mirror of
https://github.com/RinCat/RTL88x2BU-Linux-Driver.git
synced 2024-12-26 01:51:34 +00:00
Linux 4.20 compat: get_monotonic_boottime()
This commit is contained in:
parent
0644d0b316
commit
012e635ae3
6
os_dep/linux/ioctl_cfg80211.c
Executable file → Normal file
6
os_dep/linux/ioctl_cfg80211.c
Executable file → Normal file
@ -688,7 +688,11 @@ static int rtw_cfg80211_sync_iftype(_adapter *adapter)
|
|||||||
|
|
||||||
static u64 rtw_get_systime_us(void)
|
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 timespec ts;
|
||||||
|
getboottime(&ts);
|
||||||
|
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;
|
||||||
|
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
get_monotonic_boottime(&ts);
|
get_monotonic_boottime(&ts);
|
||||||
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;
|
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;
|
||||||
|
Loading…
Reference in New Issue
Block a user