Linux wifi移植

來源:互聯網
上載者:User

標籤:

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啦

Linux wifi移植

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.