From 3586c3f35b34ae0ccf81b20bf114ff229beda927 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Fri, 24 May 2019 17:30:57 +0200 Subject: [PATCH 1/5] Added kernel v5.2 support --- README.md | 2 -- dkms.conf | 2 +- os_dep/linux/os_intfs.c | 22 +++++++++++----------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 925cb55..137eebd 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,6 @@ unmanaged-devices=mac:A7:A7:A7:A7:A7 * Check code with checkpatch.pl (found in "tools") -* pcap_activate error on "reaver" - investigate -* Add/upload the documentation * Add more VID/PIDS for all 3 chipsets supported. * Remove unused functions
diff --git a/dkms.conf b/dkms.conf index f6ad8ee..bbf7e55 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME="realtek-rtl8188eus" -PACKAGE_VERSION="5.3.9~20190215" +PACKAGE_VERSION="5.3.9~20190523" CLEAN="'make' clean" BUILT_MODULE_NAME[0]=8188eu PROCS_NUM=`nproc` diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index f3ba70c..3d49b3e 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1289,18 +1289,18 @@ unsigned int rtw_classify8021d(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(4, 19, 0) - , void *accel_priv - #else - , struct net_device *sb_dev - #endif - #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) - , select_queue_fallback_t fallback - #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0)) +static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb, + struct net_device *sb_dev) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) +static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb, + struct net_device *sb_dev, + select_queue_fallback_t fallback) +#else +static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb, + void *accel_priv, select_queue_fallback_t fallback) #endif -) +static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb { _adapter *padapter = rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; From 31a9f2807c631e39294d70e5f6f445af46cd3d8e Mon Sep 17 00:00:00 2001 From: kimocoder Date: Fri, 24 May 2019 17:52:48 +0200 Subject: [PATCH 2/5] Fix some compile issues/errors --- core/rtw_sta_mgt.c | 4 ++-- os_dep/linux/os_intfs.c | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 69d63b0..3a79e09 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -775,8 +775,8 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta) pstapriv->sta_aid[psta->cmn.aid - 1] = NULL; psta->cmn.aid = 0; } - if (psta->aid > 31) { - pr_err("***** psta->aid (%d) out of bounds\n", psta->aid); + if (psta->cmn.aid > 31) { + pr_err("***** psta->aid (%d) out of bounds\n", psta->cmn.aid); return _FAIL; } } diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index ad8553d..f5a124c 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1300,15 +1300,16 @@ 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, void *accel_priv, select_queue_fallback_t fallback) #endif -static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb { _adapter *padapter = rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; skb->priority = rtw_classify8021d(skb); - if (pmlmepriv->acm_mask != 0) + if(pmlmepriv->acm_mask != 0) + { skb->priority = qos_acm(pmlmepriv->acm_mask, skb->priority); + } return rtw_1d_to_queue[skb->priority]; } @@ -1676,10 +1677,6 @@ void rtw_os_ndev_unregister(_adapter *adapter) #endif if ((adapter->DriverState != DRIVER_DISAPPEAR) && netdev) { -#ifdef CONFIG_IOCTL_CFG80211 - struct wireless_dev *wdev = padapter->rtw_wdev; - wdev->current_bss = NULL; -#endif struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj); @@ -3557,11 +3554,11 @@ static int netdev_close(struct net_device *pnetdev) #endif /* CONFIG_P2P */ #ifdef CONFIG_IOCTL_CFG80211 - wdev->iftype = NL80211_IFTYPE_STATION; + //wdev->iftype = NL80211_IFTYPE_STATION; rtw_scan_abort(padapter); rtw_cfg80211_wait_scan_req_empty(padapter, 200); adapter_wdev_data(padapter)->bandroid_scan = _FALSE; - padapter->rtw_wdev->iftype = NL80211_IFTYPE_STATION; /* set this at the end */ + //padapter->rtw_wdev->iftype = NL80211_IFTYPE_STATION; /* set this at the end */ #endif /* CONFIG_IOCTL_CFG80211 */ #ifdef CONFIG_WAPI_SUPPORT From 7eb1cddab519a4db74d9059a61861c5865d2d263 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Fri, 24 May 2019 17:58:22 +0200 Subject: [PATCH 3/5] Added kernel v5.1 support --- os_dep/osdep_service.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index ce7086c..e5323f1 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -2147,7 +2147,7 @@ static int isFileReadable(const char *path, u32 *sz) 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); @@ -2185,7 +2185,7 @@ static int retriveFromFile(const 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); @@ -2220,7 +2220,7 @@ static int storeToFile(const 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); From c7cba7bd0043130bf9f646801905e66fc8f92eb5 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Fri, 24 May 2019 18:26:31 +0200 Subject: [PATCH 4/5] Fix uninitialized variable in auth seq=2 packet, An unintialized value for a temporary little-endian variable can cause some clients to fail to connect to AP. --- core/rtw_mlme_ext.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 29a4cb8..3666352 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -8999,12 +8999,11 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status /* setting auth algo number */ val16 = (u16)psta->authalg; - if (status != _STATS_SUCCESSFUL_) - val16 = 0; - if (val16) { val16 = cpu_to_le16(val16); use_shared_key = 1; + } else { + le_val16 = 0; } pframe = rtw_set_fixed_ie(pframe, _AUTH_ALGM_NUM_, (unsigned char *)&val16, &(pattrib->pktlen)); From d00f4a112dddb9ff04a294f58b8ff19cea9e6949 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Fri, 24 May 2019 18:44:57 +0200 Subject: [PATCH 5/5] Fix build error --- core/rtw_mlme_ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 3666352..68dc9d2 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -9003,7 +9003,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status val16 = cpu_to_le16(val16); use_shared_key = 1; } else { - le_val16 = 0; + val16 = 0; } pframe = rtw_set_fixed_ie(pframe, _AUTH_ALGM_NUM_, (unsigned char *)&val16, &(pattrib->pktlen));