wlan-ap-Telecominfraproject/feeds/wifi-ax/hostapd/patches/c00-012-AP-Allow-downgrading-to-20MHz-based-on-OBSS-results.patch
John Crispin 04f6078da6 ipq807x: update AX support
Signed-off-by: John Crispin <john@phrozen.org>
2020-10-04 14:28:57 +02:00

30 lines
925 B
Diff

--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -313,7 +313,7 @@ static void ieee80211n_check_scan(struct
{
struct wpa_scan_results *scan_res;
int oper40;
- int res;
+ int res = 0;
/* Check list of neighboring BSSes (from scan) to see whether 40 MHz is
* allowed per IEEE Std 802.11-2012, 10.15.3.2 */
@@ -349,8 +349,16 @@ static void ieee80211n_check_scan(struct
}
}
- res = ieee80211n_allowed_ht40_channel_pair(iface);
+ /*
+ * Secondary channel is set to 0 if OBSS failed.
+ * The function ieee80211n_allowed_ht40_channel_pair() sets primary
+ * and secondary channel to same value in this case.
+ */
+ if(iface->conf->secondary_channel)
+ res = ieee80211n_allowed_ht40_channel_pair(iface);
+
if (!res) {
+ /* Downgrade to 20MHz. */
iface->conf->secondary_channel = 0;
hostapd_set_oper_centr_freq_seg0_idx(iface->conf, 0);
hostapd_set_oper_centr_freq_seg1_idx(iface->conf, 0);