diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2013-08-01 02:23:22 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-08-01 15:52:05 -0400 |
commit | 9ddf03017917970c53da577b263e1686ef5c9652 (patch) | |
tree | beee49808314dab88e22f7a79896a3585143b95a /drivers/net/wireless/ath/ath9k | |
parent | 5f800ffbbb29c51fbcd886080dc3b0a6ab20b9b9 (diff) |
ath9k: Simplify checks in quick_scan
There is a function to do a ratio comparison for ALT,
so make use of it.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/antenna.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c index 0b157ad91255..6495fc620b40 100644 --- a/drivers/net/wireless/ath/ath9k/antenna.c +++ b/drivers/net/wireless/ath/ath9k/antenna.c | |||
@@ -164,11 +164,11 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb, | |||
164 | else | 164 | else |
165 | antcomb->first_ratio = false; | 165 | antcomb->first_ratio = false; |
166 | } else { | 166 | } else { |
167 | if ((((alt_ratio >= ATH_ANT_DIV_COMB_ALT_ANT_RATIO2) && | 167 | if (ath_is_alt_ant_ratio_better(alt_ratio, |
168 | (alt_rssi_avg > main_rssi_avg + | 168 | ATH_ANT_DIV_COMB_LNA1_DELTA_HI, |
169 | ATH_ANT_DIV_COMB_LNA1_DELTA_HI)) || | 169 | 0, |
170 | (alt_rssi_avg > main_rssi_avg)) && | 170 | main_rssi_avg, alt_rssi_avg, |
171 | (antcomb->total_pkt_count > 50)) | 171 | antcomb->total_pkt_count)) |
172 | antcomb->first_ratio = true; | 172 | antcomb->first_ratio = true; |
173 | else | 173 | else |
174 | antcomb->first_ratio = false; | 174 | antcomb->first_ratio = false; |
@@ -219,11 +219,11 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb, | |||
219 | else | 219 | else |
220 | antcomb->second_ratio = false; | 220 | antcomb->second_ratio = false; |
221 | } else { | 221 | } else { |
222 | if ((((alt_ratio >= ATH_ANT_DIV_COMB_ALT_ANT_RATIO2) && | 222 | if (ath_is_alt_ant_ratio_better(alt_ratio, |
223 | (alt_rssi_avg > main_rssi_avg + | 223 | ATH_ANT_DIV_COMB_LNA1_DELTA_HI, |
224 | ATH_ANT_DIV_COMB_LNA1_DELTA_HI)) || | 224 | 0, |
225 | (alt_rssi_avg > main_rssi_avg)) && | 225 | main_rssi_avg, alt_rssi_avg, |
226 | (antcomb->total_pkt_count > 50)) | 226 | antcomb->total_pkt_count)) |
227 | antcomb->second_ratio = true; | 227 | antcomb->second_ratio = true; |
228 | else | 228 | else |
229 | antcomb->second_ratio = false; | 229 | antcomb->second_ratio = false; |