移植wifi驱动MX53平台
配置内核支持8686wifi
选上Networking support->wireless->cfg80211 – wireless configuration API
选上Device Drivers->Network device support->Wireless LAN->Marvell 8xxx Libertas WLAN driver support->Marvell Libertas 8385/8686/8688 SDIO 802.11b/g cards
修改hardware\libhardware_legacy\wifi\wifi.c
//#define WIFI_TEST_INTERFACE "sta"
#define WIFI_TEST_INTERFACE "wlan0"
在rmmod函数中直接返回,如下代码:
static int rmmod(const char *modname)
{
int ret = -1;
int maxtry = 10;
return 0;
…...
}
配置wpa_supplicant的驱动Z:\myandroid\device\fsl\imx53_smd\BoardConfig.mk
#---------------------------------------------------------------
#WIFI_DRIVER_MODULE_NAME := "ar6000"
#WPA_SUPPLICANT_VERSION := VER_0_6_ATHEROS
#BOARD_WLAN_ATHEROS_SDK := system/wlan/atheros/AR6kSDK
#WPA_SUPPLICANT_VERSION := VER_0_6_ATHEROS
#BOARD_WPA_SUPPLICANT_DRIVER := AR6000
BOARD_WLAN_CHIP_AR6102 := false
BOARD_WLAN_CHIP_AR6003 := false
#BOARD_WPA_SUPPLICANT_DRIVER := WEXT
# Select Wake on wireless mode for AR6003 suspend/resume policy
#BOARD_WLAN_PM_SUSPEND := 2
WIFI_DRIVER_MODULE_NAME := "libertas_sdio"
WIFI_DRIVER_MODULE_PATH := "/system/lib/modules/libertas_sdio.ko"
BOARD_WIFI_LIBRARIES := true
BOARD_WPA_SUPPLICANT_DRIVER := WEXT
WPA_BUILD_SUPPLICANT := true
WPA_SUPPLICANT_VERSION := VER_0_5_X
#-----------------------------------------------------------------
修改wpa_supplicant.conf
把external/wpa_supplicant/wpa_supplicant.conf拷贝到/system/etc/wifi/目录下,
并把:ctrl_interface=DIR=/data/misc/wifi/wpa_supplicant GROUP=wifi
改为: ctrl_interface= /data/system/wpa_supplicant //这个一定要和IFACE_DIR对应并保证目录权限
配置路径和权限:\myandroid\device\fsl\imx5x\init.rc
# give system access to wpa_supplicant.conf for backup and restore
#--------------------------------------------
mkdir /system/etc/wifi 0777 wifi wifi
chmod 0777 /system/etc/wifi
chmod 0777 /system/etc/wifi/wpa_supplicant.conf
chown wifi wifi /system/etc/wifi/wpa_supplicant.conf
mkdir /data/misc/wifi 0777 wifi wifi
mkdir /data/misc/wifi/sockets 0777 wifi wifi
chmod 0777 /data/misc/wifi
chown wifi wifi /data/misc/wifi/wpa_supplicant.conf
chown wifi wifi /data/misc/wifi
chmod 0666 /data/misc/wifi/wpa_supplicant.conf
mkdir /data/system/wpa_supplicant
chmod 0777 /data/system/wpa_supplicant
chown wifi system /data/system/wpa_supplicant
#--------------------------------------------
# Prepare for wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
setprop wifi.interface wlan0
setprop wlan.interface wlan0
修改\myandroid\device\fsl\imx53_smd\init.rc
注释掉原有的:
#service wpa_supplicant /system/bin/wlan_tool wpa_supplicant
# socket wpa_wlan0 dgram 660 root wifi
# disabled
# oneshot
#service wlan_tool /system/bin/wlan_tool
# oneshot
加入以下语句:
#------------------------------------------------------------------------------------------------------------------------
service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0 -c /data/misc/wifi/wpa_supplicant.conf
socket wpa_wlan0 dgram 0666 wifi wifi
disabled
oneshot
service dhcpcd /system/bin/logwrapper /system/bin/dhcpcd -o domain_name_servers -ABKL
disabled
oneshot
group system dhcp
on property:init.svc.wpa_supplicant=stopped
stop dhcpcd
#------------------------------------------------------------------------------------------------------------------------
提供固件firmware
Android不使用标准的hotplug binary,WIFI需要的firmware要复制到/etc/firmware。 或者复制到WIFI驱动指定的位置,然后WIFI驱动会自动加载.
在此把wifi模块提供的sd8686.bin sd8686_helper.bin放到/system/etc/firmware目录下。
This is the solution,I get my wifi worked successfully.
Hello danzhou,
I've follow your guide but it didn't work. May I have some questions
1> What kernel linux which you're using ?
2> What is libertas firmware version ?
When turning on the WIFI, the wpa_supplicant said not support wext driver, have we to modify this driver ?
Many thanks for your help.
Ok,
Here is my experiment, hope it's useful for everyone.
Cheer.