mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
qcacld-3.0: Disable SAP bringup in DFS when DFSmastercap
is disabled Issue Scenario: 1) INI gEnableDFSMasterCap is set to 0 2) User tries to force start SAP on 160 MHz. 3) SAP starts on 160 MHz which contains DFS channels. This is a violation since the DUT does not support DFS master capability. To fix this, stop the SAP bringup if atleast one of the bonded channels is DFS. CRs-Fixed: 4516874 Change-Id: Iaeb77d52059505bafb8a0d38386cb1790432b498
This commit is contained in:
parent
221de7eef1
commit
1b0f7e3489
3 changed files with 76 additions and 0 deletions
|
|
@ -210,6 +210,24 @@ QDF_STATUS
|
|||
policy_mgr_get_sta_sap_scc_on_dfs_chnl(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *sta_sap_scc_on_dfs_chnl);
|
||||
|
||||
/**
|
||||
* policy_mgr_is_bonded_chan_dfs() - check whether the given bonded
|
||||
* channel configuration falls under DFS
|
||||
* @psoc: pointer to psoc
|
||||
* @ch_width: channel width of the operating channel
|
||||
* @mhz_freq_seg1: center frequency of segment 1; used for 80+80 MHz
|
||||
* @chan_freq: primary/operating channel frequency in MHz
|
||||
*
|
||||
* This API checks whether the given channel or bonded channel span
|
||||
* includes DFS, based on the channel width and frequency segments.
|
||||
*
|
||||
* Return: true if the given bonded channel is DFS, else false.
|
||||
*/
|
||||
bool
|
||||
policy_mgr_is_bonded_chan_dfs(struct wlan_objmgr_psoc *psoc,
|
||||
enum phy_ch_width ch_width,
|
||||
qdf_freq_t mhz_freq_seg1,
|
||||
uint32_t chan_freq);
|
||||
/**
|
||||
* policy_mgr_get_dfs_master_dynamic_enabled() - support dfs master or not
|
||||
* on AP interafce when STA+SAP(GO) concurrency
|
||||
|
|
|
|||
|
|
@ -181,6 +181,45 @@ policy_mgr_get_sta_sap_scc_on_dfs_chnl(struct wlan_objmgr_psoc *psoc,
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
bool
|
||||
policy_mgr_is_bonded_chan_dfs(struct wlan_objmgr_psoc *psoc,
|
||||
enum phy_ch_width ch_width,
|
||||
qdf_freq_t mhz_freq_seg1,
|
||||
uint32_t chan_freq)
|
||||
{
|
||||
bool is_ch_dfs = false;
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
if (!pm_ctx) {
|
||||
policy_mgr_err("pm_ctx is NULL");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ch_width == CH_WIDTH_160MHZ) {
|
||||
if (wlan_reg_get_5g_bonded_channel_state_for_freq(pm_ctx->pdev,
|
||||
chan_freq,
|
||||
ch_width)
|
||||
== CHANNEL_STATE_DFS)
|
||||
is_ch_dfs = true;
|
||||
} else if (ch_width == CH_WIDTH_80P80MHZ) {
|
||||
if (wlan_reg_get_channel_state_for_freq(
|
||||
pm_ctx->pdev,
|
||||
chan_freq) ==
|
||||
CHANNEL_STATE_DFS ||
|
||||
wlan_reg_get_channel_state_for_freq(
|
||||
pm_ctx->pdev,
|
||||
mhz_freq_seg1) ==
|
||||
CHANNEL_STATE_DFS)
|
||||
is_ch_dfs = true;
|
||||
} else {
|
||||
if (wlan_reg_is_dfs_for_freq(pm_ctx->pdev, chan_freq))
|
||||
is_ch_dfs = true;
|
||||
}
|
||||
|
||||
return is_ch_dfs;
|
||||
}
|
||||
|
||||
static bool
|
||||
policy_mgr_update_dfs_master_dynamic_enabled(
|
||||
struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
|
||||
|
|
|
|||
|
|
@ -5244,6 +5244,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
|
|||
bool deliver_start_evt = true;
|
||||
struct s_ext_cap *p_ext_cap;
|
||||
enum reg_phymode reg_phy_mode, updated_phy_mode;
|
||||
bool dfs_master_capable;
|
||||
|
||||
hdd_enter();
|
||||
|
||||
|
|
@ -5787,6 +5788,24 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
|
|||
config->ch_width_orig = CH_WIDTH_20MHZ;
|
||||
}
|
||||
|
||||
status = ucfg_mlme_get_dfs_master_capability(hdd_ctx->psoc,
|
||||
&dfs_master_capable);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
hdd_err("Failed to get dfs master capable");
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!dfs_master_capable &&
|
||||
policy_mgr_is_bonded_chan_dfs(hdd_ctx->psoc,
|
||||
config->ch_width_orig,
|
||||
config->ch_params.mhz_freq_seg1,
|
||||
config->chan_freq)) {
|
||||
hdd_err("Failed to bringup SAP; Atleast one bonded channel is DFS");
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (wlan_hdd_setup_driver_overrides(adapter)) {
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
|
|
|
|||
Loading…
Reference in a new issue