From: Ilan Peer <ilan.peer@xxxxxxxxx> 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@xxxxxxxxx> --- 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 d943062feb..4781537d2d 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 88ee9e724a..f77a4fb115 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -1461,7 +1461,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 b2d195ca75..9320fa816b 100644 --- a/wpa_supplicant/nan_usd.c +++ b/wpa_supplicant/nan_usd.c @@ -275,7 +275,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); } @@ -293,7 +293,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); } @@ -324,7 +324,8 @@ static void wpas_nan_process_p2p_usd_elems(void *ctx, const u8 *buf, 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; @@ -371,7 +372,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); } @@ -398,7 +399,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), @@ -417,7 +418,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); } @@ -430,7 +431,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; @@ -471,7 +473,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), @@ -491,7 +493,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 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap