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