56 lines
1.7 KiB
Diff
56 lines
1.7 KiB
Diff
From 89e0430eb616f09848a1811f1e40781c869c71fc Mon Sep 17 00:00:00 2001
|
|
From: Patrick Walther <patrick.walther@netmodule.com>
|
|
Date: Fri, 24 Jul 2020 14:41:09 +0200
|
|
|
|
---
|
|
src/ap/acs.c | 13 +++----------
|
|
1 file changed, 3 insertions(+), 10 deletions(-)
|
|
|
|
diff --git a/src/ap/acs.c b/src/ap/acs.c
|
|
index aa2ceb0d1..4993865b0 100644
|
|
--- a/src/ap/acs.c
|
|
+++ b/src/ap/acs.c
|
|
@@ -302,18 +302,12 @@ static void acs_fail(struct hostapd_iface *iface)
|
|
static long double
|
|
acs_survey_interference_factor(struct freq_survey *survey, s8 min_nf)
|
|
{
|
|
- long double factor, busy, total;
|
|
+ long double factor, busy = 0, total;
|
|
|
|
if (survey->filled & SURVEY_HAS_CHAN_TIME_BUSY)
|
|
busy = survey->channel_time_busy;
|
|
else if (survey->filled & SURVEY_HAS_CHAN_TIME_RX)
|
|
busy = survey->channel_time_rx;
|
|
- else {
|
|
- /* This shouldn't really happen as survey data is checked in
|
|
- * acs_sanity_check() */
|
|
- wpa_printf(MSG_ERROR, "ACS: Survey data missing");
|
|
- return 0;
|
|
- }
|
|
|
|
total = survey->channel_time;
|
|
|
|
@@ -415,20 +409,19 @@ static int acs_usable_vht160_chan(const struct hostapd_channel_data *chan)
|
|
static int acs_survey_is_sufficient(struct freq_survey *survey)
|
|
{
|
|
if (!(survey->filled & SURVEY_HAS_NF)) {
|
|
+ survey->nf = -95;
|
|
wpa_printf(MSG_INFO, "ACS: Survey is missing noise floor");
|
|
- return 0;
|
|
}
|
|
|
|
if (!(survey->filled & SURVEY_HAS_CHAN_TIME)) {
|
|
+ survey->channel_time = 0;
|
|
wpa_printf(MSG_INFO, "ACS: Survey is missing channel time");
|
|
- return 0;
|
|
}
|
|
|
|
if (!(survey->filled & SURVEY_HAS_CHAN_TIME_BUSY) &&
|
|
!(survey->filled & SURVEY_HAS_CHAN_TIME_RX)) {
|
|
wpa_printf(MSG_INFO,
|
|
"ACS: Survey is missing RX and busy time (at least one is required)");
|
|
- return 0;
|
|
}
|
|
|
|
return 1;
|