1
0

qcacmn: Avoid mem copy for different structure types

The regulatory wireless modes are populated by FW in
wlan_psoc_hal_reg_capability during service ready. This is copied
to the host regulatory data structure reg_cap. To accommodate the
802.11BE wireless modes, data type of wireless_modes in reg_cap is
changed from uint32_t to uint64_t, though FW still advertises as a 32
bit flag. As the wireless mode data type of host and FW are different,
structure copy using qdf_mem_copy does not work as expected and it corrupts
the adjacent elements.

Hence copy the elements individually from wlan_psoc_hal_reg_capability
to wlan_psoc_host_hal_reg_capabilities_ext structure. Also, typecast the
wireless_modes to 64 bit before storing in the host structure.

CRs-Fixed: 2901260
Change-Id: I42c8de831f97ec691c9b8cb50b8982662e39e7d9
Este cometimento está contido em:
Priyadarshnee Srinivasan
2021-04-09 12:02:19 +05:30
cometido por snandini
ascendente 2b51168ba8
cometimento ca3471eeec

Ver ficheiro

@@ -625,6 +625,33 @@ static void init_deinit_update_phy_reg_cap(struct wlan_objmgr_psoc *psoc,
}
#endif
/**
* init_deinit_fill_host_reg_cap() - Fill the host regulatory cap
* with target hal reg capabilities.
* @cap: Pointer to wlan_psoc_hal_reg_capability where FW capabilities
* are extracted.
* @reg_cap: Pointer to wlan_psoc_host_hal_reg_capabilities_ext, host reg
* capabilities to be filled.
*
* Return - None
*/
static void
init_deinit_fill_host_reg_cap(struct wlan_psoc_hal_reg_capability *cap,
struct wlan_psoc_host_hal_reg_capabilities_ext
*reg_cap)
{
reg_cap->phy_id = 0;
reg_cap->eeprom_reg_domain = cap->eeprom_rd;
reg_cap->eeprom_reg_domain_ext = cap->eeprom_rd_ext;
reg_cap->regcap1 = cap->regcap1;
reg_cap->regcap2 = cap->regcap2;
reg_cap->wireless_modes = (uint64_t)cap->wireless_modes;
reg_cap->low_2ghz_chan = cap->low_2ghz_chan;
reg_cap->high_2ghz_chan = cap->high_2ghz_chan;
reg_cap->low_5ghz_chan = cap->low_5ghz_chan;
reg_cap->high_5ghz_chan = cap->high_5ghz_chan;
}
int init_deinit_populate_phy_reg_cap(struct wlan_objmgr_psoc *psoc,
wmi_unified_t handle, uint8_t *event,
struct tgt_info *info,
@@ -645,10 +672,8 @@ int init_deinit_populate_phy_reg_cap(struct wlan_objmgr_psoc *psoc,
}
info->service_ext_param.num_phy = 1;
num_phy_reg_cap = 1;
reg_cap[0].phy_id = 0;
qdf_mem_copy(&(reg_cap[0].eeprom_reg_domain), &cap,
sizeof(struct wlan_psoc_hal_reg_capability));
target_if_debug("FW wireless modes 0x%x",
init_deinit_fill_host_reg_cap(&cap, &reg_cap[0]);
target_if_debug("FW wireless modes 0x%llx",
reg_cap[0].wireless_modes);
} else {
num_phy_reg_cap = info->service_ext_param.num_phy;