96ebdefae9e710a350fa44a359896071b142af67
[openwrt/staging/xback.git] /
1 From 37528a5205cb0b9e2238b7d97fb2ff5457448f1c Mon Sep 17 00:00:00 2001
2 From: David Bauer <mail@david-bauer.net>
3 Date: Thu, 8 Sep 2022 01:45:41 +0200
4 Subject: [PATCH] acs: don't select indoor channel on outdoor operation
5
6 Don't select channels designated for exclusive-indoor use when the
7 country3 element is set on outdoor operation.
8
9 Signed-off-by: David Bauer <mail@david-bauer.net>
10 ---
11 src/ap/acs.c | 9 +++++++++
12 src/ap/dfs.c | 3 +++
13 2 files changed, 12 insertions(+)
14
15 --- a/src/ap/acs.c
16 +++ b/src/ap/acs.c
17 @@ -552,6 +552,9 @@ static void acs_survey_mode_interference
18 if (chan->max_tx_power < iface->conf->min_tx_power)
19 continue;
20
21 + if (chan->flag & HOSTAPD_CHAN_INDOOR_ONLY && iface->conf->country[2] == 0x4f)
22 + continue;
23 +
24 wpa_printf(MSG_DEBUG, "ACS: Survey analysis for channel %d (%d MHz)",
25 chan->chan, chan->freq);
26
27 @@ -686,6 +689,9 @@ acs_find_ideal_chan_mode(struct hostapd_
28 if (chan->max_tx_power < iface->conf->min_tx_power)
29 continue;
30
31 + if (chan->flag & HOSTAPD_CHAN_INDOOR_ONLY && iface->conf->country[2] == 0x4f)
32 + continue;
33 +
34 if (!chan_bw_allowed(chan, bw, 1, 1)) {
35 wpa_printf(MSG_DEBUG,
36 "ACS: Channel %d: BW %u is not supported",
37 @@ -1065,6 +1071,9 @@ static int * acs_request_scan_add_freqs(
38 if (chan->max_tx_power < iface->conf->min_tx_power)
39 continue;
40
41 + if (chan->flag & HOSTAPD_CHAN_INDOOR_ONLY && iface->conf->country[2] == 0x4f)
42 + continue;
43 +
44 *freq++ = chan->freq;
45 }
46
47 --- a/src/ap/dfs.c
48 +++ b/src/ap/dfs.c
49 @@ -282,6 +282,9 @@ static int dfs_find_channel(struct hosta
50 if (chan->max_tx_power < iface->conf->min_tx_power)
51 continue;
52
53 + if (chan->flag & HOSTAPD_CHAN_INDOOR_ONLY && iface->conf->country[2] == 0x4f)
54 + continue;
55 +
56 if (ret_chan && idx == channel_idx) {
57 wpa_printf(MSG_DEBUG, "Selected channel %d (%d)",
58 chan->freq, chan->chan);