aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorKarl Beldan <karl.beldan@rivierawaves.com>2013-03-25 11:26:57 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-03-25 14:19:35 -0400
commit675a0b049abf6edf30f8dd84c5610b6edc2296c8 (patch)
tree164178c576642dc1ec8ae70d9e26a5ec33472d26 /drivers/net
parent219c38674c262378ec411dd8318ebfd199fbce8d (diff)
mac80211: Use a cfg80211_chan_def in ieee80211_hw_conf_chan
Drivers that don't use chanctxes cannot perform VHT association because they still use a "backward compatibility" pair of {ieee80211_channel, nl80211_channel_type} in ieee80211_conf and ieee80211_local. Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> [fix kernel-doc] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/adm8211.c3
-rw-r--r--drivers/net/wireless/at76c50x-usb.c4
-rw-r--r--drivers/net/wireless/ath/ar5523/ar5523.c14
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c2
-rw-r--r--drivers/net/wireless/ath/ath5k/mac80211-ops.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/beacon.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/calib.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/common.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c16
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_txrx.c8
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/link.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c10
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c6
-rw-r--r--drivers/net/wireless/ath/carl9170/debug.c5
-rw-r--r--drivers/net/wireless/ath/carl9170/mac.c8
-rw-r--r--drivers/net/wireless/ath/carl9170/main.c9
-rw-r--r--drivers/net/wireless/ath/carl9170/phy.c4
-rw-r--r--drivers/net/wireless/b43/b43.h2
-rw-r--r--drivers/net/wireless/b43/main.c8
-rw-r--r--drivers/net/wireless/b43/phy_ht.c5
-rw-r--r--drivers/net/wireless/b43/phy_lcn.c5
-rw-r--r--drivers/net/wireless/b43/phy_n.c5
-rw-r--r--drivers/net/wireless/b43legacy/main.c9
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/channel.c4
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c6
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c4
-rw-r--r--drivers/net/wireless/iwlegacy/3945-rs.c2
-rw-r--r--drivers/net/wireless/iwlegacy/4965-rs.c2
-rw-r--r--drivers/net/wireless/iwlegacy/common.c2
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/rs.c2
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/rxon.c9
-rw-r--r--drivers/net/wireless/libertas_tf/main.c8
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c42
-rw-r--r--drivers/net/wireless/mwl8k.c36
-rw-r--r--drivers/net/wireless/p54/fwio.c4
-rw-r--r--drivers/net/wireless/p54/main.c4
-rw-r--r--drivers/net/wireless/p54/txrx.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c8
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c10
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c2
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/dev.c4
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/grf5101.c3
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/max2820.c2
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/rtl8225.c3
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/sa2400.c3
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187/dev.c4
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187/rtl8225.c3
-rw-r--r--drivers/net/wireless/rtlwifi/base.c4
-rw-r--r--drivers/net/wireless/rtlwifi/core.c6
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/trx.c4
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/trx.c8
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/trx.c4
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/trx.c4
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8723ae/trx.c4
-rw-r--r--drivers/net/wireless/ti/wl1251/main.c5
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c2
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c4
60 files changed, 201 insertions, 164 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 3d339e04efb7..f9a24e599dee 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1293,7 +1293,8 @@ static int adm8211_config(struct ieee80211_hw *dev, u32 changed)
1293{ 1293{
1294 struct adm8211_priv *priv = dev->priv; 1294 struct adm8211_priv *priv = dev->priv;
1295 struct ieee80211_conf *conf = &dev->conf; 1295 struct ieee80211_conf *conf = &dev->conf;
1296 int channel = ieee80211_frequency_to_channel(conf->channel->center_freq); 1296 int channel =
1297 ieee80211_frequency_to_channel(conf->chandef.chan->center_freq);
1297 1298
1298 if (channel != priv->channel) { 1299 if (channel != priv->channel) {
1299 priv->channel = channel; 1300 priv->channel = channel;
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 5ac5f7ae2721..34c8a33cac06 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -1943,12 +1943,12 @@ static int at76_config(struct ieee80211_hw *hw, u32 changed)
1943 struct at76_priv *priv = hw->priv; 1943 struct at76_priv *priv = hw->priv;
1944 1944
1945 at76_dbg(DBG_MAC80211, "%s(): channel %d", 1945 at76_dbg(DBG_MAC80211, "%s(): channel %d",
1946 __func__, hw->conf.channel->hw_value); 1946 __func__, hw->conf.chandef.chan->hw_value);
1947 at76_dbg_dump(DBG_MAC80211, priv->bssid, ETH_ALEN, "bssid:"); 1947 at76_dbg_dump(DBG_MAC80211, priv->bssid, ETH_ALEN, "bssid:");
1948 1948
1949 mutex_lock(&priv->mtx); 1949 mutex_lock(&priv->mtx);
1950 1950
1951 priv->channel = hw->conf.channel->hw_value; 1951 priv->channel = hw->conf.chandef.chan->hw_value;
1952 1952
1953 if (is_valid_ether_addr(priv->bssid)) 1953 if (is_valid_ether_addr(priv->bssid))
1954 at76_join(priv); 1954 at76_join(priv);
diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c
index afd1e36d308f..17d7fece35d2 100644
--- a/drivers/net/wireless/ath/ar5523/ar5523.c
+++ b/drivers/net/wireless/ath/ar5523/ar5523.c
@@ -457,14 +457,14 @@ static int ar5523_set_chan(struct ar5523 *ar)
457 memset(&reset, 0, sizeof(reset)); 457 memset(&reset, 0, sizeof(reset));
458 reset.flags |= cpu_to_be32(UATH_CHAN_2GHZ); 458 reset.flags |= cpu_to_be32(UATH_CHAN_2GHZ);
459 reset.flags |= cpu_to_be32(UATH_CHAN_OFDM); 459 reset.flags |= cpu_to_be32(UATH_CHAN_OFDM);
460 reset.freq = cpu_to_be32(conf->channel->center_freq); 460 reset.freq = cpu_to_be32(conf->chandef.chan->center_freq);
461 reset.maxrdpower = cpu_to_be32(50); /* XXX */ 461 reset.maxrdpower = cpu_to_be32(50); /* XXX */
462 reset.channelchange = cpu_to_be32(1); 462 reset.channelchange = cpu_to_be32(1);
463 reset.keeprccontent = cpu_to_be32(0); 463 reset.keeprccontent = cpu_to_be32(0);
464 464
465 ar5523_dbg(ar, "set chan flags 0x%x freq %d\n", 465 ar5523_dbg(ar, "set chan flags 0x%x freq %d\n",
466 be32_to_cpu(reset.flags), 466 be32_to_cpu(reset.flags),
467 conf->channel->center_freq); 467 conf->chandef.chan->center_freq);
468 return ar5523_cmd_write(ar, WDCMSG_RESET, &reset, sizeof(reset), 0); 468 return ar5523_cmd_write(ar, WDCMSG_RESET, &reset, sizeof(reset), 0);
469} 469}
470 470
@@ -594,7 +594,7 @@ static void ar5523_data_rx_cb(struct urb *urb)
594 rx_status = IEEE80211_SKB_RXCB(data->skb); 594 rx_status = IEEE80211_SKB_RXCB(data->skb);
595 memset(rx_status, 0, sizeof(*rx_status)); 595 memset(rx_status, 0, sizeof(*rx_status));
596 rx_status->freq = be32_to_cpu(desc->channel); 596 rx_status->freq = be32_to_cpu(desc->channel);
597 rx_status->band = hw->conf.channel->band; 597 rx_status->band = hw->conf.chandef.chan->band;
598 rx_status->signal = -95 + be32_to_cpu(desc->rssi); 598 rx_status->signal = -95 + be32_to_cpu(desc->rssi);
599 599
600 ieee80211_rx_irqsafe(hw, data->skb); 600 ieee80211_rx_irqsafe(hw, data->skb);
@@ -1153,13 +1153,13 @@ static int ar5523_get_wlan_mode(struct ar5523 *ar,
1153 struct ieee80211_sta *sta; 1153 struct ieee80211_sta *sta;
1154 u32 sta_rate_set; 1154 u32 sta_rate_set;
1155 1155
1156 band = ar->hw->wiphy->bands[ar->hw->conf.channel->band]; 1156 band = ar->hw->wiphy->bands[ar->hw->conf.chandef.chan->band];
1157 sta = ieee80211_find_sta(ar->vif, bss_conf->bssid); 1157 sta = ieee80211_find_sta(ar->vif, bss_conf->bssid);
1158 if (!sta) { 1158 if (!sta) {
1159 ar5523_info(ar, "STA not found!\n"); 1159 ar5523_info(ar, "STA not found!\n");
1160 return WLAN_MODE_11b; 1160 return WLAN_MODE_11b;
1161 } 1161 }
1162 sta_rate_set = sta->supp_rates[ar->hw->conf.channel->band]; 1162 sta_rate_set = sta->supp_rates[ar->hw->conf.chandef.chan->band];
1163 1163
1164 for (bit = 0; bit < band->n_bitrates; bit++) { 1164 for (bit = 0; bit < band->n_bitrates; bit++) {
1165 if (sta_rate_set & 1) { 1165 if (sta_rate_set & 1) {
@@ -1197,11 +1197,11 @@ static void ar5523_create_rateset(struct ar5523 *ar,
1197 ar5523_info(ar, "STA not found. Cannot set rates\n"); 1197 ar5523_info(ar, "STA not found. Cannot set rates\n");
1198 sta_rate_set = bss_conf->basic_rates; 1198 sta_rate_set = bss_conf->basic_rates;
1199 } else 1199 } else
1200 sta_rate_set = sta->supp_rates[ar->hw->conf.channel->band]; 1200 sta_rate_set = sta->supp_rates[ar->hw->conf.chandef.chan->band];
1201 1201
1202 ar5523_dbg(ar, "sta rate_set = %08x\n", sta_rate_set); 1202 ar5523_dbg(ar, "sta rate_set = %08x\n", sta_rate_set);
1203 1203
1204 band = ar->hw->wiphy->bands[ar->hw->conf.channel->band]; 1204 band = ar->hw->wiphy->bands[ar->hw->conf.chandef.chan->band];
1205 for (bit = 0; bit < band->n_bitrates; bit++) { 1205 for (bit = 0; bit < band->n_bitrates; bit++) {
1206 BUG_ON(i >= AR5523_MAX_NRATES); 1206 BUG_ON(i >= AR5523_MAX_NRATES);
1207 ar5523_dbg(ar, "Considering rate %d : %d\n", 1207 ar5523_dbg(ar, "Considering rate %d : %d\n",
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 1d264c0f5a9b..9b20d9ee2719 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2639,7 +2639,7 @@ int ath5k_start(struct ieee80211_hw *hw)
2639 * be followed by initialization of the appropriate bits 2639 * be followed by initialization of the appropriate bits
2640 * and then setup of the interrupt mask. 2640 * and then setup of the interrupt mask.
2641 */ 2641 */
2642 ah->curchan = ah->hw->conf.channel; 2642 ah->curchan = ah->hw->conf.chandef.chan;
2643 ah->imask = AR5K_INT_RXOK 2643 ah->imask = AR5K_INT_RXOK
2644 | AR5K_INT_RXERR 2644 | AR5K_INT_RXERR
2645 | AR5K_INT_RXEOL 2645 | AR5K_INT_RXEOL
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
index 4264341533ea..06f86f435711 100644
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
@@ -202,7 +202,7 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed)
202 mutex_lock(&ah->lock); 202 mutex_lock(&ah->lock);
203 203
204 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { 204 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
205 ret = ath5k_chan_set(ah, conf->channel); 205 ret = ath5k_chan_set(ah, conf->chandef.chan);
206 if (ret < 0) 206 if (ret < 0)
207 goto unlock; 207 goto unlock;
208 } 208 }
@@ -678,7 +678,7 @@ ath5k_get_survey(struct ieee80211_hw *hw, int idx, struct survey_info *survey)
678 678
679 memcpy(survey, &ah->survey, sizeof(*survey)); 679 memcpy(survey, &ah->survey, sizeof(*survey));
680 680
681 survey->channel = conf->channel; 681 survey->channel = conf->chandef.chan;
682 survey->noise = ah->ah_noise_floor; 682 survey->noise = ah->ah_noise_floor;
683 survey->filled = SURVEY_INFO_NOISE_DBM | 683 survey->filled = SURVEY_INFO_NOISE_DBM |
684 SURVEY_INFO_CHANNEL_TIME | 684 SURVEY_INFO_CHANNEL_TIME |
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index 5f05c26d1ec4..2ff570f7f8ff 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -79,7 +79,7 @@ static void ath9k_beacon_setup(struct ath_softc *sc, struct ieee80211_vif *vif,
79 u8 chainmask = ah->txchainmask; 79 u8 chainmask = ah->txchainmask;
80 u8 rate = 0; 80 u8 rate = 0;
81 81
82 sband = &sc->sbands[common->hw->conf.channel->band]; 82 sband = &sc->sbands[common->hw->conf.chandef.chan->band];
83 rate = sband->bitrates[rateidx].hw_value; 83 rate = sband->bitrates[rateidx].hw_value;
84 if (vif->bss_conf.use_short_preamble) 84 if (vif->bss_conf.use_short_preamble)
85 rate |= sband->bitrates[rateidx].hw_value_short; 85 rate |= sband->bitrates[rateidx].hw_value_short;
diff --git a/drivers/net/wireless/ath/ath9k/calib.c b/drivers/net/wireless/ath/ath9k/calib.c
index 1e8508530e98..b184f1ff0d38 100644
--- a/drivers/net/wireless/ath/ath9k/calib.c
+++ b/drivers/net/wireless/ath/ath9k/calib.c
@@ -208,7 +208,7 @@ bool ath9k_hw_reset_calvalid(struct ath_hw *ah)
208 return true; 208 return true;
209 209
210 ath_dbg(common, CALIBRATE, "Resetting Cal %d state for channel %u\n", 210 ath_dbg(common, CALIBRATE, "Resetting Cal %d state for channel %u\n",
211 currCal->calData->calType, conf->channel->center_freq); 211 currCal->calData->calType, conf->chandef.chan->center_freq);
212 212
213 ah->caldata->CalValid &= ~currCal->calData->calType; 213 ah->caldata->CalValid &= ~currCal->calData->calType;
214 currCal->calState = CAL_WAITING; 214 currCal->calState = CAL_WAITING;
diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c
index 905f1b313961..6c78fe7ca54d 100644
--- a/drivers/net/wireless/ath/ath9k/common.c
+++ b/drivers/net/wireless/ath/ath9k/common.c
@@ -133,13 +133,14 @@ EXPORT_SYMBOL(ath9k_cmn_update_ichannel);
133struct ath9k_channel *ath9k_cmn_get_curchannel(struct ieee80211_hw *hw, 133struct ath9k_channel *ath9k_cmn_get_curchannel(struct ieee80211_hw *hw,
134 struct ath_hw *ah) 134 struct ath_hw *ah)
135{ 135{
136 struct ieee80211_channel *curchan = hw->conf.channel; 136 struct ieee80211_channel *curchan = hw->conf.chandef.chan;
137 struct ath9k_channel *channel; 137 struct ath9k_channel *channel;
138 u8 chan_idx; 138 u8 chan_idx;
139 139
140 chan_idx = curchan->hw_value; 140 chan_idx = curchan->hw_value;
141 channel = &ah->channels[chan_idx]; 141 channel = &ah->channels[chan_idx];
142 ath9k_cmn_update_ichannel(channel, curchan, hw->conf.channel_type); 142 ath9k_cmn_update_ichannel(channel, curchan,
143 cfg80211_get_chandef_type(&hw->conf.chandef));
143 144
144 return channel; 145 return channel;
145} 146}
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index a8016d70088a..098e3545e512 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -190,7 +190,7 @@ void ath9k_htc_reset(struct ath9k_htc_priv *priv)
190{ 190{
191 struct ath_hw *ah = priv->ah; 191 struct ath_hw *ah = priv->ah;
192 struct ath_common *common = ath9k_hw_common(ah); 192 struct ath_common *common = ath9k_hw_common(ah);
193 struct ieee80211_channel *channel = priv->hw->conf.channel; 193 struct ieee80211_channel *channel = priv->hw->conf.chandef.chan;
194 struct ath9k_hw_cal_data *caldata = NULL; 194 struct ath9k_hw_cal_data *caldata = NULL;
195 enum htc_phymode mode; 195 enum htc_phymode mode;
196 __be16 htc_mode; 196 __be16 htc_mode;
@@ -250,7 +250,7 @@ static int ath9k_htc_set_channel(struct ath9k_htc_priv *priv,
250 struct ath_common *common = ath9k_hw_common(ah); 250 struct ath_common *common = ath9k_hw_common(ah);
251 struct ieee80211_conf *conf = &common->hw->conf; 251 struct ieee80211_conf *conf = &common->hw->conf;
252 bool fastcc; 252 bool fastcc;
253 struct ieee80211_channel *channel = hw->conf.channel; 253 struct ieee80211_channel *channel = hw->conf.chandef.chan;
254 struct ath9k_hw_cal_data *caldata = NULL; 254 struct ath9k_hw_cal_data *caldata = NULL;
255 enum htc_phymode mode; 255 enum htc_phymode mode;
256 __be16 htc_mode; 256 __be16 htc_mode;
@@ -602,7 +602,7 @@ static void ath9k_htc_setup_rate(struct ath9k_htc_priv *priv,
602 u32 caps = 0; 602 u32 caps = 0;
603 int i, j; 603 int i, j;
604 604
605 sband = priv->hw->wiphy->bands[priv->hw->conf.channel->band]; 605 sband = priv->hw->wiphy->bands[priv->hw->conf.chandef.chan->band];
606 606
607 for (i = 0, j = 0; i < sband->n_bitrates; i++) { 607 for (i = 0, j = 0; i < sband->n_bitrates; i++) {
608 if (sta->supp_rates[sband->band] & BIT(i)) { 608 if (sta->supp_rates[sband->band] & BIT(i)) {
@@ -904,7 +904,7 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
904 struct ath9k_htc_priv *priv = hw->priv; 904 struct ath9k_htc_priv *priv = hw->priv;
905 struct ath_hw *ah = priv->ah; 905 struct ath_hw *ah = priv->ah;
906 struct ath_common *common = ath9k_hw_common(ah); 906 struct ath_common *common = ath9k_hw_common(ah);
907 struct ieee80211_channel *curchan = hw->conf.channel; 907 struct ieee80211_channel *curchan = hw->conf.chandef.chan;
908 struct ath9k_channel *init_channel; 908 struct ath9k_channel *init_channel;
909 int ret = 0; 909 int ret = 0;
910 enum htc_phymode mode; 910 enum htc_phymode mode;
@@ -1193,15 +1193,17 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
1193 } 1193 }
1194 1194
1195 if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || chip_reset) { 1195 if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || chip_reset) {
1196 struct ieee80211_channel *curchan = hw->conf.channel; 1196 struct ieee80211_channel *curchan = hw->conf.chandef.chan;
1197 enum nl80211_channel_type channel_type =
1198 cfg80211_get_chandef_type(&hw->conf.chandef);
1197 int pos = curchan->hw_value; 1199 int pos = curchan->hw_value;
1198 1200
1199 ath_dbg(common, CONFIG, "Set channel: %d MHz\n", 1201 ath_dbg(common, CONFIG, "Set channel: %d MHz\n",
1200 curchan->center_freq); 1202 curchan->center_freq);
1201 1203
1202 ath9k_cmn_update_ichannel(&priv->ah->channels[pos], 1204 ath9k_cmn_update_ichannel(&priv->ah->channels[pos],
1203 hw->conf.channel, 1205 hw->conf.chandef.chan,
1204 hw->conf.channel_type); 1206 channel_type);
1205 1207
1206 if (ath9k_htc_set_channel(priv, hw, &priv->ah->channels[pos]) < 0) { 1208 if (ath9k_htc_set_channel(priv, hw, &priv->ah->channels[pos]) < 0) {
1207 ath_err(common, "Unable to set channel\n"); 1209 ath_err(common, "Unable to set channel\n");
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 3ad1fd05c5e7..306c55019e77 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -490,7 +490,7 @@ static void ath9k_htc_tx_process(struct ath9k_htc_priv *priv,
490 if (txs->ts_flags & ATH9K_HTC_TXSTAT_SGI) 490 if (txs->ts_flags & ATH9K_HTC_TXSTAT_SGI)
491 rate->flags |= IEEE80211_TX_RC_SHORT_GI; 491 rate->flags |= IEEE80211_TX_RC_SHORT_GI;
492 } else { 492 } else {
493 if (cur_conf->channel->band == IEEE80211_BAND_5GHZ) 493 if (cur_conf->chandef.chan->band == IEEE80211_BAND_5GHZ)
494 rate->idx += 4; /* No CCK rates */ 494 rate->idx += 4; /* No CCK rates */
495 } 495 }
496 496
@@ -939,7 +939,7 @@ static void ath9k_process_rate(struct ieee80211_hw *hw,
939 return; 939 return;
940 } 940 }
941 941
942 band = hw->conf.channel->band; 942 band = hw->conf.chandef.chan->band;
943 sband = hw->wiphy->bands[band]; 943 sband = hw->wiphy->bands[band];
944 944
945 for (i = 0; i < sband->n_bitrates; i++) { 945 for (i = 0; i < sband->n_bitrates; i++) {
@@ -1078,8 +1078,8 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv,
1078 priv->ah->stats.avgbrssi = rxbuf->rxstatus.rs_rssi; 1078 priv->ah->stats.avgbrssi = rxbuf->rxstatus.rs_rssi;
1079 1079
1080 rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp); 1080 rx_status->mactime = be64_to_cpu(rxbuf->rxstatus.rs_tstamp);
1081 rx_status->band = hw->conf.channel->band; 1081 rx_status->band = hw->conf.chandef.chan->band;
1082 rx_status->freq = hw->conf.channel->center_freq; 1082 rx_status->freq = hw->conf.chandef.chan->center_freq;
1083 rx_status->signal = rxbuf->rxstatus.rs_rssi + ATH_DEFAULT_NOISE_FLOOR; 1083 rx_status->signal = rxbuf->rxstatus.rs_rssi + ATH_DEFAULT_NOISE_FLOOR;
1084 rx_status->antenna = rxbuf->rxstatus.rs_antenna; 1084 rx_status->antenna = rxbuf->rxstatus.rs_antenna;
1085 rx_status->flag |= RX_FLAG_MACTIME_END; 1085 rx_status->flag |= RX_FLAG_MACTIME_END;
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 2a2ae403e0e5..d5e6a38fe74b 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -139,7 +139,7 @@ static void ath9k_hw_set_clockrate(struct ath_hw *ah)
139 clockrate = 117; 139 clockrate = 117;
140 else if (!ah->curchan) /* should really check for CCK instead */ 140 else if (!ah->curchan) /* should really check for CCK instead */
141 clockrate = ATH9K_CLOCK_RATE_CCK; 141 clockrate = ATH9K_CLOCK_RATE_CCK;
142 else if (conf->channel->band == IEEE80211_BAND_2GHZ) 142 else if (conf->chandef.chan->band == IEEE80211_BAND_2GHZ)
143 clockrate = ATH9K_CLOCK_RATE_2GHZ_OFDM; 143 clockrate = ATH9K_CLOCK_RATE_2GHZ_OFDM;
144 else if (ah->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK) 144 else if (ah->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK)
145 clockrate = ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM; 145 clockrate = ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM;
@@ -1110,7 +1110,8 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
1110 * BA frames in some implementations, but it has been found to fix ACK 1110 * BA frames in some implementations, but it has been found to fix ACK
1111 * timeout issues in other cases as well. 1111 * timeout issues in other cases as well.
1112 */ 1112 */
1113 if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ && 1113 if (conf->chandef.chan &&
1114 conf->chandef.chan->band == IEEE80211_BAND_2GHZ &&
1114 !IS_CHAN_HALF_RATE(chan) && !IS_CHAN_QUARTER_RATE(chan)) { 1115 !IS_CHAN_HALF_RATE(chan) && !IS_CHAN_QUARTER_RATE(chan)) {
1115 acktimeout += 64 - sifstime - ah->slottime; 1116 acktimeout += 64 - sifstime - ah->slottime;
1116 ctstimeout += 48 - sifstime - ah->slottime; 1117 ctstimeout += 48 - sifstime - ah->slottime;
diff --git a/drivers/net/wireless/ath/ath9k/link.c b/drivers/net/wireless/ath/ath9k/link.c
index ade3afb21f91..b1433f561cd2 100644
--- a/drivers/net/wireless/ath/ath9k/link.c
+++ b/drivers/net/wireless/ath/ath9k/link.c
@@ -213,7 +213,7 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int
213 txctl.txq = sc->tx.txq_map[IEEE80211_AC_BE]; 213 txctl.txq = sc->tx.txq_map[IEEE80211_AC_BE];
214 214
215 memset(tx_info, 0, sizeof(*tx_info)); 215 memset(tx_info, 0, sizeof(*tx_info));
216 tx_info->band = hw->conf.channel->band; 216 tx_info->band = hw->conf.chandef.chan->band;
217 tx_info->flags |= IEEE80211_TX_CTL_NO_ACK; 217 tx_info->flags |= IEEE80211_TX_CTL_NO_ACK;
218 tx_info->control.rates[0].idx = 0; 218 tx_info->control.rates[0].idx = 0;
219 tx_info->control.rates[0].count = 1; 219 tx_info->control.rates[0].count = 1;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 24650fd41694..f984a03f912c 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -585,7 +585,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
585 struct ath_softc *sc = hw->priv; 585 struct ath_softc *sc = hw->priv;
586 struct ath_hw *ah = sc->sc_ah; 586 struct ath_hw *ah = sc->sc_ah;
587 struct ath_common *common = ath9k_hw_common(ah); 587 struct ath_common *common = ath9k_hw_common(ah);
588 struct ieee80211_channel *curchan = hw->conf.channel; 588 struct ieee80211_channel *curchan = hw->conf.chandef.chan;
589 struct ath9k_channel *init_channel; 589 struct ath9k_channel *init_channel;
590 int r; 590 int r;
591 591
@@ -1184,7 +1184,9 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1184 } 1184 }
1185 1185
1186 if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) { 1186 if ((changed & IEEE80211_CONF_CHANGE_CHANNEL) || reset_channel) {
1187 struct ieee80211_channel *curchan = hw->conf.channel; 1187 struct ieee80211_channel *curchan = hw->conf.chandef.chan;
1188 enum nl80211_channel_type channel_type =
1189 cfg80211_get_chandef_type(&conf->chandef);
1188 int pos = curchan->hw_value; 1190 int pos = curchan->hw_value;
1189 int old_pos = -1; 1191 int old_pos = -1;
1190 unsigned long flags; 1192 unsigned long flags;
@@ -1193,7 +1195,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1193 old_pos = ah->curchan - &ah->channels[0]; 1195 old_pos = ah->curchan - &ah->channels[0];
1194 1196
1195 ath_dbg(common, CONFIG, "Set channel: %d MHz type: %d\n", 1197 ath_dbg(common, CONFIG, "Set channel: %d MHz type: %d\n",
1196 curchan->center_freq, conf->channel_type); 1198 curchan->center_freq, channel_type);
1197 1199
1198 /* update survey stats for the old channel before switching */ 1200 /* update survey stats for the old channel before switching */
1199 spin_lock_irqsave(&common->cc_lock, flags); 1201 spin_lock_irqsave(&common->cc_lock, flags);
@@ -1208,7 +1210,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1208 ath9k_hw_getnf(ah, ah->curchan); 1210 ath9k_hw_getnf(ah, ah->curchan);
1209 1211
1210 ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos], 1212 ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos],
1211 curchan, conf->channel_type); 1213 curchan, channel_type);
1212 1214
1213 /* 1215 /*
1214 * If the operating channel changes, change the survey in-use flags 1216 * If the operating channel changes, change the survey in-use flags
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 96ac433ba7f6..aa4d368d8d3d 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -814,7 +814,7 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
814 * So, set fourth rate in series to be same as third one for 814 * So, set fourth rate in series to be same as third one for
815 * above conditions. 815 * above conditions.
816 */ 816 */
817 if ((sc->hw->conf.channel->band == IEEE80211_BAND_2GHZ) && 817 if ((sc->hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ) &&
818 (conf_is_ht(&sc->hw->conf))) { 818 (conf_is_ht(&sc->hw->conf))) {
819 u8 dot11rate = rate_table->info[rix].dot11rate; 819 u8 dot11rate = rate_table->info[rix].dot11rate;
820 u8 phy = rate_table->info[rix].phy; 820 u8 phy = rate_table->info[rix].phy;
@@ -1328,7 +1328,7 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
1328 1328
1329 ath_dbg(ath9k_hw_common(sc->sc_ah), CONFIG, 1329 ath_dbg(ath9k_hw_common(sc->sc_ah), CONFIG,
1330 "Operating HT Bandwidth changed to: %d\n", 1330 "Operating HT Bandwidth changed to: %d\n",
1331 sc->hw->conf.channel_type); 1331 cfg80211_get_chandef_type(&sc->hw->conf.chandef));
1332 } 1332 }
1333} 1333}
1334 1334
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index ee156e543147..c90ca57e3722 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -859,7 +859,7 @@ static int ath9k_process_rate(struct ath_common *common,
859 unsigned int i = 0; 859 unsigned int i = 0;
860 struct ath_softc __maybe_unused *sc = common->priv; 860 struct ath_softc __maybe_unused *sc = common->priv;
861 861
862 band = hw->conf.channel->band; 862 band = hw->conf.chandef.chan->band;
863 sband = hw->wiphy->bands[band]; 863 sband = hw->wiphy->bands[band];
864 864
865 if (rx_stats->rs_rate & 0x80) { 865 if (rx_stats->rs_rate & 0x80) {
@@ -954,8 +954,8 @@ static int ath9k_rx_skb_preprocess(struct ath_common *common,
954 if (ath9k_process_rate(common, hw, rx_stats, rx_status)) 954 if (ath9k_process_rate(common, hw, rx_stats, rx_status))
955 return -EINVAL; 955 return -EINVAL;
956 956
957 rx_status->band = hw->conf.channel->band; 957 rx_status->band = hw->conf.chandef.chan->band;
958 rx_status->freq = hw->conf.channel->center_freq; 958 rx_status->freq = hw->conf.chandef.chan->center_freq;
959 rx_status->signal = ah->noise + rx_stats->rs_rssi; 959 rx_status->signal = ah->noise + rx_stats->rs_rssi;
960 rx_status->antenna = rx_stats->rs_antenna; 960 rx_status->antenna = rx_stats->rs_antenna;
961 rx_status->flag |= RX_FLAG_MACTIME_END; 961 rx_status->flag |= RX_FLAG_MACTIME_END;
diff --git a/drivers/net/wireless/ath/carl9170/debug.c b/drivers/net/wireless/ath/carl9170/debug.c
index 93fe6003a493..7741fe8e0816 100644
--- a/drivers/net/wireless/ath/carl9170/debug.c
+++ b/drivers/net/wireless/ath/carl9170/debug.c
@@ -654,8 +654,9 @@ static ssize_t carl9170_debugfs_bug_write(struct ar9170 *ar, const char *buf,
654 goto out; 654 goto out;
655 655
656 case 'P': 656 case 'P':
657 err = carl9170_set_channel(ar, ar->hw->conf.channel, 657 err = carl9170_set_channel(ar, ar->hw->conf.chandef.chan,
658 ar->hw->conf.channel_type, CARL9170_RFI_COLD); 658 cfg80211_get_chandef_type(&ar->hw->conf.chandef),
659 CARL9170_RFI_COLD);
659 if (err < 0) 660 if (err < 0)
660 count = err; 661 count = err;
661 662
diff --git a/drivers/net/wireless/ath/carl9170/mac.c b/drivers/net/wireless/ath/carl9170/mac.c
index 24d75ab94f0d..a2f005703c04 100644
--- a/drivers/net/wireless/ath/carl9170/mac.c
+++ b/drivers/net/wireless/ath/carl9170/mac.c
@@ -48,7 +48,7 @@ int carl9170_set_dyn_sifs_ack(struct ar9170 *ar)
48 if (conf_is_ht40(&ar->hw->conf)) 48 if (conf_is_ht40(&ar->hw->conf))
49 val = 0x010a; 49 val = 0x010a;
50 else { 50 else {
51 if (ar->hw->conf.channel->band == IEEE80211_BAND_2GHZ) 51 if (ar->hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ)
52 val = 0x105; 52 val = 0x105;
53 else 53 else
54 val = 0x104; 54 val = 0x104;
@@ -66,7 +66,7 @@ int carl9170_set_rts_cts_rate(struct ar9170 *ar)
66 rts_rate = 0x1da; 66 rts_rate = 0x1da;
67 cts_rate = 0x10a; 67 cts_rate = 0x10a;
68 } else { 68 } else {
69 if (ar->hw->conf.channel->band == IEEE80211_BAND_2GHZ) { 69 if (ar->hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ) {
70 /* 11 mbit CCK */ 70 /* 11 mbit CCK */
71 rts_rate = 033; 71 rts_rate = 033;
72 cts_rate = 003; 72 cts_rate = 003;
@@ -93,7 +93,7 @@ int carl9170_set_slot_time(struct ar9170 *ar)
93 return 0; 93 return 0;
94 } 94 }
95 95
96 if ((ar->hw->conf.channel->band == IEEE80211_BAND_5GHZ) || 96 if ((ar->hw->conf.chandef.chan->band == IEEE80211_BAND_5GHZ) ||
97 vif->bss_conf.use_short_slot) 97 vif->bss_conf.use_short_slot)
98 slottime = 9; 98 slottime = 9;
99 99
@@ -120,7 +120,7 @@ int carl9170_set_mac_rates(struct ar9170 *ar)
120 basic |= (vif->bss_conf.basic_rates & 0xff0) << 4; 120 basic |= (vif->bss_conf.basic_rates & 0xff0) << 4;
121 rcu_read_unlock(); 121 rcu_read_unlock();
122 122
123 if (ar->hw->conf.channel->band == IEEE80211_BAND_5GHZ) 123 if (ar->hw->conf.chandef.chan->band == IEEE80211_BAND_5GHZ)
124 mandatory = 0xff00; /* OFDM 6/9/12/18/24/36/48/54 */ 124 mandatory = 0xff00; /* OFDM 6/9/12/18/24/36/48/54 */
125 else 125 else
126 mandatory = 0xff0f; /* OFDM (6/9../54) + CCK (1/2/5.5/11) */ 126 mandatory = 0xff0f; /* OFDM (6/9../54) + CCK (1/2/5.5/11) */
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index 08b193199946..4e268b1360d8 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -929,6 +929,9 @@ static int carl9170_op_config(struct ieee80211_hw *hw, u32 changed)
929 } 929 }
930 930
931 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { 931 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
932 enum nl80211_channel_type channel_type =
933 cfg80211_get_chandef_type(&hw->conf.chandef);
934
932 /* adjust slot time for 5 GHz */ 935 /* adjust slot time for 5 GHz */
933 err = carl9170_set_slot_time(ar); 936 err = carl9170_set_slot_time(ar);
934 if (err) 937 if (err)
@@ -938,8 +941,8 @@ static int carl9170_op_config(struct ieee80211_hw *hw, u32 changed)
938 if (err) 941 if (err)
939 goto out; 942 goto out;
940 943
941 err = carl9170_set_channel(ar, hw->conf.channel, 944 err = carl9170_set_channel(ar, hw->conf.chandef.chan,
942 hw->conf.channel_type, CARL9170_RFI_NONE); 945 channel_type, CARL9170_RFI_NONE);
943 if (err) 946 if (err)
944 goto out; 947 goto out;
945 948
@@ -957,7 +960,7 @@ static int carl9170_op_config(struct ieee80211_hw *hw, u32 changed)
957 } 960 }
958 961
959 if (changed & IEEE80211_CONF_CHANGE_POWER) { 962 if (changed & IEEE80211_CONF_CHANGE_POWER) {
960 err = carl9170_set_mac_tpc(ar, ar->hw->conf.channel); 963 err = carl9170_set_mac_tpc(ar, ar->hw->conf.chandef.chan);
961 if (err) 964 if (err)
962 goto out; 965 goto out;
963 } 966 }
diff --git a/drivers/net/wireless/ath/carl9170/phy.c b/drivers/net/wireless/ath/carl9170/phy.c
index b72c09cf43a4..c5f1fdd1eaeb 100644
--- a/drivers/net/wireless/ath/carl9170/phy.c
+++ b/drivers/net/wireless/ath/carl9170/phy.c
@@ -1331,7 +1331,7 @@ static void carl9170_calc_ctl(struct ar9170 *ar, u32 freq, enum carl9170_bw bw)
1331 * CTL_ETSI for 2GHz and CTL_FCC for 5GHz. 1331 * CTL_ETSI for 2GHz and CTL_FCC for 5GHz.
1332 */ 1332 */
1333 ctl_grp = ath_regd_get_band_ctl(&ar->common.regulatory, 1333 ctl_grp = ath_regd_get_band_ctl(&ar->common.regulatory,
1334 ar->hw->conf.channel->band); 1334 ar->hw->conf.chandef.chan->band);
1335 1335
1336 /* ctl group not found - either invalid band (NO_CTL) or ww roaming */ 1336 /* ctl group not found - either invalid band (NO_CTL) or ww roaming */
1337 if (ctl_grp == NO_CTL || ctl_grp == SD_NO_CTL) 1337 if (ctl_grp == NO_CTL || ctl_grp == SD_NO_CTL)
@@ -1341,7 +1341,7 @@ static void carl9170_calc_ctl(struct ar9170 *ar, u32 freq, enum carl9170_bw bw)
1341 /* skip CTL and heavy clip for CTL_MKK and CTL_ETSI */ 1341 /* skip CTL and heavy clip for CTL_MKK and CTL_ETSI */
1342 return; 1342 return;
1343 1343
1344 if (ar->hw->conf.channel->band == IEEE80211_BAND_2GHZ) { 1344 if (ar->hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ) {
1345 modes = mode_list_2ghz; 1345 modes = mode_list_2ghz;
1346 nr_modes = ARRAY_SIZE(mode_list_2ghz); 1346 nr_modes = ARRAY_SIZE(mode_list_2ghz);
1347 } else { 1347 } else {
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index 10e288d470e7..6a4bd8c433b4 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -972,7 +972,7 @@ static inline int b43_is_mode(struct b43_wl *wl, int type)
972 */ 972 */
973static inline enum ieee80211_band b43_current_band(struct b43_wl *wl) 973static inline enum ieee80211_band b43_current_band(struct b43_wl *wl)
974{ 974{
975 return wl->hw->conf.channel->band; 975 return wl->hw->conf.chandef.chan->band;
976} 976}
977 977
978static inline int b43_bus_may_powerdown(struct b43_wldev *wldev) 978static inline int b43_bus_may_powerdown(struct b43_wldev *wldev)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 05682736e466..d135e8975f52 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3848,7 +3848,7 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
3848 dev = wl->current_dev; 3848 dev = wl->current_dev;
3849 3849
3850 /* Switch the band (if necessary). This might change the active core. */ 3850 /* Switch the band (if necessary). This might change the active core. */
3851 err = b43_switch_band(wl, conf->channel); 3851 err = b43_switch_band(wl, conf->chandef.chan);
3852 if (err) 3852 if (err)
3853 goto out_unlock_mutex; 3853 goto out_unlock_mutex;
3854 3854
@@ -3878,8 +3878,8 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed)
3878 3878
3879 /* Switch to the requested channel. 3879 /* Switch to the requested channel.
3880 * The firmware takes care of races with the TX handler. */ 3880 * The firmware takes care of races with the TX handler. */
3881 if (conf->channel->hw_value != phy->channel) 3881 if (conf->chandef.chan->hw_value != phy->channel)
3882 b43_switch_channel(dev, conf->channel->hw_value); 3882 b43_switch_channel(dev, conf->chandef.chan->hw_value);
3883 3883
3884 dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_MONITOR); 3884 dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_MONITOR);
3885 3885
@@ -5002,7 +5002,7 @@ static int b43_op_get_survey(struct ieee80211_hw *hw, int idx,
5002 if (idx != 0) 5002 if (idx != 0)
5003 return -ENOENT; 5003 return -ENOENT;
5004 5004
5005 survey->channel = conf->channel; 5005 survey->channel = conf->chandef.chan;
5006 survey->filled = SURVEY_INFO_NOISE_DBM; 5006 survey->filled = SURVEY_INFO_NOISE_DBM;
5007 survey->noise = dev->stats.link_noise; 5007 survey->noise = dev->stats.link_noise;
5008 5008
diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c
index 7416c5e9154d..016682ea7445 100644
--- a/drivers/net/wireless/b43/phy_ht.c
+++ b/drivers/net/wireless/b43/phy_ht.c
@@ -525,8 +525,9 @@ static void b43_phy_ht_op_switch_analog(struct b43_wldev *dev, bool on)
525static int b43_phy_ht_op_switch_channel(struct b43_wldev *dev, 525static int b43_phy_ht_op_switch_channel(struct b43_wldev *dev,
526 unsigned int new_channel) 526 unsigned int new_channel)
527{ 527{
528 struct ieee80211_channel *channel = dev->wl->hw->conf.channel; 528 struct ieee80211_channel *channel = dev->wl->hw->conf.chandef.chan;
529 enum nl80211_channel_type channel_type = dev->wl->hw->conf.channel_type; 529 enum nl80211_channel_type channel_type =
530 cfg80211_get_chandef_type(&dev->wl->hw->conf.chandef);
530 531
531 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { 532 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
532 if ((new_channel < 1) || (new_channel > 14)) 533 if ((new_channel < 1) || (new_channel > 14))
diff --git a/drivers/net/wireless/b43/phy_lcn.c b/drivers/net/wireless/b43/phy_lcn.c
index a13e28ef6246..0bafa3b17035 100644
--- a/drivers/net/wireless/b43/phy_lcn.c
+++ b/drivers/net/wireless/b43/phy_lcn.c
@@ -808,8 +808,9 @@ static void b43_phy_lcn_op_switch_analog(struct b43_wldev *dev, bool on)
808static int b43_phy_lcn_op_switch_channel(struct b43_wldev *dev, 808static int b43_phy_lcn_op_switch_channel(struct b43_wldev *dev,
809 unsigned int new_channel) 809 unsigned int new_channel)
810{ 810{
811 struct ieee80211_channel *channel = dev->wl->hw->conf.channel; 811 struct ieee80211_channel *channel = dev->wl->hw->conf.chandef.chan;
812 enum nl80211_channel_type channel_type = dev->wl->hw->conf.channel_type; 812 enum nl80211_channel_type channel_type =
813 cfg80211_get_chandef_type(&dev->wl->hw->conf.chandef);
813 814
814 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { 815 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
815 if ((new_channel < 1) || (new_channel > 14)) 816 if ((new_channel < 1) || (new_channel > 14))
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 3c35382ee6c2..949a3bdeede9 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -5530,8 +5530,9 @@ static void b43_nphy_op_switch_analog(struct b43_wldev *dev, bool on)
5530static int b43_nphy_op_switch_channel(struct b43_wldev *dev, 5530static int b43_nphy_op_switch_channel(struct b43_wldev *dev,
5531 unsigned int new_channel) 5531 unsigned int new_channel)
5532{ 5532{
5533 struct ieee80211_channel *channel = dev->wl->hw->conf.channel; 5533 struct ieee80211_channel *channel = dev->wl->hw->conf.chandef.chan;
5534 enum nl80211_channel_type channel_type = dev->wl->hw->conf.channel_type; 5534 enum nl80211_channel_type channel_type =
5535 cfg80211_get_chandef_type(&dev->wl->hw->conf.chandef);
5535 5536
5536 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { 5537 if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
5537 if ((new_channel < 1) || (new_channel > 14)) 5538 if ((new_channel < 1) || (new_channel > 14))
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 8c3f70e1a013..572668821862 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2720,7 +2720,7 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
2720 goto out_unlock_mutex; 2720 goto out_unlock_mutex;
2721 2721
2722 /* Switch the PHY mode (if necessary). */ 2722 /* Switch the PHY mode (if necessary). */
2723 switch (conf->channel->band) { 2723 switch (conf->chandef.chan->band) {
2724 case IEEE80211_BAND_2GHZ: 2724 case IEEE80211_BAND_2GHZ:
2725 if (phy->type == B43legacy_PHYTYPE_B) 2725 if (phy->type == B43legacy_PHYTYPE_B)
2726 new_phymode = B43legacy_PHYMODE_B; 2726 new_phymode = B43legacy_PHYMODE_B;
@@ -2748,8 +2748,9 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw,
2748 2748
2749 /* Switch to the requested channel. 2749 /* Switch to the requested channel.
2750 * The firmware takes care of races with the TX handler. */ 2750 * The firmware takes care of races with the TX handler. */
2751 if (conf->channel->hw_value != phy->channel) 2751 if (conf->chandef.chan->hw_value != phy->channel)
2752 b43legacy_radio_selectchannel(dev, conf->channel->hw_value, 0); 2752 b43legacy_radio_selectchannel(dev, conf->chandef.chan->hw_value,
2753 0);
2753 2754
2754 dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_MONITOR); 2755 dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_MONITOR);
2755 2756
@@ -3558,7 +3559,7 @@ static int b43legacy_op_get_survey(struct ieee80211_hw *hw, int idx,
3558 if (idx != 0) 3559 if (idx != 0)
3559 return -ENOENT; 3560 return -ENOENT;
3560 3561
3561 survey->channel = conf->channel; 3562 survey->channel = conf->chandef.chan;
3562 survey->filled = SURVEY_INFO_NOISE_DBM; 3563 survey->filled = SURVEY_INFO_NOISE_DBM;
3563 survey->noise = dev->stats.link_noise; 3564 survey->noise = dev->stats.link_noise;
3564 3565
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.c b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
index 10ee314c4229..cc87926f5055 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.c
@@ -379,7 +379,7 @@ brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, u16 chanspec,
379 u8 local_constraint_qdbm) 379 u8 local_constraint_qdbm)
380{ 380{
381 struct brcms_c_info *wlc = wlc_cm->wlc; 381 struct brcms_c_info *wlc = wlc_cm->wlc;
382 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.channel; 382 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.chandef.chan;
383 struct txpwr_limits txpwr; 383 struct txpwr_limits txpwr;
384 384
385 brcms_c_channel_reg_limits(wlc_cm, chanspec, &txpwr); 385 brcms_c_channel_reg_limits(wlc_cm, chanspec, &txpwr);
@@ -404,7 +404,7 @@ brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, u16 chanspec,
404 struct txpwr_limits *txpwr) 404 struct txpwr_limits *txpwr)
405{ 405{
406 struct brcms_c_info *wlc = wlc_cm->wlc; 406 struct brcms_c_info *wlc = wlc_cm->wlc;
407 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.channel; 407 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.chandef.chan;
408 uint i; 408 uint i;
409 uint chan; 409 uint chan;
410 int maxpwr; 410 int maxpwr;
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index aa5f43fee5ed..70731d23ddb1 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -414,10 +414,10 @@ static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed)
414 new_int); 414 new_int);
415 } 415 }
416 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { 416 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
417 if (conf->channel_type == NL80211_CHAN_HT20 || 417 if (conf->chandef.width == NL80211_CHAN_WIDTH_20 ||
418 conf->channel_type == NL80211_CHAN_NO_HT) 418 conf->chandef.width == NL80211_CHAN_WIDTH_20_NOHT)
419 err = brcms_c_set_channel(wl->wlc, 419 err = brcms_c_set_channel(wl->wlc,
420 conf->channel->hw_value); 420 conf->chandef.chan->hw_value);
421 else 421 else
422 err = -ENOTSUPP; 422 err = -ENOTSUPP;
423 } 423 }
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 8ef02dca8f8c..e0dc1838cd19 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -5099,7 +5099,7 @@ int brcms_c_up(struct brcms_c_info *wlc)
5099 wlc->pub->up = true; 5099 wlc->pub->up = true;
5100 5100
5101 if (wlc->bandinit_pending) { 5101 if (wlc->bandinit_pending) {
5102 ch = wlc->pub->ieee_hw->conf.channel; 5102 ch = wlc->pub->ieee_hw->conf.chandef.chan;
5103 brcms_c_suspend_mac_and_wait(wlc); 5103 brcms_c_suspend_mac_and_wait(wlc);
5104 brcms_c_set_chanspec(wlc, ch20mhz_chspec(ch->hw_value)); 5104 brcms_c_set_chanspec(wlc, ch20mhz_chspec(ch->hw_value));
5105 wlc->bandinit_pending = false; 5105 wlc->bandinit_pending = false;
@@ -7748,7 +7748,7 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
7748void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx) 7748void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx)
7749{ 7749{
7750 struct bcma_device *core = wlc->hw->d11core; 7750 struct bcma_device *core = wlc->hw->d11core;
7751 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.channel; 7751 struct ieee80211_channel *ch = wlc->pub->ieee_hw->conf.chandef.chan;
7752 u16 chanspec; 7752 u16 chanspec;
7753 7753
7754 brcms_dbg_info(core, "wl%d\n", wlc->pub->unit); 7754 brcms_dbg_info(core, "wl%d\n", wlc->pub->unit);
diff --git a/drivers/net/wireless/iwlegacy/3945-rs.c b/drivers/net/wireless/iwlegacy/3945-rs.c
index d4fd29ad90dc..c9f197d9ca1e 100644
--- a/drivers/net/wireless/iwlegacy/3945-rs.c
+++ b/drivers/net/wireless/iwlegacy/3945-rs.c
@@ -347,7 +347,7 @@ il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id)
347 347
348 psta = (struct il3945_sta_priv *)sta->drv_priv; 348 psta = (struct il3945_sta_priv *)sta->drv_priv;
349 rs_sta = &psta->rs_sta; 349 rs_sta = &psta->rs_sta;
350 sband = hw->wiphy->bands[conf->channel->band]; 350 sband = hw->wiphy->bands[conf->chandef.chan->band];
351 351
352 rs_sta->il = il; 352 rs_sta->il = il;
353 353
diff --git a/drivers/net/wireless/iwlegacy/4965-rs.c b/drivers/net/wireless/iwlegacy/4965-rs.c
index e8324b5e5bfe..1d92a59a85ad 100644
--- a/drivers/net/wireless/iwlegacy/4965-rs.c
+++ b/drivers/net/wireless/iwlegacy/4965-rs.c
@@ -2299,7 +2299,7 @@ il4965_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id)
2299 2299
2300 sta_priv = (struct il_station_priv *)sta->drv_priv; 2300 sta_priv = (struct il_station_priv *)sta->drv_priv;
2301 lq_sta = &sta_priv->lq_sta; 2301 lq_sta = &sta_priv->lq_sta;
2302 sband = hw->wiphy->bands[conf->channel->band]; 2302 sband = hw->wiphy->bands[conf->chandef.chan->band];
2303 2303
2304 lq_sta->lq.sta_id = sta_id; 2304 lq_sta->lq.sta_id = sta_id;
2305 2305
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 722bfb57cfd5..025d8b0eeafe 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -4974,7 +4974,7 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed)
4974 struct il_priv *il = hw->priv; 4974 struct il_priv *il = hw->priv;
4975 const struct il_channel_info *ch_info; 4975 const struct il_channel_info *ch_info;
4976 struct ieee80211_conf *conf = &hw->conf; 4976 struct ieee80211_conf *conf = &hw->conf;
4977 struct ieee80211_channel *channel = conf->channel; 4977 struct ieee80211_channel *channel = conf->chandef.chan;
4978 struct il_ht_config *ht_conf = &il->current_ht_config; 4978 struct il_ht_config *ht_conf = &il->current_ht_config;
4979 unsigned long flags = 0; 4979 unsigned long flags = 0;
4980 int ret = 0; 4980 int ret = 0;
diff --git a/drivers/net/wireless/iwlwifi/dvm/rs.c b/drivers/net/wireless/iwlwifi/dvm/rs.c
index abe304267261..907bd6e50aad 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rs.c
@@ -2831,7 +2831,7 @@ void iwl_rs_rate_init(struct iwl_priv *priv, struct ieee80211_sta *sta, u8 sta_i
2831 2831
2832 sta_priv = (struct iwl_station_priv *) sta->drv_priv; 2832 sta_priv = (struct iwl_station_priv *) sta->drv_priv;
2833 lq_sta = &sta_priv->lq_sta; 2833 lq_sta = &sta_priv->lq_sta;
2834 sband = hw->wiphy->bands[conf->channel->band]; 2834 sband = hw->wiphy->bands[conf->chandef.chan->band];
2835 2835
2836 2836
2837 lq_sta->lq.sta_id = sta_id; 2837 lq_sta->lq.sta_id = sta_id;
diff --git a/drivers/net/wireless/iwlwifi/dvm/rxon.c b/drivers/net/wireless/iwlwifi/dvm/rxon.c
index 23be948cf162..085c589e7149 100644
--- a/drivers/net/wireless/iwlwifi/dvm/rxon.c
+++ b/drivers/net/wireless/iwlwifi/dvm/rxon.c
@@ -78,8 +78,9 @@ void iwl_connection_init_rx_config(struct iwl_priv *priv,
78 ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK; 78 ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
79#endif 79#endif
80 80
81 ctx->staging.channel = cpu_to_le16(priv->hw->conf.channel->hw_value); 81 ctx->staging.channel =
82 priv->band = priv->hw->conf.channel->band; 82 cpu_to_le16(priv->hw->conf.chandef.chan->hw_value);
83 priv->band = priv->hw->conf.chandef.chan->band;
83 84
84 iwl_set_flags_for_band(priv, ctx, priv->band, ctx->vif); 85 iwl_set_flags_for_band(priv, ctx, priv->band, ctx->vif);
85 86
@@ -951,7 +952,7 @@ static void iwl_calc_basic_rates(struct iwl_priv *priv,
951 unsigned long basic = ctx->vif->bss_conf.basic_rates; 952 unsigned long basic = ctx->vif->bss_conf.basic_rates;
952 int i; 953 int i;
953 954
954 sband = priv->hw->wiphy->bands[priv->hw->conf.channel->band]; 955 sband = priv->hw->wiphy->bands[priv->hw->conf.chandef.chan->band];
955 956
956 for_each_set_bit(i, &basic, BITS_PER_LONG) { 957 for_each_set_bit(i, &basic, BITS_PER_LONG) {
957 int hw = sband->bitrates[i].hw_value; 958 int hw = sband->bitrates[i].hw_value;
@@ -1181,7 +1182,7 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
1181 struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); 1182 struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
1182 struct iwl_rxon_context *ctx; 1183 struct iwl_rxon_context *ctx;
1183 struct ieee80211_conf *conf = &hw->conf; 1184 struct ieee80211_conf *conf = &hw->conf;
1184 struct ieee80211_channel *channel = conf->channel; 1185 struct ieee80211_channel *channel = conf->chandef.chan;
1185 int ret = 0; 1186 int ret = 0;
1186 1187
1187 IWL_DEBUG_MAC80211(priv, "enter: changed %#x\n", changed); 1188 IWL_DEBUG_MAC80211(priv, "enter: changed %#x\n", changed);
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index 7001856241e6..088de9d25c39 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -412,9 +412,9 @@ static int lbtf_op_config(struct ieee80211_hw *hw, u32 changed)
412 struct ieee80211_conf *conf = &hw->conf; 412 struct ieee80211_conf *conf = &hw->conf;
413 lbtf_deb_enter(LBTF_DEB_MACOPS); 413 lbtf_deb_enter(LBTF_DEB_MACOPS);
414 414
415 if (conf->channel->center_freq != priv->cur_freq) { 415 if (conf->chandef.chan->center_freq != priv->cur_freq) {
416 priv->cur_freq = conf->channel->center_freq; 416 priv->cur_freq = conf->chandef.chan->center_freq;
417 lbtf_set_channel(priv, conf->channel->hw_value); 417 lbtf_set_channel(priv, conf->chandef.chan->hw_value);
418 } 418 }
419 lbtf_deb_leave(LBTF_DEB_MACOPS); 419 lbtf_deb_leave(LBTF_DEB_MACOPS);
420 return 0; 420 return 0;
@@ -537,7 +537,7 @@ static int lbtf_op_get_survey(struct ieee80211_hw *hw, int idx,
537 if (idx != 0) 537 if (idx != 0)
538 return -ENOENT; 538 return -ENOENT;
539 539
540 survey->channel = conf->channel; 540 survey->channel = conf->chandef.chan;
541 survey->filled = SURVEY_INFO_NOISE_DBM; 541 survey->filled = SURVEY_INFO_NOISE_DBM;
542 survey->noise = priv->noise; 542 survey->noise = priv->noise;
543 543
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 0064d38276bf..4ac54861e912 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1062,11 +1062,13 @@ out:
1062 return HRTIMER_NORESTART; 1062 return HRTIMER_NORESTART;
1063} 1063}
1064 1064
1065static const char *hwsim_chantypes[] = { 1065static const char * const hwsim_chanwidths[] = {
1066 [NL80211_CHAN_NO_HT] = "noht", 1066 [NL80211_CHAN_WIDTH_20_NOHT] = "noht",
1067 [NL80211_CHAN_HT20] = "ht20", 1067 [NL80211_CHAN_WIDTH_20] = "ht20",
1068 [NL80211_CHAN_HT40MINUS] = "ht40-", 1068 [NL80211_CHAN_WIDTH_40] = "ht40",
1069 [NL80211_CHAN_HT40PLUS] = "ht40+", 1069 [NL80211_CHAN_WIDTH_80] = "vht80",
1070 [NL80211_CHAN_WIDTH_80P80] = "vht80p80",
1071 [NL80211_CHAN_WIDTH_160] = "vht160",
1070}; 1072};
1071 1073
1072static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed) 1074static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
@@ -1080,18 +1082,28 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
1080 [IEEE80211_SMPS_DYNAMIC] = "dynamic", 1082 [IEEE80211_SMPS_DYNAMIC] = "dynamic",
1081 }; 1083 };
1082 1084
1083 wiphy_debug(hw->wiphy, 1085 if (conf->chandef.chan)
1084 "%s (freq=%d/%s idle=%d ps=%d smps=%s)\n", 1086 wiphy_debug(hw->wiphy,
1085 __func__, 1087 "%s (freq=%d(%d - %d)/%s idle=%d ps=%d smps=%s)\n",
1086 conf->channel ? conf->channel->center_freq : 0, 1088 __func__,
1087 hwsim_chantypes[conf->channel_type], 1089 conf->chandef.chan->center_freq,
1088 !!(conf->flags & IEEE80211_CONF_IDLE), 1090 conf->chandef.center_freq1,
1089 !!(conf->flags & IEEE80211_CONF_PS), 1091 conf->chandef.center_freq2,
1090 smps_modes[conf->smps_mode]); 1092 hwsim_chanwidths[conf->chandef.width],
1093 !!(conf->flags & IEEE80211_CONF_IDLE),
1094 !!(conf->flags & IEEE80211_CONF_PS),
1095 smps_modes[conf->smps_mode]);
1096 else
1097 wiphy_debug(hw->wiphy,
1098 "%s (freq=0 idle=%d ps=%d smps=%s)\n",
1099 __func__,
1100 !!(conf->flags & IEEE80211_CONF_IDLE),
1101 !!(conf->flags & IEEE80211_CONF_PS),
1102 smps_modes[conf->smps_mode]);
1091 1103
1092 data->idle = !!(conf->flags & IEEE80211_CONF_IDLE); 1104 data->idle = !!(conf->flags & IEEE80211_CONF_IDLE);
1093 1105
1094 data->channel = conf->channel; 1106 data->channel = conf->chandef.chan;
1095 1107
1096 WARN_ON(data->channel && channels > 1); 1108 WARN_ON(data->channel && channels > 1);
1097 1109
@@ -1277,7 +1289,7 @@ static int mac80211_hwsim_get_survey(
1277 return -ENOENT; 1289 return -ENOENT;
1278 1290
1279 /* Current channel */ 1291 /* Current channel */
1280 survey->channel = conf->channel; 1292 survey->channel = conf->chandef.chan;
1281 1293
1282 /* 1294 /*
1283 * Magically conjured noise level --- this is only ok for simulated hardware. 1295 * Magically conjured noise level --- this is only ok for simulated hardware.
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 091d9a64080a..9f9a1449e812 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -2837,7 +2837,9 @@ static int mwl8k_cmd_tx_power(struct ieee80211_hw *hw,
2837 struct ieee80211_conf *conf, 2837 struct ieee80211_conf *conf,
2838 unsigned short pwr) 2838 unsigned short pwr)
2839{ 2839{
2840 struct ieee80211_channel *channel = conf->channel; 2840 struct ieee80211_channel *channel = conf->chandef.chan;
2841 enum nl80211_channel_type channel_type =
2842 cfg80211_get_chandef_type(&conf->chandef);
2841 struct mwl8k_cmd_tx_power *cmd; 2843 struct mwl8k_cmd_tx_power *cmd;
2842 int rc; 2844 int rc;
2843 int i; 2845 int i;
@@ -2857,14 +2859,14 @@ static int mwl8k_cmd_tx_power(struct ieee80211_hw *hw,
2857 2859
2858 cmd->channel = cpu_to_le16(channel->hw_value); 2860 cmd->channel = cpu_to_le16(channel->hw_value);
2859 2861
2860 if (conf->channel_type == NL80211_CHAN_NO_HT || 2862 if (channel_type == NL80211_CHAN_NO_HT ||
2861 conf->channel_type == NL80211_CHAN_HT20) { 2863 channel_type == NL80211_CHAN_HT20) {
2862 cmd->bw = cpu_to_le16(0x2); 2864 cmd->bw = cpu_to_le16(0x2);
2863 } else { 2865 } else {
2864 cmd->bw = cpu_to_le16(0x4); 2866 cmd->bw = cpu_to_le16(0x4);
2865 if (conf->channel_type == NL80211_CHAN_HT40MINUS) 2867 if (channel_type == NL80211_CHAN_HT40MINUS)
2866 cmd->sub_ch = cpu_to_le16(0x3); 2868 cmd->sub_ch = cpu_to_le16(0x3);
2867 else if (conf->channel_type == NL80211_CHAN_HT40PLUS) 2869 else if (channel_type == NL80211_CHAN_HT40PLUS)
2868 cmd->sub_ch = cpu_to_le16(0x1); 2870 cmd->sub_ch = cpu_to_le16(0x1);
2869 } 2871 }
2870 2872
@@ -3008,7 +3010,9 @@ struct mwl8k_cmd_set_rf_channel {
3008static int mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw, 3010static int mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw,
3009 struct ieee80211_conf *conf) 3011 struct ieee80211_conf *conf)
3010{ 3012{
3011 struct ieee80211_channel *channel = conf->channel; 3013 struct ieee80211_channel *channel = conf->chandef.chan;
3014 enum nl80211_channel_type channel_type =
3015 cfg80211_get_chandef_type(&conf->chandef);
3012 struct mwl8k_cmd_set_rf_channel *cmd; 3016 struct mwl8k_cmd_set_rf_channel *cmd;
3013 int rc; 3017 int rc;
3014 3018
@@ -3026,12 +3030,12 @@ static int mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw,
3026 else if (channel->band == IEEE80211_BAND_5GHZ) 3030 else if (channel->band == IEEE80211_BAND_5GHZ)
3027 cmd->channel_flags |= cpu_to_le32(0x00000004); 3031 cmd->channel_flags |= cpu_to_le32(0x00000004);
3028 3032
3029 if (conf->channel_type == NL80211_CHAN_NO_HT || 3033 if (channel_type == NL80211_CHAN_NO_HT ||
3030 conf->channel_type == NL80211_CHAN_HT20) 3034 channel_type == NL80211_CHAN_HT20)
3031 cmd->channel_flags |= cpu_to_le32(0x00000080); 3035 cmd->channel_flags |= cpu_to_le32(0x00000080);
3032 else if (conf->channel_type == NL80211_CHAN_HT40MINUS) 3036 else if (channel_type == NL80211_CHAN_HT40MINUS)
3033 cmd->channel_flags |= cpu_to_le32(0x000001900); 3037 cmd->channel_flags |= cpu_to_le32(0x000001900);
3034 else if (conf->channel_type == NL80211_CHAN_HT40PLUS) 3038 else if (channel_type == NL80211_CHAN_HT40PLUS)
3035 cmd->channel_flags |= cpu_to_le32(0x000000900); 3039 cmd->channel_flags |= cpu_to_le32(0x000000900);
3036 3040
3037 rc = mwl8k_post_cmd(hw, &cmd->header); 3041 rc = mwl8k_post_cmd(hw, &cmd->header);
@@ -3950,7 +3954,7 @@ static int mwl8k_cmd_set_new_stn_add(struct ieee80211_hw *hw,
3950 memcpy(cmd->mac_addr, sta->addr, ETH_ALEN); 3954 memcpy(cmd->mac_addr, sta->addr, ETH_ALEN);
3951 cmd->stn_id = cpu_to_le16(sta->aid); 3955 cmd->stn_id = cpu_to_le16(sta->aid);
3952 cmd->action = cpu_to_le16(MWL8K_STA_ACTION_ADD); 3956 cmd->action = cpu_to_le16(MWL8K_STA_ACTION_ADD);
3953 if (hw->conf.channel->band == IEEE80211_BAND_2GHZ) 3957 if (hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ)
3954 rates = sta->supp_rates[IEEE80211_BAND_2GHZ]; 3958 rates = sta->supp_rates[IEEE80211_BAND_2GHZ];
3955 else 3959 else
3956 rates = sta->supp_rates[IEEE80211_BAND_5GHZ] << 5; 3960 rates = sta->supp_rates[IEEE80211_BAND_5GHZ] << 5;
@@ -4385,7 +4389,7 @@ static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw,
4385 p->ht_caps = cpu_to_le16(sta->ht_cap.cap); 4389 p->ht_caps = cpu_to_le16(sta->ht_cap.cap);
4386 p->extended_ht_caps = (sta->ht_cap.ampdu_factor & 3) | 4390 p->extended_ht_caps = (sta->ht_cap.ampdu_factor & 3) |
4387 ((sta->ht_cap.ampdu_density & 7) << 2); 4391 ((sta->ht_cap.ampdu_density & 7) << 2);
4388 if (hw->conf.channel->band == IEEE80211_BAND_2GHZ) 4392 if (hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ)
4389 rates = sta->supp_rates[IEEE80211_BAND_2GHZ]; 4393 rates = sta->supp_rates[IEEE80211_BAND_2GHZ];
4390 else 4394 else
4391 rates = sta->supp_rates[IEEE80211_BAND_5GHZ] << 5; 4395 rates = sta->supp_rates[IEEE80211_BAND_5GHZ] << 5;
@@ -4868,7 +4872,7 @@ mwl8k_bss_info_changed_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
4868 goto out; 4872 goto out;
4869 } 4873 }
4870 4874
4871 if (hw->conf.channel->band == IEEE80211_BAND_2GHZ) { 4875 if (hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ) {
4872 ap_legacy_rates = ap->supp_rates[IEEE80211_BAND_2GHZ]; 4876 ap_legacy_rates = ap->supp_rates[IEEE80211_BAND_2GHZ];
4873 } else { 4877 } else {
4874 ap_legacy_rates = 4878 ap_legacy_rates =
@@ -4900,7 +4904,7 @@ mwl8k_bss_info_changed_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
4900 if (idx) 4904 if (idx)
4901 idx--; 4905 idx--;
4902 4906
4903 if (hw->conf.channel->band == IEEE80211_BAND_2GHZ) 4907 if (hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ)
4904 rate = mwl8k_rates_24[idx].hw_value; 4908 rate = mwl8k_rates_24[idx].hw_value;
4905 else 4909 else
4906 rate = mwl8k_rates_50[idx].hw_value; 4910 rate = mwl8k_rates_50[idx].hw_value;
@@ -4973,7 +4977,7 @@ mwl8k_bss_info_changed_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
4973 if (idx) 4977 if (idx)
4974 idx--; 4978 idx--;
4975 4979
4976 if (hw->conf.channel->band == IEEE80211_BAND_2GHZ) 4980 if (hw->conf.chandef.chan->band == IEEE80211_BAND_2GHZ)
4977 rate = mwl8k_rates_24[idx].hw_value; 4981 rate = mwl8k_rates_24[idx].hw_value;
4978 else 4982 else
4979 rate = mwl8k_rates_50[idx].hw_value; 4983 rate = mwl8k_rates_50[idx].hw_value;
@@ -5246,7 +5250,7 @@ static int mwl8k_get_survey(struct ieee80211_hw *hw, int idx,
5246 if (idx != 0) 5250 if (idx != 0)
5247 return -ENOENT; 5251 return -ENOENT;
5248 5252
5249 survey->channel = conf->channel; 5253 survey->channel = conf->chandef.chan;
5250 survey->filled = SURVEY_INFO_NOISE_DBM; 5254 survey->filled = SURVEY_INFO_NOISE_DBM;
5251 survey->noise = priv->noise; 5255 survey->noise = priv->noise;
5252 5256
diff --git a/drivers/net/wireless/p54/fwio.c b/drivers/net/wireless/p54/fwio.c
index 9ba85106eec0..b3879fbf5368 100644
--- a/drivers/net/wireless/p54/fwio.c
+++ b/drivers/net/wireless/p54/fwio.c
@@ -402,7 +402,7 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell)
402 struct p54_rssi_db_entry *rssi_data; 402 struct p54_rssi_db_entry *rssi_data;
403 unsigned int i; 403 unsigned int i;
404 void *entry; 404 void *entry;
405 __le16 freq = cpu_to_le16(priv->hw->conf.channel->center_freq); 405 __le16 freq = cpu_to_le16(priv->hw->conf.chandef.chan->center_freq);
406 406
407 skb = p54_alloc_skb(priv, P54_HDR_FLAG_CONTROL_OPSET, sizeof(*head) + 407 skb = p54_alloc_skb(priv, P54_HDR_FLAG_CONTROL_OPSET, sizeof(*head) +
408 2 + sizeof(*iq_autocal) + sizeof(*body) + 408 2 + sizeof(*iq_autocal) + sizeof(*body) +
@@ -532,7 +532,7 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell)
532err: 532err:
533 wiphy_err(priv->hw->wiphy, "frequency change to channel %d failed.\n", 533 wiphy_err(priv->hw->wiphy, "frequency change to channel %d failed.\n",
534 ieee80211_frequency_to_channel( 534 ieee80211_frequency_to_channel(
535 priv->hw->conf.channel->center_freq)); 535 priv->hw->conf.chandef.chan->center_freq));
536 536
537 dev_kfree_skb_any(skb); 537 dev_kfree_skb_any(skb);
538 return -EINVAL; 538 return -EINVAL;
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index ee654a691f38..067e6f2fd050 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -340,7 +340,7 @@ static int p54_config(struct ieee80211_hw *dev, u32 changed)
340 * TODO: Use the LM_SCAN_TRAP to determine the current 340 * TODO: Use the LM_SCAN_TRAP to determine the current
341 * operating channel. 341 * operating channel.
342 */ 342 */
343 priv->curchan = priv->hw->conf.channel; 343 priv->curchan = priv->hw->conf.chandef.chan;
344 p54_reset_stats(priv); 344 p54_reset_stats(priv);
345 WARN_ON(p54_fetch_statistics(priv)); 345 WARN_ON(p54_fetch_statistics(priv));
346 } 346 }
@@ -480,7 +480,7 @@ static void p54_bss_info_changed(struct ieee80211_hw *dev,
480 p54_set_edcf(priv); 480 p54_set_edcf(priv);
481 } 481 }
482 if (changed & BSS_CHANGED_BASIC_RATES) { 482 if (changed & BSS_CHANGED_BASIC_RATES) {
483 if (dev->conf.channel->band == IEEE80211_BAND_5GHZ) 483 if (dev->conf.chandef.chan->band == IEEE80211_BAND_5GHZ)
484 priv->basic_rate_mask = (info->basic_rates << 4); 484 priv->basic_rate_mask = (info->basic_rates << 4);
485 else 485 else
486 priv->basic_rate_mask = info->basic_rates; 486 priv->basic_rate_mask = info->basic_rates;
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 12f0a34477f2..f95de0d16216 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -354,13 +354,13 @@ static int p54_rx_data(struct p54_common *priv, struct sk_buff *skb)
354 rx_status->signal = p54_rssi_to_dbm(priv, hdr->rssi); 354 rx_status->signal = p54_rssi_to_dbm(priv, hdr->rssi);
355 if (hdr->rate & 0x10) 355 if (hdr->rate & 0x10)
356 rx_status->flag |= RX_FLAG_SHORTPRE; 356 rx_status->flag |= RX_FLAG_SHORTPRE;
357 if (priv->hw->conf.channel->band == IEEE80211_BAND_5GHZ) 357 if (priv->hw->conf.chandef.chan->band == IEEE80211_BAND_5GHZ)
358 rx_status->rate_idx = (rate < 4) ? 0 : rate - 4; 358 rx_status->rate_idx = (rate < 4) ? 0 : rate - 4;
359 else 359 else
360 rx_status->rate_idx = rate; 360 rx_status->rate_idx = rate;
361 361
362 rx_status->freq = freq; 362 rx_status->freq = freq;
363 rx_status->band = priv->hw->conf.channel->band; 363 rx_status->band = priv->hw->conf.chandef.chan->band;
364 rx_status->antenna = hdr->antenna; 364 rx_status->antenna = hdr->antenna;
365 365
366 tsf32 = le32_to_cpu(hdr->tsf32); 366 tsf32 = le32_to_cpu(hdr->tsf32);
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index a658b4bc7da2..34456b45acbb 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -2763,7 +2763,7 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev,
2763 2763
2764void rt2800_gain_calibration(struct rt2x00_dev *rt2x00dev) 2764void rt2800_gain_calibration(struct rt2x00_dev *rt2x00dev)
2765{ 2765{
2766 rt2800_config_txpower(rt2x00dev, rt2x00dev->hw->conf.channel, 2766 rt2800_config_txpower(rt2x00dev, rt2x00dev->hw->conf.chandef.chan,
2767 rt2x00dev->tx_power); 2767 rt2x00dev->tx_power);
2768} 2768}
2769EXPORT_SYMBOL_GPL(rt2800_gain_calibration); 2769EXPORT_SYMBOL_GPL(rt2800_gain_calibration);
@@ -2898,11 +2898,11 @@ void rt2800_config(struct rt2x00_dev *rt2x00dev,
2898 if (flags & IEEE80211_CONF_CHANGE_CHANNEL) { 2898 if (flags & IEEE80211_CONF_CHANGE_CHANNEL) {
2899 rt2800_config_channel(rt2x00dev, libconf->conf, 2899 rt2800_config_channel(rt2x00dev, libconf->conf,
2900 &libconf->rf, &libconf->channel); 2900 &libconf->rf, &libconf->channel);
2901 rt2800_config_txpower(rt2x00dev, libconf->conf->channel, 2901 rt2800_config_txpower(rt2x00dev, libconf->conf->chandef.chan,
2902 libconf->conf->power_level); 2902 libconf->conf->power_level);
2903 } 2903 }
2904 if (flags & IEEE80211_CONF_CHANGE_POWER) 2904 if (flags & IEEE80211_CONF_CHANGE_POWER)
2905 rt2800_config_txpower(rt2x00dev, libconf->conf->channel, 2905 rt2800_config_txpower(rt2x00dev, libconf->conf->chandef.chan,
2906 libconf->conf->power_level); 2906 libconf->conf->power_level);
2907 if (flags & IEEE80211_CONF_CHANGE_RETRY_LIMITS) 2907 if (flags & IEEE80211_CONF_CHANGE_RETRY_LIMITS)
2908 rt2800_config_retry_limit(rt2x00dev, libconf); 2908 rt2800_config_retry_limit(rt2x00dev, libconf);
@@ -5563,7 +5563,7 @@ int rt2800_get_survey(struct ieee80211_hw *hw, int idx,
5563 if (idx != 0) 5563 if (idx != 0)
5564 return -ENOENT; 5564 return -ENOENT;
5565 5565
5566 survey->channel = conf->channel; 5566 survey->channel = conf->chandef.chan;
5567 5567
5568 rt2800_register_read(rt2x00dev, CH_IDLE_STA, &idle); 5568 rt2800_register_read(rt2x00dev, CH_IDLE_STA, &idle);
5569 rt2800_register_read(rt2x00dev, CH_BUSY_STA, &busy); 5569 rt2800_register_read(rt2x00dev, CH_BUSY_STA, &busy);
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 49a63e973934..8cb43f8f3efc 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -184,7 +184,7 @@ static u16 rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev,
184 /* 184 /*
185 * Initialize center channel to current channel. 185 * Initialize center channel to current channel.
186 */ 186 */
187 center_channel = spec->channels[conf->channel->hw_value].channel; 187 center_channel = spec->channels[conf->chandef.chan->hw_value].channel;
188 188
189 /* 189 /*
190 * Adjust center channel to HT40+ and HT40- operation. 190 * Adjust center channel to HT40+ and HT40- operation.
@@ -199,7 +199,7 @@ static u16 rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev,
199 return i; 199 return i;
200 200
201 WARN_ON(1); 201 WARN_ON(1);
202 return conf->channel->hw_value; 202 return conf->chandef.chan->hw_value;
203} 203}
204 204
205void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, 205void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
@@ -227,7 +227,7 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
227 hw_value = rt2x00ht_center_channel(rt2x00dev, conf); 227 hw_value = rt2x00ht_center_channel(rt2x00dev, conf);
228 } else { 228 } else {
229 clear_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags); 229 clear_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags);
230 hw_value = conf->channel->hw_value; 230 hw_value = conf->chandef.chan->hw_value;
231 } 231 }
232 232
233 memcpy(&libconf.rf, 233 memcpy(&libconf.rf,
@@ -279,8 +279,8 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
279 else 279 else
280 clear_bit(CONFIG_POWERSAVING, &rt2x00dev->flags); 280 clear_bit(CONFIG_POWERSAVING, &rt2x00dev->flags);
281 281
282 rt2x00dev->curr_band = conf->channel->band; 282 rt2x00dev->curr_band = conf->chandef.chan->band;
283 rt2x00dev->curr_freq = conf->channel->center_freq; 283 rt2x00dev->curr_freq = conf->chandef.chan->center_freq;
284 rt2x00dev->tx_power = conf->power_level; 284 rt2x00dev->tx_power = conf->power_level;
285 rt2x00dev->short_retry = conf->short_frame_max_tx_count; 285 rt2x00dev->short_retry = conf->short_frame_max_tx_count;
286 rt2x00dev->long_retry = conf->long_frame_max_tx_count; 286 rt2x00dev->long_retry = conf->long_frame_max_tx_count;
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index f95792cfcf89..f85035cc836f 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -847,7 +847,7 @@ static void rt61pci_config_lna_gain(struct rt2x00_dev *rt2x00dev,
847 u16 eeprom; 847 u16 eeprom;
848 short lna_gain = 0; 848 short lna_gain = 0;
849 849
850 if (libconf->conf->channel->band == IEEE80211_BAND_2GHZ) { 850 if (libconf->conf->chandef.chan->band == IEEE80211_BAND_2GHZ) {
851 if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags)) 851 if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags))
852 lna_gain += 14; 852 lna_gain += 14;
853 853
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 24eec66e9fd2..a3387b146bb5 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -739,7 +739,7 @@ static void rt73usb_config_lna_gain(struct rt2x00_dev *rt2x00dev,
739 u16 eeprom; 739 u16 eeprom;
740 short lna_gain = 0; 740 short lna_gain = 0;
741 741
742 if (libconf->conf->channel->band == IEEE80211_BAND_2GHZ) { 742 if (libconf->conf->chandef.chan->band == IEEE80211_BAND_2GHZ) {
743 if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags)) 743 if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags))
744 lna_gain += 14; 744 lna_gain += 14;
745 745
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index 1b3c2843221d..91a04e2b8ece 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -147,8 +147,8 @@ static void rtl8180_handle_rx(struct ieee80211_hw *dev)
147 signal = priv->rf->calc_rssi(agc, sq); 147 signal = priv->rf->calc_rssi(agc, sq);
148 } 148 }
149 rx_status.signal = signal; 149 rx_status.signal = signal;
150 rx_status.freq = dev->conf.channel->center_freq; 150 rx_status.freq = dev->conf.chandef.chan->center_freq;
151 rx_status.band = dev->conf.channel->band; 151 rx_status.band = dev->conf.chandef.chan->band;
152 rx_status.mactime = le64_to_cpu(entry->tsft); 152 rx_status.mactime = le64_to_cpu(entry->tsft);
153 rx_status.flag |= RX_FLAG_MACTIME_START; 153 rx_status.flag |= RX_FLAG_MACTIME_START;
154 if (flags & RTL818X_RX_DESC_FLAG_CRC32_ERR) 154 if (flags & RTL818X_RX_DESC_FLAG_CRC32_ERR)
diff --git a/drivers/net/wireless/rtl818x/rtl8180/grf5101.c b/drivers/net/wireless/rtl818x/rtl8180/grf5101.c
index 5ee7589dd546..077ff92cc139 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/grf5101.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/grf5101.c
@@ -82,7 +82,8 @@ static void grf5101_rf_set_channel(struct ieee80211_hw *dev,
82 struct ieee80211_conf *conf) 82 struct ieee80211_conf *conf)
83{ 83{
84 struct rtl8180_priv *priv = dev->priv; 84 struct rtl8180_priv *priv = dev->priv;
85 int channel = ieee80211_frequency_to_channel(conf->channel->center_freq); 85 int channel =
86 ieee80211_frequency_to_channel(conf->chandef.chan->center_freq);
86 u32 txpw = priv->channels[channel - 1].hw_value & 0xFF; 87 u32 txpw = priv->channels[channel - 1].hw_value & 0xFF;
87 u32 chan = channel - 1; 88 u32 chan = channel - 1;
88 89
diff --git a/drivers/net/wireless/rtl818x/rtl8180/max2820.c b/drivers/net/wireless/rtl818x/rtl8180/max2820.c
index 667b3363d437..4715000c94dd 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/max2820.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/max2820.c
@@ -95,7 +95,7 @@ static void max2820_rf_set_channel(struct ieee80211_hw *dev,
95{ 95{
96 struct rtl8180_priv *priv = dev->priv; 96 struct rtl8180_priv *priv = dev->priv;
97 int channel = conf ? 97 int channel = conf ?
98 ieee80211_frequency_to_channel(conf->channel->center_freq) : 1; 98 ieee80211_frequency_to_channel(conf->chandef.chan->center_freq) : 1;
99 unsigned int chan_idx = channel - 1; 99 unsigned int chan_idx = channel - 1;
100 u32 txpw = priv->channels[chan_idx].hw_value & 0xFF; 100 u32 txpw = priv->channels[chan_idx].hw_value & 0xFF;
101 u32 chan = max2820_chan[chan_idx]; 101 u32 chan = max2820_chan[chan_idx];
diff --git a/drivers/net/wireless/rtl818x/rtl8180/rtl8225.c b/drivers/net/wireless/rtl818x/rtl8180/rtl8225.c
index 7c4574ba9d75..cc2a5412c1f0 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/rtl8225.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/rtl8225.c
@@ -719,7 +719,8 @@ static void rtl8225_rf_set_channel(struct ieee80211_hw *dev,
719 struct ieee80211_conf *conf) 719 struct ieee80211_conf *conf)
720{ 720{
721 struct rtl8180_priv *priv = dev->priv; 721 struct rtl8180_priv *priv = dev->priv;
722 int chan = ieee80211_frequency_to_channel(conf->channel->center_freq); 722 int chan =
723 ieee80211_frequency_to_channel(conf->chandef.chan->center_freq);
723 724
724 if (priv->rf->init == rtl8225_rf_init) 725 if (priv->rf->init == rtl8225_rf_init)
725 rtl8225_rf_set_tx_power(dev, chan); 726 rtl8225_rf_set_tx_power(dev, chan);
diff --git a/drivers/net/wireless/rtl818x/rtl8180/sa2400.c b/drivers/net/wireless/rtl818x/rtl8180/sa2400.c
index 44771a6286af..b3ec40f6bd23 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/sa2400.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/sa2400.c
@@ -105,7 +105,8 @@ static void sa2400_rf_set_channel(struct ieee80211_hw *dev,
105 struct ieee80211_conf *conf) 105 struct ieee80211_conf *conf)
106{ 106{
107 struct rtl8180_priv *priv = dev->priv; 107 struct rtl8180_priv *priv = dev->priv;
108 int channel = ieee80211_frequency_to_channel(conf->channel->center_freq); 108 int channel =
109 ieee80211_frequency_to_channel(conf->chandef.chan->center_freq);
109 u32 txpw = priv->channels[channel - 1].hw_value & 0xFF; 110 u32 txpw = priv->channels[channel - 1].hw_value & 0xFF;
110 u32 chan = sa2400_chan[channel - 1]; 111 u32 chan = sa2400_chan[channel - 1];
111 112
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index 4574bd213705..f49220e234b0 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -379,8 +379,8 @@ static void rtl8187_rx_cb(struct urb *urb)
379 rate = (flags >> 20) & 0xF; 379 rate = (flags >> 20) & 0xF;
380 skb_trim(skb, flags & 0x0FFF); 380 skb_trim(skb, flags & 0x0FFF);
381 rx_status.rate_idx = rate; 381 rx_status.rate_idx = rate;
382 rx_status.freq = dev->conf.channel->center_freq; 382 rx_status.freq = dev->conf.chandef.chan->center_freq;
383 rx_status.band = dev->conf.channel->band; 383 rx_status.band = dev->conf.chandef.chan->band;
384 rx_status.flag |= RX_FLAG_MACTIME_START; 384 rx_status.flag |= RX_FLAG_MACTIME_START;
385 if (flags & RTL818X_RX_DESC_FLAG_CRC32_ERR) 385 if (flags & RTL818X_RX_DESC_FLAG_CRC32_ERR)
386 rx_status.flag |= RX_FLAG_FAILED_FCS_CRC; 386 rx_status.flag |= RX_FLAG_FAILED_FCS_CRC;
diff --git a/drivers/net/wireless/rtl818x/rtl8187/rtl8225.c b/drivers/net/wireless/rtl818x/rtl8187/rtl8225.c
index 908903f721f5..f0bf35fedbaf 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/rtl8225.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/rtl8225.c
@@ -905,7 +905,8 @@ static void rtl8225_rf_set_channel(struct ieee80211_hw *dev,
905 struct ieee80211_conf *conf) 905 struct ieee80211_conf *conf)
906{ 906{
907 struct rtl8187_priv *priv = dev->priv; 907 struct rtl8187_priv *priv = dev->priv;
908 int chan = ieee80211_frequency_to_channel(conf->channel->center_freq); 908 int chan =
909 ieee80211_frequency_to_channel(conf->chandef.chan->center_freq);
909 910
910 if (priv->rf->init == rtl8225_rf_init) 911 if (priv->rf->init == rtl8225_rf_init)
911 rtl8225_rf_set_tx_power(dev, chan); 912 rtl8225_rf_set_tx_power(dev, chan);
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index 99c5cea3fe21..0e7866d1d0e2 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -691,7 +691,7 @@ int rtlwifi_rate_mapping(struct ieee80211_hw *hw,
691 int rate_idx; 691 int rate_idx;
692 692
693 if (false == isht) { 693 if (false == isht) {
694 if (IEEE80211_BAND_2GHZ == hw->conf.channel->band) { 694 if (IEEE80211_BAND_2GHZ == hw->conf.chandef.chan->band) {
695 switch (desc_rate) { 695 switch (desc_rate) {
696 case DESC92_RATE1M: 696 case DESC92_RATE1M:
697 rate_idx = 0; 697 rate_idx = 0;
@@ -1365,7 +1365,7 @@ int rtl_send_smps_action(struct ieee80211_hw *hw,
1365 rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0); 1365 rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0);
1366 1366
1367 info->control.rates[0].idx = 0; 1367 info->control.rates[0].idx = 0;
1368 info->band = hw->conf.channel->band; 1368 info->band = hw->conf.chandef.chan->band;
1369 rtlpriv->intf_ops->adapter_tx(hw, sta, skb, &tcb_desc); 1369 rtlpriv->intf_ops->adapter_tx(hw, sta, skb, &tcb_desc);
1370 } 1370 }
1371err_free: 1371err_free:
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index b5a7a260bf63..64a41ecf86cf 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -320,7 +320,7 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
320 } 320 }
321 321
322 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { 322 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
323 struct ieee80211_channel *channel = hw->conf.channel; 323 struct ieee80211_channel *channel = hw->conf.chandef.chan;
324 u8 wide_chan = (u8) channel->hw_value; 324 u8 wide_chan = (u8) channel->hw_value;
325 325
326 /* 326 /*
@@ -332,7 +332,7 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
332 *info for cisco1253 bw20, so we modify 332 *info for cisco1253 bw20, so we modify
333 *it here based on UPPER & LOWER 333 *it here based on UPPER & LOWER
334 */ 334 */
335 switch (hw->conf.channel_type) { 335 switch (cfg80211_get_chandef_type(&hw->conf.chandef)) {
336 case NL80211_CHAN_HT20: 336 case NL80211_CHAN_HT20:
337 case NL80211_CHAN_NO_HT: 337 case NL80211_CHAN_NO_HT:
338 /* SC */ 338 /* SC */
@@ -390,7 +390,7 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
390 rtlpriv->cfg->ops->switch_channel(hw); 390 rtlpriv->cfg->ops->switch_channel(hw);
391 rtlpriv->cfg->ops->set_channel_access(hw); 391 rtlpriv->cfg->ops->set_channel_access(hw);
392 rtlpriv->cfg->ops->set_bw_mode(hw, 392 rtlpriv->cfg->ops->set_bw_mode(hw,
393 hw->conf.channel_type); 393 cfg80211_get_chandef_type(&hw->conf.chandef));
394 } 394 }
395 395
396 mutex_unlock(&rtlpriv->locks.conf_mutex); 396 mutex_unlock(&rtlpriv->locks.conf_mutex);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
index b9b1a6e0b16e..27e4ebd51091 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
@@ -544,8 +544,8 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
544 stats->timestamp_low = GET_RX_DESC_TSFL(pdesc); 544 stats->timestamp_low = GET_RX_DESC_TSFL(pdesc);
545 stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc); 545 stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc);
546 546
547 rx_status->freq = hw->conf.channel->center_freq; 547 rx_status->freq = hw->conf.chandef.chan->center_freq;
548 rx_status->band = hw->conf.channel->band; 548 rx_status->band = hw->conf.chandef.chan->band;
549 549
550 if (GET_RX_DESC_CRC32(pdesc)) 550 if (GET_RX_DESC_CRC32(pdesc))
551 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; 551 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
index b6222eedb835..f0dada530153 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
@@ -324,8 +324,8 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
324 && (GET_RX_DESC_FAGGR(pdesc) == 1)); 324 && (GET_RX_DESC_FAGGR(pdesc) == 1));
325 stats->timestamp_low = GET_RX_DESC_TSFL(pdesc); 325 stats->timestamp_low = GET_RX_DESC_TSFL(pdesc);
326 stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc); 326 stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc);
327 rx_status->freq = hw->conf.channel->center_freq; 327 rx_status->freq = hw->conf.chandef.chan->center_freq;
328 rx_status->band = hw->conf.channel->band; 328 rx_status->band = hw->conf.chandef.chan->band;
329 if (GET_RX_DESC_CRC32(pdesc)) 329 if (GET_RX_DESC_CRC32(pdesc))
330 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; 330 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
331 if (!GET_RX_DESC_SWDEC(pdesc)) 331 if (!GET_RX_DESC_SWDEC(pdesc))
@@ -395,8 +395,8 @@ static void _rtl_rx_process(struct ieee80211_hw *hw, struct sk_buff *skb)
395 stats.rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(rxdesc); 395 stats.rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(rxdesc);
396 /* TODO: is center_freq changed when doing scan? */ 396 /* TODO: is center_freq changed when doing scan? */
397 /* TODO: Shall we add protection or just skip those two step? */ 397 /* TODO: Shall we add protection or just skip those two step? */
398 rx_status->freq = hw->conf.channel->center_freq; 398 rx_status->freq = hw->conf.chandef.chan->center_freq;
399 rx_status->band = hw->conf.channel->band; 399 rx_status->band = hw->conf.chandef.chan->band;
400 if (GET_RX_DESC_CRC32(rxdesc)) 400 if (GET_RX_DESC_CRC32(rxdesc))
401 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; 401 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
402 if (!GET_RX_DESC_SWDEC(rxdesc)) 402 if (!GET_RX_DESC_SWDEC(rxdesc))
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
index 941080e03c06..b8ec718a0fab 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
@@ -499,8 +499,8 @@ bool rtl92de_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
499 && (GET_RX_DESC_FAGGR(pdesc) == 1)); 499 && (GET_RX_DESC_FAGGR(pdesc) == 1));
500 stats->timestamp_low = GET_RX_DESC_TSFL(pdesc); 500 stats->timestamp_low = GET_RX_DESC_TSFL(pdesc);
501 stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc); 501 stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc);
502 rx_status->freq = hw->conf.channel->center_freq; 502 rx_status->freq = hw->conf.chandef.chan->center_freq;
503 rx_status->band = hw->conf.channel->band; 503 rx_status->band = hw->conf.chandef.chan->band;
504 if (GET_RX_DESC_CRC32(pdesc)) 504 if (GET_RX_DESC_CRC32(pdesc))
505 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; 505 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
506 if (!GET_RX_DESC_SWDEC(pdesc)) 506 if (!GET_RX_DESC_SWDEC(pdesc))
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index 7b0a2e75b8b8..0b074f11f969 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -538,8 +538,8 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
538 if (stats->hwerror) 538 if (stats->hwerror)
539 return false; 539 return false;
540 540
541 rx_status->freq = hw->conf.channel->center_freq; 541 rx_status->freq = hw->conf.chandef.chan->center_freq;
542 rx_status->band = hw->conf.channel->band; 542 rx_status->band = hw->conf.chandef.chan->band;
543 543
544 hdr = (struct ieee80211_hdr *)(skb->data + stats->rx_drvinfo_size 544 hdr = (struct ieee80211_hdr *)(skb->data + stats->rx_drvinfo_size
545 + stats->rx_bufshift); 545 + stats->rx_bufshift);
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
index ac081297db50..601261d67e84 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
@@ -304,8 +304,8 @@ bool rtl8723ae_rx_query_desc(struct ieee80211_hw *hw,
304 304
305 status->is_cck = RTL8723E_RX_HAL_IS_CCK_RATE(status->rate); 305 status->is_cck = RTL8723E_RX_HAL_IS_CCK_RATE(status->rate);
306 306
307 rx_status->freq = hw->conf.channel->center_freq; 307 rx_status->freq = hw->conf.chandef.chan->center_freq;
308 rx_status->band = hw->conf.channel->band; 308 rx_status->band = hw->conf.chandef.chan->band;
309 309
310 hdr = (struct ieee80211_hdr *)(skb->data + status->rx_drvinfo_size 310 hdr = (struct ieee80211_hdr *)(skb->data + status->rx_drvinfo_size
311 + status->rx_bufshift); 311 + status->rx_bufshift);
diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
index bbbf68cf50a7..3291ffa95273 100644
--- a/drivers/net/wireless/ti/wl1251/main.c
+++ b/drivers/net/wireless/ti/wl1251/main.c
@@ -572,7 +572,8 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
572 struct ieee80211_conf *conf = &hw->conf; 572 struct ieee80211_conf *conf = &hw->conf;
573 int channel, ret = 0; 573 int channel, ret = 0;
574 574
575 channel = ieee80211_frequency_to_channel(conf->channel->center_freq); 575 channel = ieee80211_frequency_to_channel(
576 conf->chandef.chan->center_freq);
576 577
577 wl1251_debug(DEBUG_MAC80211, "mac80211 config ch %d psm %s power %d", 578 wl1251_debug(DEBUG_MAC80211, "mac80211 config ch %d psm %s power %d",
578 channel, 579 channel,
@@ -1223,7 +1224,7 @@ static int wl1251_op_get_survey(struct ieee80211_hw *hw, int idx,
1223 if (idx != 0) 1224 if (idx != 0)
1224 return -ENOENT; 1225 return -ENOENT;
1225 1226
1226 survey->channel = conf->channel; 1227 survey->channel = conf->chandef.chan;
1227 survey->filled = SURVEY_INFO_NOISE_DBM; 1228 survey->filled = SURVEY_INFO_NOISE_DBM;
1228 survey->noise = wl->noise; 1229 survey->noise = wl->noise;
1229 1230
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index a9f7041c7192..c26cb095010c 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -4474,7 +4474,7 @@ static int wl1271_op_get_survey(struct ieee80211_hw *hw, int idx,
4474 if (idx != 0) 4474 if (idx != 0)
4475 return -ENOENT; 4475 return -ENOENT;
4476 4476
4477 survey->channel = conf->channel; 4477 survey->channel = conf->chandef.chan;
4478 survey->filled = 0; 4478 survey->filled = 0;
4479 return 0; 4479 return 0;
4480} 4480}
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 114364b5d466..c6208a7988e4 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -1156,10 +1156,10 @@ static int zd_op_config(struct ieee80211_hw *hw, u32 changed)
1156 struct ieee80211_conf *conf = &hw->conf; 1156 struct ieee80211_conf *conf = &hw->conf;
1157 1157
1158 spin_lock_irq(&mac->lock); 1158 spin_lock_irq(&mac->lock);
1159 mac->channel = conf->channel->hw_value; 1159 mac->channel = conf->chandef.chan->hw_value;
1160 spin_unlock_irq(&mac->lock); 1160 spin_unlock_irq(&mac->lock);
1161 1161
1162 return zd_chip_set_channel(&mac->chip, conf->channel->hw_value); 1162 return zd_chip_set_channel(&mac->chip, conf->chandef.chan->hw_value);
1163} 1163}
1164 1164
1165static void zd_beacon_done(struct zd_mac *mac) 1165static void zd_beacon_done(struct zd_mac *mac)