qcacld-3.0: Disallow SAP+SAP+STA on same MAC
For DBS HW, reject STA or SAP connection if result to SAP+SAP and STA active on same mac. SAP+SAP+SAP SCC is still allowed. Change-Id: If30cf58d2b16fc3ff4dfff4f75d7eeaa51786cad CRs-Fixed: 2498837
This commit is contained in:
@@ -2483,9 +2483,42 @@ bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc,
|
||||
return match;
|
||||
}
|
||||
|
||||
/**
|
||||
* policy_mgr_is_multi_ap_plus_sta_3vif_conc() - Check multiple AP plus STA
|
||||
* concurrency
|
||||
* @mode1: policy_mgr_con_mode of connection 1
|
||||
* @mode2: policy_mgr_con_mode of connection 2
|
||||
* @mode2: policy_mgr_con_mode of connection 3
|
||||
*
|
||||
* Check the 3vif concurrency is SAP(GO)+SAP(GO)+STA or not based on
|
||||
* connection mode.
|
||||
*
|
||||
* Return: True/False
|
||||
*/
|
||||
static bool policy_mgr_is_multi_ap_plus_sta_3vif_conc(
|
||||
enum policy_mgr_con_mode mode1, enum policy_mgr_con_mode mode2,
|
||||
enum policy_mgr_con_mode mode3)
|
||||
{
|
||||
if (mode1 == PM_STA_MODE &&
|
||||
(mode2 == PM_SAP_MODE || mode2 == PM_P2P_GO_MODE) &&
|
||||
(mode3 == PM_SAP_MODE || mode3 == PM_P2P_GO_MODE))
|
||||
return true;
|
||||
if (mode2 == PM_STA_MODE &&
|
||||
(mode1 == PM_SAP_MODE || mode1 == PM_P2P_GO_MODE) &&
|
||||
(mode3 == PM_SAP_MODE || mode3 == PM_P2P_GO_MODE))
|
||||
return true;
|
||||
if (mode3 == PM_STA_MODE &&
|
||||
(mode1 == PM_SAP_MODE || mode1 == PM_P2P_GO_MODE) &&
|
||||
(mode2 == PM_SAP_MODE || mode2 == PM_P2P_GO_MODE))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* policy_mgr_allow_new_home_channel() - Check for allowed number of
|
||||
* home channels
|
||||
* @mode: policy_mgr_con_mode of new connection,
|
||||
* @channel: channel on which new connection is coming up
|
||||
* @num_connections: number of current connections
|
||||
*
|
||||
@@ -2495,8 +2528,9 @@ bool policy_mgr_disallow_mcc(struct wlan_objmgr_psoc *psoc,
|
||||
*
|
||||
* Return: True/False
|
||||
*/
|
||||
bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t channel, uint32_t num_connections)
|
||||
bool policy_mgr_allow_new_home_channel(
|
||||
struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode,
|
||||
uint8_t channel, uint32_t num_connections)
|
||||
{
|
||||
bool status = true;
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
@@ -2566,6 +2600,35 @@ bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc,
|
||||
policy_mgr_err("don't allow 3rd home channel on same MAC");
|
||||
status = false;
|
||||
}
|
||||
} else {
|
||||
/* Existing two connections are SCC */
|
||||
if (policy_mgr_is_hw_dbs_capable(psoc) == false) {
|
||||
/* keep legacy chip "allow" as it is */
|
||||
policy_mgr_debug("allow 2 intf SCC + new intf ch %d for legacy hw",
|
||||
channel);
|
||||
} else if ((pm_conc_connection_list[0].mode ==
|
||||
PM_NAN_DISC_MODE &&
|
||||
pm_conc_connection_list[1].mode ==
|
||||
PM_NDI_MODE) ||
|
||||
(pm_conc_connection_list[0].mode ==
|
||||
PM_NDI_MODE &&
|
||||
pm_conc_connection_list[1].mode ==
|
||||
PM_NAN_DISC_MODE)) {
|
||||
/*
|
||||
* NAN + NDI are managed in Firmware by dividing
|
||||
* up slots. Connection on NDI is re-negotiable
|
||||
* and therefore a 3rd connection with the
|
||||
* same MAC is possible.
|
||||
*/
|
||||
} else if (wlan_reg_is_same_band_channels(
|
||||
channel, pm_conc_connection_list[0].chan) &&
|
||||
policy_mgr_is_multi_ap_plus_sta_3vif_conc(
|
||||
pm_conc_connection_list[0].mode,
|
||||
pm_conc_connection_list[1].mode,
|
||||
mode)) {
|
||||
policy_mgr_err("don't allow 3rd home channel on same MAC - sta existing");
|
||||
status = false;
|
||||
}
|
||||
}
|
||||
} else if ((num_connections == 1)
|
||||
&& (mcc_to_scc_switch ==
|
||||
|
@@ -2137,8 +2137,8 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc,
|
||||
|
||||
if (channel) {
|
||||
/* don't allow 3rd home channel on same MAC */
|
||||
if (!policy_mgr_allow_new_home_channel(psoc,
|
||||
channel, num_connections))
|
||||
if (!policy_mgr_allow_new_home_channel(psoc, mode, channel,
|
||||
num_connections))
|
||||
goto done;
|
||||
|
||||
/*
|
||||
|
@@ -535,8 +535,9 @@ QDF_STATUS policy_mgr_get_channel_list(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *pcl_channels, uint32_t *len,
|
||||
enum policy_mgr_con_mode mode,
|
||||
uint8_t *pcl_weights, uint32_t weight_len);
|
||||
bool policy_mgr_allow_new_home_channel(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t channel, uint32_t num_connections);
|
||||
bool policy_mgr_allow_new_home_channel(
|
||||
struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode,
|
||||
uint8_t channel, uint32_t num_connections);
|
||||
bool policy_mgr_is_5g_channel_allowed(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t channel, uint32_t *list,
|
||||
enum policy_mgr_con_mode mode);
|
||||
|
Reference in New Issue
Block a user