aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-23 08:29:21 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-07-31 10:18:55 -0400
commit679ef4eadde1f8e55074427c0d8de2da55ca81f9 (patch)
tree35d87a3631699ee7bed7296731bc86a4ea767a3c
parent568d6e289736c9c78cd8723aa81415daffafeff9 (diff)
mac80211: use oper_channel in utils and config
Using hw.conf.channel is wrong as it could be the temporary channel if any function like the beacon get function is called while scanning or during other temporary out-of-channel activities. Use oper_channel instead. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/cfg.c6
-rw-r--r--net/mac80211/iface.c2
-rw-r--r--net/mac80211/util.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 06b8d39780e9..1b8d19112943 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -330,7 +330,7 @@ static void rate_idx_to_bitrate(struct rate_info *rate, struct sta_info *sta, in
330 if (!(rate->flags & RATE_INFO_FLAGS_MCS)) { 330 if (!(rate->flags & RATE_INFO_FLAGS_MCS)) {
331 struct ieee80211_supported_band *sband; 331 struct ieee80211_supported_band *sband;
332 sband = sta->local->hw.wiphy->bands[ 332 sband = sta->local->hw.wiphy->bands[
333 sta->local->hw.conf.channel->band]; 333 sta->local->oper_channel->band];
334 rate->legacy = sband->bitrates[idx].bitrate; 334 rate->legacy = sband->bitrates[idx].bitrate;
335 } else 335 } else
336 rate->mcs = idx; 336 rate->mcs = idx;
@@ -1662,7 +1662,7 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
1662 } 1662 }
1663 1663
1664 if (!sdata->vif.bss_conf.use_short_slot && 1664 if (!sdata->vif.bss_conf.use_short_slot &&
1665 sdata->local->hw.conf.channel->band == IEEE80211_BAND_5GHZ) { 1665 sdata->local->oper_channel->band == IEEE80211_BAND_5GHZ) {
1666 sdata->vif.bss_conf.use_short_slot = true; 1666 sdata->vif.bss_conf.use_short_slot = true;
1667 changed |= BSS_CHANGED_ERP_SLOT; 1667 changed |= BSS_CHANGED_ERP_SLOT;
1668 } 1668 }
@@ -1928,7 +1928,7 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy,
1928 enum nl80211_tx_power_setting type, int mbm) 1928 enum nl80211_tx_power_setting type, int mbm)
1929{ 1929{
1930 struct ieee80211_local *local = wiphy_priv(wiphy); 1930 struct ieee80211_local *local = wiphy_priv(wiphy);
1931 struct ieee80211_channel *chan = local->hw.conf.channel; 1931 struct ieee80211_channel *chan = local->oper_channel;
1932 u32 changes = 0; 1932 u32 changes = 0;
1933 1933
1934 switch (type) { 1934 switch (type) {
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index bfb57dcc1538..fc8ba83e2c33 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1274,7 +1274,7 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
1274 /* reset some values that shouldn't be kept across type changes */ 1274 /* reset some values that shouldn't be kept across type changes */
1275 sdata->vif.bss_conf.basic_rates = 1275 sdata->vif.bss_conf.basic_rates =
1276 ieee80211_mandatory_rates(sdata->local, 1276 ieee80211_mandatory_rates(sdata->local,
1277 sdata->local->hw.conf.channel->band); 1277 sdata->local->oper_channel->band);
1278 sdata->drop_unencrypted = 0; 1278 sdata->drop_unencrypted = 0;
1279 if (type == NL80211_IFTYPE_STATION) 1279 if (type == NL80211_IFTYPE_STATION)
1280 sdata->u.mgd.use_4addr = false; 1280 sdata->u.mgd.use_4addr = false;
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 037d148e9f19..39005eca1a59 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -832,7 +832,7 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
832 832
833 memset(&qparam, 0, sizeof(qparam)); 833 memset(&qparam, 0, sizeof(qparam));
834 834
835 use_11b = (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ) && 835 use_11b = (local->oper_channel->band == IEEE80211_BAND_2GHZ) &&
836 !(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE); 836 !(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE);
837 837
838 /* 838 /*
@@ -919,7 +919,7 @@ void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
919 if ((supp_rates[i] & 0x7f) * 5 > 110) 919 if ((supp_rates[i] & 0x7f) * 5 > 110)
920 have_higher_than_11mbit = 1; 920 have_higher_than_11mbit = 1;
921 921
922 if (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ && 922 if (local->oper_channel->band == IEEE80211_BAND_2GHZ &&
923 have_higher_than_11mbit) 923 have_higher_than_11mbit)
924 sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE; 924 sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
925 else 925 else