aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index f7d85a2173c8..0e6161d7c764 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -295,11 +295,11 @@ static u32 rs_tl_get_load(struct iwl_lq_sta *lq_data, u8 tid)
295 return tl->total; 295 return tl->total;
296} 296}
297 297
298static void rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv, 298static int rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv,
299 struct iwl_lq_sta *lq_data, u8 tid, 299 struct iwl_lq_sta *lq_data, u8 tid,
300 struct ieee80211_sta *sta) 300 struct ieee80211_sta *sta)
301{ 301{
302 int ret; 302 int ret = -EAGAIN;
303 303
304 if (rs_tl_get_load(lq_data, tid) > IWL_AGG_LOAD_THRESHOLD) { 304 if (rs_tl_get_load(lq_data, tid) > IWL_AGG_LOAD_THRESHOLD) {
305 IWL_DEBUG_HT(priv, "Starting Tx agg: STA: %pM tid: %d\n", 305 IWL_DEBUG_HT(priv, "Starting Tx agg: STA: %pM tid: %d\n",
@@ -313,29 +313,29 @@ static void rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv,
313 */ 313 */
314 IWL_DEBUG_HT(priv, "Fail start Tx agg on tid: %d\n", 314 IWL_DEBUG_HT(priv, "Fail start Tx agg on tid: %d\n",
315 tid); 315 tid);
316 ret = ieee80211_stop_tx_ba_session(sta, tid, 316 ieee80211_stop_tx_ba_session(sta, tid,
317 WLAN_BACK_INITIATOR); 317 WLAN_BACK_INITIATOR);
318 } 318 }
319 } 319 } else
320 IWL_ERR(priv, "Fail finding valid aggregation tid: %d\n", tid);
321 return ret;
320} 322}
321 323
322static void rs_tl_turn_on_agg(struct iwl_priv *priv, u8 tid, 324static void rs_tl_turn_on_agg(struct iwl_priv *priv, u8 tid,
323 struct iwl_lq_sta *lq_data, 325 struct iwl_lq_sta *lq_data,
324 struct ieee80211_sta *sta) 326 struct ieee80211_sta *sta)
325{ 327{
326 if ((tid < TID_MAX_LOAD_COUNT)) 328 if ((tid < TID_MAX_LOAD_COUNT) &&
327 rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta); 329 !rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta)) {
328 else if (tid == IWL_AGG_ALL_TID) 330 if (priv->cfg->use_rts_for_ht) {
329 for (tid = 0; tid < TID_MAX_LOAD_COUNT; tid++) 331 /*
330 rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta); 332 * switch to RTS/CTS if it is the prefer protection
331 if (priv->cfg->use_rts_for_ht) { 333 * method for HT traffic
332 /* 334 */
333 * switch to RTS/CTS if it is the prefer protection method 335 IWL_DEBUG_HT(priv, "use RTS/CTS protection for HT\n");
334 * for HT traffic 336 priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN;
335 */ 337 iwlcore_commit_rxon(priv);
336 IWL_DEBUG_HT(priv, "use RTS/CTS protection for HT\n"); 338 }
337 priv->staging_rxon.flags &= ~RXON_FLG_SELF_CTS_EN;
338 iwlcore_commit_rxon(priv);
339 } 339 }
340} 340}
341 341
@@ -2558,8 +2558,17 @@ void iwl_rs_rate_init(struct iwl_priv *priv, struct ieee80211_sta *sta, u8 sta_i
2558 lq_sta->active_mimo3_rate); 2558 lq_sta->active_mimo3_rate);
2559 2559
2560 /* These values will be overridden later */ 2560 /* These values will be overridden later */
2561 lq_sta->lq.general_params.single_stream_ant_msk = ANT_A; 2561 lq_sta->lq.general_params.single_stream_ant_msk =
2562 lq_sta->lq.general_params.dual_stream_ant_msk = ANT_AB; 2562 first_antenna(priv->hw_params.valid_tx_ant);
2563 lq_sta->lq.general_params.dual_stream_ant_msk =
2564 priv->hw_params.valid_tx_ant &
2565 ~first_antenna(priv->hw_params.valid_tx_ant);
2566 if (!lq_sta->lq.general_params.dual_stream_ant_msk) {
2567 lq_sta->lq.general_params.dual_stream_ant_msk = ANT_AB;
2568 } else if (num_of_ant(priv->hw_params.valid_tx_ant) == 2) {
2569 lq_sta->lq.general_params.dual_stream_ant_msk =
2570 priv->hw_params.valid_tx_ant;
2571 }
2563 2572
2564 /* as default allow aggregation for all tids */ 2573 /* as default allow aggregation for all tids */
2565 lq_sta->tx_agg_tid_en = IWL_AGG_ALL_TID; 2574 lq_sta->tx_agg_tid_en = IWL_AGG_ALL_TID;