Skip to content

Commit

Permalink
[nrf fromlist] Add WNM feature flag
Browse files Browse the repository at this point in the history
Protects WNM code in case the DUT doesn't support it yet.

Upstream-Pr: Wi-FiQuickTrack/Wi-FiQuickTrack-ControlAppC#5

Signed-off-by: Triveni Danda <[email protected]>
  • Loading branch information
krish2718 committed Aug 2, 2023
1 parent 4f8cf56 commit f397c7a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ endif

# Feature flags
# Enable by default
CFLAGS += -DCONFIG_P2P
CFLAGS += -DCONFIG_P2P -DCONFIG_WNM

# Define the package version
ifneq ($(VERSION),)
Expand Down
4 changes: 4 additions & 0 deletions indigo_api_callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions indigo_api_callback_dut.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f397c7a

Please sign in to comment.