1
0
mirror of https://github.com/morrownr/8821cu-20210916.git synced 2024-12-21 22:06:32 +00:00

minor updates

This commit is contained in:
morrownr 2023-01-07 23:16:17 -06:00
parent 6203514ec2
commit 4f4073d8d2
6 changed files with 91 additions and 52 deletions

View File

@ -18,7 +18,7 @@ options 8821cu rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=1 rtw_power_mgn
# After editing is complete, save this file (if using nano: Ctrl + x, y, Enter)
# and reboot to activate the changes.
#
# Warning: Some adapters based on the rtl8821cu chipset may require the
# Important: Some adapters based on the rtl8821cu chipset may require the
# `rtw_RFE_type` option to be set. If wifi or bluetooth does not work
# after driver installation, see the appropriate section in the below
# documentation. This issue has not been seen on wifi only adapters.
@ -117,6 +117,22 @@ options 8821cu 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)
#
# -----
#
# Select RFE type ( rtw_RFE_type )
#
# 0 = (2-Ant, DPDT), (2G_WLG, iPA, iLNA, iSW), (5G, iPA, iLNA, iSW)

View File

@ -1,5 +1,6 @@
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
EXTRA_CFLAGS += -O1
# --param ggc-min-expand=10
#EXTRA_CFLAGS += -O3
#EXTRA_CFLAGS += -Wall
#EXTRA_CFLAGS += -Wextra
@ -119,7 +120,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 = 0
CONFIG_RTW_LOG_LEVEL = 1
# enable /proc/net/rtlxxxx/ debug interfaces
CONFIG_PROC_DEBUG = y
@ -133,7 +134,7 @@ CONFIG_WOW_LPS_MODE = default
CONFIG_SUSPEND_TYPE = 0
CONFIG_WOW_STA_MIX = n
CONFIG_GPIO_WAKEUP = n
# Please contact with RTK support team first. After getting the agreement from RTK support team,
# Please contact with RTK support team first. After getting the agreement from RTK support team,
# you are just able to modify the CONFIG_WAKEUP_GPIO_IDX with customized requirement.
CONFIG_WAKEUP_GPIO_IDX = default
CONFIG_HIGH_ACTIVE_DEV2HST = n

View File

@ -44,7 +44,7 @@ confirm that this is the correct driver for your adapter.
### A FAQ is available at the end of this document.
### Additional documentation is the file `8821cu.conf`.
### Additional documentation is in the file `8821cu.conf`.
### Compatible CPU Architectures
@ -174,7 +174,7 @@ $ sudo ./install-driver.sh
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.
Another method is to keep a [WiFi adapter that uses an in-kernel driver](https://github.com/morrownr/USB-WiFi/blob/main/home/USB_WiFi_Adapters_that_are_supported_with_Linux_in-kernel_drivers.md) 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).
@ -189,7 +189,7 @@ 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 if available. DKMS is a system utility
DKMS is used for the installation, if available. 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.

View File

@ -291,7 +291,8 @@ void rtw_acs_info_dump(void *sel, _adapter *adapter)
_RTW_PRINT_SEL(sel, "========== ACS (VER-%d) ==========\n", RTK_ACS_VERSION);
_RTW_PRINT_SEL(sel, "Best 24G Channel:%d\n", hal_data->acs.best_chan_24g);
_RTW_PRINT_SEL(sel, "Best 5G Channel:%d\n\n", hal_data->acs.best_chan_5g);
_RTW_PRINT_SEL(sel, "Best 5G Channel:%d\n", hal_data->acs.best_chan_5g);
_RTW_PRINT_SEL(sel, "==================================\n");
#ifdef CONFIG_RTW_ACS_DBG
_RTW_PRINT_SEL(sel, "Advanced setting - scan_type:%c, ch_ms:%d(ms), igi:0x%02x, bw:%d\n",

View File

@ -4,7 +4,7 @@
#
# Supports dkms and non-dkms installations.
# Copyright(c) 2022 Nick Morrow
# Copyright(c) 2023 Nick Morrow
#
# 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
@ -16,7 +16,7 @@
# GNU General Public License for more details.
SCRIPT_NAME="install-driver.sh"
SCRIPT_VERSION="20230101"
SCRIPT_VERSION="20230107"
MODULE_NAME="8821cu"
DRV_VERSION="5.12.0.4"
@ -117,47 +117,6 @@ done
# displays script name and version
echo "Script: ${SCRIPT_NAME} v${SCRIPT_VERSION}"
# check for and remove non-dkms installations
# standard naming
if [[ -f "${MODDESTDIR}${MODULE_NAME}.ko" ]]
then
echo "Removing a non-dkms installation: ${MODDESTDIR}${MODULE_NAME}.ko"
rm -f ${MODDESTDIR}${MODULE_NAME}.ko
/sbin/depmod -a ${KVER}
fi
# check for and remove non-dkms installations
# with rtl added to module name (PClinuxOS)
if [[ -f "${MODDESTDIR}rtl${MODULE_NAME}.ko" ]]
then
echo "Removing a non-dkms installation: ${MODDESTDIR}rtl${MODULE_NAME}.ko"
rm -f ${MODDESTDIR}rtl${MODULE_NAME}.ko
/sbin/depmod -a ${KVER}
fi
# check for and remove non-dkms installations
# with compressed module in a unique non-standard location (Armbian)
# Example: /usr/lib/modules/5.15.80-rockchip64/kernel/drivers/net/wireless/rtl8821cu/8821cu.ko.xz
# 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
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
/sbin/depmod -a ${KVER}
fi
# check for existing dkms installations of any version of this driver
if command -v dkms >/dev/null 2>&1
then
if dkms status | grep -i ${DRV_NAME}; then
echo "The above driver needs to be removed before the installation can be successfull."
echo "Example: $ sudo dkms remove ${DRV_NAME}/X.X.X.X --all"
echo "Please replace X.X.X.X by the driver version number shown above."
echo "Once the driver is removed, please run \"sudo ./${SCRIPT_NAME}\""
exit 1
fi
fi
# information that helps with bug reports
# display kernel version
@ -166,6 +125,9 @@ echo "Kernel: ${KVER}"
# display architecture
echo "Arch : ${KARCH}"
# display total memory in system
grep MemTotal /proc/meminfo
# display gcc version
gcc_ver=$(gcc --version | grep -i gcc)
echo "gcc : "${gcc_ver}
@ -187,6 +149,64 @@ then
mokutil --sb-state
fi
# check for and remove non-dkms installations
# standard naming
if [[ -f "${MODDESTDIR}${MODULE_NAME}.ko" ]]
then
echo "Removing a non-dkms installation: ${MODDESTDIR}${MODULE_NAME}.ko"
rm -f ${MODDESTDIR}${MODULE_NAME}.ko
/sbin/depmod -a ${KVER}
echo "Removing ${OPTIONS_FILE} from /etc/modprobe.d"
rm -f /etc/modprobe.d/${OPTIONS_FILE}
echo "Removing source files from /usr/src/${DRV_NAME}-${DRV_VERSION}"
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
make clean >/dev/null 2>&1
fi
# check for and remove non-dkms installations
# with rtl added to module name (PClinuxOS)
if [[ -f "${MODDESTDIR}rtl${MODULE_NAME}.ko" ]]
then
echo "Removing a non-dkms installation: ${MODDESTDIR}rtl${MODULE_NAME}.ko"
rm -f ${MODDESTDIR}rtl${MODULE_NAME}.ko
/sbin/depmod -a ${KVER}
echo "Removing ${OPTIONS_FILE} from /etc/modprobe.d"
rm -f /etc/modprobe.d/${OPTIONS_FILE}
echo "Removing source files from /usr/src/${DRV_NAME}-${DRV_VERSION}"
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
make clean >/dev/null 2>&1
fi
# check for and remove non-dkms installations
# with compressed module in a unique non-standard location (Armbian)
# Example: /usr/lib/modules/5.15.80-rockchip64/kernel/drivers/net/wireless/rtl8821cu/8821cu.ko.xz
# 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
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
/sbin/depmod -a ${KVER}
echo "Removing ${OPTIONS_FILE} from /etc/modprobe.d"
rm -f /etc/modprobe.d/${OPTIONS_FILE}
echo "Removing source files from /usr/src/${DRV_NAME}-${DRV_VERSION}"
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
make clean >/dev/null 2>&1
fi
# check for and remove dkms installations
if command -v dkms >/dev/null 2>&1
then
if dkms status | grep -i ${DRV_NAME}
then
echo "Removing a dkms installation: ${DRV_NAME}"
dkms remove -m ${DRV_NAME} -v ${DRV_VERSION} --all
echo "Removing ${OPTIONS_FILE} from /etc/modprobe.d"
rm -f /etc/modprobe.d/${OPTIONS_FILE}
echo "Removing source files from /usr/src/${DRV_NAME}-${DRV_VERSION}"
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
fi
fi
# sets module parameters (driver options) and blacklisted modules
echo "Installing ${OPTIONS_FILE} to /etc/modprobe.d"
cp -f ${OPTIONS_FILE} /etc/modprobe.d
@ -231,6 +251,7 @@ then
exit $RESULT
fi
else
dkms --version
echo "The dkms installation routines are in use."
# the dkms add command requires source in /usr/src/${DRV_NAME}-${DRV_VERSION}

View File

@ -4,7 +4,7 @@
#
# Supports dkms and non-dkms removals.
# Copyright(c) 2022 Nick Morrow
# Copyright(c) 2023 Nick Morrow
#
# 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
@ -16,7 +16,7 @@
# GNU General Public License for more details.
SCRIPT_NAME="remove-driver.sh"
SCRIPT_VERSION="20230101"
SCRIPT_VERSION="20230107"
MODULE_NAME="8821cu"
DRV_VERSION="5.12.0.4"