Re: [OpenWrt-Devel] ar71xx: local mac support on the wndr3700?

2012-01-11 Thread Mark Mentovai
Dave Taht wrote:
> [PATCH 4/4] Add local mac support to wndr3700 so as to be able to
> route not bridge
>
> 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.

It’s unfortunate that in the default bridged configuration now, br-lan
uses a MAC address with the locally-administered bit set.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] ar71xx: local mac support on the wndr3700?

2012-01-06 Thread Dave Taht
On Thu, Jan 5, 2012 at 10:09 PM, Gabor Juhos  wrote:
> Please remove the ar71xx_eth{0,1}_data.* initialization. Those values are
> configured automatically for AR7240 since r29103.

I have been carrying this patch (of yours?) forward for a while,
in order to get routable ethernet interfaces on the wndr3700 and
wndr3800. Am I doing it in the right place?

One thing I've noticed on my recent builds (3.1.6) is that hostapd
eats cpu when the wireless is not in use, and the wired interface
is being loaded up. (top shows a hostapd eating up to 40% of
cpu while I'm doing a big transfer over the two ethernet interfaces
- and my transfer rates have dropped since I last did benchmarking)

I've been doing debugging on other quarters, but perhaps
this is significant, or another problem... The mac address DOES
show up as changed, but maybe the driver or hostapd is confused?

[PATCH 4/4] Add local mac support to wndr3700 so as to be able to
route not bridge

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.
---
 .../ar71xx/files/arch/mips/ar71xx/mach-wndr3700.c  |   15 +--
 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 cfd0ba9..c708b97 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(0x1fff);

-   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 = 0x;
ar71xx_eth0_data.mii_bus_dev = &wndr3700_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
-- 
1.7.1


-- 
Dave Täht
SKYPE: davetaht
US Tel: 1-239-829-5608
FR Tel: 0638645374
http://www.bufferbloat.net
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel