1
0

200-initial-macaddr.patch 923 B

1234567891011121314151617181920212223242526272829
  1. --- a/cardsetting.c
  2. +++ b/cardsetting.c
  3. @@ -715,10 +715,25 @@ int acx1xx_get_station_id(acx_device_t *
  4. u8 *stationID = adev->ie_cmd_buf;
  5. const u8 *paddr;
  6. int i, res;
  7. + const char *prom_addr;
  8. + char *prom_getenv(const char *name);
  9. res = acx_interrogate(adev, stationID, ACX1xx_IE_DOT11_STATION_ID);
  10. paddr = &stationID[4];
  11. - for (i = 0; i < ETH_ALEN; i++) {
  12. + prom_addr = NULL;
  13. +#ifdef CONFIG_VLYNQ
  14. + prom_addr = prom_getenv("macwlan");
  15. + if (prom_addr == NULL)
  16. + prom_addr = prom_getenv("mac_ap");
  17. +#endif
  18. + if (prom_addr)
  19. + sscanf(prom_addr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", adev->dev_addr,
  20. + adev->dev_addr + 1,
  21. + adev->dev_addr + 2,
  22. + adev->dev_addr + 3,
  23. + adev->dev_addr + 4,
  24. + adev->dev_addr + 5);
  25. + else for (i = 0; i < ETH_ALEN; i++) {
  26. /* we copy the MAC address (reversed in the card) to
  27. * the netdevice's MAC address, and on ifup it will be
  28. * copied into iwadev->dev_addr */