diff options
author | Felix Fietkau <nbd@nbd.name> | 2021-05-18 15:58:03 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-05-26 11:48:14 +0200 |
commit | 8e2ca15726bcfcf43051c3a2f7e2f96a51f0f001 (patch) | |
tree | 8be06e79014c5367ddeecaedaa61fd576d3fb5f8 | |
parent | 33c69aee4185a38f1ca542d236186450b81962d0 (diff) | |
download | upstream-8e2ca15726bcfcf43051c3a2f7e2f96a51f0f001.tar.gz upstream-8e2ca15726bcfcf43051c3a2f7e2f96a51f0f001.tar.bz2 upstream-8e2ca15726bcfcf43051c3a2f7e2f96a51f0f001.zip |
hostapd: improve channel switch support
Instead of requiring the user to call it on each BSS individually,
run it on all BSSs internally.
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | package/network/services/hostapd/src/src/ap/ubus.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index a34695f36a..bfa44e2915 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -728,6 +728,8 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *tb[__CSA_MAX]; struct hostapd_data *hapd = get_hapd_from_object(obj); struct csa_settings css; + int ret = UBUS_STATUS_OK; + int i; blobmsg_parse(csa_policy, __CSA_MAX, tb, blob_data(msg), blob_len(msg)); @@ -752,10 +754,14 @@ hostapd_switch_chan(struct ubus_context *ctx, struct ubus_object *obj, SET_CSA_SETTING(CSA_VHT, freq_params.vht_enabled, bool); SET_CSA_SETTING(CSA_BLOCK_TX, block_tx, bool); + for (i = 0; i < hapd->iface->num_bss; i++) { + struct hostapd_data *bss = hapd->iface->bss[i]; - if (hostapd_switch_channel(hapd, &css) != 0) - return UBUS_STATUS_NOT_SUPPORTED; - return UBUS_STATUS_OK; + if (hostapd_switch_channel(bss, &css) != 0) + ret = UBUS_STATUS_NOT_SUPPORTED; + } + + return ret; #undef SET_CSA_SETTING } #endif |