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
*/
#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

View File

@@ -36,9 +36,6 @@
#include <linux/version.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#ifdef CONFIG_CNSS
#include <net/cnss.h>
#endif
#include <qdf_types.h>
#include <qdf_status.h>
#include <qdf_trace.h>
@@ -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;
}

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
*/
#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 */

View File

@@ -30,9 +30,6 @@
#include <qdf_trace.h>
#include <qdf_types.h>
#ifdef CONFIG_CNSS
#include <net/cnss.h>
#endif
#ifdef CONFIG_MCL
#include <i_host_diag_core_event.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)
{
#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);

View File

@@ -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