1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-25 14:44:09 +00:00

Merge pull request #359 from v3l0c1r4pt0r/v5.1.5

Fixes for kernel version 5.1.4
This commit is contained in:
Christian Bremvåg 2019-05-26 17:55:22 +02:00 committed by GitHub
commit 3df255bf29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 7 deletions

View File

@ -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) * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2)
*/ */
#define IEEE80211_MIN_AMPDU_BUF 0x8 #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 */ /* Spatial Multiplexing Power Save Modes */

View File

@ -342,7 +342,11 @@ static const struct ieee80211_txrx_stypes
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 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; 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;

View File

@ -1058,11 +1058,14 @@ unsigned int rtw_classify8021d(struct sk_buff *skb)
return dscp >> 5; return dscp >> 5;
} }
static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb 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(3, 13, 0)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0))
, void *accel_priv , 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 , select_queue_fallback_t fallback
#endif #endif
#endif #endif

View File

@ -630,7 +630,11 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
goto exit; 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)) { if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)) {
#endif
RTW_INFO("%s: failed to access memory\n", __FUNCTION__); RTW_INFO("%s: failed to access memory\n", __FUNCTION__);
ret = -EFAULT; ret = -EFAULT;
goto exit; goto exit;

View File

@ -1961,7 +1961,7 @@ static int isFileReadable(char *path)
ret = PTR_ERR(fp); ret = PTR_ERR(fp);
else { else {
oldfs = get_fs(); oldfs = get_fs();
set_fs(get_ds()); set_fs(KERNEL_DS);
if (1 != readFile(fp, &buf, 1)) if (1 != readFile(fp, &buf, 1))
ret = PTR_ERR(fp); 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); RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
oldfs = get_fs(); oldfs = get_fs();
set_fs(get_ds()); set_fs(KERNEL_DS);
ret = readFile(fp, buf, sz); ret = readFile(fp, buf, sz);
set_fs(oldfs); set_fs(oldfs);
closeFile(fp); 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); RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
oldfs = get_fs(); oldfs = get_fs();
set_fs(get_ds()); set_fs(KERNEL_DS);
ret = writeFile(fp, buf, sz); ret = writeFile(fp, buf, sz);
set_fs(oldfs); set_fs(oldfs);
closeFile(fp); closeFile(fp);