qcacmn: Support for RF path selection
Includes changes: 1. Save frequency values from EXT and EXT2 events to psoc object - wireless_modes, low/high 2 GHz chan and low/high 5 GHz chan from EXT event - wireless_modes_ext, similar frequency range fields with _ext from EXT2 event. Frequency range fields with _ext are non-zero when a radio supports overlapping frequency. Eg.Radio that supports 5 GHz full and 5 GHz high band will have low/high 5 GHz fields populated with primary band values in EXT event and low/high 5 GHz fields are populated in EXT2 event with secondary band values. These values are stored in tgt info for later use. 2. Modify regulatory APIs to get and set the wireless modes in reg component 3. Retrieve frequency fields from EXT2 event Change-Id: I49ebcc7ee7b26bd115f37abc8cb5b6fa5a415eda CRs-Fixed: 3576551
This commit is contained in:
parent
d1d1770bd9
commit
b9322f12bd
@ -1467,6 +1467,24 @@ static inline struct wlan_psoc_host_service_ext_param
|
||||
return &psoc_info->info.service_ext_param;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_psoc_get_service_ext2_param() - get service_ext2_param
|
||||
* @psoc_info: pointer to structure target_psoc_info
|
||||
*
|
||||
* API to get service_ext2_param
|
||||
*
|
||||
* Return: structure pointer to wlan_psoc_host_service_ext2_param
|
||||
*/
|
||||
static inline struct wlan_psoc_host_service_ext2_param
|
||||
*target_psoc_get_service_ext2_param
|
||||
(struct target_psoc_info *psoc_info)
|
||||
{
|
||||
if (!psoc_info)
|
||||
return NULL;
|
||||
|
||||
return &psoc_info->info.service_ext2_param;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_psoc_get_num_dbr_ring_caps() - get no of dbr_ring_caps
|
||||
* @psoc_info: pointer to structure target_psoc_info
|
||||
|
@ -481,6 +481,15 @@ struct wlan_psoc_host_aux_dev_caps {
|
||||
* @num_bin_scaling_params: Number of Spectral bin scaling parameters
|
||||
* @chainmask_table: Available chain mask tables.
|
||||
* @sar_version: SAR version info
|
||||
*
|
||||
* Following fields are used to save the values that are received in service
|
||||
* ready EXT event. Currently, used by RF path switch code.
|
||||
* @wireless_modes: Regdmn modes
|
||||
* @low_2ghz_chan: 2 GHz channel low
|
||||
* @high_2ghz_chan: 2 GHz channel High
|
||||
* @low_5ghz_chan: 5 GHz channel low
|
||||
* @high_5ghz_chan: 5 GHz channel High
|
||||
*
|
||||
*/
|
||||
struct wlan_psoc_host_service_ext_param {
|
||||
uint32_t default_conc_scan_config_bits;
|
||||
@ -499,6 +508,11 @@ struct wlan_psoc_host_service_ext_param {
|
||||
struct wlan_psoc_host_chainmask_table
|
||||
chainmask_table[PSOC_MAX_CHAINMASK_TABLES];
|
||||
uint32_t sar_version;
|
||||
uint64_t wireless_modes;
|
||||
uint32_t low_2ghz_chan;
|
||||
uint32_t high_2ghz_chan;
|
||||
uint32_t low_5ghz_chan;
|
||||
uint32_t high_5ghz_chan;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -534,6 +548,14 @@ struct wlan_psoc_host_service_ext_param {
|
||||
* @is_multipass_sap: Multipass sap flag
|
||||
* @num_max_mlo_link_per_ml_bss_supp: max link number per MLD FW supports.
|
||||
* @num_aux_dev_caps: number of aux dev capabilities
|
||||
*
|
||||
* Following fields are used to save the values that are received in service
|
||||
* ready EXT2 event. Currently, used by RF path switch code.
|
||||
* @wireless_modes_ext: REGDMN MODE, see REGDMN_MODE_ enum
|
||||
* @low_2ghz_chan_ext: 2 GHz channel ext low
|
||||
* @high_2ghz_chan_ext: 2 GHz channel ext High
|
||||
* @low_5ghz_chan_ext: 5 GHz channel ext low
|
||||
* @high_5ghz_chan_ext: 5 GHz channel ext High
|
||||
*/
|
||||
struct wlan_psoc_host_service_ext2_param {
|
||||
uint8_t reg_db_version_major;
|
||||
@ -569,6 +591,12 @@ struct wlan_psoc_host_service_ext2_param {
|
||||
#endif
|
||||
uint32_t num_max_mlo_link_per_ml_bss_supp;
|
||||
uint32_t num_aux_dev_caps;
|
||||
|
||||
uint64_t wireless_modes_ext;
|
||||
uint32_t low_2ghz_chan_ext;
|
||||
uint32_t high_2ghz_chan_ext;
|
||||
uint32_t low_5ghz_chan_ext;
|
||||
uint32_t high_5ghz_chan_ext;
|
||||
};
|
||||
|
||||
#endif /* _SERVICE_READY_PARAM_H_*/
|
||||
|
@ -844,6 +844,34 @@ init_deinit_fill_host_reg_cap(struct wlan_psoc_hal_reg_capability *cap,
|
||||
reg_cap->high_5ghz_chan = cap->high_5ghz_chan;
|
||||
}
|
||||
|
||||
static void
|
||||
init_deinit_populate_tgt_ext_param(struct tgt_info *info,
|
||||
struct wlan_psoc_host_hal_reg_capabilities_ext *cap)
|
||||
{
|
||||
struct wlan_psoc_host_service_ext_param *ext_param;
|
||||
|
||||
ext_param = &info->service_ext_param;
|
||||
ext_param->wireless_modes = cap->wireless_modes;
|
||||
ext_param->low_2ghz_chan = cap->low_2ghz_chan;
|
||||
ext_param->high_2ghz_chan = cap->high_2ghz_chan;
|
||||
ext_param->low_5ghz_chan = cap->low_5ghz_chan;
|
||||
ext_param->high_5ghz_chan = cap->high_5ghz_chan;
|
||||
}
|
||||
|
||||
static void
|
||||
init_deinit_populate_tgt_ext2_param(struct tgt_info *info,
|
||||
struct wlan_psoc_host_hal_reg_capabilities_ext2 *cap)
|
||||
{
|
||||
struct wlan_psoc_host_service_ext2_param *ext2_param;
|
||||
|
||||
ext2_param = &info->service_ext2_param;
|
||||
ext2_param->wireless_modes_ext = cap->wireless_modes_ext;
|
||||
ext2_param->low_2ghz_chan_ext = cap->low_2ghz_chan_ext;
|
||||
ext2_param->high_2ghz_chan_ext = cap->high_2ghz_chan_ext;
|
||||
ext2_param->low_5ghz_chan_ext = cap->low_5ghz_chan_ext;
|
||||
ext2_param->high_5ghz_chan_ext = cap->high_5ghz_chan_ext;
|
||||
}
|
||||
|
||||
int init_deinit_populate_phy_reg_cap(struct wlan_objmgr_psoc *psoc,
|
||||
wmi_unified_t handle, uint8_t *event,
|
||||
struct tgt_info *info,
|
||||
@ -865,6 +893,7 @@ int init_deinit_populate_phy_reg_cap(struct wlan_objmgr_psoc *psoc,
|
||||
info->service_ext_param.num_phy = 1;
|
||||
num_phy_reg_cap = 1;
|
||||
init_deinit_fill_host_reg_cap(&cap, ®_cap[0]);
|
||||
init_deinit_populate_tgt_ext_param(info, ®_cap[0]);
|
||||
target_if_debug("FW wireless modes 0x%llx",
|
||||
reg_cap[0].wireless_modes);
|
||||
} else {
|
||||
@ -985,8 +1014,9 @@ int init_deinit_populate_hal_reg_cap_ext2(wmi_unified_t wmi_handle,
|
||||
return qdf_status_to_os_return(status);
|
||||
}
|
||||
|
||||
status = ucfg_reg_update_hal_reg_cap(
|
||||
psoc, reg_cap[reg_idx].wireless_modes_ext,
|
||||
init_deinit_populate_tgt_ext2_param(info, ®_cap[reg_idx]);
|
||||
status = ucfg_reg_update_hal_cap_wireless_modes(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");
|
||||
|
@ -115,6 +115,8 @@
|
||||
#define WLAN_PDEV_FEXT_WIFI_RADAR_ENABLE 0x00000200
|
||||
/* Scan blanking support enabled.valid only for scan radio supported pdevs */
|
||||
#define WLAN_PDEV_FEXT_SCAN_BLANKING_EN 0x00000400
|
||||
/* Overlapping frequency support */
|
||||
#define WLAN_PDEV_FEXT_OVERLAPPING_FREQ 0x00000800
|
||||
|
||||
/* PDEV op flags */
|
||||
/* Enable htrate for wep and tkip */
|
||||
|
@ -470,10 +470,18 @@ struct wlan_psoc_host_hal_reg_capabilities_ext {
|
||||
* from service ready ext2 event.
|
||||
* @phy_id: phy id starts with 0
|
||||
* @wireless_modes_ext: REGDMN MODE, see REGDMN_MODE_ enum
|
||||
* @low_2ghz_chan_ext: 2 GHz channel low
|
||||
* @high_2ghz_chan_ext: 2 GHz channel High
|
||||
* @low_5ghz_chan_ext: 5 GHz channel low
|
||||
* @high_5ghz_chan_ext: 5 GHz channel High
|
||||
*/
|
||||
struct wlan_psoc_host_hal_reg_capabilities_ext2 {
|
||||
uint32_t phy_id;
|
||||
uint64_t wireless_modes_ext;
|
||||
uint32_t low_2ghz_chan_ext;
|
||||
uint32_t high_2ghz_chan_ext;
|
||||
uint32_t low_5ghz_chan_ext;
|
||||
uint32_t high_5ghz_chan_ext;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -2234,8 +2234,8 @@ QDF_STATUS reg_set_hal_reg_cap(
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS reg_update_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
|
||||
uint64_t wireless_modes, uint8_t phy_id)
|
||||
QDF_STATUS reg_update_hal_cap_wireless_modes(struct wlan_objmgr_psoc *psoc,
|
||||
uint64_t wireless_modes, uint8_t phy_id)
|
||||
{
|
||||
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
|
||||
|
||||
@ -2256,6 +2256,37 @@ QDF_STATUS reg_update_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS reg_update_hal_reg_range_caps(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t low_2g_chan,
|
||||
uint32_t high_2g_chan,
|
||||
uint32_t low_5g_chan,
|
||||
uint32_t high_5g_chan,
|
||||
uint8_t phy_id)
|
||||
{
|
||||
struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
|
||||
struct wlan_psoc_host_hal_reg_capabilities_ext *reg_cap;
|
||||
|
||||
if (!psoc) {
|
||||
reg_err("psoc is null");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
psoc_priv_obj = reg_get_psoc_obj(psoc);
|
||||
|
||||
if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
|
||||
reg_err("psoc reg component is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
reg_cap = &psoc_priv_obj->reg_cap[phy_id];
|
||||
reg_cap->low_2ghz_chan = low_2g_chan;
|
||||
reg_cap->high_2ghz_chan = high_2g_chan;
|
||||
reg_cap->low_5ghz_chan = low_5g_chan;
|
||||
reg_cap->high_5ghz_chan = high_5g_chan;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BAND_6GHZ) && defined(CONFIG_AFC_SUPPORT)
|
||||
bool reg_get_enable_6ghz_sp_mode_support(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
|
@ -434,6 +434,17 @@ bool reg_get_afc_noaction(struct wlan_objmgr_psoc *psoc);
|
||||
void reg_set_afc_noaction(struct wlan_objmgr_psoc *psoc, bool value);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* reg_update_hal_cap_wireless_modes() - update wireless modes
|
||||
* @psoc: psoc ptr
|
||||
* @modes: modes to set to
|
||||
* @phy_id: phy id
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS reg_update_hal_cap_wireless_modes(struct wlan_objmgr_psoc *psoc,
|
||||
uint64_t modes, uint8_t phy_id);
|
||||
|
||||
/**
|
||||
* reg_get_hal_reg_cap() - Get HAL REG capabilities
|
||||
* @psoc: psoc for country information
|
||||
@ -457,15 +468,22 @@ QDF_STATUS reg_set_hal_reg_cap(
|
||||
uint16_t phy_cnt);
|
||||
|
||||
/**
|
||||
* reg_update_hal_reg_cap() - Update HAL REG capabilities
|
||||
* reg_update_hal_reg_range_caps() - Update HAL REG frequency ranges
|
||||
* @psoc: psoc pointer
|
||||
* @wireless_modes: 11AX wireless modes
|
||||
* @lo_2g_chan: low 2g channel
|
||||
* @hi_2g_chan: high 2g channel
|
||||
* @lo_5g_chan: low 5g channel
|
||||
* @hi_5g_chan: high 2g channel
|
||||
* @phy_id: phy id
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS reg_update_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
|
||||
uint64_t wireless_modes, uint8_t phy_id);
|
||||
QDF_STATUS reg_update_hal_reg_range_caps(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t lo_2g_chan,
|
||||
uint32_t hi_2g_chan,
|
||||
uint32_t lo_5g_chan,
|
||||
uint32_t hi_5g_chan,
|
||||
uint8_t phy_id);
|
||||
|
||||
/**
|
||||
* reg_chan_in_range() - Check if the given channel is in pdev's channel range
|
||||
|
@ -644,6 +644,17 @@ QDF_STATUS ucfg_reg_11d_vdev_created_update(struct wlan_objmgr_vdev *vdev)
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ucfg_reg_update_hal_cap_wireless_modes() - update wireless modes
|
||||
* @psoc: psoc ptr
|
||||
* @modes: value of modes to update
|
||||
* @phy_id: phy id
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS ucfg_reg_update_hal_cap_wireless_modes(struct wlan_objmgr_psoc *psoc,
|
||||
uint64_t modes, uint8_t phy_id);
|
||||
|
||||
/**
|
||||
* ucfg_reg_get_hal_reg_cap() - return hal reg cap
|
||||
* @psoc: psoc ptr
|
||||
@ -666,15 +677,22 @@ QDF_STATUS ucfg_reg_set_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
|
||||
uint16_t phy_cnt);
|
||||
|
||||
/**
|
||||
* ucfg_reg_update_hal_reg_cap() - update hal reg cap
|
||||
* ucfg_reg_update_hal_reg_range_caps() - update hal reg frequency range fields
|
||||
* @psoc: psoc ptr
|
||||
* @wireless_modes: 11AX wireless modes
|
||||
* @low_2g_chan: low 2g channel
|
||||
* @high_2g_chan: high 2g channel
|
||||
* @low_5g_chan: low 5g channel
|
||||
* @high_5g_chan: high 2g channel
|
||||
* @phy_id: phy id
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS ucfg_reg_update_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
|
||||
uint64_t wireless_modes, uint8_t phy_id);
|
||||
QDF_STATUS ucfg_reg_update_hal_reg_range_caps(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t low_2g_chan,
|
||||
uint32_t high_2g_chan,
|
||||
uint32_t low_5g_chan,
|
||||
uint32_t high_5g_chan,
|
||||
uint8_t phy_id);
|
||||
|
||||
/**
|
||||
* ucfg_set_ignore_fw_reg_offload_ind() - API to set ignore regdb offload ind
|
||||
|
@ -332,6 +332,14 @@ QDF_STATUS ucfg_reg_11d_vdev_created_update(struct wlan_objmgr_vdev *vdev)
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS ucfg_reg_update_hal_cap_wireless_modes(struct wlan_objmgr_psoc *psoc,
|
||||
uint64_t modes, uint8_t phy_id)
|
||||
{
|
||||
return reg_update_hal_cap_wireless_modes(psoc, modes, phy_id);
|
||||
}
|
||||
|
||||
qdf_export_symbol(ucfg_reg_update_hal_cap_wireless_modes);
|
||||
|
||||
struct wlan_psoc_host_hal_reg_capabilities_ext *ucfg_reg_get_hal_reg_cap(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
@ -348,13 +356,19 @@ QDF_STATUS ucfg_reg_set_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
|
||||
}
|
||||
qdf_export_symbol(ucfg_reg_set_hal_reg_cap);
|
||||
|
||||
QDF_STATUS ucfg_reg_update_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
|
||||
uint64_t wireless_modes, uint8_t phy_id)
|
||||
QDF_STATUS ucfg_reg_update_hal_reg_range_caps(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t low_2g_chan,
|
||||
uint32_t high_2g_chan,
|
||||
uint32_t low_5g_chan,
|
||||
uint32_t high_5g_chan,
|
||||
uint8_t phy_id)
|
||||
{
|
||||
return reg_update_hal_reg_cap(psoc, wireless_modes, phy_id);
|
||||
return reg_update_hal_reg_range_caps(psoc, low_2g_chan,
|
||||
high_2g_chan, low_5g_chan, high_5g_chan,
|
||||
phy_id);
|
||||
}
|
||||
|
||||
qdf_export_symbol(ucfg_reg_update_hal_reg_cap);
|
||||
qdf_export_symbol(ucfg_reg_update_hal_reg_range_caps);
|
||||
|
||||
#ifdef DISABLE_CHANNEL_LIST
|
||||
#ifdef CONFIG_CHAN_FREQ_API
|
||||
|
@ -13046,6 +13046,10 @@ static QDF_STATUS extract_hal_reg_cap_ext2_tlv(
|
||||
param->phy_id = reg_caps->phy_id;
|
||||
param->wireless_modes_ext = convert_wireless_modes_ext_tlv(
|
||||
reg_caps->wireless_modes_ext);
|
||||
param->low_2ghz_chan_ext = reg_caps->low_2ghz_chan_ext;
|
||||
param->high_2ghz_chan_ext = reg_caps->high_2ghz_chan_ext;
|
||||
param->low_5ghz_chan_ext = reg_caps->low_5ghz_chan_ext;
|
||||
param->high_5ghz_chan_ext = reg_caps->high_5ghz_chan_ext;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user