现在的位置: 首页 > 综合 > 正文

配置NW330USB无线网卡到FL2440

2013年06月17日 ⁄ 综合 ⁄ 共 2670字 ⁄ 字号 评论关闭
参考了大侠hugerat的文章,非常感谢!

http://blog.chinaunix.net/u2/75270/showart_1870742.html

参考了FL官方论坛斑竹的贴子移植linux2.6.33内核,非常感谢!http://bbs.witech.com.cn/thread-468-1-1.html

我的无线网卡是NW330,打电话问了售后,他们公司不提供该网卡的linux driver,告诉我芯片是8187的,让我去瑞昱的网站去下,我搜了半个小时毫无结果,失望之下意外发现linux2.6.32的内核选项中有8187的网卡驱动,so greate!

2.6.28内核是否支持该无线网卡就不知道了,决定移植2.6.32内核了,之前也移植过内核,所以不是很难,LCD的配置是我自己跟据手册配置的,大部分差不多,也就不单独再整理篇内核移植了。

 

移植内核。。。

     

开始配置内核中8187网卡驱动,原来驱动是在:

      Device Drivers-->

           [*]Network Device Support-->

                 [*]Wireless LAN-->

                      [*]Wireless LAN(IEEE 802.11)-->

但是我发现移植后的网卡驱动内核选项并没有出现,应该是依赖问题,查看该目录下的Kconfig,发现依赖于MAC80211,于是配置:

      [*]Networking Support-->

           [*]Wireless-->

                 <*> cfg80211 - wireless configuration API

                 <*> Generic IEEE 802.11 Networking Stack (mac80211)

当时mac80211是不是能设置为<*>忘记了,但是返回去查看Wireless LAN(IEEE 802.11)目录下出现了8187网卡的驱动,

<M>   Realtek 8187 and 8187B USB support

不过只能选为M,估计还是依赖问题,但看Kconfig没有更多发现了,就先把模块编译出来了,然后用modinfo查看rtl8187.ko的信息,发现依赖:

      depends:        mac80211,eeprom_93cx6,led-class,cfg80211

那么只要把上面的依赖都设置为<*>,网卡驱动应该也可以加入内核了。

配置:

      Device Drivers-->

           -*- LED Support-->

                 <*>   LED Class Support

      Device Drivers-->

           [*] Misc devices  --->

                 EEPROM support  --->  

                      <*>  EEPROM 93CX6 support

再次编译内核,make zImage,烧写到开发板,插入NW330无线网卡后出现:

usb 1-1.4: USB disconnect, address 3

usb 1-1.4: new full speed USB device using s3c2410-ohci and address 4

usb 1-1.4: configuration #1 chosen from 1 choice

phy1: hwaddr 08:10:74:94:be:5c, RTL8187BvE V0 + rtl8225z2, rfkill mask 2

rtl8187: Customer ID is 0x00

Registered led device: rtl8187-phy1::tx

Registered led device: rtl8187-phy1::rx

rtl8187: wireless switch is on

使用cat /proc/net/wireless后可以看到wlan0网卡,说明网卡已被正确识别。

ifconfig wlan0 up

没有出现任何信息,ifconfig查看一下,发现出现了wlan0,网卡已经工作了,设置IP后发现无法和同网段的主机PING通,参考大侠hugerat的帖子,原来还要配置无线网卡才能正常工作的。

下载配置工具:

http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools.29.tar.gz

解压后修改Makefile:

CC = /usr/local/arm/4.3.2/bin/arm-linux-gcc

AR = /usr/local/arm/4.3.2/bin/arm-linux-ar

RANLIB = /usr/local/arm/4.3.2/bin/arm-linux-ranlib

BUILD_STATIC = y

然后make,可以得到一些工具,把这些工具添加到开发板/bin目录下。

把工具放入开发板/bin目录下,库放到/lib目录下,开始配置无线网卡:

      启动无线网卡:

ifconfig wlan0 up

获取路由器ESSID

iwlist scanning

 

设置ESSID

iwconfig wlan0 essid “TP-LINK_5CB8A4”

设置密码,支持WEP的,长度为5字符(WAP的没研究过)

iwconfig wlan0 key s:uuuuu

设置网卡IP

ifconfig wlan0 192.168.1.133

设置网关:

route add default gw 192.168.1.1

设置DNS:

echo “nameserver 192.168.1.1” > /ect/resolv.conf

OK,开始联网:

iwconfig wlan0 ap auto

 

配置成脚本:

#! /bin/sh

echo "setting the wireless..." > /dev/tty1

ifconfig wlan0 up

iwconfig wlan0 essid "TP-LINK_5CB8A4"

iwconfig wlan0 key loveu

ifconfig wlan0 192.168.1.133

route add default gw 192.168.1.1

echo "nameserver 192.168.1.1" > /ect/resolv.conf

iwconfig wlan0 ap auto

问题:运行配置脚本后网卡不能起来,再运行一次iwconfig wlan0 ap auto就可以了,原因不明。

抱歉!评论已关闭.