package/mac80211: use platform_data on PCI devices in ath9k
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch
1 --- a/drivers/net/wireless/ath/ath9k/hw.c
2 +++ b/drivers/net/wireless/ath/ath9k/hw.c
3 @@ -433,11 +433,8 @@ static void ath9k_hw_init_defaults(struc
4 ah->hw_version.magic = AR5416_MAGIC;
5 ah->hw_version.subvendorid = 0;
6
7 - ah->ah_flags = 0;
8 if (ah->hw_version.devid == AR5416_AR9100_DEVID)
9 ah->hw_version.macVersion = AR_SREV_VERSION_9100;
10 - if (!AR_SREV_9100(ah))
11 - ah->ah_flags = AH_USE_EEPROM;
12
13 ah->atim_window = 0;
14 ah->sta_id1_defaults = AR_STA_ID1_CRPT_MIC_ENABLE;
15 --- a/drivers/net/wireless/ath/ath9k/main.c
16 +++ b/drivers/net/wireless/ath/ath9k/main.c
17 @@ -15,6 +15,7 @@
18 */
19
20 #include <linux/nl80211.h>
21 +#include <linux/ath9k_platform.h>
22 #include "ath9k.h"
23 #include "btcoex.h"
24
25 @@ -1633,6 +1634,7 @@ static int ath_init_softc(u16 devid, str
26 {
27 struct ath_hw *ah = NULL;
28 struct ath_common *common;
29 + struct ath9k_platform_data *pdata;
30 int r = 0, i;
31 int csz = 0;
32 int qnum;
33 @@ -1656,6 +1658,10 @@ static int ath_init_softc(u16 devid, str
34
35 ah->hw_version.devid = devid;
36 ah->hw_version.subsysid = subsysid;
37 + pdata = (struct ath9k_platform_data *) sc->dev->platform_data;
38 + if (!pdata)
39 + ah->ah_flags |= AH_USE_EEPROM;
40 +
41 sc->sc_ah = ah;
42
43 common = ath9k_hw_common(ah);