qcacmn: Add support in host to receive ext2 ready event

Currently the host gets service_ready_event and service_ready_ext_event
during the init sequence as a part of handshake with firmware. As the
size of the service_ready_ext_event exceeds on adding further
parameters, new event is created.

Add support for WMI_SERVICE_READY_EXT2_EVENT to be processed after
WMI_SERVICE_READY_EXT_EVENT based on the service bit
WMI_SERVICE_EXT2_MSG.

Also add support to extract the reg db/bdf version information that
comes inside the ext2 event.

Change-Id: If0b57af362e7eb653f9189b912ec1dd3efb0f731
CRs-Fixed: 2501132
This commit is contained in:
Sourav Mohapatra
2019-07-26 09:09:11 +05:30
committed by nshrivas
parent f01c83d57e
commit 6561456601
10 changed files with 235 additions and 11 deletions

View File

@@ -33,6 +33,14 @@
#include <init_cmd_api.h>
#include <cdp_txrx_cmn.h>
static void init_deinit_set_send_init_cmd(struct wlan_objmgr_psoc *psoc,
struct target_psoc_info *tgt_hdl)
{
tgt_hdl->info.wmi_service_ready = TRUE;
/* send init command */
init_deinit_prepare_send_init_cmd(psoc, tgt_hdl);
}
static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle,
uint8_t *event,
uint32_t data_len)
@@ -178,20 +186,60 @@ static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle,
goto exit;
target_if_reg_set_offloaded_info(psoc);
if (!wmi_service_enabled(wmi_handle, wmi_service_ext_msg)) {
target_if_debug("No EXT message, send init command");
tgt_hdl->info.wmi_service_ready = TRUE;
target_psoc_set_num_radios(tgt_hdl, 1);
/* send init command */
init_deinit_prepare_send_init_cmd(psoc, tgt_hdl);
} else {
if (wmi_service_enabled(wmi_handle, wmi_service_ext_msg)) {
target_if_debug("Wait for EXT message");
} else {
target_if_debug("No EXT message, send init command");
target_psoc_set_num_radios(tgt_hdl, 1);
init_deinit_set_send_init_cmd(psoc, tgt_hdl);
}
exit:
return err_code;
}
static int init_deinit_service_ext2_ready_event_handler(ol_scn_t scn_handle,
uint8_t *event,
uint32_t data_len)
{
int err_code = 0;
struct wlan_objmgr_psoc *psoc;
struct target_psoc_info *tgt_hdl;
struct wmi_unified *wmi_handle;
struct tgt_info *info;
if (!scn_handle) {
target_if_err("scn handle NULL in service ready handler");
return -EINVAL;
}
psoc = target_if_get_psoc_from_scn_hdl(scn_handle);
if (!psoc) {
target_if_err("psoc is null in service ready handler");
return -EINVAL;
}
tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
if (!tgt_hdl) {
target_if_err("target_psoc_info is null in service ready ev");
return -EINVAL;
}
wmi_handle = target_psoc_get_wmi_hdl(tgt_hdl);
info = (&tgt_hdl->info);
err_code = init_deinit_populate_service_ready_ext2_param(wmi_handle,
event, info);
if (err_code)
goto exit;
/* send init command */
init_deinit_set_send_init_cmd(psoc, tgt_hdl);
exit:
return err_code;
}
static int init_deinit_service_ext_ready_event_handler(ol_scn_t scn_handle,
uint8_t *event,
uint32_t data_len)
@@ -295,9 +343,12 @@ static int init_deinit_service_ext_ready_event_handler(ol_scn_t scn_handle,
info->wlan_res_cfg.max_bssid_indicator =
info->service_ext_param.max_bssid_indicator;
info->wmi_service_ready = TRUE;
init_deinit_prepare_send_init_cmd(psoc, tgt_hdl);
if (wmi_service_enabled(wmi_handle, wmi_service_ext2_msg)) {
target_if_debug("Wait for EXT2 message");
} else {
target_if_debug("No EXT2 message, send init command");
init_deinit_set_send_init_cmd(psoc, tgt_hdl);
}
exit:
return err_code;
@@ -562,6 +613,12 @@ QDF_STATUS init_deinit_register_tgt_psoc_ev_handlers(
wmi_ready_event_id,
init_deinit_ready_event_handler,
WMI_RX_WORK_CTX);
retval = wmi_unified_register_event_handler(
wmi_handle,
wmi_service_ready_ext2_event_id,
init_deinit_service_ext2_ready_event_handler,
WMI_RX_WORK_CTX);
return retval;
}

View File

@@ -140,6 +140,22 @@ int init_deinit_populate_service_ready_ext_param(
return 0;
}
int init_deinit_populate_service_ready_ext2_param(
wmi_unified_t handle, uint8_t *evt,
struct tgt_info *info)
{
QDF_STATUS status;
status = wmi_extract_service_ready_ext2(handle, evt,
&info->service_ext2_param);
if (QDF_IS_STATUS_ERROR(status)) {
target_if_err("failed to parse wmi service ready ext param");
return qdf_status_to_os_return(status);
}
return 0;
}
int init_deinit_populate_chainmask_tables(
wmi_unified_t handle, uint8_t *evt,
struct wlan_psoc_host_chainmask_table *param)