瀏覽代碼

qcacmn: Use ktime_get_real_ts64 for kernel 3.17.0+

ktime_get_real_ts64 is defined from kernel 3.17.0.
Use ktime_get_real_ts64 instead of ktime_get_ts from
kernel 3.17.0.

Change-Id: Ica72545fe5224966fbb350813bf3c2d849946dbc
CRs-Fixed: 2666404
bings 5 年之前
父節點
當前提交
1740435d49
共有 1 個文件被更改,包括 12 次插入1 次删除
  1. 12 1
      qdf/linux/src/i_qdf_time.h

+ 12 - 1
qdf/linux/src/i_qdf_time.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -288,6 +288,16 @@ static inline uint64_t __qdf_get_log_timestamp(void)
  *
  * Return: system tick for non MSM platfroms
  */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
+static inline uint64_t __qdf_get_log_timestamp(void)
+{
+	struct timespec64 ts;
+
+	ktime_get_real_ts64(&ts);
+
+	return ((uint64_t)ts.tv_sec * 1000000) + (ts.tv_nsec / 1000);
+}
+#else
 static inline uint64_t __qdf_get_log_timestamp(void)
 {
 	struct timespec ts;
@@ -297,6 +307,7 @@ static inline uint64_t __qdf_get_log_timestamp(void)
 	return ((uint64_t) ts.tv_sec * 1000000) + (ts.tv_nsec / 1000);
 }
 #endif
+#endif
 
 /**
  * __qdf_get_bootbased_boottime_ns() - Get the bootbased time in nanoseconds