From d5aaced9c3f4eb097f4f9248c3d9cbdbb06e8503 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Fri, 22 Jun 2018 21:43:50 +0200 Subject: [PATCH] Optimized Makefile and added DKMS ++ --- Makefile | 11 +++++------ core/rtw_mlme_ext.c | 0 core/rtw_recv.c | 0 dkms-install.sh | 23 +++++++++++++++++++++++ dkms-remove.sh | 24 ++++++++++++++++++++++++ dkms.conf | 6 +++--- hal/btc/halbtc8821cwifionly.c | 0 hal/btc/halbtc8821cwifionly.h | 0 include/drv_conf.h | 0 include/hal_data.h | 0 include/rtl8723b_hal.h | 0 include/rtl8723b_led.h | 0 include/rtl8723b_recv.h | 0 include/rtl8723b_spec.h | 0 include/rtl8723b_xmit.h | 0 include/rtl8814a_cmd.h | 0 include/rtl8814a_hal.h | 0 include/rtl8814a_recv.h | 0 include/rtl8814a_spec.h | 0 include/rtl8814a_xmit.h | 0 include/rtl8821ce_hal.h | 0 include/rtl8822be_hal.h | 0 kimocoder_Changelog.txt | 9 ++++++++- os_dep/linux/ioctl_cfg80211.c | 0 runwpa | 10 +++++----- 25 files changed, 68 insertions(+), 15 deletions(-) mode change 100755 => 100644 core/rtw_mlme_ext.c mode change 100755 => 100644 core/rtw_recv.c create mode 100755 dkms-install.sh create mode 100755 dkms-remove.sh mode change 100755 => 100644 hal/btc/halbtc8821cwifionly.c mode change 100755 => 100644 hal/btc/halbtc8821cwifionly.h mode change 100755 => 100644 include/drv_conf.h mode change 100755 => 100644 include/hal_data.h mode change 100755 => 100644 include/rtl8723b_hal.h mode change 100755 => 100644 include/rtl8723b_led.h mode change 100755 => 100644 include/rtl8723b_recv.h mode change 100755 => 100644 include/rtl8723b_spec.h mode change 100755 => 100644 include/rtl8723b_xmit.h mode change 100755 => 100644 include/rtl8814a_cmd.h mode change 100755 => 100644 include/rtl8814a_hal.h mode change 100755 => 100644 include/rtl8814a_recv.h mode change 100755 => 100644 include/rtl8814a_spec.h mode change 100755 => 100644 include/rtl8814a_xmit.h mode change 100755 => 100644 include/rtl8821ce_hal.h mode change 100755 => 100644 include/rtl8822be_hal.h mode change 100755 => 100644 os_dep/linux/ioctl_cfg80211.c diff --git a/Makefile b/Makefile index e2ab3f0..6388912 100755 --- a/Makefile +++ b/Makefile @@ -452,7 +452,7 @@ endif EXTRA_CFLAGS += -DCONFIG_RTL8821A _HAL_INTFS_FILES += hal/rtl8812a/hal8821a_fw.o - + endif endif @@ -1732,7 +1732,7 @@ ARCH := arm CROSS_COMPILE := /home/android_sdk/Telechips/v13.05_r1-tcc-android-4.2.2_tcc893x-evm_build/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- KSRC := /home/android_sdk/Telechips/v13.05_r1-tcc-android-4.2.2_tcc893x-evm_build/kernel MODULE_NAME := wlan -endif +endif ifeq ($(CONFIG_PLATFORM_RTL8197D), y) EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN -DCONFIG_PLATFORM_RTL8197D @@ -1794,7 +1794,7 @@ rtk_core := core/rtw_cmd.o \ core/rtw_btcoex.o \ core/rtw_beamforming.o \ core/rtw_odm.o \ - core/efuse/rtw_efuse.o + core/efuse/rtw_efuse.o ifeq ($(CONFIG_SDIO_HCI), y) rtk_core += core/rtw_sdio.o @@ -1828,7 +1828,7 @@ export CONFIG_RTL8812AU = m all: modules modules: - $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules + $(MAKE) -j $(shell nproc || echo 1) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules strip: $(CROSS_COMPILE)strip $(MODULE_NAME).ko --strip-unneeded @@ -1890,7 +1890,7 @@ clean: cd hal ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko cd core/efuse ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko cd core ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko - cd os_dep/linux ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko + cd os_dep/linux ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko .rtw_radiotap.o.d cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko cd platform ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order @@ -1898,4 +1898,3 @@ clean: rm -fr .tmp_versions rm -fr .cache.mk endif - diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c old mode 100755 new mode 100644 diff --git a/core/rtw_recv.c b/core/rtw_recv.c old mode 100755 new mode 100644 diff --git a/dkms-install.sh b/dkms-install.sh new file mode 100755 index 0000000..5cfa452 --- /dev/null +++ b/dkms-install.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [[ $EUID -ne 0 ]]; then + echo "You must run this with superuser priviliges. Try \"sudo ./dkms-install.sh\"" 2>&1 + exit 1 +else + echo "About to run dkms install steps..." +fi + +DRV_DIR=rtl8812au +DRV_NAME=rtl8812au +DRV_VERSION=5.2.20 + +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} +dkms install -m ${DRV_NAME} -v ${DRV_VERSION} +RESULT=$? + +echo "Finished running dkms install steps." + +exit $RESULT diff --git a/dkms-remove.sh b/dkms-remove.sh new file mode 100755 index 0000000..d873c30 --- /dev/null +++ b/dkms-remove.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +if [[ $EUID -ne 0 ]]; then + echo "You must run this with superuser priviliges. Try \"sudo ./dkms-remove.sh\"" 2>&1 + exit 1 +else + echo "About to run dkms removal steps..." +fi + +DRV_DIR=rtl8812au +DRV_NAME=rtl8812au +DRV_VERSION=5.2.20 + +dkms remove ${DRV_NAME}/${DRV_VERSION} --all +rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION} + +RESULT=$? +if [[ "$RESULT" != "0" ]]; then + echo "Error occurred while running dkms remove." 2>&1 +else + echo "Finished running dkms removal steps." +fi + +exit $RESULT diff --git a/dkms.conf b/dkms.conf index 1798524..c689e16 100644 --- a/dkms.conf +++ b/dkms.conf @@ -1,10 +1,10 @@ -PACKAGE_NAME="@PKGBASE@" -PACKAGE_VERSION="@PKGVER@" +PACKAGE_NAME="realtek-rtl8812au" +PACKAGE_VERSION="5.2.20~20180622" BUILT_MODULE_NAME[0]="8812au" PROCS_NUM=`nproc` [ $PROCS_NUM -gt 16 ] && PROCS_NUM=16 MAKE="'make' -j$PROCS_NUM KVER=${kernelver} KSRC=/lib/modules/${kernelver}/build" CLEAN="'make' clean" -DEST_MODULE_LOCATION[0]="/updates/dkms" +DEST_MODULE_LOCATION[0]="/updates" AUTOINSTALL="yes" REMAKE_INITRD=no diff --git a/hal/btc/halbtc8821cwifionly.c b/hal/btc/halbtc8821cwifionly.c old mode 100755 new mode 100644 diff --git a/hal/btc/halbtc8821cwifionly.h b/hal/btc/halbtc8821cwifionly.h old mode 100755 new mode 100644 diff --git a/include/drv_conf.h b/include/drv_conf.h old mode 100755 new mode 100644 diff --git a/include/hal_data.h b/include/hal_data.h old mode 100755 new mode 100644 diff --git a/include/rtl8723b_hal.h b/include/rtl8723b_hal.h old mode 100755 new mode 100644 diff --git a/include/rtl8723b_led.h b/include/rtl8723b_led.h old mode 100755 new mode 100644 diff --git a/include/rtl8723b_recv.h b/include/rtl8723b_recv.h old mode 100755 new mode 100644 diff --git a/include/rtl8723b_spec.h b/include/rtl8723b_spec.h old mode 100755 new mode 100644 diff --git a/include/rtl8723b_xmit.h b/include/rtl8723b_xmit.h old mode 100755 new mode 100644 diff --git a/include/rtl8814a_cmd.h b/include/rtl8814a_cmd.h old mode 100755 new mode 100644 diff --git a/include/rtl8814a_hal.h b/include/rtl8814a_hal.h old mode 100755 new mode 100644 diff --git a/include/rtl8814a_recv.h b/include/rtl8814a_recv.h old mode 100755 new mode 100644 diff --git a/include/rtl8814a_spec.h b/include/rtl8814a_spec.h old mode 100755 new mode 100644 diff --git a/include/rtl8814a_xmit.h b/include/rtl8814a_xmit.h old mode 100755 new mode 100644 diff --git a/include/rtl8821ce_hal.h b/include/rtl8821ce_hal.h old mode 100755 new mode 100644 diff --git a/include/rtl8822be_hal.h b/include/rtl8822be_hal.h old mode 100755 new mode 100644 diff --git a/kimocoder_Changelog.txt b/kimocoder_Changelog.txt index 5a526fc..fdf1021 100644 --- a/kimocoder_Changelog.txt +++ b/kimocoder_Changelog.txt @@ -3,7 +3,6 @@ ---------------------------------------------------------------------------------------- TODO: - - Makefile should increase the speed of compilation - Enable TX queue in monitor mode - Place signal quality and per antenna rssi into radiotap header - Calculate signal quality in the monitor mode @@ -19,6 +18,7 @@ - Fix is_compat_task() issue - Use in_compat_syscall() instead of is_compat_task() if available - Add support mode more adapters + - Add a more informational README +++ And propably alot more. We'll see. @@ -29,3 +29,10 @@ - Enabled monitor mode - Parse radiotap headers for proper frame injection - RadioTap iterator from kernel 4.9 was added due to VHT field bug in kernels before 4.6 + - Tweaked & optimized Makefile to compile with all cores available. Decreasing the compile time. + - Fixed dkms.conf and added dkms-install.sh and dkms-remove.sh + - Cleaned up some files & execution permissions. + + + + diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c old mode 100755 new mode 100644 diff --git a/runwpa b/runwpa index f825e8b..7d77dea 100644 --- a/runwpa +++ b/runwpa @@ -1,17 +1,17 @@ #!/bin/bash -if [ "`which iwconfig`" = "" ] ; then +if [ "`which iwconfig`" = "" ] ; then echo "WARNING:Wireless tool not exist!" echo " Please install it!" exit else if [ `uname -r | cut -d. -f2` -eq 4 ]; then - wpa_supplicant -D ipw -c wpa1.conf -i wlan0 + wpa_supplicant -D ipw -c wpa1.conf -i wlan0 else if [ `iwconfig -v |awk '{print $4}' | head -n 1` -lt 18 ] ; then - wpa_supplicant -D ipw -c wpa1.conf -i wlan0 - else - wpa_supplicant -D wext -c wpa1.conf -i wlan0 + wpa_supplicant -D ipw -c wpa1.conf -i wlan0 + else + wpa_supplicant -D wext -c wpa1.conf -i wlan0 fi fi