STA驱动移植到hi3518c平台小结


#add by kj ,in the platform hi_3518c
ifeq ($(PLATFORM),HI_3518C)
LINUX_SRC = /home/kongjun/mywork/develop_kj/Hi3518_SDK_V1.0.3.0/osdrv/kernel/linux-3.0.y
LINUX_SRC_MODULE = /home/kongjun/mywork/develop_kj/Hi3518_SDK_V1.0.3.0/osdrv/kernel/linux-3.0.y/drivers/net/wireless/
CROSS_COMPILE = arm-hisiv100nptl-linux-
endif
#end alter by kj

2、./os/linux/config.mk 文件:

#add by kj
ifeq ($(PLATFORM),HI_3518C)
#WFLAGS += -DRT_BIG_ENDIAN
endif

#add by kj
ifeq ($(PLATFORM),HI_3518C)
#CFLAGS := -v -D__KERNEL__ -DMODULE -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -mbig-endian -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe -mapcs-32 -D__LINUX_ARM_ARCH__=5 -mcpu=xscale -mtune=xscale -malignment-traps -msoft-float $(WFLAGS)
EXTRA_CFLAGS := -v $(WFLAGS) -I$(RT28xx_DIR)/include
export CFLAGS
endif

3、make即可。

注:

驱动加载后生成的设备名称是‘ra0’,这个在驱动是可以修改的,在驱动中的位置是:
./include/rtmp_def.h

#define INF_MAIN_DEV_NAME "ra"
#define INF_MBSSID_DEV_NAME "ra"

#define INF_WDS_DEV_NAME "wds"
#define INF_APCLI_DEV_NAME "apcli"
#define INF_MESH_DEV_NAME "mesh"
#define INF_P2P_DEV_NAME "p2p"

其他参考资料:

2. RT3070驱动修改

解压 tar -zxvf 2011_0107_RT3070_RT3370_Linux_STA_v2.5.0.1_DPO.tar.gz

进入RT3070_Linux_STA目录,看到有一个README_STA_usb文件,里面介绍了如何加载该驱动,先浏览一下

2.1 先设好环境变量
export PATH=/opt/hisi-linux/x86-arm/gcc-3.4.3-uClibc-0.9.28/usr/bin:$PATH

2.2 makefile修改 (-为去掉设置, +为新加的设置)
#vi makefile

- #PLATFORM = PC
+ PLATFORM = IXP
#(选用的是IXP)

ifeq ($(PLATFORM),IXP)

- LINUX_SRC = /project/stable/Gmtek/snapgear-uclibc/linux-2.6.x
- CROSS_COMPILE = arm-linux-
+ LINUX_SRC = /xxx/kernel/linux-2.6.14
+ CROSS_COMPILE = arm-hismall-linux-
endif


2.3 /os/linux/config.mk修改
#cd /os/linux/
#vi config.mk

# Support Wpa_Supplicant
- HAS_WPA_SUPPLICANT=n
+ HAS_WPA_SUPPLICANT=y

# Support Native WpaSupplicant for Network Maganger
- HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n
+ HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

ifeq ($(PLATFORM),IXP)
- WFLAGS += -DRT_BIG_ENDIAN
#加这个选项,模块运行时显示出错,CPU不能工作
endif

ifeq ($(PLATFORM),IXP)

- CFLAGS := -v -D__KERNEL__ -DMODULE -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -mbig-endian -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe -mapcs-32 -D__LINUX_ARM_ARCH__=5 -mcpu=xscale -mtune=xscale -malignment-traps -msoft-float $(WFLAGS)
- EXTRA_CFLAGS := -v $(WFLAGS) -I$(RT28xx_DIR)/include -mbig-endian
+ EXTRA_CFLAGS := -v $(WFLAGS) -I$(RT28xx_DIR)/include
export CFLAGS
endif

3、 编译源码
make通过,在2011_0107_RT3070_RT3370_Linux_STA_v2.5.0.1_DPO/os/linux目录下生成了rt3070sta.ko,也就是RT3070的驱动了

4. 拷贝驱动到目标系统
把RT2870STA.dat拷贝到/etc/Wireless/RT2870STA目录下
把rt3070sta.ko拷贝到/xxx/ 目录下 xxx自定

5. 加载驱动模块
insmod /xxx/rt3070sta.ko

出现以下错误
rt3070sta: Unknown symbol usb_alloc_urb
rt3070sta: Unknown symbol usb_free_urb
rt3070sta: Unknown symbol usb_register
rt3070sta: Unknown symbol usb_put_dev
rt3070sta: Unknown symbol usb_get_dev
rt3070sta: Unknown symbol usb_submit_urb
rt3070sta: Unknown symbol usb_control_msg
rt3070sta: Unknown symbol usb_deregister
rt3070sta: Unknown symbol usb_kill_urb
rt3070sta: Unknown symbol usb_buffer_free
rt3070sta: Unknown symbol usb_buffer_alloc
insmod: cannot insert `rt3070sta.ko': Unknown symbol in module (-1): No such file or directory

原因未加载USB驱动

5.1 加载usbcore.ko
insmod /lib/modules/2.6.14-hi3511v100dmeb-release/kernel/drivers/usb/core/usbcore.ko

显示
usbcore: registered new driver usbfs
usbcore: registered new driver hub

加载成功

5.2.1 如果为USB1.1 加载hi3511_usb_1-1.ko

insmod /lib/modules/2.6.14-hi3511v100dmeb-release/misc/hi3511_usb_1-1.ko

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/c448c30f08fc84e7c1e8025475f3ea4b.html