1
0
mirror of https://github.com/morrownr/8821cu-20210916.git synced 2024-12-22 14:26:30 +00:00

various script and documentation updates

This commit is contained in:
morrownr 2023-02-27 10:50:37 -06:00
parent 5e901d1615
commit e75a84e4c0
5 changed files with 124 additions and 111 deletions

114
FAQ.md
View File

@ -1,54 +1,5 @@
### FAQ ### FAQ
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 (distros released after
mid 2022) or compile and install new versions of wpa_supplicant and/or
Network Manager.
-----
Question: I bought two usb wifi adapters based on this chipset and am
planning to use both in the same computer. How do I set that up?
Answer: 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: 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
following site:
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.
-----
Secure Boot Information Secure Boot Information
Question: The driver installation script completed successfully and the Question: The driver installation script completed successfully and the
@ -90,11 +41,64 @@ Here is a link regarding Debian and Secure Boot:
https://wiki.debian.org/SecureBoot https://wiki.debian.org/SecureBoot
There is work underway to add Secure Boot suuport for systems that do not There is work underway to add Secure Boot suport for systems that do not
have `dkms` available or if a manual installation is desired. have `dkms` available or if a manual installation is desired.
----- -----
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
Network Manager.
-----
Question: I bought two usb wifi adapters based on this chipset and am
planning to use both in the same computer. How do I set that up?
Answer: 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.
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
following site:
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? Question: Can you provide additional information about monitor mode?
Answer: I have a repo that is setup to help with monitor mode: Answer: I have a repo that is setup to help with monitor mode:
@ -140,7 +144,6 @@ Note: Replace ${EDITOR} with the name of the text editor you wish to use.
----- -----
Question: How do I disable the onboard WiFi in a Raspberry Pi? Question: How do I disable the onboard WiFi in a Raspberry Pi?
Note: This answer is for the Raspberry Pi OS. Note: This answer is for the Raspberry Pi OS.
@ -153,16 +156,15 @@ Add the following line to `/boot/config.txt`
dtoverlay=disable-wifi dtoverlay=disable-wifi
``` ```
----- -----
Question: I have an adapter with the 8821cu chipset and it supports Question: I have an adapter with the 8821cu chipset and it supports
bluetooth. The bluetooth works but the wifi does not. What is wrong? bluetooth. The bluetooth works but the wifi does not. What is wrong?
Answer: There appears to be an issue where adapters can be set up Answer: There appears to be an issue that is caused by makers setting up
differently by makers. The fix is to set the driver option adapters differently. The fix is to set the driver option ( `rtw_RFE_type` )
( `rtw_RFE_type` ) in 8821cu.conf. The easiest way to edit 8821cu.conf is in 8821cu.conf. The easiest way to edit 8821cu.conf is to run the following
to run the following from the driver directory: from the driver directory:
``` ```
sudo ./edit-options.sh sudo ./edit-options.sh

View File

@ -12240,7 +12240,7 @@ static void rtw_mlmeext_disconnect(_adapter *padapter)
self_action = MLME_STA_DISCONNECTED; self_action = MLME_STA_DISCONNECTED;
else if (MLME_IS_ADHOC(padapter) || MLME_IS_ADHOC_MASTER(padapter)) else if (MLME_IS_ADHOC(padapter) || MLME_IS_ADHOC_MASTER(padapter))
self_action = MLME_ADHOC_STOPPED; self_action = MLME_ADHOC_STOPPED;
/* nrm */ // nrm
#ifdef CONFIG_WIFI_MONITOR #ifdef CONFIG_WIFI_MONITOR
else if (MLME_IS_MONITOR(padapter)) else if (MLME_IS_MONITOR(padapter))
self_action = MLME_ACTION_NONE; self_action = MLME_ACTION_NONE;
@ -16164,7 +16164,7 @@ u8 rtw_set_chbw_hdl(_adapter *padapter, u8 *pbuf)
} }
LeaveAllPowerSaveModeDirect(padapter); LeaveAllPowerSaveModeDirect(padapter);
// nrm
#ifdef CONFIG_MONITOR_MODE_XMIT #ifdef CONFIG_MONITOR_MODE_XMIT
pmlmeext->cur_channel = set_ch_parm->ch; pmlmeext->cur_channel = set_ch_parm->ch;
pmlmeext->cur_ch_offset = set_ch_parm->ch_offset; pmlmeext->cur_ch_offset = set_ch_parm->ch_offset;

View File

@ -1,12 +1,11 @@
2023-01-26 2023-02-26
Note: This document is under coonstruction. Purpose: Provide instructions for setting the ISO 3166-1 alpha-2 Country Code.
Instructions for setting the ISO 3166-1 alpha-2 Country Code in your Linux
distro.
Note: Package "iw" must be installed. Note: Package "iw" must be installed.
To set the country code:
``` ```
sudo iw reg set XX sudo iw reg set XX
``` ```
@ -49,11 +48,13 @@ AR Argentina
AM Armenia AM Armenia
Aruba AW AW Aruba
Australia AU AU Australia
Austria AT AT Austria
>> under construction <<
Azerbaijan AZ Azerbaijan AZ
@ -552,40 +553,33 @@ Turkey TR
TM Turkmenistan TM Turkmenistan
Turks and TC Turks and Caicos Islands
Caicos
Islands TC
Tuvalu TV TV Tuvalu
Uganda UG UG Uganda
Ukraine UA UA Ukraine
United Arab AE United Arab Emirates
Emirates AE
GB United Kingdom GB United Kingdom
US United States US United States
United States UM United States Minor Outlying Islands
Minor
Outlying
Islands UM
Uruguay UY UY Uruguay
Uzbekistan UZ UZ Uzbekistan
Vanuatu VU VU Vanuatu
Venezuela VE VE Venezuela
Viet Nam VN VN Viet Nam
Virgin Islands, VG Virgin Islands, British
British VG
VI Virgin Islands, U.S. VI Virgin Islands, U.S.

View File

@ -28,7 +28,7 @@
# GNU General Public License for more details. # GNU General Public License for more details.
SCRIPT_NAME="install-driver.sh" SCRIPT_NAME="install-driver.sh"
SCRIPT_VERSION="20230221" SCRIPT_VERSION="20230227"
MODULE_NAME="8821cu" MODULE_NAME="8821cu"
DRV_VERSION="5.12.0.4" DRV_VERSION="5.12.0.4"
@ -170,31 +170,30 @@ if command -v dkms >/dev/null 2>&1; then
echo ": ""${dkms_ver}" echo ": ""${dkms_ver}"
fi fi
# display secure mode status if mokutil is installed # display secure mode status if SecureBoot is enabled and if mokutil is installed
if command -v mokutil >/dev/null 2>&1; then if command -v mokutil >/dev/null 2>&1; then
sb_state=$(mokutil --sb-state) if mokutil --sb-state | grep -i enabled >/dev/null 2>&1; then
echo ": ""${sb_state}" echo ": SecureBoot enabled - read FAQ about SecureBoot"
fi
fi fi
# needs work # check ISO 3166-1 alpha-2 Country Code is not 00
# display ISO 3166-1 alpha-2 Country Code #if iw reg get | grep -i 00 >/dev/null 2>&1; then
#a2_country_code=$(iw reg get | grep -i country) # echo ": The Country Code may not be properly set."
#echo ": Location: ""${a2_country_code}" # echo ": File 'alpha-2_Country_Codes' is located in the docs directory."
#if [[ $a2_country_code == *"00"* ]]; # echo ": Please read and follow the directions in the file after installation."
#then
# echo "The Country Code may not be properly set."
# echo "File alpha-2_Country_Codes is located in the driver directory."
# echo "Please read and follow the directions in the file after installation."
#fi #fi
echo ": ---------------------------" echo ": ---------------------------"
echo echo
echo "Checking for previously installed drivers."
echo "Checking for previously installed drivers."
# check for and remove non-dkms installations # check for and remove non-dkms installations
# standard naming # standard naming
if [ -f "${MODDESTDIR}${MODULE_NAME}.ko" ]; then if [ -f "${MODDESTDIR}${MODULE_NAME}.ko" ]; then
echo ": ---------------------------"
echo
echo "Removing a non-dkms installation: ${MODDESTDIR}${MODULE_NAME}.ko" echo "Removing a non-dkms installation: ${MODDESTDIR}${MODULE_NAME}.ko"
rm -f "${MODDESTDIR}"${MODULE_NAME}.ko rm -f "${MODDESTDIR}"${MODULE_NAME}.ko
/sbin/depmod -a "${KVER}" /sbin/depmod -a "${KVER}"
@ -204,12 +203,13 @@ if [ -f "${MODDESTDIR}${MODULE_NAME}.ko" ]; then
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION} rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
make clean >/dev/null 2>&1 make clean >/dev/null 2>&1
echo "Removal complete." echo "Removal complete."
echo ": ---------------------------"
fi fi
# check for and remove non-dkms installations # check for and remove non-dkms installations
# with rtl added to module name (PClinuxOS) # with rtl added to module name (PClinuxOS)
if [ -f "${MODDESTDIR}rtl${MODULE_NAME}.ko" ]; then if [ -f "${MODDESTDIR}rtl${MODULE_NAME}.ko" ]; then
echo ": ---------------------------"
echo
echo "Removing a non-dkms installation: ${MODDESTDIR}rtl${MODULE_NAME}.ko" echo "Removing a non-dkms installation: ${MODDESTDIR}rtl${MODULE_NAME}.ko"
rm -f "${MODDESTDIR}"rtl${MODULE_NAME}.ko rm -f "${MODDESTDIR}"rtl${MODULE_NAME}.ko
/sbin/depmod -a "${KVER}" /sbin/depmod -a "${KVER}"
@ -219,7 +219,6 @@ if [ -f "${MODDESTDIR}rtl${MODULE_NAME}.ko" ]; then
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION} rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
make clean >/dev/null 2>&1 make clean >/dev/null 2>&1
echo "Removal complete." echo "Removal complete."
echo ": ---------------------------"
fi fi
# check for and remove non-dkms installations # check for and remove non-dkms installations
@ -227,6 +226,8 @@ fi
# Example: /usr/lib/modules/5.15.80-rockchip64/kernel/drivers/net/wireless/rtl8821cu/8821cu.ko.xz # Example: /usr/lib/modules/5.15.80-rockchip64/kernel/drivers/net/wireless/rtl8821cu/8821cu.ko.xz
# Dear Armbiam, this is a really bad idea. # Dear Armbiam, this is a really bad idea.
if [ -f "/usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz" ]; then if [ -f "/usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz" ]; then
echo ": ---------------------------"
echo
echo "Removing a non-dkms installation: /usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz" echo "Removing a non-dkms installation: /usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz"
rm -f /usr/lib/modules/"${KVER}"/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz rm -f /usr/lib/modules/"${KVER}"/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz
/sbin/depmod -a "${KVER}" /sbin/depmod -a "${KVER}"
@ -236,30 +237,31 @@ if [ -f "/usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODU
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION} rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
make clean >/dev/null 2>&1 make clean >/dev/null 2>&1
echo "Removal complete." echo "Removal complete."
echo ": ---------------------------"
fi fi
# check for and remove dkms installations # check for and remove dkms installations
if command -v dkms >/dev/null 2>&1; then if command -v dkms >/dev/null 2>&1; then
if dkms status | grep -i ${DRV_NAME}; then if dkms status | grep -i ${DRV_NAME}; then
echo "Removing a dkms installation: ${DRV_NAME}" echo ": ---------------------------"
echo
echo "Removing a dkms installation."
dkms remove -m ${DRV_NAME} -v ${DRV_VERSION} --all dkms remove -m ${DRV_NAME} -v ${DRV_VERSION} --all
echo "Removing ${OPTIONS_FILE} from /etc/modprobe.d" echo "Removing ${OPTIONS_FILE} from /etc/modprobe.d"
rm -f /etc/modprobe.d/${OPTIONS_FILE} rm -f /etc/modprobe.d/${OPTIONS_FILE}
echo "Removing source files from /usr/src/${DRV_NAME}-${DRV_VERSION}" echo "Removing source files from /usr/src/${DRV_NAME}-${DRV_VERSION}"
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION} rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
echo "Removal complete." echo "Removal complete."
echo ": ---------------------------"
fi fi
fi fi
# sets module parameters (driver options) and blacklisted modules # sets module parameters (driver options) and blacklisted modules
echo ": ---------------------------"
echo echo
echo "Starting installation." echo "Starting installation."
echo "Installing ${OPTIONS_FILE} to /etc/modprobe.d" echo "Installing ${OPTIONS_FILE} to /etc/modprobe.d"
cp -f ${OPTIONS_FILE} /etc/modprobe.d cp -f ${OPTIONS_FILE} /etc/modprobe.d
# determine if dkms is installed and run the appropriate routines # determine if dkms is installed and run the appropriate installation routines
if ! command -v dkms >/dev/null 2>&1; then if ! command -v dkms >/dev/null 2>&1; then
echo "The non-dkms installation routines are in use." echo "The non-dkms installation routines are in use."
@ -287,6 +289,8 @@ if ! command -v dkms >/dev/null 2>&1; then
if [ "$RESULT" = "0" ]; then if [ "$RESULT" = "0" ]; then
make clean >/dev/null 2>&1 make clean >/dev/null 2>&1
echo "The driver was installed successfully." echo "The driver was installed successfully."
echo ": ---------------------------"
echo
else else
echo "An error occurred: ${RESULT}" echo "An error occurred: ${RESULT}"
echo "Please report this error." echo "Please report this error."
@ -358,9 +362,20 @@ else
else else
echo "The driver was installed by dkms successfully." echo "The driver was installed by dkms successfully."
echo ": ---------------------------" echo ": ---------------------------"
echo
fi fi
fi fi
# provide driver upgrade information
echo "Info: Upgrade this driver with the following commands as needed:"
echo "$ git pull"
echo "$ sudo sh install-driver.sh"
echo "Note: Upgrades should be performed before distro upgrades."
echo "Note: Upgrades can be performed as often as you like."
echo "Note: Work on this driver is continuous."
echo ": ---------------------------"
echo
# unblock wifi # unblock wifi
if command -v rfkill >/dev/null 2>&1; then if command -v rfkill >/dev/null 2>&1; then
rfkill unblock wlan rfkill unblock wlan
@ -370,14 +385,13 @@ fi
# if NoPrompt is not used, ask user some questions # if NoPrompt is not used, ask user some questions
if [ $NO_PROMPT -ne 1 ]; then if [ $NO_PROMPT -ne 1 ]; then
echo printf "Do you want to edit the driver options file now? (y is recommended) [y/N] "
printf "Do you want to edit the driver options file now? [y/N] "
read -r REPLY read -r REPLY
case "$REPLY" in case "$REPLY" in
[yY]*) ${TEXT_EDITOR} /etc/modprobe.d/${OPTIONS_FILE} ;; [yY]*) ${TEXT_EDITOR} /etc/modprobe.d/${OPTIONS_FILE} ;;
esac esac
printf "Do you want to apply the new options by rebooting now? (recommended) [y/N] " printf "Do you want to apply the new options by rebooting now? ( y is recommended) [y/N] "
read -r REPLY read -r REPLY
case "$REPLY" in case "$REPLY" in
[yY]*) reboot ;; [yY]*) reboot ;;

View File

@ -28,7 +28,7 @@
# GNU General Public License for more details. # GNU General Public License for more details.
SCRIPT_NAME="remove-driver.sh" SCRIPT_NAME="remove-driver.sh"
SCRIPT_VERSION="20230126" SCRIPT_VERSION="20230226"
MODULE_NAME="8821cu" MODULE_NAME="8821cu"
DRV_VERSION="5.12.0.4" DRV_VERSION="5.12.0.4"
@ -77,6 +77,7 @@ echo ": ${KARCH} (architecture)"
echo ": ${KVER} (kernel version)" echo ": ${KVER} (kernel version)"
echo ": ---------------------------" echo ": ---------------------------"
echo
# check for and remove non-dkms installations # check for and remove non-dkms installations
# standard naming # standard naming
@ -133,6 +134,8 @@ rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
make clean >/dev/null 2>&1 make clean >/dev/null 2>&1
echo "The driver was removed successfully." echo "The driver was removed successfully."
echo "You may now delete the driver directory if desired." echo "You may now delete the driver directory if desired."
echo ": ---------------------------"
echo
# if NoPrompt is not used, ask user some questions # if NoPrompt is not used, ask user some questions
if [ $NO_PROMPT -ne 1 ]; then if [ $NO_PROMPT -ne 1 ]; then