diff --git a/include/wifi.h b/include/wifi.h index 091cd4f..040a310 100644 --- a/include/wifi.h +++ b/include/wifi.h @@ -1038,7 +1038,8 @@ typedef enum _HT_CAP_AMPDU_DENSITY { * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2) */ #define IEEE80211_MIN_AMPDU_BUF 0x8 -#define IEEE80211_MAX_AMPDU_BUF 0x40 +#define IEEE80211_MAX_AMPDU_BUF_HT 0x40 +#define IEEE80211_MAX_AMPDU_BUF 0x100 /* Spatial Multiplexing Power Save Modes */ diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index d19eba7..4540822 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -342,7 +342,11 @@ static const struct ieee80211_txrx_stypes 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 timespec64 ts; + ktime_get_boottime_ts64(&ts); + return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 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; diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 09c54e5..5f6f8e9 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1058,11 +1058,14 @@ unsigned int rtw_classify8021d(struct sk_buff *skb) return dscp >> 5; } - static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) + #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0)) , void *accel_priv - #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) + #else + , struct net_device *sb_dev + #endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)) , select_queue_fallback_t fallback #endif #endif diff --git a/os_dep/linux/rtw_android.c b/os_dep/linux/rtw_android.c index 3831b88..d17233d 100644 --- a/os_dep/linux/rtw_android.c +++ b/os_dep/linux/rtw_android.c @@ -630,7 +630,11 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) goto exit; } + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) + if (!access_ok(priv_cmd.buf, priv_cmd.total_len)) { + #else if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)) { + #endif RTW_INFO("%s: failed to access memory\n", __FUNCTION__); ret = -EFAULT; goto exit; diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 88a3ff5..0bfb93a 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -1961,7 +1961,7 @@ static int isFileReadable(char *path) ret = PTR_ERR(fp); else { oldfs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); if (1 != readFile(fp, &buf, 1)) ret = PTR_ERR(fp); @@ -1991,7 +1991,7 @@ static int retriveFromFile(char *path, u8 *buf, u32 sz) RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); oldfs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); ret = readFile(fp, buf, sz); set_fs(oldfs); closeFile(fp); @@ -2026,7 +2026,7 @@ static int storeToFile(char *path, u8 *buf, u32 sz) RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); oldfs = get_fs(); - set_fs(get_ds()); + set_fs(KERNEL_DS); ret = writeFile(fp, buf, sz); set_fs(oldfs); closeFile(fp);