wpa supplicant驅動移植

2021-06-07 00:59:45 字數 4366 閱讀 4971

移植環境:

主機作業系統:ubantu 10.10

目標系統:hi351x 核心 linux-2.6.14

交叉編譯器:arm-hismall-linux-

版本: wpa_supplicant-0.7.3

移植wpa_supplicant前確保openssl已經移植好了,openssl移植參考前文「openss驅動移植「

download: wpa_supplicant驅動原始碼

2. 配置修改,編譯

#cp defconfig   .config

#vi .config

增加這幾行

cflags += -i/usr/local/ssl/include

libs += -l/usr/local/ssl/lib

cc = arm-hismall-linux-gcc -l /usr/local/ssl/lib/

#make

需要先編譯安裝openssl庫,確保兩個編譯都使用統一工具arm-hismall-linux-gcc

不一致會出現這樣的問題:

/usr/bin/ld: skipping incompatible /usr/local/ssl/lib/libssl.so when searching for -lssl

/usr/bin/ld: skipping incompatible /usr/local/ssl/lib/libssl.a when searching for -lssl

/usr/bin/ld: cannot find -lssl

/usr/bin/ld: skipping incompatible /usr/local/ssl/lib/libcrypto.so when searching for -lcrypto

/usr/bin/ld: skipping incompatible /usr/local/ssl/lib/libcrypto.a when searching for -lcrypto

/usr/bin/ld: cannot find -lcrypto

collect2: ld returned 1 exit status

make: *** [wpa_supplicant] error 1

這樣只要把openssl和wpa_supplicant兩個用同乙個編譯工具編譯即可。

3. 產品板使用:

3.1.把wpa_supplicant.conf拷貝到/***目錄下 (***目錄自定)

按加密方式分3種,以下3個配置檔案均測試正常

# 無密碼 wpa_supplicant.conf內容:

ctrl_inte***ce=/var/run/wpa_supplicant

network=

# wep密碼 wpa_supplicant.conf內容:

ctrl_inte***ce=/var/run/wpa_supplicant

network=

# wpa密碼 wpa_supplicant.conf內容:

# wpa-psk/tkip

ctrl_inte***ce=/var/run/wpa_supplicant

network=

3.2. wpa_supplicant拷貝到/***/目錄下

//無橋方式

wpa_supplicant -b -ira0 -c /***/wpa_supplicant.conf -dwext (***為前面wpa_supplicant.conf目錄)

//有橋接方式(bridge-utils)

wpa_supplicant -b -b br0 -ira0 -c /***/wpa_supplicant.conf -dwext

如果執行時出現:

socket(pf_packet): address family not supported by protocol

原因核心不支援raw socket,編譯核心時把config_packet選項開啟,

config_packet = y

if we use config_packet=m instead of config_packet=y we'd need to 

include af_packet.ko into the initramfs for netboot installation.

手動載入af_packet.ko

#insmod af_packet.ko

顯示net: registered protocol family 17

載入正常

3.3執行#wpa_supplicant

#wpa_supplicant -b -ira0 -c /***/wpa_supplicant.conf -dwext

(efuse for 3062/3562/3572) size=0x2d [2d0-2fc] 

rtmp_timerlistadd: add timer obj d1b3c620!

rtmp_timerlistadd: add timer obj d1b3c650!

rtmp_timerlistadd: add timer obj d1b3c680!

rtmp_timerlistadd: add timer obj d1b3c5f0!

rtmp_timerlistadd: add timer obj d1b3c560!

rtmp_timerlistadd: add timer obj d1b3c590!

rtmp_timerlistadd: add timer obj d1b06b94!

rtmp_timerlistadd: add timer obj d1af5f54!

rtmp_timerlistadd: add timer obj d1af5f8c!

rtmp_timerlistadd: add timer obj d1b06c38!

rtmp_timerlistadd: add timer obj d1b06b34!

rtmp_timerlistadd: add timer obj d1b06c04!

-->rtusbvenderreset

<--rtusbvenderreset

key1str is invalid key length(0) or type(0)

key2str is invalid key length(0) or type(0)

key3str is invalid key length(0) or type(0)

key4str is invalid key length(0) or type(0)

1. phy mode = 5

2. phy mode = 5

phy mode> error! the chip does not support 5g band 5!

rtmpsetphymode: channel is out of range, use first channel=1 

(efuse for 3062/3562/3572) size=0x2d [2d0-2fc] 

3. phy mode = 9

mcs set = ff 00 00 00 01

<==== rt28xx_init, status=0

0x1300 = 00064300

執行正常

檢視狀態:

#iwconfig

ralink sta  essid:"***x"  nickname:"rt2870sta"

mode:managed  frequency=2.427 ghz  access point: 54:e6:fc:68:74:24   

bit rate=54 mb/s   

rts thr:off   fragment thr:off

encryption key:8888-8888-8888-8888-8888-8888-8888-8888   security mode:open

link quality=68/100  signal level:-60 dbm  noise level:-83 dbm

rx invalid nwid:0  rx invalid crypt:0  rx invalid frag:0

tx excessive retries:0  invalid misc:0   missed beacon:0

3.4設定ip

#ifconfig ra0 192.168.1.230 netmask 255.255.255.0

設定完一會,等網路連線好就可以了。

Linux系統Wpa supplicant用法小結

wpa supplicant是linux系統下乙個非常強大的無線網絡卡管理程式。google搜尋到的它似乎不支援wpa2和aes,其實不然,參考它的文件可以發現,wpa2只是rsn的別名,而aes也是ccmp的一部分,所以它們的支援完全是沒有問題的。它的文件看起來非常複雜,其實配置非常簡單,下面先給...

wpa supplicant 使用記錄

連線 wifi wpa 配置檔案一般在目錄 etc 也可以根據使用者需要自行建立,如 data user 等目錄下 cmd touch wpa supplicanf.confctrl inte ce var run wpa supplicant 乙個目錄,用於wpa supplicant和wpa c...

wpa supplicant交叉編譯

wpa supplicant 的編譯依賴 libnl 庫 libssl庫,因此需要先編譯這兩個庫。解壓檔案,進入主目錄,使用如下命令編譯 mkdir install config no asm shared prefix pwd install cross compile prefix arm hi...