y52 Posted April 2, 2016 Posted April 2, 2016 The built-in WIFI module doesn't switch to monitor mode. This makes me looking for rebuilding the module from the Git repository: https://github.com/rdm-dev/rtl8189ES_linux/tree/52ee6388111fbaf990ec60e93b086cafa6cc373a I am stuck with the following error: *** No rule to make target 'arch/arm/tools/gen-mach-types', needed by 'include/generated/mach-types.h'. What is necessary to rebuild and replace the module with a new one? Here is what was done so far: root@orangepiplus:/usr/src/rtl8189ES_linux# uname -a Linux orangepiplus 3.4.110-sun8i #18 SMP PREEMPT Tue Mar 8 20:03:32 CET 2016 armv7l GNU/Linux root@orangepiplus:/usr/src/rtl8189ES_linux# dmesg |grep 8189 [ 3.923104] RTL871X: rtl8189es v4.3.0.4_11916.20140724_COB [ 3.923090] RTL871X: module init start [ 3.923104] RTL871X: rtl8189es v4.3.0.4_11916.20140724_COB [ 3.923112] RTL871X: build time: Mar 8 2016 20:02:27 root@orangepiplus:~# lsmod Module Size Used by 8189es 896688 0 root@orangepiplus:~# rmmod 8189es root@orangepiplus:/usr/src/rtl8189ES_linux# ls -al /lib/modules/`uname -r`/ lrwxrwxrwx 1 root root 36 Mar 8 20:03 build -> /usr/src/linux-headers-3.4.110-sun8i root@orangepiplus:/usr/src# svn ls https://github.com/rdm-dev/rtl8189ES_linux/trunk KconfigMakefilecleancore/hal/ifcfg-wlan0import-update.shinclude/os_dep/platform/runwpawlan0dhcp root@orangepiplus:/usr/src# svn export https://github.com/rdm-dev/rtl8189ES_linux/trunk A trunk A trunk/Kconfig A trunk/Makefile A trunk/clean A trunk/core A trunk/core/efuse A trunk/core/efuse/rtw_efuse.c A trunk/core/rtw_ap.c A trunk/hal/efuse A trunk/hal/efuse/efuse_mask.h A trunk/hal/efuse/rtl8188e A trunk/hal/efuse/rtl8188e/HalEfuseMask8188E_PCIE.c A trunk/hal/efuse/rtl8188e/HalEfuseMask8188E_PCIE.h A trunk/hal/phydm/rtl8188e/hal8188ereg.h A trunk/runwpa A trunk/wlan0dhcp Exported revision 6. root@orangepiplus:/usr/src# mv trunk rtl8189ES_linux root@orangepiplus:/usr/src# ls -al rtl8189ES_linux total 112 drwxr-xr-x 7 root root 4096 Apr 2 19:28 . drwxr-xr-x 11 root root 4096 Apr 2 19:30 .. -rw-r--r-- 1 root root 64 Oct 6 21:21 clean drwxr-xr-x 3 root root 4096 Apr 2 19:28 core drwxr-xr-x 8 root root 4096 Apr 2 19:28 hal -rw-r--r-- 1 root root 54 Oct 6 21:21 ifcfg-wlan0 -rwxr-xr-x 1 root root 496 Oct 6 21:21 import-update.sh drwxr-xr-x 4 root root 12288 Apr 2 19:28 include -rw-r--r-- 1 root root 110 Oct 6 21:21 Kconfig -rwxr-xr-x 1 root root 51507 Oct 6 21:21 Makefile drwxr-xr-x 3 root root 4096 Apr 2 19:28 os_dep drwxr-xr-x 2 root root 4096 Apr 2 19:28 platform -rw-r--r-- 1 root root 423 Oct 6 21:21 runwpa -rw-r--r-- 1 root root 294 Oct 6 21:21 wlan0dhcp cd /usr/src/rtl8189ES_linux root@orangepiplus:/usr/src/rtl8189ES_linux# make -C /lib/modules/`uname -r`/build make: Entering directory '/usr/src/linux-headers-3.4.110-sun8i' HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/confscripts/kconfig/conf --silentoldconfig Kconfig CHK include/linux/version.h CHK include/generated/utsrelease.h UPD include/generated/utsrelease.hmake[1]: *** No rule to make target 'arch/arm/tools/gen-mach-types', needed by 'include/generated/mach-types.h'. Stop./usr/src/linux-headers-3.4.110-sun8i/arch/arm/Makefile:278: recipe for target 'archprepare' failedmake: *** [archprepare] Error 2make: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'
Igor Posted April 3, 2016 Posted April 3, 2016 Solution is written in Documentation. How to build a wireless driver ? In new builds it will be even less complicated.
y52 Posted April 3, 2016 Author Posted April 3, 2016 Probably, the question was not in general of how to build any driver, but the given one. For that particular driver, the build doesn't advance with the make stage : root@orangepiplus:/usr/src/rtl8189ES_linux-52ee# make ARCH=arm -C /lib/modules/`uname -r`/buildmake: Entering directory '/usr/src/linux-headers-3.4.110-sun8i' CHK include/linux/version.h CHK include/generated/utsrelease.hmake[1]: *** No rule to make target 'arch/arm/tools/gen-mach-types', needed by 'include/generated/mach-types.h'. Stop./usr/src/linux-headers-3.4.110-sun8i/arch/arm/Makefile:278: recipe for target 'archprepare' failedmake: *** [archprepare] Error 2make: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'
y52 Posted April 4, 2016 Author Posted April 4, 2016 The build is not clear yet, despite that some progress was made.Which of the options is it necessary to enable in the Makefile?CONFIG_80211W = yCONFIG_WIFI_MONITOR = yWhich of the 3 platforms is valid for OPI + ?###################### Platform Related #######################ONFIG_PLATFORM_ARM_SUN7I = yCONFIG_PLATFORM_ARM_SUN8I_W3P1 = nCONFIG_PLATFORM_ARM_SUN8I_W5P1 = nWill this option compile the driver as a module?CONFIG_DRVEXT_MODULE = yBy the same occasion, which is the good option for OPI+ out of the following ?choice[1-2?]: 1Select the wafer with arch sun8i> 1. Allwinner A3x SOCs(sun8iw1) (ARCH_SUN8IW1) (NEW) 2. Allwinner A2x SOCs(sun8iw3) (ARCH_SUN8IW3) (NEW) 3. Allwinner A33 SOCs(sun8iw5) (ARCH_SUN8IW5) (NEW) 4. Allwinner A83 SOCs(sun8iw6) (ARCH_SUN8IW6) (NEW) 5. Allwinner Axx SOCs(sun8w7) (ARCH_SUN8IW7) (NEW) 6. Allwinner V3x SOCs(sun8iw8) (ARCH_SUN8IW8) (NEW) 7. Allwinner Axx SOCs(sun8iw9) (ARCH_SUN8IW9) (NEW)choice[1-7?]: 6I was able to start the build configuration in a strange sequence of 2 commands:1st run :root@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm/mach-sunxi -C /lib/modules/`uname -r`/buildthen run :root@orangepiplus:/usr/src/rtl8189ES_linux-52ee# make -C /lib/modules/`uname -r`/buildThe 1st command will raise an error:root@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm/mach-sunxi -C /lib/modules/`uname -r`/buildmake: Entering directory '/usr/src/linux-headers-3.4.110-sun8i'scripts/kconfig/conf --silentoldconfig Kconfig## configuration written to .config#include/config/auto.conf:42:warning: symbol value 'cubic' invalid for DEFAULT_TCP_CONGinclude/config/auto.conf:43:warning: symbol value '' invalid for UEVENT_HELPER_PATHinclude/config/auto.conf:140:warning: symbol value '/lib/modules/$UNAME_RELEASE/.config' invalid for DEFCONFIG_LISTinclude/config/auto.conf:232:warning: symbol value '(none)' invalid for DEFAULT_HOSTNAMEinclude/config/auto.conf:240:warning: symbol value '' invalid for EXTRA_FIRMWAREinclude/config/auto.conf:374:warning: symbol value '' invalid for LOCALVERSIONinclude/config/auto.conf:378:warning: symbol value '' invalid for CMDLINEinclude/config/auto.conf:442:warning: symbol value 'cfq' invalid for DEFAULT_IOSCHEDinclude/config/auto.conf:479:warning: symbol value '' invalid for DEFAULT_SECURITYinclude/config/auto.conf:526:warning: symbol value '' invalid for CROSS_COMPILE CHK include/linux/version.h CHK include/generated/utsrelease.hmake[1]: *** No rule to make target 'sys_config.o', needed by 'built-in.o'. Stop.Makefile:987: recipe for target 'prepare0' failedmake: *** [prepare0] Error 2make: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'The 2nd will start the build configuration with the long options list :root@orangepiplus:/usr/src/rtl8189ES_linux# make -C /lib/modules/`uname -r`/buildmake: Entering directory '/usr/src/linux-headers-3.4.110-sun8i'scripts/kconfig/conf --silentoldconfig Kconfig** Restart config...*** General setup*Prompt for development and/or incomplete code/drivers (EXPERIMENTAL) [N/y/?] (NEW)....which will finish with error anyway :# configuration written to .config# CHK include/linux/version.h CHK include/generated/utsrelease.hmake[1]: *** No rule to make target 'arch/arm/tools/gen-mach-types', needed by 'include/generated/mach-types.h'. Stop./usr/src/linux-headers-3.4.110-sun8i/arch/arm/Makefile:278: recipe for target 'archprepare' failedmake: *** [archprepare] Error 2make: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'Still no luck. Probably other ideas ?
y52 Posted April 8, 2016 Author Posted April 8, 2016 Hello, To rebuild the rtl8189es driver with the necessary options the platform_ARM_SUNnI_sdio.c from Armbian should be used instead of the one in the rtl8189es sources. The Armbian distribution doesn't contain it. This one belongs to the rtl8189ES sourcesroot@orangepiplus:/usr/src/rtl8189ES_linux# find / -name platform_ARM_SUNnI_sdio.c/usr/src/rtl8189ES_linux/platform/platform_ARM_SUNnI_sdio.cThe distribution headers have only :root@orangepiplus:/usr/src/linux-headers-3.4.110-sun8i/drivers/net/wireless/rtl8189es# ls -altotal 56drwxr-xr-x 2 root root 4096 Apr 7 23:56 .drwxr-xr-x 28 root root 4096 Mar 8 20:10 ..-rwxr-xr-x 1 root root 110 Feb 26 10:41 Kconfig-rwxr-xr-x 1 root root 41465 Feb 26 10:41 Makefile Where in the Armbian Git located and how to extract this only single file from it? Would it be possible in the future versions enabling ########################## Features ########################### CONFIG_WIFI_MONITOR = y in the driver's Makefile features section ?
y52 Posted April 12, 2016 Author Posted April 12, 2016 Jernej from the Orange PI forum helped me to almost rebuild the rtl8189ES driver on the Armbian : http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=1091&page=3#pid11851 The initial setup was somewhat tricky, but finally compilation turned ALMOST successful : root@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm KSRC=/usr/src/linux-headers-3.4.110-sun8imake ARCH=arm CROSS_COMPILE= -C /usr/src/linux-headers-3.4.110-sun8i M=/usr/src/rtl8189ES_linux modulesmake[1]: Entering directory '/usr/src/linux-headers-3.4.110-sun8i' CC [M] /usr/src/rtl8189ES_linux/core/rtw_cmd.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_security.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_debug.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_io.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_ioctl_query.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_ioctl_set.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_ieee80211.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_mlme.o.... CC [M] /usr/src/rtl8189ES_linux/hal/phydm/rtl8188e/halhwimg8188e_rf.o CC [M] /usr/src/rtl8189ES_linux/hal/phydm/rtl8188e/halhwimg8188e_t_fw.o CC [M] /usr/src/rtl8189ES_linux/hal/phydm/rtl8188e/halhwimg8188e_s_fw.o CC [M] /usr/src/rtl8189ES_linux/hal/phydm/rtl8188e/halphyrf_8188e_ce.o CC [M] /usr/src/rtl8189ES_linux/hal/phydm/rtl8188e/phydm_regconfig8188e.o CC [M] /usr/src/rtl8189ES_linux/hal/phydm/rtl8188e/hal8188erateadaptive.o CC [M] /usr/src/rtl8189ES_linux/hal/phydm/rtl8188e/phydm_rtl8188e.o CC [M] /usr/src/rtl8189ES_linux/platform/platform_ops.o CC [M] /usr/src/rtl8189ES_linux/platform/platform_ARM_SUNnI_sdio.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_mp.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_mp_ioctl.o LD [M] /usr/src/rtl8189ES_linux/8189es.o Building modules, stage 2. MODPOST 1 modules/bin/sh: 1: scripts/mod/modpost: not found/usr/src/linux-headers-3.4.110-sun8i/scripts/Makefile.modpost:91: recipe for target '__modpost' failedmake[2]: *** [__modpost] Error 127Makefile:1370: recipe for target 'modules' failedmake[1]: *** [modules] Error 2make[1]: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'Makefile:1635: recipe for target 'modules' failedmake: *** [modules] Error 2This new obscure "makefile.modpost:91: recipe for target '__modpost' failed" keeps me even more frustrated. We tried troubleshooting the the error, but failed. Could you help completing the driver build ?
tkaiser Posted April 12, 2016 Posted April 12, 2016 Could you help completing the driver build ? First step -- make scripts -- outlined in documentation has been done already?
y52 Posted April 13, 2016 Author Posted April 13, 2016 Hello, Your tip almost made the magic, although the grain of salt is discovered after the drive is built. Could the "kernel tainted" be resolved? root@orangepiplus:~# cd /usr/src/linux-headers-$(uname -r)root@orangepiplus:/usr/src/linux-headers-3.4.110-sun8i# make scripts CC scripts/mod/empty.o HOSTCC scripts/mod/mk_elfconfig MKELF scripts/mod/elfconfig.h HOSTCC scripts/mod/file2alias.o HOSTCC scripts/mod/modpost.o HOSTCC scripts/mod/sumversion.o HOSTLD scripts/mod/modpost HOSTCC scripts/kallsyms HOSTCC scripts/conmakehashroot@orangepiplus:/usr/src/linux-headers-3.4.110-sun8i#root@orangepiplus:/usr/src/linux-headers-3.4.110-sun8i# cd /usr/src/rtl8189ES_linux/root@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm KSRC=/usr/src/linux-headers-3.4.110-sun8imake ARCH=arm CROSS_COMPILE= -C /usr/src/linux-headers-3.4.110-sun8i M=/usr/src/rtl8189ES_linux modulesmake[1]: Entering directory '/usr/src/linux-headers-3.4.110-sun8i' Building modules, stage 2. MODPOST 1 modules CC /usr/src/rtl8189ES_linux/8189es.mod.o LD [M] /usr/src/rtl8189ES_linux/8189es.komake[1]: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'root@orangepiplus:/usr/src/rtl8189ES_linux#root@orangepiplus:/usr/src/rtl8189ES_linux# find / -regextype posix-egrep -regex ".*8189.*\.(ko)$"/usr/src/rtl8189ES_linux/8189es.ko/lib/modules/3.4.110-sun8i/kernel/drivers/net/wireless/rtl8189es/8189es.koroot@orangepiplus:/usr/src/rtl8189ES_linux# ls -al /usr/src/rtl8189ES_linux/8189es.ko /lib/modules/3.4.110-sun8i/kernel/drivers/net/wireless/rtl8189es/8189es.ko-rw-r--r-- 1 root root 1210099 Mar 8 20:03 /lib/modules/3.4.110-sun8i/kernel/drivers/net/wireless/rtl8189es/8189es.ko-rw-r--r-- 1 root root 1706532 Apr 13 22:14 /usr/src/rtl8189ES_linux/8189es.koroot@orangepiplus:/usr/src/rtl8189ES_linux# lsmodModule Size Used by8189es 896688 0root@orangepiplus:/usr/src/rtl8189ES_linux# rmmod 8189es root@orangepiplus:/usr/src/rtl8189ES_linux# lsmodModule Size Used by root@orangepiplus:/usr/src/rtl8189ES_linux# insmod 8189es.koinsmod: ERROR: could not insert module 8189es.ko: Invalid module format Apr 13 22:19:00 localhost kernel: [ 6997.745433] 8189es: module_layout: kernel tainted.Apr 13 22:19:00 localhost kernel: [ 6997.745469] Disabling lock debugging due to kernel taint#dmesg [ 6997.745433] 8189es: module_layout: kernel tainted.[ 6997.745469] Disabling lock debugging due to kernel taint[ 6997.745564] 8189es: version magic '3.4.110 mod_unload ARMv7 p2v8 ' should be '3.4.110-sun8i SMP preempt mod_unload modversions ARMv7 p2v8 'root@orangepiplus:~#
y52 Posted April 13, 2016 Author Posted April 13, 2016 root@orangepiplus:~# cat /proc/sys/kernel/tainted2 root@orangepiplus:/usr/src/rtl8189ES_linux# modinfo 8189es.kofilename: /usr/src/rtl8189ES_linux/8189es.koversion: v4.3.18.1_15373.20151005author: Realtek Semiconductor Corp.description: Realtek Wireless Lan Driverlicense: GPLsrcversion: C5DDC3DBBA8AB579D910935alias: sdio:c*v024Cd8179*depends: vermagic: 3.4.110 mod_unload ARMv7 p2v8parm: rtw_ips_mode:The default IPS mode (int)parm: rtw_usb_rxagg_mode:intparm: rtw_qos_opt_enable:intparm: ifname:The default name to allocate for first interface (charp)parm: if2name:The default name to allocate for second interface (charp)parm: rtw_initmac:charpparm: rtw_channel_plan:intparm: rtw_special_rf_path:intparm: rtw_chip_version:intparm: rtw_rfintfs:intparm: rtw_lbkmode:intparm: rtw_network_mode:intparm: rtw_channel:intparm: rtw_mp_mode:intparm: rtw_wmm_enable:intparm: rtw_vrtl_carrier_sense:intparm: rtw_vcs_type:intparm: rtw_busy_thresh:intparm: rtw_ht_enable:intparm: rtw_bw_mode:intparm: rtw_ampdu_enable:intparm: rtw_rx_stbc:intparm: rtw_ampdu_amsdu:intparm: rtw_lowrate_two_xmit:intparm: rtw_rf_config:intparm: rtw_power_mgnt:intparm: rtw_smart_ps:intparm: rtw_low_power:intparm: rtw_wifi_spec:intparm: rtw_antdiv_cfg:intparm: rtw_antdiv_type:intparm: rtw_switch_usb3:intparm: rtw_enusbss:intparm: rtw_hwpdn_mode:intparm: rtw_hwpwrp_detect:intparm: rtw_hw_wps_pbc:intparm: rtw_max_roaming_times:The max roaming times to try (uint)parm: rtw_fw_iol:FW IOL. 0:Disable, 1:enable, 2:by usb speed (int)parm: rtw_mc2u_disable:intparm: rtw_80211d:Enable 802.11d mechanism (int)parm: rtw_notch_filter:0:Disable, 1:Enable, 2:Enable only for P2P (uint)parm: rtw_hiq_filter:0:allow all, 1:allow special, 2:deny all (uint)parm: rtw_adaptivity_en:0:disable, 1:enable (uint)parm: rtw_adaptivity_mode:0:normal, 1:carrier sense (uint)parm: rtw_adaptivity_dml:0:disable, 1:enable (uint)parm: rtw_adaptivity_dc_backoff:DC backoff for Adaptivity (uint)parm: rtw_amplifier_type_2g:BIT3:2G ext-PA, BIT4:2G ext-LNA (uint)parm: rtw_amplifier_type_5g:BIT6:5G ext-PA, BIT7:5G ext-LNA (uint)parm: rtw_RFE_type:default init value:64 (uint)parm: rtw_GLNA_type:default init value:0 (uint)parm: rtw_TxBBSwing_2G:default init value:0xFF (uint)parm: rtw_TxBBSwing_5G:default init value:0xFF (uint)parm: rtw_OffEfuseMask:default open Efuse Mask vaule:0 (uint)parm: rtw_FileMaskEfuse:default drv Mask Efuse vaule:0 (uint)parm: rtw_pll_ref_clk_sel:force pll_ref_clk_sel, 0xF:use autoload value (uint)parm: rtw_tx_pwr_lmt_enable:0:Disable, 1:Enable, 2: Depend on efuse (int)parm: rtw_tx_pwr_by_rate:0:Disable, 1:Enable, 2: Depend on efuse (int)parm: rtw_phy_file_path:The path of phy parameter (charp)parm: rtw_load_phy_file:PHY File Bit Map (int)parm: rtw_decrypt_phy_file:Enable Decrypt PHY File (int)root@orangepiplus:/usr/src/rtl8189ES_linux#
y52 Posted April 17, 2016 Author Posted April 17, 2016 Strange issue. Why the newly built module with the Armbian distribution and the native headers reports the Invalid module format ?I made another clean build disabling the default module in theroot@orangepiplus:/usr/src/rtl8189ES_linux# cat /etc/modules#8189esroot@orangepiplus:/usr/src/rtl8189ES_linux# make cleancd hal/phydm/ ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko...rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.orderrm -fr *.mod.c *.mod *.o .*.cmd *.ko *~rm -fr .tmp_versionsroot@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm KSRC=/usr/src/linux-headers-3.4.110-sun8imake ARCH=arm CROSS_COMPILE= -C /usr/src/linux-headers-3.4.110-sun8i M=/usr/src/rtl8189ES_linux modulesmake[1]: Entering directory '/usr/src/linux-headers-3.4.110-sun8i' CC [M] /usr/src/rtl8189ES_linux/core/rtw_cmd.o,,,C [M] /usr/src/rtl8189ES_linux/hal/led/hal_sdio_led.o CC [M] /usr/src/rtl8189ES_linux/hal/HalPwrSeqCmd.onothing special, except that it builds the 8188e tree: CC [M] /usr/src/rtl8189ES_linux/hal/rtl8188e/Hal8188EPwrSeq.o CC [M] /usr/src/rtl8189ES_linux/hal/rtl8188e/rtl8188e_xmit.o CC [M] /usr/src/rtl8189ES_linux/hal/rtl8188e/rtl8188e_sreset.o CC [M] /usr/src/rtl8189ES_linux/hal/rtl8188e/rtl8188e_hal_init.o CC [M] /usr/src/rtl8189ES_linux/hal/rtl8188e/rtl8188e_phycfg.o CC [M] /usr/src/rtl8189ES_linux/hal/rtl8188e/rtl8188e_rf6052.o CC [M] /usr/src/rtl8189ES_linux/hal/rtl8188e/rtl8188e_dm.o CC [M] /usr/src/rtl8189ES_linux/hal/phydm/rtl8188e/phydm_rtl8188e.o CC [M] /usr/src/rtl8189ES_linux/platform/platform_ops.o CC [M] /usr/src/rtl8189ES_linux/platform/platform_ARM_SUNnI_sdio.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_mp.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_mp_ioctl.o LD [M] /usr/src/rtl8189ES_linux/8189es.o Building modules, stage 2. MODPOST 1 modules CC /usr/src/rtl8189ES_linux/8189es.mod.o LD [M] /usr/src/rtl8189ES_linux/8189es.komake[1]: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'root@orangepiplus:/usr/src/rtl8189ES_linux#root@orangepiplus:/usr/src/rtl8189ES_linux# modinfo 8189es.kofilename: /usr/src/rtl8189ES_linux/8189es.koversion: v4.3.18.1_15373.20151005author: Realtek Semiconductor Corp.description: Realtek Wireless Lan Driverlicense: GPLsrcversion: C5DDC3DBBA8AB579D910935alias: sdio:c*v024Cd8179*depends: vermagic: 3.4.110 mod_unload ARMv7 p2v8parm: rtw_ips_mode:The default IPS mode (int)parm: rtw_usb_rxagg_mode:intparm: rtw_qos_opt_enable:intparm: ifname:The default name to allocate for first interface (charp)parm: if2name:The default name to allocate for second interface (charp)It still doesn't load:root@orangepiplus:/usr/src/rtl8189ES_linux# insmod 8189es.koinsmod: ERROR: could not insert module 8189es.ko: Invalid module format[ 682.251187] 8189es: module_layout: kernel tainted.[ 682.251207] Disabling lock debugging due to kernel taint[ 682.251255] 8189es: version magic '3.4.110 mod_unload ARMv7 p2v8 ' should be '3.4.110-sun8i SMP preempt mod_unload modversions ARMv7 p2v8 '[ 1553.150477] 8189es: version magic '3.4.110 mod_unload ARMv7 p2v8 ' should be '3.4.110-sun8i SMP preempt mod_unload modversions ARMv7 p2v8
y52 Posted April 17, 2016 Author Posted April 17, 2016 Jernej thinks, that inability to load the newly built module is related with the version magic. This means that kernel thinks that module was compiled for different version, which is strange. Neither of us knows much about this magic strings, but at least they should match in kernel version (3.4.110 vs 3.4.110-sun8i). Probably this is a result of crosscompiling. Could you have a look again as I am building on Armbian directly, thus without cross compiling?Jernej uses a kernels which have this check disabled. Alternatively, could you build this module on your setup or let us the Git tree with some of the corrections, so that we could try building on our own? Originally, I looked to rebuild the driver in order to enable the Monitor mode for the OPI+ wifi, which presumably is available in the driver's Makefile : CONFIG_WIFI_MONITOR = y
Eng-Shien Wu Posted April 17, 2016 Posted April 17, 2016 The built-in WIFI module doesn't switch to monitor mode. This makes me looking for rebuilding the module from... Just curious.. what do you intend to use WIFI monitor mode for?
y52 Posted April 18, 2016 Author Posted April 18, 2016 The monitor mode is like the root access to your system. To make the full use of it, you ought to get the full access. Besides, this practical experience will hopefully help building other drivers on the same system.
y52 Posted April 18, 2016 Author Posted April 18, 2016 Apparently, the magic version mismatch could be corrected with the settingEXTRAVERSION =http://linux.die.net/lkmpg/x380.htmlI looked for that setting in the driver's tree, but unable to find it.This setting exists in the# /lib/modules/`uname -r`/build/Makefileand it is empty.As I understand it, this Makefile is the one used for the kernel building, not the module, hence it is not the one to correct.Probably, it is not as complicated to resolve, provided finding out where the above setting is defined. Does anybody could resolve it?
zador.blood.stained Posted April 18, 2016 Posted April 18, 2016 You can try changing CONFIG_LOCALVERSION in /usr/src/linux-headers-3.4.110-sun8i/.config to see if it affects module version magic. Edit: /lib/modules/`uname -r`/build/Makefile is actually /usr/src/linux-headers-3.4.110-sun8i/Makefile, so try setting EXTRAVERSION there. Edit 2: Okay, I made some quick tests. You need to change either .config or Makefile, execute "make" in kernel headers directory (/usr/src/linux-headers-3.4.110-sun8i), it will return error, but it doesn't matter. After that newly compiled modules should have version "3.4.110-sun8i".
y52 Posted April 18, 2016 Author Posted April 18, 2016 This is almost it! I editied the Makefile : root@orangepiplus:/lib/modules/3.4.110-sun8i/build# vi MakefileVERSION = 3PATCHLEVEL = 4SUBLEVEL = 110#EXTRAVERSION =EXTRAVERSION = -sun8i SMP preemptroot@orangepiplus:/lib/modules/3.4.110-sun8i/build# makescripts/kconfig/conf --silentoldconfig Kconfigwarning: (ARCH_SUN8I && ARCH_SUN9I && ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC && MACH_U300) selects PINCTRL which has unmet direct dependencies (EXPERIMENTAL)warning: (ARCH_SUN8I && ARCH_SUN9I && ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC && MACH_U300) selects PINCTRL which has unmet direct dependencies (EXPERIMENTAL) CHK include/linux/version.h CHK include/generated/utsrelease.h UPD include/generated/utsrelease.hmake[1]: *** No rule to make target 'arch/arm/tools/gen-mach-types', needed by 'include/generated/mach-types.h'. Stop./usr/src/linux-headers-3.4.110-sun8i/arch/arm/Makefile:278: recipe for target 'archprepare' failedmake: *** [archprepare] Error 2root@orangepiplus:/lib/modules/3.4.110-sun8i/build# Then I rebuilt the drive in a usual way: root@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm KSRC=/usr/src/linux-headers-3.4.110-sun8i Now root@orangepiplus:/usr/src/rtl8189ES_linux# insmod 8189es.koinsmod: ERROR: could not insert module 8189es.ko: Invalid module format Gives the error:[ 3785.304498] 8189es: version magic '3.4.110-sun8i SMP preempt mod_unload ARMv7 p2v8 ' should be '3.4.110-sun8i SMP preempt mod_unload modversions ARMv7 p2v8 'So, the difference is minimal :'3.4.110-sun8i SMP preempt mod_unload ARMv7 p2v8 ''3.4.110-sun8i SMP preempt mod_unload modversions ARMv7 p2v8 ' This time, I don't know which setting the word "modversions" comes from. More efforts are necessary to resolving it. Pls assist.
y52 Posted April 20, 2016 Author Posted April 20, 2016 Has anybody a solution to build the driver with the correct magic version?
zador.blood.stained Posted April 22, 2016 Posted April 22, 2016 Please try removing kernel headers package, manually deleting /usr/src/linux-headers-3.4.110-sun8i/ directory and installing kernel headers package again. I believe some of your compilation attempts with wrong commands overwrote supplied kernel configuration (in kernel headers directory), which caused all version magic mismatches. If there will be compilation issues after that, go into kernel headers directory, execute "make M=scripts", change directory back and repeat your module compilation.
Igor Posted April 27, 2016 Posted April 27, 2016 http://openlinux.amlogic.com:8000/download/ARM/wifi/rtk8189es-2015-12-15-90ed86d42d.tar.gz I succeed to port this driver to kernel. Client and AP mode works. Some speed tests, for stability ... we need to use it more. [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.1 sec 26.0 MBytes 21.6 Mbits/sec [ 3] 0.0-10.1 sec 23.1 MBytes 19.1 Mbits/sec [ 3] 0.0-10.3 sec 30.5 MBytes 24.9 Mbits/sec
rufik Posted April 27, 2016 Posted April 27, 2016 http://openlinux.amlogic.com:8000/download/ARM/wifi/rtk8189es-2015-12-15-90ed86d42d.tar.gz I succeed to port this driver to kernel. Will it be included into 5.10 release? Because I'm really interested in, current version (v4.3.0.4_11916.20140724_COB) is a crap, I'm getting a lot of RX Packets dropped on OPI 2.
Igor Posted April 27, 2016 Posted April 27, 2016 I just mad very basic tests. Welcome to test it http://mirror.igorpecovnik.com/test/linux-image-sun8i_5.10_armhf.deb v4.3.10.1_13373.20150129 cca. 4% rx package lost on 250Mb download
y52 Posted April 29, 2016 Author Posted April 29, 2016 http://openlinux.aml...ed86d42d.tar.gz>I succeed to port this driver to kernel. This is great news! Have you enabled the monitor mode? What are the guidelines to set it up on the regular Armbian 5.05? Should I build it manually? Welcome to test it http://mirror.igorpe..._5.10_armhf.deb How to implement this package to give it a try?
y52 Posted April 29, 2016 Author Posted April 29, 2016 http://openlinux.aml...ed86d42d.tar.gz>I succeed to port this driver to kernel. I wrote an Armbian 5.05 to the new card, Prepared the scripts: root@orangepiplus:~# cd /usr/src/linux-headers-$(uname -r)root@orangepiplus:/usr/src/linux-headers-3.4.110-sun8i# make scripts Unzipped the sources above and tried building it : root@orangepiplus:/usr/src/rtk8189es-2015-12-15-90ed86d42d/rtl8189ES# make ARCH=arm KSRC=/usr/src/linux-headers-$(uname -r)make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- -C /usr/src/linux-headers-3.4.110-sun8i M=/usr/src/rtk8189es-2015-12-15-90ed86d42d/rtl8189ES modulesmake[1]: Entering directory '/usr/src/linux-headers-3.4.110-sun8i'make[1]: aarch64-linux-gnu-gcc: Command not found CC [M] /usr/src/rtk8189es-2015-12-15-90ed86d42d/rtl8189ES/core/rtw_cmd.o/bin/sh: 1: aarch64-linux-gnu-gcc: not foundscripts/Makefile.build:307: recipe for target '/usr/src/rtk8189es-2015-12-15-90ed86d42d/rtl8189ES/core/rtw_cmd.o' failedmake[2]: *** [/usr/src/rtk8189es-2015-12-15-90ed86d42d/rtl8189ES/core/rtw_cmd.o] Error 127Makefile:1367: recipe for target '_module_/usr/src/rtk8189es-2015-12-15-90ed86d42d/rtl8189ES' failedmake[1]: *** [_module_/usr/src/rtk8189es-2015-12-15-90ed86d42d/rtl8189ES] Error 2make[1]: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'Makefile:1507: recipe for target 'modules' failedmake: *** [modules] Error 2root@orangepiplus:/usr/src/rtk8189es-2015-12-15-90ed86d42d/rtl8189ES# Is there special way deploying it ?
Igor Posted April 30, 2016 Posted April 30, 2016 Unfortunately the second driver, which have monitor mode, I was not able to fix / adopt to kernel. My knowledge is also limited. Some drivers doesn't have simple hot-to-install and here is nothing I can do. The driver and kernel are too far away. Can't tell what to do. If you want to test my build, download and install with su rights: dpkg -i linux-image-sun8i_5.10_armhf.deb
rufik Posted April 30, 2016 Posted April 30, 2016 I just mad very basic tests. Welcome to test it http://mirror.igorpecovnik.com/test/linux-image-sun8i_5.10_armhf.deb v4.3.10.1_13373.20150129 cca. 4% rx package lost on 250Mb download I've installed and it works fine so far. About 2% rx dropped on 2GB download, so not that bad. We'll see yet...
y52 Posted April 30, 2016 Author Posted April 30, 2016 I also installed the linux-image-sun8i_5.10_armhf.deb package. It also updated the kernel to Linux orangepiplus 3.4.111-sun8i #26 SMP PREEMPT Wed Apr 27 19:50:35 CEST 2016 armv7l GNU/Linux The downside for that package, is that the LED turns off after boot. There is no visual indicator for the SBC's working state. Could it be corrected? The wifi module is upgraded to root@orangepiplus:/lib/modules/3.4.111-sun8i/kernel/drivers/net/wireless/rtl8189es# modinfo 8189es.kofilename: /lib/modules/3.4.111-sun8i/kernel/drivers/net/wireless/rtl8189es/8189es.koversion: v4.3.10.1_13373.20150129 but regretfully, the MONITOR MODE is not enabled. How could a speed and stability be initiated to evaluate them?
Igor Posted April 30, 2016 Posted April 30, 2016 but regretfully, the MONITOR MODE is not enabled. This driver does not have this option. How could a speed and stability be initiated to evaluate them? Stability with some longer usage, speed with iperf or similar.
y52 Posted April 30, 2016 Author Posted April 30, 2016 I was preparing to rebuild the '52ee6388111fbaf990ec60e93b086cafa6cc373a' commit where the CONFIG_WIFI_MONITOR = y on the linux-image-sun8i_5.10_armhf.deb package It missed the headers: root@orangepiplus:/usr/src/rtl8189ES_linux/platform# ls -al /usr/src/linux-headers-$(uname -r)ls: cannot access /usr/src/linux-headers-3.4.111-sun8i: No such file or directory Could you create the headers for your build and post the pakage? Will you correct the LED issue?
tkaiser Posted April 30, 2016 Posted April 30, 2016 Will you correct the LED issue? We exchanged the definition of both leds a while ago so that it matches with the way OpenELEC does (green == active, red reserved for 1st boot signaling or maybe in future for 'suspend to RAM'). So by choosing a new 5.10 image everything will be fine and by exchanging only some parts (u-boot, kernel, armhwinfo script) things will get messed up.
y52 Posted April 30, 2016 Author Posted April 30, 2016 I have been able rebuilding conveniently the 8189es driver on the regular Armbian 5.05 from the '52ee6388111fbaf990ec60e93b086cafa6cc373a' commit where the CONFIG_WIFI_MONITOR = y The build went smoothly after replacing the platform_ARM_SUNnI_sdio.c in the driver's platform directory with the one from : https://github.com/loboris/OrangePI-Kernel/blob/master/linux-3.4/drivers/net/wireless/rtl8189es/platform/platform_ARM_SUNnI_sdio.c Then root@orangepiplus:/usr/src/rtl8189ES_linux# make ARCH=arm KSRC=/usr/src/linux-headers-$(uname -r)make ARCH=arm CROSS_COMPILE= -C /usr/src/linux-headers-3.4.110-sun8i M=/usr/src/rtl8189ES_linux modulesmake[1]: Entering directory '/usr/src/linux-headers-3.4.110-sun8i' CC [M] /usr/src/rtl8189ES_linux/core/rtw_cmd.o... CC [M] /usr/src/rtl8189ES_linux/hal/phydm/rtl8188e/hal8188erateadaptive.o CC [M] /usr/src/rtl8189ES_linux/hal/phydm/rtl8188e/phydm_rtl8188e.o CC [M] /usr/src/rtl8189ES_linux/platform/platform_ops.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_mp.o CC [M] /usr/src/rtl8189ES_linux/core/rtw_mp_ioctl.o LD [M] /usr/src/rtl8189ES_linux/8189es.o Building modules, stage 2. MODPOST 1 modules CC /usr/src/rtl8189ES_linux/8189es.mod.o LD [M] /usr/src/rtl8189ES_linux/8189es.komake[1]: Leaving directory '/usr/src/linux-headers-3.4.110-sun8i'root@orangepiplus:/usr/src/rtl8189ES_linux# Looking at the info from : root@orangepiplus:/usr/src/rtl8189ES_linux# lsmod 8189es.koUsage: lsmodroot@orangepiplus:/usr/src/rtl8189ES_linux# modinfo 8189es.kofilename: /usr/src/rtl8189ES_linux/8189es.koversion: v4.3.18.1_15373.20151005author: Realtek Semiconductor Corp.description: Realtek Wireless Lan Driverlicense: GPLsrcversion: 374911DC5AF9842313AEAA0alias: sdio:c*v024Cd8179*depends: vermagic: 3.4.110-sun8i SMP preempt mod_unload modversions ARMv7 p2v8 This driver is more recent, than the one provided by Igor Posted 27 April 2016 - 06:25 PM root@orangepiplus:/lib/modules/3.4.111-sun8i/kernel/drivers/net/wireless/rtl8189es# modinfo 8189es.kofilename: /lib/modules/3.4.111-sun8i/kernel/drivers/net/wireless/rtl8189es/8189es.koversion: v4.3.10.1_13373.20150129 Probably this is the reason, that the CONFIG_WIFI_MONITOR = y was not present in the v4.3.10.1_13373.20150129 Taken that knowledge, would it be possible porting the version: v4.3.18.1_15373.20151005 to the kernel. The magic version matches the kernel well now and the module loads without errors: The regular module with the Armbian 5.05: root@orangepiplus:/usr/src/rtl8189ES_linux# lsmodModule Size Used by8189es 896688 0root@orangepiplus:/usr/src/rtl8189ES_linux# rmmod 8189es Custom built module:root@orangepiplus:/usr/src/rtl8189ES_linux# insmod 8189es.koroot@orangepiplus:/usr/src/rtl8189ES_linux# lsmodModule Size Used by8189es 1212556 0 How to replace the regular module with the custom one, so that to load it on the system boot up? How the iperf could be used for testing the speed ?
Recommended Posts