From 2f375755321f90d5cad1b8b335e13d482ecea55d Mon Sep 17 00:00:00 2001 From: Nirav Shah Date: Mon, 23 Aug 2021 12:23:56 +0530 Subject: [PATCH] qcacmn: Send responder pm mode info to user space Send responder pm mode info in twt setup event and twt get session parameter response. Change-Id: I1f58e0bed62f152d84cec20ff7924d05e126347f CRs-Fixed: 3029014 --- wmi/inc/wmi_unified_twt_param.h | 14 ++++++++++++-- wmi/src/wmi_unified_twt_tlv.c | 10 ++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/wmi/inc/wmi_unified_twt_param.h b/wmi/inc/wmi_unified_twt_param.h index 272bed7509..37e2855b6c 100644 --- a/wmi/inc/wmi_unified_twt_param.h +++ b/wmi/inc/wmi_unified_twt_param.h @@ -197,6 +197,8 @@ enum host_twt_session_stats_type { * @announ: If the flow type is announced/unannounced * @protection: If the TWT protection field is set * @info_frame_disabled: If the TWT Information frame is disabled + * @pm_responder_bit_valid: pm responder bit is valid or not + * @pm_responder_bit: pm responder value * @dialog_id: Dialog_id of current session * @wake_dura_us: wake duration in us * @wake_intvl_us: wake time interval in us @@ -213,7 +215,9 @@ struct wmi_host_twt_session_stats_info { trig:1, announ:1, protection:1, - info_frame_disabled:1; + info_frame_disabled:1, + pm_responder_bit_valid:1, + pm_responder_bit:1; uint32_t dialog_id; uint32_t wake_dura_us; uint32_t wake_intvl_us; @@ -373,6 +377,10 @@ enum WMI_HOST_ADD_TWT_STATUS { * 1 means B-TWT ID 0 * @info_frame_disabled: 0 means TWT Information frame is enabled * 1 means TWT Information frame is disabled + * @pm_responder_bit_valid: 1 means responder pm mode field is valid + * 0 means responder pm mode field is not valid + * @pm_responder_bit: 1 means that responder set responder pm mode to 1 + * 0 means that responder set responder pm mode to 0 * @wake_dura_us: wake duration in us * @wake_intvl_us: wake time interval in us * @sp_offset_us: Time until initial TWT SP occurs @@ -386,7 +394,9 @@ struct wmi_twt_add_dialog_additional_params { announce:1, protection:1, b_twt_id0:1, - info_frame_disabled:1; + info_frame_disabled:1, + pm_responder_bit_valid:1, + pm_responder_bit:1; uint32_t wake_dur_us; uint32_t wake_intvl_us; uint32_t sp_offset_us; diff --git a/wmi/src/wmi_unified_twt_tlv.c b/wmi/src/wmi_unified_twt_tlv.c index 656eb9f498..472896ccd3 100644 --- a/wmi/src/wmi_unified_twt_tlv.c +++ b/wmi/src/wmi_unified_twt_tlv.c @@ -610,6 +610,10 @@ static QDF_STATUS extract_twt_add_dialog_comp_additional_parameters param_buf->twt_params[idx].sp_tsf_us_lo; additional_params->sp_tsf_us_hi = param_buf->twt_params[idx].sp_tsf_us_hi; + additional_params->pm_responder_bit_valid = + TWT_FLAGS_GET_PM_RESPONDER_MODE_VALID(flags); + additional_params->pm_responder_bit = + TWT_FLAGS_GET_PM_RESPONDER_MODE(flags); return QDF_STATUS_SUCCESS; } @@ -1013,6 +1017,10 @@ extract_twt_session_stats_event_data(wmi_unified_t wmi_handle, session->protection = WMI_TWT_SESSION_FLAG_TWT_PROTECTION_GET(flags); session->info_frame_disabled = WMI_TWT_SESSION_FLAG_TWT_INFO_FRAME_DISABLED_GET(flags); + session->pm_responder_bit = + WMI_TWT_SESSION_FLAG_TWT_PM_RESPONDER_MODE_GET(flags); + session->pm_responder_bit_valid = + WMI_TWT_SESSION_FLAG_TWT_PM_RESPONDER_MODE_VALID_GET(flags); session->dialog_id = twt_session->dialog_id; session->wake_dura_us = twt_session->wake_dura_us; session->wake_intvl_us = twt_session->wake_intvl_us; @@ -1024,6 +1032,8 @@ extract_twt_session_stats_event_data(wmi_unified_t wmi_handle, session->bcast, session->trig, session->announ, session->dialog_id, session->wake_dura_us, session->wake_intvl_us, session->sp_offset_us); + wmi_debug("resp_pm_valid=%d resp_pm=%d", + session->pm_responder_bit_valid, session->pm_responder_bit); return QDF_STATUS_SUCCESS; }