qcacmn: Extract additional params from twt add dialog comp evt
Extract additional params obtained from fw as part of WMI_TWT_ADD_DIALOG_COMPLETE_EVENTID during TWT setup Change-Id: Ic58a1da463238a748cbf2678fe0156789ebb3559 CRs-Fixed: 2737036
This commit is contained in:

gecommit door
snandini

bovenliggende
98f996d608
commit
19b1248241
@@ -2158,6 +2158,13 @@ QDF_STATUS (*extract_twt_add_dialog_comp_event)(wmi_unified_t wmi_handle,
|
||||
uint8_t *evt_buf,
|
||||
struct wmi_twt_add_dialog_complete_event_param *params);
|
||||
|
||||
QDF_STATUS (*extract_twt_add_dialog_comp_additional_params)
|
||||
(
|
||||
wmi_unified_t wmi_handle, uint8_t *evt_buf,
|
||||
struct wmi_twt_add_dialog_additional_params *additional_params,
|
||||
uint32_t idx
|
||||
);
|
||||
|
||||
QDF_STATUS (*extract_twt_del_dialog_comp_event)(wmi_unified_t wmi_handle,
|
||||
uint8_t *evt_buf,
|
||||
struct wmi_twt_del_dialog_complete_event_param *params);
|
||||
|
@@ -159,6 +159,21 @@ QDF_STATUS wmi_extract_twt_add_dialog_comp_event(
|
||||
uint8_t *evt_buf,
|
||||
struct wmi_twt_add_dialog_complete_event_param *params);
|
||||
|
||||
/**
|
||||
* wmi_extract_twt_add_dialog_comp_additional_params() - Extracts additional
|
||||
* twt parameters, as part of add dialog completion event
|
||||
* @wmi_hdl: wmi handle
|
||||
* @evt_buf: Pointer event buffer
|
||||
* @additional_params: additional parameters to extract
|
||||
* @idx: index of num_twt_params to extract
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
||||
*/
|
||||
QDF_STATUS wmi_extract_twt_add_dialog_comp_additional_params(
|
||||
wmi_unified_t wmi_handle, uint8_t *evt_buf,
|
||||
struct wmi_twt_add_dialog_additional_params *additional_params,
|
||||
uint32_t idx);
|
||||
|
||||
/**
|
||||
* wmi_extract_twt_del_dialog_comp_event() - Extract WMI event params for TWT
|
||||
* delete dialog completion event
|
||||
|
@@ -215,17 +215,55 @@ enum WMI_HOST_ADD_TWT_STATUS {
|
||||
WMI_HOST_ADD_TWT_STATUS_UNKNOWN_ERROR,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wmi_twt_add_dialog_additional_params -
|
||||
* @twt_cmd: TWT command
|
||||
* @bcast: 0 means Individual TWT
|
||||
* 1 means Broadcast TWT
|
||||
* @trig_en: 0 means non-Trigger-enabled TWT
|
||||
* 1 means Trigger-enabled TWT
|
||||
* @announce: 0 means announced TWT
|
||||
* 1 means un-announced TWT
|
||||
* @protection: 0 means TWT protection is required
|
||||
* 1 means TWT protection is not required
|
||||
* @b_twt_id0: 0 means non-0 B-TWT ID or I-TWT
|
||||
* 1 means B-TWT ID 0
|
||||
* @info_frame_disabled: 0 means TWT Information frame is enabled
|
||||
* 1 means TWT Information frame is disabled
|
||||
* @wake_dura_us: wake duration in us
|
||||
* @wake_intvl_us: wake time interval in us
|
||||
* @sp_offset_us: Time until initial TWT SP occurs
|
||||
* @sp_tsf_us_lo: TWT service period tsf in usecs lower bits - 31:0
|
||||
* @sp_tsf_us_hi: TWT service period tsf in usecs higher bits - 63:32
|
||||
*/
|
||||
struct wmi_twt_add_dialog_additional_params {
|
||||
uint32_t twt_cmd:8,
|
||||
bcast:1,
|
||||
trig_en:1,
|
||||
announce:1,
|
||||
protection:1,
|
||||
b_twt_id0:1,
|
||||
info_frame_disabled:1;
|
||||
uint32_t wake_dur_us;
|
||||
uint32_t wake_intvl_us;
|
||||
uint32_t sp_offset_us;
|
||||
uint32_t sp_tsf_us_lo;
|
||||
uint32_t sp_tsf_us_hi;
|
||||
};
|
||||
|
||||
/** struct wmi_twt_add_dialog_complete_param -
|
||||
* @vdev_id: VDEV identifier
|
||||
* @peer_macaddr: Peer mac address
|
||||
* @dialog_id: TWT dialog ID
|
||||
* @status: refer to WMI_HOST_ADD_TWT_STATUS enum
|
||||
* @num_additional_twt_params: no of additional_twt_params available
|
||||
*/
|
||||
struct wmi_twt_add_dialog_complete_event_param {
|
||||
uint32_t vdev_id;
|
||||
uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
|
||||
uint32_t dialog_id;
|
||||
uint32_t status;
|
||||
uint32_t num_additional_twt_params;
|
||||
};
|
||||
|
||||
/** struct wmi_twt_del_dialog_param -
|
||||
|
@@ -149,6 +149,19 @@ QDF_STATUS wmi_extract_twt_add_dialog_comp_event(
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS wmi_extract_twt_add_dialog_comp_additional_params(
|
||||
wmi_unified_t wmi_handle, uint8_t *evt_buf,
|
||||
struct wmi_twt_add_dialog_additional_params *additional_params,
|
||||
uint32_t idx)
|
||||
{
|
||||
if (wmi_handle->ops->extract_twt_add_dialog_comp_additional_params)
|
||||
return wmi_handle->ops->
|
||||
extract_twt_add_dialog_comp_additional_params(
|
||||
wmi_handle, evt_buf, additional_params, idx);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS wmi_extract_twt_del_dialog_comp_event(
|
||||
wmi_unified_t wmi_handle,
|
||||
uint8_t *evt_buf,
|
||||
|
@@ -413,6 +413,15 @@ static QDF_STATUS extract_twt_disable_comp_event_tlv(wmi_unified_t wmi_handle,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* extract_twt_add_dialog_comp_event_tlv - Extacts twt add dialog complete wmi
|
||||
* event from firmware
|
||||
* @wmi_hande: WMI handle
|
||||
* @evt_buf: Pointer to wmi event buf of twt add dialog complete event
|
||||
* @params: Pointer to store the extracted parameters
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success or QDF STATUS error values on failure
|
||||
*/
|
||||
static QDF_STATUS extract_twt_add_dialog_comp_event_tlv(
|
||||
wmi_unified_t wmi_handle,
|
||||
uint8_t *evt_buf,
|
||||
@@ -433,6 +442,74 @@ static QDF_STATUS extract_twt_add_dialog_comp_event_tlv(
|
||||
WMI_MAC_ADDR_TO_CHAR_ARRAY(&ev->peer_macaddr, params->peer_macaddr);
|
||||
params->status = ev->status;
|
||||
params->dialog_id = ev->dialog_id;
|
||||
params->num_additional_twt_params = param_buf->num_twt_params;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* extract_twt_add_dialog_comp_additional_parameters() - Extracts additional twt
|
||||
* twt parameters, as part of add dialog completion event
|
||||
* @wmi_hdl: wmi handle
|
||||
* @evt_buf: Pointer event buffer
|
||||
* @additional_params: twt additional parameters to extract
|
||||
* @idx: index of num_twt_params
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
||||
*/
|
||||
static QDF_STATUS extract_twt_add_dialog_comp_additional_parameters
|
||||
(
|
||||
wmi_unified_t wmi_handle, uint8_t *evt_buf,
|
||||
struct wmi_twt_add_dialog_additional_params *additional_params,
|
||||
uint32_t idx
|
||||
)
|
||||
{
|
||||
WMI_TWT_ADD_DIALOG_COMPLETE_EVENTID_param_tlvs *param_buf;
|
||||
wmi_twt_add_dialog_complete_event_fixed_param *ev;
|
||||
uint32_t flags = 0;
|
||||
|
||||
param_buf = (WMI_TWT_ADD_DIALOG_COMPLETE_EVENTID_param_tlvs *)evt_buf;
|
||||
if (!param_buf) {
|
||||
WMI_LOGE("evt_buf is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
ev = param_buf->fixed_param;
|
||||
|
||||
if (ev->status != WMI_HOST_ADD_TWT_STATUS_OK) {
|
||||
WMI_LOGE("Status of add dialog complete is not success");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (idx >= param_buf->num_twt_params) {
|
||||
WMI_LOGE("Invalid idx %d while num_twt_params = %d",
|
||||
idx, param_buf->num_twt_params);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (!param_buf->twt_params) {
|
||||
WMI_LOGE("Unable to extract additional twt parameters");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
flags = param_buf->twt_params[idx].flags;
|
||||
additional_params->twt_cmd = TWT_FLAGS_GET_CMD(flags);
|
||||
additional_params->bcast = TWT_FLAGS_GET_BROADCAST(flags);
|
||||
additional_params->trig_en = TWT_FLAGS_GET_TRIGGER(flags);
|
||||
additional_params->announce = TWT_FLAGS_GET_FLOW_TYPE(flags);
|
||||
additional_params->protection = TWT_FLAGS_GET_PROTECTION(flags);
|
||||
additional_params->b_twt_id0 = TWT_FLAGS_GET_BTWT_ID0(flags);
|
||||
additional_params->info_frame_disabled =
|
||||
TWT_FLAGS_GET_TWT_INFO_FRAME_DISABLED(flags);
|
||||
additional_params->wake_dur_us = param_buf->twt_params[idx].wake_dur_us;
|
||||
additional_params->wake_intvl_us =
|
||||
param_buf->twt_params[idx].wake_intvl_us;
|
||||
additional_params->sp_offset_us =
|
||||
param_buf->twt_params[idx].sp_offset_us;
|
||||
additional_params->sp_tsf_us_lo =
|
||||
param_buf->twt_params[idx].sp_tsf_us_lo;
|
||||
additional_params->sp_tsf_us_hi =
|
||||
param_buf->twt_params[idx].sp_tsf_us_hi;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -604,6 +681,8 @@ void wmi_twt_attach_tlv(wmi_unified_t wmi_handle)
|
||||
extract_twt_disable_comp_event_tlv;
|
||||
ops->extract_twt_add_dialog_comp_event =
|
||||
extract_twt_add_dialog_comp_event_tlv;
|
||||
ops->extract_twt_add_dialog_comp_additional_params =
|
||||
extract_twt_add_dialog_comp_additional_parameters;
|
||||
ops->extract_twt_del_dialog_comp_event =
|
||||
extract_twt_del_dialog_comp_event_tlv;
|
||||
ops->extract_twt_pause_dialog_comp_event =
|
||||
|
Verwijs in nieuw issue
Block a user