diff options
author | Alexandros C. Couloumbis <alex@ozo.com> | 2010-06-17 08:17:17 +0000 |
---|---|---|
committer | Alexandros C. Couloumbis <alex@ozo.com> | 2010-06-17 08:17:17 +0000 |
commit | 36331b22ad8865d09871d3d61e8d612690f67360 (patch) | |
tree | 804dbadb50c61f399c7cf51a6738ed8757ca1963 | |
parent | 11776310f4b99c471d3443e40134d9f99e64562c (diff) | |
download | upstream-36331b22ad8865d09871d3d61e8d612690f67360.tar.gz upstream-36331b22ad8865d09871d3d61e8d612690f67360.tar.bz2 upstream-36331b22ad8865d09871d3d61e8d612690f67360.zip |
ixp4xx: (Titan Wireless 2662) check for invalid/null MAC before assigning a random one
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21825 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | target/linux/ixp4xx/patches-2.6.35/520-tw2662_support.patch | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/target/linux/ixp4xx/patches-2.6.35/520-tw2662_support.patch b/target/linux/ixp4xx/patches-2.6.35/520-tw2662_support.patch index cc796c504b..a83a15dc99 100644 --- a/target/linux/ixp4xx/patches-2.6.35/520-tw2662_support.patch +++ b/target/linux/ixp4xx/patches-2.6.35/520-tw2662_support.patch @@ -118,7 +118,7 @@ +subsys_initcall(tw2662_pci_init); --- /dev/null +++ b/arch/arm/mach-ixp4xx/tw2662-setup.c -@@ -0,0 +1,208 @@ +@@ -0,0 +1,215 @@ +/* + * arch/arm/mach-ixp4xx/tw2662-setup.c + * @@ -302,15 +302,22 @@ +static void __init tw2662_init(void) +{ + ixp4xx_sys_init(); ++ int i; + + tw2662_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); + tw2662_flash_resource.end = + IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; + + platform_add_devices(tw2662_devices, ARRAY_SIZE(tw2662_devices)); -+ /* hack MACs as most of these boards have a broken eeprom */ -+ random_ether_addr(tw2662_plat_eth[0].hwaddr); -+ random_ether_addr(tw2662_plat_eth[1].hwaddr); ++ ++ for (i = 0; i < 6; i++) ++ if (tw2662_plat_eth[0].hwaddr[i] != 0x00) ++ break; ++ if (i == 6) { ++ /* hack MACs as most of these boards have a broken eeprom */ ++ random_ether_addr(tw2662_plat_eth[0].hwaddr); ++ tw2662_plat_eth[1].hwaddr = (tw2662_plat_eth[0].hwaddr + 1); ++ } + +} + |