Commit efa2ad8918afc2f5e4ea533110758b26991f1937
Committed by
David S. Miller
1 parent
0e08785845
Exists in
master
and in
7 other branches
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>
Showing 1 changed file with 19 additions and 4 deletions Side-by-side Diff
drivers/net/sis900.c
... | ... | @@ -240,7 +240,8 @@ |
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) |
... | ... | @@ -261,6 +262,9 @@ |
261 | 262 | for (i = 0; i < 3; i++) |
262 | 263 | ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr); |
263 | 264 | |
265 | + /* Store MAC Address in perm_addr */ | |
266 | + memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN); | |
267 | + | |
264 | 268 | return 1; |
265 | 269 | } |
266 | 270 | |
... | ... | @@ -271,7 +275,8 @@ |
271 | 275 | * |
272 | 276 | * SiS630E model, use APC CMOS RAM to store MAC address. |
273 | 277 | * APC CMOS RAM is accessed through ISA bridge. |
274 | - * MAC address is read into @net_dev->dev_addr. | |
278 | + * MAC address is read into @net_dev->dev_addr and | |
279 | + * @net_dev->perm_addr. | |
275 | 280 | */ |
276 | 281 | |
277 | 282 | static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, |
... | ... | @@ -296,6 +301,10 @@ |
296 | 301 | outb(0x09 + i, 0x70); |
297 | 302 | ((u8 *)(net_dev->dev_addr))[i] = inb(0x71); |
298 | 303 | } |
304 | + | |
305 | + /* Store MAC Address in perm_addr */ | |
306 | + memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN); | |
307 | + | |
299 | 308 | pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40); |
300 | 309 | pci_dev_put(isa_bridge); |
301 | 310 | |
... | ... | @@ -310,7 +319,7 @@ |
310 | 319 | * |
311 | 320 | * SiS635 model, set MAC Reload Bit to load Mac address from APC |
312 | 321 | * to rfdr. rfdr is accessed through rfcr. MAC address is read into |
313 | - * @net_dev->dev_addr. | |
322 | + * @net_dev->dev_addr and @net_dev->perm_addr. | |
314 | 323 | */ |
315 | 324 | |
316 | 325 | static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, |
... | ... | @@ -334,6 +343,9 @@ |
334 | 343 | *( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr); |
335 | 344 | } |
336 | 345 | |
346 | + /* Store MAC Address in perm_addr */ | |
347 | + memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN); | |
348 | + | |
337 | 349 | /* enable packet filtering */ |
338 | 350 | outl(rfcrSave | RFEN, rfcr + ioaddr); |
339 | 351 | |
... | ... | @@ -353,7 +365,7 @@ |
353 | 365 | * EEDONE signal to refuse EEPROM access by LAN. |
354 | 366 | * The EEPROM map of SiS962 or SiS963 is different to SiS900. |
355 | 367 | * The signature field in SiS962 or SiS963 spec is meaningless. |
356 | - * MAC address is read into @net_dev->dev_addr. | |
368 | + * MAC address is read into @net_dev->dev_addr and @net_dev->perm_addr. | |
357 | 369 | */ |
358 | 370 | |
359 | 371 | static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev, |
... | ... | @@ -371,6 +383,9 @@ |
371 | 383 | /* get MAC address from EEPROM */ |
372 | 384 | for (i = 0; i < 3; i++) |
373 | 385 | ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr); |
386 | + | |
387 | + /* Store MAC Address in perm_addr */ | |
388 | + memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN); | |
374 | 389 | |
375 | 390 | outl(EEDONE, ee_addr); |
376 | 391 | return 1; |