From: Vamsi Krishna Date: Thu, 20 May 2021 18:47:28 +0000 (+0530) Subject: Use estimated throughputs irrespective of RSSI delta for 6 GHz APs X-Git-Tag: hostap_2_10~267 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6abfb1418c6913e6367666fd8ad9b72027c73498;p=thirdparty%2Fhostap.git Use estimated throughputs irrespective of RSSI delta for 6 GHz APs 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 --- diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index c624c3c84..c194806cd 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -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;