|  | 
 
| x4412 linux3.0.15平台WIFI测试方法 
 一:加载WIFI驱动
 insmod /lib/modules/wlan.ko
 wlan.ko见附件,注意,USB wifi支持80211和wext两种规范,rt8188eus有多个驱动版本,请使用支持wext较好的
 
 驱动!
 
 二:给WIFI设置IP,确定IP在自己的网段:
 ifconfig wlan0 192.168.0.123 up
 
 三:在/etc目录下,修改wpa_supplicant.conf文件:
 默认内容为:
 # WPA-PSK/TKIP
 
 ctrl_interface=/var/run/wpa_supplicant
 
 network={
 ssid="armeasy"
 scan_ssid=1
 key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
 pairwise=TKIP CCMP
 group=CCMP TKIP WEP104 WEP40
 psk="63638485"
 }
 注意,这里ssid表示WIFI名称,psk表示WIFI密码,请填写自己对应的名称和密码。
 
 四:建立工作目录
 mkdir –p /var/run/wpa_supplicant
 
 五:执行如下指令:
 wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant.conf &
 如加载成功,会有如下打印:
 [root@x4412 mnt]# wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant.conf &
 [root@x4412 mnt]# Successfully initialized wpa_supplicant
 
 [root@x4412 mnt]# [   83.964879] RTL871X: [rtw_wx_set_pmkid] IW_PMKSA_FLUSH!
 [   83.968793] RTL871X: _rtw_pwr_wakeup call ips_leave....
 [   83.973917] RTL871X: ==>ips_leave cnts:1
 [   83.977798] RTL871X: ===>  rtw_ips_pwr_up..............
 [   83.983008] RTL871X: ===> ips_netdrv_open.........
 [   83.992341] RTL871X: rtl8188e_FirmwareDownload: fw_ver=11 fw_subver=1 sig=0x88e1
 [   84.017714] RTL871X: _FWFreeToGo: Checksum report OK! REG_MCUFWDL:0x00030004
 [   84.023962] RTL871X: =====> _8051Reset88E(): 8051 reset success .
 [   84.029588] RTL871X: _FWFreeToGo: Polling FW ready success!! REG_MCUFWDL:0x000300c6
 [   84.156214] ==> rtl8188e_iol_efuse_patch
 [   84.192752] RTL871X: pDM_Odm TxPowerTrackControl = 1
 [   84.402551] RTL871X: rtl8188eu_hal_init in 415ms
 [   84.406509] RTL871X: <===  rtw_ips_pwr_up.............. in 430ms
 [   84.412188] RTL871X: nolinked power save leave
 [   84.417175] RTL871X: ==> ips_leave.....LED(0x00028282)...
 [   84.421953] RTL871X: set_mode = IW_MODE_INFRA
 [   84.426909] RTL871X: set bssid:00:00:00:00:00:00
 [   84.431081] RTL871X: hw_var_set_opmode()-3362 mode = 2
 [   84.436790] RTL871X: =>rtw_wx_set_essid
 [   84.439435] RTL871X: ssid=g苅sQ秃F|耇桤峷Z.c3熒 len=32
 [   84.446397] RTL871X: set ssid [g苅sQ秃F|耇桤峷Z.c3熒媇 fw_state=0x00000008
 [   84.454169] RTL871X: Set SSID under fw_state=0x00000008
 ioctl[SIOCSIWA[   84.460589] RTL871X: <=rtw_wx_set_essid, ret 0
 P]: Operation not permitted
 ioctl[SIOCSIWENCO[   84.501418] RTL871X: [rtw_wx_set_pmkid] IW_PMKSA_FLUSH!
 DEEXT]: Invalid argument
 ioctl[SIOCSIWENCODEEXT]: Invalid argument
 [   85.815426] RTL871X: survey done event(43)
 [   85.818105] RTL871X: rtw_select_and_join_from_scanned_queue: return _FAIL(candidate == NULL)
 [   85.826569] RTL871X: try_to_join, but select scanning queue fail, to_roaming:0
 wlan0: Trying to [   85.848231] RTL871X: wpa_set_auth_algs, AUTH_ALG_OPEN_SYSTEM
 [   85.853946] RTL871X: set_mode = IW_MODE_INFRA
 [   85.858734] RTL871X:
 [   85.858750]  wpa_ie(length:22):
 [   85.863961] RTL871X: hw_var_set_opmode()-3362 mode = 2
 [   85.868989] RTL871X: 0x30 0x14 0x01 0x00 0x00 0x0f 0xac 0x02
 [   85.874703] RTL871X: 0x01 0x00 0x00 0x0f 0xac 0x04 0x01 0x00
 [   85.880428] RTL871X: 0x00 0x0f 0xac 0x02 0x00 0x00 0x00 0x00
 [   85.886117] RTL871X: =>rtw_wx_set_essid
 [   85.889280] RTL871X: ssid=armeasy, len=7
 [   85.894177] RTL871X: set ssid [armeasy] fw_state=0x00000008
 [   85.899158] RTL871X: Set SSID under fw_state=0x00000008
 [   85.904050] RTL871X: [by_bssid:0][assoc_ssid:armeasy][to_roaming:0] new candidate: armeasy
 
 (8c:21:0a:0d:4b:0c) rssi:-76
 [   85.914695] RTL871X: rtw_select_and_join_from_scanned_queue: candidate: armeasy
 
 (8c:21:0a:0d:4b:0c, ch:9)
 [   85.924155] RTL871X: Capture EPIGRAM_OUI
 [   85.928028] RTL871X: Capture EPIGRAM_OUI
 [   85.931929] RTL871X: link to Artheros AP
 [   85.935842] RTL871X: rtw_joinbss_cmd: smart_ps=2
 [   85.941172] RTL871X: <=rtw_wx_set_essid, ret 0
 [   85.945099] RTL871X: set ch/bw before connected
 [   85.949685] RTL871X: set bssid:8c:21:0a:0d:4b:0c
 [   85.954138] RTL871X: Set BSSID under fw_state=0x00000088
 associate with 8c:21:0a:0d:4b:0c (SSID='armeasy' freq=2452 MHz)
 wlan0: Association [   85.967104] RTL871X: update_mgnt_tx_rate(): rate = 2
 request to the driver failed
 [   86.022131] RTL871X: Capture EPIGRAM_OUI
 [   86.024571] RTL871X: Capture EPIGRAM_OUI
 [   86.028476] RTL871X: link to Artheros AP
 [   86.032386] RTL871X: issue_deauth to 8c:21:0a:0d:4b:0c
 [   86.037515] RTL871X: start auth
 [   86.040671] RTL871X: issue_auth
 [   86.045608] RTL871X: OnAuthClient
 [   86.047434] RTL871X: auth success, start assoc
 [   86.051881] RTL871X: network.SupportedRates[0]=82
 [   86.056559] RTL871X: network.SupportedRates[1]=84
 [   86.061245] RTL871X: network.SupportedRates[2]=8B
 [   86.065932] RTL871X: network.SupportedRates[3]=96
 [   86.070618] RTL871X: network.SupportedRates[4]=0C
 [   86.075306] RTL871X: network.SupportedRates[5]=12
 [   86.079984] RTL871X: network.SupportedRates[6]=18
 [   86.084680] RTL871X: network.SupportedRates[7]=24
 [   86.089367] RTL871X: network.SupportedRates[8]=30
 [   86.094054] RTL871X: network.SupportedRates[9]=48
 [   86.098741] RTL871X: network.SupportedRates[10]=60
 [   86.103516] RTL871X: network.SupportedRates[11]=6C
 [   86.108291] RTL871X: bssrate_len = 12
 [   86.115749] RTL871X: OnAssocRsp
 [   86.117410] RTL871X: report_join_res(4)
 [   86.121325] RTL871X: rtw_joinbss_update_network
 [   86.125750] RTL871X: +rtw_update_ht_cap()
 [   86.129736] RTL871X: rtw_joinbss_update_stainfo
 [   86.134256] RTL871X: ### Set STA_(0) info
 [   86.138251] RTL871X: assoc success
 [   86.141672] RTL871X: OnAction_back
 [   86.145021] RTL871X: OnAction_back, action=0
 [   86.149263] RTL871X: issue_action_BA, category=3, action=1, status=0
 [   86.156072] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
 [   86.161611] RTL871X: HW_VAR_BASIC_RATE: BrateCfg(0x15f)
 [   86.167690] RTL871X: send eapol packet
 wlan0: Associa[   86.171711] RTL871X: WMM(0): 0, a42b
 [   86.175496] RTL871X: send eapol packet
 [   86.178896] RTL871X:  ~~~~set sta key:unicastkey
 [   86.183752] RTL871X:  ~~~~set sta key:groupkey
 [   86.187966] RTL871X: WMM(1): 0, a44f
 [   86.191569] RTL871X: ==> rtw_set_key algorithm(2),keyid(1),key_mask(2)
 [   86.198042] RTL871X: WMM(2): 0, 5e4322
 [   86.201970] RTL871X: WMM(3): 0, 2f3222
 [   86.205948] RTL871X: wmm_para_seq(0): 0
 [   86.209239] RTL871X: wmm_para_seq(1): 1
 [   86.213329] RTL871X: wmm_para_seq(2): 2
 [   86.216944] RTL871X: wmm_para_seq(3): 3
 [   86.220757] RTL871X: HTOnAssocRsp
 ted with 8c:21:0a:0d:4b:0c
 wlan0: WPA: Key negotiation [   86.229970] UpdateHalRAMask8188EUsb => mac_id:0, networkType:0x0b,
 
 mask:0x000fffff
 [   86.229974]   ==> rssi_level:0, rate_bitmap:0x000ff015
 [   86.241745] RTL871X: ### MacID(0),Set Max Tx RPT MID(1)
 [   86.246973] RTL871X: ### rtl8188e_set_FwMediaStatus_cmd: MStatus=1 MACID=0
 completed with[   86.255465] RTL871X: rtl8188e_set_FwJoinBssReport_cmd mstatus(1)
 [   86.262088] RTL871X: SetFwRsvdPagePkt
 [   86.264549] RTL871X: SetFwRsvdPagePkt: Set RSVD page location to Fw
 [   86.271840] RTL871X: rtl8188e_set_FwJoinBssReport_cmd: 1 Download RSVD success! DLBcnCount:1,
 
 poll:1
 [   86.280588] RTL871X: Set RSVD page location to Fw.
 [   86.284832] RTL871X: =>mlmeext_joinbss_event_callback
 [   86.289840] RTL871X: set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) camid:4
 8c:21:0a:0d:4[   86.299465] RTL871X: set group key to hw: alg:2(WEP40-1 WEP104-5 TKIP-2 AES-4)
 
 keyid:1
 b:0c [PTK=CCMP GTK=TKIP]
 wlan0: CTRL-EVENT-CONNECTED - Connection to 8c:21:0a:0d:4b:0c completed [id=0 id_str=]
 
 [root@x4412 mnt]#
 
 留意,当我们收到WPA发来的CTRL-EVENT-CONNECTED指令时,表明连接成功,如果收到的是CTRL-EVENT-
 
 DISCONNECTED指令,恭喜您,您再找找原因,建议换个其他版本的驱动试试!
 
 六:ping路由,这时应该能够PING通路由:
 [root@x4412 mnt]# ping 192.168.0.1
 PING 192.168.0.1 (192.168.0.1): 56 data bytes
 64 bytes from 192.168.0.1: seq=0 ttl=64 time=2087.804 ms
 64 bytes from 192.168.0.1: seq=1 ttl=64 time=1086.098 ms
 64 bytes from 192.168.0.1: seq=2 ttl=64 time=84.827 ms
 64 bytes from 192.168.0.1: seq=3 ttl=64 time=1.726 ms
 64 bytes from 192.168.0.1: seq=4 ttl=64 time=1.700 ms
 [root@x4412 mnt]#
 
 七:添加网关
 route  add  default   gw  192.168.0.1
 成功后可通过route指令查询:
 [root@x4412 /]# route
 Kernel IP routing table
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
 192.168.0.0     *               255.255.255.0   U     0      0        0 wlan0
 [root@x4412 /]# route  add  default   gw  192.168.0.1
 [root@x4412 /]# route
 Kernel IP routing table
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
 192.168.0.0     *               255.255.255.0   U     0      0        0 wlan0
 default         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0
 [root@x4412 /]#
 
 八:ping外网
 [root@x4412 /]# ping 58.63.236.39
 PING 58.63.236.39 (58.63.236.39): 56 data bytes
 64 bytes from 58.63.236.39: seq=0 ttl=55 time=2903.754 ms
 64 bytes from 58.63.236.39: seq=1 ttl=55 time=2990.038 ms
 64 bytes from 58.63.236.39: seq=2 ttl=55 time=2963.814 ms
 64 bytes from 58.63.236.39: seq=3 ttl=55 time=3113.067 ms
 64 bytes from 58.63.236.39: seq=4 ttl=55 time=2949.479 ms
 64 bytes from 58.63.236.39: seq=5 ttl=55 time=2371.217 ms
 64 bytes from 58.63.236.39: seq=6 ttl=55 time=1503.418 ms
 
 --- 58.63.236.39 ping statistics ---
 9 packets transmitted, 7 packets received, 22% packet loss
 round-trip min/avg/max = 1503.418/2684.969/3113.067 ms
 [root@x4412 /]#
 表明已经成功连上外网。上面IP为新浪IP地址。
 
 说明:linux USB WIFI的移植,关键就是如何生成wpa_supplicant工具。我们直接从android编译好的目录下提取
 
 ,也可以直接用我们制作好的文件,在linux文件系统的sbin目录下。
 
 当您看到这篇文章时,基本上意味着x4412/ibox开发板的android4.4平台,USB WIFI就要支持了,哈哈!
 
 附:编译好的KO文件:
 
  wlan.ko
(860.92 KB, 下载次数: 87) RTL8188EUS驱动源码包,可无缝支持linux3.0.15内核,基于WEXT协议的驱动包,它将完美支持x4412/ibox开发板的android4.4系统!
 
  rtl8188EUS_linux_v4.1.4_6773.20130222.tar.gz
(1.16 MB, 下载次数: 243) 
 | 
 |