Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2e3884b5b16795c03a7bf295797c1b2402885b88
Commit:     2e3884b5b16795c03a7bf295797c1b2402885b88
Parent:     1d39da3dcaad4231f0fa75024b1d6d710a2ced74
Author:     Bj�rn Steinbrink <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 7 23:22:53 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Jan 8 23:30:20 2008 -0800

    [FORCEDETH]: Fix reversing the MAC address on suspend.
    
    For cards that initially have the MAC address stored in reverse order,
    the forcedeth driver uses a flag to signal whether the address was
    already corrected, so that it is not reversed again on a subsequent
    probe.
    
    Unfortunately this flag, which is stored in a register of the card,
    seems to get lost during suspend, resulting in the MAC address being
    reversed again. To fix that, the MAC address needs to be written back
    in reversed order before we suspend and the flag needs to be reset.
    
    The flag is still required because at least kexec will never write
    back the reversed address and thus needs to know what state the card
    is in.
    
    Signed-off-by: Bj�rn Steinbrink <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/forcedeth.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index a96583c..f84c752 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -5199,10 +5199,6 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, 
const struct pci_device_i
                dev->dev_addr[3] = (np->orig_mac[0] >> 16) & 0xff;
                dev->dev_addr[4] = (np->orig_mac[0] >>  8) & 0xff;
                dev->dev_addr[5] = (np->orig_mac[0] >>  0) & 0xff;
-               /* set permanent address to be correct aswell */
-               np->orig_mac[0] = (dev->dev_addr[0] << 0) + (dev->dev_addr[1] 
<< 8) +
-                       (dev->dev_addr[2] << 16) + (dev->dev_addr[3] << 24);
-               np->orig_mac[1] = (dev->dev_addr[4] << 0) + (dev->dev_addr[5] 
<< 8);
                writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + 
NvRegTransmitPoll);
        }
        memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
@@ -5414,6 +5410,8 @@ static void __devexit nv_remove(struct pci_dev *pci_dev)
         */
        writel(np->orig_mac[0], base + NvRegMacAddrA);
        writel(np->orig_mac[1], base + NvRegMacAddrB);
+       writel(readl(base + NvRegTransmitPoll) & 
~NVREG_TRANSMITPOLL_MAC_ADDR_REV,
+              base + NvRegTransmitPoll);
 
        /* free all structures */
        free_rings(dev);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to