ath9k_hw: set default values for radar pulse detection
authorFelix Fietkau <nbd@openwrt.org>
Sat, 13 Nov 2010 19:22:41 +0000 (20:22 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 17 Nov 2010 21:19:01 +0000 (16:19 -0500)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ar5008_phy.c
drivers/net/wireless/ath/ath9k/ar9003_phy.c
drivers/net/wireless/ath/ath9k/hw.h

index 3686811cc8df02f8bc222124c490c143ebf07cbe..7303d98e41009d2f0c7610cf39fc7d1350d12c79 100644 (file)
@@ -1610,6 +1610,20 @@ static void ar5008_hw_set_radar_params(struct ath_hw *ah,
                REG_CLR_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
 }
 
+static void ar5008_hw_set_radar_conf(struct ath_hw *ah)
+{
+       struct ath_hw_radar_conf *conf = &ah->radar_conf;
+
+       conf->fir_power = -33;
+       conf->radar_rssi = 20;
+       conf->pulse_height = 10;
+       conf->pulse_rssi = 24;
+       conf->pulse_inband = 15;
+       conf->pulse_maxlen = 255;
+       conf->pulse_inband_step = 12;
+       conf->radar_inband = 8;
+}
+
 void ar5008_hw_attach_phy_ops(struct ath_hw *ah)
 {
        struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
@@ -1656,5 +1670,6 @@ void ar5008_hw_attach_phy_ops(struct ath_hw *ah)
                priv_ops->compute_pll_control = ar5008_hw_compute_pll_control;
 
        ar5008_hw_set_nf_limits(ah);
+       ar5008_hw_set_radar_conf(ah);
        memcpy(ah->nf_regs, ar5416_cca_regs, sizeof(ah->nf_regs));
 }
index f676b21ac4378bc864f8c32bf41e8225b43855a5..e8d6455b59483e1f05a57620e443503dca7554a3 100644 (file)
@@ -1144,6 +1144,20 @@ static void ar9003_hw_set_radar_params(struct ath_hw *ah,
                REG_CLR_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
 }
 
+static void ar9003_hw_set_radar_conf(struct ath_hw *ah)
+{
+       struct ath_hw_radar_conf *conf = &ah->radar_conf;
+
+       conf->fir_power = -28;
+       conf->radar_rssi = 0;
+       conf->pulse_height = 10;
+       conf->pulse_rssi = 24;
+       conf->pulse_inband = 8;
+       conf->pulse_maxlen = 255;
+       conf->pulse_inband_step = 12;
+       conf->radar_inband = 8;
+}
+
 void ar9003_hw_attach_phy_ops(struct ath_hw *ah)
 {
        struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
@@ -1175,6 +1189,7 @@ void ar9003_hw_attach_phy_ops(struct ath_hw *ah)
        priv_ops->set_radar_params = ar9003_hw_set_radar_params;
 
        ar9003_hw_set_nf_limits(ah);
+       ar9003_hw_set_radar_conf(ah);
        memcpy(ah->nf_regs, ar9300_cca_regs, sizeof(ah->nf_regs));
 }
 
index c20a5421f87088863a69fabe588bf0578dc09ca6..d5e68347ef728c624ddc2f159edf1d84578911d4 100644 (file)
@@ -782,6 +782,8 @@ struct ath_hw {
        u8 txchainmask;
        u8 rxchainmask;
 
+       struct ath_hw_radar_conf radar_conf;
+
        u32 originalGain[22];
        int initPDADC;
        int PDADCdelta;