aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/forcedeth.c
diff options
context:
space:
mode:
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;