Browse Source

qcacmn: Add proper api for ktime_get_boot_ns for kernel 3.10

Kernel api ktime_get_boot_ns is not supported in kernel version 3.10
so add correct api for kernel 3.10.

Change-Id: Id78d50d759db90a9c6edf4114f8af1a925dfb9bb
CRs-Fixed: 2076538
Ashish Kumar Dhanotiya 7 years ago
parent
commit
1c5d902876
1 changed files with 9 additions and 0 deletions
  1. 9 0
      qdf/inc/qdf_time.h

+ 9 - 0
qdf/inc/qdf_time.h

@@ -91,11 +91,20 @@ static inline qdf_time_t qdf_get_system_uptime(void)
  * Return:
  * The time since system booted in nanoseconds
  */
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 10, 0))
 static inline s64 qdf_get_bootbased_boottime_ns(void)
 {
 	return ktime_get_boot_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
  *