From 0f56141c6c779a1a74c3cab14ff872d5288a01f6 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 29 Sep 2025 13:40:08 +0200 Subject: [PATCH] hostapd: add new ubus method for performig channel switch This is a replacement for the bss based function, which cannot be used for MLO. Signed-off-by: Felix Fietkau --- .../network/services/hostapd/files/hostapd.uc | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 30be818c69..1ec2bb6945 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -1210,6 +1210,34 @@ let main_obj = { return ret; } }, + switch_channel: { + args: { + phy: "", + radio: 0, + csa_count: 0, + sec_channel: 0, + oper_chwidth: 0, + frequency: 0, + center_freq1: 0, + center_freq2: 0, + }, + call: function(req) { + let phy = phy_name(req.args.phy, req.args.radio); + if (!req.args.frequency || !phy) + return libubus.STATUS_INVALID_ARGUMENT; + + let iface = hostapd.interfaces[phy]; + if (!iface) + return libubus.STATUS_NOT_FOUND; + + req.args.csa_count ??= 10; + let ret = iface.switch_channel(req.args); + if (!ret) + return libubus.STATUS_UNKNOWN_ERROR; + + return 0; + }, + }, mld_set: { args: { config: {} -- 2.30.2