From ea50530a3e90dd243313df324d24f61bd93a474c Mon Sep 17 00:00:00 2001 From: morrownr Date: Fri, 18 Feb 2022 13:54:03 -0600 Subject: [PATCH] update device IDs and docs --- raspiOS-64.sh => ARM64_RPI.sh | 7 +- raspiOS-32.sh => ARM_RPI.sh | 7 +- README.md | 151 +++++++++++++++++++++------------- os_dep/linux/usb_intf.c | 33 +++++--- supported-device-IDs | 25 ++++-- 5 files changed, 146 insertions(+), 77 deletions(-) rename raspiOS-64.sh => ARM64_RPI.sh (88%) rename raspiOS-32.sh => ARM_RPI.sh (89%) diff --git a/raspiOS-64.sh b/ARM64_RPI.sh similarity index 88% rename from raspiOS-64.sh rename to ARM64_RPI.sh index ce9f0e6..395ed15 100755 --- a/raspiOS-64.sh +++ b/ARM64_RPI.sh @@ -1,14 +1,15 @@ #!/bin/bash # -# Purpose: Change settings in the Makefile to support compiling for Raspberry Pi OS (64 bit). +# Purpose: Change settings in the Makefile to support compiling 64 bit +# operating systems for Raspberry Pi Hardware. # # To make this file executable: # -# $ chmod +x raspiOS-64.sh +# $ chmod +x ARM64_RPI.sh # # To execute this file: # -# $ ./raspiOS-64.sh +# $ ./ARM64_RPI.sh sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile RESULT=$? diff --git a/raspiOS-32.sh b/ARM_RPI.sh similarity index 89% rename from raspiOS-32.sh rename to ARM_RPI.sh index c3c7995..b4fd321 100755 --- a/raspiOS-32.sh +++ b/ARM_RPI.sh @@ -1,14 +1,15 @@ #!/bin/bash # -# Purpose: Change settings in the Makefile to support compiling for Raspberry Pi OS (32 bit). +# Purpose: Change settings in the Makefile to support compiling 32 bit +# operating systems for Raspberry Pi Hardware. # # To make this file executable (if necessary): # -# $ chmod +x raspiOS-32.sh +# $ chmod +x ARM_RPI.sh # # To execute this file: # -# $ ./raspiOS-32.sh +# $ ./ARM_RPI.sh # getconf LONG_BIT (need to work on this) diff --git a/README.md b/README.md index 8e901f4..163aaba 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,18 @@ sudo uname -a; mokutil --sb-state; lsusb; rfkill list all; dkms status; iw dev ----- -### 88x2bu ( 88x2bu.ko ) :rocket: +## 88x2bu ( 88x2bu.ko ) :rocket: -### Linux Driver for USB WiFi Adapters that are based on the RTL8812BU and RTL8822BU Chipsets +## Linux Driver for USB WiFi Adapters that are based on the RTL8812BU and RTL8822BU Chipsets - v5.13.1 (Realtek) (20210702) plus updates from the Linux community -- 4,200 visitors over the 2 weeks ended on 20220206 (Thank you!) +- 5,027 Views over the 2 weeks ended on 20220218 (Thank you!) ### Features - IEEE 802.11 b/g/n/ac WiFi compliant - 802.1x, WEP, WPA TKIP and WPA2 AES/Mixed mode for PSK and TLS (Radius) -- WPA3 (see pinned issue with title `How to Enable WPA3 support`) +- WPA3 (see FAQ) - IEEE 802.11b/g/n/ac Client mode * Supports wireless security for WEP, WPA TKIP and WPA2 AES PSK * Supports site survey scan and manual connect @@ -189,36 +189,51 @@ driver by running the following command: sudo dkms status ``` -The installation instructions are for the novice user. Experienced users are welcome to alter the installation to meet their needs. +The installation instructions are for the novice user. Experienced users are +welcome to alter the installation to meet their needs. -Temporary internet access is required for installation. There are numerous ways to enable temporary internet access depending on your hardware and situation. [One method is to use tethering from a phone.](https://www.makeuseof.com/tag/how-to-tether-your-smartphone-in-linux) Another method is to keep a [WiFi adapter that uses an in-kernel driver](https://github.com/morrownr/USB-WiFi) in your toolkit. +Temporary internet access is required for installation. There are numerous ways +to enable temporary internet access depending on your hardware and situation. +[One method is to use tethering from a phone.](https://www.makeuseof.com/tag/how-to-tether-your-smartphone-in-linux). +Another method is to keep a [WiFi adapter that uses an in-kernel driver](https://github.com/morrownr/USB-WiFi) in your toolkit. -You will need to use the terminal interface. The quick way to open a terminal: Ctrl+Alt+T (hold down on the Ctrl and Alt keys then press the T key). +You will need to use the terminal interface. The quick way to open a terminal: +Ctrl+Alt+T (hold down on the Ctrl and Alt keys then press the T key). -An alternative terminal is to use SSH (Secure Shell) from the same or from another computer, in which case you will be in a suitable terminal after logging in, but this step requires that an SSH daemon/server has already been configured. (There are lots of SSH guides available, e.g., for the [Raspberry Pi](https://www.raspberrypi.com/documentation/computers/remote-access.html#setting-up-an-ssh-server) and for [Ubuntu](https://linuxconfig.org/ubuntu-20-04-ssh-server). Do not forget [to secure the SSH server](https://www.howtogeek.com/443156/the-best-ways-to-secure-your-ssh-server/).) +An alternative terminal is to use SSH (Secure Shell) from the same or from +another computer, in which case you will be in a suitable terminal after logging +in, but this step requires that an SSH daemon/server has already been +configured. (There are lots of SSH guides available, e.g., for the [Raspberry Pi](https://www.raspberrypi.com/documentation/computers/remote-access.html#setting-up-an-ssh-server) and for [Ubuntu](https://linuxconfig.org/ubuntu-20-04-ssh-server). Do not forget [to secure the SSH server](https://www.howtogeek.com/443156/the-best-ways-to-secure-your-ssh-server/).) -You will need to have sufficient access rights to use `sudo` so that commands can be executed as the `root` user. (If the command `sudo echo Yes` returns "Yes", with or without having to enter your password, you do have sufficient access rights.) +You will need to have sufficient access rights to use `sudo` so that commands +can be executed as the `root` user. (If the command `sudo echo Yes` returns +"Yes", with or without having to enter your password, you do have sufficient +access rights.) -DKMS is used for the installation. DKMS is a system utility which will automatically recompile and reinstall this driver when a new kernel is installed. DKMS is provided by and maintained by Dell. +DKMS is used for the installation. DKMS is a system utility which will +automatically recompile and reinstall this driver when a new kernel is +installed. DKMS is provided by and maintained by Dell. -It is recommended that you do not delete the driver directory after installation as the directory contains information and scripts that you may need in the future. +It is recommended that you do not delete the driver directory after installation +as the directory contains information and scripts that you may need in the future. -There is no need to disable Secure Mode to install this driver. If Secure Mode is properly setup on your system, this installation will support it. +There is no need to disable Secure Mode to install this driver. If Secure Mode +is properly setup on your system, this installation will support it. ### Installation Steps #### Step 1: Open a terminal (e.g. Ctrl+Alt+T) -#### Step 2: Update the system package information (select the option for the OS you are using) +#### Step 2: Update and upgrade system packages (select the option for the OS you are using) Note: If your Linux distro does not fall into one of options listed -below, you will need to research how to update your system package -information. +below, you will need to research how to update and upgrade your system +packages. - Option for Debian based distributions such as Ubuntu, Linux Mint, Kali and Raspberry Pi OS ``` -sudo apt update +sudo apt update && sudo apt upgrade ``` - Option for Arch based distributions such as Manjaro @@ -230,7 +245,7 @@ sudo pacman -Syu - Option for Fedora based distributions ``` -sudo dnf -y update +sudo dnf upgrade ``` - Option for openSUSE based distributions @@ -239,20 +254,23 @@ sudo dnf -y update sudo zypper update ``` -Note: If you do not regularly maintain your system by installing updated -packages, please do so now and then reboot. The rest of the installation -will appreciate having a fully up to date system to work with. The -installation can then be continued with Step 3. +Note: It is recommended that you reboot your system at this point. The +rest of the installation will appreciate having a fully up to date +system to work with. The installation can then be continued with Step 3. + +``` +sudo reboot +``` #### Step 3: Install the required packages (select the option for the OS you are using) -- Option for Raspberry Pi OS +- Option for Raspberry Pi OS (ARM/ARM64), for Raspberry Pi Desktop (x86) see below ``` sudo apt install -y raspberrypi-kernel-headers bc build-essential dkms git ``` -- Option for Debian, Kali and Linux Mint Debian Edition (LMDE) +- Option for Debian, Kali, Linux Mint Debian Edition (LMDE) and Raspberry Pi Desktop (x86) ``` sudo apt install -y linux-headers-$(uname -r) build-essential dkms git libelf-dev @@ -332,35 +350,44 @@ whether you want to enable Concurrent Mode. ./cmode-on.sh ``` -#### Step 9: Run a script to reconfigure for Raspberry Pi hardware +#### Step 9: Run a script to reconfigure for ARM or ARM64 based systems -Warning: This step only applies if you are installing to Raspberry Pi -*hardware*. +Warning: This driver defaults to supporting x86 and amd64 based systems +and this step should be `skipped` if your system is powered by an x86, +amd64 or compatible CPU. -Warning: You should skip this step if installing to x86 or amd64 based -systems. +Note: If your system is powered by an ARM or ARM64 based Raspberry Pi, +then one of the following scripts should be executed: -- Option for the 32 bit Raspberry Pi OS to be installed to Raspberry Pi hardware +- Option for the following listed operating systems to be installed to +Raspberry Pi hardware ``` -./raspiOS-32.sh + * Raspberry Pi OS (32 bit) ``` -- Option for the 64 bit Raspberry Pi OS to be installed to Raspberry Pi hardware - ``` -./raspiOS-64.sh +./ARM_RPI.sh ``` -Note: The best option for other 64 bit operating systems to be -installed to Raspberry Pi hardware is to use the 64 bit option. An -example is Ubuntu for Raspberry Pi. +- Option for the following listed operating systems to be installed to +Raspberry Pi hardware -Note: Other ARM or ARM64 based systems will likely require modifications -similar to those provided in the above scripts for Raspberry Pi hardware -but the number and variety of different ARM and ARM64 based systems -makes supporting each system unpractical so you will need to research -the needs of your system and make the appropriate modifications. If you +``` + * Raspberry Pi OS (64 bit) + * Kali Linux RPI ARM64 + * Ubuntu for Raspberry Pi +``` + +``` +./ARM64_RPI.sh +``` + +Note: ARM or ARM64 based systems not listed above will likely require +modifications similar to those provided in the above scripts but the +number and variety of different ARM and ARM64 based systems makes +supporting each system unpractical so you will need to research the +needs of your system and make the appropriate modifications. If you discover the settings and make a new script that works with your ARM or ARM64 based system, you are welcome to submit the script and information to be included here. @@ -428,8 +455,7 @@ Note: This script should be used in the following situations: Note: This script removes everything that has been installed, with the exception of the packages installed in Step 3 and the driver directory. -The driver directory can and probably should be deleted in most cases -after running this script. +The driver directory can be deleted after running this script. #### Step 1: Open a terminal (e.g. Ctrl+Alt+T) @@ -553,24 +579,39 @@ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf Question: Is WPA3 supported? -Answer: WPA3-SAE support is in this driver according to Realtek, -however, for it to work with some current Linux distros, you will need -to download, compile and install the current development version of -wpa_supplicant at the following site: +Answer: WPA3-SAE support is in this driver according to Realtek, however, for it +to work in client mode with some current Linux distros, you will need to +download, compile and install the current development version of wpa_supplicant +from the following site: https://w1.fi/cgit/ -See issue titled `How to Enable WPA3 support` for more information. +Note: There is a file in the `docs` folder called `Update_wpa_supplicant_v3a.md` +that may help with updating wpa_supplicant. + +Note: Some distros appear to have versions of Network Manager that are not +compatible with this driver. If that is the case, you may need to STOP or KILL +Network Manager and connect using wpa_supplicant. + +WPA3-SAE is working well in AP mode using hostapd with current versions of the +Raspberry Pi OS. + +Question: I bought two rtl8812bu based adapters and am planning to use both in +the same computer. How do I set that up? + +Answer: You can't without considerable technical skills. Realtek drivers do not +support more than one adapter with the same chipset in the same computer. You +can have multiple Realtek based adapters in the same computer as long as the +adapters are based on different chipsets. -Question: I bought two rtl8812bu based adapters and am planning to run one of them as an AP and another as a WiFi client. How do I set that up? +Question: Why do you recommend Mediatek based adapters when you maintain this +repo for a Realtek driver? -Answer: You can't without considerable technical skills. Realtek drivers do not support more than one adapter with the same chipset in the same computer. You have multiple Realtek based adapters in the same computer as long as the adapters are based on different chipsets. Testing has shown that the Mediatek drivers do support more than one adapter with the same chipset in various configurations. - - -Question: Why do you recommend Mediatek based adapters when you maintain this repo for a Realtek driver? - -Answer: Many new and existing Linux users already have adapters based on Realtek chipsets. This repo is for Linux users to support their existing adapters but my STRONG recommendation is for Linux users to seek out WiFi solutions based on Mediatek, Intel or Atheros chipsets and in-kernel drivers. If users are looking at a USB solution, Mediatek and Atheros based adapters are the best solution. Realtek based USB adapters are not a good solution because Realtek does not follow Linux Wireless standards (mac80211) for USB WiFi adapters and the drivers are not maintained in the Linux kernel. These issues make Realtek drivers problematic in many ways. You have been WARNED. For more information about USB WiFi adapters: +Answer: Many new and existing Linux users already have adapters based on Realtek +chipsets. This repo is for Linux users to support their existing adapters but my +STRONG recommendation is for Linux users to seek out USB WiFi solutions based on +Mediatek, https://github.com/morrownr/USB-WiFi diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index f4e46b2..03005f3 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -241,20 +241,33 @@ static struct usb_device_id rtw_usb_id_tbl[] = { /*=== Realtek demoboard ===*/ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB82C, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Default ID for USB multi-function */ {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB812, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Default ID for USB Single-function, WiFi only */ + {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xB81A, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Default ID */ /*=== Customer ID ===*/ - {USB_DEVICE_AND_INTERFACE_INFO(0x13b1, 0x0043, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Alpha - Alpha*/ - {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_EDOMAX, 0xB822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax */ - {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_EDOMAX, 0xC822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax */ - {USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x1841, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS AC1300 USB-AC55 B1 */ - {USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x184C, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS U2*/ - {USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x331e, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Dlink - DWA-181*/ - {USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x331c, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Dlink - DWA-182*/ - {USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9055, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* NetGear A6150 */ - {USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x012D, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T3U */ - {USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0138, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T3U Plus */ + {USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xB822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax */ + {USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xC822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax */ + {USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xD822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax */ + {USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xE822, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Edimax */ + {USB_DEVICE_AND_INTERFACE_INFO(0x13b1, 0x0043, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Alpha - Alpha */ + {USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x012D, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T3U v1 */ + {USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0138, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T3U Plus v1 */ {USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0115, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-Link Archer T4U V3 */ + {USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x012E, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-LINK */ + {USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0116, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-LINK */ + {USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0117, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TP-LINK */ + {USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9055, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Netgear A6150 */ + {USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x1841, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS AC1300 USB-AC55 B1 */ + {USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x184C, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS U2 */ + {USB_DEVICE_AND_INTERFACE_INFO(0x0B05, 0x19aa, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS - USB-AC58 rev A1 */ + {USB_DEVICE_AND_INTERFACE_INFO(0x0B05, 0x1870, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS */ + {USB_DEVICE_AND_INTERFACE_INFO(0x0B05, 0x1874, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* ASUS */ + {USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x331e, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Dlink - DWA-181 */ + {USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x331c, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Dlink - DWA-182 - D1 */ {USB_DEVICE_AND_INTERFACE_INFO(0x20F4, 0x808A, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* TRENDnet TEW-808UBM */ {USB_DEVICE_AND_INTERFACE_INFO(0x13b1, 0x0045, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Linksys WUSB3600 v2 */ + {USB_DEVICE_AND_INTERFACE_INFO(0x04CA, 0x8602, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* LiteOn */ + {USB_DEVICE_AND_INTERFACE_INFO(0x0E66, 0x0025, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Hawking HW12ACU */ + {USB_DEVICE_AND_INTERFACE_INFO(0x13B1, 0x0043, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* Linksys */ + {USB_DEVICE_AND_INTERFACE_INFO(0x0BDA, 0x2102, 0xff, 0xff, 0xff), .driver_info = RTL8822B}, /* CCNC */ #endif /* CONFIG_RTL8822B */ #ifdef CONFIG_RTL8723D diff --git a/supported-device-IDs b/supported-device-IDs index 6c22c82..7f28b48 100644 --- a/supported-device-IDs +++ b/supported-device-IDs @@ -16,22 +16,35 @@ Realtek default IDs ID 0BDA:B82C - Default ID for USB multi-function (such as WiFi plus bluetooth) ID 0BDA:B812 - Default ID for USB Single-function, WiFi only +ID 0BDA:B81A - Default ID Seller specific IDs -ID 13b1:0043 -ID 0b05:1841 -ID 0b05:184C ID 7392:B822 ID 7392:C822 -ID 2001:331e -ID 2001:331c -ID 0846:9055 +ID 7392:D822 +ID 7392:E822 +ID 13b1:0043 ID 2357:012D ID 2357:0138 ID 2357:0115 +ID 2357:012E +ID 2357:0116 +ID 2357:0117 +ID 0846:9055 +ID 0b05:1841 +ID 0b05:184C +ID 0B05:19aa +ID 0B05:1870 +ID 0B05:1874 +ID 2001:331e +ID 2001:331c ID 20F4:808A ID 13b1:0045 +ID 04CA:8602 +ID 0E66:0025 +ID 13B1:0043 +ID 0BDA:2102 If your adapter matches one of the default or seller specific IDs then this is the driver to use.