Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=edba2a1fefc6296bc527754dee1c72a625bb675a
Commit:     edba2a1fefc6296bc527754dee1c72a625bb675a
Parent:     9a262d5c24c63d2b7bea05e41d9b3bfbef63e903
Author:     Thomas Bogendoerfer <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 6 00:21:47 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Tue Jan 8 23:30:00 2008 -0800

    [METH]: Fix MAC address handling.
    
    meth didn't set a valid mac address during probing, but later during
    open. Newer kernel refuse to open device with 00:00:00:00:00:00 as mac
    address -> dead ethernet. This patch sets the mac address in the probe
    function and uses only the mac address from the netdevice struct when
    setting up the hardware.
    
    Signed-off-by: Thomas Bogendoerfer <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/meth.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/meth.c b/drivers/net/meth.c
index 0c89b02..cdaa8fc 100644
--- a/drivers/net/meth.c
+++ b/drivers/net/meth.c
@@ -95,11 +95,14 @@ static inline void load_eaddr(struct net_device *dev)
 {
        int i;
        DECLARE_MAC_BUF(mac);
+       u64 macaddr;
 
-       for (i = 0; i < 6; i++)
-               dev->dev_addr[i] = o2meth_eaddr[i];
        DPRINTK("Loading MAC Address: %s\n", print_mac(mac, dev->dev_addr));
-       mace->eth.mac_addr = (*(unsigned long*)o2meth_eaddr) >> 16;
+       macaddr = 0;
+       for (i = 0; i < 6; i++)
+               macaddr |= dev->dev_addr[i] << ((5 - i) * 8);
+
+       mace->eth.mac_addr = macaddr;
 }
 
 /*
@@ -794,6 +797,7 @@ static int __init meth_probe(struct platform_device *pdev)
 #endif
        dev->irq             = MACE_ETHERNET_IRQ;
        dev->base_addr       = (unsigned long)&mace->eth;
+       memcpy(dev->dev_addr, o2meth_eaddr, 6);
 
        priv = netdev_priv(dev);
        spin_lock_init(&priv->meth_lock);
-
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