[OpenWrt-Devel] [PATCH 2/3] ar71xx: WNR612v2: fix for random WLAN MAC

Michal michal.cieslakiewicz at wp.pl
Sun Feb 21 17:06:11 EST 2016

From: Michal Cieslakiewicz <michal.cieslakiewicz at wp.pl>
Date: Sun, 21 Feb 2016 18:18:11 +0100
Subject: [PATCH 2/3] ar71xx: WNR612v2: fix for random WLAN MAC

Fix for invalid/random WLAN MAC address in WNR612v2. Permanent platform
MAC is calculated and assigned during system startup. WLAN MAC follows
wired Ethernet interface addresses. This is the same fix as for WNR2000v3.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz at wp.pl>
 Note: This patchset requires the other patchset applied as it
 relies heavily on functionality provided there and modifies
 the same files (WNR612v2 is a smaller version of WNR2000v3):

 [PATCH v4 1/8] mac80211: ath9k: enable platform WLAN LED name
 [PATCH v4 2/8] mac80211: ath9k: set default state for platform LEDs
 [PATCH v4 3/8] mac80211: ath9k: show platform MAC address in kernel
 [PATCH v4 4/8] mac80211: ath9k: enable access to GPIO
 [PATCH v5 5/8] mac80211: ath9k: enable GPIO buttons
 ([PATCH v5 6/8] ar71xx: WNR2000v3: exclude USB modules from image - in trunk now)
 [PATCH v5 7/8] ar71xx: WNR2000v3: fix for random WLAN MAC
 [PATCH v5 8/8] ar71xx: WNR2000v3: enable control of all LEDs and buttons

 target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v3.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v3.c
index 31eb079..f29086b 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v3.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnr2000-v3.c
@@ -80,6 +80,7 @@
 #define WNR2000V3_KEYS_POLL_INTERVAL	20	/* msecs */
+/* ART offsets for: WNR2000v3, WNR612v2 */
 #define WNR2000V3_MAC0_OFFSET		0
 #define WNR2000V3_MAC1_OFFSET		6
 #define WNR2000V3_PCIE_CALDATA_OFFSET	0x1000
@@ -372,7 +373,12 @@ MIPS_MACHINE(ATH79_MACH_WNR2000_V3, "WNR2000V3", "NETGEAR WNR2000 V3", wnr2000v3
 static void __init wnr612v2_setup(void)
-	wnr_common_setup(NULL);
+	u8 wlan_mac_addr[6];
+	wnr_get_wmac(wlan_mac_addr, WNR2000V3_MAC0_OFFSET,
+		     WNR2000V3_MAC1_OFFSET, WNR2000V3_WMAC_OFFSET);
+	wnr_common_setup(wlan_mac_addr);
 	ath79_register_leds_gpio(-1, ARRAY_SIZE(wnr612v2_leds_gpio),
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list