Madwifi
背景知识
MadWifi 全称是Multiband Atheros Driver for Wifi,使用Atheros系列芯片的802.11a/b/g无线网卡在linux下驱动程序。
市面上有很多基于Atheros芯片的无线网卡,例如DLink的DWL-G650。
特别注意,在中国大陆市场上出售的DLink的DWL-G650+A 不是基于Atheros芯片组,而是Ralink芯片组,不能使用madwifi驱动!!!
MadWifi的官方网站为http://www.madwifi.org
系统要求
要用MadWifi驱动您的无线网卡,您的系统至少要满足以下的条件:
- 有一张使用Atheros系列芯片的无线网卡
- 较新的内核(推荐2.6.xx)
- 内核打开了和802.11相关的支持
如果您没有手动更新过您的内核的话,Magic Linux 2.0能符合这些要求。
安装 MadWifi
检查系统是否能认出无线网卡
首先我们用lspci确定一下系统是否能认出无线网卡:
[mhh@wheat ~]$ lspci -v
如果系统能认出您的网卡,您应该能看到类似以下的信息:
07:00.0 Ethernet controller: Atheros Communications, Inc. AR5212 Multiprotocol MAC/baseband processor (rev 01)
Subsystem: D-Link System Inc D-Link AirPlus G DWL-G650+A Wireless Cardbus Adapter
Flags: bus master, medium devsel, latency 168, IRQ 5
Memory at 48000000 (32-bit, non-prefetchable) [size=64K]
Capabilities: <access denied>
编译安装
从http://www.madwifi.org下载madwifi-ng的最新snapshots,然后将源代码解压。例如:
tar zxf madwifi-ng-current.tar.gz
进入madwifi的目录,仔细阅读目录下的文档,然后开始编译安装:
[mhh@wheat ~]$ cd madwifi-ng-r1454-20060222/
[mhh@wheat madwifi-ng-r1454-20060222]$ make
....
[mhh@wheat madwifi-ng-r1454-20060222]$ su
Password:
[mhh@wheat madwifi-ng-r1454-20060222]# make install
....
配置无线网卡
注意:更具体的内容可参见http://www.madwifi.org。
加载madwifi内核模块:
[mhh@wheat ~]# modprobe ath_pci
启动无线网卡:
[mhh@wheat ~]# ifconfig ath0 up
如果一切正常,您可以用Magic Linux 2.0中的无线网络助手解决剩下的问题 :-)
疑难解答
给ath/if_ath_pci.c 打补丁
由于无线网卡种类繁多,MadWifi可能不能识别所有使用Atheros芯片的无线网卡(如DLink的DWL-G650+A),这时您可以试试给ath/if_ath_pci.c打上补丁,使得MadWifi”认识“您的网卡。
首先通过lspci -n找出无线网卡的PCI ID:
lspci -n
在结果中找到和lspci -v对应的项:
07:00.0 0200: 168c:001a (rev 01)
其中168c:001a即为无线网卡的PCI ID。
修改ath/if_ath_pci.c,在__devinitdata结构加上您的无线网卡的PCI ID项:
static struct pci_device_id ath_pci_id_table[] __devinitdata = {
{ 0x168c, 0x0007, PCI_ANY_ID, PCI_ANY_ID },
{ 0x168c, 0x0012, PCI_ANY_ID, PCI_ANY_ID },
{ 0x168c, 0x0013, PCI_ANY_ID, PCI_ANY_ID },
{ 0xa727, 0x0013, PCI_ANY_ID, PCI_ANY_ID }, /* 3com */
{ 0x10b7, 0x0013, PCI_ANY_ID, PCI_ANY_ID }, /* 3com 3CRDAG675 */
{ 0x10b7, 0x001a, PCI_ANY_ID, PCI_ANY_ID }, /* DLINK DWL-G650+A */
{ 0x168c, 0x1014, PCI_ANY_ID, PCI_ANY_ID }, /* IBM minipci 5212 */
{ 0x168c, 0x1014, PCI_ANY_ID, PCI_ANY_ID }, /* IBM minipci 5212 */
{ 0x168c, 0x101a, PCI_ANY_ID, PCI_ANY_ID }, /* some Griffin-Lite */
....
保存文件后,重新编译安装madwifi,并重启计算机。