update docs and clean code

This commit is contained in:
morrownr 2023-02-24 14:14:49 -06:00
parent 2885e9c222
commit 51a2fb9489
15 changed files with 284 additions and 269 deletions

182
FAQ.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -11,13 +11,14 @@ EXTRA_CFLAGS += -Wno-unused-variable
#EXTRA_CFLAGS += -Wno-unused-value
#EXTRA_CFLAGS += -Wno-unused-label
#EXTRA_CFLAGS += -Wno-unused-parameter
EXTRA_CFLAGS += -Wno-unused-function
#EXTRA_CFLAGS += -Wno-unused-function
#EXTRA_CFLAGS += -Wno-unused
#EXTRA_CFLAGS += -Wno-uninitialized
#EXTRA_CFLAGS += -Wno-vla
EXTRA_CFLAGS += -Wno-misleading-indentation
EXTRA_CFLAGS += -Wno-implicit-fallthrough
#EXTRA_CFLAGS += -Wno-return-type
#EXTRA_CFLAGS += -Wno-discarded-qualifiers
# Activates Concurrent Mode if uncommented
#EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
@ -94,11 +95,10 @@ CONFIG_RTW_CHPLAN = 0xFF
CONFIG_RTW_ADAPTIVITY_EN = disable
CONFIG_RTW_ADAPTIVITY_MODE = normal
CONFIG_SIGNAL_SCALE_MAPPING = n
# necessary for WPA3 support
CONFIG_80211W = y
CONFIG_REDUCE_TX_CPU_LOADING = n
CONFIG_BR_EXT = y
CONFIG_TDLS = y
CONFIG_TDLS = n
CONFIG_WIFI_MONITOR = y
CONFIG_MCC_MODE = n
CONFIG_APPEND_VENDOR_IE_ENABLE = n
@ -127,7 +127,7 @@ CONFIG_RTW_DEBUG = y
CONFIG_RTW_LOG_LEVEL = 1
# enable /proc/net/rtlxxxx/ debug interfaces
CONFIG_PROC_DEBUG = y
CONFIG_PROC_DEBUG = n
######################## Wake On Lan ##########################
CONFIG_WOWLAN = n
@ -2516,6 +2516,13 @@ uninstall:
rm -f $(MODDESTDIR)$(MODULE_NAME).ko
/sbin/depmod -a ${KVER}
sign:
@openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Custom MOK/"
@mokutil --import MOK.der
@$(KSRC)/scripts/sign-file sha256 MOK.priv MOK.der 8821cu.ko
sign-install: all sign install
backup_rtlwifi:
@echo "Making backup rtlwifi drivers"
ifneq (,$(wildcard $(STAGINGMODDIR)/rtl*))

286
README.md

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ const char *rtw_log_level_str[] = {
void dump_drv_version(void *sel)
{
RTW_PRINT_SEL(sel, "%s %s\n", DRV_NAME, DRIVERVERSION);
// RTW_PRINT_SEL(sel, "build time: %s %s\n", __DATE__, __TIME__);
// nrm RTW_PRINT_SEL(sel, "build time: %s %s\n", __DATE__, __TIME__);
}
#ifdef CONFIG_PROC_DEBUG

View File

@ -12246,7 +12246,7 @@ static void rtw_mlmeext_disconnect(_adapter *padapter)
self_action = MLME_STA_DISCONNECTED;
else if (MLME_IS_ADHOC(padapter) || MLME_IS_ADHOC_MASTER(padapter))
self_action = MLME_ADHOC_STOPPED;
/* nrm */
// nrm
#ifdef CONFIG_WIFI_MONITOR
else if (MLME_IS_MONITOR(padapter))
self_action = MLME_ACTION_NONE;

View File

@ -89,8 +89,7 @@ void _ips_enter(_adapter *padapter)
if (rf_off == pwrpriv->change_rfpwrstate) {
pwrpriv->bpower_saving = _TRUE;
/* nrm */
// RTW_PRINT("nolinked power save enter\n");
// nrm RTW_PRINT("nolinked power save enter\n");
if (pwrpriv->ips_mode == IPS_LEVEL_2)
pwrpriv->bkeepfwalive = _TRUE;
@ -143,8 +142,7 @@ int _ips_leave(_adapter *padapter)
pwrpriv->pwr_saving_time += rtw_get_passing_time_ms(pwrpriv->pwr_saving_start_time);
#endif /* CONFIG_RTW_CFGVENDOR_LLSTATS */
/* nrm */
// RTW_PRINT("nolinked power save leave\n");
// nrm RTW_PRINT("nolinked power save leave\n");
RTW_INFO("==> ips_leave.....LED(0x%08x)...\n", rtw_read32(padapter, 0x4c));
pwrpriv->bips_processing = _FALSE;

View File

@ -1392,6 +1392,7 @@ void dump_sta_info(void *sel, struct sta_info *psta)
HDATA_RATE(curr_tx_rate), (curr_tx_sgi) ? "S" : "L");
RTW_PRINT_SEL(sel, "curr_tx_bw : %s\n", ch_width_str(ra_info->curr_tx_bw));
RTW_PRINT_SEL(sel, "curr_retry_ratio : %d\n", ra_info->curr_retry_ratio);
// nrm
RTW_PRINT_SEL(sel, "ra_mask : 0x%016llx\n", ra_info->ramask);
}

View File

@ -291,6 +291,7 @@ 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);
// nrm
_RTW_PRINT_SEL(sel, "Best 5G Channel:%d\n", hal_data->acs.best_chan_5g);
#ifdef CONFIG_RTW_ACS_DBG

View File

@ -988,10 +988,9 @@ pre_init_system_cfg_8822b(struct halmac_adapter *adapter)
enable_bb = 0;
set_hw_value_88xx(adapter, HALMAC_HW_EN_BB_RF, &enable_bb);
/* nrm */
if (HALMAC_REG_R8(REG_SYS_CFG1 + 2) & BIT(4)) {
PLTFM_MSG_ERR("[ERR]test mode!!\n");
// return HALMAC_RET_WLAN_MODE_FAIL;
// nrm return HALMAC_RET_WLAN_MODE_FAIL;
}
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);

View File

@ -87,8 +87,7 @@ mac_pwr_switch_usb_8822b(struct halmac_adapter *adapter,
HALMAC_REG_W8_CLR(REG_SYS_STATUS1 + 1, BIT(0));
if ((HALMAC_REG_R8(REG_SW_MDIO + 3) & BIT(0)) == BIT(0))
/* nrm */
// PLTFM_MSG_ALWAYS("[ALWAYS]shall R reg twice!!\n");
// nrm PLTFM_MSG_ALWAYS("[ALWAYS]shall R reg twice!!\n");
adapter->halmac_state.mac_pwr = HALMAC_MAC_POWER_ON;
}

View File

@ -42,7 +42,6 @@
#endif
#ifdef CONFIG_80211AC_VHT
/* nrm - activates beamforming */
#define CONFIG_BEAMFORMING
#endif
@ -178,7 +177,7 @@
#define CONFIG_RTW_LED
#ifdef CONFIG_RTW_LED
// #define CONFIG_RTW_SW_LED
// nrm #define CONFIG_RTW_SW_LED
#ifdef CONFIG_RTW_SW_LED
/* #define CONFIG_RTW_LED_HANDLED_BY_CMD_THREAD */
#endif
@ -187,6 +186,7 @@
#define USB_INTERFERENCE_ISSUE /* this should be checked in all usb interface */
#define CONFIG_GLOBAL_UI_PID
// nrm
#define CONFIG_RTW_80211K
/*#define CONFIG_ADAPTOR_INFO_CACHING_FILE */ /* now just applied on 8192cu only, should make it general... */

View File

@ -6,11 +6,15 @@
#
# To make this file executable:
#
# $ chmod +x edit-options.sh
# $ chmod +x install-driver.sh
#
# To execute this file:
#
# $ sudo ./edit-options.sh
# $ sudo ./install-driver.sh
#
# or
#
# $ sudo sh install-driver.sh
#
# Copyright(c) 2023 Nick Morrow
#
@ -184,6 +188,9 @@ fi
#fi
echo ": ---------------------------"
echo
echo "Checking for previously installed drivers."
# check for and remove non-dkms installations
# standard naming
@ -196,6 +203,8 @@ if [ -f "${MODDESTDIR}${MODULE_NAME}.ko" ]; then
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
echo "Removal complete."
echo ": ---------------------------"
fi
# check for and remove non-dkms installations
@ -209,6 +218,8 @@ if [ -f "${MODDESTDIR}rtl${MODULE_NAME}.ko" ]; then
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
echo "Removal complete."
echo ": ---------------------------"
fi
# check for and remove non-dkms installations
@ -224,6 +235,8 @@ if [ -f "/usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODU
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
echo "Removal complete."
echo ": ---------------------------"
fi
# check for and remove dkms installations
@ -235,10 +248,14 @@ if command -v dkms >/dev/null 2>&1; then
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}
echo "Removal complete."
echo ": ---------------------------"
fi
fi
# sets module parameters (driver options) and blacklisted modules
echo
echo "Starting installation."
echo "Installing ${OPTIONS_FILE} to /etc/modprobe.d"
cp -f ${OPTIONS_FILE} /etc/modprobe.d
@ -306,6 +323,7 @@ else
fi
else
echo "The driver was added to dkms successfully."
echo ": ---------------------------"
fi
if command -v /usr/bin/time >/dev/null 2>&1; then
@ -324,6 +342,7 @@ else
exit $RESULT
else
echo "The driver was built by dkms successfully."
echo ": ---------------------------"
fi
dkms install -m ${DRV_NAME} -v ${DRV_VERSION}
@ -338,6 +357,7 @@ else
exit $RESULT
else
echo "The driver was installed by dkms successfully."
echo ": ---------------------------"
fi
fi
@ -350,6 +370,7 @@ fi
# if NoPrompt is not used, ask user some questions
if [ $NO_PROMPT -ne 1 ]; then
echo
printf "Do you want to edit the driver options file now? [y/N] "
read -r REPLY
case "$REPLY" in

View File

@ -139,7 +139,6 @@ int rtw_os_alloc_recvframe(_adapter *padapter, union recv_frame *precvframe, u8
precvframe->u.hdr.pkt = rtw_skb_clone(pskb);
if (precvframe->u.hdr.pkt) {
RTW_INFO("%s: rtw_skb_clone success, RX throughput may be low!\n", __FUNCTION__);
precvframe->u.hdr.pkt->dev = padapter->pnetdev;
precvframe->u.hdr.rx_head = precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail = pdata;
precvframe->u.hdr.rx_end = pdata + alloc_sz;

View File

@ -6,11 +6,15 @@
#
# To make this file executable:
#
# $ chmod +x edit-options.sh
# $ chmod +x remove-driver.sh
#
# To execute this file:
#
# $ sudo ./edit-options.sh
# $ sudo ./remove-driver.sh
#
# or
#
# $ sudo sh remove-driver.sh
#
# Copyright(c) 2023 Nick Morrow
#

View File

@ -8,7 +8,11 @@
#
# To execute this file:
#
# $ sudo ./edit-options.sh
# $ sudo ./save-log.sh
#
# or
#
# $ sudo sh save-log.sh
SCRIPT_NAME="save-log.sh"