From 741f7a299aa1f913bb9563f551eb032cf246c0ca Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sat, 13 Apr 2024 07:56:36 +0200 Subject: [PATCH 1/2] Revert "hostapd: fix opclass during CSA with DFS channels" This reverts commit 5c37272cd645ba0feb7d154c18d9657b211f5231. --- .../x-0007-fix-dfs-csa-invalid-opclass.patch | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 feeds/wifi-ax/hostapd/patches/x-0007-fix-dfs-csa-invalid-opclass.patch diff --git a/feeds/wifi-ax/hostapd/patches/x-0007-fix-dfs-csa-invalid-opclass.patch b/feeds/wifi-ax/hostapd/patches/x-0007-fix-dfs-csa-invalid-opclass.patch deleted file mode 100644 index b4a99313d..000000000 --- a/feeds/wifi-ax/hostapd/patches/x-0007-fix-dfs-csa-invalid-opclass.patch +++ /dev/null @@ -1,25 +0,0 @@ -Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.c -+++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.c -@@ -3814,6 +3814,8 @@ hostapd_switch_channel_fallback(struct h - const struct hostapd_freq_params *freq_params) - { - int seg0_idx = 0, seg1_idx = 0, bw = CHANWIDTH_USE_HT; -+ u8 op_class; -+ u8 chan; - - wpa_printf(MSG_DEBUG, "Restarting all CSA-related BSSes"); - -@@ -3846,6 +3848,11 @@ hostapd_switch_channel_fallback(struct h - iface->freq = freq_params->freq; - iface->conf->channel = freq_params->channel; - iface->conf->secondary_channel = freq_params->sec_channel_offset; -+ ieee80211_freq_to_channel_ext(freq_params->freq, freq_params->sec_channel_offset, bw, &op_class, &chan); -+ if (chan != freq_params->channel) -+ wpa_printf(MSG_ERROR, "Channel mismatch: %d -> %d", freq_params->channel, chan); -+ -+ iface->conf->op_class = op_class; - hostapd_set_oper_centr_freq_seg0_idx(iface->conf, seg0_idx); - hostapd_set_oper_centr_freq_seg1_idx(iface->conf, seg1_idx); - hostapd_set_oper_chwidth(iface->conf, bw); From ffb843b48626a89f6048d43f7653d645e18762f0 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Sat, 13 Apr 2024 07:56:38 +0200 Subject: [PATCH 2/2] Revert "hostapd: ubus: add DFS channels support during CSA" This reverts commit 4b5eeb48cc8b62881854a68d185e09e5f9892aa5. --- .../x-0006-ubus-csa-add-dfs-support.patch | 54 ------------------- 1 file changed, 54 deletions(-) delete mode 100644 feeds/wifi-ax/hostapd/patches/x-0006-ubus-csa-add-dfs-support.patch diff --git a/feeds/wifi-ax/hostapd/patches/x-0006-ubus-csa-add-dfs-support.patch b/feeds/wifi-ax/hostapd/patches/x-0006-ubus-csa-add-dfs-support.patch deleted file mode 100644 index ae2b522a6..000000000 --- a/feeds/wifi-ax/hostapd/patches/x-0006-ubus-csa-add-dfs-support.patch +++ /dev/null @@ -1,54 +0,0 @@ -Index: hostapd-2021-02-20-59e9794c/src/ap/ubus.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ubus.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ubus.c -@@ -25,6 +25,7 @@ - #include "airtime_policy.h" - #include "hw_features.h" - #include "radius_client.h" -+#include "dfs.h" - - static struct ubus_context *ctx; - static struct blob_buf b; -@@ -857,6 +858,7 @@ hostapd_switch_chan(struct ubus_context - u8 seg0 = 0, seg1 = 0; - int ret = UBUS_STATUS_OK; - int i; -+ int dfs_range = 0; - - blobmsg_parse(csa_policy, __CSA_MAX, tb, blob_data(msg), blob_len(msg)); - -@@ -912,6 +914,17 @@ hostapd_switch_chan(struct ubus_context - break; - } - -+ if (css.freq_params.center_freq1) -+ dfs_range += hostapd_is_dfs_overlap( -+ hapd->iface, chwidth, css.freq_params.center_freq1); -+ else -+ dfs_range += hostapd_is_dfs_overlap( -+ hapd->iface, chwidth, css.freq_params.freq); -+ -+ if (css.freq_params.center_freq2) -+ dfs_range += hostapd_is_dfs_overlap( -+ hapd->iface, chwidth, css.freq_params.center_freq2); -+ - hostapd_set_freq_params(&css.freq_params, iconf->hw_mode, - css.freq_params.freq, - css.freq_params.channel, iconf->enable_edmg, -@@ -925,6 +938,15 @@ hostapd_switch_chan(struct ubus_context - mode ? &mode->he_capab[IEEE80211_MODE_AP] : - NULL); - -+ if (dfs_range) { -+ /* Perform CAC and switch channel */ -+ freq_params = malloc(sizeof(*freq_params)); -+ memcpy(freq_params, &css.freq_params, sizeof(*freq_params)); -+ eloop_register_timeout(0, 1, switch_chan_fallback_cb, -+ hapd->iface, freq_params); -+ return 0; -+ } -+ - for (i = 0; i < hapd->iface->num_bss; i++) { - struct hostapd_data *bss = hapd->iface->bss[i]; -