diff options
author | David S. Miller <davem@davemloft.net> | 2008-10-01 09:12:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-01 09:12:56 -0400 |
commit | b262e60309e1b0eb25d300c7e739427d5316abb1 (patch) | |
tree | bf319d78c79bb5cb617ff0c8340c73aa349bba15 /drivers/net/forcedeth.c | |
parent | 93c8b90f01f0dc73891da4e84b26524b61d29d66 (diff) | |
parent | 0523820482dcb42784572ffd2296c2f08c275a2b (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/ath9k/core.c
drivers/net/wireless/ath9k/main.c
net/core/dev.c
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r-- | drivers/net/forcedeth.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 35e582d3fd2a..cc7328b15521 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -5643,6 +5643,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5643 | dev->dev_addr[4] = (np->orig_mac[0] >> 8) & 0xff; | 5643 | dev->dev_addr[4] = (np->orig_mac[0] >> 8) & 0xff; |
5644 | dev->dev_addr[5] = (np->orig_mac[0] >> 0) & 0xff; | 5644 | dev->dev_addr[5] = (np->orig_mac[0] >> 0) & 0xff; |
5645 | writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll); | 5645 | writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll); |
5646 | printk(KERN_DEBUG "nv_probe: set workaround bit for reversed mac addr\n"); | ||
5646 | } | 5647 | } |
5647 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | 5648 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); |
5648 | 5649 | ||
@@ -5890,14 +5891,12 @@ static void nv_restore_phy(struct net_device *dev) | |||
5890 | } | 5891 | } |
5891 | } | 5892 | } |
5892 | 5893 | ||
5893 | static void __devexit nv_remove(struct pci_dev *pci_dev) | 5894 | static void nv_restore_mac_addr(struct pci_dev *pci_dev) |
5894 | { | 5895 | { |
5895 | struct net_device *dev = pci_get_drvdata(pci_dev); | 5896 | struct net_device *dev = pci_get_drvdata(pci_dev); |
5896 | struct fe_priv *np = netdev_priv(dev); | 5897 | struct fe_priv *np = netdev_priv(dev); |
5897 | u8 __iomem *base = get_hwbase(dev); | 5898 | u8 __iomem *base = get_hwbase(dev); |
5898 | 5899 | ||
5899 | unregister_netdev(dev); | ||
5900 | |||
5901 | /* special op: write back the misordered MAC address - otherwise | 5900 | /* special op: write back the misordered MAC address - otherwise |
5902 | * the next nv_probe would see a wrong address. | 5901 | * the next nv_probe would see a wrong address. |
5903 | */ | 5902 | */ |
@@ -5905,6 +5904,15 @@ static void __devexit nv_remove(struct pci_dev *pci_dev) | |||
5905 | writel(np->orig_mac[1], base + NvRegMacAddrB); | 5904 | writel(np->orig_mac[1], base + NvRegMacAddrB); |
5906 | writel(readl(base + NvRegTransmitPoll) & ~NVREG_TRANSMITPOLL_MAC_ADDR_REV, | 5905 | writel(readl(base + NvRegTransmitPoll) & ~NVREG_TRANSMITPOLL_MAC_ADDR_REV, |
5907 | base + NvRegTransmitPoll); | 5906 | base + NvRegTransmitPoll); |
5907 | } | ||
5908 | |||
5909 | static void __devexit nv_remove(struct pci_dev *pci_dev) | ||
5910 | { | ||
5911 | struct net_device *dev = pci_get_drvdata(pci_dev); | ||
5912 | |||
5913 | unregister_netdev(dev); | ||
5914 | |||
5915 | nv_restore_mac_addr(pci_dev); | ||
5908 | 5916 | ||
5909 | /* restore any phy related changes */ | 5917 | /* restore any phy related changes */ |
5910 | nv_restore_phy(dev); | 5918 | nv_restore_phy(dev); |
@@ -5975,6 +5983,8 @@ static void nv_shutdown(struct pci_dev *pdev) | |||
5975 | if (netif_running(dev)) | 5983 | if (netif_running(dev)) |
5976 | nv_close(dev); | 5984 | nv_close(dev); |
5977 | 5985 | ||
5986 | nv_restore_mac_addr(pdev); | ||
5987 | |||
5978 | pci_disable_device(pdev); | 5988 | pci_disable_device(pdev); |
5979 | if (system_state == SYSTEM_POWER_OFF) { | 5989 | if (system_state == SYSTEM_POWER_OFF) { |
5980 | if (pci_enable_wake(pdev, PCI_D3cold, np->wolenabled)) | 5990 | if (pci_enable_wake(pdev, PCI_D3cold, np->wolenabled)) |