Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+11
+11
drivers/net/wireless/ti/wl18xx/main.c
··· 23 23 #include <linux/platform_device.h> 24 24 #include <linux/ip.h> 25 25 #include <linux/firmware.h> 26 + #include <linux/etherdevice.h> 26 27 27 28 #include "../wlcore/wlcore.h" 28 29 #include "../wlcore/debug.h" ··· 1318 1317 wl->fuse_oui_addr = ((mac2 & 0xffff) << 8) + 1319 1318 ((mac1 & 0xff000000) >> 24); 1320 1319 wl->fuse_nic_addr = (mac1 & 0xffffff); 1320 + 1321 + if (!wl->fuse_oui_addr && !wl->fuse_nic_addr) { 1322 + u8 mac[ETH_ALEN]; 1323 + 1324 + eth_random_addr(mac); 1325 + 1326 + wl->fuse_oui_addr = (mac[0] << 16) + (mac[1] << 8) + mac[2]; 1327 + wl->fuse_nic_addr = (mac[3] << 16) + (mac[4] << 8) + mac[5]; 1328 + wl1271_warning("MAC address from fuse not available, using random locally administered addresses."); 1329 + } 1321 1330 1322 1331 ret = wlcore_set_partition(wl, &wl->ptable[PART_DOWN]); 1323 1332