Commit 9ddf0301 authored by Sujith Manoharan's avatar Sujith Manoharan Committed by John W. Linville

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: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5f800ffb
...@@ -164,11 +164,11 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb, ...@@ -164,11 +164,11 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb,
else else
antcomb->first_ratio = false; antcomb->first_ratio = false;
} else { } else {
if ((((alt_ratio >= ATH_ANT_DIV_COMB_ALT_ANT_RATIO2) && if (ath_is_alt_ant_ratio_better(alt_ratio,
(alt_rssi_avg > main_rssi_avg + ATH_ANT_DIV_COMB_LNA1_DELTA_HI,
ATH_ANT_DIV_COMB_LNA1_DELTA_HI)) || 0,
(alt_rssi_avg > main_rssi_avg)) && main_rssi_avg, alt_rssi_avg,
(antcomb->total_pkt_count > 50)) antcomb->total_pkt_count))
antcomb->first_ratio = true; antcomb->first_ratio = true;
else else
antcomb->first_ratio = false; antcomb->first_ratio = false;
...@@ -219,11 +219,11 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb, ...@@ -219,11 +219,11 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb,
else else
antcomb->second_ratio = false; antcomb->second_ratio = false;
} else { } else {
if ((((alt_ratio >= ATH_ANT_DIV_COMB_ALT_ANT_RATIO2) && if (ath_is_alt_ant_ratio_better(alt_ratio,
(alt_rssi_avg > main_rssi_avg + ATH_ANT_DIV_COMB_LNA1_DELTA_HI,
ATH_ANT_DIV_COMB_LNA1_DELTA_HI)) || 0,
(alt_rssi_avg > main_rssi_avg)) && main_rssi_avg, alt_rssi_avg,
(antcomb->total_pkt_count > 50)) antcomb->total_pkt_count))
antcomb->second_ratio = true; antcomb->second_ratio = true;
else else
antcomb->second_ratio = false; antcomb->second_ratio = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment