lantiq: Tune the XWAY subtarget cflags
[openwrt.git] / package / acx-mac80211 / patches / 200-initial-macaddr.patch
1 --- a/cardsetting.c
2 +++ b/cardsetting.c
3 @@ -710,12 +710,27 @@ static int acx1xx_get_station_id(acx_dev
4         u8 stationID[4 + acx_ie_descs[ACX1xx_IE_DOT11_STATION_ID].len];
5         const u8 *paddr;
6         int i, res;
7 +       const char *prom_addr;
8 +       char *prom_getenv(const char *name);
9  
10  
11  
12         res = acx_interrogate(adev, &stationID, ACX1xx_IE_DOT11_STATION_ID);
13         paddr = &stationID[4];
14 -       for (i = 0; i < ETH_ALEN; i++) {
15 +       prom_addr = NULL;
16 +#ifdef CONFIG_VLYNQ
17 +       prom_addr = prom_getenv("macwlan");
18 +       if (prom_addr == NULL)
19 +               prom_addr = prom_getenv("mac_ap");
20 +#endif
21 +       if (prom_addr)
22 +               sscanf(prom_addr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", adev->dev_addr,
23 +                               adev->dev_addr + 1,
24 +                               adev->dev_addr + 2,
25 +                               adev->dev_addr + 3,
26 +                               adev->dev_addr + 4,
27 +                               adev->dev_addr + 5);
28 +       else for (i = 0; i < ETH_ALEN; i++) {
29                 /* we copy the MAC address (reversed in the card) to
30                  * the netdevice's MAC address, and on ifup it will be
31                  * copied into iwadev->dev_addr */