Changeset 29675


Ignore:
Timestamp:
2012-01-07T18:24:44+01:00 (6 years ago)
Author:
juhosg
Message:

ar71xx: local mac support on the wndr3700

The wndr3700 at least has no eth0 mac address and usually leverages
the first wireless device's mac when in a bridged scenario. If,
however, you want to route, and not bridge the interfaces, you
need a unique mac address for it.

This patch sets the local bit on the mac address pulled from the
wireless chip and uses the resulting address for eth0.

Patch-by: Dave Taht <dave.taht@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c

    r29513 r29675  
    112112}; 
    113113 
     114/* 
     115 * The eth0 and wmac0 interfaces share the same MAC address which 
     116 * can lead to problems if operated unbridged. Set the locally 
     117 * administered bit on the eth0 MAC to make it unique. 
     118 */ 
     119 
     120static void __init wndr3700_init_local_mac(unsigned char *mac_base) 
     121{ 
     122        ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac_base, 0); 
     123        ar71xx_eth0_data.mac_addr[0] |= 0x02; 
     124} 
     125 
    114126static void __init wndr3700_setup(void) 
    115127{ 
    116128        u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); 
    117129 
    118         ar71xx_init_mac(ar71xx_eth0_data.mac_addr, 
    119                         art + WNDR3700_ETH0_MAC_OFFSET, 0); 
     130        wndr3700_init_local_mac(art + WNDR3700_ETH0_MAC_OFFSET); 
    120131        ar71xx_eth0_pll_data.pll_1000 = 0x11110000; 
    121132        ar71xx_eth0_data.mii_bus_dev = &wndr3700_rtl8366s_device.dev; 
Note: See TracChangeset for help on using the changeset viewer.