summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-10-08 01:07:41 +0400
committerArnd Bergmann <arnd@arndb.de>2011-10-08 01:07:41 +0400
commit8efc59ad6764ade520012cb192cd484e5191cd9c (patch)
treed2465d91ebb2652e35cd08f715fc202b3f9e042a /drivers/net/wireless/iwlegacy/iwl-3945-rs.c
parent6f6184a9d01880a3e21349544f73b3720ce5e152 (diff)
parent492c4a0df11573e141a2decc6012b3bddd14a11e (diff)
downloadlinux-8efc59ad6764ade520012cb192cd484e5191cd9c.tar.xz
Merge branch 'sirf/cleanup' into next/cleanup
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-3945-rs.c')
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945-rs.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
index 977bd2477c6a..164bcae821f8 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlegacy/iwl-3945-rs.c
@@ -822,12 +822,15 @@ static void iwl3945_rs_get_rate(void *priv_r, struct ieee80211_sta *sta,
out:
- rs_sta->last_txrate_idx = index;
- if (sband->band == IEEE80211_BAND_5GHZ)
- info->control.rates[0].idx = rs_sta->last_txrate_idx -
- IWL_FIRST_OFDM_RATE;
- else
+ if (sband->band == IEEE80211_BAND_5GHZ) {
+ if (WARN_ON_ONCE(index < IWL_FIRST_OFDM_RATE))
+ index = IWL_FIRST_OFDM_RATE;
+ rs_sta->last_txrate_idx = index;
+ info->control.rates[0].idx = index - IWL_FIRST_OFDM_RATE;
+ } else {
+ rs_sta->last_txrate_idx = index;
info->control.rates[0].idx = rs_sta->last_txrate_idx;
+ }
IWL_DEBUG_RATE(priv, "leave: %d\n", index);
}