USB无线网卡(Zydas)移植到Linux

/*2011-3-29 -- 2011-3-30*/

Kernel version :2.6.22.6
Crosstool      :arm-linux-gcc-3.4.1
Board          :FL2440
System         :Ubuntu 10.10
Source         :zd1211-firmware-1.4.tar.bz2, wireless_tools.29.tar.gz

1.配置内核:
/*一般采用WiFi Zyda 2611的网卡,注意在内核中有一个ZB1201的无法驱动比较新的网卡*/

Networking--->
     [*]Networking support
     Wireless-->
           <*>Generic IEEE 802.11 Networking Stack (mac80211)
           <*>Generic IEEE 802.11 Networking Stack
           <*>   Software MAC add-on to the IEEE 802.11 networking stack


Device Drivers--->
     Netword device support--->
          Wireless LAN--->
               [*]Wireless LAN (IEEE 802.11)
               <M>ZyDAS ZD1211/ZD1211B USB-wireless support

注意:要使用firmware,必须要在配置内核时选上:

Device Drivers  --->   
     Generic Driver Options  --->     
          <*> Userspace firmware loading support


否则会出现: Unknown symbol release_firmware 和: Unknown symbol request_firmware 的错误。


2.make uImage

3.make modules /*编译动态模块*/

4.tar xvjf zd1211-firmware-1.4.tar.bz2
mkdir -p /lib/firmware/zd1211/
cp zd1211-firmware/*   lib/firmware/zd1211/

5.此时应该安装应用层的工具.以便在Linux 在ifconfig 下能使用网络结点操作.
一般使用wireless_tools.29.tar.gz这一工具配置结点.

cd /home/arm/work/source
tar zxvf wireless_tools.29.tar.gz

cd wireless_tools.29


vi Makefile
修改Makefile中的以下代码:
## Compiler to use (modify this for cross compile).
CC = gcc
## Other tools you need to modify for cross compile (static lib only).
AR = ar
RANLIB = ranlib

修改后代码:

## Compiler to use (modify this for cross compile).
CC = arm-linux-gcc
## Other tools you need to modify for cross compile (static lib only).
AR = arm-linux-ar
RANLIB = arm-linux-ranlib

6.再执行make,编译完成后,将生成的iwconfig,iwlist文件拷贝到FL2440的根文件系统中的/bin目录下,将
libiw.so.29拷贝到/lib目录下(这里我是用NFS挂PC机上的根文件系统):

cp iwconfig iwlist /home/arm/rootfs/bin/
cp libiw.so.29 /home/arm/rootfs/lib/

7.启动开发板FL2440,执行 insmod zd1211rw.ko 后插入无线网卡显示如下:
# usb 1-1.1: new full speed USB device using s3c2410-ohci and address 3
usb 1-1.1: configuration #1 chosen from 1 choice
usb 1-1.1: reset full speed USB device using s3c2410-ohci and address 3
zd1211rw 1-1.1:1.0: firmware version 4725
zd1211rw 1-1.1:1.0: zd1211b chip 0ace:1215 v4810 full 00-02-72 AL2230_RF pa0 g-S
zd1211rw 1-1.1:1.0: eth1

如果网卡安装成功,应该能在 用 cat /proc/net/wireless 目录下看到网卡,( 注意,在2.6.21以前,要配置CONFIG_NET_RADIO才会显示这个文件系统.更高的版本是自动支持的.):
Inter-| sta-|   Quality        |   Discarded packets               | Missed | WE
 face | tus | link level noise |  nwid  crypt   frag  retry   misc | beacon | 22
  eth1: 0000    0     0     0        0      0      0      0      0        0

由以上看到无线网卡为eth1.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwxxyy.html