Compare commits

...

17 commits

Author SHA1 Message Date
Sherry Sun d819b6d266 mxm_wifiex: update to mxm5x17366.p5 release
Driver Bug Fixes:
-----------------
1. WCSWREL-386: wifi cannot re-connect to AP automatically after resume back

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-11-14 09:08:04 +08:00
Sherry Sun 4eb4876654 mxm_wifiex: fix the 17366.p3 version wifi driver build errors on L6.x kernel
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-11-11 16:00:18 +08:00
Sherry Sun 2a2b814866 mxm_wifiex: update to mxm5x17366.p3 release
Driver Bug Fixes:
-----------------
1. WSW-22601: kernel warning are seen on STAUT when Channel switch command is executed on Ex-AP
2. WSW-22845: hotspot start fail in function test from Android GUI
3. WSW-22456: APUT is not sending ECSA Action frames when channel_switch command is executed with ECSA Action frame enabled
4. WCSWREL-372: Kernel difference between Linux 5.15 and Android 13 cause Wi-Fi driver compilation failure
5. WSW-17873: Remove big endian flag from makefile
6. WSW-22457: APUT is not switching to new channel when channel_switch command is executed in 2.4 GHz
7. WSW-22313: 0xa9 cmd timeout on fw reload
8. WCSWREL-375: merge the fix patch for the build errors with the API changes on next-20220912 kernel tag
9. WSW-22361: Change the state of Timer function in mxmdriver
10. WSW-22207: Kernel Panic when run timeout IR stress on iMX8 Platform
11. WSFD-559: Support Wi-fi Auto Recovery in Linux driver

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-11-11 15:57:21 +08:00
Sherry Sun f0c4bdf134 mxm_wifiex: enable IW612 in mwifiex wifi driver
Enable IW612 device in mwifiex wifi driver instead the standalone IW612
wifi driver.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-11-04 18:58:07 +08:00
Sherry Sun 72ddfc7550 mxm_wifiex: use get_random_u32() when possible
The prandom_u32() function has been a deprecated inline wrapper around
get_random_u32() for several releases now, and compiles down to the
exact same code. Replace the deprecated wrapper with a direct call to
the real function.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-10-27 12:40:18 +08:00
Sherry Sun 5a38226a47 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>
2022-10-10 15:32:56 +08:00
Sherry Sun 65ddf89682 mxm_wifiex: fix the build errors with the API changes on next-20220930 kernel tag
b48b89f9c189 ("net: drop the weight argument from netif_napi_add") patch
in upstream kernel change the netif_napi_add API, so corresponding
functions used in wifi driver also need to be changed to avoid build
break. Now this API change is based on the next-20220930 kernel tag.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-10-10 15:25:57 +08:00
Sherry Sun d88bd98445 mxm_wifiex: fix the build errors with the API changes on next-20220912 kernel tag
Kernel cfg80211 add link_id parameter to various key operations for
MLO, for more details, please check the following link:
https://lore.kernel.org/all/20220730052643.1959111-4-quic_vjakkam@quicinc.com/

As these API changes on next-20220912 kernel tag, corresponding
functions also need to be changed to avoid build break.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-09-26 12:03:35 +08:00
Sherry Sun fb098b07fc mxm_wifiex: fix oob irq request fail on i.MX93 9x9 qsb board
i.MX93 9x9 qsb board connect the out-of-band WoWLAN irq pin(M.2 pin21
SDIO_WAKE) to I2C IO expander pcal6524 instead of i.MX GPIO, pcal6524
IRQ handlers need to be threaded, and the IRQ trigger type depends on
the devicetree setting. Also the IRQF_ONESHOT flag need to be set for
threaded IRQ.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
2022-09-14 18:26:15 +08:00
Sherry Sun a036032a76 mxm_wifiex: update to mxm5x17344.p3 release
Driver Bug Fixes:
-----------------
1. LF-6972: Updated the License to GPL-2.0
2. Incremented the driver version

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-08-31 13:08:31 +08:00
Sherry Sun 3bcb60dc2b mxm_wifiex: update to mxm5x17344.p2 release
Driver Bug Fixes:
-----------------
1. WSW-21217: Wifi driver crash at woal_ring_poll_worker during PDn recovery test
2. WSW-21020: Enable host_mlme by default
3. WSW-20532: Resolved CSA IE not present in beacon when injecting chirp type radar
4. WSW-21085: Link measurement bit not set in RRM Cap IE
5. WSW-17940: Kernel crash is seen randomly during STA/P2P testing
6. WSW-19320: Testcases from VtsHalWifiV1_3TargetTest suite are failing
7. WSW-21164: Fix driver crash issue caused by null ring buffer of wifi logger
8. WSW-19335: RSN Extension IE is not included in Assoc req when AP side does not connect via WPA3 R3

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-08-31 13:08:26 +08:00
Sherry Sun 9a15e44e49 mxm_wifiex: fix the build errors with the API changes on next-20220719 kernel tag
There are many cfg80211 common api and struct changes on next-20220719
kernel tag, which is based on v5.19-rc7 Linus tree tag with the for-next
branch patches on each kernel IP repo, target for v6.0 kernel version.
So need to change the local wifi driver accordingly to avoid the build
errors.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
2022-08-22 16:10:44 +08:00
Sherry Sun 30f40263eb mwifiex: update SCR.txt file
Remove Package Category from the local SCR file.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-08-12 09:28:52 +08:00
Sherry Sun 880a3f5b7b mwifiex: add SCR.txt for mwifiex repo
Add the SCR.txt for mwifiex repo.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-08-10 10:39:39 +08:00
Sherry Sun a0835444f1 mxm_wifiex: update to mxm5x17344.p1 release
Driver Bug Fixes:
-----------------
1. WCSWREL-352: Fixed WiFi driver kernel panic with "use after free" print
2. WCSWREL-353: Fixed WiFi driver panic when switch AP to another AP
3. WCSWREL-337: merge the L5.18 build errors and warnings fix patches into next wifi release
4. WSW-16518: Fixed STA going to unresponsive state during basic UAPSD operation
5. WSW-19350: Observed "unexpected kernel BRK exception" in STA 2G VHT with BT HID traffic running simultaneously
6. WSW-19640: cannot enable the "20/40 BSS Coexistence Management" support

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-07-19 12:20:01 +08:00
Sherry Sun c874a3d10c mxm_wifiex: update to mxm5x17322.p3 release
Driver Bug Fixes:
-----------------
1. Added GPL/NXP dual license header
2. WCSWREL-242: Fixed system rebooted issue after connecting wifi and running bt A2DP stress
3. WCSWREL-310: merge the L5.17 build errors and warnings related to netif_rx
4. WCSWREL-317: merge the build error and warning fix related to eth_hw_addr_set
5. WSW-19664: Fixed VtsHalWifiV1_0TargetTest failure

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-05-31 09:59:14 +08:00
Sherry Sun 638d8eae2a mxm_wifiex: fix the build errors with the API changes on L5.18 kernel
L5.18 kernel removed the wrappers in include/linux/pci-dma-compat.h, so
need to switch from 'pci_dma' to 'dma_' API.

Also, to make it unambiguous that mmc_hw_reset() is for cards and not
for controllers, L5.18 kernel make the function argument mmc_card
instead of mmc_host.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
2022-05-13 13:04:59 +08:00
83 changed files with 10189 additions and 12239 deletions

View file

@ -44,7 +44,7 @@ CONFIG_USB8997=n
CONFIG_PCIE8997=y
CONFIG_SD8987=y
CONFIG_SD9097=n
CONFIG_SD9177=n
CONFIG_SD9177=y
CONFIG_SD8801=y
CONFIG_USB8801=n
CONFIG_USB9097=n
@ -84,6 +84,9 @@ CONFIG_MFG_CMD_SUPPORT=y
# OpenWrt support
CONFIG_OPENWRT_SUPPORT=n
# Big-endian platform
CONFIG_BIG_ENDIAN=n
ifeq ($(CONFIG_DRV_EMBEDDED_SUPPLICANT), y)
@ -130,6 +133,9 @@ ARCH ?= arm64
CONFIG_IMX_SUPPORT=y
ifeq ($(CONFIG_IMX_SUPPORT),y)
ccflags-y += -DIMX_SUPPORT
ifneq ($(ANDROID_PRODUCT_OUT),)
ccflags-y += -DIMX_ANDROID
endif
endif
KERNELDIR ?= /usr/src/arm/linux_5_10_y_kernel/linux-nxp
CROSS_COMPILE ?= /opt/fsl-imx-internal-xwayland/5.10-gatesgarth/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-
@ -188,6 +194,10 @@ ifeq ($(CONFIG_MFG_CMD_SUPPORT),y)
ccflags-y += -DMFG_CMD_SUPPORT
endif
ifeq ($(CONFIG_BIG_ENDIAN),y)
ccflags-y += -DBIG_ENDIAN_SUPPORT
endif
ifeq ($(CONFIG_USERSPACE_32BIT_OVER_KERNEL_64BIT),y)
ccflags-y += -DUSERSPACE_32BIT_OVER_KERNEL_64BIT
endif
@ -581,11 +591,9 @@ endif
export CC LD ccflags-y KERNELDIR
.PHONY: mapp/mlanconfig mapp/mlanutl clean distclean
.PHONY: mapp/mlanutl clean distclean
@echo "Finished Making NXP Wlan Linux Driver"
mapp/mlanconfig:
$(MAKE) -C $@
mapp/mlanutl:
$(MAKE) -C $@
@ -598,8 +606,9 @@ appsbuild:
fi
cp -f README_MLAN $(BINDIR)
ifneq ($(APPDIR),)
$(MAKE) -C mapp/mlanconfig $@ INSTALLDIR=$(BINDIR)
cp -rf mapp/mlanconfig/config $(BINDIR)
$(MAKE) -C mapp/mlanutl $@ INSTALLDIR=$(BINDIR)
endif
@ -616,8 +625,9 @@ build: echo default
cp -rpf script/unload $(BINDIR)/
cp -f README_MLAN $(BINDIR)
ifneq ($(APPDIR),)
$(MAKE) -C mapp/mlanconfig $@ INSTALLDIR=$(BINDIR)
cp -rf mapp/mlanconfig/config $(BINDIR)
$(MAKE) -C mapp/mlanutl $@ INSTALLDIR=$(BINDIR)
endif
@ -633,7 +643,6 @@ clean:
-find . -name "*dwo" -exec rm {} \;
-rm -rf .tmp_versions
ifneq ($(APPDIR),)
$(MAKE) -C mapp/mlanconfig $@
$(MAKE) -C mapp/mlanutl $@
endif
#ifdef SDIO
@ -663,7 +672,6 @@ distclean:
-find . -name "*dwo" -exec rm {} \;
-rm -rf .tmp_versions
ifneq ($(APPDIR),)
$(MAKE) -C mapp/mlanconfig $@
$(MAKE) -C mapp/mlanutl $@
endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,13 @@
NXP Software Content Register
--------------------------------------------
Package: mwifiex.git
Outgoing License: GPL-2.0
License File: mxm_wifiex/wlan_src/gpl-2.0.txt
Type of content: source
Description and comments: NXP Wi-Fi linux SDK
Release Location: https://github.com/nxp-imx/mwifiex
Origin: NXP (GPL-2.0)
--------------------------------------------

View file

@ -1,46 +0,0 @@
#
# File : mlanconfig/Makefile
#
# Copyright 2008-2020 NXP
# Path to the top directory of the mlandriver 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))
#
# List of application executables to create
#
TARGETS := $(exectarget)
#
# Make target rules
#
# All rule compiles list of TARGETS using builtin program target from src rule
all :
$(exectarget): $(libobjs)
$(CC) $(CFLAGS) $(libobjs) -o $(exectarget)
# Update any needed TARGETS and then copy to the install path
build install: $(TARGETS)
@cp -rf config $(INSTALLPATH)
clean:
@rm -f $(exectarget)
@rm -f *.o
distclean: clean
@rm -f *~ core
@rm -f tags

View file

@ -1,126 +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=1 # GET 15.4 Statistics
length:4=52 # Length of collected statistics
stats:52=0 # Accumulated Statistics
}
}
get_bt_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 BT Statistics
length:4=28 # Length of collected statistics
stats:28=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,43 +0,0 @@
# File : robust_btc_MM.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_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
}
}

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
#}
#SD8978 = {
# 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
#}
#SD9177 = {
# cfg80211_wext=0xf
# wfd_name=p2p
# hw_name=SDNW611
# 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,375 +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_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 TLV data*/
typedef struct _ntb_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;
/**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__ ntb_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[];
} __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 _ntb_ranging_cfg_tlv {
/** Type*/
t_u16 type;
/** Length*/
t_u16 len;
/** Value*/
ntb_ranging_cfg_t val;
} __ATTRIB_PACK__ ntb_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 */
ntb_ranging_cfg_tlv_t ntb_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*/
ntb_ranging_cfg_t ntb_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

@ -76,7 +76,7 @@ static t_u8 wlan_check_ap_11ax_twt_supported(BSSDescriptor_t *pbss_desc)
{
if (!pbss_desc->phe_cap)
return MFALSE;
if (!(pbss_desc->phe_cap->he_mac_cap[0] & HE_MAC_CAP_TWT_REQ_SUPPORT))
if (!(pbss_desc->phe_cap->he_mac_cap[0] & HE_MAC_CAP_TWT_RESP_SUPPORT))
return MFALSE;
if (!pbss_desc->pext_cap)
return MFALSE;
@ -99,12 +99,14 @@ t_u8 wlan_check_11ax_twt_supported(mlan_private *pmpriv,
(MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap;
MrvlIEtypes_He_cap_t *hw_he_cap =
(MrvlIEtypes_He_cap_t *)&pmpriv->adapter->hw_he_cap;
t_u16 band_selected = BAND_A;
if (pbss_desc && !wlan_check_ap_11ax_twt_supported(pbss_desc)) {
PRINTM(MINFO, "AP don't support twt feature\n");
return MFALSE;
}
if (pbss_desc) {
if (pbss_desc->bss_band & BAND_A) {
if (pbss_desc->bss_band & band_selected) {
hw_he_cap = (MrvlIEtypes_He_cap_t *)&pmpriv->adapter
->hw_he_cap;
phecap = (MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap;
@ -186,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);
@ -198,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);
@ -406,6 +409,7 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u16 cfg_value = 0;
t_u16 hw_value = 0;
MrvlIEtypes_He_cap_t *phw_hecap = MNULL;
t_u16 band_selected = BAND_A;
ENTER();
@ -425,7 +429,7 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
}
bw_80p80 = wlan_is_80_80_support(pmpriv, pbss_desc);
phecap = (MrvlIEtypes_He_cap_t *)*ppbuffer;
if (pbss_desc->bss_band & BAND_A) {
if (pbss_desc->bss_band & band_selected) {
memcpy_ext(pmadapter, *ppbuffer, pmpriv->user_he_cap,
pmpriv->user_hecap_len, pmpriv->user_hecap_len);
*ppbuffer += pmpriv->user_hecap_len;
@ -447,7 +451,7 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
if (IS_CARD9098(pmpriv->adapter->card_type) ||
IS_CARDNW62X(pmpriv->adapter->card_type) ||
IS_CARD9097(pmpriv->adapter->card_type)) {
if (pbss_desc->bss_band & BAND_A) {
if (pbss_desc->bss_band & band_selected) {
rx_nss = GET_RXMCSSUPP(pmpriv->adapter->user_htstream >>
8);
tx_nss = GET_TXMCSSUPP(pmpriv->adapter->user_htstream >>
@ -522,6 +526,7 @@ void wlan_update_11ax_cap(mlan_adapter *pmadapter,
MrvlIEtypes_He_cap_t *phe_cap = MNULL;
t_u8 i = 0;
t_u8 he_cap_2g = 0;
MrvlIEtypes_He_cap_t *user_he_cap_tlv = MNULL;
ENTER();
if ((hw_he_cap->len + sizeof(MrvlIEtypesHeader_t)) >
@ -580,6 +585,28 @@ void wlan_update_11ax_cap(mlan_adapter *pmadapter,
pmadapter->hw_hecap_len,
sizeof(pmadapter->priv[i]->user_he_cap));
}
/**
* Clear TWT bits in he_mac_cap by bss role
* STA mode should clear TWT responder bit
* UAP mode should clear TWT request bit
*/
if (he_cap_2g)
user_he_cap_tlv =
(MrvlIEtypes_He_cap_t *)&pmadapter
->priv[i]
->user_2g_he_cap;
else
user_he_cap_tlv =
(MrvlIEtypes_He_cap_t *)&pmadapter
->priv[i]
->user_he_cap;
if (pmadapter->priv[i]->bss_role == MLAN_BSS_ROLE_STA)
user_he_cap_tlv->he_mac_cap[0] &=
~HE_MAC_CAP_TWT_RESP_SUPPORT;
else
user_he_cap_tlv->he_mac_cap[0] &=
~HE_MAC_CAP_TWT_REQ_SUPPORT;
}
}
LEAVE();
@ -632,15 +659,6 @@ static mlan_status wlan_11ax_ioctl_hecfg(pmlan_adapter pmadapter,
ENTER();
if (pioctl_req->buf_len < sizeof(mlan_ds_11ax_cfg)) {
PRINTM(MINFO, "MLAN bss IOCTL length is too short.\n");
pioctl_req->data_read_written = 0;
pioctl_req->buf_len_needed = sizeof(mlan_ds_11ax_cfg);
pioctl_req->status_code = MLAN_ERROR_INVALID_PARAMETER;
LEAVE();
return MLAN_STATUS_RESOURCE;
}
cfg = (mlan_ds_11ax_cfg *)pioctl_req->pbuf;
if ((cfg->param.he_cfg.band & MBIT(0)) &&

View file

@ -409,8 +409,7 @@ static mlan_status wlan_11d_update_chan_pwr_table(mlan_private *pmpriv,
/* Channel not found. Update the channel in the channel-power
table */
parsed_region_chan->chan_pwr[i].chan = chan;
parsed_region_chan->chan_pwr[i].band =
(t_u8)pbss_desc->bss_band;
parsed_region_chan->chan_pwr[i].band = pbss_desc->bss_band;
parsed_region_chan->chan_pwr[i].pwr = tx_power;
parsed_region_chan->chan_pwr[i].ap_seen = MTRUE;
parsed_region_chan->no_of_chan++;
@ -1524,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;
@ -1588,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;
@ -1596,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) ==
@ -1625,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,28 +763,29 @@ 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, "ZeroDFS: 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, "ZeroDFS: STOP\n");
PRINTM(MCMND, "DFS: STOP\n");
}
pcmd_ptr->size += sizeof(MrvlIEtypes_ZeroDfsOperation_t);
pcmd_ptr->size = wlan_cpu_to_le16(pcmd_ptr->size);
LEAVE();
return MLAN_STATUS_SUCCESS;
}
pcmd_ptr->size = wlan_cpu_to_le16(pcmd_ptr->size);
/* update dfs sturcture.
* dfs_check_pending is set when we receive CMD_RESP == SUCCESS */
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 +1080,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 +1758,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 +1862,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 +2303,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 +2313,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 +2320,6 @@ t_void wlan_11h_cleanup(mlan_adapter *adapter)
adapter->pmoal_handle, &pstate_dfs->dfs_ts_head, MNULL,
MNULL);
}
LEAVE();
}
@ -2417,7 +2758,11 @@ t_s32 wlan_11h_process_start(mlan_private *priv, t_u8 **ppbuffer,
((adapter->adhoc_start_band & BAND_A))) {
if (!wlan_fw_11d_is_enabled(priv)) {
/* No use having 11h enabled without 11d enabled */
wlan_11d_enable(priv, MNULL, ENABLE_11D);
if (wlan_11d_enable(priv, MNULL, ENABLE_11D)) {
ret = MLAN_STATUS_FAILURE;
LEAVE();
return ret;
}
#ifdef STA_SUPPORT
wlan_11d_create_dnld_countryinfo(
priv, adapter->adhoc_start_band);
@ -2489,8 +2834,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,
@ -2507,11 +2851,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();
@ -2521,7 +2866,11 @@ t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
if (p11h_bss_info->sensed_11h) {
if (!wlan_fw_11d_is_enabled(priv)) {
/* No use having 11h enabled without 11d enabled */
wlan_11d_enable(priv, MNULL, ENABLE_11D);
if (wlan_11d_enable(priv, MNULL, ENABLE_11D)) {
PRINTM(MERROR, "Fail to enable 11D\n");
LEAVE();
return ret;
}
#ifdef STA_SUPPORT
wlan_11d_parse_dnld_countryinfo(
priv, priv->pattempted_bss_desc);
@ -2552,10 +2901,12 @@ t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
priv, ppbuffer, band, channel, p11h_bss_info);
}
} else {
/* Deactivate 11h functions in the firmware */
wlan_11h_activate(priv, MNULL, MFALSE);
pcap_info->spectrum_mgmt = MFALSE;
wlan_11h_check_update_radar_det_state(priv);
if (pcap_info->ibss) {
/* Deactivate 11h functions in the firmware */
wlan_11h_activate(priv, MNULL, MFALSE);
pcap_info->spectrum_mgmt = MFALSE;
wlan_11h_check_update_radar_det_state(priv);
}
}
LEAVE();
@ -2880,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 */
@ -2924,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();
@ -2978,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
@ -3007,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 ||
@ -3026,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;
}
@ -3078,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,
@ -3203,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;
@ -3221,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();
@ -3228,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) {
@ -3252,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;
@ -3265,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(
@ -3296,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, "ZeroDFS: 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;
}
@ -3475,6 +3900,7 @@ void wlan_11h_update_bandcfg(mlan_private *pmpriv, Band_Config_t *uap_band_cfg,
LEAVE();
}
#ifdef UAP_SUPPORT
/**
* @brief Get priv current index -- this is used to enter correct rdh_state
* during radar handling
@ -3503,6 +3929,7 @@ wlan_11h_get_priv_curr_idx(mlan_private *pmpriv,
}
return (found == MTRUE) ? MLAN_STATUS_SUCCESS : MLAN_STATUS_FAILURE;
}
#endif
/**
* @brief Driver handling for remove customeie
@ -4362,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();
}
@ -4403,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

@ -1050,7 +1050,7 @@ static void wlan_update_all_stations_ampdu(mlan_private *priv)
}
while (sta_ptr != (sta_node *)&priv->sta_list) {
for (i = 0; i < MAX_NUM_TID; i++) {
if (sta_ptr->is_11n_enabled)
if (sta_ptr->is_11n_enabled || sta_ptr->is_11ax_enabled)
sta_ptr->ampdu_sta[i] =
priv->aggr_prio_tbl[i].ampdu_user;
}
@ -1233,7 +1233,8 @@ static mlan_status wlan_11n_ioctl_supported_mcs_set(pmlan_adapter pmadapter,
if ((ISSUPP_CHANWIDTH40(pmpriv->usr_dot_11n_dev_cap_bg) ||
ISSUPP_CHANWIDTH40(pmpriv->usr_dot_11n_dev_cap_a)) &&
!(pmpriv->curr_chan_flags & CHAN_FLAGS_NO_HT40PLUS &&
pmpriv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS))
pmpriv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS) &&
pmadapter->init_para.mcs32 == 1)
SETHT_MCS32(mcs_set);
cfg = (mlan_ds_11n_cfg *)pioctl_req->pbuf;
@ -1541,7 +1542,8 @@ void wlan_fill_ht_cap_tlv(mlan_private *priv, MrvlIETypes_HTCap_t *pht_cap,
* supprot*/
if (ISSUPP_CHANWIDTH40(usr_dot_11n_dev_cap) &&
!(priv->curr_chan_flags & CHAN_FLAGS_NO_HT40PLUS &&
priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS))
priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS) &&
pmadapter->init_para.mcs32 == 1)
SETHT_MCS32(pht_cap->ht_cap.supported_mcs_set);
/* Clear RD responder bit */
@ -1617,7 +1619,8 @@ void wlan_fill_ht_cap_ie(mlan_private *priv, IEEEtypes_HTCap_t *pht_cap,
* supprot*/
if (ISSUPP_CHANWIDTH40(usr_dot_11n_dev_cap) &&
!(priv->curr_chan_flags & CHAN_FLAGS_NO_HT40PLUS &&
priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS))
priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS) &&
pmadapter->init_para.mcs32 == 1)
SETHT_MCS32(pht_cap->ht_cap.supported_mcs_set);
/* Clear RD responder bit */
@ -2885,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

@ -614,6 +614,10 @@ mlan_status wlan_cmd_11n_addba_req(mlan_private *priv, HostCmd_DS_COMMAND *cmd,
*/
static t_u8 wlan_is_addba_reject(mlan_private *priv, t_u8 tid)
{
if (tid >= MAX_NUM_TID) {
PRINTM(MERROR, "Wrong TID =%d", tid);
return ADDBA_RSP_STATUS_REJECT;
}
#ifdef STA_SUPPORT
#endif
return priv->addba_reject[tid];
@ -1412,6 +1416,7 @@ void wlan_flush_rxreorder_tbl(pmlan_adapter pmadapter)
static void wlan_update_ampdu_rxwinsize(pmlan_adapter pmadapter, t_u8 coex_flag)
{
t_u8 i;
t_u8 j;
t_u32 rx_win_size = 0;
pmlan_private priv = MNULL;
@ -1441,7 +1446,9 @@ static void wlan_update_ampdu_rxwinsize(pmlan_adapter pmadapter, t_u8 coex_flag)
priv->add_ba_param.rx_win_size =
MLAN_UAP_COEX_AMPDU_DEF_RXWINSIZE;
#endif
priv->add_ba_param.rx_win_size =
MIN(priv->add_ba_param.rx_win_size,
priv->user_rxwinsize);
} else {
priv->add_ba_param.rx_win_size =
priv->user_rxwinsize;
@ -1452,8 +1459,8 @@ static void wlan_update_ampdu_rxwinsize(pmlan_adapter pmadapter, t_u8 coex_flag)
pmadapter->coex_rx_win_size;
if (rx_win_size != priv->add_ba_param.rx_win_size) {
if (priv->media_connected == MTRUE) {
for (i = 0; i < MAX_NUM_TID; i++)
wlan_11n_delba(priv, i);
for (j = 0; j < MAX_NUM_TID; j++)
wlan_11n_delba(priv, j);
wlan_recv_event(
priv,
MLAN_EVENT_ID_DRV_DEFER_HANDLING,

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

@ -57,6 +57,20 @@ Change Log:
Local Functions
********************************************************/
#ifdef STA_SUPPORT
/**
* @brief This function check if the command was cancel scan command
*
* @param pcmd A pointer to HostCmd_DS_COMMAND structure
* @return N/A
*/
static t_u8 wlan_is_cancel_scan_cmd(HostCmd_DS_COMMAND *pcmd)
{
HostCmd_DS_802_11_SCAN_EXT *pext_scan_cmd = &pcmd->params.ext_scan;
if (pext_scan_cmd->ext_scan_type == EXT_SCAN_CANCEL)
return MTRUE;
else
return MFALSE;
}
/**
* @brief This function inserts scan command node to scan_pending_q.
*
@ -120,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;
@ -486,6 +501,7 @@ static t_void wlan_dump_info(mlan_adapter *pmadapter, t_u8 reason)
pmadapter->pps_uapsd_mode, pmadapter->sleep_period.period);
PRINTM(MERROR, "tx_lock_flag = %d\n", pmadapter->tx_lock_flag);
PRINTM(MERROR, "scan_processing = %d\n", pmadapter->scan_processing);
PRINTM(MERROR, "scan_state = 0x%x\n", pmadapter->scan_state);
PRINTM(MERROR, "bypass_pkt_count=%d\n", pmadapter->bypass_pkt_count);
#ifdef SDIO
if (IS_SD(pmadapter->card_type)) {
@ -1114,9 +1130,9 @@ static mlan_status wlan_cmd_host_cmd(pmlan_private pmpriv,
*
* @return timeout value for this command
*/
static t_u16 wlan_get_cmd_timeout(t_u16 cmd_id)
static t_u32 wlan_get_cmd_timeout(t_u16 cmd_id)
{
t_u16 timeout;
t_u32 timeout;
ENTER();
switch (cmd_id) {
case HostCmd_CMD_802_11_SCAN:
@ -1197,7 +1213,7 @@ static mlan_status wlan_dnld_cmd_to_fw(mlan_private *pmpriv,
#ifdef DEBUG_LEVEL1
t_u32 sec = 0, usec = 0;
#endif
t_u16 timeout = 0;
t_u32 timeout = 0;
ENTER();
@ -1284,6 +1300,9 @@ static mlan_status wlan_dnld_cmd_to_fw(mlan_private *pmpriv,
}
#endif
if (pcmd->command == HostCmd_CMD_802_11_SCAN_EXT)
pmadapter->scan_state |= wlan_get_ext_scan_state(pcmd);
PRINTM_GET_SYS_TIME(MCMND, &sec, &usec);
PRINTM_NETINTF(MCMND, pmpriv);
PRINTM(MCMND,
@ -1919,7 +1938,15 @@ mlan_status wlan_prepare_cmd(mlan_private *pmpriv, t_u16 cmd_no,
#ifdef STA_SUPPORT
if (cmd_no == HostCmd_CMD_802_11_SCAN ||
cmd_no == HostCmd_CMD_802_11_SCAN_EXT) {
wlan_queue_scan_cmd(pmpriv, pcmd_node);
if (cmd_no == HostCmd_CMD_802_11_SCAN_EXT &&
pmadapter->ext_scan && pmadapter->ext_scan_enh &&
pmadapter->ext_scan_type == EXT_SCAN_ENHANCE &&
wlan_is_cancel_scan_cmd(cmd_ptr)) {
wlan_insert_cmd_to_pending_q(pmadapter, pcmd_node,
MFALSE);
} else
wlan_queue_scan_cmd(pmpriv, pcmd_node);
} else {
#endif
if ((cmd_no == HostCmd_CMD_802_11_HS_CFG_ENH) &&
@ -2257,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 =
@ -2318,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;
@ -4016,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
@ -4034,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));
}
@ -4076,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);
@ -4237,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
@ -5053,6 +5090,8 @@ mlan_status wlan_ret_get_hw_spec(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
MrvlIEtypes_Extension_t *ext_tlv = MNULL;
MrvlIEtypes_fw_cap_info_t *fw_cap_tlv = MNULL;
MrvlIEtypes_Secure_Boot_Uuid_t *sb_uuid_tlv = MNULL;
ENTER();
pmadapter->fw_cap_info = wlan_le32_to_cpu(hw_spec->fw_cap_info);
@ -5349,6 +5388,13 @@ mlan_status wlan_ret_get_hw_spec(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
PRINTM(MCMND, "fw_cap_info=0x%x fw_cap_ext=0x%x\n",
pmadapter->fw_cap_info, pmadapter->fw_cap_ext);
break;
case TLV_TYPE_SECURE_BOOT_UUID:
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: %016llx%016llx\n",
pmadapter->uuid_lo, pmadapter->uuid_hi);
break;
default:
break;
}
@ -7744,8 +7790,10 @@ static void wlan_fill_link_statistic(mlan_private *priv,
.get_link_statistic;
/* TLV parse */
left_len = resp->size - sizeof(HostCmd_DS_802_11_LINK_STATISTIC) -
S_DS_GEN;
if (resp->size > (sizeof(HostCmd_DS_802_11_LINK_STATISTIC) - S_DS_GEN))
left_len = resp->size -
sizeof(HostCmd_DS_802_11_LINK_STATISTIC) - S_DS_GEN;
tlv = (MrvlIEtypesHeader_t *)(plink_stat->value);
DBG_HEXDUMP(MDAT_D, "tlv:", (void *)tlv, 1024);
while (left_len > sizeof(MrvlIEtypesHeader_t)) {
@ -9137,6 +9185,7 @@ mlan_status wlan_ret_mc_aggr_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function prepares command of ch_load
*
@ -9159,9 +9208,13 @@ mlan_status wlan_cmd_get_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_GET_CH_LOAD) + S_DS_GEN);
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;
}
/**
* @brief This function handles the command response of ch_load
*
@ -9174,15 +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;
mlan_ds_misc_cfg *misc_cfg = MNULL;
ENTER();
if (pioctl_buf) {
misc_cfg = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
misc_cfg->param.ch_load.ch_load_param =
wlan_le16_to_cpu(cfg_cmd->ch_load);
}
LEAVE();
return MLAN_STATUS_SUCCESS;
}

View file

@ -24,7 +24,7 @@
#define _MLAN_DECL_H_
/** MLAN release version */
#define MLAN_RELEASE_VERSION "322"
#define MLAN_RELEASE_VERSION "366.p5"
/** 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
@ -432,7 +427,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** SD8977 Card */
#define CARD_SD8977 "SD8977"
/** SD8978 Card */
#define CARD_SD8978 "SD8978"
#define CARD_SD8978 "SDIW416"
/** SD8997 Card */
#define CARD_SD8997 "SD8997"
/** SD8987 Card */
@ -442,7 +437,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** SD9098 Card */
#define CARD_SD9098 "SD9098"
/** SD9177 Card */
#define CARD_SD9177 "SD9177"
#define CARD_SD9177 "SDIW612"
/** SD8801 Card */
#define CARD_SD8801 "SD8801"
/** SDNW62X Card */
@ -481,6 +476,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define CARD_PCIEAW690 "PCIEAW690"
/** PCIENW62X Card */
#define CARD_PCIENW62X "PCIENW62X"
/** PCIEIW629 Card */
#define CARD_PCIEIW629 "PCIEIW629"
#endif
#ifdef USB
@ -514,7 +511,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** USB8997 Card */
#define CARD_USB8997 "USB8997"
/** USB8978 Card */
#define CARD_USB8978 "USB8978"
#define CARD_USB8978 "USBIW416"
/** USB9098 Card */
#define CARD_USB9098 "USB9098"
/** USB9097 Card */
@ -632,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
@ -690,6 +689,18 @@ typedef enum _mlan_buf_type {
#endif
} mlan_buf_type;
#define SCAN_STATE_SCAN_START MBIT(0)
#define SCAN_STATE_EXT_SCAN MBIT(1)
#define SCAN_STATE_EXT_SCAN_ENH MBIT(2)
#define SCAN_STATE_EXT_SCAN_CANCEL MBIT(3)
#define SCAN_STATE_EXT_SCAN_CMDRESP MBIT(4)
#define SCAN_STATE_EXT_SCAN_ENH_CMDRESP MBIT(5)
#define SCAN_STATE_EXT_SCAN_CANCEL_CMDRESP MBIT(6)
#define SCAN_STATE_EXT_SCAN_RESULT MBIT(7)
#define SCAN_STATE_LAST_EXT_SCAN_RESULT MBIT(8)
#define SCAN_STATE_EXT_SCAN_STATUS MBIT(9)
#define SCAN_STATE_SCAN_COMPLETE MBIT(10)
#ifdef USB
/** mlan_usb_ep */
typedef enum _mlan_usb_ep {
@ -896,8 +907,8 @@ enum mlan_channel_type {
/** channel band */
enum { BAND_2GHZ = 0,
BAND_5GHZ = 1,
BAND_4GHZ = 2,
BAND_6GHZ = 3,
BAND_6GHZ = 2,
BAND_4GHZ = 3,
};
/** channel offset */
@ -946,8 +957,26 @@ 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 {
#ifdef BIG_ENDIAN_SUPPORT
/** Channel Selection Mode - (00)=manual, (01)=ACS, (02)=user*/
t_u8 scanMode : 2;
/** Secondary Channel Offset - (00)=None, (01)=Above, (11)=Below */
t_u8 chan2Offset : 2;
/** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */
t_u8 chanWidth : 2;
/** Band Info - (00)=2.4GHz, (01)=5GHz */
t_u8 chanBand : 2;
#else
/** Band Info - (00)=2.4GHz, (01)=5GHz */
t_u8 chanBand : 2;
/** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */
@ -956,6 +985,7 @@ typedef MLAN_PACK_START struct _Band_Config_t {
t_u8 chan2Offset : 2;
/** Channel Selection Mode - (00)=manual, (01)=ACS, (02)=Adoption mode*/
t_u8 scanMode : 2;
#endif
} MLAN_PACK_END Band_Config_t;
/** channel_band_t */
@ -1157,6 +1187,16 @@ typedef MLAN_PACK_START struct _radiotap_info {
/** txpower structure */
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
/** Host tx power ctrl:
0x0: use fw setting for TX power
0x1: value specified in bit[6] and bit[5:0] are valid */
t_u8 hostctl : 1;
/** Sign of the power specified in bit[5:0] */
t_u8 sign : 1;
/** Power to be used for transmission(in dBm) */
t_u8 abs_val : 6;
#else
/** Power to be used for transmission(in dBm) */
t_u8 abs_val : 6;
/** Sign of the power specified in bit[5:0] */
@ -1165,6 +1205,7 @@ typedef MLAN_PACK_START struct {
0x0: use fw setting for TX power
0x1: value specified in bit[6] and bit[5:0] are valid */
t_u8 hostctl : 1;
#endif
} MLAN_PACK_END tx_power_t;
/* pkt_txctrl */
typedef MLAN_PACK_START struct _pkt_txctrl {
@ -1991,7 +2032,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
@ -2291,8 +2341,12 @@ typedef struct _mlan_device {
t_u32 drv_mode;
/** dfs w53 cfg */
t_u8 dfs53cfg;
/** dfs_offload */
t_u8 dfs_offload;
/** extend enhance scan */
t_u8 ext_scan;
/* mcs32 setting */
t_u8 mcs32;
} mlan_device, *pmlan_device;
/** MLAN API function prototype */

View file

@ -546,6 +546,9 @@ typedef enum _WLAN_802_11_WEP_STATUS {
/** TLV type: fw cap info */
#define TLV_TYPE_FW_CAP_INFO (PROPRIETARY_TLV_BASE_ID + 318)
/** TLV type: secure boot uuid */
#define TLV_TYPE_SECURE_BOOT_UUID (PROPRIETARY_TLV_BASE_ID + 348)
/** ADDBA TID mask */
#define ADDBA_TID_MASK (MBIT(2) | MBIT(3) | MBIT(4) | MBIT(5))
/** DELBA TID mask */
@ -1351,6 +1354,7 @@ typedef enum _WLAN_802_11_WEP_STATUS {
#define HostCmd_CMD_802_11_BAND_STEERING 0x026f
/*** Host Command ID " MC_AGGR_CFG */
#define HostCmd_CMD_MC_AGGR_CFG 0x027a
#define HostCmd_CMD_802_11_STATS 0x0014
#define HostCmd_CMD_GET_CH_LOAD 0x027b
/** Host Command ID : TDLS configuration */
@ -1619,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
@ -2078,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
@ -2257,6 +2266,43 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_TDLS_Idle_Timeout_t {
#define TXPD_RETRY_ENABLE MBIT(12)
/** tx_control*/
#ifdef BIG_ENDIAN_SUPPORT
typedef MLAN_PACK_START struct _tx_ctrl {
/** reserved */
t_u32 reserved : 3;
/** mc retry packet */
t_u32 mc_pkt_retry : 1;
/** end of mc AMPDU */
t_u32 mc_ampdu_end : 1;
/** start of mc AMPDU */
t_u32 mc_ampdu_start : 1;
/** End of mc cycle */
t_u32 mc_cycle_end : 1;
/** start of mc cycle */
t_u32 mc_cycle_start : 1;
/** bw 0-20MHz, 1-40MHz */
t_u32 bw : 3;
/** Rate used for transmission MCS0-7*/
t_u32 tx_rate : 5;
/** Control the use of txRate. 0 - use FW setting, 1 - use the specified
* txRate;*/
t_u32 host_txrate_ctrl : 1;
/** 0/1 - use FW setting, 2 - ACK_IMMD, 3 - NO_ACK.*/
t_u32 ack_policy : 2;
/** Control the use of retryLimit. 0 - use FW setting, 1 - use the
* specified retryLimit.*/
t_u32 host_retry_ctrl : 1;
/** retry limit */
t_u32 retry_limit : 4;
/** Control the use of txPower. 0 - use FW power setting, 1 - use the
* specified txPower.*/
t_u32 host_tx_powerctrl : 1;
/** Sign of the txPower, 0 - positive_sign(+), 1 - negative_sign(-). */
t_u32 tx_power_sign : 1;
/** Power used for transmission(in dBm); */
t_u32 tx_power : 6;
} MLAN_PACK_END tx_ctrl;
#else
typedef MLAN_PACK_START struct _tx_ctrl {
/** Power used for transmission(in dBm); */
t_u32 tx_power : 6;
@ -2292,6 +2338,7 @@ typedef MLAN_PACK_START struct _tx_ctrl {
/** reserved */
t_u32 reserved : 3;
} MLAN_PACK_END tx_ctrl;
#endif
/** mc tx ctrl */
typedef MLAN_PACK_START struct _mc_tx_ctrl {
@ -2374,6 +2421,32 @@ typedef MLAN_PACK_START struct _RxPD {
} MLAN_PACK_END RxPD, *PRxPD;
/** IEEEtypes_FrameCtl_t*/
#ifdef BIG_ENDIAN_SUPPORT
typedef MLAN_PACK_START struct _IEEEtypes_FrameCtl_t {
/** Order */
t_u8 order : 1;
/** Wep */
t_u8 wep : 1;
/** More Data */
t_u8 more_data : 1;
/** Power Mgmt */
t_u8 pwr_mgmt : 1;
/** Retry */
t_u8 retry : 1;
/** More Frag */
t_u8 more_frag : 1;
/** From DS */
t_u8 from_ds : 1;
/** To DS */
t_u8 to_ds : 1;
/** Sub Type */
t_u8 sub_type : 4;
/** Type */
t_u8 type : 2;
/** Protocol Version */
t_u8 protocol_version : 2;
} MLAN_PACK_END IEEEtypes_FrameCtl_t;
#else
typedef MLAN_PACK_START struct _IEEEtypes_FrameCtl_t {
/** Protocol Version */
t_u8 protocol_version : 2;
@ -2398,6 +2471,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_FrameCtl_t {
/** Order */
t_u8 order : 1;
} MLAN_PACK_END IEEEtypes_FrameCtl_t;
#endif
/** MrvlIETypes_MgmtFrameSet_t */
typedef MLAN_PACK_START struct _MrvlIETypes_MgmtFrameSet_t {
@ -2508,6 +2582,24 @@ typedef MLAN_PACK_START struct _parsed_region_chan_11d {
/** ChanScanMode_t */
typedef MLAN_PACK_START struct _ChanScanMode_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 reserved_7 : 1;
/** First passive scan then active scan */
t_u8 passive_to_active_scan : 1;
/** First channel in scan */
t_u8 first_chan : 1;
/** Enable hidden ssid report */
t_u8 hidden_ssid_report : 1;
/** Enable probe response timeout */
t_u8 rsp_timeout_en : 1;
/** Multidomain scan mode */
t_u8 multidomain_scan : 1;
/** Disble channel filtering flag */
t_u8 disable_chan_filt : 1;
/** Channel scan mode passive flag */
t_u8 passive_scan : 1;
#else
/** Channel scan mode passive flag */
t_u8 passive_scan : 1;
/** Disble channel filtering flag */
@ -2524,6 +2616,7 @@ typedef MLAN_PACK_START struct _ChanScanMode_t {
t_u8 passive_to_active_scan : 1;
/** Reserved */
t_u8 reserved_7 : 1;
#endif
} MLAN_PACK_END ChanScanMode_t;
/** ChanScanParamSet_t */
@ -2980,24 +3073,50 @@ typedef MLAN_PACK_START struct _HostCmd_DS_GTK_REKEY_PARAMS {
/** Data structure of WMM QoS information */
typedef MLAN_PACK_START struct _WmmQosInfo_t {
#ifdef BIG_ENDIAN_SUPPORT
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
/** Reserved */
t_u8 reserved : 3;
/** Parameter set count */
t_u8 para_set_count : 4;
#else
/** Parameter set count */
t_u8 para_set_count : 4;
/** Reserved */
t_u8 reserved : 3;
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END WmmQosInfo_t, *pWmmQosInfo_t;
/** Data structure of WMM ECW */
typedef MLAN_PACK_START struct _WmmEcw_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Maximum Ecw */
t_u8 ecw_max : 4;
/** Minimum Ecw */
t_u8 ecw_min : 4;
#else
/** Minimum Ecw */
t_u8 ecw_min : 4;
/** Maximum Ecw */
t_u8 ecw_max : 4;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END WmmEcw_t, *pWmmEcw_t;
/** Data structure of WMM Aci/Aifsn */
typedef MLAN_PACK_START struct _WmmAciAifsn_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 reserved : 1;
/** Aci */
t_u8 aci : 2;
/** Acm */
t_u8 acm : 1;
/** Aifsn */
t_u8 aifsn : 4;
#else
/** Aifsn */
t_u8 aifsn : 4;
/** Acm */
@ -3006,6 +3125,7 @@ typedef MLAN_PACK_START struct _WmmAciAifsn_t {
t_u8 aci : 2;
/** Reserved */
t_u8 reserved : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END WmmAciAifsn_t, *pWmmAciAifsn_t;
/** Data structure of WMM AC parameters */
@ -3158,6 +3278,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 */
@ -3284,14 +3412,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 */
@ -3497,10 +3617,34 @@ typedef MLAN_PACK_START struct _HostCmd_DS_MC_AGGR_CFG {
/** CTS2Self duration offset */
t_u16 cts2self_offset;
} MLAN_PACK_END HostCmd_DS_MC_AGGR_CFG;
/** Stats_Cfg_Params_TLV */
typedef struct MLAN_PACK_START _Stats_Cfg_Params_TLV {
/** tlvHeader */
MrvlIEtypesHeader_t tlvHeader;
/** op */
t_u8 op;
/** reserved */
t_u8 reserved;
/** mac */
mlan_802_11_mac_addr mac;
} MLAN_PACK_END Stats_Cfg_Params_TLV_t;
/** HostCmd_DS_STATS */
typedef MLAN_PACK_START struct _HostCmd_DS_STATS {
/** Action */
t_u16 action;
/** TLV buffer */
t_u8 tlv_buffer[1];
} MLAN_PACK_END HostCmd_DS_STATS;
typedef MLAN_PACK_START struct _HostCmd_DS_GET_CH_LOAD {
/** Action */
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;
/** HostCmd_DS_CMD_802_11_RSSI_INFO */
@ -5259,9 +5403,15 @@ typedef MLAN_PACK_START struct {
*/
typedef MLAN_PACK_START struct {
mlan_wmm_queue_stats_action_e action; /**< Start, Stop, or Get */
#ifdef BIG_ENDIAN_SUPPORT
t_u8 select_bin : 7; /**< WMM_AC_BK(0) to WMM_AC_VO(3), or TID */
t_u8 select_is_userpri : 1; /**< Set if select_bin is UP, Clear for AC
*/
#else
t_u8 select_is_userpri : 1; /**< Set if select_bin is UP, Clear for AC
*/
t_u8 select_bin : 7; /**< WMM_AC_BK(0) to WMM_AC_VO(3), or TID */
#endif
t_u16 pkt_count; /**< Number of successful packets transmitted */
t_u16 pkt_loss; /**< Packets lost; not included in pktCount */
t_u32 avg_queue_delay; /**< Average Queue delay in microsec */
@ -5934,6 +6084,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:
@ -6264,9 +6433,12 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_MacAddr_t {
/** TLV type : AP WMM params */
#define TLV_TYPE_AP_WMM_PARAM (PROPRIETARY_TLV_BASE_ID + 0xd0) /* 0x01d0 */
/** TLV type : AP Tx beacon rate */
#define TLV_TYPE_UAP_TX_BEACON_RATE \
(PROPRIETARY_TLV_BASE_ID + 288) /* 0x0220 \
*/
#define TLV_TYPE_UAP_TX_BEACON_RATE (PROPRIETARY_TLV_BASE_ID + 288) /* 0x0220 \
*/
#define NXP_802_11_PER_PEER_STATS_CFG_TLV_ID \
(PROPRIETARY_TLV_BASE_ID + 346) /* 0x025A */
#define NXP_802_11_PER_PEER_STATS_ENTRY_TLV_ID \
(PROPRIETARY_TLV_BASE_ID + 347) /* 0x025B */
/** MrvlIEtypes_beacon_period_t */
typedef MLAN_PACK_START struct _MrvlIEtypes_beacon_period_t {
@ -7090,6 +7262,20 @@ typedef MLAN_PACK_START enum _MeasType_t {
* @brief Mode octet of the measurement request element (7.3.2.21)
*/
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
/**< Reserved */
t_u8 rsvd5_7 : 3;
/**< 11k: duration spec. for meas. is mandatory */
t_u8 duration_mandatory : 1;
/**< 11h: en/disable report rcpt. of spec. type */
t_u8 report : 1;
/**< 11h: en/disable requests of specified type */
t_u8 request : 1;
/**< 11h: enable report/request bits */
t_u8 enable : 1;
/**< 11k: series or parallel with previous meas */
t_u8 parallel : 1;
#else
/**< 11k: series or parallel with previous meas */
t_u8 parallel : 1;
/**< 11h: enable report/request bits */
@ -7102,6 +7288,7 @@ typedef MLAN_PACK_START struct {
t_u8 duration_mandatory : 1;
/**< Reserved */
t_u8 rsvd5_7 : 3;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END MeasReqMode_t;
@ -7146,10 +7333,17 @@ typedef union {
* @brief Mode octet of the measurement report element (7.3.2.22)
*/
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
t_u8 rsvd3_7 : 5; /**< Reserved */
t_u8 refused : 1; /**< Measurement refused */
t_u8 incapable : 1; /**< Incapable of performing measurement */
t_u8 late : 1; /**< Start TSF time missed for measurement */
#else
t_u8 late : 1; /**< Start TSF time missed for measurement */
t_u8 incapable : 1; /**< Incapable of performing measurement */
t_u8 refused : 1; /**< Measurement refused */
t_u8 rsvd3_7 : 5; /**< Reserved */
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END MeasRptMode_t;
@ -7930,6 +8124,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
@ -7999,6 +8194,7 @@ typedef struct MLAN_PACK_START _HostCmd_DS_COMMAND {
HostCmd_DS_HAL_PHY_CFG hal_phy_cfg_params;
HostCmd_DS_IPS_CONFIG ips_cfg;
HostCmd_DS_MC_AGGR_CFG mc_aggr_cfg;
HostCmd_DS_STATS stats;
HostCmd_DS_GET_CH_LOAD ch_load;
} params;
} MLAN_PACK_END HostCmd_DS_COMMAND, *pHostCmd_DS_COMMAND;
@ -8027,6 +8223,15 @@ typedef struct MLAN_PACK_START _opt_sleep_confirm_buffer {
OPT_Confirm_Sleep ps_cfm_sleep;
} MLAN_PACK_END opt_sleep_confirm_buffer;
typedef MLAN_PACK_START struct _MrvlIEtypes_Secure_Boot_Uuid_t {
/** Header */
MrvlIEtypesHeader_t header;
/** Secure boot uuid lower and higher 8 bytes */
t_u64 uuid_lo;
t_u64 uuid_hi;
} MLAN_PACK_END MrvlIEtypes_Secure_Boot_Uuid_t;
/** req host side download vdll block */
#define VDLL_IND_TYPE_REQ 0
/** notify vdll start offset in firmware image */

View file

@ -46,10 +46,17 @@ typedef enum _WLAN_802_11_NETWORK_TYPE {
Wlan802_11NetworkTypeMax
} WLAN_802_11_NETWORK_TYPE;
#ifdef BIG_ENDIAN_SUPPORT
/** Frame control: Type Mgmt frame */
#define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 0x3000
/** Frame control: SubType Mgmt frame */
#define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc)&0xF000) >> 12)
#else
/** Frame control: Type Mgmt frame */
#define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 0x000C
/** Frame control: SubType Mgmt frame */
#define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc)&0x00F0) >> 4)
#endif
#ifdef PRAGMA_PACK
#pragma pack(push, 1)
@ -172,12 +179,21 @@ typedef MLAN_PACK_START struct _IEEEtypes_Generic_t {
/**ft capability policy*/
typedef MLAN_PACK_START struct _IEEEtypes_FtCapPolicy_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 reserved : 6;
/** RIC support */
t_u8 ric : 1;
/** FT over the DS capable */
t_u8 ft_over_ds : 1;
#else
/** FT over the DS capable */
t_u8 ft_over_ds : 1;
/** RIC support */
t_u8 ric : 1;
/** Reserved */
t_u8 reserved : 6;
#endif
} MLAN_PACK_END IEEEtypes_FtCapPolicy_t;
/** Mobility domain IE */
@ -310,6 +326,25 @@ typedef MLAN_PACK_START struct _TLV_Generic_t {
#define CAPINFO_MASK (~(MBIT(15) | MBIT(14) | MBIT(11) | MBIT(9)))
/** Capability Bit Map*/
#ifdef BIG_ENDIAN_SUPPORT
typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
t_u8 rsrvd1 : 2;
t_u8 dsss_ofdm : 1;
t_u8 radio_measurement : 1;
t_u8 rsvrd2 : 1;
t_u8 short_slot_time : 1;
t_u8 rsrvd3 : 1;
t_u8 spectrum_mgmt : 1;
t_u8 chan_agility : 1;
t_u8 pbcc : 1;
t_u8 short_preamble : 1;
t_u8 privacy : 1;
t_u8 cf_poll_rqst : 1;
t_u8 cf_pollable : 1;
t_u8 ibss : 1;
t_u8 ess : 1;
} MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
#else
typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
/** Capability Bit Map : ESS */
t_u8 ess : 1;
@ -342,6 +377,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
/** Capability Bit Map : Reserved */
t_u8 rsrvd1 : 2;
} MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
#endif /* BIG_ENDIAN_SUPPORT */
/** IEEEtypes_Ssid_t */
typedef MLAN_PACK_START struct _IEEEtypes_Ssid_t {
@ -556,16 +592,35 @@ typedef MLAN_PACK_START struct _IEEEtypes_Wpa_t {
/** Data structure of WMM QoS information */
typedef MLAN_PACK_START struct _IEEEtypes_WmmQosInfo_t {
#ifdef BIG_ENDIAN_SUPPORT
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
/** Reserved */
t_u8 reserved : 3;
/** Parameter set count */
t_u8 para_set_count : 4;
#else
/** Parameter set count */
t_u8 para_set_count : 4;
/** Reserved */
t_u8 reserved : 3;
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END IEEEtypes_WmmQosInfo_t, *pIEEEtypes_WmmQosInfo_t;
/** Data structure of WMM Aci/Aifsn */
typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 reserved : 1;
/** Aci */
t_u8 aci : 2;
/** Acm */
t_u8 acm : 1;
/** Aifsn */
t_u8 aifsn : 4;
#else
/** Aifsn */
t_u8 aifsn : 4;
/** Acm */
@ -574,14 +629,22 @@ typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t {
t_u8 aci : 2;
/** Reserved */
t_u8 reserved : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END IEEEtypes_WmmAciAifsn_t, *pIEEEtypes_WmmAciAifsn_t;
/** Data structure of WMM ECW */
typedef MLAN_PACK_START struct _IEEEtypes_WmmEcw_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Maximum Ecw */
t_u8 ecw_max : 4;
/** Minimum Ecw */
t_u8 ecw_min : 4;
#else
/** Minimum Ecw */
t_u8 ecw_min : 4;
/** Maximum Ecw */
t_u8 ecw_max : 4;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END IEEEtypes_WmmEcw_t, *pIEEEtypes_WmmEcw_t;
/** Data structure of WMM AC parameters */
@ -669,6 +732,22 @@ typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e {
/** Data structure of WMM TSPEC information */
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
t_u8 Reserved17_23 : 7; /* ! Reserved */
t_u8 Schedule : 1;
IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2;
t_u8 UserPri : 3; /* ! 802.1d User Priority */
// IEEEtypes_WMM_TSPEC_TS_Info_PSB_e PowerSaveBehavior : 1; /*
// !Legacy/Trigg*/
t_u8 PowerSaveBehavior : 1;
t_u8 Aggregation : 1; /* ! Reserved */
t_u8 AccessPolicy2 : 1; /* ! */
t_u8 AccessPolicy1 : 1; /* ! */
IEEEtypes_WMM_TSPEC_TS_Info_Direction_e Direction : 2;
t_u8 TID : 4; /* ! Unique identifier */
// IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1;
t_u8 TrafficType : 1;
#else
// IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1;
t_u8 TrafficType : 1;
t_u8 TID : 4; /* ! Unique identifier */
@ -683,19 +762,31 @@ typedef MLAN_PACK_START struct {
IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2;
t_u8 Schedule : 1;
t_u8 Reserved17_23 : 7; /* ! Reserved */
#endif
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_t;
/** Data structure of WMM TSPEC Nominal Size */
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is
nominal */
t_u16 Size : 15; /* ! Nominal size in octets */
#else
t_u16 Size : 15; /* ! Nominal size in octets */
t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is
nominal */
#endif
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_NomMSDUSize_t;
/** Data structure of WMM TSPEC SBWA */
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
t_u16 Whole : 3; /* ! Whole portion */
t_u16 Fractional : 13; /* ! Fractional portion */
#else
t_u16 Fractional : 13; /* ! Fractional portion */
t_u16 Whole : 3; /* ! Whole portion */
#endif
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_SBWA;
/** Data structure of WMM TSPEC Body */
@ -1036,6 +1127,26 @@ typedef MLAN_PACK_START struct _VHT_MCS_set {
/** VHT Capabilities info field, reference 802.11ac D1.4 p89 */
typedef MLAN_PACK_START struct _VHT_capa {
#if 0
#ifdef BIG_ENDIAN_SUPPORT
t_u8 mpdu_max_len:2;
t_u8 chan_width:2;
t_u8 rx_LDPC:1;
t_u8 sgi_80:1;
t_u8 sgi_160:1;
t_u8 tx_STBC:1;
t_u8 rx_STBC:3;
t_u8 SU_beamformer_capa:1;
t_u8 SU_beamformee_capa:1;
t_u8 beamformer_ante_num:3;
t_u8 sounding_dim_num:3;
t_u8 MU_beamformer_capa:1;
t_u8 MU_beamformee_capa:1;
t_u8 VHT_TXOP_ps:1;
t_u8 HTC_VHT_capa:1;
t_u8 max_ampdu_len:3;
t_u8 link_apapt_capa:2;
t_u8 reserved_1:4;
#else
t_u8 reserved_1:4;
t_u8 link_apapt_capa:2;
t_u8 max_ampdu_len:3;
@ -1054,6 +1165,7 @@ typedef MLAN_PACK_START struct _VHT_capa {
t_u8 rx_LDPC:1;
t_u8 chan_width:2;
t_u8 mpdu_max_len:2;
#endif /* BIG_ENDIAN_SUPPORT */
#endif
t_u32 vht_cap_info;
VHT_MCS_set_t mcs_sets;
@ -1162,6 +1274,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_Extension_t {
} MLAN_PACK_END IEEEtypes_Extension_t, *pIEEEtypes_Extension_t;
typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Max HE-MAC for 8 SS */
t_u8 max_mcs_8ss : 2;
/** Max HE-MAC for 7 SS */
t_u8 max_mcs_7ss : 2;
/** Max HE-MAC for 6 SS */
t_u8 max_mcs_6ss : 2;
/** Max HE-MAC for 5 SS */
t_u8 max_mcs_5ss : 2;
/** Max HE-MAC for 4 SS */
t_u8 max_mcs_4ss : 2;
/** Max HE-MAC for 3 SS */
t_u8 max_mcs_3ss : 2;
/** Max HE-MAC for 2 SS */
t_u8 max_mcs_2ss : 2;
/** Max HE-MAC for 1 SS */
t_u8 max_mcs_1ss : 2;
#else
/** Max HE-MAC for 1 SS */
t_u8 max_mcs_1ss : 2;
/** Max HE-MAC for 2 SS */
@ -1178,6 +1308,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t {
t_u8 max_mcs_7ss : 2;
/** Max HE-MAC for 8 SS */
t_u8 max_mcs_8ss : 2;
#endif
} MLAN_PACK_END IEEEtypes_HeMcsMap_t, *pIEEEtypes_HeMcsMap_t;
typedef MLAN_PACK_START struct _IEEEtypes_HeMcsNss_t {
@ -1204,6 +1335,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_HECap_t {
} MLAN_PACK_END IEEEtypes_HECap_t, *pIEEEtypes_HECap_t;
typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved, including 6G Operation Info Pressent (bit17) */
t_u8 reserved : 6; /* bit 18-23 */
/* 6g operation info present */
t_u8 he_6g_op_info_present : 1; /* bit 17 */
/** ER SU Disable */
t_u8 er_su_disable : 1; /* bit 16 */
/** Co-Hosted BSS */
t_u16 co_located_bss : 1; /* bit 15 */
/** VHT Operation Info Present */
t_u16 vht_op_info_present : 1; /* bit 14 */
/** TXOP Duration RTS Threshold */
t_u16 txop_dur_rts_threshold : 10; /* bit 4-13 */
/** TWT Required */
t_u16 twt_req : 1; /* bit 3 */
/** Default PE Duration */
t_u16 default_pe_dur : 3; /* bit 0-2 */
#else
/** Default PE Duration */
t_u16 default_pe_dur : 3; /* bit 0-2 */
/** TWT Required */
@ -1216,17 +1365,29 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t {
t_u16 co_located_bss : 1; /* bit 15 */
/** ER SU Disable */
t_u8 er_su_disable : 1; /* bit 16 */
/** Reserved, including 6G Operation Info Pressent (bit17) */
t_u8 reserved : 7; /* bit 17-23 */
/* 6g operation info present */
t_u8 he_6g_op_info_present : 1; /* bit 17 */
/** Reserved bit 18-23 */
t_u8 reserved : 6; /* bit 18-23 */
#endif
} MLAN_PACK_END IEEEtypes_HeOpParam_t;
typedef MLAN_PACK_START struct _IEEEtypes_HeBssColorInfo_t {
#ifdef BIG_ENDIAN_SUPPORT
/** BSS Color Disabled */
t_u8 bss_color_disabled : 1; /* bit 7 */
/** Partial BSS Color */
t_u8 partial_bss_color : 1; /* bit 6 */
/** BSS Color */
t_u8 bss_color : 6; /* bit 0-5 */
#else
/** BSS Color */
t_u8 bss_color : 6; /* bit 0-5 */
/** Partial BSS Color */
t_u8 partial_bss_color : 1; /* bit 6 */
/** BSS Color Disabled */
t_u8 bss_color_disabled : 1; /* bit 7 */
#endif
} MLAN_PACK_END IEEEtypes_HeBssColorInfo_t;
typedef MLAN_PACK_START struct _IEEEtypes_HeOp_t {
@ -1388,6 +1549,20 @@ typedef MLAN_PACK_START struct {
*** @brief Map octet of the basic measurement report (7.3.2.22.1)
**/
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
/**< Reserved */
t_u8 rsvd5_7 : 3;
/**< Channel is unmeasured */
t_u8 unmeasured : 1;
/**< Radar detected on channel */
t_u8 radar : 1;
/**< Unidentified signal found on channel */
t_u8 unidentified_sig : 1;
/**< OFDM preamble detected on channel */
t_u8 ofdm_preamble : 1;
/**< At least one valid MPDU received on channel */
t_u8 bss : 1;
#else
/**< At least one valid MPDU received on channel */
t_u8 bss : 1;
/**< OFDM preamble detected on channel */
@ -1400,6 +1575,7 @@ typedef MLAN_PACK_START struct {
t_u8 unmeasured : 1;
/**< Reserved */
t_u8 rsvd5_7 : 3;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END MeasRptBasicMap_t;
@ -1635,6 +1811,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*/
@ -1657,7 +1835,10 @@ typedef MLAN_PACK_START struct {
/**wait for all channel scan to complete to report scan result*/
#define BG_SCAN_WAIT_ALL_CHAN_DONE 0x80000000
/** Maximum number of channels that can be sent in bg scan config */
#define WLAN_BG_SCAN_CHAN_MAX 38
#define CHAN_MAX_24G 14
#define CHAN_MAX_5G 24
#define CHAN_MAX_UNII4 3
#define WLAN_BG_SCAN_CHAN_MAX (CHAN_MAX_24G + CHAN_MAX_5G + CHAN_MAX_UNII4)
/** Enumeration definition */
/** EES MODE */

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 =
@ -1470,6 +1470,7 @@ done:
static void wlan_update_hw_spec(pmlan_adapter pmadapter)
{
t_u32 i;
MrvlIEtypes_He_cap_t *user_he_cap_tlv = MNULL;
ENTER();
@ -1582,6 +1583,28 @@ static void wlan_update_hw_spec(pmlan_adapter pmadapter)
pmadapter->hw_he_cap,
pmadapter->hw_hecap_len,
sizeof(pmadapter->priv[i]->user_he_cap));
user_he_cap_tlv =
(MrvlIEtypes_He_cap_t *)&pmadapter
->priv[i]
->user_2g_he_cap;
if (pmadapter->priv[i]->bss_role ==
MLAN_BSS_ROLE_STA)
user_he_cap_tlv->he_mac_cap[0] &=
~HE_MAC_CAP_TWT_RESP_SUPPORT;
else
user_he_cap_tlv->he_mac_cap[0] &=
~HE_MAC_CAP_TWT_REQ_SUPPORT;
user_he_cap_tlv =
(MrvlIEtypes_He_cap_t *)&pmadapter
->priv[i]
->user_he_cap;
if (pmadapter->priv[i]->bss_role ==
MLAN_BSS_ROLE_STA)
user_he_cap_tlv->he_mac_cap[0] &=
~HE_MAC_CAP_TWT_RESP_SUPPORT;
else
user_he_cap_tlv->he_mac_cap[0] &=
~HE_MAC_CAP_TWT_REQ_SUPPORT;
}
}
}

View file

@ -104,9 +104,22 @@ typedef MLAN_PACK_START struct _FWSyncPkt {
t_u32 fw_ready;
} MLAN_PACK_END FWSyncPkt;
#ifdef BIG_ENDIAN_SUPPORT
/** Convert sequence number and command fields
* of fwheader to correct endian format
*/
#define endian_convert_syncfwheader(x) \
{ \
(x)->cmd = wlan_le32_to_cpu((x)->cmd); \
(x)->seq_num = wlan_le32_to_cpu((x)->seq_num); \
(x)->status = wlan_le32_to_cpu((x)->status); \
(x)->offset = wlan_le32_to_cpu((x)->offset); \
}
#else
/** Convert sequence number and command fields
* of fwheader to correct endian format
*/
#define endian_convert_syncfwheader(x)
#endif /* BIG_ENDIAN_SUPPORT */
#endif /* _MLAN_INIT_H_ */

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
@ -360,6 +363,8 @@ enum _mlan_ioctl_req_id {
MLAN_OID_MISC_IPS_CFG = 0x00200085,
MLAN_OID_MISC_MC_AGGR_CFG = 0x00200086,
MLAN_OID_MISC_CH_LOAD = 0x00200087,
MLAN_OID_MISC_STATS = 0x00200088,
MLAN_OID_MISC_CH_LOAD_RESULTS = 0x00200089,
};
/** Sub command size */
@ -401,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
@ -757,14 +770,31 @@ typedef struct _mlan_ssid_bssid {
/** Data structure of WMM ECW */
typedef struct _wmm_ecw_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Maximum Ecw */
t_u8 ecw_max : 4;
/** Minimum Ecw */
t_u8 ecw_min : 4;
#else
/** Minimum Ecw */
t_u8 ecw_min : 4;
/** Maximum Ecw */
t_u8 ecw_max : 4;
#endif /* BIG_ENDIAN_SUPPORT */
} wmm_ecw_t, *pwmm_ecw_t;
/** Data structure of WMM Aci/Aifsn */
typedef struct _wmm_aci_aifsn_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 reserved : 1;
/** Aci */
t_u8 aci : 2;
/** Acm */
t_u8 acm : 1;
/** Aifsn */
t_u8 aifsn : 4;
#else
/** Aifsn */
t_u8 aifsn : 4;
/** Acm */
@ -773,6 +803,7 @@ typedef struct _wmm_aci_aifsn_t {
t_u8 aci : 2;
/** Reserved */
t_u8 reserved : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} wmm_aci_aifsn_t, *pwmm_aci_aifsn_t;
/** Data structure of WMM AC parameters */
@ -979,12 +1010,21 @@ typedef struct _wep_param {
/** Data structure of WMM QoS information */
typedef struct _wmm_qos_info_t {
#ifdef BIG_ENDIAN_SUPPORT
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
/** Reserved */
t_u8 reserved : 3;
/** Parameter set count */
t_u8 para_set_count : 4;
#else
/** Parameter set count */
t_u8 para_set_count : 4;
/** Reserved */
t_u8 reserved : 3;
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} wmm_qos_info_t, *pwmm_qos_info_t;
/** Data structure of WMM parameter IE */
@ -1878,11 +1918,20 @@ typedef struct _mlan_fw_info {
t_u8 prohibit_80mhz;
/** FW support beacon protection */
t_u8 fw_beacon_prot;
/* lower 8 bytes of uuid */
t_u64 uuid_lo;
/* higher 8 bytes of uuid */
t_u64 uuid_hi;
} mlan_fw_info, *pmlan_fw_info;
/** Version string buffer length */
#define MLAN_MAX_VER_STR_LEN 128
/** Maximum length of secure boot uuid */
#define MLAN_MAX_UUID_LEN 32
/** mlan_ver_ext data structure for MLAN_OID_GET_VER_EXT */
typedef struct _mlan_ver_ext {
/** Selected version string */
@ -1891,6 +1940,100 @@ typedef struct _mlan_ver_ext {
char version_str[MLAN_MAX_VER_STR_LEN];
} mlan_ver_ext, *pmlan_ver_ext;
#ifdef BIG_ENDIAN_SUPPORT
/** Extended Capabilities Data */
typedef struct MLAN_PACK_START _ExtCap_t {
/** Extended Capabilities value */
t_u8 rsvdBit87 : 1; /* bit 87 */
t_u8 rsvdBit86 : 1; /* bit 86 */
t_u8 rsvdBit85 : 1; /* bit 85 */
t_u8 beacon_prot : 1; /* bit 84 */
t_u8 rsvdBit83 : 1; /* bit 83 */
t_u8 rsvdBit82 : 1; /* bit 82 */
t_u8 rsvdBit81 : 1; /* bit 81 */
t_u8 rsvdBit80 : 1; /* bit 80 */
t_u8 rsvdBit79 : 1; /* bit 79 */
t_u8 TWTResp : 1; /* bit 78 */
t_u8 TWTReq : 1; /* bit 77 */
t_u8 rsvdBit76 : 1; /* bit 76 */
t_u8 rsvdBit75 : 1; /* bit 75 */
t_u8 rsvdBit74 : 1; /* bit 74 */
t_u8 rsvdBit73 : 1; /* bit 73 */
t_u8 FILS : 1; /* bit 72 */
t_u8 FTMI : 1; /* bit 71 */
t_u8 FTMR : 1; /* bit 70 */
t_u8 CAQ : 1; /* bit 69 */
t_u8 rsvdBit68 : 1; /* bit 68 */
t_u8 NCC : 1; /* bit 67 */
t_u8 rsvdBit66 : 1; /* bit 66 */
t_u8 chanSchedMgnt : 1; /* bit 65 */
t_u8 MaxAMSDU1 : 1; /* bit 64 */
t_u8 MaxAMSDU0 : 1; /* bit 63 */
t_u8 OperModeNtf : 1; /* bit 62 */
t_u8 TDLSWildBandwidth : 1; /* bit 61 */
t_u8 rsvdBit60 : 1; /* bit 60 */
t_u8 rsvdBit59 : 1; /* bit 59 */
t_u8 rsvdBit58 : 1; /* bit 58 */
t_u8 rsvdBit57 : 1; /* bit 57 */
t_u8 rsvdBit56 : 1; /* bit 56 */
t_u8 rsvdBit55 : 1; /* bit 55 */
t_u8 rsvdBit54 : 1; /* bit 54 */
t_u8 rsvdBit53 : 1; /* bit 53 */
t_u8 rsvdBit52 : 1; /* bit 52 */
t_u8 rsvdBit51 : 1; /* bit 51 */
t_u8 rsvdBit50 : 1; /* bit 50 */
t_u8 rsvdBit49 : 1; /* bit 49 */
t_u8 rsvdBit48 : 1; /* bit 48 */
t_u8 rsvdBit47 : 1; /* bit 47 */
t_u8 rsvdBit46 : 1; /* bit 46 */
t_u8 rsvdBit45 : 1; /* bit 45 */
t_u8 rsvdBit44 : 1; /* bit 44 */
t_u8 rsvdBit43 : 1; /* bit 43 */
t_u8 rsvdBit42 : 1; /* bit 42 */
t_u8 rsvdBit41 : 1; /* bit 41 */
t_u8 rsvdBit40 : 1; /* bit 40 */
t_u8 TDLSChlSwitchProhib : 1; /* bit 39 */
t_u8 TDLSProhibited : 1; /* bit 38 */
t_u8 TDLSSupport : 1; /* bit 37 */
t_u8 MSGCF_Capa : 1; /* bit 36 */
t_u8 Reserved35 : 1; /* bit 35 */
t_u8 SSPN_Interface : 1; /* bit 34 */
t_u8 EBR : 1; /* bit 33 */
t_u8 Qos_Map : 1; /* bit 32 */
t_u8 Interworking : 1; /* bit 31 */
t_u8 TDLSChannelSwitching : 1; /* bit 30 */
t_u8 TDLSPeerPSMSupport : 1; /* bit 29 */
t_u8 TDLSPeerUAPSDSupport : 1; /* bit 28 */
t_u8 UTC : 1; /* bit 27 */
t_u8 DMS : 1; /* bit 26 */
t_u8 SSID_List : 1; /* bit 25 */
t_u8 ChannelUsage : 1; /* bit 24 */
t_u8 TimingMeasurement : 1; /* bit 23 */
t_u8 MultipleBSSID : 1; /* bit 22 */
t_u8 AC_StationCount : 1; /* bit 21 */
t_u8 QoSTrafficCap : 1; /* bit 20 */
t_u8 BSS_Transition : 1; /* bit 19 */
t_u8 TIM_Broadcast : 1; /* bit 18 */
t_u8 WNM_Sleep : 1; /* bit 17 */
t_u8 TFS : 1; /* bit 16 */
t_u8 GeospatialLocation : 1; /* bit 15 */
t_u8 CivicLocation : 1; /* bit 14 */
t_u8 CollocatedIntf : 1; /* bit 13 */
t_u8 ProxyARPService : 1; /* bit 12 */
t_u8 FMS : 1; /* bit 11 */
t_u8 LocationTracking : 1; /* bit 10 */
t_u8 MulticastDiagnostics : 1; /* bit 9 */
t_u8 Diagnostics : 1; /* bit 8 */
t_u8 Event : 1; /* bit 7 */
t_u8 SPSMP_Support : 1; /* bit 6 */
t_u8 Reserved5 : 1; /* bit 5 */
t_u8 PSMP_Capable : 1; /* bit 4 */
t_u8 RejectUnadmFrame : 1; /* bit 3 */
t_u8 ExtChanSwitching : 1; /* bit 2 */
t_u8 Reserved1 : 1; /* bit 1 */
t_u8 BSS_CoexistSupport : 1; /* bit 0 */
} MLAN_PACK_END ExtCap_t, *pExtCap_t;
#else
/** Extended Capabilities Data */
typedef struct MLAN_PACK_START _ExtCap_t {
/** Extended Capabilities value */
@ -1983,6 +2126,7 @@ typedef struct MLAN_PACK_START _ExtCap_t {
t_u8 rsvdBit86 : 1; /* bit 86 */
t_u8 rsvdBit87 : 1; /* bit 87 */
} MLAN_PACK_END ExtCap_t, *pExtCap_t;
#endif
/** ExtCap : TDLS prohibited */
#define IS_EXTCAP_TDLS_PROHIBITED(ext_cap) (ext_cap.TDLSProhibited)
@ -2000,7 +2144,7 @@ typedef struct _mlan_bss_info {
/** Channel */
t_u32 bss_chan;
/** Band */
t_u8 bss_band;
t_u16 bss_band;
/** Region code */
t_u32 region_code;
/** Connection status */
@ -2192,6 +2336,8 @@ typedef struct _mlan_debug_info {
t_u32 bypass_pkt_count;
/** Corresponds to scan_processing member of mlan_adapter */
t_u32 scan_processing;
/** Corresponds to scan_state member of mlan_adapter */
t_u32 scan_state;
/** Corresponds to mlan_processing member of mlan_adapter */
t_u32 mlan_processing;
/** Corresponds to main_lock_flag member of mlan_adapter */
@ -4175,12 +4321,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;
@ -4216,6 +4373,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*/
@ -4223,6 +4382,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;
@ -4425,6 +4586,9 @@ typedef struct _mlan_ds_misc_cck_desense_cfg {
#define MLAN_IPADDR_OP_ARP_FILTER MBIT(0)
/** IP operation ARP response */
#define MLAN_IPADDR_OP_AUTO_ARP_RESP MBIT(1)
/** Enable opcode bit for MDNS & NS when device enter into suspend **/
#define MLAN_OP_ADD_MDNS MBIT(2)
#define MLAN_OP_ADD_IPV6_NS MBIT(3)
/** Type definition of mlan_ds_misc_ipaddr_cfg for MLAN_OID_MISC_IP_ADDR */
typedef struct _mlan_ds_misc_ipaddr_cfg {
@ -4628,6 +4792,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;
@ -5492,10 +5666,24 @@ typedef struct _mlan_ds_mc_aggr_cfg {
/** CTS2Self duration offset */
t_u16 cts2self_offset;
} mlan_ds_mc_aggr_cfg;
/** mlan_ds_stats */
typedef struct _mlan_ds_stats {
/** action */
t_u16 action;
/** tlv len */
t_u16 tlv_len;
/** TLV buffer */
t_u8 tlv_buf[1];
} mlan_ds_stats;
typedef struct _mlan_ds_ch_load {
/** action */
t_u8 action;
t_u16 ch_load_param;
t_s16 noise;
t_u16 rx_quality;
t_u16 duration;
} mlan_ds_ch_load;
/** Type definition of mlan_ds_misc_cfg for MLAN_IOCTL_MISC_CFG */
@ -5569,6 +5757,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
*/
@ -5640,6 +5830,7 @@ typedef struct _mlan_ds_misc_cfg {
mlan_ds_misc_tp_state tp_state;
mlan_ds_hal_phy_cfg_params hal_phy_cfg_params;
mlan_ds_mc_aggr_cfg mc_aggr_cfg;
mlan_ds_stats stats;
#ifdef UAP_SUPPORT
t_u8 wacp_mode;
#endif

View file

@ -7,7 +7,7 @@
* to the firmware.
*
*
* Copyright 2008-2021 NXP
* Copyright 2008-2022 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
@ -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;
@ -871,6 +871,7 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
MrvlIEtypes_RatesParamSet_t *prates_tlv;
MrvlIEtypes_AuthType_t *pauth_tlv = MNULL;
MrvlIEtypes_RsnParamSet_t *prsn_ie_tlv = MNULL;
MrvlIEtypes_SAE_PWE_Mode_t *prsnx_ie_tlv = MNULL;
MrvlIEtypes_SecurityCfg_t *psecurity_cfg_ie = MNULL;
MrvlIEtypes_ChanListParamSet_t *pchan_tlv;
WLAN_802_11_RATES rates;
@ -1028,7 +1029,6 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
pchan_tlv->chan_scan_param[0].bandcfg.chanBand =
wlan_band_to_radio_type(pbss_desc->bss_band);
PRINTM(MINFO, "Assoc: TLV Bandcfg = %x\n",
pchan_tlv->chan_scan_param[0].bandcfg);
pos += sizeof(pchan_tlv->header) + sizeof(ChanScanParamSet_t);
@ -1175,6 +1175,37 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
prsn_ie_tlv->header.len = wlan_cpu_to_le16(
prsn_ie_tlv->header.len);
}
if (pbss_desc->prsnx_ie) {
prsnx_ie_tlv =
(MrvlIEtypes_SAE_PWE_Mode_t *)pos;
prsnx_ie_tlv->header.type =
(t_u16)(*(pbss_desc->prsnx_ie))
.ieee_hdr.element_id;
prsnx_ie_tlv->header.type =
prsnx_ie_tlv->header.type & 0x00FF;
prsnx_ie_tlv->header.type = wlan_cpu_to_le16(
prsnx_ie_tlv->header.type);
prsnx_ie_tlv->header.len =
(t_u16)(*(pbss_desc->prsnx_ie))
.ieee_hdr.len;
prsnx_ie_tlv->header.len =
prsnx_ie_tlv->header.len & 0x00FF;
memcpy_ext(pmadapter, prsnx_ie_tlv->pwe,
&((*(pbss_desc->prsnx_ie)).data[0]),
prsnx_ie_tlv->header.len,
prsnx_ie_tlv->header.len);
HEXDUMP("ASSOC_CMD: RSNX IE",
(t_u8 *)prsnx_ie_tlv,
sizeof(prsnx_ie_tlv->header) +
prsnx_ie_tlv->header.len);
pos += sizeof(prsnx_ie_tlv->header) +
prsnx_ie_tlv->header.len;
prsnx_ie_tlv->header.len = wlan_cpu_to_le16(
prsnx_ie_tlv->header.len);
}
}
}
@ -1209,8 +1240,7 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
wlan_11ax_bandconfig_allowed(pmpriv, pbss_desc))
wlan_cmd_append_11ax_tlv(pmpriv, pbss_desc, &pos);
wlan_wmm_process_association_req(pmpriv, &pos, &pbss_desc->wmm_ie,
pbss_desc->pht_cap);
wlan_wmm_process_association_req(pmpriv, &pos, &pbss_desc->wmm_ie);
if (pmpriv->sec_info.wapi_enabled && pmpriv->wapi_ie_len)
wlan_cmd_append_wapi_ie(pmpriv, &pos);
@ -1480,7 +1510,7 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
pmpriv->curr_bss_params.bss_descriptor.channel =
pbss_desc->phy_param_set.ds_param_set.current_chan;
pmpriv->curr_bss_params.band = (t_u8)pbss_desc->bss_band;
pmpriv->curr_bss_params.band = pbss_desc->bss_band;
/* Store current channel for further reference.
* This would save one extra call to get current
@ -1489,7 +1519,7 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
pmpriv->adapter->dfsr_channel =
pmpriv->curr_bss_params.bss_descriptor.channel;
/*
/*`
* Adjust the timestamps in the scan table to be relative to the newly
* associated AP's TSF
*/
@ -1500,10 +1530,7 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
else
pmpriv->curr_bss_params.wmm_enabled = MFALSE;
if ((pmpriv->wmm_required ||
(pbss_desc->pht_cap &&
(pbss_desc->pht_cap->ieee_hdr.element_id == HT_CAPABILITY))) &&
pmpriv->curr_bss_params.wmm_enabled)
if (pmpriv->wmm_required && pmpriv->curr_bss_params.wmm_enabled)
pmpriv->wmm_enabled = MTRUE;
else
pmpriv->wmm_enabled = MFALSE;
@ -1595,9 +1622,11 @@ 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
/* Send OBSS scan param to the application if available */
wlan_2040_coex_event(pmpriv);
wlan_coex_ampdu_rxwinsize(pmpriv->adapter);
if (!pmpriv->sec_info.wpa_enabled && !pmpriv->sec_info.wpa2_enabled &&
@ -1997,6 +2026,7 @@ mlan_status wlan_cmd_802_11_ad_hoc_join(mlan_private *pmpriv,
t_u32 i, rates_size = 0;
t_u32 curr_pkt_filter;
t_u8 *pos = (t_u8 *)padhoc_join + sizeof(HostCmd_DS_802_11_AD_HOC_JOIN);
t_s32 append_size_11h = 0;
ENTER();
@ -2089,7 +2119,7 @@ mlan_status wlan_cmd_802_11_ad_hoc_join(mlan_private *pmpriv,
/* Copy the channel information */
pmpriv->curr_bss_params.bss_descriptor.channel = pbss_desc->channel;
pmpriv->curr_bss_params.band = (t_u8)pbss_desc->bss_band;
pmpriv->curr_bss_params.band = pbss_desc->bss_band;
if (pmpriv->sec_info.wep_status == Wlan802_11WEPEnabled ||
pmpriv->sec_info.wpa_enabled || pmpriv->sec_info.ewpa_enabled)
@ -2135,10 +2165,17 @@ mlan_status wlan_cmd_802_11_ad_hoc_join(mlan_private *pmpriv,
* adhoc/infra 11h behavior can be properly triggered.
* pos modified if data is appended
*/
cmd_append_size += wlan_11h_process_join(
pmpriv, &pos, &padhoc_join->bss_descriptor.cap,
(t_u8)pbss_desc->bss_band, pbss_desc->channel,
&pbss_desc->wlan_11h_bss_info);
append_size_11h +=
wlan_11h_process_join(pmpriv, &pos,
&padhoc_join->bss_descriptor.cap,
pbss_desc->bss_band, pbss_desc->channel,
&pbss_desc->wlan_11h_bss_info);
if (append_size_11h >= 0)
cmd_append_size += append_size_11h;
else {
ret = MLAN_STATUS_FAILURE;
goto done;
}
if (pmpriv->sec_info.wpa_enabled) {
prsn_ie_tlv = (MrvlIEtypes_RsnParamSet_t *)pos;

View file

@ -308,6 +308,55 @@ extern t_u32 mlan_drvdbg;
(t_u64)(((t_u64)(x)&0x00ff000000000000ULL) >> 40) | \
(t_u64)(((t_u64)(x)&0xff00000000000000ULL) >> 56)))
#ifdef BIG_ENDIAN_SUPPORT
/** Convert ulong n/w to host */
#define mlan_ntohl(x) x
/** Convert host ulong to n/w */
#define mlan_htonl(x) x
/** Convert n/w to host */
#define mlan_ntohs(x) x
/** Convert host to n/w */
#define mlan_htons(x) x
/** Convert from 16 bit little endian format to CPU format */
#define wlan_le16_to_cpu(x) swap_byte_16(x)
/** Convert from 32 bit little endian format to CPU format */
#define wlan_le32_to_cpu(x) swap_byte_32(x)
/** Convert from 64 bit little endian format to CPU format */
#define wlan_le64_to_cpu(x) swap_byte_64(x)
/** Convert to 16 bit little endian format from CPU format */
#define wlan_cpu_to_le16(x) swap_byte_16(x)
/** Convert to 32 bit little endian format from CPU format */
#define wlan_cpu_to_le32(x) swap_byte_32(x)
/** Convert to 64 bit little endian format from CPU format */
#define wlan_cpu_to_le64(x) swap_byte_64(x)
/** Convert TxPD to little endian format from CPU format */
#define endian_convert_TxPD(x) \
{ \
(x)->tx_pkt_length = wlan_cpu_to_le16((x)->tx_pkt_length); \
(x)->tx_pkt_offset = wlan_cpu_to_le16((x)->tx_pkt_offset); \
(x)->tx_pkt_type = wlan_cpu_to_le16((x)->tx_pkt_type); \
(x)->tx_control = wlan_cpu_to_le32((x)->tx_control); \
(x)->tx_control_1 = wlan_cpu_to_le32((x)->tx_control_1); \
}
/** Convert RxPD from little endian format to CPU format */
#define endian_convert_RxPD(x) \
{ \
(x)->rx_pkt_length = wlan_le16_to_cpu((x)->rx_pkt_length); \
(x)->rx_pkt_offset = wlan_le16_to_cpu((x)->rx_pkt_offset); \
(x)->rx_pkt_type = wlan_le16_to_cpu((x)->rx_pkt_type); \
(x)->seq_num = wlan_le16_to_cpu((x)->seq_num); \
(x)->rx_info = wlan_le32_to_cpu((x)->rx_info);
}
/** Convert RxPD extra header from little endian format to CPU format */
#define endian_convert_RxPD_extra_header(x) \
do { \
(x)->channel_flags = wlan_le16_to_cpu((x)->channel_flags); \
(x)->vht_sig1 = wlan_le32_to_cpu((x)->vht_sig1); \
(x)->vht_sig2 = wlan_le32_to_cpu((x)->vht_sig2); \
} while (0)
#else
/** Convert ulong n/w to host */
#define mlan_ntohl(x) swap_byte_32(x)
/** Convert host ulong to n/w */
@ -341,6 +390,7 @@ extern t_u32 mlan_drvdbg;
#define endian_convert_RxPD_extra_header(x) \
do { \
} while (0)
#endif /* BIG_ENDIAN_SUPPORT */
/** Global moal_assert_callback */
extern t_void (*assert_callback)(t_void *pmoal_handle, t_u32 cond);
@ -1147,6 +1197,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 */
@ -1307,6 +1359,12 @@ typedef struct _mlan_private {
t_u32 amsdu_tx_cnt;
/** tx msdu count in amsdu*/
t_u32 msdu_in_tx_amsdu_cnt;
/** channel load info for current channel */
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 {
@ -1589,6 +1647,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,
@ -1799,7 +1859,7 @@ typedef struct _mef_entry {
int num_wowlan_entry;
/** Num for IPv6 neighbor solicitation message offload */
int num_ipv6_ns_offload;
int clear_mef_entry;
/** criteria*/
t_u32 criteria;
/** MEF CFG Array to store etted_entry_bitmap;
@ -1866,11 +1926,14 @@ typedef struct _mlan_init_para {
t_u8 uap_max_sta;
/** dfs w53 cfg */
t_u8 dfs53cfg;
/** dfs_offload */
t_u8 dfs_offload;
#ifdef PCIE
/** adma ring size */
t_u16 ring_size;
#endif
t_u8 ext_scan;
t_u8 mcs32;
} mlan_init_para, *pmlan_init_para;
#ifdef SDIO
@ -2255,7 +2318,7 @@ typedef struct _adapter_operations {
} mlan_adapter_operations;
/** Adapter data structure for MLAN */
typedef struct _mlan_adapter {
struct _mlan_adapter {
/** MOAL handle structure */
t_void *pmoal_handle;
/** BSS Attributes */
@ -2439,6 +2502,8 @@ typedef struct _mlan_adapter {
pmlan_private pending_disconnect_priv;
/** mlan_processing */
t_u32 scan_processing;
/** scan state */
t_u32 scan_state;
/** firmware support for roaming*/
t_u8 fw_roaming;
/** User set passphrase*/
@ -2494,6 +2559,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 */
@ -2769,7 +2836,12 @@ typedef struct _mlan_adapter {
t_u32 tp_state_on;
/** Packet drop point */
t_u32 tp_state_drop_point;
} mlan_adapter, *pmlan_adapter;
/* lower 8 bytes of uuid */
t_u64 uuid_lo;
/* higher 8 bytes of uuid */
t_u64 uuid_hi;
};
/** Check if stream 2X2 enabled */
#define IS_STREAM_2X2(x) ((x)&FEATURE_CTRL_STREAM_2X2)
@ -2872,7 +2944,7 @@ mlan_status wlan_misc_ioctl_init_shutdown(pmlan_adapter pmadapter,
mlan_status wlan_get_info_debug_info(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
#if defined(STA_SUPPORT) || defined(UAP_SUPPORT)
extern pmlan_operations mlan_ops[];
/** Set/Get BSS role */
mlan_status wlan_bss_ioctl_bss_role(pmlan_adapter pmadapter,
@ -3045,8 +3117,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. */
@ -3306,6 +3379,7 @@ mlan_status wlan_cmd_802_11_scan(pmlan_private pmpriv, HostCmd_DS_COMMAND *pcmd,
mlan_status wlan_ret_802_11_scan(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
t_void *pioctl_buf);
t_u8 wlan_get_ext_scan_state(HostCmd_DS_COMMAND *pcmd);
/** Extended scan command handler */
mlan_status wlan_cmd_802_11_scan_ext(pmlan_private pmpriv,
HostCmd_DS_COMMAND *pcmd,
@ -3544,6 +3618,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);
@ -3962,6 +4038,8 @@ mlan_status wlan_misc_ioctl_mc_aggr_cfg(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req);
mlan_status wlan_misc_ioctl_ch_load(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req);
mlan_status wlan_misc_ioctl_ch_load_results(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req);
mlan_status wlan_cmd_get_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action, t_void *pdata_buf);
mlan_status wlan_ret_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,

View file

@ -441,6 +441,7 @@ mlan_status wlan_get_info_debug_info(pmlan_adapter pmadapter,
debug_info->port_open = pmpriv->port_open;
debug_info->bypass_pkt_count = pmadapter->bypass_pkt_count;
debug_info->scan_processing = pmadapter->scan_processing;
debug_info->scan_state = pmadapter->scan_state;
debug_info->mlan_processing = pmadapter->mlan_processing;
debug_info->main_lock_flag = pmadapter->main_lock_flag;
debug_info->main_process_cnt = pmadapter->main_process_cnt;
@ -1017,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();
@ -1028,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;
@ -1048,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,
@ -1066,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:
@ -1243,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++) {
@ -2412,7 +2414,8 @@ mlan_status wlan_misc_ioctl_tdls_oper(pmlan_adapter pmadapter,
sta_ptr->max_amsdu =
MLAN_TX_DATA_BUF_SIZE_4K;
for (i = 0; i < MAX_NUM_TID; i++) {
if (sta_ptr->is_11n_enabled)
if (sta_ptr->is_11n_enabled ||
sta_ptr->is_11ax_enabled)
sta_ptr->ampdu_sta[i] =
pmpriv->aggr_prio_tbl[i]
.ampdu_user;
@ -2465,7 +2468,8 @@ mlan_status wlan_misc_ioctl_tdls_oper(pmlan_adapter pmadapter,
wlan_restore_tdls_packets(pmpriv,
ptdls_oper->peer_mac,
TDLS_TEAR_DOWN);
if (sta_ptr->is_11n_enabled) {
if (sta_ptr->is_11n_enabled ||
sta_ptr->is_11ax_enabled) {
wlan_cleanup_reorder_tbl(
pmpriv, ptdls_oper->peer_mac);
wlan_11n_cleanup_txbastream_tbl(
@ -3490,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
*
@ -3510,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;
@ -3646,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;
@ -3672,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))
@ -3968,7 +3995,8 @@ mlan_status wlan_radio_ioctl_ant_cfg(pmlan_adapter pmadapter,
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if (IS_CARD9098(pmadapter->card_type) ||
IS_CARD9097(pmadapter->card_type)) {
IS_CARD9097(pmadapter->card_type) ||
IS_CARDNW62X(pmadapter->card_type)) {
ant_cfg->tx_antenna &= 0x0303;
ant_cfg->rx_antenna &= 0x0303;
/** 2G antcfg TX */
@ -5543,32 +5571,35 @@ mlan_status wlan_process_mef_cfg_cmd(mlan_private *pmpriv,
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb;
mef_cfg_data mef;
mef_entry_t *pentry;
mef_entry_t *pentry = MNULL;
mef_entry *pmef;
t_u16 entry_num = 0;
ENTER();
pcb = &pmadapter->callbacks;
memset(pmadapter, &mef, 0, sizeof(mef_cfg_data));
/** check how many entries in adapter*/
pmef = &pmadapter->entry_cfg;
entry_num += pmef->enable_autoarp_entry;
entry_num += pmef->num_wowlan_entry;
entry_num += pmef->num_ipv6_ns_offload;
if (!entry_num) {
if (!entry_num && !pmef->clear_mef_entry) {
PRINTM(MIOCTL, "No filter entries\n");
goto done;
}
ret = pcb->moal_malloc(pmadapter->pmoal_handle,
sizeof(mef_entry_t) * entry_num, MLAN_MEM_DEF,
(t_u8 **)&mef.pentry);
if (ret != MLAN_STATUS_SUCCESS || mef.pentry == MNULL) {
PRINTM(MERROR, "Failed to allocate cmd data buffer\n");
ret = MLAN_STATUS_FAILURE;
goto err_handle;
if (entry_num) {
ret = pcb->moal_malloc(pmadapter->pmoal_handle,
sizeof(mef_entry_t) * entry_num,
MLAN_MEM_DEF, (t_u8 **)&mef.pentry);
if (ret != MLAN_STATUS_SUCCESS || mef.pentry == MNULL) {
PRINTM(MERROR, "Failed to allocate cmd data buffer\n");
ret = MLAN_STATUS_FAILURE;
goto err_handle;
}
}
/** Fill mef_cfg structure*/
mef.criteria = pmef->criteria;
mef.entry_num = entry_num;
@ -5657,11 +5688,25 @@ mlan_status wlan_misc_ioctl_mef_flt_cfg(pmlan_adapter pmadapter,
pmadapter))
PRINTM(MERROR,
"Set MEF Entries Error\n");
} else if (mef_cfg->op_code &
MLAN_IPADDR_OP_IP_REMOVE) {
} else if (!(mef_cfg->op_code &
MLAN_IPADDR_OP_IP_REMOVE)) {
pmef->enable_autoarp_entry = 0;
pmef->num_wowlan_entry = 0;
pmef->num_ipv6_ns_offload = 0;
pmef->clear_mef_entry = 1;
memset(pmadapter, &pmef->entry[5], 0,
sizeof(mef_entry_t));
memset(pmadapter, &pmef->entry[6], 0,
sizeof(mef_entry_t));
memset(pmadapter, &pmef->entry[7], 0,
sizeof(mef_entry_t));
if (MLAN_STATUS_SUCCESS !=
wlan_process_mef_cfg_cmd(
pmadapter
->priv[pioctl_req->bss_index],
pmadapter))
PRINTM(MERROR,
"Clear MEF Entries Error\n");
}
}
break;
@ -6061,6 +6106,41 @@ mlan_status wlan_misc_ioctl_mc_aggr_cfg(pmlan_adapter pmadapter,
LEAVE();
return ret;
}
/**
* @brief get channel load results
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pioctl_req A pointer to ioctl request buffer
*
* @return MLAN_STATUS_PENDING --success, otherwise fail
*/
mlan_status wlan_misc_ioctl_ch_load_results(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req)
{
mlan_private *pmpriv = MNULL;
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u16 cmd_action = 0;
mlan_ds_misc_cfg *misc = MNULL;
ENTER();
if (pioctl_req == MNULL)
return MLAN_STATUS_FAILURE;
pmpriv = pmadapter->priv[pioctl_req->bss_index];
misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
cmd_action = pioctl_req->action;
/* Send request to firmware */
if (pmpriv->ch_load_param == 255) {
return MLAN_STATUS_FAILURE;
} 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();
return ret;
}
/**
* @brief get channel load
@ -6073,17 +6153,21 @@ mlan_status wlan_misc_ioctl_mc_aggr_cfg(pmlan_adapter pmadapter,
mlan_status wlan_misc_ioctl_ch_load(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req)
{
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_private *pmpriv = MNULL;
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u16 cmd_action = 0;
mlan_ds_misc_cfg *misc = MNULL;
ENTER();
if (pioctl_req == MNULL)
return MLAN_STATUS_FAILURE;
pmpriv = pmadapter->priv[pioctl_req->bss_index];
misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
cmd_action = pioctl_req->action;
/* Send request to firmware */
pmpriv->ch_load_param = 255; /* Default value for identifying
update/non-updated value*/
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_GET_CH_LOAD, cmd_action, 0,
(t_void *)pioctl_req,
(t_void *)&misc->param.ch_load);

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");
@ -1027,7 +1028,9 @@ wlan_scan_channel_list(mlan_private *pmpriv, t_void *pioctl_buf,
wlan_cpu_to_le16(pvht_cap->header.len);
}
if (IS_FW_SUPPORT_11AX(pmadapter)) {
if (IS_FW_SUPPORT_11AX(pmadapter) &&
((pmpriv->config_bands & BAND_GAX) ||
(pmpriv->config_bands & BAND_AAX))) {
phe_cap = (MrvlIEtypes_Extension_t *)ptlv_pos;
len = wlan_fill_he_cap_tlv(pmpriv, pmpriv->config_bands,
phe_cap, MFALSE);
@ -1496,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)) {
@ -1515,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(
@ -4140,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");
@ -4151,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");
@ -4218,6 +4227,7 @@ mlan_status wlan_scan_networks(mlan_private *pmpriv, t_void *pioctl_buf,
&pmadapter->scan_pending_q, MNULL, MNULL);
pmadapter->pscan_ioctl_req = pioctl_req;
pmadapter->scan_processing = MTRUE;
pmadapter->scan_state = SCAN_STATE_SCAN_START;
wlan_insert_cmd_to_pending_q(pmadapter, pcmd_node,
MTRUE);
}
@ -4834,6 +4844,26 @@ done:
return ret;
}
/**
* @brief Get ext_scan state from ext_scan_type
*
*
* @param pcmd A pointer to HostCmd_DS_COMMAND structure to be sent to
* firmware with the HostCmd_DS_802_11_SCAN_EXT structure
*
* @return
* SCAN_STATE_EXT_SCAN_ENH/SCAN_STATE_EXT_SCAN_CANCEL/SCAN_STATE_EXT_SCAN_ENH
*/
t_u8 wlan_get_ext_scan_state(HostCmd_DS_COMMAND *pcmd)
{
HostCmd_DS_802_11_SCAN_EXT *pext_scan_cmd = &pcmd->params.ext_scan;
if (pext_scan_cmd->ext_scan_type == EXT_SCAN_ENHANCE)
return SCAN_STATE_EXT_SCAN_ENH;
if (pext_scan_cmd->ext_scan_type == EXT_SCAN_CANCEL)
return SCAN_STATE_EXT_SCAN_CANCEL;
return SCAN_STATE_EXT_SCAN;
}
/**
* @brief Prepare an extended scan command to be sent to the firmware
*
@ -4923,11 +4953,13 @@ mlan_status wlan_ret_802_11_scan_ext(mlan_private *pmpriv,
ENTER();
PRINTM(MINFO, "EXT scan returns successfully\n");
pmadapter->scan_state |= wlan_get_ext_scan_state(resp);
ext_scan_type = pext_scan_cmd->ext_scan_type;
if (ext_scan_type == EXT_SCAN_CANCEL) {
PRINTM(MCMND, "Cancel scan command completed!\n");
wlan_request_cmd_lock(pmadapter);
pmadapter->scan_processing = MFALSE;
pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE;
pmadapter->ext_scan_type = EXT_SCAN_DEFAULT;
wlan_release_cmd_lock(pmadapter);
/* Need to indicate IOCTL complete */
@ -5747,6 +5779,13 @@ mlan_status wlan_handle_event_ext_scan_report(mlan_private *pmpriv,
DBG_HEXDUMP(MCMD_D, "EVENT EXT_SCAN", pmbuf->pbuf + pmbuf->data_offset,
pmbuf->data_len);
if (!pevent_scan->more_event)
pmadapter->scan_state |= SCAN_STATE_EXT_SCAN_RESULT |
SCAN_STATE_LAST_EXT_SCAN_RESULT;
else
pmadapter->scan_state |= SCAN_STATE_EXT_SCAN_RESULT;
wlan_parse_ext_scan_result(pmpriv, pevent_scan->num_of_set, ptlv,
tlv_buf_left);
if (!pevent_scan->more_event &&
@ -5780,6 +5819,7 @@ mlan_status wlan_handle_event_ext_scan_report(mlan_private *pmpriv,
wlan_scan_process_results(pmpriv);
wlan_request_cmd_lock(pmadapter);
pmadapter->scan_processing = MFALSE;
pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE;
pioctl_req = pmadapter->pscan_ioctl_req;
pmadapter->pscan_ioctl_req = MNULL;
/* Need to indicate IOCTL complete */
@ -5805,6 +5845,9 @@ mlan_status wlan_handle_event_ext_scan_report(mlan_private *pmpriv,
wlan_flush_scan_queue(pmadapter);
wlan_request_cmd_lock(pmadapter);
pmadapter->scan_processing = MFALSE;
pmadapter->scan_state |=
SCAN_STATE_SCAN_COMPLETE;
pioctl_req = pmadapter->pscan_ioctl_req;
pmadapter->pscan_ioctl_req = MNULL;
/* Indicate IOCTL complete */
@ -5865,6 +5908,7 @@ mlan_status wlan_handle_event_ext_scan_status(mlan_private *pmpriv,
ret = MLAN_STATUS_FAILURE;
goto done;
}
pmadapter->scan_state |= SCAN_STATE_EXT_SCAN_STATUS;
scan_event =
(pmlan_event_scan_status)(pmbuf->pbuf + pmbuf->data_offset);
@ -5911,6 +5955,7 @@ done:
wlan_flush_scan_queue(pmadapter);
wlan_request_cmd_lock(pmadapter);
pmadapter->scan_processing = MFALSE;
pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE;
pioctl_req = pmadapter->pscan_ioctl_req;
pmadapter->pscan_ioctl_req = MNULL;
/* Indicate IOCTL complete */
@ -5971,6 +6016,7 @@ done:
/** Complete scan ioctl */
wlan_request_cmd_lock(pmadapter);
pmadapter->scan_processing = MFALSE;
pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE;
pioctl_req = pmadapter->pscan_ioctl_req;
pmadapter->pscan_ioctl_req = MNULL;
/* Need to indicate IOCTL complete */
@ -6426,7 +6472,9 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
pvht_cap->header.len = wlan_cpu_to_le16(pvht_cap->header.len);
}
if (IS_FW_SUPPORT_11AX(pmadapter)) {
if (IS_FW_SUPPORT_11AX(pmadapter) &&
((pmpriv->config_bands & BAND_GAX) ||
(pmpriv->config_bands & BAND_AAX))) {
phe_cap = (MrvlIEtypes_Extension_t *)tlv;
len = wlan_fill_he_cap_tlv(pmpriv, pmpriv->config_bands,
phe_cap, MFALSE);
@ -6943,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) {
@ -7006,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;
@ -2159,7 +2161,7 @@ static mlan_status wlan_sdio_check_fw_status(mlan_adapter *pmadapter,
ret = MLAN_STATUS_SUCCESS;
break;
} else {
wlan_mdelay(pmadapter, 100);
wlan_mdelay(pmadapter, 10);
ret = MLAN_STATUS_FAILURE;
}
}

View file

@ -330,6 +330,7 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
pmadapter->card_type = pmdevice->card_type;
pmadapter->card_rev = pmdevice->card_rev;
pmadapter->init_para.uap_max_sta = pmdevice->uap_max_sta;
pmadapter->init_para.mcs32 = pmdevice->mcs32;
#ifdef SDIO
if (IS_SD(pmadapter->card_type)) {
@ -461,6 +462,7 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
}
#endif
pmadapter->init_para.dfs53cfg = pmdevice->dfs53cfg;
pmadapter->init_para.dfs_offload = pmdevice->dfs_offload;
pmadapter->priv_num = 0;
pmadapter->priv[0] = MNULL;
@ -1260,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 */
@ -1275,6 +1280,8 @@ process_start:
WlanHardwareStatusInitializing;
wlan_get_hw_spec_complete(pmadapter);
}
} else {
wlan_release_cmd_lock(pmadapter);
}
/* Check for event */
@ -1592,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:
@ -1742,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

@ -101,7 +101,8 @@ wlan_process_cmdreps_error_tdls_operation(mlan_private *pmpriv,
if (ISSUPP_EXTCAP_TDLS_CHAN_SWITCH(
sta_ptr->ExtCap.ext_cap))
wlan_tdls_config(pmpriv, MFALSE);
if (sta_ptr->is_11n_enabled) {
if (sta_ptr->is_11n_enabled ||
sta_ptr->is_11ax_enabled) {
wlan_cleanup_reorder_tbl(
pmpriv, ptdls_oper_data->peer_mac);
wlan_11n_cleanup_txbastream_tbl(
@ -321,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;
@ -627,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);
@ -1838,7 +1841,8 @@ static mlan_status wlan_ret_tdls_config(pmlan_private pmpriv,
sta_ptr = wlan_get_station_entry(
pmpriv, tdls_all_cfg->u.tdls_tear_down.peer_mac_addr);
if (sta_ptr) {
if (sta_ptr->is_11n_enabled) {
if (sta_ptr->is_11n_enabled ||
sta_ptr->is_11ax_enabled) {
wlan_cleanup_reorder_tbl(
pmpriv, tdls_all_cfg->u.tdls_tear_down
.peer_mac_addr);
@ -2010,7 +2014,8 @@ static mlan_status wlan_ret_tdls_oper(pmlan_private pmpriv,
if (ISSUPP_EXTCAP_TDLS_CHAN_SWITCH(
sta_ptr->ExtCap.ext_cap))
wlan_tdls_config(pmpriv, MFALSE);
if (sta_ptr->is_11n_enabled) {
if (sta_ptr->is_11n_enabled ||
sta_ptr->is_11ax_enabled) {
wlan_cleanup_reorder_tbl(pmpriv,
ptdls_oper->peer_mac);
wlan_11n_cleanup_txbastream_tbl(
@ -2236,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
@ -2626,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;
}
@ -2666,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");
}
}
}
@ -3320,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

@ -139,7 +139,8 @@ static void wlan_parse_tdls_event(pmlan_private priv, pmlan_buffer pevent)
}
}
for (i = 0; i < MAX_NUM_TID; i++) {
if (sta_ptr->is_11n_enabled)
if (sta_ptr->is_11n_enabled ||
sta_ptr->is_11ax_enabled)
sta_ptr->ampdu_sta[i] =
priv->aggr_prio_tbl[i]
.ampdu_user;
@ -212,7 +213,8 @@ static void wlan_parse_tdls_event(pmlan_private priv, pmlan_buffer pevent)
wlan_restore_tdls_packets(priv,
tdls_event->peer_mac_addr,
TDLS_TEAR_DOWN);
if (sta_ptr->is_11n_enabled) {
if (sta_ptr->is_11n_enabled ||
sta_ptr->is_11ax_enabled) {
wlan_cleanup_reorder_tbl(
priv, tdls_event->peer_mac_addr);
wlan_11n_cleanup_txbastream_tbl(
@ -368,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) {
@ -798,8 +805,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
MRVDRV_TxPD_POWER_MGMT_NULL_PACKET |
MRVDRV_TxPD_POWER_MGMT_LAST_PACKET) ==
MLAN_STATUS_SUCCESS) {
LEAVE();
return MLAN_STATUS_SUCCESS;
ret = MLAN_STATUS_SUCCESS;
goto done;
}
}
}
@ -876,6 +883,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
}
pmadapter->scan_block = MFALSE;
wlan_recv_event(pmpriv, MLAN_EVENT_ID_FW_PORT_RELEASE, MNULL);
/* Send OBSS scan param to the application */
wlan_2040_coex_event(pmpriv);
break;
case EVENT_STOP_TX:
@ -915,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 =
@ -990,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;
@ -1369,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

@ -295,7 +295,7 @@ static mlan_status wlan_get_info_bss_info(pmlan_adapter pmadapter,
info->param.bss_info.beacon_interval = pbss_desc->beacon_period;
/* Band */
info->param.bss_info.bss_band = (t_u8)pbss_desc->bss_band;
info->param.bss_info.bss_band = pbss_desc->bss_band;
/* Region code */
info->param.bss_info.region_code = pmadapter->region_code;
@ -446,6 +446,8 @@ static mlan_status wlan_get_info_ioctl(pmlan_adapter pmadapter,
pmpriv->usr_dot_11ac_mcs_support;
pget_info->param.fw_info.usr_dot_11ac_dev_cap_a =
pmpriv->usr_dot_11ac_dev_cap_a;
pget_info->param.fw_info.uuid_lo = pmadapter->uuid_lo;
pget_info->param.fw_info.uuid_hi = pmadapter->uuid_hi;
pget_info->param.fw_info.hw_hecap_len = pmadapter->hw_hecap_len;
pget_info->param.fw_info.hw_2g_hecap_len =
pmadapter->hw_2g_hecap_len;
@ -3370,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;
@ -3954,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:
@ -4388,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
*
@ -5257,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);
@ -5327,6 +5369,9 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
case MLAN_OID_MISC_CH_LOAD:
status = wlan_misc_ioctl_ch_load(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_CH_LOAD_RESULTS:
status = wlan_misc_ioctl_ch_load_results(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_GET_TSF:
status = wlan_misc_ioctl_get_tsf(pmadapter, pioctl_req);
break;

View file

@ -33,6 +33,7 @@ Change log:
#include "mlan_main.h"
#include "mlan_11n_aggr.h"
#include "mlan_11n_rxreorder.h"
#include "mlan_11ax.h"
#ifdef DRV_EMBEDDED_SUPPLICANT
#include "authenticator_api.h"
#endif
@ -305,12 +306,14 @@ void wlan_process_tdls_action_frame(pmlan_private priv, t_u8 *pbuf, t_u32 len)
break;
case QOS_INFO:
sta_ptr->qos_info = pos[2];
sta_ptr->is_wmm_enabled = MTRUE;
PRINTM(MDAT_D, "TDLS qos info %x\n", sta_ptr->qos_info);
break;
case VENDOR_SPECIFIC_221:
pvendor_ie = (IEEEtypes_VendorHeader_t *)pos;
if (!memcmp(priv->adapter, pvendor_ie->oui, wmm_oui,
sizeof(wmm_oui))) {
sta_ptr->is_wmm_enabled = MTRUE;
sta_ptr->qos_info = pos[8]; /** qos info in wmm
parameters in
response and
@ -803,7 +806,8 @@ mlan_status wlan_ops_sta_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
prx_pd->nf);
}
}
if (!sta_ptr || !sta_ptr->is_11n_enabled) {
if (!sta_ptr || (!sta_ptr->is_11n_enabled &&
!sta_ptr->is_11ax_enabled)) {
wlan_process_rx_packet(pmadapter, pmbuf);
goto done;
}

View file

@ -199,7 +199,7 @@ static mlan_status uap_process_cmdresp_error(mlan_private *pmpriv,
mlan_status ret = MLAN_STATUS_FAILURE;
ENTER();
if (resp->command != HostCmd_CMD_WMM_PARAM_CONFIG ||
if (resp->command != HostCmd_CMD_WMM_PARAM_CONFIG &&
resp->command != HostCmd_CMD_CHAN_REGION_CFG)
PRINTM(MERROR, "CMD_RESP: cmd %#x error, result=%#x\n",
resp->command, resp->result);
@ -2232,6 +2232,9 @@ static mlan_status wlan_uap_ret_cmd_ap_config(pmlan_private pmpriv,
tlv_chan_band = (MrvlIEtypes_channel_band_t *)tlv;
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 =
@ -2496,6 +2499,8 @@ static mlan_status wlan_uap_ret_sys_config(pmlan_private pmpriv,
MrvlIEtypes_uap_max_sta_cnt_t *tlv_uap_max_sta = MNULL;
ENTER();
sys_config->action = wlan_le16_to_cpu(sys_config->action);
if (pioctl_buf) {
if (pioctl_buf->req_id == MLAN_IOCTL_BSS) {
bss = (mlan_ds_bss *)pioctl_buf->pbuf;
@ -2667,6 +2672,14 @@ static mlan_status wlan_uap_ret_sys_config(pmlan_private pmpriv,
chan_band_tlv->channel;
bss->param.ap_channel.is_11n_enabled =
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 =
chan_band_tlv->channel;
bss->param.ap_channel.is_dfs_chan =
wlan_11h_radar_detect_required(
pmpriv,
@ -2792,8 +2805,11 @@ static mlan_status wlan_uap_ret_sys_config(pmlan_private pmpriv,
} else { /* no ioctl: driver generated get/set */
switch (wlan_le16_to_cpu(tlv->header.type)) {
case TLV_TYPE_UAP_MAC_ADDRESS:
memcpy_ext(pmpriv->adapter, pmpriv->curr_addr, tlv->mac,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
if (sys_config->action == HostCmd_ACT_GEN_SET) {
memcpy_ext(pmpriv->adapter, pmpriv->curr_addr,
tlv->mac, MLAN_MAC_ADDR_LENGTH,
MLAN_MAC_ADDR_LENGTH);
}
break;
case TLV_TYPE_UAP_MAX_STA_CNT_PER_CHIP:
tlv_uap_max_sta = (MrvlIEtypes_uap_max_sta_cnt_t *)tlv;
@ -2950,6 +2966,12 @@ static mlan_status wlan_uap_cmd_snmp_mib(pmlan_private pmpriv,
psnmp_mib->oid = wlan_cpu_to_le16((t_u16)cmd_oid);
psnmp_mib->buf_size = 0;
break;
case ChanTrackParam_i:
psnmp_mib->oid = wlan_cpu_to_le16((t_u16)cmd_oid);
psnmp_mib->buf_size = wlan_cpu_to_le16(sizeof(t_u8));
psnmp_mib->value[0] = *((t_u8 *)pdata_buf);
cmd->size += sizeof(t_u8);
break;
default:
PRINTM(MERROR, "Unsupported OID.\n");
ret = MLAN_STATUS_FAILURE;
@ -3148,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);
@ -3860,8 +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;
PRINTM(MCMND, "uap_channel FW: 0x%x\n",
priv->uap_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 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);
@ -4417,7 +4443,7 @@ static mlan_status wlan_uap_cmd_add_station(pmlan_private pmpriv,
}
for (i = 0; i < MAX_NUM_TID; i++) {
if (sta_ptr->is_11n_enabled)
if (sta_ptr->is_11n_enabled || sta_ptr->is_11ax_enabled)
sta_ptr->ampdu_sta[i] =
pmpriv->aggr_prio_tbl[i].ampdu_user;
else
@ -4431,6 +4457,81 @@ done:
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function prepares command of per peer stats
*
* @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_stats(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action, t_void *pdata_buf)
{
HostCmd_DS_STATS *stats_cmd = (HostCmd_DS_STATS *)&cmd->params.stats;
Stats_Cfg_Params_TLV_t *cfg_param = MNULL;
mlan_ds_stats *stats = (mlan_ds_stats *)pdata_buf;
Stats_Cfg_Params_TLV_t *stats_param = MNULL;
ENTER();
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_802_11_STATS);
cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_STATS) + S_DS_GEN);
if (cmd_action) {
cmd->size =
wlan_cpu_to_le16(sizeof(HostCmd_DS_STATS) + S_DS_GEN +
sizeof(Stats_Cfg_Params_TLV_t) - 1);
stats_cmd->action = wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
stats_param = (Stats_Cfg_Params_TLV_t *)stats->tlv_buf;
if (stats_param->tlvHeader.type ==
NXP_802_11_PER_PEER_STATS_CFG_TLV_ID) {
cfg_param =
(Stats_Cfg_Params_TLV_t *)stats_cmd->tlv_buffer;
*cfg_param = *stats_param;
}
} else {
cmd->size =
wlan_cpu_to_le16(sizeof(HostCmd_DS_STATS) + S_DS_GEN);
stats_cmd->action = wlan_cpu_to_le16(HostCmd_ACT_GEN_GET);
}
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function handles the command response of stats
*
* @param pmpriv A pointer to mlan_private structure
* @param resp A pointer to HostCmd_DS_COMMAND
* @param pioctl_buf A pointer to mlan_ioctl_req structure
*
* @return MLAN_STATUS_SUCCESS
*/
static mlan_status wlan_ret_stats(pmlan_private pmpriv,
HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf)
{
HostCmd_DS_STATS *cfg_cmd = (HostCmd_DS_STATS *)&resp->params.stats;
mlan_ds_misc_cfg *misc_cfg = MNULL;
t_u8 *pBuf = (t_u8 *)&cfg_cmd->tlv_buffer;
int len = resp->size;
ENTER();
if (pioctl_buf) {
misc_cfg = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
len -= (S_DS_GEN + sizeof(t_u16));
memcpy_ext(pmpriv->adapter,
(t_u8 *)&misc_cfg->param.stats.tlv_buf, pBuf, len,
len);
misc_cfg->param.stats.tlv_len = len;
pioctl_buf->buf_len = sizeof(mlan_ds_stats) + len - 1;
}
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/********************************************************
Global Functions
********************************************************/
@ -4816,6 +4917,9 @@ mlan_status wlan_ops_uap_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_mc_aggr_cfg(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_802_11_STATS:
ret = wlan_cmd_stats(pmpriv, cmd_ptr, cmd_action, pdata_buf);
break;
case HostCmd_CMD_GET_CH_LOAD:
ret = wlan_cmd_get_ch_load(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
@ -4882,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 {
@ -5210,6 +5315,9 @@ mlan_status wlan_ops_uap_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
case HostCmd_CMD_MC_AGGR_CFG:
ret = wlan_ret_mc_aggr_cfg(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_802_11_STATS:
ret = wlan_ret_stats(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_GET_CH_LOAD:
ret = wlan_ret_ch_load(pmpriv, resp, pioctl_buf);
break;
@ -5248,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;
@ -5302,6 +5411,8 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
MNULL);
}
#endif
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");
@ -5356,14 +5467,15 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
MAC2STR(sta_addr));
if (!sta_ptr)
break;
if (pmpriv->is_11n_enabled
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)
if (sta_ptr->is_11n_enabled ||
sta_ptr->is_11ax_enabled)
sta_ptr->ampdu_sta[i] =
pmpriv->aggr_prio_tbl[i]
.ampdu_user;
@ -5395,10 +5507,11 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
wlan_recv_event(pmpriv, pevent->event_id, pevent);
memcpy_ext(pmadapter, sta_addr, pmadapter->event_body + 2,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
sta_ptr = wlan_get_station_entry(pmpriv, sta_addr);
PRINTM_NETINTF(MMSG, pmpriv);
PRINTM(MMSG, "wlan: EVENT: MICRO_AP_STA_DEAUTH " MACSTR "\n",
MAC2STR(sta_addr));
if (pmpriv->is_11n_enabled) {
if (pmpriv->is_11n_enabled || pmpriv->is_11ax_enabled) {
wlan_cleanup_reorder_tbl(pmpriv, sta_addr);
wlan_11n_cleanup_txbastream_tbl(pmpriv, sta_addr);
}
@ -5500,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);
@ -5528,9 +5643,7 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
.no_channel_change_on_radar ||
pmpriv->adapter->dfs_test_params
.fixed_new_channel_on_radar) {
if (pmadapter->state_rdh.stage == RDH_OFF ||
pmadapter->state_rdh.stage ==
RDH_SET_CUSTOM_IE) {
if (pmadapter->state_rdh.stage == RDH_OFF) {
pmadapter->state_rdh.stage =
RDH_CHK_INTFS;
wlan_11h_radar_detected_handling(
@ -5565,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);
@ -5581,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);
@ -5599,23 +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->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 ||
@ -5632,6 +5736,8 @@ mlan_status wlan_ops_uap_process_event(t_void *priv)
} else {
/* Handle Host-based DFS and non-DFS(normal uap) case */
pmpriv->intf_state_11h.tx_disabled = MFALSE;
}
if (pmpriv->uap_host_based) {
memset(pmadapter, event_buf, 0x00, MAX_EVENT_SIZE);
/* Setup event buffer */
pevent->bss_index = pmpriv->bss_index;
@ -5733,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,9 +1450,10 @@ 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);
PRINTM(MCMND, "ZERODFS: Channel %d is Avaliable\n",
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,
pioctl, MLAN_STATUS_COMPLETE);
@ -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,
@ -1823,6 +1845,39 @@ mlan_status wlan_uap_get_beacon_dtim(pmlan_private pmpriv)
return ret;
}
/**
* @brief Get/Start/Stop/Reset stats
*
* @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_stats(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req)
{
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u16 cmd_action = 0;
mlan_ds_misc_cfg *misc = MNULL;
ENTER();
misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
cmd_action = pioctl_req->action;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11_STATS, cmd_action, 0,
(t_void *)pioctl_req,
(t_void *)&misc->param.stats);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
LEAVE();
return ret;
}
/**
* @brief Set/Get deauth control.
*
@ -1860,6 +1915,43 @@ static mlan_status wlan_uap_snmp_mib_ctrl_deauth(pmlan_adapter pmadapter,
return ret;
}
/**
* @brief Set/Get channel tracking control.
*
* @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_uap_snmp_mib_chan_track(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_snmp_mib *mib = (mlan_ds_snmp_mib *)pioctl_req->pbuf;
t_u16 cmd_action = 0;
ENTER();
mib = (mlan_ds_snmp_mib *)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_802_11_SNMP_MIB, cmd_action,
ChanTrackParam_i, (t_void *)pioctl_req,
&mib->param.chan_track);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
LEAVE();
return ret;
}
/**
* @brief MLAN uap ioctl handler
*
@ -2056,6 +2148,8 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
pget_info->param.fw_info.antinfo = pmadapter->antinfo;
pget_info->param.fw_info.max_ap_assoc_sta =
pmadapter->max_sta_conn;
pget_info->param.fw_info.uuid_lo = pmadapter->uuid_lo;
pget_info->param.fw_info.uuid_hi = pmadapter->uuid_hi;
} else if (pget_info->sub_command == MLAN_OID_LINK_STATS)
status = wlan_ioctl_link_statistic(pmpriv, pioctl_req);
break;
@ -2130,8 +2224,13 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
if (misc->sub_command == MLAN_OID_MISC_MC_AGGR_CFG)
status = wlan_misc_ioctl_mc_aggr_cfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_STATS)
status = wlan_misc_ioctl_stats(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CH_LOAD)
status = wlan_misc_ioctl_ch_load(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CH_LOAD_RESULTS)
status = wlan_misc_ioctl_ch_load_results(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_GET_TSF)
status = wlan_misc_ioctl_get_tsf(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_GET_CHAN_REGION_CFG)
@ -2240,6 +2339,9 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
if (snmp->sub_command == MLAN_OID_SNMP_MIB_DOT11H_FAKERADAR)
status = wlan_uap_snmp_mib_11h_fakeradar(pmadapter,
pioctl_req);
if (snmp->sub_command == MLAN_OID_SNMP_MIB_CHAN_TRACK)
status = wlan_uap_snmp_mib_chan_track(pmadapter,
pioctl_req);
break;
case MLAN_IOCTL_SEC_CFG:
sec = (mlan_ds_sec_cfg *)pioctl_req->pbuf;
@ -2275,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);
@ -2287,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
@ -472,7 +476,7 @@ mlan_status wlan_ops_uap_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
}
}
/* check if UAP enable 11n */
if (!priv->is_11n_enabled ||
if ((!priv->is_11n_enabled && !priv->is_11ax_enabled) ||
(!wlan_11n_get_rxreorder_tbl((mlan_private *)priv, prx_pd->priority,
ta) &&
(prx_pd->rx_pkt_type != PKT_TYPE_AMSDU))) {

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

@ -34,6 +34,7 @@ Change log:
#include "mlan_main.h"
#include "mlan_wmm.h"
#include "mlan_11n.h"
#include "mlan_11ax.h"
#ifdef SDIO
#include "mlan_sdio.h"
#endif /* SDIO */
@ -1642,6 +1643,47 @@ void wlan_wmm_setup_ac_downgrade(pmlan_private priv)
LEAVE();
}
/**
* @brief This function checks whether a station has WMM enabled or not
*
* @param priv A pointer to mlan_private
* @param mac station mac address
* @return MTRUE or MFALSE
*/
static t_u8 is_station_wmm_enabled(mlan_private *priv, t_u8 *mac)
{
sta_node *sta_ptr = MNULL;
sta_ptr = wlan_get_station_entry(priv, mac);
if (sta_ptr) {
if (sta_ptr->is_11n_enabled || sta_ptr->is_11ax_enabled)
return MTRUE;
}
return MFALSE;
}
/**
* @brief This function checks whether wmm is supported
*
* @param priv A pointer to mlan_private
* @param ra Address of the receiver STA
*
* @return MTRUE or MFALSE
*/
static int wlan_is_wmm_enabled(mlan_private *priv, t_u8 *ra)
{
int ret = MFALSE;
ENTER();
#ifdef UAP_SUPPORT
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) {
if ((!(ra[0] & 0x01)) &&
(priv->is_11n_enabled || priv->is_11ax_enabled))
ret = is_station_wmm_enabled(priv, ra);
}
#endif /* UAP_SUPPORT */
LEAVE();
return ret;
}
/**
* @brief Allocate and add a RA list for all TIDs with the given RA
*
@ -1668,7 +1710,7 @@ void wlan_ralist_add(mlan_private *priv, t_u8 *ra)
ra_list->ba_status = BA_STREAM_NOT_SETUP;
ra_list->amsdu_in_ampdu = MFALSE;
if (queuing_ra_based(priv)) {
ra_list->is_wmm_enabled = wlan_is_11n_enabled(priv, ra);
ra_list->is_wmm_enabled = wlan_is_wmm_enabled(priv, ra);
if (ra_list->is_wmm_enabled)
ra_list->max_amsdu =
get_station_max_amsdu_size(priv, ra);
@ -1679,7 +1721,7 @@ void wlan_ralist_add(mlan_private *priv, t_u8 *ra)
status = wlan_get_tdls_link_status(priv, ra);
if (MTRUE == wlan_is_tdls_link_setup(status)) {
ra_list->is_wmm_enabled =
is_station_11n_enabled(priv, ra);
is_station_wmm_enabled(priv, ra);
if (ra_list->is_wmm_enabled)
ra_list->max_amsdu =
get_station_max_amsdu_size(priv,
@ -2009,7 +2051,7 @@ int wlan_ralist_update(mlan_private *priv, t_u8 *old_ra, t_u8 *new_ra)
if (queuing_ra_based(priv)) {
ra_list->is_wmm_enabled =
wlan_is_11n_enabled(priv, new_ra);
wlan_is_wmm_enabled(priv, new_ra);
if (ra_list->is_wmm_enabled)
ra_list->max_amsdu =
get_station_max_amsdu_size(
@ -2107,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,
@ -2230,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];
@ -2347,13 +2396,11 @@ mlan_status wlan_ret_wmm_get_status(pmlan_private priv, t_u8 *ptlv,
* @param ppassoc_buf Output parameter: Pointer to the TLV output buffer,
* modified on return to point after the appended WMM TLV
* @param pwmm_ie Pointer to the WMM IE for the BSS we are joining
* @param pht_cap Pointer to the HT IE for the BSS we are joining
*
* @return Length of data appended to the association tlv buffer
*/
t_u32 wlan_wmm_process_association_req(pmlan_private priv, t_u8 **ppassoc_buf,
IEEEtypes_WmmParameter_t *pwmm_ie,
IEEEtypes_HTCap_t *pht_cap)
IEEEtypes_WmmParameter_t *pwmm_ie)
{
MrvlIEtypes_WmmParamSet_t *pwmm_tlv;
t_u32 ret_len = 0;
@ -2378,10 +2425,7 @@ t_u32 wlan_wmm_process_association_req(pmlan_private priv, t_u8 **ppassoc_buf,
PRINTM(MINFO, "WMM: process assoc req: bss->wmmIe=0x%x\n",
pwmm_ie->vend_hdr.element_id);
if ((priv->wmm_required ||
(pht_cap && (pht_cap->ieee_hdr.element_id == HT_CAPABILITY) &&
(priv->config_bands & BAND_GN || priv->config_bands & BAND_AN))) &&
pwmm_ie->vend_hdr.element_id == WMM_IE) {
if (priv->wmm_required && pwmm_ie->vend_hdr.element_id == WMM_IE) {
pwmm_tlv = (MrvlIEtypes_WmmParamSet_t *)*ppassoc_buf;
pwmm_tlv->header.type = (t_u16)wmm_info_ie[0];
pwmm_tlv->header.type = wlan_cpu_to_le16(pwmm_tlv->header.type);

View file

@ -166,8 +166,7 @@ mlan_status wlan_ret_wmm_param_config(pmlan_private pmpriv,
/** Process WMM association request */
extern t_u32 wlan_wmm_process_association_req(pmlan_private priv,
t_u8 **ppAssocBuf,
IEEEtypes_WmmParameter_t *pWmmIE,
IEEEtypes_HTCap_t *pHTCap);
IEEEtypes_WmmParameter_t *pWmmIE);
#endif /* STA_SUPPORT */
/** setup wmm queue priorities */

View file

@ -24,7 +24,7 @@
#define _MLAN_DECL_H_
/** MLAN release version */
#define MLAN_RELEASE_VERSION "322"
#define MLAN_RELEASE_VERSION "366.p5"
/** 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
@ -432,7 +427,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** SD8977 Card */
#define CARD_SD8977 "SD8977"
/** SD8978 Card */
#define CARD_SD8978 "SD8978"
#define CARD_SD8978 "SDIW416"
/** SD8997 Card */
#define CARD_SD8997 "SD8997"
/** SD8987 Card */
@ -442,7 +437,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** SD9098 Card */
#define CARD_SD9098 "SD9098"
/** SD9177 Card */
#define CARD_SD9177 "SD9177"
#define CARD_SD9177 "SDIW612"
/** SD8801 Card */
#define CARD_SD8801 "SD8801"
/** SDNW62X Card */
@ -481,6 +476,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define CARD_PCIEAW690 "PCIEAW690"
/** PCIENW62X Card */
#define CARD_PCIENW62X "PCIENW62X"
/** PCIEIW629 Card */
#define CARD_PCIEIW629 "PCIEIW629"
#endif
#ifdef USB
@ -514,7 +511,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** USB8997 Card */
#define CARD_USB8997 "USB8997"
/** USB8978 Card */
#define CARD_USB8978 "USB8978"
#define CARD_USB8978 "USBIW416"
/** USB9098 Card */
#define CARD_USB9098 "USB9098"
/** USB9097 Card */
@ -632,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
@ -690,6 +689,18 @@ typedef enum _mlan_buf_type {
#endif
} mlan_buf_type;
#define SCAN_STATE_SCAN_START MBIT(0)
#define SCAN_STATE_EXT_SCAN MBIT(1)
#define SCAN_STATE_EXT_SCAN_ENH MBIT(2)
#define SCAN_STATE_EXT_SCAN_CANCEL MBIT(3)
#define SCAN_STATE_EXT_SCAN_CMDRESP MBIT(4)
#define SCAN_STATE_EXT_SCAN_ENH_CMDRESP MBIT(5)
#define SCAN_STATE_EXT_SCAN_CANCEL_CMDRESP MBIT(6)
#define SCAN_STATE_EXT_SCAN_RESULT MBIT(7)
#define SCAN_STATE_LAST_EXT_SCAN_RESULT MBIT(8)
#define SCAN_STATE_EXT_SCAN_STATUS MBIT(9)
#define SCAN_STATE_SCAN_COMPLETE MBIT(10)
#ifdef USB
/** mlan_usb_ep */
typedef enum _mlan_usb_ep {
@ -896,8 +907,8 @@ enum mlan_channel_type {
/** channel band */
enum { BAND_2GHZ = 0,
BAND_5GHZ = 1,
BAND_4GHZ = 2,
BAND_6GHZ = 3,
BAND_6GHZ = 2,
BAND_4GHZ = 3,
};
/** channel offset */
@ -946,8 +957,26 @@ 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 {
#ifdef BIG_ENDIAN_SUPPORT
/** Channel Selection Mode - (00)=manual, (01)=ACS, (02)=user*/
t_u8 scanMode : 2;
/** Secondary Channel Offset - (00)=None, (01)=Above, (11)=Below */
t_u8 chan2Offset : 2;
/** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */
t_u8 chanWidth : 2;
/** Band Info - (00)=2.4GHz, (01)=5GHz */
t_u8 chanBand : 2;
#else
/** Band Info - (00)=2.4GHz, (01)=5GHz */
t_u8 chanBand : 2;
/** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */
@ -956,6 +985,7 @@ typedef MLAN_PACK_START struct _Band_Config_t {
t_u8 chan2Offset : 2;
/** Channel Selection Mode - (00)=manual, (01)=ACS, (02)=Adoption mode*/
t_u8 scanMode : 2;
#endif
} MLAN_PACK_END Band_Config_t;
/** channel_band_t */
@ -1157,6 +1187,16 @@ typedef MLAN_PACK_START struct _radiotap_info {
/** txpower structure */
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
/** Host tx power ctrl:
0x0: use fw setting for TX power
0x1: value specified in bit[6] and bit[5:0] are valid */
t_u8 hostctl : 1;
/** Sign of the power specified in bit[5:0] */
t_u8 sign : 1;
/** Power to be used for transmission(in dBm) */
t_u8 abs_val : 6;
#else
/** Power to be used for transmission(in dBm) */
t_u8 abs_val : 6;
/** Sign of the power specified in bit[5:0] */
@ -1165,6 +1205,7 @@ typedef MLAN_PACK_START struct {
0x0: use fw setting for TX power
0x1: value specified in bit[6] and bit[5:0] are valid */
t_u8 hostctl : 1;
#endif
} MLAN_PACK_END tx_power_t;
/* pkt_txctrl */
typedef MLAN_PACK_START struct _pkt_txctrl {
@ -1991,7 +2032,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
@ -2291,8 +2341,12 @@ typedef struct _mlan_device {
t_u32 drv_mode;
/** dfs w53 cfg */
t_u8 dfs53cfg;
/** dfs_offload */
t_u8 dfs_offload;
/** extend enhance scan */
t_u8 ext_scan;
/* mcs32 setting */
t_u8 mcs32;
} mlan_device, *pmlan_device;
/** MLAN API function prototype */

View file

@ -46,10 +46,17 @@ typedef enum _WLAN_802_11_NETWORK_TYPE {
Wlan802_11NetworkTypeMax
} WLAN_802_11_NETWORK_TYPE;
#ifdef BIG_ENDIAN_SUPPORT
/** Frame control: Type Mgmt frame */
#define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 0x3000
/** Frame control: SubType Mgmt frame */
#define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc)&0xF000) >> 12)
#else
/** Frame control: Type Mgmt frame */
#define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 0x000C
/** Frame control: SubType Mgmt frame */
#define IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(fc) (((fc)&0x00F0) >> 4)
#endif
#ifdef PRAGMA_PACK
#pragma pack(push, 1)
@ -172,12 +179,21 @@ typedef MLAN_PACK_START struct _IEEEtypes_Generic_t {
/**ft capability policy*/
typedef MLAN_PACK_START struct _IEEEtypes_FtCapPolicy_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 reserved : 6;
/** RIC support */
t_u8 ric : 1;
/** FT over the DS capable */
t_u8 ft_over_ds : 1;
#else
/** FT over the DS capable */
t_u8 ft_over_ds : 1;
/** RIC support */
t_u8 ric : 1;
/** Reserved */
t_u8 reserved : 6;
#endif
} MLAN_PACK_END IEEEtypes_FtCapPolicy_t;
/** Mobility domain IE */
@ -310,6 +326,25 @@ typedef MLAN_PACK_START struct _TLV_Generic_t {
#define CAPINFO_MASK (~(MBIT(15) | MBIT(14) | MBIT(11) | MBIT(9)))
/** Capability Bit Map*/
#ifdef BIG_ENDIAN_SUPPORT
typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
t_u8 rsrvd1 : 2;
t_u8 dsss_ofdm : 1;
t_u8 radio_measurement : 1;
t_u8 rsvrd2 : 1;
t_u8 short_slot_time : 1;
t_u8 rsrvd3 : 1;
t_u8 spectrum_mgmt : 1;
t_u8 chan_agility : 1;
t_u8 pbcc : 1;
t_u8 short_preamble : 1;
t_u8 privacy : 1;
t_u8 cf_poll_rqst : 1;
t_u8 cf_pollable : 1;
t_u8 ibss : 1;
t_u8 ess : 1;
} MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
#else
typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
/** Capability Bit Map : ESS */
t_u8 ess : 1;
@ -342,6 +377,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
/** Capability Bit Map : Reserved */
t_u8 rsrvd1 : 2;
} MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
#endif /* BIG_ENDIAN_SUPPORT */
/** IEEEtypes_Ssid_t */
typedef MLAN_PACK_START struct _IEEEtypes_Ssid_t {
@ -556,16 +592,35 @@ typedef MLAN_PACK_START struct _IEEEtypes_Wpa_t {
/** Data structure of WMM QoS information */
typedef MLAN_PACK_START struct _IEEEtypes_WmmQosInfo_t {
#ifdef BIG_ENDIAN_SUPPORT
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
/** Reserved */
t_u8 reserved : 3;
/** Parameter set count */
t_u8 para_set_count : 4;
#else
/** Parameter set count */
t_u8 para_set_count : 4;
/** Reserved */
t_u8 reserved : 3;
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END IEEEtypes_WmmQosInfo_t, *pIEEEtypes_WmmQosInfo_t;
/** Data structure of WMM Aci/Aifsn */
typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 reserved : 1;
/** Aci */
t_u8 aci : 2;
/** Acm */
t_u8 acm : 1;
/** Aifsn */
t_u8 aifsn : 4;
#else
/** Aifsn */
t_u8 aifsn : 4;
/** Acm */
@ -574,14 +629,22 @@ typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t {
t_u8 aci : 2;
/** Reserved */
t_u8 reserved : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END IEEEtypes_WmmAciAifsn_t, *pIEEEtypes_WmmAciAifsn_t;
/** Data structure of WMM ECW */
typedef MLAN_PACK_START struct _IEEEtypes_WmmEcw_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Maximum Ecw */
t_u8 ecw_max : 4;
/** Minimum Ecw */
t_u8 ecw_min : 4;
#else
/** Minimum Ecw */
t_u8 ecw_min : 4;
/** Maximum Ecw */
t_u8 ecw_max : 4;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END IEEEtypes_WmmEcw_t, *pIEEEtypes_WmmEcw_t;
/** Data structure of WMM AC parameters */
@ -669,6 +732,22 @@ typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e {
/** Data structure of WMM TSPEC information */
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
t_u8 Reserved17_23 : 7; /* ! Reserved */
t_u8 Schedule : 1;
IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2;
t_u8 UserPri : 3; /* ! 802.1d User Priority */
// IEEEtypes_WMM_TSPEC_TS_Info_PSB_e PowerSaveBehavior : 1; /*
// !Legacy/Trigg*/
t_u8 PowerSaveBehavior : 1;
t_u8 Aggregation : 1; /* ! Reserved */
t_u8 AccessPolicy2 : 1; /* ! */
t_u8 AccessPolicy1 : 1; /* ! */
IEEEtypes_WMM_TSPEC_TS_Info_Direction_e Direction : 2;
t_u8 TID : 4; /* ! Unique identifier */
// IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1;
t_u8 TrafficType : 1;
#else
// IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1;
t_u8 TrafficType : 1;
t_u8 TID : 4; /* ! Unique identifier */
@ -683,19 +762,31 @@ typedef MLAN_PACK_START struct {
IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2;
t_u8 Schedule : 1;
t_u8 Reserved17_23 : 7; /* ! Reserved */
#endif
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_t;
/** Data structure of WMM TSPEC Nominal Size */
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is
nominal */
t_u16 Size : 15; /* ! Nominal size in octets */
#else
t_u16 Size : 15; /* ! Nominal size in octets */
t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is
nominal */
#endif
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_NomMSDUSize_t;
/** Data structure of WMM TSPEC SBWA */
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
t_u16 Whole : 3; /* ! Whole portion */
t_u16 Fractional : 13; /* ! Fractional portion */
#else
t_u16 Fractional : 13; /* ! Fractional portion */
t_u16 Whole : 3; /* ! Whole portion */
#endif
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_SBWA;
/** Data structure of WMM TSPEC Body */
@ -1036,6 +1127,26 @@ typedef MLAN_PACK_START struct _VHT_MCS_set {
/** VHT Capabilities info field, reference 802.11ac D1.4 p89 */
typedef MLAN_PACK_START struct _VHT_capa {
#if 0
#ifdef BIG_ENDIAN_SUPPORT
t_u8 mpdu_max_len:2;
t_u8 chan_width:2;
t_u8 rx_LDPC:1;
t_u8 sgi_80:1;
t_u8 sgi_160:1;
t_u8 tx_STBC:1;
t_u8 rx_STBC:3;
t_u8 SU_beamformer_capa:1;
t_u8 SU_beamformee_capa:1;
t_u8 beamformer_ante_num:3;
t_u8 sounding_dim_num:3;
t_u8 MU_beamformer_capa:1;
t_u8 MU_beamformee_capa:1;
t_u8 VHT_TXOP_ps:1;
t_u8 HTC_VHT_capa:1;
t_u8 max_ampdu_len:3;
t_u8 link_apapt_capa:2;
t_u8 reserved_1:4;
#else
t_u8 reserved_1:4;
t_u8 link_apapt_capa:2;
t_u8 max_ampdu_len:3;
@ -1054,6 +1165,7 @@ typedef MLAN_PACK_START struct _VHT_capa {
t_u8 rx_LDPC:1;
t_u8 chan_width:2;
t_u8 mpdu_max_len:2;
#endif /* BIG_ENDIAN_SUPPORT */
#endif
t_u32 vht_cap_info;
VHT_MCS_set_t mcs_sets;
@ -1162,6 +1274,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_Extension_t {
} MLAN_PACK_END IEEEtypes_Extension_t, *pIEEEtypes_Extension_t;
typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Max HE-MAC for 8 SS */
t_u8 max_mcs_8ss : 2;
/** Max HE-MAC for 7 SS */
t_u8 max_mcs_7ss : 2;
/** Max HE-MAC for 6 SS */
t_u8 max_mcs_6ss : 2;
/** Max HE-MAC for 5 SS */
t_u8 max_mcs_5ss : 2;
/** Max HE-MAC for 4 SS */
t_u8 max_mcs_4ss : 2;
/** Max HE-MAC for 3 SS */
t_u8 max_mcs_3ss : 2;
/** Max HE-MAC for 2 SS */
t_u8 max_mcs_2ss : 2;
/** Max HE-MAC for 1 SS */
t_u8 max_mcs_1ss : 2;
#else
/** Max HE-MAC for 1 SS */
t_u8 max_mcs_1ss : 2;
/** Max HE-MAC for 2 SS */
@ -1178,6 +1308,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t {
t_u8 max_mcs_7ss : 2;
/** Max HE-MAC for 8 SS */
t_u8 max_mcs_8ss : 2;
#endif
} MLAN_PACK_END IEEEtypes_HeMcsMap_t, *pIEEEtypes_HeMcsMap_t;
typedef MLAN_PACK_START struct _IEEEtypes_HeMcsNss_t {
@ -1204,6 +1335,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_HECap_t {
} MLAN_PACK_END IEEEtypes_HECap_t, *pIEEEtypes_HECap_t;
typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved, including 6G Operation Info Pressent (bit17) */
t_u8 reserved : 6; /* bit 18-23 */
/* 6g operation info present */
t_u8 he_6g_op_info_present : 1; /* bit 17 */
/** ER SU Disable */
t_u8 er_su_disable : 1; /* bit 16 */
/** Co-Hosted BSS */
t_u16 co_located_bss : 1; /* bit 15 */
/** VHT Operation Info Present */
t_u16 vht_op_info_present : 1; /* bit 14 */
/** TXOP Duration RTS Threshold */
t_u16 txop_dur_rts_threshold : 10; /* bit 4-13 */
/** TWT Required */
t_u16 twt_req : 1; /* bit 3 */
/** Default PE Duration */
t_u16 default_pe_dur : 3; /* bit 0-2 */
#else
/** Default PE Duration */
t_u16 default_pe_dur : 3; /* bit 0-2 */
/** TWT Required */
@ -1216,17 +1365,29 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t {
t_u16 co_located_bss : 1; /* bit 15 */
/** ER SU Disable */
t_u8 er_su_disable : 1; /* bit 16 */
/** Reserved, including 6G Operation Info Pressent (bit17) */
t_u8 reserved : 7; /* bit 17-23 */
/* 6g operation info present */
t_u8 he_6g_op_info_present : 1; /* bit 17 */
/** Reserved bit 18-23 */
t_u8 reserved : 6; /* bit 18-23 */
#endif
} MLAN_PACK_END IEEEtypes_HeOpParam_t;
typedef MLAN_PACK_START struct _IEEEtypes_HeBssColorInfo_t {
#ifdef BIG_ENDIAN_SUPPORT
/** BSS Color Disabled */
t_u8 bss_color_disabled : 1; /* bit 7 */
/** Partial BSS Color */
t_u8 partial_bss_color : 1; /* bit 6 */
/** BSS Color */
t_u8 bss_color : 6; /* bit 0-5 */
#else
/** BSS Color */
t_u8 bss_color : 6; /* bit 0-5 */
/** Partial BSS Color */
t_u8 partial_bss_color : 1; /* bit 6 */
/** BSS Color Disabled */
t_u8 bss_color_disabled : 1; /* bit 7 */
#endif
} MLAN_PACK_END IEEEtypes_HeBssColorInfo_t;
typedef MLAN_PACK_START struct _IEEEtypes_HeOp_t {
@ -1388,6 +1549,20 @@ typedef MLAN_PACK_START struct {
*** @brief Map octet of the basic measurement report (7.3.2.22.1)
**/
typedef MLAN_PACK_START struct {
#ifdef BIG_ENDIAN_SUPPORT
/**< Reserved */
t_u8 rsvd5_7 : 3;
/**< Channel is unmeasured */
t_u8 unmeasured : 1;
/**< Radar detected on channel */
t_u8 radar : 1;
/**< Unidentified signal found on channel */
t_u8 unidentified_sig : 1;
/**< OFDM preamble detected on channel */
t_u8 ofdm_preamble : 1;
/**< At least one valid MPDU received on channel */
t_u8 bss : 1;
#else
/**< At least one valid MPDU received on channel */
t_u8 bss : 1;
/**< OFDM preamble detected on channel */
@ -1400,6 +1575,7 @@ typedef MLAN_PACK_START struct {
t_u8 unmeasured : 1;
/**< Reserved */
t_u8 rsvd5_7 : 3;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END MeasRptBasicMap_t;
@ -1635,6 +1811,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*/
@ -1657,7 +1835,10 @@ typedef MLAN_PACK_START struct {
/**wait for all channel scan to complete to report scan result*/
#define BG_SCAN_WAIT_ALL_CHAN_DONE 0x80000000
/** Maximum number of channels that can be sent in bg scan config */
#define WLAN_BG_SCAN_CHAN_MAX 38
#define CHAN_MAX_24G 14
#define CHAN_MAX_5G 24
#define CHAN_MAX_UNII4 3
#define WLAN_BG_SCAN_CHAN_MAX (CHAN_MAX_24G + CHAN_MAX_5G + CHAN_MAX_UNII4)
/** Enumeration definition */
/** EES MODE */

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
@ -360,6 +363,8 @@ enum _mlan_ioctl_req_id {
MLAN_OID_MISC_IPS_CFG = 0x00200085,
MLAN_OID_MISC_MC_AGGR_CFG = 0x00200086,
MLAN_OID_MISC_CH_LOAD = 0x00200087,
MLAN_OID_MISC_STATS = 0x00200088,
MLAN_OID_MISC_CH_LOAD_RESULTS = 0x00200089,
};
/** Sub command size */
@ -401,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
@ -757,14 +770,31 @@ typedef struct _mlan_ssid_bssid {
/** Data structure of WMM ECW */
typedef struct _wmm_ecw_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Maximum Ecw */
t_u8 ecw_max : 4;
/** Minimum Ecw */
t_u8 ecw_min : 4;
#else
/** Minimum Ecw */
t_u8 ecw_min : 4;
/** Maximum Ecw */
t_u8 ecw_max : 4;
#endif /* BIG_ENDIAN_SUPPORT */
} wmm_ecw_t, *pwmm_ecw_t;
/** Data structure of WMM Aci/Aifsn */
typedef struct _wmm_aci_aifsn_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 reserved : 1;
/** Aci */
t_u8 aci : 2;
/** Acm */
t_u8 acm : 1;
/** Aifsn */
t_u8 aifsn : 4;
#else
/** Aifsn */
t_u8 aifsn : 4;
/** Acm */
@ -773,6 +803,7 @@ typedef struct _wmm_aci_aifsn_t {
t_u8 aci : 2;
/** Reserved */
t_u8 reserved : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} wmm_aci_aifsn_t, *pwmm_aci_aifsn_t;
/** Data structure of WMM AC parameters */
@ -979,12 +1010,21 @@ typedef struct _wep_param {
/** Data structure of WMM QoS information */
typedef struct _wmm_qos_info_t {
#ifdef BIG_ENDIAN_SUPPORT
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
/** Reserved */
t_u8 reserved : 3;
/** Parameter set count */
t_u8 para_set_count : 4;
#else
/** Parameter set count */
t_u8 para_set_count : 4;
/** Reserved */
t_u8 reserved : 3;
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} wmm_qos_info_t, *pwmm_qos_info_t;
/** Data structure of WMM parameter IE */
@ -1878,11 +1918,20 @@ typedef struct _mlan_fw_info {
t_u8 prohibit_80mhz;
/** FW support beacon protection */
t_u8 fw_beacon_prot;
/* lower 8 bytes of uuid */
t_u64 uuid_lo;
/* higher 8 bytes of uuid */
t_u64 uuid_hi;
} mlan_fw_info, *pmlan_fw_info;
/** Version string buffer length */
#define MLAN_MAX_VER_STR_LEN 128
/** Maximum length of secure boot uuid */
#define MLAN_MAX_UUID_LEN 32
/** mlan_ver_ext data structure for MLAN_OID_GET_VER_EXT */
typedef struct _mlan_ver_ext {
/** Selected version string */
@ -1891,6 +1940,100 @@ typedef struct _mlan_ver_ext {
char version_str[MLAN_MAX_VER_STR_LEN];
} mlan_ver_ext, *pmlan_ver_ext;
#ifdef BIG_ENDIAN_SUPPORT
/** Extended Capabilities Data */
typedef struct MLAN_PACK_START _ExtCap_t {
/** Extended Capabilities value */
t_u8 rsvdBit87 : 1; /* bit 87 */
t_u8 rsvdBit86 : 1; /* bit 86 */
t_u8 rsvdBit85 : 1; /* bit 85 */
t_u8 beacon_prot : 1; /* bit 84 */
t_u8 rsvdBit83 : 1; /* bit 83 */
t_u8 rsvdBit82 : 1; /* bit 82 */
t_u8 rsvdBit81 : 1; /* bit 81 */
t_u8 rsvdBit80 : 1; /* bit 80 */
t_u8 rsvdBit79 : 1; /* bit 79 */
t_u8 TWTResp : 1; /* bit 78 */
t_u8 TWTReq : 1; /* bit 77 */
t_u8 rsvdBit76 : 1; /* bit 76 */
t_u8 rsvdBit75 : 1; /* bit 75 */
t_u8 rsvdBit74 : 1; /* bit 74 */
t_u8 rsvdBit73 : 1; /* bit 73 */
t_u8 FILS : 1; /* bit 72 */
t_u8 FTMI : 1; /* bit 71 */
t_u8 FTMR : 1; /* bit 70 */
t_u8 CAQ : 1; /* bit 69 */
t_u8 rsvdBit68 : 1; /* bit 68 */
t_u8 NCC : 1; /* bit 67 */
t_u8 rsvdBit66 : 1; /* bit 66 */
t_u8 chanSchedMgnt : 1; /* bit 65 */
t_u8 MaxAMSDU1 : 1; /* bit 64 */
t_u8 MaxAMSDU0 : 1; /* bit 63 */
t_u8 OperModeNtf : 1; /* bit 62 */
t_u8 TDLSWildBandwidth : 1; /* bit 61 */
t_u8 rsvdBit60 : 1; /* bit 60 */
t_u8 rsvdBit59 : 1; /* bit 59 */
t_u8 rsvdBit58 : 1; /* bit 58 */
t_u8 rsvdBit57 : 1; /* bit 57 */
t_u8 rsvdBit56 : 1; /* bit 56 */
t_u8 rsvdBit55 : 1; /* bit 55 */
t_u8 rsvdBit54 : 1; /* bit 54 */
t_u8 rsvdBit53 : 1; /* bit 53 */
t_u8 rsvdBit52 : 1; /* bit 52 */
t_u8 rsvdBit51 : 1; /* bit 51 */
t_u8 rsvdBit50 : 1; /* bit 50 */
t_u8 rsvdBit49 : 1; /* bit 49 */
t_u8 rsvdBit48 : 1; /* bit 48 */
t_u8 rsvdBit47 : 1; /* bit 47 */
t_u8 rsvdBit46 : 1; /* bit 46 */
t_u8 rsvdBit45 : 1; /* bit 45 */
t_u8 rsvdBit44 : 1; /* bit 44 */
t_u8 rsvdBit43 : 1; /* bit 43 */
t_u8 rsvdBit42 : 1; /* bit 42 */
t_u8 rsvdBit41 : 1; /* bit 41 */
t_u8 rsvdBit40 : 1; /* bit 40 */
t_u8 TDLSChlSwitchProhib : 1; /* bit 39 */
t_u8 TDLSProhibited : 1; /* bit 38 */
t_u8 TDLSSupport : 1; /* bit 37 */
t_u8 MSGCF_Capa : 1; /* bit 36 */
t_u8 Reserved35 : 1; /* bit 35 */
t_u8 SSPN_Interface : 1; /* bit 34 */
t_u8 EBR : 1; /* bit 33 */
t_u8 Qos_Map : 1; /* bit 32 */
t_u8 Interworking : 1; /* bit 31 */
t_u8 TDLSChannelSwitching : 1; /* bit 30 */
t_u8 TDLSPeerPSMSupport : 1; /* bit 29 */
t_u8 TDLSPeerUAPSDSupport : 1; /* bit 28 */
t_u8 UTC : 1; /* bit 27 */
t_u8 DMS : 1; /* bit 26 */
t_u8 SSID_List : 1; /* bit 25 */
t_u8 ChannelUsage : 1; /* bit 24 */
t_u8 TimingMeasurement : 1; /* bit 23 */
t_u8 MultipleBSSID : 1; /* bit 22 */
t_u8 AC_StationCount : 1; /* bit 21 */
t_u8 QoSTrafficCap : 1; /* bit 20 */
t_u8 BSS_Transition : 1; /* bit 19 */
t_u8 TIM_Broadcast : 1; /* bit 18 */
t_u8 WNM_Sleep : 1; /* bit 17 */
t_u8 TFS : 1; /* bit 16 */
t_u8 GeospatialLocation : 1; /* bit 15 */
t_u8 CivicLocation : 1; /* bit 14 */
t_u8 CollocatedIntf : 1; /* bit 13 */
t_u8 ProxyARPService : 1; /* bit 12 */
t_u8 FMS : 1; /* bit 11 */
t_u8 LocationTracking : 1; /* bit 10 */
t_u8 MulticastDiagnostics : 1; /* bit 9 */
t_u8 Diagnostics : 1; /* bit 8 */
t_u8 Event : 1; /* bit 7 */
t_u8 SPSMP_Support : 1; /* bit 6 */
t_u8 Reserved5 : 1; /* bit 5 */
t_u8 PSMP_Capable : 1; /* bit 4 */
t_u8 RejectUnadmFrame : 1; /* bit 3 */
t_u8 ExtChanSwitching : 1; /* bit 2 */
t_u8 Reserved1 : 1; /* bit 1 */
t_u8 BSS_CoexistSupport : 1; /* bit 0 */
} MLAN_PACK_END ExtCap_t, *pExtCap_t;
#else
/** Extended Capabilities Data */
typedef struct MLAN_PACK_START _ExtCap_t {
/** Extended Capabilities value */
@ -1983,6 +2126,7 @@ typedef struct MLAN_PACK_START _ExtCap_t {
t_u8 rsvdBit86 : 1; /* bit 86 */
t_u8 rsvdBit87 : 1; /* bit 87 */
} MLAN_PACK_END ExtCap_t, *pExtCap_t;
#endif
/** ExtCap : TDLS prohibited */
#define IS_EXTCAP_TDLS_PROHIBITED(ext_cap) (ext_cap.TDLSProhibited)
@ -2000,7 +2144,7 @@ typedef struct _mlan_bss_info {
/** Channel */
t_u32 bss_chan;
/** Band */
t_u8 bss_band;
t_u16 bss_band;
/** Region code */
t_u32 region_code;
/** Connection status */
@ -2192,6 +2336,8 @@ typedef struct _mlan_debug_info {
t_u32 bypass_pkt_count;
/** Corresponds to scan_processing member of mlan_adapter */
t_u32 scan_processing;
/** Corresponds to scan_state member of mlan_adapter */
t_u32 scan_state;
/** Corresponds to mlan_processing member of mlan_adapter */
t_u32 mlan_processing;
/** Corresponds to main_lock_flag member of mlan_adapter */
@ -4175,12 +4321,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;
@ -4216,6 +4373,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*/
@ -4223,6 +4382,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;
@ -4425,6 +4586,9 @@ typedef struct _mlan_ds_misc_cck_desense_cfg {
#define MLAN_IPADDR_OP_ARP_FILTER MBIT(0)
/** IP operation ARP response */
#define MLAN_IPADDR_OP_AUTO_ARP_RESP MBIT(1)
/** Enable opcode bit for MDNS & NS when device enter into suspend **/
#define MLAN_OP_ADD_MDNS MBIT(2)
#define MLAN_OP_ADD_IPV6_NS MBIT(3)
/** Type definition of mlan_ds_misc_ipaddr_cfg for MLAN_OID_MISC_IP_ADDR */
typedef struct _mlan_ds_misc_ipaddr_cfg {
@ -4628,6 +4792,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;
@ -5492,10 +5666,24 @@ typedef struct _mlan_ds_mc_aggr_cfg {
/** CTS2Self duration offset */
t_u16 cts2self_offset;
} mlan_ds_mc_aggr_cfg;
/** mlan_ds_stats */
typedef struct _mlan_ds_stats {
/** action */
t_u16 action;
/** tlv len */
t_u16 tlv_len;
/** TLV buffer */
t_u8 tlv_buf[1];
} mlan_ds_stats;
typedef struct _mlan_ds_ch_load {
/** action */
t_u8 action;
t_u16 ch_load_param;
t_s16 noise;
t_u16 rx_quality;
t_u16 duration;
} mlan_ds_ch_load;
/** Type definition of mlan_ds_misc_cfg for MLAN_IOCTL_MISC_CFG */
@ -5569,6 +5757,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
*/
@ -5640,6 +5830,7 @@ typedef struct _mlan_ds_misc_cfg {
mlan_ds_misc_tp_state tp_state;
mlan_ds_hal_phy_cfg_params hal_phy_cfg_params;
mlan_ds_mc_aggr_cfg mc_aggr_cfg;
mlan_ds_stats stats;
#ifdef UAP_SUPPORT
t_u8 wacp_mode;
#endif

View file

@ -167,6 +167,11 @@ extern const struct net_device_ops woal_netdev_ops;
/********************************************************
* Global Functions
********************************************************/
#ifdef UAP_SUPPORT
#if CFG80211_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
int woal_11ax_cfg(moal_private *priv, t_u8 action, mlan_ds_11ax_he_cfg *he_cfg);
#endif
#endif
/**
* @brief Get the private structure from wiphy
@ -285,6 +290,32 @@ t_u8 woal_band_cfg_to_ieee_band(t_u32 band)
return ret_radio_type;
}
/**
* @brief Convert IEEE band type to radio_type
*
* @param ieeeband IEEE band
*
* @return radio_type
*/
t_u8 woal_ieee_band_to_radio_type(t_u8 ieee_band)
{
t_u8 radio_type = 0;
ENTER();
switch (ieee_band) {
case IEEE80211_BAND_5GHZ:
radio_type = BAND_5GHZ;
break;
case IEEE80211_BAND_2GHZ:
default:
radio_type = BAND_2GHZ;
break;
}
LEAVE();
return radio_type;
}
/**
* @brief Set/Enable encryption key
*
@ -512,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;
@ -533,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 */
@ -564,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;
@ -593,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 */
@ -855,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);
@ -954,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)) {
@ -976,6 +1042,44 @@ done:
#endif /* KERNEL_VERSION */
#endif /* WIFI_DIRECT_SUPPORT */
#ifdef UAP_SUPPORT
/**
* @brief Request to cancel CAC
*
* @param priv A pointer to moal_private structure
*
* @return N/A */
void woal_cancel_cac(moal_private *priv)
{
#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
return;
}
#endif
/**
* @brief Request the driver to change the interface type
*
@ -1016,10 +1120,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
@ -1109,7 +1249,11 @@ 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 ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13)
woal_cfg80211_del_beacon(wiphy, dev, 0);
#else
woal_cfg80211_del_beacon(wiphy, dev);
#endif
bss_role = MLAN_BSS_ROLE_STA;
woal_cfg80211_bss_role_cfg(priv, MLAN_ACT_SET,
&bss_role);
@ -1168,10 +1312,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);
@ -1336,6 +1483,9 @@ fail:
*/
#endif
int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev,
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index,
#if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE
bool pairwise,
@ -1392,6 +1542,9 @@ int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *netdev,
*/
#endif
int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev,
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index,
#if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE
bool pairwise,
@ -1447,7 +1600,11 @@ int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *netdev,
*/
#endif
int woal_cfg80211_set_default_key(struct wiphy *wiphy,
struct net_device *netdev, t_u8 key_index
struct net_device *netdev,
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index
#if KERNEL_VERSION(2, 6, 37) < CFG80211_VERSION_CODE
,
bool ucast, bool mcast
@ -1479,6 +1636,9 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy,
#if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE
int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
struct net_device *netdev,
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index)
{
PRINTM(MINFO, "set default mgmt key, key index=%d\n", key_index);
@ -1490,6 +1650,9 @@ int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
#if KERNEL_VERSION(5, 10, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_set_default_beacon_key(struct wiphy *wiphy,
struct net_device *netdev,
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index)
{
PRINTM(MINFO, "set default beacon key, key index=%d\n", key_index);
@ -1514,7 +1677,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();
@ -1522,7 +1684,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;
@ -1536,14 +1699,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;
}
/**
@ -1649,7 +1810,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);
@ -2076,6 +2237,9 @@ done:
* @return 0 -- success, otherwise fail
*/
int woal_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13)
unsigned int link_id,
#endif
const u8 *peer,
const struct cfg80211_bitrate_mask *mask)
{
@ -2403,6 +2567,8 @@ void woal_cfg80211_mgmt_frame_register(struct wiphy *wiphy,
LEAVE();
}
#ifdef UAP_CFG80211
#if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE
/*
* @brief prepare and send WOAL_EVENT_CANCEL_CHANRPT
*
@ -2410,7 +2576,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;
@ -2423,17 +2589,15 @@ static void woal_cancel_chanrpt_event(moal_private *priv)
return;
}
evt->priv = priv;
#ifdef UAP_CFG80211
#if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE
evt->type = WOAL_EVENT_CANCEL_CHANRPT;
#endif
#endif
INIT_LIST_HEAD(&evt->link);
spin_lock_irqsave(&handle->evt_lock, flags);
list_add_tail(&evt->link, &handle->evt_queue);
spin_unlock_irqrestore(&handle->evt_lock, flags);
queue_work(handle->evt_workqueue, &handle->evt_work);
}
#endif
#endif
#if KERNEL_VERSION(3, 2, 0) <= CFG80211_VERSION_CODE
#if KERNEL_VERSION(3, 3, 0) <= CFG80211_VERSION_CODE
@ -2630,19 +2794,14 @@ 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,
"Drop deauth packet before AP started\n");
woal_cancel_cac(priv);
goto done;
}
#endif
PRINTM(MMSG,
"wlan: HostMlme %s send deauth/disassoc\n",
priv->netdev->name);
@ -2787,7 +2946,11 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy,
#if KERNEL_VERSION(3, 8, 0) > LINUX_VERSION_CODE
*cookie = random32() | 1;
#else
#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
*cookie = prandom_u32() | 1;
#else
*cookie = get_random_u32() | 1;
#endif
#endif
pmbuf->data_offset = MLAN_MIN_DATA_HEADER_LEN;
pkt_type = MRVL_PKT_TYPE_MGMT_FRAME;
@ -3361,6 +3524,7 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie, int len,
case HT_OPERATION:
case VHT_CAPABILITY:
case VHT_OPERATION:
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
if (moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) {
if ((out_len + length + 2) < (int)ie_out_len) {
moal_memcpy_ext(priv->phandle,
@ -3373,6 +3537,7 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie, int len,
"IE too big, fail copy COUNTRY INFO IE\n");
}
}
#endif
break;
case EXTENDED_SUPPORTED_RATES:
case WLAN_EID_ERP_INFO:
@ -3385,11 +3550,14 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie, int len,
break;
case EXTENSION:
ext_id = *(pos + 2);
if ((ext_id == HE_CAPABILITY ||
ext_id == HE_OPERATION) &&
!moal_extflg_isset(priv->phandle, EXT_HOST_MLME))
if ((ext_id == HE_CAPABILITY || ext_id == HE_OPERATION)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
&& !moal_extflg_isset(priv->phandle, EXT_HOST_MLME)
#endif
)
break;
else {
#ifdef UAP_SUPPORT
#if CFG80211_VERSION_CODE < KERNEL_VERSION(4, 20, 0)
if (ext_id == HE_CAPABILITY) {
mlan_ds_11ax_he_cfg he_cfg;
@ -3432,6 +3600,7 @@ static t_u16 woal_filter_beacon_ies(moal_private *priv, const t_u8 *ie, int len,
"Fail to get 11ax he_cap parameters\n");
}
} else
#endif
#endif
{
if ((out_len + length + 2) <
@ -3531,8 +3700,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;
}
@ -3694,6 +3869,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;
}
@ -3746,6 +3922,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;
@ -3760,6 +3937,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;
}
@ -3851,6 +4029,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;
@ -3907,6 +4086,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;
}
@ -3919,6 +4099,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;
@ -3937,6 +4118,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;
@ -3991,6 +4173,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;
@ -4013,6 +4196,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;
@ -4027,6 +4211,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;
}
@ -4064,6 +4249,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;
@ -4089,6 +4275,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;
@ -4164,14 +4351,14 @@ struct ieee80211_supported_band *woal_setup_wiphy_bands(t_u8 ieee_band)
sizeof(struct ieee80211_supported_band),
GFP_KERNEL);
if (!band) {
PRINTM(MERROR, "No memory for band\n");
PRINTM(MERROR, "No memory for 5g band\n");
break;
}
band->channels =
kmemdup(&cfg80211_channels_5ghz,
sizeof(cfg80211_channels_5ghz), GFP_KERNEL);
if (!band->channels) {
PRINTM(MERROR, "No memory for band->channel\n");
PRINTM(MERROR, "No memory for 5g band->channel\n");
kfree(band);
band = NULL;
break;
@ -4184,14 +4371,14 @@ struct ieee80211_supported_band *woal_setup_wiphy_bands(t_u8 ieee_band)
sizeof(struct ieee80211_supported_band),
GFP_KERNEL);
if (!band) {
PRINTM(MERROR, "No memory for band\n");
PRINTM(MERROR, "No memory for 2g band\n");
break;
}
band->channels =
kmemdup(&cfg80211_channels_2ghz,
sizeof(cfg80211_channels_2ghz), GFP_KERNEL);
if (!band->channels) {
PRINTM(MERROR, "No memory for band->channel\n");
PRINTM(MERROR, "No memory for 2g band->channel\n");
kfree(band);
band = NULL;
break;
@ -4407,7 +4594,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
@ -4571,7 +4758,7 @@ done:
*/
void woal_cfg80211_free_bands(struct wiphy *wiphy)
{
enum nl80211_band band;
t_u8 band;
for (band = NL80211_BAND_2GHZ; band < IEEE80211_NUM_BANDS; ++band) {
if (!wiphy->bands[band])
@ -4588,6 +4775,7 @@ void woal_cfg80211_free_bands(struct wiphy *wiphy)
}
}
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
/*
* @brief prepare and send fake deauth packet to cfg80211 to
* notify wpa_supplicant about disconnection
@ -4619,6 +4807,7 @@ void woal_deauth_event(moal_private *priv, int reason_code)
spin_unlock_irqrestore(&handle->evt_lock, flags);
queue_work(handle->evt_workqueue, &handle->evt_work);
}
#endif
#ifdef STA_CFG80211
#if KERNEL_VERSION(3, 2, 0) <= CFG80211_VERSION_CODE
@ -4667,27 +4856,6 @@ void woal_cfg80211_notify_sched_scan_stop(moal_private *priv)
PRINTM(MEVENT, "Notify sched scan stopped\n");
}
/**
* @brief sched_scan work handler
*
* @param work a pointer to work_struct
*
* @return 0 -- success, otherwise fail
*/
void woal_sched_scan_work_queue(struct work_struct *work)
{
struct delayed_work *delayed_work =
container_of(work, struct delayed_work, work);
moal_private *priv =
container_of(delayed_work, moal_private, sched_scan_work);
ENTER();
if (priv->sched_scanning)
woal_cfg80211_notify_sched_scan_stop(priv);
LEAVE();
}
/**
* @brief report sched_scan result to kernel
*
@ -4703,8 +4871,6 @@ void woal_report_sched_scan_result(moal_private *priv)
priv->bg_scan_reqid
#endif
);
queue_delayed_work(priv->sched_scan_workqueue, &priv->sched_scan_work,
msecs_to_jiffies(2000));
}
#endif
#endif
@ -4763,7 +4929,17 @@ 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(3, 14, 0) <= CFG80211_VERSION_CODE
mutex_lock(&priv->wdev->mtx);
#endif
#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13)
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
moal_memcpy_ext(priv->phandle, &priv->chan, &chandef,
@ -4894,6 +5070,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy,
0x300 &&
(radio->param.ant_cfg.rx_antenna & 0xFF00) != 0)) {
bands->ht_cap.mcs.rx_mask[1] = 0;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
bands->vht_cap.vht_mcs.rx_mcs_map =
(__force __le16)0xfffe;
bands->vht_cap.vht_mcs.tx_mcs_map =
@ -4902,6 +5079,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy,
(__force __le16)0x186;
bands->vht_cap.vht_mcs.tx_highest =
(__force __le16)0x186;
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
if (bands->n_iftype_data &&
bands->iftype_data &&
@ -4928,6 +5106,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy,
(radio->param.ant_cfg.rx_antenna & 0xFF00) ==
0x300) {
bands->ht_cap.mcs.rx_mask[1] = 0xff;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
bands->vht_cap.vht_mcs.rx_mcs_map =
(__force __le16)0xfffa;
bands->vht_cap.vht_mcs.tx_mcs_map =
@ -4936,6 +5115,7 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy,
(__force __le16)0x30c;
bands->vht_cap.vht_mcs.tx_highest =
(__force __le16)0x30c;
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
if (bands->n_iftype_data &&
bands->iftype_data &&
@ -5095,18 +5275,19 @@ 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;
(dfs_state_t)sband->channels[i]
.dfs_state;
ch_dfs_state->dfs_required = MTRUE;
ret = 0;
#endif
break;
}
ret = 0;
break;
}
}
LEAVE();
@ -5153,8 +5334,8 @@ 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, "ZERODFS: Set channel %d dfs_state: %d\n",
channel, sband->channels[i].dfs_state);
PRINTM(MCMD_D, "DFS: Set channel %d dfs_state: %d\n", channel,
sband->channels[i].dfs_state);
#endif
LEAVE();
}

View file

@ -115,6 +115,7 @@ void woal_regulatory_work_queue(struct work_struct *work);
#endif
t_u8 woal_band_cfg_to_ieee_band(t_u32 band);
t_u8 woal_ieee_band_to_radio_type(t_u8 ieee_band);
int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy,
struct net_device *dev,
@ -127,6 +128,9 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy,
int woal_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index,
#if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE
bool pairwise,
@ -134,6 +138,9 @@ int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
const t_u8 *mac_addr, struct key_params *params);
int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index,
#if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE
bool pairwise,
@ -155,6 +162,9 @@ 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 ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13)
unsigned int link_id,
#endif
const u8 *peer,
const struct cfg80211_bitrate_mask *mask);
#if KERNEL_VERSION(2, 6, 38) <= CFG80211_VERSION_CODE
@ -203,6 +213,9 @@ int woal_cfg80211_set_channel(struct wiphy *wiphy,
#if KERNEL_VERSION(2, 6, 37) < CFG80211_VERSION_CODE
int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev,
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index, bool ucast, bool mcast);
#else
int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev,
@ -212,12 +225,18 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev,
#if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE
int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
struct net_device *netdev,
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index);
#endif
#if KERNEL_VERSION(5, 10, 0) <= CFG80211_VERSION_CODE
int woal_cfg80211_set_default_beacon_key(struct wiphy *wiphy,
struct net_device *netdev,
#if (CFG80211_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index);
#endif
@ -263,10 +282,6 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy,
#endif
u64 *cookie);
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
void woal_update_radar_chans_dfs_state(struct wiphy *wiphy);
#endif
mlan_status woal_register_cfg80211(moal_private *priv);
extern struct ieee80211_supported_band cfg80211_band_2ghz;
@ -278,6 +293,11 @@ extern struct ieee80211_supported_band mac1_cfg80211_band_5ghz;
int woal_cfg80211_bss_role_cfg(moal_private *priv, t_u16 action,
t_u8 *bss_role);
#endif
#ifdef UAP_SUPPORT
void woal_cancel_cac(moal_private *priv);
#endif
#if KERNEL_VERSION(4, 1, 0) <= CFG80211_VERSION_CODE
struct wireless_dev *
woal_cfg80211_add_virtual_intf(struct wiphy *wiphy, const char *name,
@ -421,7 +441,12 @@ int woal_cfg80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,
struct beacon_parameters *params);
#endif
#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13)
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
int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
#if KERNEL_VERSION(3, 19, 0) <= CFG80211_VERSION_CODE
struct station_del_parameters *param);
@ -466,7 +491,6 @@ void woal_channel_switch_event(moal_private *priv, chan_band_info *pchan_info);
#if KERNEL_VERSION(3, 2, 0) <= CFG80211_VERSION_CODE
void woal_bgscan_stop_event(moal_private *priv);
void woal_cfg80211_notify_sched_scan_stop(moal_private *priv);
void woal_sched_scan_work_queue(struct work_struct *work);
void woal_report_sched_scan_result(moal_private *priv);
#endif
#endif
@ -477,7 +501,9 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy,
mlan_ds_radio_cfg *radio);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
void woal_deauth_event(moal_private *priv, int reason_code);
#endif
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
mlan_status woal_chandef_create(moal_private *priv,

View file

@ -52,6 +52,18 @@ static const struct nl80211_vendor_cmd_info vendor_events[] = {
.vendor_id = MRVL_VENDOR_ID,
.subcmd = event_fw_dump_done,
}, /*event_id 1*/
{
.vendor_id = MRVL_VENDOR_ID,
.subcmd = event_fw_reset_success,
}, /*event_id 2*/
{
.vendor_id = MRVL_VENDOR_ID,
.subcmd = event_fw_reset_failure,
}, /*event_id 3*/
{
.vendor_id = MRVL_VENDOR_ID,
.subcmd = event_fw_reset_start,
}, /*event_id 4*/
{
.vendor_id = MRVL_VENDOR_ID,
.subcmd = event_rssi_monitor,
@ -254,6 +266,7 @@ int woal_cfg80211_vendor_event(moal_private *priv, int event, t_u8 *data,
return ret;
}
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
/**
* @brief send fw dump complete event to vendorhal
*
@ -267,6 +280,7 @@ void woal_cfg80211_vendor_event_fw_dump(moal_private *priv)
woal_cfg80211_vendor_event(priv, event_fw_dump_done, CUS_EVT_FW_DUMP,
strlen(CUS_EVT_FW_DUMP));
}
#endif
/**
* @brief send dfs vendor event to kernel
@ -772,14 +786,23 @@ static int woal_cfg80211_subcmd_get_supp_feature_set(struct wiphy *wiphy,
#endif
| WLAN_FEATURE_LINK_LAYER_STATS |
WLAN_FEATURE_LOGGER | WLAN_FEATURE_RSSI_MONITOR |
WLAN_FEATURE_CONFIG_NDO |
WLAN_FEATURE_CONTROL_ROAMING |
WLAN_FEATURE_SCAN_RAND | WLAN_FEATURE_MKEEP_ALIVE;
WLAN_FEATURE_CONFIG_NDO | WLAN_FEATURE_SCAN_RAND |
WLAN_FEATURE_MKEEP_ALIVE | WLAN_FEATURE_PNO |
WLAN_FEATURE_TDLS;
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*/
@ -922,8 +945,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;
@ -1751,14 +1774,16 @@ static int woal_deinit_ring_buffer(moal_private *priv)
ENTER();
for (i = 0; i < RING_ID_MAX - 1; i++) {
for (i = 0; i < RING_ID_MAX; i++) {
ring_buff = (wifi_ring_buffer *)priv->rings[i];
if (!ring_buff)
continue;
spin_lock_irqsave(&ring_buff->lock, lock_flags);
ring_state = ring_buff->state;
if (ring_state == RING_ACTIVE)
if (ring_state == RING_ACTIVE) {
ring_buff->state = RING_STOP;
ring_buff->interval = 0;
}
spin_unlock_irqrestore(&ring_buff->lock, lock_flags);
if (ring_state == RING_ACTIVE)
cancel_delayed_work_sync(&ring_buff->work);
@ -3172,7 +3197,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");
@ -3182,7 +3212,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;
@ -3647,8 +3682,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:
@ -3824,6 +3863,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,9 @@ 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_fw_reset_start = 4,
event_rssi_monitor = 0x1501,
event_set_key_mgmt_offload = 0x10001,
event_fw_roam_success = 0x10002,

View file

@ -117,6 +117,7 @@ static struct debug_data items[] = {
item_addr(bypass_pkt_count), INFO_ADDR},
{"scan_processing", item_size(scan_processing),
item_addr(scan_processing), INFO_ADDR},
{"scan_state", item_size(scan_state), item_addr(scan_state), INFO_ADDR},
{"num_cmd_timeout", item_size(num_cmd_timeout),
item_addr(num_cmd_timeout), INFO_ADDR},
{"timeout_cmd_id", item_size(timeout_cmd_id), item_addr(timeout_cmd_id),
@ -259,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"
@ -294,7 +297,9 @@ typedef struct _chan_stats {
#define PRIV_CMD_MCAST_AGGR_GROUP "mcast_aggr_group"
#define PRIV_CMD_MC_AGGR_CFG "mc_aggr_cfg"
#define PRIV_CMD_STATS "stats"
#define PRIV_CMD_CH_LOAD "getchload"
#define PRIV_CMD_CH_LOAD_RESULTS "getloadresults"
#define PRIV_CMD_ARB_CFG "arb"
@ -372,6 +377,12 @@ typedef struct _ssu_params_cfg {
#define PRIV_CMD_BOOTSLEEP "bootsleep"
/** Private command ID to config txwatchdog enable/disable */
#define PRIV_CMD_TXWATCHDOG "txwatchdog"
/** Private command to get secure boot uuid */
#define PRIV_CMD_GET_SB_UUID "getuuid"
/** Private command: 11AX Cfg */
#define PRIV_CMD_11AXCFG "11axcfg"
/** Private command: 11AX Cmd */
@ -532,6 +543,7 @@ typedef struct woal_priv_addba {
#define ACTION_ADD 2
/** Action field value: remove */
#define ACTION_REMOVE 3
#define MC_AGGR_CTRL MBIT(0)
/* mcast_aggr_group */
typedef struct _mcast_aggr_group {

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,7 +62,7 @@ static int beacon_hints;
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static int host_mlme;
static int host_mlme = 1;
#endif
#endif
@ -129,7 +130,7 @@ static int shutdown_hs;
static int slew_rate = 3;
#endif
int tx_work = 0;
static int rps = 0;
static int tx_skb_clone = 0;
#ifdef IMX_SUPPORT
static int pmqos = 1;
@ -138,6 +139,7 @@ static int pmqos = 0;
#endif
static int chan_track = 0;
static int mcs32 = 1;
#if defined(STA_SUPPORT)
/** 802.11d configuration */
@ -350,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
*
@ -600,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) !=
@ -1167,17 +1179,6 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
PRINTM(MMSG, "tx_work %s\n",
moal_extflg_isset(handle, EXT_TX_WORK) ? "on" :
"off");
} else if (strncmp(line, "rps", strlen("rps")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
if (out_data)
moal_extflg_set(handle, EXT_RPS);
else
moal_extflg_clear(handle, EXT_RPS);
PRINTM(MMSG, "rps %s\n",
moal_extflg_isset(handle, EXT_RPS) ? "on" :
"off");
} else if (strncmp(line, "tx_skb_clone",
strlen("tx_skb_clone")) == 0) {
if (parse_line_read_int(line, &out_data) !=
@ -1309,6 +1310,13 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
PRINTM(MMSG, "wacp_moe=%d\n", params->wacp_mode);
}
#endif
else if (strncmp(line, "mcs32", strlen("mcs32")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->mcs32 = out_data;
PRINTM(MMSG, "mcs32=%d\n", params->mcs32);
}
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
else if (strncmp(line, "host_mlme", strlen("host_mlme")) == 0) {
@ -1343,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)
@ -1383,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);
@ -1419,11 +1439,13 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
woal_dup_string(&handle->params.uap_name, uap_name);
handle->params.uap_max_sta = uap_max_sta;
handle->params.wacp_mode = wacp_mode;
handle->params.mcs32 = mcs32;
if (params) {
handle->params.max_uap_bss = params->max_uap_bss;
woal_dup_string(&handle->params.uap_name, params->uap_name);
handle->params.uap_max_sta = params->uap_max_sta;
handle->params.wacp_mode = params->wacp_mode;
handle->params.mcs32 = params->mcs32;
}
#endif /* UAP_SUPPORT */
#ifdef WIFI_DIRECT_SUPPORT
@ -1602,8 +1624,7 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
moal_extflg_set(handle, EXT_NAPI);
if (tx_work)
moal_extflg_set(handle, EXT_TX_WORK);
if (rps)
moal_extflg_set(handle, EXT_RPS);
if (tx_skb_clone)
moal_extflg_set(handle, EXT_TX_SKB_CLONE);
if (pmqos)
@ -1662,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;
}
/**
@ -1831,11 +1853,6 @@ void woal_init_from_dev_tree(void)
PRINTM(MIOCTL, "tx_work=0x%x\n", data);
tx_work = data;
}
} else if (!strncmp(prop->name, "rps", strlen("rps"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MIOCTL, "rps=0x%x\n", data);
rps = data;
}
} else if (!strncmp(prop->name, "tx_skb_clone",
strlen("tx_skb_clone"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
@ -1847,6 +1864,11 @@ void woal_init_from_dev_tree(void)
PRINTM(MIOCTL, "pmqos=0x%x\n", data);
pmqos = data;
}
} else if (!strncmp(prop->name, "mcs32", strlen("mcs32"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MIOCTL, "mcs32=0x%x\n", data);
mcs32 = data;
}
}
#ifdef MFG_CMD_SUPPORT
else if (!strncmp(prop->name, "mfg_mode", strlen("mfg_mode"))) {
@ -2117,8 +2139,13 @@ void woal_init_from_dev_tree(void)
}
}
#endif
else if (!strncmp(prop->name, "sched_scan",
strlen("sched_scan"))) {
else if (!strncmp(prop->name, "mcs32", strlen("mcs32"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MERROR, "mcs32=0x%x\n", data);
mcs32 = data;
}
} else if (!strncmp(prop->name, "sched_scan",
strlen("sched_scan"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MIOCTL, "sched_scan=%d\n", data);
sched_scan = data;
@ -2129,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();
@ -2335,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,
@ -2429,13 +2466,13 @@ MODULE_PARM_DESC(
#endif
module_param(tx_work, uint, 0660);
MODULE_PARM_DESC(tx_work, "1: Enable tx_work; 0: Disable tx_work");
module_param(rps, uint, 0660);
MODULE_PARM_DESC(rps, "1: Enable rps; 0: Disable rps");
module_param(tx_skb_clone, uint, 0660);
MODULE_PARM_DESC(tx_skb_clone,
"1: Enable tx_skb_clone; 0: Disable tx_skb_clone");
module_param(pmqos, uint, 0660);
MODULE_PARM_DESC(pmqos, "1: Enable pmqos; 0: Disable pmqos");
module_param(mcs32, uint, 0660);
MODULE_PARM_DESC(mcs32, "1: Enable mcs32; 0: Disable mcs32");
module_param(dpd_data_cfg, charp, 0);
MODULE_PARM_DESC(dpd_data_cfg, "DPD data file name");
@ -2595,8 +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);
MODULE_PARM_DESC(host_mlme,
"1: Enable Host MLME Support; 0: Disable Host MLME support");
MODULE_PARM_DESC(
host_mlme,
"1: Enable Host MLME Support (Default); 0: Disable Host MLME support");
#endif
#endif
@ -2625,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)
{
@ -2900,7 +2909,6 @@ static mlan_status woal_set_wake_on_mdns(moal_handle *handle, t_u8 enable)
sizeof(filter->byte_seq));
entry->rpn[2] = RPN_TYPE_AND;
filter++;
filter->fill_flag = (FILLING_TYPE | FILLING_PATTERN | FILLING_OFFSET |
FILLING_NUM_BYTES);
filter->type = TYPE_BYTE_EQ + 1;
@ -2909,7 +2917,6 @@ static mlan_status woal_set_wake_on_mdns(moal_handle *handle, t_u8 enable)
filter->num_bytes = 1;
entry->rpn[3] = RPN_TYPE_AND;
filter++;
filter->fill_flag = (FILLING_TYPE | FILLING_PATTERN | FILLING_OFFSET |
FILLING_NUM_BYTES);
filter->type = TYPE_BYTE_EQ + 1;
@ -2919,16 +2926,14 @@ static mlan_status woal_set_wake_on_mdns(moal_handle *handle, t_u8 enable)
filter++;
entry->filter_num = 4;
if (enable) {
ret = woal_request_ioctl(woal_get_priv(handle,
MLAN_BSS_ROLE_ANY),
req, MOAL_NO_WAIT);
if (ret != MLAN_STATUS_SUCCESS && ret != MLAN_STATUS_PENDING)
PRINTM(MIOCTL, "Set Mdns wake up failed! ret=%d\n",
ret);
mef_cfg->op_code = MLAN_OP_ADD_MDNS;
} else {
PRINTM(MIOCTL, "Mdns wake up is disable\n");
mef_cfg->op_code = MLAN_IPADDR_OP_IP_REMOVE;
}
ret = woal_request_ioctl(woal_get_priv(handle, MLAN_BSS_ROLE_ANY), req,
MOAL_NO_WAIT);
if (ret != MLAN_STATUS_SUCCESS && ret != MLAN_STATUS_PENDING)
PRINTM(MIOCTL, "Set Mdns wake up failed! ret=%d\n", ret);
done:
if (ret != MLAN_STATUS_PENDING)
kfree(req);
@ -2945,7 +2950,7 @@ done:
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING -- success, otherwise
* fail
*/
static mlan_status woal_set_ipv6_ns_offload(moal_handle *handle)
static mlan_status woal_set_ipv6_ns_offload(moal_handle *handle, t_u8 enable)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_ds_misc_cfg *misc = NULL;
@ -2995,7 +3000,11 @@ static mlan_status woal_set_ipv6_ns_offload(moal_handle *handle)
moal_memcpy_ext(handle, filter->byte_seq, "\x87", 1,
sizeof(filter->byte_seq));
entry->filter_num = 2;
if (enable) {
mef_cfg->op_code = MLAN_OP_ADD_IPV6_NS;
} else {
mef_cfg->op_code = MLAN_IPADDR_OP_IP_REMOVE;
}
ret = woal_request_ioctl(woal_get_priv(handle, MLAN_BSS_ROLE_ANY), req,
MOAL_NO_WAIT);
if (ret != MLAN_STATUS_SUCCESS && ret != MLAN_STATUS_PENDING)
@ -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);
@ -3417,12 +3431,16 @@ mlan_status woal_cancel_hs(moal_private *priv, t_u8 wait_option)
woal_set_clear_pmk(priv, MLAN_ACT_CLEAR);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
#if IS_ENABLED(CONFIG_IPV6)
if (priv->phandle->hs_auto_arp) {
PRINTM(MIOCTL, "Cancel Host Sleep... remove ipv6 offload\n");
/** Set ipv6 router advertisement message offload */
woal_set_ipv6_ra_offload(priv->phandle, MFALSE);
}
/** Set Neighbor Solitation message offload */
woal_set_ipv6_ns_offload(priv->phandle, MFALSE);
#endif
#endif
if (priv->phandle->hs_auto_arp) {
@ -3449,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__);
}
}
}
@ -3712,14 +3734,16 @@ int woal_enable_hs(moal_private *priv)
#endif
}
media_connected = woal_check_media_connected(handle);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
#if IS_ENABLED(CONFIG_IPV6)
if (handle->hs_auto_arp && media_connected) {
PRINTM(MIOCTL, "Host Sleep enabled... set ipv6 offload\n");
/** Set ipv6 router advertisement message offload */
woal_set_ipv6_ra_offload(handle, MTRUE);
/** Set Neighbor Solitation message offload */
woal_set_ipv6_ns_offload(handle);
woal_set_ipv6_ns_offload(handle, MTRUE);
}
#endif
#endif
if (handle->hs_auto_arp) {
@ -3745,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__);
}
}
}
@ -4477,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;
@ -5763,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);
@ -5831,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;
@ -6153,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;
@ -6170,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();
}
@ -7490,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);
@ -7498,15 +7541,41 @@ static int parse_radio_mode_string(const char *s, size_t len,
return ret;
}
/*
* @brief PoweLevelToDUT11Bits
*
* @param Pwr A user txpwr values of type int
* @param PowerLevel A Pointer of uint32 type for converted txpwr vals
* @return nothing just exit
*/
static void PoweLevelToDUT11Bits(int Pwr, t_u32 *PowerLevel)
{
int Z = 0;
if ((Pwr > 64) || (Pwr < -64))
return;
Z = (int)(Pwr * 16);
if (Z < 0) {
Z = Z + (1 << 11);
}
(*PowerLevel) = (t_u32)Z;
return;
}
/*
* @brief Parse mfg cmd tx pwr string
*
* @param handle A pointer to moal_handle structure
* @param s A pointer to user buffer
* @param len Length of user buffer
* @param d A pointer to mfg_cmd_generic_cfg struct
* @return 0 on success, -EINVAL otherwise
*/
static int parse_tx_pwr_string(const char *s, size_t len,
static int parse_tx_pwr_string(moal_handle *handle, const char *s, size_t len,
struct mfg_cmd_generic_cfg *d)
{
int ret = MLAN_STATUS_SUCCESS;
@ -7514,12 +7583,19 @@ static int parse_tx_pwr_string(const char *s, size_t len,
char *tmp = NULL;
char *pos = NULL;
gfp_t flag;
t_u32 tx_pwr_converted = 0xffffffff;
int tx_pwr_local = 0;
t_u8 fc_card = MFALSE;
ENTER();
if (!s || !d) {
LEAVE();
return -EINVAL;
}
#ifdef SD9177
if (IS_SD9177(handle->card_type))
fc_card = MTRUE;
#endif
flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
string = kzalloc(TX_PWR_STR_LEN, flag);
if (string == NULL) {
@ -7535,9 +7611,15 @@ static int parse_tx_pwr_string(const char *s, size_t len,
/* tx power value */
pos = strsep(&string, " \t");
if (pos)
if (fc_card && pos) {
/* for sd9177 we need to convert user power vals including -ve
* vals as per labtool */
tx_pwr_local = woal_string_to_number(pos);
PoweLevelToDUT11Bits(tx_pwr_local, &tx_pwr_converted);
d->data1 = tx_pwr_converted;
} else if (pos) {
d->data1 = (t_u32)woal_string_to_number(pos);
}
/* modulation */
pos = strsep(&string, " \t");
if (pos)
@ -7548,7 +7630,7 @@ static int parse_tx_pwr_string(const char *s, size_t len,
if (pos)
d->data3 = (t_u32)woal_string_to_number(pos);
if ((d->data1 > 24) || (d->data2 > 2))
if (((!fc_card) && (d->data1 > 24)) || (d->data2 > 2))
ret = -EINVAL;
kfree(tmp);
@ -7594,13 +7676,13 @@ static int parse_tx_cont_string(const char *s, size_t len,
if (pos)
d->enable_tx = (t_u32)woal_string_to_number(pos);
if (d->enable_tx == MFALSE)
goto done;
pos = strsep(&string, " \t");
if (pos)
d->cw_mode = (t_u32)woal_string_to_number(pos);
if (d->enable_tx == MFALSE)
goto done;
pos = strsep(&string, " \t");
if (pos)
d->payload_pattern = (t_u32)woal_string_to_number(pos);
@ -7778,7 +7860,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;
@ -7821,7 +7902,7 @@ static int parse_he_tb_tx_string(const char *s, size_t len,
ret = -EINVAL;
done:
kfree(tmp);
kfree(string);
LEAVE();
return ret;
}
@ -7955,7 +8036,7 @@ mlan_status woal_process_rf_test_mode_cmd(moal_handle *handle, t_u32 cmd,
err = MTRUE;
break;
case MFG_CMD_RFPWR:
if (parse_tx_pwr_string(buffer, len,
if (parse_tx_pwr_string(handle, buffer, len,
&misc->param.mfg_generic_cfg))
err = MTRUE;
break;

File diff suppressed because it is too large Load diff

View file

@ -137,8 +137,10 @@ Change log:
#include <linux/suspend.h>
#endif /* IMX_SUPPORT */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
#include <linux/pm_qos.h>
#else
#include <linux/pm_qos_params.h>
#endif
#ifndef MIN
@ -154,6 +156,17 @@ Change log:
#define COMPAT_VERSION_CODE KERNEL_VERSION(0, 0, 0)
#define CFG80211_VERSION_CODE MAX(LINUX_VERSION_CODE, COMPAT_VERSION_CODE)
#define IMX_ANDROID_13 0
#if defined(IMX_SUPPORT)
#if defined(IMX_ANDROID)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 15, 41)
#undef IMX_ANDROID_13
#define IMX_ANDROID_13 1
#endif
#endif
#endif
/**
* Reason Code 3: STA is leaving (or has left) IBSS or ESS
*/
@ -212,6 +225,10 @@ Change log:
#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
#define IEEE80211_BAND_6GHZ NL80211_BAND_6GHZ
#endif
/**
* interface name
*/
@ -258,6 +275,8 @@ typedef t_u8 BOOLEAN;
#define CARD_TYPE_USB_USB 6
/** card type PCIE_USB */
#define CARD_TYPE_PCIE_USB 7
/** card type SD9177_UART */
#define CARD_TYPE_SD9177_UART 1 // As per datasheet/SoC design
/** Driver version */
extern char driver_version[];
@ -318,6 +337,18 @@ typedef enum _MOAL_HARDWARE_STATUS {
HardwareStatusNotReady
} MOAL_HARDWARE_STATUS;
#define WIFI_STATUS_OK 0
#define WIFI_STATUS_FW_DNLD 1
#define WIFI_STATUS_FW_DNLD_COMPLETE 2
#define WIFI_STATUS_INIT_FW 3
#define WIFI_STATUS_DNLD_FW_FAIL 4
#define WIFI_STATUS_INIT_FW_FAIL 5
#define WIFI_STATUS_TX_TIMEOUT 6
#define WIFI_STATUS_WIFI_HANG 7
#define WIFI_STATUS_SCAN_TIMEOUT 8
#define WIFI_STATUS_FW_DUMP 9
#define WIFI_STATUS_FW_RELOAD 10
/** fw cap info 11p */
#define FW_CAPINFO_80211P MBIT(24)
/** fw cap info bit26 for 0-DFS support */
@ -382,9 +413,10 @@ static inline void woal_timer_handler(unsigned long fcontext)
pmoal_drv_timer timer = (pmoal_drv_timer)fcontext;
#endif
timer->timer_function(timer->function_context);
if (!timer->timer_is_canceled)
timer->timer_function(timer->function_context);
if (timer->timer_is_periodic == MTRUE) {
if (timer->timer_is_periodic == MTRUE && !timer->timer_is_canceled) {
mod_timer(&timer->tl,
jiffies + ((timer->time_period * HZ) / 1000));
} else {
@ -725,6 +757,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"
@ -809,10 +845,14 @@ typedef enum {
#define CUS_EVT_RADAR_DETECTED "EVENT=RADAR_DETECTED"
/** Custom event : CAC finished */
#define CUS_EVT_CAC_FINISHED "EVENT=CAC_FINISHED"
#ifdef UAP_SUPPORT
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 */
#define CUS_EVT_WEP_ICV_ERR "EVENT=WEP_ICV_ERR"
@ -843,6 +883,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
@ -865,7 +907,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
@ -959,7 +1001,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
@ -1072,7 +1114,7 @@ struct tcp_sess {
/** timer for ack */
moal_drv_timer ack_timer __ATTRIB_ALIGN__;
/** timer is set */
BOOLEAN is_timer_set;
atomic_t is_timer_set;
/** last update time*/
wifi_timeval update_time;
};
@ -1231,6 +1273,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;
@ -1349,8 +1421,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 */
@ -1374,6 +1444,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 */
@ -1418,10 +1496,6 @@ struct _moal_private {
wlan_bgscan_cfg scan_cfg;
/** sched scaning flag */
t_u8 sched_scanning;
/** sched_scan work queue */
struct workqueue_struct *sched_scan_workqueue;
/** sched_scan work */
struct delayed_work sched_scan_work;
/** bgscan request id */
t_u64 bg_scan_reqid;
#ifdef STA_CFG80211
@ -1645,6 +1719,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
@ -1685,6 +1760,12 @@ struct _moal_private {
void *rings[RING_ID_MAX];
t_u8 pkt_fate_monitor_enable;
void *packet_filter;
/** txwatchdog disable */
t_u8 txwatchdog_disable;
/** secure boot uuid lower and higher 8 bytes */
t_u64 uuid_lo;
t_u64 uuid_hi;
};
#ifdef SDIO
@ -1945,8 +2026,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
@ -2050,7 +2131,6 @@ enum ext_mod_params {
#endif
#endif
EXT_TX_WORK,
EXT_RPS,
EXT_TX_SKB_CLONE,
EXT_PMQOS,
EXT_CHAN_TRACK,
@ -2064,6 +2144,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;
@ -2145,6 +2226,9 @@ typedef struct _moal_mod_para {
t_u16 inact_tmo;
char *reg_alpha2;
int dfs53cfg;
t_u8 mcs32;
int keep_previous_scan;
} moal_mod_para;
void woal_tp_acnt_timer_func(void *context);
@ -2392,6 +2476,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 */
@ -2512,6 +2598,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 */
@ -2536,6 +2628,8 @@ struct _moal_handle {
moal_drv_timer fw_dump_timer __ATTRIB_ALIGN__;
/** fw dump buffer total len */
t_u64 fw_dump_len;
/** fw dump status for each chip, useful in multichip drive */
BOOLEAN fw_dump_status;
/** Pointer of fw dump buffer */
t_u8 *fw_dump_buf;
/** FW dump full name */
@ -2579,8 +2673,10 @@ struct _moal_handle {
/* feature_control */
t_u32 feature_control;
struct notifier_block woal_notifier;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
#if IS_ENABLED(CONFIG_IPV6)
struct notifier_block woal_inet6_notifier;
#endif
#endif
mlan_ds_misc_keep_alive keep_alive[MAX_KEEP_ALIVE_ID];
struct net_device napi_dev;
@ -2983,6 +3079,20 @@ static inline void hexdump(t_u32 level, char *prompt, t_u8 *buf, int len)
} while (0)
#endif
#ifdef BIG_ENDIAN_SUPPORT
/** Convert from 16 bit little endian format to CPU format */
#define woal_le16_to_cpu(x) le16_to_cpu(x)
/** Convert from 32 bit little endian format to CPU format */
#define woal_le32_to_cpu(x) le32_to_cpu(x)
/** Convert from 64 bit little endian format to CPU format */
#define woal_le64_to_cpu(x) le64_to_cpu(x)
/** Convert to 16 bit little endian format from CPU format */
#define woal_cpu_to_le16(x) cpu_to_le16(x)
/** Convert to 32 bit little endian format from CPU format */
#define woal_cpu_to_le32(x) cpu_to_le32(x)
/** Convert to 64 bit little endian format from CPU format */
#define woal_cpu_to_le64(x) cpu_to_le64(x)
#else
/** Do nothing */
#define woal_le16_to_cpu(x) x
/** Do nothing */
@ -2995,6 +3105,7 @@ static inline void hexdump(t_u32 level, char *prompt, t_u8 *buf, int len)
#define woal_cpu_to_le32(x) x
/** Do nothing */
#define woal_cpu_to_le64(x) x
#endif
/**
* @brief This function returns first available priv
@ -3313,7 +3424,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,
@ -3351,6 +3462,7 @@ int woal_enable_hs(moal_private *priv);
/** Get wakeup reason */
mlan_status woal_get_wakeup_reason(moal_private *priv,
mlan_ds_hs_wakeup_reason *wakeup_reason);
int woal_process_proc_hssetpara(moal_handle *handle, t_u8 *buf);
#define FW_DUMP_INFO_LEN 0x280000
/** mem dump header */
typedef struct {
@ -3512,7 +3624,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
@ -3616,7 +3728,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
@ -3768,8 +3882,10 @@ monitor_iface *woal_prepare_mon_if(moal_private *priv, const char *name,
#endif
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
void woal_cfg80211_vendor_event_fw_dump(moal_private *priv);
#endif
#endif
#ifdef STA_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)

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)
@ -36,9 +40,11 @@ Change log:
#endif
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
#if IS_ENABLED(CONFIG_IPV6)
#include <net/addrconf.h>
#endif
#endif
/********************************************************
Local Variables
@ -135,6 +141,11 @@ static moal_if_ops pcie_ops;
********************************************************/
static mlan_status woal_pcie_preinit(struct pci_dev *pdev);
#if defined(PCIE8897) || defined(PCIE8997) || defined(PCIE9098) || \
defined(PCIE9097) || defined(PCIENW62X)
static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag,
t_u8 resetflag);
#endif
/** @brief This function updates the card types
*
@ -297,8 +308,19 @@ static mlan_status woal_do_flr(moal_handle *handle, bool prepare, bool flr_flag)
}
unregister_inetaddr_notifier(&handle->woal_notifier);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
#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 */
@ -459,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) {
@ -523,6 +549,46 @@ static void woal_pcie_remove(struct pci_dev *dev)
return;
}
/**
* @brief This function handles PCIE driver remove
*
* @param pdev A pointer to pci_dev structure
*
* @return error code
*/
static void woal_pcie_shutdown(struct pci_dev *dev)
{
pcie_service_card *card;
moal_handle *handle;
ENTER();
PRINTM(MCMND, "<--- Enter woal_pcie_shutdown --->\n");
card = pci_get_drvdata(dev);
if (!card) {
PRINTM(MINFO, "PCIE card removed from slot\n");
LEAVE();
return;
}
handle = card->handle;
if (handle->second_mac)
goto done;
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (IS_PCIE9098(handle->card_type) || IS_PCIENW62X(handle->card_type) ||
IS_PCIE9097(handle->card_type)) {
if (RDWR_STATUS_FAILURE !=
woal_pcie_rdwr_firmware(handle, 0, 1))
PRINTM(MMSG, "wlan: start in-bound IR...\n");
}
#endif
done:
handle->surprise_removed = MTRUE;
pci_disable_device(dev);
PRINTM(MCMND, "<--- Leave woal_pcie_shutdown --->\n");
LEAVE();
return;
}
/**
* @brief Handle suspend
*
@ -908,6 +974,7 @@ static struct pci_driver REFDATA wlan_pcie = {
.id_table = wlan_ids,
.probe = woal_pcie_probe,
.remove = woal_pcie_remove,
.shutdown = woal_pcie_shutdown,
#ifdef CONFIG_PM
/* Power Management Hooks */
.suspend = woal_pcie_suspend,
@ -1126,13 +1193,21 @@ static mlan_status woal_pcie_preinit(struct pci_dev *pdev)
pci_set_master(pdev);
PRINTM(MINFO, "Try set_consistent_dma_mask(32)\n");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
#else
ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
#endif
if (ret) {
PRINTM(MERROR, "set_dma_mask(32) failed\n");
goto err_set_dma_mask;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
#else
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
#endif
if (ret) {
PRINTM(MERROR, "set_consistent_dma_mask(64) failed\n");
goto err_set_dma_mask;
@ -1168,13 +1243,21 @@ static mlan_status woal_pcie_init(pcie_service_card *card)
pci_set_master(pdev);
PRINTM(MINFO, "Try set_consistent_dma_mask(32)\n");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
#else
ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
#endif
if (ret) {
PRINTM(MERROR, "set_dma_mask(32) failed\n");
goto err_set_dma_mask;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
#else
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
#endif
if (ret) {
PRINTM(MERROR, "set_consistent_dma_mask(64) failed\n");
goto err_set_dma_mask;
@ -1813,6 +1896,7 @@ static memory_type_mapping mem_type_mapping_tbl_8897[] = {
defined(PCIENW62X)
#define DEBUG_HOST_READY_8997 0xCC
#define DEBUG_HOST_EVENT_READY 0xAA
#define DEBUG_HOST_RESET_READY 0x99
static memory_type_mapping mem_type_mapping_tbl_8997 = {"DUMP", NULL, NULL,
0xDD, 0x00};
@ -1842,10 +1926,12 @@ static mlan_status woal_read_reg_eight_bit(moal_handle *handle, t_u32 reg,
*
* @param phandle A pointer to moal_handle
* @param doneflag done flag
* @param resetflag reset flag;
*
* @return MLAN_STATUS_SUCCESS
*/
static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag,
t_u8 resetflag)
{
int ret = 0;
int tries = 0;
@ -1875,33 +1961,38 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
debug_host_ready = DEBUG_HOST_EVENT_READY;
else
debug_host_ready = DEBUG_HOST_READY_8997;
if (resetflag)
debug_host_ready = DEBUG_HOST_RESET_READY;
dump_ctrl_reg = PCIE9098_DUMP_CTRL_REG;
}
#endif
ret = woal_pcie_write_reg(phandle, dump_ctrl_reg, debug_host_ready);
if (ret) {
PRINTM(MERROR, "PCIE Write ERR\n");
PRINTM(MERROR, "PCIE Write ERR, reg=0x%x debug_reay=0x%x\n",
dump_ctrl_reg, debug_host_ready);
return RDWR_STATUS_FAILURE;
}
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (IS_PCIE9098(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
if (phandle->event_fw_dump)
if (phandle->event_fw_dump || resetflag)
return RDWR_STATUS_SUCCESS;
}
#endif
ret = woal_pcie_read_reg(phandle, dump_ctrl_reg, &reg_data);
if (ret) {
PRINTM(MERROR, "PCIE Read DEBUG_DUMP_CTRL_REG fail\n");
PRINTM(MERROR, "PCIE Read DEBUG_DUMP_CTRL_REG 0x%x fail\n",
dump_ctrl_reg);
return RDWR_STATUS_FAILURE;
}
for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
ret = woal_read_reg_eight_bit(phandle, dump_ctrl_reg,
&ctrl_data);
if (ret) {
PRINTM(MERROR, "PCIE READ ERR\n");
PRINTM(MERROR, "PCIE READ reg 0x%x 8bit ERR\n",
dump_ctrl_reg);
return RDWR_STATUS_FAILURE;
}
if (ctrl_data == DEBUG_FW_DONE)
@ -1909,7 +2000,9 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
if (doneflag && ctrl_data == doneflag)
return RDWR_STATUS_DONE;
if (ctrl_data != debug_host_ready) {
PRINTM(MMSG, "The ctrl reg was changed, try again!\n");
PRINTM(MMSG,
"The ctrl reg was changed, ctrl_data=0x%x, host_ready:0x%x try again!\n",
ctrl_data, debug_host_ready);
ret = woal_pcie_write_reg(phandle, dump_ctrl_reg,
debug_host_ready);
if (ret) {
@ -1924,7 +2017,8 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
#endif
}
if (ctrl_data == debug_host_ready) {
PRINTM(MERROR, "Fail to pull ctrl_data\n");
PRINTM(MERROR, "Fail to pull ctrl_data=0x%x host_ready=0x%x\n",
ctrl_data, debug_host_ready);
return RDWR_STATUS_FAILURE;
}
return RDWR_STATUS_SUCCESS;
@ -1976,7 +2070,8 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle)
PRINTM(MMSG, "====PCIE DEBUG MODE OUTPUT START: %u.%06u ====\n", sec,
usec);
/* read the number of the memories which will dump */
if (RDWR_STATUS_FAILURE == woal_pcie_rdwr_firmware(phandle, doneflag))
if (RDWR_STATUS_FAILURE ==
woal_pcie_rdwr_firmware(phandle, doneflag, 0))
goto done;
reg = DEBUG_DUMP_START_REG;
ret = woal_read_reg_eight_bit(phandle, reg, &dump_num);
@ -1990,7 +2085,7 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle)
idx < dump_num && idx < ARRAY_SIZE(mem_type_mapping_tbl_8897);
idx++) {
if (RDWR_STATUS_FAILURE ==
woal_pcie_rdwr_firmware(phandle, doneflag))
woal_pcie_rdwr_firmware(phandle, doneflag, 0))
goto done;
memory_size = 0;
reg = DEBUG_DUMP_START_REG;
@ -2034,7 +2129,7 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle)
PRINTM(MMSG, "Start %s output %u.%06u, please wait...\n",
mem_type_mapping_tbl[idx].mem_name, sec, usec);
do {
stat = woal_pcie_rdwr_firmware(phandle, doneflag);
stat = woal_pcie_rdwr_firmware(phandle, doneflag, 0);
if (RDWR_STATUS_FAILURE == stat)
goto done;
@ -2125,7 +2220,7 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
IS_PCIE9097(phandle->card_type)) {
if (phandle->event_fw_dump) {
if (RDWR_STATUS_FAILURE !=
woal_pcie_rdwr_firmware(phandle, doneflag)) {
woal_pcie_rdwr_firmware(phandle, doneflag, 0)) {
PRINTM(MMSG,
"====PCIE FW DUMP EVENT MODE START ====\n");
return;
@ -2139,7 +2234,8 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
PRINTM(MMSG, "====PCIE DEBUG MODE OUTPUT START: %u.%06u ====\n", sec,
usec);
/* read the number of the memories which will dump */
if (RDWR_STATUS_FAILURE == woal_pcie_rdwr_firmware(phandle, doneflag))
if (RDWR_STATUS_FAILURE ==
woal_pcie_rdwr_firmware(phandle, doneflag, 0))
goto done;
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (IS_PCIE9098(phandle->card_type) ||
@ -2178,7 +2274,7 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
PRINTM(MMSG, "Start %s output %u.%06u, please wait...\n",
mem_type_mapping_tbl->mem_name, sec, usec);
do {
stat = woal_pcie_rdwr_firmware(phandle, doneflag);
stat = woal_pcie_rdwr_firmware(phandle, doneflag, 0);
if (RDWR_STATUS_FAILURE == stat)
goto done;
@ -2298,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

@ -118,7 +118,7 @@ Change log:
#define PCIEUARTNW62X_DEFAULT_COMBO_FW_NAME "nxp/pcieuartnw62x_combo.bin"
#define PCIEUSBNW62X_DEFAULT_COMBO_FW_NAME "nxp/pcieusbnw62x_combo.bin"
#define PCIENW62X_DEFAULT_WLAN_FW_NAME "nxp/pcienw62x_wlan.bin"
#endif /* PCIE8997 */
#endif /* PCIENW62X */
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
#define PCIE_NUM_MSIX_VECTORS 32

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

@ -81,6 +81,7 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data)
struct net_device *netdev = (struct net_device *)sfp->private;
char fmt[MLAN_MAX_VER_STR_LEN];
moal_private *priv = (moal_private *)netdev_priv(netdev);
mlan_fw_info fw_info;
#ifdef STA_SUPPORT
int i = 0;
moal_handle *handle = NULL;
@ -105,6 +106,8 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data)
t_u8 c[4];
} ver;
fw_info.uuid_lo = fw_info.uuid_hi = 0x0ULL;
ENTER();
if (priv == NULL)
@ -154,6 +157,11 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data)
ver.l = handle->fw_release_number;
seq_printf(sfp, "firmware_major_version=%u.%u.%u\n", ver.c[2], ver.c[1],
ver.c[0]);
woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info);
if (fw_info.uuid_lo || fw_info.uuid_hi)
seq_printf(sfp, "uuid = %llx%llx\n", fw_info.uuid_lo,
fw_info.uuid_hi);
#ifdef WIFI_DIRECT_SUPPORT
if (priv->bss_type == MLAN_BSS_TYPE_WIFIDIRECT) {
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_STA)
@ -451,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;
@ -523,18 +531,14 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
if (ref_handle) {
priv = woal_get_priv(ref_handle, MLAN_BSS_ROLE_ANY);
if (priv) {
#ifdef DEBUG_LEVEL1
drvdbg &= ~MFW_D;
#endif
handle->fw_dump_status = MTRUE;
woal_mlan_debug_info(priv);
woal_moal_debug_info(priv, NULL, MFALSE);
}
}
priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY);
if (priv) {
#ifdef DEBUG_LEVEL1
drvdbg &= ~MFW_D;
#endif
handle->fw_dump_status = MTRUE;
woal_mlan_debug_info(priv);
woal_moal_debug_info(priv, NULL, MFALSE);
handle->ops.dump_fw_info(handle);
@ -595,6 +599,11 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
PRINTM(MMSG, "on=%d drop_point=%d\n", handle->tp_acnt.on,
handle->tp_acnt.drop_point);
}
if (!strncmp(databuf, "hssetpara=", strlen("hssetpara="))) {
line += strlen("hssetpara") + 1;
PRINTM(MCMND, "hssetpara=%s\n", line);
woal_process_proc_hssetpara(handle, line);
}
if (!strncmp(databuf, "rf_test_mode", strlen("rf_test_mode"))) {
line += strlen("rf_test_mode") + 1;
config_data = (t_u32)woal_string_to_number(line);
@ -674,6 +683,8 @@ static int woal_config_read(struct seq_file *sfp, void *data)
{
moal_handle *handle = (moal_handle *)sfp->private;
int i;
moal_private *priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY);
mlan_ds_hs_cfg hscfg;
ENTER();
@ -685,6 +696,13 @@ static int woal_config_read(struct seq_file *sfp, void *data)
seq_printf(sfp, "hardware_status=%d\n", (int)handle->hardware_status);
seq_printf(sfp, "netlink_num=%d\n", (int)handle->netlink_num);
seq_printf(sfp, "drv_mode=%d\n", (int)handle->params.drv_mode);
if (priv) {
memset(&hscfg, 0, sizeof(mlan_ds_hs_cfg));
woal_set_get_hs_params(priv, MLAN_ACT_GET, MOAL_IOCTL_WAIT,
&hscfg);
seq_printf(sfp, "hssetpara=%d,0x%x,%d,%d\n", hscfg.conditions,
hscfg.gpio, hscfg.gap, hscfg.hs_wake_interval);
}
#ifdef SDIO
if (IS_SD(handle->card_type)) {
seq_printf(sfp, "sdcmd52rw=%d 0x%0x 0x%02X\n",
@ -751,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

@ -152,10 +152,10 @@ Change log:
#define SD9177_DEFAULT_COMBO_FW_NAME "nxp/sdsd_nw61x.bin"
#define SD9177_DEFAULT_COMBO_V1_FW_NAME "nxp/sduart_nw61x_v1.bin"
#define SDUART9177_DEFAULT_COMBO_FW_NAME "nxp/sduart_nw61x.bin"
#define SDSD9177_DEFAULT_COMBO_FW_NAME "sdsd_nw61x.bin"
#define SDSD9177_DEFAULT_COMBO_FW_NAME "nxp/sdsd_nw61x.bin"
#define SD9177_DEFAULT_WLAN_FW_NAME "nxp/sd_w61x.bin"
#define SDUART9177_DEFAULT_COMBO_V1_FW_NAME "nxp/sduart_nw61x_v1.bin"
#define SDSD9177_DEFAULT_COMBO_V1_FW_NAME "sdsd_nw61x_v1.bin"
#define SDSD9177_DEFAULT_COMBO_V1_FW_NAME "nxp/sdsd_nw61x_v1.bin"
#define SD9177_DEFAULT_WLAN_V1_FW_NAME "nxp/sd_w61x_v1.bin"
#endif /* SD9177 */

View file

@ -87,7 +87,7 @@ static moal_if_ops sdiommc_ops;
#endif
#ifdef SDNW62X
/** Device ID for SDNW62X */
#define SD_DEVICE_ID_NW62X (0x020C)
#define SD_DEVICE_ID_NW62X (0x020D)
#endif
/** WLAN IDs */
@ -512,7 +512,7 @@ int woal_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
if (NULL ==
woal_add_card(card, &card->func->dev, &sdiommc_ops, card_type)) {
PRINTM(MERROR, "woal_add_card failed\n");
PRINTM(MMSG, "woal_add_card failed\n");
ret = MLAN_STATUS_FAILURE;
goto err;
}
@ -1176,14 +1176,21 @@ static void woal_sdiommc_unregister_dev(moal_handle *handle)
ENTER();
if (handle->card) {
struct sdio_mmc_card *card = handle->card;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
struct sdio_func *func = card->func;
#endif
/* Release the SDIO IRQ */
sdio_claim_host(card->func);
sdio_release_irq(card->func);
sdio_disable_func(card->func);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
if (handle->driver_status)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
mmc_hw_reset(func->card);
#else
mmc_hw_reset(func->card->host);
#endif
#endif
sdio_release_host(card->func);
sdio_set_drvdata(card->func, NULL);
@ -1545,7 +1552,7 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle)
switch (revision_id) {
case SD9177_A0:
if (magic == CHIP_MAGIC_VALUE) {
if (strap == CARD_TYPE_SD_UART)
if (strap == CARD_TYPE_SD9177_UART)
strcpy(handle->card_info->fw_name,
SDUART9177_DEFAULT_COMBO_FW_NAME);
else
@ -1557,7 +1564,7 @@ static mlan_status woal_sdiommc_get_fw_name(moal_handle *handle)
break;
case SD9177_A1:
if (magic == CHIP_MAGIC_VALUE) {
if (strap == CARD_TYPE_SD_UART)
if (strap == CARD_TYPE_SD9177_UART)
strcpy(handle->card_info->fw_name,
SDUART9177_DEFAULT_COMBO_V1_FW_NAME);
else
@ -1819,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++) {
@ -1831,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) {
@ -2028,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) {
@ -2174,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;
}
@ -2324,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) {
@ -2343,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);
@ -2464,7 +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

@ -93,8 +93,12 @@ extern int wifi_status;
mlan_status moal_malloc(t_void *pmoal, t_u32 size, t_u32 flag, t_u8 **ppbuf)
{
moal_handle *handle = (moal_handle *)pmoal;
gfp_t mem_flag =
(in_interrupt() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
gfp_t mem_flag = (in_interrupt() || in_atomic() || irqs_disabled()) ?
GFP_ATOMIC :
GFP_KERNEL;
if (flag & MLAN_MEM_FLAG_ATOMIC)
mem_flag = GFP_ATOMIC;
#ifdef USB
if (!IS_USB(handle->card_type))
@ -200,8 +204,13 @@ mlan_status moal_malloc_consistent(t_void *pmoal, t_u32 size, t_u8 **ppbuf,
if (!card)
return MLAN_STATUS_FAILURE;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
*ppbuf = (t_u8 *)dma_alloc_coherent(&card->dev->dev, size,
(dma_addr_t *)&dma, GFP_KERNEL);
#else
*ppbuf = (t_u8 *)pci_alloc_consistent(card->dev, size,
(dma_addr_t *)&dma);
#endif
if (*ppbuf == NULL) {
PRINTM(MERROR,
"%s: allocate consistent memory (%d bytes) failed!\n",
@ -233,7 +242,11 @@ mlan_status moal_mfree_consistent(t_void *pmoal, t_u32 size, t_u8 *pbuf,
if (!pbuf || !card)
return MLAN_STATUS_FAILURE;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
dma_free_coherent(&card->dev->dev, size, pbuf, buf_pa);
#else
pci_free_consistent(card->dev, size, pbuf, buf_pa);
#endif
atomic_dec(&handle->malloc_cons_count);
return MLAN_STATUS_SUCCESS;
}
@ -260,14 +273,18 @@ mlan_status moal_map_memory(t_void *pmoal, t_u8 *pbuf, t_u64 *pbuf_pa,
if (!card)
return MLAN_STATUS_FAILURE;
/* Init memory to device */
/* Init memory to device */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
dma = dma_map_single(&card->dev->dev, pbuf, size, flag);
if (dma_mapping_error(&card->dev->dev, dma)) {
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
dma = pci_map_single(card->dev, pbuf, size, flag);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
if (pci_dma_mapping_error(card->dev, dma)) {
#else
dma = pci_map_single(card->dev, pbuf, size, flag);
if (pci_dma_mapping_error(dma)) {
#endif
PRINTM(MERROR, "Tx ring: failed to pci_map_single\n");
PRINTM(MERROR, "Tx ring: failed to dma_map_single\n");
return MLAN_STATUS_FAILURE;
}
@ -295,7 +312,11 @@ mlan_status moal_unmap_memory(t_void *pmoal, t_u8 *pbuf, t_u64 buf_pa,
if (!card)
return MLAN_STATUS_FAILURE;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
dma_unmap_single(&card->dev->dev, buf_pa, size, flag);
#else
pci_unmap_single(card->dev, buf_pa, size, flag);
#endif
return MLAN_STATUS_SUCCESS;
}
@ -492,8 +513,9 @@ mlan_status moal_init_timer(t_void *pmoal, t_void **pptimer,
t_void *pcontext)
{
moal_drv_timer *timer = NULL;
gfp_t mem_flag =
(in_interrupt() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
gfp_t mem_flag = (in_interrupt() || in_atomic() || irqs_disabled()) ?
GFP_ATOMIC :
GFP_KERNEL;
timer = kmalloc(sizeof(moal_drv_timer), mem_flag);
if (timer == NULL)
@ -1131,19 +1153,27 @@ mlan_status moal_send_packet_complete(t_void *pmoal, pmlan_buffer pmbuf,
}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 29)
index = skb_get_queue_mapping(skb);
atomic_dec(&handle->tx_pending);
if (atomic_dec_return(
&priv->wmm_tx_pending[index]) ==
LOW_TX_PENDING) {
struct netdev_queue *txq =
netdev_get_tx_queue(
priv->netdev, index);
if (netif_tx_queue_stopped(txq)) {
netif_tx_wake_queue(txq);
PRINTM(MINFO,
"Wakeup Kernel Queue:%d\n",
index);
if (index < 4) {
atomic_dec(&handle->tx_pending);
if (atomic_dec_return(
&priv->wmm_tx_pending[index]) ==
LOW_TX_PENDING) {
struct netdev_queue *txq =
netdev_get_tx_queue(
priv->netdev,
index);
if (netif_tx_queue_stopped(
txq)) {
netif_tx_wake_queue(
txq);
PRINTM(MINFO,
"Wakeup Kernel Queue:%d\n",
index);
}
}
} else {
PRINTM(MERROR,
"Invalid queue index for skb\n");
}
#else /*#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29)*/
if (atomic_dec_return(&handle->tx_pending) <
@ -1499,7 +1529,8 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
/** Antenna */
rth->body.antenna_signal = -(rt_info.nf - rt_info.snr);
rth->body.antenna_noise = -rt_info.nf;
rth->body.antenna = rt_info.antenna;
/* Convert FW antenna value to radiotap spec */
rth->body.antenna = (t_u16)rt_info.antenna >> 1;
/** MCS */
if (format == MLAN_RATE_FORMAT_HT) {
rth->hdr.it_present |= cpu_to_le32(
@ -1580,10 +1611,10 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
/** PARTIAL_AID */
/** TODO: Not support now */
/** mcs_nss */
rth->body.u.vht.mcs_nss[0] =
(vht_sig2 & (0xF0)) >> 4;
rth->body.u.vht.mcs_nss[0] = vht_sig2 & (0xF0);
/* Convert FW NSS value to radiotap spec */
rth->body.u.vht.mcs_nss[0] |=
(vht_sig1 & (0x1C00)) >> (10 - 4);
((vht_sig1 & (0x1C00)) >> 10) + 1;
/** coding */
if (vht_sig2 & MBIT(2))
rth->body.u.vht.coding |=
@ -1600,14 +1631,15 @@ static mlan_status moal_recv_packet_to_mon_if(moal_handle *handle,
handle->mon_if->stats.rx_bytes += skb->len;
handle->mon_if->stats.rx_packets++;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
netif_rx(skb);
#else
if (in_interrupt())
netif_rx(skb);
else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
netif_rx(skb);
#else
netif_rx_ni(skb);
#endif
status = MLAN_STATUS_PENDING;
}
@ -1650,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;
@ -1677,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;
}
@ -1726,7 +1763,12 @@ mlan_status moal_recv_amsdu_packet(t_void *pmoal, pmlan_buffer pmbuf)
frame->dev = netdev;
frame->priority = skb->priority;
payload = frame->data;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
if (ether_addr_equal(payload, rfc1042_eth_hdr)) {
#else
if (!memcmp(payload, rfc1042_eth_hdr,
sizeof(rfc1042_eth_hdr))) {
#endif
/* Remove RFC1042 */
skb_pull(frame, 6);
memcpy(skb_push(frame, ETH_ALEN), src, ETH_ALEN);
@ -1768,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);
@ -2083,15 +2125,22 @@ void woal_request_busfreq_pmqos_add(t_void *handle)
#endif
if (moal_extflg_isset(pmhandle, EXT_PMQOS)) {
#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 6, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
#ifdef IMX_SUPPORT
pm_qos_add_request(&pmhandle->woal_pm_qos_req,
PM_QOS_CPU_DMA_LATENCY, 0);
if (!pm_qos_request_active(&pmhandle->woal_pm_qos_req))
pm_qos_add_request(&pmhandle->woal_pm_qos_req,
PM_QOS_CPU_DMA_LATENCY, 0);
else
PRINTM(MERROR, "PM-QOS request already active\n");
#endif
#endif
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
#ifdef IMX_SUPPORT
cpu_latency_qos_add_request(&pmhandle->woal_pm_qos_req, 0);
if (!cpu_latency_qos_request_active(&pmhandle->woal_pm_qos_req))
cpu_latency_qos_add_request(&pmhandle->woal_pm_qos_req,
0);
else
PRINTM(MERROR, "PM-QOS request already active\n");
#endif
#endif
}
@ -2111,14 +2160,21 @@ void woal_release_busfreq_pmqos_remove(t_void *handle)
if (moal_extflg_isset(pmhandle, EXT_PMQOS)) {
#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 6, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)
#ifdef IMX_SUPPORT
pm_qos_remove_request(&pmhandle->woal_pm_qos_req);
if (pm_qos_request_active(&pmhandle->woal_pm_qos_req))
pm_qos_remove_request(&pmhandle->woal_pm_qos_req);
else
PRINTM(MERROR, "PM-QOS request already removed\n");
#endif
#endif
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
#ifdef IMX_SUPPORT
cpu_latency_qos_remove_request(&pmhandle->woal_pm_qos_req);
if (cpu_latency_qos_request_active(&pmhandle->woal_pm_qos_req))
cpu_latency_qos_remove_request(
&pmhandle->woal_pm_qos_req);
else
PRINTM(MERROR, "PM-QOS request already removed\n");
#endif
#endif
}
@ -2138,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) {
@ -2176,6 +2232,7 @@ void moal_connection_status_check_pmqos(t_void *pmoal)
}
}
#ifdef UAP_SUPPORT
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
/**
@ -2209,6 +2266,7 @@ static void woal_rx_mgmt_pkt_event(moal_private *priv, t_u8 *pkt, t_u16 len)
}
#endif
#endif
#endif
/**
* @brief This function handles event receive
@ -2270,10 +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, 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;
@ -2286,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;
@ -2421,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,
@ -2542,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;
}
@ -2745,13 +2824,25 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
#if CFG80211_VERSION_CODE > KERNEL_VERSION(2, 6, 35)
if (IS_STA_CFG80211(cfg80211_wext)) {
struct cfg80211_bss *bss = NULL;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
bss = cfg80211_get_bss(priv->wdev->wiphy, NULL,
priv->cfg_bssid, NULL, 0,
IEEE80211_BSS_TYPE_ESS,
IEEE80211_PRIVACY_ANY);
#else
bss = cfg80211_get_bss(priv->wdev->wiphy, NULL,
priv->cfg_bssid, NULL, 0,
WLAN_CAPABILITY_ESS,
WLAN_CAPABILITY_ESS);
#endif
if (bss) {
cfg80211_unlink_bss(priv->wdev->wiphy, bss);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
cfg80211_put_bss(priv->wdev->wiphy, bss);
#else
cfg80211_put_bss(bss);
#endif
}
if (!hw_test && priv->roaming_enabled)
woal_config_bgscan_and_rssi(priv, MFALSE);
@ -2842,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));
@ -2948,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];
@ -2977,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;
}
@ -3013,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,
@ -3033,10 +3176,32 @@ 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));
PRINTM(MEVENT, "Radar detected on channel %d\n", radar_chan);
#ifdef UAP_CFG80211
#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_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) {
@ -3046,22 +3211,12 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
priv->target_chan = 0;
break;
}
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
if (!IS_STA_OR_UAP_CFG80211(cfg80211_wext))
if (priv->bss_type == MLAN_BSS_TYPE_DFS) {
woal_chan_event(priv, WOAL_EVENT_RADAR,
priv->chan_rpt_req.chanNum, MTRUE);
break;
cfg_priv = woal_get_priv_with_wdev(priv->phandle);
if (cfg_priv) {
woal_update_channel_dfs_state(radar_chan,
DFS_UNAVAILABLE);
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) {
if (priv->bss_index == priv->phandle->cac_bss_index) {
PRINTM(MEVENT, "radar detected during CAC \n");
@ -3126,11 +3281,23 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
case MLAN_EVENT_ID_FW_CHAN_SWITCH_COMPLETE:
#if defined(UAP_CFG80211) || defined(STA_CFG80211)
pchan_info = (chan_band_info *)pmevent->event_buf;
#ifdef UAP_SUPPORT
if (priv->bss_role == MLAN_BSS_ROLE_UAP) {
if (priv->uap_tx_blocked) {
if (!netif_carrier_ok(priv->netdev))
netif_carrier_on(priv->netdev);
woal_start_queue(priv->netdev);
priv->uap_tx_blocked = MFALSE;
}
priv->phandle->chsw_wait_q_woken = MTRUE;
wake_up_interruptible(&priv->phandle->chsw_wait_q);
}
#endif
if (IS_STA_OR_UAP_CFG80211(cfg80211_wext)) {
PRINTM(MMSG,
"CSA/ECSA: Switch to new channel %d complete!\n",
pchan_info->channel);
priv->channel = pchan_info->channel;
#ifdef UAP_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
if (priv->csa_chan.chan &&
@ -3144,6 +3311,10 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
}
#endif
#endif
if (priv->channel == pchan_info->channel)
break;
priv->channel = pchan_info->channel;
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
if (MFALSE
#ifdef UAP_CFG80211
@ -3161,22 +3332,10 @@ 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
}
#endif
#ifdef UAP_SUPPORT
if (priv->bss_role == MLAN_BSS_ROLE_UAP) {
if (priv->uap_tx_blocked) {
if (!netif_carrier_ok(priv->netdev))
netif_carrier_on(priv->netdev);
woal_start_queue(priv->netdev);
priv->uap_tx_blocked = MFALSE;
}
priv->phandle->chsw_wait_q_woken = MTRUE;
wake_up_interruptible(&priv->phandle->chsw_wait_q);
}
#endif
break;
case MLAN_EVENT_ID_FW_STOP_TX:
@ -3299,7 +3458,11 @@ 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, 2)) || IMX_ANDROID_13)
cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0);
#else
cfg80211_ch_switch_notify(priv->netdev, &priv->chan);
#endif
priv->chan_under_nop = MFALSE;
}
#endif
@ -3363,12 +3526,23 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
PRINTM(MEVENT,
"FW_REMAIN_ON_CHANNEL_EXPIRED cookie = %#llx\n",
priv->phandle->cookie);
#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;
}
#endif
priv->phandle->remain_on_channel = MFALSE;
if (priv->phandle->cookie &&
!priv->phandle->is_remain_timer_set) {
@ -3405,12 +3579,7 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
moal_memcpy_ext(priv->phandle, addr,
pmevent->event_buf, ETH_ALEN,
ETH_ALEN);
/** these field add in kernel 3.2, but some
* kernel do have the pacth to support it,
* like T3T and pxa978T 3.0.31 JB, these
* patch are needed to support
* wpa_supplicant 2.x */
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 0, 31)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
if (pmevent->event_len > ETH_ALEN) {
#if CFG80211_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
/* set station info filled flag */
@ -3623,7 +3792,11 @@ 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, 2)) || IMX_ANDROID_13)
if (!priv->wdev->connected) {
#else
if (!priv->wdev->current_bss) {
#endif
PRINTM(MEVENT,
"HostMlme: Drop deauth/disassociate, current_bss = null\n");
break;
@ -3993,7 +4166,11 @@ 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(6, 0, 0)) || IMX_ANDROID_13)
roam_info->links[0].bssid = priv->cfg_bssid;
#else
roam_info->bssid = priv->cfg_bssid;
#endif
roam_info->req_ie = req_ie;
roam_info->req_ie_len = ie_len;
roam_info->resp_ie = pinfo->rsp_ie;

File diff suppressed because it is too large Load diff

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
@ -2113,8 +2111,8 @@ int woal_11h_chan_dfs_state(moal_private *priv, t_u8 action,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
if (action == MLAN_ACT_GET) {
if (IS_UAP_CFG80211(cfg80211_wext)) {
ret = woal_get_wiphy_chan_dfs_state(priv->wdev->wiphy,
ch_dfs_state);
ret = woal_get_wiphy_chan_dfs_state(
priv->phandle->wiphy, ch_dfs_state);
if (!ret) {
LEAVE();
return ret;
@ -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,
"ZeroDFS: 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, "ZeroDFS: 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) {
@ -3660,6 +3777,10 @@ int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band,
&hecap_ie->ext_id, he_cfg.he_cap.len,
he_cfg.he_cap.len);
}
#define HE_MAC_CAP_TWT_REQ_SUPPORT MBIT(1)
/* uap mode clear TWT request bit */
he_cfg.he_cap.he_mac_cap[0] &= ~HE_MAC_CAP_TWT_REQ_SUPPORT;
if (action == MLAN_ACT_DISABLE) {
if (he_cfg.he_cap.len &&
(he_cfg.he_cap.ext_id == HE_CAPABILITY)) {
@ -4235,12 +4356,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 +4373,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 +4416,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 +4435,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));
@ -130,8 +132,17 @@ static int woal_deauth_assoc_station(moal_private *priv, u8 *mac_addr,
for (i = 0; i < info->param.sta_list.sta_count; i++) {
if (!memcmp(info->param.sta_list.info[i].mac_address, mac_addr,
ETH_ALEN))
ETH_ALEN)) {
PRINTM(MMSG, "wlan: deauth station " MACSTR "\n",
MAC2STR(mac_addr));
ret = woal_deauth_station(priv, mac_addr, reason_code);
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
if (moal_extflg_isset(priv->phandle, EXT_HOST_MLME))
cfg80211_del_sta(priv->netdev, mac_addr,
GFP_KERNEL);
#endif
break;
}
}
done:
@ -604,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;
}
@ -665,11 +677,17 @@ static void woal_convert_chan_to_bandconfig(moal_private *priv,
struct cfg80211_chan_def *chandef)
{
ENTER();
if (chandef->chan->hw_value <= MAX_BG_CHANNEL)
memset(bandcfg, 0, sizeof(Band_Config_t));
switch (chandef->chan->band) {
case NL80211_BAND_2GHZ:
bandcfg->chanBand = BAND_2GHZ;
else
break;
case NL80211_BAND_5GHZ:
bandcfg->chanBand = BAND_5GHZ;
break;
default:
break;
}
switch (chandef->width) {
case NL80211_CHAN_WIDTH_20_NOHT:
case NL80211_CHAN_WIDTH_20:
@ -692,10 +710,16 @@ static void woal_convert_chan_to_bandconfig(moal_private *priv,
default:
break;
}
PRINTM(MCMND,
"cfg80211 AP: channel=%d, chanBand=0x%x chanWidth=0x%x chan2Offset=0x%x\n",
chandef->chan->hw_value, bandcfg->chanBand, bandcfg->chanWidth,
bandcfg->chan2Offset);
LEAVE();
return;
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
/**
* @brief Enable radar detect for DFS channel
*
@ -843,8 +867,10 @@ static int woal_cfg80211_beacon_config(moal_private *priv,
int GoAgeoutTime = priv->phandle->params.GoAgeoutTime;
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
mlan_ds_11h_chan_nop_info chan_nop_info;
Band_Config_t bandcfg;
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
mlan_ds_11h_chan_nop_info chan_nop_info;
#endif
ENTER();
@ -947,18 +973,21 @@ static int woal_cfg80211_beacon_config(moal_private *priv,
sizeof(struct cfg80211_chan_def), sizeof(priv->chan));
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
woal_convert_chan_to_bandconfig(priv, &bandcfg, &params->chandef);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
if (priv->phandle->usr_nop_period_sec) {
PRINTM(MCMND, "Checking if AP's channel %d is under NOP\n",
priv->channel);
woal_convert_chan_to_bandconfig(priv, &bandcfg,
&params->chandef);
memset(&chan_nop_info, 0, sizeof(chan_nop_info));
chan_nop_info.curr_chan = priv->channel;
chan_nop_info.chan_width = bandcfg.chanWidth;
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) {
@ -1080,6 +1109,11 @@ static int woal_cfg80211_beacon_config(moal_private *priv,
params->head_len, params->tail,
params->tail_len);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
moal_memcpy_ext(priv->phandle, &sys_config->bandcfg, &bandcfg,
sizeof(bandcfg), sizeof(bandcfg));
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
enable_11ac = woal_check_11ac_capability(
priv, sys_config->bandcfg.chanBand, params);
@ -1287,7 +1321,7 @@ static int woal_cfg80211_beacon_config(moal_private *priv,
(priv->cipher == WLAN_CIPHER_SUITE_WEP104)) {
sys_config->protocol = PROTOCOL_STATIC_WEP;
sys_config->key_mgmt = KEY_MGMT_NONE;
sys_config->.wpa_cfg.length = 0;
sys_config->wpa_cfg.length = 0;
moal_memcpy_ext(priv->phandle, &sys_config->wep_cfg.key0,
&priv->uap_wep_key[0], sizeof(wep_key),
sizeof(sys_config->wep_cfg.key0));
@ -1329,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);
@ -2306,15 +2348,34 @@ int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy,
}
}
if (vir_priv && vir_priv->bss_type == MLAN_BSS_TYPE_UAP) {
woal_cfg80211_del_beacon(wiphy, dev);
#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13)
if (woal_cfg80211_del_beacon(wiphy, dev, 0))
#else
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, 2)) || IMX_ANDROID_13)
vir_priv->wdev->links[0].ap.beacon_interval = 0;
#else
vir_priv->wdev->beacon_interval = 0;
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13)
memset(&vir_priv->wdev->links[0].ap.chandef, 0,
sizeof(vir_priv->wdev->links[0].ap.chandef));
#else
memset(&vir_priv->wdev->chandef, 0,
sizeof(vir_priv->wdev->chandef));
#endif
#endif
#endif
#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13)
vir_priv->wdev->u.ap.ssid_len = 0;
#else
vir_priv->wdev->ssid_len = 0;
#endif
PRINTM(MMSG, "Skip del UAP virtual interface %s",
dev->name);
}
@ -2489,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;
@ -2589,7 +2650,12 @@ done:
*
* @return 0 -- success, otherwise fail
*/
#if ((CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) || IMX_ANDROID_13)
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
{
moal_private *priv = (moal_private *)woal_get_netdev_priv(dev);
int ret = 0;
@ -2623,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);
@ -2640,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;
}
@ -2733,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;
@ -2745,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);
@ -2794,29 +2868,20 @@ 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;
#ifdef UAP_SUPPORT
if ((priv->bss_type == MLAN_BSS_TYPE_UAP) && !priv->bss_started) {
woal_cancel_cac(priv);
LEAVE();
return 0;
}
#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();
return 0;
}
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
if (param) {
@ -2824,30 +2889,20 @@ int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
reason_code = param->reason_code;
}
#endif
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
if (moal_extflg_isset(priv->phandle, EXT_HOST_MLME)) {
if (mac_addr)
cfg80211_del_sta(dev, mac_addr, GFP_KERNEL);
}
#endif
if (priv->media_connected == MFALSE) {
PRINTM(MINFO, "cfg80211: Media not connected!\n");
LEAVE();
return 0;
}
/** we will not send deauth to p2p interface, it might cause WPS failure
*/
if (mac_addr) {
PRINTM(MMSG, "wlan: deauth station " MACSTR "\n",
MAC2STR(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;
@ -2915,11 +2970,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;
@ -3087,7 +3145,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,
@ -3095,8 +3154,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;
}
@ -3184,6 +3246,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.
@ -3226,8 +3385,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;
}
@ -3268,10 +3426,8 @@ static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option)
priv->csa_chan.width);
break;
}
if (priv->csa_chan.chan->band == IEEE80211_BAND_2GHZ)
uap_channel.bandcfg.chanBand = BAND_2GHZ;
else if (priv->csa_chan.chan->band == IEEE80211_BAND_5GHZ)
uap_channel.bandcfg.chanBand = BAND_5GHZ;
uap_channel.bandcfg.chanBand =
woal_ieee_band_to_radio_type(priv->csa_chan.chan->band);
uap_channel.bandcfg.chan2Offset = chan2Offset;
if (MLAN_STATUS_SUCCESS != woal_set_get_ap_channel(priv, MLAN_ACT_SET,
wait_option,
@ -3279,8 +3435,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;
}
@ -3289,7 +3444,11 @@ 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, 2)) || IMX_ANDROID_13)
cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0);
#else
cfg80211_ch_switch_notify(priv->netdev, &priv->chan);
#endif
if (priv->uap_tx_blocked) {
if (!netif_carrier_ok(priv->netdev))
netif_carrier_on(priv->netdev);
@ -3319,6 +3478,7 @@ void woal_csa_work_queue(struct work_struct *work)
LEAVE();
}
#if KERNEL_VERSION(3, 12, 0) <= CFG80211_VERSION_CODE
/*
* @brief handle WOAL_EVENT_CANCEL_CHANRPT
*
@ -3328,13 +3488,14 @@ void woal_csa_work_queue(struct work_struct *work)
*/
void woal_process_cancel_chanrpt_event(moal_private *priv)
{
#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 (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);
@ -3346,8 +3507,8 @@ void woal_process_cancel_chanrpt_event(moal_private *priv)
sizeof(struct cfg80211_chan_def));
priv->phandle->cac_bss_index = 0xff;
}
#endif
}
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
/**
@ -3359,7 +3520,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,
@ -3500,15 +3660,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,

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