summaryrefslogtreecommitdiff
path: root/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch
blob: 8beb224c9105cf223edc04ffa6531fc58c70de5c (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
39
40
41
42
43
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -433,11 +433,8 @@ static void ath9k_hw_init_defaults(struc
 	ah->hw_version.magic = AR5416_MAGIC;
 	ah->hw_version.subvendorid = 0;
 
-	ah->ah_flags = 0;
 	if (ah->hw_version.devid == AR5416_AR9100_DEVID)
 		ah->hw_version.macVersion = AR_SREV_VERSION_9100;
-	if (!AR_SREV_9100(ah))
-		ah->ah_flags = AH_USE_EEPROM;
 
 	ah->atim_window = 0;
 	ah->sta_id1_defaults = AR_STA_ID1_CRPT_MIC_ENABLE;
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -15,6 +15,7 @@
  */
 
 #include <linux/nl80211.h>
+#include <linux/ath9k_platform.h>
 #include "ath9k.h"
 #include "btcoex.h"
 
@@ -1633,6 +1634,7 @@ static int ath_init_softc(u16 devid, str
 {
 	struct ath_hw *ah = NULL;
 	struct ath_common *common;
+	struct ath9k_platform_data *pdata;
 	int r = 0, i;
 	int csz = 0;
 	int qnum;
@@ -1656,6 +1658,10 @@ static int ath_init_softc(u16 devid, str
 
 	ah->hw_version.devid = devid;
 	ah->hw_version.subsysid = subsysid;
+	pdata = (struct ath9k_platform_data *) sc->dev->platform_data;
+	if (!pdata)
+		ah->ah_flags |= AH_USE_EEPROM;
+
 	sc->sc_ah = ah;
 
 	common = ath9k_hw_common(ah);