mirror of
https://github.com/chinawrj/rtl8812au
synced 2025-01-08 17:46:31 +00:00
Fix builds for kernels older than 4.11.0
This commit is contained in:
parent
6a85cb90dd
commit
dae6545ef1
@ -686,7 +686,11 @@ static int rtw_cfg80211_sync_iftype(_adapter *adapter)
|
||||
|
||||
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))
|
||||
ktime_t ts;
|
||||
ts = ktime_get_boottime();
|
||||
return do_div(ts, 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;
|
||||
|
@ -20,6 +20,14 @@
|
||||
|
||||
#define RT_TAG '1178'
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0))
|
||||
static inline ssize_t call_read_iter(struct file *file, struct kiocb *kio,
|
||||
struct iov_iter *iter)
|
||||
{
|
||||
return file->f_op->read_iter(kio, iter);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DBG_MEMORY_LEAK
|
||||
#ifdef PLATFORM_LINUX
|
||||
atomic_t _malloc_cnt = ATOMIC_INIT(0);
|
||||
|
Loading…
Reference in New Issue
Block a user