2009-05-01 21:43:12 +08:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
2013-12-15 01:07:08 +08:00
|
|
|
@@ -19,6 +19,7 @@
|
2011-11-18 19:27:19 +08:00
|
|
|
#include <linux/module.h>
|
2013-11-19 03:58:53 +08:00
|
|
|
#include <linux/time.h>
|
2013-12-15 01:07:08 +08:00
|
|
|
#include <linux/bitops.h>
|
2009-10-11 08:36:23 +08:00
|
|
|
+#include <linux/etherdevice.h>
|
|
|
|
#include <asm/unaligned.h>
|
|
|
|
|
|
|
|
#include "hw.h"
|
2014-05-20 17:35:17 +08:00
|
|
|
@@ -449,8 +450,16 @@ static int ath9k_hw_init_macaddr(struct
|
2009-10-11 08:36:23 +08:00
|
|
|
common->macaddr[2 * i] = eeval >> 8;
|
|
|
|
common->macaddr[2 * i + 1] = eeval & 0xff;
|
2009-02-02 00:15:45 +08:00
|
|
|
}
|
2009-05-01 21:43:12 +08:00
|
|
|
- if (sum == 0 || sum == 0xffff * 3)
|
|
|
|
- return -EADDRNOTAVAIL;
|
2009-10-11 08:36:23 +08:00
|
|
|
+ if (!is_valid_ether_addr(common->macaddr)) {
|
2010-12-11 09:45:12 +08:00
|
|
|
+ ath_err(common,
|
2010-03-10 09:09:12 +08:00
|
|
|
+ "eeprom contains invalid mac address: %pM\n",
|
|
|
|
+ common->macaddr);
|
2009-02-02 00:15:45 +08:00
|
|
|
+
|
2009-10-11 08:36:23 +08:00
|
|
|
+ random_ether_addr(common->macaddr);
|
2010-12-11 09:45:12 +08:00
|
|
|
+ ath_err(common,
|
2010-03-10 09:09:12 +08:00
|
|
|
+ "random mac address will be used: %pM\n",
|
|
|
|
+ common->macaddr);
|
2009-05-01 21:43:12 +08:00
|
|
|
+ }
|
2009-02-02 00:15:45 +08:00
|
|
|
|
|
|
|
return 0;
|
2009-05-01 21:43:12 +08:00
|
|
|
}
|