فهرست منبع

qcacmn: Get monotonic boottime from kernel in nano sec

qcacld-2.0 to qca-wifi-host-cmn propogation

Add support to get the boot time from kernel in nano seconds.

Change-Id: Iaa512248a5e56d77cff39da562e0c9ee4eaeeefd
CRs-Fixed: 1107219
Arunk Khandavalli 8 سال پیش
والد
کامیت
cae132b6a9
2فایلهای تغییر یافته به همراه18 افزوده شده و 2 حذف شده
  1. 8 1
      qdf/inc/qdf_mc_timer.h
  2. 10 1
      qdf/linux/src/qdf_mc_timer.c

+ 8 - 1
qdf/inc/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.
  *
@@ -249,6 +249,13 @@ unsigned long qdf_mc_timer_get_system_ticks(void);
  */
 unsigned long qdf_mc_timer_get_system_time(void);
 
+/**
+  * qdf_get_monotonic_boottime_ns() - Get kernel boottime in ns
+  *
+  * Return: kernel boottime in nano sec
+  */
+s64 qdf_get_monotonic_boottime_ns(void);
+
 /**
  * qdf_timer_module_init() - initializes a QDF timer module.
  *

+ 10 - 1
qdf/linux/src/qdf_mc_timer.c

@@ -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.
  *
@@ -703,6 +703,15 @@ unsigned long qdf_mc_timer_get_system_time(void)
 }
 EXPORT_SYMBOL(qdf_mc_timer_get_system_time);
 
+s64 qdf_get_monotonic_boottime_ns(void)
+{
+	struct timespec ts;
+
+	ktime_get_ts(&ts);
+	return timespec_to_ns(&ts);
+}
+EXPORT_SYMBOL(qdf_get_monotonic_boottime_ns);
+
 /**
  * qdf_timer_module_deinit() - Deinitializes a QDF timer module.
  *