close
最近專案中需要做wifi定頻測試,用到了iwpriv。
iwpriv是iwconfig的輔助工具,用來配置無線網路介面的各種私有可選引數。iwpriv針對不同種類的驅動實現特定的引數處理和設定。iwpriv不跟引數時會列出每個介面上可用的私有命令和它們對應的引數。使用者可根據這些資訊對特定的介面使用不同的命令操作。
#iwpriv
eth0 no private ioctls
wlan0 no private ioctls
l0 no private ioctl
在網上查了相關資料,得知可能的原因是以下這兩個巨集沒有開啟
CONFIG_WIRELESS_EXT=y
CONFIG_WEXT_PRIV=y
需要在核心中IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)下兩個選項配置上才可以
make menuconfig_public_linux
-> Device Drivers
-> Network device support (NETDEVICES [=y])
-> Wireless LAN (WLAN [=y])
-> IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP) (HOSTAP [=y])
編譯重新燒錄再次執行:
# iwpriv
wlan0 Available private ioctls :
write (8BE0) : set 2047 char & get 0
read (8BE1) : set 2047 char & get 16 char
driver_ext (8BE2) : set 0 & get 0
mp_ioctl (8BE3) : set 0 & get 0
apinfo (8BE4) : set 1 int & get 0
setpid (8BE5) : set 2 int & get 0
wps_start (8BE6) : set 1 int & get 0
get_sensitivity (8BE7) : set 1 int & get 0
wps_prob_req_ie (8BE8) : set 1 int & get 0
wps_assoc_req_ie (8BE9) : set 1 int & get 0
channel_plan (8BEA) : set 1 int & get 0
dbg (8BEB) : set 2 int & get 0
rfw (8BEC) : set 3 int & get 0
rfr (8BED) : set 2 int & get 16 char
p2p_set (8BF0) : set 1024 char & get 0
p2p_get (8BF1) : set 1024 char & get 2047 char
NULL (8BF2) : set 0 & get 0
p2p_get2 (8BF3) : set 64 char & get 64 char
tdls (8BF4) : set 64 char & get 0
tdls_get (8BF5) : set 1024 char & get 1024 char
pm_set (8BF6) : set 64 char & get 0
rereg_nd_name (8BF8) : set 16 char & get 0
NULL (8BFA) : set 1024 char & get 0
NULL (8BFB) : set 128 char & get 2047 char
test (8BFD) : set 40 char & get 2047 char
mp_start (0005) : set 1024 char & get 0
mp_phypara (0018) : set 1024 char & get 2047 char
mp_stop (0006) : set 1024 char & get 0
mp_channel (0008) : set 1024 char & get 2047 char
mp_bandwidth (0009) : set 1024 char & get 0
mp_rate (0007) : set 1024 char & get 2047 char
mp_reset_stats (0016) : set 1024 char & get 0
mp_query (000E) : set 1024 char & get 2047 char
read_reg (0002) : set 1024 char & get 2047 char
mp_rate (0007) : set 1024 char & get 2047 char
read_rf (0004) : set 1024 char & get 2047 char
mp_psd (0010) : set 1024 char & get 2047 char
mp_dump (0017) : set 1024 char & get 2047 char
mp_txpower (000A) : set 1024 char & get 2047 char
mp_ant_tx (000B) : set 1024 char & get 2047 char
mp_ant_rx (000C) : set 1024 char & get 2047 char
write_reg (0001) : set 1024 char & get 2047 char
write_rf (0003) : set 1024 char & get 2047 char
mp_ctx (000D) : set 1024 char & get 2047 char
mp_arx (000F) : set 1024 char & get 2047 char
mp_ther (0012) : set 1024 char & get 2047 char
efuse_set (0015) : set 1024 char & get 2047 char
efuse_get (0014) : set 1024 char & get 2047 char
mp_pwrtrk (0011) : set 1024 char & get 0
mp_drvquery (001A) : set 1024 char & get 2047 char
mp_ioctl (0013) : set 1024 char & get 0
mp_setrfpath (0019) : set 1024 char & get 0
mp_pwrctldm (001E) : set 1024 char & get 2047 char
mp_get_txpower (0027) : set 1024 char & get 2047 char
mp_priv_ver (001F) : set 1024 char & get 2047 char
mp_mon (0020) : set 1024 char & get 2047 char
efuse_mask (0021) : set 1024 char & get 2047 char
efuse_file (0022) : set 1024 char & get 2047 char
mp_tx (0023) : set 1024 char & get 2047 char
mp_rx (0024) : set 1024 char & get 2047 char
mp_hxtx (0025) : set 1024 char & get 2047 char
cta_test (001C) : set 1024 char & get 0
定頻測試命令:
iwpriv wlan0 mp_start #發射
iwpriv wlan0 mp_channel 1 #通道設定為channel 1
iwpriv wlan0 mp_bandwidth 40M=0,shortGI=0 #40M頻寬關閉,ShortGI功能關閉
iwpriv wlan0 mp_ant_tx a #選擇天線a為發射天線
iwpriv wlan0 mp_txpower patha=44,pathb=44 #設定a,b天線的發射功率對應值
iwpriv wlan0 mp_rate 108 #傳輸速率設定
iwpriv wlan0 mp_ctx background #支援background時wifi功能仍然處於長髮狀態
更詳細用法請參見官方手冊。
不過我的板子狀況還是認不到
查看驅動發現 dev->wireless_handlers 根本沒有 所以導致驅動直接跳出
查看驅動發現 dev->wireless_handlers 根本沒有 所以導致驅動直接跳出
不知道是我的驅動不支援 iwpriv 嗎??
wireless_process_ioctl-CONFIG_WEXT_PRIV cmd=0x8b0d dev->wireless_handlers=0x0
wireless_process_ioctl-CONFIG_WEXT_PRIV cmd=0x8b0d dev->wireless_handlers=0x0
文章標籤
全站熱搜
留言列表