mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
qcacld-3.0: STA SAP concurrency changes for DFS channel
Previously, if STA is connected to DFS channel and SAP starts on Non-DBS HW, then it is forced to start on DFS channel with BW 160 Mhz irrespective of BW on which STA is connected without CAC. Even after STA disconnects, SAP remains on DFS channel with BW 160Mhz. So, scan will be disabled and STA cannot be connected on any channel other than DFS channel. If STA is connected on non-DFS channel on 5 GHz and SAP starts, it will start on non-DFS channel as primary channel with BW 160 Mhz without CAC. Also, scanning was also allowed when SAP is started with BW 160 Mhz. This might violate regulatory in case radar comes up while scanning. Standalone SAP on DFS channel was not allowed. To fix this, Force set SCC for non-dbs HW, this way standalone SAP can come on DFS channel but scan will be disabled in such case and STA cannot be connected other than DFS channel. In case STA gets connected to dfs channel in non-dbs HW, then sap starts only on STA channel with force SCC with BW MIN(sta_chan_width, CH_WIDTH_80MHZ). Afterwards, if STA disconnects, restart the AP with BW CH_WIDTH_80MHZ on safe channel. Scan will be allowed as the DFS master capability is offloaded to AP with which STA is connected on DFS channel. Also, if standalone sap starts, then STA connects to DFS channel then SAP will restart with STA channel frequency and Channel width MIN(sta_chan_width, 80MHZ). If standalone SAP starts and then STA connects to non-dfs AP or SAP starts when STA is already connected to non-DFS AP, then ch_width is MAX(sta_chan_width, 80MHZ) (5 Ghz) or 20 Mhz (2.4 Ghz). If STA disconnects during SAP+STA on non-DFS, SAP won't restart unless the STA was connected on BW 160 Mhz. Change-Id: I1cebfc79f170c1e4e2710ed747ec804df3d8b441 CRs-Fixed: 2809255
This commit is contained in:
parent
ba8ff0781b
commit
e0a5c68700
10 changed files with 268 additions and 24 deletions
|
|
@ -179,6 +179,20 @@ QDF_STATUS policy_mgr_set_dual_mac_feature(struct wlan_objmgr_psoc *psoc,
|
|||
*/
|
||||
QDF_STATUS policy_mgr_get_force_1x1(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *force_1x1);
|
||||
|
||||
/**
|
||||
* policy_mgr_set_sta_sap_scc_on_dfs_chnl() - to set sta_sap_scc_on_dfs_chnl
|
||||
* @psoc: pointer to psoc
|
||||
* @sta_sap_scc_on_dfs_chnl: value to be set
|
||||
*
|
||||
* This API is used to set sta_sap_scc_on_dfs_chnl
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS up on success and any other status for failure.
|
||||
*/
|
||||
QDF_STATUS
|
||||
policy_mgr_set_sta_sap_scc_on_dfs_chnl(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t sta_sap_scc_on_dfs_chnl);
|
||||
|
||||
/**
|
||||
* policy_mgr_get_sta_sap_scc_on_dfs_chnl() - to find out if STA and SAP
|
||||
* SCC is allowed on DFS channel
|
||||
|
|
@ -818,6 +832,7 @@ uint32_t policy_mgr_get_dfs_beaconing_session_id(
|
|||
* if any DFS session
|
||||
* @psoc: PSOC object information
|
||||
* @ch_freq: pointer to channel frequency that needs to filled
|
||||
* @ch_width: pointer to channel width for the beaconing session
|
||||
*
|
||||
* If any beaconing session such as SAP or GO present and it is on DFS channel
|
||||
* then this function will return true
|
||||
|
|
@ -825,7 +840,9 @@ uint32_t policy_mgr_get_dfs_beaconing_session_id(
|
|||
* Return: true if session is on DFS or false if session is on non-dfs channel
|
||||
*/
|
||||
bool policy_mgr_is_any_dfs_beaconing_session_present(
|
||||
struct wlan_objmgr_psoc *psoc, uint32_t *ch_freq);
|
||||
struct wlan_objmgr_psoc *psoc, qdf_freq_t *ch_freq,
|
||||
enum hw_mode_bandwidth *ch_width);
|
||||
|
||||
/**
|
||||
* policy_mgr_allow_concurrency() - Check for allowed concurrency
|
||||
* combination consulting the PCL
|
||||
|
|
@ -2065,6 +2082,36 @@ QDF_STATUS policy_mgr_get_chan_by_session_id(struct wlan_objmgr_psoc *psoc,
|
|||
uint32_t policy_mgr_get_sap_go_count_on_mac(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *list, uint8_t mac_id);
|
||||
|
||||
/**
|
||||
* policy_mgr_is_sta_present_on_dfs_channel() - to find whether any DFS STA is
|
||||
* present
|
||||
* @psoc: PSOC object information
|
||||
* @vdev_id: pointer to vdev_id. It will be filled with the vdev_id of DFS STA
|
||||
* @ch_freq: pointer to channel frequency on which DFS STA is present
|
||||
* @ch_width: pointer channel width on which DFS STA is connected
|
||||
* If any STA is connected on DFS channel then this function will return true
|
||||
*
|
||||
* Return: true if session is on DFS or false if session is on non-dfs channel
|
||||
*/
|
||||
bool policy_mgr_is_sta_present_on_dfs_channel(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *vdev_id,
|
||||
qdf_freq_t *ch_freq,
|
||||
enum hw_mode_bandwidth *ch_width);
|
||||
|
||||
/**
|
||||
* policy_mgr_is_sta_present_on_freq() - Checks whether sta is present on the
|
||||
* given frequency
|
||||
* @psoc: PSOC object information
|
||||
* @vdev_id: pointer to vdev_id. It will be filled with the vdev_id of DFS STA
|
||||
* @ch_freq: channel for which this checks is needed
|
||||
* @ch_width: pointer channel width on which DFS STA is connected
|
||||
*
|
||||
* Return: true if STA is found in ch_freq
|
||||
*/
|
||||
bool policy_mgr_is_sta_present_on_freq(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *vdev_id, qdf_freq_t ch_freq,
|
||||
enum hw_mode_bandwidth *ch_width);
|
||||
|
||||
/**
|
||||
* policy_mgr_is_sta_gc_active_on_mac() - Is there active sta/gc for a
|
||||
* given mac id
|
||||
|
|
@ -2966,6 +3013,14 @@ QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config(
|
|||
bool policy_mgr_is_safe_channel(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t ch_freq);
|
||||
|
||||
/**
|
||||
* policy_mgr_get_ch_width() - Convert hw_mode_bandwidth to phy_ch_width
|
||||
* @bw: Hardware mode band width used by WMI
|
||||
*
|
||||
* Return: phy_ch_width
|
||||
*/
|
||||
enum phy_ch_width policy_mgr_get_ch_width(enum hw_mode_bandwidth bw);
|
||||
|
||||
/**
|
||||
* policy_mgr_is_force_scc() - checks if SCC needs to be
|
||||
* mandated
|
||||
|
|
|
|||
|
|
@ -120,6 +120,22 @@ QDF_STATUS policy_mgr_get_force_1x1(struct wlan_objmgr_psoc *psoc,
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
policy_mgr_set_sta_sap_scc_on_dfs_chnl(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t sta_sap_scc_on_dfs_chnl)
|
||||
{
|
||||
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 QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
pm_ctx->cfg.sta_sap_scc_on_dfs_chnl = sta_sap_scc_on_dfs_chnl;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
policy_mgr_get_sta_sap_scc_on_dfs_chnl(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *sta_sap_scc_on_dfs_chnl)
|
||||
|
|
@ -3103,6 +3119,77 @@ bool policy_mgr_is_multiple_active_sta_sessions(struct wlan_objmgr_psoc *psoc)
|
|||
psoc, PM_STA_MODE, NULL) > 1;
|
||||
}
|
||||
|
||||
bool policy_mgr_is_sta_present_on_dfs_channel(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *vdev_id,
|
||||
qdf_freq_t *ch_freq,
|
||||
enum hw_mode_bandwidth *ch_width)
|
||||
{
|
||||
struct policy_mgr_conc_connection_info *conn_info;
|
||||
bool status = false;
|
||||
uint32_t conn_index = 0;
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
if (!pm_ctx) {
|
||||
policy_mgr_err("Invalid Context");
|
||||
return false;
|
||||
}
|
||||
qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
|
||||
for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
|
||||
conn_index++) {
|
||||
conn_info = &pm_conc_connection_list[conn_index];
|
||||
if (conn_info->in_use &&
|
||||
(conn_info->mode == PM_STA_MODE ||
|
||||
conn_info->mode == PM_P2P_CLIENT_MODE) &&
|
||||
(wlan_reg_is_dfs_for_freq(pm_ctx->pdev, conn_info->freq) ||
|
||||
(wlan_reg_is_5ghz_ch_freq(conn_info->freq) &&
|
||||
conn_info->bw == HW_MODE_160_MHZ))) {
|
||||
*vdev_id = conn_info->vdev_id;
|
||||
*ch_freq = pm_conc_connection_list[conn_index].freq;
|
||||
*ch_width = conn_info->bw;
|
||||
status = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
bool policy_mgr_is_sta_present_on_freq(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *vdev_id,
|
||||
qdf_freq_t ch_freq,
|
||||
enum hw_mode_bandwidth *ch_width)
|
||||
{
|
||||
struct policy_mgr_conc_connection_info *conn_info;
|
||||
bool status = false;
|
||||
uint32_t conn_index = 0;
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
if (!pm_ctx) {
|
||||
policy_mgr_err("Invalid Context");
|
||||
return false;
|
||||
}
|
||||
qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
|
||||
for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
|
||||
conn_index++) {
|
||||
conn_info = &pm_conc_connection_list[conn_index];
|
||||
if (conn_info->in_use &&
|
||||
(conn_info->mode == PM_STA_MODE ||
|
||||
conn_info->mode == PM_P2P_CLIENT_MODE) &&
|
||||
ch_freq == conn_info->freq) {
|
||||
*vdev_id = conn_info->vdev_id;
|
||||
*ch_width = conn_info->bw;
|
||||
status = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
bool policy_mgr_is_sta_gc_active_on_mac(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t mac_id)
|
||||
{
|
||||
|
|
@ -3217,7 +3304,8 @@ uint32_t policy_mgr_get_dfs_beaconing_session_id(
|
|||
}
|
||||
|
||||
bool policy_mgr_is_any_dfs_beaconing_session_present(
|
||||
struct wlan_objmgr_psoc *psoc, uint32_t *ch_freq)
|
||||
struct wlan_objmgr_psoc *psoc, qdf_freq_t *ch_freq,
|
||||
enum hw_mode_bandwidth *ch_width)
|
||||
{
|
||||
struct policy_mgr_conc_connection_info *conn_info;
|
||||
bool status = false;
|
||||
|
|
@ -3234,10 +3322,13 @@ bool policy_mgr_is_any_dfs_beaconing_session_present(
|
|||
conn_index++) {
|
||||
conn_info = &pm_conc_connection_list[conn_index];
|
||||
if (conn_info->in_use &&
|
||||
wlan_reg_is_dfs_for_freq(pm_ctx->pdev, conn_info->freq) &&
|
||||
(PM_SAP_MODE == conn_info->mode ||
|
||||
PM_P2P_GO_MODE == conn_info->mode)) {
|
||||
(conn_info->mode == PM_SAP_MODE ||
|
||||
conn_info->mode == PM_P2P_GO_MODE) &&
|
||||
(wlan_reg_is_dfs_for_freq(pm_ctx->pdev, conn_info->freq) ||
|
||||
(wlan_reg_is_5ghz_ch_freq(conn_info->freq) &&
|
||||
conn_info->bw == HW_MODE_160_MHZ))) {
|
||||
*ch_freq = pm_conc_connection_list[conn_index].freq;
|
||||
*ch_width = conn_info->bw;
|
||||
status = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -3249,7 +3340,9 @@ bool policy_mgr_is_any_dfs_beaconing_session_present(
|
|||
bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
uint32_t ap_dfs_ch_freq = 0;
|
||||
qdf_freq_t dfs_ch_frq = 0;
|
||||
uint8_t vdev_id;
|
||||
enum hw_mode_bandwidth ch_width;
|
||||
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
if (!pm_ctx) {
|
||||
|
|
@ -3257,8 +3350,17 @@ bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc)
|
|||
return false;
|
||||
}
|
||||
|
||||
policy_mgr_is_any_dfs_beaconing_session_present(psoc, &ap_dfs_ch_freq);
|
||||
if (!ap_dfs_ch_freq)
|
||||
if (policy_mgr_is_sta_present_on_dfs_channel(psoc, &vdev_id,
|
||||
&dfs_ch_frq,
|
||||
&ch_width)) {
|
||||
policymgr_nofl_err("DFS STA present vdev_id %d ch_feq %d ch_width %d",
|
||||
vdev_id, dfs_ch_frq, ch_width);
|
||||
return false;
|
||||
}
|
||||
|
||||
policy_mgr_is_any_dfs_beaconing_session_present(psoc, &dfs_ch_frq,
|
||||
&ch_width);
|
||||
if (!dfs_ch_frq)
|
||||
return false;
|
||||
/*
|
||||
* 1) if agile & DFS scans are supportet
|
||||
|
|
@ -3273,8 +3375,8 @@ bool policy_mgr_scan_trim_5g_chnls_for_dfs_ap(struct wlan_objmgr_psoc *psoc)
|
|||
policy_mgr_get_single_mac_scan_with_dfs_config(psoc))
|
||||
return false;
|
||||
|
||||
policy_mgr_debug("scan skip 5g chan due to dfs ap(ch %d) present",
|
||||
ap_dfs_ch_freq);
|
||||
policy_mgr_debug("scan skip 5g chan due to dfs ap(ch %d / ch_width %d) present",
|
||||
dfs_ch_frq, ch_width);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -570,15 +570,14 @@ QDF_STATUS policy_mgr_pdev_get_pcl(struct wlan_objmgr_psoc *psoc,
|
|||
void pm_dbs_opportunistic_timer_handler(void *data);
|
||||
enum policy_mgr_con_mode policy_mgr_get_mode(uint8_t type,
|
||||
uint8_t subtype);
|
||||
enum hw_mode_bandwidth policy_mgr_get_bw(enum phy_ch_width chan_width);
|
||||
|
||||
/**
|
||||
* policy_mgr_get_bw() - Convert hw_mode_bandwidth to phy_ch_width
|
||||
* @bw: Hardware mode band width used by WMI
|
||||
* policy_mgr_get_bw() - Convert phy_ch_width to hw_mode_bandwidth.
|
||||
* @chan_width: phy_ch_width
|
||||
*
|
||||
* Return: phy_ch_width
|
||||
* Return: hw_mode_bandwidth
|
||||
*/
|
||||
enum phy_ch_width policy_mgr_get_ch_width(enum hw_mode_bandwidth bw);
|
||||
enum hw_mode_bandwidth policy_mgr_get_bw(enum phy_ch_width chan_width);
|
||||
|
||||
QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
|
||||
enum policy_mgr_pcl_type pcl,
|
||||
|
|
|
|||
|
|
@ -55,9 +55,15 @@ static QDF_STATUS policy_mgr_init_cfg(struct wlan_objmgr_psoc *psoc)
|
|||
cfg_get(psoc, CFG_FORCE_1X1_FEATURE);
|
||||
cfg->sta_sap_scc_on_dfs_chnl =
|
||||
cfg_get(psoc, CFG_STA_SAP_SCC_ON_DFS_CHAN);
|
||||
|
||||
/*
|
||||
* Force set sta_sap_scc_on_dfs_chnl on Non-DBS HW so that standalone
|
||||
* SAP is not allowed on DFS channel on non-DBS HW, Also, force SCC in
|
||||
* case of STA+SAP
|
||||
*/
|
||||
if (cfg->sta_sap_scc_on_dfs_chnl == 2 &&
|
||||
!cfg_get(psoc, CFG_ENABLE_DFS_MASTER_CAPABILITY))
|
||||
cfg->sta_sap_scc_on_dfs_chnl = 0;
|
||||
cfg->sta_sap_scc_on_dfs_chnl = 1;
|
||||
cfg->nan_sap_scc_on_lte_coex_chnl =
|
||||
cfg_get(psoc, CFG_NAN_SAP_SCC_ON_LTE_COEX_CHAN);
|
||||
cfg->sta_sap_scc_on_lte_coex_chnl =
|
||||
|
|
|
|||
Loading…
Reference in a new issue