2012-10-27 16:55:36 +08:00
|
|
|
--- a/include/linux/ath9k_platform.h
|
|
|
|
+++ b/include/linux/ath9k_platform.h
|
2013-12-08 22:48:30 +08:00
|
|
|
@@ -34,6 +34,8 @@ struct ath9k_platform_data {
|
2012-10-27 16:55:36 +08:00
|
|
|
bool endian_check;
|
|
|
|
bool is_clk_25mhz;
|
2013-12-08 22:48:30 +08:00
|
|
|
bool tx_gain_buffalo;
|
2012-10-27 16:55:36 +08:00
|
|
|
+ bool disable_2ghz;
|
|
|
|
+ bool disable_5ghz;
|
2013-12-08 22:48:30 +08:00
|
|
|
|
2012-10-27 16:55:36 +08:00
|
|
|
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
|
2014-05-20 17:35:17 +08:00
|
|
|
@@ -2328,17 +2328,25 @@ int ath9k_hw_fill_cap_info(struct ath_hw
|
2012-10-27 16:55:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
+ }
|
|
|
|
|
2012-12-08 00:46:04 +08:00
|
|
|
if (AR_SREV_9485(ah) ||
|
|
|
|
AR_SREV_9285(ah) ||
|
2012-10-27 16:55:36 +08:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/hw.h
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/hw.h
|
2014-01-30 21:21:36 +08:00
|
|
|
@@ -932,6 +932,8 @@ struct ath_hw {
|
2012-10-27 16:55:36 +08:00
|
|
|
bool is_clk_25mhz;
|
|
|
|
int (*get_mac_revision)(void);
|
|
|
|
int (*external_reset)(void);
|
|
|
|
+ bool disable_2ghz;
|
|
|
|
+ bool disable_5ghz;
|
|
|
|
|
2012-12-10 23:46:15 +08:00
|
|
|
const struct firmware *eeprom_blob;
|
|
|
|
};
|
2012-10-27 16:55:36 +08:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/init.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
2014-04-06 18:41:23 +08:00
|
|
|
@@ -518,6 +518,8 @@ static int ath9k_init_softc(u16 devid, s
|
2012-10-27 16:55:36 +08:00
|
|
|
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;
|
|
|
|
}
|