diff options
author | Luciano Coelho <coelho@ti.com> | 2013-05-08 05:54:56 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2013-06-17 05:03:41 -0400 |
commit | bc2ab3b850a8c563b3910f396e5f0753ce855134 (patch) | |
tree | aeeab46795fe3305685df2b6955e9d80f0eb0fef /drivers/net/wireless/ti/wl18xx/main.c | |
parent | 6f0b1bb2ba2b1df781c64fff645c3fe0495b8161 (diff) |
wl18xx: use locally administered MAC address if not available from fuse
In some R&D chips, the device may be left untrimmed and with the MAC
address missing from fuse ROM. In order to support those devices,
apply a random locally administered MAC address instead.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx/main.c')
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index ae85ae46c61b..7aa0eb848c5a 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | #include <linux/ip.h> | 24 | #include <linux/ip.h> |
25 | #include <linux/firmware.h> | 25 | #include <linux/firmware.h> |
26 | #include <linux/etherdevice.h> | ||
26 | 27 | ||
27 | #include "../wlcore/wlcore.h" | 28 | #include "../wlcore/wlcore.h" |
28 | #include "../wlcore/debug.h" | 29 | #include "../wlcore/debug.h" |
@@ -1318,6 +1319,16 @@ static int wl18xx_get_mac(struct wl1271 *wl) | |||
1318 | ((mac1 & 0xff000000) >> 24); | 1319 | ((mac1 & 0xff000000) >> 24); |
1319 | wl->fuse_nic_addr = (mac1 & 0xffffff); | 1320 | wl->fuse_nic_addr = (mac1 & 0xffffff); |
1320 | 1321 | ||
1322 | if (!wl->fuse_oui_addr && !wl->fuse_nic_addr) { | ||
1323 | u8 mac[ETH_ALEN]; | ||
1324 | |||
1325 | eth_random_addr(mac); | ||
1326 | |||
1327 | wl->fuse_oui_addr = (mac[0] << 16) + (mac[1] << 8) + mac[2]; | ||
1328 | wl->fuse_nic_addr = (mac[3] << 16) + (mac[4] << 8) + mac[5]; | ||
1329 | wl1271_warning("MAC address from fuse not available, using random locally administered addresses."); | ||
1330 | } | ||
1331 | |||
1321 | ret = wlcore_set_partition(wl, &wl->ptable[PART_DOWN]); | 1332 | ret = wlcore_set_partition(wl, &wl->ptable[PART_DOWN]); |
1322 | 1333 | ||
1323 | out: | 1334 | out: |