From 9a1be9afdc7701bf45b10d241315bc3511de7f66 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Mon, 5 Nov 2018 03:16:25 +0000 Subject: [PATCH] Fix build with 4.20-rc1 Ref: https://github.com/torvalds/linux/commit/976516404ff3fab2a8caa8bd6f5efc1437fed0b8 https://github.com/torvalds/linux/commit/8498887660dfc9a07659ad545bfec389eb1d1d3f --- os_dep/linux/ioctl_cfg80211.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 2b92c93..ed36a13 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -357,7 +357,9 @@ rtw_cfg80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = { 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)) + return ktime_to_us(ktime_get_boottime()); +#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;