From 9fc768c393b26f4b192e3730d5ca24b24c98f5ec Mon Sep 17 00:00:00 2001 From: Jim Date: Wed, 12 Dec 2018 05:45:53 -0500 Subject: [PATCH 01/15] Updated to compile on kernel 4.19.0+ Updated: u16 (*)(struct net_device *, struct sk_buff *, void *) to u16 (*)(struct net_device *, struct sk_buff *, struct net_device *) --- os_dep/linux/os_intfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index a964d67..7cfd262 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1010,7 +1010,9 @@ 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)) + , struct net_device *unused +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)) , void *unused #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) From f7c1f84da63911b58142487e5a84d7fdc859dd8a Mon Sep 17 00:00:00 2001 From: James Drabb Jr Date: Wed, 12 Dec 2018 06:11:25 -0500 Subject: [PATCH 02/15] [Fixed simple compiler waring] --- hal/rtl8812a/rtl8812a_mp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hal/rtl8812a/rtl8812a_mp.c b/hal/rtl8812a/rtl8812a_mp.c index 6cb0bfa..75217fe 100644 --- a/hal/rtl8812a/rtl8812a_mp.c +++ b/hal/rtl8812a/rtl8812a_mp.c @@ -600,6 +600,7 @@ void Hal_SetAntenna(PADAPTER pAdapter) u8 r_rx_antenna_ofdm = 0, r_ant_select_cck_val = 0; u8 chgTx = 0, chgRx = 0; u32 r_ant_sel_cck_val = 0, r_ant_select_ofdm_val = 0, r_ofdm_tx_en_val = 0; + u32 reg0xC50 = 0; p_ofdm_tx = (R_ANTENNA_SELECT_OFDM *)&r_ant_select_ofdm_val; @@ -637,7 +638,6 @@ void Hal_SetAntenna(PADAPTER pAdapter) switch (pAdapter->mppriv.antenna_rx) { - u32 reg0xC50 = 0; case ANTENNA_A: PHY_SetBBReg(pAdapter, rRxPath_Jaguar, bMaskByte0, 0x11); PHY_SetRFReg(pAdapter, ODM_RF_PATH_B, RF_AC_Jaguar, 0xF0000, 0x1); // RF_B_0x0[19:16] = 1, Standby mode From 6cd9605377992529e8297e013495ed19b4663696 Mon Sep 17 00:00:00 2001 From: Michael John Date: Mon, 11 Mar 2019 18:40:43 -0400 Subject: [PATCH 03/15] Add support for TP-Link Archer T4UHP, AC1300. --- 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 80989b7..7e92c91 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -280,6 +280,7 @@ static struct usb_device_id rtw_usb_id_tbl[] ={ {USB_DEVICE(0x2357, 0x0103),.driver_info = RTL8812}, /* TP-Link - Archer T4UH(US), AC1200 */ {USB_DEVICE(0x2357, 0x010d),.driver_info = RTL8812}, /* TP-Link - Archer T4U, AC1300 */ {USB_DEVICE(0x2357, 0x010e),.driver_info = RTL8812}, /* TP-Link - Archer T4UH, AC1300 */ + {USB_DEVICE(0x2357, 0x0122),.driver_info = RTL8812}, /* TP-Link - Archer T4UHP, AC1300 */ {USB_DEVICE(0x0411, 0x025d),.driver_info = RTL8812}, /* Buffalo - WI-U3-866D */ {USB_DEVICE(0x0bda, 0x8812),.driver_info = RTL8812}, /* Netis WF2190 */ {USB_DEVICE(0x2604, 0x0012),.driver_info = RTL8812}, /* Tenda U12 */ From c5f3d21507050e0f34ddb0433f36aaf16b6b2a21 Mon Sep 17 00:00:00 2001 From: James Drabb Jr Date: Sun, 17 Mar 2019 05:22:44 -0400 Subject: [PATCH 04/15] Fixed to work with kernel versions 5.0.x --- dkms.conf | 2 +- include/rtw_version.h | 2 +- install.sh | 0 os_dep/linux/rtw_android.c | 6 +++++- runwpa | 4 +--- 5 files changed, 8 insertions(+), 6 deletions(-) mode change 100644 => 100755 install.sh diff --git a/dkms.conf b/dkms.conf index 3cff3fa..a9a062e 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME=8812au -PACKAGE_VERSION=4.2.2 +PACKAGE_VERSION=4.2.3 DEST_MODULE_LOCATION=/kernel/drivers/net/wireless BUILT_MODULE_NAME=8812au diff --git a/include/rtw_version.h b/include/rtw_version.h index 3c2314b..a9262d5 100644 --- a/include/rtw_version.h +++ b/include/rtw_version.h @@ -1 +1 @@ -#define DRIVERVERSION "v4.2.2_7502.20130517" +#define DRIVERVERSION "v4.2.3" diff --git a/install.sh b/install.sh old mode 100644 new mode 100755 diff --git a/os_dep/linux/rtw_android.c b/os_dep/linux/rtw_android.c index d56c2ec..3ab6dfa 100644 --- a/os_dep/linux/rtw_android.c +++ b/os_dep/linux/rtw_android.c @@ -352,7 +352,11 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) goto exit; } - if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)){ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)) + if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)){ +#else + if (!access_ok(priv_cmd.buf, priv_cmd.total_len)){ +#endif DBG_871X("%s: failed to access memory\n", __FUNCTION__); ret = -EFAULT; goto exit; diff --git a/runwpa b/runwpa index f825e8b..ebb21d4 100644 --- a/runwpa +++ b/runwpa @@ -1,7 +1,7 @@ #!/bin/bash if [ "`which iwconfig`" = "" ] ; then - echo "WARNING:Wireless tool not exist!" + echo "WARNING:Wireless tool (iwconfig) not exist!" echo " Please install it!" exit else @@ -16,5 +16,3 @@ else fi fi - - From 0ee556a6888921aa9deac891bab1104f2a6e2913 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 24 Sep 2018 06:46:51 +0200 Subject: [PATCH 05/15] Makefile: always use weak assignment for KSRC With a weak-assignment of KSRC the module will be enabled to support cross- building it for different Kernel Versions on a build machine. The change enabled me to cross-compile this module for the VyOS 4.18.8 Kernel by simply invoking: $ KSRC=/home/cpo/vyos-build/packages/vyos-kernel make --- Makefile | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index fc7fd5e..870ae2e 100644 --- a/Makefile +++ b/Makefile @@ -654,7 +654,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/) ARCH ?= $(SUBARCH) CROSS_COMPILE ?= KVER ?= $(shell uname -r) -KSRC := /lib/modules/$(KVER)/build +KSRC ?= /lib/modules/$(KVER)/build MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/ INSTALL_PREFIX := endif @@ -666,15 +666,15 @@ ARCH := $(R_ARCH) #CROSS_COMPILE := arm-none-linux-gnueabi- CROSS_COMPILE := $(R_CROSS_COMPILE) KVER := 3.4.0 -#KSRC := ../../../../build/out/kernel -KSRC := $(KERNEL_BUILD_PATH) +#KSRC ?= ../../../../build/out/kernel +KSRC ?= $(KERNEL_BUILD_PATH) MODULE_NAME :=wlan endif ifeq ($(CONFIG_PLATFORM_TI_AM3517), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_SHUTTLE CROSS_COMPILE := arm-eabi- -KSRC := $(shell pwd)/../../../Android/kernel +KSRC ?= $(shell pwd)/../../../Android/kernel ARCH := arm endif @@ -683,7 +683,7 @@ EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR_TITANIA12 ARCH:=mips CROSS_COMPILE:= /usr/src/Mstar_kernel/mips-4.3/bin/mips-linux-gnu- KVER := 2.6.28.9 -KSRC := /usr/src/Mstar_kernel/2.6.28.9/ +KSRC ?= /usr/src/Mstar_kernel/2.6.28.9/ endif ifeq ($(CONFIG_PLATFORM_ANDROID_X86), y) @@ -691,7 +691,7 @@ EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN SUBARCH := $(shell uname -m | sed -e s/i.86/i386/) ARCH := $(SUBARCH) CROSS_COMPILE := /media/DATA-2/android-x86/ics-x86_20120130/prebuilt/linux-x86/toolchain/i686-unknown-linux-gnu-4.2.1/bin/i686-unknown-linux-gnu- -KSRC := /media/DATA-2/android-x86/ics-x86_20120130/out/target/product/generic_x86/obj/kernel +KSRC ?= /media/DATA-2/android-x86/ics-x86_20120130/out/target/product/generic_x86/obj/kernel MODULE_NAME :=wlan endif @@ -703,7 +703,7 @@ EXTRA_CFLAGS += -DCONFIG_P2P_IPS SUBARCH := $(shell uname -m | sed -e s/i.86/i386/) ARCH := $(SUBARCH) CROSS_COMPILE := /home/android_sdk/android-x86_JB/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7/bin/i686-linux-android- -KSRC := /home/android_sdk/android-x86_JB/out/target/product/x86/obj/kernel/ +KSRC ?= /home/android_sdk/android-x86_JB/out/target/product/x86/obj/kernel/ MODULE_NAME :=wlan endif @@ -720,7 +720,7 @@ EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH := arm CROSS_COMPILE := arm-linux- KVER := 2.6.24.7_$(ARCH) -KSRC := /usr/src/kernels/linux-$(KVER) +KSRC ?= /usr/src/kernels/linux-$(KVER) endif ifeq ($(CONFIG_PLATFORM_ARM_S3C6K4), y) @@ -776,7 +776,7 @@ ifeq ($(CONFIG_PLATFORM_MIPS_AR9132), y) EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN ARCH := mips CROSS_COMPILE := mips-openwrt-linux- -KSRC := /home/alex/test_openwrt/tmp/linux-2.6.30.9 +KSRC ?= /home/alex/test_openwrt/tmp/linux-2.6.30.9 endif ifeq ($(CONFIG_PLATFORM_DMP_PHILIPS), y) @@ -825,7 +825,7 @@ EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ACTIONS_ATJ227X ARCH := mips CROSS_COMPILE := /home/cnsd4/project/actions/tools-2.6.27/bin/mipsel-linux-gnu- KVER := 2.6.27 -KSRC := /home/cnsd4/project/actions/linux-2.6.27.28 +KSRC ?= /home/cnsd4/project/actions/linux-2.6.27.28 endif ifeq ($(CONFIG_PLATFORM_TI_DM365), y) @@ -833,7 +833,7 @@ EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_TI_DM365 ARCH := arm CROSS_COMPILE := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le- KVER := 2.6.18 -KSRC := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/lsp/ti-davinci/linux-dm365 +KSRC ?= /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/lsp/ti-davinci/linux-dm365 endif ifeq ($(CONFIG_PLATFORM_TEGRA3_CARDHU), y) @@ -845,7 +845,7 @@ EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_P2P_IPS ARCH := arm CROSS_COMPILE := /home/android_sdk/nvidia/tegra-16r3-partner-android-4.1_20120723/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- -KSRC := /home/android_sdk/nvidia/tegra-16r3-partner-android-4.1_20120723/out/target/product/cardhu/obj/KERNEL +KSRC ?= /home/android_sdk/nvidia/tegra-16r3-partner-android-4.1_20120723/out/target/product/cardhu/obj/KERNEL MODULE_NAME := wlan endif @@ -858,7 +858,7 @@ EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_P2P_IPS ARCH := arm CROSS_COMPILE := /home/android_sdk/nvidia/tegra-17r9-partner-android-4.2-dalmore_20130131/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- -KSRC := /home/android_sdk/nvidia/tegra-17r9-partner-android-4.2-dalmore_20130131/out/target/product/dalmore/obj/KERNEL +KSRC ?= /home/android_sdk/nvidia/tegra-17r9-partner-android-4.2-dalmore_20130131/out/target/product/dalmore/obj/KERNEL MODULE_NAME := wlan endif @@ -866,7 +866,7 @@ ifeq ($(CONFIG_PLATFORM_ARM_TCC8900), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH := arm CROSS_COMPILE := /home/android_sdk/Telechips/SDK_2304_20110613/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- -KSRC := /home/android_sdk/Telechips/SDK_2304_20110613/kernel +KSRC ?= /home/android_sdk/Telechips/SDK_2304_20110613/kernel MODULE_NAME := wlan endif @@ -874,7 +874,7 @@ ifeq ($(CONFIG_PLATFORM_ARM_TCC8920), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN ARCH := arm CROSS_COMPILE := /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- -KSRC := /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/kernel +KSRC ?= /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/kernel MODULE_NAME := wlan endif @@ -886,7 +886,7 @@ EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_P2P_IPS ARCH := arm CROSS_COMPILE := /home/android_sdk/Telechips/v13.03_r1-tcc-android-4.2.2_ds_patched/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- -KSRC := /home/android_sdk/Telechips/v13.03_r1-tcc-android-4.2.2_ds_patched/kernel +KSRC ?= /home/android_sdk/Telechips/v13.03_r1-tcc-android-4.2.2_ds_patched/kernel MODULE_NAME := wlan endif @@ -894,7 +894,7 @@ ifeq ($(CONFIG_PLATFORM_ARM_RK2818), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS -DCONFIG_MINIMAL_MEMORY_USAGE ARCH := arm CROSS_COMPILE := /usr/src/release_fae_version/toolchain/arm-eabi-4.4.0/bin/arm-eabi- -KSRC := /usr/src/release_fae_version/kernel25_A7_281x +KSRC ?= /usr/src/release_fae_version/kernel25_A7_281x MODULE_NAME := wlan endif @@ -902,7 +902,7 @@ ifeq ($(CONFIG_PLATFORM_ARM_URBETTER), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN #-DCONFIG_MINIMAL_MEMORY_USAGE ARCH := arm CROSS_COMPILE := /media/DATA-1/urbetter/arm-2009q3/bin/arm-none-linux-gnueabi- -KSRC := /media/DATA-1/urbetter/ics-urbetter/kernel +KSRC ?= /media/DATA-1/urbetter/ics-urbetter/kernel MODULE_NAME := wlan endif @@ -910,9 +910,9 @@ ifeq ($(CONFIG_PLATFORM_ARM_TI_PANDA), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN #-DCONFIG_MINIMAL_MEMORY_USAGE ARCH := arm #CROSS_COMPILE := /media/DATA-1/aosp/ics-aosp_20111227/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- -#KSRC := /media/DATA-1/aosp/android-omap-panda-3.0_20120104 +#KSRC ?= /media/DATA-1/aosp/android-omap-panda-3.0_20120104 CROSS_COMPILE := /media/DATA-1/android-4.0/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- -KSRC := /media/DATA-1/android-4.0/panda_kernel/omap +KSRC ?= /media/DATA-1/android-4.0/panda_kernel/omap MODULE_NAME := wlan endif @@ -937,7 +937,7 @@ EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MN10300 ARCH := mn10300 CROSS_COMPILE := mn10300-linux- KVER := 2.6.32.2 -KSRC := /home/winuser/work/Plat_sLD2T_V3010/usr/src/linux-2.6.32.2 +KSRC ?= /home/winuser/work/Plat_sLD2T_V3010/usr/src/linux-2.6.32.2 INSTALL_PREFIX := endif @@ -978,7 +978,7 @@ SUBARCH := $(shell uname -m | sed -e s/ppc/powerpc/) ARCH ?= $(SUBARCH) CROSS_COMPILE ?= KVER ?= $(shell uname -r) -KSRC := /lib/modules/$(KVER)/build +KSRC ?= /lib/modules/$(KVER)/build MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/ INSTALL_PREFIX := endif From a48df038fedf6e8050126dce62e9004034513426 Mon Sep 17 00:00:00 2001 From: Alexander Traud Date: Tue, 8 Jan 2019 10:58:12 +0100 Subject: [PATCH 06/15] Add USB Device Obihai OBiWiFi with 3823:6249 USB driver gets attached and Wi-Fi adapter is usable. However, I did not test this driver but used version 5.3.4 for RTL8811AU, see and . --- 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 36e928e..80989b7 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -302,6 +302,7 @@ static struct usb_device_id rtw_usb_id_tbl[] ={ {USB_DEVICE(0x04BB, 0x0953),.driver_info = RTL8821}, /* I-O DATA - WN-AC433UA */ {USB_DEVICE(0x0BDA, 0xA811),.driver_info = RTL8821}, /* GMYLE - AC450 */ {USB_DEVICE(0x2001, 0x3318),.driver_info = RTL8821}, /* D-Link - DWA-172 */ + {USB_DEVICE(0x3823, 0x6249),.driver_info = RTL8821}, /* Obihai - OBiWiFi */ #endif #ifdef CONFIG_RTL8192E From 64f269b90edfe89833a8b6d10016ef12082247fb Mon Sep 17 00:00:00 2001 From: James Drabb Jr Date: Sun, 17 Mar 2019 05:58:01 -0400 Subject: [PATCH 07/15] Create .gitignore Ignore built kernel modules and cmd files. --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6d12d2e --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ + +*.o +*.o.cmd +*.ko +*.ko.cmd +Module.symvers +modules.order +*.mod +8812au.mod.c From 2eb86a834977f56c82a0079b0a2c8302f5ab7501 Mon Sep 17 00:00:00 2001 From: James Drabb Jr Date: Sun, 17 Mar 2019 06:23:05 -0400 Subject: [PATCH 08/15] Update Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed warning about ISO C90 forbids variable length array ‘input’ [-Wvla]. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 870ae2e..a878615 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ EXTRA_CFLAGS += -Wno-unused EXTRA_CFLAGS += -Wno-uninitialized EXTRA_CFLAGS += -Wno-int-to-pointer-cast +EXTRA_CFLAGS += -Wno-vla EXTRA_CFLAGS += -I$(src)/include From bd775685837b507882093c6529ba6d3543978dbd Mon Sep 17 00:00:00 2001 From: Naoki Mizuno Date: Wed, 10 Jul 2019 11:57:35 +0900 Subject: [PATCH 09/15] Add USB Device I-O DATA WNPU583B with 0bda:0823 --- 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 80989b7..7698fa4 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -303,6 +303,7 @@ static struct usb_device_id rtw_usb_id_tbl[] ={ {USB_DEVICE(0x0BDA, 0xA811),.driver_info = RTL8821}, /* GMYLE - AC450 */ {USB_DEVICE(0x2001, 0x3318),.driver_info = RTL8821}, /* D-Link - DWA-172 */ {USB_DEVICE(0x3823, 0x6249),.driver_info = RTL8821}, /* Obihai - OBiWiFi */ + {USB_DEVICE(0x0bda, 0x0823),.driver_info = RTL8821}, /* I-O DATA - WNPU583B */ #endif #ifdef CONFIG_RTL8192E From 89b8d132c33149598eea6c6db941e8aab25f048e Mon Sep 17 00:00:00 2001 From: Jim Date: Thu, 11 Jul 2019 16:13:57 -0400 Subject: [PATCH 10/15] os_intfs.c: linux-5.2: disable fallback from rtw_select_queue osdep_service.c: Replaced get_ds() with KERNEL_DS --- os_dep/linux/os_intfs.c | 16 +++++++++------- os_dep/osdep_service.c | 6 +++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 7cfd262..f4fe0c5 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1010,13 +1010,15 @@ 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(4, 19, 0)) - , struct net_device *unused -#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)) - , void *unused -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) - , select_queue_fallback_t fallback +#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) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)) + , select_queue_fallback_t fallback + #endif #endif ){ _adapter *padapter = rtw_netdev_priv(dev); diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 7afaf73..7af3324 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -1556,7 +1556,7 @@ static int isFileReadable(char *path) ret = PTR_ERR(fp); } else { - oldfs = get_fs(); set_fs(get_ds()); + oldfs = get_fs(); set_fs(KERNEL_DS); if(1!=readFile(fp, &buf, 1)) ret = PTR_ERR(fp); @@ -1584,7 +1584,7 @@ static int retriveFromFile(char *path, u8* buf, u32 sz) if( 0 == (ret=openFile(&fp,path, O_RDONLY, 0)) ){ DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp); - oldfs = get_fs(); set_fs(get_ds()); + oldfs = get_fs(); set_fs(KERNEL_DS); ret=readFile(fp, buf, sz); set_fs(oldfs); closeFile(fp); @@ -1618,7 +1618,7 @@ static int storeToFile(char *path, u8* buf, u32 sz) if( 0 == (ret=openFile(&fp, path, O_CREAT|O_WRONLY, 0666)) ) { DBG_871X("%s openFile path:%s fp=%p\n",__FUNCTION__, path ,fp); - oldfs = get_fs(); set_fs(get_ds()); + oldfs = get_fs(); set_fs(KERNEL_DS); ret=writeFile(fp, buf, sz); set_fs(oldfs); closeFile(fp); From 16044fb5e70ba426b50663940661fed1781a2d05 Mon Sep 17 00:00:00 2001 From: Jim Date: Thu, 11 Jul 2019 16:21:50 -0400 Subject: [PATCH 11/15] Added note about changes --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2bde357..094d8a4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +## Changes +2019-07-11: Updated to compile against kernel 5.2 + ## Realtek 802.11ac (rtl8812au) This is a fork of the Realtek 802.11ac (rtl8812au) v4.2.2 (7502.20130507) From 187be66f2fcf0ff6c722ec407d96d5399e7dcedb Mon Sep 17 00:00:00 2001 From: Aleksandr Shugurov Date: Fri, 2 Aug 2019 09:54:48 -0400 Subject: [PATCH 12/15] linux kernel 5.x. Ubuntu 19.04 --- Makefile | 3 +++ os_dep/linux/rtw_android.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 870ae2e..b27a70f 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,9 @@ EXTRA_CFLAGS += -Wno-unused-parameter EXTRA_CFLAGS += -Wno-unused-function EXTRA_CFLAGS += -Wno-unused +EXTRA_CFLAGS += -Wno-incompatible-pointer-types +EXTRA_CFLAGS += -Wno-implicit-function-declaration + EXTRA_CFLAGS += -Wno-uninitialized EXTRA_CFLAGS += -Wno-int-to-pointer-cast diff --git a/os_dep/linux/rtw_android.c b/os_dep/linux/rtw_android.c index d56c2ec..8932dc7 100644 --- a/os_dep/linux/rtw_android.c +++ b/os_dep/linux/rtw_android.c @@ -352,7 +352,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) goto exit; } - if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)){ + if (!access_ok(priv_cmd.buf, priv_cmd.total_len)){ DBG_871X("%s: failed to access memory\n", __FUNCTION__); ret = -EFAULT; goto exit; From 032b11c048af7d528aeee0298f6ed9b478fdd557 Mon Sep 17 00:00:00 2001 From: Wistral Date: Fri, 16 Aug 2019 21:37:15 +0800 Subject: [PATCH 13/15] add USB device Tenda U12 RTL8812 with 0x2604, 0x0012 --- 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 1df5587..40d1af7 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -257,6 +257,7 @@ static struct usb_device_id rtw_usb_id_tbl[] ={ {USB_DEVICE(USB_VENDER_ID_REALTEK, 0x881C),.driver_info = RTL8812},/* Default ID */ /*=== Customer ID ===*/ {USB_DEVICE(0x050D, 0x1106),.driver_info = RTL8812}, /* Belkin - sercomm */ + {USB_DEVICE(0x2604, 0x0012),.driver_info = RTL8812}, /* Tenda - U12 */ {USB_DEVICE(0x050D, 0x1109),.driver_info = RTL8812}, /* Belkin F9L1109 - SerComm */ {USB_DEVICE(0x2001, 0x330E),.driver_info = RTL8812}, /* D-Link - ALPHA */ {USB_DEVICE(0x7392, 0xA822),.driver_info = RTL8812}, /* Edimax - Edimax */ From c37d20f8cc2cdb14847c9398e35c1fed9c5a3076 Mon Sep 17 00:00:00 2001 From: shadowsf Date: Tue, 8 Oct 2019 09:44:35 +0200 Subject: [PATCH 14/15] Test files for WiFi driver fork --- project/prjtTest1.htm | 0 project/prjtTest1.js | 0 repoTest1.js | 0 repoTest2.htm | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 project/prjtTest1.htm create mode 100644 project/prjtTest1.js create mode 100644 repoTest1.js create mode 100644 repoTest2.htm diff --git a/project/prjtTest1.htm b/project/prjtTest1.htm new file mode 100644 index 0000000..e69de29 diff --git a/project/prjtTest1.js b/project/prjtTest1.js new file mode 100644 index 0000000..e69de29 diff --git a/repoTest1.js b/repoTest1.js new file mode 100644 index 0000000..e69de29 diff --git a/repoTest2.htm b/repoTest2.htm new file mode 100644 index 0000000..e69de29 From 3adef736e77bd0671a91c0a6a6541853a28e245f Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 11 Oct 2019 05:49:16 -0400 Subject: [PATCH 15/15] Address two -Wimplicit-fallthrough issues for gcc In rtw_mlme_ext.c, falling through makes perfect sense. I've there replaced the ad hoc comment with the necessary gcc attribute. In rtw_ap.c, the default case seems to agree with the previous ones only by happenstance, so I've inserted an actual break there. The warnings no longer fire. Yes, there's a portable [[fallthrough]] -- for C++17. This won't work on Clang, but neither will the kernel, nor this Makefile. --- core/rtw_ap.c | 1 + core/rtw_mlme_ext.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 2ea3466..6ae613a 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -2069,6 +2069,7 @@ static int rtw_ap_set_key(_adapter *padapter, u8 *key, u8 alg, int keyid, u8 set case _TKIP_WTMIC_: case _AES_: keylen = 16; + break; default: keylen = 16; } diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 464fa11..25651da 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -709,7 +709,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame) ptable->func = &OnAuth; else ptable->func = &OnAuthClient; - //pass through + __attribute__ ((fallthrough)); case WIFI_ASSOCREQ: case WIFI_REASSOCREQ: _mgt_dispatcher(padapter, ptable, precv_frame);