qcacmn: Create QDF timer multiplier get/set APIs
In order to provide greater flexibility on emulation platforms, replace the current hard-coded QDF_TIMER_MULTIPLIER with a pair of get/set methods, configurable at runtime. Change-Id: I0757da6c2129db08459411eaef75b6183f1aa557 CRs-Fixed: 2049309
Šī revīzija ir iekļauta:

revīziju iesūtīja
snandini

vecāks
a17c68d656
revīzija
c7e0c63260
@@ -285,4 +285,20 @@ void qdf_timer_module_deinit(void);
|
|||||||
*/
|
*/
|
||||||
void qdf_get_time_of_the_day_in_hr_min_sec_usec(char *tbuf, int len);
|
void qdf_get_time_of_the_day_in_hr_min_sec_usec(char *tbuf, int len);
|
||||||
void qdf_register_mc_timer_callback(void (*callback) (unsigned long data));
|
void qdf_register_mc_timer_callback(void (*callback) (unsigned long data));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qdf_timer_set_multiplier() - set the global QDF timer scalar value
|
||||||
|
* @multiplier: the scalar value to apply
|
||||||
|
*
|
||||||
|
* Return: None
|
||||||
|
*/
|
||||||
|
void qdf_timer_set_multiplier(uint32_t multiplier);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qdf_timer_get_multiplier() - get the global QDF timer scalar value
|
||||||
|
*
|
||||||
|
* Return: the global QDF timer scalar value
|
||||||
|
*/
|
||||||
|
uint32_t qdf_timer_get_multiplier(void);
|
||||||
|
|
||||||
#endif /* __QDF_MC_TIMER_H */
|
#endif /* __QDF_MC_TIMER_H */
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||||
*
|
*
|
||||||
@@ -36,15 +36,9 @@
|
|||||||
|
|
||||||
/* Include Files */
|
/* Include Files */
|
||||||
#include "qdf_event.h"
|
#include "qdf_event.h"
|
||||||
|
#include "qdf_mc_timer.h"
|
||||||
#include <linux/export.h>
|
#include <linux/export.h>
|
||||||
|
|
||||||
/* Flag for napier emulation */
|
|
||||||
#ifdef QCA_WIFI_NAPIER_EMULATION
|
|
||||||
#define QDF_TIMER_MULTIPLIER 100
|
|
||||||
#else
|
|
||||||
#define QDF_TIMER_MULTIPLIER 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Function Definitions and Documentation */
|
/* Function Definitions and Documentation */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -251,7 +245,7 @@ QDF_STATUS qdf_wait_single_event(qdf_event_t *event, uint32_t timeout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* update the timeout if its on a emaulation platform */
|
/* update the timeout if its on a emaulation platform */
|
||||||
timeout *= QDF_TIMER_MULTIPLIER;
|
timeout *= qdf_timer_get_multiplier();
|
||||||
if (timeout) {
|
if (timeout) {
|
||||||
long ret;
|
long ret;
|
||||||
ret = wait_for_completion_timeout(&event->complete,
|
ret = wait_for_completion_timeout(&event->complete,
|
||||||
|
@@ -43,13 +43,25 @@
|
|||||||
#define LINUX_INVALID_TIMER_COOKIE 0xfeedface
|
#define LINUX_INVALID_TIMER_COOKIE 0xfeedface
|
||||||
#define TMR_INVALID_ID (0)
|
#define TMR_INVALID_ID (0)
|
||||||
|
|
||||||
/* Flag for napier emulation */
|
/* qdf timer multiplier */
|
||||||
#ifdef QCA_WIFI_NAPIER_EMULATION
|
#ifdef QCA_WIFI_NAPIER_EMULATION
|
||||||
#define QDF_TIMER_MULTIPLIER 100
|
static uint32_t g_qdf_timer_multiplier = 100;
|
||||||
#else
|
#else
|
||||||
#define QDF_TIMER_MULTIPLIER 1
|
static uint32_t g_qdf_timer_multiplier = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
inline void qdf_timer_set_multiplier(uint32_t multiplier)
|
||||||
|
{
|
||||||
|
g_qdf_timer_multiplier = multiplier;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(qdf_timer_set_multiplier);
|
||||||
|
|
||||||
|
inline uint32_t qdf_timer_get_multiplier(void)
|
||||||
|
{
|
||||||
|
return g_qdf_timer_multiplier;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(qdf_timer_get_multiplier);
|
||||||
|
|
||||||
/* Type declarations */
|
/* Type declarations */
|
||||||
|
|
||||||
/* Static Variable Definitions */
|
/* Static Variable Definitions */
|
||||||
@@ -569,7 +581,7 @@ QDF_STATUS qdf_mc_timer_start(qdf_mc_timer_t *timer, uint32_t expiration_time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* update expiration time based on if emulation platform */
|
/* update expiration time based on if emulation platform */
|
||||||
expiration_time *= QDF_TIMER_MULTIPLIER;
|
expiration_time *= qdf_timer_get_multiplier();
|
||||||
|
|
||||||
/* make sure the remainer of the logic isn't interrupted */
|
/* make sure the remainer of the logic isn't interrupted */
|
||||||
qdf_spin_lock_irqsave(&timer->platform_info.spinlock);
|
qdf_spin_lock_irqsave(&timer->platform_info.spinlock);
|
||||||
|
Atsaukties uz šo jaunā problēmā
Block a user