码迷,mamicode.com
首页 > 其他好文 > 详细

wifi驱动移植

时间:2015-02-07 11:41:32      阅读:522      评论:0      收藏:0      [点我收藏+]

标签:

目标板:Hi3518

内核版本:linux3.0.8
 
1.修改makefile
#PLATFORM = PC     //注释掉
PLATFORM = HI3518     //支持平台

ifeq ($(PLATFORM),HI3518)
LINUX_SRC = /root/hi3518/linux-3.0.y     //内核路径
CROSS_COMPILE = /opt/hisi-linux-nptl/arm-hisiv100-linux/target/bin/arm-hisiv100nptl-linux- //工具链路径
endif

2.进入RT3070/include/rtmp_def.h

1476    #define INF_MAIN_DEV_NAME     "wlan"
1477    #define INF_MBSSID_DEV_NAME "wlan"

3.修改os/linux/config.mk使其支持wpa_suplicant(将‘n‘变成‘y‘)

# Support Wpa_Supplicant
HAS_WPA_SUPPLICANT=y
# Support Native WpaSupplicant for Network Maganger
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

4.在编译驱动前必须先编译image

问题一:

/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.c:2227: error: unknown field private specified in initializer
/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.c:2227: warning: initialization from incompatible pointer type
/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.c:2228: error: unknown field num_private specified in initializer
/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.c:2228: warning: excess elements in struct initializer
/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.c:2228: warning: (near initialization for rt28xx_iw_handler_def)
/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.c:2229: error: unknown field private_args specified in initializer
/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.c:2229: warning: excess elements in struct initializer
/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.c:2229: warning: (near initialization for rt28xx_iw_handler_def)
/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.c:2230: error: unknown field num_private_args specified in initializer
/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.c:2230: warning: excess elements in struct initializer
/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.c:2230: warning: (near initialization for rt28xx_iw_handler_def)
make[2]: *** [/root/hi3518/RT3070/os/linux/../../os/linux/sta_ioctl.o] 错误 1
make[1]: *** [_module_/root/hi3518/RT3070/os/linux] 错误 2
make[1]:正在离开目录 `/root/hi3518/linux-3.0.ymake: *** [LINUX] 错误 2

问题原因:是因为在配置Makefile时,指定的内核在配置时不支持802.11的无线设备驱动。

解决办法:重新配置编译指定的Linux Kernel,将Device Drivers
   
   ==>Network deivce support
       ==>Wireless LAN
        ==><*> USB ZD1201 based Wireless device support,编译即可

 


问题二:
rt3070sta: module has no symbols (stripped?)
insmod: cant insert rt3070sta.ko: invalid module format

解决办法:不能对目标文件进行裁剪

rtusb init rt2870 --->
usbcore: registered new interface driver rt2870

 

如果出现以下报错,说明内核源码错了
rt5370sta: version magic 2.6.32.59 mod_unload ARMv4  should be 2.6.32.2-Frie
insmod: cannot insert rt5370sta.ko: invalid module format

插入网卡,这个时候ifconfig是看不到网卡的,要启用网卡,用以下命令:

ifconfig ra0 up

 

wifi驱动移植

标签:

原文地址:http://www.cnblogs.com/youthshouting/p/4278474.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!