1 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
2 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
3 @@ -585,6 +585,7 @@ struct ath_softc {
4 struct ieee80211_hw *hw;
10 struct survey_info *cur_survey;
11 --- a/drivers/net/wireless/ath/ath9k/debug.c
12 +++ b/drivers/net/wireless/ath/ath9k/debug.c
13 @@ -1693,6 +1693,9 @@ int ath9k_init_debug(struct ath_hw *ah)
14 debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
17 + debugfs_create_u32("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
21 memset(&sc->debug.bb_mac_samp, 0, sizeof(sc->debug.bb_mac_samp));
22 sc->debug.sampidx = 0;
23 --- a/drivers/net/wireless/ath/ath9k/main.c
24 +++ b/drivers/net/wireless/ath/ath9k/main.c
25 @@ -1636,9 +1636,10 @@ static int ath9k_config(struct ieee80211
27 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
28 struct ieee80211_channel *curchan = hw->conf.channel;
29 - struct ath9k_channel old_chan;
30 + struct ath9k_channel old_chan, *hchan;
31 int pos = curchan->hw_value;
37 @@ -1691,7 +1692,23 @@ static int ath9k_config(struct ieee80211
38 memset(&sc->survey[pos], 0, sizeof(struct survey_info));
41 - if (ath_set_channel(sc, hw, &sc->sc_ah->channels[pos]) < 0) {
42 + hchan = &sc->sc_ah->channels[pos];
43 + oldflags = hchan->channelFlags;
44 + switch (sc->chan_bw) {
46 + hchan->channelFlags &= ~CHANNEL_HALF;
47 + hchan->channelFlags |= CHANNEL_QUARTER;
50 + hchan->channelFlags &= ~CHANNEL_QUARTER;
51 + hchan->channelFlags |= CHANNEL_HALF;
54 + hchan->channelFlags &= ~(CHANNEL_HALF | CHANNEL_QUARTER);
58 + if (ath_set_channel(sc, hw, hchan) < 0) {
59 ath_err(common, "Unable to set channel\n");
60 mutex_unlock(&sc->mutex);
62 --- a/drivers/net/wireless/ath/ath9k/hw.c
63 +++ b/drivers/net/wireless/ath/ath9k/hw.c
64 @@ -1509,6 +1509,10 @@ int ath9k_hw_reset(struct ath_hw *ah, st
65 (AR_SREV_9300_20_OR_LATER(ah) && IS_CHAN_5GHZ(chan)))
66 bChannelChange = false;
68 + if (!ah->curchan || ((ah->curchan->channelFlags ^ chan->channelFlags) &
69 + (CHANNEL_HALF | CHANNEL_QUARTER)))
70 + bChannelChange = false;
73 (ah->chip_fullsleep != true) &&
74 (ah->curchan != NULL) &&