aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-01-19 05:53:54 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-01-31 16:19:32 -0500
commit7b09068721b1a1bbba9372d0293c21d2425b14de (patch)
tree6875faf8f18a44276fabff5a27c0ddb8eed5a8ab /drivers/net
parent9b7688328422b88a7a15dc0dc123ad9ab1a6e22d (diff)
iwlwifi: use maximum aggregation size
Use the values from the peer to set up the ucode for the right maximum number of subframes in an aggregate. Since the ucode only tracks this per station, use the minimum across all aggregation sessions with this peer. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c32
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h1
3 files changed, 32 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 20d01a312a07..d03b4734c892 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2890,6 +2890,8 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
2890 u8 ant_toggle_cnt = 0; 2890 u8 ant_toggle_cnt = 0;
2891 u8 use_ht_possible = 1; 2891 u8 use_ht_possible = 1;
2892 u8 valid_tx_ant = 0; 2892 u8 valid_tx_ant = 0;
2893 struct iwl_station_priv *sta_priv =
2894 container_of(lq_sta, struct iwl_station_priv, lq_sta);
2893 struct iwl_link_quality_cmd *lq_cmd = &lq_sta->lq; 2895 struct iwl_link_quality_cmd *lq_cmd = &lq_sta->lq;
2894 2896
2895 /* Override starting rate (index 0) if needed for debug purposes */ 2897 /* Override starting rate (index 0) if needed for debug purposes */
@@ -3008,7 +3010,8 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
3008 repeat_rate--; 3010 repeat_rate--;
3009 } 3011 }
3010 3012
3011 lq_cmd->agg_params.agg_frame_cnt_limit = LINK_QUAL_AGG_FRAME_LIMIT_DEF; 3013 lq_cmd->agg_params.agg_frame_cnt_limit =
3014 sta_priv->max_agg_bufsize ?: LINK_QUAL_AGG_FRAME_LIMIT_DEF;
3012 lq_cmd->agg_params.agg_dis_start_th = LINK_QUAL_AGG_DISABLE_START_DEF; 3015 lq_cmd->agg_params.agg_dis_start_th = LINK_QUAL_AGG_DISABLE_START_DEF;
3013 3016
3014 lq_cmd->agg_params.agg_time_limit = 3017 lq_cmd->agg_params.agg_time_limit =
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index dcc4b2d55988..cf285f53ad1d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3429,6 +3429,7 @@ int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
3429{ 3429{
3430 struct iwl_priv *priv = hw->priv; 3430 struct iwl_priv *priv = hw->priv;
3431 int ret = -EINVAL; 3431 int ret = -EINVAL;
3432 struct iwl_station_priv *sta_priv = (void *) sta->drv_priv;
3432 3433
3433 IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n", 3434 IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n",
3434 sta->addr, tid); 3435 sta->addr, tid);
@@ -3483,11 +3484,28 @@ int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
3483 } 3484 }
3484 break; 3485 break;
3485 case IEEE80211_AMPDU_TX_OPERATIONAL: 3486 case IEEE80211_AMPDU_TX_OPERATIONAL:
3487 /*
3488 * If the limit is 0, then it wasn't initialised yet,
3489 * use the default. We can do that since we take the
3490 * minimum below, and we don't want to go above our
3491 * default due to hardware restrictions.
3492 */
3493 if (sta_priv->max_agg_bufsize == 0)
3494 sta_priv->max_agg_bufsize =
3495 LINK_QUAL_AGG_FRAME_LIMIT_DEF;
3496
3497 /*
3498 * Even though in theory the peer could have different
3499 * aggregation reorder buffer sizes for different sessions,
3500 * our ucode doesn't allow for that and has a global limit
3501 * for each station. Therefore, use the minimum of all the
3502 * aggregation sessions and our default value.
3503 */
3504 sta_priv->max_agg_bufsize =
3505 min(sta_priv->max_agg_bufsize, buf_size);
3506
3486 if (priv->cfg->ht_params && 3507 if (priv->cfg->ht_params &&
3487 priv->cfg->ht_params->use_rts_for_aggregation) { 3508 priv->cfg->ht_params->use_rts_for_aggregation) {
3488 struct iwl_station_priv *sta_priv =
3489 (void *) sta->drv_priv;
3490
3491 /* 3509 /*
3492 * switch to RTS/CTS if it is the prefer protection 3510 * switch to RTS/CTS if it is the prefer protection
3493 * method for HT traffic 3511 * method for HT traffic
@@ -3495,9 +3513,13 @@ int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
3495 3513
3496 sta_priv->lq_sta.lq.general_params.flags |= 3514 sta_priv->lq_sta.lq.general_params.flags |=
3497 LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK; 3515 LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK;
3498 iwl_send_lq_cmd(priv, iwl_rxon_ctx_from_vif(vif),
3499 &sta_priv->lq_sta.lq, CMD_ASYNC, false);
3500 } 3516 }
3517
3518 sta_priv->lq_sta.lq.agg_params.agg_frame_cnt_limit =
3519 sta_priv->max_agg_bufsize;
3520
3521 iwl_send_lq_cmd(priv, iwl_rxon_ctx_from_vif(vif),
3522 &sta_priv->lq_sta.lq, CMD_ASYNC, false);
3501 ret = 0; 3523 ret = 0;
3502 break; 3524 break;
3503 } 3525 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index b5f21e041953..c56b797e1a1a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -509,6 +509,7 @@ struct iwl_station_priv {
509 atomic_t pending_frames; 509 atomic_t pending_frames;
510 bool client; 510 bool client;
511 bool asleep; 511 bool asleep;
512 u8 max_agg_bufsize;
512}; 513};
513 514
514/** 515/**