aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/ar9003_phy.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-11-10 21:18:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-16 16:37:08 -0500
commit4e8c14e9587c38f4cce8049c766935629fdb8d46 (patch)
tree7dc06b37bc5648314c96ea9bbb39c9544e98ecd5 /drivers/net/wireless/ath/ath9k/ar9003_phy.c
parent82b873afe83c81d9b1273a816bbdacb266f71a52 (diff)
ath9k_hw: add a private op for configuring radar pulse detection
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ar9003_phy.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 44c5454b2ad..f676b21ac43 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -1113,6 +1113,37 @@ static void ar9003_hw_ani_cache_ini_regs(struct ath_hw *ah)
1113 aniState->mrcCCKOff = !ATH9K_ANI_ENABLE_MRC_CCK; 1113 aniState->mrcCCKOff = !ATH9K_ANI_ENABLE_MRC_CCK;
1114} 1114}
1115 1115
1116static void ar9003_hw_set_radar_params(struct ath_hw *ah,
1117 struct ath_hw_radar_conf *conf)
1118{
1119 u32 radar_0 = 0, radar_1 = 0;
1120
1121 if (!conf) {
1122 REG_CLR_BIT(ah, AR_PHY_RADAR_0, AR_PHY_RADAR_0_ENA);
1123 return;
1124 }
1125
1126 radar_0 |= AR_PHY_RADAR_0_ENA | AR_PHY_RADAR_0_FFT_ENA;
1127 radar_0 |= SM(conf->fir_power, AR_PHY_RADAR_0_FIRPWR);
1128 radar_0 |= SM(conf->radar_rssi, AR_PHY_RADAR_0_RRSSI);
1129 radar_0 |= SM(conf->pulse_height, AR_PHY_RADAR_0_HEIGHT);
1130 radar_0 |= SM(conf->pulse_rssi, AR_PHY_RADAR_0_PRSSI);
1131 radar_0 |= SM(conf->pulse_inband, AR_PHY_RADAR_0_INBAND);
1132
1133 radar_1 |= AR_PHY_RADAR_1_MAX_RRSSI;
1134 radar_1 |= AR_PHY_RADAR_1_BLOCK_CHECK;
1135 radar_1 |= SM(conf->pulse_maxlen, AR_PHY_RADAR_1_MAXLEN);
1136 radar_1 |= SM(conf->pulse_inband_step, AR_PHY_RADAR_1_RELSTEP_THRESH);
1137 radar_1 |= SM(conf->radar_inband, AR_PHY_RADAR_1_RELPWR_THRESH);
1138
1139 REG_WRITE(ah, AR_PHY_RADAR_0, radar_0);
1140 REG_WRITE(ah, AR_PHY_RADAR_1, radar_1);
1141 if (conf->ext_channel)
1142 REG_SET_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
1143 else
1144 REG_CLR_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA);
1145}
1146
1116void ar9003_hw_attach_phy_ops(struct ath_hw *ah) 1147void ar9003_hw_attach_phy_ops(struct ath_hw *ah)
1117{ 1148{
1118 struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah); 1149 struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
@@ -1141,6 +1172,7 @@ void ar9003_hw_attach_phy_ops(struct ath_hw *ah)
1141 priv_ops->ani_control = ar9003_hw_ani_control; 1172 priv_ops->ani_control = ar9003_hw_ani_control;
1142 priv_ops->do_getnf = ar9003_hw_do_getnf; 1173 priv_ops->do_getnf = ar9003_hw_do_getnf;
1143 priv_ops->ani_cache_ini_regs = ar9003_hw_ani_cache_ini_regs; 1174 priv_ops->ani_cache_ini_regs = ar9003_hw_ani_cache_ini_regs;
1175 priv_ops->set_radar_params = ar9003_hw_set_radar_params;
1144 1176
1145 ar9003_hw_set_nf_limits(ah); 1177 ar9003_hw_set_nf_limits(ah);
1146 memcpy(ah->nf_regs, ar9300_cca_regs, sizeof(ah->nf_regs)); 1178 memcpy(ah->nf_regs, ar9300_cca_regs, sizeof(ah->nf_regs));