Skip to content

Commit

Permalink
Merge remote-tracking branch 'morrownr/main' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
hmtheboy154 committed Jun 2, 2024
2 parents 060e59b + eec76d8 commit 32092ed
Show file tree
Hide file tree
Showing 15 changed files with 380 additions and 388 deletions.
45 changes: 19 additions & 26 deletions 8821au.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,32 @@
#
# Purpose: Allow easy access to specific driver options.
#
# Edit the following line to change, add or delete options:
options 8821au rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=1 rtw_power_mgnt=1
# Edit the following line to change, add or delete driver options:
#
# Note: The above `options` line is a good default for managed mode. Below is
# an example for AP mode. Modify as required after reading the documentation:
#options 8821au rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=2 rtw_power_mgnt=1 rtw_dfs_region_domain=1
options 8821au rtw_led_ctrl=1
#
# Note: The above `options` line is a good default for managed mode. Below
# are examples for AP mode. Modify as required after reading the documentation:
#
# Band 1 (2.4 GHz)
#options 8812au rtw_switch_usb_mode=2
#
# Band 2 (5 GHz)
#options 8812au rtw_switch_usb_mode=1 rtw_vht_enable=2 rtw_dfs_region_domain=1 rtw_country_code=US
#
# After editing is complete, save this file (if using nano: Ctrl + x, y, Enter)
# and reboot to activate the changes.
#
# Note: hostapd information is located at the end of this file.
#
# Documentation:
#
# -----
#
# Log options ( rtw_drv_log_level )
#
# 0 = NONE
# 1 = ALWAYS (default)
# 0 = NONE (default)
# 1 = ALWAYS
# 2 = ERROR
# 3 = WARNING
# 4 = INFO
Expand All @@ -31,7 +39,8 @@ options 8821au rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=1 rtw_power_mgn
#
# sudo ./save-log.sh
#
# Note: The name of the log file will be `rtw.log`.
# Note: A log option greater than 1 must be set. The name of the log
# file will be `rtw.log`.
#
# -----
#
Expand Down Expand Up @@ -113,23 +122,7 @@ options 8821au rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=1 rtw_power_mgn
#
# -----
#
# Wireless Mode options ( rtw_wireless_mode )
#
# 1 = 2.4GHz 802.11b
# 2 = 2.4GHz 802.11g
# 3 = 2.4GHz 802.11b/g
# 4 = 5GHz 802.11a
# 8 = 2.4Hz 802.11n
# 11 = 2.4GHz 802.11b/g/n
# 16 = 5GHz 802.11n
# 20 = 5GHz 802.11a/n
# 64 = 5GHz 802.11ac
# 84 = 5GHz 802.11a/n/ac
# 95 = 2.4GHz 802.11b/g/n 5GHz 802.11a/n/ac (default)
#
# -----
#
# To see all options that are available:
# To see all driver options that are available:
#
# $ ls /sys/module/8821au/parameters/
#
Expand All @@ -145,7 +138,7 @@ options 8821au rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=1 rtw_power_mgn
# Note: The best settings can vary but the following may be a good place to start.
#
# /etc/modprobe.d/8821au.conf
# options 8821au rtw_drv_log_level=0 rtw_led_ctrl=0 rtw_vht_enable=2 rtw_power_mgnt=1 rtw_beamform_cap=0 rtw_dfs_region_domain=1
# options 8821au rtw_drv_log_level=0 rtw_led_ctrl=0 rtw_vht_enable=2 rtw_power_mgnt=1 rtw_dfs_region_domain=1
#
# Note: The best setting for `rtw_dfs_region_domain=` will depend on your location.
#
Expand Down
180 changes: 50 additions & 130 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,91 +6,59 @@ Question: The driver installation script completed successfully and the
driver is installed but does not seem to be working. What is wrong?

Answer: This question often comes up after installing the driver to a
system that has Secure Boot on. To test if there is a Secure Boot related
problem, turn secure boot off in the system BIOS and reboot. If the driver
works as expected after reboot, then the problem is likely related to
Secure Boot.
system that has Secure Boot on. To test if there is a Secure Boot
related problem, turn secure boot off in the system BIOS and reboot. If
the driver works as expected after reboot, then the problem is likely
related to Secure Boot.

What will increase my chances of having a sucessessful installation on a
system that has Secure Boot on?

First and foremost, make sure Secure Boot is on when you initially install
your Linux distro. If your Linux distro was installed with Secure Boot off,
the easiest solution is likely to do a clean reinstallation with Secure Boot
on.
First and foremost, make sure Secure Boot is on when you initially
install your Linux distro. If your Linux distro was installed with
Secure Boot off, the easiest solution is likely to do a clean
reinstallation with Secure Boot on.

Ubuntu is used as the example but other distros should be similar to one
degree or another. During the installation there may be a box on one of
installation pages that will appear if the installation program detects
that Secure Boot is on. You will need to check the appropriate box and
supply a password. You can use the same password that you use for the system
if you wish. After the installation and reboot completes, the first screen
you should see is the mokutil screen. Mokutil will guide you through the
process of setting up your system to support Secure Boot. If you are unsure
what to do, I recommend you seek guidance from your distro documentation or
user forums. Having Secure Boot properly set up in your installation is very
important.
supply a password. You can use the same password that you use for the
system if you wish. After the installation and reboot completes, the
first screen you should see is the mokutil screen. Mokutil will guide
you through the process of setting up your system to support Secure
Boot. If you are unsure what to do, I recommend you seek guidance from
your distro documentation or user forums. Having Secure Boot properly
set up in your installation is very important.

The `install-driver.sh` script currently supports Secure Boot if `dkms`
is installed. Here is a link to the `dkms` website. There is information
regarding Secure Boot in two sections in the `README`.
is installed. Here is a link to the `dkms` website.

https://github.com/dell/dkms

Here is a link regarding Debian and Secure Boot:

https://wiki.debian.org/SecureBoot

There is work underway to add Secure Boot support for systems that do not
have `dkms` available or if a manual installation is desired.

If you are using a basic command line (non-dkms) installation, see the
following section in the Installation Steps part of the README:

If you use the `install-driver.sh` script and see the following message

`SecureBoot enabled - read FAQ about SecureBoot`

You need to read the following:

The MOK managerment screen will appear during boot:

`Shim UEFI Key Management"

`Press any key...`

Select "Enroll key"

Select "Continue"

Select "Yes"

When promted, enter the password you entered earlier.

If you enter the wrong password, your computer will not be bootable. In
this case, use the BOOT menu from your BIOS to boot then as follows:

```
sudo mokutil --reset
```

Restart your computer and use the BOOT menu from BIOS to boot. In the MOK
managerment screen, select `reset MOK list`. Then Reboot and retry the
driver installation.
following section in the README:

Manual Installation Instructions

It provides secure boot instructions.
It provides secure boot instructions for a manual installation.

-----

Question: Is WPA3 supported?

Answer: WPA3-SAE is supported. It works well on most modern Linux distros
but not all. Generally the reason for WPA3 not working on Linux distros is
that the distro has an old version of wpa_supplicant or Network Manager.
Your options are to upgrade to a more modern distro such as those released
after mid-2022 or compile and install new versions of wpa_supplicant and/or
Answer: WPA3-SAE is supported. It works well on most modern Linux
distros. Generally the reason for WPA3 not working on Linux distros is
that the distro has old versions of components required for WPA3
support. This includes, but is not limited to, utilities such as
wpa_supplicant or Network Manager. Your options are to upgrade to a more
modern distro such as those released after mid-2022 or determine what
the problem is and figure out how to fix it. Fixes could include
compiling and installing new versions of wpa_supplicant and/or
Network Manager.

-----
Expand All @@ -103,22 +71,21 @@ 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.

Recommendation: If this is an important capability for you, I have tested
Mediatek adapters for this capability and it does work with adapters that
use the following chipsets: mt7921au, mt7612u and mt7610u.

-----

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 USB
WiFi solutions based on Mediatek chipsets. Mediatek is making and
supporting their drivers per Linux Wireless Standards guidance per the
Linux Foundation. This results in far fewer compatibility and support
problems. More information and recommended adapters shown at the
Answer: When Realtek makes the decision to move to exclusively using a
modern standards compliant Linux driver model, I will consider changing
this recommendation but until that happens I will continue to recommend
Linux users buy new adapters that use Mediatek chipsets. However...

Many new and existing Linux users already have adapters based on Realtek
chipsets so this repo will be supported as long as it is needed and I am
able to maintain it.

Note: More information about recommended adapters shown at the
following site:

https://github.com/morrownr/USB-WiFi
Expand All @@ -127,72 +94,21 @@ https://github.com/morrownr/USB-WiFi

Question: Will you put volunteers to work?

Answer: Yes. Post a message in `Issues` or `Discussions` if interested.

-----

Question: I am having problems with my adapter and I use Virtualbox?

Answer: This [article](https://null-byte.wonderhowto.com/forum/wifi-hacking-attach-usb-wireless-adapter-with-virtual-box-0324433/) may help.

-----

Question: Can you provide additional information about monitor mode?

Answer: I have a repo that is setup to help with monitor mode:

https://github.com/morrownr/Monitor_Mode

Work to improve monitor mode is ongoing with this driver. Your reports of
success or failure are needed. If you have yet to buy an adapter to use with
monitor mode, there are adapters available that are known to work very well
with monitor mode. My recommendation for those looking to buy an adapter for
monitor mode is to buy adapters based on the following chipsets: mt7921au,
mt7612u, mt7610u, rtl8821cu, and rtl8812bu. My specific recommendations for
adapters in order of preference currently are:

ALFA AWUS036ACHM - long range - in-kernel driver

ALFA AWUS036ACM - in-kernel driver

ALFA AWUS036ACU - in-kernel driver (as of kernel 6.2) and [out-of-kernel driver](https://github.com/morrownr/8821cu)

To ask questions, go to [USB-WiFi](https://github.com/morrownr/USB-WiFi)
and post in `Discussions` or `Issues`.
Answer: Yes. Post a message in `Issues` if interested.

-----

Question: How do I forget a saved WiFi network on a Raspberry Pi?

Note: This answer is for the Raspberry Pi OS without Network Manager active.

Step 1: Edit `wpa_supplicant.conf`

```
sudo ${EDITOR} /etc/wpa_supplicant/wpa_supplicant.conf
```
Question: I am having problems with my adapter and I use Virtualbox or
another VM?

Note: Replace ${EDITOR} with the name of the text editor you wish to use.
Answer: Running under VMs is not supported. It can work but you are
your own techical support. There are guides available on the internet
and it is recommended that you seek support with the provider of the VM.

#### Step 2: Delete the relevant WiFi network block (including the '`network=`' and opening/closing braces).

#### Step 3: Save the file.

#### Step 4: Reboot

-----

Question: How do I disable the onboard WiFi in a Raspberry Pi?

Note: This answer is for the Raspberry Pi OS.

Answer:

Add the following line to `/boot/config.txt`

```
dtoverlay=disable-wifi
```
Note: There are alternatives to using VM's. For example: Almost all
Linux distros support installing in a Dualboot or Multiboot
configuration. This will eliminate the many problems associated with
using USB WiFi adapters in a VM.

-----

Expand All @@ -219,6 +135,10 @@ Reference:

https://forums.raspberrypi.com/viewtopic.php?p=2091532&hilit=Tp+link#p2091532

Note: If your RasPi is capable of using a 64 bit version of the RasPiOS,
it is recommended that you use a 64 bit version of the RasPiOS as this
will eliminate this problem.

Note to RasPiOS devs: We really really wish you would consider the
consequences of the changes you make. Thank you.

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2023 Realtek Corporation.
* Copyright(c) 2007 - 2024 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ EXTRA_CFLAGS += -Wno-unused-variable
EXTRA_CFLAGS += -Wno-implicit-fallthrough
#EXTRA_CFLAGS += -Wno-return-type
#EXTRA_CFLAGS += -Wno-discarded-qualifiers
EXTRA_CFLAGS += -Wno-missing-prototypes
EXTRA_CFLAGS += -Wno-missing-declarations

# Activates Concurrent Mode if uncommented
#EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
Expand All @@ -33,12 +31,15 @@ EXTRA_CFLAGS += -DCONFIG_LED_ENABLE
# gcc-12
EXTRA_CFLAGS += -Wno-address
EXTRA_CFLAGS += -Wframe-larger-than=1648
EXTRA_CFLAGS += -Wno-cast-function-type

# gcc-13
#EXTRA_CFLAGS += -Wno-enum-int-mismatch
#EXTRA_CFLAGS += -Wno-stringop-overread
EXTRA_CFLAGS += -Wno-enum-conversion
EXTRA_CFLAGS += -Wno-int-in-bool-context
EXTRA_CFLAGS += -Wno-missing-prototypes
EXTRA_CFLAGS += -Wno-missing-declarations

GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )
ifeq ($(GCC_VER_49),1)
Expand Down Expand Up @@ -127,7 +128,7 @@ endif
CONFIG_RTW_DEBUG = y
# default log level is _DRV_INFO_ = 4,
# please refer to "How_to_set_driver_debug_log_level.doc" to set the available level.
CONFIG_RTW_LOG_LEVEL = 1
CONFIG_RTW_LOG_LEVEL = 0

# enable /proc/net/rtlxxxx/ debug interfaces
CONFIG_PROC_DEBUG = n
Expand Down
Loading

0 comments on commit 32092ed

Please sign in to comment.