aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/forcedeth.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-14 05:30:23 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-14 05:30:23 -0400
commitdf39e8ba56a788733d369068c7319e04b1da3cd5 (patch)
tree1e9be853bdb455e341cdbf957656f342cfa2eb9e /drivers/net/forcedeth.c
parentf5572855ec492334d8c3ec0e0e86c31865d5cf07 (diff)
parent159d83363b629c91d020734207c1bc788b96af5a (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/ehea/ehea_main.c drivers/net/wireless/iwlwifi/Kconfig drivers/net/wireless/rt2x00/rt61pci.c net/ipv4/inet_timewait_sock.c net/ipv6/raw.c net/mac80211/ieee80211_sta.c
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r--drivers/net/forcedeth.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 4708a1631925..3338b115fa66 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -2112,9 +2112,8 @@ static inline void nv_tx_flip_ownership(struct net_device *dev)
2112 2112
2113 np->tx_pkts_in_progress--; 2113 np->tx_pkts_in_progress--;
2114 if (np->tx_change_owner) { 2114 if (np->tx_change_owner) {
2115 __le32 flaglen = le32_to_cpu(np->tx_change_owner->first_tx_desc->flaglen); 2115 np->tx_change_owner->first_tx_desc->flaglen |=
2116 flaglen |= NV_TX2_VALID; 2116 cpu_to_le32(NV_TX2_VALID);
2117 np->tx_change_owner->first_tx_desc->flaglen = cpu_to_le32(flaglen);
2118 np->tx_pkts_in_progress++; 2117 np->tx_pkts_in_progress++;
2119 2118
2120 np->tx_change_owner = np->tx_change_owner->next_tx_ctx; 2119 np->tx_change_owner = np->tx_change_owner->next_tx_ctx;
@@ -5319,8 +5318,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5319 5318
5320 /* check the workaround bit for correct mac address order */ 5319 /* check the workaround bit for correct mac address order */
5321 txreg = readl(base + NvRegTransmitPoll); 5320 txreg = readl(base + NvRegTransmitPoll);
5322 if ((txreg & NVREG_TRANSMITPOLL_MAC_ADDR_REV) || 5321 if (id->driver_data & DEV_HAS_CORRECT_MACADDR) {
5323 (id->driver_data & DEV_HAS_CORRECT_MACADDR)) {
5324 /* mac address is already in correct order */ 5322 /* mac address is already in correct order */
5325 dev->dev_addr[0] = (np->orig_mac[0] >> 0) & 0xff; 5323 dev->dev_addr[0] = (np->orig_mac[0] >> 0) & 0xff;
5326 dev->dev_addr[1] = (np->orig_mac[0] >> 8) & 0xff; 5324 dev->dev_addr[1] = (np->orig_mac[0] >> 8) & 0xff;
@@ -5328,6 +5326,22 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5328 dev->dev_addr[3] = (np->orig_mac[0] >> 24) & 0xff; 5326 dev->dev_addr[3] = (np->orig_mac[0] >> 24) & 0xff;
5329 dev->dev_addr[4] = (np->orig_mac[1] >> 0) & 0xff; 5327 dev->dev_addr[4] = (np->orig_mac[1] >> 0) & 0xff;
5330 dev->dev_addr[5] = (np->orig_mac[1] >> 8) & 0xff; 5328 dev->dev_addr[5] = (np->orig_mac[1] >> 8) & 0xff;
5329 } else if (txreg & NVREG_TRANSMITPOLL_MAC_ADDR_REV) {
5330 /* mac address is already in correct order */
5331 dev->dev_addr[0] = (np->orig_mac[0] >> 0) & 0xff;
5332 dev->dev_addr[1] = (np->orig_mac[0] >> 8) & 0xff;
5333 dev->dev_addr[2] = (np->orig_mac[0] >> 16) & 0xff;
5334 dev->dev_addr[3] = (np->orig_mac[0] >> 24) & 0xff;
5335 dev->dev_addr[4] = (np->orig_mac[1] >> 0) & 0xff;
5336 dev->dev_addr[5] = (np->orig_mac[1] >> 8) & 0xff;
5337 /*
5338 * Set orig mac address back to the reversed version.
5339 * This flag will be cleared during low power transition.
5340 * Therefore, we should always put back the reversed address.
5341 */
5342 np->orig_mac[0] = (dev->dev_addr[5] << 0) + (dev->dev_addr[4] << 8) +
5343 (dev->dev_addr[3] << 16) + (dev->dev_addr[2] << 24);
5344 np->orig_mac[1] = (dev->dev_addr[1] << 0) + (dev->dev_addr[0] << 8);
5331 } else { 5345 } else {
5332 /* need to reverse mac address to correct order */ 5346 /* need to reverse mac address to correct order */
5333 dev->dev_addr[0] = (np->orig_mac[1] >> 8) & 0xff; 5347 dev->dev_addr[0] = (np->orig_mac[1] >> 8) & 0xff;
@@ -5598,7 +5612,9 @@ out:
5598static int nv_resume(struct pci_dev *pdev) 5612static int nv_resume(struct pci_dev *pdev)
5599{ 5613{
5600 struct net_device *dev = pci_get_drvdata(pdev); 5614 struct net_device *dev = pci_get_drvdata(pdev);
5615 u8 __iomem *base = get_hwbase(dev);
5601 int rc = 0; 5616 int rc = 0;
5617 u32 txreg;
5602 5618
5603 if (!netif_running(dev)) 5619 if (!netif_running(dev))
5604 goto out; 5620 goto out;
@@ -5609,6 +5625,11 @@ static int nv_resume(struct pci_dev *pdev)
5609 pci_restore_state(pdev); 5625 pci_restore_state(pdev);
5610 pci_enable_wake(pdev, PCI_D0, 0); 5626 pci_enable_wake(pdev, PCI_D0, 0);
5611 5627
5628 /* restore mac address reverse flag */
5629 txreg = readl(base + NvRegTransmitPoll);
5630 txreg |= NVREG_TRANSMITPOLL_MAC_ADDR_REV;
5631 writel(txreg, base + NvRegTransmitPoll);
5632
5612 rc = nv_open(dev); 5633 rc = nv_open(dev);
5613out: 5634out:
5614 return rc; 5635 return rc;