From 9a6e41adb843a2a107af769059c634846659d6ae Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 14 Sep 2023 13:40:27 +0200 Subject: [PATCH] hostapd: fix ucode reload issues Signed-off-by: Felix Fietkau --- ...d-frequency-info-in-start-AP-command.patch | 43 +++++++++++++++++++ ...ix-setting-QoS-map-on-secondary-BSSs.patch | 20 +++++++++ ...pdate-drv-ifindex-on-removing-the-fi.patch | 18 ++++++++ 3 files changed, 81 insertions(+) create mode 100644 feeds/wifi-ax/hostapd/patches/040-nl80211-Add-frequency-info-in-start-AP-command.patch create mode 100644 feeds/wifi-ax/hostapd/patches/041-driver_nl80211-fix-setting-QoS-map-on-secondary-BSSs.patch create mode 100644 feeds/wifi-ax/hostapd/patches/042-driver_nl80211-update-drv-ifindex-on-removing-the-fi.patch diff --git a/feeds/wifi-ax/hostapd/patches/040-nl80211-Add-frequency-info-in-start-AP-command.patch b/feeds/wifi-ax/hostapd/patches/040-nl80211-Add-frequency-info-in-start-AP-command.patch new file mode 100644 index 000000000..ebe0ef12a --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/040-nl80211-Add-frequency-info-in-start-AP-command.patch @@ -0,0 +1,43 @@ +From: Harshitha Prem +Date: Wed, 22 Feb 2023 09:29:01 +0530 +Subject: [PATCH] nl80211: Add frequency info in start AP command + +When ACS is configured in multiple BSS case, sometimes a virtual AP +interface does not come up as the channel context information between +different BSSs of the same band does not match. + +Same behavior is observed in case of multiple band/hardware under a +single wiphy, when we bring up multiple virtual interface in various +bands simultaneously and the kernel maps a random channel as it has more +than one channel context, e.g., say a 2.4 GHz channel to a 5 GHz virtual +AP interface when the start AP command is sent. This is because the +frequency information is not present in the command. + +Add the frequency information into the start AP netlink command so that +the kernel maps the appropriate channel context by parsing it instead of +using a previous set channel information. + +Signed-off-by: Harshitha Prem +--- + +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -167,6 +167,8 @@ static int nl80211_send_frame_cmd(struct + const u16 *csa_offs, size_t csa_offs_len); + static int wpa_driver_nl80211_probe_req_report(struct i802_bss *bss, + int report); ++static int nl80211_put_freq_params(struct nl_msg *msg, ++ const struct hostapd_freq_params *freq); + + #define IFIDX_ANY -1 + +@@ -4717,6 +4719,9 @@ static int wpa_driver_nl80211_set_ap(voi + nla_nest_end(msg, spr); + } + ++ if (params->freq && nl80211_put_freq_params(msg, params->freq) < 0) ++ goto fail; ++ + if (params->freq && params->freq->he_enabled) { + struct nlattr *bss_color; + diff --git a/feeds/wifi-ax/hostapd/patches/041-driver_nl80211-fix-setting-QoS-map-on-secondary-BSSs.patch b/feeds/wifi-ax/hostapd/patches/041-driver_nl80211-fix-setting-QoS-map-on-secondary-BSSs.patch new file mode 100644 index 000000000..f30159840 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/041-driver_nl80211-fix-setting-QoS-map-on-secondary-BSSs.patch @@ -0,0 +1,20 @@ +From: Felix Fietkau +Date: Thu, 14 Sep 2023 10:53:50 +0200 +Subject: [PATCH] driver_nl80211: fix setting QoS map on secondary BSSs + +The setting is per-BSS, not per PHY + +Signed-off-by: Felix Fietkau +--- + +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -10045,7 +10045,7 @@ static int nl80211_set_qos_map(void *pri + wpa_hexdump(MSG_DEBUG, "nl80211: Setting QoS Map", + qos_map_set, qos_map_set_len); + +- if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_SET_QOS_MAP)) || ++ if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_QOS_MAP)) || + nla_put(msg, NL80211_ATTR_QOS_MAP, qos_map_set_len, qos_map_set)) { + nlmsg_free(msg); + return -ENOBUFS; diff --git a/feeds/wifi-ax/hostapd/patches/042-driver_nl80211-update-drv-ifindex-on-removing-the-fi.patch b/feeds/wifi-ax/hostapd/patches/042-driver_nl80211-update-drv-ifindex-on-removing-the-fi.patch new file mode 100644 index 000000000..a1a5b2821 --- /dev/null +++ b/feeds/wifi-ax/hostapd/patches/042-driver_nl80211-update-drv-ifindex-on-removing-the-fi.patch @@ -0,0 +1,18 @@ +From: Felix Fietkau +Date: Thu, 14 Sep 2023 11:28:03 +0200 +Subject: [PATCH] driver_nl80211: update drv->ifindex on removing the first + BSS + +Signed-off-by: Felix Fietkau +--- + +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -8003,6 +8003,7 @@ static int wpa_driver_nl80211_if_remove( + if (drv->first_bss->next) { + drv->first_bss = drv->first_bss->next; + drv->ctx = drv->first_bss->ctx; ++ drv->ifindex = drv->first_bss->ifindex; + os_free(bss); + } else { + wpa_printf(MSG_DEBUG, "nl80211: No second BSS to reassign context to");