aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/dvm/sta.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/dvm/sta.c')
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/sta.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/sta.c b/drivers/net/wireless/iwlwifi/dvm/sta.c
index 2d33760a9dc2..94ef33838bc6 100644
--- a/drivers/net/wireless/iwlwifi/dvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/dvm/sta.c
@@ -173,7 +173,7 @@ int iwl_send_add_sta(struct iwl_priv *priv,
173 173
174bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv, 174bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
175 struct iwl_rxon_context *ctx, 175 struct iwl_rxon_context *ctx,
176 struct ieee80211_sta_ht_cap *ht_cap) 176 struct ieee80211_sta *sta)
177{ 177{
178 if (!ctx->ht.enabled || !ctx->ht.is_40mhz) 178 if (!ctx->ht.enabled || !ctx->ht.is_40mhz)
179 return false; 179 return false;
@@ -183,20 +183,11 @@ bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
183 return false; 183 return false;
184#endif 184#endif
185 185
186 /* 186 /* special case for RXON */
187 * Remainder of this function checks ht_cap, but if it's 187 if (!sta)
188 * NULL then we can do HT40 (special case for RXON)
189 */
190 if (!ht_cap)
191 return true; 188 return true;
192 189
193 if (!ht_cap->ht_supported) 190 return sta->bandwidth >= IEEE80211_STA_RX_BW_40;
194 return false;
195
196 if (!(ht_cap->cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40))
197 return false;
198
199 return true;
200} 191}
201 192
202static void iwl_sta_calc_ht_flags(struct iwl_priv *priv, 193static void iwl_sta_calc_ht_flags(struct iwl_priv *priv,
@@ -205,7 +196,6 @@ static void iwl_sta_calc_ht_flags(struct iwl_priv *priv,
205 __le32 *flags, __le32 *mask) 196 __le32 *flags, __le32 *mask)
206{ 197{
207 struct ieee80211_sta_ht_cap *sta_ht_inf = &sta->ht_cap; 198 struct ieee80211_sta_ht_cap *sta_ht_inf = &sta->ht_cap;
208 u8 mimo_ps_mode;
209 199
210 *mask = STA_FLG_RTS_MIMO_PROT_MSK | 200 *mask = STA_FLG_RTS_MIMO_PROT_MSK |
211 STA_FLG_MIMO_DIS_MSK | 201 STA_FLG_MIMO_DIS_MSK |
@@ -217,26 +207,24 @@ static void iwl_sta_calc_ht_flags(struct iwl_priv *priv,
217 if (!sta || !sta_ht_inf->ht_supported) 207 if (!sta || !sta_ht_inf->ht_supported)
218 return; 208 return;
219 209
220 mimo_ps_mode = (sta_ht_inf->cap & IEEE80211_HT_CAP_SM_PS) >> 2;
221
222 IWL_DEBUG_INFO(priv, "STA %pM SM PS mode: %s\n", 210 IWL_DEBUG_INFO(priv, "STA %pM SM PS mode: %s\n",
223 sta->addr, 211 sta->addr,
224 (mimo_ps_mode == WLAN_HT_CAP_SM_PS_STATIC) ? 212 (sta->smps_mode == IEEE80211_SMPS_STATIC) ?
225 "static" : 213 "static" :
226 (mimo_ps_mode == WLAN_HT_CAP_SM_PS_DYNAMIC) ? 214 (sta->smps_mode == IEEE80211_SMPS_DYNAMIC) ?
227 "dynamic" : "disabled"); 215 "dynamic" : "disabled");
228 216
229 switch (mimo_ps_mode) { 217 switch (sta->smps_mode) {
230 case WLAN_HT_CAP_SM_PS_STATIC: 218 case IEEE80211_SMPS_STATIC:
231 *flags |= STA_FLG_MIMO_DIS_MSK; 219 *flags |= STA_FLG_MIMO_DIS_MSK;
232 break; 220 break;
233 case WLAN_HT_CAP_SM_PS_DYNAMIC: 221 case IEEE80211_SMPS_DYNAMIC:
234 *flags |= STA_FLG_RTS_MIMO_PROT_MSK; 222 *flags |= STA_FLG_RTS_MIMO_PROT_MSK;
235 break; 223 break;
236 case WLAN_HT_CAP_SM_PS_DISABLED: 224 case IEEE80211_SMPS_OFF:
237 break; 225 break;
238 default: 226 default:
239 IWL_WARN(priv, "Invalid MIMO PS mode %d\n", mimo_ps_mode); 227 IWL_WARN(priv, "Invalid MIMO PS mode %d\n", sta->smps_mode);
240 break; 228 break;
241 } 229 }
242 230
@@ -246,7 +234,7 @@ static void iwl_sta_calc_ht_flags(struct iwl_priv *priv,
246 *flags |= cpu_to_le32( 234 *flags |= cpu_to_le32(
247 (u32)sta_ht_inf->ampdu_density << STA_FLG_AGG_MPDU_DENSITY_POS); 235 (u32)sta_ht_inf->ampdu_density << STA_FLG_AGG_MPDU_DENSITY_POS);
248 236
249 if (iwl_is_ht40_tx_allowed(priv, ctx, &sta->ht_cap)) 237 if (iwl_is_ht40_tx_allowed(priv, ctx, sta))
250 *flags |= STA_FLG_HT40_EN_MSK; 238 *flags |= STA_FLG_HT40_EN_MSK;
251} 239}
252 240