diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-10 20:22:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-15 16:48:24 -0400 |
commit | b7e35008815a1c39123f4dd53b430788e2e18da4 (patch) | |
tree | a071c5d2c1224eed68a3684b6367155b1eccfebf /drivers/net/wireless/iwlwifi/iwl-3945-rs.c | |
parent | 95dac040041723d0c0ab245642c1b9802f12cc8d (diff) |
mac80211: move last_txrate_idx into RC algorithms
This variable in sta_info is only used in a meaningful way
by the Intel RC algorithms, so move it into those.
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.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c index da23c927380f..46b672c34585 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c | |||
@@ -65,6 +65,9 @@ struct iwl3945_rs_sta { | |||
65 | u8 ibss_sta_added; | 65 | u8 ibss_sta_added; |
66 | struct timer_list rate_scale_flush; | 66 | struct timer_list rate_scale_flush; |
67 | struct iwl3945_rate_scale_data win[IWL_RATE_COUNT]; | 67 | struct iwl3945_rate_scale_data win[IWL_RATE_COUNT]; |
68 | |||
69 | /* used to be in sta_info */ | ||
70 | int last_txrate_idx; | ||
68 | }; | 71 | }; |
69 | 72 | ||
70 | static s32 iwl3945_expected_tpt_g[IWL_RATE_COUNT] = { | 73 | static s32 iwl3945_expected_tpt_g[IWL_RATE_COUNT] = { |
@@ -319,6 +322,7 @@ static void iwl3945_collect_tx_data(struct iwl3945_rs_sta *rs_sta, | |||
319 | static void rs_rate_init(void *priv_rate, void *priv_sta, | 322 | static void rs_rate_init(void *priv_rate, void *priv_sta, |
320 | struct ieee80211_local *local, struct sta_info *sta) | 323 | struct ieee80211_local *local, struct sta_info *sta) |
321 | { | 324 | { |
325 | struct iwl3945_rs_sta *rs_sta = (void *)sta->rate_ctrl_priv; | ||
322 | int i; | 326 | int i; |
323 | 327 | ||
324 | IWL_DEBUG_RATE("enter\n"); | 328 | IWL_DEBUG_RATE("enter\n"); |
@@ -335,11 +339,11 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, | |||
335 | } | 339 | } |
336 | } | 340 | } |
337 | 341 | ||
338 | sta->last_txrate_idx = sta->txrate_idx; | 342 | rs_sta->last_txrate_idx = sta->txrate_idx; |
339 | 343 | ||
340 | /* For 5 GHz band it start at IWL_FIRST_OFDM_RATE */ | 344 | /* For 5 GHz band it start at IWL_FIRST_OFDM_RATE */ |
341 | if (local->hw.conf.channel->band == IEEE80211_BAND_5GHZ) | 345 | if (local->hw.conf.channel->band == IEEE80211_BAND_5GHZ) |
342 | sta->last_txrate_idx += IWL_FIRST_OFDM_RATE; | 346 | rs_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE; |
343 | 347 | ||
344 | IWL_DEBUG_RATE("leave\n"); | 348 | IWL_DEBUG_RATE("leave\n"); |
345 | } | 349 | } |
@@ -674,14 +678,14 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
674 | return; | 678 | return; |
675 | } | 679 | } |
676 | 680 | ||
681 | rs_sta = (void *)sta->rate_ctrl_priv; | ||
682 | |||
677 | rate_mask = sta->supp_rates[sband->band]; | 683 | rate_mask = sta->supp_rates[sband->band]; |
678 | index = min(sta->last_txrate_idx & 0xffff, IWL_RATE_COUNT - 1); | 684 | index = min(rs_sta->last_txrate_idx & 0xffff, IWL_RATE_COUNT - 1); |
679 | 685 | ||
680 | if (sband->band == IEEE80211_BAND_5GHZ) | 686 | if (sband->band == IEEE80211_BAND_5GHZ) |
681 | rate_mask = rate_mask << IWL_FIRST_OFDM_RATE; | 687 | rate_mask = rate_mask << IWL_FIRST_OFDM_RATE; |
682 | 688 | ||
683 | rs_sta = (void *)sta->rate_ctrl_priv; | ||
684 | |||
685 | if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) && | 689 | if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) && |
686 | !rs_sta->ibss_sta_added) { | 690 | !rs_sta->ibss_sta_added) { |
687 | u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1); | 691 | u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1); |
@@ -803,11 +807,11 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
803 | 807 | ||
804 | out: | 808 | out: |
805 | 809 | ||
806 | sta->last_txrate_idx = index; | 810 | rs_sta->last_txrate_idx = index; |
807 | if (sband->band == IEEE80211_BAND_5GHZ) | 811 | if (sband->band == IEEE80211_BAND_5GHZ) |
808 | sta->txrate_idx = sta->last_txrate_idx - IWL_FIRST_OFDM_RATE; | 812 | sta->txrate_idx = rs_sta->last_txrate_idx - IWL_FIRST_OFDM_RATE; |
809 | else | 813 | else |
810 | sta->txrate_idx = sta->last_txrate_idx; | 814 | sta->txrate_idx = rs_sta->last_txrate_idx; |
811 | 815 | ||
812 | rcu_read_unlock(); | 816 | rcu_read_unlock(); |
813 | 817 | ||