qcacld-3.0: Add support for STA+NAN+NDI+NDI

Add support for four port concurrency for
STA+NAN discovery + NDI + NDI.

Change-Id: I7d6d3f482a61bef7f3d0a31eee3fdfe5e5e9d879
CRs-Fixed: 2633982
此提交包含在:
gaurank kathpalia
2020-02-27 00:02:54 +05:30
提交者 nshrivas
父節點 d6a5f31685
當前提交 82511bc630
共有 12 個檔案被更改,包括 184 行新增35 行删除

查看文件

@@ -801,6 +801,14 @@ enum policy_mgr_two_connection_mode {
* SCC, SAP on 5 G
* @PM_SAP_NDI_SCC_5_NAN_DISC_24_DBS: SAP & NDI/NDP connection on 5 Ghz,
* NAN_DISC on 24 Ghz
* @PM_NAN_DISC_STA_24_NDI_5_DBS: STA and NAN Disc on 2.4Ghz and NDI on 5ghz DBS
* @PM_NAN_DISC_NDI_24_STA_5_DBS: NDI and NAN Disc on 2.4Ghz and STA on 5ghz DBS
* @PM_STA_NDI_5_NAN_DISC_24_DBS: STA, NDI on 5ghz and NAN Disc on 2.4Ghz DBS
* @PM_STA_NDI_NAN_DISC_24_SMM: STA, NDI, NAN Disc all on 2.4ghz SMM
* @PM_NAN_DISC_NDI_24_NDI_5_DBS: NDI and NAN Disc on 2.4Ghz and second NDI in
* 5ghz DBS
* @PM_NDI_NDI_5_NAN_DISC_24_DBS: Both NDI on 5ghz and NAN Disc on 2.4Ghz DBS
* @PM_NDI_NDI_NAN_DISC_24_SMM: Both NDI, NAN Disc on 2.4ghz SMM
*/
enum policy_mgr_three_connection_mode {
PM_STA_SAP_SCC_24_SAP_5_DBS,
@@ -810,6 +818,13 @@ enum policy_mgr_three_connection_mode {
PM_NAN_DISC_SAP_SCC_24_NDI_5_DBS,
PM_NAN_DISC_NDI_SCC_24_SAP_5_DBS,
PM_SAP_NDI_SCC_5_NAN_DISC_24_DBS,
PM_NAN_DISC_STA_24_NDI_5_DBS,
PM_NAN_DISC_NDI_24_STA_5_DBS,
PM_STA_NDI_5_NAN_DISC_24_DBS,
PM_STA_NDI_NAN_DISC_24_SMM,
PM_NAN_DISC_NDI_24_NDI_5_DBS,
PM_NDI_NDI_5_NAN_DISC_24_DBS,
PM_NDI_NDI_NAN_DISC_24_SMM,
PM_MAX_THREE_CONNECTION_MODE
};

查看文件

@@ -2146,38 +2146,48 @@ static bool policy_mgr_is_concurrency_allowed_4_port(
{
uint32_t i;
struct policy_mgr_psoc_priv_obj *pm_ctx;
uint8_t sap_cnt, go_cnt;
/* new STA may just have ssid, no channel until bssid assigned */
if (ch_freq == 0 && mode == PM_STA_MODE)
return true;
pm_ctx = policy_mgr_get_context(psoc);
if (!pm_ctx) {
policy_mgr_err("context is NULL");
sap_cnt = policy_mgr_mode_specific_connection_count(psoc,
PM_SAP_MODE, NULL);
go_cnt = policy_mgr_mode_specific_connection_count(psoc,
PM_P2P_GO_MODE, NULL);
if (sap_cnt || go_cnt) {
pm_ctx = policy_mgr_get_context(psoc);
if (!pm_ctx) {
policy_mgr_err("context is NULL");
return false;
}
if (policy_mgr_get_mcc_to_scc_switch_mode(psoc) !=
QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION) {
policy_mgr_err("couldn't start 4th port for bad force scc cfg");
return false;
}
if (pm_ctx->cfg.dual_mac_feature ||
!pm_ctx->cfg.sta_sap_scc_on_dfs_chnl ||
!pm_ctx->cfg.sta_sap_scc_on_lte_coex_chnl) {
policy_mgr_err(
"Couldn't start 4th port for bad cfg of dual mac, dfs scc, lte coex scc");
return false;
}
for (i = 0; i < pcl.pcl_len; i++)
if (ch_freq == pcl.pcl_list[i])
return true;
policy_mgr_err("4th port failed on ch freq %d with mode %d",
ch_freq, mode);
return false;
}
if (policy_mgr_get_mcc_to_scc_switch_mode(psoc) !=
QDF_MCC_TO_SCC_SWITCH_FORCE_WITHOUT_DISCONNECTION) {
policy_mgr_err("couldn't start 4th port for bad force scc cfg");
return false;
}
if (pm_ctx->cfg.dual_mac_feature ||
!pm_ctx->cfg.sta_sap_scc_on_dfs_chnl ||
!pm_ctx->cfg.sta_sap_scc_on_lte_coex_chnl) {
policy_mgr_err(
"Couldn't start 4th port for bad cfg of dual mac, dfs scc, lte coex scc");
return false;
}
for (i = 0; i < pcl.pcl_len; i++)
if (ch_freq == pcl.pcl_list[i])
return true;
policy_mgr_err("4th port failed on ch freq %d with mode %d",
ch_freq, mode);
return false;
return true;
}
#else
static inline bool policy_mgr_is_concurrency_allowed_4_port(

查看文件

@@ -703,7 +703,6 @@ static enum policy_mgr_pcl_type policy_mgr_get_pcl_4_port(
{
enum policy_mgr_three_connection_mode fourth_index = 0;
enum policy_mgr_pcl_type pcl;
enum policy_mgr_con_mode pm_mode;
/* Will be enhanced for other types of 4 port conc (NaN etc.)
* in future.
@@ -715,11 +714,12 @@ static enum policy_mgr_pcl_type policy_mgr_get_pcl_4_port(
/* SAP and P2P Go have same result in 4th port pcl table */
if (mode == PM_SAP_MODE || mode == PM_P2P_GO_MODE) {
pm_mode = PM_SAP_MODE;
} else if (mode == PM_STA_MODE) {
pm_mode = PM_STA_MODE;
} else {
policy_mgr_err("Can't start 4th port of type: %d", mode);
mode = PM_SAP_MODE;
}
if (mode != PM_STA_MODE && mode != PM_SAP_MODE &&
mode != PM_NDI_MODE) {
policy_mgr_err("Can't start 4th port if not STA, SAP, NDI");
return PM_MAX_PCL_TYPE;
}
@@ -731,7 +731,7 @@ static enum policy_mgr_pcl_type policy_mgr_get_pcl_4_port(
}
policy_mgr_debug("Index for 4th port pcl table: %d", fourth_index);
pcl = fourth_connection_pcl_dbs_table[fourth_index][pm_mode][pref];
pcl = fourth_connection_pcl_dbs_table[fourth_index][mode][pref];
return pcl;
}
@@ -1962,6 +1962,52 @@ enum policy_mgr_three_connection_mode
} else {
index = PM_MAX_THREE_CONNECTION_MODE;
}
} else if (count_nan_disc == 1 && count_ndi == 1 && count_sta == 1) {
/* Policy mgr only considers NAN Disc ch in 2.4GHz */
if (WLAN_REG_IS_24GHZ_CH_FREQ(
pm_conc_connection_list[list_sta[0]].freq) &&
WLAN_REG_IS_5GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[0]].freq)) {
index = PM_NAN_DISC_STA_24_NDI_5_DBS;
} else if (WLAN_REG_IS_5GHZ_CH_FREQ(
pm_conc_connection_list[list_sta[0]].freq) &&
WLAN_REG_IS_24GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[0]].freq)) {
index = PM_NAN_DISC_NDI_24_STA_5_DBS;
} else if (WLAN_REG_IS_5GHZ_CH_FREQ(
pm_conc_connection_list[list_sta[0]].freq) &&
WLAN_REG_IS_5GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[0]].freq)) {
index = PM_STA_NDI_5_NAN_DISC_24_DBS;
} else if (WLAN_REG_IS_24GHZ_CH_FREQ(
pm_conc_connection_list[list_sta[0]].freq) &&
WLAN_REG_IS_24GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[0]].freq)) {
index = PM_STA_NDI_NAN_DISC_24_SMM;
}
} else if (count_nan_disc == 1 && count_ndi == 2) {
/* Policy mgr only considers NAN Disc ch in 2.4GHz */
if (WLAN_REG_IS_24GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[0]].freq) &&
WLAN_REG_IS_5GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[1]].freq)) {
index = PM_NAN_DISC_NDI_24_NDI_5_DBS;
} else if (WLAN_REG_IS_5GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[0]].freq) &&
WLAN_REG_IS_24GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[0]].freq)) {
index = PM_NAN_DISC_NDI_24_NDI_5_DBS;
} else if (WLAN_REG_IS_5GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[0]].freq) &&
WLAN_REG_IS_5GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[0]].freq)) {
index = PM_NDI_NDI_5_NAN_DISC_24_DBS;
} else if (WLAN_REG_IS_24GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[0]].freq) &&
WLAN_REG_IS_24GHZ_CH_FREQ(
pm_conc_connection_list[list_ndi[0]].freq)) {
index = PM_NDI_NDI_NAN_DISC_24_SMM;
}
}
policy_mgr_debug(

查看文件

@@ -2110,8 +2110,9 @@ pm_third_connection_pcl_dbs_2x2_table = {
/**
* fourth_connection_pcl_dbs_table - table which provides PCL for
* the 4th connection, when we have 3 connections already in
* the system (with DBS supported by HW)
* the system (with DBS supported by HW), this table is for auto products.
*/
#ifdef FOURTH_CONNECTION_AUTO
const enum policy_mgr_pcl_type
fourth_connection_pcl_dbs_table
[PM_MAX_THREE_CONNECTION_MODE][PM_MAX_NUM_OF_MODE]
@@ -2131,6 +2132,35 @@ fourth_connection_pcl_dbs_table
[PM_SAP_NDI_SCC_5_NAN_DISC_24_DBS] = {
[PM_SAP_MODE] = { PM_24G, PM_24G, PM_24G } }
};
#else
/**
* fourth_connection_pcl_dbs_table - table which provides PCL for
* the 4th connection, when we have 3 connections already in
* the system (with DBS supported by HW), this table is for mobile products
* If you want to support any 4 port other than the below in MCL add below as
* other concurrencies supported by auto may not be PORed for mobile products
* and vice-versa.
*/
const enum policy_mgr_pcl_type
fourth_connection_pcl_dbs_table
[PM_MAX_THREE_CONNECTION_MODE][PM_MAX_NUM_OF_MODE]
[PM_MAX_CONC_PRIORITY_MODE] = {
[PM_NAN_DISC_STA_24_NDI_5_DBS] = {
[PM_NDI_MODE] = { PM_5G, PM_5G, PM_5G } },
[PM_NAN_DISC_NDI_24_STA_5_DBS] = {
[PM_NDI_MODE] = { PM_5G, PM_5G, PM_5G } },
[PM_STA_NDI_5_NAN_DISC_24_DBS] = {
[PM_NDI_MODE] = { PM_5G, PM_5G, PM_5G } },
[PM_STA_NDI_NAN_DISC_24_SMM] = {
[PM_NDI_MODE] = { PM_5G, PM_5G, PM_5G } },
[PM_NAN_DISC_NDI_24_NDI_5_DBS] = {
[PM_STA_MODE] = { PM_5G, PM_5G, PM_5G } },
[PM_NDI_NDI_5_NAN_DISC_24_DBS] = {
[PM_STA_MODE] = { PM_5G, PM_5G, PM_5G } },
[PM_NDI_NDI_NAN_DISC_24_SMM] = {
[PM_STA_MODE] = { PM_5G, PM_5G, PM_5G } }
};
#endif
#endif
/**