From cae132b6a917b645cf6db7c3c072e7406aa219f9 Mon Sep 17 00:00:00 2001 From: Arunk Khandavalli Date: Tue, 3 Jan 2017 20:04:22 +0530 Subject: [PATCH] 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 --- qdf/inc/qdf_mc_timer.h | 9 ++++++++- qdf/linux/src/qdf_mc_timer.c | 11 ++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/qdf/inc/qdf_mc_timer.h b/qdf/inc/qdf_mc_timer.h index e5401c8f1b..bd1d65755c 100644 --- a/qdf/inc/qdf_mc_timer.h +++ b/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. * diff --git a/qdf/linux/src/qdf_mc_timer.c b/qdf/linux/src/qdf_mc_timer.c index 3f3863fafd..4114024814 100644 --- a/qdf/linux/src/qdf_mc_timer.c +++ b/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. *