]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use estimated throughputs irrespective of RSSI delta for 6 GHz APs
authorVamsi Krishna <vamsin@codeaurora.org>
Thu, 20 May 2021 18:47:28 +0000 (00:17 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 21 May 2021 15:41:59 +0000 (18:41 +0300)
APs in 6 GHz operating with LPI/VLP rules will have significantly lower
SNR values compared to 2.4/5 GHz band APs. Earlier, the estimated
throughputs were used for comparison only when the delta of SNRs between
both the APs was not greater than 7 and as a result for comparing 6 GHz
APs with 2.4/5 GHz APs, estimated throughputs were not getting used.

The estimated throughput calculations takes SNR value also into
consideration, hence remove RSSI delta check if any of the APs are from
the 6 GHz band. This change is limited to the 6 GHz band only in order
to avoid possible regressions with 2.4/5 GHz APs.

Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
wpa_supplicant/scan.c

index c624c3c84a8c020bb2374dcc85ccbc03e635b0cf..c194806cd7f20d239525b3af5bfe3dc18108d3a5 100644 (file)
@@ -2039,8 +2039,14 @@ static int wpa_scan_result_compar(const void *a, const void *b)
                snr_b = snr_b_full = wb->level;
        }
 
-       /* if SNR is close, decide by max rate or frequency band */
-       if (snr_a && snr_b && abs(snr_b - snr_a) < 7) {
+       /* If SNR is close, decide by max rate or frequency band. For cases
+        * involving the 6 GHz band, use the throughput estimate irrespective
+        * of the SNR difference since the LPI/VLP rules may result in
+        * significant differences in SNR for cases where the estimated
+        * throughput can be considerably higher with the lower SNR. */
+       if (snr_a && snr_b && (abs(snr_b - snr_a) < 7 ||
+                              is_6ghz_freq(wa->freq) ||
+                              is_6ghz_freq(wb->freq))) {
                if (wa->est_throughput != wb->est_throughput)
                        return (int) wb->est_throughput -
                                (int) wa->est_throughput;