From f397c7aba207c7a1f69f6430aa6b9534139dbc45 Mon Sep 17 00:00:00 2001 From: Chaitanya Tata Date: Wed, 2 Aug 2023 19:34:42 +0530 Subject: [PATCH] [nrf fromlist] Add WNM feature flag Protects WNM code in case the DUT doesn't support it yet. Upstream-Pr: https://github.com/Wi-FiQuickTrack/Wi-FiQuickTrack-ControlAppC/pull/5 Signed-off-by: Triveni Danda --- Makefile | 2 +- indigo_api_callback.h | 4 ++++ indigo_api_callback_dut.c | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5a60828..258f271 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ endif # Feature flags # Enable by default -CFLAGS += -DCONFIG_P2P +CFLAGS += -DCONFIG_P2P -DCONFIG_WNM # Define the package version ifneq ($(VERSION),) diff --git a/indigo_api_callback.h b/indigo_api_callback.h index cd82bb7..ca53f19 100644 --- a/indigo_api_callback.h +++ b/indigo_api_callback.h @@ -249,7 +249,9 @@ static int configure_ap_handler(struct packet_wrapper *req, struct packet_wrappe static int start_ap_handler(struct packet_wrapper *req, struct packet_wrapper *resp); static int send_ap_disconnect_handler(struct packet_wrapper *req, struct packet_wrapper *resp); static int set_ap_parameter_handler(struct packet_wrapper *req, struct packet_wrapper *resp); +#ifdef CONFIG_WNM static int send_ap_btm_handler(struct packet_wrapper *req, struct packet_wrapper *resp); +#endif /* End Of CONFIG_WNM */ static int trigger_ap_channel_switch(struct packet_wrapper *req, struct packet_wrapper *resp); static int start_wps_ap_handler(struct packet_wrapper *req, struct packet_wrapper *resp); static int configure_ap_wsc_handler(struct packet_wrapper *req, struct packet_wrapper *resp); @@ -259,7 +261,9 @@ static int configure_sta_handler(struct packet_wrapper *req, struct packet_wrapp static int associate_sta_handler(struct packet_wrapper *req, struct packet_wrapper *resp); static int send_sta_disconnect_handler(struct packet_wrapper *req, struct packet_wrapper *resp); static int send_sta_reconnect_handler(struct packet_wrapper *req, struct packet_wrapper *resp); +#ifdef CONFIG_WNM static int send_sta_btm_query_handler(struct packet_wrapper *req, struct packet_wrapper *resp); +#endif /* End Of CONFIG_WNM */ static int send_sta_anqp_query_handler(struct packet_wrapper *req, struct packet_wrapper *resp); static int sta_scan_handler(struct packet_wrapper *req, struct packet_wrapper *resp); static int set_sta_parameter_handler(struct packet_wrapper *req, struct packet_wrapper *resp); diff --git a/indigo_api_callback_dut.c b/indigo_api_callback_dut.c index ef91397..2c954e9 100644 --- a/indigo_api_callback_dut.c +++ b/indigo_api_callback_dut.c @@ -56,7 +56,9 @@ void register_apis() { register_api(API_AP_TRIGGER_CHANSWITCH, NULL, trigger_ap_channel_switch); register_api(API_AP_SEND_DISCONNECT, NULL, send_ap_disconnect_handler); register_api(API_AP_SET_PARAM , NULL, set_ap_parameter_handler); +#ifdef CONFIG_WNM register_api(API_AP_SEND_BTM_REQ, NULL, send_ap_btm_handler); +#endif /* End Of CONFIG_WNM */ register_api(API_AP_START_WPS, NULL, start_wps_ap_handler); register_api(API_AP_CONFIGURE_WSC, NULL, configure_ap_wsc_handler); /* STA */ @@ -66,7 +68,9 @@ void register_apis() { register_api(API_STA_SEND_DISCONNECT, NULL, send_sta_disconnect_handler); register_api(API_STA_REASSOCIATE, NULL, send_sta_reconnect_handler); register_api(API_STA_SET_PARAM, NULL, set_sta_parameter_handler); +#ifdef CONFIG_WNM register_api(API_STA_SEND_BTM_QUERY, NULL, send_sta_btm_query_handler); +#endif /* End Of CONFIG_WNM */ register_api(API_STA_SEND_ANQP_QUERY, NULL, send_sta_anqp_query_handler); register_api(API_STA_SCAN, NULL, sta_scan_handler); register_api(API_STA_START_WPS, NULL, start_wps_sta_handler); @@ -1545,6 +1549,7 @@ static int set_ap_parameter_handler(struct packet_wrapper *req, struct packet_wr return 0; } +#ifdef CONFIG_WNM static int send_ap_btm_handler(struct packet_wrapper *req, struct packet_wrapper *resp) { int status = TLV_VALUE_STATUS_NOT_OK; size_t resp_len; @@ -1677,6 +1682,7 @@ static int send_ap_btm_handler(struct packet_wrapper *req, struct packet_wrapper } return 0; } +#endif /* End Of CONFIG_WNM */ static int trigger_ap_channel_switch(struct packet_wrapper *req, struct packet_wrapper *resp) { int status = TLV_VALUE_STATUS_NOT_OK; @@ -2172,6 +2178,7 @@ static int set_sta_parameter_handler(struct packet_wrapper *req, struct packet_w return 0; } +#ifdef CONFIG_WNM static int send_sta_btm_query_handler(struct packet_wrapper *req, struct packet_wrapper *resp) { int status = TLV_VALUE_STATUS_NOT_OK; size_t resp_len; @@ -2231,6 +2238,7 @@ static int send_sta_btm_query_handler(struct packet_wrapper *req, struct packet_ } return 0; } +#endif /* End Of CONFIG_WNM */ static int send_sta_anqp_query_handler(struct packet_wrapper *req, struct packet_wrapper *resp) { int len, status = TLV_VALUE_STATUS_NOT_OK;