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-agn-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-agn-rs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index af4e0b994e42..54f076bb2022 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -163,6 +163,9 @@ struct iwl_lq_sta { | |||
163 | u32 dbg_fixed_rate; | 163 | u32 dbg_fixed_rate; |
164 | #endif | 164 | #endif |
165 | struct iwl_priv *drv; | 165 | struct iwl_priv *drv; |
166 | |||
167 | /* used to be in sta_info */ | ||
168 | int last_txrate_idx; | ||
166 | }; | 169 | }; |
167 | 170 | ||
168 | static void rs_rate_scale_perform(struct iwl_priv *priv, | 171 | static void rs_rate_scale_perform(struct iwl_priv *priv, |
@@ -1746,7 +1749,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, | |||
1746 | is_green = lq_sta->is_green; | 1749 | is_green = lq_sta->is_green; |
1747 | 1750 | ||
1748 | /* current tx rate */ | 1751 | /* current tx rate */ |
1749 | index = sta->last_txrate_idx; | 1752 | index = lq_sta->last_txrate_idx; |
1750 | 1753 | ||
1751 | IWL_DEBUG_RATE("Rate scale index %d for type %d\n", index, | 1754 | IWL_DEBUG_RATE("Rate scale index %d for type %d\n", index, |
1752 | tbl->lq_type); | 1755 | tbl->lq_type); |
@@ -2059,7 +2062,7 @@ lq_update: | |||
2059 | out: | 2062 | out: |
2060 | tbl->current_rate = rate_n_flags_from_tbl(tbl, index, is_green); | 2063 | tbl->current_rate = rate_n_flags_from_tbl(tbl, index, is_green); |
2061 | i = index; | 2064 | i = index; |
2062 | sta->last_txrate_idx = i; | 2065 | lq_sta->last_txrate_idx = i; |
2063 | 2066 | ||
2064 | /* sta->txrate_idx is an index to A mode rates which start | 2067 | /* sta->txrate_idx is an index to A mode rates which start |
2065 | * at IWL_FIRST_OFDM_RATE | 2068 | * at IWL_FIRST_OFDM_RATE |
@@ -2090,7 +2093,7 @@ static void rs_initialize_lq(struct iwl_priv *priv, | |||
2090 | goto out; | 2093 | goto out; |
2091 | 2094 | ||
2092 | lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv; | 2095 | lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv; |
2093 | i = sta->last_txrate_idx; | 2096 | i = lq_sta->last_txrate_idx; |
2094 | 2097 | ||
2095 | if ((lq_sta->lq.sta_id == 0xff) && | 2098 | if ((lq_sta->lq.sta_id == 0xff) && |
2096 | (priv->iw_mode == NL80211_IFTYPE_ADHOC)) | 2099 | (priv->iw_mode == NL80211_IFTYPE_ADHOC)) |
@@ -2161,7 +2164,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, | |||
2161 | } | 2164 | } |
2162 | 2165 | ||
2163 | lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv; | 2166 | lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv; |
2164 | i = sta->last_txrate_idx; | 2167 | i = lq_sta->last_txrate_idx; |
2165 | 2168 | ||
2166 | if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) && | 2169 | if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) && |
2167 | !lq_sta->ibss_sta_added) { | 2170 | !lq_sta->ibss_sta_added) { |
@@ -2270,10 +2273,10 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, | |||
2270 | if (sta->supp_rates[sband->band] & BIT(i)) | 2273 | if (sta->supp_rates[sband->band] & BIT(i)) |
2271 | sta->txrate_idx = i; | 2274 | sta->txrate_idx = i; |
2272 | 2275 | ||
2273 | sta->last_txrate_idx = sta->txrate_idx; | 2276 | lq_sta->last_txrate_idx = sta->txrate_idx; |
2274 | /* For MODE_IEEE80211A, skip over cck rates in global rate table */ | 2277 | /* For MODE_IEEE80211A, skip over cck rates in global rate table */ |
2275 | if (local->hw.conf.channel->band == IEEE80211_BAND_5GHZ) | 2278 | if (local->hw.conf.channel->band == IEEE80211_BAND_5GHZ) |
2276 | sta->last_txrate_idx += IWL_FIRST_OFDM_RATE; | 2279 | lq_sta->last_txrate_idx += IWL_FIRST_OFDM_RATE; |
2277 | 2280 | ||
2278 | lq_sta->is_dup = 0; | 2281 | lq_sta->is_dup = 0; |
2279 | lq_sta->is_green = rs_use_green(priv, conf); | 2282 | lq_sta->is_green = rs_use_green(priv, conf); |