1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Sat, 18 Oct 2014 18:31:49 +0200
3 Subject: [PATCH] ath9k: use a random MAC address if the EEPROM address
6 Based on OpenWrt patch by Gabor Juhos
8 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 --- a/drivers/net/wireless/ath/ath9k/hw.c
12 +++ b/drivers/net/wireless/ath/ath9k/hw.c
14 #include <linux/module.h>
15 #include <linux/time.h>
16 #include <linux/bitops.h>
17 +#include <linux/etherdevice.h>
18 #include <asm/unaligned.h>
21 @@ -446,8 +447,16 @@ static int ath9k_hw_init_macaddr(struct
22 common->macaddr[2 * i] = eeval >> 8;
23 common->macaddr[2 * i + 1] = eeval & 0xff;
25 - if (sum == 0 || sum == 0xffff * 3)
26 - return -EADDRNOTAVAIL;
27 + if (!is_valid_ether_addr(common->macaddr)) {
29 + "eeprom contains invalid mac address: %pM\n",
32 + random_ether_addr(common->macaddr);
34 + "random mac address will be used: %pM\n",