qcacmn: Add support to populate target 11AX wireless modes
Add support to populate 11AX wireless modes advetised in ext2 service ready message. To support older FW that do not advertise this, use existing host workaround to populate these in host itself. Change-Id: I3b3b280672592c858bd3f6f0e368909a16bd30ee CRs-Fixed: 2650136
This commit is contained in:

committed by
nshrivas

parent
4a452b5de6
commit
a76f88adb8
@@ -32,6 +32,7 @@
|
||||
#include <service_ready_param.h>
|
||||
#include <init_cmd_api.h>
|
||||
#include <cdp_txrx_cmn.h>
|
||||
#include <wlan_reg_ucfg_api.h>
|
||||
|
||||
static void init_deinit_set_send_init_cmd(struct wlan_objmgr_psoc *psoc,
|
||||
struct target_psoc_info *tgt_hdl)
|
||||
@@ -226,23 +227,28 @@ static int init_deinit_service_ext2_ready_event_handler(ol_scn_t scn_handle,
|
||||
struct tgt_info *info;
|
||||
|
||||
if (!scn_handle) {
|
||||
target_if_err("scn handle NULL in service ready handler");
|
||||
target_if_err("scn handle NULL in service ready ext2 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");
|
||||
target_if_err("psoc is null in service ready ext2 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");
|
||||
target_if_err("target_psoc_info is null in service ready ext2 handler");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
wmi_handle = target_psoc_get_wmi_hdl(tgt_hdl);
|
||||
if (!wmi_handle) {
|
||||
target_if_err("wmi_handle is null in service ready ext2 handler");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
info = (&tgt_hdl->info);
|
||||
|
||||
err_code = init_deinit_populate_service_ready_ext2_param(wmi_handle,
|
||||
@@ -259,6 +265,22 @@ static int init_deinit_service_ext2_ready_event_handler(ol_scn_t scn_handle,
|
||||
goto exit;
|
||||
}
|
||||
|
||||
err_code = init_deinit_populate_hal_reg_cap_ext2(wmi_handle, event,
|
||||
info);
|
||||
if (err_code) {
|
||||
target_if_err("failed to populate hal reg cap ext2");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
err_code = init_deinit_populate_mac_phy_cap_ext2(wmi_handle, event,
|
||||
info);
|
||||
if (err_code) {
|
||||
target_if_err("failed to populate mac phy cap ext2");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
target_if_add_11ax_modes(psoc, tgt_hdl);
|
||||
|
||||
/* send init command */
|
||||
init_deinit_set_send_init_cmd(psoc, tgt_hdl);
|
||||
|
||||
@@ -329,7 +351,12 @@ static int init_deinit_service_ext_ready_event_handler(ol_scn_t scn_handle,
|
||||
if (err_code)
|
||||
goto exit;
|
||||
|
||||
target_if_add_11ax_modes(psoc, tgt_hdl);
|
||||
/* Host receives 11AX wireless modes from target in service ext2
|
||||
* message. Therefore, call target_if_add_11ax_modes() from service ext2
|
||||
* event handler as well.
|
||||
*/
|
||||
if (!wmi_service_enabled(wmi_handle, wmi_service_ext2_msg))
|
||||
target_if_add_11ax_modes(psoc, tgt_hdl);
|
||||
|
||||
if (init_deinit_chainmask_table_alloc(
|
||||
&(info->service_ext_param)) ==
|
||||
|
@@ -343,6 +343,8 @@ int init_deinit_populate_hw_mode_capability(
|
||||
if (hw_idx < WMI_HOST_HW_MODE_MAX) {
|
||||
info->hw_modes.hw_mode_ids[hw_idx] =
|
||||
hw_mode_caps[hw_idx].hw_mode_id;
|
||||
info->hw_modes.phy_bit_map[hw_idx] =
|
||||
hw_mode_caps[hw_idx].phy_id_map;
|
||||
info->hw_modes.num_modes++;
|
||||
}
|
||||
|
||||
@@ -647,6 +649,110 @@ int init_deinit_populate_phy_reg_cap(struct wlan_objmgr_psoc *psoc,
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
int init_deinit_populate_mac_phy_cap_ext2(wmi_unified_t wmi_handle,
|
||||
uint8_t *event,
|
||||
struct tgt_info *info)
|
||||
{
|
||||
struct wlan_psoc_host_mac_phy_caps_ext2
|
||||
mac_phy_caps_ext2[PSOC_MAX_MAC_PHY_CAP] = {{0} };
|
||||
uint32_t num_hw_modes;
|
||||
uint8_t hw_idx;
|
||||
uint32_t hw_mode_id;
|
||||
uint32_t phy_bit_map;
|
||||
uint8_t phy_id;
|
||||
uint8_t mac_phy_count = 0;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct wlan_psoc_host_mac_phy_caps *mac_phy_cap;
|
||||
|
||||
if (!event)
|
||||
return -EINVAL;
|
||||
|
||||
num_hw_modes = info->hw_modes.num_modes;
|
||||
|
||||
for (hw_idx = 0; hw_idx < num_hw_modes; hw_idx++) {
|
||||
hw_mode_id = info->hw_modes.hw_mode_ids[hw_idx];
|
||||
phy_bit_map = info->hw_modes.phy_bit_map[hw_idx];
|
||||
|
||||
phy_id = info->mac_phy_cap[mac_phy_count].phy_id;
|
||||
while (phy_bit_map) {
|
||||
if (mac_phy_count >= info->total_mac_phy_cnt) {
|
||||
target_if_err("total MAC PHY count exceeds max limit %d, mac_phy_count = %d",
|
||||
info->total_mac_phy_cnt,
|
||||
mac_phy_count);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mac_phy_cap = &info->mac_phy_cap[mac_phy_count];
|
||||
status = wmi_extract_mac_phy_cap_service_ready_ext2(
|
||||
wmi_handle, event, hw_mode_id, phy_id,
|
||||
mac_phy_cap->phy_idx,
|
||||
&mac_phy_caps_ext2[mac_phy_count]);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("failed to parse mac phy capability ext2");
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
mac_phy_cap->reg_cap_ext.wireless_modes |=
|
||||
mac_phy_caps_ext2[phy_id].wireless_modes_ext;
|
||||
|
||||
mac_phy_count++;
|
||||
phy_bit_map &= (phy_bit_map - 1);
|
||||
phy_id++;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int init_deinit_populate_hal_reg_cap_ext2(wmi_unified_t wmi_handle,
|
||||
uint8_t *event,
|
||||
struct tgt_info *info)
|
||||
{
|
||||
struct wlan_psoc_host_hal_reg_capabilities_ext2
|
||||
reg_cap[PSOC_MAX_PHY_REG_CAP] = {{0} };
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
uint32_t num_phy_reg_cap;
|
||||
uint8_t reg_idx;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
if (!event) {
|
||||
target_if_err("event buffer is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psoc = target_if_get_psoc_from_scn_hdl(wmi_handle->scn_handle);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc is null");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
num_phy_reg_cap = info->service_ext_param.num_phy;
|
||||
if (num_phy_reg_cap > PSOC_MAX_PHY_REG_CAP) {
|
||||
target_if_err("Invalid num_phy_reg_cap %d", num_phy_reg_cap);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (reg_idx = 0; reg_idx < num_phy_reg_cap; reg_idx++) {
|
||||
status = wmi_extract_hal_reg_cap_ext2(
|
||||
wmi_handle, event, reg_idx, ®_cap[reg_idx]);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("failed to parse hal reg cap ext2");
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
status = ucfg_reg_update_hal_reg_cap(
|
||||
psoc, reg_cap[reg_idx].wireless_modes_ext,
|
||||
reg_idx);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Failed to update hal reg cap");
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool init_deinit_regdmn_160mhz_support(
|
||||
struct wlan_psoc_host_hal_reg_capabilities_ext *hal_cap)
|
||||
{
|
||||
|
Reference in New Issue
Block a user