mxm_wifiex: update to mxm5x17362 release

Driver Bug Fixes:
-----------------
1. WSW-19892: Driver compilation errors on older kernel version
2. WSW-19638: Enable RF Test Mode support for 9098 PCIE and SDIO
3. WCSWREL-370: oob irq request fail on i.MX93 9x9 qsb board
4. WSW-21756: WLAN Driver hang observed during WiFi connect/disconnect
5. WCSWREL-362: merge the L6.0.0 build errors fix patches
6. WSW-22054: STA CSA event is not propagated to cfg80211
7. WSW-21873: STA does not send probes after switching from DFS channel
8. WSW-21530: UDP Tx not able to send ARP when high bandwidth is used
9. WSW-21541: WFA Pre-Cert Channel switch test is failing
10. WSW-21072: AP stops sending CTS-to-Self in mcast Tx after issue mc_aggr_cfg

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
This commit is contained in:
Sherry Sun 2022-10-10 11:14:56 +08:00
parent 65ddf89682
commit 5a38226a47
75 changed files with 7206 additions and 12083 deletions

View file

@ -604,9 +604,9 @@ appsbuild:
fi
cp -f README_MLAN $(BINDIR)
cp -rf mapp/mlanconfig/config $(BINDIR)
ifneq ($(APPDIR),)
cp -rf mapp/mlanconfig/config $(BINDIR)
$(MAKE) -C mapp/mlanutl $@ INSTALLDIR=$(BINDIR)
endif
@ -623,9 +623,9 @@ build: echo default
cp -rpf script/unload $(BINDIR)/
cp -f README_MLAN $(BINDIR)
cp -rf mapp/mlanconfig/config $(BINDIR)
ifneq ($(APPDIR),)
cp -rf mapp/mlanconfig/config $(BINDIR)
$(MAKE) -C mapp/mlanutl $@ INSTALLDIR=$(BINDIR)
endif

File diff suppressed because it is too large Load diff

View file

@ -1,113 +0,0 @@
# File : coex_int_api.conf
######################### Coex API command ###############
get_bca_arb_config={
CmdCode=0x0277 # do NOT change this line
# BCA Arbitration TLV
BCAArbitrationTLVType:2=0x024B # do NOT change this line
RobustCoexTlvLength:2={
Version:2=0x1 # Firecrest
Action:2=0 # GET
Arbitration_Enable:1=0x00 # Read-back BCA Arb Settings
Grant_Policy:1=0 # Read-back Grant Policy acc to Ant and Isolation config
Priority_Remap_WLAN:16=0 # Read-back remapped WLAN priority
Priority_Remap_BT:4=0 # Read-back remapped BT priority
Priority_Remap_15_4:4=0 # Read-back remapped 15.4 priority
Priority_Ramap_ExtRadio:4=0 # Read-back remapped External Radio
}
}
set_en_bca_arb_config={
CmdCode=0x0277 # do NOT change this line
# BCA Arbitration TLV
BCAArbitrationTLVType:2=0x024B # do NOT change this line
RobustCoexTlvLength:2={
Version:2=0x1 # Firecrest
Action:2=1 # SET
Arbitration_Enable:1=0x01 # Set BCA Arb Settings
Grant_Policy:1=0 # Set Grant Policy acc to Ant and Isolation config
Priority_Remap_WLAN:16='0x00,0x08,0x10,0x18,0x20,0x28,0x30,0x38,0x40,0x48,0x50,0x58,0x60,0x68,0x70,0x78' # Set remapped WLAN priority
Priority_Remap_BT:4='0x80,0x88,0x90,0x98' # Set remapped BT priority
Priority_Remap_15_4:4='0xA0,0xA8,0xB0,0xB8' # Set remapped 15.4 priority
}
}
set_dis_bca_arb_config={
CmdCode=0x0277 # do NOT change this line
# BCA Arbitration TLV
BCAArbitrationTLVType:2=0x024B # do NOT change this line
RobustCoexTlvLength:2={
Version:2=0x1 # Firecrest
Action:2=1 # SET
Arbitration_Enable:1=0x00 # Clear BCA Arb Settings
Grant_Policy:1=0 # Set Grant Policy acc to Ant and Isolation config
Priority_Remap_WLAN:16='0x00,0x08,0x10,0x18,0x20,0x28,0x30,0x38,0x40,0x48,0x50,0x58,0x60,0x68,0x70,0x78' # Set remapped WLAN priority
Priority_Remap_BT:4='0x80,0x88,0x90,0x98' # Set remapped BT priority
Priority_Remap_15_4:4='0xA0,0xA8,0xB0,0xB8' # Set remapped 15.4 priority
}
}
set_wlan_traffic_priority={
CmdCode=0x0277 # do NOT change this line
# COEX WLAN Traffic Priority TLV
BCAArbitrationTLVType:2=0x024C # do NOT change this line
RobustCoexTlvLength:2={
Version:2=0x1 # Firecrest
Action:2=1 # SET
Mode:1=1 # 1 - Qbased based;0-Packet type based
Mask_1:4=0xffffffff # This value will be read in little endian format in firmware,Tx_Priority_setting[t] t = 0 31, set bits to indicate which entry need to update priorities
Mask_2:4=0xffffffff # Tx_Priority_setting[t] t= 32 63, set bits to indicate which entry need to update priorities
Mask_3:4=0xffffffff # Rx_Priority_setting[t] t= 0 31, set bits to indicate which entry need to update priorities
Mask_4:4=0xffffffff # Rx_Priority_setting[t] t= 32 63, set bits to indicate which entry need to update priorities
Tx_Priority_setting:64='0xf,0xf,0xf,0xf,0xf,0xf,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x08,0x08,0x8,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0xd,0x1e,0x1f,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,0x40' # WLAN Tx Traffic priorities
Rx_Priority_setting:64='0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f,0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f,0x80' # WLAN Rx Traffic priorities
}
}
get_wlan_traffic_priority={
CmdCode=0x0277 # do NOT change this line
# COEX WLAN Traffic Priority TLV
BCAArbitrationTLVType:2=0x024C # do NOT change this line
RobustCoexTlvLength:2={
Version:2=0x1 # Firecrest
Action:2=0 # GET WLAN Traffic priorities
Mode:1=0 # (Qbased based - 1) or (Packet type based - 0)
Mask_1:4=0 # GET mask 1
Mask_2:4=0 # GET mask 2
Mask_3:4=0 # GET mask 3
Mask_4:4=0 # GET mask 4
Tx_Priority_setting:64=0 # GET WLAN Tx Traffic priorities
Rx_Priority_setting:64=0 # GET WLAN Rx Traffic priorities
}
}
get_wlan_stats={
CmdCode=0x0277 # do NOT change this line
# BCA Arbitration TLV
BCAArbitrationTLVType:2=0x024F # do NOT change this line
RobustCoexTlvLength:2={
Version:2=0x1 # Firecrest
Action:2=0 # GET WLAN Statistics
length:4=40 # Length of collected statistics
stats:40=0 # Accumulated Statistics
}
}
get_15_4_stats={
CmdCode=0x0277 # do NOT change this line
# BCA Arbitration TLV
BCAArbitrationTLVType:2=0x024F # do NOT change this line
RobustCoexTlvLength:2={
Version:2=0x1 # Firecrest
Action:2=2 # GET 15.4 Statistics
length:4=52 # Length of collected statistics
stats:52=0 # Accumulated Statistics
}
}

View file

@ -1,15 +0,0 @@
# File : ed_mac_ctrl_V1_8801.conf
#
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V1_8801.conf ed_mac_ctrl
#
#
## Set Energy Detect Threshold for EU Adaptivity test
ed_mac_ctrl={
CmdCode=0x0124 #Command code, DO NOT change this line
Enable:2=0x1 # 0 - disable EU adaptivity
# 1 - enable EU adaptivity
Offset:2=0x1b # 0 - Default Energy Detect threshold
#offset value range: 0x80 to 0x7F
}

View file

@ -1,22 +0,0 @@
# File : ed_mac_ctrl_V2_8987.conf
#
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V2_8987.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=0x6 # 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=0x6 # 0 - Default Energy Detect threshold
#offset value range: 0x80 to 0x7F
ed_ctrl_txq_lock:4=0xFF #DO NOT Change this line
}

View file

@ -1,22 +0,0 @@
# File : ed_mac_ctrl_V2_8997.conf
#
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V2_8997.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_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
}

View file

@ -1,22 +0,0 @@
# File : ed_mac_ctrl_V2_iw416.conf
#
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V2_iw416.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=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
}

View file

@ -1,22 +0,0 @@
# File : ed_mac_ctrl_V2_nw61x.conf
#
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V2_nw61x.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=0xA # 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=0xA # 0 - Default Energy Detect threshold
#offset value range: 0x80 to 0x7F
ed_ctrl_txq_lock:4=0x1e00FF #DO NOT Change this line
}

View file

@ -1,24 +0,0 @@
######################### Keep-Alive command ##################
stop={
mkeep_alive_id=1
enable=0 #1-enable; 0-disable
}
reset={
mkeep_alive_id=1
enable=0 #1-enable; 0-disable
reset=1 #enable reset
}
start={
mkeep_alive_id=1
enable=1 #1-enable; 0-disable
sendInterval=55000 # 55 seconds(The unit of sendInterval is milliseconds)
retryInterval=20000 # 20 seconds(The unit of retryInterval is milliseconds)
retryCount=3 # tcp alive retry count
destMacAddr=00:50:43:21:3b:7b # destination MAC address. need change accordingly
srcMacAddr=00:00:00:00:00:00 # source MAC address. need change accordingly
pktLen=67 #IP packet len
ipPkt=45 00 00 43 8c 9e 00 00 ff 06 ac bf c0 a8 00 7c c0 a8 00 8a c0 03 22 b7 b0 b6 60 9f 42 dd 9e 1e 50 18 80 00 d0 88 00 00 74 68 69 73 20 69 73 20 61 20 6b 65 65 70 20 61 6c 69 76 65 20 70 61 63 6b 65 74 #packet content. "c0 a8 00 7c" is the source ip address. "c0 a8 00 8a" is the destination ip address. They may need change accordingly.
}

View file

@ -1,295 +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_bca={
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=0x08 # BCA Coex mode.
# Pure HW BCA based WLAN and BT traffic arbitration.
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 enable
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
}
}
external_coex_uwb_config={
CmdCode=0x00e0
Action:2=1 # 0x0 get, 0x1 set
RSVD:2=0
RobustCoexTlvType:2=0x0238 # TLV ID
RobustCoexTlvLength:2={
Enabled:1=0x03 # 0x03 to configure UWB
}
}
external_coex_config_2={
CmdCode=0x00e0
Action:2=1 //0x0 get, 0x1 set
RSVD:2=0
RobustCoexTlvType:2=0x0238 //TLV ID
RobustCoexTlvLength:2={
Enabled:1=0x02 // 0x00 disable, 0x02 enable (KF2, Fixed GPIO external COEX)
ExtHighInputPriority:1=0x02 // Input priority: 0x00 Input Low Priority, 0x01 Input Medium Priority, 0x02 Input High Priority
ExtLowInputPriority:1=0x02
}
}
external_coex_uart_config={
CmdCode=0x00e0
Action:2=1 //0x0 get, 0x1 set
RSVD:2=0
RobustCoexTlvType:2=0x0238 //TLV ID
RobustCoexTlvLength:2={
Enabled:1=0x04 // 0x00 disable, 0x04: UART enable
Loopback:1=0x00 // 0x00 Loopback disable, 0x01 Loopback enable 0x02 UARTGPIO, 0x06 Get LTE Stats, 0x05 Clear LTE stats
BaudRate:4=4000000 // UART Baud Rate, 4000000: 4M baudrate, 3000000 = 3M baudrate
}
}
external_coex_pta_config={
CmdCode=0x00e0
Action:2=1 // 0x0 get, 0x1 set
RSVD:2=0
RobustCoexTlvType:2=0x0238 // TLV ID
RobustCoexTlvLength:2={
Enabled:1=0x05 // 0x00 disable, 0x01 enable
ExtWifiBtArb:1=0x01 // 0x00 disable, 0x01 enable
PolGrantPin:1=0x01 // 0x00 active high, 0x01 active low
EnablePriPtaInt:1=0x01 // 0x00 disable, 0x01 enable
EnableStateFromPta:1=0x02 // 0x00 state input disable
// 0x01 state info is from state pin
// 0x02 state info is sampled on priority pin.
SetPriSampTiming:2=100 // Timing to sample Priority bit
SetStateInfoSampTiming:2=100 // Timing to sample Tx/Rx info
ExtRadioTrafficPrio:1=0x01 // 0x00 disable, 0x01 enable external traffic Tx/Rx Priority.
ExtCoexHwIntWci2:1=0x00 // 0x00 disable, 0x01 enable(wci-2 interface)
}
}
#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=10 #(12.5ms)Enter value in Units (1Unit = 1.25ms), BTTime must be less than 65535
WlanTime:2=20 #(25ms)Enter value in Units (1Unit = 1.25ms), WlanTime must be less than 65535
}
}
#WLAN duty low prio time is set as WlanLowPrioTime
#WLAN duty total time is set as TotalTime
wlandutytime={
CmdCode=0x00e0
Action:2=1
RSVD:2=0
RobustCoexTlvType:2=0x0390
RobustCoexTlvLength:2={
Enable:2=0x02 # Enable = 1 is for generic time, 0x02 for Dutycycle feature, 0x03 disables DutyCycle feature
WlanLowPrioTime:2=30 #(30ms)Enter value in Units (1Unit = 1ms), keep it less than TotalTime
TotalTime:2=100 #(100ms)Enter value in Units (1Unit = 1ms), TotalTime must be <= 100
}
}
#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 ###############

View file

@ -1,537 +0,0 @@
# File : txpwrlimit_cfg.conf
## Get CFG data for Tx power limitation
txpwrlimit_2g_cfg_get={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x00 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
ChanTRPC.TlvType:2=0x0249
ChanTRPC.TlvLength:2={ # Get Tx Power Values for a particular antenna
TLVAntNum:1=0 # Antenna Num: 0 - Both, 1 - Main, 2 - Aux
}
}
txpwrlimit_5g_cfg_get_sub0={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x10 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
ChanTRPC.TlvType:2=0x0249
ChanTRPC.TlvLength:2={ # Get Tx Power Values for a particular antenna
TLVAntNum:1=0 # Antenna Num: 0 - Both, 1 - Main, 2 - Aux
}
}
txpwrlimit_5g_cfg_get_sub1={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x11 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
ChanTRPC.TlvType:2=0x0249
ChanTRPC.TlvLength:2={ # Get Tx Power Values for a particular antenna
TLVAntNum:1=0 # Antenna Num: 0 - Both, 1 - Main, 2 - Aux
}
}
txpwrlimit_5g_cfg_get_sub2={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x12 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
ChanTRPC.TlvType:2=0x0249
ChanTRPC.TlvLength:2={ # Get Tx Power Values for a particular antenna
TLVAntNum:1=0 # Antenna Num: 0 - Both, 1 - Main, 2 - Aux
}
}
txpwrlimit_5g_cfg_get_sub3={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x13 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
ChanTRPC.TlvType:2=0x0249
ChanTRPC.TlvLength:2={ # Get Tx Power Values for a particular antenna
TLVAntNum:1=0 # Antenna Num: 0 - Both, 1 - Main, 2 - Aux
}
}
## Set CFG data for Tx power limitation
##
## TLVStartFreq: Starting Frequency of the band for this channel
## 2407, 2414 or 2400 for 2.4 GHz
## 5000
## 4000
## TLVChanWidth: Channel Width
## 20
## TLVChanNum : Channel Number
## TLVPwr[] : ModulationGroup
## 0: CCK (1,2,5.5,11 Mbps)
## 1: OFDM (6,9,12,18 Mbps)
## 2: OFDM (24,36 Mbps)
## 3: OFDM (48,54 Mbps)
## 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
##
## 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 Tx power limit CFG
txpwrlimit_2g_cfg_set={
CmdCode=0x00fb # do NOT change this line
Action:2=1 # 1 - SET
RSVD:2=0 # do NOT change this line
ChanTRPC.TlvType:2=0x0249
ChanTRPC.TlvLength:2={ # Configure Tx Power Values for a particular antenna
TLVAntNum:1=0 # Antenna Num: 0 - Both, 1 - Main, 2 - Aux
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=1
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: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: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: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: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: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: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: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: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: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: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: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: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=2414
TLVChanWidth:1=20
TLVChanNum:1=14
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 Tx power limit CFG
txpwrlimit_5g_cfg_set={
CmdCode=0x00fb # do NOT change this line
Action:2=1 # 1 - SET
RSVD:2=0 # do NOT change this line
ChanTRPC.TlvType:2=0x0249
ChanTRPC.TlvLength:2={ # Configure Tx Power Values for a particular antenna
TLVAntNum:1=0 # Antenna Num: 0 - Both, 1 - Main, 2 - Aux
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=36
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: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: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: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: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: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: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: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=100
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: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: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: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: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: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: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: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: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: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: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: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=149
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: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: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: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: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=183
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=184
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=185
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=187
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=188
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=189
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=192
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=196
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: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: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: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: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: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: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'
}
}

View file

@ -1,621 +0,0 @@
# File : txpwrlimit_cfg.conf
## Get CFG data for Tx power limitation
txpwrlimit_2g_cfg_get={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x00 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub0={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x10 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub1={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x11 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub2={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x12 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub3={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x13 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
## Set CFG data for Tx power limitation
##
## TLVStartFreq: Starting Frequency of the band for this channel
## 2407, 2414 or 2400 for 2.4 GHz
## 5000
## 4000
## TLVChanWidth: Channel Width
## 20
## TLVChanNum : Channel Number
## TLVPwr[] : ModulationGroup
## 0: CCK (1,2,5.5,11 Mbps)
## 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)
## Power Limit in dBm
## 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
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
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'
}
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'
}
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'
}
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'
}
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'
}
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'
}
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'
}
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'
}
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'
}
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'
}
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'
}
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'
}
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'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
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'
}
}
## 5G subband1 Tx power limit CFG
txpwrlimit_5g_cfg_set_sub0={
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=36
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=40
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=44
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=48
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=52
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=56
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=60
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=64
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
}
## 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:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=104
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=108
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=112
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=116
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=120
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=124
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=128
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=132
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=136
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=140
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=144
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
}
## 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:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=153
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=157
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=161
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=165
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
}
## 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
TLVChanWidth:1=20
TLVChanNum:1=183
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=184
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=185
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=187
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=188
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=189
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=192
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=196
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=7
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=8
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=11
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=12
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=16
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=34
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
}

View file

@ -1,497 +0,0 @@
# File : txpwrlimit_cfg_iw416.conf
## Get CFG data for Tx power limitation
txpwrlimit_2g_cfg_get={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x00 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub0={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x10 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub1={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x11 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub2={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x12 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub3={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x13 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
## Set CFG data for Tx power limitation
##
## TLVStartFreq: Starting Frequency of the band for this channel
## 2407, 2414 or 2400 for 2.4 GHz
## 5000
## 4000
## TLVChanWidth: Channel Width
## 20
## TLVChanNum : Channel Number
## TLVPwr[] : ModulationGroup
## 0: CCK (1,2,5.5,11 Mbps)
## 1: OFDM (6,9,12,18 Mbps)
## 2: OFDM (24,36 Mbps)
## 3: OFDM (48,54 Mbps)
## 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)
## Power Limit in dBm
##
## 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)
##
## 2G Tx power limit CFG
txpwrlimit_2g_cfg_set={
CmdCode=0x00fb # do NOT change this line
Action:2=1 # 1 - SET
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:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=2
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=3
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=4
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=5
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=6
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=7
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=8
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=9
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=10
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=11
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=12
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=13
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2414
TLVChanWidth:1=20
TLVChanNum:1=14
TLVPwr:20='0,16,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
}
## 5G Tx power limit CFG
txpwrlimit_5g_cfg_set={
CmdCode=0x00fb # do NOT change this line
Action:2=1 # 1 - SET
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:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=40
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=44
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=48
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=52
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=56
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=60
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=64
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=100
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,16,8,15,9,12'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=104
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,16,8,15,9,12'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=108
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,16,8,15,9,12'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=112
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,16,8,15,9,12'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=116
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,16,8,15,9,12'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=120
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,16,8,15,9,12'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=124
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,16,8,15,9,12'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=128
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,16,8,15,9,12'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=132
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,16,8,15,9,12'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=136
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,16,8,15,9,12'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=140
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,15,8,15,9,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=144
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=149
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,15,8,15,9,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=153
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,15,8,15,9,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=157
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,15,8,15,9,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=161
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,15,8,15,9,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=165
TLVPwr:20='0,0,1,16,2,16,3,13,4,16,5,16,6,12,7,15,8,15,9,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=183
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=184
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=185
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=187
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=188
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=189
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=192
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=196
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=7
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=8
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=11
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=12
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=16
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=34
TLVPwr:20='0,0,1,16,2,16,3,15,4,16,5,16,6,14,7,16,8,16,9,14'
}
}

View file

@ -1,204 +0,0 @@
# Not matter how many spaces or tabs are inserted in a line,
# components and ending format must be exactly same as given
# example:
#
# <card_type>[_<block_id>] = {
# key=value
# }
#
# card_type : 8XXX (mandatory)
# block_id : configuration block id (optional )
# key : module parameter name
# value : value for module parameter
# for string value, no need to add ""
#
# card_type supported: 8887/8897/8997/8977/8987/9098
# block_id: support same chipset with
# different module parameter.
# For example to support mutiple SD8997 cards, usr can
# specify the configuration block id number [0 - 9], if not
# specified, it is taken as 0 by default.
#
# debug related module parameters could not be set via module
# configure file, ex. drvdbg could not be set in this file
#
# line started with "#" will be ignored
# refer to the USB8997_1 for parameters that could be set in
# this configuration file, and set the corresponding value
# according to your real needs
SD8997 = {
cfg80211_wext=0xf
wfd_name=p2p
max_vir_bss=1
cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf
drv_mode=7
}
#SD8997_1 = {
# cfg80211_wext=0xf
# wfd_name=wfd0
# max_vir_bss=1
# cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf
# drv_mode=5
#}
#SD8887 = {
# cfg80211_wext=0xf
# wfd_name=p2p
# max_vir_bss=1
# cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf
# drv_mode=7
#}
#SD8897 = {
# cfg80211_wext=0xf
# wfd_name=p2p
# max_vir_bss=1
# cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf
# drv_mode=7
#}
#SD8977 = {
# cfg80211_wext=0xf
# wfd_name=p2p
# max_vir_bss=1
# cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf
# drv_mode=7
#}
#SDIW416 = {
# cfg80211_wext=0xf
# wfd_name=p2p
# hw_name=SDIW416
# max_vir_bss=1
# cal_data_cfg=nxp/WlanCalData_ext_8978_QFN_TB.conf
# drv_mode=7
#}
#SD8987 = {
# cfg80211_wext=0xf
# wfd_name=p2p
# max_vir_bss=1
# cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf
# drv_mode=7
#}
#SDIW612 = {
# cfg80211_wext=0xf
# wfd_name=p2p
# hw_name=SDIW612
# max_vir_bss=1
# drv_mode=7
#}
USB8997 = {
cfg80211_wext=0xf
wfd_name=p2p
max_vir_bss=1
cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf
drv_mode=7
}
#USBIW620 = {
# cfg80211_wext=0xf
# wfd_name=p2p
# hw_name=USBIW620
# max_vir_bss=1
# drv_mode=7
#}
PCIE8997 = {
cfg80211_wext=0xf
wfd_name=p2p
max_vir_bss=1
cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf
drv_mode=7
}
PCIE9098_0 = {
cfg80211_wext=0xf
wfd_name=p2p
max_vir_bss=1
cal_data_cfg=none
drv_mode=7
mac_addr=00:50:43:20:12:34
}
PCIE9098_1 = {
cfg80211_wext=0xf
wfd_name=p2p
max_vir_bss=1
cal_data_cfg=none
drv_mode=7
mac_addr=00:50:43:20:52:56
}
#USB8997 = {
# hw_test=0
# fw_name="nxp/usbusb8997_combo_v4.bin"
# req_fw_nowait=1
# fw_reload=3
# fw_serial=1
# mac_addr=00:50:43:22:1e:3d
# mfg_mode=0
# drv_mode=0x5
# max_sta_bss=1
# sta_name=wlan
# max_uap_bss=1
# uap_name=uap
# wfd_name=p2p
# max_vir_bss=1
# max_mpl_bss=1
# nan_name=nan
# max_nan_bss=1
# max_11p_bss=1
# auto_ds=0
# ps_mode=1
# max_tx_buf=4096
# intmode=0
# gpiopin=0
# pm_keep_power=0
# shutdown_hs=1
# cfg_11d=1
# start_11ai_scan=0
# oob_mode=0
# sdio_pd=1
# cal_data_cfg=nxp/WlanCalData_ext_8997_QFN_TB.conf
# txpwrtlimit_cfg=nxp/txpwr_limit.conf
# cntry_txpwrt=0
# init_hostcmd_cfg=nxp/init_hostcmd_cfg.conf
# minicard_pwrup=0
# cfg80211_wext=0xf
# skip_fwdnld=0
# wq_sched_prio=0
# wq_sched_policy=0
# rx_work=1
# aggrctrl=1
# usb_aggr=1
# pcie_int_mode=1
# low_power_mode_enable=1
# wakelock_timeout=10
# dev_cap_mask=0xffffffff
# sdio_rx_aggr=1
# pmic=1
# antcfg=0
# uap_oper_ctrl=0
# hs_wake_interval=400
# indication_gpio=0xff
# disconnect_on_suspend=0
# hs_mimo_switch=1
# indrstcfg=0xffffffff
# fixed_beacon_buffer=0
# GoAgeoutTime=0
# gtk_rekey_offload=1
# multi_dtim=0
# inact_tmo=0
# usb_fw_option=1
# napi=1
# dfs_offload=1
# cfg80211_drcs=1
# drcs_chantime_mode=0
# reg_alpha2=US
#}

View file

@ -1,59 +0,0 @@
# File : mlanutl/Makefile
#
# Copyright 2011-2022 NXP
# Path to the top directory of the wlan distribution
PATH_TO_TOP = ../..
# Determine how we should copy things to the install directory
ABSPATH := $(filter /%, $(INSTALLDIR))
RELPATH := $(filter-out /%, $(INSTALLDIR))
INSTALLPATH := $(ABSPATH)
ifeq ($(strip $(INSTALLPATH)),)
INSTALLPATH := $(PATH_TO_TOP)/$(RELPATH)
endif
# Override CFLAGS for application sources, remove __ kernel namespace defines
CFLAGS := $(filter-out -D__%, $(ccflags-y))
# remove KERNEL include dir
CFLAGS := $(filter-out -I$(KERNELDIR)%, $(CFLAGS))
#CFLAGS += -DAP22 -fshort-enums
CFLAGS += -Wall
CFLAGS += -Wno-stringop-truncation
#ECHO = @
ifeq (,$(findstring ANDROID_KERNEL, $(CFLAGS)))
LIBS=-lrt
endif
.PHONY: default tags all
OBJECTS = mlanutl.o
HEADERS = mlanutl.h
exectarget=mlanutl
TARGET := $(exectarget)
build appsbuild default: $(TARGET)
@cp -f $(TARGET) $(INSTALLPATH)
all : tags default
$(TARGET): $(OBJECTS) $(HEADERS)
$(ECHO)$(CC) $(LIBS) -o $@ $(OBJECTS)
%.o: %.c $(HEADERS)
$(ECHO)$(CC) $(CFLAGS) -c -o $@ $<
tags:
ctags -R -f tags.txt
distclean clean:
$(ECHO)$(RM) $(OBJECTS) $(TARGET)
$(ECHO)$(RM) tags.txt

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,379 +0,0 @@
/** @file mlanwls.h
*
* @brief 11mc/11az Wifi location services application
*
*
* Copyright 2022 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:
01/24/2022: initial version
************************************************************************/
#ifndef _WLS_H_
#define _WLS_H_
/** Size of command buffer */
#define MRVDRV_SIZE_OF_CMD_BUFFER (3 * 1024)
/** MAC BROADCAST */
#define MAC_BROADCAST 0x1FF
/** MAC MULTICAST */
#define MAC_MULTICAST 0x1FE
/** Default scan interval in second*/
#define DEFAULT_SCAN_INTERVAL 300
/** Netlink protocol number */
#define NETLINK_NXP (MAX_LINKS - 1)
/** Netlink maximum payload size */
#define NL_MAX_PAYLOAD 1024
/** Default wait time in seconds for events */
#define UAP_RECV_WAIT_DEFAULT 10
#ifndef NLMSG_HDRLEN
/** NL message header length */
#define NLMSG_HDRLEN ((int)NLMSG_ALIGN(sizeof(struct nlmsghdr)))
#endif
/** Host Command ID : FTM session config and control */
#define HostCmd_CMD_FTM_SESSION_CFG 0x024d
#define HostCmd_CMD_FTM_SESSION_CTRL 0x024E
#define HostCmd_CMD_FTM_FEATURE_CTRL 0x024f
#define HostCmd_CMD_WLS_REQ_FTM_RANGE 0x0250
/** Events*/
#define EVENT_WLS_FTM_COMPLETE 0x00000086
#define WLS_SUB_EVENT_FTM_COMPLETE 0
#define WLS_SUB_EVENT_RADIO_RECEIVED 1
#define WLS_SUB_EVENT_RADIO_RPT_RECEIVED 2
#define WLS_SUB_EVENT_ANQP_RESP_RECEIVED 3
#define WLS_SUB_EVENT_RTT_RESULTS 4
/** Custom events definitions */
/** AP connected event */
#define CUS_EVT_AP_CONNECTED "EVENT=AP_CONNECTED"
/** Custom events definitions end */
/*TLVs*/
/** TLV type ID definition */
#define PROPRIETARY_TLV_BASE_ID 0x0100
#define FTM_SESSION_CFG_INITATOR_TLV_ID (PROPRIETARY_TLV_BASE_ID + 273)
#define FTM_NTB_RANGING_CFG_TLV_ID (PROPRIETARY_TLV_BASE_ID + 343)
#define FTM_TB_RANGING_CFG_TLV_ID (PROPRIETARY_TLV_BASE_ID + 344)
#define FTM_RANGE_REPORT_TLV_ID \
(PROPRIETARY_TLV_BASE_ID + 0x10C) /* 0x0100 + 0x10C = 0x20C */
#define FTM_SESSION_CFG_LCI_TLV_ID (PROPRIETARY_TLV_BASE_ID + 270)
#define FTM_SESSION_CFG_LOCATION_CIVIC_TLV_ID (PROPRIETARY_TLV_BASE_ID + 271)
/** Structure of command table*/
typedef struct {
/** User Command ID*/
int cmd_id;
/** Command name */
char *cmd;
/** Command function pointer */
int (*func)(int argc, char *argv[], void *param);
/** Command usuage */
char **help;
} wls_app_command_table;
/** Structure of FTM_SESSION_CFG_NTB_RANGING / FTM_SESSION_CFG_TB_RANGING TLV
* data*/
typedef struct _ranging_cfg {
/** Indicates the channel BW for session*/
/*0: HE20, 1: HE40, 2: HE80, 3: HE80+80, 4: HE160, 5:HE160_SRF*/
t_u8 format_bw;
/** indicates for bandwidths less than or equal to 80 MHz the maximum
* number of space-time streams to be used in DL/UL NDP frames in the
* session*/
t_u8 max_i2r_sts_upto80;
/**indicates for bandwidths less than or equal to 80 MHz the maximum
* number of space-time streams to be used in DL/UL NDP frames in the
* session*/
t_u8 max_r2i_sts_upto80;
/**Specify measurement freq in Hz to calculate measurement interval*/
t_u8 az_measurement_freq;
/**Indicates the number of measurements to be done for session*/
t_u8 az_number_of_measurements;
/** Initator lmr feedback */
t_u8 i2r_lmr_feedback;
/**Include location civic request (Expect location civic from
* responder)*/
t_u8 civic_req;
/**Include LCI request (Expect LCI info from responder)*/
t_u8 lci_req;
} __ATTRIB_PACK__ ranging_cfg_t;
/** Structure of FTM_SESSION_CFG TLV data*/
typedef struct _ftm_session_cfg {
/** Indicates how many burst instances are requested for the FTM
* session*/
t_u8 burst_exponent;
/** Indicates the duration of a burst instance*/
t_u8 burst_duration;
/**Minimum time between consecutive FTM frames*/
t_u8 min_delta_FTM;
/**ASAP/non-ASAP casel*/
t_u8 is_ASAP;
/**Number of FTMs per burst*/
t_u8 per_burst_FTM;
/**FTM channel spacing: HT20/HT40/VHT80/…*/
t_u8 channel_spacing;
/**Indicates the interval between two consecutive burst instances*/
t_u16 burst_period;
} __ATTRIB_PACK__ ftm_session_cfg_t;
/** Structure for FTM_SESSION_CFG_LOCATION_CIVIC TLV data*/
typedef struct _civic_loc_cfg {
/**Civic location type*/
t_u8 civic_location_type;
/**Country code*/
t_u16 country_code;
/**Civic address type*/
t_u8 civic_address_type;
/**Civic address length*/
t_u8 civic_address_length;
/**Civic Address*/
t_u8 civic_address[256];
} __ATTRIB_PACK__ civic_loc_cfg_t;
/** Structure for FTM_SESSION_CFG_LCI TLV data*/
typedef struct _lci_cfg {
/** known longitude*/
double longitude;
/** known Latitude*/
double latitude;
/** known altitude*/
double altitude;
/** known Latitude uncertainty*/
t_u8 lat_unc;
/** known Longitude uncertainty*/
t_u8 long_unc;
/** Known Altitude uncertainty*/
t_u8 alt_unc;
/** 1 word for additional Z information */
t_u32 z_info;
} __ATTRIB_PACK__ lci_cfg_t;
/** Structure for FTM_SESSION_CFG_NTB_RANGING TLV*/
typedef struct _ranging_cfg_tlv {
/** Type*/
t_u16 type;
/** Length*/
t_u16 len;
/** Value*/
ranging_cfg_t val;
} __ATTRIB_PACK__ ranging_cfg_tlv_t;
/** Structure for FTM_SESSION_CFG TLV*/
typedef struct _ftm_session_cfg_tlv {
/** Type*/
t_u16 type;
/** Length*/
t_u16 len;
/** Value*/
ftm_session_cfg_t val;
t_u8 civic_req;
t_u8 lci_req;
} __ATTRIB_PACK__ ftm_session_cfg_tlv_t;
/** Structure for FTM_SESSION_CFG_LOCATION_CIVIC TLV*/
typedef struct _civic_loc_tlv {
/** Type*/
t_u16 type;
/** Length*/
t_u16 len;
/** Value*/
civic_loc_cfg_t val;
} __ATTRIB_PACK__ civic_loc_tlv_t;
/** Structure for FTM_SESSION_CFG_LCI TLV*/
typedef struct _lci_tlv {
/** Type*/
t_u16 type;
/** Length*/
t_u16 len;
/** Value*/
lci_cfg_t val;
} __ATTRIB_PACK__ lci_tlv_t;
/** Structure for DOT11MC FTM_SESSION_CFG */
typedef struct _dot11mc_ftm_cfg {
/** FTM session cfg*/
ftm_session_cfg_tlv_t sess_tlv;
/** Location Request cfg*/
lci_tlv_t lci_tlv;
/** Civic location cfg*/
civic_loc_tlv_t civic_tlv;
} __ATTRIB_PACK__ dot11mc_ftm_cfg_t;
/** Structure for DOT11AZ FTM_SESSION_CFG */
typedef struct _dot11az_ftmcfg_ntb_t {
/** NTB session cfg */
ranging_cfg_tlv_t range_tlv;
} __ATTRIB_PACK__ dot11az_ftm_cfg_t;
/** Type definition for hostcmd_ftm_session_cfg */
typedef struct _hostcmd_ftm_session_cfg {
/** 0:Get, 1:Set */
t_u16 action;
/** FTM_SESSION_CFG_TLVs*/
union {
/**11az cfg*/
dot11az_ftm_cfg_t cfg_11az;
/** 11mc cfg*/
dot11mc_ftm_cfg_t cfg_11mc;
} tlv;
} __ATTRIB_PACK__ hostcmd_ftm_session_cfg;
/** Type definition for hostcmd_ftm_session_ctrl */
typedef struct _hostcmd_ftm_session_ctrl {
/** 0: Not used, 1: Start, 2: Stop*/
t_u16 action;
/*FTM for ranging*/
t_u8 for_ranging;
/** Mac address of the peer with whom FTM session is required*/
t_u8 peer_mac[ETH_ALEN];
/** Channel on which FTM must be started */
t_u8 chan;
} __ATTRIB_PACK__ hostcmd_ftm_session_ctrl;
/** Type definition for generic Hostcmd for 11AZ FTM Session */
typedef struct _hostcmd_ds_ftm_session_cmd {
/** HostCmd_DS_GEN */
HostCmd_DS_GEN cmd_hdr;
/** Command Body */
union {
/** hostcmd for session_ctrl user command */
hostcmd_ftm_session_ctrl ftm_session_ctrl;
/** hostcmd for session_cfg user command */
hostcmd_ftm_session_cfg ftm_session_cfg;
} cmd;
} __ATTRIB_PACK__ hostcmd_ds_ftm_session_cmd;
/** Type definition for FTM Session Events */
/** Event ID length */
#define EVENT_ID_LEN 4
/**Structure for RTT results subevent*/
typedef struct _wls_subevent_rtt_results_t {
/** complete */
t_u8 complete;
/** tlv buffer */
/** MrvlIEtypes_RTTResult_t */
t_u8 tlv_buffer[];
} __ATTRIB_PACK__ wls_subevent_rtt_results_t;
/**Structure for FTM complete subevent*/
typedef struct _wls_subevent_ftm_complete {
/** BSS Number */
t_u8 bssNum;
/** BSS Type */
t_u8 bssType;
/** MAC address of the responder */
t_u8 mac[ETH_ALEN];
/** Average RTT */
t_u32 avg_rtt;
/** Average Clock offset */
t_u32 avg_clk_offset;
/** Measure start timestamp */
t_u32 meas_start_tsf;
} __ATTRIB_PACK__ wls_subevent_ftm_complete_t;
/** TLV for FTM Range Report */
typedef struct _range_report_tlv_t {
/**Type*/
t_u16 type;
/**Length*/
t_u16 len;
/** MAC address of the responder */
t_u8 mac[ETH_ALEN];
/** Average RTT */
t_u32 avg_rtt;
/** Average Clock offset */
t_u32 avg_clk_offset;
/** LCI and Location Civic TLV */
} __ATTRIB_PACK__ range_report_tlv_t;
/** Structure for FTM events*/
typedef struct _wls_event_t {
/** Event ID */
t_u16 event_id;
/** BSS index number for multiple BSS support */
t_u8 bss_index;
/** BSS type */
t_u8 bss_type;
/** sub event id */
t_u8 sub_event_id;
union {
/** FTM Complete Sub event*/
wls_subevent_ftm_complete_t ftm_complete;
} e;
} __ATTRIB_PACK__ wls_event_t;
/*Application Global Data*/
typedef struct {
/** Average RTT */
t_u32 avg_rtt;
/** Average Clock offset */
t_u32 avg_clk_offset;
/*Range*/
t_s64 range;
} range_results_t;
/** Structure for ftm command private data*/
typedef struct _wls_app_data {
/** 0 : 80211mc, 1:80211az*/
t_u8 protocol_type;
/** num of times to run FTM*/
t_u8 loop_cnt;
/** flag to run nonstop*/
t_u8 run_nonstop;
/** flag is associated */
t_u8 associated;
/** 0 - STA, 1- AP*/
t_u8 bss_type;
/**flag for ftm started */
t_u8 ftm_started;
/** flag for app to terminate ftm session*/
t_u8 terminate_app;
/**flag for debug print level */
t_u8 debug_level;
/**peer mac address */
t_u8 peer_mac[ETH_ALEN];
/**AP mac address */
t_u8 ap_mac[ETH_ALEN];
/** Channel number for FTM session*/
t_u8 channel;
/**SET/GET action */
t_u8 hostcmd_action;
/**Is LCI data available in cfg*/
t_u8 lci_request;
/** Is civic data available in cfg*/
t_u8 civic_request;
/**ntb cfg param*/
ranging_cfg_t range_cfg;
/** 11mc session cfg param*/
ftm_session_cfg_t session_cfg;
/** lci cfg data*/
lci_cfg_t lci_cfg;
/** civic cfg data - this should be last field*/
civic_loc_cfg_t civic_cfg;
} __ATTRIB_PACK__ wls_app_data_t;
int mlanwls_main(int argc, char *argv[]);
#endif /* _WLS_H_ */

View file

@ -801,7 +801,7 @@ void wlan_fill_vht_cap_tlv(mlan_private *priv, MrvlIETypes_VHTCap_t *pvht_cap,
t_u16 nss;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) | defined(USBNW62X)
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
t_u16 rx_nss = 0, tx_nss = 0;
#endif
ENTER();

View file

@ -188,9 +188,9 @@ t_u8 wlan_fill_he_cap_ie(mlan_private *pmpriv, IEEEtypes_HECap_t *hecap_ie,
he_mcsnss = (IEEEtypes_HeMcsNss_t *)hecap_ie->he_txrx_mcs_support;
cfg_value = GET_HE_NSSMCS(user_hecap_tlv->rx_mcs_80, nss);
hw_value = GET_HE_NSSMCS(hw_hecap_tlv->rx_mcs_80, nss);
for (nss = 1; nss <= 8; nss++) {
cfg_value = GET_HE_NSSMCS(user_hecap_tlv->rx_mcs_80, nss);
hw_value = GET_HE_NSSMCS(hw_hecap_tlv->rx_mcs_80, nss);
if ((hw_value == NO_NSS_SUPPORT) ||
(cfg_value == NO_NSS_SUPPORT)) {
SET_HE_NSSMCS(he_mcsnss->rx_mcs, nss, NO_NSS_SUPPORT);
@ -200,9 +200,10 @@ t_u8 wlan_fill_he_cap_ie(mlan_private *pmpriv, IEEEtypes_HECap_t *hecap_ie,
}
}
cfg_value = GET_HE_NSSMCS(user_hecap_tlv->tx_mcs_80, nss);
hw_value = GET_HE_NSSMCS(hw_hecap_tlv->tx_mcs_80, nss);
for (nss = 1; nss <= 8; nss++) {
cfg_value = GET_HE_NSSMCS(user_hecap_tlv->tx_mcs_80, nss);
hw_value = GET_HE_NSSMCS(hw_hecap_tlv->tx_mcs_80, nss);
if ((hw_value == NO_NSS_SUPPORT) ||
(cfg_value == NO_NSS_SUPPORT)) {
SET_HE_NSSMCS(he_mcsnss->tx_mcs, nss, NO_NSS_SUPPORT);

View file

@ -1523,8 +1523,11 @@ mlan_status wlan_11d_cfg_domain_info(pmlan_adapter pmadapter,
ret = MLAN_STATUS_FAILURE;
goto done;
}
if (!wlan_fw_11d_is_enabled(pmpriv))
wlan_11d_enable(pmpriv, MNULL, ENABLE_11D);
if (!wlan_fw_11d_is_enabled(pmpriv)) {
ret = wlan_11d_enable(pmpriv, MNULL, ENABLE_11D);
if (ret)
PRINTM(MERROR, "Enabling 11D in FW failed\n");
}
cfg_11d = (mlan_ds_11d_cfg *)pioctl_req->pbuf;
domain_info = &cfg_11d->param.domain_info;
@ -1587,7 +1590,8 @@ mlan_status wlan_11d_handle_uap_domain_info(mlan_private *pmpriv, t_u16 band,
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = pmpriv->adapter;
MrvlIEtypes_DomainParamSet_t *pdomain_tlv;
MrvlIEtypes_DomainParamSet_t *pdomain_tlv = MNULL;
MrvlIEtypes_Rgn_dom_code_t *pregdomain_tlv = MNULL;
t_u8 num_sub_band = 0;
t_u8 cfp_bg = 0, cfp_a = 0;
@ -1595,6 +1599,12 @@ mlan_status wlan_11d_handle_uap_domain_info(mlan_private *pmpriv, t_u16 band,
pdomain_tlv = (MrvlIEtypes_DomainParamSet_t *)domain_tlv;
if (pdomain_tlv->header.type == TLV_TYPE_DOMAIN) {
pregdomain_tlv =
(MrvlIEtypes_Rgn_dom_code_t
*)(domain_tlv + sizeof(MrvlIEtypesHeader_t) +
pdomain_tlv->header.len);
}
/* update region code & table based on country string */
if (wlan_misc_country_2_cfp_table_code(
pmadapter, pdomain_tlv->country_code, &cfp_bg, &cfp_a) ==
@ -1624,9 +1634,18 @@ mlan_status wlan_11d_handle_uap_domain_info(mlan_private *pmpriv, t_u16 band,
/* TODO: don't just clobber pmadapter->domain_reg.
* Add some checking or merging between STA & UAP domain_info
*/
wlan_11d_set_domain_info(pmpriv, band, pdomain_tlv->country_code,
num_sub_band, pdomain_tlv->sub_band,
NXP_DFS_UNKNOWN);
if (pregdomain_tlv &&
(pregdomain_tlv->header.type == TLV_TYPE_REGION_DOMAIN_CODE)) {
wlan_11d_set_domain_info(pmpriv, band,
pdomain_tlv->country_code,
num_sub_band, pdomain_tlv->sub_band,
pregdomain_tlv->domain_code);
} else
wlan_11d_set_domain_info(pmpriv, band,
pdomain_tlv->country_code,
num_sub_band, pdomain_tlv->sub_band,
NXP_DFS_UNKNOWN);
ret = wlan_11d_send_domain_info(pmpriv, pioctl_buf);
done:

View file

@ -200,6 +200,92 @@ static t_u32 wlan_11h_convert_ieee_to_mrvl_ie(mlan_adapter *pmadapter,
return sizeof(mrvl_ie_hdr) + pin_ie[1];
}
/**
* @brief find all bonded channel.
*
* @param pri_chan primary channel
* @param bw channel bandwidth
* @param chan_list buffer to return channel list.
*
* @return number of channel
*/
static t_u8 woal_get_bonded_channels(t_u8 pri_chan, t_u8 bw, t_u8 *chan_list)
{
t_u8 ht40_plus[] = {52, 60, 100, 108, 116, 124, 132, 140};
t_u8 ht40_minus[] = {56, 64, 104, 112, 120, 128, 136, 144};
t_u8 vht80_dfs[4][4] = {{52, 56, 60, 64},
{100, 104, 108, 112},
{116, 120, 124, 128},
{132, 136, 140, 144}};
t_u8 find = MFALSE;
int j;
int i;
t_u8 sec_chan = 0;
t_u8 n_chan = 1;
ENTER();
if (bw == CHAN_BW_20MHZ) {
chan_list[0] = pri_chan;
} else if (bw == CHAN_BW_40MHZ) {
chan_list[0] = pri_chan;
for (i = 0; i < sizeof(ht40_minus); i++) {
if (pri_chan == (t_u8)ht40_plus[i]) {
sec_chan = pri_chan + 4;
n_chan = 2;
break;
}
}
for (i = 0; i < sizeof(ht40_minus); i++) {
if (pri_chan == (t_u8)ht40_minus[i]) {
sec_chan = pri_chan - 4;
n_chan = 2;
break;
}
}
chan_list[1] = sec_chan;
} else if (bw == CHAN_BW_80MHZ) {
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
if (pri_chan == (t_u8)vht80_dfs[i][j]) {
find = MTRUE;
break;
}
}
if (find)
break;
}
if (find) {
n_chan = 4;
for (j = 0; j < n_chan; j++) {
chan_list[j] = (t_u8)vht80_dfs[i][j];
}
}
}
LEAVE();
return n_chan;
}
/**
* @brief Set channel's dfs state
*
* @param priv Private driver information structure
* @param chan primary channel
* @param bw channel bandwidth
* @param dfs_state dfs state
*
* @return N/A
*/
t_void wlan_11h_set_chan_dfs_state(mlan_private *priv, t_u8 chan, t_u8 bw,
dfs_state_t dfs_state)
{
t_u8 n_chan;
t_u8 chan_list[4];
t_u8 i;
n_chan = woal_get_bonded_channels(chan, bw, chan_list);
for (i = 0; i < n_chan; i++)
wlan_set_chan_dfs_state(priv, BAND_A, chan_list[i], dfs_state);
}
#ifdef STA_SUPPORT
/**
* @brief Setup the IBSS DFS element passed to the firmware in adhoc start
@ -677,8 +763,9 @@ static mlan_status wlan_11h_cmd_chan_rpt_req(mlan_private *priv,
ptlv_zero_dfs->Header.len = wlan_cpu_to_le16(sizeof(t_u8));
if (!is_cancel_req) {
ptlv_zero_dfs->zero_dfs_enbl = MTRUE;
PRINTM(MCMND, "DFS: START: chan=%d\n",
pchan_rpt_req->chan_desc.chanNum);
PRINTM(MCMND, "DFS: START: chan=%d bw=%d\n",
pchan_rpt_req->chan_desc.chanNum,
pchan_rpt_req->chan_desc.bandcfg.chanWidth);
} else {
ptlv_zero_dfs->zero_dfs_enbl = MFALSE;
PRINTM(MCMND, "DFS: STOP\n");
@ -695,10 +782,12 @@ static mlan_status wlan_11h_cmd_chan_rpt_req(mlan_private *priv,
pstate_dfs->dfs_check_pending = MFALSE;
pstate_dfs->dfs_radar_found = MFALSE;
pstate_dfs->dfs_check_priv = MNULL;
if (!is_cancel_req)
if (!is_cancel_req) {
pstate_dfs->dfs_check_channel =
pchan_rpt_req->chan_desc.chanNum;
pstate_dfs->dfs_check_bandwidth =
pchan_rpt_req->chan_desc.bandcfg.chanWidth;
}
LEAVE();
return MLAN_STATUS_SUCCESS;
@ -993,6 +1082,34 @@ static t_bool wlan_11h_is_slave_active_on_dfs_chan(mlan_private *priv)
return ret;
}
/**
* @brief Check if the current input channel is on radar channel
*
*
* @param priv Private driver information structure
* @param channel Channel to determine radar detection requirements
*
* @return
* - MTRUE if radar detection is required
* - MFALSE otherwise
*/
t_bool wlan_11h_is_radar_channel(mlan_private *priv, t_u8 channel)
{
t_bool required = MFALSE;
ENTER();
/*
* No checks for 11h or measurement code being enabled is placed here
* since regulatory requirements exist whether we support them or not.
*/
required = wlan_get_cfp_radar_detect(priv, channel);
LEAVE();
return required;
}
/**
* @brief Return whether the master interface is active, and on DFS channel.
* priv is assumed to already be a dfs master interface, doesn't check this.
@ -1643,6 +1760,27 @@ static mlan_status wlan_11h_add_dfs_timestamp(mlan_adapter *pmadapter,
return ret;
}
/**
* @brief Add all bonded channel's dfs timestamp to the list
*
* @param pmadapter Pointer to mlan_adapter
* @param repr Timestamp 'represents' value (see _dfs_timestamp_repr_e)
* @param channel Channel number
* @param bandwidth Channel bandwidth
*
* @return Pointer to timestamp if found, or MNULL
*/
static void wlan_11h_add_all_dfs_timestamp(mlan_adapter *pmadapter, t_u8 repr,
t_u8 channel, t_u8 bandwidth)
{
t_u8 n_chan;
t_u8 chan_list[4];
t_u8 i;
n_chan = woal_get_bonded_channels(channel, bandwidth, chan_list);
for (i = 0; i < n_chan; i++)
wlan_11h_add_dfs_timestamp(pmadapter, repr, chan_list[i]);
}
/********************************************************
Global functions
********************************************************/
@ -1726,6 +1864,217 @@ mlan_status wlan_11h_config_slave_radar_det(mlan_private *priv, t_bool enable)
return ret;
}
#ifdef UAP_SUPPORT
/**
* @brief Return whether the slave interface is on DFS channel.
* priv is assumed to already be a dfs slave interface, doesn't check this.
*
* @param priv Private driver information structure
*
* @return
* - MTRUE if priv is slave, and meets both conditions
* - MFALSE otherwise
*/
static t_bool wlan_11h_is_slave_on_dfs_chan(mlan_private *priv)
{
t_bool ret = MFALSE;
ENTER();
if ((priv->media_connected == MTRUE) &&
(priv->curr_bss_params.band & BAND_A) &&
wlan_11h_is_radar_channel(
priv, priv->curr_bss_params.bss_descriptor.channel))
ret = MTRUE;
LEAVE();
return ret;
}
/**
* @brief check if dfs_master and dfs_slave are in same channel
*
* @param pmadapter Pointer to mlan_adapter structure
*
* @return MTRUE-dfs_master and dfs_slave interface on same DFS channel
*
*/
t_u8 static wlan_11h_check_dfs_channel(mlan_adapter *pmadapter)
{
mlan_private *priv_master = MNULL;
mlan_private *priv_slave = MNULL;
mlan_private *priv_list[MLAN_MAX_BSS_NUM] = {MNULL};
if (wlan_get_privs_by_two_cond(
pmadapter, wlan_11h_is_master_active_on_dfs_chan,
wlan_11h_is_dfs_master, MTRUE, priv_list)) {
priv_master = priv_list[0];
PRINTM(MINFO, "%s: found dfs_master priv=%p\n", __func__,
priv_master);
}
if (wlan_get_privs_by_two_cond(pmadapter, wlan_11h_is_slave_on_dfs_chan,
wlan_11h_is_dfs_slave, MTRUE,
priv_list)) {
priv_slave = priv_list[0];
PRINTM(MINFO, "%s: found dfs_slave priv=%p\n", __func__,
priv_slave);
}
if (!priv_slave || !priv_master)
return MFALSE;
if (priv_master->uap_state_chan_cb.channel !=
priv_slave->curr_bss_params.bss_descriptor.channel)
return MFALSE;
return MTRUE;
}
/**
* @brief disable 11h and DFS function
*
* @param priv Private driver information structure
* @param pioctl_buf A pointer to MLAN IOCTL Request buffer
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status static wlan_11h_disable_dfs(mlan_private *priv, t_void *pioctl_buf)
{
t_u32 enable = 0;
mlan_status ret = MLAN_STATUS_SUCCESS;
ENTER();
/*
* Send cmd to FW to enable/disable 11h function in firmware
*/
ret = wlan_prepare_cmd(priv, HostCmd_CMD_802_11_SNMP_MIB,
HostCmd_ACT_GEN_SET, Dot11H_i,
(t_void *)pioctl_buf, &enable);
if (ret)
ret = MLAN_STATUS_FAILURE;
else
/* Set boolean flag in driver 11h state */
priv->intf_state_11h.is_11h_active = MFALSE;
PRINTM(MINFO, "11h: DFS %s\n", "Deactivate");
LEAVE();
return ret;
}
/**
* @brief check if we need enable dfs_master
*
* @param priv Pointer to mlan_private structure
* priv should be UAP priv
*
* @return N/A
*
*/
void wlan_11h_update_dfs_master_state_by_uap(mlan_private *pmpriv)
{
mlan_adapter *pmadapter = pmpriv->adapter;
mlan_status ret = MLAN_STATUS_SUCCESS;
if (pmadapter->dfs_mode && wlan_11h_check_dfs_channel(pmadapter)) {
PRINTM(MCMND,
"11h: disable DFS master when AP+STA on same DFS channel\n");
ret = wlan_11h_disable_dfs(pmpriv, MNULL);
return;
}
if (!wlan_11h_is_active(pmpriv)) {
/* active 11h extention in Fw */
PRINTM(MCMND,
"11h: Enable DFS master after AP up or chan_switch\n");
ret = wlan_11h_activate(pmpriv, MNULL, MTRUE);
ret = wlan_11h_config_master_radar_det(pmpriv, MTRUE);
ret = wlan_11h_check_update_radar_det_state(pmpriv);
}
if (pmpriv->uap_host_based && !pmpriv->adapter->init_para.dfs_offload)
pmpriv->intf_state_11h.is_11h_host = MTRUE;
wlan_11h_set_dfs_check_chan(pmpriv, pmpriv->uap_channel,
pmpriv->uap_bandwidth);
return;
}
/**
* @brief check if dfs_master and dfs_slave are in same channel
*
* @param pmadapter Pointer to mlan_adapter structure
*
* @return MTRUE-dfs_master and dfs_slave interface on same DFS channel
*
*/
void wlan_11h_update_dfs_master_state_by_sta(mlan_private *pmpriv)
{
mlan_private *priv_master = MNULL;
mlan_private *priv_slave = MNULL;
mlan_private *priv_list[MLAN_MAX_BSS_NUM] = {MNULL};
mlan_adapter *pmadapter = pmpriv->adapter;
mlan_status ret = MLAN_STATUS_SUCCESS;
if (wlan_get_privs_by_two_cond(
pmadapter, wlan_11h_is_master_active_on_dfs_chan,
wlan_11h_is_dfs_master, MTRUE, priv_list)) {
priv_master = priv_list[0];
PRINTM(MINFO, "%s: found dfs_master priv=%p\n", __func__,
priv_master);
}
if (wlan_get_privs_by_two_cond(pmadapter, wlan_11h_is_slave_on_dfs_chan,
wlan_11h_is_dfs_slave, MTRUE,
priv_list)) {
priv_slave = priv_list[0];
PRINTM(MINFO, "%s: found dfs_slave priv=%p\n", __func__,
priv_slave);
}
if (!priv_slave || !priv_master)
return;
if (priv_master->uap_state_chan_cb.channel ==
priv_slave->curr_bss_params.bss_descriptor.channel) {
PRINTM(MCMND,
"11h: disable DFS master when AP+STA on same DFS channel\n");
ret = wlan_11h_disable_dfs(priv_master, MNULL);
}
return;
}
/**
* @brief update the dfs master state on station disconnect
*
* @param priv Pointer to mlan_private structure
* priv should be UAP priv
*
* @return N/A
*
*/
void wlan_11h_update_dfs_master_state_on_disconect(mlan_private *priv)
{
mlan_private *priv_master = MNULL;
mlan_private *priv_list[MLAN_MAX_BSS_NUM] = {MNULL};
mlan_adapter *pmadapter = priv->adapter;
mlan_status ret = MLAN_STATUS_SUCCESS;
if (wlan_get_privs_by_two_cond(
pmadapter, wlan_11h_is_master_active_on_dfs_chan,
wlan_11h_is_dfs_master, MTRUE, priv_list)) {
priv_master = priv_list[0];
PRINTM(MINFO, "%s: found dfs_master priv=%p\n", __func__,
priv_master);
}
if (!priv_master) {
wlan_11h_check_update_radar_det_state(priv);
return;
}
if (!wlan_11h_is_active(priv_master)) {
PRINTM(MCMND, "11h: Enable DFS master after STA disconnect\n");
/* active 11h extention in Fw */
ret = wlan_11h_activate(priv_master, MNULL, MTRUE);
ret = wlan_11h_config_master_radar_det(priv_master, MTRUE);
ret = wlan_11h_check_update_radar_det_state(priv_master);
}
if (priv_master->uap_host_based && !pmadapter->init_para.dfs_offload)
priv_master->intf_state_11h.is_11h_host = MTRUE;
wlan_11h_set_dfs_check_chan(priv_master, priv_master->uap_channel,
priv_master->uap_bandwidth);
return;
}
#endif
/**
* @brief Checks all interfaces and determines if radar_detect flag states
* have/should be changed. If so, sends SNMP_MIB 11H command to FW.
@ -1956,7 +2305,6 @@ t_void wlan_11h_cleanup(mlan_adapter *adapter)
{
wlan_dfs_device_state_t *pstate_dfs = &adapter->state_dfs;
wlan_dfs_timestamp_t *pdfs_ts;
mlan_private *priv = MNULL;
ENTER();
@ -1967,10 +2315,6 @@ t_void wlan_11h_cleanup(mlan_adapter *adapter)
util_unlink_list(adapter->pmoal_handle,
&pstate_dfs->dfs_ts_head,
(pmlan_linked_list)pdfs_ts, MNULL, MNULL);
priv = wlan_get_priv(adapter, MLAN_BSS_ROLE_ANY);
if (priv)
wlan_set_chan_dfs_state(priv, BAND_A, pdfs_ts->channel,
DFS_USABLE);
adapter->callbacks.moal_mfree(adapter->pmoal_handle,
(t_u8 *)pdfs_ts);
@ -1978,7 +2322,6 @@ t_void wlan_11h_cleanup(mlan_adapter *adapter)
adapter->pmoal_handle, &pstate_dfs->dfs_ts_head, MNULL,
MNULL);
}
LEAVE();
}
@ -2493,8 +2836,7 @@ t_s32 wlan_11h_process_start(mlan_private *priv, t_u8 **ppbuffer,
* network that was parsed out of the scan response.
*
* @return Integer number of bytes appended to the TLV output
* buffer (ppbuffer), MLAN_STATUS_FAILURE (-1),
* or MLAN_STATUS_SUCCESS (0)
* buffer (ppbuffer)
*/
t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
IEEEtypes_CapInfo_t *pcap_info, t_u16 band,
@ -2511,11 +2853,12 @@ t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
* long as the current & next APs have the same spectrum
* mgmt capability bit setting
*/
ret = MLAN_STATUS_SUCCESS;
PRINTM(MINFO,
"Assume DFS parameters are the same for roaming\n");
} else {
/* No support for roaming between DFS/non-DFS yet */
ret = MLAN_STATUS_FAILURE;
PRINTM(MINFO,
"No support for roaming between DFS/non-DFS yet\n");
}
LEAVE();
@ -2526,7 +2869,7 @@ t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
if (!wlan_fw_11d_is_enabled(priv)) {
/* No use having 11h enabled without 11d enabled */
if (wlan_11d_enable(priv, MNULL, ENABLE_11D)) {
ret = MLAN_STATUS_FAILURE;
PRINTM(MERROR, "Fail to enable 11D\n");
LEAVE();
return ret;
}
@ -2888,14 +3231,14 @@ mlan_status wlan_11h_handle_event_chanswann(mlan_private *priv)
}
}
}
if (pmadapter->ecsa_enable) {
t_u8 stop_tx = *(t_u8 *)pmadapter->event_body;
#endif /* UAP_SUPPORT */
if (priv->adapter->ecsa_enable) {
t_u8 stop_tx = *(t_u8 *)priv->adapter->event_body;
if (stop_tx)
pmadapter->state_rdh.tx_block = MTRUE;
priv->adapter->state_rdh.tx_block = MTRUE;
LEAVE();
return ret;
}
#endif
priv->adapter->state_11h.recvd_chanswann_event = MTRUE;
/* unlikely: clean up previous csa if still on-going */
@ -2932,7 +3275,7 @@ mlan_status wlan_11h_handle_event_chanswann(mlan_private *priv)
"11h: handle_event_chanswann() - scan blacklist csa channel\n");
wlan_set_chan_blacklist(priv, BAND_A,
priv->intf_state_11h.dfs_slave_csa_chan, MTRUE);
#endif
#endif /* STA_SUPPORT */
priv->adapter->state_11h.recvd_chanswann_event = MFALSE;
LEAVE();
@ -2986,6 +3329,53 @@ mlan_status wlan_11h_ioctl_dfs_testing(pmlan_adapter pmadapter,
return MLAN_STATUS_SUCCESS;
}
/**
* @brief 802.11h IOCTL to get nop channel list
*
* @param pmadapter Pointer to mlan_adapter
* @param pioctl_req Pointer to mlan_ioctl_req
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status wlan_11h_ioctl_nop_channel_list(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
mlan_ds_11h_cfg *ds_11hcfg = MNULL;
int i, j;
chan_freq_power_t *pcfp = MNULL;
t_u8 num_chan = 0;
ENTER();
ds_11hcfg = (mlan_ds_11h_cfg *)pioctl_req->pbuf;
/*get the cfp table first */
for (i = 0; i < MAX_REGION_CHANNEL_NUM; i++) {
if (pmadapter->region_channel[i].band == BAND_A) {
pcfp = pmadapter->region_channel[i].pcfp;
break;
}
}
if (!pcfp) {
/* This means operation in BAND-A is not support, we can
* just return false here, it's harmless
*/
goto done;
}
/*get the radar detection requirements according to chan num */
for (j = 0; j < pmadapter->region_channel[i].num_cfp; j++) {
if (pcfp[j].passive_scan_or_radar_detect) {
if (wlan_11h_is_channel_under_nop(pmadapter,
pcfp[j].channel)) {
ds_11hcfg->param.nop_chan_list
.chan_list[num_chan] = pcfp[j].channel;
num_chan++;
}
}
}
done:
ds_11hcfg->param.nop_chan_list.num_chan = num_chan;
return MLAN_STATUS_SUCCESS;
}
/**
* @brief 802.11h IOCTL to handle channel NOP status check/clear
* @brief If given channel is under NOP, return a new non-dfs
@ -3015,7 +3405,8 @@ mlan_status wlan_11h_ioctl_channel_nop_info(pmlan_adapter pmadapter,
ch_nop_info->chan_under_nop =
wlan_11h_is_channel_under_nop(
pmadapter, ch_nop_info->curr_chan);
if (ch_nop_info->chan_under_nop) {
if (ch_nop_info->chan_under_nop &&
ch_nop_info->check_new_chan) {
wlan_11h_switch_non_dfs_chan(
pmpriv, &ch_nop_info->new_chan.channel);
if (ch_nop_info->chan_width == CHAN_BW_80MHZ ||
@ -3034,6 +3425,8 @@ mlan_status wlan_11h_ioctl_channel_nop_info(pmlan_adapter pmadapter,
}
} else if (pioctl_req->action == MLAN_ACT_CLEAR) {
wlan_11h_cleanup(pmadapter);
wlan_reset_all_chan_dfs_state(pmpriv, BAND_A,
DFS_USABLE);
}
ret = MLAN_STATUS_SUCCESS;
}
@ -3086,17 +3479,20 @@ mlan_status wlan_11h_ioctl_chan_dfs_state(pmlan_adapter pmadapter,
{
mlan_ds_11h_cfg *ds_11hcfg = MNULL;
t_s32 ret = MLAN_STATUS_FAILURE;
pmlan_private priv = pmadapter->priv[pioctl_req->bss_index];
pmlan_private priv = MNULL;
ENTER();
if (pioctl_req) {
ds_11hcfg = (mlan_ds_11h_cfg *)pioctl_req->pbuf;
priv = pmadapter->priv[pioctl_req->bss_index];
if (pioctl_req->action == MLAN_ACT_GET) {
wlan_11h_is_channel_under_nop(
pmadapter,
ds_11hcfg->param.ch_dfs_state.channel);
if (MFALSE ==
wlan_11h_is_channel_under_nop(
pmadapter,
ds_11hcfg->param.ch_dfs_state.channel))
PRINTM(MINFO, "Channel is not in NOP\n");
ds_11hcfg->param.ch_dfs_state.dfs_required =
wlan_11h_radar_detect_required(
priv,
@ -3211,12 +3607,15 @@ t_bool wlan_11h_is_channel_under_nop(mlan_adapter *pmadapter, t_u8 channel)
*
* @param priv Pointer to mlan_private
* @param pevent Pointer to mlan_event
* @param radar_chan Pointer to radar channel
* @param bandwidth Pointer to band width
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
mlan_event *pevent,
t_u8 *radar_chan)
t_u8 *radar_chan,
t_u8 *bandwidth)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
HostCmd_DS_CHAN_RPT_RSP *pchan_rpt_rsp;
@ -3229,6 +3628,7 @@ mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
wlan_dfs_device_state_t *pstate_dfs = &priv->adapter->state_dfs;
t_u8 dfs_radar_found = MFALSE;
t_u8 dfs_check_channel = pstate_dfs->dfs_check_channel;
t_u8 dfs_check_bandwidth = pstate_dfs->dfs_check_bandwidth;
MrvlIEtypes_channel_band_t *tlv;
ENTER();
@ -3236,8 +3636,10 @@ mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
DBG_HEXDUMP(MCMD_D, "11h: Event ChanRptReady (HostCmd_DS_CHAN_RPT_RSP)",
(t_u8 *)pchan_rpt_rsp, pevent->event_len);
if (priv->bss_type == MLAN_BSS_TYPE_DFS)
if (priv->bss_type == MLAN_BSS_TYPE_DFS) {
dfs_check_channel = priv->chan_rep_req.chanNum;
dfs_check_bandwidth = priv->chan_rep_req.bandcfg.chanWidth;
}
if (wlan_le32_to_cpu(pchan_rpt_rsp->cmd_result) ==
MLAN_CMD_RESULT_SUCCESS) {
@ -3260,6 +3662,7 @@ mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
case TLV_TYPE_CHANNELBANDLIST:
tlv = (MrvlIEtypes_channel_band_t *)ptlv;
dfs_check_channel = tlv->channel;
dfs_check_bandwidth = tlv->bandcfg.chanWidth;
break;
default:
break;
@ -3273,19 +3676,23 @@ mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
ret = MLAN_STATUS_FAILURE;
}
if (dfs_radar_found) {
PRINTM(MMSG, "RADAR Detected on channel %d!\n",
dfs_check_channel);
PRINTM(MMSG, "RADAR Detected on channel %d bw=%d !\n",
dfs_check_channel, dfs_check_bandwidth);
/* add channel to NOP list */
wlan_11h_add_dfs_timestamp(priv->adapter, DFS_TS_REPR_NOP_START,
dfs_check_channel);
wlan_11h_add_all_dfs_timestamp(priv->adapter,
DFS_TS_REPR_NOP_START,
dfs_check_channel,
dfs_check_bandwidth);
}
*radar_chan = dfs_check_channel;
*bandwidth = dfs_check_bandwidth;
if (dfs_radar_found)
wlan_set_chan_dfs_state(priv, BAND_A, dfs_check_channel,
DFS_UNAVAILABLE);
wlan_11h_set_chan_dfs_state(priv, dfs_check_channel,
dfs_check_bandwidth,
DFS_UNAVAILABLE);
else
wlan_set_chan_dfs_state(priv, BAND_A, dfs_check_channel,
DFS_AVAILABLE);
wlan_11h_set_chan_dfs_state(priv, dfs_check_channel,
dfs_check_bandwidth, DFS_AVAILABLE);
pstate_dfs->dfs_radar_found = dfs_radar_found;
/* Update DFS structure. */
priv->adapter->callbacks.moal_get_system_time(
@ -3304,28 +3711,38 @@ mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
* @param priv Pointer to mlan_private
* @param pevent Pointer to mlan_event
* @param radar_chan Pointer to radar channel
* @param bandwidth Pointer to band width
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status wlan_11h_print_event_radar_detected(mlan_private *priv,
mlan_event *pevent,
t_u8 *radar_chan)
t_u8 *radar_chan,
t_u8 *bandwidth)
{
wlan_dfs_device_state_t *pstate_dfs = &priv->adapter->state_dfs;
t_u8 dfs_check_bandwidth = pstate_dfs->dfs_check_bandwidth;
MrvlIEtypes_channel_band_t *tlv;
ENTER();
*radar_chan = pstate_dfs->dfs_check_channel;
if (pevent->event_len >= sizeof(MrvlIEtypes_channel_band_t)) {
tlv = (MrvlIEtypes_channel_band_t *)&pevent->event_buf;
*radar_chan = tlv->channel;
dfs_check_bandwidth = tlv->bandcfg.chanWidth;
} else {
if (priv->bss_type == MLAN_BSS_TYPE_DFS)
if (priv->bss_type == MLAN_BSS_TYPE_DFS) {
*radar_chan = priv->chan_rep_req.chanNum;
dfs_check_bandwidth =
priv->chan_rep_req.bandcfg.chanWidth;
}
}
wlan_11h_add_dfs_timestamp(priv->adapter, DFS_TS_REPR_NOP_START,
*radar_chan);
wlan_set_chan_dfs_state(priv, BAND_A, *radar_chan, DFS_UNAVAILABLE);
PRINTM(MEVENT, "DFS: Radar detected on %d\n", *radar_chan);
*bandwidth = dfs_check_bandwidth;
wlan_11h_add_all_dfs_timestamp(priv->adapter, DFS_TS_REPR_NOP_START,
*radar_chan, dfs_check_bandwidth);
wlan_11h_set_chan_dfs_state(priv, *radar_chan, dfs_check_bandwidth,
DFS_UNAVAILABLE);
PRINTM(MEVENT, "DFS: Radar detected on %d bw=%d\n", *radar_chan,
dfs_check_bandwidth);
LEAVE();
return MLAN_STATUS_SUCCESS;
}
@ -4372,14 +4789,16 @@ done:
* @param priv Void pointer to mlan_private
*
* @param chan pointer to channel
* @param bandwidth band width
*
* @return N/A
*/
void wlan_11h_set_dfs_check_chan(mlan_private *priv, t_u8 chan)
void wlan_11h_set_dfs_check_chan(mlan_private *priv, t_u8 chan, t_u8 bandwidth)
{
wlan_dfs_device_state_t *pstate_dfs = &priv->adapter->state_dfs;
ENTER();
pstate_dfs->dfs_check_channel = chan;
pstate_dfs->dfs_check_bandwidth = bandwidth;
PRINTM(MCMND, "Set dfs_check_channel=%d\n", chan);
LEAVE();
}
@ -4413,3 +4832,29 @@ mlan_status wlan_11h_ioctl_dfs_w53_cfg(pmlan_adapter pmadapter,
return MLAN_STATUS_SUCCESS;
}
/**
* @brief 802.11h DFS mode configuration
*
* @param pmadapter Pointer to mlan_adapter
* @param pioctl_req Pointer to mlan_ioctl_req
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
mlan_status wlan_11h_ioctl_dfs_mode(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
mlan_ds_11h_cfg *ds_11hcfg = MNULL;
ENTER();
ds_11hcfg = (mlan_ds_11h_cfg *)pioctl_req->pbuf;
if (pioctl_req->action == MLAN_ACT_GET) {
ds_11hcfg->param.dfs_mode = pmadapter->dfs_mode;
} else {
pmadapter->dfs_mode = ds_11hcfg->param.dfs_mode;
}
LEAVE();
return MLAN_STATUS_SUCCESS;
}

View file

@ -63,6 +63,14 @@ extern mlan_status wlan_11h_config_slave_radar_det(mlan_private *priv,
/** Checks all interfaces and updates radar detect flags if necessary */
extern mlan_status wlan_11h_check_update_radar_det_state(mlan_private *pmpriv);
#ifdef UAP_SUPPORT
/** update dfs master state from uap interface */
void wlan_11h_update_dfs_master_state_by_uap(mlan_private *pmpriv);
/** update dfs master when station disconnected */
void wlan_11h_update_dfs_master_state_on_disconect(mlan_private *priv);
/** update dfs master state from STA interface */
void wlan_11h_update_dfs_master_state_by_sta(mlan_private *pmpriv);
#endif
/** Return 1 if 11h is active in the firmware, 0 if it is inactive */
extern t_bool wlan_11h_is_active(mlan_private *priv);
@ -135,12 +143,14 @@ extern mlan_status wlan_11h_handle_event_chanswann(mlan_private *priv);
/** Handler for EVENT_CHANNEL_REPORT_RDY */
extern mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
mlan_event *pevent,
t_u8 *radar_chan);
t_u8 *radar_chan,
t_u8 *bandwidth);
/** Debug output for EVENT_RADAR_DETECTED */
mlan_status wlan_11h_print_event_radar_detected(mlan_private *priv,
mlan_event *pevent,
t_u8 *radar_chan);
t_u8 *radar_chan,
t_u8 *bandwidth);
t_s32 wlan_11h_cancel_radar_detect(mlan_private *priv);
/** Handler for DFS_TESTING IOCTL */
@ -148,6 +158,8 @@ extern mlan_status wlan_11h_ioctl_dfs_testing(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
extern mlan_status wlan_11h_ioctl_channel_nop_info(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
extern mlan_status wlan_11h_ioctl_nop_channel_list(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
extern mlan_status wlan_11h_ioctl_dfs_chan_report(mlan_private *priv,
pmlan_ioctl_req pioctl_req);
@ -162,6 +174,9 @@ mlan_status wlan_11h_ioctl_chan_dfs_state(pmlan_adapter pmadapter,
mlan_status wlan_11h_ioctl_dfs_w53_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
/** get/set dfs mode */
mlan_status wlan_11h_ioctl_dfs_mode(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
/** Check if channel is under a NOP duration (should not be used) */
extern t_bool wlan_11h_is_channel_under_nop(mlan_adapter *pmadapter,
t_u8 channel);
@ -172,7 +187,7 @@ extern t_bool wlan_11h_radar_detected_tx_blocked(mlan_adapter *pmadapter);
/** Callback for RADAR_DETECTED (for UAP cmdresp) */
extern mlan_status wlan_11h_radar_detected_callback(t_void *priv);
/** set dfs check channel */
void wlan_11h_set_dfs_check_chan(mlan_private *priv, t_u8 chan);
void wlan_11h_set_dfs_check_chan(mlan_private *priv, t_u8 chan, t_u8 bandwidth);
#ifdef UAP_SUPPORT
/** BW_change event Handler for dfs_repeater */

View file

@ -2888,7 +2888,7 @@ void wlan_11n_create_txbastream_tbl(mlan_private *priv, t_u8 *ra, int tid,
if (pmadapter->callbacks.moal_malloc(
pmadapter->pmoal_handle, sizeof(TxBAStreamTbl),
MLAN_MEM_DEF, (t_u8 **)&new_node)) {
MLAN_MEM_DEF | MLAN_MEM_FLAG_ATOMIC, (t_u8 **)&new_node)) {
PRINTM(MERROR,
"wlan_11n_create_txbastream_tbl Failed to allocate new_node\n");
LEAVE();

View file

@ -474,9 +474,9 @@ int wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
pmbuf_src = (pmlan_buffer)util_peek_list(
pmadapter->pmoal_handle, &pra_list->buf_head, MNULL, MNULL);
if (pmbuf_src) {
pmbuf_aggr = wlan_alloc_mlan_buffer(pmadapter,
pmadapter->tx_buf_size, 0,
MOAL_MALLOC_BUFFER);
pmbuf_aggr = wlan_alloc_mlan_buffer(
pmadapter, pmadapter->tx_buf_size, 0,
MOAL_MALLOC_BUFFER | MOAL_MEM_FLAG_ATOMIC);
if (!pmbuf_aggr) {
PRINTM(MERROR, "Error allocating mlan_buffer\n");
pmadapter->callbacks.moal_spin_unlock(

View file

@ -159,8 +159,8 @@ static chan_freq_power_t channel_freq_power_EU_BG[] = {
{9, 2452, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}},
{10, 2457, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}},
{11, 2462, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}},
{12, 2467, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1d, 0, 0}},
{13, 2472, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1d, 0, 0}}};
{12, 2467, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}},
{13, 2472, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}};
/** Band: 'B/G', Region: Japan */
static chan_freq_power_t channel_freq_power_JPN41_BG[] = {
@ -175,8 +175,8 @@ static chan_freq_power_t channel_freq_power_JPN41_BG[] = {
{9, 2452, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
{10, 2457, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
{11, 2462, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
{12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}},
{13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}}};
{12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
{13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}};
/** Band: 'B/G', Region: Japan */
static chan_freq_power_t channel_freq_power_JPN40_BG[] = {
@ -211,8 +211,8 @@ static chan_freq_power_t channel_freq_power_BR_BG[] = {
{9, 2452, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}},
{10, 2457, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}},
{11, 2462, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}},
{12, 2467, WLAN_TX_PWR_1000MW, MFALSE, {0x1d, 0, 0}},
{13, 2472, WLAN_TX_PWR_1000MW, MFALSE, {0x1d, 0, 0}}};
{12, 2467, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}},
{13, 2472, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}};
/** Band : 'B/G', Region: Special */
static chan_freq_power_t channel_freq_power_SPECIAL_BG[] = {
@ -227,9 +227,9 @@ static chan_freq_power_t channel_freq_power_SPECIAL_BG[] = {
{9, 2452, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
{10, 2457, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
{11, 2462, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
{12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}},
{13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}},
{14, 2484, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}}};
{12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
{13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
{14, 2484, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}};
/**
* The 2.4GHz CFP tables
@ -2579,7 +2579,7 @@ mlan_status wlan_get_curr_oper_class(mlan_private *pmpriv, t_u8 channel,
}
}
PRINTM(MCMND, "Operating class not find!\n");
PRINTM(MCMND, "Operating class not found!\n");
LEAVE();
return MLAN_STATUS_FAILURE;
}
@ -3101,6 +3101,41 @@ dfs_state_t wlan_get_chan_dfs_state(mlan_private *priv, t_u16 band, t_u8 chan)
return dfs_state;
}
/**
* @brief reset all channel's dfs state
*
* @param priv Private driver information structure
* @param band Band to check
* @param dfs_state dfs state
*
* @return N/A
*/
t_void wlan_reset_all_chan_dfs_state(mlan_private *priv, t_u16 band,
dfs_state_t dfs_state)
{
int i, j;
chan_freq_power_t *pcfp = MNULL;
ENTER();
/*get the cfp table first*/
for (i = 0; i < MAX_REGION_CHANNEL_NUM; i++) {
if (priv->adapter->region_channel[i].band & band) {
pcfp = priv->adapter->region_channel[i].pcfp;
break;
}
}
if (pcfp) {
/*check table according to chan num*/
for (j = 0; j < priv->adapter->region_channel[i].num_cfp; j++) {
pcfp[j].dynamic.dfs_state = dfs_state;
}
}
LEAVE();
}
/**
* @brief Convert rateid in IEEE format to MRVL format
*

View file

@ -134,6 +134,7 @@ static t_u8 wlan_is_cmd_allowed_during_scan(t_u16 cmd_id)
case HOST_CMD_APCMD_BSS_STOP:
case HOST_CMD_APCMD_STA_DEAUTH:
#endif
case HostCmd_CMD_802_11_BG_SCAN_CONFIG:
case HostCMD_APCMD_ACS_SCAN:
ret = MFALSE;
break;
@ -2283,7 +2284,8 @@ mlan_status wlan_process_cmdresp(mlan_adapter *pmadapter)
if (pmadapter->hw_status == WlanHardwareStatusInitializing ||
pmadapter->hw_status == WlanHardwareStatusGetHwSpec) {
if (ret == MLAN_STATUS_FAILURE) {
#ifdef STA_SUPPORT
#if 0
//ignore command error for WARM RESET
if (pmadapter->pwarm_reset_ioctl_req) {
/* warm reset failure */
pmadapter->pwarm_reset_ioctl_req->status_code =
@ -2344,6 +2346,15 @@ mlan_status wlan_process_cmdresp(mlan_adapter *pmadapter)
if (!pmpriv_next || i >= pmadapter->priv_num) {
#ifdef STA_SUPPORT
if (pmadapter->pwarm_reset_ioctl_req) {
for (i = 0; i < pmadapter->priv_num; i++) {
if (pmadapter->priv[i]->curr_addr[0] ==
0xff)
memmove(pmadapter,
pmadapter->priv[i]
->curr_addr,
pmadapter->permanent_addr,
MLAN_MAC_ADDR_LENGTH);
}
/* warm reset complete */
PRINTM(MMSG, "wlan: warm reset complete\n");
pmadapter->hw_status = WlanHardwareStatusReady;
@ -4042,9 +4053,10 @@ mlan_status wlan_cmd_tx_rate_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
rate_drop->length = wlan_cpu_to_le16(sizeof(rate_drop->rate_drop_mode));
rate_drop->rate_drop_mode = 0;
cmd->size = wlan_cpu_to_le16(
S_DS_GEN + sizeof(HostCmd_DS_TX_RATE_CFG) + rate_scope->length +
sizeof(MrvlIEtypesHeader_t) + sizeof(MrvlRateDropPattern_t));
cmd->size = wlan_cpu_to_le16(S_DS_GEN + sizeof(HostCmd_DS_TX_RATE_CFG) +
wlan_le16_to_cpu(rate_scope->length) +
sizeof(MrvlIEtypesHeader_t) +
sizeof(MrvlRateDropPattern_t));
if (pioctl_buf && pmpriv->adapter->pcard_info->v17_fw_api) {
ds_rate = (mlan_ds_rate *)pioctl_buf->pbuf;
rate_setting_tlv = (MrvlIETypes_rate_setting_t
@ -4060,7 +4072,8 @@ mlan_status wlan_cmd_tx_rate_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
rate_setting_tlv->rate_setting);
cmd->size = wlan_cpu_to_le16(
S_DS_GEN + sizeof(HostCmd_DS_TX_RATE_CFG) +
rate_scope->length + sizeof(MrvlIEtypesHeader_t) +
wlan_le16_to_cpu(rate_scope->length) +
sizeof(MrvlIEtypesHeader_t) +
sizeof(MrvlRateDropPattern_t) +
sizeof(MrvlIETypes_rate_setting_t));
}
@ -4102,11 +4115,7 @@ mlan_status wlan_ret_tx_rate_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
prate_cfg = (HostCmd_DS_TX_RATE_CFG *)&(resp->params.tx_rate_cfg);
tlv_buf = (t_u8 *)prate_cfg->tlv_buf;
if (tlv_buf) {
tlv_buf_len = resp->size -
(sizeof(HostCmd_DS_TX_RATE_CFG) + S_DS_GEN);
tlv_buf_len = wlan_le16_to_cpu(tlv_buf_len);
}
tlv_buf_len = resp->size - (sizeof(HostCmd_DS_TX_RATE_CFG) + S_DS_GEN);
while (tlv_buf && tlv_buf_len > 0) {
tlv = (*tlv_buf);
@ -4263,6 +4272,8 @@ mlan_status wlan_adapter_get_hw_spec(pmlan_adapter pmadapter)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_private priv = wlan_get_priv(pmadapter, MLAN_BSS_ROLE_ANY);
ENTER();
#if defined(SDIO)
/*
* This should be issued in the very first to config
@ -5381,8 +5392,8 @@ mlan_status wlan_ret_get_hw_spec(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
sb_uuid_tlv = (MrvlIEtypes_Secure_Boot_Uuid_t *)tlv;
pmadapter->uuid_lo = sb_uuid_tlv->uuid_lo;
pmadapter->uuid_hi = sb_uuid_tlv->uuid_hi;
PRINTM(MMSG, "uuid: %llx%llx\n", pmadapter->uuid_lo,
pmadapter->uuid_hi);
PRINTM(MMSG, "uuid: %016llx%016llx\n",
pmadapter->uuid_lo, pmadapter->uuid_hi);
break;
default:
break;
@ -9198,6 +9209,7 @@ mlan_status wlan_cmd_get_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
cfg_cmd->action = wlan_cpu_to_le16(cmd_action);
cfg_cmd->ch_load = wlan_cpu_to_le16(cfg->ch_load_param);
cfg_cmd->noise = wlan_cpu_to_le16(cfg->noise);
cfg_cmd->rx_quality = wlan_cpu_to_le16(cfg->rx_quality);
cfg_cmd->duration = wlan_cpu_to_le16(cfg->duration);
LEAVE();
return MLAN_STATUS_SUCCESS;
@ -9215,12 +9227,7 @@ mlan_status wlan_cmd_get_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
mlan_status wlan_ret_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf)
{
HostCmd_DS_GET_CH_LOAD *cfg_cmd =
(HostCmd_DS_GET_CH_LOAD *)&resp->params.ch_load;
ENTER();
pmpriv->ch_load_param = wlan_le16_to_cpu(cfg_cmd->ch_load);
pmpriv->noise = wlan_le16_to_cpu(cfg_cmd->noise);
LEAVE();
return MLAN_STATUS_SUCCESS;
}

View file

@ -24,7 +24,7 @@
#define _MLAN_DECL_H_
/** MLAN release version */
#define MLAN_RELEASE_VERSION "344.p3"
#define MLAN_RELEASE_VERSION "362"
/** Re-define generic data types for MLAN/MOAL */
/** Signed char (1-byte) */
@ -129,13 +129,8 @@ typedef t_s32 t_sval;
/** Return aligned offset */
#define OFFSET_ALIGN_ADDR(p, a) (t_u32)(ALIGN_ADDR(p, a) - (t_ptr)p)
#if defined(WIFI_DIRECT_SUPPORT)
/** Maximum BSS numbers */
#define MLAN_MAX_BSS_NUM (16)
#else
/** Maximum BSS numbers */
#define MLAN_MAX_BSS_NUM (2)
#endif
/** NET IP alignment */
#define MLAN_NET_IP_ALIGN 2
@ -634,6 +629,8 @@ typedef enum {
/** Memory allocation type: DMA */
#define MLAN_MEM_DMA MBIT(0)
/** Memory allocation flag: ATOMIC */
#define MLAN_MEM_FLAG_ATOMIC MBIT(1)
/** Default memory allocation flag */
#define MLAN_MEM_DEF 0
@ -960,6 +957,14 @@ typedef enum _dfs_w53_cfg_t {
DFS_W53_OLD = 2
} dfs_w53_cfg_t;
typedef enum _dfs_moe_t {
/** driver default DFS behavior */
DFS_MODE_DEFAULT = 0,
/* disable DFS master when uap and station operate in same DFS channel
*/
DFS_MODE_ENH = 1,
} dfs_mode_t;
/** Band_Config_t */
typedef MLAN_PACK_START struct _Band_Config_t {
/** Band Info - (00)=2.4GHz, (01)=5GHz */
@ -2005,7 +2010,16 @@ typedef struct {
/** station stats */
typedef struct _sta_stats {
/** last_rx_in_msec */
t_u64 last_rx_in_msec;
/** rx_packets */
t_u32 rx_packets;
/** tx packets */
t_u32 tx_packets;
/** rx bytes */
t_u32 rx_bytes;
/** tx bytes */
t_u32 tx_bytes;
} sta_stats;
#ifdef PRAGMA_PACK

View file

@ -1623,6 +1623,9 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_He_Op_t {
/** Host Command ID : OTP user data */
#define HostCmd_CMD_OTP_READ_USER_DATA 0x0114
/** Host Command ID: fw auto reconnect */
#define HostCmd_CMD_FW_AUTO_RECONNECT 0x0115
/** Host Command ID: HS wakeup reason */
#define HostCmd_CMD_HS_WAKEUP_REASON 0x0116
@ -2082,6 +2085,8 @@ typedef enum _ENH_PS_MODES {
#define EVENT_ASSOC_REQ_IE 0x00000095
#define CHAN_LOAD_EVENT 0x00000099
/** Event ID mask */
#define EVENT_ID_MASK 0xffff
@ -3162,6 +3167,14 @@ typedef MLAN_PACK_START struct _mef_op {
t_u8 val[MAX_NUM_BYTE_SEQ + 1];
} MLAN_PACK_END mef_op;
/** Structure definition for low power mode cfg command */
typedef MLAN_PACK_START struct _HostCmd_DS_LOW_POWER_MODE_CFG {
/** Action */
t_u16 action;
/** Low power mode */
t_u16 lpm;
} MLAN_PACK_END HostCmd_DS_LOW_POWER_MODE_CFG;
/* HostCmd_DS_802_11_SLEEP_PERIOD */
typedef MLAN_PACK_START struct _HostCmd_DS_802_11_SLEEP_PERIOD {
/** ACT_GET/ACT_SET */
@ -3288,14 +3301,6 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_bcn_timeout_t {
t_u16 bcn_rq_tmo_period;
} MLAN_PACK_END MrvlIEtypes_bcn_timeout_t;
/** Structure definition for low power mode cfg command */
typedef MLAN_PACK_START struct _HostCmd_DS_LOW_POWER_MODE_CFG {
/** Action */
t_u16 action;
/** Low power mode */
t_u16 lpm;
} MLAN_PACK_END HostCmd_DS_LOW_POWER_MODE_CFG;
/** Structure definition for new power save command */
typedef MLAN_PACK_START struct _HostCmd_DS_PS_MODE_ENH {
/** Action */
@ -3527,6 +3532,7 @@ typedef MLAN_PACK_START struct _HostCmd_DS_GET_CH_LOAD {
t_u16 action;
t_u16 ch_load;
t_s16 noise;
t_u16 rx_quality;
t_u16 duration;
} MLAN_PACK_END HostCmd_DS_GET_CH_LOAD;
@ -5961,6 +5967,25 @@ typedef MLAN_PACK_START struct _HostCmd_DS_OTP_USER_DATA {
t_u8 user_data[1];
} MLAN_PACK_END HostCmd_DS_OTP_USER_DATA;
/** HostCmd_DS_FW_AUTO_RECONNECT */
typedef MLAN_PACK_START struct _HostCmd_DS_FW_AUTO_RECONNECT {
/** ACT_GET/ACT_SET */
t_u16 action;
/** reconnect counter:
* [0x0]: Do not attempt auto reconnect i.e. disable auto-reconnect
* [0x1-0xFE]: Number of times reconnection needs to be attempted
* [0xFF]: Attempt auto-reconnection forever */
t_u8 reconnect_counter;
/** reconnect interval */
t_u8 reconnect_interval;
/** flags:
* [Bit 0]: Set to 1: Firmware should report link-loss to host if AP
* rejects authentication/association while reconnecting Set to 0:
* Default behavior: Firmware does not report link-loss to host on AP
* rejection and continues internally [Bit 1-15]: Reserved */
t_u16 flags;
} MLAN_PACK_END HostCmd_DS_FW_AUTO_RECONNECT;
/** HostCmd_CMD_HS_WAKEUP_REASON */
typedef MLAN_PACK_START struct _HostCmd_DS_HS_WAKEUP_REASON {
/** wakeupReason:
@ -7960,6 +7985,7 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
#endif
HostCmd_DS_GPIO_TSF_LATCH_PARAM_CONFIG gpio_tsf_latch;
HostCmd_DS_COALESCE_CONFIG coalesce_config;
HostCmd_DS_FW_AUTO_RECONNECT fw_auto_reconnect_cmd;
HostCmd_DS_HS_WAKEUP_REASON hs_wakeup_reason;
HostCmd_DS_PACKET_AGGR_CTRL aggr_ctrl;
#ifdef USB

View file

@ -1637,6 +1637,8 @@ typedef MLAN_PACK_START struct {
t_u8 bssid_num;
/** BSSID filter list used in the to limit the scan results */
mlan_802_11_mac_addr bssid_list[MAX_BSSID_FILTER_LIST];
/** use scan setting from scan_cfg only */
t_u8 scan_cfg_only;
} MLAN_PACK_END wlan_user_scan_cfg;
/** Default scan interval in millisecond*/

View file

@ -808,9 +808,9 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter)
*/
pmadapter->pm_wakeup_card_req = MFALSE;
pmadapter->pm_wakeup_timeout = 0;
pmadapter->pm_wakeup_fw_try = MFALSE;
pmadapter->pm_wakeup_timeout = 0;
if (!pmadapter->init_para.max_tx_buf)
pmadapter->max_tx_buf_size =

View file

@ -236,6 +236,8 @@ enum _mlan_ioctl_req_id {
MLAN_OID_11H_CHAN_NOP_INFO = 0x00110006,
MLAN_OID_11H_CHAN_DFS_STATE = 0x00110007,
MLAN_OID_11H_DFS_W53_CFG = 0x00110008,
MLAN_OID_11H_DFS_MODE = 0x00110009,
MLAN_OID_11H_NOP_CHAN_LIST = 0x0011000A,
/* 802.11n Configuration Group RANDYTODO for value assign */
MLAN_IOCTL_11AC_CFG = 0x00120000,
@ -280,6 +282,7 @@ enum _mlan_ioctl_req_id {
#endif
MLAN_OID_MISC_HOTSPOT_CFG = 0x0020001C,
MLAN_OID_MISC_OTP_USER_DATA = 0x0020001D,
MLAN_OID_MISC_AUTO_ASSOC = 0x0020001E,
#ifdef USB
MLAN_OID_MISC_USB_AGGR_CTRL = 0x0020001F,
#endif
@ -403,6 +406,14 @@ enum _mlan_pass_to_act_scan {
MLAN_PASS_TO_ACT_SCAN_DIS
};
/** Enumeration for passive to active scan */
enum _mlan_ext_scan {
MLAN_EXTENDED_SCAN_UNCHANGED = 0,
MLAN_LEGACY_SCAN,
MLAN_EXT_SCAN,
MLAN_EXT_SCAN_ENH
};
/** Max number of supported rates */
#define MLAN_SUPPORTED_RATES 32
@ -4188,12 +4199,23 @@ typedef struct _mlan_ds_11h_chan_nop_info {
t_u8 curr_chan;
/** channel_width */
t_u8 chan_width;
/** check new channel flag */
t_u8 check_new_chan;
/** flag for chan under nop */
t_bool chan_under_nop;
/** chan_ban_info for new channel */
chan_band_info new_chan;
} mlan_ds_11h_chan_nop_info, *pmlan_ds_11h_chan_nop_info;
/** Type definition of mlan_ds_11h_nop_chan_list for MLAN_OID_11H_NOP_CHAN_LIST
*/
typedef struct _mlan_ds_11h_nop_chan_list {
/** number of nop channel */
t_u8 num_chan;
/** chan list array */
t_u8 chan_list[20];
} mlan_ds_11h_nop_chan_list, *pmlan_ds_11h_nop_chan_list;
typedef struct _mlan_ds_11h_chan_rep_req {
t_u16 startFreq;
Band_Config_t bandcfg;
@ -4229,6 +4251,8 @@ typedef struct _mlan_ds_11h_cfg {
mlan_ds_11h_dfs_testing dfs_testing;
/** channel NOP information for MLAN_OID_11H_CHAN_NOP_INFO */
mlan_ds_11h_chan_nop_info ch_nop_info;
/** NOP channel list for MLAN_OID_11H_NOP_CHAN_LIST */
mlan_ds_11h_nop_chan_list nop_chan_list;
/** channel report req for MLAN_OID_11H_CHAN_REPORT_REQUEST */
mlan_ds_11h_chan_rep_req chan_rpt_req;
/** channel switch count for MLAN_OID_11H_CHAN_SWITCH_COUNT*/
@ -4236,6 +4260,8 @@ typedef struct _mlan_ds_11h_cfg {
/** channel dfs state for MLAN_OID_11H_CHAN_DFS_STATE */
mlan_ds_11h_chan_dfs_state ch_dfs_state;
mlan_ds_11h_dfs_w53_cfg dfs_w53_cfg;
/** dfs_mode for MLAN_OID_11H_DFS_MODE */
t_u8 dfs_mode;
} param;
} mlan_ds_11h_cfg, *pmlan_ds_11h_cfg;
@ -4644,6 +4670,16 @@ typedef struct _mlan_ds_misc_otp_user_data {
t_u8 user_data[MAX_OTP_USER_DATA_LEN];
} mlan_ds_misc_otp_user_data;
/** Type definition of mlan_ds_fw_reconnect for MLAN_OID_MISC_AUTO_ASSOC */
typedef struct _mlan_ds_fw_reconnect {
/* fw auto re-connect counter */
t_u8 fw_reconn_counter;
/* fw auto re-connect interval */
t_u8 fw_reconn_interval;
/* fw auto re-connect flags */
t_u16 fw_reconn_flags;
} mlan_ds_fw_reconnect;
typedef struct _aggr_ctrl_cfg {
/** Enable */
t_u16 enable;
@ -5524,6 +5560,7 @@ typedef struct _mlan_ds_ch_load {
t_u8 action;
t_u16 ch_load_param;
t_s16 noise;
t_u16 rx_quality;
t_u16 duration;
} mlan_ds_ch_load;
@ -5598,6 +5635,8 @@ typedef struct _mlan_ds_misc_cfg {
ExtCap_t ext_cap;
#endif
mlan_ds_misc_otp_user_data otp_user_data;
/** fw re-connect cfg param set */
mlan_ds_fw_reconnect fw_auto_reconnect;
#ifdef USB
/** USB aggregation parameters for MLAN_OID_MISC_USB_AGGR_CTRL
*/

View file

@ -282,7 +282,7 @@ static mlan_status wlan_get_common_rates(mlan_private *pmpriv, t_u8 *rate1,
ENTER();
ret = pcb->moal_malloc(pmpriv->adapter->pmoal_handle, rate1_size,
MLAN_MEM_DEF, &tmp);
MLAN_MEM_DEF | MLAN_MEM_FLAG_ATOMIC, &tmp);
if (ret != MLAN_STATUS_SUCCESS || !tmp) {
PRINTM(MERROR, "Failed to allocate buffer\n");
ret = MLAN_STATUS_FAILURE;
@ -1622,6 +1622,10 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
pmpriv->curr_bss_params.bss_descriptor.mac_address);
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_CONNECTED, pevent);
#ifdef UAP_SUPPORT
if (pmpriv->adapter->dfs_mode)
wlan_11h_update_dfs_master_state_by_sta(pmpriv);
#endif
wlan_coex_ampdu_rxwinsize(pmpriv->adapter);

View file

@ -1147,6 +1147,8 @@ typedef struct _mlan_private {
t_bool uap_host_based;
/**UAP operating channel*/
t_u8 uap_channel;
/**UAP bandwidth*/
t_u8 uap_bandwidth;
/** state variable for UAP Get Info callback */
wlan_uap_get_info_cb_t uap_state_chan_cb;
#endif /* UAP_SUPPORT */
@ -1311,6 +1313,8 @@ typedef struct _mlan_private {
t_u16 ch_load_param;
/** Noise floor value for current channel */
t_s16 noise;
/** rx quality info */
t_u16 rx_quality;
} mlan_private, *pmlan_private;
typedef struct _assoc_logger {
@ -1593,6 +1597,8 @@ typedef struct {
t_bool dfs_radar_found;
/** Channel radar is being checked on. BAND_A is assumed. */
t_u8 dfs_check_channel;
/** Channel radar is being checked on bandwidth*/
t_u8 dfs_check_bandwidth;
/** point to the priv which start the DFS check */
t_void *dfs_check_priv;
/** Timestamp when we got last report,
@ -2503,6 +2509,8 @@ typedef struct _mlan_adapter {
wlan_dfs_testing_settings_t dfs_test_params;
/** dfs w53 cfg */
t_u8 dfs53cfg;
/** dfs_mode */
t_u8 dfs_mode;
/** FSM variable for MEAS support */
wlan_meas_state_t state_meas;
/** Scan table */
@ -3059,8 +3067,9 @@ t_u8 wlan_bypass_tx_list_empty(mlan_adapter *pmadapter);
/** Check if this is the last packet */
t_u8 wlan_check_last_packet_indication(pmlan_private priv);
#define MOAL_ALLOC_MLAN_BUFFER (0)
#define MOAL_MALLOC_BUFFER (1)
#define MOAL_ALLOC_MLAN_BUFFER MBIT(0)
#define MOAL_MALLOC_BUFFER MBIT(1)
#define MOAL_MEM_FLAG_ATOMIC MBIT(2)
#ifdef PCIE
/* This defines the direction arg to the DMA mapping routines. */
@ -3559,6 +3568,8 @@ t_bool wlan_set_chan_blacklist(mlan_private *priv, t_u16 band, t_u8 chan,
dfs_state_t wlan_get_chan_dfs_state(mlan_private *priv, t_u16 band, t_u8 chan);
t_void wlan_set_chan_dfs_state(mlan_private *priv, t_u16 band, t_u8 chan,
dfs_state_t dfs_state);
t_void wlan_reset_all_chan_dfs_state(mlan_private *priv, t_u16 band,
dfs_state_t dfs_state);
/* 802.11D related functions */
/** Initialize 11D */
t_void wlan_11d_priv_init(mlan_private *pmpriv);

View file

@ -1018,6 +1018,7 @@ pmlan_buffer wlan_alloc_mlan_buffer(mlan_adapter *pmadapter, t_u32 data_len,
t_u32 buf_size = 0;
t_u8 *tmp_buf = MNULL;
pmlan_callbacks pcb = &pmadapter->callbacks;
t_u32 mem_flags = MLAN_MEM_DEF | MLAN_MEM_DMA;
ENTER();
@ -1029,13 +1030,12 @@ pmlan_buffer wlan_alloc_mlan_buffer(mlan_adapter *pmadapter, t_u32 data_len,
#endif
/* head_room is not implemented for malloc mlan buffer */
switch (malloc_flag) {
case MOAL_MALLOC_BUFFER:
if (malloc_flag & MOAL_MALLOC_BUFFER) {
buf_size = sizeof(mlan_buffer) + data_len + DMA_ALIGNMENT;
if (malloc_flag & MOAL_MEM_FLAG_ATOMIC)
mem_flags |= MLAN_MEM_FLAG_ATOMIC;
ret = pcb->moal_malloc(pmadapter->pmoal_handle, buf_size,
MLAN_MEM_DEF | MLAN_MEM_DMA,
(t_u8 **)&pmbuf);
mem_flags, (t_u8 **)&pmbuf);
if ((ret != MLAN_STATUS_SUCCESS) || !pmbuf) {
pmbuf = MNULL;
goto exit;
@ -1049,9 +1049,7 @@ pmlan_buffer wlan_alloc_mlan_buffer(mlan_adapter *pmadapter, t_u32 data_len,
pmbuf->data_offset = 0;
pmbuf->data_len = data_len;
pmbuf->flags |= MLAN_BUF_FLAG_MALLOC_BUF;
break;
case MOAL_ALLOC_MLAN_BUFFER:
} else if (malloc_flag & MOAL_ALLOC_MLAN_BUFFER) {
/* use moal_alloc_mlan_buffer, head_room supported */
ret = pcb->moal_alloc_mlan_buffer(
pmadapter->pmoal_handle,
@ -1067,7 +1065,6 @@ pmlan_buffer wlan_alloc_mlan_buffer(mlan_adapter *pmadapter, t_u32 data_len,
(t_u32)(tmp_buf - (pmbuf->pbuf + pmbuf->data_offset));
pmbuf->data_len = data_len;
pmbuf->flags = 0;
break;
}
exit:
@ -1244,6 +1241,10 @@ mlan_status wlan_bss_ioctl_bss_role(pmlan_adapter pmadapter,
pmpriv->bss_type = MLAN_BSS_TYPE_UAP;
/* Initialize private structures */
wlan_init_priv(pmpriv);
/* restore mac address */
memcpy_ext(pmpriv->adapter, pmpriv->curr_addr,
pmpriv->adapter->permanent_addr,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
mlan_block_rx_process(pmadapter, MFALSE);
/* Initialize function table */
for (j = 0; mlan_ops[j]; j++) {
@ -3493,6 +3494,33 @@ mlan_status wlan_misc_otp_user_data(pmlan_adapter pmadapter,
return ret;
}
#ifdef UAP_SUPPORT
/**
* @brief Check 11B support Rates
*
*
* @param pmadapter Private mlan adapter structure
*
* @return MTRUE/MFALSE
*
*/
static t_u8 wlan_check_ie_11b_support_rates(pIEEEtypes_Generic_t prates)
{
int i;
t_u8 rate;
t_u8 ret = MTRUE;
for (i = 0; i < prates->ieee_hdr.len; i++) {
rate = prates->data[i] & 0x7f;
if ((rate != 0x02) && (rate != 0x04) && (rate != 0x0b) &&
(rate != 0x16)) {
ret = MFALSE;
break;
}
}
return ret;
}
#endif
/**
* @brief This function will search for the specific ie
*
@ -3513,7 +3541,8 @@ void wlan_check_sta_capability(pmlan_private priv, pmlan_buffer pevent,
IEEEtypes_VHTCap_t *pvht_cap = MNULL;
IEEEtypes_Extension_t *phe_cap = MNULL;
#ifdef UAP_SUPPORT
t_u8 *ext_rate = MNULL, *erp = MNULL;
t_u8 *rate = MNULL;
t_u8 b_only = MFALSE;
#endif
int tlv_buf_left = pevent->data_len - ASSOC_EVENT_FIX_SIZE;
@ -3649,17 +3678,12 @@ void wlan_check_sta_capability(pmlan_private priv, pmlan_buffer pevent,
}
#ifdef UAP_SUPPORT
/* Note: iphone6 does not have ERP_INFO */
ext_rate = wlan_get_specific_ie(
priv, assoc_req_ie, ie_len,
EXTENDED_SUPPORTED_RATES, 0);
erp = wlan_get_specific_ie(priv, assoc_req_ie,
ie_len, ERP_INFO, 0);
if (!ext_rate)
PRINTM(MCMND,
"STA doesn't support EXTENDED_SUPPORTED_RATES\n");
if (!erp)
PRINTM(MCMND,
"STA doesn't support ERP_INFO\n");
rate = wlan_get_specific_ie(priv, assoc_req_ie,
ie_len,
SUPPORTED_RATES, 0);
if (rate)
b_only = wlan_check_ie_11b_support_rates(
(pIEEEtypes_Generic_t)rate);
if (sta_ptr->is_11ax_enabled) {
if (priv->uap_channel <= 14)
sta_ptr->bandmode = BAND_GAX;
@ -3675,13 +3699,13 @@ void wlan_check_sta_capability(pmlan_private priv, pmlan_buffer pevent,
sta_ptr->bandmode = BAND_GN;
else
sta_ptr->bandmode = BAND_AN;
} else if (ext_rate || erp) {
if (priv->uap_channel <= 14)
sta_ptr->bandmode = BAND_G;
} else if (priv->uap_channel <= 14) {
if (b_only)
sta_ptr->bandmode = BAND_B;
else
sta_ptr->bandmode = BAND_A;
sta_ptr->bandmode = BAND_G;
} else
sta_ptr->bandmode = BAND_B;
sta_ptr->bandmode = BAND_A;
#endif
#ifdef DRV_EMBEDDED_AUTHENTICATOR
if (IsAuthenticatorEnabled(priv->psapriv))
@ -6111,6 +6135,7 @@ mlan_status wlan_misc_ioctl_ch_load_results(pmlan_adapter pmadapter,
} else {
misc->param.ch_load.ch_load_param = pmpriv->ch_load_param;
misc->param.ch_load.noise = pmpriv->noise;
misc->param.ch_load.rx_quality = pmpriv->rx_quality;
}
LEAVE();

View file

@ -934,9 +934,9 @@ static mlan_status wlan_pcie_create_txbd_ring(mlan_adapter *pmadapter)
(t_void *)padma_bd_buf;
padma_bd_buf->paddr = 0;
padma_bd_buf->len = 0;
padma_bd_buf->flags =
padma_bd_buf->flags = wlan_cpu_to_le16(
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_SRC_HOST |
ADMA_BD_FLAG_SOP | ADMA_BD_FLAG_EOP;
ADMA_BD_FLAG_SOP | ADMA_BD_FLAG_EOP);
padma_bd_buf->pkt_size = 0;
padma_bd_buf->reserved = 0;
}
@ -1169,11 +1169,14 @@ static mlan_status wlan_pcie_create_rxbd_ring(mlan_adapter *pmadapter)
(sizeof(mlan_pcie_data_buf) * i));
pmadapter->pcard_pcie->rxbd_ring[i] =
(t_void *)prxbd_buf;
prxbd_buf->paddr = pmbuf->buf_pa;
prxbd_buf->len = (t_u16)pmbuf->data_len;
prxbd_buf->flags = MLAN_BD_FLAG_SOP | MLAN_BD_FLAG_EOP;
prxbd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
prxbd_buf->len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
prxbd_buf->flags = wlan_cpu_to_le16(MLAN_BD_FLAG_SOP |
MLAN_BD_FLAG_EOP);
prxbd_buf->offset = 0;
prxbd_buf->frag_len = (t_u16)pmbuf->data_len;
prxbd_buf->frag_len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
}
#endif
@ -1186,11 +1189,11 @@ static mlan_status wlan_pcie_create_rxbd_ring(mlan_adapter *pmadapter)
(sizeof(adma_dual_desc_buf) * i));
pmadapter->pcard_pcie->rxbd_ring[i] =
(t_void *)padma_bd_buf;
padma_bd_buf->paddr = pmbuf->buf_pa;
padma_bd_buf->len =
ALIGN_SZ(pmbuf->data_len, ADMA_ALIGN_SIZE);
padma_bd_buf->flags =
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_DST_HOST;
padma_bd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
padma_bd_buf->len = wlan_cpu_to_le16(
ALIGN_SZ(pmbuf->data_len, ADMA_ALIGN_SIZE));
padma_bd_buf->flags = wlan_cpu_to_le16(
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_DST_HOST);
padma_bd_buf->pkt_size = 0;
padma_bd_buf->reserved = 0;
}
@ -1382,8 +1385,9 @@ static mlan_status wlan_pcie_create_evtbd_ring(mlan_adapter *pmadapter)
(sizeof(mlan_pcie_evt_buf) * i));
pmadapter->pcard_pcie->evtbd_ring[i] =
(t_void *)pevtbd_buf;
pevtbd_buf->paddr = pmbuf->buf_pa;
pevtbd_buf->len = (t_u16)pmbuf->data_len;
pevtbd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
pevtbd_buf->len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
pevtbd_buf->flags = 0;
}
#endif
@ -1397,11 +1401,11 @@ static mlan_status wlan_pcie_create_evtbd_ring(mlan_adapter *pmadapter)
(sizeof(adma_dual_desc_buf) * i));
pmadapter->pcard_pcie->evtbd_ring[i] =
(t_void *)padma_bd_buf;
padma_bd_buf->paddr = pmbuf->buf_pa;
padma_bd_buf->len =
ALIGN_SZ(pmbuf->data_len, ADMA_ALIGN_SIZE);
padma_bd_buf->flags =
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_DST_HOST;
padma_bd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
padma_bd_buf->len = wlan_cpu_to_le16(
ALIGN_SZ(pmbuf->data_len, ADMA_ALIGN_SIZE));
padma_bd_buf->flags = wlan_cpu_to_le16(
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_DST_HOST);
padma_bd_buf->pkt_size = 0;
padma_bd_buf->reserved = 0;
}
@ -1888,7 +1892,7 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type,
ENTER();
if (!(pmadapter && pmbuf)) {
if (!pmbuf) {
PRINTM(MERROR, "%s() has no buffer", __FUNCTION__);
ret = MLAN_STATUS_FAILURE;
goto done;
@ -1934,10 +1938,13 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type,
wr_ptr_start = TXBD_RW_PTR_START;
ptx_bd_buf = (mlan_pcie_data_buf *)pmadapter->pcard_pcie
->txbd_ring[wrindx];
ptx_bd_buf->paddr = pmbuf->buf_pa;
ptx_bd_buf->len = (t_u16)pmbuf->data_len;
ptx_bd_buf->flags = MLAN_BD_FLAG_SOP | MLAN_BD_FLAG_EOP;
ptx_bd_buf->frag_len = (t_u16)pmbuf->data_len;
ptx_bd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
ptx_bd_buf->len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
ptx_bd_buf->flags = wlan_cpu_to_le16(MLAN_BD_FLAG_SOP |
MLAN_BD_FLAG_EOP);
ptx_bd_buf->frag_len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
ptx_bd_buf->offset = 0;
pmadapter->pcard_pcie->last_tx_pkt_size[wrindx] =
pmbuf->data_len;
@ -1959,15 +1966,16 @@ static mlan_status wlan_pcie_send_data(mlan_adapter *pmadapter, t_u8 type,
wr_ptr_start = ADMA_WPTR_START;
padma_bd_buf = (adma_dual_desc_buf *)pmadapter
->pcard_pcie->txbd_ring[wrindx];
padma_bd_buf->paddr = pmbuf->buf_pa;
padma_bd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
padma_bd_buf->len =
ALIGN_SZ(pmbuf->data_len, ADMA_ALIGN_SIZE);
padma_bd_buf->flags =
padma_bd_buf->flags = wlan_cpu_to_le16(
ADMA_BD_FLAG_SOP | ADMA_BD_FLAG_EOP |
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_SRC_HOST;
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_SRC_HOST);
if (padma_bd_buf->len < ADMA_MIN_PKT_SIZE)
padma_bd_buf->len = ADMA_MIN_PKT_SIZE;
padma_bd_buf->pkt_size = pmbuf->data_len;
padma_bd_buf->len = wlan_cpu_to_le16(padma_bd_buf->len);
padma_bd_buf->pkt_size = padma_bd_buf->len;
pmadapter->pcard_pcie->last_tx_pkt_size[wrindx] =
pmbuf->data_len;
pmadapter->pcard_pcie->txbd_wrptr++;
@ -2312,11 +2320,14 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter)
if (!pmadapter->pcard_pcie->reg->use_adma) {
prxbd_buf = (mlan_pcie_data_buf *)pmadapter->pcard_pcie
->rxbd_ring[rd_index];
prxbd_buf->paddr = pmbuf->buf_pa;
prxbd_buf->len = (t_u16)pmbuf->data_len;
prxbd_buf->flags = MLAN_BD_FLAG_SOP | MLAN_BD_FLAG_EOP;
prxbd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
prxbd_buf->len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
prxbd_buf->flags = wlan_cpu_to_le16(MLAN_BD_FLAG_SOP |
MLAN_BD_FLAG_EOP);
prxbd_buf->offset = 0;
prxbd_buf->frag_len = (t_u16)pmbuf->data_len;
prxbd_buf->frag_len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
/* update rxbd's rdptrs */
if ((++pmadapter->pcard_pcie->rxbd_rdptr &
@ -2348,11 +2359,11 @@ static mlan_status wlan_pcie_process_recv_data(mlan_adapter *pmadapter)
padma_bd_buf =
(adma_dual_desc_buf *)pmadapter->pcard_pcie
->rxbd_ring[rd_index];
padma_bd_buf->paddr = pmbuf->buf_pa;
padma_bd_buf->len =
ALIGN_SZ(pmbuf->data_len, ADMA_ALIGN_SIZE);
padma_bd_buf->flags =
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_DST_HOST;
padma_bd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
padma_bd_buf->len = wlan_cpu_to_le16(
ALIGN_SZ(pmbuf->data_len, ADMA_ALIGN_SIZE));
padma_bd_buf->flags = wlan_cpu_to_le16(
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_DST_HOST);
padma_bd_buf->pkt_size = 0;
padma_bd_buf->reserved = 0;
pmadapter->pcard_pcie->rxbd_rdptr++;
@ -2994,8 +3005,9 @@ static mlan_status wlan_pcie_event_complete(mlan_adapter *pmadapter,
if (!pmadapter->pcard_pcie->reg->use_adma) {
pevtbd_buf = (mlan_pcie_evt_buf *)pmadapter->pcard_pcie
->evtbd_ring[wrptr];
pevtbd_buf->paddr = pmbuf->buf_pa;
pevtbd_buf->len = (t_u16)pmbuf->data_len;
pevtbd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
pevtbd_buf->len =
wlan_cpu_to_le16((t_u16)pmbuf->data_len);
pevtbd_buf->flags = 0;
}
#endif
@ -3004,12 +3016,12 @@ static mlan_status wlan_pcie_event_complete(mlan_adapter *pmadapter,
if (pmadapter->pcard_pcie->reg->use_adma) {
padma_bd_buf = (adma_dual_desc_buf *)pmadapter
->pcard_pcie->evtbd_ring[wrptr];
padma_bd_buf->paddr = pmbuf->buf_pa;
padma_bd_buf->len =
ALIGN_SZ(pmbuf->data_len, ADMA_ALIGN_SIZE);
padma_bd_buf->paddr = wlan_cpu_to_le64(pmbuf->buf_pa);
padma_bd_buf->len = wlan_cpu_to_le16(
ALIGN_SZ(pmbuf->data_len, ADMA_ALIGN_SIZE));
padma_bd_buf->flags = 0;
padma_bd_buf->flags =
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_DST_HOST;
padma_bd_buf->flags = wlan_cpu_to_le16(
ADMA_BD_FLAG_INT_EN | ADMA_BD_FLAG_DST_HOST);
padma_bd_buf->pkt_size = 0;
padma_bd_buf->reserved = 0;
}
@ -4335,21 +4347,24 @@ mlan_status wlan_set_pcie_buf_config(mlan_private *pmpriv)
sizeof(HostCmd_DS_PCIE_HOST_BUF_DETAILS));
/* Send the ring base addresses and count to firmware */
host_spec.txbd_addr_lo =
(t_u32)(pmadapter->pcard_pcie->txbd_ring_pbase);
host_spec.txbd_addr_hi = (t_u32)(
((t_u64)pmadapter->pcard_pcie->txbd_ring_pbase) >> 32);
host_spec.txbd_count = pmadapter->pcard_pcie->txrx_bd_size;
host_spec.rxbd_addr_lo =
(t_u32)(pmadapter->pcard_pcie->rxbd_ring_pbase);
host_spec.rxbd_addr_hi = (t_u32)(
((t_u64)pmadapter->pcard_pcie->rxbd_ring_pbase) >> 32);
host_spec.rxbd_count = pmadapter->pcard_pcie->txrx_bd_size;
host_spec.evtbd_addr_lo =
(t_u32)(pmadapter->pcard_pcie->evtbd_ring_pbase);
host_spec.evtbd_addr_hi = (t_u32)(
((t_u64)pmadapter->pcard_pcie->evtbd_ring_pbase) >> 32);
host_spec.evtbd_count = MLAN_MAX_EVT_BD;
host_spec.txbd_addr_lo = wlan_cpu_to_le32(
(t_u32)(pmadapter->pcard_pcie->txbd_ring_pbase));
host_spec.txbd_addr_hi = wlan_cpu_to_le32((t_u32)(
((t_u64)pmadapter->pcard_pcie->txbd_ring_pbase) >> 32));
host_spec.txbd_count =
wlan_cpu_to_le32(pmadapter->pcard_pcie->txrx_bd_size);
host_spec.rxbd_addr_lo = wlan_cpu_to_le32(
(t_u32)(pmadapter->pcard_pcie->rxbd_ring_pbase));
host_spec.rxbd_addr_hi = wlan_cpu_to_le32((t_u32)(
((t_u64)pmadapter->pcard_pcie->rxbd_ring_pbase) >> 32));
host_spec.rxbd_count =
wlan_cpu_to_le32(pmadapter->pcard_pcie->txrx_bd_size);
host_spec.evtbd_addr_lo = wlan_cpu_to_le32(
(t_u32)(pmadapter->pcard_pcie->evtbd_ring_pbase));
host_spec.evtbd_addr_hi = wlan_cpu_to_le32((t_u32)(
((t_u64)pmadapter->pcard_pcie->evtbd_ring_pbase) >>
32));
host_spec.evtbd_count = wlan_cpu_to_le32(MLAN_MAX_EVT_BD);
ret = wlan_prepare_cmd(pmpriv,
HostCmd_CMD_PCIE_HOST_BUF_DETAILS,

View file

@ -532,7 +532,7 @@ static t_u8 wlan_scan_create_channel_list(
/* Passive scan on DFS channels */
if (wlan_11h_radar_detect_required(
pmpriv, (t_u8)cfp->channel) &&
scan_type != MLAN_SCAN_TYPE_PASSIVE)
scan_type == MLAN_SCAN_TYPE_PASSIVE)
scan_type =
MLAN_SCAN_TYPE_PASSIVE_TO_ACTIVE;
break;
@ -808,7 +808,8 @@ wlan_scan_channel_list(mlan_private *pmpriv, t_void *pioctl_buf,
ret = pcb->moal_malloc(
pmadapter->pmoal_handle,
MAX_SCAN_CFG_ALLOC - CHAN_TLV_MAX_SIZE,
MLAN_MEM_DEF, (t_u8 **)&ptlv_temp);
MLAN_MEM_DEF | MOAL_MEM_FLAG_ATOMIC,
(t_u8 **)&ptlv_temp);
if (ret != MLAN_STATUS_SUCCESS || !ptlv_temp) {
PRINTM(MERROR,
"Memory allocation for pscan_cfg_out failed!\n");
@ -1498,17 +1499,20 @@ static mlan_status wlan_scan_setup_scan_config(
return ret;
}
}
if (wlan_is_chan_passive(pmpriv,
radio_type_to_band(radio_type),
channel)) {
/* do not send probe requests on this channel */
scan_type = MLAN_SCAN_TYPE_PASSIVE;
if (!puser_scan_in->scan_cfg_only) {
if (wlan_is_chan_passive(
pmpriv,
radio_type_to_band(radio_type),
channel)) {
/* do not send probe requests on this
* channel */
scan_type = MLAN_SCAN_TYPE_PASSIVE;
}
}
/* Prevent active scanning on a radar controlled channel
*/
if (radio_type == BAND_5GHZ &&
scan_type != MLAN_SCAN_TYPE_PASSIVE) {
scan_type == MLAN_SCAN_TYPE_PASSIVE) {
if (pmadapter->active_scan_triggered == MFALSE)
if (wlan_11h_radar_detect_required(
pmpriv, channel)) {
@ -1517,6 +1521,7 @@ static mlan_status wlan_scan_setup_scan_config(
}
}
if (radio_type == BAND_2GHZ &&
!puser_scan_in->scan_cfg_only &&
scan_type != MLAN_SCAN_TYPE_PASSIVE) {
if (pmadapter->active_scan_triggered == MFALSE)
if (wlan_bg_scan_type_is_passive(
@ -4142,7 +4147,8 @@ mlan_status wlan_scan_networks(mlan_private *pmpriv, t_void *pioctl_buf,
ENTER();
ret = pcb->moal_malloc(pmadapter->pmoal_handle,
sizeof(wlan_scan_cmd_config_tlv), MLAN_MEM_DEF,
sizeof(wlan_scan_cmd_config_tlv),
MLAN_MEM_DEF | MLAN_MEM_FLAG_ATOMIC,
(t_u8 **)&pscan_cfg_out);
if (ret != MLAN_STATUS_SUCCESS || !pscan_cfg_out) {
PRINTM(MERROR, "Memory allocation for pscan_cfg_out failed!\n");
@ -4153,7 +4159,8 @@ mlan_status wlan_scan_networks(mlan_private *pmpriv, t_void *pioctl_buf,
}
buf_size = sizeof(ChanScanParamSet_t) * WLAN_USER_SCAN_CHAN_MAX;
ret = pcb->moal_malloc(pmadapter->pmoal_handle, buf_size, MLAN_MEM_DEF,
ret = pcb->moal_malloc(pmadapter->pmoal_handle, buf_size,
MLAN_MEM_DEF | MLAN_MEM_FLAG_ATOMIC,
(t_u8 **)&pscan_chan_list);
if (ret != MLAN_STATUS_SUCCESS || !pscan_chan_list) {
PRINTM(MERROR, "Failed to allocate scan_chan_list\n");
@ -6984,7 +6991,8 @@ mlan_status wlan_scan_specific_ssid(mlan_private *pmpriv, t_void *pioctl_buf,
wlan_scan_delete_ssid_table_entry(pmpriv, preq_ssid);
ret = pcb->moal_malloc(pmpriv->adapter->pmoal_handle,
sizeof(wlan_user_scan_cfg), MLAN_MEM_DEF,
sizeof(wlan_user_scan_cfg),
MLAN_MEM_DEF | MLAN_MEM_FLAG_ATOMIC,
(t_u8 **)&pscan_cfg);
if (ret != MLAN_STATUS_SUCCESS || !pscan_cfg) {
@ -7047,7 +7055,8 @@ t_void wlan_save_curr_bcn(mlan_private *pmpriv)
if (pmpriv->curr_bcn_size) {
ret = pcb->moal_malloc(pmadapter->pmoal_handle,
pcurr_bss->beacon_buf_size,
MLAN_MEM_DEF,
MLAN_MEM_DEF |
MLAN_MEM_FLAG_ATOMIC,
&pmpriv->pcurr_bcn_buf);
if ((ret == MLAN_STATUS_SUCCESS) &&

View file

@ -1334,6 +1334,8 @@ static mlan_status wlan_decode_rx_packet(mlan_adapter *pmadapter,
case MLAN_TYPE_CMD:
PRINTM(MINFO, "--- Rx: Cmd Response ---\n");
if (pmadapter->cmd_sent)
pmadapter->cmd_sent = MFALSE;
/* take care of curr_cmd = NULL case */
if (!pmadapter->curr_cmd) {
cmd_buf = pmadapter->upld_buf;

View file

@ -1262,8 +1262,11 @@ process_start:
}
/* Check for Cmd Resp */
wlan_request_cmd_lock(pmadapter);
if (pmadapter->cmd_resp_received) {
pmadapter->cmd_resp_received = MFALSE;
wlan_release_cmd_lock(pmadapter);
wlan_process_cmdresp(pmadapter);
/* call moal back when init_fw is done */
@ -1277,6 +1280,8 @@ process_start:
WlanHardwareStatusInitializing;
wlan_get_hw_spec_complete(pmadapter);
}
} else {
wlan_release_cmd_lock(pmadapter);
}
/* Check for event */
@ -1594,11 +1599,13 @@ mlan_status mlan_recv(t_void *padapter, pmlan_buffer pmbuf, t_u32 port)
}
PRINTM(MINFO, "mlan_recv: no curr_cmd\n");
} else {
wlan_request_cmd_lock(pmadapter);
pmadapter->upld_len = len;
pmbuf->data_offset += MLAN_TYPE_LEN;
pmbuf->data_len -= MLAN_TYPE_LEN;
pmadapter->curr_cmd->respbuf = pmbuf;
pmadapter->cmd_resp_received = MTRUE;
wlan_release_cmd_lock(pmadapter);
}
break;
case MLAN_USB_TYPE_EVENT:
@ -1744,8 +1751,12 @@ void mlan_process_deaggr_pkt(t_void *padapter, pmlan_buffer pmbuf, t_u8 *drop)
PRINTM(MEVENT, "Recevie AMSDU EAPOL frame\n");
if (pmpriv->sec_info.ewpa_enabled) {
*drop = MTRUE;
wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11_EAPOL_PKT,
0, 0, MNULL, pmbuf);
if (MLAN_STATUS_FAILURE ==
wlan_prepare_cmd(pmpriv,
HostCmd_CMD_802_11_EAPOL_PKT, 0, 0,
MNULL, pmbuf)) {
PRINTM(MERROR, "Preparing the CMD failed\n");
}
wlan_recv_event(pmpriv,
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);

View file

@ -2489,6 +2489,46 @@ static mlan_status wlan_cmd_otp_user_data(pmlan_private pmpriv,
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function prepares command of fw auto re-connect.
*
* @param pmpriv A pointer to mlan_private structure
* @param cmd A pointer to HostCmd_DS_COMMAND structure
* @param cmd_action the action: GET or SET
* @param pdata_buf A pointer to data buffer
* @return MLAN_STATUS_SUCCESS
*/
static mlan_status wlan_cmd_fw_auto_reconnect(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action,
t_void *pdata_buf)
{
HostCmd_DS_FW_AUTO_RECONNECT *fw_auto_reconnect =
&cmd->params.fw_auto_reconnect_cmd;
mlan_ds_fw_reconnect *fw_auto_reconn =
(mlan_ds_fw_reconnect *)pdata_buf;
ENTER();
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_FW_AUTO_RECONNECT);
cmd->size = wlan_cpu_to_le16((sizeof(HostCmd_DS_FW_AUTO_RECONNECT)) +
S_DS_GEN);
fw_auto_reconnect->action = wlan_cpu_to_le16(cmd_action);
if (cmd_action == HostCmd_ACT_GEN_SET) {
fw_auto_reconnect->reconnect_counter =
fw_auto_reconn->fw_reconn_counter;
fw_auto_reconnect->reconnect_interval =
fw_auto_reconn->fw_reconn_interval;
fw_auto_reconnect->flags =
wlan_cpu_to_le16(fw_auto_reconn->fw_reconn_flags);
}
LEAVE();
return MLAN_STATUS_SUCCESS;
}
#ifdef USB
/**
* @brief This function prepares command of packet aggragation
@ -3950,6 +3990,10 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_otp_user_data(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_FW_AUTO_RECONNECT:
ret = wlan_cmd_fw_auto_reconnect(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_HS_WAKEUP_REASON:
ret = wlan_cmd_hs_wakeup_reason(pmpriv, cmd_ptr, pdata_buf);
break;

View file

@ -322,7 +322,8 @@ static mlan_status wlan_process_cmdresp_error(mlan_private *pmpriv,
}
} break;
case HostCmd_CMD_ROAM_OFFLOAD:
wlan_clear_fw_roaming_pmk(pmpriv);
if (MLAN_STATUS_SUCCESS != wlan_clear_fw_roaming_pmk(pmpriv))
PRINTM(MERROR, "wlan_clear_fw_roaming_pmk fail\n");
pmpriv->adapter->fw_roaming = MFALSE;
PRINTM(MERROR, "FW do not support roaming!\n");
break;
@ -628,6 +629,7 @@ static mlan_status wlan_ret_802_11_snmp_mib(pmlan_private pmpriv,
/* Update state for 11h */
if (oid == Dot11H_i) {
ul_temp = wlan_le16_to_cpu(*((t_u16 *)(psmib->value)));
PRINTM(MCMND, "wlan: Dot11H_i=%d\n", ul_temp);
/* Set 11h state to priv */
pmpriv->intf_state_11h.is_11h_active =
(ul_temp & ENABLE_11H_MASK);
@ -2239,6 +2241,42 @@ static mlan_status wlan_ret_otp_user_data(pmlan_private pmpriv,
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function handles the command response of
* fw auto re-connect
*
* @param pmpriv A pointer to mlan_private structure
* @param resp A pointer to HostCmd_DS_COMMAND
* @param pioctl_buf A pointer to command buffer
*
* @return MLAN_STATUS_SUCCESS
*/
static mlan_status wlan_ret_fw_auto_reconnect(pmlan_private pmpriv,
HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf)
{
HostCmd_DS_FW_AUTO_RECONNECT *fw_auto_reconnect =
(HostCmd_DS_FW_AUTO_RECONNECT *)&resp->params
.fw_auto_reconnect_cmd;
mlan_ds_misc_cfg *misc = MNULL;
ENTER();
if (pioctl_buf && (pioctl_buf->action == MLAN_ACT_GET)) {
misc = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
misc->param.fw_auto_reconnect.fw_reconn_counter =
fw_auto_reconnect->reconnect_counter;
misc->param.fw_auto_reconnect.fw_reconn_interval =
fw_auto_reconnect->reconnect_interval;
misc->param.fw_auto_reconnect.fw_reconn_flags =
wlan_le16_to_cpu(fw_auto_reconnect->flags);
pioctl_buf->data_read_written = sizeof(mlan_ds_misc_cfg);
}
LEAVE();
return MLAN_STATUS_SUCCESS;
}
#ifdef USB
/**
* @brief This function handles the command response of
@ -2629,10 +2667,6 @@ mlan_status wlan_clear_fw_roaming_pmk(pmlan_private pmpriv)
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_SUPPLICANT_PMK,
HostCmd_ACT_GEN_REMOVE, 0, MNULL, MNULL);
if (ret == MLAN_STATUS_SUCCESS) {
ret = MLAN_STATUS_FAILURE;
}
LEAVE();
return ret;
}
@ -2669,7 +2703,10 @@ static mlan_status wlan_ret_roam_offload(pmlan_private pmpriv,
pmpriv->adapter->fw_roaming = MTRUE;
else {
pmpriv->adapter->fw_roaming = MFALSE;
wlan_clear_fw_roaming_pmk(pmpriv);
if (MLAN_STATUS_SUCCESS !=
wlan_clear_fw_roaming_pmk(pmpriv))
PRINTM(MERROR,
"wlan_clear_fw_roaming_pmk failed\n");
}
}
}
@ -3323,6 +3360,9 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
case HostCmd_CMD_OTP_READ_USER_DATA:
ret = wlan_ret_otp_user_data(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_FW_AUTO_RECONNECT:
ret = wlan_ret_fw_auto_reconnect(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_HS_WAKEUP_REASON:
ret = wlan_ret_hs_wakeup_reason(pmpriv, resp, pioctl_buf);
break;

View file

@ -370,7 +370,12 @@ t_void wlan_reset_connect_state(pmlan_private priv, t_u8 drv_disconnect)
if (drv_disconnect) {
priv->media_connected = MFALSE;
pmadapter->state_rdh.tx_block = MFALSE;
wlan_11h_check_update_radar_det_state(priv);
#ifdef UAP_SUPPORT
if (pmadapter->dfs_mode)
wlan_11h_update_dfs_master_state_on_disconect(priv);
else
#endif
wlan_11h_check_update_radar_det_state(priv);
}
if (priv->port_ctrl_mode == MTRUE) {
@ -919,6 +924,10 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
cfp->freq;
else
pmpriv->curr_bss_params.bss_descriptor.freq = 0;
#ifdef UAP_SUPPORT
if (pmpriv->adapter->dfs_mode)
wlan_11h_update_dfs_master_state_by_sta(pmpriv);
#endif
if (pmpriv->adapter->state_rdh.stage ==
RDH_SET_CUSTOM_IE) {
pmadapter->state_rdh.stage =
@ -994,7 +1003,7 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
pevent->event_len, pevent->event_len);
/* Handle / pass event data */
ret = wlan_11h_handle_event_chanrpt_ready(pmpriv, pevent,
&radar_chan);
&radar_chan, 0);
/* Also send this event as passthru */
pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU;
pevent->event_len = pmbuf->data_len;
@ -1373,6 +1382,17 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
pmadapter->fw_hang_report = MTRUE;
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL);
break;
case CHAN_LOAD_EVENT: {
t_u8 *ptr = MNULL;
HostCmd_DS_GET_CH_LOAD *cfg_cmd = MNULL;
ptr = (t_u8 *)(pmbuf->pbuf + pmbuf->data_offset);
ptr += 4; /* data start */
cfg_cmd = (HostCmd_DS_GET_CH_LOAD *)ptr;
pmpriv->ch_load_param = wlan_le16_to_cpu(cfg_cmd->ch_load);
pmpriv->noise = wlan_le16_to_cpu(cfg_cmd->noise);
pmpriv->rx_quality = wlan_le16_to_cpu(cfg_cmd->rx_quality);
break;
}
default:
PRINTM(MEVENT, "EVENT: unknown event id: %#x\n", eventcause);
wlan_recv_event(pmpriv, MLAN_EVENT_ID_FW_UNKNOWN, MNULL);

View file

@ -3372,8 +3372,8 @@ static mlan_status wlan_sec_cfg_ioctl(pmlan_adapter pmadapter,
*
* @return MLAN_STATUS_SUCCESS --success, otherwise fail
*/
static int wlan_set_gen_ie_helper(mlan_private *priv, t_u8 *ie_data_ptr,
t_u16 ie_len)
static mlan_status wlan_set_gen_ie_helper(mlan_private *priv, t_u8 *ie_data_ptr,
t_u16 ie_len)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
IEEEtypes_VendorHeader_t *pvendor_ie;
@ -3956,9 +3956,9 @@ static mlan_status wlan_misc_ioctl_gen_ie(pmlan_adapter pmadapter,
pmpriv->wpa_ie, misc->param.gen_ie.len,
MAX_IE_SIZE);
} else {
wlan_set_gen_ie_helper(pmpriv,
misc->param.gen_ie.ie_data,
(t_u16)misc->param.gen_ie.len);
ret = wlan_set_gen_ie_helper(
pmpriv, misc->param.gen_ie.ie_data,
(t_u16)misc->param.gen_ie.len);
}
break;
case MLAN_IE_TYPE_ARP_FILTER:
@ -4390,6 +4390,42 @@ static mlan_status wlan_misc_ioctl_subscribe_evt(pmlan_adapter pmadapter,
return ret;
}
/**
* @brief Get/Set fw auto reconnect
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pioctl_req A pointer to ioctl request buffer
*
* @return MLAN_STATUS_PENDING -- success, otherwise fail
*/
static mlan_status wlan_misc_ioctl_fw_auto_reconnect(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_ds_misc_cfg *misc = MNULL;
t_u16 cmd_action = 0;
ENTER();
misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
if (pioctl_req->action == MLAN_ACT_SET)
cmd_action = HostCmd_ACT_GEN_SET;
else
cmd_action = HostCmd_ACT_GEN_GET;
/* Send command to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_FW_AUTO_RECONNECT,
cmd_action, 0, (t_void *)pioctl_req,
&misc->param.fw_auto_reconnect);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
LEAVE();
return ret;
}
/**
* @brief Set ARP filter based on IP address
*
@ -5259,6 +5295,10 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
case MLAN_OID_MISC_OTP_USER_DATA:
status = wlan_misc_otp_user_data(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_AUTO_ASSOC:
status = wlan_misc_ioctl_fw_auto_reconnect(pmadapter,
pioctl_req);
break;
#ifdef USB
case MLAN_OID_MISC_USB_AGGR_CTRL:
status = wlan_misc_ioctl_usb_aggr_ctrl(pmadapter, pioctl_req);

View file

@ -2233,6 +2233,8 @@ static mlan_status wlan_uap_ret_cmd_ap_config(pmlan_private pmpriv,
bss->param.bss_config.bandcfg = tlv_chan_band->bandcfg;
bss->param.bss_config.channel = tlv_chan_band->channel;
pmpriv->uap_channel = tlv_chan_band->channel;
pmpriv->uap_bandwidth =
tlv_chan_band->bandcfg.chanWidth;
pmpriv->uap_state_chan_cb.bandcfg =
tlv_chan_band->bandcfg;
pmpriv->uap_state_chan_cb.channel =
@ -2672,6 +2674,8 @@ static mlan_status wlan_uap_ret_sys_config(pmlan_private pmpriv,
pmpriv->is_11n_enabled;
pmpriv->uap_channel =
chan_band_tlv->channel;
pmpriv->uap_bandwidth =
chan_band_tlv->bandcfg.chanWidth;
pmpriv->uap_state_chan_cb.bandcfg =
chan_band_tlv->bandcfg;
pmpriv->uap_state_chan_cb.channel =
@ -3166,6 +3170,7 @@ static mlan_status wlan_uap_ret_snmp_mib(pmlan_private pmpriv,
break;
case Dot11H_i:
data = wlan_le16_to_cpu(*((t_u16 *)(psnmp_mib->value)));
PRINTM(MCMND, "wlan: uap Dot11H_i=%d\n", data);
/* Set 11h state to priv */
pmpriv->intf_state_11h.is_11h_active =
(data & ENABLE_11H_MASK);
@ -3878,10 +3883,11 @@ static void wlan_check_uap_capability(pmlan_private priv, pmlan_buffer pevent)
tlv_len + sizeof(MrvlIEtypesHeader_t));
pchan_info = (MrvlIEtypes_channel_band_t *)tlv;
priv->uap_channel = pchan_info->channel;
priv->uap_bandwidth = pchan_info->bandcfg.chanWidth;
priv->uap_state_chan_cb.channel = pchan_info->channel;
priv->uap_state_chan_cb.bandcfg = pchan_info->bandcfg;
PRINTM(MCMND, "uap_channel FW: 0x%x\n",
priv->uap_channel);
PRINTM(MCMND, "uap_channel FW: 0x%x bw=%d\n",
priv->uap_channel, priv->uap_bandwidth);
event->bss_index = priv->bss_index;
event->event_id = MLAN_EVENT_ID_DRV_UAP_CHAN_INFO;
event->event_len = sizeof(chan_band_info);
@ -4980,6 +4986,7 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
pmpriv->adapter->pmoal_handle, &sec, &usec);
pstate_dfs->dfs_report_time_sec = sec;
}
wlan_reset_all_chan_dfs_state(priv, BAND_A, DFS_USABLE);
if (pmpriv->intf_state_11h.is_11h_host)
pmpriv->intf_state_11h.tx_disabled = MFALSE;
else {
@ -5349,6 +5356,7 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
sta_node *sta_ptr = MNULL;
t_u8 i = 0;
t_u8 channel = 0;
t_u8 bandwidth = 0;
MrvlIEtypes_channel_band_t *pchan_info = MNULL;
chan_band_info *pchan_band_info = MNULL;
event_exceed_max_p2p_conn *event_excd_p2p = MNULL;
@ -5403,22 +5411,8 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
MNULL);
}
#endif
if (wlan_11h_radar_detect_required(pmpriv,
pmpriv->uap_channel)) {
if (!wlan_11h_is_active(pmpriv)) {
/* active 11h extention in Fw */
ret = wlan_11h_activate(pmpriv, MNULL, MTRUE);
ret = wlan_11h_config_master_radar_det(pmpriv,
MTRUE);
ret = wlan_11h_check_update_radar_det_state(
pmpriv);
}
if (pmpriv->uap_host_based &&
!pmpriv->adapter->init_para.dfs_offload)
pmpriv->intf_state_11h.is_11h_host = MTRUE;
wlan_11h_set_dfs_check_chan(pmpriv,
pmpriv->uap_channel);
}
if (wlan_11h_radar_detect_required(pmpriv, pmpriv->uap_channel))
wlan_11h_update_dfs_master_state_by_uap(pmpriv);
break;
case EVENT_MICRO_AP_BSS_ACTIVE:
PRINTM(MEVENT, "EVENT: MICRO_AP_BSS_ACTIVE\n");
@ -5473,12 +5467,12 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
MAC2STR(sta_addr));
if (!sta_ptr)
break;
wlan_check_sta_capability(pmpriv, pmbuf, sta_ptr);
if (pmpriv->is_11n_enabled || pmpriv->is_11ax_enabled
#ifdef DRV_EMBEDDED_AUTHENTICATOR
|| IsAuthenticatorEnabled(pmpriv->psapriv)
#endif
) {
wlan_check_sta_capability(pmpriv, pmbuf, sta_ptr);
for (i = 0; i < MAX_NUM_TID; i++) {
if (sta_ptr->is_11n_enabled ||
sta_ptr->is_11ax_enabled)
@ -5619,8 +5613,10 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
pmbuf->pbuf + pmbuf->data_offset +
sizeof(eventcause),
pevent->event_len, pevent->event_len);
wlan_11h_print_event_radar_detected(pmpriv, pevent, &channel);
wlan_11h_print_event_radar_detected(pmpriv, pevent, &channel,
&bandwidth);
*((t_u8 *)pevent->event_buf) = channel;
*((t_u8 *)pevent->event_buf + 1) = bandwidth;
if (pmpriv->bss_type == MLAN_BSS_TYPE_DFS) {
wlan_recv_event(priv, MLAN_EVENT_ID_FW_RADAR_DETECTED,
pevent);
@ -5682,11 +5678,12 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
pevent->event_len, pevent->event_len);
/* Handle / pass event data, and free buffer */
ret = wlan_11h_handle_event_chanrpt_ready(pmpriv, pevent,
&channel);
&channel, &bandwidth);
if (pmpriv->bss_type == MLAN_BSS_TYPE_DFS) {
*((t_u8 *)pevent->event_buf) =
pmpriv->adapter->state_dfs.dfs_radar_found;
*((t_u8 *)pevent->event_buf + 1) = channel;
*((t_u8 *)pevent->event_buf + 2) = bandwidth;
wlan_recv_event(pmpriv,
MLAN_EVENT_ID_FW_CHANNEL_REPORT_RDY,
pevent);
@ -5698,6 +5695,8 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
*((t_u8 *)pevent->event_buf) =
pmpriv->adapter->state_dfs.dfs_radar_found;
*((t_u8 *)pevent->event_buf + 1) = channel;
*((t_u8 *)pevent->event_buf + 2) = bandwidth;
wlan_recv_event(pmpriv,
MLAN_EVENT_ID_FW_CHANNEL_REPORT_RDY,
pevent);
@ -5716,24 +5715,11 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
PRINTM(MEVENT, "EVENT: CHANNEL_SWITCH new channel %d\n",
channel);
pmpriv->uap_channel = channel;
pmpriv->uap_bandwidth = pchan_info->bandcfg.chanWidth;
pmpriv->uap_state_chan_cb.channel = pchan_info->channel;
pmpriv->uap_state_chan_cb.bandcfg = pchan_info->bandcfg;
if (wlan_11h_radar_detect_required(pmpriv,
pchan_info->channel)) {
if (!wlan_11h_is_active(pmpriv)) {
/* active 11h extention in Fw */
ret = wlan_11h_activate(pmpriv, MNULL, MTRUE);
ret = wlan_11h_config_master_radar_det(pmpriv,
MTRUE);
ret = wlan_11h_check_update_radar_det_state(
pmpriv);
}
if (pmpriv->uap_host_based &&
!pmpriv->adapter->init_para.dfs_offload)
pmpriv->intf_state_11h.is_11h_host = MTRUE;
wlan_11h_set_dfs_check_chan(pmpriv,
pchan_info->channel);
}
if (wlan_11h_radar_detect_required(pmpriv, pchan_info->channel))
wlan_11h_update_dfs_master_state_by_uap(pmpriv);
if ((pmpriv->adapter->state_rdh.stage != RDH_OFF &&
!pmpriv->intf_state_11h.is_11h_host) ||
pmpriv->adapter->dfs_test_params.no_channel_change_on_radar ||
@ -5853,6 +5839,21 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
sizeof(eventcause),
sizeof(t_u16), sizeof(t_u16));
break;
case CHAN_LOAD_EVENT: {
t_u8 *ptr = MNULL;
HostCmd_DS_GET_CH_LOAD *cfg_cmd = MNULL;
ptr = (t_u8 *)(pmbuf->pbuf + pmbuf->data_offset);
ptr += 4; /* actual data buffer start */
cfg_cmd = (HostCmd_DS_GET_CH_LOAD *)ptr;
pmpriv->ch_load_param = wlan_le16_to_cpu(cfg_cmd->ch_load);
pmpriv->noise = wlan_le16_to_cpu(cfg_cmd->noise);
pmpriv->rx_quality = wlan_le16_to_cpu(cfg_cmd->rx_quality);
break;
}
case EVENT_FW_DUMP_INFO:
PRINTM(MINFO, "EVENT: Dump FW info\n");
pevent->event_id = MLAN_EVENT_ID_FW_DUMP_INFO;
break;
default:
pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU;
break;

View file

@ -124,10 +124,6 @@ static mlan_status wlan_uap_callback_bss_ioctl_start(t_void *priv)
!wlan_can_radar_det_skip(pmpriv) &&
wlan_11h_radar_detect_required(pmpriv,
puap_state_chan_cb->channel)) {
dfs_state = wlan_get_chan_dfs_state(
pmpriv, BAND_A, puap_state_chan_cb->channel);
if (dfs_state == DFS_AVAILABLE)
goto prep_bss_start;
/* If DFS repeater mode is on then before starting the uAP
* make sure that mlan0 is connected to some external AP
* for DFS channel operations.
@ -154,7 +150,10 @@ static mlan_status wlan_uap_callback_bss_ioctl_start(t_void *priv)
goto prep_bss_start;
}
}
dfs_state = wlan_get_chan_dfs_state(
pmpriv, BAND_A, puap_state_chan_cb->channel);
if (dfs_state == DFS_AVAILABLE)
goto prep_bss_start;
/* first check if channel is under NOP */
if (wlan_11h_is_channel_under_nop(
pmpriv->adapter, puap_state_chan_cb->channel)) {
@ -1451,8 +1450,9 @@ static mlan_status wlan_uap_callback_11h_channel_check_req(t_void *priv)
dfs_state = wlan_get_chan_dfs_state(
pmpriv, BAND_A, puap_state_chan_cb->channel);
if (dfs_state == DFS_AVAILABLE) {
wlan_11h_set_dfs_check_chan(
pmpriv, puap_state_chan_cb->channel);
wlan_11h_set_dfs_check_chan(pmpriv,
puap_state_chan_cb->channel,
pband_cfg->chanWidth);
PRINTM(MCMND, "DFS: Channel %d is Avaliable\n",
puap_state_chan_cb->channel);
pcb->moal_ioctl_complete(pmpriv->adapter->pmoal_handle,
@ -1538,6 +1538,28 @@ static mlan_status wlan_uap_11h_channel_check_req(pmlan_adapter pmadapter,
pmpriv->adapter->dfs_test_params
.user_cac_period_msec;
}
if (pmpriv->adapter->dfs_test_params.cac_restart &&
p11h_cfg->param.chan_rpt_req.millisec_dwell_time) {
pmpriv->adapter->dfs_test_params.chan =
p11h_cfg->param.chan_rpt_req.chanNum;
pmpriv->adapter->dfs_test_params
.millisec_dwell_time =
p11h_cfg->param.chan_rpt_req
.millisec_dwell_time;
memcpy_ext(
pmpriv->adapter,
&pmpriv->adapter->dfs_test_params
.bandcfg,
&p11h_cfg->param.chan_rpt_req.bandcfg,
sizeof(Band_Config_t),
sizeof(Band_Config_t));
}
if (p11h_cfg->param.chan_rpt_req.millisec_dwell_time)
PRINTM(MMSG,
"11h: issuing DFS Radar check for channel=%d."
" Please wait for response...\n",
p11h_cfg->param.chan_rpt_req.chanNum);
ret = wlan_prepare_cmd(
pmpriv, HostCmd_CMD_CHAN_REPORT_REQUEST,
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
@ -2355,6 +2377,9 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
if (cfg11h->sub_command == MLAN_OID_11H_CHAN_NOP_INFO)
status = wlan_11h_ioctl_channel_nop_info(pmadapter,
pioctl_req);
if (cfg11h->sub_command == MLAN_OID_11H_NOP_CHAN_LIST)
status = wlan_11h_ioctl_nop_channel_list(pmadapter,
pioctl_req);
if (cfg11h->sub_command == MLAN_OID_11H_CHAN_REPORT_REQUEST)
status = wlan_11h_ioctl_dfs_chan_report(pmpriv,
pioctl_req);
@ -2367,6 +2392,8 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
if (cfg11h->sub_command == MLAN_OID_11H_DFS_W53_CFG)
status = wlan_11h_ioctl_dfs_w53_cfg(pmadapter,
pioctl_req);
if (cfg11h->sub_command == MLAN_OID_11H_DFS_MODE)
status = wlan_11h_ioctl_dfs_mode(pmadapter, pioctl_req);
break;
case MLAN_IOCTL_RADIO_CFG:
radiocfg = (mlan_ds_radio_cfg *)pioctl_req->pbuf;

View file

@ -443,6 +443,10 @@ mlan_status wlan_ops_uap_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
pmadapter->pmoal_handle, &last_rx_sec, &last_rx_usec);
sta_ptr->stats.last_rx_in_msec =
(t_u64)last_rx_sec * 1000 + (t_u64)last_rx_usec / 1000;
if (rx_pkt_type != PKT_TYPE_BAR) {
sta_ptr->stats.rx_packets++;
sta_ptr->stats.rx_bytes += prx_pd->rx_pkt_length;
}
}
#ifdef DRV_EMBEDDED_AUTHENTICATOR

View file

@ -366,6 +366,16 @@ static mlan_status wlan_usb_prog_fw_w_helper(pmlan_adapter pmadapter,
break;
}
if (check_fw_status &&
(SyncFWHeader.status & MBIT(9))) {
PRINTM(MERROR,
"FW received Blk with SE_BOOT error 0x%x\n",
SyncFWHeader.status);
retries = 0;
ret = MLAN_STATUS_FAILURE;
break;
}
/* Check the firmware block response for CRC errors */
if (SyncFWHeader.cmd) {
/* Check firmware block response for CRC and MIC

View file

@ -2149,6 +2149,8 @@ t_void wlan_wmm_add_buf_txqueue(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
else if (priv->bss_type == MLAN_BSS_TYPE_UAP) {
sta_ptr = wlan_get_station_entry(priv, ra);
if (sta_ptr) {
sta_ptr->stats.tx_bytes += pmbuf->data_len;
sta_ptr->stats.tx_packets++;
if (!sta_ptr->is_wmm_enabled &&
!priv->is_11ac_enabled) {
tid_down = wlan_wmm_downgrade_tid(priv,
@ -2272,6 +2274,11 @@ mlan_status wlan_ret_wmm_get_status(pmlan_private priv, t_u8 *ptlv,
ptlv_wmm_q_status->flow_required,
ptlv_wmm_q_status->disabled);
/* Pick the minimum among these to avoid array out of
* bounds */
ptlv_wmm_q_status->queue_index = MIN(
ptlv_wmm_q_status->queue_index, MAX_AC_QUEUES);
pac_status =
&priv->wmm.ac_status[ptlv_wmm_q_status
->queue_index];

View file

@ -24,7 +24,7 @@
#define _MLAN_DECL_H_
/** MLAN release version */
#define MLAN_RELEASE_VERSION "344.p3"
#define MLAN_RELEASE_VERSION "362"
/** Re-define generic data types for MLAN/MOAL */
/** Signed char (1-byte) */
@ -129,13 +129,8 @@ typedef t_s32 t_sval;
/** Return aligned offset */
#define OFFSET_ALIGN_ADDR(p, a) (t_u32)(ALIGN_ADDR(p, a) - (t_ptr)p)
#if defined(WIFI_DIRECT_SUPPORT)
/** Maximum BSS numbers */
#define MLAN_MAX_BSS_NUM (16)
#else
/** Maximum BSS numbers */
#define MLAN_MAX_BSS_NUM (2)
#endif
/** NET IP alignment */
#define MLAN_NET_IP_ALIGN 2
@ -634,6 +629,8 @@ typedef enum {
/** Memory allocation type: DMA */
#define MLAN_MEM_DMA MBIT(0)
/** Memory allocation flag: ATOMIC */
#define MLAN_MEM_FLAG_ATOMIC MBIT(1)
/** Default memory allocation flag */
#define MLAN_MEM_DEF 0
@ -960,6 +957,14 @@ typedef enum _dfs_w53_cfg_t {
DFS_W53_OLD = 2
} dfs_w53_cfg_t;
typedef enum _dfs_moe_t {
/** driver default DFS behavior */
DFS_MODE_DEFAULT = 0,
/* disable DFS master when uap and station operate in same DFS channel
*/
DFS_MODE_ENH = 1,
} dfs_mode_t;
/** Band_Config_t */
typedef MLAN_PACK_START struct _Band_Config_t {
/** Band Info - (00)=2.4GHz, (01)=5GHz */
@ -2005,7 +2010,16 @@ typedef struct {
/** station stats */
typedef struct _sta_stats {
/** last_rx_in_msec */
t_u64 last_rx_in_msec;
/** rx_packets */
t_u32 rx_packets;
/** tx packets */
t_u32 tx_packets;
/** rx bytes */
t_u32 rx_bytes;
/** tx bytes */
t_u32 tx_bytes;
} sta_stats;
#ifdef PRAGMA_PACK

View file

@ -1637,6 +1637,8 @@ typedef MLAN_PACK_START struct {
t_u8 bssid_num;
/** BSSID filter list used in the to limit the scan results */
mlan_802_11_mac_addr bssid_list[MAX_BSSID_FILTER_LIST];
/** use scan setting from scan_cfg only */
t_u8 scan_cfg_only;
} MLAN_PACK_END wlan_user_scan_cfg;
/** Default scan interval in millisecond*/

View file

@ -236,6 +236,8 @@ enum _mlan_ioctl_req_id {
MLAN_OID_11H_CHAN_NOP_INFO = 0x00110006,
MLAN_OID_11H_CHAN_DFS_STATE = 0x00110007,
MLAN_OID_11H_DFS_W53_CFG = 0x00110008,
MLAN_OID_11H_DFS_MODE = 0x00110009,
MLAN_OID_11H_NOP_CHAN_LIST = 0x0011000A,
/* 802.11n Configuration Group RANDYTODO for value assign */
MLAN_IOCTL_11AC_CFG = 0x00120000,
@ -280,6 +282,7 @@ enum _mlan_ioctl_req_id {
#endif
MLAN_OID_MISC_HOTSPOT_CFG = 0x0020001C,
MLAN_OID_MISC_OTP_USER_DATA = 0x0020001D,
MLAN_OID_MISC_AUTO_ASSOC = 0x0020001E,
#ifdef USB
MLAN_OID_MISC_USB_AGGR_CTRL = 0x0020001F,
#endif
@ -403,6 +406,14 @@ enum _mlan_pass_to_act_scan {
MLAN_PASS_TO_ACT_SCAN_DIS
};
/** Enumeration for passive to active scan */
enum _mlan_ext_scan {
MLAN_EXTENDED_SCAN_UNCHANGED = 0,
MLAN_LEGACY_SCAN,
MLAN_EXT_SCAN,
MLAN_EXT_SCAN_ENH
};
/** Max number of supported rates */
#define MLAN_SUPPORTED_RATES 32
@ -4188,12 +4199,23 @@ typedef struct _mlan_ds_11h_chan_nop_info {
t_u8 curr_chan;
/** channel_width */
t_u8 chan_width;
/** check new channel flag */
t_u8 check_new_chan;
/** flag for chan under nop */
t_bool chan_under_nop;
/** chan_ban_info for new channel */
chan_band_info new_chan;
} mlan_ds_11h_chan_nop_info, *pmlan_ds_11h_chan_nop_info;
/** Type definition of mlan_ds_11h_nop_chan_list for MLAN_OID_11H_NOP_CHAN_LIST
*/
typedef struct _mlan_ds_11h_nop_chan_list {
/** number of nop channel */
t_u8 num_chan;
/** chan list array */
t_u8 chan_list[20];
} mlan_ds_11h_nop_chan_list, *pmlan_ds_11h_nop_chan_list;
typedef struct _mlan_ds_11h_chan_rep_req {
t_u16 startFreq;
Band_Config_t bandcfg;
@ -4229,6 +4251,8 @@ typedef struct _mlan_ds_11h_cfg {
mlan_ds_11h_dfs_testing dfs_testing;
/** channel NOP information for MLAN_OID_11H_CHAN_NOP_INFO */
mlan_ds_11h_chan_nop_info ch_nop_info;
/** NOP channel list for MLAN_OID_11H_NOP_CHAN_LIST */
mlan_ds_11h_nop_chan_list nop_chan_list;
/** channel report req for MLAN_OID_11H_CHAN_REPORT_REQUEST */
mlan_ds_11h_chan_rep_req chan_rpt_req;
/** channel switch count for MLAN_OID_11H_CHAN_SWITCH_COUNT*/
@ -4236,6 +4260,8 @@ typedef struct _mlan_ds_11h_cfg {
/** channel dfs state for MLAN_OID_11H_CHAN_DFS_STATE */
mlan_ds_11h_chan_dfs_state ch_dfs_state;
mlan_ds_11h_dfs_w53_cfg dfs_w53_cfg;
/** dfs_mode for MLAN_OID_11H_DFS_MODE */
t_u8 dfs_mode;
} param;
} mlan_ds_11h_cfg, *pmlan_ds_11h_cfg;
@ -4644,6 +4670,16 @@ typedef struct _mlan_ds_misc_otp_user_data {
t_u8 user_data[MAX_OTP_USER_DATA_LEN];
} mlan_ds_misc_otp_user_data;
/** Type definition of mlan_ds_fw_reconnect for MLAN_OID_MISC_AUTO_ASSOC */
typedef struct _mlan_ds_fw_reconnect {
/* fw auto re-connect counter */
t_u8 fw_reconn_counter;
/* fw auto re-connect interval */
t_u8 fw_reconn_interval;
/* fw auto re-connect flags */
t_u16 fw_reconn_flags;
} mlan_ds_fw_reconnect;
typedef struct _aggr_ctrl_cfg {
/** Enable */
t_u16 enable;
@ -5524,6 +5560,7 @@ typedef struct _mlan_ds_ch_load {
t_u8 action;
t_u16 ch_load_param;
t_s16 noise;
t_u16 rx_quality;
t_u16 duration;
} mlan_ds_ch_load;
@ -5598,6 +5635,8 @@ typedef struct _mlan_ds_misc_cfg {
ExtCap_t ext_cap;
#endif
mlan_ds_misc_otp_user_data otp_user_data;
/** fw re-connect cfg param set */
mlan_ds_fw_reconnect fw_auto_reconnect;
#ifdef USB
/** USB aggregation parameters for MLAN_OID_MISC_USB_AGGR_CTRL
*/

View file

@ -543,9 +543,11 @@ mlan_status woal_cfg80211_set_wep_keys(moal_private *priv, const t_u8 *key,
/* No key provided so it is enable key. We
* want to just set the transmit key index
*/
woal_cfg80211_set_key(priv, 1, cipher, key, key_len, NULL, 0,
index, NULL, 0, wait_option);
ret = woal_cfg80211_set_key(priv, 1, cipher, key, key_len, NULL,
0, index, NULL, 0, wait_option);
}
if (ret != MLAN_STATUS_SUCCESS)
PRINTM(MERROR, "woal_cfg80211_set_wep_keys Fail\n");
LEAVE();
return ret;
@ -564,17 +566,21 @@ void woal_clear_all_mgmt_ies(moal_private *priv, t_u8 wait_option)
/* clear BEACON WPS/P2P IE */
if (priv->beacon_wps_index != MLAN_CUSTOM_IE_AUTO_IDX_MASK) {
PRINTM(MCMND, "Clear BEACON WPS ie\n");
woal_cfg80211_mgmt_frame_ie(priv, NULL, 0, NULL, 0, NULL, 0,
NULL, 0, MGMT_MASK_BEACON_WPS_P2P,
wait_option);
if (woal_cfg80211_mgmt_frame_ie(
priv, NULL, 0, NULL, 0, NULL, 0, NULL, 0,
MGMT_MASK_BEACON_WPS_P2P, wait_option))
PRINTM(MERROR, "%s: clear beacon wps ie failed \n",
__func__);
priv->beacon_wps_index = MLAN_CUSTOM_IE_AUTO_IDX_MASK;
}
if (priv->assocresp_qos_map_index != MLAN_CUSTOM_IE_AUTO_IDX_MASK) {
PRINTM(MCMND, "Clear associate response QOS map ie\n");
woal_cfg80211_mgmt_frame_ie(priv, NULL, 0, NULL, 0, NULL, 0,
NULL, 0,
MGMT_MASK_ASSOC_RESP_QOS_MAP,
wait_option);
if (woal_cfg80211_mgmt_frame_ie(
priv, NULL, 0, NULL, 0, NULL, 0, NULL, 0,
MGMT_MASK_ASSOC_RESP_QOS_MAP, wait_option))
PRINTM(MERROR,
"%s: Clear associate response QOS map ie failed \n",
__func__);
priv->assocresp_qos_map_index = MLAN_CUSTOM_IE_AUTO_IDX_MASK;
}
/* clear mgmt frame ies */
@ -595,8 +601,10 @@ void woal_clear_all_mgmt_ies(moal_private *priv, t_u8 wait_option)
priv->beacon_index, priv->probereq_index,
priv->proberesp_index, priv->assocresp_index,
priv->proberesp_p2p_index, priv->beacon_vendor_index);
woal_cfg80211_mgmt_frame_ie(priv, NULL, 0, NULL, 0, NULL, 0,
NULL, 0, mask, wait_option);
if (woal_cfg80211_mgmt_frame_ie(priv, NULL, 0, NULL, 0, NULL, 0,
NULL, 0, mask, wait_option))
PRINTM(MERROR, "%s: Clear ies failed, mask=0x%x\n",
__func__, mask);
}
priv->probereq_index = MLAN_CUSTOM_IE_AUTO_IDX_MASK;
priv->beacon_index = MLAN_CUSTOM_IE_AUTO_IDX_MASK;
@ -624,18 +632,29 @@ int woal_cfg80211_bss_role_cfg(moal_private *priv, t_u16 action, t_u8 *bss_role)
if (action == MLAN_ACT_SET) {
/* Reset interface */
woal_reset_intf(priv, MOAL_IOCTL_WAIT, MFALSE);
if (MLAN_STATUS_SUCCESS !=
woal_reset_intf(priv, MOAL_IOCTL_WAIT, MFALSE)) {
PRINTM(MERROR, "woal_reset_intf fail\n");
ret = -EFAULT;
goto done;
}
}
if (MLAN_STATUS_SUCCESS !=
woal_bss_role_cfg(priv, action, MOAL_IOCTL_WAIT, bss_role)) {
PRINTM(MERROR, "woal_bss_role_cfg fail\n");
ret = -EFAULT;
goto done;
}
if (action == MLAN_ACT_SET) {
/* set back the mac address */
woal_request_set_mac_address(priv, MOAL_IOCTL_WAIT);
if (MLAN_STATUS_SUCCESS !=
woal_request_set_mac_address(priv, MOAL_IOCTL_WAIT)) {
PRINTM(MERROR, "woal_request_set_mac_address fail\n");
ret = -EFAULT;
goto done;
}
/* clear the mgmt ies */
woal_clear_all_mgmt_ies(priv, MOAL_IOCTL_WAIT);
/* Initialize private structures */
@ -886,11 +905,22 @@ int woal_cfg80211_init_p2p_go(moal_private *priv)
p2p_config.noa_duration = priv->phandle->noa_duration;
p2p_config.noa_interval = priv->phandle->noa_interval;
p2p_config.flags = WIFI_DIRECT_NOA;
woal_p2p_config(priv, MLAN_ACT_SET, &p2p_config);
if (MLAN_STATUS_SUCCESS !=
woal_p2p_config(priv, MLAN_ACT_SET, &p2p_config)) {
PRINTM(MERROR, "woal_p2p_config fail\n");
ret = -EFAULT;
goto done;
}
memset(&ps_mgmt, 0, sizeof(ps_mgmt));
ps_mgmt.flags = PS_FLAG_PS_MODE;
ps_mgmt.ps_mode = PS_MODE_INACTIVITY;
woal_set_get_uap_power_mode(priv, MLAN_ACT_SET, &ps_mgmt);
if (MLAN_STATUS_SUCCESS !=
woal_set_get_uap_power_mode(priv, MLAN_ACT_SET, &ps_mgmt)) {
PRINTM(MERROR, "woal_set_get_uap_power_mode fail\n");
ret = -EFAULT;
goto done;
}
PRINTM(MMSG, "Enable NOA: duration=%d, interval=%d\n",
priv->phandle->noa_duration,
priv->phandle->noa_interval);
@ -985,7 +1015,12 @@ int woal_cfg80211_deinit_p2p(moal_private *priv)
memset(&ps_mgmt, 0, sizeof(ps_mgmt));
ps_mgmt.flags = PS_FLAG_PS_MODE;
ps_mgmt.ps_mode = PS_MODE_DISABLE;
woal_set_get_uap_power_mode(priv, MLAN_ACT_SET, &ps_mgmt);
if (MLAN_STATUS_SUCCESS !=
woal_set_get_uap_power_mode(priv, MLAN_ACT_SET, &ps_mgmt)) {
PRINTM(MERROR, "woal_set_get_uap_power_mode fail\n");
ret = -EFAULT;
goto done;
}
bss_role = MLAN_BSS_ROLE_STA;
if (MLAN_STATUS_SUCCESS !=
woal_cfg80211_bss_role_cfg(priv, MLAN_ACT_SET, &bss_role)) {
@ -1047,10 +1082,46 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy,
goto done;
}
#ifdef UAP_SUPPORT
/* when AP mode switch to station mode, we use it to cancel pending CAC
*/
if (priv->wdev->iftype == NL80211_IFTYPE_AP &&
type == NL80211_IFTYPE_STATION) {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
if (priv->phandle->is_cac_timer_set &&
priv->bss_index == priv->phandle->cac_bss_index) {
woal_cancel_timer(&priv->phandle->cac_timer);
priv->phandle->is_cac_timer_set = MFALSE;
/* Make sure Chan Report is cancelled */
if (woal_11h_cancel_chan_report_ioctl(priv,
MOAL_IOCTL_WAIT))
PRINTM(MERROR,
"%s: cancel chan report failed \n",
__func__);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev,
&priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED,
GFP_KERNEL);
#else
cfg80211_cac_event(priv->netdev,
NL80211_RADAR_CAC_ABORTED,
GFP_KERNEL);
#endif
memset(&priv->phandle->dfs_channel, 0,
sizeof(struct cfg80211_chan_def));
priv->phandle->cac_bss_index = 0xff;
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
if (moal_extflg_isset(priv->phandle, EXT_DFS_OFFLOAD))
woal_cancel_cac_block(priv);
#endif
}
if ((priv->bss_type == MLAN_BSS_TYPE_UAP) && (priv->bss_index > 0)) {
PRINTM(MMSG,
"%s: Skip change virtual intf type on uap: from %d to %d\n",
dev->name, priv->wdev->iftype, type);
priv->wdev->iftype = type;
PRINTM(MMSG, "%s: Skip change virtual intf on uap: type=%d\n",
dev->name, type);
goto done;
}
#endif
@ -1140,7 +1211,7 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy,
#endif /* WIFI_DIRECT_SUPPORT */
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
if (priv->bss_type == MLAN_BSS_TYPE_UAP) {
#if KERNEL_VERSION(5, 19, 0) <= CFG80211_VERSION_CODE
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
woal_cfg80211_del_beacon(wiphy, dev, 0);
#else
woal_cfg80211_del_beacon(wiphy, dev);
@ -1203,10 +1274,13 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy,
#endif
if (priv->probereq_index !=
MLAN_CUSTOM_IE_AUTO_IDX_MASK)
woal_cfg80211_mgmt_frame_ie(priv, NULL, 0, NULL,
0, NULL, 0, NULL, 0,
MGMT_MASK_PROBE_REQ,
MOAL_IOCTL_WAIT);
if (woal_cfg80211_mgmt_frame_ie(
priv, NULL, 0, NULL, 0, NULL, 0,
NULL, 0, MGMT_MASK_PROBE_REQ,
MOAL_IOCTL_WAIT))
PRINTM(MERROR,
"%s: Clear probe req ie failed\n",
__func__);
bss_role = MLAN_BSS_ROLE_UAP;
woal_cfg80211_bss_role_cfg(priv, MLAN_ACT_SET,
&bss_role);
@ -1565,7 +1639,6 @@ mlan_status woal_set_rekey_data(moal_private *priv,
{
mlan_ioctl_req *req;
mlan_ds_misc_cfg *misc_cfg;
int ret = 0;
mlan_status status;
ENTER();
@ -1573,7 +1646,8 @@ mlan_status woal_set_rekey_data(moal_private *priv,
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
if (req == NULL) {
ret = -ENOMEM;
LEAVE();
return MLAN_STATUS_FAILURE;
} else {
misc_cfg = (mlan_ds_misc_cfg *)req->pbuf;
misc_cfg->sub_command = MLAN_OID_MISC_GTK_REKEY_OFFLOAD;
@ -1587,14 +1661,12 @@ mlan_status woal_set_rekey_data(moal_private *priv,
sizeof(mlan_ds_misc_gtk_rekey_data));
status = woal_request_ioctl(priv, req, wait_option);
if (status != MLAN_STATUS_SUCCESS)
ret = -EFAULT;
if (status != MLAN_STATUS_PENDING)
kfree(req);
}
LEAVE();
return ret;
return status;
}
/**
@ -1700,7 +1772,7 @@ int woal_flush_pmksa_list(moal_private *priv)
if (!priv || priv->bss_type != MLAN_BSS_TYPE_STA) {
PRINTM(MERROR, "Invalid interface structure\n");
return -1;
return -EFAULT;
}
spin_lock_irqsave(&priv->pmksa_list_lock, flags);
@ -2127,7 +2199,7 @@ done:
* @return 0 -- success, otherwise fail
*/
int woal_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
#if KERNEL_VERSION(5, 19, 0) <= CFG80211_VERSION_CODE
#if KERNEL_VERSION(5, 19, 2) <= CFG80211_VERSION_CODE
unsigned int link_id,
#endif
const u8 *peer,
@ -2466,7 +2538,7 @@ void woal_cfg80211_mgmt_frame_register(struct wiphy *wiphy,
*
* @return N/A
*/
static void woal_cancel_chanrpt_event(moal_private *priv)
void woal_cancel_chanrpt_event(moal_private *priv)
{
struct woal_event *evt;
unsigned long flags;
@ -2684,14 +2756,6 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy,
break;
case IEEE80211_STYPE_DEAUTH:
case IEEE80211_STYPE_DISASSOC:
/* Need cancel the CAC when stop hostapd during
* CAC*/
#ifdef UAP_CFG80211
#if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE
if (priv->phandle->is_cac_timer_set)
woal_cancel_chanrpt_event(priv);
#endif
#endif
#ifdef UAP_SUPPORT
if (!priv->bss_started) {
PRINTM(MCMND,
@ -3593,8 +3657,14 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie, int len,
left_len -= (length + 2);
}
if (enable_11d)
woal_set_11d(priv, MOAL_IOCTL_WAIT, MTRUE);
#ifdef UAP_SUPPORT
if (enable_11d && !priv->bss_started) {
if (MLAN_STATUS_SUCCESS !=
woal_set_11d(priv, MOAL_IOCTL_WAIT, MTRUE)) {
PRINTM(MERROR, "woal_set_11d fail\n");
}
}
#endif
return out_len;
}
@ -3756,6 +3826,7 @@ int woal_cfg80211_mgmt_frame_ie(
if (beacon_wps_index > MAX_MGMT_IE_INDEX) {
PRINTM(MERROR,
"Invalid beacon wps index for mgmt frame ie.\n");
ret = -EFAULT;
goto done;
}
@ -3808,6 +3879,7 @@ int woal_cfg80211_mgmt_frame_ie(
PRINTM(MERROR,
"IE too big: assocresp_ies_len=%d\n",
(int)assocresp_ies_len);
ret = -EFAULT;
goto done;
}
assocresp_ies_data->ie_length = assocresp_ies_len;
@ -3822,6 +3894,7 @@ int woal_cfg80211_mgmt_frame_ie(
if (assocrep_qos_map_index > MAX_MGMT_IE_INDEX) {
PRINTM(MERROR,
"Invalid Qos map index for mgmt frame ie.\n");
ret = -EFAULT;
goto done;
}
@ -3913,6 +3986,7 @@ int woal_cfg80211_mgmt_frame_ie(
if (beacon_vendor_index > MAX_MGMT_IE_INDEX) {
PRINTM(MERROR,
"Invalid beacon_vendor_index for mgmt frame ie.\n");
ret = -EFAULT;
goto done;
}
beacon_ies_data->ie_index = beacon_vendor_index;
@ -3969,6 +4043,7 @@ int woal_cfg80211_mgmt_frame_ie(
if (beacon_index > MAX_MGMT_IE_INDEX) {
PRINTM(MINFO,
"Invalid beacon index for mgmt frame ie.\n");
ret = -EFAULT;
goto done;
}
@ -3981,6 +4056,7 @@ int woal_cfg80211_mgmt_frame_ie(
}
if (proberesp_ies_data) {
proberesp_ies_data->mgmt_subtype_mask = 0xff;
if (proberesp_ies && proberesp_ies_len) {
/* set the probe response p2p ies */
proberesp_ies_data->ie_index = proberesp_p2p_index;
@ -3999,6 +4075,7 @@ int woal_cfg80211_mgmt_frame_ie(
if (proberesp_p2p_index > MAX_MGMT_IE_INDEX) {
PRINTM(MERROR,
"Invalid proberesp_p2p_index for mgmt frame ie.\n");
ret = -EFAULT;
goto done;
}
proberesp_ies_data->ie_index = proberesp_p2p_index;
@ -4053,6 +4130,7 @@ int woal_cfg80211_mgmt_frame_ie(
if (proberesp_index > MAX_MGMT_IE_INDEX) {
PRINTM(MERROR,
"Invalid probe resp index for mgmt frame ie.\n");
ret = -EFAULT;
goto done;
}
proberesp_ies_data->ie_index = proberesp_index;
@ -4075,6 +4153,7 @@ int woal_cfg80211_mgmt_frame_ie(
PRINTM(MERROR,
"IE too big, assocresp_ies_len=%d\n",
(int)assocresp_ies_len);
ret = -EFAULT;
goto done;
}
assocresp_ies_data->ie_length = assocresp_ies_len;
@ -4089,6 +4168,7 @@ int woal_cfg80211_mgmt_frame_ie(
if (assocresp_index > MAX_MGMT_IE_INDEX) {
PRINTM(MERROR,
"Invalid assoc resp index for mgmt frame ie.\n");
ret = -EFAULT;
goto done;
}
@ -4126,6 +4206,7 @@ int woal_cfg80211_mgmt_frame_ie(
PRINTM(MERROR,
"IE too big, probereq_ies_len=%d\n",
(int)probereq_ies_len);
ret = -EFAULT;
goto done;
}
probereq_ies_data->ie_length = probereq_ies_len;
@ -4151,6 +4232,7 @@ int woal_cfg80211_mgmt_frame_ie(
if (probereq_index > MAX_MGMT_IE_INDEX) {
PRINTM(MERROR,
"Invalid probe req index for mgmt frame ie.\n");
ret = -EFAULT;
goto done;
}
probereq_ies_data->ie_index = probereq_index;
@ -4469,7 +4551,7 @@ Bit75: 0x1 (Rx 1024-QAM Support < 242-tone RU)
#define UAP_HE_2G_MAC_CAP3_MASK 0x02
#define UAP_HE_2G_MAC_CAP4_MASK 0x00
#define UAP_HE_2G_MAC_CAP5_MASK 0x00
#define UAP_HE_2G_PHY_CAP0_MASK 0x04
#define UAP_HE_2G_PHY_CAP0_MASK 0x02
#define UAP_HE_2G_PHY_CAP1_MASK 0x20
#define UAP_HE_2G_PHY_CAP2_MASK 0x3E
#define UAP_HE_2G_PHY_CAP3_MASK 0x88
@ -4804,10 +4886,16 @@ void woal_cfg80211_notify_channel(moal_private *priv,
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
if (MLAN_STATUS_SUCCESS ==
woal_chandef_create(priv, &chandef, pchan_info)) {
#if KERNEL_VERSION(5, 19, 0) <= CFG80211_VERSION_CODE
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
mutex_lock(&priv->wdev->mtx);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
cfg80211_ch_switch_notify(priv->netdev, &chandef, 0);
#else
cfg80211_ch_switch_notify(priv->netdev, &chandef);
#endif
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
mutex_unlock(&priv->wdev->mtx);
#endif
priv->channel = pchan_info->channel;
#ifdef UAP_CFG80211
@ -5144,18 +5232,18 @@ int woal_get_wiphy_chan_dfs_state(struct wiphy *wiphy,
LEAVE();
return ret;
}
ch_dfs_state->dfs_required = MFALSE;
for (i = 0; i < sband->n_channels; i++) {
if (sband->channels[i].flags & IEEE80211_CHAN_RADAR) {
if (sband->channels[i].hw_value == channel) {
if (sband->channels[i].hw_value == channel) {
if (sband->channels[i].flags & IEEE80211_CHAN_RADAR) {
#if CFG80211_VERSION_CODE > KERNEL_VERSION(3, 8, 13)
ch_dfs_state->dfs_state =
sband->channels[i].dfs_state;
ch_dfs_state->dfs_required = MTRUE;
ret = 0;
#endif
break;
}
ret = 0;
break;
}
}
LEAVE();
@ -5202,7 +5290,7 @@ static void woal_update_wiphy_chan_dfs_state(struct wiphy *wiphy, t_u8 channel,
}
#if CFG80211_VERSION_CODE > KERNEL_VERSION(3, 8, 13)
if (i < sband->n_channels)
PRINTM(MCMND, "DFS: Set channel %d dfs_state: %d\n", channel,
PRINTM(MCMD_D, "DFS: Set channel %d dfs_state: %d\n", channel,
sband->channels[i].dfs_state);
#endif
LEAVE();

View file

@ -162,7 +162,7 @@ int woal_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev);
#endif
int woal_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
#if KERNEL_VERSION(5, 19, 0) <= CFG80211_VERSION_CODE
#if KERNEL_VERSION(5, 19, 2) <= CFG80211_VERSION_CODE
unsigned int link_id,
#endif
const u8 *peer,
@ -436,8 +436,9 @@ int woal_cfg80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,
struct beacon_parameters *params);
#endif
#if KERNEL_VERSION(5, 19, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev, unsigned int link_id);
#if KERNEL_VERSION(5, 19, 2) <= CFG80211_VERSION_CODE
int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev,
unsigned int link_id);
#else
int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev);
#endif

View file

@ -775,15 +775,22 @@ static int woal_cfg80211_subcmd_get_supp_feature_set(struct wiphy *wiphy,
| WLAN_FEATURE_LINK_LAYER_STATS |
WLAN_FEATURE_LOGGER | WLAN_FEATURE_RSSI_MONITOR |
WLAN_FEATURE_CONFIG_NDO | WLAN_FEATURE_SCAN_RAND |
WLAN_FEATURE_MKEEP_ALIVE;
WLAN_FEATURE_MKEEP_ALIVE | WLAN_FEATURE_PNO;
memset(&fw_info, 0, sizeof(mlan_fw_info));
woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info);
if (MLAN_STATUS_SUCCESS !=
woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info)) {
PRINTM(MERROR, "Fail to get fw info\n");
ret = -EFAULT;
goto done;
}
if (fw_info.fw_bands & BAND_A)
supp_feature_set |= WLAN_FEATURE_INFRA_5G;
if (fw_info.fw_roaming_support)
supp_feature_set |= WLAN_FEATURE_CONTROL_ROAMING;
priv->phandle->wifi_hal_flag = MTRUE;
reply_len = sizeof(supp_feature_set);
/** Allocate skb for cmd reply*/
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, reply_len);
@ -925,8 +932,8 @@ static void woal_get_ring_status(moal_private *priv, int ring_id,
ring = (wifi_ring_buffer *)priv->rings[id];
if (ring && VALID_RING(ring->ring_id) &&
ring_id == ring->ring_id) {
strncpy(status->name, ring->name,
sizeof(status->name) - 1);
moal_memcpy(priv->phandle, status->name, ring->name,
sizeof(status->name) - 1);
status->ring_id = ring->ring_id;
status->ring_buffer_byte_size = ring->ring_size;
status->written_bytes = ring->ctrl.written_bytes;
@ -3177,7 +3184,12 @@ static int woal_cfg80211_subcmd_rssi_monitor(struct wiphy *wiphy,
priv->cqm_rssi_high_thold = rssi_max;
priv->cqm_rssi_thold = rssi_min;
priv->cqm_rssi_hyst = 4;
woal_set_rssi_threshold(priv, 0, MOAL_IOCTL_WAIT);
if (MLAN_STATUS_SUCCESS !=
woal_set_rssi_threshold(priv, 0, MOAL_IOCTL_WAIT)) {
PRINTM(MERROR, "set rssi threhold fail\n");
ret = -EFAULT;
goto done;
}
} else if (rssi_monitor_control == RSSI_MONOTOR_STOP) {
/* stop rssi monitor */
PRINTM(MEVENT, "stop rssi monitor\n");
@ -3187,7 +3199,12 @@ static int woal_cfg80211_subcmd_rssi_monitor(struct wiphy *wiphy,
priv->cqm_rssi_high_thold = 0;
priv->cqm_rssi_thold = 0;
priv->cqm_rssi_hyst = 0;
woal_set_rssi_threshold(priv, 0, MOAL_IOCTL_WAIT);
if (MLAN_STATUS_SUCCESS !=
woal_set_rssi_threshold(priv, 0, MOAL_IOCTL_WAIT)) {
PRINTM(MERROR, "set rssi threhold fail\n");
ret = -EFAULT;
goto done;
}
} else {
PRINTM(MERROR, "invalid rssi_monitor control request\n");
ret = -EINVAL;
@ -3652,8 +3669,12 @@ static int woal_cfg80211_subcmd_fw_roaming_config(struct wiphy *wiphy,
sizeof(wifi_ssid_params) -
sizeof(whitelist.num_ssid),
MAX_SSID_NUM * sizeof(mlan_802_11_ssid));
woal_config_fw_roaming(priv, ROAM_OFFLOAD_PARAM_CFG,
roam_offload_cfg);
if (woal_config_fw_roaming(priv, ROAM_OFFLOAD_PARAM_CFG,
roam_offload_cfg)) {
PRINTM(MERROR, "%s: config fw roaming failed \n",
__func__);
ret = -EFAULT;
}
}
done:
@ -3829,6 +3850,10 @@ static int woal_cfg80211_subcmd_start_keep_alive(struct wiphy *wiphy,
break;
case MKEEP_ALIVE_ATTRIBUTE_IP_PKT:
if (ip_pkt_len) {
if (ip_pkt) {
kfree(ip_pkt);
ip_pkt = NULL;
}
ip_pkt = (u8 *)kzalloc(ip_pkt_len, GFP_ATOMIC);
if (ip_pkt == NULL) {
ret = -ENOMEM;

View file

@ -624,6 +624,8 @@ enum mrvl_wlan_vendor_attr_wifi_logger {
enum vendor_event {
event_hang = 0,
event_fw_dump_done = 1,
event_fw_reset_success = 2,
event_fw_reset_failure = 3,
event_rssi_monitor = 0x1501,
event_set_key_mgmt_offload = 0x10001,
event_fw_roam_success = 0x10002,

View file

@ -260,6 +260,10 @@ static struct debug_data items[] = {
item_handle_addr(hs_skip_count), HANDLE_ADDR},
{"hs_force_count", item_handle_size(hs_force_count),
item_handle_addr(hs_force_count), HANDLE_ADDR},
#ifdef STA_CFG80211
{"scan_timeout", item_handle_size(scan_timeout),
item_handle_addr(scan_timeout), HANDLE_ADDR},
#endif
};
#endif

File diff suppressed because it is too large Load diff

View file

@ -110,6 +110,7 @@ typedef struct _chan_stats {
#define PRIV_CMD_ASSOCESSID "assocessid"
#define PRIV_CMD_ASSOCBSSID "assocessid_bssid"
#endif
#define PRIV_CMD_AUTOASSOC "assocctrl"
#define PRIV_CMD_WAKEUPREASON "wakeupreason"
#ifdef STA_SUPPORT
#define PRIV_CMD_LISTENINTERVAL "listeninterval"
@ -219,8 +220,10 @@ typedef struct _chan_stats {
#endif
#define PRIV_CMD_DFS_TESTING "dfstesting"
#define PRIV_CMD_CLEAR_NOP "clear_nop"
#define PRIV_CMD_NOP_LIST "nop_list"
#define PRIV_CMD_FAKE_RADAR "fake_radar"
#define PRIV_CMD_DFS53_CFG "dfs53cfg"
#define PRIV_CMD_DFS_MODE "dfs_mode"
#define PRIV_CMD_DFS_CAC "dfs_cac"
#define PRIV_CMD_AUTODFS "autodfs"
#define PRIV_CMD_CFP_CODE "cfpcode"

View file

@ -29,6 +29,7 @@ extern pmoal_handle m_handle[];
static char *fw_name;
static int req_fw_nowait;
int fw_reload;
int auto_fw_reload;
static char *hw_name;
@ -61,12 +62,7 @@ static int beacon_hints;
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
#ifdef IMX_SUPPORT
static int host_mlme = 1;
#else
static int host_mlme = 0;
#endif
#endif
#endif
@ -356,6 +352,8 @@ static card_type_entry card_type_map_tbl[] = {
static int dfs53cfg = DFS_W53_DEFAULT_FW;
static int keep_previous_scan = 1;
/**
* @brief This function read a line in module parameter file
*
@ -606,6 +604,14 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
goto err;
params->fw_reload = out_data;
PRINTM(MMSG, "fw_reload %d\n", params->fw_reload);
} else if (strncmp(line, "auto_fw_reload",
strlen("auto_fw_reload")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->auto_fw_reload = out_data;
PRINTM(MMSG, "auto_fw_reload %d\n",
params->auto_fw_reload);
} else if (strncmp(line, "fw_serial", strlen("fw_serial")) ==
0) {
if (parse_line_read_int(line, &out_data) !=
@ -1345,6 +1351,14 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
PRINTM(MMSG, "chan_track= %s\n",
moal_extflg_isset(handle, EXT_PMQOS) ? "on" :
"off");
} else if (strncmp(line, "keep_previous_scan",
strlen("keep_previous_scan")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->keep_previous_scan = out_data;
PRINTM(MMSG, "keep_previous_scan=%d\n",
params->keep_previous_scan);
}
}
if (end)
@ -1385,6 +1399,10 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
}
if (params)
handle->params.fw_reload = params->fw_reload;
handle->params.auto_fw_reload = auto_fw_reload;
if (params)
handle->params.auto_fw_reload = params->auto_fw_reload;
if (fw_serial)
moal_extflg_set(handle, EXT_FW_SERIAL);
woal_dup_string(&handle->params.hw_name, hw_name);
@ -1665,6 +1683,7 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
if (params)
handle->params.dfs53cfg = params->dfs53cfg;
}
handle->params.keep_previous_scan = keep_previous_scan;
}
/**
@ -2137,6 +2156,13 @@ void woal_init_from_dev_tree(void)
chan_track = data;
PRINTM(MIOCTL, "chan_track=%d\n", chan_track);
}
} else if (!strncmp(prop->name, "keep_previous_scan",
strlen("keep_previous_scan"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MERROR, "keep_previous_scan=0x%x\n",
data);
keep_previous_scan = data;
}
}
}
LEAVE();
@ -2343,6 +2369,9 @@ MODULE_PARM_DESC(
module_param(fw_reload, int, 0);
MODULE_PARM_DESC(fw_reload,
"0: disable fw_reload; 1: enable fw reload feature");
module_param(auto_fw_reload, int, 0);
MODULE_PARM_DESC(auto_fw_reload,
"0: disable auto_fw_reload; 1: enable auto fw reload feature");
module_param(fw_serial, int, 0);
MODULE_PARM_DESC(
fw_serial,
@ -2603,15 +2632,9 @@ MODULE_PARM_DESC(
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
module_param(host_mlme, int, 0);
#ifdef IMX_SUPPORT
MODULE_PARM_DESC(
host_mlme,
"1: Enable Host MLME Support (Default); 0: Disable Host MLME support");
#else
MODULE_PARM_DESC(
host_mlme,
"1: Enable Host MLME Support; 0: Disable Host MLME support (Default)");
#endif
#endif
#endif
@ -2640,3 +2663,8 @@ module_param(chan_track, int, 0);
MODULE_PARM_DESC(
chan_track,
"1: Set channel tracking; 0: Restore channel tracking for 9098 only");
module_param(keep_previous_scan, int, 0);
MODULE_PARM_DESC(
keep_previous_scan,
"1: keep previous scan result; 0: flush previous scan result before start scan ");

View file

@ -971,6 +971,8 @@ done:
#ifdef REASSOCIATION
priv->reassoc_required = MFALSE;
#endif /* REASSOCIATION */
priv->auto_assoc_priv.drv_assoc.status = MFALSE;
priv->auto_assoc_priv.drv_reconnect.status = MFALSE;
LEAVE();
return status;
}
@ -1304,7 +1306,7 @@ int woal_pre_warmreset(moal_private *priv)
#endif
woal_cancel_cac_block(priv);
/* Reset all interfaces */
ret = woal_reset_intf(priv, MOAL_IOCTL_WAIT, MTRUE);
woal_reset_intf(priv, MOAL_IOCTL_WAIT, MTRUE);
/* Initialize private structures */
for (intf_num = 0; intf_num < handle->priv_num; intf_num++) {
woal_init_priv(handle->priv[intf_num], MOAL_IOCTL_WAIT);
@ -2756,7 +2758,12 @@ int woal_set_get_bss_role(moal_private *priv, struct iwreq *wrq)
}
action = MLAN_ACT_SET;
/* Reset interface */
woal_reset_intf(priv, MOAL_IOCTL_WAIT, MFALSE);
if (MLAN_STATUS_SUCCESS !=
woal_reset_intf(priv, MOAL_IOCTL_WAIT, MFALSE)) {
PRINTM(MERROR, "%s: reset_intf failed \n", __func__);
ret = -EFAULT;
goto done;
}
}
if (MLAN_STATUS_SUCCESS != woal_bss_role_cfg(priv, action,
@ -2792,6 +2799,7 @@ done:
#endif /* STA_WEXT || UAP_WEXT */
#endif /* STA_SUPPORT && UAP_SUPPORT */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
/**
* @brief Enable IPv6 Router Advertisement offload
*
@ -2847,6 +2855,7 @@ done:
LEAVE();
return ret;
}
#endif
static mlan_status woal_set_wake_on_mdns(moal_handle *handle, t_u8 enable)
{
@ -3243,7 +3252,7 @@ mlan_status woal_set_get_hs_params(moal_private *priv, t_u16 action,
/* Allocate an IOCTL request buffer */
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_pm_cfg));
if (req == NULL) {
ret = -ENOMEM;
ret = MLAN_STATUS_FAILURE;
goto done;
}
@ -3403,7 +3412,12 @@ mlan_status woal_cancel_hs(moal_private *priv, t_u8 wait_option)
hscfg.conditions = HOST_SLEEP_CFG_CANCEL;
hscfg.is_invoke_hostcmd = MTRUE;
ret = woal_set_get_hs_params(priv, MLAN_ACT_SET, wait_option, &hscfg);
if (ret != MLAN_STATUS_SUCCESS) {
PRINTM(MERROR, "%s: woal_set_get_hs_params failed \n",
__func__);
LEAVE();
return ret;
}
if (moal_extflg_isset(priv->phandle, EXT_ROAMOFFLOAD_IN_HS)) {
/*Disable firmware roaming*/
woal_enable_fw_roaming(priv, 0);
@ -3453,9 +3467,13 @@ mlan_status woal_cancel_hs(moal_private *priv, t_u8 wait_option)
if (handle->priv[i] &&
handle->priv[i]->gtk_data_ready) {
PRINTM(MCMND, "clear GTK in resume\n");
woal_set_rekey_data(handle->priv[i], NULL,
MLAN_ACT_CLEAR,
wait_option);
if (MLAN_STATUS_SUCCESS !=
woal_set_rekey_data(handle->priv[i], NULL,
MLAN_ACT_CLEAR,
wait_option))
PRINTM(MERROR,
"%s: clear GTK in resume failed \n",
__func__);
}
}
}
@ -3751,10 +3769,14 @@ int woal_enable_hs(moal_private *priv)
if (handle->priv[i] &&
handle->priv[i]->gtk_data_ready) {
PRINTM(MCMND, "set GTK before suspend\n");
woal_set_rekey_data(
handle->priv[i],
&handle->priv[i]->gtk_rekey_data,
MLAN_ACT_SET, MOAL_NO_WAIT);
if (MLAN_STATUS_SUCCESS !=
woal_set_rekey_data(
handle->priv[i],
&handle->priv[i]->gtk_rekey_data,
MLAN_ACT_SET, MOAL_NO_WAIT))
PRINTM(MERROR,
"%s: set GTR before suspend failed \n",
__func__);
}
}
}
@ -4483,7 +4505,10 @@ void woal_cancel_cac_block(moal_private *priv)
if (priv->phandle->cac_period == MTRUE) {
priv->phandle->cac_period = MFALSE;
/* Make sure Chan Report is cancelled */
woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT);
if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT))
PRINTM(MERROR,
"%s: Cancelling CAC chan report in FW failed \n",
__func__);
priv->phandle->meas_start_jiffies = 0;
if (priv->phandle->delay_bss_start == MTRUE)
priv->phandle->delay_bss_start = MFALSE;
@ -5769,6 +5794,7 @@ mlan_status woal_cancel_scan(moal_private *priv, t_u8 wait_option)
spin_lock_irqsave(&handle->scan_req_lock, flags);
if (IS_STA_CFG80211(handle->params.cfg80211_wext) &&
handle->scan_request) {
cancel_delayed_work(&handle->scan_timeout_work);
/** some supplicant can not handle SCAN abort event */
if (scan_priv->bss_type == MLAN_BSS_TYPE_STA)
woal_cfg80211_scan_done(handle->scan_request, MTRUE);
@ -5837,10 +5863,10 @@ int woal_find_essid(moal_private *priv, mlan_ssid_bssid *ssid_bssid,
* @param cfg_mode configure mode
* @param roam_offload_cfg Pointer to woal_roam_offload_cfg structure
*
* @return Number of bytes written, negative for failure.
* @return 0-success, negative for failure.
*/
mlan_status woal_config_fw_roaming(moal_private *priv, t_u8 cfg_mode,
woal_roam_offload_cfg *roam_offload_cfg)
int woal_config_fw_roaming(moal_private *priv, t_u8 cfg_mode,
woal_roam_offload_cfg *roam_offload_cfg)
{
mlan_ioctl_req *ioctl_req = NULL;
mlan_ds_misc_cfg *misc = NULL;
@ -6159,7 +6185,11 @@ void woal_config_bgscan_and_rssi(moal_private *priv, t_u8 set_rssi)
priv->scan_cfg.rssi_threshold = priv->rssi_low - RSSI_HYSTERESIS;
priv->scan_cfg.repeat_count = DEF_REPEAT_COUNT;
priv->scan_cfg.scan_interval = MIN_BGSCAN_INTERVAL;
woal_get_band(priv, &band);
if (MLAN_STATUS_SUCCESS != woal_get_band(priv, &band)) {
PRINTM(MERROR, "woal get band fail\n");
LEAVE();
return;
}
switch (band) {
case WIFI_FREQUENCY_BAND_2GHZ:
priv->scan_cfg.chan_list[0].radio_type = 0 | BAND_SPECIFIED;
@ -6176,12 +6206,19 @@ void woal_config_bgscan_and_rssi(moal_private *priv, t_u8 set_rssi)
moal_memcpy_ext(priv->phandle, priv->scan_cfg.random_mac,
priv->random_mac, ETH_ALEN,
sizeof(priv->scan_cfg.random_mac));
woal_request_bgscan(priv, MOAL_NO_WAIT, &priv->scan_cfg);
if (MLAN_STATUS_FAILURE ==
woal_request_bgscan(priv, MOAL_NO_WAIT, &priv->scan_cfg)) {
PRINTM(MERROR, "request bgscan fail\n");
LEAVE();
return;
}
if (set_rssi &&
((priv->rssi_low + RSSI_HYSTERESIS) <= LOWEST_RSSI_THRESHOLD)) {
priv->rssi_low += RSSI_HYSTERESIS;
snprintf(rssi_low, sizeof(rssi_low), "%d", priv->rssi_low);
woal_set_rssi_low_threshold(priv, rssi_low, MOAL_NO_WAIT);
if (MLAN_STATUS_FAILURE ==
woal_set_rssi_low_threshold(priv, rssi_low, MOAL_NO_WAIT))
PRINTM(MERROR, "set_rssi_low_threshold fail\n");
}
LEAVE();
}
@ -7496,7 +7533,7 @@ static int parse_radio_mode_string(const char *s, size_t len,
if (pos)
d->data2 = (t_u32)woal_string_to_number(pos);
if ((d->data1 > 14 || d->data1 < 0) || (d->data2 > 14 || d->data2 < 0))
if ((d->data1 > 14) || (d->data2 > 14))
ret = -EINVAL;
kfree(tmp);
@ -7784,7 +7821,6 @@ static int parse_he_tb_tx_string(const char *s, size_t len,
{
int ret = MLAN_STATUS_SUCCESS;
char *string = NULL;
char *tmp = NULL;
char *pos = NULL;
gfp_t flag;
@ -7827,7 +7863,7 @@ static int parse_he_tb_tx_string(const char *s, size_t len,
ret = -EINVAL;
done:
kfree(tmp);
kfree(string);
LEAVE();
return ret;
}

File diff suppressed because it is too large Load diff

View file

@ -326,6 +326,14 @@ typedef enum _MOAL_HARDWARE_STATUS {
HardwareStatusNotReady
} MOAL_HARDWARE_STATUS;
#define WIFI_STATUS_OK 0
#define WIFI_STATUS_DNLD_FW_FAIL 1
#define WIFI_STATUS_INIT_FW_FAIL 2
#define WIFI_STATUS_TX_TIMEOUT 3
#define WIFI_STATUS_WIFI_HANG 4
#define WIFI_STATUS_SCAN_TIMEOUT 5
#define WIFI_STATUS_FW_DUMP 6
/** fw cap info 11p */
#define FW_CAPINFO_80211P MBIT(24)
/** fw cap info bit26 for 0-DFS support */
@ -734,6 +742,10 @@ out:
#define CUS_EVT_DRIVER_HANG "EVENT=DRIVER_HANG"
/** Custom event : FW_DUMP */
#define CUS_EVT_FW_DUMP "EVENT=FW_DUMP"
/** Custom event : START FW RESET */
#define CUS_EVT_FW_RECOVER_START "EVENT=FW_RECOVER_START"
#define CUS_EVT_FW_RECOVER_SUCCESS "EVENT=FW_RECOVER_SUCCESS"
#define CUS_EVT_FW_RECOVER_FAIL "EVENT=FW_RECOVER_FAILURE"
/** TDLS connected event */
#define CUS_EVT_TDLS_CONNECTED "EVENT=TDLS_CONNECTED"
@ -823,6 +835,8 @@ void woal_move_to_next_channel(moal_private *priv);
void woal_chan_event(moal_private *priv, t_u8 type, t_u8 channel, t_u8 radar);
void woal_process_chan_event(moal_private *priv, t_u8 type, t_u8 channel,
t_u8 radar);
mlan_status woal_do_dfs_cac(moal_private *priv,
mlan_ds_11h_chan_rep_req *ch_rpt_req);
#endif
/** Custom event : WEP ICV error */
@ -854,6 +868,8 @@ void woal_process_chan_event(moal_private *priv, t_u8 type, t_u8 channel,
#define MOAL_TIMER_1S 1000
/** 1 milisecond */
#define MOAL_TIMER_1MS 1
/** scan timeout set to 25 seconds */
#define SCAN_TIMEOUT_25S 25000
/** passive scan time */
#define PASSIVE_SCAN_CHAN_TIME 110
@ -876,7 +892,7 @@ void woal_process_chan_event(moal_private *priv, t_u8 type, t_u8 channel,
/** Netlink protocol number */
#define NETLINK_NXP (MAX_LINKS - 1)
/** Netlink maximum payload size */
#define NL_MAX_PAYLOAD 1024
#define NL_MAX_PAYLOAD (3 * 1024)
/** Netlink multicast group number */
#define NL_MULTICAST_GROUP 1
@ -970,7 +986,7 @@ typedef struct _wait_queue {
/** Driver mode uAP bit */
#define DRV_MODE_UAP MBIT(1)
/** Maximum uAP BSS */
#define MAX_UAP_BSS 1
#define MAX_UAP_BSS 3
/** Default uAP BSS */
#define DEF_UAP_BSS 1
@ -1242,6 +1258,36 @@ struct mcast_node {
t_u8 mcast_addr[ETH_ALEN];
};
/** This is a flag for auto assoc/re-connect retry forever */
#define AUTO_ASSOC_RETRY_FOREVER 0xFFFF
typedef enum {
AUTO_ASSOC_TYPE_NONE = 0,
AUTO_ASSOC_TYPE_DRV_ASSOC,
AUTO_ASSOC_TYPE_DRV_RECONN,
AUTO_ASSOC_TYPE_FW_RECONN,
} AUTO_ASSOC_TYPE;
typedef struct {
/** driver auto assoc retry count */
t_u8 retry_count;
/** driver auto assoc retry interval */
t_u8 retry_interval;
/** driver auto assoc status */
t_u8 status;
} drv_auto_assoc;
typedef struct {
/** Bitmap for auto assoc type on/off */
t_u8 auto_assoc_type_on;
/** flag of being triggered by drv auto assoc/re-connect */
t_u8 auto_assoc_trigger_flag;
/** driver auto assoc info*/
drv_auto_assoc drv_assoc;
/** driver auto re-connect info*/
drv_auto_assoc drv_reconnect;
} auto_assoc;
struct rf_test_mode_data {
/* tx antenna num */
t_u32 tx_antenna;
@ -1360,8 +1406,6 @@ struct _moal_private {
struct workqueue_struct *mclist_workqueue;
/** mclist work */
struct work_struct mclist_work;
/** Scan deferred work*/
struct delayed_work scan_deferred_work;
/** Statistics of tcp ack tx dropped */
t_u32 tcp_ack_drop_cnt;
/** Statistics of tcp ack tx in total from kernel */
@ -1385,6 +1429,14 @@ struct _moal_private {
t_u32 user_cac_period_msec;
/** channel under nop */
BOOLEAN chan_under_nop;
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
/** radar background */
t_u8 radar_background;
/** radar background channel */
struct cfg80211_chan_def radar_background_chan;
#endif
#endif
/** chan_rpt_req on Zero DFS interface */
mlan_ds_11h_chan_rep_req chan_rpt_req;
/** chan_rpt pending */
@ -1652,6 +1704,7 @@ struct _moal_private {
t_u8 enable_auto_tdls;
/** check tx packet for tdls peer */
t_u8 tdls_check_tx;
auto_assoc auto_assoc_priv;
#if CFG80211_VERSION_CODE > KERNEL_VERSION(2, 6, 29)
atomic_t wmm_tx_pending[4];
#endif
@ -1958,8 +2011,8 @@ typedef struct woal_priv_fw_roam_offload_cfg {
#ifdef STA_CFG80211
int woal_set_clear_pmk(moal_private *priv, t_u8 action);
#endif
mlan_status woal_config_fw_roaming(moal_private *priv, t_u8 cfg_mode,
woal_roam_offload_cfg *roam_offload_cfg);
int woal_config_fw_roaming(moal_private *priv, t_u8 cfg_mode,
woal_roam_offload_cfg *roam_offload_cfg);
int woal_enable_fw_roaming(moal_private *priv, int data);
#define GTK_REKEY_OFFLOAD_DISABLE 0
@ -2076,6 +2129,7 @@ typedef struct _moal_mod_para {
t_u8 flag;
char *fw_name;
int fw_reload;
int auto_fw_reload;
char *mac_addr;
#ifdef MFG_CMD_SUPPORT
int mfg_mode;
@ -2159,6 +2213,7 @@ typedef struct _moal_mod_para {
int dfs53cfg;
t_u8 mcs32;
int keep_previous_scan;
} moal_mod_para;
void woal_tp_acnt_timer_func(void *context);
@ -2406,6 +2461,8 @@ struct _moal_handle {
t_u8 remain_on_channel;
/** bss index for remain on channel */
t_u8 remain_bss_index;
/** wifi hal enabled flag */
t_u8 wifi_hal_flag;
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
struct wiphy *wiphy;
/** Country code for regulatory domain */
@ -2526,6 +2583,12 @@ struct _moal_handle {
#ifdef STA_CFG80211
/** CFG80211 scan request description */
struct cfg80211_scan_request *scan_request;
/** fake scan flag */
u8 fake_scan_complete;
/** Scan timeout work*/
struct delayed_work scan_timeout_work;
/** scan timeout time */
t_u32 scan_timeout;
#endif
#endif
/** main state */
@ -3331,7 +3394,7 @@ mlan_status woal_set_get_gen_ie(moal_private *priv, t_u32 action, t_u8 *ie,
#ifdef CONFIG_PROC_FS
mlan_status woal_request_soft_reset(moal_handle *handle);
#endif
void woal_request_fw_reload(moal_handle *phandle, t_u8 mode);
int woal_request_fw_reload(moal_handle *phandle, t_u8 mode);
/** Get debug information */
mlan_status woal_get_debug_info(moal_private *priv, t_u8 wait_option,
@ -3531,7 +3594,7 @@ mlan_status woal_set_wapi_enable(moal_private *priv, t_u8 wait_option,
/** Initialize priv */
void woal_init_priv(moal_private *priv, t_u8 wait_option);
/** Reset interface(s) */
int woal_reset_intf(moal_private *priv, t_u8 wait_option, int all_intf);
mlan_status woal_reset_intf(moal_private *priv, t_u8 wait_option, int all_intf);
#define TLV_TYPE_MGMT_IE (0x169)
#define MGMT_MASK_ASSOC_REQ 0x01
#define MGMT_MASK_REASSOC_REQ 0x04
@ -3635,7 +3698,9 @@ t_void woal_main_work_queue(struct work_struct *work);
t_void woal_rx_work_queue(struct work_struct *work);
t_void woal_evt_work_queue(struct work_struct *work);
t_void woal_mclist_work_queue(struct work_struct *work);
t_void woal_scan_deferred_work_queue(struct work_struct *work);
#ifdef STA_CFG80211
t_void woal_scan_timeout_handler(struct work_struct *work);
#endif
netdev_tx_t woal_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
#ifdef STA_SUPPORT

View file

@ -28,6 +28,10 @@ Change log:
#include <linux/firmware.h>
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#include "moal_cfg80211.h"
#endif
#include "moal_pcie.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 70)
@ -308,6 +312,15 @@ static mlan_status woal_do_flr(moal_handle *handle, bool prepare, bool flr_flag)
#if IS_ENABLED(CONFIG_IPV6)
unregister_inet6addr_notifier(&handle->woal_inet6_notifier);
#endif
#endif
#ifdef WIFI_DIRECT_SUPPORT
#if defined(STA_CFG80211) && defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= WIFI_DIRECT_KERNEL_VERSION
/* Remove virtual interface */
woal_remove_virtual_interface(handle);
#endif
#endif
#endif
/* Remove interface */
@ -468,7 +481,11 @@ static int woal_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
ret = MLAN_STATUS_FAILURE;
goto err;
}
woal_pcie_init(card);
if (MLAN_STATUS_SUCCESS != woal_pcie_init(card)) {
PRINTM(MERROR, "woal_pcie_init failed\n");
ret = -EFAULT;
goto err;
}
if (woal_add_card(card, &card->dev->dev, &pcie_ops, card_type) ==
NULL) {
@ -2377,9 +2394,11 @@ static void woal_pcie_dump_fw_info(moal_handle *phandle)
}
}
#endif
phandle->fw_dump = MFALSE;
if (!phandle->priv_num)
return;
woal_send_fw_dump_complete_event(
woal_get_priv(phandle, MLAN_BSS_ROLE_ANY));
phandle->fw_dump = MFALSE;
mlan_pm_wakeup_card(phandle->pmlan_adapter, MFALSE);
queue_work(phandle->workqueue, &phandle->main_work);
woal_process_hang(phandle);

View file

@ -4740,6 +4740,7 @@ static int woal_set_user_scan_ext_ioctl(moal_private *priv, struct iwreq *wrq)
MIN(wrq->u.data.length,
sizeof(wlan_user_scan_cfg)))) {
PRINTM(MINFO, "Copy from user failed\n");
kfree(scan_req);
LEAVE();
return -EFAULT;
}

View file

@ -459,7 +459,7 @@ static int parse_cmd52_string(const char *buffer, size_t len, int *func,
static ssize_t woal_config_write(struct file *f, const char __user *buf,
size_t count, loff_t *off)
{
char databuf[101];
char databuf[200];
char *line = NULL;
t_u32 config_data = 0;
struct seq_file *sfp = f->private_data;
@ -769,7 +769,7 @@ static int woal_config_read(struct seq_file *sfp, void *data)
seq_printf(sfp, " %u",
handle->rf_data->tx_frame_data[i]);
for (i = 13; i < 20; i++)
seq_printf(sfp, " %u",
seq_printf(sfp, " %d",
handle->rf_data->tx_frame_data[i]);
seq_printf(sfp, " %02x:%02x:%02x:%02x:%02x:%02x",
handle->rf_data->bssid[0],

View file

@ -1826,7 +1826,7 @@ void woal_dump_firmware_info(moal_handle *phandle)
if (dbg_ptr < end_ptr)
dbg_ptr++;
else {
PRINTM(MERROR, "pre-allocced buf is not enough\n");
PRINTM(MINFO, "pre-allocced buf is not enough\n");
goto done;
}
for (reg = reg_start; reg <= reg_end; reg++) {
@ -1838,7 +1838,7 @@ void woal_dump_firmware_info(moal_handle *phandle)
if (dbg_ptr < end_ptr)
dbg_ptr++;
else
PRINTM(MMSG,
PRINTM(MINFO,
"pre-allocced buf is not enough\n");
}
switch (ctrl_data) {
@ -2035,7 +2035,7 @@ void woal_dump_firmware_info_v2(moal_handle *phandle)
if (dbg_ptr < end_ptr)
dbg_ptr++;
else
PRINTM(MMSG,
PRINTM(MINFO,
"pre-allocced buf is not enough\n");
}
if (RDWR_STATUS_DONE == stat) {
@ -2181,27 +2181,30 @@ void woal_dump_firmware_info_v3(moal_handle *phandle)
}
dbg_ptr++;
if (dbg_ptr >= end_ptr) {
PRINTM(MMSG,
PRINTM(MINFO,
"pre-allocced buf is not enough\n");
ret = moal_vmalloc(phandle,
memory_size + 0x4000 + 1,
memory_size + 0x2000 + 1,
(t_u8 **)&temp_Ptr);
if ((ret != MLAN_STATUS_SUCCESS) || !temp_Ptr) {
PRINTM(MERROR,
"Error: vmalloc buffer failed!!!\n");
goto done;
}
moal_memcpy_ext(phandle, temp_Ptr,
pmem_type_mapping_tbl->mem_Ptr,
memory_size,
memory_size + 0x4000);
memory_size + 0x2000);
moal_vfree(phandle,
pmem_type_mapping_tbl->mem_Ptr);
pmem_type_mapping_tbl->mem_Ptr = temp_Ptr;
temp_Ptr = NULL;
dbg_ptr = pmem_type_mapping_tbl->mem_Ptr +
memory_size;
memory_size += 0x4000;
memory_size += 0x2000;
end_ptr = pmem_type_mapping_tbl->mem_Ptr +
memory_size;
}
@ -2331,6 +2334,9 @@ static void woal_sdiommc_dump_fw_info(moal_handle *phandle)
PRINTM(MERROR, "Could not dump firmwware info\n");
return;
}
/** cancel all pending commands */
mlan_ioctl(phandle->pmlan_adapter, NULL);
mlan_pm_wakeup_card(phandle->pmlan_adapter, MTRUE);
phandle->fw_dump = MTRUE;
if (phandle->card_info->dump_fw_info == DUMP_FW_SDIO_V2) {
@ -2350,9 +2356,11 @@ static void woal_sdiommc_dump_fw_info(moal_handle *phandle)
woal_dump_firmware_info(phandle);
}
#endif
phandle->fw_dump = MFALSE;
if (!phandle->priv_num)
return;
woal_send_fw_dump_complete_event(
woal_get_priv(phandle, MLAN_BSS_ROLE_ANY));
phandle->fw_dump = MFALSE;
mlan_pm_wakeup_card(phandle->pmlan_adapter, MFALSE);
queue_work(phandle->workqueue, &phandle->main_work);
woal_process_hang(phandle);
@ -2471,11 +2479,14 @@ void woal_sdio_reset_hw(moal_handle *handle)
sdio_claim_host(func);
sdio_release_irq(card->func);
sdio_disable_func(card->func);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
mmc_hw_reset(func->card);
#else
mmc_hw_reset(func->card->host);
#endif
#endif
#ifdef MMC_QUIRK_BLKSZ_FOR_BYTE_MODE
/* The byte mode patch is available in kernel MMC driver
* which fixes one issue in MP-A transfer.

View file

@ -97,6 +97,9 @@ mlan_status moal_malloc(t_void *pmoal, t_u32 size, t_u32 flag, t_u8 **ppbuf)
GFP_ATOMIC :
GFP_KERNEL;
if (flag & MLAN_MEM_FLAG_ATOMIC)
mem_flag = GFP_ATOMIC;
#ifdef USB
if (!IS_USB(handle->card_type))
#endif
@ -1679,6 +1682,11 @@ mlan_status moal_recv_amsdu_packet(t_void *pmoal, pmlan_buffer pmbuf)
t_u32 in_ts_usec = 0;
ENTER();
if (!pmbuf) {
PRINTM(MERROR, "%s: pmbuf is null\n", __func__);
goto done;
}
memset(&mbuf, 0, sizeof(mlan_buffer));
mbuf.bss_index = pmbuf->bss_index;
@ -1706,7 +1714,7 @@ mlan_status moal_recv_amsdu_packet(t_void *pmoal, pmlan_buffer pmbuf)
woal_get_monotonic_time(&t1);
in_ts_sec = t1.time_sec;
in_ts_usec = t1.time_usec;
if (pmbuf && pmbuf->in_ts_sec) {
if (pmbuf->in_ts_sec) {
pmbuf->out_ts_sec = t1.time_sec;
pmbuf->out_ts_usec = t1.time_usec;
}
@ -1802,7 +1810,7 @@ mlan_status moal_recv_amsdu_packet(t_void *pmoal, pmlan_buffer pmbuf)
}
}
if (handle->tp_acnt.on) {
if (pmbuf && pmbuf->in_ts_sec)
if (pmbuf->in_ts_sec)
moal_tp_accounting(handle, pmbuf, RX_TIME_PKT);
woal_get_monotonic_time(&t2);
@ -2186,8 +2194,8 @@ int woal_check_media_connected(t_void *pmoal)
int i;
moal_handle *pmhandle = (moal_handle *)pmoal;
moal_private *pmpriv = NULL;
for (i = 0; i < pmhandle->priv_num && (pmpriv = pmhandle->priv[i]);
i++) {
for (i = 0; i < pmhandle->priv_num; i++) {
pmpriv = pmhandle->priv[i];
if (!pmpriv)
continue;
if (pmpriv->media_connected == MTRUE) {
@ -2320,12 +2328,18 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
chan_band_info *pchan_info = NULL;
#endif
t_u8 radar_detected;
t_u8 bandwidth;
t_u8 event_buf[64];
t_u8 radar_chan;
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
moal_private *cfg_priv = NULL;
#endif
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
#ifdef UAP_CFG80211
unsigned long wait_time, wait_time_ms, timeout;
#endif
#endif
t_u8 auto_fw_dump = MFALSE;
@ -2338,6 +2352,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
}
woal_store_firmware_dump(pmoal, pmevent);
handle->driver_status = MTRUE;
wifi_status = WIFI_STATUS_FW_DUMP;
ref_handle = (moal_handle *)handle->pref_mac;
if (ref_handle)
ref_handle->driver_status = MTRUE;
@ -2473,6 +2488,9 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
&priv->phandle->scan_req_lock,
flags);
if (priv->phandle->scan_request) {
cancel_delayed_work(
&priv->phandle
->scan_timeout_work);
woal_cfg80211_scan_done(
priv->phandle
->scan_request,
@ -2594,11 +2612,20 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
#endif
#ifdef REASSOCIATION
if (priv->reassoc_on == MTRUE) {
PRINTM(MINFO, "Reassoc: trigger the timer\n");
priv->reassoc_required = MTRUE;
priv->phandle->is_reassoc_timer_set = MTRUE;
woal_mod_timer(&priv->phandle->reassoc_timer,
REASSOC_TIMER_DEFAULT);
if (priv->auto_assoc_priv.auto_assoc_type_on &
(0x1 << (AUTO_ASSOC_TYPE_DRV_RECONN - 1))) {
PRINTM(MINFO,
" auto assoc: trigger driver auto re-connect\n");
priv->auto_assoc_priv.auto_assoc_trigger_flag =
AUTO_ASSOC_TYPE_DRV_RECONN;
priv->auto_assoc_priv.drv_reconnect.status =
MTRUE;
PRINTM(MINFO, "Reassoc: trigger the timer\n");
priv->reassoc_required = MTRUE;
priv->phandle->is_reassoc_timer_set = MTRUE;
woal_mod_timer(&priv->phandle->reassoc_timer,
REASSOC_TIMER_DEFAULT);
}
} else {
priv->rate_index = AUTO_RATE;
}
@ -2906,13 +2933,15 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
ref_handle = (moal_handle *)priv->phandle->pref_mac;
if (ref_handle)
ref_handle->driver_status = MTRUE;
#ifdef DEBUG_LEVEL1
if (drvdbg & MFW_D)
auto_fw_dump = MTRUE;
#endif
woal_moal_debug_info(priv, NULL, MFALSE);
if (!auto_fw_dump && !handle->fw_dump)
woal_process_hang(priv->phandle);
wifi_status = 2;
wifi_status = WIFI_STATUS_WIFI_HANG;
break;
case MLAN_EVENT_ID_DRV_WIFI_STATUS:
wifi_status = *(t_u16 *)(pmevent->event_buf + sizeof(t_u32));
@ -3012,6 +3041,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
case MLAN_EVENT_ID_FW_CHANNEL_REPORT_RDY:
radar_detected = pmevent->event_buf[0];
bandwidth = pmevent->event_buf[2];
#ifdef UAP_SUPPORT
if (priv->chan_rpt_req.chanNum && priv->chan_rpt_pending) {
radar_chan = pmevent->event_buf[1];
@ -3041,17 +3071,38 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
break;
if (priv->chan_rpt_req.chanNum && priv->chan_rpt_pending) {
priv->chan_rpt_pending = MFALSE;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
if (priv->radar_background) {
PRINTM(MEVENT,
"%s radar found when background CAC \n",
radar_detected ? "" : "No");
if (radar_detected)
cfg80211_background_radar_event(
priv->phandle->wiphy,
&priv->radar_background_chan,
GFP_ATOMIC);
break;
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg_priv = woal_get_priv_with_wdev(priv->phandle);
if (cfg_priv) {
if (radar_detected)
woal_update_channel_dfs_state(
woal_update_channels_dfs_state(
cfg_priv,
priv->chan_rpt_req.chanNum,
priv->chan_rpt_req.bandcfg
.chanWidth,
DFS_UNAVAILABLE);
else
woal_update_channel_dfs_state(
woal_update_channels_dfs_state(
cfg_priv,
priv->chan_rpt_req.chanNum,
priv->chan_rpt_req.bandcfg
.chanWidth,
DFS_AVAILABLE);
}
#endif
break;
}
@ -3077,6 +3128,34 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
&priv->phandle->dfs_channel,
GFP_KERNEL);
} else {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
if (!priv->user_cac_period_msec) {
// host and device timer isn't sync,add
// delay to avoid kernel warning
// WARN_ON(!time_after_eq(jiffies,
// timeout)); mdelay(100); Using
// optimized delay
timeout =
(priv->wdev->cac_start_time +
msecs_to_jiffies(
priv->wdev
->cac_time_ms));
if (!time_after_eq(jiffies, timeout)) {
/* Exact time to make host and
* device timer in sync */
wait_time = timeout - jiffies;
wait_time_ms =
jiffies_to_msecs(
wait_time) +
3;
PRINTM(MEVENT,
"Waiting for %ld ms for syncing\n",
wait_time_ms);
mdelay(wait_time_ms);
}
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev,
&priv->phandle->dfs_channel,
@ -3097,6 +3176,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
break;
case MLAN_EVENT_ID_FW_RADAR_DETECTED:
radar_chan = pmevent->event_buf[0];
bandwidth = pmevent->event_buf[1];
snprintf(event_buf, sizeof(event_buf) - 1, "%s %d",
CUS_EVT_RADAR_DETECTED, radar_chan);
woal_broadcast_event(priv, event_buf, strlen(event_buf));
@ -3106,27 +3186,35 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
if (!IS_STA_OR_UAP_CFG80211(cfg80211_wext))
break;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
if (priv->radar_background) {
cfg80211_background_radar_event(
priv->phandle->wiphy,
&priv->radar_background_chan, GFP_ATOMIC);
break;
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg_priv = woal_get_priv_with_wdev(priv->phandle);
if (cfg_priv) {
woal_update_channel_dfs_state(radar_chan,
DFS_UNAVAILABLE);
if (cfg_priv)
woal_update_channels_dfs_state(cfg_priv, radar_chan,
bandwidth,
DFS_UNAVAILABLE);
#endif
#ifdef UAP_SUPPORT
if ((priv->target_chan && priv->bss_started &&
(priv->target_chan != radar_chan)) ||
priv->backup_chan) {
PRINTM(MEVENT,
"Move to target or backup chan %d %d\n",
priv->target_chan, priv->backup_chan);
woal_move_to_next_channel(priv);
priv->target_chan = 0;
break;
}
if (priv->bss_type == MLAN_BSS_TYPE_DFS) {
woal_chan_event(priv, WOAL_EVENT_RADAR,
priv->chan_rpt_req.chanNum,
MTRUE);
break;
}
if ((priv->target_chan && priv->bss_started &&
(priv->target_chan != radar_chan)) ||
priv->backup_chan) {
PRINTM(MEVENT, "Move to target or backup chan %d %d\n",
priv->target_chan, priv->backup_chan);
woal_move_to_next_channel(priv);
priv->target_chan = 0;
break;
}
if (priv->bss_type == MLAN_BSS_TYPE_DFS) {
woal_chan_event(priv, WOAL_EVENT_RADAR,
priv->chan_rpt_req.chanNum, MTRUE);
break;
}
#endif
if (priv->phandle->is_cac_timer_set) {
@ -3145,10 +3233,9 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
NL80211_RADAR_CAC_ABORTED,
GFP_KERNEL);
#else
cfg80211_cac_event(
priv->netdev,
NL80211_RADAR_CAC_ABORTED,
GFP_KERNEL);
cfg80211_cac_event(priv->netdev,
NL80211_RADAR_CAC_ABORTED,
GFP_KERNEL);
#endif
cfg80211_radar_event(
priv->wdev->wiphy,
@ -3229,7 +3316,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
pchan_info->bandcfg.chanBand,
pchan_info->bandcfg.chanWidth,
pchan_info->bandcfg.chan2Offset);
woal_cfg80211_notify_channel(priv, pchan_info);
woal_channel_switch_event(priv, pchan_info);
}
#endif
}
@ -3367,7 +3454,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
PRINTM(MMSG,
"Channel Under Nop: notify cfg80211 new channel=%d\n",
priv->channel);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0);
#else
cfg80211_ch_switch_notify(priv->netdev, &priv->chan);
@ -3438,6 +3525,15 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
if (priv->host_mlme &&
(priv->auth_flag & HOST_MLME_AUTH_PENDING)) {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
if (priv->assoc_bss) {
PRINTM(MEVENT,
"wlan: HostMlme auth timeout\n");
cfg80211_auth_timeout(
priv->netdev,
priv->assoc_bss->bssid);
}
#endif
priv->auth_flag = 0;
priv->host_mlme = MFALSE;
priv->auth_alg = 0xFFFF;
@ -3692,7 +3788,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
PRINTM(MEVENT,
"HostMlme %s: Receive deauth/disassociate\n",
priv->netdev->name);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
if (!priv->wdev->connected) {
#else
if (!priv->wdev->current_bss) {
@ -4066,7 +4162,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
roam_info =
kzalloc(sizeof(struct cfg80211_roam_info), GFP_ATOMIC);
if (roam_info) {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
roam_info->links[0].bssid = priv->cfg_bssid;
#else
roam_info->bssid = priv->cfg_bssid;

View file

@ -103,7 +103,7 @@ static int woal_cfg80211_dump_survey(struct wiphy *wiphy,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static int woal_cfg80211_get_channel(struct wiphy *wiphy,
struct wireless_dev *wdev,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
unsigned int link_id,
#endif
struct cfg80211_chan_def *chandef);
@ -279,6 +279,13 @@ static int woal_cfg80211_disassociate(struct wiphy *wiphy,
struct cfg80211_disassoc_request *req);
#endif
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
int woal_cfg80211_set_radar_background(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef);
#endif
#endif
/** cfg80211 operations */
static struct cfg80211_ops woal_cfg80211_ops = {
.change_virtual_intf = woal_cfg80211_change_virtual_intf,
@ -502,7 +509,7 @@ static const struct ieee80211_txrx_stypes
// clang-format on
#endif
#if CFG80211_VERSION_CODE > KERNEL_VERSION(3, 0, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
/**
* NOTE: types in all the sets must be equals to the
* initial value of wiphy->interface_modes
@ -923,7 +930,13 @@ static int woal_cfg80211_assoc_ies_cfg(moal_private *priv, t_u8 *ie, int ie_len,
sizeof(pvendor_ie->vend_hdr.oui)) &&
(pvendor_ie->vend_hdr.oui_type == wps_oui[3])) {
PRINTM(MIOCTL, "Enable WPS session\n");
woal_wps_cfg(priv, MTRUE);
if (woal_wps_cfg(priv, MTRUE)) {
PRINTM(MERROR,
"%s: Enable WPS session failed\n",
__func__);
ret = -EFAULT;
goto done;
}
}
if (!memcmp(pvendor_ie->vend_hdr.oui, hs20_oui,
@ -1906,7 +1919,7 @@ static void woal_save_assoc_params(moal_private *priv,
req->bss->bssid, MLAN_MAC_ADDR_LENGTH,
MLAN_MAC_ADDR_LENGTH);
if (req->ie && req->ie_len) {
priv->sme_current.ie = kzalloc(req->ie_len, GFP_KERNEL);
priv->sme_current.ie = kzalloc(req->ie_len, GFP_ATOMIC);
priv->sme_current.ie_len = req->ie_len;
moal_memcpy_ext(priv->phandle, (void *)priv->sme_current.ie,
req->ie, req->ie_len, priv->sme_current.ie_len);
@ -1931,6 +1944,7 @@ static void woal_save_assoc_params(moal_private *priv,
#endif
if (ssid_bssid && ssid_bssid->ssid.ssid_len) {
priv->sme_current.ssid = priv->conn_ssid;
priv->sme_current.ssid_len = ssid_bssid->ssid.ssid_len;
memset(priv->conn_ssid, 0, MLAN_MAX_SSID_LENGTH);
moal_memcpy_ext(priv->phandle, (void *)priv->sme_current.ssid,
ssid_bssid->ssid.ssid,
@ -1952,6 +1966,7 @@ static void woal_save_auth_params(moal_private *priv,
{
ENTER();
woal_clear_conn_params(priv);
priv->assoc_bss = req->bss;
priv->sme_current.auth_type = req->auth_type;
priv->sme_current.key_idx = req->key_idx;
priv->sme_current.key_len = req->key_len;
@ -2401,8 +2416,7 @@ static int woal_cfg80211_authenticate(struct wiphy *wiphy,
dev->name, MAC2STR(req->bss->bssid));
DBG_HEXDUMP(MDAT_D, "Auth:", pmbuf->pbuf + pmbuf->data_offset,
pmbuf->data_len);
if (priv->bss_type == MLAN_BSS_TYPE_STA)
woal_save_auth_params(priv, req);
woal_save_auth_params(priv, req);
status = mlan_send_packet(priv->phandle->pmlan_adapter, pmbuf);
switch (status) {
@ -2484,7 +2498,7 @@ void woal_host_mlme_process_assoc_resp(moal_private *priv,
struct cfg80211_bss *bss = NULL;
unsigned long flags;
u8 *assoc_req_buf = NULL;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
struct cfg80211_rx_assoc_resp resp = {
.uapsd_queues = -1,
};
@ -2528,10 +2542,7 @@ void woal_host_mlme_process_assoc_resp(moal_private *priv,
WLAN_STATUS_SUCCESS) {
memset(priv->cfg_bssid, 0,
ETH_ALEN);
if (priv->bss_type ==
MLAN_BSS_TYPE_STA)
woal_clear_conn_params(
priv);
woal_clear_conn_params(priv);
} else {
priv->cfg_disconnect = MFALSE;
}
@ -2545,14 +2556,16 @@ void woal_host_mlme_process_assoc_resp(moal_private *priv,
assoc_info
->assoc_req_buf;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
resp.links[0].bss = bss;
resp.buf = assoc_info->assoc_resp_buf;
resp.len = assoc_info->assoc_resp_len;
resp.req_ies = assoc_req_buf;
resp.req_ies_len = assoc_info->assoc_req_len;
resp.req_ies_len =
assoc_info->assoc_req_len;
mutex_lock(&priv->wdev->mtx);
cfg80211_rx_assoc_resp(priv->netdev, &resp);
cfg80211_rx_assoc_resp(priv->netdev,
&resp);
mutex_unlock(&priv->wdev->mtx);
#else
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
@ -2691,6 +2704,7 @@ static int woal_cfg80211_associate(struct wiphy *wiphy, struct net_device *dev,
}
if (priv->auth_flag && !(priv->auth_flag & HOST_MLME_AUTH_DONE)) {
kfree(ssid_bssid);
LEAVE();
return -EBUSY;
}
@ -2814,12 +2828,9 @@ done:
if (!ret) {
priv->rssi_low = DEFAULT_RSSI_LOW_THRESHOLD;
if (priv->bss_type == MLAN_BSS_TYPE_STA
#ifdef WIFI_DIRECT_SUPPORT
|| priv->bss_type == MLAN_BSS_TYPE_WIFIDIRECT
#endif
)
woal_save_assoc_params(priv, req, ssid_bssid);
woal_save_assoc_params(priv, req, ssid_bssid);
memset(&bss_info, 0, sizeof(bss_info));
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
priv->channel = bss_info.bss_chan;
@ -2849,8 +2860,7 @@ done:
ssid_bssid->assoc_rsp.assoc_resp_len = 0;
ret = -EFAULT;
memset(priv->cfg_bssid, 0, ETH_ALEN);
if (priv->bss_type == MLAN_BSS_TYPE_STA)
woal_clear_conn_params(priv);
woal_clear_conn_params(priv);
}
priv->host_mlme = MFALSE;
priv->auth_flag = 0;
@ -4207,13 +4217,33 @@ static mlan_status woal_uap_scan(moal_private *priv,
return MLAN_STATUS_FAILURE;
}
role = GET_BSS_ROLE(tmp_priv);
if (role == MLAN_BSS_ROLE_UAP)
woal_role_switch(tmp_priv, MOAL_IOCTL_WAIT, MLAN_BSS_ROLE_STA);
if (role == MLAN_BSS_ROLE_UAP) {
if (MLAN_STATUS_SUCCESS !=
woal_role_switch(tmp_priv, MOAL_IOCTL_WAIT,
MLAN_BSS_ROLE_STA)) {
PRINTM(MERROR, "role switch from uap to sta fail\n");
LEAVE();
return MLAN_STATUS_FAILURE;
}
}
if (tmp_priv != priv) {
woal_setget_bandcfg(priv, MLAN_ACT_GET, &bandcfg);
woal_setget_bandcfg(tmp_priv, MLAN_ACT_GET, &org_bandcfg);
if (woal_setget_bandcfg(priv, MLAN_ACT_GET, &bandcfg)) {
PRINTM(MERROR, "get bandcfg fail\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
if (woal_setget_bandcfg(tmp_priv, MLAN_ACT_GET, &org_bandcfg)) {
PRINTM(MERROR, "get bandcfg fail\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
if (bandcfg.config_bands != org_bandcfg.config_bands) {
woal_setget_bandcfg(tmp_priv, MLAN_ACT_SET, &bandcfg);
if (woal_setget_bandcfg(tmp_priv, MLAN_ACT_SET,
&bandcfg)) {
PRINTM(MERROR, "set bandcfg fail\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
band_change = MTRUE;
}
}
@ -4228,12 +4258,22 @@ static mlan_status woal_uap_scan(moal_private *priv,
woal_sched_timeout(5);
#ifdef REASSOCIATION
MOAL_REL_SEMAPHORE(&handle->reassoc_sem);
done:
#endif
if (role == MLAN_BSS_ROLE_UAP)
woal_role_switch(tmp_priv, MOAL_IOCTL_WAIT, MLAN_BSS_ROLE_UAP);
if (band_change)
woal_setget_bandcfg(tmp_priv, MLAN_ACT_SET, &org_bandcfg);
done:
if (role == MLAN_BSS_ROLE_UAP) {
if (MLAN_STATUS_SUCCESS !=
woal_role_switch(tmp_priv, MOAL_IOCTL_WAIT,
MLAN_BSS_ROLE_UAP)) {
PRINTM(MERROR, "role switch back to uap fail\n");
ret = MLAN_STATUS_FAILURE;
}
}
if (band_change) {
if (woal_setget_bandcfg(tmp_priv, MLAN_ACT_SET, &org_bandcfg)) {
PRINTM(MERROR, "restore bandcfg fail\n");
ret = MLAN_STATUS_FAILURE;
}
}
LEAVE();
return ret;
}
@ -4405,12 +4445,13 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev,
#endif
#endif
#endif
cancel_delayed_work(&priv->phandle->scan_timeout_work);
priv->phandle->fake_scan_complete = priv->fake_scan_complete;
if (priv->fake_scan_complete) {
PRINTM(MEVENT,
"scan result not expired or fake scan complete flag is on\n");
PRINTM(MEVENT, "fake scan complete flag is on\n");
priv->phandle->scan_request = request;
queue_delayed_work(priv->phandle->evt_workqueue,
&priv->scan_deferred_work,
&priv->phandle->scan_timeout_work,
msecs_to_jiffies(1000));
return ret;
}
@ -4441,6 +4482,11 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev,
priv->phandle->scan_time_start.time_usec);
}
scan_req = kmalloc(sizeof(wlan_user_scan_cfg), GFP_KERNEL);
if (!scan_req) {
PRINTM(MERROR, "Failed to alloc memory for scan_req\n");
LEAVE();
return -ENOMEM;
}
memset(scan_req, 0x00, sizeof(wlan_user_scan_cfg));
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
if (!is_broadcast_ether_addr(request->bssid)) {
@ -4472,6 +4518,7 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev,
if (scan_req->scan_chan_gap && priv->phandle->pref_mac)
scan_req->scan_chan_gap |= GAP_FLAG_OPTIONAL;
scan_req->scan_cfg_only = MTRUE;
if (scan_cfg.ext_scan == 3)
scan_req->ext_scan_type = EXT_SCAN_ENHANCE;
@ -4576,11 +4623,17 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev,
}
} else {
/** Clear SCAN IE in Firmware */
if (priv->probereq_index != MLAN_CUSTOM_IE_AUTO_IDX_MASK)
woal_cfg80211_mgmt_frame_ie(priv, NULL, 0, NULL, 0,
NULL, 0, NULL, 0,
MGMT_MASK_PROBE_REQ,
MOAL_IOCTL_WAIT);
if (priv->probereq_index != MLAN_CUSTOM_IE_AUTO_IDX_MASK) {
if (MLAN_STATUS_SUCCESS !=
woal_cfg80211_mgmt_frame_ie(
priv, NULL, 0, NULL, 0, NULL, 0, NULL, 0,
MGMT_MASK_PROBE_REQ, MOAL_IOCTL_WAIT)) {
PRINTM(MERROR,
"Fail to clear scan request IE\n");
ret = -EFAULT;
goto done;
}
}
}
#ifdef UAP_CFG80211
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) {
@ -4615,7 +4668,9 @@ static int woal_cfg80211_scan(struct wiphy *wiphy, struct net_device *dev,
PRINTM(MCMND, "wlan:random_mac " MACSTR "\n",
MAC2STR(scan_req->random_mac));
scan_req->keep_previous_scan = wlan_check_scan_table_ageout(priv);
if (priv->phandle->params.keep_previous_scan)
scan_req->keep_previous_scan =
wlan_check_scan_table_ageout(priv);
if (MLAN_STATUS_SUCCESS != woal_do_scan(priv, scan_req)) {
PRINTM(MERROR, "woal_do_scan fails!\n");
@ -4629,8 +4684,13 @@ done:
priv->phandle->scan_request = NULL;
priv->phandle->scan_priv = NULL;
spin_unlock_irqrestore(&priv->phandle->scan_req_lock, flags);
} else
} else {
PRINTM(MMSG, "wlan: %s START SCAN\n", dev->name);
queue_delayed_work(
priv->phandle->evt_workqueue,
&priv->phandle->scan_timeout_work,
msecs_to_jiffies(priv->phandle->scan_timeout));
}
kfree(scan_req);
LEAVE();
return ret;
@ -5099,6 +5159,7 @@ static int woal_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
"wlan: already connected with other interface, bssid " MACSTR
"\n",
MAC2STR(handle->priv[i]->cfg_bssid));
kfree(ssid_bssid);
LEAVE();
return -EINVAL;
}
@ -5126,6 +5187,7 @@ static int woal_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
"Init p2p client for wpa_supplicant failed.\n");
ret = -EFAULT;
kfree(ssid_bssid);
LEAVE();
return ret;
}
@ -5186,8 +5248,7 @@ static int woal_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
if (!ret) {
passoc_rsp = (IEEEtypes_AssocRsp_t *)assoc_rsp->assoc_resp_buf;
priv->rssi_low = DEFAULT_RSSI_LOW_THRESHOLD;
if (priv->bss_type == MLAN_BSS_TYPE_STA)
woal_save_conn_params(priv, sme);
woal_save_conn_params(priv, sme);
memset(&bss_info, 0, sizeof(bss_info));
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
priv->channel = bss_info.bss_chan;
@ -5319,7 +5380,7 @@ static int woal_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
if (priv->media_connected == MFALSE) {
PRINTM(MMSG, " Already disconnected\n");
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
if (priv->wdev->connected &&
#else
if (priv->wdev->current_bss &&
@ -5365,8 +5426,7 @@ static int woal_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
#endif
memset(priv->cfg_bssid, 0, ETH_ALEN);
if (priv->bss_type == MLAN_BSS_TYPE_STA)
woal_clear_conn_params(priv);
woal_clear_conn_params(priv);
priv->channel = 0;
LEAVE();
@ -5651,7 +5711,7 @@ done:
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static int woal_cfg80211_get_channel(struct wiphy *wiphy,
struct wireless_dev *wdev,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
unsigned int link_id,
#endif
struct cfg80211_chan_def *chandef)
@ -6359,11 +6419,16 @@ int woal_cfg80211_sched_scan_start(struct wiphy *wiphy, struct net_device *dev,
}
} else {
/** Clear SCAN IE in Firmware */
if (priv->probereq_index != MLAN_CUSTOM_IE_AUTO_IDX_MASK)
woal_cfg80211_mgmt_frame_ie(priv, NULL, 0, NULL, 0,
NULL, 0, NULL, 0,
MGMT_MASK_PROBE_REQ,
MOAL_IOCTL_WAIT);
if (priv->probereq_index != MLAN_CUSTOM_IE_AUTO_IDX_MASK) {
if (MLAN_STATUS_SUCCESS !=
woal_cfg80211_mgmt_frame_ie(
priv, NULL, 0, NULL, 0, NULL, 0, NULL, 0,
MGMT_MASK_PROBE_REQ, MOAL_IOCTL_WAIT)) {
PRINTM(MERROR, "Fail to clear sched scan IE\n");
ret = -EFAULT;
goto done;
}
}
}
/* Interval between scan cycles in milliseconds,supplicant set to 10
@ -6382,18 +6447,20 @@ int woal_cfg80211_sched_scan_start(struct wiphy *wiphy, struct net_device *dev,
priv->scan_cfg.config_ees = MTRUE;
priv->scan_cfg.ees_mode =
MBIT(EES_MODE_HIGH) | MBIT(EES_MODE_MID);
/*High scan interval in milliseconds*/
priv->scan_cfg.high_period =
request->scan_plans[0].interval * 1000;
priv->scan_cfg.high_period_count =
request->scan_plans[0].iterations;
priv->scan_cfg.mid_period =
request->scan_plans[1].interval * 1000;
/*Mid scan interval in seconds*/
priv->scan_cfg.mid_period = request->scan_plans[1].interval;
priv->scan_cfg.mid_period_count =
request->scan_plans[1].iterations;
if (request->n_scan_plans == 3) {
priv->scan_cfg.ees_mode |= MBIT(EES_MODE_LOW);
/*low scan interval in seconds*/
priv->scan_cfg.low_period =
request->scan_plans[2].interval * 1000;
request->scan_plans[2].interval;
priv->scan_cfg.low_period_count =
request->scan_plans[2].iterations;
}
@ -6544,8 +6611,12 @@ int woal_cfg80211_resume(struct wiphy *wiphy)
}
}
woal_get_wakeup_reason(priv, &wakeup_reason);
memset((t_u8 *)&wakeup_reason, 0, sizeof(wakeup_reason));
if (MLAN_STATUS_SUCCESS !=
woal_get_wakeup_reason(priv, &wakeup_reason)) {
PRINTM(MERROR, "%s: get_wakeup_reason failed \n", __func__);
goto done;
}
#ifdef STA_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
if (IS_STA_CFG80211(priv->phandle->params.cfg80211_wext))
@ -7366,8 +7437,12 @@ static int woal_construct_tdls_data_frame(moal_private *priv, t_u8 *peer,
switch (action_code) {
case WLAN_TDLS_SETUP_REQUEST:
setup_flag |= TDLS_IE_FLAGS_SETUP;
woal_tdls_get_ies(priv, peer, tdls_ies, setup_flag);
if (woal_tdls_get_ies(priv, peer, tdls_ies, setup_flag)) {
PRINTM(MERROR, "%s: woal_tdls_get_ies failed \n",
__func__);
ret = -EFAULT;
goto done;
}
tdata->category = WLAN_CATEGORY_TDLS;
tdata->action_code = WLAN_TDLS_SETUP_REQUEST;
skb_put(skb, sizeof(tdata->u.setup_req));
@ -7377,8 +7452,12 @@ static int woal_construct_tdls_data_frame(moal_private *priv, t_u8 *peer,
woal_add_ext_supported_rates_ie(priv, skb, band);
break;
case WLAN_TDLS_SETUP_RESPONSE:
woal_tdls_get_ies(priv, peer, tdls_ies, setup_flag);
if (woal_tdls_get_ies(priv, peer, tdls_ies, setup_flag)) {
PRINTM(MERROR, "%s: woal_tdls_get_ies failed \n",
__func__);
ret = -EFAULT;
goto done;
}
tdata->category = WLAN_CATEGORY_TDLS;
tdata->action_code = WLAN_TDLS_SETUP_RESPONSE;
@ -7391,8 +7470,12 @@ static int woal_construct_tdls_data_frame(moal_private *priv, t_u8 *peer,
woal_add_ext_supported_rates_ie(priv, skb, band);
break;
case WLAN_TDLS_SETUP_CONFIRM:
woal_tdls_get_ies(priv, peer, tdls_ies, confirm_flag);
if (woal_tdls_get_ies(priv, peer, tdls_ies, confirm_flag)) {
PRINTM(MERROR, "%s: woal_tdls_get_ies failed \n",
__func__);
ret = -EFAULT;
goto done;
}
tdata->category = WLAN_CATEGORY_TDLS;
tdata->action_code = WLAN_TDLS_SETUP_CONFIRM;
@ -7630,9 +7713,16 @@ static int woal_construct_tdls_action_frame(moal_private *priv, t_u8 *peer,
switch (action_code) {
case WLAN_PUB_ACTION_TDLS_DISCOVER_RES:
woal_tdls_get_ies(priv, peer, tdls_ies,
TDLS_IE_FLAGS_EXTCAP |
TDLS_IE_FLAGS_SUPP_CS_IE);
if (woal_tdls_get_ies(priv, peer, tdls_ies,
TDLS_IE_FLAGS_EXTCAP |
TDLS_IE_FLAGS_SUPP_CS_IE)) {
PRINTM(MERROR, "%s: woal_tdls_get_ies failed \n",
__func__);
if (tdls_ies)
kfree(tdls_ies);
LEAVE();
return -EFAULT;
}
skb_put(skb, 1 + sizeof(mgmt->u.action.u.tdls_discover_resp));
mgmt->u.action.category = WLAN_CATEGORY_PUBLIC;
mgmt->u.action.u.tdls_discover_resp.action_code =
@ -8531,7 +8621,7 @@ int woal_cfg80211_update_ft_ies(struct wiphy *wiphy, struct net_device *dev,
passoc_rsp = (IEEEtypes_AssocRsp_t *)
assoc_rsp->assoc_resp_buf;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
roam_info.links[0].bssid = priv->cfg_bssid;
#else
roam_info.bssid = priv->cfg_bssid;
@ -9003,7 +9093,7 @@ void woal_start_roaming(moal_private *priv)
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
roam_info.links[0].bssid = priv->cfg_bssid;
#else
roam_info.bssid = priv->cfg_bssid;
@ -9042,7 +9132,9 @@ done:
priv->last_event = 0;
priv->rssi_low = DEFAULT_RSSI_LOW_THRESHOLD;
sprintf(rssi_low, "%d", priv->rssi_low);
woal_set_rssi_low_threshold(priv, rssi_low, MOAL_IOCTL_WAIT);
if (MLAN_STATUS_FAILURE ==
woal_set_rssi_low_threshold(priv, rssi_low, MOAL_IOCTL_WAIT))
PRINTM(MERROR, "set_rssi_low_threshold fail\n");
LEAVE();
return;
}
@ -9082,11 +9174,10 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev,
if (params->ext_capab_len)
req_len += sizeof(MrvlIEtypesHeader_t) + params->ext_capab_len;
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
if (params->link_sta_params.supported_rates_len)
req_len += sizeof(MrvlIEtypesHeader_t) +
params->link_sta_params.supported_rates_len;
#else
if (params->supported_rates_len)
req_len += sizeof(MrvlIEtypesHeader_t) +
@ -9094,34 +9185,39 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev,
#endif
if (params->uapsd_queues || params->max_sp)
req_len += sizeof(MrvlIEtypesHeader_t) + sizeof(qosinfo);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
if (params->link_sta_params.ht_capa)
#else
if (params->ht_capa)
#endif
req_len += sizeof(MrvlIEtypesHeader_t) +
sizeof(struct ieee80211_ht_cap);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
if (params->link_sta_params.vht_capa)
#else
if (params->vht_capa)
#endif
req_len += sizeof(MrvlIEtypesHeader_t) +
sizeof(struct ieee80211_vht_cap);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
if (params->link_sta_params.opmode_notif_used)
req_len += sizeof(MrvlIEtypesHeader_t) + sizeof(u8);
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#else
if (params->opmode_notif_used)
req_len += sizeof(MrvlIEtypesHeader_t) + sizeof(u8);
#endif
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
if (params->link_sta_params.he_capa_len)
req_len += sizeof(MrvlExtIEtypesHeader_t) + params->link_sta_params.he_capa_len;
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
req_len += sizeof(MrvlExtIEtypesHeader_t) +
params->link_sta_params.he_capa_len;
#else
if (params->he_capa_len)
req_len += sizeof(MrvlExtIEtypesHeader_t) + params->he_capa_len;
#endif
#endif
req = woal_alloc_mlan_ioctl_req(req_len);
if (req == NULL) {
@ -9169,21 +9265,22 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev,
tlv = (MrvlIEtypes_Data_t *)pos;
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
if (params->link_sta_params.supported_rates_len) {
#else
if (params->supported_rates_len) {
#endif
tlv = (MrvlIEtypes_Data_t *)pos;
tlv->header.type = SUPPORTED_RATES;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
tlv->header.len = params->link_sta_params.supported_rates_len;
#else
tlv->header.len = params->supported_rates_len;
#endif
moal_memcpy_ext(priv->phandle, tlv->data,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
params->link_sta_params.supported_rates, tlv->header.len,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
params->link_sta_params.supported_rates,
tlv->header.len,
#else
params->supported_rates, tlv->header.len,
#endif
@ -9205,7 +9302,7 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev,
sizeof(MrvlIEtypesHeader_t) + tlv->header.len;
tlv = (MrvlIEtypes_Data_t *)pos;
}
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
if (params->link_sta_params.ht_capa) {
#else
if (params->ht_capa) {
@ -9213,8 +9310,9 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev,
tlv = (MrvlIEtypes_Data_t *)pos;
tlv->header.type = HT_CAPABILITY;
tlv->header.len = sizeof(struct ieee80211_ht_cap);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
moal_memcpy_ext(priv->phandle, tlv->data, params->link_sta_params.ht_capa,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
moal_memcpy_ext(priv->phandle, tlv->data,
params->link_sta_params.ht_capa,
#else
moal_memcpy_ext(priv->phandle, tlv->data, params->ht_capa,
#endif
@ -9224,7 +9322,7 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev,
sizeof(MrvlIEtypesHeader_t) + tlv->header.len;
tlv = (MrvlIEtypes_Data_t *)pos;
}
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
if (params->link_sta_params.vht_capa) {
#else
if (params->vht_capa) {
@ -9232,8 +9330,9 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev,
tlv = (MrvlIEtypes_Data_t *)pos;
tlv->header.type = VHT_CAPABILITY;
tlv->header.len = sizeof(struct ieee80211_vht_cap);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
moal_memcpy_ext(priv->phandle, tlv->data, params->link_sta_params.vht_capa,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
moal_memcpy_ext(priv->phandle, tlv->data,
params->link_sta_params.vht_capa,
#else
moal_memcpy_ext(priv->phandle, tlv->data, params->vht_capa,
#endif
@ -9244,7 +9343,7 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev,
tlv = (MrvlIEtypes_Data_t *)pos;
}
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
if (params->link_sta_params.opmode_notif_used) {
#else
if (params->opmode_notif_used) {
@ -9252,8 +9351,9 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev,
tlv = (MrvlIEtypes_Data_t *)pos;
tlv->header.type = OPER_MODE_NTF;
tlv->header.len = sizeof(u8);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
moal_memcpy_ext(priv->phandle, tlv->data, &params->link_sta_params.opmode_notif,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
moal_memcpy_ext(priv->phandle, tlv->data,
&params->link_sta_params.opmode_notif,
#else
moal_memcpy_ext(priv->phandle, tlv->data, &params->opmode_notif,
#endif
@ -9264,18 +9364,22 @@ int woal_cfg80211_uap_add_station(struct wiphy *wiphy, struct net_device *dev,
tlv = (MrvlIEtypes_Data_t *)pos;
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
if (params->link_sta_params.he_capa_len) {
ext_tlv = (MrvlExtIEtypes_Data_t *)pos;
ext_tlv->header.type = EXTENSION;
ext_tlv->header.len = params->link_sta_params.he_capa_len + sizeof(u8);
ext_tlv->header.len =
params->link_sta_params.he_capa_len + sizeof(u8);
ext_tlv->header.ext_id = HE_CAPABILITY;
moal_memcpy_ext(priv->phandle, ext_tlv->data,
(u8 *)params->link_sta_params.he_capa, params->link_sta_params.he_capa_len,
(u8 *)params->link_sta_params.he_capa,
params->link_sta_params.he_capa_len,
params->link_sta_params.he_capa_len);
pos += sizeof(MrvlExtIEtypesHeader_t) + params->link_sta_params.he_capa_len;
pos += sizeof(MrvlExtIEtypesHeader_t) +
params->link_sta_params.he_capa_len;
bss->param.sta_info.tlv_len +=
sizeof(MrvlExtIEtypesHeader_t) + params->link_sta_params.he_capa_len;
sizeof(MrvlExtIEtypesHeader_t) +
params->link_sta_params.he_capa_len;
tlv = (MrvlIEtypes_Data_t *)pos;
}
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
@ -9604,7 +9708,13 @@ static mlan_status woal_cfg80211_init_wiphy(moal_private *priv,
ret = woal_request_ioctl(priv, req, wait_option);
if (ret != MLAN_STATUS_SUCCESS)
goto done;
/* Set available antennas to wiphy */
/* Set available antennas to wiphy */
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
if (priv->phandle->params.drv_mode & DRV_MODE_DFS) {
radio->param.ant_cfg.tx_antenna = 0x101;
radio->param.ant_cfg.rx_antenna = 0x101;
}
#endif
if (IS_CARD9098(priv->phandle->card_type) ||
IS_CARD9097(priv->phandle->card_type)) {
woal_cfg80211_notify_antcfg(priv, wiphy, radio);
@ -9976,7 +10086,16 @@ mlan_status woal_register_cfg80211(moal_private *priv)
wiphy, NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT);
}
#endif
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
if (priv->phandle->params.drv_mode & DRV_MODE_DFS) {
wiphy_ext_feature_set(wiphy,
NL80211_EXT_FEATURE_RADAR_BACKGROUND);
woal_cfg80211_ops.set_radar_background =
woal_cfg80211_set_radar_background;
}
#endif
#endif
/* Set struct moal_handle pointer in wiphy_priv */
wdev_priv = wiphy_priv(wiphy);
*(unsigned long *)wdev_priv = (unsigned long)priv->phandle;

View file

@ -834,6 +834,7 @@ static int woal_uap_snmp_mib(struct net_device *dev, struct ifreq *req)
snmp->sub_command = MLAN_OID_SNMP_MIB_DOT11H;
break;
default:
ret = -EINVAL;
PRINTM(MERROR, "%s: Unsupported SNMP_MIB OID (%d).\n", __func__,
param.oid);
goto done;
@ -889,14 +890,14 @@ static int woal_uap_domain_info(struct net_device *dev, struct ifreq *req)
mlan_ioctl_req *ioctl_req = NULL;
mlan_ds_11d_cfg *cfg11d = NULL;
domain_info_para param;
t_u8 tlv[MAX_DOMAIN_TLV_LEN];
t_u8 tlv[MAX_DOMAIN_TLV_LEN + MAX_REG_DOMAIN_TLV_LEN];
t_u16 tlv_data_len = 0;
int ret = 0;
mlan_status status = MLAN_STATUS_SUCCESS;
ENTER();
memset(&param, 0, sizeof(param));
memset(tlv, 0, MAX_DOMAIN_TLV_LEN);
memset(tlv, 0, MAX_DOMAIN_TLV_LEN + MAX_REG_DOMAIN_TLV_LEN);
/* Sanity check */
if (req->ifr_data == NULL) {
@ -921,6 +922,7 @@ static int woal_uap_domain_info(struct net_device *dev, struct ifreq *req)
goto done;
}
tlv_data_len = ((t_u16 *)(tlv))[1];
tlv_data_len += MAX_REG_DOMAIN_TLV_LEN;
if ((TLV_HEADER_LEN + tlv_data_len) > (int)sizeof(tlv)) {
PRINTM(MERROR, "TLV buffer is overflowed");
ret = -EINVAL;
@ -1080,8 +1082,6 @@ done:
return ret;
}
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
/**
* @brief uap channel NOP status check ioctl handler
*
@ -1135,8 +1135,6 @@ done:
LEAVE();
return ret;
}
#endif
#endif
/**
* @brief configure channel switch count
@ -2153,6 +2151,105 @@ done:
return ret;
}
/**
* @brief find all bonded channel.
*
* @param pri_chan primary channel
* @param bw channel bandwidth
* @param ch_dfs_state a pointer to mlan_ds_11h_chan_dfs_state array
*
* @return number of channel
*/
static int woal_uap_get_dfs_chan(t_u8 pri_chan, t_u8 bw,
mlan_ds_11h_chan_dfs_state *ch_dfs_state)
{
int ht40_plus[] = {52, 60, 100, 108, 116, 124, 132, 140};
int ht40_minus[] = {56, 64, 104, 112, 120, 128, 136, 144};
int vht80_dfs[4][4] = {{52, 56, 60, 64},
{100, 104, 108, 112},
{116, 120, 124, 128},
{132, 136, 140, 144}};
t_u8 find = false;
int i, j;
t_u8 sec_chan = 0;
mlan_ds_11h_chan_dfs_state *pos = ch_dfs_state;
t_u8 n_chan = 1;
if (bw == CHAN_BW_20MHZ) {
pos->channel = pri_chan;
} else if (bw == CHAN_BW_40MHZ) {
pos->channel = pri_chan;
pos++;
for (i = 0; i < (sizeof(ht40_minus) / sizeof(int)); i++) {
if (pri_chan == (t_u8)ht40_plus[i]) {
sec_chan = pri_chan + 4;
n_chan = 2;
break;
}
}
for (i = 0; i < (sizeof(ht40_minus) / sizeof(int)); i++) {
if (pri_chan == (t_u8)ht40_minus[i]) {
sec_chan = pri_chan - 4;
n_chan = 2;
break;
}
}
pos->channel = sec_chan;
} else if (bw == CHAN_BW_80MHZ) {
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
if (pri_chan == (t_u8)vht80_dfs[i][j]) {
find = true;
break;
}
}
if (find)
break;
}
if (find) {
n_chan = 4;
for (j = 0; j < n_chan; j++) {
pos->channel = (t_u8)vht80_dfs[i][j];
pos++;
}
}
}
return n_chan;
}
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
/**
* @brief update channel dfs state to all wiphy
*
* @param channel given radar channel
* @param bandwidth channel's bandwidth
* @param dfs_state dfs_state
*
* @return N/A
*/
void woal_update_channels_dfs_state(moal_private *priv, t_u8 channel,
t_u8 bandwidth, t_u8 dfs_state)
{
mlan_ds_11h_chan_dfs_state ch_dfs_state[4];
int cfg80211_wext = priv->phandle->params.cfg80211_wext;
t_u8 n_chan;
int i;
ENTER();
memset(ch_dfs_state, 0, sizeof(ch_dfs_state));
n_chan = woal_uap_get_dfs_chan(channel, bandwidth, &ch_dfs_state[0]);
if (IS_UAP_CFG80211(cfg80211_wext)) {
for (i = 0; i < n_chan; i++) {
woal_update_channel_dfs_state(ch_dfs_state[i].channel,
dfs_state);
}
}
LEAVE();
return;
}
#endif
#endif
/**
* @brief skip cac on specific channel
* @and Wext
@ -2173,7 +2270,9 @@ static int woal_uap_skip_cac(struct net_device *dev, struct ifreq *req)
#endif
#endif
dfs_state_t dfs_state;
mlan_ds_11h_chan_dfs_state ch_dfs_state;
mlan_ds_11h_chan_dfs_state ch_dfs_state[4];
t_u8 n_chan;
int i = 0;
ENTER();
/* Sanity check */
@ -2194,27 +2293,39 @@ static int woal_uap_skip_cac(struct net_device *dev, struct ifreq *req)
else
dfs_state = DFS_USABLE;
memset(&ch_dfs_state, 0, sizeof(ch_dfs_state));
ch_dfs_state.channel = param.channel;
woal_11h_chan_dfs_state(priv, MLAN_ACT_GET, &ch_dfs_state);
if (ch_dfs_state.dfs_state == dfs_state)
goto done;
if (param.skip_cac && ch_dfs_state.dfs_state == DFS_USABLE)
PRINTM(MMSG,
"DFS: Requst skip cac on the channel %d which hasn't do CAC before!\n",
param.channel);
ch_dfs_state.dfs_state = dfs_state;
woal_11h_chan_dfs_state(priv, MLAN_ACT_SET, &ch_dfs_state);
PRINTM(MCMND, "DFS: Skip CAC on chan %d %d\n", param.channel,
param.skip_cac);
n_chan = woal_uap_get_dfs_chan(param.channel, param.bw,
&ch_dfs_state[0]);
for (i = 0; i < n_chan; i++) {
if (woal_11h_chan_dfs_state(priv, MLAN_ACT_GET,
&ch_dfs_state[i]))
PRINTM(MERROR, "Get DFS state for chan:%d failed\n",
ch_dfs_state[i].channel);
}
for (i = 0; i < n_chan; i++) {
if (param.skip_cac && ch_dfs_state[i].dfs_state == DFS_USABLE)
PRINTM(MMSG,
"DFS: Requst skip cac on the channel %d which hasn't do CAC before!\n",
ch_dfs_state[i].channel);
ch_dfs_state[i].dfs_state = dfs_state;
if (woal_11h_chan_dfs_state(priv, MLAN_ACT_SET,
&ch_dfs_state[i]))
PRINTM(MERROR, "Set DFS state for chan:%d failed\n",
ch_dfs_state[i].channel);
else
PRINTM(MCMND, "DFS: Skip CAC on chan %d %d\n",
ch_dfs_state[i].channel, param.skip_cac);
}
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
if (IS_UAP_CFG80211(cfg80211_wext)) {
if (param.skip_cac)
woal_update_channel_dfs_state(param.channel,
DFS_AVAILABLE);
else
woal_update_channel_dfs_state(param.channel,
DFS_USABLE);
for (i = 0; i < n_chan; i++) {
if (param.skip_cac)
woal_update_channel_dfs_state(
ch_dfs_state[i].channel, DFS_AVAILABLE);
else
woal_update_channel_dfs_state(
ch_dfs_state[i].channel, DFS_USABLE);
}
}
#endif
#endif
@ -2791,8 +2902,8 @@ done:
*
* @return MLAN_STATUS_SUCCESS -- success, otherwise fail
*/
int woal_set_get_uap_power_mode(moal_private *priv, t_u32 action,
mlan_ds_ps_mgmt *ps_mgmt)
mlan_status woal_set_get_uap_power_mode(moal_private *priv, t_u32 action,
mlan_ds_ps_mgmt *ps_mgmt)
{
mlan_ioctl_req *ioctl_req = NULL;
mlan_ds_pm_cfg *pm_cfg = NULL;
@ -3192,8 +3303,10 @@ static mlan_status woal_enable_wapi(moal_private *priv, t_u8 enable)
"Set AP setting failed! status=%d, error_code=0x%x\n",
status, req->status_code);
}
if (enable)
woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_START);
if (enable) {
if (woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_START))
PRINTM(MERROR, "%s: uap bss start failed \n", __func__);
}
done:
if (status != MLAN_STATUS_PENDING)
kfree(req);
@ -3224,7 +3337,11 @@ static int woal_uap_set_wapi_flag_ioctl(moal_private *priv, wapi_msg *msg)
ENTER();
woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_STOP);
if (woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_STOP)) {
PRINTM(MERROR, "%s: uap bss stop failed \n", __func__);
ret = -EFAULT;
goto done;
}
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
if (req == NULL) {
@ -4235,12 +4352,7 @@ int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data)
ENTER();
PRINTM(MIOCTL, "ioctl bss ctrl=%d\n", data);
if ((data != UAP_BSS_START) && (data != UAP_BSS_STOP) &&
(data != UAP_BSS_RESET)) {
PRINTM(MERROR, "Invalid parameter: %d\n", data);
ret = -EINVAL;
goto done;
}
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_bss));
if (req == NULL) {
ret = -ENOMEM;
@ -4257,7 +4369,9 @@ int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data)
|| moal_extflg_isset(priv->phandle, EXT_DFS_OFFLOAD)
#endif
) {
woal_do_acs_check(priv);
status = woal_do_acs_check(priv);
if (status)
PRINTM(MMSG, "woal_do_acs_check fails\n");
/* about to start bss: issue channel check */
status = woal_11h_channel_check_ioctl(priv,
MOAL_IOCTL_WAIT);
@ -4298,6 +4412,11 @@ int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data)
bss->sub_command = MLAN_OID_UAP_BSS_RESET;
woal_cancel_cac_block(priv);
break;
default:
PRINTM(MMSG, "We don't support this uap_bss_ctrl cmd %d\n",
data);
ret = -EFAULT;
goto done;
}
req->req_id = MLAN_IOCTL_BSS;
req->action = MLAN_ACT_SET;
@ -4312,8 +4431,12 @@ int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data)
woal_stop_queue(priv->netdev);
if (netif_carrier_ok(priv->netdev))
netif_carrier_off(priv->netdev);
if (data == UAP_BSS_RESET)
woal_request_set_mac_address(priv, wait_option);
if (data == UAP_BSS_RESET) {
if (MLAN_STATUS_FAILURE ==
woal_request_set_mac_address(priv, wait_option))
PRINTM(MERROR,
"Fail to set mac address after UAP_BSS_RESET\n");
}
woal_flush_tcp_sess_queue(priv);
}
done:

View file

@ -207,6 +207,8 @@ typedef struct _skip_cac_para {
t_u16 skip_cac;
/** channel */
t_u8 channel;
/** bandwidth */
t_u8 bw;
} skip_cac_para;
/** radio control command */
@ -532,12 +534,23 @@ typedef struct _domain_info_param {
#define MAX_DOMAIN_TLV_LEN \
(TLV_HEADER_LEN + COUNTRY_CODE_LEN + (SUB_BAND_LEN * MAX_SUB_BANDS))
/** DOMAIN_INFO param size of dfs_region */
#define DFS_REGION_LEN 1
/** MAX reg domain TLV length*/
#define MAX_REG_DOMAIN_TLV_LEN (TLV_HEADER_LEN + DFS_REGION_LEN)
/** Get/Set channel DFS state */
int woal_11h_chan_dfs_state(moal_private *priv, t_u8 action,
mlan_ds_11h_chan_dfs_state *ch_dfs_state);
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
void woal_update_channels_dfs_state(moal_private *priv, t_u8 channel,
t_u8 bandwidth, t_u8 dfs_state);
#endif
#endif
int woal_set_get_uap_power_mode(moal_private *priv, t_u32 action,
mlan_ds_ps_mgmt *ps_mgmt);
mlan_status woal_set_get_uap_power_mode(moal_private *priv, t_u32 action,
mlan_ds_ps_mgmt *ps_mgmt);
void woal_uap_set_multicast_list(struct net_device *dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
@ -548,12 +561,10 @@ int woal_uap_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd);
#endif
int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data);
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
int woal_uap_get_channel_nop_info(moal_private *priv, t_u8 wait_option,
pmlan_ds_11h_chan_nop_info ch_info);
#endif
#endif
mlan_status woal_set_get_ap_channel(moal_private *priv, t_u16 action,
t_u8 wait_option,
chan_band_info *uap_channel);

View file

@ -94,7 +94,7 @@ done:
static int woal_deauth_assoc_station(moal_private *priv, u8 *mac_addr,
u16 reason_code)
{
int ret = -EFAULT;
int ret = 0;
int i = 0;
mlan_ds_get_info *info = NULL;
mlan_ioctl_req *ioctl_req = NULL;
@ -120,8 +120,10 @@ static int woal_deauth_assoc_station(moal_private *priv, u8 *mac_addr,
ioctl_req->action = MLAN_ACT_GET;
status = woal_request_ioctl(priv, ioctl_req, MOAL_IOCTL_WAIT);
if (status != MLAN_STATUS_SUCCESS)
if (status != MLAN_STATUS_SUCCESS) {
ret = -EFAULT;
goto done;
}
if (!info->param.sta_list.sta_count) {
PRINTM(MCMND, "wlan: skip deauth to station " MACSTR "\n",
MAC2STR(mac_addr));
@ -613,7 +615,8 @@ static t_u16 woal_get_htcap_info(const t_u8 *ie, int len)
/* hostap has converted ht_cap_info to little endian, here
* conver to host endian */
ht_cap_info = woal_le16_to_cpu(htcap_ie->ht_cap.ht_cap_info);
PRINTM(MMSG, "Get ht_cap from beacon ies: 0x%x\n", ht_cap_info);
PRINTM(MINFO, "Get ht_cap from beacon ies: 0x%x\n",
ht_cap_info);
}
return ht_cap_info;
}
@ -984,6 +987,7 @@ static int woal_cfg80211_beacon_config(moal_private *priv,
if (params->chandef.width >= NL80211_CHAN_WIDTH_20)
chan_nop_info.new_chan.is_11n_enabled = MTRUE;
chan_nop_info.new_chan.bandcfg = bandcfg;
chan_nop_info.check_new_chan = MTRUE;
woal_uap_get_channel_nop_info(priv, MOAL_IOCTL_WAIT,
&chan_nop_info);
if (chan_nop_info.chan_under_nop) {
@ -1359,12 +1363,20 @@ static int woal_cfg80211_beacon_config(moal_private *priv,
(sys_config->protocol == PROTOCOL_WPA))
enable_11n = MFALSE;
if (!enable_11n) {
woal_set_uap_ht_tx_cfg(priv, sys_config->bandcfg, ht_cap,
MFALSE);
if (woal_set_uap_ht_tx_cfg(priv, sys_config->bandcfg, ht_cap,
MFALSE)) {
PRINTM(MMSG, "woal_set_uap_ht_tx_cfg fail\n");
ret = -EFAULT;
goto done;
}
woal_uap_set_11n_status(priv, sys_config, MLAN_ACT_DISABLE);
} else {
woal_set_uap_ht_tx_cfg(priv, sys_config->bandcfg, ht_cap,
MTRUE);
if (woal_set_uap_ht_tx_cfg(priv, sys_config->bandcfg, ht_cap,
MTRUE)) {
PRINTM(MMSG, "woal_set_uap_ht_tx_cfg fail\n");
ret = -EFAULT;
goto done;
}
woal_uap_set_11n_status(priv, sys_config, MLAN_ACT_ENABLE);
woal_set_get_tx_bf_cap(priv, MLAN_ACT_GET,
&sys_config->tx_bf_cap);
@ -2336,26 +2348,30 @@ int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy,
}
}
if (vir_priv && vir_priv->bss_type == MLAN_BSS_TYPE_UAP) {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
woal_cfg80211_del_beacon(wiphy, dev, 0);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
if (woal_cfg80211_del_beacon(wiphy, dev, 0))
#else
woal_cfg80211_del_beacon(wiphy, dev);
if (woal_cfg80211_del_beacon(wiphy, dev))
#endif
PRINTM(MERROR, "%s: del_beacon failed\n",
__func__);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
vir_priv->wdev->links[0].ap.beacon_interval = 0;
#else
vir_priv->wdev->beacon_interval = 0;
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
memset(&vir_priv->wdev->links[0].ap.chandef, 0,
sizeof(vir_priv->wdev->links[0].ap.chandef));
#elif CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
#else
memset(&vir_priv->wdev->chandef, 0,
sizeof(vir_priv->wdev->chandef));
#endif
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
vir_priv->wdev->u.ap.ssid_len = 0;
#else
vir_priv->wdev->ssid_len = 0;
@ -2534,8 +2550,8 @@ int woal_cfg80211_add_beacon(struct wiphy *wiphy, struct net_device *dev,
if (moal_extflg_isset(priv->phandle, EXT_DFS_OFFLOAD))
wait_option = MOAL_NO_WAIT;
#endif
if (MLAN_STATUS_SUCCESS !=
woal_uap_bss_ctrl(priv, wait_option, UAP_BSS_START)) {
if (woal_uap_bss_ctrl(priv, wait_option, UAP_BSS_START)) {
PRINTM(MERROR, "%s: start uap failed \n", __func__);
priv->uap_host_based = MFALSE;
ret = -EFAULT;
goto done;
@ -2634,8 +2650,9 @@ done:
*
* @return 0 -- success, otherwise fail
*/
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev, unsigned int link_id)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev,
unsigned int link_id)
#else
int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev)
#endif
@ -2672,7 +2689,9 @@ int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev)
woal_cancel_timer(&priv->phandle->cac_timer);
priv->phandle->is_cac_timer_set = MFALSE;
/* Make sure Chan Report is cancelled */
woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT);
if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT))
PRINTM(MERROR, "%s: cancel chan report failed \n",
__func__);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
@ -2689,13 +2708,13 @@ int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev)
#endif
/* if the bss is still running, then stop it */
if (priv->bss_started == MTRUE) {
if ((int)MLAN_STATUS_FAILURE ==
woal_uap_bss_ctrl(priv, MOAL_NO_WAIT, UAP_BSS_STOP)) {
if (woal_uap_bss_ctrl(priv, MOAL_NO_WAIT, UAP_BSS_STOP)) {
PRINTM(MERROR, "%s: stop uap failed \n", __func__);
ret = -EFAULT;
goto done;
}
if ((int)MLAN_STATUS_FAILURE ==
woal_uap_bss_ctrl(priv, MOAL_NO_WAIT, UAP_BSS_RESET)) {
if (woal_uap_bss_ctrl(priv, MOAL_NO_WAIT, UAP_BSS_RESET)) {
PRINTM(MERROR, "%s: reset uap failed \n", __func__);
ret = -EFAULT;
goto done;
}
@ -2782,7 +2801,10 @@ int woal_cfg80211_change_bss(struct wiphy *wiphy, struct net_device *dev,
if (change) {
if (priv->bss_started == MTRUE) {
bss_started = MTRUE;
woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_STOP);
if (woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT,
UAP_BSS_STOP))
PRINTM(MERROR, "%s: stop uap failed \n",
__func__);
}
if (params->use_short_preamble == 1)
sys_config->preamble_type = 1;
@ -2794,9 +2816,12 @@ int woal_cfg80211_change_bss(struct wiphy *wiphy, struct net_device *dev,
woal_set_get_sys_config(priv, MLAN_ACT_SET, MOAL_IOCTL_WAIT,
sys_config))
ret = 0;
if (bss_started)
woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT_TIMEOUT,
UAP_BSS_START);
if (bss_started) {
if (woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT_TIMEOUT,
UAP_BSS_START))
PRINTM(MERROR, "%s: start uap failed \n",
__func__);
}
}
done:
kfree(sys_config);
@ -2843,29 +2868,7 @@ int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
u16 reason_code = REASON_CODE_DEAUTH_LEAVING;
moal_private *priv = (moal_private *)woal_get_netdev_priv(dev);
ENTER();
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
if (priv->phandle->is_cac_timer_set &&
priv->bss_index == priv->phandle->cac_bss_index) {
woal_cancel_timer(&priv->phandle->cac_timer);
priv->phandle->is_cac_timer_set = MFALSE;
/* Make sure Chan Report is cancelled */
woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
#else
cfg80211_cac_event(priv->netdev, NL80211_RADAR_CAC_ABORTED,
GFP_KERNEL);
#endif
memset(&priv->phandle->dfs_channel, 0,
sizeof(struct cfg80211_chan_def));
priv->phandle->cac_bss_index = 0xff;
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
if (moal_extflg_isset(priv->phandle, EXT_DFS_OFFLOAD))
woal_cancel_cac_block(priv);
#endif
if (priv->media_connected == MFALSE) {
PRINTM(MINFO, "cfg80211: Media not connected!\n");
LEAVE();
@ -2881,14 +2884,17 @@ int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
/** we will not send deauth to p2p interface, it might cause WPS failure
*/
if (mac_addr) {
if (mac_addr
#ifdef WIFI_DIRECT_SUPPORT
if (!priv->phandle->is_go_timer_set)
&& !priv->phandle->is_go_timer_set
#endif
woal_deauth_assoc_station(priv, (u8 *)mac_addr,
reason_code);
) {
if (woal_deauth_assoc_station(priv, (u8 *)mac_addr,
reason_code))
PRINTM(MMSG, "wlan: deauth station " MACSTR " failed\n",
MAC2STR(mac_addr));
} else {
PRINTM(MIOCTL, "del all station\n");
PRINTM(MIOCTL, "del station\n");
}
LEAVE();
return 0;
@ -2956,11 +2962,14 @@ int woal_uap_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
BIT(NL80211_STA_INFO_RX_PACKETS) |
BIT(NL80211_STA_INFO_TX_PACKETS) |
BIT(NL80211_STA_INFO_SIGNAL);
stainfo->rx_bytes = priv->stats.rx_bytes;
stainfo->tx_bytes = priv->stats.tx_bytes;
stainfo->rx_packets = priv->stats.rx_packets;
stainfo->tx_packets = priv->stats.tx_packets;
stainfo->rx_bytes =
info->param.sta_list.info[i].stats.rx_bytes;
stainfo->tx_bytes =
info->param.sta_list.info[i].stats.tx_bytes;
stainfo->rx_packets =
info->param.sta_list.info[i].stats.rx_packets;
stainfo->tx_packets =
info->param.sta_list.info[i].stats.tx_packets;
#else
stainfo->filled = STATION_INFO_INACTIVE_TIME |
STATION_INFO_SIGNAL;
@ -3128,7 +3137,8 @@ int woal_cfg80211_set_mac_acl(struct wiphy *wiphy, struct net_device *dev,
sizeof(sys_config->filter.mac_list));
if (priv->bss_started == MTRUE) {
bss_started = MTRUE;
woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_STOP);
if (woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_STOP))
PRINTM(MERROR, "%s: stop uap failed \n", __func__);
}
if (MLAN_STATUS_SUCCESS == woal_set_get_sys_config(priv, MLAN_ACT_SET,
MOAL_IOCTL_WAIT,
@ -3136,8 +3146,11 @@ int woal_cfg80211_set_mac_acl(struct wiphy *wiphy, struct net_device *dev,
ret = 0;
done:
kfree(sys_config);
if (bss_started)
woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT_TIMEOUT, UAP_BSS_START);
if (bss_started) {
if (woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT_TIMEOUT,
UAP_BSS_START))
PRINTM(MERROR, "%s: start uap failed \n", __func__);
}
LEAVE();
return ret;
}
@ -3225,6 +3238,103 @@ int woal_cfg80211_set_txq_params(struct wiphy *wiphy, struct net_device *dev,
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
/**
* @brief start background radar detection
*
* @param wiphy A pointer to wiphy structure
* @param chandef A pointer to cfg80211_chan_def structure
* @return 0 -- success, otherwise fail
*/
int woal_cfg80211_set_radar_background(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef)
{
u32 cac_time_ms = DEF_CAC_DWELL_TIME;
moal_handle *handle = (moal_handle *)woal_get_wiphy_priv(wiphy);
moal_private *priv = woal_get_priv_bss_type(handle, MLAN_BSS_TYPE_DFS);
mlan_ds_11h_chan_rep_req chan_rpt_req;
int ret = 0;
mlan_status status;
ENTER();
if (!priv) {
PRINTM(MERROR,
"DFS interface not avalible in set_radar_background\n");
return -EFAULT;
}
if (!chandef) {
PRINTM(MMSG, "Stop radar background\n");
woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT);
priv->chan_rpt_pending = MFALSE;
priv->radar_background = MFALSE;
memset(&priv->chan_rpt_req, 0,
sizeof(mlan_ds_11h_chan_rep_req));
LEAVE();
return ret;
}
if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR)) {
PRINTM(MERROR, "Not radar channel in set_radar_background\n");
LEAVE();
return -EFAULT;
}
if ((woal_is_etsi_country(priv->phandle->country_code) == MTRUE)) {
if (chandef->chan->hw_value == 120 ||
chandef->chan->hw_value == 124 ||
chandef->chan->hw_value == 128) {
cac_time_ms = MAX_CAC_DWELL_TIME;
}
if (chandef->chan->hw_value == 116 &&
((chandef->width == NL80211_CHAN_WIDTH_40) ||
(chandef->width == NL80211_CHAN_WIDTH_80))) {
cac_time_ms = MAX_CAC_DWELL_TIME;
}
}
if (priv->chan_rpt_req.chanNum &&
(priv->chan_rpt_req.chanNum != (t_u8)chandef->chan->hw_value)) {
woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT);
priv->chan_rpt_pending = MFALSE;
memset(&priv->chan_rpt_req, 0,
sizeof(mlan_ds_11h_chan_rep_req));
}
chan_rpt_req.startFreq = START_FREQ_11A_BAND;
chan_rpt_req.chanNum = (t_u8)chandef->chan->hw_value;
chan_rpt_req.bandcfg.chanBand = BAND_5GHZ;
switch (chandef->width) {
case NL80211_CHAN_WIDTH_40:
chan_rpt_req.bandcfg.chanWidth = CHAN_BW_40MHZ;
break;
case NL80211_CHAN_WIDTH_80:
chan_rpt_req.bandcfg.chanWidth = CHAN_BW_80MHZ;
break;
case NL80211_CHAN_WIDTH_20:
case NL80211_CHAN_WIDTH_20_NOHT:
default:
chan_rpt_req.bandcfg.chanWidth = CHAN_BW_20MHZ;
break;
}
chan_rpt_req.millisec_dwell_time = cac_time_ms;
chan_rpt_req.host_based = MTRUE;
moal_memcpy_ext(priv->phandle, &priv->chan_rpt_req, &chan_rpt_req,
sizeof(mlan_ds_11h_chan_rep_req),
sizeof(mlan_ds_11h_chan_rep_req));
PRINTM(MCMND,
"DFS: Start Background Radar detect on channel=%d, bandwidth=%d, cac time=%d\n",
chan_rpt_req.chanNum, (int)(chan_rpt_req.bandcfg.chanWidth),
chan_rpt_req.millisec_dwell_time);
status = woal_do_dfs_cac(priv, &chan_rpt_req);
if (status != MLAN_STATUS_SUCCESS) {
ret = -EFAULT;
} else {
priv->chan_rpt_pending = MTRUE;
priv->radar_background = MTRUE;
moal_memcpy_ext(priv->phandle, &priv->radar_background_chan,
chandef, sizeof(struct cfg80211_chan_def),
sizeof(struct cfg80211_chan_def));
}
LEAVE();
return ret;
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
/**
* @brief cac timer call back function.
@ -3267,8 +3377,7 @@ static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option)
t_u8 chan2Offset = SEC_CHAN_NONE;
ENTER();
woal_clear_all_mgmt_ies(priv, MOAL_IOCTL_WAIT);
if (MLAN_STATUS_SUCCESS !=
woal_uap_bss_ctrl(priv, wait_option, UAP_BSS_STOP)) {
if (woal_uap_bss_ctrl(priv, wait_option, UAP_BSS_STOP)) {
PRINTM(MERROR, "%s: stop uap failed \n", __func__);
goto done;
}
@ -3318,8 +3427,7 @@ static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option)
PRINTM(MERROR, "Fail to set ap channel \n");
goto done;
}
if (MLAN_STATUS_SUCCESS !=
woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT_TIMEOUT, UAP_BSS_START)) {
if (woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT_TIMEOUT, UAP_BSS_START)) {
PRINTM(MERROR, "%s: start uap failed \n", __func__);
goto done;
}
@ -3328,7 +3436,7 @@ static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option)
priv->channel = uap_channel.channel;
moal_memcpy_ext(priv->phandle, &priv->chan, &priv->csa_chan,
sizeof(struct cfg80211_chan_def), sizeof(priv->chan));
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0);
#else
cfg80211_ch_switch_notify(priv->netdev, &priv->chan);
@ -3377,7 +3485,9 @@ void woal_process_cancel_chanrpt_event(moal_private *priv)
woal_cancel_timer(&priv->phandle->cac_timer);
priv->phandle->is_cac_timer_set = MFALSE;
/* Make sure Chan Report is cancelled */
woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT);
if (woal_11h_cancel_chan_report_ioctl(priv, MOAL_IOCTL_WAIT))
PRINTM(MERROR, "%s: cancel chan report failed \n",
__func__);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
cfg80211_cac_event(priv->netdev, &priv->phandle->dfs_channel,
NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
@ -3402,7 +3512,6 @@ void woal_process_cancel_chanrpt_event(moal_private *priv)
* @param cac_time_ms A cac dwell time
* @return 0 -- success, otherwise fail
*/
int woal_cfg80211_start_radar_detection(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_chan_def *chandef,
@ -3543,15 +3652,12 @@ int woal_cfg80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
ret = -EINVAL;
goto done;
}
/* TODO: support this case in next version */
if (params->radar_required) {
PRINTM(MMSG,
" hostapd handle this case by disable and re-enable interface\n");
ret = -ENOTSUPP;
goto done;
PRINTM(MMSG, "switch to DFS channel\n");
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
woal_enable_dfs_support(priv, &params->chandef);
#endif
}
/* actually hostapd would always choose one diff channel*/
if (cfg80211_chandef_identical(&params->chandef, &priv->chan)) {
PRINTM(MMSG,
@ -3631,8 +3737,7 @@ mlan_status woal_register_uap_cfg80211(struct net_device *dev, t_u8 bss_type)
return MLAN_STATUS_FAILURE;
}
if (bss_type == MLAN_BSS_TYPE_UAP)
wdev->iftype = NL80211_IFTYPE_AP;
wdev->iftype = NL80211_IFTYPE_STATION;
dev_net_set(dev, wiphy_net(wdev->wiphy));
dev->ieee80211_ptr = wdev;

View file

@ -736,7 +736,10 @@ static int woal_get_encode(struct net_device *dev, struct iw_request_info *info,
moal_memcpy_ext(priv->phandle, extra,
ap_cfg->wpa_cfg.passphrase,
ap_cfg->wpa_cfg.length, ap_cfg->wpa_cfg.length);
dwrq->length = ap_cfg->wpa_cfg.length;
if (ap_cfg->wpa_cfg.length)
dwrq->length = ap_cfg->wpa_cfg.length;
else
dwrq->length = 16;
dwrq->flags |= 1;
dwrq->flags &= ~IW_ENCODE_DISABLED;
break;

View file

@ -2680,6 +2680,38 @@ static int woal_set_essid(struct net_device *dev, struct iw_request_info *info,
goto setessid_ret;
}
priv->auto_assoc_priv.drv_assoc.status = MFALSE;
priv->auto_assoc_priv.drv_reconnect.status = MFALSE;
#ifdef REASSOCIATION
if (priv->reassoc_on == MTRUE) {
if (priv->auto_assoc_priv.auto_assoc_type_on &
(0x1 << (AUTO_ASSOC_TYPE_DRV_ASSOC - 1))) {
if (priv->scan_type == MLAN_SCAN_TYPE_PASSIVE)
woal_set_scan_type(
priv, MLAN_SCAN_TYPE_PASSIVE);
MOAL_REL_SEMAPHORE(&handle->reassoc_sem);
moal_memcpy_ext(
priv->phandle,
&priv->prev_ssid_bssid.ssid, &req_ssid,
sizeof(mlan_802_11_ssid),
sizeof(priv->prev_ssid_bssid.ssid));
priv->auto_assoc_priv.auto_assoc_trigger_flag =
AUTO_ASSOC_TYPE_DRV_ASSOC;
priv->auto_assoc_priv.drv_assoc.status = MTRUE;
priv->reassoc_required = MTRUE;
priv->phandle->is_reassoc_timer_set = MTRUE;
PRINTM(MINFO,
" auto assoc: trigger driver auto assoc\n");
woal_mod_timer(&priv->phandle->reassoc_timer,
0);
ret = MLAN_STATUS_SUCCESS;
LEAVE();
return ret;
}
}
#endif
if (dwrq->flags != 0xFFFF) {
if (MLAN_STATUS_SUCCESS !=
woal_find_essid(priv, &ssid_bssid,
@ -3092,9 +3124,6 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
current_ev = IWE_STREAM_ADD_POINT(
info, current_ev, end_buf, &iwe,
buf);
current_val = current_ev +
IW_EV_LCP_LEN +
strlen(buf);
break;
#endif
default:
@ -3114,9 +3143,9 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
ptr += sprintf(ptr, "band=");
memset(&iwe, 0, sizeof(iwe));
if (scan_table[i].bss_band == BAND_A)
ptr += sprintf(ptr, "a");
sprintf(ptr, "a");
else
ptr += sprintf(ptr, "bg");
sprintf(ptr, "bg");
iwe.u.data.length = strlen(buf);
PRINTM(MINFO, "iwe.u.data.length %d\n", iwe.u.data.length);
PRINTM(MINFO, "BUF: %s\n", buf);
@ -3124,7 +3153,6 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
iwe.len = IW_EV_POINT_LEN + iwe.u.data.length;
current_ev = IWE_STREAM_ADD_POINT(info, current_ev, end_buf,
&iwe, buf);
current_val = current_ev + IW_EV_LCP_LEN + strlen(buf);
#endif
current_val = current_ev + IW_EV_LCP_LEN;
@ -3260,6 +3288,11 @@ void woal_send_iwevcustom_event(moal_private *priv, char *str)
char buf[IW_CUSTOM_MAX];
ENTER();
/* Check register_netdevice is completed before sending*/
if (priv->netdev->reg_state != NETREG_REGISTERED) {
LEAVE();
return;
}
memset(&iwrq, 0, sizeof(union iwreq_data));
memset(buf, 0, sizeof(buf));

View file

@ -3,6 +3,8 @@ ifconfig mlan0 down
ifconfig uap0 down
ifconfig mmlan0 down
ifconfig muap0 down
ifconfig uap1 down
ifconfig muap1 down
ifconfig wfd0 down
ifconfig wfd1 down
ifconfig mwfd0 down