qcacmn: Add QDF OS abstraction convergence
Converge ADF and CDF API's and move them to QDF folder. MCL/WIN driver use this QDF converged module for OS abstraction. Change-Id: I1d0cdfd8730a5c021aaa50b7dc8549d491d760b3 CRs-Fixed: 981187
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

부모
5693683262
커밋
5776318d19
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
@@ -26,127 +26,129 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: cdf_atomic.h
|
||||
* This file abstracts an atomic counter.
|
||||
* DOC: qdf_atomic.h
|
||||
* This file provides OS abstraction for atomic APIs.
|
||||
*/
|
||||
|
||||
#ifndef _CDF_ATOMIC_H
|
||||
#define _CDF_ATOMIC_H
|
||||
#ifndef _QDF_ATOMIC_H
|
||||
#define _QDF_ATOMIC_H
|
||||
|
||||
#include <i_cdf_atomic.h>
|
||||
#include <i_qdf_atomic.h>
|
||||
|
||||
/**
|
||||
* cdf_atomic_t - atomic type of variable
|
||||
* qdf_atomic_t - atomic type of variable
|
||||
*
|
||||
* Use this when you want a simple resource counter etc. which is atomic
|
||||
* across multiple CPU's. These maybe slower than usual counters on some
|
||||
* platforms/OS'es, so use them with caution.
|
||||
*/
|
||||
|
||||
typedef __cdf_atomic_t cdf_atomic_t;
|
||||
typedef __qdf_atomic_t qdf_atomic_t;
|
||||
|
||||
/**
|
||||
* cdf_atomic_init() - initialize an atomic type variable
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
* qdf_atomic_init() - initialize an atomic type variable
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline void cdf_atomic_init(cdf_atomic_t *v)
|
||||
static inline QDF_STATUS qdf_atomic_init(qdf_atomic_t *v)
|
||||
{
|
||||
__cdf_atomic_init(v);
|
||||
return __qdf_atomic_init(v);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdf_atomic_read() - read the value of an atomic variable
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
* qdf_atomic_read() - read the value of an atomic variable
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
*
|
||||
* Return: The current value of the variable
|
||||
*/
|
||||
static inline int32_t cdf_atomic_read(cdf_atomic_t *v)
|
||||
static inline int32_t qdf_atomic_read(qdf_atomic_t *v)
|
||||
{
|
||||
return __cdf_atomic_read(v);
|
||||
return __qdf_atomic_read(v);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdf_atomic_inc() - increment the value of an atomic variable
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
* qdf_atomic_inc() - increment the value of an atomic variable
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline void cdf_atomic_inc(cdf_atomic_t *v)
|
||||
static inline void qdf_atomic_inc(qdf_atomic_t *v)
|
||||
{
|
||||
__cdf_atomic_inc(v);
|
||||
__qdf_atomic_inc(v);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdf_atomic_dec() - decrement the value of an atomic variable
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
* qdf_atomic_dec() - decrement the value of an atomic variable
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline void cdf_atomic_dec(cdf_atomic_t *v)
|
||||
static inline void qdf_atomic_dec(qdf_atomic_t *v)
|
||||
{
|
||||
__cdf_atomic_dec(v);
|
||||
__qdf_atomic_dec(v);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdf_atomic_add() - add a value to the value of an atomic variable
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
* @i: The amount by which to increase the atomic counter
|
||||
* qdf_atomic_add() - add a value to the value of an atomic variable
|
||||
* @i: The amount by which to increase the atomic counter
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline void cdf_atomic_add(int i, cdf_atomic_t *v)
|
||||
static inline void qdf_atomic_add(int i, qdf_atomic_t *v)
|
||||
{
|
||||
__cdf_atomic_add(i, v);
|
||||
__qdf_atomic_add(i, v);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdf_atomic_sub() - Subtract a value from an atomic variable.
|
||||
* qdf_atomic_sub() - Subtract a value from an atomic variable
|
||||
* @i: the amount by which to decrease the atomic counter
|
||||
* @v: a pointer to an opaque atomic variable
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static inline void cdf_atomic_sub(int i, cdf_atomic_t *v)
|
||||
static inline void qdf_atomic_sub(int i, qdf_atomic_t *v)
|
||||
{
|
||||
__cdf_atomic_sub(i, v);
|
||||
__qdf_atomic_sub(i, v);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdf_atomic_dec_and_test() - decrement an atomic variable and check if the
|
||||
* new value is zero
|
||||
* qdf_atomic_dec_and_test() - decrement an atomic variable and check if the
|
||||
* new value is zero
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
*
|
||||
* Return:
|
||||
* true (non-zero) if the new value is zero,
|
||||
* or false (0) if the new value is non-zero
|
||||
* true (non-zero) if the new value is zero,
|
||||
* false (0) if the new value is non-zero
|
||||
*/
|
||||
static inline int32_t cdf_atomic_dec_and_test(cdf_atomic_t *v)
|
||||
static inline int32_t qdf_atomic_dec_and_test(qdf_atomic_t *v)
|
||||
{
|
||||
return __cdf_atomic_dec_and_test(v);
|
||||
return __qdf_atomic_dec_and_test(v);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdf_atomic_set() - set a value to the value of an atomic variable
|
||||
* qdf_atomic_set() - set a value to the value of an atomic variable
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
* @i: required value to set
|
||||
*
|
||||
* Atomically sets the value of v to i
|
||||
* Return: None
|
||||
*/
|
||||
static inline void cdf_atomic_set(cdf_atomic_t *v, int i)
|
||||
static inline void qdf_atomic_set(qdf_atomic_t *v, int i)
|
||||
{
|
||||
__cdf_atomic_set(v, i);
|
||||
__qdf_atomic_set(v, i);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdf_atomic_inc_return() - return the incremented value of an atomic variable
|
||||
* qdf_atomic_inc_return() - return the incremented value of an atomic variable
|
||||
* @v: A pointer to an opaque atomic variable
|
||||
*
|
||||
* Return: The current value of the variable
|
||||
*/
|
||||
static inline int32_t cdf_atomic_inc_return(cdf_atomic_t *v)
|
||||
static inline int32_t qdf_atomic_inc_return(qdf_atomic_t *v)
|
||||
{
|
||||
return __cdf_atomic_inc_return(v);
|
||||
return __qdf_atomic_inc_return(v);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user