2011-07-01 16:11:53 +00:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
2011-09-15 17:55:16 +00:00
|
|
|
@@ -585,6 +585,7 @@ struct ath_softc {
|
2011-07-01 16:11:53 +00:00
|
|
|
struct ieee80211_hw *hw;
|
|
|
|
struct device *dev;
|
|
|
|
|
|
|
|
+ u32 chan_bw;
|
|
|
|
int chan_idx;
|
|
|
|
int chan_is_ht;
|
|
|
|
struct survey_info *cur_survey;
|
|
|
|
--- a/drivers/net/wireless/ath/ath9k/debug.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/debug.c
|
2011-09-15 17:55:16 +00:00
|
|
|
@@ -1693,6 +1693,9 @@ int ath9k_init_debug(struct ath_hw *ah)
|
2011-07-01 16:11:53 +00:00
|
|
|
debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc,
|
|
|
|
&fops_eeprom);
|
|
|
|
|
|
|
|
+ debugfs_create_u32("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy,
|
|
|
|
+ &sc->chan_bw);
|
|
|
|
+
|
|
|
|
sc->debug.regidx = 0;
|
2011-09-15 17:55:16 +00:00
|
|
|
memset(&sc->debug.bb_mac_samp, 0, sizeof(sc->debug.bb_mac_samp));
|
|
|
|
sc->debug.sampidx = 0;
|
2011-07-01 16:11:53 +00:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/main.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/main.c
|
2011-09-15 17:55:16 +00:00
|
|
|
@@ -1636,9 +1636,10 @@ static int ath9k_config(struct ieee80211
|
2011-07-01 16:11:53 +00:00
|
|
|
|
2011-08-28 18:38:24 +00:00
|
|
|
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;
|
2011-07-01 16:11:53 +00:00
|
|
|
|
2011-08-28 18:38:24 +00:00
|
|
|
if (ah->curchan)
|
2011-09-15 17:55:16 +00:00
|
|
|
@@ -1691,7 +1692,23 @@ static int ath9k_config(struct ieee80211
|
2011-08-28 18:38:24 +00:00
|
|
|
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;
|
|
|
|
+ }
|
2011-07-01 16:11:53 +00:00
|
|
|
+
|
2011-08-28 18:38:24 +00:00
|
|
|
+ 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
|
2011-09-15 17:55:16 +00:00
|
|
|
@@ -1509,6 +1509,10 @@ int ath9k_hw_reset(struct ath_hw *ah, st
|
|
|
|
(AR_SREV_9300_20_OR_LATER(ah) && IS_CHAN_5GHZ(chan)))
|
|
|
|
bChannelChange = false;
|
2011-07-01 16:11:53 +00:00
|
|
|
|
2011-08-28 18:38:24 +00:00
|
|
|
+ if (!ah->curchan || ((ah->curchan->channelFlags ^ chan->channelFlags) &
|
|
|
|
+ (CHANNEL_HALF | CHANNEL_QUARTER)))
|
|
|
|
+ bChannelChange = false;
|
|
|
|
+
|
|
|
|
if (bChannelChange &&
|
|
|
|
(ah->chip_fullsleep != true) &&
|
|
|
|
(ah->curchan != NULL) &&
|