summaryrefslogtreecommitdiff
path: root/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch
blob: 353419417b0b8bacc9ee823277527636180c970e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -23,6 +23,7 @@
 
 struct ath9k_platform_data {
 	u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
+	u8 *macaddr;
 };
 
 #endif /* _LINUX_ATH9K_PLATFORM_H */
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -16,6 +16,7 @@
 
 #include <linux/slab.h>
 #include <linux/pm_qos_params.h>
+#include <linux/ath9k_platform.h>
 
 #include "ath9k.h"
 
@@ -520,6 +521,7 @@ static void ath9k_init_misc(struct ath_s
 static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
 			    const struct ath_bus_ops *bus_ops)
 {
+	struct ath9k_platform_data *pdata = sc->dev->platform_data;
 	struct ath_hw *ah = NULL;
 	struct ath_common *common;
 	int ret = 0, i;
@@ -565,6 +567,9 @@ static int ath9k_init_softc(u16 devid, s
 	if (ret)
 		goto err_hw;
 
+	if (pdata && pdata->macaddr)
+		memcpy(common->macaddr, pdata->macaddr, ETH_ALEN);
+
 	ret = ath9k_init_debug(ah);
 	if (ret) {
 		ath_print(common, ATH_DBG_FATAL,