一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

【原創(chuàng)】調(diào)試ralink 5370 wifi芯片 二

 昵稱14797374 2013-12-10
參考文檔:
http://blog.csdn.net/z642010820/article/details/7341476
http://blog.csdn.net/lanbo_g/article/details/6821840

http://blog.csdn.net/darkengine/article/details/7024459
http://blog./2010/04/porting-wifi-drivers-to-android.html


接下來在android4.0系統(tǒng)上調(diào)試。

1.修改shell為root權(quán)限:
init.rc中修改:
service console /system/bin/sh
console
disabled
user root
group log
這樣shell就有root權(quán)限了

2.

仿造其它設(shè)備的做法,在device/***/****/BoardConfig.mk中添加了以下語句:
BOARD_WPA_SUPPLICANT_DRIVER := NL80211
WPA_SUPPLICANT_VERSION := VER_0_8_X
WIFI_DRIVER_LOAD_DYNAMIC := false
BOARD_HOSTAPD_DRIVER := NL80211
NUFRONT_NUSMART := true
BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_wext_nl80211
BOARD_HOSTAPD_PRIVATE_LIB := lib_driver_cmd_wext_nl80211
BOARD_WLAN_DEVICE := wlan0
WIFI_DRIVER_FW_PATH_STA := "/system/etc/firmware/rt2870_sta.bin"
WIFI_DRIVER_FW_PATH_AP := "/system/etc/firmware/rt2870.bin"

同時按照一篇老外的文檔修改了一些配置,包括hardware下的wifi.c
編譯可以通過,但是啟動系統(tǒng)后,打開wifi時失?。篎ailed to open wlan fw path param
這句話是wifi.c中報出來的,主要是想通過寫驅(qū)動屬性文件fwpath的方法來傳遞firmware.
但是ralink在kernel3.0中自帶的驅(qū)動是沒有這個屬性的.

3.為了簡化調(diào)試,我決定先調(diào)試wifi功能,所以在BoardConfig.mk中去掉了HOSATP相關(guān)的設(shè)置。
 但是無法啟動普通wifi功能,主要報錯如下:
 E/SoftapController(  977): SIOCGIPRIV failed: -1
E/SoftapController(  977): Softap fwReload - failed: -1
E/WifiStateMachine( 1062): Failed to reload STA firmware java.lang.IllegalStateException: Error communicating to native daem
E/WifiConfigStore( 1062): Error parsing configurationjava.io.FileNotFoundException: /data/misc/wifi/ipconfig.txt: open faile)
E/wpa_supplicant( 1951): wpa_driver_nl80211_driver_cmd: failed to issue private commands
E/wpa_supplicant( 1951): wpa_driver_nl80211_driver_cmd: failed to issue private commands
E/wpa_supplicant( 1951): wpa_driver_nl80211_driver_cmd: failed to issue private commands
E/wpa_supplicant( 1951): wpa_driver_nl80211_driver_cmd: failed to issue private commands
E/WifiStateMachine( 1062): Failed to set frequency band 0

4.將wpa_driver_nl80211_driver_cmd函數(shù)入口處直接return 0后,sta模式可以工作,但稍微有點不穩(wěn)定現(xiàn)象。
   接下來嘗試ap模式。
  在frameworks/base/core/res/res/values/config.xml中設(shè)置config_tether_wifi_regexs項,添加<item>wlan0</item>

   驗證了沒有RT2870STA.dat也可以正常工作

  順便驗證了一些使用ap的firmware看sta功能是否可以使用,答案是可以的。但不知道android是否重新load了sta的firmware

5如果按照目前的設(shè)置,ap不成功,報錯如下:
E/SoftapController(  977): SIOCGIPRIV failed: -1
E/SoftapController(  977): Softap fwReload - failed: -1
E/WifiStateMachine( 1062): Exception in softap start java.lang.IllegalStateException: Error communicating to native daemon

6.修改了默認的rt2870.bin為ap的firmware。同時存放了RT2870AP.dat。
  打開了hostapd。
 結(jié)果:失敗 log如下:
 E/WifiHW  (  977): Failed to open wlan fw path param (No such file or directory)
E/SoftapController(  977): Softap fwReload - failed: -1
E/WifiStateMachine(1062): Exception in softap start java.lang.IllegalStateException: Error communicating to native daemon
又驗證了不打開hostapd,也失敗了,失敗信息和第5點一樣。

7.接下來將softapcontroller.cpp中的fw reload函數(shù)直接返回成功,再進行驗證,同時打開了hostapd。
  wifi熱點建立成功了,但是無法連接。
 可能和沒有tethering目標有關(guān)系。

8.打開kernel中的相關(guān)選項后,ubuntu已經(jīng)完美實現(xiàn)Ap功能了,同時可以利用eth0實現(xiàn)tethering.
  但是android中,可以建立ap成功,但是可能由于沒有tethering upstream 接口,所以可以看到AP,但是無法連接上。
  但是ubuntu中沒有upstream也是可以連接上的,難道android必須有upstream才能建立連接嗎?還是說dhcp相關(guān)配置不對?

9.android中dhcp服務(wù)器使用的是dnsmasq。

   在ubuntu下嘗試了dnsmasq,發(fā)現(xiàn)也無法分配地址。
  命令:dnsmasq --conf-file=./etc/dnsmasq.conf
  設(shè)置wlan0 ip為192.168.0.1

   最后發(fā)現(xiàn)是因為dnsmasq.conf配置得不正確,下面是我的正確配置:
  interface=wlan0
bind-interfaces
except-interface=lo
dhcp-range=192.168.0.0,192.168.0.150,12h
dhcp-option=1,255.255.255.0 #subnet mask
dhcp-option=28,192.168.0.255 #broadcast
dhcp-option=3,192.168.0.1 #default gateway
dhcp-option=6,192.168.0.1 #DNS

其中的關(guān)鍵就是dhcp-range要包括從192.168.0.0開始.現(xiàn)在在ubuntu上已經(jīng)可以分配IP了?。?!
如果Dnsmasq配置正確,使用netstat -pan命令可以看到dnsmasq在監(jiān)聽端口67.

10.android的softap連接成功了,也分配了地址。
    我只是在system/netd/softapController.cpp中增加了一些hostapd.conf的設(shè)置:
    asprintf(&wbuf, "interface=%s\ndriver=nl80211\nssid=%s\nchannel=6\nhw_mode=g\nmacaddr_acl=0\nignore_broadcast_ssid=0\nauth_algs=1\n", iface, ssid);
并且打開了hostapd的debug信息。同時去掉了hostapd/android.mk中的#L_CFLAGS += -DANDROID_BRCM_P2P_PATCH。
嘗試了幾次連接后,居然連接成功了。真不知道是哪個改動生效了。成功log如下:
D/hostapd ( 1755): mgmt::assoc_req
D/hostapd ( 1755): association request: STA=00:15:00:16:64:62 capab_info=0x401 listen_interval=10
D/hostapd ( 1755):   new AID 1
D/hostapd ( 1755): nl80211: Set beacon (beacon_set=1)
D/hostapd ( 1755): wpa_driver_nl80211_send_mlme: Sending frame using monitor interface/l2 socket
D/hostapd ( 1755): mgmt::auth cb
D/hostapd ( 1755): mgmt::assoc_resp cb
I/hostapd ( 1755): wlan0: AP-STA-CONNECTED 00:15:00:16:64:62
D/hostapd ( 1755): IEEE 802.1X: Ignore STA - 802.1X not enabled or forced for WPS
D/hostapd ( 1755): nl80211: Event message available
D/hostapd ( 1755): nl80211: New station 00:15:00:16:64:62
D/hostapd ( 1755): wpa_driver_nl80211_send_mlme: Sending frame using monitor interface/l2 socket
D/hostapd ( 1755): wpa_driver_nl80211_send_mlme: Sending frame using monitor interface/l2 socket
[ 3095.000000] phy0 -> rt2x00usb_watchdog_tx_status: Warning - TX queue 2 status timed out, invoke forced tx handler
D/hostapd ( 1755): wpa_driver_nl80211_send_mlme: Sending frame using monitor interface/l2 socket
D/hostapd ( 1755): wpa_driver_nl80211_send_mlme: Sending frame using monitor interface/l2 socket
D/hostapd ( 1755): wpa_driver_nl80211_send_mlme: Sending frame using monitor interface/l2 socket
D/hostapd ( 1755): wpa_driver_nl80211_send_mlme: Sending frame using monitor interface/l2 socket
D/hostapd ( 1755): wpa_driver_nl80211_send_mlme: Sending frame using monitor interface/l2 socket
D/hostapd ( 1755): wpa_driver_nl80211_send_mlme: Sending frame using monitor interface/l2 socket
D/Tethering( 1036): TetherModeAliveState.processMessage what=5
D/Tethering( 1036): chooseUpstreamType(false), preferredApn =5, got type=-1
D/Tethering( 1036): notifying tethered with iface =null
D/Tethering( 1036): TetheredState.processMessage what=12
I/dnsmasq ( 1757): enter dhcp packet!
E/dnsmasq ( 1757): enter dhcp reply!
I/dnsmasq ( 1757): DHCPDISCOVER(wlan0) 192.168.43.99 00:15:00:16:64:62
I/dnsmasq ( 1757): DHCPOFFER(wlan0) 192.168.43.99 00:15:00:16:64:62
I/dnsmasq ( 1757): enter dhcp packet!
E/dnsmasq ( 1757): enter dhcp reply!
I/dnsmasq ( 1757): DHCPREQUEST(wlan0) 192.168.43.99 00:15:00:16:64:62
I/dnsmasq ( 1757): DHCPACK(wlan0) 192.168.43.99 00:15:00:16:64:62 ys-laptop

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多

    日韩综合国产欧美一区| 激情三级在线观看视频| 欧美夫妻性生活一区二区| 亚洲少妇一区二区三区懂色| 神马午夜福利免费视频| 色哟哟在线免费一区二区三区| 国产午夜福利不卡片在线观看| 日本少妇三级三级三级| 九九热这里只有精品视频| 国产精品乱子伦一区二区三区| 国内午夜精品视频在线观看| 国产精品免费视频视频| 91亚洲人人在字幕国产| 黄片免费在线观看日韩| 国产黄色高清内射熟女视频| 国产精品日韩精品一区| 日韩一级毛一欧美一级乱| 夫妻激情视频一区二区三区| 亚洲国产黄色精品在线观看| 视频一区日韩经典中文字幕| 精品日韩av一区二区三区| 亚洲欧美中文日韩综合| 99久久精品一区二区国产| 亚洲视频偷拍福利来袭| 九九热在线免费在线观看| 亚洲综合激情另类专区老铁性| 果冻传媒在线观看免费高清| 精品国产成人av一区二区三区| 日韩三级黄色大片免费观看| 人妻熟女中文字幕在线| 麻豆tv传媒在线观看| 人妻内射精品一区二区| 国产中文另类天堂二区| 日韩专区欧美中文字幕| 日韩18一区二区三区| 一区二区三区亚洲天堂| 日本加勒比中文在线观看| 亚洲欧美日韩在线中文字幕| 一区二区三区国产日韩| 欧美日韩亚洲国产综合网| 亚洲成人精品免费在线观看|