移植平台:ubuntu+freescale 6q
驱动包:DPO_RT5572_LinuxSTA_2.6.1.3_20121022.tar.bz2
解压后,修改两个文件Makefile和config.mk,按照已有的照写属于自己的规则:
RT28xx_MODE = STA
TARGET = LINUX
CHIPSET = 3070
Makefile:22:PLATFORM =myboard
Makefile:162:ifeq ($(PLATFORM),myboard)
os/linux/config.mk:851:ifeq ($(PLATFORM),myboard)
内核需要配置(大概是这样,一定要选择,不然编译驱动会出现问题,貌似是一些变量没定义或者没找到):
Networking supportà
Wirelessà
-*-Wireless extensions
[*]Wireless extensions sysfs files
Device Driversà
Network device supportà
Wierless LANà
[*]Wireless LAN(IEEE 802.11)
<M>Ralink driver support
USB驱动支持USB Wireless Device Management support
重新编译即可。
如果加载后出现探测不到wifi模块,如下打印:
# insmod rt3070sta.ko
[ 304.232305] rtusb init rt2870 --->
[ 304.235108] usbcore: registered new interface driver rt2870
此时就是因为没有探测到wifi模块。
运行lsusb命令,查看usb是否探测到wifi模块的id:
# lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 004: ID 8516:5077
直接修改common/rtusb_dev_id.c:107: {USB_DEVICE(0x8516,0x5077)}, /* Ralink 3070 */
增加相应的usb id,重新编译驱动,加载正常。
/tmp # insmod rt3070sta.ko
[ 2476.338172] rtusb init rt2870 --->
[ 2476.342050]
[ 2476.342053]
[ 2476.342055] === pAd = eae1e000, size = 513664 ===
[ 2476.342059]
[ 2476.354747] <-- RTMPAllocAdapterBlock, Status=0
[ 2476.360037] NVM is EFUSE
[ 2476.372196] usbcore: registered new interface driver rt2870
/tmp # ls
rt3070sta.ko
/tmp # ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:0B:82:27:FD:E4
inet addr:192.168.81.238 Bcast:192.168.81.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:82655 errors:0 dropped:570 overruns:0 frame:0
TX packets:75600 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:42686076 (40.7 MiB) TX bytes:3629419 (3.4 MiB)
eth1 Link encap:Ethernet HWaddr 00:0B:82:27:FD:E4
inet addr:192.168.81.239 Bcast:192.168.81.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
ra0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
/tmp # ifconfig
eth0 Link encap:Ethernet HWaddr 00:0B:82:27:FD:E4
inet addr:192.168.81.238 Bcast:192.168.81.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:82681 errors:0 dropped:572 overruns:0 frame:0
TX packets:75600 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:42688044 (40.7 MiB) TX bytes:3629419 (3.4 MiB)
eth1 Link encap:Ethernet HWaddr 00:0B:82:27:FD:E4
inet addr:192.168.81.239 Bcast:192.168.81.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
/tmp # ifconfig ra0 up
[ 2502.483915] NICLoadFirmware: We need to load firmware
[ 2502.757938] <-- RTMPAllocTxRxRingMemory, Status=0
[ 2502.762872] RTMP_TimerListAdd: add timer obj eae66200!
[ 2502.768058] RTMP_TimerListAdd: add timer obj eae66230!
[ 2502.773202] RTMP_TimerListAdd: add timer obj eae66260!
[ 2502.778357] RTMP_TimerListAdd: add timer obj eae661d0!
[ 2502.783502] RTMP_TimerListAdd: add timer obj eae66140!
[ 2502.788670] RTMP_TimerListAdd: add timer obj eae66170!
[ 2502.793814] RTMP_TimerListAdd: add timer obj eae30974!
[ 2502.799274] RTMP_TimerListAdd: add timer obj eae1fe34!
[ 2502.804493] RTMP_TimerListAdd: add timer obj eae1fe68!
[ 2502.809701] RTMP_TimerListAdd: add timer obj eae30a18!
[ 2502.814943] RTMP_TimerListAdd: add timer obj eae30914!
[ 2502.820149] RTMP_TimerListAdd: add timer obj eae309e4!
[ 2502.827287] -->RTUSBVenderReset
[ 2502.830536] <--RTUSBVenderReset
[ 2503.064254] Key1Str is Invalid key length(0) or Type(0)
[ 2503.069903] Key2Str is Invalid key length(0) or Type(0)
[ 2503.075258] Key3Str is Invalid key length(0) or Type(0)
[ 2503.080666] Key4Str is Invalid key length(0) or Type(0)
[ 2503.087325] 1. Phy Mode = 5
[ 2503.090186] 2. Phy Mode = 5
[ 2503.093025] NVM is Efuse and its size =2d[2d0-2fc]
[ 2503.149293] phy mode> Error! The chip does not support 5G band 5!
[ 2503.155585] RTMPSetPhyMode: channel is out of range, use first channel=1
[ 2503.189163] 3. Phy Mode = 9
[ 2503.194543] AntCfgInit: primary/secondary ant 0/1
[ 2503.194548] MCS Set = ff 00 00 00 01
[ 2503.279070] <==== rt28xx_init, Status=0
[ 2503.284536] 0x1300 = 00064300
/tmp #
/tmp #
/tmp # ifconfig
eth0 Link encap:Ethernet HWaddr 00:0B:82:27:FD:E4
inet addr:192.168.81.238 Bcast:192.168.81.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:82729 errors:0 dropped:577 overruns:0 frame:0
TX packets:75600 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:42691060 (40.7 MiB) TX bytes:3629419 (3.4 MiB)
eth1 Link encap:Ethernet HWaddr 00:0B:82:27:FD:E4
inet addr:192.168.81.239 Bcast:192.168.81.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
ra0 Link encap:Ethernet HWaddr 00:12:04:20:01:3F
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
下一篇介绍移植wireless tools