qcacmn: Ignore regulatory offload indication from FW

Based on the ini "ignore_fw_reg_offload_ind" ignore regulatory
offload indicatin from fw.

Change-Id: Ia95b5bdda6ee1fcc2b07f28f997a7c80afcbc32b
CRs-Fixed: 2533001
This commit is contained in:
Rajeev Kumar Sirasanagandla
2019-08-05 21:35:14 +05:30
committed by nshrivas
parent f3f9797014
commit 816b503c44
11 changed files with 96 additions and 0 deletions

View File

@@ -52,10 +52,19 @@ static inline uint32_t get_chan_list_cc_event_id(void)
static bool tgt_if_regulatory_is_regdb_offloaded(struct wlan_objmgr_psoc *psoc) static bool tgt_if_regulatory_is_regdb_offloaded(struct wlan_objmgr_psoc *psoc)
{ {
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
struct wlan_lmac_if_reg_rx_ops *reg_rx_ops;
reg_rx_ops = target_if_regulatory_get_rx_ops(psoc);
if (!wmi_handle) if (!wmi_handle)
return false; return false;
if (reg_rx_ops->reg_ignore_fw_reg_offload_ind &&
reg_rx_ops->reg_ignore_fw_reg_offload_ind(psoc)) {
target_if_debug("User disabled regulatory offload from ini");
return 0;
}
return wmi_service_enabled(wmi_handle, wmi_service_regulatory_db); return wmi_service_enabled(wmi_handle, wmi_service_regulatory_db);
} }

View File

@@ -28,10 +28,19 @@
bool tgt_if_regulatory_is_11d_offloaded(struct wlan_objmgr_psoc *psoc) bool tgt_if_regulatory_is_11d_offloaded(struct wlan_objmgr_psoc *psoc)
{ {
wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); wmi_unified_t wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
struct wlan_lmac_if_reg_rx_ops *reg_rx_ops;
reg_rx_ops = target_if_regulatory_get_rx_ops(psoc);
if (!wmi_handle) if (!wmi_handle)
return false; return false;
if (reg_rx_ops->reg_ignore_fw_reg_offload_ind &&
reg_rx_ops->reg_ignore_fw_reg_offload_ind(psoc)) {
target_if_debug("Ignore fw reg 11d offload indication");
return 0;
}
return wmi_service_enabled(wmi_handle, wmi_service_11d_offload); return wmi_service_enabled(wmi_handle, wmi_service_11d_offload);
} }

View File

@@ -984,6 +984,7 @@ struct wlan_lmac_if_reg_rx_ops {
bool dfs_enable); bool dfs_enable);
QDF_STATUS (*reg_modify_pdev_chan_range)(struct QDF_STATUS (*reg_modify_pdev_chan_range)(struct
wlan_objmgr_pdev *pdev); wlan_objmgr_pdev *pdev);
bool (*reg_ignore_fw_reg_offload_ind)(struct wlan_objmgr_psoc *psoc);
}; };
#ifdef CONVERGED_P2P_ENABLE #ifdef CONVERGED_P2P_ENABLE

View File

@@ -316,6 +316,9 @@ static void wlan_lmac_if_umac_reg_rx_ops_register(
rx_ops->reg_rx_ops.reg_modify_pdev_chan_range = rx_ops->reg_rx_ops.reg_modify_pdev_chan_range =
wlan_reg_modify_pdev_chan_range; wlan_reg_modify_pdev_chan_range;
rx_ops->reg_rx_ops.reg_ignore_fw_reg_offload_ind =
tgt_reg_ignore_fw_reg_offload_ind;
} }
#ifdef CONVERGED_P2P_ENABLE #ifdef CONVERGED_P2P_ENABLE

View File

@@ -86,6 +86,7 @@ struct chan_change_cbk_entry {
* country update is pending for pdev (phy_id). * country update is pending for pdev (phy_id).
* @world_country_pending: In this array, element[phy_id] is true if any world * @world_country_pending: In this array, element[phy_id] is true if any world
* country update is pending for pdev (phy_id). * country update is pending for pdev (phy_id).
* @ignore_fw_reg_offload_ind: Ignore FW reg offload indication
*/ */
struct wlan_regulatory_psoc_priv_obj { struct wlan_regulatory_psoc_priv_obj {
struct mas_chan_params mas_chan_params[PSOC_MAX_PHY_REG_CAP]; struct mas_chan_params mas_chan_params[PSOC_MAX_PHY_REG_CAP];
@@ -104,6 +105,7 @@ struct wlan_regulatory_psoc_priv_obj {
bool dfs_enabled; bool dfs_enabled;
enum band_info band_capability; enum band_info band_capability;
bool indoor_chan_enabled; bool indoor_chan_enabled;
bool ignore_fw_reg_offload_ind;
bool enable_11d_supp_original; bool enable_11d_supp_original;
bool enable_11d_supp; bool enable_11d_supp;
bool is_11d_offloaded; bool is_11d_offloaded;

View File

@@ -3383,3 +3383,29 @@ enum reg_wifi_band reg_freq_to_band(uint16_t freq)
return REG_BAND_UNKNOWN; return REG_BAND_UNKNOWN;
} }
#endif /* CONFIG_CHAN_FREQ_API */ #endif /* CONFIG_CHAN_FREQ_API */
QDF_STATUS reg_set_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc)
{
struct wlan_regulatory_psoc_priv_obj *psoc_reg;
psoc_reg = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_reg)) {
reg_err("psoc reg component is NULL");
return QDF_STATUS_E_INVAL;
}
psoc_reg->ignore_fw_reg_offload_ind = true;
return QDF_STATUS_SUCCESS;
}
bool reg_get_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc)
{
struct wlan_regulatory_psoc_priv_obj *psoc_reg;
psoc_reg = reg_get_psoc_obj(psoc);
if (!IS_VALID_PSOC_REG_OBJ(psoc_reg))
return false;
return psoc_reg->ignore_fw_reg_offload_ind;
}

View File

@@ -905,4 +905,22 @@ uint16_t reg_min_chan_freq(void);
uint16_t reg_max_chan_freq(void); uint16_t reg_max_chan_freq(void);
#endif /* CONFIG_CHAN_FREQ_API */ #endif /* CONFIG_CHAN_FREQ_API */
/**
* reg_set_ignore_fw_reg_offload_ind() - Set if regdb offload indication
* needs to be ignored
* @psoc: Pointer to psoc
*
* Return: QDF_STATUS
*/
QDF_STATUS reg_set_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc);
/**
* reg_get_ignore_fw_reg_offload_ind() - Check whether regdb offload indication
* needs to be ignored
*
* @psoc: Pointer to psoc
*/
bool reg_get_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc);
#endif #endif

View File

@@ -65,4 +65,13 @@ QDF_STATUS tgt_reg_set_11d_offloaded(struct wlan_objmgr_psoc *psoc,
*/ */
QDF_STATUS tgt_reg_process_ch_avoid_event(struct wlan_objmgr_psoc *psoc, QDF_STATUS tgt_reg_process_ch_avoid_event(struct wlan_objmgr_psoc *psoc,
struct ch_avoid_ind_type *ch_avoid_evnt); struct ch_avoid_ind_type *ch_avoid_evnt);
/**
* tgt_reg_ignore_fw_reg_offload_ind() - Check whether regdb offload indication
* from FW needs to be ignored.
*
* @psoc: Pointer to psoc
*/
bool tgt_reg_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc);
#endif #endif

View File

@@ -371,4 +371,13 @@ struct wlan_psoc_host_hal_reg_capabilities_ext *ucfg_reg_get_hal_reg_cap(
QDF_STATUS ucfg_reg_set_hal_reg_cap(struct wlan_objmgr_psoc *psoc, QDF_STATUS ucfg_reg_set_hal_reg_cap(struct wlan_objmgr_psoc *psoc,
struct wlan_psoc_host_hal_reg_capabilities_ext *reg_cap, struct wlan_psoc_host_hal_reg_capabilities_ext *reg_cap,
uint16_t phy_cnt); uint16_t phy_cnt);
/**
* ucfg_set_ignore_fw_reg_offload_ind() - API to set ignore regdb offload ind
* @psoc: psoc ptr
*
* Return: QDF_STATUS
*/
QDF_STATUS ucfg_set_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc);
#endif #endif

View File

@@ -70,3 +70,8 @@ QDF_STATUS tgt_reg_process_ch_avoid_event(struct wlan_objmgr_psoc *psoc,
{ {
return reg_process_ch_avoid_event(psoc, ch_avoid_evnt); return reg_process_ch_avoid_event(psoc, ch_avoid_evnt);
} }
bool tgt_reg_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc)
{
return reg_get_ignore_fw_reg_offload_ind(psoc);
}

View File

@@ -328,3 +328,8 @@ void ucfg_reg_restore_cached_channels(struct wlan_objmgr_pdev *pdev)
reg_restore_cached_channels(pdev); reg_restore_cached_channels(pdev);
} }
#endif #endif
QDF_STATUS ucfg_set_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc)
{
return reg_set_ignore_fw_reg_offload_ind(psoc);
}