Commit 679ef4eadde1f8e55074427c0d8de2da55ca81f9

Authored by Johannes Berg
1 parent 568d6e2897

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>

Showing 3 changed files with 6 additions and 6 deletions Side-by-side Diff

... ... @@ -330,7 +330,7 @@
330 330 if (!(rate->flags & RATE_INFO_FLAGS_MCS)) {
331 331 struct ieee80211_supported_band *sband;
332 332 sband = sta->local->hw.wiphy->bands[
333   - sta->local->hw.conf.channel->band];
  333 + sta->local->oper_channel->band];
334 334 rate->legacy = sband->bitrates[idx].bitrate;
335 335 } else
336 336 rate->mcs = idx;
... ... @@ -1662,7 +1662,7 @@
1662 1662 }
1663 1663  
1664 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 1666 sdata->vif.bss_conf.use_short_slot = true;
1667 1667 changed |= BSS_CHANGED_ERP_SLOT;
1668 1668 }
... ... @@ -1928,7 +1928,7 @@
1928 1928 enum nl80211_tx_power_setting type, int mbm)
1929 1929 {
1930 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 1932 u32 changes = 0;
1933 1933  
1934 1934 switch (type) {
net/mac80211/iface.c
... ... @@ -1274,7 +1274,7 @@
1274 1274 /* reset some values that shouldn't be kept across type changes */
1275 1275 sdata->vif.bss_conf.basic_rates =
1276 1276 ieee80211_mandatory_rates(sdata->local,
1277   - sdata->local->hw.conf.channel->band);
  1277 + sdata->local->oper_channel->band);
1278 1278 sdata->drop_unencrypted = 0;
1279 1279 if (type == NL80211_IFTYPE_STATION)
1280 1280 sdata->u.mgd.use_4addr = false;
... ... @@ -832,7 +832,7 @@
832 832  
833 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 836 !(sdata->flags & IEEE80211_SDATA_OPERATING_GMODE);
837 837  
838 838 /*
... ... @@ -919,7 +919,7 @@
919 919 if ((supp_rates[i] & 0x7f) * 5 > 110)
920 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 923 have_higher_than_11mbit)
924 924 sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
925 925 else