qcacmn: Apply timer multiplier to qdf_timer
The qdf_timer_multiplier is currently applied to qdf_mc_timer and
qdf_event. In addition to these cases, also apply qdf_timer_multiplier
to qdf_timer to enable more debugging scenarios.
Change-Id: Ie3bd340dd2e8f1bec7e5bfa7ec3f0d0ceaa32e6d
CRs-Fixed: 2393017
diff --git a/qdf/linux/src/i_qdf_timer.h b/qdf/linux/src/i_qdf_timer.h
index 683d876..527f91b 100644
--- a/qdf/linux/src/i_qdf_timer.h
+++ b/qdf/linux/src/i_qdf_timer.h
@@ -28,11 +28,15 @@
#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
+#include "qdf_mc_timer.h"
#include <qdf_types.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
#include <linux/sched/task_stack.h>
#endif
+#define qdf_msecs_to_jiffies(msec) \
+ (qdf_timer_get_multiplier() * msecs_to_jiffies(msec))
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
struct __qdf_timer_t {
struct timer_list os_timer;
@@ -77,13 +81,13 @@
{
struct timer_list *os_timer = &timer->os_timer;
- os_timer->expires = jiffies + msecs_to_jiffies(msec);
+ os_timer->expires = jiffies + qdf_msecs_to_jiffies(msec);
add_timer(os_timer);
}
static inline void __qdf_timer_mod(struct __qdf_timer_t *timer, uint32_t msec)
{
- mod_timer(&timer->os_timer, jiffies + msecs_to_jiffies(msec));
+ mod_timer(&timer->os_timer, jiffies + qdf_msecs_to_jiffies(msec));
}
static inline bool __qdf_timer_stop(struct __qdf_timer_t *timer)
@@ -140,13 +144,13 @@
static inline void __qdf_timer_start(__qdf_timer_t *timer, uint32_t msec)
{
- timer->expires = jiffies + msecs_to_jiffies(msec);
+ timer->expires = jiffies + qdf_msecs_to_jiffies(msec);
add_timer(timer);
}
static inline void __qdf_timer_mod(__qdf_timer_t *timer, uint32_t msec)
{
- mod_timer(timer, jiffies + msecs_to_jiffies(msec));
+ mod_timer(timer, jiffies + qdf_msecs_to_jiffies(msec));
}
static inline bool __qdf_timer_stop(__qdf_timer_t *timer)
diff --git a/qdf/linux/src/qdf_mc_timer.c b/qdf/linux/src/qdf_mc_timer.c
index 7a3d297..6726f32 100644
--- a/qdf/linux/src/qdf_mc_timer.c
+++ b/qdf/linux/src/qdf_mc_timer.c
@@ -35,12 +35,7 @@
#define LINUX_INVALID_TIMER_COOKIE 0xfeedface
#define TMR_INVALID_ID (0)
-/* qdf timer multiplier */
-#ifdef QCA_WIFI_NAPIER_EMULATION
-static uint32_t g_qdf_timer_multiplier = 100;
-#else
static uint32_t g_qdf_timer_multiplier = 1;
-#endif
inline void qdf_timer_set_multiplier(uint32_t multiplier)
{