aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorMohamed Abbas <mohamed.abbas@intel.com>2008-12-12 11:22:15 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-19 15:23:10 -0500
commitd5e490362feb648048ef20db9b0b2531d5425775 (patch)
treed7e3147748bfb7a6c9bd82fdc350f0a80e60153b /drivers/net/wireless
parentb8d476c8cb64a1640d8762aa442b8a73fa74b7d5 (diff)
iwlagn: fix agn rate scaling
Rate scaling in agn can be broken because of these two problems 1- the LQ command could not sent, we try to call LQ command before post association will be rejected, this will cause the driver to break in rs_tx_status reporting initial rate does not match. 2- In rs_rate_init we can get a value of 12, rate 60, for last_txrate_idx, this rate only valid in SISO/MIMO mode only Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 37b892044a18..f3f17929ca0b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -836,6 +836,10 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband,
836 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate != 836 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate !=
837 hw->wiphy->bands[info->band]->bitrates[info->status.rates[0].idx].bitrate)) { 837 hw->wiphy->bands[info->band]->bitrates[info->status.rates[0].idx].bitrate)) {
838 IWL_DEBUG_RATE("initial rate does not match 0x%x\n", tx_rate); 838 IWL_DEBUG_RATE("initial rate does not match 0x%x\n", tx_rate);
839 /* the last LQ command could failed so the LQ in ucode not
840 * the same in driver sync up
841 */
842 iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC);
839 goto out; 843 goto out;
840 } 844 }
841 845
@@ -2167,6 +2171,7 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2167 struct iwl_priv *priv = (struct iwl_priv *)priv_r; 2171 struct iwl_priv *priv = (struct iwl_priv *)priv_r;
2168 struct ieee80211_conf *conf = &priv->hw->conf; 2172 struct ieee80211_conf *conf = &priv->hw->conf;
2169 struct iwl_lq_sta *lq_sta = priv_sta; 2173 struct iwl_lq_sta *lq_sta = priv_sta;
2174 u16 mask_bit = 0;
2170 2175
2171 lq_sta->flush_timer = 0; 2176 lq_sta->flush_timer = 0;
2172 lq_sta->supp_rates = sta->supp_rates[sband->band]; 2177 lq_sta->supp_rates = sta->supp_rates[sband->band];
@@ -2200,16 +2205,6 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2200 priv->assoc_station_added = 1; 2205 priv->assoc_station_added = 1;
2201 } 2206 }
2202 2207
2203 /* Find highest tx rate supported by hardware and destination station */
2204 lq_sta->last_txrate_idx = 3;
2205 for (i = 0; i < sband->n_bitrates; i++)
2206 if (sta->supp_rates[sband->band] & BIT(i))
2207 lq_sta->last_txrate_idx = i;
2208
2209 /* For MODE_IEEE80211A, skip over cck rates in global rate table */
2210 if (sband->band == IEEE80211_BAND_5GHZ)
2211 lq_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE;
2212
2213 lq_sta->is_dup = 0; 2208 lq_sta->is_dup = 0;
2214 lq_sta->is_green = rs_use_green(priv, conf); 2209 lq_sta->is_green = rs_use_green(priv, conf);
2215 lq_sta->active_legacy_rate = priv->active_rate & ~(0x1000); 2210 lq_sta->active_legacy_rate = priv->active_rate & ~(0x1000);
@@ -2248,6 +2243,17 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2248 lq_sta->tx_agg_tid_en = IWL_AGG_ALL_TID; 2243 lq_sta->tx_agg_tid_en = IWL_AGG_ALL_TID;
2249 lq_sta->drv = priv; 2244 lq_sta->drv = priv;
2250 2245
2246 /* Find highest tx rate supported by hardware and destination station */
2247 mask_bit = sta->supp_rates[sband->band] & lq_sta->active_legacy_rate;
2248 lq_sta->last_txrate_idx = 3;
2249 for (i = 0; i < sband->n_bitrates; i++)
2250 if (mask_bit & BIT(i))
2251 lq_sta->last_txrate_idx = i;
2252
2253 /* For MODE_IEEE80211A, skip over cck rates in global rate table */
2254 if (sband->band == IEEE80211_BAND_5GHZ)
2255 lq_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE;
2256
2251 rs_initialize_lq(priv, conf, sta, lq_sta); 2257 rs_initialize_lq(priv, conf, sta, lq_sta);
2252} 2258}
2253 2259