diff options
Diffstat (limited to 'package/mac80211/patches/513-ath9k_channelbw_debugfs.patch')
-rw-r--r-- | package/mac80211/patches/513-ath9k_channelbw_debugfs.patch | 75 |
1 files changed, 46 insertions, 29 deletions
diff --git a/package/mac80211/patches/513-ath9k_channelbw_debugfs.patch b/package/mac80211/patches/513-ath9k_channelbw_debugfs.patch index 6ae1323d2b..fedd17f51d 100644 --- a/package/mac80211/patches/513-ath9k_channelbw_debugfs.patch +++ b/package/mac80211/patches/513-ath9k_channelbw_debugfs.patch @@ -22,36 +22,53 @@ } --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -226,6 +226,7 @@ static int ath_set_channel(struct ath_so - bool fastcc = true, stopped; - struct ieee80211_channel *channel = hw->conf.channel; - struct ath9k_hw_cal_data *caldata = NULL; -+ u32 oldflags; - int r; +@@ -1654,9 +1654,10 @@ static int ath9k_config(struct ieee80211 - if (sc->sc_flags & SC_OP_INVALID) -@@ -268,6 +269,24 @@ static int ath_set_channel(struct ath_so - if (!stopped || !(sc->sc_flags & SC_OP_OFFCHANNEL)) - fastcc = false; + if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { + struct ieee80211_channel *curchan = hw->conf.channel; +- struct ath9k_channel old_chan; ++ struct ath9k_channel old_chan, *hchan; + int pos = curchan->hw_value; + int old_pos = -1; ++ u32 oldflags; + unsigned long flags; -+ oldflags = hchan->channelFlags; -+ switch (sc->chan_bw) { -+ case 5: -+ hchan->channelFlags &= ~CHANNEL_HALF; -+ hchan->channelFlags |= CHANNEL_QUARTER; -+ break; -+ case 10: -+ hchan->channelFlags &= ~CHANNEL_QUARTER; -+ hchan->channelFlags |= CHANNEL_HALF; -+ break; -+ default: -+ hchan->channelFlags &= ~(CHANNEL_HALF | CHANNEL_QUARTER); -+ break; -+ } -+ -+ if (oldflags != hchan->channelFlags) -+ fastcc = false; + if (ah->curchan) +@@ -1709,7 +1710,23 @@ static int ath9k_config(struct ieee80211 + memset(&sc->survey[pos], 0, sizeof(struct survey_info)); + } + +- if (ath_set_channel(sc, hw, &sc->sc_ah->channels[pos]) < 0) { ++ hchan = &sc->sc_ah->channels[pos]; ++ oldflags = hchan->channelFlags; ++ switch (sc->chan_bw) { ++ case 5: ++ hchan->channelFlags &= ~CHANNEL_HALF; ++ hchan->channelFlags |= CHANNEL_QUARTER; ++ break; ++ case 10: ++ hchan->channelFlags &= ~CHANNEL_QUARTER; ++ hchan->channelFlags |= CHANNEL_HALF; ++ break; ++ default: ++ hchan->channelFlags &= ~(CHANNEL_HALF | CHANNEL_QUARTER); ++ break; ++ } + - if (!(sc->sc_flags & SC_OP_OFFCHANNEL)) - caldata = &sc->caldata; ++ if (ath_set_channel(sc, hw, hchan) < 0) { + ath_err(common, "Unable to set channel\n"); + mutex_unlock(&sc->mutex); + return -EINVAL; +--- a/drivers/net/wireless/ath/ath9k/hw.c ++++ b/drivers/net/wireless/ath/ath9k/hw.c +@@ -1504,6 +1504,10 @@ int ath9k_hw_reset(struct ath_hw *ah, st + } + ah->noise = ath9k_hw_getchan_noise(ah, chan); ++ if (!ah->curchan || ((ah->curchan->channelFlags ^ chan->channelFlags) & ++ (CHANNEL_HALF | CHANNEL_QUARTER))) ++ bChannelChange = false; ++ + if (bChannelChange && + (ah->chip_fullsleep != true) && + (ah->curchan != NULL) && |