diff options
author | Jouni Malinen <j@w1.fi> | 2017-02-16 09:09:04 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2017-02-16 10:05:10 (GMT) |
commit | b4d56efb1a237e4ed91de97b1615747082de7fd3 (patch) | |
tree | 18a4c5f49c11375b556e005f41f4d27ac5d174d3 | |
parent | 14204148781cf8e64827eae12dffacc869586073 (diff) | |
download | hostap-b4d56efb1a237e4ed91de97b1615747082de7fd3.zip hostap-b4d56efb1a237e4ed91de97b1615747082de7fd3.tar.gz hostap-b4d56efb1a237e4ed91de97b1615747082de7fd3.tar.bz2 |
Use throughput estimate-based BSS selection with larger SNR difference
Previously, the est_throughput comparison was done only when SNR
difference was less than 5 dB. Since the throughput estimation take into
account SNR, this can be done in more cases. For now, add a conservative
2 dB more to the difference so that any SNR difference below 7 dB
results in BSS selection based on throughput estimates.
In addition, the throughput estimates require SNR values to be
available, so separate this from the 5 GHz preference that can be done
based on either SNR or qual values.
Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r-- | wpa_supplicant/scan.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 7345c9b..3a100cd 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -1841,10 +1841,12 @@ static int wpa_scan_result_compar(const void *a, const void *b) } /* if SNR is close, decide by max rate or frequency band */ - if ((snr_a && snr_b && abs(snr_b - snr_a) < 5) || - (wa->qual && wb->qual && abs(wb->qual - wa->qual) < 10)) { + if (snr_a && snr_b && abs(snr_b - snr_a) < 7) { if (wa->est_throughput != wb->est_throughput) return wb->est_throughput - wa->est_throughput; + } + if ((snr_a && snr_b && abs(snr_b - snr_a) < 5) || + (wa->qual && wb->qual && abs(wb->qual - wa->qual) < 10)) { if (IS_5GHZ(wa->freq) ^ IS_5GHZ(wb->freq)) return IS_5GHZ(wa->freq) ? -1 : 1; } |