From 1ee51132c5d28c289f3c62adfe0449a5760e7e67 Mon Sep 17 00:00:00 2001 From: "Ruchi, Agrawal" Date: Mon, 3 Sep 2018 20:06:45 +0530 Subject: [PATCH] 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 --- qdf/inc/qdf_util.h | 10 +++++----- qdf/linux/src/i_qdf_util.h | 29 ++++++++++++++++++++++++----- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/qdf/inc/qdf_util.h b/qdf/inc/qdf_util.h index 1901644804..7b49357a44 100644 --- a/qdf/inc/qdf_util.h +++ b/qdf/inc/qdf_util.h @@ -109,18 +109,18 @@ typedef __qdf_wait_queue_head_t qdf_wait_queue_head_t; (_a)[5] == 0xff) #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) \ - _qdf_ewma_tx_lag_init(tx_lag) + __qdf_ewma_tx_lag_init(tx_lag) #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) \ - _qdf_ewma_tx_lag_read(tx_lag) + __qdf_ewma_tx_lag_read(tx_lag) /** * qdf_status_to_os_return - returns the status to OS. diff --git a/qdf/linux/src/i_qdf_util.h b/qdf/linux/src/i_qdf_util.h index abc2300722..2d2779595f 100644 --- a/qdf/linux/src/i_qdf_util.h +++ b/qdf/linux/src/i_qdf_util.h @@ -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_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) -#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)) @@ -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_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) -#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) -#define _qdf_ewma_tx_lag_read(tx_lag) \ +#define __qdf_ewma_tx_lag_read(tx_lag) \ ewma_tx_lag_read(tx_lag) +#endif #ifdef QCA_CONFIG_SMP /**