iwlwifi: mvm: rs: avoid recalc of supported legacy rate mask

The supported legacy rate mask is initialized when rs
is initialized based on the remote peer supported rates.
There's no need to re mask it repeatedly with the supported
remote peer rates.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
This commit is contained in:
Eyal Shapira 2013-12-09 11:14:11 +02:00 committed by Emmanuel Grumbach
parent 8fc7c58c03
commit ca6f38ff4b
2 changed files with 2 additions and 35 deletions

View File

@ -880,16 +880,6 @@ static void rs_get_lower_rate(struct iwl_lq_sta *lq_sta,
rate_mask = rs_get_supported_rates(lq_sta, rate); rate_mask = rs_get_supported_rates(lq_sta, rate);
/* Mask with station rate restriction */
if (is_legacy(rate)) {
/* supp_rates has no CCK bits in A mode */
if (lq_sta->band == IEEE80211_BAND_5GHZ)
rate_mask = (u16)(rate_mask &
(lq_sta->supp_rates << IWL_FIRST_OFDM_RATE));
else
rate_mask = (u16)(rate_mask & lq_sta->supp_rates);
}
/* If we switched from HT to legacy, check current rate */ /* If we switched from HT to legacy, check current rate */
if (switch_to_legacy && (rate_mask & (1 << scale_index))) { if (switch_to_legacy && (rate_mask & (1 << scale_index))) {
low = scale_index; low = scale_index;
@ -1629,7 +1619,6 @@ static void rs_rate_scale_perform(struct iwl_mvm *mvm,
u16 rate_mask; u16 rate_mask;
u8 update_lq = 0; u8 update_lq = 0;
struct iwl_scale_tbl_info *tbl, *tbl1; struct iwl_scale_tbl_info *tbl, *tbl1;
u16 rate_scale_index_msk = 0;
u8 active_tbl = 0; u8 active_tbl = 0;
u8 done_search = 0; u8 done_search = 0;
u16 high_low; u16 high_low;
@ -1646,8 +1635,6 @@ static void rs_rate_scale_perform(struct iwl_mvm *mvm,
info->flags & IEEE80211_TX_CTL_NO_ACK) info->flags & IEEE80211_TX_CTL_NO_ACK)
return; return;
lq_sta->supp_rates = sta->supp_rates[lq_sta->band];
tid = rs_get_tid(lq_sta, hdr); tid = rs_get_tid(lq_sta, hdr);
if ((tid != IWL_MAX_TID_COUNT) && if ((tid != IWL_MAX_TID_COUNT) &&
(lq_sta->tx_agg_tid_en & (1 << tid))) { (lq_sta->tx_agg_tid_en & (1 << tid))) {
@ -1686,24 +1673,7 @@ static void rs_rate_scale_perform(struct iwl_mvm *mvm,
/* rates available for this association, and for modulation mode */ /* rates available for this association, and for modulation mode */
rate_mask = rs_get_supported_rates(lq_sta, rate); rate_mask = rs_get_supported_rates(lq_sta, rate);
/* mask with station rate restriction */ if (!(BIT(index) & rate_mask)) {
if (is_legacy(rate)) {
if (lq_sta->band == IEEE80211_BAND_5GHZ)
/* supp_rates has no CCK bits in A mode */
rate_scale_index_msk = (u16) (rate_mask &
(lq_sta->supp_rates << IWL_FIRST_OFDM_RATE));
else
rate_scale_index_msk = (u16) (rate_mask &
lq_sta->supp_rates);
} else {
rate_scale_index_msk = rate_mask;
}
if (!rate_scale_index_msk)
rate_scale_index_msk = rate_mask;
if (!((BIT(index) & rate_scale_index_msk))) {
IWL_ERR(mvm, "Current Rate is not valid\n"); IWL_ERR(mvm, "Current Rate is not valid\n");
if (lq_sta->search_better_tbl) { if (lq_sta->search_better_tbl) {
/* revert to active table if search table is not valid*/ /* revert to active table if search table is not valid*/
@ -1816,8 +1786,7 @@ static void rs_rate_scale_perform(struct iwl_mvm *mvm,
/* (Else) not in search of better modulation mode, try for better /* (Else) not in search of better modulation mode, try for better
* starting rate, while staying in this mode. */ * starting rate, while staying in this mode. */
high_low = rs_get_adjacent_rate(mvm, index, rate_scale_index_msk, high_low = rs_get_adjacent_rate(mvm, index, rate_mask, rate->type);
rate->type);
low = high_low & 0xff; low = high_low & 0xff;
high = (high_low >> 8) & 0xff; high = (high_low >> 8) & 0xff;
@ -2253,7 +2222,6 @@ void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]); rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]);
lq_sta->flush_timer = 0; lq_sta->flush_timer = 0;
lq_sta->supp_rates = sta->supp_rates[sband->band];
IWL_DEBUG_RATE(mvm, IWL_DEBUG_RATE(mvm,
"LQ: *** rate scale station global init for station %d ***\n", "LQ: *** rate scale station global init for station %d ***\n",

View File

@ -314,7 +314,6 @@ struct iwl_lq_sta {
enum ieee80211_band band; enum ieee80211_band band;
/* The following are bitmaps of rates; IWL_RATE_6M_MASK, etc. */ /* The following are bitmaps of rates; IWL_RATE_6M_MASK, etc. */
u32 supp_rates;
u16 active_legacy_rate; u16 active_legacy_rate;
u16 active_siso_rate; u16 active_siso_rate;
u16 active_mimo2_rate; u16 active_mimo2_rate;