qcacmn: Change to avoid compilation issue HK2.0

EWMA macros which were used for sojourn stats
time delay calculation, causing compilation issue
for x86 platform as x86 platform is on kernel
version less than 4.3 and EWMA macros were
introduced after that version.

Change-Id: I184844c7df8e5b317a095355c2f6a9af9e4747ff
CRs-Fixed: 2308338
This commit is contained in:
Ruchi, Agrawal
2018-09-03 20:06:45 +05:30
committed by nshrivas
parent 6da8bf6f3a
commit 1ee51132c5
2 changed files with 29 additions and 10 deletions

View File

@@ -109,18 +109,18 @@ typedef __qdf_wait_queue_head_t qdf_wait_queue_head_t;
(_a)[5] == 0xff) (_a)[5] == 0xff)
#define QDF_DECLARE_EWMA(name, factor, weight) \ #define QDF_DECLARE_EWMA(name, factor, weight) \
_QDF_DECLARE_EWMA(name, factor, weight) __QDF_DECLARE_EWMA(name, factor, weight)
#define qdf_ewma_tx_lag _qdf_ewma_tx_lag #define qdf_ewma_tx_lag __qdf_ewma_tx_lag
#define qdf_ewma_tx_lag_init(tx_lag) \ #define qdf_ewma_tx_lag_init(tx_lag) \
_qdf_ewma_tx_lag_init(tx_lag) __qdf_ewma_tx_lag_init(tx_lag)
#define qdf_ewma_tx_lag_add(tx_lag, value) \ #define qdf_ewma_tx_lag_add(tx_lag, value) \
_qdf_ewma_tx_lag_add(tx_lag, value) __qdf_ewma_tx_lag_add(tx_lag, value)
#define qdf_ewma_tx_lag_read(tx_lag) \ #define qdf_ewma_tx_lag_read(tx_lag) \
_qdf_ewma_tx_lag_read(tx_lag) __qdf_ewma_tx_lag_read(tx_lag)
/** /**
* qdf_status_to_os_return - returns the status to OS. * qdf_status_to_os_return - returns the status to OS.

View File

@@ -281,10 +281,22 @@ static inline bool __qdf_is_macaddr_equal(struct qdf_mac_addr *mac_addr1,
#define __qdf_min(_a, _b) min(_a, _b) #define __qdf_min(_a, _b) min(_a, _b)
#define __qdf_max(_a, _b) max(_a, _b) #define __qdf_max(_a, _b) max(_a, _b)
#define _QDF_DECLARE_EWMA(name, _factor, _weight) \
/**
* Setting it to blank as feature is not intended to be supported
* on linux version less than 4.3
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) || \
LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#define __QDF_DECLARE_EWMA(name, _factor, _weight)
#define __qdf_ewma_tx_lag struct ewma
#else
#define __QDF_DECLARE_EWMA(name, _factor, _weight) \
DECLARE_EWMA(name, _factor, _weight) DECLARE_EWMA(name, _factor, _weight)
#define _qdf_ewma_tx_lag struct ewma_tx_lag #define __qdf_ewma_tx_lag struct ewma_tx_lag
#endif
#define __qdf_ffz(mask) (~(mask) == 0 ? -1 : ffz(mask)) #define __qdf_ffz(mask) (~(mask) == 0 ? -1 : ffz(mask))
@@ -355,14 +367,21 @@ static inline bool __qdf_is_macaddr_equal(struct qdf_mac_addr *mac_addr1,
#define __qdf_roundup(x, y) roundup(x, y) #define __qdf_roundup(x, y) roundup(x, y)
#define _qdf_ewma_tx_lag_init(tx_lag) \ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) || \
LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#define __qdf_ewma_tx_lag_init(tx_lag)
#define __qdf_ewma_tx_lag_add(tx_lag, value)
#define __qdf_ewma_tx_lag_read(tx_lag)
#else
#define __qdf_ewma_tx_lag_init(tx_lag) \
ewma_tx_lag_init(tx_lag) ewma_tx_lag_init(tx_lag)
#define _qdf_ewma_tx_lag_add(tx_lag, value) \ #define __qdf_ewma_tx_lag_add(tx_lag, value) \
ewma_tx_lag_add(tx_lag, value) ewma_tx_lag_add(tx_lag, value)
#define _qdf_ewma_tx_lag_read(tx_lag) \ #define __qdf_ewma_tx_lag_read(tx_lag) \
ewma_tx_lag_read(tx_lag) ewma_tx_lag_read(tx_lag)
#endif
#ifdef QCA_CONFIG_SMP #ifdef QCA_CONFIG_SMP
/** /**