mac80211: set the country code through iw reg, setting it only through hostapd appare...
[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 @@ -15,6 +15,7 @@
4 */
5
6 #include <linux/io.h>
7 +#include <linux/etherdevice.h>
8 #include <asm/unaligned.h>
9
10 #include "hw.h"
11 @@ -489,8 +490,18 @@ static int ath9k_hw_init_macaddr(struct
12 common->macaddr[2 * i] = eeval >> 8;
13 common->macaddr[2 * i + 1] = eeval & 0xff;
14 }
15 - if (sum == 0 || sum == 0xffff * 3)
16 - return -EADDRNOTAVAIL;
17 + if (!is_valid_ether_addr(common->macaddr)) {
18 + DECLARE_MAC_BUF(macbuf);
19 +
20 + ath_print(common, ATH_DBG_EEPROM,
21 + "eeprom contains invalid mac address: %s\n",
22 + print_mac(macbuf, common->macaddr));
23 +
24 + random_ether_addr(common->macaddr);
25 + ath_print(common, ATH_DBG_EEPROM,
26 + "random mac address will be used: %s\n",
27 + print_mac(macbuf, common->macaddr));
28 + }
29
30 return 0;
31 }
This page took 0.060681 seconds and 5 git commands to generate.