From 6e61837391b8cdcef0ada607c9af5bd50a790372 Mon Sep 17 00:00:00 2001 From: Martin Kennedy Date: Sun, 7 Apr 2019 22:14:01 -0400 Subject: [PATCH 01/20] Actually run `pwd` into a variable, instead of just quoting 'pwd' This fixes a bug in DKMS compilation introduced in commit 3fcba157. --- dkms-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dkms-install.sh b/dkms-install.sh index d2f06d1..c7c500e 100755 --- a/dkms-install.sh +++ b/dkms-install.sh @@ -7,7 +7,7 @@ else echo "About to run dkms install steps..." fi -DRV_DIR='pwd' +DRV_DIR="$(pwd)" DRV_NAME=rtl8812au DRV_VERSION=5.3.4 From b85108f07405929bac665103a013cf6cd85a2744 Mon Sep 17 00:00:00 2001 From: Martin Kennedy Date: Sun, 7 Apr 2019 22:32:42 -0400 Subject: [PATCH 02/20] Correct an if statement in the DKMS installer script This was introduced in commit 3b3346a. This does assume the Makefile is in the driver directory. --- dkms-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dkms-install.sh b/dkms-install.sh index c7c500e..547a6f4 100755 --- a/dkms-install.sh +++ b/dkms-install.sh @@ -20,7 +20,7 @@ RESULT=$? echo "Finished running dkms install steps." -if defined(CONFIG_DISABLE_IPV6) +if grep -q -e "^CONFIG_DISABLE_IPV6 = y$" "$DRV_DIR/Makefile" ; then if echo "net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf; then @@ -29,6 +29,6 @@ if defined(CONFIG_DISABLE_IPV6) else echo "Could not disable IPv6" fi -endif +fi exit $RESULT From 3ea535d21860e01ccede623a83e55fc042982e3c Mon Sep 17 00:00:00 2001 From: kaosushijin Date: Mon, 8 Apr 2019 00:32:33 -0400 Subject: [PATCH 03/20] pwd failure caused build to fail Apostrophes should have been grave accents. --- dkms-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dkms-install.sh b/dkms-install.sh index d2f06d1..1a5e394 100755 --- a/dkms-install.sh +++ b/dkms-install.sh @@ -7,7 +7,7 @@ else echo "About to run dkms install steps..." fi -DRV_DIR='pwd' +DRV_DIR=`pwd` DRV_NAME=rtl8812au DRV_VERSION=5.3.4 From 66674a5c3654fa4e3ad342cfe70725da8917874f Mon Sep 17 00:00:00 2001 From: visbs <44805295+visbs@users.noreply.github.com> Date: Tue, 23 Apr 2019 17:44:51 +0530 Subject: [PATCH 04/20] Update Makefile for uninstall --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1c4e3b3..4ee761e 100755 --- a/Makefile +++ b/Makefile @@ -1718,7 +1718,7 @@ install: /sbin/depmod -a ${KVER} uninstall: - rm -f $(MODDESTDIR)/$(MODULE_NAME).ko + rm -f $(MODDESTDIR)$(MODULE_NAME).ko /sbin/depmod -a ${KVER} backup_rtlwifi: From 105e8a0603a62f8b138d55cf434c86cac40aec83 Mon Sep 17 00:00:00 2001 From: satmandu Date: Fri, 10 May 2019 17:49:22 -0400 Subject: [PATCH 05/20] Changes required for ARM64_RPI builds to work This makes the instructions in the main README work which suggest the following before installing for a dkms install: ``` $ sed -i 's/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g' Makefile $ sed -i 's/CONFIG_PLATFORM_ARM64_RPI = n/CONFIG_PLATFORM_ARM64_RPI = y/g' Makefile ``` This makes building for the 3B on ubuntu/arm64 work, and should work for 3B+ in arm64 mode as well. This should fix the bug reported here: https://github.com/aircrack-ng/rtl8812au/issues/336 --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 4ee761e..1a2dd74 100755 --- a/Makefile +++ b/Makefile @@ -156,6 +156,7 @@ CONFIG_PLATFORM_ARM_SPREADTRUM_6820 = n CONFIG_PLATFORM_ARM_SPREADTRUM_8810 = n CONFIG_PLATFORM_ARM_WMT = n CONFIG_PLATFORM_ARM_RPI = n +CONFIG_PLATFORM_ARM64_RPI = n CONFIG_PLATFORM_ARM_ODROIDC2 = n CONFIG_PLATFORM_TI_DM365 = n CONFIG_PLATFORM_MOZART = n @@ -1456,6 +1457,17 @@ MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/ INSTALL_PREFIX := endif +ifeq ($(CONFIG_PLATFORM_ARM64_RPI), y) +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT +ARCH ?= arm64 +CROSS_COMPILE ?= +KVER ?= $(shell uname -r) +KSRC := /lib/modules/$(KVER)/build +MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/ +INSTALL_PREFIX := +endif + ifeq ($(CONFIG_PLATFORM_ARM_ODROIDC2), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT From 4f07fb357556ba9f805ad18b64ff7101d0c94607 Mon Sep 17 00:00:00 2001 From: satmandu Date: Fri, 10 May 2019 22:48:40 -0400 Subject: [PATCH 06/20] Updating RPI arm64 Makefile CFLAGS After https://github.com/aircrack-ng/rtl8812au/commit/de2c75f9fd4f26996e2b40f0df4bd42eadba31d5 any build on some architectures appears to throw many errors as follows. This change keeps the redefine from happening. (Yes this affects other architectures, but I can only verify the fix on arm64.) ```/var/lib/dkms/rtl8812au/5.3.4/build/include/autoconf.h:34: warning: "CONFIG_IOCTL_CFG80211" redefined 34 | #define CONFIG_IOCTL_CFG80211 | : note: this is the location of the previous definition ``` --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1a2dd74..426b95f 100755 --- a/Makefile +++ b/Makefile @@ -1459,7 +1459,7 @@ endif ifeq ($(CONFIG_PLATFORM_ARM64_RPI), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT +EXTRA_CFLAGS += -DRTW_USE_CFG80211_STA_EVENT ARCH ?= arm64 CROSS_COMPILE ?= KVER ?= $(shell uname -r) From e2d6505b67df57def5043302073a01ec8298f932 Mon Sep 17 00:00:00 2001 From: Hansruedi Patzen Date: Wed, 15 May 2019 14:25:00 +0200 Subject: [PATCH 07/20] linux-5.2: disable fallback from rtw_select_queue The fallback parameter has been removed in the latest kernel (>= 5.2) See: https://github.com/torvalds/linux/commit/a350eccee5830d9a1f29e393a88dc05a15326d44 --- os_dep/linux/os_intfs.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 865f5c1..28e7c0c 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1273,20 +1273,18 @@ unsigned int rtw_classify8021d(struct sk_buff *skb) return dscp >> 5; } -#if (LINUX_VERSION_CODE>=KERNEL_VERSION(4,19,0)) -static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb, - struct net_device *sb_dev, - select_queue_fallback_t fallback) -#else static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) + #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,19,0)) , void *accel_priv - #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) + #else + , struct net_device *sb_dev + #endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)) , select_queue_fallback_t fallback #endif #endif ) -#endif { _adapter *padapter = rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; From d8d9399a5bfa3657d94505602a863d7f49d40393 Mon Sep 17 00:00:00 2001 From: Hansruedi Patzen Date: Wed, 15 May 2019 14:26:01 +0200 Subject: [PATCH 08/20] compilation: fix override-init warning rtl8812au/os_dep/linux/ioctl_cfg80211.c:9512:25: warning: initialized field overwritten [-Woverride-init] .set_monitor_channel = cfg80211_rtw_set_monitor_channel, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- os_dep/linux/ioctl_cfg80211.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 09ce5f7..cbdad95 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -9458,9 +9458,6 @@ static struct cfg80211_ops rtw_cfg80211_ops = { .set_pmksa = cfg80211_rtw_set_pmksa, .del_pmksa = cfg80211_rtw_del_pmksa, .flush_pmksa = cfg80211_rtw_flush_pmksa, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - .set_monitor_channel = cfg80211_rtw_set_monitor_channel, -#endif #ifdef CONFIG_AP_MODE .add_virtual_intf = cfg80211_rtw_add_virtual_intf, From d1d2446e051ad743769765e4367fca1811005da8 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Tue, 21 May 2019 23:50:29 +0200 Subject: [PATCH 09/20] Revert back some changes to fix frame injection --- Makefile | 19 +---- core/rtw_mlme_ext.c | 2 +- core/rtw_recv.c | 21 ++--- dkms-install.sh | 9 +- dkms.conf | 2 +- hal/phydm/phydm_hwconfig.c | 8 +- hal/rtl8814a/rtl8814a_dm.c | 2 +- hal/rtl8814a/rtl8814a_phycfg.c | 9 +- os_dep/linux/ioctl_cfg80211.c | 146 +++++++++++++++++++++++++-------- os_dep/linux/ioctl_linux.c | 7 +- os_dep/linux/os_intfs.c | 6 +- 11 files changed, 140 insertions(+), 91 deletions(-) diff --git a/Makefile b/Makefile index 426b95f..8bb98b4 100755 --- a/Makefile +++ b/Makefile @@ -10,7 +10,6 @@ EXTRA_CFLAGS += -Wextra #EXTRA_CFLAGS += -Wno-tautological-compare #EXTRA_CFLAGS += -Wno-incompatible-pointer-types #EXTRA_CFLAGS += -Wno-switch -EXTRA_CFLAGS += -Wmissing-field-initializers EXTRA_CFLAGS += -Wno-cast-function-type EXTRA_CFLAGS += -Wno-unused-variable EXTRA_CFLAGS += -Wno-unused-value @@ -44,12 +43,8 @@ CONFIG_RTL8821A = y CONFIG_RTL8814A = y ######################### Interface ########################### CONFIG_USB_HCI = y -######################### LED ########################### -CONFIG_LED_CONTROL = y -CONFIG_LED_ENABLE = y ########################## Features ########################### CONFIG_NET_NS = n -CONFIG_IPV6_DISABLE = n CONFIG_MP_INCLUDED = y CONFIG_CONCURRENT_MODE = n CONFIG_POWER_SAVING = n @@ -156,7 +151,6 @@ CONFIG_PLATFORM_ARM_SPREADTRUM_6820 = n CONFIG_PLATFORM_ARM_SPREADTRUM_8810 = n CONFIG_PLATFORM_ARM_WMT = n CONFIG_PLATFORM_ARM_RPI = n -CONFIG_PLATFORM_ARM64_RPI = n CONFIG_PLATFORM_ARM_ODROIDC2 = n CONFIG_PLATFORM_TI_DM365 = n CONFIG_PLATFORM_MOZART = n @@ -1457,17 +1451,6 @@ MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/ INSTALL_PREFIX := endif -ifeq ($(CONFIG_PLATFORM_ARM64_RPI), y) -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -EXTRA_CFLAGS += -DRTW_USE_CFG80211_STA_EVENT -ARCH ?= arm64 -CROSS_COMPILE ?= -KVER ?= $(shell uname -r) -KSRC := /lib/modules/$(KVER)/build -MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/ -INSTALL_PREFIX := -endif - ifeq ($(CONFIG_PLATFORM_ARM_ODROIDC2), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT @@ -1730,7 +1713,7 @@ install: /sbin/depmod -a ${KVER} uninstall: - rm -f $(MODDESTDIR)$(MODULE_NAME).ko + rm -f $(MODDESTDIR)/$(MODULE_NAME).ko /sbin/depmod -a ${KVER} backup_rtlwifi: diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index e298ef9..5bd061e 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -5965,7 +5965,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) /* DS parameter set */ pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&pwdinfo->listen_channel, &pattrib->pktlen); -#if 0 +#ifdef CONFIG_IOCTL_CFG80211 if (adapter_wdev_data(padapter)->p2p_enabled && pwdinfo->driver_interface == DRIVER_CFG80211) { if (pmlmepriv->wps_probe_resp_ie != NULL && pmlmepriv->p2p_probe_resp_ie != NULL) { /* WPS IE */ diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 4158f16..ee51ced 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -3964,12 +3964,6 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, rtap_hdr = (struct ieee80211_radiotap_header *)&hdr_buf[0]; rtap_hdr->it_version = PKTHDR_RADIOTAP_VERSION; -#ifdef CONFIG_RTL8814A - /* RTL8814AU rx descriptor has no bandwidth, ldpc, stbc and sgi info */ - /* fixup bandwidth */ - pattrib->bw = pattrib->phy_info.band_width & 0x03; -#endif - /* tsft */ if (pattrib->tsfl) { u64 tmp_64bit; @@ -4088,19 +4082,22 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, hdr_buf[rt_len] |= BIT1; /* MCS index known */ /* bandwidth */ +#ifdef CONFIG_RTL8814A + if(pattrib->physt) { + hdr_buf[rt_len] |= BIT0; + hdr_buf[rt_len+1] |= (pattrib->phy_info.band_width & 0x03); + } +#else hdr_buf[rt_len] |= BIT0; hdr_buf[rt_len + 1] |= (pattrib->bw & 0x03); - /* guard interval */ -#ifndef CONFIG_RTL8814A - hdr_buf[rt_len] |= BIT2; #endif + /* guard interval */ + hdr_buf[rt_len] |= BIT2; hdr_buf[rt_len + 1] |= (pattrib->sgi & 0x01) << 2; /* STBC */ -#ifndef CONFIG_RTL8814A hdr_buf[rt_len] |= BIT5; -#endif hdr_buf[rt_len + 1] |= (pattrib->stbc & 0x03) << 5; rt_len += 2; @@ -4135,9 +4132,7 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, hdr_buf[rt_len + 2] |= (pattrib->sgi & 0x01) << 2; /* LDPC extra OFDM symbol */ -#ifndef CONFIG_RTL8814A tmp_16bit |= BIT4; -#endif hdr_buf[rt_len + 2] |= (pattrib->ldpc & 0x01) << 4; memcpy(&hdr_buf[rt_len], &tmp_16bit, 2); diff --git a/dkms-install.sh b/dkms-install.sh index 58503ef..b4c4379 100755 --- a/dkms-install.sh +++ b/dkms-install.sh @@ -7,12 +7,11 @@ else echo "About to run dkms install steps..." fi - -DRV_DIR=`pwd` +DRV_DIR=rtl8812au DRV_NAME=rtl8812au DRV_VERSION=5.3.4 -cp -r ${DRV_DIR} /usr/src/${DRV_NAME}-${DRV_VERSION} +cp -r $(pwd) /usr/src/${DRV_NAME}-${DRV_VERSION} dkms add -m ${DRV_NAME} -v ${DRV_VERSION} dkms build -m ${DRV_NAME} -v ${DRV_VERSION} @@ -21,7 +20,7 @@ RESULT=$? echo "Finished running dkms install steps." -if grep -q -e "^CONFIG_DISABLE_IPV6 = y$" "$DRV_DIR/Makefile" ; then + if echo "net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf; then @@ -30,6 +29,6 @@ if grep -q -e "^CONFIG_DISABLE_IPV6 = y$" "$DRV_DIR/Makefile" ; then else echo "Could not disable IPv6" fi -fi + exit $RESULT diff --git a/dkms.conf b/dkms.conf index a8669e8..1f862a2 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,5 +1,5 @@ PACKAGE_NAME="realtek-rtl88xxau" -PACKAGE_VERSION="5.3.4~20190409" +PACKAGE_VERSION="5.3.4~20190522" CLEAN="'make' clean" BUILT_MODULE_NAME[0]=88XXau PROCS_NUM=`nproc` diff --git a/hal/phydm/phydm_hwconfig.c b/hal/phydm/phydm_hwconfig.c index fd03fb3..69d3490 100644 --- a/hal/phydm/phydm_hwconfig.c +++ b/hal/phydm/phydm_hwconfig.c @@ -299,13 +299,13 @@ odm_config_bb_with_header_file( /*if (p_dm->rfe_type == 0) READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type0); else if (dm->rfe_type == 2) - READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type2); + READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type2); else if (dm->rfe_type == 3) - READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type3); + READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type3); else if (dm->rfe_type == 4) - READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type4); + READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type4); else if (dm->rfe_type == 5) - READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type5); + READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type5); else if (dm->rfe_type == 7) READ_AND_CONFIG_MP(8814a,_phy_reg_pg_type7); else if (dm->rfe_type == 8) diff --git a/hal/rtl8814a/rtl8814a_dm.c b/hal/rtl8814a/rtl8814a_dm.c index aef425e..61a77d1 100644 --- a/hal/rtl8814a/rtl8814a_dm.c +++ b/hal/rtl8814a/rtl8814a_dm.c @@ -334,7 +334,7 @@ void rtl8814_init_dm_priv(IN PADAPTER Adapter) #endif Init_ODM_ComInfo_8814(Adapter); - odm_init_all_timers(podmpriv ); + odm_init_all_timers(podmpriv ); //PHYDM_InitDebugSetting(podmpriv); pHalData->CurrentTxPwrIdx = 18; diff --git a/hal/rtl8814a/rtl8814a_phycfg.c b/hal/rtl8814a/rtl8814a_phycfg.c index 30d096a..fa1cd06 100644 --- a/hal/rtl8814a/rtl8814a_phycfg.c +++ b/hal/rtl8814a/rtl8814a_phycfg.c @@ -1094,7 +1094,7 @@ PHY_SetRFPowerState8814A( #elif (DEV_BUS_TYPE == RT_SDIO_INTERFACE) bResult = phy_SetRFPowerState_8814Sdio(Adapter, eRFPowerState); #endif - + RT_TRACE(COMP_RF, DBG_LOUD, ("<--------- PHY_SetRFPowerState8814(): bResult(%d)\n", bResult)); return bResult; @@ -1230,18 +1230,17 @@ PHY_GetTxPowerIndex8814A( tic->ebias = 0; } - phy_TxPwrAdjInPercentage(pAdapter, (u8 *)&txPower); if(txPower > MAX_POWER_INDEX) txPower = MAX_POWER_INDEX; - //if (Adapter->registrypriv.mp_mode==0 && + //if (Adapter->registrypriv.mp_mode==0 && //(pHalData->bautoload_fail_flag || pHalData->EfuseMap[EFUSE_INIT_MAP][EEPROM_TX_PWR_INX_JAGUAR] == 0xFF)) //txPower = 0x12; /*RTW_INFO("Final Tx Power(RF-%c, Channel: %d) = %d(0x%X)\n", ((RFPath==0)?'A':(RFPath==1)?'B':(RFPath==2)?'C':'D'), Channel, txPower, txPower);*/ - return (u8) txPower; + return (u8) txPower; } @@ -1249,7 +1248,7 @@ VOID PHY_SetTxPowerIndex_8814A( IN PADAPTER Adapter, IN u32 PowerIndex, - IN enum rf_path RFPath, + IN enum rf_path RFPath, IN u8 Rate ) { diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 09ce5f7..7aae542 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -3939,22 +3939,43 @@ int value; value = dbm; #endif -if (value < 0) { +if(value < 0) value = 0; -} -if (value > 40) { +if(value > 40) value = 40; -} - if (type == NL80211_TX_POWER_FIXED) { - pHalData->CurrentTxPwrIdx = value; - rtw_hal_set_tx_power_level(padapter, pHalData->current_channel); - } else { +if(type == NL80211_TX_POWER_FIXED) { + pHalData->CurrentTxPwrIdx = value; + rtw_hal_set_tx_power_level(padapter, pHalData->current_channel); +} else return -EOPNOTSUPP; - } - return -EOPNOTSUPP; +#if 0 + struct iwm_priv *iwm = wiphy_to_iwm(wiphy); + int ret; + switch (type) { + case NL80211_TX_POWER_AUTOMATIC: + return 0; + case NL80211_TX_POWER_FIXED: + if (mbm < 0 || (mbm % 100)) + return -EOPNOTSUPP; + + if (!test_bit(IWM_STATUS_READY, &iwm->status)) + return 0; + + ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX, + CFG_TX_PWR_LIMIT_USR, + MBM_TO_DBM(mbm) * 2); + if (ret < 0) + return ret; + + return iwm_tx_power_trigger(iwm); + default: + IWM_ERR(iwm, "Unsupported power type: %d\n", type); + return -EOPNOTSUPP; + } +#endif RTW_INFO("%s\n", __func__); return 0; } @@ -5710,48 +5731,104 @@ static int cfg80211_rtw_set_channel(struct wiphy *wiphy return 0; } -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) -/* TODO: 160 MHz bandwidth */ -static int cfg80211_rtw_set_monitor_channel(struct wiphy *wiphy, struct cfg80211_chan_def *chandef) +static int cfg80211_rtw_set_monitor_channel(struct wiphy *wiphy +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) + , struct cfg80211_chan_def *chandef +#else + , struct ieee80211_channel *chan + , enum nl80211_channel_type channel_type +#endif +) { - int chan_target = (u8) ieee80211_frequency_to_channel(chandef->chan->center_freq); - int chan_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; - int chan_width = CHANNEL_WIDTH_20; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) + struct ieee80211_channel *chan = chandef->chan; +#endif _adapter *padapter = wiphy_to_adapter(wiphy); + int target_channal = chan->hw_value; + int target_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + int target_width = CHANNEL_WIDTH_20; + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)) +#ifdef CONFIG_DEBUG_CFG80211 + RTW_INFO("center_freq %u Mhz ch %u width %u freq1 %u freq2 %u\n" + , chan->center_freq + , chan->hw_value + , chandef->width + , chandef->center_freq1 + , chandef->center_freq2); +#endif /* CONFIG_DEBUG_CFG80211 */ switch (chandef->width) { case NL80211_CHAN_WIDTH_20_NOHT: case NL80211_CHAN_WIDTH_20: - chan_width = CHANNEL_WIDTH_20; - chan_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + target_width = CHANNEL_WIDTH_20; + target_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; break; case NL80211_CHAN_WIDTH_40: - chan_width = CHANNEL_WIDTH_40; - if (chandef->center_freq1 > chandef->chan->center_freq) - chan_offset = HAL_PRIME_CHNL_OFFSET_LOWER; + target_width = CHANNEL_WIDTH_40; + if (chandef->center_freq1 > chan->center_freq) + target_offset = HAL_PRIME_CHNL_OFFSET_LOWER; else - chan_offset = HAL_PRIME_CHNL_OFFSET_UPPER; + target_offset = HAL_PRIME_CHNL_OFFSET_UPPER; break; case NL80211_CHAN_WIDTH_80: - chan_width = CHANNEL_WIDTH_80; - if (chandef->center_freq1 > chandef->chan->center_freq) - chan_offset = HAL_PRIME_CHNL_OFFSET_LOWER; - else - chan_offset = HAL_PRIME_CHNL_OFFSET_UPPER; + target_width = CHANNEL_WIDTH_80; + target_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; break; + case NL80211_CHAN_WIDTH_80P80: + target_width = CHANNEL_WIDTH_80_80; + target_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + break; + case NL80211_CHAN_WIDTH_160: + target_width = CHANNEL_WIDTH_160; + target_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + break; + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) + case NL80211_CHAN_WIDTH_5: + case NL80211_CHAN_WIDTH_10: +#endif default: - chan_width = CHANNEL_WIDTH_20; - chan_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + target_width = CHANNEL_WIDTH_20; + target_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; break; } +#else +#ifdef CONFIG_DEBUG_CFG80211 + RTW_INFO("center_freq %u Mhz ch %u channel_type %u\n" + , chan->center_freq + , chan->hw_value + , channel_type); +#endif /* CONFIG_DEBUG_CFG80211 */ + + switch (channel_type) { + case NL80211_CHAN_NO_HT: + case NL80211_CHAN_HT20: + target_width = CHANNEL_WIDTH_20; + target_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + break; + case NL80211_CHAN_HT40MINUS: + target_width = CHANNEL_WIDTH_40; + target_offset = HAL_PRIME_CHNL_OFFSET_UPPER; + break; + case NL80211_CHAN_HT40PLUS: + target_width = CHANNEL_WIDTH_40; + target_offset = HAL_PRIME_CHNL_OFFSET_LOWER; + break; + default: + target_width = CHANNEL_WIDTH_20; + target_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; + break; + } +#endif + RTW_INFO(FUNC_ADPT_FMT" ch:%d bw:%d, offset:%d\n" + , FUNC_ADPT_ARG(padapter), target_channal, target_width, target_offset); + + rtw_set_chbw_cmd(padapter, target_channal, target_width, target_offset, RTW_CMDF_WAIT_ACK); - set_channel_bwmode(padapter, chan_target, chan_offset, chan_width); - RTW_INFO("%s : %d %d %d\n", __func__, chan_target, chan_offset, chan_width); return 0; } -#endif - static int cfg80211_rtw_auth(struct wiphy *wiphy, struct net_device *ndev, struct cfg80211_auth_request *req) @@ -9458,9 +9535,6 @@ static struct cfg80211_ops rtw_cfg80211_ops = { .set_pmksa = cfg80211_rtw_set_pmksa, .del_pmksa = cfg80211_rtw_del_pmksa, .flush_pmksa = cfg80211_rtw_flush_pmksa, -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) - .set_monitor_channel = cfg80211_rtw_set_monitor_channel, -#endif #ifdef CONFIG_AP_MODE .add_virtual_intf = cfg80211_rtw_add_virtual_intf, diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 9c4ba08..3ff1564 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -6942,7 +6942,7 @@ out: static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, u32 param_len) { int ret = 0; - u32 wep_key_idx, wep_key_len, wep_total_len = 0; + u32 wep_key_idx, wep_key_len, wep_total_len; NDIS_802_11_WEP *pwep = NULL; struct sta_info *psta = NULL, *pbcmc_sta = NULL; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); @@ -12355,9 +12355,8 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) } #endif -#if defined(CONFIG_WIRELESS_EXT) && !defined(CONFIG_CFG80211_WEXT) -struct iw_handler_def rtw_handlers_def = -{ +#ifdef CONFIG_WIRELESS_EXT +struct iw_handler_def rtw_handlers_def = { .standard = rtw_handlers, .num_standard = sizeof(rtw_handlers) / sizeof(iw_handler), #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33)) || defined(CONFIG_WEXT_PRIV) diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 865f5c1..36e282d 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1531,7 +1531,7 @@ struct net_device *rtw_init_netdev(_adapter *old_padapter) /* pnetdev->tx_timeout = NULL; */ pnetdev->watchdog_timeo = HZ * 3; /* 3 second timeout */ -#if defined(CONFIG_WIRELESS_EXT) && !defined(CONFIG_CFG80211_WEXT) +#ifdef CONFIG_WIRELESS_EXT pnetdev->wireless_handlers = (struct iw_handler_def *)&rtw_handlers_def; #endif @@ -2650,8 +2650,8 @@ static int netdev_vir_if_close(struct net_device *pnetdev) #endif #ifdef CONFIG_IOCTL_CFG80211 - padapter->rtw_wdev->iftype = NL80211_IFTYPE_MONITOR; - padapter->rtw_wdev->current_bss = NULL; + wdev->iftype = NL80211_IFTYPE_MONITOR; + wdev->current_bss = NULL; rtw_scan_abort(padapter); rtw_cfg80211_wait_scan_req_empty(padapter, 200); adapter_wdev_data(padapter)->bandroid_scan = _FALSE; From 40ac5fb27d5104ff9a2c2b3d42b539bdc76376f6 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 22 May 2019 00:00:34 +0200 Subject: [PATCH 10/20] TX power control for 8814 --- hal/rtl8814a/rtl8814a_dm.c | 2 +- hal/rtl8814a/rtl8814a_phycfg.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hal/rtl8814a/rtl8814a_dm.c b/hal/rtl8814a/rtl8814a_dm.c index 61a77d1..aef425e 100644 --- a/hal/rtl8814a/rtl8814a_dm.c +++ b/hal/rtl8814a/rtl8814a_dm.c @@ -334,7 +334,7 @@ void rtl8814_init_dm_priv(IN PADAPTER Adapter) #endif Init_ODM_ComInfo_8814(Adapter); - odm_init_all_timers(podmpriv ); + odm_init_all_timers(podmpriv ); //PHYDM_InitDebugSetting(podmpriv); pHalData->CurrentTxPwrIdx = 18; diff --git a/hal/rtl8814a/rtl8814a_phycfg.c b/hal/rtl8814a/rtl8814a_phycfg.c index fa1cd06..30d096a 100644 --- a/hal/rtl8814a/rtl8814a_phycfg.c +++ b/hal/rtl8814a/rtl8814a_phycfg.c @@ -1094,7 +1094,7 @@ PHY_SetRFPowerState8814A( #elif (DEV_BUS_TYPE == RT_SDIO_INTERFACE) bResult = phy_SetRFPowerState_8814Sdio(Adapter, eRFPowerState); #endif - + RT_TRACE(COMP_RF, DBG_LOUD, ("<--------- PHY_SetRFPowerState8814(): bResult(%d)\n", bResult)); return bResult; @@ -1230,17 +1230,18 @@ PHY_GetTxPowerIndex8814A( tic->ebias = 0; } + phy_TxPwrAdjInPercentage(pAdapter, (u8 *)&txPower); if(txPower > MAX_POWER_INDEX) txPower = MAX_POWER_INDEX; - //if (Adapter->registrypriv.mp_mode==0 && + //if (Adapter->registrypriv.mp_mode==0 && //(pHalData->bautoload_fail_flag || pHalData->EfuseMap[EFUSE_INIT_MAP][EEPROM_TX_PWR_INX_JAGUAR] == 0xFF)) //txPower = 0x12; /*RTW_INFO("Final Tx Power(RF-%c, Channel: %d) = %d(0x%X)\n", ((RFPath==0)?'A':(RFPath==1)?'B':(RFPath==2)?'C':'D'), Channel, txPower, txPower);*/ - return (u8) txPower; + return (u8) txPower; } @@ -1248,7 +1249,7 @@ VOID PHY_SetTxPowerIndex_8814A( IN PADAPTER Adapter, IN u32 PowerIndex, - IN enum rf_path RFPath, + IN enum rf_path RFPath, IN u8 Rate ) { From cccd2f324c1a05b1b5ca811633cc961d2ff8d313 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 22 May 2019 00:03:27 +0200 Subject: [PATCH 11/20] Add support for TP-Link Archer T2U Nano AC600 --- os_dep/linux/usb_intf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index cbe5c12..708b3e9 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -218,6 +218,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = { {USB_DEVICE(0x056E, 0x4007), .driver_info = RTL8821}, /* Elecom - WDC-433DU2HBK */ {USB_DEVICE(0x0BDA, 0xA811), .driver_info = RTL8821}, /* GMYLE - AC450 */ {USB_DEVICE(0x3823, 0x6249), .driver_info = RTL8821}, /* Obihai - OBiWiFi */ + {USB_DEVICE(0x2357, 0x0122), .driver_info = RTL8821}, /* TP Link - T2U Nano */ #endif #ifdef CONFIG_RTL8192E From 33d12b04c5ea57c44bf9a590dcddb64444be410c Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 22 May 2019 00:10:03 +0200 Subject: [PATCH 12/20] Fix radiotap header for 8814 --- core/rtw_recv.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/core/rtw_recv.c b/core/rtw_recv.c index ee51ced..12dd0bd 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -3964,6 +3964,12 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, rtap_hdr = (struct ieee80211_radiotap_header *)&hdr_buf[0]; rtap_hdr->it_version = PKTHDR_RADIOTAP_VERSION; +#ifdef CONFIG_RTL8814A + /* RTL8814AU rx descriptor has no bandwidth, ldpc, stbc and sgi info */ + /* fixup bandwidth */ + pattrib->bw = pattrib->phy_info.band_width & 0x03; +#endif + /* tsft */ if (pattrib->tsfl) { u64 tmp_64bit; @@ -4082,22 +4088,19 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, hdr_buf[rt_len] |= BIT1; /* MCS index known */ /* bandwidth */ -#ifdef CONFIG_RTL8814A - if(pattrib->physt) { - hdr_buf[rt_len] |= BIT0; - hdr_buf[rt_len+1] |= (pattrib->phy_info.band_width & 0x03); - } -#else hdr_buf[rt_len] |= BIT0; hdr_buf[rt_len + 1] |= (pattrib->bw & 0x03); -#endif /* guard interval */ +#ifndef CONFIG_RTL8814A hdr_buf[rt_len] |= BIT2; hdr_buf[rt_len + 1] |= (pattrib->sgi & 0x01) << 2; +#endif /* STBC */ +#ifndef CONFIG_RTL8814A hdr_buf[rt_len] |= BIT5; +#endif hdr_buf[rt_len + 1] |= (pattrib->stbc & 0x03) << 5; rt_len += 2; @@ -4132,7 +4135,9 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe, hdr_buf[rt_len + 2] |= (pattrib->sgi & 0x01) << 2; /* LDPC extra OFDM symbol */ +#ifndef CONFIG_RTL8814A tmp_16bit |= BIT4; +#endif hdr_buf[rt_len + 2] |= (pattrib->ldpc & 0x01) << 4; memcpy(&hdr_buf[rt_len], &tmp_16bit, 2); From 788e49feae8ee1350c992b29794de2942c78e103 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 22 May 2019 00:11:21 +0200 Subject: [PATCH 13/20] dkms-install: Don't hardcode parent folder --- dkms-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dkms-install.sh b/dkms-install.sh index b4c4379..084ec68 100755 --- a/dkms-install.sh +++ b/dkms-install.sh @@ -7,11 +7,11 @@ else echo "About to run dkms install steps..." fi -DRV_DIR=rtl8812au +DRV_DIR='pwd' DRV_NAME=rtl8812au DRV_VERSION=5.3.4 -cp -r $(pwd) /usr/src/${DRV_NAME}-${DRV_VERSION} +cp -r ${DRV_DIR} /usr/src/${DRV_NAME}-${DRV_VERSION} dkms add -m ${DRV_NAME} -v ${DRV_VERSION} dkms build -m ${DRV_NAME} -v ${DRV_VERSION} From 94cd8fba9efd4b92dd713fb81718db0793299aaa Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 22 May 2019 00:12:23 +0200 Subject: [PATCH 14/20] Fix used before initialized warning --- os_dep/linux/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 3ff1564..d824dc5 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -863,7 +863,7 @@ static int wpa_set_auth_algs(struct net_device *dev, u32 value) static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, u32 param_len) { int ret = 0; - u32 wep_key_idx, wep_key_len, wep_total_len; + u32 wep_key_idx, wep_key_len, wep_total_len = 0; _adapter *padapter = (_adapter *)rtw_netdev_priv(dev); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct security_priv *psecuritypriv = &padapter->securitypriv; From 9e681b1e4285c910c557347d67a49b329994cdfd Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 22 May 2019 00:14:09 +0200 Subject: [PATCH 15/20] Added a switch to IPv6 disable/enable --- Makefile | 1 + dkms-install.sh | 4 ++-- dkms-remove.sh | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8bb98b4..5fe905f 100755 --- a/Makefile +++ b/Makefile @@ -45,6 +45,7 @@ CONFIG_RTL8814A = y CONFIG_USB_HCI = y ########################## Features ########################### CONFIG_NET_NS = n +CONFIG_IPV6_DISABLE = n CONFIG_MP_INCLUDED = y CONFIG_CONCURRENT_MODE = n CONFIG_POWER_SAVING = n diff --git a/dkms-install.sh b/dkms-install.sh index 084ec68..6167817 100755 --- a/dkms-install.sh +++ b/dkms-install.sh @@ -20,7 +20,7 @@ RESULT=$? echo "Finished running dkms install steps." - +if defined(CONFIG_DISABLE_IPV6) if echo "net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf; then @@ -29,6 +29,6 @@ echo "Finished running dkms install steps." else echo "Could not disable IPv6" fi - +#endif exit $RESULT diff --git a/dkms-remove.sh b/dkms-remove.sh index 96d9b20..a14bb99 100755 --- a/dkms-remove.sh +++ b/dkms-remove.sh @@ -7,7 +7,7 @@ else echo "About to run dkms removal steps..." fi -DRV_DIR=rtl8812au +DRV_DIR='pwd' DRV_NAME=rtl8812au DRV_VERSION=5.3.4 From 3a9681eaf2f84e6bd715a8c89b9ca71d419c2752 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 22 May 2019 00:15:11 +0200 Subject: [PATCH 16/20] Added another debug message in Makefile --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 5fe905f..df16efc 100755 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ EXTRA_CFLAGS += -Wextra #EXTRA_CFLAGS += -Wno-tautological-compare #EXTRA_CFLAGS += -Wno-incompatible-pointer-types #EXTRA_CFLAGS += -Wno-switch +#EXTRA_CFLAGS += -Wmissing-field-initializers EXTRA_CFLAGS += -Wno-cast-function-type EXTRA_CFLAGS += -Wno-unused-variable EXTRA_CFLAGS += -Wno-unused-value From 29d0588c8aab07e95048fee7e901071882ce671b Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 22 May 2019 00:15:56 +0200 Subject: [PATCH 17/20] Added LED control --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index df16efc..731a35e 100755 --- a/Makefile +++ b/Makefile @@ -44,6 +44,9 @@ CONFIG_RTL8821A = y CONFIG_RTL8814A = y ######################### Interface ########################### CONFIG_USB_HCI = y +######################### LED ########################### +CONFIG_LED_CONTROL = y +CONFIG_LED_ENABLE = y ########################## Features ########################### CONFIG_NET_NS = n CONFIG_IPV6_DISABLE = n From f2ac716f764ee2d373923e1f33717dc7a13be7e7 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 22 May 2019 00:19:32 +0200 Subject: [PATCH 18/20] Fixed Makefile, DKMS and ARM64 RPI support added --- Makefile | 14 +++++++++++++- dkms-install.sh | 6 +++--- dkms-remove.sh | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 731a35e..c83e878 100755 --- a/Makefile +++ b/Makefile @@ -156,6 +156,7 @@ CONFIG_PLATFORM_ARM_SPREADTRUM_6820 = n CONFIG_PLATFORM_ARM_SPREADTRUM_8810 = n CONFIG_PLATFORM_ARM_WMT = n CONFIG_PLATFORM_ARM_RPI = n +CONFIG_PLATFORM_ARM64_RPI = n CONFIG_PLATFORM_ARM_ODROIDC2 = n CONFIG_PLATFORM_TI_DM365 = n CONFIG_PLATFORM_MOZART = n @@ -1456,6 +1457,17 @@ MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/ INSTALL_PREFIX := endif +ifeq ($(CONFIG_PLATFORM_ARM64_RPI), y) +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT +ARCH ?= arm64 +CROSS_COMPILE ?= +KVER ?= $(shell uname -r) +KSRC := /lib/modules/$(KVER)/build +MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/ +INSTALL_PREFIX := +endif + ifeq ($(CONFIG_PLATFORM_ARM_ODROIDC2), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT @@ -1718,7 +1730,7 @@ install: /sbin/depmod -a ${KVER} uninstall: - rm -f $(MODDESTDIR)/$(MODULE_NAME).ko + rm -f $(MODDESTDIR)$(MODULE_NAME).ko /sbin/depmod -a ${KVER} backup_rtlwifi: diff --git a/dkms-install.sh b/dkms-install.sh index 6167817..547a6f4 100755 --- a/dkms-install.sh +++ b/dkms-install.sh @@ -7,7 +7,7 @@ else echo "About to run dkms install steps..." fi -DRV_DIR='pwd' +DRV_DIR="$(pwd)" DRV_NAME=rtl8812au DRV_VERSION=5.3.4 @@ -20,7 +20,7 @@ RESULT=$? echo "Finished running dkms install steps." -if defined(CONFIG_DISABLE_IPV6) +if grep -q -e "^CONFIG_DISABLE_IPV6 = y$" "$DRV_DIR/Makefile" ; then if echo "net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf; then @@ -29,6 +29,6 @@ if defined(CONFIG_DISABLE_IPV6) else echo "Could not disable IPv6" fi -#endif +fi exit $RESULT diff --git a/dkms-remove.sh b/dkms-remove.sh index a14bb99..40c69b1 100755 --- a/dkms-remove.sh +++ b/dkms-remove.sh @@ -7,7 +7,7 @@ else echo "About to run dkms removal steps..." fi -DRV_DIR='pwd' +DRV_DIR="$(pwd)" DRV_NAME=rtl8812au DRV_VERSION=5.3.4 From 4aeea0a137af3f9436dab5ce779aab443d7b45f5 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 22 May 2019 00:20:33 +0200 Subject: [PATCH 19/20] Another ARM64 RPI: Makefile fix --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c83e878..ac2dd73 100755 --- a/Makefile +++ b/Makefile @@ -1459,7 +1459,7 @@ endif ifeq ($(CONFIG_PLATFORM_ARM64_RPI), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT +EXTRA_CFLAGS += -DRTW_USE_CFG80211_STA_EVENT ARCH ?= arm64 CROSS_COMPILE ?= KVER ?= $(shell uname -r) From 3aeec6f02d17b08d12d22c88ab8172a8e72b1bcc Mon Sep 17 00:00:00 2001 From: kimocoder Date: Wed, 22 May 2019 00:26:27 +0200 Subject: [PATCH 20/20] Radiotap header fix --- core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 12dd0bd..2a1aaf8 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -4424,7 +4424,7 @@ int recv_func(_adapter *padapter, union recv_frame *rframe) if (cnt) RTW_INFO(FUNC_ADPT_FMT" dequeue %d from uc_swdec_pending_queue\n", - FUNC_ADPT_ARG(padapter), cnt); + FUNC_ADPT_ARG(padapter), cnt); } }