Skip to content

Commit 84782c4

Browse files
committed
Revert "iwl3945: Fix rate scale for B-mode connection"
This reverts commit 88a39e5.
1 parent 355fe78 commit 84782c4

File tree

3 files changed

+16
-39
lines changed

3 files changed

+16
-39
lines changed

drivers/net/wireless/iwlwifi/iwl-3945-rs.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,10 @@ static void iwl3945_collect_tx_data(struct iwl3945_rs_sta *rs_sta,
335335

336336
}
337337

338-
static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
338+
static void rs_rate_init(void *priv, struct ieee80211_supported_band *sband,
339339
struct ieee80211_sta *sta, void *priv_sta)
340340
{
341341
struct iwl3945_rs_sta *rs_sta = priv_sta;
342-
struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r;
343342
int i;
344343

345344
IWL_DEBUG_RATE("enter\n");
@@ -349,21 +348,16 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
349348
* previous packets? Need to have IEEE 802.1X auth succeed immediately
350349
* after assoc.. */
351350

352-
for (i = sband->n_bitrates - 1; i >= 0; i--) {
351+
for (i = IWL_RATE_COUNT - 1; i >= 0; i--) {
353352
if (sta->supp_rates[sband->band] & (1 << i)) {
354353
rs_sta->last_txrate_idx = i;
355354
break;
356355
}
357356
}
358357

359-
priv->sta_supp_rates = sta->supp_rates[sband->band];
360358
/* For 5 GHz band it start at IWL_FIRST_OFDM_RATE */
361-
if (sband->band == IEEE80211_BAND_5GHZ) {
359+
if (sband->band == IEEE80211_BAND_5GHZ)
362360
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-
367361

368362
IWL_DEBUG_RATE("leave\n");
369363
}

drivers/net/wireless/iwlwifi/iwl-3945.c

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,12 @@ int iwl3945_rs_next_rate(struct iwl3945_priv *priv, int rate)
277277
else if (rate == IWL_RATE_6M_INDEX)
278278
next_rate = IWL_RATE_6M_INDEX;
279279
break;
280-
case IEEE80211_BAND_2GHZ:
281-
if (!(priv->sta_supp_rates & IWL_OFDM_RATES_MASK) &&
282-
iwl3945_is_associated(priv)) {
283-
if (rate == IWL_RATE_11M_INDEX)
284-
next_rate = IWL_RATE_5M_INDEX;
285-
}
280+
/* XXX cannot be invoked in current mac80211 so not a regression
281+
case MODE_IEEE80211B:
282+
if (rate == IWL_RATE_11M_INDEX_TABLE)
283+
next_rate = IWL_RATE_5M_INDEX_TABLE;
286284
break;
287-
285+
*/
288286
default:
289287
break;
290288
}
@@ -2381,23 +2379,19 @@ int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv)
23812379
iwl3945_hw_set_rate_n_flags(iwl3945_rates[i].plcp, 0);
23822380
table[index].try_cnt = priv->retry_rate;
23832381
prev_index = iwl3945_get_prev_ieee_rate(i);
2384-
table[index].next_rate_index =
2385-
iwl3945_rates[prev_index].table_rs_index;
2382+
table[index].next_rate_index = iwl3945_rates[prev_index].table_rs_index;
23862383
}
23872384

23882385
switch (priv->band) {
23892386
case IEEE80211_BAND_5GHZ:
23902387
IWL_DEBUG_RATE("Select A mode rate scale\n");
23912388
/* If one of the following CCK rates is used,
23922389
* have it fall back to the 6M OFDM rate */
2393-
for (i = IWL_RATE_1M_INDEX_TABLE;
2394-
i <= IWL_RATE_11M_INDEX_TABLE; i++)
2395-
table[i].next_rate_index =
2396-
iwl3945_rates[IWL_FIRST_OFDM_RATE].table_rs_index;
2390+
for (i = IWL_RATE_1M_INDEX_TABLE; i <= IWL_RATE_11M_INDEX_TABLE; i++)
2391+
table[i].next_rate_index = iwl3945_rates[IWL_FIRST_OFDM_RATE].table_rs_index;
23972392

23982393
/* Don't fall back to CCK rates */
2399-
table[IWL_RATE_12M_INDEX_TABLE].next_rate_index =
2400-
IWL_RATE_9M_INDEX_TABLE;
2394+
table[IWL_RATE_12M_INDEX_TABLE].next_rate_index = IWL_RATE_9M_INDEX_TABLE;
24012395

24022396
/* Don't drop out of OFDM rates */
24032397
table[IWL_RATE_6M_INDEX_TABLE].next_rate_index =
@@ -2408,20 +2402,11 @@ int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv)
24082402
IWL_DEBUG_RATE("Select B/G mode rate scale\n");
24092403
/* If an OFDM rate is used, have it fall back to the
24102404
* 1M CCK rates */
2405+
for (i = IWL_RATE_6M_INDEX_TABLE; i <= IWL_RATE_54M_INDEX_TABLE; i++)
2406+
table[i].next_rate_index = iwl3945_rates[IWL_FIRST_CCK_RATE].table_rs_index;
24112407

2412-
if (!(priv->sta_supp_rates & IWL_OFDM_RATES_MASK) &&
2413-
iwl3945_is_associated(priv)) {
2414-
2415-
index = IWL_FIRST_CCK_RATE;
2416-
for (i = IWL_RATE_6M_INDEX_TABLE;
2417-
i <= IWL_RATE_54M_INDEX_TABLE; i++)
2418-
table[i].next_rate_index =
2419-
iwl3945_rates[index].table_rs_index;
2420-
2421-
index = IWL_RATE_11M_INDEX_TABLE;
2422-
/* CCK shouldn't fall back to OFDM... */
2423-
table[index].next_rate_index = IWL_RATE_5M_INDEX_TABLE;
2424-
}
2408+
/* CCK shouldn't fall back to OFDM... */
2409+
table[IWL_RATE_11M_INDEX_TABLE].next_rate_index = IWL_RATE_5M_INDEX_TABLE;
24252410
break;
24262411

24272412
default:

drivers/net/wireless/iwlwifi/iwl-3945.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,6 @@ struct iwl3945_priv {
810810
u16 active_rate;
811811
u16 active_rate_basic;
812812

813-
u32 sta_supp_rates;
814-
815813
u8 call_post_assoc_from_beacon;
816814
/* Rate scaling data */
817815
s8 data_retry_limit;

0 commit comments

Comments
 (0)