summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx/files/arch/mips
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-01-07 17:24:44 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-01-07 17:24:44 +0000
commit54bc3d42c433d28002eb518e7b292efca5728a8d (patch)
tree331540487ff5489befafb0afa1989fcf48cffe70 /target/linux/ar71xx/files/arch/mips
parentc2243d1fb9e44f9f4dbf83f8e85b4d52b30aea82 (diff)
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@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29675 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/arch/mips')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
index cfd0ba90c9..c708b97d93 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c
@@ -111,12 +111,23 @@ static struct platform_device wndr3700_rtl8366s_device = {
}
};
+/*
+ * The eth0 and wmac0 interfaces share the same MAC address which
+ * can lead to problems if operated unbridged. Set the locally
+ * administered bit on the eth0 MAC to make it unique.
+ */
+
+static void __init wndr3700_init_local_mac(unsigned char *mac_base)
+{
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac_base, 0);
+ ar71xx_eth0_data.mac_addr[0] |= 0x02;
+}
+
static void __init wndr3700_setup(void)
{
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
- ar71xx_init_mac(ar71xx_eth0_data.mac_addr,
- art + WNDR3700_ETH0_MAC_OFFSET, 0);
+ wndr3700_init_local_mac(art + WNDR3700_ETH0_MAC_OFFSET);
ar71xx_eth0_pll_data.pll_1000 = 0x11110000;
ar71xx_eth0_data.mii_bus_dev = &wndr3700_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;