Linux wifi移植

Linux wifi移植

wpa_supplicant-0.7.3

WIFI 服务端程序 wpa_supplicant包含两个主要的可执行工具:

wpa_supplicant和wpa_cli。

wpa_supplicant是核心程序,

它和wpa_cli的关系就是服务和客户端的关系:后台运行wpa_supplicant,使用wpa_cli来搜索、设置、和连接网络。 无线网卡驱动 DPO_RT5572_LinuxSTA_2.6.1.3_20121022 编译网卡驱动 1:修改解压目录的Makefile文件 set the "MODE = STA" set "TARGET = LINUX" ifeq ($(PLATFORM),xxxxx) //可以自定义平台名称 LINUX_SRC := linux //linux 目录 CROSS_COMPILE = arm-linux- //交叉编译 Endif 2:修改os/linux/config.mk文件 HAS_WPA_SUPPLICANT=y HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y ifeq ($(PLATFORM),xxxxx) EXTRA_CFLAGS := -D__KERNEL__   -I$(RT28xx_DIR)/include \   -I$(LINUX_SRC)/include \   -Wall -Wstrict-prototypes -Wno-trigraphs \   -O2 -fno-strict-aliasing -fno-common \   -Uarm -fno-common -pipe \ -D__LINUX_ARM_ARCH__=7 \ //跟实际平台相匹配   -march=armv7-a -Wa,\ //CPU型号    -DMODVERSIONS \   $(WFLAGS)export export EXTRA_CFLAGS endif 3:编译遇到下面问题 : error: unknown field ‘private‘ specified in initializer /os/linux/sta_ioctl.c:2386:2: warning: initialization from incompatible pointer type /os/linux/sta_ioctl.c:2387:2: error: unknown field ‘num_private‘ specified in initializer /os/linux/sta_ioctl.c:2387:2: warning: excess elements in struct initializer /os/linux/sta_ioctl.c:2387:2: warning: (near initialization for ‘rt28xx_iw_handler_def‘) /os/linux/sta_ioctl.c:2388:2: error: unknown field ‘private_args‘ specified in initializer /os/linux/sta_ioctl.c:2388:26: warning: excess elements in struct initializer /os/linux/sta_ioctl.c:2388:26: warning: (near initialization for ‘rt28xx_iw_handler_def‘) /os/linux/sta_ioctl.c:2389:2: error: unknown field ‘num_private_args‘ specified in initializer /os/linux/sta_ioctl.c:2389:2: warning: excess elements in struct initializer /os/linux/sta_ioctl.c:2389:2: warning: (near initialization for ‘rt28xx_iw_handler_def‘) os/linux/../../os/linux/sta_ioctl.o] Error 1 可以用下面的方法解决: 进入linux 内核 #make menuconfig 进行选择 Device Drivers==> Network deivce support==> Wireless LAN==> <*> USB ZD1201 based Wireless device support, 编译即可 sysctl -w coherent_pool= kernel parameter! 0100 0100 0000 0000 0000 0000 0000 0000 16 x 16 x 16 x 16 x 16 4:查看无线网卡的详解信息 cat /proc/net/wireless ifconfig ra0 up 报下面的错误 RtmpAsicLoadFirmware: ver 21/21, sum cdf7/cdf7, mac cdf72100 ifconfig: ioctl 0x8914 failed: Operation not permitted wireless_tools.29 无线网卡工具,主要用来获取无线网卡的状态信息。 insmod rt5572sta.ko rtusb init rt2870 ---> 后台运行程序 wpa_supplicant -Dwext -c/etc/wpa_supplicant.conf -ira0 PLATFORM = BROADCOM7252D1 读取网络文件 #define PROC_NET_WIRELESS "/proc/net/wireless" 需要将以下文件拷贝到 /etc/Wireless/RT2870STA目录下 RT2870STA.dat RT2870STACard.dat rt2870.bin 配置文件 /etc/wpa_supplicant.conf 里面的内容为 ctrl_interface=/var/run/wpa_supplicant ap_scan=1 插上USB WIFI后报下面的错误 # insmod rt5572sta.ko rtusb init rt2870 ---> usbcore: registered new interface driver rt2870 # usb 1-1: new high-speed USB device number 2 using ehci-brcm ERROR: 256 KiB atomic DMA coherent pool is too small! Please increase it with coherent_pool= kernel parameter! ifconfig: ioctl RtmpAsicLoadFirmware: ver 21/21, sum cdf7/cdf7, mac cdf72100 0x8914 failed: Operation not permitted [NetMgrWifi.cpp:558]Cmd(ifconfig ra0 up) ret 256 [NetMgrWifi.cpp:562]iRet=27 RtmpAsicLoadFirmware: ver 21/21, sum cdf7/cdf7, mac cdf72100 Could not set interface ra0 flags: Operation not permitted Failed to initialize driver interface [NetMgrWifi.cpp:599]WaitFor_WpaSupplicant_Start failed 内核参数的查看方法 sysctl -a 内核参数的的设置方法 sysctl -w 参数名=值 vi ./arch/arm/mm/dma-mapping.c early_param("coherent_pool", early_coherent_pool); #define DEFAULT_DMA_COHERENT_POOL_SIZE SZ_150K 将SZ_150K改为SZ_2M,改了这个参数就OK啦

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。