qcacmn: Add timekeeping.h inclusion under correct kernel version
timekeeping.h is available from kernel version 3.17. Add header inclusion and ktime_get_boot_ns call under correct version check flag. Change-Id: I2a1a127e1716b52af56d14c39e2e646e34b05fa3 CRs-Fixed: 2230949
This commit is contained in:

committed by
nshrivas

parent
2faa46fbfb
commit
bc1c547b8e
@@ -168,19 +168,11 @@ static inline qdf_time_t qdf_get_system_uptime(void)
|
|||||||
* The time since system booted in nanoseconds
|
* The time since system booted in nanoseconds
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 10, 0))
|
static inline uint64_t qdf_get_bootbased_boottime_ns(void)
|
||||||
static inline s64 qdf_get_bootbased_boottime_ns(void)
|
|
||||||
{
|
{
|
||||||
return ktime_get_boot_ns();
|
return __qdf_get_bootbased_boottime_ns();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
static inline s64 qdf_get_bootbased_boottime_ns(void)
|
|
||||||
{
|
|
||||||
return ktime_to_ns(ktime_get_boottime());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qdf_get_system_timestamp - Return current timestamp
|
* qdf_get_system_timestamp - Return current timestamp
|
||||||
*
|
*
|
||||||
|
@@ -36,7 +36,9 @@
|
|||||||
#include <linux/jiffies.h>
|
#include <linux/jiffies.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/ktime.h>
|
#include <linux/ktime.h>
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
|
||||||
#include <linux/timekeeping.h>
|
#include <linux/timekeeping.h>
|
||||||
|
#endif
|
||||||
#ifdef MSM_PLATFORM
|
#ifdef MSM_PLATFORM
|
||||||
#include <asm/arch_timer.h>
|
#include <asm/arch_timer.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -305,4 +307,28 @@ static inline uint64_t __qdf_get_log_timestamp(void)
|
|||||||
}
|
}
|
||||||
#endif /* QCA_WIFI_3_0_ADRASTEA */
|
#endif /* QCA_WIFI_3_0_ADRASTEA */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __qdf_get_bootbased_boottime_ns() - Get the bootbased time in nanoseconds
|
||||||
|
*
|
||||||
|
* __qdf_get_bootbased_boottime_ns() function returns the number of nanoseconds
|
||||||
|
* that have elapsed since the system was booted. It also includes the time when
|
||||||
|
* system was suspended.
|
||||||
|
*
|
||||||
|
* Return:
|
||||||
|
* The time since system booted in nanoseconds
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
|
||||||
|
static inline uint64_t __qdf_get_bootbased_boottime_ns(void)
|
||||||
|
{
|
||||||
|
return ktime_get_boot_ns();
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
static inline uint64_t __qdf_get_bootbased_boottime_ns(void)
|
||||||
|
{
|
||||||
|
return ktime_to_ns(ktime_get_boottime());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user