Separate both calibrations and call noise floor calibrations only when 
necessary.

Signed-off-by: Tulio Magno Quites Machado Filho <tul...@gmail.com>
---
 drivers/net/wireless/ath5k/base.c |    4 ++++
 drivers/net/wireless/ath5k/phy.c  |    8 --------
 drivers/net/wireless/ath5k/reg.h  |    1 +
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath5k/base.c 
b/drivers/net/wireless/ath5k/base.c
index 697450d..251d022 100644
--- a/drivers/net/wireless/ath5k/base.c
+++ b/drivers/net/wireless/ath5k/base.c
@@ -2518,6 +2518,10 @@ ath5k_calibrate(unsigned long data)
                        ieee80211_frequency_to_channel(
                                sc->curchan->center_freq));
 
+       if(ah->ah_regdomain & AR5K_PHY_NFC) {
+               ath5k_hw_noise_floor_calibration(ah, sc->curchan->center_freq);
+       }
+
        mod_timer(&sc->calib_tim, round_jiffies(jiffies +
                        msecs_to_jiffies(ath5k_calinterval * 1000)));
 }
diff --git a/drivers/net/wireless/ath5k/phy.c b/drivers/net/wireless/ath5k/phy.c
index 81f5beb..b5c4726 100644
--- a/drivers/net/wireless/ath5k/phy.c
+++ b/drivers/net/wireless/ath5k/phy.c
@@ -1256,8 +1256,6 @@ static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah,
                return ret;
        }
 
-       ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
-
        /*
         * Re-enable RX/TX and beacons
         */
@@ -1325,12 +1323,6 @@ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah,
 
 done:
 
-       /* TODO: Separate noise floor calibration from I/Q calibration
-        * since noise floor calibration interrupts rx path while I/Q
-        * calibration doesn't. We don't need to run noise floor calibration
-        * as often as I/Q calibration.*/
-       ath5k_hw_noise_floor_calibration(ah, channel->center_freq);
-
        /* Initiate a gain_F calibration */
        ath5k_hw_request_rfgain_probe(ah);
 
diff --git a/drivers/net/wireless/ath5k/reg.h b/drivers/net/wireless/ath5k/reg.h
index d023eb5..e8a10b8 100644
--- a/drivers/net/wireless/ath5k/reg.h
+++ b/drivers/net/wireless/ath5k/reg.h
@@ -2032,6 +2032,7 @@
 #define        AR5K_PHY_NF_THRESH62_S          12
 #define        AR5K_PHY_NF_MINCCA_PWR          0x0ff80000      /* ??? */
 #define        AR5K_PHY_NF_MINCCA_PWR_S        19
+#define AR5K_PHY_NFC                   4 /* Bit to identify when it is 
necessary floor calibration */
 
 /*
  * PHY ADC saturation register [5110]
-- 
1.6.0.2

_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to