diff --git a/feeds/wifi-ax/hostapd/files/hostapd.sh b/feeds/wifi-ax/hostapd/files/hostapd.sh index d22e12454..90d921041 100644 --- a/feeds/wifi-ax/hostapd/files/hostapd.sh +++ b/feeds/wifi-ax/hostapd/files/hostapd.sh @@ -1203,9 +1203,6 @@ hostapd_set_bss_options() { append bss_conf "$val" "$N" done - bss_md5sum=$(echo $bss_conf | md5sum | cut -d" " -f1) - append bss_conf "config_id=$bss_md5sum" "$N" - append "$var" "$bss_conf" "$N" return 0 } diff --git a/feeds/wifi-ax/hostapd/files/hostapd.uc b/feeds/wifi-ax/hostapd/files/hostapd.uc index b52732adc..f9f0c31ba 100644 --- a/feeds/wifi-ax/hostapd/files/hostapd.uc +++ b/feeds/wifi-ax/hostapd/files/hostapd.uc @@ -66,10 +66,12 @@ function iface_restart(phy, config, old_config) if (err) hostapd.printf(`Failed to create ${bss.ifname} on phy ${phy}: ${err}`); let config_inline = iface_gen_config(phy, config); - if (hostapd.add_iface(`bss_config=${bss.ifname}:${config_inline}`) < 0) { + + let ubus = hostapd.data.ubus; + ubus.call("wpa_supplicant", "phy_set_state", { phy: phy, stop: true }); + if (hostapd.add_iface(`bss_config=${bss.ifname}:${config_inline}`) < 0) hostapd.printf(`hostapd.add_iface failed for phy ${phy} ifname=${bss.ifname}`); - return; - } + ubus.call("wpa_supplicant", "phy_set_state", { phy: phy, stop: false }); } function array_to_obj(arr, key, start) @@ -123,30 +125,37 @@ function iface_reload_config(phy, config, old_config) if (config.bss[0].ifname != old_config.bss[0].ifname) return false; - let iface = hostapd.interfaces[config.bss[0].ifname]; + let iface_name = config.bss[0].ifname; + let iface = hostapd.interfaces[iface_name]; if (!iface) return false; + let first_bss = hostapd.bss[iface_name]; + if (!first_bss) + return false; + let config_inline = iface_gen_config(phy, config); - bss_reload_psk(iface.bss[0], config.bss[0], old_config.bss[0]); + bss_reload_psk(first_bss, config.bss[0], old_config.bss[0]); if (!is_equal(config.bss[0], old_config.bss[0])) { if (phy_is_fullmac(phy)) return false; + if (config.bss[0].bssid != old_config.bss[0].bssid) + return false; + hostapd.printf(`Reload config for bss '${config.bss[0].ifname}' on phy '${phy}'`); - if (iface.bss[0].set_config(config_inline, 0) < 0) { + if (first_bss.set_config(config_inline, 0) < 0) { hostapd.printf(`Failed to set config`); return false; } } - let bss_list = array_to_obj(iface.bss, "name", 1); let new_cfg = array_to_obj(config.bss, "ifname", 1); let old_cfg = array_to_obj(old_config.bss, "ifname", 1); for (let name in old_cfg) { - let bss = bss_list[name]; + let bss = hostapd.bss[name]; if (!bss) { hostapd.printf(`bss '${name}' not found`); return false; @@ -267,6 +276,9 @@ function iface_load_config(filename) if (!val[0]) continue; + if (val[0] == "bssid") + bss.bssid = val[1]; + if (val[0] == "bss") { bss = config_add_bss(config, val[1]); continue; @@ -305,6 +317,78 @@ let main_obj = { return 0; } }, + apsta_state: { + args: { + phy: "", + up: true, + frequency: 0, + sec_chan_offset: 0, + csa: true, + csa_count: 0, + }, + call: function(req) { + if (req.args.up == null || !req.args.phy) + return libubus.STATUS_INVALID_ARGUMENT; + + let phy = req.args.phy; + let config = hostapd.data.config[phy]; + if (!config || !config.bss || !config.bss[0] || !config.bss[0].ifname) + return 0; + + let iface = hostapd.interfaces[config.bss[0].ifname]; + if (!iface) + return 0; + + if (!req.args.up) { + iface.stop(); + return 0; + } + + let freq = req.args.frequency; + if (!freq) + return libubus.STATUS_INVALID_ARGUMENT; + + let sec_offset = req.args.sec_chan_offset; + if (sec_offset != -1 && sec_offset != 1) + sec_offset = 0; + + let width = 0; + for (let line in config.radio.data) { + if (!sec_offset && match(line, /^ht_capab=.*HT40/)) { + sec_offset = null; // auto-detect + continue; + } + + let val = match(line, /^(vht_oper_chwidth|he_oper_chwidth)=(\d+)/); + if (!val) + continue; + + val = int(val[2]); + if (val > width) + width = val; + } + + if (freq < 4000) + width = 0; + + let freq_info = hostapd.freq_info(freq, sec_offset, width); + if (!freq_info) + return libubus.STATUS_UNKNOWN_ERROR; + + let ret; + if (req.args.csa) { + freq_info.csa_count = req.args.csa_count ?? 10; + ret = iface.switch_channel(freq_info); + } else { + iface.stop(); + ret = iface.start(freq_info); + } + if (!ret) + return libubus.STATUS_UNKNOWN_ERROR; + + return 0; + } + }, config_set: { args: { phy: "", diff --git a/feeds/wifi-ax/hostapd/files/wpa_supplicant.uc b/feeds/wifi-ax/hostapd/files/wpa_supplicant.uc index 22cb130e7..e3a3afcff 100644 --- a/feeds/wifi-ax/hostapd/files/wpa_supplicant.uc +++ b/feeds/wifi-ax/hostapd/files/wpa_supplicant.uc @@ -5,11 +5,16 @@ import { wdev_create, wdev_remove, is_equal, vlist_new } from "common"; let ubus = libubus.connect(); wpas.data.config = {}; +wpas.data.iface_phy = {}; function iface_stop(iface) { let ifname = iface.config.iface; + if (!iface.running) + return; + + delete wpas.data.iface_phy[ifname]; wpas.remove_iface(ifname); wdev_remove(ifname); iface.running = false; @@ -22,6 +27,7 @@ function iface_start(phy, iface) let ifname = iface.config.iface; + wpas.data.iface_phy[ifname] = phy; wdev_remove(ifname); let ret = wdev_create(phy, ifname, iface.config); if (ret) @@ -37,7 +43,7 @@ function iface_cb(new_if, old_if) return; } - if (old_if && old_if.running) + if (old_if) iface_stop(old_if); } @@ -73,6 +79,33 @@ function start_pending(phy_name) } let main_obj = { + phy_set_state: { + args: { + phy: "", + stop: true, + }, + call: function(req) { + if (!req.args.phy || req.args.stop == null) + return libubus.STATUS_INVALID_ARGUMENT; + + let phy = wpas.data.config[req.args.phy]; + if (!phy) + return libubus.STATUS_NOT_FOUND; + + try { + if (req.args.stop) { + for (let ifname in phy.data) + iface_stop(phy.data[ifname]); + } else { + start_pending(req.args.phy); + } + } catch (e) { + wpas.printf(`Error chaging state: ${e}\n${e.stacktrace[0].context}`); + return libubus.STATUS_INVALID_ARGUMENT; + } + return 0; + } + }, config_set: { args: { phy: "", @@ -146,6 +179,46 @@ function iface_event(type, name, data) { ubus.call("service", "event", { type: `wpa_supplicant.${name}.${type}`, data: {} }); } +function iface_hostapd_notify(phy, ifname, iface, state) +{ + let ubus = wpas.data.ubus; + let status = iface.status(); + let msg = { phy: phy }; + + switch (state) { + case "DISCONNECTED": + case "AUTHENTICATING": + msg.up = false; + break; + case "INTERFACE_DISABLED": + case "INACTIVE": + msg.up = true; + break; + case "COMPLETED": + msg.up = true; + msg.frequency = status.frequency; + msg.sec_chan_offset = status.sec_chan_offset; + break; + default: + return; + } + + ubus.call("hostapd", "apsta_state", msg); +} + +function iface_channel_switch(phy, ifname, iface, info) +{ + let msg = { + phy: phy, + up: true, + csa: true, + csa_count: info.csa_count ? info.csa_count - 1 : 0, + frequency: info.frequency, + sec_chan_offset: info.sec_chan_offset, + }; + ubus.call("hostapd", "apsta_state", msg); +} + return { shutdown: function() { for (let phy in wpas.data.config) @@ -157,5 +230,24 @@ return { }, iface_remove: function(name, obj) { iface_event("remove", name); + }, + state: function(ifname, iface, state) { + let phy = wpas.data.iface_phy[ifname]; + if (!phy) { + wpas.printf(`no PHY for ifname ${ifname}`); + return; + } + + iface_hostapd_notify(phy, ifname, iface, state); + }, + event: function(ifname, iface, ev, info) { + let phy = wpas.data.iface_phy[ifname]; + if (!phy) { + wpas.printf(`no PHY for ifname ${ifname}`); + return; + } + + if (ev == "CH_SWITCH_STARTED") + iface_channel_switch(phy, ifname, iface, info); } }; diff --git a/feeds/wifi-ax/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch b/feeds/wifi-ax/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch index 03a1e339a..ba5d23d10 100644 --- a/feeds/wifi-ax/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch +++ b/feeds/wifi-ax/hostapd/patches/011-mesh-use-deterministic-channel-on-channel-switch.patch @@ -68,7 +68,7 @@ Signed-off-by: Markus Theil if (!chan) { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9872,6 +9872,10 @@ static int nl80211_switch_channel(void * +@@ -9797,6 +9797,10 @@ static int nl80211_switch_channel(void * if (ret) goto error; diff --git a/feeds/wifi-ax/hostapd/patches/020-mesh-make-forwarding-configurable.patch b/feeds/wifi-ax/hostapd/patches/020-mesh-make-forwarding-configurable.patch index 75726a675..0473b66ec 100644 --- a/feeds/wifi-ax/hostapd/patches/020-mesh-make-forwarding-configurable.patch +++ b/feeds/wifi-ax/hostapd/patches/020-mesh-make-forwarding-configurable.patch @@ -31,7 +31,7 @@ Signed-off-by: Daniel Golle }; #define MAX_STA_COUNT 2007 -@@ -696,6 +697,7 @@ struct hostapd_bss_config { +@@ -694,6 +695,7 @@ struct hostapd_bss_config { #define MESH_ENABLED BIT(0) int mesh; @@ -59,7 +59,7 @@ Signed-off-by: Daniel Golle --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -10456,6 +10456,9 @@ static int nl80211_put_mesh_config(struc +@@ -10381,6 +10381,9 @@ static int nl80211_put_mesh_config(struc if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) && nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS, params->auto_plinks)) || diff --git a/feeds/wifi-ax/hostapd/patches/021-fix-sta-add-after-previous-connection.patch b/feeds/wifi-ax/hostapd/patches/021-fix-sta-add-after-previous-connection.patch index 124fd8bdf..accf2fdc2 100644 --- a/feeds/wifi-ax/hostapd/patches/021-fix-sta-add-after-previous-connection.patch +++ b/feeds/wifi-ax/hostapd/patches/021-fix-sta-add-after-previous-connection.patch @@ -1,6 +1,6 @@ --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -4942,6 +4942,13 @@ static int add_associated_sta(struct hos +@@ -4810,6 +4810,13 @@ static int add_associated_sta(struct hos * drivers to accept the STA parameter configuration. Since this is * after a new FT-over-DS exchange, a new TK has been derived, so key * reinstallation is not a concern for this case. @@ -14,7 +14,7 @@ */ wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR " (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)", -@@ -4955,7 +4962,8 @@ static int add_associated_sta(struct hos +@@ -4823,7 +4830,8 @@ static int add_associated_sta(struct hos (!(sta->flags & WLAN_STA_AUTHORIZED) || (reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) || (!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) && diff --git a/feeds/wifi-ax/hostapd/patches/022-hostapd-fix-use-of-uninitialized-stack-variables.patch b/feeds/wifi-ax/hostapd/patches/022-hostapd-fix-use-of-uninitialized-stack-variables.patch index c7da33f02..b6f291928 100644 --- a/feeds/wifi-ax/hostapd/patches/022-hostapd-fix-use-of-uninitialized-stack-variables.patch +++ b/feeds/wifi-ax/hostapd/patches/022-hostapd-fix-use-of-uninitialized-stack-variables.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3431,7 +3431,7 @@ static int hostapd_change_config_freq(st +@@ -3403,7 +3403,7 @@ static int hostapd_change_config_freq(st struct hostapd_freq_params *old_params) { int channel; diff --git a/feeds/wifi-ax/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch b/feeds/wifi-ax/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch index e8a78e355..4d7671439 100644 --- a/feeds/wifi-ax/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch +++ b/feeds/wifi-ax/hostapd/patches/030-driver_nl80211-rewrite-neigh-code-to-not-depend-on-l.patch @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -5284,26 +5281,29 @@ fail: +@@ -5233,26 +5230,29 @@ fail: static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr) { @@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau if (err < 0) { wpa_printf(MSG_DEBUG, "nl80211: bridge FDB entry delete for " MACSTR " ifindex=%d failed: %s", MAC2STR(addr), -@@ -5313,9 +5313,8 @@ static void rtnl_neigh_delete_fdb_entry( +@@ -5262,9 +5262,8 @@ static void rtnl_neigh_delete_fdb_entry( MACSTR, MAC2STR(addr)); } @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau } -@@ -7691,7 +7690,6 @@ static void *i802_init(struct hostapd_da +@@ -7633,7 +7632,6 @@ static void *i802_init(struct hostapd_da (params->num_bridge == 0 || !params->bridge[0])) add_ifidx(drv, br_ifindex, drv->ifindex); @@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau if (bss->added_if_into_bridge || bss->already_in_bridge) { int err; -@@ -7708,7 +7706,6 @@ static void *i802_init(struct hostapd_da +@@ -7650,7 +7648,6 @@ static void *i802_init(struct hostapd_da goto failed; } } @@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) { wpa_printf(MSG_DEBUG, -@@ -10655,13 +10652,14 @@ static int wpa_driver_br_add_ip_neigh(vo +@@ -10581,13 +10578,14 @@ static int wpa_driver_br_add_ip_neigh(vo const u8 *ipaddr, int prefixlen, const u8 *addr) { @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau int res; if (!ipaddr || prefixlen == 0 || !addr) -@@ -10680,85 +10678,66 @@ static int wpa_driver_br_add_ip_neigh(vo +@@ -10606,85 +10604,66 @@ static int wpa_driver_br_add_ip_neigh(vo } if (version == 4) { @@ -220,7 +220,7 @@ Signed-off-by: Felix Fietkau addrsize = 16; } else { return -EINVAL; -@@ -10776,41 +10755,30 @@ static int wpa_driver_br_delete_ip_neigh +@@ -10702,41 +10681,30 @@ static int wpa_driver_br_delete_ip_neigh return -1; } diff --git a/feeds/wifi-ax/hostapd/patches/200-multicall.patch b/feeds/wifi-ax/hostapd/patches/200-multicall.patch index 8dce26087..3d0e8035a 100644 --- a/feeds/wifi-ax/hostapd/patches/200-multicall.patch +++ b/feeds/wifi-ax/hostapd/patches/200-multicall.patch @@ -72,7 +72,7 @@ include ../src/build.rules ifdef LIBS -@@ -359,7 +360,9 @@ endif +@@ -354,7 +355,9 @@ endif ifdef CONFIG_IBSS_RSN NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_IBSS_RSN @@ -82,7 +82,7 @@ OBJS += ibss_rsn.o endif -@@ -897,6 +900,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS +@@ -886,6 +889,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -93,7 +93,7 @@ endif ifdef CONFIG_AP -@@ -904,9 +911,11 @@ NEED_EAP_COMMON=y +@@ -893,9 +900,11 @@ NEED_EAP_COMMON=y NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_AP OBJS += ap.o @@ -105,7 +105,7 @@ OBJS += ../src/ap/hostapd.o OBJS += ../src/ap/wpa_auth_glue.o OBJS += ../src/ap/utils.o -@@ -986,6 +995,12 @@ endif +@@ -975,6 +984,12 @@ endif ifdef CONFIG_HS20 OBJS += ../src/ap/hs20.o endif @@ -118,7 +118,7 @@ endif ifdef CONFIG_MBO -@@ -994,7 +1009,9 @@ CFLAGS += -DCONFIG_MBO +@@ -983,7 +998,9 @@ CFLAGS += -DCONFIG_MBO endif ifdef NEED_RSN_AUTHENTICATOR @@ -128,7 +128,7 @@ NEED_AES_WRAP=y OBJS += ../src/ap/wpa_auth.o OBJS += ../src/ap/wpa_auth_ie.o -@@ -1889,6 +1906,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) +@@ -1878,6 +1895,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) _OBJS_VAR := OBJS include ../src/objs.mk @@ -141,7 +141,7 @@ wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ -@@ -2021,6 +2044,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK) +@@ -1983,6 +2006,12 @@ eap_eke.so: ../src/eap_peer/eap_eke.c .. $(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ @$(E) " sed" $< @@ -156,7 +156,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -6025,8 +6025,8 @@ union wpa_event_data { +@@ -6018,8 +6018,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -167,7 +167,7 @@ /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -6038,7 +6038,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -6031,7 +6031,7 @@ void wpa_supplicant_event(void *ctx, enu * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ @@ -178,7 +178,7 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1836,8 +1836,8 @@ err: +@@ -1827,8 +1827,8 @@ err: #endif /* CONFIG_OWE */ @@ -189,7 +189,7 @@ { struct hostapd_data *hapd = ctx; #ifndef CONFIG_NO_STDOUT_DEBUG -@@ -2082,7 +2082,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -2073,7 +2073,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -231,7 +231,7 @@ os_memset(&global, 0, sizeof(global)); --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -4665,8 +4665,8 @@ static void wpas_event_unprot_beacon(str +@@ -4666,8 +4666,8 @@ static void wpas_event_unprot_beacon(str } @@ -242,7 +242,7 @@ { struct wpa_supplicant *wpa_s = ctx; int resched; -@@ -5511,7 +5511,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -5512,7 +5512,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -253,7 +253,7 @@ struct wpa_supplicant *wpa_s; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -6819,7 +6819,6 @@ struct wpa_interface * wpa_supplicant_ma +@@ -6814,7 +6814,6 @@ struct wpa_interface * wpa_supplicant_ma return NULL; } @@ -261,7 +261,7 @@ /** * wpa_supplicant_match_existing - Match existing interfaces * @global: Pointer to global data from wpa_supplicant_init() -@@ -6854,6 +6853,11 @@ static int wpa_supplicant_match_existing +@@ -6849,6 +6848,11 @@ static int wpa_supplicant_match_existing #endif /* CONFIG_MATCH_IFACE */ @@ -273,7 +273,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -7110,6 +7114,8 @@ struct wpa_global * wpa_supplicant_init( +@@ -7105,6 +7109,8 @@ struct wpa_global * wpa_supplicant_init( #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ @@ -333,7 +333,7 @@ const struct wpa_driver_ops *const wpa_drivers[] = { NULL }; -@@ -1291,6 +1296,10 @@ static void usage(void) +@@ -1292,6 +1297,10 @@ static void usage(void) "option several times.\n"); } @@ -344,7 +344,7 @@ int main(int argc, char *argv[]) { -@@ -1311,6 +1320,8 @@ int main(int argc, char *argv[]) +@@ -1312,6 +1321,8 @@ int main(int argc, char *argv[]) if (os_program_init()) return -1; diff --git a/feeds/wifi-ax/hostapd/patches/300-noscan.patch b/feeds/wifi-ax/hostapd/patches/300-noscan.patch index 93b093428..98a431770 100644 --- a/feeds/wifi-ax/hostapd/patches/300-noscan.patch +++ b/feeds/wifi-ax/hostapd/patches/300-noscan.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3459,6 +3459,10 @@ static int hostapd_config_fill(struct ho +@@ -3439,6 +3439,10 @@ static int hostapd_config_fill(struct ho if (bss->ocv && !bss->ieee80211w) bss->ieee80211w = 1; #endif /* CONFIG_OCV */ @@ -13,7 +13,7 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1009,6 +1009,8 @@ struct hostapd_config { +@@ -995,6 +995,8 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; diff --git a/feeds/wifi-ax/hostapd/patches/310-rescan_immediately.patch b/feeds/wifi-ax/hostapd/patches/310-rescan_immediately.patch index 7f5e20706..41f1b1e49 100644 --- a/feeds/wifi-ax/hostapd/patches/310-rescan_immediately.patch +++ b/feeds/wifi-ax/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -5154,7 +5154,7 @@ wpa_supplicant_alloc(struct wpa_supplica +@@ -5147,7 +5147,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/feeds/wifi-ax/hostapd/patches/320-optional_rfkill.patch b/feeds/wifi-ax/hostapd/patches/320-optional_rfkill.patch index 01537790e..a703c7e13 100644 --- a/feeds/wifi-ax/hostapd/patches/320-optional_rfkill.patch +++ b/feeds/wifi-ax/hostapd/patches/320-optional_rfkill.patch @@ -1,6 +1,6 @@ --- a/src/drivers/drivers.mak +++ b/src/drivers/drivers.mak -@@ -54,7 +54,6 @@ NEED_SME=y +@@ -50,7 +50,6 @@ NEED_SME=y NEED_AP_MLME=y NEED_NETLINK=y NEED_LINUX_IOCTL=y @@ -8,7 +8,7 @@ NEED_RADIOTAP=y NEED_LIBNL=y endif -@@ -111,7 +110,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT +@@ -107,7 +106,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT CONFIG_WIRELESS_EXTENSION=y NEED_NETLINK=y NEED_LINUX_IOCTL=y @@ -16,7 +16,7 @@ endif ifdef CONFIG_DRIVER_NDIS -@@ -137,7 +135,6 @@ endif +@@ -133,7 +131,6 @@ endif ifdef CONFIG_WIRELESS_EXTENSION DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION DRV_WPA_OBJS += ../src/drivers/driver_wext.o @@ -24,7 +24,7 @@ endif ifdef NEED_NETLINK -@@ -146,6 +143,7 @@ endif +@@ -142,6 +139,7 @@ endif ifdef NEED_RFKILL DRV_OBJS += ../src/drivers/rfkill.o diff --git a/feeds/wifi-ax/hostapd/patches/330-nl80211_fix_set_freq.patch b/feeds/wifi-ax/hostapd/patches/330-nl80211_fix_set_freq.patch index 9ced08801..e1070d0f4 100644 --- a/feeds/wifi-ax/hostapd/patches/330-nl80211_fix_set_freq.patch +++ b/feeds/wifi-ax/hostapd/patches/330-nl80211_fix_set_freq.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4973,7 +4973,7 @@ static int nl80211_set_channel(struct i8 +@@ -4919,7 +4919,7 @@ static int nl80211_set_channel(struct i8 freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled, freq->bandwidth, freq->center_freq1, freq->center_freq2); diff --git a/feeds/wifi-ax/hostapd/patches/340-reload_freq_change.patch b/feeds/wifi-ax/hostapd/patches/340-reload_freq_change.patch deleted file mode 100644 index 3d51a47a1..000000000 --- a/feeds/wifi-ax/hostapd/patches/340-reload_freq_change.patch +++ /dev/null @@ -1,75 +0,0 @@ ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -115,6 +115,28 @@ static void hostapd_reload_bss(struct ho - #endif /* CONFIG_NO_RADIUS */ - - ssid = &hapd->conf->ssid; -+ -+ hostapd_set_freq(hapd, hapd->iconf->hw_mode, hapd->iface->freq, -+ hapd->iconf->channel, -+ hapd->iconf->enable_edmg, -+ hapd->iconf->edmg_channel, -+ hapd->iconf->ieee80211n, -+ hapd->iconf->ieee80211ac, -+ hapd->iconf->ieee80211ax, -+ hapd->iconf->secondary_channel, -+ hostapd_get_oper_chwidth(hapd->iconf), -+ hostapd_get_oper_centr_freq_seg0_idx(hapd->iconf), -+ hostapd_get_oper_centr_freq_seg1_idx(hapd->iconf)); -+ -+ if (hapd->iface->current_mode) { -+ if (hostapd_prepare_rates(hapd->iface, hapd->iface->current_mode)) { -+ wpa_printf(MSG_ERROR, "Failed to prepare rates table."); -+ hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, -+ HOSTAPD_LEVEL_WARNING, -+ "Failed to prepare rates table."); -+ } -+ } -+ - if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && - ssid->wpa_passphrase_set && ssid->wpa_passphrase) { - /* -@@ -216,6 +238,7 @@ int hostapd_reload_config(struct hostapd - struct hostapd_data *hapd = iface->bss[0]; - struct hostapd_config *newconf, *oldconf; - size_t j; -+ int i; - - if (iface->config_fname == NULL) { - /* Only in-memory config in use - assume it has been updated */ -@@ -266,24 +289,20 @@ int hostapd_reload_config(struct hostapd - } - iface->conf = newconf; - -+ for (i = 0; i < iface->num_hw_features; i++) { -+ struct hostapd_hw_modes *mode = &iface->hw_features[i]; -+ if (mode->mode == iface->conf->hw_mode) { -+ iface->current_mode = mode; -+ break; -+ } -+ } -+ -+ if (iface->conf->channel) -+ iface->freq = hostapd_hw_get_freq(hapd, iface->conf->channel); -+ - for (j = 0; j < iface->num_bss; j++) { - hapd = iface->bss[j]; - hapd->iconf = newconf; -- hapd->iconf->channel = oldconf->channel; -- hapd->iconf->acs = oldconf->acs; -- hapd->iconf->secondary_channel = oldconf->secondary_channel; -- hapd->iconf->ieee80211n = oldconf->ieee80211n; -- hapd->iconf->ieee80211ac = oldconf->ieee80211ac; -- hapd->iconf->ht_capab = oldconf->ht_capab; -- hapd->iconf->vht_capab = oldconf->vht_capab; -- hostapd_set_oper_chwidth(hapd->iconf, -- hostapd_get_oper_chwidth(oldconf)); -- hostapd_set_oper_centr_freq_seg0_idx( -- hapd->iconf, -- hostapd_get_oper_centr_freq_seg0_idx(oldconf)); -- hostapd_set_oper_centr_freq_seg1_idx( -- hapd->iconf, -- hostapd_get_oper_centr_freq_seg1_idx(oldconf)); - hapd->conf = newconf->bss[j]; - hostapd_reload_bss(hapd); - } diff --git a/feeds/wifi-ax/hostapd/patches/350-nl80211_del_beacon_bss.patch b/feeds/wifi-ax/hostapd/patches/350-nl80211_del_beacon_bss.patch index 1f9b74e97..41e427c22 100644 --- a/feeds/wifi-ax/hostapd/patches/350-nl80211_del_beacon_bss.patch +++ b/feeds/wifi-ax/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -2918,10 +2918,15 @@ static int wpa_driver_nl80211_del_beacon +@@ -2891,10 +2891,15 @@ static int wpa_driver_nl80211_del_beacon struct nl_msg *msg; struct wpa_driver_nl80211_data *drv = bss->drv; @@ -18,7 +18,7 @@ return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL); } -@@ -5602,7 +5607,7 @@ static void nl80211_teardown_ap(struct i +@@ -5550,7 +5555,7 @@ static void nl80211_teardown_ap(struct i nl80211_mgmt_unsubscribe(bss, "AP teardown"); nl80211_put_wiphy_data_ap(bss); @@ -27,7 +27,7 @@ } -@@ -8051,8 +8056,6 @@ static int wpa_driver_nl80211_if_remove( +@@ -7990,8 +7995,6 @@ static int wpa_driver_nl80211_if_remove( } else { wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); nl80211_teardown_ap(bss); @@ -36,7 +36,7 @@ nl80211_destroy_bss(bss); if (!bss->added_if) i802_set_iface_flags(bss, 0); -@@ -8449,7 +8452,6 @@ static int wpa_driver_nl80211_deinit_ap( +@@ -8388,7 +8391,6 @@ static int wpa_driver_nl80211_deinit_ap( if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); @@ -44,7 +44,7 @@ /* * If the P2P GO interface was dynamically added, then it is -@@ -8469,7 +8471,6 @@ static int wpa_driver_nl80211_stop_ap(vo +@@ -8408,7 +8410,6 @@ static int wpa_driver_nl80211_stop_ap(vo if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); diff --git a/feeds/wifi-ax/hostapd/patches/360-ctrl_iface_reload.patch b/feeds/wifi-ax/hostapd/patches/360-ctrl_iface_reload.patch deleted file mode 100644 index 349522e06..000000000 --- a/feeds/wifi-ax/hostapd/patches/360-ctrl_iface_reload.patch +++ /dev/null @@ -1,106 +0,0 @@ ---- a/hostapd/ctrl_iface.c -+++ b/hostapd/ctrl_iface.c -@@ -67,6 +67,7 @@ - #include "fst/fst_ctrl_iface.h" - #include "config_file.h" - #include "ctrl_iface.h" -+#include "config_file.h" - - - #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256 -@@ -82,6 +83,7 @@ static void hostapd_ctrl_iface_send(stru - enum wpa_msg_type type, - const char *buf, size_t len); - -+static char *reload_opts = NULL; - - static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd, - struct sockaddr_storage *from, -@@ -133,6 +135,61 @@ static int hostapd_ctrl_iface_new_sta(st - return 0; - } - -+static char *get_option(char *opt, char *str) -+{ -+ int len = strlen(str); -+ -+ if (!strncmp(opt, str, len)) -+ return opt + len; -+ else -+ return NULL; -+} -+ -+static struct hostapd_config *hostapd_ctrl_iface_config_read(const char *fname) -+{ -+ struct hostapd_config *conf; -+ char *opt, *val; -+ -+ conf = hostapd_config_read(fname); -+ if (!conf) -+ return NULL; -+ -+ for (opt = strtok(reload_opts, " "); -+ opt; -+ opt = strtok(NULL, " ")) { -+ -+ if ((val = get_option(opt, "channel="))) -+ conf->channel = atoi(val); -+ else if ((val = get_option(opt, "ht_capab="))) -+ conf->ht_capab = atoi(val); -+ else if ((val = get_option(opt, "ht_capab_mask="))) -+ conf->ht_capab &= atoi(val); -+ else if ((val = get_option(opt, "sec_chan="))) -+ conf->secondary_channel = atoi(val); -+ else if ((val = get_option(opt, "hw_mode="))) -+ conf->hw_mode = atoi(val); -+ else if ((val = get_option(opt, "ieee80211n="))) -+ conf->ieee80211n = atoi(val); -+ else -+ break; -+ } -+ -+ return conf; -+} -+ -+static int hostapd_ctrl_iface_update(struct hostapd_data *hapd, char *txt) -+{ -+ struct hostapd_config * (*config_read_cb)(const char *config_fname); -+ struct hostapd_iface *iface = hapd->iface; -+ -+ config_read_cb = iface->interfaces->config_read_cb; -+ iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read; -+ reload_opts = txt; -+ -+ hostapd_reload_config(iface); -+ -+ iface->interfaces->config_read_cb = config_read_cb; -+} - - #ifdef NEED_AP_MLME - static int hostapd_ctrl_iface_sa_query(struct hostapd_data *hapd, -@@ -3754,6 +3811,8 @@ static int hostapd_ctrl_iface_receive_pr - } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { - reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, - reply_size); -+ } else if (os_strncmp(buf, "UPDATE ", 7) == 0) { -+ hostapd_ctrl_iface_update(hapd, buf + 7); - } else if (os_strcmp(buf, "ERP_FLUSH") == 0) { - ieee802_1x_erp_flush(hapd); - #ifdef RADIUS_SERVER ---- a/src/ap/ctrl_iface_ap.c -+++ b/src/ap/ctrl_iface_ap.c -@@ -919,7 +919,13 @@ int hostapd_parse_csa_settings(const cha - - int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd) - { -- return hostapd_drv_stop_ap(hapd); -+ struct hostapd_iface *iface = hapd->iface; -+ int i; -+ -+ for (i = 0; i < iface->num_bss; i++) -+ hostapd_drv_stop_ap(iface->bss[i]); -+ -+ return 0; - } - - diff --git a/feeds/wifi-ax/hostapd/patches/370-ap_sta_support.patch b/feeds/wifi-ax/hostapd/patches/370-ap_sta_support.patch deleted file mode 100644 index 9ffd7e2a0..000000000 --- a/feeds/wifi-ax/hostapd/patches/370-ap_sta_support.patch +++ /dev/null @@ -1,414 +0,0 @@ -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/Makefile -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/Makefile -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/Makefile -@@ -103,6 +103,8 @@ OBJS_c += ../src/utils/common.o - OBJS_c += ../src/common/cli.o - OBJS += wmm_ac.o - -+OBJS += ../src/common/wpa_ctrl.o -+ - ifndef CONFIG_OS - ifdef CONFIG_NATIVE_WINDOWS - CONFIG_OS=win32 -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/bss.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/bss.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/bss.c -@@ -11,6 +11,7 @@ - #include "utils/common.h" - #include "utils/eloop.h" - #include "common/ieee802_11_defs.h" -+#include "common/ieee802_11_common.h" - #include "drivers/driver.h" - #include "eap_peer/eap.h" - #include "wpa_supplicant_i.h" -@@ -282,6 +283,10 @@ void calculate_update_time(const struct - static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, - struct os_reltime *fetch_time) - { -+ struct ieee80211_ht_capabilities *capab; -+ struct ieee80211_ht_operation *oper; -+ struct ieee802_11_elems elems; -+ - dst->flags = src->flags; - os_memcpy(dst->bssid, src->bssid, ETH_ALEN); - dst->freq = src->freq; -@@ -294,6 +299,15 @@ static void wpa_bss_copy_res(struct wpa_ - dst->est_throughput = src->est_throughput; - dst->snr = src->snr; - -+ memset(&elems, 0, sizeof(elems)); -+ ieee802_11_parse_elems((u8 *) (src + 1), src->ie_len, &elems, 0); -+ capab = (struct ieee80211_ht_capabilities *) elems.ht_capabilities; -+ oper = (struct ieee80211_ht_operation *) elems.ht_operation; -+ if (capab) -+ dst->ht_capab = le_to_host16(capab->ht_capabilities_info); -+ if (oper) -+ dst->ht_param = oper->ht_param; -+ - calculate_update_time(fetch_time, src->age, &dst->last_update); - } - -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/bss.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/bss.h -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/bss.h -@@ -94,6 +94,10 @@ struct wpa_bss { - u8 ssid[SSID_MAX_LEN]; - /** Length of SSID */ - size_t ssid_len; -+ /** HT capabilities */ -+ u16 ht_capab; -+ /* Five octets of HT Operation Information */ -+ u8 ht_param; - /** Frequency of the channel in MHz (e.g., 2412 = channel 1) */ - int freq; - /** Beacon interval in TUs (host byte order) */ -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/main.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/main.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/main.c -@@ -34,7 +34,7 @@ static void usage(void) - "vW] [-P] " - "[-g] \\\n" - " [-G] \\\n" -- " -i -c [-C] [-D] " -+ " -i -c [-C] [-D] [-H] " - "[-p] \\\n" - " [-b] [-e]" - #ifdef CONFIG_DEBUG_FILE -@@ -74,6 +74,7 @@ static void usage(void) - " -g = global ctrl_interface\n" - " -G = global ctrl_interface group\n" - " -h = show this help text\n" -+ " -H = connect to a hostapd instance to manage state changes\n" - " -i = interface name\n" - " -I = additional configuration file\n" - " -K = include keys (passwords, etc.) in debug output\n" -@@ -201,7 +202,7 @@ int main(int argc, char *argv[]) - - for (;;) { - c = getopt(argc, argv, -- "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW"); -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuvW"); - if (c < 0) - break; - switch (c) { -@@ -248,6 +249,9 @@ int main(int argc, char *argv[]) - usage(); - exitcode = 0; - goto out; -+ case 'H': -+ iface->hostapd_ctrl = optarg; -+ break; - case 'i': - iface->ifname = optarg; - break; -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_supplicant.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c -@@ -130,6 +130,54 @@ static void wpas_update_fils_connect_par - static void wpas_update_owe_connect_params(struct wpa_supplicant *wpa_s); - #endif /* CONFIG_OWE */ - -+static int hostapd_stop(struct wpa_supplicant *wpa_s) -+{ -+ const char *cmd = "STOP_AP"; -+ char buf[256]; -+ size_t len = sizeof(buf); -+ -+ if (wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL) < 0) { -+ wpa_printf(MSG_ERROR, "\nFailed to stop hostapd AP interfaces\n"); -+ return -1; -+ } -+ return 0; -+} -+ -+static int hostapd_reload(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) -+{ -+ char *cmd = NULL; -+ char buf[256]; -+ size_t len = sizeof(buf); -+ enum hostapd_hw_mode hw_mode; -+ u8 channel; -+ int sec_chan = 0; -+ int ret; -+ -+ if (!bss) -+ return -1; -+ -+ if (bss->ht_param & HT_INFO_HT_PARAM_STA_CHNL_WIDTH) { -+ int sec = bss->ht_param & HT_INFO_HT_PARAM_SECONDARY_CHNL_OFF_MASK; -+ if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE) -+ sec_chan = 1; -+ else if (sec == HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW) -+ sec_chan = -1; -+ } -+ -+ hw_mode = ieee80211_freq_to_chan(bss->freq, &channel); -+ if (asprintf(&cmd, "UPDATE channel=%d sec_chan=%d hw_mode=%d", -+ channel, sec_chan, hw_mode) < 0) -+ return -1; -+ -+ ret = wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL); -+ free(cmd); -+ -+ if (ret < 0) { -+ wpa_printf(MSG_ERROR, "\nFailed to reload hostapd AP interfaces\n"); -+ return -1; -+ } -+ return 0; -+} - - #ifdef CONFIG_WEP - /* Configure default/group WEP keys for static WEP */ -@@ -1007,6 +1055,8 @@ void wpa_supplicant_set_state(struct wpa - - sme_sched_obss_scan(wpa_s, 1); - -+ if (wpa_s->hostapd) -+ hostapd_reload(wpa_s, wpa_s->current_bss); - #if defined(CONFIG_FILS) && defined(IEEE8021X_EAPOL) - if (!fils_hlp_sent && ssid && ssid->eap.erp) - update_fils_connect_params = true; -@@ -1017,6 +1067,8 @@ void wpa_supplicant_set_state(struct wpa - #endif /* CONFIG_OWE */ - } else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING || - state == WPA_ASSOCIATED) { -+ if (wpa_s->hostapd) -+ hostapd_stop(wpa_s); - wpa_s->new_connection = 1; - wpa_drv_set_operstate(wpa_s, 0); - #ifndef IEEE8021X_EAPOL -@@ -2276,6 +2328,8 @@ void wpa_supplicant_associate(struct wpa - return; - } - wpa_s->current_bss = bss; -+ if (wpa_s->hostapd) -+ hostapd_reload(wpa_s, wpa_s->current_bss); - #else /* CONFIG_MESH */ - wpa_msg(wpa_s, MSG_ERROR, - "mesh mode support not included in the build"); -@@ -6419,6 +6473,16 @@ static int wpa_supplicant_init_iface(str - sizeof(wpa_s->bridge_ifname)); - } - -+ if (iface->hostapd_ctrl) { -+ wpa_s->hostapd = wpa_ctrl_open(iface->hostapd_ctrl); -+ if (!wpa_s->hostapd) { -+ wpa_printf(MSG_ERROR, "\nFailed to connect to hostapd\n"); -+ return -1; -+ } -+ if (hostapd_stop(wpa_s) < 0) -+ return -1; -+ } -+ - /* RSNA Supplicant Key Management - INITIALIZE */ - eapol_sm_notify_portEnabled(wpa_s->eapol, false); - eapol_sm_notify_portValid(wpa_s->eapol, false); -@@ -6756,6 +6820,11 @@ static void wpa_supplicant_deinit_iface( - if (terminate) - wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); - -+ if (wpa_s->hostapd) { -+ wpa_ctrl_close(wpa_s->hostapd); -+ wpa_s->hostapd = NULL; -+ } -+ - if (wpa_s->ctrl_iface) { - wpa_supplicant_ctrl_iface_deinit(wpa_s->ctrl_iface); - wpa_s->ctrl_iface = NULL; -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant_i.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_supplicant_i.h -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant_i.h -@@ -103,6 +103,11 @@ struct wpa_interface { - const char *ifname; - - /** -+ * hostapd_ctrl - path to hostapd control socket for notification -+ */ -+ const char *hostapd_ctrl; -+ -+ /** - * bridge_ifname - Optional bridge interface name - * - * If the driver interface (ifname) is included in a Linux bridge -@@ -611,6 +616,8 @@ struct wpa_supplicant { - #endif /* CONFIG_CTRL_IFACE_BINDER */ - char bridge_ifname[16]; - -+ struct wpa_ctrl *hostapd; -+ - char *confname; - char *confanother; - -Index: hostapd-2021-02-20-59e9794c/hostapd/ctrl_iface.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/hostapd/ctrl_iface.c -+++ hostapd-2021-02-20-59e9794c/hostapd/ctrl_iface.c -@@ -2781,6 +2781,11 @@ static int hostapd_ctrl_iface_chan_switc - return 0; - } - -+ if (os_strstr(pos, " auto-ht")) { -+ settings.freq_params.ht_enabled = iface->conf->ieee80211n; -+ settings.freq_params.vht_enabled = iface->conf->ieee80211ac; -+ } -+ - for (i = 0; i < iface->num_bss; i++) { - - /* Save CHAN_SWITCH VHT and HE config */ -Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/beacon.c -+++ hostapd-2021-02-20-59e9794c/src/ap/beacon.c -@@ -1753,11 +1753,6 @@ int ieee802_11_set_beacon(struct hostapd - struct wpabuf *beacon, *proberesp, *assocresp; - int res, ret = -1; - -- if (hapd->csa_in_progress) { -- wpa_printf(MSG_ERROR, "Cannot set beacons during CSA period"); -- return -1; -- } -- - hapd->beacon_set_done = 1; - - if (ieee802_11_build_ap_params(hapd, ¶ms) < 0) -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/events.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/events.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/events.c -@@ -4666,6 +4666,60 @@ static void wpas_event_unprot_beacon(str - } - - -+static void -+supplicant_ch_switch_started(struct wpa_supplicant *wpa_s, -+ union wpa_event_data *data) -+{ -+ char buf[256]; -+ size_t len = sizeof(buf); -+ char *cmd = NULL; -+ int width = 20; -+ int ret; -+ -+ if (!wpa_s->hostapd) -+ return; -+ -+ wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_CHANNEL_SWITCH -+ "count=%d freq=%d ht_enabled=%d ch_offset=%d ch_width=%s cf1=%d cf2=%d", -+ data->ch_switch.count, -+ data->ch_switch.freq, -+ data->ch_switch.ht_enabled, -+ data->ch_switch.ch_offset, -+ channel_width_to_string(data->ch_switch.ch_width), -+ data->ch_switch.cf1, -+ data->ch_switch.cf2); -+ -+ switch (data->ch_switch.ch_width) { -+ case CHAN_WIDTH_20_NOHT: -+ case CHAN_WIDTH_20: -+ width = 20; -+ break; -+ case CHAN_WIDTH_40: -+ width = 40; -+ break; -+ case CHAN_WIDTH_80: -+ width = 80; -+ break; -+ case CHAN_WIDTH_160: -+ case CHAN_WIDTH_80P80: -+ width = 160; -+ break; -+ } -+ -+ asprintf(&cmd, "CHAN_SWITCH %d %d sec_channel_offset=%d center_freq1=%d center_freq2=%d, bandwidth=%d auto-ht\n", -+ data->ch_switch.count - 1, -+ data->ch_switch.freq, -+ data->ch_switch.ch_offset, -+ data->ch_switch.cf1, -+ data->ch_switch.cf2, -+ width); -+ ret = wpa_ctrl_request(wpa_s->hostapd, cmd, os_strlen(cmd), buf, &len, NULL); -+ free(cmd); -+ -+ if (ret < 0) -+ wpa_printf(MSG_ERROR, "\nFailed to reload hostapd AP interfaces\n"); -+} -+ - void supplicant_event(void *ctx, enum wpa_event_type event, - union wpa_event_data *data) - { -@@ -4981,8 +5035,10 @@ void supplicant_event(void *ctx, enum wp - channel_width_to_string(data->ch_switch.ch_width), - data->ch_switch.cf1, - data->ch_switch.cf2); -- if (event == EVENT_CH_SWITCH_STARTED) -+ if (event == EVENT_CH_SWITCH_STARTED) { -+ supplicant_ch_switch_started(wpa_s, data); - break; -+ } - - wpa_s->assoc_freq = data->ch_switch.freq; - wpa_s->current_ssid->frequency = data->ch_switch.freq; -Index: hostapd-2021-02-20-59e9794c/src/drivers/driver.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver.h -+++ hostapd-2021-02-20-59e9794c/src/drivers/driver.h -@@ -5822,6 +5822,7 @@ union wpa_event_data { - - /** - * struct ch_switch -+ * @count: Count until channel switch activates - * @freq: Frequency of new channel in MHz - * @ht_enabled: Whether this is an HT channel - * @ch_offset: Secondary channel offset -@@ -5830,6 +5831,7 @@ union wpa_event_data { - * @cf2: Center frequency 2 - */ - struct ch_switch { -+ int count; - int freq; - int ht_enabled; - int ch_offset; -Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211_event.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver_nl80211_event.c -+++ hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211_event.c -@@ -655,7 +655,7 @@ static void mlme_event_ch_switch(struct - struct nlattr *ifindex, struct nlattr *freq, - struct nlattr *type, struct nlattr *bw, - struct nlattr *cf1, struct nlattr *cf2, -- int finished) -+ struct nlattr *count, int finished) - { - struct i802_bss *bss; - union wpa_event_data data; -@@ -714,6 +714,8 @@ static void mlme_event_ch_switch(struct - data.ch_switch.cf1 = nla_get_u32(cf1); - if (cf2) - data.ch_switch.cf2 = nla_get_u32(cf2); -+ if (count) -+ data.ch_switch.count = nla_get_u32(count); - - if (finished) - bss->freq = data.ch_switch.freq; -@@ -2886,6 +2888,7 @@ static void do_process_drv_event(struct - tb[NL80211_ATTR_CHANNEL_WIDTH], - tb[NL80211_ATTR_CENTER_FREQ1], - tb[NL80211_ATTR_CENTER_FREQ2], -+ tb[NL80211_ATTR_CH_SWITCH_COUNT], - 0); - break; - case NL80211_CMD_CH_SWITCH_NOTIFY: -@@ -2896,6 +2899,7 @@ static void do_process_drv_event(struct - tb[NL80211_ATTR_CHANNEL_WIDTH], - tb[NL80211_ATTR_CENTER_FREQ1], - tb[NL80211_ATTR_CENTER_FREQ2], -+ NULL, - 1); - break; - case NL80211_CMD_DISCONNECT: diff --git a/feeds/wifi-ax/hostapd/patches/380-disable_ctrl_iface_mib.patch b/feeds/wifi-ax/hostapd/patches/380-disable_ctrl_iface_mib.patch index ca634077b..80500414b 100644 --- a/feeds/wifi-ax/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ b/feeds/wifi-ax/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -12,7 +12,7 @@ else --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3569,6 +3569,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3388,6 +3388,7 @@ static int hostapd_ctrl_iface_receive_pr reply_size); } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { reply_len = hostapd_drv_status(hapd, reply, reply_size); @@ -20,7 +20,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = ieee802_11_get_mib(hapd, reply, reply_size); if (reply_len >= 0) { -@@ -3610,6 +3611,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3429,6 +3430,7 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, reply_size); @@ -30,7 +30,7 @@ reply_len = -1; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -955,6 +955,9 @@ ifdef CONFIG_FILS +@@ -942,6 +942,9 @@ ifdef CONFIG_FILS OBJS += ../src/ap/fils_hlp.o endif ifdef CONFIG_CTRL_IFACE @@ -42,7 +42,7 @@ --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c -@@ -2308,7 +2308,7 @@ static int wpa_supplicant_ctrl_iface_sta +@@ -2294,7 +2294,7 @@ static int wpa_supplicant_ctrl_iface_sta pos += ret; } @@ -51,7 +51,7 @@ if (wpa_s->ap_iface) { pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, end - pos, -@@ -10919,6 +10919,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10602,6 +10602,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = -1; } else if (os_strncmp(buf, "NOTE ", 5) == 0) { wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); @@ -59,7 +59,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { -@@ -10931,6 +10932,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10614,6 +10615,7 @@ char * wpa_supplicant_ctrl_iface_process reply_size - reply_len); #endif /* CONFIG_MACSEC */ } @@ -67,7 +67,7 @@ } else if (os_strncmp(buf, "STATUS", 6) == 0) { reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -11419,6 +11421,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -11102,6 +11104,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = wpa_supplicant_ctrl_iface_bss( wpa_s, buf + 4, reply, reply_size); #ifdef CONFIG_AP @@ -75,7 +75,7 @@ } else if (os_strcmp(buf, "STA-FIRST") == 0) { reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); } else if (os_strncmp(buf, "STA ", 4) == 0) { -@@ -11427,12 +11430,15 @@ char * wpa_supplicant_ctrl_iface_process +@@ -11110,12 +11113,15 @@ char * wpa_supplicant_ctrl_iface_process } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, reply_size); @@ -144,7 +144,7 @@ static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -4519,6 +4519,7 @@ static const char * wpa_bool_txt(int val +@@ -4503,6 +4503,7 @@ static const char * wpa_bool_txt(int val return val ? "TRUE" : "FALSE"; } @@ -152,7 +152,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ -@@ -4669,7 +4670,7 @@ int wpa_get_mib_sta(struct wpa_state_mac +@@ -4653,7 +4654,7 @@ int wpa_get_mib_sta(struct wpa_state_mac return len; } @@ -163,7 +163,7 @@ { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2767,6 +2767,8 @@ static u32 wpa_key_mgmt_suite(struct wpa +@@ -2763,6 +2763,8 @@ static u32 wpa_key_mgmt_suite(struct wpa } @@ -172,7 +172,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -2848,6 +2850,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch +@@ -2844,6 +2846,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch return (int) len; } diff --git a/feeds/wifi-ax/hostapd/patches/420-indicate-features.patch b/feeds/wifi-ax/hostapd/patches/420-indicate-features.patch index f9dff6607..f74db4c02 100644 --- a/feeds/wifi-ax/hostapd/patches/420-indicate-features.patch +++ b/feeds/wifi-ax/hostapd/patches/420-indicate-features.patch @@ -36,16 +36,16 @@ #include "fst/fst.h" #include "wpa_supplicant_i.h" #include "driver_i.h" -@@ -202,7 +203,7 @@ int main(int argc, char *argv[]) +@@ -201,7 +202,7 @@ int main(int argc, char *argv[]) for (;;) { c = getopt(argc, argv, -- "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuvW"); -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuv::W"); +- "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW"); ++ "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuv::W"); if (c < 0) break; switch (c) { -@@ -305,8 +306,12 @@ int main(int argc, char *argv[]) +@@ -301,8 +302,12 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ case 'v': diff --git a/feeds/wifi-ax/hostapd/patches/430-hostapd_cli_ifdef.patch b/feeds/wifi-ax/hostapd/patches/430-hostapd_cli_ifdef.patch index dc1fa3d29..49ad781d4 100644 --- a/feeds/wifi-ax/hostapd/patches/430-hostapd_cli_ifdef.patch +++ b/feeds/wifi-ax/hostapd/patches/430-hostapd_cli_ifdef.patch @@ -32,7 +32,7 @@ static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, -@@ -1579,13 +1575,10 @@ static const struct hostapd_cli_cmd host +@@ -1571,13 +1567,10 @@ static const struct hostapd_cli_cmd host { "disassociate", hostapd_cli_cmd_disassociate, hostapd_complete_stations, " = disassociate a station" }, @@ -46,7 +46,7 @@ { "wps_pin", hostapd_cli_cmd_wps_pin, NULL, " [timeout] [addr] = add WPS Enrollee PIN" }, { "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, -@@ -1610,7 +1603,6 @@ static const struct hostapd_cli_cmd host +@@ -1602,7 +1595,6 @@ static const struct hostapd_cli_cmd host " = configure AP" }, { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, "= show current WPS status" }, diff --git a/feeds/wifi-ax/hostapd/patches/450-scan_wait.patch b/feeds/wifi-ax/hostapd/patches/450-scan_wait.patch deleted file mode 100644 index ac874ad66..000000000 --- a/feeds/wifi-ax/hostapd/patches/450-scan_wait.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- a/hostapd/main.c -+++ b/hostapd/main.c -@@ -39,6 +39,8 @@ struct hapd_global { - }; - - static struct hapd_global global; -+static int daemonize = 0; -+static char *pid_file = NULL; - - - #ifndef CONFIG_NO_HOSTAPD_LOGGER -@@ -146,6 +148,14 @@ static void hostapd_logger_cb(void *ctx, - } - #endif /* CONFIG_NO_HOSTAPD_LOGGER */ - -+static void hostapd_setup_complete_cb(void *ctx) -+{ -+ if (daemonize && os_daemonize(pid_file)) { -+ perror("daemon"); -+ return; -+ } -+ daemonize = 0; -+} - - /** - * hostapd_driver_init - Preparate driver interface -@@ -164,6 +174,8 @@ static int hostapd_driver_init(struct ho - return -1; - } - -+ hapd->setup_complete_cb = hostapd_setup_complete_cb; -+ - /* Initialize the driver interface */ - if (!(b[0] | b[1] | b[2] | b[3] | b[4] | b[5])) - b = NULL; -@@ -404,8 +416,6 @@ static void hostapd_global_deinit(const - #endif /* CONFIG_NATIVE_WINDOWS */ - - eap_server_unregister_methods(); -- -- os_daemonize_terminate(pid_file); - } - - -@@ -431,18 +441,6 @@ static int hostapd_global_run(struct hap - } - #endif /* EAP_SERVER_TNC */ - -- if (daemonize) { -- if (os_daemonize(pid_file)) { -- wpa_printf(MSG_ERROR, "daemon: %s", strerror(errno)); -- return -1; -- } -- if (eloop_sock_requeue()) { -- wpa_printf(MSG_ERROR, "eloop_sock_requeue: %s", -- strerror(errno)); -- return -1; -- } -- } -- - eloop_run(); - - return 0; -@@ -645,8 +643,7 @@ int main(int argc, char *argv[]) - struct hapd_interfaces interfaces; - int ret = 1; - size_t i, j; -- int c, debug = 0, daemonize = 0; -- char *pid_file = NULL; -+ int c, debug = 0; - const char *log_file = NULL; - const char *entropy_file = NULL; - char **bss_config = NULL, **tmp_bss; diff --git a/feeds/wifi-ax/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/feeds/wifi-ax/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index e0e687e16..e395faaf3 100644 --- a/feeds/wifi-ax/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/feeds/wifi-ax/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -3726,6 +3726,12 @@ static void wpas_start_assoc_cb(struct w +@@ -3673,6 +3673,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; diff --git a/feeds/wifi-ax/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/feeds/wifi-ax/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch index 1d2a053fa..19165d028 100644 --- a/feeds/wifi-ax/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/feeds/wifi-ax/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -5951,7 +5951,7 @@ static int wpa_driver_nl80211_ibss(struc +@@ -5886,7 +5886,7 @@ static int wpa_driver_nl80211_ibss(struc struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli int count = 0; wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -5978,6 +5978,37 @@ retry: +@@ -5913,6 +5913,37 @@ retry: nl80211_put_beacon_int(msg, params->beacon_int)) goto fail; diff --git a/feeds/wifi-ax/hostapd/patches/463-add-mcast_rate-to-11s.patch b/feeds/wifi-ax/hostapd/patches/463-add-mcast_rate-to-11s.patch index 1794befe9..395c6d31b 100644 --- a/feeds/wifi-ax/hostapd/patches/463-add-mcast_rate-to-11s.patch +++ b/feeds/wifi-ax/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich struct wpa_driver_set_key_params { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -10476,6 +10476,18 @@ static int nl80211_put_mesh_id(struct nl +@@ -10398,6 +10398,18 @@ static int nl80211_put_mesh_id(struct nl } @@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params) { -@@ -10537,6 +10549,7 @@ static int nl80211_join_mesh(struct i802 +@@ -10459,6 +10471,7 @@ static int nl80211_join_mesh(struct i802 nl80211_put_basic_rates(msg, params->basic_rates) || nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || nl80211_put_beacon_int(msg, params->beacon_int) || diff --git a/feeds/wifi-ax/hostapd/patches/464-fix-mesh-obss-check.patch b/feeds/wifi-ax/hostapd/patches/464-fix-mesh-obss-check.patch index 4c7cb9ea3..0e9d2590d 100644 --- a/feeds/wifi-ax/hostapd/patches/464-fix-mesh-obss-check.patch +++ b/feeds/wifi-ax/hostapd/patches/464-fix-mesh-obss-check.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2457,11 +2457,13 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2403,11 +2403,13 @@ void ibss_mesh_setup_freq(struct wpa_sup for (j = 0; j < wpa_s->last_scan_res_used; j++) { struct wpa_bss *bss = wpa_s->last_scan_res[j]; diff --git a/feeds/wifi-ax/hostapd/patches/470-survey_data_fallback.patch b/feeds/wifi-ax/hostapd/patches/470-survey_data_fallback.patch index efd82599d..57a78ee86 100644 --- a/feeds/wifi-ax/hostapd/patches/470-survey_data_fallback.patch +++ b/feeds/wifi-ax/hostapd/patches/470-survey_data_fallback.patch @@ -20,7 +20,7 @@ total = survey->channel_time; -@@ -422,20 +416,19 @@ static int acs_usable_bw160_chan(const s +@@ -415,20 +409,19 @@ static int acs_usable_vht160_chan(const static int acs_survey_is_sufficient(struct freq_survey *survey) { if (!(survey->filled & SURVEY_HAS_NF)) { diff --git a/feeds/wifi-ax/hostapd/patches/500-lto-jobserver-support.patch b/feeds/wifi-ax/hostapd/patches/500-lto-jobserver-support.patch index 1475590d0..7ba3e096e 100644 --- a/feeds/wifi-ax/hostapd/patches/500-lto-jobserver-support.patch +++ b/feeds/wifi-ax/hostapd/patches/500-lto-jobserver-support.patch @@ -20,7 +20,7 @@ NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -1918,31 +1918,31 @@ wpa_supplicant_multi.a: .config $(BCHECK +@@ -1905,31 +1905,31 @@ wpa_supplicant_multi.a: .config $(BCHECK @$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) diff --git a/feeds/wifi-ax/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch b/feeds/wifi-ax/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch index 6c080adc0..4d3f524f9 100644 --- a/feeds/wifi-ax/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch +++ b/feeds/wifi-ax/hostapd/patches/550-WNM-allow-specifying-dialog-token.patch @@ -19,7 +19,7 @@ Signed-off-by: David Bauer --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -897,7 +897,7 @@ static int hostapd_ctrl_iface_bss_tm_req +@@ -840,7 +840,7 @@ static int hostapd_ctrl_iface_bss_tm_req const char *pos, *end; int disassoc_timer = 0; struct sta_info *sta; @@ -28,7 +28,7 @@ Signed-off-by: David Bauer u8 bss_term_dur[12]; char *url = NULL; int ret; -@@ -935,6 +935,12 @@ static int hostapd_ctrl_iface_bss_tm_req +@@ -878,6 +878,12 @@ static int hostapd_ctrl_iface_bss_tm_req valid_int = atoi(pos); } @@ -41,7 +41,7 @@ Signed-off-by: David Bauer pos = os_strstr(cmd, " bss_term="); if (pos) { pos += 10; -@@ -1041,7 +1047,7 @@ static int hostapd_ctrl_iface_bss_tm_req +@@ -984,7 +990,7 @@ static int hostapd_ctrl_iface_bss_tm_req #endif /* CONFIG_MBO */ ret = wnm_send_bss_tm_req(hapd, sta, req_mode, disassoc_timer, diff --git a/feeds/wifi-ax/hostapd/patches/590-rrm-wnm-statistics.patch b/feeds/wifi-ax/hostapd/patches/590-rrm-wnm-statistics.patch index ee3ab7938..737fdbb5d 100644 --- a/feeds/wifi-ax/hostapd/patches/590-rrm-wnm-statistics.patch +++ b/feeds/wifi-ax/hostapd/patches/590-rrm-wnm-statistics.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -150,6 +150,21 @@ struct hostapd_sae_commit_queue { +@@ -148,6 +148,21 @@ struct hostapd_sae_commit_queue { }; /** @@ -22,7 +22,7 @@ * struct hostapd_data - hostapd per-BSS data structure */ struct hostapd_data { -@@ -163,6 +178,9 @@ struct hostapd_data { +@@ -161,6 +176,9 @@ struct hostapd_data { u8 own_addr[ETH_ALEN]; @@ -71,7 +71,7 @@ if (disassoc_timer) { /* send disassociation frame after time-out */ set_disassoc_timer(hapd, sta, disassoc_timer); -@@ -857,6 +862,7 @@ int wnm_send_bss_tm_req(struct hostapd_d +@@ -856,6 +861,7 @@ int wnm_send_bss_tm_req(struct hostapd_d } os_free(buf); diff --git a/feeds/wifi-ax/hostapd/patches/600-ubus_support.patch b/feeds/wifi-ax/hostapd/patches/600-ubus_support.patch index 4d9674421..afcb8eb47 100644 --- a/feeds/wifi-ax/hostapd/patches/600-ubus_support.patch +++ b/feeds/wifi-ax/hostapd/patches/600-ubus_support.patch @@ -41,7 +41,7 @@ struct hostapd_iface * hostapd_alloc_iface(void); --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -395,6 +395,7 @@ void hostapd_free_hapd_data(struct hosta +@@ -376,6 +376,7 @@ void hostapd_free_hapd_data(struct hosta hapd->beacon_set_done = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); @@ -49,7 +49,7 @@ accounting_deinit(hapd); hostapd_deinit_wpa(hapd); vlan_deinit(hapd); -@@ -1417,6 +1418,8 @@ static int hostapd_setup_bss(struct host +@@ -1398,6 +1399,8 @@ static int hostapd_setup_bss(struct host if (hapd->driver && hapd->driver->set_operstate) hapd->driver->set_operstate(hapd->drv_priv, 1); @@ -58,7 +58,7 @@ return 0; } -@@ -2002,6 +2005,7 @@ static int hostapd_setup_interface_compl +@@ -1983,6 +1986,7 @@ static int hostapd_setup_interface_compl if (err) goto fail; @@ -66,7 +66,7 @@ wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (iface->freq) { #ifdef NEED_AP_MLME -@@ -2199,6 +2203,7 @@ dfs_offload: +@@ -2180,6 +2184,7 @@ dfs_offload: fail: wpa_printf(MSG_ERROR, "Interface initialization failed"); @@ -74,7 +74,7 @@ hostapd_set_state(iface, HAPD_IFACE_DISABLED); wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); #ifdef CONFIG_FST -@@ -2672,6 +2677,7 @@ void hostapd_interface_deinit_free(struc +@@ -2653,6 +2658,7 @@ void hostapd_interface_deinit_free(struc (unsigned int) iface->conf->num_bss); driver = iface->bss[0]->driver; drv_priv = iface->bss[0]->drv_priv; @@ -316,7 +316,7 @@ --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -171,6 +171,13 @@ ifdef CONFIG_EAPOL_TEST +@@ -169,6 +169,13 @@ ifdef CONFIG_EAPOL_TEST CFLAGS += -Werror -DEAPOL_TEST endif @@ -330,7 +330,7 @@ ifdef CONFIG_CODE_COVERAGE CFLAGS += -O0 -fprofile-arcs -ftest-coverage LIBS += -lgcov -@@ -948,6 +955,9 @@ ifdef CONFIG_CTRL_IFACE_MIB +@@ -946,6 +953,9 @@ ifdef CONFIG_CTRL_IFACE_MIB CFLAGS += -DCONFIG_CTRL_IFACE_MIB endif OBJS += ../src/ap/ctrl_iface_ap.o @@ -342,7 +342,7 @@ CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -7012,6 +7012,8 @@ struct wpa_supplicant * wpa_supplicant_a +@@ -6943,6 +6943,8 @@ struct wpa_supplicant * wpa_supplicant_a } #endif /* CONFIG_P2P */ @@ -351,7 +351,7 @@ return wpa_s; } -@@ -7038,6 +7040,8 @@ int wpa_supplicant_remove_iface(struct w +@@ -6969,6 +6971,8 @@ int wpa_supplicant_remove_iface(struct w struct wpa_supplicant *parent = wpa_s->parent; #endif /* CONFIG_MESH */ @@ -360,7 +360,7 @@ /* Remove interface from the global list of interfaces */ prev = global->ifaces; if (prev == wpa_s) { -@@ -7341,8 +7345,12 @@ int wpa_supplicant_run(struct wpa_global +@@ -7272,8 +7276,12 @@ int wpa_supplicant_run(struct wpa_global eloop_register_signal_terminate(wpa_supplicant_terminate, global); eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); @@ -383,7 +383,7 @@ extern const char *const wpa_supplicant_version; extern const char *const wpa_supplicant_license; -@@ -321,6 +322,8 @@ struct wpa_global { +@@ -316,6 +317,8 @@ struct wpa_global { #endif /* CONFIG_WIFI_DISPLAY */ struct psk_list_entry *add_psk; /* From group formation */ @@ -392,7 +392,7 @@ }; -@@ -601,6 +604,7 @@ struct wpa_supplicant { +@@ -596,6 +599,7 @@ struct wpa_supplicant { unsigned char own_addr[ETH_ALEN]; unsigned char perm_addr[ETH_ALEN]; char ifname[100]; @@ -421,16 +421,16 @@ --- a/wpa_supplicant/main.c +++ b/wpa_supplicant/main.c -@@ -203,7 +203,7 @@ int main(int argc, char *argv[]) +@@ -202,7 +202,7 @@ int main(int argc, char *argv[]) for (;;) { c = getopt(argc, argv, -- "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuv::W"); -+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:nNo:O:p:P:qsTtuv::W"); +- "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuv::W"); ++ "b:Bc:C:D:de:f:g:G:hi:I:KLMm:nNo:O:p:P:qsTtuv::W"); if (c < 0) break; switch (c) { -@@ -271,6 +271,9 @@ int main(int argc, char *argv[]) +@@ -267,6 +267,9 @@ int main(int argc, char *argv[]) params.conf_p2p_dev = optarg; break; #endif /* CONFIG_P2P */ diff --git a/feeds/wifi-ax/hostapd/patches/601-ucode_support.patch b/feeds/wifi-ax/hostapd/patches/601-ucode_support.patch index 69d5df96b..d542f3b2b 100644 --- a/feeds/wifi-ax/hostapd/patches/601-ucode_support.patch +++ b/feeds/wifi-ax/hostapd/patches/601-ucode_support.patch @@ -26,7 +26,7 @@ ifdef CONFIG_CODE_COVERAGE --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -895,6 +895,7 @@ int main(int argc, char *argv[]) +@@ -898,6 +898,7 @@ int main(int argc, char *argv[]) } hostapd_global_ctrl_iface_init(&interfaces); @@ -34,7 +34,7 @@ if (hostapd_global_run(&interfaces, daemonize, pid_file)) { wpa_printf(MSG_ERROR, "Failed to start eloop"); -@@ -904,6 +905,7 @@ int main(int argc, char *argv[]) +@@ -907,6 +908,7 @@ int main(int argc, char *argv[]) ret = 0; out: @@ -79,18 +79,27 @@ void *owner; char *config_fname; struct hostapd_config *conf; +@@ -637,6 +644,8 @@ struct hostapd_iface * hostapd_init(stru + struct hostapd_iface * + hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy, + const char *config_fname, int debug); ++int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon); ++void hostapd_bss_deinit(struct hostapd_data *hapd); + void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, + int reassoc); + void hostapd_interface_deinit_free(struct hostapd_iface *iface); --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -239,6 +239,8 @@ int hostapd_reload_config(struct hostapd +@@ -216,6 +216,8 @@ int hostapd_reload_config(struct hostapd + struct hostapd_config *newconf, *oldconf; size_t j; - int i; -+ hostapd_ucode_reload_bss(hapd, reconf); ++ hostapd_ucode_reload_bss(hapd); + if (iface->config_fname == NULL) { /* Only in-memory config in use - assume it has been updated */ hostapd_clear_old(iface); -@@ -395,6 +397,7 @@ void hostapd_free_hapd_data(struct hosta +@@ -376,6 +378,7 @@ void hostapd_free_hapd_data(struct hosta hapd->beacon_set_done = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); @@ -98,7 +107,7 @@ hostapd_ubus_free_bss(hapd); accounting_deinit(hapd); hostapd_deinit_wpa(hapd); -@@ -549,6 +552,7 @@ void hostapd_cleanup_iface_partial(struc +@@ -530,6 +533,7 @@ void hostapd_cleanup_iface_partial(struc static void hostapd_cleanup_iface(struct hostapd_iface *iface) { wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); @@ -106,7 +115,16 @@ eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); eloop_cancel_timeout(hostapd_interface_setup_failure_handler, iface, NULL); -@@ -1419,6 +1423,7 @@ static int hostapd_setup_bss(struct host +@@ -1104,7 +1108,7 @@ static int db_table_create_radius_attrib + * initialized. Most of the modules that are initialized here will be + * deinitialized in hostapd_cleanup(). + */ +-static int hostapd_setup_bss(struct hostapd_data *hapd, int first) ++int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool set_beacon) + { + struct hostapd_bss_config *conf = hapd->conf; + u8 ssid[SSID_MAX_LEN + 1]; +@@ -1400,6 +1404,7 @@ static int hostapd_setup_bss(struct host hapd->driver->set_operstate(hapd->drv_priv, 1); hostapd_ubus_add_bss(hapd); @@ -114,9 +132,36 @@ return 0; } +@@ -2090,7 +2095,7 @@ static int hostapd_setup_interface_compl + hapd = iface->bss[j]; + if (j) + os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); +- if (hostapd_setup_bss(hapd, j == 0)) { ++ if (hostapd_setup_bss(hapd, j == 0, true)) { + for (;;) { + hapd = iface->bss[j]; + hostapd_bss_deinit_no_free(hapd); +@@ -2368,7 +2373,7 @@ hostapd_alloc_bss_data(struct hostapd_if + } + + +-static void hostapd_bss_deinit(struct hostapd_data *hapd) ++void hostapd_bss_deinit(struct hostapd_data *hapd) + { + if (!hapd) + return; +@@ -2985,7 +2990,7 @@ int hostapd_add_iface(struct hapd_interf + + if (start_ctrl_iface_bss(hapd) < 0 || + (hapd_iface->state == HAPD_IFACE_ENABLED && +- hostapd_setup_bss(hapd, -1))) { ++ hostapd_setup_bss(hapd, -1, true))) { + hostapd_cleanup(hapd); + hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; + hapd_iface->conf->num_bss--; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -174,8 +174,20 @@ endif +@@ -172,8 +172,20 @@ endif ifdef CONFIG_UBUS CFLAGS += -DUBUS_SUPPORT OBJS += ubus.o @@ -138,9 +183,27 @@ endif ifdef CONFIG_CODE_COVERAGE +@@ -956,6 +968,9 @@ OBJS += ../src/ap/ctrl_iface_ap.o + ifdef CONFIG_UBUS + OBJS += ../src/ap/ubus.o + endif ++ifdef CONFIG_UCODE ++OBJS += ../src/ap/ucode.o ++endif + endif + + CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -7013,6 +7013,7 @@ struct wpa_supplicant * wpa_supplicant_a +@@ -1025,6 +1025,7 @@ void wpa_supplicant_set_state(struct wpa + sme_sched_obss_scan(wpa_s, 0); + } + wpa_s->wpa_state = state; ++ wpas_ucode_update_state(wpa_s); + + #ifdef CONFIG_BGSCAN + if (state == WPA_COMPLETED && wpa_s->current_ssid != wpa_s->bgscan_ssid) +@@ -6944,6 +6945,7 @@ struct wpa_supplicant * wpa_supplicant_a #endif /* CONFIG_P2P */ wpas_ubus_add_bss(wpa_s); @@ -148,7 +211,7 @@ return wpa_s; } -@@ -7040,6 +7041,7 @@ int wpa_supplicant_remove_iface(struct w +@@ -6971,6 +6973,7 @@ int wpa_supplicant_remove_iface(struct w struct wpa_supplicant *parent = wpa_s->parent; #endif /* CONFIG_MESH */ @@ -156,7 +219,7 @@ wpas_ubus_free_bss(wpa_s); /* Remove interface from the global list of interfaces */ -@@ -7307,6 +7309,7 @@ struct wpa_global * wpa_supplicant_init( +@@ -7238,6 +7241,7 @@ struct wpa_global * wpa_supplicant_init( eloop_register_timeout(WPA_SUPPLICANT_CLEANUP_INTERVAL, 0, wpas_periodic, global, NULL); @@ -164,7 +227,7 @@ return global; } -@@ -7345,12 +7348,8 @@ int wpa_supplicant_run(struct wpa_global +@@ -7276,12 +7280,8 @@ int wpa_supplicant_run(struct wpa_global eloop_register_signal_terminate(wpa_supplicant_terminate, global); eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); @@ -177,7 +240,7 @@ return 0; } -@@ -7383,6 +7382,8 @@ void wpa_supplicant_deinit(struct wpa_gl +@@ -7314,6 +7314,8 @@ void wpa_supplicant_deinit(struct wpa_gl wpas_notify_supplicant_deinitialized(global); @@ -196,7 +259,7 @@ extern const char *const wpa_supplicant_version; extern const char *const wpa_supplicant_license; -@@ -605,6 +606,7 @@ struct wpa_supplicant { +@@ -600,6 +601,7 @@ struct wpa_supplicant { unsigned char perm_addr[ETH_ALEN]; char ifname[100]; struct wpas_ubus_bss ubus; @@ -206,7 +269,7 @@ #endif /* CONFIG_MATCH_IFACE */ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -4941,6 +4941,7 @@ try_again: +@@ -4877,6 +4877,7 @@ try_again: return -1; } @@ -214,7 +277,7 @@ wpa_msg_register_cb(hostapd_ctrl_iface_msg_cb); return 0; -@@ -5042,6 +5043,7 @@ fail: +@@ -4978,6 +4979,7 @@ fail: os_free(fname); interface->global_ctrl_sock = s; @@ -222,3 +285,66 @@ eloop_register_read_sock(s, hostapd_global_ctrl_iface_receive, interface, NULL); +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -5827,6 +5827,7 @@ union wpa_event_data { + + /** + * struct ch_switch ++ * @count: Count until channel switch activates + * @freq: Frequency of new channel in MHz + * @ht_enabled: Whether this is an HT channel + * @ch_offset: Secondary channel offset +@@ -5835,6 +5836,7 @@ union wpa_event_data { + * @cf2: Center frequency 2 + */ + struct ch_switch { ++ int count; + int freq; + int ht_enabled; + int ch_offset; +--- a/src/drivers/driver_nl80211_event.c ++++ b/src/drivers/driver_nl80211_event.c +@@ -655,6 +655,7 @@ static void mlme_event_ch_switch(struct + struct nlattr *ifindex, struct nlattr *freq, + struct nlattr *type, struct nlattr *bw, + struct nlattr *cf1, struct nlattr *cf2, ++ struct nlattr *count, + int finished) + { + struct i802_bss *bss; +@@ -714,6 +715,8 @@ static void mlme_event_ch_switch(struct + data.ch_switch.cf1 = nla_get_u32(cf1); + if (cf2) + data.ch_switch.cf2 = nla_get_u32(cf2); ++ if (count) ++ data.ch_switch.count = nla_get_u32(count); + + if (finished) + bss->freq = data.ch_switch.freq; +@@ -2886,6 +2889,7 @@ static void do_process_drv_event(struct + tb[NL80211_ATTR_CHANNEL_WIDTH], + tb[NL80211_ATTR_CENTER_FREQ1], + tb[NL80211_ATTR_CENTER_FREQ2], ++ tb[NL80211_ATTR_CH_SWITCH_COUNT], + 0); + break; + case NL80211_CMD_CH_SWITCH_NOTIFY: +@@ -2896,6 +2900,7 @@ static void do_process_drv_event(struct + tb[NL80211_ATTR_CHANNEL_WIDTH], + tb[NL80211_ATTR_CENTER_FREQ1], + tb[NL80211_ATTR_CENTER_FREQ2], ++ NULL, + 1); + break; + case NL80211_CMD_DISCONNECT: +--- a/wpa_supplicant/events.c ++++ b/wpa_supplicant/events.c +@@ -4702,6 +4702,7 @@ void supplicant_event(void *ctx, enum wp + event_to_string(event), event); + #endif /* CONFIG_NO_STDOUT_DEBUG */ + ++ wpas_ucode_event(wpa_s, event, data); + switch (event) { + case EVENT_AUTH: + #ifdef CONFIG_FST diff --git a/feeds/wifi-ax/hostapd/patches/700-wifi-reload.patch b/feeds/wifi-ax/hostapd/patches/700-wifi-reload.patch deleted file mode 100644 index a4890379a..000000000 --- a/feeds/wifi-ax/hostapd/patches/700-wifi-reload.patch +++ /dev/null @@ -1,328 +0,0 @@ ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -2437,8 +2437,13 @@ static int hostapd_config_fill(struct ho - bss->isolate = atoi(pos); - } else if (os_strcmp(buf, "ap_max_inactivity") == 0) { - bss->ap_max_inactivity = atoi(pos); -+ } else if (os_strcmp(buf, "config_id") == 0) { -+ bss->config_id = os_strdup(pos); - } else if (os_strcmp(buf, "skip_inactivity_poll") == 0) { - bss->skip_inactivity_poll = atoi(pos); -+ } else if (os_strcmp(buf, "config_id") == 0) { -+ os_free(bss->config_id); -+ bss->config_id = os_strdup(pos); - } else if (os_strcmp(buf, "country_code") == 0) { - if (pos[0] < 'A' || pos[0] > 'Z' || - pos[1] < 'A' || pos[1] > 'Z') { -@@ -3133,6 +3138,8 @@ static int hostapd_config_fill(struct ho - } - } else if (os_strcmp(buf, "acs_exclude_dfs") == 0) { - conf->acs_exclude_dfs = atoi(pos); -+ } else if (os_strcmp(buf, "radio_config_id") == 0) { -+ conf->config_id = os_strdup(pos); - } else if (os_strcmp(buf, "op_class") == 0) { - conf->op_class = atoi(pos); - } else if (os_strcmp(buf, "channel") == 0) { ---- a/src/ap/ap_config.c -+++ b/src/ap/ap_config.c -@@ -785,6 +785,7 @@ void hostapd_config_free_bss(struct host - os_free(conf->radius_req_attr_sqlite); - os_free(conf->rsn_preauth_interfaces); - os_free(conf->ctrl_interface); -+ os_free(conf->config_id); - os_free(conf->ca_cert); - os_free(conf->server_cert); - os_free(conf->server_cert2); -@@ -981,6 +982,7 @@ void hostapd_config_free(struct hostapd_ - - for (i = 0; i < conf->num_bss; i++) - hostapd_config_free_bss(conf->bss[i]); -+ os_free(conf->config_id); - os_free(conf->bss); - os_free(conf->supported_rates); - os_free(conf->basic_rates); ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -882,6 +882,7 @@ struct hostapd_bss_config { - #endif /* CONFIG_PASN */ - - unsigned int unsol_bcast_probe_resp_interval; -+ char *config_id; - }; - - /** -@@ -924,6 +925,7 @@ struct spatial_reuse { - struct hostapd_config { - struct hostapd_bss_config **bss, *last_bss; - size_t num_bss; -+ char *config_id; - - u16 beacon_int; - int rts_threshold; ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c -@@ -99,7 +99,7 @@ void hostapd_reconfig_encryption(struct - } - - --static void hostapd_reload_bss(struct hostapd_data *hapd) -+void hostapd_reload_bss(struct hostapd_data *hapd) - { - struct hostapd_ssid *ssid; - -@@ -189,27 +189,34 @@ static void hostapd_reload_bss(struct ho - } - - --static void hostapd_clear_old(struct hostapd_iface *iface) -+static void hostapd_clear_old_bss(struct hostapd_data *bss) - { -- size_t j; -+ wpa_printf(MSG_DEBUG, "BSS %s changed - clear old state", -+ bss->conf->iface); - - /* - * Deauthenticate all stations since the new configuration may not - * allow them to use the BSS anymore. - */ -- for (j = 0; j < iface->num_bss; j++) { -- hostapd_flush_old_stations(iface->bss[j], -- WLAN_REASON_PREV_AUTH_NOT_VALID); -+ hostapd_flush_old_stations(bss, WLAN_REASON_PREV_AUTH_NOT_VALID); - #ifdef CONFIG_WEP -- hostapd_broadcast_wep_clear(iface->bss[j]); -+ hostapd_broadcast_wep_clear(bss); - #endif /* CONFIG_WEP */ - - #ifndef CONFIG_NO_RADIUS -- /* TODO: update dynamic data based on changed configuration -- * items (e.g., open/close sockets, etc.) */ -- radius_client_flush(iface->bss[j]->radius, 0); -+ /* TODO: update dynamic data based on changed configuration -+ * items (e.g., open/close sockets, etc.) */ -+ radius_client_flush(bss->radius, 0); - #endif /* CONFIG_NO_RADIUS */ -- } -+} -+ -+ -+static void hostapd_clear_old(struct hostapd_iface *iface) -+{ -+ size_t j; -+ -+ for (j = 0; j < iface->num_bss; j++) -+ hostapd_clear_old_bss(iface->bss[j]); - } - - -@@ -218,6 +225,10 @@ static int hostapd_iface_conf_changed(st - { - size_t i; - -+ if (newconf->config_id != oldconf->config_id) -+ if (strcmp(newconf->config_id, oldconf->config_id)) -+ return 1; -+ - if (newconf->num_bss != oldconf->num_bss) - return 1; - -@@ -231,7 +242,7 @@ static int hostapd_iface_conf_changed(st - } - - --int hostapd_reload_config(struct hostapd_iface *iface) -+int hostapd_reload_config(struct hostapd_iface *iface, int reconf) - { - struct hapd_interfaces *interfaces = iface->interfaces; - struct hostapd_data *hapd = iface->bss[0]; -@@ -256,13 +267,16 @@ int hostapd_reload_config(struct hostapd - if (newconf == NULL) - return -1; - -- hostapd_clear_old(iface); -- - oldconf = hapd->iconf; - if (hostapd_iface_conf_changed(newconf, oldconf)) { - char *fname; - int res; - -+ if (reconf) -+ return -1; -+ -+ hostapd_clear_old(iface); -+ - wpa_printf(MSG_DEBUG, - "Configuration changes include interface/BSS modification - force full disable+enable sequence"); - fname = os_strdup(iface->config_fname); -@@ -287,6 +301,24 @@ int hostapd_reload_config(struct hostapd - wpa_printf(MSG_ERROR, - "Failed to enable interface on config reload"); - return res; -+ } else { -+ for (j = 0; j < iface->num_bss; j++) { -+ hapd = iface->bss[j]; -+ if (!hapd->config_id || strcmp(hapd->config_id, newconf->bss[j]->config_id)) { -+ hostapd_flush_old_stations(iface->bss[j], -+ WLAN_REASON_PREV_AUTH_NOT_VALID); -+#ifdef CONFIG_WEP -+ hostapd_broadcast_wep_clear(iface->bss[j]); -+#endif -+ -+#ifndef CONFIG_NO_RADIUS -+ /* TODO: update dynamic data based on changed configuration -+ * items (e.g., open/close sockets, etc.) */ -+ radius_client_flush(iface->bss[j]->radius, 0); -+#endif /* CONFIG_NO_RADIUS */ -+ wpa_printf(MSG_INFO, "bss %zu changed", j); -+ } -+ } - } - iface->conf = newconf; - -@@ -303,6 +335,16 @@ int hostapd_reload_config(struct hostapd - - for (j = 0; j < iface->num_bss; j++) { - hapd = iface->bss[j]; -+ if (hapd->config_id) { -+ os_free(hapd->config_id); -+ hapd->config_id = NULL; -+ } -+ if (newconf->bss[j]->config_id) -+ hapd->config_id = strdup(newconf->bss[j]->config_id); -+ if (!hapd->conf->config_id || !newconf->bss[j]->config_id || -+ os_strcmp(hapd->conf->config_id, -+ newconf->bss[j]->config_id) != 0) -+ hostapd_clear_old_bss(hapd); - hapd->iconf = newconf; - hapd->conf = newconf->bss[j]; - hostapd_reload_bss(hapd); -@@ -1127,7 +1169,7 @@ static int db_table_create_radius_attrib - * initialized. Most of the modules that are initialized here will be - * deinitialized in hostapd_cleanup(). - */ --static int hostapd_setup_bss(struct hostapd_data *hapd, int first) -+int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool set_beacon) - { - struct hostapd_bss_config *conf = hapd->conf; - u8 ssid[SSID_MAX_LEN + 1]; -@@ -2114,7 +2156,7 @@ static int hostapd_setup_interface_compl - hapd = iface->bss[j]; - if (j) - os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); -- if (hostapd_setup_bss(hapd, j == 0)) { -+ if (hostapd_setup_bss(hapd, j == 0, true)) { - for (;;) { - hapd = iface->bss[j]; - hostapd_bss_deinit_no_free(hapd); -@@ -2374,6 +2416,10 @@ hostapd_alloc_bss_data(struct hostapd_if - hapd->iconf = conf; - hapd->conf = bss; - hapd->iface = hapd_iface; -+ if (bss && bss->config_id) -+ hapd->config_id = strdup(bss->config_id); -+ else -+ hapd->config_id = NULL; - if (conf) - hapd->driver = conf->driver; - hapd->ctrl_sock = -1; -@@ -2392,7 +2438,7 @@ hostapd_alloc_bss_data(struct hostapd_if - } - - --static void hostapd_bss_deinit(struct hostapd_data *hapd) -+void hostapd_bss_deinit(struct hostapd_data *hapd) - { - if (!hapd) - return; -@@ -3009,7 +3055,7 @@ int hostapd_add_iface(struct hapd_interf - - if (start_ctrl_iface_bss(hapd) < 0 || - (hapd_iface->state == HAPD_IFACE_ENABLED && -- hostapd_setup_bss(hapd, -1))) { -+ hostapd_setup_bss(hapd, -1, true))) { - hostapd_cleanup(hapd); - hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; - hapd_iface->conf->num_bss--; ---- a/hostapd/ctrl_iface.c -+++ b/hostapd/ctrl_iface.c -@@ -186,7 +186,7 @@ static int hostapd_ctrl_iface_update(str - iface->interfaces->config_read_cb = hostapd_ctrl_iface_config_read; - reload_opts = txt; - -- hostapd_reload_config(iface); -+ hostapd_reload_config(iface, 0); - - iface->interfaces->config_read_cb = config_read_cb; - } ---- a/hostapd/main.c -+++ b/hostapd/main.c -@@ -317,7 +317,7 @@ static void handle_term(int sig, void *s - - static int handle_reload_iface(struct hostapd_iface *iface, void *ctx) - { -- if (hostapd_reload_config(iface) < 0) { -+ if (hostapd_reload_config(iface, 0) < 0) { - wpa_printf(MSG_WARNING, "Failed to read new configuration " - "file - continuing with old."); - } ---- a/src/ap/hostapd.h -+++ b/src/ap/hostapd.h -@@ -47,7 +47,7 @@ struct mesh_conf; - struct hostapd_iface; - - struct hapd_interfaces { -- int (*reload_config)(struct hostapd_iface *iface); -+ int (*reload_config)(struct hostapd_iface *iface, int reconf); - struct hostapd_config * (*config_read_cb)(const char *config_fname); - int (*ctrl_iface_init)(struct hostapd_data *hapd); - void (*ctrl_iface_deinit)(struct hostapd_data *hapd); -@@ -177,6 +177,7 @@ struct hostapd_data { - struct hostapd_bss_config *conf; - struct hostapd_ubus_bss ubus; - struct hostapd_ucode_bss ucode; -+ char *config_id; - int interface_added; /* virtual interface added for this BSS */ - unsigned int started:1; - unsigned int disabled:1; -@@ -627,7 +628,9 @@ struct hostapd_iface { - int hostapd_for_each_interface(struct hapd_interfaces *interfaces, - int (*cb)(struct hostapd_iface *iface, - void *ctx), void *ctx); --int hostapd_reload_config(struct hostapd_iface *iface); -+int hostapd_reload_config(struct hostapd_iface *iface, int reconf); -+void hostapd_reload_bss(struct hostapd_data *hapd); -+void hostapd_bss_deinit(struct hostapd_data *hapd); - void hostapd_reconfig_encryption(struct hostapd_data *hapd); - struct hostapd_data * - hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, -@@ -644,6 +647,7 @@ struct hostapd_iface * hostapd_init(stru - struct hostapd_iface * - hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy, - const char *config_fname, int debug); -+int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool set_beacon); - void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, - int reassoc); - void hostapd_interface_deinit_free(struct hostapd_iface *iface); ---- a/src/ap/wps_hostapd.c -+++ b/src/ap/wps_hostapd.c -@@ -315,7 +315,7 @@ static void wps_reload_config(void *eloo - - wpa_printf(MSG_DEBUG, "WPS: Reload configuration data"); - if (iface->interfaces == NULL || -- iface->interfaces->reload_config(iface) < 0) { -+ iface->interfaces->reload_config(iface, 1) < 0) { - wpa_printf(MSG_WARNING, "WPS: Failed to reload the updated " - "configuration"); - } ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -4766,6 +4766,9 @@ static int wpa_driver_nl80211_set_ap(voi - if (ret) { - wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)", - ret, strerror(-ret)); -+ if (!bss->beacon_set) -+ ret = 0; -+ bss->beacon_set = 0; - } else { - bss->beacon_set = 1; - nl80211_set_bss(bss, params->cts_protect, params->preamble, diff --git a/feeds/wifi-ax/hostapd/patches/701-reload_config_inline.patch b/feeds/wifi-ax/hostapd/patches/701-reload_config_inline.patch index e73b7adae..2f68e73e0 100644 --- a/feeds/wifi-ax/hostapd/patches/701-reload_config_inline.patch +++ b/feeds/wifi-ax/hostapd/patches/701-reload_config_inline.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4706,7 +4706,12 @@ struct hostapd_config * hostapd_config_r +@@ -4699,7 +4699,12 @@ struct hostapd_config * hostapd_config_r int errors = 0; size_t i; diff --git a/feeds/wifi-ax/hostapd/patches/710-vlan_no_bridge.patch b/feeds/wifi-ax/hostapd/patches/710-vlan_no_bridge.patch index 3aeb36b49..0459bd478 100644 --- a/feeds/wifi-ax/hostapd/patches/710-vlan_no_bridge.patch +++ b/feeds/wifi-ax/hostapd/patches/710-vlan_no_bridge.patch @@ -30,7 +30,7 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3349,6 +3349,8 @@ static int hostapd_config_fill(struct ho +@@ -3342,6 +3342,8 @@ static int hostapd_config_fill(struct ho #ifndef CONFIG_NO_VLAN } else if (os_strcmp(buf, "dynamic_vlan") == 0) { bss->ssid.dynamic_vlan = atoi(pos); diff --git a/feeds/wifi-ax/hostapd/patches/720-iface_max_num_sta.patch b/feeds/wifi-ax/hostapd/patches/720-iface_max_num_sta.patch index ef6ac28d6..cecc6d3f4 100644 --- a/feeds/wifi-ax/hostapd/patches/720-iface_max_num_sta.patch +++ b/feeds/wifi-ax/hostapd/patches/720-iface_max_num_sta.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2858,6 +2858,14 @@ static int hostapd_config_fill(struct ho +@@ -2853,6 +2853,14 @@ static int hostapd_config_fill(struct ho line, bss->max_num_sta, MAX_STA_COUNT); return 1; } @@ -17,7 +17,7 @@ } else if (os_strcmp(buf, "extended_key_id") == 0) { --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -674,6 +674,7 @@ void hostapd_cleanup_cs_params(struct ho +@@ -672,6 +672,7 @@ void hostapd_cleanup_cs_params(struct ho void hostapd_periodic_iface(struct hostapd_iface *iface); int hostapd_owe_trans_get_info(struct hostapd_data *hapd); void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx); @@ -27,7 +27,7 @@ int hostapd_register_probereq_cb(struct hostapd_data *hapd, --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -242,6 +242,30 @@ static int hostapd_iface_conf_changed(st +@@ -209,6 +209,30 @@ static int hostapd_iface_conf_changed(st } @@ -55,7 +55,7 @@ + return 0; +} + - int hostapd_reload_config(struct hostapd_iface *iface, int reconf) + int hostapd_reload_config(struct hostapd_iface *iface) { struct hapd_interfaces *interfaces = iface->interfaces; --- a/src/ap/beacon.c @@ -71,7 +71,7 @@ " since no room for additional STA", --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -961,6 +961,8 @@ struct hostapd_config { +@@ -959,6 +959,8 @@ struct hostapd_config { unsigned int track_sta_max_num; unsigned int track_sta_max_age; diff --git a/feeds/wifi-ax/hostapd/patches/730-ft_iface.patch b/feeds/wifi-ax/hostapd/patches/730-ft_iface.patch index 8a56184e8..6bf85bfa5 100644 --- a/feeds/wifi-ax/hostapd/patches/730-ft_iface.patch +++ b/feeds/wifi-ax/hostapd/patches/730-ft_iface.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3016,6 +3016,8 @@ static int hostapd_config_fill(struct ho +@@ -3011,6 +3011,8 @@ static int hostapd_config_fill(struct ho wpa_printf(MSG_INFO, "Line %d: Obsolete peerkey parameter ignored", line); #ifdef CONFIG_IEEE80211R_AP diff --git a/feeds/wifi-ax/hostapd/patches/760-dynamic_own_ip.patch b/feeds/wifi-ax/hostapd/patches/760-dynamic_own_ip.patch index 530d835cf..ad6fa287f 100644 --- a/feeds/wifi-ax/hostapd/patches/760-dynamic_own_ip.patch +++ b/feeds/wifi-ax/hostapd/patches/760-dynamic_own_ip.patch @@ -98,7 +98,7 @@ hapd->conf->own_ip_addr.af == AF_INET && --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2701,6 +2701,8 @@ static int hostapd_config_fill(struct ho +@@ -2696,6 +2696,8 @@ static int hostapd_config_fill(struct ho } else if (os_strcmp(buf, "iapp_interface") == 0) { wpa_printf(MSG_INFO, "DEPRECATED: iapp_interface not used"); #endif /* CONFIG_IAPP */ diff --git a/feeds/wifi-ax/hostapd/patches/770-wds-hack.patch b/feeds/wifi-ax/hostapd/patches/770-wds-hack.patch index 8817a4d74..5fa58585f 100644 --- a/feeds/wifi-ax/hostapd/patches/770-wds-hack.patch +++ b/feeds/wifi-ax/hostapd/patches/770-wds-hack.patch @@ -9,7 +9,7 @@ #include "utils/common.h" #include "utils/eloop.h" #include "utils/crc32.h" -@@ -1259,6 +1261,22 @@ int hostapd_setup_bss(struct hostapd_dat +@@ -1198,6 +1200,22 @@ int hostapd_setup_bss(struct hostapd_dat os_memcpy(hapd->own_addr, if_addr, ETH_ALEN); } diff --git a/feeds/wifi-ax/hostapd/patches/900-coa_multi.patch b/feeds/wifi-ax/hostapd/patches/900-coa_multi.patch index a9f6e9ad4..24927ea73 100644 --- a/feeds/wifi-ax/hostapd/patches/900-coa_multi.patch +++ b/feeds/wifi-ax/hostapd/patches/900-coa_multi.patch @@ -10,7 +10,7 @@ unsigned int time_window; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -1386,6 +1386,7 @@ int hostapd_setup_bss(struct hostapd_dat +@@ -1325,6 +1325,7 @@ int hostapd_setup_bss(struct hostapd_dat struct radius_das_conf das_conf; os_memset(&das_conf, 0, sizeof(das_conf)); das_conf.port = conf->radius_das_port; diff --git a/feeds/wifi-ax/hostapd/patches/901-cfg-section.patch b/feeds/wifi-ax/hostapd/patches/901-cfg-section.patch index 7be0b33f3..b640f17db 100644 --- a/feeds/wifi-ax/hostapd/patches/901-cfg-section.patch +++ b/feeds/wifi-ax/hostapd/patches/901-cfg-section.patch @@ -21,7 +21,7 @@ --- a/src/ap/ubus.c +++ b/src/ap/ubus.c -@@ -428,6 +428,9 @@ hostapd_bss_get_status(struct ubus_conte +@@ -424,6 +424,9 @@ hostapd_bss_get_status(struct ubus_conte hapd->iface->cac_started ? hapd->iface->dfs_cac_ms / 1000 - now.sec : 0); blobmsg_close_table(&b, dfs_table); @@ -38,6 +38,6 @@ os_free(conf->rsn_preauth_interfaces); os_free(conf->ctrl_interface); + os_free(conf->uci_section); - os_free(conf->config_id); os_free(conf->ca_cert); os_free(conf->server_cert); + os_free(conf->server_cert2); diff --git a/feeds/wifi-ax/hostapd/patches/920-sta_driver_data.patch b/feeds/wifi-ax/hostapd/patches/920-sta_driver_data.patch index ea11be4a7..6bf5e5661 100644 --- a/feeds/wifi-ax/hostapd/patches/920-sta_driver_data.patch +++ b/feeds/wifi-ax/hostapd/patches/920-sta_driver_data.patch @@ -13,7 +13,7 @@ struct hostapd_sta_add_params { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -7013,6 +7013,8 @@ static int get_sta_handler(struct nl_msg +@@ -7010,6 +7010,8 @@ static int get_sta_handler(struct nl_msg [NL80211_RATE_INFO_VHT_MCS] = { .type = NLA_U8 }, [NL80211_RATE_INFO_SHORT_GI] = { .type = NLA_FLAG }, [NL80211_RATE_INFO_VHT_NSS] = { .type = NLA_U8 }, @@ -22,7 +22,7 @@ }; nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), -@@ -7105,6 +7107,10 @@ static int get_sta_handler(struct nl_msg +@@ -7102,6 +7104,10 @@ static int get_sta_handler(struct nl_msg nla_get_u8(rate[NL80211_RATE_INFO_VHT_NSS]); data->flags |= STA_DRV_DATA_TX_VHT_NSS; } @@ -33,7 +33,7 @@ } if (stats[NL80211_STA_INFO_RX_BITRATE] && -@@ -7135,11 +7141,16 @@ static int get_sta_handler(struct nl_msg +@@ -7132,11 +7138,16 @@ static int get_sta_handler(struct nl_msg nla_get_u8(rate[NL80211_RATE_INFO_VHT_NSS]); data->flags |= STA_DRV_DATA_RX_VHT_NSS; } @@ -52,7 +52,7 @@ --- a/src/ap/ubus.c +++ b/src/ap/ubus.c -@@ -310,6 +310,36 @@ hostapd_bss_get_clients(struct ubus_cont +@@ -306,6 +306,36 @@ hostapd_bss_get_clients(struct ubus_cont blobmsg_add_u32(&b, "tx", sta_driver_data.current_tx_rate * 100); blobmsg_close_table(&b, r); blobmsg_add_u32(&b, "signal", sta_driver_data.signal); diff --git a/feeds/wifi-ax/hostapd/patches/999-probe-request.patch b/feeds/wifi-ax/hostapd/patches/999-probe-request.patch index 29e0a3d29..a239c8432 100644 --- a/feeds/wifi-ax/hostapd/patches/999-probe-request.patch +++ b/feeds/wifi-ax/hostapd/patches/999-probe-request.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3344,6 +3344,8 @@ static int hostapd_config_fill(struct ho +@@ -3337,6 +3337,8 @@ static int hostapd_config_fill(struct ho bss->ignore_broadcast_ssid = atoi(pos); } else if (os_strcmp(buf, "no_probe_resp_if_max_sta") == 0) { bss->no_probe_resp_if_max_sta = atoi(pos); diff --git a/feeds/wifi-ax/hostapd/patches/999-ssi_signal.patch b/feeds/wifi-ax/hostapd/patches/999-ssi_signal.patch index 8a88b1272..bdd0a0ede 100644 --- a/feeds/wifi-ax/hostapd/patches/999-ssi_signal.patch +++ b/feeds/wifi-ax/hostapd/patches/999-ssi_signal.patch @@ -63,7 +63,7 @@ --- a/src/ap/ubus.c +++ b/src/ap/ubus.c -@@ -340,6 +340,9 @@ hostapd_bss_get_clients(struct ubus_cont +@@ -336,6 +336,9 @@ hostapd_bss_get_clients(struct ubus_cont blobmsg_add_u32(&b, "tx", sta_driver_data.tx_mcs); } blobmsg_close_table(&b, r); @@ -73,7 +73,7 @@ } hostapd_parse_capab_blobmsg(sta); -@@ -461,6 +464,9 @@ hostapd_bss_get_status(struct ubus_conte +@@ -457,6 +460,9 @@ hostapd_bss_get_status(struct ubus_conte if (hapd->conf->uci_section) blobmsg_add_string(&b, "uci_section", hapd->conf->uci_section); @@ -85,7 +85,7 @@ return 0; --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -452,6 +452,7 @@ struct hostapd_data { +@@ -451,6 +451,7 @@ struct hostapd_data { #ifdef CONFIG_CTRL_IFACE_UDP unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN]; #endif /* CONFIG_CTRL_IFACE_UDP */ diff --git a/feeds/wifi-ax/hostapd/patches/a00-004-Add-provision-to-test-RADAR-detection-probablity-in-.patch b/feeds/wifi-ax/hostapd/patches/a00-004-Add-provision-to-test-RADAR-detection-probablity-in-.patch index ca7361ef9..0b4f1c68f 100644 --- a/feeds/wifi-ax/hostapd/patches/a00-004-Add-provision-to-test-RADAR-detection-probablity-in-.patch +++ b/feeds/wifi-ax/hostapd/patches/a00-004-Add-provision-to-test-RADAR-detection-probablity-in-.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2465,6 +2465,8 @@ static int hostapd_config_fill(struct ho +@@ -2460,6 +2460,8 @@ static int hostapd_config_fill(struct ho conf->ieee80211d = atoi(pos); } else if (os_strcmp(buf, "ieee80211h") == 0) { conf->ieee80211h = atoi(pos); @@ -11,7 +11,7 @@ } else if (os_strcmp(buf, "eapol_version") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -981,6 +981,7 @@ struct hostapd_config { +@@ -979,6 +979,7 @@ struct hostapd_config { int ieee80211d; int ieee80211h; /* DFS */ @@ -143,7 +143,7 @@ int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq, --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -2901,6 +2901,7 @@ int hostapd_disable_iface(struct hostapd +@@ -2836,6 +2836,7 @@ int hostapd_disable_iface(struct hostapd hostapd_cleanup_cs_params(hapd_iface->bss[j]); #endif /* NEED_AP_MLME */ diff --git a/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch b/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch index 05490be21..8f6043d98 100644 --- a/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch +++ b/feeds/wifi-ax/hostapd/patches/b00-014-hostapd-add-ht40-allow-map.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3246,6 +3246,92 @@ set: +@@ -3184,6 +3184,92 @@ set: return ret; } @@ -93,7 +93,7 @@ static int hostapd_ctrl_iface_remove_neighbor(struct hostapd_data *hapd, char *buf) -@@ -3931,6 +4017,10 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3867,6 +3953,10 @@ static int hostapd_ctrl_iface_receive_pr if (radius_server_dac_request(hapd->radius_srv, buf + 12) < 0) reply_len = -1; #endif /* RADIUS_SERVER */ diff --git a/feeds/wifi-ax/hostapd/patches/b00-036-hostapd-disable-40mhz-scan.patch b/feeds/wifi-ax/hostapd/patches/b00-036-hostapd-disable-40mhz-scan.patch index 84645f367..6c4093aeb 100644 --- a/feeds/wifi-ax/hostapd/patches/b00-036-hostapd-disable-40mhz-scan.patch +++ b/feeds/wifi-ax/hostapd/patches/b00-036-hostapd-disable-40mhz-scan.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4338,6 +4338,8 @@ static int hostapd_config_fill(struct ho +@@ -4331,6 +4331,8 @@ static int hostapd_config_fill(struct ho } else if (os_strcmp(buf, "wowlan_triggers") == 0) { os_free(bss->wowlan_triggers); bss->wowlan_triggers = os_strdup(pos); @@ -11,7 +11,7 @@ size_t len = os_strlen(pos); --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1049,6 +1049,7 @@ struct hostapd_config { +@@ -1047,6 +1047,7 @@ struct hostapd_config { } *acs_chan_bias; unsigned int num_acs_chan_bias; #endif /* CONFIG_ACS */ diff --git a/feeds/wifi-ax/hostapd/patches/c00-010-hostapd-fix-enabling-he-in-5G.patch b/feeds/wifi-ax/hostapd/patches/c00-010-hostapd-fix-enabling-he-in-5G.patch index bd1b8ebd6..ef19fac64 100644 --- a/feeds/wifi-ax/hostapd/patches/c00-010-hostapd-fix-enabling-he-in-5G.patch +++ b/feeds/wifi-ax/hostapd/patches/c00-010-hostapd-fix-enabling-he-in-5G.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2745,7 +2745,7 @@ skip_ht40: +@@ -2692,7 +2692,7 @@ skip_ht40: if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq, freq->channel, ssid->enable_edmg, ssid->edmg_channel, freq->ht_enabled, diff --git a/feeds/wifi-ax/hostapd/patches/c00-011-hostapd-add-mbo-support.patch b/feeds/wifi-ax/hostapd/patches/c00-011-hostapd-add-mbo-support.patch index db514536d..bc68b2d05 100644 --- a/feeds/wifi-ax/hostapd/patches/c00-011-hostapd-add-mbo-support.patch +++ b/feeds/wifi-ax/hostapd/patches/c00-011-hostapd-add-mbo-support.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4172,10 +4172,12 @@ static int hostapd_config_fill(struct ho +@@ -4165,10 +4165,12 @@ static int hostapd_config_fill(struct ho #ifdef CONFIG_MBO } else if (os_strcmp(buf, "mbo") == 0) { bss->mbo_enabled = atoi(pos); @@ -17,7 +17,7 @@ #define PARSE_TEST_PROBABILITY(_val) \ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -945,10 +945,11 @@ static int hostapd_ctrl_iface_bss_tm_req +@@ -888,10 +888,11 @@ static int hostapd_ctrl_iface_bss_tm_req if (pos) { pos += 10; req_mode |= WNM_BSS_TM_REQ_BSS_TERMINATION_INCLUDED; @@ -31,7 +31,7 @@ end = os_strchr(pos, ','); if (end == NULL) { wpa_printf(MSG_DEBUG, "Invalid bss_term data"); -@@ -958,7 +959,7 @@ static int hostapd_ctrl_iface_bss_tm_req +@@ -901,7 +902,7 @@ static int hostapd_ctrl_iface_bss_tm_req WPA_PUT_LE16(&bss_term_dur[10], atoi(end)); } diff --git a/feeds/wifi-ax/hostapd/patches/d00-002-set-supp-chan-width-for-40mghz.patch b/feeds/wifi-ax/hostapd/patches/d00-002-set-supp-chan-width-for-40mghz.patch index 94c388de8..074c0075b 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-002-set-supp-chan-width-for-40mghz.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-002-set-supp-chan-width-for-40mghz.patch @@ -13,7 +13,7 @@ Signed-off-by: Lavanya Suresh --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3600,6 +3600,9 @@ static int hostapd_fill_csa_settings(str +@@ -3535,6 +3535,9 @@ static int hostapd_fill_csa_settings(str if (!iface || !iface->freq || hapd->csa_in_progress) return -1; diff --git a/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch b/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch index 69f0f921d..64b5c6aaf 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-003-wpa-supplicant-override-HE-toVHT-2G.patch @@ -10,7 +10,7 @@ * --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2521,16 +2521,14 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2468,16 +2468,14 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Allow HE on 2.4 GHz without VHT: see nl80211_put_freq_params() */ @@ -33,7 +33,7 @@ for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) { pri_chan = &mode->channels[chan_idx]; -@@ -2626,6 +2624,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2573,6 +2571,11 @@ void ibss_mesh_setup_freq(struct wpa_sup wpa_scan_results_free(scan_res); } @@ -45,7 +45,7 @@ #ifdef CONFIG_HT_OVERRIDES skip_ht40: -@@ -2658,6 +2661,11 @@ skip_ht40: +@@ -2605,6 +2608,11 @@ skip_ht40: /* Enable HE with VHT for 5 GHz */ freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; diff --git a/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch b/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch index fcb8f476f..b5e3e7c33 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-004-hostapd-Add-param-to-enable-disable-ul-mumimo.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3517,6 +3517,8 @@ static int hostapd_config_fill(struct ho +@@ -3510,6 +3510,8 @@ static int hostapd_config_fill(struct ho conf->he_phy_capab.he_su_beamformee = atoi(pos); } else if (os_strcmp(buf, "he_mu_beamformer") == 0) { conf->he_phy_capab.he_mu_beamformer = atoi(pos); @@ -37,7 +37,7 @@ conf->he_op.he_bss_color = 1; --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -903,6 +903,7 @@ struct he_phy_capabilities_info { +@@ -902,6 +902,7 @@ struct he_phy_capabilities_info { bool he_su_beamformer; bool he_su_beamformee; bool he_mu_beamformer; diff --git a/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch b/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch index f80b6b900..a3f280ef6 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch @@ -50,7 +50,7 @@ Signed-off-by: Karthikeyan Kathirvel switch (sm->key_mgmt) { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -5058,7 +5058,7 @@ static int wpa_driver_nl80211_sta_add(vo +@@ -5055,7 +5055,7 @@ static int wpa_driver_nl80211_sta_add(vo if (params->he_capab) { wpa_hexdump(MSG_DEBUG, " * he_capab", diff --git a/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch b/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch index 15964e79a..32d78c9f5 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-008-hostapd-fix-enable-40-80mhz-bandwidth-in-6Ghz.patch @@ -22,7 +22,7 @@ Signed-off-by: Pradeep Kumar Chitrapu --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -10923,7 +10923,8 @@ static int add_acs_ch_list(struct nl_msg +@@ -10920,7 +10920,8 @@ static int add_acs_ch_list(struct nl_msg * compatibility. */ if (!(freq >= 2412 && freq <= 2484) && @@ -182,7 +182,7 @@ Signed-off-by: Pradeep Kumar Chitrapu wpa_printf(MSG_DEBUG, --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -1800,6 +1800,10 @@ static int setup_interface2(struct hosta +@@ -1739,6 +1739,10 @@ static int setup_interface2(struct hosta ch_width = op_class_to_ch_width(iface->conf->op_class); hostapd_set_oper_chwidth(iface->conf, ch_width); diff --git a/feeds/wifi-ax/hostapd/patches/d00-009-hostapd-update-muedca-params.patch b/feeds/wifi-ax/hostapd/patches/d00-009-hostapd-update-muedca-params.patch index 161d83dac..5aebecba8 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-009-hostapd-update-muedca-params.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-009-hostapd-update-muedca-params.patch @@ -87,7 +87,7 @@ /** --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c -@@ -2682,6 +2682,35 @@ static void nl80211_sta_opmode_change_ev +@@ -2683,6 +2683,35 @@ static void nl80211_sta_opmode_change_ev wpa_supplicant_event(drv->ctx, EVENT_STATION_OPMODE_CHANGED, &ed); } @@ -123,7 +123,7 @@ static void nl80211_control_port_frame(struct wpa_driver_nl80211_data *drv, struct nlattr **tb) -@@ -2739,7 +2768,6 @@ nl80211_control_port_frame_tx_status(str +@@ -2740,7 +2769,6 @@ nl80211_control_port_frame_tx_status(str wpa_supplicant_event(drv->ctx, EVENT_EAPOL_TX_STATUS, &event); } @@ -131,7 +131,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, struct nlattr **tb) { -@@ -2988,6 +3016,9 @@ static void do_process_drv_event(struct +@@ -2989,6 +3017,9 @@ static void do_process_drv_event(struct tb[NL80211_ATTR_ACK], tb[NL80211_ATTR_COOKIE]); break; @@ -193,7 +193,7 @@ return "UNKNOWN"; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3659,6 +3659,10 @@ static int hostapd_fill_csa_settings(str +@@ -3594,6 +3594,10 @@ static int hostapd_fill_csa_settings(str hapd->cs_count = settings->cs_count; hapd->cs_block_tx = settings->block_tx; @@ -206,7 +206,7 @@ free_beacon_data(&settings->beacon_after); --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -1590,6 +1590,11 @@ static int hostapd_ctrl_iface_set(struct +@@ -1533,6 +1533,11 @@ static int hostapd_ctrl_iface_set(struct } else if (os_strncmp(cmd, "wme_ac_", 7) == 0 || os_strncmp(cmd, "wmm_ac_", 7) == 0) { hapd->parameter_set_count++; diff --git a/feeds/wifi-ax/hostapd/patches/d00-010-hostapd-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch b/feeds/wifi-ax/hostapd/patches/d00-010-hostapd-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch index e6ce49065..1b2c433fb 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-010-hostapd-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-010-hostapd-FILS-discovery-Unsolicited-Bcast-Probe-Resp-Support.patch @@ -264,7 +264,7 @@ Signed-off-by: Aloka Dixit ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, NULL, NULL, NULL, NULL); if (ret) { -@@ -4776,6 +4809,13 @@ static int wpa_driver_nl80211_set_ap(voi +@@ -4773,6 +4806,13 @@ static int wpa_driver_nl80211_set_ap(voi params->isolate, params->basic_rates); nl80211_set_multicast_to_unicast(bss, params->multicast_to_unicast); diff --git a/feeds/wifi-ax/hostapd/patches/d00-011-01-multiple_bssid-add-the-config-file.patch b/feeds/wifi-ax/hostapd/patches/d00-011-01-multiple_bssid-add-the-config-file.patch index 44b7a6d2a..8ba98ee21 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-011-01-multiple_bssid-add-the-config-file.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-011-01-multiple_bssid-add-the-config-file.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4692,6 +4692,8 @@ static int hostapd_config_fill(struct ho +@@ -4685,6 +4685,8 @@ static int hostapd_config_fill(struct ho } bss->mka_psk_set |= MKA_PSK_SET_CKN; #endif /* CONFIG_MACSEC */ @@ -11,7 +11,7 @@ } else if (os_strcmp(buf, "disable_11ac") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1027,6 +1027,8 @@ struct hostapd_config { +@@ -1025,6 +1025,8 @@ struct hostapd_config { u8 vht_oper_centr_freq_seg1_idx; u8 ht40_plus_minus_allowed; @@ -49,7 +49,7 @@ void hostapd_reconfig_encryption(struct hostapd_data *hapd) { if (hapd->wpa_auth) -@@ -1223,6 +1243,13 @@ int hostapd_setup_bss(struct hostapd_dat +@@ -1162,6 +1182,13 @@ int hostapd_setup_bss(struct hostapd_dat if (!first || first == -1) { u8 *addr = hapd->own_addr; @@ -63,7 +63,7 @@ if (!is_zero_ether_addr(conf->bssid)) { /* Allocate the configured BSSID. */ -@@ -1250,7 +1277,7 @@ int hostapd_setup_bss(struct hostapd_dat +@@ -1189,7 +1216,7 @@ int hostapd_setup_bss(struct hostapd_dat conf->iface, addr, hapd, &hapd->drv_priv, force_ifname, if_addr, conf->bridge[0] ? conf->bridge : NULL, @@ -74,15 +74,15 @@ hapd->interface_added = 0; --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -629,6 +629,8 @@ struct hostapd_iface { +@@ -628,6 +628,8 @@ struct hostapd_iface { int hostapd_for_each_interface(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx); +int hostapd_get_bss_index(struct hostapd_data *hapd); +struct hostapd_data * hostapd_get_primary_bss(struct hostapd_data *hapd); - int hostapd_reload_config(struct hostapd_iface *iface, int reconf); - void hostapd_reload_bss(struct hostapd_data *hapd); - void hostapd_bss_deinit(struct hostapd_data *hapd); + int hostapd_reload_config(struct hostapd_iface *iface); + void hostapd_reconfig_encryption(struct hostapd_data *hapd); + struct hostapd_data * --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c @@ -321,7 +321,7 @@ int hostapd_vlan_if_add(struct hostapd_d @@ -193,7 +193,7 @@ #ifdef CONFIG_FILS os_free(params->fd_frame_tmpl); params->fd_frame_tmpl = NULL; -@@ -1804,6 +1818,22 @@ int ieee802_11_set_beacon(struct hostapd +@@ -1809,6 +1823,22 @@ int ieee802_11_set_beacon(struct hostapd params.unsol_bcast_probe_resp_tmpl = hostapd_unsol_bcast_probe_resp(hapd, ¶ms); #endif /* CONFIG_IEEE80211AX */ @@ -320,7 +320,7 @@ ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, NULL, NULL, NULL, NULL); if (ret) { -@@ -5405,13 +5426,13 @@ const char * nl80211_iftype_str(enum nl8 +@@ -5402,13 +5423,13 @@ const char * nl80211_iftype_str(enum nl8 } } @@ -336,7 +336,7 @@ { struct nl_msg *msg; int ifidx; -@@ -5440,6 +5461,17 @@ static int nl80211_create_iface_once(str +@@ -5437,6 +5458,17 @@ static int nl80211_create_iface_once(str goto fail; } @@ -354,7 +354,7 @@ /* * Tell cfg80211 that the interface belongs to the socket that created * it, and the interface should be deleted when the socket is closed. -@@ -5497,12 +5529,15 @@ int nl80211_create_iface(struct wpa_driv +@@ -5494,12 +5526,15 @@ int nl80211_create_iface(struct wpa_driv const char *ifname, enum nl80211_iftype iftype, const u8 *addr, int wds, int (*handler)(struct nl_msg *, void *), @@ -372,7 +372,7 @@ /* if error occurred and interface exists already */ if (ret == -ENFILE && if_nametoindex(ifname)) { -@@ -5528,7 +5563,9 @@ int nl80211_create_iface(struct wpa_driv +@@ -5525,7 +5560,9 @@ int nl80211_create_iface(struct wpa_driv /* Try to create the interface again */ ret = nl80211_create_iface_once(drv, ifname, iftype, addr, @@ -383,7 +383,7 @@ } if (ret >= 0 && is_p2p_net_interface(iftype)) { -@@ -7529,7 +7566,7 @@ static int i802_set_wds_sta(void *priv, +@@ -7526,7 +7563,7 @@ static int i802_set_wds_sta(void *priv, if (!if_nametoindex(name)) { if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN, @@ -392,7 +392,7 @@ 0) return -1; if (bridge_ifname && -@@ -7874,7 +7911,9 @@ static int wpa_driver_nl80211_if_add(voi +@@ -7871,7 +7908,9 @@ static int wpa_driver_nl80211_if_add(voi void *bss_ctx, void **drv_priv, char *force_ifname, u8 *if_addr, const char *bridge, int use_existing, @@ -403,7 +403,7 @@ { enum nl80211_iftype nlmode; struct i802_bss *bss = priv; -@@ -7891,7 +7930,8 @@ static int wpa_driver_nl80211_if_add(voi +@@ -7888,7 +7927,8 @@ static int wpa_driver_nl80211_if_add(voi os_memset(&p2pdev_info, 0, sizeof(p2pdev_info)); ifidx = nl80211_create_iface(drv, ifname, nlmode, addr, 0, nl80211_wdev_handler, @@ -413,7 +413,7 @@ if (!p2pdev_info.wdev_id_set || ifidx != 0) { wpa_printf(MSG_ERROR, "nl80211: Failed to create a P2P Device interface %s", ifname); -@@ -7907,7 +7947,9 @@ static int wpa_driver_nl80211_if_add(voi +@@ -7904,7 +7944,9 @@ static int wpa_driver_nl80211_if_add(voi (long long unsigned int) p2pdev_info.wdev_id); } else { ifidx = nl80211_create_iface(drv, ifname, nlmode, addr, diff --git a/feeds/wifi-ax/hostapd/patches/d00-012a-hostapd-add-support-for-reduced-neighbour-report.patch b/feeds/wifi-ax/hostapd/patches/d00-012a-hostapd-add-support-for-reduced-neighbour-report.patch index ab89d56ba..50e831843 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-012a-hostapd-add-support-for-reduced-neighbour-report.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-012a-hostapd-add-support-for-reduced-neighbour-report.patch @@ -45,7 +45,7 @@ Signed-off-by: John Crispin #include "common/ieee802_11_defs.h" #include "common/wpa_ctrl.h" #include "common/hw_features_common.h" -@@ -1356,12 +1355,6 @@ int hostapd_setup_bss(struct hostapd_dat +@@ -1295,12 +1294,6 @@ int hostapd_setup_bss(struct hostapd_dat os_memcpy(conf->ssid.ssid, ssid, conf->ssid.ssid_len); } diff --git a/feeds/wifi-ax/hostapd/patches/d00-012b-hostapd-add-support-for-reduced-neighbour-report.patch b/feeds/wifi-ax/hostapd/patches/d00-012b-hostapd-add-support-for-reduced-neighbour-report.patch index f7a55dc08..342677a0e 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-012b-hostapd-add-support-for-reduced-neighbour-report.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-012b-hostapd-add-support-for-reduced-neighbour-report.patch @@ -18,7 +18,7 @@ Signed-off-by: John Crispin --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3157,6 +3157,7 @@ static int hostapd_ctrl_iface_set_neighb +@@ -3095,6 +3095,7 @@ static int hostapd_ctrl_iface_set_neighb u8 bssid[ETH_ALEN]; struct wpabuf *nr, *lci = NULL, *civic = NULL; int stationary = 0; @@ -26,7 +26,7 @@ Signed-off-by: John Crispin char *tmp; int ret; -@@ -3241,9 +3242,22 @@ static int hostapd_ctrl_iface_set_neighb +@@ -3179,9 +3180,22 @@ static int hostapd_ctrl_iface_set_neighb if (os_strstr(buf, "stat")) stationary = 1; diff --git a/feeds/wifi-ax/hostapd/patches/d00-012d-hostapd-add-support-for-reduced-neighbour-report.patch b/feeds/wifi-ax/hostapd/patches/d00-012d-hostapd-add-support-for-reduced-neighbour-report.patch index d48dd9f66..0dc38112a 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-012d-hostapd-add-support-for-reduced-neighbour-report.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-012d-hostapd-add-support-for-reduced-neighbour-report.patch @@ -21,7 +21,7 @@ Signed-off-by: Pradeep Kumar Chitrapu --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4701,6 +4701,8 @@ static int hostapd_config_fill(struct ho +@@ -4694,6 +4694,8 @@ static int hostapd_config_fill(struct ho #endif /* CONFIG_MACSEC */ } else if (os_strcmp(buf, "multiple_bssid") == 0) { conf->multiple_bssid = atoi(pos); @@ -49,9 +49,9 @@ Signed-off-by: Pradeep Kumar Chitrapu unsigned int unsol_bcast_probe_resp_interval; + u8 rnr_beacon; - char *config_id; }; + /** --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -1469,6 +1469,7 @@ int ieee802_11_build_ap_params(struct ho diff --git a/feeds/wifi-ax/hostapd/patches/e00-003-mesh-support-6ghz-support-in-11s-mesh.patch b/feeds/wifi-ax/hostapd/patches/e00-003-mesh-support-6ghz-support-in-11s-mesh.patch index db6267403..6a83b3000 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-003-mesh-support-6ghz-support-in-11s-mesh.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-003-mesh-support-6ghz-support-in-11s-mesh.patch @@ -15,7 +15,7 @@ ifmsh->conf = conf; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2440,7 +2440,9 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2387,7 +2387,9 @@ void ibss_mesh_setup_freq(struct wpa_sup struct hostapd_hw_modes *mode = NULL; int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, 184, 192 }; @@ -26,7 +26,7 @@ struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL; u8 channel; int i, chan_idx, ht40 = -1, res, obss_scan = !(ssid->noscan); -@@ -2448,7 +2450,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2395,7 +2397,7 @@ void ibss_mesh_setup_freq(struct wpa_sup struct hostapd_freq_params vht_freq; int chwidth, seg0, seg1; u32 vht_caps = 0; @@ -35,7 +35,7 @@ int dfs_enabled = wpa_s->conf->country[0] && (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR); -@@ -2506,9 +2508,16 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2453,9 +2455,16 @@ void ibss_mesh_setup_freq(struct wpa_sup freq->channel = channel; @@ -52,7 +52,7 @@ #ifdef CONFIG_HT_OVERRIDES if (ssid->disable_ht) { freq->ht_enabled = 0; -@@ -2645,8 +2654,6 @@ skip_ht40: +@@ -2592,8 +2601,6 @@ skip_ht40: !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_VHT_IBSS)) return; @@ -61,7 +61,7 @@ #ifdef CONFIG_VHT_OVERRIDES if (ssid->disable_vht) { freq->vht_enabled = 0; -@@ -2654,12 +2661,16 @@ skip_ht40: +@@ -2601,12 +2608,16 @@ skip_ht40: } #endif /* CONFIG_VHT_OVERRIDES */ @@ -80,7 +80,7 @@ #ifdef CONFIG_HE_OVERRIDES if (is_24ghz) -@@ -2667,16 +2678,14 @@ skip_ht40: +@@ -2614,16 +2625,14 @@ skip_ht40: #endif /* CONFIG_HE_OVERRIDES */ /* setup center_freq1, bandwidth */ @@ -101,7 +101,7 @@ struct hostapd_channel_data *chan; chan = hw_get_channel_chan(mode, i, NULL); -@@ -2692,16 +2701,20 @@ skip_ht40: +@@ -2639,16 +2648,20 @@ skip_ht40: } chwidth = CHANWIDTH_80MHZ; @@ -126,7 +126,7 @@ struct hostapd_channel_data *chan; chan = hw_get_channel_chan(mode, i, NULL); -@@ -2717,9 +2730,10 @@ skip_ht40: +@@ -2664,9 +2677,10 @@ skip_ht40: /* Found a suitable second segment for 80+80 */ chwidth = CHANWIDTH_80P80MHZ; @@ -140,7 +140,7 @@ } if (chwidth == CHANWIDTH_80P80MHZ) -@@ -2737,7 +2751,7 @@ skip_ht40: +@@ -2684,7 +2698,7 @@ skip_ht40: } } else if (ssid->max_oper_chwidth == CHANWIDTH_USE_HT) { chwidth = CHANWIDTH_USE_HT; diff --git a/feeds/wifi-ax/hostapd/patches/e00-004-hostapd-Enable-160MHz-support-for-6G-in-11s-mesh.patch b/feeds/wifi-ax/hostapd/patches/e00-004-hostapd-Enable-160MHz-support-for-6G-in-11s-mesh.patch index 23c4bc28a..d471797c0 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-004-hostapd-Enable-160MHz-support-for-6G-in-11s-mesh.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-004-hostapd-Enable-160MHz-support-for-6G-in-11s-mesh.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2430,6 +2430,22 @@ static int drv_supports_vht(struct wpa_s +@@ -2377,6 +2377,22 @@ static int drv_supports_vht(struct wpa_s return mode->vht_capab != 0; } @@ -23,7 +23,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, -@@ -2443,6 +2459,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2390,6 +2406,7 @@ void ibss_mesh_setup_freq(struct wpa_sup unsigned int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, 6035, 6115, 6195, 6275, 6355, 6435, 6515, 6595, 6675, 6755, 6835, 6915, 6995 }; @@ -31,7 +31,7 @@ struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL; u8 channel; int i, chan_idx, ht40 = -1, res, obss_scan = !(ssid->noscan); -@@ -2685,25 +2702,34 @@ skip_to_6ghz: +@@ -2632,25 +2649,34 @@ skip_to_6ghz: if (j == ARRAY_SIZE(bw80)) return; diff --git a/feeds/wifi-ax/hostapd/patches/e00-004-multiple_bssid-set-extended-capabilities.patch b/feeds/wifi-ax/hostapd/patches/e00-004-multiple_bssid-set-extended-capabilities.patch index 61e8c3a43..1b1742102 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-004-multiple_bssid-set-extended-capabilities.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-004-multiple_bssid-set-extended-capabilities.patch @@ -97,7 +97,7 @@ Signed-off-by: Aloka Dixit return 0; } -@@ -1820,22 +1846,6 @@ int ieee802_11_set_beacon(struct hostapd +@@ -1825,22 +1851,6 @@ int ieee802_11_set_beacon(struct hostapd params.unsol_bcast_probe_resp_tmpl = hostapd_unsol_bcast_probe_resp(hapd, ¶ms); #endif /* CONFIG_IEEE80211AX */ diff --git a/feeds/wifi-ax/hostapd/patches/e00-007-add-EMA-configuration-option.patch b/feeds/wifi-ax/hostapd/patches/e00-007-add-EMA-configuration-option.patch index 6647d1bb4..e7644b603 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-007-add-EMA-configuration-option.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-007-add-EMA-configuration-option.patch @@ -25,7 +25,7 @@ Signed-off-by: Aloka Dixit --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4701,6 +4701,8 @@ static int hostapd_config_fill(struct ho +@@ -4694,6 +4694,8 @@ static int hostapd_config_fill(struct ho #endif /* CONFIG_MACSEC */ } else if (os_strcmp(buf, "multiple_bssid") == 0) { conf->multiple_bssid = atoi(pos); @@ -36,7 +36,7 @@ Signed-off-by: Aloka Dixit } else if (os_strcmp(buf, "disable_11n") == 0) { --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -1489,6 +1489,12 @@ int hostapd_config_check(struct hostapd_ +@@ -1487,6 +1487,12 @@ int hostapd_config_check(struct hostapd_ return -1; } @@ -51,7 +51,7 @@ Signed-off-by: Aloka Dixit return -1; --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1029,6 +1029,7 @@ struct hostapd_config { +@@ -1027,6 +1027,7 @@ struct hostapd_config { u8 ht40_plus_minus_allowed; u8 multiple_bssid; diff --git a/feeds/wifi-ax/hostapd/patches/e00-008-multiple_bssid-DTIM-setting.patch b/feeds/wifi-ax/hostapd/patches/e00-008-multiple_bssid-DTIM-setting.patch index 0b8a198b5..038ecb78a 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-008-multiple_bssid-DTIM-setting.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-008-multiple_bssid-DTIM-setting.patch @@ -43,7 +43,7 @@ Signed-off-by: Aloka Dixit return 0; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -1203,11 +1203,52 @@ static int db_table_create_radius_attrib +@@ -1142,11 +1142,52 @@ static int db_table_create_radius_attrib #endif /* CONFIG_NO_RADIUS */ @@ -96,7 +96,7 @@ Signed-off-by: Aloka Dixit * * This function is used to initialize all per-BSS data structures and * resources. This gets called in a loop for each BSS when an interface is -@@ -1503,32 +1544,8 @@ int hostapd_setup_bss(struct hostapd_dat +@@ -1442,32 +1483,8 @@ int hostapd_setup_bss(struct hostapd_dat return -1; } @@ -131,7 +131,7 @@ Signed-off-by: Aloka Dixit return 0; } -@@ -2223,7 +2240,8 @@ static int hostapd_setup_interface_compl +@@ -2162,7 +2179,8 @@ static int hostapd_setup_interface_compl hapd = iface->bss[j]; if (j) os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); @@ -141,7 +141,7 @@ Signed-off-by: Aloka Dixit for (;;) { hapd = iface->bss[j]; hostapd_bss_deinit_no_free(hapd); -@@ -2237,6 +2255,24 @@ static int hostapd_setup_interface_compl +@@ -2176,6 +2194,24 @@ static int hostapd_setup_interface_compl if (is_zero_ether_addr(hapd->conf->bssid)) prev_addr = hapd->own_addr; } @@ -166,7 +166,7 @@ Signed-off-by: Aloka Dixit hapd = iface->bss[0]; hostapd_tx_queue_params(iface); -@@ -3123,7 +3159,7 @@ int hostapd_add_iface(struct hapd_interf +@@ -3058,7 +3094,7 @@ int hostapd_add_iface(struct hapd_interf if (start_ctrl_iface_bss(hapd) < 0 || (hapd_iface->state == HAPD_IFACE_ENABLED && diff --git a/feeds/wifi-ax/hostapd/patches/e00-011-6ghz-out-of-band-advertisements.patch b/feeds/wifi-ax/hostapd/patches/e00-011-6ghz-out-of-band-advertisements.patch index 72e91b3dd..ec207820a 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-011-6ghz-out-of-band-advertisements.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-011-6ghz-out-of-band-advertisements.patch @@ -15,7 +15,7 @@ Signed-off-by: John Crispin --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3671,6 +3671,8 @@ static int hostapd_config_fill(struct ho +@@ -3664,6 +3664,8 @@ static int hostapd_config_fill(struct ho return 1; } bss->unsol_bcast_probe_resp_interval = val; @@ -38,7 +38,7 @@ Signed-off-by: John Crispin # ieee80211n: Whether IEEE 802.11n (HT) is enabled --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1078,6 +1078,7 @@ struct hostapd_config { +@@ -1076,6 +1076,7 @@ struct hostapd_config { u8 he_6ghz_max_ampdu_len_exp; u8 he_6ghz_rx_ant_pat; u8 he_6ghz_tx_ant_pat; diff --git a/feeds/wifi-ax/hostapd/patches/f00-001-bss-coloring-add-support-for-handling-collision-events-and-triggering-CCA.patch b/feeds/wifi-ax/hostapd/patches/f00-001-bss-coloring-add-support-for-handling-collision-events-and-triggering-CCA.patch index 099a8abb2..913b0cb3f 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-001-bss-coloring-add-support-for-handling-collision-events-and-triggering-CCA.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-001-bss-coloring-add-support-for-handling-collision-events-and-triggering-CCA.patch @@ -47,7 +47,7 @@ Signed-off-by: John Crispin int hostapd_for_each_interface(struct hapd_interfaces *interfaces, -@@ -568,6 +570,9 @@ void hostapd_free_hapd_data(struct hosta +@@ -507,6 +509,9 @@ void hostapd_free_hapd_data(struct hosta } eloop_cancel_timeout(auth_sae_process_commit, hapd, NULL); #endif /* CONFIG_SAE */ @@ -57,7 +57,7 @@ Signed-off-by: John Crispin } -@@ -3850,6 +3855,119 @@ hostapd_switch_channel_fallback(struct h +@@ -3785,6 +3790,119 @@ hostapd_switch_channel_fallback(struct h hostapd_enable_iface(iface); } @@ -179,7 +179,7 @@ Signed-off-by: John Crispin --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -321,6 +321,16 @@ struct hostapd_data { +@@ -320,6 +320,16 @@ struct hostapd_data { unsigned int cs_c_off_ecsa_beacon; unsigned int cs_c_off_ecsa_proberesp; @@ -196,7 +196,7 @@ Signed-off-by: John Crispin #ifdef CONFIG_P2P struct p2p_data *p2p; struct p2p_group *p2p_group; -@@ -681,6 +691,12 @@ int hostapd_owe_trans_get_info(struct ho +@@ -679,6 +689,12 @@ int hostapd_owe_trans_get_info(struct ho void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx); int hostapd_check_max_sta(struct hostapd_data *hapd); diff --git a/feeds/wifi-ax/hostapd/patches/f00-002-hostap-Move-acl-related-code-to-generic-to-be-used-for-mesh.patch b/feeds/wifi-ax/hostapd/patches/f00-002-hostap-Move-acl-related-code-to-generic-to-be-used-for-mesh.patch index c2e3534cb..416b72e49 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-002-hostap-Move-acl-related-code-to-generic-to-be-used-for-mesh.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-002-hostap-Move-acl-related-code-to-generic-to-be-used-for-mesh.patch @@ -168,7 +168,7 @@ Signed-off-by: Nishant Pandey #endif /* CONFIG_FILE_H */ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -1420,42 +1420,6 @@ static int hostapd_ctrl_iface_get_config +@@ -1363,42 +1363,6 @@ static int hostapd_ctrl_iface_get_config } @@ -211,7 +211,7 @@ Signed-off-by: Nishant Pandey static int hostapd_ctrl_iface_set_band(struct hostapd_data *hapd, const char *bands) -@@ -3435,81 +3399,6 @@ static int hostapd_ctrl_driver_flags2(st +@@ -3373,81 +3337,6 @@ static int hostapd_ctrl_driver_flags2(st return pos - buf; } diff --git a/feeds/wifi-ax/hostapd/patches/f00-003-Extend-acl-config-support-to-mesh.patch b/feeds/wifi-ax/hostapd/patches/f00-003-Extend-acl-config-support-to-mesh.patch index 077900379..5fefe94a8 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-003-Extend-acl-config-support-to-mesh.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-003-Extend-acl-config-support-to-mesh.patch @@ -81,7 +81,7 @@ Signed-off-by: Nishant Pandey #include "uuid.h" #include "common/ieee802_1x_defs.h" #include "p2p/p2p.h" -@@ -818,6 +821,9 @@ static void wpa_config_write_network(FIL +@@ -823,6 +826,9 @@ static void wpa_config_write_network(FIL write_int(f, "mac_addr", ssid->mac_addr, -1); #ifdef CONFIG_MESH STR(mesh_basic_rates); diff --git a/feeds/wifi-ax/hostapd/patches/f00-004-bss-coloring-add-the-switch_color-handler-to-the-nl80211-driver.patch b/feeds/wifi-ax/hostapd/patches/f00-004-bss-coloring-add-the-switch_color-handler-to-the-nl80211-driver.patch index 91a99c8cd..62134ff98 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-004-bss-coloring-add-the-switch_color-handler-to-the-nl80211-driver.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-004-bss-coloring-add-the-switch_color-handler-to-the-nl80211-driver.patch @@ -15,7 +15,7 @@ Signed-off-by: John Crispin --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9961,6 +9961,82 @@ error: +@@ -9958,6 +9958,82 @@ error: } @@ -98,7 +98,7 @@ Signed-off-by: John Crispin static int nl80211_add_ts(void *priv, u8 tsid, const u8 *addr, u8 user_priority, u16 admitted_time) { -@@ -12121,6 +12197,9 @@ const struct wpa_driver_ops wpa_driver_n +@@ -12118,6 +12194,9 @@ const struct wpa_driver_ops wpa_driver_n .get_survey = wpa_driver_nl80211_get_survey, .status = wpa_driver_nl80211_status, .switch_channel = nl80211_switch_channel, diff --git a/feeds/wifi-ax/hostapd/patches/f00-005-bss-coloring-handle-the-collision-and-CCA-events-coming-from-the-kernel.patch b/feeds/wifi-ax/hostapd/patches/f00-005-bss-coloring-handle-the-collision-and-CCA-events-coming-from-the-kernel.patch index 1cc0018b0..96fb973b0 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-005-bss-coloring-handle-the-collision-and-CCA-events-coming-from-the-kernel.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-005-bss-coloring-handle-the-collision-and-CCA-events-coming-from-the-kernel.patch @@ -153,7 +153,7 @@ Signed-off-by: John Crispin default: return "NL80211_CMD_UNKNOWN"; } -@@ -2745,6 +2748,51 @@ static void nl80211_control_port_frame(s +@@ -2746,6 +2749,51 @@ static void nl80211_control_port_frame(s } } @@ -205,7 +205,7 @@ Signed-off-by: John Crispin static void nl80211_control_port_frame_tx_status(struct wpa_driver_nl80211_data *drv, -@@ -3019,6 +3067,20 @@ static void do_process_drv_event(struct +@@ -3020,6 +3068,20 @@ static void do_process_drv_event(struct case NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS: nl80211_update_muedca_params_event(drv, tb); break; diff --git a/feeds/wifi-ax/hostapd/patches/f00-006-bss_coloring-allow-using-a-random-starting-color.patch b/feeds/wifi-ax/hostapd/patches/f00-006-bss_coloring-allow-using-a-random-starting-color.patch index 5c818435f..296bfcd20 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-006-bss_coloring-allow-using-a-random-starting-color.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-006-bss_coloring-allow-using-a-random-starting-color.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3412,8 +3412,11 @@ static int hostapd_config_fill(struct ho +@@ -3405,8 +3405,11 @@ static int hostapd_config_fill(struct ho } else if (os_strcmp(buf, "he_ul_mumimo") == 0) { conf->he_phy_capab.he_ul_mumimo = atoi(pos); } else if (os_strcmp(buf, "he_bss_color") == 0) { diff --git a/feeds/wifi-ax/hostapd/patches/f00-007-bss_coloring-add-intelligence-color-choose-in-CCA.patch b/feeds/wifi-ax/hostapd/patches/f00-007-bss_coloring-add-intelligence-color-choose-in-CCA.patch index 556a0244b..d15dded0b 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-007-bss_coloring-add-intelligence-color-choose-in-CCA.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-007-bss_coloring-add-intelligence-color-choose-in-CCA.patch @@ -95,7 +95,7 @@ Signed-off-by: Karthikeyan Periyasamy #endif /* AP_LIST_H */ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3906,6 +3906,7 @@ hostapd_switch_color_timeout_handler(voi +@@ -3841,6 +3841,7 @@ hostapd_switch_color_timeout_handler(voi struct cca_settings settings; struct os_time now; int i, r, b, ret; @@ -103,7 +103,7 @@ Signed-off-by: Karthikeyan Periyasamy if (os_get_time(&now)) return; -@@ -3914,11 +3915,16 @@ hostapd_switch_color_timeout_handler(voi +@@ -3849,11 +3850,16 @@ hostapd_switch_color_timeout_handler(voi if (now.sec - hapd->last_color_collision.sec > 50) return; diff --git a/feeds/wifi-ax/hostapd/patches/f00-008-bss_coloring_add_support_to_change_bss_color_by_user.patch b/feeds/wifi-ax/hostapd/patches/f00-008-bss_coloring_add_support_to_change_bss_color_by_user.patch index 8634c5f35..eb1d85af1 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-008-bss_coloring_add_support_to_change_bss_color_by_user.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-008-bss_coloring_add_support_to_change_bss_color_by_user.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2679,6 +2679,59 @@ static int hostapd_ctrl_check_freq_param +@@ -2622,6 +2622,59 @@ static int hostapd_ctrl_check_freq_param } #endif /* NEED_AP_MLME */ @@ -60,7 +60,7 @@ static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, char *pos) -@@ -3688,6 +3741,9 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3626,6 +3679,9 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) { if (hostapd_ctrl_iface_chan_switch(hapd->iface, buf + 12)) reply_len = -1; @@ -128,7 +128,7 @@ len += ret; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3477,7 +3477,7 @@ int hostapd_csa_in_progress(struct hosta +@@ -3412,7 +3412,7 @@ int hostapd_csa_in_progress(struct hosta #ifdef NEED_AP_MLME @@ -137,7 +137,7 @@ { os_free(beacon->head); beacon->head = NULL; -@@ -3867,7 +3867,7 @@ void hostapd_cleanup_cca_params(struct h +@@ -3802,7 +3802,7 @@ void hostapd_cleanup_cca_params(struct h } @@ -148,7 +148,7 @@ struct hostapd_iface *iface = hapd->iface; --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -690,11 +690,13 @@ void hostapd_periodic_iface(struct hosta +@@ -688,11 +688,13 @@ void hostapd_periodic_iface(struct hosta int hostapd_owe_trans_get_info(struct hostapd_data *hapd); void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx); int hostapd_check_max_sta(struct hostapd_data *hapd); diff --git a/feeds/wifi-ax/hostapd/patches/f00-009-add-bcca-IE-with-countdown-zero-in-color-change-beacon.patch b/feeds/wifi-ax/hostapd/patches/f00-009-add-bcca-IE-with-countdown-zero-in-color-change-beacon.patch index 131506949..eb63ae94b 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-009-add-bcca-IE-with-countdown-zero-in-color-change-beacon.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-009-add-bcca-IE-with-countdown-zero-in-color-change-beacon.patch @@ -52,7 +52,7 @@ Signed-off-by: Lavanya Suresh wpa_printf(MSG_DEBUG, "CCA aborted on %s for cca_color: %d", hapd->conf->iface, hapd->cca_color); --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3879,12 +3879,18 @@ int hostapd_fill_cca_settings(struct hos +@@ -3814,12 +3814,18 @@ int hostapd_fill_cca_settings(struct hos old_color = iface->conf->he_op.he_bss_color; iface->conf->he_op.he_bss_color = hapd->cca_color; @@ -75,7 +75,7 @@ Signed-off-by: Lavanya Suresh if (ret) { --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -323,6 +323,7 @@ struct hostapd_data { +@@ -322,6 +322,7 @@ struct hostapd_data { #ifdef CONFIG_IEEE80211AX int cca_in_progress; diff --git a/feeds/wifi-ax/hostapd/patches/f00-010-bss_coloring-check-free-color-periodically.patch b/feeds/wifi-ax/hostapd/patches/f00-010-bss_coloring-check-free-color-periodically.patch index 9c83f8613..712c2794f 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-010-bss_coloring-check-free-color-periodically.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-010-bss_coloring-check-free-color-periodically.patch @@ -15,7 +15,7 @@ Signed-off-by: Lavanya Suresh --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3918,11 +3918,12 @@ hostapd_switch_color_timeout_handler(voi +@@ -3853,11 +3853,12 @@ hostapd_switch_color_timeout_handler(voi return; /* check if there has been a recent collision */ @@ -30,7 +30,7 @@ Signed-off-by: Lavanya Suresh r = os_random() % HE_OPERATION_BSS_COLOR_MAX - 1; r++; -@@ -3934,13 +3935,26 @@ hostapd_switch_color_timeout_handler(voi +@@ -3869,13 +3870,26 @@ hostapd_switch_color_timeout_handler(voi } if (i == HE_OPERATION_BSS_COLOR_MAX) { /* there are no free colors so turn bss coloring off */ @@ -60,7 +60,7 @@ Signed-off-by: Lavanya Suresh --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -324,6 +324,7 @@ struct hostapd_data { +@@ -323,6 +323,7 @@ struct hostapd_data { #ifdef CONFIG_IEEE80211AX int cca_in_progress; int cca_zero_count; diff --git a/feeds/wifi-ax/hostapd/patches/g00-001-multiple_bssid-add-support.patch b/feeds/wifi-ax/hostapd/patches/g00-001-multiple_bssid-add-support.patch index 10a2ce1e0..9064d80d1 100644 --- a/feeds/wifi-ax/hostapd/patches/g00-001-multiple_bssid-add-support.patch +++ b/feeds/wifi-ax/hostapd/patches/g00-001-multiple_bssid-add-support.patch @@ -25,7 +25,7 @@ Signed-off-by: John Crispin --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4591,8 +4591,8 @@ static int hostapd_config_fill(struct ho +@@ -4584,8 +4584,8 @@ static int hostapd_config_fill(struct ho #endif /* CONFIG_MACSEC */ } else if (os_strcmp(buf, "multiple_bssid") == 0) { conf->multiple_bssid = atoi(pos); @@ -38,7 +38,7 @@ Signed-off-by: John Crispin } else if (os_strcmp(buf, "disable_11n") == 0) { --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2827,6 +2827,9 @@ static int hostapd_ctrl_iface_chan_switc +@@ -2765,6 +2765,9 @@ static int hostapd_ctrl_iface_chan_switc * submitting multi-BSS CSA requests? */ return ret; } @@ -50,7 +50,7 @@ Signed-off-by: John Crispin return 0; --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -1489,7 +1489,7 @@ int hostapd_config_check(struct hostapd_ +@@ -1487,7 +1487,7 @@ int hostapd_config_check(struct hostapd_ return -1; } @@ -61,7 +61,7 @@ Signed-off-by: John Crispin return -1; --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1029,7 +1029,7 @@ struct hostapd_config { +@@ -1027,7 +1027,7 @@ struct hostapd_config { u8 ht40_plus_minus_allowed; u8 multiple_bssid; @@ -200,7 +200,7 @@ Signed-off-by: John Crispin } if (params->multiple_bssid_ie_len) { -@@ -5461,17 +5471,6 @@ static int nl80211_create_iface_once(str +@@ -5458,17 +5468,6 @@ static int nl80211_create_iface_once(str goto fail; } diff --git a/feeds/wifi-ax/hostapd/patches/g00-002-fixes-in-EMA-beacon-transmission-offload.patch b/feeds/wifi-ax/hostapd/patches/g00-002-fixes-in-EMA-beacon-transmission-offload.patch index 3ca98da24..156be1469 100644 --- a/feeds/wifi-ax/hostapd/patches/g00-002-fixes-in-EMA-beacon-transmission-offload.patch +++ b/feeds/wifi-ax/hostapd/patches/g00-002-fixes-in-EMA-beacon-transmission-offload.patch @@ -22,7 +22,7 @@ Signed-off-by: Aloka Dixit --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2827,9 +2827,6 @@ static int hostapd_ctrl_iface_chan_switc +@@ -2765,9 +2765,6 @@ static int hostapd_ctrl_iface_chan_switc * submitting multi-BSS CSA requests? */ return ret; } diff --git a/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-Enable-HE40-support-in-2G-11s-mesh.patch b/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-Enable-HE40-support-in-2G-11s-mesh.patch index b77771f4d..7206552a6 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-Enable-HE40-support-in-2G-11s-mesh.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-Enable-HE40-support-in-2G-11s-mesh.patch @@ -14,7 +14,7 @@ Signed-off-by: P Praneesh --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2431,6 +2431,57 @@ static int drv_supports_vht(struct wpa_s +@@ -2378,6 +2378,57 @@ static int drv_supports_vht(struct wpa_s return mode->vht_capab != 0; } @@ -72,7 +72,7 @@ Signed-off-by: P Praneesh static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode) { int i; -@@ -2555,6 +2606,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2502,6 +2553,11 @@ void ibss_mesh_setup_freq(struct wpa_sup else #endif /* CONFIG_HE_OVERRIDES */ freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; @@ -110,7 +110,7 @@ Signed-off-by: P Praneesh #undef OFFSET --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c -@@ -887,7 +887,7 @@ static void wpa_config_write_network(FIL +@@ -892,7 +892,7 @@ static void wpa_config_write_network(FIL #ifdef CONFIG_HE_OVERRIDES INT(disable_he); #endif /* CONFIG_HE_OVERRIDES */ diff --git a/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-disable-HE-when-wmm-is-not-enabled.patch b/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-disable-HE-when-wmm-is-not-enabled.patch index ba47d624a..621683cec 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-disable-HE-when-wmm-is-not-enabled.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-002-hostapd-disable-HE-when-wmm-is-not-enabled.patch @@ -25,7 +25,7 @@ Signed-off-by: Lavanya Suresh --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -1239,6 +1239,9 @@ static int hostapd_config_check_bss(stru +@@ -1237,6 +1237,9 @@ static int hostapd_config_check_bss(stru } #endif /* CONFIG_WEP */ @@ -37,7 +37,7 @@ Signed-off-by: Lavanya Suresh bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) { --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -130,7 +130,7 @@ void hostapd_reload_bss(struct hostapd_d +@@ -130,7 +130,7 @@ static void hostapd_reload_bss(struct ho return; if (hapd->conf->wmm_enabled < 0) @@ -46,7 +46,7 @@ Signed-off-by: Lavanya Suresh #ifndef CONFIG_NO_RADIUS radius_client_reconfig(hapd->radius, hapd->conf->radius); -@@ -1350,7 +1350,7 @@ int hostapd_setup_bss(struct hostapd_dat +@@ -1289,7 +1289,7 @@ int hostapd_setup_bss(struct hostapd_dat } if (conf->wmm_enabled < 0) diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-08-hostapd-Update-2.4-5GHz-beacons-when-6GHz-AP-comes-u.patch b/feeds/wifi-ax/hostapd/patches/h00-003-08-hostapd-Update-2.4-5GHz-beacons-when-6GHz-AP-comes-u.patch index ef2f05f7b..566acca98 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-003-08-hostapd-Update-2.4-5GHz-beacons-when-6GHz-AP-comes-u.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-003-08-hostapd-Update-2.4-5GHz-beacons-when-6GHz-AP-comes-u.patch @@ -29,7 +29,7 @@ Signed-off-by: Aloka Dixit { struct wpa_driver_ap_params params; struct hostapd_freq_params freq; -@@ -1963,12 +1963,47 @@ int ieee802_11_set_beacon(struct hostapd +@@ -1968,12 +1968,47 @@ int ieee802_11_set_beacon(struct hostapd wpa_printf(MSG_ERROR, "Failed to set beacon parameters"); else ret = 0; diff --git a/feeds/wifi-ax/hostapd/patches/h00-004-hostapd-Add-support-for-beacon-tx-mode.patch b/feeds/wifi-ax/hostapd/patches/h00-004-hostapd-Add-support-for-beacon-tx-mode.patch index 31879b434..2c87b2d5e 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-004-hostapd-Add-support-for-beacon-tx-mode.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-004-hostapd-Add-support-for-beacon-tx-mode.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4601,6 +4601,15 @@ static int hostapd_config_fill(struct ho +@@ -4594,6 +4594,15 @@ static int hostapd_config_fill(struct ho bss->disable_11ac = !!atoi(pos); } else if (os_strcmp(buf, "disable_11ax") == 0) { bss->disable_11ax = !!atoi(pos); @@ -23,9 +23,9 @@ unsigned int unsol_bcast_probe_resp_interval; u8 rnr_beacon; + int beacon_tx_mode; - char *config_id; }; + /** --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -1863,6 +1863,8 @@ int ieee802_11_build_ap_params(struct ho @@ -95,7 +95,7 @@ goto fail; if (params->proberesp && params->proberesp_len) { wpa_hexdump(MSG_DEBUG, "nl80211: proberesp (offload)", -@@ -10674,7 +10677,9 @@ static int nl80211_join_mesh(struct i802 +@@ -10671,7 +10674,9 @@ static int nl80211_join_mesh(struct i802 nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || nl80211_put_beacon_int(msg, params->beacon_int) || nl80211_put_mcast_rate(msg, params->mcast_rate) || @@ -174,7 +174,7 @@ --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c -@@ -888,6 +888,7 @@ static void wpa_config_write_network(FIL +@@ -893,6 +893,7 @@ static void wpa_config_write_network(FIL INT(disable_he); #endif /* CONFIG_HE_OVERRIDES */ INT(disable_40mhz_scan); diff --git a/feeds/wifi-ax/hostapd/patches/h00-007-hostapd-Setting-Spectrum-Management-bit-for-chan-swi.patch b/feeds/wifi-ax/hostapd/patches/h00-007-hostapd-Setting-Spectrum-Management-bit-for-chan-swi.patch index 4f458afa1..3a9c65a0b 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-007-hostapd-Setting-Spectrum-Management-bit-for-chan-swi.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-007-hostapd-Setting-Spectrum-Management-bit-for-chan-swi.patch @@ -25,7 +25,7 @@ Signed-off-by: Muna Sinada conf->wmm_ac_params[0] = ac_be; conf->wmm_ac_params[1] = ac_bk; -@@ -1474,7 +1476,7 @@ int hostapd_config_check(struct hostapd_ +@@ -1472,7 +1474,7 @@ int hostapd_config_check(struct hostapd_ return -1; } diff --git a/feeds/wifi-ax/hostapd/patches/h00-008-c-add-support-for-6ghz-tpc.patch b/feeds/wifi-ax/hostapd/patches/h00-008-c-add-support-for-6ghz-tpc.patch index bc5111495..af316f194 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-008-c-add-support-for-6ghz-tpc.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-008-c-add-support-for-6ghz-tpc.patch @@ -18,7 +18,7 @@ Signed-off-by: Pradeep Kumar Chitrapu --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3535,6 +3535,8 @@ static int hostapd_config_fill(struct ho +@@ -3528,6 +3528,8 @@ static int hostapd_config_fill(struct ho line, pos); return 1; } @@ -45,7 +45,7 @@ Signed-off-by: Pradeep Kumar Chitrapu # ieee80211n: Whether IEEE 802.11n (HT) is enabled --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1081,6 +1081,9 @@ struct hostapd_config { +@@ -1079,6 +1079,9 @@ struct hostapd_config { u8 he_6ghz_rx_ant_pat; u8 he_6ghz_tx_ant_pat; bool he_co_locate; @@ -55,7 +55,7 @@ Signed-off-by: Pradeep Kumar Chitrapu #endif /* CONFIG_IEEE80211AX */ /* VHT enable/disable config from CHAN_SWITCH */ -@@ -1110,6 +1113,15 @@ struct hostapd_config { +@@ -1108,6 +1111,15 @@ struct hostapd_config { #endif /* CONFIG_AIRTIME_POLICY */ }; diff --git a/feeds/wifi-ax/hostapd/patches/h00-008-e-Fill-6G-TPE-IE-for-non-US-countries.patch b/feeds/wifi-ax/hostapd/patches/h00-008-e-Fill-6G-TPE-IE-for-non-US-countries.patch index b8d2b6de0..7c69c3a8f 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-008-e-Fill-6G-TPE-IE-for-non-US-countries.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-008-e-Fill-6G-TPE-IE-for-non-US-countries.patch @@ -22,7 +22,7 @@ Signed-off-by: Lavanya Suresh --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1083,6 +1083,7 @@ struct hostapd_config { +@@ -1081,6 +1081,7 @@ struct hostapd_config { bool he_co_locate; #define AP_TYPE_6GHZ_INDOOR_AP 0 #define AP_TYPE_6GHZ_STANDARD_POWER_AP 1 diff --git a/feeds/wifi-ax/hostapd/patches/i00-001-compile-fix.patch b/feeds/wifi-ax/hostapd/patches/i00-001-compile-fix.patch index 67c86345c..fdff4edbf 100644 --- a/feeds/wifi-ax/hostapd/patches/i00-001-compile-fix.patch +++ b/feeds/wifi-ax/hostapd/patches/i00-001-compile-fix.patch @@ -11,7 +11,7 @@ Signed-off-by: Tamizh Chelvam --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -5171,7 +5171,7 @@ static int wpa_driver_nl80211_sta_add(vo +@@ -5168,7 +5168,7 @@ static int wpa_driver_nl80211_sta_add(vo if (params->he_6ghz_capab) { wpa_hexdump(MSG_DEBUG, " * he_6ghz_capab", diff --git a/feeds/wifi-ax/hostapd/patches/j00-001-hostapd-update-missing-5.9GHz-channels.patch b/feeds/wifi-ax/hostapd/patches/j00-001-hostapd-update-missing-5.9GHz-channels.patch index 60cd7c62f..5de0d07d1 100644 --- a/feeds/wifi-ax/hostapd/patches/j00-001-hostapd-update-missing-5.9GHz-channels.patch +++ b/feeds/wifi-ax/hostapd/patches/j00-001-hostapd-update-missing-5.9GHz-channels.patch @@ -11,7 +11,7 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2507,8 +2507,8 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2454,8 +2454,8 @@ void ibss_mesh_setup_freq(struct wpa_sup enum hostapd_hw_mode hw_mode; struct hostapd_hw_modes *mode = NULL; int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, diff --git a/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-cli-allowed-bw-on-each-channel.patch b/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-cli-allowed-bw-on-each-channel.patch index 209ad266a..adfbb4997 100644 --- a/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-cli-allowed-bw-on-each-channel.patch +++ b/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-cli-allowed-bw-on-each-channel.patch @@ -11,7 +11,7 @@ Signed-off-by: Hari Chandrakanthan --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3283,75 +3283,202 @@ set: +@@ -3221,75 +3221,202 @@ set: return ret; } @@ -262,7 +262,7 @@ Signed-off-by: Hari Chandrakanthan { struct hostapd_data *hapd = iface->bss[0]; struct hostapd_hw_modes *mode; -@@ -3363,11 +3490,12 @@ static int hostapd_ctrl_iface_ht40_allow +@@ -3301,11 +3428,12 @@ static int hostapd_ctrl_iface_ht40_allow &dfs_domain); if (mode->mode != HOSTAPD_MODE_IEEE80211A) @@ -277,7 +277,7 @@ Signed-off-by: Hari Chandrakanthan } static int hostapd_ctrl_iface_remove_neighbor(struct hostapd_data *hapd, -@@ -3982,10 +4110,9 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3918,10 +4046,9 @@ static int hostapd_ctrl_iface_receive_pr if (radius_server_dac_request(hapd->radius_srv, buf + 12) < 0) reply_len = -1; #endif /* RADIUS_SERVER */ diff --git a/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-macsec-support-gcmaes256-cipher-suite-when-participant-act-as-key-server.patch b/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-macsec-support-gcmaes256-cipher-suite-when-participant-act-as-key-server.patch index 915f4a49d..4dfabc30f 100644 --- a/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-macsec-support-gcmaes256-cipher-suite-when-participant-act-as-key-server.patch +++ b/feeds/wifi-ax/hostapd/patches/k00-001-hostapd-macsec-support-gcmaes256-cipher-suite-when-participant-act-as-key-server.patch @@ -19,7 +19,7 @@ Signed-off-by: leiwei --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4561,6 +4561,16 @@ static int hostapd_config_fill(struct ho +@@ -4554,6 +4554,16 @@ static int hostapd_config_fill(struct ho return 1; } bss->mka_priority = mka_priority; diff --git a/feeds/wifi-ax/hostapd/patches/k00-002-hostapd-Fix-channel-switch-on-6g.patch b/feeds/wifi-ax/hostapd/patches/k00-002-hostapd-Fix-channel-switch-on-6g.patch index e6a5a10fa..337c77ada 100644 --- a/feeds/wifi-ax/hostapd/patches/k00-002-hostapd-Fix-channel-switch-on-6g.patch +++ b/feeds/wifi-ax/hostapd/patches/k00-002-hostapd-Fix-channel-switch-on-6g.patch @@ -18,7 +18,7 @@ Signed-off-by: Anilkumar Kolli --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2591,6 +2591,16 @@ static int hostapd_ctrl_get_pmk(struct h +@@ -2534,6 +2534,16 @@ static int hostapd_ctrl_get_pmk(struct h #ifdef NEED_AP_MLME static int hostapd_ctrl_check_freq_params(struct hostapd_freq_params *params) { diff --git a/feeds/wifi-ax/hostapd/patches/l00-002-hostapd-fix-enabling-HE-thru-cli-in-2ghz.patch b/feeds/wifi-ax/hostapd/patches/l00-002-hostapd-fix-enabling-HE-thru-cli-in-2ghz.patch index 6fffc91cc..faa91342e 100644 --- a/feeds/wifi-ax/hostapd/patches/l00-002-hostapd-fix-enabling-HE-thru-cli-in-2ghz.patch +++ b/feeds/wifi-ax/hostapd/patches/l00-002-hostapd-fix-enabling-HE-thru-cli-in-2ghz.patch @@ -16,7 +16,7 @@ Signed-off-by: Karthikeyan Kathirvel --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4980,7 +4980,7 @@ static int nl80211_put_freq_params(struc +@@ -4977,7 +4977,7 @@ static int nl80211_put_freq_params(struc nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ2, freq->center_freq2))) return -ENOBUFS; diff --git a/feeds/wifi-ax/hostapd/patches/m00-001-hostap-Avoid-adjacent-channel-selection-in-DFS-for-q.patch b/feeds/wifi-ax/hostapd/patches/m00-001-hostap-Avoid-adjacent-channel-selection-in-DFS-for-q.patch index f90496f52..4fae3e4db 100644 --- a/feeds/wifi-ax/hostapd/patches/m00-001-hostap-Avoid-adjacent-channel-selection-in-DFS-for-q.patch +++ b/feeds/wifi-ax/hostapd/patches/m00-001-hostap-Avoid-adjacent-channel-selection-in-DFS-for-q.patch @@ -18,7 +18,7 @@ Signed-off-by: Seevalamuthu Mariappan --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3378,6 +3378,8 @@ static int hostapd_config_fill(struct ho +@@ -3371,6 +3371,8 @@ static int hostapd_config_fill(struct ho conf->require_ht = atoi(pos); } else if (os_strcmp(buf, "obss_interval") == 0) { conf->obss_interval = atoi(pos); @@ -29,7 +29,7 @@ Signed-off-by: Seevalamuthu Mariappan conf->ieee80211ac = atoi(pos); --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1042,6 +1042,7 @@ struct hostapd_config { +@@ -1040,6 +1040,7 @@ struct hostapd_config { /* Use driver-generated interface addresses when adding multiple BSSs */ u8 use_driver_iface_addr; diff --git a/feeds/wifi-ax/hostapd/patches/n00-001-RADIUS-ACL-PSK-check-during-4-way-handshake.patch b/feeds/wifi-ax/hostapd/patches/n00-001-RADIUS-ACL-PSK-check-during-4-way-handshake.patch index 7d6ea78e1..efcbe17f9 100644 --- a/feeds/wifi-ax/hostapd/patches/n00-001-RADIUS-ACL-PSK-check-during-4-way-handshake.patch +++ b/feeds/wifi-ax/hostapd/patches/n00-001-RADIUS-ACL-PSK-check-during-4-way-handshake.patch @@ -28,7 +28,7 @@ Signed-off-by: Jouni Malinen --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2865,7 +2865,8 @@ static int hostapd_config_fill(struct ho +@@ -2860,7 +2860,8 @@ static int hostapd_config_fill(struct ho bss->wpa_psk_radius = atoi(pos); if (bss->wpa_psk_radius != PSK_RADIUS_IGNORED && bss->wpa_psk_radius != PSK_RADIUS_ACCEPTED && @@ -67,7 +67,7 @@ Signed-off-by: Jouni Malinen * * This software may be distributed under the terms of the BSD license. * See README for more details. -@@ -1246,6 +1246,7 @@ static int hostapd_config_check_bss(stru +@@ -1244,6 +1244,7 @@ static int hostapd_config_check_bss(stru if (full_config && bss->wpa && bss->wpa_psk_radius != PSK_RADIUS_IGNORED && @@ -75,7 +75,7 @@ Signed-off-by: Jouni Malinen bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) { wpa_printf(MSG_ERROR, "WPA-PSK using RADIUS enabled, but no " "RADIUS checking (macaddr_acl=2) enabled."); -@@ -1255,6 +1256,7 @@ static int hostapd_config_check_bss(stru +@@ -1253,6 +1254,7 @@ static int hostapd_config_check_bss(stru if (full_config && bss->wpa && (bss->wpa_key_mgmt & WPA_KEY_MGMT_PSK) && bss->ssid.wpa_psk == NULL && bss->ssid.wpa_passphrase == NULL && bss->ssid.wpa_psk_file == NULL && diff --git a/feeds/wifi-ax/hostapd/src/src/ap/ubus.c b/feeds/wifi-ax/hostapd/src/src/ap/ubus.c index 07c85ac19..befa3bc84 100644 --- a/feeds/wifi-ax/hostapd/src/src/ap/ubus.c +++ b/feeds/wifi-ax/hostapd/src/src/ap/ubus.c @@ -163,7 +163,7 @@ hostapd_bss_reload(struct ubus_context *ctx, struct ubus_object *obj, { struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); - return hostapd_reload_config(hapd->iface, 1); + return hostapd_reload_config(hapd->iface); } diff --git a/feeds/wifi-ax/hostapd/src/src/ap/ucode.c b/feeds/wifi-ax/hostapd/src/src/ap/ucode.c index d8174b294..02413c70b 100644 --- a/feeds/wifi-ax/hostapd/src/src/ap/ucode.c +++ b/feeds/wifi-ax/hostapd/src/src/ap/ucode.c @@ -4,6 +4,8 @@ #include "utils/common.h" #include "utils/ucode.h" #include "hostapd.h" +#include "beacon.h" +#include "hw_features.h" #include "ap_drv_ops.h" #include @@ -21,7 +23,7 @@ hostapd_ucode_bss_get_uval(struct hostapd_data *hapd) return wpa_ucode_registry_get(bss_registry, hapd->ucode.idx); val = uc_resource_new(bss_type, hapd); - wpa_ucode_registry_add(bss_registry, val, &hapd->ucode.idx); + hapd->ucode.idx = wpa_ucode_registry_add(bss_registry, val); return val; } @@ -35,46 +37,46 @@ hostapd_ucode_iface_get_uval(struct hostapd_iface *hapd) return wpa_ucode_registry_get(iface_registry, hapd->ucode.idx); val = uc_resource_new(iface_type, hapd); - wpa_ucode_registry_add(iface_registry, val, &hapd->ucode.idx); + hapd->ucode.idx = wpa_ucode_registry_add(iface_registry, val); return val; } static void -hostapd_ucode_update_bss_list(struct hostapd_iface *iface) +hostapd_ucode_update_bss_list(struct hostapd_iface *iface, uc_value_t *if_bss, uc_value_t *bss) { - uc_value_t *ifval, *list; + uc_value_t *list; int i; list = ucv_array_new(vm); for (i = 0; i < iface->num_bss; i++) { struct hostapd_data *hapd = iface->bss[i]; uc_value_t *val = hostapd_ucode_bss_get_uval(hapd); - uc_value_t *proto = ucv_prototype_get(val); - ucv_object_add(proto, "name", ucv_get(ucv_string_new(hapd->conf->iface))); - ucv_object_add(proto, "index", ucv_int64_new(i)); - ucv_array_set(list, i, ucv_get(val)); + ucv_array_set(list, i, ucv_get(ucv_string_new(hapd->conf->iface))); + ucv_object_add(bss, hapd->conf->iface, ucv_get(val)); } - - ifval = hostapd_ucode_iface_get_uval(iface); - ucv_object_add(ucv_prototype_get(ifval), "bss", ucv_get(list)); + ucv_object_add(if_bss, iface->phy, ucv_get(list)); } static void hostapd_ucode_update_interfaces(void) { uc_value_t *ifs = ucv_object_new(vm); + uc_value_t *if_bss = ucv_array_new(vm); + uc_value_t *bss = ucv_object_new(vm); int i; for (i = 0; i < interfaces->count; i++) { struct hostapd_iface *iface = interfaces->iface[i]; ucv_object_add(ifs, iface->phy, ucv_get(hostapd_ucode_iface_get_uval(iface))); - hostapd_ucode_update_bss_list(iface); + hostapd_ucode_update_bss_list(iface, if_bss, bss); } ucv_object_add(ucv_prototype_get(global), "interfaces", ucv_get(ifs)); + ucv_object_add(ucv_prototype_get(global), "interface_bss", ucv_get(if_bss)); + ucv_object_add(ucv_prototype_get(global), "bss", ucv_get(bss)); ucv_gc(vm); } @@ -130,18 +132,18 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs) if (!conf || idx > conf->num_bss || !conf->bss[idx]) goto out; + hostapd_bss_deinit_no_free(hapd); + hostapd_drv_stop_ap(hapd); + hostapd_free_hapd_data(hapd); + old_bss = hapd->conf; for (i = 0; i < iface->conf->num_bss; i++) if (iface->conf->bss[i] == hapd->conf) iface->conf->bss[i] = conf->bss[idx]; hapd->conf = conf->bss[idx]; - conf->bss[idx] = NULL; + conf->bss[idx] = old_bss; hostapd_config_free(conf); - hostapd_bss_deinit_no_free(hapd); - hostapd_drv_stop_ap(hapd); - hostapd_free_hapd_data(hapd); - hostapd_config_free_bss(old_bss); hostapd_setup_bss(hapd, hapd == iface->bss[0], !iface->conf->multiple_bssid); ret = 0; @@ -197,7 +199,7 @@ uc_hostapd_bss_delete(uc_vm_t *vm, size_t nargs) hostapd_config_free_bss(hapd->conf); os_free(hapd); - hostapd_ucode_update_bss_list(iface); + hostapd_ucode_update_interfaces(); ucv_gc(vm); return NULL; @@ -250,7 +252,7 @@ uc_hostapd_iface_add_bss(uc_vm_t *vm, size_t nargs) iface->conf->bss[iface->conf->num_bss] = bss; conf->bss[idx] = NULL; ret = hostapd_ucode_bss_get_uval(hapd); - hostapd_ucode_update_bss_list(iface); + hostapd_ucode_update_interfaces(); goto out; deinit_ctrl: @@ -289,12 +291,158 @@ uc_hostapd_bss_ctrl(uc_vm_t *vm, size_t nargs) return ucv_string_new_length(reply, reply_len); } +static uc_value_t * +uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs) +{ + struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface"); + int i; + + for (i = 0; i < iface->num_bss; i++) { + struct hostapd_data *hapd = iface->bss[i]; + + hostapd_drv_stop_ap(hapd); + hapd->started = 0; + } +} + +static uc_value_t * +uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs) +{ + struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface"); + uc_value_t *info = uc_fn_arg(0); + struct hostapd_config *conf; + uint64_t intval; + int i; + + if (!iface) + return NULL; + + if (!info) + goto out; + + if (ucv_type(info) != UC_OBJECT) + return NULL; + + conf = iface->conf; + if ((intval = ucv_int64_get(ucv_object_get(info, "op_class", NULL))) && !errno) + conf->op_class = intval; + if ((intval = ucv_int64_get(ucv_object_get(info, "hw_mode", NULL))) && !errno) + conf->hw_mode = intval; + if ((intval = ucv_int64_get(ucv_object_get(info, "channel", NULL))) && !errno) + conf->channel = intval; + if ((intval = ucv_int64_get(ucv_object_get(info, "sec_channel", NULL))) && !errno) + conf->secondary_channel = intval; +#ifdef CONFIG_IEEE80211AC + if ((intval = ucv_int64_get(ucv_object_get(info, "center_seg0_idx", NULL))) && !errno) { + conf->vht_oper_centr_freq_seg0_idx = intval; +#ifdef CONFIG_IEEE80211AX + conf->he_oper_centr_freq_seg0_idx = intval; +#endif +#ifdef CONFIG_IEEE80211BE + conf->eht_oper_centr_freq_seg0_idx = intval; +#endif + } + if ((intval = ucv_int64_get(ucv_object_get(info, "center_seg1_idx", NULL))) && !errno) { + conf->vht_oper_centr_freq_seg1_idx = intval; +#ifdef CONFIG_IEEE80211AX + conf->he_oper_centr_freq_seg1_idx = intval; +#endif +#ifdef CONFIG_IEEE80211BE + conf->eht_oper_centr_freq_seg1_idx = intval; +#endif + } + intval = ucv_int64_get(ucv_object_get(info, "oper_chwidth", NULL)); + if (!errno) { + conf->vht_oper_chwidth = intval; +#ifdef CONFIG_IEEE80211AX + conf->he_oper_chwidth = intval; +#endif +#ifdef CONFIG_IEEE80211BE + conf->eht_oper_chwidth = intval; +#endif + } +#endif + +out: + if (conf->channel) + iface->freq = hostapd_hw_get_freq(iface->bss[0], conf->channel); + + for (i = 0; i < iface->num_bss; i++) { + struct hostapd_data *hapd = iface->bss[i]; + int ret; + + hapd->started = 1; + hostapd_set_freq(hapd, conf->hw_mode, iface->freq, + conf->channel, + conf->enable_edmg, + conf->edmg_channel, + conf->ieee80211n, + conf->ieee80211ac, + conf->ieee80211ax, + conf->secondary_channel, + hostapd_get_oper_chwidth(conf), + hostapd_get_oper_centr_freq_seg0_idx(conf), + hostapd_get_oper_centr_freq_seg1_idx(conf)); + + ieee802_11_set_beacon(hapd); + } + + return ucv_boolean_new(true); +} + +static uc_value_t * +uc_hostapd_iface_switch_channel(uc_vm_t *vm, size_t nargs) +{ + struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface"); + uc_value_t *info = uc_fn_arg(0); + struct hostapd_config *conf; + struct csa_settings csa = {}; + uint64_t intval; + int i, ret = 0; + + if (!iface || ucv_type(info) != UC_OBJECT) + return NULL; + + conf = iface->conf; + if ((intval = ucv_int64_get(ucv_object_get(info, "csa_count", NULL))) && !errno) + csa.cs_count = intval; + if ((intval = ucv_int64_get(ucv_object_get(info, "sec_channel", NULL))) && !errno) + csa.freq_params.sec_channel_offset = intval; + + csa.freq_params.ht_enabled = conf->ieee80211n; + csa.freq_params.vht_enabled = conf->ieee80211ac; + csa.freq_params.he_enabled = conf->ieee80211ax; +#ifdef CONFIG_IEEE80211BE + csa.freq_params.eht_enabled = conf->ieee80211be; +#endif + intval = ucv_int64_get(ucv_object_get(info, "oper_chwidth", NULL)); + if (errno) + intval = hostapd_get_oper_chwidth(conf); + if (intval) + csa.freq_params.bandwidth = 40 << intval; + else + csa.freq_params.bandwidth = csa.freq_params.sec_channel_offset ? 40 : 20; + + if ((intval = ucv_int64_get(ucv_object_get(info, "frequency", NULL))) && !errno) + csa.freq_params.freq = intval; + if ((intval = ucv_int64_get(ucv_object_get(info, "center_freq1", NULL))) && !errno) + csa.freq_params.center_freq1 = intval; + if ((intval = ucv_int64_get(ucv_object_get(info, "center_freq2", NULL))) && !errno) + csa.freq_params.center_freq2 = intval; + + for (i = 0; i < iface->num_bss; i++) + ret = hostapd_switch_channel(iface->bss[i], &csa); + + return ucv_boolean_new(!ret); +} + int hostapd_ucode_init(struct hapd_interfaces *ifaces) { static const uc_function_list_t global_fns[] = { { "printf", uc_wpa_printf }, { "getpid", uc_wpa_getpid }, { "sha1", uc_wpa_sha1 }, + { "freq_info", uc_wpa_freq_info }, { "add_iface", uc_hostapd_add_iface }, { "remove_iface", uc_hostapd_remove_iface }, }; @@ -304,7 +452,10 @@ int hostapd_ucode_init(struct hapd_interfaces *ifaces) { "delete", uc_hostapd_bss_delete }, }; static const uc_function_list_t iface_fns[] = { - { "add_bss", uc_hostapd_iface_add_bss } + { "add_bss", uc_hostapd_iface_add_bss }, + { "stop", uc_hostapd_iface_stop }, + { "start", uc_hostapd_iface_start }, + { "switch_channel", uc_hostapd_iface_switch_channel }, }; uc_value_t *data, *proto; @@ -360,7 +511,7 @@ void hostapd_ucode_add_bss(struct hostapd_data *hapd) ucv_gc(vm); } -void hostapd_ucode_reload_bss(struct hostapd_data *hapd, int reconf) +void hostapd_ucode_reload_bss(struct hostapd_data *hapd) { uc_value_t *val; @@ -370,8 +521,7 @@ void hostapd_ucode_reload_bss(struct hostapd_data *hapd, int reconf) val = hostapd_ucode_bss_get_uval(hapd); uc_value_push(ucv_get(ucv_string_new(hapd->conf->iface))); uc_value_push(ucv_get(val)); - uc_value_push(ucv_int64_new(reconf)); - ucv_put(wpa_ucode_call(3)); + ucv_put(wpa_ucode_call(2)); ucv_gc(vm); } diff --git a/feeds/wifi-ax/hostapd/src/src/ap/ucode.h b/feeds/wifi-ax/hostapd/src/src/ap/ucode.h index dbc49e6ea..d00b78716 100644 --- a/feeds/wifi-ax/hostapd/src/src/ap/ucode.h +++ b/feeds/wifi-ax/hostapd/src/src/ap/ucode.h @@ -25,7 +25,7 @@ void hostapd_ucode_free(void); void hostapd_ucode_free_iface(struct hostapd_iface *iface); void hostapd_ucode_add_bss(struct hostapd_data *hapd); void hostapd_ucode_free_bss(struct hostapd_data *hapd); -void hostapd_ucode_reload_bss(struct hostapd_data *hapd, int reconf); +void hostapd_ucode_reload_bss(struct hostapd_data *hapd); #else @@ -39,7 +39,7 @@ static inline void hostapd_ucode_free(void) static inline void hostapd_ucode_free_iface(struct hostapd_iface *iface) { } -static inline void hostapd_ucode_reload_bss(struct hostapd_data *hapd, int reconf) +static inline void hostapd_ucode_reload_bss(struct hostapd_data *hapd) { } static inline void hostapd_ucode_add_bss(struct hostapd_data *hapd) diff --git a/feeds/wifi-ax/hostapd/src/src/utils/ucode.c b/feeds/wifi-ax/hostapd/src/src/utils/ucode.c index fabf58a5e..b106d856f 100644 --- a/feeds/wifi-ax/hostapd/src/src/utils/ucode.c +++ b/feeds/wifi-ax/hostapd/src/src/utils/ucode.c @@ -3,6 +3,7 @@ #include "utils/eloop.h" #include "crypto/crypto.h" #include "crypto/sha1.h" +#include "common/ieee802_11_common.h" #include #include @@ -45,6 +46,97 @@ uc_value_t *uc_wpa_printf(uc_vm_t *vm, size_t nargs) return NULL; } +uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs) +{ + uc_value_t *freq = uc_fn_arg(0); + uc_value_t *sec = uc_fn_arg(1); + int width = ucv_uint64_get(uc_fn_arg(2)); + int freq_val, center_idx, center_ofs; + enum hostapd_hw_mode hw_mode; + u8 op_class, channel, tmp_channel; + const char *modestr; + int sec_channel = 0; + uc_value_t *ret; + int chanwidth; + + if (ucv_type(freq) != UC_INTEGER) + return NULL; + + freq_val = ucv_int64_get(freq); + if (ucv_type(sec) == UC_INTEGER) + sec_channel = ucv_int64_get(sec); + else if (sec) + return NULL; + else if (freq_val > 4000) + sec_channel = (freq_val / 20) & 1 ? 1 : -1; + else + sec_channel = freq_val < 2442 ? 1 : -1; + + if (sec_channel != -1 && sec_channel != 1 && sec_channel != 0) + return NULL; + + switch (width) { + case 0: + chanwidth = CHANWIDTH_USE_HT; + break; + case 1: + chanwidth = CHANWIDTH_80MHZ; + break; + case 2: + chanwidth = CHANWIDTH_160MHZ; + break; + default: + return NULL; + } + + hw_mode = ieee80211_freq_to_channel_ext(freq_val, sec_channel, + chanwidth, &op_class, &channel); + switch (hw_mode) { + case HOSTAPD_MODE_IEEE80211B: + modestr = "b"; + break; + case HOSTAPD_MODE_IEEE80211G: + modestr = "g"; + break; + case HOSTAPD_MODE_IEEE80211A: + modestr = "a"; + break; + case HOSTAPD_MODE_IEEE80211AD: + modestr = "ad"; + break; + default: + return NULL; + } + + ret = ucv_object_new(vm); + ucv_object_add(ret, "op_class", ucv_int64_new(op_class)); + ucv_object_add(ret, "channel", ucv_int64_new(channel)); + ucv_object_add(ret, "hw_mode", ucv_int64_new(hw_mode)); + ucv_object_add(ret, "hw_mode_str", ucv_get(ucv_string_new(modestr))); + ucv_object_add(ret, "sec_channel", ucv_int64_new(sec_channel)); + ucv_object_add(ret, "frequency", ucv_int64_new(freq_val)); + + if (!sec_channel) + return ret; + + if (freq_val >= 5900) + center_ofs = 0; + else if (freq_val >= 5745) + center_ofs = 20; + else + center_ofs = 35; + tmp_channel = channel - center_ofs; + tmp_channel &= ~((8 << width) - 1); + center_idx = tmp_channel + center_ofs + (4 << width) - 1; + + ucv_object_add(ret, "center_seg0_idx", ucv_int64_new(center_idx)); + center_idx = (center_idx - channel) * 5 + freq_val; + ucv_object_add(ret, "center_freq1", ucv_int64_new(center_idx)); + +out: + return ret; +} + uc_value_t *uc_wpa_getpid(uc_vm_t *vm, size_t nargs) { return ucv_int64_new(getpid()); @@ -179,7 +271,7 @@ uc_value_t *wpa_ucode_global_init(const char *name, uc_resource_type_t *global_t return global; } -void wpa_ucode_registry_add(uc_value_t *reg, uc_value_t *val, int *idx) +int wpa_ucode_registry_add(uc_value_t *reg, uc_value_t *val) { uc_value_t *data; int i = 0; @@ -189,10 +281,7 @@ void wpa_ucode_registry_add(uc_value_t *reg, uc_value_t *val, int *idx) ucv_array_set(reg, i, ucv_get(val)); - data = ucv_object_new(&vm); - ucv_object_add(ucv_prototype_get(val), "data", ucv_get(data)); - - *idx = i + 1; + return i + 1; } uc_value_t *wpa_ucode_registry_get(uc_value_t *reg, int idx) diff --git a/feeds/wifi-ax/hostapd/src/src/utils/ucode.h b/feeds/wifi-ax/hostapd/src/src/utils/ucode.h index 4caf8ada5..2c1886976 100644 --- a/feeds/wifi-ax/hostapd/src/src/utils/ucode.h +++ b/feeds/wifi-ax/hostapd/src/src/utils/ucode.h @@ -17,12 +17,13 @@ void wpa_ucode_free_vm(void); uc_value_t *wpa_ucode_global_init(const char *name, uc_resource_type_t *global_type); -void wpa_ucode_registry_add(uc_value_t *reg, uc_value_t *val, int *idx); +int wpa_ucode_registry_add(uc_value_t *reg, uc_value_t *val); uc_value_t *wpa_ucode_registry_get(uc_value_t *reg, int idx); uc_value_t *wpa_ucode_registry_remove(uc_value_t *reg, int idx); uc_value_t *uc_wpa_printf(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_getpid(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_sha1(uc_vm_t *vm, size_t nargs); +uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs); #endif diff --git a/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.c b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.c index 660357a43..d0a78d162 100644 --- a/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.c +++ b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.c @@ -1,8 +1,10 @@ #include "utils/includes.h" #include "utils/common.h" #include "utils/ucode.h" +#include "drivers/driver.h" #include "wpa_supplicant_i.h" #include "wps_supplicant.h" +#include "bss.h" #include "ucode.h" static struct wpa_global *wpa_global; @@ -19,7 +21,7 @@ wpas_ucode_iface_get_uval(struct wpa_supplicant *wpa_s) return wpa_ucode_registry_get(iface_registry, wpa_s->ucode.idx); val = uc_resource_new(iface_type, wpa_s); - wpa_ucode_registry_add(iface_registry, val, &wpa_s->ucode.idx); + wpa_s->ucode.idx = wpa_ucode_registry_add(iface_registry, val); return val; } @@ -63,12 +65,65 @@ void wpas_ucode_free_bss(struct wpa_supplicant *wpa_s) if (wpa_ucode_call_prepare("iface_remove")) return; - uc_value_push(ucv_string_new(wpa_s->ifname)); + uc_value_push(ucv_get(ucv_string_new(wpa_s->ifname))); uc_value_push(ucv_get(val)); ucv_put(wpa_ucode_call(2)); ucv_gc(vm); } +void wpas_ucode_update_state(struct wpa_supplicant *wpa_s) +{ + const char *state; + uc_value_t *val; + + val = wpa_ucode_registry_get(iface_registry, wpa_s->ucode.idx); + if (!val) + return; + + if (wpa_ucode_call_prepare("state")) + return; + + state = wpa_supplicant_state_txt(wpa_s->wpa_state); + uc_value_push(ucv_get(ucv_string_new(wpa_s->ifname))); + uc_value_push(ucv_get(val)); + uc_value_push(ucv_get(ucv_string_new(state))); + ucv_put(wpa_ucode_call(3)); + ucv_gc(vm); +} + +void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_data *data) +{ + const char *state; + uc_value_t *val; + + if (event != EVENT_CH_SWITCH_STARTED) + return; + + val = wpa_ucode_registry_get(iface_registry, wpa_s->ucode.idx); + if (!val) + return; + + if (wpa_ucode_call_prepare("event")) + return; + + uc_value_push(ucv_get(ucv_string_new(wpa_s->ifname))); + uc_value_push(ucv_get(val)); + uc_value_push(ucv_get(ucv_string_new(event_to_string(event)))); + val = ucv_object_new(vm); + uc_value_push(ucv_get(val)); + + if (event == EVENT_CH_SWITCH_STARTED) { + ucv_object_add(val, "csa_count", ucv_int64_new(data->ch_switch.count)); + ucv_object_add(val, "frequency", ucv_int64_new(data->ch_switch.freq)); + ucv_object_add(val, "sec_chan_offset", ucv_int64_new(data->ch_switch.ch_offset)); + ucv_object_add(val, "center_freq1", ucv_int64_new(data->ch_switch.cf1)); + ucv_object_add(val, "center_freq2", ucv_int64_new(data->ch_switch.cf2)); + } + + ucv_put(wpa_ucode_call(4)); + ucv_gc(vm); +} + static const char *obj_stringval(uc_value_t *obj, const char *name) { uc_value_t *val = ucv_object_get(obj, name, NULL); @@ -84,7 +139,6 @@ uc_wpas_add_iface(uc_vm_t *vm, size_t nargs) uc_value_t *bridge = ucv_object_get(info, "bridge", NULL); uc_value_t *config = ucv_object_get(info, "config", NULL); uc_value_t *ctrl = ucv_object_get(info, "ctrl", NULL); - uc_value_t *hapd_ctrl = ucv_object_get(info, "hostapd_ctrl", NULL); struct wpa_interface iface; int ret = -1; @@ -97,7 +151,6 @@ uc_wpas_add_iface(uc_vm_t *vm, size_t nargs) .bridge_ifname = ucv_string_get(bridge), .confname = ucv_string_get(config), .ctrl_interface = ucv_string_get(ctrl), - .hostapd_ctrl = ucv_string_get(hapd_ctrl), }; if (!iface.ifname || !iface.confname) @@ -135,6 +188,45 @@ out: return ucv_int64_new(ret); } +static uc_value_t * +uc_wpas_iface_status(uc_vm_t *vm, size_t nargs) +{ + struct wpa_supplicant *wpa_s = uc_fn_thisval("wpas.iface"); + struct wpa_bss *bss; + uc_value_t *ret, *val; + + if (!wpa_s) + return NULL; + + ret = ucv_object_new(vm); + + val = ucv_string_new(wpa_supplicant_state_txt(wpa_s->wpa_state)); + ucv_object_add(ret, "state", ucv_get(val)); + + bss = wpa_s->current_bss; + if (bss) { + int sec_chan = 0; + const u8 *ie; + + ie = wpa_bss_get_ie(bss, WLAN_EID_HT_OPERATION); + if (ie && ie[1] >= 2) { + const struct ieee80211_ht_operation *ht_oper; + + ht_oper = (const void *) (ie + 2); + if (ht_oper->ht_param & HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE) + sec_chan = 1; + else if (ht_oper->ht_param & + HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW) + sec_chan = -1; + } + + ucv_object_add(ret, "sec_chan_offset", ucv_int64_new(sec_chan)); + ucv_object_add(ret, "frequency", ucv_int64_new(bss->freq)); + } + + return ret; +} + int wpas_ucode_init(struct wpa_global *gl) { static const uc_function_list_t global_fns[] = { @@ -144,6 +236,7 @@ int wpas_ucode_init(struct wpa_global *gl) { "remove_iface", uc_wpas_remove_iface }, }; static const uc_function_list_t iface_fns[] = { + { "status", uc_wpas_iface_status }, }; uc_value_t *data, *proto; @@ -151,10 +244,10 @@ int wpas_ucode_init(struct wpa_global *gl) vm = wpa_ucode_create_vm(); global_type = uc_type_declare(vm, "wpas.global", global_fns, NULL); - iface_type = uc_type_declare(vm, "hostapd.iface", iface_fns, NULL); + iface_type = uc_type_declare(vm, "wpas.iface", iface_fns, NULL); iface_registry = ucv_array_new(vm); - uc_vm_registry_set(vm, "hostap.iface_registry", iface_registry); + uc_vm_registry_set(vm, "wpas.iface_registry", iface_registry); global = wpa_ucode_global_init("wpas", global_type); diff --git a/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.h b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.h index fcd231357..a429a0ed8 100644 --- a/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.h +++ b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.h @@ -4,6 +4,7 @@ #include "utils/ucode.h" struct wpa_global; +union wpa_event_data; struct wpa_supplicant; struct wpas_ucode_bss { @@ -17,6 +18,8 @@ int wpas_ucode_init(struct wpa_global *gl); void wpas_ucode_free(void); void wpas_ucode_add_bss(struct wpa_supplicant *wpa_s); void wpas_ucode_free_bss(struct wpa_supplicant *wpa_s); +void wpas_ucode_update_state(struct wpa_supplicant *wpa_s); +void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_data *data); #else static inline int wpas_ucode_init(struct wpa_global *gl) { @@ -33,6 +36,14 @@ static inline void wpas_ucode_free_bss(struct wpa_supplicant *wpa_s) { } +static inline void wpas_ucode_update_state(struct wpa_supplicant *wpa_s) +{ +} + +static inline void wpas_ucode_event(struct wpa_supplicant *wpa_s, int event, union wpa_event_data *data) +{ +} + #endif #endif diff --git a/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh b/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh index e98e79205..dcf41441e 100644 --- a/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -492,8 +492,6 @@ $base_cfg EOF json_select .. - radio_md5sum=$(md5sum $hostapd_conf_file | cut -d" " -f1) - echo "radio_config_id=${radio_md5sum}" >> $hostapd_conf_file } mac80211_hostapd_setup_bss() {