2. 模块概述
目前R16 android4.4 平台上已支持wifi 模组有5款,本文档将以R16 y3方案为例
说明如何配置每款wifi 模组。Rtl8723au暂不支持
wifi 模组可分USB 接口和SDIO 接口两种类型,部分模组带蓝牙和FM 功能(FM 功能尚未支持),wifi 的全功能包括station、softap 和wifi direct,其中station 是wifi 的最基本功能,每款wifi 模组均支持。
android4.4 平台wifi 模组列表
注意:
1、内核默认编译所有的realtek wifi 驱动,在确定使用哪一款wifi 的情况下可把其余的去掉,不参与编译,这样可减少最终生成的固件大小,减少烧写时间。
(进入linux-3.4 目录,输入make ARCH=arm menuconfig,然后选择Device Drivers--->Network device support,即可看到参与编译的wifi 驱动
2、内核默认编译蓝牙,如果实际平台没有蓝牙功能,可以去除编译,减少生成的内核大小,修改方法如下。
到linux-3.4 目录下,输入make ARCH=arm menuconfig
然后选择[*] Networking support --->
< > Bluetooth subsystem support --->
.......
< > RF switch subsystem support --->
3. 模组移植
3.1. ap6181
功能:wifi station、softap、wifi direct
接口类型:SDIO
编译模式:编成模块方式,修改路径如下
进入 linux-3.4 目录,输入 make ARCH=arm menuconfig
然后选择Device Drivers --->
Network device support --->
Wireless LAN --->
Broadcom 4329/30 wireless cards support
(/system/vendor/modules/fw_bcmxxxx.bin) Firmware path
(/system/vendor/modules/nvram_apxxxx.txt) NVRAM path
Interrupt type (Out-of-Band Interrupt) --->
3.1.1. BoardConfig.mk
android4.4\device\softwinner\astar-y3\
BoardConfig.mk 文件决定android 加载哪一款wifi 模组, 要配置成使用ap6181 模组需要把BoardConfig.mk 文件的相关代码修改成如下。
# wifi and bt configuration
# 1. Wifi Configuration
# 1.1 realtek wifi support
#BOARD_WIFI_VENDOR := realtek
ifeq ($(BOARD_WIFI_VENDOR), realtek)
......
......
endif
# 1.2 broadcom wifi support
BOARD_WIFI_VENDOR := broadcom
ifeq ($(BOARD_WIFI_VENDOR), broadcom)
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
WPA_SUPPLICANT_VERSION := VER_0_8_X
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_bcmdhd
BOARD_HOSTAPD_DRIVER := NL80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_bcmdhd
BOARD_WLAN_DEVICE := bcmdhd
WIFI_DRIVER_FW_PATH_PARAM :=
"/sys/module/bcmdhd/parameters/firmware_path"
SW_BOARD_USR_WIFI := AP6181
#SW_BOARD_USR_WIFI := AP6210
WIFI_DRIVER_FW_PATH_STA := "/system/vendor/modules/fw_bcm40181a2.bin"
WIFI_DRIVER_FW_PATH_P2P :=
"/system/vendor/modules/fw_bcm40181a2_p2p.bin"
WIFI_DRIVER_FW_PATH_AP :=
"/system/vendor/modules/fw_bcm40181a2_apsta.bin"
endif
说明:
1、“#”符号起注释作用;
2、“#BOARD_WIFI_VENDOR := realtek”指明不使用realtek 系统wifi 模组;
3、“BOARD_WIFI_VENDOR := broadcom”指明使用broadcom 系统wifi 模组;
4、“WIFI_DRIVER_FW_PATH_STA”、“WIFI_DRIVER_FW_PATH_P2P”、“WIFI_DRIVER_FW_PATH_AP”宏指固件路径;
5、对于 broadcom 系列模组,“SW_BOARD_USR_WIFI”宏只起标识用,无实际用处;
3.1.2. init.sun8i.rc
android4.4\device\softwinner\astar-y3\
init.sun8i.rc 是资源和服务配置相关的文件,使用 ap6181 wifi 模组需要作如下修改(部分代码)。
insmod /system/vendor/modules/bcmdhd.ko
......
# 2. broadcom wifi service
# 2.1 broadcom wifi station and softap
service wpa_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-I/system/etc/wifi/wpa_supplicant_overlay.conf \
-O/data/misc/wifi/sockets \
-e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
# 2.2 braodcom wifi sta p2p concurrent service
service p2p_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
-I/system/etc/wifi/wpa_supplicant_overlay.conf \
-O/data/misc/wifi/sockets -N \
-ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
-I/system/etc/wifi/p2p_supplicant_overlay.conf \
-puse_p2p_group_interface=1 -e/data/misc/wifi/entropy.bin \
-g@android:wpa_wlan0
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
注意:
1、init.sun8i.rc 文件加载bcm wifi驱动bcmdhd.ko,指定开启wpa_supplicant 和p2p_supplicant 两个服务;
2、需要确定 realtek 对应的 wpa_supplicant 和 p2p_supplicant 两个服务被注释掉