aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-09-10 21:04:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-15 16:48:24 -0400
commitae17e986091637e7ef5a8224c7b689029b105131 (patch)
tree184fb207b36348f4ac989831b3425d9d67221e02 /drivers/net/wireless/iwlwifi/iwl-3945-rs.c
parent323ce79a9cdbf838ea577677b1ddace8e0b4d4c6 (diff)
mac80211: move txrate_idx into RC algorithms
The sta_info->txrate_idx member isn't used by all RC algorithms in the way it was intended to be used, move it into those that require it (only PID) and keep track in the core code of which rate was last used for reporting to userspace and the mesh MLME. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> 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.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index f751b909759..a279bf1dc9b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -334,13 +334,11 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
334 334
335 for (i = IWL_RATE_COUNT - 1; i >= 0; i--) { 335 for (i = IWL_RATE_COUNT - 1; i >= 0; i--) {
336 if (sta->sta.supp_rates[local->hw.conf.channel->band] & (1 << i)) { 336 if (sta->sta.supp_rates[local->hw.conf.channel->band] & (1 << i)) {
337 sta->txrate_idx = i; 337 rs_sta->last_txrate_idx = i;
338 break; 338 break;
339 } 339 }
340 } 340 }
341 341
342 rs_sta->last_txrate_idx = sta->txrate_idx;
343
344 /* For 5 GHz band it start at IWL_FIRST_OFDM_RATE */ 342 /* For 5 GHz band it start at IWL_FIRST_OFDM_RATE */
345 if (local->hw.conf.channel->band == IEEE80211_BAND_5GHZ) 343 if (local->hw.conf.channel->band == IEEE80211_BAND_5GHZ)
346 rs_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE; 344 rs_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE;
@@ -809,15 +807,13 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev,
809 807
810 rs_sta->last_txrate_idx = index; 808 rs_sta->last_txrate_idx = index;
811 if (sband->band == IEEE80211_BAND_5GHZ) 809 if (sband->band == IEEE80211_BAND_5GHZ)
812 sta->txrate_idx = rs_sta->last_txrate_idx - IWL_FIRST_OFDM_RATE; 810 sel->rate_idx = rs_sta->last_txrate_idx - IWL_FIRST_OFDM_RATE;
813 else 811 else
814 sta->txrate_idx = rs_sta->last_txrate_idx; 812 sel->rate_idx = rs_sta->last_txrate_idx;
815 813
816 rcu_read_unlock(); 814 rcu_read_unlock();
817 815
818 IWL_DEBUG_RATE("leave: %d\n", index); 816 IWL_DEBUG_RATE("leave: %d\n", index);
819
820 sel->rate_idx = sta->txrate_idx;
821} 817}
822 818
823static struct rate_control_ops rs_ops = { 819static struct rate_control_ops rs_ops = {