mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
Merge "qcacld-3.0: Disable SAP bringup in DFS when DFSmastercap is disabled"
This commit is contained in:
commit
e0313af26b
4 changed files with 79 additions and 7 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)
|
||||
|
|
|
|||
|
|
@ -1718,7 +1718,7 @@ static const struct nl80211_vendor_cmd_info wlan_hdd_cfg80211_vendor_events[] =
|
|||
};
|
||||
|
||||
/**
|
||||
* __is_driver_dfs_capable() - get driver DFS capability
|
||||
* __is_driver_dfs_capable() - get driver DFS offload capability
|
||||
* @wiphy: pointer to wireless wiphy structure.
|
||||
* @wdev: pointer to wireless_dev structure.
|
||||
* @data: Pointer to the data to be passed via vendor interface
|
||||
|
|
@ -17739,7 +17739,7 @@ void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx)
|
|||
{
|
||||
int value;
|
||||
bool fils_enabled, mac_spoofing_enabled;
|
||||
bool dfs_master_capable = true, is_oce_sta_enabled = false;
|
||||
bool is_oce_sta_enabled = false;
|
||||
QDF_STATUS status;
|
||||
struct wiphy *wiphy = hdd_ctx->wiphy;
|
||||
uint8_t allow_mcc_go_diff_bi = 0, enable_mcc = 0;
|
||||
|
|
@ -17764,11 +17764,7 @@ void wlan_hdd_update_wiphy(struct hdd_context *hdd_ctx)
|
|||
if (fils_enabled)
|
||||
wlan_hdd_cfg80211_set_wiphy_fils_feature(wiphy);
|
||||
|
||||
status = ucfg_mlme_get_dfs_master_capability(hdd_ctx->psoc,
|
||||
&dfs_master_capable);
|
||||
if (QDF_IS_STATUS_SUCCESS(status) && dfs_master_capable)
|
||||
wlan_hdd_cfg80211_set_dfs_offload_feature(wiphy);
|
||||
|
||||
wlan_hdd_cfg80211_set_dfs_offload_feature(wiphy);
|
||||
|
||||
status = ucfg_mlme_get_bigtk_support(hdd_ctx->psoc,
|
||||
&is_bigtk_supported);
|
||||
|
|
|
|||
|
|
@ -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