aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
diff options
context:
space:
mode:
authorAbbas, Mohamed <mohamed.abbas@intel.com>2008-12-05 10:58:37 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-12 13:48:21 -0500
commit7262796ab726fcefad9b588a44d1d5a9f221051f (patch)
tree92187f0ee5d569b7c61a764f3201cdcd8cc93c32 /drivers/net/wireless/iwlwifi/iwl-3945-rs.c
parent00e540b3768c96a5e2a9d5d39524fef98b2cd981 (diff)
iwl3945: Fix rate scale for B-mode connection
This patch make sure we use only CCK rate for B only network. For 3945 driver, it sets REPLY_RATE_SCALE command every time we connect to a new network. In this command we set for every rate the number of try and next rate. The problem mac80211 reports same mode for both B and G mode as IEEE80211_BAND_2GHZ which will cause using invalid rate other than CCK in B only network. THis patch on association will examine sta valid rate on association, if no OFDM rate in valid available rates it considers it as B only mode so we can set REPLY_RATE_SCALE command with valid B only network and only choose CCK rate in rate scaling. 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/iwlwifi/iwl-3945-rs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index b03dd06ceabf..047317f26483 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -335,10 +335,11 @@ static void iwl3945_collect_tx_data(struct iwl3945_rs_sta *rs_sta,
335 335
336} 336}
337 337
338static void rs_rate_init(void *priv, struct ieee80211_supported_band *sband, 338static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
339 struct ieee80211_sta *sta, void *priv_sta) 339 struct ieee80211_sta *sta, void *priv_sta)
340{ 340{
341 struct iwl3945_rs_sta *rs_sta = priv_sta; 341 struct iwl3945_rs_sta *rs_sta = priv_sta;
342 struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r;
342 int i; 343 int i;
343 344
344 IWL_DEBUG_RATE("enter\n"); 345 IWL_DEBUG_RATE("enter\n");
@@ -348,16 +349,21 @@ static void rs_rate_init(void *priv, struct ieee80211_supported_band *sband,
348 * previous packets? Need to have IEEE 802.1X auth succeed immediately 349 * previous packets? Need to have IEEE 802.1X auth succeed immediately
349 * after assoc.. */ 350 * after assoc.. */
350 351
351 for (i = IWL_RATE_COUNT - 1; i >= 0; i--) { 352 for (i = sband->n_bitrates - 1; i >= 0; i--) {
352 if (sta->supp_rates[sband->band] & (1 << i)) { 353 if (sta->supp_rates[sband->band] & (1 << i)) {
353 rs_sta->last_txrate_idx = i; 354 rs_sta->last_txrate_idx = i;
354 break; 355 break;
355 } 356 }
356 } 357 }
357 358
359 priv->sta_supp_rates = sta->supp_rates[sband->band];
358 /* For 5 GHz band it start at IWL_FIRST_OFDM_RATE */ 360 /* For 5 GHz band it start at IWL_FIRST_OFDM_RATE */
359 if (sband->band == IEEE80211_BAND_5GHZ) 361 if (sband->band == IEEE80211_BAND_5GHZ) {
360 rs_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE; 362 rs_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE;
363 priv->sta_supp_rates = priv->sta_supp_rates <<
364 IWL_FIRST_OFDM_RATE;
365 }
366
361 367
362 IWL_DEBUG_RATE("leave\n"); 368 IWL_DEBUG_RATE("leave\n");
363} 369}