blueice2:/# lspci -s 30:00.0 30:00.0 Network controller: Broadcom Corporation Dell Wireless 1390 WLAN Mini-PCI Card (rev 02) blueice2:/# lspci -n -s 30:00.0 30:00.0 0280: 14e4:4311 (rev 02) |
我使用ndiswrapper的方式驱动这块网卡。
首先需要安装ndiswrapper,在debian sid中, ndiswrapper包括3个软件包ndiswrapper-common,
ndiswrapper-source,ndiswrapper-utils-1.9,其中ndiswrapper-source是ndiswrapper内核模块的源代码,可以使用module-assistant安装。
module-assistant会根据当前内核的情况生成并安装kernel module软件包, 同时将根据包依赖关系安装ndiswrapper-common,ndiswrapper-utils-1.9两个软件包。 在我的系统中,安装了如下软件包:
blueice2:~# dpkg -l |grep ndis ii ndiswrapper-common 1.47-2 Common scripts required to use the utilities ii ndiswrapper-modules-2.6.22-2-k7 1.47-2+2.6.22-4 ndiswrapper Linux kernel module ii ndiswrapper-source 1.47-2 Source for the ndiswrapper Linux kernel modu ii ndiswrapper-utils-1.9 1.47-2 Userspace utilities for the ndiswrapper Linu |
由于kernel中除ndiswrapper外还有一个模块bcm43xx可用来驱动bcm4300系列无线网卡,需要在/etc/modprobe.d/blacklist中增加一行“blacklist bcm43xx”来阻止bcm43xx在启动时被载入,并在/etc/modules中增加行"ndiswrapper"设置系统启动时载入ndiswrapper。重启系统使设置生效。
从下载bcm43xx在windows下的驱动,在windows下运行或使用wine运行,生成解压后的目录SP34152A, 这个目录下有个文件bcmwl5.inf。
运行ndiswrapper -i /
blueice2:~# ndiswrapper -l bcmwl5 : driver installed device (14E4:4311) present (alternate driver: bcm43xx) |
此时可使用ifconfig -a查到wlan0网络接口,并可使用iwconfig配置该接口.
blueice2:~# ifconfig -a eth0 Link encap:Ethernet HWaddr 00:1A:4B:61:08:E8 BROADCAST MULTICAST MTU:1500 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:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:20 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:58 errors:0 dropped:0 overruns:0 frame:0 TX packets:58 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4020 (3.9 KiB) TX bytes:4020 (3.9 KiB) wlan0 Link encap:Ethernet HWaddr 00:1A:73:81:CC:EC BROADCAST MULTICAST MTU:1500 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:1000 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:21 Memory:c8000000-c8004000 blueice2:~# iwconfig lo no wireless extensions. eth0 no wireless extensions. wlan0 IEEE 802.11g ESSID:off/any Mode:Managed Frequency:2.462 GHz Access Point: Not-Associated Bit Rate:54 Mb/s Tx-Power:32 dBm RTS thr:2347 B Fragment thr:2346 B 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 blueice2:~# iwconfig wlan0 key s:1111222233444 [2] blueice2:~# iwconfig wlan0 key open [2] blueice2:~# iwconfig lo no wireless extensions. eth0 no wireless extensions. wlan0 IEEE 802.11g ESSID:"beijin" Mode:Managed Frequency:2.412 GHz Access Point: 08:00:2D:13:F4:6A Bit Rate=54 Mb/s Tx-Power:32 dBm RTS thr:2347 B Fragment thr:2346 B Encryption key:3039-3657-3235-3433-3223-6154-63 [2] Security mode:open 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 blueice2:~# ifconfig 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:58 errors:0 dropped:0 overruns:0 frame:0 TX packets:58 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:4020 (3.9 KiB) TX bytes:4020 (3.9 KiB) blueice2:~# ifconfig wlan0 up blueice2:~# dhclient wlan0 Internet Systems Consortium DHCP Client V3.0.6 Copyright 2004-2007 Internet Systems Consortium. All rights reserved. For info, please visit Listening on LPF/wlan0/00:1a:73:83:cd:ea Sending on LPF/wlan0/00:1a:73:83:cd:ea Sending on Socket/fallback DHCPREQUEST on wlan0 to 255.255.255.255 port 67 DHCPACK from 192.168.0.1 bound to 192.168.0.10 -- renewal in 39594 seconds. blueice2:~# ping -c 2 PING .fastcdn.com (60.28.166.84) 56(84) bytes of data. 64 bytes from 60.28.166.84: icmp_seq=1 ttl=54 time=34.2 ms 64 bytes from 60.28.166.84: icmp_seq=2 ttl=54 time=33.7 ms --- .fastcdn.com ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 5335ms rtt min/avg/max/mdev = 33.763/33.995/34.227/0.232 ms |
在我的环境中只许需要配置好密钥和密钥序号,驱动程序就能够找到essid,无须收工设置。
在设置密钥时要特别注意安全模式, ndiswrapper默认的安全模式是“restricted”,而我的环境中无线路由器的模式安全模式为“open”,为这个问题折腾了一天的时间。
使用ndiswrapper也可以用于别的无线网卡,我还测试了一块tp-link TL-WN321G的usb 无线网卡, 工作正常。
后记:
在使用的过程中发现一个小bug:如果在windows中按“蓝色的无线网络按钮”将无线网卡移出后, 进入Linux, 无论怎么按“蓝色的无线网络按钮”都无法启用无线网络。不过删除/etc/modprobe.d/blacklist中的“blacklist bcm43xx”行, 并运行update-initramfs -u更新initrd,img文件后“蓝色的无线网络按钮”就可以启动无线网络了。