Root/
Source at commit 99c6c73 created 13 years 10 months ago. By Lars-Peter Clausen, reset to backfire. | |
---|---|
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 | @@ -441,8 +442,16 @@ 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 | + ath_print(common, ATH_DBG_EEPROM, |
19 | + "eeprom contains invalid mac address: %pM\n", |
20 | + common->macaddr); |
21 | + |
22 | + random_ether_addr(common->macaddr); |
23 | + ath_print(common, ATH_DBG_EEPROM, |
24 | + "random mac address will be used: %pM\n", |
25 | + common->macaddr); |
26 | + } |
27 | |
28 | return 0; |
29 | } |
30 |