设为首页收藏本站
查看: 21012|回复: 1

[应用笔记] 在MYD-AM335X上编译USB WiFi RT3070驱动

[复制链接]

21

主题

21

回帖

575

积分

管理员

积分
575
oneal.tang 发表于 2015-7-20 21:18:39 | 显示全部楼层 |阅读模式
1.首先下载附件中提供的RT3070压缩包,驱动已经编译完成,用户可直接解压使用。[mw_shl_code=bash,true]tar zxvf DPO_RT5572_LinuxSTA_2.6.1.3_20121022
[/mw_shl_code]
2.将目录下的RT2870STA.dat和os/linux/目录下的rt3070sta.ko拷贝进Am335x板子中
[mw_shl_code=bash,true]mkdir –p /etc/Wireless/RT2870STA/  
  
cp RT2870STA.dat / etc/Wireless/RT2870STA/  
  
cp rt3070sta.ko /home  [/mw_shl_code]
3.加载驱动
[mw_shl_code=bash,true]root@MYD-AM335x home# insmod rt3070sta.ko
Disabling lock debugging due to kernel taint
rtusb init rt2870 --->


=== pAd = e0ab3000, size = 512288 ===

<-- RTMPAllocAdapterBlock, Status=0
NVM is EFUSE
usbcore: registered new interface driver rt2870[/mw_shl_code]
4.然后可以通过ifconfig -a 可以看到系统已经正确识别网卡,名称为ra0
5 启动网卡ifconfig -a
[mw_shl_code=applescript,true]root@MYD-AM335x home# ifconfig ra0 up
NICLoadFirmware: We need to load firmware
<-- RTMPAllocTxRxRingMemory, Status=0
RTMP_TimerListAdd: add timer obj e0afb0b8!
RTMP_TimerListAdd: add timer obj e0afb0e8!
RTMP_TimerListAdd: add timer obj e0afb118!
RTMP_TimerListAdd: add timer obj e0afb088!
RTMP_TimerListAdd: add timer obj e0afaff8!
RTMP_TimerListAdd: add timer obj e0afb028!
RTMP_TimerListAdd: add timer obj e0ac582c!
RTMP_TimerListAdd: add timer obj e0ab4d0c!
RTMP_TimerListAdd: add timer obj e0ab4d40!
RTMP_TimerListAdd: add timer obj e0ac58d0!
RTMP_TimerListAdd: add timer obj e0ac57cc!
RTMP_TimerListAdd: add timer obj e0ac589c!
-->RTUSBVenderReset
<--RTUSBVenderReset
Key1Str is Invalid key length(0) or Type(0)
Key2Str is Invalid key length(0) or Type(0)
Key3Str is Invalid key length(0) or Type(0)
Key4Str is Invalid key length(0) or Type(0)
1. Phy Mode = 5
2. Phy Mode = 5
NVM is Efuse and its size =2d[2d0-2fc]
phy mode> Error! The chip does not support 5G band 5!
RTMPSetPhyMode: channel is out of range, use first channel=1
3. Phy Mode = 9
AntCfgInit: primary/secondary ant 0/1
MCS Set = ff 00 00 00 01
<==== rt28xx_init, Status=0
0x1300 = 00064300[/mw_shl_code]
6 .配置wpa_supplicant配置文件(wpa_supplicant相关工具已经移植好,包含在我们提供的文件系统中)
[mw_shl_code=applescript,true]vi /etc/wpa_supplicant.conf[/mw_shl_code]
编辑如下形式
[mw_shl_code=bash,true]ctrl_interface=/var/run/wpa_supplicant
network={
        ssid="XXXXXXXX"
        scan_ssid=1
        key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
        pairwise=TKIP CCMP
        group=CCMP TKIP WEP104 WEP40
        psk="XXXXXXXX"
}[/mw_shl_code]注:ssid无线网名字,psk为无线网密码,请根据自己具体路由设置进行编辑配置文件
7.连接 wpa_supplicant -Dwext -ira0 -c/etc/wpa_supplicant.conf&
[mw_shl_code=bash,true]root@MYD-AM335x home#  wpa_supplicant -Dwext -ira0 -c/etc/wpa_supplicant.conf&
root@MYD-AM335x home# Successfully initialized wpa_supplicant
===>rt_ioctl_giwscan. 6(6) BSS returned, data->length = 1126
ra0: Trying to associate with 38==>rt_ioctl_siwfreq::SIOCSIWFREQ(Channel=1)
:83:45:2c:c8:00 (SSID='TP-LINK-1201' freq=2412 MHz)
ra0: Associated with 38:83:45:2c:c8:00
ra0: WPA: Key negotiation completed with 38:83:45:2c:c8:00 [PTK=CCMP GTK=CCMP]
ra0: CTRL-EVENT-CONNECTED - Connection to 38:83:45:2c:c8:00 completed [id=0 id_str=][/mw_shl_code]
8.ping通外网
[mw_shl_code=bash,true]root@MYD-AM335x home# ifconfig ra0 192.168.1.24 netmask 255.255.255.0
root@MYD-AM335x home# route add default gw 192.168.1.1
root@MYD-AM335x home# ping www.baidu.com
PING www.baidu.com (119.75.217.109): 56 data bytes
64 bytes from 119.75.217.109: seq=0 ttl=53 time=73.124 ms
64 bytes from 119.75.217.109: seq=1 ttl=53 time=72.575 ms
64 bytes from 119.75.217.109: seq=2 ttl=53 time=73.074 ms
64 bytes from 119.75.217.109: seq=3 ttl=53 time=72.973 ms

--- www.baidu.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 72.575/72.936/73.124 ms[/mw_shl_code]9.附件
DPO_RT5572_LinuxSTA_2.6.1.3_20121022.tar.gz (3.25 MB, 下载次数: 11395)



回复

使用道具 举报

0

主题

2

回帖

21

积分

新手上路

积分
21
leolzf0000 发表于 2015-7-30 09:18:37 | 显示全部楼层
GOOD GOOD 好东西,好好看看,好好学习
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录

本版积分规则

Archiver|手机版|小黑屋|米尔科技论坛   

GMT+8, 2024-4-30 10:44 , Processed in 0.052713 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表