红联Linux门户
Linux帮助

FC5下usb无线网卡TL-WN620G安装、配置及网络通讯实现

发布时间:2006-12-30 09:14:09来源:红联作者:xjzhang518
FC5下usb无线网卡TL-WN620G安装、配置及网络通讯实现
张小军
12.27.2006

最近在linux系统上安装了一块TPLINK 的USB无线网卡。希望给大家有点帮助!!!!
kernel是2.6.15-1.2054_FC5-i686 ;驱动用的是ndiswrapper;同时查看ndiswrapper是否支持你的网卡
http://ndiswrapper.sourceforge.net/mediawiki/index.php/List

1. 安装fc5的时候要装kernel开发包。

2. 下载ndiswrapper 源码ndiswrapper-1.32.tar.gz.
http://sourceforge.net/projects/ndiswrapper/

3. 安装ndiswrapper
参考
http://ndiswrapper.sourceforge.net/mediawiki/index.php/Installation
(1) 首先,创建一个与内核源码的连接:
#ln -s /usr/src/kernels/2.6.15-1.2054_FC5-i686 /lib/modules/2.6.15-1.2054_FC5/build
(2)安装:#tar -zxvf ndiswrapper-1.32.tar.gz.tar.gz
#cd ndiswrapper-1.32

4. 安装 driverloader-2.35_k2.6.15_1.2054_FC5.stk16-1fdr.i686.rpm.zip
因为最近的2.6版内核有一个enabel/disable 4K stack size 的选项,然而Fedora的内核是关闭了该选项的,同时使用的4K堆栈的大小。当你加载内核模块modprobe ndiswrapper 时,会出现一个警告,你运行的驱动可能需要超过4K的堆栈。所以需要安装16K的堆栈内核。
下载网站:
http://www.linuxant.com/driverloader/wlan/full/downloads.php
解压:#unzip driverloader-2.35_k2.6.15_1.2054_FC5.stk16-1fdr.i686.rpm.zip
安装rpm包:#rpm -i driverloader-2.35_k2.6.15_1.2054_FC5.stk16-1fdr.i686.rpm

5. 然后编译ndiswrapper.
#make uninstall
#make distclean
#make
#make install

6.安装WINDOWS driver
下载 TP-LINK usb 网卡(tl-wn620g)for windows xp的驱动.
http://www.tp-link.com.cn/)在xp 的驱动中找到 net5523.inf ,net5523.sys,athfmwdl.inf,athfmwdl.sys 文件. 放在同一个目录中. 把这个windows xp驱动安装到ndiswrapper中.
#ndiswrapper -i net5523.inf
#ndiswrapper -i sthfmwdl.inf
#ndiswrapper -i TL-WN620G.inf
这步将适当的文件安装到/etc/ndiswrapper/下,你可以执行如下操作以检查确认ndiswrapper:
#ndiswrapper -l

7. 加载内核模块
# modprobe ndiswrapper
加载成功后,网卡灯会开始正常的闪。

8. 运行 dmesg|tail 查看一下是不是装上了.
usb 5-8: reset high speed USB device using ehci_hcd and address 2
ndiswrapper: driver net5523 (,02/24/2005,1.1.0.25) loaded
wlan0: ethernet device 00:0a:eb:a5:81:e0 using NDIS driver: net5523, version: 0x10001, NDIS version : 0x501, vendor: '', 0CF3:0001.F.conf
wlan0: encryption modes supported: WEP; TKIP with WPA; AES/CCMP with WPA
usbcore: registered new driver ndiswrapper
显示上述信息表示已装上。
#iwconfig
wlan0 IEEE 802.11b ESSID:off/any
Mode:Managed Frequency:2.412 GHz Access Point: Not-Associated
Bit Rate:108 Mb/s
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

9.配置接口:
# iwconfig wlan0 essid ESSID
# iwlist wlan0 scan
wlan0 Scan completed :
Cell 01 - Address: 00:14:78:A5:AE:D4
ESSID:"TP-LINK"
Protocol:IEEE 802.11g
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality:78/100 Signal level:-46 dBm Noise level:-96 dBm
Encryption key:off
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Extra:bcn_int=100
Extra:atim=0
搜索到附近的AP信息。说明网卡已经成功驱动,可以使用了。

10. 在/etc/sysconfig/network-scripts目录中创建ifcfg-wlan0配置文件.
下面式我的配置信息,仅供参考:
DEVICE=wlan0
BOOTPROTO=dhcp
HWADDR= 00:14:78:A5:AE:D4
ONBOOT=yes
USERCTL=no
IPV6INIT=no
PEERDNS=yes
ESSID="TP-LINK"
Protocol=IEEE802.11g
Mode=Managed

11. 运行 system-config-network, 你会发现多了一个网卡wlan0. 启动它就好了.
#ifconfig wlan0 up 将网络接口挂起,简单的配置(neat命令)就可以实现网卡的正常通讯功能了。
大功告成.

相关安装信息参考网站:
http://ndiswrapper.sourceforge.net/mediawiki/index.php/Distributions


附件:
整个过程的操作流程:(仅供参考)
[root@localhost ~]# cd /home/xjzhang/
[root@localhost xjzhang]# cd ndiswrapper-1.32 // ndiswrapper的解压位置。
[root@localhost ndiswrapper-1.32]# make uninstall
NOTE: Not all installed files are removed, as different distributions install nd iswrapper files at different places.
Run uninstall as many times as necessary until no "removing" messages appear bel ow.
removing /sbin/loadndisdriver
removing /usr/sbin/ndiswrapper
removing /usr/sbin/ndiswrapper-buginfo
removing /lib/modules/2.6.15-1.2054_FC5/misc/ndiswrapper.ko
[root@localhost ndiswrapper-1.32]# make distclean
make -C driver clean
make[1]: Entering directory `/home/xjzhang/ndiswrapper-1.32/driver'
rm -rf ndiswrapper.ko ndiswrapper.o crt.o hal.o iw_ndis.o loader.o ndis.o ntoske rnel.o ntoskernel_io.o pe_linker.o pnp.o proc.o rtl.o wrapmem.o wrapndis.o wrapp er.o usb.o divdi3.o usb.o win2lin_stubs.o \
divdi3.o workqueue.o .*.ko.cmd .*.o.cmd \
ndiswrapper.mod.[oc] *~ .tmp_versions Modules.symvers Module.symvers
make[1]: Leaving directory `/home/xjzhang/ndiswrapper-1.32/driver'
make -C utils clean
make[1]: Entering directory `/home/xjzhang/ndiswrapper-1.32/utils'
rm -f *~ *.o loadndisdriver
make[1]: Leaving directory `/home/xjzhang/ndiswrapper-1.32/utils'
rm -f *~
rm -fr ndiswrapper-1.32 ndiswrapper-1.32.tar.gz patch-stamp
make -C driver distclean
make[1]: Entering directory `/home/xjzhang/ndiswrapper-1.32/driver'
rm -rf ndiswrapper.ko ndiswrapper.o crt.o hal.o iw_ndis.o loader.o ndis.o ntoske rnel.o ntoskernel_io.o pe_linker.o pnp.o proc.o rtl.o wrapmem.o wrapndis.o wrapp er.o usb.o divdi3.o usb.o win2lin_stubs.o \
divdi3.o workqueue.o .*.ko.cmd .*.o.cmd \
ndiswrapper.mod.[oc] *~ .tmp_versions Modules.symvers Module.symvers
rm -f *_exports.h .\#* win2lin_stubs.h
make[1]: Leaving directory `/home/xjzhang/ndiswrapper-1.32/driver'
make -C utils distclean
make[1]: Entering directory `/home/xjzhang/ndiswrapper-1.32/utils'
rm -f *~ *.o loadndisdriver
rm -f .\#*
make[1]: Leaving directory `/home/xjzhang/ndiswrapper-1.32/utils'
rm -f .\#*
[root@localhost ndiswrapper-1.32]# make
make -C driver
make[1]: Entering directory `/home/xjzhang/ndiswrapper-1.32/driver'
make -C /lib/modules/2.6.15-1.2054_FC5/build SUBDIRS=/home/xjzhang/ndiswrapper-1 .32/driver
make[2]: Entering directory `/usr/src/redhat/BUILD/kernel-2.6.15/linux-2.6.15.i6 86'
LD /home/xjzhang/ndiswrapper-1.32/driver/built-in.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/crt.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/hal.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/iw_ndis.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/loader.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/ndis.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/ntoskernel.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/ntoskernel_io.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/pe_linker.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/pnp.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/proc.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/rtl.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/wrapmem.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/wrapndis.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/wrapper.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/usb.o
CC [M] /home/xjzhang/ndiswrapper-1.32/driver/divdi3.o
LD [M] /home/xjzhang/ndiswrapper-1.32/driver/ndiswrapper.o
Building modules, stage 2.
MODPOST
CC /home/xjzhang/ndiswrapper-1.32/driver/ndiswrapper.mod.o
LD [M] /home/xjzhang/ndiswrapper-1.32/driver/ndiswrapper.ko
make[2]: Leaving directory `/usr/src/redhat/BUILD/kernel-2.6.15/linux-2.6.15.i68 6'
*** WARNING: This kernel seems to use 4K stack size option (CONFIG_4KSTACKS); ma ny Windows drivers will not work with this option enabled. Disable CONFIG_4KSTAC KS option, recompile and install kernel
make[1]: Leaving directory `/home/xjzhang/ndiswrapper-1.32/driver'
make -C utils
make[1]: Entering directory `/home/xjzhang/ndiswrapper-1.32/utils'
gcc -g -Wall -I../driver -o loadndisdriver loadndisdriver.c
make[1]: Leaving directory `/home/xjzhang/ndiswrapper-1.32/utils'
[root@localhost ndiswrapper-1.32]# make install
make -C driver install
make[1]: Entering directory `/home/xjzhang/ndiswrapper-1.32/driver'
make -C /lib/modules/2.6.15-1.2054_FC5/build SUBDIRS=/home/xjzhang/ndiswrapper-1.32/driver
make[2]: Entering directory `/usr/src/redhat/BUILD/kernel-2.6.15/linux-2.6.15.i686'
Building modules, stage 2.
MODPOST
make[2]: Leaving directory `/usr/src/redhat/BUILD/kernel-2.6.15/linux-2.6.15.i686'
*** WARNING: This kernel seems to use 4K stack size option (CONFIG_4KSTACKS); many Windows drivers will not work with this option enabled. Disable CONFIG_4KSTACKS option, recompile and install kernel
echo /lib/modules/2.6.15-1.2054_FC5/misc
/lib/modules/2.6.15-1.2054_FC5/misc
mkdir -p /lib/modules/2.6.15-1.2054_FC5/misc
install -m 0644 ndiswrapper.ko /lib/modules/2.6.15-1.2054_FC5/misc
/sbin/depmod -a 2.6.15-1.2054_FC5 -b /
make[1]: Leaving directory `/home/xjzhang/ndiswrapper-1.32/driver'
make -C utils install
make[1]: Entering directory `/home/xjzhang/ndiswrapper-1.32/utils'
install -D -m 755 loadndisdriver /sbin/loadndisdriver
install -D -m 755 ndiswrapper /usr/sbin/ndiswrapper
install -D -m 755 ndiswrapper-buginfo /usr/sbin/ndiswrapper-buginfo
NOTE: Windows driver configuration file format has changed since 1.5. You must re-install Windows drivers if they were installed before.
make[1]: Leaving directory `/home/xjzhang/ndiswrapper-1.32/utils'
mkdir -p -m 0755 /usr/share/man/man8
install -m 644 ndiswrapper.8 /usr/share/man/man8
install -m 644 loadndisdriver.8 /usr/share/man/man8
[root@localhost ndiswrapper-1.32]# ndiswrapper -i net5523.inf
driver net5523 is already installed
[root@localhost ndiswrapper-1.32]# ndiswrapper -i athfmwdl.inf
driver athfmwdl is already installed
[root@localhost ndiswrapper-1.32]# ndiswrapper -l
athfmwdl : driver installed
net5523 : driver installed
[root@localhost ndiswrapper-1.32]# modprobe ndiswrapper //重启后,重新从该步骤开始执行,启动网卡
[root@localhost ndiswrapper-1.32]# dmesg|tail
audit(1167183586.828:12): avc: granted { execmem } for pid=2444 comm="nautilus" scontext=root:system_r:unconfined_t:s0-s0:c0.c255 tcontext=root:system_r:unconfined_t:s0-s0:c0.c255 tclass=process
audit(1167183586.828:13): avc: granted { execmem } for pid=2444 comm="nautilus" scontext=root:system_r:unconfined_t:s0-s0:c0.c255 tcontext=root:system_r:unconfined_t:s0-s0:c0.c255 tclass=process
audit(1167183586.828:14): avc: granted { execmem } for pid=2444 comm="nautilus" scontext=root:system_r:unconfined_t:s0-s0:c0.c255 tcontext=root:system_r:unconfined_t:s0-s0:c0.c255 tclass=process
audit(1167183642.660:15): avc: granted { execmem } for pid=2444 comm="nautilus" scontext=root:system_r:unconfined_t:s0-s0:c0.c255 tcontext=root:system_r:unconfined_t:s0-s0:c0.c255 tclass=process
ndiswrapper version 1.32 loaded (preempt=no,smp=no)
usb 1-8: reset high speed USB device using ehci_hcd and address 2
ndiswrapper: driver net5523 (,02/24/2005,1.1.0.25) loaded
wlan0: ethernet device 00:0a:eb:a5:81:e0 using NDIS driver: net5523, version: 0x10001, NDIS version: 0x501, vendor: '', 0CF3:0001.F.conf
wlan0: encryption modes supported: WEP; TKIP with WPA; AES/CCMP with WPA
usbcore: registered new driver ndiswrapper
[root@localhost ndiswrapper-1.32]# iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
sit0 no wireless extensions.
wlan0 IEEE 802.11b ESSID:off/any
Mode:Managed Frequency:2.412 GHz Access Point: Not-Associated
Bit Rate:54 Mb/s
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
[root@localhost ndiswrapper-1.32]# iwconfig wlan0 essid ESSID
[root@localhost ndiswrapper-1.32]# iwlist wlan0 scan
wlan0 Scan completed :
Cell 01 - Address: 00:14:78:A5:AE:D4
ESSID:"TP-LINK"
Protocol:IEEE 802.11g
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality:100/100 Signal level:-28 dBm Noise level:-96 dBm
Encryption key:off
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Extra:bcn_int=100
Extra:atim=0
[root@localhost ~]# iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
sit0 no wireless extensions.
wlan0 IEEE 802.11b ESSID:"ESSID" Nickname:"localhost.localdomain"
Mode:Managed Frequency:2.437 GHz Access Point: Not-Associated
Bit Rate=108 Mb/s
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
[root@localhost ~]# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.2 icmp_seq=2 Destination Host Unreachable
From 192.168.1.2 icmp_seq=3 Destination Host Unreachable
From 192.168.1.2 icmp_seq=4 Destination Host Unreachable
From 192.168.1.2 icmp_seq=6 Destination Host Unreachable
From 192.168.1.2 icmp_seq=7 Destination Host Unreachable
From 192.168.1.2 icmp_seq=8 Destination Host Unreachable
--- 192.168.1.1 ping statistics ---
11 packets transmitted, 0 received, +6 errors, 100% packet loss, time 10000ms
, pipe 3
[root@localhost ~]# ifconfig wlan0 up //看来是要挂起接口wlan0网络才联通。
[root@localhost ~]# ping 192.168.0.101 //测试以太网
PING 192.168.0.101 (192.168.0.101) 56(84) bytes of data.
64 bytes from 192.168.0.101: icmp_seq=1 ttl=64 time=0.071 ms
64 bytes from 192.168.0.101: icmp_seq=2 ttl=64 time=0.062 ms
64 bytes from 192.168.0.101: icmp_seq=3 ttl=64 time=0.062 ms
64 bytes from 192.168.0.101: icmp_seq=4 ttl=64 time=0.060 ms
--- 192.168.0.101 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.060/0.063/0.071/0.010 ms
//#neat将IP地址为192.168.1.2和192.168.1.3两台机器的网络工作模式设置为Infrastructuer(分布式)
[root@localhost ~]# ping 192.168.1.1//路由器
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=6.67 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.31 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=1.30 ms
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 1.307/3.100/6.676/2.528 ms
[root@localhost ~]# ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.068 ms
64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=0.063 ms
64 bytes from 192.168.1.2: icmp_seq=3 ttl=64 time=0.063 ms
64 bytes from 192.168.1.2: icmp_seq=4 ttl=64 time=0.063 ms
--- 192.168.1.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 2999ms
rtt min/avg/max/mdev = 0.063/0.064/0.068/0.006 ms
[root@localhost ~]# ping 192.168.1.3
PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
64 bytes from 192.168.1.3: icmp_seq=1 ttl=128 time=6.61 ms
64 bytes from 192.168.1.3: icmp_seq=2 ttl=128 time=2.13 ms
64 bytes from 192.168.1.3: icmp_seq=3 ttl=128 time=2.10 ms
64 bytes from 192.168.1.3: icmp_seq=4 ttl=128 time=2.08 ms
64 bytes from 192.168.1.3: icmp_seq=5 ttl=128 time=2.05 ms
64 bytes from 192.168.1.3: icmp_seq=6 ttl=128 time=2.27 ms
--- 192.168.1.3 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5002ms
rtt min/avg/max/mdev = 2.057/2.877/6.615/1.673 ms
//#neat将IP地址为192.168.1.2和192.168.1.3两台机器的网络工作模式设置为Adhoc(对等式)
[root@localhost ~]# ping 192.168.1.2
PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0.068 ms
64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=0.060 ms
64 bytes from 192.168.1.2: icmp_seq=3 ttl=64 time=0.063 ms
--- 192.168.1.2 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.060/0.063/0.068/0.009 ms
[root@localhost ~]# ping 192.168.1.3
PING 192.168.1.3 (192.168.1.3) 56(84) bytes of data.
64 bytes from 192.168.1.3: icmp_seq=1 ttl=128 time=5.85 ms
64 bytes from 192.168.1.3: icmp_seq=2 ttl=128 time=1.83 ms
64 bytes from 192.168.1.3: icmp_seq=3 ttl=128 time=1.80 ms
64 bytes from 192.168.1.3: icmp_seq=4 ttl=128 time=3.13 ms
64 bytes from 192.168.1.3: icmp_seq=5 ttl=128 time=1.75 ms
--- 192.168.1.3 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4000ms
rtt min/avg/max/mdev = 1.757/2.875/5.852/1.576 ms
[root@localhost ~]# ping 192.168.1.1 //对等模式下,路由器不起作用
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.2 icmp_seq=2 Destination Host Unreachable
From 192.168.1.2 icmp_seq=3 Destination Host Unreachable
From 192.168.1.2 icmp_seq=4 Destination Host Unreachable
--- 192.168.1.1 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4000ms
, pipe 3
以上信息表明USB无线网卡完全正常工作,至此将WINDOWS驱动挂载到LINUX下全部完成。


[ 本帖最后由 xjzhang518 于 2006-12-30 09:15 编辑 ]
文章评论

共有 3 条评论

  1. 81.98.124.* 于 2007-06-25 04:52:14发表:

    http://www.ringtones-rate.com/mp3/ ringtones site free. qwest ringtones: Free nokia ringtones here, Download ringtones FREE, Best free samsung ringtones. nextel ringtones from website .

  2. 81.98.124.* 于 2007-06-25 04:51:37发表:

    http://www.ringtones-rate.com/tones/ real ringtones. motorola ringtones: Free nokia ringtones here, Download ringtones FREE, Best free samsung ringtones. http://www.ringtones-rate.com/ring/ [link=http://www.ringtones-rate.com]tracfone ringtones[/link] from site .

  3. 81.98.124.* 于 2007-06-25 04:50:59发表:

    http://www.ringtones-rate.com/tones/ real ringtones. motorola ringtones: Free nokia ringtones here, Download ringtones FREE, Best free samsung ringtones. http://www.ringtones-rate.com/ring/ [link=http://www.ringtones-rate.com]tracfone ringtones[/link] from site .