qcacld-3.0: Ignore regulatory offload indication from FW

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

Change-Id: I6e20f2100eeac8e93baa5c5d3f3d1c8b33356aed
CRs-Fixed: 2532989
This commit is contained in:
Rajeev Kumar Sirasanagandla
2019-08-05 21:33:03 +05:30
committed by nshrivas
parent 1bb77499c5
commit 1b3a535500
9 changed files with 109 additions and 1 deletions

View File

@@ -2283,6 +2283,10 @@ static void mlme_init_reg_cfg(struct wlan_objmgr_psoc *psoc,
reg->enable_11d_in_world_mode = cfg_get(psoc,
CFG_ENABLE_11D_IN_WORLD_MODE);
reg->scan_11d_interval = cfg_get(psoc, CFG_SCAN_11D_INTERVAL);
reg->ignore_fw_reg_offload_ind = cfg_get(
psoc,
CFG_IGNORE_FW_REG_OFFLOAD_IND);
qdf_uint8_array_parse(cfg_default(CFG_VALID_CHANNEL_LIST),
channel_list,
CFG_VALID_CHANNEL_LIST_LEN,

View File

@@ -242,6 +242,38 @@
"", \
"country code")
/*
* <ini>
* ignore_fw_reg_offload_ind - If set, Ignore the FW offload indication
* @Min: 0
* @Max: 1
* @Default: 0
*
* This ini is used to ignore regdb offload indication from FW and
* regulatory will be treated as non offload.
* There is a case where FW is sending the offload indication in
* service ready event but not sending the cc list event
* WMI_REG_CHAN_LIST_CC_EVENTID and because of this driver is not
* able to populate the channel list. To address this issue, this ini
* is added. If this ini is enabled, regulatory will always be treated as
* non offload solution.
*
* This ini should only be enabled to circumvent the above mentioned firmware
* bug.
*
* Related: None
*
* Supported Feature: STA/AP
*
* Usage: External
*
* </ini>
*/
#define CFG_IGNORE_FW_REG_OFFLOAD_IND CFG_INI_BOOL( \
"ignore_fw_reg_offload_ind", \
0, \
"Ignore Regulatory offloads Indication from FW")
#define CFG_REG_ALL \
CFG(CFG_SELF_GEN_FRM_PWR) \
CFG(CFG_ENABLE_11D_IN_WORLD_MODE) \
@@ -251,6 +283,7 @@
CFG(CFG_SCAN_11D_INTERVAL) \
CFG(CFG_VALID_CHANNEL_LIST) \
CFG(CFG_COUNTRY_CODE) \
CFG(CFG_IGNORE_FW_REG_OFFLOAD_IND) \
CFG_SAP_AVOID_ACS_FREQ_LIST_ALL
#endif /* CFG_MLME_REG_H__ */

View File

@@ -2257,4 +2257,15 @@ mlme_get_peer_phymode(struct wlan_objmgr_psoc *psoc, uint8_t *mac,
*/
QDF_STATUS mlme_set_tgt_wpa3_roam_cap(struct wlan_objmgr_psoc *psoc,
uint32_t akm_bitmap);
/**
* wlan_mlme_get_ignore_fw_reg_offload_ind() - Get the
* ignore_fw_reg_offload_ind ini
* @psoc: pointer to psoc object
* @disabled: output pointer to hold user config
*
* Return: QDF Status
*/
QDF_STATUS
wlan_mlme_get_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc,
bool *disabled);
#endif /* _WLAN_MLME_API_H_ */

View File

@@ -2107,6 +2107,7 @@ struct wlan_mlme_mwc {
* @avoid_acs_freq_list: List of the frequencies which need to be avoided
* during acs
* @avoid_acs_freq_list_num: Number of the frequencies to be avoided during acs
* @ignore_fw_reg_offload_ind: Ignore fw regulatory offload indication
*/
struct wlan_mlme_reg {
uint32_t self_gen_frm_pwr;
@@ -2124,6 +2125,7 @@ struct wlan_mlme_reg {
uint16_t avoid_acs_freq_list[CFG_VALID_CHANNEL_LIST_LEN];
uint8_t avoid_acs_freq_list_num;
#endif
bool ignore_fw_reg_offload_ind;
};
/**

View File

@@ -3920,4 +3920,19 @@ bool ucfg_mlme_validate_full_roam_scan_period(uint32_t full_roam_scan_period);
* Return: True if roam_scan_period is in expected range, false otherwise.
*/
bool ucfg_mlme_validate_scan_period(uint32_t roam_scan_period);
/**
* ucfg_mlme_get_ignore_fw_reg_offload_ind() - Get the
* ignore_fw_reg_offload_ind ini
* @psoc: pointer to psoc object
* @disabled: output pointer to hold user config
*
* Return: QDF Status
*/
static inline QDF_STATUS
ucfg_mlme_get_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc,
bool *disabled)
{
return wlan_mlme_get_ignore_fw_reg_offload_ind(psoc, disabled);
}
#endif /* _WLAN_MLME_UCFG_API_H_ */

View File

@@ -3542,3 +3542,17 @@ QDF_STATUS mlme_set_tgt_wpa3_roam_cap(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_mlme_get_ignore_fw_reg_offload_ind(struct wlan_objmgr_psoc *psoc,
bool *disabled)
{
struct wlan_mlme_psoc_obj *mlme_obj;
mlme_obj = mlme_get_psoc_obj(psoc);
if (!mlme_obj)
return QDF_STATUS_E_FAILURE;
*disabled = mlme_obj->cfg.reg.ignore_fw_reg_offload_ind;
return QDF_STATUS_SUCCESS;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -91,4 +91,14 @@ void hdd_modify_indoor_channel_state_flags(
struct regulatory_channel *cds_chan,
enum channel_enum chan_enum, int chan_num, bool disable);
/**
* hdd_update_regdb_offload_config() - Update regdb offload disable ini
* for regulatory component.
*
* @psoc: psoc ptr
*
* Return: None
*/
void hdd_update_regdb_offload_config(struct hdd_context *hdd_ctx);
#endif

View File

@@ -15090,6 +15090,8 @@ int hdd_update_config(struct hdd_context *hdd_ctx)
ret = hdd_update_cds_config(hdd_ctx);
ret = hdd_update_user_config(hdd_ctx);
hdd_update_regdb_offload_config(hdd_ctx);
return ret;
}

View File

@@ -1492,3 +1492,20 @@ int hdd_regulatory_init(struct hdd_context *hdd_ctx, struct wiphy *wiphy)
return 0;
}
#endif
void hdd_update_regdb_offload_config(struct hdd_context *hdd_ctx)
{
QDF_STATUS status;
bool ignore_fw_reg_offload_ind = false;
status = ucfg_mlme_get_ignore_fw_reg_offload_ind(
hdd_ctx->psoc,
&ignore_fw_reg_offload_ind);
if (!ignore_fw_reg_offload_ind) {
hdd_debug("regdb offload is based on firmware capability");
return;
}
hdd_debug("Ignore regdb offload Indication from FW");
ucfg_set_ignore_fw_reg_offload_ind(hdd_ctx->psoc);
}