Update ioctl_cfg80211.c

This commit is contained in:
Christian Bremvåg 2020-08-01 03:09:55 +02:00 committed by GitHub
parent 03bfa50c24
commit ae1d233fe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -686,18 +686,12 @@ static int rtw_cfg80211_sync_iftype(_adapter *adapter)
static u64 rtw_get_systime_us(void)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
struct timespec64 ts;
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0))
struct timespec ts;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
getboottime64(&ts);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
getboottime(&ts);
#else
get_monotonic_boottime(&ts);
#endif
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
return ktime_to_us(ktime_get_boottime());
#else
struct timeval tv;
do_gettimeofday(&tv);