]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/blobdiff - drivers/net/wireless/ath/ath9k/hw.c
Merge branch 'linux-3.8.y' into ti-linux-3.8.y
[android-sdk/kernel-video.git] / drivers / net / wireless / ath / ath9k / hw.c
index e26f92dd063ecebe58de6f76ac4334c71b27b75a..7b485e4d104cdfb2f6dd584d2f97e0a2e229cf6e 100644 (file)
@@ -54,11 +54,6 @@ static void ath9k_hw_init_cal_settings(struct ath_hw *ah)
        ath9k_hw_private_ops(ah)->init_cal_settings(ah);
 }
 
-static void ath9k_hw_init_mode_regs(struct ath_hw *ah)
-{
-       ath9k_hw_private_ops(ah)->init_mode_regs(ah);
-}
-
 static u32 ath9k_hw_compute_pll_control(struct ath_hw *ah,
                                        struct ath9k_channel *chan)
 {
@@ -208,7 +203,7 @@ void ath9k_hw_synth_delay(struct ath_hw *ah, struct ath9k_channel *chan,
        udelay(hw_delay + BASE_ACTIVATE_DELAY);
 }
 
-void ath9k_hw_write_array(struct ath_hw *ah, struct ar5416IniArray *array,
+void ath9k_hw_write_array(struct ath_hw *ah, const struct ar5416IniArray *array,
                          int column, unsigned int *writecnt)
 {
        int r;
@@ -554,28 +549,19 @@ static int ath9k_hw_post_init(struct ath_hw *ah)
                ah->eep_ops->get_eeprom_ver(ah),
                ah->eep_ops->get_eeprom_rev(ah));
 
-       ecode = ath9k_hw_rf_alloc_ext_banks(ah);
-       if (ecode) {
-               ath_err(ath9k_hw_common(ah),
-                       "Failed allocating banks for external radio\n");
-               ath9k_hw_rf_free_ext_banks(ah);
-               return ecode;
-       }
-
-       if (ah->config.enable_ani) {
-               ath9k_hw_ani_setup(ah);
+       if (ah->config.enable_ani)
                ath9k_hw_ani_init(ah);
-       }
 
        return 0;
 }
 
-static void ath9k_hw_attach_ops(struct ath_hw *ah)
+static int ath9k_hw_attach_ops(struct ath_hw *ah)
 {
-       if (AR_SREV_9300_20_OR_LATER(ah))
-               ar9003_hw_attach_ops(ah);
-       else
-               ar9002_hw_attach_ops(ah);
+       if (!AR_SREV_9300_20_OR_LATER(ah))
+               return ar9002_hw_attach_ops(ah);
+
+       ar9003_hw_attach_ops(ah);
+       return 0;
 }
 
 /* Called for all hardware families */
@@ -611,7 +597,9 @@ static int __ath9k_hw_init(struct ath_hw *ah)
        ath9k_hw_init_defaults(ah);
        ath9k_hw_init_config(ah);
 
-       ath9k_hw_attach_ops(ah);
+       r = ath9k_hw_attach_ops(ah);
+       if (r)
+               return r;
 
        if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) {
                ath_err(common, "Couldn't wakeup chip\n");
@@ -675,8 +663,6 @@ static int __ath9k_hw_init(struct ath_hw *ah)
        if (!AR_SREV_9300_20_OR_LATER(ah))
                ah->ani_function &= ~ATH9K_ANI_MRC_CCK;
 
-       ath9k_hw_init_mode_regs(ah);
-
        if (!ah->is_pciexpress)
                ath9k_hw_disablepcie(ah);
 
@@ -1153,12 +1139,9 @@ void ath9k_hw_deinit(struct ath_hw *ah)
        struct ath_common *common = ath9k_hw_common(ah);
 
        if (common->state < ATH_HW_INITIALIZED)
-               goto free_hw;
+               return;
 
        ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP);
-
-free_hw:
-       ath9k_hw_rf_free_ext_banks(ah);
 }
 EXPORT_SYMBOL(ath9k_hw_deinit);
 
@@ -2578,12 +2561,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
                rx_chainmask >>= 1;
        }
 
-       if (AR_SREV_9300_20_OR_LATER(ah)) {
-               ah->enabled_cals |= TX_IQ_CAL;
-               if (AR_SREV_9485_OR_LATER(ah))
-                       ah->enabled_cals |= TX_IQ_ON_AGC_CAL;
-       }
-
        if (AR_SREV_9462(ah) || AR_SREV_9565(ah)) {
                if (!(ah->ent_mode & AR_ENT_OTP_49GHZ_DISABLE))
                        pCap->hw_caps |= ATH9K_HW_CAP_MCI;
@@ -2592,7 +2569,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
                        pCap->hw_caps |= ATH9K_HW_CAP_RTT;
        }
 
-
        if (AR_SREV_9280_20_OR_LATER(ah)) {
                pCap->hw_caps |= ATH9K_HW_WOW_DEVICE_CAPABLE |
                                 ATH9K_HW_WOW_PATTERN_MATCH_EXACT;