qcacmn: Clean up OS wrapper functions

Use OS standard APIs instead of CNSS wrapper functions

Change-Id: Icd048f41864c33463f4bb582d8d184816fa77c5d
CRs-Fixed: 1000797
This commit is contained in:
Yuanyuan Liu
2016-04-21 16:20:39 -07:00
committed by Akash Patel
parent d8d4c735a8
commit ae38003449
5 changed files with 7 additions and 65 deletions

View File

@@ -99,19 +99,11 @@ static bool work_initialized;
* *
* Return: N/A * 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, static void init_tasklet_work(struct work_struct *work,
work_func_t work_handler) work_func_t work_handler)
{ {
INIT_WORK(work, work_handler); INIT_WORK(work, work_handler);
} }
#endif
/** /**
* init_tasklet_workers() - init_tasklet_workers * init_tasklet_workers() - init_tasklet_workers

View File

@@ -36,9 +36,6 @@
#include <linux/version.h> #include <linux/version.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#ifdef CONFIG_CNSS
#include <net/cnss.h>
#endif
#include <qdf_types.h> #include <qdf_types.h>
#include <qdf_status.h> #include <qdf_status.h>
#include <qdf_trace.h> #include <qdf_trace.h>
@@ -177,11 +174,7 @@ static inline QDF_STATUS __qdf_init_work(qdf_handle_t hdl,
{ {
work->fn = func; work->fn = func;
work->arg = arg; work->arg = arg;
#ifdef CONFIG_CNSS
cnss_init_work(&work->work, __qdf_defer_func);
#else
INIT_WORK(&work->work, __qdf_defer_func); INIT_WORK(&work->work, __qdf_defer_func);
#endif
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }

View File

@@ -178,21 +178,14 @@ static inline bool __qdf_system_time_after_eq(__qdf_time_t a, __qdf_time_t b)
* *
* Return: Time in microseconds * Return: Time in microseconds
*/ */
#ifdef CONFIG_CNSS
static inline uint64_t __qdf_get_monotonic_boottime(void) static inline uint64_t __qdf_get_monotonic_boottime(void)
{ {
struct timespec ts; struct timespec ts;
cnss_get_monotonic_boottime(&ts); get_monotonic_boottime(&ts);
return ((uint64_t) ts.tv_sec * 1000000) + (ts.tv_nsec / 1000); 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 #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) static inline uint64_t __qdf_get_log_timestamp(void)
{ {
#ifdef CONFIG_CNSS
struct timespec ts; struct timespec ts;
cnss_get_boottime(&ts); ktime_get_ts(&ts);
return ((uint64_t) ts.tv_sec * 1000000) + (ts.tv_nsec / 1000); 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 */ #endif /* QCA_WIFI_3_0_ADRASTEA */

View File

@@ -30,9 +30,6 @@
#include <qdf_trace.h> #include <qdf_trace.h>
#include <qdf_types.h> #include <qdf_types.h>
#ifdef CONFIG_CNSS
#include <net/cnss.h>
#endif
#ifdef CONFIG_MCL #ifdef CONFIG_MCL
#include <i_host_diag_core_event.h> #include <i_host_diag_core_event.h>
#include <ani_global.h> #include <ani_global.h>
@@ -249,13 +246,8 @@ EXPORT_SYMBOL(qdf_mutex_release);
*/ */
static const char *qdf_wake_lock_name(qdf_wake_lock_t *lock) static const char *qdf_wake_lock_name(qdf_wake_lock_t *lock)
{ {
#if defined CONFIG_CNSS
if (lock->name) if (lock->name)
return 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"; return "UNNAMED_WAKELOCK";
} }
EXPORT_SYMBOL(qdf_wake_lock_name); 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) QDF_STATUS qdf_wake_lock_create(qdf_wake_lock_t *lock, const char *name)
{ {
#if defined CONFIG_CNSS wakeup_source_init(lock, name);
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
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
EXPORT_SYMBOL(qdf_wake_lock_create); 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_DEFAULT_WAKELOCK_TIMEOUT,
WIFI_POWER_EVENT_WAKELOCK_TAKEN); WIFI_POWER_EVENT_WAKELOCK_TAKEN);
#endif #endif
#if defined CONFIG_CNSS __pm_stay_awake(lock);
cnss_pm_wake_lock(lock);
#elif defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK)
wake_lock(lock);
#endif
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
EXPORT_SYMBOL(qdf_wake_lock_acquire); 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); WIFI_POWER_EVENT_WAKELOCK_TAKEN);
} }
#endif #endif
#if defined CONFIG_CNSS __pm_wakeup_event(lock, msec);
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
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
EXPORT_SYMBOL(qdf_wake_lock_timeout_acquire); 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_DEFAULT_WAKELOCK_TIMEOUT,
WIFI_POWER_EVENT_WAKELOCK_RELEASED); WIFI_POWER_EVENT_WAKELOCK_RELEASED);
#endif #endif
#if defined CONFIG_CNSS __pm_relax(lock);
cnss_pm_wake_lock_release(lock);
#elif defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK)
wake_unlock(lock);
#endif
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
EXPORT_SYMBOL(qdf_wake_lock_release); 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) QDF_STATUS qdf_wake_lock_destroy(qdf_wake_lock_t *lock)
{ {
#if defined CONFIG_CNSS wakeup_source_trash(lock);
cnss_pm_wake_lock_destroy(lock);
#elif defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK)
wake_lock_destroy(lock);
#endif
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
EXPORT_SYMBOL(qdf_wake_lock_destroy); EXPORT_SYMBOL(qdf_wake_lock_destroy);

View File

@@ -1400,11 +1400,7 @@ void *wmi_unified_attach(void *scn_handle,
wmi_runtime_pm_init(wmi_handle); wmi_runtime_pm_init(wmi_handle);
qdf_spinlock_create(&wmi_handle->eventq_lock); qdf_spinlock_create(&wmi_handle->eventq_lock);
qdf_nbuf_queue_init(&wmi_handle->event_queue); 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); INIT_WORK(&wmi_handle->rx_event_work, wmi_rx_event_work);
#endif
#ifdef WMI_INTERFACE_EVENT_LOGGING #ifdef WMI_INTERFACE_EVENT_LOGGING
qdf_spinlock_create(&wmi_handle->wmi_record_lock); qdf_spinlock_create(&wmi_handle->wmi_record_lock);
#endif #endif