Commit 5455d5d6 authored by Sophie Brun's avatar Sophie Brun

Update upstream source from tag 'upstream/5.2.20.2_20190210'

Update to upstream version '5.2.20.2~20190210'
with Debian dir 77762ea4b1572130355ea13c74f94159ce2066b3
parents e59dc502 0e554547
This diff is collapsed.
## RTL8812AU/21AU and RTL8814AU drivers
## with monitor mode and frame injection
### Supports Realtek 8811, 8812, 8814 and 8821 chipsets
[![Monitor mode](https://img.shields.io/badge/monitor%20mode-working-brightgreen.svg)](#)
[![Frame Injection](https://img.shields.io/badge/frame%20injection-working-brightgreen.svg)](#)
[![GitHub version](https://badge.fury.io/gh/aircrack-ng%2Frtl8812au.svg)](https://badge.fury.io/gh/aircrack-ng%2Frtl8812au)
[![GitHub issues](https://img.shields.io/github/issues/aircrack-ng/rtl8812au.svg)](https://github.com/aircrack-ng/rtl8812au/issues)
[![GitHub forks](https://img.shields.io/github/forks/aircrack-ng/rtl8812au.svg)](https://github.com/aircrack-ng/rtl8812au/network)
[![GitHub stars](https://img.shields.io/github/stars/aircrack-ng/rtl8812au.svg)](https://github.com/aircrack-ng/rtl8812au/stargazers)
[![GitHub license](https://img.shields.io/github/license/aircrack-ng/rtl8812au.svg)](https://github.com/aircrack-ng/rtl8812au/blob/master/LICENSE)
<br>
[![Kali](https://img.shields.io/badge/Kali-supported-blue.svg)](https://www.kali.org)
[![Arch](https://img.shields.io/badge/Arch-supported-blue.svg)](https://www.archlinux.org)
[![Armbian](https://img.shields.io/badge/Armbian-supported-blue.svg)](https://www.armbian.com)
[![ArchLinux](https://img.shields.io/badge/ArchLinux-supported-blue.svg)](https://img.shields.io/badge/ArchLinux-supported-blue.svg)
[![aircrack-ng](https://img.shields.io/badge/aircrack--ng-supported-blue.svg)](https://github.com/aircrack-ng/aircrack-ng)
[![wifite2](https://img.shields.io/badge/wifite2-supported-blue.svg)](https://github.com/derv82/wifite2)
### 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 apt-get install dkms
$ sudo apt-get install dkms
```
### 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
```
### 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
```
### Make
### Build / Install with Make
For building & installing the driver with 'make' use
```
make
make install
$ make
$ make install
```
### Notes
### Using hostapd?
Check the documents folder for more information on how to setup wpa_cli and hostapd
support on these drivers. <br>For 802.11ac (high speed), the driver also needs to be loaded
with: <br>"modprobe -r 88XXau" && "modprobe 88XXau rtw_vht_enable=2"
```
# For a bit more info on AP/STA mode configuration, see following links:
- http://blog.fraggod.net/2017/04/27/wifi-hostapd-configuration-for-80211ac-networks.html
- https://github.com/mk-fg/archlinux-pkgbuilds/issues/2#issuecomment-325991813
```
### Download / Build / Install
Download
```
git clone -b v5.2.20 https://github.com/aircrack-ng/rtl8812au.git
cd rtl*
$ git clone -b v5.2.20 https://github.com/aircrack-ng/rtl8812au.git
$ cd rtl*
```
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 linux-headers-`uname -r`
$ apt-get install build-essential
$ apt-get install bc
$ apt-get install libelf-dev
$ apt-get install linux-headers-`uname -r`
```
For Raspberry (RPI 2/3) you will need kernel sources
```
$ wget "https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source" -O /usr/bin/rpi-source
$ chmod 755 /usr/bin/rpi-source
$ rpi-source
```
Then you need to download and compile the driver on the RPI
```
$ git clone https://github.com/aircrack-ng/rtl8812au -b v5.2.20
$ cd rtl*
$ make
$ cp 8812au.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless
$ depmod -a
$ modprobe 88XXau
```
then run this step to change platform in Makefile, For RPI 2/3:
```
For Raspberry (RPI)
$ sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
$ sed -i 's/CONFIG_PLATFORM_ARM_RPI = n/CONFIG_PLATFORM_ARM_RPI = y/g' Makefile
```
sudo apt-get install raspberrypi-kernel-headers
But for RPI 3 B+ you will need to run those below
which builds the ARM64 arch driver:
```
For setting monitor mode
$ sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile
$ sed -i 's/CONFIG_PLATFORM_ARM64_RPI = n/CONFIG_PLATFORM_ARM64_RPI = y/g' Makefile
```
### For setting monitor mode
1. Fix problematic interference in monitor mode.
```
airmon-ng check kill
$ 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
$ ip link set <wlan1> down
```
3. Set monitor mode
```
sudo iw dev wlan0 set type monitor
$ airmon-ng start <wlan1>
or
$ iw dev <wlan1> set type monitor
```
4. Set interface up
```
sudo ip link set wlan0 up
$ ip link set <wlan1> up
```
For setting TX power
```
sudo iw wlan0 set txpower fixed 3000
$ iwconfig <wlan1> txpower 30
or
$ iw <wlan1> set txpower fixed 3000
```
### LED control
#### You can now control LED behaviour statically by Makefile, for example:
......@@ -76,7 +127,7 @@ CONFIG_LED_ENABLE = n
```
value can be y or n
#### statically by module parameter in /etc/modprobe.d/8812au.conf or wherever, for example:
#### statically by module parameter in /etc/modprobe.d/8812au.conf or whatever, example:
```sh
options 88XXau rtw_led_enable=0
......@@ -96,15 +147,28 @@ value can be 0 or 1
$ cat /proc/net/rtl8812au/$(your interface name)/led_enable
```
### Testing / Debug
```
Check "documents" and "tools" folders for information
We also got a Android APK tool for debugging several chipsets
```
![https://github.com/aircrack-ng/rtl8812au/blob/v5.2.20/documents/Screenshot_20190129-025608-01.jpeg](https://github.com/aircrack-ng/rtl8812au/blob/v5.2.20/documents/Screenshot_20190129-025608-01.jpeg)
### NetworkManager
Newer versions of NetworkManager switches to random MAC address. Some users would prefer to use a fixed address.
Simply add these lines below
Newer versions of NetworkManager got some options you might want to disable.
Simply add these lines into the NetworkManager.conf
```
[device]
wifi.scan-rand-mac-address=no
[ifupdown]
managed=false
[connection]
wifi.powersave=2
```
at the end of file /etc/NetworkManager/NetworkManager.conf and restart NetworkManager with the command:
```
sudo service NetworkManager restart
$ sudo service NetworkManager restart
```
......@@ -80,19 +80,12 @@ void dump_drv_cfg(void *sel)
RTW_PRINT_SEL(sel, "CONFIG_POWER_SAVING\n");
#endif
#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE
RTW_PRINT_SEL(sel, "LOAD_PHY_PARA_FROM_FILE - REALTEK_CONFIG_PATH=%s\n", REALTEK_CONFIG_PATH);
#if defined(CONFIG_MULTIDRV) || defined(REALTEK_CONFIG_PATH_WITH_IC_NAME_FOLDER)
RTW_PRINT_SEL(sel, "LOAD_PHY_PARA_FROM_FILE - REALTEK_CONFIG_PATH_WITH_IC_NAME_FOLDER\n");
#endif
/* configurations about TX power */
#ifdef CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY
RTW_PRINT_SEL(sel, "CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY\n");
#endif
#ifdef CONFIG_CALIBRATE_TX_POWER_TO_MAX
RTW_PRINT_SEL(sel, "CONFIG_CALIBRATE_TX_POWER_TO_MAX\n");
#endif
#endif
RTW_PRINT_SEL(sel, "RTW_DEF_MODULE_REGULATORY_CERT=0x%02x\n", RTW_DEF_MODULE_REGULATORY_CERT);
......
......@@ -11844,8 +11844,8 @@ static void rtw_mlmeext_disconnect(_adapter *padapter)
self_action = MLME_ADHOC_STOPPED;
else if (MLME_IS_NULL(padapter))
self_action = MLME_ACTION_NONE;
else
rtw_warn_on(1);
//else
// rtw_warn_on(1);
/* set_opmode_cmd(padapter, infra_client_with_mlme); */
......
......@@ -11,7 +11,7 @@ DRV_DIR=rtl8812au
DRV_NAME=rtl8812au
DRV_VERSION=5.2.20.2
cp -r ../${DRV_DIR} /usr/src/${DRV_NAME}-${DRV_VERSION}
cp -r $(pwd) /usr/src/${DRV_NAME}-${DRV_VERSION}
dkms add -m ${DRV_NAME} -v ${DRV_VERSION}
dkms build -m ${DRV_NAME} -v ${DRV_VERSION}
......
PACKAGE_NAME="realtek-rtl88xxau"
PACKAGE_VERSION="5.2.20.2~20181106"
PACKAGE_VERSION="5.2.20.2~20190210"
CLEAN="'make' clean"
BUILT_MODULE_NAME[0]=88XXau
PROCS_NUM=`nproc`
......
##### hostapd configuration file ##############################################
interface=wlan0
ctrl_interface=/var/run/hostapd
ssid=DIRECT-RT
channel=6
wpa=2
wpa_passphrase=12345678
##### Wi-Fi Protected Setup (WPS) #############################################
eap_server=1
# WPS state
# 0 = WPS disabled (default)
# 1 = WPS enabled, not configured
# 2 = WPS enabled, configured
wps_state=2
uuid=12345678-9abc-def0-1234-56789abcdef0
# Device Name
# User-friendly description of device; up to 32 octets encoded in UTF-8
device_name=RTL8192CU
# Manufacturer
# The manufacturer of the device (up to 64 ASCII characters)
manufacturer=Realtek
# Model Name
# Model of the device (up to 32 ASCII characters)
model_name=RTW_SOFTAP
# Model Number
# Additional device description (up to 32 ASCII characters)
model_number=WLAN_CU
# Serial Number
# Serial number of the device (up to 32 characters)
serial_number=12345
# Primary Device Type
# Used format: <categ>-<OUI>-<subcateg>
# categ = Category as an integer value
# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for
# default WPS OUI
# subcateg = OUI-specific Sub Category as an integer value
# Examples:
# 1-0050F204-1 (Computer / PC)
# 1-0050F204-2 (Computer / Server)
# 5-0050F204-1 (Storage / NAS)
# 6-0050F204-1 (Network Infrastructure / AP)
device_type=6-0050F204-1
# OS Version
# 4-octet operating system version number (hex string)
os_version=01020300
# Config Methods
# List of the supported configuration methods
config_methods=label display push_button keypad
##### default configuration #######################################
driver=rtl871xdrv
beacon_int=100
hw_mode=g
ieee80211n=1
wme_enabled=1
ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+]
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
max_num_sta=8
wpa_group_rekey=86400
supported_rates=60 90 120 180 240 360 480 540
basic_rates=60 120 240
##### hostapd configuration file ##############################################
interface=wlan0
ctrl_interface=/var/run/hostapd
ssid=rtwap
channel=6
wpa=2
wpa_passphrase=87654321
#bridge=br0
##### Wi-Fi Protected Setup (WPS) #############################################
eap_server=1
# WPS state
# 0 = WPS disabled (default)
# 1 = WPS enabled, not configured
# 2 = WPS enabled, configured
wps_state=2
uuid=12345678-9abc-def0-1234-56789abcdef0
# Device Name
# User-friendly description of device; up to 32 octets encoded in UTF-8
device_name=RTL8192CU
# Manufacturer
# The manufacturer of the device (up to 64 ASCII characters)
manufacturer=Realtek
# Model Name
# Model of the device (up to 32 ASCII characters)
model_name=RTW_SOFTAP
# Model Number
# Additional device description (up to 32 ASCII characters)
model_number=WLAN_CU
# Serial Number
# Serial number of the device (up to 32 characters)
serial_number=12345
# Primary Device Type
# Used format: <categ>-<OUI>-<subcateg>
# categ = Category as an integer value
# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for
# default WPS OUI
# subcateg = OUI-specific Sub Category as an integer value
# Examples:
# 1-0050F204-1 (Computer / PC)
# 1-0050F204-2 (Computer / Server)
# 5-0050F204-1 (Storage / NAS)
# 6-0050F204-1 (Network Infrastructure / AP)
device_type=6-0050F204-1
# OS Version
# 4-octet operating system version number (hex string)
os_version=01020300
# Config Methods
# List of the supported configuration methods
config_methods=label display push_button keypad
##### default configuration #######################################
driver=rtl871xdrv
beacon_int=100
hw_mode=g
ieee80211n=1
wme_enabled=1
ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+]
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
max_num_sta=8
wpa_group_rekey=86400
##### hostapd configuration file ##############################################
interface=wlan0
ctrl_interface=/var/run/hostapd
ssid=rtwap
channel=36
wpa=2
wpa_passphrase=87654321
#bridge=br0
##### Wi-Fi Protected Setup (WPS) #############################################
eap_server=1
# WPS state
# 0 = WPS disabled (default)
# 1 = WPS enabled, not configured
# 2 = WPS enabled, configured
wps_state=2
uuid=12345678-9abc-def0-1234-56789abcdef0
# Device Name
# User-friendly description of device; up to 32 octets encoded in UTF-8
device_name=RTL8192CU
# Manufacturer
# The manufacturer of the device (up to 64 ASCII characters)
manufacturer=Realtek
# Model Name
# Model of the device (up to 32 ASCII characters)
model_name=RTW_SOFTAP
# Model Number
# Additional device description (up to 32 ASCII characters)
model_number=WLAN_CU
# Serial Number
# Serial number of the device (up to 32 characters)
serial_number=12345
# Primary Device Type
# Used format: <categ>-<OUI>-<subcateg>
# categ = Category as an integer value
# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for
# default WPS OUI
# subcateg = OUI-specific Sub Category as an integer value
# Examples:
# 1-0050F204-1 (Computer / PC)
# 1-0050F204-2 (Computer / Server)
# 5-0050F204-1 (Storage / NAS)
# 6-0050F204-1 (Network Infrastructure / AP)
device_type=6-0050F204-1
# OS Version
# 4-octet operating system version number (hex string)
os_version=01020300
# Config Methods
# List of the supported configuration methods
config_methods=label display push_button keypad
##### default configuration #######################################
driver=rtl871xdrv
beacon_int=100
hw_mode=a
ieee80211n=1
wme_enabled=1
ht_capab=[SHORT-GI-20][SHORT-GI-40][HT40+]
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
max_num_sta=8
wpa_group_rekey=86400
ctrl_interface=/var/run/wpa_supplicant
update_config=1
# Wi-Fi Protected Setup (WPS) parameters
# Device Name
# User-friendly description of device; up to 32 octets encoded in UTF-8
device_name=RTL8192CU
# Manufacturer
# The manufacturer of the device (up to 64 ASCII characters)
manufacturer=Realtek
# Model Name
# Model of the device (up to 32 ASCII characters)
model_name=RTW_STA
# Model Number
# Additional device description (up to 32 ASCII characters)
model_number=WLAN_CU
# Serial Number
# Serial number of the device (up to 32 characters)
serial_number=12345
# Primary Device Type
# Used format: <categ>-<OUI>-<subcateg>
# categ = Category as an integer value
# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for
# default WPS OUI
# subcateg = OUI-specific Sub Category as an integer value
# Examples:
# 1-0050F204-1 (Computer / PC)
# 1-0050F204-2 (Computer / Server)
# 5-0050F204-1 (Storage / NAS)
# 6-0050F204-1 (Network Infrastructure / AP)
device_type=1-0050F204-1
# OS Version
# 4-octet operating system version number (hex string)
os_version=01020300
# Config Methods
# List of the supported configuration methods
# Available methods: usba ethernet label display ext_nfc_token int_nfc_token
# nfc_interface push_button keypad virtual_display physical_display
# virtual_push_button physical_push_button
# For WSC 1.0:
#config_methods=display push_button keypad
# For WSC 2.0:
config_methods=virtual_display virtual_push_button keypad
......@@ -4823,128 +4823,6 @@ void hal_btcoex_SetAntIsolationType(PADAPTER padapter, u8 anttype)
}
#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE
int
hal_btcoex_ParseAntIsolationConfigFile(
PADAPTER Adapter,
char *buffer
)
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
u32 i = 0 , j = 0;
char *szLine , *ptmp;
int rtStatus = _SUCCESS;
char param_value_string[10];
u8 param_value;
u8 anttype = 4;
u8 ant_num = 3 , ant_distance = 50 , rfe_type = 1;
typedef struct ant_isolation {
char *param_name; /* antenna isolation config parameter name */
u8 *value; /* antenna isolation config parameter value */
} ANT_ISOLATION;
ANT_ISOLATION ant_isolation_param[] = {
{"ANT_NUMBER" , &ant_num},
{"ANT_DISTANCE" , &ant_distance},
{"RFE_TYPE" , &rfe_type},
{NULL , 0}
};
/* RTW_INFO("===>Hal_ParseAntIsolationConfigFile()\n" ); */
ptmp = buffer;
for (szLine = GetLineFromBuffer(ptmp) ; szLine != NULL; szLine = GetLineFromBuffer(ptmp)) {
/* skip comment */
if (IsCommentString(szLine))
continue;
/* RTW_INFO("%s : szLine = %s , strlen(szLine) = %d\n" , __func__ , szLine , strlen(szLine));*/
for (j = 0 ; ant_isolation_param[j].param_name != NULL ; j++) {
if (strstr(szLine , ant_isolation_param[j].param_name) != NULL) {
i = 0;
while (i < strlen(szLine)) {
if (szLine[i] != '"')
++i;
else {
/* skip only has one " */
if (strpbrk(szLine , "\"") == strrchr(szLine , '"')) {
RTW_INFO("Fail to parse parameters , format error!\n");
break;
}
_rtw_memset((PVOID)param_value_string , 0 , 10);
if (!ParseQualifiedString(szLine , &i , param_value_string , '"' , '"')) {
RTW_INFO("Fail to parse parameters\n");
return _FAIL;
} else if (!GetU1ByteIntegerFromStringInDecimal(param_value_string , ant_isolation_param[j].value))
RTW_INFO("Fail to GetU1ByteIntegerFromStringInDecimal\n");
break;
}
}
}
}
}
/* YiWei 20140716 , for BT coex antenna isolation control */
/* rfe_type = 0 was SPDT , rfe_type = 1 was coupler */
if (ant_num == 3 && ant_distance >= 50)
anttype = 3;
else if (ant_num == 2 && ant_distance >= 50 && rfe_type == 1)
anttype = 2;
else if (ant_num == 3 && ant_distance >= 15 && ant_distance < 50)
anttype = 2;
else if (ant_num == 2 && ant_distance >= 15 && ant_distance < 50 && rfe_type == 1)
anttype = 2;
else if ((ant_num == 2 && ant_distance < 15 && rfe_type == 1) || (ant_num == 3 && ant_distance < 15))
anttype = 1;
else if (ant_num == 2 && rfe_type == 0)
anttype = 0;
else
anttype = 0;
hal_btcoex_SetAntIsolationType(Adapter, anttype);
RTW_INFO("%s : ant_num = %d\n" , __func__ , ant_num);
RTW_INFO("%s : ant_distance = %d\n" , __func__ , ant_distance);
RTW_INFO("%s : rfe_type = %d\n" , __func__ , rfe_type);
/* RTW_INFO("<===Hal_ParseAntIsolationConfigFile()\n"); */
return rtStatus;
}
int
hal_btcoex_AntIsolationConfig_ParaFile(