aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/543-ath9k-allow-to-disable-bands-via-platform-data.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-08-13 10:35:14 +0000
committerFelix Fietkau <nbd@openwrt.org>2013-08-13 10:35:14 +0000
commit253d2b511bd7b32a63aeec471717430902906d51 (patch)
tree359c6c6c61af769870a3519faff2d323fc2371ae /package/kernel/mac80211/patches/543-ath9k-allow-to-disable-bands-via-platform-data.patch
parentbbd4d4c8b867b00809f283dbc90ed95337d9a21e (diff)
downloadupstream-253d2b511bd7b32a63aeec471717430902906d51.tar.gz
upstream-253d2b511bd7b32a63aeec471717430902906d51.tar.bz2
upstream-253d2b511bd7b32a63aeec471717430902906d51.zip
ath9k: reorganize patches
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 37766
Diffstat (limited to 'package/kernel/mac80211/patches/543-ath9k-allow-to-disable-bands-via-platform-data.patch')
-rw-r--r--package/kernel/mac80211/patches/543-ath9k-allow-to-disable-bands-via-platform-data.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/543-ath9k-allow-to-disable-bands-via-platform-data.patch b/package/kernel/mac80211/patches/543-ath9k-allow-to-disable-bands-via-platform-data.patch
new file mode 100644
index 0000000000..c5b90af68c
--- /dev/null
+++ b/package/kernel/mac80211/patches/543-ath9k-allow-to-disable-bands-via-platform-data.patch
@@ -0,0 +1,70 @@
+--- a/include/linux/ath9k_platform.h
++++ b/include/linux/ath9k_platform.h
+@@ -33,6 +33,9 @@ struct ath9k_platform_data {
+
+ bool endian_check;
+ bool is_clk_25mhz;
++ bool disable_2ghz;
++ bool disable_5ghz;
++
+ int (*get_mac_revision)(void);
+ int (*external_reset)(void);
+
+--- a/drivers/net/wireless/ath/ath9k/hw.c
++++ b/drivers/net/wireless/ath/ath9k/hw.c
+@@ -2449,17 +2449,25 @@ int ath9k_hw_fill_cap_info(struct ath_hw
+ }
+
+ eeval = ah->eep_ops->get_eeprom(ah, EEP_OP_MODE);
+- if ((eeval & (AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A)) == 0) {
+- ath_err(common,
+- "no band has been marked as supported in EEPROM\n");
+- return -EINVAL;
++
++ if (eeval & AR5416_OPFLAGS_11A) {
++ if (ah->disable_5ghz)
++ ath_warn(common, "disabling 5GHz band\n");
++ else
++ pCap->hw_caps |= ATH9K_HW_CAP_5GHZ;
+ }
+
+- if (eeval & AR5416_OPFLAGS_11A)
+- pCap->hw_caps |= ATH9K_HW_CAP_5GHZ;
++ if (eeval & AR5416_OPFLAGS_11G) {
++ if (ah->disable_2ghz)
++ ath_warn(common, "disabling 2GHz band\n");
++ else
++ pCap->hw_caps |= ATH9K_HW_CAP_2GHZ;
++ }
+
+- if (eeval & AR5416_OPFLAGS_11G)
+- pCap->hw_caps |= ATH9K_HW_CAP_2GHZ;
++ if ((pCap->hw_caps & (ATH9K_HW_CAP_2GHZ | ATH9K_HW_CAP_5GHZ)) == 0) {
++ ath_err(common, "both bands are disabled\n");
++ return -EINVAL;
++ }
+
+ if (AR_SREV_9485(ah) ||
+ AR_SREV_9285(ah) ||
+--- a/drivers/net/wireless/ath/ath9k/hw.h
++++ b/drivers/net/wireless/ath/ath9k/hw.h
+@@ -948,6 +948,8 @@ struct ath_hw {
+ bool is_clk_25mhz;
+ int (*get_mac_revision)(void);
+ int (*external_reset)(void);
++ bool disable_2ghz;
++ bool disable_5ghz;
+
+ const struct firmware *eeprom_blob;
+ };
+--- a/drivers/net/wireless/ath/ath9k/init.c
++++ b/drivers/net/wireless/ath/ath9k/init.c
+@@ -613,6 +613,8 @@ static int ath9k_init_softc(u16 devid, s
+ ah->is_clk_25mhz = pdata->is_clk_25mhz;
+ ah->get_mac_revision = pdata->get_mac_revision;
+ ah->external_reset = pdata->external_reset;
++ ah->disable_2ghz = pdata->disable_2ghz;
++ ah->disable_5ghz = pdata->disable_5ghz;
+ if (!pdata->endian_check)
+ ah->ah_flags |= AH_NO_EEP_SWAP;
+ }