wlan-ap-Telecominfraproject/feeds/qca/hostapd/patches/r04-003-hostapd-Add-mld-link-id-support-for-the-action-frame.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

197 lines
6.7 KiB
Diff

From facc0209fe5eacb9d705a571c816522c184781b8 Mon Sep 17 00:00:00 2001
From: Balamurugan Ramar <quic_bramar@quicinc.com>
Date: Sat, 25 Nov 2023 17:53:56 +0530
Subject: [PATCH] hostapd: Add mld link id support for the action frame
Action frame from hostapd is not sent to the driver if the STA link
is changed. This is because, link id is not sent to the driver
from hostapd. After passing link id to the driver, works fine
Signed-off-by: Balamurugan Ramar <quic_bramar@quicinc.com>
---
src/ap/ap_drv_ops.c | 27 +++++++++++++++++++++------
src/drivers/driver.h | 2 +-
src/drivers/driver_nl80211.c | 24 ++++++++++++++++--------
wpa_supplicant/wpa_supplicant.c | 2 +-
4 files changed, 39 insertions(+), 16 deletions(-)
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 71a566d..cae9cb2 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -868,13 +868,14 @@ int hostapd_drv_send_mlme(struct hostapd_data *hapd,
{
int link_id = -1;
+ if (!hapd->driver || !hapd->driver->send_mlme || !hapd->drv_priv)
+ return 0;
+
#ifdef CONFIG_IEEE80211BE
- if (hapd->conf->mld_ap)
- link_id = hapd->mld_link_id;
+ if (hapd->conf->mld_ap)
+ link_id = hapd->mld_link_id;
#endif /* CONFIG_IEEE80211BE */
- if (!hapd->driver || !hapd->driver->send_mlme || !hapd->drv_priv)
- return 0;
return hapd->driver->send_mlme(hapd->drv_priv, msg, len, noack, 0,
csa_offs, csa_offs_len, no_encrypt, 0,
link_id);
@@ -926,9 +927,16 @@ int hostapd_drv_send_action(struct hostapd_data *hapd, unsigned int freq,
const u8 wildcard_bssid[ETH_ALEN] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
+ int link_id = -1;
if (!hapd->driver || !hapd->driver->send_action || !hapd->drv_priv)
return 0;
+
+#ifdef CONFIG_IEEE80211BE
+ if (hapd->conf->mld_ap)
+ link_id = hapd->mld_link_id;
+#endif /* CONFIG_IEEE80211BE */
+
bssid = hapd->own_addr;
if (!is_multicast_ether_addr(dst) &&
len > 0 && data[0] == WLAN_ACTION_PUBLIC) {
@@ -952,7 +960,7 @@ int hostapd_drv_send_action(struct hostapd_data *hapd, unsigned int freq,
bssid = wildcard_bssid;
}
return hapd->driver->send_action(hapd->drv_priv, freq, wait, dst,
- hapd->own_addr, bssid, data, len, 0);
+ hapd->own_addr, bssid, data, len, 0, link_id);
}
@@ -961,11 +969,18 @@ int hostapd_drv_send_action_addr3_ap(struct hostapd_data *hapd,
unsigned int wait, const u8 *dst,
const u8 *data, size_t len)
{
+ int link_id = -1;
if (hapd->driver == NULL || hapd->driver->send_action == NULL)
return 0;
+
+#ifdef CONFIG_IEEE80211BE
+ if (hapd->conf->mld_ap)
+ link_id = hapd->mld_link_id;
+#endif /* CONFIG_IEEE80211BE */
+
return hapd->driver->send_action(hapd->drv_priv, freq, wait, dst,
hapd->own_addr, hapd->own_addr, data,
- len, 0);
+ len, 0, link_id);
}
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 874a54d..9458784 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -4067,7 +4067,7 @@ struct wpa_driver_ops {
*/
int (*send_action)(void *priv, unsigned int freq, unsigned int wait,
const u8 *dst, const u8 *src, const u8 *bssid,
- const u8 *data, size_t data_len, int no_cck);
+ const u8 *data, size_t data_len, int no_cck, int link);
/**
* send_action_cancel_wait - Cancel action frame TX wait
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index d9d73f5..4e3f1a5 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -168,7 +168,8 @@ static int nl80211_send_frame_cmd(struct i802_bss *bss,
const u8 *buf, size_t buf_len,
int save_cookie,
int no_cck, int no_ack, int offchanok,
- const u16 *csa_offs, size_t csa_offs_len);
+ const u16 *csa_offs, size_t csa_offs_len,
+ int link_id);
static int wpa_driver_nl80211_probe_req_report(struct i802_bss *bss,
int report);
@@ -4353,7 +4354,7 @@ send_frame_cmd:
wpa_printf(MSG_DEBUG, "nl80211: send_mlme -> send_frame_cmd");
res = nl80211_send_frame_cmd(bss, freq, wait_time, data, data_len,
use_cookie, no_cck, noack, offchanok,
- csa_offs, csa_offs_len);
+ csa_offs, csa_offs_len, link_id);
if (!res)
drv->send_frame_link_id = link_id;
@@ -9096,7 +9097,7 @@ static int nl80211_send_frame_cmd(struct i802_bss *bss,
const u8 *buf, size_t buf_len,
int save_cookie, int no_cck, int no_ack,
int offchanok, const u16 *csa_offs,
- size_t csa_offs_len)
+ size_t csa_offs_len, int link_id)
{
struct wpa_driver_nl80211_data *drv = bss->drv;
struct nl_msg *msg;
@@ -9121,6 +9122,13 @@ static int nl80211_send_frame_cmd(struct i802_bss *bss,
nla_put(msg, NL80211_ATTR_FRAME, buf_len, buf))
goto fail;
+#ifdef CONFIG_IEEE80211BE
+ if (link_id != NL80211_DRV_LINK_ID_NA) {
+ if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id))
+ goto fail;
+ }
+#endif
+
cookie = 0;
ret = send_and_recv_msgs(drv, msg, cookie_handler, &cookie, NULL, NULL);
msg = NULL;
@@ -9168,7 +9176,7 @@ static int wpa_driver_nl80211_send_action(struct i802_bss *bss,
const u8 *dst, const u8 *src,
const u8 *bssid,
const u8 *data, size_t data_len,
- int no_cck)
+ int no_cck, int link_id)
{
struct wpa_driver_nl80211_data *drv = bss->drv;
int ret = -1;
@@ -9231,11 +9239,11 @@ static int wpa_driver_nl80211_send_action(struct i802_bss *bss,
!drv->use_monitor))
ret = wpa_driver_nl80211_send_mlme(bss, buf, 24 + data_len,
0, freq, no_cck, offchanok,
- wait_time, NULL, 0, 0, -1);
+ wait_time, NULL, 0, 0, link_id);
else
ret = nl80211_send_frame_cmd(bss, freq, wait_time, buf,
24 + data_len,
- 1, no_cck, 0, offchanok, NULL, 0);
+ 1, no_cck, 0, offchanok, NULL, 0, link_id);
os_free(buf);
return ret;
@@ -10801,11 +10809,11 @@ static int driver_nl80211_send_action(void *priv, unsigned int freq,
const u8 *dst, const u8 *src,
const u8 *bssid,
const u8 *data, size_t data_len,
- int no_cck)
+ int no_cck, int link_id)
{
struct i802_bss *bss = priv;
return wpa_driver_nl80211_send_action(bss, freq, wait_time, dst, src,
- bssid, data, data_len, no_cck);
+ bssid, data, data_len, no_cck, link_id);
}
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index ea6a6eb..67408da 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -9376,5 +9376,5 @@ int wpa_drv_send_action(struct wpa_supplicant *wpa_s, unsigned int freq,
}
return wpa_s->driver->send_action(wpa_s->drv_priv, freq, wait, dst, src,
- bssid, data, data_len, no_cck);
+ bssid, data, data_len, no_cck, -1);
}
--
2.17.1