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