diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index b8de57b5dede..97f267dd07e6 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -34,11 +34,6 @@ struct target_psoc_info; -typedef const enum policy_mgr_pcl_type - pm_dbs_pcl_second_connection_table_type - [PM_MAX_ONE_CONNECTION_MODE][PM_MAX_NUM_OF_MODE] - [PM_MAX_CONC_PRIORITY_MODE]; - typedef const enum policy_mgr_pcl_type pm_dbs_pcl_third_connection_table_type [PM_MAX_TWO_CONNECTION_MODE][PM_MAX_NUM_OF_MODE] @@ -3290,4 +3285,16 @@ uint32_t policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, */ bool policy_mgr_is_sap_go_on_2g(struct wlan_objmgr_psoc *psoc); +/** + * policy_mgr_get_5g_scc_prefer() - Prefer 5G SCC + * @psoc: psoc object + * @mode: Connection Mode + * + * This function checks if 5G SCC is preferred. + * + * Return: True if 5G SCC is preferred + */ +bool policy_mgr_get_5g_scc_prefer( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode); + #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h index 6e3f0ae961f6..ac6bc3c78117 100644 --- a/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h +++ b/components/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h @@ -586,6 +586,28 @@ CFG_INI_UINT("g_enable_go_force_scc", 0, 1, 0, CFG_VALUE_OR_DEFAULT, \ CFG_INI_UINT("g_pcl_band_priority", 0, 1, 0, CFG_VALUE_OR_DEFAULT, \ "Set 5G and 6G Channel order") +/* + * + * g_prefer_5g_scc_to_dbs - prefer 5g scc to dbs + * @Min: 0 + * @Max: 0xFFFFFFFF + * @Default: 0 + * + * This ini is used to give higher priority for 5g scc than dbs. + * It is bitmap per enum policy_mgr_con_mode. + * For example in GO+STA(5G) mode, when TPUT is onfigured as wlan system + * preference option, If 5G SCC needs higher priority than dbs, set it as 0x8. + * + * Supported Feature: P2P GO + * + * Usage: External + * + * + */ +#define CFG_PREFER_5G_SCC_TO_DBS \ +CFG_INI_UINT("g_prefer_5g_scc_to_dbs", 0, 0xFFFFFFFF, 0, CFG_VALUE_OR_DEFAULT, \ + "5G SCC has higher priority than DBS") + #define CFG_POLICY_MGR_ALL \ CFG(CFG_MCC_TO_SCC_SWITCH) \ CFG(CFG_CONC_SYS_PREF) \ @@ -607,5 +629,6 @@ CFG_INI_UINT("g_pcl_band_priority", 0, 1, 0, CFG_VALUE_OR_DEFAULT, \ CFG(CFG_MARK_INDOOR_AS_DISABLE_FEATURE)\ CFG(CFG_ALLOW_MCC_GO_DIFF_BI) \ CFG(CFG_P2P_GO_ENABLE_FORCE_SCC) \ - CFG(CFG_PCL_BAND_PRIORITY) + CFG(CFG_PCL_BAND_PRIORITY) \ + CFG(CFG_PREFER_5G_SCC_TO_DBS) #endif diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c index d0ceb52e3ba8..e9cb42a04db7 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c @@ -4256,3 +4256,16 @@ bool policy_mgr_is_sap_go_on_2g(struct wlan_objmgr_psoc *psoc) return ret; } +bool policy_mgr_get_5g_scc_prefer( + struct wlan_objmgr_psoc *psoc, enum policy_mgr_con_mode mode) +{ + 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; + } + + return pm_ctx->cfg.prefer_5g_scc_to_dbs & (1 << mode); +} diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h index 0fe285b4f921..b616676d8bd2 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h @@ -191,8 +191,9 @@ extern struct policy_mgr_conc_connection_info extern const enum policy_mgr_pcl_type first_connection_pcl_table[PM_MAX_NUM_OF_MODE] [PM_MAX_CONC_PRIORITY_MODE]; -extern pm_dbs_pcl_second_connection_table_type - *second_connection_pcl_dbs_table; +extern enum policy_mgr_pcl_type + (*second_connection_pcl_dbs_table)[PM_MAX_ONE_CONNECTION_MODE] + [PM_MAX_NUM_OF_MODE][PM_MAX_CONC_PRIORITY_MODE]; extern pm_dbs_pcl_third_connection_table_type *third_connection_pcl_dbs_table; extern policy_mgr_next_action_two_connection_table_type @@ -248,6 +249,7 @@ struct sta_ap_intf_check_work_ctx { * @enable_sta_cxn_5g_band: Enable/Disable STA connection in 5G band * @go_force_scc: Enable/Disable P2P GO force SCC * @pcl_band_priority: PCL channel order between 5G and 6G. + * @prefer_5g_scc_to_dbs: Prefer to work in 5G SCC mode. */ struct policy_mgr_cfg { uint8_t mcc_to_scc_switch; @@ -271,6 +273,7 @@ struct policy_mgr_cfg { uint32_t chnl_select_plcy; uint8_t go_force_scc; enum policy_mgr_pcl_band_priority pcl_band_priority; + uint32_t prefer_5g_scc_to_dbs; }; /** diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c index 5f7c1531c835..3ef258af11a2 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c @@ -378,6 +378,34 @@ QDF_STATUS policy_mgr_psoc_close(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } +/** + * policy_mgr_update_5g_scc_prefer() - Update pcl if 5g scc is preferred + * @psoc: psoc object + * + * Return: void + */ +static void policy_mgr_update_5g_scc_prefer(struct wlan_objmgr_psoc *psoc) +{ + enum policy_mgr_con_mode mode; + + for (mode = PM_STA_MODE; mode < PM_MAX_NUM_OF_MODE; mode++) { + if (policy_mgr_get_5g_scc_prefer(psoc, mode)) { + (*second_connection_pcl_dbs_table) + [PM_STA_5_1x1][mode][PM_THROUGHPUT] = + PM_SCC_CH_24G; + policy_mgr_info("overwrite pm_second_connection_pcl_dbs_2x2_table, index %d mode %d system prefer %d new pcl %d", + PM_STA_5_1x1, mode, + PM_THROUGHPUT, PM_SCC_CH_24G); + (*second_connection_pcl_dbs_table) + [PM_STA_5_2x2][mode][PM_THROUGHPUT] = + PM_SCC_CH_24G; + policy_mgr_info("overwrite pm_second_connection_pcl_dbs_2x2_table, index %d mode %d system prefer %d new pcl %d", + PM_STA_5_2x2, mode, + PM_THROUGHPUT, PM_SCC_CH_24G); + } + } +} + QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) { QDF_STATUS status; @@ -446,12 +474,14 @@ QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) if (policy_mgr_is_hw_dbs_2x2_capable(psoc) || policy_mgr_is_hw_dbs_required_for_band(psoc, HW_MODE_MAC_BAND_2G) || - policy_mgr_is_2x2_1x1_dbs_capable(psoc)) + policy_mgr_is_2x2_1x1_dbs_capable(psoc)) { second_connection_pcl_dbs_table = &pm_second_connection_pcl_dbs_2x2_table; - else + policy_mgr_update_5g_scc_prefer(psoc); + } else { second_connection_pcl_dbs_table = &pm_second_connection_pcl_dbs_1x1_table; + } if (policy_mgr_is_hw_dbs_2x2_capable(psoc) || policy_mgr_is_hw_dbs_required_for_band(psoc, diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c index 8d4289bd954b..fa3cef1b4e9d 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c @@ -49,8 +49,9 @@ first_connection_pcl_table[PM_MAX_NUM_OF_MODE] [PM_NAN_DISC_MODE] = {PM_5G, PM_5G, PM_5G}, }; -pm_dbs_pcl_second_connection_table_type - *second_connection_pcl_dbs_table; +enum policy_mgr_pcl_type + (*second_connection_pcl_dbs_table)[PM_MAX_ONE_CONNECTION_MODE] + [PM_MAX_NUM_OF_MODE][PM_MAX_CONC_PRIORITY_MODE]; pm_dbs_pcl_third_connection_table_type *third_connection_pcl_dbs_table; policy_mgr_next_action_two_connection_table_type diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_1x1_dbs_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_1x1_dbs_i.h index 463dc02b90c3..7acc8292fa08 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_1x1_dbs_i.h +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_1x1_dbs_i.h @@ -26,8 +26,9 @@ * for the 2nd connection, when we have a connection already in * the system (with DBS supported by HW) */ -pm_dbs_pcl_second_connection_table_type -pm_second_connection_pcl_dbs_1x1_table = { +enum policy_mgr_pcl_type + pm_second_connection_pcl_dbs_1x1_table[PM_MAX_ONE_CONNECTION_MODE] + [PM_MAX_NUM_OF_MODE][PM_MAX_CONC_PRIORITY_MODE] = { [PM_STA_24_1x1] = { [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h index 1161f03b848a..45d84537f783 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_2x2_dbs_i.h @@ -28,8 +28,9 @@ * This table consolidates selection for P2PCLI, P2PGO, STA, SAP * into the single set of STA entries for 2.4G and 5G. */ -static pm_dbs_pcl_second_connection_table_type -pm_second_connection_pcl_dbs_2x2_table = { +static enum policy_mgr_pcl_type + pm_second_connection_pcl_dbs_2x2_table[PM_MAX_ONE_CONNECTION_MODE] + [PM_MAX_NUM_OF_MODE][PM_MAX_CONC_PRIORITY_MODE] = { [PM_STA_24_1x1] = { [PM_STA_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, [PM_SAP_MODE] = {PM_5G_SCC_CH, PM_5G_SCC_CH, PM_5G_SCC_CH}, diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c index 647a1a7d5f89..e95f07b85ed6 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c @@ -64,6 +64,7 @@ static QDF_STATUS policy_mgr_init_cfg(struct wlan_objmgr_psoc *psoc) cfg->mark_indoor_chnl_disable = cfg_get(psoc, CFG_MARK_INDOOR_AS_DISABLE_FEATURE); cfg->go_force_scc = cfg_get(psoc, CFG_P2P_GO_ENABLE_FORCE_SCC); + cfg->prefer_5g_scc_to_dbs = cfg_get(psoc, CFG_PREFER_5G_SCC_TO_DBS); return QDF_STATUS_SUCCESS; }