diff options
author | Chris Snook <csnook@redhat.com> | 2007-03-28 20:51:51 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-03-29 08:26:05 -0400 |
commit | 8c754a04ff11a9c1107c134ad5a858e9dc08c1de (patch) | |
tree | 946448901e0d9e460a7d0f049bd329809409f19f /drivers/net/atl1/atl1_main.c | |
parent | 190a4408ecb577391ea5fbd1f90148a6992a5756 (diff) |
atl1: save mac address on remove
Some atl1 boards get their MAC address written directly to the register
by the BIOS during POST, rather than storing it in EEPROM that's
accessible to the driver. If the MAC register on one of these boards
is changed and then the module is unloaded, the permanent MAC address
will be forgotten until the box is rebooted. We should save the
permanent address during removal if we've been messing with it.
Signed-off-by: Chris Snook <csnook@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/atl1/atl1_main.c')
-rw-r--r-- | drivers/net/atl1/atl1_main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c index dee3638ad744..8606eac5bec8 100644 --- a/drivers/net/atl1/atl1_main.c +++ b/drivers/net/atl1/atl1_main.c | |||
@@ -2320,6 +2320,16 @@ static void __devexit atl1_remove(struct pci_dev *pdev) | |||
2320 | return; | 2320 | return; |
2321 | 2321 | ||
2322 | adapter = netdev_priv(netdev); | 2322 | adapter = netdev_priv(netdev); |
2323 | |||
2324 | /* Some atl1 boards lack persistent storage for their MAC, and get it | ||
2325 | * from the BIOS during POST. If we've been messing with the MAC | ||
2326 | * address, we need to save the permanent one. | ||
2327 | */ | ||
2328 | if (memcmp(adapter->hw.mac_addr, adapter->hw.perm_mac_addr, ETH_ALEN)) { | ||
2329 | memcpy(adapter->hw.mac_addr, adapter->hw.perm_mac_addr, ETH_ALEN); | ||
2330 | atl1_set_mac_addr(&adapter->hw); | ||
2331 | } | ||
2332 | |||
2323 | iowrite16(0, adapter->hw.hw_addr + REG_GPHY_ENABLE); | 2333 | iowrite16(0, adapter->hw.hw_addr + REG_GPHY_ENABLE); |
2324 | unregister_netdev(netdev); | 2334 | unregister_netdev(netdev); |
2325 | pci_iounmap(pdev, adapter->hw.hw_addr); | 2335 | pci_iounmap(pdev, adapter->hw.hw_addr); |