rt5370驱动移植

 

//----------------------------------------------------

//AUTHOR: lanyang123456

//DATE: 2012-3-19

//----------------------------------------------------

 

硬件:ARM 开发板 OK6410

系统:linux 2.6.28内核

 

无线USB网卡 腾达 型号:W311M

芯片类型rt5370

第一步:下载驱动

驱动下载地址  腾达官网下载

http://www.tenda.com.cn/tendacn/Product/show.aspx?productid=172&type=2

或者到无线芯片组解决方案开发商 Ralink Technology公司官网下载

http://www.ralinktech.com/en/04_support/support.php?sn=501

 

第二步:

解压 tar –jvxf  2011_0225_RT5370_RT5372_Linux_STA_V2.5.0.1_DPO.tar.bz2

修改驱动源码根目录下的Makefile

PLATFORM=SMDK

 

LINUX_SRC=/usr/local/arm/linux-2.6.28(内核源码目录)

CROSS_COMPILE=/usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-

 

第三步:

编译驱动

#make

 

在os/linux 目录生成最后的ko文件rt5370sta.ko

 

 

第四步:

将rt5370驱动源码目录下的RT2870STA.dat拷贝到/etc/Wireless/RT2870STA/目录下(首先要创建/etc/Wireless/RT2870STA)

 

第五步:

加载驱动

将rt5370sta.ko拷贝到开发板

#insmod rt5370sta.ko

 

[root@OK6410 linux]# insmod rt5370sta.ko

rtusb init rt2870 --->

 

 

=== pAd = c884c000, size = 512016 ===

 

<-- RTMPAllocTxRxRingMemory, Status=0

<-- RTMPAllocAdapterBlock, Status=0

usbcore: registered new interface driver rt2870

 

第六步:

激活无线网卡

插入无线USB网卡

网卡接口为ra0

激活ra0

#ifconfig ra0 up

 

[root@OK6410 linux]# ifconfig ra0 up

(Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]

RTMP_TimerListAdd: add timer obj c8893b48!

RTMP_TimerListAdd: add timer obj c8893b74!

RTMP_TimerListAdd: add timer obj c8893ba0!

RTMP_TimerListAdd: add timer obj c8893b1c!

RTMP_TimerListAdd: add timer obj c8893a98!

RTMP_TimerListAdd: add timer obj c8893ac4!

RTMP_TimerListAdd: add timer obj c885e6dc!

RTMP_TimerListAdd: add timer obj c884dfec!

RTMP_TimerListAdd: add timer obj c884e020!

RTMP_TimerListAdd: add timer obj c885e774!

RTMP_TimerListAdd: add timer obj c885e684!

RTMP_TimerListAdd: add timer obj c885e744!

-->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 15!

RTMPSetPhyMode: channel is out of range, use first channel=1

(Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]

3. Phy Mode = 9

MacValue1=2

MacValue2=0

MCS Set = ff 00 00 00 01

<==== rt28xx_init, Status=0

0x1300 = 00064300

 

第七步:无线网络配置

配置无线网络ESSID

 

[root@OK6410 linux]# iwconfig ra0 essid DLUT

查看配置

[root@FORLINX6410]# iwconfig wlan0

wlan0     IEEE 802.11bgn  ESSID:"DLUT"

          Mode:Managed  Frequency:2.412 GHz  Access Point: 11:22:33:44:55:66

          Bit Rate=21.7 Mb/s   Tx-Power=20 dBm

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:off

          Power Management:on

          Link Quality=43/70  Signal level=-67 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:2  Invalid misc:0   Missed beacon:0

 

配置自动获取IP

在ARM板linux系统下,使用dhclient命令会提示无法找到该命令,首先需要进行dhcp移植。

移植dhcp 详见http://blog.csdn.net/lanyang123456/article/details/7361781 。

移植成功后

[root@FORLINX6410]# dhclient wlan0

Internet Systems Consortium DHCP Client V3.1.3

Copyright 2004-2009 Internet Systems Consortium.

All rights reserved.

For info, please visit https://www.isc.org/software/dhcp/

 

Listening on LPF/wlan0/aa:bb:cc:dd:ee:ff

Sending on   LPF/wlan0/aa:bb:cc:dd:ee:ff

Sending on   Socket/fallback

DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3

DHCPOFFER from 192.168.1.254

DHCPREQUEST on wlan0 to 255.255.255.255 port 67

DHCPACK from 192.168.1.254

bound to 192.168.1.235 -- renewal in 801 seconds.

查看配置

[root@FORLINX6410]# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr aa:bb:cc:dd:ee:ff

          inet addr:192.168.1.235  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:99322 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1577 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6920184 (6.5 MiB)  TX bytes:185103 (180.7 KiB) 

配置结束,打开浏览器,输入无线账号、密码,现在可以上网了。

 

 

有一个问题:#dmesg查看内核缓冲区,发现一直输出,不知何故。

GetDesiredTssiAndCurrentTssi: BBP TSSI INFO is not ready. (

BbpR47 = 0x4)

AsicAdjustTxPower: Incorrect desired TSSI or current TSSI

GetDesiredTssiAndCurrentTssi: BBP TSSI INFO is not ready. (BbpR47 = 0x4)

AsicAdjustTxPower: Incorrect desired TSSI or current TSSI

 

GetDesiredTssiAndCurrentTssi: BBP TSSI INFO is not ready. (BbpR47 = 0x4)

AsicAdjustTxPower: Incorrect desired TSSI or current TSSI

 

 

-------------------------------------------------------------------------------------------

另外,Linux 内核3.0.1 自带RT53** RT28**等系统芯片的驱动drivers/net/wireless/rt2x00/,不需要再去下载驱动,并且不会出现上面的问题。

插入USB无线网卡后,系统识别,输出

usb 1-1: new full speed USB device number 5 using s3c2410-ohci

usb 1-1: not running at top speed; connect to a high speed hub

usb 1-1: New USB device found, idVendor=148f, idProduct=5370

usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3

usb 1-1: Product: 802.11 n WLAN

usb 1-1: Manufacturer: Ralink

usb 1-1: SerialNumber: 1.0

phy1 -> rt2x00_set_chip: Info - Chipset detected - rt: 5390, rf: 5370, rev: 0502

.

 

接着,将驱动源码目录下common/rt2870.bin文件拷贝到开发板/lib/firmware/目录下

 

激活无线接口

[root@FORLINX6410]# ifconfig wlan0 up

phy1 -> rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'.

phy1 -> rt2x00lib_request_firmware: Info - Firmware detected - version: 0.236.

phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 0 - CWmin: 3, CWmax: 4, Ai

fs: 2, TXop: 102.

phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 1 - CWmin: 4, CWmax: 5, Ai

fs: 2, TXop: 188.

phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 2 - CWmin: 5, CWmax: 10, A

ifs: 3, TXop: 0.

phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 3 - CWmin: 5, CWmax: 10, A

ifs: 7, TXop: 0.

[root@FORLINX6410]# phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 2 - CW

min: 4, CWmax: 10, Aifs: 3, TXop: 0.

phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 3 - CWmin: 4, CWmax: 10, A

ifs: 7, TXop: 0.

phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 1 - CWmin: 3, CWmax: 4, Ai

fs: 2, TXop: 94.

phy1 -> rt2x00mac_conf_tx: Info - Configured TX queue 0 - CWmin: 2, CWmax: 3, Ai

fs: 2, TXop: 47.

 

然后配置无线网络ESSID ,配置自动获取IP后,就可以上网了。

 

 

 

参考

将 RT73 无线网卡驱动移植到 ARM 平台上

http://www.paulchan.tk/site/?p=36

 

无线网卡驱动RT73的移植 (转)

http://www.cnitblog.com/zouzheng/archive/2008/02/18/36358.html

 

你可能感兴趣的:(c,linux,timer,encryption,internet,Signal)