[PATCH 02/35] USD: Rename WPA_DRIVER_FLAGS2_NAN_OFFLOAD
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Mon Oct 20 05:27:37 PDT 2025
From: Ilan Peer <ilan.peer at intel.com>
Rename WPA_DRIVER_FLAGS2_NAN_OFFLOAD to WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD
as this is currently used to mean the NAN USD offload is supported (QCA).
Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
src/drivers/driver.h | 4 ++--
src/drivers/driver_nl80211_capa.c | 2 +-
wpa_supplicant/nan_usd.c | 20 +++++++++++---------
3 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 9edd569d71..5d9fe82e73 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2414,8 +2414,8 @@ struct wpa_driver_capa {
#define WPA_DRIVER_FLAGS2_HT_VHT_TWT_RESPONDER 0x0000000000200000ULL
/** Driver supports RSN override elements */
#define WPA_DRIVER_FLAGS2_RSN_OVERRIDE_STA 0x0000000000400000ULL
-/** Driver supports NAN offload */
-#define WPA_DRIVER_FLAGS2_NAN_OFFLOAD 0x0000000000800000ULL
+/** Driver supports NAN USD offload */
+#define WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD 0x0000000000800000ULL
/** Driver/device supports SPP A-MSDUs */
#define WPA_DRIVER_FLAGS2_SPP_AMSDU 0x0000000001000000ULL
/** Driver supports P2P V2 */
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 2aba1f9a42..d11cd5ed63 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1463,7 +1463,7 @@ static void qca_nl80211_get_features(struct wpa_driver_nl80211_data *drv)
drv->capa.flags2 |= WPA_DRIVER_FLAGS2_RSN_OVERRIDE_STA;
}
if (check_feature(QCA_WLAN_VENDOR_FEATURE_NAN_USD_OFFLOAD, &info))
- drv->capa.flags2 |= WPA_DRIVER_FLAGS2_NAN_OFFLOAD;
+ drv->capa.flags2 |= WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD;
if (check_feature(QCA_WLAN_VENDOR_FEATURE_P2P_V2, &info))
drv->capa.flags2 |= WPA_DRIVER_FLAGS2_P2P_FEATURE_V2;
diff --git a/wpa_supplicant/nan_usd.c b/wpa_supplicant/nan_usd.c
index b8eb4c41b7..ccec2ac286 100644
--- a/wpa_supplicant/nan_usd.c
+++ b/wpa_supplicant/nan_usd.c
@@ -293,7 +293,7 @@ static void wpas_nan_usd_offload_cancel_publish(void *ctx, int publish_id)
{
struct wpa_supplicant *wpa_s = ctx;
- if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_OFFLOAD)
+ if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD)
wpas_drv_nan_cancel_publish(wpa_s, publish_id);
}
@@ -311,7 +311,7 @@ static void wpas_nan_usd_offload_cancel_subscribe(void *ctx, int subscribe_id)
{
struct wpa_supplicant *wpa_s = ctx;
- if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_OFFLOAD)
+ if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD)
wpas_drv_nan_cancel_subscribe(wpa_s, subscribe_id);
}
@@ -354,7 +354,8 @@ static void wpas_nan_process_pr_usd_elems(void *ctx, const u8 *buf, u16 buf_len,
int wpas_nan_usd_init(struct wpa_supplicant *wpa_s)
{
struct nan_callbacks cb;
- bool offload = wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_OFFLOAD;
+ bool offload = !!(wpa_s->drv_flags2 &
+ WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD);
os_memset(&cb, 0, sizeof(cb));
cb.ctx = wpa_s;
@@ -406,7 +407,7 @@ void wpas_nan_usd_flush(struct wpa_supplicant *wpa_s)
if (!wpa_s->nan_de)
return;
nan_de_flush(wpa_s->nan_de);
- if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_OFFLOAD)
+ if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD)
wpas_drv_nan_flush(wpa_s);
}
@@ -441,7 +442,7 @@ int wpas_nan_usd_publish(struct wpa_supplicant *wpa_s, const char *service_name,
publish_id = nan_de_publish(wpa_s->nan_de, service_name, srv_proto_type,
ssi, elems, params, p2p);
if (publish_id >= 1 &&
- (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_OFFLOAD) &&
+ (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD) &&
wpas_drv_nan_publish(wpa_s, addr, publish_id, service_name,
nan_de_get_service_id(wpa_s->nan_de,
publish_id),
@@ -460,7 +461,7 @@ void wpas_nan_usd_cancel_publish(struct wpa_supplicant *wpa_s, int publish_id)
if (!wpa_s->nan_de)
return;
nan_de_cancel_publish(wpa_s->nan_de, publish_id);
- if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_OFFLOAD)
+ if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD)
wpas_drv_nan_cancel_publish(wpa_s, publish_id);
}
@@ -473,7 +474,8 @@ int wpas_nan_usd_update_publish(struct wpa_supplicant *wpa_s, int publish_id,
if (!wpa_s->nan_de)
return -1;
ret = nan_de_update_publish(wpa_s->nan_de, publish_id, ssi);
- if (ret == 0 && (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_OFFLOAD) &&
+ if (ret == 0 && (wpa_s->drv_flags2 &
+ WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD) &&
wpas_drv_nan_update_publish(wpa_s, publish_id, ssi) < 0)
return -1;
return ret;
@@ -522,7 +524,7 @@ int wpas_nan_usd_subscribe(struct wpa_supplicant *wpa_s,
srv_proto_type, ssi, elems, params,
p2p);
if (subscribe_id >= 1 &&
- (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_OFFLOAD) &&
+ (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD) &&
wpas_drv_nan_subscribe(wpa_s, addr, subscribe_id, service_name,
nan_de_get_service_id(wpa_s->nan_de,
subscribe_id),
@@ -542,7 +544,7 @@ void wpas_nan_usd_cancel_subscribe(struct wpa_supplicant *wpa_s,
if (!wpa_s->nan_de)
return;
nan_de_cancel_subscribe(wpa_s->nan_de, subscribe_id);
- if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_OFFLOAD)
+ if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD)
wpas_drv_nan_cancel_subscribe(wpa_s, subscribe_id);
}
--
2.49.0
More information about the Hostap
mailing list