From f2119aedd711c677f87bdbb5f7cfca77be95f290 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Sat, 4 Aug 2018 17:13:04 +0200 Subject: [PATCH] Fix DKMS to include 8814au chipset --- Makefile | 18 ++-- README.md | 127 +++++++++++-------------- dkms.conf | 9 +- hal/rtl8814a/usb/.rtl8814au_xmit.c.swp | Bin 1024 -> 0 bytes 4 files changed, 65 insertions(+), 89 deletions(-) delete mode 100644 hal/rtl8814a/usb/.rtl8814au_xmit.c.swp diff --git a/Makefile b/Makefile index 1911446..b4324ad 100755 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ CONFIG_RTL8812A = y CONFIG_RTL8821A = y CONFIG_RTL8192E = n CONFIG_RTL8723B = n -CONFIG_RTL8814A = y +CONFIG_RTL8814A = n CONFIG_RTL8723C = n CONFIG_RTL8188F = n CONFIG_RTL8822B = n @@ -196,17 +196,11 @@ ifeq ($(CONFIG_PCI_HCI), y) HCI_NAME = pci endif -#ifeq ($(RTL8814), 1) -#CONFIG_RTL8812A = n -#CONFIG_RTL8821A = n -#CONFIG_RTL8814A = y -#endif - -#ifeq ($(RTL8821), 1) -#CONFIG_RTL8812A = y -#CONFIG_RTL8821A = y -#CONFIG_RTL8814A = n -#endif +ifeq ($(RTL8814), 1) +CONFIG_RTL8812A = y +CONFIG_RTL8821A = y +CONFIG_RTL8814A = y +endif ifeq ($(CONFIG_USB2_EXTERNAL_POWER), y) EXTRA_CFLAGS += -DCONFIG_USE_EXTERNAL_POWER diff --git a/README.md b/README.md index ad2cab1..c0a632d 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,37 @@ -# rtl8812au +# RTL8812AU/21AU and RTL8814AU drivers +# with monitor mode and frame injection -## Realtek 8812AU driver v5.2.20.2 with monitor mode and frame injection - -This driver supports 8812au / 8821au and 8814au chipsets. - -### Building / Installing - -To build and install module manually: +## DKMS +This driver can be installed using [DKMS]. This is a system which will automatically recompile and install a kernel module when a new kernel gets installed or updated. To make use of DKMS, install the `dkms` package, which on Debian (based) systems is done like this: ``` -$ sudo make -$ sudo make install +sudo apt install dkms ``` -To use DKMS install: - +## Installation of Driver +In order to install the driver open a terminal in the directory with the source code and execute the following command: ``` -$ sudo ./dkms-install.sh +sudo ./dkms-install.sh ``` -To use DKMS uninstall and remove: - +## Removal of Driver +In order to remove the driver from your system open a terminal in the directory with the source code and execute the following command: ``` -$ sudo ./dkms-remove.sh +sudo ./dkms-remove.sh ``` -### Notes +## Make +For building & installing the rtl8812au/rtl8821au driver with 'make' use +``` +make +make install +``` +and for building & installing the rtl8814au driver with 'make' use +``` +make RTL8814=1 +make install RTL8814=1 +``` + +## Notes Download ``` git clone -b v5.2.20 https://github.com/aircrack-ng/rtl8812au.git @@ -35,72 +42,45 @@ Package / Build dependencies (Kali) sudo apt-get install build-essential sudo apt-get install bc sudo apt-get install libelf-dev -sudo apt-get install dkms sudo apt-get install linux-headers-`uname -r` ``` -Building for Raspberry (RPI) also needs +For Raspberry (RPI) ``` sudo apt install raspberrypi-kernel-headers ``` - -### For setting monitor mode -1. Fix problematic interference in monitor mode. +For setting monitor mode + 1. Fix problematic interference in monitor mode. + ``` + airmon-ng check kill + ``` + You may also uncheck the box "Automatically connect to this network when it is avaiable" in nm-connection-editor. This only works if you have a saved wifi connection. + + 2. Set interface down + ``` + sudo ip link set wlan0 down + ``` + 3. Set monitor mode + ``` + sudo iw dev wlan0 set type monitor + ``` + 4. Set interface up + ``` + sudo ip link set wlan0 up + ``` +For setting TX power ``` -airmon-ng check kill -``` -You may also uncheck the box "Automatically connect to this network when it is avaiable" in nm-connection-editor. This only works if you have a saved wifi connection. - -2. Set interface down -``` -sudo ip link set wlan0 down -``` -3. Set monitor mode -``` -sudo iw dev wlan0 set type monitor -``` -4. Set interface up -``` -sudo ip link set wlan0 up +sudo iw wlan0 set txpower fixed 3000 ``` -### TX Power Control - -The txpower may be adjusted with these commands -``` -ifconfig down -iwconfig txpower 30 +## LED Parameter ``` +We've added the "realtek-leds.conf" in build directory, +with this you may change the leds to +"2: Allways On", "1: Normal" or "0: Allways Off" with placing the file in "/etc/modprobe.d/ -### LED control - -#### You can now control LED behaviour statically by Makefile, for example: - -```sh -CONFIG_LED_ENABLE = n -``` -value can be y or n - -#### statically by module parameter in /etc/modprobe.d/8812au.conf or wherever, for example: - -```sh -options 8812au rtw_led_enable=0 -``` -value can be 0 or 1 - -#### or dynamically by writing to /proc/net/rtl8812au/$(your interface name)/led_enable, for example: - -```sh -$ echo "0" > /proc/net/rtl8812au/$(your interface name)/led_enable -``` -value can be 0 or 1 - -#### check current value: - -```sh -$ cat /proc/net/rtl8812au/$(your interface name)/led_enable -``` - -### NetworkManager +Manual modprobe will override this file if option value also included at the command line, e.g., +$ sudo modprobe -r 8812au +$ sudo modprobe 8812au rtw_led_ctrl=1 Newer versions of NetworkManager switches to random MAC address. Some users would prefer to use a fixed address. Simply add these lines below @@ -111,3 +91,4 @@ wifi.scan-rand-mac-address=no at the end of file /etc/NetworkManager/NetworkManager.conf and restart NetworkManager with the command: ``` sudo service NetworkManager restart +``` diff --git a/dkms.conf b/dkms.conf index 011695b..a8c9005 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,10 +1,11 @@ PACKAGE_NAME="realtek-rtl88xxau" PACKAGE_VERSION="5.2.20.2~20180804" -BUILT_MODULE_NAME[0]="8812au" +CLEAN="make clean" +BUILT_MODULE_NAME[0]=8812au PROCS_NUM=`nproc` [ $PROCS_NUM -gt 16 ] && PROCS_NUM=16 -MAKE="'make' -j$PROCS_NUM KVER=${kernelver} KSRC=/lib/modules/${kernelver}/build" -CLEAN="'make' clean" DEST_MODULE_LOCATION[0]="/updates" +MAKE[0]="'make' -j$PROCS_NUM KVER=${kernelver} && 'make' -j$PROCS_NUM RTL8814=1 KVER=${kernelver}" +BUILT_MODULE_NAME[1]=8814au +DEST_MODULE_LOCATION[1]="/updates" AUTOINSTALL="yes" -REMAKE_INITRD=no diff --git a/hal/rtl8814a/usb/.rtl8814au_xmit.c.swp b/hal/rtl8814a/usb/.rtl8814au_xmit.c.swp deleted file mode 100644 index 7b41a0671dcd73b0cc953d5e4b2f54be30a91d1d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmYc?$V<%2S1{7E)U#kf0;={53`P0*B}hUznc0asnK&hpBr+0n^ovSzEG!I767@@q bli-}v_=?=j61`+3wWG|@5Eu;s+J^uDc5@PH