rt3070驱动移植 phy mode> Error! The chip does not...

4527人阅读
软硬件平台:
宿主机:fedora10vmware虚拟机
目标版:tiny6410,linux2.6.38
交叉编译工具:arm-linux-4.5.1
网卡:Ralink3070模块
1、编译驱动的预操作:编译arm版本的内核源码。
从tiny6410的光碟中获取内核源码,此内核源码已经经过友善之臂的移植,可以直接编译移植入tiny6410中。
cp linux-2.6.38-.tar.gz/usr/src/kernels/
cd /usr/src/kernels
tar -zxvf linux-2.6.38-.tar.gz
cd linux-2.6.38
cp config_mini6410_n43 .config
make menuconfig
进入内核配置界面,内核配置中需要做的修改如下:
[*] Networking support&
&&&&&&&&&&&&&
cfg80211 - wireless configuration API
&&&&&&&&&&&&&
Wireless extensions sysfs files
&&&&&&&&&&&&&
Generic IEEE 802.11 Networking Stack(mac80211)
Device Drivers&
[*]Network device support&
&&&&&&&&&&&&&
Wireless LAN&
&&&&&&&&&&&&&&&&&&&&
IEEE 802.11 for Host AP (Prism2/2.5/3 andWEP/TKIP/CCMP)
&&&&&&&&&&&&&&&&&&&&
Support downloading firmware images withHost AP driver
&&&&&&&&&&&&&&&&&&&&
Support for non-volatile firmwaredownload
&&&&&&&&&&&&&&&&&&&&
Ralink driver support&
&&&&&&&&&&&&&&&&&&&&&&&&&&&
Ralink rt27xx/rt28xx/rt30xx (USB) support
然后make,编译通过后会在arch/arm/boot/目录下生成可烧写入开发板的zImage内核镜像。
2、编译rt3070模块的驱动
在雷凌的官网下载linux版本的rt3070驱动_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO.bz2,解压后的目录名称太长,所以可以对其做修改方便使用,然后进入到目录中
tar –jxf_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO.bz2
mv _RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPOrt3070
目录中的README_STA_usb文件介绍了编译和加载驱动的一些信息。需要对os/linux/目录下的conf.mk文件进行修改,这里只贴出要修改的部分:
vim os/linux/config.mk
# Support Wpa_Supplicant
HAS_WPA_SUPPLICANT=y
# Support Native WpaSupplicant for NetworkMaganger
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
Makefile也要进行修改,芯片类型改为3070,默认的PLATFORM为PC,那么将后面的ifeq($(PLATFORM),PC)下的内核源码路径指定为上述的交叉编译过的内核源码目录,交叉编译工具指定为arm-linux-,当然之前应该把交叉工具链安装好,这里不再详述。
vim Makefile
ifeq ($(CHIPSET),)
CHIPSET = 3070
ifeq ($(PLATFORM),PC)
# Linux 2.6
LINUX_SRC = /usr/src/kernels/linux-2.6.38
# Linux 2.4 Change to your local setting
#LINUX_SRC = /usr/src/linux-2.4
LINUX_SRC_MODULE = /lib/modules/$(shelluname -r)/kernel/drivers/net/wireless/
CROSS_COMPILE = /usr/local/FriendlyARM/toolschain/4.5.1/bin/arm-linux-
然后如果直接make,会报如下错误:
/home/cabbage/Desktop/rt3070/os/linux/../../chips/rtmp_chip.c:In function 'RtmpChipOpsHook':
/home/cabbage/Desktop/rt3070/os/linux/../../chips/rtmp_chip.c:470:error: implicit declaration of function 'RT33xx_Init'
make[2]: ***[/home/cabbage/Desktop/rt3070/os/linux/../../chips/rtmp_chip.o] Error 1
make[1]: ***[_module_/home/cabbage/Desktop/rt3070/os/linux] Error 2
make[1]: Leaving directory`/usr/src/kernels/linux-2.6.38'
make: *** [LINUX] Error 2
在网上查到似乎是因为改变了CHIPSET所导致的错误。修改chips/目录下的rtmp_chip.c文件,定位到470行,修改后如下:
#ifdef RT30xx
if (IS_RT30xx(pAd))
&&&&&&&&&&&&&&&
if (IS_RT3390(pAd))
&&&&&&&&&&&&&&&&&&&&
;//RT33xx_Init(pAd);
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
RT30xx_Init(pAd);
#endif /* RT30xx */
然后再make,编译通过后会在os/linux/下生成rt3070sta.ko,这就是模块的驱动。
但是这里我出现了一个问题,查看rt3070sta.ko这个文件的大小,居然达到了12m,这是不合理的,原因应该是包含了大量调试信息,用arm-linux-strip可将它的大小裁剪为750k左右。
#arm-linux-strip -S rt3070sta.ko
其中-S参数是必须的,否则在加载驱动的时候会报找不到版本信息的错误。
3、烧写内核和加载驱动
将之前编译好的zImage镜像通过dnw烧写入开发板中,将rt3070sta.ko和驱动源码目录下的RT2870STA.dat两个文件通过nfs或者sd卡下载到开发板中,RT2870STA.dat放入/etc/Wireless/RT2870STA/目录下,rt3070sta.ko放入任意合适的目录,我放在了/usr下。
mkdir –p /etc/Wireless/RT2870STA/
cp RT2870STA.dat / etc/Wireless/RT2870STA/
cp rt3070sta.ko /usr
insmod /usr/rt3070sta.ko
rtusb init rt2870 ---&
=== pAd = d1502000, size = 513400 ===
&-- RTMPAllocTxRxRingMemory, Status=0
&-- RTMPAllocAdapterBlock, Status=0
usbcore: registered new interface driverrt2870
然后可以通过ifconfig–a可以看到系统已经正确识别网卡,名称为ra0。
ifconfig –a
Link encap:Ethernet&
HWaddr00:00:00:00:00:00&
BROADCAST MULTICAST&
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)
然后启动网卡,有如下信息输出,而后可以观察到模块的指示灯不停闪烁,此时网卡已经可以正常工作了。
#ifconfig ra0 up
(Efuse for 72) Size=0x2d[2d0-2fc]
RTMP_TimerListAdd: add timer obj d1549ba8!
RTMP_TimerListAdd: add timer obj d1549bd8!
RTMP_TimerListAdd: add timer obj d1549c08!
RTMP_TimerListAdd: add timer obj d1549b78!
RTMP_TimerListAdd: add timer obj d1549ae8!
RTMP_TimerListAdd: add timer obj d1549b18!
RTMP_TimerListAdd: add timer obj d151471c!
RTMP_TimerListAdd: add timer obj d1503edc!
RTMP_TimerListAdd: add timer obj d1503f14!
RTMP_TimerListAdd: add timer obj d15147c0!
RTMP_TimerListAdd: add timer obj d15146bc!
RTMP_TimerListAdd: add timer obj d151478c!
--&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 notsupport 5G band 5!
RTMPSetPhyMode: channel is out of range, usefirst channel=1
(Efuse for 72) Size=0x2d[2d0-2fc]
3. Phy Mode = 9
AntCfgInit: primary/secondary ant 0/1
MCS Set = ff 00 00 00 01
&==== rt28xx_init, Status=0
至此网卡驱动移植成功。但是如果需要让网卡连接入目前常见的WPA加密的网络,还需要移植wpa_supplicant工具。
另外还有一个名为wireless_tools的辅助工具,可以用它来检索在网卡所在的环境中存在的无线网络,如果对于要连接入的无线网络的ssid和相关信息已经清楚,可以不用移植,不过这个工具的移植很简单。
4、移植wireless_tools
源码下载地址:(这个地址里的资源跟描述不一致……)
tar zxvf wireless_tools.29.tar.gz
cd wireless_tools.29
vim Makefile
PREFIX = /usr/local/wirelesstool
/usr/local/FriendlyARM/toolschain/4.5.1/bin/arm-linux-gcc
/usr/local/FriendlyARM/toolschain/4.5.1/bin/arm-linux-ar
/usr/local/FriendlyARM/toolschain/4.5.1/bin/arm-linux-ranlib
make install
在/usr/local/wirelesstool/lib目录下找到libiw.so.29,下载到开发板的/lib/目录下;/usr/local/wirelesstool/sbin目录下找到iwpriv、iwconfig、iwlist,
iwevent, iwspy等命令,下载到开发板的/usr/sbin目录下。这时就应该可以使用这些命令通过网卡搜索到环境中的无线网络。
ifconfig ra0 up
iwlist ra0 scan
Cell 06 - Address: 38:83:45:E5:CB:3E
&&&&&&&&&&&&&&&&&&&
Protocol:802.11b/g/n
&&&&&&&&&&&&&&&&&&&
ESSID:&idart-wlan311&
&&&&&&&&&&&&&&&&&&&
Mode:Managed
&&&&&&&&&&&&&&&&&&&
Frequency:2.437 GHz(Channel 6)
&&&&&&&&&&&&&&&&&&&
Quality=100/100&
Signal level=-43 dBm&
Noise level=-92 dBm
&&&&&&&&&&&&&&&&&&&
Encryption key:on
&&&&&&&&&&&&&&&&&&&
Bit Rates:22.5 Mb/s
&&&&&&&&&&&&&&&&&&&
IE: WPA Version 1
&&&&&&&&&&&&&&&&&&&&&&&
Group Cipher : CCMP
&&&&&&&&&&&&&&&&&&&&&&&
Pairwise Ciphers (1) :CCMP
&&&&&&&&&&&&&&&&&&&&&&&
Authentication Suites(1) : PSK
&&&&&&&&&&&&&&&&&&&
IE: IEEE 802.11i/WPA2Version 1
&&&&&&&&&&&&&&&&&&&&&&&
Group Cipher : CCMP
&&&&&&&&&&&&&&&&&&&&&&&
Pairwise Ciphers (1) :CCMP
&&&&&&&&&&&&&&&&&&&&&&&
Authentication Suites(1) : PSK
&&&&&&&&&&&&&&&&&&&
IE: Unknown:DD0EA0102
Cell 07 - Address: 58:66:BA:EE:DB:40
&&&&&&&&&&&&&&&&&&&
Protocol:802.11b/g/n
&&&&&&&&&&&&&&&&&&&
ESSID:&ChinaNet&
&&&&&&&&&&&&&&&&&&&
Mode:Managed
&&&&&&&&&&&&&&&&&&&
Frequency:2.437 GHz(Channel 6)
&&&&&&&&&&&&&&&&&&&
Quality=42/100&
Signal level=-73 dBm&
Noise level=-76 dBm
&&&&&&&&&&&&&&&&&&&
Encryption key:off
&&&&&&&&&&&&&&&&&&&
Bit Rates:54 Mb/s
Cell 08 - Address: 58:66:BA:EE:DB:41
&&&&&&&&&&&&&&&&&&&
Protocol:802.11b/g/n
&&&&&&&&&&&&&&&&&&&
ESSID:&SYSUWLAN&
&&&&&&&&&&&&&&&&&
&&Mode:Managed
&&&&&&&&&&&&&&&&&&&
Frequency:2.437 GHz(Channel 6)
&&&&&&&&&&&&&&&&&&&
Quality=37/100&
Signal level=-75 dBm&
Noise level=-78 dBm
&&&&&&&&&&&&&&&&&&&
Encryption key:off
&&&&&&&&&&&&&&&&&&&
Bit Rates:54 Mb/s
至此wireliss_tools移植成功。
5、移植wpa_supplicant
源码下载地址:
它的移植还需要openssl,下载地址:
我使用的是wpa_supplicant-0.6.10和openssl-0.9.8e。
将两个包解压后,需要为opensll打上wpa的补丁,然后交叉编译
cpwpa_supplicant-0.6.10/patches/openssl-0.9.8e-tls-extensions.patchopenssl-0.9.8e/
cd openssl-0.9.8e
mkdir /usr/local/ssl
vim Makefile
INSTALLTOP=/usr/local/ssl
OPENSSLDIR=/usr/local/ssl
CC= arm-linux-gcc
AR= arm-linux- ar $(ARFLAGS) r
RANLIB= arm-linux-ranlib
make install
在/usr/local/ssl目录下安装了ssl库。
然后进入到wpa_supplicant的目录,修改配置文件和Makefile
cd ../wpa_supplicant-0.6.10/wpa_supplicant
cp defconfig .config
vim .config
# Uncomment following two lines and fix thepaths if you have installed OpenSSL
# or GnuTLS in non-default location
CFLAGS += -I/usr/local/ssl/include
LIBS += -L/usr/local/ssl/lib
vim Makefile
#ifndef CC
CC=arm-linux-gcc
然后make,便可以在当前目录下得到需要的wpa_supplicant工具
将wpa_supplicant和配置文件wpa_supplicant.conf下载到开发板中,wpa_supplicant替换掉原本开发板/usr/sbin/目录下的wpa_supplicant,wpa_supplicant.conf放在/etc目录下,对wpa_supplicant.conf文件进行编辑:
ctrl_interface=/var/run/wpa_supplicant
ssid=&idart-wlan311&
scan_ssid=1
key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
pairwise=TKIP CCMP
group=CCMP TKIP WEP104 WEP40
psk=&XXXXXXXX&
其中的psk为无线网的密码
然后把文件末尾提供的一些example全部删除,否则在使用wpa_supplicant时会报一些类型无法识别的错误。
最后进行测试,测试之前要关闭有线网卡eth0,原因是如果不关闭的话在之后添加默认路由时会被设置为有线网卡的默认路由,这个应该有别的解决方法,不过我没有仔细去查。
ifconfig eth0 down
ifconfig ra0 up&
ifconfig ra0 192.168.1.248 netmask255.255.255.0
route add default gw 192.168.1.1
wpa_supplicant -B -ira0 -c/etc/wpa_supplicant.conf –Dwext
===&rt_ioctl_giwscan. 28(28) BSSreturned, data-&length = 3351
==&rt_ioctl_siwfreq::SIOCSIWFREQ(Channel=6)
RTMP_TimerListAdd: add timer obj d15785c4!
6、ping通外网
Rcv Wcid(1) AddBAReq
Start Seq =
RTMP_TimerListAdd: add timer obj d157a5e4!
(74.125.128.106): 56 databytes
64 bytes from 74.125.128.106: seq=0 ttl=40time=86.383 ms
64 bytes from 74.125.128.106: seq=1 ttl=40time=84.996 ms
64 bytes from 74.125.128.106: seq=2 ttl=40time=102.010 ms
64 bytes from 74.125.128.106: seq=3 ttl=40time=86.005 ms
ping statistics ---
4 packets transmitted, 4 packets received,0% packet loss
round-trip min/avg/max =84.996/89.848/102.010 ms
参考链接:
================================End===============================
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:654682次
积分:8136
积分:8136
排名:第1082名
原创:135篇
转载:187篇
评论:111条
(1)(1)(4)(1)(2)(3)(4)(4)(4)(2)(4)(23)(3)(5)(14)(5)(8)(6)(3)(10)(13)(14)(41)(43)(14)(3)(10)(5)(13)(8)(8)(9)(11)(5)(8)(2)(4)(1)(2)(1)1471人阅读
硬件平台:飞思卡尔MX258开发板
操作系统:Linux2.6.31
WIFI:&&& RT2860 USB WIFI模组
交叉编译环境:gcc version 4.1.2
调试步骤:
第一步:测试USB HOST接口
在menuconfig中将USB HOST设置为内核模式:
重新编译内核后启动开发板,插入U盘并挂载:
mount /dev/sda1 /tmp
可以看到U盘已经正常挂载,测试USB HOST OK!
第二步:网上下载雷凌最新的USB驱动,
_RT3070_RT3370_Linux_STA_v2[1].5.0.1_DPO.tar.bz2
拷备到Linux目录并解压:
tar& jxf& _RT3070_RT3370_Linux_STA_v2[1].5.0.1_DPO.tar.bz2
由于上面名字很长,可以修改为简短的名字:
mv& _RT3070_RT3370_Linux_STA_v2[1].5.0.1_DPO& RT3070_Linux_STA
第三步:进入RT3070_Linux_STA目录,看到有一个README_STA_usb文件,里面介绍了如何加载该驱动:
=======================================================================
Build Instructions:&
====================
1& $tar -xvzf DPB_RT2870_Linux_STA_x.x.x.x.tgz
&&& go to &./DPB_RT2870_Linux_STA_x.x.x.x& directory.
2& In Makefile
&&&&&&&& &set the &MODE = STA& in Makefile and chose the TARGET to Linux by set &TARGET = LINUX&
&&&&&&&& &define the linux kernel source include file path LINUX_SRC
&&&&&&&& &modify to meet your need.
3& In os/linux/config.mk
&&&&&&&& define the GCC and LD of the target machine
&&&&&&&& define the compiler flags CFLAGS
&&&&&&&& modify to meet your need.
&&&&&&&& ** Build for being controlled by NetworkManager or wpa_supplicant wext functions
&&&&&&&& && Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y'.
&&&&&&&& && =& #&cd wpa_supplicant-x.x
&&&&&&&& && =& #&./wpa_supplicant -Dwext -ira0 -c wpa_supplicant.conf -d
&&&&&&&& ** Build for being controlled by WpaSupplicant with Ralink Driver
&&&&&&&& && Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n'.
&&&&&&&& && =& #&cd wpa_supplicant-0.5.7
&&&&&&&& && =& #&./wpa_supplicant -Dralink -ira0 -c wpa_supplicant.conf -d
&&&&&&&& # compile driver source code
&&&&&&&& # To fix &error: too few arguments to function ˉiwe_stream_add_event&
&&&&&&&& & =& $patch -i os/linux/sta_ioctl.c.patch os/linux/sta_ioctl.c
5& $cp RT2870STA.dat& /etc/Wireless/RT2870STA/RT2870STA.dat
6& load driver, go to &os/linux/& directory.
&&& #[kernel 2.4]
&&& #&&& $/sbin/insmod rt2870sta.o
&&& #&&& $/sbin/ifconfig ra0 inet YOUR_IP up
&&& #[kernel 2.6]
&&& #&&& $/sbin/insmod rt2870sta.ko
&&& #&&& $/sbin/ifconfig ra0 inet YOUR_IP up
7& unload driver&&&
&&& $/sbin/ifconfig ra0 down
&&&&&&&& $/sbin/rmmod rt2870sta
这里go to &./DPB_RT2870_Linux_STA_x.x.x.x& directory.即我们刚解压的RT3070_Linux_STA目录。修改该目录下的makefile文件,以下只给出修改部分:
#PLATFORM = PC
PLATFORM = RALINK_2880
ifeq ($(PLATFORM), RALINK_2880)
LINUX_SRC = /home/lqm/share/G360/kernel_kfb
CROSS_COMPILE = /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-
ifeq ($(RT28xx_MODE),APSTA)
&&&&&&&& cp -f $(RT28xx_DIR)/os/linux/rt$(CHIPSET)apsta.ko /tftpboot
ifeq ($(OSABL),YES)
&&&&&&&& cp -f $(RT28xx_DIR)/os/linux/rtutil$(CHIPSET)apsta.ko /tftpboot
&&&&&&&& cp -f $(RT28xx_DIR)/os/linux/rtnet$(CHIPSET)apsta.ko /tftpboot
&&&&&&&& cp -f $(RT28xx_DIR)/os/linux/rt$(CHIPSET)sta.ko /home/lqm/share/NFS/tmp
注意,虽然我们使用的是2860模组,我们这里仍然可以定义PLATFORM为RALINK_2880,只要后面对应的编译环境正确就可以了。LINUX_SRC表示内核的目录,CORSS_COMPILE为交叉编译环境,最末一行为编译完后将生成的KO文件复制到NFS文件系统的tmp目录。
第四步:按照第三步README_STA_usb给出的提示,修改config.mk文件,这里也只给出修改部分:
# Support Wpa_Supplicant
HAS_WPA_SUPPLICANT=y
# Support Native WpaSupplicant for Network Maganger
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n
CC := /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc
LD := /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-ld
ifeq ($(PLATFORM), RALINK_2880)
EXTRA_CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe -D__LINUX_ARM_ARCH__=5 -march=armv5te -msoft-float
-Uarm -DMODULE -DMODVERSIONS -include $(LINUX_SRC)/include/config/modversions.h $(WFLAGS)
export EXTRA_CFLAGS
注意,这里CC为交叉编译环境,LD为交叉编译的链接。默认EXTRA_CFLAGS为CFLAGS,这里需要修改为EXTRA_CFLAGS,否则编译时会提示如下错误:
scripts/Makefile.build:49: *** CFLAGS was changed in &/home/lqm/share/RT3070_Linux_STA/os/linux/Makefile&. Fix it to use EXTRA_CFLAGS。 停止。
LINUX_ARM_ARCH一定要设置为5,-march一定要设置得和CPU匹配,由于这里为MX258,因此设置为armv5te,不可设置为armv5t或armv5,否则出现如下错误:
& CC [M]& /home/lqm/share/RT3070_Linux_STA/os/linux/../../os/linux/rt_main_dev.o
{standard input}: Assembler messages:
{standard input}:340: Error: selected processor does not support `pld [r5,#0]'
{standard input}:349: Error: selected processor does not support `pld [r5,#0]'
make[2]: *** [/home/lqm/share/RT3070_Linux_STA/os/linux/../../os/linux/rt_main_dev.o] 错误 1
make[1]: *** [_module_/home/lqm/share/RT3070_Linux_STA/os/linux] 错误 2
make[1]: Leaving directory `/home/lqm/share/G360/kernel_kfb'
make: *** [LINUX] 错误 2
[root@lqm RT3070_Linux_STA]#
第五步:make
如果编译一切正常,将会在/RT3070_Linux_STA/os/linux目录下生成rt3070sta.ko文件。
第六步:将USB WIFI模组插到开发板的USB HOST端口,将rt3070sta.ko文件复制到文件系统的/tmp目录,重启开发板,进入文件系统后加载驱动:
insmod& rt3070sta.ko
这时会提示如下信息:
root@freescale ~$ cd /tmp
root@freescale /tmp$ insmod rt3070sta.ko
rtusb init rt2870 ---&
=== pAd = c49eb000, size = 509592 ===
&-- RTMPAllocTxRxRingMemory, Status=0
&-- RTMPAllocAdapterBlock, Status=0
usbcore: registered new interface driver rt2870
root@freescale /tmp$
第七步:配置无线网卡
首先检测开发板的网络设备:
可以看到这时只有eth0和lo两个网络信号,使用如下命令设置无线网卡的网络地址:
ifconfig ra0 192.168.1.5
打印信息如下:
root@freescale /tmp$ ifconfig ra0 192.168.1.5
(Efuse for 72) Size=0x2d [2d0-2fc]
RTMP_TimerListAdd: add timer obj c4a32d88!
RTMP_TimerListAdd: add timer obj c4a32db4!
RTMP_TimerListAdd: add timer obj c4a32de0!
RTMP_TimerListAdd: add timer obj c4a32d5c!
RTMP_TimerListAdd: add timer obj c4a32cd8!
RTMP_TimerListAdd: add timer obj c4a32d04!
RTMP_TimerListAdd: add timer obj c49fd91c!
RTMP_TimerListAdd: add timer obj c49ece5c!
RTMP_TimerListAdd: add timer obj c49ece90!
RTMP_TimerListAdd: add timer obj c49fd9b4!
RTMP_TimerListAdd: add timer obj c49fd8c4!
RTMP_TimerListAdd: add timer obj c49fd984!
--&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
(Efuse for 72) Size=0x2d [2d0-2fc]
3. Phy Mode = 9
MCS Set = ff 00 00 00 01
&==== rt28xx_init, Status=0
root@freescale /tmp$
再使用ifconfig查看网络设备:
root@freescale /tmp$ ifconfig
eth0&&&&& Link encap:Ethernet& HWaddr 00:04:9F:00:EB:33&
&&&&&&&&& inet addr:172.18.2.133& Bcast:172.18.255.255& Mask:255.255.0.0
&&&&&&&&& UP BROADCAST RUNNING MULTICAST& MTU:1500& Metric:1
&&&&&&&&& RX packets:3182 errors:0 dropped:0 overruns:0 frame:0
&&&&&&&&& TX packets:1380 errors:0 dropped:0 overruns:0 carrier:0
&&&&&&&&& collisions:0 txqueuelen:1000
&&&&&&&&& RX bytes:.9 MiB)& TX bytes:2.2 KiB)
&&&&&&&&& Base address:0xa000
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:E0:61:37:D0:10&
&&&&&&&&& inet addr:192.168.1.5& Bcast:192.168.1.255& Mask:255.255.255.0
&&&&&&&&& UP BROADCAST RUNNING MULTICAST& MTU:1500& Metric:1
&&&&&&&&& RX packets:631 errors:0 dropped:0 overruns:0 frame:0
&&&&&&&&& TX packets:83 errors:0 dropped:0 overruns:0 carrier:0
&&&&&&&&& collisions:0 txqueuelen:1000
&&&&&&&&& RX bytes:9 KiB)& TX bytes: KiB)
root@freescale /tmp$
可以看到这时多了一组ra0设备,它就是无线网卡的相关信息。
第八步:下载并编译无线网络工具wireless_tools.29.tar.gz
tar& zxf& wireless_tools.29.tar.gz
cd& wireless_tools.29
修改makefile,修改部分如下:
## Compiler to use (modify this for cross compile).
CC = arm-none-linux-gnueabi-gcc
## Other tools you need to modify for cross compile (static lib only).
AR = arm-none-linux-gnueabi-ar
RANLIB = arm-none-linux-gnueabi-ranlib
修改后make,成功后会在当前目录生成iwspy,iwpriv,iwlist以及iwconfig等文件。我们只需将这四个文件拷备到NFS文件系统的sbin目录,然后将当前目录的libiw.so.29库文件拷到NFS文件系统的lib目录,无线网络工具即安装完成。
第九步:查看无线网络:
iwlist ra0 scanning
这时如果设备周边有无线信号,将会搜索出这些信号并打印出来,例如:
&&&&&&&&&& &&&&&&&&&Encryption key:on
&&&&&&&&&&&&&&&&&&& Bit Rates:54 Mb/s
&&&&&&&&&&&&&&&&&&& IE: WPA Version 1
&&&&&&&&&&&&&&&&&&&&&&& Group Cipher : TKIP
&&&&&&&&&&&&&&&&&&&&&&& Pairwise Ciphers (2) : CCMP TKIP
&&&&&&&&&&&&&&&&&&&&&&& Authentication Suites (1) : PSK
&&&&&&&&&&&&&&&&&&& IE: IEEE 802.11i/WPA2 Version 1
&&&&&&&&&&&&&&&&&&&&&&& Group Cipher : TKIP
&&&&&&&&&&&&&&&&&&&&&&& Pairwise Ciphers (2) : CCMP TKIP
&&&&&&&&&&&&&&&&&&&&&&& Authentication Suites (1) : PSK
&&&&&&&&& Cell 23 - Address: 00:25:5E:1E:38:5A
&&&&&&&&&&&&&&&&&&& Protocol:802.11b/g
&&&&&&&&&&&&&&&&&&& ESSID:&ChinaNet-UWfq&
&&&&&&&&&&&&&&&&&&& Mode:Managed
&&&&&&&&&&&&&&&&&&& Frequency:2.412 GHz (Channel 1)
&&&&&&&&&&&&&&&&&&& Quality=26/100& Signal level=-79 dBm& Noise level=-74 dBm
&&&&&&&&&&&&&&&&&&& Encryption key:on
&&&&&&&&&&&&&&&&&&& Bit Rates:54 Mb/s
&&&&&&&&&&&&&&&&&&& IE: WPA Version 1
&&&&&&&&&&&&&&&&&&&&&&& Group Cipher : TKIP
&&&&&&&&&&&&&&&&&&&&&&& Pairwise Ciphers (1) : TKIP
& &&&&&&&&&&&&&&&&&&&&&&Authentication Suites (1) : PSK
&&&&&&&&&&&&&&&&&&& IE: Unknown: DD0EA0102
&&&&&&&&& Cell 24 - Address: 00:25:5E:1D:2F:FF
&&&&&&&&&&&&&&&&&&& Protocol:802.11b/g
&&&&&&&&&&&&&&&&&&& ESSID:&ChinaNet-eSpK&
&&&&&&& &&&&&&&&&&&&Mode:Managed
&&&&&&&&&&&&&&&&&&& Frequency:2.437 GHz (Channel 6)
&&&&&&&&&&&&&&&&&&& Quality=42/100& Signal level=-73 dBm& Noise level=-75 dBm
&&&&&&&&&&&&&&&&&&& Encryption key:on
&&&&&&&&&&&&&&&&&&& Bit Rates:54 Mb/s
&&&&&&&&&&&&&&&&&&& IE: WPA Version 1
&&&&&&&&&&&&&&&&&&&&&&& Group Cipher : TKIP
&&&&&&&&&&&&&&&&&&&&&&& Pairwise Ciphers (1) : TKIP
&&&&&&&&&&&&&&&&&&&&&&& Authentication Suites (1) : PSK
&&&&&&&&&&&&&&&&&&& IE: Unknown: DD0EA0102
root@freescale /tmp$
第九步:下载并解压wpa_supplicant需要的源码
tar xvfz wpa_supplicant-0.7.2.tar.gz
tar xvfz wpa_supplicant-0.5.8.tar.gz
tar zxvf openssl-0.9.8e.tar.gz
第十步:编译openssl库
将wpa_supplicant中的补丁拷贝到openssl中:
cp &wpa_supplicant-0.7.2/patches/openssl-0.9.8e-tls-extensions.patch &openssl-0.9.8e/
建立openssl编译目标路径:
mkdir& /usr/local/ssl
修改openssl-0.9.8e目录下的makefile文件,修改内容如下:
CC= arm-none-linux-gnueabi-gcc
AR= arm-none-linux-gnueabi-ar
RANLIB= arm-none-linux-gnueabi-ranlib
INSTALLTOP=/usr/local/ssl
OPENSSLDIR=/usr/local/ssl
然后编译openssl:
make & make install
正常编译后,在/usr/local/ssl中将会出现ssl库。
第十一步:编译wpa_supplicant
cd& wpa_supplicant-0.5.8
cp &defconfig& .config
在.config中添加如下代码:
CC=arm-none-linux-gnueabi-gcc -L /usr/local/ssl/lib/
CFLAGS += -I/usr/local/ssl/include/
LIBS += -L/usr/local/ssl/lib/
正常情况下,将会在wpa_supplicant-0.5.8目录生成wpa_supplicant文件。将生成的文件拷备到文件系统的sbin目录
第十二步:建立配置文件wpa_supplicant.conf
在开发板文件系统的/etc目录下建立配置文件wpa_supplicant.conf,编辑内容如下:
# WPA-PSK/TKIP
ctrl_interface=/var/run/wpa_supplicant
&&&&&&&& ssid=&XGD-kjy&
&&&&&&&& scan_ssid=1
&&&&&&&& key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
&&&&&&&& pairwise=TKIP CCMP
&&&&&&&& group=CCMP TKIP WEP104 WEP40
&&&&&&&& psk=&xgdoko2008&
注意上面ssid要和无线路由的名字相同,psk为无线路由的密码。无线路由使用WPA或WPA2的加密方式。
在开发板终端建立无线网卡运行目录:
mkdir –p /var/run/wpa_supplicant
第十三步:执行wpa_supplicant
wpa_supplicant& -Dwext& -ira0& -c& /etc/wpa_supplicant.conf& -dd& &
这时PING路由的IP:
root@freescale /tmp$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=169.375 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=16.678 ms
64 bytes from 192.168.1.1: seq=2 ttl=64 time=60.179 ms
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 16.678/82.077/169.375 ms
root@freescale /tmp$
可见,已经能够PING通路由了。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:168229次
积分:2275
积分:2275
排名:第8617名
原创:53篇
转载:55篇
评论:26条
(5)(2)(6)(3)(3)(1)(3)(3)(1)(5)(6)(3)(2)(9)(1)(1)(17)(15)(9)(5)(3)(2)(2)(1)

我要回帖

更多关于 ralink rt3070 的文章

 

随机推荐