[PATCH 2/8] nl80211: Add SPP A-MSDU driver capability
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Tue Jan 7 04:51:43 PST 2025
From: Daniel Gabay <daniel.gabay at intel.com>
cfg80211 introduced a new device capability, add a new driver
capability and station flag.
In addition, since mac80211_hwsim does not implement this feature in
offload mode, make sure to disable it when force_connect_cmd is set.
Signed-off-by: Daniel Gabay <daniel.gabay at intel.com>
---
src/drivers/driver.h | 3 +++
src/drivers/driver_nl80211.c | 14 ++++++++++++--
src/drivers/driver_nl80211_capa.c | 4 ++++
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index de2b1de097..fb6b69ef43 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2373,6 +2373,8 @@ struct wpa_driver_capa {
#define WPA_DRIVER_FLAGS2_RSN_OVERRIDE_STA 0x0000000000400000ULL
/** Driver supports NAN offload */
#define WPA_DRIVER_FLAGS2_NAN_OFFLOAD 0x0000000000800000ULL
+/** Driver/device supports SPP A-MSDUs */
+#define WPA_DRIVER_FLAGS2_SPP_AMSDU 0x0000000001000000ULL
u64 flags2;
#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
@@ -2651,6 +2653,7 @@ struct wpa_bss_params {
#define WPA_STA_TDLS_PEER BIT(4)
#define WPA_STA_AUTHENTICATED BIT(5)
#define WPA_STA_ASSOCIATED BIT(6)
+#define WPA_STA_SPP_AMSDU BIT(7)
enum tdls_oper {
TDLS_DISCOVERY_REQ,
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index c139cfef21..0e897f25ba 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -5636,6 +5636,8 @@ static u32 sta_flags_nl80211(int flags)
f |= BIT(NL80211_STA_FLAG_AUTHENTICATED);
if (flags & WPA_STA_ASSOCIATED)
f |= BIT(NL80211_STA_FLAG_ASSOCIATED);
+ if (flags & WPA_STA_SPP_AMSDU)
+ f |= BIT(NL80211_STA_FLAG_SPP_AMSDU);
return f;
}
@@ -10080,6 +10082,11 @@ static int nl80211_set_param(void *priv, const char *param)
if (os_strstr(param, "force_connect_cmd=1")) {
drv->capa.flags &= ~WPA_DRIVER_FLAGS_SME;
drv->force_connect_cmd = 1;
+ /*
+ * mac80211_hwsim does not implement SPP A-MSDU in
+ * offload mode.
+ */
+ drv->capa.flags2 &= ~WPA_DRIVER_FLAGS2_SPP_AMSDU;
}
if (os_strstr(param, "force_bss_selection=1"))
@@ -11389,7 +11396,8 @@ static int wpa_driver_nl80211_status(void *priv, char *buf, size_t buflen)
"capa.max_sched_scan_plan_iterations=%u\n"
"capa.mbssid_max_interfaces=%u\n"
"capa.ema_max_periodicity=%u\n"
- "capa.max_probe_req_ie_len=%zu\n",
+ "capa.max_probe_req_ie_len=%zu\n"
+ "capa.flags2.spp_amsdu=%u\n",
drv->capa.key_mgmt,
drv->capa.enc,
drv->capa.auth,
@@ -11415,7 +11423,9 @@ static int wpa_driver_nl80211_status(void *priv, char *buf, size_t buflen)
drv->capa.max_sched_scan_plan_iterations,
drv->capa.mbssid_max_interfaces,
drv->capa.ema_max_periodicity,
- drv->capa.max_probe_req_ie_len);
+ drv->capa.max_probe_req_ie_len,
+ !!(drv->capa.flags2 &
+ WPA_DRIVER_FLAGS2_SPP_AMSDU));
if (os_snprintf_error(end - pos, res))
return pos - buf;
pos += res;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 08a8552a10..72be7d103f 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -720,6 +720,10 @@ static void wiphy_info_ext_feature_flags(struct wiphy_info_data *info,
if (ext_feature_isset(ext_features, len,
NL80211_EXT_FEATURE_SAE_OFFLOAD_AP))
capa->flags2 |= WPA_DRIVER_FLAGS2_SAE_OFFLOAD_AP;
+
+ if (ext_feature_isset(ext_features, len,
+ NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT))
+ capa->flags2 |= WPA_DRIVER_FLAGS2_SPP_AMSDU;
}
--
2.43.0
More information about the Hostap
mailing list