aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-03-01 04:12:57 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 19:01:09 -0400
commit5421e40def70b76fb0a677f963a8390b6c3cc69a (patch)
treeaee345097385fb64ffd9a642b34bf50312a84449
parent6c6a223088cf477b941fd57806dd0187ada219a0 (diff)
mac80211: Fix HT rate control configuration
commit 4fa004373133ece3d9b1c0a7e243b0e53760b165 upstream. Handling HT configuration changes involved setting the channel with the new HT parameters and then issuing a rate_update() notification to the driver. This behavior changed after the off-channel changes. Now, the channel is not updated with the new HT params in enable_ht() - instead, it is now done when the scan work terminates. This results in the driver depending on stale information, defaulting to non-HT mode always. Fix this by passing the new channel type to the driver. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c6
-rw-r--r--include/net/mac80211.h3
-rw-r--r--net/mac80211/mlme.c3
-rw-r--r--net/mac80211/rate.h5
4 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 1d6cf7df7c66..171ce2bfc24f 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1323,7 +1323,7 @@ static void ath_rate_init(void *priv, struct ieee80211_supported_band *sband,
1323 1323
1324static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband, 1324static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
1325 struct ieee80211_sta *sta, void *priv_sta, 1325 struct ieee80211_sta *sta, void *priv_sta,
1326 u32 changed) 1326 u32 changed, enum nl80211_channel_type oper_chan_type)
1327{ 1327{
1328 struct ath_softc *sc = priv; 1328 struct ath_softc *sc = priv;
1329 struct ath_rate_priv *ath_rc_priv = priv_sta; 1329 struct ath_rate_priv *ath_rc_priv = priv_sta;
@@ -1340,8 +1340,8 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
1340 if (sc->sc_ah->opmode != NL80211_IFTYPE_STATION) 1340 if (sc->sc_ah->opmode != NL80211_IFTYPE_STATION)
1341 return; 1341 return;
1342 1342
1343 if (sc->hw->conf.channel_type == NL80211_CHAN_HT40MINUS || 1343 if (oper_chan_type == NL80211_CHAN_HT40MINUS ||
1344 sc->hw->conf.channel_type == NL80211_CHAN_HT40PLUS) 1344 oper_chan_type == NL80211_CHAN_HT40PLUS)
1345 oper_cw40 = true; 1345 oper_cw40 = true;
1346 1346
1347 oper_sgi40 = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? 1347 oper_sgi40 = (sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ?
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 0bf369752274..15bcb56106ec 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2258,7 +2258,8 @@ struct rate_control_ops {
2258 struct ieee80211_sta *sta, void *priv_sta); 2258 struct ieee80211_sta *sta, void *priv_sta);
2259 void (*rate_update)(void *priv, struct ieee80211_supported_band *sband, 2259 void (*rate_update)(void *priv, struct ieee80211_supported_band *sband,
2260 struct ieee80211_sta *sta, 2260 struct ieee80211_sta *sta,
2261 void *priv_sta, u32 changed); 2261 void *priv_sta, u32 changed,
2262 enum nl80211_channel_type oper_chan_type);
2262 void (*free_sta)(void *priv, struct ieee80211_sta *sta, 2263 void (*free_sta)(void *priv, struct ieee80211_sta *sta,
2263 void *priv_sta); 2264 void *priv_sta);
2264 2265
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 05a18f43e1bf..9072a412089e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -205,7 +205,8 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
205 sta = sta_info_get(local, bssid); 205 sta = sta_info_get(local, bssid);
206 if (sta) 206 if (sta)
207 rate_control_rate_update(local, sband, sta, 207 rate_control_rate_update(local, sband, sta,
208 IEEE80211_RC_HT_CHANGED); 208 IEEE80211_RC_HT_CHANGED,
209 local->oper_channel_type);
209 rcu_read_unlock(); 210 rcu_read_unlock();
210 } 211 }
211 212
diff --git a/net/mac80211/rate.h b/net/mac80211/rate.h
index cb9bd1f65e27..3e02ea4eecd1 100644
--- a/net/mac80211/rate.h
+++ b/net/mac80211/rate.h
@@ -69,7 +69,8 @@ static inline void rate_control_rate_init(struct sta_info *sta)
69 69
70static inline void rate_control_rate_update(struct ieee80211_local *local, 70static inline void rate_control_rate_update(struct ieee80211_local *local,
71 struct ieee80211_supported_band *sband, 71 struct ieee80211_supported_band *sband,
72 struct sta_info *sta, u32 changed) 72 struct sta_info *sta, u32 changed,
73 enum nl80211_channel_type oper_chan_type)
73{ 74{
74 struct rate_control_ref *ref = local->rate_ctrl; 75 struct rate_control_ref *ref = local->rate_ctrl;
75 struct ieee80211_sta *ista = &sta->sta; 76 struct ieee80211_sta *ista = &sta->sta;
@@ -77,7 +78,7 @@ static inline void rate_control_rate_update(struct ieee80211_local *local,
77 78
78 if (ref && ref->ops->rate_update) 79 if (ref && ref->ops->rate_update)
79 ref->ops->rate_update(ref->priv, sband, ista, 80 ref->ops->rate_update(ref->priv, sband, ista,
80 priv_sta, changed); 81 priv_sta, changed, oper_chan_type);
81} 82}
82 83
83static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, 84static inline void *rate_control_alloc_sta(struct rate_control_ref *ref,