Skip to content

Commit 3053484

Browse files
ajayparidadleach02
authored andcommitted
net: mgmt: Update app of TWT teardown status
Update user/app status of TWT teardown sessions. Signed-off-by: Ajay Parida <[email protected]>
1 parent 62c8b06 commit 3053484

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

include/zephyr/net/wifi.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,14 @@ enum wifi_twt_fail_reason {
345345
WIFI_TWT_FAIL_FLOW_ALREADY_EXISTS,
346346
};
347347

348+
/** Wi-Fi Target Wake Time (TWT) teradown status. */
349+
enum wifi_twt_teardown_status {
350+
/** TWT teardown success */
351+
WIFI_TWT_TEARDOWN_SUCCESS = 0,
352+
/** TWT teardown failure */
353+
WIFI_TWT_TEARDOWN_FAILED,
354+
};
355+
348356
/** @cond INTERNAL_HIDDEN */
349357
static const char * const wifi_twt_err_code_tbl[] = {
350358
[WIFI_TWT_FAIL_UNSPECIFIED] = "Unspecified",

include/zephyr/net/wifi_mgmt.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ struct wifi_twt_params {
470470
enum wifi_twt_setup_cmd setup_cmd;
471471
/** TWT setup response status, see enum wifi_twt_setup_resp_status */
472472
enum wifi_twt_setup_resp_status resp_status;
473+
/** TWT teardown cmd status, see enum wifi_twt_teardown_status */
474+
enum wifi_twt_teardown_status teardown_status;
473475
/** Dialog token, used to map requests to responses */
474476
uint8_t dialog_token;
475477
/** Flow ID, used to map setup with teardown */

subsys/net/l2/wifi/wifi_shell.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,13 @@ static void handle_wifi_twt_event(struct net_mgmt_event_callback *cb)
290290
(const struct wifi_twt_params *)cb->info;
291291

292292
if (resp->operation == WIFI_TWT_TEARDOWN) {
293-
print(context.sh, SHELL_NORMAL, "TWT teardown received for flow ID %d\n",
294-
resp->flow_id);
293+
if (resp->teardown_status == WIFI_TWT_TEARDOWN_SUCCESS) {
294+
print(context.sh, SHELL_NORMAL, "TWT teardown received for flow ID %d\n",
295+
resp->flow_id);
296+
} else {
297+
print(context.sh, SHELL_NORMAL, "TWT teardown failed for flow ID %d\n",
298+
resp->flow_id);
299+
}
295300
return;
296301
}
297302

0 commit comments

Comments
 (0)