Hi all
Im trying to port RTL8192CU driver to imx6qp sabre board running on android 6.0.1 kernel 4.1.15.
Please advise the steps to be taken.
I am trying to compile the aosp and kernel with rtl8192cu as a module. I edited the imx_v7_android_defconfig file to include
CONFIG_WLAN=y
CONFIG_CFG80211=m
CONFIG_MAC80211_MESH=y
CONFIG_MAC80211=y
CONFIG_HOSTAP=y
CONFIG_RTL8192CU=m
CONFIG_RTLWIFI=y
CONFIG_RTL8192C_COMMON=y
CONFIG_USB_USBNET=y
CONFIG_NET_RADIO=y
But when I try to 'make imx_v7_android_defconfig', the defconfig file doesnt get copied to .config file.
CONFIG_RTL8192CU=m
CONFIG_RTLWIFI=y
CONFIG_RTL8192C_COMMON=y
are missing from the .config file. So the module doesnt get built with the 'make'.
Is there some other file I need to modify to build the module?
But I did make menuconfig and selected the required options and the module got compiled when I built the kernel separately. But again when I build the aosp with make, the kernel config again reverts back and starts building and gives this error.
arch/arm/configs/imx_v7_android_defconfig:148:warning: override: reassigning to symbol NF_NAT_IPV4
arch/arm/configs/imx_v7_android_defconfig:167:warning: override: reassigning to symbol NF_NAT_IPV6
arch/arm/configs/imx_v7_android_defconfig:348:warning: override: reassigning to symbol SENSORS_FXOS8700
arch/arm/configs/imx_v7_android_defconfig:349:warning: override: reassigning to symbol SENSORS_FXAS2100X
arch/arm/configs/imx_v7_android_defconfig:350:warning: override: reassigning to symbol INPUT_MPL3115
arch/arm/configs/imx_v7_android_defconfig:688:warning: override: reassigning to symbol CFG80211
arch/arm/configs/imx_v7_android_defconfig:691:warning: override: reassigning to symbol MAC80211
arch/arm/configs/imx_v7_android_defconfig:698:warning: override: reassigning to symbol USB_USBNET
#
# configuration written to .config
#
make[1]: Leaving directory `/home/jcxmej/Desktop/Tevatron/imx6.0.1/kernel_imx'
install -D kernel_imx/.config out/target/product/sabresd_6dq/.config
make -C kernel_imx -j4 uImage modules ARCH=arm CROSS_COMPILE=`pwd`/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi- LOADADDR=0x10008000 KCFLAGS=-mno-android
make[1]: Entering directory `/home/jcxmej/Desktop/Tevatron/imx6.0.1/kernel_imx'
scripts/kconfig/conf --silentoldconfig Kconfig
make[1]: Leaving directory `/home/jcxmej/Desktop/Tevatron/imx6.0.1/kernel_imx'
make[1]: Entering directory `/home/jcxmej/Desktop/Tevatron/imx6.0.1/kernel_imx'
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
make[2]: `include/generated/mach-types.h' is up to date.
CHK include/generated/bounds.h
CHK include/generated/asm-offsets.h
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
LINK vmlinux
LD vmlinux.o
MODPOST vmlinux.o
WARNING: modpost: Found 4 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
/home/jcxmej/Desktop/Tevatron/imx6.0.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-ld: warning: unwinding may not work because EXIDX input section 8 of arch/arm/crypto/built-in.o is not in EXIDX output section
/home/jcxmej/Desktop/Tevatron/imx6.0.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-ld: warning: unwinding may not work because EXIDX input section 18 of arch/arm/mach-imx/built-in.o is not in EXIDX output section
/home/jcxmej/Desktop/Tevatron/imx6.0.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-ld: warning: unwinding may not work because EXIDX input section 311 of mm/built-in.o is not in EXIDX output section
/home/jcxmej/Desktop/Tevatron/imx6.0.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-ld: warning: unwinding may not work because EXIDX input section 556 of fs/built-in.o is not in EXIDX output section
/home/jcxmej/Desktop/Tevatron/imx6.0.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-ld: warning: unwinding may not work because EXIDX input section 31 of crypto/built-in.o is not in EXIDX output section
/home/jcxmej/Desktop/Tevatron/imx6.0.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-ld: warning: unwinding may not work because EXIDX input section 286 of block/built-in.o is not in EXIDX output section
/home/jcxmej/Desktop/Tevatron/imx6.0.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-ld: warning: unwinding may not work because EXIDX input section 243 of lib/built-in.o is not in EXIDX output section
/home/jcxmej/Desktop/Tevatron/imx6.0.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-ld: warning: unwinding may not work because EXIDX input section 26 of drivers/built-in.o is not in EXIDX output section
/home/jcxmej/Desktop/Tevatron/imx6.0.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-ld: warning: unwinding may not work because EXIDX input section 6 of sound/built-in.o is not in EXIDX output section
/home/jcxmej/Desktop/Tevatron/imx6.0.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-ld: warning: unwinding may not work because EXIDX input section 524 of net/built-in.o is not in EXIDX output section
drivers/built-in.o:wl_cfg80211.c:function wl_cfg80211_disconnect: error: undefined reference to 'cfg80211_disconnected'
drivers/built-in.o:wl_cfg80211.c:function wl_cfg80211_disconnect: error: undefined reference to 'cfg80211_disconnected'
drivers/built-in.o:wl_cfg80211.c:function wl_cfg80211_connect: error: undefined reference to 'ieee80211_frequency_to_channel'
drivers/built-in.o:wl_cfg80211.c:function wl_cfg80211_connect: error: undefined reference to 'ieee80211_frequency_to_channel'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_pfn_status: error: undefined reference to 'cfg80211_disconnected'
drivers/built-in.o:wl_cfg80211.c:function wl_tdls_event_handler: error: undefined reference to 'cfg80211_rx_mgmt'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_mic_status: error: undefined reference to 'cfg80211_michael_mic_failure'
drivers/built-in.o:wl_cfg80211.c:function wl_free_wdev: error: undefined reference to 'wiphy_unregister'
drivers/built-in.o:wl_cfg80211.c:function wl_free_wdev: error: undefined reference to 'wiphy_free'
drivers/built-in.o:wl_cfg80211.c:function wl_run_escan.constprop.17: error: undefined reference to 'ieee80211_frequency_to_channel'
drivers/built-in.o:wl_cfg80211.c:function wl_run_escan.constprop.17: error: undefined reference to 'ieee80211_frequency_to_channel'
drivers/built-in.o:wl_cfg80211.c:function wl_inform_single_bss: error: undefined reference to 'cfg80211_find_ie'
drivers/built-in.o:wl_cfg80211.c:function wl_inform_single_bss: error: undefined reference to 'ieee80211_channel_to_frequency'
drivers/built-in.o:wl_cfg80211.c:function wl_inform_single_bss: error: undefined reference to '__ieee80211_get_channel'
drivers/built-in.o:wl_cfg80211.c:function wl_inform_single_bss: error: undefined reference to 'cfg80211_inform_bss_width_frame'
drivers/built-in.o:wl_cfg80211.c:function wl_inform_single_bss: error: undefined reference to 'cfg80211_put_bss'
drivers/built-in.o:wl_cfg80211.c:function wl_update_bss_info: error: undefined reference to 'cfg80211_get_bss'
drivers/built-in.o:wl_cfg80211.c:function wl_update_bss_info: error: undefined reference to 'cfg80211_put_bss'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_escan_complete: error: undefined reference to 'cfg80211_scan_done'
drivers/built-in.o:wl_cfg80211.c:function wl_cfg80211_mgmt_tx: error: undefined reference to 'cfg80211_mgmt_tx_status'
drivers/built-in.o:wl_cfg80211.c:function wl_cfg80211_mgmt_tx: error: undefined reference to 'cfg80211_mgmt_tx_status'
drivers/built-in.o:wl_cfg80211.c:function wl_cfg80211_mgmt_tx: error: undefined reference to 'cfg80211_mgmt_tx_status'
drivers/built-in.o:wl_cfg80211.c:function wl_bss_connect_done: error: undefined reference to 'cfg80211_connect_result'
drivers/built-in.o:wl_cfg80211.c:function wl_bss_connect_done: error: undefined reference to 'cfg80211_connect_result'
drivers/built-in.o:wl_cfg80211.c:function wl_cfg80211_join_ibss: error: undefined reference to 'cfg80211_get_bss'
drivers/built-in.o:binder.c:function wl_cfg80211_attach: error: undefined reference to 'wiphy_new_nm'
drivers/built-in.o:binder.c:function wl_cfg80211_attach: error: undefined reference to 'wiphy_apply_custom_regulatory'
drivers/built-in.o:binder.c:function wl_cfg80211_attach: error: undefined reference to 'wiphy_register'
drivers/built-in.o:binder.c:function wl_cfg80211_attach: error: undefined reference to 'wiphy_free'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_roaming_status: error: undefined reference to 'ieee80211_channel_to_frequency'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_roaming_status: error: undefined reference to '__ieee80211_get_channel'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_roaming_status: error: undefined reference to 'cfg80211_roamed'
drivers/built-in.o:wl_cfg80211.c:function wl_cfg80211_get_station: error: undefined reference to 'cfg80211_disconnected'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_connect_status_ap: error: undefined reference to 'cfg80211_new_sta'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_connect_status_ap: error: undefined reference to 'cfg80211_del_sta_sinfo'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_connect_status: error: undefined reference to 'ieee80211_channel_to_frequency'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_connect_status: error: undefined reference to '__ieee80211_get_channel'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_connect_status: error: undefined reference to 'cfg80211_ibss_joined'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_connect_status: error: undefined reference to 'cfg80211_get_bss'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_connect_status: error: undefined reference to 'cfg80211_unlink_bss'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_connect_status: error: undefined reference to 'cfg80211_ibss_joined'
drivers/built-in.o:binder.c:function wl_update_wiphybands: error: undefined reference to 'wiphy_apply_custom_regulatory'
drivers/built-in.o:binder.c:function wl_update_wiphybands: error: undefined reference to 'ieee80211_channel_to_frequency'
drivers/built-in.o:binder.c:function wl_cfg80211_down: error: undefined reference to 'cfg80211_scan_done'
drivers/built-in.o:wl_cfg80211.c:function wl_cfg80211_remain_on_channel: error: undefined reference to 'cfg80211_ready_on_channel'
drivers/built-in.o:binder.c:function wl_cfg80211_scan_stop: error: undefined reference to 'cfg80211_scan_done'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_rx_mgmt_frame: error: undefined reference to 'cfg80211_rx_mgmt'
drivers/built-in.o:wl_cfg80211.c:function wl_notify_rx_mgmt_frame: error: undefined reference to 'cfg80211_rx_mgmt'
drivers/built-in.o:binder.c:function wl_chspec_chandef: error: undefined reference to '__ieee80211_get_channel'
drivers/built-in.o:binder.c:function wl_chspec_chandef: error: undefined reference to 'cfg80211_chandef_create'
drivers/built-in.o:binder.c:function wl_cfg80211_ch_switch_notify: error: undefined reference to 'cfg80211_ch_switch_notify'
drivers/built-in.o:binder.c:function wl_cfgp2p_listen_complete: error: undefined reference to 'cfg80211_remain_on_channel_expired'
drivers/built-in.o:binder.c:function wl_cfgp2p_down: error: undefined reference to 'cfg80211_remain_on_channel_expired'
drivers/built-in.o:binder.c:function wl_cfgp2p_del_p2p_disc_if: error: undefined reference to 'cfg80211_unregister_wdev'
drivers/built-in.o:binder.c:function wl_cfgp2p_del_p2p_disc_if: error: undefined reference to 'cfg80211_unregister_wdev'
drivers/built-in.o:wl_cfgvendor.c:function wl_cfgvendor_priv_string_handler: error: undefined reference to '__cfg80211_alloc_reply_skb'
drivers/built-in.o:wl_cfgvendor.c:function wl_cfgvendor_priv_string_handler: error: undefined reference to 'cfg80211_vendor_cmd_reply'
drivers/built-in.o:binder.c:function wl_cfgvendor_send_async_event: error: undefined reference to '__cfg80211_alloc_event_skb'
drivers/built-in.o:binder.c:function wl_cfgvendor_send_async_event: error: undefined reference to '__cfg80211_send_event_skb'
make[1]: *** [vmlinux] Error 1
make[1]: Leaving directory `/home/jcxmej/Desktop/Tevatron/imx6.0.1/kernel_imx'
make: *** [out/target/product/sabresd_6dq/kernel] Error 2
If anyone tell me which all files are needed to be edited and how.
I referred posts about porting rt8192cu but its about previous versions of kernel and android. I tried following those only but Im failing to even compile everything. So can someone update the steps here. Thanks.
已解决! 转到解答。
Hi Jaffin,
First you give make menuconfig . By using this set your WiFi chip as module(CONFIG_RTL8192CU=m). Then you save it.
Now you copy .config into imx_v7_android_defconfig.
Now you can compile. Your WiFi chip build as module only.
Hope above information is helpful for you!
Regards,
Aravinthkumar J
Hi Jaffin,
First you give make menuconfig . By using this set your WiFi chip as module(CONFIG_RTL8192CU=m). Then you save it.
Now you copy .config into imx_v7_android_defconfig.
Now you can compile. Your WiFi chip build as module only.
Hope above information is helpful for you!
Regards,
Aravinthkumar J
Hi
I have installed the driver module in the android system but how do you connect android to it. I have noticed wifi_realtek.c in some posts but I dont have that file in my source. Any idea what should be done?
Hi
I am making it as kernel builtin module. Thats all fine the driver is loaded it is attached to the device. But wifi still doesnt work. Not even from the kernel. I get this error
usb 2-1: new high-speed USB device number 11 using ci_hdrc
usb 2-1: New USB device found, idVendor=0bda, idProduct=8176
usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-1: Product: 802.11n WLAN Adapter
usb 2-1: Manufacturer: Realtek
usb 2-1: SerialNumber: 00e04c000001
type=1400 audit(84339.060:31): avc: denied { create } for pid=24 comm="kdevtmpfs" name="002" scontext=u:r:kernel:s0 tcontext=u:object_r:device:s0 tclass=dir permissive=0
rtl8192cu: Chip version 0x10
rtl8192cu: MAC address: 00:17:7c:22:88:18
rtl8192cu: Board Type 0
rtl_usb: rx_max_size 15360, rx_urb_num 8, in_ep 1
rtl8192cu: Loading firmware rtlwifi/rtl8192cufw_TMSC.bin
usb 2-1: Direct firmware load for rtlwifi/rtl8192cufw_TMSC.bin failed with error -2
usb 2-1: Falling back to user helper
The firmware doesnt load. Also cat /sys/kernel/debug/usb/devices
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 11 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0bda ProdID=8176 Rev= 2.00
S: Manufacturer=Realtek
S: Product=802.11n WLAN Adapter
S: SerialNumber=00e04c000001
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 4 Cls=ff(vend.) Sub=ff Prot=ff Driver=rtl8192cu
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=125us
No wlan0 on ifconfig.
Hi
Like I said I am building as builtin in the kernel. Also since this is not linux, services dont link to the driver directly. But through androids HAL layer. But I am missing the realtek specific HAL. Also I am having issue with the firmware loading of the device. Please tell me how you have done this if you have integrated realtek wifi.
Hi Jaffin,
I did for some other chip.
Just now i checked in kernel. It is default chip. So we can fix it easily.
Can you share what are all the steps you did for wifi?
And also attach you latest bootlog(full log).
Regards,
Aravinth
Thank you for the answer. I did it exactly like you said. I am able to build the kernel like this
$ make menuconfig
$ cp .config arch/arm/imx_v7_android_defconfig
$ make imx_v7_android_defconfig
$ make KCFLAGS=-mno-android
but when I try to build the aosp
$ lunch sabresd_6dq-user
$ make 2>&1 | tee build-log.txt
it gives me this error.
Target build info: out/target/product/sabresd_6dq/system/build.prop
make: *** No rule to make target `kernel_imx/drivers/net/wireless/rtl8188c_8192c_usb/8192cu.ko', needed by `out/target/product/sabresd_6dq/system/lib/modules/8192cu.ko'. Stop.
#### make failed to build some targets (03:42 (mm:ss)) ####
EDIT:
Sorry that was my bad. I messed up my sabresd_6dq.mk.