qcacmn: Add and modify extract APIs for TBTT offset and SWBA events

Recently, FW changes were implemented to support WMI resource config for
multi-radio. As part of this, the TBTT offset and SWBA events were modified
to support increase in the number of vdevs per SOC.

Brief description of the changes with respect to TBTT offset
------------------------------------------------------------

Converged FW will send extended TBTT offset event when the number of vdevs
configured is greater than 32 and will continue to send normal TBTT offset
event when the number of vdevs configured is less than 32. Legacy FW will
continue to send vdev map and tbttoffset list array as part of the TBTT
event.

Extraction API is added to extract the number of vdevs configured for both
legacy and converged FW. Number of vdevs is sent directly by the FW for
extended TBTT offset event but sent as vdev map for the normal TBTT offset
event. In order to handle normal TBTT offset event, extraction API for
normal TBTT event adds logic to convert vdev map into the number of vdevs
configured.

Extraction APIs are added to extract vdev id and tbttoffset information per
vdev that are configured. The vdev id information is sent as vdev map and
tbttoffset list as an array for normal TBTT event and as an array of
structures containing vdev id and tbttoffset in the case of extended TBTT
event. In order to support normal TBTT event based on num vdevs, extraction
API for normal TBTT eventadds logic to determine the vdev id from vdev map
based on the index(running through 1 to total number of vdevs) passed from
the driver.

Brief description of the changes with respect to SWBA
-----------------------------------------------------

Converged FW will send additional information num vdevs and vdev id
embedded in tim info and p2p noa TLVs for SWBA event. Legacy FW will
continue to send vdev map and array of tim info and p2p noa desciptors.

Extraction APIs is added to extract the number of vdevs configured for both
legacy and converged FW. Number of vdevs is sent directly by the FW for
SWBA event in the case of converged FW and as a vdev map in the legacy FW.
In order to handle legacy FW, extraction API for non-TLV adds logic
to convert vdev map into number of vdevs configured.

Extraction APIs are modified to extract newly embedded vdev id information
in tim info and p2p noa descriptors. The vdev id information is sent as
vdev map for legacy. In order to handle legacy FW, extraction API for
non-TLV adds logic to determing the vdev id from vdev map based on the
index (running through 1 to total number of vdevs) passed from the driver.

Change-Id: Ibf84adbb1c526321ec031d5539aff66dcbd1315b
CRs-Fixed: 2053628
This commit is contained in:
Sathish Kumar
2017-05-17 18:05:15 +05:30
committed by snandini
parent 42cd1e66cb
commit e5f0e0e801
3 changed files with 243 additions and 37 deletions

View File

@@ -5886,24 +5886,52 @@ static QDF_STATUS extract_vdev_start_resp_non_tlv(wmi_unified_t wmi_handle,
return QDF_STATUS_SUCCESS;
}
/**
* extract_tbttoffset_num_vdevs_non_tlv() - extract tbtt offset num vdevs
* @wmi_handle: wmi handle
* @param evt_buf: pointer to event buffer
* @param num_vdev: Pointer to hold num vdev
*
* Return: 0 for success or error code
*/
static QDF_STATUS extract_tbttoffset_num_vdevs_non_tlv(void *wmi_hdl,
void *evt_buf,
uint32_t *num_vdevs)
{
wmi_tbtt_offset_event *tbtt_offset_event =
(wmi_tbtt_offset_event *)evt_buf;
uint32_t vdev_map;
vdev_map = tbtt_offset_event->vdev_map;
*num_vdevs = wmi_vdev_map_to_num_vdevs(vdev_map);
return QDF_STATUS_SUCCESS;
}
/**
* extract_tbttoffset_update_params_non_tlv() - extract tbtt offset update param
* @wmi_handle: wmi handle
* @param evt_buf: pointer to event buffer
* @param vdev_map: Pointer to hold vdev map
* @param tbttoffset_list: Pointer to tbtt offset list
* @param idx: Index refering to a vdev
* @param tbtt_param: Pointer to tbttoffset event param
*
* Return: 0 for success or error code
*/
static QDF_STATUS extract_tbttoffset_update_params_non_tlv(void *wmi_hdl,
void *evt_buf,
uint32_t *vdev_map, uint32_t **tbttoffset_list)
void *evt_buf, uint8_t idx,
struct tbttoffset_params *tbtt_param)
{
wmi_tbtt_offset_event *tbtt_offset_event =
(wmi_tbtt_offset_event *)evt_buf;
uint32_t vdev_map;
*vdev_map = tbtt_offset_event->vdev_map;
*tbttoffset_list = tbtt_offset_event->tbttoffset_list;
vdev_map = tbtt_offset_event->vdev_map;
tbtt_param->vdev_id = wmi_vdev_map_to_vdev_id(vdev_map, idx);
if (tbtt_param->vdev_id == WLAN_INVALID_VDEV_ID)
return QDF_STATUS_E_INVAL;
tbtt_param->tbttoffset =
tbtt_offset_event->tbttoffset_list[tbtt_param->vdev_id];
return QDF_STATUS_SUCCESS;
}
@@ -6331,20 +6359,22 @@ static QDF_STATUS extract_pdev_reserve_ast_ev_param_non_tlv(
}
/**
* extract_swba_vdev_map_non_tlv() - extract swba vdev map from event
* extract_swba_num_vdevs_non_tlv() - extract swba num vdevs from event
* @wmi_handle: wmi handle
* @param evt_buf: pointer to event buffer
* @param vdev_map: Pointer to hold vdev map
* @param num_vdevs: Pointer to hold num vdevs
*
* Return: 0 for success or error code
*/
static QDF_STATUS extract_swba_vdev_map_non_tlv(wmi_unified_t wmi_handle,
static QDF_STATUS extract_swba_num_vdevs_non_tlv(wmi_unified_t wmi_handle,
void *evt_buf,
uint32_t *vdev_map)
uint32_t *num_vdevs)
{
wmi_host_swba_event *swba_event = (wmi_host_swba_event *)evt_buf;
uint32_t vdev_map;
*vdev_map = swba_event->vdev_map;
vdev_map = swba_event->vdev_map;
*num_vdevs = wmi_vdev_map_to_num_vdevs(vdev_map);
return QDF_STATUS_SUCCESS;
}
@@ -6364,9 +6394,14 @@ static QDF_STATUS extract_swba_tim_info_non_tlv(wmi_unified_t wmi_handle,
{
wmi_host_swba_event *swba_event = (wmi_host_swba_event *)evt_buf;
wmi_bcn_info *bcn_info;
uint32_t vdev_map;
bcn_info = &swba_event->bcn_info[idx];
vdev_map = swba_event->vdev_map;
tim_info->vdev_id = wmi_vdev_map_to_vdev_id(vdev_map, idx);
if (tim_info->vdev_id == WLAN_INVALID_VDEV_ID)
return QDF_STATUS_E_INVAL;
tim_info->tim_len = bcn_info->tim_info.tim_len;
tim_info->tim_mcast = bcn_info->tim_info.tim_mcast;
qdf_mem_copy(tim_info->tim_bitmap, bcn_info->tim_info.tim_bitmap,
@@ -6393,11 +6428,15 @@ static QDF_STATUS extract_swba_noa_info_non_tlv(wmi_unified_t wmi_handle,
wmi_p2p_noa_info *p2p_noa_info;
wmi_bcn_info *bcn_info;
uint8_t i = 0;
uint32_t vdev_map;
bcn_info = &swba_event->bcn_info[idx];
vdev_map = swba_event->vdev_map;
p2p_noa_info = &bcn_info->p2p_noa_info;
p2p_desc->vdev_id = wmi_vdev_map_to_vdev_id(vdev_map, idx);
if (p2p_desc->vdev_id == WLAN_INVALID_VDEV_ID)
return QDF_STATUS_E_INVAL;
p2p_desc->modified = false;
p2p_desc->num_descriptors = 0;
if (WMI_UNIFIED_NOA_ATTR_IS_MODIFIED(p2p_noa_info)) {
@@ -8077,6 +8116,8 @@ struct wmi_ops non_tlv_ops = {
.extract_vdev_start_resp = extract_vdev_start_resp_non_tlv,
.extract_tbttoffset_update_params =
extract_tbttoffset_update_params_non_tlv,
.extract_tbttoffset_num_vdevs =
extract_tbttoffset_num_vdevs_non_tlv,
.extract_mgmt_rx_params = extract_mgmt_rx_params_non_tlv,
.extract_vdev_stopped_param = extract_vdev_stopped_param_non_tlv,
.extract_vdev_roam_param = extract_vdev_roam_param_non_tlv,
@@ -8091,7 +8132,7 @@ struct wmi_ops non_tlv_ops = {
.extract_gpio_input_ev_param = extract_gpio_input_ev_param_non_tlv,
.extract_pdev_reserve_ast_ev_param =
extract_pdev_reserve_ast_ev_param_non_tlv,
.extract_swba_vdev_map = extract_swba_vdev_map_non_tlv,
.extract_swba_num_vdevs = extract_swba_num_vdevs_non_tlv,
.extract_swba_tim_info = extract_swba_tim_info_non_tlv,
.extract_swba_noa_info = extract_swba_noa_info_non_tlv,
.extract_peer_sta_ps_statechange_ev =