summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-07-01 16:11:53 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-07-01 16:11:53 +0000
commitbd5980d51badf06cf5eb050b7f246f1e67b7de57 (patch)
treeb899554805222ddd9621dd6ebc9a891d493a6faf
parent6dfcb18e8a1e3d6de5a280d46085b1f410bec53f (diff)
ath9k: add a small hack to make changing the channel bandwidth to 5/10 mhz available through debugfs - does not work on all chipsets and is not recommended for production use yet
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27340 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/mac80211/patches/540-ath9k_channelbw_debugfs.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/package/mac80211/patches/540-ath9k_channelbw_debugfs.patch b/package/mac80211/patches/540-ath9k_channelbw_debugfs.patch
new file mode 100644
index 0000000000..9c2c014a5e
--- /dev/null
+++ b/package/mac80211/patches/540-ath9k_channelbw_debugfs.patch
@@ -0,0 +1,54 @@
+--- a/drivers/net/wireless/ath/ath9k/ath9k.h
++++ b/drivers/net/wireless/ath/ath9k/ath9k.h
+@@ -586,6 +586,7 @@ struct ath_softc {
+ 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
+@@ -1281,6 +1281,9 @@ int ath9k_init_debug(struct ath_hw *ah)
+ 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;
+ return 0;
+ }
+--- 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;
+
+ if (sc->sc_flags & SC_OP_INVALID)
+@@ -268,6 +269,21 @@ static int ath_set_channel(struct ath_so
+ if (!stopped || !(sc->sc_flags & SC_OP_OFFCHANNEL))
+ fastcc = false;
+
++ 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;
++ }
++
++ if (oldflags != hchan->channelFlags)
++ fastcc = false;
++
+ if (!(sc->sc_flags & SC_OP_OFFCHANNEL))
+ caldata = &sc->caldata;
+