天天看點

開發調試指令大全--(博通開發調試指令)前言

博通開發調試指令

  • 前言
    • 1、指令行基本文法
    • 1、bcm常見指令行
        • (1)檢視軟體版本資訊
        • (2)檢視無線硬體版本資訊
        • (3)檢視無線狀态
        • (4)檢視無線驅動統計資訊
        • (5)無線驅動加載map檔案資訊
        • (6)查詢關聯sta資訊
        • (7)查詢指定sta詳細資訊
        • (8)檢視AP目前發射功率
        • (9)檢視AP天線的RSSI
        • (10)檢視AP鄰居資訊
        • (11)檢視AP實時實體速率
        • (12)設定無線ssid
        • (13)設定無線信道
        • (14)觸發自動信道選擇
        • (15)自動信道選擇調試指令行
        • (16)查詢關聯sta資訊
    • 2、bcm easymesh簡介
        • (1)查詢組網資訊
        • (2)查詢easymesh配置資訊
        • (3)手動觸發renew消息
        • (4)手動模拟觸發wps按鍵組網

前言

本文主要介紹博通方案的常用的無線配置方法和以及開發調試過程中出現的一些常見問題及解決方案。

1、指令行基本文法

BCM基本指令行存在兩種方式:wl 和 nvram

(1)、

wl

Usage:

-h this message and command descriptions

-h [cmd] command description for cmd

-a, -i adapter name or number

-d output format signed integer

-u output format unsigned integer

-x output format hexdecimal

-i選項,用于指定具體的裝置節點,如2.4G ssid1對應wl0, ssid2對應wl0.1,ssid3對應wl0.2,依此類推;

5G ssid1 則對應wl1,ssid2 對應wl1.1,依此類推

(2)、

nvram

usage:

[set] : set name with value

[setflag] : set bit value

[unset] : remove nvram entry

[get] : get nvram value with name

[getflag] : get bit value

[show:dump:getall] : show all nvrams

[loadfile] : populate nvram value from files

[savefile] : save all nvram value to file

[commit] : save nvram [optional] to restart wlan when following restart

[restart] : restart wlan

1、bcm常見指令行

(1)檢視軟體版本資訊

指令行:

wl -i wl0 ver

說明:檢視2.4G的版本資訊

(2)檢視無線硬體版本資訊

指令行:

wl –i wl0/wl1 revinfo

說明:指令行顯示的無線硬體版本資訊

(3)檢視無線狀态

指令行:

wl status

說明:預設查詢到的時2.4G主ssid的資訊,如果需要查詢指定ssid的資訊,使用【-i】選項

wl -i wl0 status

SSID: “ChinaNet-zyh111”

Mode: Managed RSSI: 0 dBm SNR: 0 dB noise: -89 dBm Channel: 1l

BSSID: 00:23:22:22:11:55 Capability: ESS ShortSlot

Supported Rates: [ 1(b) 2(b) 5.5(b) 6 9 11(b) 12 18 24 36 48 54 ]

HE Capable:

Chanspec: 2.4GHz channel 3 40MHz (0x1803)

Primary channel: 1

HT Capabilities: 40MHz SGI20 SGI40

Supported HT MCS : 0-23 32

Supported VHT MCS:

NSS1 Tx: 0-11 Rx: 0-11

NSS2 Tx: 0-11 Rx: 0-11

NSS3 Tx: 0-11 Rx: 0-11

Supported HE MCS:

20/40/80 MHz:

NSS1 Tx: 0-11 Rx: 0-11

NSS2 Tx: 0-11 Rx: 0-11

NSS3 Tx: 0-11 Rx: 0-11

VHT MCS:表示802.11n mcs

HE MCS:表示802.11ax,也即支援wifi6

(4)檢視無線驅動統計資訊

指令行:

wl –i wl0/wl1 counters

說明:指令行顯示的無線驅動統計資訊。

(5)無線驅動加載map檔案資訊

指令行:

wl –i wl0/wl1 srdump

說明:指令行顯示的加載到驅動裡的map資訊。

map檔案儲存無線校準相關參數,是以在調試中有時會需要調高或調低發射功率;産測涉及更新map檔案。相當于mtk中的

iwpriv ra0 e2p

(6)查詢關聯sta資訊

指令行:

wl -i wl0 assoclist

說明:查詢指定接口下關聯的sta清單

(7)查詢指定sta詳細資訊

指令行:

wl -i wl0 sta_info F8:87:F1:6C:E3:30

說明:查詢已關聯指定sta的相關資訊

(8)檢視AP目前發射功率

指令行:

wl –i wl0/wl1 curpower

說明:指令行輸出AP每根天線目前實時發射功率

(9)檢視AP天線的RSSI

指令行:

wl –i wl0/wl1 dump rssi

說明:指令行輸出AP天線實時的接收靈敏度

(10)檢視AP鄰居資訊

指令行:

wl –i wl0/wl1 scan

指令行:

wl –i wl0/wl1 scanresults

說明:這兩個指令行完成AP對周圍其他SSID資訊的掃描及輸出

(11)檢視AP實時實體速率

指令行:

wl –i wl0/wl1 rate

說明:指令行顯示的無線AP實時協商實體速率。

(12)設定無線ssid

指令行:

wl –i wl0 ssid ChinaNet-zyh1111

wlctl -i wl0 ssid -C 0 ChinaNet-zyh1111

說明:指令行設定無線ssid。

(13)設定無線信道

指令行:

wlctl -i wl0 down

wlctl -i wl0 channel 6

wlctl -i wl0 up

說明:指令行設定無線ssid。

(14)觸發自動信道選擇

指令行:

acs_cli2 -i wl0 autochannel

acs_cli2 -i wl1 autochannel

說明:觸發自動信道選擇并切換到最優信道

(15)自動信道選擇調試指令行

自動信道選擇調試指令行,主要包含開啟日志列印、dump相關資訊,比如信道掃描評分、配置信道掃描時間等

bcm自動信道選擇涉及相關指令:

acs_cli2 -h                      // 查詢支援的指令行資訊
usage: acs_cli2 [options] <command>|<variable>[ <value>]
options are:
   -i, --interface <ifname>  Apply command to specified wl interface on server
   -p, --port <port>         Server TCP Port of remote ACSD
   -s, --server <server>     Server address of remote ACSD (IP address or name)
   -C, --commands            Lists available commands and variables to get/set
   -S, --settings            Retrieves and displays all known variables
   -R, --report              Retrieves and displays all known information.
   -h, --help                This help text.

NOTE:- Start the acsd on target to use this command

/fhrom/fhshell # acs_cli2  -i wl0 -C
Available commands:
 autochannel       csscan         dump          get         info          set
      status 
Dump options:
  acs_record    ACSD Channel switch log records
  acsd_stats    ACSD Statistics
         bss    BSS counters per channel
   candidate    Channel switch candidate details
      chanim    Channel Interference monitor counters
      cscore    Channel switch candidate scores
        dfsr    ACSD DFS Reentry Information
 scanresults    ACSD Scan results

Available variables (more may exist in the daemon):
     acs_chan_dwell_time     acs_chan_flop_period      acs_ci_scan_timeout
       acs_ci_scan_timer        acs_cs_scan_timer                  acs_dfs
acs_ci_scan_chanim_stats                acs_flags         acs_far_sta_rssi
    acs_nofcs_least_rssi               acs_policy    acs_scan_chanim_stats
   acs_scan_entry_expire          acs_trigger_var          acs_txdelay_cnt
      acs_txdelay_period        acs_txdelay_ratio          acs_tx_idle_cnt
            chanim_flags           lockout_period                  max_acs
                    mode                 msglevel            sample_period
          threshold_time                test_dfsr            test_preclear
            zdfs_5g_move             zdfs_2g_move         zdfs_5g_preclear
        zdfs_2g_preclear            bw_upgradable      fallback_to_primary
     switch_score_thresh       ci_scan_txop_limit           acs_txop_limit


ACSD設定列印等級:
#define ACSD_DEBUG_ERROR	0x0001
#define ACSD_DEBUG_WARNING	0x0002
#define ACSD_DEBUG_INFO		0x0004
#define ACSD_DEBUG_DETAIL	0x0008
#define ACSD_DEBUG_CHANIM	0x0010
#define ACSD_DEBUG_5G		0x0020
#define ACSD_DEBUG_DFSR		0x0040

nvram get acsd_debug_level
nvram set acsd_debug_level=0

acs_cli2  -i wl0 get msglevel
acs_cli2  -i wl0 set msglevel 1

acs_cli2  -i wl0 get mode

acs_cli2 -i wl0 dump acs_record 
acs_cli2 -i wl0 dump acsd_stats
acs_cli2 -i wl0 dump bss
acs_cli2 -i wl0 dump candidate
acs_cli2 -i wl0 dump cscore
acs_cli2 -i wl0 dump scanresults

acs_cli2 -i wl1 csscan
acs_cli2 -i wl1 dump cscore
acs_cli2 -i wl1 autochannel

acs_cli2 -i wl1 get acs_policy
acs_cli2 -i wl1 set acs_policy 9


acs_cli2 -i wl0 get acs_cs_scan_timer
           

自動信道評分算法:

#define CH_SCORE_BSS		0	/* number of bss */
#define CH_SCORE_BUSY		1	/* channel occupancy */
#define CH_SCORE_INTF		2	/* interference */
#define CH_SCORE_INTFADJ	3	/* interference adjustment, include neighboring channels */
#define CH_SCORE_FCS		4	/* FCS */
#define CH_SCORE_TXPWR		5	/* TX pwr consideration */
#define CH_SCORE_BGNOISE	6
#define CH_SCORE_TOTAL		7
#define CH_SCORE_CNS		8
/* adjacent channel score(number of bss's using the adjacent channel spec) */
#define CH_SCORE_ADJ		9
#define CH_SCORE_TXOP		10
#define CH_SCORE_MAX		11

static void
acs_candidate_score_total(ch_candidate_t *candi, acs_chaninfo_t* c_info)
{
	int i, total;
	ch_score_t *score_p;

	total = 0;
	score_p = candi->chscore;

	for (i = 0; i < CH_SCORE_TOTAL; i++)
		total += score_p[i].score * score_p[i].weight;

	if (BAND_5G(c_info->rs_info.band_type) && c_info->txop_weight) {
		total += score_p[CH_SCORE_TXOP].score * c_info->txop_weight;
	} else {
		total += score_p[CH_SCORE_TXOP].score * score_p[CH_SCORE_TXOP].weight;
	}
	score_p[CH_SCORE_TOTAL].score = total;
}
           
Fact	 Score   	 Weight  	 SubTotal	
BSS	        4	       10	       40	
busy	       23	        1	       23	
interf.	        4	        1	        4	
TOTAL	      317	        1	      317	
CNS	      -97	        1	      -97	
TXOP	       25	       10	      250

hannel (Chspec) Use DFS      BSS     busy  interf.  itf_adj      fcs  txpower  bgnoise    TOTAL      CNS      ADJ     TXOP 
  36/80 (0xe02a)   -        90        0        0        0        0       20        0      160      -97        0       50 
           

(16)查詢關聯sta資訊

指令行:

wl -i wl0 rx_report

說明:查詢下挂終端的資訊,相比wl -i wl0 assoclist的資訊更為詳盡

開發調試指令大全--(博通開發調試指令)前言

設定非關聯sta的的rssi測量

iwpriv ra0 set mnt_clr=1

iwpriv ra0 set mnt_sta0=00:00:00:00:00:00

iwpriv ra0 set mnt_en=1

iwpriv ra0 set mnt_rule=1:1:1

iwpriv ra0 set mnt_sta0=F8:9A:78:BC:12:98

2、bcm easymesh簡介

bcmesaymesh有兩種角色:

controller、agent、controller+agent

開啟easymesh後,主要有兩個程序:

1)、如果是controller或者controller+Agent,則啟動wbd_master和wbd_slave

2)、如果是作為agent,則啟動wbd_slave

(1)查詢組網資訊

指令行:

wb_cli -s info

說明:查詢組網狀态資訊

開發調試指令大全--(博通開發調試指令)前言

(2)查詢easymesh配置資訊

開啟bsd列印:

nvram set bsd_msglevel=0x205

nvram get wl0_bss_enabled
nvram get wl1_bss_enabled



#map_agent:
#擷取agent的onboarding狀态:
nvram get map_onboarded
#擷取agent的配置 同步狀态:
nvram get map_agent_configured

nvram get map_bss_names
nvram get fh_map
nvram get bh_map
nvram get wbd_ifnames

nvram set wbd_ifnames
           

(3)手動觸發renew消息

指令行:

i5ctl apConfigRenew f6:6f:ed:9d:41:2a 2 0

說明:手動觸發renew消息格式:i5ctl apConfigRenew ALID freqband role

(4)手動模拟觸發wps按鍵組網

#在controller運作如下指令:
hostapd_cli -p /var/run/hostapd -i wl0 wps_cancel
hostapd_cli -p /var/run/hostapd -i wl0 wps_pbc
hostapd_cli -p /var/run/hostapd -i wl1.1 wps_cancel
hostapd_cli -p /var/run/hostapd -i wl1.1 wps_pbc

#在agent上運作如下指令:
wpa_cli -p /var/run/wl1_wpa_supplicant -i wl1 wps_cancel
wpa_cli -p /var/run/wl1_wpa_supplicant -i wl1 wps_pbc
wpa_cli -p /var/run/wl1_wpa_supplicant -i wl0 wps_cancel
wpa_cli -p /var/run/wl1_wpa_supplicant -i wl0 wps_pbc
           

後續更新

繼續閱讀