From ae733769eacba7ba1576d020811f117187ca6fdc Mon Sep 17 00:00:00 2001 From: Kamil Lorenc Date: Sun, 26 May 2019 16:21:29 +0200 Subject: [PATCH] Replace get_monotonic_boottime This function is deprecated as of kernel 4.20. It is replaced straight away with ktime_get_boottime_ts64 --- os_dep/linux/ioctl_cfg80211.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index d19eba7..4540822 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -342,7 +342,11 @@ static const struct ieee80211_txrx_stypes static u64 rtw_get_systime_us(void) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) + struct timespec64 ts; + ktime_get_boottime_ts64(&ts); + return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000; +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) struct timespec ts; get_monotonic_boottime(&ts); return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;