From a5e7d0948712fff19bcafa3f61dda44a5cb293fd Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Sat, 13 Oct 2012 17:46:54 +0000 Subject: [PATCH] acx-mac80211: fetch WLAN MAC address from PROM environment Patch from Daniel Gimpelevich. SVN-Revision: 33747 --- .../patches/200-initial-macaddr.patch | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 package/acx-mac80211/patches/200-initial-macaddr.patch diff --git a/package/acx-mac80211/patches/200-initial-macaddr.patch b/package/acx-mac80211/patches/200-initial-macaddr.patch new file mode 100644 index 0000000000..498c72dd85 --- /dev/null +++ b/package/acx-mac80211/patches/200-initial-macaddr.patch @@ -0,0 +1,31 @@ +--- a/cardsetting.c 2012-07-03 16:21:25.934102662 -0700 ++++ b/cardsetting.c 2012-07-03 16:49:26.910438174 -0700 +@@ -710,12 +710,27 @@ + u8 stationID[4 + acx_ie_descs[ACX1xx_IE_DOT11_STATION_ID].len]; + const u8 *paddr; + int i, res; ++ const char *prom_addr; ++ char *prom_getenv(const char *name); + + + + res = acx_interrogate(adev, &stationID, ACX1xx_IE_DOT11_STATION_ID); + paddr = &stationID[4]; +- for (i = 0; i < ETH_ALEN; i++) { ++ prom_addr = NULL; ++#ifdef CONFIG_VLYNQ ++ prom_addr = prom_getenv("macwlan"); ++ if (prom_addr == NULL) ++ prom_addr = prom_getenv("mac_ap"); ++#endif ++ if (prom_addr) ++ sscanf(prom_addr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", adev->dev_addr, ++ adev->dev_addr + 1, ++ adev->dev_addr + 2, ++ adev->dev_addr + 3, ++ adev->dev_addr + 4, ++ adev->dev_addr + 5); ++ else for (i = 0; i < ETH_ALEN; i++) { + /* we copy the MAC address (reversed in the card) to + * the netdevice's MAC address, and on ifup it will be + * copied into iwadev->dev_addr */ -- 2.25.1