]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
USD: Rename WPA_DRIVER_FLAGS2_NAN_OFFLOAD
authorIlan Peer <ilan.peer@intel.com>
Tue, 23 Dec 2025 11:45:51 +0000 (13:45 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 29 Jan 2026 10:31:55 +0000 (12:31 +0200)
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@intel.com>
src/drivers/driver.h
src/drivers/driver_nl80211_capa.c
wpa_supplicant/nan_usd.c

index 69f1158f4abcab00ef49c725673bf5be1c2060bb..cc19a986191764e7368c0f5b62c550aa6319db86 100644 (file)
@@ -2417,8 +2417,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 */
index aed2774dce69a439c0d5fae60688565d8f22b1f5..7a2e80b624cdb64fac9304e295fa20c05df5f22e 100644 (file)
@@ -1467,7 +1467,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;
index ed7929206ab503b2c24e9ca92d23e878b091ee12..e4c448f6bd631aa61adf526f05dd87bbe7c06362 100644 (file)
@@ -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;
@@ -492,7 +494,7 @@ int wpas_nan_usd_unpause_publish(struct wpa_supplicant *wpa_s, int publish_id,
 
 static int wpas_nan_stop_listen(struct wpa_supplicant *wpa_s, int id)
 {
-       if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_OFFLOAD)
+       if (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_NAN_USD_OFFLOAD)
                return 0;
 
        if (nan_de_stop_listen(wpa_s->nan_de, id) < 0)
@@ -558,7 +560,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),
@@ -578,7 +580,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);
 }