mac80211: update to wireless-testing 2010-01-19
[openwrt.git] / package / mac80211 / patches / 407-ath9k-override-mac-address-from-platform-data.patch
1 --- a/include/linux/ath9k_platform.h
2 +++ b/include/linux/ath9k_platform.h
3 @@ -23,6 +23,7 @@
4
5 struct ath9k_platform_data {
6 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
7 + u8 *macaddr;
8 };
9
10 #endif /* _LINUX_ATH9K_PLATFORM_H */
11 --- a/drivers/net/wireless/ath/ath9k/init.c
12 +++ b/drivers/net/wireless/ath/ath9k/init.c
13 @@ -15,6 +15,7 @@
14 */
15
16 #include <linux/slab.h>
17 +#include <linux/ath9k_platform.h>
18
19 #include "ath9k.h"
20
21 @@ -528,6 +529,7 @@ static void ath9k_init_misc(struct ath_s
22 static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
23 const struct ath_bus_ops *bus_ops)
24 {
25 + struct ath9k_platform_data *pdata = sc->dev->platform_data;
26 struct ath_hw *ah = NULL;
27 struct ath_common *common;
28 int ret = 0, i;
29 @@ -541,7 +543,7 @@ static int ath9k_init_softc(u16 devid, s
30 ah->hw_version.subsysid = subsysid;
31 sc->sc_ah = ah;
32
33 - if (!sc->dev->platform_data)
34 + if (!pdata)
35 ah->ah_flags |= AH_USE_EEPROM;
36
37 common = ath9k_hw_common(ah);
38 @@ -574,6 +576,9 @@ static int ath9k_init_softc(u16 devid, s
39 if (ret)
40 goto err_hw;
41
42 + if (pdata && pdata->macaddr)
43 + memcpy(common->macaddr, pdata->macaddr, ETH_ALEN);
44 +
45 ret = ath9k_init_queues(sc);
46 if (ret)
47 goto err_queues;
This page took 0.056418 seconds and 5 git commands to generate.