aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.c
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-11-27 06:01:35 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-04 14:16:23 -0500
commita9a29ce674ac62e7bfcb6c1404ca86cda4782988 (patch)
tree45aad580765aba12a3283418227383a07cf53080 /drivers/net/wireless/ath/ath9k/hw.c
parent1f351e3840dcf25aaddec2d908c3ab06ae105ee6 (diff)
ath9k: enable 2GHz band only if the device supports it
Currently, the 2GHz band is enabled unconditionally, even if the device does not support it. Changes-licensed-under: ISC Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 493160c8c75..2ec61f08cfd 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -976,7 +976,10 @@ int ath9k_hw_init(struct ath_hw *ah)
976 return r; 976 return r;
977 977
978 ath9k_hw_init_mode_gain_regs(ah); 978 ath9k_hw_init_mode_gain_regs(ah);
979 ath9k_hw_fill_cap_info(ah); 979 r = ath9k_hw_fill_cap_info(ah);
980 if (r)
981 return r;
982
980 ath9k_hw_init_11a_eeprom_fix(ah); 983 ath9k_hw_init_11a_eeprom_fix(ah);
981 984
982 r = ath9k_hw_init_macaddr(ah); 985 r = ath9k_hw_init_macaddr(ah);
@@ -3112,7 +3115,7 @@ EXPORT_SYMBOL(ath9k_hw_set_sta_beacon_timers);
3112/* HW Capabilities */ 3115/* HW Capabilities */
3113/*******************/ 3116/*******************/
3114 3117
3115void ath9k_hw_fill_cap_info(struct ath_hw *ah) 3118int ath9k_hw_fill_cap_info(struct ath_hw *ah)
3116{ 3119{
3117 struct ath9k_hw_capabilities *pCap = &ah->caps; 3120 struct ath9k_hw_capabilities *pCap = &ah->caps;
3118 struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah); 3121 struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
@@ -3143,6 +3146,12 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah)
3143 } 3146 }
3144 3147
3145 eeval = ah->eep_ops->get_eeprom(ah, EEP_OP_MODE); 3148 eeval = ah->eep_ops->get_eeprom(ah, EEP_OP_MODE);
3149 if ((eeval & (AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A)) == 0) {
3150 ath_print(common, ATH_DBG_FATAL,
3151 "no band has been marked as supported in EEPROM.\n");
3152 return -EINVAL;
3153 }
3154
3146 bitmap_zero(pCap->wireless_modes, ATH9K_MODE_MAX); 3155 bitmap_zero(pCap->wireless_modes, ATH9K_MODE_MAX);
3147 3156
3148 if (eeval & AR5416_OPFLAGS_11A) { 3157 if (eeval & AR5416_OPFLAGS_11A) {
@@ -3306,6 +3315,8 @@ void ath9k_hw_fill_cap_info(struct ath_hw *ah)
3306 } else { 3315 } else {
3307 btcoex_hw->scheme = ATH_BTCOEX_CFG_NONE; 3316 btcoex_hw->scheme = ATH_BTCOEX_CFG_NONE;
3308 } 3317 }
3318
3319 return 0;
3309} 3320}
3310 3321
3311bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type, 3322bool ath9k_hw_getcapability(struct ath_hw *ah, enum ath9k_capability_type type,