From 2af6b3c1b2a2cf3867a82a1b15e10ac19f3a5eb8 Mon Sep 17 00:00:00 2001 From: Jyoti Kumari Date: Thu, 22 Jul 2021 13:55:53 +0530 Subject: [PATCH] qcacld-3.0: Reset twt active command if ack fail Reset twt active command if ack fails due to firmware internal error. Change-Id: Ic980314261ab4f6deb437b36e525ea59c286eee2 CRs-Fixed: 2997509 --- .../dispatcher/inc/wlan_mlme_twt_ucfg_api.h | 27 ++++++++++++------- .../dispatcher/src/wlan_mlme_twt_ucfg_api.c | 7 +++-- core/hdd/src/wlan_hdd_twt.c | 14 ++++++---- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/components/mlme/dispatcher/inc/wlan_mlme_twt_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_twt_ucfg_api.h index 8f28d643c880..8afc8abfef01 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_twt_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_twt_ucfg_api.h @@ -220,19 +220,18 @@ QDF_STATUS ucfg_mlme_set_twt_responder_flag(struct wlan_objmgr_psoc *psoc, bool val); /** - * ucfg_mlme_reset_twt_init_context() - Reset twt init if ack fail - * This is to handle back to back command. If ack failed for previous - * command and again new commad comes then init context should reset to - * allow new command. + * ucfg_mlme_reset_twt_active_cmd() - Reset twt active cmd if ack fail + * This is to handle back to back command. If ack failed for active + * command then reset this command to allow new twt command. * @psoc: pointer to psoc object * @peer_mac: peer mac address * @dialog_id: dialog id * * Return: QDF Status */ -QDF_STATUS ucfg_mlme_reset_twt_init_context(struct wlan_objmgr_psoc *psoc, - struct qdf_mac_addr *peer_mac, - uint8_t dialog_id); +QDF_STATUS ucfg_mlme_reset_twt_active_cmd(struct wlan_objmgr_psoc *psoc, + struct qdf_mac_addr *peer_mac, + uint8_t dialog_id); /** * ucfg_mlme_is_twt_setup_in_progress() - Get TWT setup in progress for @@ -640,9 +639,9 @@ ucfg_mlme_set_twt_responder_flag(struct wlan_objmgr_psoc *psoc, } static inline QDF_STATUS -ucfg_mlme_reset_twt_init_context(struct wlan_objmgr_psoc *psoc, - struct qdf_mac_addr *peer_mac, - uint8_t dialog_id) +ucfg_mlme_reset_twt_reset_cmd(struct wlan_objmgr_psoc *psoc, + struct qdf_mac_addr *peer_mac, + uint8_t dialog_id) { return QDF_STATUS_E_NOSUPPORT; } @@ -728,5 +727,13 @@ ucfg_mlme_get_twt_session_state(struct wlan_objmgr_psoc *psoc, return WLAN_TWT_SETUP_STATE_NOT_ESTABLISHED; } +static inline QDF_STATUS +ucfg_mlme_reset_twt_active_cmd(struct wlan_objmgr_psoc *psoc, + struct qdf_mac_addr *peer_mac, + uint8_t dialog_id) +{ + return QDF_STATUS_E_NOSUPPORT; +} + #endif /* defined(WLAN_SUPPORT_TWT) && defined(WLAN_FEATURE_11AX) */ #endif /* _WLAN_MLME_TWT_UCFG_API_H_ */ diff --git a/components/mlme/dispatcher/src/wlan_mlme_twt_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_twt_ucfg_api.c index 57f6b9785a35..205917d48dcd 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_twt_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_twt_ucfg_api.c @@ -118,13 +118,12 @@ ucfg_mlme_set_twt_responder_flag(struct wlan_objmgr_psoc *psoc, bool val) } QDF_STATUS -ucfg_mlme_reset_twt_init_context(struct wlan_objmgr_psoc *psoc, - struct qdf_mac_addr *peer_macaddr, - uint8_t dialog_id) +ucfg_mlme_reset_twt_active_cmd(struct wlan_objmgr_psoc *psoc, + struct qdf_mac_addr *peer_macaddr, + uint8_t dialog_id) { mlme_set_twt_command_in_progress(psoc, peer_macaddr, dialog_id, WLAN_TWT_NONE); - mlme_init_twt_context(psoc, peer_macaddr, dialog_id); return QDF_STATUS_SUCCESS; } diff --git a/core/hdd/src/wlan_hdd_twt.c b/core/hdd/src/wlan_hdd_twt.c index dfb9995e643d..610c390de787 100644 --- a/core/hdd/src/wlan_hdd_twt.c +++ b/core/hdd/src/wlan_hdd_twt.c @@ -1714,7 +1714,11 @@ int hdd_send_twt_add_dialog_cmd(struct hdd_context *hdd_ctx, ack_priv = osif_request_priv(request); if (ack_priv->status) { hdd_err("Received TWT ack error. Reset twt command"); - ucfg_mlme_reset_twt_init_context( + ucfg_mlme_reset_twt_active_cmd( + hdd_ctx->psoc, + (struct qdf_mac_addr *)twt_params->peer_macaddr, + twt_params->dialog_id); + ucfg_mlme_init_twt_context( hdd_ctx->psoc, (struct qdf_mac_addr *)twt_params->peer_macaddr, twt_params->dialog_id); @@ -2102,7 +2106,7 @@ int hdd_send_twt_del_dialog_cmd(struct hdd_context *hdd_ctx, ack_priv = osif_request_priv(request); if (ack_priv->status) { hdd_err("Received TWT ack error. Reset twt command"); - ucfg_mlme_reset_twt_init_context( + ucfg_mlme_reset_twt_active_cmd( hdd_ctx->psoc, (struct qdf_mac_addr *)twt_params->peer_macaddr, twt_params->dialog_id); @@ -2647,7 +2651,7 @@ int hdd_send_twt_pause_dialog_cmd(struct hdd_context *hdd_ctx, ack_priv = osif_request_priv(request); if (ack_priv->status) { hdd_err("Received TWT ack error. Reset twt command"); - ucfg_mlme_reset_twt_init_context( + ucfg_mlme_reset_twt_active_cmd( hdd_ctx->psoc, (struct qdf_mac_addr *)twt_params->peer_macaddr, twt_params->dialog_id); @@ -2806,7 +2810,7 @@ int hdd_send_twt_nudge_dialog_cmd(struct hdd_context *hdd_ctx, ack_priv = osif_request_priv(request); if (ack_priv->status) { hdd_err("Received TWT ack error. Reset twt command"); - ucfg_mlme_reset_twt_init_context( + ucfg_mlme_reset_twt_active_cmd( hdd_ctx->psoc, (struct qdf_mac_addr *)twt_params->peer_macaddr, twt_params->dialog_id); @@ -3108,7 +3112,7 @@ hdd_send_twt_resume_dialog_cmd(struct hdd_context *hdd_ctx, ack_priv = osif_request_priv(request); if (ack_priv->status) { hdd_err("Received TWT ack error. Reset twt command"); - ucfg_mlme_reset_twt_init_context( + ucfg_mlme_reset_twt_active_cmd( hdd_ctx->psoc, (struct qdf_mac_addr *)twt_params->peer_macaddr, twt_params->dialog_id);