diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 41d66bbec9f2..cc60eab3295f 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1653,8 +1653,8 @@ struct hdd_context { #endif /* Present state of driver cds modules */ enum driver_modules_status driver_status; - /* MC timer interface change */ - qdf_mc_timer_t iface_change_timer; + /* interface idle work */ + qdf_delayed_work_t iface_idle_work; /* Interface change lock */ struct mutex iface_change_lock; bool rps; diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index a98c858b0601..e28c329374ed 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -1428,10 +1428,7 @@ static void wlan_hdd_purge_notifier(void) } mutex_lock(&hdd_ctx->iface_change_lock); - if (QDF_TIMER_STATE_RUNNING == - qdf_mc_timer_get_current_state(&hdd_ctx->iface_change_timer)) - qdf_mc_timer_stop(&hdd_ctx->iface_change_timer); - + qdf_cancel_delayed_work(&hdd_ctx->iface_idle_work); cds_shutdown_notifier_call(); cds_shutdown_notifier_purge(); mutex_unlock(&hdd_ctx->iface_change_lock); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 684221bcdf40..6eca640a1426 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2319,13 +2319,8 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, mutex_lock(&hdd_ctx->iface_change_lock); hdd_ctx->start_modules_in_progress = true; - if (QDF_TIMER_STATE_RUNNING == - qdf_mc_timer_get_current_state(&hdd_ctx->iface_change_timer)) { - - hdd_set_idle_ps_config(hdd_ctx, false); - hdd_debug("Interface change Timer running Stop timer"); - qdf_mc_timer_stop(&hdd_ctx->iface_change_timer); - } + hdd_set_idle_ps_config(hdd_ctx, false); + qdf_cancel_delayed_work(&hdd_ctx->iface_idle_work); switch (hdd_ctx->driver_status) { case DRIVER_MODULES_UNINITIALIZED: @@ -2756,8 +2751,8 @@ static int __hdd_stop(struct net_device *dev) */ if (hdd_check_for_opened_interfaces(hdd_ctx)) { hdd_debug("Closing all modules from the hdd_stop"); - qdf_mc_timer_start(&hdd_ctx->iface_change_timer, - hdd_ctx->config->iface_change_wait_time); + qdf_sched_delayed_work(&hdd_ctx->iface_idle_work, + hdd_ctx->config->iface_change_wait_time); hdd_prevent_suspend_timeout( hdd_ctx->config->iface_change_wait_time, WIFI_POWER_EVENT_WAKELOCK_IFACE_CHANGE_TIMER); @@ -5977,16 +5972,7 @@ static void hdd_wlan_exit(struct hdd_context *hdd_ctx) ENTER(); - if (QDF_TIMER_STATE_RUNNING == - qdf_mc_timer_get_current_state(&hdd_ctx->iface_change_timer)) { - hdd_debug("Stop interface change timer"); - qdf_mc_timer_stop(&hdd_ctx->iface_change_timer); - } - - if (!QDF_IS_STATUS_SUCCESS - (qdf_mc_timer_destroy(&hdd_ctx->iface_change_timer))) - hdd_err("Cannot delete interface change timer"); - + qdf_cancel_delayed_work(&hdd_ctx->iface_idle_work); hdd_unregister_notifiers(hdd_ctx); @@ -7842,8 +7828,9 @@ static struct hdd_context *hdd_context_create(struct device *dev) goto err_out; } - qdf_mc_timer_init(&hdd_ctx->iface_change_timer, QDF_TIMER_TYPE_SW, - hdd_iface_change_callback, (void *)hdd_ctx); + qdf_create_delayed_work(&hdd_ctx->iface_idle_work, + hdd_iface_change_callback, + (void *)hdd_ctx); mutex_init(&hdd_ctx->iface_change_lock); @@ -7924,7 +7911,6 @@ err_free_config: err_free_hdd_context: wiphy_free(hdd_ctx->wiphy); - qdf_mc_timer_destroy(&hdd_ctx->iface_change_timer); mutex_destroy(&hdd_ctx->iface_change_lock); err_out: @@ -9579,8 +9565,8 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) if (is_idle_stop && !ftm_mode) { mutex_unlock(&hdd_ctx->iface_change_lock); - qdf_mc_timer_start(&hdd_ctx->iface_change_timer, - hdd_ctx->config->iface_change_wait_time); + qdf_sched_delayed_work(&hdd_ctx->iface_idle_work, + hdd_ctx->config->iface_change_wait_time); hdd_prevent_suspend_timeout( hdd_ctx->config->iface_change_wait_time, WIFI_POWER_EVENT_WAKELOCK_IFACE_CHANGE_TIMER); @@ -9863,7 +9849,6 @@ int hdd_wlan_startup(struct device *dev) goto err_hdd_free_context; } - qdf_nbuf_init_replenish_timer(); #ifdef FEATURE_WLAN_CH_AVOID mutex_init(&hdd_ctx->avoid_freq_lock); @@ -9950,8 +9935,8 @@ int hdd_wlan_startup(struct device *dev) hdd_set_idle_ps_config(hdd_ctx, false); if (QDF_GLOBAL_FTM_MODE != hdd_get_conparam()) { - qdf_mc_timer_start(&hdd_ctx->iface_change_timer, - hdd_ctx->config->iface_change_wait_time); + qdf_sched_delayed_work(&hdd_ctx->iface_idle_work, + hdd_ctx->config->iface_change_wait_time); hdd_prevent_suspend_timeout( hdd_ctx->config->iface_change_wait_time, WIFI_POWER_EVENT_WAKELOCK_IFACE_CHANGE_TIMER); diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 965619f67bbf..2bd406f377ad 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -672,8 +672,8 @@ stop_modules: */ if (hdd_check_for_opened_interfaces(hdd_ctx)) { hdd_debug("Closing all modules from the add_virt_iface"); - qdf_mc_timer_start(&hdd_ctx->iface_change_timer, - hdd_ctx->config->iface_change_wait_time); + qdf_sched_delayed_work(&hdd_ctx->iface_idle_work, + hdd_ctx->config->iface_change_wait_time); hdd_prevent_suspend_timeout( hdd_ctx->config->iface_change_wait_time, WIFI_POWER_EVENT_WAKELOCK_IFACE_CHANGE_TIMER);