【記憶】 Real6410 Android 2.1 的 WiFi (不是100%成功)

 

 

http://www.realarm.cn/bbs/dv_rss.asp?s=xhtml&boardid=7&id=161&page=1&star=1&count=3

1樓
linuxbaba 發表於:2010-5-19 0:00:53
 1. 從這裡下載固件

    http://extranet.marvell.com/drivers/driverDisplay.do?driverId=203

    26409.p45-GPL 是為 Linux內核 2.6

    解壓它,你會發現兩個文件 helper_sd.bin 和 sd8686.bin.

    重新命名 helper_sd.bin 至 sd8686_helper.bin (不要問為什麼名稱不同)

2. 你有兩個選擇使用sd8686的WiFi,你可以把sd8686_helper.bin和sd8686.bin放到內核或把它放在文件系統中。

這是內核模式或模塊的模式。據我而言,我把它放到內核,因為我仍然有NAND空間為zImage。

#make xconfig

Device Drivers  --->
   Generic Driver Options  --->
   ()  External firmware blobs to build into the kernel binary
   ()  Firmware blobs root directory

設置“External firmware blobs” = "sd8686_helper.bin sd8686.bin"
設置"Firmware blobs root directory" = "firmware"
把這些文sd8686_helper.bin,sd8686.bin件放在firmware中

這是.config配置文件,還有一些配置請看看Real6410 Android 2.0使用手?V1.2.
.....
#
# Device Drivers
#

#
# Generic Driver Options
#
C
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
CONFIG_FIRMWARE_IN_KERNEL=y
C
C
# CONFIG_DEBUG_DRIVER is not set
# CONFIG_DEBUG_DEVRES is not set
.....

這是目錄
.....
drwxr-xr-x  3 root root     4096 2010-05-17 14:24 crypto
drwxr-xr-x 82 root root     4096 2010-01-20 20:27 Documentation
drwxr-xr-x 84 root root     4096 2010-05-17 18:14 drivers
drwxr-xr-x 18 root root     4096 2010-05-17 18:06 firmware
drwxr-xr-x 63 root root    12288 2010-05-17 14:26 fs
drwxr-xr-x 28 root root     4096 2010-05-17 18:14 include
drwxr-xr-x  2 root root     4096 2010-05-17 18:14 init
drwxr-xr-x  2 root root     4096 2010-05-17 14:23 ipc
-rw-r--r--  1 root root     2430 2009-12-12 13:18 Kbuild
drwxr-xr-x  6 root root    12288 2010-05-17 14:23 kernel
drwxr-xr-x  6 root root    12288 2010-05-17 18:07 lib
-rw-r--r--  1 root root   106036 2009-12-12 13:18 MAINTAINERS
-rwxr-xr-x  1 root root    57211 2010-02-25 14:48 Makefile
....

現在可以建立內核

#make -j2 sdk

3. Android使用一個修改過的wpa_supplicant為 WiFi支持,您需要啟用wpa_supplicant. 打開BoardConfig.ml加上一行代碼:

BOARD_WPA_SUPPLICANT_DRIVER := WEXT


4. 您還可以啟用Debug為wpa_supplicant看更多一點信息
在external/wpa_supplicant/common.c 改變 wpa_debug_level = MSG_DEBUG
在external/wpa_supplicant/common.h 改變 ....if ((level) >= MSG_INFO) 至 if ((level) >= MSG_DEBUG)

5 創建配置文件 /Android-2.1/system/core/rootdir/etc/wifi/wpa_supplicant.conf 它會複製到 /system/etc/wifi/wpa_supplicant.conf

ctrl_interface=eth1
update_config=1
 
6. 添加路徑,權限和服務 init.rc (如果權限有問題,自己改改)

mkdir /system/etc/wifi 0770 wifi wifi
chmod 0770 /system/etc/wifi
chmod 0660 /system/etc/wifi/wpa_supplicant.conf
chown wifi wifi /system/etc/wifi/wpa_supplicant.conf
mkdir /data/misc/wifi 0770 wifi wifi
mkdir /data/misc/wifi/sockets 0770 wifi wifi
chmod 0770 /data/misc/wifi
chmod 0660 /data/misc/wifi/wpa_supplicant.conf
chown wifi wifi /data/misc/wifi
chown wifi wifi /data/misc/wifi/wpa_supplicant.conf
....
on boot
# basic network init
    ifup lo
    ifup eth0
    setprop net.dns1 202.14.67.4
    setprop net.dns2 202.14.67.1
    hostname localhost
    domainname localdomain

# for wifi
    setprop wifi.interface "eth1"
    setprop wlan.driver.status "ok"
    setprop wlan.interface "eth1"
    # setprop wlan.modpath /system/lib
    # setprop wlan.mod1 libertas_sdio.ko

# set RLIMIT_NICE to allow priorities from 19 to -20
    setrlimit 13 40 40

....
service wpa_supplicant /system/bin/wpa_supplicant -dd -Dwext -ieth1 -c /system/etc/wifi/wpa_supplicant.conf
    socket wpa_wlan0 dgram 660 wifi wifi
    group system wifi inet
    disabled
    oneshot
service dhcpcd /system/bin/dhcpcd -f /system/etc/dhcpcd/dhcpcd.conf -d eth1
   group system dhcp
   disabled
   oneshot
   
7. 這是因為我使用的內核模式下,我需要禁用insmod()和rmmod(),因為Android UI 打開Wifi和關閉Wifi將使用它:
   /libhardware_legacy/wifi/wifi.c
....
   static int insmod(const char *filename, const char *args)
{
/* for kernel mode wifi */
    return 0;
    void *module;
    unsigned int size;
    int ret;
    module = load_file(filename, &size);
    if (!module)
        return -1;

    ret = init_module(module, size, args);
.....
.....
static int rmmod(const char *modname)
{
/* for kernel mode  */
    return 0;

    int ret = -1;
    int maxtry = 10;
.....
....
8. 如果你想手動做試驗,這兩個命令可以幫助你, 用strace看看wpa_supplicant有或沒有問題
   #strace /system/bin/wpa_supplicant -dd -Dwext -ieth1 -c /system/etc/wifi/wpa_supplicant.conf
   果你沒有問題你可以:
   #/system/bin/wpa_supplicant -dd -Dwext -ieth1 -c /system/etc/wifi/wpa_supplicant.conf&
   這個互動式的命令:
   /system/bin/wpa_cli -i eth1 -p /data/system/wpa_supplicant

9. 未解決的問題:
   A. 我的AP遠離我的Real6410,我還沒有測試DHCP. 告訴我如果你成功啟用DHCP
   B. 如果您發現Unable to scan for network錯誤信息,也許搜索速度的問題, 您可以在...
      /packages/apps/Setting/src/com/android/settings/wifi/WifiLayer.java
      的SCAN_MAX_RETRY由5修改多一點10,15,20...
   C.WifiLayer.java的"Ignore enterprise-secured"問題
[此貼子已經被作者於2010-5-19 19:25:30編輯過]
2樓
wangtianxu 發表於:2010-5-19 0:29:07
well done!
3樓
Figo 發表於:2010-5-19 9:19:46
非常感謝linuxbaba的分享
4樓
jackking0204 發表於:2010-5-20 3:49:49
感謝linuxbaba的分享讓我對於porting 驅動有更進一步的瞭解最近在安裝eclipse和SDK準備來撰寫APP porting還是一樣苦手~>"<
5樓
blackdream2 發表於:2010-5-21 19:22:07

我沒有將 firmware編譯在內核中 每次加載firmware都失敗:

libertas_sdio: Copyright Pierre Ossman
libertas_sdio:  func->card->info Marvell
libertas_sdio:  func->card->info 802.11 SDIO ID: 0B
lbs_helper_name /etc/firmware/sd8686_helper.bin
lbs_fw_name /etc/firmware/sd8686_helper.bin
bf if_sdio_prog_helper
libertas_sdio mmc0:0001:1: firmware: requesting /etc/firmware/sd8686_helper.bin
init: untracked pid 2130 exited
libertas: can't load helper firmware
can't load helper firmware
libertas: failed to load helper firmware
libertas_sdio: probe of mmc0:0001:1 failed with error -2

 

有誰遇到過嗎?

6樓
linuxbaba 發表於:2010-5-21 22:55:46
 我還沒有嘗試這Module Load. 但,你有沒有Boot log?讓我看看

 

標題:Real6410 Android 2.1 的 WiFi (不是100%成功) [助人自助]

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章