diff options
| -rw-r--r-- | core/cds/inc/cds_concurrency.h | 7 | ||||
| -rw-r--r-- | core/cds/src/cds_concurrency.c | 17 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_hostapd.c | 14 |
3 files changed, 37 insertions, 1 deletions
diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h index d2b7d42a4d98..61c5aa8610ec 100644 --- a/core/cds/inc/cds_concurrency.h +++ b/core/cds/inc/cds_concurrency.h @@ -842,6 +842,13 @@ QDF_STATUS qdf_wait_for_connection_update(void); QDF_STATUS qdf_reset_connection_update(void); QDF_STATUS qdf_set_connection_update(void); QDF_STATUS qdf_init_connection_update(void); + +/** + * cds_stop_opportunistic_timer() - Stops opportunistic timer + * + * Return: QDF_STATUS + */ +QDF_STATUS cds_stop_opportunistic_timer(void); QDF_STATUS cds_restart_opportunistic_timer(bool check_state); QDF_STATUS cds_modify_sap_pcl_based_on_mandatory_channel(uint8_t *pcl_list_org, uint8_t *weight_list_org, diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index f178cc37451d..738815e0738a 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -9350,6 +9350,23 @@ static enum cds_conc_next_action cds_get_current_pref_hw_mode(void) } +QDF_STATUS cds_stop_opportunistic_timer(void) +{ + p_cds_contextType cds_ctx; + + cds_ctx = cds_get_global_context(); + if (!cds_ctx) { + cds_err("Invalid CDS context"); + return QDF_STATUS_E_FAILURE; + } + + if (cds_ctx->dbs_opportunistic_timer.state != QDF_TIMER_STATE_RUNNING) + return QDF_STATUS_SUCCESS; + + qdf_mc_timer_stop(&cds_ctx->dbs_opportunistic_timer); + return QDF_STATUS_SUCCESS; +} + /** * cds_restart_opportunistic_timer() - Restarts opportunistic timer * @check_state: check timer state if this flag is set, else restart diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 647bbeef92bc..6247905a92f5 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -9266,10 +9266,22 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, if (!QDF_IS_STATUS_SUCCESS(status)) hdd_err("ERR: clear event failed"); + /* + * Stop opportunistic timer here if running as we are already doing + * hw mode change before vdev start based on the new concurrency + * situation. If timer is not stopped and if it gets triggered before + * VDEV_UP, it will reset the hw mode to some wrong value. + */ + status = cds_stop_opportunistic_timer(); + if (status != QDF_STATUS_SUCCESS) { + hdd_err("Failed to stop DBS opportunistic timer"); + return -EINVAL; + } + status = cds_current_connections_update(pAdapter->sessionId, channel, SIR_UPDATE_REASON_START_AP); - if (QDF_STATUS_E_FAILURE == status) { + if (status == QDF_STATUS_E_FAILURE) { hdd_err("ERROR: connections update failed!!"); return -EINVAL; } |
