将wq9001驱动集成到rv1106 SDK

下载代码

上次修改好的代码已经上传到仓库,通过git clone下载到SDK的luckfox-pico/sysdrv/drv_ko/wifi文件夹中

修改上级Makefile文件

打开luckfox-pico/sysdrv/drv_ko/wifi中的Makefile
添加

ifneq ($(findstring $(RK_ENABLE_WIFI_CHIP),"WQ9001"),)
	@make -C wq9001-wifi/
endif

修改wq9001 的Makefile

# 这里要注意不能用$(shell pwd)及$(PWD)
# 防止在进入kernel后包含头文件时路径变化
DRV_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
DRV_PATH := $(dir $(DRV_PATH))
export DRV_PATH

ARCH ?= arm
CROSS_COMPILE ?= arm-rockchip830-linux-uclibcgnueabihf-
KSRC ?= ../../../source/kernel
......

all:
ifeq ($(KSRC),)
	$(error KSRC must be defined. Please specify the kernel source directory)
endif
	@echo $(DRV_PATH)
	$(MAKE) V=1 -C $(KSRC) M=$(DRV_PATH) \
		ARCH=$(ARCH) \
		CROSS_COMPILE=$(CROSS_COMPILE) \
		modules
	#添加strip进行瘦身
	$(CROSS_COMPILE)strip --strip-debug $(shell pwd)/*.ko
	#复制驱动到out目录
	cp $(shell pwd)/wq9001.ko $(M_OUT_DIR)

clean:
	rm -f *.o *.ko *.mod.c *.mod.o .*.cmd modules.order Module.symvers
	rm -rf .tmp_versions
	find . -name '*.o' -delete
	find . -name '.*.o.d' -delete
	find . -name '.*.o.cmd' -delete

使用

从新编译后,烧录镜像到TF卡,能正常找到wifi。

你可能感兴趣的:(linux)