1
0

ath9k: allow disabling bands via platform data

Some devices have multiple bands enables in the EEPROM data, even though
they are only calibrated for one. Allow platform data to disable
unsupported bands.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Este cometimento está contido em:
Felix Fietkau
2014-10-25 17:19:34 +02:00
cometido por John W. Linville
ascendente a59dadbeea
cometimento 3468968ef7
4 ficheiros modificados com 22 adições e 8 eliminações

Ver ficheiro

@@ -2344,17 +2344,25 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
}
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) ||