我用的wifi是tenda W311MI 150m无线usb网卡 内核版本2.6.37 架构cortex A8
首先去tenda官网下载驱动
移植过程:
1 修改内核配置选项
make clean
make menuconfig
Go into the following menu(s):
Device Drivers -> Generic Driver Options
Select "*" Userspace firmware loading support
(/sbin/mdev) path to uevent helper
Networking Support -> Wireless
Select "*" cfg80211
Select "*" nl80211 testmode command
Select "*" enable developer warnings
Select "*" cfg80211 regulatory debugging
Select "*" enable powersave by default
Select "*" cfg80211 wireless extensions
Select "*" Wireless extensions sysfs files
Select "*" Common routines for IEEE802.11 drivers
Select "*" lib80211 debugging messages
Device Drivers -> Network Device Support -> Wireless LAN
Select "*" Ralink driver support
Go into "Ralink driver support"
Select "*" Ralink rt2500 (USB) support
Select "*" Ralink rt2501/rt73 (USB) support support
Select "*" Ralink rt27xx/rt28xx/rt30xx (USB) support
Select "*" rt2800usb - Include support for rt33xx devices
Select "*" rt2800usb - Include support for rt35xx devices (EXPERIMEN
Select "*" rt2800usb - Include support for rt53xx devices (EXPERIMEN
Select "*" rt2800usb - Include support for unknown (USB) devices
Select "*" Ralink debug output
Select "*" Generic IEEE 802.11 Networking Stack (mac80211)
evice Drivers -> USB support ->USB Wireless Device Management support
Select "*" USB Wireless Device Management support
2.重新编译内核
make uImage
make modules
make modules_install INSTALL_MOD_PATH=/opt/modules_install
3 解压tenda W311MI.tar.gz压缩包
打开顶层Makefile
26 PLATFORM = PC改为#PLATFORM = PC 注释掉
添加PLATFORM = DM8168
我在170添加以下
ifeq ($(PLATFORM),DM8168)
LINUX_SRC = /opt/DM8168_DVRRDK_V03.00.00.00/ti_tools/linux_lsp/linux-psp-dvr-04.04.00.01/src/linux-04.04.00.01
CROSS_COMPILE = arm-none-linux-gnueabi-
endif
进入os/linux目录打开config.mk文件
189 行CC := $(CROSS_COMPILE)gcc 改为arm-none-linux-gnueabi-gcc
190 行LD := $(CROSS_COMPILE)ld 改为 arm-none-linux-gnueabi-ld
不做修改则make的时候 后面加上CROSS_COMPILE=arm-none-linux-gnueabi- 即可
722行添加以下
ifeq ($(PLATFORM),DM8168)
EXTRA_CFLAGS := $(WFLAGS) -I$(RT28xx_DIR)/include
endif
57 行 HAS_WPA_SUPPLICANT=n改为HAS_WPA_SUPPLICANT=y
61 行 HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n改为HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
4 make ARCH=arm
生成rt5370sta.ko 模块便是成功了 至于cp 到/tftpboot这一步可以手工来操作
5 移动到目标板上并加载
root@dvr:/a/wireless# insmod rt5370sta.ko
rt5370sta: module license 'unspecified' taints kernel.
Disabling lock debugging due to kernel taint
rt5370sta: Unknown symbol usb_alloc_urb (err 0)
rt5370sta: Unknown symbol usb_free_urb (err 0)
rt5370sta: Unknown symbol usb_alloc_coherent (err 0)
rt5370sta: Unknown symbol usb_register_driver (err 0)
rt5370sta: Unknown symbol usb_put_dev (err 0)
rt5370sta: Unknown symbol usb_get_dev (err 0)
rt5370sta: Unknown symbol usb_submit_urb (err 0)
rt5370sta: Unknown symbol usb_free_coherent (err 0)
rt5370sta: Unknown symbol usb_control_msg (err 0)
rt5370sta: Unknown symbol usb_deregister (err 0)
rt5370sta: Unknown symbol usb_kill_urb (err 0)
insmod: error inserting 'rt5370sta.ko': -1 Unknown symbol in module
这是模块没有声明lisence
在os/linux下的usb_main_dev.c的35行添加 MODULE_LICENSE("GPL");
6 tools目录下有个工具 修改下Makefile 中gcc改为arm-none-linux-gnueabi-gcc便可用
7 复制wifi配置文件
cp RT2870STA.dat /etc/Wireless/RT2870STA/RT2870STA.dat
设置上网可以打开RT2870STA.dat文件
我主要设置了这三项无线wpapsk加密上网设置
SSID=无线路由的名字
AuthMode=open(不需密码) 、AuthMode=WPAPSK
WPAPSK="密码"
8 启动无线网卡用
ifconfig ra0 inet 192.168.0.165 up //ip根据个人喜好
9 交叉编译wireless_tools.29
网上下载wireless_tools.29.tar.gz
修改Makefile
12行 改为CC = arm-none-linux-gnueabi-gcc
14行 改为AR = arm-none-linux-gnueabi-ar
make 生成
ifrename
iwconfig
iwevent
iwgetid
iwlist
iwpriv
iwspy
libiw.so.29 挪到目标板的/usr/lib里面
15 网络的测试看鸟哥的私房菜服务器篇里面讲的很好
更多推荐
usb wifi 驱动移植rtl5370
发布评论