mirror of
https://github.com/aircrack-ng/rtl8812au.git
synced 2024-11-22 13:24:36 +00:00
Minor cleanup/fix for kernel v4.20 support (get_monotonic_boottime)
This commit is contained in:
parent
87ee8a2f44
commit
038f1ea370
@ -736,12 +736,12 @@ 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(4, 20, 0))
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) && 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;
|
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;
|
||||||
|
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
|
||||||
|
return ktime_to_us(ktime_get_boottime());
|
||||||
#else
|
#else
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
do_gettimeofday(&tv);
|
do_gettimeofday(&tv);
|
||||||
|
@ -656,7 +656,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
|
|||||||
ret = -EFAULT;
|
ret = -EFAULT;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
command = rtw_zmalloc(priv_cmd.total_len+1);
|
command = rtw_zmalloc(priv_cmd.total_len+1);
|
||||||
if (!command) {
|
if (!command) {
|
||||||
RTW_INFO("%s: failed to allocate memory\n", __FUNCTION__);
|
RTW_INFO("%s: failed to allocate memory\n", __FUNCTION__);
|
||||||
|
Loading…
Reference in New Issue
Block a user