尊敬的FAE
我有一块客户根据NXP(Freescale)的sabresd_mx6dq设计的开发板,使用的是SDIO接口的
Rtl8189es,OS为Android4.2.2. 在porting过程中遇到了一些问题,急需您的帮助!
驱动:RTL8188EUS_RTL8189ES_linux_v4.1.8_9499.20131104.zip
参考文档:android_ref_codes_JB_4.2/Realtek_Wi-Fi_SDK_for_Android_JB_4_2.pdf
移植过程基本完全参照Realtek_Wi-Fi_SDK_for_Android_JB_4_2.pdf。
编译安卓后烧写固件到开发板中。
在安卓的设置-》Wi-Fi-》移动滑块
现象:滑块变为打开,右侧显示正在打开Wi-Fi…,大约几秒后,滑块重新变为关闭
如果用logcat监视,可见如下信息:
D/WifiService( 2503): setWifiEnabled: true pid=2766, uid=1000
D/BluetoothAdapter( 2766): 1089157384: getState() : mService = null. Returning STATE_OFF
D/WifiHW ( 2503): check_wifi_ifname_from_proc: find lo
D/WifiHW ( 2503): check_wifi_ifname_from_proc: find eth0
D/WifiHW ( 2503): check_wifi_ifname_from_proc: find tunl0
D/WifiHW ( 2503): check_wifi_ifname_from_proc: find sit0
D/WifiHW ( 2503): check_wifi_ifname_from_proc: find ip6tnl0
: 《重复信息》
D/WifiHW ( 2503): check_wifi_ifname_from_proc: find lo
D/WifiHW ( 2503): check_wifi_ifname_from_proc: find eth0
D/WifiHW ( 2503): check_wifi_ifname_from_proc: find tunl0
D/WifiHW ( 2503): check_wifi_ifname_from_proc: find sit0
D/WifiHW ( 2503): check_wifi_ifname_from_proc: find ip6tnl0
E/WifiHW ( 2503): load_driver: get wifi_ifname(PRIMARY) fail
E/WifiStateMachine( 2503): Failed to load driver!
E/WifiStateMachine( 2503): DriverFailedState
D/BluetoothAdapter( 2766): 1089157384: getState() : mService = null. Returning STATE_OFF
串口控制台有如下输出:
RTL871X: module init start version:v4.1.8_9499.20131104
RTL871X: rtl8189es driver version=v4.1.8_9499.20131104
RTL871X: build time: Oct 27 2016 13:15:52
RTL871X: module init ret=0
RTL871X: module exit start
RTL871X: module exit success
从现象来看,在试图打开wifi时,module先被init,且顺利完成(?)
但是因为找不到wlan0和p2p0,导致load_driver: get wifi_ifname(PRIMARY) fail(?)
最终module exit start
这大概是哪里的问题呢?
我曾经试图让printk输出更多信息,但是
cat proc/sys/kernel/printk
输出为
15 4 1 7
这个15很让人费解,但是似乎已经是输出所有信息了。。。
最近又测试了一个更新版本的驱动,错误依旧。
所以现在有些怀疑是不是:
1,硬件连接问题:在和wifi模块厂家确认
2,板文件设置问题?
目前8189es接在了SD2,板文件中定义如下:
static const struct esdhc_platform_data mx6q_sabresd_sd2_data __initconst = {
.cd_gpio = SABRESD_SD2_CD,
.wp_gpio = SABRESD_SD2_WP,
.keep_power_at_suspend = 1,
// change by shao, 2016-09-21, for rtl8189es
//.support_8bit = 1,
.support_8bit = 0,
.delay_line = 0,
.cd_type = ESDHC_CD_CONTROLLER,
.runtime_pm = 1,
};
不知有没有不妥的地方?
wp is not use. you can remove the .wp_gpio = SABRESD_SD2_WP,
非常感谢,我按照您的提示修改如下,
static const struct esdhc_platform_data mx6q_sabresd_sd2_data __initconst = {
//.cd_gpio = SABRESD_SD2_CD,
//.wp_gpio = SABRESD_SD2_WP,
.always_present = 1,
.keep_power_at_suspend = 1,
//change by shao, 2016-09-21, for rtl8189es
//.support_8bit = 1,
.support_8bit = 0,
.delay_line = 0,
//.cd_type = ESDHC_CD_CONTROLLER,
.cd_type = ESDHC_CD_PERMANENT,
//.runtime_pm = 1,
};
错误有了变化,似乎wlan0出现了,但是p2p0还是没有。。。
D/WifiService( 2504): setWifiEnabled: true pid=2797, uid=1000
D/BluetoothAdapter( 2797): 1092990560: getState() : mService = null. Returning STATE_OFF
D/Tethering( 2504): sendTetherStateChangedBroadcast 1, 0, 0
D/Tethering( 2504): InitialState.processMessage what=4
D/Tethering( 2504): sendTetherStateChangedBroadcast 0, 0, 0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find lo
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find eth0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find tunl0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find sit0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find ip6tnl0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find eth1
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find wlan0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find lo
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find eth0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find tunl0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find sit0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find ip6tnl0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find eth1
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find wlan0
D/SoftapController( 2175): Softap fwReload - Ok
D/CommandListener( 2175): Setting iface cfg
D/CommandListener( 2175): Trying to bring down wlan0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find lo
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find eth0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find tunl0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find sit0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find ip6tnl0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find eth1
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find wlan0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find lo
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find eth0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find tunl0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find sit0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find ip6tnl0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find eth1
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find wlan0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find lo
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find eth0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find tunl0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find sit0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find ip6tnl0
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find eth1
D/WifiHW ( 2504): check_wifi_ifname_from_proc: find wlan0
E/WifiHW ( 2504): wifi_start_supplicant get wifi_ifname(SECONDARY) fail
E/WifiStateMachine( 2504): Failed to start supplicant!
W/Netd ( 2175): No subsystem found in netlink event
D/NetlinkEvent( 2175): Unexpected netlink message. type=0x11
D/BluetoothAdapter( 2797): 1092990560: getState() : mService = null. Returning STATE_OFF
This link may useful for you.
(please check the permission in Android)
maybe the name setting here is not match in your system:
WIFI_DRIVER_MODULE_NAME := "wlan"
WIFI_DRIVER_MODULE_PATH := "/system/lib/modules/wlan.ko"
WIFI_DRIVER_MODULE_ARG := "ifname=wlan0 if2name=p2p0"
please check the BoardConfig.mk
我们的BoardConfig.mk定义如下:
WPA_SUPPLICANT_VERSION := VER_0_8_X
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
CONFIG_DRIVER_WEXT := y
#CONFIG_DRIVER_NL80211 :=true
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_rtl
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_rtl
BOARD_WLAN_DEVICE := rtl8189es
WIFI_DRIVER_MODULE_NAME := "8189es"
WIFI_DRIVER_MODULE_PATH := "/system/lib/modules/8189es.ko"
WIFI_DRIVER_MODULE_ARG := "ifname=wlan0 if2name=p2p0"
且我已将make modules得到的8189es.ko放入/system/lib/modules/
另外,如果我选择把8189不编译成ko,而是编译进内核,
logcat有如下错误:
D/WifiService( 2579): setWifiEnabled: true pid=2873, uid=1000
D/BluetoothAdapter( 2873): 1108199328: getState() : mService = null. Returning STATE_OFF
E/WifiStateMachine( 2579): Failed to load driver!
E/WifiStateMachine( 2579): DriverFailedState
D/BluetoothAdapter( 2873): 1108199328: getState() : mService = null. Returning STATE_OFF
从dmesg的输出来看
<4>RTL871X: module init start
<4>RTL871X: rtl8189es v4.3.18.1_15373.20151005
<4>RTL871X: build time: Nov 7 2016 15:17:23
<4>RTL871X: module init ret=0
驱动的版本都已经被识别,应该是驱动被找到了。。。
I found this may useful for you.
android-imx6-kitkat/platform/hardware/realtek.git at master · rabeeh/android-imx6-kitkat · GitHub
Basically, this is realtek driver issue. It is better to consult realtek for the driver solution using in Android.
Jimmy 你好!
我现在也碰到了找不到wlan0的问题,请问你是怎么解决的!
Can you show the full logcat (from the board boot up to this issue occur)?
刚才上传了log,从3098行开始