From 416453cadc3a40036d625c6f798151b4b970f8d6 Mon Sep 17 00:00:00 2001 From: Magnus Bergmark Date: Tue, 18 Aug 2015 21:10:30 +0200 Subject: [PATCH 01/20] No more NULL dereference and kernel panic on current kernels Found patch on the web: http://users.telenet.be/x86_64/Patches/rtl8192eu-k3.13.patch Before patch, kernel panic due to a NULL dereference in rtw_ndev_notifier_register; this patch solves that problem by not using these methods on kernel versions after a certain number, so it leads me to believe that this patch is meant to make the driver compatible with newer kernel versions. --- include/osdep_intf.h | 2 ++ os_dep/linux/os_intfs.c | 13 ++++++++++--- os_dep/linux/rtw_android.c | 2 +- os_dep/linux/rtw_proc.c | 2 +- os_dep/linux/usb_intf.c | 7 ++++++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/include/osdep_intf.h b/include/osdep_intf.h index 7a61a13..48bada5 100644 --- a/include/osdep_intf.h +++ b/include/osdep_intf.h @@ -116,8 +116,10 @@ void rtw_unregister_netdevs(struct dvobj_priv *dvobj); u16 rtw_recv_select_queue(struct sk_buff *skb); #endif //LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,35) +#if (LINUX_VERSION_CODE> 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)) + ,void *accel_priv +#endif +#if (LINUX_VERSION_CODE>=KERNEL_VERSION(3, 14, 0)) + ,select_queue_fallback_t fallback +#endif +) { _adapter *padapter = rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -643,9 +650,9 @@ u16 rtw_recv_select_queue(struct sk_buff *skb) return rtw_1d_to_queue[priority]; } - #endif +#if (LINUX_VERSION_CODE Date: Tue, 10 Nov 2015 23:04:30 +0100 Subject: [PATCH 02/20] Fix `file_path` symbol conflict with Linux 4.3 file_path is now something in kernel 4.3 that conflicts with this version of the driver. Work-around found here: https://github.com/hadess/rtl8723bs/commit/e2ca8113463891d16d0d7f141166fdb416d3030b See related issue for discussion about it: https://github.com/hadess/rtl8723bs/issues/24 --- hal/hal_com_phycfg.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/hal/hal_com_phycfg.c b/hal/hal_com_phycfg.c index c0c65e4..625e640 100644 --- a/hal/hal_com_phycfg.c +++ b/hal/hal_com_phycfg.c @@ -2575,7 +2575,7 @@ Hal_ChannelPlanToRegulation( #ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE extern char *rtw_phy_file_path; -char file_path[PATH_LENGTH_MAX]; +char file_path_bs[PATH_LENGTH_MAX]; #define GetLineFromBuffer(buffer) strsep(&buffer, "\n") @@ -2597,11 +2597,11 @@ phy_ConfigMACWithParaFile( if ((pHalData->mac_reg_len == 0) && (pHalData->mac_reg == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(file_path_bs, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(file_path_bs) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; @@ -2696,11 +2696,11 @@ phy_ConfigBBWithParaFile( if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(file_path_bs, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(file_path_bs) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; @@ -3149,11 +3149,11 @@ phy_ConfigBBWithPgParaFile( if ((pHalData->bb_phy_reg_pg_len == 0) && (pHalData->bb_phy_reg_pg == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(file_path_bs, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(file_path_bs) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; @@ -3212,11 +3212,11 @@ phy_ConfigBBWithMpParaFile( if ((pHalData->bb_phy_reg_mp_len == 0) && (pHalData->bb_phy_reg_mp == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(file_path_bs, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(file_path_bs) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; @@ -3348,11 +3348,11 @@ PHY_ConfigRFWithParaFile( if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(file_path_bs, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(file_path_bs) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; @@ -3626,11 +3626,11 @@ PHY_ConfigRFWithTxPwrTrackParaFile( if ((pHalData->rf_tx_pwr_track_len == 0) && (pHalData->rf_tx_pwr_track == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(file_path_bs, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(file_path_bs) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; @@ -3995,11 +3995,11 @@ PHY_ConfigRFWithPowerLimitTableParaFile( if ((pHalData->rf_tx_pwr_lmt_len == 0) && (pHalData->rf_tx_pwr_lmt == NULL)) { - rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); + rtw_merge_string(file_path_bs, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName); - if (rtw_is_file_readable(file_path) == _TRUE) + if (rtw_is_file_readable(file_path_bs) == _TRUE) { - rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); + rlen = rtw_retrive_from_file(file_path_bs, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN); if (rlen > 0) { rtStatus = _SUCCESS; From 0c8b0caaaa2acce8a9c5cb724ddf94eb9ace416a Mon Sep 17 00:00:00 2001 From: Magnus Bergmark Date: Tue, 10 Nov 2015 23:06:48 +0100 Subject: [PATCH 03/20] Fix "void value not ignored as it ought to be" errors The macros in rtw_debug.h expands an `if` without a body, so this error is emitted several dozen times when compiling. Work-around found here: https://github.com/donahue95/rtl8192eu-linux-driver/commit/f96431f1e33d0dec4213959d3a24bb53adcf771e Related issue discussion: https://github.com/donahue95/rtl8192eu-linux-driver/issues/2 Thanks to donahue95 ! <3 (donahue95/rtl8192eu-linux-driver@f96431f1e33d0dec4213959d3a24bb53adcf771e) --- include/rtw_debug.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/rtw_debug.h b/include/rtw_debug.h index 09490bc..4936b0e 100644 --- a/include/rtw_debug.h +++ b/include/rtw_debug.h @@ -227,7 +227,7 @@ extern void rtl871x_cedbg(const char *fmt, ...); if (sel == RTW_DBGDUMP)\ _DBG_871X_LEVEL(_drv_always_, fmt, ##arg); \ else {\ - if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \ + _seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \ } \ }while(0) @@ -237,7 +237,7 @@ extern void rtl871x_cedbg(const char *fmt, ...); if (sel == RTW_DBGDUMP)\ DBG_871X_LEVEL(_drv_always_, fmt, ##arg); \ else {\ - if(_seqdump(sel, fmt, ##arg)) /*rtw_warn_on(1)*/; \ + _seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \ } \ }while(0) From 6793baedf50fbf0822d2b87a1070527c0fd0685e Mon Sep 17 00:00:00 2001 From: Magnus Bergmark Date: Tue, 10 Nov 2015 23:20:10 +0100 Subject: [PATCH 04/20] Fix strnicmp not defined in Kernel >= 4.0 This particular fix is all over the internet, as patches posted on mailing lists, package maintainer's mirrors, etc. I don't know the full origin of it, but it works. It also makes sense. I found a quote regarding it here: http://comments.gmane.org/gmane.linux.drivers.driver-project.devel/71438 > [...] patched so it will compile against kernels that no longer > provide the old procfs API and with calls to strnicmp() replaced with > strncasecmp(). Here's an example of the patch in the wild: https://github.com/felixonmars/aur3-mirror/blob/9cf1f08f9a6806ae5804f534bceb174cfec3daa9/8192cu-dkms/RTL8192CU-kernel-4.0.patch Note that the sources mentioned above all talk about the more common 8192cu driver, but the change is the same as both drivers share the majority of the code with each other. I guess this is part of the reason why the hardware makers don't publish updated drivers; they've copy-pasted it everywhere and patching them all is a pain for them. --- os_dep/linux/rtw_android.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/os_dep/linux/rtw_android.c b/os_dep/linux/rtw_android.c index 98f0d31..242048a 100644 --- a/os_dep/linux/rtw_android.c +++ b/os_dep/linux/rtw_android.c @@ -337,8 +337,12 @@ int rtw_android_cmdstr_to_num(char *cmdstr) { int cmd_num; for(cmd_num=0 ; cmd_num= KERNEL_VERSION(4, 0, 0)) + if(!strncasecmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) ) +#else + if(0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num], strlen(android_wifi_cmd_str[cmd_num])) ) +#endif + break; return cmd_num; } From 779c4bcd0292374ad1494284ca41a89850747035 Mon Sep 17 00:00:00 2001 From: Magnus Bergmark Date: Wed, 11 Nov 2015 20:58:31 +0100 Subject: [PATCH 05/20] Add README --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a016d2c --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# rtl8192eu linux drivers + +The official drivers for D-Link DWA-131 Rev E, with patches to keep it working on newer kernels. + +## Source for the official drivers + +Official drivers were downloaded from D-Link Australia. D-Link USA and the european countries I checked only lists revision A and B. Australia lists all three. + +* [Download page for DWA-131][driver-downloads] +* [Direct download link for Linux drivers][direct-download] + * GitHub will not link to the `ftp://` schema. Raw link contents: + + `ftp://files.dlink.com.au/products/DWA-131/REV_E/Drivers/DWA-131_Linux_driver_v4.3.1.1.zip` + +In addition, you can find the contents of this version in the initial commit of this repo: [1387cf623d54bc2caec533e72ee18ef3b6a1db29][initial-commit] + +## Patches + +You can see the applied patches, their sources and/or motivation by looking at the commits. The `master` branch will be kept clean with a single commit per patch. You can review patch by patch and then record the SHA for that commit in order to get a safe reference to use. As long as the SHA stays the same you know that what you get has been reviewed by you. + +Note that updates to this README will show up as separate commits. I will not mix changes to this file with changes to the code in case you want to mirror this without the README. + +## Submitting patches + +1. Fork repo +2. Do your patch in a topic branch +3. Open a pull request on GH, or send it by email to `Magnus Bergmark `. +4. I'll squash your commits when everything checks out and add it to `master`. + +## Copyright and licenses + +The original code is copyrighted, but I don't know by whom. The driver download does not contain license information; please open an issue if you are the copyright holder. + +Most C files are licensed under GNU General Public License (GPL), version 2. + +[driver-downloads]: http://support.dlink.com.au/Download/download.aspx?product=DWA-131 +[direct-download]: ftp://files.dlink.com.au/products/DWA-131/REV_E/Drivers/DWA-131_Linux_driver_v4.3.1.1.zip +[initial-commit]: https://github.com/Mange/rtl8192eu-linux-driver/commit/1387cf623d54bc2caec533e72ee18ef3b6a1db29 From 2b7b0110c60819c2d2865615d0819b88d58ccc1d Mon Sep 17 00:00:00 2001 From: Wil Birkmaier Date: Sat, 12 Dec 2015 14:37:36 -0500 Subject: [PATCH 06/20] Notes for working on Rosewill card and fix to compile under Fedora Core 21 with 4.1.x kernel --- Makefile | 2 ++ README.md | 1 + 2 files changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 0c800f8..97af9fa 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ EXTRA_CFLAGS += -Wno-unused-parameter EXTRA_CFLAGS += -Wno-unused-function EXTRA_CFLAGS += -Wno-unused +EXTRA_CFLAGS += -Wno-date-time + #EXTRA_CFLAGS += -Wno-uninitialized EXTRA_CFLAGS += -I$(src)/include diff --git a/README.md b/README.md index a016d2c..17f652a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # rtl8192eu linux drivers The official drivers for D-Link DWA-131 Rev E, with patches to keep it working on newer kernels. +Also works on Rosewill RNX-N180UBE v2 N300 Wireless Adapter. ## Source for the official drivers From 5c288352abea04d98d873488af32ee8da9df1d26 Mon Sep 17 00:00:00 2001 From: SSomov Date: Sun, 17 Jan 2016 20:31:38 +0300 Subject: [PATCH 07/20] Update Makefile Support Raspberry Pi2 B --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 97af9fa..ae0609b 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,7 @@ CONFIG_RTW_SDIO_PM_KEEP_POWER = y CONFIG_PLATFORM_I386_PC = y CONFIG_PLATFORM_ANDROID_X86 = n CONFIG_PLATFORM_JB_X86 = n +CONFIG_PLATFORM_ARM_RPI = n CONFIG_PLATFORM_ARM_S3C2K4 = n CONFIG_PLATFORM_ARM_PXA2XX = n CONFIG_PLATFORM_ARM_S3C6K4 = n @@ -759,6 +760,15 @@ MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/ INSTALL_PREFIX := endif +ifeq ($(CONFIG_PLATFORM_ARM_RPI), y) +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +ARCH := arm +CROSS_COMPILE := +KVER := $(shell uname -r) +KSRC ?= /lib/modules/$(KVER)/build +MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/ +endif + ifeq ($(CONFIG_PLATFORM_ACTIONS_ATM702X), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ACTIONS_ATM702X #ARCH := arm From f0c1b5cb1c6aa73bba28250cc67471f0df8dee12 Mon Sep 17 00:00:00 2001 From: jeremyb31 Date: Sun, 10 Jul 2016 08:25:30 -0500 Subject: [PATCH 08/20] Update usb_intf.c --- os_dep/linux/usb_intf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index c96c321..a86087d 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -214,6 +214,7 @@ static struct usb_device_id rtw_usb_id_tbl[] ={ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x818C,0xff,0xff,0xff),.driver_info = RTL8192E},/* Default ID */ /*=== Customer ID ===*/ {USB_DEVICE(0x2001, 0x3319),.driver_info = RTL8192E}, /* D-Link - DWA-131 */ + {USB_DEVICE(0x2357, 0x0107),.driver_info = RTL8192E}, /* TP-Link - Cameo */ #endif #ifdef CONFIG_RTL8723B From 16f07fe6fdef6b075048eabbbfdcb9f034587c98 Mon Sep 17 00:00:00 2001 From: jeremyb31 Date: Mon, 11 Jul 2016 16:09:09 -0500 Subject: [PATCH 09/20] Update usb_intf.c --- os_dep/linux/usb_intf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index a86087d..c96c321 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -214,7 +214,6 @@ static struct usb_device_id rtw_usb_id_tbl[] ={ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x818C,0xff,0xff,0xff),.driver_info = RTL8192E},/* Default ID */ /*=== Customer ID ===*/ {USB_DEVICE(0x2001, 0x3319),.driver_info = RTL8192E}, /* D-Link - DWA-131 */ - {USB_DEVICE(0x2357, 0x0107),.driver_info = RTL8192E}, /* TP-Link - Cameo */ #endif #ifdef CONFIG_RTL8723B From 56ccb6b05cff08de1beddbbd03efdb36eff1416d Mon Sep 17 00:00:00 2001 From: jeremyb31 Date: Mon, 11 Jul 2016 16:13:44 -0500 Subject: [PATCH 10/20] Add TP-Link devices --- os_dep/linux/usb_intf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index c96c321..c607121 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -214,6 +214,10 @@ static struct usb_device_id rtw_usb_id_tbl[] ={ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0x818C,0xff,0xff,0xff),.driver_info = RTL8192E},/* Default ID */ /*=== Customer ID ===*/ {USB_DEVICE(0x2001, 0x3319),.driver_info = RTL8192E}, /* D-Link - DWA-131 */ + /*===TPLINK ID===========*/ + {USB_DEVICE(0x2357, 0x0107),.driver_info = RTL8192E}, /* TP-Link - Cameo */ + {USB_DEVICE(0x2357, 0x0108),.driver_info = RTL8192E}, /* TP-Link - Cameo */ + {USB_DEVICE(0x2357, 0x0109),.driver_info = RTL8192E}, /* TP-Link - Cameo */ #endif #ifdef CONFIG_RTL8723B From c9eb264936e6a811aba067550deded9181e30a8e Mon Sep 17 00:00:00 2001 From: Magnus Bergmark Date: Mon, 1 Aug 2016 20:39:31 +0200 Subject: [PATCH 11/20] Make it clear that this is just a mirror I don't support or understand the code in this repo. I'm just keeping it here. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 17f652a..8134e5c 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ The official drivers for D-Link DWA-131 Rev E, with patches to keep it working on newer kernels. Also works on Rosewill RNX-N180UBE v2 N300 Wireless Adapter. +**NOTE:** This is just a "mirror". I have no knowledge about this code or how it works. Expect no support from me or any contributors here. I just think GitHub is a nicer way of keeping track of this than random form posts and precompiled binaries being sent by email. I don't want someone else to have to spend 5 days of googling and compiling with random patches until it works. + ## Source for the official drivers Official drivers were downloaded from D-Link Australia. D-Link USA and the european countries I checked only lists revision A and B. Australia lists all three. @@ -17,7 +19,7 @@ In addition, you can find the contents of this version in the initial commit of ## Patches -You can see the applied patches, their sources and/or motivation by looking at the commits. The `master` branch will be kept clean with a single commit per patch. You can review patch by patch and then record the SHA for that commit in order to get a safe reference to use. As long as the SHA stays the same you know that what you get has been reviewed by you. +You can see the applied patches, their sources and/or motivation by looking at the commits. The `master` branch will mostly be kept clean with a single commit per patch, except for Pull Requests. You can review commit by commit and then record the SHA in order to get a safe reference to use. As long as the SHA stays the same you know that what you get has been reviewed by you. Note that updates to this README will show up as separate commits. I will not mix changes to this file with changes to the code in case you want to mirror this without the README. From 0c80da7f67607bf5916a9def05cfc4099c098057 Mon Sep 17 00:00:00 2001 From: Magnus Bergmark Date: Mon, 1 Aug 2016 20:40:06 +0200 Subject: [PATCH 12/20] Fix speling eror --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8134e5c..5741239 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ The official drivers for D-Link DWA-131 Rev E, with patches to keep it working on newer kernels. Also works on Rosewill RNX-N180UBE v2 N300 Wireless Adapter. -**NOTE:** This is just a "mirror". I have no knowledge about this code or how it works. Expect no support from me or any contributors here. I just think GitHub is a nicer way of keeping track of this than random form posts and precompiled binaries being sent by email. I don't want someone else to have to spend 5 days of googling and compiling with random patches until it works. +**NOTE:** This is just a "mirror". I have no knowledge about this code or how it works. Expect no support from me or any contributors here. I just think GitHub is a nicer way of keeping track of this than random forum posts and precompiled binaries being sent by email. I don't want someone else to have to spend 5 days of googling and compiling with random patches until it works. ## Source for the official drivers From 83638179d7f8833a924c972288e79e719188e494 Mon Sep 17 00:00:00 2001 From: Kenneth Jorgensen Date: Tue, 27 Sep 2016 15:22:00 +0900 Subject: [PATCH 13/20] Added support for PLANEX GW-300S Katana. --- os_dep/linux/usb_intf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index c607121..5a62f24 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -218,6 +218,8 @@ static struct usb_device_id rtw_usb_id_tbl[] ={ {USB_DEVICE(0x2357, 0x0107),.driver_info = RTL8192E}, /* TP-Link - Cameo */ {USB_DEVICE(0x2357, 0x0108),.driver_info = RTL8192E}, /* TP-Link - Cameo */ {USB_DEVICE(0x2357, 0x0109),.driver_info = RTL8192E}, /* TP-Link - Cameo */ + /*=== PLANEX ===========*/ + {USB_DEVICE(0x2019, 0xab33),.driver_info = RTL8192E}, /* PLANEX - GW-300S Katana */ #endif #ifdef CONFIG_RTL8723B From 4955a5a8d6eb9418c4cbb3dac8da6351c7bca989 Mon Sep 17 00:00:00 2001 From: Reynaldo Gil Pons Date: Thu, 13 Oct 2016 09:30:00 -0400 Subject: [PATCH 14/20] corrected interface name --- os_dep/linux/os_intfs.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index b349d5b..1d2c0fc 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -725,9 +725,15 @@ static const struct net_device_ops rtw_netdev_ops = { }; #endif +static const struct device_type wlan_type = { + .name = "wlan", +}; + int rtw_init_netdev_name(struct net_device *pnetdev, const char *ifname) { - _adapter *padapter = rtw_netdev_priv(pnetdev); + _adapter *padapter; + pnetdev->dev.type = &wlan_type; + padapter = rtw_netdev_priv(pnetdev); #ifdef CONFIG_EASY_REPLACEMENT struct net_device *TargetNetdev = NULL; From 6563172295ff571271ec543a3b18128421aaf167 Mon Sep 17 00:00:00 2001 From: CGarces Date: Tue, 1 Nov 2016 12:12:21 +0100 Subject: [PATCH 15/20] Add kernel-4.7 and 4.8 compatibility --- os_dep/linux/ioctl_cfg80211.c | 85 +++++++++++++++++++---------------- os_dep/linux/wifi_regd.c | 24 +++++----- 2 files changed, 58 insertions(+), 51 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 5f7a315..cc15013 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -74,7 +74,7 @@ static const u32 rtw_cipher_suites[] = { } #define CHAN2G(_channel, _freq, _flags) { \ - .band = IEEE80211_BAND_2GHZ, \ + .band = NL80211_BAND_2GHZ, \ .center_freq = (_freq), \ .hw_value = (_channel), \ .flags = (_flags), \ @@ -83,7 +83,7 @@ static const u32 rtw_cipher_suites[] = { } #define CHAN5G(_channel, _flags) { \ - .band = IEEE80211_BAND_5GHZ, \ + .band = NL80211_BAND_5GHZ, \ .center_freq = 5000 + (5 * (_channel)), \ .hw_value = (_channel), \ .flags = (_flags), \ @@ -200,18 +200,18 @@ void rtw_5g_rates_init(struct ieee80211_rate *rates) } struct ieee80211_supported_band *rtw_spt_band_alloc( - enum ieee80211_band band + enum nl80211_band band ) { struct ieee80211_supported_band *spt_band = NULL; int n_channels, n_bitrates; - if(band == IEEE80211_BAND_2GHZ) + if(band == NL80211_BAND_2GHZ) { n_channels = RTW_2G_CHANNELS_NUM; n_bitrates = RTW_G_RATES_NUM; } - else if(band == IEEE80211_BAND_5GHZ) + else if(band == NL80211_BAND_5GHZ) { n_channels = RTW_5G_CHANNELS_NUM; n_bitrates = RTW_A_RATES_NUM; @@ -235,12 +235,12 @@ struct ieee80211_supported_band *rtw_spt_band_alloc( spt_band->n_channels = n_channels; spt_band->n_bitrates = n_bitrates; - if(band == IEEE80211_BAND_2GHZ) + if(band == NL80211_BAND_2GHZ) { rtw_2g_channels_init(spt_band->channels); rtw_2g_rates_init(spt_band->bitrates); } - else if(band == IEEE80211_BAND_5GHZ) + else if(band == NL80211_BAND_5GHZ) { rtw_5g_channels_init(spt_band->channels); rtw_5g_rates_init(spt_band->bitrates); @@ -260,13 +260,13 @@ void rtw_spt_band_free(struct ieee80211_supported_band *spt_band) if(!spt_band) return; - if(spt_band->band == IEEE80211_BAND_2GHZ) + if(spt_band->band == NL80211_BAND_2GHZ) { size = sizeof(struct ieee80211_supported_band) + sizeof(struct ieee80211_channel)*RTW_2G_CHANNELS_NUM + sizeof(struct ieee80211_rate)*RTW_G_RATES_NUM; } - else if(spt_band->band == IEEE80211_BAND_5GHZ) + else if(spt_band->band == NL80211_BAND_5GHZ) { size = sizeof(struct ieee80211_supported_band) + sizeof(struct ieee80211_channel)*RTW_5G_CHANNELS_NUM @@ -335,12 +335,12 @@ static int rtw_ieee80211_channel_to_frequency(int chan, int band) /* see 802.11 17.3.8.3.2 and Annex J * there are overlapping channel numbers in 5GHz and 2GHz bands */ - if (band == IEEE80211_BAND_5GHZ) { + if (band == NL80211_BAND_5GHZ) { if (chan >= 182 && chan <= 196) return 4000 + chan * 5; else return 5000 + chan * 5; - } else { /* IEEE80211_BAND_2GHZ */ + } else { /* NL80211_BAND_2GHZ */ if (chan == 14) return 2484; else if (chan < 14) @@ -441,9 +441,9 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net DBG_871X("%s, got sr, but ssid mismatch, to remove this bss\n", __func__); if (pselect_network->Configuration.DSConfig <= RTW_CH_MAX_2G_CHANNEL) - freq = rtw_ieee80211_channel_to_frequency(pselect_network->Configuration.DSConfig, IEEE80211_BAND_2GHZ); + freq = rtw_ieee80211_channel_to_frequency(pselect_network->Configuration.DSConfig, NL80211_BAND_2GHZ); else - freq = rtw_ieee80211_channel_to_frequency(pselect_network->Configuration.DSConfig, IEEE80211_BAND_5GHZ); + freq = rtw_ieee80211_channel_to_frequency(pselect_network->Configuration.DSConfig, NL80211_BAND_5GHZ); notify_channel = ieee80211_get_channel(wiphy, freq); pselect_bss = cfg80211_get_bss(wiphy, NULL/*notify_channel*/, @@ -475,9 +475,9 @@ struct cfg80211_bss *rtw_cfg80211_inform_bss(_adapter *padapter, struct wlan_net channel = pnetwork->network.Configuration.DSConfig; if (channel <= RTW_CH_MAX_2G_CHANNEL) - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ); else - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_5GHZ); notify_channel = ieee80211_get_channel(wiphy, freq); @@ -617,9 +617,9 @@ int rtw_cfg80211_check_bss(_adapter *padapter) return _FALSE; if (pnetwork->Configuration.DSConfig <= RTW_CH_MAX_2G_CHANNEL) - freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, IEEE80211_BAND_2GHZ); + freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, NL80211_BAND_2GHZ); else - freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, IEEE80211_BAND_5GHZ); + freq = rtw_ieee80211_channel_to_frequency(pnetwork->Configuration.DSConfig, NL80211_BAND_5GHZ); notify_channel = ieee80211_get_channel(padapter->rtw_wdev->wiphy, freq); bss = cfg80211_get_bss(padapter->rtw_wdev->wiphy, notify_channel, @@ -771,9 +771,9 @@ check_bss: u16 channel = cur_network->network.Configuration.DSConfig; if (channel <= RTW_CH_MAX_2G_CHANNEL) - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ); else - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_5GHZ); notify_channel = ieee80211_get_channel(wiphy, freq); #endif @@ -1891,7 +1891,14 @@ void rtw_cfg80211_indicate_scan_done(_adapter *adapter, bool aborted) } else { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0) + struct cfg80211_scan_info info = { + .aborted = aborted + }; + cfg80211_scan_done(pwdev_priv->scan_request, &info); +#else cfg80211_scan_done(pwdev_priv->scan_request, aborted); +#endif } pwdev_priv->scan_request = NULL; @@ -3400,9 +3407,9 @@ void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint f #else /* defined(RTW_USE_CFG80211_STA_EVENT) */ channel = pmlmeext->cur_channel; if (channel <= RTW_CH_MAX_2G_CHANNEL) - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ); else - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_5GHZ); #ifdef COMPAT_KERNEL_RELEASE rtw_cfg80211_rx_mgmt(padapter, freq, 0, pmgmt_frame, frame_len, GFP_ATOMIC); @@ -3445,9 +3452,9 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, unsigned char *da, u #else /* defined(RTW_USE_CFG80211_STA_EVENT) */ channel = pmlmeext->cur_channel; if (channel <= RTW_CH_MAX_2G_CHANNEL) - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ); else - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_5GHZ); pmgmt_frame = mgmt_buf; pwlanhdr = (struct rtw_ieee80211_hdr *)pmgmt_frame; @@ -4257,9 +4264,9 @@ void rtw_cfg80211_rx_action_p2p(_adapter *padapter, u8 *pmgmt_frame, uint frame_ indicate: if (channel <= RTW_CH_MAX_2G_CHANNEL) - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ); else - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_5GHZ); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) rtw_cfg80211_rx_mgmt(padapter, freq, 0, pmgmt_frame, frame_len, GFP_ATOMIC); @@ -4297,9 +4304,9 @@ void rtw_cfg80211_rx_p2p_action_public(_adapter *padapter, u8 *pmgmt_frame, uint indicate: if (channel <= RTW_CH_MAX_2G_CHANNEL) - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ); else - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_5GHZ); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) rtw_cfg80211_rx_mgmt(padapter, freq, 0, pmgmt_frame, frame_len, GFP_ATOMIC); @@ -4327,9 +4334,9 @@ void rtw_cfg80211_rx_action(_adapter *adapter, u8 *frame, uint frame_len, const DBG_871X("RTW_Rx:category(%u), action(%u)\n", category, action); if (channel <= RTW_CH_MAX_2G_CHANNEL) - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_2GHZ); else - freq = rtw_ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ); + freq = rtw_ieee80211_channel_to_frequency(channel, NL80211_BAND_5GHZ); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE) rtw_cfg80211_rx_mgmt(adapter, freq, 0, frame, frame_len, GFP_ATOMIC); @@ -5718,7 +5725,7 @@ int rtw_cfg80211_set_mgnt_wpsp2pie(struct net_device *net, char *buf, int len, } -static void rtw_cfg80211_init_ht_capab(struct ieee80211_sta_ht_cap *ht_cap, enum ieee80211_band band, u8 rf_type) +static void rtw_cfg80211_init_ht_capab(struct ieee80211_sta_ht_cap *ht_cap, enum nl80211_band band, u8 rf_type) { #define MAX_BIT_RATE_40MHZ_MCS15 300 /* Mbps */ @@ -5742,7 +5749,7 @@ static void rtw_cfg80211_init_ht_capab(struct ieee80211_sta_ht_cap *ht_cap, enum ht_cap->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; /* - *hw->wiphy->bands[IEEE80211_BAND_2GHZ] + *hw->wiphy->bands[NL80211_BAND_2GHZ] *base on ant_num *rx_mask: RX mask *if rx_ant =1 rx_mask[0]=0xff;==>MCS0-MCS7 @@ -5787,16 +5794,16 @@ void rtw_cfg80211_init_wiphy(_adapter *padapter) /* if (padapter->registrypriv.wireless_mode & WIRELESS_11G) */ { - bands = wiphy->bands[IEEE80211_BAND_2GHZ]; + bands = wiphy->bands[NL80211_BAND_2GHZ]; if(bands) - rtw_cfg80211_init_ht_capab(&bands->ht_cap, IEEE80211_BAND_2GHZ, rf_type); + rtw_cfg80211_init_ht_capab(&bands->ht_cap, NL80211_BAND_2GHZ, rf_type); } /* if (padapter->registrypriv.wireless_mode & WIRELESS_11A) */ { - bands = wiphy->bands[IEEE80211_BAND_5GHZ]; + bands = wiphy->bands[NL80211_BAND_5GHZ]; if(bands) - rtw_cfg80211_init_ht_capab(&bands->ht_cap, IEEE80211_BAND_5GHZ, rf_type); + rtw_cfg80211_init_ht_capab(&bands->ht_cap, NL80211_BAND_5GHZ, rf_type); } /* init regulary domain */ @@ -5874,9 +5881,9 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy) wiphy->n_cipher_suites = ARRAY_SIZE(rtw_cipher_suites); /* if (padapter->registrypriv.wireless_mode & WIRELESS_11G) */ - wiphy->bands[IEEE80211_BAND_2GHZ] = rtw_spt_band_alloc(IEEE80211_BAND_2GHZ); + wiphy->bands[NL80211_BAND_2GHZ] = rtw_spt_band_alloc(NL80211_BAND_2GHZ); /* if (padapter->registrypriv.wireless_mode & WIRELESS_11A) */ - wiphy->bands[IEEE80211_BAND_5GHZ] = rtw_spt_band_alloc(IEEE80211_BAND_5GHZ); + wiphy->bands[NL80211_BAND_5GHZ] = rtw_spt_band_alloc(NL80211_BAND_5GHZ); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) && LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)) wiphy->flags |= WIPHY_FLAG_SUPPORTS_SEPARATE_DEFAULT_KEYS; @@ -6071,8 +6078,8 @@ void rtw_wdev_free(struct wireless_dev *wdev) if (!wdev) return; - rtw_spt_band_free(wdev->wiphy->bands[IEEE80211_BAND_2GHZ]); - rtw_spt_band_free(wdev->wiphy->bands[IEEE80211_BAND_5GHZ]); + rtw_spt_band_free(wdev->wiphy->bands[NL80211_BAND_2GHZ]); + rtw_spt_band_free(wdev->wiphy->bands[NL80211_BAND_5GHZ]); wiphy_free(wdev->wiphy); diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c index 74895ea..0427111 100644 --- a/os_dep/linux/wifi_regd.c +++ b/os_dep/linux/wifi_regd.c @@ -143,7 +143,7 @@ static bool _rtw_is_radar_freq(u16 center_freq) static void _rtw_reg_apply_beaconing_flags(struct wiphy *wiphy, enum nl80211_reg_initiator initiator) { - enum ieee80211_band band; + enum nl80211_band band; struct ieee80211_supported_band *sband; const struct ieee80211_reg_rule *reg_rule; struct ieee80211_channel *ch; @@ -205,9 +205,9 @@ static void _rtw_reg_apply_active_scan_flags(struct wiphy *wiphy, u32 bandwidth = 0; int r; - if (!wiphy->bands[IEEE80211_BAND_2GHZ]) + if (!wiphy->bands[NL80211_BAND_2GHZ]) return; - sband = wiphy->bands[IEEE80211_BAND_2GHZ]; + sband = wiphy->bands[NL80211_BAND_2GHZ]; /* * If no country IE has been received always enable active scan @@ -258,10 +258,10 @@ static void _rtw_reg_apply_radar_flags(struct wiphy *wiphy) struct ieee80211_channel *ch; unsigned int i; - if (!wiphy->bands[IEEE80211_BAND_5GHZ]) + if (!wiphy->bands[NL80211_BAND_5GHZ]) return; - sband = wiphy->bands[IEEE80211_BAND_5GHZ]; + sband = wiphy->bands[NL80211_BAND_5GHZ]; for (i = 0; i < sband->n_channels; i++) { ch = &sband->channels[i]; @@ -298,12 +298,12 @@ static int rtw_ieee80211_channel_to_frequency(int chan, int band) /* see 802.11 17.3.8.3.2 and Annex J * there are overlapping channel numbers in 5GHz and 2GHz bands */ - if (band == IEEE80211_BAND_5GHZ) { + if (band == NL80211_BAND_5GHZ) { if (chan >= 182 && chan <= 196) return 4000 + chan * 5; else return 5000 + chan * 5; - } else { /* IEEE80211_BAND_2GHZ */ + } else { /* NL80211_BAND_2GHZ */ if (chan == 14) return 2484; else if (chan < 14) @@ -348,11 +348,11 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy) if (channel <= 14) freq = rtw_ieee80211_channel_to_frequency(channel, - IEEE80211_BAND_2GHZ); + NL80211_BAND_2GHZ); else freq = rtw_ieee80211_channel_to_frequency(channel, - IEEE80211_BAND_5GHZ); + NL80211_BAND_5GHZ); ch = ieee80211_get_channel(wiphy, freq); if (ch) { @@ -393,11 +393,11 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy) if (channel <= 14) freq = rtw_ieee80211_channel_to_frequency(channel, - IEEE80211_BAND_2GHZ); + NL80211_BAND_2GHZ); else freq = rtw_ieee80211_channel_to_frequency(channel, - IEEE80211_BAND_5GHZ); + NL80211_BAND_5GHZ); ch = ieee80211_get_channel(wiphy, freq); if (ch) { @@ -544,4 +544,4 @@ int rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) return _rtw_reg_notifier_apply(wiphy, request, reg); } -#endif //CONFIG_IOCTL_CFG80211 \ No newline at end of file +#endif //CONFIG_IOCTL_CFG80211 From 1d714dd498c1d14415c7c33117367023b1f42a6c Mon Sep 17 00:00:00 2001 From: Magnus Olsson Date: Wed, 21 Dec 2016 21:38:57 +0100 Subject: [PATCH 16/20] Add support for DKMS Adds support for building, installing and uninstalling the driver using DKMS. Once installed, DKMS will manage the kernel module and automatically recompile it upon kernel upgrades. This simplifies the installation and driver maintenance for users. --- README.md | 30 ++++++++++++++++++++++++++++++ dkms.conf | 9 +++++++++ 2 files changed, 39 insertions(+) create mode 100644 dkms.conf diff --git a/README.md b/README.md index 5741239..8422849 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,36 @@ You can see the applied patches, their sources and/or motivation by looking at t Note that updates to this README will show up as separate commits. I will not mix changes to this file with changes to the code in case you want to mirror this without the README. +## Building and installing using DKMS + +This tree supports Dynamic Kernel Module Support (DKMS), a system for +generating kernel modules from out-of-tree kernel sources. It can be used to +install/uninstall kernel modules, and the module will be automatically rebuilt +from source when the kernel is upgraded (for example using your package manager). + +1. Install DKMS and other required tools + + ```shell + $ apt-get install git linux-headers-generic build-essential dkms + ``` + +2. Add the driver to DKMS. This will copy the source to a system directory so +that it can used to rebuild the module on kernel upgrades. + + ```shell + $ dkms add . + ``` + +3. Build and install the driver. + + ```shell + $ dkms install rtl8192eu/1.0 + ``` + +If you wish to uninstall the driver at a later point, use +_dkms uninstall rtl8192eu/1.0_. To completely remove the driver from DKMS use +_dkms remove rtl8192eu/1.0_. + ## Submitting patches 1. Fork repo diff --git a/dkms.conf b/dkms.conf new file mode 100644 index 0000000..592da54 --- /dev/null +++ b/dkms.conf @@ -0,0 +1,9 @@ +PACKAGE_NAME="rtl8192eu" +PACKAGE_VERSION="1.0" +BUILT_MODULE_NAME="8192eu" +DEST_MODULE_LOCATION="/kernel/drivers/net/wireless/" +REMAKE_INITRD="yes" +AUTOINSTALL="yes" +MAKE="'make' all" +CLEAN="make clean" + From 00293460e155e5c8c4514065a58f6ac9dccef9db Mon Sep 17 00:00:00 2001 From: absolutelyNoWarranty Date: Sun, 2 Apr 2017 13:55:32 +0800 Subject: [PATCH 17/20] Edit dkms.conf to use correct kernel version See http://askubuntu.com/a/832372/634049 --- dkms.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dkms.conf b/dkms.conf index 592da54..c2a2ece 100644 --- a/dkms.conf +++ b/dkms.conf @@ -4,6 +4,6 @@ BUILT_MODULE_NAME="8192eu" DEST_MODULE_LOCATION="/kernel/drivers/net/wireless/" REMAKE_INITRD="yes" AUTOINSTALL="yes" -MAKE="'make' all" +MAKE="'make' all KVER=${kernelver}" CLEAN="make clean" From 86dfb14946c0327266478e04a9484c89c045c77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Wed, 19 Apr 2017 01:25:04 +0200 Subject: [PATCH 18/20] Fix build for API changes in kernel 4.11 --- include/osdep_service.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/osdep_service.h b/include/osdep_service.h index 76026b9..6b9e27f 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -20,6 +20,10 @@ #ifndef __OSDEP_SERVICE_H_ #define __OSDEP_SERVICE_H_ +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +#include +#endif #define _FAIL 0 #define _SUCCESS 1 From 16c45522ecb03de7d5b36b152f8b54bb56b7df6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Sat, 13 May 2017 15:41:51 +0200 Subject: [PATCH 19/20] Fix compilation for ARM64 arch The kernel module failed to build on arm64 platform. Other platforms like x86 can build without problem because the csum_ipv6_magic function are defined in arch specific asm/checksum.h, which is missing on arm64 platform. --- core/rtw_br_ext.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c index 88a517a..54bd47d 100644 --- a/core/rtw_br_ext.c +++ b/core/rtw_br_ext.c @@ -49,6 +49,7 @@ #include #include #include +#include #endif #endif From f93e5f0abc968fb1546a5e0e9cf651c457b0a7fe Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Thu, 18 May 2017 14:03:47 +0100 Subject: [PATCH 20/20] Fix build with kernel 4.12-rc1 --- os_dep/linux/ioctl_cfg80211.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index cc15013..e215402 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -779,6 +779,19 @@ check_bss: #endif DBG_871X(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter)); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) + { + struct cfg80211_roam_info roam_info = { + .channel = notify_channel, + .bssid = cur_network->network.MacAddress, + .req_ie = pmlmepriv->assoc_req+sizeof(struct rtw_ieee80211_hdr_3addr)+2, + .req_ie_len = pmlmepriv->assoc_req_len-sizeof(struct rtw_ieee80211_hdr_3addr)-2, + .resp_ie = pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6, + .resp_ie_len = pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6, + }; + cfg80211_roamed(padapter->pnetdev, &roam_info, GFP_ATOMIC); + } + #else cfg80211_roamed(padapter->pnetdev #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) || defined(COMPAT_KERNEL_RELEASE) , notify_channel @@ -789,6 +802,7 @@ check_bss: , pmlmepriv->assoc_rsp+sizeof(struct rtw_ieee80211_hdr_3addr)+6 , pmlmepriv->assoc_rsp_len-sizeof(struct rtw_ieee80211_hdr_3addr)-6 , GFP_ATOMIC); + #endif } else { @@ -1750,10 +1764,17 @@ enum nl80211_iftype { NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1 }; */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) +static int cfg80211_rtw_change_iface(struct wiphy *wiphy, + struct net_device *ndev, + enum nl80211_iftype type, + struct vif_params *params) +#else static int cfg80211_rtw_change_iface(struct wiphy *wiphy, struct net_device *ndev, enum nl80211_iftype type, u32 *flags, struct vif_params *params) +#endif { enum nl80211_iftype old_type; NDIS_802_11_NETWORK_INFRASTRUCTURE networkType; @@ -3792,7 +3813,11 @@ static int #else char *name, #endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)) + enum nl80211_iftype type, struct vif_params *params) + #else enum nl80211_iftype type, u32 *flags, struct vif_params *params) + #endif { int ret = 0; struct net_device* ndev = NULL; @@ -5895,7 +5920,11 @@ static void rtw_cfg80211_preinit_wiphy(_adapter *padapter, struct wiphy *wiphy) #endif #if defined(CONFIG_PM) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)) wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN; +#else // kernel >= 4.12 + wiphy->max_sched_scan_reqs = 1; +#endif #ifdef CONFIG_PNO_SUPPORT wiphy->max_sched_scan_ssids = MAX_PNO_LIST_COUNT; #endif