]> git.baikalelectronics.ru Git - kernel.git/commit
tg3: fix big endian MAC address collection failure
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 13 Apr 2009 21:31:51 +0000 (14:31 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Apr 2009 21:31:51 +0000 (14:31 -0700)
commit0b42398e2c01411d62f1d269ee456ce29c4e737e
tree2bf15701525b016ed62eae461725e2c6e12b1d8a
parent8dbf73683455f4554b439d0e22b7bb12f9a1305a
tg3: fix big endian MAC address collection failure

We noticed on parisc that our broadcoms all swapped MAC addresses going
from 2.6.29 to 2.6.30-rc1:

Apr 11 07:48:24 ion kernel: eth0: Tigon3 [partno(BCM95700A6) rev 0105] (PCI:66MHz:64-bit) MAC address 00:30:6e:4b:15:59
Apr 13 07:34:34 ion kernel: eth0: Tigon3 [partno(BCM95700A6) rev 0105] (PCI:66MHz:64-bit) MAC address 00:00:59:15:4b:6e

The problem patch is:

commit 56bce3a4eadf158f9f31f073fc385a1315dca101
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Wed Feb 25 14:25:52 2009 +0000

    tg3: Eliminate tg3_nvram_read_swab()

With the root cause being the use of memcpy to set the mac address:

   memcpy(&dev->dev_addr[0], ((char *)&hi) + 2, 2);
   memcpy(&dev->dev_addr[2], (char *)&lo, sizeof(lo));

This might work on little endian machines, but it can't on big endian
ones.  You have to use the original setting mechanism to be correct on
all architectures.

The attached patch fixes parisc.

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c