diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2011-04-12 01:30:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-12 17:56:00 -0400 |
commit | efa2ad8918afc2f5e4ea533110758b26991f1937 (patch) | |
tree | e1c5072a205caafd2959dbd389a907132e84fe66 /drivers/net | |
parent | 0e08785845093ef4ed220463a739bc8d0db95de7 (diff) |
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/sis900.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index cb317cd069ff..484f795a779d 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
@@ -240,7 +240,8 @@ static const struct ethtool_ops sis900_ethtool_ops; | |||
240 | * @net_dev: the net device to get address for | 240 | * @net_dev: the net device to get address for |
241 | * | 241 | * |
242 | * Older SiS900 and friends, use EEPROM to store MAC address. | 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 | static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_device *net_dev) | 247 | static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_device *net_dev) |
@@ -261,6 +262,9 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de | |||
261 | for (i = 0; i < 3; i++) | 262 | for (i = 0; i < 3; i++) |
262 | ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr); | 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 | return 1; | 268 | return 1; |
265 | } | 269 | } |
266 | 270 | ||
@@ -271,7 +275,8 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de | |||
271 | * | 275 | * |
272 | * SiS630E model, use APC CMOS RAM to store MAC address. | 276 | * SiS630E model, use APC CMOS RAM to store MAC address. |
273 | * APC CMOS RAM is accessed through ISA bridge. | 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 | static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, | 282 | static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, |
@@ -296,6 +301,10 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, | |||
296 | outb(0x09 + i, 0x70); | 301 | outb(0x09 + i, 0x70); |
297 | ((u8 *)(net_dev->dev_addr))[i] = inb(0x71); | 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 | pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40); | 308 | pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40); |
300 | pci_dev_put(isa_bridge); | 309 | pci_dev_put(isa_bridge); |
301 | 310 | ||
@@ -310,7 +319,7 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, | |||
310 | * | 319 | * |
311 | * SiS635 model, set MAC Reload Bit to load Mac address from APC | 320 | * 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 | 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 | static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, | 325 | static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, |
@@ -334,6 +343,9 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, | |||
334 | *( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr); | 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 | /* enable packet filtering */ | 349 | /* enable packet filtering */ |
338 | outl(rfcrSave | RFEN, rfcr + ioaddr); | 350 | outl(rfcrSave | RFEN, rfcr + ioaddr); |
339 | 351 | ||
@@ -353,7 +365,7 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, | |||
353 | * EEDONE signal to refuse EEPROM access by LAN. | 365 | * EEDONE signal to refuse EEPROM access by LAN. |
354 | * The EEPROM map of SiS962 or SiS963 is different to SiS900. | 366 | * The EEPROM map of SiS962 or SiS963 is different to SiS900. |
355 | * The signature field in SiS962 or SiS963 spec is meaningless. | 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 | static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev, | 371 | static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev, |
@@ -372,6 +384,9 @@ static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev, | |||
372 | for (i = 0; i < 3; i++) | 384 | for (i = 0; i < 3; i++) |
373 | ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr); | 385 | ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr); |
374 | 386 | ||
387 | /* Store MAC Address in perm_addr */ | ||
388 | memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN); | ||
389 | |||
375 | outl(EEDONE, ee_addr); | 390 | outl(EEDONE, ee_addr); |
376 | return 1; | 391 | return 1; |
377 | } else { | 392 | } else { |