179e5c6deab891b84f8f1a82adc9201f74aa3f06
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 540-ath9k-define-mac-version-for-AR9330.patch
1 --- a/drivers/net/wireless/ath/ath9k/hw.c
2 +++ b/drivers/net/wireless/ath/ath9k/hw.c
3 @@ -560,6 +560,7 @@ static int __ath9k_hw_init(struct ath_hw
4 case AR_SREV_VERSION_9287:
5 case AR_SREV_VERSION_9271:
6 case AR_SREV_VERSION_9300:
7 + case AR_SREV_VERSION_9330:
8 case AR_SREV_VERSION_9485:
9 case AR_SREV_VERSION_9340:
10 break;
11 @@ -570,7 +571,8 @@ static int __ath9k_hw_init(struct ath_hw
12 return -EOPNOTSUPP;
13 }
14
15 - if (AR_SREV_9271(ah) || AR_SREV_9100(ah) || AR_SREV_9340(ah))
16 + if (AR_SREV_9271(ah) || AR_SREV_9100(ah) || AR_SREV_9340(ah) ||
17 + AR_SREV_9330(ah))
18 ah->is_pciexpress = false;
19
20 ah->hw_version.phyRev = REG_READ(ah, AR_PHY_CHIP_ID);
21 @@ -2584,6 +2586,7 @@ static struct {
22 { AR_SREV_VERSION_9287, "9287" },
23 { AR_SREV_VERSION_9271, "9271" },
24 { AR_SREV_VERSION_9300, "9300" },
25 + { AR_SREV_VERSION_9330, "9330" },
26 { AR_SREV_VERSION_9485, "9485" },
27 };
28
29 --- a/drivers/net/wireless/ath/ath9k/reg.h
30 +++ b/drivers/net/wireless/ath/ath9k/reg.h
31 @@ -788,6 +788,10 @@
32 #define AR_SREV_REVISION_9271_11 1
33 #define AR_SREV_VERSION_9300 0x1c0
34 #define AR_SREV_REVISION_9300_20 2 /* 2.0 and 2.1 */
35 +#define AR_SREV_VERSION_9330 0x200
36 +#define AR_SREV_REVISION_9330_10 0
37 +#define AR_SREV_REVISION_9330_11 1
38 +#define AR_SREV_REVISION_9330_12 2
39 #define AR_SREV_VERSION_9485 0x240
40 #define AR_SREV_REVISION_9485_10 0
41 #define AR_SREV_REVISION_9485_11 1
42 @@ -862,6 +866,18 @@
43 #define AR_SREV_9300_20_OR_LATER(_ah) \
44 ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9300)
45
46 +#define AR_SREV_9330(_ah) \
47 + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9330))
48 +#define AR_SREV_9330_10(_ah) \
49 + (AR_SREV_9330((_ah)) && \
50 + ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_10))
51 +#define AR_SREV_9330_11(_ah) \
52 + (AR_SREV_9330((_ah)) && \
53 + ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_11))
54 +#define AR_SREV_9330_12(_ah) \
55 + (AR_SREV_9330((_ah)) && \
56 + ((_ah)->hw_version.macRev == AR_SREV_REVISION_9330_12))
57 +
58 #define AR_SREV_9485(_ah) \
59 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9485))
60 #define AR_SREV_9485_10(_ah) \