aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2010-05-13 21:42:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-02 16:13:01 -0400
commit6473d24d5b6b76bb5fd16914709a619a00c44d28 (patch)
tree7a073fb351dd100595510d8808f98784f1407f12 /drivers/net/wireless
parent6ac478cf05662911242957e8f765c623be23cf2a (diff)
ath9k: Enable Short GI in 20 Mhz for ar9287 and later chips
This patch enables short GI rx at all rates and tx at mcs15 for 20 Mhz channel width also. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c173
4 files changed, 101 insertions, 79 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 6bfac1ca07f..2fd62546187 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2234,6 +2234,9 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
2234 if (AR_SREV_9300_20_OR_LATER(ah)) 2234 if (AR_SREV_9300_20_OR_LATER(ah))
2235 pCap->hw_caps |= ATH9K_HW_CAP_RAC_SUPPORTED; 2235 pCap->hw_caps |= ATH9K_HW_CAP_RAC_SUPPORTED;
2236 2236
2237 if (AR_SREV_9287_10_OR_LATER(ah))
2238 pCap->hw_caps |= ATH9K_HW_CAP_SGI_20;
2239
2237 return 0; 2240 return 0;
2238} 2241}
2239 2242
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index bfecde083a4..5cf0714f069 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -199,6 +199,7 @@ enum ath9k_hw_caps {
199 ATH9K_HW_CAP_RAC_SUPPORTED = BIT(18), 199 ATH9K_HW_CAP_RAC_SUPPORTED = BIT(18),
200 ATH9K_HW_CAP_LDPC = BIT(19), 200 ATH9K_HW_CAP_LDPC = BIT(19),
201 ATH9K_HW_CAP_FASTCLOCK = BIT(20), 201 ATH9K_HW_CAP_FASTCLOCK = BIT(20),
202 ATH9K_HW_CAP_SGI_20 = BIT(21),
202}; 203};
203 204
204enum ath9k_capability_type { 205enum ath9k_capability_type {
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index d457cb3bd77..f388dcc8e46 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -208,6 +208,9 @@ static void setup_ht_cap(struct ath_softc *sc,
208 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_LDPC) 208 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_LDPC)
209 ht_info->cap |= IEEE80211_HT_CAP_LDPC_CODING; 209 ht_info->cap |= IEEE80211_HT_CAP_LDPC_CODING;
210 210
211 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_SGI_20)
212 ht_info->cap |= IEEE80211_HT_CAP_SGI_20;
213
211 ht_info->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; 214 ht_info->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
212 ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8; 215 ht_info->ampdu_density = IEEE80211_HT_MPDU_DENSITY_8;
213 216
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 8519452c95f..f5180d3d407 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -40,73 +40,75 @@ static const struct ath_rate_table ar5416_11na_ratetable = {
40 { VALID, VALID, WLAN_RC_PHY_OFDM, 54000, /* 54 Mb */ 40 { VALID, VALID, WLAN_RC_PHY_OFDM, 54000, /* 54 Mb */
41 29300, 7, 108, 4, 7, 7, 7, 7 }, 41 29300, 7, 108, 4, 7, 7, 7, 7 },
42 { VALID_2040, VALID_2040, WLAN_RC_PHY_HT_20_SS, 6500, /* 6.5 Mb */ 42 { VALID_2040, VALID_2040, WLAN_RC_PHY_HT_20_SS, 6500, /* 6.5 Mb */
43 6400, 0, 0, 0, 8, 24, 8, 24 }, 43 6400, 0, 0, 0, 8, 25, 8, 25 },
44 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 13000, /* 13 Mb */ 44 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 13000, /* 13 Mb */
45 12700, 1, 1, 2, 9, 25, 9, 25 }, 45 12700, 1, 1, 2, 9, 26, 9, 26 },
46 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 19500, /* 19.5 Mb */ 46 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 19500, /* 19.5 Mb */
47 18800, 2, 2, 2, 10, 26, 10, 26 }, 47 18800, 2, 2, 2, 10, 27, 10, 27 },
48 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 26000, /* 26 Mb */ 48 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 26000, /* 26 Mb */
49 25000, 3, 3, 4, 11, 27, 11, 27 }, 49 25000, 3, 3, 4, 11, 28, 11, 28 },
50 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 39000, /* 39 Mb */ 50 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 39000, /* 39 Mb */
51 36700, 4, 4, 4, 12, 28, 12, 28 }, 51 36700, 4, 4, 4, 12, 29, 12, 29 },
52 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 52000, /* 52 Mb */ 52 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 52000, /* 52 Mb */
53 48100, 5, 5, 4, 13, 29, 13, 29 }, 53 48100, 5, 5, 4, 13, 30, 13, 30 },
54 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 58500, /* 58.5 Mb */ 54 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 58500, /* 58.5 Mb */
55 53500, 6, 6, 4, 14, 30, 14, 30 }, 55 53500, 6, 6, 4, 14, 31, 14, 31 },
56 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 65000, /* 65 Mb */ 56 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 65000, /* 65 Mb */
57 59000, 7, 7, 4, 15, 31, 15, 32 }, 57 59000, 7, 7, 4, 15, 32, 15, 33 },
58 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 13000, /* 13 Mb */ 58 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 13000, /* 13 Mb */
59 12700, 8, 8, 3, 16, 33, 16, 33 }, 59 12700, 8, 8, 3, 16, 34, 16, 34 },
60 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 26000, /* 26 Mb */ 60 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 26000, /* 26 Mb */
61 24800, 9, 9, 2, 17, 34, 17, 34 }, 61 24800, 9, 9, 2, 17, 35, 17, 35 },
62 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 39000, /* 39 Mb */ 62 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 39000, /* 39 Mb */
63 36600, 10, 10, 2, 18, 35, 18, 35 }, 63 36600, 10, 10, 2, 18, 36, 18, 36 },
64 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 52000, /* 52 Mb */ 64 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 52000, /* 52 Mb */
65 48100, 11, 11, 4, 19, 36, 19, 36 }, 65 48100, 11, 11, 4, 19, 37, 19, 37 },
66 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 78000, /* 78 Mb */ 66 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 78000, /* 78 Mb */
67 69500, 12, 12, 4, 20, 37, 20, 37 }, 67 69500, 12, 12, 4, 20, 38, 20, 38 },
68 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 104000, /* 104 Mb */ 68 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 104000, /* 104 Mb */
69 89500, 13, 13, 4, 21, 38, 21, 38 }, 69 89500, 13, 13, 4, 21, 39, 21, 39 },
70 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 117000, /* 117 Mb */ 70 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 117000, /* 117 Mb */
71 98900, 14, 14, 4, 22, 39, 22, 39 }, 71 98900, 14, 14, 4, 22, 40, 22, 40 },
72 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 130000, /* 130 Mb */ 72 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 130000, /* 130 Mb */
73 108300, 15, 15, 4, 23, 40, 23, 41 }, 73 108300, 15, 15, 4, 23, 41, 24, 42 },
74 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS_HGI, 144400, /* 144.4 Mb */
75 12000, 15, 15, 4, 23, 41, 24, 42 },
74 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 13500, /* 13.5 Mb */ 76 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 13500, /* 13.5 Mb */
75 13200, 0, 0, 0, 8, 24, 24, 24 }, 77 13200, 0, 0, 0, 8, 25, 25, 25 },
76 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 27500, /* 27.0 Mb */ 78 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 27500, /* 27.0 Mb */
77 25900, 1, 1, 2, 9, 25, 25, 25 }, 79 25900, 1, 1, 2, 9, 26, 26, 26 },
78 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 40500, /* 40.5 Mb */ 80 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 40500, /* 40.5 Mb */
79 38600, 2, 2, 2, 10, 26, 26, 26 }, 81 38600, 2, 2, 2, 10, 27, 27, 27 },
80 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 54000, /* 54 Mb */ 82 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 54000, /* 54 Mb */
81 49800, 3, 3, 4, 11, 27, 27, 27 }, 83 49800, 3, 3, 4, 11, 28, 28, 28 },
82 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 81500, /* 81 Mb */ 84 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 81500, /* 81 Mb */
83 72200, 4, 4, 4, 12, 28, 28, 28 }, 85 72200, 4, 4, 4, 12, 29, 29, 29 },
84 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 108000, /* 108 Mb */ 86 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 108000, /* 108 Mb */
85 92900, 5, 5, 4, 13, 29, 29, 29 }, 87 92900, 5, 5, 4, 13, 30, 30, 30 },
86 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 121500, /* 121.5 Mb */ 88 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 121500, /* 121.5 Mb */
87 102700, 6, 6, 4, 14, 30, 30, 30 }, 89 102700, 6, 6, 4, 14, 31, 31, 31 },
88 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 135000, /* 135 Mb */ 90 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 135000, /* 135 Mb */
89 112000, 7, 7, 4, 15, 31, 32, 32 }, 91 112000, 7, 7, 4, 15, 32, 33, 33 },
90 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS_HGI, 150000, /* 150 Mb */ 92 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS_HGI, 150000, /* 150 Mb */
91 122000, 7, 7, 4, 15, 31, 32, 32 }, 93 122000, 7, 7, 4, 15, 32, 33, 33 },
92 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 27000, /* 27 Mb */ 94 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 27000, /* 27 Mb */
93 25800, 8, 8, 0, 16, 33, 33, 33 }, 95 25800, 8, 8, 0, 16, 34, 34, 34 },
94 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 54000, /* 54 Mb */ 96 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 54000, /* 54 Mb */
95 49800, 9, 9, 2, 17, 34, 34, 34 }, 97 49800, 9, 9, 2, 17, 35, 35, 35 },
96 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 81000, /* 81 Mb */ 98 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 81000, /* 81 Mb */
97 71900, 10, 10, 2, 18, 35, 35, 35 }, 99 71900, 10, 10, 2, 18, 36, 36, 36 },
98 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 108000, /* 108 Mb */ 100 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 108000, /* 108 Mb */
99 92500, 11, 11, 4, 19, 36, 36, 36 }, 101 92500, 11, 11, 4, 19, 37, 37, 37 },
100 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 162000, /* 162 Mb */ 102 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 162000, /* 162 Mb */
101 130300, 12, 12, 4, 20, 37, 37, 37 }, 103 130300, 12, 12, 4, 20, 38, 38, 38 },
102 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 216000, /* 216 Mb */ 104 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 216000, /* 216 Mb */
103 162800, 13, 13, 4, 21, 38, 38, 38 }, 105 162800, 13, 13, 4, 21, 39, 39, 39 },
104 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 243000, /* 243 Mb */ 106 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 243000, /* 243 Mb */
105 178200, 14, 14, 4, 22, 39, 39, 39 }, 107 178200, 14, 14, 4, 22, 40, 40, 40 },
106 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 270000, /* 270 Mb */ 108 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 270000, /* 270 Mb */
107 192100, 15, 15, 4, 23, 40, 41, 41 }, 109 192100, 15, 15, 4, 23, 41, 42, 42 },
108 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS_HGI, 300000, /* 300 Mb */ 110 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS_HGI, 300000, /* 300 Mb */
109 207000, 15, 15, 4, 23, 40, 41, 41 }, 111 207000, 15, 15, 4, 23, 41, 42, 42 },
110 }, 112 },
111 50, /* probe interval */ 113 50, /* probe interval */
112 WLAN_RC_HT_FLAG, /* Phy rates allowed initially */ 114 WLAN_RC_HT_FLAG, /* Phy rates allowed initially */
@@ -144,73 +146,75 @@ static const struct ath_rate_table ar5416_11ng_ratetable = {
144 { VALID, VALID, WLAN_RC_PHY_OFDM, 54000, /* 54 Mb */ 146 { VALID, VALID, WLAN_RC_PHY_OFDM, 54000, /* 54 Mb */
145 30900, 11, 108, 8, 11, 11, 11, 11 }, 147 30900, 11, 108, 8, 11, 11, 11, 11 },
146 { INVALID, INVALID, WLAN_RC_PHY_HT_20_SS, 6500, /* 6.5 Mb */ 148 { INVALID, INVALID, WLAN_RC_PHY_HT_20_SS, 6500, /* 6.5 Mb */
147 6400, 0, 0, 4, 12, 28, 12, 28 }, 149 6400, 0, 0, 4, 12, 29, 12, 29 },
148 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 13000, /* 13 Mb */ 150 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 13000, /* 13 Mb */
149 12700, 1, 1, 6, 13, 29, 13, 29 }, 151 12700, 1, 1, 6, 13, 30, 13, 30 },
150 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 19500, /* 19.5 Mb */ 152 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 19500, /* 19.5 Mb */
151 18800, 2, 2, 6, 14, 30, 14, 30 }, 153 18800, 2, 2, 6, 14, 31, 14, 31 },
152 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 26000, /* 26 Mb */ 154 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 26000, /* 26 Mb */
153 25000, 3, 3, 8, 15, 31, 15, 31 }, 155 25000, 3, 3, 8, 15, 32, 15, 32 },
154 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 39000, /* 39 Mb */ 156 { VALID_20, VALID_20, WLAN_RC_PHY_HT_20_SS, 39000, /* 39 Mb */
155 36700, 4, 4, 8, 16, 32, 16, 32 }, 157 36700, 4, 4, 8, 16, 33, 16, 33 },
156 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 52000, /* 52 Mb */ 158 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 52000, /* 52 Mb */
157 48100, 5, 5, 8, 17, 33, 17, 33 }, 159 48100, 5, 5, 8, 17, 34, 17, 34 },
158 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 58500, /* 58.5 Mb */ 160 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 58500, /* 58.5 Mb */
159 53500, 6, 6, 8, 18, 34, 18, 34 }, 161 53500, 6, 6, 8, 18, 35, 18, 35 },
160 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 65000, /* 65 Mb */ 162 { INVALID, VALID_20, WLAN_RC_PHY_HT_20_SS, 65000, /* 65 Mb */
161 59000, 7, 7, 8, 19, 35, 19, 36 }, 163 59000, 7, 7, 8, 19, 36, 19, 37 },
162 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 13000, /* 13 Mb */ 164 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 13000, /* 13 Mb */
163 12700, 8, 8, 4, 20, 37, 20, 37 }, 165 12700, 8, 8, 4, 20, 38, 20, 38 },
164 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 26000, /* 26 Mb */ 166 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 26000, /* 26 Mb */
165 24800, 9, 9, 6, 21, 38, 21, 38 }, 167 24800, 9, 9, 6, 21, 39, 21, 39 },
166 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 39000, /* 39 Mb */ 168 { INVALID, INVALID, WLAN_RC_PHY_HT_20_DS, 39000, /* 39 Mb */
167 36600, 10, 10, 6, 22, 39, 22, 39 }, 169 36600, 10, 10, 6, 22, 40, 22, 40 },
168 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 52000, /* 52 Mb */ 170 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 52000, /* 52 Mb */
169 48100, 11, 11, 8, 23, 40, 23, 40 }, 171 48100, 11, 11, 8, 23, 41, 23, 41 },
170 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 78000, /* 78 Mb */ 172 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 78000, /* 78 Mb */
171 69500, 12, 12, 8, 24, 41, 24, 41 }, 173 69500, 12, 12, 8, 24, 42, 24, 42 },
172 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 104000, /* 104 Mb */ 174 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 104000, /* 104 Mb */
173 89500, 13, 13, 8, 25, 42, 25, 42 }, 175 89500, 13, 13, 8, 25, 43, 25, 43 },
174 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 117000, /* 117 Mb */ 176 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 117000, /* 117 Mb */
175 98900, 14, 14, 8, 26, 43, 26, 44 }, 177 98900, 14, 14, 8, 26, 44, 26, 44 },
176 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 130000, /* 130 Mb */ 178 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS, 130000, /* 130 Mb */
177 108300, 15, 15, 8, 27, 44, 27, 45 }, 179 108300, 15, 15, 8, 27, 45, 28, 46 },
180 { VALID_20, INVALID, WLAN_RC_PHY_HT_20_DS_HGI, 144400, /* 130 Mb */
181 120000, 15, 15, 8, 27, 45, 28, 46 },
178 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 13500, /* 13.5 Mb */ 182 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 13500, /* 13.5 Mb */
179 13200, 0, 0, 8, 12, 28, 28, 28 }, 183 13200, 0, 0, 8, 12, 29, 29, 29 },
180 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 27500, /* 27.0 Mb */ 184 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 27500, /* 27.0 Mb */
181 25900, 1, 1, 8, 13, 29, 29, 29 }, 185 25900, 1, 1, 8, 13, 30, 30, 30 },
182 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 40500, /* 40.5 Mb */ 186 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 40500, /* 40.5 Mb */
183 38600, 2, 2, 8, 14, 30, 30, 30 }, 187 38600, 2, 2, 8, 14, 31, 31, 31 },
184 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 54000, /* 54 Mb */ 188 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 54000, /* 54 Mb */
185 49800, 3, 3, 8, 15, 31, 31, 31 }, 189 49800, 3, 3, 8, 15, 32, 32, 32 },
186 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 81500, /* 81 Mb */ 190 { VALID_40, VALID_40, WLAN_RC_PHY_HT_40_SS, 81500, /* 81 Mb */
187 72200, 4, 4, 8, 16, 32, 32, 32 }, 191 72200, 4, 4, 8, 16, 33, 33, 33 },
188 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 108000, /* 108 Mb */ 192 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 108000, /* 108 Mb */
189 92900, 5, 5, 8, 17, 33, 33, 33 }, 193 92900, 5, 5, 8, 17, 34, 34, 34 },
190 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 121500, /* 121.5 Mb */ 194 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 121500, /* 121.5 Mb */
191 102700, 6, 6, 8, 18, 34, 34, 34 }, 195 102700, 6, 6, 8, 18, 35, 35, 35 },
192 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 135000, /* 135 Mb */ 196 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS, 135000, /* 135 Mb */
193 112000, 7, 7, 8, 19, 35, 36, 36 }, 197 112000, 7, 7, 8, 19, 36, 37, 37 },
194 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS_HGI, 150000, /* 150 Mb */ 198 { INVALID, VALID_40, WLAN_RC_PHY_HT_40_SS_HGI, 150000, /* 150 Mb */
195 122000, 7, 7, 8, 19, 35, 36, 36 }, 199 122000, 7, 7, 8, 19, 36, 37, 37 },
196 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 27000, /* 27 Mb */ 200 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 27000, /* 27 Mb */
197 25800, 8, 8, 8, 20, 37, 37, 37 }, 201 25800, 8, 8, 8, 20, 38, 38, 38 },
198 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 54000, /* 54 Mb */ 202 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 54000, /* 54 Mb */
199 49800, 9, 9, 8, 21, 38, 38, 38 }, 203 49800, 9, 9, 8, 21, 39, 39, 39 },
200 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 81000, /* 81 Mb */ 204 { INVALID, INVALID, WLAN_RC_PHY_HT_40_DS, 81000, /* 81 Mb */
201 71900, 10, 10, 8, 22, 39, 39, 39 }, 205 71900, 10, 10, 8, 22, 40, 40, 40 },
202 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 108000, /* 108 Mb */ 206 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 108000, /* 108 Mb */
203 92500, 11, 11, 8, 23, 40, 40, 40 }, 207 92500, 11, 11, 8, 23, 41, 41, 41 },
204 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 162000, /* 162 Mb */ 208 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 162000, /* 162 Mb */
205 130300, 12, 12, 8, 24, 41, 41, 41 }, 209 130300, 12, 12, 8, 24, 42, 42, 42 },
206 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 216000, /* 216 Mb */ 210 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 216000, /* 216 Mb */
207 162800, 13, 13, 8, 25, 42, 42, 42 }, 211 162800, 13, 13, 8, 25, 43, 43, 43 },
208 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 243000, /* 243 Mb */ 212 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 243000, /* 243 Mb */
209 178200, 14, 14, 8, 26, 43, 43, 43 }, 213 178200, 14, 14, 8, 26, 44, 44, 44 },
210 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 270000, /* 270 Mb */ 214 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS, 270000, /* 270 Mb */
211 192100, 15, 15, 8, 27, 44, 45, 45 }, 215 192100, 15, 15, 8, 27, 45, 46, 46 },
212 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS_HGI, 300000, /* 300 Mb */ 216 { VALID_40, INVALID, WLAN_RC_PHY_HT_40_DS_HGI, 300000, /* 300 Mb */
213 207000, 15, 15, 8, 27, 44, 45, 45 }, 217 207000, 15, 15, 8, 27, 45, 46, 46 },
214 }, 218 },
215 50, /* probe interval */ 219 50, /* probe interval */
216 WLAN_RC_HT_FLAG, /* Phy rates allowed initially */ 220 WLAN_RC_HT_FLAG, /* Phy rates allowed initially */
@@ -1193,7 +1197,7 @@ static void ath_rc_init(struct ath_softc *sc,
1193} 1197}
1194 1198
1195static u8 ath_rc_build_ht_caps(struct ath_softc *sc, struct ieee80211_sta *sta, 1199static u8 ath_rc_build_ht_caps(struct ath_softc *sc, struct ieee80211_sta *sta,
1196 bool is_cw40, bool is_sgi40) 1200 bool is_cw40, bool is_sgi)
1197{ 1201{
1198 u8 caps = 0; 1202 u8 caps = 0;
1199 1203
@@ -1206,8 +1210,9 @@ static u8 ath_rc_build_ht_caps(struct ath_softc *sc, struct ieee80211_sta *sta,
1206 } 1210 }
1207 if (is_cw40) 1211 if (is_cw40)
1208 caps |= WLAN_RC_40_FLAG; 1212 caps |= WLAN_RC_40_FLAG;
1209 if (is_sgi40) 1213 if (is_sgi)
1210 caps |= WLAN_RC_SGI_FLAG; 1214 caps |= WLAN_RC_SGI_FLAG;
1215
1211 } 1216 }
1212 1217
1213 return caps; 1218 return caps;
@@ -1300,7 +1305,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
1300 struct ath_softc *sc = priv; 1305 struct ath_softc *sc = priv;
1301 struct ath_rate_priv *ath_rc_priv = priv_sta; 1306 struct ath_rate_priv *ath_rc_priv = priv_sta;
1302 const struct ath_rate_table *rate_table; 1307 const struct ath_rate_table *rate_table;
1303 bool is_cw40, is_sgi40; 1308 bool is_cw40, is_sgi = false;
1304 int i, j = 0; 1309 int i, j = 0;
1305 1310
1306 for (i = 0; i < sband->n_bitrates; i++) { 1311 for (i = 0; i < sband->n_bitrates; i++) {
@@ -1323,7 +1328,11 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
1323 } 1328 }
1324 1329
1325 is_cw40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40; 1330 is_cw40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40;
1326 is_sgi40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40; 1331
1332 if (is_cw40)
1333 is_sgi = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40;
1334 else if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_SGI_20)
1335 is_sgi = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20;
1327 1336
1328 /* Choose rate table first */ 1337 /* Choose rate table first */
1329 1338
@@ -1336,7 +1345,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
1336 rate_table = hw_rate_table[sc->cur_rate_mode]; 1345 rate_table = hw_rate_table[sc->cur_rate_mode];
1337 } 1346 }
1338 1347
1339 ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta, is_cw40, is_sgi40); 1348 ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta, is_cw40, is_sgi);
1340 ath_rc_init(sc, priv_sta, sband, sta, rate_table); 1349 ath_rc_init(sc, priv_sta, sband, sta, rate_table);
1341} 1350}
1342 1351
@@ -1347,10 +1356,10 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
1347 struct ath_softc *sc = priv; 1356 struct ath_softc *sc = priv;
1348 struct ath_rate_priv *ath_rc_priv = priv_sta; 1357 struct ath_rate_priv *ath_rc_priv = priv_sta;
1349 const struct ath_rate_table *rate_table = NULL; 1358 const struct ath_rate_table *rate_table = NULL;
1350 bool oper_cw40 = false, oper_sgi40; 1359 bool oper_cw40 = false, oper_sgi;
1351 bool local_cw40 = (ath_rc_priv->ht_cap & WLAN_RC_40_FLAG) ? 1360 bool local_cw40 = (ath_rc_priv->ht_cap & WLAN_RC_40_FLAG) ?
1352 true : false; 1361 true : false;
1353 bool local_sgi40 = (ath_rc_priv->ht_cap & WLAN_RC_SGI_FLAG) ? 1362 bool local_sgi = (ath_rc_priv->ht_cap & WLAN_RC_SGI_FLAG) ?
1354 true : false; 1363 true : false;
1355 1364
1356 /* FIXME: Handle AP mode later when we support CWM */ 1365 /* FIXME: Handle AP mode later when we support CWM */
@@ -1363,15 +1372,21 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
1363 oper_chan_type == NL80211_CHAN_HT40PLUS) 1372 oper_chan_type == NL80211_CHAN_HT40PLUS)
1364 oper_cw40 = true; 1373 oper_cw40 = true;
1365 1374
1366 oper_sgi40 = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? 1375 if (oper_cw40)
1367 true : false; 1376 oper_sgi = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ?
1377 true : false;
1378 else if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_SGI_20)
1379 oper_sgi = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ?
1380 true : false;
1381 else
1382 oper_sgi = false;
1368 1383
1369 if ((local_cw40 != oper_cw40) || (local_sgi40 != oper_sgi40)) { 1384 if ((local_cw40 != oper_cw40) || (local_sgi != oper_sgi)) {
1370 rate_table = ath_choose_rate_table(sc, sband->band, 1385 rate_table = ath_choose_rate_table(sc, sband->band,
1371 sta->ht_cap.ht_supported, 1386 sta->ht_cap.ht_supported,
1372 oper_cw40); 1387 oper_cw40);
1373 ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta, 1388 ath_rc_priv->ht_cap = ath_rc_build_ht_caps(sc, sta,
1374 oper_cw40, oper_sgi40); 1389 oper_cw40, oper_sgi);
1375 ath_rc_init(sc, priv_sta, sband, sta, rate_table); 1390 ath_rc_init(sc, priv_sta, sband, sta, rate_table);
1376 1391
1377 ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_CONFIG, 1392 ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_CONFIG,