无线网卡驱动RT73的移植 1.下载最新版的RT73无线网卡驱动: # wget http://rt2x00.serialmonkey.com/rt73-cvs-daily.tar.gz 解压:# tar zxvf rt73-cvs-daily.tar.gz 2.在内核中创建新文件夹drivers/usb/net/rt73, # mkdir drivers/usb/net/rt73 将解压出来的文件夹Module下的文件拷贝到刚才新建的rt73文件夹中: # cp rt73-(time)/Module/* /home/oem/trunk/cirrus-1-0-0-4/linux- 2.6.8 .1/drivers/usb/net/rt73 3.修改Qwerk板内核源代码,加入RT73驱动的配置信息,以使在make menuconfig 中能添加RT73驱动的选项。 ?修改drivers/usb/net/Kconfig文件,加入RT73的驱动模块的配置项: # gedit drivers/usb/net/Kconfig & 加入以下内容: config RT73 tristate “support for rt73 wireless usb device” depends on USB && NET && USB_USBNET ?修改drivers/usb/net/Makefile, 加入rt73的编译项: # gedit drivers/usb/net/Makefile & 添加一下内容: obj-$(CONFIG_RT73)+= rt73/ 4.修改RT73的Makefile,设置内核位置和编译选项: ?删除以前的modules选项,并将arm编译项改成modules,这样编译的时候才是for ARM版本的驱动模块; ?修改KERNDIR为Qwerk内核位置: KERNDIR=/home/oem/trunk/cirrus-1-0-0-4/linux-2.6.8.1 5.配置内核: ?将Qwerk默认配置拷贝到内核根目录下: # cp ../edb9302/linux.config .config ?用make menuconfig界面配置编译选项,选上RT73无线网卡编译选项: 在USB devices à network à support for rt73 wireless usb device,按空格键选为M,将其编译成模块。 6.编译内核模块: # make modules 成功编译后,会在drivers/usb/net/rt73目录下生成rt73.ko驱动文件,将其拷贝到FTP目录下,以便于下载到Qwerk板上: # cp drivers/usb/net/rt73/rt73.ko /home/ftp/ 7.下载rt73驱动到Qwerk上,并修改一些脚本文件使其开机加载驱动并启用网卡: 假设Qwerk板已经可以启动起来(烧写系统可以参考QwerkDevelopmentGuide),启动Qwerk板,从minicom命令行操作: # cd /opt/driver/ # wget ftp://192.168.1.201/rt73.ko 编写开机加载rt73.ko驱动、启用网卡脚本,将其放入/opt/scripts/目录下: # cd ../scripts/ # vi wifi-up 加入如下内容:
#!/bin/sh THE_SSID=your_SSID_name; PATH_TO_USBDRIVER=/opt/drivers cd $PATH_TO_USBDRIVER && echo "Configuring wireless device to work in managed mode with SSID=$THE_SSID ..."; /sbin/insmod rt73.ko && /sbin/ifconfig rausb0 up address YOUR_IP_ADDRESS && echo "status before iwconfig"; /sbin/iwconfig rausb0 && /sbin/iwconfig rausb0 mode managed && /sbin/iwconfig rausb0 key s:YOUR_PASSWORD && /sbin/iwconfig rausb0 channel 6 && /sbin/iwconfig rausb0 essid $THE_SSID && echo "status after iwconfig"; /sbin/iwconfig rausb0; echo "Successfully configured with SSID $THE_SSID";
修改/opt/scripts/robot.init脚本文件,在最后添加wifi-up脚本: # vi robot.init 加入: /opt/scripts/wifi-up 保存推出。 8.至此为止,无线网卡驱动移植和配置工作已经完成,重启Qwerk,无线网卡就能工作了。 说明: 1.如果按照modules编译的rt73.ko不能工作的话,可以选用armdebug编译。 附一个老外的指导: put the contents of the Module directory into my arm 2.6.15 kernel tree under drivers/usb/net/rt73, then did the following to make it part of the kernel build: - I added to the /drivers/usb/net/Kconfig to add an option to enable the rt73 module, - Then edited the Makefile in /drivers/usb/net to have it build the subdir rt73 when the option above is active. Then I ran the kernel menuconfig to actually enable that option. Finally I edited the Makefile for the rt73 driver itself: - put the right paths in KERNEL_SOURCE and MODULE_ROOT - removed the calls to /sbin/depmod since we're not on the target system - deleted the module and debug rules - renamed arm rule to module and armdebug rule to debug At this point doing make modules && make modules_install from the kernel root did the trick. I'm not sure if this will be enough on your system. It worked for me. By wuzechun MSN:chernwu at hotmail.com