diff --git a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 06f377f5a853..bbcb7e4c295f 100644 --- a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -1709,14 +1709,7 @@ enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index( * * Return: True if master DBS control is enabled */ -static inline bool policy_mgr_is_scan_simultaneous_capable( - struct wlan_objmgr_psoc *psoc) -{ - if (policy_mgr_is_hw_dbs_capable(psoc)) - return true; - - return false; -} +bool policy_mgr_is_scan_simultaneous_capable(struct wlan_objmgr_psoc *psoc); /** * policy_mgr_is_mcc_adaptive_scheduler_enabled() - Function to @@ -1924,4 +1917,19 @@ uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, * Return: true for success, else false */ bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev); + +/** + * policy_mgr_get_updated_scan_and_fw_mode_config() - Function + * to get latest scan & fw config for DBS + * @psoc: PSOC object information + * @scan_config: DBS related scan config + * @fw_mode_config: DBS related FW config + * @dual_mac_disable_ini: DBS related ini config + * This function returns the latest DBS configuration for + * connection & scan, sent to FW + * Return: SUCCESS or FAILURE + */ +QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( + struct wlan_objmgr_psoc *psoc, uint32_t *scan_config, + uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini); #endif /* __WLAN_POLICY_MGR_API_H */ diff --git a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h index f0c73e983817..b10adbaff31a 100644 --- a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h +++ b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h @@ -794,6 +794,26 @@ enum policy_mgr_hw_mode_change { POLICY_MGR_SBS_IN_PROGRESS }; +/** + * enum dbs_support - structure to define INI values and their meaning + * + * @ENABLE_DBS_CXN_AND_SCAN: Enable DBS support for connection and scan + * @DISABLE_DBS_CXN_AND_SCAN: Disable DBS support for connection and scan + * @DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN: disable dbs support for + * connection but keep dbs support for scan + * @DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF: disable dbs support + * for connection but keep dbs for scan but switch off the async scan + * @ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF: enable dbs support for + * connection and scan but switch off the async scan + */ +enum dbs_support { + ENABLE_DBS_CXN_AND_SCAN, + DISABLE_DBS_CXN_AND_SCAN, + DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN, + DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF, + ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF, +}; + /** * struct policy_mgr_conc_connection_info - information of all existing * connections in the wlan system diff --git a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c index 924997fcf726..c284a9647f85 100644 --- a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c +++ b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c @@ -136,12 +136,32 @@ QDF_STATUS policy_mgr_get_updated_fw_mode_config( * * Checks if the dual mac feature is disabled in INI * - * Return: true if the dual mac feature is disabled from INI + * Return: true if the dual mac connection is disabled from INI */ bool policy_mgr_is_dual_mac_disabled_in_ini( struct wlan_objmgr_psoc *psoc) { - return wlan_objmgr_psoc_get_dual_mac_disable(psoc); + bool is_disabled = false; + enum dbs_support dbs_type = wlan_objmgr_psoc_get_dual_mac_disable(psoc); + + /* + * If DBS support for connection is disabled through INI then assume + * that DBS is not supported, so that policy manager takes + * the decision considering non-dbs cases only. + * + * For DBS scan check the INI value explicitly + */ + switch (dbs_type) { + case DISABLE_DBS_CXN_AND_SCAN: + case DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN: + case DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF: + is_disabled = true; + break; + default: + break; + } + + return is_disabled; } uint32_t policy_mgr_mcc_to_scc_switch_mode_in_user_cfg( diff --git a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c index 1b64f22c45e5..a2561f5b038e 100644 --- a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c +++ b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c @@ -375,13 +375,20 @@ void policy_mgr_init_dbs_config(struct wlan_objmgr_psoc *psoc, /* If dual mac features are disabled in the INI, we * need not proceed further */ - if (policy_mgr_is_dual_mac_disabled_in_ini(psoc)) { + if (DISABLE_DBS_CXN_AND_SCAN == + wlan_objmgr_psoc_get_dual_mac_disable(psoc)) { policy_mgr_err("Disabling dual mac capabilities"); /* All capabilites are initialized to 0. We can return */ goto done; } /* Initialize concurrent_scan_config_bits with default FW value */ + WMI_DBS_CONC_SCAN_CFG_ASYNC_DBS_SCAN_SET( + pm_ctx->dual_mac_cfg.cur_scan_config, + WMI_DBS_CONC_SCAN_CFG_ASYNC_DBS_SCAN_GET(scan_config)); + WMI_DBS_CONC_SCAN_CFG_SYNC_DBS_SCAN_SET( + pm_ctx->dual_mac_cfg.cur_scan_config, + WMI_DBS_CONC_SCAN_CFG_SYNC_DBS_SCAN_GET(scan_config)); WMI_DBS_CONC_SCAN_CFG_DBS_SCAN_SET( pm_ctx->dual_mac_cfg.cur_scan_config, WMI_DBS_CONC_SCAN_CFG_DBS_SCAN_GET(scan_config)); @@ -399,6 +406,9 @@ void policy_mgr_init_dbs_config(struct wlan_objmgr_psoc *psoc, WMI_DBS_FW_MODE_CFG_AGILE_DFS_SET( pm_ctx->dual_mac_cfg.cur_fw_mode_config, WMI_DBS_FW_MODE_CFG_AGILE_DFS_GET(fw_config)); + WMI_DBS_FW_MODE_CFG_DBS_FOR_CXN_SET( + pm_ctx->dual_mac_cfg.cur_fw_mode_config, + WMI_DBS_FW_MODE_CFG_DBS_FOR_CXN_GET(fw_config)); done: /* Initialize the previous scan/fw mode config */ pm_ctx->dual_mac_cfg.prev_scan_config = @@ -2567,3 +2577,52 @@ uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, return final_max_rf_chains; } + +bool policy_mgr_is_scan_simultaneous_capable(struct wlan_objmgr_psoc *psoc) +{ + if (DISABLE_DBS_CXN_AND_SCAN != + wlan_objmgr_psoc_get_dual_mac_disable(psoc)) + return true; + + return false; +} + +QDF_STATUS policy_mgr_get_updated_scan_and_fw_mode_config( + struct wlan_objmgr_psoc *psoc, uint32_t *scan_config, + uint32_t *fw_mode_config, uint32_t dual_mac_disable_ini) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return QDF_STATUS_E_FAILURE; + } + + *scan_config = pm_ctx->dual_mac_cfg.cur_scan_config; + *fw_mode_config = pm_ctx->dual_mac_cfg.cur_fw_mode_config; + switch (dual_mac_disable_ini) { + case DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN_WITH_ASYNC_SCAN_OFF: + policy_mgr_debug("dual_mac_disable_ini:%d async/dbs off", + dual_mac_disable_ini); + WMI_DBS_CONC_SCAN_CFG_ASYNC_DBS_SCAN_SET(*scan_config, 0); + WMI_DBS_FW_MODE_CFG_DBS_FOR_CXN_SET(*fw_mode_config, 0); + break; + case DISABLE_DBS_CXN_AND_ENABLE_DBS_SCAN: + policy_mgr_debug("dual_mac_disable_ini:%d dbs_cxn off", + dual_mac_disable_ini); + WMI_DBS_FW_MODE_CFG_DBS_FOR_CXN_SET(*fw_mode_config, 0); + break; + case ENABLE_DBS_CXN_AND_ENABLE_SCAN_WITH_ASYNC_SCAN_OFF: + policy_mgr_debug("dual_mac_disable_ini:%d async off", + dual_mac_disable_ini); + WMI_DBS_CONC_SCAN_CFG_ASYNC_DBS_SCAN_SET(*scan_config, 0); + break; + default: + break; + } + policy_mgr_debug("*scan_config:%x ", *scan_config); + policy_mgr_debug("*fw_mode_config:%x ", *fw_mode_config); + + return QDF_STATUS_SUCCESS; +} diff --git a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c index 7ecf7c1aa95e..fead940f99a6 100644 --- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c @@ -359,7 +359,8 @@ ucfg_scan_update_dbs_scan_ctrl_ext_flag(struct scan_start_request *req) /* Resetting the scan_ctrl_flags_ext to 0 */ req->scan_req.scan_ctrl_flags_ext = 0; - if (!policy_mgr_is_hw_dbs_capable(psoc)) + if (DISABLE_DBS_CXN_AND_SCAN == + wlan_objmgr_psoc_get_dual_mac_disable(psoc)) goto end; if (!qdf_is_macaddr_zero(&req->scan_req.bssid_list[0]))