Add USB WIFI to your system
来源:互联网 发布:js 实现高斯模糊效果 编辑:程序博客网 时间:2024/05/17 22:38
我也要试着在Q7上试验一下
转自http://hi.baidu.com/aokikyon/blog/item/1e16931e675de11440341753.html
编译Android操作系统(2)——添加Wifi支持
Rockie Cheng
Now,zd1211b无线网卡已可使用wpa_supplicant连接无线网络,下一步要让android能够识别无线网卡。
Android默认使用wifi.c加载无线网卡驱动模块,如果直接编译进内核需要做一定修改。
btw:需要内核支持wifi和dhcp
(1)build/target/board/idea6410/BoardConfig.mk
add
# Wifi related defines
BOARD_WPA_SUPPLICANT_DRIVER := WEXT
(2)external/wpa_supplicant/.config
# CONFIG_NO_WPA=y
CONFIG_OS=unix
CONFIG_IEEE8021X_EAPOL=y
CONFIG_EAP_MD5=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_PSK=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_PKCS12=y
CONFIG_SMARTCARD=y
CONFIG_WIRELESS_EXTENSION=y
CONFIG_CTRL_IFACE=y
CONFIG_DRIVER_WEXT=y
it seems there is a problem with driver_wext.c in eclar,so I got one from cupcake.
(3)hardware/libhardware_legacy/wifi/wifi.c
将驱动直接编译进内核
int wifi_load_driver()
{
char driver_status[PROPERTY_VALUE_MAX];
int count = 100; /* wait at most 20 seconds for completion */
LOGE("wifi driver loaded !");
return 0;
}
int wifi_unload_driver()
{
int count = 20; /* wait at most 10 seconds for completion */
LOGE("wifi driver unloaded by rockie!");
return 0;
注意这个定义static const char IFACE_DIR[] = "/data/system/wpa_supplicant";
(4)编译整个android系统,确认编译完bin目录中含有wpa_supplicant、wpa_cli
(5)修改init.rc文件
add
mkdir /data/misc/wifi 0770 system system
mkdir /data/misc/wifi/sockets 0770 system system
mkdir /data/system/wpa_supplicant 0770 system system
chmod 0660 /data/misc/wifi/wpa_supplicant.conf
add at the end
service wpa_supplicant /system/bin/wpa_supplicant -Dwext -iwlan0 -d -c /data/misc/wifi/wpa_supplicant.conf
# user wifi
# group wifi system
socket wpa_eth0 dgram 0660 wifi system
disabled
oneshot
service dhcpcd /system/bin/dhcpcd -f /system/etc/dhcpcd/dhcpcd.conf -d wlan0
disabled
oneshot
on property:init.svc.wpa_supplicant=stopped
stop dhcpcd
(6)添加system/etc/wifi/wpa_supplicant.conf
update_config=1
ctrl_interface=/data/system/wpa_supplicant //这个一定要和IFACE_DIR对应并保证目录权限
eapol_version=1
ap_scan=1
fast_reauth=1
(7)/system/etc/dhcpcd/dhcpcd.conf 文件内容
interface wlan0
option subnet_mask, routers, domain_name_servers
(8)boot and try
存在的问题是无法获取wifi的信号强度
- Add USB WIFI to your system
- Rockie's Android Porting Guide(2)——Add USB WIFI to your system
- add backtrace to your program
- Rockie's Android Porting Guide(3)——Add correct keymap to your system
- Rockie's Android Porting Guide(4)——Add SD card to your system
- Android Build System ---- how to add your product and board config *.mk
- Android Build System ---- how to add your product and board config *.mk
- Android Build System ---- how to add your product and board config *.mk
- Android Build System - how to add your product and board config *.mk[转]
- Rockie's Android Porting Guide(4)——Add SD card to your system
- Android Build System ---- how to add your product and board config *.mk
- Android Build System ---- how to add your product and board config *.mk
- Add logging to your Java applications
- Add crash report to your application (windbg)
- Add accounting periods to your calendar
- Add Talents, Not Skills, to Your Team
- Add accounting periods to your calendar
- Add your own board to Nuttx configuration
- jQuery.validate.js API
- CuteReminder --清华大学 微软中国计算机科学实验班
- StringEscapeUtils.escapeJavaScript(String abc)
- 【连载】优秀程序员的45个习惯之42——允许大家自己想办法
- 用AspNetPager控件最详细的分页实现方法
- Add USB WIFI to your system
- fdopen and socket
- 我对异常的理解_temp1
- 《C专家编程》之C语言的声明
- 105 - The Skyline Problem
- SQL*PLUS命令的使用大全(上)
- netbeans快捷键设置
- DevExpress控件的使用
- 存储过程中的 set ansi_nulls