[mac80211] update openfw to 5.2
[openwrt.git] / package / mac80211 / patches / 403-ath9k-fix-invalid-mac-address-handling.patch
1 --- a/drivers/net/wireless/ath/ath9k/hw.c
2 +++ b/drivers/net/wireless/ath/ath9k/hw.c
3 @@ -521,8 +521,18 @@ static int ath9k_hw_init_macaddr(struct
4 ah->macaddr[2 * i] = eeval >> 8;
5 ah->macaddr[2 * i + 1] = eeval & 0xff;
6 }
7 - if (sum == 0 || sum == 0xffff * 3)
8 - return -EADDRNOTAVAIL;
9 + if (!is_valid_ether_addr(ah->macaddr)) {
10 + DECLARE_MAC_BUF(macbuf);
11 +
12 + DPRINTF(ah->ah_sc, ATH_DBG_EEPROM,
13 + "eeprom contains invalid mac address: %s\n",
14 + print_mac(macbuf, ah->macaddr));
15 +
16 + random_ether_addr(ah->macaddr);
17 + DPRINTF(ah->ah_sc, ATH_DBG_EEPROM,
18 + "random mac address will be used: %s\n",
19 + print_mac(macbuf, ah->macaddr));
20 + }
21
22 return 0;
23 }
This page took 0.045255 seconds and 5 git commands to generate.