diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index d0e6ee9e7e62..f9d38dc4c9b6 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -704,6 +704,18 @@ enum policy_mgr_con_mode policy_mgr_convert_device_mode_to_qdf_type( enum QDF_OPMODE policy_mgr_get_qdf_mode_from_pm( enum policy_mgr_con_mode device_mode); +/** + * policy_mgr_check_n_start_opportunistic_timer - check single mac upgrade + * needed or not, if needed start the oppurtunistic timer. + * @psoc: pointer to SOC + * + * This function starts the oppurtunistic timer if hw_mode change is needed + * + * Return: QDF_STATUS + */ +QDF_STATUS policy_mgr_check_n_start_opportunistic_timer( + struct wlan_objmgr_psoc *psoc); + /** * policy_mgr_pdev_set_hw_mode() - Set HW mode command to FW * @psoc: PSOC object information diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 2d9cab406595..061a068e6eb0 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -93,6 +93,29 @@ void policy_mgr_hw_mode_transition_cb(uint32_t old_hw_mode_index, return; } +QDF_STATUS policy_mgr_check_n_start_opportunistic_timer( + struct wlan_objmgr_psoc *psoc) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("PM ctx not valid. Oppurtunistic timer cannot start"); + return QDF_STATUS_E_FAILURE; + } + if (policy_mgr_need_opportunistic_upgrade(psoc)) { + /* let's start the timer */ + qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); + status = qdf_mc_timer_start( + &pm_ctx->dbs_opportunistic_timer, + DBS_OPPORTUNISTIC_TIME * 1000); + if (!QDF_IS_STATUS_SUCCESS(status)) + policy_mgr_err("Failed to start dbs opportunistic timer"); + } + return status; +} + QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc, uint32_t session_id, enum hw_mode_ss_config mac0_ss, @@ -1458,13 +1481,22 @@ void policy_mgr_checkn_update_hw_mode_single_mac_mode( qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock); for (i = 0; i < MAX_NUMBER_OF_CONC_CONNECTIONS; i++) { - if (pm_conc_connection_list[i].in_use) + if (pm_conc_connection_list[i].in_use) { if (!WLAN_REG_IS_SAME_BAND_CHANNELS(channel, pm_conc_connection_list[i].chan)) { qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); policy_mgr_debug("DBS required"); return; } + if (policy_mgr_is_hw_dbs_2x2_capable(psoc) && + (WLAN_REG_IS_24GHZ_CH(channel) || + WLAN_REG_IS_24GHZ_CH + (pm_conc_connection_list[i].chan))) { + qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); + policy_mgr_debug("DBS required"); + return; + } + } } qdf_mutex_release(&pm_ctx->qdf_conc_list_lock); pm_dbs_opportunistic_timer_handler((void *)psoc); diff --git a/src/wlan_policy_mgr_pcl.c b/src/wlan_policy_mgr_pcl.c index 1a4c8f4c5200..e41025045d5d 100644 --- a/src/wlan_policy_mgr_pcl.c +++ b/src/wlan_policy_mgr_pcl.c @@ -130,16 +130,7 @@ void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc, */ policy_mgr_set_pcl_for_existing_combo(psoc, PM_STA_MODE); /* do we need to change the HW mode */ - if (policy_mgr_need_opportunistic_upgrade(psoc)) { - /* let's start the timer */ - qdf_mc_timer_stop(&pm_ctx->dbs_opportunistic_timer); - qdf_status = qdf_mc_timer_start( - &pm_ctx->dbs_opportunistic_timer, - DBS_OPPORTUNISTIC_TIME * 1000); - if (!QDF_IS_STATUS_SUCCESS(qdf_status)) - policy_mgr_err("Failed to start dbs opportunistic timer"); - } - + policy_mgr_check_n_start_opportunistic_timer(psoc); return; }