diff --git a/hif/src/ce/ce_tasklet.c b/hif/src/ce/ce_tasklet.c index 40909e5ee6..f64aff2ff1 100644 --- a/hif/src/ce/ce_tasklet.c +++ b/hif/src/ce/ce_tasklet.c @@ -99,19 +99,11 @@ static bool work_initialized; * * Return: N/A */ -#ifdef CONFIG_CNSS -static void init_tasklet_work(struct work_struct *work, - work_func_t work_handler) -{ - cnss_init_work(work, work_handler); -} -#else static void init_tasklet_work(struct work_struct *work, work_func_t work_handler) { INIT_WORK(work, work_handler); } -#endif /** * init_tasklet_workers() - init_tasklet_workers diff --git a/qdf/linux/src/i_qdf_defer.h b/qdf/linux/src/i_qdf_defer.h index d2615c7f13..b2e5398563 100644 --- a/qdf/linux/src/i_qdf_defer.h +++ b/qdf/linux/src/i_qdf_defer.h @@ -36,9 +36,6 @@ #include #include #include -#ifdef CONFIG_CNSS -#include -#endif #include #include #include @@ -177,11 +174,7 @@ static inline QDF_STATUS __qdf_init_work(qdf_handle_t hdl, { work->fn = func; work->arg = arg; -#ifdef CONFIG_CNSS - cnss_init_work(&work->work, __qdf_defer_func); -#else INIT_WORK(&work->work, __qdf_defer_func); -#endif return QDF_STATUS_SUCCESS; } diff --git a/qdf/linux/src/i_qdf_time.h b/qdf/linux/src/i_qdf_time.h index fc5e6ab3bc..ee05ecc826 100644 --- a/qdf/linux/src/i_qdf_time.h +++ b/qdf/linux/src/i_qdf_time.h @@ -178,21 +178,14 @@ static inline bool __qdf_system_time_after_eq(__qdf_time_t a, __qdf_time_t b) * * Return: Time in microseconds */ -#ifdef CONFIG_CNSS static inline uint64_t __qdf_get_monotonic_boottime(void) { struct timespec ts; - cnss_get_monotonic_boottime(&ts); + get_monotonic_boottime(&ts); return ((uint64_t) ts.tv_sec * 1000000) + (ts.tv_nsec / 1000); } -#else -static inline uint64_t __qdf_get_monotonic_boottime(void) -{ - return __qdf_system_ticks_to_msecs(__qdf_system_ticks()) * 1000; -} -#endif /* CONFIG_CNSS */ #ifdef QCA_WIFI_3_0_ADRASTEA @@ -229,15 +222,11 @@ static inline uint64_t __qdf_get_log_timestamp(void) */ static inline uint64_t __qdf_get_log_timestamp(void) { -#ifdef CONFIG_CNSS struct timespec ts; - cnss_get_boottime(&ts); + ktime_get_ts(&ts); return ((uint64_t) ts.tv_sec * 1000000) + (ts.tv_nsec / 1000); -#else - return __qdf_system_ticks_to_msecs(__qdf_system_ticks()) * 1000; -#endif /* CONFIG_CNSS */ } #endif /* QCA_WIFI_3_0_ADRASTEA */ diff --git a/qdf/linux/src/qdf_lock.c b/qdf/linux/src/qdf_lock.c index 3450243b8f..33d77c3c8e 100644 --- a/qdf/linux/src/qdf_lock.c +++ b/qdf/linux/src/qdf_lock.c @@ -30,9 +30,6 @@ #include #include -#ifdef CONFIG_CNSS -#include -#endif #ifdef CONFIG_MCL #include #include @@ -249,13 +246,8 @@ EXPORT_SYMBOL(qdf_mutex_release); */ static const char *qdf_wake_lock_name(qdf_wake_lock_t *lock) { -#if defined CONFIG_CNSS if (lock->name) return lock->name; -#elif defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK) - if (lock->ws.name) - return lock->ws.name; -#endif return "UNNAMED_WAKELOCK"; } EXPORT_SYMBOL(qdf_wake_lock_name); @@ -271,11 +263,7 @@ EXPORT_SYMBOL(qdf_wake_lock_name); */ QDF_STATUS qdf_wake_lock_create(qdf_wake_lock_t *lock, const char *name) { -#if defined CONFIG_CNSS - cnss_pm_wake_lock_init(lock, name); -#elif defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK) - wake_lock_init(lock, WAKE_LOCK_SUSPEND, name); -#endif + wakeup_source_init(lock, name); return QDF_STATUS_SUCCESS; } EXPORT_SYMBOL(qdf_wake_lock_create); @@ -296,11 +284,7 @@ QDF_STATUS qdf_wake_lock_acquire(qdf_wake_lock_t *lock, uint32_t reason) WIFI_POWER_EVENT_DEFAULT_WAKELOCK_TIMEOUT, WIFI_POWER_EVENT_WAKELOCK_TAKEN); #endif -#if defined CONFIG_CNSS - cnss_pm_wake_lock(lock); -#elif defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK) - wake_lock(lock); -#endif + __pm_stay_awake(lock); return QDF_STATUS_SUCCESS; } EXPORT_SYMBOL(qdf_wake_lock_acquire); @@ -328,11 +312,7 @@ QDF_STATUS qdf_wake_lock_timeout_acquire(qdf_wake_lock_t *lock, uint32_t msec, WIFI_POWER_EVENT_WAKELOCK_TAKEN); } #endif -#if defined CONFIG_CNSS - cnss_pm_wake_lock_timeout(lock, msec); -#elif defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK) - wake_lock_timeout(lock, msecs_to_jiffies(msec)); -#endif + __pm_wakeup_event(lock, msec); return QDF_STATUS_SUCCESS; } EXPORT_SYMBOL(qdf_wake_lock_timeout_acquire); @@ -353,11 +333,7 @@ QDF_STATUS qdf_wake_lock_release(qdf_wake_lock_t *lock, uint32_t reason) WIFI_POWER_EVENT_DEFAULT_WAKELOCK_TIMEOUT, WIFI_POWER_EVENT_WAKELOCK_RELEASED); #endif -#if defined CONFIG_CNSS - cnss_pm_wake_lock_release(lock); -#elif defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK) - wake_unlock(lock); -#endif + __pm_relax(lock); return QDF_STATUS_SUCCESS; } EXPORT_SYMBOL(qdf_wake_lock_release); @@ -372,11 +348,7 @@ EXPORT_SYMBOL(qdf_wake_lock_release); */ QDF_STATUS qdf_wake_lock_destroy(qdf_wake_lock_t *lock) { -#if defined CONFIG_CNSS - cnss_pm_wake_lock_destroy(lock); -#elif defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK) - wake_lock_destroy(lock); -#endif + wakeup_source_trash(lock); return QDF_STATUS_SUCCESS; } EXPORT_SYMBOL(qdf_wake_lock_destroy); diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index a138ae7422..c4ca834080 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1400,11 +1400,7 @@ void *wmi_unified_attach(void *scn_handle, wmi_runtime_pm_init(wmi_handle); qdf_spinlock_create(&wmi_handle->eventq_lock); qdf_nbuf_queue_init(&wmi_handle->event_queue); -#ifdef CONFIG_CNSS - cnss_init_work(&wmi_handle->rx_event_work, wmi_rx_event_work); -#else INIT_WORK(&wmi_handle->rx_event_work, wmi_rx_event_work); -#endif #ifdef WMI_INTERFACE_EVENT_LOGGING qdf_spinlock_create(&wmi_handle->wmi_record_lock); #endif