net/sis900: store MAC into perm_addr for SiS 900, 630E, 635 and 96x variants

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Otavio Salvador and committed by David S. Miller efa2ad89 0e087858

+19 -4
+19 -4
drivers/net/sis900.c
··· 240 240 * @net_dev: the net device to get address for 241 241 * 242 242 * Older SiS900 and friends, use EEPROM to store MAC address. 243 - * MAC address is read from read_eeprom() into @net_dev->dev_addr. 243 + * MAC address is read from read_eeprom() into @net_dev->dev_addr and 244 + * @net_dev->perm_addr. 244 245 */ 245 246 246 247 static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_device *net_dev) ··· 262 261 for (i = 0; i < 3; i++) 263 262 ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr); 264 263 264 + /* Store MAC Address in perm_addr */ 265 + memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN); 266 + 265 267 return 1; 266 268 } 267 269 ··· 275 271 * 276 272 * SiS630E model, use APC CMOS RAM to store MAC address. 277 273 * APC CMOS RAM is accessed through ISA bridge. 278 - * MAC address is read into @net_dev->dev_addr. 274 + * MAC address is read into @net_dev->dev_addr and 275 + * @net_dev->perm_addr. 279 276 */ 280 277 281 278 static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, ··· 301 296 outb(0x09 + i, 0x70); 302 297 ((u8 *)(net_dev->dev_addr))[i] = inb(0x71); 303 298 } 299 + 300 + /* Store MAC Address in perm_addr */ 301 + memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN); 302 + 304 303 pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40); 305 304 pci_dev_put(isa_bridge); 306 305 ··· 319 310 * 320 311 * SiS635 model, set MAC Reload Bit to load Mac address from APC 321 312 * to rfdr. rfdr is accessed through rfcr. MAC address is read into 322 - * @net_dev->dev_addr. 313 + * @net_dev->dev_addr and @net_dev->perm_addr. 323 314 */ 324 315 325 316 static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, ··· 343 334 *( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr); 344 335 } 345 336 337 + /* Store MAC Address in perm_addr */ 338 + memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN); 339 + 346 340 /* enable packet filtering */ 347 341 outl(rfcrSave | RFEN, rfcr + ioaddr); 348 342 ··· 365 353 * EEDONE signal to refuse EEPROM access by LAN. 366 354 * The EEPROM map of SiS962 or SiS963 is different to SiS900. 367 355 * The signature field in SiS962 or SiS963 spec is meaningless. 368 - * MAC address is read into @net_dev->dev_addr. 356 + * MAC address is read into @net_dev->dev_addr and @net_dev->perm_addr. 369 357 */ 370 358 371 359 static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev, ··· 383 371 /* get MAC address from EEPROM */ 384 372 for (i = 0; i < 3; i++) 385 373 ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr); 374 + 375 + /* Store MAC Address in perm_addr */ 376 + memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN); 386 377 387 378 outl(EEDONE, ee_addr); 388 379 return 1;