From 5b397d54cef2fac60b8abd20f8e843c429a22b0b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 5 Jul 2023 12:22:23 +0000 Subject: [PATCH] wifi-ax: backport hostapd reload support Signed-off-by: Felix Fietkau --- feeds/ucentral/ucode/Makefile | 2 +- feeds/wifi-ax/hostapd/Makefile | 23 +- feeds/wifi-ax/hostapd/files/common.uc | 156 +++++ feeds/wifi-ax/hostapd/files/hostapd.uc | 405 ++++++++++++ feeds/wifi-ax/hostapd/files/wdev.uc | 153 +++++ feeds/wifi-ax/hostapd/files/wpa_supplicant.uc | 159 +++++ .../hostapd/patches/600-ubus_support.patch | 357 +++++++---- .../hostapd/patches/601-ucode_support.patch | 224 +++++++ .../hostapd/patches/700-wifi-reload.patch | 220 +++++-- .../hostapd/patches/710-vlan_no_bridge.patch | 2 +- .../patches/711-wds_bridge_force.patch | 14 +- .../patches/720-iface_max_num_sta.patch | 8 +- .../hostapd/patches/730-ft_iface.patch | 4 +- .../hostapd/patches/740-snoop_iface.patch | 22 +- feeds/wifi-ax/hostapd/patches/750-wispr.patch | 26 +- .../hostapd/patches/760-acs_exclude_dfs.patch | 8 +- .../hostapd/patches/760-dynamic_own_ip.patch | 14 +- .../hostapd/patches/770-wds-hack.patch | 12 +- .../hostapd/patches/780-maxassoc.patch | 6 +- .../800-fix-ap-sta-channel-setup-failed.patch | 4 +- feeds/wifi-ax/hostapd/patches/900-coa.patch | 6 +- .../hostapd/patches/900-coa_multi.patch | 2 +- .../hostapd/patches/901-cfg-section.patch | 28 +- .../hostapd/patches/920-sta_driver_data.patch | 28 +- .../hostapd/patches/999-probe-request.patch | 22 +- .../hostapd/patches/999-ssi_signal.patch | 30 +- ...-test-RADAR-detection-probablity-in-.patch | 38 +- ...n-issue-related-with-wpa_group_state.patch | 2 +- ...b00-004-hostap-fix-compilation-issue.patch | 8 +- .../b00-014-hostapd-add-ht40-allow-map.patch | 8 +- ...rate-information-into-STATUS-and-STA.patch | 6 +- .../b00-036-hostapd-disable-40mhz-scan.patch | 6 +- .../c00-002-hostapd-he-update-nl-header.patch | 16 +- .../patches/c00-004-add-HE-cross-check.patch | 14 +- ...00-010-hostapd-fix-enabling-he-in-5G.patch | 2 +- .../c00-011-hostapd-add-mbo-support.patch | 10 +- ...0-002-set-supp-chan-width-for-40mghz.patch | 7 +- ...-wpa-supplicant-override-HE-toVHT-2G.patch | 12 +- ...dd-param-to-enable-disable-ul-mumimo.patch | 12 +- .../patches/d00-007-fixing-warning.patch | 6 +- ...ix-enable-40-80mhz-bandwidth-in-6Ghz.patch | 52 +- ...d00-009-hostapd-update-muedca-params.patch | 40 +- ...Unsolicited-Bcast-Probe-Resp-Support.patch | 19 +- ...1-multiple_bssid-add-the-config-file.patch | 142 ++--- ...support-for-reduced-neighbour-report.patch | 6 +- ...support-for-reduced-neighbour-report.patch | 6 +- ...support-for-reduced-neighbour-report.patch | 2 +- ...support-for-reduced-neighbour-report.patch | 54 +- .../e00-003-hostapd-chan-switch-6ghz.patch | 2 +- ...esh-support-6ghz-support-in-11s-mesh.patch | 24 +- ...le-160MHz-support-for-6G-in-11s-mesh.patch | 6 +- ...iple_bssid-set-extended-capabilities.patch | 20 +- ...on-element-in-multiple-BSSID-element.patch | 6 +- ...e00-007-add-EMA-configuration-option.patch | 52 +- ...ation-ID-with-multiple-BSSID-element.patch | 2 +- .../e00-008-multiple_bssid-DTIM-setting.patch | 36 +- ...9-fix-reduced-neighbor-report-length.patch | 6 +- ...en-SSID-support-in-multiple-BSSID-IE.patch | 40 +- ...-011-6ghz-out-of-band-advertisements.patch | 190 ++---- ...0MHz-center-freq-calculation-in-6GHz.patch | 7 +- ...tapd-update-cfs0-and-cfs1-for-160MHz.patch | 2 +- ...-collision-events-and-triggering-CCA.patch | 22 +- ...code-required-to-generate-the-CCA-IE.patch | 30 +- ...-code-to-generic-to-be-used-for-mesh.patch | 8 +- ...03-Extend-acl-config-support-to-mesh.patch | 62 +- ...oloring-disable-BSS-color-during-CCA.patch | 2 +- ..._color-handler-to-the-nl80211-driver.patch | 8 +- ...CL-management-over-control-interface.patch | 16 +- ...nd-CCA-events-coming-from-the-kernel.patch | 12 +- ...-allow-using-a-random-starting-color.patch | 4 +- ...add-intelligence-color-choose-in-CCA.patch | 4 +- ..._support_to_change_bss_color_by_user.patch | 40 +- ...ountdown-zero-in-color-change-beacon.patch | 8 +- ...loring-check-free-color-periodically.patch | 6 +- .../g00-001-multiple_bssid-add-support.patch | 30 +- ...s-in-EMA-beacon-transmission-offload.patch | 48 +- ...stapd-fix-int-in-bool-context-Werror.patch | 7 +- ...nt-add-mesh-ID-IE-only-for-mesh-mode.patch | 7 +- ...d-Enable-HE40-support-in-2G-11s-mesh.patch | 60 +- ...d-disable-HE-when-wmm-is-not-enabled.patch | 6 +- ...-hostapd-Process-known-BSSID-element.patch | 64 +- ...unctions-used-for-reduced-neighbor-r.patch | 26 +- ...frame-instead-of-probe_resp-flag-in-.patch | 18 +- ...dition-of-co-located-APs-to-6GHz-ban.patch | 35 +- ...h-checks-for-reduced-neighbor-report.patch | 94 ++- ...torage-class-of-multiple-BSSID-funct.patch | 17 +- .../h00-003-07-hostad-RNR-for-EMA-AP.patch | 60 +- ....4-5GHz-beacons-when-6GHz-AP-comes-u.patch | 4 +- ...tapd-Netlink-changes-for-RNR-offsets.patch | 20 +- ...ow-AP_VLAN-creation-for-dynamic-VLAN.patch | 6 +- ...stapd-Add-support-for-beacon-tx-mode.patch | 82 +-- ...Spectrum-Management-bit-for-chan-swi.patch | 16 +- .../h00-008-b-add-support-for-6ghz-tpc.patch | 11 +- .../h00-008-c-add-support-for-6ghz-tpc.patch | 23 +- .../h00-008-d-add-support-for-6ghz-tpc.patch | 18 +- ...-Fill-6G-TPE-IE-for-non-US-countries.patch | 8 +- .../hostapd/patches/i00-001-compile-fix.patch | 2 +- ...stapd-update-missing-5.9GHz-channels.patch | 12 +- ...stapd-cli-allowed-bw-on-each-channel.patch | 25 +- ...e-when-participant-act-as-key-server.patch | 43 +- ...002-hostapd-Fix-channel-switch-on-6g.patch | 7 +- ...apd-fix-enabling-HE-thru-cli-in-2ghz.patch | 7 +- ...acent-channel-selection-in-DFS-for-q.patch | 8 +- ...ACL-PSK-check-during-4-way-handshake.patch | 8 +- ...ributes-with-Extended-Types-RFC-6929.patch | 36 +- ...ibutes-for-EAPOL-Key-message-details.patch | 17 +- ...1-validate-DigestAlgorithmIdentifier.patch | 19 +- ...2-dragonfly-Add-sqrt-helper-function.patch | 11 +- ...-coordinate-for-PWE-with-own-impleme.patch | 9 +- ...he-y-coordinate-for-PWE-with-own-imp.patch | 17 +- feeds/wifi-ax/hostapd/src/src/ap/ubus.c | 164 +---- feeds/wifi-ax/hostapd/src/src/ap/ucode.c | 386 +++++++++++ feeds/wifi-ax/hostapd/src/src/ap/ucode.h | 54 ++ .../hostapd/src/src/utils/build_features.h | 16 +- feeds/wifi-ax/hostapd/src/src/utils/ucode.c | 237 +++++++ feeds/wifi-ax/hostapd/src/src/utils/ucode.h | 28 + .../wifi-ax/hostapd/src/wpa_supplicant/ubus.c | 162 +---- .../wifi-ax/hostapd/src/wpa_supplicant/ubus.h | 11 - .../hostapd/src/wpa_supplicant/ucode.c | 177 +++++ .../hostapd/src/wpa_supplicant/ucode.h | 38 ++ feeds/wifi-ax/mac80211/Makefile | 2 +- .../files/lib/netifd/wireless/mac80211.sh | 602 ++++++++---------- 122 files changed, 3566 insertions(+), 2210 deletions(-) create mode 100644 feeds/wifi-ax/hostapd/files/common.uc create mode 100644 feeds/wifi-ax/hostapd/files/hostapd.uc create mode 100644 feeds/wifi-ax/hostapd/files/wdev.uc create mode 100644 feeds/wifi-ax/hostapd/files/wpa_supplicant.uc create mode 100644 feeds/wifi-ax/hostapd/patches/601-ucode_support.patch create mode 100644 feeds/wifi-ax/hostapd/src/src/ap/ucode.c create mode 100644 feeds/wifi-ax/hostapd/src/src/ap/ucode.h create mode 100644 feeds/wifi-ax/hostapd/src/src/utils/ucode.c create mode 100644 feeds/wifi-ax/hostapd/src/src/utils/ucode.h create mode 100644 feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.c create mode 100644 feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.h diff --git a/feeds/ucentral/ucode/Makefile b/feeds/ucentral/ucode/Makefile index 2de45667c..1cffcb1b6 100644 --- a/feeds/ucentral/ucode/Makefile +++ b/feeds/ucentral/ucode/Makefile @@ -96,7 +96,7 @@ endef define Package/ucode-mod-nl80211 $(Package/ucode/default) TITLE+= (nl80211 module) - DEPENDS:=ucode +libnl-tiny +libubox + DEPENDS:=ucode +libnl-tiny +libubox +kmod-mac80211 endef define Package/ucode-mod-nl80211/description diff --git a/feeds/wifi-ax/hostapd/Makefile b/feeds/wifi-ax/hostapd/Makefile index 24638ed38..2698b4bd6 100644 --- a/feeds/wifi-ax/hostapd/Makefile +++ b/feeds/wifi-ax/hostapd/Makefile @@ -84,6 +84,8 @@ ifneq ($(CONFIG_DRIVER_11AX_SUPPORT),) HOSTAPD_IEEE80211AX:=y endif +CORE_DEPENDS = +libubus +libucode +ucode-mod-fs +ucode-mod-nl80211 +ucode-mod-ubus +ucode-mod-uloop +libblobmsg-json + DRIVER_MAKEOPTS= \ CONFIG_ACS=$(CONFIG_PACKAGE_kmod-cfg80211) \ CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-cfg80211) \ @@ -91,6 +93,7 @@ DRIVER_MAKEOPTS= \ CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \ CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \ CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \ + CONFIG_UCODE=y ifeq ($(SSL_VARIANT),openssl) DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y @@ -142,7 +145,7 @@ define Package/hostapd/Default SUBMENU:=WirelessAPD TITLE:=IEEE 802.1x Authenticator URL:=http://hostap.epitest.fi/ - DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus + DEPENDS:=$(DRV_DEPENDS) +hostapd-common $(CORE_DEPENDS) USERID:=network=101:network=101 PROVIDES:=hostapd CONFLICTS:=$(HOSTAPD_PROVIDERS) @@ -226,7 +229,7 @@ define Package/wpad/Default CATEGORY:=Network SUBMENU:=WirelessAPD TITLE:=IEEE 802.1x Auth/Supplicant - DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus + DEPENDS:=$(DRV_DEPENDS) +hostapd-common $(CORE_DEPENDS) USERID:=network=101:network=101 URL:=http://hostap.epitest.fi/ PROVIDES:=hostapd wpa-supplicant @@ -341,7 +344,7 @@ define Package/wpa-supplicant/Default SUBMENU:=WirelessAPD TITLE:=WPA Supplicant URL:=http://hostap.epitest.fi/wpa_supplicant/ - DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus + DEPENDS:=$(DRV_DEPENDS) +hostapd-common $(CORE_DEPENDS) USERID:=network=101:network=101 PROVIDES:=wpa-supplicant CONFLICTS:=$(SUPPLICANT_PROVIDERS) @@ -446,7 +449,7 @@ define Package/eapol-test/Default SECTION:=net SUBMENU:=WirelessAPD CATEGORY:=Network - DEPENDS:=$(DRV_DEPENDS) +libubus + DEPENDS:=$(DRV_DEPENDS) $(CORE_DEPENDS) endef define Package/eapol-test @@ -503,7 +506,7 @@ TARGET_CPPFLAGS := \ $(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY)) TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto -TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver -fuse-linker-plugin -lubox -lubus +TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver -fuse-linker-plugin -lubox -lubus -lucode ifdef CONFIG_PACKAGE_kmod-cfg80211 TARGET_LDFLAGS += -lm -lnl-tiny @@ -587,20 +590,24 @@ define Build/Compile endef define Install/hostapd - $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hostap + $(INSTALL_DATA) ./files/hostapd.uc $(1)/usr/share/hostap/ endef define Install/supplicant - $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/share/hostap + $(INSTALL_DATA) ./files/wpa_supplicant.uc $(1)/usr/share/hostap/ endef define Package/hostapd-common/install - $(INSTALL_DIR) $(1)/etc/capabilities $(1)/etc/rc.button $(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d $(1)/lib/netifd $(1)/usr/share/acl.d + $(INSTALL_DIR) $(1)/etc/capabilities $(1)/etc/rc.button $(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d $(1)/lib/netifd $(1)/usr/share/acl.d $(1)/usr/share/hostap $(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/netifd/hostapd.sh $(INSTALL_BIN) ./files/wpad.init $(1)/etc/init.d/wpad $(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps $(INSTALL_DATA) ./files/wpad_acl.json $(1)/usr/share/acl.d $(INSTALL_DATA) ./files/wpad.json $(1)/etc/capabilities + $(INSTALL_DATA) ./files/common.uc $(1)/usr/share/hostap/ + $(INSTALL_DATA) ./files/wdev.uc $(1)/usr/share/hostap/ endef define Package/hostapd/install diff --git a/feeds/wifi-ax/hostapd/files/common.uc b/feeds/wifi-ax/hostapd/files/common.uc new file mode 100644 index 000000000..5c358b190 --- /dev/null +++ b/feeds/wifi-ax/hostapd/files/common.uc @@ -0,0 +1,156 @@ +import * as nl80211 from "nl80211"; +import * as rtnl from "rtnl"; +import { readfile } from "fs"; + +const iftypes = { + ap: nl80211.const.NL80211_IFTYPE_AP, + mesh: nl80211.const.NL80211_IFTYPE_MESH_POINT, + sta: nl80211.const.NL80211_IFTYPE_STATION, + adhoc: nl80211.const.NL80211_IFTYPE_ADHOC, + monitor: nl80211.const.NL80211_IFTYPE_MONITOR, +}; + +function wdev_remove(name) +{ + nl80211.request(nl80211.const.NL80211_CMD_DEL_INTERFACE, 0, { dev: name }); +} + + +function find_reusable_wdev(phyidx) +{ + let data = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, 0, { wiphy: phyidx }); + if (data.software_iftypes.ap_vlan) + return null; + + data = nl80211.request( + nl80211.const.NL80211_CMD_GET_INTERFACE, + nl80211.const.NLM_F_DUMP, + { wiphy: phyidx }); + for (let res in data) + if (trim(readfile(`/sys/class/net/${res.ifname}/operstate`)) == "down") + return res.ifname; + return null; +} + +function wdev_create(phy, name, data) +{ + let phyidx = int(readfile(`/sys/class/ieee80211/${phy}/index`)); + + wdev_remove(name); + + if (!iftypes[data.mode]) + return `Invalid mode: ${data.mode}`; + + let req = { + wiphy: phyidx, + ifname: name, + iftype: iftypes[data.mode], + }; + + if (data["4addr"]) + req["4addr"] = data["4addr"]; + if (data.macaddr) + req.mac = data.macaddr; + + nl80211.error(); + + let reuse_ifname = find_reusable_wdev(phyidx); + if (reuse_ifname && + (reuse_ifname == name || + rtnl.request(rtnl.const.RTM_SETLINK, 0, { dev: reuse_ifname, ifname: name}) != false)) + nl80211.request( + nl80211.const.NL80211_CMD_SET_INTERFACE, 0, { + wiphy: phyidx, + dev: name, + iftype: iftypes[data.mode], + }); + else + nl80211.request( + nl80211.const.NL80211_CMD_NEW_INTERFACE, + nl80211.const.NLM_F_CREATE, + req); + + let error = nl80211.error(); + if (error) + return error; + + if (data.powersave != null) { + nl80211.request(nl80211.const.NL80211_CMD_SET_POWER_SAVE, 0, + { dev: name, ps_state: data.powersave ? 1 : 0}); + } + + return null; +} + +const vlist_proto = { + update: function(values, arg) { + let data = this.data; + let cb = this.cb; + let seq = { }; + let new_data = {}; + let old_data = {}; + + this.data = new_data; + + if (type(values) == "object") { + for (let key in values) { + old_data[key] = data[key]; + new_data[key] = values[key]; + delete data[key]; + } + } else { + for (let val in values) { + let cur_key = val[0]; + let cur_obj = val[1]; + + old_data[cur_key] = data[cur_key]; + new_data[cur_key] = val[1]; + delete data[cur_key]; + } + } + + for (let key in data) { + cb(null, data[key], arg); + delete data[key]; + } + for (let key in new_data) + cb(new_data[key], old_data[key], arg); + } +}; + +function is_equal(val1, val2) { + let t1 = type(val1); + + if (t1 != type(val2)) + return false; + + if (t1 == "array") { + if (length(val1) != length(val2)) + return false; + + for (let i = 0; i < length(val1); i++) + if (!is_equal(val1[i], val2[i])) + return false; + + return true; + } else if (t1 == "object") { + for (let key in val1) + if (!is_equal(val1[key], val2[key])) + return false; + for (let key in val2) + if (!val1[key]) + return false; + return true; + } else { + return val1 == val2; + } +} + +function vlist_new(cb) { + return proto({ + cb: cb, + data: {} + }, vlist_proto); +} + +export { wdev_remove, wdev_create, is_equal, vlist_new }; diff --git a/feeds/wifi-ax/hostapd/files/hostapd.uc b/feeds/wifi-ax/hostapd/files/hostapd.uc new file mode 100644 index 000000000..2cd9339e7 --- /dev/null +++ b/feeds/wifi-ax/hostapd/files/hostapd.uc @@ -0,0 +1,405 @@ +let libubus = require("ubus"); +import { open, readfile } from "fs"; +import { wdev_create, wdev_remove, is_equal, vlist_new } from "common"; + +let ubus = libubus.connect(); + +hostapd.data.config = {}; + +hostapd.data.file_fields = { + vlan_file: true, + wpa_psk_file: true, + accept_mac_file: true, + deny_mac_file: true, + eap_user_file: true, + ca_cert: true, + server_cert: true, + server_cert2: true, + private_key: true, + private_key2: true, + dh_file: true, + eap_sim_db: true, +}; + +function iface_remove(cfg) +{ + if (!cfg || !cfg.bss || !cfg.bss[0] || !cfg.bss[0].ifname) + return; + + hostapd.remove_iface(cfg.bss[0].ifname); + for (let bss in cfg.bss) + wdev_remove(bss.ifname); +} + +function write_lines(f, data) +{ + for (let line in data) { + f.write(line); + f.write("\n"); + } +} + +function iface_write_config(phy, config) +{ + config.file = `/var/run/ap-${phy}.conf`; + + let f = open(config.file, "w"); + if (!f) { + hostapd.printf(`Failed to open file ${config.file}`); + return; + } + + write_lines(f, config.radio.data); + f.write(`channel=${config.radio.channel}\n`); + + for (let i = 0; i < length(config.bss); i++) { + let bss = config.bss[i]; + let type = i > 0 ? "bss" : "interface"; + + f.write(`${type}=${bss.ifname}\n`); + write_lines(f, bss.data); + } + f.close(); +} + +function iface_restart(phy, config, old_config) +{ + iface_remove(old_config); + iface_remove(config); + + if (!config.bss || !config.bss[0]) { + hostapd.printf(`No bss for phy ${phy}`); + return; + } + + let bss = config.bss[0]; + let err = wdev_create(phy, bss.ifname, { mode: "ap" }); + if (err) + hostapd.printf(`Failed to create ${bss.ifname} on phy ${phy}: ${err}`); + if (hostapd.add_iface(`bss_config=${bss.ifname}:${config.file}`) < 0) { + hostapd.printf(`hostapd.add_iface failed for phy ${phy} ifname=${bss.ifname}`); + return; + } +} + +function array_to_obj(arr, key, start) +{ + let obj = {}; + + start ??= 0; + for (let i = start; i < length(arr); i++) { + let cur = arr[i]; + obj[cur[key]] = cur; + } + + return obj; +} + +function find_array_idx(arr, key, val) +{ + for (let i = 0; i < length(arr); i++) + if (arr[i][key] == val) + return i; + + return -1; +} + +function bss_reload_psk(bss, config, old_config) +{ + if (is_equal(old_config.hash.wpa_psk_file, config.hash.wpa_psk_file)) + return; + + old_config.hash.wpa_psk_file = config.hash.wpa_psk_file; + if (!is_equal(old_config, config)) + return; + + let ret = bss.ctrl("RELOAD_WPA_PSK"); + ret ??= "failed"; + + hostapd.printf(`Reload WPA PSK file for bss ${config.ifname}: ${ret}`); +} + +function iface_reload_config(phy, config, old_config) +{ + if (!old_config || !is_equal(old_config.radio, config.radio)) + return false; + + if (is_equal(old_config.bss, config.bss)) + return true; + + if (config.bss[0].ifname != old_config.bss[0].ifname) + return false; + + let iface = hostapd.interfaces[config.bss[0].ifname]; + if (!iface) + return false; + + bss_reload_psk(iface.bss[0], config.bss[0], old_config.bss[0]); + if (!is_equal(config.bss[0], old_config.bss[0])) { + hostapd.printf(`Reload config for bss '${config.bss[0].ifname}' on phy '${phy}'`); + if (iface.bss[0].set_config(config.file, 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]; + if (!bss) { + hostapd.printf(`bss '${name}' not found`); + return false; + } + + if (!new_cfg[name]) { + hostapd.printf(`Remove bss '${name}' on phy '${phy}'`); + bss.delete(); + continue; + } + + let new_cfg_data = new_cfg[name]; + delete new_cfg[name]; + + if (is_equal(old_cfg[name], new_cfg_data)) + continue; + + hostapd.printf(`Reload config for bss '${name}' on phy '${phy}'`); + let idx = find_array_idx(config.bss, "ifname", name); + if (idx < 0) { + hostapd.printf(`bss index not found`); + return false; + } + + if (bss.set_config(config.file, idx) < 0) { + hostapd.printf(`Failed to set config`); + return false; + } + } + + for (let name in new_cfg) { + hostapd.printf(`Add bss '${name}' on phy '${phy}'`); + + let idx = find_array_idx(config.bss, "ifname", name); + if (idx < 0) { + hostapd.printf(`bss index not found`); + return false; + } + + if (iface.add_bss(config.file, idx) < 0) { + hostapd.printf(`Failed to add bss`); + return false; + } + } + + return true; +} + +function iface_set_config(phy, config) +{ + let old_config = hostapd.data.config[phy]; + + hostapd.data.config[phy] = config; + + if (!config) + return iface_remove(old_config); + + iface_write_config(phy, config); + + let ret = iface_reload_config(phy, config, old_config); + if (ret) { + hostapd.printf(`Reloaded settings for phy ${phy}`); + return 0; + } + + hostapd.printf(`Restart interface for phy ${phy}`); + return iface_restart(phy, config, old_config); +} + +function config_add_bss(config, name) +{ + let bss = { + ifname: name, + data: [], + hash: {} + }; + + push(config.bss, bss); + + return bss; +} + +function iface_load_config(filename) +{ + let f = open(filename, "r"); + if (!f) + return null; + + let config = { + radio: { + data: [] + }, + bss: [], + orig_file: filename, + }; + + let bss; + let line; + while ((line = trim(f.read("line"))) != null) { + let val = split(line, "=", 2); + if (!val[0]) + continue; + + if (val[0] == "interface") { + bss = config_add_bss(config, val[1]); + break; + } + + if (val[0] == "channel") { + config.radio.channel = val[1]; + continue; + } + + push(config.radio.data, line); + } + + while ((line = trim(f.read("line"))) != null) { + let val = split(line, "=", 2); + if (!val[0]) + continue; + + if (val[0] == "bss") { + bss = config_add_bss(config, val[1]); + continue; + } + + if (hostapd.data.file_fields[val[0]]) + bss.hash[val[0]] = hostapd.sha1(readfile(val[1])); + + push(bss.data, line); + } + f.close(); + + return config; +} + + + +let main_obj = { + reload: { + args: { + phy: "", + }, + call: function(req) { + try { + let phy_list = req.args.phy ? [ req.args.phy ] : keys(hostapd.data.config); + for (let phy_name in phy_list) { + let phy = hostapd.data.config[phy_name]; + let config = iface_load_config(phy.orig_file); + iface_set_config(phy_name, config); + } + } catch(e) { + hostapd.printf(`Error reloading config: ${e}\n${e.stacktrace[0].context}`); + return libubus.STATUS_INVALID_ARGUMENT; + } + + return 0; + } + }, + config_set: { + args: { + phy: "", + config: "", + prev_config: "", + }, + call: function(req) { + let phy = req.args.phy; + let file = req.args.config; + let prev_file = req.args.prev_config; + + if (!phy) + return libubus.STATUS_INVALID_ARGUMENT; + + try { + if (prev_file && !hostapd.data.config[phy]) { + let config = iface_load_config(prev_file); + if (config) + config.radio.data = []; + hostapd.data.config[phy] = config; + } + + let config = iface_load_config(file); + + hostapd.printf(`Set new config for phy ${phy}: ${file}`); + iface_set_config(phy, config); + } catch(e) { + hostapd.printf(`Error loading config: ${e}\n${e.stacktrace[0].context}`); + return libubus.STATUS_INVALID_ARGUMENT; + } + + return { + pid: hostapd.getpid() + }; + } + }, + config_add: { + args: { + iface: "", + config: "", + }, + call: function(req) { + if (!req.args.iface || !req.args.config) + return libubus.STATUS_INVALID_ARGUMENT; + + if (hostapd.add_iface(`bss_config=${req.args.iface}:${req.args.config}`) < 0) + return libubus.STATUS_INVALID_ARGUMENT; + + return { + pid: hostapd.getpid() + }; + } + }, + config_remove: { + args: { + iface: "" + }, + call: function(req) { + if (!req.args.iface) + return libubus.STATUS_INVALID_ARGUMENT; + + hostapd.remove_iface(req.args.iface); + return 0; + } + }, +}; + +hostapd.data.ubus = ubus; +hostapd.data.obj = ubus.publish("hostapd", main_obj); + +function bss_event(type, name, data) { + let ubus = hostapd.data.ubus; + + data ??= {}; + data.name = name; + hostapd.data.obj.notify(`bss.${type}`, data, null, null, null, -1); + ubus.call("service", "event", { type: `hostapd.${name}.${type}`, data: {} }); +} + +return { + shutdown: function() { + for (let phy in hostapd.data.config) + iface_set_config(phy, null); + hostapd.ubus.disconnect(); + }, + bss_add: function(name, obj) { + bss_event("add", name); + }, + bss_reload: function(name, obj, reconf) { + bss_event("reload", name, { reconf: reconf != 0 }); + }, + bss_remove: function(name, obj) { + bss_event("remove", name); + } +}; diff --git a/feeds/wifi-ax/hostapd/files/wdev.uc b/feeds/wifi-ax/hostapd/files/wdev.uc new file mode 100644 index 000000000..e7f5dcc52 --- /dev/null +++ b/feeds/wifi-ax/hostapd/files/wdev.uc @@ -0,0 +1,153 @@ +#!/usr/bin/env ucode +'use strict'; +import { vlist_new, is_equal, wdev_create, wdev_remove } from "/usr/share/hostap/common.uc"; +import { readfile, writefile, basename, glob } from "fs"; + +let keep_devices = {}; +let phy = shift(ARGV); +let new_config = shift(ARGV); +const mesh_params = [ + "mesh_retry_timeout", "mesh_confirm_timeout", "mesh_holding_timeout", "mesh_max_peer_links", + "mesh_max_retries", "mesh_ttl", "mesh_element_ttl", "mesh_hwmp_max_preq_retries", + "mesh_path_refresh_time", "mesh_min_discovery_timeout", "mesh_hwmp_active_path_timeout", + "mesh_hwmp_preq_min_interval", "mesh_hwmp_net_diameter_traversal_time", "mesh_hwmp_rootmode", + "mesh_hwmp_rann_interval", "mesh_gate_announcements", "mesh_sync_offset_max_neighor", + "mesh_rssi_threshold", "mesh_hwmp_active_path_to_root_timeout", "mesh_hwmp_root_interval", + "mesh_hwmp_confirmation_interval", "mesh_awake_window", "mesh_plink_timeout", + "mesh_auto_open_plinks", "mesh_fwding", "mesh_power_mode" +]; + +function iface_stop(wdev) +{ + if (keep_devices[wdev.ifname]) + return; + + wdev_remove(wdev.ifname); +} + +function iface_start(wdev) +{ + let ifname = wdev.ifname; + + if (readfile(`/sys/class/net/${ifname}/ifindex`)) { + system([ "ip", "link", "set", "dev", ifname, "down" ]); + wdev_remove(ifname); + } + wdev_create(phy, ifname, wdev); + system([ "ip", "link", "set", "dev", ifname, "up" ]); + if (wdev.freq) + system(`iw dev ${ifname} set freq ${wdev.freq} ${wdev.htmode}`); + if (wdev.mode == "adhoc") { + let cmd = ["iw", "dev", ifname, "ibss", "join", wdev.ssid, wdev.freq, wdev.htmode, "fixed-freq" ]; + if (wdev.bssid) + push(cmd, wdev.bssid); + for (let key in [ "beacon-interval", "basic-rates", "mcast-rate", "keys" ]) + if (wdev[key]) + push(cmd, key, wdev[key]); + system(cmd); + } else if (wdev.mode == "mesh") { + let cmd = [ "iw", "dev", ifname, "mesh", "join", ssid, "freq", wdev.freq, wdev.htmode ]; + for (let key in [ "beacon-interval", "mcast-rate" ]) + if (wdev[key]) + push(cmd, key, wdev[key]); + system(cmd); + + cmd = ["iw", "dev", ifname, "set", "mesh_param" ]; + let len = length(cmd); + + for (let param in mesh_params) + if (wdev[param]) + push(cmd, param, wdev[param]); + + if (len == length(cmd)) + return; + + system(cmd); + } + +} + +function iface_cb(new_if, old_if) +{ + if (old_if && new_if && is_equal(old_if, new_if)) + return; + + if (old_if) + iface_stop(old_if); + if (new_if) + iface_start(new_if); +} + +function drop_inactive(config) +{ + for (let key in config) { + if (!readfile(`/sys/class/net/${key}/ifindex`)) + delete config[key]; + } +} + +function add_ifname(config) +{ + for (let key in config) + config.ifname = key; +} + +function delete_ifname(config) +{ + for (let key in config) + delete config.ifname; +} + +function add_existing(phy, config) +{ + let wdevs = glob(`/sys/class/ieee80211/${phy}/device/net/*`); + wdevs = map(wdevs, function(arg) { basename(arg) }); + for (let wdev in wdevs) { + if (config[wdev]) + continue; + + if (readfile(`/sys/class/net/${wdev}/operstate`) == "down") + config[wdev] = {}; + } +} + + +let statefile = `/var/run/wdev-${phy}.json`; + +for (let dev in ARGV) + keep_devices[dev] = true; + +if (!phy || !new_config) { + warn(`Usage: ${basename(sourcepath())} [conf->oce & OCE_STA_CFON) && \ -@@ -80,7 +81,7 @@ struct hapd_interfaces { - #ifdef CONFIG_CTRL_IFACE_UDP - unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN]; - #endif /* CONFIG_CTRL_IFACE_UDP */ -- -+ struct ubus_object ubus; - }; - - enum hostapd_chan_status { @@ -169,6 +170,7 @@ struct hostapd_data { struct hostapd_iface *iface; struct hostapd_config *iconf; @@ -51,10 +39,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.h void hostapd_interface_deinit(struct hostapd_iface *iface); void hostapd_interface_free(struct hostapd_iface *iface); struct hostapd_iface * hostapd_alloc_iface(void); -Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.c -+++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.c +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c @@ -395,6 +395,7 @@ void hostapd_free_hapd_data(struct hosta hapd->beacon_set_done = 0; @@ -96,10 +82,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c hostapd_interface_deinit(iface); wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); -Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ieee802_11.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c @@ -3421,13 +3421,18 @@ static void handle_auth(struct hostapd_d u16 auth_alg, auth_transaction, status_code; u16 resp = WLAN_STATUS_SUCCESS; @@ -186,10 +170,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c sta = ap_get_sta(hapd, mgmt->sa); if (sta == NULL) { wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying " -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 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c @@ -823,6 +823,12 @@ void handle_probe_req(struct hostapd_dat u16 csa_offs[2]; size_t csa_offs_len; @@ -216,10 +198,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c /* TODO: verify that supp_rates contains at least one matching rate * with AP configuration */ -Index: hostapd-2021-02-20-59e9794c/src/ap/drv_callbacks.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/drv_callbacks.c -+++ hostapd-2021-02-20-59e9794c/src/ap/drv_callbacks.c +--- a/src/ap/drv_callbacks.c ++++ b/src/ap/drv_callbacks.c @@ -145,6 +145,10 @@ int hostapd_notif_assoc(struct hostapd_d u16 reason = WLAN_REASON_UNSPECIFIED; int status = WLAN_STATUS_SUCCESS; @@ -244,10 +224,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/drv_callbacks.c #ifdef CONFIG_P2P if (elems.p2p) { wpabuf_free(sta->p2p_ie); -Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/sta_info.c -+++ hostapd-2021-02-20-59e9794c/src/ap/sta_info.c +--- a/src/ap/sta_info.c ++++ b/src/ap/sta_info.c @@ -458,6 +458,7 @@ void ap_handle_timer(void *eloop_ctx, vo hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_INFO, "deauthenticated due to " @@ -264,26 +242,70 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.c ap_free_sta(hapd, sta); break; } -@@ -1319,6 +1321,7 @@ void ap_sta_set_authorized(struct hostap +@@ -1298,12 +1300,25 @@ void ap_sta_set_authorized(struct hostap + sta->addr, authorized, dev_addr); + + if (authorized) { ++ static const char * const auth_algs[] = { ++ [WLAN_AUTH_OPEN] = "open", ++ [WLAN_AUTH_SHARED_KEY] = "shared", ++ [WLAN_AUTH_FT] = "ft", ++ [WLAN_AUTH_SAE] = "sae", ++ [WLAN_AUTH_FILS_SK] = "fils-sk", ++ [WLAN_AUTH_FILS_SK_PFS] = "fils-sk-pfs", ++ [WLAN_AUTH_FILS_PK] = "fils-pk", ++ [WLAN_AUTH_PASN] = "pasn", ++ }; ++ const char *auth_alg = NULL; + const char *keyid; + char keyid_buf[100]; + char ip_addr[100]; ++ char alg_buf[100]; + + keyid_buf[0] = '\0'; + ip_addr[0] = '\0'; ++ alg_buf[0] = '\0'; + #ifdef CONFIG_P2P + if (wpa_auth_get_ip_addr(sta->wpa_sm, ip_addr_buf) == 0) { + os_snprintf(ip_addr, sizeof(ip_addr), +@@ -1313,22 +1328,31 @@ void ap_sta_set_authorized(struct hostap + } + #endif /* CONFIG_P2P */ + ++ if (sta->auth_alg < ARRAY_SIZE(auth_algs)) ++ auth_alg = auth_algs[sta->auth_alg]; ++ ++ if (auth_alg) ++ os_snprintf(alg_buf, sizeof(alg_buf), ++ " auth_alg=%s", auth_alg); ++ + keyid = ap_sta_wpa_get_keyid(hapd, sta); + if (keyid) { + os_snprintf(keyid_buf, sizeof(keyid_buf), " keyid=%s", keyid); } +- wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s", +- buf, ip_addr, keyid_buf); + hostapd_ubus_notify_authorized(hapd, sta); - wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s", - buf, ip_addr, keyid_buf); ++ wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s", ++ buf, ip_addr, keyid_buf, alg_buf); -@@ -1329,6 +1332,7 @@ void ap_sta_set_authorized(struct hostap - buf, ip_addr, keyid_buf); + if (hapd->msg_ctx_parent && + hapd->msg_ctx_parent != hapd->msg_ctx) + wpa_msg_no_global(hapd->msg_ctx_parent, MSG_INFO, +- AP_STA_CONNECTED "%s%s%s", +- buf, ip_addr, keyid_buf); ++ AP_STA_CONNECTED "%s%s%s%s", ++ buf, ip_addr, keyid_buf, alg_buf); } else { wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf); + hostapd_ubus_notify(hapd, "disassoc", sta->addr); if (hapd->msg_ctx_parent && hapd->msg_ctx_parent != hapd->msg_ctx) -Index: hostapd-2021-02-20-59e9794c/src/ap/wpa_auth_glue.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/wpa_auth_glue.c -+++ hostapd-2021-02-20-59e9794c/src/ap/wpa_auth_glue.c +--- a/src/ap/wpa_auth_glue.c ++++ b/src/ap/wpa_auth_glue.c @@ -265,6 +265,7 @@ static void hostapd_wpa_auth_psk_failure struct hostapd_data *hapd = ctx; wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR, @@ -292,24 +314,23 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/wpa_auth_glue.c } -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 -@@ -171,6 +171,12 @@ ifdef CONFIG_EAPOL_TEST +--- a/wpa_supplicant/Makefile ++++ b/wpa_supplicant/Makefile +@@ -171,6 +171,13 @@ ifdef CONFIG_EAPOL_TEST CFLAGS += -Werror -DEAPOL_TEST endif +ifdef CONFIG_UBUS +CFLAGS += -DUBUS_SUPPORT +OBJS += ubus.o ++OBJS += ../src/utils/uloop.o +LIBS += -lubox -lubus +endif + ifdef CONFIG_CODE_COVERAGE CFLAGS += -O0 -fprofile-arcs -ftest-coverage LIBS += -lgcov -@@ -948,6 +954,9 @@ ifdef CONFIG_CTRL_IFACE_MIB +@@ -948,6 +955,9 @@ ifdef CONFIG_CTRL_IFACE_MIB CFLAGS += -DCONFIG_CTRL_IFACE_MIB endif OBJS += ../src/ap/ctrl_iface_ap.o @@ -319,10 +340,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/Makefile endif CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY -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 +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c @@ -7012,6 +7012,8 @@ struct wpa_supplicant * wpa_supplicant_a } #endif /* CONFIG_P2P */ @@ -354,10 +373,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c return 0; } -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 +--- a/wpa_supplicant/wpa_supplicant_i.h ++++ b/wpa_supplicant/wpa_supplicant_i.h @@ -19,6 +19,7 @@ #include "wps/wps_defs.h" #include "config_ssid.h" @@ -383,10 +400,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant_i.h #ifdef CONFIG_MATCH_IFACE int matched; #endif /* CONFIG_MATCH_IFACE */ -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wps_supplicant.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wps_supplicant.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wps_supplicant.c +--- a/wpa_supplicant/wps_supplicant.c ++++ b/wpa_supplicant/wps_supplicant.c @@ -33,6 +33,7 @@ #include "p2p/p2p.h" #include "p2p_supplicant.h" @@ -404,30 +419,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wps_supplicant.c if (wpa_s->conf->wps_cred_processing == 1) return 0; -Index: hostapd-2021-02-20-59e9794c/hostapd/main.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/hostapd/main.c -+++ hostapd-2021-02-20-59e9794c/hostapd/main.c -@@ -895,6 +895,7 @@ int main(int argc, char *argv[]) - } - - hostapd_global_ctrl_iface_init(&interfaces); -+ hostapd_ubus_add(&interfaces); - - 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[]) - ret = 0; - - out: -+ hostapd_ubus_free(&interfaces); - hostapd_global_ctrl_iface_deinit(&interfaces); - /* Deinitialize all interfaces */ - for (i = 0; i < interfaces.count; i++) { -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 +--- a/wpa_supplicant/main.c ++++ b/wpa_supplicant/main.c @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) for (;;) { @@ -447,10 +440,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/main.c case 'o': params.override_driver = optarg; break; -Index: hostapd-2021-02-20-59e9794c/src/ap/rrm.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/rrm.c -+++ hostapd-2021-02-20-59e9794c/src/ap/rrm.c +--- a/src/ap/rrm.c ++++ b/src/ap/rrm.c @@ -89,6 +89,9 @@ static void hostapd_handle_beacon_report return; wpa_msg(hapd->msg_ctx, MSG_INFO, BEACON_RESP_RX MACSTR " %u %02x %s", @@ -461,10 +452,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/rrm.c } -Index: hostapd-2021-02-20-59e9794c/src/ap/vlan_init.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/vlan_init.c -+++ hostapd-2021-02-20-59e9794c/src/ap/vlan_init.c +--- a/src/ap/vlan_init.c ++++ b/src/ap/vlan_init.c @@ -22,6 +22,7 @@ static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan, int existsok) @@ -501,11 +490,9 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/vlan_init.c return hostapd_vlan_if_remove(hapd, vlan->ifname); } -Index: hostapd-2021-02-20-59e9794c/src/ap/dfs.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/dfs.c -+++ hostapd-2021-02-20-59e9794c/src/ap/dfs.c -@@ -1193,6 +1193,8 @@ int hostapd_dfs_radar_detected(struct ho +--- a/src/ap/dfs.c ++++ b/src/ap/dfs.c +@@ -1226,6 +1226,8 @@ int hostapd_dfs_nop_finished(struct host "freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d", freq, ht_enabled, chan_offset, chan_width, cf1, cf2); @@ -514,10 +501,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/dfs.c /* Proceed only if DFS is not offloaded to the driver */ if (iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) return 0; -Index: hostapd-2021-02-20-59e9794c/src/ap/airtime_policy.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/airtime_policy.c -+++ hostapd-2021-02-20-59e9794c/src/ap/airtime_policy.c +--- a/src/ap/airtime_policy.c ++++ b/src/ap/airtime_policy.c @@ -108,8 +108,14 @@ static void set_sta_weights(struct hosta { struct sta_info *sta; @@ -547,10 +532,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/airtime_policy.c if (weight) return sta_set_airtime_weight(hapd, sta, weight); } -Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/sta_info.h -+++ hostapd-2021-02-20-59e9794c/src/ap/sta_info.h +--- a/src/ap/sta_info.h ++++ b/src/ap/sta_info.h @@ -323,6 +323,7 @@ struct sta_info { #endif /* CONFIG_TESTING_OPTIONS */ #ifdef CONFIG_AIRTIME_POLICY @@ -559,10 +542,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.h struct os_reltime backlogged_until; #endif /* CONFIG_AIRTIME_POLICY */ -Index: hostapd-2021-02-20-59e9794c/src/ap/wnm_ap.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/wnm_ap.c -+++ hostapd-2021-02-20-59e9794c/src/ap/wnm_ap.c +--- a/src/ap/wnm_ap.c ++++ b/src/ap/wnm_ap.c @@ -442,7 +442,8 @@ static void ieee802_11_rx_bss_trans_mgmt wpa_hexdump(MSG_DEBUG, "WNM: BSS Transition Candidate List Entries", pos, end - pos); @@ -601,3 +582,151 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/wnm_ap.c wpa_hexdump(MSG_DEBUG, "WNM: BSS Transition Candidate List Entries", pos, end - pos); } +--- a/src/utils/eloop.c ++++ b/src/utils/eloop.c +@@ -77,6 +77,9 @@ struct eloop_sock_table { + struct eloop_data { + int max_sock; + ++ eloop_timeout_poll_handler timeout_poll_cb; ++ eloop_poll_handler poll_cb; ++ + size_t count; /* sum of all table counts */ + #ifdef CONFIG_ELOOP_POLL + size_t max_pollfd_map; /* number of pollfds_map currently allocated */ +@@ -1116,6 +1119,12 @@ void eloop_run(void) + os_reltime_sub(&timeout->time, &now, &tv); + else + tv.sec = tv.usec = 0; ++ } ++ ++ if (eloop.timeout_poll_cb && eloop.timeout_poll_cb(&tv, !!timeout)) ++ timeout = (void *)1; ++ ++ if (timeout) { + #if defined(CONFIG_ELOOP_POLL) || defined(CONFIG_ELOOP_EPOLL) + timeout_ms = tv.sec * 1000 + tv.usec / 1000; + #endif /* defined(CONFIG_ELOOP_POLL) || defined(CONFIG_ELOOP_EPOLL) */ +@@ -1185,7 +1194,8 @@ void eloop_run(void) + eloop.exceptions.changed = 0; + + eloop_process_pending_signals(); +- ++ if (eloop.poll_cb) ++ eloop.poll_cb(); + + /* check if some registered timeouts have occurred */ + timeout = dl_list_first(&eloop.timeout, struct eloop_timeout, +@@ -1247,6 +1257,14 @@ out: + return; + } + ++int eloop_register_cb(eloop_poll_handler poll_cb, ++ eloop_timeout_poll_handler timeout_cb) ++{ ++ eloop.poll_cb = poll_cb; ++ eloop.timeout_poll_cb = timeout_cb; ++ ++ return 0; ++} + + void eloop_terminate(void) + { +--- a/src/utils/eloop.h ++++ b/src/utils/eloop.h +@@ -65,6 +65,9 @@ typedef void (*eloop_timeout_handler)(vo + */ + typedef void (*eloop_signal_handler)(int sig, void *signal_ctx); + ++typedef bool (*eloop_timeout_poll_handler)(struct os_reltime *tv, bool tv_set); ++typedef void (*eloop_poll_handler)(void); ++ + /** + * eloop_init() - Initialize global event loop data + * Returns: 0 on success, -1 on failure +@@ -73,6 +76,9 @@ typedef void (*eloop_signal_handler)(int + */ + int eloop_init(void); + ++int eloop_register_cb(eloop_poll_handler poll_cb, ++ eloop_timeout_poll_handler timeout_cb); ++ + /** + * eloop_register_read_sock - Register handler for read events + * @sock: File descriptor number for the socket +@@ -320,6 +326,8 @@ int eloop_register_signal_reconfig(eloop + */ + int eloop_sock_requeue(void); + ++void eloop_add_uloop(void); ++ + /** + * eloop_run - Start the event loop + * +--- /dev/null ++++ b/src/utils/uloop.c +@@ -0,0 +1,64 @@ ++#include ++#include "includes.h" ++#include "common.h" ++#include "eloop.h" ++ ++static void eloop_uloop_event_cb(int sock, void *eloop_ctx, void *sock_ctx) ++{ ++} ++ ++static void eloop_uloop_fd_cb(struct uloop_fd *fd, unsigned int events) ++{ ++ unsigned int changed = events ^ fd->flags; ++ ++ if (changed & ULOOP_READ) { ++ if (events & ULOOP_READ) ++ eloop_register_sock(fd->fd, EVENT_TYPE_READ, eloop_uloop_event_cb, fd, fd); ++ else ++ eloop_unregister_sock(fd->fd, EVENT_TYPE_READ); ++ } ++ ++ if (changed & ULOOP_WRITE) { ++ if (events & ULOOP_WRITE) ++ eloop_register_sock(fd->fd, EVENT_TYPE_WRITE, eloop_uloop_event_cb, fd, fd); ++ else ++ eloop_unregister_sock(fd->fd, EVENT_TYPE_WRITE); ++ } ++} ++ ++static bool uloop_timeout_poll_handler(struct os_reltime *tv, bool tv_set) ++{ ++ struct os_reltime tv_uloop; ++ int timeout_ms = uloop_get_next_timeout(); ++ ++ if (timeout_ms < 0) ++ return false; ++ ++ tv_uloop.sec = timeout_ms / 1000; ++ tv_uloop.usec = (timeout_ms % 1000) * 1000; ++ ++ if (!tv_set || os_reltime_before(&tv_uloop, tv)) { ++ *tv = tv_uloop; ++ return true; ++ } ++ ++ return false; ++} ++ ++static void uloop_poll_handler(void) ++{ ++ uloop_run_timeout(0); ++} ++ ++void eloop_add_uloop(void) ++{ ++ static bool init_done = false; ++ ++ if (!init_done) { ++ uloop_init(); ++ uloop_fd_set_cb = eloop_uloop_fd_cb; ++ init_done = true; ++ } ++ ++ eloop_register_cb(uloop_poll_handler, uloop_timeout_poll_handler); ++} diff --git a/feeds/wifi-ax/hostapd/patches/601-ucode_support.patch b/feeds/wifi-ax/hostapd/patches/601-ucode_support.patch new file mode 100644 index 000000000..69d5df96b --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/601-ucode_support.patch @@ -0,0 +1,224 @@ +--- a/hostapd/Makefile ++++ b/hostapd/Makefile +@@ -168,9 +168,21 @@ OBJS += ../src/eapol_auth/eapol_auth_sm. + + ifdef CONFIG_UBUS + CFLAGS += -DUBUS_SUPPORT +-OBJS += ../src/utils/uloop.o + OBJS += ../src/ap/ubus.o +-LIBS += -lubox -lubus ++LIBS += -lubus ++NEED_ULOOP:=y ++endif ++ ++ifdef CONFIG_UCODE ++CFLAGS += -DUCODE_SUPPORT ++OBJS += ../src/utils/ucode.o ++OBJS += ../src/ap/ucode.o ++NEED_ULOOP:=y ++endif ++ ++ifdef NEED_ULOOP ++OBJS += ../src/utils/uloop.o ++LIBS += -lubox + endif + + ifdef CONFIG_CODE_COVERAGE +--- a/hostapd/main.c ++++ b/hostapd/main.c +@@ -895,6 +895,7 @@ int main(int argc, char *argv[]) + } + + hostapd_global_ctrl_iface_init(&interfaces); ++ hostapd_ucode_init(&interfaces); + + 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[]) + ret = 0; + + out: ++ hostapd_ucode_free(); + hostapd_global_ctrl_iface_deinit(&interfaces); + /* Deinitialize all interfaces */ + for (i = 0; i < interfaces.count; i++) { +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h +@@ -18,6 +18,7 @@ + #include "ap_config.h" + #include "drivers/driver.h" + #include "ubus.h" ++#include "ucode.h" + + #define OCE_STA_CFON_ENABLED(hapd) \ + ((hapd->conf->oce & OCE_STA_CFON) && \ +@@ -50,6 +51,10 @@ struct hapd_interfaces { + 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); ++ int (*ctrl_iface_recv)(struct hostapd_data *hapd, ++ char *buf, char *reply, int reply_size, ++ struct sockaddr_storage *from, ++ socklen_t fromlen); + int (*for_each_interface)(struct hapd_interfaces *interfaces, + int (*cb)(struct hostapd_iface *iface, + void *ctx), void *ctx); +@@ -171,6 +176,7 @@ struct hostapd_data { + struct hostapd_config *iconf; + struct hostapd_bss_config *conf; + struct hostapd_ubus_bss ubus; ++ struct hostapd_ucode_bss ucode; + int interface_added; /* virtual interface added for this BSS */ + unsigned int started:1; + unsigned int disabled:1; +@@ -463,6 +469,7 @@ struct hostapd_sta_info { + */ + struct hostapd_iface { + struct hapd_interfaces *interfaces; ++ struct hostapd_ucode_iface ucode; + void *owner; + char *config_fname; + struct hostapd_config *conf; +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -239,6 +239,8 @@ int hostapd_reload_config(struct hostapd + size_t j; + int i; + ++ hostapd_ucode_reload_bss(hapd, reconf); ++ + 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 + hapd->beacon_set_done = 0; + + wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); ++ hostapd_ucode_free_bss(hapd); + hostapd_ubus_free_bss(hapd); + accounting_deinit(hapd); + hostapd_deinit_wpa(hapd); +@@ -549,6 +552,7 @@ void hostapd_cleanup_iface_partial(struc + static void hostapd_cleanup_iface(struct hostapd_iface *iface) + { + wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); ++ hostapd_ucode_free_iface(iface); + 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 + hapd->driver->set_operstate(hapd->drv_priv, 1); + + hostapd_ubus_add_bss(hapd); ++ hostapd_ucode_add_bss(hapd); + + return 0; + } +--- a/wpa_supplicant/Makefile ++++ b/wpa_supplicant/Makefile +@@ -174,8 +174,20 @@ endif + ifdef CONFIG_UBUS + CFLAGS += -DUBUS_SUPPORT + OBJS += ubus.o ++LIBS += -lubus ++NEED_ULOOP:=y ++endif ++ ++ifdef CONFIG_UCODE ++CFLAGS += -DUCODE_SUPPORT ++OBJS += ../src/utils/ucode.o ++OBJS += ucode.o ++NEED_ULOOP:=y ++endif ++ ++ifdef NEED_ULOOP + OBJS += ../src/utils/uloop.o +-LIBS += -lubox -lubus ++LIBS += -lubox + endif + + ifdef CONFIG_CODE_COVERAGE +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -7013,6 +7013,7 @@ struct wpa_supplicant * wpa_supplicant_a + #endif /* CONFIG_P2P */ + + wpas_ubus_add_bss(wpa_s); ++ wpas_ucode_add_bss(wpa_s); + + return wpa_s; + } +@@ -7040,6 +7041,7 @@ int wpa_supplicant_remove_iface(struct w + struct wpa_supplicant *parent = wpa_s->parent; + #endif /* CONFIG_MESH */ + ++ wpas_ucode_free_bss(wpa_s); + wpas_ubus_free_bss(wpa_s); + + /* Remove interface from the global list of interfaces */ +@@ -7307,6 +7309,7 @@ struct wpa_global * wpa_supplicant_init( + + eloop_register_timeout(WPA_SUPPLICANT_CLEANUP_INTERVAL, 0, + wpas_periodic, global, NULL); ++ wpas_ucode_init(global); + + return global; + } +@@ -7345,12 +7348,8 @@ int wpa_supplicant_run(struct wpa_global + eloop_register_signal_terminate(wpa_supplicant_terminate, global); + eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); + +- wpas_ubus_add(global); +- + eloop_run(); + +- wpas_ubus_free(global); +- + return 0; + } + +@@ -7383,6 +7382,8 @@ void wpa_supplicant_deinit(struct wpa_gl + + wpas_notify_supplicant_deinitialized(global); + ++ wpas_ucode_free(); ++ + eap_peer_unregister_methods(); + #ifdef CONFIG_AP + eap_server_unregister_methods(); +--- a/wpa_supplicant/wpa_supplicant_i.h ++++ b/wpa_supplicant/wpa_supplicant_i.h +@@ -20,6 +20,7 @@ + #include "config_ssid.h" + #include "wmm_ac.h" + #include "ubus.h" ++#include "ucode.h" + + extern const char *const wpa_supplicant_version; + extern const char *const wpa_supplicant_license; +@@ -605,6 +606,7 @@ struct wpa_supplicant { + unsigned char perm_addr[ETH_ALEN]; + char ifname[100]; + struct wpas_ubus_bss ubus; ++ struct wpas_ucode_bss ucode; + #ifdef CONFIG_MATCH_IFACE + int matched; + #endif /* CONFIG_MATCH_IFACE */ +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -4941,6 +4941,7 @@ try_again: + return -1; + } + ++ interface->ctrl_iface_recv = hostapd_ctrl_iface_receive_process; + wpa_msg_register_cb(hostapd_ctrl_iface_msg_cb); + + return 0; +@@ -5042,6 +5043,7 @@ fail: + os_free(fname); + + interface->global_ctrl_sock = s; ++ interface->ctrl_iface_recv = hostapd_ctrl_iface_receive_process; + eloop_register_read_sock(s, hostapd_global_ctrl_iface_receive, + interface, NULL); + diff --git a/feeds/wifi-ax/hostapd/patches/700-wifi-reload.patch b/feeds/wifi-ax/hostapd/patches/700-wifi-reload.patch index 5993b0d44..a4890379a 100644 --- a/feeds/wifi-ax/hostapd/patches/700-wifi-reload.patch +++ b/feeds/wifi-ax/hostapd/patches/700-wifi-reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2453,6 +2453,8 @@ static int hostapd_config_fill(struct ho +@@ -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); @@ -8,8 +8,13 @@ + 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) { -@@ -3153,6 +3155,8 @@ static int hostapd_config_fill(struct ho + 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); @@ -20,7 +25,7 @@ } else if (os_strcmp(buf, "channel") == 0) { --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -791,6 +791,7 @@ void hostapd_config_free_bss(struct host +@@ -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); @@ -28,7 +33,7 @@ os_free(conf->ca_cert); os_free(conf->server_cert); os_free(conf->server_cert2); -@@ -987,6 +988,7 @@ void hostapd_config_free(struct hostapd_ +@@ -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]); @@ -38,16 +43,15 @@ os_free(conf->basic_rates); --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -279,6 +279,8 @@ struct hostapd_bss_config { - char vlan_bridge[IFNAMSIZ + 1]; - char wds_bridge[IFNAMSIZ + 1]; +@@ -882,6 +882,7 @@ struct hostapd_bss_config { + #endif /* CONFIG_PASN */ + unsigned int unsol_bcast_probe_resp_interval; + char *config_id; -+ - enum hostapd_logger_level logger_syslog_level, logger_stdout_level; + }; - unsigned int logger_syslog; /* module bitfield */ -@@ -938,6 +940,7 @@ struct spatial_reuse { + /** +@@ -924,6 +925,7 @@ struct spatial_reuse { struct hostapd_config { struct hostapd_bss_config **bss, *last_bss; size_t num_bss; @@ -57,7 +61,61 @@ int rts_threshold; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -219,6 +219,10 @@ static int hostapd_iface_conf_changed(st +@@ -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; @@ -68,7 +126,7 @@ if (newconf->num_bss != oldconf->num_bss) return 1; -@@ -232,7 +236,7 @@ static int hostapd_iface_conf_changed(st +@@ -231,7 +242,7 @@ static int hostapd_iface_conf_changed(st } @@ -77,7 +135,7 @@ { struct hapd_interfaces *interfaces = iface->interfaces; struct hostapd_data *hapd = iface->bss[0]; -@@ -255,13 +259,16 @@ int hostapd_reload_config(struct hostapd +@@ -256,13 +267,16 @@ int hostapd_reload_config(struct hostapd if (newconf == NULL) return -1; @@ -96,7 +154,7 @@ wpa_printf(MSG_DEBUG, "Configuration changes include interface/BSS modification - force full disable+enable sequence"); fname = os_strdup(iface->config_fname); -@@ -286,6 +293,24 @@ int hostapd_reload_config(struct hostapd +@@ -287,6 +301,24 @@ int hostapd_reload_config(struct hostapd wpa_printf(MSG_ERROR, "Failed to enable interface on config reload"); return res; @@ -121,7 +179,7 @@ } iface->conf = newconf; -@@ -302,6 +327,12 @@ int hostapd_reload_config(struct hostapd +@@ -303,6 +335,16 @@ int hostapd_reload_config(struct hostapd for (j = 0; j < iface->num_bss; j++) { hapd = iface->bss[j]; @@ -131,10 +189,32 @@ + } + 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); -@@ -2397,6 +2428,10 @@ hostapd_alloc_bss_data(struct hostapd_if +@@ -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; @@ -145,46 +225,24 @@ if (conf) hapd->driver = conf->driver; hapd->ctrl_sock = -1; ---- a/src/ap/hostapd.h -+++ b/src/ap/hostapd.h -@@ -46,7 +46,7 @@ struct mesh_conf; - struct hostapd_iface; +@@ -2392,7 +2438,7 @@ hostapd_alloc_bss_data(struct hostapd_if + } - 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); -@@ -156,6 +156,7 @@ struct hostapd_data { - struct hostapd_config *iconf; - struct hostapd_bss_config *conf; - struct hostapd_ubus_bss ubus; -+ char *config_id; - int interface_added; /* virtual interface added for this BSS */ - unsigned int started:1; - unsigned int disabled:1; -@@ -604,7 +605,7 @@ 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_reconfig_encryption(struct hostapd_data *hapd); - struct hostapd_data * - hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface, ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -4820,6 +4820,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, + +-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 @@ -207,6 +265,44 @@ 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 @@ -218,3 +314,15 @@ 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/710-vlan_no_bridge.patch b/feeds/wifi-ax/hostapd/patches/710-vlan_no_bridge.patch index 73db32e54..3aeb36b49 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 -@@ -3366,6 +3366,8 @@ static int hostapd_config_fill(struct ho +@@ -3349,6 +3349,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/711-wds_bridge_force.patch b/feeds/wifi-ax/hostapd/patches/711-wds_bridge_force.patch index 76a354780..f8bb39186 100644 --- a/feeds/wifi-ax/hostapd/patches/711-wds_bridge_force.patch +++ b/feeds/wifi-ax/hostapd/patches/711-wds_bridge_force.patch @@ -1,8 +1,6 @@ -Index: hostapd-2021-05-22-b102f19b/hostapd/config_file.c -=================================================================== ---- hostapd-2021-05-22-b102f19b.orig/hostapd/config_file.c -+++ hostapd-2021-05-22-b102f19b/hostapd/config_file.c -@@ -2357,6 +2357,8 @@ static int hostapd_config_fill(struct ho +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -2341,6 +2341,8 @@ static int hostapd_config_fill(struct ho sizeof(conf->bss[0]->iface)); } else if (os_strcmp(buf, "bridge") == 0) { os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); @@ -11,10 +9,8 @@ Index: hostapd-2021-05-22-b102f19b/hostapd/config_file.c } else if (os_strcmp(buf, "vlan_bridge") == 0) { os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge)); } else if (os_strcmp(buf, "wds_bridge") == 0) { -Index: hostapd-2021-05-22-b102f19b/src/ap/ap_drv_ops.c -=================================================================== ---- hostapd-2021-05-22-b102f19b.orig/src/ap/ap_drv_ops.c -+++ hostapd-2021-05-22-b102f19b/src/ap/ap_drv_ops.c +--- a/src/ap/ap_drv_ops.c ++++ b/src/ap/ap_drv_ops.c @@ -340,8 +340,6 @@ int hostapd_set_wds_sta(struct hostapd_d return -1; if (hapd->conf->wds_bridge[0]) 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 b93a0bcbe..ef6ac28d6 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 -@@ -2873,6 +2873,14 @@ static int hostapd_config_fill(struct ho +@@ -2858,6 +2858,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 -@@ -648,6 +648,7 @@ void hostapd_cleanup_cs_params(struct ho +@@ -674,6 +674,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 -@@ -236,6 +236,30 @@ static int hostapd_iface_conf_changed(st +@@ -242,6 +242,30 @@ static int hostapd_iface_conf_changed(st } @@ -71,7 +71,7 @@ " since no room for additional STA", --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -976,6 +976,8 @@ struct hostapd_config { +@@ -961,6 +961,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 793e8e019..8a56184e8 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 -@@ -3031,6 +3031,8 @@ static int hostapd_config_fill(struct ho +@@ -3016,6 +3016,8 @@ static int hostapd_config_fill(struct ho wpa_printf(MSG_INFO, "Line %d: Obsolete peerkey parameter ignored", line); #ifdef CONFIG_IEEE80211R_AP @@ -11,7 +11,7 @@ hexstr2bin(pos, bss->mobility_domain, --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -277,6 +277,7 @@ struct airtime_sta_weight { +@@ -275,6 +275,7 @@ struct airtime_sta_weight { struct hostapd_bss_config { char iface[IFNAMSIZ + 1]; char bridge[IFNAMSIZ + 1]; diff --git a/feeds/wifi-ax/hostapd/patches/740-snoop_iface.patch b/feeds/wifi-ax/hostapd/patches/740-snoop_iface.patch index 6e60cde84..94816ee0e 100644 --- a/feeds/wifi-ax/hostapd/patches/740-snoop_iface.patch +++ b/feeds/wifi-ax/hostapd/patches/740-snoop_iface.patch @@ -1,8 +1,6 @@ -Index: hostapd-2021-05-22-b102f19b/src/ap/ap_config.h -=================================================================== ---- hostapd-2021-05-22-b102f19b.orig/src/ap/ap_config.h -+++ hostapd-2021-05-22-b102f19b/src/ap/ap_config.h -@@ -278,6 +278,7 @@ struct hostapd_bss_config { +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -276,6 +276,7 @@ struct hostapd_bss_config { char iface[IFNAMSIZ + 1]; char bridge[IFNAMSIZ + 1]; char ft_iface[IFNAMSIZ + 1]; @@ -10,10 +8,8 @@ Index: hostapd-2021-05-22-b102f19b/src/ap/ap_config.h char vlan_bridge[IFNAMSIZ + 1]; char wds_bridge[IFNAMSIZ + 1]; -Index: hostapd-2021-05-22-b102f19b/src/ap/x_snoop.c -=================================================================== ---- hostapd-2021-05-22-b102f19b.orig/src/ap/x_snoop.c -+++ hostapd-2021-05-22-b102f19b/src/ap/x_snoop.c +--- a/src/ap/x_snoop.c ++++ b/src/ap/x_snoop.c @@ -31,14 +31,16 @@ int x_snoop_init(struct hostapd_data *ha return -1; } @@ -57,11 +53,9 @@ Index: hostapd-2021-05-22-b102f19b/src/ap/x_snoop.c if (l2 == NULL) { wpa_printf(MSG_DEBUG, "x_snoop: Failed to initialize L2 packet processing %s", -Index: hostapd-2021-05-22-b102f19b/hostapd/config_file.c -=================================================================== ---- hostapd-2021-05-22-b102f19b.orig/hostapd/config_file.c -+++ hostapd-2021-05-22-b102f19b/hostapd/config_file.c -@@ -2359,6 +2359,8 @@ static int hostapd_config_fill(struct ho +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -2343,6 +2343,8 @@ static int hostapd_config_fill(struct ho os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); if (!bss->wds_bridge[0]) os_strlcpy(bss->wds_bridge, pos, sizeof(bss->wds_bridge)); diff --git a/feeds/wifi-ax/hostapd/patches/750-wispr.patch b/feeds/wifi-ax/hostapd/patches/750-wispr.patch index 59537cede..f40cc2b90 100644 --- a/feeds/wifi-ax/hostapd/patches/750-wispr.patch +++ b/feeds/wifi-ax/hostapd/patches/750-wispr.patch @@ -1,7 +1,5 @@ -Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_1x.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ieee802_1x.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ieee802_1x.c +--- a/src/ap/ieee802_1x.c ++++ b/src/ap/ieee802_1x.c @@ -1904,6 +1904,25 @@ static int ieee802_1x_update_vlan(struct } #endif /* CONFIG_NO_VLAN */ @@ -36,11 +34,9 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_1x.c break; case RADIUS_CODE_ACCESS_REJECT: sm->eap_if->aaaFail = true; -Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/sta_info.h -+++ hostapd-2021-02-20-59e9794c/src/ap/sta_info.h -@@ -117,6 +117,7 @@ struct sta_info { +--- a/src/ap/sta_info.h ++++ b/src/ap/sta_info.h +@@ -116,6 +116,7 @@ struct sta_info { u8 supported_rates[WLAN_SUPP_RATES_MAX]; int supported_rates_len; u8 qosinfo; /* Valid when WLAN_STA_WMM is set */ @@ -48,10 +44,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.h #ifdef CONFIG_MESH enum mesh_plink_state plink_state; -Index: hostapd-2021-02-20-59e9794c/src/radius/radius.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/radius/radius.c -+++ hostapd-2021-02-20-59e9794c/src/radius/radius.c +--- a/src/radius/radius.c ++++ b/src/radius/radius.c @@ -1182,6 +1182,35 @@ radius_msg_get_cisco_keys(struct radius_ return keys; } @@ -88,10 +82,8 @@ Index: hostapd-2021-02-20-59e9794c/src/radius/radius.c int radius_msg_add_mppe_keys(struct radius_msg *msg, const u8 *req_authenticator, -Index: hostapd-2021-02-20-59e9794c/src/radius/radius.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/radius/radius.h -+++ hostapd-2021-02-20-59e9794c/src/radius/radius.h +--- a/src/radius/radius.h ++++ b/src/radius/radius.h @@ -205,6 +205,10 @@ enum { RADIUS_VENDOR_ATTR_WFA_HS20_T_C_URL = 10, }; diff --git a/feeds/wifi-ax/hostapd/patches/760-acs_exclude_dfs.patch b/feeds/wifi-ax/hostapd/patches/760-acs_exclude_dfs.patch index 52d63c5ff..27b3a6161 100644 --- a/feeds/wifi-ax/hostapd/patches/760-acs_exclude_dfs.patch +++ b/feeds/wifi-ax/hostapd/patches/760-acs_exclude_dfs.patch @@ -1,8 +1,6 @@ -Index: hostapd-2021-02-20-59e9794c/src/ap/acs.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/acs.c -+++ hostapd-2021-02-20-59e9794c/src/ap/acs.c -@@ -672,6 +672,10 @@ acs_find_ideal_chan_mode(struct hostapd_ +--- a/src/ap/acs.c ++++ b/src/ap/acs.c +@@ -668,6 +668,10 @@ acs_find_ideal_chan_mode(struct hostapd_ continue; } 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 3d2b59e8c..530d835cf 100644 --- a/feeds/wifi-ax/hostapd/patches/760-dynamic_own_ip.patch +++ b/feeds/wifi-ax/hostapd/patches/760-dynamic_own_ip.patch @@ -1,6 +1,6 @@ --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -311,6 +311,7 @@ struct hostapd_bss_config { +@@ -301,6 +301,7 @@ struct hostapd_bss_config { unsigned int eap_sim_db_timeout; int eap_server_erp; /* Whether ERP is enabled on internal EAP server */ struct hostapd_ip_addr own_ip_addr; @@ -10,7 +10,7 @@ int acct_interim_interval; --- a/src/radius/radius_client.c +++ b/src/radius/radius_client.c -@@ -163,6 +163,8 @@ struct radius_client_data { +@@ -162,6 +162,8 @@ struct radius_client_data { */ void *ctx; @@ -19,7 +19,7 @@ /** * conf - RADIUS client configuration (list of RADIUS servers to use) */ -@@ -720,6 +722,30 @@ static void radius_client_list_add(struc +@@ -719,6 +721,30 @@ static void radius_client_list_add(struc /** @@ -50,7 +50,7 @@ * radius_client_send - Send a RADIUS request * @radius: RADIUS client context from radius_client_init() * @msg: RADIUS message to be sent -@@ -1238,6 +1264,10 @@ radius_change_server(struct radius_clien +@@ -1219,6 +1245,10 @@ radius_change_server(struct radius_clien wpa_printf(MSG_DEBUG, "RADIUS local address: %s:%u", inet_ntoa(claddr.sin_addr), ntohs(claddr.sin_port)); @@ -61,7 +61,7 @@ } break; #ifdef CONFIG_IPV6 -@@ -1249,6 +1279,10 @@ radius_change_server(struct radius_clien +@@ -1230,6 +1260,10 @@ radius_change_server(struct radius_clien inet_ntop(AF_INET6, &claddr6.sin6_addr, abuf, sizeof(abuf)), ntohs(claddr6.sin6_port)); @@ -74,7 +74,7 @@ } --- a/src/radius/radius_client.h +++ b/src/radius/radius_client.h -@@ -249,6 +249,8 @@ int radius_client_register(struct radius +@@ -244,6 +244,8 @@ int radius_client_register(struct radius void radius_client_set_interim_error_cb(struct radius_client_data *radius, void (*cb)(const u8 *addr, void *ctx), void *ctx); @@ -98,7 +98,7 @@ hapd->conf->own_ip_addr.af == AF_INET && --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2681,6 +2681,8 @@ static int hostapd_config_fill(struct ho +@@ -2701,6 +2701,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 c9df6a616..8817a4d74 100644 --- a/feeds/wifi-ax/hostapd/patches/770-wds-hack.patch +++ b/feeds/wifi-ax/hostapd/patches/770-wds-hack.patch @@ -1,7 +1,5 @@ -Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.c -+++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.c +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c @@ -11,6 +11,8 @@ #include #endif /* CONFIG_SQLITE */ @@ -10,8 +8,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c + #include "utils/common.h" #include "utils/eloop.h" - #include "common/ieee802_11_defs.h" -@@ -1316,6 +1318,22 @@ static int hostapd_setup_bss(struct host + #include "utils/crc32.h" +@@ -1259,6 +1261,22 @@ int hostapd_setup_bss(struct hostapd_dat os_memcpy(hapd->own_addr, if_addr, ETH_ALEN); } @@ -32,5 +30,5 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c + } + if (conf->wmm_enabled < 0) - conf->wmm_enabled = hapd->iconf->ieee80211n | hapd->iconf->ieee80211ax; + conf->wmm_enabled = hapd->iconf->ieee80211n; diff --git a/feeds/wifi-ax/hostapd/patches/780-maxassoc.patch b/feeds/wifi-ax/hostapd/patches/780-maxassoc.patch index 98840f382..07fc54e14 100644 --- a/feeds/wifi-ax/hostapd/patches/780-maxassoc.patch +++ b/feeds/wifi-ax/hostapd/patches/780-maxassoc.patch @@ -1,7 +1,5 @@ -Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/sta_info.c -+++ hostapd-2021-02-20-59e9794c/src/ap/sta_info.c +--- a/src/ap/sta_info.c ++++ b/src/ap/sta_info.c @@ -717,7 +717,7 @@ struct sta_info * ap_sta_add(struct host return sta; diff --git a/feeds/wifi-ax/hostapd/patches/800-fix-ap-sta-channel-setup-failed.patch b/feeds/wifi-ax/hostapd/patches/800-fix-ap-sta-channel-setup-failed.patch index de7a61158..67e3d078c 100644 --- a/feeds/wifi-ax/hostapd/patches/800-fix-ap-sta-channel-setup-failed.patch +++ b/feeds/wifi-ax/hostapd/patches/800-fix-ap-sta-channel-setup-failed.patch @@ -1,8 +1,6 @@ -diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c -index ad2aebf..355b4a8 100644 --- a/src/common/hw_features_common.c +++ b/src/common/hw_features_common.c -@@ -615,9 +615,21 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data, +@@ -609,9 +609,21 @@ int hostapd_set_freq_params(struct hosta center_segment0 == channel - 6) data->center_freq1 = 5000 + center_segment0 * 5; else { diff --git a/feeds/wifi-ax/hostapd/patches/900-coa.patch b/feeds/wifi-ax/hostapd/patches/900-coa.patch index a46ec8212..3e1213a4d 100644 --- a/feeds/wifi-ax/hostapd/patches/900-coa.patch +++ b/feeds/wifi-ax/hostapd/patches/900-coa.patch @@ -1,7 +1,5 @@ -Index: hostapd-2021-02-20-59e9794c/src/radius/radius_das.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/radius/radius_das.c -+++ hostapd-2021-02-20-59e9794c/src/radius/radius_das.c +--- a/src/radius/radius_das.c ++++ b/src/radius/radius_das.c @@ -48,6 +48,8 @@ static struct radius_msg * radius_das_di RADIUS_ATTR_EVENT_TIMESTAMP, RADIUS_ATTR_MESSAGE_AUTHENTICATOR, diff --git a/feeds/wifi-ax/hostapd/patches/900-coa_multi.patch b/feeds/wifi-ax/hostapd/patches/900-coa_multi.patch index 08311367f..a9f6e9ad4 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 -@@ -1371,6 +1371,7 @@ static int hostapd_setup_bss(struct host +@@ -1386,6 +1386,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 dcfdd658f..7be0b33f3 100644 --- a/feeds/wifi-ax/hostapd/patches/901-cfg-section.patch +++ b/feeds/wifi-ax/hostapd/patches/901-cfg-section.patch @@ -1,7 +1,5 @@ -Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/hostapd/config_file.c -+++ hostapd-2021-02-20-59e9794c/hostapd/config_file.c +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c @@ -2366,6 +2366,8 @@ static int hostapd_config_fill(struct ho return 1; } @@ -11,23 +9,19 @@ Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c } else if (os_strcmp(buf, "driver_params") == 0) { os_free(conf->driver_params); conf->driver_params = os_strdup(pos); -Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_config.h -+++ hostapd-2021-02-20-59e9794c/src/ap/ap_config.h +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h @@ -279,6 +279,7 @@ struct hostapd_bss_config { char snoop_iface[IFNAMSIZ + 1]; char vlan_bridge[IFNAMSIZ + 1]; char wds_bridge[IFNAMSIZ + 1]; + char *uci_section; - char *config_id; + enum hostapd_logger_level logger_syslog_level, logger_stdout_level; -Index: hostapd-2021-02-20-59e9794c/src/ap/ubus.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ubus.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ubus.c -@@ -467,6 +467,9 @@ hostapd_bss_get_status(struct ubus_conte +--- a/src/ap/ubus.c ++++ b/src/ap/ubus.c +@@ -428,6 +428,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); @@ -37,10 +31,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ubus.c ubus_send_reply(ctx, req, b.head); return 0; -Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_config.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ap_config.c +--- 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); 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 86ebde756..ea11be4a7 100644 --- a/feeds/wifi-ax/hostapd/patches/920-sta_driver_data.patch +++ b/feeds/wifi-ax/hostapd/patches/920-sta_driver_data.patch @@ -1,8 +1,6 @@ -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 -@@ -2259,6 +2259,10 @@ struct hostap_sta_driver_data { +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -2175,6 +2175,10 @@ struct hostap_sta_driver_data { u8 tx_mcs; u8 rx_vht_nss; u8 tx_vht_nss; @@ -13,11 +11,9 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver.h }; struct hostapd_sta_add_params { -Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver_nl80211.c -+++ hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c -@@ -7123,6 +7123,8 @@ static int get_sta_handler(struct nl_msg +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -7013,6 +7013,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 }, @@ -26,7 +22,7 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c }; nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), -@@ -7215,6 +7217,10 @@ static int get_sta_handler(struct nl_msg +@@ -7105,6 +7107,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; } @@ -37,7 +33,7 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c } if (stats[NL80211_STA_INFO_RX_BITRATE] && -@@ -7245,11 +7251,16 @@ static int get_sta_handler(struct nl_msg +@@ -7135,11 +7141,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; } @@ -54,11 +50,9 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c return NL_SKIP; } -Index: hostapd-2021-02-20-59e9794c/src/ap/ubus.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ubus.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ubus.c -@@ -349,6 +349,36 @@ hostapd_bss_get_clients(struct ubus_cont +--- a/src/ap/ubus.c ++++ b/src/ap/ubus.c +@@ -310,6 +310,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 3b79338c2..29e0a3d29 100644 --- a/feeds/wifi-ax/hostapd/patches/999-probe-request.patch +++ b/feeds/wifi-ax/hostapd/patches/999-probe-request.patch @@ -1,8 +1,6 @@ -Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/hostapd/config_file.c -+++ hostapd-2021-02-20-59e9794c/hostapd/config_file.c -@@ -3339,6 +3339,8 @@ static int hostapd_config_fill(struct ho +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -3344,6 +3344,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); @@ -11,11 +9,9 @@ Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c #ifdef CONFIG_WEP } else if (os_strcmp(buf, "wep_default_key") == 0) { bss->ssid.wep.idx = atoi(pos); -Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_config.h -+++ hostapd-2021-02-20-59e9794c/src/ap/ap_config.h -@@ -460,6 +460,7 @@ struct hostapd_bss_config { +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -459,6 +459,7 @@ struct hostapd_bss_config { int ap_max_inactivity; int ignore_broadcast_ssid; int no_probe_resp_if_max_sta; @@ -23,10 +19,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h int wmm_enabled; int wmm_uapsd; -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 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c @@ -920,7 +920,8 @@ void handle_probe_req(struct hostapd_dat } #endif /* CONFIG_P2P */ diff --git a/feeds/wifi-ax/hostapd/patches/999-ssi_signal.patch b/feeds/wifi-ax/hostapd/patches/999-ssi_signal.patch index c729240d1..8a88b1272 100644 --- a/feeds/wifi-ax/hostapd/patches/999-ssi_signal.patch +++ b/feeds/wifi-ax/hostapd/patches/999-ssi_signal.patch @@ -1,7 +1,5 @@ -Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ieee802_11.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c @@ -57,6 +57,15 @@ #include "gas_query_ap.h" @@ -53,10 +51,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c break; default: hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, -Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/sta_info.h -+++ hostapd-2021-02-20-59e9794c/src/ap/sta_info.h +--- a/src/ap/sta_info.h ++++ b/src/ap/sta_info.h @@ -331,6 +331,7 @@ struct sta_info { #ifdef CONFIG_PASN struct pasn_data *pasn; @@ -65,11 +61,9 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.h }; -Index: hostapd-2021-02-20-59e9794c/src/ap/ubus.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ubus.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ubus.c -@@ -379,6 +379,9 @@ hostapd_bss_get_clients(struct ubus_cont +--- a/src/ap/ubus.c ++++ b/src/ap/ubus.c +@@ -340,6 +340,9 @@ hostapd_bss_get_clients(struct ubus_cont blobmsg_add_u32(&b, "tx", sta_driver_data.tx_mcs); } blobmsg_close_table(&b, r); @@ -79,7 +73,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ubus.c } hostapd_parse_capab_blobmsg(sta); -@@ -500,6 +503,9 @@ hostapd_bss_get_status(struct ubus_conte +@@ -461,6 +464,9 @@ hostapd_bss_get_status(struct ubus_conte if (hapd->conf->uci_section) blobmsg_add_string(&b, "uci_section", hapd->conf->uci_section); @@ -89,11 +83,9 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ubus.c ubus_send_reply(ctx, req, b.head); return 0; -Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.h -+++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.h -@@ -446,6 +446,7 @@ struct hostapd_data { +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h +@@ -452,6 +452,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 80377e444..ca7361ef9 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,8 +1,6 @@ -Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/hostapd/config_file.c -+++ hostapd-2021-02-20-59e9794c/hostapd/config_file.c -@@ -2458,6 +2458,8 @@ static int hostapd_config_fill(struct ho +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -2465,6 +2465,8 @@ static int hostapd_config_fill(struct ho conf->ieee80211d = atoi(pos); } else if (os_strcmp(buf, "ieee80211h") == 0) { conf->ieee80211h = atoi(pos); @@ -11,11 +9,9 @@ Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c } else if (os_strcmp(buf, "ieee8021x") == 0) { bss->ieee802_1x = atoi(pos); } else if (os_strcmp(buf, "eapol_version") == 0) { -Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_config.h -+++ hostapd-2021-02-20-59e9794c/src/ap/ap_config.h -@@ -979,6 +979,7 @@ struct hostapd_config { +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -981,6 +981,7 @@ struct hostapd_config { int ieee80211d; int ieee80211h; /* DFS */ @@ -23,10 +19,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h /* * Local power constraint is an octet encoded as an unsigned integer in -Index: hostapd-2021-02-20-59e9794c/src/ap/dfs.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/dfs.c -+++ hostapd-2021-02-20-59e9794c/src/ap/dfs.c +--- a/src/ap/dfs.c ++++ b/src/ap/dfs.c @@ -18,6 +18,8 @@ #include "drivers/driver.h" #include "dfs.h" @@ -120,7 +114,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/dfs.c /* Perform channel switch/CSA */ channel = dfs_get_valid_channel(iface, &secondary_channel, &oper_centr_freq_seg0_idx, -@@ -1208,6 +1280,12 @@ int hostapd_dfs_radar_detected(struct ho +@@ -1206,6 +1278,12 @@ int hostapd_dfs_radar_detected(struct ho if (!res) return 0; @@ -133,10 +127,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/dfs.c /* Skip if reported radar event not overlapped our channels */ res = dfs_are_channels_overlapped(iface, freq, chan_width, cf1, cf2); if (!res) -Index: hostapd-2021-02-20-59e9794c/src/ap/dfs.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/dfs.h -+++ hostapd-2021-02-20-59e9794c/src/ap/dfs.h +--- a/src/ap/dfs.h ++++ b/src/ap/dfs.h @@ -9,6 +9,11 @@ #ifndef DFS_H #define DFS_H @@ -149,11 +141,9 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/dfs.h int hostapd_handle_dfs(struct hostapd_iface *iface); int hostapd_dfs_complete_cac(struct hostapd_iface *iface, int success, int freq, -Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.c -+++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.c -@@ -2866,6 +2866,7 @@ int hostapd_disable_iface(struct hostapd +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -2901,6 +2901,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-001-hostapd-fix-an-issue-related-with-wpa_group_state.patch b/feeds/wifi-ax/hostapd/patches/b00-001-hostapd-fix-an-issue-related-with-wpa_group_state.patch index ad96f8e73..e9c4875d9 100644 --- a/feeds/wifi-ax/hostapd/patches/b00-001-hostapd-fix-an-issue-related-with-wpa_group_state.patch +++ b/feeds/wifi-ax/hostapd/patches/b00-001-hostapd-fix-an-issue-related-with-wpa_group_state.patch @@ -8,7 +8,7 @@ #include "wps_hostapd.h" #include "ap_drv_ops.h" #include "ap_config.h" -@@ -2030,6 +2031,7 @@ void hostapd_wpa_event(void *ctx, enum w +@@ -2040,6 +2041,7 @@ void hostapd_wpa_event(void *ctx, enum w * Try to re-enable interface if the driver stopped it * when the interface got disabled. */ diff --git a/feeds/wifi-ax/hostapd/patches/b00-004-hostap-fix-compilation-issue.patch b/feeds/wifi-ax/hostapd/patches/b00-004-hostap-fix-compilation-issue.patch index d1c840a8e..7f1f24ce8 100644 --- a/feeds/wifi-ax/hostapd/patches/b00-004-hostap-fix-compilation-issue.patch +++ b/feeds/wifi-ax/hostapd/patches/b00-004-hostap-fix-compilation-issue.patch @@ -1,6 +1,6 @@ --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -1022,7 +1022,7 @@ void wpa_receive(struct wpa_authenticato +@@ -1039,7 +1039,7 @@ void wpa_receive(struct wpa_authenticato mic_len, key_data_length); wpa_hexdump(MSG_MSGDUMP, "WPA: EAPOL-Key header (ending before Key MIC)", @@ -9,7 +9,7 @@ wpa_hexdump(MSG_MSGDUMP, "WPA: EAPOL-Key Key MIC", mic, mic_len); if (key_data_length > data_len - sizeof(*hdr) - keyhdrlen) { -@@ -3086,7 +3086,7 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING) +@@ -3126,7 +3126,7 @@ SM_STATE(WPA_PTK, PTKCALCNEGOTIATING) idx = bitfield_get_first_zero(wpa_auth->ip_pool); if (idx >= 0) { u32 start = WPA_GET_BE32(wpa_auth->conf.ip_addr_start); @@ -20,7 +20,7 @@ "P2P: Assigned IP address %u.%u.%u.%u to " --- a/src/crypto/tls_openssl.c +++ b/src/crypto/tls_openssl.c -@@ -1097,7 +1097,7 @@ void * tls_init(const struct tls_config +@@ -1099,7 +1099,7 @@ void * tls_init(const struct tls_config if (conf && conf->openssl_ciphers) ciphers = conf->openssl_ciphers; else @@ -109,7 +109,7 @@ bitfield_free(bf); --- a/wpa_supplicant/rrm.c +++ b/wpa_supplicant/rrm.c -@@ -1116,7 +1116,7 @@ static int wpas_rm_handle_beacon_req_sub +@@ -1125,7 +1125,7 @@ static int wpas_rm_handle_beacon_req_sub } for (i = 0; i < slen; i++) 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 a5bf71409..05490be21 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 -@@ -3112,6 +3112,92 @@ set: +@@ -3246,6 +3246,92 @@ set: return ret; } @@ -93,7 +93,7 @@ static int hostapd_ctrl_iface_remove_neighbor(struct hostapd_data *hapd, char *buf) -@@ -3790,6 +3876,10 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3931,6 +4017,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 */ @@ -106,7 +106,7 @@ hapd, buf + 15, reply, reply_size); --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c -@@ -1362,6 +1362,12 @@ static int hostapd_cli_cmd_driver_flags( +@@ -1361,6 +1361,12 @@ static int hostapd_cli_cmd_driver_flags( return wpa_ctrl_command(ctrl, "DRIVER_FLAGS"); } @@ -119,7 +119,7 @@ #ifdef CONFIG_DPP -@@ -1705,6 +1711,8 @@ static const struct hostapd_cli_cmd host +@@ -1720,6 +1726,8 @@ static const struct hostapd_cli_cmd host "=Add/Delete/Show/Clear deny MAC ACL" }, { "poll_sta", hostapd_cli_cmd_poll_sta, hostapd_complete_stations, " = poll a STA to check connectivity with a QoS null frame" }, diff --git a/feeds/wifi-ax/hostapd/patches/b00-034-hostapd-Add-max-rate-information-into-STATUS-and-STA.patch b/feeds/wifi-ax/hostapd/patches/b00-034-hostapd-Add-max-rate-information-into-STATUS-and-STA.patch index a6e174dbc..ffe26f809 100644 --- a/feeds/wifi-ax/hostapd/patches/b00-034-hostapd-Add-max-rate-information-into-STATUS-and-STA.patch +++ b/feeds/wifi-ax/hostapd/patches/b00-034-hostapd-Add-max-rate-information-into-STATUS-and-STA.patch @@ -157,7 +157,7 @@ Date: Thu Dec 6 15:17:46 2018 +0800 return len; } -@@ -798,6 +931,20 @@ int hostapd_ctrl_iface_status(struct hos +@@ -799,6 +932,20 @@ int hostapd_ctrl_iface_status(struct hos if (os_snprintf_error(buflen - len, ret)) return len; len += ret; @@ -178,7 +178,7 @@ Date: Thu Dec 6 15:17:46 2018 +0800 } if (iface->conf->ieee80211n && !hapd->conf->disable_11n) { -@@ -832,8 +979,33 @@ int hostapd_ctrl_iface_status(struct hos +@@ -833,8 +980,33 @@ int hostapd_ctrl_iface_status(struct hos if (os_snprintf_error(buflen - len, ret)) return len; len += ret; @@ -214,7 +214,7 @@ Date: Thu Dec 6 15:17:46 2018 +0800 ret = os_snprintf(buf + len, buflen - len, --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h -@@ -46,6 +46,7 @@ +@@ -49,6 +49,7 @@ /* Maximum number of supported rates (from both Supported Rates and Extended * Supported Rates IEs). */ #define WLAN_SUPP_RATES_MAX 32 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 3251904f4..84645f367 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 -@@ -4235,6 +4235,8 @@ static int hostapd_config_fill(struct ho +@@ -4338,6 +4338,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 -@@ -1018,6 +1018,7 @@ struct hostapd_config { +@@ -1049,6 +1049,7 @@ struct hostapd_config { } *acs_chan_bias; unsigned int num_acs_chan_bias; #endif /* CONFIG_ACS */ @@ -21,7 +21,7 @@ struct wpabuf *civic; --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -696,9 +696,14 @@ int hostapd_check_ht_capab(struct hostap +@@ -714,9 +714,14 @@ int hostapd_check_ht_capab(struct hostap !ieee80211ac_supported_vht_capab(iface)) return -1; #endif /* CONFIG_IEEE80211AC */ diff --git a/feeds/wifi-ax/hostapd/patches/c00-002-hostapd-he-update-nl-header.patch b/feeds/wifi-ax/hostapd/patches/c00-002-hostapd-he-update-nl-header.patch index 8de804a54..3ada3a9f5 100644 --- a/feeds/wifi-ax/hostapd/patches/c00-002-hostapd-he-update-nl-header.patch +++ b/feeds/wifi-ax/hostapd/patches/c00-002-hostapd-he-update-nl-header.patch @@ -12,11 +12,9 @@ Signed-off-by: John Crispin src/drivers/nl80211_copy.h | 75 +++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 38 deletions(-) -Index: hostapd-2021-02-08/src/drivers/nl80211_copy.h -=================================================================== ---- hostapd-2021-02-08.orig/src/drivers/nl80211_copy.h -+++ hostapd-2021-02-08/src/drivers/nl80211_copy.h -@@ -4541,6 +4541,10 @@ enum nl80211_chan_width { +--- a/src/drivers/nl80211_copy.h ++++ b/src/drivers/nl80211_copy.h +@@ -4570,6 +4570,10 @@ enum nl80211_chan_width { NL80211_CHAN_WIDTH_4, NL80211_CHAN_WIDTH_8, NL80211_CHAN_WIDTH_16, @@ -27,11 +25,9 @@ Index: hostapd-2021-02-08/src/drivers/nl80211_copy.h }; /** -Index: hostapd-2021-02-08/src/ap/dfs.c -=================================================================== ---- hostapd-2021-02-08.orig/src/ap/dfs.c -+++ hostapd-2021-02-08/src/ap/dfs.c -@@ -1051,13 +1051,17 @@ static int hostapd_dfs_testmode_set_beac +--- a/src/ap/dfs.c ++++ b/src/ap/dfs.c +@@ -1069,13 +1069,17 @@ static int hostapd_dfs_testmode_set_beac iface->conf->hw_mode, iface->freq, iface->conf->channel, diff --git a/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch b/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch index 5f0748722..945102ff9 100644 --- a/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch +++ b/feeds/wifi-ax/hostapd/patches/c00-004-add-HE-cross-check.patch @@ -11,11 +11,9 @@ Signed-off-by: Miles Hu src/common/ieee802_11_defs.h | 12 +++++++++- 2 files changed, 64 insertions(+), 1 deletion(-) -Index: hostapd-2021-02-08/src/ap/hw_features.c -=================================================================== ---- hostapd-2021-02-08.orig/src/ap/hw_features.c -+++ hostapd-2021-02-08/src/ap/hw_features.c -@@ -660,8 +660,63 @@ static int ieee80211ac_supported_vht_cap +--- a/src/ap/hw_features.c ++++ b/src/ap/hw_features.c +@@ -678,8 +678,63 @@ static int ieee80211ac_supported_vht_cap #ifdef CONFIG_IEEE80211AX @@ -79,10 +77,8 @@ Index: hostapd-2021-02-08/src/ap/hw_features.c return 1; } #endif /* CONFIG_IEEE80211AX */ -Index: hostapd-2021-02-08/src/common/ieee802_11_defs.h -=================================================================== ---- hostapd-2021-02-08.orig/src/common/ieee802_11_defs.h -+++ hostapd-2021-02-08/src/common/ieee802_11_defs.h +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h @@ -2233,7 +2233,10 @@ struct ieee80211_spatial_reuse { /* HE Capabilities Information defines */ 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 8232429c5..bd1b8ebd6 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 -@@ -2653,7 +2653,7 @@ skip_ht40: +@@ -2745,7 +2745,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 3b10235d7..db514536d 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 -@@ -4143,10 +4143,12 @@ static int hostapd_config_fill(struct ho +@@ -4172,10 +4172,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 -@@ -882,10 +882,11 @@ static int hostapd_ctrl_iface_bss_tm_req +@@ -945,10 +945,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"); -@@ -895,7 +896,7 @@ static int hostapd_ctrl_iface_bss_tm_req +@@ -958,7 +959,7 @@ static int hostapd_ctrl_iface_bss_tm_req WPA_PUT_LE16(&bss_term_dur[10], atoi(end)); } @@ -42,7 +42,7 @@ return -1; --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -714,6 +714,11 @@ struct hostapd_bss_config { +@@ -722,6 +722,11 @@ struct hostapd_bss_config { * - Set BIT(2) to enable OCE in AP mode */ unsigned int oce; @@ -248,7 +248,7 @@ mgmt->u.action.u.bss_tm_req.disassoc_timer = host_to_le16(0); mgmt->u.action.u.bss_tm_req.validity_interval = 1; pos = mgmt->u.action.u.bss_tm_req.variable; -@@ -394,6 +415,25 @@ static int ieee802_11_send_bss_trans_mgm +@@ -395,6 +416,25 @@ static int ieee802_11_send_bss_trans_mgm le_to_host16(mgmt->u.action.u.bss_tm_req.disassoc_timer), mgmt->u.action.u.bss_tm_req.validity_interval); 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 b8ee16442..94c388de8 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 @@ -11,11 +11,9 @@ Signed-off-by: Lavanya Suresh src/ap/hostapd.c | 3 +++ 1 file changed, 3 insertions(+) -diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c -index be9ef82..346d83c 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3532,6 +3532,9 @@ static int hostapd_fill_csa_settings(struct hostapd_data *hapd, +@@ -3600,6 +3600,9 @@ static int hostapd_fill_csa_settings(str if (!iface || !iface->freq || hapd->csa_in_progress) return -1; @@ -25,6 +23,3 @@ index be9ef82..346d83c 100644 switch (settings->freq_params.bandwidth) { case 80: if (settings->freq_params.center_freq2) --- -2.7.4 - 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 a5ef7905f..69f0f921d 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 @@ -1,7 +1,5 @@ -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config_ssid.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/config_ssid.h -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/config_ssid.h +--- a/wpa_supplicant/config_ssid.h ++++ b/wpa_supplicant/config_ssid.h @@ -1121,7 +1121,6 @@ struct wpa_ssid { * FT initial mobility domain association. */ @@ -10,10 +8,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config_ssid.h /** * beacon_prot - Whether Beacon protection is enabled * -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 +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c @@ -2521,16 +2521,14 @@ void ibss_mesh_setup_freq(struct wpa_sup return; 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 dbe2dec33..fcb8f476f 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 -@@ -3448,6 +3448,8 @@ static int hostapd_config_fill(struct ho +@@ -3517,6 +3517,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); @@ -11,7 +11,7 @@ conf->he_op.he_bss_color_disabled = 0; --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf -@@ -801,6 +801,12 @@ wmm_ac_vo_acm=0 +@@ -816,6 +816,12 @@ wmm_ac_vo_acm=0 # 1 = supported #he_mu_beamformer=1 @@ -26,7 +26,7 @@ --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -265,6 +265,8 @@ struct hostapd_config * hostapd_config_d +@@ -266,6 +266,8 @@ struct hostapd_config * hostapd_config_d HE_OPERATION_RTS_THRESHOLD_OFFSET; /* Set default basic MCS/NSS set to single stream MCS 0-7 */ conf->he_op.he_basic_mcs_nss_set = 0xfffc; @@ -37,7 +37,7 @@ conf->he_op.he_bss_color = 1; --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -875,6 +875,7 @@ struct he_phy_capabilities_info { +@@ -903,6 +903,7 @@ struct he_phy_capabilities_info { bool he_su_beamformer; bool he_su_beamformee; bool he_mu_beamformer; @@ -47,7 +47,7 @@ /** --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -717,9 +717,10 @@ static int ieee80211ax_supported_he_capa +@@ -727,9 +727,10 @@ static int ieee80211ax_supported_he_capa (SPATIAL_REUSE_NON_SRG_OFFSET_PRESENT | SPATIAL_REUSE_SRG_INFORMATION_PRESENT)))); @@ -63,7 +63,7 @@ HE_MACCAP_TWT_RESPONDER, HE_MACCAP_TWT_RESPONDER_IDX, --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c -@@ -151,6 +151,13 @@ u8 * hostapd_eid_he_capab(struct hostapd +@@ -152,6 +152,13 @@ u8 * hostapd_eid_he_capab(struct hostapd cap->he_phy_capab_info[HE_PHYCAP_MU_BEAMFORMER_CAPAB_IDX] &= ~HE_PHYCAP_MU_BEAMFORMER_CAPAB; 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 528f130b4..f80b6b900 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-007-fixing-warning.patch @@ -22,7 +22,7 @@ Signed-off-by: Karthikeyan Kathirvel --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -4454,12 +4454,13 @@ void wpa_gtk_rekey(struct wpa_authentica +@@ -4498,12 +4498,13 @@ void wpa_gtk_rekey(struct wpa_authentica } @@ -39,7 +39,7 @@ Signed-off-by: Karthikeyan Kathirvel #define RSN_SUITE_ARG(s) \ --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2701,7 +2701,7 @@ out: +@@ -2724,7 +2724,7 @@ out: } @@ -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 -@@ -4859,7 +4859,7 @@ static int wpa_driver_nl80211_sta_add(vo +@@ -5058,7 +5058,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 3bca898b8..15964e79a 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 @@ -20,11 +20,9 @@ Signed-off-by: Pradeep Kumar Chitrapu wpa_supplicant/op_classes.c | 8 ++++---- 4 files changed, 15 insertions(+), 14 deletions(-) -Index: hostapd-2021-02-20/src/drivers/driver_nl80211.c -=================================================================== ---- hostapd-2021-02-20.orig/src/drivers/driver_nl80211.c -+++ hostapd-2021-02-20/src/drivers/driver_nl80211.c -@@ -10936,7 +10936,8 @@ static int add_acs_ch_list(struct nl_msg +--- 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 * compatibility. */ if (!(freq >= 2412 && freq <= 2484) && @@ -34,10 +32,8 @@ Index: hostapd-2021-02-20/src/drivers/driver_nl80211.c continue; hw_mode = ieee80211_freq_to_chan(freq, &ch_list[num_channels]); if (hw_mode != NUM_HOSTAPD_MODES) -Index: hostapd-2021-02-20/wpa_supplicant/op_classes.c -=================================================================== ---- hostapd-2021-02-20.orig/wpa_supplicant/op_classes.c -+++ hostapd-2021-02-20/wpa_supplicant/op_classes.c +--- a/wpa_supplicant/op_classes.c ++++ b/wpa_supplicant/op_classes.c @@ -270,7 +270,7 @@ static int wpas_op_class_supported(struc if (f == 0) @@ -56,11 +52,9 @@ Index: hostapd-2021-02-20/wpa_supplicant/op_classes.c return 0; if (op_class->op_class >= 81 && op_class->op_class <= 84 && !freq2) return 0; -Index: hostapd-2021-02-20/src/ap/acs.c -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/acs.c -+++ hostapd-2021-02-20/src/ap/acs.c -@@ -372,40 +372,44 @@ acs_survey_chan_interference_factor(stru +--- a/src/ap/acs.c ++++ b/src/ap/acs.c +@@ -366,40 +366,44 @@ acs_survey_chan_interference_factor(stru } @@ -115,7 +109,7 @@ Index: hostapd-2021-02-20/src/ap/acs.c return 1; return 0; -@@ -678,10 +682,11 @@ acs_find_ideal_chan_mode(struct hostapd_ +@@ -675,10 +679,11 @@ acs_find_ideal_chan_mode(struct hostapd_ /* HT40 on 5 GHz has a limited set of primary channels as per * 11n Annex J */ if (mode->mode == HOSTAPD_MODE_IEEE80211A && @@ -131,7 +125,7 @@ Index: hostapd-2021-02-20/src/ap/acs.c chan->chan); continue; } -@@ -690,18 +695,18 @@ acs_find_ideal_chan_mode(struct hostapd_ +@@ -687,18 +692,18 @@ acs_find_ideal_chan_mode(struct hostapd_ (iface->conf->ieee80211ac || iface->conf->ieee80211ax)) { if (hostapd_get_oper_chwidth(iface->conf) == CHANWIDTH_80MHZ && @@ -154,7 +148,7 @@ Index: hostapd-2021-02-20/src/ap/acs.c chan->chan); continue; } -@@ -832,16 +837,20 @@ acs_find_ideal_chan(struct hostapd_iface +@@ -829,16 +834,20 @@ acs_find_ideal_chan(struct hostapd_iface u32 bw; struct hostapd_hw_modes *mode; @@ -178,7 +172,7 @@ Index: hostapd-2021-02-20/src/ap/acs.c n_chans = 2; if (iface->conf->ieee80211ac || iface->conf->ieee80211ax) { -@@ -857,6 +866,7 @@ acs_find_ideal_chan(struct hostapd_iface +@@ -854,6 +863,7 @@ acs_find_ideal_chan(struct hostapd_iface bw = num_chan_to_bw(n_chans); @@ -186,11 +180,9 @@ Index: hostapd-2021-02-20/src/ap/acs.c /* TODO: VHT/HE80+80. Update acs_adjust_center_freq() too. */ wpa_printf(MSG_DEBUG, -Index: hostapd-2021-02-20/src/ap/hostapd.c -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/hostapd.c -+++ hostapd-2021-02-20/src/ap/hostapd.c -@@ -1691,6 +1691,10 @@ static int setup_interface2(struct hosta +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -1800,6 +1800,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); @@ -201,10 +193,8 @@ Index: hostapd-2021-02-20/src/ap/hostapd.c } ret = hostapd_select_hw_mode(iface); -Index: hostapd-2021-02-20/src/ap/beacon.c -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/beacon.c -+++ hostapd-2021-02-20/src/ap/beacon.c +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c @@ -481,8 +481,10 @@ static u8 * hostapd_gen_probe_resp(struc resp->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT, @@ -217,11 +207,9 @@ Index: hostapd-2021-02-20/src/ap/beacon.c os_memcpy(resp->sa, hapd->own_addr, ETH_ALEN); os_memcpy(resp->bssid, hapd->own_addr, ETH_ALEN); -Index: hostapd-2021-02-20/wpa_supplicant/mesh.c -=================================================================== ---- hostapd-2021-02-20.orig/wpa_supplicant/mesh.c -+++ hostapd-2021-02-20/wpa_supplicant/mesh.c -@@ -644,6 +644,8 @@ int wpa_supplicant_join_mesh(struct wpa_ +--- a/wpa_supplicant/mesh.c ++++ b/wpa_supplicant/mesh.c +@@ -649,6 +649,8 @@ int wpa_supplicant_join_mesh(struct wpa_ params->flags |= WPA_DRIVER_MESH_FLAG_SAE_AUTH; params->flags |= WPA_DRIVER_MESH_FLAG_AMPE; wpa_s->conf->user_mpm = 1; 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 31314d94d..161d83dac 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 @@ -1,6 +1,6 @@ --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1775,6 +1775,39 @@ static void hostapd_event_wds_sta_interf +@@ -1770,6 +1770,39 @@ static void hostapd_event_wds_sta_interf ifname, MAC2STR(addr)); } @@ -40,7 +40,7 @@ #ifdef CONFIG_OWE static int hostapd_notif_update_dh_ie(struct hostapd_data *hapd, -@@ -2083,6 +2116,9 @@ void hostapd_wpa_event(void *ctx, enum w +@@ -2078,6 +2111,9 @@ void hostapd_wpa_event(void *ctx, enum w data->wds_sta_interface.ifname, data->wds_sta_interface.sta_addr); break; @@ -52,7 +52,7 @@ break; --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5038,6 +5038,15 @@ enum wpa_event_type { +@@ -5123,6 +5123,15 @@ enum wpa_event_type { * is required to provide more details of the frame. */ EVENT_UNPROT_BEACON, @@ -68,7 +68,7 @@ }; -@@ -5897,6 +5906,16 @@ union wpa_event_data { +@@ -6017,6 +6026,16 @@ union wpa_event_data { struct unprot_beacon { const u8 *sa; } unprot_beacon; @@ -87,7 +87,7 @@ /** --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c -@@ -2540,6 +2540,35 @@ static void nl80211_sta_opmode_change_ev +@@ -2682,6 +2682,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) -@@ -2597,7 +2626,6 @@ nl80211_control_port_frame_tx_status(str +@@ -2739,7 +2768,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) { -@@ -2825,6 +2853,9 @@ static void do_process_drv_event(struct +@@ -2988,6 +3016,9 @@ static void do_process_drv_event(struct tb[NL80211_ATTR_ACK], tb[NL80211_ATTR_COOKIE]); break; @@ -143,9 +143,9 @@ "(cmd=%d)", cmd); --- a/src/drivers/nl80211_copy.h +++ b/src/drivers/nl80211_copy.h -@@ -1170,6 +1170,11 @@ - * includes the contents of the frame. %NL80211_ATTR_ACK flag is included - * if the recipient acknowledged the frame. +@@ -1182,6 +1182,11 @@ + * passed using %NL80211_ATTR_SAR_SPEC. %NL80211_ATTR_WIPHY is used to + * specify the wiphy index to be applied to. * + * @NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS: Updated MU-EDCA parameters from driver. + * This event is used to update MU-EDCA parameters in Beacon frame, which @@ -155,17 +155,17 @@ * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */ -@@ -1400,6 +1405,7 @@ enum nl80211_commands { +@@ -1414,6 +1419,7 @@ enum nl80211_commands { - NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS, + NL80211_CMD_SET_SAR_SPECS, + NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS, /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ -@@ -2505,6 +2511,9 @@ enum nl80211_commands { - * @NL80211_ATTR_HE_6GHZ_CAPABILITY: HE 6 GHz Band Capability element (from - * association request when used with NL80211_CMD_NEW_STATION). +@@ -2557,6 +2563,9 @@ enum nl80211_commands { + * disassoc events to indicate that an immediate reconnect to the AP + * is desired. * + * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the + NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. @@ -173,9 +173,9 @@ * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2987,6 +2996,7 @@ enum nl80211_attrs { +@@ -3054,6 +3063,7 @@ enum nl80211_attrs { - NL80211_ATTR_HE_6GHZ_CAPABILITY, + NL80211_ATTR_DISABLE_HE, + NL80211_ATTR_HE_MUEDCA_PARAMS, /* add attributes here, update the policy in nl80211.c */ @@ -193,7 +193,7 @@ return "UNKNOWN"; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -3525,6 +3525,10 @@ static int hostapd_fill_csa_settings(str +@@ -3659,6 +3659,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 -@@ -1472,6 +1472,11 @@ static int hostapd_ctrl_iface_set(struct +@@ -1590,6 +1590,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++; @@ -252,7 +252,7 @@ static u8 ieee80211_he_ppet_size(u8 ppe_thres_hdr, const u8 *phy_cap_info) { -@@ -247,9 +248,16 @@ u8 * hostapd_eid_he_operation(struct hos +@@ -248,9 +249,16 @@ u8 * hostapd_eid_he_operation(struct hos u8 * hostapd_eid_he_mu_edca_parameter_set(struct hostapd_data *hapd, u8 *eid) { struct ieee80211_he_mu_edca_parameter_set *edca; 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 fd4ab4c84..e6ce49065 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 @@ -36,11 +36,9 @@ Signed-off-by: Aloka Dixit src/drivers/nl80211_copy.h | 10 +++ 3 files changed, 116 insertions(+), 66 deletions(-) -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index 510670da64a8..c873f5b744d0 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -1374,7 +1374,7 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len) +@@ -1376,7 +1376,7 @@ static u8 * hostapd_gen_fils_discovery(s *len = pos - (u8 *) head; wpa_hexdump(MSG_DEBUG, "FILS Discovery frame template", @@ -49,11 +47,9 @@ index 510670da64a8..c873f5b744d0 100644 return (u8 *) head; } -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index f4c646180b36..84ba66be3e4f 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4381,94 +4381,135 @@ static int nl80211_set_multicast_to_unicast(struct i802_bss *bss, +@@ -4379,94 +4379,135 @@ static int nl80211_set_multicast_to_unic return ret; } @@ -246,7 +242,7 @@ index f4c646180b36..84ba66be3e4f 100644 static int wpa_driver_nl80211_set_ap(void *priv, struct wpa_driver_ap_params *params) { -@@ -4746,9 +4787,6 @@ static int wpa_driver_nl80211_set_ap(void *priv, +@@ -4744,9 +4785,6 @@ static int wpa_driver_nl80211_set_ap(voi goto fail; } @@ -256,7 +252,7 @@ index f4c646180b36..84ba66be3e4f 100644 #endif /* CONFIG_IEEE80211AX */ #ifdef CONFIG_SAE -@@ -4758,11 +4796,6 @@ static int wpa_driver_nl80211_set_ap(void *priv, +@@ -4756,11 +4794,6 @@ static int wpa_driver_nl80211_set_ap(voi goto fail; #endif /* CONFIG_SAE */ @@ -268,7 +264,7 @@ index f4c646180b36..84ba66be3e4f 100644 ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, NULL, NULL, NULL, NULL); if (ret) { -@@ -4775,6 +4808,13 @@ static int wpa_driver_nl80211_set_ap(void *priv, +@@ -4776,6 +4809,13 @@ static int wpa_driver_nl80211_set_ap(voi params->isolate, params->basic_rates); nl80211_set_multicast_to_unicast(bss, params->multicast_to_unicast); @@ -282,8 +278,6 @@ index f4c646180b36..84ba66be3e4f 100644 if (beacon_set && params->freq && params->freq->bandwidth != bss->bandwidth) { wpa_printf(MSG_DEBUG, -diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h -index a4a611992ca0..1084c6d4c080 100644 --- a/src/drivers/nl80211_copy.h +++ b/src/drivers/nl80211_copy.h @@ -1187,6 +1187,12 @@ @@ -310,6 +304,3 @@ index a4a611992ca0..1084c6d4c080 100644 /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ --- -2.25.0 - 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 26b17d1c4..44b7a6d2a 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,8 +1,6 @@ -Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/hostapd/config_file.c -+++ hostapd-2021-02-20-59e9794c/hostapd/config_file.c -@@ -4681,6 +4681,8 @@ static int hostapd_config_fill(struct ho +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -4692,6 +4692,8 @@ static int hostapd_config_fill(struct ho } bss->mka_psk_set |= MKA_PSK_SET_CKN; #endif /* CONFIG_MACSEC */ @@ -11,11 +9,9 @@ Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c } else if (os_strcmp(buf, "disable_11n") == 0) { bss->disable_11n = !!atoi(pos); } else if (os_strcmp(buf, "disable_11ac") == 0) { -Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_config.h -+++ hostapd-2021-02-20-59e9794c/src/ap/ap_config.h -@@ -1025,6 +1025,8 @@ struct hostapd_config { +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -1027,6 +1027,8 @@ struct hostapd_config { u8 vht_oper_centr_freq_seg1_idx; u8 ht40_plus_minus_allowed; @@ -24,11 +20,9 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h /* Use driver-generated interface addresses when adding multiple BSSs */ u8 use_driver_iface_addr; -Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.c -+++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.c -@@ -87,6 +87,26 @@ int hostapd_for_each_interface(struct ha +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -89,6 +89,26 @@ int hostapd_for_each_interface(struct ha } @@ -55,7 +49,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c void hostapd_reconfig_encryption(struct hostapd_data *hapd) { if (hapd->wpa_auth) -@@ -1206,6 +1226,13 @@ static int hostapd_setup_bss(struct host +@@ -1223,6 +1243,13 @@ int hostapd_setup_bss(struct hostapd_dat if (!first || first == -1) { u8 *addr = hapd->own_addr; @@ -69,7 +63,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c if (!is_zero_ether_addr(conf->bssid)) { /* Allocate the configured BSSID. */ -@@ -1233,7 +1260,7 @@ static int hostapd_setup_bss(struct host +@@ -1250,7 +1277,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, @@ -78,23 +72,19 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c wpa_printf(MSG_ERROR, "Failed to add BSS (BSSID=" MACSTR ")", MAC2STR(hapd->own_addr)); hapd->interface_added = 0; -Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.h -+++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.h -@@ -603,6 +603,8 @@ struct hostapd_iface { +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h +@@ -629,6 +629,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_reconfig_encryption(struct hostapd_data *hapd); - struct hostapd_data * -Index: hostapd-2021-02-20-59e9794c/src/ap/ap_drv_ops.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_drv_ops.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ap_drv_ops.c + void hostapd_reload_bss(struct hostapd_data *hapd); + void hostapd_bss_deinit(struct hostapd_data *hapd); +--- 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 char force_ifname[IFNAMSIZ]; u8 if_addr[ETH_ALEN]; @@ -104,7 +94,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ap_drv_ops.c } -@@ -497,13 +497,15 @@ int hostapd_set_ssid(struct hostapd_data +@@ -495,13 +495,15 @@ int hostapd_set_ssid(struct hostapd_data int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type, const char *ifname, const u8 *addr, void *bss_ctx, void **drv_priv, char *force_ifname, u8 *if_addr, @@ -122,10 +112,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ap_drv_ops.c } -Index: hostapd-2021-02-20-59e9794c/src/ap/ap_drv_ops.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_drv_ops.h -+++ hostapd-2021-02-20-59e9794c/src/ap/ap_drv_ops.h +--- a/src/ap/ap_drv_ops.h ++++ b/src/ap/ap_drv_ops.h @@ -54,7 +54,8 @@ int hostapd_set_ssid(struct hostapd_data int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type, const char *ifname, const u8 *addr, void *bss_ctx, @@ -136,10 +124,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ap_drv_ops.h int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type, const char *ifname); int hostapd_set_ieee8021x(struct hostapd_data *hapd, -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 +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c @@ -293,7 +293,7 @@ static const u8 * hostapd_vendor_wpa_ie( } @@ -189,7 +175,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c if (len < IEEE80211_HDRLEN) return; ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN; -@@ -1085,7 +1097,7 @@ void handle_probe_req(struct hostapd_dat +@@ -1087,7 +1099,7 @@ void handle_probe_req(struct hostapd_dat hapd->cs_c_off_ecsa_proberesp; } @@ -198,7 +184,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c csa_offs_len ? csa_offs : NULL, csa_offs_len, 0); -@@ -1746,6 +1758,8 @@ void ieee802_11_free_ap_params(struct wp +@@ -1748,6 +1760,8 @@ void ieee802_11_free_ap_params(struct wp params->head = NULL; os_free(params->proberesp); params->proberesp = NULL; @@ -207,7 +193,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c #ifdef CONFIG_FILS os_free(params->fd_frame_tmpl); params->fd_frame_tmpl = NULL; -@@ -1802,6 +1816,22 @@ int ieee802_11_set_beacon(struct hostapd +@@ -1804,6 +1818,22 @@ int ieee802_11_set_beacon(struct hostapd params.unsol_bcast_probe_resp_tmpl = hostapd_unsol_bcast_probe_resp(hapd, ¶ms); #endif /* CONFIG_IEEE80211AX */ @@ -230,10 +216,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c hapd->reenable_beacon = 0; #ifdef CONFIG_SAE params.sae_pwe = hapd->conf->sae_pwe; -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 +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h @@ -1224,6 +1224,8 @@ struct wowlan_triggers { u8 rfkill_release; }; @@ -285,7 +269,7 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver.h }; struct wpa_driver_mesh_bss_params { -@@ -3344,7 +3381,8 @@ struct wpa_driver_ops { +@@ -3348,7 +3385,8 @@ struct wpa_driver_ops { int (*if_add)(void *priv, enum wpa_driver_if_type type, const char *ifname, const u8 *addr, void *bss_ctx, void **drv_priv, char *force_ifname, u8 *if_addr, @@ -295,10 +279,8 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver.h /** * if_remove - Remove a virtual interface -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/driver_i.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/driver_i.h -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/driver_i.h +--- a/wpa_supplicant/driver_i.h ++++ b/wpa_supplicant/driver_i.h @@ -444,7 +444,7 @@ static inline int wpa_drv_if_add(struct if (wpa_s->driver->if_add) return wpa_s->driver->if_add(wpa_s->drv_priv, type, ifname, @@ -308,10 +290,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/driver_i.h return -1; } -Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver_nl80211.c -+++ hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c @@ -4794,6 +4794,27 @@ static int wpa_driver_nl80211_set_ap(voi goto fail; #endif /* CONFIG_SAE */ @@ -403,7 +383,7 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c } if (ret >= 0 && is_p2p_net_interface(iftype)) { -@@ -7518,7 +7555,7 @@ static int i802_set_wds_sta(void *priv, +@@ -7529,7 +7566,7 @@ static int i802_set_wds_sta(void *priv, if (!if_nametoindex(name)) { if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN, @@ -412,7 +392,7 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c 0) return -1; if (bridge_ifname && -@@ -7863,7 +7900,9 @@ static int wpa_driver_nl80211_if_add(voi +@@ -7874,7 +7911,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, @@ -423,7 +403,7 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c { enum nl80211_iftype nlmode; struct i802_bss *bss = priv; -@@ -7880,7 +7919,8 @@ static int wpa_driver_nl80211_if_add(voi +@@ -7891,7 +7930,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, @@ -433,7 +413,7 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c if (!p2pdev_info.wdev_id_set || ifidx != 0) { wpa_printf(MSG_ERROR, "nl80211: Failed to create a P2P Device interface %s", ifname); -@@ -7896,7 +7936,9 @@ static int wpa_driver_nl80211_if_add(voi +@@ -7907,7 +7947,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, @@ -444,10 +424,8 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c if (use_existing && ifidx == -ENFILE) { added = 0; ifidx = if_nametoindex(ifname); -Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver_nl80211.h -+++ hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.h +--- a/src/drivers/driver_nl80211.h ++++ b/src/drivers/driver_nl80211.h @@ -251,7 +251,9 @@ int nl80211_create_iface(struct wpa_driv const char *ifname, enum nl80211_iftype iftype, const u8 *addr, int wds, @@ -459,10 +437,8 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.h void nl80211_remove_iface(struct wpa_driver_nl80211_data *drv, int ifidx); unsigned int nl80211_get_assoc_freq(struct wpa_driver_nl80211_data *drv); int nl80211_get_assoc_ssid(struct wpa_driver_nl80211_data *drv, u8 *ssid); -Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211_monitor.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver_nl80211_monitor.c -+++ hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211_monitor.c +--- a/src/drivers/driver_nl80211_monitor.c ++++ b/src/drivers/driver_nl80211_monitor.c @@ -381,7 +381,7 @@ int nl80211_create_monitor_interface(str drv->monitor_ifidx = @@ -472,10 +448,8 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211_monitor.c if (drv->monitor_ifidx == -EOPNOTSUPP) { /* -Index: hostapd-2021-02-20-59e9794c/src/drivers/nl80211_copy.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/drivers/nl80211_copy.h -+++ hostapd-2021-02-20-59e9794c/src/drivers/nl80211_copy.h +--- a/src/drivers/nl80211_copy.h ++++ b/src/drivers/nl80211_copy.h @@ -2576,6 +2576,20 @@ enum nl80211_commands { * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. @@ -511,10 +485,8 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/nl80211_copy.h /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ieee802_11.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c @@ -6,6 +6,7 @@ * See README for more details. */ @@ -523,7 +495,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c #include "utils/includes.h" #ifndef CONFIG_NATIVE_WINDOWS -@@ -3859,7 +3860,11 @@ int hostapd_get_aid(struct hostapd_data +@@ -3868,7 +3869,11 @@ int hostapd_get_aid(struct hostapd_data } if (j == 32) return -1; @@ -536,7 +508,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c if (aid > 2007) return -1; -@@ -5560,7 +5565,7 @@ static void handle_assoc(struct hostapd_ +@@ -5569,7 +5574,7 @@ static void handle_assoc(struct hostapd_ goto fail; omit_rsnxe = !get_ie(pos, left, WLAN_EID_RSNX); @@ -545,7 +517,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_INFO, "No room for more AIDs"); resp = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA; -@@ -6970,4 +6975,117 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct +@@ -6981,4 +6986,117 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct return eid; } @@ -663,10 +635,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c +} + #endif /* CONFIG_NATIVE_WINDOWS */ -Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ieee802_11.h -+++ hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.h +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h @@ -119,7 +119,10 @@ u8 * hostapd_eid_time_zone(struct hostap int hostapd_update_time_adv(struct hostapd_data *hapd); void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); @@ -686,10 +656,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.h +u8 * hostapd_get_rsne(struct hostapd_data *hapd, u8 *pos, size_t len); #endif /* IEEE802_11_H */ -Index: hostapd-2021-02-20-59e9794c/src/common/ieee802_11_defs.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/common/ieee802_11_defs.h -+++ hostapd-2021-02-20-59e9794c/src/common/ieee802_11_defs.h +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h @@ -457,6 +457,8 @@ #define WLAN_EID_RSNX 244 #define WLAN_EID_EXTENSION 255 @@ -699,10 +667,8 @@ Index: hostapd-2021-02-20-59e9794c/src/common/ieee802_11_defs.h /* Element ID Extension (EID 255) values */ #define WLAN_EID_EXT_ASSOC_DELAY_INFO 1 #define WLAN_EID_EXT_FILS_REQ_PARAMS 2 -Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11_shared.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ieee802_11_shared.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ieee802_11_shared.c +--- a/src/ap/ieee802_11_shared.c ++++ b/src/ap/ieee802_11_shared.c @@ -357,6 +357,8 @@ static void hostapd_ext_capab_byte(struc *pos |= 0x02; /* Bit 17 - WNM-Sleep Mode */ if (hapd->conf->bss_transition) 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 be5749ef9..ab89d56ba 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 @@ -22,7 +22,7 @@ Signed-off-by: John Crispin #include "common/ieee802_11_defs.h" #include "common/sae.h" #include "crypto/sha256.h" -@@ -2359,6 +2360,12 @@ static int hostapd_config_fill(struct ho +@@ -2395,6 +2396,12 @@ static int hostapd_config_fill(struct ho } os_memcpy(bss->ssid.ssid, pos, bss->ssid.ssid_len); bss->ssid.ssid_set = 1; @@ -37,7 +37,7 @@ Signed-off-by: John Crispin char *str = wpa_config_parse_string(pos, &slen); --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -13,7 +13,6 @@ +@@ -15,7 +15,6 @@ #include "utils/common.h" #include "utils/eloop.h" @@ -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" -@@ -1247,12 +1246,6 @@ static int hostapd_setup_bss(struct host +@@ -1356,12 +1355,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 7712636d2..f7a55dc08 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 -@@ -3023,6 +3023,7 @@ static int hostapd_ctrl_iface_set_neighb +@@ -3157,6 +3157,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; -@@ -3107,9 +3108,22 @@ static int hostapd_ctrl_iface_set_neighb +@@ -3241,9 +3242,22 @@ static int hostapd_ctrl_iface_set_neighb if (os_strstr(buf, "stat")) stationary = 1; @@ -52,7 +52,7 @@ Signed-off-by: John Crispin wpabuf_free(lci); --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -139,6 +139,7 @@ struct hostapd_neighbor_entry { +@@ -144,6 +144,7 @@ struct hostapd_neighbor_entry { /* LCI update time */ struct os_time lci_date; int stationary; diff --git a/feeds/wifi-ax/hostapd/patches/d00-012c-hostapd-add-support-for-reduced-neighbour-report.patch b/feeds/wifi-ax/hostapd/patches/d00-012c-hostapd-add-support-for-reduced-neighbour-report.patch index c3d7b16ff..fc45b9a6e 100644 --- a/feeds/wifi-ax/hostapd/patches/d00-012c-hostapd-add-support-for-reduced-neighbour-report.patch +++ b/feeds/wifi-ax/hostapd/patches/d00-012c-hostapd-add-support-for-reduced-neighbour-report.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -140,6 +140,7 @@ struct hostapd_neighbor_entry { +@@ -145,6 +145,7 @@ struct hostapd_neighbor_entry { struct os_time lci_date; int stationary; u8 bss_parameters; 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 33bed2d9c..d48dd9f66 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 @@ -19,11 +19,9 @@ Signed-off-by: Pradeep Kumar Chitrapu src/common/ieee802_11_defs.h | 14 ++++++ 7 files changed, 113 insertions(+) -Index: hostapd-2021-02-18/hostapd/config_file.c -=================================================================== ---- hostapd-2021-02-18.orig/hostapd/config_file.c -+++ hostapd-2021-02-18/hostapd/config_file.c -@@ -4672,6 +4672,8 @@ static int hostapd_config_fill(struct ho +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -4701,6 +4701,8 @@ static int hostapd_config_fill(struct ho #endif /* CONFIG_MACSEC */ } else if (os_strcmp(buf, "multiple_bssid") == 0) { conf->multiple_bssid = atoi(pos); @@ -32,10 +30,8 @@ Index: hostapd-2021-02-18/hostapd/config_file.c } else if (os_strcmp(buf, "disable_11n") == 0) { bss->disable_11n = !!atoi(pos); } else if (os_strcmp(buf, "disable_11ac") == 0) { -Index: hostapd-2021-02-18/hostapd/hostapd.conf -=================================================================== ---- hostapd-2021-02-18.orig/hostapd/hostapd.conf -+++ hostapd-2021-02-18/hostapd/hostapd.conf +--- a/hostapd/hostapd.conf ++++ b/hostapd/hostapd.conf @@ -2885,6 +2885,9 @@ own_ip_addr=127.0.0.1 # that allows sending of such data. Default: 0. #stationary_ap=0 @@ -46,23 +42,19 @@ Index: hostapd-2021-02-18/hostapd/hostapd.conf ##### Airtime policy configuration ########################################### # Set the airtime policy operating mode: -Index: hostapd-2021-02-18/src/ap/ap_config.h -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/ap_config.h -+++ hostapd-2021-02-18/src/ap/ap_config.h -@@ -885,6 +885,7 @@ struct hostapd_bss_config { +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -893,6 +893,7 @@ struct hostapd_bss_config { #endif /* CONFIG_PASN */ unsigned int unsol_bcast_probe_resp_interval; + u8 rnr_beacon; + char *config_id; }; - /** -Index: hostapd-2021-02-18/src/ap/beacon.c -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/beacon.c -+++ hostapd-2021-02-18/src/ap/beacon.c -@@ -1467,6 +1467,7 @@ int ieee802_11_build_ap_params(struct ho +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1469,6 +1469,7 @@ int ieee802_11_build_ap_params(struct ho tail_len += hostapd_mbo_ie_len(hapd); tail_len += hostapd_eid_owe_trans_len(hapd); tail_len += hostapd_eid_dpp_cc_len(hapd); @@ -70,7 +62,7 @@ Index: hostapd-2021-02-18/src/ap/beacon.c tailpos = tail = os_malloc(tail_len); if (head == NULL || tail == NULL) { -@@ -1643,6 +1644,7 @@ int ieee802_11_build_ap_params(struct ho +@@ -1645,6 +1646,7 @@ int ieee802_11_build_ap_params(struct ho tailpos = hostapd_eid_owe_trans(hapd, tailpos, tail + tail_len - tailpos); tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); @@ -78,11 +70,9 @@ Index: hostapd-2021-02-18/src/ap/beacon.c if (hapd->conf->vendor_elements) { os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), -Index: hostapd-2021-02-18/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/ieee802_11.c -+++ hostapd-2021-02-18/src/ap/ieee802_11.c -@@ -7079,4 +7079,93 @@ u8 * hostapd_eid_multiple_bssid(struct h +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -7099,4 +7099,93 @@ u8 * hostapd_eid_multiple_bssid(struct h return eid; } @@ -176,10 +166,8 @@ Index: hostapd-2021-02-18/src/ap/ieee802_11.c +} + #endif /* CONFIG_NATIVE_WINDOWS */ -Index: hostapd-2021-02-18/src/ap/ieee802_11.h -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/ieee802_11.h -+++ hostapd-2021-02-18/src/ap/ieee802_11.h +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h @@ -123,6 +123,8 @@ u8 * hostapd_eid_multiple_bssid(struct h u8 is_beacon, u8 **eid_offsets, int *eid_count, int eid_max); @@ -189,10 +177,8 @@ Index: hostapd-2021-02-18/src/ap/ieee802_11.h int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); #ifdef CONFIG_SAE void sae_clear_retransmit_timer(struct hostapd_data *hapd, -Index: hostapd-2021-02-18/src/common/ieee802_11_defs.h -=================================================================== ---- hostapd-2021-02-18.orig/src/common/ieee802_11_defs.h -+++ hostapd-2021-02-18/src/common/ieee802_11_defs.h +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h @@ -2437,4 +2437,17 @@ enum mscs_description_subelem { */ #define FD_MAX_INTERVAL_6GHZ 20 /* TUs */ diff --git a/feeds/wifi-ax/hostapd/patches/e00-003-hostapd-chan-switch-6ghz.patch b/feeds/wifi-ax/hostapd/patches/e00-003-hostapd-chan-switch-6ghz.patch index c9bbe2218..936d205d3 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-003-hostapd-chan-switch-6ghz.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-003-hostapd-chan-switch-6ghz.patch @@ -55,7 +55,7 @@ Signed-off-by: Muna Sinada hapd->iconf->channel = channel; hapd->iconf->ieee80211n = ht; -@@ -977,6 +958,7 @@ void hostapd_event_ch_switch(struct host +@@ -972,6 +953,7 @@ void hostapd_event_ch_switch(struct host hostapd_set_oper_chwidth(hapd->iconf, chwidth); hostapd_set_oper_centr_freq_seg0_idx(hapd->iconf, seg0_idx); hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, seg1_idx); 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 ca9140f13..db6267403 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 @@ -1,7 +1,5 @@ -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/mesh.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh.c +--- a/wpa_supplicant/mesh.c ++++ b/wpa_supplicant/mesh.c @@ -453,6 +453,12 @@ static int wpa_supplicant_mesh_init(stru conf->country[2] = ' '; wpa_s->mesh_params->handle_dfs = true; @@ -15,10 +13,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh.c bss->iconf = conf; ifmsh->conf = conf; -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 +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c @@ -2440,7 +2440,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, @@ -153,10 +149,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c #ifdef CONFIG_HT_OVERRIDES if (ssid->disable_ht40) seg0 = 0; -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/ap.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/ap.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/ap.c +--- a/wpa_supplicant/ap.c ++++ b/wpa_supplicant/ap.c @@ -305,20 +305,16 @@ int wpa_supplicant_conf_ap_ht(struct wpa HT_CAP_INFO_TX_STBC | HT_CAP_INFO_MAX_AMSDU_SIZE); @@ -182,10 +176,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/ap.c } if (conf->secondary_channel) { -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh_mpm.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/mesh_mpm.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh_mpm.c +--- a/wpa_supplicant/mesh_mpm.c ++++ b/wpa_supplicant/mesh_mpm.c @@ -251,6 +251,9 @@ static void mesh_mpm_send_plink_action(s HE_MAX_MCS_CAPAB_SIZE + HE_MAX_PPET_CAPAB_SIZE; 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 406e34588..23c4bc28a 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,7 +1,5 @@ -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 +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c @@ -2430,6 +2430,22 @@ static int drv_supports_vht(struct wpa_s return mode->vht_capab != 0; } 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 c910e2ff7..61e8c3a43 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 @@ -22,10 +22,8 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11_shared.c | 7 +++++- 2 files changed, 35 insertions(+), 20 deletions(-) -Index: hostapd-2021-02-18/src/ap/beacon.c -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/beacon.c -+++ hostapd-2021-02-18/src/ap/beacon.c +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c @@ -433,7 +433,7 @@ static u8 * hostapd_gen_probe_resp(struc int is_p2p, size_t *resp_len) { @@ -47,7 +45,7 @@ Index: hostapd-2021-02-18/src/ap/beacon.c pos = hostapd_eid_time_adv(hapd, pos); pos = hostapd_eid_time_zone(hapd, pos); -@@ -1701,12 +1705,12 @@ int ieee802_11_build_ap_params(struct ho +@@ -1421,12 +1425,12 @@ int ieee802_11_build_ap_params(struct ho { struct ieee80211_mgmt *head = NULL; u8 *tail = NULL; @@ -62,7 +60,7 @@ Index: hostapd-2021-02-18/src/ap/beacon.c #define BEACON_HEAD_BUF_SIZE 256 #define BEACON_TAIL_BUF_SIZE 512 -@@ -1832,7 +1836,9 @@ int ieee802_11_build_ap_params(struct ho +@@ -1552,7 +1556,9 @@ int ieee802_11_build_ap_params(struct ho tailpos = hostapd_eid_ht_capabilities(hapd, tailpos); tailpos = hostapd_eid_ht_operation(hapd, tailpos); @@ -72,7 +70,7 @@ Index: hostapd-2021-02-18/src/ap/beacon.c /* * TODO: Time Advertisement element should only be included in some -@@ -2032,6 +2038,26 @@ int ieee802_11_build_ap_params(struct ho +@@ -1750,6 +1756,26 @@ int ieee802_11_build_ap_params(struct ho } } @@ -99,7 +97,7 @@ Index: hostapd-2021-02-18/src/ap/beacon.c return 0; } -@@ -2107,22 +2133,6 @@ int ieee802_11_set_beacon(struct hostapd +@@ -1820,22 +1846,6 @@ int ieee802_11_set_beacon(struct hostapd params.unsol_bcast_probe_resp_tmpl = hostapd_unsol_bcast_probe_resp(hapd, ¶ms); #endif /* CONFIG_IEEE80211AX */ @@ -122,10 +120,8 @@ Index: hostapd-2021-02-18/src/ap/beacon.c hapd->reenable_beacon = 0; #ifdef CONFIG_SAE params.sae_pwe = hapd->conf->sae_pwe; -Index: hostapd-2021-02-18/src/ap/ieee802_11_shared.c -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/ieee802_11_shared.c -+++ hostapd-2021-02-18/src/ap/ieee802_11_shared.c +--- a/src/ap/ieee802_11_shared.c ++++ b/src/ap/ieee802_11_shared.c @@ -427,6 +427,10 @@ static void hostapd_ext_capab_byte(struc * Identifiers Used Exclusively */ } diff --git a/feeds/wifi-ax/hostapd/patches/e00-007-Add-RSN-extension-element-in-multiple-BSSID-element.patch b/feeds/wifi-ax/hostapd/patches/e00-007-Add-RSN-extension-element-in-multiple-BSSID-element.patch index c4ef5bce8..abd749933 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-007-Add-RSN-extension-element-in-multiple-BSSID-element.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-007-Add-RSN-extension-element-in-multiple-BSSID-element.patch @@ -26,7 +26,7 @@ Signed-off-by: Aloka Dixit --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5676,17 +5676,29 @@ static int hostapd_eid_multiple_bssid_ch +@@ -6991,17 +6991,29 @@ static int hostapd_eid_multiple_bssid_ch int *count) { /* ID + size + count */ @@ -62,7 +62,7 @@ Signed-off-by: Aloka Dixit } multiple_bssid_too_big: -@@ -5711,7 +5723,7 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7026,7 +7038,7 @@ static u8 * hostapd_eid_multiple_bssid_c u8 *eid, u8 *end, int *count, u8 is_beacon) { @@ -71,7 +71,7 @@ Signed-off-by: Aloka Dixit int i; *eid++ = WLAN_EID_MULTIPLE_BSSID; -@@ -5747,13 +5759,13 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7062,13 +7074,13 @@ static u8 * hostapd_eid_multiple_bssid_c *index_size_offset = (eid - index_size_offset) - 1; eid = hostapd_get_rsne(bss, eid, end - eid); 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 d29d05d28..6647d1bb4 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 @@ -23,11 +23,9 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11_shared.c | 8 +++----- 7 files changed, 22 insertions(+), 14 deletions(-) -Index: hostapd-2021-02-18/hostapd/config_file.c -=================================================================== ---- hostapd-2021-02-18.orig/hostapd/config_file.c -+++ hostapd-2021-02-18/hostapd/config_file.c -@@ -4672,6 +4672,8 @@ static int hostapd_config_fill(struct ho +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -4701,6 +4701,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,11 +34,9 @@ Index: hostapd-2021-02-18/hostapd/config_file.c } else if (os_strcmp(buf, "rnr_beacon") == 0) { bss->rnr_beacon = atoi(pos); } else if (os_strcmp(buf, "disable_11n") == 0) { -Index: hostapd-2021-02-18/src/ap/ap_config.c -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/ap_config.c -+++ hostapd-2021-02-18/src/ap/ap_config.c -@@ -1486,6 +1486,12 @@ int hostapd_config_check(struct hostapd_ +--- a/src/ap/ap_config.c ++++ b/src/ap/ap_config.c +@@ -1489,6 +1489,12 @@ int hostapd_config_check(struct hostapd_ return -1; } @@ -53,11 +49,9 @@ Index: hostapd-2021-02-18/src/ap/ap_config.c for (i = 0; i < conf->num_bss; i++) { if (hostapd_config_check_bss(conf->bss[i], conf, full_config)) return -1; -Index: hostapd-2021-02-18/src/ap/ap_config.h -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/ap_config.h -+++ hostapd-2021-02-18/src/ap/ap_config.h -@@ -1017,6 +1017,7 @@ struct hostapd_config { +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -1029,6 +1029,7 @@ struct hostapd_config { u8 ht40_plus_minus_allowed; u8 multiple_bssid; @@ -65,10 +59,8 @@ Index: hostapd-2021-02-18/src/ap/ap_config.h /* Use driver-generated interface addresses when adding multiple BSSs */ u8 use_driver_iface_addr; -Index: hostapd-2021-02-18/src/ap/beacon.c -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/beacon.c -+++ hostapd-2021-02-18/src/ap/beacon.c +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c @@ -535,7 +535,7 @@ static u8 * hostapd_gen_probe_resp(struc pos = hostapd_get_mde(hapd, pos, epos - pos); @@ -88,7 +80,7 @@ Index: hostapd-2021-02-18/src/ap/beacon.c ext_cap_pos[12] |= 0x01; pos = hostapd_eid_time_adv(hapd, pos); -@@ -2051,10 +2050,11 @@ int ieee802_11_build_ap_params(struct ho +@@ -1769,10 +1768,11 @@ int ieee802_11_build_ap_params(struct ho params->multiple_bssid_ies + len, 1, params->multiple_bssid_ie_offsets, ¶ms->multiple_bssid_ie_count, @@ -103,11 +95,9 @@ Index: hostapd-2021-02-18/src/ap/beacon.c ext_cap_pos[12] |= 0x01; } -Index: hostapd-2021-02-18/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/ieee802_11.c -+++ hostapd-2021-02-18/src/ap/ieee802_11.c -@@ -7076,12 +7076,13 @@ multiple_bssid_too_big: +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -7096,12 +7096,13 @@ multiple_bssid_too_big: u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, u8 is_beacon, u8 **eid_offsets, int *eid_count, @@ -123,10 +113,8 @@ Index: hostapd-2021-02-18/src/ap/ieee802_11.c eid_offsets[*eid_count] = eid; *eid_count = *eid_count + 1; } -Index: hostapd-2021-02-18/src/ap/ieee802_11.h -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/ieee802_11.h -+++ hostapd-2021-02-18/src/ap/ieee802_11.h +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h @@ -121,7 +121,7 @@ void hostapd_client_poll_ok(struct hosta u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, u8 *eid, u8 *end, @@ -136,10 +124,8 @@ Index: hostapd-2021-02-18/src/ap/ieee802_11.h int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd); u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid); size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd); -Index: hostapd-2021-02-18/src/ap/ieee802_11_shared.c -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/ieee802_11_shared.c -+++ hostapd-2021-02-18/src/ap/ieee802_11_shared.c +--- a/src/ap/ieee802_11_shared.c ++++ b/src/ap/ieee802_11_shared.c @@ -427,9 +427,8 @@ static void hostapd_ext_capab_byte(struc * Identifiers Used Exclusively */ } diff --git a/feeds/wifi-ax/hostapd/patches/e00-008-fix-lowest-association-ID-with-multiple-BSSID-element.patch b/feeds/wifi-ax/hostapd/patches/e00-008-fix-lowest-association-ID-with-multiple-BSSID-element.patch index f3bd7dd6b..f9ecfb7d0 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-008-fix-lowest-association-ID-with-multiple-BSSID-element.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-008-fix-lowest-association-ID-with-multiple-BSSID-element.patch @@ -22,7 +22,7 @@ Signed-off-by: Aloka Dixit --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -2719,7 +2719,7 @@ int hostapd_get_aid(struct hostapd_data +@@ -3871,7 +3871,7 @@ int hostapd_get_aid(struct hostapd_data return -1; aid = i * 32 + j; if (hapd->iconf->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 cc303fa6b..0b8a198b5 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 @@ -33,7 +33,7 @@ Signed-off-by: Aloka Dixit --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -1788,6 +1788,7 @@ int ieee802_11_build_ap_params(struct ho +@@ -1774,6 +1774,7 @@ int ieee802_11_build_ap_params(struct ho if ((params->multiple_bssid_ie_count <= 1) && (ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08)) ext_cap_pos[12] |= 0x01; @@ -43,10 +43,10 @@ Signed-off-by: Aloka Dixit return 0; --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -1109,19 +1109,60 @@ static int db_table_create_radius_attrib - +@@ -1203,11 +1203,52 @@ static int db_table_create_radius_attrib #endif /* CONFIG_NO_RADIUS */ + +static int hostapd_set_beacon(struct hostapd_data *hapd) +{ + struct hostapd_bss_config *conf = hapd->conf; @@ -84,7 +84,7 @@ Signed-off-by: Aloka Dixit + hostapd_ubus_add_bss(hapd); + return 0; +} - ++ /** * hostapd_setup_bss - Per-BSS setup (initialization) * @hapd: Pointer to BSS data @@ -96,16 +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 - * 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) -+static 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]; -@@ -1393,31 +1434,8 @@ static int hostapd_setup_bss(struct host +@@ -1503,32 +1544,8 @@ int hostapd_setup_bss(struct hostapd_dat return -1; } @@ -134,22 +125,23 @@ Signed-off-by: Aloka Dixit - hapd->driver->set_operstate(hapd->drv_priv, 1); - - hostapd_ubus_add_bss(hapd); +- hostapd_ucode_add_bss(hapd); + if (set_beacon) + return hostapd_set_beacon(hapd); return 0; } -@@ -2109,7 +2127,8 @@ static int hostapd_setup_interface_compl +@@ -2223,7 +2240,8 @@ 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)) { + if (hostapd_setup_bss(hapd, j == 0, + hapd->iconf->multiple_bssid? 0 : 1)) { for (;;) { hapd = iface->bss[j]; hostapd_bss_deinit_no_free(hapd); -@@ -2123,6 +2142,24 @@ static int hostapd_setup_interface_compl +@@ -2237,6 +2255,24 @@ static int hostapd_setup_interface_compl if (is_zero_ether_addr(hapd->conf->bssid)) prev_addr = hapd->own_addr; } @@ -174,18 +166,18 @@ Signed-off-by: Aloka Dixit hapd = iface->bss[0]; hostapd_tx_queue_params(iface); -@@ -2989,7 +3026,7 @@ int hostapd_add_iface(struct hapd_interf +@@ -3123,7 +3159,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_setup_bss(hapd, -1, 1))) { hostapd_cleanup(hapd); hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; hapd_iface->conf->num_bss--; --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5721,7 +5721,7 @@ int hostapd_eid_multiple_bssid_len(struc +@@ -7036,7 +7036,7 @@ int hostapd_eid_multiple_bssid_len(struc static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, u8 *eid, u8 *end, int *count, @@ -194,7 +186,7 @@ Signed-off-by: Aloka Dixit { u8 *size_offset, *num_offset; int i; -@@ -5753,6 +5753,7 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7068,6 +7068,7 @@ static u8 * hostapd_eid_multiple_bssid_c index_size_offset = eid++; *eid++ = i; if (is_beacon) { @@ -202,7 +194,7 @@ Signed-off-by: Aloka Dixit *eid++ = bss->conf->dtim_period; *eid++ = 0xFF; } -@@ -5783,17 +5784,53 @@ u8 * hostapd_eid_multiple_bssid(struct h +@@ -7098,17 +7099,53 @@ u8 * hostapd_eid_multiple_bssid(struct h u8 is_beacon, u8 **eid_offsets, int *eid_count, int eid_max, u8 ema_beacon) { diff --git a/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch b/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch index cc83d4ca5..7284ecaf8 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-009-fix-reduced-neighbor-report-length.patch @@ -17,7 +17,7 @@ Signed-off-by: Aloka Dixit --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5843,6 +5843,8 @@ size_t hostapd_eid_reduced_neighbor_repo +@@ -7158,6 +7158,8 @@ size_t hostapd_eid_reduced_neighbor_repo len += TBTT_HEADER_LENGTH + ((hapd->iface->num_bss - 1) * TBTT_INFO_LENGTH); if (!dl_list_empty(&hapd->nr_db)) len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); @@ -26,7 +26,7 @@ Signed-off-by: Aloka Dixit return len; } -@@ -5853,12 +5855,13 @@ u8 * hostapd_eid_reduced_neighbor_report +@@ -7168,12 +7170,13 @@ u8 * hostapd_eid_reduced_neighbor_report size_t len = hostapd_eid_reduced_neighbor_report_len(hapd); struct hostapd_neighbor_entry *nr; int i, count = 0; @@ -41,7 +41,7 @@ Signed-off-by: Aloka Dixit if (hapd->iface->num_bss > 1) { u8 op_class, channel; -@@ -5920,6 +5923,9 @@ nr_db: +@@ -7235,6 +7238,9 @@ nr_db: if (!count) eid -= 2; diff --git a/feeds/wifi-ax/hostapd/patches/e00-010-hidden-SSID-support-in-multiple-BSSID-IE.patch b/feeds/wifi-ax/hostapd/patches/e00-010-hidden-SSID-support-in-multiple-BSSID-IE.patch index 714b44e11..78a472fc8 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-010-hidden-SSID-support-in-multiple-BSSID-IE.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-010-hidden-SSID-support-in-multiple-BSSID-IE.patch @@ -20,10 +20,8 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11.h | 7 ++++-- 3 files changed, 62 insertions(+), 25 deletions(-) -Index: hostapd-2021-02-20/src/ap/beacon.c -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/beacon.c -+++ hostapd-2021-02-20/src/ap/beacon.c +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c @@ -432,12 +432,16 @@ static u8 * hostapd_gen_probe_resp(struc const struct ieee80211_mgmt *req, int is_p2p, size_t *resp_len) @@ -87,8 +85,8 @@ Index: hostapd-2021-02-20/src/ap/beacon.c /* eCSA IE */ csa_pos = hostapd_eid_ecsa(hapd, pos); @@ -847,10 +864,6 @@ void handle_probe_req(struct hostapd_dat - .frame_info = fi, - }; + ssi_signal < hapd->iconf->rssi_ignore_probe_request) + return; - if (hapd->iconf->multiple_bssid && - hapd != hostapd_get_primary_bss(hapd)) @@ -97,7 +95,7 @@ Index: hostapd-2021-02-20/src/ap/beacon.c if (len < IEEE80211_HDRLEN) return; ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN; -@@ -1077,6 +1090,10 @@ void handle_probe_req(struct hostapd_dat +@@ -1079,6 +1092,10 @@ void handle_probe_req(struct hostapd_dat wpa_msg_ctrl(hapd->msg_ctx, MSG_INFO, RX_PROBE_REQUEST "sa=" MACSTR " signal=%d", MAC2STR(mgmt->sa), ssi_signal); @@ -108,7 +106,7 @@ Index: hostapd-2021-02-20/src/ap/beacon.c resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL, &resp_len); if (resp == NULL) -@@ -1754,7 +1771,7 @@ int ieee802_11_build_ap_params(struct ho +@@ -1756,7 +1773,7 @@ int ieee802_11_build_ap_params(struct ho } if (hapd->iconf->multiple_bssid) { @@ -117,7 +115,7 @@ Index: hostapd-2021-02-20/src/ap/beacon.c u8 *end; params->multiple_bssid_index = hostapd_get_bss_index(hapd); -@@ -1762,7 +1779,8 @@ int ieee802_11_build_ap_params(struct ho +@@ -1764,7 +1781,8 @@ int ieee802_11_build_ap_params(struct ho params->multiple_bssid_ies = os_zalloc(len); if (params->multiple_bssid_ies == NULL) return -1; @@ -127,11 +125,9 @@ Index: hostapd-2021-02-20/src/ap/beacon.c params->multiple_bssid_ies + len, 1, params->multiple_bssid_ie_offsets, ¶ms->multiple_bssid_ie_count, -Index: hostapd-2021-02-20/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/ieee802_11.c -+++ hostapd-2021-02-20/src/ap/ieee802_11.c -@@ -6968,24 +6968,35 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -6988,24 +6988,35 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct static int hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, @@ -171,7 +167,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c if (wpa_auth_get_wpa_ie(bss->wpa_auth, &ies_len)) nontx_profile_len += ies_len; -@@ -7003,21 +7014,27 @@ multiple_bssid_too_big: +@@ -7023,21 +7034,27 @@ multiple_bssid_too_big: } @@ -201,7 +197,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c u8 *size_offset, *num_offset; int i; -@@ -7026,7 +7043,8 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7046,7 +7063,8 @@ static u8 * hostapd_eid_multiple_bssid_c num_offset = eid++; for (i = *count; i < hapd->iface->num_bss; i++) { @@ -211,7 +207,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c u8 *bss_size_offset, *index_size_offset, *pos = eid; u16 capab_info; -@@ -7040,16 +7058,24 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7060,16 +7078,24 @@ static u8 * hostapd_eid_multiple_bssid_c eid += sizeof(capab_info); *eid++ = WLAN_EID_SSID; @@ -240,7 +236,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c *eid++ = 0xFF; } *index_size_offset = (eid - index_size_offset) - 1; -@@ -7075,7 +7101,8 @@ multiple_bssid_too_big: +@@ -7095,7 +7121,8 @@ multiple_bssid_too_big: } @@ -250,7 +246,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c u8 is_beacon, u8 **eid_offsets, int *eid_count, int eid_max, u8 ema_beacon) { -@@ -7094,8 +7121,9 @@ u8 * hostapd_eid_multiple_bssid(struct h +@@ -7114,8 +7141,9 @@ u8 * hostapd_eid_multiple_bssid(struct h eid_offsets[*eid_count] = eid; *eid_count = *eid_count + 1; } @@ -262,10 +258,8 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c } if (!eid_count || !(*eid_count)) { -Index: hostapd-2021-02-20/src/ap/ieee802_11.h -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/ieee802_11.h -+++ hostapd-2021-02-20/src/ap/ieee802_11.h +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h @@ -119,10 +119,13 @@ u8 * hostapd_eid_time_zone(struct hostap int hostapd_update_time_adv(struct hostapd_data *hapd); void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); 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 668ff5020..72e91b3dd 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 @@ -13,11 +13,9 @@ Signed-off-by: John Crispin src/ap/ap_config.h | 1 + 3 files changed, 6 insertions(+) -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 0bdf526..bbdd969 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3642,6 +3642,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, +@@ -3671,6 +3671,8 @@ static int hostapd_config_fill(struct ho return 1; } bss->unsol_bcast_probe_resp_interval = val; @@ -26,8 +24,6 @@ index 0bdf526..bbdd969 100644 #endif /* CONFIG_IEEE80211AX */ } else if (os_strcmp(buf, "max_listen_interval") == 0) { bss->max_listen_interval = atoi(pos); -diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf -index ef26fe3..7c371cb 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -577,6 +577,9 @@ wmm_ac_vo_acm=0 @@ -40,11 +36,9 @@ index ef26fe3..7c371cb 100644 ##### IEEE 802.11n related configuration ###################################### # ieee80211n: Whether IEEE 802.11n (HT) is enabled -diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 95e44fa..5ae9187 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1066,6 +1066,7 @@ struct hostapd_config { +@@ -1078,6 +1078,7 @@ struct hostapd_config { u8 he_6ghz_max_ampdu_len_exp; u8 he_6ghz_rx_ant_pat; u8 he_6ghz_tx_ant_pat; @@ -52,28 +46,9 @@ index 95e44fa..5ae9187 100644 #endif /* CONFIG_IEEE80211AX */ /* VHT enable/disable config from CHAN_SWITCH */ --- -2.7.4 - -From e9263d5c0a8e166e025a63f823288266d1085942 Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Tue, 6 Oct 2020 15:05:24 -0700 -Subject: [PATCH 2/4] neighbor_db: set the co-locate bit - -If the BSS is co-located, the corresponding bit needs to be set inside -bssid_info. - -Signed-off-by: John Crispin ---- - src/ap/neighbor_db.c | 3 +++ - src/common/ieee802_11_defs.h | 2 ++ - 2 files changed, 5 insertions(+) - -diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c -index ce6cfa9..6a0e8c3 100644 --- a/src/ap/neighbor_db.c +++ b/src/ap/neighbor_db.c -@@ -282,6 +282,9 @@ void hostapd_neighbor_set_own_report(struct hostapd_data *hapd) +@@ -282,6 +282,9 @@ void hostapd_neighbor_set_own_report(str bssid_info |= NEI_REP_BSSID_INFO_HE; } @@ -83,8 +58,6 @@ index ce6cfa9..6a0e8c3 100644 /* TODO: Set NEI_REP_BSSID_INFO_MOBILITY_DOMAIN if MDE is set */ if (ieee80211_freq_to_channel_ext(hapd->iface->freq, -diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h -index 8c73156..3a2cb6c 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -2145,6 +2145,8 @@ enum phy_type { @@ -96,27 +69,29 @@ index 8c73156..3a2cb6c 100644 /* * IEEE P802.11-REVmc/D5.0 Table 9-152 - HT/VHT Operation Information --- -2.7.4 - -From 92d786ddb2568b688ed4d25e32f3987e926c0ca4 Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Mon, 21 Sep 2020 13:50:58 +0200 -Subject: [PATCH 3/4] rrm: add handling for co-located BSS - -A BSS shall include the neighbor entry of a co-located BSS upon an incoming -request. - -Signed-off-by: John Crispin ---- - src/ap/rrm.c | 117 +++++++++++++++++++++++++++++++++++++---------------------- - 1 file changed, 74 insertions(+), 43 deletions(-) - -diff --git a/src/ap/rrm.c b/src/ap/rrm.c -index f2d5cd1..c9d51df 100644 +@@ -2439,7 +2441,7 @@ enum mscs_description_subelem { + + /* TBTT Information field defines */ + #define TBTT_HEADER_LENGTH 4 +-#define TBTT_INFO_LENGTH 12 ++#define TBTT_INFO_LENGTH 13 + #define TBTT_INFO_FILTERED_NEIGH_AP BIT(2) + #define TBTT_INFO_COUNT(x) (((x) & 0xf) << 4) + #define TBTT_AP_OFFSET_UNKNOWN 255 +@@ -2447,7 +2449,9 @@ enum mscs_description_subelem { + #define TBTT_BSS_PARAM_SAME_SSID BIT(1) + #define TBTT_BSS_PARAM_MULTIPLE_BSSID BIT(2) + #define TBTT_BSS_PARAM_TRANSMITTED_BSSID BIT(3) +-#define TBTT_BSS_PARAM_CO_LOCATED_ESS BIT(4) ++#define TBTT_BSS_PARAM_MEMBER_CO_LOCATED_ESS BIT(4) + #define TBTT_BSS_PARAM_20_TU_PROBE_RESP_ACTIVE BIT(5) ++#define TBTT_BSS_PARAM_CO_LOCATED BIT(6) ++#define TBTT_PSD_MAX_TXPOWER 255 /* dBm */ + + #endif /* IEEE802_11_DEFS_H */ --- a/src/ap/rrm.c +++ b/src/ap/rrm.c -@@ -196,6 +196,63 @@ static size_t hostapd_neighbor_report_len(struct wpabuf *buf, +@@ -199,6 +199,63 @@ static size_t hostapd_neighbor_report_le } @@ -180,7 +155,7 @@ index f2d5cd1..c9d51df 100644 static void hostapd_send_nei_report_resp(struct hostapd_data *hapd, const u8 *addr, u8 dialog_token, struct wpa_ssid_value *ssid, u8 lci, -@@ -203,7 +260,6 @@ static void hostapd_send_nei_report_resp(struct hostapd_data *hapd, +@@ -206,7 +263,6 @@ static void hostapd_send_nei_report_resp { struct hostapd_neighbor_entry *nr; struct wpabuf *buf; @@ -188,7 +163,7 @@ index f2d5cd1..c9d51df 100644 /* * The number and length of the Neighbor Report elements in a Neighbor -@@ -220,52 +276,27 @@ static void hostapd_send_nei_report_resp(struct hostapd_data *hapd, +@@ -223,52 +279,27 @@ static void hostapd_send_nei_report_resp dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, list) { @@ -217,9 +192,7 @@ index f2d5cd1..c9d51df 100644 - wpabuf_put_u8(buf, WLAN_EID_NEIGHBOR_REPORT); - wpabuf_put_u8(buf, len - 2); - wpabuf_put_buf(buf, nr->nr); -+ if (!hapd->iconf->he_co_locate) { -+ int i; - +- - if (send_lci && nr->lci) { - wpabuf_put_u8(buf, WLAN_EID_MEASURE_REPORT); - wpabuf_put_u8(buf, wpabuf_len(nr->lci)); @@ -231,12 +204,8 @@ index f2d5cd1..c9d51df 100644 - wpabuf_put_buf(buf, nr->lci); - *msmt_token = lci; - } -+ for (i = 0; i < hapd->iface->interfaces->count; i++) { -+ struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; -+ int j; -+ -+ if (iface == hapd->iface || !iface->conf->he_co_locate) -+ continue; ++ if (!hapd->iconf->he_co_locate) { ++ int i; - if (civic && nr->civic) { - wpabuf_put_u8(buf, WLAN_EID_MEASURE_REPORT); @@ -248,6 +217,13 @@ index f2d5cd1..c9d51df 100644 - msmt_token = wpabuf_put(buf, 0); - wpabuf_put_buf(buf, nr->civic); - *msmt_token = civic; ++ for (i = 0; i < hapd->iface->interfaces->count; i++) { ++ struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; ++ int j; ++ ++ if (iface == hapd->iface || !iface->conf->he_co_locate) ++ continue; ++ + for (j = 0; j < iface->num_bss; j++) { + nr = hostapd_neighbor_get(iface->bss[j], iface->bss[j]->own_addr, NULL); + if (!nr) @@ -258,32 +234,9 @@ index f2d5cd1..c9d51df 100644 } } --- -2.7.4 - -From fe0833e906559efb41ec9ee3f3e77049b968e6aa Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Wed, 21 Oct 2020 11:47:22 -0700 -Subject: [PATCH 4/4] rnr: add reduced neighbor reporting - -The Reduced Neighbor Report (rnr) element contains channel and other -information related to neighbor APs. It is part of the OCE requirement. - -Signed-off-by: John Crispin -Signed-off-by: Aloka Dixit -Signed-off-by: Muna Sinada ---- - src/ap/beacon.c | 40 +++++++++- - src/ap/ieee802_11.c | 177 ++++++++++++++++++++++++++++++++----------- - src/ap/ieee802_11.h | 4 +- - src/common/ieee802_11_defs.h | 6 +- - 4 files changed, 173 insertions(+), 54 deletions(-) - -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index 769e0d0..8afaf7a 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -481,6 +481,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +@@ -481,6 +481,8 @@ static u8 * hostapd_gen_probe_resp(struc buflen += hostapd_eid_dpp_cc_len(hapd); if (hapd->iconf->multiple_bssid) buflen += hostapd_eid_multiple_bssid_len(hapd, hidden, 0); @@ -292,7 +245,7 @@ index 769e0d0..8afaf7a 100644 resp = os_zalloc(buflen); if (resp == NULL) -@@ -645,6 +647,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +@@ -657,6 +659,8 @@ static u8 * hostapd_gen_probe_resp(struc pos = hostapd_eid_mbo(hapd, pos, (u8 *) resp + buflen - pos); pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos); pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos); @@ -301,7 +254,7 @@ index 769e0d0..8afaf7a 100644 if (hapd->conf->vendor_elements) { os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements), -@@ -660,7 +664,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +@@ -672,7 +676,8 @@ static u8 * hostapd_gen_probe_resp(struc enum ssid_match_result { NO_SSID_MATCH, EXACT_SSID_MATCH, @@ -311,7 +264,7 @@ index 769e0d0..8afaf7a 100644 }; static enum ssid_match_result ssid_match(struct hostapd_data *hapd, -@@ -672,6 +677,7 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd, +@@ -684,6 +689,7 @@ static enum ssid_match_result ssid_match { const u8 *pos, *end; int wildcard = 0; @@ -319,7 +272,7 @@ index 769e0d0..8afaf7a 100644 if (ssid_len == 0) wildcard = 1; -@@ -705,6 +711,25 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd, +@@ -717,6 +723,25 @@ static enum ssid_match_result ssid_match } } @@ -345,7 +298,7 @@ index 769e0d0..8afaf7a 100644 return wildcard ? WILDCARD_SSID_MATCH : NO_SSID_MATCH; } -@@ -1079,7 +1104,8 @@ void handle_probe_req(struct hostapd_data *hapd, +@@ -1093,7 +1118,8 @@ void handle_probe_req(struct hostapd_dat " signal=%d", MAC2STR(mgmt->sa), ssi_signal); if (hapd->iconf->multiple_bssid && @@ -355,7 +308,7 @@ index 769e0d0..8afaf7a 100644 return; resp = hostapd_gen_probe_resp(hapd, mgmt, elems.p2p != NULL, -@@ -1318,6 +1344,8 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len) +@@ -1332,6 +1358,8 @@ static u8 * hostapd_gen_fils_discovery(s total_len += 3; } @@ -364,7 +317,7 @@ index 769e0d0..8afaf7a 100644 pos = hostapd_eid_fils_indic(hapd, buf, 0); buf_len = pos - buf; total_len += buf_len; -@@ -1386,6 +1414,8 @@ static u8 * hostapd_gen_fils_discovery(struct hostapd_data *hapd, size_t *len) +@@ -1400,6 +1428,8 @@ static u8 * hostapd_gen_fils_discovery(s /* Fill in the Length field value */ *length_pos = pos - (length_pos + 1); @@ -373,7 +326,7 @@ index 769e0d0..8afaf7a 100644 /* FILS Indication element */ if (buf_len) { os_memcpy(pos, buf, buf_len); -@@ -1475,7 +1505,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1489,7 +1519,8 @@ int ieee802_11_build_ap_params(struct ho tail_len += hostapd_mbo_ie_len(hapd); tail_len += hostapd_eid_owe_trans_len(hapd); tail_len += hostapd_eid_dpp_cc_len(hapd); @@ -383,7 +336,7 @@ index 769e0d0..8afaf7a 100644 tailpos = tail = os_malloc(tail_len); if (head == NULL || tail == NULL) { -@@ -1654,7 +1685,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1668,7 +1699,8 @@ int ieee802_11_build_ap_params(struct ho tailpos = hostapd_eid_owe_trans(hapd, tailpos, tail + tail_len - tailpos); tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); @@ -393,11 +346,9 @@ index 769e0d0..8afaf7a 100644 if (hapd->conf->vendor_elements) { os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 668c4db..408c764 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -7158,14 +7158,45 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, +@@ -7178,14 +7178,45 @@ u8 * hostapd_eid_multiple_bssid(struct h } @@ -446,7 +397,7 @@ index 668c4db..408c764 100644 if (len) len += 2; /* Element ID and length */ -@@ -7173,58 +7204,76 @@ size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd) +@@ -7193,58 +7224,76 @@ size_t hostapd_eid_reduced_neighbor_repo } @@ -471,9 +422,6 @@ index 668c4db..408c764 100644 - *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; - size_offset = eid++; -- -- if (hapd->iface->num_bss > 1) { -- u8 op_class, channel; + if (ieee80211_freq_to_channel_ext(hapd->iface->freq, + hapd->iconf->secondary_channel, + hostapd_get_oper_chwidth(hapd->iconf), @@ -481,9 +429,8 @@ index 668c4db..408c764 100644 + NUM_HOSTAPD_MODES) + return eid; -- if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) || -- !hapd->iface->freq) -- goto nr_db; +- if (hapd->iface->num_bss > 1) { +- u8 op_class, channel; + tbtt_count_pos = eid++; + *eid++ = TBTT_INFO_LENGTH; + *eid++ = op_class; @@ -491,6 +438,10 @@ index 668c4db..408c764 100644 + for (i = 0; i < hapd->iface->num_bss; i++) { + u8 bss_param = 0; +- if (!(hapd->iface->drv_flags & WPA_DRIVER_FLAGS_AP_CSA) || +- !hapd->iface->freq) +- goto nr_db; +- - if (ieee80211_freq_to_channel_ext(hapd->iface->freq, - hapd->iconf->secondary_channel, - hostapd_get_oper_chwidth(hapd->iconf), @@ -565,7 +516,7 @@ index 668c4db..408c764 100644 dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, list) { if (!nr->nr || wpabuf_len(nr->nr) < 12) -@@ -7241,9 +7290,45 @@ nr_db: +@@ -7261,9 +7310,45 @@ nr_db: os_memcpy(eid, &nr->short_ssid, 4); eid += 4; *eid++ = nr->bss_parameters; @@ -612,11 +563,9 @@ index 668c4db..408c764 100644 if (!count) eid -= 2; else -diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h -index 1145210..2f45b61 100644 --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h -@@ -126,8 +126,8 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, +@@ -126,8 +126,8 @@ u8 * hostapd_eid_multiple_bssid(struct h int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, struct hostapd_data *hidden, u8 is_beacon); @@ -627,30 +576,3 @@ index 1145210..2f45b61 100644 int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); #ifdef CONFIG_SAE void sae_clear_retransmit_timer(struct hostapd_data *hapd, -diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h -index 3a2cb6c..4c438dd 100644 ---- a/src/common/ieee802_11_defs.h -+++ b/src/common/ieee802_11_defs.h -@@ -2441,7 +2441,7 @@ enum mscs_description_subelem { - - /* TBTT Information field defines */ - #define TBTT_HEADER_LENGTH 4 --#define TBTT_INFO_LENGTH 12 -+#define TBTT_INFO_LENGTH 13 - #define TBTT_INFO_FILTERED_NEIGH_AP BIT(2) - #define TBTT_INFO_COUNT(x) (((x) & 0xf) << 4) - #define TBTT_AP_OFFSET_UNKNOWN 255 -@@ -2449,7 +2449,9 @@ enum mscs_description_subelem { - #define TBTT_BSS_PARAM_SAME_SSID BIT(1) - #define TBTT_BSS_PARAM_MULTIPLE_BSSID BIT(2) - #define TBTT_BSS_PARAM_TRANSMITTED_BSSID BIT(3) --#define TBTT_BSS_PARAM_CO_LOCATED_ESS BIT(4) -+#define TBTT_BSS_PARAM_MEMBER_CO_LOCATED_ESS BIT(4) - #define TBTT_BSS_PARAM_20_TU_PROBE_RESP_ACTIVE BIT(5) -+#define TBTT_BSS_PARAM_CO_LOCATED BIT(6) -+#define TBTT_PSD_MAX_TXPOWER 255 /* dBm */ - - #endif /* IEEE802_11_DEFS_H */ --- -2.7.4 - diff --git a/feeds/wifi-ax/hostapd/patches/e00-013-hostapd-udpate-160MHz-center-freq-calculation-in-6GHz.patch b/feeds/wifi-ax/hostapd/patches/e00-013-hostapd-udpate-160MHz-center-freq-calculation-in-6GHz.patch index a72f24760..f1f2669cc 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-013-hostapd-udpate-160MHz-center-freq-calculation-in-6GHz.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-013-hostapd-udpate-160MHz-center-freq-calculation-in-6GHz.patch @@ -23,11 +23,9 @@ Signed-off-by: P Praneesh src/ap/ieee802_11_he.c | 8 ++++++++ 1 file changed, 8 insertions(+) -diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c -index 8391f94..18436a6 100644 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c -@@ -233,6 +233,14 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) +@@ -234,6 +234,14 @@ u8 * hostapd_eid_he_operation(struct hos *pos++ = center_idx_to_bw_6ghz(seg0); /* Channel Center Freq Seg0/Seg1 */ @@ -42,6 +40,3 @@ index 8391f94..18436a6 100644 *pos++ = seg0; *pos++ = seg1; /* Minimum Rate */ --- -2.7.4 - diff --git a/feeds/wifi-ax/hostapd/patches/e00-014-hostapd-update-cfs0-and-cfs1-for-160MHz.patch b/feeds/wifi-ax/hostapd/patches/e00-014-hostapd-update-cfs0-and-cfs1-for-160MHz.patch index 9a03c58ca..1caedd2bb 100644 --- a/feeds/wifi-ax/hostapd/patches/e00-014-hostapd-update-cfs0-and-cfs1-for-160MHz.patch +++ b/feeds/wifi-ax/hostapd/patches/e00-014-hostapd-update-cfs0-and-cfs1-for-160MHz.patch @@ -121,7 +121,7 @@ Signed-off-by: P Praneesh * Convert 80+80 MHz channel width to new style as interop --- a/src/common/hw_features_common.c +++ b/src/common/hw_features_common.c -@@ -740,6 +740,7 @@ int ieee80211ac_cap_check(u32 hw, u32 co +@@ -752,6 +752,7 @@ int ieee80211ac_cap_check(u32 hw, u32 co VHT_CAP_CHECK(VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB); VHT_CAP_CHECK(VHT_CAP_RX_ANTENNA_PATTERN); VHT_CAP_CHECK(VHT_CAP_TX_ANTENNA_PATTERN); 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 eca545977..099a8abb2 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 @@ -17,7 +17,7 @@ Signed-off-by: John Crispin --- a/src/ap/ap_drv_ops.h +++ b/src/ap/ap_drv_ops.h -@@ -299,6 +299,18 @@ static inline int hostapd_drv_switch_cha +@@ -300,6 +300,18 @@ static inline int hostapd_drv_switch_cha return hapd->driver->switch_channel(hapd->drv_priv, settings); } @@ -38,7 +38,7 @@ Signed-off-by: John Crispin { --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -65,6 +65,8 @@ static int setup_interface2(struct hosta +@@ -67,6 +67,8 @@ static int setup_interface2(struct hosta static void channel_list_update_timeout(void *eloop_ctx, void *timeout_ctx); static void hostapd_interface_setup_failure_handler(void *eloop_ctx, void *timeout_ctx); @@ -47,7 +47,7 @@ Signed-off-by: John Crispin int hostapd_for_each_interface(struct hapd_interfaces *interfaces, -@@ -476,6 +478,9 @@ static void hostapd_free_hapd_data(struc +@@ -568,6 +570,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 } -@@ -3713,6 +3718,119 @@ hostapd_switch_channel_fallback(struct h +@@ -3850,6 +3855,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 -@@ -296,6 +296,16 @@ struct hostapd_data { +@@ -321,6 +321,16 @@ struct hostapd_data { unsigned int cs_c_off_ecsa_beacon; unsigned int cs_c_off_ecsa_proberesp; @@ -196,9 +196,9 @@ Signed-off-by: John Crispin #ifdef CONFIG_P2P struct p2p_data *p2p; struct p2p_group *p2p_group; -@@ -642,6 +652,12 @@ void hostapd_periodic_iface(struct hosta - int hostapd_owe_trans_get_info(struct hostapd_data *hapd); +@@ -681,6 +691,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); + +#ifdef CONFIG_IEEE80211AX @@ -211,7 +211,7 @@ Signed-off-by: John Crispin int (*cb)(void *ctx, const u8 *sa, --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h -@@ -2280,6 +2280,7 @@ struct ieee80211_spatial_reuse { +@@ -2296,6 +2296,7 @@ struct ieee80211_spatial_reuse { #define HE_OPERATION_BSS_COLOR_PARTIAL ((u32) BIT(30)) #define HE_OPERATION_BSS_COLOR_DISABLED ((u32) BIT(31)) #define HE_OPERATION_BSS_COLOR_OFFSET 24 @@ -219,7 +219,7 @@ Signed-off-by: John Crispin /* Spatial Reuse defines */ #define SPATIAL_REUSE_SRP_DISALLOWED BIT(0) -@@ -2430,4 +2431,9 @@ enum mscs_description_subelem { +@@ -2456,4 +2457,9 @@ enum mscs_description_subelem { #define TBTT_BSS_PARAM_CO_LOCATED BIT(6) #define TBTT_PSD_MAX_TXPOWER 255 /* dBm */ @@ -231,7 +231,7 @@ Signed-off-by: John Crispin #endif /* IEEE802_11_DEFS_H */ --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -2417,6 +2417,26 @@ struct csa_settings { +@@ -2435,6 +2435,26 @@ struct csa_settings { u16 counter_offset_presp[2]; }; @@ -258,7 +258,7 @@ Signed-off-by: John Crispin /* TDLS peer capabilities for send_tdls_mgmt() */ enum tdls_peer_capability { TDLS_PEER_HT = BIT(0), -@@ -3989,6 +4009,17 @@ struct wpa_driver_ops { +@@ -4018,6 +4038,17 @@ struct wpa_driver_ops { int (*switch_channel)(void *priv, struct csa_settings *settings); /** diff --git a/feeds/wifi-ax/hostapd/patches/f00-002-bss_coloring-add-the-code-required-to-generate-the-CCA-IE.patch b/feeds/wifi-ax/hostapd/patches/f00-002-bss_coloring-add-the-code-required-to-generate-the-CCA-IE.patch index 1075b9141..b414e71c3 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-002-bss_coloring-add-the-code-required-to-generate-the-CCA-IE.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-002-bss_coloring-add-the-code-required-to-generate-the-CCA-IE.patch @@ -15,11 +15,9 @@ Signed-off-by: John Crispin src/common/ieee802_11_defs.h | 1 + 4 files changed, 28 insertions(+) -Index: hostapd-2021-02-08/src/ap/beacon.c -=================================================================== ---- hostapd-2021-02-08.orig/src/ap/beacon.c -+++ hostapd-2021-02-08/src/ap/beacon.c -@@ -592,11 +592,17 @@ static u8 * hostapd_gen_probe_resp(struc +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -610,11 +610,17 @@ static u8 * hostapd_gen_probe_resp(struc #ifdef CONFIG_IEEE80211AX if (hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax) { @@ -37,7 +35,7 @@ Index: hostapd-2021-02-08/src/ap/beacon.c } #endif /* CONFIG_IEEE80211AX */ -@@ -1646,12 +1652,18 @@ int ieee802_11_build_ap_params(struct ho +@@ -1649,12 +1655,18 @@ int ieee802_11_build_ap_params(struct ho #ifdef CONFIG_IEEE80211AX if (hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax) { @@ -56,10 +54,8 @@ Index: hostapd-2021-02-08/src/ap/beacon.c } #endif /* CONFIG_IEEE80211AX */ -Index: hostapd-2021-02-08/src/ap/ieee802_11.h -=================================================================== ---- hostapd-2021-02-08.orig/src/ap/ieee802_11.h -+++ hostapd-2021-02-08/src/ap/ieee802_11.h +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h @@ -100,6 +100,7 @@ u16 copy_sta_he_6ghz_capab(struct hostap const u8 *he_6ghz_capab); int hostapd_get_he_twt_responder(struct hostapd_data *hapd, @@ -68,11 +64,9 @@ Index: hostapd-2021-02-08/src/ap/ieee802_11.h void hostapd_tx_status(struct hostapd_data *hapd, const u8 *addr, const u8 *buf, size_t len, int ack); void hostapd_eapol_tx_status(struct hostapd_data *hapd, const u8 *dst, -Index: hostapd-2021-02-08/src/ap/ieee802_11_he.c -=================================================================== ---- hostapd-2021-02-08.orig/src/ap/ieee802_11_he.c -+++ hostapd-2021-02-08/src/ap/ieee802_11_he.c -@@ -521,3 +521,17 @@ int hostapd_get_he_twt_responder(struct +--- a/src/ap/ieee802_11_he.c ++++ b/src/ap/ieee802_11_he.c +@@ -524,3 +524,17 @@ int hostapd_get_he_twt_responder(struct return !!(mac_cap[HE_MAC_CAPAB_0] & HE_MACCAP_TWT_RESPONDER); } @@ -90,10 +84,8 @@ Index: hostapd-2021-02-08/src/ap/ieee802_11_he.c + + return eid; +} -Index: hostapd-2021-02-08/src/common/ieee802_11_defs.h -=================================================================== ---- hostapd-2021-02-08.orig/src/common/ieee802_11_defs.h -+++ hostapd-2021-02-08/src/common/ieee802_11_defs.h +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h @@ -480,6 +480,7 @@ #define WLAN_EID_EXT_HE_OPERATION 36 #define WLAN_EID_EXT_HE_MU_EDCA_PARAMS 38 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 ed085e5e8..c2e3534cb 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 -@@ -1310,42 +1310,6 @@ static int hostapd_ctrl_iface_get_config +@@ -1420,42 +1420,6 @@ static int hostapd_ctrl_iface_get_config } @@ -210,8 +210,8 @@ Signed-off-by: Nishant Pandey - static int hostapd_ctrl_iface_set_band(struct hostapd_data *hapd, - const char *band) -@@ -3301,81 +3265,6 @@ static int hostapd_ctrl_driver_flags2(st + const char *bands) +@@ -3435,81 +3399,6 @@ static int hostapd_ctrl_driver_flags2(st return pos - buf; } @@ -488,7 +488,7 @@ Signed-off-by: Nishant Pandey #endif /* CTRL_IFACE_AP_H */ --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5672,6 +5672,87 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct +@@ -6987,6 +6987,87 @@ u8 * hostapd_eid_wb_chsw_wrapper(struct } 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 567e0d7a6..077900379 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 @@ -18,13 +18,11 @@ Signed-off-by: Nishant Pandey wpa_supplicant/wpa_supplicant.conf | 14 ++++++++++++++ 6 files changed, 82 insertions(+), 1 deletion(-) -Index: hostapd-2021-02-08/wpa_supplicant/config.c -=================================================================== ---- hostapd-2021-02-08.orig/wpa_supplicant/config.c -+++ hostapd-2021-02-08/wpa_supplicant/config.c +--- a/wpa_supplicant/config.c ++++ b/wpa_supplicant/config.c @@ -20,7 +20,9 @@ - #include "drivers/nl80211_copy.h" #include "fst/fst.h" + #include "ap/sta_info.h" #include "config.h" - +#ifdef CONFIG_MESH @@ -33,7 +31,7 @@ Index: hostapd-2021-02-08/wpa_supplicant/config.c #if !defined(CONFIG_CTRL_IFACE) && defined(CONFIG_NO_CONFIG_WRITE) #define NO_CONFIG_WRITE -@@ -2710,6 +2712,9 @@ static const struct parse_data ssid_fiel +@@ -2647,6 +2649,9 @@ static const struct parse_data ssid_fiel { INT(dot11MeshRetryTimeout) }, { INT(dot11MeshConfirmTimeout) }, { INT(dot11MeshHoldingTimeout) }, @@ -43,7 +41,7 @@ Index: hostapd-2021-02-08/wpa_supplicant/config.c #endif /* CONFIG_MESH */ { INT(wpa_ptk_rekey) }, { INT_RANGE(wpa_deny_ptk0_rekey, 0, 2) }, -@@ -2980,6 +2985,8 @@ void wpa_config_free_ssid(struct wpa_ssi +@@ -2915,6 +2920,8 @@ void wpa_config_free_ssid(struct wpa_ssi os_free(ssid->p2p_client_list); os_free(ssid->bssid_ignore); os_free(ssid->bssid_accept); @@ -52,7 +50,7 @@ Index: hostapd-2021-02-08/wpa_supplicant/config.c #ifdef CONFIG_HT_OVERRIDES os_free(ssid->ht_mcs); #endif /* CONFIG_HT_OVERRIDES */ -@@ -3344,6 +3351,18 @@ int wpa_config_set(struct wpa_ssid *ssid +@@ -3280,6 +3287,18 @@ int wpa_config_set(struct wpa_ssid *ssid } ret = -1; } @@ -71,10 +69,8 @@ Index: hostapd-2021-02-08/wpa_supplicant/config.c #ifdef CONFIG_SAE if (os_strcmp(var, "ssid") == 0 || os_strcmp(var, "psk") == 0 || -Index: hostapd-2021-02-08/wpa_supplicant/config_file.c -=================================================================== ---- hostapd-2021-02-08.orig/wpa_supplicant/config_file.c -+++ hostapd-2021-02-08/wpa_supplicant/config_file.c +--- a/wpa_supplicant/config_file.c ++++ b/wpa_supplicant/config_file.c @@ -18,6 +18,9 @@ #include "common.h" #include "config.h" @@ -85,7 +81,7 @@ Index: hostapd-2021-02-08/wpa_supplicant/config_file.c #include "uuid.h" #include "common/ieee802_1x_defs.h" #include "p2p/p2p.h" -@@ -914,6 +917,9 @@ static void wpa_config_write_network(FIL +@@ -818,6 +821,9 @@ static void wpa_config_write_network(FIL write_int(f, "mac_addr", ssid->mac_addr, -1); #ifdef CONFIG_MESH STR(mesh_basic_rates); @@ -95,13 +91,11 @@ Index: hostapd-2021-02-08/wpa_supplicant/config_file.c INT_DEF(dot11MeshMaxRetries, DEFAULT_MESH_MAX_RETRIES); INT_DEF(dot11MeshRetryTimeout, DEFAULT_MESH_RETRY_TIMEOUT); INT_DEF(dot11MeshConfirmTimeout, DEFAULT_MESH_CONFIRM_TIMEOUT); -Index: hostapd-2021-02-08/wpa_supplicant/config_ssid.h -=================================================================== ---- hostapd-2021-02-08.orig/wpa_supplicant/config_ssid.h -+++ hostapd-2021-02-08/wpa_supplicant/config_ssid.h -@@ -546,6 +546,11 @@ struct wpa_ssid { - int dot11MeshConfirmTimeout; /* msec */ - int dot11MeshHoldingTimeout; /* msec */ +--- a/wpa_supplicant/config_ssid.h ++++ b/wpa_supplicant/config_ssid.h +@@ -553,6 +553,11 @@ struct wpa_ssid { + */ + int mesh_fwding; + char *accept_mac_file; + char *deny_mac_file; @@ -111,10 +105,8 @@ Index: hostapd-2021-02-08/wpa_supplicant/config_ssid.h int ht; int ht40; -Index: hostapd-2021-02-08/wpa_supplicant/mesh.c -=================================================================== ---- hostapd-2021-02-08.orig/wpa_supplicant/mesh.c -+++ hostapd-2021-02-08/wpa_supplicant/mesh.c +--- a/wpa_supplicant/mesh.c ++++ b/wpa_supplicant/mesh.c @@ -16,6 +16,7 @@ #include "common/hw_features_common.h" #include "ap/sta_info.h" @@ -123,7 +115,7 @@ Index: hostapd-2021-02-08/wpa_supplicant/mesh.c #include "ap/ieee802_11.h" #include "config_ssid.h" #include "config.h" -@@ -459,6 +460,17 @@ static int wpa_supplicant_mesh_init(stru +@@ -467,6 +468,17 @@ static int wpa_supplicant_mesh_init(stru ifmsh->bss[0]->dot11RSNASAERetransPeriod = wpa_s->conf->dot11RSNASAERetransPeriod; os_strlcpy(bss->conf->iface, wpa_s->ifname, sizeof(bss->conf->iface)); @@ -141,7 +133,7 @@ Index: hostapd-2021-02-08/wpa_supplicant/mesh.c mconf = mesh_config_create(wpa_s, ssid); if (!mconf) -@@ -555,6 +567,16 @@ void wpa_mesh_notify_peer(struct wpa_sup +@@ -559,6 +571,16 @@ void wpa_mesh_notify_peer(struct wpa_sup const u8 *ies, size_t ie_len) { struct ieee802_11_elems elems; @@ -158,10 +150,8 @@ Index: hostapd-2021-02-08/wpa_supplicant/mesh.c wpa_msg(wpa_s, MSG_INFO, "new peer notification for " MACSTR, MAC2STR(addr)); -Index: hostapd-2021-02-08/wpa_supplicant/mesh_mpm.c -=================================================================== ---- hostapd-2021-02-08.orig/wpa_supplicant/mesh_mpm.c -+++ hostapd-2021-02-08/wpa_supplicant/mesh_mpm.c +--- a/wpa_supplicant/mesh_mpm.c ++++ b/wpa_supplicant/mesh_mpm.c @@ -16,6 +16,7 @@ #include "ap/hostapd.h" #include "ap/sta_info.h" @@ -202,13 +192,11 @@ Index: hostapd-2021-02-08/wpa_supplicant/mesh_mpm.c if (!elems.mesh_id || !elems.mesh_config) { wpa_printf(MSG_DEBUG, "MPM: No Mesh ID or Mesh Configuration element"); -Index: hostapd-2021-02-08/wpa_supplicant/wpa_supplicant.conf -=================================================================== ---- hostapd-2021-02-08.orig/wpa_supplicant/wpa_supplicant.conf -+++ hostapd-2021-02-08/wpa_supplicant/wpa_supplicant.conf -@@ -150,6 +150,20 @@ ap_scan=1 - # This timeout value is used in mesh STA to clean up inactive stations. - #mesh_max_inactivity=300 +--- a/wpa_supplicant/wpa_supplicant.conf ++++ b/wpa_supplicant/wpa_supplicant.conf +@@ -153,6 +153,20 @@ ap_scan=1 + # Enable 802.11s layer-2 routing and forwarding + #mesh_fwding=1 +# Mesh node address -based authentication +# Please note that this kind of access control requires a driver that uses diff --git a/feeds/wifi-ax/hostapd/patches/f00-003-bss-coloring-disable-BSS-color-during-CCA.patch b/feeds/wifi-ax/hostapd/patches/f00-003-bss-coloring-disable-BSS-color-during-CCA.patch index d0b401f36..8bf6bbcd6 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-003-bss-coloring-disable-BSS-color-during-CCA.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-003-bss-coloring-disable-BSS-color-during-CCA.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c -@@ -198,7 +198,7 @@ u8 * hostapd_eid_he_operation(struct hos +@@ -200,7 +200,7 @@ u8 * hostapd_eid_he_operation(struct hos params |= (hapd->iface->conf->he_op.he_rts_threshold << HE_OPERATION_RTS_THRESHOLD_OFFSET); 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 570b6d867..91a99c8cd 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 -@@ -10031,6 +10031,82 @@ error: +@@ -9961,6 +9961,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) { -@@ -12204,6 +12280,9 @@ const struct wpa_driver_ops wpa_driver_n +@@ -12121,6 +12197,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, @@ -110,7 +110,7 @@ Signed-off-by: John Crispin .get_noa = wpa_driver_get_p2p_noa, --- a/src/drivers/nl80211_copy.h +++ b/src/drivers/nl80211_copy.h -@@ -1429,6 +1429,14 @@ enum nl80211_commands { +@@ -1430,6 +1430,14 @@ enum nl80211_commands { NL80211_CMD_SET_FILS_DISCOVERY, NL80211_CMD_SET_UNSOL_BCAST_PROBE_RESP, @@ -125,7 +125,7 @@ Signed-off-by: John Crispin /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ -@@ -3094,6 +3102,12 @@ enum nl80211_attrs { +@@ -3095,6 +3103,12 @@ enum nl80211_attrs { NL80211_ATTR_MULTIPLE_BSSID_COUNT, NL80211_ATTR_MULTIPLE_BSSID_IES, diff --git a/feeds/wifi-ax/hostapd/patches/f00-004-mesh-Dynamic-MAC-ACL-management-over-control-interface.patch b/feeds/wifi-ax/hostapd/patches/f00-004-mesh-Dynamic-MAC-ACL-management-over-control-interface.patch index 976a23a87..a3e22f691 100644 --- a/feeds/wifi-ax/hostapd/patches/f00-004-mesh-Dynamic-MAC-ACL-management-over-control-interface.patch +++ b/feeds/wifi-ax/hostapd/patches/f00-004-mesh-Dynamic-MAC-ACL-management-over-control-interface.patch @@ -34,7 +34,7 @@ Signed-off-by: Nishant Pandey #include "utils/includes.h" -@@ -1616,6 +1617,73 @@ void wpas_ap_pmksa_cache_flush(struct wp +@@ -1708,6 +1709,73 @@ void wpas_ap_pmksa_cache_flush(struct wp hostapd_ctrl_iface_pmksa_flush(wpa_s->ifmsh->bss[0]); } @@ -132,7 +132,7 @@ Signed-off-by: Nishant Pandey #include "utils/includes.h" #ifdef CONFIG_TESTING_OPTIONS -@@ -56,6 +57,7 @@ +@@ -57,6 +58,7 @@ #include "mesh.h" #include "dpp_supplicant.h" #include "sme.h" @@ -140,7 +140,7 @@ Signed-off-by: Nishant Pandey #ifdef __NetBSD__ #include -@@ -3284,6 +3286,18 @@ static int wpa_supplicant_ctrl_iface_mes +@@ -3282,6 +3284,18 @@ static int wpa_supplicant_ctrl_iface_mes return wpas_mesh_peer_remove(wpa_s, addr); } @@ -159,7 +159,7 @@ Signed-off-by: Nishant Pandey static int wpa_supplicant_ctrl_iface_mesh_peer_add( struct wpa_supplicant *wpa_s, char *cmd) -@@ -10655,6 +10669,38 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10788,6 +10802,38 @@ char * wpa_supplicant_ctrl_iface_process reply_len = -1; #endif /* CONFIG_IBSS_RSN */ #ifdef CONFIG_MESH @@ -220,7 +220,7 @@ Signed-off-by: Nishant Pandey --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c -@@ -2113,6 +2113,19 @@ static int wpa_cli_cmd_mesh_link_probe(s +@@ -2118,6 +2118,19 @@ static int wpa_cli_cmd_mesh_link_probe(s return wpa_cli_cmd(ctrl, "MESH_LINK_PROBE", 1, argc, argv); } @@ -240,7 +240,7 @@ Signed-off-by: Nishant Pandey #endif /* CONFIG_MESH */ -@@ -3532,6 +3545,12 @@ static const struct wpa_cli_cmd wpa_cli_ +@@ -3582,6 +3595,12 @@ static const struct wpa_cli_cmd wpa_cli_ { "mesh_link_probe", wpa_cli_cmd_mesh_link_probe, NULL, cli_cmd_flag_none, " [payload=] = Probe a mesh link for a given peer by injecting a frame." }, @@ -263,7 +263,7 @@ Signed-off-by: Nishant Pandey #include "includes.h" #ifdef CONFIG_MATCH_IFACE -@@ -49,7 +50,6 @@ +@@ -50,7 +51,6 @@ #include "ibss_rsn.h" #include "sme.h" #include "gas_query.h" @@ -271,7 +271,7 @@ Signed-off-by: Nishant Pandey #include "p2p_supplicant.h" #include "wifi_display.h" #include "notify.h" -@@ -67,6 +67,7 @@ +@@ -68,6 +68,7 @@ #include "ap/ap_config.h" #include "ap/hostapd.h" #endif /* CONFIG_MESH */ 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 3a1c5a75e..1cc0018b0 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 @@ -25,7 +25,7 @@ Signed-off-by: John Crispin #ifdef CONFIG_FILS void hostapd_notify_assoc_fils_finish(struct hostapd_data *hapd, struct sta_info *sta) -@@ -1790,6 +1789,39 @@ static void hostapd_event_update_muedca_ +@@ -1786,6 +1785,39 @@ static void hostapd_event_update_muedca_ "Failed to update beacons with MU-EDCA parameters"); } @@ -65,7 +65,7 @@ Signed-off-by: John Crispin #ifdef CONFIG_OWE static int hostapd_notif_update_dh_ie(struct hostapd_data *hapd, const u8 *peer, const u8 *ie, -@@ -2100,6 +2132,17 @@ void hostapd_wpa_event(void *ctx, enum w +@@ -2096,6 +2128,17 @@ void hostapd_wpa_event(void *ctx, enum w case EVENT_UPDATE_MUEDCA_PARAMS: hostapd_event_update_muedca_params(hapd, &data->update_muedca); break; @@ -85,7 +85,7 @@ Signed-off-by: John Crispin break; --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5182,6 +5182,26 @@ enum wpa_event_type { +@@ -5201,6 +5201,26 @@ enum wpa_event_type { * beacon. */ EVENT_UPDATE_MUEDCA_PARAMS, @@ -112,7 +112,7 @@ Signed-off-by: John Crispin }; -@@ -6051,6 +6071,13 @@ union wpa_event_data { +@@ -6105,6 +6125,13 @@ union wpa_event_data { u8 he_mu_ac_vi_param[3]; u8 he_mu_ac_vo_param[3]; } update_muedca; @@ -153,7 +153,7 @@ Signed-off-by: John Crispin default: return "NL80211_CMD_UNKNOWN"; } -@@ -2603,6 +2606,51 @@ static void nl80211_control_port_frame(s +@@ -2745,6 +2748,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, -@@ -2856,6 +2904,20 @@ static void do_process_drv_event(struct +@@ -3019,6 +3067,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 685aa6aae..5c818435f 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 -@@ -3367,8 +3367,11 @@ static int hostapd_config_fill(struct ho +@@ -3412,8 +3412,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) { @@ -30,7 +30,7 @@ Signed-off-by: John Crispin } else if (os_strcmp(buf, "he_default_pe_duration") == 0) { --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf -@@ -810,7 +810,10 @@ wmm_ac_vo_acm=0 +@@ -825,7 +825,10 @@ wmm_ac_vo_acm=0 # 1 = supported #he_mu_beamformer=1 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 4bfdb3817..556a0244b 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 -@@ -3769,6 +3769,7 @@ hostapd_switch_color_timeout_handler(voi +@@ -3906,6 +3906,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; -@@ -3777,11 +3778,16 @@ hostapd_switch_color_timeout_handler(voi +@@ -3914,11 +3915,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 3d9080ab8..8634c5f35 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,8 +1,6 @@ -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 -@@ -2673,6 +2673,59 @@ static int hostapd_ctrl_check_freq_param +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -2679,6 +2679,59 @@ static int hostapd_ctrl_check_freq_param } #endif /* NEED_AP_MLME */ @@ -62,7 +60,7 @@ Index: hostapd-2021-02-20-59e9794c/hostapd/ctrl_iface.c static int hostapd_ctrl_iface_chan_switch(struct hostapd_iface *iface, char *pos) -@@ -3682,6 +3735,9 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3688,6 +3741,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; @@ -72,10 +70,8 @@ Index: hostapd-2021-02-20-59e9794c/hostapd/ctrl_iface.c } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, reply_size); -Index: hostapd-2021-02-20-59e9794c/hostapd/hostapd_cli.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/hostapd/hostapd_cli.c -+++ hostapd-2021-02-20-59e9794c/hostapd/hostapd_cli.c +--- a/hostapd/hostapd_cli.c ++++ b/hostapd/hostapd_cli.c @@ -1150,6 +1150,27 @@ static int hostapd_cli_cmd_fst(struct wp } #endif /* CONFIG_FST */ @@ -113,10 +109,8 @@ Index: hostapd-2021-02-20-59e9794c/hostapd/hostapd_cli.c { "hs20_wnm_notif", hostapd_cli_cmd_hs20_wnm_notif, NULL, " \n" " = send WNM-Notification Subscription Remediation Request" }, -Index: hostapd-2021-02-20-59e9794c/src/ap/ctrl_iface_ap.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ctrl_iface_ap.c -+++ hostapd-2021-02-20-59e9794c/src/ap/ctrl_iface_ap.c +--- a/src/ap/ctrl_iface_ap.c ++++ b/src/ap/ctrl_iface_ap.c @@ -1055,10 +1055,12 @@ int hostapd_ctrl_iface_status(struct hos ret = os_snprintf(buf + len, buflen - len, "he_oper_chwidth=%d\n" @@ -132,11 +126,9 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ctrl_iface_ap.c if (os_snprintf_error(buflen - len, ret)) return len; len += ret; -Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.c -+++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.c -@@ -3443,7 +3443,7 @@ int hostapd_csa_in_progress(struct hosta +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c +@@ -3477,7 +3477,7 @@ int hostapd_csa_in_progress(struct hosta #ifdef NEED_AP_MLME @@ -145,7 +137,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c { os_free(beacon->head); beacon->head = NULL; -@@ -3833,7 +3833,7 @@ void hostapd_cleanup_cca_params(struct h +@@ -3867,7 +3867,7 @@ void hostapd_cleanup_cca_params(struct h } @@ -154,11 +146,9 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c struct cca_settings *settings) { struct hostapd_iface *iface = hapd->iface; -Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.h -+++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.h -@@ -661,11 +661,13 @@ void hostapd_periodic_iface(struct hosta +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h +@@ -690,11 +690,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 59cbc2d8b..131506949 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 @@ -18,7 +18,7 @@ Signed-off-by: Lavanya Suresh --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1802,14 +1802,29 @@ static void hostapd_event_bss_color_coll +@@ -1798,14 +1798,29 @@ static void hostapd_event_bss_color_coll static void hostapd_event_cca(struct hostapd_data *hapd, enum wpa_event_type event) { @@ -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 -@@ -3742,12 +3742,18 @@ int hostapd_fill_cca_settings(struct hos +@@ -3879,12 +3879,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 -@@ -298,6 +298,7 @@ struct hostapd_data { +@@ -323,6 +323,7 @@ struct hostapd_data { #ifdef CONFIG_IEEE80211AX int cca_in_progress; @@ -85,7 +85,7 @@ Signed-off-by: Lavanya Suresh unsigned int cca_c_off_beacon; --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c -@@ -496,7 +496,7 @@ int hostapd_get_he_twt_responder(struct +@@ -528,7 +528,7 @@ int hostapd_get_he_twt_responder(struct u8 * hostapd_eid_cca(struct hostapd_data *hapd, u8 *eid) { 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 87b767a05..9c83f8613 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 -@@ -3781,11 +3781,12 @@ hostapd_switch_color_timeout_handler(voi +@@ -3918,11 +3918,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++; -@@ -3797,13 +3798,26 @@ hostapd_switch_color_timeout_handler(voi +@@ -3934,13 +3935,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 -@@ -299,6 +299,7 @@ struct hostapd_data { +@@ -324,6 +324,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 21aec4ebf..10a2ce1e0 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 -@@ -4560,8 +4560,8 @@ static int hostapd_config_fill(struct ho +@@ -4591,8 +4591,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 -@@ -2759,6 +2759,9 @@ static int hostapd_ctrl_iface_chan_switc +@@ -2827,6 +2827,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 -@@ -1486,7 +1486,7 @@ int hostapd_config_check(struct hostapd_ +@@ -1489,7 +1489,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 -@@ -1017,7 +1017,7 @@ struct hostapd_config { +@@ -1029,7 +1029,7 @@ struct hostapd_config { u8 ht40_plus_minus_allowed; u8 multiple_bssid; @@ -72,7 +72,7 @@ Signed-off-by: John Crispin u8 use_driver_iface_addr; --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -1808,6 +1808,9 @@ int ieee802_11_build_ap_params(struct ho +@@ -1822,6 +1822,9 @@ int ieee802_11_build_ap_params(struct ho params->multiple_bssid_index = hostapd_get_bss_index(hapd); params->multiple_bssid_count = hapd->iface->num_bss; @@ -82,7 +82,7 @@ Signed-off-by: John Crispin params->multiple_bssid_ies = os_zalloc(len); if (params->multiple_bssid_ies == NULL) return -1; -@@ -1817,7 +1820,7 @@ int ieee802_11_build_ap_params(struct ho +@@ -1831,7 +1834,7 @@ int ieee802_11_build_ap_params(struct ho 1, params->multiple_bssid_ie_offsets, ¶ms->multiple_bssid_ie_count, MULTIPLE_BSSID_IE_MAX, @@ -93,7 +93,7 @@ Signed-off-by: John Crispin (ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08)) --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -7126,7 +7126,7 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7146,7 +7146,7 @@ static u8 * hostapd_eid_multiple_bssid_c for (i = *count; i < hapd->iface->num_bss; i++) { bss = hapd->iface->bss[i]; conf = bss->conf; @@ -102,7 +102,7 @@ Signed-off-by: John Crispin u16 capab_info; *eid++ = WLAN_EID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE; -@@ -7161,8 +7161,19 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7181,8 +7181,19 @@ static u8 * hostapd_eid_multiple_bssid_c } *index_size_offset = (eid - index_size_offset) - 1; @@ -156,7 +156,7 @@ Signed-off-by: John Crispin #define WLAN_EID_EXT_EDMG_CAPABILITIES 61 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1586,9 +1586,9 @@ struct wpa_driver_ap_params { +@@ -1584,9 +1584,9 @@ struct wpa_driver_ap_params { size_t unsol_bcast_probe_resp_tmpl_len; /** @@ -168,7 +168,7 @@ Signed-off-by: John Crispin /** * multiple_bssid_index - The index of this BSS in the group -@@ -1619,6 +1619,12 @@ struct wpa_driver_ap_params { +@@ -1617,6 +1617,12 @@ struct wpa_driver_ap_params { * multiple_bssid_ie_count - The the number of offsets inside multiple_bssid_ie_offsets */ int multiple_bssid_ie_count; @@ -183,7 +183,7 @@ Signed-off-by: John Crispin struct wpa_driver_mesh_bss_params { --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4872,6 +4872,16 @@ static int wpa_driver_nl80211_set_ap(voi +@@ -4799,6 +4799,16 @@ static int wpa_driver_nl80211_set_ap(voi params->multiple_bssid_index); nla_put_u8(msg, NL80211_ATTR_MULTIPLE_BSSID_COUNT, params->multiple_bssid_count); @@ -200,7 +200,7 @@ Signed-off-by: John Crispin } if (params->multiple_bssid_ie_len) { -@@ -5528,17 +5538,6 @@ static int nl80211_create_iface_once(str +@@ -5461,17 +5471,6 @@ static int nl80211_create_iface_once(str goto fail; } @@ -220,7 +220,7 @@ Signed-off-by: John Crispin * it, and the interface should be deleted when the socket is closed. --- a/src/drivers/nl80211_copy.h +++ b/src/drivers/nl80211_copy.h -@@ -2583,9 +2583,6 @@ enum nl80211_commands { +@@ -2584,9 +2584,6 @@ enum nl80211_commands { * @NL80211_ATTR_HE_MUEDCA_PARAMS: MU-EDCA AC parameters for the NL80211_CMD_UPDATE_HE_MUEDCA_PARAMS command. * @@ -230,7 +230,7 @@ Signed-off-by: John Crispin * @NL80211_ATTR_MULTIPLE_BSSID_PARENT: If this is a Non-Transmitted BSSID, define * the parent (transmitting) interface. * -@@ -2595,7 +2592,9 @@ enum nl80211_commands { +@@ -2596,7 +2593,9 @@ enum nl80211_commands { * @NL80211_ATTR_MULTIPLE_BSSID_COUNT: The number of BSSs inside the multi bssid element. * * @NL80211_ATTR_MULTIPLE_BSSID_IES: The Elements that describe our multiple BSS group. @@ -241,7 +241,7 @@ Signed-off-by: John Crispin * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined -@@ -3096,11 +3095,11 @@ enum nl80211_attrs { +@@ -3097,11 +3096,11 @@ enum nl80211_attrs { NL80211_ATTR_HE_MUEDCA_PARAMS, 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 1b06a25bc..3ca98da24 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 @@ -20,11 +20,9 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11_shared.c | 28 +++++++++++++++++++++++----- 4 files changed, 39 insertions(+), 20 deletions(-) -Index: hostapd-2021-02-20/hostapd/ctrl_iface.c -=================================================================== ---- hostapd-2021-02-20.orig/hostapd/ctrl_iface.c -+++ hostapd-2021-02-20/hostapd/ctrl_iface.c -@@ -2759,9 +2759,6 @@ static int hostapd_ctrl_iface_chan_switc +--- a/hostapd/ctrl_iface.c ++++ b/hostapd/ctrl_iface.c +@@ -2827,9 +2827,6 @@ static int hostapd_ctrl_iface_chan_switc * submitting multi-BSS CSA requests? */ return ret; } @@ -34,10 +32,8 @@ Index: hostapd-2021-02-20/hostapd/ctrl_iface.c } return 0; -Index: hostapd-2021-02-20/src/ap/beacon.c -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/beacon.c -+++ hostapd-2021-02-20/src/ap/beacon.c +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c @@ -434,7 +434,7 @@ static u8 * hostapd_gen_probe_resp(struc { struct hostapd_data *hidden = NULL; @@ -58,7 +54,7 @@ Index: hostapd-2021-02-20/src/ap/beacon.c pos = hostapd_eid_time_adv(hapd, pos); pos = hostapd_eid_time_zone(hapd, pos); -@@ -1834,9 +1831,9 @@ int ieee802_11_build_ap_params(struct ho +@@ -1836,9 +1833,9 @@ int ieee802_11_build_ap_params(struct ho MULTIPLE_BSSID_IE_MAX, hapd->iconf->ema_beacon); params->multiple_bssid_ie_len = end - params->multiple_bssid_ies; @@ -70,11 +66,9 @@ Index: hostapd-2021-02-20/src/ap/beacon.c params->dtim_period = hapd->conf->dtim_period; } -Index: hostapd-2021-02-20/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/ieee802_11.c -+++ hostapd-2021-02-20/src/ap/ieee802_11.c -@@ -167,6 +167,7 @@ u8 * hostapd_eid_ext_supp_rates(struct h +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -175,6 +175,7 @@ u8 * hostapd_eid_ext_supp_rates(struct h int i, num, count; int h2e_required; @@ -82,7 +76,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c if (hapd->iface->current_rates == NULL) return eid; -@@ -216,6 +217,7 @@ u8 * hostapd_eid_ext_supp_rates(struct h +@@ -224,6 +225,7 @@ u8 * hostapd_eid_ext_supp_rates(struct h *pos++ = 0x80 | BSS_MEMBERSHIP_SELECTOR_SAE_H2E_ONLY; } @@ -90,7 +84,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c return pos; } -@@ -7081,6 +7083,13 @@ static int hostapd_eid_multiple_bssid_ch +@@ -7101,6 +7103,13 @@ static int hostapd_eid_multiple_bssid_ch if (wpa_auth_get_wpa_ie(bss->wpa_auth, &ies_len)) nontx_profile_len += ies_len; @@ -104,7 +98,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c if (len + nontx_profile_len > 255) { goto multiple_bssid_too_big; -@@ -7117,7 +7126,8 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7137,7 +7146,8 @@ static u8 * hostapd_eid_multiple_bssid_c struct hostapd_data *bss; struct hostapd_bss_config *conf; u8 *size_offset, *num_offset; @@ -114,7 +108,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c *eid++ = WLAN_EID_MULTIPLE_BSSID; size_offset = eid++; -@@ -7126,8 +7136,9 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7146,8 +7156,9 @@ static u8 * hostapd_eid_multiple_bssid_c for (i = *count; i < hapd->iface->num_bss; i++) { bss = hapd->iface->bss[i]; conf = bss->conf; @@ -125,7 +119,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c *eid++ = WLAN_EID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE; bss_size_offset = eid++; -@@ -7161,17 +7172,38 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7181,17 +7192,38 @@ static u8 * hostapd_eid_multiple_bssid_c } *index_size_offset = (eid - index_size_offset) - 1; @@ -173,10 +167,8 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c } *bss_size_offset = (eid - bss_size_offset) - 1; -Index: hostapd-2021-02-20/src/ap/ieee802_11_shared.c -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/ieee802_11_shared.c -+++ hostapd-2021-02-20/src/ap/ieee802_11_shared.c +--- a/src/ap/ieee802_11_shared.c ++++ b/src/ap/ieee802_11_shared.c @@ -427,9 +427,13 @@ static void hostapd_ext_capab_byte(struc * Identifiers Used Exclusively */ } @@ -239,11 +231,9 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11_shared.c while (len > 0 && eid[1 + len] == 0) { len--; eid[1] = len; -Index: hostapd-2021-02-20/src/ap/ap_config.h -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/ap_config.h -+++ hostapd-2021-02-20/src/ap/ap_config.h -@@ -534,6 +534,7 @@ struct hostapd_bss_config { +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -541,6 +541,7 @@ struct hostapd_bss_config { bool disable_11n; bool disable_11ac; bool disable_11ax; diff --git a/feeds/wifi-ax/hostapd/patches/g00-003-hostapd-fix-int-in-bool-context-Werror.patch b/feeds/wifi-ax/hostapd/patches/g00-003-hostapd-fix-int-in-bool-context-Werror.patch index 277cd1e15..96fb53d0e 100644 --- a/feeds/wifi-ax/hostapd/patches/g00-003-hostapd-fix-int-in-bool-context-Werror.patch +++ b/feeds/wifi-ax/hostapd/patches/g00-003-hostapd-fix-int-in-bool-context-Werror.patch @@ -14,11 +14,9 @@ Signed-off-by: Abinaya Kalaiselvan src/rsn_supp/wpa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c -index 3205527..88c1e3e 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -615,10 +615,11 @@ static int wpa_handle_ext_key_id(struct wpa_sm *sm, +@@ -624,10 +624,11 @@ static int wpa_handle_ext_key_id(struct { if (sm->ext_key_id) { u16 key_id; @@ -32,6 +30,3 @@ index 3205527..88c1e3e 100644 "RSN: No Key ID in Extended Key ID handshake"); sm->keyidx_active = 0; return sm->use_ext_key_id ? -1 : 0; --- -2.7.4 - diff --git a/feeds/wifi-ax/hostapd/patches/h00-001-wpa_supplicant-add-mesh-ID-IE-only-for-mesh-mode.patch b/feeds/wifi-ax/hostapd/patches/h00-001-wpa_supplicant-add-mesh-ID-IE-only-for-mesh-mode.patch index a8df94092..0a403602f 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-001-wpa_supplicant-add-mesh-ID-IE-only-for-mesh-mode.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-001-wpa_supplicant-add-mesh-ID-IE-only-for-mesh-mode.patch @@ -12,11 +12,9 @@ Signed-off-by: Lavanya Suresh wpa_supplicant/scan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c -index b9e4162..9992e42 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c -@@ -611,7 +611,10 @@ static struct wpabuf * wpa_supplicant_extra_ies(struct wpa_supplicant *wpa_s) +@@ -625,7 +625,10 @@ static struct wpabuf * wpa_supplicant_ex } #endif /* CONFIG_P2P */ @@ -28,6 +26,3 @@ index b9e4162..9992e42 100644 #endif /* CONFIG_WPS */ --- -2.7.4 - 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 93a157c91..b77771f4d 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 @@ -12,11 +12,9 @@ Signed-off-by: P Praneesh wpa_supplicant/wpa_supplicant.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) -Index: hostapd-2021-02-18/wpa_supplicant/wpa_supplicant.c -=================================================================== ---- hostapd-2021-02-18.orig/wpa_supplicant/wpa_supplicant.c -+++ hostapd-2021-02-18/wpa_supplicant/wpa_supplicant.c -@@ -2378,6 +2378,57 @@ static int drv_supports_vht(struct wpa_s +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -2431,6 +2431,57 @@ static int drv_supports_vht(struct wpa_s return mode->vht_capab != 0; } @@ -74,7 +72,7 @@ Index: hostapd-2021-02-18/wpa_supplicant/wpa_supplicant.c static bool ibss_mesh_is_80mhz_avail(int channel, struct hostapd_hw_modes *mode) { int i; -@@ -2498,6 +2549,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2555,6 +2606,11 @@ void ibss_mesh_setup_freq(struct wpa_sup else #endif /* CONFIG_HE_OVERRIDES */ freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported; @@ -86,11 +84,9 @@ Index: hostapd-2021-02-18/wpa_supplicant/wpa_supplicant.c } for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) { -Index: hostapd-2021-02-18/src/drivers/driver.h -=================================================================== ---- hostapd-2021-02-18.orig/src/drivers/driver.h -+++ hostapd-2021-02-18/src/drivers/driver.h -@@ -1203,6 +1203,11 @@ struct wpa_driver_associate_params { +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -1201,6 +1201,11 @@ struct wpa_driver_associate_params { * 2 = both hunting-and-pecking loop and hash-to-element enabled */ int sae_pwe; @@ -102,11 +98,9 @@ Index: hostapd-2021-02-18/src/drivers/driver.h }; enum hide_ssid { -Index: hostapd-2021-02-18/wpa_supplicant/config.c -=================================================================== ---- hostapd-2021-02-18.orig/wpa_supplicant/config.c -+++ hostapd-2021-02-18/wpa_supplicant/config.c -@@ -2804,6 +2804,7 @@ static const struct parse_data ssid_fiel +--- a/wpa_supplicant/config.c ++++ b/wpa_supplicant/config.c +@@ -2739,6 +2739,7 @@ static const struct parse_data ssid_fiel { INT_RANGE(beacon_prot, 0, 1) }, { INT_RANGE(transition_disable, 0, 255) }, { INT_RANGE(sae_pk, 0, 2) }, @@ -114,11 +108,9 @@ Index: hostapd-2021-02-18/wpa_supplicant/config.c }; #undef OFFSET -Index: hostapd-2021-02-18/wpa_supplicant/config_file.c -=================================================================== ---- hostapd-2021-02-18.orig/wpa_supplicant/config_file.c -+++ hostapd-2021-02-18/wpa_supplicant/config_file.c -@@ -885,7 +885,7 @@ static void wpa_config_write_network(FIL +--- a/wpa_supplicant/config_file.c ++++ b/wpa_supplicant/config_file.c +@@ -887,7 +887,7 @@ static void wpa_config_write_network(FIL #ifdef CONFIG_HE_OVERRIDES INT(disable_he); #endif /* CONFIG_HE_OVERRIDES */ @@ -127,11 +119,9 @@ Index: hostapd-2021-02-18/wpa_supplicant/config_file.c #undef STR #undef INT #undef INT_DEF -Index: hostapd-2021-02-18/wpa_supplicant/config_ssid.h -=================================================================== ---- hostapd-2021-02-18.orig/wpa_supplicant/config_ssid.h -+++ hostapd-2021-02-18/wpa_supplicant/config_ssid.h -@@ -1165,6 +1165,11 @@ struct wpa_ssid { +--- a/wpa_supplicant/config_ssid.h ++++ b/wpa_supplicant/config_ssid.h +@@ -1172,6 +1172,11 @@ struct wpa_ssid { * configuration. */ bool was_recently_reconfigured; @@ -143,11 +133,9 @@ Index: hostapd-2021-02-18/wpa_supplicant/config_ssid.h }; #endif /* CONFIG_SSID_H */ -Index: hostapd-2021-02-18/wpa_supplicant/wpa_cli.c -=================================================================== ---- hostapd-2021-02-18.orig/wpa_supplicant/wpa_cli.c -+++ hostapd-2021-02-18/wpa_supplicant/wpa_cli.c -@@ -1482,7 +1482,8 @@ static const char *network_fields[] = { +--- a/wpa_supplicant/wpa_cli.c ++++ b/wpa_supplicant/wpa_cli.c +@@ -1487,7 +1487,8 @@ static const char *network_fields[] = { #ifdef CONFIG_HS20 "update_identifier", #endif /* CONFIG_HS20 */ @@ -157,11 +145,9 @@ Index: hostapd-2021-02-18/wpa_supplicant/wpa_cli.c }; -Index: hostapd-2021-02-18/wpa_supplicant/wpa_supplicant.conf -=================================================================== ---- hostapd-2021-02-18.orig/wpa_supplicant/wpa_supplicant.conf -+++ hostapd-2021-02-18/wpa_supplicant/wpa_supplicant.conf -@@ -158,6 +158,9 @@ ap_scan=1 +--- a/wpa_supplicant/wpa_supplicant.conf ++++ b/wpa_supplicant/wpa_supplicant.conf +@@ -161,6 +161,9 @@ ap_scan=1 # 1 = deny unless in accept list macaddr_acl=0 @@ -171,7 +157,7 @@ Index: hostapd-2021-02-18/wpa_supplicant/wpa_supplicant.conf # Accept/deny lists are read from separate files (containing list of # MAC addresses, one per line). Use absolute path name to make sure that the # files can be read on SIGHUP configuration reloads. -@@ -1983,6 +1986,15 @@ network={ +@@ -1974,6 +1977,15 @@ network={ psk="very secret passphrase" } 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 0ec7229ef..ba47d624a 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 -@@ -1184,6 +1184,9 @@ static int hostapd_config_check_bss(stru +@@ -1239,6 +1239,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 -@@ -128,7 +128,7 @@ static void hostapd_reload_bss(struct ho +@@ -130,7 +130,7 @@ void hostapd_reload_bss(struct hostapd_d 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); -@@ -1241,7 +1241,7 @@ static int hostapd_setup_bss(struct host +@@ -1350,7 +1350,7 @@ int hostapd_setup_bss(struct hostapd_dat } if (conf->wmm_enabled < 0) diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-01-hostapd-Process-known-BSSID-element.patch b/feeds/wifi-ax/hostapd/patches/h00-003-01-hostapd-Process-known-BSSID-element.patch index eebc75b60..92b3ffdb0 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-003-01-hostapd-Process-known-BSSID-element.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-003-01-hostapd-Process-known-BSSID-element.patch @@ -20,10 +20,8 @@ Signed-off-by: Aloka Dixit src/common/ieee802_11_defs.h | 1 + 6 files changed, 76 insertions(+), 36 deletions(-) -Index: hostapd-2021-02-20/src/ap/beacon.c -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/beacon.c -+++ hostapd-2021-02-20/src/ap/beacon.c +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c @@ -8,6 +8,7 @@ * See README for more details. */ @@ -92,7 +90,7 @@ Index: hostapd-2021-02-20/src/ap/beacon.c /* eCSA IE */ csa_pos = hostapd_eid_ecsa(hapd, pos); -@@ -1119,12 +1124,13 @@ void handle_probe_req(struct hostapd_dat +@@ -1121,12 +1126,13 @@ void handle_probe_req(struct hostapd_dat " signal=%d", MAC2STR(mgmt->sa), ssi_signal); if (hapd->iconf->multiple_bssid && @@ -108,7 +106,7 @@ Index: hostapd-2021-02-20/src/ap/beacon.c if (resp == NULL) return; -@@ -1193,7 +1199,7 @@ static u8 * hostapd_probe_resp_offloads( +@@ -1195,7 +1201,7 @@ static u8 * hostapd_probe_resp_offloads( "this"); /* Generate a Probe Response template for the non-P2P case */ @@ -117,7 +115,7 @@ Index: hostapd-2021-02-20/src/ap/beacon.c } #endif /* NEED_AP_MLME */ -@@ -1211,7 +1217,8 @@ static u8 * hostapd_unsol_bcast_probe_re +@@ -1213,7 +1219,8 @@ static u8 * hostapd_unsol_bcast_probe_re hapd->conf->unsol_bcast_probe_resp_interval; return hostapd_gen_probe_resp(hapd, NULL, 0, @@ -127,7 +125,7 @@ Index: hostapd-2021-02-20/src/ap/beacon.c } #endif /* CONFIG_IEEE80211AX */ -@@ -1812,7 +1819,7 @@ int ieee802_11_build_ap_params(struct ho +@@ -1814,7 +1821,7 @@ int ieee802_11_build_ap_params(struct ho } if (hapd->iconf->multiple_bssid) { @@ -136,7 +134,7 @@ Index: hostapd-2021-02-20/src/ap/beacon.c u8 *end; params->multiple_bssid_index = hostapd_get_bss_index(hapd); -@@ -1820,6 +1827,8 @@ int ieee802_11_build_ap_params(struct ho +@@ -1822,6 +1829,8 @@ int ieee802_11_build_ap_params(struct ho params->ema_beacon = hapd->iconf->ema_beacon; if (hapd != hapd->iface->bss[0]) params->multiple_bssid_parent = hapd->iface->bss[0]->conf->iface; @@ -145,7 +143,7 @@ Index: hostapd-2021-02-20/src/ap/beacon.c params->multiple_bssid_ies = os_zalloc(len); if (params->multiple_bssid_ies == NULL) return -1; -@@ -1829,7 +1838,8 @@ int ieee802_11_build_ap_params(struct ho +@@ -1831,7 +1840,8 @@ int ieee802_11_build_ap_params(struct ho 1, params->multiple_bssid_ie_offsets, ¶ms->multiple_bssid_ie_count, MULTIPLE_BSSID_IE_MAX, @@ -155,11 +153,9 @@ Index: hostapd-2021-02-20/src/ap/beacon.c params->multiple_bssid_ie_len = end - params->multiple_bssid_ies; if ((params->multiple_bssid_ie_count > 1) && (ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08)) -Index: hostapd-2021-02-20/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/ieee802_11.c -+++ hostapd-2021-02-20/src/ap/ieee802_11.c -@@ -7051,13 +7051,15 @@ int hostapd_config_read_maclist(const ch +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -7071,13 +7071,15 @@ int hostapd_config_read_maclist(const ch static int hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, @@ -179,7 +175,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c struct hostapd_data *bss; struct hostapd_bss_config *conf; -@@ -7065,6 +7067,12 @@ static int hostapd_eid_multiple_bssid_ch +@@ -7085,6 +7087,12 @@ static int hostapd_eid_multiple_bssid_ch bss = hapd->iface->bss[i]; conf = bss->conf; @@ -192,7 +188,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c /* * Sublement ID: 1 byte * Length: 1 byte -@@ -7075,7 +7083,7 @@ static int hostapd_eid_multiple_bssid_ch +@@ -7095,7 +7103,7 @@ static int hostapd_eid_multiple_bssid_ch nontx_profile_len = 11; if (!conf->ignore_broadcast_ssid || @@ -201,7 +197,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c nontx_profile_len += conf->ssid.ssid_len; if (is_beacon) -@@ -7105,28 +7113,32 @@ multiple_bssid_too_big: +@@ -7125,28 +7133,32 @@ multiple_bssid_too_big: int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, @@ -243,7 +239,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c u8 non_inherit_ie[3] = {0}; *eid++ = WLAN_EID_MULTIPLE_BSSID; -@@ -7134,11 +7146,17 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7154,11 +7166,17 @@ static u8 * hostapd_eid_multiple_bssid_c num_offset = eid++; for (i = *count; i < hapd->iface->num_bss; i++) { @@ -263,7 +259,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c *eid++ = WLAN_EID_SUBELEMENT_NONTRANSMITTED_BSSID_PROFILE; bss_size_offset = eid++; -@@ -7150,7 +7168,7 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7170,7 +7188,7 @@ static u8 * hostapd_eid_multiple_bssid_c eid += sizeof(capab_info); *eid++ = WLAN_EID_SSID; @@ -272,7 +268,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c *eid++ = conf->ssid.ssid_len; os_memcpy(eid, conf->ssid.ssid, conf->ssid.ssid_len); eid += conf->ssid.ssid_len; -@@ -7226,9 +7244,10 @@ multiple_bssid_too_big: +@@ -7246,9 +7264,10 @@ multiple_bssid_too_big: u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, @@ -285,7 +281,7 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c { int count = 1, dtim_period; u8 remainder, **dtim_offset = NULL; -@@ -7245,9 +7264,11 @@ u8 * hostapd_eid_multiple_bssid(struct h +@@ -7265,9 +7284,11 @@ u8 * hostapd_eid_multiple_bssid(struct h eid_offsets[*eid_count] = eid; *eid_count = *eid_count + 1; } @@ -299,10 +295,8 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.c } if (!eid_count || !(*eid_count)) { -Index: hostapd-2021-02-20/src/ap/ieee802_11.h -=================================================================== ---- hostapd-2021-02-20.orig/src/ap/ieee802_11.h -+++ hostapd-2021-02-20/src/ap/ieee802_11.h +--- a/src/ap/ieee802_11.h ++++ b/src/ap/ieee802_11.h @@ -130,12 +130,13 @@ int hostapd_update_time_adv(struct hosta void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr); u8 * hostapd_eid_bss_max_idle_period(struct hostapd_data *hapd, u8 *eid); @@ -321,10 +315,8 @@ Index: hostapd-2021-02-20/src/ap/ieee802_11.h u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid, bool probe_resp); size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd, bool probe_resp); int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); -Index: hostapd-2021-02-20/src/common/ieee802_11_common.c -=================================================================== ---- hostapd-2021-02-20.orig/src/common/ieee802_11_common.c -+++ hostapd-2021-02-20/src/common/ieee802_11_common.c +--- a/src/common/ieee802_11_common.c ++++ b/src/common/ieee802_11_common.c @@ -307,6 +307,10 @@ static int ieee802_11_parse_extension(co elems->pasn_params = pos; elems->pasn_params_len = elen; @@ -336,10 +328,8 @@ Index: hostapd-2021-02-20/src/common/ieee802_11_common.c default: if (show_errors) { wpa_printf(MSG_MSGDUMP, -Index: hostapd-2021-02-20/src/common/ieee802_11_common.h -=================================================================== ---- hostapd-2021-02-20.orig/src/common/ieee802_11_common.h -+++ hostapd-2021-02-20/src/common/ieee802_11_common.h +--- a/src/common/ieee802_11_common.h ++++ b/src/common/ieee802_11_common.h @@ -118,6 +118,7 @@ struct ieee802_11_elems { const u8 *sae_pk; const u8 *s1g_capab; @@ -356,10 +346,8 @@ Index: hostapd-2021-02-20/src/common/ieee802_11_common.h struct mb_ies_info mb_ies; struct frag_ies_info frag_ies; -Index: hostapd-2021-02-20/src/common/ieee802_11_defs.h -=================================================================== ---- hostapd-2021-02-20.orig/src/common/ieee802_11_defs.h -+++ hostapd-2021-02-20/src/common/ieee802_11_defs.h +--- a/src/common/ieee802_11_defs.h ++++ b/src/common/ieee802_11_defs.h @@ -483,6 +483,7 @@ #define WLAN_EID_EXT_COLOR_CHANGE_ANNOUNCEMENT 42 #define WLAN_EID_EXT_OCV_OCI 54 diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-02-hostapd-Rename-functions-used-for-reduced-neighbor-r.patch b/feeds/wifi-ax/hostapd/patches/h00-003-02-hostapd-Rename-functions-used-for-reduced-neighbor-r.patch index 837269f82..f4dfc8da6 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-003-02-hostapd-Rename-functions-used-for-reduced-neighbor-r.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-003-02-hostapd-Rename-functions-used-for-reduced-neighbor-r.patch @@ -25,7 +25,7 @@ Signed-off-by: Aloka Dixit resp = os_zalloc(buflen); if (resp == NULL) -@@ -656,7 +656,7 @@ static u8 * hostapd_gen_probe_resp(struc +@@ -668,7 +668,7 @@ static u8 * hostapd_gen_probe_resp(struc pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos); pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos); if (hapd->conf->rnr_beacon) @@ -34,7 +34,7 @@ Signed-off-by: Aloka Dixit if (hapd->conf->vendor_elements) { os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements), -@@ -1354,7 +1354,7 @@ static u8 * hostapd_gen_fils_discovery(s +@@ -1368,7 +1368,7 @@ static u8 * hostapd_gen_fils_discovery(s total_len += 3; } @@ -43,7 +43,7 @@ Signed-off-by: Aloka Dixit pos = hostapd_eid_fils_indic(hapd, buf, 0); buf_len = pos - buf; -@@ -1424,7 +1424,7 @@ static u8 * hostapd_gen_fils_discovery(s +@@ -1438,7 +1438,7 @@ static u8 * hostapd_gen_fils_discovery(s /* Fill in the Length field value */ *length_pos = pos - (length_pos + 1); @@ -52,7 +52,7 @@ Signed-off-by: Aloka Dixit /* FILS Indication element */ if (buf_len) { -@@ -1516,7 +1516,7 @@ int ieee802_11_build_ap_params(struct ho +@@ -1530,7 +1530,7 @@ int ieee802_11_build_ap_params(struct ho tail_len += hostapd_eid_owe_trans_len(hapd); tail_len += hostapd_eid_dpp_cc_len(hapd); if (hapd->conf->rnr_beacon) @@ -61,7 +61,7 @@ Signed-off-by: Aloka Dixit tailpos = tail = os_malloc(tail_len); if (head == NULL || tail == NULL) { -@@ -1702,7 +1702,7 @@ int ieee802_11_build_ap_params(struct ho +@@ -1716,7 +1716,7 @@ int ieee802_11_build_ap_params(struct ho tail + tail_len - tailpos); tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); if (hapd->conf->rnr_beacon) @@ -72,7 +72,7 @@ Signed-off-by: Aloka Dixit os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -7279,8 +7279,8 @@ u8 * hostapd_eid_multiple_bssid(struct h +@@ -7323,8 +7323,8 @@ u8 * hostapd_eid_multiple_bssid(struct h } @@ -83,7 +83,7 @@ Signed-off-by: Aloka Dixit { size_t len = 0; int i; -@@ -7294,15 +7294,14 @@ size_t hostapd_eid_reduced_neighbor_repo +@@ -7338,15 +7338,14 @@ size_t hostapd_eid_reduced_neighbor_repo } @@ -101,7 +101,7 @@ Signed-off-by: Aloka Dixit for (i = 0; i < hapd->iface->interfaces->count; i++) { struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; -@@ -7311,8 +7310,7 @@ size_t hostapd_eid_reduced_neighbor_repo +@@ -7355,8 +7354,7 @@ size_t hostapd_eid_reduced_neighbor_repo continue; len += (TBTT_HEADER_LENGTH + @@ -111,7 +111,7 @@ Signed-off-by: Aloka Dixit } if (!probe_resp && !dl_list_empty(&hapd->nr_db)) -@@ -7325,9 +7323,9 @@ size_t hostapd_eid_reduced_neighbor_repo +@@ -7369,9 +7367,9 @@ size_t hostapd_eid_reduced_neighbor_repo } @@ -124,7 +124,7 @@ Signed-off-by: Aloka Dixit { u8 *eid_start = eid, *tbtt_count_pos; u8 tbtt_count = 0; -@@ -7391,7 +7389,8 @@ static u8 *hostapd_eid_reduced_neighbor_ +@@ -7435,7 +7433,8 @@ static u8 *hostapd_eid_reduced_neighbor_ } @@ -134,7 +134,7 @@ Signed-off-by: Aloka Dixit { struct hostapd_neighbor_entry *nr; -@@ -7420,9 +7419,9 @@ static u8 *hostapd_eid_reduced_neighbor_ +@@ -7464,9 +7463,9 @@ static u8 *hostapd_eid_reduced_neighbor_ } @@ -146,7 +146,7 @@ Signed-off-by: Aloka Dixit int i, count = 0; u8 *size_offset; -@@ -7433,8 +7432,7 @@ u8 * hostapd_eid_reduced_neighbor_report +@@ -7477,8 +7476,7 @@ u8 * hostapd_eid_reduced_neighbor_report size_offset = eid++; if (hapd->iface->num_bss > 1) @@ -156,7 +156,7 @@ Signed-off-by: Aloka Dixit for (i = 0; i < hapd->iface->interfaces->count; i++) { struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; -@@ -7442,13 +7440,11 @@ u8 * hostapd_eid_reduced_neighbor_report +@@ -7486,13 +7484,11 @@ u8 * hostapd_eid_reduced_neighbor_report if (iface == hapd->iface || !iface->conf->he_co_locate) continue; diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-03-hostapd-Type-of-frame-instead-of-probe_resp-flag-in-.patch b/feeds/wifi-ax/hostapd/patches/h00-003-03-hostapd-Type-of-frame-instead-of-probe_resp-flag-in-.patch index e7caf8dd6..7a8ffe41c 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-003-03-hostapd-Type-of-frame-instead-of-probe_resp-flag-in-.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-003-03-hostapd-Type-of-frame-instead-of-probe_resp-flag-in-.patch @@ -32,7 +32,7 @@ Signed-off-by: Aloka Dixit resp = os_zalloc(buflen); if (resp == NULL) -@@ -656,7 +656,7 @@ static u8 * hostapd_gen_probe_resp(struc +@@ -668,7 +668,7 @@ static u8 * hostapd_gen_probe_resp(struc pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos); pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos); if (hapd->conf->rnr_beacon) @@ -41,7 +41,7 @@ Signed-off-by: Aloka Dixit if (hapd->conf->vendor_elements) { os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements), -@@ -1354,7 +1354,7 @@ static u8 * hostapd_gen_fils_discovery(s +@@ -1368,7 +1368,7 @@ static u8 * hostapd_gen_fils_discovery(s total_len += 3; } @@ -50,7 +50,7 @@ Signed-off-by: Aloka Dixit pos = hostapd_eid_fils_indic(hapd, buf, 0); buf_len = pos - buf; -@@ -1424,7 +1424,7 @@ static u8 * hostapd_gen_fils_discovery(s +@@ -1438,7 +1438,7 @@ static u8 * hostapd_gen_fils_discovery(s /* Fill in the Length field value */ *length_pos = pos - (length_pos + 1); @@ -59,7 +59,7 @@ Signed-off-by: Aloka Dixit /* FILS Indication element */ if (buf_len) { -@@ -1516,7 +1516,7 @@ int ieee802_11_build_ap_params(struct ho +@@ -1530,7 +1530,7 @@ int ieee802_11_build_ap_params(struct ho tail_len += hostapd_eid_owe_trans_len(hapd); tail_len += hostapd_eid_dpp_cc_len(hapd); if (hapd->conf->rnr_beacon) @@ -68,7 +68,7 @@ Signed-off-by: Aloka Dixit tailpos = tail = os_malloc(tail_len); if (head == NULL || tail == NULL) { -@@ -1702,7 +1702,7 @@ int ieee802_11_build_ap_params(struct ho +@@ -1716,7 +1716,7 @@ int ieee802_11_build_ap_params(struct ho tail + tail_len - tailpos); tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); if (hapd->conf->rnr_beacon) @@ -79,7 +79,7 @@ Signed-off-by: Aloka Dixit os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -7294,7 +7294,7 @@ size_t hostapd_eid_rnr_iface_len(struct +@@ -7338,7 +7338,7 @@ size_t hostapd_eid_rnr_iface_len(struct } @@ -88,7 +88,7 @@ Signed-off-by: Aloka Dixit { size_t len = 0; int i; -@@ -7303,17 +7303,19 @@ size_t hostapd_eid_rnr_len(struct hostap +@@ -7347,17 +7347,19 @@ size_t hostapd_eid_rnr_len(struct hostap len += (TBTT_HEADER_LENGTH + hostapd_eid_rnr_iface_len(hapd, hapd)); @@ -115,7 +115,7 @@ Signed-off-by: Aloka Dixit len += dl_list_len(&hapd->nr_db) * (TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH); if (len) -@@ -7419,9 +7421,9 @@ static u8 *hostapd_eid_neighbor_report_d +@@ -7463,9 +7465,9 @@ static u8 *hostapd_eid_neighbor_report_d } @@ -127,7 +127,7 @@ Signed-off-by: Aloka Dixit int i, count = 0; u8 *size_offset; -@@ -7434,16 +7436,18 @@ u8 * hostapd_eid_rnr(struct hostapd_data +@@ -7478,16 +7480,18 @@ u8 * hostapd_eid_rnr(struct hostapd_data if (hapd->iface->num_bss > 1) eid = hostapd_eid_rnr_iface(hapd, hapd, eid, &count); diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-04-hostapd-Limit-addition-of-co-located-APs-to-6GHz-ban.patch b/feeds/wifi-ax/hostapd/patches/h00-003-04-hostapd-Limit-addition-of-co-located-APs-to-6GHz-ban.patch index ddc323055..1518c8123 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-003-04-hostapd-Limit-addition-of-co-located-APs-to-6GHz-ban.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-003-04-hostapd-Limit-addition-of-co-located-APs-to-6GHz-ban.patch @@ -15,11 +15,9 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11.c | 106 +++++++++++++++++++++++++++++++++----------- 2 files changed, 85 insertions(+), 33 deletions(-) -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index eda20fc0d9df..74ac8584ab5e 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -485,8 +485,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +@@ -485,8 +485,7 @@ static u8 * hostapd_gen_probe_resp(struc buflen += hostapd_eid_multiple_bssid_len(hapd, req_bss, 0, known_bssids, known_bssids_len); @@ -29,7 +27,7 @@ index eda20fc0d9df..74ac8584ab5e 100644 resp = os_zalloc(buflen); if (resp == NULL) -@@ -652,8 +651,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, +@@ -667,8 +666,7 @@ static u8 * hostapd_gen_probe_resp(struc pos = hostapd_eid_mbo(hapd, pos, (u8 *) resp + buflen - pos); pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos); pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos); @@ -39,7 +37,7 @@ index eda20fc0d9df..74ac8584ab5e 100644 if (hapd->conf->vendor_elements) { os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements), -@@ -1532,8 +1530,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1529,8 +1527,7 @@ int ieee802_11_build_ap_params(struct ho tail_len += hostapd_mbo_ie_len(hapd); tail_len += hostapd_eid_owe_trans_len(hapd); tail_len += hostapd_eid_dpp_cc_len(hapd); @@ -49,7 +47,7 @@ index eda20fc0d9df..74ac8584ab5e 100644 tailpos = tail = os_malloc(tail_len); if (head == NULL || tail == NULL) { -@@ -1711,8 +1708,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1715,8 +1712,7 @@ int ieee802_11_build_ap_params(struct ho tailpos = hostapd_eid_owe_trans(hapd, tailpos, tail + tail_len - tailpos); tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos); @@ -59,11 +57,9 @@ index eda20fc0d9df..74ac8584ab5e 100644 if (hapd->conf->vendor_elements) { os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements), -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 97c5b42a7528..488f02f58f63 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5989,6 +5989,7 @@ size_t hostapd_eid_rnr_iface_len(struct hostapd_data *hapd, +@@ -7328,6 +7328,7 @@ size_t hostapd_eid_rnr_iface_len(struct { size_t len = 0; int i; @@ -71,7 +67,7 @@ index 97c5b42a7528..488f02f58f63 100644 for (i = 0; i < hapd->iface->num_bss; i++) { if (hapd->iface->bss[i] == reporting_hapd || hapd->iface->bss[i]->conf->ignore_broadcast_ssid) -@@ -5999,29 +6000,69 @@ size_t hostapd_eid_rnr_iface_len(struct hostapd_data *hapd, +@@ -7338,29 +7339,69 @@ size_t hostapd_eid_rnr_iface_len(struct } @@ -99,7 +95,10 @@ index 97c5b42a7528..488f02f58f63 100644 + return len; +} + -+ + +- if (type != WLAN_FC_STYPE_ACTION) { +- for (i = 0; i < hapd->iface->interfaces->count; i++) { +- struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; +static bool is_6ghz_colocated(struct hostapd_data *hapd) +{ + u8 i; @@ -124,16 +123,13 @@ index 97c5b42a7528..488f02f58f63 100644 + return false; +} -- if (type != WLAN_FC_STYPE_ACTION) { -- for (i = 0; i < hapd->iface->interfaces->count; i++) { -- struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; - - if (iface == hapd->iface || !iface->conf->he_co_locate) - continue; + +size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type) +{ + size_t len = 0; - ++ + if (hapd->conf->rnr_beacon) { + if (hapd->iface->num_bss > 1) len += (TBTT_HEADER_LENGTH + @@ -153,7 +149,7 @@ index 97c5b42a7528..488f02f58f63 100644 if (len) len += 2; /* Element ID and length */ -@@ -6096,6 +6137,27 @@ static u8 *hostapd_eid_rnr_iface(struct hostapd_data *hapd, +@@ -7435,6 +7476,27 @@ static u8 *hostapd_eid_rnr_iface(struct } @@ -181,7 +177,7 @@ index 97c5b42a7528..488f02f58f63 100644 static u8 *hostapd_eid_neighbor_report_db(struct hostapd_data *hapd, u8 *eid, int *count) { -@@ -6138,22 +6200,16 @@ u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type) +@@ -7477,22 +7539,16 @@ u8 * hostapd_eid_rnr(struct hostapd_data *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; size_offset = eid++; @@ -211,6 +207,3 @@ index 97c5b42a7528..488f02f58f63 100644 if (!count) eid -= 2; --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-05-hostapd-Length-checks-for-reduced-neighbor-report.patch b/feeds/wifi-ax/hostapd/patches/h00-003-05-hostapd-Length-checks-for-reduced-neighbor-report.patch index b43d5715b..2574db1e3 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-003-05-hostapd-Length-checks-for-reduced-neighbor-report.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-003-05-hostapd-Length-checks-for-reduced-neighbor-report.patch @@ -16,11 +16,9 @@ Signed-off-by: Aloka Dixit src/common/ieee802_11_defs.h | 2 + 2 files changed, 166 insertions(+), 83 deletions(-) -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 488f02f58f63..953a444a5cd4 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5985,22 +5985,48 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, +@@ -7324,22 +7324,48 @@ u8 * hostapd_eid_multiple_bssid(struct h size_t hostapd_eid_rnr_iface_len(struct hostapd_data *hapd, @@ -32,7 +30,12 @@ index 488f02f58f63..953a444a5cd4 100644 - int i; + size_t total_len = 0; + int i, tbtt_count = 0, start = 0; -+ + +- for (i = 0; i < hapd->iface->num_bss; i++) { +- if (hapd->iface->bss[i] == reporting_hapd || +- hapd->iface->bss[i]->conf->ignore_broadcast_ssid) +- continue; +- len += TBTT_INFO_LENGTH; + while (start < hapd->iface->num_bss) { + if (!(*current_len) || + ((*current_len + TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH) > @@ -40,12 +43,7 @@ index 488f02f58f63..953a444a5cd4 100644 + *current_len = RNR_HEADER_LENGTH; + total_len += RNR_HEADER_LENGTH; + } - -- for (i = 0; i < hapd->iface->num_bss; i++) { -- if (hapd->iface->bss[i] == reporting_hapd || -- hapd->iface->bss[i]->conf->ignore_broadcast_ssid) -- continue; -- len += TBTT_INFO_LENGTH; ++ + *current_len += TBTT_HEADER_LENGTH; + total_len += TBTT_HEADER_LENGTH; + @@ -79,7 +77,7 @@ index 488f02f58f63..953a444a5cd4 100644 { struct hostapd_iface *iface; size_t len = 0; -@@ -6015,8 +6041,35 @@ static size_t hostapd_eid_rnr_colocation_len(struct hostapd_data *hapd) +@@ -7354,8 +7380,35 @@ static size_t hostapd_eid_rnr_colocation if (iface == hapd->iface || !iface->conf->he_co_locate) continue; @@ -117,7 +115,7 @@ index 488f02f58f63..953a444a5cd4 100644 } return len; } -@@ -6049,23 +6102,21 @@ static bool is_6ghz_colocated(struct hostapd_data *hapd) +@@ -7388,23 +7441,21 @@ static bool is_6ghz_colocated(struct hos size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type) { @@ -148,7 +146,7 @@ index 488f02f58f63..953a444a5cd4 100644 return len; } -@@ -6073,72 +6124,95 @@ size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type) +@@ -7412,72 +7463,95 @@ size_t hostapd_eid_rnr_len(struct hostap static u8 *hostapd_eid_rnr_iface(struct hostapd_data *hapd, struct hostapd_data *reporting_hapd, @@ -185,26 +183,11 @@ index 488f02f58f63..953a444a5cd4 100644 - *eid++ = hapd->iconf->channel; - for (i = 0; i < hapd->iface->num_bss; i++) { - u8 bss_param = 0; -+ while (start < iface->num_bss) { -+ if (!(*current_len) || -+ ((*current_len + TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH) > -+ 255)) { -+ eid_start = eid; -+ *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; -+ size_offset = eid++; -+ *current_len = RNR_HEADER_LENGTH; -+ tbtt_count = 0; -+ } - +- - if (hapd->iface->bss[i] == reporting_hapd || - hapd->iface->bss[i]->conf->ignore_broadcast_ssid) - continue; -+ tbtt_count_pos = eid++; -+ *eid++ = TBTT_INFO_LENGTH; -+ *eid++ = op_class; -+ *eid++ = hapd->iconf->channel; -+ *current_len += TBTT_HEADER_LENGTH; - +- - *eid++ = TBTT_AP_OFFSET_UNKNOWN; - os_memcpy(eid, hapd->iface->bss[i]->conf->bssid, ETH_ALEN); - eid += 6; @@ -218,24 +201,35 @@ index 488f02f58f63..953a444a5cd4 100644 - bss_param |= TBTT_BSS_PARAM_MULTIPLE_BSSID; - if (hapd->iface->bss[i] == hostapd_get_primary_bss(hapd->iface->bss[i])) - bss_param |= TBTT_BSS_PARAM_TRANSMITTED_BSSID; -- } ++ while (start < iface->num_bss) { ++ if (!(*current_len) || ++ ((*current_len + TBTT_HEADER_LENGTH + TBTT_INFO_LENGTH) > ++ 255)) { ++ eid_start = eid; ++ *eid++ = WLAN_EID_REDUCED_NEIGHBOR_REPORT; ++ size_offset = eid++; ++ *current_len = RNR_HEADER_LENGTH; ++ tbtt_count = 0; + } - if (hapd->iface->bss[i]->iconf->he_co_locate) - bss_param |= TBTT_BSS_PARAM_CO_LOCATED; -+ for (i = start; i < iface->num_bss; i++) { -+ bss_param = 0; -+ bss = iface->bss[i]; - if (hapd->iface->bss[i]->conf->unsol_bcast_probe_resp_interval) - bss_param |= TBTT_BSS_PARAM_20_TU_PROBE_RESP_ACTIVE; ++ tbtt_count_pos = eid++; ++ *eid++ = TBTT_INFO_LENGTH; ++ *eid++ = op_class; ++ *eid++ = hapd->iconf->channel; ++ *current_len += TBTT_HEADER_LENGTH; ++ ++ for (i = start; i < iface->num_bss; i++) { ++ bss_param = 0; ++ bss = iface->bss[i]; ++ + if (bss == reporting_hapd || + hapd->conf->ignore_broadcast_ssid) + continue; - -- *eid++ = bss_param; -- /* Setting 20 MHz PSD */ -- *eid++ = TBTT_PSD_MAX_TXPOWER - 1; -- *count += 1; -- tbtt_count++; ++ + if ((*current_len + TBTT_INFO_LENGTH > 255) || + (tbtt_count >= TBTT_INFO_COUNT_MAX)) + break; @@ -266,7 +260,12 @@ index 488f02f58f63..953a444a5cd4 100644 + *current_len += TBTT_INFO_LENGTH; + tbtt_count += 1; + } -+ + +- *eid++ = bss_param; +- /* Setting 20 MHz PSD */ +- *eid++ = TBTT_PSD_MAX_TXPOWER - 1; +- *count += 1; +- tbtt_count++; + start = i; + *tbtt_count_pos = TBTT_INFO_COUNT(tbtt_count - 1); + *size_offset = (eid - size_offset) - 1; @@ -286,7 +285,7 @@ index 488f02f58f63..953a444a5cd4 100644 { struct hostapd_iface *iface; int i; -@@ -6152,36 +6226,50 @@ static u8 * hostapd_eid_rnr_colocation(struct hostapd_data *hapd, u8 *eid, +@@ -7491,36 +7565,50 @@ static u8 * hostapd_eid_rnr_colocation(s if (iface == hapd->iface || !iface->conf->he_co_locate) continue; @@ -341,7 +340,7 @@ index 488f02f58f63..953a444a5cd4 100644 } return eid; -@@ -6190,31 +6278,24 @@ static u8 *hostapd_eid_neighbor_report_db(struct hostapd_data *hapd, u8 *eid, +@@ -7529,31 +7617,24 @@ static u8 *hostapd_eid_neighbor_report_d u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type) { @@ -382,12 +381,10 @@ index 488f02f58f63..953a444a5cd4 100644 return eid; } -diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h -index 52e2c868e723..ab7f36f39196 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h -@@ -2420,10 +2420,12 @@ enum mscs_description_subelem { - #define FILS_DISCOVERY_MAX_INTERVAL_6GHZ 20 +@@ -2446,10 +2446,12 @@ enum mscs_description_subelem { + #define FD_MAX_INTERVAL_6GHZ 20 /* TUs */ /* TBTT Information field defines */ +#define RNR_HEADER_LENGTH 2 @@ -399,6 +396,3 @@ index 52e2c868e723..ab7f36f39196 100644 #define TBTT_AP_OFFSET_UNKNOWN 255 #define TBTT_BSS_PARAM_OCT_RECOMMENDED BIT(0) #define TBTT_BSS_PARAM_SAME_SSID BIT(1) --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-06-hostapd-Change-storage-class-of-multiple-BSSID-funct.patch b/feeds/wifi-ax/hostapd/patches/h00-003-06-hostapd-Change-storage-class-of-multiple-BSSID-funct.patch index ccab1f9f5..9058463ec 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-003-06-hostapd-Change-storage-class-of-multiple-BSSID-funct.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-003-06-hostapd-Change-storage-class-of-multiple-BSSID-funct.patch @@ -13,11 +13,9 @@ Signed-off-by: Aloka Dixit src/ap/ieee802_11.h | 6 +++--- 3 files changed, 17 insertions(+), 16 deletions(-) -diff --git a/src/ap/beacon.c b/src/ap/beacon.c -index 74ac8584ab5e..fcc3b7517bcb 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -1815,7 +1815,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, +@@ -1817,7 +1817,7 @@ int ieee802_11_build_ap_params(struct ho } if (hapd->iconf->multiple_bssid) { @@ -26,11 +24,9 @@ index 74ac8584ab5e..fcc3b7517bcb 100644 u8 *end; params->multiple_bssid_index = hostapd_get_bss_index(hapd); -diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c -index 953a444a5cd4..b13f6ee47b8a 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -5753,15 +5753,15 @@ int hostapd_config_read_maclist(const char *fname, +@@ -7070,15 +7070,15 @@ int hostapd_config_read_maclist(const ch } @@ -53,7 +49,7 @@ index 953a444a5cd4..b13f6ee47b8a 100644 u8 mask; struct hostapd_data *bss; struct hostapd_bss_config *conf; -@@ -5810,12 +5810,13 @@ multiple_bssid_too_big: +@@ -7132,12 +7132,13 @@ multiple_bssid_too_big: } @@ -72,11 +68,9 @@ index 953a444a5cd4..b13f6ee47b8a 100644 while (count < hapd->iface->num_bss) len += hostapd_eid_multiple_bssid_chunk_len(hapd, req_bss, -diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h -index 74e426bc99f0..8e70bc3aa84a 100644 --- a/src/ap/ieee802_11.h +++ b/src/ap/ieee802_11.h -@@ -134,9 +134,9 @@ u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, +@@ -134,9 +134,9 @@ u8 * hostapd_eid_multiple_bssid(struct h u8 is_beacon, u8 **eid_offsets, int *eid_count, int eid_max, u8 ema_beacon, const u8 *known_bssids, u8 known_bssids_len); @@ -89,6 +83,3 @@ index 74e426bc99f0..8e70bc3aa84a 100644 u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, u32 type); size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, u32 type); int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta); --- -2.25.0 - diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-07-hostad-RNR-for-EMA-AP.patch b/feeds/wifi-ax/hostapd/patches/h00-003-07-hostad-RNR-for-EMA-AP.patch index 8a615a057..68f4ee69d 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-003-07-hostad-RNR-for-EMA-AP.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-003-07-hostad-RNR-for-EMA-AP.patch @@ -51,7 +51,7 @@ Signed-off-by: Aloka Dixit /* eCSA IE */ csa_pos = hostapd_eid_ecsa(hapd, pos); -@@ -1824,18 +1828,32 @@ int ieee802_11_build_ap_params(struct ho +@@ -1826,18 +1830,32 @@ int ieee802_11_build_ap_params(struct ho if (hapd != hapd->iface->bss[0]) params->multiple_bssid_parent = hapd->iface->bss[0]->conf->iface; @@ -88,7 +88,7 @@ Signed-off-by: Aloka Dixit params->multiple_bssid_ie_len = end - params->multiple_bssid_ies; if ((params->multiple_bssid_ie_count > 1) && (ext_cap_len >= 13) && (ext_cap_pos[12] & 0x08)) -@@ -1857,6 +1875,8 @@ void ieee802_11_free_ap_params(struct wp +@@ -1859,6 +1877,8 @@ void ieee802_11_free_ap_params(struct wp params->proberesp = NULL; os_free(params->multiple_bssid_ies); params->multiple_bssid_ies = NULL; @@ -99,9 +99,9 @@ Signed-off-by: Aloka Dixit params->fd_frame_tmpl = NULL; --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -89,6 +89,26 @@ static void handle_auth(struct hostapd_d - int rssi, int from_queue, - struct hostapd_frame_info *fi); +@@ -97,6 +97,26 @@ static void handle_auth(struct hostapd_d + const struct ieee80211_mgmt *mgmt, size_t len, + int rssi, int from_queue); +enum colocation_mode { + NO_COLOCATED_6GHZ, @@ -126,7 +126,7 @@ Signed-off-by: Aloka Dixit u8 * hostapd_eid_multi_ap(struct hostapd_data *hapd, u8 *eid) { -@@ -161,6 +181,33 @@ u8 * hostapd_eid_supp_rates(struct hosta +@@ -169,6 +189,33 @@ u8 * hostapd_eid_supp_rates(struct hosta } @@ -160,7 +160,7 @@ Signed-off-by: Aloka Dixit u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid) { u8 *pos = eid; -@@ -7052,20 +7099,27 @@ int hostapd_config_read_maclist(const ch +@@ -7072,20 +7119,27 @@ int hostapd_config_read_maclist(const ch static size_t hostapd_eid_multiple_bssid_chunk_len(struct hostapd_data *hapd, struct hostapd_data *req_bss, @@ -191,7 +191,7 @@ Signed-off-by: Aloka Dixit j = i / 8; mask = (u8)1 << (i % 8); -@@ -7086,18 +7140,25 @@ static size_t hostapd_eid_multiple_bssid +@@ -7106,18 +7160,25 @@ static size_t hostapd_eid_multiple_bssid conf->ignore_broadcast_ssid == 2 || bss == req_bss) nontx_profile_len += conf->ssid.ssid_len; @@ -224,7 +224,7 @@ Signed-off-by: Aloka Dixit if (len + nontx_profile_len > 255) { goto multiple_bssid_too_big; -@@ -7113,18 +7174,33 @@ multiple_bssid_too_big: +@@ -7133,18 +7194,33 @@ multiple_bssid_too_big: size_t hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd, @@ -265,7 +265,7 @@ Signed-off-by: Aloka Dixit return len; } -@@ -7132,16 +7208,19 @@ size_t hostapd_eid_multiple_bssid_len(st +@@ -7152,16 +7228,19 @@ size_t hostapd_eid_multiple_bssid_len(st static u8 * hostapd_eid_multiple_bssid_chunk(struct hostapd_data *hapd, struct hostapd_data *req_bss, u8 *eid, u8 *end, int *count, @@ -287,7 +287,7 @@ Signed-off-by: Aloka Dixit *eid++ = WLAN_EID_MULTIPLE_BSSID; size_offset = eid++; num_offset = eid++; -@@ -7149,9 +7228,13 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7169,9 +7248,13 @@ static u8 * hostapd_eid_multiple_bssid_c for (i = *count; i < hapd->iface->num_bss; i++) { u8 *bss_size_offset, *index_size_offset, *pos = eid; u16 capab_info; @@ -302,7 +302,7 @@ Signed-off-by: Aloka Dixit j = i / 8; mask = (u8)1 << (i % 8); -@@ -7184,7 +7267,7 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7204,7 +7287,7 @@ static u8 * hostapd_eid_multiple_bssid_c *eid++ = WLAN_EID_MULTIPLE_BSSID_INDEX; index_size_offset = eid++; *eid++ = i; @@ -311,7 +311,7 @@ Signed-off-by: Aloka Dixit dtim_offset[i] = eid; *eid++ = conf->dtim_period; *eid++ = 0xFF; -@@ -7198,19 +7281,19 @@ static u8 * hostapd_eid_multiple_bssid_c +@@ -7218,19 +7301,19 @@ static u8 * hostapd_eid_multiple_bssid_c /* Add non inheritance ie for capabalities that * are not inherited by non tx vap from tx vap */ @@ -335,7 +335,7 @@ Signed-off-by: Aloka Dixit !hostapd_wpa_ie(bss, WLAN_EID_RSNX)) { non_inherit_ie[ie_count] = WLAN_EID_RSNX; ie_count++; -@@ -7246,30 +7329,62 @@ multiple_bssid_too_big: +@@ -7266,30 +7349,62 @@ multiple_bssid_too_big: u8 * hostapd_eid_multiple_bssid(struct hostapd_data *hapd, struct hostapd_data *req_bss, u8 *eid, u8 *end, @@ -404,7 +404,7 @@ Signed-off-by: Aloka Dixit } if (!eid_count || !(*eid_count)) { -@@ -7283,7 +7398,14 @@ u8 * hostapd_eid_multiple_bssid(struct h +@@ -7303,7 +7418,14 @@ u8 * hostapd_eid_multiple_bssid(struct h break; for (count = 0; count < iface->num_bss; count++) { @@ -420,7 +420,7 @@ Signed-off-by: Aloka Dixit dtim_period = conf->dtim_period; remainder = dtim_period % (*eid_count); if (remainder) { -@@ -7304,9 +7426,10 @@ u8 * hostapd_eid_multiple_bssid(struct h +@@ -7324,9 +7446,10 @@ u8 * hostapd_eid_multiple_bssid(struct h } @@ -433,7 +433,7 @@ Signed-off-by: Aloka Dixit { size_t total_len = 0; int i, tbtt_count = 0, start = 0; -@@ -7323,8 +7446,17 @@ size_t hostapd_eid_rnr_iface_len(struct +@@ -7343,8 +7466,17 @@ size_t hostapd_eid_rnr_iface_len(struct total_len += TBTT_HEADER_LENGTH; for (i = start; i < hapd->iface->num_bss; i++) { @@ -453,7 +453,7 @@ Signed-off-by: Aloka Dixit continue; if ((*current_len + TBTT_INFO_LENGTH > 255) || -@@ -7362,7 +7494,7 @@ static size_t hostapd_eid_rnr_colocation +@@ -7382,7 +7514,7 @@ static size_t hostapd_eid_rnr_colocation continue; len += hostapd_eid_rnr_iface_len(iface->bss[0], hapd, @@ -462,7 +462,7 @@ Signed-off-by: Aloka Dixit } return len; } -@@ -7395,48 +7527,71 @@ static size_t hostapd_eid_neighbor_repor +@@ -7415,48 +7547,71 @@ static size_t hostapd_eid_neighbor_repor } @@ -529,7 +529,9 @@ Signed-off-by: Aloka Dixit ¤t_len); - } + /* fallthrough */ -+ + +- if ((true == is_6ghz_colocated(hapd)) && type != WLAN_FC_STYPE_ACTION) +- len += hostapd_eid_rnr_colocation_len(hapd, ¤t_len); + case WLAN_FC_STYPE_PROBE_RESP: + if (mode == COLOCATED_LOWER_BAND) + len += hostapd_eid_rnr_colocation_len(hapd, @@ -540,9 +542,7 @@ Signed-off-by: Aloka Dixit + len += hostapd_eid_rnr_iface_len(hapd, hapd, + ¤t_len, -1, -1); + break; - -- if ((true == is_6ghz_colocated(hapd)) && type != WLAN_FC_STYPE_ACTION) -- len += hostapd_eid_rnr_colocation_len(hapd, ¤t_len); ++ + case WLAN_FC_STYPE_ACTION: + if (hapd->iface->num_bss > 1 && mode == STANDALONE_6GHZ) + len += hostapd_eid_rnr_iface_len(hapd, hapd, @@ -555,7 +555,7 @@ Signed-off-by: Aloka Dixit return len; } -@@ -7444,7 +7599,8 @@ size_t hostapd_eid_rnr_len(struct hostap +@@ -7464,7 +7619,8 @@ size_t hostapd_eid_rnr_len(struct hostap static u8 *hostapd_eid_rnr_iface(struct hostapd_data *hapd, struct hostapd_data *reporting_hapd, @@ -565,7 +565,7 @@ Signed-off-by: Aloka Dixit { u8 *eid_start = eid, *tbtt_count_pos = NULL; u8 tbtt_count = 0, op_class, channel, bss_param; -@@ -7483,9 +7639,15 @@ static u8 *hostapd_eid_rnr_iface(struct +@@ -7503,9 +7659,15 @@ static u8 *hostapd_eid_rnr_iface(struct for (i = start; i < iface->num_bss; i++) { bss_param = 0; bss = iface->bss[i]; @@ -582,7 +582,7 @@ Signed-off-by: Aloka Dixit continue; if ((*current_len + TBTT_INFO_LENGTH > 255) || -@@ -7547,7 +7709,7 @@ static u8 * hostapd_eid_rnr_colocation(s +@@ -7567,7 +7729,7 @@ static u8 * hostapd_eid_rnr_colocation(s continue; eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid, @@ -591,7 +591,7 @@ Signed-off-by: Aloka Dixit } return eid; } -@@ -7600,19 +7762,38 @@ u8 * hostapd_eid_rnr(struct hostapd_data +@@ -7620,19 +7782,38 @@ u8 * hostapd_eid_rnr(struct hostapd_data { u8 *eid_start = eid; size_t current_len = 0; @@ -666,7 +666,7 @@ Signed-off-by: Aloka Dixit #ifdef CONFIG_SAE --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1232,6 +1232,7 @@ struct wowlan_triggers { +@@ -1230,6 +1230,7 @@ struct wowlan_triggers { }; #define MULTIPLE_BSSID_IE_MAX 8 @@ -674,7 +674,7 @@ Signed-off-by: Aloka Dixit struct wpa_driver_ap_params { /** -@@ -1630,6 +1631,27 @@ struct wpa_driver_ap_params { +@@ -1628,6 +1629,27 @@ struct wpa_driver_ap_params { */ int ema_beacon; @@ -702,7 +702,7 @@ Signed-off-by: Aloka Dixit }; struct wpa_driver_mesh_bss_params { -@@ -2291,6 +2313,7 @@ struct wpa_bss_params { +@@ -2296,6 +2318,7 @@ struct wpa_bss_params { int wpa_key_mgmt; int rsn_preauth; enum mfp_options ieee80211w; 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 234ad21fd..ef2f05f7b 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 @@ -20,7 +20,7 @@ Signed-off-by: Aloka Dixit --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -1888,7 +1888,7 @@ void ieee802_11_free_ap_params(struct wp +@@ -1890,7 +1890,7 @@ void ieee802_11_free_ap_params(struct wp } @@ -29,7 +29,7 @@ Signed-off-by: Aloka Dixit { struct wpa_driver_ap_params params; struct hostapd_freq_params freq; -@@ -1966,12 +1966,47 @@ int ieee802_11_set_beacon(struct hostapd +@@ -1963,12 +1963,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-003-09-hostapd-Netlink-changes-for-RNR-offsets.patch b/feeds/wifi-ax/hostapd/patches/h00-003-09-hostapd-Netlink-changes-for-RNR-offsets.patch index a29ce6a1f..61c0b4a41 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-003-09-hostapd-Netlink-changes-for-RNR-offsets.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-003-09-hostapd-Netlink-changes-for-RNR-offsets.patch @@ -16,11 +16,9 @@ Signed-off-by: Aloka Dixit src/drivers/nl80211_copy.h | 38 ++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) -Index: hostapd-2021-02-18/src/drivers/driver_nl80211.c -=================================================================== ---- hostapd-2021-02-18.orig/src/drivers/driver_nl80211.c -+++ hostapd-2021-02-18/src/drivers/driver_nl80211.c -@@ -4867,6 +4867,37 @@ static int wpa_driver_nl80211_set_ap(voi +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4825,6 +4825,37 @@ static int wpa_driver_nl80211_set_ap(voi nla_nest_end(msg, ies); } @@ -58,11 +56,9 @@ Index: hostapd-2021-02-18/src/drivers/driver_nl80211.c ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, NULL, NULL, NULL, NULL); if (ret) { -Index: hostapd-2021-02-18/src/drivers/nl80211_copy.h -=================================================================== ---- hostapd-2021-02-18.orig/src/drivers/nl80211_copy.h -+++ hostapd-2021-02-18/src/drivers/nl80211_copy.h -@@ -2587,6 +2587,17 @@ enum nl80211_commands { +--- a/src/drivers/nl80211_copy.h ++++ b/src/drivers/nl80211_copy.h +@@ -2597,6 +2597,17 @@ enum nl80211_commands { * * @NL80211_ATTR_MULTIPLE_BSSID_EMA: Shall the multiple BSS beacons be sent out in EMA mode. * @@ -80,7 +76,7 @@ Index: hostapd-2021-02-18/src/drivers/nl80211_copy.h * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -3098,6 +3109,8 @@ enum nl80211_attrs { +@@ -3108,6 +3119,8 @@ enum nl80211_attrs { NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_COLOR, NL80211_ATTR_COLOR_CHANGE_ANNOUNCEMENT_IES, @@ -89,7 +85,7 @@ Index: hostapd-2021-02-18/src/drivers/nl80211_copy.h /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -@@ -7325,4 +7338,27 @@ enum nl80211_sar_specs_attrs { +@@ -7335,4 +7348,27 @@ enum nl80211_sar_specs_attrs { NL80211_SAR_ATTR_SPECS_MAX = __NL80211_SAR_ATTR_SPECS_LAST - 1, }; diff --git a/feeds/wifi-ax/hostapd/patches/h00-003-hostapd-allow-AP_VLAN-creation-for-dynamic-VLAN.patch b/feeds/wifi-ax/hostapd/patches/h00-003-hostapd-allow-AP_VLAN-creation-for-dynamic-VLAN.patch index 293d39e93..186aaf874 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-003-hostapd-allow-AP_VLAN-creation-for-dynamic-VLAN.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-003-hostapd-allow-AP_VLAN-creation-for-dynamic-VLAN.patch @@ -18,7 +18,7 @@ Date: Wed Jan 13 16:51:07 2021 +0530 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c -@@ -1060,8 +1060,7 @@ int ap_sta_bind_vlan(struct hostapd_data +@@ -1097,8 +1097,7 @@ int ap_sta_bind_vlan(struct hostapd_data if (sta->vlan_id == old_vlanid) goto skip_counting; @@ -30,7 +30,7 @@ Date: Wed Jan 13 16:51:07 2021 +0530 "binding station to (vlan_id=%d)", --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c -@@ -437,12 +437,8 @@ static int hostapd_wpa_auth_set_key(void +@@ -444,12 +444,8 @@ static int hostapd_wpa_auth_set_key(void if (vlan_id > 0) { ifname = hostapd_get_vlan_id_ifname(hapd->conf->vlan, vlan_id); @@ -45,7 +45,7 @@ Date: Wed Jan 13 16:51:07 2021 +0530 } #ifdef CONFIG_TESTING_OPTIONS -@@ -917,32 +913,27 @@ static int hostapd_wpa_auth_update_vlan( +@@ -945,32 +941,27 @@ static int hostapd_wpa_auth_update_vlan( #ifndef CONFIG_NO_VLAN struct hostapd_data *hapd = ctx; struct sta_info *sta; 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 5014e8ddc..31879b434 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,8 +1,6 @@ -Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/hostapd/config_file.c -+++ hostapd-2021-02-20-59e9794c/hostapd/config_file.c -@@ -4590,6 +4590,15 @@ static int hostapd_config_fill(struct ho +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -4601,6 +4601,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); @@ -18,23 +16,19 @@ Index: hostapd-2021-02-20-59e9794c/hostapd/config_file.c #ifdef CONFIG_PASN #ifdef CONFIG_TESTING_OPTIONS } else if (os_strcmp(buf, "force_kdk_derivation") == 0) { -Index: hostapd-2021-02-20-59e9794c/src/ap/ap_config.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/ap/ap_config.h -+++ hostapd-2021-02-20-59e9794c/src/ap/ap_config.h -@@ -894,6 +894,7 @@ struct hostapd_bss_config { +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -895,6 +895,7 @@ struct hostapd_bss_config { unsigned int unsol_bcast_probe_resp_interval; u8 rnr_beacon; + int beacon_tx_mode; + char *config_id; }; - /** -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 -@@ -1861,6 +1861,8 @@ int ieee802_11_build_ap_params(struct ho +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c +@@ -1863,6 +1863,8 @@ int ieee802_11_build_ap_params(struct ho params->dtim_period = hapd->conf->dtim_period; } @@ -43,10 +37,8 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c return 0; } -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 +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h @@ -1206,6 +1206,12 @@ struct wpa_driver_associate_params { * Disable HE40MHz coexistence scan */ @@ -82,10 +74,8 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver.h }; struct wpa_driver_set_key_params { -Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/drivers/driver_nl80211.c -+++ hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c @@ -4543,6 +4543,7 @@ static int wpa_driver_nl80211_set_ap(voi wpa_printf(MSG_DEBUG, "nl80211: beacon_rate=%u", params->beacon_rate); wpa_printf(MSG_DEBUG, "nl80211: rate_type=%d", params->rate_type); @@ -105,7 +95,7 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c goto fail; if (params->proberesp && params->proberesp_len) { wpa_hexdump(MSG_DEBUG, "nl80211: proberesp (offload)", -@@ -10663,7 +10666,9 @@ static int nl80211_join_mesh(struct i802 +@@ -10674,7 +10677,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) || @@ -116,10 +106,8 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/driver_nl80211.c goto fail; wpa_printf(MSG_DEBUG, " * flags=%08X", params->flags); -Index: hostapd-2021-02-20-59e9794c/src/drivers/nl80211_copy.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/drivers/nl80211_copy.h -+++ hostapd-2021-02-20-59e9794c/src/drivers/nl80211_copy.h +--- a/src/drivers/nl80211_copy.h ++++ b/src/drivers/nl80211_copy.h @@ -2608,6 +2608,10 @@ enum nl80211_commands { * for co-located APs and neighbor APs in ESS to be added in all * EMA beacons. @@ -154,10 +142,8 @@ Index: hostapd-2021-02-20-59e9794c/src/drivers/nl80211_copy.h + NL80211_BEACON_BURST_MODE = 2, +}; #endif /* __LINUX_NL80211_H */ -Index: hostapd-2021-02-20-59e9794c/hostapd/hostapd.conf -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/hostapd/hostapd.conf -+++ hostapd-2021-02-20-59e9794c/hostapd/hostapd.conf +--- a/hostapd/hostapd.conf ++++ b/hostapd/hostapd.conf @@ -250,6 +250,9 @@ rts_threshold=-1 # it. fragm_threshold=-1 @@ -168,10 +154,8 @@ Index: hostapd-2021-02-20-59e9794c/hostapd/hostapd.conf # Rate configuration # Default is to enable all rates supported by the hardware. This configuration # item allows this list be filtered so that only the listed rates will be left -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/config.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/config.c +--- a/wpa_supplicant/config.c ++++ b/wpa_supplicant/config.c @@ -2740,6 +2740,7 @@ static const struct parse_data ssid_fiel { INT_RANGE(transition_disable, 0, 255) }, { INT_RANGE(sae_pk, 0, 2) }, @@ -188,10 +172,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config.c } -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config_file.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/config_file.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/config_file.c +--- a/wpa_supplicant/config_file.c ++++ b/wpa_supplicant/config_file.c @@ -888,6 +888,7 @@ static void wpa_config_write_network(FIL INT(disable_he); #endif /* CONFIG_HE_OVERRIDES */ @@ -200,10 +182,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config_file.c #undef STR #undef INT #undef INT_DEF -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config_ssid.h -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/config_ssid.h -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/config_ssid.h +--- a/wpa_supplicant/config_ssid.h ++++ b/wpa_supplicant/config_ssid.h @@ -47,6 +47,7 @@ #define DEFAULT_AMPDU_DENSITY -1 /* no change */ #define DEFAULT_USER_SELECTED_SIM 1 @@ -226,10 +206,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/config_ssid.h }; #endif /* CONFIG_SSID_H */ -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/mesh.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh.c +--- a/wpa_supplicant/mesh.c ++++ b/wpa_supplicant/mesh.c @@ -668,6 +668,7 @@ int wpa_supplicant_join_mesh(struct wpa_ params->dtim_period = ssid->dtim_period; else if (wpa_s->conf->dtim_period > 0) @@ -238,10 +216,8 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/mesh.c params->conf.max_peer_links = wpa_s->conf->max_peer_links; if (ssid->mesh_rssi_threshold < DEFAULT_MESH_RSSI_THRESHOLD) { params->conf.rssi_threshold = ssid->mesh_rssi_threshold; -Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_cli.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_cli.c -+++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_cli.c +--- a/wpa_supplicant/wpa_cli.c ++++ b/wpa_supplicant/wpa_cli.c @@ -1489,6 +1489,7 @@ static const char *network_fields[] = { #endif /* CONFIG_HS20 */ "mac_addr", "pbss", "wps_disabled", 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 c38e79127..4f458afa1 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 @@ -14,10 +14,8 @@ Signed-off-by: Muna Sinada src/ap/ieee802_11.c | 15 +++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) -Index: hostapd-2021-02-18/src/ap/ap_config.c -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/ap_config.c -+++ hostapd-2021-02-18/src/ap/ap_config.c +--- a/src/ap/ap_config.c ++++ b/src/ap/ap_config.c @@ -229,6 +229,8 @@ struct hostapd_config * hostapd_config_d conf->fragm_threshold = -2; /* user driver default: 2346 */ /* Set to invalid value means do not add Power Constraint IE */ @@ -27,7 +25,7 @@ Index: hostapd-2021-02-18/src/ap/ap_config.c conf->wmm_ac_params[0] = ac_be; conf->wmm_ac_params[1] = ac_bk; -@@ -1471,7 +1473,7 @@ int hostapd_config_check(struct hostapd_ +@@ -1474,7 +1476,7 @@ int hostapd_config_check(struct hostapd_ return -1; } @@ -36,11 +34,9 @@ Index: hostapd-2021-02-18/src/ap/ap_config.c conf->local_pwr_constraint == -1) { wpa_printf(MSG_ERROR, "Cannot set Spectrum Management bit without Country and Power Constraint elements"); return -1; -Index: hostapd-2021-02-18/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2021-02-18.orig/src/ap/ieee802_11.c -+++ hostapd-2021-02-18/src/ap/ieee802_11.c -@@ -300,15 +300,18 @@ u16 hostapd_own_capab_info(struct hostap +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -343,15 +343,18 @@ u16 hostapd_own_capab_info(struct hostap capab |= WLAN_CAPABILITY_SHORT_SLOT_TIME; /* diff --git a/feeds/wifi-ax/hostapd/patches/h00-008-b-add-support-for-6ghz-tpc.patch b/feeds/wifi-ax/hostapd/patches/h00-008-b-add-support-for-6ghz-tpc.patch index 5937579b5..4539730ab 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-008-b-add-support-for-6ghz-tpc.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-008-b-add-support-for-6ghz-tpc.patch @@ -13,11 +13,9 @@ Signed-off-by: Pradeep Kumar Chitrapu src/common/ieee802_11_defs.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) -diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c -index 18436a6b336b..a78ed01a54b6 100644 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c -@@ -226,7 +226,14 @@ u8 * hostapd_eid_he_operation(struct hostapd_data *hapd, u8 *eid) +@@ -227,7 +227,14 @@ u8 * hostapd_eid_he_operation(struct hos /* 6 GHz Operation Information field */ *pos++ = hapd->iconf->channel; /* Primary Channel */ @@ -33,11 +31,9 @@ index 18436a6b336b..a78ed01a54b6 100644 if (seg1) *pos++ = 3; else -diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h -index be37c9323ae2..3c065ab27f51 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h -@@ -2188,6 +2188,7 @@ struct ieee80211_he_6ghz_oper_info { +@@ -2204,6 +2204,7 @@ struct ieee80211_he_6ghz_oper_info { #define HE_6GHZ_OPER_INFO_CTRL_CHAN_WIDTH_MASK (BIT(0) | BIT(1)) #define HE_6GHZ_OPER_INFO_CTRL_DUP_BEACON BIT(2) @@ -45,6 +41,3 @@ index be37c9323ae2..3c065ab27f51 100644 /* IEEE P802.11ax/D6.0, 9.4.2.261 HE 6 GHz Band Capabilities element */ struct ieee80211_he_6ghz_band_cap { --- -2.17.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 440a5321f..bc5111495 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 @@ -16,11 +16,9 @@ Signed-off-by: Pradeep Kumar Chitrapu src/ap/ap_config.h | 12 ++++++++++++ 3 files changed, 21 insertions(+) -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index d9c21a5780ba..e3be84c2ac63 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3502,6 +3502,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, +@@ -3535,6 +3535,8 @@ static int hostapd_config_fill(struct ho line, pos); return 1; } @@ -29,11 +27,9 @@ index d9c21a5780ba..e3be84c2ac63 100644 } else if (os_strcmp(buf, "he_oper_chwidth") == 0) { conf->he_oper_chwidth = atoi(pos); } else if (os_strcmp(buf, "he_oper_centr_freq_seg0_idx") == 0) { -diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf -index 976582312513..7b9f11a16f80 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf -@@ -579,6 +579,13 @@ wmm_ac_vo_acm=0 +@@ -583,6 +583,13 @@ wmm_ac_vo_acm=0 # Enable co-locate for a 6GHz radio #co_locate=0 @@ -47,21 +43,19 @@ index 976582312513..7b9f11a16f80 100644 ##### IEEE 802.11n related configuration ###################################### # ieee80211n: Whether IEEE 802.11n (HT) is enabled -diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 70cee055bbe6..6e5406f59887 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -1049,6 +1049,9 @@ struct hostapd_config { - u8 he_oper_centr_freq_seg0_idx; - u8 he_oper_centr_freq_seg1_idx; +@@ -1081,6 +1081,9 @@ struct hostapd_config { + u8 he_6ghz_rx_ant_pat; + u8 he_6ghz_tx_ant_pat; bool he_co_locate; +#define AP_TYPE_6GHZ_INDOOR_AP 0 +#define AP_TYPE_6GHZ_STANDARD_POWER_AP 1 + u8 he_6ghz_reg_pwr_type; #endif /* CONFIG_IEEE80211AX */ - #ifdef CONFIG_IEEE80211AX -@@ -1079,6 +1082,15 @@ struct hostapd_config { + /* VHT enable/disable config from CHAN_SWITCH */ +@@ -1110,6 +1113,15 @@ struct hostapd_config { #endif /* CONFIG_AIRTIME_POLICY */ }; @@ -77,6 +71,3 @@ index 70cee055bbe6..6e5406f59887 100644 static inline u8 hostapd_get_oper_chwidth(struct hostapd_config *conf) { --- -2.17.1 - diff --git a/feeds/wifi-ax/hostapd/patches/h00-008-d-add-support-for-6ghz-tpc.patch b/feeds/wifi-ax/hostapd/patches/h00-008-d-add-support-for-6ghz-tpc.patch index 5287cc440..3166e1902 100644 --- a/feeds/wifi-ax/hostapd/patches/h00-008-d-add-support-for-6ghz-tpc.patch +++ b/feeds/wifi-ax/hostapd/patches/h00-008-d-add-support-for-6ghz-tpc.patch @@ -20,7 +20,7 @@ Signed-off-by: Pradeep Kumar Chitrapu --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -498,9 +498,14 @@ static u8 * hostapd_gen_probe_resp(struc +@@ -503,9 +503,14 @@ static u8 * hostapd_gen_probe_resp(struc 3 + sizeof(struct ieee80211_he_operation) + 3 + sizeof(struct ieee80211_he_mu_edca_parameter_set) + 3 + sizeof(struct ieee80211_spatial_reuse); @@ -36,7 +36,7 @@ Signed-off-by: Pradeep Kumar Chitrapu } #endif /* CONFIG_IEEE80211AX */ -@@ -1388,6 +1393,15 @@ static u8 * hostapd_gen_fils_discovery(s +@@ -1407,6 +1412,15 @@ static u8 * hostapd_gen_fils_discovery(s buf_len = pos - buf; total_len += buf_len; @@ -52,7 +52,7 @@ Signed-off-by: Pradeep Kumar Chitrapu head = os_zalloc(total_len); if (!head) return NULL; -@@ -1460,6 +1474,9 @@ static u8 * hostapd_gen_fils_discovery(s +@@ -1479,6 +1493,9 @@ static u8 * hostapd_gen_fils_discovery(s pos += buf_len; } @@ -62,7 +62,7 @@ Signed-off-by: Pradeep Kumar Chitrapu *len = pos - (u8 *) head; wpa_hexdump(MSG_DEBUG, "FILS Discovery frame template", (u8 *) head, pos - (u8 *) head); -@@ -1534,9 +1551,14 @@ int ieee802_11_build_ap_params(struct ho +@@ -1553,9 +1570,14 @@ int ieee802_11_build_ap_params(struct ho 3 + sizeof(struct ieee80211_he_operation) + 3 + sizeof(struct ieee80211_he_mu_edca_parameter_set) + 3 + sizeof(struct ieee80211_spatial_reuse); @@ -80,7 +80,7 @@ Signed-off-by: Pradeep Kumar Chitrapu --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h -@@ -1938,8 +1938,40 @@ struct tpc_report { +@@ -1940,8 +1940,40 @@ struct tpc_report { u8 link_margin; } STRUCT_PACKED; @@ -123,7 +123,7 @@ Signed-off-by: Pradeep Kumar Chitrapu u8 dialog_token; --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -6817,6 +6817,30 @@ void ieee802_11_rx_from_unknown(struct h +@@ -6872,6 +6872,30 @@ void ieee802_11_rx_from_unknown(struct h WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); } @@ -154,7 +154,7 @@ Signed-off-by: Pradeep Kumar Chitrapu u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid) { -@@ -6826,8 +6850,8 @@ u8 * hostapd_eid_txpower_envelope(struct +@@ -6881,8 +6905,8 @@ u8 * hostapd_eid_txpower_envelope(struct struct hostapd_channel_data *chan; int dfs, i; u8 channel, tx_pwr_count, local_pwr_constraint; @@ -164,7 +164,7 @@ Signed-off-by: Pradeep Kumar Chitrapu if (!mode) return eid; -@@ -6842,6 +6866,41 @@ u8 * hostapd_eid_txpower_envelope(struct +@@ -6897,6 +6921,41 @@ u8 * hostapd_eid_txpower_envelope(struct if (i == mode->num_channels) return eid; @@ -206,7 +206,7 @@ Signed-off-by: Pradeep Kumar Chitrapu switch (hostapd_get_oper_chwidth(iconf)) { case CHANWIDTH_USE_HT: if (iconf->secondary_channel == 0) { -@@ -6914,17 +6973,9 @@ u8 * hostapd_eid_txpower_envelope(struct +@@ -6969,17 +7028,9 @@ u8 * hostapd_eid_txpower_envelope(struct else tx_pwr = max_tx_power; 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 38c981604..b8d2b6de0 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 -@@ -1070,6 +1070,7 @@ struct hostapd_config { +@@ -1083,6 +1083,7 @@ struct hostapd_config { bool he_co_locate; #define AP_TYPE_6GHZ_INDOOR_AP 0 #define AP_TYPE_6GHZ_STANDARD_POWER_AP 1 @@ -32,7 +32,7 @@ Signed-off-by: Lavanya Suresh --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -6817,6 +6817,47 @@ void ieee802_11_rx_from_unknown(struct h +@@ -6872,6 +6872,47 @@ void ieee802_11_rx_from_unknown(struct h WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA); } @@ -80,7 +80,7 @@ Signed-off-by: Lavanya Suresh static u8 * hostapd_add_tpe_info(u8 *eid, u8 tx_pwr_count, u8 tx_pwr_intrpn, u8 tx_pwr_cat, u8 tx_pwr) -@@ -6888,14 +6929,14 @@ u8 * hostapd_eid_txpower_envelope(struct +@@ -6943,14 +6984,14 @@ u8 * hostapd_eid_txpower_envelope(struct if (ap_type == AP_TYPE_6GHZ_INDOOR_AP) { tx_pwr_cat = REG_SUBORDINATE_CLIENT; /* TODO: extract psd limits from channel data */ @@ -99,7 +99,7 @@ Signed-off-by: Lavanya Suresh return eid; --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h -@@ -1965,9 +1965,15 @@ enum reg_6g_client_type { +@@ -1967,9 +1967,15 @@ enum reg_6g_client_type { * These tx-power macros are present till the 6G regdomains are defined to * support tx-power values for various client types. */ 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 c90b56a17..67c86345c 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 -@@ -5170,7 +5170,7 @@ static int wpa_driver_nl80211_sta_add(vo +@@ -5171,7 +5171,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 35f2a44c8..60cd7c62f 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 @@ -1,7 +1,5 @@ -Index: hostapd-2021-02-20-59e9794c/src/common/hw_features_common.c -=================================================================== ---- hostapd-2021-02-20-59e9794c.orig/src/common/hw_features_common.c -+++ hostapd-2021-02-20-59e9794c/src/common/hw_features_common.c +--- a/src/common/hw_features_common.c ++++ b/src/common/hw_features_common.c @@ -114,7 +114,7 @@ int allowed_ht40_channel_pair(enum hosta { int ok, first; @@ -11,10 +9,8 @@ Index: hostapd-2021-02-20-59e9794c/src/common/hw_features_common.c size_t k; int ht40_plus, pri_chan, sec_chan; -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 +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c @@ -2507,8 +2507,8 @@ void ibss_mesh_setup_freq(struct wpa_sup enum hostapd_hw_mode hw_mode; struct hostapd_hw_modes *mode = NULL; 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 2731032d1..209ad266a 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 @@ -9,11 +9,9 @@ Signed-off-by: Hari Chandrakanthan hostapd/hostapd_cli.c | 10 +-- 2 files changed, 185 insertions(+), 60 deletions(-) -diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c -index bbe49aa..ea1a156 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -3215,75 +3215,202 @@ set: +@@ -3283,75 +3283,202 @@ set: return ret; } @@ -109,13 +107,13 @@ index bbe49aa..ea1a156 100644 - if (!ok && chan->chan != (allowed[k - 1] + 4)) - ok = -1; -- -- if (ok == 1 && (mode->channels[j + 1].flag & -- HOSTAPD_CHAN_DISABLED)) -- ok = -1; + if (ok == 0) + return false; +- if (ok == 1 && (mode->channels[j + 1].flag & +- HOSTAPD_CHAN_DISABLED)) +- ok = -1; +- - if (ok != -1) { - ret = os_snprintf(buf + len, buflen - len, - "Channel: %d : %d HT40%s\n", @@ -264,7 +262,7 @@ index bbe49aa..ea1a156 100644 { struct hostapd_data *hapd = iface->bss[0]; struct hostapd_hw_modes *mode; -@@ -3295,11 +3422,12 @@ static int hostapd_ctrl_iface_ht40_allow_map(struct hostapd_iface *iface, +@@ -3363,11 +3490,12 @@ static int hostapd_ctrl_iface_ht40_allow &dfs_domain); if (mode->mode != HOSTAPD_MODE_IEEE80211A) @@ -279,7 +277,7 @@ index bbe49aa..ea1a156 100644 } static int hostapd_ctrl_iface_remove_neighbor(struct hostapd_data *hapd, -@@ -3912,10 +4040,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, +@@ -3982,10 +4110,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 */ @@ -293,11 +291,9 @@ index bbe49aa..ea1a156 100644 } else if (os_strncmp(buf, "GET_CAPABILITY ", 15) == 0) { reply_len = hostapd_ctrl_iface_get_capability( hapd, buf + 15, reply, reply_size); -diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c -index 6ee8d96..14317f5 100644 --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c -@@ -1384,13 +1384,11 @@ static int hostapd_cli_cmd_driver_flags(struct wpa_ctrl *ctrl, int argc, +@@ -1382,13 +1382,11 @@ static int hostapd_cli_cmd_driver_flags( return wpa_ctrl_command(ctrl, "DRIVER_FLAGS"); } @@ -313,7 +309,7 @@ index 6ee8d96..14317f5 100644 #ifdef CONFIG_DPP static int hostapd_cli_cmd_dpp_qr_code(struct wpa_ctrl *ctrl, int argc, -@@ -1753,8 +1751,8 @@ static const struct hostapd_cli_cmd hostapd_cli_commands[] = { +@@ -1749,8 +1747,8 @@ static const struct hostapd_cli_cmd host "=Add/Delete/Show/Clear deny MAC ACL" }, { "poll_sta", hostapd_cli_cmd_poll_sta, hostapd_complete_stations, " = poll a STA to check connectivity with a QoS null frame" }, @@ -324,6 +320,3 @@ index 6ee8d96..14317f5 100644 { "req_beacon", hostapd_cli_cmd_req_beacon, NULL, " [req_mode=] = send a Beacon report request to a station" }, { "reload_wpa_psk", hostapd_cli_cmd_reload_wpa_psk, NULL, --- -2.7.4 - 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 91fcbccc3..915f4a49d 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 @@ -17,11 +17,9 @@ Signed-off-by: leiwei wpa_supplicant/wpas_kay.c | 4 ++-- 9 files changed, 43 insertions(+), 10 deletions(-) -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 08a5bcd..39ea156 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -4530,6 +4530,16 @@ static int hostapd_config_fill(struct hostapd_config *conf, +@@ -4561,6 +4561,16 @@ static int hostapd_config_fill(struct ho return 1; } bss->mka_priority = mka_priority; @@ -38,11 +36,9 @@ index 08a5bcd..39ea156 100644 } else if (os_strcmp(buf, "mka_cak") == 0) { size_t len = os_strlen(pos); -diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 05f3c7d..ad37222 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -850,6 +850,13 @@ struct hostapd_bss_config { +@@ -859,6 +859,13 @@ struct hostapd_bss_config { int mka_priority; /** @@ -56,11 +52,9 @@ index 05f3c7d..ad37222 100644 * mka_ckn - MKA pre-shared CKN */ #define MACSEC_CKN_MAX_LEN 32 -diff --git a/src/ap/wpa_auth_kay.c b/src/ap/wpa_auth_kay.c -index 46d94b4..d5341e2 100644 --- a/src/ap/wpa_auth_kay.c +++ b/src/ap/wpa_auth_kay.c -@@ -329,7 +329,8 @@ int ieee802_1x_alloc_kay_sm_hapd(struct hostapd_data *hapd, +@@ -329,7 +329,8 @@ int ieee802_1x_alloc_kay_sm_hapd(struct hapd->conf->macsec_replay_protect, hapd->conf->macsec_replay_window, hapd->conf->macsec_port, @@ -70,8 +64,6 @@ index 46d94b4..d5341e2 100644 hapd->own_addr); /* ieee802_1x_kay_init() frees kay_ctx on failure */ if (!res) -diff --git a/src/pae/ieee802_1x_cp.c b/src/pae/ieee802_1x_cp.c -index cf41d8d..f0527fd 100644 --- a/src/pae/ieee802_1x_cp.c +++ b/src/pae/ieee802_1x_cp.c @@ -20,7 +20,7 @@ @@ -83,7 +75,7 @@ index cf41d8d..f0527fd 100644 /* The variable defined in clause 12 in IEEE Std 802.1X-2010 */ enum connect_type { PENDING, UNAUTHENTICATED, AUTHENTICATED, SECURE }; -@@ -473,8 +473,8 @@ struct ieee802_1x_cp_sm * ieee802_1x_cp_sm_init(struct ieee802_1x_kay *kay) +@@ -473,8 +473,8 @@ struct ieee802_1x_cp_sm * ieee802_1x_cp_ sm->orx = false; sm->otx = false; @@ -94,11 +86,9 @@ index cf41d8d..f0527fd 100644 sm->cipher_offset = CONFIDENTIALITY_OFFSET_0; sm->confidentiality_offset = sm->cipher_offset; sm->transmit_delay = MKA_LIFE_TIME; -diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c -index ad5a34b..04a7e93 100644 --- a/src/pae/ieee802_1x_kay.c +++ b/src/pae/ieee802_1x_kay.c -@@ -222,7 +222,14 @@ ieee802_1x_mka_dump_dist_sak_body(struct ieee802_1x_mka_dist_sak_body *body) +@@ -222,7 +222,14 @@ ieee802_1x_mka_dump_dist_sak_body(struct wpa_printf(MSG_DEBUG, "\tKey Number............: %d", be_to_host32(body->kn)); /* TODO: Other than GCM-AES-128 case: MACsec Cipher Suite */ @@ -114,7 +104,7 @@ index ad5a34b..04a7e93 100644 } -@@ -3458,7 +3465,7 @@ static void kay_l2_receive(void *ctx, const u8 *src_addr, const u8 *buf, +@@ -3456,7 +3463,7 @@ static void kay_l2_receive(void *ctx, co struct ieee802_1x_kay * ieee802_1x_kay_init(struct ieee802_1x_kay_ctx *ctx, enum macsec_policy policy, bool macsec_replay_protect, u32 macsec_replay_window, @@ -123,7 +113,7 @@ index ad5a34b..04a7e93 100644 { struct ieee802_1x_kay *kay; -@@ -3495,7 +3502,7 @@ ieee802_1x_kay_init(struct ieee802_1x_kay_ctx *ctx, enum macsec_policy policy, +@@ -3493,7 +3500,7 @@ ieee802_1x_kay_init(struct ieee802_1x_ka kay->dist_time = 0; kay->pn_exhaustion = PENDING_PN_EXHAUSTION; @@ -132,11 +122,9 @@ index ad5a34b..04a7e93 100644 kay->mka_algindex = DEFAULT_MKA_ALG_INDEX; kay->mka_version = MKA_VERSION_ID; -diff --git a/src/pae/ieee802_1x_kay.h b/src/pae/ieee802_1x_kay.h -index 1d3c2ac..a3cf964 100644 --- a/src/pae/ieee802_1x_kay.h +++ b/src/pae/ieee802_1x_kay.h -@@ -240,7 +240,7 @@ u64 mka_sci_u64(struct ieee802_1x_mka_sci *sci); +@@ -240,7 +240,7 @@ u64 mka_sci_u64(struct ieee802_1x_mka_sc struct ieee802_1x_kay * ieee802_1x_kay_init(struct ieee802_1x_kay_ctx *ctx, enum macsec_policy policy, bool macsec_replay_protect, u32 macsec_replay_window, @@ -145,11 +133,9 @@ index 1d3c2ac..a3cf964 100644 void ieee802_1x_kay_deinit(struct ieee802_1x_kay *kay); struct ieee802_1x_mka_participant * -diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c -index 7e7d9bb..f723b70 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -2777,6 +2777,7 @@ static const struct parse_data ssid_fields[] = { +@@ -2712,6 +2712,7 @@ static const struct parse_data ssid_fiel { INT(macsec_replay_window) }, { INT_RANGE(macsec_port, 1, 65534) }, { INT_RANGE(mka_priority, 0, 255) }, @@ -157,11 +143,9 @@ index 7e7d9bb..f723b70 100644 { FUNC_KEY(mka_cak) }, { FUNC_KEY(mka_ckn) }, #endif /* CONFIG_MACSEC */ -diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h -index b655e39..747e4d0 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h -@@ -915,6 +915,13 @@ struct wpa_ssid { +@@ -920,6 +920,13 @@ struct wpa_ssid { int mka_priority; /** @@ -175,11 +159,9 @@ index b655e39..747e4d0 100644 * mka_ckn - MKA pre-shared CKN */ #define MACSEC_CKN_MAX_LEN 32 -diff --git a/wpa_supplicant/wpas_kay.c b/wpa_supplicant/wpas_kay.c -index defd0f2..4d1ce02 100644 --- a/wpa_supplicant/wpas_kay.c +++ b/wpa_supplicant/wpas_kay.c -@@ -241,8 +241,8 @@ int ieee802_1x_alloc_kay_sm(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) +@@ -241,8 +241,8 @@ int ieee802_1x_alloc_kay_sm(struct wpa_s res = ieee802_1x_kay_init(kay_ctx, policy, ssid->macsec_replay_protect, ssid->macsec_replay_window, ssid->macsec_port, @@ -190,6 +172,3 @@ index defd0f2..4d1ce02 100644 /* ieee802_1x_kay_init() frees kay_ctx on failure */ if (res == NULL) return -1; --- -2.7.4 - 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 09518d95a..e6a5a10fa 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 @@ -16,11 +16,9 @@ Signed-off-by: Anilkumar Kolli hostapd/ctrl_iface.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c -index ea1a1567278c..664711d5bd87 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2528,6 +2528,16 @@ static int hostapd_ctrl_get_pmk(struct hostapd_data *hapd, const char *cmd, +@@ -2591,6 +2591,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) { @@ -37,6 +35,3 @@ index ea1a1567278c..664711d5bd87 100644 switch (params->bandwidth) { case 0: /* bandwidth not specified: use 20 MHz by default */ --- -2.7.4 - 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 2fbdebd3d..6fffc91cc 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 @@ -14,11 +14,9 @@ Signed-off-by: Karthikeyan Kathirvel src/drivers/driver_nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index cbf41c6..a0dd827 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4979,7 +4979,7 @@ static int nl80211_put_freq_params(struct nl_msg *msg, +@@ -4980,7 +4980,7 @@ static int nl80211_put_freq_params(struc nla_put_u32(msg, NL80211_ATTR_CENTER_FREQ2, freq->center_freq2))) return -ENOBUFS; @@ -27,6 +25,3 @@ index cbf41c6..a0dd827 100644 enum nl80211_channel_type ct; wpa_printf(MSG_DEBUG, " * sec_channel_offset=%d", --- -2.7.4 - 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 da048baab..f90496f52 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 -@@ -3349,6 +3349,8 @@ static int hostapd_config_fill(struct ho +@@ -3378,6 +3378,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 -@@ -1030,6 +1030,7 @@ struct hostapd_config { +@@ -1042,6 +1042,7 @@ struct hostapd_config { /* Use driver-generated interface addresses when adding multiple BSSs */ u8 use_driver_iface_addr; @@ -39,7 +39,7 @@ Signed-off-by: Seevalamuthu Mariappan struct fst_iface_cfg fst_cfg; --- a/src/ap/dfs.c +++ b/src/ap/dfs.c -@@ -199,6 +199,24 @@ static int is_in_chanlist(struct hostapd +@@ -200,6 +200,24 @@ static int is_in_chanlist(struct hostapd return freq_range_list_includes(&iface->conf->acs_ch_list, chan->chan); } @@ -64,7 +64,7 @@ Signed-off-by: Seevalamuthu Mariappan /* * The function assumes HT40+ operation. -@@ -247,6 +265,13 @@ static int dfs_find_channel(struct hosta +@@ -248,6 +266,13 @@ static int dfs_find_channel(struct hosta chan->freq, chan->chan); continue; } 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 75dd7ddb0..7d6ea78e1 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 -@@ -2858,7 +2858,8 @@ static int hostapd_config_fill(struct ho +@@ -2865,7 +2865,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. -@@ -1245,6 +1245,7 @@ static int hostapd_config_check_bss(stru +@@ -1246,6 +1246,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."); -@@ -1254,6 +1255,7 @@ static int hostapd_config_check_bss(stru +@@ -1255,6 +1256,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 && @@ -105,7 +105,7 @@ Signed-off-by: Jouni Malinen int group_cipher; /* wpa_group value override from configuation */ --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -2348,9 +2348,8 @@ static int ieee802_11_allowed_address(st +@@ -2357,9 +2357,8 @@ static int ieee802_11_allowed_address(st } diff --git a/feeds/wifi-ax/hostapd/patches/n00-002-RADIUS-Attributes-with-Extended-Types-RFC-6929.patch b/feeds/wifi-ax/hostapd/patches/n00-002-RADIUS-Attributes-with-Extended-Types-RFC-6929.patch index eef911717..cdb798e4d 100644 --- a/feeds/wifi-ax/hostapd/patches/n00-002-RADIUS-Attributes-with-Extended-Types-RFC-6929.patch +++ b/feeds/wifi-ax/hostapd/patches/n00-002-RADIUS-Attributes-with-Extended-Types-RFC-6929.patch @@ -12,8 +12,6 @@ Signed-off-by: Jouni Malinen src/radius/radius.h | 26 +++++- 2 files changed, 193 insertions(+), 28 deletions(-) -diff --git a/src/radius/radius.c b/src/radius/radius.c -index be16e27b9..a64228067 100644 --- a/src/radius/radius.c +++ b/src/radius/radius.c @@ -1,6 +1,6 @@ @@ -24,7 +22,7 @@ index be16e27b9..a64228067 100644 * * This software may be distributed under the terms of the BSD license. * See README for more details. -@@ -159,7 +159,8 @@ static const char *radius_code_string(u8 code) +@@ -159,7 +159,8 @@ static const char *radius_code_string(u8 struct radius_attr_type { @@ -34,7 +32,7 @@ index be16e27b9..a64228067 100644 char *name; enum { RADIUS_ATTR_UNDIST, RADIUS_ATTR_TEXT, RADIUS_ATTR_IP, -@@ -260,11 +261,31 @@ static const struct radius_attr_type radius_attrs[] = +@@ -260,11 +261,31 @@ static const struct radius_attr_type rad RADIUS_ATTR_HEXDUMP }, { RADIUS_ATTR_WLAN_GROUP_MGMT_CIPHER, "WLAN-Group-Mgmt-Pairwise-Cipher", RADIUS_ATTR_HEXDUMP }, @@ -67,7 +65,7 @@ index be16e27b9..a64228067 100644 { size_t i; -@@ -277,23 +298,60 @@ static const struct radius_attr_type *radius_get_attr_type(u8 type) +@@ -277,23 +298,60 @@ static const struct radius_attr_type *ra } @@ -135,7 +133,7 @@ index be16e27b9..a64228067 100644 switch (attr->data_type) { case RADIUS_ATTR_TEXT: -@@ -627,22 +685,54 @@ static int radius_msg_add_attr_to_array(struct radius_msg *msg, +@@ -627,23 +685,55 @@ static int radius_msg_add_attr_to_array( } @@ -157,7 +155,6 @@ index be16e27b9..a64228067 100644 - if (data_len > RADIUS_MAX_ATTR_LEN) { - wpa_printf(MSG_ERROR, "radius_msg_add_attr: too long attribute (%lu bytes)", - (unsigned long) data_len); -- return NULL; + if (type > 255) { + if (!radius_is_ext_type(type >> 8)) { + wpa_printf(MSG_ERROR, @@ -170,9 +167,8 @@ index be16e27b9..a64228067 100644 + } else if (radius_is_ext_type(type)) { + wpa_printf(MSG_ERROR, "%s: Unexpected extended type use for %d", + __func__, type); - } - -- buf_needed = sizeof(*attr) + data_len; ++ } ++ + if (radius_is_long_ext_type(type)) { + size_t hdr_len = sizeof(struct radius_attr_hdr_ext) + 1; + size_t plen = 255 - hdr_len; @@ -194,12 +190,15 @@ index be16e27b9..a64228067 100644 + wpa_printf(MSG_ERROR, + "%s: too long attribute (%zu > %zu bytes)", + __func__, data_len, max_len); -+ return NULL; -+ } + return NULL; + } +- buf_needed = sizeof(*attr) + data_len; +- if (wpabuf_tailroom(msg->buf) < buf_needed) { /* allocate more space for message buffer */ -@@ -651,13 +741,44 @@ struct radius_attr_hdr *radius_msg_add_attr(struct radius_msg *msg, u8 type, + if (wpabuf_resize(&msg->buf, buf_needed) < 0) +@@ -651,13 +741,44 @@ struct radius_attr_hdr *radius_msg_add_a msg->hdr = wpabuf_mhead(msg->buf); } @@ -251,7 +250,7 @@ index be16e27b9..a64228067 100644 return attr; } -@@ -1285,6 +1406,28 @@ int radius_msg_add_wfa(struct radius_msg *msg, u8 subtype, const u8 *data, +@@ -1314,6 +1435,28 @@ int radius_msg_add_wfa(struct radius_msg } @@ -280,8 +279,6 @@ index be16e27b9..a64228067 100644 int radius_user_password_hide(struct radius_msg *msg, const u8 *data, size_t data_len, const u8 *secret, size_t secret_len, -diff --git a/src/radius/radius.h b/src/radius/radius.h -index fb8148180..490c8d1f6 100644 --- a/src/radius/radius.h +++ b/src/radius/radius.h @@ -1,6 +1,6 @@ @@ -327,7 +324,7 @@ index fb8148180..490c8d1f6 100644 }; -@@ -257,7 +277,7 @@ int radius_msg_verify_acct_req(struct radius_msg *msg, const u8 *secret, +@@ -261,7 +281,7 @@ int radius_msg_verify_acct_req(struct ra int radius_msg_verify_das_req(struct radius_msg *msg, const u8 *secret, size_t secret_len, int require_message_authenticator); @@ -336,7 +333,7 @@ index fb8148180..490c8d1f6 100644 const u8 *data, size_t data_len); struct radius_msg * radius_msg_parse(const u8 *data, size_t len); int radius_msg_add_eap(struct radius_msg *msg, const u8 *data, -@@ -284,6 +304,8 @@ int radius_msg_add_mppe_keys(struct radius_msg *msg, +@@ -289,6 +309,8 @@ int radius_msg_add_mppe_keys(struct radi const u8 *recv_key, size_t recv_key_len); int radius_msg_add_wfa(struct radius_msg *msg, u8 subtype, const u8 *data, size_t len); @@ -345,6 +342,3 @@ index fb8148180..490c8d1f6 100644 int radius_user_password_hide(struct radius_msg *msg, const u8 *data, size_t data_len, const u8 *secret, size_t secret_len, --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/patches/n00-003-RADIUS-attributes-for-EAPOL-Key-message-details.patch b/feeds/wifi-ax/hostapd/patches/n00-003-RADIUS-attributes-for-EAPOL-Key-message-details.patch index df8baa785..3ca5df297 100644 --- a/feeds/wifi-ax/hostapd/patches/n00-003-RADIUS-attributes-for-EAPOL-Key-message-details.patch +++ b/feeds/wifi-ax/hostapd/patches/n00-003-RADIUS-attributes-for-EAPOL-Key-message-details.patch @@ -18,8 +18,6 @@ Signed-off-by: Jouni Malinen src/radius/radius.h | 7 +++++++ 2 files changed, 36 insertions(+) -diff --git a/src/ap/ieee802_11_auth.c b/src/ap/ieee802_11_auth.c -index a54d7616e..4277d82cb 100644 --- a/src/ap/ieee802_11_auth.c +++ b/src/ap/ieee802_11_auth.c @@ -47,6 +47,9 @@ struct hostapd_acl_query_data { @@ -32,8 +30,8 @@ index a54d7616e..4277d82cb 100644 }; -@@ -102,6 +105,8 @@ static void hostapd_acl_query_free(struct hostapd_acl_query_data *query) - if (!query) +@@ -102,6 +105,8 @@ static void hostapd_acl_query_free(struc + if (query == NULL) return; os_free(query->auth_msg); + os_free(query->anonce); @@ -41,7 +39,7 @@ index a54d7616e..4277d82cb 100644 os_free(query); } -@@ -164,6 +169,24 @@ static int hostapd_radius_acl_query(struct hostapd_data *hapd, const u8 *addr, +@@ -164,6 +169,24 @@ static int hostapd_radius_acl_query(stru goto fail; } @@ -66,7 +64,7 @@ index a54d7616e..4277d82cb 100644 if (radius_client_send(hapd->radius, msg, RADIUS_AUTH, addr) < 0) goto fail; return 0; -@@ -703,6 +726,12 @@ void hostapd_acl_req_radius_psk(struct hostapd_data *hapd, const u8 *addr, +@@ -709,6 +732,12 @@ void hostapd_acl_req_radius_psk(struct h query->akm = key_mgmt; os_get_reltime(&query->timestamp); os_memcpy(query->addr, addr, ETH_ALEN); @@ -79,11 +77,9 @@ index a54d7616e..4277d82cb 100644 if (hostapd_radius_acl_query(hapd, addr, query)) { wpa_printf(MSG_DEBUG, "Failed to send Access-Request for RADIUS PSK/ACL query"); -diff --git a/src/radius/radius.h b/src/radius/radius.h -index 490c8d1f6..177c64a66 100644 --- a/src/radius/radius.h +++ b/src/radius/radius.h -@@ -208,6 +208,13 @@ enum { RADIUS_VENDOR_ATTR_MS_MPPE_SEND_KEY = 16, +@@ -208,6 +208,13 @@ enum { RADIUS_VENDOR_ATTR_MS_MPPE_SEND_K RADIUS_VENDOR_ATTR_MS_MPPE_RECV_KEY = 17 }; @@ -97,6 +93,3 @@ index 490c8d1f6..177c64a66 100644 /* Hotspot 2.0 - WFA Vendor-specific RADIUS Attributes */ #define RADIUS_VENDOR_ID_WFA 40808 --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/patches/x-0001-asn.1-validate-DigestAlgorithmIdentifier.patch b/feeds/wifi-ax/hostapd/patches/x-0001-asn.1-validate-DigestAlgorithmIdentifier.patch index b7381bbcd..eb6ab1b24 100644 --- a/feeds/wifi-ax/hostapd/patches/x-0001-asn.1-validate-DigestAlgorithmIdentifier.patch +++ b/feeds/wifi-ax/hostapd/patches/x-0001-asn.1-validate-DigestAlgorithmIdentifier.patch @@ -19,11 +19,9 @@ Signed-off-by: Jouni Malinen src/tls/x509v3.c | 20 ++++++++++++++++++++ 2 files changed, 41 insertions(+) -diff --git a/src/tls/pkcs1.c b/src/tls/pkcs1.c -index bbdb0d72d..5761dfed0 100644 --- a/src/tls/pkcs1.c +++ b/src/tls/pkcs1.c -@@ -244,6 +244,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk, +@@ -244,6 +244,8 @@ int pkcs1_v15_sig_ver(struct crypto_publ os_free(decrypted); return -1; } @@ -32,7 +30,7 @@ index bbdb0d72d..5761dfed0 100644 pos = hdr.payload; end = pos + hdr.length; -@@ -265,6 +267,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk, +@@ -265,6 +267,8 @@ int pkcs1_v15_sig_ver(struct crypto_publ os_free(decrypted); return -1; } @@ -41,7 +39,7 @@ index bbdb0d72d..5761dfed0 100644 da_end = hdr.payload + hdr.length; if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) { -@@ -273,6 +277,23 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk, +@@ -273,6 +277,23 @@ int pkcs1_v15_sig_ver(struct crypto_publ os_free(decrypted); return -1; } @@ -65,11 +63,9 @@ index bbdb0d72d..5761dfed0 100644 if (!asn1_oid_equal(&oid, hash_alg)) { char txt[100], txt2[100]; -diff --git a/src/tls/x509v3.c b/src/tls/x509v3.c -index a8944dd2f..df337ec4d 100644 --- a/src/tls/x509v3.c +++ b/src/tls/x509v3.c -@@ -1964,6 +1964,7 @@ int x509_check_signature(struct x509_certificate *issuer, +@@ -1964,6 +1964,7 @@ int x509_check_signature(struct x509_cer os_free(data); return -1; } @@ -77,7 +73,7 @@ index a8944dd2f..df337ec4d 100644 pos = hdr.payload; end = pos + hdr.length; -@@ -1985,6 +1986,8 @@ int x509_check_signature(struct x509_certificate *issuer, +@@ -1985,6 +1986,8 @@ int x509_check_signature(struct x509_cer os_free(data); return -1; } @@ -86,7 +82,7 @@ index a8944dd2f..df337ec4d 100644 da_end = hdr.payload + hdr.length; if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) { -@@ -1992,6 +1995,23 @@ int x509_check_signature(struct x509_certificate *issuer, +@@ -1992,6 +1995,23 @@ int x509_check_signature(struct x509_cer os_free(data); return -1; } @@ -110,6 +106,3 @@ index a8944dd2f..df337ec4d 100644 if (x509_sha1_oid(&oid)) { if (signature->oid.oid[6] != 5 /* sha-1WithRSAEncryption */) { --- -cgit v1.2.3-18-g5258 - diff --git a/feeds/wifi-ax/hostapd/patches/x-0002-dragonfly-Add-sqrt-helper-function.patch b/feeds/wifi-ax/hostapd/patches/x-0002-dragonfly-Add-sqrt-helper-function.patch index 6c8509b8c..b8b1e078b 100644 --- a/feeds/wifi-ax/hostapd/patches/x-0002-dragonfly-Add-sqrt-helper-function.patch +++ b/feeds/wifi-ax/hostapd/patches/x-0002-dragonfly-Add-sqrt-helper-function.patch @@ -13,11 +13,9 @@ Signed-off-by: Jouni Malinen src/common/dragonfly.h | 2 ++ 2 files changed, 36 insertions(+) -diff --git a/src/common/dragonfly.c b/src/common/dragonfly.c -index 547be66f1561..1e842716668e 100644 --- a/src/common/dragonfly.c +++ b/src/common/dragonfly.c -@@ -213,3 +213,37 @@ int dragonfly_generate_scalar(const struct crypto_bignum *order, +@@ -213,3 +213,37 @@ int dragonfly_generate_scalar(const stru "dragonfly: Unable to get randomness for own scalar"); return -1; } @@ -55,11 +53,9 @@ index 547be66f1561..1e842716668e 100644 + crypto_bignum_deinit(one, 0); + return ret; +} -diff --git a/src/common/dragonfly.h b/src/common/dragonfly.h -index ec3dd593eda4..84d67f575c54 100644 --- a/src/common/dragonfly.h +++ b/src/common/dragonfly.h -@@ -27,5 +27,7 @@ int dragonfly_generate_scalar(const struct crypto_bignum *order, +@@ -27,5 +27,7 @@ int dragonfly_generate_scalar(const stru struct crypto_bignum *_rand, struct crypto_bignum *_mask, struct crypto_bignum *scalar); @@ -67,6 +63,3 @@ index ec3dd593eda4..84d67f575c54 100644 + struct crypto_bignum *res); #endif /* DRAGONFLY_H */ --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/patches/x-0003-SAE-Derive-the-y-coordinate-for-PWE-with-own-impleme.patch b/feeds/wifi-ax/hostapd/patches/x-0003-SAE-Derive-the-y-coordinate-for-PWE-with-own-impleme.patch index f2a9cb3a9..aaddf665f 100644 --- a/feeds/wifi-ax/hostapd/patches/x-0003-SAE-Derive-the-y-coordinate-for-PWE-with-own-impleme.patch +++ b/feeds/wifi-ax/hostapd/patches/x-0003-SAE-Derive-the-y-coordinate-for-PWE-with-own-impleme.patch @@ -16,11 +16,9 @@ Signed-off-by: Jouni Malinen src/common/sae.c | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) -diff --git a/src/common/sae.c b/src/common/sae.c -index 08fdbfd18173..8d79ed962768 100644 --- a/src/common/sae.c +++ b/src/common/sae.c -@@ -286,14 +286,16 @@ static int sae_derive_pwe_ecc(struct sae_data *sae, const u8 *addr1, +@@ -291,14 +291,16 @@ static int sae_derive_pwe_ecc(struct sae int pwd_seed_odd = 0; u8 prime[SAE_MAX_ECC_PRIME_LEN]; size_t prime_len; @@ -38,7 +36,7 @@ index 08fdbfd18173..8d79ed962768 100644 os_memset(x_bin, 0, sizeof(x_bin)); -@@ -402,25 +404,42 @@ static int sae_derive_pwe_ecc(struct sae_data *sae, const u8 *addr1, +@@ -407,25 +409,42 @@ static int sae_derive_pwe_ecc(struct sae goto fail; } @@ -94,6 +92,3 @@ index 08fdbfd18173..8d79ed962768 100644 os_free(dummy_password); bin_clear_free(tmp_password, password_len); crypto_bignum_deinit(x, 1); --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/patches/x-0004-EAP-pwd-Derive-the-y-coordinate-for-PWE-with-own-imp.patch b/feeds/wifi-ax/hostapd/patches/x-0004-EAP-pwd-Derive-the-y-coordinate-for-PWE-with-own-imp.patch index 71d22b086..c5ddddcec 100644 --- a/feeds/wifi-ax/hostapd/patches/x-0004-EAP-pwd-Derive-the-y-coordinate-for-PWE-with-own-imp.patch +++ b/feeds/wifi-ax/hostapd/patches/x-0004-EAP-pwd-Derive-the-y-coordinate-for-PWE-with-own-imp.patch @@ -16,11 +16,9 @@ Signed-off-by: Jouni Malinen src/eap_common/eap_pwd_common.c | 46 ++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 10 deletions(-) -diff --git a/src/eap_common/eap_pwd_common.c b/src/eap_common/eap_pwd_common.c -index 2b2b8efdbd01..ff22b29b087a 100644 --- a/src/eap_common/eap_pwd_common.c +++ b/src/eap_common/eap_pwd_common.c -@@ -127,7 +127,8 @@ int compute_password_element(EAP_PWD_group *grp, u16 num, +@@ -127,7 +127,8 @@ int compute_password_element(EAP_PWD_gro u8 qr_or_qnr_bin[MAX_ECC_PRIME_LEN]; u8 x_bin[MAX_ECC_PRIME_LEN]; u8 prime_bin[MAX_ECC_PRIME_LEN]; @@ -30,7 +28,7 @@ index 2b2b8efdbd01..ff22b29b087a 100644 struct crypto_hash *hash; unsigned char pwe_digest[SHA256_MAC_LEN], *prfbuf = NULL, ctr; int ret = 0, res; -@@ -139,6 +140,7 @@ int compute_password_element(EAP_PWD_group *grp, u16 num, +@@ -139,6 +140,7 @@ int compute_password_element(EAP_PWD_gro u8 found_ctr = 0, is_odd = 0; int cmp_prime; unsigned int in_range; @@ -38,7 +36,7 @@ index 2b2b8efdbd01..ff22b29b087a 100644 if (grp->pwe) return -1; -@@ -151,11 +153,6 @@ int compute_password_element(EAP_PWD_group *grp, u16 num, +@@ -151,11 +153,6 @@ int compute_password_element(EAP_PWD_gro if (crypto_bignum_to_bin(prime, prime_bin, sizeof(prime_bin), primebytelen) < 0) return -1; @@ -50,7 +48,7 @@ index 2b2b8efdbd01..ff22b29b087a 100644 if ((prfbuf = os_malloc(primebytelen)) == NULL) { wpa_printf(MSG_INFO, "EAP-pwd: unable to malloc space for prf " -@@ -261,10 +258,37 @@ int compute_password_element(EAP_PWD_group *grp, u16 num, +@@ -261,10 +258,37 @@ int compute_password_element(EAP_PWD_gro */ crypto_bignum_deinit(x_candidate, 1); x_candidate = crypto_bignum_init_set(x_bin, primebytelen); @@ -92,7 +90,7 @@ index 2b2b8efdbd01..ff22b29b087a 100644 goto fail; } -@@ -289,6 +313,7 @@ int compute_password_element(EAP_PWD_group *grp, u16 num, +@@ -289,6 +313,7 @@ int compute_password_element(EAP_PWD_gro /* cleanliness and order.... */ crypto_bignum_deinit(x_candidate, 1); crypto_bignum_deinit(tmp2, 1); @@ -100,7 +98,7 @@ index 2b2b8efdbd01..ff22b29b087a 100644 crypto_bignum_deinit(qr, 1); crypto_bignum_deinit(qnr, 1); bin_clear_free(prfbuf, primebytelen); -@@ -296,6 +321,7 @@ int compute_password_element(EAP_PWD_group *grp, u16 num, +@@ -296,6 +321,7 @@ int compute_password_element(EAP_PWD_gro os_memset(qnr_bin, 0, sizeof(qnr_bin)); os_memset(qr_or_qnr_bin, 0, sizeof(qr_or_qnr_bin)); os_memset(pwe_digest, 0, sizeof(pwe_digest)); @@ -108,6 +106,3 @@ index 2b2b8efdbd01..ff22b29b087a 100644 return ret; } --- -2.25.1 - diff --git a/feeds/wifi-ax/hostapd/src/src/ap/ubus.c b/feeds/wifi-ax/hostapd/src/src/ap/ubus.c index 145ff5442..07c85ac19 100644 --- a/feeds/wifi-ax/hostapd/src/src/ap/ubus.c +++ b/feeds/wifi-ax/hostapd/src/src/ap/ubus.c @@ -29,11 +29,6 @@ static struct ubus_context *ctx; static struct blob_buf b; static int ctx_ref; -static inline struct hapd_interfaces *get_hapd_interfaces_from_object(struct ubus_object *obj) -{ - return container_of(obj, struct hapd_interfaces, ubus); -} - static inline struct hostapd_data *get_hapd_from_object(struct ubus_object *obj) { return container_of(obj, struct hostapd_data, ubus.obj); @@ -44,12 +39,6 @@ struct ubus_banned_client { u8 addr[ETH_ALEN]; }; -static void ubus_receive(int sock, void *eloop_ctx, void *sock_ctx) -{ - struct ubus_context *ctx = eloop_ctx; - ubus_handle_event(ctx); -} - static void ubus_reconnect_timeout(void *eloop_data, void *user_ctx) { if (ubus_reconnect(ctx, NULL)) { @@ -57,12 +46,12 @@ static void ubus_reconnect_timeout(void *eloop_data, void *user_ctx) return; } - eloop_register_read_sock(ctx->sock.fd, ubus_receive, ctx, NULL); + ubus_add_uloop(ctx); } static void hostapd_ubus_connection_lost(struct ubus_context *ctx) { - eloop_unregister_read_sock(ctx->sock.fd); + uloop_fd_delete(&ctx->sock); eloop_register_timeout(1, 0, ubus_reconnect_timeout, ctx, NULL); } @@ -71,12 +60,14 @@ static bool hostapd_ubus_init(void) if (ctx) return true; + eloop_add_uloop(); ctx = ubus_connect(NULL); if (!ctx) return false; ctx->connection_lost = hostapd_ubus_connection_lost; - eloop_register_read_sock(ctx->sock.fd, ubus_receive, ctx, NULL); + ubus_add_uloop(ctx); + return true; } @@ -94,7 +85,7 @@ static void hostapd_ubus_ref_dec(void) if (ctx_ref) return; - eloop_unregister_read_sock(ctx->sock.fd); + uloop_fd_delete(&ctx->sock); ubus_free(ctx); ctx = NULL; } @@ -127,38 +118,6 @@ static void hostapd_notify_ubus(struct ubus_object *obj, char *bssname, char *ev free(event_type); } -static void hostapd_send_procd_event(char *bssname, char *event) -{ - char *name, *s; - uint32_t id; - void *v; - - if (!ctx || ubus_lookup_id(ctx, "service", &id)) - return; - - if (asprintf(&name, "hostapd.%s.%s", bssname, event) < 0) - return; - - blob_buf_init(&b, 0); - - s = blobmsg_alloc_string_buffer(&b, "type", strlen(name) + 1); - sprintf(s, "%s", name); - blobmsg_add_string_buffer(&b); - - v = blobmsg_open_table(&b, "data"); - blobmsg_close_table(&b, v); - - ubus_invoke(ctx, id, "event", b.head, NULL, NULL, 1000); - - free(name); -} - -static void hostapd_send_shared_event(struct ubus_object *obj, char *bssname, char *event) -{ - hostapd_send_procd_event(bssname, event); - hostapd_notify_ubus(obj, bssname, event); -} - static void hostapd_bss_del_ban(void *eloop_data, void *user_ctx) { @@ -203,10 +162,8 @@ hostapd_bss_reload(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *msg) { struct hostapd_data *hapd = container_of(obj, struct hostapd_data, ubus.obj); - int ret = hostapd_reload_config(hapd->iface, 1); - hostapd_send_shared_event(&hapd->iface->interfaces->ubus, hapd->conf->iface, "reload"); - return ret; + return hostapd_reload_config(hapd->iface, 1); } @@ -693,68 +650,6 @@ enum { __CONFIG_MAX }; -static const struct blobmsg_policy config_add_policy[__CONFIG_MAX] = { - [CONFIG_IFACE] = { "iface", BLOBMSG_TYPE_STRING }, - [CONFIG_FILE] = { "config", BLOBMSG_TYPE_STRING }, -}; - -static int -hostapd_config_add(struct ubus_context *ctx, struct ubus_object *obj, - struct ubus_request_data *req, const char *method, - struct blob_attr *msg) -{ - struct blob_attr *tb[__CONFIG_MAX]; - struct hapd_interfaces *interfaces = get_hapd_interfaces_from_object(obj); - char buf[128]; - - blobmsg_parse(config_add_policy, __CONFIG_MAX, tb, blob_data(msg), blob_len(msg)); - - if (!tb[CONFIG_FILE] || !tb[CONFIG_IFACE]) - return UBUS_STATUS_INVALID_ARGUMENT; - - snprintf(buf, sizeof(buf), "bss_config=%s:%s", - blobmsg_get_string(tb[CONFIG_IFACE]), - blobmsg_get_string(tb[CONFIG_FILE])); - - if (hostapd_add_iface(interfaces, buf)) - return UBUS_STATUS_INVALID_ARGUMENT; - - blob_buf_init(&b, 0); - blobmsg_add_u32(&b, "pid", getpid()); - ubus_send_reply(ctx, req, b.head); - - return UBUS_STATUS_OK; -} - -enum { - CONFIG_REM_IFACE, - __CONFIG_REM_MAX -}; - -static const struct blobmsg_policy config_remove_policy[__CONFIG_REM_MAX] = { - [CONFIG_REM_IFACE] = { "iface", BLOBMSG_TYPE_STRING }, -}; - -static int -hostapd_config_remove(struct ubus_context *ctx, struct ubus_object *obj, - struct ubus_request_data *req, const char *method, - struct blob_attr *msg) -{ - struct blob_attr *tb[__CONFIG_REM_MAX]; - struct hapd_interfaces *interfaces = get_hapd_interfaces_from_object(obj); - char buf[128]; - - blobmsg_parse(config_remove_policy, __CONFIG_REM_MAX, tb, blob_data(msg), blob_len(msg)); - - if (!tb[CONFIG_REM_IFACE]) - return UBUS_STATUS_INVALID_ARGUMENT; - - if (hostapd_remove_iface(interfaces, blobmsg_get_string(tb[CONFIG_REM_IFACE]))) - return UBUS_STATUS_INVALID_ARGUMENT; - - return UBUS_STATUS_OK; -} - enum { CSA_FREQ, CSA_BCN_COUNT, @@ -1622,8 +1517,6 @@ void hostapd_ubus_add_bss(struct hostapd_data *hapd) obj->n_methods = bss_object_type.n_methods; ret = ubus_add_object(ctx, obj); hostapd_ubus_ref_inc(); - - hostapd_send_shared_event(&hapd->iface->interfaces->ubus, hapd->conf->iface, "add"); } void hostapd_ubus_free_bss(struct hostapd_data *hapd) @@ -1639,8 +1532,6 @@ void hostapd_ubus_free_bss(struct hostapd_data *hapd) if (!ctx) return; - hostapd_send_shared_event(&hapd->iface->interfaces->ubus, hapd->conf->iface, "remove"); - if (obj->id) { ubus_remove_object(ctx, obj); hostapd_ubus_ref_dec(); @@ -1686,47 +1577,6 @@ void hostapd_ubus_remove_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vl hostapd_ubus_vlan_action(hapd, vlan, "vlan_remove"); } -static const struct ubus_method daemon_methods[] = { - UBUS_METHOD("config_add", hostapd_config_add, config_add_policy), - UBUS_METHOD("config_remove", hostapd_config_remove, config_remove_policy), -}; - -static struct ubus_object_type daemon_object_type = - UBUS_OBJECT_TYPE("hostapd", daemon_methods); - -void hostapd_ubus_add(struct hapd_interfaces *interfaces) -{ - struct ubus_object *obj = &interfaces->ubus; - int ret; - - if (!hostapd_ubus_init()) - return; - - obj->name = strdup("hostapd"); - - obj->type = &daemon_object_type; - obj->methods = daemon_object_type.methods; - obj->n_methods = daemon_object_type.n_methods; - ret = ubus_add_object(ctx, obj); - hostapd_ubus_ref_inc(); -} - -void hostapd_ubus_free(struct hapd_interfaces *interfaces) -{ - struct ubus_object *obj = &interfaces->ubus; - char *name = (char *) obj->name; - - if (!ctx) - return; - - if (obj->id) { - ubus_remove_object(ctx, obj); - hostapd_ubus_ref_dec(); - } - - free(name); -} - struct ubus_event_req { struct ubus_notify_request nreq; int resp; diff --git a/feeds/wifi-ax/hostapd/src/src/ap/ucode.c b/feeds/wifi-ax/hostapd/src/src/ap/ucode.c new file mode 100644 index 000000000..4dcb4363a --- /dev/null +++ b/feeds/wifi-ax/hostapd/src/src/ap/ucode.c @@ -0,0 +1,386 @@ +#include + +#include "utils/includes.h" +#include "utils/common.h" +#include "utils/ucode.h" +#include "hostapd.h" +#include + +static uc_resource_type_t *global_type, *bss_type, *iface_type; +static struct hapd_interfaces *interfaces; +static uc_value_t *global, *bss_registry, *iface_registry; +static uc_vm_t *vm; + +static uc_value_t * +hostapd_ucode_bss_get_uval(struct hostapd_data *hapd) +{ + uc_value_t *val; + + if (hapd->ucode.idx) + 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); + + return val; +} + +static uc_value_t * +hostapd_ucode_iface_get_uval(struct hostapd_iface *hapd) +{ + uc_value_t *val; + + if (hapd->ucode.idx) + 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); + + return val; +} + +static void +hostapd_ucode_update_bss_list(struct hostapd_iface *iface) +{ + uc_value_t *ifval, *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)); + } + + ifval = hostapd_ucode_iface_get_uval(iface); + ucv_object_add(ucv_prototype_get(ifval), "bss", ucv_get(list)); +} + +static void +hostapd_ucode_update_interfaces(void) +{ + uc_value_t *ifs = 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); + } + + ucv_object_add(ucv_prototype_get(global), "interfaces", ucv_get(ifs)); + ucv_gc(vm); +} + +static uc_value_t * +uc_hostapd_add_iface(uc_vm_t *vm, size_t nargs) +{ + uc_value_t *iface = uc_fn_arg(0); + int ret; + + if (ucv_type(iface) != UC_STRING) + return ucv_int64_new(-1); + + ret = hostapd_add_iface(interfaces, ucv_string_get(iface)); + hostapd_ucode_update_interfaces(); + + return ucv_int64_new(ret); +} + +static uc_value_t * +uc_hostapd_remove_iface(uc_vm_t *vm, size_t nargs) +{ + uc_value_t *iface = uc_fn_arg(0); + + if (ucv_type(iface) != UC_STRING) + return NULL; + + hostapd_remove_iface(interfaces, ucv_string_get(iface)); + hostapd_ucode_update_interfaces(); + + return NULL; +} + +static uc_value_t * +uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs) +{ + struct hostapd_data *hapd = uc_fn_thisval("hostapd.bss"); + struct hostapd_iface *iface; + struct hostapd_config *conf; + uc_value_t *file = uc_fn_arg(0); + uc_value_t *index = uc_fn_arg(1); + unsigned int i, idx = 0; + int ret = -1; + + if (!hapd || ucv_type(file) != UC_STRING) + goto out; + + if (ucv_type(index) == UC_INTEGER) + idx = ucv_int64_get(index); + + iface = hapd->iface; + conf = interfaces->config_read_cb(ucv_string_get(file)); + if (!conf || idx > conf->num_bss || !conf->bss[idx]) + goto out; + + hostapd_config_free_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; + hostapd_config_free(conf); + + hostapd_reload_bss(hapd); + ret = 0; + +out: + return ucv_int64_new(ret); +} + +static void +hostapd_remove_iface_bss_conf(struct hostapd_config *iconf, + struct hostapd_bss_config *conf) +{ + int i; + + for (i = 0; i < iconf->num_bss; i++) + if (iconf->bss[i] == conf) + break; + + if (i == iconf->num_bss) + return; + + for (i++; i < iconf->num_bss; i++) + iconf->bss[i - 1] = iconf->bss[i]; + iconf->num_bss--; +} + + +static uc_value_t * +uc_hostapd_bss_delete(uc_vm_t *vm, size_t nargs) +{ + struct hostapd_data *hapd = uc_fn_thisval("hostapd.bss"); + struct hostapd_iface *iface; + int i, idx; + + if (!hapd || hapd == hapd->iface->bss[0]) + return NULL; + + iface = hapd->iface; + for (idx = 0; idx < iface->num_bss; idx++) + if (iface->bss[idx] == hapd) + break; + + if (idx == iface->num_bss) + return NULL; + + for (i = idx + 1; i < iface->num_bss; i++) + iface->bss[i - 1] = iface->bss[i]; + iface->num_bss--; + + hostapd_bss_deinit(hapd); + hostapd_remove_iface_bss_conf(iface->conf, hapd->conf); + hostapd_config_free_bss(hapd->conf); + os_free(hapd); + + hostapd_ucode_update_bss_list(iface); + ucv_gc(vm); + + return NULL; +} + +static uc_value_t * +uc_hostapd_iface_add_bss(uc_vm_t *vm, size_t nargs) +{ + struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface"); + struct hostapd_bss_config *bss; + struct hostapd_config *conf; + struct hostapd_data *hapd; + uc_value_t *file = uc_fn_arg(0); + uc_value_t *index = uc_fn_arg(1); + unsigned int idx = 0; + uc_value_t *ret = NULL; + + if (!iface || ucv_type(file) != UC_STRING) + goto out; + + if (ucv_type(index) == UC_INTEGER) + idx = ucv_int64_get(index); + + conf = interfaces->config_read_cb(ucv_string_get(file)); + if (!conf || idx > conf->num_bss || !conf->bss[idx]) + goto out; + + bss = conf->bss[idx]; + hapd = hostapd_alloc_bss_data(iface, iface->conf, bss); + if (!hapd) + goto out; + + hapd->driver = iface->bss[0]->driver; + hapd->drv_priv = iface->bss[0]->drv_priv; + if (interfaces->ctrl_iface_init && + interfaces->ctrl_iface_init(hapd) < 0) + goto free_hapd; + + if (iface->state == HAPD_IFACE_ENABLED && + hostapd_setup_bss(hapd, -1, true)) + goto deinit_ctrl; + + iface->bss = os_realloc_array(iface->bss, iface->num_bss + 1, + sizeof(*iface->bss)); + iface->bss[iface->num_bss++] = hapd; + + iface->conf->bss = os_realloc_array(iface->conf->bss, + iface->conf->num_bss + 1, + sizeof(*iface->conf->bss)); + 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); + goto out; + +deinit_ctrl: + if (interfaces->ctrl_iface_deinit) + interfaces->ctrl_iface_deinit(hapd); +free_hapd: + hostapd_free_hapd_data(hapd); + os_free(hapd); +out: + hostapd_config_free(conf); + return ret; +} + +static uc_value_t * +uc_hostapd_bss_ctrl(uc_vm_t *vm, size_t nargs) +{ + struct hostapd_data *hapd = uc_fn_thisval("hostapd.bss"); + uc_value_t *arg = uc_fn_arg(0); + struct sockaddr_storage from = {}; + static char reply[4096]; + int reply_len; + + if (!hapd || !interfaces->ctrl_iface_recv || + ucv_type(arg) != UC_STRING) + return NULL; + + reply_len = interfaces->ctrl_iface_recv(hapd, ucv_string_get(arg), + reply, sizeof(reply), + &from, sizeof(from)); + if (reply_len < 0) + return NULL; + + if (reply_len && reply[reply_len - 1] == '\n') + reply_len--; + + return ucv_string_new_length(reply, reply_len); +} + +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 }, + { "add_iface", uc_hostapd_add_iface }, + { "remove_iface", uc_hostapd_remove_iface }, + }; + static const uc_function_list_t bss_fns[] = { + { "ctrl", uc_hostapd_bss_ctrl }, + { "set_config", uc_hostapd_bss_set_config }, + { "delete", uc_hostapd_bss_delete }, + }; + static const uc_function_list_t iface_fns[] = { + { "add_bss", uc_hostapd_iface_add_bss } + }; + uc_value_t *data, *proto; + + interfaces = ifaces; + vm = wpa_ucode_create_vm(); + + global_type = uc_type_declare(vm, "hostapd.global", global_fns, NULL); + bss_type = uc_type_declare(vm, "hostapd.bss", bss_fns, NULL); + iface_type = uc_type_declare(vm, "hostapd.iface", iface_fns, NULL); + + bss_registry = ucv_array_new(vm); + uc_vm_registry_set(vm, "hostap.bss_registry", bss_registry); + + iface_registry = ucv_array_new(vm); + uc_vm_registry_set(vm, "hostap.iface_registry", iface_registry); + + global = wpa_ucode_global_init("hostapd", global_type); + + if (wpa_ucode_run(HOSTAPD_UC_PATH "hostapd.uc")) + goto free_vm; + ucv_gc(vm); + + return 0; + +free_vm: + wpa_ucode_free_vm(); + return -1; +} + +void hostapd_ucode_free(void) +{ + if (wpa_ucode_call_prepare("shutdown") == 0) + ucv_put(wpa_ucode_call(0)); + wpa_ucode_free_vm(); +} + +void hostapd_ucode_free_iface(struct hostapd_iface *iface) +{ + wpa_ucode_registry_remove(iface_registry, iface->ucode.idx); +} + +void hostapd_ucode_add_bss(struct hostapd_data *hapd) +{ + uc_value_t *val; + + if (wpa_ucode_call_prepare("bss_add")) + return; + + val = hostapd_ucode_bss_get_uval(hapd); + uc_value_push(ucv_get(ucv_string_new(hapd->conf->iface))); + uc_value_push(ucv_get(val)); + ucv_put(wpa_ucode_call(2)); + ucv_gc(vm); +} + +void hostapd_ucode_reload_bss(struct hostapd_data *hapd, int reconf) +{ + uc_value_t *val; + + if (wpa_ucode_call_prepare("bss_reload")) + return; + + 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_gc(vm); +} + +void hostapd_ucode_free_bss(struct hostapd_data *hapd) +{ + uc_value_t *val; + + val = wpa_ucode_registry_remove(bss_registry, hapd->ucode.idx); + if (!val) + return; + + hapd->ucode.idx = 0; + if (wpa_ucode_call_prepare("bss_remove")) + return; + + uc_value_push(ucv_string_new(hapd->conf->iface)); + uc_value_push(ucv_get(val)); + 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 new file mode 100644 index 000000000..dbc49e6ea --- /dev/null +++ b/feeds/wifi-ax/hostapd/src/src/ap/ucode.h @@ -0,0 +1,54 @@ +#ifndef __HOSTAPD_AP_UCODE_H +#define __HOSTAPD_AP_UCODE_H + +#include "utils/ucode.h" + +struct hostapd_data; + +struct hostapd_ucode_bss { +#ifdef UCODE_SUPPORT + int idx; +#endif +}; + +struct hostapd_ucode_iface { +#ifdef UCODE_SUPPORT + int idx; +#endif +}; + +#ifdef UCODE_SUPPORT + +int hostapd_ucode_init(struct hapd_interfaces *ifaces); + +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); + +#else + +static inline int hostapd_ucode_init(struct hapd_interfaces *ifaces) +{ + return -EINVAL; +} +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_add_bss(struct hostapd_data *hapd) +{ +} +static inline void hostapd_ucode_free_bss(struct hostapd_data *hapd) +{ +} + +#endif + +#endif diff --git a/feeds/wifi-ax/hostapd/src/src/utils/build_features.h b/feeds/wifi-ax/hostapd/src/src/utils/build_features.h index 3ab5246c7..553769ece 100644 --- a/feeds/wifi-ax/hostapd/src/src/utils/build_features.h +++ b/feeds/wifi-ax/hostapd/src/src/utils/build_features.h @@ -7,10 +7,6 @@ static inline int has_feature(const char *feat) if (!strcmp(feat, "eap")) return 1; #endif -#ifdef CONFIG_IEEE80211N - if (!strcmp(feat, "11n")) - return 1; -#endif #ifdef CONFIG_IEEE80211AC if (!strcmp(feat, "11ac")) return 1; @@ -50,6 +46,18 @@ static inline int has_feature(const char *feat) #ifdef CONFIG_WPS if (!strcmp(feat, "wps")) return 1; +#endif +#ifdef CONFIG_FILS + if (!strcmp(feat, "fils")) + return 1; +#endif +#ifdef CONFIG_OCV + if (!strcmp(feat, "ocv")) + return 1; +#endif +#ifdef CONFIG_MESH + if (!strcmp(feat, "mesh")) + return 1; #endif return 0; } diff --git a/feeds/wifi-ax/hostapd/src/src/utils/ucode.c b/feeds/wifi-ax/hostapd/src/src/utils/ucode.c new file mode 100644 index 000000000..8767aea3d --- /dev/null +++ b/feeds/wifi-ax/hostapd/src/src/utils/ucode.c @@ -0,0 +1,237 @@ +#include +#include "ucode.h" +#include "utils/eloop.h" +#include "crypto/crypto.h" +#include "crypto/sha1.h" +#include +#include + +static uc_value_t *registry; +static uc_vm_t vm; +static struct uloop_timeout gc_timer; + +static void uc_gc_timer(struct uloop_timeout *timeout) +{ + ucv_gc(&vm); +} + +uc_value_t *uc_wpa_printf(uc_vm_t *vm, size_t nargs) +{ + uc_value_t *level = uc_fn_arg(0); + uc_value_t *ret, **args; + uc_cfn_ptr_t _sprintf; + int l = MSG_INFO; + int i, start = 0; + + _sprintf = uc_stdlib_function("sprintf"); + if (!sprintf) + return NULL; + + if (ucv_type(level) == UC_INTEGER) { + l = ucv_int64_get(level); + start++; + } + + if (nargs <= start) + return NULL; + + ret = _sprintf(vm, nargs - start); + if (ucv_type(ret) != UC_STRING) + return NULL; + + wpa_printf(l, "%s", ucv_string_get(ret)); + ucv_put(ret); + + return NULL; +} + +uc_value_t *uc_wpa_getpid(uc_vm_t *vm, size_t nargs) +{ + return ucv_int64_new(getpid()); +} + +uc_value_t *uc_wpa_sha1(uc_vm_t *vm, size_t nargs) +{ + u8 hash[SHA1_MAC_LEN]; + char hash_hex[2 * ARRAY_SIZE(hash) + 1]; + uc_value_t *val; + size_t *lens; + const u8 **args; + int i; + + if (!nargs) + return NULL; + + args = alloca(nargs * sizeof(*args)); + lens = alloca(nargs * sizeof(*lens)); + for (i = 0; i < nargs; i++) { + val = uc_fn_arg(i); + if (ucv_type(val) != UC_STRING) + return NULL; + + args[i] = ucv_string_get(val); + lens[i] = ucv_string_length(val); + } + + if (sha1_vector(nargs, args, lens, hash)) + return NULL; + + for (i = 0; i < ARRAY_SIZE(hash); i++) + sprintf(hash_hex + 2 * i, "%02x", hash[i]); + + return ucv_string_new_length(hash_hex, 2 * ARRAY_SIZE(hash)); +} + +uc_vm_t *wpa_ucode_create_vm(void) +{ + static uc_parse_config_t config = { + .strict_declarations = true, + .lstrip_blocks = true, + .trim_blocks = true, + .raw_mode = true + }; + + uc_search_path_init(&config.module_search_path); + uc_search_path_add(&config.module_search_path, HOSTAPD_UC_PATH "*.so"); + uc_search_path_add(&config.module_search_path, HOSTAPD_UC_PATH "*.uc"); + + uc_vm_init(&vm, &config); + + uc_stdlib_load(uc_vm_scope_get(&vm)); + eloop_add_uloop(); + gc_timer.cb = uc_gc_timer; + + return &vm; +} + +int wpa_ucode_run(const char *script) +{ + uc_source_t *source; + uc_program_t *prog; + uc_value_t *ops; + char *err; + int ret; + + source = uc_source_new_file(script); + if (!source) + return -1; + + prog = uc_compile(vm.config, source, &err); + uc_source_put(source); + if (!prog) { + wpa_printf(MSG_ERROR, "Error loading ucode: %s\n", err); + return -1; + } + + ret = uc_vm_execute(&vm, prog, &ops); + uc_program_put(prog); + if (ret || !ops) + return -1; + + registry = ucv_array_new(&vm); + uc_vm_registry_set(&vm, "hostap.registry", registry); + ucv_array_set(registry, 0, ucv_get(ops)); + + return 0; +} + +int wpa_ucode_call_prepare(const char *fname) +{ + uc_value_t *obj, *func; + + if (!registry) + return -1; + + obj = ucv_array_get(registry, 0); + if (!obj) + return -1; + + func = ucv_object_get(obj, fname, NULL); + if (!ucv_is_callable(func)) + return -1; + + uc_vm_stack_push(&vm, ucv_get(obj)); + uc_vm_stack_push(&vm, ucv_get(func)); + + return 0; +} + +uc_value_t *wpa_ucode_global_init(const char *name, uc_resource_type_t *global_type) +{ + uc_value_t *global = uc_resource_new(global_type, NULL); + uc_value_t *proto; + + uc_vm_registry_set(&vm, "hostap.global", global); + proto = ucv_prototype_get(global); + ucv_object_add(proto, "data", ucv_get(ucv_object_new(&vm))); + +#define ADD_CONST(x) ucv_object_add(proto, #x, ucv_int64_new(x)) + ADD_CONST(MSG_EXCESSIVE); + ADD_CONST(MSG_MSGDUMP); + ADD_CONST(MSG_DEBUG); + ADD_CONST(MSG_INFO); + ADD_CONST(MSG_WARNING); + ADD_CONST(MSG_ERROR); +#undef ADD_CONST + + ucv_object_add(uc_vm_scope_get(&vm), name, ucv_get(global)); + + return global; +} + +void wpa_ucode_registry_add(uc_value_t *reg, uc_value_t *val, int *idx) +{ + uc_value_t *data; + int i = 0; + + while (ucv_array_get(reg, i)) + i++; + + 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; +} + +uc_value_t *wpa_ucode_registry_get(uc_value_t *reg, int idx) +{ + if (!idx) + return NULL; + + return ucv_array_get(reg, idx - 1); +} + +uc_value_t *wpa_ucode_registry_remove(uc_value_t *reg, int idx) +{ + uc_value_t *val = wpa_ucode_registry_get(reg, idx); + + if (val) + ucv_array_delete(reg, idx - 1, 1); + + return val; +} + + +uc_value_t *wpa_ucode_call(size_t nargs) +{ + if (uc_vm_call(&vm, true, nargs) != EXCEPTION_NONE) + return NULL; + + if (!gc_timer.pending) + uloop_timeout_set(&gc_timer, 10); + + return uc_vm_stack_pop(&vm); +} + +void wpa_ucode_free_vm(void) +{ + if (!vm.config) + return; + + uc_search_path_free(&vm.config->module_search_path); + uc_vm_free(&vm); + registry = NULL; + vm = (uc_vm_t){}; +} diff --git a/feeds/wifi-ax/hostapd/src/src/utils/ucode.h b/feeds/wifi-ax/hostapd/src/src/utils/ucode.h new file mode 100644 index 000000000..4caf8ada5 --- /dev/null +++ b/feeds/wifi-ax/hostapd/src/src/utils/ucode.h @@ -0,0 +1,28 @@ +#ifndef __HOSTAPD_UTILS_UCODE_H +#define __HOSTAPD_UTILS_UCODE_H + +#include "utils/includes.h" +#include "utils/common.h" +#include +#include + +#define HOSTAPD_UC_PATH "/usr/share/hostap/" + +extern uc_value_t *uc_registry; +uc_vm_t *wpa_ucode_create_vm(void); +int wpa_ucode_run(const char *script); +int wpa_ucode_call_prepare(const char *fname); +uc_value_t *wpa_ucode_call(size_t nargs); +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); +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); + +#endif diff --git a/feeds/wifi-ax/hostapd/src/wpa_supplicant/ubus.c b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ubus.c index 16a68c507..1c477f0c0 100644 --- a/feeds/wifi-ax/hostapd/src/wpa_supplicant/ubus.c +++ b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ubus.c @@ -30,12 +30,6 @@ static inline struct wpa_supplicant *get_wpas_from_object(struct ubus_object *ob return container_of(obj, struct wpa_supplicant, ubus.obj); } -static void ubus_receive(int sock, void *eloop_ctx, void *sock_ctx) -{ - struct ubus_context *ctx = eloop_ctx; - ubus_handle_event(ctx); -} - static void ubus_reconnect_timeout(void *eloop_data, void *user_ctx) { if (ubus_reconnect(ctx, NULL)) { @@ -43,12 +37,12 @@ static void ubus_reconnect_timeout(void *eloop_data, void *user_ctx) return; } - eloop_register_read_sock(ctx->sock.fd, ubus_receive, ctx, NULL); + ubus_add_uloop(ctx); } static void wpas_ubus_connection_lost(struct ubus_context *ctx) { - eloop_unregister_read_sock(ctx->sock.fd); + uloop_fd_delete(&ctx->sock); eloop_register_timeout(1, 0, ubus_reconnect_timeout, ctx, NULL); } @@ -57,12 +51,14 @@ static bool wpas_ubus_init(void) if (ctx) return true; + eloop_add_uloop(); ctx = ubus_connect(NULL); if (!ctx) return false; ctx->connection_lost = wpas_ubus_connection_lost; - eloop_register_read_sock(ctx->sock.fd, ubus_receive, ctx, NULL); + ubus_add_uloop(ctx); + return true; } @@ -80,7 +76,7 @@ static void wpas_ubus_ref_dec(void) if (ctx_ref) return; - eloop_unregister_read_sock(ctx->sock.fd); + uloop_fd_delete(&ctx->sock); ubus_free(ctx); ctx = NULL; } @@ -211,152 +207,6 @@ void wpas_ubus_free_bss(struct wpa_supplicant *wpa_s) free(name); } -enum { - WPAS_CONFIG_DRIVER, - WPAS_CONFIG_IFACE, - WPAS_CONFIG_BRIDGE, - WPAS_CONFIG_HOSTAPD_CTRL, - WPAS_CONFIG_CTRL, - WPAS_CONFIG_FILE, - __WPAS_CONFIG_MAX -}; - -static const struct blobmsg_policy wpas_config_add_policy[__WPAS_CONFIG_MAX] = { - [WPAS_CONFIG_DRIVER] = { "driver", BLOBMSG_TYPE_STRING }, - [WPAS_CONFIG_IFACE] = { "iface", BLOBMSG_TYPE_STRING }, - [WPAS_CONFIG_BRIDGE] = { "bridge", BLOBMSG_TYPE_STRING }, - [WPAS_CONFIG_HOSTAPD_CTRL] = { "hostapd_ctrl", BLOBMSG_TYPE_STRING }, - [WPAS_CONFIG_CTRL] = { "ctrl", BLOBMSG_TYPE_STRING }, - [WPAS_CONFIG_FILE] = { "config", BLOBMSG_TYPE_STRING }, -}; - -static int -wpas_config_add(struct ubus_context *ctx, struct ubus_object *obj, - struct ubus_request_data *req, const char *method, - struct blob_attr *msg) -{ - struct blob_attr *tb[__WPAS_CONFIG_MAX]; - struct wpa_global *global = get_wpa_global_from_object(obj); - struct wpa_interface *iface; - - blobmsg_parse(wpas_config_add_policy, __WPAS_CONFIG_MAX, tb, blob_data(msg), blob_len(msg)); - - if (!tb[WPAS_CONFIG_FILE] || !tb[WPAS_CONFIG_IFACE] || !tb[WPAS_CONFIG_DRIVER]) - return UBUS_STATUS_INVALID_ARGUMENT; - - iface = os_zalloc(sizeof(struct wpa_interface)); - if (iface == NULL) - return UBUS_STATUS_UNKNOWN_ERROR; - - iface->driver = blobmsg_get_string(tb[WPAS_CONFIG_DRIVER]); - iface->ifname = blobmsg_get_string(tb[WPAS_CONFIG_IFACE]); - iface->confname = blobmsg_get_string(tb[WPAS_CONFIG_FILE]); - - if (tb[WPAS_CONFIG_BRIDGE]) - iface->bridge_ifname = blobmsg_get_string(tb[WPAS_CONFIG_BRIDGE]); - - if (tb[WPAS_CONFIG_CTRL]) - iface->ctrl_interface = blobmsg_get_string(tb[WPAS_CONFIG_CTRL]); - - if (tb[WPAS_CONFIG_HOSTAPD_CTRL]) - iface->hostapd_ctrl = blobmsg_get_string(tb[WPAS_CONFIG_HOSTAPD_CTRL]); - - if (!wpa_supplicant_add_iface(global, iface, NULL)) - return UBUS_STATUS_INVALID_ARGUMENT; - - blob_buf_init(&b, 0); - blobmsg_add_u32(&b, "pid", getpid()); - ubus_send_reply(ctx, req, b.head); - - return UBUS_STATUS_OK; -} - -enum { - WPAS_CONFIG_REM_IFACE, - __WPAS_CONFIG_REM_MAX -}; - -static const struct blobmsg_policy wpas_config_remove_policy[__WPAS_CONFIG_REM_MAX] = { - [WPAS_CONFIG_REM_IFACE] = { "iface", BLOBMSG_TYPE_STRING }, -}; - -static int -wpas_config_remove(struct ubus_context *ctx, struct ubus_object *obj, - struct ubus_request_data *req, const char *method, - struct blob_attr *msg) -{ - struct blob_attr *tb[__WPAS_CONFIG_REM_MAX]; - struct wpa_global *global = get_wpa_global_from_object(obj); - struct wpa_supplicant *wpa_s = NULL; - unsigned int found = 0; - - blobmsg_parse(wpas_config_remove_policy, __WPAS_CONFIG_REM_MAX, tb, blob_data(msg), blob_len(msg)); - - if (!tb[WPAS_CONFIG_REM_IFACE]) - return UBUS_STATUS_INVALID_ARGUMENT; - - /* find wpa_s object for to-be-removed interface */ - for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) { - if (!strncmp(wpa_s->ifname, - blobmsg_get_string(tb[WPAS_CONFIG_REM_IFACE]), - sizeof(wpa_s->ifname))) - { - found = 1; - break; - } - } - - if (!found) - return UBUS_STATUS_INVALID_ARGUMENT; - - if (wpa_supplicant_remove_iface(global, wpa_s, 0)) - return UBUS_STATUS_INVALID_ARGUMENT; - - return UBUS_STATUS_OK; -} - -static const struct ubus_method wpas_daemon_methods[] = { - UBUS_METHOD("config_add", wpas_config_add, wpas_config_add_policy), - UBUS_METHOD("config_remove", wpas_config_remove, wpas_config_remove_policy), -}; - -static struct ubus_object_type wpas_daemon_object_type = - UBUS_OBJECT_TYPE("wpa_supplicant", wpas_daemon_methods); - -void wpas_ubus_add(struct wpa_global *global) -{ - struct ubus_object *obj = &global->ubus_global; - int ret; - - if (!wpas_ubus_init()) - return; - - obj->name = strdup("wpa_supplicant"); - - obj->type = &wpas_daemon_object_type; - obj->methods = wpas_daemon_object_type.methods; - obj->n_methods = wpas_daemon_object_type.n_methods; - ret = ubus_add_object(ctx, obj); - wpas_ubus_ref_inc(); -} - -void wpas_ubus_free(struct wpa_global *global) -{ - struct ubus_object *obj = &global->ubus_global; - char *name = (char *) obj->name; - - if (!ctx) - return; - - if (obj->id) { - ubus_remove_object(ctx, obj); - wpas_ubus_ref_dec(); - } - - free(name); -} - - #ifdef CONFIG_WPS void wpas_ubus_notify(struct wpa_supplicant *wpa_s, const struct wps_credential *cred) { diff --git a/feeds/wifi-ax/hostapd/src/wpa_supplicant/ubus.h b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ubus.h index bf92b98c0..f6681cb26 100644 --- a/feeds/wifi-ax/hostapd/src/wpa_supplicant/ubus.h +++ b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ubus.h @@ -24,9 +24,6 @@ struct wpas_ubus_bss { void wpas_ubus_add_bss(struct wpa_supplicant *wpa_s); void wpas_ubus_free_bss(struct wpa_supplicant *wpa_s); -void wpas_ubus_add(struct wpa_global *global); -void wpas_ubus_free(struct wpa_global *global); - #ifdef CONFIG_WPS void wpas_ubus_notify(struct wpa_supplicant *wpa_s, const struct wps_credential *cred); #endif @@ -34,14 +31,6 @@ void wpas_ubus_notify(struct wpa_supplicant *wpa_s, const struct wps_credential #else struct wpas_ubus_bss {}; -static inline void wpas_ubus_add_iface(struct wpa_supplicant *wpa_s) -{ -} - -static inline void wpas_ubus_free_iface(struct wpa_supplicant *wpa_s) -{ -} - static inline void wpas_ubus_add_bss(struct wpa_supplicant *wpa_s) { } diff --git a/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.c b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.c new file mode 100644 index 000000000..660357a43 --- /dev/null +++ b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.c @@ -0,0 +1,177 @@ +#include "utils/includes.h" +#include "utils/common.h" +#include "utils/ucode.h" +#include "wpa_supplicant_i.h" +#include "wps_supplicant.h" +#include "ucode.h" + +static struct wpa_global *wpa_global; +static uc_resource_type_t *global_type, *iface_type; +static uc_value_t *global, *iface_registry; +static uc_vm_t *vm; + +static uc_value_t * +wpas_ucode_iface_get_uval(struct wpa_supplicant *wpa_s) +{ + uc_value_t *val; + + if (wpa_s->ucode.idx) + 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); + + return val; +} + +static void +wpas_ucode_update_interfaces(void) +{ + uc_value_t *ifs = ucv_object_new(vm); + struct wpa_supplicant *wpa_s; + int i; + + for (wpa_s = wpa_global->ifaces; wpa_s; wpa_s = wpa_s->next) + ucv_object_add(ifs, wpa_s->ifname, ucv_get(wpas_ucode_iface_get_uval(wpa_s))); + + ucv_object_add(ucv_prototype_get(global), "interfaces", ucv_get(ifs)); + ucv_gc(vm); +} + +void wpas_ucode_add_bss(struct wpa_supplicant *wpa_s) +{ + uc_value_t *val; + + if (wpa_ucode_call_prepare("iface_add")) + return; + + uc_value_push(ucv_get(ucv_string_new(wpa_s->ifname))); + uc_value_push(ucv_get(wpas_ucode_iface_get_uval(wpa_s))); + ucv_put(wpa_ucode_call(2)); + ucv_gc(vm); +} + +void wpas_ucode_free_bss(struct wpa_supplicant *wpa_s) +{ + uc_value_t *val; + + val = wpa_ucode_registry_remove(iface_registry, wpa_s->ucode.idx); + if (!val) + return; + + wpa_s->ucode.idx = 0; + if (wpa_ucode_call_prepare("iface_remove")) + return; + + uc_value_push(ucv_string_new(wpa_s->ifname)); + uc_value_push(ucv_get(val)); + ucv_put(wpa_ucode_call(2)); + 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); + + return ucv_string_get(val); +} + +static uc_value_t * +uc_wpas_add_iface(uc_vm_t *vm, size_t nargs) +{ + uc_value_t *info = uc_fn_arg(0); + uc_value_t *ifname = ucv_object_get(info, "iface", NULL); + 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; + + if (ucv_type(info) != UC_OBJECT) + goto out; + + iface = (struct wpa_interface){ + .driver = "nl80211", + .ifname = ucv_string_get(ifname), + .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) + goto out; + + ret = wpa_supplicant_add_iface(wpa_global, &iface, 0) ? 0 : -1; + wpas_ucode_update_interfaces(); + +out: + return ucv_int64_new(ret); +} + +static uc_value_t * +uc_wpas_remove_iface(uc_vm_t *vm, size_t nargs) +{ + struct wpa_supplicant *wpa_s = NULL; + uc_value_t *ifname_arg = uc_fn_arg(0); + const char *ifname = ucv_string_get(ifname_arg); + int ret = -1; + + if (!ifname) + goto out; + + for (wpa_s = wpa_global->ifaces; wpa_s; wpa_s = wpa_s->next) + if (!strcmp(wpa_s->ifname, ifname)) + break; + + if (!wpa_s) + goto out; + + ret = wpa_supplicant_remove_iface(wpa_global, wpa_s, 0); + wpas_ucode_update_interfaces(); + +out: + return ucv_int64_new(ret); +} + +int wpas_ucode_init(struct wpa_global *gl) +{ + static const uc_function_list_t global_fns[] = { + { "printf", uc_wpa_printf }, + { "getpid", uc_wpa_getpid }, + { "add_iface", uc_wpas_add_iface }, + { "remove_iface", uc_wpas_remove_iface }, + }; + static const uc_function_list_t iface_fns[] = { + }; + uc_value_t *data, *proto; + + 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_registry = ucv_array_new(vm); + uc_vm_registry_set(vm, "hostap.iface_registry", iface_registry); + + global = wpa_ucode_global_init("wpas", global_type); + + if (wpa_ucode_run(HOSTAPD_UC_PATH "wpa_supplicant.uc")) + goto free_vm; + + ucv_gc(vm); + return 0; + +free_vm: + wpa_ucode_free_vm(); + return -1; +} + +void wpas_ucode_free(void) +{ + if (wpa_ucode_call_prepare("shutdown") == 0) + ucv_put(wpa_ucode_call(0)); + wpa_ucode_free_vm(); +} diff --git a/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.h b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.h new file mode 100644 index 000000000..fcd231357 --- /dev/null +++ b/feeds/wifi-ax/hostapd/src/wpa_supplicant/ucode.h @@ -0,0 +1,38 @@ +#ifndef __WPAS_UCODE_H +#define __WPAS_UCODE_H + +#include "utils/ucode.h" + +struct wpa_global; +struct wpa_supplicant; + +struct wpas_ucode_bss { +#ifdef UCODE_SUPPORT + unsigned int idx; +#endif +}; + +#ifdef UCODE_SUPPORT +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); +#else +static inline int wpas_ucode_init(struct wpa_global *gl) +{ + return -EINVAL; +} +static inline void wpas_ucode_free(void) +{ +} +static inline void wpas_ucode_add_bss(struct wpa_supplicant *wpa_s) +{ +} + +static inline void wpas_ucode_free_bss(struct wpa_supplicant *wpa_s) +{ +} + +#endif + +#endif diff --git a/feeds/wifi-ax/mac80211/Makefile b/feeds/wifi-ax/mac80211/Makefile index c2b07da87..cf7080c2e 100644 --- a/feeds/wifi-ax/mac80211/Makefile +++ b/feeds/wifi-ax/mac80211/Makefile @@ -89,7 +89,7 @@ define KernelPackage/mac80211 $(call KernelPackage/mac80211/Default) TITLE:=Linux 802.11 Wireless Networking Stack # +kmod-crypto-cmac is a runtime only dependency of net/mac80211/aes_cmac.c - DEPENDS+= +kmod-cfg80211 +hostapd-common +kmod-qca-nss-drv +kmod-qca-nss-drv-wifi-meshmgr + DEPENDS+= +kmod-cfg80211 +kmod-qca-nss-drv +kmod-qca-nss-drv-wifi-meshmgr KCONFIG:=\ CONFIG_AVERAGE=y FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko 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 b00545561..fec655027 100644 --- a/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/feeds/wifi-ax/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -1,6 +1,7 @@ #!/bin/sh . /lib/netifd/netifd-wireless.sh . /lib/netifd/hostapd.sh +. /lib/functions/system.sh init_wireless_driver "$@" @@ -14,12 +15,9 @@ MP_CONFIG_INT="mesh_retry_timeout mesh_confirm_timeout mesh_holding_timeout mesh MP_CONFIG_BOOL="mesh_auto_open_plinks mesh_fwding" MP_CONFIG_STRING="mesh_power_mode" -NEWAPLIST= -OLDAPLIST= -NEWSPLIST= -OLDSPLIST= -NEWUMLIST= -OLDUMLIST= +wdev_tool() { + ucode /usr/share/hostap/wdev.uc "$@" +} drv_mac80211_init_device_config() { hostapd_common_add_device_config @@ -28,9 +26,9 @@ drv_mac80211_init_device_config() { config_add_string tx_burst config_add_string distance config_add_int beacon_int chanbw frag rts - config_add_int rxantenna txantenna antenna_gain txpower + config_add_int rxantenna txantenna antenna_gain txpower min_tx_power config_add_int num_global_macaddr - config_add_boolean noscan ht_coex acs_exclude_dfs + config_add_boolean noscan ht_coex acs_exclude_dfs background_radar config_add_array ht_capab config_add_array channels config_add_array scan_list @@ -134,19 +132,21 @@ mac80211_hostapd_setup_base() { json_select config - [ "$auto_channel" -gt 0 ] && channel=0 + [ "$auto_channel" -gt 0 ] && channel=acs_survey [ "$auto_channel" -gt 0 ] && json_get_vars acs_exclude_dfs [ -n "$acs_exclude_dfs" ] && [ "$acs_exclude_dfs" -gt 0 ] && append base_cfg "acs_exclude_dfs=1" "$N" - json_get_vars noscan ht_coex - json_get_values ht_capab_list ht_capab tx_burst + json_get_vars noscan ht_coex min_tx_power:0 tx_burst + json_get_values ht_capab_list ht_capab json_get_values channel_list channels [ "$auto_channel" = 0 ] && [ -z "$channel_list" ] && \ channel_list="$channel" + [ "$min_tx_power" -gt 0 ] && append base_cfg "min_tx_power=$min_tx_power" + set_default noscan 0 [ "$noscan" -gt 0 ] && hostapd_noscan=1 @@ -276,6 +276,11 @@ mac80211_hostapd_setup_base() { vht_center_seg0=$idx ;; esac + [ "$band" = "5g" ] && { + json_get_vars background_radar:0 + + [ "$background_radar" -eq 1 ] && append base_cfg "enable_background_radar=1" "$N" + } [ "$band" = "6g" ] && { op_class= case "$htmode" in @@ -409,20 +414,21 @@ mac80211_hostapd_setup_base() { if [ "$enable_ax" != "0" ]; then json_get_vars \ he_su_beamformer:1 \ - he_su_beamformee:0 \ + he_su_beamformee:1 \ he_mu_beamformer:1 \ he_twt_required:0 \ - he_spr_sr_control:0 \ - he_spr_non_srg_obss_pd_max_offset:1 \ - he_bss_color + he_spr_sr_control:3 \ + he_spr_psr_enabled:0 \ + he_spr_non_srg_obss_pd_max_offset:0 \ + he_bss_color:128 \ + he_bss_color_enabled:1 - he_phy_cap=$(iw phy "$phy" info | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1) + he_phy_cap=$(iw phy "$phy" info | sed -n '/HE Iftypes: AP/,$p' | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1) he_phy_cap=${he_phy_cap:2} - he_mac_cap=$(iw phy "$phy" info | awk -F "[()]" '/HE MAC Capabilities/ { print $2 }' | head -1) + he_mac_cap=$(iw phy "$phy" info | sed -n '/HE Iftypes: AP/,$p' | awk -F "[()]" '/HE MAC Capabilities/ { print $2 }' | head -1) he_mac_cap=${he_mac_cap:2} append base_cfg "ieee80211ax=1" "$N" - [ -n "$he_bss_color" ] && append base_cfg "he_bss_color=$he_bss_color" "$N" [ "$hwmode" = "a" ] && { append base_cfg "he_oper_chwidth=$vht_oper_chwidth" "$N" append base_cfg "he_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N" @@ -432,10 +438,21 @@ mac80211_hostapd_setup_base() { he_su_beamformer:${he_phy_cap:6:2}:0x80:$he_su_beamformer \ he_su_beamformee:${he_phy_cap:8:2}:0x1:$he_su_beamformee \ he_mu_beamformer:${he_phy_cap:8:2}:0x2:$he_mu_beamformer \ - he_spr_sr_control:${he_phy_cap:14:2}:0x1:$he_spr_sr_control \ + he_spr_psr_enabled:${he_phy_cap:14:2}:0x1:$he_spr_psr_enabled \ he_twt_required:${he_mac_cap:0:2}:0x6:$he_twt_required - [ "$he_spr_sr_control" -gt 0 ] && append base_cfg "he_spr_non_srg_obss_pd_max_offset=$he_spr_non_srg_obss_pd_max_offset" "$N" + if [ "$he_bss_color_enabled" -gt 0 ]; then + append base_cfg "he_bss_color=$he_bss_color" "$N" + [ "$he_spr_non_srg_obss_pd_max_offset" -gt 0 ] && { \ + append base_cfg "he_spr_non_srg_obss_pd_max_offset=$he_spr_non_srg_obss_pd_max_offset" "$N" + he_spr_sr_control=$((he_spr_sr_control | (1 << 2))) + } + [ "$he_spr_psr_enabled" -gt 0 ] || he_spr_sr_control=$((he_spr_sr_control | (1 << 0))) + append base_cfg "he_spr_sr_control=$he_spr_sr_control" "$N" + else + append base_cfg "he_bss_color_disabled=1" "$N" + fi + append base_cfg "he_default_pe_duration=4" "$N" append base_cfg "he_rts_threshold=1023" "$N" @@ -490,7 +507,7 @@ mac80211_hostapd_setup_bss() { hostapd_set_bss_options hostapd_cfg "$phy" "$vif" || return 1 json_get_vars wds wds_bridge dtim_period max_listen_int start_disabled - json_get_vars fils_discovery_max_interval + json_get_vars fils_discovery_max_interval set_default wds 0 set_default start_disabled 0 @@ -598,76 +615,7 @@ mac80211_check_ap() { has_ap=1 } -mac80211_iw_interface_add() { - local phy="$1" - local ifname="$2" - local type="$3" - local wdsflag="$4" - local rc - local oldifname - - iw phy "$phy" interface add "$ifname" type "$type" $wdsflag >/dev/null 2>&1 - rc="$?" - - [ "$rc" = 233 ] && { - # Device might have just been deleted, give the kernel some time to finish cleaning it up - sleep 1 - - iw phy "$phy" interface add "$ifname" type "$type" $wdsflag >/dev/null 2>&1 - rc="$?" - } - - [ "$rc" = 233 ] && { - # Keep matching pre-existing interface - [ -d "/sys/class/ieee80211/${phy}/device/net/${ifname}" ] && \ - case "$(iw dev $ifname info | grep "^\ttype" | cut -d' ' -f2- 2>/dev/null)" in - "AP") - [ "$type" = "__ap" ] && rc=0 - ;; - "IBSS") - [ "$type" = "adhoc" ] && rc=0 - ;; - "managed") - [ "$type" = "managed" ] && rc=0 - ;; - "mesh point") - [ "$type" = "mp" ] && rc=0 - ;; - "monitor") - [ "$type" = "monitor" ] && rc=0 - ;; - esac - } - - [ "$rc" = 233 ] && { - iw dev "$ifname" del >/dev/null 2>&1 - [ "$?" = 0 ] && { - sleep 1 - - iw phy "$phy" interface add "$ifname" type "$type" $wdsflag >/dev/null 2>&1 - rc="$?" - } - } - - [ "$rc" != 0 ] && { - # Device might not support virtual interfaces, so the interface never got deleted in the first place. - # Check if the interface already exists, and avoid failing in this case. - [ -d "/sys/class/ieee80211/${phy}/device/net/${ifname}" ] && rc=0 - } - - [ "$rc" != 0 ] && { - # Device doesn't support virtual interfaces and may have existing interface other than ifname. - oldifname="$(basename "/sys/class/ieee80211/${phy}/device/net"/* 2>/dev/null)" - [ "$oldifname" ] && ip link set "$oldifname" name "$ifname" 1>/dev/null 2>&1 - rc="$?" - } - - [ "$rc" != 0 ] && echo "Failed to create interface $ifname" - return $rc -} - mac80211_prepare_vif() { - local multiple_bssid=$1 json_select config json_get_vars ifname mode ssid wds powersave macaddr enable wpa_psk_file vlan_file @@ -675,19 +623,18 @@ mac80211_prepare_vif() { [ -n "$ifname" ] || ifname="wlan${phy#phy}${if_idx:+-$if_idx}" if_idx=$((${if_idx:-0} + 1)) + append active_ifnames "$ifname" set_default wds 0 set_default powersave 0 - - json_select .. + json_add_string _ifname "$ifname" [ -n "$macaddr" ] || { macaddr="$(mac80211_generate_mac $phy $multiple_bssid)" - macidx="$(($macidx + 1))" + macidx="$(($macidx + 1))" } + json_add_string _macaddr "$macaddr" + json_select .. - json_add_object data - json_add_string ifname "$ifname" - json_close_object [ "$mode" == "ap" ] && { [ -z "$wpa_psk_file" ] && hostapd_set_psk "$ifname" @@ -698,9 +645,6 @@ mac80211_prepare_vif() { # It is far easier to delete and create the desired interface case "$mode" in - adhoc) - mac80211_iw_interface_add "$phy" "$ifname" adhoc || return - ;; ap) # Hostapd will handle recreating the interface and # subsequent virtual APs belonging to the same PHY @@ -712,119 +656,20 @@ mac80211_prepare_vif() { mac80211_hostapd_setup_bss "$phy" "$ifname" "$macaddr" "$type" || return - NEWAPLIST="${NEWAPLIST}$ifname " [ -n "$hostapd_ctrl" ] || { ap_ifname="${ifname}" hostapd_ctrl="${hostapd_ctrl:-/var/run/hostapd/$ifname}" } ;; - mesh) - mac80211_iw_interface_add "$phy" "$ifname" mp || return - ;; - monitor) - mac80211_iw_interface_add "$phy" "$ifname" monitor || return - ;; - sta) - local wdsflag= - [ "$enable" = 0 ] || staidx="$(($staidx + 1))" - [ "$wds" -gt 0 ] && wdsflag="4addr on" - mac80211_iw_interface_add "$phy" "$ifname" managed "$wdsflag" || return - if [ "$wds" -gt 0 ]; then - echo 1 > /sys/kernel/debug/ieee80211/$phy/netdev\:$ifname/disable_offload - iw "$ifname" set 4addr on - else - iw "$ifname" set 4addr off - fi - [ "$powersave" -gt 0 ] && powersave="on" || powersave="off" - iw "$ifname" set power_save "$powersave" - ;; esac - case "$mode" in - monitor|mesh) - [ "$auto_channel" -gt 0 ] || iw dev "$ifname" set channel "$channel" $iw_htmode - ;; - esac - - if [ "$mode" != "ap" ]; then - # ALL ap functionality will be passed to hostapd - # All interfaces must have unique mac addresses - # which can either be explicitly set in the device - # section, or automatically generated - ip link set dev "$ifname" address "$macaddr" - fi - json_select .. } -mac80211_setup_supplicant() { - local enable=$1 - local add_sp=0 - local spobj="$(ubus -S list | grep wpa_supplicant.${ifname})" - - [ "$enable" = 0 ] && { - ubus call wpa_supplicant.${phy} config_remove "{\"iface\":\"$ifname\"}" - ip link set dev "$ifname" down - iw dev "$ifname" del - return 0 - } - - wpa_supplicant_prepare_interface "$ifname" nl80211 || { - iw dev "$ifname" del - return 1 - } - if [ "$mode" = "sta" ]; then - wpa_supplicant_add_network "$ifname" - else - wpa_supplicant_add_network "$ifname" "$freq" "$htmode" "$noscan" - fi - - NEWSPLIST="${NEWSPLIST}$ifname " - - if [ "${NEWAPLIST%% *}" != "${OLDAPLIST%% *}" ]; then - [ "$spobj" ] && ubus call wpa_supplicant config_remove "{\"iface\":\"$ifname\"}" - add_sp=1 - fi - [ -z "$spobj" ] && add_sp=1 - - NEW_MD5_SP=$(test -e "${_config}" && md5sum ${_config}) - OLD_MD5_SP=$(uci -q -P /var/state get wireless._${phy}.md5_${ifname}) - if [ "$add_sp" = "1" ]; then - wpa_supplicant_run "$ifname" "$hostapd_ctrl" - else - [ "${NEW_MD5_SP}" == "${OLD_MD5_SP}" ] || ubus call $spobj reload - fi - uci -q -P /var/state set wireless._${phy}.md5_${ifname}="${NEW_MD5_SP}" - return 0 -} - -mac80211_setup_supplicant_noctl() { - local enable=$1 - local spobj="$(ubus -S list | grep wpa_supplicant.${ifname})" - wpa_supplicant_prepare_interface "$ifname" nl80211 || { - iw dev "$ifname" del - return 1 - } - - wpa_supplicant_add_network "$ifname" "$freq" "$htmode" "$noscan" - - NEWSPLIST="${NEWSPLIST}$ifname " - [ "$enable" = 0 ] && { - ubus call wpa_supplicant config_remove "{\"iface\":\"$ifname\"}" - ip link set dev "$ifname" down - return 0 - } - if [ -z "$spobj" ]; then - wpa_supplicant_run "$ifname" - else - ubus call $spobj reload - fi -} - mac80211_prepare_iw_htmode() { case "$htmode" in - VHT20|HT20) iw_htmode=HT20;; - HT40*|VHT40|VHT160) + VHT20|HT20|HE20) iw_htmode=HT20;; + HT40*|VHT40|VHT160|HE40) case "$band" in 2g) case "$htmode" in @@ -848,7 +693,7 @@ mac80211_prepare_iw_htmode() { esac [ "$auto_channel" -gt 0 ] && iw_htmode="HT40+" ;; - VHT80) + VHT80|HE80) iw_htmode="80MHZ" ;; NONE|NOHT) @@ -858,6 +703,13 @@ mac80211_prepare_iw_htmode() { esac } +mac80211_add_mesh_params() { + for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do + eval "mp_val=\"\$var\"" + [ -n "$mp_val" ] && json_add_string "$var" "$mp_val" + done +} + mac80211_setup_adhoc() { local enable=$1 json_get_vars bssid ssid key mcast_rate @@ -899,81 +751,194 @@ mac80211_setup_adhoc() { mcval= [ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate" - iw dev "$ifname" ibss join "$ssid" $freq $iw_htmode fixed-freq $bssid \ - beacon-interval $beacon_int \ - ${brstr:+basic-rates $brstr} \ - ${mcval:+mcast-rate $mcval} \ - ${keyspec:+keys $keyspec} + local prev + json_set_namespace wdev prev + + json_add_object "$ifname" + json_add_string mode adhoc + json_add_string macaddr "$macaddr" + json_add_string ssid "$ssid" + json_add_string freq "$freq" + json_add_string htmode "$iw_htmode" + [ -n "$bssid" ] && json_add_string bssid "$bssid" + json_add_int beacon-interval "$beacon_int" + [ -n "$brstr" ] && json_add_string basic-rates "$brstr" + [ -n "$mcval" ] && json_add_string mcast-rate "$mcval" + [ -n "$keyspec" ] && json_add_string keys "$keyspec" + json_close_object + + json_set_namespace "$prev" } mac80211_setup_mesh() { - local enable=$1 json_get_vars ssid mesh_id mcast_rate - NEWUMLIST="${NEWUMLIST}$ifname " - - [ "$enable" = 0 ] && { - ip link set dev "$ifname" down - return 0 - } - mcval= [ -n "$mcast_rate" ] && wpa_supplicant_add_rate mcval "$mcast_rate" [ -n "$mesh_id" ] && ssid="$mesh_id" - iw dev "$ifname" mesh join "$ssid" freq $freq $iw_htmode \ - ${mcval:+mcast-rate $mcval} \ - beacon-interval $beacon_int + local prev + json_set_namespace wdev prev + + json_add_object "$ifname" + json_add_string mode mesh + json_add_string macaddr "$macaddr" + json_add_string ssid "$ssid" + json_add_string freq "$freq" + json_add_string htmode "$iw_htmode" + [ -n "$mcval" ] && json_add_string mcast-rate "$mcval" + json_add_int beacon-interval "$beacon_int" + mac80211_add_mesh_params + + json_close_object + + json_set_namespace "$prev" +} + +mac80211_setup_monitor() { + local prev + json_set_namespace wdev prev + + json_add_object "$ifname" + json_add_string mode monitor + [ -n "$freq" ] && json_add_string freq "$freq" + json_add_string htmode "$iw_htmode" + json_close_object + + json_set_namespace "$prev" +} + +mac80211_set_vif_txpower() { + local name="$1" + + json_select config + json_get_var ifname _ifname + json_get_vars vif_txpower wds + json_select .. + + set_default wds 0 + [ -z "$vif_txpower" ] || iw dev "$ifname" set txpower fixed "${vif_txpower%%.*}00" + [ "$wds" -gt 0 ] && echo 1 > /sys/kernel/debug/ieee80211/$phy/netdev\:$ifname/disable_offload +} + +wpa_supplicant_add_interface() { + local ifname="$1" + local mode="$2" + local hostapd_ctrl="$3" + local prev + + _wpa_supplicant_common "$ifname" + + json_set_namespace wpa_supp prev + + [ -n "$wpa_supp_init" ] || { + json_init + json_add_array config + wpa_supp_init=1 + } + + json_add_object + json_add_string ctrl "$_rpath" + json_add_string iface "$ifname" + json_add_string mode "$mode" + json_add_string config "$_config" + json_add_string macaddr "$macaddr" + [ -n "$network_bridge" ] && json_add_string bridge "$network_bridge" + [ -n "$hostapd_ctrl" ] && json_add_string hostapd_ctrl "$hostapd_ctrl" + [ -n "$wds" ] && json_add_boolean 4addr "$wds" + json_add_boolean powersave "$powersave" + [ "$mode" = "mesh" ] && mac80211_add_mesh_params + json_close_object + + json_set_namespace "$prev" + + ret="$?" + + return $ret +} + +wpa_supplicant_set_config() { + local phy="$1" + local prev + + json_set_namespace wpa_supp prev + json_close_array + json_add_string phy "$phy" + json_add_boolean defer 1 + local data="$(json_dump)" + + json_cleanup + json_set_namespace "$prev" + + ubus wait_for wpa_supplicant + + local supplicant_res="$(ubus call wpa_supplicant config_set "$data")" + ret="$?" + [ "$ret" != 0 -o -z "$supplicant_res" ] && wireless_setup_vif_failed WPA_SUPPLICANT_FAILED + + wireless_add_process "$(jsonfilter -s "$supplicant_res" -l 1 -e @.pid)" "/usr/sbin/wpa_supplicant" 1 1 + +} + +wpa_supplicant_start() { + local phy="$1" + + ubus call wpa_supplicant config_set '{ "phy": "'"$phy"'" }' > /dev/null +} + +mac80211_setup_supplicant() { + local enable=$1 + local add_sp=0 + + wpa_supplicant_prepare_interface "$ifname" nl80211 || return 1 + + if [ "$mode" = "sta" ]; then + wpa_supplicant_add_network "$ifname" + else + wpa_supplicant_add_network "$ifname" "$freq" "$htmode" "$noscan" + fi + + wpa_supplicant_add_interface "$ifname" "$mode" "$hostapd_ctrl" + + return 0 } mac80211_setup_vif() { local name="$1" local failed - local action=up - - json_select data - json_get_vars ifname - json_select .. json_select config - json_get_vars mode - json_get_var vif_txpower - json_get_var vif_enable enable 1 + json_get_var ifname _ifname + json_get_var macaddr _macaddr + json_get_vars mode wds powersave - [ "$vif_enable" = 1 ] || action=down - if [ "$mode" != "ap" ] || [ "$ifname" = "$ap_ifname" ]; then - ip link set dev "$ifname" "$action" || { - wireless_setup_vif_failed IFUP_ERROR - json_select .. - return - } - [ -z "$vif_txpower" ] || iw dev "$ifname" set txpower fixed "${vif_txpower%%.*}00" - fi + set_default powersave 0 + set_default wds 0 case "$mode" in mesh) + json_get_vars $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING wireless_vif_parse_encryption [ -z "$htmode" ] && htmode="NOHT"; - if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ] || chan_is_dfs "$phy" "$channel"; then - mac80211_setup_supplicant $vif_enable || failed=1 + if wpa_supplicant -vmesh; then + mac80211_setup_supplicant || failed=1 else - mac80211_setup_mesh $vif_enable + mac80211_setup_mesh fi - for var in $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING; do - json_get_var mp_val "$var" - [ -n "$mp_val" ] && iw dev "$ifname" set mesh_param "$var" "$mp_val" - done ;; adhoc) wireless_vif_parse_encryption if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ]; then - mac80211_setup_supplicant_noctl $vif_enable || failed=1 + mac80211_setup_supplicant || failed=1 else - mac80211_setup_adhoc $vif_enable + mac80211_setup_adhoc fi ;; sta) - mac80211_setup_supplicant $vif_enable || failed=1 + mac80211_setup_supplicant || failed=1 + ;; + monitor) + mac80211_setup_monitor ;; esac @@ -1006,7 +971,6 @@ band_match && $3 == "MHz" && $4 == channel { ' } - chan_is_dfs() { local phy="$1" local chan="$2" @@ -1014,27 +978,6 @@ chan_is_dfs() { return $! } -mac80211_vap_cleanup() { - local service="$1" - local vaps="$2" - - for wdev in $vaps; do - [ "$service" != "none" ] && ubus call ${service} config_remove "{\"iface\":\"$wdev\"}" - ip link set dev "$wdev" down 2>/dev/null - iw dev "$wdev" del - done -} - -mac80211_interface_cleanup() { - local phy="$1" - local primary_ap=$(uci -q -P /var/state get wireless._${phy}.aplist) - primary_ap=${primary_ap%% *} - - mac80211_vap_cleanup hostapd "${primary_ap}" - mac80211_vap_cleanup wpa_supplicant "$(uci -q -P /var/state get wireless._${phy}.splist)" - mac80211_vap_cleanup none "$(uci -q -P /var/state get wireless._${phy}.umlist)" -} - mac80211_set_noscan() { hostapd_noscan=1 } @@ -1043,6 +986,15 @@ drv_mac80211_cleanup() { hostapd_common_cleanup } +mac80211_reset_config() { + local phy="$1" + + hostapd_conf_file="/var/run/hostapd-$phy.conf" + ubus call hostapd config_set '{ "phy": "'"$phy"'", "config": "", "prev_config": "'"$hostapd_conf_file"'" }' > /dev/null + ubus call wpa_supplicant config_set '{ "phy": "'"$phy"'", "config": [] }' > /dev/null + wdev_tool "$phy" '{}' +} + drv_mac80211_setup() { json_select config json_get_vars \ @@ -1066,30 +1018,11 @@ drv_mac80211_setup() { [ "$band" = "6g" ] && set_default multiple_bssid 1 wireless_set_data phy="$phy" - [ -z "$(uci -q -P /var/state show wireless._${phy})" ] && uci -q -P /var/state set wireless._${phy}=phy - - OLDAPLIST=$(uci -q -P /var/state get wireless._${phy}.aplist) - OLDSPLIST=$(uci -q -P /var/state get wireless._${phy}.splist) - OLDUMLIST=$(uci -q -P /var/state get wireless._${phy}.umlist) local wdev local cwdev local found - for wdev in $(list_phy_interfaces "$phy"); do - found=0 - for cwdev in $OLDAPLIST $OLDSPLIST $OLDUMLIST; do - if [ "$wdev" = "$cwdev" ]; then - found=1 - break - fi - done - if [ "$found" = "0" ]; then - ip link set dev "$wdev" down - iw dev "$wdev" del - fi - done - # convert channel to frequency [ "$auto_channel" -gt 0 ] || freq="$(get_freq "$phy" "$channel" "$band")" @@ -1102,7 +1035,6 @@ drv_mac80211_setup() { hostapd_conf_file="/var/run/hostapd-$phy.conf" - no_ap=1 macidx=0 staidx=0 @@ -1138,81 +1070,45 @@ drv_mac80211_setup() { hostapd_ctrl= ap_ifname= hostapd_noscan= + wpa_supp_init= for_each_interface "ap" mac80211_check_ap - rm -f "$hostapd_conf_file" + mv "$hostapd_conf_file" "$hostapd_conf_file.prev" for_each_interface "sta adhoc mesh" mac80211_set_noscan [ -n "$has_ap" ] && mac80211_hostapd_setup_base "$phy" + local prev + json_set_namespace wdev prev + json_init + json_set_namespace "$prev" + mac80211_prepare_iw_htmode - for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif - NEWAPLIST= - for_each_interface "ap" mac80211_prepare_vif ${multiple_bssid} - NEW_MD5=$(test -e "${hostapd_conf_file}" && md5sum ${hostapd_conf_file}) - OLD_MD5=$(uci -q -P /var/state get wireless._${phy}.md5) - if [ "${NEWAPLIST}" != "${OLDAPLIST}" ]; then - mac80211_vap_cleanup hostapd "${OLDAPLIST}" - fi - [ -n "${NEWAPLIST}" ] && mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap - local add_ap=0 - local primary_ap=${NEWAPLIST%% *} + active_ifnames= + for_each_interface "ap sta adhoc mesh monitor" mac80211_prepare_vif ${multiple_bssid} + for_each_interface "ap sta adhoc mesh monitor" mac80211_setup_vif + + [ -n "$wpa_supp_init" ] && wpa_supplicant_set_config "$phy" + [ -n "$hostapd_ctrl" ] && { - local no_reload=1 - if [ -n "$(ubus list | grep hostapd.$primary_ap)" ]; then - no_reload=0 - [ "${NEW_MD5}" = "${OLD_MD5}" ] || { - ubus call hostapd.$primary_ap reload - no_reload=$? - if [ "$no_reload" != "0" ]; then - mac80211_vap_cleanup hostapd "${OLDAPLIST}" - mac80211_vap_cleanup wpa_supplicant "$(uci -q -P /var/state get wireless._${phy}.splist)" - mac80211_vap_cleanup none "$(uci -q -P /var/state get wireless._${phy}.umlist)" - sleep 2 - mac80211_iw_interface_add "$phy" "${NEWAPLIST%% *}" __ap - for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif - fi - } - fi - if [ "$no_reload" != "0" ]; then - add_ap=1 - ubus wait_for hostapd - local hostapd_res - [ -f /tmp/wifi_fail_test ] || hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")" - ret="$?" - rm -f /tmp/wifi_fail_test - [ "$ret" != 0 -o -z "$hostapd_res" ] && { - logger failed to start wifi trying again - # wireless_setup_failed HOSTAPD_START_FAILED - return - } - wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1 - fi + ubus wait_for hostapd + + local hostapd_res="$(ubus call hostapd config_set "{ \"phy\": \"$phy\", \"config\":\"${hostapd_conf_file}\", \"prev_config\": \"${hostapd_conf_file}.prev\"}")" + ret="$?" + [ "$ret" != 0 -o -z "$hostapd_res" ] && { + wireless_setup_failed HOSTAPD_START_FAILED + return + } + wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1 } - uci -q -P /var/state set wireless._${phy}.aplist="${NEWAPLIST}" - uci -q -P /var/state set wireless._${phy}.md5="${NEW_MD5}" - [ "${add_ap}" = 1 ] && sleep 1 - for_each_interface "ap" mac80211_setup_vif + [ -n "$wpa_supp_init" ] && wpa_supplicant_start "$phy" - NEWSPLIST= - NEWUMLIST= + json_set_namespace wdev prev + wdev_tool "$(json_dump)" $active_ifnames + json_set_namespace "$prev" - for_each_interface "sta adhoc mesh monitor" mac80211_setup_vif - - uci -q -P /var/state set wireless._${phy}.splist="${NEWSPLIST}" - uci -q -P /var/state set wireless._${phy}.umlist="${NEWUMLIST}" - - local foundvap - local dropvap="" - for oldvap in $OLDSPLIST; do - foundvap=0 - for newvap in $NEWSPLIST; do - [ "$oldvap" = "$newvap" ] && foundvap=1 - done - [ "$foundvap" = "0" ] && dropvap="$dropvap $oldvap" - done - [ -n "$dropvap" ] && mac80211_vap_cleanup wpa_supplicant "$dropvap" + for_each_interface "ap sta adhoc mesh monitor" mac80211_set_vif_txpower wireless_set_up } @@ -1243,8 +1139,12 @@ drv_mac80211_teardown() { return 1 } - mac80211_interface_cleanup "$phy" - uci -q -P /var/state revert wireless._${phy} + mac80211_reset_config "$phy" + + for wdev in $(list_phy_interfaces "$phy"); do + ip link set dev "$wdev" down + iw dev "$wdev" del + done } add_driver mac80211