mirror of
https://github.com/nxp-imx/mwifiex.git
synced 2025-01-15 16:25:35 +00:00
mxm_wifiex: update nxp mxm_wifiex sdk to 186.p4
changes: 1. Added get_txpwrlimit cmd to mlanutl 2. Added source code of mlanutl for supported commands 3. Removed unnecessary .conf files from bin_wlan/config folder Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
This commit is contained in:
parent
5fc6a71423
commit
f18705756b
60 changed files with 898 additions and 41793 deletions
|
@ -22,8 +22,6 @@ CFLAGS := $(filter-out -I$(KERNELDIR)%, $(CFLAGS))
|
|||
#
|
||||
# List of application executables to create
|
||||
#
|
||||
libobjs:= mlanconfig.o mlanhostcmd.o mlanmisc.o
|
||||
exectarget=mlanconfig
|
||||
TARGETS := $(exectarget)
|
||||
|
||||
#
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
#Band config
|
||||
[Band]
|
||||
# band config, 1: 2.4G, 2: 5G
|
||||
02
|
||||
[/Band]
|
||||
# HE Capability
|
||||
[HECap]
|
||||
# ID
|
||||
ff 00
|
||||
# Length
|
||||
1a 00
|
||||
# he capability id
|
||||
23
|
||||
# HE MAC capability info
|
||||
01 00 00 82 00 08
|
||||
# HE PHY capability info
|
||||
04 70 7e c9 fd 01 a0 0e 03 3d 00
|
||||
# Tx Rx HE-MCS NSS support
|
||||
fa ff fa ff
|
||||
# PPE Thresholds (optional)
|
||||
# PE: 16 us
|
||||
e1 ff c7 71
|
||||
[/HECap]
|
||||
####### UAP HE cap ############
|
||||
#Band config
|
||||
#[Band]
|
||||
# band config, 1: 2.4G, 2: 5G
|
||||
#02
|
||||
#[/Band]
|
||||
# HE Capability
|
||||
#[HECap]
|
||||
# ID
|
||||
#ff 00
|
||||
# Length
|
||||
#1a 00
|
||||
# he capability id
|
||||
#23
|
||||
# HE MAC capability info
|
||||
#00 00 00 00 00 00
|
||||
# Enable PPE Threshold
|
||||
#04 20 0e c9 fe 0b a0 0e 01 20 00
|
||||
# Tx Rx HE-MCS NSS support
|
||||
#fa ff fa ff
|
||||
# PPE Thresholds (optional)
|
||||
# PE: 16 us
|
||||
#e1 ff c7 71
|
||||
#[/HECap]
|
||||
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# File : 11n_2040coex.conf
|
||||
|
||||
######################### 20/40 Coex command ##################
|
||||
2040coex={
|
||||
CmdCode=0x00e9 # do NOT change this line
|
||||
|
||||
2040CoexTlvType:1=0x48
|
||||
2040CoexTlvLen:1={
|
||||
2040CoexElement:1=0x04
|
||||
}
|
||||
|
||||
2040BssIntlChanTlvType:1=0x49
|
||||
2040BssIntlChanTlvLen:1={
|
||||
RegulatoryDomain:1=32 # USA: 32 (1-7), 33 (5-11)
|
||||
ChannelNum:1=1
|
||||
ChannelNum:1=2
|
||||
# ...
|
||||
}
|
||||
}
|
||||
|
||||
##################################################################
|
|
@ -1,54 +0,0 @@
|
|||
# File : auto_tx.conf
|
||||
|
||||
######################### Auto-TX command ##################
|
||||
auto_tx_get={
|
||||
CmdCode=0x0082 # do NOT change this line
|
||||
|
||||
Action:2=0 # GET
|
||||
}
|
||||
|
||||
auto_tx_unreg={
|
||||
CmdCode=0x0082 # do NOT change this line
|
||||
|
||||
Action:2=1 # SET
|
||||
}
|
||||
|
||||
nat_keep_alive={
|
||||
CmdCode=0x0082 # do NOT change this line
|
||||
|
||||
Action:2=1 # SET
|
||||
|
||||
AutoTxTlvType:2=0x0118
|
||||
AutoTxTlvLength:2={ # 58 = 6 + 52 (FrameLen)
|
||||
Interval:2=2 # 1 - 3600 seconds
|
||||
Priority:1=7 # Priority, ignored if non-WMM
|
||||
Reserved:1=0
|
||||
FrameLength:2={ # 52 = 6 (DA) + 6 (SA) + 2 + 38 (Length)
|
||||
DestMacAddr:6='0x00,0x40,0xf4,0xbf,0x24,0xee'
|
||||
SrcMacAddr:6='0x00,0x00,0x00,0x00,0x00,0x00'
|
||||
Length:2='0x00,38' # 38 = 8 (SNAP hdr) + 29 (IP) + 1 (padding)
|
||||
DSAP:1=0xaa # SNAP header
|
||||
SSAP:1=0xaa
|
||||
Ctrl:1=0x03
|
||||
SNAP_OUI:3='0x00,0x00,0x00'
|
||||
SNAP_PID:2='0x08,0x00' # IP Packet
|
||||
IPv4:1=0x45
|
||||
IP_TOS:1=0x00
|
||||
IP_LEN:2='0x00,29' # IP hdr 20 + payload 9 = 29
|
||||
IP_ID:2=0xefbe
|
||||
IP_Flag_FragOffset:2=0x0000
|
||||
IP_TTL:1=128
|
||||
IP_Prot:1=17 # UDP protocol
|
||||
IPhdr_cksum:2=0xc5f9 # may need re-calculation if changed
|
||||
IPsrcAddr:4='192,168,0,201' # 192.168.0.201
|
||||
IPdstAddr:4='192,168,0,1' # 192.168.0.1
|
||||
UDPsrcPort:2='0x11,0x94' # 4500
|
||||
UDPdstPort:2='0x11,0x94' # 4500
|
||||
UDPlength:2='0x00,9' # UDP hdr 8 + payload 1 = 9
|
||||
UDPcksum:2=0x985b # may need re-calculation if changed
|
||||
UDPpayload:1=0xff
|
||||
padding:1=0 # MAC Padding for 32bit alignment, set to 0
|
||||
}
|
||||
}
|
||||
}
|
||||
######################### Auto-TX command ##################
|
|
@ -1,16 +0,0 @@
|
|||
# File : band_steering_cfg.conf
|
||||
|
||||
|
||||
######################### band steering configure command ##################
|
||||
band_steering_cfg={
|
||||
CmdCode=0x026f # do NOT change this line
|
||||
|
||||
Action:1=7 # Action = BIT0|BIT1|BIT2,
|
||||
# BIT0: State take effect
|
||||
# BIT1: or this bit if want change Block2gPrbReq
|
||||
# BIT2: OR this bit if want change MaxBtmReqAllowed
|
||||
State:1 = 1 # 0: disable Band steering, 1: enable bandsteering
|
||||
Block2gPrbReq:1=5 # 0~15, the number of probe requests to block before allowing response for the STA
|
||||
MaxBtmReqAllowed:1=3 # 0~15,max bss_transition requests to station
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
# File : bg_scan.conf
|
||||
|
||||
######################### BG Scan Configuration command ##################
|
||||
########### Sample configuration for Get BG Scan Configuration #####################
|
||||
#bgscfg={
|
||||
# CmdCode=0x006b # do NOT change this line
|
||||
# Action:1=0 # 0- Get, 1- Set
|
||||
# ConfigType:1=0 # 0- normal BG Scan config, 1-PPS or UAPSD BG Scan config
|
||||
# Enable:1=1 # 0- Disable, 1-Enable
|
||||
# BssType:1=0 # 1 - Infrastructure,2 - IBSS,3 - Any
|
||||
# ChannelsPerScan:1=0 # Number of Channel to scan at one scan; maximum 14
|
||||
# Reserved1:3=0
|
||||
# ScanInterval:4=0 # Interval between consecutive scan (in milliseconds)
|
||||
# Reserved2:4=0
|
||||
# ReportConditions:4=0 # bit0 - SSID match
|
||||
# bit1 - SNR above SNR threshold
|
||||
# bit2 - RSSI above RSSI threshold
|
||||
# bit31 - All channels scanned at least once
|
||||
# Reserved3:2=0
|
||||
#}
|
||||
|
||||
########### SET BG Scan Configuration #####################
|
||||
bgscfg={
|
||||
CmdCode=0x006b # do NOT change this line
|
||||
Action:1=1 # 0- Get, 1- Set
|
||||
ConfigType:1=0 # 0- normal BG Scan config, 1-PPS or UAPSD BG Scan config
|
||||
Enable:1=1 # 0- Disable, 1-Enable
|
||||
BssType:1=3 # 1 - Infrastructure,2 - IBSS,3 - Any
|
||||
ChannelsPerScan:1=14 # Number of Channel to scan at one scan; maximum 14
|
||||
Reserved1:3=0
|
||||
ScanInterval:4=1000 # Interval between consecutive scan (in milliseconds)
|
||||
Reserved2:4=0
|
||||
ReportConditions:4=1 # bit0 - SSID match
|
||||
# bit1 - SNR above SNR threshold
|
||||
# bit2 - RSSI above RSSI threshold
|
||||
# bit31 - All channels scanned at least once
|
||||
Reserved3:2=0
|
||||
|
||||
# SSID parameter set:
|
||||
#
|
||||
# MaxSSIDLen entries:
|
||||
#
|
||||
# 1. MaxSSIDLen:1=0x00 - to denote match AP name exactly,
|
||||
# generate SSID specific probes
|
||||
# 2. MaxSSIDLen:1=maxlen - to denote AP name will be use to base match the
|
||||
# SSID and SSID's max length is 'maxlen',
|
||||
# do not generate SSID specific probes
|
||||
# 3. MaxSSIDLen:1=wildcard match char ('*' or '?')
|
||||
# - to denote wildcard AP name will be use to match the SSID
|
||||
# 4. MaxSSIDLen:1=0xff - to denote unix pattern matching
|
||||
#
|
||||
# SSID entries:
|
||||
#
|
||||
# SSID="AP_NAME" - to mention the SSID to match
|
||||
|
||||
# SSID Examples:
|
||||
#
|
||||
#
|
||||
# Match SSID name "NXPAP" exactly, generate SSID specific probes
|
||||
#
|
||||
SSIDHeaderType:2=0x0112
|
||||
SSIDHeaderLen:2={
|
||||
MaxSSIDLen:1=0x00
|
||||
SSID:9="NXPAP"
|
||||
}
|
||||
|
||||
#
|
||||
# NXPAP will be use to base match the SSID and SSID's max length is 12
|
||||
#
|
||||
# SSIDHeaderType:2=0x0112
|
||||
# SSIDHeaderLen:2={
|
||||
# MaxSSIDLen:1=0x0c
|
||||
# SSID:9="NXPAP"
|
||||
# }
|
||||
|
||||
#
|
||||
# Match "NXPAP*" where '*' is a single char
|
||||
#
|
||||
# SSIDHeaderType:2=0x0112
|
||||
# SSIDHeaderLen:2={
|
||||
# MaxSSIDLen:1='*'
|
||||
# SSID:10="NXPAP*"
|
||||
# }
|
||||
|
||||
#
|
||||
# Match "Mar?ell*" with unix pattern matching
|
||||
#
|
||||
# SSIDHeaderType:2=0x0112
|
||||
# SSIDHeaderLen:2={
|
||||
# MaxSSIDLen:1=0xff # For unix pattern matching
|
||||
# SSID:8="Mar?ell*"
|
||||
# }
|
||||
|
||||
# Number Probe requests to be sent for broadcast and
|
||||
# for each SSID specific scan required.
|
||||
#
|
||||
# If any SSID in the list has a non-zero modifier (wildcard match char,
|
||||
# unix pattern match, maxlen), "Numprobes" of broadcast probe requests
|
||||
# will be transmitted once per channel and the results matched against
|
||||
# all entries.
|
||||
#
|
||||
# Set to 0 to use global scan probes setting
|
||||
#
|
||||
ProbeHeaderType:2=0x0102
|
||||
ProbeHeaderLen:2={
|
||||
NumProbes:2=2
|
||||
}
|
||||
|
||||
# ChannelList contains the channels to scan
|
||||
# The ChannelList should be specified in the form of
|
||||
#
|
||||
# RadioType, ChanNumber, ScanType, MinScanTime, ScanTime;
|
||||
#
|
||||
# RadioType - 0 [B/G Band], 1 [A Band]
|
||||
# ScanType - 2 [Active], 3 [Passive]
|
||||
#
|
||||
|
||||
ChannHeaderType:2=0x0101
|
||||
ChannHeaderLen:2={
|
||||
Chan1_RadioType:1=0
|
||||
Chan1_ChanNumber:1=10
|
||||
Chan1_ScanType:1=2
|
||||
Chan1_MinScanTime:2=10
|
||||
Chan1_ScanTime:2=100
|
||||
|
||||
Chan2_RadioType:1=0
|
||||
Chan2_ChanNumber:1=6
|
||||
Chan2_ScanType:1=3
|
||||
Chan2_MinScanTime:2=10
|
||||
Chan2_ScanTime:2=100
|
||||
}
|
||||
|
||||
# SNR threshold used when ReportConditions bit1 is set
|
||||
SNRHeaderType:2=0x0105
|
||||
SNRHeaderLen:2={
|
||||
SNRValue:1=40 #SNR Thereshold Value
|
||||
SNRFreq:1=0
|
||||
}
|
||||
|
||||
# RSSI threshold used when ReportConditions bit2 is set
|
||||
#
|
||||
# Threshold is absolute value and match value would
|
||||
# therefore be less than or equal to trigger a report
|
||||
RSSIHeaderType:2=0x0104
|
||||
RSSIHeaderLen:2={
|
||||
RSSIValue:1=50 #RSSI Thereshold Value
|
||||
RSSIFreq:1=0
|
||||
}
|
||||
|
||||
# StartLaterValue: 0 - BGScan start immediately
|
||||
# 1 - BGScan will start later after "Scan Interval"
|
||||
StartLaterHeaderType:2=0x011e
|
||||
StartLaterHeaderLen:2={
|
||||
StartLaterValue:2=0
|
||||
}
|
||||
}
|
||||
######################### BG Scan Configuration command ##################
|
|
@ -1,88 +0,0 @@
|
|||
# File : bg_scan_wifidirect.conf
|
||||
|
||||
######################### BG Scan Configuration command ##################
|
||||
########### SET BG Scan Configuration #####################
|
||||
bgscfg={
|
||||
CmdCode=0x006b # do NOT change this line
|
||||
Action:1=1 # 0- Get, 1- Set
|
||||
ConfigType:1=0 # 0- normal BG Scan config, 1-PPS or UAPSD BG Scan config
|
||||
Enable:1=1 # 0- Disable, 1-Enable
|
||||
BssType:1=3 # 1 - Infrastructure,2 - IBSS,3 - Any
|
||||
ChannelsPerScan:1=3 # Number of Channel to scan at one scan; maximum 14
|
||||
Reserved1:3=0
|
||||
ScanInterval:4=1000 # Interval between consecutive scan (in milliseconds)
|
||||
StoreCondition:4=1 # 1 - SSID match (bit 0)
|
||||
# 2 - SSID match AND SNR above SNR threshold (bit 1)
|
||||
ReportConditions:4=1 # 1 - SSID match (bit 0)
|
||||
# 2 - SSID match AND SNR above SNR threshold (bit 1)
|
||||
Reserved3:2=0
|
||||
|
||||
# SSID parameter set:
|
||||
#
|
||||
SSIDHeaderType:2=0x0112
|
||||
SSIDHeaderLen:2={
|
||||
MaxSSIDLen:1=0x00
|
||||
SSID:7="DIRECT-"
|
||||
}
|
||||
|
||||
# Number Probe requests to be sent for broadcast and
|
||||
# for each SSID specific scan required.
|
||||
#
|
||||
# If any SSID in the list has a non-zero modifier (wildcard match char,
|
||||
# unix pattern match, maxlen), "Numprobes" of broadcast probe requests
|
||||
# will be transmitted once per channel and the results matched against
|
||||
# all entries.
|
||||
#
|
||||
# Set to 0 to use global scan probes setting
|
||||
#
|
||||
ProbeHeaderType:2=0x0102
|
||||
ProbeHeaderLen:2={
|
||||
NumProbes:2=2
|
||||
}
|
||||
|
||||
# ChannelList contains the channels to scan
|
||||
# The ChannelList should be specified in the form of
|
||||
#
|
||||
# RadioType, ChanNumber, ScanType, MinScanTime, ScanTime;
|
||||
#
|
||||
# RadioType - 0 [B/G Band], 1 [A Band]
|
||||
# ScanType - 2 [Active], 3 [Passive]
|
||||
#
|
||||
|
||||
ChannHeaderType:2=0x0101
|
||||
ChannHeaderLen:2={
|
||||
Chan1_RadioType:1=0
|
||||
Chan1_ChanNumber:1=1
|
||||
Chan1_ScanType:1=2
|
||||
Chan1_MinScanTime:2=10
|
||||
Chan1_ScanTime:2=100
|
||||
|
||||
Chan2_RadioType:1=0
|
||||
Chan2_ChanNumber:1=6
|
||||
Chan2_ScanType:1=2
|
||||
Chan2_MinScanTime:2=10
|
||||
Chan2_ScanTime:2=100
|
||||
|
||||
Chan3_RadioType:1=0
|
||||
Chan3_ChanNumber:1=11
|
||||
Chan3_ScanType:1=2
|
||||
Chan3_MinScanTime:2=10
|
||||
Chan3_ScanTime:2=100
|
||||
}
|
||||
|
||||
# SNR threshold to match, when StoreCondition
|
||||
# or ReportConditions been set to 2
|
||||
SNRHeaderType:2=0x0105
|
||||
SNRHeaderLen:2={
|
||||
SNRValue:1=40 #SNR Thereshold Value
|
||||
SNRFreq:1=0
|
||||
}
|
||||
|
||||
# StartLaterValue: 0 - BGScan start immediately
|
||||
# 1 - BGScan will start later after "Scan Interval"
|
||||
StartLaterHeaderType:2=0x011e
|
||||
StartLaterHeaderLen:2={
|
||||
StartLaterValue:2=0
|
||||
}
|
||||
}
|
||||
######################### BG Scan Configuration command ##################
|
|
@ -1,58 +0,0 @@
|
|||
# File : crypto_test.conf
|
||||
|
||||
######################### crypto_test command configuration ##################
|
||||
# support algorithm:1-RC4, 2-AES, 3-AES_KEY_WRAP,4-AES-CCM
|
||||
|
||||
crypto_test={
|
||||
CmdCode=0x0078 # do NOT change this line
|
||||
#EncDec: 0-Decrypt, 1-Encrypt
|
||||
EncDec:2=0
|
||||
#Algorithm: 1-RC4, 2-AES, 3-AES_KEY_WRAP
|
||||
Algorithm:2=1
|
||||
#KeyIVLength: Length of KeyIV (bytes)
|
||||
KeyIVLength:2=8
|
||||
#KeyIV: Key IV
|
||||
KeyIV:32='0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11'
|
||||
#KeyLength: Length of Key (bytes)
|
||||
KeyLength:2=16
|
||||
#Key: Key
|
||||
Key:32='0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22'
|
||||
#DataType: DataType
|
||||
DataType:2=0x0111
|
||||
#DataLength: Data Length
|
||||
DataLength:2={
|
||||
#Data: Data
|
||||
Data:8='0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33'
|
||||
}
|
||||
}
|
||||
|
||||
#####Sample crypto_test command configuration for AES-CCM algorithm #########
|
||||
|
||||
#crypto_test={
|
||||
# CmdCode=0x0078 # do NOT change this line
|
||||
# #EncDec: 0-Decrypt, 1-Encrypt
|
||||
# EncDec:2=1
|
||||
# #Algorithm: 4-AES-CCM
|
||||
# Algorithm:2=4
|
||||
# #KeyLength: Length of Key (bytes)
|
||||
# KeyLength:2=16
|
||||
# #Key: Key
|
||||
# Key:32='0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22'
|
||||
# #NonceLength: Length of Nonce (bytes)
|
||||
# NonceLength:2=10
|
||||
# #Nonce: Nonce
|
||||
# Nonce:14='0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11'
|
||||
# #AADLength: Length of AAD (bytes)
|
||||
# AADLength:2=12
|
||||
# #AAD: AAD
|
||||
# AAD:32='0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33'
|
||||
# #DataType: DataType
|
||||
# DataType:2=0x0111
|
||||
# #DataLength: Data Length
|
||||
# DataLength:2={
|
||||
# #Data: Data
|
||||
# Data:8='0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33'
|
||||
# }
|
||||
#}
|
||||
|
||||
######################### End of crypto_test configuration command ##################
|
|
@ -1,51 +0,0 @@
|
|||
#CW_MODE settings configuration
|
||||
#
|
||||
CW_MODE={
|
||||
#Mode of operation 0: Disable current Tx Mode, 1: Continuous Tx Packet, 2: Continuous Wave/Tone
|
||||
Mode=1
|
||||
#Channel number
|
||||
Channel=6
|
||||
#channel Info
|
||||
#bit [3:0] - channel offset 0: no secondary channel, 1: secondary channel above, 2: reserved, 3: secondary channel below
|
||||
#bit [4:7] - channel band 0: 2.4G, 1: 5G, 2: 4G, 3: reserved
|
||||
Chaninfo=0x00
|
||||
#Tx power for Cont Tx in dbm
|
||||
TxPower=12
|
||||
# Packet Length for Cont Tx
|
||||
# legacy rates: upto 2312, HT/VHT rates: upto 8K
|
||||
PktLength=2048
|
||||
#RateInfo for Cont Tx
|
||||
RateInfo=0x0000
|
||||
#rateInfo = 0x0732 : format = VHT, Bandwidth = 80MHz, datarate/MCS index = MCS7
|
||||
#rateInfo = 0x0000 : format = legacy, Bandwidth = 20MHz, datarate/MCS index = 1Mbps
|
||||
#rateInfo = 0x0521 : format = HT, Bandwidth = 40MHz, datarate/MCS index = MCS5
|
||||
#rateInfo = 0x4521 : format = HT, Bandwidth = 40MHz, datarate/MCS index = MCS5, NSS = 1
|
||||
#rateInfo = 0x8921 : format = HT, Bandwidth = 40MHz, datarate/MCS index = MCS9, NSS = 2
|
||||
#bit [1:0] - Format 0: legacy, 1: 11n (HT), 2: 11ac (VHT)
|
||||
#bit 2 - STBC (Not used for Cont Tx test)
|
||||
#bit 3 - Beamforming (Not used for Cont Tx test)
|
||||
#bit [5:4] - Bandwidth 0: 20MHz, 2: 40MHz, 3: 80MHz
|
||||
#bit [7:6] - reserved
|
||||
#bit [13:8] - index : data rate or MCS
|
||||
#bit [15:14]- NSS (Used for 2x2 chips). Used in FW only for 2x2 chips.
|
||||
#<index> can take following values.
|
||||
#If <format> is 0 (LG), #If <format> is 1 (HT) #If <format> is 2 (VHT)
|
||||
# NSS = 1 NSS = 1 or 2
|
||||
# 0 1 Mbps 0 MCS0 0 MCS0
|
||||
# 1 2 Mbps 1 MCS1 1 MCS1
|
||||
# 2 5.5 Mbps 2 MCS2 2 MCS2
|
||||
# 3 11 Mbps 3 MCS3 3 MCS3
|
||||
# 5 6 Mbps 4 MCS4 4 MCS4
|
||||
# 6 9 Mbps 5 MCS5 5 MCS5
|
||||
# 7 12 Mbps 6 MCS6 6 MCS6
|
||||
# 8 18 Mbps 7 MCS7 7 MCS7
|
||||
# Used only for NSS = 2
|
||||
# 9 24 Mbps 8 MCS8
|
||||
# 10 36 Mbps 9 MCS9
|
||||
# 11 48 Mbps 10 MCS10
|
||||
# 12 54 Mbps 11 MCS11
|
||||
# 12 MCS12
|
||||
# 13 MCS13
|
||||
# 14 MCS14
|
||||
# 15 MCS15
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
#
|
||||
# File: debug.conf
|
||||
# 11ax configuration commands
|
||||
#
|
||||
|
||||
enable_thermal_mgmt={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SUBID:2=0x113 # THERMAL_MANAGEMENT
|
||||
Value:1=1 # 1 -- ENABLE;
|
||||
}
|
||||
|
||||
disable_thermal_mgmt={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SUBID:2=0x113 # THERMAL_MANAGEMENT
|
||||
Value:1=0 # 0 -- DISABLE;
|
||||
}
|
||||
|
||||
get_thermal_mgmt={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
Action:2=0 # 0 - GET
|
||||
SUBID:2=0x113 # THERMAL_MANAGEMENT
|
||||
Value:1=0 # 1 -- ENABLE;
|
||||
# 0 -- DISABLE;
|
||||
}
|
||||
|
||||
stop_su={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SUBID:2=0x101 # DOT11AX_ULOFDMA
|
||||
Value:4=1 # 1 -- stop_su;
|
||||
# 0 -- resume su;
|
||||
}
|
||||
|
||||
start_su={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SUBID:2=0x101 # DOT11AX_ULOFDMA
|
||||
Value:4=0 # 1 -- stop_su;
|
||||
# 0 -- resume su;
|
||||
}
|
||||
|
||||
stop_forceRTS={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SUBID:2=0x104 # DOT11AX_ULOFDMA
|
||||
Value:1=0 # 1 -- stop forceRTS;
|
||||
# 0 -- start forceRTS;
|
||||
}
|
||||
|
||||
start_forceRTS={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SUBID:2=0x104 # DOT11AX_ULOFDMA
|
||||
Value:1=1 # 1 -- start forceRTS;
|
||||
# 0 -- stop forceRTS;
|
||||
}
|
||||
|
||||
set_nonampdu_txctrl_watermark={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SUBID:2=0x116 # NON_AMPDU_TX_CTRL
|
||||
non_ampdu_tx_water_mark.TlvType:2=0x101
|
||||
non_ampdu_tx_water_mark.TlvLength:2={
|
||||
non_ampdu_tx_high_water_mark:1=0x20
|
||||
non_ampdu_tx_low_water_mark:1=0x8
|
||||
}
|
||||
}
|
||||
|
||||
enable_nonampdu_txctrl={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SUBID:2=0x116 # NON_AMPDU_TX_CTRL
|
||||
non_ampdu_tx_ctrl.TlvType:2=0x102
|
||||
non_ampdu_tx_ctrl.TlvLength:2={
|
||||
non_ampdu_tx_ctrl:1=0x1
|
||||
}
|
||||
}
|
||||
|
||||
disable_nonampdu_txctrl={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SUBID:2=0x116 # NON_AMPDU_TX_CTRL
|
||||
non_ampdu_tx_ctrl.TlvType:2=0x102
|
||||
non_ampdu_tx_ctrl.TlvLength:2={
|
||||
non_ampdu_tx_ctrl:1=0x0
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
# File : ed_mac_ctrl_V2_8887.conf
|
||||
#
|
||||
# ed_mac_ctrl_v2 is used for 88W8897, 88W8887, 88W8797, 88W8782, 88W8787
|
||||
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V2_8887.conf ed_mac_ctrl_v2
|
||||
#
|
||||
## Set Energy Detect Threshold for EU Adaptivity test
|
||||
|
||||
ed_mac_ctrl_v2={
|
||||
CmdCode=0x0130 #Command code, DO NOT change this line
|
||||
ed_ctrl_2g.enable:2=0x1 # 0 - disable EU adaptivity for 2.4GHz band
|
||||
# 1 - enable EU adaptivity for 2.4GHz band
|
||||
|
||||
ed_ctrl_2g.offset:2=0x0 # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_2g.on_period:2=0x12 #DO NOT Change this line
|
||||
ed_ctrl_2g.off_period:2=0x0 #DO NOT Change this line
|
||||
ed_ctrl_2g.bitmap:2=0x1 #DO NOT Change this line
|
||||
|
||||
ed_ctrl_5g.enable:2=0x1 # 0 - disable EU adaptivity for 5GHz band
|
||||
# 1 - enable EU adaptivity for 5GHz band
|
||||
|
||||
ed_ctrl_5g.offset:2=0x6 # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_5g.on_period:2=0x12 #DO NOT Change this line
|
||||
ed_ctrl_5g.off_period:2=0x0 #DO NOT Change this line
|
||||
ed_ctrl_5g.bitmap:2=0x1 #DO NOT Change this line
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
# File : ed_mac_ctrl_V2_8897.conf
|
||||
#
|
||||
# ed_mac_ctrl_v2 is used for 88W8897, 88W8887, 88W8797, 88W8782, 88W8787
|
||||
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V2_8897.conf ed_mac_ctrl_v2
|
||||
#
|
||||
## Set Energy Detect Threshold for EU Adaptivity test
|
||||
|
||||
ed_mac_ctrl_v2={
|
||||
CmdCode=0x0130 #Command code, DO NOT change this line
|
||||
ed_ctrl_2g.enable:2=0x1 # 0 - disable EU adaptivity for 2.4GHz band
|
||||
# 1 - enable EU adaptivity for 2.4GHz band
|
||||
|
||||
ed_ctrl_2g.offset:2=0x0 # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_2g.on_period:2=0x12 #DO NOT Change this line
|
||||
ed_ctrl_2g.off_period:2=0x0 #DO NOT Change this line
|
||||
ed_ctrl_2g.bitmap:2=0x1 #DO NOT Change this line
|
||||
|
||||
ed_ctrl_5g.enable:2=0x1 # 0 - disable EU adaptivity for 5GHz band
|
||||
# 1 - enable EU adaptivity for 5GHz band
|
||||
|
||||
ed_ctrl_5g.offset:2=0x4 # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_5g.on_period:2=0x12 #DO NOT Change this line
|
||||
ed_ctrl_5g.off_period:2=0x0 #DO NOT Change this line
|
||||
ed_ctrl_5g.bitmap:2=0x1 #DO NOT Change this line
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
# File : ed_mac_ctrl_V3_8977.conf
|
||||
#
|
||||
# ed_mac_ctrl_v3 is used for 88W8997, 88W8987, 88W8977
|
||||
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V3_8977.conf ed_mac_ctrl_v3
|
||||
#
|
||||
## Set Energy Detect Threshold for EU Adaptivity test
|
||||
|
||||
ed_mac_ctrl_v3={
|
||||
CmdCode=0x0130 #Command code, DO NOT change this line
|
||||
ed_ctrl_2g.enable:2=0x1 # 0 - disable EU adaptivity for 2.4GHz band
|
||||
# 1 - enable EU adaptivity for 2.4GHz band
|
||||
|
||||
ed_ctrl_2g.offset:2=0x9 # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_5g.enable:2=0x1 # 0 - disable EU adaptivity for 5GHz band
|
||||
# 1 - enable EU adaptivity for 5GHz band
|
||||
|
||||
ed_ctrl_5g.offset:2=0xC # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_txq_lock:4=0xFF #DO NOT Change this line
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
# File : ed_mac_ctrl_V3_8978.conf
|
||||
#
|
||||
# ed_mac_ctrl_v3 is used for 88W8997, 88W8987, 88W8977, 88W8978
|
||||
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V3_8978.conf ed_mac_ctrl_v3
|
||||
#
|
||||
## Set Energy Detect Threshold for EU Adaptivity test
|
||||
|
||||
ed_mac_ctrl_v3={
|
||||
CmdCode=0x0130 #Command code, DO NOT change this line
|
||||
ed_ctrl_2g.enable:2=0x1 # 0 - disable EU adaptivity for 2.4GHz band
|
||||
# 1 - enable EU adaptivity for 2.4GHz band
|
||||
|
||||
ed_ctrl_2g.offset:2=0x9 # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_5g.enable:2=0x1 # 0 - disable EU adaptivity for 5GHz band
|
||||
# 1 - enable EU adaptivity for 5GHz band
|
||||
|
||||
ed_ctrl_5g.offset:2=0xC # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_txq_lock:4=0xFF #DO NOT Change this line
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
# File : ed_mac_ctrl_V3_8997.conf
|
||||
#
|
||||
# ed_mac_ctrl_v3 is used for 88W8997, 88W8987, 88W8977
|
||||
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V3_8997.conf ed_mac_ctrl_v3
|
||||
#
|
||||
## Set Energy Detect Threshold for EU Adaptivity test
|
||||
|
||||
ed_mac_ctrl_v3={
|
||||
CmdCode=0x0130 #Command code, DO NOT change this line
|
||||
ed_ctrl_2g.enable:2=0x1 # 0 - disable EU adaptivity for 2.4GHz band
|
||||
# 1 - enable EU adaptivity for 2.4GHz band
|
||||
|
||||
ed_ctrl_2g.offset:2=0x0 # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_5g.enable:2=0x1 # 0 - disable EU adaptivity for 5GHz band
|
||||
# 1 - enable EU adaptivity for 5GHz band
|
||||
|
||||
ed_ctrl_5g.offset:2=0x4 # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_txq_lock:4=0xFF #DO NOT Change this line
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
# File : ed_mac_ctrl_V3_909x.conf
|
||||
#
|
||||
# ed_mac_ctrl_v3 is used for 88W9098, 88W9097
|
||||
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V3_909x.conf ed_mac_ctrl_v3
|
||||
#
|
||||
## Set Energy Detect Threshold for EU Adaptivity test
|
||||
|
||||
ed_mac_ctrl_v3={
|
||||
CmdCode=0x0130 #Command code, DO NOT change this line
|
||||
ed_ctrl_2g.enable:2=0x1 # 0 - disable EU adaptivity for 2.4GHz band
|
||||
# 1 - enable EU adaptivity for 2.4GHz band
|
||||
|
||||
ed_ctrl_2g.offset:2=0x5 # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_5g.enable:2=0x1 # 0 - disable EU adaptivity for 5GHz band
|
||||
# 1 - enable EU adaptivity for 5GHz band
|
||||
|
||||
ed_ctrl_5g.offset:2=0x5 # 0 - Default Energy Detect threshold
|
||||
#offset value range: 0x80 to 0x7F
|
||||
|
||||
ed_ctrl_txq_lock:4=0x1e00FF #DO NOT Change this line
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
# File : init_cfg.conf
|
||||
|
||||
# MAC address (interface: address)
|
||||
mac_addr=mlan0: 00:50:43:20:12:34
|
||||
mac_addr=mmlan0: 00:50:43:20:42:64
|
||||
mac_addr=uap0: 00:50:43:20:12:35
|
||||
mac_addr=muap0: 00:50:43:20:42:65
|
||||
mac_addr=wfd0: 00:50:43:20:12:36
|
||||
mac_addr=mwfd0: 00:40:43:20:42:66
|
||||
|
||||
# Register (type, offset, value)
|
||||
# type 1:MAC/SOC, 2:BBP, 3:RF, 5:CAU
|
||||
#wlan_reg=1,0xA794,0x55FF55FF
|
||||
|
|
@ -1,167 +0,0 @@
|
|||
# File : mef.conf
|
||||
|
||||
######################### MEF Configuration command ##################
|
||||
mefcfg={
|
||||
#Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
|
||||
Criteria=2 # Unicast frames are received during hostsleepmode
|
||||
NumEntries=1 # Number of activated MEF entries
|
||||
#mef_entry_0: example filters to match TCP destination port 80 send by 192.168.0.88 pkt or magic pkt.
|
||||
mef_entry_0={
|
||||
#mode: bit0--hostsleep mode, bit1--non hostsleep mode
|
||||
mode=1 # HostSleep mode
|
||||
#action: 0--discard and not wake host, 1--discard and wake host 3--allow and wake host
|
||||
action=3 # Allow and Wake host
|
||||
filter_num=3 # Number of filter
|
||||
#RPN only support "&&" and "||" operator,space can not be removed between operator.
|
||||
RPN=Filter_0 && Filter_1 || Filter_2
|
||||
#Byte comparison filter's type is 0x41,Decimal comparison filter's type is 0x42,
|
||||
#Bit comparison filter's type is 0x43
|
||||
#Filter_0 is decimal comparison filter, it always with type=0x42
|
||||
#Decimal filter always has type, pattern, offset, numbyte 4 field
|
||||
#Filter_0 will match rx pkt with TCP destination port 80
|
||||
Filter_0={
|
||||
type=0x42 # decimal comparison filter
|
||||
pattern=80 # 80 is the decimal constant to be compared
|
||||
offset=44 # 44 is the byte offset of the field in RX pkt to be compare
|
||||
numbyte=2 # 2 is the number of bytes of the field
|
||||
}
|
||||
#Filter_1 is Byte comparison filter, it always with type=0x41
|
||||
#Byte filter always has type, byte, repeat, offset 4 filed
|
||||
#Filter_1 will match rx pkt send by IP address 192.168.0.88
|
||||
Filter_1={
|
||||
type=0x41 # Byte comparison filter
|
||||
repeat=1 # 1 copies of 'c0:a8:00:58'
|
||||
byte=c0:a8:00:58 # 'c0:a8:00:58' is the byte sequence constant with each byte
|
||||
# in hex format, with ':' as delimiter between two byte.
|
||||
offset=34 # 34 is the byte offset of the equal length field of rx'd pkt.
|
||||
}
|
||||
#Filter_2 is Magic packet, it will looking for 16 contiguous copies of '00:50:43:20:01:02' from
|
||||
# the rx pkt's offset 14
|
||||
Filter_2={
|
||||
type=0x41 # Byte comparison filter
|
||||
repeat=16 # 16 copies of '00:50:43:20:01:02'
|
||||
byte=00:50:43:20:01:02 # '00:50:43:20:01:02' is the byte sequence constant
|
||||
offset=14 # 14 is the byte offset of the equal length field of rx'd pkt.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#--------------------------examples for MEF filters--------------------------------
|
||||
# example: filters to match ARP packet with protocol addr 192.168.0.104
|
||||
# mef_entry_0={
|
||||
# mode=1 # HostSleep mode
|
||||
# action=3 # Allow and Wake host
|
||||
# filter_num=3 # Number of filter
|
||||
# RPN=Filter_0 && Filter_1 && Filter_2
|
||||
# #Filter_0 looking for rx pkt with DA is broadcast address
|
||||
# Filter_0={
|
||||
# type=0x41
|
||||
# repeat=6
|
||||
# byte=ff
|
||||
# offset=0
|
||||
# }
|
||||
# #Filter_1 looking for rx pkt with EtherType is 0x0806(ARP)
|
||||
# Filter_1={
|
||||
# type=0x41
|
||||
# repeat=1
|
||||
# byte=08:06
|
||||
# offset=20
|
||||
# }
|
||||
# #Filter_2 looking for rx pkt with ARP target protocol addr 192.168.0.104
|
||||
# Filter_2={
|
||||
# type=0x41
|
||||
# repeat=1
|
||||
# byte=c0:a8:00:68
|
||||
# offset=46
|
||||
# }
|
||||
# }
|
||||
#-------------------------------------------------------------------------------------
|
||||
# example: filter to check if the destination MAC address is unicast pkt
|
||||
# mef_entry_0={
|
||||
# mode=1 # HostSleep mode
|
||||
# action=3 # Allow and Wake host
|
||||
# filter_num=3 # Number of filter
|
||||
# RPN=Filter_0
|
||||
# #Filter_0 is Bit comparison filter, it always with type=0x43
|
||||
# #Byte filter always has type, byte, mask, offset 4 filed
|
||||
# #"byte" is the byte sequence constant with each byte in hex format, with ':' as delimiter between two byte
|
||||
# #"mask" is also with each byte in hex format, with ':' as delimiter between two byte
|
||||
# #"byte" should has the same length as "mask"
|
||||
# #Filter_0 will check if the destination MAC address is unicast pkt
|
||||
# Filter_0={
|
||||
# type=0x43 #Bit comparison filter
|
||||
# byte=00 #00 is the 1-byte sequence constant
|
||||
# offset=0 #0 is the byte offset of the rx pkt
|
||||
# mask=01 #1 is the 1-byte mask
|
||||
# }
|
||||
# }
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# example: Disable MEF filters
|
||||
# mefcfg={
|
||||
# #Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
|
||||
# Criteria=2 # Unicast frames are received during hostsleepmode
|
||||
# NumEntries=0 # Number of activated MEF entries
|
||||
# }
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# example: Test MEF filters
|
||||
# mefcfg={
|
||||
# Criteria=1
|
||||
# NumEntries=1
|
||||
# mef_entry_0={
|
||||
# mode=4 # Test Mode
|
||||
# action=16 # Invoke Test
|
||||
# filter_num=0
|
||||
# }
|
||||
# }
|
||||
#-----------------------------------------------------------------------------------------------------
|
||||
# example: Test MEF filters
|
||||
# mefcfg={
|
||||
# Criteria=1
|
||||
# NumEntries=1
|
||||
# mef_entry_0={
|
||||
# mode=4
|
||||
# action=0
|
||||
# filter_num=1
|
||||
# RPN=Filter_0
|
||||
# Filter_0={
|
||||
# type=0x44 # test filter
|
||||
# repeat=2 # 2 copies of 'BE:EF'
|
||||
# byte=BE:EF # 'BE:EF' is the byte sequence constant
|
||||
# offset=18 # 18 is the byte offset of the equal length field of rx'd pkt.
|
||||
# dest=00:50:43:20:5a:82 # '00:50:43:20:5a:82' is the byte sequence constant
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
#----------------------------------------------------------------------------------------------------
|
||||
#example: Filter broadcast/ipv4 multicast/ipv6 multicast packets in non hostsleep mode
|
||||
#mefcfg={
|
||||
# Criteria=9 # broadcast and multicast frames
|
||||
# NumEntries=1 # Number of activated MEF entries
|
||||
# mef_entry_0={
|
||||
# mode=2 # non HostSleep mode
|
||||
# action=0 # discard and not wake host
|
||||
# filter_num=3 # Number of filter
|
||||
# RPN=Filter_0 || Filter_1 || Filter_2
|
||||
# Filter_0={ # IPV4 multicast
|
||||
# type=0x41 # byte comparison filter
|
||||
# byte=01:00:5e # 01:00:5e is the byte constant to be compared
|
||||
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
|
||||
# repeat=1 #
|
||||
# }
|
||||
# Filter_1={ # broadcast packet check
|
||||
# type=0x41 # Byte comparison filter
|
||||
# repeat=6 # 6 copies of 'ff', means broadcast
|
||||
# byte=ff # 'ff'(0xff) is the byte sequence constant with each byte
|
||||
# # in hex format, with ':' as delimiter between two byte.
|
||||
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
|
||||
# }
|
||||
# Filter_2={ # IPV6 multicast
|
||||
# type=0x41 # byte comparison filter
|
||||
# byte=33:33 # 33:33 is the byte constant to be compared
|
||||
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
|
||||
# repeat=1 #
|
||||
# }
|
||||
# }
|
||||
#}
|
||||
#------------------------------------------------------------------------------------------------------
|
|
@ -1,204 +0,0 @@
|
|||
# File : mef_mdns.conf
|
||||
|
||||
######################### MEF Configuration command ##################
|
||||
mefcfg={
|
||||
#Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
|
||||
Criteria=8 # Multicast frames are received during hostsleepmode
|
||||
NumEntries=2 # Number of activated MEF entries
|
||||
#mef_entry_0: example filters to match WS-Discovery pkt for IPv4.
|
||||
mef_entry_0={
|
||||
#mode: bit0--hostsleep mode, bit1--non hostsleep mode
|
||||
mode=1 # HostSleep mode
|
||||
#action: 0--discard and not wake host, 1--discard and wake host 3--allow and wake host
|
||||
action=3 # Allow and Wake host
|
||||
filter_num=4 # Number of filter
|
||||
#RPN only support "&&" and "||" operator,space can not be removed between operator.
|
||||
RPN=Filter_0 && Filter_1 && Filter_2 && Filter_3
|
||||
#Filter_0 will match IPv4 protocol packet
|
||||
Filter_0={
|
||||
type=0x41
|
||||
repeat=1
|
||||
byte=08:00
|
||||
offset=20
|
||||
}
|
||||
#Filter_1 will match dest multicast IPv4 address 224.0.0.251
|
||||
Filter_1={
|
||||
type=0x41
|
||||
repeat=1
|
||||
byte=e0:00:00:fb
|
||||
offset=38
|
||||
}
|
||||
#Filter_2 will match UDP packet
|
||||
Filter_2={
|
||||
type=0x42
|
||||
pattern=17
|
||||
offset=31
|
||||
numbyte=1
|
||||
}
|
||||
#Filter_3 will match UDP port 5353
|
||||
Filter_3={
|
||||
type=0x42
|
||||
pattern=5353
|
||||
offset=44
|
||||
numbyte=2
|
||||
}
|
||||
}
|
||||
#mef_entry_1: example filters to match WS-Discovery pkt for IPv6.
|
||||
mef_entry_1={
|
||||
#mode: bit0--hostsleep mode, bit1--non hostsleep mode
|
||||
mode=1 # HostSleep mode
|
||||
#action: 0--discard and not wake host, 1--discard and wake host 3--allow and wake host
|
||||
action=3 # Allow and Wake host
|
||||
filter_num=4 # Number of filter
|
||||
#RPN only support "&&" and "||" operator,space can not be removed between operator.
|
||||
RPN=Filter_0 && Filter_1 && Filter_2 && Filter_3
|
||||
#Filter_0 will match IPv4 protocol packet
|
||||
Filter_0={
|
||||
type=0x41
|
||||
repeat=1
|
||||
byte=86:dd
|
||||
offset=20
|
||||
}
|
||||
#Filter_1 will match dest multicast IPv6 address FF02::FB
|
||||
Filter_1={
|
||||
type=0x41
|
||||
repeat=1
|
||||
byte=ff:02:00:00:00:00:00:00:00:00:00:00:00:00:00:fb
|
||||
offset=46
|
||||
}
|
||||
#Filter_2 will match UDP packet
|
||||
Filter_2={
|
||||
type=0x42
|
||||
pattern=17
|
||||
offset=28
|
||||
numbyte=1
|
||||
}
|
||||
#Filter_3 will match UDP port 5353
|
||||
Filter_3={
|
||||
type=0x42
|
||||
pattern=5353
|
||||
offset=64
|
||||
numbyte=2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#--------------------------examples for MEF filters--------------------------------
|
||||
# example: filters to match ARP packet with protocol addr 192.168.0.104
|
||||
# mef_entry_0={
|
||||
# mode=1 # HostSleep mode
|
||||
# action=3 # Allow and Wake host
|
||||
# filter_num=3 # Number of filter
|
||||
# RPN=Filter_0 && Filter_1 && Filter_2
|
||||
# #Filter_0 looking for rx pkt with DA is broadcast address
|
||||
# Filter_0={
|
||||
# type=0x41
|
||||
# repeat=6
|
||||
# byte=ff
|
||||
# offset=0
|
||||
# }
|
||||
# #Filter_1 looking for rx pkt with EtherType is 0x0806(ARP)
|
||||
# Filter_1={
|
||||
# type=0x41
|
||||
# repeat=1
|
||||
# byte=08:06
|
||||
# offset=20
|
||||
# }
|
||||
# #Filter_2 looking for rx pkt with ARP target protocol addr 192.168.0.104
|
||||
# Filter_2={
|
||||
# type=0x41
|
||||
# repeat=1
|
||||
# byte=c0:a8:00:68
|
||||
# offset=46
|
||||
# }
|
||||
# }
|
||||
#-------------------------------------------------------------------------------------
|
||||
# example: filter to check if the destination MAC address is unicast pkt
|
||||
# mef_entry_0={
|
||||
# mode=1 # HostSleep mode
|
||||
# action=3 # Allow and Wake host
|
||||
# filter_num=3 # Number of filter
|
||||
# RPN=Filter_0
|
||||
# #Filter_0 is Bit comparison filter, it always with type=0x43
|
||||
# #Byte filter always has type, byte, mask, offset 4 filed
|
||||
# #"byte" is the byte sequence constant with each byte in hex format, with ':' as delimiter between two byte
|
||||
# #"mask" is also with each byte in hex format, with ':' as delimiter between two byte
|
||||
# #"byte" should has the same length as "mask"
|
||||
# #Filter_0 will check if the destination MAC address is unicast pkt
|
||||
# Filter_0={
|
||||
# type=0x43 #Bit comparison filter
|
||||
# byte=00 #00 is the 1-byte sequence constant
|
||||
# offset=0 #0 is the byte offset of the rx pkt
|
||||
# mask=01 #1 is the 1-byte mask
|
||||
# }
|
||||
# }
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# example: Disable MEF filters
|
||||
# mefcfg={
|
||||
# #Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
|
||||
# Criteria=2 # Unicast frames are received during hostsleepmode
|
||||
# NumEntries=0 # Number of activated MEF entries
|
||||
# }
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# example: Test MEF filters
|
||||
# mefcfg={
|
||||
# Criteria=1
|
||||
# NumEntries=1
|
||||
# mef_entry_0={
|
||||
# mode=4 # Test Mode
|
||||
# action=16 # Invoke Test
|
||||
# filter_num=0
|
||||
# }
|
||||
# }
|
||||
#-----------------------------------------------------------------------------------------------------
|
||||
# example: Test MEF filters
|
||||
# mefcfg={
|
||||
# Criteria=1
|
||||
# NumEntries=1
|
||||
# mef_entry_0={
|
||||
# mode=4
|
||||
# action=0
|
||||
# filter_num=1
|
||||
# RPN=Filter_0
|
||||
# Filter_0={
|
||||
# type=0x44 # test filter
|
||||
# repeat=2 # 2 copies of 'BE:EF'
|
||||
# byte=BE:EF # 'BE:EF' is the byte sequence constant
|
||||
# offset=18 # 18 is the byte offset of the equal length field of rx'd pkt.
|
||||
# dest=00:50:43:20:5a:82 # '00:50:43:20:5a:82' is the byte sequence constant
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
#----------------------------------------------------------------------------------------------------
|
||||
#example: Filter broadcast/ipv4 multicast/ipv6 multicast packets in non hostsleep mode
|
||||
#mefcfg={
|
||||
# Criteria=9 # broadcast and multicast frames
|
||||
# NumEntries=1 # Number of activated MEF entries
|
||||
# mef_entry_0={
|
||||
# mode=2 # non HostSleep mode
|
||||
# action=0 # discard and not wake host
|
||||
# filter_num=3 # Number of filter
|
||||
# RPN=Filter_0 || Filter_1 || Filter_2
|
||||
# Filter_0={ # IPV4 multicast
|
||||
# type=0x41 # byte comparison filter
|
||||
# byte=01:00:5e # 01:00:5e is the byte constant to be compared
|
||||
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
|
||||
# repeat=1 #
|
||||
# }
|
||||
# Filter_1={ # broadcast packet check
|
||||
# type=0x41 # Byte comparison filter
|
||||
# repeat=6 # 6 copies of 'ff', means broadcast
|
||||
# byte=ff # 'ff'(0xff) is the byte sequence constant with each byte
|
||||
# # in hex format, with ':' as delimiter between two byte.
|
||||
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
|
||||
# }
|
||||
# Filter_2={ # IPV6 multicast
|
||||
# type=0x41 # byte comparison filter
|
||||
# byte=33:33 # 33:33 is the byte constant to be compared
|
||||
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
|
||||
# repeat=1 #
|
||||
# }
|
||||
# }
|
||||
#}
|
||||
#------------------------------------------------------------------------------------------------------
|
|
@ -1,204 +0,0 @@
|
|||
# File : mef_ws_discovery.conf
|
||||
|
||||
######################### MEF Configuration command ##################
|
||||
mefcfg={
|
||||
#Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
|
||||
Criteria=8 # Multicast frames are received during hostsleepmode
|
||||
NumEntries=2 # Number of activated MEF entries
|
||||
#mef_entry_0: example filters to match WS-Discovery pkt for IPv4.
|
||||
mef_entry_0={
|
||||
#mode: bit0--hostsleep mode, bit1--non hostsleep mode
|
||||
mode=1 # HostSleep mode
|
||||
#action: 0--discard and not wake host, 1--discard and wake host 3--allow and wake host
|
||||
action=3 # Allow and Wake host
|
||||
filter_num=4 # Number of filter
|
||||
#RPN only support "&&" and "||" operator,space can not be removed between operator.
|
||||
RPN=Filter_0 && Filter_1 && Filter_2 && Filter_3
|
||||
#Filter_0 will match IPv4 protocol packet
|
||||
Filter_0={
|
||||
type=0x41
|
||||
repeat=1
|
||||
byte=08:00
|
||||
offset=20
|
||||
}
|
||||
#Filter_1 will match dest multicast IPv4 address 239.255.255.250
|
||||
Filter_1={
|
||||
type=0x41
|
||||
repeat=1
|
||||
byte=ef:ff:ff:fa
|
||||
offset=38
|
||||
}
|
||||
#Filter_2 will match UDP packet
|
||||
Filter_2={
|
||||
type=0x42
|
||||
pattern=17
|
||||
offset=31
|
||||
numbyte=1
|
||||
}
|
||||
#Filter_3 will match UDP port 3702
|
||||
Filter_3={
|
||||
type=0x42
|
||||
pattern=3702
|
||||
offset=44
|
||||
numbyte=2
|
||||
}
|
||||
}
|
||||
#mef_entry_1: example filters to match WS-Discovery pkt for IPv6.
|
||||
mef_entry_1={
|
||||
#mode: bit0--hostsleep mode, bit1--non hostsleep mode
|
||||
mode=1 # HostSleep mode
|
||||
#action: 0--discard and not wake host, 1--discard and wake host 3--allow and wake host
|
||||
action=3 # Allow and Wake host
|
||||
filter_num=4 # Number of filter
|
||||
#RPN only support "&&" and "||" operator,space can not be removed between operator.
|
||||
RPN=Filter_0 && Filter_1 && Filter_2 && Filter_3
|
||||
#Filter_0 will match IPv4 protocol packet
|
||||
Filter_0={
|
||||
type=0x41
|
||||
repeat=1
|
||||
byte=86:dd
|
||||
offset=20
|
||||
}
|
||||
#Filter_1 will match dest multicast IPv6 address FF02::C
|
||||
Filter_1={
|
||||
type=0x41
|
||||
repeat=1
|
||||
byte=ff:02:00:00:00:00:00:00:00:00:00:00:00:00:00:0c
|
||||
offset=46
|
||||
}
|
||||
#Filter_2 will match UDP packet
|
||||
Filter_2={
|
||||
type=0x42
|
||||
pattern=17
|
||||
offset=28
|
||||
numbyte=1
|
||||
}
|
||||
#Filter_3 will match UDP port 3702
|
||||
Filter_3={
|
||||
type=0x42
|
||||
pattern=3702
|
||||
offset=64
|
||||
numbyte=2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#--------------------------examples for MEF filters--------------------------------
|
||||
# example: filters to match ARP packet with protocol addr 192.168.0.104
|
||||
# mef_entry_0={
|
||||
# mode=1 # HostSleep mode
|
||||
# action=3 # Allow and Wake host
|
||||
# filter_num=3 # Number of filter
|
||||
# RPN=Filter_0 && Filter_1 && Filter_2
|
||||
# #Filter_0 looking for rx pkt with DA is broadcast address
|
||||
# Filter_0={
|
||||
# type=0x41
|
||||
# repeat=6
|
||||
# byte=ff
|
||||
# offset=0
|
||||
# }
|
||||
# #Filter_1 looking for rx pkt with EtherType is 0x0806(ARP)
|
||||
# Filter_1={
|
||||
# type=0x41
|
||||
# repeat=1
|
||||
# byte=08:06
|
||||
# offset=20
|
||||
# }
|
||||
# #Filter_2 looking for rx pkt with ARP target protocol addr 192.168.0.104
|
||||
# Filter_2={
|
||||
# type=0x41
|
||||
# repeat=1
|
||||
# byte=c0:a8:00:68
|
||||
# offset=46
|
||||
# }
|
||||
# }
|
||||
#-------------------------------------------------------------------------------------
|
||||
# example: filter to check if the destination MAC address is unicast pkt
|
||||
# mef_entry_0={
|
||||
# mode=1 # HostSleep mode
|
||||
# action=3 # Allow and Wake host
|
||||
# filter_num=3 # Number of filter
|
||||
# RPN=Filter_0
|
||||
# #Filter_0 is Bit comparison filter, it always with type=0x43
|
||||
# #Byte filter always has type, byte, mask, offset 4 filed
|
||||
# #"byte" is the byte sequence constant with each byte in hex format, with ':' as delimiter between two byte
|
||||
# #"mask" is also with each byte in hex format, with ':' as delimiter between two byte
|
||||
# #"byte" should has the same length as "mask"
|
||||
# #Filter_0 will check if the destination MAC address is unicast pkt
|
||||
# Filter_0={
|
||||
# type=0x43 #Bit comparison filter
|
||||
# byte=00 #00 is the 1-byte sequence constant
|
||||
# offset=0 #0 is the byte offset of the rx pkt
|
||||
# mask=01 #1 is the 1-byte mask
|
||||
# }
|
||||
# }
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# example: Disable MEF filters
|
||||
# mefcfg={
|
||||
# #Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
|
||||
# Criteria=2 # Unicast frames are received during hostsleepmode
|
||||
# NumEntries=0 # Number of activated MEF entries
|
||||
# }
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# example: Test MEF filters
|
||||
# mefcfg={
|
||||
# Criteria=1
|
||||
# NumEntries=1
|
||||
# mef_entry_0={
|
||||
# mode=4 # Test Mode
|
||||
# action=16 # Invoke Test
|
||||
# filter_num=0
|
||||
# }
|
||||
# }
|
||||
#-----------------------------------------------------------------------------------------------------
|
||||
# example: Test MEF filters
|
||||
# mefcfg={
|
||||
# Criteria=1
|
||||
# NumEntries=1
|
||||
# mef_entry_0={
|
||||
# mode=4
|
||||
# action=0
|
||||
# filter_num=1
|
||||
# RPN=Filter_0
|
||||
# Filter_0={
|
||||
# type=0x44 # test filter
|
||||
# repeat=2 # 2 copies of 'BE:EF'
|
||||
# byte=BE:EF # 'BE:EF' is the byte sequence constant
|
||||
# offset=18 # 18 is the byte offset of the equal length field of rx'd pkt.
|
||||
# dest=00:50:43:20:5a:82 # '00:50:43:20:5a:82' is the byte sequence constant
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
#----------------------------------------------------------------------------------------------------
|
||||
#example: Filter broadcast/ipv4 multicast/ipv6 multicast packets in non hostsleep mode
|
||||
#mefcfg={
|
||||
# Criteria=9 # broadcast and multicast frames
|
||||
# NumEntries=1 # Number of activated MEF entries
|
||||
# mef_entry_0={
|
||||
# mode=2 # non HostSleep mode
|
||||
# action=0 # discard and not wake host
|
||||
# filter_num=3 # Number of filter
|
||||
# RPN=Filter_0 || Filter_1 || Filter_2
|
||||
# Filter_0={ # IPV4 multicast
|
||||
# type=0x41 # byte comparison filter
|
||||
# byte=01:00:5e # 01:00:5e is the byte constant to be compared
|
||||
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
|
||||
# repeat=1 #
|
||||
# }
|
||||
# Filter_1={ # broadcast packet check
|
||||
# type=0x41 # Byte comparison filter
|
||||
# repeat=6 # 6 copies of 'ff', means broadcast
|
||||
# byte=ff # 'ff'(0xff) is the byte sequence constant with each byte
|
||||
# # in hex format, with ':' as delimiter between two byte.
|
||||
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
|
||||
# }
|
||||
# Filter_2={ # IPV6 multicast
|
||||
# type=0x41 # byte comparison filter
|
||||
# byte=33:33 # 33:33 is the byte constant to be compared
|
||||
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
|
||||
# repeat=1 #
|
||||
# }
|
||||
# }
|
||||
#}
|
||||
#------------------------------------------------------------------------------------------------------
|
|
@ -1,17 +0,0 @@
|
|||
#File : memory/register update
|
||||
# memory/register update file
|
||||
mem_set={
|
||||
CmdCode=0x0086 #do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
Rsrvd:2=0
|
||||
Addr:4=0x8000a584 # memory/register address
|
||||
Value:4=0x16161669 #Value
|
||||
}
|
||||
|
||||
mem_get={
|
||||
CmdCode=0x0086 #do NOT change this line
|
||||
Action:2=0 # 1 - SET
|
||||
Rsrvd:2=0
|
||||
Addr:4=0x8000a584 # memory/register address
|
||||
Result:4=0
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
# Format of the packet data to be sent.
|
||||
# Update the TxControl value for TxPD, else zero is sent.
|
||||
# all packet data is written under "Data" block
|
||||
|
||||
PktType=0x00 # should be zero for MGMT frames
|
||||
PktSubType=0x05
|
||||
# Assoc Request 0
|
||||
# Assoc Response 1
|
||||
# Re-Assoc Request 2
|
||||
# Re-Assoc Response 3
|
||||
# Probe Request 4
|
||||
# Probe Response 5
|
||||
# Beacon 8
|
||||
# Atim 9
|
||||
# Dis-assoc 10
|
||||
# Auth 11
|
||||
# Deauth 12
|
||||
# Action Frame 13
|
||||
|
||||
FromDS=0
|
||||
ToDS=0
|
||||
|
||||
Addr1=00:50:43:27:B0:41 # Destination address
|
||||
Addr2=00:50:43:21:0F:84 # Source address
|
||||
Addr3=00:50:43:21:0F:84 # BSSID
|
||||
|
||||
Data=0x01,0x01,0x00,0x0c,0x00,0x58,0x02,0x40
|
||||
|
||||
SeqNum=0
|
||||
FragNum=0
|
|
@ -1,15 +0,0 @@
|
|||
##############management frame filter to wake up host ###########
|
||||
##### support two entries currently ######
|
||||
mgmtfilter={
|
||||
entry_num=1
|
||||
entry_0={
|
||||
action=1 # discard and wakeup host
|
||||
type=0x1 # p2p frames
|
||||
frame_mask=0x7 # Go neg req & rsp & cfm frame
|
||||
}
|
||||
# entry_1={
|
||||
# action=0 # discard and not wakeup host
|
||||
# type=0xff # management frames
|
||||
# frame_mask=0x3 # assoc req & rsp frame
|
||||
# }
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
07 01 03 3A 80 00 3A 00 ff ff 00 17 03 00 07 03
|
||||
09 00 0e 10 16 02 19 25 1a 04 1c ff 32 5e 33 15
|
||||
35 29 36 17 4b 74 4c 64 4d 3b 50 27 61 d6 62 98
|
||||
6b ae 6f 5b 77 f2 79 ff 7f 2d
|
||||
07 01 12 16 c0 00 ff ff ff ff 00 05 03 10 32 5c
|
||||
33 1a 6b a2 7f 20
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
# File : pad_cfg.conf
|
||||
|
||||
## Get CFG data for PAD OR
|
||||
pad_cfg_get={
|
||||
CmdCode=0x008f # do NOT change this line
|
||||
Action:2=0 # 0 - GET
|
||||
Type:2=5 # 5 - optimized pad reg
|
||||
CfgLen:2={
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
## Set CFG data for PAD OR
|
||||
#pad_cfg_set={
|
||||
# CmdCode=0x008f # do NOT change this line
|
||||
# Action:2=1 # 1 - SET
|
||||
# Type:2=5 # 5 - optimized pad reg
|
||||
# CfgLen:2={ # 9 entries for W8787
|
||||
# CFG1:4=0x00000000 # SDIO in sleep
|
||||
# CFG2:4=0x55550004 # GPIO in sleep
|
||||
# CFG3:4=0x00000001
|
||||
# CFG4:4=0x00000000 # RFCTRL in sleep
|
||||
# CFG5:4=0x00000000
|
||||
# CFG6:4=0x0E001800 # GPIO/RFCTRL in power down
|
||||
# CFG7:4=0x249A0000
|
||||
# CFG8:4=0x000000D2
|
||||
# CFG9:4=0x00000000
|
||||
# }
|
||||
#}
|
|
@ -1,15 +0,0 @@
|
|||
# File : requesttpc.conf
|
||||
|
||||
######################### requesttpc command configuration ##################
|
||||
|
||||
requesttpc={
|
||||
CmdCode=0x0060 # do NOT change this line
|
||||
#DestMac: Destination STA address
|
||||
DestMac:6='0x02,0x04,0x0e,0x06,0x01,0x12'
|
||||
#RateIndex: IEEE Rate index to send request
|
||||
RateIndex:1=22
|
||||
#Timeout: Response timeout in ms
|
||||
Timeout:2=10
|
||||
}
|
||||
|
||||
######################### End of requesttpc command configuration ##################
|
|
@ -1,211 +0,0 @@
|
|||
# File : robust_btc.conf
|
||||
|
||||
######################### Robust Coex command ###############
|
||||
mode_get={
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=0 # GET
|
||||
RSVD:2=0
|
||||
|
||||
# Robust Coex Mode TLV
|
||||
RobustCoexTlvType:2=0x0160
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:1=0x00 # Read-back Coex mode(s)
|
||||
Reserved:3=0
|
||||
}
|
||||
}
|
||||
|
||||
mode_timeshare={
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=1 # SET
|
||||
RSVD:2=0
|
||||
|
||||
# Robust Coex Mode TLV
|
||||
RobustCoexTlvType:2=0x0160
|
||||
RobustCoexTlvLength:2={
|
||||
# All the modes below are mutually exclusive of each other;
|
||||
Enable:1=0x01 # Bit0: Enable 2x2 or 1x1 Time Distribute(TMD)
|
||||
# Robust Coex(RBC) mode, when uAP bss start,
|
||||
# uAP TMD RBC scheme is enabled,
|
||||
# STA TMD RBC scheme is disabled.
|
||||
Reserved:3=0
|
||||
}
|
||||
}
|
||||
|
||||
mode_spatial={
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=1 # SET
|
||||
RSVD:2=0
|
||||
|
||||
# Robust Coex Mode TLV
|
||||
RobustCoexTlvType:2=0x0160
|
||||
RobustCoexTlvLength:2={
|
||||
# All the modes below are mutually exclusive of each other;
|
||||
Enable:1=0x82 # Bit1: Enable 1x1 SMPS Spatial RBC Mode, e.g. 0x02
|
||||
# Bit7: Enable uAP+STA SMPS RBC Mode,
|
||||
# when uAP bss start, uAP SMPS RBC scheme enable,
|
||||
# must combined with BIT1 or BIT2, e.g. 0x82, 0x84.
|
||||
Reserved:3=0
|
||||
}
|
||||
}
|
||||
|
||||
mode_none={
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=1 # SET
|
||||
RSVD:2=0
|
||||
|
||||
# Robust Coex Mode TLV
|
||||
RobustCoexTlvType:2=0x0160
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:1=0 # Concurrent Coex mode. Used for chips which has
|
||||
# separate antenna for BT
|
||||
Reserved:3=0
|
||||
}
|
||||
}
|
||||
|
||||
mode_2={
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=1 # SET
|
||||
RSVD:2=0
|
||||
|
||||
# Robust Coex Mode TLV
|
||||
RobustCoexTlvType:2=0x0160
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:1=0x20 # Concurrent Coex mode with Tx power control and Rx De-sense.
|
||||
# Used for chips which has separate antenna for BT
|
||||
Reserved:3=0
|
||||
}
|
||||
}
|
||||
|
||||
gpio_cfg={
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=1 # SET
|
||||
RSVD:2=0
|
||||
|
||||
# Robust Coex Mode TLV
|
||||
RobustCoexTlvType:2=0x021B
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:1=0x1 # enable GPIO cfg for external bt request
|
||||
gpionum:1=4 # gpio 4
|
||||
gpiopolarity:1=1 # Polarity High
|
||||
}
|
||||
}
|
||||
|
||||
external_coex_config={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1 //0x0 get, 0x1 set
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0238 //TLV ID
|
||||
RobustCoexTlvLength:2={
|
||||
Enabled:1=0x01 // 0x00 disable, 0x01 enalbe
|
||||
|
||||
ExtHighInputPriority:1=0x02 // Input priority: 0x00 Input Low Priority, 0x01 Input Medium Priority, 0x02 Input High Priority
|
||||
ExtLowInputPriority:1=0x02
|
||||
|
||||
ExtPriGPIONum:1=0x06; // Input Priority signal GPIO pin number
|
||||
ExtPriGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High
|
||||
|
||||
ExtReqGPIONum:1=0x07; // Input Request signal GPIO pin number
|
||||
ExtReqGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High
|
||||
|
||||
ExtGrntGPIONum:1=0x05; // Output Grant signal GPIO pin number
|
||||
ExtGrntGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#In Station generic case
|
||||
#BT time is set as BTTime
|
||||
#Wlan time is set as Wlan Time
|
||||
generictime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0390
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTime:2=10000 #(10ms) BTTime must be less than 65535
|
||||
WlanTime:2=40000 #(40ms) WlanTime must be less than 65535
|
||||
}
|
||||
}
|
||||
|
||||
#In Station A2DP case
|
||||
#BT time is set as BTTime
|
||||
#Wlan time is set as Wlan Time
|
||||
a2dptime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0391
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTime:2=10000 #(10ms) BTTime must be less than 65535
|
||||
WlanTime:2=39500 #(39.5ms) WlanTime must be less than 65535
|
||||
}
|
||||
}
|
||||
|
||||
#In Station inquiry case
|
||||
#BT time is set as BTTime
|
||||
#Wlan time is set as Wlan Time
|
||||
inquirytime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0392
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTime:2=21215 #(21.215ms) BTTime must be less than 65535
|
||||
WlanTime:2=11000 #(11ms) WlanTime must be less than 65535
|
||||
}
|
||||
}
|
||||
|
||||
#In Ap generic case
|
||||
#BT time is BTTimeBusy when BT has traffic
|
||||
#BT time is BTTimeIdle when BT is idle
|
||||
#Wlan time is WlanTimeBusy when Wlan has traffic
|
||||
#Wlan time is WlanTimeIdle when Wlan is idle
|
||||
ap_generictime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0393
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTime_MAX:2=23000 #(23ms) BTTime(BT Busy) must be less than 28767
|
||||
BtTime_MIN:2=6500 #(6.5ms) BTTime(BT Idle) must be less than 28767
|
||||
WlanTime_MAX:2=18000 #(18ms) WlanTime(Wlan Busy) must be less than 32767
|
||||
WlanTime_MIN:2=5750 #(5.75ms) WlanTime(Wlan Idle) must be less than 32767
|
||||
}
|
||||
}
|
||||
|
||||
#In Ap A2DP case
|
||||
#BT time is change from BTTimeMax to BTTimeMin
|
||||
#Wlan time is change from WlanTimeMax to WlanTimeMin
|
||||
ap_a2dptime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0394
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTimebusy:2=23000 #(23ms) Maximum BTTime must be less than 32767
|
||||
BtTimeidle:2=6500 #(6.5ms) Minimum BTTime must be less than 32767
|
||||
WlanTimebusy:2=18000 #(18ms) Maximum WlanTime must be less than 32767
|
||||
WlanTimeidle:2=5750 #(5.75ms) Minimum WlanTime must be less than 32767
|
||||
}
|
||||
}
|
||||
|
||||
#In Ap inquiry case
|
||||
#BT time is set as BTTime
|
||||
#Wlan time is set as Wlan Time
|
||||
ap_inquirytime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0395
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTime:2=28750 #(28.75ms) BTTime must less than 32767
|
||||
WlanTime:2=20000 #(20ms) WlanTime must be less than 32767
|
||||
}
|
||||
}
|
||||
######################### Robust Coex command ###############
|
|
@ -1,674 +0,0 @@
|
|||
# File: rutxpower_limit.conf
|
||||
|
||||
## Get CFG data for RU based Tx power limit
|
||||
rutxpowerlimit_cfg_get={
|
||||
CmdCode=0x026d #do not change this line
|
||||
Action:2=0 #0 - GET
|
||||
SubID:2=0x117 #RU POWER
|
||||
}
|
||||
|
||||
|
||||
## Set CFG data for RU based Tx power limit
|
||||
##
|
||||
## TLVStartFreq: Starting Frequency of the band for this channel
|
||||
## 2407, 2414 or 2400 for 2.4 GHz
|
||||
## 5000
|
||||
## 4000
|
||||
## TLVChanWidth: Channel Width
|
||||
## 20 40 80
|
||||
## TLVChanNum : Channel Number
|
||||
## TLVPwr[] : Power Limit in dBm (RU=26,52,106,242,484,996)
|
||||
## range from -64dBm to +63dBm in steps of 1dBm
|
||||
##
|
||||
|
||||
rutxpowerlimit_cfg_set={
|
||||
CmdCode=0x026d #do not change this line
|
||||
Action:2=1 #1 - SET
|
||||
SubID:2=0x117 #RU POWER
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=1
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=2
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=3
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=4
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=5
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=6
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=7
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=8
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=9
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=10
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=11
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=12
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=13
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
}
|
||||
|
||||
rutxpowerlimit_5g_cfg_set={
|
||||
CmdCode=0x026d #do not change this line
|
||||
Action:2=1 #1 - SET
|
||||
SubID:2=0x117 #RU POWER
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=36
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=40
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=44
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=48
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=52
|
||||
TlvPwr:6='-2,1,4,7,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=56
|
||||
TlvPwr:6='-2,1,4,7,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=60
|
||||
TlvPwr:6='-2,1,4,7,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=64
|
||||
TlvPwr:6='-2,1,4,7,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=100
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=104
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=108
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=112
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=116
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=120
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=124
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=128
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=132
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=136
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=140
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=144
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=149
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=153
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=157
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=161
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=20
|
||||
TlvChanNum:1=165
|
||||
TlvPwr:6='-1,2,5,8,0,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=36
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=40
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=44
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=48
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=52
|
||||
TlvPwr:6='-5,-2,1,4,7,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=56
|
||||
TlvPwr:6='-5,-2,1,4,7,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=60
|
||||
TlvPwr:6='-5,-2,1,4,7,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=64
|
||||
TlvPwr:6='-5,-2,1,4,7,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=100
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=104
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=108
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=112
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=116
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=120
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=124
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=128
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=132
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=136
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=149
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=153
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=157
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=40
|
||||
TlvChanNum:1=161
|
||||
TlvPwr:6='-4,-1,2,5,8,0'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=36
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=40
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=44
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=48
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=52
|
||||
TlvPwr:6='-8,-5,-2,1,4,7'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=56
|
||||
TlvPwr:6='-8,-5,-2,1,4,7'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=60
|
||||
TlvPwr:6='-8,-5,-2,1,4,7'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=64
|
||||
TlvPwr:6='-8,-5,-2,1,4,7'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=100
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=104
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=108
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=112
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=116
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=120
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=124
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=128
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=149
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=153
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=157
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
|
||||
PwrVal.TlvType:2=0x0244
|
||||
PwrVal.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TlvChanWidth:1=80
|
||||
TlvChanNum:1=161
|
||||
TlvPwr:6='-7,-4,-1,2,5,8'
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
# File : sdio_pulldown.conf
|
||||
|
||||
######################### SDIO Pulldown command ###############
|
||||
sdio_pulldown_get={
|
||||
CmdCode=0x0093 # do NOT change this line
|
||||
|
||||
Action:2=0 # GET
|
||||
PullUpDelay:2=0
|
||||
PullDownDelay:2=0
|
||||
}
|
||||
|
||||
sdio_pulldown_set={
|
||||
CmdCode=0x0093 # do NOT change this line
|
||||
|
||||
Action:2=1 # SET
|
||||
PullUpDelay:2=0
|
||||
PullDownDelay:2=0
|
||||
}
|
||||
|
||||
sdio_pulldown_disable={
|
||||
CmdCode=0x0093 # do NOT change this line
|
||||
|
||||
Action:2=1 # SET
|
||||
PullUpDelay:2=0xffff
|
||||
PullDownDelay:2=0xffff
|
||||
}
|
||||
######################### SDIO Pulldown command ###############
|
|
@ -1,62 +0,0 @@
|
|||
# File : small_debug.conf
|
||||
|
||||
######################### DBG Config command ###############
|
||||
small_debug_enable={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
|
||||
Dst:1=0x06 # dbgs_cfg_t
|
||||
Air_Chan:1=0x00
|
||||
RSVD:1=0
|
||||
Num_Entries:1=0x81 # one entry global enable
|
||||
|
||||
# dbgs_t
|
||||
En_Mask:2=0x0000 # en_mask_id
|
||||
BaseId:2=0x0000 # base_id
|
||||
}
|
||||
|
||||
small_debug_disable={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
|
||||
Dst:1=0x00
|
||||
Air_Chan:1=0x00
|
||||
RSVD:1=0
|
||||
Num_Entries:1=0x00
|
||||
}
|
||||
|
||||
######################### DBG Get Trace Memory ###############
|
||||
# Disable Air and Host destinations to disable dbgs_drain
|
||||
# Enable only the Power save ID - Host interface is a course enable - not on specific event
|
||||
trace_enable={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
|
||||
Dst:1=0x00 # dbgs_cfg_t - don't drain debug
|
||||
Air_Chan:1=0x00
|
||||
RSVD:1=0
|
||||
Num_Entries:1=0x02 # 2 entry
|
||||
|
||||
# dbgs_t
|
||||
En_Mask:2=0x5fff # en_mask_id - enable single ID=0x80
|
||||
BaseId:2=0x0020 # base_id
|
||||
En_Mask:2=0x5fff # en_mask_id - enable single ID=0x80
|
||||
BaseId:2=0x0021 # base_id
|
||||
}
|
||||
|
||||
get_trace={
|
||||
CmdCode=0x008c # do NOT change this line
|
||||
|
||||
startAddress:4=0x02 # read trace memeory - not a generic memory read
|
||||
len:2=0x0000 # First read=0 - for next reads use the returned next start
|
||||
}
|
||||
|
||||
trace_disable={
|
||||
CmdCode=0x008b # do NOT change this line
|
||||
|
||||
Dst:1=0x00 # dbgs_cfg_t - don't drain debug
|
||||
Air_Chan:1=0x00
|
||||
RSVD:1=0
|
||||
Num_Entries:1=0x01 # one entry
|
||||
|
||||
# dbgs_t
|
||||
En_Mask:2=0x0000 # en_mask_id
|
||||
BaseId:2=0x0000 # base_id
|
||||
}
|
|
@ -1,124 +0,0 @@
|
|||
# File : smc.conf
|
||||
|
||||
smc_get={
|
||||
CmdCode=0x012d #do not change this
|
||||
|
||||
Action:2=0 # GET
|
||||
}
|
||||
|
||||
smc_set={
|
||||
CmdCode=0x012d #do not change this
|
||||
|
||||
Action:2=1 # SET
|
||||
|
||||
# SSID
|
||||
SSIDHeaderType:2=0x0000
|
||||
SSIDHeaderLen:2={
|
||||
SSID:10="NXP_SMC_1"
|
||||
}
|
||||
|
||||
# Beacon Period.
|
||||
# This should be smaller than than MinScanTime.
|
||||
BeaconHeaderType:2=0x012c
|
||||
BeaconHeaderLen:2={
|
||||
beaconPeriod:2=30
|
||||
}
|
||||
|
||||
# Channel list.
|
||||
# ChanNumber, MinScanTime and ScanTime are mandatory.
|
||||
# MinScanTime is minimum dwelling time for ChanNumber channel.
|
||||
# ScanTime is maximum dwelling time for ChanNumber channel.
|
||||
ChannHeaderType:2=0x0101
|
||||
ChannHeaderLen:2={
|
||||
|
||||
# Following four line define one channel.
|
||||
# Please add similar four lines with different channel number for new channel.
|
||||
Chan1_RadioType:1=0
|
||||
Chan1_ChanNumber:1=1
|
||||
Chan1_ScanType:1=2
|
||||
Chan1_MinScanTime:2=40
|
||||
Chan1_ScanTime:2=200
|
||||
|
||||
Chan2_RadioType:1=0
|
||||
Chan2_ChanNumber:1=6
|
||||
Chan2_ScanType:1=3
|
||||
Chan2_MinScanTime:2=40
|
||||
Chan2_ScanTime:2=200
|
||||
|
||||
Chan3_RadioType:1=0
|
||||
Chan3_ChanNumber:1=9
|
||||
Chan3_ScanType:1=2
|
||||
Chan3_MinScanTime:2=40
|
||||
Chan3_ScanTime:2=100
|
||||
|
||||
Chan2_RadioType:1=0
|
||||
Chan2_ChanNumber:1=11
|
||||
Chan2_ScanType:1=3
|
||||
Chan2_MinScanTime:2=40
|
||||
Chan2_ScanTime:2=200
|
||||
}
|
||||
|
||||
#Custom IE
|
||||
#Currently max size of custom IE supported is 50 bytes.
|
||||
#
|
||||
# CustomHeaderType:2=0x010a
|
||||
# CustomHeaderLen:2={
|
||||
# start:1=0xdd
|
||||
# start:1=0x10
|
||||
# start:1=0x00
|
||||
# start:1=0x01
|
||||
# start:1=0x02
|
||||
# start:1=0x03
|
||||
# start:1=0x04
|
||||
# start:1=0x05
|
||||
# start:1=0x06
|
||||
# start:1=0x07
|
||||
# start:1=0x08
|
||||
# start:1=0x09
|
||||
# start:1=0x0a
|
||||
# start:1=0x0b
|
||||
# start:1=0x0c
|
||||
# start:1=0x0d
|
||||
# start:1=0x0e
|
||||
# start:1=0x0f
|
||||
# }
|
||||
|
||||
#Multicast mac filtering address
|
||||
#All the multicast packets from starting mac address to ending mac address would
|
||||
#be captured and sent to the host.
|
||||
MACHeaderType:2=0x01cc
|
||||
MACHeaderLen:2={
|
||||
#Staring Multicast mac address
|
||||
start:1=0x01
|
||||
start:1=0x00
|
||||
start:1=0x5e
|
||||
start:1=0x00
|
||||
start:1=0x00
|
||||
start:1=0x01
|
||||
|
||||
#Ending Multicast mac address
|
||||
end:1=0x01
|
||||
end:1=0x00
|
||||
end:1=0x5e
|
||||
end:1=0x7f
|
||||
end:1=0xff
|
||||
end:1=0xff
|
||||
|
||||
#FilterType
|
||||
# 1 for RX AP frames
|
||||
# 2 for RX STA frames
|
||||
# 3 for both
|
||||
Filter:2=0x3
|
||||
}
|
||||
|
||||
}
|
||||
smc_start={
|
||||
CmdCode=0x012d #do not change this
|
||||
|
||||
Action:2=2 # START
|
||||
}
|
||||
smc_stop={
|
||||
CmdCode=0x012d #do not change this
|
||||
|
||||
Action:2=3 # STOP
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
# File ssu.conf
|
||||
ssu_params_cfg={
|
||||
nskip=3 #0-3; # of FFT samples to skip
|
||||
nsel=2 #0-3: # of FFT samples selected to dump
|
||||
adcdownsample=1 #0-3: Down sample ADC input for buffering
|
||||
mask_adc_pkt=1 #0-1: Mask out ADC Data from spectral packet
|
||||
out_16bits=1 #0-1: Enable 16-Bit FFT output data precision in spectral packet
|
||||
spec_pwr_enable=1 #0-1: Enable power spectrum in dB for spectral packet
|
||||
rate_reduction=1 #0-1: Enable spectral packet rae reduction in DB output format
|
||||
n_pkt_avg=6 #0-7: Number of spectral packets over which spectral data is to be averaged.
|
||||
}
|
||||
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
# File : subevent.conf
|
||||
|
||||
######################### Subscribe Events command ##################
|
||||
subevent_get={
|
||||
CmdCode=0x0075 # do NOT change this line
|
||||
|
||||
Action:2=0 # GET
|
||||
Events:2=0
|
||||
}
|
||||
|
||||
subevent_set={
|
||||
CmdCode=0x0075 # do NOT change this line
|
||||
|
||||
Action:2=1 # SET
|
||||
Events:2=0xbc8 # bit0 - Beacon RSSI_LOW
|
||||
# bit1 - Beacon SNR_LOW
|
||||
# bit2 - FAILED_COUNT
|
||||
# bit3 - Beacon Missed
|
||||
# bit4 - Beacon RSSI_HIGH
|
||||
# bit5 - Beacon SNR_HIGH
|
||||
# bit6 - Data RSSI_LOW
|
||||
# bit7 - Data SNR_LOW
|
||||
# bit8 - Data RSSI_HIGH
|
||||
# bit9 - Data SNR_HIGH
|
||||
# bit10 - LINK_QUALITY
|
||||
# bit11 - PRE_BCN_LOST
|
||||
# bit12-15 - Reserved
|
||||
|
||||
LowRssiTlvType:2=0x0104
|
||||
LowRssiTlvLength:2={
|
||||
Threshold:1=70
|
||||
ReportingFreq:1=0
|
||||
}
|
||||
|
||||
LowSnrTlvType:2=0x0105
|
||||
LowSnrTlvLength:2={
|
||||
Threshold:1=56
|
||||
ReportingFreq:1=0
|
||||
}
|
||||
|
||||
FailedCountTlvType:2=0x0106
|
||||
FailedCountTlvLength:2={
|
||||
Threshold:1=5
|
||||
ReportingFreq:1=0
|
||||
}
|
||||
|
||||
BeaconMissTlvType:2=0x0107
|
||||
BeaconMissTlvLength:2={
|
||||
BeaconMissed:1=60
|
||||
Reserved:1=0
|
||||
}
|
||||
|
||||
HighRssiTlvType:2=0x0116
|
||||
HighRssiTlvLength:2={
|
||||
Threshold:1=40
|
||||
ReportingFreq:1=0
|
||||
}
|
||||
|
||||
HighSnrTlvType:2=0x0117
|
||||
HighSnrTlvLength:2={
|
||||
Threshold:1=86
|
||||
ReportingFreq:1=0
|
||||
}
|
||||
|
||||
DataLowRssiTlvType:2=0x0126
|
||||
DataLowRssiTlvLength:2={
|
||||
Threshold:1=10
|
||||
ReportingFreq:1=0
|
||||
}
|
||||
|
||||
DataLowSnrTlvType:2=0x0127
|
||||
DataLowSnrTlvLength:2={
|
||||
Threshold:1=66
|
||||
ReportingFreq:1=0
|
||||
}
|
||||
|
||||
DataHighRssiTlvType:2=0x0128
|
||||
DataHighRssiTlvLength:2={
|
||||
Threshold:1=50
|
||||
ReportingFreq:1=0
|
||||
}
|
||||
|
||||
DataHighSnrTlvType:2=0x0129
|
||||
DataHighSnrTlvLength:2={
|
||||
Threshold:1=96
|
||||
ReportingFreq:1=1
|
||||
}
|
||||
LinkQualityTlvType:2=0x0124
|
||||
LinkQualityTlvType:2={
|
||||
LinkSNRThreshold:2=0x0056
|
||||
LinkSNRFrequency:2=0x0003
|
||||
MinRateVal:2=0x0014
|
||||
MinRateFreq:2=0x0003
|
||||
TxLatencyVal:4=0x00C8
|
||||
TxLatencyThreshold:4=0x0003
|
||||
}
|
||||
PreBcnLostTlvType:2=0x0149
|
||||
PreBcnLostTlvLength:2={
|
||||
PreBeaconCnt:1=30
|
||||
Reserved:1=0
|
||||
}
|
||||
}
|
||||
######################### Subscribe Events command ##################
|
|
@ -1,100 +0,0 @@
|
|||
# TSPEC contents for TID=0, UserPriority = 6
|
||||
[tspec0]
|
||||
# Element ID
|
||||
dd
|
||||
# Length
|
||||
3d
|
||||
# OUI
|
||||
00 50 f2
|
||||
# OUI Type
|
||||
02
|
||||
# OUI SubType
|
||||
02
|
||||
# Version
|
||||
01
|
||||
# TSInfo
|
||||
e0 34 00
|
||||
# Nominal MSDU Size
|
||||
d0 80
|
||||
# Maximum MSDU Size
|
||||
d0 00
|
||||
# Min Service Interval
|
||||
20 4e 00 00
|
||||
# Max Service Interval
|
||||
20 4e 00 00
|
||||
# Inactivity Interval
|
||||
80 96 98 00
|
||||
# Suspension Interval
|
||||
ff ff ff ff
|
||||
# Service Start Time
|
||||
00 00 00 00
|
||||
# Minimum Data Rate
|
||||
00 45 01 00
|
||||
# Mean Data Rate
|
||||
00 45 01 00
|
||||
# Peak Data Rate
|
||||
00 45 01 00
|
||||
# Max Burst Size
|
||||
00 00 00 00
|
||||
# Delay Bound
|
||||
00 00 00 00
|
||||
# Min PHY Rate
|
||||
00 1b b7 00
|
||||
# Surplus Bandwidth Allowance
|
||||
00 30
|
||||
# Medium Time
|
||||
00 00
|
||||
# Extra Data Bytes
|
||||
[/tspec0]
|
||||
|
||||
|
||||
# TSPEC contents for TID=1, UserPriority = 4
|
||||
[tspec1]
|
||||
# Element ID
|
||||
dd
|
||||
# Length
|
||||
3d
|
||||
# OUI
|
||||
00 50 f2
|
||||
# OUI Type
|
||||
02
|
||||
# OUI SubType
|
||||
02
|
||||
# Version
|
||||
01
|
||||
# TSInfo
|
||||
e3 20 00
|
||||
# Nominal MSDU Size
|
||||
96 00
|
||||
# Maximum MSDU Size
|
||||
dc 05
|
||||
# Min Service Interval
|
||||
00 00 00 00
|
||||
# Max Service Interval
|
||||
00 00 00 00
|
||||
# Inactivity Interval
|
||||
00 00 00 00
|
||||
# Suspension Interval
|
||||
ff ff ff ff
|
||||
# Service Start Time
|
||||
00 00 00 00
|
||||
# Minimum Data Rate
|
||||
a0 00 00 00
|
||||
# Mean Data Rate
|
||||
a0 00 00 00
|
||||
# Peak Data Rate
|
||||
a0 00 00 00
|
||||
# Max Burst Size
|
||||
00 00 00 00
|
||||
# Delay Bound
|
||||
00 00 00 00
|
||||
# Min PHY Rate
|
||||
80 8d 5b 00
|
||||
# Surplus Bandwidth Allowance
|
||||
00 30
|
||||
# Medium Time
|
||||
00 00
|
||||
# Extra Data Bytes
|
||||
dd 04 00 50 43 ff
|
||||
[/tspec1]
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
#File : turbo_mode.conf
|
||||
## WMM turbo mode config command
|
||||
turbo_mode_set={
|
||||
CmdCode=0x0016 # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
OID:2=0x27 # OID_WMM_TURBO_MODE
|
||||
Size:2=1
|
||||
Value:1=3 # 1 -- Enable turbo_mode_1;
|
||||
# 2 -- Enable turbo_mode_2;
|
||||
# 3 -- Enable turbo_mode_3;
|
||||
# otherwise, disable turbo_mode
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
#protocol
|
||||
Protocol=0x88dc
|
||||
|
||||
# configure data rate in unit of 0.5Mbps
|
||||
# 0 - auto rate determined by firmware
|
||||
# Any other data rate except these data rates will
|
||||
# be overwritten by default data rate.
|
||||
# datarate index, unit in 0.5Mbps
|
||||
# Index | 20MHz | 10MHz
|
||||
# 12 | 6Mbps | 3Mbps
|
||||
# 18 | 9Mbps | 4.5Mbps
|
||||
# 24 | 12Mbps | 6Mbps
|
||||
# 36 | 18Mbps | 9Mbps
|
||||
# 48 | 24Mbps | 12Mbps
|
||||
# 72 | 36Mbps | 18Mbps
|
||||
# 96 | 48Mbps | 24Mbps
|
||||
# 108 | 54Mbps | 27.5Mbps
|
||||
Datarate=12
|
||||
|
||||
# configure Channel for the packet
|
||||
# 0 - the channel set during the enable would be used
|
||||
Channel=0
|
||||
|
||||
# configure Bandwith (only for 11p)
|
||||
# 0: auto bandwith setting by firmware
|
||||
# bit4: 1 use bit[3:0] bandwith setting
|
||||
# bit[3:0]:
|
||||
# 0 - 5MHz
|
||||
# 1 - 10MHz
|
||||
# 2 - 20MHz
|
||||
# 3 - 40MHz
|
||||
# 4 - 80MHz
|
||||
Bandwidth=0x00
|
||||
|
||||
# configure power settings
|
||||
# bit[7] host tx power control flag
|
||||
# 0x0: use fw setting for tx power
|
||||
# 0x1: value specified in bit[6] and bit[5:0] are valid
|
||||
# bit[6] sign of the power specified in bit[5:0]
|
||||
# 0x0: power specified in bit[5:0] is postive (+)
|
||||
# 0x1: power specified in bit[5:0] is negative (-)
|
||||
# bit[5:0] power to be used for transmission (in dBm)
|
||||
Power=0x00
|
||||
|
||||
# configure Priority of the packet
|
||||
# 1,2 - BK
|
||||
# 0,3 - BE
|
||||
# 4,5 - VI
|
||||
# 6,7 - VO
|
||||
Priority=0
|
||||
|
||||
# configure tx retry time
|
||||
Retry_limit=0
|
||||
|
||||
# Destination MAC Address
|
||||
Addr=00:50:43:22:0f:b0
|
||||
|
||||
Data=0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x8,0x9,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x8,0x9,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x8,0x9,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19
|
|
@ -93,525 +93,417 @@ txpwrlimit_5g_cfg_get_sub3={
|
|||
## 1: OFDM (6,9,12,18 Mbps)
|
||||
## 2: OFDM (24,36 Mbps)
|
||||
## 3: OFDM (48,54 Mbps)
|
||||
## 4: HT20 (MCS0,1,2)
|
||||
## 5: HT20 (MCS3,4)
|
||||
## 6: HT20 (MCS5,6,7)
|
||||
## 7: HT40 (MCS0,1,2)
|
||||
## 8: HT40 (MCS3,4)
|
||||
## 9: HT40 (MCS5,6,7)
|
||||
## 10: HT2_20 (MCS8,9,10)
|
||||
## 11: HT2_20 (MCS11,12)
|
||||
## 12: HT2_20 (MCS13,14,15)
|
||||
## 13: HT2_40 (MCS8,9,10)
|
||||
## 14: HT2_40 (MCS11,12)
|
||||
## 15: HT2_40 (MCS13,14,15)
|
||||
## 16: VHT_QAM256 (MCS8)
|
||||
## 17: VHT_40_QAM256 (MCS8,9)
|
||||
## 18: VHT_80_PSK (MCS0,1,2)
|
||||
## 19: VHT_80_QAM16 (MCS3,4)
|
||||
## 20: VHT_80_QAM64 (MCS5,6,7)
|
||||
## 21: VHT_80_QAM256 (MCS8,9)
|
||||
## 22: VHT2_20_QAM256 (MCS8,9)
|
||||
## 23: VHT2_40_QAM256 (MCS8,9)
|
||||
## 24: VHT2_80_PSK (MCS0, 1, 2)
|
||||
## 25: VHT2_80_QAM16 (MCS3,4)
|
||||
## 26: VHT2_80_QAM64 (MCS5,6,7)
|
||||
## 27: VHT2_80_QAM256 (MCS8,9)
|
||||
## 28: HE_20_QAM256 (MCS8,9)
|
||||
## 29: HE_20_QAM1024 (MCS10,11)
|
||||
## 30: HE_40_QAM1024 (MCS10,11)
|
||||
## 31: HE_80_QAM1024 (MCS10,11)
|
||||
## 32: HE2_20_QAM256 (MCS8,9)
|
||||
## 33: HE2_20_QAM1024 (MCS10,11)
|
||||
## 34: HE2_40_QAM1024 (MCS10,11)
|
||||
## 35: HE2_80_QAM1024 (MCS10,11)
|
||||
## 4: HT20 (0,1,2)
|
||||
## 5: HT20 (3,4)
|
||||
## 6: HT20 (5,6,7)
|
||||
## 7: HT40 (0,1,2)
|
||||
## 8: HT40 (3,4)
|
||||
## 9: HT40 (5,6,7)
|
||||
## 10: VHT_QAM256 (MCS8)
|
||||
## 11: VHT_40_QAM256 (MCS8,9)
|
||||
## 12: VHT_80_PSK (MCS0,1,2)
|
||||
## 13: VHT_80_QAM16 (MCS3,4)
|
||||
## 14: VHT_80_QAM64 (MCS5,6,7)
|
||||
## 15: VHT_80_QAM256 (MCS8,9)
|
||||
## Power Limit in dBm
|
||||
##
|
||||
## Note: For KF, add VHT 20/40/80 1SS/2SS mod group.
|
||||
## For 40MHz modulation groups, specify same Tx power value for a set of
|
||||
## two consecutive channel frequencies
|
||||
## Valid channel sets:
|
||||
## (36, 40), (44, 48), (52, 56), (60, 64)
|
||||
## (100, 104), (108, 112), (116, 120), (124, 128), (132, 136), (140, 144)
|
||||
## (149, 153), (157, 161)
|
||||
##
|
||||
## For 80MHz modulation groups, specify same Tx power value for a set of
|
||||
## four consecutive channel frequencies
|
||||
## Valid channel sets:
|
||||
## (36, 40, 44, 48), (52, 56, 60, 64)
|
||||
## (100, 104, 108, 112), (116, 120, 124, 128), (132, 136, 140, 144)
|
||||
## (149, 153, 157, 161)
|
||||
|
||||
## 2G subband0 Tx power limit CFG
|
||||
## 2G Tx power limit CFG
|
||||
txpwrlimit_2g_cfg_set={
|
||||
CmdCode=0x00fb # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SubBand:2=0 # do NOT use this member in set cmd
|
||||
RSVD:2=0 # do NOT change this line
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=1
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=2
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=3
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=4
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=5
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=6
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=7
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=8
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=9
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=10
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=11
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,18,1,18,2,16,3,14,4,18,5,16,6,14,7,18,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=12
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,16,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=13
|
||||
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
|
||||
TLVPwr:24='0,16,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,16,11,16'
|
||||
}
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=2407
|
||||
TLVStartFreq:2=2414
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=14
|
||||
TLVPwr:32='0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12,12,12,13,12,14,12,15,12'
|
||||
TLVPwr:24='0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
## 5G subband1 Tx power limit CFG
|
||||
txpwrlimit_5g_cfg_set_sub0={
|
||||
## 5G Tx power limit CFG
|
||||
txpwrlimit_5g_cfg_set={
|
||||
CmdCode=0x00fb # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SubBand:2=0 # do NOT use this member in set cmd
|
||||
RSVD:2=0 # do NOT change this line
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=36
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,20,5,20,6,18,7,20,8,20,9,18,10,20,11,20,12,18,13,20,14,20,15,18,16,17,17,17,18,20,19,19,20,17,21,16,22,17,23,17,24,20,25,19,26,17,27,16,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=40
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,20,5,20,6,18,7,20,8,20,9,18,10,20,11,20,12,18,13,20,14,20,15,18,16,17,17,17,18,20,19,19,20,17,21,16,22,17,23,17,24,20,25,19,26,17,27,16,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=44
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,20,5,20,6,18,7,20,8,20,9,18,10,20,11,20,12,18,13,20,14,20,15,18,16,18,17,17,18,20,19,19,20,17,21,16,22,18,23,17,24,20,25,19,26,17,27,16,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=48
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,20,5,20,6,18,7,20,8,20,9,18,10,20,11,20,12,18,13,20,14,20,15,18,16,18,17,17,18,20,19,19,20,17,21,16,22,18,23,17,24,20,25,19,26,17,27,16,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,16,2,16,3,14,4,16,5,16,6,14,7,16,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=52
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,20,5,20,6,18,7,20,8,20,9,19,10,20,11,20,12,18,13,20,14,20,15,19,16,18,17,17,18,19,19,19,20,18,21,17,22,18,23,17,24,19,25,19,26,18,27,17,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=56
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,20,5,20,6,18,7,20,8,20,9,19,10,20,11,20,12,18,13,20,14,20,15,19,16,18,17,17,18,19,19,19,20,18,21,17,22,18,23,17,24,19,25,19,26,18,27,17,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=60
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,20,5,20,6,18,7,20,8,20,9,19,10,20,11,20,12,18,13,20,14,20,15,19,16,18,17,17,18,19,19,19,20,18,21,17,22,18,23,17,24,19,25,19,26,18,27,17,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=64
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,20,5,20,6,18,7,20,8,20,9,19,10,20,11,20,12,18,13,20,14,20,15,19,16,18,17,17,18,19,19,19,20,18,21,17,22,18,23,17,24,19,25,19,26,18,27,17,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
}
|
||||
|
||||
## 5G subband2 Tx power limit CFG
|
||||
txpwrlimit_5g_cfg_set_sub1={
|
||||
CmdCode=0x00fb # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SubBand:2=0 # do NOT use this member in set cmd
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=100
|
||||
TLVPwr:72='0,0,1,20,2,20,3,20,4,18,5,18,6,19,7,18,8,18,9,18,10,18,11,18,12,19,13,18,14,18,15,18,16,18,17,16,18,18,19,19,20,18,21,16,22,18,23,16,24,18,25,19,26,18,27,16,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=104
|
||||
TLVPwr:72='0,0,1,20,2,20,3,20,4,18,5,18,6,18,7,18,8,18,9,18,10,18,11,18,12,18,13,18,14,18,15,18,16,18,17,16,18,18,19,19,20,18,21,16,22,18,23,16,24,18,25,19,26,18,27,16,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=108
|
||||
TLVPwr:72='0,0,1,20,2,20,3,20,4,18,5,18,6,19,7,18,8,18,9,17,10,18,11,18,12,19,13,18,14,18,15,17,16,18,17,16,18,18,19,19,20,18,21,16,22,18,23,16,24,18,25,19,26,18,27,16,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=112
|
||||
TLVPwr:72='0,0,1,20,2,20,3,20,4,18,5,18,6,19,7,18,8,18,9,17,10,18,11,18,12,19,13,18,14,18,15,17,16,17,17,16,18,18,19,19,20,18,21,16,22,17,23,16,24,18,25,19,26,18,27,16,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=116
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,18,6,18,7,18,8,18,9,17,10,18,11,18,12,18,13,18,14,18,15,17,16,16,17,15,18,18,19,18,20,17,21,15,22,16,23,15,24,18,25,18,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=120
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,18,6,18,7,18,8,18,9,17,10,18,11,18,12,18,13,18,14,18,15,17,16,17,17,15,18,18,19,18,20,17,21,15,22,17,23,15,24,18,25,18,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=124
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,18,6,18,7,18,8,18,9,18,10,18,11,18,12,18,13,18,14,18,15,18,16,17,17,15,18,18,19,18,20,17,21,15,22,17,23,15,24,18,25,18,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=128
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,18,6,18,7,18,8,18,9,18,10,18,11,18,12,18,13,18,14,18,15,18,16,17,17,15,18,18,19,18,20,17,21,15,22,17,23,15,24,18,25,18,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=132
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,18,6,18,7,18,8,17,9,18,10,18,11,18,12,18,13,18,14,17,15,18,16,16,17,15,18,18,19,18,20,18,21,15,22,16,23,15,24,18,25,18,26,18,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=136
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,18,6,18,7,18,8,17,9,18,10,18,11,18,12,18,13,18,14,17,15,18,16,17,17,15,18,18,19,18,20,18,21,15,22,17,23,15,24,18,25,18,26,18,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=140
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,18,6,18,7,18,8,17,9,17,10,18,11,18,12,18,13,18,14,17,15,17,16,18,17,16,18,18,19,18,20,18,21,15,22,18,23,16,24,18,25,18,26,18,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=144
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,18,6,18,7,18,8,17,9,17,10,18,11,18,12,18,13,18,14,17,15,17,16,18,17,16,18,18,19,18,20,18,21,15,22,18,23,16,24,18,25,18,26,18,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
## 5G subband3 Tx power limit CFG
|
||||
txpwrlimit_5g_cfg_set_sub2={
|
||||
CmdCode=0x00fb # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SubBand:2=0 # do NOT use this member in set cmd
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=149
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,18,7,18,8,18,9,18,10,18,11,19,12,18,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=153
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=157
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=161
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=165
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
## 5G subband4 Tx power limit CFG
|
||||
txpwrlimit_5g_cfg_set_sub3={
|
||||
CmdCode=0x00fb # do NOT change this line
|
||||
Action:2=1 # 1 - SET
|
||||
SubBand:2=0 # do NOT use this in set cmd
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=4000
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=183
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=4000
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=184
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=4000
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=185
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=4000
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=187
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=4000
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=188
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=4000
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=189
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=4000
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=192
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=4000
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=196
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=7
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=8
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=11
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=12
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=16
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
|
||||
|
||||
ChanTRPC.TlvType:2=0x0189
|
||||
ChanTRPC.TlvLength:2={
|
||||
TLVStartFreq:2=5000
|
||||
TLVChanWidth:1=20
|
||||
TLVChanNum:1=34
|
||||
TLVPwr:72='0,0,1,20,2,20,3,19,4,18,5,19,6,19,7,18,8,18,9,18,10,18,11,19,12,19,13,18,14,18,15,18,16,17,17,17,18,18,19,19,20,17,21,15,22,17,23,17,24,18,25,19,26,17,27,15,28,5,29,5,30,5,31,5,32,5,33,5,34,5,35,5'
|
||||
TLVPwr:32='0,0,1,17,2,16,3,14,4,17,5,16,6,14,7,17,8,16,9,14,10,15,11,14,12,15,13,15,14,14,15,13'
|
||||
}
|
||||
}
|
||||
|
|
@ -1,172 +0,0 @@
|
|||
# File : txrate_cfg.conf
|
||||
|
||||
## Tx Rate Configuration command
|
||||
txrate_cfg_get={
|
||||
CmdCode=0x00d6 # do NOT change this line
|
||||
Action:2=0 # 0 - GET
|
||||
Index:2=0 # do NOT change this line
|
||||
|
||||
TxRateScope.TlvType:2=0x0153
|
||||
TxRateScope.TlvLength:2={
|
||||
}
|
||||
}
|
||||
|
||||
txrate_cfg_set_bg={
|
||||
CmdCode=0x00d6 # do NOT change this line
|
||||
|
||||
Action:2=1 # 1 - SET
|
||||
Index:2=0 # do NOT change this line
|
||||
|
||||
TxRateScope.TlvType:2=0x0153
|
||||
TxRateScope.TlvLength:2={
|
||||
################# TXRATE SCOPE ######################
|
||||
|
||||
# The following table shows the bitmap of the rates:
|
||||
# (bit 0 is the least significant bit)
|
||||
# Bit Data rate
|
||||
# 0 1 Mbps
|
||||
# 1 2 Mbps
|
||||
# 2 5.5 Mbps
|
||||
# 3 11 Mbps
|
||||
# 4 Reserved
|
||||
HRDSSS.RateScope:2=0x0000
|
||||
|
||||
# The following table shows the bitmap of the rates:
|
||||
# (bit 0 is the least significant bit)
|
||||
# Bit Data rate
|
||||
# 0 6 Mbps
|
||||
# 1 9 Mbps
|
||||
# 2 12 Mbps
|
||||
# 3 18 Mbps
|
||||
# 4 24 Mbps
|
||||
# 5 36 Mbps
|
||||
# 6 48 Mbps
|
||||
# 7 54 Mbps
|
||||
OFDM.RateScope:2=0x0080
|
||||
|
||||
# The following table shows the bitmap of the rates:
|
||||
# (bit 0 is the least significant bit)
|
||||
# Bit Data rate
|
||||
# 0 MCS0
|
||||
# 1 MCS1
|
||||
# 2 MCS2
|
||||
# 3 MCS3
|
||||
# 4 MCS4
|
||||
# 5 MCS5
|
||||
# 6 MCS6
|
||||
# 7 MCS7
|
||||
# 32 MCS32
|
||||
HT.RateScopeDword0:4=0x00000000
|
||||
HT.RateScopeDword1:4=0x00000000
|
||||
HT.RateScopeDword2:4=0x00000000
|
||||
HT.RateScopeDword3:4=0x00000000
|
||||
}
|
||||
|
||||
TxRateDrop.TlvType:2=0x0151
|
||||
TxRateDrop.TlvLength:2={
|
||||
RateDrop.Mode:4=0x00000001
|
||||
}
|
||||
}
|
||||
|
||||
txrate_cfg_set_bgn={
|
||||
CmdCode=0x00d6 # do NOT change this line
|
||||
|
||||
Action:2=1 # 1 - SET
|
||||
Index:2=0 # do NOT change this line
|
||||
|
||||
TxRateScope.TlvType:2=0x0153
|
||||
TxRateScope.TlvLength:2={
|
||||
################# TXRATE SCOPE ######################
|
||||
|
||||
# The following table shows the bitmap of the rates:
|
||||
# (bit 0 is the least significant bit)
|
||||
# Bit Data rate
|
||||
# 0 1 Mbps
|
||||
# 1 2 Mbps
|
||||
# 2 5.5 Mbps
|
||||
# 3 11 Mbps
|
||||
# 4 Reserved
|
||||
HRDSSS.RateScope:2=0x0000
|
||||
|
||||
# The following table shows the bitmap of the rates:
|
||||
# (bit 0 is the least significant bit)
|
||||
# Bit Data rate
|
||||
# 0 6 Mbps
|
||||
# 1 9 Mbps
|
||||
# 2 12 Mbps
|
||||
# 3 18 Mbps
|
||||
# 4 24 Mbps
|
||||
# 5 36 Mbps
|
||||
# 6 48 Mbps
|
||||
# 7 54 Mbps
|
||||
OFDM.RateScope:2=0x0000
|
||||
|
||||
# The following table shows the bitmap of the rates:
|
||||
# (bit 0 is the least significant bit)
|
||||
# Bit Data rate
|
||||
# 0 MCS0
|
||||
# 1 MCS1
|
||||
# 2 MCS2
|
||||
# 3 MCS3
|
||||
# 4 MCS4
|
||||
# 5 MCS5
|
||||
# 6 MCS6
|
||||
# 7 MCS7
|
||||
# 32 MCS32
|
||||
HT.RateScopeDword0:4=0x00000080
|
||||
HT.RateScopeDword1:4=0x00000000
|
||||
HT.RateScopeDword2:4=0x00000000
|
||||
HT.RateScopeDword3:4=0x00000000
|
||||
}
|
||||
|
||||
TxRateDrop.TlvType:2=0x0151
|
||||
TxRateDrop.TlvLength:2={
|
||||
RateDrop.Mode:4=0x00000001
|
||||
}
|
||||
}
|
||||
|
||||
########supported BasicRate setting###########
|
||||
basic_rate_get={
|
||||
CmdCode=0x00d6 # do NOT change this line
|
||||
Action:2=0 # 0 - GET
|
||||
Index:2=0 # do NOT change this line
|
||||
|
||||
TlvType:2=0x21a
|
||||
TlvLength:2={
|
||||
}
|
||||
}
|
||||
|
||||
basic_rate_set={
|
||||
CmdCode=0x00d6 # do NOT change this line
|
||||
|
||||
Action:2=1 # 1 - SET
|
||||
Index:2=0 # do NOT change this line
|
||||
|
||||
TlvType:2=0x21a
|
||||
TlvLength:2={
|
||||
BasicRateSupport:2=0x000f #defalt value
|
||||
|
||||
# The following table shows the bitmap of the rates:
|
||||
# (bit 0 is the least significant bit)
|
||||
# Bit BasicRateSupport
|
||||
# 0 DBPSK1Mbps
|
||||
# 1 DQPSK2Mbps
|
||||
# 2 CCK5_5Mbps
|
||||
# 3 CCK11Mbps
|
||||
# 4 Not used.
|
||||
# 5 OFDM6Mbps
|
||||
# 6 OFDM9Mbps
|
||||
# 7 OFDM12Mbps
|
||||
# 8 OFDM18Mbps
|
||||
# 9 OFDM24Mbps
|
||||
# 10 OFDM36Mbps
|
||||
# 11 OFDM48Mbps
|
||||
# 12 OFDM54Mbps
|
||||
# 13-15 Reserved
|
||||
#note: value0x0 represents no setting value
|
||||
#For example:
|
||||
#BasicRateSupport:2=0x3 set supported BasicRate to DBPSK1Mbps, DQPSK2Mbps
|
||||
#BasicRateSupport:2=0x180 set supported BasicRate to OFDM18Mbps, OFDM12Mbps
|
||||
}
|
||||
}
|
||||
|
|
@ -115,7 +115,6 @@ PCIE9098_1 = {
|
|||
# req_fw_nowait=1
|
||||
# fw_reload=3
|
||||
# fw_serial=1
|
||||
# fw_region=0
|
||||
# mac_addr=00:50:43:22:1e:3d
|
||||
# mfg_mode=0
|
||||
# drv_mode=0x5
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,249 +0,0 @@
|
|||
/** @file mlanconfig.h
|
||||
*
|
||||
* @brief This file contains definitions for application
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
11/26/2008: initial version
|
||||
************************************************************************/
|
||||
#ifndef _MLANCONFIG_H_
|
||||
#define _MLANCONFIG_H_
|
||||
|
||||
/** Include header files */
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <errno.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/wireless.h>
|
||||
#include <sys/types.h>
|
||||
#include <linux/if_ether.h>
|
||||
#include <time.h>
|
||||
|
||||
#if (BYTE_ORDER == LITTLE_ENDIAN)
|
||||
#undef BIG_ENDIAN_SUPPORT
|
||||
#endif
|
||||
|
||||
/** Type definition: boolean */
|
||||
typedef enum { FALSE, TRUE } boolean;
|
||||
|
||||
/**
|
||||
* This macro specifies the attribute pack used for structure packing
|
||||
*/
|
||||
#ifndef __ATTRIB_PACK__
|
||||
#define __ATTRIB_PACK__ __attribute__((packed))
|
||||
#endif
|
||||
|
||||
/** 16 bits byte swap */
|
||||
#define swap_byte_16(x) \
|
||||
((t_u16)((((t_u16)(x) & 0x00ffU) << 8) | \
|
||||
(((t_u16)(x) & 0xff00U) >> 8)))
|
||||
|
||||
/** 32 bits byte swap */
|
||||
#define swap_byte_32(x) \
|
||||
((t_u32)((((t_u32)(x) & 0x000000ffUL) << 24) | \
|
||||
(((t_u32)(x) & 0x0000ff00UL) << 8) | \
|
||||
(((t_u32)(x) & 0x00ff0000UL) >> 8) | \
|
||||
(((t_u32)(x) & 0xff000000UL) >> 24)))
|
||||
|
||||
/** Convert to correct endian format */
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** CPU to little-endian convert for 16-bit */
|
||||
#define cpu_to_le16(x) swap_byte_16(x)
|
||||
/** CPU to little-endian convert for 32-bit */
|
||||
#define cpu_to_le32(x) swap_byte_32(x)
|
||||
/** Little-endian to CPU convert for 16-bit */
|
||||
#define le16_to_cpu(x) swap_byte_16(x)
|
||||
/** Little-endian to CPU convert for 32-bit */
|
||||
#define le32_to_cpu(x) swap_byte_32(x)
|
||||
#else
|
||||
/** Do nothing */
|
||||
#define cpu_to_le16(x) (x)
|
||||
/** Do nothing */
|
||||
#define cpu_to_le32(x) (x)
|
||||
/** Do nothing */
|
||||
#define le16_to_cpu(x) (x)
|
||||
/** Do nothing */
|
||||
#define le32_to_cpu(x) (x)
|
||||
#endif
|
||||
|
||||
/** Character, 1 byte */
|
||||
typedef char t_s8;
|
||||
/** Unsigned character, 1 byte */
|
||||
typedef unsigned char t_u8;
|
||||
|
||||
/** Short integer */
|
||||
typedef signed short t_s16;
|
||||
/** Unsigned short integer */
|
||||
typedef unsigned short t_u16;
|
||||
|
||||
/** Integer */
|
||||
typedef signed int t_s32;
|
||||
/** Unsigned integer */
|
||||
typedef unsigned int t_u32;
|
||||
|
||||
/** Long long integer */
|
||||
typedef signed long long t_s64;
|
||||
/** Unsigned long long integer */
|
||||
typedef unsigned long long t_u64;
|
||||
|
||||
/** Void pointer (4-bytes) */
|
||||
typedef void t_void;
|
||||
|
||||
/** Success */
|
||||
#define MLAN_STATUS_SUCCESS (0)
|
||||
/** Failure */
|
||||
#define MLAN_STATUS_FAILURE (-1)
|
||||
|
||||
t_s8 *mlan_config_get_line(FILE * fp, t_s8 *s, t_s32 size, int *line);
|
||||
int get_priv_ioctl(char *ioctl_name, int *ioctl_val, int *subioctl_val);
|
||||
int fparse_for_hex(FILE * fp, t_u8 *dst);
|
||||
|
||||
/**
|
||||
* Hex or Decimal to Integer
|
||||
* @param num string to convert into decimal or hex
|
||||
*/
|
||||
#define A2HEXDECIMAL(num) \
|
||||
(strncasecmp("0x", (num), 2)?(unsigned int) strtoll((num),NULL,0):a2hex((num)))
|
||||
|
||||
/** Convert character to integer */
|
||||
#define CHAR2INT(x) (((x) >= 'A') ? ((x) - 'A' + 10) : ((x) - '0'))
|
||||
|
||||
/** Convert TLV header from little endian format to CPU format */
|
||||
#define endian_convert_tlv_header_in(x) \
|
||||
{ \
|
||||
(x)->tag = le16_to_cpu((x)->tag); \
|
||||
(x)->length = le16_to_cpu((x)->length); \
|
||||
}
|
||||
|
||||
/** Convert TLV header to little endian format from CPU format */
|
||||
#define endian_convert_tlv_header_out(x) \
|
||||
{ \
|
||||
(x)->tag = cpu_to_le16((x)->tag); \
|
||||
(x)->length = cpu_to_le16((x)->length); \
|
||||
}
|
||||
/** Private command ID to pass custom IE list */
|
||||
#define CUSTOM_IE_CFG (SIOCDEVPRIVATE + 13)
|
||||
/* TLV Definitions */
|
||||
/** TLV header */
|
||||
#define TLVHEADER /** Tag */ \
|
||||
t_u16 tag; \
|
||||
/** Length */ \
|
||||
t_u16 length
|
||||
|
||||
/** Maximum IE buffer length */
|
||||
#define MAX_IE_BUFFER_LEN 256
|
||||
|
||||
/** TLV: Management IE list */
|
||||
#define MRVL_MGMT_IE_LIST_TLV_ID (PROPRIETARY_TLV_BASE_ID + 0x69) //0x0169
|
||||
|
||||
/** TLV: Max Management IE */
|
||||
#define MRVL_MAX_MGMT_IE_TLV_ID (PROPRIETARY_TLV_BASE_ID + 0xaa) //0x01aa
|
||||
|
||||
/** custom IE info */
|
||||
typedef struct _custom_ie_info {
|
||||
/** size of buffer */
|
||||
t_u16 buf_size;
|
||||
/** no of buffers of buf_size */
|
||||
t_u16 buf_count;
|
||||
} __ATTRIB_PACK__ custom_ie_info;
|
||||
|
||||
/** TLV buffer : custom IE */
|
||||
typedef struct _tlvbuf_max_mgmt_ie {
|
||||
/** Header */
|
||||
TLVHEADER;
|
||||
/** No of tuples */
|
||||
t_u16 count;
|
||||
/** custom IE info tuples */
|
||||
custom_ie_info info[];
|
||||
} __ATTRIB_PACK__ tlvbuf_max_mgmt_ie;
|
||||
|
||||
/** custom IE */
|
||||
typedef struct _custom_ie {
|
||||
/** IE Index */
|
||||
t_u16 ie_index;
|
||||
/** Mgmt Subtype Mask */
|
||||
t_u16 mgmt_subtype_mask;
|
||||
/** IE Length */
|
||||
t_u16 ie_length;
|
||||
/** IE buffer */
|
||||
t_u8 ie_buffer[];
|
||||
} __ATTRIB_PACK__ custom_ie;
|
||||
|
||||
/** TLV buffer : custom IE */
|
||||
typedef struct _tlvbuf_custom_ie {
|
||||
/** Header */
|
||||
TLVHEADER;
|
||||
/** custom IE data */
|
||||
custom_ie ie_data[];
|
||||
} __ATTRIB_PACK__ tlvbuf_custom_ie;
|
||||
|
||||
/** Maximum length of lines in configuration file */
|
||||
#define MAX_CONFIG_LINE 1024
|
||||
/** Ethernet address length */
|
||||
#define ETH_ALEN 6
|
||||
/** MAC BROADCAST */
|
||||
#define MAC_BROADCAST 0x1FF
|
||||
/** MAC MULTICAST */
|
||||
#define MAC_MULTICAST 0x1FE
|
||||
|
||||
/** pkt_header */
|
||||
typedef struct _pkt_header {
|
||||
/** pkt_len */
|
||||
t_u32 pkt_len;
|
||||
/** pkt_type */
|
||||
t_u32 TxPktType;
|
||||
/** tx control */
|
||||
t_u32 TxControl;
|
||||
} pkt_header;
|
||||
|
||||
/** wlan_802_11_header packet from FW with length */
|
||||
typedef struct _wlan_mgmt_frame_tx {
|
||||
/** Packet Length */
|
||||
t_u16 frm_len;
|
||||
/** Frame Control */
|
||||
t_u16 frm_ctl;
|
||||
/** Duration ID */
|
||||
t_u16 duration_id;
|
||||
/** Address1 */
|
||||
t_u8 addr1[ETH_ALEN];
|
||||
/** Address2 */
|
||||
t_u8 addr2[ETH_ALEN];
|
||||
/** Address3 */
|
||||
t_u8 addr3[ETH_ALEN];
|
||||
/** Sequence Control */
|
||||
t_u16 seq_ctl;
|
||||
/** Address4 */
|
||||
t_u8 addr4[ETH_ALEN];
|
||||
/** Frame payload */
|
||||
t_u8 payload[];
|
||||
} __ATTRIB_PACK__ wlan_mgmt_frame_tx;
|
||||
|
||||
/** frame tx ioctl number */
|
||||
#define FRAME_TX_IOCTL (SIOCDEVPRIVATE + 12)
|
||||
|
||||
extern t_s32 sockfd; /**< socket */
|
||||
extern t_s8 dev_name[IFNAMSIZ + 1]; /**< device name */
|
||||
|
||||
#endif /* _MLANCONFIG_H_ */
|
|
@ -1,923 +0,0 @@
|
|||
/** @file mlanhostcmd.c
|
||||
*
|
||||
* @brief This file contains mlanconfig helper functions
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
11/26/2008: initial version
|
||||
************************************************************************/
|
||||
|
||||
#include "mlanconfig.h"
|
||||
#include "mlanhostcmd.h"
|
||||
|
||||
#ifndef MIN
|
||||
/** Find minimum value */
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif /* MIN */
|
||||
|
||||
/********************************************************
|
||||
Local Variables
|
||||
********************************************************/
|
||||
|
||||
/********************************************************
|
||||
Global Variables
|
||||
********************************************************/
|
||||
|
||||
/********************************************************
|
||||
Local Functions
|
||||
********************************************************/
|
||||
/**
|
||||
* @brief get hostcmd data
|
||||
*
|
||||
* @param ln A pointer to line number
|
||||
* @param buf A pointer to hostcmd data
|
||||
* @param size A pointer to the return size of hostcmd buffer
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
static int
|
||||
mlan_get_hostcmd_data(FILE * fp, int *ln, t_u8 *buf, t_u16 *size)
|
||||
{
|
||||
t_s32 errors = 0, i;
|
||||
t_s8 line[512], *pos, *pos1, *pos2, *pos3;
|
||||
t_u16 len;
|
||||
|
||||
while ((pos = mlan_config_get_line(fp, line, sizeof(line), ln))) {
|
||||
(*ln)++;
|
||||
if (strcmp(pos, "}") == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
pos1 = strchr(pos, ':');
|
||||
if (pos1 == NULL) {
|
||||
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
|
||||
pos);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
*pos1++ = '\0';
|
||||
|
||||
pos2 = strchr(pos1, '=');
|
||||
if (pos2 == NULL) {
|
||||
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
|
||||
pos);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
*pos2++ = '\0';
|
||||
|
||||
len = a2hex_or_atoi(pos1);
|
||||
if (len < 1 || len > MRVDRV_SIZE_OF_CMD_BUFFER) {
|
||||
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
|
||||
pos);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
|
||||
*size += len;
|
||||
|
||||
if (*pos2 == '"') {
|
||||
pos2++;
|
||||
if ((pos3 = strchr(pos2, '"')) == NULL) {
|
||||
printf("Line %d: invalid quotation '%s'\n", *ln,
|
||||
pos);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
*pos3 = '\0';
|
||||
memset(buf, 0, len);
|
||||
memmove(buf, pos2, MIN(strlen(pos2), len));
|
||||
buf += len;
|
||||
} else if (*pos2 == '\'') {
|
||||
pos2++;
|
||||
if ((pos3 = strchr(pos2, '\'')) == NULL) {
|
||||
printf("Line %d: invalid quotation '%s'\n", *ln,
|
||||
pos);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
*pos3 = ',';
|
||||
for (i = 0; i < len; i++) {
|
||||
if ((pos3 = strchr(pos2, ',')) != NULL) {
|
||||
*pos3 = '\0';
|
||||
*buf++ = (t_u8)a2hex_or_atoi(pos2);
|
||||
pos2 = pos3 + 1;
|
||||
} else
|
||||
*buf++ = 0;
|
||||
}
|
||||
} else if (*pos2 == '{') {
|
||||
t_u16 tlvlen = 0, tmp_tlvlen;
|
||||
mlan_get_hostcmd_data(fp, ln, buf + len, &tlvlen);
|
||||
tmp_tlvlen = tlvlen;
|
||||
while (len--) {
|
||||
*buf++ = (t_u8)(tmp_tlvlen & 0xff);
|
||||
tmp_tlvlen >>= 8;
|
||||
}
|
||||
*size += tlvlen;
|
||||
buf += tlvlen;
|
||||
} else {
|
||||
t_u32 value = a2hex_or_atoi(pos2);
|
||||
while (len--) {
|
||||
*buf++ = (t_u8)(value & 0xff);
|
||||
value >>= 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/********************************************************
|
||||
Global Functions
|
||||
********************************************************/
|
||||
/**
|
||||
* @brief convert char to hex integer
|
||||
*
|
||||
* @param chr char to convert
|
||||
* @return hex integer or 0
|
||||
*/
|
||||
int
|
||||
hexval(t_s32 chr)
|
||||
{
|
||||
if (chr >= '0' && chr <= '9')
|
||||
return chr - '0';
|
||||
if (chr >= 'A' && chr <= 'F')
|
||||
return chr - 'A' + 10;
|
||||
if (chr >= 'a' && chr <= 'f')
|
||||
return chr - 'a' + 10;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Hump hex data
|
||||
*
|
||||
* @param prompt A pointer prompt buffer
|
||||
* @param p A pointer to data buffer
|
||||
* @param len the len of data buffer
|
||||
* @param delim delim char
|
||||
* @return hex integer
|
||||
*/
|
||||
t_void
|
||||
hexdump(t_s8 *prompt, t_void *p, t_s32 len, t_s8 delim)
|
||||
{
|
||||
t_s32 i;
|
||||
t_u8 *s = p;
|
||||
|
||||
if (prompt) {
|
||||
printf("%s: len=%d\n", prompt, (int)len);
|
||||
}
|
||||
for (i = 0; i < len; i++) {
|
||||
if (i != len - 1)
|
||||
printf("%02x%c", *s++, delim);
|
||||
else
|
||||
printf("%02x\n", *s);
|
||||
if ((i + 1) % 16 == 0)
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief convert char to hex integer
|
||||
*
|
||||
* @param chr char
|
||||
* @return hex integer
|
||||
*/
|
||||
t_u8
|
||||
hexc2bin(t_s8 chr)
|
||||
{
|
||||
if (chr >= '0' && chr <= '9')
|
||||
chr -= '0';
|
||||
else if (chr >= 'A' && chr <= 'F')
|
||||
chr -= ('A' - 10);
|
||||
else if (chr >= 'a' && chr <= 'f')
|
||||
chr -= ('a' - 10);
|
||||
|
||||
return chr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief convert string to hex integer
|
||||
*
|
||||
* @param s A pointer string buffer
|
||||
* @return hex integer
|
||||
*/
|
||||
t_u32
|
||||
a2hex(t_s8 *s)
|
||||
{
|
||||
t_u32 val = 0;
|
||||
|
||||
if (!strncasecmp("0x", s, 2)) {
|
||||
s += 2;
|
||||
}
|
||||
|
||||
while (*s && isxdigit(*s)) {
|
||||
val = (val << 4) + hexc2bin(*s++);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief convert String to integer
|
||||
*
|
||||
* @param value A pointer to string
|
||||
* @return integer
|
||||
*/
|
||||
t_u32
|
||||
a2hex_or_atoi(t_s8 *value)
|
||||
{
|
||||
if (value[0] == '0' && (value[1] == 'X' || value[1] == 'x')) {
|
||||
return a2hex(value + 2);
|
||||
} else if (isdigit(*value)) {
|
||||
return atoi(value);
|
||||
} else {
|
||||
return *value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief convert string to hex
|
||||
*
|
||||
* @param ptr A pointer to data buffer
|
||||
* @param chr A pointer to return integer
|
||||
* @return A pointer to next data field
|
||||
*/
|
||||
t_s8 *
|
||||
convert2hex(t_s8 *ptr, t_u8 *chr)
|
||||
{
|
||||
t_u8 val;
|
||||
|
||||
for (val = 0; *ptr && isxdigit(*ptr); ptr++) {
|
||||
val = (val * 16) + hexval(*ptr);
|
||||
}
|
||||
|
||||
*chr = val;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check the Hex String
|
||||
* @param s A pointer to the string
|
||||
* @return MLAN_STATUS_SUCCESS --HexString, MLAN_STATUS_FAILURE --not HexString
|
||||
*/
|
||||
int
|
||||
ishexstring(t_s8 *s)
|
||||
{
|
||||
int ret = MLAN_STATUS_FAILURE;
|
||||
t_s32 tmp;
|
||||
|
||||
if (!strncasecmp("0x", s, 2)) {
|
||||
s += 2;
|
||||
}
|
||||
while (*s) {
|
||||
tmp = toupper(*s);
|
||||
if (((tmp >= 'A') && (tmp <= 'F')) ||
|
||||
((tmp >= '0') && (tmp <= '9'))) {
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
} else {
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
break;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert String to Integer
|
||||
* @param buf A pointer to the string
|
||||
* @return Integer
|
||||
*/
|
||||
int
|
||||
atoval(t_s8 *buf)
|
||||
{
|
||||
if (!strncasecmp(buf, "0x", 2))
|
||||
return a2hex(buf + 2);
|
||||
else if (!ishexstring(buf))
|
||||
return a2hex(buf);
|
||||
else
|
||||
return atoi(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Prepare host-command buffer
|
||||
* @param fp File handler
|
||||
* @param cmd_name Command name
|
||||
* @param buf A pointer to comand buffer
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
int
|
||||
prepare_host_cmd_buffer(FILE * fp, char *cmd_name, t_u8 *buf)
|
||||
{
|
||||
t_s8 line[256], cmdname[256], *pos, cmdcode[10];
|
||||
HostCmd_DS_GEN *hostcmd;
|
||||
int ln = 0;
|
||||
int cmdname_found = 0, cmdcode_found = 0;
|
||||
|
||||
memset(buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
|
||||
hostcmd = (HostCmd_DS_GEN *)buf;
|
||||
hostcmd->command = 0xffff;
|
||||
|
||||
snprintf(cmdname, sizeof(cmdname), "%s={", cmd_name);
|
||||
cmdname_found = 0;
|
||||
while ((pos = mlan_config_get_line(fp, line, sizeof(line), &ln))) {
|
||||
if (strcmp(pos, cmdname) == 0) {
|
||||
t_u16 len = 0;
|
||||
cmdname_found = 1;
|
||||
snprintf(cmdcode, sizeof(cmdcode), "CmdCode=");
|
||||
cmdcode_found = 0;
|
||||
while ((pos =
|
||||
mlan_config_get_line(fp, line, sizeof(line),
|
||||
&ln))) {
|
||||
if (strncmp(pos, cmdcode, strlen(cmdcode)) == 0) {
|
||||
cmdcode_found = 1;
|
||||
hostcmd->command =
|
||||
a2hex_or_atoi(pos +
|
||||
strlen(cmdcode));
|
||||
hostcmd->size = S_DS_GEN;
|
||||
mlan_get_hostcmd_data(fp, &ln,
|
||||
buf +
|
||||
hostcmd->size,
|
||||
&len);
|
||||
hostcmd->size += len;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!cmdcode_found) {
|
||||
fprintf(stderr,
|
||||
"mlanconfig: CmdCode not found in conf file\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cmdname_found) {
|
||||
fprintf(stderr,
|
||||
"mlanconfig: cmdname '%s' is not found in conf file\n",
|
||||
cmd_name);
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
hostcmd->command = cpu_to_le16(hostcmd->command);
|
||||
hostcmd->size = cpu_to_le16(hostcmd->size);
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/** Config data header length */
|
||||
#define CFG_DATA_HEADER_LEN 6
|
||||
|
||||
/**
|
||||
* @brief Prepare cfg-data buffer
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
* @param fp File handler
|
||||
* @param buf A pointer to comand buffer
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
int
|
||||
prepare_cfg_data_buffer(int argc, char *argv[], FILE * fp, t_u8 *buf)
|
||||
{
|
||||
int ln = 0, type;
|
||||
HostCmd_DS_GEN *hostcmd;
|
||||
HostCmd_DS_802_11_CFG_DATA *pcfg_data;
|
||||
|
||||
memset(buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
|
||||
hostcmd = (HostCmd_DS_GEN *)buf;
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_CFG_DATA);
|
||||
pcfg_data = (HostCmd_DS_802_11_CFG_DATA *)(buf + S_DS_GEN);
|
||||
pcfg_data->action =
|
||||
(argc == 4) ? HostCmd_ACT_GEN_GET : HostCmd_ACT_GEN_SET;
|
||||
type = atoi(argv[3]);
|
||||
if ((type < 1) || (type > 2)) {
|
||||
fprintf(stderr, "mlanconfig: Invalid register type\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
} else {
|
||||
pcfg_data->type = type;
|
||||
}
|
||||
if (argc == 5) {
|
||||
ln = fparse_for_hex(fp, pcfg_data->data);
|
||||
}
|
||||
pcfg_data->data_len = ln;
|
||||
hostcmd->size =
|
||||
cpu_to_le16(pcfg_data->data_len + S_DS_GEN +
|
||||
CFG_DATA_HEADER_LEN);
|
||||
pcfg_data->data_len = cpu_to_le16(pcfg_data->data_len);
|
||||
pcfg_data->type = cpu_to_le16(pcfg_data->type);
|
||||
pcfg_data->action = cpu_to_le16(pcfg_data->action);
|
||||
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Process host_cmd response
|
||||
* @param buf A pointer to the response buffer
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
int
|
||||
process_host_cmd_resp(t_u8 *buf)
|
||||
{
|
||||
HostCmd_DS_GEN *hostcmd = (HostCmd_DS_GEN *)buf;
|
||||
int ret = MLAN_STATUS_SUCCESS;
|
||||
|
||||
hostcmd->command = le16_to_cpu(hostcmd->command);
|
||||
hostcmd->size = le16_to_cpu(hostcmd->size);
|
||||
hostcmd->seq_num = le16_to_cpu(hostcmd->seq_num);
|
||||
hostcmd->result = le16_to_cpu(hostcmd->result);
|
||||
|
||||
hostcmd->command &= ~HostCmd_RET_BIT;
|
||||
if (!hostcmd->result) {
|
||||
switch (hostcmd->command) {
|
||||
case HostCmd_CMD_CFG_DATA:
|
||||
{
|
||||
HostCmd_DS_802_11_CFG_DATA *pstcfgData =
|
||||
(HostCmd_DS_802_11_CFG_DATA *)(buf +
|
||||
S_DS_GEN);
|
||||
pstcfgData->data_len =
|
||||
le16_to_cpu(pstcfgData->data_len);
|
||||
pstcfgData->action =
|
||||
le16_to_cpu(pstcfgData->action);
|
||||
|
||||
if (pstcfgData->action == HostCmd_ACT_GEN_GET) {
|
||||
hexdump("cfgdata", pstcfgData->data,
|
||||
pstcfgData->data_len, ' ');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_802_11_TPC_ADAPT_REQ:
|
||||
{
|
||||
mlan_ioctl_11h_tpc_resp *tpcIoctlResp =
|
||||
(mlan_ioctl_11h_tpc_resp *)(buf +
|
||||
S_DS_GEN);
|
||||
if (tpcIoctlResp->status_code == 0) {
|
||||
printf("tpcrequest: txPower(%d), linkMargin(%d), rssi(%d)\n", tpcIoctlResp->tx_power, tpcIoctlResp->link_margin, tpcIoctlResp->rssi);
|
||||
} else {
|
||||
printf("tpcrequest: failure, status = %d\n", tpcIoctlResp->status_code);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_802_11_CRYPTO:
|
||||
{
|
||||
t_u16 alg =
|
||||
le16_to_cpu((t_u16)
|
||||
*(buf + S_DS_GEN +
|
||||
sizeof(t_u16)));
|
||||
if (alg == CIPHER_TEST_AES_CCM ||
|
||||
alg == CIPHER_TEST_GCMP) {
|
||||
HostCmd_DS_802_11_CRYPTO_AES_CCM
|
||||
*cmd_aes_ccm =
|
||||
(HostCmd_DS_802_11_CRYPTO_AES_CCM
|
||||
*)(buf + S_DS_GEN);
|
||||
|
||||
cmd_aes_ccm->encdec
|
||||
=
|
||||
le16_to_cpu(cmd_aes_ccm->
|
||||
encdec);
|
||||
cmd_aes_ccm->algorithm =
|
||||
le16_to_cpu(cmd_aes_ccm->
|
||||
algorithm);
|
||||
cmd_aes_ccm->key_length =
|
||||
le16_to_cpu(cmd_aes_ccm->
|
||||
key_length);
|
||||
cmd_aes_ccm->nonce_length =
|
||||
le16_to_cpu(cmd_aes_ccm->
|
||||
nonce_length);
|
||||
cmd_aes_ccm->AAD_length =
|
||||
le16_to_cpu(cmd_aes_ccm->
|
||||
AAD_length);
|
||||
cmd_aes_ccm->data.header.type =
|
||||
le16_to_cpu(cmd_aes_ccm->data.
|
||||
header.type);
|
||||
cmd_aes_ccm->data.header.len =
|
||||
le16_to_cpu(cmd_aes_ccm->data.
|
||||
header.len);
|
||||
|
||||
printf("crypto_result: encdec=%d algorithm=%d, KeyLen=%d," " NonceLen=%d,AADLen=%d,dataLen=%d\n", cmd_aes_ccm->encdec, cmd_aes_ccm->algorithm, cmd_aes_ccm->key_length, cmd_aes_ccm->nonce_length, cmd_aes_ccm->AAD_length, cmd_aes_ccm->data.header.len);
|
||||
|
||||
hexdump("Key", cmd_aes_ccm->key,
|
||||
cmd_aes_ccm->key_length, ' ');
|
||||
hexdump("Nonce", cmd_aes_ccm->nonce,
|
||||
cmd_aes_ccm->nonce_length, ' ');
|
||||
hexdump("AAD", cmd_aes_ccm->AAD,
|
||||
cmd_aes_ccm->AAD_length, ' ');
|
||||
hexdump("Data", cmd_aes_ccm->data.data,
|
||||
cmd_aes_ccm->data.header.len,
|
||||
' ');
|
||||
} else if (alg == CIPHER_TEST_WAPI) {
|
||||
HostCmd_DS_802_11_CRYPTO_WAPI *cmd_wapi
|
||||
=
|
||||
(HostCmd_DS_802_11_CRYPTO_WAPI
|
||||
*) (buf + S_DS_GEN);
|
||||
|
||||
cmd_wapi->encdec
|
||||
= le16_to_cpu(cmd_wapi->encdec);
|
||||
cmd_wapi->algorithm
|
||||
=
|
||||
le16_to_cpu(cmd_wapi->
|
||||
algorithm);
|
||||
cmd_wapi->key_length =
|
||||
le16_to_cpu(cmd_wapi->
|
||||
key_length);
|
||||
cmd_wapi->nonce_length =
|
||||
le16_to_cpu(cmd_wapi->
|
||||
nonce_length);
|
||||
cmd_wapi->AAD_length =
|
||||
le16_to_cpu(cmd_wapi->
|
||||
AAD_length);
|
||||
|
||||
printf("crypto_result: encdec=%d algorithm=%d, KeyLen=%d," " NonceLen=%d,AADLen=%d,dataLen=%d\n", cmd_wapi->encdec, cmd_wapi->algorithm, cmd_wapi->key_length, cmd_wapi->nonce_length, cmd_wapi->AAD_length, cmd_wapi->data_length);
|
||||
|
||||
hexdump("Key", cmd_wapi->key,
|
||||
cmd_wapi->key_length, ' ');
|
||||
hexdump("Nonce", cmd_wapi->nonce,
|
||||
cmd_wapi->nonce_length, ' ');
|
||||
hexdump("AAD", cmd_wapi->AAD,
|
||||
cmd_wapi->AAD_length, ' ');
|
||||
} else {
|
||||
HostCmd_DS_802_11_CRYPTO *cmd =
|
||||
(HostCmd_DS_802_11_CRYPTO *)(buf
|
||||
+
|
||||
S_DS_GEN);
|
||||
cmd->encdec = le16_to_cpu(cmd->encdec);
|
||||
cmd->algorithm =
|
||||
le16_to_cpu(cmd->algorithm);
|
||||
cmd->key_IV_length =
|
||||
le16_to_cpu(cmd->key_IV_length);
|
||||
cmd->key_length =
|
||||
le16_to_cpu(cmd->key_length);
|
||||
cmd->data.header.type =
|
||||
le16_to_cpu(cmd->data.header.
|
||||
type);
|
||||
cmd->data.header.len =
|
||||
le16_to_cpu(cmd->data.header.
|
||||
len);
|
||||
|
||||
printf("crypto_result: encdec=%d algorithm=%d,KeyIVLen=%d," " KeyLen=%d,dataLen=%d\n", cmd->encdec, cmd->algorithm, cmd->key_IV_length, cmd->key_length, cmd->data.header.len);
|
||||
hexdump("KeyIV", cmd->keyIV,
|
||||
cmd->key_IV_length, ' ');
|
||||
hexdump("Key", cmd->key,
|
||||
cmd->key_length, ' ');
|
||||
hexdump("Data", cmd->data.data,
|
||||
cmd->data.header.len, ' ');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_802_11_AUTO_TX:
|
||||
{
|
||||
HostCmd_DS_802_11_AUTO_TX *at =
|
||||
(HostCmd_DS_802_11_AUTO_TX *)(buf +
|
||||
S_DS_GEN);
|
||||
|
||||
if (le16_to_cpu(at->action) ==
|
||||
HostCmd_ACT_GEN_GET) {
|
||||
if (S_DS_GEN + sizeof(at->action) ==
|
||||
hostcmd->size) {
|
||||
printf("auto_tx not configured\n");
|
||||
|
||||
} else {
|
||||
MrvlIEtypesHeader_t *header =
|
||||
&at->auto_tx.header;
|
||||
|
||||
header->type =
|
||||
le16_to_cpu(header->
|
||||
type);
|
||||
header->len =
|
||||
le16_to_cpu(header->
|
||||
len);
|
||||
|
||||
if ((S_DS_GEN +
|
||||
sizeof(at->action)
|
||||
+
|
||||
sizeof(MrvlIEtypesHeader_t)
|
||||
+ header->len ==
|
||||
hostcmd->size) &&
|
||||
(header->type ==
|
||||
TLV_TYPE_AUTO_TX)) {
|
||||
|
||||
AutoTx_MacFrame_t *atmf
|
||||
=
|
||||
&at->auto_tx.
|
||||
auto_tx_mac_frame;
|
||||
|
||||
printf("Interval: %d second(s)\n", le16_to_cpu(atmf->interval));
|
||||
printf("Priority: %#x\n", atmf->priority);
|
||||
printf("Frame Length: %d\n", le16_to_cpu(atmf->frame_len));
|
||||
printf("Dest Mac Address: " "%02x:%02x:%02x:%02x:%02x:%02x\n", atmf->dest_mac_addr[0], atmf->dest_mac_addr[1], atmf->dest_mac_addr[2], atmf->dest_mac_addr[3], atmf->dest_mac_addr[4], atmf->dest_mac_addr[5]);
|
||||
printf("Src Mac Address: " "%02x:%02x:%02x:%02x:%02x:%02x\n", atmf->src_mac_addr[0], atmf->src_mac_addr[1], atmf->src_mac_addr[2], atmf->src_mac_addr[3], atmf->src_mac_addr[4], atmf->src_mac_addr[5]);
|
||||
|
||||
hexdump("Frame Payload",
|
||||
atmf->payload,
|
||||
le16_to_cpu
|
||||
(atmf->
|
||||
frame_len)
|
||||
-
|
||||
MLAN_MAC_ADDR_LENGTH
|
||||
* 2, ' ');
|
||||
} else {
|
||||
printf("incorrect auto_tx command response\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_802_11_SUBSCRIBE_EVENT:
|
||||
{
|
||||
HostCmd_DS_802_11_SUBSCRIBE_EVENT *se =
|
||||
(HostCmd_DS_802_11_SUBSCRIBE_EVENT
|
||||
*)(buf + S_DS_GEN);
|
||||
if (le16_to_cpu(se->action) ==
|
||||
HostCmd_ACT_GEN_GET) {
|
||||
int len =
|
||||
S_DS_GEN +
|
||||
sizeof
|
||||
(HostCmd_DS_802_11_SUBSCRIBE_EVENT);
|
||||
printf("\nEvent\t\tValue\tFreq\tsubscribed\n\n");
|
||||
while (len < hostcmd->size) {
|
||||
MrvlIEtypesHeader_t *header =
|
||||
(MrvlIEtypesHeader_t
|
||||
*)(buf + len);
|
||||
switch (le16_to_cpu
|
||||
(header->type)) {
|
||||
case TLV_TYPE_RSSI_LOW:
|
||||
{
|
||||
MrvlIEtypes_RssiThreshold_t
|
||||
*low_rssi
|
||||
=
|
||||
(MrvlIEtypes_RssiThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Beacon Low RSSI\t%d\t%d\t%s\n", low_rssi->RSSI_value, low_rssi->RSSI_freq, (le16_to_cpu(se->events) & 0x0001) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_SNR_LOW:
|
||||
{
|
||||
MrvlIEtypes_SnrThreshold_t
|
||||
*low_snr
|
||||
=
|
||||
(MrvlIEtypes_SnrThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Beacon Low SNR\t%d\t%d\t%s\n", low_snr->SNR_value, low_snr->SNR_freq, (le16_to_cpu(se->events) & 0x0002) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_FAILCOUNT:
|
||||
{
|
||||
MrvlIEtypes_FailureCount_t
|
||||
*failure_count
|
||||
=
|
||||
(MrvlIEtypes_FailureCount_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Failure Count\t%d\t%d\t%s\n", failure_count->fail_value, failure_count->fail_freq, (le16_to_cpu(se->events) & 0x0004) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_BCNMISS:
|
||||
{
|
||||
MrvlIEtypes_BeaconsMissed_t
|
||||
*bcn_missed
|
||||
=
|
||||
(MrvlIEtypes_BeaconsMissed_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Beacon Missed\t%d\tN/A\t%s\n", bcn_missed->beacon_missed, (le16_to_cpu(se->events) & 0x0008) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_RSSI_HIGH:
|
||||
{
|
||||
MrvlIEtypes_RssiThreshold_t
|
||||
*high_rssi
|
||||
=
|
||||
(MrvlIEtypes_RssiThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Bcn High RSSI\t%d\t%d\t%s\n", high_rssi->RSSI_value, high_rssi->RSSI_freq, (le16_to_cpu(se->events) & 0x0010) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
|
||||
case TLV_TYPE_SNR_HIGH:
|
||||
{
|
||||
MrvlIEtypes_SnrThreshold_t
|
||||
*high_snr
|
||||
=
|
||||
(MrvlIEtypes_SnrThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Beacon High SNR\t%d\t%d\t%s\n", high_snr->SNR_value, high_snr->SNR_freq, (le16_to_cpu(se->events) & 0x0020) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_RSSI_LOW_DATA:
|
||||
{
|
||||
MrvlIEtypes_RssiThreshold_t
|
||||
*low_rssi
|
||||
=
|
||||
(MrvlIEtypes_RssiThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Data Low RSSI\t%d\t%d\t%s\n", low_rssi->RSSI_value, low_rssi->RSSI_freq, (le16_to_cpu(se->events) & 0x0040) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_SNR_LOW_DATA:
|
||||
{
|
||||
MrvlIEtypes_SnrThreshold_t
|
||||
*low_snr
|
||||
=
|
||||
(MrvlIEtypes_SnrThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Data Low SNR\t%d\t%d\t%s\n", low_snr->SNR_value, low_snr->SNR_freq, (le16_to_cpu(se->events) & 0x0080) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_RSSI_HIGH_DATA:
|
||||
{
|
||||
MrvlIEtypes_RssiThreshold_t
|
||||
*high_rssi
|
||||
=
|
||||
(MrvlIEtypes_RssiThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Data High RSSI\t%d\t%d\t%s\n", high_rssi->RSSI_value, high_rssi->RSSI_freq, (le16_to_cpu(se->events) & 0x0100) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_SNR_HIGH_DATA:
|
||||
{
|
||||
MrvlIEtypes_SnrThreshold_t
|
||||
*high_snr
|
||||
=
|
||||
(MrvlIEtypes_SnrThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Data High SNR\t%d\t%d\t%s\n", high_snr->SNR_value, high_snr->SNR_freq, (le16_to_cpu(se->events) & 0x0200) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_LINK_QUALITY:
|
||||
{
|
||||
MrvlIEtypes_LinkQuality_t
|
||||
*link_qual
|
||||
=
|
||||
(MrvlIEtypes_LinkQuality_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Link Quality Parameters:\n");
|
||||
printf("------------------------\n");
|
||||
printf("Link Quality Event Subscribed\t%s\n", (le16_to_cpu(se->events) & 0x0400) ? "yes" : "no");
|
||||
printf("Link SNR Threshold = %d\n", le16_to_cpu(link_qual->link_SNR_thrs));
|
||||
printf("Link SNR Frequency = %d\n", le16_to_cpu(link_qual->link_SNR_freq));
|
||||
printf("Min Rate Value = %d\n", le16_to_cpu(link_qual->min_rate_val));
|
||||
printf("Min Rate Frequency = %d\n", le16_to_cpu(link_qual->min_rate_freq));
|
||||
printf("Tx Latency Value = %d\n", le32_to_cpu(link_qual->tx_latency_val));
|
||||
printf("Tx Latency Threshold = %d\n", le32_to_cpu(link_qual->tx_latency_thrs));
|
||||
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_PRE_BEACON_LOST:
|
||||
{
|
||||
MrvlIEtypes_PreBeaconLost_t
|
||||
*pre_bcn_lost
|
||||
=
|
||||
(MrvlIEtypes_PreBeaconLost_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("------------------------\n");
|
||||
printf("Pre-Beacon Lost Event Subscribed\t%s\n", (le16_to_cpu(se->events) & 0x0800) ? "yes" : "no");
|
||||
printf("Pre-Beacon Lost: %d\n", pre_bcn_lost->pre_beacon_lost);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
printf("Unknown subscribed event TLV Type=%#x," " Len=%d\n", le16_to_cpu(header->type), le16_to_cpu(header->len));
|
||||
break;
|
||||
}
|
||||
|
||||
len += (sizeof
|
||||
(MrvlIEtypesHeader_t)
|
||||
+
|
||||
le16_to_cpu(header->
|
||||
len));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_MAC_REG_ACCESS:
|
||||
case HostCmd_CMD_BBP_REG_ACCESS:
|
||||
case HostCmd_CMD_RF_REG_ACCESS:
|
||||
case HostCmd_CMD_CAU_REG_ACCESS:
|
||||
{
|
||||
HostCmd_DS_REG *preg =
|
||||
(HostCmd_DS_REG *)(buf + S_DS_GEN);
|
||||
preg->action = le16_to_cpu(preg->action);
|
||||
if (preg->action == HostCmd_ACT_GEN_GET) {
|
||||
preg->value = le32_to_cpu(preg->value);
|
||||
printf("value = 0x%08x\n", preg->value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_MEM_ACCESS:
|
||||
{
|
||||
HostCmd_DS_MEM *pmem =
|
||||
(HostCmd_DS_MEM *)(buf + S_DS_GEN);
|
||||
pmem->action = le16_to_cpu(pmem->action);
|
||||
if (pmem->action == HostCmd_ACT_GEN_GET) {
|
||||
pmem->value = le32_to_cpu(pmem->value);
|
||||
printf("value = 0x%08x\n", pmem->value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
printf("HOSTCMD_RESP: CmdCode=%#04x, Size=%#04x,"
|
||||
" SeqNum=%#04x, Result=%#04x\n",
|
||||
hostcmd->command, hostcmd->size,
|
||||
hostcmd->seq_num, hostcmd->result);
|
||||
hexdump("payload",
|
||||
(t_void *)(buf + S_DS_GEN),
|
||||
hostcmd->size - S_DS_GEN, ' ');
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
printf("HOSTCMD failed: CmdCode=%#04x, Size=%#04x,"
|
||||
" SeqNum=%#04x, Result=%#04x\n",
|
||||
hostcmd->command, hostcmd->size,
|
||||
hostcmd->seq_num, hostcmd->result);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Prepare the hostcmd for register access
|
||||
* @param type Register type
|
||||
* @param offset Register offset
|
||||
* @param value Pointer to value (NULL for read)
|
||||
* @param buf Pointer to hostcmd buffer
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
int
|
||||
prepare_hostcmd_regrdwr(t_u32 type, t_u32 offset, t_u32 *value, t_u8 *buf)
|
||||
{
|
||||
HostCmd_DS_GEN *hostcmd;
|
||||
HostCmd_DS_REG *preg;
|
||||
|
||||
hostcmd = (HostCmd_DS_GEN *)buf;
|
||||
switch (type) {
|
||||
case 1:
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_MAC_REG_ACCESS);
|
||||
break;
|
||||
case 2:
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_BBP_REG_ACCESS);
|
||||
break;
|
||||
case 3:
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_RF_REG_ACCESS);
|
||||
break;
|
||||
case 5:
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_CAU_REG_ACCESS);
|
||||
break;
|
||||
default:
|
||||
printf("Invalid register set specified\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
preg = (HostCmd_DS_REG *)(buf + S_DS_GEN);
|
||||
preg->action = (value) ? HostCmd_ACT_GEN_SET : HostCmd_ACT_GEN_GET;
|
||||
preg->action = cpu_to_le16(preg->action);
|
||||
preg->offset = cpu_to_le16((t_u16)offset);
|
||||
if (value)
|
||||
preg->value = cpu_to_le32(*value);
|
||||
else
|
||||
preg->value = 0;
|
||||
hostcmd->size = cpu_to_le16(S_DS_GEN + sizeof(HostCmd_DS_REG));
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
|
@ -1,385 +0,0 @@
|
|||
/** @file mlanhostcmd.h
|
||||
*
|
||||
* @brief This file contains command structures for mlanconfig application
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
11/26/2008: initial version
|
||||
************************************************************************/
|
||||
#ifndef _MLANHOSTCMD_H_
|
||||
#define _MLANHOSTCMD_H_
|
||||
|
||||
/** Find number of elements */
|
||||
#define NELEMENTS(x) (sizeof(x)/sizeof(x[0]))
|
||||
|
||||
/** MLAN MAC Address Length */
|
||||
#define MLAN_MAC_ADDR_LENGTH (6)
|
||||
/** Size of command buffer */
|
||||
#define MRVDRV_SIZE_OF_CMD_BUFFER (3 * 1024)
|
||||
|
||||
/** Command RET code, MSB is set to 1 */
|
||||
#define HostCmd_RET_BIT 0x8000
|
||||
/** General purpose action : Get */
|
||||
#define HostCmd_ACT_GEN_GET 0x0000
|
||||
/** General purpose action : Set */
|
||||
#define HostCmd_ACT_GEN_SET 0x0001
|
||||
/** General purpose action : Clear */
|
||||
#define HostCmd_ACT_GEN_CLEAR 0x0004
|
||||
/** General purpose action : Remove */
|
||||
#define HostCmd_ACT_GEN_REMOVE 0x0004
|
||||
|
||||
/** Host Command ID : Memory access */
|
||||
#define HostCmd_CMD_MEM_ACCESS 0x0086
|
||||
|
||||
/** Pre-Authenticate - 11r only */
|
||||
#define HostCmd_CMD_802_11_AUTHENTICATE 0x0011
|
||||
|
||||
/** Read/Write Mac register */
|
||||
#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
|
||||
/** Read/Write BBP register */
|
||||
#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
|
||||
/** Read/Write RF register */
|
||||
#define HostCmd_CMD_RF_REG_ACCESS 0x001b
|
||||
/** Get TX Power data */
|
||||
#define HostCmd_CMD_802_11_RF_TX_POWER 0x001e
|
||||
/** Get the current TSF */
|
||||
#define HostCmd_CMD_GET_TSF 0x0080
|
||||
/** Host Command ID : CAU register access */
|
||||
#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
|
||||
|
||||
/** Host Command ID : 802.11 BG scan configuration */
|
||||
#define HostCmd_CMD_802_11_BG_SCAN_CONFIG 0x006b
|
||||
/** Host Command ID : Configuration data */
|
||||
#define HostCmd_CMD_CFG_DATA 0x008f
|
||||
/** Host Command ID : 802.11 TPC adapt req */
|
||||
#define HostCmd_CMD_802_11_TPC_ADAPT_REQ 0x0060
|
||||
/** Host Command ID : 802.11 crypto */
|
||||
#define HostCmd_CMD_802_11_CRYPTO 0x0078
|
||||
/** Host Command ID : 802.11 auto Tx */
|
||||
#define HostCmd_CMD_802_11_AUTO_TX 0x0082
|
||||
|
||||
/** Host Command ID : 802.11 subscribe event */
|
||||
#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
|
||||
|
||||
#ifdef OPCHAN
|
||||
/** Host Command ID : Operating channel config */
|
||||
#define HostCmd_CMD_OPCHAN_CONFIG 0x00f8
|
||||
/** Host Command ID : Opchan channel group config */
|
||||
#define HostCmd_CMD_OPCHAN_CHANGROUP_CONFIG 0x00f9
|
||||
#endif
|
||||
|
||||
/** Host Command ID : Channel TRPC config */
|
||||
#define HostCmd_CMD_CHAN_TRPC_CONFIG 0x00fb
|
||||
|
||||
/** TLV type ID definition */
|
||||
#define PROPRIETARY_TLV_BASE_ID 0x0100
|
||||
/** TLV type : Beacon RSSI low */
|
||||
#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 0x04) //0x0104
|
||||
/** TLV type : Beacon SNR low */
|
||||
#define TLV_TYPE_SNR_LOW (PROPRIETARY_TLV_BASE_ID + 0x05) //0x0105
|
||||
/** TLV type : Fail count */
|
||||
#define TLV_TYPE_FAILCOUNT (PROPRIETARY_TLV_BASE_ID + 0x06) //0x0106
|
||||
/** TLV type : BCN miss */
|
||||
#define TLV_TYPE_BCNMISS (PROPRIETARY_TLV_BASE_ID + 0x07) //0x0107
|
||||
/** TLV type : Beacon RSSI high */
|
||||
#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 0x16) //0x0116
|
||||
/** TLV type : Beacon SNR high */
|
||||
#define TLV_TYPE_SNR_HIGH (PROPRIETARY_TLV_BASE_ID + 0x17) //0x0117
|
||||
/** TLV type : Auto Tx */
|
||||
#define TLV_TYPE_AUTO_TX (PROPRIETARY_TLV_BASE_ID + 0x18) //0x0118
|
||||
/** TLV type :Link Quality */
|
||||
#define TLV_TYPE_LINK_QUALITY (PROPRIETARY_TLV_BASE_ID + 0x24) //0x0124
|
||||
/** TLV type : Data RSSI low */
|
||||
#define TLV_TYPE_RSSI_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 0x26) //0x0126
|
||||
/** TLV type : Data SNR low */
|
||||
#define TLV_TYPE_SNR_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 0x27) //0x0127
|
||||
/** TLV type : Data RSSI high */
|
||||
#define TLV_TYPE_RSSI_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 0x28) //0x0128
|
||||
/** TLV type : Data SNR high */
|
||||
#define TLV_TYPE_SNR_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 0x29) //0x0129
|
||||
/** TLV type: Pre-Beacon Lost */
|
||||
#define TLV_TYPE_PRE_BEACON_LOST (PROPRIETARY_TLV_BASE_ID + 0x49) //0x0149
|
||||
|
||||
#ifdef OPCHAN
|
||||
/** TLV type : Operating channel control description */
|
||||
#define TLV_TYPE_OPCHAN_CONTROL_DESC (PROPRIETARY_TLV_BASE_ID + 0x79) //0x0179
|
||||
/** TLV type : Operating channel group control */
|
||||
#define TLV_TYPE_OPCHAN_CHANGRP_CTRL (PROPRIETARY_TLV_BASE_ID + 0x7a) //0x017a
|
||||
#endif
|
||||
|
||||
/** TLV type : Channel TRPC */
|
||||
#define TLV_TYPE_CHAN_TRPC (PROPRIETARY_TLV_BASE_ID + 0x89) //0x0189
|
||||
|
||||
/* Define general hostcmd data structure */
|
||||
/** HostCmd_DS_GEN */
|
||||
typedef struct MAPP_HostCmd_DS_GEN {
|
||||
/** Command */
|
||||
t_u16 command;
|
||||
/** Size */
|
||||
t_u16 size;
|
||||
/** Sequence number */
|
||||
t_u16 seq_num;
|
||||
/** Result */
|
||||
t_u16 result;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_GEN;
|
||||
|
||||
typedef struct _HostCmd_DS_MEF_CFG {
|
||||
/** Criteria */
|
||||
t_u32 Criteria;
|
||||
/** Number of entries */
|
||||
t_u16 NumEntries;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_MEF_CFG;
|
||||
|
||||
typedef struct _MEF_CFG_DATA {
|
||||
/** Size */
|
||||
t_u16 size;
|
||||
/** Data */
|
||||
HostCmd_DS_MEF_CFG data;
|
||||
} __ATTRIB_PACK__ MEF_CFG_DATA;
|
||||
|
||||
/** Size of HostCmd_DS_GEN */
|
||||
#define S_DS_GEN sizeof(HostCmd_DS_GEN)
|
||||
|
||||
/** HostCmd_DS_REG */
|
||||
typedef struct MAPP_HostCmd_DS_REG {
|
||||
/** Read or write */
|
||||
t_u16 action;
|
||||
/** Register offset */
|
||||
t_u16 offset;
|
||||
/** Value */
|
||||
t_u32 value;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_REG;
|
||||
|
||||
/** HostCmd_DS_MEM */
|
||||
typedef struct MAPP_HostCmd_DS_MEM {
|
||||
/** Read or write */
|
||||
t_u16 action;
|
||||
/** Reserved */
|
||||
t_u16 reserved;
|
||||
/** Address */
|
||||
t_u32 addr;
|
||||
/** Value */
|
||||
t_u32 value;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_MEM;
|
||||
|
||||
/** HostCmd_DS_802_11_CFG_DATA */
|
||||
typedef struct MAPP_HostCmd_DS_802_11_CFG_DATA {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** Type */
|
||||
t_u16 type;
|
||||
/** Data length */
|
||||
t_u16 data_len;
|
||||
/** Data */
|
||||
t_u8 data[1];
|
||||
} __ATTRIB_PACK__ HostCmd_DS_802_11_CFG_DATA;
|
||||
|
||||
/** mlan_ioctl_11h_tpc_resp */
|
||||
typedef struct {
|
||||
int status_code;
|
||||
/**< Firmware command result status code */
|
||||
int tx_power;/**< Reported TX Power from the TPC Report */
|
||||
int link_margin;
|
||||
/**< Reported Link margin from the TPC Report */
|
||||
int rssi; /**< RSSI of the received TPC Report frame */
|
||||
} __ATTRIB_PACK__ mlan_ioctl_11h_tpc_resp;
|
||||
|
||||
/** MrvlIEtypesHeader_t */
|
||||
typedef struct MrvlIEtypesHeader {
|
||||
/** Header type */
|
||||
t_u16 type;
|
||||
/** Header length */
|
||||
t_u16 len;
|
||||
} __ATTRIB_PACK__ MrvlIEtypesHeader_t;
|
||||
|
||||
/** MrvlIEtypes_Data_t */
|
||||
typedef struct MrvlIEtypes_Data_t {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** Data */
|
||||
t_u8 data[1];
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_Data_t;
|
||||
|
||||
/** HostCmd_DS_802_11_CRYPTO */
|
||||
typedef struct MAPP_HostCmd_DS_802_11_CRYPTO {
|
||||
t_u16 encdec; /**< Decrypt=0, Encrypt=1 */
|
||||
t_u16 algorithm; /**< RC4=1 AES=2 , AES_KEY_WRAP=3 */
|
||||
t_u16 key_IV_length;/**< Length of Key IV (bytes) */
|
||||
t_u8 keyIV[32]; /**< Key IV */
|
||||
t_u16 key_length; /**< Length of Key (bytes) */
|
||||
t_u8 key[32]; /**< Key */
|
||||
MrvlIEtypes_Data_t data; /**< Plain text if encdec=Encrypt, Ciphertext data if encdec=Decrypt*/
|
||||
} __ATTRIB_PACK__ HostCmd_DS_802_11_CRYPTO;
|
||||
|
||||
/** HostCmd_DS_802_11_CRYPTO_AES_CCM */
|
||||
typedef struct MAPP_HostCmd_DS_802_11_CRYPTO_AES_CCM {
|
||||
t_u16 encdec; /**< Decrypt=0, Encrypt=1 */
|
||||
t_u16 algorithm; /**< AES_CCM=4 */
|
||||
t_u16 key_length; /**< Length of Key (bytes) */
|
||||
t_u8 key[32]; /**< Key */
|
||||
t_u16 nonce_length;/**< Length of Nonce (bytes) */
|
||||
t_u8 nonce[14]; /**< Nonce */
|
||||
t_u16 AAD_length; /**< Length of AAD (bytes) */
|
||||
t_u8 AAD[32]; /**< AAD */
|
||||
MrvlIEtypes_Data_t data; /**< Plain text if encdec=Encrypt, Ciphertext data if encdec=Decrypt*/
|
||||
} __ATTRIB_PACK__ HostCmd_DS_802_11_CRYPTO_AES_CCM;
|
||||
|
||||
/** HostCmd_DS_802_11_CRYPTO_WAPI */
|
||||
typedef struct MAPP_HostCmd_DS_802_11_CRYPTO_WAPI {
|
||||
t_u16 encdec; /**< Decrypt=0, Encrypt=1 */
|
||||
t_u16 algorithm; /**< WAPI =5 */
|
||||
t_u16 key_length; /**< Length of Key (bytes) */
|
||||
t_u8 key[32]; /**< Key */
|
||||
t_u16 nonce_length;/**< Length of Nonce (bytes) */
|
||||
t_u8 nonce[16]; /**< Nonce */
|
||||
t_u16 AAD_length; /**< Length of AAD (bytes) */
|
||||
t_u8 AAD[48]; /**< AAD */
|
||||
t_u16 data_length; /**< Length of data (bytes) */
|
||||
} __ATTRIB_PACK__ HostCmd_DS_802_11_CRYPTO_WAPI;
|
||||
/** WAPI cipher test */
|
||||
#define CIPHER_TEST_WAPI (5)
|
||||
/** AES CCM cipher test */
|
||||
#define CIPHER_TEST_AES_CCM (4)
|
||||
/** GCMP cipher test */
|
||||
#define CIPHER_TEST_GCMP (6)
|
||||
/** AutoTx_MacFrame_t */
|
||||
typedef struct AutoTx_MacFrame {
|
||||
t_u16 interval; /**< in seconds */
|
||||
t_u8 priority; /**< User Priority: 0~7, ignored if non-WMM */
|
||||
t_u8 reserved; /**< set to 0 */
|
||||
t_u16 frame_len; /**< Length of MAC frame payload */
|
||||
t_u8 dest_mac_addr[MLAN_MAC_ADDR_LENGTH]; /**< Destination MAC address */
|
||||
t_u8 src_mac_addr[MLAN_MAC_ADDR_LENGTH]; /**< Source MAC address */
|
||||
t_u8 payload[]; /**< Payload */
|
||||
} __ATTRIB_PACK__ AutoTx_MacFrame_t;
|
||||
|
||||
/** MrvlIEtypes_AutoTx_t */
|
||||
typedef struct MrvlIEtypes_AutoTx {
|
||||
MrvlIEtypesHeader_t header; /**< Header */
|
||||
AutoTx_MacFrame_t auto_tx_mac_frame; /**< Auto Tx MAC frame */
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_AutoTx_t;
|
||||
|
||||
/** HostCmd_DS_802_11_AUTO_TX */
|
||||
typedef struct MAPP_HostCmd_DS_802_11_AUTO_TX {
|
||||
/** Action */
|
||||
t_u16 action; /* 0 = ACT_GET; 1 = ACT_SET; */
|
||||
MrvlIEtypes_AutoTx_t auto_tx; /**< Auto Tx */
|
||||
} __ATTRIB_PACK__ HostCmd_DS_802_11_AUTO_TX;
|
||||
|
||||
/** HostCmd_DS_802_11_SUBSCRIBE_EVENT */
|
||||
typedef struct MAPP_HostCmd_DS_802_11_SUBSCRIBE_EVENT {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** Events */
|
||||
t_u16 events;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_802_11_SUBSCRIBE_EVENT;
|
||||
|
||||
/** MrvlIEtypes_RssiParamSet_t */
|
||||
typedef struct MrvlIEtypes_RssiThreshold {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** RSSI value */
|
||||
t_u8 RSSI_value;
|
||||
/** RSSI frequency */
|
||||
t_u8 RSSI_freq;
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_RssiThreshold_t;
|
||||
|
||||
/** MrvlIEtypes_SnrThreshold_t */
|
||||
typedef struct MrvlIEtypes_SnrThreshold {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** SNR value */
|
||||
t_u8 SNR_value;
|
||||
/** SNR frequency */
|
||||
t_u8 SNR_freq;
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_SnrThreshold_t;
|
||||
|
||||
/** MrvlIEtypes_FailureCount_t */
|
||||
typedef struct MrvlIEtypes_FailureCount {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** Failure value */
|
||||
t_u8 fail_value;
|
||||
/** Failure frequency */
|
||||
t_u8 fail_freq;
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_FailureCount_t;
|
||||
|
||||
/** MrvlIEtypes_BeaconsMissed_t */
|
||||
typedef struct MrvlIEtypes_BeaconsMissed {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** Number of beacons missed */
|
||||
t_u8 beacon_missed;
|
||||
/** Reserved */
|
||||
t_u8 reserved;
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_BeaconsMissed_t;
|
||||
|
||||
/** MrvlIEtypes_LinkQuality_t */
|
||||
typedef struct MrvlIEtypes_LinkQuality {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** Link SNR threshold */
|
||||
t_u16 link_SNR_thrs;
|
||||
/** Link SNR frequency */
|
||||
t_u16 link_SNR_freq;
|
||||
/** Minimum rate value */
|
||||
t_u16 min_rate_val;
|
||||
/** Minimum rate frequency */
|
||||
t_u16 min_rate_freq;
|
||||
/** Tx latency value */
|
||||
t_u32 tx_latency_val;
|
||||
/** Tx latency threshold */
|
||||
t_u32 tx_latency_thrs;
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_LinkQuality_t;
|
||||
|
||||
/** MrvlIEtypes_PreBeaconLost_t */
|
||||
typedef struct MrvlIEtypes_PreBeaconLost {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** Pre-Beacon Lost */
|
||||
t_u8 pre_beacon_lost;
|
||||
/** Reserved */
|
||||
t_u8 reserved;
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_PreBeaconLost_t;
|
||||
|
||||
/* String helper functions */
|
||||
/** Convert char to hex integer */
|
||||
int hexval(t_s32 chr);
|
||||
/** Convert char to hex integer */
|
||||
t_u8 hexc2bin(t_s8 chr);
|
||||
/** Convert string to hex integer */
|
||||
t_u32 a2hex(t_s8 *s);
|
||||
/** Check the Hex String */
|
||||
int ishexstring(t_s8 *s);
|
||||
/** Convert String to integer */
|
||||
t_u32 a2hex_or_atoi(t_s8 *value);
|
||||
/** Convert String to Integer */
|
||||
int atoval(t_s8 *buf);
|
||||
/** Hump hex data */
|
||||
void hexdump(t_s8 *prompt, void *p, t_s32 len, t_s8 delim);
|
||||
/** Convert String to Hex */
|
||||
t_s8 *convert2hex(t_s8 *ptr, t_u8 *chr);
|
||||
|
||||
int process_host_cmd_resp(t_u8 *buf);
|
||||
int prepare_host_cmd_buffer(FILE * fp, char *cmd_name, t_u8 *buf);
|
||||
int prepare_cfg_data_buffer(int argc, char *argv[], FILE * fp, t_u8 *buf);
|
||||
int prepare_hostcmd_regrdwr(t_u32 type, t_u32 offset, t_u32 *value, t_u8 *buf);
|
||||
|
||||
#endif /* _MLANHOSTCMD_H_ */
|
File diff suppressed because it is too large
Load diff
|
@ -1,705 +0,0 @@
|
|||
/** @file mlanmisc.h
|
||||
*
|
||||
* @brief This file contains command definitions for application
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
03/10/2009: initial version
|
||||
************************************************************************/
|
||||
|
||||
#ifndef _MLANMISC_H_
|
||||
#define _MLANMISC_H_
|
||||
|
||||
/** Maximum size of IEEE Information Elements */
|
||||
#define IEEE_MAX_IE_SIZE 256
|
||||
|
||||
/** Maximum scan response buffer size */
|
||||
#define SCAN_RESP_BUF_SIZE 2000
|
||||
|
||||
#ifdef FALSE
|
||||
#undef FALSE
|
||||
#endif
|
||||
|
||||
#ifdef TRUE
|
||||
#undef TRUE
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
/** Find minimum value */
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif /* MIN */
|
||||
|
||||
#ifndef MAX
|
||||
/** Find maximum value */
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#endif /* MAX */
|
||||
|
||||
/** Type enumeration of WMM AC_QUEUES */
|
||||
typedef enum _mlan_wmm_ac_e {
|
||||
WMM_AC_BK,
|
||||
WMM_AC_BE,
|
||||
WMM_AC_VI,
|
||||
WMM_AC_VO
|
||||
} __ATTRIB_PACK__ mlan_wmm_ac_e;
|
||||
|
||||
/** Maximum length of SSID */
|
||||
#define MRVDRV_MAX_SSID_LENGTH 32
|
||||
|
||||
/** Enumeration for scan mode */
|
||||
enum {
|
||||
MLAN_SCAN_MODE_UNCHANGED = 0,
|
||||
MLAN_SCAN_MODE_BSS,
|
||||
MLAN_SCAN_MODE_IBSS,
|
||||
MLAN_SCAN_MODE_ANY
|
||||
};
|
||||
|
||||
/** Enumeration for scan type */
|
||||
enum {
|
||||
MLAN_SCAN_TYPE_UNCHANGED = 0,
|
||||
MLAN_SCAN_TYPE_ACTIVE,
|
||||
MLAN_SCAN_TYPE_PASSIVE
|
||||
};
|
||||
|
||||
/** Length of ethernet address */
|
||||
#ifndef ETH_ALEN
|
||||
#define ETH_ALEN 6
|
||||
#endif
|
||||
/** Maximum length of SSID list */
|
||||
#define MRVDRV_MAX_SSID_LIST_LENGTH 10
|
||||
|
||||
/** Maximum number of channels that can be sent in a setuserscan ioctl */
|
||||
#define WLAN_IOCTL_USER_SCAN_CHAN_MAX 50
|
||||
|
||||
/** IEEE Type definitions */
|
||||
typedef enum _IEEEtypes_ElementId_e {
|
||||
SSID = 0,
|
||||
SUPPORTED_RATES = 1,
|
||||
FH_PARAM_SET = 2,
|
||||
DS_PARAM_SET = 3,
|
||||
CF_PARAM_SET = 4,
|
||||
|
||||
IBSS_PARAM_SET = 6,
|
||||
|
||||
COUNTRY_INFO = 7,
|
||||
|
||||
POWER_CONSTRAINT = 32,
|
||||
POWER_CAPABILITY = 33,
|
||||
TPC_REQUEST = 34,
|
||||
TPC_REPORT = 35,
|
||||
SUPPORTED_CHANNELS = 36,
|
||||
CHANNEL_SWITCH_ANN = 37,
|
||||
QUIET = 40,
|
||||
IBSS_DFS = 41,
|
||||
HT_CAPABILITY = 45,
|
||||
HT_OPERATION = 61,
|
||||
BSSCO_2040 = 72,
|
||||
OVERLAPBSSSCANPARAM = 74,
|
||||
EXT_CAPABILITY = 127,
|
||||
|
||||
VHT_CAPABILITY = 191,
|
||||
VHT_OPERATION = 192,
|
||||
EXT_BSS_LOAD = 193,
|
||||
BW_CHANNEL_SWITCH = 194,
|
||||
VHT_TX_POWER_ENV = 195,
|
||||
EXT_POWER_CONSTR = 196,
|
||||
AID_INFO = 197,
|
||||
QUIET_CHAN = 198,
|
||||
|
||||
ERP_INFO = 42,
|
||||
EXTENDED_SUPPORTED_RATES = 50,
|
||||
|
||||
VENDOR_SPECIFIC_221 = 221,
|
||||
WMM_IE = VENDOR_SPECIFIC_221,
|
||||
|
||||
WPS_IE = VENDOR_SPECIFIC_221,
|
||||
|
||||
WPA_IE = VENDOR_SPECIFIC_221,
|
||||
RSN_IE = 48,
|
||||
} __ATTRIB_PACK__ IEEEtypes_ElementId_e;
|
||||
|
||||
/** Capability Bit Map*/
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
typedef struct _IEEEtypes_CapInfo_t {
|
||||
t_u8 rsrvd1:2;
|
||||
t_u8 dsss_ofdm:1;
|
||||
t_u8 rsvrd2:2;
|
||||
t_u8 short_slot_time:1;
|
||||
t_u8 rsrvd3:1;
|
||||
t_u8 spectrum_mgmt:1;
|
||||
t_u8 chan_agility:1;
|
||||
t_u8 pbcc:1;
|
||||
t_u8 short_preamble:1;
|
||||
t_u8 privacy:1;
|
||||
t_u8 cf_poll_rqst:1;
|
||||
t_u8 cf_pollable:1;
|
||||
t_u8 ibss:1;
|
||||
t_u8 ess:1;
|
||||
} __ATTRIB_PACK__ IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
|
||||
#else
|
||||
typedef struct _IEEEtypes_CapInfo_t {
|
||||
/** Capability Bit Map : ESS */
|
||||
t_u8 ess:1;
|
||||
/** Capability Bit Map : IBSS */
|
||||
t_u8 ibss:1;
|
||||
/** Capability Bit Map : CF pollable */
|
||||
t_u8 cf_pollable:1;
|
||||
/** Capability Bit Map : CF poll request */
|
||||
t_u8 cf_poll_rqst:1;
|
||||
/** Capability Bit Map : privacy */
|
||||
t_u8 privacy:1;
|
||||
/** Capability Bit Map : Short preamble */
|
||||
t_u8 short_preamble:1;
|
||||
/** Capability Bit Map : PBCC */
|
||||
t_u8 pbcc:1;
|
||||
/** Capability Bit Map : Channel agility */
|
||||
t_u8 chan_agility:1;
|
||||
/** Capability Bit Map : Spectrum management */
|
||||
t_u8 spectrum_mgmt:1;
|
||||
/** Capability Bit Map : Reserved */
|
||||
t_u8 rsrvd3:1;
|
||||
/** Capability Bit Map : Short slot time */
|
||||
t_u8 short_slot_time:1;
|
||||
/** Capability Bit Map : APSD */
|
||||
t_u8 apsd:1;
|
||||
/** Capability Bit Map : Reserved */
|
||||
t_u8 rsvrd2:1;
|
||||
/** Capability Bit Map : DSS OFDM */
|
||||
t_u8 dsss_ofdm:1;
|
||||
/** Capability Bit Map : Reserved */
|
||||
t_u8 rsrvd1:2;
|
||||
} __ATTRIB_PACK__ IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
|
||||
/** IEEE IE header */
|
||||
typedef struct _IEEEtypes_Header_t {
|
||||
/** Element ID */
|
||||
t_u8 element_id;
|
||||
/** Length */
|
||||
t_u8 len;
|
||||
} __ATTRIB_PACK__ IEEEtypes_Header_t, *pIEEEtypes_Header_t;
|
||||
|
||||
/** IEEE IE header */
|
||||
#define IEEE_HEADER_LEN sizeof(IEEEtypes_Header_t)
|
||||
|
||||
/** Vendor specific IE header */
|
||||
typedef struct _IEEEtypes_VendorHeader_t {
|
||||
/** Element ID */
|
||||
t_u8 element_id;
|
||||
/** Length */
|
||||
t_u8 len;
|
||||
/** OUI */
|
||||
t_u8 oui[3];
|
||||
/** OUI type */
|
||||
t_u8 oui_type;
|
||||
/** OUI subtype */
|
||||
t_u8 oui_subtype;
|
||||
/** Version */
|
||||
t_u8 version;
|
||||
} __ATTRIB_PACK__ IEEEtypes_VendorHeader_t, *pIEEEtypes_VendorHeader_t;
|
||||
|
||||
/** Vendor specific IE */
|
||||
typedef struct _IEEEtypes_VendorSpecific_t {
|
||||
/** Vendor specific IE header */
|
||||
IEEEtypes_VendorHeader_t vend_hdr;
|
||||
/** IE Max - size of previous fields */
|
||||
t_u8 data[IEEE_MAX_IE_SIZE - sizeof(IEEEtypes_VendorHeader_t)];
|
||||
} __ATTRIB_PACK__ IEEEtypes_VendorSpecific_t, *pIEEEtypes_VendorSpecific_t;
|
||||
|
||||
/** IEEE IE */
|
||||
typedef struct _IEEEtypes_Generic_t {
|
||||
/** Generic IE header */
|
||||
IEEEtypes_Header_t ieee_hdr;
|
||||
/** IE Max - size of previous fields */
|
||||
t_u8 data[IEEE_MAX_IE_SIZE - sizeof(IEEEtypes_Header_t)];
|
||||
} __ATTRIB_PACK__ IEEEtypes_Generic_t, *pIEEEtypes_Generic_t;
|
||||
|
||||
/** Size of a TSPEC. Used to allocate necessary buffer space in commands */
|
||||
#define WMM_TSPEC_SIZE 63
|
||||
|
||||
/** Maximum number of AC QOS queues available in the driver/firmware */
|
||||
#define MAX_AC_QUEUES 4
|
||||
|
||||
/** Maximum number of User Priorities */
|
||||
#define MAX_USER_PRIORITIES 8
|
||||
|
||||
/** Extra IE bytes allocated in messages for appended IEs after a TSPEC */
|
||||
#define WMM_ADDTS_EXTRA_IE_BYTES 256
|
||||
|
||||
/**
|
||||
* @brief Enumeration for the command result from an ADDTS or DELTS command
|
||||
*/
|
||||
typedef enum {
|
||||
TSPEC_RESULT_SUCCESS = 0,
|
||||
TSPEC_RESULT_EXEC_FAILURE = 1,
|
||||
TSPEC_RESULT_TIMEOUT = 2,
|
||||
TSPEC_RESULT_DATA_INVALID = 3,
|
||||
} __ATTRIB_PACK__ mlan_wmm_tspec_result_e;
|
||||
|
||||
/**
|
||||
* @brief Enumeration for the action field in the Queue configure command
|
||||
*/
|
||||
typedef enum {
|
||||
WMM_QUEUE_CONFIG_ACTION_GET = 0,
|
||||
WMM_QUEUE_CONFIG_ACTION_SET = 1,
|
||||
WMM_QUEUE_CONFIG_ACTION_DEFAULT = 2,
|
||||
|
||||
WMM_QUEUE_CONFIG_ACTION_MAX
|
||||
} __ATTRIB_PACK__ mlan_wmm_queue_config_action_e;
|
||||
|
||||
/**
|
||||
* @brief Enumeration for the action field in the queue stats command
|
||||
*/
|
||||
typedef enum {
|
||||
WMM_STATS_ACTION_START = 0,
|
||||
WMM_STATS_ACTION_STOP = 1,
|
||||
WMM_STATS_ACTION_GET_CLR = 2,
|
||||
WMM_STATS_ACTION_SET_CFG = 3, /* Not currently used */
|
||||
WMM_STATS_ACTION_GET_CFG = 4, /* Not currently used */
|
||||
|
||||
WMM_STATS_ACTION_MAX
|
||||
} __ATTRIB_PACK__ mlan_wmm_stats_action_e;
|
||||
|
||||
/** Data structure of WMM QoS information */
|
||||
typedef struct _IEEEtypes_WmmQosInfo_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** QoS UAPSD */
|
||||
t_u8 qos_uapsd:1;
|
||||
/** Reserved */
|
||||
t_u8 reserved:3;
|
||||
/** Parameter set count */
|
||||
t_u8 para_set_count:4;
|
||||
#else
|
||||
/** Parameter set count */
|
||||
t_u8 para_set_count:4;
|
||||
/** Reserved */
|
||||
t_u8 reserved:3;
|
||||
/** QoS UAPSD */
|
||||
t_u8 qos_uapsd:1;
|
||||
#endif
|
||||
} __ATTRIB_PACK__ IEEEtypes_WmmQosInfo_t, *pIEEEtypes_WmmQosInfo_t;
|
||||
|
||||
/** Data structure of WMM Aci/Aifsn */
|
||||
typedef struct _IEEEtypes_WmmAciAifsn_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Reserved */
|
||||
t_u8 reserved:1;
|
||||
/** Aci */
|
||||
t_u8 aci:2;
|
||||
/** Acm */
|
||||
t_u8 acm:1;
|
||||
/** Aifsn */
|
||||
t_u8 aifsn:4;
|
||||
#else
|
||||
/** Aifsn */
|
||||
t_u8 aifsn:4;
|
||||
/** Acm */
|
||||
t_u8 acm:1;
|
||||
/** Aci */
|
||||
t_u8 aci:2;
|
||||
/** Reserved */
|
||||
t_u8 reserved:1;
|
||||
#endif
|
||||
} __ATTRIB_PACK__ IEEEtypes_WmmAciAifsn_t, *pIEEEtypes_WmmAciAifsn_t;
|
||||
|
||||
/** Data structure of WMM ECW */
|
||||
typedef struct _IEEEtypes_WmmEcw_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Maximum Ecw */
|
||||
t_u8 ecw_max:4;
|
||||
/** Minimum Ecw */
|
||||
t_u8 ecw_min:4;
|
||||
#else
|
||||
/** Minimum Ecw */
|
||||
t_u8 ecw_min:4;
|
||||
/** Maximum Ecw */
|
||||
t_u8 ecw_max:4;
|
||||
#endif
|
||||
} __ATTRIB_PACK__ IEEEtypes_WmmEcw_t, *pIEEEtypes_WmmEcw_t;
|
||||
|
||||
/** Data structure of WMM AC parameters */
|
||||
typedef struct _IEEEtypes_WmmAcParameters_t {
|
||||
IEEEtypes_WmmAciAifsn_t aci_aifsn; /**< AciAifSn */
|
||||
IEEEtypes_WmmEcw_t ecw; /**< Ecw */
|
||||
t_u16 tx_op_limit; /**< Tx op limit */
|
||||
} __ATTRIB_PACK__ IEEEtypes_WmmAcParameters_t, *pIEEEtypes_WmmAcParameters_t;
|
||||
|
||||
/** Data structure of WMM Info IE */
|
||||
typedef struct _IEEEtypes_WmmInfo_t {
|
||||
|
||||
/**
|
||||
* WMM Info IE - Vendor Specific Header:
|
||||
* element_id [221/0xdd]
|
||||
* Len [7]
|
||||
* Oui [00:50:f2]
|
||||
* OuiType [2]
|
||||
* OuiSubType [0]
|
||||
* Version [1]
|
||||
*/
|
||||
IEEEtypes_VendorHeader_t vend_hdr;
|
||||
|
||||
/** QoS information */
|
||||
IEEEtypes_WmmQosInfo_t qos_info;
|
||||
|
||||
} __ATTRIB_PACK__ IEEEtypes_WmmInfo_t, *pIEEEtypes_WmmInfo_t;
|
||||
|
||||
/** Data structure of WMM parameter IE */
|
||||
typedef struct _IEEEtypes_WmmParameter_t {
|
||||
/**
|
||||
* WMM Parameter IE - Vendor Specific Header:
|
||||
* element_id [221/0xdd]
|
||||
* Len [24]
|
||||
* Oui [00:50:f2]
|
||||
* OuiType [2]
|
||||
* OuiSubType [1]
|
||||
* Version [1]
|
||||
*/
|
||||
IEEEtypes_VendorHeader_t vend_hdr;
|
||||
|
||||
/** QoS information */
|
||||
IEEEtypes_WmmQosInfo_t qos_info;
|
||||
/** Reserved */
|
||||
t_u8 reserved;
|
||||
|
||||
/** AC Parameters Record WMM_AC_BE, WMM_AC_BK, WMM_AC_VI, WMM_AC_VO */
|
||||
IEEEtypes_WmmAcParameters_t ac_params[MAX_AC_QUEUES];
|
||||
|
||||
} __ATTRIB_PACK__ IEEEtypes_WmmParameter_t, *pIEEEtypes_WmmParameter_t;
|
||||
|
||||
/**
|
||||
* @brief IOCTL structure to send an ADDTS request and retrieve the response.
|
||||
*
|
||||
* IOCTL structure from the application layer relayed to firmware to
|
||||
* instigate an ADDTS management frame with an appropriate TSPEC IE as well
|
||||
* as any additional IEs appended in the ADDTS Action frame.
|
||||
*
|
||||
* @sa wlan_wmm_addts_req_ioctl
|
||||
*/
|
||||
typedef struct {
|
||||
mlan_wmm_tspec_result_e commandResult;
|
||||
/**< Firmware execution result */
|
||||
|
||||
t_u32 timeout_ms; /**< Timeout value in milliseconds */
|
||||
t_u8 ieeeStatusCode; /**< IEEE status code */
|
||||
|
||||
t_u32 ieDataLen;
|
||||
t_u8 ieData[WMM_TSPEC_SIZE
|
||||
/**< TSPEC to send in the ADDTS */
|
||||
+ WMM_ADDTS_EXTRA_IE_BYTES];
|
||||
/**< ADDTS extra IE buf */
|
||||
} wlan_ioctl_wmm_addts_req_t;
|
||||
|
||||
/**
|
||||
* @brief IOCTL structure to send a DELTS request.
|
||||
*
|
||||
* IOCTL structure from the application layer relayed to firmware to
|
||||
* instigate an DELTS management frame with an appropriate TSPEC IE.
|
||||
*
|
||||
* @sa wlan_wmm_delts_req_ioctl
|
||||
*/
|
||||
typedef struct {
|
||||
mlan_wmm_tspec_result_e commandResult;
|
||||
/**< Firmware execution result */
|
||||
t_u8 ieeeReasonCode; /**< IEEE reason code sent, unused for WMM */
|
||||
|
||||
t_u32 ieDataLen;
|
||||
t_u8 ieData[WMM_TSPEC_SIZE];
|
||||
/**< TSPEC to send in the DELTS */
|
||||
} wlan_ioctl_wmm_delts_req_t;
|
||||
|
||||
/**
|
||||
* @brief IOCTL structure to configure a specific AC Queue's parameters
|
||||
*
|
||||
* IOCTL structure from the application layer relayed to firmware to
|
||||
* get, set, or default the WMM AC queue parameters.
|
||||
*
|
||||
* - msduLifetimeExpiry is ignored if set to 0 on a set command
|
||||
*
|
||||
* @sa wlan_wmm_queue_config_ioctl
|
||||
*/
|
||||
typedef struct {
|
||||
mlan_wmm_queue_config_action_e action;
|
||||
/**< Set, Get, or Default */
|
||||
mlan_wmm_ac_e accessCategory; /**< WMM_AC_BK(0) to WMM_AC_VO(3) */
|
||||
t_u16 msduLifetimeExpiry; /**< lifetime expiry in TUs */
|
||||
t_u8 supportedRates[10]; /**< Not supported yet */
|
||||
} wlan_ioctl_wmm_queue_config_t;
|
||||
|
||||
/** Number of bins in the histogram for the HostCmd_DS_WMM_QUEUE_STATS */
|
||||
#define WMM_STATS_PKTS_HIST_BINS 7
|
||||
|
||||
/**
|
||||
* @brief IOCTL structure to start, stop, and get statistics for a WMM AC
|
||||
*
|
||||
* IOCTL structure from the application layer relayed to firmware to
|
||||
* start or stop statistical collection for a given AC. Also used to
|
||||
* retrieve and clear the collected stats on a given AC.
|
||||
*
|
||||
* @sa wlan_wmm_queue_stats_ioctl
|
||||
*/
|
||||
typedef struct {
|
||||
mlan_wmm_stats_action_e action;
|
||||
/**< Start, Stop, or Get */
|
||||
t_u8 userPriority;
|
||||
/**< User Priority (0 to 7) */
|
||||
t_u16 pktCount; /**< Number of successful packets transmitted */
|
||||
t_u16 pktLoss; /**< Packets lost; not included in pktCount */
|
||||
t_u32 avgQueueDelay;
|
||||
/**< Average Queue delay in microseconds */
|
||||
t_u32 avgTxDelay;/**< Average Transmission delay in microseconds */
|
||||
t_u16 usedTime; /**< Calculated used time - units of 32 microsec */
|
||||
t_u16 policedTime;
|
||||
/**< Calculated policed time - units of 32 microsec */
|
||||
|
||||
/** @brief Queue Delay Histogram; number of packets per queue delay range
|
||||
*
|
||||
* [0] - 0ms <= delay < 5ms
|
||||
* [1] - 5ms <= delay < 10ms
|
||||
* [2] - 10ms <= delay < 20ms
|
||||
* [3] - 20ms <= delay < 30ms
|
||||
* [4] - 30ms <= delay < 40ms
|
||||
* [5] - 40ms <= delay < 50ms
|
||||
* [6] - 50ms <= delay < msduLifetime (TUs)
|
||||
*/
|
||||
t_u16 delayHistogram[WMM_STATS_PKTS_HIST_BINS];
|
||||
} wlan_ioctl_wmm_queue_stats_t;
|
||||
|
||||
/**
|
||||
* @brief IOCTL and command sub structure for a Traffic stream status.
|
||||
*/
|
||||
typedef struct {
|
||||
t_u8 tid; /**< TSID: Range: 0->7 */
|
||||
t_u8 valid; /**< TSID specified is valid */
|
||||
t_u8 accessCategory;/**< AC TSID is active on */
|
||||
t_u8 userPriority; /**< UP specified for the TSID */
|
||||
|
||||
t_u8 psb; /**< Power save mode for TSID: 0 (legacy), 1 (UAPSD) */
|
||||
t_u8 flowDir; /**< Upstream (0), Downlink(1), Bidirectional(3) */
|
||||
t_u16 mediumTime; /**< Medium time granted for the TSID */
|
||||
} __ATTRIB_PACK__ HostCmd_DS_WMM_TS_STATUS,
|
||||
wlan_ioctl_wmm_ts_status_t, wlan_cmd_wmm_ts_status_t;
|
||||
|
||||
/**
|
||||
* @brief IOCTL sub structure for a specific WMM AC Status
|
||||
*/
|
||||
typedef struct {
|
||||
/** WMM Acm */
|
||||
t_u8 wmmAcm;
|
||||
/** Flow required flag */
|
||||
t_u8 flowRequired;
|
||||
/** Flow created flag */
|
||||
t_u8 flowCreated;
|
||||
/** Disabled flag */
|
||||
t_u8 disabled;
|
||||
/** delivery enabled */
|
||||
t_u8 deliveryEnabled;
|
||||
/** trigger enabled */
|
||||
t_u8 triggerEnabled;
|
||||
} wlan_ioctl_wmm_queue_status_ac_t;
|
||||
|
||||
/**
|
||||
* @brief IOCTL structure to retrieve the WMM AC Queue status
|
||||
*
|
||||
* IOCTL structure from the application layer to retrieve:
|
||||
* - ACM bit setting for the AC
|
||||
* - Firmware status (flow required, flow created, flow disabled)
|
||||
*
|
||||
* @sa wlan_wmm_queue_status_ioctl
|
||||
*/
|
||||
typedef struct {
|
||||
/** WMM AC queue status */
|
||||
wlan_ioctl_wmm_queue_status_ac_t acStatus[MAX_AC_QUEUES];
|
||||
} wlan_ioctl_wmm_queue_status_t;
|
||||
|
||||
typedef struct _wlan_get_scan_table_fixed {
|
||||
/** BSSID of this network */
|
||||
t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
|
||||
/** Channel this beacon/probe response was detected */
|
||||
t_u8 channel;
|
||||
/** RSSI for the received packet */
|
||||
t_u8 rssi;
|
||||
/** TSF value from the firmware at packet reception */
|
||||
t_u64 network_tsf;
|
||||
} wlan_get_scan_table_fixed;
|
||||
|
||||
/**
|
||||
* Structure passed in the wlan_ioctl_get_scan_table_info for each
|
||||
* BSS returned in the WLAN_GET_SCAN_RESP IOCTL
|
||||
*/
|
||||
typedef struct _wlan_ioctl_get_scan_table_entry {
|
||||
/**
|
||||
* Fixed field length included in the response.
|
||||
*
|
||||
* Length value is included so future fixed fields can be added to the
|
||||
* response without breaking backwards compatibility. Use the length
|
||||
* to find the offset for the bssInfoLength field, not a sizeof() calc.
|
||||
*/
|
||||
t_u32 fixed_field_length;
|
||||
|
||||
/**
|
||||
* Length of the BSS Information (probe resp or beacon) that
|
||||
* follows after the fixed_field_length
|
||||
*/
|
||||
t_u32 bss_info_length;
|
||||
|
||||
/**
|
||||
* Always present, fixed length data fields for the BSS
|
||||
*/
|
||||
wlan_get_scan_table_fixed fixed_fields;
|
||||
|
||||
/*
|
||||
* Probe response or beacon scanned for the BSS.
|
||||
*
|
||||
* Field layout:
|
||||
* - TSF 8 octets
|
||||
* - Beacon Interval 2 octets
|
||||
* - Capability Info 2 octets
|
||||
*
|
||||
* - IEEE Infomation Elements; variable number & length per 802.11 spec
|
||||
*/
|
||||
/* t_u8 bss_info_buffer[1]; */
|
||||
} wlan_ioctl_get_scan_table_entry;
|
||||
|
||||
/**
|
||||
* Structure to store BSS info (probe resp or beacon) & IEEE IE info for each
|
||||
* BSS returned in WLAN_GET_SCAN_RESP IOCTL
|
||||
*/
|
||||
typedef struct _wlan_ioctl_get_bss_info {
|
||||
/**
|
||||
* Length of the BSS Information (probe resp or beacon) that
|
||||
* follows after the fixed_field
|
||||
*/
|
||||
t_u32 bss_info_length;
|
||||
|
||||
/**
|
||||
* Probe response or beacon scanned for the BSS.
|
||||
*
|
||||
* Field layout:
|
||||
*/
|
||||
/** TSF 8 octets */
|
||||
t_u8 tsf[8];
|
||||
/** Beacon Interval 2 octets */
|
||||
t_u16 beacon_interval;
|
||||
/** Capability Info 2 octets */
|
||||
IEEEtypes_CapInfo_t cap_info;
|
||||
|
||||
/**
|
||||
* IEEE Infomation Elements; variable number & length per 802.11 spec
|
||||
*/
|
||||
/** SSID */
|
||||
char ssid[MRVDRV_MAX_SSID_LENGTH + 1];
|
||||
/** SSID Length */
|
||||
t_u32 ssid_len;
|
||||
/** WMM Capability */
|
||||
char wmm_cap;
|
||||
/** WPS Capability */
|
||||
char wps_cap;
|
||||
/** Privacy Capability - WEP/WPA/RSN */
|
||||
char priv_cap;
|
||||
/** HT (11N) Capability */
|
||||
char ht_cap;
|
||||
/** VHT (11AC) Capability */
|
||||
char vht_cap[2];
|
||||
/* 802.11k Capability */
|
||||
char dot11k_cap;
|
||||
/** 802.11r Capability */
|
||||
char dot11r_cap;
|
||||
} wlan_ioctl_get_bss_info;
|
||||
|
||||
/**
|
||||
* Structure to save of scan table info for each BSS returned
|
||||
* in WLAN_GET_SCAN_RESP IOCTL
|
||||
*/
|
||||
struct wlan_ioctl_get_scan_list {
|
||||
/** fixed info */
|
||||
wlan_ioctl_get_scan_table_entry fixed_buf;
|
||||
/** variable info - BSS info (probe resp or beacon) & IEEE IE info */
|
||||
wlan_ioctl_get_bss_info bss_info_buf;
|
||||
/** pointer to next node in list */
|
||||
struct wlan_ioctl_get_scan_list *next;
|
||||
};
|
||||
|
||||
/**
|
||||
* Sructure to retrieve the scan table
|
||||
*/
|
||||
typedef struct {
|
||||
/**
|
||||
* - Zero based scan entry to start retrieval in command request
|
||||
* - Number of scans entries returned in command response
|
||||
*/
|
||||
t_u32 scan_number;
|
||||
/**
|
||||
* Buffer marker for multiple wlan_ioctl_get_scan_table_entry structures.
|
||||
* Each struct is padded to the nearest 32 bit boundary.
|
||||
*/
|
||||
t_u8 scan_table_entry_buf[1];
|
||||
|
||||
} wlan_ioctl_get_scan_table_info;
|
||||
|
||||
typedef struct {
|
||||
t_u8 chan_number;
|
||||
/**< Channel Number to scan */
|
||||
t_u8 radio_type;
|
||||
/**< Radio type: 'B/G' Band = 0, 'A' Band = 1 */
|
||||
t_u8 scan_type;/**< Scan type: Active = 1, Passive = 2 */
|
||||
t_u8 reserved;/**< Reserved */
|
||||
t_u32 scan_time;
|
||||
/**< Scan duration in milliseconds; if 0 default used */
|
||||
} __ATTRIB_PACK__ wlan_ioctl_user_scan_chan;
|
||||
|
||||
typedef struct {
|
||||
char ssid[MRVDRV_MAX_SSID_LENGTH + 1];
|
||||
/**< SSID */
|
||||
t_u8 max_len; /**< Maximum length of SSID */
|
||||
} __ATTRIB_PACK__ wlan_ioctl_user_scan_ssid;
|
||||
|
||||
typedef struct {
|
||||
|
||||
/** Flag set to keep the previous scan table intact */
|
||||
t_u8 keep_previous_scan; /* Do not erase the existing scan results */
|
||||
|
||||
/** BSS mode to be sent in the firmware command */
|
||||
t_u8 bss_mode;
|
||||
|
||||
/** Configure the number of probe requests for active chan scans */
|
||||
t_u8 num_probes;
|
||||
|
||||
/** Reserved */
|
||||
t_u8 reserved;
|
||||
|
||||
/** BSSID filter sent in the firmware command to limit the results */
|
||||
t_u8 specific_bssid[ETH_ALEN];
|
||||
|
||||
/** SSID filter list used in the to limit the scan results */
|
||||
wlan_ioctl_user_scan_ssid ssid_list[MRVDRV_MAX_SSID_LIST_LENGTH];
|
||||
|
||||
/** Variable number (fixed maximum) of channels to scan up */
|
||||
wlan_ioctl_user_scan_chan chan_list[WLAN_IOCTL_USER_SCAN_CHAN_MAX];
|
||||
|
||||
} __ATTRIB_PACK__ wlan_ioctl_user_scan_cfg;
|
||||
|
||||
#ifdef SDIO
|
||||
int process_sdcmd52rw(int argc, char *argv[]);
|
||||
int process_sdcmd53rw(int argc, char *argv[]);
|
||||
#endif
|
||||
int process_setuserscan(int argc, char *argv[]);
|
||||
int process_getscantable(int argc, char *argv[]);
|
||||
int process_getscantable_idx(wlan_ioctl_get_scan_table_info *prsp_info_req);
|
||||
|
||||
#endif /* _MLANMISC_H_ */
|
|
@ -31,7 +31,6 @@ HEADERS = mlanutl.h
|
|||
|
||||
|
||||
|
||||
|
||||
exectarget=mlanutl
|
||||
TARGET := $(exectarget)
|
||||
|
||||
|
|
|
@ -1,895 +0,0 @@
|
|||
/** @file mlanhostcmd.c
|
||||
*
|
||||
* @brief This file contains mlanutl helper functions
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
11/26/2008: initial version
|
||||
************************************************************************/
|
||||
|
||||
#include "mlanhostcmd.h"
|
||||
|
||||
#ifndef MIN
|
||||
/** Find minimum value */
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif /* MIN */
|
||||
|
||||
/********************************************************
|
||||
Local Variables
|
||||
********************************************************/
|
||||
|
||||
/********************************************************
|
||||
Global Variables
|
||||
********************************************************/
|
||||
|
||||
/********************************************************
|
||||
Local Functions
|
||||
********************************************************/
|
||||
/**
|
||||
* @brief get hostcmd data
|
||||
*
|
||||
* @param ln A pointer to line number
|
||||
* @param buf A pointer to hostcmd data
|
||||
* @param size A pointer to the return size of hostcmd buffer
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
static int
|
||||
mlan_get_hostcmd_data(FILE * fp, int *ln, t_u8 *buf, t_u16 *size)
|
||||
{
|
||||
t_s32 errors = 0, i;
|
||||
t_s8 line[512], *pos, *pos1, *pos2, *pos3;
|
||||
t_u16 len;
|
||||
|
||||
while ((pos = mlan_config_get_line(fp, line, sizeof(line), ln))) {
|
||||
(*ln)++;
|
||||
if (strcmp(pos, "}") == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
pos1 = strchr(pos, ':');
|
||||
if (pos1 == NULL) {
|
||||
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
|
||||
pos);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
*pos1++ = '\0';
|
||||
|
||||
pos2 = strchr(pos1, '=');
|
||||
if (pos2 == NULL) {
|
||||
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
|
||||
pos);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
*pos2++ = '\0';
|
||||
|
||||
len = a2hex_or_atoi(pos1);
|
||||
if (len < 1 || len > MRVDRV_SIZE_OF_CMD_BUFFER) {
|
||||
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
|
||||
pos);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
|
||||
*size += len;
|
||||
|
||||
if (*pos2 == '"') {
|
||||
pos2++;
|
||||
pos3 = strchr(pos2, '"');
|
||||
if (pos3 == NULL) {
|
||||
printf("Line %d: invalid quotation '%s'\n", *ln,
|
||||
pos);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
*pos3 = '\0';
|
||||
memset(buf, 0, len);
|
||||
memmove(buf, pos2, MIN(strlen(pos2), len));
|
||||
buf += len;
|
||||
} else if (*pos2 == '\'') {
|
||||
pos2++;
|
||||
pos3 = strchr(pos2, '\'');
|
||||
if (pos3 == NULL) {
|
||||
printf("Line %d: invalid quotation '%s'\n", *ln,
|
||||
pos);
|
||||
errors++;
|
||||
continue;
|
||||
}
|
||||
*pos3 = ',';
|
||||
for (i = 0; i < len; i++) {
|
||||
pos3 = strchr(pos2, ',');
|
||||
if (pos3 != NULL) {
|
||||
*pos3 = '\0';
|
||||
*buf++ = (t_u8)a2hex_or_atoi(pos2);
|
||||
pos2 = pos3 + 1;
|
||||
} else
|
||||
*buf++ = 0;
|
||||
}
|
||||
} else if (*pos2 == '{') {
|
||||
t_u16 tlvlen = 0, tmp_tlvlen;
|
||||
mlan_get_hostcmd_data(fp, ln, buf + len, &tlvlen);
|
||||
tmp_tlvlen = tlvlen;
|
||||
while (len--) {
|
||||
*buf++ = (t_u8)(tmp_tlvlen & 0xff);
|
||||
tmp_tlvlen >>= 8;
|
||||
}
|
||||
*size += tlvlen;
|
||||
buf += tlvlen;
|
||||
} else {
|
||||
t_u32 value = a2hex_or_atoi(pos2);
|
||||
while (len--) {
|
||||
*buf++ = (t_u8)(value & 0xff);
|
||||
value >>= 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/********************************************************
|
||||
Global Functions
|
||||
********************************************************/
|
||||
/**
|
||||
* @brief convert char to hex integer
|
||||
*
|
||||
* @param chr char to convert
|
||||
* @return hex integer or 0
|
||||
*/
|
||||
int
|
||||
hexval(t_s32 chr)
|
||||
{
|
||||
if (chr >= '0' && chr <= '9')
|
||||
return chr - '0';
|
||||
if (chr >= 'A' && chr <= 'F')
|
||||
return chr - 'A' + 10;
|
||||
if (chr >= 'a' && chr <= 'f')
|
||||
return chr - 'a' + 10;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Hump hex data
|
||||
*
|
||||
* @param prompt A pointer prompt buffer
|
||||
* @param p A pointer to data buffer
|
||||
* @param len the len of data buffer
|
||||
* @param delim delim char
|
||||
* @return hex integer
|
||||
*/
|
||||
t_void
|
||||
hexdump(t_s8 *prompt, t_void *p, t_s32 len, t_s8 delim)
|
||||
{
|
||||
t_s32 i;
|
||||
t_u8 *s = p;
|
||||
|
||||
if (prompt) {
|
||||
printf("%s: len=%d\n", prompt, (int)len);
|
||||
}
|
||||
for (i = 0; i < len; i++) {
|
||||
if (i != len - 1)
|
||||
printf("%02x%c", *s++, delim);
|
||||
else
|
||||
printf("%02x\n", *s);
|
||||
if ((i + 1) % 16 == 0)
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief convert char to hex integer
|
||||
*
|
||||
* @param chr char
|
||||
* @return hex integer
|
||||
*/
|
||||
t_u8
|
||||
hexc2bin(t_s8 chr)
|
||||
{
|
||||
if (chr >= '0' && chr <= '9')
|
||||
chr -= '0';
|
||||
else if (chr >= 'A' && chr <= 'F')
|
||||
chr -= ('A' - 10);
|
||||
else if (chr >= 'a' && chr <= 'f')
|
||||
chr -= ('a' - 10);
|
||||
|
||||
return chr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief convert string to hex integer
|
||||
*
|
||||
* @param s A pointer string buffer
|
||||
* @return hex integer
|
||||
*/
|
||||
t_u32
|
||||
a2hex(t_s8 *s)
|
||||
{
|
||||
t_u32 val = 0;
|
||||
|
||||
if (!strncasecmp("0x", s, 2)) {
|
||||
s += 2;
|
||||
}
|
||||
|
||||
while (*s && isxdigit(*s)) {
|
||||
val = (val << 4) + hexc2bin(*s++);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief convert String to integer
|
||||
*
|
||||
* @param value A pointer to string
|
||||
* @return integer
|
||||
*/
|
||||
t_u32
|
||||
a2hex_or_atoi(t_s8 *value)
|
||||
{
|
||||
if (value[0] == '0' && (value[1] == 'X' || value[1] == 'x')) {
|
||||
return a2hex(value + 2);
|
||||
} else if (isdigit(*value)) {
|
||||
return atoi(value);
|
||||
} else {
|
||||
return *value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief convert string to hex
|
||||
*
|
||||
* @param ptr A pointer to data buffer
|
||||
* @param chr A pointer to return integer
|
||||
* @return A pointer to next data field
|
||||
*/
|
||||
t_s8 *
|
||||
convert2hex(t_s8 *ptr, t_u8 *chr)
|
||||
{
|
||||
t_u8 val;
|
||||
|
||||
for (val = 0; *ptr && isxdigit(*ptr); ptr++) {
|
||||
val = (val * 16) + hexval(*ptr);
|
||||
}
|
||||
|
||||
*chr = val;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check the Hex String
|
||||
* @param s A pointer to the string
|
||||
* @return MLAN_STATUS_SUCCESS --HexString, MLAN_STATUS_FAILURE --not HexString
|
||||
*/
|
||||
int
|
||||
ishexstring(t_s8 *s)
|
||||
{
|
||||
int ret = MLAN_STATUS_FAILURE;
|
||||
t_s32 tmp;
|
||||
|
||||
if (!strncasecmp("0x", s, 2)) {
|
||||
s += 2;
|
||||
}
|
||||
while (*s) {
|
||||
tmp = toupper(*s);
|
||||
if (((tmp >= 'A') && (tmp <= 'F')) ||
|
||||
((tmp >= '0') && (tmp <= '9'))) {
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
} else {
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
break;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert String to Integer
|
||||
* @param buf A pointer to the string
|
||||
* @return Integer
|
||||
*/
|
||||
int
|
||||
atoval(t_s8 *buf)
|
||||
{
|
||||
if (!strncasecmp(buf, "0x", 2))
|
||||
return a2hex(buf + 2);
|
||||
else if (!ishexstring(buf))
|
||||
return a2hex(buf);
|
||||
else
|
||||
return atoi(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Prepare host-command buffer
|
||||
* @param fp File handler
|
||||
* @param cmd_name Command name
|
||||
* @param buf A pointer to comand buffer
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
int
|
||||
prepare_host_cmd_buffer(FILE * fp, char *cmd_name, t_u8 *buf)
|
||||
{
|
||||
t_s8 line[256], cmdname[256], *pos, cmdcode[10];
|
||||
HostCmd_DS_GEN *hostcmd;
|
||||
int ln = 0;
|
||||
int cmdname_found = 0, cmdcode_found = 0;
|
||||
|
||||
memset(buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
|
||||
hostcmd = (HostCmd_DS_GEN *)buf;
|
||||
hostcmd->command = 0xffff;
|
||||
|
||||
snprintf(cmdname, sizeof(cmdname), "%s={", cmd_name);
|
||||
cmdname_found = 0;
|
||||
while ((pos = mlan_config_get_line(fp, line, sizeof(line), &ln))) {
|
||||
if (strcmp(pos, cmdname) == 0) {
|
||||
t_u16 len = 0;
|
||||
cmdname_found = 1;
|
||||
snprintf(cmdcode, sizeof(cmdcode), "CmdCode=");
|
||||
cmdcode_found = 0;
|
||||
while ((pos =
|
||||
mlan_config_get_line(fp, line, sizeof(line),
|
||||
&ln))) {
|
||||
if (strncmp(pos, cmdcode, strlen(cmdcode)) == 0) {
|
||||
cmdcode_found = 1;
|
||||
hostcmd->command =
|
||||
a2hex_or_atoi(pos +
|
||||
strlen(cmdcode));
|
||||
hostcmd->size = S_DS_GEN;
|
||||
mlan_get_hostcmd_data(fp, &ln,
|
||||
buf +
|
||||
hostcmd->size,
|
||||
&len);
|
||||
hostcmd->size += len;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!cmdcode_found) {
|
||||
fprintf(stderr,
|
||||
"mlanutl: CmdCode not found in conf file\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cmdname_found) {
|
||||
fprintf(stderr,
|
||||
"mlanutl: cmdname '%s' is not found in conf file\n",
|
||||
cmd_name);
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
hostcmd->command = cpu_to_le16(hostcmd->command);
|
||||
hostcmd->size = cpu_to_le16(hostcmd->size);
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/** Config data header length */
|
||||
#define CFG_DATA_HEADER_LEN 6
|
||||
|
||||
/**
|
||||
* @brief Prepare cfg-data buffer
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
* @param fp File handler
|
||||
* @param buf A pointer to comand buffer
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
int
|
||||
prepare_cfg_data_buffer(int argc, char *argv[], FILE * fp, t_u8 *buf)
|
||||
{
|
||||
int ln = 0, type;
|
||||
HostCmd_DS_GEN *hostcmd;
|
||||
HostCmd_DS_802_11_CFG_DATA *pcfg_data;
|
||||
|
||||
memset(buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
|
||||
hostcmd = (HostCmd_DS_GEN *)buf;
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_CFG_DATA);
|
||||
pcfg_data = (HostCmd_DS_802_11_CFG_DATA *)(buf + S_DS_GEN);
|
||||
pcfg_data->action =
|
||||
(argc == 4) ? HostCmd_ACT_GEN_GET : HostCmd_ACT_GEN_SET;
|
||||
type = atoi(argv[3]);
|
||||
if ((type < 1) || (type > 2)) {
|
||||
fprintf(stderr, "mlanutl: Invalid register type\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
} else {
|
||||
pcfg_data->type = type;
|
||||
}
|
||||
if (argc == 5) {
|
||||
ln = fparse_for_hex(fp, pcfg_data->data);
|
||||
}
|
||||
pcfg_data->data_len = ln;
|
||||
hostcmd->size =
|
||||
cpu_to_le16(pcfg_data->data_len + S_DS_GEN +
|
||||
CFG_DATA_HEADER_LEN);
|
||||
pcfg_data->data_len = cpu_to_le16(pcfg_data->data_len);
|
||||
pcfg_data->type = cpu_to_le16(pcfg_data->type);
|
||||
pcfg_data->action = cpu_to_le16(pcfg_data->action);
|
||||
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Process host_cmd response
|
||||
* @param buf A pointer to the response buffer
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
int
|
||||
process_host_cmd_resp(t_u8 *buf)
|
||||
{
|
||||
HostCmd_DS_GEN *hostcmd = (HostCmd_DS_GEN *)buf;
|
||||
int ret = MLAN_STATUS_SUCCESS;
|
||||
|
||||
hostcmd->command = le16_to_cpu(hostcmd->command);
|
||||
hostcmd->size = le16_to_cpu(hostcmd->size);
|
||||
hostcmd->seq_num = le16_to_cpu(hostcmd->seq_num);
|
||||
hostcmd->result = le16_to_cpu(hostcmd->result);
|
||||
|
||||
hostcmd->command &= ~HostCmd_RET_BIT;
|
||||
if (!hostcmd->result) {
|
||||
switch (hostcmd->command) {
|
||||
case HostCmd_CMD_CFG_DATA:
|
||||
{
|
||||
HostCmd_DS_802_11_CFG_DATA *pstcfgData =
|
||||
(HostCmd_DS_802_11_CFG_DATA *)(buf +
|
||||
S_DS_GEN);
|
||||
pstcfgData->data_len =
|
||||
le16_to_cpu(pstcfgData->data_len);
|
||||
pstcfgData->action =
|
||||
le16_to_cpu(pstcfgData->action);
|
||||
|
||||
if (pstcfgData->action == HostCmd_ACT_GEN_GET) {
|
||||
hexdump("cfgdata", pstcfgData->data,
|
||||
pstcfgData->data_len, ' ');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_802_11_TPC_ADAPT_REQ:
|
||||
{
|
||||
mlan_ioctl_11h_tpc_resp *tpcIoctlResp =
|
||||
(mlan_ioctl_11h_tpc_resp *)(buf +
|
||||
S_DS_GEN);
|
||||
if (tpcIoctlResp->status_code == 0) {
|
||||
printf("tpcrequest: txPower(%d), linkMargin(%d), rssi(%d)\n", tpcIoctlResp->tx_power, tpcIoctlResp->link_margin, tpcIoctlResp->rssi);
|
||||
} else {
|
||||
printf("tpcrequest: failure, status = %d\n", tpcIoctlResp->status_code);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_802_11_CRYPTO:
|
||||
{
|
||||
t_u16 alg =
|
||||
le16_to_cpu((t_u16)
|
||||
*(buf + S_DS_GEN +
|
||||
sizeof(t_u16)));
|
||||
if (alg != CIPHER_TEST_AES_CCM &&
|
||||
alg != CIPHER_TEST_GCMP) {
|
||||
HostCmd_DS_802_11_CRYPTO *cmd =
|
||||
(HostCmd_DS_802_11_CRYPTO *)(buf
|
||||
+
|
||||
S_DS_GEN);
|
||||
cmd->encdec = le16_to_cpu(cmd->encdec);
|
||||
cmd->algorithm =
|
||||
le16_to_cpu(cmd->algorithm);
|
||||
cmd->key_IV_length =
|
||||
le16_to_cpu(cmd->key_IV_length);
|
||||
cmd->key_length =
|
||||
le16_to_cpu(cmd->key_length);
|
||||
cmd->data.header.type =
|
||||
le16_to_cpu(cmd->data.header.
|
||||
type);
|
||||
cmd->data.header.len =
|
||||
le16_to_cpu(cmd->data.header.
|
||||
len);
|
||||
|
||||
printf("crypto_result: encdec=%d algorithm=%d,KeyIVLen=%d," " KeyLen=%d,dataLen=%d\n", cmd->encdec, cmd->algorithm, cmd->key_IV_length, cmd->key_length, cmd->data.header.len);
|
||||
hexdump("KeyIV", cmd->keyIV,
|
||||
cmd->key_IV_length, ' ');
|
||||
hexdump("Key", cmd->key,
|
||||
cmd->key_length, ' ');
|
||||
hexdump("Data", cmd->data.data,
|
||||
cmd->data.header.len, ' ');
|
||||
} else {
|
||||
HostCmd_DS_802_11_CRYPTO_AES_CCM
|
||||
*cmd_aes_ccm =
|
||||
(HostCmd_DS_802_11_CRYPTO_AES_CCM
|
||||
*)(buf + S_DS_GEN);
|
||||
|
||||
cmd_aes_ccm->encdec
|
||||
=
|
||||
le16_to_cpu(cmd_aes_ccm->
|
||||
encdec);
|
||||
cmd_aes_ccm->algorithm =
|
||||
le16_to_cpu(cmd_aes_ccm->
|
||||
algorithm);
|
||||
cmd_aes_ccm->key_length =
|
||||
le16_to_cpu(cmd_aes_ccm->
|
||||
key_length);
|
||||
cmd_aes_ccm->nonce_length =
|
||||
le16_to_cpu(cmd_aes_ccm->
|
||||
nonce_length);
|
||||
cmd_aes_ccm->AAD_length =
|
||||
le16_to_cpu(cmd_aes_ccm->
|
||||
AAD_length);
|
||||
cmd_aes_ccm->data.header.type =
|
||||
le16_to_cpu(cmd_aes_ccm->data.
|
||||
header.type);
|
||||
cmd_aes_ccm->data.header.len =
|
||||
le16_to_cpu(cmd_aes_ccm->data.
|
||||
header.len);
|
||||
|
||||
printf("crypto_result: encdec=%d algorithm=%d, KeyLen=%d," " NonceLen=%d,AADLen=%d,dataLen=%d\n", cmd_aes_ccm->encdec, cmd_aes_ccm->algorithm, cmd_aes_ccm->key_length, cmd_aes_ccm->nonce_length, cmd_aes_ccm->AAD_length, cmd_aes_ccm->data.header.len);
|
||||
|
||||
hexdump("Key", cmd_aes_ccm->key,
|
||||
cmd_aes_ccm->key_length, ' ');
|
||||
hexdump("Nonce", cmd_aes_ccm->nonce,
|
||||
cmd_aes_ccm->nonce_length, ' ');
|
||||
hexdump("AAD", cmd_aes_ccm->AAD,
|
||||
cmd_aes_ccm->AAD_length, ' ');
|
||||
hexdump("Data", cmd_aes_ccm->data.data,
|
||||
cmd_aes_ccm->data.header.len,
|
||||
' ');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_802_11_AUTO_TX:
|
||||
{
|
||||
HostCmd_DS_802_11_AUTO_TX *at =
|
||||
(HostCmd_DS_802_11_AUTO_TX *)(buf +
|
||||
S_DS_GEN);
|
||||
|
||||
if (le16_to_cpu(at->action) ==
|
||||
HostCmd_ACT_GEN_GET) {
|
||||
if (S_DS_GEN + sizeof(at->action) ==
|
||||
hostcmd->size) {
|
||||
printf("auto_tx not configured\n");
|
||||
|
||||
} else {
|
||||
MrvlIEtypesHeader_t *header =
|
||||
&at->auto_tx.header;
|
||||
|
||||
header->type =
|
||||
le16_to_cpu(header->
|
||||
type);
|
||||
header->len =
|
||||
le16_to_cpu(header->
|
||||
len);
|
||||
|
||||
if ((S_DS_GEN +
|
||||
sizeof(at->action)
|
||||
+
|
||||
sizeof(MrvlIEtypesHeader_t)
|
||||
+ header->len ==
|
||||
hostcmd->size) &&
|
||||
(header->type ==
|
||||
TLV_TYPE_AUTO_TX)) {
|
||||
|
||||
AutoTx_MacFrame_t *atmf
|
||||
=
|
||||
&at->auto_tx.
|
||||
auto_tx_mac_frame;
|
||||
|
||||
printf("Interval: %d second(s)\n", le16_to_cpu(atmf->interval));
|
||||
printf("Priority: %#x\n", atmf->priority);
|
||||
printf("Frame Length: %d\n", le16_to_cpu(atmf->frame_len));
|
||||
printf("Dest Mac Address: " "%02x:%02x:%02x:%02x:%02x:%02x\n", atmf->dest_mac_addr[0], atmf->dest_mac_addr[1], atmf->dest_mac_addr[2], atmf->dest_mac_addr[3], atmf->dest_mac_addr[4], atmf->dest_mac_addr[5]);
|
||||
printf("Src Mac Address: " "%02x:%02x:%02x:%02x:%02x:%02x\n", atmf->src_mac_addr[0], atmf->src_mac_addr[1], atmf->src_mac_addr[2], atmf->src_mac_addr[3], atmf->src_mac_addr[4], atmf->src_mac_addr[5]);
|
||||
|
||||
hexdump("Frame Payload",
|
||||
atmf->payload,
|
||||
le16_to_cpu
|
||||
(atmf->
|
||||
frame_len)
|
||||
-
|
||||
MLAN_MAC_ADDR_LENGTH
|
||||
* 2, ' ');
|
||||
} else {
|
||||
printf("incorrect auto_tx command response\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_802_11_SUBSCRIBE_EVENT:
|
||||
{
|
||||
HostCmd_DS_802_11_SUBSCRIBE_EVENT *se =
|
||||
(HostCmd_DS_802_11_SUBSCRIBE_EVENT
|
||||
*)(buf + S_DS_GEN);
|
||||
if (le16_to_cpu(se->action) ==
|
||||
HostCmd_ACT_GEN_GET) {
|
||||
int len =
|
||||
S_DS_GEN +
|
||||
sizeof
|
||||
(HostCmd_DS_802_11_SUBSCRIBE_EVENT);
|
||||
printf("\nEvent\t\tValue\tFreq\tsubscribed\n\n");
|
||||
while (len < hostcmd->size) {
|
||||
MrvlIEtypesHeader_t *header =
|
||||
(MrvlIEtypesHeader_t
|
||||
*)(buf + len);
|
||||
switch (le16_to_cpu
|
||||
(header->type)) {
|
||||
case TLV_TYPE_RSSI_LOW:
|
||||
{
|
||||
MrvlIEtypes_RssiThreshold_t
|
||||
*low_rssi
|
||||
=
|
||||
(MrvlIEtypes_RssiThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Beacon Low RSSI\t%d\t%d\t%s\n", low_rssi->RSSI_value, low_rssi->RSSI_freq, (le16_to_cpu(se->events) & 0x0001) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_SNR_LOW:
|
||||
{
|
||||
MrvlIEtypes_SnrThreshold_t
|
||||
*low_snr
|
||||
=
|
||||
(MrvlIEtypes_SnrThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Beacon Low SNR\t%d\t%d\t%s\n", low_snr->SNR_value, low_snr->SNR_freq, (le16_to_cpu(se->events) & 0x0002) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_FAILCOUNT:
|
||||
{
|
||||
MrvlIEtypes_FailureCount_t
|
||||
*failure_count
|
||||
=
|
||||
(MrvlIEtypes_FailureCount_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Failure Count\t%d\t%d\t%s\n", failure_count->fail_value, failure_count->fail_freq, (le16_to_cpu(se->events) & 0x0004) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_BCNMISS:
|
||||
{
|
||||
MrvlIEtypes_BeaconsMissed_t
|
||||
*bcn_missed
|
||||
=
|
||||
(MrvlIEtypes_BeaconsMissed_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Beacon Missed\t%d\tN/A\t%s\n", bcn_missed->beacon_missed, (le16_to_cpu(se->events) & 0x0008) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_RSSI_HIGH:
|
||||
{
|
||||
MrvlIEtypes_RssiThreshold_t
|
||||
*high_rssi
|
||||
=
|
||||
(MrvlIEtypes_RssiThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Bcn High RSSI\t%d\t%d\t%s\n", high_rssi->RSSI_value, high_rssi->RSSI_freq, (le16_to_cpu(se->events) & 0x0010) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
|
||||
case TLV_TYPE_SNR_HIGH:
|
||||
{
|
||||
MrvlIEtypes_SnrThreshold_t
|
||||
*high_snr
|
||||
=
|
||||
(MrvlIEtypes_SnrThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Beacon High SNR\t%d\t%d\t%s\n", high_snr->SNR_value, high_snr->SNR_freq, (le16_to_cpu(se->events) & 0x0020) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_RSSI_LOW_DATA:
|
||||
{
|
||||
MrvlIEtypes_RssiThreshold_t
|
||||
*low_rssi
|
||||
=
|
||||
(MrvlIEtypes_RssiThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Data Low RSSI\t%d\t%d\t%s\n", low_rssi->RSSI_value, low_rssi->RSSI_freq, (le16_to_cpu(se->events) & 0x0040) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_SNR_LOW_DATA:
|
||||
{
|
||||
MrvlIEtypes_SnrThreshold_t
|
||||
*low_snr
|
||||
=
|
||||
(MrvlIEtypes_SnrThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Data Low SNR\t%d\t%d\t%s\n", low_snr->SNR_value, low_snr->SNR_freq, (le16_to_cpu(se->events) & 0x0080) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_RSSI_HIGH_DATA:
|
||||
{
|
||||
MrvlIEtypes_RssiThreshold_t
|
||||
*high_rssi
|
||||
=
|
||||
(MrvlIEtypes_RssiThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Data High RSSI\t%d\t%d\t%s\n", high_rssi->RSSI_value, high_rssi->RSSI_freq, (le16_to_cpu(se->events) & 0x0100) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_SNR_HIGH_DATA:
|
||||
{
|
||||
MrvlIEtypes_SnrThreshold_t
|
||||
*high_snr
|
||||
=
|
||||
(MrvlIEtypes_SnrThreshold_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Data High SNR\t%d\t%d\t%s\n", high_snr->SNR_value, high_snr->SNR_freq, (le16_to_cpu(se->events) & 0x0200) ? "yes" : "no");
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_LINK_QUALITY:
|
||||
{
|
||||
MrvlIEtypes_LinkQuality_t
|
||||
*link_qual
|
||||
=
|
||||
(MrvlIEtypes_LinkQuality_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("Link Quality Parameters:\n");
|
||||
printf("------------------------\n");
|
||||
printf("Link Quality Event Subscribed\t%s\n", (le16_to_cpu(se->events) & 0x0400) ? "yes" : "no");
|
||||
printf("Link SNR Threshold = %d\n", le16_to_cpu(link_qual->link_SNR_thrs));
|
||||
printf("Link SNR Frequency = %d\n", le16_to_cpu(link_qual->link_SNR_freq));
|
||||
printf("Min Rate Value = %d\n", le16_to_cpu(link_qual->min_rate_val));
|
||||
printf("Min Rate Frequency = %d\n", le16_to_cpu(link_qual->min_rate_freq));
|
||||
printf("Tx Latency Value = %d\n", le32_to_cpu(link_qual->tx_latency_val));
|
||||
printf("Tx Latency Threshold = %d\n", le32_to_cpu(link_qual->tx_latency_thrs));
|
||||
|
||||
break;
|
||||
}
|
||||
case TLV_TYPE_PRE_BEACON_LOST:
|
||||
{
|
||||
MrvlIEtypes_PreBeaconLost_t
|
||||
*pre_bcn_lost
|
||||
=
|
||||
(MrvlIEtypes_PreBeaconLost_t
|
||||
*)(buf
|
||||
+
|
||||
len);
|
||||
printf("------------------------\n");
|
||||
printf("Pre-Beacon Lost Event Subscribed\t%s\n", (le16_to_cpu(se->events) & 0x0800) ? "yes" : "no");
|
||||
printf("Pre-Beacon Lost: %d\n", pre_bcn_lost->pre_beacon_lost);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
printf("Unknown subscribed event TLV Type=%#x," " Len=%d\n", le16_to_cpu(header->type), le16_to_cpu(header->len));
|
||||
break;
|
||||
}
|
||||
|
||||
len += (sizeof
|
||||
(MrvlIEtypesHeader_t)
|
||||
+
|
||||
le16_to_cpu(header->
|
||||
len));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_MAC_REG_ACCESS:
|
||||
case HostCmd_CMD_BBP_REG_ACCESS:
|
||||
case HostCmd_CMD_RF_REG_ACCESS:
|
||||
case HostCmd_CMD_CAU_REG_ACCESS:
|
||||
{
|
||||
HostCmd_DS_REG *preg =
|
||||
(HostCmd_DS_REG *)(buf + S_DS_GEN);
|
||||
preg->action = le16_to_cpu(preg->action);
|
||||
if (preg->action == HostCmd_ACT_GEN_GET) {
|
||||
preg->value = le32_to_cpu(preg->value);
|
||||
printf("value = 0x%08x\n", preg->value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HostCmd_CMD_MEM_ACCESS:
|
||||
{
|
||||
HostCmd_DS_MEM *pmem =
|
||||
(HostCmd_DS_MEM *)(buf + S_DS_GEN);
|
||||
pmem->action = le16_to_cpu(pmem->action);
|
||||
if (pmem->action == HostCmd_ACT_GEN_GET) {
|
||||
pmem->value = le32_to_cpu(pmem->value);
|
||||
printf("value = 0x%08x\n", pmem->value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
printf("HOSTCMD_RESP: CmdCode=%#04x, Size=%#04x,"
|
||||
" SeqNum=%#04x, Result=%#04x\n",
|
||||
hostcmd->command, hostcmd->size,
|
||||
hostcmd->seq_num, hostcmd->result);
|
||||
hexdump("payload",
|
||||
(t_void *)(buf + S_DS_GEN),
|
||||
hostcmd->size - S_DS_GEN, ' ');
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
printf("HOSTCMD failed: CmdCode=%#04x, Size=%#04x,"
|
||||
" SeqNum=%#04x, Result=%#04x\n",
|
||||
hostcmd->command, hostcmd->size,
|
||||
hostcmd->seq_num, hostcmd->result);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Prepare the hostcmd for register access
|
||||
* @param type Register type
|
||||
* @param offset Register offset
|
||||
* @param value Pointer to value (NULL for read)
|
||||
* @param buf Pointer to hostcmd buffer
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
int
|
||||
prepare_hostcmd_regrdwr(t_u32 type, t_u32 offset, t_u32 *value, t_u8 *buf)
|
||||
{
|
||||
HostCmd_DS_GEN *hostcmd;
|
||||
HostCmd_DS_REG *preg;
|
||||
|
||||
hostcmd = (HostCmd_DS_GEN *)buf;
|
||||
switch (type) {
|
||||
case 1:
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_MAC_REG_ACCESS);
|
||||
break;
|
||||
case 2:
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_BBP_REG_ACCESS);
|
||||
break;
|
||||
case 3:
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_RF_REG_ACCESS);
|
||||
break;
|
||||
case 5:
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_CAU_REG_ACCESS);
|
||||
break;
|
||||
default:
|
||||
printf("Invalid register set specified\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
preg = (HostCmd_DS_REG *)(buf + S_DS_GEN);
|
||||
preg->action = (value) ? HostCmd_ACT_GEN_SET : HostCmd_ACT_GEN_GET;
|
||||
preg->action = cpu_to_le16(preg->action);
|
||||
preg->offset = cpu_to_le16((t_u16)offset);
|
||||
if (value)
|
||||
preg->value = cpu_to_le32(*value);
|
||||
else
|
||||
preg->value = 0;
|
||||
hostcmd->size = cpu_to_le16(S_DS_GEN + sizeof(HostCmd_DS_REG));
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
/** @file mlanhostcmd.h
|
||||
*
|
||||
* @brief This file contains command structures for mlanutl application
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
11/26/2008: initial version
|
||||
************************************************************************/
|
||||
#ifndef _MLANHOSTCMD_H_
|
||||
#define _MLANHOSTCMD_H_
|
||||
|
||||
/** Find number of elements */
|
||||
#define NELEMENTS(x) (sizeof(x)/sizeof(x[0]))
|
||||
|
||||
/** Size of command buffer */
|
||||
#define MRVDRV_SIZE_OF_CMD_BUFFER (3 * 1024)
|
||||
|
||||
/** Host Command ID : Memory access */
|
||||
#define HostCmd_CMD_MEM_ACCESS 0x0086
|
||||
|
||||
/** Pre-Authenticate - 11r only */
|
||||
#define HostCmd_CMD_802_11_AUTHENTICATE 0x0011
|
||||
|
||||
/** Read/Write Mac register */
|
||||
#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
|
||||
/** Read/Write BBP register */
|
||||
#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
|
||||
/** Read/Write RF register */
|
||||
#define HostCmd_CMD_RF_REG_ACCESS 0x001b
|
||||
/** Get TX Power data */
|
||||
#define HostCmd_CMD_802_11_RF_TX_POWER 0x001e
|
||||
/** Host Command ID : CAU register access */
|
||||
#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
|
||||
|
||||
/** Host Command ID : 802.11 BG scan configuration */
|
||||
#define HostCmd_CMD_802_11_BG_SCAN_CONFIG 0x006b
|
||||
/** Host Command ID : Configuration data */
|
||||
#define HostCmd_CMD_CFG_DATA 0x008f
|
||||
/** Host Command ID : 802.11 TPC adapt req */
|
||||
#define HostCmd_CMD_802_11_TPC_ADAPT_REQ 0x0060
|
||||
/** Host Command ID : 802.11 crypto */
|
||||
#define HostCmd_CMD_802_11_CRYPTO 0x0078
|
||||
/** Host Command ID : 802.11 auto Tx */
|
||||
#define HostCmd_CMD_802_11_AUTO_TX 0x0082
|
||||
|
||||
/** Host Command ID : 802.11 subscribe event */
|
||||
#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
|
||||
|
||||
#ifdef OPCHAN
|
||||
/** Host Command ID : Operating channel config */
|
||||
#define HostCmd_CMD_OPCHAN_CONFIG 0x00f8
|
||||
/** Host Command ID : Opchan channel group config */
|
||||
#define HostCmd_CMD_OPCHAN_CHANGROUP_CONFIG 0x00f9
|
||||
#endif
|
||||
|
||||
/** Host Command ID : Channel TRPC config */
|
||||
#define HostCmd_CMD_CHAN_TRPC_CONFIG 0x00fb
|
||||
|
||||
/** TLV type ID definition */
|
||||
#define PROPRIETARY_TLV_BASE_ID 0x0100
|
||||
/** TLV type : Beacon RSSI low */
|
||||
#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 0x04) /* 0x0104 */
|
||||
/** TLV type : Beacon SNR low */
|
||||
#define TLV_TYPE_SNR_LOW (PROPRIETARY_TLV_BASE_ID + 0x05) /* 0x0105 */
|
||||
/** TLV type : Fail count */
|
||||
#define TLV_TYPE_FAILCOUNT (PROPRIETARY_TLV_BASE_ID + 0x06) /* 0x0106 */
|
||||
/** TLV type : BCN miss */
|
||||
#define TLV_TYPE_BCNMISS (PROPRIETARY_TLV_BASE_ID + 0x07) /* 0x0107 */
|
||||
/** TLV type : Beacon RSSI high */
|
||||
#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 0x16) /* 0x0116 */
|
||||
/** TLV type : Beacon SNR high */
|
||||
#define TLV_TYPE_SNR_HIGH (PROPRIETARY_TLV_BASE_ID + 0x17) /* 0x0117 */
|
||||
/** TLV type : Auto Tx */
|
||||
#define TLV_TYPE_AUTO_TX (PROPRIETARY_TLV_BASE_ID + 0x18) /* 0x0118 */
|
||||
/** TLV type :Link Quality */
|
||||
#define TLV_TYPE_LINK_QUALITY (PROPRIETARY_TLV_BASE_ID + 0x24) /* 0x0124 */
|
||||
/** TLV type : Data RSSI low */
|
||||
#define TLV_TYPE_RSSI_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 0x26) /* 0x0126 */
|
||||
/** TLV type : Data SNR low */
|
||||
#define TLV_TYPE_SNR_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 0x27) /* 0x0127 */
|
||||
/** TLV type : Data RSSI high */
|
||||
#define TLV_TYPE_RSSI_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 0x28) /* 0x0128 */
|
||||
/** TLV type : Data SNR high */
|
||||
#define TLV_TYPE_SNR_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 0x29) /* 0x0129 */
|
||||
/** TLV type: Pre-Beacon Lost */
|
||||
#define TLV_TYPE_PRE_BEACON_LOST (PROPRIETARY_TLV_BASE_ID + 0x49) /* 0x0149 */
|
||||
|
||||
#ifdef OPCHAN
|
||||
/** TLV type : Operating channel control description */
|
||||
#define TLV_TYPE_OPCHAN_CONTROL_DESC (PROPRIETARY_TLV_BASE_ID + 0x79) /* 0x0179 */
|
||||
/** TLV type : Operating channel group control */
|
||||
#define TLV_TYPE_OPCHAN_CHANGRP_CTRL (PROPRIETARY_TLV_BASE_ID + 0x7a) /* 0x017a */
|
||||
#endif
|
||||
|
||||
/** TLV type : Channel TRPC */
|
||||
#define TLV_TYPE_CHAN_TRPC (PROPRIETARY_TLV_BASE_ID + 0x89) /* 0x0189 */
|
||||
|
||||
/** mlan_ioctl_11h_tpc_resp */
|
||||
typedef struct {
|
||||
int status_code;
|
||||
/**< Firmware command result status code */
|
||||
int tx_power;/**< Reported TX Power from the TPC Report */
|
||||
int link_margin;
|
||||
/**< Reported Link margin from the TPC Report */
|
||||
int rssi; /**< RSSI of the received TPC Report frame */
|
||||
} __ATTRIB_PACK__ mlan_ioctl_11h_tpc_resp;
|
||||
|
||||
/* Define general hostcmd data structure */
|
||||
|
||||
/** Convert String to integer */
|
||||
t_u32 a2hex_or_atoi(char *value);
|
||||
char *mlan_config_get_line(FILE * fp, char *str, t_s32 size, int *lineno);
|
||||
|
||||
int prepare_host_cmd_buffer(FILE * fp, char *cmd_name, t_u8 *buf);
|
||||
int prepare_hostcmd_regrdwr(t_u32 type, t_u32 offset, t_u32 *value, t_u8 *buf);
|
||||
|
||||
#endif /* _MLANHOSTCMD_H_ */
|
File diff suppressed because it is too large
Load diff
|
@ -1,514 +0,0 @@
|
|||
/** @file mlanoffload.h
|
||||
*
|
||||
* @brief This files contains mlanutl offload command handling.
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
08/11/2009: initial version
|
||||
************************************************************************/
|
||||
|
||||
#ifndef _MLANOFFLOAD_H_
|
||||
#define _MLANOFFLOAD_H_
|
||||
|
||||
#ifndef MAX
|
||||
/** Find maximum value */
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#endif /* MAX */
|
||||
|
||||
/** Key length */
|
||||
#define KEY_LEN 32
|
||||
/** Phrase length */
|
||||
#define PHRASE_LEN 32
|
||||
/** WEP Key count */
|
||||
#define WEP_KEY_CNT 4
|
||||
|
||||
/* Bitmap for OFFLoad Enable - Feature*/
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Roaming Feature */
|
||||
#define PROFILE_DB_FEATURE_ROAMING 0x8000
|
||||
/** CCX Feature */
|
||||
#define PROFILE_DB_FEATURE_CCX 0x4000
|
||||
/** UNUSED Feature */
|
||||
#define PROFILE_DB_FEATURE_UNUSED 0x2000
|
||||
/** adhoc/infra mode */
|
||||
#define PROFILE_DB_FEATURE_MODE 0x1000
|
||||
#else
|
||||
/** Roaming Feature */
|
||||
#define PROFILE_DB_FEATURE_ROAMING 0x0001
|
||||
/** CCX Feature */
|
||||
#define PROFILE_DB_FEATURE_CCX 0x0002
|
||||
/** UNUSED Feature */
|
||||
#define PROFILE_DB_FEATURE_UNUSED 0x0004
|
||||
/** adhoc/infra mode */
|
||||
#define PROFILE_DB_FEATURE_MODE 0x0008
|
||||
#endif
|
||||
|
||||
/* Bitmap for profile AKMP Support */
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Key Management EAP */
|
||||
#define PROFILE_DB_KEY_MGMT_IEEE8021X 0x8000
|
||||
/** Key Management PSK */
|
||||
#define PROFILE_DB_KEY_MGMT_PSK 0x4000
|
||||
/** Key Management NONE */
|
||||
#define PROFILE_DB_KEY_MGMT_NONE 0x2000
|
||||
/** Key Management CCKM */
|
||||
#define PROFILE_DB_KEY_MGMT_CCKM 0x1000
|
||||
/** Key Management UNUSED */
|
||||
#define PROFILE_DB_KEY_MGMT_UNUSED 0x0800
|
||||
/** Key Management FT 802.1x */
|
||||
#define PROFILE_DB_KEY_MGMT_FT_IEEE8021X 0x0400
|
||||
/** Key Management FT PSK */
|
||||
#define PROFILE_DB_KEY_MGMT_FT_PSK 0x0200
|
||||
/** Key Management SHA256 802.1x */
|
||||
#define PROFILE_DB_KEY_MGMT_SHA256_IEEE8021X 0x0100
|
||||
/** Key Management SHA256 PSK*/
|
||||
#define PROFILE_DB_KEY_MGMT_SHA256_PSK 0x0080
|
||||
#else
|
||||
/** Key Management EAP */
|
||||
#define PROFILE_DB_KEY_MGMT_IEEE8021X 0x0001
|
||||
/** Key Management PSK */
|
||||
#define PROFILE_DB_KEY_MGMT_PSK 0x0002
|
||||
/** Key Management NONE */
|
||||
#define PROFILE_DB_KEY_MGMT_NONE 0x0004
|
||||
/** Key Management CCKM */
|
||||
#define PROFILE_DB_KEY_MGMT_CCKM 0x0008
|
||||
/** Key Management UNUSED */
|
||||
#define PROFILE_DB_KEY_MGMT_UNUSED 0x0010
|
||||
/** Key Management FT 802.1x */
|
||||
#define PROFILE_DB_KEY_MGMT_FT_IEEE8021X 0x0020
|
||||
/** Key Management FT PSK */
|
||||
#define PROFILE_DB_KEY_MGMT_FT_PSK 0x0040
|
||||
/** Key Management SHA256 802.1x */
|
||||
#define PROFILE_DB_KEY_MGMT_SHA256_IEEE8021X 0x0080
|
||||
/** Key Management SHA256 PSK*/
|
||||
#define PROFILE_DB_KEY_MGMT_SHA256_PSK 0x0100
|
||||
#endif
|
||||
|
||||
/* Bitmap for profile Encryption protocol support */
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Encryption protocol noRsn */
|
||||
#define PROFILE_DB_PROTO_NO_RSN 0x8000
|
||||
/** Encryption protocol static wep */
|
||||
#define PROFILE_DB_PROTO_WEP_STATIC 0x4000
|
||||
/** Encryption protocol dynamic wep */
|
||||
#define PROFILE_DB_PROTO_WEP_DYNAMIC 0x2000
|
||||
/** Encryption protocol WPA */
|
||||
#define PROFILE_DB_PROTO_WPA 0x1000
|
||||
/** Encryption protocol WPA-none
|
||||
* Ad-hoc Networks */
|
||||
#define PROFILE_DB_PROTO_WPA_NONE 0x0800
|
||||
/** Encryption protocol WPA2 */
|
||||
#define PROFILE_DB_PROTO_WPA2 0x0400
|
||||
/** Encryption protocol CCKM */
|
||||
#define PROFILE_DB_PROTO_CCKM 0x0200
|
||||
#else
|
||||
/** Encryption protocol noRsn */
|
||||
#define PROFILE_DB_PROTO_NO_RSN 0x0001
|
||||
/** Encryption protocol static wep */
|
||||
#define PROFILE_DB_PROTO_WEP_STATIC 0x0002
|
||||
/** Encryption protocol dynamic wep */
|
||||
#define PROFILE_DB_PROTO_WEP_DYNAMIC 0x0004
|
||||
/** Encryption protocol WPA */
|
||||
#define PROFILE_DB_PROTO_WPA 0x0008
|
||||
/** Encryption protocol WPA-none
|
||||
* Ad-hoc Networks */
|
||||
#define PROFILE_DB_PROTO_WPA_NONE 0x0010
|
||||
/** Encryption protocol WPA2 */
|
||||
#define PROFILE_DB_PROTO_WPA2 0x0020
|
||||
/** Encryption protocol CCKM */
|
||||
#define PROFILE_DB_PROTO_CCKM 0x0040
|
||||
#endif
|
||||
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Cipher wep40 */
|
||||
#define PROFILE_DB_CIPHER_WEP40 0x80
|
||||
/** Cipher wep104 */
|
||||
#define PROFILE_DB_CIPHER_WEP104 0x40
|
||||
/** Cipher tkip */
|
||||
#define PROFILE_DB_CIPHER_TKIP 0x20
|
||||
/** Cipher ccmp */
|
||||
#define PROFILE_DB_CIPHER_CCMP 0x10
|
||||
#else
|
||||
/** Cipher wep40 */
|
||||
#define PROFILE_DB_CIPHER_WEP40 0x01
|
||||
/** Cipher wep104 */
|
||||
#define PROFILE_DB_CIPHER_WEP104 0x02
|
||||
/** Cipher tkip */
|
||||
#define PROFILE_DB_CIPHER_TKIP 0x04
|
||||
/** Cipher ccmp */
|
||||
#define PROFILE_DB_CIPHER_CCMP 0x08
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
|
||||
t_u32 mode; /**< Mode */
|
||||
t_u32 max_off_channel;
|
||||
/**< Maximum off-channel measurement duration (ms) */
|
||||
t_u32 max_on_channel;
|
||||
/**< Maximum on-channel measurement duration (ms) */
|
||||
|
||||
} __ATTRIB_PACK__ MrvlIETypes_MeasTiming_t;
|
||||
|
||||
typedef struct {
|
||||
/** Action Set or get */
|
||||
t_u16 action;
|
||||
|
||||
/** TLV buffer starts here */
|
||||
t_u8 tlv_buffer[1];
|
||||
|
||||
/*
|
||||
* MrvlIETypes_MeasTiming_t
|
||||
*/
|
||||
} __ATTRIB_PACK__ HostCmd_DS_MEASUREMENT_Timing;
|
||||
|
||||
/** helper structure for profile parsing */
|
||||
typedef struct {
|
||||
/** SSID name string */
|
||||
t_u8 ssid[IW_ESSID_MAX_SIZE + 1];
|
||||
/** SSID len */
|
||||
t_u32 ssid_len;
|
||||
/** BSSID network name */
|
||||
t_u8 bssid[ETH_ALEN];
|
||||
/** passphrase configured */
|
||||
t_s8 passphrase[PHRASE_LEN];
|
||||
/** passphrase length */
|
||||
t_u32 passphrase_len;
|
||||
/** Pre-shared key config flag */
|
||||
int psk_config;
|
||||
/** Pre-shared key */
|
||||
t_u8 psk[KEY_LEN];
|
||||
/** wep keys */
|
||||
t_u8 wep_key[WEP_KEY_CNT][KEY_LEN];
|
||||
/** wep keys lengths */
|
||||
t_u8 wep_key_len[WEP_KEY_CNT];
|
||||
/** wep key index */
|
||||
int wep_key_idx;
|
||||
/** protocol fields */
|
||||
t_u16 protocol;
|
||||
/** pairwise Cipher values */
|
||||
t_u8 pairwise_cipher;
|
||||
/** Group Cipher values */
|
||||
t_u8 groupwise_cipher;
|
||||
/** key management */
|
||||
t_u16 key_mgmt;
|
||||
/** offload specific parameter(roaming) */
|
||||
t_u16 roaming;
|
||||
/** offload specific parameter */
|
||||
t_u16 reserved;
|
||||
/** offload specific parameter--ccx */
|
||||
t_u16 ccx;
|
||||
/** offload specific parameter--mode */
|
||||
t_u16 mode;
|
||||
} profile_entry_t;
|
||||
|
||||
typedef struct {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Reserved */
|
||||
t_u8 Reserved:3;
|
||||
/** Channel not measured */
|
||||
t_u8 Unmeasured:1;
|
||||
/** Radar detected */
|
||||
t_u8 Radar:1;
|
||||
/** Unidentified signal received */
|
||||
t_u8 Unidentified:1;
|
||||
/** OFDM Preamble received */
|
||||
t_u8 OFDM_Preamble:1;
|
||||
/** BSS found */
|
||||
t_u8 BSS:1;
|
||||
#else
|
||||
/** BSS found */
|
||||
t_u8 BSS:1;
|
||||
/** OFDM Preamble received */
|
||||
t_u8 OFDM_Preamble:1;
|
||||
/** Unidentified signal received */
|
||||
t_u8 Unidentified:1;
|
||||
/** Radar detected */
|
||||
t_u8 Radar:1;
|
||||
/** Channel not measured */
|
||||
t_u8 Unmeasured:1;
|
||||
/** Reserved */
|
||||
t_u8 Reserved:3;
|
||||
#endif
|
||||
} __ATTRIB_PACK__ IEEEtypes_DFS_Map_t;
|
||||
|
||||
typedef struct {
|
||||
MrvlIEtypesHeader_t Header; /**< Header */
|
||||
|
||||
t_u8 scanReqId; /**< Scan request id assigned in table */
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_ChanRptBcn_t;
|
||||
|
||||
typedef struct {
|
||||
MrvlIEtypesHeader_t Header; /**< Header */
|
||||
|
||||
IEEEtypes_DFS_Map_t map; /**< IEEE 802.11h basic meas report */
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_ChanRpt11hBasic_t;
|
||||
|
||||
typedef struct {
|
||||
MrvlIEtypesHeader_t Header; /**< Header */
|
||||
|
||||
t_u8 sourceAddr[ETH_ALEN]; /**< Source MAC */
|
||||
t_u8 bssid[ETH_ALEN]; /**< BSSID MAC */
|
||||
t_s16 rssi; /**< Avg RSSI of frames */
|
||||
t_u16 frameCnt; /**< # of frames */
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_ChanRptFrame_t;
|
||||
|
||||
#ifdef OPCHAN
|
||||
typedef struct {
|
||||
MrvlIEtypesHeader_t header;
|
||||
/**< Header */
|
||||
|
||||
MrvlChannelDesc_t chanDesc;
|
||||
|
||||
t_u16 controlFlags;
|
||||
t_u16 reserved;
|
||||
|
||||
t_u8 actPower;
|
||||
t_u8 mdMinPower;
|
||||
t_u8 mdMaxPower;
|
||||
t_u8 mdPower;
|
||||
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_ChanControlDesc_t;
|
||||
|
||||
typedef struct {
|
||||
#ifdef BIG_ENDIAN
|
||||
/** Reserved */
|
||||
t_u8 reserved_4_7:4;
|
||||
/** Disble channel filtering flag */
|
||||
t_u8 disable_chan_filt:1;
|
||||
/** Channel scan mode passive flag */
|
||||
t_u8 passive_scan:1;
|
||||
/** Multidomain scan mode */
|
||||
t_u8 multidomain_scan:1;
|
||||
/** Enable probe response timeout */
|
||||
t_u8 rsp_timeout_en:1;
|
||||
#else
|
||||
/** Enable probe response timeout */
|
||||
t_u8 rsp_timeout_en:1;
|
||||
/** Multidomain scan mode */
|
||||
t_u8 multidomain_scan:1;
|
||||
/** Channel scan mode passive flag */
|
||||
t_u8 passive_scan:1;
|
||||
/** Disble channel filtering flag */
|
||||
t_u8 disable_chan_filt:1;
|
||||
/** Reserved */
|
||||
t_u8 reserved_4_7:4;
|
||||
#endif
|
||||
} __ATTRIB_PACK__ ChanScanMode_t;
|
||||
|
||||
typedef struct {
|
||||
MrvlIEtypesHeader_t header;
|
||||
/**< Header */
|
||||
|
||||
t_u32 chanGroupBitmap;
|
||||
ChanScanMode_t scanMode;
|
||||
t_u8 numChan;
|
||||
|
||||
MrvlChannelDesc_t chanDesc[50];
|
||||
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_ChanGroupControl_t;
|
||||
|
||||
typedef struct {
|
||||
t_u16 action;
|
||||
/**< CMD Action Get/Set*/
|
||||
|
||||
t_u8 tlv_buffer[1];
|
||||
|
||||
} __ATTRIB_PACK__ HostCmd_DS_OPCHAN_CONFIG;
|
||||
|
||||
typedef struct {
|
||||
t_u16 action;
|
||||
/**< CMD Action Get/Set*/
|
||||
|
||||
t_u8 tlv_buffer[1];
|
||||
|
||||
} __ATTRIB_PACK__ HostCmd_DS_OPCHAN_CHANGROUP_CONFIG;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
t_u8 modGroup;
|
||||
t_u8 txPower;
|
||||
|
||||
} __ATTRIB_PACK__ MrvlChanTrpcEntry_t;
|
||||
|
||||
typedef struct {
|
||||
MrvlIEtypesHeader_t header;
|
||||
/**< Header */
|
||||
|
||||
MrvlChannelDesc_t chanDesc;
|
||||
MrvlChanTrpcEntry_t chanTrpcEntry[1];
|
||||
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_ChanTrpcCfg_t;
|
||||
|
||||
typedef struct {
|
||||
t_u16 action;
|
||||
/**< CMD Action Get/Set*/
|
||||
t_u16 reserved;
|
||||
|
||||
t_u8 tlv_buffer[1];/** MrvlIEtypes_ChanTrpcCfg_t TLVs */
|
||||
|
||||
} __ATTRIB_PACK__ HostCmd_DS_CHAN_TRPC_CONFIG;
|
||||
|
||||
typedef struct {
|
||||
t_u8 controlSelect;
|
||||
|
||||
t_u8 controlBitmap[1]; /* Variable length # of byte bitmaps */
|
||||
|
||||
} __ATTRIB_PACK__ HostCmd_DS_OFFLOAD_FEATURE_CONTROL;
|
||||
|
||||
#define IAPP_DATA_MAX 1000
|
||||
|
||||
/**
|
||||
* @brief Enumeration for the command result from an IAPP Proxy command
|
||||
*/
|
||||
typedef enum {
|
||||
IAPP_PROXY_RESULT_SUCCESS = 0,
|
||||
IAPP_PROXY_RESULT_EXEC_FAILURE = 1,
|
||||
IAPP_PROXY_RESULT_TIMEOUT = 2,
|
||||
IAPP_PROXY_RESULT_DATA_INVALID = 3,
|
||||
} __ATTRIB_PACK__ mlan_iapp_proxy_result_e;
|
||||
|
||||
typedef struct {
|
||||
mlan_iapp_proxy_result_e commandResult;
|
||||
/**< Firmware execution result */
|
||||
|
||||
t_u32 timeout_ms; /**< Timeout value in milliseconds */
|
||||
|
||||
t_u8 iappType;
|
||||
t_u8 iappSubType;
|
||||
|
||||
t_u32 iappDataLen;
|
||||
t_u8 iappData[IAPP_DATA_MAX];
|
||||
|
||||
} __ATTRIB_PACK__ HostCmd_DS_IAPP_PROXY;
|
||||
|
||||
typedef struct {
|
||||
/** Action: GET/SET */
|
||||
t_u16 Action;
|
||||
/** Reserved */
|
||||
t_u16 Reserved;
|
||||
/** Association timeout */
|
||||
t_u32 AssocTimeout;
|
||||
/** Reassociation timeout */
|
||||
t_u32 ReassocTimeout;
|
||||
/** Hand shake timeout */
|
||||
t_u32 HandShakeTimeout;
|
||||
/** Frame exchange timeout */
|
||||
t_u32 FrameExchangeTimeout;
|
||||
/** Deauth of old AP in millisec; 0 to disable */
|
||||
t_u32 PriorApDeauthDelay;
|
||||
/** Maximum time after a disconnect where a reassoc frame will be sent */
|
||||
t_u32 ReassocDiscMax;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_AssociationTiming_t;
|
||||
|
||||
/** 16 bit unsigned integer */
|
||||
typedef t_u16 IEEEtypes_AId_t;
|
||||
/** 16 bit unsigned integer */
|
||||
typedef t_u16 IEEEtypes_StatusCode_t;
|
||||
|
||||
typedef struct {
|
||||
/** Capability information */
|
||||
IEEEtypes_CapInfo_t Capability;
|
||||
/** Association response status code */
|
||||
IEEEtypes_StatusCode_t StatusCode;
|
||||
/** Association ID */
|
||||
IEEEtypes_AId_t AId;
|
||||
/** IE data buffer */
|
||||
t_u8 IEBuffer[1];
|
||||
} __ATTRIB_PACK__ IEEEtypes_AssocRsp_t;
|
||||
|
||||
/** Maximum number of AC QOS queues available in the driver/firmware */
|
||||
#define MAX_AC_QUEUES 4
|
||||
|
||||
/** timing select structure */
|
||||
typedef struct {
|
||||
char *str; /**< Timing mode string */
|
||||
int match_len; /**< match length */
|
||||
t_u8 sel; /**< flag */
|
||||
|
||||
} timing_sel_t;
|
||||
|
||||
/** ENUM definition: reg_chan_table */
|
||||
typedef enum {
|
||||
REGTABLE_DEFAULT = 0,
|
||||
REGTABLE_ESS = 1,
|
||||
REGTABLE_USER = 2,
|
||||
REGTABLE_MULTIDOMAIN = 3,
|
||||
|
||||
REGTABLE_MAX = 0xFFFF,
|
||||
} reg_chan_table_e;
|
||||
|
||||
/** Sub-command callback */
|
||||
typedef int (*sub_cmd_callback_t) (int argc, char *argv[]);
|
||||
|
||||
/** Sub-command execution data */
|
||||
typedef struct {
|
||||
char *str;
|
||||
/**< Command string */
|
||||
int match_len;
|
||||
/**< Length */
|
||||
int display;
|
||||
/**< display as valid cmd */
|
||||
sub_cmd_callback_t callback;
|
||||
/**< Sub-command callback */
|
||||
|
||||
} sub_cmd_exec_t;
|
||||
|
||||
/** HostCmd_CMD_802_11_RF_TX_POWER */
|
||||
typedef struct {
|
||||
t_u16 action;
|
||||
t_s16 current_level;
|
||||
t_s8 max_power;
|
||||
t_s8 min_power;
|
||||
|
||||
} __ATTRIB_PACK__ HostCmd_DS_802_11_RF_TX_POWER;
|
||||
|
||||
/** HostCmd_CMD_802_11_AUTHENTICATE */
|
||||
typedef struct {
|
||||
/** MAC address */
|
||||
t_u8 MacAddr[ETH_ALEN];
|
||||
/** Authentication type */
|
||||
t_u8 AuthType;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_802_11_AUTHENTICATE;
|
||||
|
||||
boolean reg_class_table_select(char *tableStr, reg_chan_table_e *pTable);
|
||||
int process_sub_cmd(sub_cmd_exec_t *sub_cmd, int num_sub_cmds,
|
||||
int argc, char *argv[]);
|
||||
int process_regclass(int argc, char *argv[]);
|
||||
int process_scanagent(int argc, char *argv[]);
|
||||
int process_measurement(int argc, char *argv[]);
|
||||
int process_profile_entry(int argc, char *argv[]);
|
||||
int process_get_ra_config(int argc, char *argv[]);
|
||||
int process_set_ra_config(int argc, char *argv[]);
|
||||
int process_chanrpt(int argc, char *argv[]);
|
||||
int process_assoc_timing(int argc, char *argv[]);
|
||||
int process_get_assocrsp(int argc, char *argv[]);
|
||||
int process_link_stats(int argc, char *argv[]);
|
||||
|
||||
int process_opchan(int argc, char *argv[]);
|
||||
int process_changroup(int argc, char *argv[]);
|
||||
int process_fcontrol(int argc, char *argv[]);
|
||||
int process_iapp(int argc, char *argv[]);
|
||||
int process_rf_tx_power(int argc, char *argv[]);
|
||||
int process_authenticate(int argc, char *argv[]);
|
||||
int process_txpowdisp(int argc, char *argv[]);
|
||||
|
||||
#endif /* _MLANOFFLOAD_H_ */
|
|
@ -1,540 +0,0 @@
|
|||
/** @file mlanregclass.c
|
||||
*
|
||||
* @brief This files contains mlanutl regclass command handling.
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
08/11/2009: initial version
|
||||
************************************************************************/
|
||||
|
||||
#include "mlanutl.h"
|
||||
#include "mlanhostcmd.h"
|
||||
#include "mlanoffload.h"
|
||||
#include "mlanregclass.h"
|
||||
|
||||
/********************************************************
|
||||
Local Variables
|
||||
********************************************************/
|
||||
|
||||
/********************************************************
|
||||
Global Variables
|
||||
********************************************************/
|
||||
|
||||
/********************************************************
|
||||
Local Functions
|
||||
********************************************************/
|
||||
|
||||
/**
|
||||
* @brief Convert reg domain number to string
|
||||
*
|
||||
* @param reg_domain Reg Domain
|
||||
*
|
||||
* @return Reg Domain type
|
||||
*/
|
||||
static char *
|
||||
reg_domain_to_str(reg_domain_e reg_domain)
|
||||
{
|
||||
switch (reg_domain) {
|
||||
case REGDOMAIN_FCC:
|
||||
return "FCC";
|
||||
|
||||
case REGDOMAIN_ETSI:
|
||||
return "ETSI";
|
||||
|
||||
case REGDOMAIN_MIC:
|
||||
return "MIC";
|
||||
|
||||
case REGDOMAIN_OTHER:
|
||||
return "MULTI";
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return "UNKN";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert reg channel table number to string
|
||||
*
|
||||
* @param table_select Reg channel table
|
||||
*
|
||||
* @return Reg channel table type
|
||||
*/
|
||||
static char *
|
||||
table_num_to_str(reg_chan_table_e table_select)
|
||||
{
|
||||
switch (table_select) {
|
||||
case REGTABLE_USER:
|
||||
return "User";
|
||||
|
||||
case REGTABLE_MULTIDOMAIN:
|
||||
return "MultiDomain";
|
||||
|
||||
case REGTABLE_ESS:
|
||||
return "ESS";
|
||||
|
||||
case REGTABLE_DEFAULT:
|
||||
return "Default";
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return "UNKN";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Regclass dump channel table
|
||||
*
|
||||
* @param argc Number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
static int
|
||||
reg_class_dump_chan_table(int argc, char *argv[])
|
||||
{
|
||||
int ret = MLAN_STATUS_SUCCESS;
|
||||
struct ifreq ifr;
|
||||
t_u8 *buffer = NULL, *pos = NULL;
|
||||
t_u32 cmd_len = 0, cmd_header_len;
|
||||
struct eth_priv_cmd *cmd = NULL;
|
||||
HostCmd_DS_GEN *hostcmd;
|
||||
HostCmd_DS_REGCLASS_GET_CHAN_TABLE *get_table;
|
||||
int idx;
|
||||
t_u16 regLimits;
|
||||
boolean invalid_cmd = FALSE;
|
||||
|
||||
printf("ERR:Cannot allocate buffer for command!\n");
|
||||
if (argv[0] == NULL) {
|
||||
invalid_cmd = TRUE;
|
||||
} else {
|
||||
|
||||
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
|
||||
|
||||
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
|
||||
if (buffer == NULL) {
|
||||
fprintf(stderr, "Cannot alloc memory\n");
|
||||
ret = ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
memset(buffer, 0, BUFFER_LENGTH);
|
||||
|
||||
cmd = (struct eth_priv_cmd *)
|
||||
malloc(sizeof(struct eth_priv_cmd));
|
||||
if (!cmd) {
|
||||
printf("ERR:Cannot allocate buffer for command!\n");
|
||||
ret = ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Fill up buffer */
|
||||
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
|
||||
memset(cmd, 0, sizeof(struct eth_priv_cmd));
|
||||
memcpy(&cmd->buf, &buffer, sizeof(buffer));
|
||||
#else
|
||||
cmd->buf = buffer;
|
||||
#endif
|
||||
cmd->used_len = 0;
|
||||
cmd->total_len = BUFFER_LENGTH;
|
||||
|
||||
/* buffer = MRVL_CMD<cmd> */
|
||||
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
|
||||
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD,
|
||||
strlen(HOSTCMD));
|
||||
|
||||
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
|
||||
hostcmd =
|
||||
(HostCmd_DS_GEN *)(buffer + cmd_header_len +
|
||||
sizeof(t_u32));
|
||||
|
||||
/* Point after host command header */
|
||||
pos = (t_u8 *)hostcmd + S_DS_GEN;
|
||||
|
||||
cmd_len = S_DS_GEN + sizeof(HostCmd_DS_REGCLASS_GET_CHAN_TABLE);
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_REGCLASS_CHAN_TABLE);
|
||||
hostcmd->size = cpu_to_le16(cmd_len);
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
|
||||
get_table = (HostCmd_DS_REGCLASS_GET_CHAN_TABLE *)pos;
|
||||
get_table->action = cpu_to_le16(HostCmd_ACT_GEN_GET);
|
||||
|
||||
if (reg_class_table_select(argv[0], (reg_chan_table_e *)
|
||||
&get_table->table_select) == FALSE) {
|
||||
invalid_cmd = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (invalid_cmd) {
|
||||
printf("\nValid tables table; valid [user, md, ess, default]\n\n");
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
get_table->table_select = cpu_to_le16((t_u16)(get_table->table_select));
|
||||
|
||||
/* Put buffer length */
|
||||
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
|
||||
|
||||
/* Initialize the ifr structure */
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
|
||||
ifr.ifr_ifru.ifru_data = (void *)cmd;
|
||||
/* Perform ioctl */
|
||||
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
|
||||
perror("ioctl[regClassIoctl]");
|
||||
printf("ERR:Command sending failed!\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!le16_to_cpu(hostcmd->result)) {
|
||||
printf("HOSTCMD_RESP: ReturnCode=%#04x, Result=%#04x\n",
|
||||
le16_to_cpu(hostcmd->command),
|
||||
le16_to_cpu(hostcmd->result));
|
||||
} else {
|
||||
printf("HOSTCMD failed: ReturnCode=%#04x, Result=%#04x\n",
|
||||
le16_to_cpu(hostcmd->command),
|
||||
le16_to_cpu(hostcmd->result));
|
||||
}
|
||||
|
||||
get_table->table_select = le16_to_cpu(get_table->table_select);
|
||||
get_table->chan = le32_to_cpu(get_table->chan);
|
||||
|
||||
printf("---------------------------------------");
|
||||
printf("---------------------------------------\n");
|
||||
printf("%35s: %s [%d]\n", "Channel Table",
|
||||
table_num_to_str(get_table->table_select), (int)get_table->chan);
|
||||
printf("---------------------------------------");
|
||||
printf("---------------------------------------\n");
|
||||
printf(" chn | freq | sfrq | sp | class | maxP | behavior limits\n");
|
||||
printf("---------------------------------------");
|
||||
printf("---------------------------------------\n");
|
||||
|
||||
for (idx = 0; (unsigned int)idx < get_table->chan; idx++) {
|
||||
char regDisp[8];
|
||||
|
||||
sprintf(regDisp, "%4s-%02u",
|
||||
reg_domain_to_str(get_table->chan_entry[idx].
|
||||
reg_domain),
|
||||
get_table->chan_entry[idx].regulatory_class);
|
||||
|
||||
printf(" %03u | %04u | %04u | %02u | %-8s | %02u |",
|
||||
get_table->chan_entry[idx].chan_num,
|
||||
(get_table->chan_entry[idx].start_freq +
|
||||
(get_table->chan_entry[idx].chan_num * 5)),
|
||||
le16_to_cpu(get_table->chan_entry[idx].start_freq),
|
||||
le16_to_cpu(get_table->chan_entry[idx].chan_spacing),
|
||||
regDisp, get_table->chan_entry[idx].max_tx_power);
|
||||
|
||||
regLimits = le16_to_cpu(get_table->chan_entry[idx].reg_limits);
|
||||
|
||||
if (regLimits & BLIMIT_NOMADIC)
|
||||
printf(" nomadic");
|
||||
if (regLimits & BLIMIT_INDOOR_ONLY)
|
||||
printf(" indoor");
|
||||
if (regLimits & BLIMIT_TPC)
|
||||
printf(" tpc");
|
||||
if (regLimits & BLIMIT_DFS)
|
||||
printf(" dfs");
|
||||
if (regLimits & BLIMIT_IBSS_PROHIBIT)
|
||||
printf(" no_ibss");
|
||||
if (regLimits & BLIMIT_FOUR_MS_CS)
|
||||
printf(" 4ms_cs");
|
||||
if (regLimits & BLIMIT_LIC_BASE_STA)
|
||||
printf(" base_sta");
|
||||
if (regLimits & BLIMIT_MOBILE_STA)
|
||||
printf(" mobile");
|
||||
if (regLimits & BLIMIT_PUBLIC_SAFETY)
|
||||
printf(" safety");
|
||||
if (regLimits & BLIMIT_ISM_BANDS)
|
||||
printf(" ism");
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
printf("---------------------------------------");
|
||||
printf("---------------------------------------\n");
|
||||
printf("\n");
|
||||
|
||||
done:
|
||||
if (buffer)
|
||||
free(buffer);
|
||||
if (cmd)
|
||||
free(cmd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Regclass configure user table
|
||||
*
|
||||
* @param argc Number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
static int
|
||||
reg_class_config_user_table(int argc, char *argv[])
|
||||
{
|
||||
int ret = MLAN_STATUS_SUCCESS;
|
||||
struct ifreq ifr;
|
||||
t_u8 *buffer = NULL, *pos = NULL;
|
||||
t_u32 cmd_len = 0, cmd_header_len;
|
||||
struct eth_priv_cmd *cmd = NULL;
|
||||
HostCmd_DS_GEN *hostcmd;
|
||||
HostCmd_DS_REGCLASS_CONFIG_USER_TABLE *cfg_user_table;
|
||||
|
||||
if (argv[0] == NULL) {
|
||||
printf("\nCountry string not specified\n");
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
|
||||
|
||||
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
|
||||
if (buffer == NULL) {
|
||||
fprintf(stderr, "Cannot alloc memory\n");
|
||||
ret = ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
memset(buffer, 0, BUFFER_LENGTH);
|
||||
|
||||
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
|
||||
if (!cmd) {
|
||||
printf("ERR:Cannot allocate buffer for command!\n");
|
||||
ret = ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Fill up buffer */
|
||||
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
|
||||
memset(cmd, 0, sizeof(struct eth_priv_cmd));
|
||||
memcpy(&cmd->buf, &buffer, sizeof(buffer));
|
||||
#else
|
||||
cmd->buf = buffer;
|
||||
#endif
|
||||
cmd->used_len = 0;
|
||||
cmd->total_len = BUFFER_LENGTH;
|
||||
|
||||
/* buffer = MRVL_CMD<cmd> */
|
||||
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
|
||||
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
|
||||
|
||||
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
|
||||
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
|
||||
|
||||
/* Point after host command header */
|
||||
pos = (t_u8 *)hostcmd + S_DS_GEN;
|
||||
|
||||
cmd_len = S_DS_GEN + sizeof(HostCmd_DS_REGCLASS_CONFIG_USER_TABLE);
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_REGCLASS_CONFIG_USER_TABLE);
|
||||
hostcmd->size = cpu_to_le16(cmd_len);
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
|
||||
cfg_user_table = (HostCmd_DS_REGCLASS_CONFIG_USER_TABLE *)pos;
|
||||
cfg_user_table->action = cpu_to_le16(HostCmd_ACT_GEN_SET);
|
||||
memcpy(cfg_user_table->regulatory_str,
|
||||
argv[0],
|
||||
MIN(strlen(argv[0]), sizeof(cfg_user_table->regulatory_str)));
|
||||
|
||||
/* Put buffer length */
|
||||
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
|
||||
|
||||
/* Initialize the ifr structure */
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
|
||||
ifr.ifr_ifru.ifru_data = (void *)cmd;
|
||||
/* Perform ioctl */
|
||||
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
|
||||
perror("ioctl[regClassIoctl]");
|
||||
printf("ERR:Command sending failed!\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!le16_to_cpu(hostcmd->result)) {
|
||||
printf("HOSTCMD_RESP: ReturnCode=%#04x, Result=%#04x\n",
|
||||
le16_to_cpu(hostcmd->command),
|
||||
le16_to_cpu(hostcmd->result));
|
||||
} else {
|
||||
printf("HOSTCMD failed: ReturnCode=%#04x, Result=%#04x\n",
|
||||
le16_to_cpu(hostcmd->command),
|
||||
le16_to_cpu(hostcmd->result));
|
||||
}
|
||||
|
||||
done:
|
||||
if (buffer)
|
||||
free(buffer);
|
||||
if (cmd)
|
||||
free(cmd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Issue regclass multi-domain command
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
static int
|
||||
reg_class_multidomain(int argc, char *argv[])
|
||||
{
|
||||
int ret = MLAN_STATUS_SUCCESS;
|
||||
struct ifreq ifr;
|
||||
t_u8 *buffer = NULL, *pos = NULL;
|
||||
t_u32 cmd_len = 0, cmd_header_len;
|
||||
struct eth_priv_cmd *cmd = NULL;
|
||||
HostCmd_DS_GEN *hostcmd;
|
||||
HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL *multidomain_ctrl;
|
||||
boolean invalid_cmd = FALSE;
|
||||
|
||||
if (argv[0] == NULL) {
|
||||
invalid_cmd = TRUE;
|
||||
} else {
|
||||
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
|
||||
|
||||
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
|
||||
if (buffer == NULL) {
|
||||
fprintf(stderr, "Cannot alloc memory\n");
|
||||
ret = ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
memset(buffer, 0, BUFFER_LENGTH);
|
||||
|
||||
cmd = (struct eth_priv_cmd *)
|
||||
malloc(sizeof(struct eth_priv_cmd));
|
||||
if (!cmd) {
|
||||
printf("ERR:Cannot allocate buffer for command!\n");
|
||||
ret = ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Fill up buffer */
|
||||
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
|
||||
memset(cmd, 0, sizeof(struct eth_priv_cmd));
|
||||
memcpy(&cmd->buf, &buffer, sizeof(buffer));
|
||||
#else
|
||||
cmd->buf = buffer;
|
||||
#endif
|
||||
cmd->used_len = 0;
|
||||
cmd->total_len = BUFFER_LENGTH;
|
||||
|
||||
/* buffer = MRVL_CMD<cmd> */
|
||||
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
|
||||
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD,
|
||||
strlen(HOSTCMD));
|
||||
|
||||
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
|
||||
hostcmd =
|
||||
(HostCmd_DS_GEN *)(buffer + cmd_header_len +
|
||||
sizeof(t_u32));
|
||||
|
||||
/* Point after host command header */
|
||||
pos = (t_u8 *)hostcmd + S_DS_GEN;
|
||||
|
||||
cmd_len =
|
||||
S_DS_GEN +
|
||||
sizeof(HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL);
|
||||
hostcmd->command =
|
||||
cpu_to_le16(HostCmd_CMD_REGCLASS_MULTIDOMAIN_CONTROL);
|
||||
hostcmd->size = cpu_to_le16(cmd_len);
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
|
||||
multidomain_ctrl =
|
||||
(HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL *)pos;
|
||||
if (strcmp(argv[0], "on") == 0) {
|
||||
multidomain_ctrl->multidomain_enable = 1;
|
||||
} else if (strcmp(argv[0], "off") == 0) {
|
||||
multidomain_ctrl->multidomain_enable = 0;
|
||||
} else {
|
||||
invalid_cmd = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (invalid_cmd) {
|
||||
printf("\nUnknown multiDomain command; valid [on, off]\n\n");
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
multidomain_ctrl->multidomain_enable =
|
||||
cpu_to_le32(multidomain_ctrl->multidomain_enable);
|
||||
|
||||
/* Put buffer length */
|
||||
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
|
||||
|
||||
/* Initialize the ifr structure */
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
|
||||
ifr.ifr_ifru.ifru_data = (void *)cmd;
|
||||
/* Perform ioctl */
|
||||
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
|
||||
perror("ioctl[regClass]");
|
||||
printf("ERR:Command sending failed!\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
} else {
|
||||
printf("\nMultiDomain: %s\n",
|
||||
le32_to_cpu(multidomain_ctrl->multidomain_enable) ?
|
||||
"Enabled" : "Disabled");
|
||||
}
|
||||
|
||||
if (!le16_to_cpu(hostcmd->result)) {
|
||||
printf("HOSTCMD_RESP: ReturnCode=%#04x, Result=%#04x\n",
|
||||
le16_to_cpu(hostcmd->command),
|
||||
le16_to_cpu(hostcmd->result));
|
||||
} else {
|
||||
printf("HOSTCMD failed: ReturnCode=%#04x, Result=%#04x\n",
|
||||
le16_to_cpu(hostcmd->command),
|
||||
le16_to_cpu(hostcmd->result));
|
||||
}
|
||||
|
||||
done:
|
||||
if (buffer)
|
||||
free(buffer);
|
||||
if (cmd)
|
||||
free(cmd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Issue a regclass command
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
int
|
||||
process_regclass(int argc, char *argv[])
|
||||
{
|
||||
sub_cmd_exec_t sub_cmd[] = { {"table", 1, 1, reg_class_dump_chan_table},
|
||||
{"multidomain", 1, 1, reg_class_multidomain},
|
||||
{"country", 1, 1, reg_class_config_user_table}
|
||||
};
|
||||
|
||||
return process_sub_cmd(sub_cmd, NELEMENTS(sub_cmd), argc, argv);
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
/** @file mlanregclass.h
|
||||
*
|
||||
* @brief This files contains mlanutl regclass command handling.
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
08/11/2009: initial version
|
||||
************************************************************************/
|
||||
|
||||
#ifndef _MLANREGCLASS_H
|
||||
#define _MLANREGCLASS_H
|
||||
|
||||
/** Nomadic */
|
||||
#define BLIMIT_NOMADIC (1 << 0)
|
||||
/** Indoor */
|
||||
#define BLIMIT_INDOOR_ONLY (1 << 1)
|
||||
/** Tpc */
|
||||
#define BLIMIT_TPC (1 << 2)
|
||||
/** Dfs */
|
||||
#define BLIMIT_DFS (1 << 3)
|
||||
/** IBSS Prohibit */
|
||||
#define BLIMIT_IBSS_PROHIBIT (1 << 4)
|
||||
/** Four MS CS */
|
||||
#define BLIMIT_FOUR_MS_CS (1 << 5)
|
||||
/** LIC Base STA */
|
||||
#define BLIMIT_LIC_BASE_STA (1 << 6)
|
||||
/** Mobile STA */
|
||||
#define BLIMIT_MOBILE_STA (1 << 7)
|
||||
/** Public Safety */
|
||||
#define BLIMIT_PUBLIC_SAFETY (1 << 8)
|
||||
/** ISM Bands */
|
||||
#define BLIMIT_ISM_BANDS (1 << 9)
|
||||
|
||||
/** Enum Definitions: reg_domain */
|
||||
typedef enum {
|
||||
REGDOMAIN_NULL = 0x00,
|
||||
|
||||
REGDOMAIN_FCC = 0x01,
|
||||
REGDOMAIN_ETSI = 0x02,
|
||||
REGDOMAIN_MIC = 0x03,
|
||||
|
||||
REGDOMAIN_OTHER = 0xFF,
|
||||
|
||||
} reg_domain_e;
|
||||
|
||||
typedef struct {
|
||||
t_u8 reg_domain; /**< Domain */
|
||||
t_u8 regulatory_class;
|
||||
/**< Regulatory class */
|
||||
t_u8 chan_num; /**< Channel Number */
|
||||
t_u8 reserved1; /**< Reserved */
|
||||
t_u16 start_freq; /**< Start frequency */
|
||||
t_u16 chan_spacing; /**< channel spacing */
|
||||
t_u8 max_tx_power; /**< Max. tx power */
|
||||
t_u8 coverage_class;/**< Coverage class */
|
||||
t_u16 reg_limits; /**< Limits */
|
||||
} __ATTRIB_PACK__ chan_entry_t;
|
||||
|
||||
typedef struct {
|
||||
/** Action: GET/SET */
|
||||
t_u16 action;
|
||||
/** Reg channel table */
|
||||
t_u16 table_select;
|
||||
/** Channel number */
|
||||
t_u32 chan;
|
||||
/** Channel entry */
|
||||
chan_entry_t chan_entry[75];
|
||||
} __ATTRIB_PACK__ HostCmd_DS_REGCLASS_GET_CHAN_TABLE;
|
||||
|
||||
typedef struct {
|
||||
t_u16 action;
|
||||
/**< Action: GET/SET */
|
||||
t_u16 reserved;
|
||||
/**< Reserved */
|
||||
char regulatory_str[3];/**< Regulatory String */
|
||||
} __ATTRIB_PACK__ HostCmd_DS_REGCLASS_CONFIG_USER_TABLE;
|
||||
|
||||
typedef struct {
|
||||
t_u32 multidomain_enable;
|
||||
/**< Multi domain enable */
|
||||
} __ATTRIB_PACK__ HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL;
|
||||
|
||||
#endif /* _MLANREGCLASS_H */
|
File diff suppressed because it is too large
Load diff
|
@ -1,315 +0,0 @@
|
|||
/** @file mlanroamagent.h
|
||||
*
|
||||
* @brief This files contains mlanutl roamagent command handling.
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
08/11/2009: initial version
|
||||
************************************************************************/
|
||||
|
||||
#ifndef _MLANROAMAGENT_H_
|
||||
#define _MLANROAMAGENT_H_
|
||||
|
||||
/** Bit definitions */
|
||||
#ifndef BIT
|
||||
#define BIT(x) (1UL << (x))
|
||||
#endif
|
||||
|
||||
/* Define actionsd for HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST_MAINTENANCE */
|
||||
/** Blacklist */
|
||||
#define HostCmd_ACT_ADD_TO_BLACKLIST 0x0001
|
||||
/** Flushing blacklisted entry */
|
||||
#define HostCmd_ACT_REMOVE_FROM_BLACKLIST 0x0002
|
||||
|
||||
/** Roaming scanmode: discovery */
|
||||
#define DISCOVERY_MODE 1
|
||||
/** Roaming scanmode: tracking */
|
||||
#define TRACKING_MODE 2
|
||||
|
||||
/** Threshold configuration: RSSI */
|
||||
#define RSSI_THRESHOLD 1
|
||||
/** Threshold configuration: SNR */
|
||||
#define SNR_THRESHOLD 2
|
||||
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Bit values for Qualified Neighbor RSSI Entry */
|
||||
#define BIT_NEIGHFLAG_RSSI 0x80000000
|
||||
/** Bit values for Qualified Neighbor AGE Entry */
|
||||
#define BIT_NEIGHFLAG_AGE 0x40000000
|
||||
/** Bit values for Qualified Neighbor Blacklist Entry */
|
||||
#define BIT_NEIGHFLAG_BLACKLIST 0x20000000
|
||||
/** Bit values for Qualified Neighbor Admission Capacity */
|
||||
#define BIT_NEIGHFLAG_ADMISSION_CAP 0x10000000
|
||||
/** Bit values for Qualified Neighbor Uplink RSSI */
|
||||
#define BIT_NEIGHFLAG_UPLINK_RSSI 0x08000000
|
||||
#else
|
||||
/** Bit values for Qualified Neighbor RSSI Entry */
|
||||
#define BIT_NEIGHFLAG_RSSI 0x01
|
||||
/** Bit values for Qualified Neighbor AGE Entry */
|
||||
#define BIT_NEIGHFLAG_AGE 0x02
|
||||
/** Bit values for Qualified Neighbor Blacklist Entry */
|
||||
#define BIT_NEIGHFLAG_BLACKLIST 0x04
|
||||
/** Bit values for Qualified Neighbor Admission Capacity */
|
||||
#define BIT_NEIGHFLAG_ADMISSION_CAP 0x08
|
||||
/** Bit values for Qualified Neighbor Uplink RSSI */
|
||||
#define BIT_NEIGHFLAG_UPLINK_RSSI 0x10
|
||||
#endif
|
||||
|
||||
/** milliseconds time conversion data */
|
||||
typedef struct exactTime {
|
||||
t_u16 hrs; /**< Number of hours */
|
||||
t_u16 mins; /**< Number of minutes */
|
||||
t_u16 secs; /**< Number of seconds */
|
||||
t_u16 msecs; /**< Number of milliseconds left */
|
||||
} ExactTime_t;
|
||||
|
||||
/** ROAMAGENT HostEvent bitmasks */
|
||||
typedef enum {
|
||||
HOST_EVENT_NBOR_DISABLE = 6, /* reset bit 0 */
|
||||
HOST_EVENT_NBOR_ENABLE = 1, /* set bit 0 */
|
||||
HOST_EVENT_ROAM_DISABLE = 5, /* reset bit 1 */
|
||||
HOST_EVENT_ROAM_ENABLE = 2, /* set bit 1 */
|
||||
HOST_EVENT_STATE_DISABLE = 3, /* reset bit 2 */
|
||||
HOST_EVENT_STATE_ENABLE = 4, /* reset bit 2 */
|
||||
} __ATTRIB_PACK__ HostEvent_e;
|
||||
|
||||
/** ROAMAGENT_CONTROL command identifiers */
|
||||
typedef enum {
|
||||
ROAM_CONTROL_DISABLE = 6, /* reset bit 0 */
|
||||
ROAM_CONTROL_ENABLE = 1, /* set bit 0 */
|
||||
ROAM_CONTROL_RESUME = 5, /* reset bit 1 */
|
||||
ROAM_CONTROL_SUSPEND = 2, /* set bit 1 */
|
||||
CROSSBAND_DISABLE = 3, /* reset bit 2 */
|
||||
CROSSBAND_ENABLE = 4 /* set bit 2 */
|
||||
} __ATTRIB_PACK__ RoamControl_e;
|
||||
|
||||
/*
|
||||
* Definitions of roaming state and other constants
|
||||
*/
|
||||
/** Enum Definitations: Roaming agent state */
|
||||
typedef enum {
|
||||
STATE_DISCONNECTED,
|
||||
STATE_STABLE,
|
||||
STATE_DEGRADING,
|
||||
STATE_UNACCEPTABLE,
|
||||
STATE_HARDROAM,
|
||||
STATE_LINKLOSS,
|
||||
STATE_SOFTROAM,
|
||||
STATE_SUSPEND,
|
||||
STATE_CMD_SUSPEND,
|
||||
STATE_ASYNCASSOC_SUSPEND
|
||||
} RoamingAgentState;
|
||||
|
||||
/** statistics threshold High RSSI */
|
||||
typedef struct {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t Header;
|
||||
/** RSSI threshold (dBm) */
|
||||
t_u8 Value;
|
||||
/** reporting frequency */
|
||||
t_u8 Frequency;
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_BeaconHighRssiThreshold_t,
|
||||
MrvlIEtypes_BeaconLowRssiThreshold_t,
|
||||
MrvlIEtypes_BeaconHighSnrThreshold_t,
|
||||
MrvlIEtypes_BeaconLowSnrThreshold_t;
|
||||
|
||||
/** HostCmd_DS_CMD_ROAMAGENT_STATISTICS_THRESHOLD */
|
||||
typedef struct {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** roaming state */
|
||||
t_u8 State;
|
||||
/** active/configured user */
|
||||
t_u8 Profile;
|
||||
/** TLV buffer */
|
||||
t_u8 TlvBuffer[1];
|
||||
/* MrvlIEtypes_BeaconHighRssiThreshold_t BeaconHighRssiThreshold;
|
||||
* MrvlIEtypes_BeaconLowRssiThreshold_t BeaconLowRssiThreshold;
|
||||
* MrvlIEtypes_BeaconHighSnrThreshold_t BeaconHighSnrThreshold;
|
||||
* MrvlIEtypes_BeaconLowSnrThreshold_t BeaconLowSnrThreshold;
|
||||
* MrvlIEtypes_BeaconsMissed_t PreBeaconMissed;
|
||||
* MrvlIEtypes_FailureCount_t FailureCnt;
|
||||
*/
|
||||
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_STATISTICS_THRESHOLD;
|
||||
|
||||
typedef struct {
|
||||
/** */
|
||||
signed char RssiHighLevel;
|
||||
/** */
|
||||
signed char RssiLowLevel;
|
||||
/** */
|
||||
signed char RssiNborDiff;
|
||||
|
||||
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_ROAM_THRESHOLD;
|
||||
|
||||
#define ROAM_THRESH_MAX 4
|
||||
|
||||
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_ASSESSMENT */
|
||||
typedef struct {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** configured qualifying snr */
|
||||
signed char ConfQualSignalStrength;
|
||||
/** active qualifying snr */
|
||||
signed char ActiveQualSignalStrength;
|
||||
/** qualifying neighbor count */
|
||||
t_u16 QualifyingNumNeighbor;
|
||||
/** inactivity in # scans */
|
||||
t_u16 StaleCount;
|
||||
/** inactivity in time (ms) */
|
||||
t_u32 StalePeriod;
|
||||
/** blacklist duration in ms due to minor failures */
|
||||
t_u32 ShortBlacklistPeriod;
|
||||
/** blacklist duration in ms due to severe failures */
|
||||
t_u32 LongBlacklistPeriod;
|
||||
|
||||
HostCmd_DS_CMD_ROAMAGENT_ROAM_THRESHOLD RoamThresh[ROAM_THRESH_MAX];
|
||||
|
||||
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_ASSESSMENT;
|
||||
|
||||
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST */
|
||||
typedef struct {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** Reserved */
|
||||
t_u16 Reserved;
|
||||
/** TLV buffer */
|
||||
t_u8 TlvBuffer[1];
|
||||
/* MrvlIEtypes_NeighborEntry_t Neighbors[MRVL_ROAM_MAX_NEIGHBORS];
|
||||
* MRVL_ROAM_MAX_NEIGHBORS = 5
|
||||
*/
|
||||
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST;
|
||||
|
||||
/** neighbor entry details roaming agent */
|
||||
typedef struct {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t Header;
|
||||
/** bssid of neighbor */
|
||||
t_u8 Bssid[ETH_ALEN];
|
||||
/** Reserved */
|
||||
t_u16 Reserved;
|
||||
/** neighbor snr */
|
||||
t_s16 SignalStrength;
|
||||
/** neighbor age */
|
||||
t_u16 Age;
|
||||
/** bit map for qualified neighbor */
|
||||
t_u32 QualifiedNeighborBitmap;
|
||||
/** blacklist duration in ms */
|
||||
t_u32 BlackListDuration;
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_NeighborEntry_t;
|
||||
|
||||
/** HostCmd_DS_ROAMAGENT_ADV_METRIC_THRESHOLD */
|
||||
typedef struct {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** Beacon RSSI Metrics,Data RSSI Metrics or PER Metrics */
|
||||
t_u16 Metrics;
|
||||
/** Percentage FER Threshold value to exceed for making a roam decision */
|
||||
t_u8 UcFerThresholdValue;
|
||||
/** Percentage PER Threshold value to exceed for making a roam decision */
|
||||
t_u8 UcPerThresholdValue;
|
||||
/** Reserved for later use */
|
||||
t_u8 Reserved[2];
|
||||
/** Time (ms) for which FER should prevail in stable state */
|
||||
t_u32 StableFERPeriod_ms;
|
||||
/** Time (ms) for which FER should prevail in degrading state */
|
||||
t_u32 DegradingFERPeriod_ms;
|
||||
/** Time (ms) for which FER should prevail in unacceptable state */
|
||||
t_u32 UnacceptableFERPeriod_ms;
|
||||
/** Time (ms) for which FER should prevail in stable state */
|
||||
t_u32 StablePERPeriod_ms;
|
||||
/** Time (ms) for which PER should prevail in degrading state */
|
||||
t_u32 DegradingPERPeriod_ms;
|
||||
/** Time (ms) for which PER should prevail in unacceptable state */
|
||||
t_u32 UnacceptablePERPeriod_ms;
|
||||
/** Number of TX packets to exceed in period_ms ms for the FER for Roam */
|
||||
t_u32 UiFerPktThreshold;
|
||||
/** Number of TX packets to exceed in period_ms ms for the PER for Roam */
|
||||
t_u32 UiPerPktThreshold;
|
||||
/** Time in ms for which inactivity should prevail for state transition */
|
||||
t_u32 InactivityPeriodThreshold_ms;
|
||||
/** With Data RSSI Metrics, Roam only when RX packets in period_ms ms exceeds this */
|
||||
t_u32 UiRxPktThreshold;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_ADV_METRIC_THRESHOLD;
|
||||
|
||||
/** scan period for each search mode and state for roaming agent */
|
||||
typedef struct {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t Header;
|
||||
/** search mode */
|
||||
t_u16 SearchMode;
|
||||
/** roaming state */
|
||||
t_u16 State;
|
||||
/** scan period value */
|
||||
t_u32 ScanPeriod;
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_NeighborScanPeriod_t;
|
||||
|
||||
/** HostCmd_DS_CMD_ROAMAGENT_CONTROL */
|
||||
typedef struct {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** enable control */
|
||||
t_u8 Control;
|
||||
/** host event control */
|
||||
t_u8 HostEvent;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_CONTROL;
|
||||
|
||||
/** HostCmd_DS_CMD_ROAMAGENT_BACKOFF */
|
||||
typedef struct {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** minimum scans */
|
||||
t_u16 Scans;
|
||||
/** backoff period */
|
||||
t_u32 Period;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_BACKOFF;
|
||||
|
||||
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD */
|
||||
typedef struct {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** Reserved */
|
||||
t_u16 Reserved;
|
||||
/** scanPeriod TLV */
|
||||
MrvlIEtypes_NeighborScanPeriod_t scanPeriod;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD;
|
||||
|
||||
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD_RSP */
|
||||
typedef struct {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** Reserved */
|
||||
t_u16 Reserved;
|
||||
/** TLV buffer */
|
||||
t_u8 TlvBuffer[1];
|
||||
/* MrvlIEtypes_NeighborScanPeriod_t scanPeriod[MRVL_ROAM_SCAN_PERIODS];
|
||||
* MRVL_ROAM_SCAN_PERIODS = 6
|
||||
*/
|
||||
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD_RSP;
|
||||
|
||||
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST_MAINTENANCE */
|
||||
typedef struct {
|
||||
/** Action */
|
||||
t_u16 action;
|
||||
/** BSSID */
|
||||
t_u8 BSSID[ETH_ALEN];
|
||||
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST_MAINTENANCE;
|
||||
|
||||
#endif /* _MLANROAMAGENT_H_ */
|
|
@ -1,841 +0,0 @@
|
|||
/** @file mlanscanagent.c
|
||||
*
|
||||
* @brief This files contains mlanutl scanagent command handling.
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
08/11/2009: initial version
|
||||
************************************************************************/
|
||||
|
||||
#include "mlanutl.h"
|
||||
#include "mlanhostcmd.h"
|
||||
#include "mlanoffload.h"
|
||||
#include "mlanscanagent.h"
|
||||
|
||||
/********************************************************
|
||||
Local Variables
|
||||
********************************************************/
|
||||
|
||||
/********************************************************
|
||||
Global Variables
|
||||
********************************************************/
|
||||
|
||||
/********************************************************
|
||||
Local Functions
|
||||
********************************************************/
|
||||
|
||||
/**
|
||||
* @brief scanagent configure scan table
|
||||
*
|
||||
* @param age_limit age limit
|
||||
* @param hold_limit hold limit
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
|
||||
*/
|
||||
static int
|
||||
scanagent_cfg_scan_table_limits(t_u32 age_limit, t_u32 hold_limit)
|
||||
{
|
||||
int ret = 0;
|
||||
struct ifreq ifr;
|
||||
t_u8 *buffer = NULL, *pos = NULL;
|
||||
t_u32 cmd_len = 0, cmd_header_len;
|
||||
struct eth_priv_cmd *cmd = NULL;
|
||||
HostCmd_DS_GEN *hostcmd = NULL;
|
||||
HostCmd_DS_SCANAGENT_SCAN_TABLE_LIMITS *scan_table_limits = NULL;
|
||||
|
||||
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
|
||||
cmd_len = S_DS_GEN + sizeof(HostCmd_DS_SCANAGENT_SCAN_TABLE_LIMITS);
|
||||
|
||||
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
|
||||
if (buffer == NULL) {
|
||||
fprintf(stderr, "Cannot alloc memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(buffer, 0, BUFFER_LENGTH);
|
||||
|
||||
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
|
||||
if (!cmd) {
|
||||
printf("ERR:Cannot allocate buffer for command!\n");
|
||||
free(buffer);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Fill up buffer */
|
||||
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
|
||||
memset(cmd, 0, sizeof(struct eth_priv_cmd));
|
||||
memcpy(&cmd->buf, &buffer, sizeof(buffer));
|
||||
#else
|
||||
cmd->buf = buffer;
|
||||
#endif
|
||||
cmd->used_len = 0;
|
||||
cmd->total_len = BUFFER_LENGTH;
|
||||
|
||||
/* buffer = MRVL_CMD<cmd> */
|
||||
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
|
||||
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
|
||||
|
||||
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
|
||||
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_SCANAGENT_SCAN_TABLE_LIMITS);
|
||||
hostcmd->size = cpu_to_le16(cmd_len);
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
|
||||
/* Put buffer length */
|
||||
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
|
||||
|
||||
/* Point after host command header */
|
||||
pos = (t_u8 *)hostcmd + S_DS_GEN;
|
||||
|
||||
scan_table_limits = (HostCmd_DS_SCANAGENT_SCAN_TABLE_LIMITS *)pos;
|
||||
scan_table_limits->table_age_limit = cpu_to_le16(age_limit);
|
||||
scan_table_limits->table_hold_limit = cpu_to_le16(hold_limit);
|
||||
|
||||
/* 0 set values are ignored by firmware */
|
||||
scan_table_limits->action = cpu_to_le16(HostCmd_ACT_GEN_SET);
|
||||
|
||||
/* Initialize the ifr structure */
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
|
||||
ifr.ifr_ifru.ifru_data = (void *)cmd;
|
||||
/* Perform ioctl */
|
||||
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
|
||||
perror("ioctl[scanAgentIoctl]");
|
||||
printf("ERR:Command sending failed!\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
printf("\nAge limit = %7d seconds\n",
|
||||
le16_to_cpu(scan_table_limits->table_age_limit));
|
||||
printf("Hold limit = %7d seconds\n\n",
|
||||
le16_to_cpu(scan_table_limits->table_hold_limit));
|
||||
|
||||
done:
|
||||
if (buffer)
|
||||
free(buffer);
|
||||
if (cmd)
|
||||
free(cmd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set scanagent age limit
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
|
||||
*/
|
||||
static int
|
||||
scanagent_age_limit(int argc, char *argv[])
|
||||
{
|
||||
t_u32 age_limit = 0;
|
||||
|
||||
if (argc) {
|
||||
age_limit = atoi(argv[0]);
|
||||
}
|
||||
|
||||
return scanagent_cfg_scan_table_limits(age_limit, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set scanagent hold limit
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
|
||||
*/
|
||||
static int
|
||||
scanagent_hold_limit(int argc, char *argv[])
|
||||
{
|
||||
t_u32 hold_limit = 0;
|
||||
|
||||
if (argc) {
|
||||
hold_limit = atoi(argv[0]);
|
||||
}
|
||||
|
||||
return scanagent_cfg_scan_table_limits(0, hold_limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set scanagent scan timing
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
|
||||
*/
|
||||
static int
|
||||
scanagent_timing(int argc, char *argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
struct ifreq ifr;
|
||||
int idx;
|
||||
t_u8 *buffer = NULL, *pos = NULL;
|
||||
t_u32 cmd_len = 0, cmd_header_len = 0, sel = 0;
|
||||
struct eth_priv_cmd *cmd = NULL;
|
||||
HostCmd_DS_GEN *hostcmd = NULL;
|
||||
HostCmd_DS_SCANAGENT_CONFIG_TIMING *cfg_timing_cmd = NULL;
|
||||
MrvlIEtypes_ConfigScanTiming_t *cfg_timing_tlv = NULL;
|
||||
timing_sel_t sel_str[] = { {"disconnected", 1},
|
||||
{"adhoc", 1},
|
||||
{"fullpower", 1},
|
||||
{"ieeeps", 1},
|
||||
{"periodic", 1}
|
||||
};
|
||||
|
||||
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
|
||||
cmd_len = S_DS_GEN + sizeof(t_u16);
|
||||
|
||||
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
|
||||
if (buffer == NULL) {
|
||||
fprintf(stderr, "Cannot alloc memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(buffer, 0, BUFFER_LENGTH);
|
||||
|
||||
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
|
||||
if (!cmd) {
|
||||
printf("ERR:Cannot allocate buffer for command!\n");
|
||||
free(buffer);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Fill up buffer */
|
||||
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
|
||||
memset(cmd, 0, sizeof(struct eth_priv_cmd));
|
||||
memcpy(&cmd->buf, &buffer, sizeof(buffer));
|
||||
#else
|
||||
cmd->buf = buffer;
|
||||
#endif
|
||||
cmd->used_len = 0;
|
||||
cmd->total_len = BUFFER_LENGTH;
|
||||
|
||||
/* buffer = MRVL_CMD<cmd> */
|
||||
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
|
||||
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
|
||||
|
||||
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
|
||||
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_SCANAGENT_SCAN_TIMING);
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
|
||||
/* Point after host command header */
|
||||
pos = (t_u8 *)hostcmd + S_DS_GEN;
|
||||
|
||||
cfg_timing_cmd = (HostCmd_DS_SCANAGENT_CONFIG_TIMING *)pos;
|
||||
cfg_timing_cmd->action = cpu_to_le16(HostCmd_ACT_GEN_GET);
|
||||
|
||||
cfg_timing_tlv
|
||||
= (MrvlIEtypes_ConfigScanTiming_t *)cfg_timing_cmd->tlv_buffer;
|
||||
|
||||
if (argc == 5) {
|
||||
cfg_timing_cmd->action = cpu_to_le16(HostCmd_ACT_GEN_SET);
|
||||
cfg_timing_tlv->header.type = cpu_to_le16(TLV_TYPE_SCAN_TIMING);
|
||||
cfg_timing_tlv->header.len =
|
||||
cpu_to_le16(sizeof(MrvlIEtypes_ConfigScanTiming_t)
|
||||
- sizeof(cfg_timing_tlv->header));
|
||||
|
||||
for (idx = 0; (unsigned int)idx < NELEMENTS(sel_str); idx++) {
|
||||
if (strncmp(argv[0],
|
||||
sel_str[idx].str,
|
||||
sel_str[idx].match_len) == 0) {
|
||||
sel = idx + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (idx == NELEMENTS(sel_str)) {
|
||||
printf("Wrong argument for mode selected \"%s\"\n",
|
||||
argv[0]);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/*
|
||||
* HostCmd_DS_ScanagentTimingMode_e;
|
||||
* TIMING_MODE_INVALID = 0,
|
||||
* TIMING_MODE_DISCONNECTED = 1,
|
||||
* TIMING_MODE_ADHOC = 2,
|
||||
* TIMING_MODE_FULL_POWER = 3,
|
||||
* TIMING_MODE_IEEE_PS = 4,
|
||||
* TIMING_MODE_PERIODIC_PS = 5,
|
||||
*/
|
||||
cfg_timing_tlv->mode = cpu_to_le32(sel);
|
||||
cfg_timing_tlv->dwell = cpu_to_le32(atoi(argv[1]));
|
||||
cfg_timing_tlv->max_off = cpu_to_le32(atoi(argv[2]));
|
||||
cfg_timing_tlv->min_link = cpu_to_le32(atoi(argv[3]));
|
||||
cfg_timing_tlv->rsp_timeout = cpu_to_le32(atoi(argv[4]));
|
||||
|
||||
cmd_len += sizeof(MrvlIEtypes_ConfigScanTiming_t);
|
||||
}
|
||||
|
||||
hostcmd->size = cpu_to_le16(cmd_len);
|
||||
|
||||
/* Put buffer length */
|
||||
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
|
||||
|
||||
/* Initialize the ifr structure */
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
|
||||
ifr.ifr_ifru.ifru_data = (void *)cmd;
|
||||
/* Perform ioctl */
|
||||
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
|
||||
perror("ioctl[scanAgentIoctl]");
|
||||
printf("ERR:Command sending failed!\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ret = process_host_cmd_resp(HOSTCMD, buffer);
|
||||
|
||||
done:
|
||||
if (buffer)
|
||||
free(buffer);
|
||||
if (cmd)
|
||||
free(cmd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set scanagent profile scan period
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
|
||||
*/
|
||||
static int
|
||||
scanagent_profile_period(int argc, char *argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
struct ifreq ifr;
|
||||
t_u8 *buffer = NULL, *pos = NULL;
|
||||
t_u32 cmd_len = 0, cmd_header_len = 0;
|
||||
struct eth_priv_cmd *cmd = NULL;
|
||||
HostCmd_DS_GEN *hostcmd = NULL;
|
||||
HostCmd_DS_SCANAGENT_CONFIG_PROFILE_SCAN *cfg_profile_scan = NULL;
|
||||
|
||||
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
|
||||
cmd_len = S_DS_GEN + sizeof(HostCmd_DS_SCANAGENT_CONFIG_PROFILE_SCAN);
|
||||
|
||||
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
|
||||
if (buffer == NULL) {
|
||||
fprintf(stderr, "Cannot alloc memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(buffer, 0, BUFFER_LENGTH);
|
||||
|
||||
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
|
||||
if (!cmd) {
|
||||
printf("ERR:Cannot allocate buffer for command!\n");
|
||||
free(buffer);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Fill up buffer */
|
||||
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
|
||||
memset(cmd, 0, sizeof(struct eth_priv_cmd));
|
||||
memcpy(&cmd->buf, &buffer, sizeof(buffer));
|
||||
#else
|
||||
cmd->buf = buffer;
|
||||
#endif
|
||||
cmd->used_len = 0;
|
||||
cmd->total_len = BUFFER_LENGTH;
|
||||
|
||||
/* buffer = MRVL_CMD<cmd> */
|
||||
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
|
||||
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
|
||||
|
||||
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
|
||||
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
|
||||
hostcmd->command =
|
||||
cpu_to_le16(HostCmd_CMD_SCANAGENT_CONFIG_PROFILE_SCAN);
|
||||
hostcmd->size = cpu_to_le16(cmd_len);
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
|
||||
/* Point after host command header */
|
||||
pos = (t_u8 *)hostcmd + S_DS_GEN;
|
||||
|
||||
cfg_profile_scan = (HostCmd_DS_SCANAGENT_CONFIG_PROFILE_SCAN *)pos;
|
||||
if (argc == 1) {
|
||||
cfg_profile_scan->action = cpu_to_le16(HostCmd_ACT_GEN_SET);
|
||||
cfg_profile_scan->scan_interval = cpu_to_le16(atoi(argv[0]));
|
||||
} else {
|
||||
cfg_profile_scan->action = cpu_to_le16(HostCmd_ACT_GEN_GET);
|
||||
}
|
||||
|
||||
/* Put buffer length */
|
||||
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
|
||||
|
||||
/* Initialize the ifr structure */
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
|
||||
ifr.ifr_ifru.ifru_data = (void *)cmd;
|
||||
/* Perform ioctl */
|
||||
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
|
||||
perror("ioctl[scanAgentIoctl]");
|
||||
printf("ERR:Command sending failed!\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
cfg_profile_scan->scan_interval =
|
||||
le16_to_cpu(cfg_profile_scan->scan_interval);
|
||||
if ((int)cfg_profile_scan->scan_interval == 0)
|
||||
printf("\nProfile Scan interval: <disabled>\n\n");
|
||||
else
|
||||
printf("\nProfile Scan interval: %d seconds\n\n",
|
||||
(int)cfg_profile_scan->scan_interval);
|
||||
|
||||
done:
|
||||
if (buffer)
|
||||
free(buffer);
|
||||
if (cmd)
|
||||
free(cmd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief scanagent parse entry selection
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
* @param psel A pointer to scanagent entry selection
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static void
|
||||
scanAgentParseEntrySel(int argc, char *argv[],
|
||||
HostCmd_DS_SCANAGENT_TABLE_MAINTENANCE *psel,
|
||||
int *cmd_len)
|
||||
{
|
||||
int arg_idx, tmp_idx;
|
||||
t_u8 *tlv_pos;
|
||||
MrvlIEtypes_SsIdParamSet_t *ssid;
|
||||
MrvlIEtypes_Bssid_List_t *bssid;
|
||||
unsigned int mac[ETH_ALEN];
|
||||
|
||||
tlv_pos = (t_u8 *)psel->tlv_buffer;
|
||||
|
||||
for (arg_idx = 0; arg_idx < argc; arg_idx++) {
|
||||
if (strncmp(argv[arg_idx], "ssid=", strlen("ssid=")) == 0) {
|
||||
ssid = (MrvlIEtypes_SsIdParamSet_t *)tlv_pos;
|
||||
ssid->header.type = cpu_to_le16(TLV_TYPE_SSID);
|
||||
ssid->header.len =
|
||||
strlen(argv[arg_idx]) - strlen("ssid=");
|
||||
strncpy((char *)ssid->ssid,
|
||||
(argv[arg_idx] + strlen("ssid=")),
|
||||
ssid->header.len);
|
||||
tlv_pos +=
|
||||
ssid->header.len + sizeof(MrvlIEtypesHeader_t);
|
||||
ssid->header.len = cpu_to_le16(ssid->header.len);
|
||||
|
||||
} else if (strncmp(argv[arg_idx], "bssid=", strlen("bssid=")) ==
|
||||
0) {
|
||||
bssid = (MrvlIEtypes_Bssid_List_t *)tlv_pos;
|
||||
bssid->header.type = cpu_to_le16(TLV_TYPE_BSSID);
|
||||
bssid->header.len = ETH_ALEN;
|
||||
/*
|
||||
* "bssid" token string handler
|
||||
*/
|
||||
sscanf(argv[arg_idx] + strlen("bssid="),
|
||||
"%2x:%2x:%2x:%2x:%2x:%2x", mac + 0, mac + 1,
|
||||
mac + 2, mac + 3, mac + 4, mac + 5);
|
||||
for (tmp_idx = 0;
|
||||
(unsigned int)tmp_idx < NELEMENTS(mac);
|
||||
tmp_idx++) {
|
||||
bssid->bssid[tmp_idx] = (t_u8)mac[tmp_idx];
|
||||
}
|
||||
tlv_pos +=
|
||||
bssid->header.len + sizeof(MrvlIEtypesHeader_t);
|
||||
bssid->header.len = cpu_to_le16(bssid->header.len);
|
||||
|
||||
} else if (strncmp(argv[arg_idx], "age=", strlen("age=")) == 0) {
|
||||
psel->age =
|
||||
cpu_to_le32(atoi
|
||||
(argv[arg_idx] + strlen("age=")));
|
||||
|
||||
} else if (strncmp(argv[arg_idx], "id=", strlen("id=")) == 0) {
|
||||
psel->scan_request_id =
|
||||
cpu_to_le32(atoi
|
||||
(argv[arg_idx] + strlen("id=")));
|
||||
}
|
||||
}
|
||||
|
||||
*cmd_len += (tlv_pos - psel->tlv_buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief scanagent execute scan
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
|
||||
*/
|
||||
static int
|
||||
scanagent_exec_scan(int argc, char *argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
struct ifreq ifr;
|
||||
int arg_idx, tmp_idx;
|
||||
t_u32 cmd_len = 0, cmd_header_len = 0;
|
||||
t_u8 *buffer = NULL, *pos = NULL, *tlv_pos = NULL;
|
||||
struct eth_priv_cmd *cmd = NULL;
|
||||
HostCmd_DS_GEN *hostcmd = NULL;
|
||||
HostCmd_DS_SCANAGENT_SCAN_EXEC *scan_exec = NULL;
|
||||
MrvlIEtypes_SsIdParamSet_t *ssid = NULL;
|
||||
MrvlIEtypes_Bssid_List_t *bssid = NULL;
|
||||
MrvlIEtypes_ConfigScanTiming_t *cfg_timing_tlv = NULL;
|
||||
unsigned int mac[ETH_ALEN];
|
||||
|
||||
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
|
||||
cmd_len = (S_DS_GEN + sizeof(HostCmd_DS_SCANAGENT_SCAN_EXEC)
|
||||
- sizeof(scan_exec->tlv_buffer));
|
||||
|
||||
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
|
||||
if (buffer == NULL) {
|
||||
fprintf(stderr, "Cannot alloc memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(buffer, 0, BUFFER_LENGTH);
|
||||
|
||||
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
|
||||
if (!cmd) {
|
||||
printf("ERR:Cannot allocate buffer for command!\n");
|
||||
free(buffer);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Fill up buffer */
|
||||
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
|
||||
memset(cmd, 0, sizeof(struct eth_priv_cmd));
|
||||
memcpy(&cmd->buf, &buffer, sizeof(buffer));
|
||||
#else
|
||||
cmd->buf = buffer;
|
||||
#endif
|
||||
cmd->used_len = 0;
|
||||
cmd->total_len = BUFFER_LENGTH;
|
||||
|
||||
/* buffer = MRVL_CMD<cmd> */
|
||||
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
|
||||
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
|
||||
|
||||
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
|
||||
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_SCANAGENT_SCAN_EXEC);
|
||||
hostcmd->size = 0;
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
|
||||
/* Point after host command header */
|
||||
pos = (t_u8 *)hostcmd + S_DS_GEN;
|
||||
|
||||
scan_exec = (HostCmd_DS_SCANAGENT_SCAN_EXEC *)pos;
|
||||
tlv_pos = scan_exec->tlv_buffer;
|
||||
|
||||
for (arg_idx = 0; arg_idx < argc; arg_idx++) {
|
||||
if (strncmp(argv[arg_idx], "ssid=", strlen("ssid=")) == 0) {
|
||||
/*
|
||||
* "ssid" token string handler
|
||||
*/
|
||||
ssid = (MrvlIEtypes_SsIdParamSet_t *)tlv_pos;
|
||||
ssid->header.type = cpu_to_le16(TLV_TYPE_SSID);
|
||||
ssid->header.len =
|
||||
strlen(argv[arg_idx]) - strlen("ssid=");
|
||||
strncpy((char *)ssid->ssid,
|
||||
argv[arg_idx] + strlen("ssid="),
|
||||
ssid->header.len);
|
||||
tlv_pos +=
|
||||
ssid->header.len + sizeof(MrvlIEtypesHeader_t);
|
||||
ssid->header.len = cpu_to_le16(ssid->header.len);
|
||||
} else if (strncmp(argv[arg_idx], "bssid=", strlen("bssid=")) ==
|
||||
0) {
|
||||
bssid = (MrvlIEtypes_Bssid_List_t *)tlv_pos;
|
||||
bssid->header.type = cpu_to_le16(TLV_TYPE_BSSID);
|
||||
bssid->header.len = ETH_ALEN;
|
||||
/*
|
||||
* "bssid" token string handler
|
||||
*/
|
||||
sscanf(argv[arg_idx] + strlen("bssid="),
|
||||
"%2x:%2x:%2x:%2x:%2x:%2x", mac + 0, mac + 1,
|
||||
mac + 2, mac + 3, mac + 4, mac + 5);
|
||||
for (tmp_idx = 0;
|
||||
(unsigned int)tmp_idx < NELEMENTS(mac);
|
||||
tmp_idx++) {
|
||||
bssid->bssid[tmp_idx] = (t_u8)mac[tmp_idx];
|
||||
}
|
||||
tlv_pos +=
|
||||
bssid->header.len + sizeof(MrvlIEtypesHeader_t);
|
||||
bssid->header.len = cpu_to_le16(bssid->header.len);
|
||||
} else if (strncmp(argv[arg_idx], "type=", strlen("type=")) ==
|
||||
0) {
|
||||
/*
|
||||
if (strcmp(argv[arg_idx] + strlen("type="), "prof") == 0) {
|
||||
scan_exec->scan_type = CONFIG_PROFILE;
|
||||
} else {
|
||||
scan_exec->scan_type = CONFIG_SITE_SURVEY;
|
||||
}
|
||||
*/
|
||||
scan_exec->scan_type = CONFIG_SITE_SURVEY;
|
||||
scan_exec->scan_type =
|
||||
cpu_to_le16(scan_exec->scan_type);
|
||||
} else if (strncmp(argv[arg_idx], "group=", strlen("group=")) ==
|
||||
0) {
|
||||
sscanf(argv[arg_idx] + strlen("group="), "0x%x",
|
||||
&tmp_idx);
|
||||
scan_exec->chan_group = cpu_to_le32(tmp_idx);
|
||||
} else if (strncmp(argv[arg_idx], "delay=", strlen("delay=")) ==
|
||||
0) {
|
||||
/*
|
||||
* "delay" token string handler
|
||||
*/
|
||||
sscanf(argv[arg_idx] + strlen("delay="),
|
||||
"%d", (int *)&scan_exec->delay);
|
||||
scan_exec->delay = cpu_to_le32(scan_exec->delay);
|
||||
} else if (strncmp(argv[arg_idx], "timing=", strlen("timing="))
|
||||
== 0) {
|
||||
cfg_timing_tlv =
|
||||
(MrvlIEtypes_ConfigScanTiming_t *)tlv_pos;
|
||||
cfg_timing_tlv->header.type =
|
||||
cpu_to_le16(TLV_TYPE_SCAN_TIMING);
|
||||
cfg_timing_tlv->header.len = ((sizeof(cfg_timing_tlv)
|
||||
-
|
||||
sizeof(cfg_timing_tlv->
|
||||
header)));
|
||||
/*
|
||||
* "timing" token string handler
|
||||
*/
|
||||
sscanf(argv[arg_idx] + strlen("timing="), "%d,%d,%d,%d",
|
||||
(int *)&cfg_timing_tlv->dwell,
|
||||
(int *)&cfg_timing_tlv->max_off,
|
||||
(int *)&cfg_timing_tlv->min_link,
|
||||
(int *)&cfg_timing_tlv->rsp_timeout);
|
||||
|
||||
cfg_timing_tlv->mode = 0;
|
||||
cfg_timing_tlv->dwell =
|
||||
cpu_to_le32(cfg_timing_tlv->dwell);
|
||||
cfg_timing_tlv->max_off =
|
||||
cpu_to_le32(cfg_timing_tlv->max_off);
|
||||
cfg_timing_tlv->min_link =
|
||||
cpu_to_le32(cfg_timing_tlv->min_link);
|
||||
cfg_timing_tlv->rsp_timeout =
|
||||
cpu_to_le32(cfg_timing_tlv->rsp_timeout);
|
||||
|
||||
tlv_pos += sizeof(MrvlIEtypesHeader_t);
|
||||
tlv_pos += cfg_timing_tlv->header.len;
|
||||
cfg_timing_tlv->header.len =
|
||||
cpu_to_le16(cfg_timing_tlv->header.len);
|
||||
}
|
||||
}
|
||||
|
||||
cmd_len += (tlv_pos - scan_exec->tlv_buffer);
|
||||
hostcmd->size = cpu_to_le16(cmd_len);
|
||||
|
||||
/* Put buffer length */
|
||||
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
|
||||
|
||||
/* Initialize the ifr structure */
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
|
||||
ifr.ifr_ifru.ifru_data = (void *)cmd;
|
||||
/* Perform ioctl */
|
||||
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
|
||||
perror("ioctl[scanAgentIoctl]");
|
||||
printf("ERR:Command sending failed!\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
} else {
|
||||
printf("\nScan Scheduled, ID = %d\n\n",
|
||||
(int)le32_to_cpu(scan_exec->scan_req_id_out));
|
||||
}
|
||||
|
||||
done:
|
||||
if (buffer)
|
||||
free(buffer);
|
||||
if (cmd)
|
||||
free(cmd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Issue a scanagent cmd_type subcommand
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
* @param cmd_type command type
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
|
||||
*/
|
||||
static int
|
||||
scanagent_table_entry_sub_cmd(int argc, char *argv[],
|
||||
HostCmd_DS_ScanagentTableMaintenance_e cmd_type)
|
||||
{
|
||||
int ret = 0;
|
||||
struct ifreq ifr;
|
||||
t_u8 *buffer = NULL, *pos = NULL;
|
||||
t_u32 cmd_len = 0, cmd_header_len = 0;
|
||||
struct eth_priv_cmd *cmd = NULL;
|
||||
HostCmd_DS_GEN *hostcmd = NULL;
|
||||
HostCmd_DS_SCANAGENT_TABLE_MAINTENANCE *table_maintenance = NULL;
|
||||
|
||||
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
|
||||
cmd_len = (S_DS_GEN + sizeof(HostCmd_DS_SCANAGENT_TABLE_MAINTENANCE)
|
||||
- sizeof(table_maintenance->tlv_buffer));
|
||||
|
||||
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
|
||||
if (buffer == NULL) {
|
||||
fprintf(stderr, "Cannot alloc memory\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(buffer, 0, BUFFER_LENGTH);
|
||||
|
||||
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
|
||||
if (!cmd) {
|
||||
printf("ERR:Cannot allocate buffer for command!\n");
|
||||
free(buffer);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
/* Fill up buffer */
|
||||
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
|
||||
memset(cmd, 0, sizeof(struct eth_priv_cmd));
|
||||
memcpy(&cmd->buf, &buffer, sizeof(buffer));
|
||||
#else
|
||||
cmd->buf = buffer;
|
||||
#endif
|
||||
cmd->used_len = 0;
|
||||
cmd->total_len = BUFFER_LENGTH;
|
||||
|
||||
/* buffer = MRVL_CMD<cmd> */
|
||||
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
|
||||
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
|
||||
|
||||
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
|
||||
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
|
||||
hostcmd->command = cpu_to_le16(HostCmd_CMD_SCANAGENT_TABLE_MAINTENANCE);
|
||||
hostcmd->size = 0;
|
||||
hostcmd->seq_num = 0;
|
||||
hostcmd->result = 0;
|
||||
|
||||
/* Point after host command header */
|
||||
pos = (t_u8 *)hostcmd + S_DS_GEN;
|
||||
|
||||
table_maintenance = (HostCmd_DS_SCANAGENT_TABLE_MAINTENANCE *)pos;
|
||||
table_maintenance->action = cpu_to_le16((t_u16)cmd_type);
|
||||
|
||||
scanAgentParseEntrySel(argc, argv, table_maintenance, (int *)&cmd_len);
|
||||
|
||||
hostcmd->size = cpu_to_le16(cmd_len);
|
||||
|
||||
/* Put buffer length */
|
||||
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
|
||||
|
||||
/* Initialize the ifr structure */
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
|
||||
ifr.ifr_ifru.ifru_data = (void *)cmd;
|
||||
/* Perform ioctl */
|
||||
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
|
||||
perror("ioctl[scanAgentIoctl]");
|
||||
printf("ERR:Command sending failed!\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
done:
|
||||
if (buffer)
|
||||
free(buffer);
|
||||
if (cmd)
|
||||
free(cmd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Issue a scanagent table lock subcommand
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
|
||||
*/
|
||||
static int
|
||||
scanagent_table_lock(int argc, char *argv[])
|
||||
{
|
||||
return scanagent_table_entry_sub_cmd(argc, argv, SCAN_TABLE_OP_LOCK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Issue a scanagent table unlock subcommand
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
|
||||
*/
|
||||
static int
|
||||
scanagent_table_unlock(int argc, char *argv[])
|
||||
{
|
||||
return scanagent_table_entry_sub_cmd(argc, argv, SCAN_TABLE_OP_UNLOCK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Issue a scanagent table purge subcommand
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
|
||||
*/
|
||||
static int
|
||||
scanagent_table_purge(int argc, char *argv[])
|
||||
{
|
||||
return scanagent_table_entry_sub_cmd(argc, argv, SCAN_TABLE_OP_PURGE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Issue a scanagent command
|
||||
*
|
||||
* @param argc number of arguments
|
||||
* @param argv A pointer to arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
|
||||
*/
|
||||
int
|
||||
process_scanagent(int argc, char *argv[])
|
||||
{
|
||||
sub_cmd_exec_t sub_cmd[] = {
|
||||
{"timing", 2, 1, scanagent_timing},
|
||||
{"scan", 2, 1, scanagent_exec_scan},
|
||||
{"lock", 2, 1, scanagent_table_lock},
|
||||
{"unlock", 2, 1, scanagent_table_unlock},
|
||||
{"purge", 2, 1, scanagent_table_purge},
|
||||
{"profile", 2, 1, scanagent_profile_period},
|
||||
{"holdlimit", 2, 1, scanagent_hold_limit},
|
||||
{"agelimit", 2, 1, scanagent_age_limit}
|
||||
};
|
||||
|
||||
return process_sub_cmd(sub_cmd, NELEMENTS(sub_cmd), argc, argv);
|
||||
}
|
|
@ -1,150 +0,0 @@
|
|||
/** @file mlanscanagent.h
|
||||
*
|
||||
* @brief This files contains mlanutl scanagent command handling.
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
08/11/2009: initial version
|
||||
************************************************************************/
|
||||
|
||||
#ifndef _MLAN_SCANAGENT_H_
|
||||
#define _MLAN_SCANAGENT_H_
|
||||
|
||||
typedef struct {
|
||||
/** Action GET or SET */
|
||||
t_u16 action;
|
||||
/** scan interval */
|
||||
t_u16 scan_interval;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_CONFIG_PROFILE_SCAN;
|
||||
|
||||
typedef struct {
|
||||
t_u32 scan_req_id_out;
|
||||
/**< Scan request id */
|
||||
t_u32 delay; /**< Delay */
|
||||
t_u32 chan_group; /**< Channel Group */
|
||||
t_u16 scan_type; /**< Scan type */
|
||||
t_u16 reserved; /**< Reserved */
|
||||
|
||||
t_u8 tlv_buffer[1]; /**< Rest is TLV buffer */
|
||||
|
||||
/* MrvlIEtypes_SsIdParamSet_t
|
||||
* MrvlIEtypes_Bssid_List_t
|
||||
* MrvlIEtypes_ConfigScanTiming_t
|
||||
*/
|
||||
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_SCAN_EXEC;
|
||||
|
||||
typedef struct {
|
||||
/** Action Set or get */
|
||||
t_u16 action;
|
||||
/** Reserved */
|
||||
t_u16 reserved;
|
||||
/** Table age limit */
|
||||
t_u16 table_age_limit;
|
||||
/** Table hold limit */
|
||||
t_u16 table_hold_limit;
|
||||
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_SCAN_TABLE_LIMITS;
|
||||
|
||||
typedef struct {
|
||||
/** Action Set or get */
|
||||
t_u16 action;
|
||||
/** TLV buffer starts here */
|
||||
t_u8 tlv_buffer[1];
|
||||
/* MrvlIEtypes_ConfigScanTiming_t */
|
||||
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_CONFIG_TIMING;
|
||||
|
||||
typedef struct {
|
||||
/** HostCmd_DS_ScanagentTableMaintenance_e action */
|
||||
t_u16 action;
|
||||
/** Reserved */
|
||||
t_u16 reserved;
|
||||
/** Request Id, 0 to disable */
|
||||
t_u32 scan_request_id;
|
||||
/** Age, 0 to disable */
|
||||
t_u32 age;
|
||||
/** TLV Buffer follows */
|
||||
t_u8 tlv_buffer[1];
|
||||
|
||||
/* MrvlIEtypes_SsIdParamSet_t
|
||||
* MrvlIEtypes_Bssid_List_t
|
||||
*/
|
||||
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_TABLE_MAINTENANCE;
|
||||
|
||||
/** ENUM definition: Scanagent Table Maintenance */
|
||||
typedef enum {
|
||||
SCAN_TABLE_OP_INVALID = 0,
|
||||
|
||||
SCAN_TABLE_OP_LOCK = 1,
|
||||
SCAN_TABLE_OP_UNLOCK = 2,
|
||||
SCAN_TABLE_OP_PURGE = 3,
|
||||
|
||||
} __ATTRIB_PACK__ HostCmd_DS_ScanagentTableMaintenance_e;
|
||||
|
||||
/** MrvlIEtypes_SsIdParamSet_t */
|
||||
typedef struct _MrvlIEtypes_SsIdParamSet_t {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** SSID */
|
||||
t_u8 ssid[1];
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_SsIdParamSet_t;
|
||||
|
||||
/** _MrvlIEtypes_Bssid_List_t */
|
||||
typedef struct _MrvlIEtypes_Bssid_List_t {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
/** BSSID */
|
||||
t_u8 bssid[ETH_ALEN];
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_Bssid_List_t;
|
||||
|
||||
typedef struct {
|
||||
/** Header */
|
||||
MrvlIEtypesHeader_t header;
|
||||
|
||||
t_u32 mode; /**< Mode */
|
||||
t_u32 dwell; /**< Dwell */
|
||||
t_u32 max_off; /**< Max. off */
|
||||
t_u32 min_link;/**< Minimum Link */
|
||||
t_u32 rsp_timeout;
|
||||
/**< Rsp Timeout */
|
||||
|
||||
} __ATTRIB_PACK__ MrvlIEtypes_ConfigScanTiming_t;
|
||||
|
||||
/** ENUM definition: ScanAgentScanType */
|
||||
typedef enum {
|
||||
CONFIG_SITE_SURVEY = 0,
|
||||
CONFIG_NEIGHBOR = 1,
|
||||
CONFIG_PROFILE = 2,
|
||||
CONFIG_ARBITRARY_CHANNEL = 3,
|
||||
|
||||
} __ATTRIB_PACK__ HostCmd_DS_ScanagentScanType_e;
|
||||
|
||||
/** ENUM definition: ScanAgentScanTimingMode */
|
||||
typedef enum {
|
||||
TIMING_MODE_INVALID = 0,
|
||||
|
||||
TIMING_MODE_DISCONNECTED = 1,
|
||||
TIMING_MODE_ADHOC = 2,
|
||||
TIMING_MODE_FULL_POWER = 3,
|
||||
TIMING_MODE_IEEE_PS = 4,
|
||||
TIMING_MODE_PERIODIC_PS = 5,
|
||||
|
||||
} __ATTRIB_PACK__HostCmd_DS_ScanagentTimingMode_e;
|
||||
|
||||
int process_host_cmd_resp(char *cmd_name, t_u8 *buf);
|
||||
#endif /* _MLAN_SCANAGENT_H_ */
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,414 +0,0 @@
|
|||
/** @file timestamp.c
|
||||
*
|
||||
* @brief Functions for timestamping feature
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "timestamp.h"
|
||||
#include "time.h"
|
||||
|
||||
/* GLobal Declarations */
|
||||
struct timespec send_time;
|
||||
struct interface_data inter;
|
||||
|
||||
/**
|
||||
*@brief Receive Timestamps
|
||||
*
|
||||
*@param argc Number of arguments
|
||||
*@param argv Pointer to the arguments array
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_FAILURE
|
||||
**/
|
||||
void
|
||||
receive_timestamp(int argc, char *argv[])
|
||||
{
|
||||
int sockfd;
|
||||
int sockopt;
|
||||
char ifName[IFNAMSIZ];
|
||||
struct ifreq if_ip; /* get ip addr */
|
||||
int so_timestamping_flags = 0;
|
||||
int siocgstamp = 0;
|
||||
int siocgstampns = 0;
|
||||
struct timeval now;
|
||||
int res;
|
||||
struct ifreq if_idx;
|
||||
struct ifreq if_mac;
|
||||
fd_set readfs, errorfs;
|
||||
|
||||
/* Get interface name */
|
||||
if (argc > 2)
|
||||
strcpy(ifName, argv[1]);
|
||||
else {
|
||||
fprintf(stderr,
|
||||
"invalid no. of arguments to receive_timestamp \n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Header structures */
|
||||
so_timestamping_flags |= SOF_TIMESTAMPING_SOFTWARE;
|
||||
so_timestamping_flags |= SOF_TIMESTAMPING_RAW_HARDWARE;
|
||||
memset(&if_ip, 0, sizeof(struct ifreq));
|
||||
|
||||
/* Open PF_PACKET socket, listening for EtherType ETHER_TYPE */
|
||||
if ((sockfd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_802_EX1))) == -1) {
|
||||
perror("listener: socket");
|
||||
}
|
||||
|
||||
/* Get the index of the interface to receive on */
|
||||
memset(&if_idx, 0, sizeof(struct ifreq));
|
||||
strncpy(if_idx.ifr_name, ifName, IFNAMSIZ - 1);
|
||||
if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0)
|
||||
perror("SIOCGIFINDEX");
|
||||
|
||||
/* Get the MAC address of the interface to receive on */
|
||||
memset(&if_mac, 0, sizeof(struct ifreq));
|
||||
strncpy(if_mac.ifr_name, ifName, IFNAMSIZ - 1);
|
||||
if (ioctl(sockfd, SIOCGIFHWADDR, &if_mac) < 0)
|
||||
perror("SIOCGIFHWADDR");
|
||||
|
||||
/* Allow the socket to be reused - incase connection is closed prematurely */
|
||||
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &sockopt,
|
||||
sizeof sockopt) == -1) {
|
||||
perror("setsockopt");
|
||||
close(sockfd);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Bind to device */
|
||||
if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,
|
||||
ifName, IFNAMSIZ - 1) == -1) {
|
||||
perror("SO_BINDTODEVICE");
|
||||
close(sockfd);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (so_timestamping_flags &&
|
||||
setsockopt(sockfd, SOL_SOCKET, SO_TIMESTAMPING,
|
||||
&so_timestamping_flags,
|
||||
sizeof(so_timestamping_flags)) < 0)
|
||||
perror("setsockopt SO_TIMESTAMPING");
|
||||
|
||||
while (1) {
|
||||
FD_ZERO(&readfs);
|
||||
FD_ZERO(&errorfs);
|
||||
FD_SET(sockfd, &readfs);
|
||||
FD_SET(sockfd, &errorfs);
|
||||
gettimeofday(&now, NULL);
|
||||
res = select(sockfd + 1, &readfs, 0, &errorfs, NULL);
|
||||
if (res > 0) {
|
||||
recvpacket(sockfd, 0, siocgstamp, siocgstampns);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*@brief Send Timestamps
|
||||
*
|
||||
*@param argc Number of arguments
|
||||
*@param argv Pointer to the arguments array
|
||||
*
|
||||
*@return MLAN_STATUS_SUCCESS/MLAN_STATUS_FAILURE
|
||||
**/
|
||||
int
|
||||
send_timestamp(int argc, char *argv[])
|
||||
{
|
||||
int sockfd;
|
||||
struct ifreq if_idx;
|
||||
struct ifreq if_mac;
|
||||
int tx_len = 0, i;
|
||||
char sendbuf[BUF_SIZ];
|
||||
char buff[BUF_SIZ];
|
||||
struct ether_header *eh = (struct ether_header *)sendbuf;
|
||||
struct sockaddr_ll socket_address;
|
||||
char ifName[IFNAMSIZ], ip[50];
|
||||
struct timeval delta;
|
||||
fd_set readfs, errorfs;
|
||||
int res, siocgstamp = 1, siocgstampns = 1;
|
||||
int so_timestamping_flags = SOF_TIMESTAMPING_TX_HARDWARE;
|
||||
struct ifreq hwtstamp;
|
||||
struct hwtstamp_config hwconfig;
|
||||
|
||||
so_timestamping_flags |= SOF_TIMESTAMPING_RAW_HARDWARE;
|
||||
so_timestamping_flags |= SOF_TIMESTAMPING_TX_HARDWARE;
|
||||
so_timestamping_flags |= SOF_TIMESTAMPING_SYS_HARDWARE;
|
||||
|
||||
/* Get interface name */
|
||||
if (argc > 4) {
|
||||
strcpy(ifName, argv[1]);
|
||||
strcpy(ip, argv[4]);
|
||||
} else {
|
||||
fprintf(stderr, "invalid no. of args for send_timestamp\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Open RAW socket to send on */
|
||||
if ((sockfd = socket(PF_PACKET, SOCK_RAW, ETH_P_802_EX1)) == -1) {
|
||||
perror("socket");
|
||||
}
|
||||
|
||||
memset(&hwtstamp, 0, sizeof(hwtstamp));
|
||||
strncpy(hwtstamp.ifr_name, ifName, sizeof(hwtstamp.ifr_name));
|
||||
hwtstamp.ifr_data = (void *)&hwconfig;
|
||||
memset(&hwconfig, 0, sizeof(hwconfig));
|
||||
|
||||
hwconfig.tx_type =
|
||||
(so_timestamping_flags & SOF_TIMESTAMPING_TX_HARDWARE) ?
|
||||
HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF;
|
||||
|
||||
hwconfig.rx_filter =
|
||||
(so_timestamping_flags & SOF_TIMESTAMPING_RX_HARDWARE) ?
|
||||
HWTSTAMP_FILTER_PTP_V1_L4_SYNC : HWTSTAMP_FILTER_NONE;
|
||||
|
||||
/* Get the index of the interface to send on */
|
||||
memset(&if_idx, 0, sizeof(struct ifreq));
|
||||
strncpy(if_idx.ifr_name, ifName, IFNAMSIZ - 1);
|
||||
if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0)
|
||||
perror("SIOCGIFINDEX");
|
||||
|
||||
/* Get the MAC address of the interface to send on */
|
||||
memset(&if_mac, 0, sizeof(struct ifreq));
|
||||
strncpy(if_mac.ifr_name, ifName, IFNAMSIZ - 1);
|
||||
if (ioctl(sockfd, SIOCGIFHWADDR, &if_mac) < 0)
|
||||
perror("SIOCGIFHWADDR");
|
||||
|
||||
if (so_timestamping_flags &&
|
||||
setsockopt(sockfd, SOL_SOCKET, SO_TIMESTAMPING,
|
||||
&so_timestamping_flags,
|
||||
sizeof(so_timestamping_flags)) < 0)
|
||||
perror("setsockopt SO_TIMESTAMPING");
|
||||
|
||||
if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE,
|
||||
ifName, IFNAMSIZ - 1) == -1) {
|
||||
perror("bind");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* Construct the Ethernet header */
|
||||
memset(sendbuf, 0, BUF_SIZ);
|
||||
|
||||
/* Ethernet header */
|
||||
memcpy(eh->ether_shost, (u_int8_t *) & if_mac.ifr_hwaddr.sa_data,
|
||||
MLAN_MAC_ADDR_LENGTH);
|
||||
|
||||
eh->ether_type = htons(ETH_P_802_EX1);
|
||||
|
||||
tx_len += sizeof(struct ether_header);
|
||||
|
||||
get_mac(ifName, ip);
|
||||
for (i = 0; i < MLAN_MAC_ADDR_LENGTH; i++) {
|
||||
eh->ether_dhost[i] = (uint8_t) inter.mac[i];
|
||||
}
|
||||
/* Index of the network device */
|
||||
socket_address.sll_ifindex = if_idx.ifr_ifindex;
|
||||
|
||||
/* Address length */
|
||||
socket_address.sll_halen = ETH_ALEN;
|
||||
memcpy(&socket_address.sll_addr, (uint8_t *) & inter.mac,
|
||||
MLAN_MAC_ADDR_LENGTH);
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &send_time);
|
||||
sprintf(buff, "%lld.%lld", (long long)send_time.tv_sec,
|
||||
(long long)send_time.tv_nsec);
|
||||
strcpy((sendbuf + tx_len), buff);
|
||||
|
||||
/* Send packet */
|
||||
res = sendto(sockfd, sendbuf, tx_len + strlen(buff), 0,
|
||||
(struct sockaddr *)&socket_address,
|
||||
sizeof(struct sockaddr_ll));
|
||||
if (res < 0)
|
||||
perror("Send ");
|
||||
|
||||
fprintf(stdout, "Application time : %lld.%09lld (sent)\n",
|
||||
(long long)send_time.tv_sec, (long long)send_time.tv_nsec);
|
||||
|
||||
delta.tv_sec = 5;
|
||||
delta.tv_usec = 0;
|
||||
|
||||
FD_ZERO(&readfs);
|
||||
FD_ZERO(&errorfs);
|
||||
FD_SET(sockfd, &readfs);
|
||||
FD_SET(sockfd, &errorfs);
|
||||
|
||||
res = select(sockfd + 1, &readfs, 0, &errorfs, &delta);
|
||||
if (res > 0) {
|
||||
recvpacket(sockfd, MSG_ERRQUEUE, siocgstamp, siocgstampns);
|
||||
}
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
*@brief get destination mac address
|
||||
*
|
||||
*@param ifc interface from which packet has to be sent
|
||||
*@param ip IP Address of destination
|
||||
*
|
||||
*@return N/A
|
||||
**/
|
||||
void
|
||||
get_mac(char *ifc, char *ip)
|
||||
{
|
||||
char ipAddr[20];
|
||||
char hwAddr[20];
|
||||
char device[10], temp[3], in[50];
|
||||
int i = 0, j = 0, k = 0, res = 0, retry = 0;
|
||||
FILE *arpCache = fopen("/proc/net/arp", "r");
|
||||
if (!arpCache) {
|
||||
fprintf(stderr,
|
||||
"Arp Cache: Failed to open file \"/proc/net/arp\"");
|
||||
}
|
||||
|
||||
/* Ignore the first line, which contains the header */
|
||||
char header[ARP_FILE_BUFFER_LEN];
|
||||
|
||||
retry_again:
|
||||
|
||||
if (!fgets(header, sizeof(header), arpCache))
|
||||
fprintf(stderr, "error getting mac from proc files");
|
||||
while (3 == fscanf(arpCache, ARP_FORMAT, ipAddr, hwAddr, device)) {
|
||||
if ((!strcmp(ipAddr, ip)) && (!strcmp(ifc, device))) {
|
||||
printf("Sending Packet to Peer : %s\n", hwAddr);
|
||||
strcpy(inter.ip, ipAddr);
|
||||
strcpy(inter.interface, device);
|
||||
while (hwAddr[i] != '\0') {
|
||||
if (hwAddr[i] == ':') {
|
||||
inter.mac[j++] = strtol(temp, NULL, 16);
|
||||
i++;
|
||||
k = 0;
|
||||
} else
|
||||
temp[k++] = hwAddr[i++];
|
||||
}
|
||||
inter.mac[j] = strtol(temp, NULL, 16);
|
||||
res = 1;
|
||||
}
|
||||
}
|
||||
if (res != 1 && retry == 0) {
|
||||
sprintf(in, "ping -c 2 %s > /dev/null", ip);
|
||||
system(in);
|
||||
retry = 1;
|
||||
rewind(arpCache);
|
||||
goto retry_again;
|
||||
} else if (res != 1 && retry == 1) {
|
||||
printf("cannot find mac address for the specified ip\n");
|
||||
fclose(arpCache);
|
||||
exit(1);
|
||||
}
|
||||
fclose(arpCache);
|
||||
}
|
||||
|
||||
/*
|
||||
*@brief Receive Sync Packets
|
||||
*
|
||||
*@param sock socket from which packet must be recieved
|
||||
*@param recvmsg_flags flags for recvmsg
|
||||
*@param siocgstamp timestamp flag
|
||||
*@param siocgstampns timestamp flag for nano secs
|
||||
*
|
||||
*@return N/A
|
||||
**/
|
||||
void
|
||||
recvpacket(int sock, int recvmsg_flags, int siocgstamp, int siocgstampns)
|
||||
{
|
||||
unsigned char data[256];
|
||||
struct msghdr msg;
|
||||
struct iovec entry;
|
||||
struct sockaddr_in from_addr;
|
||||
struct {
|
||||
struct cmsghdr cm;
|
||||
char control[512];
|
||||
} control;
|
||||
int res, i;
|
||||
|
||||
memset(&msg, 0, sizeof(msg));
|
||||
msg.msg_iov = &entry;
|
||||
msg.msg_iovlen = 1;
|
||||
entry.iov_base = data;
|
||||
entry.iov_len = sizeof(data);
|
||||
msg.msg_name = (caddr_t) & from_addr;
|
||||
msg.msg_namelen = sizeof(from_addr);
|
||||
msg.msg_control = &control;
|
||||
msg.msg_controllen = sizeof(control);
|
||||
|
||||
res = recvmsg(sock, &msg, recvmsg_flags | MSG_DONTWAIT);
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "%s %s: %s\n",
|
||||
"recvmsg",
|
||||
(recvmsg_flags & MSG_ERRQUEUE) ? "error" : "regular",
|
||||
strerror(errno));
|
||||
} else {
|
||||
if (!(recvmsg_flags & MSG_ERRQUEUE)) {
|
||||
printf("Received Packet from Peer : ");
|
||||
for (i = 6; i < 12; i++)
|
||||
printf("%02x:", data[i]);
|
||||
printf("\n");
|
||||
}
|
||||
printpacket(&msg, res, sock, recvmsg_flags, siocgstamp,
|
||||
siocgstampns);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Prints Sent/Received Sync packets
|
||||
*
|
||||
* @param msg msghdr structure variable
|
||||
* @param res result of recvmsg call
|
||||
* @param sock socket variable
|
||||
* @param recvmsg_flags flags for receive message
|
||||
* @param siocgstamp timestamp flag
|
||||
* @param siocgstampns timestamp flag for nano secs
|
||||
*
|
||||
* @return N/A
|
||||
**/
|
||||
void
|
||||
printpacket(struct msghdr *msg, int res,
|
||||
int sock, int recvmsg_flags, int siocgstamp, int siocgstampns)
|
||||
{
|
||||
struct cmsghdr *cmsg;
|
||||
struct timespec now;
|
||||
struct timespec *stamp;
|
||||
clock_gettime(CLOCK_REALTIME, &now);
|
||||
if (!(recvmsg_flags & MSG_ERRQUEUE)) {
|
||||
printf("Application time : %ld.%09ld (received)\n",
|
||||
(long)now.tv_sec, (long)now.tv_nsec);
|
||||
}
|
||||
|
||||
for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
|
||||
if (cmsg->cmsg_level == SOL_SOCKET &&
|
||||
cmsg->cmsg_type == SO_TIMESTAMPING) {
|
||||
stamp = (struct timespec *)CMSG_DATA(cmsg);
|
||||
stamp++;
|
||||
/* skip deprecated HW transformed */
|
||||
stamp++;
|
||||
fprintf(stdout, "HW time : %ld.%09ld\n",
|
||||
(long)stamp->tv_sec, (long)stamp->tv_nsec);
|
||||
if (!(recvmsg_flags & MSG_ERRQUEUE))
|
||||
fprintf(stdout, "Delta in nsecs= %lld\n",
|
||||
((long long)(now.tv_sec -
|
||||
stamp->tv_sec) *
|
||||
1000000000L + now.tv_nsec) -
|
||||
(stamp->tv_nsec));
|
||||
else
|
||||
fprintf(stdout, "Delta in nsecs= %lld",
|
||||
((long long)(stamp->tv_sec -
|
||||
send_time.tv_sec) *
|
||||
1000000000L + (stamp->tv_nsec) -
|
||||
send_time.tv_nsec));
|
||||
}
|
||||
}
|
||||
fprintf(stdout, "\n");
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
/** @file timestamp.h
|
||||
*
|
||||
* @brief This file contains definitions used for application
|
||||
*
|
||||
*
|
||||
* Copyright 2014-2020 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _TIMESTAMP_H_
|
||||
#define _TIMESTAMP_H_
|
||||
|
||||
#include "mlanutl.h"
|
||||
#include <linux/if_packet.h>
|
||||
#include <netinet/ether.h>
|
||||
#include <linux/net_tstamp.h>
|
||||
|
||||
#define BUF_SIZ 1024
|
||||
#define ARP_FORMAT "%s %*s %*s %s %*s %s"
|
||||
#define ARP_FILE_BUFFER_LEN (1024)
|
||||
|
||||
struct interface_data {
|
||||
char ip[20];
|
||||
int mac[20];
|
||||
char interface[20];
|
||||
};
|
||||
|
||||
/**
|
||||
* 802.1 Local Experimental 1.
|
||||
*/
|
||||
#ifndef ETH_P_802_EX1
|
||||
#define ETH_P_802_EX1 0x88B5
|
||||
#endif
|
||||
|
||||
void receive_timestamp(int argc, char *argv[]);
|
||||
int send_timestamp(int argc, char *argv[]);
|
||||
void get_mac(char *ifc, char *ip);
|
||||
void recvpacket(int sock, int recvmsg_flags, int siocgstamp, int siocgstampns);
|
||||
void printpacket(struct msghdr *msg, int res, int sock,
|
||||
int recvmsg_flags, int siocgstamp, int siocgstampns);
|
||||
|
||||
#endif //_TIMESTAMP_H_
|
Loading…
Reference in a new issue