wlan-ap-Telecominfraproject/feeds/qca/hostapd/patches/r02-020-hostapd-process-nl80211-stop-AP-events-on-link-basis.patch
John Crispin 008ca9618d
Some checks failed
Build OpenWrt/uCentral images / build (cig_wf186h) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf186w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf188n) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf189) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cig_wf196) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-a1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (cybertan_eww631-b1) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap102) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap104) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap105) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap111) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_eap112) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (edgecore_oap101e-6e) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_3) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4x_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xe) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi) (push) Has been cancelled
Build OpenWrt/uCentral images / build (hfcl_ion4xi_w) (push) Has been cancelled
Build OpenWrt/uCentral images / build (indio_um-305ax) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sercomm_ap72tip) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630c-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-211g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (sonicfi_rap630w-311g) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-id2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (udaya_a6-od2) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr5018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018) (push) Has been cancelled
Build OpenWrt/uCentral images / build (wallys_dr6018-v4) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax820) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_ax840) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap640) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap650) (push) Has been cancelled
Build OpenWrt/uCentral images / build (yuncore_fap655) (push) Has been cancelled
Build OpenWrt/uCentral images / trigger-testing (push) Has been cancelled
Build OpenWrt/uCentral images / create-x64_vm-ami (push) Has been cancelled
ipq95xx: import ath12.4-cs kernel and drivers
Signed-off-by: John Crispin <john@phrozen.org>
2024-10-20 09:25:13 +02:00

102 lines
3.4 KiB
Diff

From 2aeba574badedc8237e67579bec000c2ee41f97f Mon Sep 17 00:00:00 2001
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
Date: Tue, 21 Nov 2023 10:56:18 +0530
Subject: [PATCH 1/2] hostapd: process nl80211 stop AP events on link basis
Currently, stop AP events are processed on the first BSS in drv
always. However, with multi-link operation, the event will have
link ID attribute which is not used and still it is passed to
first BSS which is wrong. It can be used to properly route
the event to intended BSS.
Also, there is a need to update bss->links[] state once a link
is removed so that later it can be added back.
Add support for the same.
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
src/drivers/driver_nl80211.c | 3 +--
src/drivers/driver_nl80211.h | 1 +
src/drivers/driver_nl80211_event.c | 33 ++++++++++++++++++++++++++----
3 files changed, 31 insertions(+), 6 deletions(-)
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -197,7 +197,6 @@ static int nl80211_put_mesh_config(struc
static int i802_sta_disassoc(void *priv, const u8 *own_addr, const u8 *addr,
u16 reason);
-static int nl80211_remove_link(struct i802_bss *bss, int link_id);
static void nl80211_remove_links(struct i802_bss *bss);
/* Converts nl80211_chan_width to a common format */
@@ -9500,7 +9499,7 @@ fail:
return -1;
}
-static int nl80211_remove_link(struct i802_bss *bss, int link_id)
+int nl80211_remove_link(struct i802_bss *bss, int link_id)
{
struct wpa_driver_nl80211_data *drv = bss->drv;
struct i802_link *link = NULL;
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
@@ -372,5 +372,6 @@ int wpa_driver_set_phyname(struct wpa_dr
struct hostapd_multi_hw_info *
nl80211_get_multi_hw_info(void *priv, u8 *num_multi_hws);
bool nl80211_link_valid(struct i802_bss *bss, s8 link_id);
+int nl80211_remove_link(struct i802_bss *bss, int link_id);
#endif /* DRIVER_NL80211_H */
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -2399,10 +2399,35 @@ static void nl80211_tdls_oper_event(stru
}
-static void nl80211_stop_ap(struct wpa_driver_nl80211_data *drv,
- struct nlattr **tb)
+static void nl80211_stop_ap(struct i802_bss *bss, struct nlattr **tb)
{
- wpa_supplicant_event(drv->ctx, EVENT_INTERFACE_UNAVAILABLE, NULL);
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+ struct i802_link *mld_link = NULL;
+ void *ctx = bss->ctx;
+ int link_id = -1;
+
+ if (tb[NL80211_ATTR_MLO_LINK_ID]) {
+ link_id = nla_get_u8(tb[NL80211_ATTR_MLO_LINK_ID]);
+ mld_link = nl80211_get_link_or_null(bss, link_id);
+ if (!mld_link) {
+ wpa_printf(MSG_DEBUG,
+ "nl80211: Ignoring STOP_AP event on invalid link id %d",
+ link_id);
+ return;
+ }
+
+ wpa_printf(MSG_DEBUG,
+ "nl80211: STOP_AP event on link %d", link_id);
+ ctx = mld_link->ctx;
+ }
+
+ /* driver would have already deleted the link hence ret would be non-zero.
+ * Ignore that since nl80211_remove_link() is called only to update the
+ * bss->links[] state
+ */
+ nl80211_remove_link(bss, mld_link ? mld_link->link_id : bss->flink->link_id);
+
+ wpa_supplicant_event(ctx, EVENT_INTERFACE_UNAVAILABLE, NULL);
}
@@ -4250,7 +4275,7 @@ static void do_process_drv_event(struct
nl80211_radar_event(bss, tb);
break;
case NL80211_CMD_STOP_AP:
- nl80211_stop_ap(drv, tb);
+ nl80211_stop_ap(bss, tb);
break;
case NL80211_CMD_VENDOR:
nl80211_vendor_event(drv, tb);