staging: r8188eu: fall back to random mac address

Call eth_random_addr to generate a random mac address if we cannot load
the mac address from the efuses.

Do not use a constant mac address as fallback. This may create conflicts
if we have several r8188eu devices on the network.

Suggested-by: Joe Perches <[email protected]>
Tested-by: Philipp Hortmann <[email protected]> # Edimax N150
Reviewed-by: Pavel Skripkin <[email protected]>
Signed-off-by: Martin Kaiser <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Martin Kaiser authored and Greg Kroah-Hartman committed 2022-07-14 15:47:36 +02:00
1 parent c1da5a7bef
commit 724933e37a
1 file changed
+1 -2
+1 -2
View File
@@ -912,11 +912,10 @@ exit:
static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail)
{
u8 sMacAddr[6] = {0x00, 0xE0, 0x4C, 0x81, 0x88, 0x02};
struct eeprom_priv *eeprom = &adapt->eeprompriv;
if (AutoLoadFail) {
memcpy(eeprom->mac_addr, sMacAddr, ETH_ALEN);
eth_random_addr(eeprom->mac_addr);
} else {
/* Read Permanent MAC address */
memcpy(eeprom->mac_addr, &hwinfo[EEPROM_MAC_ADDR_88EU], ETH_ALEN);