Compare commits

..

1 commit

Author SHA1 Message Date
Sherry Sun 31800f43a6 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-30 17:32:12 +08:00
112 changed files with 21040 additions and 27770 deletions

13
SCR.txt
View file

@ -1,13 +0,0 @@
NXP Software Content Register
--------------------------------------------
Package: mwifiex.git
Outgoing License: GPL-2.0
License File: LICENSE
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,25 +1,35 @@
# File: Makefile
#
# Copyright 2008-2023 NXP
# Copyright 2014-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.
# NXP CONFIDENTIAL
# The source code contained or described herein and all documents related to
# the source code (Materials) are owned by NXP, its
# suppliers and/or its licensors. Title to the Materials remains with NXP,
# its suppliers and/or its licensors. The Materials contain
# trade secrets and proprietary and confidential information of NXP, its
# suppliers and/or its licensors. The Materials are protected by worldwide copyright
# and trade secret laws and treaty provisions. No part of the Materials may be
# used, copied, reproduced, modified, published, uploaded, posted,
# transmitted, distributed, or disclosed in any way without NXP's prior
# express written permission.
#
# 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.
# No license under any patent, copyright, trade secret or other intellectual
# property right is granted to or conferred upon you by disclosure or delivery
# of the Materials, either expressly, by implication, inducement, estoppel or
# otherwise. Any license under such intellectual property rights must be
# express and approved by NXP in writing.
#
# Alternatively, this software may be distributed under the terms of GPL v2.
# SPDX-License-Identifier: GPL-2.0
#
CONFIG_COMPATDIR=n
ifeq ($(CONFIG_COMPATDIR), y)
COMPATDIR=/lib/modules/$(KERNELVERSION_X86)/build/compat-wireless-3.2-rc1-1/include
CC ?= $(CROSS_COMPILE)gcc -I$(COMPATDIR)
else
CC ?= $(CROSS_COMPILE)gcc -I$(COMPATDIR)
endif
LD ?= $(CROSS_COMPILE)ld
@ -42,7 +52,7 @@ CONFIG_USB8997=n
CONFIG_PCIE8997=y
CONFIG_SD8987=y
CONFIG_SD9097=n
CONFIG_SD9177=y
CONFIG_SD9177=n
CONFIG_SD8801=y
CONFIG_USB8801=n
CONFIG_USB9097=n
@ -50,12 +60,9 @@ CONFIG_PCIE9097=n
CONFIG_SD9098=y
CONFIG_USB9098=n
CONFIG_PCIE9098=y
CONFIG_SDIW624=n
CONFIG_SDAW693=n
CONFIG_PCIEIW624=n
CONFIG_USBIW624=n
CONFIG_PCIEAW693=n
CONFIG_SDNW62X=n
CONFIG_PCIENW62X=n
CONFIG_USBNW62X=n
# Debug Option
@ -85,11 +92,15 @@ CONFIG_MFG_CMD_SUPPORT=y
# OpenWrt support
CONFIG_OPENWRT_SUPPORT=n
# Big-endian platform
CONFIG_BIG_ENDIAN=n
ifeq ($(CONFIG_DRV_EMBEDDED_SUPPLICANT), y)
CONFIG_EMBEDDED_SUPP_AUTH=y
else
ifeq ($(CONFIG_DRV_EMBEDDED_AUTHENTICATOR), y)
CONFIG_EMBEDDED_SUPP_AUTH=y
endif
endif
#ifdef SDIO_MMC
# SDIO suspend/resume
@ -99,13 +110,12 @@ CONFIG_SDIO_SUSPEND_RESUME=y
# DFS testing support
CONFIG_DFS_TESTING_SUPPORT=y
# Multi-channel support
CONFIG_MULTI_CHAN_SUPPORT=y
CONFIG_DUMP_TO_PROC=y
# Use static link for app build
export CONFIG_STATIC_LINK=y
CONFIG_ANDROID_KERNEL=n
#32bit app over 64bit kernel support
CONFIG_USERSPACE_32BIT_OVER_KERNEL_64BIT=n
@ -128,12 +138,9 @@ ARCH ?= arm64
CONFIG_IMX_SUPPORT=y
ifeq ($(CONFIG_IMX_SUPPORT),y)
ccflags-y += -DIMX_SUPPORT
ifneq ($(ANDROID_PRODUCT_OUT),)
ccflags-y += -DIMX_ANDROID
ccflags-y += -Wno-implicit-fallthrough
CONFIG_ANDROID_KERNEL=y
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-
LD += -S
@ -189,10 +196,6 @@ 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
@ -203,9 +206,6 @@ ifeq ($(CONFIG_SDIO_SUSPEND_RESUME),y)
endif
#endif
ifeq ($(CONFIG_MULTI_CHAN_SUPPORT),y)
ccflags-y += -DMULTI_CHAN_SUPPORT
endif
ifeq ($(CONFIG_DFS_TESTING_SUPPORT),y)
ccflags-y += -DDFS_TESTING_SUPPORT
@ -214,11 +214,6 @@ endif
ifeq ($(CONFIG_ANDROID_KERNEL), y)
ccflags-y += -DANDROID_KERNEL
CONFIG_DUMP_TO_PROC=y
endif
ifeq ($(CONFIG_DUMP_TO_PROC), y)
ccflags-y += -DDUMP_TO_PROC
endif
ifeq ($(CONFIG_OPENWRT_SUPPORT), y)
@ -259,13 +254,9 @@ ifeq ($(CONFIG_SD9097),y)
CONFIG_SDIO=y
ccflags-y += -DSD9097
endif
ifeq ($(CONFIG_SDIW624),y)
ifeq ($(CONFIG_SDNW62X),y)
CONFIG_SDIO=y
ccflags-y += -DSDIW624
endif
ifeq ($(CONFIG_SDAW693),y)
CONFIG_SDIO=y
ccflags-y += -DSDAW693
ccflags-y += -DSDNW62X
endif
ifeq ($(CONFIG_SD9177),y)
CONFIG_SDIO=y
@ -299,9 +290,9 @@ ifeq ($(CONFIG_USB9097),y)
CONFIG_MUSB=y
ccflags-y += -DUSB9097
endif
ifeq ($(CONFIG_USBIW624),y)
ifeq ($(CONFIG_USBNW62X),y)
CONFIG_MUSB=y
ccflags-y += -DUSBIW624
ccflags-y += -DUSBNW62X
endif
ifeq ($(CONFIG_USB9098),y)
CONFIG_MUSB=y
@ -323,16 +314,10 @@ ifeq ($(CONFIG_PCIE9098),y)
CONFIG_PCIE=y
ccflags-y += -DPCIE9098
endif
ifeq ($(CONFIG_PCIEIW624),y)
ifeq ($(CONFIG_PCIENW62X),y)
CONFIG_PCIE=y
ccflags-y += -DPCIEIW624
ccflags-y += -DPCIENW62X
endif
#ifdef PCIEAW693_OPT
ifeq ($(CONFIG_PCIEAW693),y)
CONFIG_PCIE=y
ccflags-y += -DPCIEAW693
endif
#endif
ifeq ($(CONFIG_SDIO),y)
ccflags-y += -DSDIO
ccflags-y += -DSDIO_MMC
@ -376,6 +361,7 @@ endif
#ccflags-y += -Wstringop-truncation
#ccflags-y += -Wmisleading-indentation
#ccflags-y += -Wunused-const-variable
ccflags-y += -Wno-array-bounds
#############################################################################
# Make Targets
#############################################################################
@ -617,10 +603,10 @@ appsbuild:
mkdir $(BINDIR); \
fi
cp -f README $(BINDIR)
cp -f README_MLAN $(BINDIR)
cp -rf mapp/mlanconfig/config $(BINDIR)
ifneq ($(APPDIR),)
cp -rf mapp/mlanconfig/config $(BINDIR)
$(MAKE) -C mapp/mlanutl $@ INSTALLDIR=$(BINDIR)
endif
@ -636,10 +622,10 @@ build: echo default
cp -rpf script/load $(BINDIR)/
cp -rpf script/unload $(BINDIR)/
cp -f README $(BINDIR)
cp -f README_MLAN $(BINDIR)
cp -rf mapp/mlanconfig/config $(BINDIR)
ifneq ($(APPDIR),)
cp -rf mapp/mlanconfig/config $(BINDIR)
$(MAKE) -C mapp/mlanutl $@ INSTALLDIR=$(BINDIR)
endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,126 @@
# 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

@ -0,0 +1,15 @@
# 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

@ -0,0 +1,22 @@
# 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

@ -0,0 +1,22 @@
# 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

@ -0,0 +1,22 @@
# 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

@ -0,0 +1,22 @@
# 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

@ -0,0 +1,24 @@
######################### 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

@ -0,0 +1,43 @@
# 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

@ -0,0 +1,537 @@
# 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

@ -0,0 +1,621 @@
# 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

@ -0,0 +1,497 @@
# 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

@ -0,0 +1,204 @@
# 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

@ -0,0 +1,59 @@
# 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

@ -0,0 +1,380 @@
/** @file mlanwls.h
*
* @brief 11mc/11az Wifi location services application
*
*
* Copyright 2022 NXP
*
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
*/
/************************************************************************
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

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/

View file

@ -1,22 +1,33 @@
/** @file mlan_11ac.c
*
* @brief This file contains the functions for station ioctl.
* @brief This file defines the private and adapter data
* structures and declares global function prototypes used
* in MLAN module.
*
*
* Copyright 2011-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -53,84 +64,97 @@ t_u16 wlan_convert_mcsmap_to_maxrate(mlan_private *priv, t_u16 bands,
*
* @return channel center frequency center, if found; O, otherwise
*/
t_u8 wlan_get_center_freq_idx(mlan_private *pmpriv, t_u16 band, t_u32 pri_chan,
t_u8 chan_bw)
{
struct center_freq_desc {
t_u8 pri_chan;
t_u8 ch_40;
t_u8 ch_80;
t_u8 ch_160;
};
t_u8 center_freq_idx = 0;
static const struct center_freq_desc center_freq_idx_map_5g[] = {
{.pri_chan = 36, .ch_40 = 38, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 40, .ch_40 = 38, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 44, .ch_40 = 46, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 48, .ch_40 = 46, .ch_80 = 42, .ch_160 = 50},
{.pri_chan = 52, .ch_40 = 54, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 56, .ch_40 = 54, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 60, .ch_40 = 62, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 64, .ch_40 = 62, .ch_80 = 58, .ch_160 = 50},
{.pri_chan = 68, .ch_40 = 70, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 72, .ch_40 = 70, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 76, .ch_40 = 78, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 80, .ch_40 = 78, .ch_80 = 74, .ch_160 = 0},
{.pri_chan = 84, .ch_40 = 86, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 88, .ch_40 = 86, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 92, .ch_40 = 94, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 96, .ch_40 = 94, .ch_80 = 90, .ch_160 = 0},
{.pri_chan = 100, .ch_40 = 102, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 104, .ch_40 = 102, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 108, .ch_40 = 110, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 112, .ch_40 = 110, .ch_80 = 106, .ch_160 = 114},
{.pri_chan = 116, .ch_40 = 118, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 120, .ch_40 = 118, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 124, .ch_40 = 126, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 128, .ch_40 = 126, .ch_80 = 122, .ch_160 = 114},
{.pri_chan = 132, .ch_40 = 134, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 136, .ch_40 = 134, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 140, .ch_40 = 142, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 144, .ch_40 = 142, .ch_80 = 138, .ch_160 = 0},
{.pri_chan = 149, .ch_40 = 151, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 153, .ch_40 = 151, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 157, .ch_40 = 159, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 161, .ch_40 = 159, .ch_80 = 155, .ch_160 = 163},
{.pri_chan = 165, .ch_40 = 167, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 169, .ch_40 = 167, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 173, .ch_40 = 175, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 177, .ch_40 = 175, .ch_80 = 171, .ch_160 = 163},
{.pri_chan = 184, .ch_40 = 186, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 188, .ch_40 = 186, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 192, .ch_40 = 194, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 196, .ch_40 = 194, .ch_80 = 190, .ch_160 = 0},
{.pri_chan = 0,
.ch_40 = 42 /* terminator with default cfreq */}};
const struct center_freq_desc *map = MNULL;
if (band == BAND_5GHZ)
map = center_freq_idx_map_5g;
for (; map != MNULL; map++) {
/* reached end of map, return default value for that map */
if (map->pri_chan == 0)
return map->ch_40;
if (map->pri_chan == pri_chan) {
if (chan_bw == CHANNEL_BW_40MHZ_ABOVE ||
chan_bw == CHANNEL_BW_40MHZ_BELOW)
return map->ch_40;
if (chan_bw == CHANNEL_BW_80MHZ)
return map->ch_80;
if (chan_bw == CHANNEL_BW_160MHZ)
return map->ch_160;
if (band & BAND_AAC) {
switch (pri_chan) {
case 36:
case 40:
case 44:
case 48:
if (chan_bw == CHANNEL_BW_80MHZ) {
center_freq_idx = 42;
break;
}
/* fall through */
case 52:
case 56:
case 60:
case 64:
if (chan_bw == CHANNEL_BW_80MHZ) {
center_freq_idx = 58;
break;
} else if (chan_bw == CHANNEL_BW_160MHZ) {
center_freq_idx = 50;
break;
}
/* fall through */
case 100:
case 104:
case 108:
case 112:
if (chan_bw == CHANNEL_BW_80MHZ) {
center_freq_idx = 106;
break;
}
/* fall through */
case 116:
case 120:
case 124:
case 128:
if (chan_bw == CHANNEL_BW_80MHZ) {
center_freq_idx = 122;
break;
} else if (chan_bw == CHANNEL_BW_160MHZ) {
center_freq_idx = 114;
break;
}
/* fall through */
case 132:
case 136:
case 140:
case 144:
if (chan_bw == CHANNEL_BW_80MHZ) {
center_freq_idx = 138;
break;
}
/* fall through */
case 149:
case 153:
case 157:
case 161:
if (chan_bw == CHANNEL_BW_80MHZ) {
center_freq_idx = 155;
break;
}
/* fall through */
case 165:
case 169:
case 173:
case 177:
if (chan_bw == CHANNEL_BW_80MHZ) {
center_freq_idx = 171;
break;
}
/* fall through */
case 184:
case 188:
case 192:
case 196:
if (chan_bw == CHANNEL_BW_80MHZ) {
center_freq_idx = 190;
break;
}
/* fall through */
default: /* error. go to the default */
center_freq_idx = 42;
}
}
return 0;
return center_freq_idx;
}
/**
@ -214,8 +238,12 @@ static mlan_status wlan_11ac_ioctl_vhtcfg(pmlan_adapter pmadapter,
t_u32 cfg_value = 0;
t_u32 hw_value = 0;
t_u8 nss = 0;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(USB9097) || defined(SDNW62X) || \
defined(PCIENW62X) || defined(USBNW62X) || defined(SD9097)
t_u16 rx_nss = 0;
t_u16 tx_nss = 0;
#endif
ENTER();
@ -294,8 +322,11 @@ static mlan_status wlan_11ac_ioctl_vhtcfg(pmlan_adapter pmadapter,
/** update the RX MCS map */
if (cfg->param.vht_cfg.txrx & MLAN_RADIO_RX) {
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if (IS_CARD9098(pmadapter->card_type) ||
IS_CARDIW624(pmadapter->card_type) ||
IS_CARDNW62X(pmadapter->card_type) ||
IS_CARD9097(pmadapter->card_type)) {
if (cfg->param.vht_cfg.band == BAND_SELECT_A) {
rx_nss = GET_RXMCSSUPP(
@ -314,6 +345,7 @@ static mlan_status wlan_11ac_ioctl_vhtcfg(pmlan_adapter pmadapter,
0x0f;
}
}
#endif
/* use the previous user value */
if (cfg->param.vht_cfg.vht_rx_mcs == 0xffffffff)
cfg->param.vht_cfg.vht_rx_mcs = GET_VHTMCS(
@ -324,8 +356,12 @@ static mlan_status wlan_11ac_ioctl_vhtcfg(pmlan_adapter pmadapter,
hw_value = GET_DEVNSSRXMCS(
pmadapter->hw_dot_11ac_mcs_support,
nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if ((rx_nss != 0) && (nss > rx_nss))
cfg_value = NO_NSS_SUPPORT;
#endif
if ((hw_value == NO_NSS_SUPPORT) ||
(cfg_value == NO_NSS_SUPPORT))
SET_VHTNSSMCS(
@ -348,8 +384,12 @@ static mlan_status wlan_11ac_ioctl_vhtcfg(pmlan_adapter pmadapter,
hw_value = GET_DEVNSSTXMCS(
pmadapter->hw_dot_11ac_mcs_support,
nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if ((tx_nss != 0) && (nss > tx_nss))
cfg_value = NO_NSS_SUPPORT;
#endif
if ((hw_value == NO_NSS_SUPPORT) ||
(cfg_value == NO_NSS_SUPPORT))
SET_VHTNSSMCS(
@ -770,7 +810,11 @@ void wlan_fill_vht_cap_tlv(mlan_private *priv, MrvlIETypes_VHTCap_t *pvht_cap,
t_u16 mcs_user = 0;
t_u16 mcs_resp = 0;
t_u16 nss;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) | defined(USBNW62X)
t_u16 rx_nss = 0, tx_nss = 0;
#endif
ENTER();
/* Fill VHT cap info */
@ -788,8 +832,11 @@ void wlan_fill_vht_cap_tlv(mlan_private *priv, MrvlIETypes_VHTCap_t *pvht_cap,
if (flag)
mcs_map_resp =
wlan_le16_to_cpu(pvht_cap->vht_cap.mcs_sets.rx_mcs_map);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if (IS_CARD9098(priv->adapter->card_type) ||
IS_CARDIW624(priv->adapter->card_type) ||
IS_CARDNW62X(priv->adapter->card_type) ||
IS_CARD9097(priv->adapter->card_type)) {
if (bands & BAND_A) {
rx_nss = GET_RXMCSSUPP(priv->adapter->user_htstream >>
@ -806,12 +853,17 @@ void wlan_fill_vht_cap_tlv(mlan_private *priv, MrvlIETypes_VHTCap_t *pvht_cap,
if (bw_80p80)
rx_nss = tx_nss = 1;
}
#endif
mcs_map_result = 0;
for (nss = 1; nss <= 8; nss++) {
mcs_user = GET_VHTNSSMCS(mcs_map_user, nss);
mcs_resp = GET_VHTNSSMCS(mcs_map_resp, nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if ((rx_nss != 0) && (nss > rx_nss))
mcs_user = NO_NSS_SUPPORT;
#endif
if ((mcs_user == NO_NSS_SUPPORT) ||
(mcs_resp == NO_NSS_SUPPORT))
SET_VHTNSSMCS(mcs_map_result, nss, NO_NSS_SUPPORT);
@ -839,8 +891,12 @@ void wlan_fill_vht_cap_tlv(mlan_private *priv, MrvlIETypes_VHTCap_t *pvht_cap,
for (nss = 1; nss <= 8; nss++) {
mcs_user = GET_VHTNSSMCS(mcs_map_user, nss);
mcs_resp = GET_VHTNSSMCS(mcs_map_resp, nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if ((tx_nss != 0) && (nss > tx_nss))
mcs_user = NO_NSS_SUPPORT;
#endif
if ((mcs_user == NO_NSS_SUPPORT) ||
(mcs_resp == NO_NSS_SUPPORT))
SET_VHTNSSMCS(mcs_map_result, nss, NO_NSS_SUPPORT);
@ -1035,7 +1091,7 @@ void wlan_fill_tdls_vht_oprat_ie(mlan_private *priv,
break;
}
vht_oprat->chan_center_freq_1 = wlan_get_center_freq_idx(
priv, BAND_5GHZ, pbss_desc->channel, chan_bw);
priv, BAND_AAC, pbss_desc->channel, chan_bw);
LEAVE();
return;
@ -1052,15 +1108,22 @@ void wlan_fill_tdls_vht_oprat_ie(mlan_private *priv,
t_u8 wlan_is_80_80_support(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
{
t_u8 ret = MFALSE;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
t_u16 rx_nss = 0, tx_nss = 0;
IEEEtypes_VHTCap_t *pvht_cap = pbss_desc->pvht_cap;
MrvlIEtypes_He_cap_t *phecap = MNULL;
IEEEtypes_HECap_t *pBsshecap = MNULL;
#endif
ENTER();
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if (!IS_CARD9098(pmpriv->adapter->card_type) &&
!IS_CARDIW624(pmpriv->adapter->card_type) &&
!IS_CARDNW62X(pmpriv->adapter->card_type) &&
!IS_CARD9097(pmpriv->adapter->card_type))
return ret;
/** check band A */
@ -1087,6 +1150,7 @@ t_u8 wlan_is_80_80_support(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
else
ret = MFALSE;
}
#endif
LEAVE();
return ret;
}
@ -1110,7 +1174,11 @@ int wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
t_u16 nss;
int ret_len = 0;
t_u8 bw_80p80 = MFALSE;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(USB9097) || defined(SDNW62X) || \
defined(PCIENW62X) || defined(USBNW62X) || defined(SD9097)
t_u16 rx_nss = 0;
#endif
ENTER();
@ -1178,8 +1246,11 @@ int wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
} else {
/** set default bandwidth:80M*/
SET_OPER_MODE_80M(pmrvl_oper_mode->oper_mode);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if (IS_CARD9098(pmadapter->card_type) ||
IS_CARDIW624(pmadapter->card_type) ||
IS_CARDNW62X(pmadapter->card_type) ||
IS_CARD9097(pmadapter->card_type)) {
if (pbss_desc->bss_band & BAND_A)
rx_nss = GET_RXMCSSUPP(
@ -1188,16 +1259,21 @@ int wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
rx_nss =
GET_RXMCSSUPP(pmadapter->user_htstream);
}
#endif
mcs_map_user =
GET_DEVRXMCSMAP(pmpriv->usr_dot_11ac_mcs_support);
nss = wlan_get_nss_num_vht_mcs(mcs_map_user);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if (IS_CARD9098(pmadapter->card_type) ||
IS_CARDIW624(pmadapter->card_type) ||
IS_CARDNW62X(pmadapter->card_type) ||
IS_CARD9097(pmadapter->card_type)) {
PRINTM(MCMND, "rx_nss=%d nss=%d\n", rx_nss, nss);
nss = MIN(rx_nss, nss);
}
#endif
pmrvl_oper_mode->oper_mode |= (nss - 1) << 4;

View file

@ -1,22 +1,33 @@
/** @file mlan_11ac.h
*
* @brief This file contains the functions for station ioctl.
* @brief This file defines the private and adapter data
* structures and declares global function prototypes used
* in MLAN module.
*
*
* Copyright 2011-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/

View file

@ -1,22 +1,33 @@
/** @file mlan_11ax.c
*
* @brief This file contains the functions for 11ax related features.
* @brief This file defines the private and adapter data
* structures and declares global function prototypes used
* in MLAN module.
*
*
* Copyright 2018-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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -76,7 +87,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_RESP_SUPPORT))
if (!(pbss_desc->phe_cap->he_mac_cap[0] & HE_MAC_CAP_TWT_REQ_SUPPORT))
return MFALSE;
if (!pbss_desc->pext_cap)
return MFALSE;
@ -99,14 +110,12 @@ 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_selected) {
if (pbss_desc->bss_band & BAND_A) {
hw_he_cap = (MrvlIEtypes_He_cap_t *)&pmpriv->adapter
->hw_he_cap;
phecap = (MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap;
@ -188,9 +197,9 @@ t_u8 wlan_fill_he_cap_ie(mlan_private *pmpriv, IEEEtypes_HECap_t *hecap_ie,
he_mcsnss = (IEEEtypes_HeMcsNss_t *)hecap_ie->he_txrx_mcs_support;
cfg_value = GET_HE_NSSMCS(user_hecap_tlv->rx_mcs_80, nss);
hw_value = GET_HE_NSSMCS(hw_hecap_tlv->rx_mcs_80, nss);
for (nss = 1; nss <= 8; nss++) {
cfg_value = GET_HE_NSSMCS(user_hecap_tlv->rx_mcs_80, nss);
hw_value = GET_HE_NSSMCS(hw_hecap_tlv->rx_mcs_80, nss);
if ((hw_value == NO_NSS_SUPPORT) ||
(cfg_value == NO_NSS_SUPPORT)) {
SET_HE_NSSMCS(he_mcsnss->rx_mcs, nss, NO_NSS_SUPPORT);
@ -200,10 +209,9 @@ 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);
@ -295,7 +303,11 @@ t_u16 wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u16 band,
{
pmlan_adapter pmadapter = pmpriv->adapter;
t_u16 len = 0;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
t_u16 rx_nss = 0, tx_nss = 0;
#endif
MrvlIEtypes_He_cap_t *phecap = MNULL;
t_u8 nss = 0;
t_u16 cfg_value = 0;
@ -321,6 +333,9 @@ t_u16 wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u16 band,
}
phe_cap->type = wlan_cpu_to_le16(phe_cap->type);
phe_cap->len = wlan_cpu_to_le16(phe_cap->len);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if (IS_CARD9098(pmpriv->adapter->card_type) ||
IS_CARD9097(pmpriv->adapter->card_type)) {
if (band & BAND_AAX) {
@ -335,12 +350,17 @@ t_u16 wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u16 band,
0x0f;
}
}
#endif
phecap = (MrvlIEtypes_He_cap_t *)phe_cap;
for (nss = 1; nss <= 8; nss++) {
cfg_value = GET_HE_NSSMCS(phecap->rx_mcs_80, nss);
hw_value = GET_HE_NSSMCS(phw_hecap->rx_mcs_80, nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if ((rx_nss != 0) && (nss > rx_nss))
cfg_value = NO_NSS_SUPPORT;
#endif
if ((hw_value == NO_NSS_SUPPORT) ||
(cfg_value == NO_NSS_SUPPORT))
SET_HE_NSSMCS(phecap->rx_mcs_80, nss, NO_NSS_SUPPORT);
@ -351,8 +371,12 @@ t_u16 wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u16 band,
for (nss = 1; nss <= 8; nss++) {
cfg_value = GET_HE_NSSMCS(phecap->tx_mcs_80, nss);
hw_value = GET_HE_NSSMCS(phw_hecap->tx_mcs_80, nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if ((tx_nss != 0) && (nss > tx_nss))
cfg_value = NO_NSS_SUPPORT;
#endif
if ((hw_value == NO_NSS_SUPPORT) ||
(cfg_value == NO_NSS_SUPPORT))
SET_HE_NSSMCS(phecap->tx_mcs_80, nss, NO_NSS_SUPPORT);
@ -384,12 +408,15 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
MrvlIEtypes_He_cap_t *phecap = MNULL;
int len = 0;
t_u8 bw_80p80 = MFALSE;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
t_u16 rx_nss = 0, tx_nss = 0;
#endif
t_u8 nss = 0;
t_u16 cfg_value = 0;
t_u16 hw_value = 0;
MrvlIEtypes_He_cap_t *phw_hecap = MNULL;
t_u16 band_selected = BAND_A;
ENTER();
@ -409,7 +436,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_selected) {
if (pbss_desc->bss_band & BAND_A) {
memcpy_ext(pmadapter, *ppbuffer, pmpriv->user_he_cap,
pmpriv->user_hecap_len, pmpriv->user_hecap_len);
*ppbuffer += pmpriv->user_hecap_len;
@ -425,10 +452,13 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
}
phecap->type = wlan_cpu_to_le16(phecap->type);
phecap->len = wlan_cpu_to_le16(phecap->len);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if (IS_CARD9098(pmpriv->adapter->card_type) ||
IS_CARDIW624(pmpriv->adapter->card_type) ||
IS_CARDNW62X(pmpriv->adapter->card_type) ||
IS_CARD9097(pmpriv->adapter->card_type)) {
if (pbss_desc->bss_band & band_selected) {
if (pbss_desc->bss_band & BAND_A) {
rx_nss = GET_RXMCSSUPP(pmpriv->adapter->user_htstream >>
8);
tx_nss = GET_TXMCSSUPP(pmpriv->adapter->user_htstream >>
@ -443,11 +473,16 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
if (bw_80p80)
rx_nss = tx_nss = 1;
}
#endif
for (nss = 1; nss <= 8; nss++) {
cfg_value = GET_HE_NSSMCS(phecap->rx_mcs_80, nss);
hw_value = GET_HE_NSSMCS(phw_hecap->rx_mcs_80, nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if ((rx_nss != 0) && (nss > rx_nss))
cfg_value = NO_NSS_SUPPORT;
#endif
if ((hw_value == NO_NSS_SUPPORT) ||
(cfg_value == NO_NSS_SUPPORT))
SET_HE_NSSMCS(phecap->rx_mcs_80, nss, NO_NSS_SUPPORT);
@ -458,8 +493,12 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
for (nss = 1; nss <= 8; nss++) {
cfg_value = GET_HE_NSSMCS(phecap->tx_mcs_80, nss);
hw_value = GET_HE_NSSMCS(phw_hecap->tx_mcs_80, nss);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if ((tx_nss != 0) && (nss > tx_nss))
cfg_value = NO_NSS_SUPPORT;
#endif
if ((hw_value == NO_NSS_SUPPORT) ||
(cfg_value == NO_NSS_SUPPORT))
SET_HE_NSSMCS(phecap->tx_mcs_80, nss, NO_NSS_SUPPORT);
@ -494,7 +533,6 @@ 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)) >
@ -553,28 +591,6 @@ 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();
@ -627,6 +643,15 @@ 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)) &&
@ -892,10 +917,6 @@ mlan_status wlan_cmd_11ax_cmd(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
(mlan_ds_11ax_txomi_cmd *)&ds_11ax_cmd->param;
mlan_ds_11ax_toltime_cmd *toltime_cmd =
(mlan_ds_11ax_toltime_cmd *)&ds_11ax_cmd->param;
mlan_ds_11ax_set_bsrp_cmd *set_bsrp_cmd =
(mlan_ds_11ax_set_bsrp_cmd *)&ds_11ax_cmd->param;
mlan_ds_11ax_llde_cmd *llde_cmd =
(mlan_ds_11ax_llde_cmd *)&ds_11ax_cmd->param;
MrvlIEtypes_Data_t *tlv = MNULL;
ENTER();
@ -929,25 +950,14 @@ mlan_status wlan_cmd_11ax_cmd(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
break;
case MLAN_11AXCMD_TXOMI_SUBID:
memcpy_ext(pmadapter, axcmd->val, &txomi_cmd->omi,
sizeof(mlan_ds_11ax_txomi_cmd),
sizeof(mlan_ds_11ax_txomi_cmd));
cmd->size += sizeof(mlan_ds_11ax_txomi_cmd);
sizeof(t_u16), sizeof(t_u16));
cmd->size += sizeof(t_u16);
break;
case MLAN_11AXCMD_OBSS_TOLTIME_SUBID:
memcpy_ext(pmadapter, axcmd->val, &toltime_cmd->tol_time,
sizeof(t_u32), sizeof(t_u32));
cmd->size += sizeof(t_u32);
break;
case MLAN_11AXCMD_SET_BSRP_SUBID:
axcmd->val[0] = set_bsrp_cmd->value;
cmd->size += sizeof(t_u8);
break;
case MLAN_11AXCMD_LLDE_SUBID:
memcpy_ext(pmadapter, axcmd->val, &llde_cmd->llde,
sizeof(mlan_ds_11ax_llde_cmd),
sizeof(mlan_ds_11ax_llde_cmd));
cmd->size += sizeof(mlan_ds_11ax_llde_cmd);
break;
default:
PRINTM(MERROR, "Unknown subcmd %x\n", ds_11ax_cmd->sub_id);
break;
@ -1017,21 +1027,12 @@ mlan_status wlan_ret_11ax_cmd(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
break;
case MLAN_11AXCMD_TXOMI_SUBID:
memcpy_ext(pmadapter, &cfg->param.txomi_cfg.omi, axcmd->val,
sizeof(mlan_ds_11ax_txomi_cmd),
sizeof(mlan_ds_11ax_txomi_cmd));
sizeof(t_u16), sizeof(t_u16));
break;
case MLAN_11AXCMD_OBSS_TOLTIME_SUBID:
memcpy_ext(pmadapter, &cfg->param.toltime_cfg.tol_time,
axcmd->val, sizeof(t_u32), sizeof(t_u32));
break;
case MLAN_11AXCMD_SET_BSRP_SUBID:
cfg->param.setbsrp_cfg.value = *axcmd->val;
break;
case MLAN_11AXCMD_LLDE_SUBID:
memcpy_ext(pmadapter, &cfg->param.llde_cfg.llde, axcmd->val,
sizeof(mlan_ds_11ax_llde_cmd),
sizeof(mlan_ds_11ax_llde_cmd));
break;
default:
PRINTM(MERROR, "Unknown subcmd %x\n", axcmd->sub_id);
break;
@ -1061,7 +1062,6 @@ mlan_status wlan_cmd_twt_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
mlan_ds_twtcfg *ds_twtcfg = (mlan_ds_twtcfg *)pdata_buf;
hostcmd_twt_setup *twt_setup_params = MNULL;
hostcmd_twt_teardown *twt_teardown_params = MNULL;
hostcmd_twt_report *twt_report_params = MNULL;
mlan_status ret = MLAN_STATUS_SUCCESS;
ENTER();
@ -1114,13 +1114,6 @@ mlan_status wlan_cmd_twt_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
ds_twtcfg->param.twt_teardown.teardown_all_twt;
cmd->size += sizeof(hostcmd_twtcfg->param.twt_teardown);
break;
case MLAN_11AX_TWT_REPORT_SUBID:
twt_report_params = &hostcmd_twtcfg->param.twt_report;
memset(pmpriv->adapter, twt_report_params, 0x00,
sizeof(hostcmd_twtcfg->param.twt_report));
twt_report_params->type = ds_twtcfg->param.twt_report.type;
cmd->size += sizeof(hostcmd_twtcfg->param.twt_report);
break;
default:
PRINTM(MERROR, "Unknown subcmd %x\n", ds_twtcfg->sub_id);
ret = MLAN_STATUS_FAILURE;

View file

@ -1,22 +1,33 @@
/** @file mlan_11ax.h
*
* @brief This file contains the functions for station ioctl.
* @brief This file defines the private and adapter data
* structures and declares global function prototypes used
* in MLAN module.
*
*
* Copyright 2018-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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/

View file

@ -5,18 +5,27 @@
*
* 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
/********************************************************
@ -409,7 +418,8 @@ 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 = pbss_desc->bss_band;
parsed_region_chan->chan_pwr[i].band =
(t_u8)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++;
@ -1523,11 +1533,8 @@ mlan_status wlan_11d_cfg_domain_info(pmlan_adapter pmadapter,
ret = MLAN_STATUS_FAILURE;
goto done;
}
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");
}
if (!wlan_fw_11d_is_enabled(pmpriv))
wlan_11d_enable(pmpriv, MNULL, ENABLE_11D);
cfg_11d = (mlan_ds_11d_cfg *)pioctl_req->pbuf;
domain_info = &cfg_11d->param.domain_info;
@ -1590,8 +1597,7 @@ 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 = MNULL;
MrvlIEtypes_Rgn_dom_code_t *pregdomain_tlv = MNULL;
MrvlIEtypes_DomainParamSet_t *pdomain_tlv;
t_u8 num_sub_band = 0;
t_u8 cfp_bg = 0, cfp_a = 0;
@ -1599,12 +1605,6 @@ 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) ==
@ -1634,18 +1634,9 @@ 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
*/
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);
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:

File diff suppressed because it is too large Load diff

View file

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -63,14 +72,6 @@ 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);
@ -143,14 +144,12 @@ 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 *bandwidth);
t_u8 *radar_chan);
/** 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 *bandwidth);
t_u8 *radar_chan);
t_s32 wlan_11h_cancel_radar_detect(mlan_private *priv);
/** Handler for DFS_TESTING IOCTL */
@ -158,8 +157,6 @@ 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);
@ -169,16 +166,11 @@ extern mlan_status wlan_11h_ioctl_chan_switch_count(pmlan_adapter pmadapter,
/** get/set channel dfs state */
mlan_status wlan_11h_ioctl_chan_dfs_state(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
t_void wlan_11h_reset_dfs_checking_chan_dfs_state(mlan_private *priv,
dfs_state_t dfs_state);
/** get/set dfs w53 cfg */
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);
@ -189,7 +181,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, t_u8 bandwidth);
void wlan_11h_set_dfs_check_chan(mlan_private *priv, t_u8 chan);
#ifdef UAP_SUPPORT
/** BW_change event Handler for dfs_repeater */

View file

@ -5,18 +5,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -61,24 +70,9 @@ static mlan_status wlan_11n_ioctl_max_tx_buf_size(pmlan_adapter pmadapter,
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_ds_11n_cfg *cfg = MNULL;
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
ENTER();
cfg = (mlan_ds_11n_cfg *)pioctl_req->pbuf;
if (pioctl_req->action == MLAN_ACT_SET) {
if (cfg->param.tx_buf_size == 0xffff) {
PRINTM(MIOCTL, "Send reconfigure tx buf to FW\n");
ret = wlan_prepare_cmd(pmpriv,
HostCmd_CMD_RECONFIGURE_TX_BUFF,
HostCmd_ACT_GEN_SET, 0,
(t_void *)pioctl_req,
&cfg->param.tx_buf_size);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
LEAVE();
return ret;
}
}
cfg->param.tx_buf_size = (t_u32)pmadapter->max_tx_buf_size;
pioctl_req->data_read_written = sizeof(t_u32) + MLAN_SUB_COMMAND_SIZE;
@ -398,7 +392,6 @@ void wlan_11n_send_delba_to_peer(mlan_private *priv, t_u8 *ra)
MLAN_MAC_ADDR_LENGTH)) {
PRINTM(MIOCTL, "Tx:Send delba to tid=%d, " MACSTR "\n",
ptx_tbl->tid, MAC2STR(ptx_tbl->ra));
ptx_tbl->ba_status = BA_STREAM_SENT_DELBA;
wlan_send_delba(priv, MNULL, ptx_tbl->tid, ptx_tbl->ra,
1);
}
@ -470,7 +463,6 @@ static void wlan_11n_update_addba_request(mlan_private *priv)
}
while (ptx_tbl != (TxBAStreamTbl *)&priv->tx_ba_stream_tbl_ptr) {
ptx_tbl->ba_status = BA_STREAM_SETUP_SENT_ADDBA;
wlan_send_addba(priv, ptx_tbl->tid, ptx_tbl->ra);
ptx_tbl = ptx_tbl->pnext;
}
@ -761,8 +753,6 @@ static mlan_status wlan_send_delba_to_entry_in_txbastream_tbl(
!memcmp(pmadapter, peer_address,
tx_ba_stream_tbl_ptr->ra,
MLAN_MAC_ADDR_LENGTH))) {
tx_ba_stream_tbl_ptr->ba_status =
BA_STREAM_SENT_DELBA;
if (last_tx_ba_to_delete &&
(tx_ba_stream_tbl_ptr ==
last_tx_ba_to_delete))
@ -1026,8 +1016,6 @@ static void wlan_send_delba_txbastream_tbl(pmlan_private priv, t_u8 tid)
PRINTM(MIOCTL,
"Tx:Send delba to tid=%d, " MACSTR "\n",
tid, MAC2STR(tx_ba_stream_tbl_ptr->ra));
tx_ba_stream_tbl_ptr->ba_status =
BA_STREAM_SENT_DELBA;
wlan_release_ralist_lock(priv);
wlan_send_delba(priv, MNULL,
tx_ba_stream_tbl_ptr->tid,
@ -1071,7 +1059,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 || sta_ptr->is_11ax_enabled)
if (sta_ptr->is_11n_enabled)
sta_ptr->ampdu_sta[i] =
priv->aggr_prio_tbl[i].ampdu_user;
}
@ -1254,8 +1242,7 @@ 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) &&
pmadapter->init_para.mcs32 == 1)
pmpriv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS))
SETHT_MCS32(mcs_set);
cfg = (mlan_ds_11n_cfg *)pioctl_req->pbuf;
@ -1532,12 +1519,14 @@ void wlan_fill_ht_cap_tlv(mlan_private *priv, MrvlIETypes_HTCap_t *pht_cap,
/* Set ampdu param */
SETAMPDU_SIZE(pht_cap->ht_cap.ampdu_param, AMPDU_FACTOR_64K);
SETAMPDU_SPACING(pht_cap->ht_cap.ampdu_param,
pmadapter->hw_mpdu_density);
SETAMPDU_SPACING(pht_cap->ht_cap.ampdu_param, 0);
rx_mcs_supp = GET_RXMCSSUPP(priv->usr_dev_mcs_support);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if (IS_CARD9098(pmadapter->card_type) ||
IS_CARDIW624(pmadapter->card_type) ||
IS_CARDNW62X(pmadapter->card_type) ||
IS_CARD9097(pmadapter->card_type)) {
if (bands & BAND_A)
rx_mcs_supp = MIN(
@ -1548,6 +1537,7 @@ void wlan_fill_ht_cap_tlv(mlan_private *priv, MrvlIETypes_HTCap_t *pht_cap,
MIN(rx_mcs_supp,
GET_RXMCSSUPP(pmadapter->user_htstream));
}
#endif
memset(pmadapter, (t_u8 *)pht_cap->ht_cap.supported_mcs_set, 0xff,
rx_mcs_supp);
/* Clear all the other values to get the minimum mcs set btw STA and AP
@ -1560,8 +1550,7 @@ 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) &&
pmadapter->init_para.mcs32 == 1)
priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS))
SETHT_MCS32(pht_cap->ht_cap.supported_mcs_set);
/* Clear RD responder bit */
@ -1609,8 +1598,11 @@ void wlan_fill_ht_cap_ie(mlan_private *priv, IEEEtypes_HTCap_t *pht_cap,
SETAMPDU_SPACING(pht_cap->ht_cap.ampdu_param, 0);
rx_mcs_supp = GET_RXMCSSUPP(priv->usr_dev_mcs_support);
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
if (IS_CARD9098(pmadapter->card_type) ||
IS_CARDIW624(pmadapter->card_type) ||
IS_CARDNW62X(pmadapter->card_type) ||
IS_CARD9097(pmadapter->card_type)) {
if (bands & BAND_A)
rx_mcs_supp = MIN(
@ -1621,6 +1613,7 @@ void wlan_fill_ht_cap_ie(mlan_private *priv, IEEEtypes_HTCap_t *pht_cap,
MIN(rx_mcs_supp,
GET_RXMCSSUPP(pmadapter->user_htstream));
}
#endif
memset(pmadapter, (t_u8 *)pht_cap->ht_cap.supported_mcs_set, 0xff,
rx_mcs_supp);
/* Clear all the other values to get the minimum mcs set btw STA and AP
@ -1633,8 +1626,7 @@ 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) &&
pmadapter->init_para.mcs32 == 1)
priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS))
SETHT_MCS32(pht_cap->ht_cap.supported_mcs_set);
/* Clear RD responder bit */
@ -1760,12 +1752,8 @@ mlan_status wlan_ret_11n_delba(mlan_private *priv, HostCmd_DS_COMMAND *resp)
ptx_ba_tbl = wlan_11n_get_txbastream_status(
priv, BA_STREAM_SETUP_INPROGRESS);
wlan_release_ralist_lock(priv);
if (ptx_ba_tbl) {
/* mark this txba stream as waiting addba resp, in case
* we send duplicate addba req command */
ptx_ba_tbl->ba_status = BA_STREAM_SETUP_SENT_ADDBA;
if (ptx_ba_tbl)
wlan_send_addba(priv, ptx_ba_tbl->tid, ptx_ba_tbl->ra);
}
} else { /*
* In case of failure, recreate
* the deleted stream in case
@ -1773,11 +1761,11 @@ mlan_status wlan_ret_11n_delba(mlan_private *priv, HostCmd_DS_COMMAND *resp)
*/
if (INITIATOR_BIT(pdel_ba->del_ba_param_set)) {
wlan_request_ralist_lock(priv);
wlan_11n_set_txbastream_status(priv, tid,
pdel_ba->peer_mac_addr,
BA_STREAM_SETUP_COMPLETE,
MFALSE);
if (!wlan_11n_get_txbastream_tbl(
priv, tid, pdel_ba->peer_mac_addr, MFALSE))
wlan_11n_create_txbastream_tbl(
priv, pdel_ba->peer_mac_addr, tid,
BA_STREAM_SETUP_INPROGRESS);
ptx_ba_tbl = wlan_11n_get_txbastream_status(
priv, BA_STREAM_SETUP_INPROGRESS);
wlan_release_ralist_lock(priv);
@ -1876,27 +1864,12 @@ mlan_status wlan_ret_11n_addba_req(mlan_private *priv, HostCmd_DS_COMMAND *resp)
BA_STREAM_NOT_ALLOWED;
} else {
t_u8 event_buf[256];
mlan_event *pevent = (mlan_event *)event_buf;
addba_timeout_event *evtbuf =
(addba_timeout_event *)pevent->event_buf;
if (ra_list) {
ra_list->packet_count = 0;
ra_list->ba_packet_threshold =
wlan_get_random_ba_threshold(
priv->adapter);
}
memset(priv->adapter, event_buf, 0x00,
sizeof(event_buf));
pevent->bss_index = priv->bss_index;
pevent->event_id = MLAN_EVENT_ID_DRV_ADDBA_TIMEOUT;
pevent->event_len = sizeof(addba_timeout_event);
memcpy_ext(priv->adapter, evtbuf->peer_mac_addr,
padd_ba_rsp->peer_mac_addr,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
evtbuf->tid = tid;
wlan_recv_event(priv, MLAN_EVENT_ID_DRV_ADDBA_TIMEOUT,
pevent);
}
}
@ -2895,58 +2868,6 @@ TxBAStreamTbl *wlan_11n_get_txbastream_tbl(mlan_private *priv, int tid,
return MNULL;
}
/**
* @brief This function will set ba_status txbastream entry with
* given RA/TID.
*
* @param priv A pointer to mlan_private
* @param ra RA to find in txbastream
* @param tid TID to find in txbastream
* @param ba_status BA stream status
*
* @return N/A
*/
void wlan_11n_set_txbastream_status(mlan_private *priv, int tid, t_u8 *ra,
baStatus_e ba_status, int lock)
{
TxBAStreamTbl *ptx_tbl;
pmlan_adapter pmadapter = priv->adapter;
ENTER();
if (lock)
wlan_request_ralist_lock(priv);
ptx_tbl = (TxBAStreamTbl *)util_peek_list(pmadapter->pmoal_handle,
&priv->tx_ba_stream_tbl_ptr,
MNULL, MNULL);
if (!ptx_tbl) {
if (lock)
wlan_release_ralist_lock(priv);
LEAVE();
return;
}
while (ptx_tbl != (TxBAStreamTbl *)&priv->tx_ba_stream_tbl_ptr) {
PRINTM(MDAT_D, "get_txbastream_tbl TID %d\n", ptx_tbl->tid);
DBG_HEXDUMP(MDAT_D, "RA", ptx_tbl->ra, MLAN_MAC_ADDR_LENGTH);
if ((!memcmp(pmadapter, ptx_tbl->ra, ra,
MLAN_MAC_ADDR_LENGTH)) &&
(ptx_tbl->tid == tid)) {
ptx_tbl->ba_status = ba_status;
if (lock)
wlan_release_ralist_lock(priv);
LEAVE();
return;
}
ptx_tbl = ptx_tbl->pnext;
}
if (lock)
wlan_release_ralist_lock(priv);
LEAVE();
return;
}
/**
* @brief This function will create a entry in tx ba stream table for the
* given RA/TID.
@ -2973,7 +2894,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 | MLAN_MEM_FLAG_ATOMIC, (t_u8 **)&new_node)) {
MLAN_MEM_DEF, (t_u8 **)&new_node)) {
PRINTM(MERROR,
"wlan_11n_create_txbastream_tbl Failed to allocate new_node\n");
LEAVE();
@ -3016,8 +2937,8 @@ int wlan_send_addba(mlan_private *priv, int tid, t_u8 *peer_mac)
ENTER();
PRINTM(MCMND, "Send addba: TID %d, " MACSTR "\n", tid,
MAC2STR(peer_mac));
PRINTM(MCMND, "Send addba: TID %d\n", tid);
DBG_HEXDUMP(MCMD_D, "Send addba RA", peer_mac, MLAN_MAC_ADDR_LENGTH);
add_ba_req.block_ack_param_set = (t_u16)(
(tid << BLOCKACKPARAM_TID_POS) |
@ -3065,9 +2986,6 @@ int wlan_send_delba(mlan_private *priv, pmlan_ioctl_req pioctl_req, int tid,
ENTER();
PRINTM(MCMND, "Send delba: TID %d initiator=%d, " MACSTR "\n", tid,
initiator, MAC2STR(peer_mac));
memset(priv->adapter, &delba, 0, sizeof(delba));
delba.del_ba_param_set = (tid << DELBA_TID_POS);

View file

@ -8,18 +8,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -87,10 +96,6 @@ void wlan_11n_deleteall_txbastream_tbl(mlan_private *priv);
/** Get Tx BA stream table */
TxBAStreamTbl *wlan_11n_get_txbastream_tbl(mlan_private *priv, int tid,
t_u8 *ra, int lock);
/** Set Tx BA stream table BA status */
void wlan_11n_set_txbastream_status(mlan_private *priv, int tid, t_u8 *ra,
baStatus_e ba_status, int lock);
/** Create Tx BA stream table */
void wlan_11n_create_txbastream_tbl(mlan_private *priv, t_u8 *ra, int tid,
baStatus_e ba_status);
@ -380,14 +385,14 @@ static INLINE t_u8 wlan_find_stream_to_delete(mlan_private *priv,
tid = priv->aggr_prio_tbl[ptr_tid].ampdu_user;
while (ptx_tbl != (TxBAStreamTbl *)&priv->tx_ba_stream_tbl_ptr) {
if ((ptx_tbl->ba_status == BA_STREAM_SETUP_COMPLETE) &&
(tid > priv->aggr_prio_tbl[ptx_tbl->tid].ampdu_user)) {
if (tid > priv->aggr_prio_tbl[ptx_tbl->tid].ampdu_user) {
tid = priv->aggr_prio_tbl[ptx_tbl->tid].ampdu_user;
*ptid = ptx_tbl->tid;
memcpy_ext(priv->adapter, ra, ptx_tbl->ra,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
ret = MTRUE;
}
ptx_tbl = ptx_tbl->pnext;
}
LEAVE();

View file

@ -5,18 +5,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -120,6 +129,8 @@ static void wlan_11n_form_amsdu_txpd(mlan_private *priv, mlan_buffer *mbuf)
* Original priority has been overwritten
*/
ptx_pd->priority = (t_u8)mbuf->priority;
ptx_pd->pkt_delay_2ms =
wlan_wmm_compute_driver_packet_delay(priv, mbuf);
ptx_pd->bss_num = GET_BSS_NUM(priv);
ptx_pd->bss_type = priv->bss_type;
/* Always zero as the data is followed by TxPD */
@ -154,9 +165,6 @@ static INLINE void wlan_11n_update_pktlen_amsdu_txpd(mlan_private *priv,
ptx_pd = (TxPD *)mbuf->pbuf;
ptx_pd->tx_pkt_length =
(t_u16)wlan_cpu_to_le16(mbuf->data_len - sizeof(TxPD));
ptx_pd->pkt_delay_2ms =
wlan_wmm_compute_driver_packet_delay(priv, mbuf);
#ifdef STA_SUPPORT
if ((GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_STA) &&
(priv->adapter->pps_uapsd_mode)) {
@ -475,9 +483,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 | MOAL_MEM_FLAG_ATOMIC);
pmbuf_aggr = wlan_alloc_mlan_buffer(pmadapter,
pmadapter->tx_buf_size, 0,
MOAL_MALLOC_BUFFER);
if (!pmbuf_aggr) {
PRINTM(MERROR, "Error allocating mlan_buffer\n");
pmadapter->callbacks.moal_spin_unlock(
@ -495,8 +503,6 @@ int wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
pmbuf_aggr->data_offset = 0;
pmbuf_aggr->in_ts_sec = pmbuf_src->in_ts_sec;
pmbuf_aggr->in_ts_usec = pmbuf_src->in_ts_usec;
pmbuf_aggr->extra_ts_sec = pmbuf_src->extra_ts_sec;
pmbuf_aggr->extra_ts_usec = pmbuf_src->extra_ts_usec;
if (pmbuf_src->flags & MLAN_BUF_FLAG_TDLS)
pmbuf_aggr->flags |= MLAN_BUF_FLAG_TDLS;
if (pmbuf_src->flags & MLAN_BUF_FLAG_TCP_ACK)
@ -525,7 +531,7 @@ int wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
/* Collects TP statistics */
if (pmadapter->tp_state_on && (pkt_size > sizeof(TxPD)))
pmadapter->callbacks.moal_tp_accounting(
pmadapter->pmoal_handle, pmbuf_src, 3);
pmadapter->pmoal_handle, pmbuf_src->pdesc, 3);
pra_list->total_pkts--;
/* decrement for every PDU taken from the list */
@ -673,5 +679,5 @@ int wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
exit:
LEAVE();
return MIN((pkt_size + headroom), INT_MAX);
return pkt_size + headroom;
}

View file

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/

View file

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -134,13 +143,13 @@ static mlan_status wlan_11n_dispatch_pkt(t_void *priv, t_void *payload,
static void mlan_11n_rxreorder_timer_restart(pmlan_adapter pmadapter,
RxReorderTbl *rx_reor_tbl_ptr)
{
t_u16 min_flush_time = pmadapter->flush_time_ac_be_bk;
mlan_wmm_ac_e wmm_ac;
t_u16 min_flush_time = 0;
ENTER();
wmm_ac = wlan_wmm_convert_tos_to_ac(pmadapter, rx_reor_tbl_ptr->tid);
if ((WMM_AC_VI == wmm_ac) || (WMM_AC_VO == wmm_ac))
min_flush_time = pmadapter->flush_time_ac_vi_vo;
if (rx_reor_tbl_ptr->win_size >= 32)
min_flush_time = MIN_FLUSH_TIMER_15_MS;
else
min_flush_time = MIN_FLUSH_TIMER_MS;
if (rx_reor_tbl_ptr->timer_context.timer_is_set)
pmadapter->callbacks.moal_stop_timer(
@ -149,7 +158,7 @@ static void mlan_11n_rxreorder_timer_restart(pmlan_adapter pmadapter,
pmadapter->callbacks.moal_start_timer(
pmadapter->pmoal_handle, rx_reor_tbl_ptr->timer_context.timer,
MFALSE, min_flush_time);
MFALSE, (rx_reor_tbl_ptr->win_size * min_flush_time));
rx_reor_tbl_ptr->timer_context.timer_is_set = MTRUE;
LEAVE();
@ -168,7 +177,7 @@ static void mlan_11n_rxreorder_timer_restart(pmlan_adapter pmadapter,
static mlan_status wlan_11n_dispatch_pkt_until_start_win(
t_void *priv, RxReorderTbl *rx_reor_tbl_ptr, int start_win)
{
t_u32 no_pkt_to_send, i, xchg;
int no_pkt_to_send, i, xchg;
mlan_status ret = MLAN_STATUS_SUCCESS;
void *rx_tmp_ptr = MNULL;
mlan_private *pmpriv = (mlan_private *)priv;
@ -208,9 +217,6 @@ static mlan_status wlan_11n_dispatch_pkt_until_start_win(
rx_reor_tbl_ptr->rx_reorder_ptr[no_pkt_to_send + i] = MNULL;
}
/* clear the bits of reorder bitmap that has been dispatched */
rx_reor_tbl_ptr->bitmap = rx_reor_tbl_ptr->bitmap >> no_pkt_to_send;
rx_reor_tbl_ptr->start_win = start_win;
pmpriv->adapter->callbacks.moal_spin_unlock(
pmpriv->adapter->pmoal_handle, pmpriv->rx_pkt_lock);
@ -289,9 +295,6 @@ static mlan_status wlan_11n_scan_and_dispatch(t_void *priv,
}
}
/* clear the bits of reorder bitmap that has been dispatched */
rx_reor_tbl_ptr->bitmap = rx_reor_tbl_ptr->bitmap >> i;
rx_reor_tbl_ptr->start_win =
(rx_reor_tbl_ptr->start_win + i) & (MAX_TID_VALUE - 1);
@ -523,8 +526,6 @@ static t_void wlan_11n_create_rxreorder_tbl(mlan_private *priv, t_u8 *ta,
new_node->win_size = win_size;
new_node->force_no_drop = MFALSE;
new_node->check_start_win = MTRUE;
new_node->bitmap = 0;
new_node->ba_status = BA_STREAM_SETUP_INPROGRESS;
for (i = 0; i < win_size; ++i)
new_node->rx_reorder_ptr[i] = MNULL;
@ -622,62 +623,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];
}
/**
* @brief This function handles the command response of
* delete a block ack request
*
* @param priv A pointer to mlan_private structure
* @param addba A pointer to addba buffer
*
* @return N/A
*/
mlan_status wlan_11n_add_bastream(mlan_private *priv, t_u8 *addba)
{
HostCmd_DS_11N_ADDBA_REQ *pevt_addba_req =
(HostCmd_DS_11N_ADDBA_REQ *)addba;
RxReorderTbl *rx_reor_tbl_ptr = MNULL;
t_u16 block_ack_param_set;
mlan_status ret = MLAN_STATUS_SUCCESS;
int tid;
ENTER();
DBG_HEXDUMP(MCMD_D, "addba req", (t_u8 *)addba,
sizeof(HostCmd_DS_11N_ADDBA_REQ));
if (priv->adapter->scan_processing) {
PRINTM(MERROR,
"Scan in progress, ignore ADDBA Request event\n");
LEAVE();
return ret;
}
block_ack_param_set =
wlan_le16_to_cpu(pevt_addba_req->block_ack_param_set);
tid = (block_ack_param_set & BLOCKACKPARAM_TID_MASK) >>
BLOCKACKPARAM_TID_POS;
rx_reor_tbl_ptr = wlan_11n_get_rxreorder_tbl(
priv, tid, pevt_addba_req->peer_mac_addr);
if (rx_reor_tbl_ptr &&
(rx_reor_tbl_ptr->ba_status != BA_STREAM_SETUP_COMPLETE)) {
PRINTM(MCMND,
"BA setup in progress, ignore ADDBA Request event\n");
LEAVE();
return ret;
}
ret = wlan_prepare_cmd(priv, HostCmd_CMD_11N_ADDBA_RSP,
HostCmd_ACT_GEN_SET, 0, MNULL, addba);
LEAVE();
return ret;
}
/**
* @brief This function prepares command for adding a block ack
* response.
@ -696,7 +645,7 @@ mlan_status wlan_cmd_11n_addba_rspgen(mlan_private *priv,
HostCmd_DS_11N_ADDBA_REQ *pevt_addba_req =
(HostCmd_DS_11N_ADDBA_REQ *)pdata_buf;
t_u8 tid = 0;
t_u32 win_size = 0;
int win_size = 0;
ENTER();
@ -741,26 +690,21 @@ mlan_status wlan_cmd_11n_addba_rspgen(mlan_private *priv,
else
padd_ba_rsp->status_code =
wlan_cpu_to_le16(ADDBA_RSP_STATUS_ACCEPT);
win_size = (padd_ba_rsp->block_ack_param_set &
BLOCKACKPARAM_WINSIZE_MASK) >>
BLOCKACKPARAM_WINSIZE_POS;
padd_ba_rsp->block_ack_param_set &= ~BLOCKACKPARAM_WINSIZE_MASK;
if (!priv->add_ba_param.rx_amsdu)
/* We do not support AMSDU inside AMPDU, hence reset the bit */
padd_ba_rsp->block_ack_param_set &=
~BLOCKACKPARAM_AMSDU_SUPP_MASK;
/*cert failure observed due to BA setup failure
if win_size requested from client is 0 */
if (win_size)
win_size = MIN(win_size, priv->add_ba_param.rx_win_size);
else
win_size = priv->add_ba_param.rx_win_size;
padd_ba_rsp->block_ack_param_set |=
(priv->add_ba_param.rx_win_size << BLOCKACKPARAM_WINSIZE_POS);
win_size = (padd_ba_rsp->block_ack_param_set &
BLOCKACKPARAM_WINSIZE_MASK) >>
BLOCKACKPARAM_WINSIZE_POS;
padd_ba_rsp->block_ack_param_set |= win_size
<< BLOCKACKPARAM_WINSIZE_POS;
if (win_size == 0)
padd_ba_rsp->status_code =
wlan_cpu_to_le16(ADDBA_RSP_STATUS_DECLINED);
padd_ba_rsp->block_ack_param_set =
wlan_cpu_to_le16(padd_ba_rsp->block_ack_param_set);
@ -854,11 +798,6 @@ mlan_status mlan_11n_rxreorder_pkt(void *priv, t_u16 seq_num, t_u16 tid,
PRINTM(MDAT_D, "AMSDU ");
if (rx_reor_tbl_ptr->check_start_win) {
PRINTM(MDAT_D,
"0:seq_num %d start_win %d win_size %d last_seq %d\n",
seq_num, rx_reor_tbl_ptr->start_win,
rx_reor_tbl_ptr->win_size,
rx_reor_tbl_ptr->last_seq);
if (seq_num == rx_reor_tbl_ptr->start_win)
rx_reor_tbl_ptr->check_start_win = MFALSE;
else {
@ -1026,8 +965,6 @@ mlan_status mlan_11n_rxreorder_pkt(void *priv, t_u16 seq_num, t_u16 tid,
rx_reor_tbl_ptr
->rx_reorder_ptr[seq_num - start_win] =
payload;
MLAN_SET_BIT(rx_reor_tbl_ptr->bitmap,
seq_num - start_win);
} else { /* Wrap condition */
if (rx_reor_tbl_ptr
->rx_reorder_ptr[(seq_num +
@ -1041,9 +978,6 @@ mlan_status mlan_11n_rxreorder_pkt(void *priv, t_u16 seq_num, t_u16 tid,
->rx_reorder_ptr[(seq_num +
(MAX_TID_VALUE)) -
start_win] = payload;
MLAN_SET_BIT(rx_reor_tbl_ptr->bitmap,
(seq_num + (MAX_TID_VALUE)) -
start_win);
}
}
@ -1059,20 +993,11 @@ mlan_status mlan_11n_rxreorder_pkt(void *priv, t_u16 seq_num, t_u16 tid,
}
done:
if (rx_reor_tbl_ptr->bitmap == 0) {
if (rx_reor_tbl_ptr->timer_context.timer_is_set) {
pmadapter->callbacks.moal_stop_timer(
pmadapter->pmoal_handle,
rx_reor_tbl_ptr->timer_context.timer);
rx_reor_tbl_ptr->timer_context.timer_is_set = MFALSE;
}
} else {
if (!rx_reor_tbl_ptr->timer_context.timer_is_set ||
(prev_start_win != rx_reor_tbl_ptr->start_win)) {
mlan_11n_rxreorder_timer_restart(pmadapter,
rx_reor_tbl_ptr);
}
if (!rx_reor_tbl_ptr->timer_context.timer_is_set ||
(prev_start_win != rx_reor_tbl_ptr->start_win)) {
mlan_11n_rxreorder_timer_restart(pmadapter, rx_reor_tbl_ptr);
}
LEAVE();
return ret;
}
@ -1107,7 +1032,7 @@ void mlan_11n_delete_bastream_tbl(mlan_private *priv, int tid, t_u8 *peer_mac,
cleanup_rx_reorder_tbl = (initiator) ? MFALSE : MTRUE;
PRINTM(MEVENT,
"delete_bastream_tbl: " MACSTR " tid=%d, type=%d "
"delete_bastream_tbl: " MACSTR " tid=%d, type=%d"
"initiator=%d reason=%d\n",
MAC2STR(peer_mac), tid, type, initiator, reason_code);
@ -1142,13 +1067,14 @@ void mlan_11n_delete_bastream_tbl(mlan_private *priv, int tid, t_u8 *peer_mac,
ra_list->del_ba_count = 0;
else
ra_list->del_ba_count++;
}
ra_list->packet_count = 0;
ra_list->packet_count = 0;
/** after delba, we will try to set up BA again after sending 1k packets*/
#define MIN_BA_SETUP_PACKET_REQIRED 1024
ra_list->ba_packet_threshold =
MIN_BA_SETUP_PACKET_REQIRED +
wlan_get_random_ba_threshold(priv->adapter);
ra_list->ba_packet_threshold =
MIN_BA_SETUP_PACKET_REQIRED +
wlan_get_random_ba_threshold(
priv->adapter);
}
}
}
@ -1235,19 +1161,11 @@ void wlan_11n_ba_stream_timeout(mlan_private *priv,
HostCmd_DS_11N_BATIMEOUT *event)
{
HostCmd_DS_11N_DELBA delba;
mlan_status ret = MLAN_STATUS_SUCCESS;
ENTER();
DBG_HEXDUMP(MCMD_D, "Event:", (t_u8 *)event, 20);
if (event->origninator &&
!wlan_11n_get_txbastream_tbl(priv, event->tid, event->peer_mac_addr,
MFALSE)) {
LEAVE();
return;
}
memset(priv->adapter, &delba, 0, sizeof(HostCmd_DS_11N_DELBA));
memcpy_ext(priv->adapter, delba.peer_mac_addr, event->peer_mac_addr,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
@ -1256,10 +1174,7 @@ void wlan_11n_ba_stream_timeout(mlan_private *priv,
delba.del_ba_param_set |= (t_u16)event->origninator
<< DELBA_INITIATOR_POS;
delba.reason_code = REASON_CODE_STA_TIMEOUT;
ret = wlan_prepare_cmd(priv, HostCmd_CMD_11N_DELBA, 0, 0, MNULL,
&delba);
if (ret)
PRINTM(MERROR, "Failed to send cmd to FW\n");
wlan_prepare_cmd(priv, HostCmd_CMD_11N_DELBA, 0, 0, MNULL, &delba);
LEAVE();
return;
@ -1506,7 +1421,6 @@ 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;
@ -1536,9 +1450,7 @@ 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;
@ -1549,8 +1461,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 (j = 0; j < MAX_NUM_TID; j++)
wlan_11n_delba(priv, j);
for (i = 0; i < MAX_NUM_TID; i++)
wlan_11n_delba(priv, i);
wlan_recv_event(
priv,
MLAN_EVENT_ID_DRV_DEFER_HANDLING,

View file

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -82,7 +91,6 @@ mlan_status mlan_11n_rxreorder_pkt(void *priv, t_u16 seqNum, t_u16 tid,
void mlan_11n_delete_bastream_tbl(mlan_private *priv, int tid,
t_u8 *PeerMACAddr, t_u8 type, int initiator,
t_u16 reason_code);
mlan_status wlan_11n_add_bastream(mlan_private *priv, t_u8 *addba);
void wlan_11n_ba_stream_timeout(mlan_private *priv,
HostCmd_DS_11N_BATIMEOUT *event);
mlan_status wlan_ret_11n_addba_resp(mlan_private *priv,

View file

@ -5,20 +5,29 @@
* related code
*
*
* Copyright 2009-2023 NXP
* Copyright 2009-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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -32,7 +41,6 @@
#include "mlan_fw.h"
#include "mlan_join.h"
#include "mlan_main.h"
#include "mlan_11h.h"
/********************************************************
* Local Variables
@ -88,7 +96,7 @@ static country_code_mapping_t country_code_mapping[] = {
{"IN", 0x10, 0x06}, /* India */
{"MY", 0x30, 0x06}, /* Malaysia */
{"NZ", 0x30, 0x30}, /* New Zeland */
{"MX", 0x30, 0x07}, /* Mexico */
{"MX", 0x10, 0x07}, /* Mexico */
};
/** Country code for ETSI */
@ -160,8 +168,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, {0x1c, 0, 0}},
{13, 2472, 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}}};
/** Band: 'B/G', Region: Japan */
static chan_freq_power_t channel_freq_power_JPN41_BG[] = {
@ -176,8 +184,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, {0x1c, 0, 0}},
{13, 2472, 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}}};
/** Band: 'B/G', Region: Japan */
static chan_freq_power_t channel_freq_power_JPN40_BG[] = {
@ -212,8 +220,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, {0x1c, 0, 0}},
{13, 2472, 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}}};
/** Band : 'B/G', Region: Special */
static chan_freq_power_t channel_freq_power_SPECIAL_BG[] = {
@ -228,9 +236,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, {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}}};
{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}}};
/**
* The 2.4GHz CFP tables
@ -398,7 +406,6 @@ static chan_freq_power_t channel_freq_power_EU_A[] = {
{132, 5660, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}},
{136, 5680, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}},
{140, 5700, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}},
{144, 5720, WLAN_TX_PWR_EMEA_DEFAULT, MTRUE, {0x13, 0, 0}},
{149, 5745, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{153, 5765, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
{157, 5785, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x10, 0, 0}},
@ -580,10 +587,10 @@ static chan_freq_power_t channel_freq_power_low_middle_high_band[] = {
{40, 5200, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{44, 5220, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{48, 5240, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{52, 5260, WLAN_TX_PWR_DEFAULT, MTRUE, {0x10, 0, 0}},
{56, 5280, WLAN_TX_PWR_DEFAULT, MTRUE, {0x10, 0, 0}},
{60, 5300, WLAN_TX_PWR_DEFAULT, MTRUE, {0x10, 0, 0}},
{64, 5320, WLAN_TX_PWR_DEFAULT, MTRUE, {0x10, 0, 0}},
{52, 5260, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{56, 5280, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{60, 5300, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{64, 5320, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{149, 5745, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{153, 5765, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
{157, 5785, WLAN_TX_PWR_DEFAULT, MFALSE, {0x10, 0, 0}},
@ -2448,6 +2455,9 @@ static oper_bw_chan *wlan_get_nonglobal_operclass_table(mlan_private *pmpriv,
poper_bw_chan = oper_bw_chan_eu;
*arraysize = sizeof(oper_bw_chan_eu);
break;
default:
PRINTM(MERROR, "Country not support!\n");
break;
}
LEAVE();
@ -2460,12 +2470,11 @@ static oper_bw_chan *wlan_get_nonglobal_operclass_table(mlan_private *pmpriv,
* @param pmpriv A pointer to mlan_private structure
* @param channel Channel number
* @param oper_class operating class
* @param bandwidth band width
*
* @return MLAN_STATUS_PENDING --success, otherwise fail
*/
mlan_status wlan_check_operclass_validation(mlan_private *pmpriv, t_u8 channel,
t_u8 oper_class, t_u8 bandwidth)
t_u8 oper_class)
{
int arraysize = 0, i = 0, channum = 0;
oper_bw_chan *poper_bw_chan = MNULL;
@ -2488,7 +2497,7 @@ mlan_status wlan_check_operclass_validation(mlan_private *pmpriv, t_u8 channel,
}
if (oper_class >= 128) {
center_freq_idx = wlan_get_center_freq_idx(
pmpriv, BAND_5GHZ, channel, CHANNEL_BW_80MHZ);
pmpriv, BAND_AAC, channel, CHANNEL_BW_80MHZ);
channel = center_freq_idx;
}
poper_bw_chan = wlan_get_nonglobal_operclass_table(pmpriv, &arraysize);
@ -2558,7 +2567,7 @@ mlan_status wlan_get_curr_oper_class(mlan_private *pmpriv, t_u8 channel,
}
if (bw == BW_80MHZ) {
center_freq_idx = wlan_get_center_freq_idx(
pmpriv, BAND_5GHZ, channel, CHANNEL_BW_80MHZ);
pmpriv, BAND_AAC, channel, CHANNEL_BW_80MHZ);
channel = center_freq_idx;
}
@ -2579,7 +2588,7 @@ mlan_status wlan_get_curr_oper_class(mlan_private *pmpriv, t_u8 channel,
}
}
PRINTM(MCMND, "Operating class not found!\n");
PRINTM(MCMND, "Operating class not find!\n");
LEAVE();
return MLAN_STATUS_FAILURE;
}
@ -2596,16 +2605,14 @@ mlan_status wlan_get_curr_oper_class(mlan_private *pmpriv, t_u8 channel,
int wlan_add_supported_oper_class_ie(mlan_private *pmpriv, t_u8 **pptlv_out,
t_u8 curr_oper_class)
{
t_u8 oper_class_us[] = {115, 118, 124, 121, 125, 81, 116,
119, 122, 126, 126, 117, 120, 123,
127, 127, 83, 84, 128, 129, 130};
t_u8 oper_class_eu[] = {115, 118, 121, 81, 116, 119, 122, 117,
120, 123, 83, 84, 125, 128, 129, 130};
t_u8 oper_class_jp[] = {115, 81, 82, 118, 118, 121, 121, 116,
119, 119, 122, 122, 117, 120, 120, 123,
123, 83, 84, 121, 128, 129, 130};
t_u8 oper_class_cn[] = {115, 118, 125, 116, 119, 126,
81, 83, 84, 128, 129, 130};
t_u8 oper_class_us[] = {1, 2, 3, 4, 5, 12, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 128, 129, 130};
t_u8 oper_class_eu[] = {1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 17, 128, 129, 130};
t_u8 oper_class_jp[] = {1, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44,
45, 56, 57, 58, 128, 129, 130};
t_u8 oper_class_cn[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 128, 129, 130};
t_u8 country_code[][COUNTRY_CODE_LEN] = {"US", "JP", "CN"};
int country_id = 0, ret = 0;
MrvlIETypes_SuppOperClass_t *poper_class = MNULL;
@ -2715,12 +2722,11 @@ mlan_status wlan_set_regiontable(mlan_private *pmpriv, t_u8 region, t_u16 band)
if ((j < MAX_REGION_CHANNEL_NUM) &&
(region_chan_old[j].valid == MTRUE)) {
wlan_cfp_copy_dynamic(pmadapter, cfp, (t_u8)cfp_no,
wlan_cfp_copy_dynamic(pmadapter, cfp, cfp_no,
region_chan_old[j].pcfp,
region_chan_old[j].num_cfp);
} else if (cfp) {
wlan_cfp_copy_dynamic(pmadapter, cfp, (t_u8)cfp_no,
MNULL, 0);
wlan_cfp_copy_dynamic(pmadapter, cfp, cfp_no, MNULL, 0);
}
i++;
}
@ -2748,12 +2754,11 @@ mlan_status wlan_set_regiontable(mlan_private *pmpriv, t_u8 region, t_u16 band)
break;
}
if ((j < MAX_REGION_CHANNEL_NUM) && region_chan_old[j].valid) {
wlan_cfp_copy_dynamic(pmadapter, cfp, (t_u8)cfp_no,
wlan_cfp_copy_dynamic(pmadapter, cfp, cfp_no,
region_chan_old[j].pcfp,
region_chan_old[j].num_cfp);
} else if (cfp) {
wlan_cfp_copy_dynamic(pmadapter, cfp, (t_u8)cfp_no,
MNULL, 0);
wlan_cfp_copy_dynamic(pmadapter, cfp, cfp_no, MNULL, 0);
}
i++;
}
@ -3105,41 +3110,6 @@ 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
*
@ -3369,49 +3339,27 @@ void wlan_add_fw_cfp_tables(pmlan_private pmpriv, t_u8 *buf, t_u16 buf_left)
break;
}
}
PRINTM(MCMND,
"OTP region: region_code=%d %c%c dfs_region=%d\n",
pmadapter->otp_region->region_code,
pmadapter->otp_region->country_code[0],
pmadapter->otp_region->country_code[1],
pmadapter->otp_region->dfs_region);
/* Update the region code and the country code in
* pmadapter
*/
pmadapter->region_code =
pmadapter->otp_region->region_code;
if (pmadapter->otp_region->force_reg) {
/* Region is enforced. Use FW country code only
*/
pmadapter->country_code[0] =
pmadapter->otp_region->country_code[0];
pmadapter->country_code[1] =
pmadapter->otp_region->country_code[1];
} else if (memcmp(pmadapter,
pmadapter->otp_region->country_code,
pmadapter->country_code,
COUNTRY_CODE_LEN - 1)) {
PRINTM(MERROR,
"FW country code %c%c does not match with %c%c\n",
pmadapter->otp_region->country_code[0],
pmadapter->otp_region->country_code[1],
pmadapter->country_code[0],
pmadapter->country_code[1]);
/* FW code mismatch, replace with the driver
* code */
pmadapter->otp_region->country_code[0] =
pmadapter->country_code[0];
pmadapter->otp_region->country_code[1] =
pmadapter->country_code[1];
}
pmadapter->country_code[0] =
pmadapter->otp_region->country_code[0];
pmadapter->country_code[1] =
pmadapter->otp_region->country_code[1];
pmadapter->country_code[2] = '\0';
pmadapter->domain_reg.country_code[0] =
pmadapter->otp_region->country_code[0];
pmadapter->domain_reg.country_code[1] =
pmadapter->otp_region->country_code[1];
pmadapter->domain_reg.country_code[2] = '\0';
PRINTM(MCMND,
"OTP region: region_code=%d %c%c dfs_region=%d\n",
pmadapter->otp_region->region_code,
pmadapter->country_code[0],
pmadapter->country_code[1],
pmadapter->otp_region->dfs_region);
pmadapter->cfp_code_bg =
pmadapter->otp_region->region_code;
pmadapter->cfp_code_a =
@ -3728,13 +3676,6 @@ mlan_status wlan_get_cfpinfo(pmlan_adapter pmadapter,
ret = MLAN_STATUS_FAILURE;
goto out;
}
ret = wlan_11h_ioctl_nop_channel_list(pmadapter, pioctl_req);
if (ret) {
PRINTM(MERROR,
"cfpinfo wlan_11h_ioctl_nop_channel_list failed!\n");
ret = MLAN_STATUS_FAILURE;
goto out;
}
/* Calculate the total response size required to return region,
* country codes, cfp tables and power tables
*/

File diff suppressed because it is too large Load diff

View file

@ -5,18 +5,27 @@
*
* 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -24,7 +33,7 @@
#define _MLAN_DECL_H_
/** MLAN release version */
#define MLAN_RELEASE_VERSION "408.p2"
#define MLAN_RELEASE_VERSION "322.p3"
/** Re-define generic data types for MLAN/MOAL */
/** Signed char (1-byte) */
@ -129,8 +138,13 @@ 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
@ -157,10 +171,6 @@ typedef t_s32 t_sval;
/** This is current limit on Maximum Rx AMPDU allowed */
#define MLAN_MAX_RX_BASTREAM_SUPPORTED 16
#ifndef UINT_MAX
#define UINT_MAX (~0U)
#endif
#ifdef STA_SUPPORT
/** Default Win size attached during ADDBA request */
#define MLAN_STA_AMPDU_DEF_TXWINSIZE 64
@ -266,17 +276,12 @@ typedef t_s32 t_sval;
#define FW_RELOAD_NO_EMULATION 2
/** out band reset with interface re-emulation */
#define FW_RELOAD_WITH_EMULATION 3
#ifdef PCIE
/** pcie card reset */
#define FW_RELOAD_PCIE_RESET 4
/** sdio hw reset */
#define FW_RELOAD_SDIO_HW_RESET 5
/** pcie inband reset */
#define FW_RELOAD_PCIE_INBAND_RESET 6
#ifdef PCIE
/* Interrupt type */
enum { RX_DATA, RX_EVENT, TX_COMPLETE, RX_CMD_RESP };
#endif
#define FW_RELOAD_SDIO_HW_RESET 5
#ifdef USB
#define MLAN_USB_BLOCK_SIZE (512)
#define MLAN_USB_AGGR_MODE_NUM (0)
@ -382,9 +387,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** 8801 card type */
#define CARD_TYPE_8801 0x0a
/** OWL card type */
#define CARD_TYPE_IW624 0x0b
/** Black bird card type */
#define CARD_TYPE_AW693 0x0c
#define CARD_TYPE_NW62X 0x0b
/** 9098 A0 reverion num */
#define CHIP_9098_REV_A0 1
@ -416,10 +419,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define CARD_TYPE_SD9177 (CARD_TYPE_9177 | (INTF_SD << 8))
/** SD8801 card type */
#define CARD_TYPE_SD8801 (CARD_TYPE_8801 | (INTF_SD << 8))
/** SD_IW624 card type */
#define CARD_TYPE_SDIW624 (CARD_TYPE_IW624 | (INTF_SD << 8))
/** SD_IW624 card type */
#define CARD_TYPE_SDAW693 (CARD_TYPE_AW693 | (INTF_SD << 8))
/** SD_NW62X card type */
#define CARD_TYPE_SDNW62X (CARD_TYPE_NW62X | (INTF_SD << 8))
#define IS_SD8887(ct) (CARD_TYPE_SD8887 == (ct))
#define IS_SD8897(ct) (CARD_TYPE_SD8897 == (ct))
@ -431,8 +432,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define IS_SD9098(ct) (CARD_TYPE_SD9098 == (ct))
#define IS_SD9177(ct) (CARD_TYPE_SD9177 == (ct))
#define IS_SD8801(ct) (CARD_TYPE_SD8801 == (ct))
#define IS_SDIW624(ct) (CARD_TYPE_SDIW624 == (ct))
#define IS_SDAW693(ct) (CARD_TYPE_SDAW693 == (ct))
#define IS_SDNW62X(ct) (CARD_TYPE_SDNW62X == (ct))
/** SD8887 Card */
#define CARD_SD8887 "SD8887"
@ -441,7 +441,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** SD8977 Card */
#define CARD_SD8977 "SD8977"
/** SD8978 Card */
#define CARD_SD8978 "SDIW416"
#define CARD_SD8978 "SD8978"
/** SD8997 Card */
#define CARD_SD8997 "SD8997"
/** SD8987 Card */
@ -451,13 +451,11 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** SD9098 Card */
#define CARD_SD9098 "SD9098"
/** SD9177 Card */
#define CARD_SD9177 "SDIW612"
#define CARD_SD9177 "SD9177"
/** SD8801 Card */
#define CARD_SD8801 "SD8801"
/** SDIW624 Card */
#define CARD_SDIW624 "SDIW624"
/** SDAW693 Card */
#define CARD_SDAW693 "SDAW693"
/** SDNW62X Card */
#define CARD_SDNW62X "SDNW62X"
#endif
#ifdef PCIE
@ -469,17 +467,14 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define CARD_TYPE_PCIE9097 (CARD_TYPE_9097 | (INTF_PCIE << 8))
/** PCIE9098 card type */
#define CARD_TYPE_PCIE9098 (CARD_TYPE_9098 | (INTF_PCIE << 8))
/** PCIEIW624 card type */
#define CARD_TYPE_PCIEIW624 (CARD_TYPE_IW624 | (INTF_PCIE << 8))
/** PCIEAW693 card type */
#define CARD_TYPE_PCIEAW693 (CARD_TYPE_AW693 | (INTF_PCIE << 8))
/** PCIENW62X card type */
#define CARD_TYPE_PCIENW62X (CARD_TYPE_NW62X | (INTF_PCIE << 8))
#define IS_PCIE8897(ct) (CARD_TYPE_PCIE8897 == (ct))
#define IS_PCIE8997(ct) (CARD_TYPE_PCIE8997 == (ct))
#define IS_PCIE9097(ct) (CARD_TYPE_PCIE9097 == (ct))
#define IS_PCIE9098(ct) (CARD_TYPE_PCIE9098 == (ct))
#define IS_PCIEIW624(ct) (CARD_TYPE_PCIEIW624 == (ct))
#define IS_PCIEAW693(ct) (CARD_TYPE_PCIEAW693 == (ct))
#define IS_PCIENW62X(ct) (CARD_TYPE_PCIENW62X == (ct))
/** PCIE8897 Card */
#define CARD_PCIE8897 "PCIE8897"
@ -493,12 +488,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define CARD_PCIE9098 "PCIE9098"
/** PCIEAW690 Card */
#define CARD_PCIEAW690 "PCIEAW690"
/** PCIEIW624 Card */
#define CARD_PCIEIW624 "PCIEIW624"
/** PCIEAW693 Card */
#define CARD_PCIEAW693 "PCIEAW693"
/** PCIEIW629 Card */
#define CARD_PCIEIW629 "PCIEIW629"
/** PCIENW62X Card */
#define CARD_PCIENW62X "PCIENW62X"
#endif
#ifdef USB
@ -514,8 +505,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define CARD_TYPE_USB9098 (CARD_TYPE_9098 | (INTF_USB << 8))
/** USB9097 card type */
#define CARD_TYPE_USB9097 (CARD_TYPE_9097 | (INTF_USB << 8))
/** USBIW624 card type */
#define CARD_TYPE_USBIW624 (CARD_TYPE_IW624 | (INTF_USB << 8))
/** USBNW62X card type */
#define CARD_TYPE_USBNW62X (CARD_TYPE_NW62X | (INTF_USB << 8))
#define IS_USB8801(ct) (CARD_TYPE_USB8801 == (ct))
#define IS_USB8897(ct) (CARD_TYPE_USB8897 == (ct))
@ -523,7 +514,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define IS_USB8978(ct) (CARD_TYPE_USB8978 == (ct))
#define IS_USB9098(ct) (CARD_TYPE_USB9098 == (ct))
#define IS_USB9097(ct) (CARD_TYPE_USB9097 == (ct))
#define IS_USBIW624(ct) (CARD_TYPE_USBIW624 == (ct))
#define IS_USBNW62X(ct) (CARD_TYPE_USBNW62X == (ct))
/** USB8801 Card */
#define CARD_USB8801 "USB8801"
@ -532,13 +523,13 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** USB8997 Card */
#define CARD_USB8997 "USB8997"
/** USB8978 Card */
#define CARD_USB8978 "USBIW416"
#define CARD_USB8978 "USB8978"
/** USB9098 Card */
#define CARD_USB9098 "USB9098"
/** USB9097 Card */
#define CARD_USB9097 "USBIW620"
/** USBIW624 Card */
#define CARD_USBIW624 "USBIW624"
/** USBNW62X Card */
#define CARD_USBNW62X "USBNW62X"
#endif
#define IS_CARD8801(ct) (CARD_TYPE_8801 == ((ct)&0xf))
@ -550,8 +541,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define IS_CARD9098(ct) (CARD_TYPE_9098 == ((ct)&0xf))
#define IS_CARD9097(ct) (CARD_TYPE_9097 == ((ct)&0xf))
#define IS_CARD9177(ct) (CARD_TYPE_9177 == ((ct)&0xf))
#define IS_CARDIW624(ct) (CARD_TYPE_IW624 == ((ct)&0xf))
#define IS_CARDAW693(ct) (CARD_TYPE_AW693 == ((ct)&0xf))
#define IS_CARDNW62X(ct) (CARD_TYPE_NW62X == ((ct)&0xf))
typedef struct _card_type_entry {
t_u16 card_type;
@ -621,8 +611,6 @@ typedef enum {
#define MLAN_BUF_FLAG_TX_CTRL MBIT(14)
#define MLAN_BUF_FLAG_EASYMESH MBIT(16)
#define MLAN_BUF_FLAG_MC_AGGR_PKT MBIT(17)
#ifdef DEBUG_LEVEL1
@ -653,8 +641,6 @@ 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
@ -709,21 +695,10 @@ typedef enum _mlan_buf_type {
MLAN_BUF_TYPE_EVENT,
MLAN_BUF_TYPE_RAW_DATA,
#ifdef SDIO
MLAN_BUF_TYPE_SPA_DATA,
#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 {
@ -845,19 +820,11 @@ typedef enum _mlan_event_id {
MLAN_EVENT_ID_DRV_UAP_CHAN_INFO = 0x80000020,
#endif
MLAN_EVENT_ID_FW_ROAM_OFFLOAD_RESULT = 0x80000023,
MLAN_EVENT_ID_DRV_RTT_RESULT = 0x80000025,
MLAN_EVENT_ID_DRV_ASSOC_FAILURE_LOGGER = 0x80000026,
MLAN_EVENT_ID_DRV_ASSOC_SUCC_LOGGER = 0x80000027,
MLAN_EVENT_ID_DRV_DISCONNECT_LOGGER = 0x80000028,
MLAN_EVENT_ID_DRV_WIFI_STATUS = 0x80000029,
MLAN_EVENT_ID_STORE_HOST_CMD_RESP = 0x80000030,
MLAN_EVENT_ID_DRV_ADDBA_TIMEOUT = 0x80000031,
#ifdef PCIE
MLAN_EVENT_ID_DRV_DEFER_RX_DATA = 0x80000032,
MLAN_EVENT_ID_DRV_DEFER_RX_EVENT = 0x80000033,
MLAN_EVENT_ID_DRV_DEFER_CMDRESP = 0x80000034,
MLAN_EVENT_ID_DRV_DEFER_TX_COMPLTE = 0x80000035,
#endif
} mlan_event_id;
/** Data Structures */
@ -938,8 +905,8 @@ enum mlan_channel_type {
/** channel band */
enum { BAND_2GHZ = 0,
BAND_5GHZ = 1,
BAND_6GHZ = 2,
BAND_4GHZ = 3,
BAND_4GHZ = 2,
BAND_6GHZ = 3,
};
/** channel offset */
@ -988,27 +955,9 @@ 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 Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */
t_u8 chanWidth : 2;
/** Band Info - (00)=2.4GHz, (01)=5GHz, (10)=6GHz */
t_u8 chanBand : 2;
/** 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;
#else
/** Band Info - (00)=2.4GHz, (01)=5GHz, (10)=6GHz */
/** Band Info - (00)=2.4GHz, (01)=5GHz */
t_u8 chanBand : 2;
/** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */
t_u8 chanWidth : 2;
@ -1016,7 +965,6 @@ 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 */
@ -1183,10 +1131,6 @@ typedef MLAN_PACK_START struct _mix_rate_info {
t_u8 mcs_index;
/** bitrate, in 500Kbps */
t_u16 bitrate;
/** NSS */
t_u8 nss_index;
/** DCM */
t_u8 dcm;
} MLAN_PACK_END mix_rate_info, *pmix_rate_info;
typedef MLAN_PACK_START struct _rxpd_extra_info {
@ -1198,12 +1142,10 @@ typedef MLAN_PACK_START struct _rxpd_extra_info {
t_u8 mcs_known;
/** mcs.flags */
t_u8 mcs_flags;
/** vht/he sig1 */
t_u32 vht_he_sig1;
/** vht/he sig2 */
t_u32 vht_he_sig2;
/** HE user idx */
t_u32 user_idx;
/** vht sig1 */
t_u32 vht_sig1;
/** vht sig2 */
t_u32 vht_sig2;
} MLAN_PACK_END rxpd_extra_info, *prxpd_extra_info;
typedef MLAN_PACK_START struct _radiotap_info {
@ -1224,16 +1166,6 @@ 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] */
@ -1242,7 +1174,6 @@ 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 {
@ -1337,8 +1268,6 @@ typedef struct _mlan_buffer {
t_u32 extra_ts_sec;
/** Time stamp when packet is dequed from rx_q(micro seconds) */
t_u32 extra_ts_usec;
/** When TX ra mac address, When Rx Ta mac address*/
t_u8 mac[MLAN_MAC_ADDR_LENGTH];
/** Fields below are valid for MLAN module only */
/** Pointer to parent mlan_buffer */
struct _mlan_buffer *pparent;
@ -1729,14 +1658,6 @@ typedef struct _tdls_tear_down_event {
t_u16 reason_code;
} tdls_tear_down_event;
/** Event structure for addba timeout */
typedef struct _addba_timeout_event {
/** Peer mac address */
t_u8 peer_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** Tid */
t_u8 tid;
} addba_timeout_event;
/** channel width */
typedef enum wifi_channel_width {
WIFI_CHAN_WIDTH_20 = 0,
@ -1794,15 +1715,6 @@ typedef struct {
t_u32 time_usec;
} wifi_timeval;
#define timeval_to_msec(timeval) \
(t_u64)((t_u64)(timeval.time_sec) * 1000 + \
(t_u64)(timeval.time_usec) / 1000)
#define timeval_to_usec(timeval) \
(t_u64)((t_u64)(timeval.time_sec) * 1000 * 1000 + \
(t_u64)(timeval.time_usec))
#define is_zero_timeval(timeval) \
((timeval.time_sec == 0) && (timeval.time_usec == 0))
#define MAX_NUM_RATE 32
#define MAX_RADIO 2
#define MAX_NUM_CHAN 1
@ -1884,6 +1796,15 @@ typedef struct {
t_u32 cca_busy_time;
} wifi_channel_stat;
#define timeval_to_msec(timeval) \
(t_u64)((t_u64)(timeval.time_sec) * 1000 + \
(t_u64)(timeval.time_usec) / 1000)
#define timeval_to_usec(timeval) \
(t_u64)((t_u64)(timeval.time_sec) * 1000 * 1000 + \
(t_u64)(timeval.time_usec))
#define is_zero_timeval(timeval) \
((timeval.time_sec == 0) && (timeval.time_usec == 0))
/** radio statistics */
typedef struct {
/** wifi radio (if multiple radio supported) */
@ -2077,320 +1998,9 @@ typedef struct {
0x00000080 /** all contention (min, max, avg) statistics (within ac \
statisctics) */
/** =========== Define Copied from HAL START =========== */
/** Ranging status */
typedef enum {
RTT_STATUS_SUCCESS = 0,
/** general failure status */
RTT_STATUS_FAILURE = 1,
/** target STA does not respond to request */
RTT_STATUS_FAIL_NO_RSP = 2,
/** request rejected. Applies to 2-sided RTT only */
RTT_STATUS_FAIL_REJECTED = 3,
RTT_STATUS_FAIL_NOT_SCHEDULED_YET = 4,
/** timing measurement times out */
RTT_STATUS_FAIL_TM_TIMEOUT = 5,
/** Target on different channel, cannot range */
RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL = 6,
/** ranging not supported */
RTT_STATUS_FAIL_NO_CAPABILITY = 7,
/** request aborted for unknown reason */
RTT_STATUS_ABORTED = 8,
/** Invalid T1-T4 timestamp */
RTT_STATUS_FAIL_INVALID_TS = 9,
/** 11mc protocol failed */
RTT_STATUS_FAIL_PROTOCOL = 10,
/** request could not be scheduled */
RTT_STATUS_FAIL_SCHEDULE = 11,
/** responder cannot collaborate at time of request */
RTT_STATUS_FAIL_BUSY_TRY_LATER = 12,
/** bad request args */
RTT_STATUS_INVALID_REQ = 13,
/** WiFi not enabled */
RTT_STATUS_NO_WIFI = 14,
/** Responder overrides param info, cannot range with new params */
RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE = 15
} wifi_rtt_status;
/** RTT peer type */
typedef enum {
RTT_PEER_AP = 0x1,
RTT_PEER_STA = 0x2,
RTT_PEER_P2P_GO = 0x3,
RTT_PEER_P2P_CLIENT = 0x4,
RTT_PEER_NAN = 0x5
} rtt_peer_type;
/** RTT Measurement Bandwidth */
typedef enum {
WIFI_RTT_BW_5 = 0x01,
WIFI_RTT_BW_10 = 0x02,
WIFI_RTT_BW_20 = 0x04,
WIFI_RTT_BW_40 = 0x08,
WIFI_RTT_BW_80 = 0x10,
WIFI_RTT_BW_160 = 0x20
} wifi_rtt_bw;
/** RTT Type */
typedef enum {
RTT_TYPE_1_SIDED = 0x1,
RTT_TYPE_2_SIDED = 0x2,
} wifi_rtt_type;
/** RTT configuration */
typedef struct {
/** peer device mac address */
t_u8 addr[MLAN_MAC_ADDR_LENGTH];
/** 1-sided or 2-sided RTT */
wifi_rtt_type type;
/** optional - peer device hint (STA, P2P, AP) */
rtt_peer_type peer;
/** Required for STA-AP mode, optional for P2P, NBD etc. */
wifi_channel_info channel;
/** Time interval between bursts (units: 100 ms).
* Applies to 1-sided and 2-sided RTT multi-burst requests.
* Range: 0-31, 0: no preference by initiator (2-sided RTT) */
t_u32 burst_period;
/** Total number of RTT bursts to be executed. It will be
* specified in the same way as the parameter "Number of
* Burst Exponent" found in the FTM frame format. It
* applies to both: 1-sided RTT and 2-sided RTT. Valid
* values are 0 to 15 as defined in 802.11mc std.
* 0 means single shot
* The implication of this parameter on the maximum
* number of RTT results is the following:
* for 1-sided RTT: max num of RTT results =
* (2^num_burst)*(num_frames_per_burst)
* for 2-sided RTT: max num of RTT results =
* (2^num_burst)*(num_frames_per_burst - 1) */
t_u32 num_burst;
/** num of frames per burst. Minimum value = 1, Maximum value = 31
* For 2-sided this equals the number of FTM frames to be attempted in a
* single burst. This also equals the number of FTM frames that the
* initiator will request that the responder send in a single frame. */
t_u32 num_frames_per_burst;
/** number of retries for a failed RTT frame. Applies
* to 1-sided RTT only. Minimum value = 0, Maximum value = 3 */
t_u32 num_retries_per_rtt_frame;
/** following fields are only valid for 2-side RTT */
/** Maximum number of retries that the initiator can retry an FTMR
* frame. Minimum value = 0, Maximum value = 3 */
t_u32 num_retries_per_ftmr;
/** 1: request LCI, 0: do not request LCI */
t_u8 LCI_request;
/** 1: request LCR, 0: do not request LCR */
t_u8 LCR_request;
/** Applies to 1-sided and 2-sided RTT. Valid values will
* be 2-11 and 15 as specified by the 802.11mc std for
* the FTM parameter burst duration. In a multi-burst
* request, if responder overrides with larger value,
* the initiator will return failure. In a single-burst
* request if responder overrides with larger value,
* the initiator will sent TMR_STOP to terminate RTT
* at the end of the burst_duration it requested. */
t_u32 burst_duration;
/** RTT preamble to be used in the RTT frames */
wifi_preamble preamble;
/** RTT BW to be used in the RTT frames */
wifi_rtt_bw bw;
} wifi_rtt_config;
/** Format of information elements found in the beacon */
typedef struct {
/** element identifier */
t_u8 id;
/** number of bytes to follow */
t_u8 len;
t_u8 data[];
} wifi_information_element;
/** RTT results */
typedef struct {
/** device mac address */
t_u8 addr[MLAN_MAC_ADDR_LENGTH];
/** burst number in a multi-burst request */
t_u32 burst_num;
/** Total RTT measurement frames attempted */
t_u32 measurement_number;
/** Total successful RTT measurement frames */
t_u32 success_number;
/** Maximum number of "FTM frames per burst" supported by
* the responder STA. Applies to 2-sided RTT only.
* If reponder overrides with larger value:
* - for single-burst request initiator will truncate the
* larger value and send a TMR_STOP after receiving as
* many frames as originally requested.
* - for multi-burst request, initiator will return
* failure right away */
t_u8 number_per_burst_peer;
/** ranging status */
wifi_rtt_status status;
/** When status == RTT_STATUS_FAIL_BUSY_TRY_LATER,
* this will be the time provided by the responder as to
* when the request can be tried again. Applies to 2-sided
* RTT only. In sec, 1-31sec. */
t_u8 retry_after_duration;
/** RTT type */
wifi_rtt_type type;
/** average rssi in 0.5 dB steps e.g. 143 implies -71.5 dB */
int rssi;
/** rssi spread in 0.5 dB steps e.g. 5 implies 2.5 dB spread (optional)
*/
int rssi_spread;
/** 1-sided RTT: TX rate of RTT frame.
* 2-sided RTT: TX rate of initiator's Ack in response to FTM frame. */
wifi_rate tx_rate;
/** 1-sided RTT: TX rate of Ack from other side.
* 2-sided RTT: TX rate of FTM frame coming from responder. */
wifi_rate rx_rate;
/** round trip time in picoseconds */
t_s64 rtt;
/** rtt standard deviation in picoseconds */
t_s64 rtt_sd;
/** difference between max and min rtt times recorded in picoseconds */
t_s64 rtt_spread;
/** distance in mm (optional) */
int distance_mm;
/** standard deviation in mm (optional) */
int distance_sd_mm;
/** difference between max and min distance recorded in mm (optional) */
int distance_spread_mm;
/** time of the measurement (in microseconds since boot) */
t_s64 ts;
/** in ms, actual time taken by the FW to finish one burst
* measurement. Applies to 1-sided and 2-sided RTT. */
int burst_duration;
/** Number of bursts allowed by the responder. Applies
* to 2-sided RTT only. */
int negotiated_burst_num;
/** for 11mc only */
wifi_information_element *LCI;
/** for 11mc only */
wifi_information_element *LCR;
} wifi_rtt_result;
/** Preamble definition for bit mask used in wifi_rtt_capabilities */
#define PREAMBLE_LEGACY 0x1
#define PREAMBLE_HT 0x2
#define PREAMBLE_VHT 0x4
/** BW definition for bit mask used in wifi_rtt_capabilities */
#define BW_5_SUPPORT 0x1
#define BW_10_SUPPORT 0x2
#define BW_20_SUPPORT 0x4
#define BW_40_SUPPORT 0x8
#define BW_80_SUPPORT 0x10
#define BW_160_SUPPORT 0x20
/** RTT Capabilities */
typedef struct {
/** if 1-sided rtt data collection is supported */
t_u8 rtt_one_sided_supported;
/** if ftm rtt data collection is supported */
t_u8 rtt_ftm_supported;
/** if initiator supports LCI request. Applies to 2-sided RTT */
t_u8 lci_support;
/** if initiator supports LCR request. Applies to 2-sided RTT */
t_u8 lcr_support;
/** bit mask indicates what preamble is supported by initiator */
t_u8 preamble_support;
/** bit mask indicates what BW is supported by initiator */
t_u8 bw_support;
/** if 11mc responder mode is supported */
t_u8 responder_supported;
/** draft 11mc spec version supported by chip. For instance,
* version 4.0 should be 40 and version 4.3 should be 43 etc. */
t_u8 mc_version;
} wifi_rtt_capabilities;
/** API for setting LCI/LCR information to be provided to a requestor */
typedef enum {
/** Not expected to change location */
WIFI_MOTION_NOT_EXPECTED = 0,
/** Expected to change location */
WIFI_MOTION_EXPECTED = 1,
/** Movement pattern unknown */
WIFI_MOTION_UNKNOWN = 2,
} wifi_motion_pattern;
/** LCI information */
typedef struct {
/** latitude in degrees * 2^25 , 2's complement */
long latitude;
/** latitude in degrees * 2^25 , 2's complement */
long longitude;
/** Altitude in units of 1/256 m */
int altitude;
/** As defined in Section 2.3.2 of IETF RFC 6225 */
t_u8 latitude_unc;
/** As defined in Section 2.3.2 of IETF RFC 6225 */
t_u8 longitude_unc;
/** As defined in Section 2.4.5 from IETF RFC 6225: */
t_u8 altitude_unc;
/** Following element for configuring the Z subelement */
wifi_motion_pattern motion_pattern;
/** floor in units of 1/16th of floor. 0x80000000 if unknown. */
int floor;
/** in units of 1/64 m */
int height_above_floor;
/** in units of 1/64 m. 0 if unknown */
int height_unc;
} wifi_lci_information;
/** LCR information */
typedef struct {
/** country code */
char country_code[2];
/** length of the info field */
int length;
/** Civic info to be copied in FTM frame */
char civic_info[256];
} wifi_lcr_information;
/**
* RTT Responder information
*/
typedef struct {
wifi_channel_info channel;
wifi_preamble preamble;
} wifi_rtt_responder;
/** =========== Define Copied from HAL END =========== */
#define MAX_RTT_CONFIG_NUM 10
/** RTT config params */
typedef struct wifi_rtt_config_params {
t_u8 rtt_config_num;
wifi_rtt_config rtt_config[MAX_RTT_CONFIG_NUM];
} wifi_rtt_config_params_t;
#define OID_RTT_REQUEST 0
#define OID_RTT_CANCEL 1
/** Pass RTT result element between mlan and moal */
typedef struct {
/** element identifier */
t_u16 id;
/** number of bytes to follow */
t_u16 len;
/** data: fill with one wifi_rtt_result */
t_u8 data[];
} wifi_rtt_result_element;
/** 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
@ -2538,6 +2148,12 @@ typedef struct _mlan_callbacks {
t_void (*moal_updata_peer_signal)(t_void *pmoal, t_u32 bss_index,
t_u8 *peer_addr, t_s8 snr, t_s8 nflr);
t_u64 (*moal_do_div)(t_u64 num, t_u32 base);
#if defined(DRV_EMBEDDED_AUTHENTICATOR) || defined(DRV_EMBEDDED_SUPPLICANT)
mlan_status (*moal_wait_hostcmd_complete)(t_void *pmoal,
t_u32 bss_index);
mlan_status (*moal_notify_hostcmd_complete)(t_void *pmoal,
t_u32 bss_index);
#endif
void (*moal_tp_accounting)(t_void *pmoal, t_void *buf,
t_u32 drop_point);
void (*moal_tp_accounting_rx_param)(t_void *pmoal, unsigned int type,
@ -2626,6 +2242,8 @@ typedef struct _mlan_device {
/** SDIO MPA Rx */
t_u32 mpa_rx_cfg;
#ifdef SDIO
/** SDIO Single port rx aggr */
t_u8 sdio_rx_aggr_enable;
/* see blk_queue_max_segment_size */
t_u32 max_seg_size;
/* see blk_queue_max_segments */
@ -2663,8 +2281,6 @@ typedef struct _mlan_device {
t_u8 indication_gpio;
/** Dynamic MIMO-SISO switch for hscfg*/
t_u8 hs_mimo_switch;
/** channel time and mode for DRCS*/
t_u32 drcs_chantime_mode;
#ifdef USB
/** Tx CMD endpoint address */
t_u8 tx_cmd_ep;
@ -2675,8 +2291,6 @@ typedef struct _mlan_device {
t_u8 rx_data_ep;
/** Tx data endpoint address */
t_u8 tx_data_ep;
/** Tx data second endpoint address */
t_u8 tx_data2_ep;
#endif
/** passive to active scan */
t_u8 passive_to_active_scan;
@ -2686,16 +2300,8 @@ 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;
/** second mac flag */
t_u8 second_mac;
/** napi */
t_u8 napi;
} mlan_device, *pmlan_device;
/** MLAN API function prototype */
@ -2776,9 +2382,6 @@ MLAN_API t_u8 mlan_select_wmm_queue(t_void *padapter, t_u8 bss_num, t_u8 tid);
MLAN_API mlan_status mlan_disable_host_int(t_void *padapter);
/** mlan unmask host interrupt */
MLAN_API mlan_status mlan_enable_host_int(t_void *padapter);
#ifdef PCIE
MLAN_API void mlan_process_pcie_interrupt_cb(t_void *pmadapter, int type);
#endif
#define CSI_SIGNATURE 0xABCD

View file

@ -1,217 +0,0 @@
/** @file mlan_event_ids.h
*
* @brief This file contains FW event ID definitions.
*
*
* Copyright 2023 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/* include guard is absent intentionally */
/* FW -> Host Event ID Constants */
/** Card Event definition : Dummy host wakeup signal */
ENUM_ELEMENT(EVENT_DUMMY_HOST_WAKEUP_SIGNAL, 0x0001),
/** Card Event definition : Link lost */
ENUM_ELEMENT(EVENT_LINK_LOST, 0x0003),
/** Card Event definition : Link sensed */
ENUM_ELEMENT(EVENT_LINK_SENSED, 0x0004),
/** Card Event definition : MIB changed */
ENUM_ELEMENT(EVENT_MIB_CHANGED, 0x0006),
/** Card Event definition : Init done */
ENUM_ELEMENT(EVENT_INIT_DONE, 0x0007),
/** Card Event definition : Deauthenticated */
ENUM_ELEMENT(EVENT_DEAUTHENTICATED, 0x0008),
/** Card Event definition : Disassociated */
ENUM_ELEMENT(EVENT_DISASSOCIATED, 0x0009),
/** Card Event definition : Power save awake */
ENUM_ELEMENT(EVENT_PS_AWAKE, 0x000a),
/** Card Event definition : Power save sleep */
ENUM_ELEMENT(EVENT_PS_SLEEP, 0x000b),
/** Card Event definition : MIC error multicast */
ENUM_ELEMENT(EVENT_MIC_ERR_MULTICAST, 0x000d),
/** Card Event definition : MIC error unicast */
ENUM_ELEMENT(EVENT_MIC_ERR_UNICAST, 0x000e),
/** Card Event definition : Ad-Hoc BCN lost */
ENUM_ELEMENT(EVENT_ADHOC_BCN_LOST, 0x0011),
/** Card Event definition : Stop Tx */
ENUM_ELEMENT(EVENT_STOP_TX, 0x0013),
/** Card Event definition : Start Tx */
ENUM_ELEMENT(EVENT_START_TX, 0x0014),
/** Card Event definition : Channel switch */
ENUM_ELEMENT(EVENT_CHANNEL_SWITCH, 0x0015),
/** Card Event definition : MEAS report ready */
ENUM_ELEMENT(EVENT_MEAS_REPORT_RDY, 0x0016),
/** Card Event definition : WMM status change */
ENUM_ELEMENT(EVENT_WMM_STATUS_CHANGE, 0x0017),
/** Card Event definition : BG scan report */
ENUM_ELEMENT(EVENT_BG_SCAN_REPORT, 0x0018),
/** Card Event definition : BG scan stopped */
ENUM_ELEMENT(EVENT_BG_SCAN_STOPPED, 0x0065),
/** Card Event definition : Beacon RSSI low */
ENUM_ELEMENT(EVENT_RSSI_LOW, 0x0019),
/** Card Event definition : Beacon SNR low */
ENUM_ELEMENT(EVENT_SNR_LOW, 0x001a),
/** Card Event definition : Maximum fail */
ENUM_ELEMENT(EVENT_MAX_FAIL, 0x001b),
/** Card Event definition : Beacon RSSI high */
ENUM_ELEMENT(EVENT_RSSI_HIGH, 0x001c),
/** Card Event definition : Beacon SNR high */
ENUM_ELEMENT(EVENT_SNR_HIGH, 0x001d),
/** Card Event definition : IBSS coalsced */
ENUM_ELEMENT(EVENT_IBSS_COALESCED, 0x001e),
/** Event definition : IBSS station connected */
ENUM_ELEMENT(EVENT_IBSS_STATION_CONNECT, 0x0020),
/** Event definition : IBSS station dis-connected */
ENUM_ELEMENT(EVENT_IBSS_STATION_DISCONNECT, 0x0021),
/** Card Event definition : Data RSSI low */
ENUM_ELEMENT(EVENT_DATA_RSSI_LOW, 0x0024),
/** Card Event definition : Data SNR low */
ENUM_ELEMENT(EVENT_DATA_SNR_LOW, 0x0025),
/** Card Event definition : Data RSSI high */
ENUM_ELEMENT(EVENT_DATA_RSSI_HIGH, 0x0026),
/** Card Event definition : Data SNR high */
ENUM_ELEMENT(EVENT_DATA_SNR_HIGH, 0x0027),
/** Card Event definition : Link Quality */
ENUM_ELEMENT(EVENT_LINK_QUALITY, 0x0028),
/** Card Event definition : Port release event */
ENUM_ELEMENT(EVENT_PORT_RELEASE, 0x002b),
#ifdef UAP_SUPPORT
/** Event ID: STA deauth */
ENUM_ELEMENT(EVENT_MICRO_AP_STA_DEAUTH, 0x002c),
/** Event ID: STA assoicated */
ENUM_ELEMENT(EVENT_MICRO_AP_STA_ASSOC, 0x002d),
/** Event ID: BSS started */
ENUM_ELEMENT(EVENT_MICRO_AP_BSS_START, 0x002e),
/** Event ID: BSS idle event */
ENUM_ELEMENT(EVENT_MICRO_AP_BSS_IDLE, 0x0043),
/** Event ID: BSS active event */
ENUM_ELEMENT(EVENT_MICRO_AP_BSS_ACTIVE, 0x0044),
/** Event ID: MIC countermeasures event */
ENUM_ELEMENT(EVENT_MICRO_AP_MIC_COUNTERMEASURES, 0x004c),
#endif /* UAP_SUPPORT */
/** Card Event definition : Pre-Beacon Lost */
ENUM_ELEMENT(EVENT_PRE_BEACON_LOST, 0x0031),
ENUM_ELEMENT(EVENT_WATCHDOG_TMOUT, 0x0032),
/** Card Event definition : Add BA event */
ENUM_ELEMENT(EVENT_ADDBA, 0x0033),
/** Card Event definition : Del BA event */
ENUM_ELEMENT(EVENT_DELBA, 0x0034),
/** Card Event definition: BA stream timeout*/
ENUM_ELEMENT(EVENT_BA_STREAM_TIMEOUT, 0x0037),
/** Card Event definition : AMSDU aggr control */
ENUM_ELEMENT(EVENT_AMSDU_AGGR_CTRL, 0x0042),
/** Card Event definition: WEP ICV error */
ENUM_ELEMENT(EVENT_WEP_ICV_ERR, 0x0046),
/** Card Event definition : Host sleep enable */
ENUM_ELEMENT(EVENT_HS_ACT_REQ, 0x0047),
/** Card Event definition : BW changed */
ENUM_ELEMENT(EVENT_BW_CHANGE, 0x0048),
#ifdef WIFI_DIRECT_SUPPORT
/** WIFIDIRECT generic event */
ENUM_ELEMENT(EVENT_WIFIDIRECT_GENERIC_EVENT, 0x0049),
/** WIFIDIRECT service discovery event */
ENUM_ELEMENT(EVENT_WIFIDIRECT_SERVICE_DISCOVERY, 0x004a),
#endif
/** Remain on Channel expired event */
ENUM_ELEMENT(EVENT_REMAIN_ON_CHANNEL_EXPIRED, 0x005f),
/** TDLS generic event */
ENUM_ELEMENT(EVENT_TDLS_GENERIC_EVENT, 0x0052),
ENUM_ELEMENT(EVENT_MEF_HOST_WAKEUP, 0x004f),
/** Card Event definition: Channel switch pending announcment */
ENUM_ELEMENT(EVENT_CHANNEL_SWITCH_ANN, 0x0050),
/** Event definition: Radar Detected by card */
ENUM_ELEMENT(EVENT_RADAR_DETECTED, 0x0053),
/** Event definition: Radar Detected by card */
ENUM_ELEMENT(EVENT_CHANNEL_REPORT_RDY, 0x0054),
/** Event definition: Scan results through event */
ENUM_ELEMENT(EVENT_EXT_SCAN_REPORT, 0x0058),
/** Enhance ext scan done event */
ENUM_ELEMENT(EVENT_EXT_SCAN_STATUS_REPORT, 0x007f),
/** Event definition: RXBA_SYNC */
ENUM_ELEMENT(EVENT_RXBA_SYNC, 0x0059),
/** Event ID: TX data pause event */
ENUM_ELEMENT(EVENT_TX_DATA_PAUSE, 0x0055),
/** Event definition : FW debug information */
ENUM_ELEMENT(EVENT_FW_DEBUG_INFO, 0x0063),
/** Event ID: SAD Report */
ENUM_ELEMENT(EVENT_SAD_REPORT, 0x0066),
/** Event ID: Multi Chan Info*/
ENUM_ELEMENT(EVENT_MULTI_CHAN_INFO, 0x006a),
ENUM_ELEMENT(EVENT_FW_DUMP_INFO, 0x0073),
/** Event ID: Tx status */
ENUM_ELEMENT(EVENT_TX_STATUS_REPORT, 0x0074),
ENUM_ELEMENT(EVENT_BT_COEX_WLAN_PARA_CHANGE, 0x0076),
ENUM_ELEMENT(EVENT_VDLL_IND, 0x0081),
ENUM_ELEMENT(EVENT_ROAM_OFFLOAD, 0x0083),
ENUM_ELEMENT(EVENT_WLS_FTM_COMPLETE, 0x0086),
ENUM_ELEMENT(EVENT_EXCEED_MAX_P2P_CONN, 0x0089),
#if defined(PCIE)
ENUM_ELEMENT(EVENT_SSU_DUMP_DMA, 0x008C),
#endif
ENUM_ELEMENT(EVENT_CSI, 0x008D),
ENUM_ELEMENT(EVENT_FW_HANG_REPORT, 0x008F),
/** Card Event definition : RESET PN */
ENUM_ELEMENT(EVENT_ASSOC_REQ_IE, 0x0095),
ENUM_ELEMENT(EVENT_CHAN_LOAD, 0x0099),
ENUM_ELEMENT(EVENT_IMD3_CAL_START, 0x00A0),
ENUM_ELEMENT(EVENT_IMD3_CAL_END, 0x00A1),
/* Always keep this last */

File diff suppressed because it is too large Load diff

View file

@ -1,449 +0,0 @@
/** @file mlan_hostcmd_ids.h
*
* @brief This file contains host command ID definitions.
*
*
* Copyright 2023 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/* include guard is absent intentionally */
/** Firmware Host Command ID Constants */
/** Host Command ID : Get hardware specifications */
ENUM_ELEMENT(HostCmd_CMD_GET_HW_SPEC, 0x0003),
/** Host Command ID : 802.11 scan */
ENUM_ELEMENT(HostCmd_CMD_802_11_SCAN, 0x0006),
/** Host Command ID : 802.11 get log */
ENUM_ELEMENT(HostCmd_CMD_802_11_GET_LOG, 0x000b),
/** Host Command id: GET_TX_RX_PKT_STATS */
ENUM_ELEMENT(HostCmd_CMD_TX_RX_PKT_STATS, 0x008d),
/** Host Command ID : 802.11 get/set link layer statistic */
ENUM_ELEMENT(HostCmd_CMD_802_11_LINK_STATS, 0x0256),
/** Host Command ID : MAC multicast address */
ENUM_ELEMENT(HostCmd_CMD_MAC_MULTICAST_ADR, 0x0010),
/** Host Command ID : 802.11 EEPROM access */
ENUM_ELEMENT(HostCmd_CMD_802_11_EEPROM_ACCESS, 0x0059),
/** Host Command ID : 802.11 associate */
ENUM_ELEMENT(HostCmd_CMD_802_11_ASSOCIATE, 0x0012),
/** Host Command ID : 802.11 SNMP MIB */
ENUM_ELEMENT(HostCmd_CMD_802_11_SNMP_MIB, 0x0016),
/** Host Command ID : MAC register access */
ENUM_ELEMENT(HostCmd_CMD_MAC_REG_ACCESS, 0x0019),
/** Host Command ID : BBP register access */
ENUM_ELEMENT(HostCmd_CMD_BBP_REG_ACCESS, 0x001a),
/** Host Command ID : RF register access */
ENUM_ELEMENT(HostCmd_CMD_RF_REG_ACCESS, 0x001b),
/** Host Command ID : 802.11 radio control */
ENUM_ELEMENT(HostCmd_CMD_802_11_RADIO_CONTROL, 0x001c),
/** Host Command ID : 802.11 RF channel */
ENUM_ELEMENT(HostCmd_CMD_802_11_RF_CHANNEL, 0x001d),
/** Host Command ID : 802.11 RF Tx power */
ENUM_ELEMENT(HostCmd_CMD_802_11_RF_TX_POWER, 0x001e),
/** Host Command ID : 802.11 RF antenna */
ENUM_ELEMENT(HostCmd_CMD_802_11_RF_ANTENNA, 0x0020),
/** Host Command ID : 802.11 deauthenticate */
ENUM_ELEMENT(HostCmd_CMD_802_11_DEAUTHENTICATE, 0x0024),
/** Host Command ID: 802.11 disassoicate */
ENUM_ELEMENT(HostCmd_CMD_802_11_DISASSOCIATE, 0x0026),
/** Host Command ID : MAC control */
ENUM_ELEMENT(HostCmd_CMD_MAC_CONTROL, 0x0028),
/** Host Command ID : 802.11 Ad-Hoc start */
ENUM_ELEMENT(HostCmd_CMD_802_11_AD_HOC_START, 0x002b),
/** Host Command ID : 802.11 Ad-Hoc join */
ENUM_ELEMENT(HostCmd_CMD_802_11_AD_HOC_JOIN, 0x002c),
/** Host Command ID: CW Mode */
ENUM_ELEMENT(HostCmd_CMD_CW_MODE_CTRL, 0x0239),
/** Host Command ID : 802.11 key material */
ENUM_ELEMENT(HostCmd_CMD_802_11_KEY_MATERIAL, 0x005e),
/** Host Command ID : 802.11 Ad-Hoc stop */
ENUM_ELEMENT(HostCmd_CMD_802_11_AD_HOC_STOP, 0x0040),
/** Host Command ID : 802.22 MAC address */
ENUM_ELEMENT(HostCmd_CMD_802_11_MAC_ADDRESS, 0x004D),
/** Host Command ID : LED control config */
ENUM_ELEMENT(HostCmd_CMD_802_11_LED_CONTROL, 0x004E),
/** Host Command ID : WMM Traffic Stream Status */
ENUM_ELEMENT(HostCmd_CMD_WMM_TS_STATUS, 0x005d),
/** Host Command ID : 802.11 D domain information */
ENUM_ELEMENT(HostCmd_CMD_802_11D_DOMAIN_INFO, 0x005b),
/*This command gets/sets the Transmit Rate-based Power Control (TRPC)
* channel configuration.*/
ENUM_ELEMENT(HostCmd_CMD_CHANNEL_TRPC_CONFIG, 0x00fb),
/** Host Command ID : 802.11 TPC information */
ENUM_ELEMENT(HostCmd_CMD_802_11_TPC_INFO, 0x005f),
/** Host Command ID : 802.11 TPC adapt req */
ENUM_ELEMENT(HostCmd_CMD_802_11_TPC_ADAPT_REQ, 0x0060),
/** Host Command ID : 802.11 channel SW ann */
ENUM_ELEMENT(HostCmd_CMD_802_11_CHAN_SW_ANN, 0x0061),
/** Host Command ID : Measurement request */
ENUM_ELEMENT(HostCmd_CMD_MEASUREMENT_REQUEST, 0x0062),
/** Host Command ID : Measurement report */
ENUM_ELEMENT(HostCmd_CMD_MEASUREMENT_REPORT, 0x0063),
/** Host Command ID : 802.11 sleep parameters */
ENUM_ELEMENT(HostCmd_CMD_802_11_SLEEP_PARAMS, 0x0066),
/** Host Command ID : 802.11 ps inactivity timeout */
ENUM_ELEMENT(HostCmd_CMD_802_11_PS_INACTIVITY_TIMEOUT, 0x0067),
/** Host Command ID : 802.11 sleep period */
ENUM_ELEMENT(HostCmd_CMD_802_11_SLEEP_PERIOD, 0x0068),
/** Host Command ID: 802.11 BG scan config */
ENUM_ELEMENT(HostCmd_CMD_802_11_BG_SCAN_CONFIG, 0x006b),
/** Host Command ID : 802.11 BG scan query */
ENUM_ELEMENT(HostCmd_CMD_802_11_BG_SCAN_QUERY, 0x006c),
/** Host Command ID : WMM ADDTS req */
ENUM_ELEMENT(HostCmd_CMD_WMM_ADDTS_REQ, 0x006E),
/** Host Command ID : WMM DELTS req */
ENUM_ELEMENT(HostCmd_CMD_WMM_DELTS_REQ, 0x006F),
/** Host Command ID : WMM queue configuration */
ENUM_ELEMENT(HostCmd_CMD_WMM_QUEUE_CONFIG, 0x0070),
/** Host Command ID : 802.11 get status */
ENUM_ELEMENT(HostCmd_CMD_WMM_GET_STATUS, 0x0071),
/** Host Command ID : 802.11 subscribe event */
ENUM_ELEMENT(HostCmd_CMD_802_11_SUBSCRIBE_EVENT, 0x0075),
/** Host Command ID : 802.11 Tx rate query */
ENUM_ELEMENT(HostCmd_CMD_802_11_TX_RATE_QUERY, 0x007f),
/** Host Command ID :Get timestamp value */
ENUM_ELEMENT(HostCmd_CMD_GET_TSF, 0x0080),
/** Host Command ID : WMM queue stats */
ENUM_ELEMENT(HostCmd_CMD_WMM_QUEUE_STATS, 0x0081),
/** Host Command ID : KEEP ALIVE command */
ENUM_ELEMENT(HostCmd_CMD_AUTO_TX, 0x0082),
/** Host Command ID : 802.11 IBSS coalescing status */
ENUM_ELEMENT(HostCmd_CMD_802_11_IBSS_COALESCING_STATUS, 0x0083),
/** Host Command ID : Memory access */
ENUM_ELEMENT(HostCmd_CMD_MEM_ACCESS, 0x0086),
#if defined(SDIO)
/** Host Command ID : SDIO GPIO interrupt configuration */
ENUM_ELEMENT(HostCmd_CMD_SDIO_GPIO_INT_CONFIG, 0x0088),
#endif
/** Host Command ID : Mfg command */
ENUM_ELEMENT(HostCmd_CMD_MFG_COMMAND, 0x0089),
/** Host Command ID : Inactivity timeout ext */
ENUM_ELEMENT(HostCmd_CMD_INACTIVITY_TIMEOUT_EXT, 0x008a),
/** Host Command ID : DBGS configuration */
ENUM_ELEMENT(HostCmd_CMD_DBGS_CFG, 0x008b),
/** Host Command ID : Get memory */
ENUM_ELEMENT(HostCmd_CMD_GET_MEM, 0x008c),
/** Host Command ID : Cal data dnld */
ENUM_ELEMENT(HostCmd_CMD_CFG_DATA, 0x008f),
/** Host Command ID : SDIO pull control */
ENUM_ELEMENT(HostCmd_CMD_SDIO_PULL_CTRL, 0x0093),
/** Host Command ID : ECL system clock configuration */
ENUM_ELEMENT(HostCmd_CMD_ECL_SYSTEM_CLOCK_CONFIG, 0x0094),
/** Host Command ID : Extended version */
ENUM_ELEMENT(HostCmd_CMD_VERSION_EXT, 0x0097),
/** Host Command ID : MEF configuration */
ENUM_ELEMENT(HostCmd_CMD_MEF_CFG, 0x009a),
/** Host Command ID : 802.11 RSSI INFO*/
ENUM_ELEMENT(HostCmd_CMD_RSSI_INFO, 0x00a4),
/** Host Command ID : Function initialization */
ENUM_ELEMENT(HostCmd_CMD_FUNC_INIT, 0x00a9),
/** Host Command ID : Function shutdown */
ENUM_ELEMENT(HostCmd_CMD_FUNC_SHUTDOWN, 0x00aa),
#ifdef OPCHAN
ENUM_ELEMENT(HostCmd_CMD_OPCHAN_CONFIG, 0x00f8),
ENUM_ELEMENT(HostCmd_CMD_OPCHAN_CHANGROUP_CONFIG, 0x00f9),
#endif
/** Host Command ID : Robustcoex */
ENUM_ELEMENT(HostCmd_CMD_802_11_ROBUSTCOEX, 0x00e0),
/** Host Command ID :EAPOL PKT */
ENUM_ELEMENT(HostCmd_CMD_802_11_EAPOL_PKT, 0x012e),
/** Host Command ID :MIMO SWITCH **/
ENUM_ELEMENT(HostCmd_CMD_802_11_MIMO_SWITCH, 0x0235),
/** Host Command ID : 802.11 RSSI INFO EXT*/
ENUM_ELEMENT(HostCmd_CMD_RSSI_INFO_EXT, 0x0237),
/** Host Command ID : ROAMING OFFLOAD TO FW*/
ENUM_ELEMENT(HostCmd_CMD_ROAM_OFFLOAD, 0x0245),
/** Host Command ID: Multi chan config */
ENUM_ELEMENT(HostCmd_CMD_MULTI_CHAN_CONFIG, 0x011e),
/** Host Command ID: Multi chan policy */
ENUM_ELEMENT(HostCmd_CMD_MULTI_CHAN_POLICY, 0x0121),
/** Host Command ID: DRCS config */
ENUM_ELEMENT(HostCmd_CMD_DRCS_CONFIG, 0x024a),
/** Host Command ID : Channel report request */
ENUM_ELEMENT(HostCmd_CMD_CHAN_REPORT_REQUEST, 0x00dd),
/** Host Command ID: SUPPLICANT_PMK */
ENUM_ELEMENT(HostCmd_CMD_SUPPLICANT_PMK, 0x00c4),
/** Host Command ID: SUPPLICANT_PROFILE */
ENUM_ELEMENT(HostCmd_CMD_SUPPLICANT_PROFILE, 0x00c5),
/** Host Command ID : Add Block Ack Request */
ENUM_ELEMENT(HostCmd_CMD_11N_ADDBA_REQ, 0x00ce),
/** Host Command ID : Delete a Block Ack Request */
ENUM_ELEMENT(HostCmd_CMD_11N_CFG, 0x00cd),
/** Host Command ID : Add Block Ack Response */
ENUM_ELEMENT(HostCmd_CMD_11N_ADDBA_RSP, 0x00cf),
/** Host Command ID : Delete a Block Ack Request */
ENUM_ELEMENT(HostCmd_CMD_11N_DELBA, 0x00d0),
/** Host Command ID: Configure Tx Buf size */
ENUM_ELEMENT(HostCmd_CMD_RECONFIGURE_TX_BUFF, 0x00d9),
/** Host Command ID: AMSDU Aggr Ctrl */
ENUM_ELEMENT(HostCmd_CMD_AMSDU_AGGR_CTRL, 0x00df),
/** Host Command ID: 11AC config */
ENUM_ELEMENT(HostCmd_CMD_11AC_CFG, 0x0112),
/** Host Command ID: Configure TX Beamforming capability */
ENUM_ELEMENT(HostCmd_CMD_TX_BF_CFG, 0x0104),
/** Host Command ID : 802.11 TX power configuration */
ENUM_ELEMENT(HostCmd_CMD_TXPWR_CFG, 0x00d1),
/** Host Command ID : Soft Reset */
ENUM_ELEMENT(HostCmd_CMD_SOFT_RESET, 0x00d5),
/** Host Command ID : 802.11 b/g/n rate configration */
ENUM_ELEMENT(HostCmd_CMD_TX_RATE_CFG, 0x00d6),
/** Host Command ID : Enhanced PS mode */
ENUM_ELEMENT(HostCmd_CMD_802_11_PS_MODE_ENH, 0x00e4),
/** Host command action : Host sleep configuration */
ENUM_ELEMENT(HostCmd_CMD_802_11_HS_CFG_ENH, 0x00e5),
/** Host Command ID : CAU register access */
ENUM_ELEMENT(HostCmd_CMD_CAU_REG_ACCESS, 0x00ed),
/** Host Command ID : mgmt IE list */
ENUM_ELEMENT(HostCmd_CMD_MGMT_IE_LIST, 0x00f2),
ENUM_ELEMENT(HostCmd_CMD_802_11_BAND_STEERING, 0x026f),
/*** Host Command ID " MC_AGGR_CFG */
ENUM_ELEMENT(HostCmd_CMD_MC_AGGR_CFG, 0x027a),
ENUM_ELEMENT(HostCmd_CMD_802_11_STATS, 0x0014),
ENUM_ELEMENT(HostCmd_CMD_GET_CH_LOAD, 0x027b),
/** Host Command ID: CROSS CHIP SYNCH */
ENUM_ELEMENT(HostCmd_CMD_CROSS_CHIP_SYNCH, 0x027d),
/** Host Command ID : TDLS configuration */
ENUM_ELEMENT(HostCmd_CMD_TDLS_CONFIG, 0x0100),
/** Host Command ID : TDLS operation */
ENUM_ELEMENT(HostCmd_CMD_TDLS_OPERATION, 0x0122),
/** Host Command ID : Packet aggregation over host interface */
ENUM_ELEMENT(HostCmd_CMD_PACKET_AGGR_OVER_HOST_INTERFACE, 0x0117),
#ifdef SDIO
#endif
/** Host Command ID : Extended scan support */
ENUM_ELEMENT(HostCmd_CMD_802_11_SCAN_EXT, 0x0107),
/** Host Command ID : Forward mgmt frame */
ENUM_ELEMENT(HostCmd_CMD_RX_MGMT_IND, 0x010c),
#ifdef PCIE
/** Host Command ID: Host buffer description */
ENUM_ELEMENT(HostCmd_CMD_PCIE_HOST_BUF_DETAILS, 0x00fa),
#endif
/** Host Command ID : Set BSS_MODE */
ENUM_ELEMENT(HostCmd_CMD_SET_BSS_MODE, 0x00f7),
#ifdef UAP_SUPPORT
/** Host Command id: SYS_INFO */
ENUM_ELEMENT(HostCmd_CMD_APCMD_SYS_INFO, 0x00ae),
/** Host Command id: sys_reset */
ENUM_ELEMENT(HostCmd_CMD_APCMD_SYS_RESET, 0x00af),
/** Host Command id: SYS_CONFIGURE */
ENUM_ELEMENT(HostCmd_CMD_APCMD_SYS_CONFIGURE, 0x00b0),
/** Host Command id: BSS_START */
ENUM_ELEMENT(HostCmd_CMD_APCMD_BSS_START, 0x00b1),
/** Host Command id: BSS_STOP */
ENUM_ELEMENT(HostCmd_CMD_APCMD_BSS_STOP, 0x00b2),
/** Host Command id: sta_list */
ENUM_ELEMENT(HostCmd_CMD_APCMD_STA_LIST, 0x00b3),
/** Host Command id: STA_DEAUTH */
ENUM_ELEMENT(HostCmd_CMD_APCMD_STA_DEAUTH, 0x00b5),
/** Host Command id: REPORT_MIC */
ENUM_ELEMENT(HostCmd_CMD_APCMD_REPORT_MIC, 0x00ee),
/** Host Command id: UAP_OPER_CTRL */
ENUM_ELEMENT(HostCmd_CMD_APCMD_OPER_CTRL, 0x0233),
#endif /* UAP_SUPPORT */
/** Host Command id: PMIC CONFIGURE*/
ENUM_ELEMENT(HostCmd_CMD_PMIC_CONFIGURE, 0x23E),
/** Host Command ID: 802.11 Network Monitor */
ENUM_ELEMENT(HostCmd_CMD_802_11_NET_MONITOR, 0x0102),
/** Host Command ID: Tx data pause */
ENUM_ELEMENT(HostCmd_CMD_CFG_TX_DATA_PAUSE, 0x0103),
#ifdef WIFI_DIRECT_SUPPORT
/** Host Command ID: P2P PARAMS CONFIG */
ENUM_ELEMENT(HostCmd_CMD_P2P_PARAMS_CONFIG, 0x00ea),
/** Host Command ID: WIFI_DIRECT_MODE_CONFIG */
ENUM_ELEMENT(HostCmd_CMD_WIFI_DIRECT_MODE_CONFIG, 0x00eb),
#endif
/** Host Command ID: GPIO TSF LATCH */
ENUM_ELEMENT(HostCmd_CMD_GPIO_TSF_LATCH_PARAM_CONFIG, 0x0278),
/** Host Command ID: Remain On Channel */
ENUM_ELEMENT(HostCmd_CMD_802_11_REMAIN_ON_CHANNEL, 0x010d),
ENUM_ELEMENT(HostCmd_CMD_COALESCE_CFG, 0x010a),
/** Host Command ID: GTK REKEY OFFLOAD CFG */
ENUM_ELEMENT(HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG, 0x010f),
/** Host Command ID : OTP user data */
ENUM_ELEMENT(HostCmd_CMD_OTP_READ_USER_DATA, 0x0114),
/** Host Command ID: fw auto reconnect */
ENUM_ELEMENT(HostCmd_CMD_FW_AUTO_RECONNECT, 0x0115),
/** Host Command ID: HS wakeup reason */
ENUM_ELEMENT(HostCmd_CMD_HS_WAKEUP_REASON, 0x0116),
/** Host Command ID: reject addba request */
ENUM_ELEMENT(HostCmd_CMD_REJECT_ADDBA_REQ, 0x0119),
ENUM_ELEMENT(HostCmd_CMD_FW_DUMP_EVENT, 0x0125),
ENUM_ELEMENT(HostCmd_CMD_CONFIG_LOW_POWER_MODE, 0x0128),
/** Host Command ID : Target device access */
ENUM_ELEMENT(HostCmd_CMD_TARGET_ACCESS, 0x012a),
/** Host Command ID: BCA device access */
ENUM_ELEMENT(HostCmd_CMD_BCA_REG_ACCESS, 0x0272),
/** Host Command ID: register device access */
ENUM_ELEMENT(HostCmd_CMD_REG_ACCESS, 0x027C),
/** Host Command ID: DFS repeater mode */
ENUM_ELEMENT(HostCmd_CMD_DFS_REPEATER_MODE, 0x012b),
/** Host Command ID: ACS scan */
ENUM_ELEMENT(HostCmd_CMD_APCMD_ACS_SCAN, 0x0224),
/** Host Command ID: Get sensor temp*/
ENUM_ELEMENT(HostCmd_CMD_DS_GET_SENSOR_TEMP, 0x0227),
/** Host Command ID : Configure ADHOC_OVER_IP parameters */
ENUM_ELEMENT(HostCmd_CMD_WMM_PARAM_CONFIG, 0x023a),
ENUM_ELEMENT(HostCmd_CMD_IPV6_RA_OFFLOAD_CFG, 0x0238),
#ifdef STA_SUPPORT
/** Host Command ID : set/get sta configure */
ENUM_ELEMENT(HostCmd_CMD_STA_CONFIGURE, 0x023f),
#endif
/** Host Command ID : GPIO independent reset configure */
ENUM_ELEMENT(HostCmd_CMD_INDEPENDENT_RESET_CFG, 0x0243),
/** use to query chan region cfg setting in firmware */
ENUM_ELEMENT(HostCmd_CMD_CHAN_REGION_CFG, 0x0242),
/** used in hostcmd to download region power cfg setting to firmware */
ENUM_ELEMENT(HostCmd_CMD_REGION_POWER_CFG, 0x0249),
/** Host Command ID : Packet aggregation CTRL */
ENUM_ELEMENT(HostCmd_CMD_PACKET_AGGR_CTRL, 0x0251),
ENUM_ELEMENT(HostCmd_CMD_DYN_BW, 0x0252),
ENUM_ELEMENT(HostCmd_CMD_BOOT_SLEEP, 0x0258),
ENUM_ELEMENT(HostCmd_CMD_RX_ABORT_CFG, 0x0261),
ENUM_ELEMENT(HostCmd_CMD_RX_ABORT_CFG_EXT, 0x0262),
ENUM_ELEMENT(HostCmd_CMD_TX_AMPDU_PROT_MODE, 0x0263),
ENUM_ELEMENT(HostCmd_CMD_RATE_ADAPT_CFG, 0x0264),
ENUM_ELEMENT(HostCmd_CMD_CCK_DESENSE_CFG, 0x0265),
ENUM_ELEMENT(HostCmd_CMD_FTM_CONFIG_SESSION_PARAMS, 0x024d),
ENUM_ELEMENT(HostCmd_CMD_FTM_SESSION_CTRL, 0x024e),
ENUM_ELEMENT(HostCmd_CMD_FTM_FEATURE_CTRL, 0x024f),
ENUM_ELEMENT(HostCmd_CMD_WLS_REQ_FTM_RANGE, 0x0250),
ENUM_ELEMENT(HostCmd_CMD_FTM_CONFIG_RESPONDER, 0x0255),
ENUM_ELEMENT(HostCmd_CMD_VDLL, 0x0240),
#if defined(PCIE)
ENUM_ELEMENT(HostCmd_CMD_SSU, 0x0259),
#endif
ENUM_ELEMENT(HostCmd_CMD_CSI, 0x025b),
#if defined(UAP_SUPPORT)
/** Host Command ID : Add New Station */
ENUM_ELEMENT(HostCmd_CMD_ADD_NEW_STATION, 0x025f),
#endif
ENUM_ELEMENT(HostCmd_CMD_DMCS_CONFIG, 0x0260),
/** Host Command ID: 11AX config */
ENUM_ELEMENT(HostCmd_CMD_11AX_CFG, 0x0266),
/** Host Command ID: 11AX command */
ENUM_ELEMENT(HostCmd_CMD_11AX_CMD, 0x026d),
/** Host Command ID: Range ext command */
ENUM_ELEMENT(HostCmd_CMD_RANGE_EXT, 0x0274),
/** Host Command ID: TWT cfg command */
ENUM_ELEMENT(HostCmd_CMD_TWT_CFG, 0x0270),
ENUM_ELEMENT(HostCmd_CMD_LOW_POWER_MODE_CFG, 0x026e),
ENUM_ELEMENT(HostCmd_CMD_UAP_BEACON_STUCK_CFG, 0x0271),
ENUM_ELEMENT(HostCmd_CMD_ARB_CONFIG, 0x0273),
ENUM_ELEMENT(HostCmd_CMD_DOT11MC_UNASSOC_FTM_CFG, 0x0275),
ENUM_ELEMENT(HostCmd_CMD_HAL_PHY_CFG, 0x0276),
/** Host Command ID : IPS Config */
ENUM_ELEMENT(HostCmd_CMD_IPS_CONFIG, 0x0279),
ENUM_ELEMENT(HostCmd_CMD_OFDM_DESENSE_CFG, 0x027f),
ENUM_ELEMENT(HostCmd_CMD_NAV_MITIGATION_CFG, 0x0282),
/* Always keep this last */

View file

@ -4,20 +4,29 @@
* definitions used in MLAN and MOAL module.
*
*
* Copyright 2008-2023 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -46,17 +55,10 @@ 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 0x0c00
/** 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)
@ -90,8 +92,6 @@ typedef MLAN_PACK_START enum _IEEEtypes_ElementId_e {
EXTEND_CHANNEL_SWITCH_ANN = 60,
QUIET = 40,
IBSS_DFS = 41,
MEASUREMENT_REQUEST = 38,
MEASUREMENT_REPORT = 39,
SUPPORTED_CHANNELS = 36,
REGULATORY_CLASS = 59,
HT_CAPABILITY = 45,
@ -179,50 +179,14 @@ typedef MLAN_PACK_START struct _IEEEtypes_Generic_t {
t_u8 data[IEEE_MAX_IE_SIZE - sizeof(IEEEtypes_Header_t)];
} MLAN_PACK_END IEEEtypes_Generic_t, *pIEEEtypes_Generic_t;
#define MEASURE_TYPE_CLI 8
#define MEASURE_TYPE_LOCATION_CIVIC 9
/** Measurement Report IE */
typedef MLAN_PACK_START struct _IEEEtypes_MeasurementReport_t {
/** Generic IE header */
IEEEtypes_Header_t ieee_hdr;
/** Measurement Token */
t_u8 ms_token;
/** Measurement Report Mode */
t_u8 ms_rp_mode;
/** Measurement Type, value in MEASURE_TYPE_XXX */
t_u8 ms_type;
/** variable */
t_u8 variable[];
} MLAN_PACK_END IEEEtypes_MeasurementReport_t;
/** Report */
typedef MLAN_PACK_START struct _IEEEtypes_Report_t {
/** Subelement ID */
t_u8 subelement_id;
/** length */
t_u8 length;
/** variable */
t_u8 variable[];
} MLAN_PACK_END IEEEtypes_Report_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 */
@ -355,25 +319,6 @@ 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;
@ -406,7 +351,6 @@ 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 {
@ -621,35 +565,16 @@ 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 */
@ -658,22 +583,14 @@ 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 */
@ -761,22 +678,6 @@ 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 */
@ -791,31 +692,19 @@ 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 */
@ -1156,26 +1045,6 @@ 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;
@ -1194,7 +1063,6 @@ 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;
@ -1303,24 +1171,6 @@ 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 */
@ -1337,7 +1187,6 @@ 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 {
@ -1364,59 +1213,29 @@ 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
/** Default PE Duration */
t_u16 default_pe_dur : 3; /* bit 0-2 */
/** TWT Required */
t_u16 twt_req : 1; /* bit 3 */
/** TXOP Duration RTS Threshold */
t_u16 txop_dur_rts_threshold : 10; /* bit 4-13 */
/** VHT Operation Info Present */
t_u16 vht_op_info_present : 1; /* bit 14 */
/** Co-Hosted BSS */
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 : 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 */
t_u16 twt_req : 1; /* bit 3 */
/** TXOP Duration RTS Threshold */
t_u16 txop_dur_rts_threshold : 10; /* bit 4-13 */
/** VHT Operation Info Present */
t_u16 vht_op_info_present : 1; /* bit 14 */
/** Co-Hosted BSS */
t_u16 co_located_bss : 1; /* bit 15 */
/** ER SU Disable */
t_u8 er_su_disable : 1; /* bit 16 */
/* 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
t_u8 reserved : 7; /* bit 17-23 */
} 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 {
@ -1578,20 +1397,6 @@ 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 */
@ -1604,7 +1409,6 @@ typedef MLAN_PACK_START struct {
t_u8 unmeasured : 1;
/**< Reserved */
t_u8 rsvd5_7 : 3;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END MeasRptBasicMap_t;
@ -1747,8 +1551,8 @@ typedef MLAN_PACK_START struct _wlan_user_scan_chan {
t_u8 radio_type;
/** Scan type: Active = 1, Passive = 2 */
t_u8 scan_type;
/** rnr_flag */
t_u8 rnr_flag;
/** Reserved */
t_u8 reserved;
/** Scan duration in milliseconds; if 0 default used */
t_u32 scan_time;
} MLAN_PACK_END wlan_user_scan_chan;
@ -1840,8 +1644,6 @@ 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*/
@ -1863,15 +1665,9 @@ typedef MLAN_PACK_START struct {
#define BG_SCAN_SSID_RSSI_MATCH 0x0004
/**wait for all channel scan to complete to report scan result*/
#define BG_SCAN_WAIT_ALL_CHAN_DONE 0x80000000
#define CHAN_MAX_6G 0
/** max bgscan chan number */
/** Maximum number of channels that can be sent in bg scan config */
#define WLAN_BG_SCAN_CHAN_MAX 38
/** max bgscan chan number, include UNII_4 channel */
#define WLAN_BG_SCAN_CHAN_MAX_UNII_4 41
/** Enumeration definition */
/** EES MODE */
typedef enum {
@ -1938,7 +1734,7 @@ typedef MLAN_PACK_START struct {
/** SSID filter list used in the to limit the scan results */
wlan_user_scan_ssid ssid_list[MRVDRV_MAX_SSID_LIST_LENGTH];
/** Variable number (fixed maximum) of channels to scan up */
wlan_user_scan_chan chan_list[WLAN_USER_SCAN_CHAN_MAX];
wlan_user_scan_chan chan_list[WLAN_BG_SCAN_CHAN_MAX];
/** scan channel gap */
t_u16 scan_chan_gap;
/** Enable EES configuration */
@ -1971,11 +1767,6 @@ typedef MLAN_PACK_START struct {
} MLAN_PACK_END wlan_bgscan_cfg;
#endif /* STA_SUPPORT */
/** The open AP in OWE transmition Mode */
#define OWE_TRANS_MODE_OPEN 1
/** The security AP in OWE trsnsition Mode */
#define OWE_TRANS_MODE_OWE 2
#ifdef PRAGMA_PACK
#pragma pack(pop)
#endif
@ -1990,15 +1781,6 @@ typedef struct _BSSDescriptor_t {
/** SSID */
mlan_802_11_ssid ssid;
/** Transition MAC address */
mlan_802_11_mac_addr trans_mac_address;
/** Transition SSID */
mlan_802_11_ssid trans_ssid;
/** OWE Transition mode */
t_u8 owe_transition_mode;
/** WEP encryption requirement */
t_u32 privacy;

View file

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -45,6 +54,9 @@ Change log:
#ifdef PCIE
#include "mlan_pcie.h"
#endif /* PCIE */
#if defined(DRV_EMBEDDED_AUTHENTICATOR) || defined(DRV_EMBEDDED_SUPPLICANT)
#include "hostsa_init.h"
#endif
#include "mlan_11ax.h"
/********************************************************
@ -314,20 +326,6 @@ mlan_status wlan_allocate_adapter(pmlan_adapter pmadapter)
LEAVE();
return MLAN_STATUS_FAILURE;
}
if (pmadapter->callbacks.moal_vmalloc &&
pmadapter->callbacks.moal_vfree)
ret = pmadapter->callbacks.moal_vmalloc(
pmadapter->pmoal_handle, buf_size,
(t_u8 **)&pmadapter->pold_chan_stats);
else
ret = pmadapter->callbacks.moal_malloc(
pmadapter->pmoal_handle, buf_size, MLAN_MEM_DEF,
(t_u8 **)&pmadapter->pold_chan_stats);
if (ret != MLAN_STATUS_SUCCESS || !pmadapter->pold_chan_stats) {
PRINTM(MERROR, "Failed to allocate old channel statistics\n");
LEAVE();
return MLAN_STATUS_FAILURE;
}
#endif
/* Allocate command buffer */
@ -607,7 +605,7 @@ mlan_status wlan_init_priv(pmlan_private priv)
}
#endif
priv->user_rxwinsize = priv->add_ba_param.rx_win_size;
memset(pmadapter, priv->rx_seq, 0xff, sizeof(priv->rx_seq));
memset(pmadapter, priv->rx_seq, 0, sizeof(priv->rx_seq));
priv->port_ctrl_mode = MTRUE;
priv->port_open = MFALSE;
priv->prior_port_status = MFALSE;
@ -615,7 +613,6 @@ mlan_status wlan_init_priv(pmlan_private priv)
priv->hotspot_cfg = 0;
priv->intf_hr_len = pmadapter->ops.intf_header_len;
priv->multi_ap_flag = 0;
memset(pmadapter, &priv->chan_rep_req, 0, sizeof(priv->chan_rep_req));
#ifdef USB
if (IS_USB(pmadapter->card_type)) {
@ -626,10 +623,12 @@ mlan_status wlan_init_priv(pmlan_private priv)
priv->intf_hr_len = MLAN_USB_TX_AGGR_HEADER;
}
priv->port = pmadapter->tx_data_ep;
priv->port_index = 0;
}
#endif
ret = wlan_add_bsspriotbl(priv);
#if defined(DRV_EMBEDDED_AUTHENTICATOR) || defined(DRV_EMBEDDED_SUPPLICANT)
hostsa_init(priv);
#endif
LEAVE();
return ret;
@ -818,9 +817,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 =
@ -833,9 +832,6 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter)
#ifdef USB
if (IS_USB(pmadapter->card_type)) {
for (i = 0; i < MAX_USB_TX_PORT_NUM; i++) {
pmadapter->pcard_usb->usb_port_status[i] = MFALSE;
}
for (i = 0; i < MAX_USB_TX_PORT_NUM; i++) {
pmadapter->pcard_usb->usb_tx_aggr[i].aggr_ctrl.enable =
MFALSE;
@ -855,7 +851,7 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter)
pmadapter->pcard_usb->usb_tx_aggr[i].hold_timeout_msec =
MLAN_USB_TX_AGGR_TIMEOUT_MSEC;
pmadapter->pcard_usb->usb_tx_aggr[i].port =
pmadapter->usb_tx_ports[i];
pmadapter->tx_data_ep;
pmadapter->pcard_usb->usb_tx_aggr[i].phandle =
(t_void *)pmadapter;
}
@ -877,12 +873,7 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter)
pmadapter->is_hs_configured = MFALSE;
pmadapter->hs_cfg.conditions = HOST_SLEEP_DEF_COND;
pmadapter->hs_cfg.gpio = HOST_SLEEP_DEF_GPIO;
#ifdef PCIE
if (IS_PCIE(pmadapter->card_type))
pmadapter->hs_cfg.gap = HOST_SLEEP_GAP_SPECIAL;
else
#endif
pmadapter->hs_cfg.gap = HOST_SLEEP_DEF_GAP;
pmadapter->hs_cfg.gap = HOST_SLEEP_DEF_GAP;
pmadapter->hs_activated = MFALSE;
pmadapter->min_wake_holdoff = HOST_SLEEP_DEF_WAKE_HOLDOFF;
pmadapter->hs_inactivity_timeout = HOST_SLEEP_DEF_INACTIVITY_TIMEOUT;
@ -951,9 +942,6 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter)
pmadapter->upld_len = 0;
pmadapter->event_cause = 0;
pmadapter->pmlan_buffer_event = MNULL;
pmadapter->flush_time_ac_vi_vo = DEF_FLUSH_TIME_AC_VI_VO;
pmadapter->flush_time_ac_be_bk = DEF_FLUSH_TIME_AC_BE_BK;
memset(pmadapter, &pmadapter->region_channel, 0,
sizeof(pmadapter->region_channel));
pmadapter->region_code = 0;
@ -967,8 +955,6 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter)
pmadapter->arp_filter_size = 0;
#endif /* STA_SUPPORT */
pmadapter->mc_status = MFALSE;
#ifdef PCIE
if (IS_PCIE(pmadapter->card_type)) {
pmadapter->pcard_pcie->txbd_wrptr = 0;
@ -984,11 +970,13 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter)
EVT_RW_PTR_ROLLOVER_IND;
}
#endif
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (pmadapter->pcard_pcie->reg->use_adma) {
pmadapter->pcard_pcie->rxbd_wrptr =
pmadapter->pcard_pcie->txrx_bd_size;
pmadapter->pcard_pcie->evtbd_wrptr = MLAN_MAX_EVT_BD;
}
#endif
}
#endif
LEAVE();
@ -1146,33 +1134,6 @@ mlan_status wlan_init_lock_list(pmlan_adapter pmadapter)
ret = MLAN_STATUS_FAILURE;
goto error;
}
#ifdef PCIE
if (pcb->moal_init_lock(pmadapter->pmoal_handle,
&pmadapter->pmlan_rx_lock) !=
MLAN_STATUS_SUCCESS) {
ret = MLAN_STATUS_FAILURE;
goto error;
}
if (pcb->moal_init_lock(pmadapter->pmoal_handle,
&pmadapter->pmlan_tx_lock) !=
MLAN_STATUS_SUCCESS) {
ret = MLAN_STATUS_FAILURE;
goto error;
}
if (pcb->moal_init_lock(pmadapter->pmoal_handle,
&pmadapter->pmlan_event_lock) !=
MLAN_STATUS_SUCCESS) {
ret = MLAN_STATUS_FAILURE;
goto error;
}
if (pcb->moal_init_lock(pmadapter->pmoal_handle,
&pmadapter->pmlan_pcie_lock) !=
MLAN_STATUS_SUCCESS) {
ret = MLAN_STATUS_FAILURE;
goto error;
}
#endif
#if defined(USB)
if (IS_USB(pmadapter->card_type)) {
for (i = 0; i < MAX_USB_TX_PORT_NUM; i++) {
@ -1254,20 +1215,6 @@ t_void wlan_free_lock_list(pmlan_adapter pmadapter)
if (pmadapter->pmlan_cmd_lock)
pcb->moal_free_lock(pmadapter->pmoal_handle,
pmadapter->pmlan_cmd_lock);
#ifdef PCIE
if (pmadapter->pmlan_rx_lock)
pcb->moal_free_lock(pmadapter->pmoal_handle,
pmadapter->pmlan_rx_lock);
if (pmadapter->pmlan_tx_lock)
pcb->moal_free_lock(pmadapter->pmoal_handle,
pmadapter->pmlan_tx_lock);
if (pmadapter->pmlan_event_lock)
pcb->moal_free_lock(pmadapter->pmoal_handle,
pmadapter->pmlan_event_lock);
if (pmadapter->pmlan_pcie_lock)
pcb->moal_free_lock(pmadapter->pmoal_handle,
pmadapter->pmlan_pcie_lock);
#endif
#if defined(USB)
if (IS_USB(pmadapter->card_type)) {
for (i = 0; i < MAX_USB_TX_PORT_NUM; i++) {
@ -1532,7 +1479,6 @@ done:
static void wlan_update_hw_spec(pmlan_adapter pmadapter)
{
t_u32 i;
MrvlIEtypes_He_cap_t *user_he_cap_tlv = MNULL;
ENTER();
@ -1645,28 +1591,6 @@ 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;
}
}
}
@ -1819,15 +1743,6 @@ t_void wlan_free_adapter(pmlan_adapter pmadapter)
(t_u8 *)pmadapter->pchan_stats);
pmadapter->pchan_stats = MNULL;
}
if (pmadapter->pold_chan_stats) {
if (pcb->moal_vmalloc && pcb->moal_vfree)
pcb->moal_vfree(pmadapter->pmoal_handle,
(t_u8 *)pmadapter->pold_chan_stats);
else
pcb->moal_mfree(pmadapter->pmoal_handle,
(t_u8 *)pmadapter->pold_chan_stats);
pmadapter->pold_chan_stats = MNULL;
}
if (pmadapter->bcn_buf) {
if (pcb->moal_vmalloc && pcb->moal_vfree)
pcb->moal_vfree(pmadapter->pmoal_handle,
@ -1936,6 +1851,10 @@ t_void wlan_free_priv(mlan_private *pmpriv)
wlan_free_curr_bcn(pmpriv);
#endif /* STA_SUPPORT */
#if defined(DRV_EMBEDDED_AUTHENTICATOR) || defined(DRV_EMBEDDED_SUPPLICANT)
hostsa_cleanup(pmpriv);
#endif /*EMBEDDED AUTHENTICATOR*/
wlan_delete_station_list(pmpriv);
LEAVE();
}
@ -2116,16 +2035,11 @@ mlan_status wlan_init_fw_complete(pmlan_adapter pmadapter)
/* Reconfigure wmm parameter*/
if (status == MLAN_STATUS_SUCCESS) {
pmpriv = wlan_get_priv(pmadapter, MLAN_BSS_ROLE_STA);
if (pmpriv) {
if (pmpriv)
status = wlan_prepare_cmd(pmpriv,
HostCmd_CMD_WMM_PARAM_CONFIG,
HostCmd_ACT_GEN_SET, 0, MNULL,
&pmadapter->ac_params);
if (status != MLAN_STATUS_SUCCESS)
PRINTM(MERROR,
"ERR: wlan_prepare_cmd returned status=0x%x\n",
status);
}
}
/* Invoke callback */
ret = pcb->moal_init_fw_complete(pmadapter->pmoal_handle, status);

View file

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -104,22 +113,9 @@ 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_ */

File diff suppressed because it is too large Load diff

View file

@ -7,20 +7,29 @@
* to the firmware.
*
*
* Copyright 2008-2023 NXP
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -39,6 +48,9 @@ Change log:
#include "mlan_11ac.h"
#include "mlan_11ax.h"
#include "mlan_11h.h"
#ifdef DRV_EMBEDDED_SUPPLICANT
#include "authenticator_api.h"
#endif
/********************************************************
Local Constants
********************************************************/
@ -279,7 +291,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 | MLAN_MEM_FLAG_ATOMIC, &tmp);
MLAN_MEM_DEF, &tmp);
if (ret != MLAN_STATUS_SUCCESS || !tmp) {
PRINTM(MERROR, "Failed to allocate buffer\n");
ret = MLAN_STATUS_FAILURE;
@ -306,13 +318,12 @@ static mlan_status wlan_get_common_rates(mlan_private *pmpriv, t_u8 *rate1,
PRINTM(MINFO, "Tx DataRate is set to 0x%X\n", pmpriv->data_rate);
if (!pmpriv->is_data_rate_auto) {
while (rate1_size && *ptr) {
while (*ptr) {
if ((*ptr & 0x7f) == pmpriv->data_rate) {
ret = MLAN_STATUS_SUCCESS;
goto done;
}
ptr++;
rate1_size--;
}
PRINTM(MMSG,
"Previously set fixed data rate %#x is not "
@ -349,7 +360,7 @@ static mlan_status wlan_setup_rates_from_bssdesc(mlan_private *pmpriv,
t_u8 *pout_rates,
t_u32 *pout_rates_size)
{
t_u8 card_rates[WLAN_SUPPORTED_RATES] = {0};
t_u8 card_rates[WLAN_SUPPORTED_RATES];
t_u32 card_rates_size = 0;
ENTER();
/* Copy AP supported rates */
@ -548,53 +559,33 @@ static int wlan_cmd_append_osen_ie(mlan_private *priv, t_u8 **ppbuffer)
/**
* @brief This function get the rsn_cap from RSN ie buffer.
*
* @param pmpriv A pointer to mlan_private structure
*
* @param data A pointer to rsn_ie data after IE header
* @param len Length of ie rsn_ie data after IE header
* @param return rsn_cap
*/
static t_u16 wlan_get_rsn_cap(t_u8 *data, t_u8 len)
static t_u16 wlan_get_rsn_cap(t_u8 *data)
{
t_u16 rsn_cap = 0;
t_u16 *ptr;
t_u16 *end_ptr;
t_u16 pairwise_cipher_count = 0;
t_u16 akm_suite_count = 0;
if (len < 20) {
/* Version(2B)+GRP(4B)+PairwiseCnt(2B)+PairwiseList(4B)+
akmCnt(2B)+akmList(4B)+rsnCap(2B) = 20B */
PRINTM(MERROR,
"RSNE: IE len should not less than 20 Bytes, len=%d\n",
len);
goto done;
}
/* rsn_cap = data + 2 bytes version + 4 bytes
* group_cipher_suite + 2 bytes pairwise_cipher_count +
* pairwise_cipher_count * PAIRWISE_CIPHER_SUITE_LEN + 2 bytes
* akm_suite_count + akm_suite_count * AKM_SUITE_LEN
*/
end_ptr = (t_u16 *)(data + len);
ptr = (t_u16 *)(data + sizeof(t_u16) + 4 * sizeof(t_u8));
pairwise_cipher_count = wlan_le16_to_cpu(*ptr);
ptr = (t_u16 *)(data + sizeof(t_u16) + 4 * sizeof(t_u8) +
sizeof(t_u16) +
pairwise_cipher_count * PAIRWISE_CIPHER_SUITE_LEN);
if ((pairwise_cipher_count == 0) || (ptr >= end_ptr)) {
PRINTM(MERROR, "RSNE: PAIRWISE_CIPHER not correct\n");
goto done;
}
akm_suite_count = wlan_le16_to_cpu(*ptr);
ptr = (t_u16 *)(data + sizeof(t_u16) + 4 * sizeof(t_u8) +
sizeof(t_u16) +
pairwise_cipher_count * PAIRWISE_CIPHER_SUITE_LEN +
sizeof(t_u16) + akm_suite_count * AKM_SUITE_LEN);
if ((akm_suite_count == 0) || (ptr > end_ptr)) {
PRINTM(MERROR, "RSNE: AKM Suite or RSNCAP not correct\n");
goto done;
}
rsn_cap = wlan_le16_to_cpu(*ptr);
done:
PRINTM(MCMND, "rsn_cap=0x%x\n", rsn_cap);
return rsn_cap;
}
@ -616,12 +607,10 @@ static t_u8 wlan_use_mfp(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
if (pmpriv->wpa_ie[0] != RSN_IE)
return 0;
sta_rsn_cap =
wlan_get_rsn_cap(pmpriv->wpa_ie + 2, *(pmpriv->wpa_ie + 1));
sta_rsn_cap = wlan_get_rsn_cap(pmpriv->wpa_ie + 2);
if (!pbss_desc->prsn_ie)
return 0;
ap_rsn_cap = wlan_get_rsn_cap(pbss_desc->prsn_ie->data,
pbss_desc->prsn_ie->ieee_hdr.len);
ap_rsn_cap = wlan_get_rsn_cap(pbss_desc->prsn_ie->data);
ap_mfpc = ((ap_rsn_cap & (0x1 << MFPC_BIT)) == (0x1 << MFPC_BIT));
ap_mfpr = ((ap_rsn_cap & (0x1 << MFPR_BIT)) == (0x1 << MFPR_BIT));
sta_mfpc = ((sta_rsn_cap & (0x1 << MFPC_BIT)) == (0x1 << MFPC_BIT));
@ -645,65 +634,23 @@ static t_u8 wlan_use_mfp(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
* @param ptlv_rsn_ie A pointer to rsn_ie TLV
*/
static int wlan_update_rsn_ie(mlan_private *pmpriv,
MrvlIEtypes_RsnParamSet_t *ptlv_rsn_ie,
t_u16 *rsn_ie_len, t_u8 *akm_type)
MrvlIEtypes_RsnParamSet_t *ptlv_rsn_ie)
{
t_u16 *prsn_cap;
t_u8 *ptr;
t_u8 *pairwise_cipher_count_ptr;
t_u8 *group_mgmt_cipher_suite_ptr = MNULL;
t_u8 *pmkid_list_ptr = MNULL;
t_u8 *end_ptr;
t_u16 *ptr;
t_u16 *akm_suite_count_ptr;
t_u16 pmf_mask = 0x00;
t_u8 *temp;
t_u16 pairwise_cipher_count = 0;
t_u16 akm_suite_count = 0;
t_u16 pmkid_count = 0;
t_u8 i;
#define PREFERENCE_TKIP 1
/* Cipher Perference Order:
(5) CIPHER_SYITE_TYPE_GCMP_256 = 9
(4) CIPHER_SYITE_TYPE_GCMP_128 = 8
(3) CIPHER_SYITE_TYPE_CCMP_256 = 10
(2) CIPHER_SYITE_TYPE_CCMP_128 = 4
(1) CIPHER_SYITE_TYPE_TKIP = 2
(0) Skip
*/
t_u8 preference_selected;
t_u8 cipher_selected_id;
#if 0 // defined(ENABLE_GCMP_SUPPORT)
// embedded supplicant doesn't support GCMP yet
t_u8 cipher_preference[11] = {0, 0, 1, 0, 2, 0, 0, 0, 4, 5, 3};
#else
t_u8 cipher_preference[5] = {0, 0, 1, 0, 2};
#endif
t_u8 oui[4] = {0x00, 0x0f, 0xac, 0x00};
/* AKM Perference Order:
(6) AKM_SUITE_TYPE_FT_SAE = 9 //Not supported in esupp
(5) AKM_SUITE_TYPE_SAE = 8
(4) AKM_SUITE_TYPE_OWE = 18
(3) AKM_SUITE_TYPE_FT_PSK = 4 //Not supported in esupp
(2) AKM_SUITE_TYPE_PSK_SHA256 = 6
(1) AKM_SUITE_TYPE_PSK = 2
(0) Skip
*/
t_u8 akm_type_selected;
t_u8 akm_type_id = 0;
t_u8 akm_preference[19] = {0, 0, 1, 0, 0, 0, 2, 0, 5, 0,
0, 0, 0, 0, 0, 0, 0, 0, 4};
t_u16 temp_akm_suite_count = 0;
int found = 0;
t_u8 sha_256_oui[4] = {0x00, 0x0f, 0xac, 0x06};
t_u8 sae_oui[4] = {0x00, 0x0f, 0xac, 0x08};
mlan_adapter *pmadapter = pmpriv->adapter;
int ap_mfpc = 0, ap_mfpr = 0, ret = MLAN_STATUS_SUCCESS;
if (*rsn_ie_len < 20) {
/* Version(2B)+GRP(4B)+PairwiseCnt(2B)+PairwiseList(4B)+
akmCnt(2B)+akmList(4B)+rsnCap(2B) = 20B */
PRINTM(MERROR,
"RSNE: IE len should not less than 20 Bytes, len=%d\n",
*rsn_ie_len);
return MLAN_STATUS_FAILURE;
}
pmf_mask = (((pmpriv->pmfcfg.mfpc << MFPC_BIT) |
(pmpriv->pmfcfg.mfpr << MFPR_BIT)) |
(~PMF_MASK));
@ -712,129 +659,82 @@ static int wlan_update_rsn_ie(mlan_private *pmpriv,
* pairwise_cipher_count * PAIRWISE_CIPHER_SUITE_LEN + 2 bytes
* akm_suite_count + akm_suite_count * AKM_SUITE_LEN
*/
end_ptr = ptlv_rsn_ie->rsn_ie + *rsn_ie_len;
ptr = ptlv_rsn_ie->rsn_ie + sizeof(t_u16) + 4 * sizeof(t_u8);
pairwise_cipher_count_ptr = ptr;
pairwise_cipher_count = wlan_le16_to_cpu(*(t_u16 *)ptr);
ptr += sizeof(t_u16);
if ((pairwise_cipher_count == 0) ||
(ptr + PAIRWISE_CIPHER_SUITE_LEN * pairwise_cipher_count) >=
end_ptr) {
PRINTM(MERROR, "RSNE: PAIRWISE_CIPHER not correct\n");
return MLAN_STATUS_FAILURE;
}
preference_selected = 0;
cipher_selected_id = 0;
for (i = 0; i < pairwise_cipher_count; i++) {
if ((ptr[3] < sizeof(cipher_preference)) &&
(cipher_preference[ptr[3]] > preference_selected)) {
preference_selected = cipher_preference[ptr[3]];
cipher_selected_id = ptr[3];
}
ptr += PAIRWISE_CIPHER_SUITE_LEN;
}
if (preference_selected == 0) {
PRINTM(MERROR, "RSNE: PAIRWISE_CIPHER not supported\n");
return MLAN_STATUS_FAILURE;
}
if ((preference_selected == PREFERENCE_TKIP) &&
((*akm_type == AssocAgentAuth_Wpa3Sae) ||
(*akm_type == AssocAgentAuth_Owe))) {
PRINTM(MERROR,
"RSNE: PAIRWISE_CIPHER TKIP not allowed for AKM %s\n",
(*akm_type == AssocAgentAuth_Wpa3Sae) ? "SAE" : "ÖWE");
return MLAN_STATUS_FAILURE;
}
if ((preference_selected == PREFERENCE_TKIP) &&
(*akm_type == AssocAgentAuth_Auto)) {
*akm_type = AssocAgentAuth_Open;
}
/* Process AKM
* Preference order for AssocAgentAuth_Auto:
* FT Authentication using SAE 00-0F-AC:9 (not supported in embedded
* supplicant) SAE Authentication 00-0F-AC:8 OWE Authentication
* 00-0F-AC:18 FT Authentication using PSK 00-0F-AC:4 (not supported in
* embedded supplicant) PSK using SHA-256 00-0F-AC:6 PSK 00-0F-AC:2
*/
ptr = ptlv_rsn_ie->rsn_ie + sizeof(t_u16) + 4 * sizeof(t_u8) +
sizeof(t_u16) + pairwise_cipher_count * PAIRWISE_CIPHER_SUITE_LEN;
akm_suite_count = wlan_le16_to_cpu(*(t_u16 *)ptr);
ptr += sizeof(t_u16); // move pointer to AKM suite
if ((akm_suite_count == 0) || (ptr + AKM_SUITE_LEN * akm_suite_count +
sizeof(t_u16)) > end_ptr) { // sizeof(t_u16)
// is for
// rsncap
PRINTM(MERROR, "RSNE: AKM Suite or RSNCAP not correct\n");
return MLAN_STATUS_FAILURE;
}
akm_type_selected = 0;
if (*akm_type == AssocAgentAuth_Auto) {
// find the best one
for (i = 0; i < akm_suite_count; i++) {
if ((ptr[3] < sizeof(akm_preference)) &&
(akm_preference[ptr[3]] > akm_type_selected)) {
akm_type_selected = akm_preference[ptr[3]];
akm_type_id = ptr[3];
}
ptr += AKM_SUITE_LEN;
}
if (akm_type_selected) {
if (akm_type_id == 6)
*akm_type = AssocAgentAuth_Open;
else if (akm_type_id == 2)
*akm_type = AssocAgentAuth_Open;
else if (akm_type_id == 18)
*akm_type = AssocAgentAuth_Owe;
else if (akm_type_id == 8)
*akm_type = AssocAgentAuth_Wpa3Sae;
}
} else {
// find the matched AKM
for (i = 0; i < akm_suite_count; i++) {
if (ptr[3] < sizeof(akm_preference)) {
if ((*akm_type == AssocAgentAuth_Open) &&
(ptr[3] == 6)) {
break;
} else if ((*akm_type == AssocAgentAuth_Open) &&
(ptr[3] == 2)) {
break;
} else if ((*akm_type ==
AssocAgentAuth_Wpa3Sae) &&
(ptr[3] == 8)) {
break;
} else if ((*akm_type == AssocAgentAuth_Owe) &&
(ptr[3] == 18)) {
ptr = (t_u16 *)(ptlv_rsn_ie->rsn_ie + sizeof(t_u16) + 4 * sizeof(t_u8));
pairwise_cipher_count = wlan_le16_to_cpu(*ptr);
ptr = (t_u16 *)(ptlv_rsn_ie->rsn_ie + sizeof(t_u16) + 4 * sizeof(t_u8) +
sizeof(t_u16) +
pairwise_cipher_count * PAIRWISE_CIPHER_SUITE_LEN);
temp_akm_suite_count = wlan_le16_to_cpu(*ptr);
akm_suite_count = wlan_le16_to_cpu(*ptr);
/* Save pointer to akm_suite_count in RSN IE to update it later */
akm_suite_count_ptr = ptr;
temp = ptlv_rsn_ie->rsn_ie + sizeof(t_u16) + 4 * sizeof(t_u8) +
sizeof(t_u16) +
pairwise_cipher_count * PAIRWISE_CIPHER_SUITE_LEN +
sizeof(t_u16);
/* ptr now points to the 1st AKM suite */
if (temp_akm_suite_count > 1) {
while (temp_akm_suite_count) {
if (pmpriv->sec_info.authentication_mode ==
MLAN_AUTH_MODE_SAE) {
if (!memcmp(pmadapter, temp, sae_oui,
AKM_SUITE_LEN)) {
found = 1;
break;
}
} else if (!memcmp(pmadapter, temp, sha_256_oui,
AKM_SUITE_LEN)) {
found = 1;
break;
}
ptr += AKM_SUITE_LEN;
temp += AKM_SUITE_LEN;
temp_akm_suite_count--;
}
if (i == akm_suite_count) {
akm_type_selected = 0; // not found
} else {
akm_type_selected = akm_preference[ptr[3]];
akm_type_id = ptr[3];
if (found) {
/* Copy SHA256 as AKM suite */
memcpy_ext(pmadapter,
ptlv_rsn_ie->rsn_ie +
(sizeof(t_u16) + 4 * sizeof(t_u8) +
sizeof(t_u16) +
pairwise_cipher_count *
PAIRWISE_CIPHER_SUITE_LEN +
sizeof(t_u16)),
temp, AKM_SUITE_LEN, AKM_SUITE_LEN);
/* Shift remaining bytes of RSN IE after this */
memmove(pmadapter,
ptlv_rsn_ie->rsn_ie +
(sizeof(t_u16) + 4 * sizeof(t_u8) +
sizeof(t_u16) +
pairwise_cipher_count *
PAIRWISE_CIPHER_SUITE_LEN +
sizeof(t_u16) + AKM_SUITE_LEN),
ptlv_rsn_ie->rsn_ie +
(sizeof(t_u16) + 4 * sizeof(t_u8) +
sizeof(t_u16) +
pairwise_cipher_count *
PAIRWISE_CIPHER_SUITE_LEN +
sizeof(t_u16) +
akm_suite_count * AKM_SUITE_LEN),
ptlv_rsn_ie->header.len -
(sizeof(t_u16) + 4 * sizeof(t_u8) +
sizeof(t_u16) +
pairwise_cipher_count *
PAIRWISE_CIPHER_SUITE_LEN +
sizeof(t_u16) +
akm_suite_count * AKM_SUITE_LEN));
ptlv_rsn_ie->header.len =
ptlv_rsn_ie->header.len -
(akm_suite_count - 1) * AKM_SUITE_LEN;
/* Update akm suite count */
akm_suite_count = 1;
*akm_suite_count_ptr = akm_suite_count;
}
}
if (akm_type_selected == 0) {
PRINTM(MERROR, "RSNE: AKM Suite not found for authtype %d\n",
*akm_type);
return MLAN_STATUS_FAILURE;
}
/* Process RSNCAP */
ptr = ptlv_rsn_ie->rsn_ie + sizeof(t_u16) + 4 * sizeof(t_u8) +
sizeof(t_u16) +
pairwise_cipher_count * PAIRWISE_CIPHER_SUITE_LEN +
sizeof(t_u16) + akm_suite_count * AKM_SUITE_LEN;
prsn_cap = (t_u16 *)ptr;
ptr = (t_u16 *)(ptlv_rsn_ie->rsn_ie + sizeof(t_u16) + 4 * sizeof(t_u8) +
sizeof(t_u16) +
pairwise_cipher_count * PAIRWISE_CIPHER_SUITE_LEN +
sizeof(t_u16) + akm_suite_count * AKM_SUITE_LEN);
prsn_cap = ptr;
ap_mfpc = ((*prsn_cap & (0x1 << MFPC_BIT)) == (0x1 << MFPC_BIT));
ap_mfpr = ((*prsn_cap & (0x1 << MFPR_BIT)) == (0x1 << MFPR_BIT));
@ -843,66 +743,15 @@ static int wlan_update_rsn_ie(mlan_private *pmpriv,
((!ap_mfpc) && ap_mfpr) ||
(ap_mfpc && ap_mfpr && (!pmpriv->pmfcfg.mfpc))) {
PRINTM(MERROR,
"RSNE: Mismatch in PMF config of STA and AP, can't associate to AP\n");
"Mismatch in PMF config of STA and AP, can't associate to AP\n");
return MLAN_STATUS_FAILURE;
}
*prsn_cap |= PMF_MASK;
*prsn_cap &= pmf_mask;
if ((pmpriv->pmfcfg.mfpr && pmpriv->pmfcfg.mfpc) ||
pmpriv->pmfcfg.mfpc) {
*prsn_cap |= PMF_MASK;
*prsn_cap &= pmf_mask;
}
// PMKID
ptr += sizeof(t_u16);
if (end_ptr >= (ptr + sizeof(t_u16))) {
pmkid_count = wlan_le16_to_cpu(*(t_u16 *)ptr);
ptr += sizeof(t_u16);
if (pmkid_count &&
(end_ptr >= (ptr + pmkid_count * PMKID_LEN))) {
pmkid_list_ptr = ptr;
ptr += pmkid_count * PMKID_LEN;
}
}
// Group Mgmt Cipher Suite
if ((end_ptr >= (ptr + GROUP_MGMT_CIPHER_SUITE_LEN)) &&
(pmf_mask & PMF_MASK)) {
group_mgmt_cipher_suite_ptr = ptr;
}
/* Compose new RSNE */
// pairwiase
ptr = pairwise_cipher_count_ptr;
*(t_u16 *)ptr = wlan_cpu_to_le16(1);
ptr += sizeof(t_u16);
oui[3] = cipher_selected_id;
*(t_u32 *)ptr = *(t_u32 *)oui;
ptr += PAIRWISE_CIPHER_SUITE_LEN;
// akm
*(t_u16 *)ptr = wlan_cpu_to_le16(1);
ptr += sizeof(t_u16);
oui[3] = akm_type_id;
*(t_u32 *)ptr = *(t_u32 *)oui;
ptr += AKM_SUITE_LEN;
// RSNCAP
*(t_u16 *)ptr = wlan_cpu_to_le16(*prsn_cap);
ptr += sizeof(t_u16);
// PMKID list
if (pmkid_list_ptr || group_mgmt_cipher_suite_ptr) {
// Add PMKID
*(t_u16 *)ptr = wlan_cpu_to_le16(pmkid_count);
ptr += sizeof(t_u16);
if (pmkid_count) {
memcpy_ext(pmadapter, ptr, (t_u8 *)pmkid_list_ptr,
(pmkid_count * PMKID_LEN), (end_ptr - ptr));
ptr += pmkid_count * PMKID_LEN;
}
if (group_mgmt_cipher_suite_ptr) {
// Add Group Mgmt Cipher Suite
memcpy_ext(pmadapter, ptr,
(t_u8 *)group_mgmt_cipher_suite_ptr,
GROUP_MGMT_CIPHER_SUITE_LEN,
(end_ptr - ptr));
ptr += GROUP_MGMT_CIPHER_SUITE_LEN;
}
}
*rsn_ie_len = ptr - ptlv_rsn_ie->rsn_ie;
return ret;
}
@ -1031,21 +880,21 @@ 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;
t_u32 rates_size;
t_u16 tmp_cap;
t_u8 *pos;
#ifdef DRV_EMBEDDED_SUPPLICANT
void *rsn_wpa_ie_tmp = MNULL;
#endif
t_u8 ft_akm = 0;
t_u8 oper_class;
t_u8 oper_class_flag = MFALSE;
t_u8 akm_type = 0;
MrvlIEtypes_HostMlme_t *host_mlme_tlv = MNULL;
MrvlIEtypes_PrevBssid_t *prev_bssid_tlv = MNULL;
t_u8 zero_mac[MLAN_MAC_ADDR_LENGTH] = {0};
MrvlIEtypes_MultiAp_t *multi_ap_tlv = MNULL;
ENTER();
@ -1056,9 +905,6 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
/* Save so we know which BSS Desc to use in the response handler */
pmpriv->pattempted_bss_desc = pbss_desc;
memcpy_ext(pmpriv->adapter, &pmpriv->curr_bss_params.attemp_bssid,
pbss_desc->mac_address, MLAN_MAC_ADDR_LENGTH,
MLAN_MAC_ADDR_LENGTH);
/* clear assoc_rsp_size */
pmpriv->assoc_rsp_size = 0;
pmpriv->assoc_req_size = 0;
@ -1123,8 +969,7 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
PRINTM(MINFO, "ASSOC_CMD: Rates size = %d\n", rates_size);
/* Add the Authentication type to be used for Auth frames if needed */
if ((pmpriv->sec_info.authentication_mode != MLAN_AUTH_MODE_AUTO) ||
(pbss_desc->owe_transition_mode == OWE_TRANS_MODE_OWE)) {
if ((pmpriv->sec_info.authentication_mode != MLAN_AUTH_MODE_AUTO)) {
pauth_tlv = (MrvlIEtypes_AuthType_t *)pos;
pauth_tlv->header.type = wlan_cpu_to_le16(TLV_TYPE_AUTH_TYPE);
pauth_tlv->header.len = sizeof(pauth_tlv->auth_type);
@ -1141,16 +986,9 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
MLAN_AUTH_MODE_SAE)
pauth_tlv->auth_type =
wlan_cpu_to_le16(AssocAgentAuth_Wpa3Sae);
else if (!pmpriv->curr_bss_params.host_mlme &&
((pbss_desc->owe_transition_mode ==
OWE_TRANS_MODE_OWE) ||
pmpriv->sec_info.authentication_mode ==
MLAN_AUTH_MODE_OWE))
pauth_tlv->auth_type =
wlan_cpu_to_le16(AssocAgentAuth_Owe);
else
pauth_tlv->auth_type =
wlan_cpu_to_le16(AssocAgentAuth_Open);
wlan_cpu_to_le16(MLAN_AUTH_MODE_OPEN);
pos += sizeof(pauth_tlv->header) + pauth_tlv->header.len;
pauth_tlv->header.len = wlan_cpu_to_le16(pauth_tlv->header.len);
}
@ -1167,8 +1005,8 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
psae_pwe_mode_tlv = (MrvlIEtypes_SAE_PWE_Mode_t *)pos;
psae_pwe_mode_tlv->header.type = wlan_cpu_to_le16(
TLV_TYPE_WPA3_SAE_PWE_DERIVATION_MODE);
psae_pwe_mode_tlv->header.len = wlan_cpu_to_le16(
sizeof(psae_pwe_mode_tlv->pwe));
psae_pwe_mode_tlv->header.len =
sizeof(psae_pwe_mode_tlv->pwe);
psae_pwe_mode_tlv->pwe[0] =
pbss_desc->prsnx_ie->data[0];
pos += sizeof(psae_pwe_mode_tlv->header) +
@ -1199,6 +1037,7 @@ 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);
@ -1253,13 +1092,21 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
psecurity_cfg_ie->header.len = sizeof(t_u8);
pos += sizeof(psecurity_cfg_ie->header) +
psecurity_cfg_ie->header.len;
psecurity_cfg_ie->header.len =
wlan_cpu_to_le16(psecurity_cfg_ie->header.len);
} else if (pmpriv->sec_info.ewpa_enabled ||
(pbss_desc->owe_transition_mode ==
OWE_TRANS_MODE_OWE) ||
(pmpriv->sec_info.authentication_mode ==
MLAN_AUTH_MODE_OWE)) {
}
#ifdef DRV_EMBEDDED_SUPPLICANT
else if (supplicantIsEnabled(pmpriv->psapriv)) {
supplicantClrEncryptKey(pmpriv->psapriv);
if (pbss_desc->prsn_ie)
rsn_wpa_ie_tmp = pbss_desc->prsn_ie;
else if (pbss_desc->pwpa_ie)
rsn_wpa_ie_tmp = pbss_desc->pwpa_ie;
prsn_ie_tlv = (MrvlIEtypes_RsnParamSet_t *)pos;
pos += supplicantFormatRsnWpaTlv(
pmpriv->psapriv, rsn_wpa_ie_tmp, prsn_ie_tlv);
}
#endif
else if (pmpriv->sec_info.ewpa_enabled) {
prsn_ie_tlv = (MrvlIEtypes_RsnParamSet_t *)pos;
if (pbss_desc->pwpa_ie) {
prsn_ie_tlv->header.type =
@ -1318,16 +1165,8 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
.data[0]),
prsn_ie_tlv->header.len,
prsn_ie_tlv->header.len);
akm_type =
pauth_tlv ?
wlan_le16_to_cpu(
pauth_tlv
->auth_type) :
AssocAgentAuth_Auto;
ret = wlan_update_rsn_ie(
pmpriv, prsn_ie_tlv,
&prsn_ie_tlv->header.len,
&akm_type);
ret = wlan_update_rsn_ie(pmpriv,
prsn_ie_tlv);
if (ret != MLAN_STATUS_SUCCESS) {
goto done;
}
@ -1344,58 +1183,6 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
prsn_ie_tlv->header.len;
prsn_ie_tlv->header.len = wlan_cpu_to_le16(
prsn_ie_tlv->header.len);
if ((pauth_tlv == MNULL) &&
(pmpriv->sec_info.authentication_mode ==
MLAN_AUTH_MODE_AUTO)) {
pauth_tlv =
(MrvlIEtypes_AuthType_t *)pos;
pauth_tlv->header.type =
wlan_cpu_to_le16(
TLV_TYPE_AUTH_TYPE);
pauth_tlv->header.len =
sizeof(pauth_tlv->auth_type);
pauth_tlv->auth_type =
wlan_cpu_to_le16(akm_type);
pos += sizeof(pauth_tlv->header) +
pauth_tlv->header.len;
pauth_tlv->header.len =
wlan_cpu_to_le16(
pauth_tlv->header.len);
}
}
if ((pbss_desc->prsnx_ie) &&
(akm_type == AssocAgentAuth_Wpa3Sae)) {
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);
}
}
}
@ -1431,14 +1218,8 @@ 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);
if ((!pbss_desc->disable_11n) &&
(ISSUPP_11NENABLED(pmadapter->fw_cap_info) ||
ISSUPP_11ACENABLED(pmadapter->fw_cap_info) ||
IS_FW_SUPPORT_11AX(pmadapter))) {
PRINTM(MCMND, "STBC NOT supported, Will be disabled\n");
}
wlan_wmm_process_association_req(pmpriv, &pos, &pbss_desc->wmm_ie);
wlan_wmm_process_association_req(pmpriv, &pos, &pbss_desc->wmm_ie,
pbss_desc->pht_cap);
if (pmpriv->sec_info.wapi_enabled && pmpriv->wapi_ie_len)
wlan_cmd_append_wapi_ie(pmpriv, &pos);
@ -1456,20 +1237,18 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
host_mlme_tlv = (MrvlIEtypes_HostMlme_t *)pos;
host_mlme_tlv->header.type =
wlan_cpu_to_le16(TLV_TYPE_HOST_MLME);
host_mlme_tlv->header.len = sizeof(host_mlme_tlv->host_mlme);
host_mlme_tlv->header.len =
wlan_cpu_to_le16(sizeof(host_mlme_tlv->host_mlme));
host_mlme_tlv->host_mlme = MTRUE;
pos += sizeof(host_mlme_tlv->header) +
host_mlme_tlv->header.len;
host_mlme_tlv->header.len =
wlan_cpu_to_le16(host_mlme_tlv->header.len);
}
if (memcmp(pmadapter, &pmpriv->curr_bss_params.prev_bssid, zero_mac,
MLAN_MAC_ADDR_LENGTH)) {
prev_bssid_tlv = (MrvlIEtypes_PrevBssid_t *)pos;
prev_bssid_tlv->header.type =
wlan_cpu_to_le16(TLV_TYPE_PREV_BSSID);
prev_bssid_tlv->header.len =
wlan_cpu_to_le16(MLAN_MAC_ADDR_LENGTH);
prev_bssid_tlv->header.len = MLAN_MAC_ADDR_LENGTH;
memcpy_ext(pmadapter, prev_bssid_tlv->prev_bssid,
&pmpriv->curr_bss_params.prev_bssid,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
@ -1478,18 +1257,6 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
pos += sizeof(prev_bssid_tlv->header) + MLAN_MAC_ADDR_LENGTH;
}
if (pmpriv->multi_ap_flag) {
multi_ap_tlv = (MrvlIEtypes_MultiAp_t *)pos;
multi_ap_tlv->header.type = wlan_cpu_to_le16(TLV_TYPE_MULTI_AP);
multi_ap_tlv->header.len = sizeof(multi_ap_tlv->flag);
multi_ap_tlv->flag = pmpriv->multi_ap_flag;
PRINTM(MINFO, " TLV multi_ap_flag : 0x%x\n",
multi_ap_tlv->flag);
pos += sizeof(multi_ap_tlv->header) + multi_ap_tlv->header.len;
multi_ap_tlv->header.len =
wlan_cpu_to_le16(sizeof(multi_ap_tlv->flag));
}
if (wlan_11d_create_dnld_countryinfo(pmpriv, pbss_desc->bss_band)) {
PRINTM(MERROR, "Dnld_countryinfo_11d failed\n");
ret = MLAN_STATUS_FAILURE;
@ -1519,9 +1286,6 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
if (pmpriv->config_bands == BAND_B)
SHORT_SLOT_TIME_DISABLED(tmp_cap);
if (pmpriv->adapter->pcard_info->support_11mc)
RADIO_MEASUREMENT_ENABLED(tmp_cap);
tmp_cap &= CAPINFO_MASK;
PRINTM(MINFO, "ASSOC_CMD: tmp_cap=%4X CAPINFO_MASK=%4lX\n", tmp_cap,
CAPINFO_MASK);
@ -1674,19 +1438,11 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
pmpriv->pattempted_bss_desc->mac_address,
MLAN_MAC_ADDR_LENGTH))
wlan_reset_connect_state(pmpriv, MTRUE);
else {
memcpy_ext(
pmpriv->adapter,
&pmpriv->curr_bss_params.attemp_bssid,
pmpriv->curr_bss_params.bss_descriptor
.mac_address,
MLAN_MAC_ADDR_LENGTH,
MLAN_MAC_ADDR_LENGTH);
else
wlan_recv_event(
pmpriv,
MLAN_EVENT_ID_DRV_ASSOC_FAILURE_REPORT,
MNULL);
}
} else
wlan_reset_connect_state(pmpriv, MTRUE);
pmpriv->adapter->dbg.num_cmd_assoc_failure++;
@ -1713,7 +1469,6 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
/* Send a Media Connected event, according to the Spec */
pmpriv->media_connected = MTRUE;
pmpriv->multi_ap_flag = 0;
pmpriv->adapter->pps_uapsd_mode = MFALSE;
pmpriv->adapter->tx_lock_flag = MFALSE;
pmpriv->adapter->delay_null_pkt = MFALSE;
@ -1734,7 +1489,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 = pbss_desc->bss_band;
pmpriv->curr_bss_params.band = (t_u8)pbss_desc->bss_band;
/* Store current channel for further reference.
* This would save one extra call to get current
@ -1743,7 +1498,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
*/
@ -1754,7 +1509,10 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
else
pmpriv->curr_bss_params.wmm_enabled = MFALSE;
if (pmpriv->wmm_required && pmpriv->curr_bss_params.wmm_enabled)
if ((pmpriv->wmm_required ||
(pbss_desc->pht_cap &&
(pbss_desc->pht_cap->ieee_hdr.element_id == HT_CAPABILITY))) &&
pmpriv->curr_bss_params.wmm_enabled)
pmpriv->wmm_enabled = MTRUE;
else
pmpriv->wmm_enabled = MFALSE;
@ -1846,16 +1604,18 @@ 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 &&
!pmpriv->sec_info.ewpa_enabled && !pmpriv->sec_info.wapi_enabled &&
!pmpriv->wps.session_enable && !pmpriv->sec_info.osen_enabled) {
!pmpriv->wps.session_enable && !pmpriv->sec_info.osen_enabled
#ifdef DRV_EMBEDDED_SUPPLICANT
&& !supplicantIsEnabled(pmpriv->psapriv)
#endif
) {
/* We are in Open/WEP mode, open port immediately */
if (pmpriv->port_ctrl_mode == MTRUE) {
pmpriv->port_open = MTRUE;
@ -1864,9 +1624,22 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
}
if (pmpriv->sec_info.wpa_enabled || pmpriv->sec_info.wpa2_enabled ||
pmpriv->sec_info.ewpa_enabled || pmpriv->sec_info.wapi_enabled ||
pmpriv->wps.session_enable || pmpriv->sec_info.osen_enabled)
pmpriv->wps.session_enable || pmpriv->sec_info.osen_enabled
#ifdef DRV_EMBEDDED_SUPPLICANT
|| (supplicantIsEnabled(pmpriv->psapriv))
#endif
)
pmpriv->adapter->scan_block = MTRUE;
#ifdef DRV_EMBEDDED_SUPPLICANT
supplicantInitSession(
pmpriv->psapriv,
(t_u8 *)&pmpriv->curr_bss_params.bss_descriptor.ssid.ssid,
pmpriv->curr_bss_params.bss_descriptor.ssid.ssid_len,
(t_u8 *)&pmpriv->curr_bss_params.bss_descriptor.mac_address,
(t_u8 *)&pmpriv->curr_addr);
#endif
pevent = (mlan_event *)event_buf;
memset(pmadapter, event_buf, 0, sizeof(event_buf));
pevent->bss_index = pmpriv->bss_index;
@ -1903,6 +1676,7 @@ done:
pioctl_req->status_code = MLAN_ERROR_NO_ERROR;
}
}
LEAVE();
return ret;
}
@ -2232,7 +2006,6 @@ 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();
@ -2325,7 +2098,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 = pbss_desc->bss_band;
pmpriv->curr_bss_params.band = (t_u8)pbss_desc->bss_band;
if (pmpriv->sec_info.wep_status == Wlan802_11WEPEnabled ||
pmpriv->sec_info.wpa_enabled || pmpriv->sec_info.ewpa_enabled)
@ -2371,17 +2144,10 @@ 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
*/
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;
}
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);
if (pmpriv->sec_info.wpa_enabled) {
prsn_ie_tlv = (MrvlIEtypes_RsnParamSet_t *)pos;

View file

@ -10,18 +10,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/

View file

@ -5,20 +5,29 @@
* in MLAN module.
*
*
* Copyright 2008-2023 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -308,56 +317,6 @@ 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_he_sig1 = wlan_le32_to_cpu((x)->vht_he_sig1); \
(x)->vht_he_sig2 = wlan_le32_to_cpu((x)->vht_he_sig2); \
(x)->user_idx = wlan_le32_to_cpu((x)->user_idx); \
} while (0)
#else
/** Convert ulong n/w to host */
#define mlan_ntohl(x) swap_byte_32(x)
/** Convert host ulong to n/w */
@ -391,7 +350,6 @@ 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);
@ -558,9 +516,24 @@ extern t_void (*assert_callback)(t_void *pmoal_handle, t_u32 cond);
/** Type vdll */
#define MLAN_TYPE_VDLL 4
#ifdef SDIO
/** Type single port aggr data */
#define MLAN_TYPE_SPA_DATA 10
/** OFFSET of 512 block number */
#define OFFSET_OF_BLOCK_NUMBER 15
/** OFFSET of SDIO Header */
#define OFFSET_OF_SDIO_HEADER 28
/** sdio max rx size for cmd53, 255 * 256, reserve 1 block for DMA alignment */
#define SDIO_CMD53_MAX_SIZE 65280
#define MAX_SUPPORT_AMSDU_SIZE 4096
/** Maximum numbfer of registers to read for multiple port */
#if defined(SD8887) || defined(SD8997) || defined(SD8977) || \
defined(SD8987) || defined(SD9098) || defined(SD9097) || \
defined(SDNW62X) || defined(SD8978) || defined(SD9177)
#define MAX_MP_REGS 196
#else
/* upto 0xB7 */
#define MAX_MP_REGS 184
#endif
/** Maximum port */
#define MAX_PORT 32
/** Maximum port 16 */
@ -597,14 +570,10 @@ extern t_void (*assert_callback)(t_void *pmoal_handle, t_u32 cond);
#define MFG_CMD_RF_CHANNELBW 0x1044
#define MFG_CMD_RADIO_MODE_CFG 0x1211
#define MFG_CMD_CONFIG_MAC_HE_TB_TX 0x110A
#define MFG_CMD_CONFIG_TRIGGER_FRAME 0x110C
/** Debug command number */
#define DBG_CMD_NUM 10
/** scan GAP value is optional */
#define GAP_FLAG_OPTIONAL MBIT(15)
/** Info for debug purpose */
typedef struct _wlan_dbg {
/** Number of host to card command failures */
@ -660,12 +629,6 @@ typedef struct _wlan_dbg {
t_u16 last_event_index;
/** Number of no free command node */
t_u16 num_no_cmd_node;
/** num_assoc_cmd_error, count result 4 error */
t_u16 num_assoc_err;
/** num_scan_cmd_error, count result 4 error */
t_u16 num_scan_err;
/** num_remain_on_channel_cmd_error, count result 4 error */
t_u16 num_remain_chan_err;
} wlan_dbg;
/** Hardware status codes */
@ -700,6 +663,11 @@ typedef enum _PS_STATE {
PS_STATE_SLEEP
} PS_STATE;
/** Minimum flush timer for win size of 1 is 50 ms */
#define MIN_FLUSH_TIMER_MS 50
/** Minimum flush timer for win size of 1 is 15 ms */
#define MIN_FLUSH_TIMER_15_MS 15
/** Tx BA stream table */
typedef struct _TxBAStreamTbl TxBAStreamTbl;
@ -733,9 +701,7 @@ typedef struct _txAggr_t {
typedef enum _baStatus_e {
BA_STREAM_NOT_SETUP = 0,
BA_STREAM_SETUP_INPROGRESS,
BA_STREAM_SETUP_SENT_ADDBA,
BA_STREAM_SETUP_COMPLETE,
BA_STREAM_SENT_DELBA,
BA_STREAM_SETUP_COMPLETE
} baStatus_e;
/** RA list table */
@ -863,10 +829,7 @@ typedef struct {
t_u8 data_rates[WLAN_SUPPORTED_RATES];
/** Host MLME flag*/
t_u8 host_mlme;
/** prev_bssid */
mlan_802_11_mac_addr prev_bssid;
/** attemp_bssid */
mlan_802_11_mac_addr attemp_bssid;
t_u8 use_mfp;
} current_bss_params_t;
@ -1193,8 +1156,6 @@ 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 */
@ -1330,7 +1291,6 @@ typedef struct _mlan_private {
/** IP address */
t_u8 ip_addr[IPADDR_LEN];
t_u32 hotspot_cfg;
t_u8 multi_ap_flag;
#ifdef STA_SUPPORT
ExtCap_t ext_cap;
ExtCap_t def_ext_cap;
@ -1340,11 +1300,12 @@ typedef struct _mlan_private {
#ifdef USB
/** USB data port */
t_u32 port;
/** port Index */
t_u32 port_index;
#endif
/** Control TX AMPDU on infra link */
t_u8 txaggrctrl;
#if defined(DRV_EMBEDDED_AUTHENTICATOR) || defined(DRV_EMBEDDED_SUPPLICANT)
t_void *psapriv;
#endif
/** rx per packet info */
t_u8 rx_pkt_info;
/** received amsdu count*/
@ -1355,12 +1316,6 @@ 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 {
@ -1401,14 +1356,6 @@ typedef struct {
mlan_private *priv;
} reorder_tmr_cnxt_t;
#define MLAN_SET_BIT(x, val) ((x) |= (1UL << (val)))
#define MLAN_CLEAR_BIT(x, val) ((x) &= ~(1UL << (val)))
/** default RX reorder table flush time 128 ms for AC_VI, AC_VO*/
#define DEF_FLUSH_TIME_AC_VI_VO 128
/** default RX reorder table flush time 512 ms for AC_BE, AC_BK*/
#define DEF_FLUSH_TIME_AC_BE_BK 512
/** minimal AMPDU flush time */
#define MIN_FLUSH_TIME 100
/** RX reorder table */
struct _RxReorderTbl {
/** RxReorderTbl previous node */
@ -1440,8 +1387,6 @@ struct _RxReorderTbl {
t_u8 pkt_count;
/** flush data flag */
t_u8 flush_data;
/** BA window bitmap */
t_u64 bitmap;
};
/** BSS priority node */
@ -1583,9 +1528,10 @@ struct _sta_node {
t_u8 tx_pause;
/** station band mode */
t_u16 bandmode;
#if defined(DRV_EMBEDDED_AUTHENTICATOR) || defined(DRV_EMBEDDED_SUPPLICANT)
t_void *cm_connectioninfo;
#endif
sta_stats stats;
/** station aid */
t_u16 aid;
};
/** 802.11h State information kept in the 'mlan_adapter' driver structure */
@ -1652,8 +1598,6 @@ 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,
@ -1822,7 +1766,7 @@ typedef struct _usb_rx_deaggr_params {
usb_aggr_ctrl_cfg aggr_ctrl;
} usb_rx_deaggr_params;
#define MAX_USB_TX_PORT_NUM 2
#define MAX_USB_TX_PORT_NUM 1
/** data structure for USB Tx Aggregation */
typedef struct _usb_tx_aggr_params {
/** Tx aggregation control */
@ -1864,7 +1808,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;
@ -1925,22 +1869,17 @@ typedef struct _mlan_init_para {
t_u32 dev_cap_mask;
/** oob independent reset mode */
t_u32 indrstcfg;
/** drcs channel time mode */
t_u32 drcs_chantime_mode;
/** passive to active scan */
t_u8 passive_to_active_scan;
/** uap max sta */
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
@ -2098,6 +2037,10 @@ typedef struct _mlan_sdio_card {
/** GPIO interrupt pin number */
t_u32 gpio_pin;
/** flag for sdio rx aggr */
t_bool sdio_rx_aggr_enable;
/** fw rx block size */
t_u16 sdio_rx_block_size;
} mlan_sdio_card, *pmlan_sdio_card;
#endif
@ -2165,12 +2108,7 @@ typedef struct _mlan_pcie_card_reg {
t_u32 host_intr_cmd_done;
/** Event ready interrupt for host */
t_u32 host_intr_event_rdy;
/** cmd dnld interrupt for host */
t_u32 host_intr_cmd_dnld;
/** adma align size */
t_u8 adma_align_size;
/** adma min pkt size */
t_u8 adma_min_pkt_size;
/* TX/RX buffer description mask */
t_u32 txrx_rw_ptr_mask;
/* TX/RX buffer description wrap mask */
@ -2266,8 +2204,6 @@ typedef struct _mlan_usb_card {
/** USB sggregation supported by FW */
t_u8 fw_usb_aggr;
/** port status: MFALSE-port available MTRUE--port busy*/
t_u8 usb_port_status[MAX_USB_TX_PORT_NUM];
} mlan_usb_card, *pmlan_usb_card;
#endif
@ -2285,7 +2221,6 @@ typedef struct _mlan_card_info {
t_u8 supp_ps_handshake;
/** DEFAULT_11N_TX_BF_CAP */
t_u32 default_11n_tx_bf_cap;
t_u8 support_11mc;
} mlan_card_info, *pmlan_card_info;
typedef struct _mlan_adapter mlan_adapter, *pmlan_adapter;
@ -2297,7 +2232,7 @@ typedef struct _adapter_operations {
/**interrupt handler*/
mlan_status (*interrupt)(t_u16 msg_id, pmlan_adapter pmadapter);
/**INT process handler*/
mlan_status (*process_int_status)(pmlan_adapter pmadapter, t_u8 type);
mlan_status (*process_int_status)(pmlan_adapter pmadapter);
/**host to card handler*/
mlan_status (*host_to_card)(pmlan_private pmpriv, t_u8 type,
mlan_buffer *pmbuf,
@ -2329,7 +2264,7 @@ typedef struct _adapter_operations {
} mlan_adapter_operations;
/** Adapter data structure for MLAN */
struct _mlan_adapter {
typedef struct _mlan_adapter {
/** MOAL handle structure */
t_void *pmoal_handle;
/** BSS Attributes */
@ -2348,16 +2283,6 @@ struct _mlan_adapter {
t_void *pmlan_lock;
/** main_proc_lock for main_process */
t_void *pmain_proc_lock;
#ifdef PCIE
/** rx data lock to synchronize wlan_pcie_process_recv_data */
t_void *pmlan_rx_lock;
/** tx data lock to synchronize send_data and send_data_complete */
t_void *pmlan_tx_lock;
/** event lock to synchronize process_event and event_ready */
t_void *pmlan_event_lock;
/** pcie lock to synchronize rxbd_wr_ptr and txbd_wr_ptr */
t_void *pmlan_pcie_lock;
#endif
/** mlan_processing */
t_u32 mlan_processing;
/** main_process_cnt */
@ -2376,10 +2301,6 @@ struct _mlan_adapter {
t_u32 more_task_flag;
/** delay task flag */
t_u32 delay_task_flag;
#ifdef PCIE
/** delay rx data */
t_u32 delay_rx_data_flag;
#endif
/** Max tx buf size */
t_u16 max_tx_buf_size;
/** Tx buf size */
@ -2424,9 +2345,13 @@ struct _mlan_adapter {
t_u32 fw_cap_info;
/** Extended firmware capability information */
t_u32 fw_cap_ext;
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
/** High byte for 5G, low byte for 2G, like 0x2211 0x22 for 5G, 0x11 for
* 2G */
t_u16 user_htstream;
#endif
/** vdll ctrl */
vdll_dnld_ctrl vdll_ctrl;
#if defined(SDIO) || defined(PCIE)
@ -2523,8 +2448,6 @@ 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*/
@ -2580,8 +2503,6 @@ 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 */
@ -2596,9 +2517,6 @@ struct _mlan_adapter {
t_u32 num_in_chan_stats;
/** index of chan stats */
t_u32 idx_chan_stats;
ChanStatistics_t *pold_chan_stats;
/** index of chan stats */
t_u32 old_idx_chan_stats;
t_u8 bgscan_reported;
/** Number of records in the scan table */
@ -2657,14 +2575,6 @@ struct _mlan_adapter {
/** Tx data endpoint address */
t_u8 tx_data_ep;
#endif
/** Multi channel status */
t_u8 mc_status;
#ifdef USB
/** port status: MFALSE-port available MTRUE--port busy*/
t_u8 usb_port_status[MAX_USB_TX_PORT_NUM];
/** usb tx ports */
t_u8 usb_tx_ports[MAX_USB_TX_PORT_NUM];
#endif
/** sleep_params_t */
sleep_params_t sleep_params;
@ -2746,8 +2656,6 @@ struct _mlan_adapter {
t_u32 hw_dot_11n_dev_cap;
/** Device support for MIMO abstraction of MCSs */
t_u8 hw_dev_mcs_support;
/** mpdu density */
t_u8 hw_mpdu_density;
#ifdef STA_SUPPORT
/** Adhoc Secondary Channel Bandwidth */
t_u8 chan_bandwidth;
@ -2842,7 +2750,6 @@ struct _mlan_adapter {
t_u8 coex_rx_winsize;
t_bool dfs_repeater;
t_u32 dfsr_channel;
t_bool mc_policy;
t_u8 chanrpt_param_bandcfg;
#if defined(PCIE)
mlan_buffer *ssu_buf;
@ -2863,26 +2770,15 @@ struct _mlan_adapter {
t_u8 tx_power_table_a_cols;
/**mlan adapter operations*/
mlan_adapter_operations ops;
#ifdef DRV_EMBEDDED_AUTHENTICATOR
/** authenticator_priv */
pmlan_private authenticator_priv;
#endif
/** TP accounting mode 1-enable 0-disable */
t_u32 tp_state_on;
/** Packet drop point */
t_u32 tp_state_drop_point;
/** second mac flag */
t_u8 second_mac;
/** napi */
t_u8 napi;
/* lower 8 bytes of uuid */
t_u64 uuid_lo;
/* higher 8 bytes of uuid */
t_u64 uuid_hi;
/** AC BK/BE_flush time*/
t_u16 flush_time_ac_be_bk;
/** AC VI/VO flush time */
t_u16 flush_time_ac_vi_vo;
/** remain_on_channel flag */
t_u8 remain_on_channel;
};
} mlan_adapter, *pmlan_adapter;
/** Check if stream 2X2 enabled */
#define IS_STREAM_2X2(x) ((x)&FEATURE_CTRL_STREAM_2X2)
@ -2901,19 +2797,6 @@ struct _mlan_adapter {
/** Ethernet packet type offset */
#define MLAN_ETHER_PKT_TYPE_OFFSET (12)
/** Rx packet Sniffer Operation Mode
*
* MODE1 : Can be enabled only in disconnected state.
*
* MODE3 : Can be enabled irrespective of active connection state.
* Both 802.11 and rtap headers are attached to all destined
* unicast data frames in the FW and uploaded to the host driver.
* Such frame will be duplicated in mlan, one for monitor interface
* and other for data interface, by reconstructing the 802.3 header.
*/
#define NET_MON_MODE_DISABLED 0
#define NET_MON_MODE1 1
#define NET_MON_MODE3 3
mlan_status wlan_cmd_net_monitor(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action, t_void *pdata_buf);
@ -2998,7 +2881,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,
@ -3171,9 +3054,8 @@ 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 MBIT(0)
#define MOAL_MALLOC_BUFFER MBIT(1)
#define MOAL_MEM_FLAG_ATOMIC MBIT(2)
#define MOAL_ALLOC_MLAN_BUFFER (0)
#define MOAL_MALLOC_BUFFER (1)
#ifdef PCIE
/* This defines the direction arg to the DMA mapping routines. */
@ -3271,14 +3153,6 @@ mlan_status wlan_misc_gpio_tsf_latch_config(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_get_tsf_info(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_cmd_cross_chip_synch(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd, t_u16 cmd_action,
t_void *pdata_buf);
mlan_status wlan_ret_cross_chip_synch(pmlan_private pmpriv,
HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
mlan_status wlan_misc_ioctl_cross_chip_synch(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
/** get ralist info */
int wlan_get_ralist_info(mlan_private *priv, pralist_info buf);
/** dump ralist */
@ -3382,61 +3256,19 @@ mlan_status wlan_adapter_init_cmd(pmlan_adapter pmadapter);
mlan_status wlan_radio_ioctl_band_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_handle_event_multi_chan_info(pmlan_private pmpriv,
pmlan_buffer pevent);
#ifdef USB
/**
* @brief This function update the port status
*
* @param pmadapter A pointer to mlan_adapter
* @param port USB port
* @param status port status
*
* @return N/A
*/
static INLINE void wlan_update_port_status(pmlan_adapter pmadapter, t_u32 port,
t_u8 status)
{
int i;
for (i = 0; i < MAX_USB_TX_PORT_NUM; i++) {
if (port == pmadapter->usb_tx_ports[i]) {
pmadapter->pcard_usb->usb_port_status[i] = status;
break;
}
}
return;
}
inline t_u8 wlan_usb_data_sent(pmlan_adapter pmadapter);
void wlan_resync_usb_port(pmlan_adapter pmadapter);
/**
* @brief This function return port index
*
* @param pmadapter A pointer to mlan_adapter
* @param port USB port
* @return port index
*
*/
static INLINE t_u8 wlan_get_port_index(pmlan_adapter pmadapter, t_u32 port)
{
t_u8 i;
for (i = 0; i < MAX_USB_TX_PORT_NUM; i++) {
if (port == pmadapter->usb_tx_ports[i]) {
return i;
}
}
return 0;
}
#ifdef RX_PACKET_COALESCE
mlan_status wlan_cmd_rx_pkt_coalesce_cfg(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action, t_void *pdata_buf);
mlan_status wlan_ret_rx_pkt_coalesce_cfg(pmlan_private pmpriv,
const HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
#endif
#ifdef STA_SUPPORT
/** warm reset */
mlan_status wlan_misc_ioctl_warm_reset(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
#ifdef STA_SUPPORT
/** Process received packet */
mlan_status wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf);
/** ioctl handler for station mode */
@ -3483,10 +3315,6 @@ 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);
mlan_status wlan_scan_ioctl(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
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,
@ -3630,28 +3458,12 @@ mlan_status wlan_cmd_rxabortcfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action, t_void *pdata_buf);
mlan_status wlan_ret_rxabortcfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
mlan_status wlan_cmd_ofdmdesense_cfg(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd, t_u16 cmd_action,
t_void *pdata_buf);
mlan_status wlan_ret_ofdmdesense_cfg(pmlan_private pmpriv,
HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
mlan_status wlan_cmd_rxabortcfg_ext(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd, t_u16 cmd_action,
t_void *pdata_buf);
mlan_status wlan_cmd_nav_mitigation(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd, t_u16 cmd_action,
t_void *pdata_buf);
mlan_status wlan_cmd_led_config(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action, t_void *pdata_buf);
mlan_status wlan_ret_rxabortcfg_ext(pmlan_private pmpriv,
HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
mlan_status wlan_ret_nav_mitigation(pmlan_private pmpriv,
HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
mlan_status wlan_ret_led_config(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
mlan_status wlan_cmd_tx_ampdu_prot_mode(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action, t_void *pdata_buf);
@ -3694,14 +3506,8 @@ mlan_status wlan_ret_arb_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
mlan_status wlan_misc_ioctl_rxabortcfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_ioctl_ofdmdesense_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_ioctl_rxabortcfg_ext(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_ioctl_nav_mitigation(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_ioctl_led(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_ioctl_tx_ampdu_prot_mode(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_ioctl_dot11mc_unassoc_ftm_cfg(pmlan_adapter pmadapter,
@ -3718,10 +3524,6 @@ mlan_status wlan_misc_ioctl_rf_test_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_ioctl_range_ext(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_ioctl_twt_report(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_ret_twt_report(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
mlan_status wlan_misc_ioctl_arb_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_ioctl_tp_state(pmlan_adapter pmadapter,
@ -3751,8 +3553,6 @@ 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);
@ -3806,10 +3606,6 @@ mlan_status wlan_11d_handle_uap_domain_info(mlan_private *pmpriv, t_u16 band,
mlan_status wlan_11d_cfg_domain_info(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req);
/** This functionn set/get reorder flush time */
mlan_status wlan_misc_ioctl_reorder_flush_time(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req);
/** This function converts region string to CFP table code */
mlan_status wlan_misc_country_2_cfp_table_code(pmlan_adapter pmadapter,
t_u8 *country_code, t_u8 *cfp_bg,
@ -3833,18 +3629,9 @@ sta_node *wlan_add_station_entry(mlan_private *priv, t_u8 *mac);
void wlan_check_sta_capability(pmlan_private priv, pmlan_buffer pevent,
sta_node *sta_ptr);
/** find specific ie */
t_u8 *wlan_get_specific_ie(pmlan_private priv, t_u8 *ie_buf, t_u16 ie_len,
t_u8 *wlan_get_specific_ie(pmlan_private priv, t_u8 *ie_buf, t_u8 ie_len,
IEEEtypes_ElementId_e id, t_u8 ext_id);
t_u8 wlan_is_wmm_ie_present(pmlan_adapter pmadapter, t_u8 *pbuf, t_u16 buf_len);
/** Ethernet II header */
typedef struct {
/** Ethernet II header destination address */
t_u8 dest_addr[MLAN_MAC_ADDR_LENGTH];
/** Ethernet II header source address */
t_u8 src_addr[MLAN_MAC_ADDR_LENGTH];
/** Ethernet II header length */
t_u16 ethertype;
} EthII_Hdr_t;
/**
* @brief This function checks whether a station TDLS link is enabled or not
@ -3935,29 +3722,6 @@ static INLINE int wlan_is_tx_pause(mlan_private *priv, t_u8 *ra)
}
t_u16 wlan_update_ralist_tx_pause(pmlan_private priv, t_u8 *mac, t_u8 tx_pause);
#if defined(USB)
/**
* @brief This function used to check if specific port is ready
*
* @param pmadapter A pointer to mlan_adapter
* @param port_index port index;
*
* @return MTRUE -- port is ready.
* MFALSE -- port is busy.
*/
static inline t_u8 wlan_is_port_ready(pmlan_adapter pmadapter, t_u32 port_index)
{
if (IS_USB(pmadapter->card_type))
return (pmadapter->pcard_usb->usb_port_status[port_index]) ?
MFALSE :
MTRUE;
else
return MTRUE;
}
#endif
mlan_status wlan_check_easymesh_pkt(mlan_private *priv, pmlan_buffer pmbuf,
RxPD *prx_pd);
#ifdef UAP_SUPPORT
mlan_status wlan_process_uap_rx_packet(mlan_private *priv, pmlan_buffer pmbuf);
t_void wlan_drop_tx_pkts(pmlan_private priv);
@ -3977,6 +3741,10 @@ mlan_status wlan_cmd_get_hw_spec(pmlan_private pmpriv,
mlan_status wlan_ret_get_hw_spec(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
t_void *pioctl_buf);
#ifdef SDIO
mlan_status wlan_cmd_sdio_rx_aggr_cfg(HostCmd_DS_COMMAND *pcmd,
t_u16 cmd_action, t_void *pdata_buf);
mlan_status wlan_ret_sdio_rx_aggr_cfg(pmlan_private pmpriv,
HostCmd_DS_COMMAND *resp);
#endif
mlan_status wlan_misc_ioctl_mac_control(pmlan_adapter pmadapter,
@ -4051,33 +3819,6 @@ t_void wlan_tdls_config(pmlan_private pmpriv, t_u8 enable);
mlan_status wlan_misc_ioctl_tdls_cs_channel(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_config_rtt(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_cancel_rtt(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_rtt_responder_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_cmd_802_11_ftm_config_session_params(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action,
t_u32 cmd_oid,
t_void *pdata_buf);
mlan_status
wlan_ret_802_11_ftm_config_session_params(pmlan_private pmpriv,
HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
mlan_status wlan_fill_hal_rtt_results(pmlan_private pmpriv,
Event_WLS_FTM_t *event_ftm,
t_u32 event_ftm_len, mlan_event *pevent);
mlan_status wlan_cmd_802_11_ftm_config_responder(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action,
t_u32 cmd_oid,
t_void *pdata_buf);
mlan_status wlan_ret_802_11_ftm_config_responder(pmlan_private pmpriv,
HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
mlan_status wlan_get_info_ver_ext(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
@ -4104,13 +3845,12 @@ mlan_status wlan_set_drvdbg(pmlan_adapter pmadapter,
mlan_status wlan_misc_hotspot_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_multi_ap_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
#ifdef STA_SUPPORT
mlan_status wlan_misc_ext_capa_cfg(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
t_u32 wlan_is_ext_capa_support(mlan_private *pmpriv);
#endif
#ifdef STA_SUPPORT
void wlan_add_ext_capa_info_ie(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
@ -4123,6 +3863,14 @@ mlan_status wlan_cmd_boot_sleep(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
mlan_status wlan_ret_boot_sleep(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
#if defined(DRV_EMBEDDED_AUTHENTICATOR) || defined(DRV_EMBEDDED_SUPPLICANT)
mlan_status wlan_cmd_crypto(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action, t_u16 *pdata_buf);
mlan_status wlan_ret_crypto(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
#endif
#define BW_20MHZ 0
#define BW_40MHZ 1
#define BW_80MHZ 2
@ -4132,7 +3880,7 @@ int wlan_add_supported_oper_class_ie(mlan_private *pmpriv, t_u8 **pptlv_out,
mlan_status wlan_get_curr_oper_class(mlan_private *pmpriv, t_u8 channel,
t_u8 bw, t_u8 *oper_class);
mlan_status wlan_check_operclass_validation(mlan_private *pmpriv, t_u8 channel,
t_u8 oper_class, t_u8 bandwidth);
t_u8 oper_class);
mlan_status wlan_misc_ioctl_operclass_validation(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req);
mlan_status wlan_misc_ioctl_oper_class(pmlan_adapter pmadapter,
@ -4165,37 +3913,10 @@ mlan_status wlan_misc_ioctl_txcontrol(pmlan_adapter pmadapter,
mlan_status wlan_misc_ioctl_region(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_misc_ioctl_multi_chan_config(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_cmd_multi_chan_cfg(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd, t_u16 cmd_action,
t_void *pdata_buf);
mlan_status wlan_ret_multi_chan_cfg(pmlan_private pmpriv,
const HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
mlan_status wlan_misc_ioctl_multi_chan_policy(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_cmd_multi_chan_policy(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action, t_void *pdata_buf);
mlan_status wlan_ret_multi_chan_policy(pmlan_private pmpriv,
const HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
mlan_status wlan_misc_ioctl_drcs_config(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
mlan_status wlan_cmd_drcs_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
t_u16 cmd_action, t_void *pdata_buf);
mlan_status wlan_ret_drcs_cfg(pmlan_private pmpriv,
const HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
#ifdef RX_PACKET_COALESCE
mlan_status wlan_misc_ioctl_rx_pkt_coalesce_config(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req);
#endif
void wlan_bt_coex_wlan_param_update_event(pmlan_private priv,
pmlan_buffer pevent);
@ -4250,8 +3971,6 @@ 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,
@ -4352,10 +4071,6 @@ mlan_status wlan_ret_get_sensor_temp(pmlan_private pmpriv,
HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf);
/** Set/Get Country code */
mlan_status wlan_misc_ioctl_country_code(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req);
/**
* @brief RA based queueing
*
@ -4441,23 +4156,6 @@ static INLINE t_u32 wlan_isspace(t_u8 chr)
return chr <= ' ' && (chr == ' ' || (chr <= 13 && chr >= 9));
}
static INLINE const char *wlan_str_skip_prefix(const char *str,
const char *prefix)
{
const char *substr = str;
while (*substr && *substr == *prefix) {
substr++;
prefix++;
}
if (*substr && !*prefix) {
str = substr;
}
return str;
}
/** delay unit */
typedef enum _delay_unit {
USEC,

View file

@ -14,18 +14,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/

View file

@ -11,18 +11,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/

File diff suppressed because it is too large Load diff

View file

@ -5,18 +5,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -29,9 +38,7 @@ Change log:
#include <linux/module.h>
#include "mlan_decl.h"
#include "mlan_ioctl.h"
#ifdef PCIE
EXPORT_SYMBOL(mlan_process_pcie_interrupt_cb);
#endif
EXPORT_SYMBOL(mlan_register);
EXPORT_SYMBOL(mlan_unregister);
EXPORT_SYMBOL(mlan_init_fw);

File diff suppressed because it is too large Load diff

View file

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -169,12 +178,8 @@ Change log:
#define ADMA_BD_FLAG_DST_HOST MBIT(4)
/** ADMA MIN PKT SIZE */
#define ADMA_MIN_PKT_SIZE 128
/** ADMA MIN PKT SIZE 32 */
#define ADMA_MIN_PKT_SIZE_32 32
/** ADMA dual descriptor mode requir 8 bytes alignment in buf size */
#define ADMA_ALIGN_SIZE 8
/** ADMA dual descriptor mode requir 8 bytes alignment in buf size */
#define ADMA_ALIGN_SIZE_1 1
/** ADMA RW_PTR wrap mask */
#define ADMA_RW_PTR_WRAP_MASK 0x00001FFF
/** ADMA MSIX DOORBEEL DATA */
@ -186,6 +191,7 @@ Change log:
/** PF start bit */
#define ADMA_MSIX_PF_BIT 24
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
/** PCIE9098 dev_id/vendor id reg */
#define PCIE9098_DEV_ID_REG 0x0000
/** PCIE revision ID register */
@ -322,6 +328,7 @@ Change log:
#define PCIE9098_HOST_INTR_SEL_MASK \
(PCIE9098_HOST_INTR_DNLD_DONE | PCIE9098_HOST_INTR_UPLD_RDY | \
PCIE9098_HOST_INTR_CMD_DONE | PCIE9098_HOST_INTR_EVENT_RDY)
#endif
#if defined(PCIE8997) || defined(PCIE8897)
/* PCIE INTERNAL REGISTERS */

View file

@ -6,20 +6,29 @@
* for sending scan commands to the firmware.
*
*
* Copyright 2008-2023 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -37,6 +46,9 @@ Change log:
#include "mlan_11ac.h"
#include "mlan_11ax.h"
#include "mlan_11h.h"
#ifdef DRV_EMBEDDED_SUPPLICANT
#include "authenticator_api.h"
#endif
/********************************************************
Local Constants
********************************************************/
@ -505,7 +517,6 @@ static t_u8 wlan_scan_create_channel_list(
band = pmpriv->config_bands;
if (!wlan_is_band_compatible(band, pscan_region->band))
continue;
for (next_chan = 0; next_chan < pscan_region->num_cfp;
next_chan++) {
/* Set the default scan type to the user specified type,
@ -530,7 +541,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;
@ -686,7 +697,6 @@ wlan_scan_channel_list(mlan_private *pmpriv, t_void *pioctl_buf,
MrvlIEtypes_Extension_t *phe_cap;
t_u16 len = 0;
t_u8 radio_type = 0;
t_u8 channel = 0;
mlan_callbacks *pcb = (mlan_callbacks *)&pmadapter->callbacks;
@ -710,6 +720,7 @@ wlan_scan_channel_list(mlan_private *pmpriv, t_void *pioctl_buf,
/* check expiry before preparing scan list - may affect blacklist */
wlan_11h_get_csa_closed_channel(pmpriv);
pchan_tlv_out->header.type = wlan_cpu_to_le16(TLV_TYPE_CHANLIST);
/* Set the temp channel struct pointer to the start of the desired list
@ -761,15 +772,12 @@ wlan_scan_channel_list(mlan_private *pmpriv, t_void *pioctl_buf,
first_chan = 0;
}
radio_type = ptmp_chan_list->bandcfg.chanBand;
channel = ptmp_chan_list->chan_number;
PRINTM(MCMD_D,
"Scan: Chan(%3d), bandcfg(%x), Mode(%d,%d,%d), Dur(%d)\n",
"Scan: Chan(%3d), bandcfg(%x), Mode(%d,%d), Dur(%d)\n",
ptmp_chan_list->chan_number,
ptmp_chan_list->bandcfg,
ptmp_chan_list->chan_scan_mode.passive_scan,
ptmp_chan_list->chan_scan_mode.disable_chan_filt,
ptmp_chan_list->chan_scan_mode
.passive_to_active_scan,
wlan_le16_to_cpu(ptmp_chan_list->max_scan_time));
if (foundJPch14 == MTRUE) {
@ -809,8 +817,7 @@ 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 | MOAL_MEM_FLAG_ATOMIC,
(t_u8 **)&ptlv_temp);
MLAN_MEM_DEF, (t_u8 **)&ptlv_temp);
if (ret != MLAN_STATUS_SUCCESS || !ptlv_temp) {
PRINTM(MERROR,
"Memory allocation for pscan_cfg_out failed!\n");
@ -1029,9 +1036,7 @@ 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) &&
((pmpriv->config_bands & BAND_GAX) ||
(pmpriv->config_bands & BAND_AAX))) {
if (IS_FW_SUPPORT_11AX(pmadapter)) {
phe_cap = (MrvlIEtypes_Extension_t *)ptlv_pos;
len = wlan_fill_he_cap_tlv(pmpriv, pmpriv->config_bands,
phe_cap, MFALSE);
@ -1129,7 +1134,7 @@ static mlan_status wlan_scan_setup_scan_config(
t_u8 *ptlv_pos;
t_u32 num_probes;
t_u32 ssid_len;
t_u32 chan_idx = 0;
t_u32 chan_idx;
t_u32 chan_list_idx = 0;
t_u32 scan_type;
t_u16 scan_dur;
@ -1500,20 +1505,17 @@ static mlan_status wlan_scan_setup_scan_config(
return ret;
}
}
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;
}
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)) {
@ -1522,7 +1524,6 @@ 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(
@ -1595,6 +1596,7 @@ static mlan_status wlan_scan_setup_scan_config(
*pscan_current_only = MTRUE;
PRINTM(MINFO, "Scan: Scanning current channel only\n");
}
} else {
num_of_channel =
wlan_scan_create_channel_list(pmpriv, puser_scan_in,
@ -1740,7 +1742,6 @@ static mlan_status wlan_interpret_bss_desc_with_ie(pmlan_adapter pmadapter,
IEEEtypes_VendorSpecific_t *pvendor_ie;
const t_u8 wpa_oui[4] = {0x00, 0x50, 0xf2, 0x01};
const t_u8 wmm_oui[4] = {0x00, 0x50, 0xf2, 0x02};
const t_u8 owe_oui[4] = {0x50, 0x6f, 0x9a, 0x1c};
const t_u8 osen_oui[] = {0x50, 0x6f, 0x9a, 0x12};
IEEEtypes_CountryInfoSet_t *pcountry_info;
@ -2080,54 +2081,6 @@ static mlan_status wlan_interpret_bss_desc_with_ie(pmlan_adapter pmadapter,
(t_u8 *)&pbss_entry->wmm_ie,
total_ie_len);
}
} else if (IS_FW_SUPPORT_EMBEDDED_OWE(pmadapter) &&
!memcmp(pmadapter, pvendor_ie->vend_hdr.oui,
owe_oui, sizeof(owe_oui))) {
/* Current Format of OWE IE is
* element_id:element_len:oui:MAC Address:SSID
* length:SSID */
t_u8 trans_ssid_len = *(
pcurrent_ptr +
sizeof(IEEEtypes_Header_t) +
sizeof(owe_oui) + MLAN_MAC_ADDR_LENGTH);
if (!trans_ssid_len ||
trans_ssid_len > MRVDRV_MAX_SSID_LENGTH) {
bytes_left_for_current_beacon = 0;
continue;
}
if (!pcap_info->privacy)
pbss_entry->owe_transition_mode =
OWE_TRANS_MODE_OPEN;
else
pbss_entry->owe_transition_mode =
OWE_TRANS_MODE_OWE;
memcpy_ext(
pmadapter,
pbss_entry->trans_mac_address,
(pcurrent_ptr +
sizeof(IEEEtypes_Header_t) +
sizeof(owe_oui)),
MLAN_MAC_ADDR_LENGTH,
sizeof(pbss_entry->trans_mac_address));
pbss_entry->trans_ssid.ssid_len =
trans_ssid_len;
memcpy_ext(
pmadapter, pbss_entry->trans_ssid.ssid,
(pcurrent_ptr +
sizeof(IEEEtypes_Header_t) +
sizeof(owe_oui) +
MLAN_MAC_ADDR_LENGTH + sizeof(t_u8)),
trans_ssid_len,
sizeof(pbss_entry->trans_ssid.ssid));
PRINTM(MCMND,
"InterpretIE: OWE Transition AP privacy=%d MAC Addr-" MACSTR
" ssid %s\n",
pbss_entry->owe_transition_mode,
MAC2STR(pbss_entry->trans_mac_address),
pbss_entry->trans_ssid.ssid);
} else if (!memcmp(pmadapter, pvendor_ie->vend_hdr.oui,
osen_oui, sizeof(osen_oui))) {
pbss_entry->posen_ie =
@ -3830,13 +3783,6 @@ t_s32 wlan_is_network_compatible(mlan_private *pmpriv, t_u32 index, t_u32 mode)
LEAVE();
return index;
}
if ((pbss_desc->owe_transition_mode == OWE_TRANS_MODE_OPEN) &&
(pmpriv->sec_info.authentication_mode != MLAN_AUTH_MODE_OWE)) {
PRINTM(MINFO,
"Return success directly in OWE Transition mode\n");
LEAVE();
return index;
}
if (pmpriv->sec_info.osen_enabled && pbss_desc->posen_ie &&
((*(pbss_desc->posen_ie)).ieee_hdr.element_id ==
@ -3851,9 +3797,11 @@ t_s32 wlan_is_network_compatible(mlan_private *pmpriv, t_u32 index, t_u32 mode)
}
if ((pbss_desc->bss_mode == mode) &&
(pmpriv->sec_info.ewpa_enabled == MTRUE ||
pmpriv->sec_info.authentication_mode == MLAN_AUTH_MODE_OWE ||
pbss_desc->owe_transition_mode == OWE_TRANS_MODE_OWE)) {
(pmpriv->sec_info.ewpa_enabled == MTRUE
#ifdef DRV_EMBEDDED_SUPPLICANT
|| supplicantIsEnabled(pmpriv->psapriv)
#endif
)) {
if (((pbss_desc->pwpa_ie) &&
((*(pbss_desc->pwpa_ie)).vend_hdr.element_id == WPA_IE)) ||
((pbss_desc->prsn_ie) &&
@ -4201,8 +4149,7 @@ 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 | MLAN_MEM_FLAG_ATOMIC,
sizeof(wlan_scan_cmd_config_tlv), MLAN_MEM_DEF,
(t_u8 **)&pscan_cfg_out);
if (ret != MLAN_STATUS_SUCCESS || !pscan_cfg_out) {
PRINTM(MERROR, "Memory allocation for pscan_cfg_out failed!\n");
@ -4213,8 +4160,7 @@ 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 | MLAN_MEM_FLAG_ATOMIC,
ret = pcb->moal_malloc(pmadapter->pmoal_handle, buf_size, MLAN_MEM_DEF,
(t_u8 **)&pscan_chan_list);
if (ret != MLAN_STATUS_SUCCESS || !pscan_chan_list) {
PRINTM(MERROR, "Failed to allocate scan_chan_list\n");
@ -4227,6 +4173,10 @@ mlan_status wlan_scan_networks(mlan_private *pmpriv, t_void *pioctl_buf,
return MLAN_STATUS_FAILURE;
}
memset(pmadapter, pscan_chan_list, 0x00, buf_size);
memset(pmadapter, pscan_cfg_out, 0x00,
sizeof(wlan_scan_cmd_config_tlv));
keep_previous_scan = MFALSE;
ret = wlan_scan_setup_scan_config(pmpriv, puser_scan_in,
@ -4259,15 +4209,6 @@ mlan_status wlan_scan_networks(mlan_private *pmpriv, t_void *pioctl_buf,
} else {
wlan_scan_delete_ageout_entry(pmpriv);
}
// back up the pchan_stats before reset it
memset(pmadapter, pmadapter->pold_chan_stats, 0x00,
sizeof(ChanStatistics_t) * pmadapter->num_in_chan_stats);
memcpy_ext(pmpriv->adapter, pmadapter->pold_chan_stats,
pmadapter->pchan_stats,
sizeof(ChanStatistics_t) * pmadapter->num_in_chan_stats,
sizeof(ChanStatistics_t) * pmadapter->num_in_chan_stats);
pmadapter->old_idx_chan_stats = pmadapter->idx_chan_stats;
for (i = 0; i < pmadapter->num_in_chan_stats; i++)
pmadapter->pchan_stats[i].cca_scan_duration = 0;
pmadapter->idx_chan_stats = 0;
@ -4286,7 +4227,6 @@ 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);
}
@ -4370,11 +4310,10 @@ static t_bool wlan_active_scan_req_for_passive_chan(mlan_private *pmpriv,
t_u32 bss_idx, i;
t_u8 null_ssid[MLAN_MAX_SSID_LENGTH] = {0};
mlan_callbacks *pcb = (mlan_callbacks *)&pmpriv->adapter->callbacks;
wlan_user_scan_cfg *user_scan_cfg = MNULL;
wlan_user_scan_cfg *user_scan_cfg;
mlan_ds_scan *pscan = (mlan_ds_scan *)pioctl_buf->pbuf;
mlan_scan_req *pscan_req = MNULL;
wlan_user_scan_cfg *puser_scan_in = MNULL;
t_u16 band;
ENTER();
@ -4398,6 +4337,7 @@ static t_bool wlan_active_scan_req_for_passive_chan(mlan_private *pmpriv,
PRINTM(MERROR, "Memory allocation for user_scan_cfg failed\n");
goto done;
}
memset(pmadapter, user_scan_cfg, 0, sizeof(wlan_user_scan_cfg));
for (bss_idx = 0; bss_idx < pmadapter->num_in_scan_table; bss_idx++) {
scan_reqd = MFALSE;
if (!memcmp(pmadapter,
@ -4444,15 +4384,12 @@ static t_bool wlan_active_scan_req_for_passive_chan(mlan_private *pmpriv,
if (scan_reqd) {
chan_listed = MFALSE;
for (i = 0; i < id; i++) {
band = radio_type_to_band(
user_scan_cfg->chan_list[i]
.radio_type);
if ((user_scan_cfg->chan_list[i]
.chan_number ==
pmadapter->pscan_table[bss_idx]
.channel) &&
(band &
(user_scan_cfg->chan_list[i]
.radio_type &
pmadapter->pscan_table[bss_idx]
.bss_band)) {
chan_listed = MTRUE;
@ -4474,9 +4411,6 @@ static t_bool wlan_active_scan_req_for_passive_chan(mlan_private *pmpriv,
user_scan_cfg->chan_list[id].scan_type =
MLAN_SCAN_TYPE_ACTIVE;
id++;
if (id >= WLAN_USER_SCAN_CHAN_MAX)
break;
}
}
}
@ -4496,20 +4430,16 @@ static t_bool wlan_active_scan_req_for_passive_chan(mlan_private *pmpriv,
MLAN_MAX_SSID_LENGTH);
}
user_scan_cfg->keep_previous_scan = MTRUE;
if (pmadapter->ext_scan_type == EXT_SCAN_ENHANCE)
user_scan_cfg->ext_scan_type = EXT_SCAN_ENHANCE;
PRINTM(MCMND, "active scan request for passive channel %d\n",
id);
if (MLAN_STATUS_SUCCESS !=
wlan_scan_networks(pmpriv, pioctl_buf, user_scan_cfg)) {
goto done;
}
ret = MTRUE;
}
done:
if (user_scan_cfg)
pcb->moal_mfree(pmadapter->pmoal_handle, (t_u8 *)user_scan_cfg);
done:
LEAVE();
return ret;
}
@ -4557,7 +4487,7 @@ mlan_status wlan_ret_802_11_scan(mlan_private *pmpriv, HostCmd_DS_COMMAND *resp,
t_u32 num_in_table;
t_u32 bss_idx;
t_u32 idx;
t_u32 tlv_buf_size = 0;
t_u32 tlv_buf_size;
t_u64 tsf_val;
chan_freq_power_t *cfp;
MrvlIEtypes_ChanBandListParamSet_t *pchan_band_tlv = MNULL;
@ -4608,21 +4538,10 @@ mlan_status wlan_ret_802_11_scan(mlan_private *pmpriv, HostCmd_DS_COMMAND *resp,
* BSS Descriptions (bss_descript_size as bytesLef) and the command
* response header (S_DS_GEN)
*/
if (scan_resp_size >
(bytes_left + sizeof(pscan_rsp->bss_descript_size) +
sizeof(pscan_rsp->number_of_sets) + S_DS_GEN)) {
tlv_buf_size =
(scan_resp_size -
(bytes_left + sizeof(pscan_rsp->bss_descript_size) +
sizeof(pscan_rsp->number_of_sets) + S_DS_GEN));
} else {
PRINTM(MERROR,
"scan_resp_size: Incorrect size of TLV buff size.\n");
}
if (is_bgscan_resp &&
(tlv_buf_size >
sizeof(resp->params.bg_scan_query_resp.report_condition)))
tlv_buf_size = scan_resp_size -
(bytes_left + sizeof(pscan_rsp->bss_descript_size) +
sizeof(pscan_rsp->number_of_sets) + S_DS_GEN);
if (is_bgscan_resp)
tlv_buf_size -= sizeof(
resp->params.bg_scan_query_resp.report_condition);
@ -4924,26 +4843,6 @@ 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
*
@ -5033,13 +4932,11 @@ 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 */
@ -5388,7 +5285,7 @@ static t_void wlan_parse_non_trans_bssid_profile(
IEEEtypes_NotxBssCap_t *pcap =
(IEEEtypes_NotxBssCap_t *)pbss_profile->profile_data;
t_u8 *pos = pbss_profile->profile_data;
t_u8 left_len = pbss_profile->ieee_hdr.len;
t_s8 left_len = pbss_profile->ieee_hdr.len;
t_u8 ret = MFALSE;
mlan_callbacks *pcb = (pmlan_callbacks)&pmadapter->callbacks;
BSSDescriptor_t *bss_new_entry = MNULL;
@ -5859,13 +5756,6 @@ 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 &&
@ -5899,7 +5789,6 @@ 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 */
@ -5925,9 +5814,6 @@ 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 */
@ -5978,7 +5864,7 @@ mlan_status wlan_handle_event_ext_scan_status(mlan_private *pmpriv,
t_u16 tlv_buf_left, tlv_len, tlv_type;
MrvlIEtypesHeader_t *tlv;
MrvlIEtypes_ChannelStats_t *tlv_chan_stats;
t_u8 status = 0;
t_u8 status;
cmd_ctrl_node *pcmd_node = MNULL;
ENTER();
@ -5988,7 +5874,6 @@ 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);
@ -6035,7 +5920,6 @@ 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 */
@ -6096,7 +5980,6 @@ 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 */
@ -6109,8 +5992,7 @@ done:
wlan_release_cmd_lock(pmadapter);
wlan_move_cmd_to_cmd_pending_q(pmadapter);
pmadapter->bgscan_reported = MFALSE;
if (!status)
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_SCAN_REPORT, MNULL);
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_SCAN_REPORT, MNULL);
LEAVE();
return ret;
}
@ -6157,9 +6039,10 @@ mlan_status wlan_cmd_802_11_bg_scan_query(mlan_private *pmpriv,
*
* @return channel number
*/
static t_u8 wlan_bgscan_create_channel_list(
mlan_private *pmpriv, const wlan_bgscan_cfg *pbg_scan_in,
MrvlIEtypes_ChanListParamSet_t *tlv_chan_list, t_u8 max_bgscan_chan)
static t_u8
wlan_bgscan_create_channel_list(mlan_private *pmpriv,
const wlan_bgscan_cfg *pbg_scan_in,
MrvlIEtypes_ChanListParamSet_t *tlv_chan_list)
{
mlan_adapter *pmadapter = pmpriv->adapter;
region_chan_t *pscan_region;
@ -6208,7 +6091,7 @@ static t_u8 wlan_bgscan_create_channel_list(
continue;
for (next_chan = 0; next_chan < pscan_region->num_cfp;
next_chan++, chan_idx++) {
if (chan_idx >= max_bgscan_chan)
if (chan_idx >= WLAN_BG_SCAN_CHAN_MAX)
break;
/*
* Set the default scan type to ACTIVE SCAN type, will
@ -6316,7 +6199,6 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
MrvlIETypes_HTCap_t *pht_cap = MNULL;
MrvlIETypes_VHTCap_t *pvht_cap = MNULL;
MrvlIEtypes_Extension_t *phe_cap = MNULL;
MrvlIEtypes_ScanChanGap_t *pscan_gap_tlv;
t_u16 len = 0;
t_u8 index;
@ -6330,21 +6212,10 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
t_u16 scan_dur;
t_u8 scan_type;
t_u16 band;
t_u8 max_bgscan_chan = 0;
t_u16 scan_chan_gap = 0;
const t_u8 zero_mac[6] = {0, 0, 0, 0, 0, 0};
ENTER();
max_bgscan_chan = WLAN_BG_SCAN_CHAN_MAX;
#if defined(SD9177)
if (IS_CARD9177(pmadapter->card_type))
max_bgscan_chan = WLAN_BG_SCAN_CHAN_MAX_UNII_4;
#endif
PRINTM(MCMND, "max_bgscan_chan=%d\n", max_bgscan_chan);
pcmd->command = wlan_cpu_to_le16(HostCmd_CMD_802_11_BG_SCAN_CONFIG);
bg_scan->action = wlan_cpu_to_le16(bg_scan_in->action);
bg_scan->enable = bg_scan_in->enable;
@ -6412,22 +6283,6 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
tlv += sizeof(MrvlIEtypes_RepeatCount_t);
cmd_size += sizeof(MrvlIEtypes_RepeatCount_t);
}
scan_chan_gap = (bg_scan_in->scan_chan_gap ? bg_scan_in->scan_chan_gap :
pmadapter->scan_chan_gap);
if (scan_chan_gap) {
pscan_gap_tlv = (MrvlIEtypes_ScanChanGap_t *)tlv;
PRINTM(MCMND, "bgScan: channel gap = 0x%x\n", scan_chan_gap);
pscan_gap_tlv->header.type =
wlan_cpu_to_le16(TLV_TYPE_SCAN_CHANNEL_GAP);
pscan_gap_tlv->header.len = sizeof(pscan_gap_tlv->gap);
pscan_gap_tlv->gap =
wlan_cpu_to_le16((t_u16)pmadapter->scan_chan_gap);
/** indicate FW, gap is optional */
pscan_gap_tlv->gap |= GAP_FLAG_OPTIONAL;
tlv += sizeof(pscan_gap_tlv->header) +
pscan_gap_tlv->header.len;
cmd_size += sizeof(MrvlIEtypes_ScanChanGap_t);
}
for (ssid_idx = 0; ((ssid_idx < NELEMENTS(bg_scan_in->ssid_list)) &&
(*bg_scan_in->ssid_list[ssid_idx].ssid ||
bg_scan_in->ssid_list[ssid_idx].max_len));
@ -6458,7 +6313,7 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
tlv_chan_list = (MrvlIEtypes_ChanListParamSet_t *)tlv;
PRINTM(MINFO, "Scan: Using supplied channel list\n");
chan_num = 0;
for (chan_idx = 0; chan_idx < max_bgscan_chan &&
for (chan_idx = 0; chan_idx < WLAN_BG_SCAN_CHAN_MAX &&
bg_scan_in->chan_list[chan_idx].chan_number;
chan_idx++) {
radio_type = bg_scan_in->chan_list[chan_idx].radio_type;
@ -6514,15 +6369,6 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
pmadapter->specific_scan_time;
}
}
PRINTM(MCMD_D,
"BGScan: Chan(%3d), bandcfg(%x), Mode(%d), Dur(%d)\n",
tlv_chan_list->chan_scan_param[chan_num]
.chan_number,
tlv_chan_list->chan_scan_param[chan_num].bandcfg,
tlv_chan_list->chan_scan_param[chan_num]
.chan_scan_mode.passive_scan,
scan_dur);
tlv_chan_list->chan_scan_param[chan_num].min_scan_time =
wlan_cpu_to_le16(scan_dur);
tlv_chan_list->chan_scan_param[chan_num].max_scan_time =
@ -6539,8 +6385,8 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
sizeof(ChanScanParamSet_t) * chan_num;
} else {
tlv_chan_list = (MrvlIEtypes_ChanListParamSet_t *)tlv;
chan_num = wlan_bgscan_create_channel_list(
pmpriv, bg_scan_in, tlv_chan_list, max_bgscan_chan);
chan_num = wlan_bgscan_create_channel_list(pmpriv, bg_scan_in,
tlv_chan_list);
tlv_chan_list->header.type =
wlan_cpu_to_le16(TLV_TYPE_CHANLIST);
tlv_chan_list->header.len =
@ -6551,8 +6397,7 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
sizeof(ChanScanParamSet_t) * chan_num;
}
if (bg_scan_in->chan_per_scan) {
bg_scan->chan_per_scan =
MIN(max_bgscan_chan, bg_scan_in->chan_per_scan);
bg_scan->chan_per_scan = bg_scan_in->chan_per_scan;
} else {
if (bg_scan_in->report_condition & BG_SCAN_WAIT_ALL_CHAN_DONE)
bg_scan->chan_per_scan = chan_num;
@ -6590,9 +6435,7 @@ 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) &&
((pmpriv->config_bands & BAND_GAX) ||
(pmpriv->config_bands & BAND_AAX))) {
if (IS_FW_SUPPORT_11AX(pmadapter)) {
phe_cap = (MrvlIEtypes_Extension_t *)tlv;
len = wlan_fill_he_cap_tlv(pmpriv, pmpriv->config_bands,
phe_cap, MFALSE);
@ -7109,8 +6952,7 @@ 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 | MLAN_MEM_FLAG_ATOMIC,
sizeof(wlan_user_scan_cfg), MLAN_MEM_DEF,
(t_u8 **)&pscan_cfg);
if (ret != MLAN_STATUS_SUCCESS || !pscan_cfg) {
@ -7121,6 +6963,8 @@ mlan_status wlan_scan_specific_ssid(mlan_private *pmpriv, t_void *pioctl_buf,
goto done;
}
memset(pmpriv->adapter, pscan_cfg, 0x00, sizeof(wlan_user_scan_cfg));
memcpy_ext(pmpriv->adapter, pscan_cfg->ssid_list[0].ssid,
preq_ssid->ssid, preq_ssid->ssid_len, MLAN_MAX_SSID_LENGTH);
pscan_cfg->keep_previous_scan = MFALSE;
@ -7171,8 +7015,7 @@ 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_FLAG_ATOMIC,
MLAN_MEM_DEF,
&pmpriv->pcurr_bcn_buf);
if ((ret == MLAN_STATUS_SUCCESS) &&

View file

@ -5,18 +5,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -107,7 +116,6 @@ static const struct _mlan_card_info mlan_card_info_sd8887 = {
.v16_fw_api = 0,
.supp_ps_handshake = 0,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_1X1,
.support_11mc = 0,
};
#endif
@ -148,7 +156,6 @@ static const struct _mlan_card_info mlan_card_info_sd8801 = {
.v16_fw_api = 0,
.supp_ps_handshake = 0,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_1X1,
.support_11mc = 0,
};
#endif
@ -219,10 +226,12 @@ static const struct _mlan_card_info mlan_card_info_sd8897 = {
.v16_fw_api = 0,
.supp_ps_handshake = 0,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 0,
};
#endif
#if defined(SD8977) || defined(SD8997) || defined(SD8987) || \
defined(SD9098) || defined(SD9097) || defined(SDNW62X) || \
defined(SD8978) || defined(SD9177)
static const struct _mlan_sdio_card_reg mlan_reg_sd8977_sd8997 = {
.start_rd_port = 0,
.start_wr_port = 0,
@ -289,6 +298,7 @@ static const struct _mlan_sdio_card_reg mlan_reg_sd8977_sd8997 = {
.fw_dnld_status_1_reg = 0xE9,
.winner_check_reg = 0xFC,
};
#endif
#ifdef SD8997
static const struct _mlan_card_info mlan_card_info_sd8997 = {
@ -296,7 +306,6 @@ static const struct _mlan_card_info mlan_card_info_sd8997 = {
.v16_fw_api = 1,
.supp_ps_handshake = 0,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 1,
};
#endif
@ -307,30 +316,19 @@ static const struct _mlan_card_info mlan_card_info_sd9097 = {
.v17_fw_api = 1,
.supp_ps_handshake = 0,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 1,
};
#endif
#ifdef SDIW624
static const struct _mlan_card_info mlan_card_info_sdiw624 = {
#ifdef SDNW62X
static const struct _mlan_card_info mlan_card_info_sdnw62x = {
.max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_4K,
.v16_fw_api = 1,
.v17_fw_api = 1,
.supp_ps_handshake = 0,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 1,
};
#endif
static const struct _mlan_card_info mlan_card_info_sdaw693 = {
.max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_4K,
.v16_fw_api = 1,
.v17_fw_api = 1,
.supp_ps_handshake = 0,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 1,
};
#ifdef SD9098
static const struct _mlan_card_info mlan_card_info_sd9098 = {
.max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_4K,
@ -338,7 +336,6 @@ static const struct _mlan_card_info mlan_card_info_sd9098 = {
.v17_fw_api = 1,
.supp_ps_handshake = 0,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 1,
};
#endif
#ifdef SD9177
@ -348,7 +345,6 @@ static const struct _mlan_card_info mlan_card_info_sd9177 = {
.v17_fw_api = 1,
.supp_ps_handshake = 0,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_1X1,
.support_11mc = 1,
};
#endif
@ -358,7 +354,6 @@ static const struct _mlan_card_info mlan_card_info_sd8977 = {
.v16_fw_api = 1,
.supp_ps_handshake = 0,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_1X1,
.support_11mc = 1,
};
#endif
@ -368,7 +363,6 @@ static const struct _mlan_card_info mlan_card_info_sd8987 = {
.v16_fw_api = 1,
.supp_ps_handshake = 0,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_1X1,
.support_11mc = 1,
};
#endif
@ -991,7 +985,7 @@ static mlan_status wlan_sdio_prog_fw_w_helper(pmlan_adapter pmadapter, t_u8 *fw,
t_u8 *firmware = fw;
t_u32 firmwarelen = fw_len;
t_u32 offset = 0;
t_u32 base0 = 0, base1 = 0;
t_u32 base0, base1;
t_void *tmpfwbuf = MNULL;
t_u32 tmpfwbufsz;
t_u8 *fwbuf;
@ -1030,6 +1024,7 @@ static mlan_status wlan_sdio_prog_fw_w_helper(pmlan_adapter pmadapter, t_u8 *fw,
ret = MLAN_STATUS_FAILURE;
goto done;
}
memset(pmadapter, tmpfwbuf, 0, tmpfwbufsz);
/* Ensure 8-byte aligned firmware buffer */
fwbuf = (t_u8 *)ALIGN_ADDR(tmpfwbuf, DMA_ALIGNMENT);
#if defined(SD9098)
@ -1049,10 +1044,11 @@ static mlan_status wlan_sdio_prog_fw_w_helper(pmlan_adapter pmadapter, t_u8 *fw,
check_fw_status = MTRUE;
}
#endif
#if defined(SD9097) || defined(SD9177) || defined(SDNW62X)
if (IS_SD9097(pmadapter->card_type) ||
IS_SDIW624(pmadapter->card_type) ||
IS_SDAW693(pmadapter->card_type) || IS_SD9177(pmadapter->card_type))
IS_SDNW62X(pmadapter->card_type) || IS_SD9177(pmadapter->card_type))
check_fw_status = MTRUE;
#endif
/* Perform firmware data transfer */
do {
@ -1176,7 +1172,7 @@ static mlan_status wlan_sdio_prog_fw_w_helper(pmlan_adapter pmadapter, t_u8 *fw,
* for last block */
if (firmwarelen && firmwarelen - offset < txlen)
txlen = firmwarelen - offset;
PRINTM(MINFO, ".\n");
PRINTM(MINFO, ".");
tx_blocks = (txlen + MLAN_SDIO_BLOCK_SIZE_FW_DNLD - 1) /
MLAN_SDIO_BLOCK_SIZE_FW_DNLD;
@ -1264,6 +1260,32 @@ static mlan_status wlan_decode_rx_packet(mlan_adapter *pmadapter,
ENTER();
switch (upld_typ) {
case MLAN_TYPE_SPA_DATA:
PRINTM(MINFO, "--- Rx: SPA Data packet ---\n");
pmbuf->data_len = pmadapter->upld_len;
if (pmadapter->rx_work_flag) {
pmbuf->buf_type = MLAN_BUF_TYPE_SPA_DATA;
if (lock_flag)
pmadapter->callbacks.moal_spin_lock(
pmadapter->pmoal_handle,
pmadapter->rx_data_queue.plock);
util_enqueue_list_tail(pmadapter->pmoal_handle,
&pmadapter->rx_data_queue,
(pmlan_linked_list)pmbuf, MNULL,
MNULL);
pmadapter->rx_pkts_queued++;
if (lock_flag)
pmadapter->callbacks.moal_spin_unlock(
pmadapter->pmoal_handle,
pmadapter->rx_data_queue.plock);
} else {
wlan_decode_spa_buffer(pmadapter,
pmbuf->pbuf + pmbuf->data_offset,
pmbuf->data_len);
wlan_free_mlan_buffer(pmadapter, pmbuf);
}
pmadapter->data_received = MTRUE;
break;
case MLAN_TYPE_DATA:
PRINTM(MINFO, "--- Rx: Data packet ---\n");
if (pmadapter->upld_len > pmbuf->data_len) {
@ -1321,8 +1343,6 @@ 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->vdll_ctrl.vdll_len)
pmadapter->cmd_sent = MFALSE;
/* take care of curr_cmd = NULL case */
if (!pmadapter->curr_cmd) {
cmd_buf = pmadapter->upld_buf;
@ -1359,7 +1379,6 @@ static mlan_status wlan_decode_rx_packet(mlan_adapter *pmadapter,
case MLAN_TYPE_EVENT:
PRINTM(MINFO, "--- Rx: Event ---\n");
event = *(t_u32 *)&pmbuf->pbuf[pmbuf->data_offset +
SDIO_INTF_HEADER_LEN];
pmadapter->event_cause = wlan_le32_to_cpu(event);
@ -1418,7 +1437,7 @@ static mlan_status wlan_receive_single_packet(mlan_adapter *pmadapter)
ret = MLAN_STATUS_FAILURE;
goto done;
}
if (pkt_type != MLAN_TYPE_DATA) {
if (pkt_type != MLAN_TYPE_DATA && pkt_type != MLAN_TYPE_SPA_DATA) {
PRINTM(MERROR,
"receive a wrong pkt from DATA PORT: type=%d, len=%dd\n",
pkt_type, pmbuf->data_len);
@ -1552,7 +1571,8 @@ static mlan_status wlan_receive_mp_aggr_buf(mlan_adapter *pmadapter)
/* copy pkt to deaggr buf */
mbuf_deaggr =
pmadapter->pcard_sd->mpa_rx.mbuf_arr[pind];
if ((pkt_type == MLAN_TYPE_DATA) &&
if ((pkt_type == MLAN_TYPE_DATA ||
pkt_type == MLAN_TYPE_SPA_DATA) &&
(pkt_len <=
pmadapter->pcard_sd->mpa_rx.len_arr[pind])) {
memcpy_ext(pmadapter,
@ -1713,7 +1733,8 @@ rx_curr_single:
goto done;
}
if (new_mode || (port != CTRL_PORT)) {
if (pkt_type != MLAN_TYPE_DATA) {
if (pkt_type != MLAN_TYPE_DATA &&
pkt_type != MLAN_TYPE_SPA_DATA) {
PRINTM(MERROR,
"receive a wrong pkt from DATA PORT: type=%d, len=%dd\n",
pkt_type, pmbuf->data_len);
@ -2147,7 +2168,7 @@ static mlan_status wlan_sdio_check_fw_status(mlan_adapter *pmadapter,
ret = MLAN_STATUS_SUCCESS;
break;
} else {
wlan_mdelay(pmadapter, 10);
wlan_mdelay(pmadapter, 100);
ret = MLAN_STATUS_FAILURE;
}
}
@ -2405,16 +2426,12 @@ mlan_status wlan_get_sdio_device(pmlan_adapter pmadapter)
pmadapter->pcard_info = &mlan_card_info_sd9097;
break;
#endif
#ifdef SDIW624
case CARD_TYPE_SDIW624:
#ifdef SDNW62X
case CARD_TYPE_SDNW62X:
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
pmadapter->pcard_info = &mlan_card_info_sdiw624;
pmadapter->pcard_info = &mlan_card_info_sdnw62x;
break;
#endif
case CARD_TYPE_SDAW693:
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
pmadapter->pcard_info = &mlan_card_info_sdaw693;
break;
#ifdef SD9177
case CARD_TYPE_SD9177:
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
@ -2491,9 +2508,6 @@ void wlan_dump_mp_registers(pmlan_adapter pmadapter)
if (new_mode && rx_len)
sdio_ireg |= UP_LD_CMD_PORT_HOST_INT_STATUS;
if (new_mode && pmadapter->cmd_sent)
sdio_ireg |= DN_LD_CMD_PORT_HOST_INT_STATUS;
if (!(pmadapter->pcard_sd->mp_wr_bitmap &
pmadapter->pcard_sd->mp_data_port_mask)) {
if (mp_wr_bitmap & pmadapter->pcard_sd->mp_data_port_mask)
@ -2571,7 +2585,6 @@ static mlan_status wlan_sdio_interrupt(t_u16 msg_id, pmlan_adapter pmadapter)
* Clear the interrupt status register
*/
PRINTM(MINTR, "wlan_interrupt: sdio_ireg = 0x%x\n", sdio_ireg);
pmadapter->pm_wakeup_timeout = 0;
pmadapter->pcard_sd->num_of_irq++;
pcb->moal_spin_lock(pmadapter->pmoal_handle,
pmadapter->pint_lock);
@ -2625,7 +2638,7 @@ static mlan_status wlan_sdio_card_to_host_recovery(mlan_adapter *pmadapter,
pmadapter->pcard_sd->ioport + port)) {
PRINTM(MERROR, "Recovery: Fail to do cmd53\n");
}
if (pkt_type != MLAN_TYPE_DATA) {
if (pkt_type != MLAN_TYPE_DATA && pkt_type != MLAN_TYPE_SPA_DATA) {
PRINTM(MERROR,
"Recovery: Receive a wrong pkt: type=%d, len=%d\n",
pkt_type, pmadapter->upld_len);
@ -2635,6 +2648,12 @@ static mlan_status wlan_sdio_card_to_host_recovery(mlan_adapter *pmadapter,
// TODO fill the hole in Rx reorder table
PRINTM(MDATA, "Recovery: Drop Data packet\n");
pmadapter->dbg.num_pkt_dropped++;
} else if (pkt_type == MLAN_TYPE_SPA_DATA) {
PRINTM(MDATA, "Recovery: SPA Data packet len=%d\n",
pmadapter->upld_len);
wlan_decode_spa_buffer(pmadapter, pmadapter->pcard_sd->rx_buf,
pmadapter->upld_len);
pmadapter->data_received = MTRUE;
}
PRINTM(MMSG, "wlan: Success handle rx port=%d, rx_len=%d \n", port,
rx_len);
@ -2648,11 +2667,9 @@ done:
* @brief This function checks the interrupt status and handle it accordingly.
*
* @param pmadapter A pointer to mlan_adapter structure
* @param type interrupt type, not used in SDIO
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status wlan_process_sdio_int_status(mlan_adapter *pmadapter,
t_u8 type)
static mlan_status wlan_process_sdio_int_status(mlan_adapter *pmadapter)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb = &pmadapter->callbacks;
@ -2850,7 +2867,7 @@ static mlan_status wlan_process_sdio_int_status(mlan_adapter *pmadapter,
MLAN_SDIO_BLOCK_SIZE;
if (rx_len <= SDIO_INTF_HEADER_LEN ||
(rx_blocks * MLAN_SDIO_BLOCK_SIZE) >
ALLOC_BUF_SIZE) {
pmadapter->pcard_sd->mpa_rx.buf_size) {
PRINTM(MERROR, "invalid rx_len=%d\n", rx_len);
ret = MLAN_STATUS_FAILURE;
goto done;
@ -3024,6 +3041,7 @@ exit:
return ret;
}
#if (defined(SD9098) || defined(SD9097) || defined(SDNW62X) || defined(SD9177))
/**
* @brief This function sends vdll data to the card.
*
@ -3065,6 +3083,7 @@ static mlan_status wlan_sdio_send_vdll(mlan_adapter *pmadapter,
LEAVE();
return ret;
}
#endif
/**
* @brief This function sends data to the card.
@ -3083,8 +3102,10 @@ static mlan_status wlan_sdio_host_to_card_ext(pmlan_private pmpriv, t_u8 type,
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_adapter *pmadapter = pmpriv->adapter;
#if (defined(SD9098) || defined(SD9097) || defined(SDNW62X) || defined(SD9177))
if (type == MLAN_TYPE_VDLL)
return wlan_sdio_send_vdll(pmadapter, pmbuf);
#endif
ret = wlan_sdio_host_to_card(pmadapter, type, pmbuf, tx_param);
if (type == MLAN_TYPE_DATA && ret == MLAN_STATUS_FAILURE)
@ -3094,6 +3115,94 @@ static mlan_status wlan_sdio_host_to_card_ext(pmlan_private pmpriv, t_u8 type,
return ret;
}
/**
* @brief Deaggregate single port aggregation packet
*
* @param pmadapter A pointer to mlan_adapter structure
* @param buf A pointer to aggregated data packet
* @param len
*
* @return N/A
*/
void wlan_decode_spa_buffer(mlan_adapter *pmadapter, t_u8 *buf, t_u32 len)
{
int total_pkt_len;
t_u8 block_num = 0;
t_u16 block_size = 0;
t_u8 *data;
t_u32 pkt_len;
mlan_buffer *mbuf_deaggr = MNULL;
ENTER();
data = (t_u8 *)buf;
total_pkt_len = len;
if (total_pkt_len < pmadapter->pcard_sd->sdio_rx_block_size) {
PRINTM(MERROR, "Invalid sp aggr packet size=%d\n",
total_pkt_len);
goto done;
}
while (total_pkt_len >=
(OFFSET_OF_SDIO_HEADER + SDIO_INTF_HEADER_LEN)) {
block_num = *(data + OFFSET_OF_BLOCK_NUMBER);
block_size =
pmadapter->pcard_sd->sdio_rx_block_size * block_num;
if (block_size > total_pkt_len) {
PRINTM(MERROR,
"Error in pkt, block_num=%d, pkt_len=%d\n",
block_num, total_pkt_len);
break;
}
pkt_len = wlan_le16_to_cpu(
*(t_u16 *)(data + OFFSET_OF_SDIO_HEADER));
if ((pkt_len + OFFSET_OF_SDIO_HEADER) > block_size) {
PRINTM(MERROR,
"Error in pkt, pkt_len=%d, block_size=%d\n",
pkt_len, block_size);
break;
}
mbuf_deaggr = wlan_alloc_mlan_buffer(
pmadapter, pkt_len - SDIO_INTF_HEADER_LEN,
MLAN_RX_HEADER_LEN, MOAL_ALLOC_MLAN_BUFFER);
if (mbuf_deaggr == MNULL) {
PRINTM(MERROR, "Error allocating daggr mlan_buffer\n");
break;
}
memcpy_ext(pmadapter,
mbuf_deaggr->pbuf + mbuf_deaggr->data_offset,
data + OFFSET_OF_SDIO_HEADER + SDIO_INTF_HEADER_LEN,
pkt_len - SDIO_INTF_HEADER_LEN,
pkt_len - SDIO_INTF_HEADER_LEN);
mbuf_deaggr->data_len = pkt_len - SDIO_INTF_HEADER_LEN;
wlan_handle_rx_packet(pmadapter, mbuf_deaggr);
data += block_size;
total_pkt_len -= block_size;
if (total_pkt_len < pmadapter->pcard_sd->sdio_rx_block_size)
break;
}
done:
LEAVE();
return;
}
/**
* @brief This function deaggr rx pkt
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pmbuf A pointer to the SDIO mpa data
* @return N/A
*/
t_void wlan_sdio_deaggr_rx_pkt(pmlan_adapter pmadapter, mlan_buffer *pmbuf)
{
if (pmbuf->buf_type == MLAN_BUF_TYPE_SPA_DATA) {
wlan_decode_spa_buffer(pmadapter,
pmbuf->pbuf + pmbuf->data_offset,
pmbuf->data_len);
wlan_free_mlan_buffer(pmadapter, pmbuf);
} else
wlan_handle_rx_packet(pmadapter, pmbuf);
}
/**
* @brief This function allocates buffer for the SDIO aggregation buffer
* related members of adapter structure
@ -3202,6 +3311,80 @@ mlan_status wlan_free_sdio_mpa_buffers(mlan_adapter *pmadapter)
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function re-allocate rx mpa buffer
*
* @param pmadapter A pointer to mlan_adapter structure
*
* @return MLAN_STATUS_SUCCESS
*/
mlan_status wlan_re_alloc_sdio_rx_mpa_buffer(mlan_adapter *pmadapter)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb = &pmadapter->callbacks;
t_u8 mp_aggr_pkt_limit = pmadapter->pcard_sd->mp_aggr_pkt_limit;
t_u32 mpa_rx_buf_size = pmadapter->pcard_sd->mp_tx_aggr_buf_size;
if (pmadapter->pcard_sd->mpa_rx.buf) {
pcb->moal_mfree(pmadapter->pmoal_handle,
(t_u8 *)pmadapter->pcard_sd->mpa_rx.head_ptr);
pmadapter->pcard_sd->mpa_rx.head_ptr = MNULL;
pmadapter->pcard_sd->mpa_rx.buf = MNULL;
pmadapter->pcard_sd->mpa_rx.buf_size = 0;
}
if (pmadapter->pcard_sd->sdio_rx_aggr_enable) {
mpa_rx_buf_size = MAX(mpa_rx_buf_size, SDIO_CMD53_MAX_SIZE);
/** reallocate rx buffer for recover when single port rx
* aggregation enabled */
if (pmadapter->pcard_sd->rx_buffer) {
pcb->moal_mfree(pmadapter->pmoal_handle,
(t_u8 *)pmadapter->pcard_sd->rx_buffer);
pmadapter->pcard_sd->rx_buffer = MNULL;
pmadapter->pcard_sd->rx_buf = MNULL;
}
ret = pmadapter->callbacks.moal_malloc(
pmadapter->pmoal_handle,
SDIO_CMD53_MAX_SIZE + DMA_ALIGNMENT,
MLAN_MEM_DEF | MLAN_MEM_DMA,
(t_u8 **)&pmadapter->pcard_sd->rx_buffer);
if (ret != MLAN_STATUS_SUCCESS ||
!pmadapter->pcard_sd->rx_buffer) {
PRINTM(MERROR, "Failed to allocate receive buffer\n");
ret = MLAN_STATUS_FAILURE;
goto error;
}
pmadapter->pcard_sd->rx_buf = (t_u8 *)ALIGN_ADDR(
pmadapter->pcard_sd->rx_buffer, DMA_ALIGNMENT);
}
if ((pmadapter->pcard_sd->max_segs < mp_aggr_pkt_limit) ||
(pmadapter->pcard_sd->max_seg_size <
pmadapter->pcard_sd->max_sp_rx_size)) {
ret = pcb->moal_malloc(
pmadapter->pmoal_handle,
mpa_rx_buf_size + DMA_ALIGNMENT,
MLAN_MEM_DEF | MLAN_MEM_DMA,
(t_u8 **)&pmadapter->pcard_sd->mpa_rx.head_ptr);
if (ret != MLAN_STATUS_SUCCESS ||
!pmadapter->pcard_sd->mpa_rx.head_ptr) {
PRINTM(MERROR,
"Could not allocate buffer for SDIO MP RX aggr\n");
ret = MLAN_STATUS_FAILURE;
goto error;
}
pmadapter->pcard_sd->mpa_rx.buf = (t_u8 *)ALIGN_ADDR(
pmadapter->pcard_sd->mpa_rx.head_ptr, DMA_ALIGNMENT);
} else {
PRINTM(MMSG, "wlan: Enable RX SG mode\n");
pmadapter->pcard_sd->mpa_rx.head_ptr = MNULL;
pmadapter->pcard_sd->mpa_rx.buf = MNULL;
}
pmadapter->pcard_sd->mpa_rx.buf_size = mpa_rx_buf_size;
PRINTM(MMSG, "mpa_rx_buf_size=%d\n", mpa_rx_buf_size);
error:
return ret;
}
/**
* @brief This function wakes up the card.
*
@ -3218,10 +3401,7 @@ static mlan_status wlan_pm_sdio_wakeup_card(pmlan_adapter pmadapter,
pmlan_callbacks pcb = &pmadapter->callbacks;
ENTER();
if (pmadapter->second_mac)
PRINTM(MEVENT, "#2 Wakeup device...\n");
else
PRINTM(MEVENT, "Wakeup device...\n");
PRINTM(MEVENT, "Wakeup device...\n");
pmadapter->callbacks.moal_get_system_time(pmadapter->pmoal_handle,
&pmadapter->pm_wakeup_in_secs,
&age_ts_usec);
@ -3229,7 +3409,7 @@ static mlan_status wlan_pm_sdio_wakeup_card(pmlan_adapter pmadapter,
if (timeout) {
pmadapter->callbacks.moal_start_timer(
pmadapter->pmoal_handle, pmadapter->pwakeup_fw_timer,
MFALSE, MRVDRV_TIMER_5S);
MFALSE, MRVDRV_TIMER_3S);
pmadapter->wakeup_fw_timer_is_set = MTRUE;
}
@ -3384,6 +3564,9 @@ mlan_status wlan_reset_fw(pmlan_adapter pmadapter)
ret = MLAN_STATUS_FAILURE;
goto done;
}
#if defined(SD8997) || defined(SD8977) || defined(SD8987) || \
defined(SD9098) || defined(SD9097) || defined(SDNW62X) || \
defined(SD8978) || defined(SD9177)
if (MFALSE
#ifdef SD8997
|| IS_SD8997(pmadapter->card_type)
@ -3403,10 +3586,9 @@ mlan_status wlan_reset_fw(pmlan_adapter pmadapter)
#ifdef SD9097
|| IS_SD9097(pmadapter->card_type)
#endif
#ifdef SDIW624
|| IS_SDIW624(pmadapter->card_type)
#ifdef SDNW62X
|| IS_SDNW62X(pmadapter->card_type)
#endif
|| IS_SDAW693(pmadapter->card_type)
#ifdef SD9177
|| IS_SD9177(pmadapter->card_type)
#endif
@ -3417,6 +3599,7 @@ mlan_status wlan_reset_fw(pmlan_adapter pmadapter)
HOST_TO_CARD_EVENT_REG,
value | HOST_POWER_UP);
}
#endif
/* Poll register around 100 ms */
for (tries = 0; tries < MAX_POLL_TRIES; ++tries) {
pcb->moal_read_reg(pmadapter->pmoal_handle, reset_reg, &value);
@ -3446,34 +3629,13 @@ done:
* @param pmbuf A pointer to the mlan_buffer
* @return N/A
*/
static mlan_status wlan_sdio_evt_complete(pmlan_adapter pmadapter,
mlan_buffer *pmbuf,
mlan_status status)
{
ENTER();
pmadapter->event_cause = 0;
pmadapter->pmlan_buffer_event = MNULL;
if (pmbuf)
wlan_free_mlan_buffer(pmadapter, pmbuf);
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function handle data/cmd complete
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pmbuf A pointer to the mlan_buffer
* @return N/A
*/
static mlan_status wlan_sdio_data_cmd_complete(pmlan_adapter pmadapter,
static mlan_status wlan_sdio_data_evt_complete(pmlan_adapter pmadapter,
mlan_buffer *pmbuf,
mlan_status status)
{
ENTER();
if (pmbuf)
wlan_free_mlan_buffer(pmadapter, pmbuf);
wlan_free_mlan_buffer(pmadapter, pmbuf);
LEAVE();
return MLAN_STATUS_SUCCESS;
@ -3491,7 +3653,7 @@ static mlan_status wlan_sdio_handle_rx_packet(mlan_adapter *pmadapter,
{
ENTER();
wlan_handle_rx_packet(pmadapter, pmbuf);
wlan_sdio_deaggr_rx_pkt(pmadapter, pmbuf);
LEAVE();
return MLAN_STATUS_SUCCESS;
@ -3504,9 +3666,9 @@ mlan_adapter_operations mlan_sdio_ops = {
.host_to_card = wlan_sdio_host_to_card_ext,
.wakeup_card = wlan_pm_sdio_wakeup_card,
.reset_card = wlan_pm_sdio_reset_card,
.event_complete = wlan_sdio_evt_complete,
.data_complete = wlan_sdio_data_cmd_complete,
.cmdrsp_complete = wlan_sdio_data_cmd_complete,
.event_complete = wlan_sdio_data_evt_complete,
.data_complete = wlan_sdio_data_evt_complete,
.cmdrsp_complete = wlan_sdio_data_evt_complete,
.handle_rx_packet = wlan_sdio_handle_rx_packet,
.disable_host_int = wlan_disable_sdio_host_int,
.enable_host_int = wlan_enable_sdio_host_int,

View file

@ -1,23 +1,31 @@
/** @file mlan_sdio.h
*
* @brief This file contains definitions for SDIO interface.
* driver.
* @brief This file contains definitions for SDIO interface.
*
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
/****************************************************
@ -358,6 +366,10 @@ mlan_status wlan_get_sdio_device(pmlan_adapter pmadapter);
mlan_status wlan_send_mp_aggr_buf(mlan_adapter *pmadapter);
mlan_status wlan_re_alloc_sdio_rx_mpa_buffer(mlan_adapter *pmadapter);
void wlan_decode_spa_buffer(mlan_adapter *pmadapter, t_u8 *buf, t_u32 len);
t_void wlan_sdio_deaggr_rx_pkt(pmlan_adapter pmadapter, mlan_buffer *pmbuf);
/** Transfer data to card */
mlan_status wlan_sdio_host_to_card(mlan_adapter *pmadapter, t_u8 type,
mlan_buffer *mbuf, mlan_tx_param *tx_param);

View file

@ -2,21 +2,60 @@
*
* @brief This file contains APIs to MOAL module.
*
* Copyright 2008-2021 NXP
*
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*
*/
/**
* @mainpage MLAN Driver
*
* @section overview_sec Overview
*
* The MLAN is an OS independent WLAN driver for NXP 802.11
* embedded chipset.
*
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
*/
@ -44,6 +83,9 @@ Change log:
#endif
#include "mlan_11h.h"
#include "mlan_11n_rxreorder.h"
#ifdef DRV_EMBEDDED_AUTHENTICATOR
#include "authenticator_api.h"
#endif
/********************************************************
Local Variables
@ -167,6 +209,7 @@ static void wlan_process_pending_ioctl(mlan_adapter *pmadapter)
}
break;
#endif
#ifdef STA_SUPPORT
case MLAN_IOCTL_MISC_CFG:
misc = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
if (misc->sub_command == MLAN_OID_MISC_WARM_RESET) {
@ -175,6 +218,7 @@ static void wlan_process_pending_ioctl(mlan_adapter *pmadapter)
pioctl_buf);
}
break;
#endif
default:
break;
}
@ -325,7 +369,6 @@ 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)) {
@ -360,6 +403,8 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
pmadapter->init_para.mpa_tx_cfg = pmdevice->mpa_tx_cfg;
pmadapter->init_para.mpa_rx_cfg = pmdevice->mpa_rx_cfg;
pmadapter->pcard_sd->sdio_rx_aggr_enable =
pmdevice->sdio_rx_aggr_enable;
}
#endif
@ -435,9 +480,6 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
pmadapter->multiple_dtim = pmdevice->multi_dtim;
pmadapter->inact_tmo = pmdevice->inact_tmo;
pmadapter->init_para.drcs_chantime_mode = pmdevice->drcs_chantime_mode;
pmadapter->second_mac = pmdevice->second_mac;
pmadapter->napi = pmdevice->napi;
pmadapter->hs_wake_interval = pmdevice->hs_wake_interval;
if (pmdevice->indication_gpio != 0xff) {
pmadapter->ind_gpio = pmdevice->indication_gpio & 0x0f;
@ -455,12 +497,9 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
pmadapter->rx_cmd_ep = pmdevice->rx_cmd_ep;
pmadapter->tx_data_ep = pmdevice->tx_data_ep;
pmadapter->rx_data_ep = pmdevice->rx_data_ep;
pmadapter->usb_tx_ports[0] = pmdevice->tx_data_ep;
pmadapter->usb_tx_ports[1] = pmdevice->tx_data2_ep;
}
#endif
pmadapter->init_para.dfs53cfg = pmdevice->dfs53cfg;
pmadapter->init_para.dfs_offload = pmdevice->dfs_offload;
pmadapter->priv_num = 0;
pmadapter->priv[0] = MNULL;
@ -1050,6 +1089,18 @@ mlan_status mlan_rx_process(t_void *padapter, t_u8 *rx_pkts)
rx_process_start:
/* Check for Rx data */
while (MTRUE) {
#ifdef DRV_EMBEDDED_AUTHENTICATOR
if (pmadapter->authenticator_priv) {
if (IsAuthenticatorEnabled(
pmadapter->authenticator_priv->psapriv)) {
AuthenticatorKeyMgmtInit(
pmadapter->authenticator_priv->psapriv,
pmadapter->authenticator_priv
->curr_addr);
pmadapter->authenticator_priv = MNULL;
}
}
#endif
if (pmadapter->flush_data) {
pmadapter->flush_data = MFALSE;
wlan_flush_rxreorder_tbl(pmadapter);
@ -1093,16 +1144,6 @@ rx_process_start:
pmadapter->delay_task_flag = MFALSE;
mlan_queue_main_work(pmadapter);
}
#ifdef PCIE
if (pmadapter->delay_rx_data_flag &&
(pmadapter->rx_pkts_queued < LOW_RX_PENDING)) {
PRINTM(MEVENT, "Run\n");
pmadapter->delay_rx_data_flag = MFALSE;
wlan_recv_event(wlan_get_priv(pmadapter,
MLAN_BSS_ROLE_ANY),
MLAN_EVENT_ID_DRV_DEFER_RX_DATA, MNULL);
}
#endif
pmadapter->ops.handle_rx_packet(pmadapter, pmbuf);
if (limit && rx_num >= limit)
break;
@ -1174,7 +1215,7 @@ process_start:
pmadapter->pending_disconnect_priv, MTRUE);
pmadapter->pending_disconnect_priv = MNULL;
}
#if defined(SDIO)
#if defined(SDIO) || defined(PCIE)
if (!IS_USB(pmadapter->card_type)) {
if (pmadapter->rx_pkts_queued > HIGH_RX_PENDING) {
pcb->moal_tp_accounting_rx_param(
@ -1188,7 +1229,7 @@ process_start:
if (pmadapter->ireg) {
if (pmadapter->hs_activated == MTRUE)
wlan_process_hs_config(pmadapter);
pmadapter->ops.process_int_status(pmadapter, 0);
pmadapter->ops.process_int_status(pmadapter);
if (pmadapter->data_received)
mlan_queue_rx_work(pmadapter);
}
@ -1258,11 +1299,8 @@ 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 */
@ -1276,8 +1314,6 @@ process_start:
WlanHardwareStatusInitializing;
wlan_get_hw_spec_complete(pmadapter);
}
} else {
wlan_release_cmd_lock(pmadapter);
}
/* Check for event */
@ -1285,6 +1321,7 @@ process_start:
pmadapter->event_received = MFALSE;
wlan_process_event(pmadapter);
}
/* Check if we need to confirm Sleep Request received previously
*/
if (pmadapter->ps_state == PS_STATE_PRE_SLEEP)
@ -1380,8 +1417,7 @@ process_start:
exit_main_proc:
if (pmadapter->hw_status == WlanHardwareStatusClosing)
if (MLAN_STATUS_SUCCESS != mlan_shutdown_fw(pmadapter))
PRINTM(MERROR, "ERR:mlan_shutdown_fw failed\n");
mlan_shutdown_fw(pmadapter);
LEAVE();
return ret;
}
@ -1483,6 +1519,11 @@ mlan_status mlan_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
wlan_cancel_all_pending_cmd(pmadapter, MFALSE);
goto exit;
}
if (pioctl_req->action == MLAN_ACT_CANCEL) {
wlan_cancel_pending_ioctl(pmadapter, pioctl_req);
ret = MLAN_STATUS_SUCCESS;
goto exit;
}
pmpriv = pmadapter->priv[pioctl_req->bss_index];
ret = pmpriv->ops.ioctl(adapter, pioctl_req);
exit:
@ -1516,9 +1557,6 @@ mlan_status mlan_write_data_async_complete(t_void *padapter, pmlan_buffer pmbuf,
wlan_free_mlan_buffer(pmadapter, pmbuf);
} else {
pmadapter->data_sent = MFALSE;
wlan_update_port_status(pmadapter, port, MFALSE);
PRINTM(MDATA, "mlan_write_data_async_complete: DATA(%d)\n",
port);
ret = wlan_write_data_complete(pmadapter, pmbuf, status);
}
@ -1542,9 +1580,9 @@ mlan_status mlan_recv(t_void *padapter, pmlan_buffer pmbuf, t_u32 port)
mlan_adapter *pmadapter = (mlan_adapter *)padapter;
t_u8 *pbuf;
t_u32 len, recv_type;
t_u32 event_cause = 0;
t_u32 event_cause;
#ifdef DEBUG_LEVEL1
t_u32 sec = 0, usec = 0;
t_u32 sec, usec;
#endif
t_u32 max_rx_data_size = MLAN_RX_DATA_BUF_SIZE;
@ -1593,13 +1631,11 @@ 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:
@ -1745,12 +1781,8 @@ 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;
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_prepare_cmd(pmpriv, HostCmd_CMD_802_11_EAPOL_PKT,
0, 0, MNULL, pmbuf);
wlan_recv_event(pmpriv,
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
MNULL);
@ -1852,54 +1884,4 @@ t_void mlan_set_int_mode(t_void *adapter, t_u32 int_mode, t_u8 func_num)
pmadapter->pcard_pcie->func_num = func_num;
LEAVE();
}
/**
* @brief This function handle RX/EVENT/CMDRESP/TX_COMPLETE interrupt.
*
* @param adapter A pointer to mlan_adapter structure
* @param type interrupt type
* @return N/A
*/
void mlan_process_pcie_interrupt_cb(t_void *padapter, int type)
{
mlan_adapter *pmadapter = (mlan_adapter *)padapter;
pmlan_callbacks pcb = &pmadapter->callbacks;
ENTER();
if (type == RX_DATA) {
if (pmadapter->rx_pkts_queued > HIGH_RX_PENDING) {
pcb->moal_tp_accounting_rx_param(
pmadapter->pmoal_handle, 2, 0);
PRINTM(MEVENT, "Pause\n");
pmadapter->delay_rx_data_flag = MTRUE;
if (pmadapter->napi)
mlan_queue_rx_work(pmadapter);
else
mlan_rx_process(pmadapter, MNULL);
LEAVE();
return;
}
}
pmadapter->ops.process_int_status(pmadapter, type);
switch (type) {
case RX_DATA: // Rx Data
if (pmadapter->data_received) {
if (pmadapter->napi)
mlan_queue_rx_work(pmadapter);
else
mlan_rx_process(pmadapter, MNULL);
}
break;
case RX_EVENT: // Rx event
case TX_COMPLETE: // Tx data complete
case RX_CMD_RESP: // Rx CMD Resp
mlan_main_process(pmadapter);
break;
default:
break;
}
LEAVE();
return;
}
#endif

View file

@ -5,20 +5,29 @@
* it is ready.
*
*
* Copyright 2008-2023 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -424,55 +433,6 @@ static mlan_status wlan_cmd_mfg_tx_frame(pmlan_private pmpriv,
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function prepares command of MFG config trigger frame.
*
* @param pmpriv A pointer to mlan_private structure
* @param cmd A pointer to HostCmd_DS_COMMAND structure
* @param action The action: GET or SET
* @param pdata_buf A pointer to data buffer
*
* @return MLAN_STATUS_SUCCESS
*/
static mlan_status wlan_cmd_mfg_config_trigger_frame(pmlan_private pmpriv,
HostCmd_DS_COMMAND *cmd,
t_u16 action,
t_void *pdata_buf)
{
mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t *mcmd =
(mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t *)&cmd->params
.mfg_tx_trigger_config;
mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t *cfg =
(mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t *)pdata_buf;
ENTER();
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_MFG_COMMAND);
cmd->size = wlan_cpu_to_le16(
sizeof(mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t) + S_DS_GEN);
mcmd->mfg_cmd = wlan_cpu_to_le32(cfg->mfg_cmd);
mcmd->action = wlan_cpu_to_le16(action);
if (action == HostCmd_ACT_GEN_SET) {
mcmd->enable_tx = wlan_cpu_to_le32(cfg->enable_tx);
mcmd->standalone_hetb = wlan_cpu_to_le32(cfg->standalone_hetb);
mcmd->frmCtl.type = wlan_cpu_to_le16(cfg->frmCtl.type);
mcmd->frmCtl.sub_type = wlan_cpu_to_le16(cfg->frmCtl.sub_type);
mcmd->duration = wlan_cpu_to_le16(cfg->duration);
mcmd->trig_common_field =
wlan_cpu_to_le64(cfg->trig_common_field);
memcpy_ext(pmpriv->adapter, &mcmd->trig_user_info_field,
&cfg->trig_user_info_field,
sizeof(cfg->trig_user_info_field),
sizeof(mcmd->trig_user_info_field));
mcmd->basic_trig_user_info =
wlan_cpu_to_le16(cfg->basic_trig_user_info);
}
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function prepares command of MFG HE TB Tx.
*
@ -544,10 +504,6 @@ mlan_status wlan_cmd_mfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
case MFG_CMD_CONFIG_MAC_HE_TB_TX:
ret = wlan_cmd_mfg_he_tb_tx(pmpriv, cmd, action, pdata_buf);
goto cmd_mfg_done;
case MFG_CMD_CONFIG_TRIGGER_FRAME:
ret = wlan_cmd_mfg_config_trigger_frame(pmpriv, cmd, action,
pdata_buf);
goto cmd_mfg_done;
case MFG_CMD_SET_TEST_MODE:
case MFG_CMD_UNSET_TEST_MODE:
case MFG_CMD_TX_ANT:
@ -1002,10 +958,6 @@ static mlan_status wlan_cmd_mac_multicast_adr(pmlan_private pmpriv,
HostCmd_DS_MAC_MULTICAST_ADR *pmc_addr = &cmd->params.mc_addr;
ENTER();
if (!pdata_buf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
cmd->size = wlan_cpu_to_le16(sizeof(HostCmd_DS_MAC_MULTICAST_ADR) +
S_DS_GEN);
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_MAC_MULTICAST_ADR);
@ -1285,7 +1237,7 @@ static mlan_status wlan_cmd_802_11_key_material(pmlan_private pmpriv,
S_DS_GEN + KEY_PARAMS_FIXED_LEN +
sizeof(gcmp_param) +
sizeof(pkey_material->action));
PRINTM(MCMND, "Set GCMP Key\n");
goto done;
}
if (pkey->key_flags & KEY_FLAG_CCMP_256) {
@ -1309,7 +1261,7 @@ static mlan_status wlan_cmd_802_11_key_material(pmlan_private pmpriv,
S_DS_GEN + KEY_PARAMS_FIXED_LEN +
sizeof(ccmp_256_param) +
sizeof(pkey_material->action));
PRINTM(MCMND, "Set CCMP256 Key\n");
goto done;
}
if (pkey->key_len == WPA_AES_KEY_LEN &&
@ -1376,7 +1328,7 @@ static mlan_status wlan_cmd_802_11_key_material(pmlan_private pmpriv,
(KEY_FLAG_RX_SEQ_VALID | KEY_FLAG_TX_SEQ_VALID))
memcpy_ext(pmpriv->adapter,
pkey_material->key_param_set.key_params
.gmac_aes.ipn,
.cmac_aes.ipn,
pkey->pn, SEQ_MAX_SIZE, IGTK_PN_SIZE);
pkey_material->key_param_set.key_info &=
~(wlan_cpu_to_le16(KEY_INFO_MCAST_KEY));
@ -1384,10 +1336,10 @@ static mlan_status wlan_cmd_802_11_key_material(pmlan_private pmpriv,
wlan_cpu_to_le16(KEY_INFO_AES_MCAST_IGTK);
pkey_material->key_param_set.key_type =
KEY_TYPE_ID_BIP_GMAC_256;
pkey_material->key_param_set.key_params.gmac_aes.key_len =
pkey_material->key_param_set.key_params.cmac_aes.key_len =
wlan_cpu_to_le16(pkey->key_len);
memcpy_ext(pmpriv->adapter,
pkey_material->key_param_set.key_params.gmac_aes.key,
pkey_material->key_param_set.key_params.cmac_aes.key,
pkey->key_material, pkey->key_len,
WPA_IGTK_256_KEY_LEN);
pkey_material->key_param_set.length = wlan_cpu_to_le16(
@ -2546,46 +2498,6 @@ 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
@ -2693,8 +2605,6 @@ static mlan_status wlan_cmd_inactivity_timeout(HostCmd_DS_COMMAND *cmd,
wlan_cpu_to_le16((t_u16)inac_to->mcast_timeout);
cmd_inac_to->ps_entry_timeout =
wlan_cpu_to_le16((t_u16)inac_to->ps_entry_timeout);
cmd_inac_to->ps_cmd_timeout =
wlan_cpu_to_le16((t_u16)inac_to->ps_cmd_timeout);
}
LEAVE();
@ -2728,15 +2638,13 @@ mlan_status wlan_cmd_net_monitor(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
cmd->command = wlan_cpu_to_le16(cmd->command);
cmd_net_mon->action = wlan_cpu_to_le16(cmd_action);
if (cmd_action == HostCmd_ACT_GEN_SET) {
cmd_net_mon->enable_net_mon =
wlan_cpu_to_le16((t_u16)net_mon->enable_net_mon);
if (net_mon->enable_net_mon) {
cmd_net_mon->enable_net_mon =
wlan_cpu_to_le16((t_u16)NET_MON_MODE3);
cmd_net_mon->filter_flag =
wlan_cpu_to_le16((t_u16)net_mon->filter_flag);
}
if (net_mon->enable_net_mon && net_mon->channel) {
pchan_band =
&cmd_net_mon->monitor_chan.chan_band_param[0];
cmd_net_mon->filter_flag =
wlan_cpu_to_le16((t_u16)net_mon->filter_flag);
cmd_net_mon->monitor_chan.header.type =
wlan_cpu_to_le16(TLV_TYPE_CHANNELBANDLIST);
cmd_net_mon->monitor_chan.header.len =
@ -3321,7 +3229,7 @@ static t_u16 mlan_prepare_roam_offload_tlv(pmlan_private pmpriv, t_u32 type,
pos += sizeof(MrvlIEtypes_RepeatCount_t);
}
LEAVE();
return ((t_u16)(pos - begin));
return (pos - begin);
}
/**
* @brief This function sends enable/disable roam offload command to firmware.
@ -3464,8 +3372,6 @@ static mlan_status wlan_cmd_auto_tx(pmlan_private pmpriv,
MrvlIEtypes_Keep_Alive_Ctrl_t *ctrl_tlv = MNULL;
MrvlIEtypes_Keep_Alive_Pkt_t *pkt_tlv = MNULL;
mlan_ds_misc_keep_alive *misc_keep_alive = MNULL;
MrvlIEtypes_Cloud_Keep_Alive_Rx_t *keep_alive_Rx_tlv = MNULL;
mlan_ds_misc_keep_alive_rx *misc_keep_alive_rx = MNULL;
t_u8 eth_ip[] = {0x08, 0x00};
ENTER();
@ -3560,46 +3466,6 @@ static mlan_status wlan_cmd_auto_tx(pmlan_private pmpriv,
}
keep_alive_tlv->header.len = wlan_cpu_to_le16(len);
cmd->size = cmd->size + len + sizeof(MrvlIEtypesHeader_t);
cmd->size = wlan_cpu_to_le16(cmd->size);
break;
case OID_CLOUD_KEEP_ALIVE_ACK:
misc_keep_alive_rx = (mlan_ds_misc_keep_alive_rx *)pdata_buf;
keep_alive_Rx_tlv = (MrvlIEtypes_Cloud_Keep_Alive_Rx_t *)pos;
keep_alive_Rx_tlv->header.type =
wlan_cpu_to_le16(TLV_TYPE_CLOUD_KEEP_ALIVE_ACK);
keep_alive_Rx_tlv->keep_alive_id =
misc_keep_alive_rx->mkeep_alive_id;
keep_alive_Rx_tlv->enable = misc_keep_alive_rx->enable;
memcpy_ext(pmpriv->adapter,
keep_alive_Rx_tlv->eth_header.dest_addr,
misc_keep_alive_rx->dst_mac, MLAN_MAC_ADDR_LENGTH,
MLAN_MAC_ADDR_LENGTH);
memcpy_ext(pmpriv->adapter,
keep_alive_Rx_tlv->eth_header.src_addr,
misc_keep_alive_rx->src_mac, MLAN_MAC_ADDR_LENGTH,
MLAN_MAC_ADDR_LENGTH);
memcpy_ext(pmpriv->adapter,
(t_u8 *)&keep_alive_Rx_tlv->eth_header.h803_len,
eth_ip, sizeof(t_u16), sizeof(t_u16));
if (misc_keep_alive_rx->ether_type)
keep_alive_Rx_tlv->eth_header.h803_len =
mlan_htons(misc_keep_alive_rx->ether_type);
else
memcpy_ext(
pmpriv->adapter,
(t_u8 *)&keep_alive_Rx_tlv->eth_header.h803_len,
eth_ip, sizeof(t_u16), sizeof(t_u16));
memcpy_ext(pmpriv->adapter,
(t_u8 *)&keep_alive_Rx_tlv->ip_packet,
misc_keep_alive_rx->packet,
misc_keep_alive_rx->pkt_len,
MKEEP_ALIVE_ACK_PKT_MAX);
len = sizeof(MrvlIEtypes_Cloud_Keep_Alive_Rx_t) +
misc_keep_alive_rx->pkt_len - sizeof(MrvlIEtypesHeader_t);
keep_alive_Rx_tlv->header.len = wlan_cpu_to_le16(len);
cmd->size = cmd->size + len + sizeof(MrvlIEtypesHeader_t);
cmd->size = wlan_cpu_to_le16(cmd->size);
break;
@ -3726,6 +3592,9 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_get_hw_spec(pmpriv, cmd_ptr);
break;
#ifdef SDIO
case HostCmd_CMD_SDIO_SP_RX_AGGR_CFG:
ret = wlan_cmd_sdio_rx_aggr_cfg(cmd_ptr, cmd_action, pdata_buf);
break;
#endif
case HostCmd_CMD_CFG_DATA:
ret = wlan_cmd_cfg_data(pmpriv, cmd_ptr, cmd_action, cmd_oid,
@ -3794,7 +3663,7 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_ips_config(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_PMIC_CONFIGURE:
case HOST_CMD_PMIC_CONFIGURE:
cmd_ptr->command = wlan_cpu_to_le16(cmd_no);
cmd_ptr->size = wlan_cpu_to_le16(S_DS_GEN);
break;
@ -3839,14 +3708,6 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_802_11_link_statistic(pmpriv, cmd_ptr,
cmd_action, pioctl_buf);
break;
case HostCmd_CMD_FTM_CONFIG_SESSION_PARAMS:
ret = wlan_cmd_802_11_ftm_config_session_params(
pmpriv, cmd_ptr, cmd_action, cmd_oid, pdata_buf);
break;
case HostCmd_CMD_FTM_CONFIG_RESPONDER:
ret = wlan_cmd_802_11_ftm_config_responder(
pmpriv, cmd_ptr, cmd_action, cmd_oid, pdata_buf);
break;
case HostCmd_CMD_RSSI_INFO:
ret = wlan_cmd_802_11_rssi_info(pmpriv, cmd_ptr, cmd_action);
break;
@ -4085,7 +3946,7 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
pdata_buf);
break;
#ifdef WIFI_DIRECT_SUPPORT
case HostCmd_CMD_WIFI_DIRECT_MODE_CONFIG:
case HOST_CMD_WIFI_DIRECT_MODE_CONFIG:
ret = wlan_cmd_wifi_direct_mode(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
@ -4098,10 +3959,6 @@ 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;
@ -4119,21 +3976,16 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
pmpriv, cmd_ptr, cmd_action, pdata_buf);
break;
#endif
case HostCmd_CMD_MULTI_CHAN_CONFIG:
ret = wlan_cmd_multi_chan_cfg(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
#ifdef RX_PACKET_COALESCE
case HostCmd_CMD_RX_PKT_COALESCE_CFG:
ret = wlan_cmd_rx_pkt_coalesce_cfg(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_MULTI_CHAN_POLICY:
ret = wlan_cmd_multi_chan_policy(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_DRCS_CONFIG:
ret = wlan_cmd_drcs_cfg(pmpriv, cmd_ptr, cmd_action, pdata_buf);
break;
case HostCmd_CMD_CONFIG_LOW_POWER_MODE:
#endif
case HostCMD_CONFIG_LOW_POWER_MODE:
ret = wlan_cmd_low_pwr_mode(pmpriv, cmd_ptr, pdata_buf);
break;
case HostCmd_CMD_DFS_REPEATER_MODE:
case HostCmd_DFS_REPEATER_MODE:
ret = wlan_cmd_dfs_repeater_cfg(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
@ -4141,7 +3993,7 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_coalesce_config(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_DS_GET_SENSOR_TEMP:
case HostCmd_DS_GET_SENSOR_TEMP:
ret = wlan_cmd_get_sensor_temp(pmpriv, cmd_ptr, cmd_action);
break;
case HostCmd_CMD_802_11_MIMO_SWITCH:
@ -4179,7 +4031,7 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_auto_tx(pmpriv, cmd_ptr, cmd_action, cmd_oid,
pdata_buf);
break;
case HostCmd_CMD_TX_RX_PKT_STATS:
case HOST_CMD_TX_RX_PKT_STATS:
ret = wlan_cmd_tx_rx_pkt_stats(pmpriv, cmd_ptr,
(pmlan_ioctl_req)pioctl_buf,
pdata_buf);
@ -4196,6 +4048,11 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_fw_dump_event(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
#if defined(DRV_EMBEDDED_SUPPLICANT)
case HostCmd_CMD_CRYPTO:
ret = wlan_cmd_crypto(pmpriv, cmd_ptr, cmd_action, pdata_buf);
break;
#endif
case HostCmd_CMD_11AX_CFG:
ret = wlan_cmd_11ax_cfg(pmpriv, cmd_ptr, cmd_action, pdata_buf);
break;
@ -4209,7 +4066,7 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
case HostCmd_CMD_TWT_CFG:
ret = wlan_cmd_twt_cfg(pmpriv, cmd_ptr, cmd_action, pdata_buf);
break;
case HostCmd_CMD_GPIO_TSF_LATCH_PARAM_CONFIG:
case HOST_CMD_GPIO_TSF_LATCH_PARAM_CONFIG:
ret = wlan_cmd_gpio_tsf_latch(pmpriv, cmd_ptr, cmd_action,
pioctl_buf, pdata_buf);
break;
@ -4217,22 +4074,10 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_rxabortcfg(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_OFDM_DESENSE_CFG:
ret = wlan_cmd_ofdmdesense_cfg(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_RX_ABORT_CFG_EXT:
ret = wlan_cmd_rxabortcfg_ext(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_NAV_MITIGATION_CFG:
ret = wlan_cmd_nav_mitigation(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_802_11_LED_CONTROL:
ret = wlan_cmd_led_config(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_ARB_CONFIG:
ret = wlan_cmd_arb_cfg(pmpriv, cmd_ptr, cmd_action, pdata_buf);
break;
@ -4252,7 +4097,7 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_cck_desense_cfg(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_CHANNEL_TRPC_CONFIG:
case HostCmd_CHANNEL_TRPC_CONFIG:
ret = wlan_cmd_get_chan_trpc_config(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
@ -4271,10 +4116,6 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
ret = wlan_cmd_get_ch_load(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
case HostCmd_CMD_CROSS_CHIP_SYNCH:
ret = wlan_cmd_cross_chip_synch(pmpriv, cmd_ptr, cmd_action,
pdata_buf);
break;
default:
PRINTM(MERROR, "PREP_CMD: unknown command- %#x\n", cmd_no);
ret = MLAN_STATUS_FAILURE;

View file

@ -4,20 +4,29 @@
* responses generated by firmware.
*
*
* Copyright 2008-2023 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -101,8 +110,7 @@ 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 ||
sta_ptr->is_11ax_enabled) {
if (sta_ptr->is_11n_enabled) {
wlan_cleanup_reorder_tbl(
pmpriv, ptdls_oper_data->peer_mac);
wlan_11n_cleanup_txbastream_tbl(
@ -181,8 +189,6 @@ static mlan_status wlan_process_cmdresp_error(mlan_private *pmpriv,
} break;
case HostCmd_CMD_802_11_SCAN_EXT:
case HostCmd_CMD_802_11_SCAN:
if (resp->result == HostCmd_RESULT_BUSY)
pmadapter->dbg.num_scan_err++;
/* Cancel all pending scan command */
wlan_flush_scan_queue(pmadapter);
@ -260,15 +266,13 @@ static mlan_status wlan_process_cmdresp_error(mlan_private *pmpriv,
break;
#endif
case HostCmd_CMD_802_11_ASSOCIATE:
if (resp->result == HostCmd_RESULT_BUSY)
pmadapter->dbg.num_assoc_err++;
wlan_reset_connect_state(pmpriv, MTRUE);
break;
case HostCmd_CMD_802_11_REMAIN_ON_CHANNEL:
if (resp->result == HostCmd_RESULT_BUSY)
pmadapter->dbg.num_remain_chan_err++;
break;
#ifdef SDIO
case HostCmd_CMD_SDIO_SP_RX_AGGR_CFG:
pmadapter->pcard_sd->sdio_rx_aggr_enable = MFALSE;
PRINTM(MMSG, "FW don't support SDIO single port rx aggr\n");
break;
#endif
case HostCmd_CMD_MGMT_IE_LIST: {
@ -326,8 +330,7 @@ static mlan_status wlan_process_cmdresp_error(mlan_private *pmpriv,
}
} break;
case HostCmd_CMD_ROAM_OFFLOAD:
if (MLAN_STATUS_SUCCESS != wlan_clear_fw_roaming_pmk(pmpriv))
PRINTM(MERROR, "wlan_clear_fw_roaming_pmk fail\n");
wlan_clear_fw_roaming_pmk(pmpriv);
pmpriv->adapter->fw_roaming = MFALSE;
PRINTM(MERROR, "FW do not support roaming!\n");
break;
@ -335,6 +338,12 @@ static mlan_status wlan_process_cmdresp_error(mlan_private *pmpriv,
ret = MLAN_STATUS_SUCCESS;
PRINTM(MCMND, "FW don't support chan region cfg command!\n");
break;
#if defined(DRV_EMBEDDED_SUPPLICANT)
case HostCmd_CMD_CRYPTO:
PRINTM(MCMND, "crypto cmd result=0x%x!\n", resp->result);
ret = wlan_ret_crypto(pmpriv, resp, pioctl_buf);
break;
#endif
default:
break;
}
@ -627,7 +636,6 @@ 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);
@ -718,10 +726,8 @@ static mlan_status wlan_ret_get_log(pmlan_private pmpriv,
wlan_le32_to_cpu(pget_log->rx_stuck_issue_cnt[0]);
pget_info->param.stats.rx_stuck_issue_cnt[1] =
wlan_le32_to_cpu(pget_log->rx_stuck_issue_cnt[1]);
pget_info->param.stats.rx_stuck_poll_recovery_cnt =
wlan_le32_to_cpu(pget_log->rx_stuck_poll_recovery_cnt);
pget_info->param.stats.rx_stuck_intr_recovery_cnt =
wlan_le32_to_cpu(pget_log->rx_stuck_intr_recovery_cnt);
pget_info->param.stats.rx_stuck_recovery_cnt =
wlan_le32_to_cpu(pget_log->rx_stuck_recovery_cnt);
pget_info->param.stats.rx_stuck_tsf[0] =
wlan_le64_to_cpu(pget_log->rx_stuck_tsf[0]);
pget_info->param.stats.rx_stuck_tsf[1] =
@ -888,7 +894,7 @@ static mlan_status wlan_ret_get_log(pmlan_private pmpriv,
*/
static mlan_status wlan_get_power_level(pmlan_private pmpriv, void *pdata_buf)
{
t_s32 length = 0;
t_u16 length = 0;
t_s8 max_power = -1, min_power = -1;
MrvlTypes_Power_Group_t *ppg_tlv = MNULL;
Power_Group_t *pg = MNULL;
@ -907,7 +913,7 @@ static mlan_status wlan_get_power_level(pmlan_private pmpriv, void *pdata_buf)
min_power = pg->power_min;
length -= sizeof(Power_Group_t);
}
while (length > 0) {
while (length) {
pg++;
if (max_power < pg->power_max)
max_power = pg->power_max;
@ -1318,16 +1324,11 @@ static mlan_status wlan_ret_802_11_key_material(pmlan_private pmpriv,
}
if (memcmp(pmpriv->adapter, pmpriv->gtk_rekey.kek,
zero_kek, sizeof(zero_kek)) != 0) {
mlan_status ret = MLAN_STATUS_SUCCESS;
ret = wlan_prepare_cmd(
wlan_prepare_cmd(
pmpriv,
HostCmd_CMD_GTK_REKEY_OFFLOAD_CFG,
HostCmd_ACT_GEN_SET, 0, MNULL,
&pmpriv->gtk_rekey);
if (ret) {
PRINTM(MINFO,
"Error sending message to FW\n");
}
memset(pmpriv->adapter, &pmpriv->gtk_rekey, 0,
sizeof(mlan_ds_misc_gtk_rekey_data));
}
@ -1396,16 +1397,13 @@ static mlan_status wlan_ret_802_11_key_material(pmlan_private pmpriv,
wlan_le16_to_cpu(
pkey->key_param_set.key_params
.aes.key_len);
sec->param.encrypt_key
.key_len = MIN(
memcpy_ext(
pmpriv->adapter,
sec->param.encrypt_key.key_material,
pkey->key_param_set.key_params.aes.key,
sec->param.encrypt_key.key_len,
sizeof(pkey->key_param_set.key_params
.aes.key)),
memcpy_ext(pmpriv->adapter,
sec->param.encrypt_key.key_material,
pkey->key_param_set.key_params.aes.key,
sec->param.encrypt_key.key_len,
sizeof(sec->param.encrypt_key.key_material));
sizeof(sec->param.encrypt_key
.key_material));
memcpy_ext(
pmpriv->adapter,
sec->param.encrypt_key.pn,
@ -1418,16 +1416,13 @@ static mlan_status wlan_ret_802_11_key_material(pmlan_private pmpriv,
wlan_le16_to_cpu(
pkey->key_param_set.key_params
.cmac_aes.key_len);
sec->param.encrypt_key
.key_len = MIN(
sec->param.encrypt_key.key_len,
sizeof(pkey->key_param_set.key_params
.cmac_aes.key)),
memcpy_ext(pmpriv->adapter,
sec->param.encrypt_key.key_material,
pkey->key_param_set.key_params.cmac_aes.key,
sec->param.encrypt_key.key_len,
sizeof(sec->param.encrypt_key.key_material));
memcpy_ext(pmpriv->adapter,
sec->param.encrypt_key.key_material,
pkey->key_param_set.key_params
.cmac_aes.key,
sec->param.encrypt_key.key_len,
sizeof(sec->param.encrypt_key
.key_material));
memcpy_ext(pmpriv->adapter,
sec->param.encrypt_key.pn,
pkey->key_param_set.key_params
@ -1440,16 +1435,13 @@ static mlan_status wlan_ret_802_11_key_material(pmlan_private pmpriv,
wlan_le16_to_cpu(
pkey->key_param_set.key_params
.wep.key_len);
sec->param.encrypt_key
.key_len = MIN(
memcpy_ext(
pmpriv->adapter,
sec->param.encrypt_key.key_material,
pkey->key_param_set.key_params.wep.key,
sec->param.encrypt_key.key_len,
sizeof(pkey->key_param_set.key_params
.wep.key)),
memcpy_ext(pmpriv->adapter,
sec->param.encrypt_key.key_material,
pkey->key_param_set.key_params.wep.key,
sec->param.encrypt_key.key_len,
sizeof(sec->param.encrypt_key.key_material));
sizeof(sec->param.encrypt_key
.key_material));
break;
}
}
@ -1855,8 +1847,7 @@ 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 ||
sta_ptr->is_11ax_enabled) {
if (sta_ptr->is_11n_enabled) {
wlan_cleanup_reorder_tbl(
pmpriv, tdls_all_cfg->u.tdls_tear_down
.peer_mac_addr);
@ -2028,8 +2019,7 @@ 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 ||
sta_ptr->is_11ax_enabled) {
if (sta_ptr->is_11n_enabled) {
wlan_cleanup_reorder_tbl(pmpriv,
ptdls_oper->peer_mac);
wlan_11n_cleanup_txbastream_tbl(
@ -2128,8 +2118,6 @@ static mlan_status wlan_ret_inactivity_timeout(pmlan_private pmpriv,
wlan_le16_to_cpu(cmd_inac_to->mcast_timeout);
inac_to->ps_entry_timeout =
wlan_le16_to_cpu(cmd_inac_to->ps_entry_timeout);
inac_to->ps_cmd_timeout =
wlan_le16_to_cpu(cmd_inac_to->ps_cmd_timeout);
}
LEAVE();
@ -2257,42 +2245,6 @@ 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
@ -2634,22 +2586,20 @@ static mlan_status wlan_ret_sta_config(pmlan_private pmpriv,
if (pioctl_buf->req_id == MLAN_IOCTL_BSS) {
bss = (mlan_ds_bss *)pioctl_buf->pbuf;
if (bss->sub_command == MLAN_OID_BSS_CHAN_INFO) {
Band_Config_t *bandcfg =
&bss->param.sta_channel.bandcfg;
tlv_band_channel =
(MrvlIEtypes_channel_band_t *)
cmdrsp_sta_cfg->tlv_buffer;
*bandcfg = tlv_band_channel->bandcfg;
bss->param.sta_channel.bandcfg =
tlv_band_channel->bandcfg;
bss->param.sta_channel.channel =
tlv_band_channel->channel;
bss->param.sta_channel.is_11n_enabled =
IS_11N_ENABLED(pmpriv);
if (bandcfg->chanWidth == CHAN_BW_80MHZ)
if (bss->param.sta_channel.bandcfg.chanWidth ==
CHAN_BW_80MHZ)
bss->param.sta_channel.center_chan =
wlan_get_center_freq_idx(
pmpriv,
bandcfg->chanBand,
pmpriv, BAND_AAC,
bss->param.sta_channel
.channel,
CHANNEL_BW_80MHZ);
@ -2685,6 +2635,10 @@ 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;
}
@ -2721,10 +2675,7 @@ static mlan_status wlan_ret_roam_offload(pmlan_private pmpriv,
pmpriv->adapter->fw_roaming = MTRUE;
else {
pmpriv->adapter->fw_roaming = MFALSE;
if (MLAN_STATUS_SUCCESS !=
wlan_clear_fw_roaming_pmk(pmpriv))
PRINTM(MERROR,
"wlan_clear_fw_roaming_pmk failed\n");
wlan_clear_fw_roaming_pmk(pmpriv);
}
}
}
@ -2756,8 +2707,6 @@ static mlan_status wlan_ret_auto_tx(pmlan_private pmpriv,
MrvlIEtypes_Cloud_Keep_Alive_t *keep_alive_tlv = MNULL;
MrvlIEtypes_Keep_Alive_Pkt_t *pkt_tlv = MNULL;
mlan_ds_misc_keep_alive *misc_keep_alive = MNULL;
MrvlIEtypes_Cloud_Keep_Alive_Rx_t *keep_alive_Rx_tlv = MNULL;
mlan_ds_misc_keep_alive_rx *misc_keep_alive_rx = MNULL;
ENTER();
@ -2834,65 +2783,6 @@ static mlan_status wlan_ret_auto_tx(pmlan_private pmpriv,
}
}
}
if (header->type == TLV_TYPE_CLOUD_KEEP_ALIVE_ACK) {
keep_alive_Rx_tlv =
(MrvlIEtypes_Cloud_Keep_Alive_Rx_t *)
cmdrsp_auto_tx->tlv_buffer;
misc_keep_alive_rx = (mlan_ds_misc_keep_alive_rx *)&misc
->param.keep_alive_rx;
misc_keep_alive_rx->mkeep_alive_id =
keep_alive_Rx_tlv->keep_alive_id;
misc_keep_alive_rx->enable = keep_alive_Rx_tlv->enable;
if (((action == HostCmd_ACT_GEN_SET) ||
(action == HostCmd_ACT_GEN_RESET)) &&
!keep_alive_Rx_tlv->enable) {
len = len -
sizeof(keep_alive_Rx_tlv->keep_alive_id) -
sizeof(keep_alive_Rx_tlv->enable);
if (len > sizeof(MrvlIEtypesHeader_t)) {
header = (MrvlIEtypesHeader_t *)
keep_alive_Rx_tlv;
header->type =
wlan_le16_to_cpu(header->type);
len = wlan_le16_to_cpu(header->len) -
sizeof(Eth803Hdr_t);
if (header->type ==
TLV_TYPE_CLOUD_KEEP_ALIVE_ACK) {
memcpy_ext(
pmpriv->adapter,
misc_keep_alive_rx
->dst_mac,
keep_alive_Rx_tlv
->eth_header
.dest_addr,
MLAN_MAC_ADDR_LENGTH,
sizeof(misc_keep_alive_rx
->dst_mac));
memcpy_ext(
pmpriv->adapter,
misc_keep_alive_rx
->src_mac,
keep_alive_Rx_tlv
->eth_header
.src_addr,
MLAN_MAC_ADDR_LENGTH,
sizeof(misc_keep_alive
->src_mac));
memcpy_ext(
pmpriv->adapter,
misc_keep_alive_rx
->packet,
keep_alive_Rx_tlv
->ip_packet,
len,
sizeof(misc_keep_alive
->packet));
misc_keep_alive_rx->pkt_len =
len;
}
}
}
}
}
LEAVE();
@ -2993,53 +2883,6 @@ static mlan_status wlan_ret_mfg_tx_frame(pmlan_private pmpriv,
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function prepares command resp of MFG config Trigger frame
*
* @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_mfg_config_trigger_frame(pmlan_private pmpriv,
HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf)
{
mlan_ds_misc_cfg *misc = MNULL;
mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t *mcmd =
(mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t *)&resp->params
.mfg_tx_trigger_config;
mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t *cfg = MNULL;
ENTER();
if (!pioctl_buf) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
misc = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
cfg = (mfg_Cmd_IEEEtypes_CtlBasicTrigHdr_t *)&misc->param
.mfg_tx_trigger_config;
cfg->enable_tx = wlan_le32_to_cpu(mcmd->enable_tx);
cfg->standalone_hetb = wlan_le32_to_cpu(mcmd->standalone_hetb);
cfg->frmCtl.type = wlan_le16_to_cpu(mcmd->frmCtl.type);
cfg->frmCtl.sub_type = wlan_le16_to_cpu(mcmd->frmCtl.sub_type);
cfg->duration = wlan_le16_to_cpu(mcmd->duration);
cfg->trig_common_field = wlan_le64_to_cpu(mcmd->trig_common_field);
memcpy_ext(pmpriv->adapter, &cfg->trig_user_info_field,
&mcmd->trig_user_info_field,
sizeof(mcmd->trig_user_info_field),
sizeof(cfg->trig_user_info_field));
cfg->basic_trig_user_info =
wlan_le16_to_cpu(mcmd->basic_trig_user_info);
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function prepares command resp of MFG HE TB Tx
@ -3095,9 +2938,6 @@ mlan_status wlan_ret_mfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
(struct mfg_cmd_generic_cfg *)&resp->params.mfg_generic_cfg;
struct mfg_cmd_generic_cfg *cfg = MNULL;
mlan_status ret = MLAN_STATUS_SUCCESS;
#ifdef SD9177
mlan_adapter *pmadapter = pmpriv->adapter;
#endif
ENTER();
if (!pioctl_buf) {
@ -3114,10 +2954,6 @@ mlan_status wlan_ret_mfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
case MFG_CMD_CONFIG_MAC_HE_TB_TX:
ret = wlan_ret_mfg_he_tb_tx(pmpriv, resp, pioctl_buf);
goto cmd_mfg_done;
case MFG_CMD_CONFIG_TRIGGER_FRAME:
ret = wlan_ret_mfg_config_trigger_frame(pmpriv, resp,
pioctl_buf);
goto cmd_mfg_done;
case MFG_CMD_SET_TEST_MODE:
case MFG_CMD_UNSET_TEST_MODE:
case MFG_CMD_TX_ANT:
@ -3137,20 +2973,7 @@ mlan_status wlan_ret_mfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
cfg = (struct mfg_cmd_generic_cfg *)&misc->param.mfg_generic_cfg;
cfg->error = wlan_le32_to_cpu(mcmd->error);
#ifdef SD9177
if (IS_SD9177(pmadapter->card_type) &&
(wlan_le32_to_cpu(mcmd->mfg_cmd) == MFG_CMD_RFPWR)) {
//! TX_POWER was multipied by 16 while passing to fw
//! So It is needed to divide by 16 for user vals understanding.
cfg->data1 = (wlan_le32_to_cpu(mcmd->data1) >> 4);
} else {
#endif
cfg->data1 = wlan_le32_to_cpu(mcmd->data1);
#ifdef SD9177
}
#endif
cfg->data1 = wlan_le32_to_cpu(mcmd->data1);
cfg->data2 = wlan_le32_to_cpu(mcmd->data2);
cfg->data3 = wlan_le32_to_cpu(mcmd->data3);
cmd_mfg_done:
@ -3158,39 +2981,6 @@ cmd_mfg_done:
return ret;
}
/**
* @brief This function handles the command response of TWT_REPORT
*
* @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
*/
mlan_status wlan_ret_twt_report(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
mlan_ioctl_req *pioctl_buf)
{
mlan_ds_misc_cfg *misc_cfg = MNULL;
HostCmd_DS_TWT_CFG *twt_recfg = &resp->params.twtcfg;
ENTER();
if ((wlan_le16_to_cpu(twt_recfg->action) == HostCmd_ACT_GEN_GET) &&
(wlan_le16_to_cpu(twt_recfg->sub_id) ==
MLAN_11AX_TWT_REPORT_SUBID)) {
if (pioctl_buf) {
misc_cfg = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
memcpy_ext(pmpriv->adapter,
&misc_cfg->param.twt_report_info,
&resp->params.twtcfg.param.twt_report,
sizeof(mlan_ds_twt_report),
sizeof(mlan_ds_twt_report));
}
}
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function handles the station command response
*
@ -3228,6 +3018,9 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
ret = wlan_ret_get_hw_spec(pmpriv, resp, pioctl_buf);
break;
#ifdef SDIO
case HostCmd_CMD_SDIO_SP_RX_AGGR_CFG:
ret = wlan_ret_sdio_rx_aggr_cfg(pmpriv, resp);
break;
#endif
case HostCmd_CMD_CFG_DATA:
ret = wlan_ret_cfg_data(pmpriv, resp, pioctl_buf);
@ -3325,14 +3118,6 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
case HostCmd_CMD_802_11_LINK_STATS:
ret = wlan_ret_get_link_statistic(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_FTM_CONFIG_SESSION_PARAMS:
ret = wlan_ret_802_11_ftm_config_session_params(pmpriv, resp,
pioctl_buf);
break;
case HostCmd_CMD_FTM_CONFIG_RESPONDER:
ret = wlan_ret_802_11_ftm_config_responder(pmpriv, resp,
pioctl_buf);
break;
case HostCmd_CMD_RSSI_INFO_EXT:
ret = wlan_ret_802_11_rssi_info_ext(pmpriv, resp, pioctl_buf);
break;
@ -3400,10 +3185,6 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
break;
case HostCmd_CMD_RECONFIGURE_TX_BUFF:
wlan_set_tx_pause_flag(pmpriv, MFALSE);
#if defined(USB)
if (IS_USB(pmadapter->card_type))
wlan_resync_usb_port(pmadapter);
#endif
pmadapter->tx_buf_size =
(t_u16)wlan_le16_to_cpu(resp->params.tx_buf.buff_size);
@ -3538,7 +3319,7 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
ret = wlan_ret_remain_on_channel(pmpriv, resp, pioctl_buf);
break;
#ifdef WIFI_DIRECT_SUPPORT
case HostCmd_CMD_WIFI_DIRECT_MODE_CONFIG:
case HOST_CMD_WIFI_DIRECT_MODE_CONFIG:
ret = wlan_ret_wifi_direct_mode(pmpriv, resp, pioctl_buf);
break;
#endif
@ -3548,9 +3329,6 @@ 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;
@ -3566,18 +3344,14 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
pioctl_buf);
break;
#endif
case HostCmd_CMD_MULTI_CHAN_CONFIG:
ret = wlan_ret_multi_chan_cfg(pmpriv, resp, pioctl_buf);
#ifdef RX_PACKET_COALESCE
case HostCmd_CMD_RX_PKT_COALESCE_CFG:
ret = wlan_ret_rx_pkt_coalesce_cfg(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_MULTI_CHAN_POLICY:
ret = wlan_ret_multi_chan_policy(pmpriv, resp, pioctl_buf);
#endif
case HostCMD_CONFIG_LOW_POWER_MODE:
break;
case HostCmd_CMD_DRCS_CONFIG:
ret = wlan_ret_drcs_cfg(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_CONFIG_LOW_POWER_MODE:
break;
case HostCmd_CMD_DFS_REPEATER_MODE:
case HostCmd_DFS_REPEATER_MODE:
ret = wlan_ret_dfs_repeater_cfg(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_COALESCE_CFG:
@ -3585,7 +3359,7 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
break;
case HostCmd_CMD_MEF_CFG:
break;
case HostCmd_CMD_DS_GET_SENSOR_TEMP:
case HostCmd_DS_GET_SENSOR_TEMP:
ret = wlan_ret_get_sensor_temp(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_802_11_MIMO_SWITCH:
@ -3596,7 +3370,7 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
case HostCmd_CMD_STA_CONFIGURE:
ret = wlan_ret_sta_config(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_PMIC_CONFIGURE:
case HOST_CMD_PMIC_CONFIGURE:
break;
case HostCmd_CMD_INDEPENDENT_RESET_CFG:
ret = wlan_ret_ind_rst_cfg(pmpriv, resp, pioctl_buf);
@ -3615,7 +3389,7 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
case HostCmd_CMD_AUTO_TX:
ret = wlan_ret_auto_tx(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_TX_RX_PKT_STATS:
case HOST_CMD_TX_RX_PKT_STATS:
ret = wlan_ret_tx_rx_pkt_stats(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_DYN_BW:
@ -3624,6 +3398,11 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
case HostCmd_CMD_BOOT_SLEEP:
ret = wlan_ret_boot_sleep(pmpriv, resp, pioctl_buf);
break;
#if defined(DRV_EMBEDDED_SUPPLICANT)
case HostCmd_CMD_CRYPTO:
ret = wlan_ret_crypto(pmpriv, resp, pioctl_buf);
break;
#endif
case HostCmd_CMD_11AX_CFG:
ret = wlan_ret_11ax_cfg(pmpriv, resp, pioctl_buf);
break;
@ -3634,26 +3413,16 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
ret = wlan_ret_range_ext(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_TWT_CFG:
ret = wlan_ret_twt_report(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_GPIO_TSF_LATCH_PARAM_CONFIG:
case HOST_CMD_GPIO_TSF_LATCH_PARAM_CONFIG:
ret = wlan_ret_gpio_tsf_latch(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_RX_ABORT_CFG:
ret = wlan_ret_rxabortcfg(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_OFDM_DESENSE_CFG:
ret = wlan_ret_ofdmdesense_cfg(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_RX_ABORT_CFG_EXT:
ret = wlan_ret_rxabortcfg_ext(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_NAV_MITIGATION_CFG:
ret = wlan_ret_nav_mitigation(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_802_11_LED_CONTROL:
ret = wlan_ret_led_config(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_ARB_CONFIG:
ret = wlan_ret_arb_cfg(pmpriv, resp, pioctl_buf);
break;
@ -3676,7 +3445,7 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
case HostCmd_CMD_CCK_DESENSE_CFG:
ret = wlan_ret_cck_desense_cfg(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_CHANNEL_TRPC_CONFIG:
case HostCmd_CHANNEL_TRPC_CONFIG:
ret = wlan_ret_get_chan_trpc_config(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_LOW_POWER_MODE_CFG:
@ -3692,9 +3461,6 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
case HostCmd_CMD_GET_CH_LOAD:
ret = wlan_ret_ch_load(pmpriv, resp, pioctl_buf);
break;
case HostCmd_CMD_CROSS_CHIP_SYNCH:
ret = wlan_ret_cross_chip_synch(pmpriv, resp, pioctl_buf);
break;
default:
PRINTM(MERROR, "CMD_RESP: Unknown command response %#x\n",
resp->command);

View file

@ -5,18 +5,27 @@
*
* 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -33,6 +42,9 @@ Change log:
#include "mlan_wmm.h"
#include "mlan_11n.h"
#include "mlan_11h.h"
#ifdef DRV_EMBEDDED_SUPPLICANT
#include "authenticator_api.h"
#endif
#ifdef PCIE
#include "mlan_pcie.h"
#endif /* PCIE */
@ -136,8 +148,7 @@ 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 ||
sta_ptr->is_11ax_enabled)
if (sta_ptr->is_11n_enabled)
sta_ptr->ampdu_sta[i] =
priv->aggr_prio_tbl[i]
.ampdu_user;
@ -168,7 +179,6 @@ static void wlan_parse_tdls_event(pmlan_private priv, pmlan_buffer pevent)
case TDLS_EVENT_TYPE_LINK_TORN_DOWN:
if (sta_ptr) {
if (sta_ptr->external_tdls) {
mlan_status ret = MLAN_STATUS_SUCCESS;
PRINTM(MMSG,
"Receive TDLS TEAR DOWN event, Disable TDLS LINK\n");
pmadapter->tdls_status = TDLS_TEAR_DOWN;
@ -181,13 +191,10 @@ static void wlan_parse_tdls_event(pmlan_private priv, pmlan_buffer pevent)
MLAN_MAC_ADDR_LENGTH);
/* Send command to firmware to delete tdls
* link*/
ret = wlan_prepare_cmd(
priv, HostCmd_CMD_TDLS_OPERATION,
HostCmd_ACT_GEN_SET, 0, (t_void *)MNULL,
&tdls_oper);
if (ret)
PRINTM(MERROR,
"11D: failed to send cmd to FW\n");
wlan_prepare_cmd(priv,
HostCmd_CMD_TDLS_OPERATION,
HostCmd_ACT_GEN_SET, 0,
(t_void *)MNULL, &tdls_oper);
ptdls_event->bss_index = priv->bss_index;
ptdls_event->event_id =
MLAN_EVENT_ID_DRV_TDLS_TEARDOWN_REQ;
@ -214,8 +221,7 @@ 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 ||
sta_ptr->is_11ax_enabled) {
if (sta_ptr->is_11n_enabled) {
wlan_cleanup_reorder_tbl(
priv, tdls_event->peer_mac_addr);
wlan_11n_cleanup_txbastream_tbl(
@ -371,16 +377,7 @@ 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;
#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 defined(USB)
if (IS_USB(pmadapter->card_type))
wlan_resync_usb_port(pmadapter);
#endif
wlan_11h_check_update_radar_det_state(priv);
}
if (priv->port_ctrl_mode == MTRUE) {
@ -406,13 +403,17 @@ t_void wlan_reset_connect_state(pmlan_private priv, t_u8 drv_disconnect)
priv->rxpd_rate_info = 0;
priv->max_amsdu = 0;
priv->amsdu_disable = MFALSE;
priv->multi_ap_flag = 0;
wlan_coex_ampdu_rxwinsize(pmadapter);
priv->sec_info.ewpa_enabled = MFALSE;
priv->sec_info.wpa_enabled = MFALSE;
priv->sec_info.wpa2_enabled = MFALSE;
priv->wpa_ie_len = 0;
#ifdef DRV_EMBEDDED_SUPPLICANT
supplicantStopSessionTimer(priv->psapriv);
supplicantClrEncryptKey(priv->psapriv);
supplicantDisable(priv->psapriv);
#endif
priv->sec_info.wapi_enabled = MFALSE;
priv->wapi_ie_len = 0;
@ -471,6 +472,11 @@ t_void wlan_reset_connect_state(pmlan_private priv, t_u8 drv_disconnect)
return;
}
if (pmadapter->pending_disconnect_priv) {
LEAVE();
return;
}
pevent->bss_index = priv->bss_index;
pevent->event_id = MLAN_EVENT_ID_FW_DISCONNECTED;
pevent->event_len = sizeof(priv->disconnect_reason_code);
@ -671,12 +677,9 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
pmlan_callbacks pcb = &pmadapter->callbacks;
mlan_event *pevent = MNULL;
t_u8 addr[MLAN_MAC_ADDR_LENGTH];
Event_WLS_FTM_t *event_ftm = MNULL;
chan_band_info *pchan_band_info = MNULL;
t_u8 radar_chan;
t_u8 bandwidth;
t_u16 enable = 0;
Event_Link_Lost *link_lost_evt = MNULL;
ENTER();
@ -758,61 +761,20 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
break;
case EVENT_LINK_LOST:
if (pmbuf && (pmbuf->data_len >=
sizeof(eventcause) + sizeof(Event_Link_Lost))) {
link_lost_evt = (Event_Link_Lost *)(pmbuf->pbuf +
pmbuf->data_offset +
sizeof(eventcause));
PRINTM(MMSG,
"wlan: EVENT: Link lost (reason 0x%x) bssid: " MACSTR
"\n",
link_lost_evt->reason_code,
MAC2STR(link_lost_evt->bssid));
pmpriv->disconnect_reason_code =
link_lost_evt->reason_code;
if (memcmp(pmpriv->adapter, link_lost_evt->bssid,
&pmpriv->curr_bss_params.attemp_bssid,
MLAN_MAC_ADDR_LENGTH)) {
PRINTM(MMSG, "wlan: skip link lost event\n");
PRINTM(MMSG, "pattempted_bssid: " MACSTR "\n",
MAC2STR(&pmpriv->curr_bss_params
.attemp_bssid));
break;
}
} else {
if (memcmp(pmpriv->adapter,
pmpriv->curr_bss_params.bss_descriptor
.mac_address,
&pmpriv->curr_bss_params.attemp_bssid,
MLAN_MAC_ADDR_LENGTH)) {
PRINTM(MMSG, "wlan: skip link lost event\n");
PRINTM(MMSG,
"pattempted_bssid: " MACSTR
" curr_bssid:" MACSTR "\n",
MAC2STR(&pmpriv->curr_bss_params
.attemp_bssid),
MAC2STR(pmpriv->curr_bss_params
.bss_descriptor
.mac_address));
break;
}
reason_code = wlan_le16_to_cpu(
*(t_u16 *)(pmbuf->pbuf + pmbuf->data_offset +
sizeof(eventcause)));
PRINTM(MMSG, "wlan: EVENT: Link lost (reason 0x%x)\n",
reason_code);
pmpriv->disconnect_reason_code = reason_code;
}
reason_code = wlan_le16_to_cpu(*(t_u16 *)(pmbuf->pbuf +
pmbuf->data_offset +
sizeof(eventcause)));
PRINTM(MMSG, "wlan: EVENT: Link lost (reason 0x%x)\n",
reason_code);
pmpriv->disconnect_reason_code = reason_code;
pmadapter->dbg.num_event_link_lost++;
wlan_handle_disconnect_event(pmpriv);
break;
case EVENT_PS_SLEEP:
PRINTM(MINFO, "EVENT: SLEEP\n");
if (pmadapter->second_mac)
PRINTM(MEVENT, "__");
else
PRINTM(MEVENT, "_");
PRINTM_NETINTF(MEVENT, pmpriv);
PRINTM(MEVENT, "_");
/* Handle unexpected PS SLEEP event */
if (pmadapter->ps_state == PS_STATE_SLEEP_CFM)
@ -824,10 +786,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
case EVENT_PS_AWAKE:
PRINTM(MINFO, "EVENT: AWAKE\n");
if (pmadapter->second_mac)
PRINTM(MEVENT, "||");
else
PRINTM(MEVENT, "|");
PRINTM_NETINTF(MEVENT, pmpriv);
PRINTM(MEVENT, "|");
if (!pmadapter->pps_uapsd_mode && pmpriv->media_connected &&
(pmpriv->port_open || !pmpriv->port_ctrl_mode) &&
pmadapter->sleep_period.period) {
@ -841,19 +801,14 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
if (pmadapter->pps_uapsd_mode && pmadapter->gen_null_pkt) {
if (MTRUE ==
wlan_check_last_packet_indication(pmpriv)) {
if (!pmadapter->data_sent
#if defined(USB)
&& wlan_is_port_ready(pmadapter,
pmpriv->port_index)
#endif
) {
if (!pmadapter->data_sent) {
if (wlan_send_null_packet(
pmpriv,
MRVDRV_TxPD_POWER_MGMT_NULL_PACKET |
MRVDRV_TxPD_POWER_MGMT_LAST_PACKET) ==
MLAN_STATUS_SUCCESS) {
ret = MLAN_STATUS_SUCCESS;
goto done;
LEAVE();
return MLAN_STATUS_SUCCESS;
}
}
}
@ -930,12 +885,6 @@ 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);
#if defined(USB)
if (IS_USB(pmadapter->card_type))
wlan_resync_usb_port(pmadapter);
#endif
break;
case EVENT_STOP_TX:
@ -975,10 +924,6 @@ 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 =
@ -1000,10 +945,11 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
sizeof(pchan_band_info->bandcfg));
pchan_band_info->channel = pchan_info->channel;
if (pchan_band_info->bandcfg.chanWidth == CHAN_BW_80MHZ)
pchan_band_info
->center_chan = wlan_get_center_freq_idx(
priv, pchan_band_info->bandcfg.chanBand,
pchan_info->channel, CHANNEL_BW_80MHZ);
pchan_band_info->center_chan =
wlan_get_center_freq_idx(
priv, BAND_AAC,
pchan_info->channel,
CHANNEL_BW_80MHZ);
wlan_recv_event(pmpriv,
MLAN_EVENT_ID_FW_CHAN_SWITCH_COMPLETE,
pevent);
@ -1052,8 +998,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
sizeof(eventcause),
pevent->event_len, pevent->event_len);
/* Handle / pass event data */
ret = wlan_11h_handle_event_chanrpt_ready(
pmpriv, pevent, &radar_chan, &bandwidth);
ret = wlan_11h_handle_event_chanrpt_ready(pmpriv, pevent,
&radar_chan);
/* Also send this event as passthru */
pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU;
pevent->event_len = pmbuf->data_len;
@ -1167,17 +1113,18 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
break;
case EVENT_ADDBA:
PRINTM(MEVENT, "EVENT: ADDBA Request\n");
if (pmpriv->media_connected == MTRUE &&
!pmpriv->adapter->remain_on_channel)
wlan_11n_add_bastream(pmpriv, pmadapter->event_body);
if (pmpriv->media_connected == MTRUE)
ret = wlan_prepare_cmd(pmpriv,
HostCmd_CMD_11N_ADDBA_RSP,
HostCmd_ACT_GEN_SET, 0, MNULL,
pmadapter->event_body);
else
PRINTM(MERROR,
"Ignore ADDBA Request event in disconnected state\n");
break;
case EVENT_DELBA:
PRINTM(MEVENT, "EVENT: DELBA Request\n");
if (pmpriv->media_connected == MTRUE &&
!pmpriv->adapter->remain_on_channel)
if (pmpriv->media_connected == MTRUE)
wlan_11n_delete_bastream(pmpriv, pmadapter->event_body);
else
PRINTM(MERROR,
@ -1185,8 +1132,7 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
break;
case EVENT_BA_STREAM_TIMEOUT:
PRINTM(MEVENT, "EVENT: BA Stream timeout\n");
if (pmpriv->media_connected == MTRUE &&
!pmpriv->adapter->remain_on_channel)
if (pmpriv->media_connected == MTRUE)
wlan_11n_ba_stream_timeout(
pmpriv, (HostCmd_DS_11N_BATIMEOUT *)
pmadapter->event_body);
@ -1273,7 +1219,6 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
PRINTM_NETINTF(MEVENT, pmpriv);
PRINTM(MEVENT, "EVENT: REMAIN_ON_CHANNEL_EXPIRED reason=%d\n",
*(t_u16 *)pmadapter->event_body);
pmpriv->adapter->remain_on_channel = MFALSE;
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_FLUSH_RX_WORK, MNULL);
wlan_recv_event(pmpriv, MLAN_EVENT_ID_FW_REMAIN_ON_CHAN_EXPIRED,
MNULL);
@ -1309,10 +1254,6 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
eventcause, pevt_dat[0] + 1, pevt_dat[1] + 1,
pevt_dat[2], pevt_dat[3]);
} break;
case EVENT_MULTI_CHAN_INFO:
PRINTM(MEVENT, "EVENT: MULTI_CHAN_INFO\n");
wlan_handle_event_multi_chan_info(pmpriv, pmbuf);
break;
case EVENT_FW_DUMP_INFO:
PRINTM(MINFO, "EVENT: Dump FW info\n");
@ -1412,37 +1353,14 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
pevent->bss_index = pmpriv->bss_index;
pevent->event_id = MLAN_EVENT_ID_FW_ROAM_OFFLOAD_RESULT;
/** Drop event id length and 2 bytes reverved length*/
if ((pmbuf->data_len - sizeof(eventcause)) > 2) {
pevent->event_len =
pmbuf->data_len - sizeof(eventcause) - 2;
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmadapter->event_body + 2, pevent->event_len,
pevent->event_len);
wlan_recv_event(pmpriv, pevent->event_id, pevent);
} else {
PRINTM(MERROR,
"EVENT: ERR:: ROAM OFFLOAD IN FW has invalid length\n");
}
pevent->event_len = pmbuf->data_len - sizeof(eventcause) - 2;
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmadapter->event_body + 2, pevent->event_len,
pevent->event_len);
wlan_recv_event(pmpriv, pevent->event_id, pevent);
break;
case EVENT_CLOUD_KEEP_ALIVE_RETRY_FAIL:
break;
case EVENT_WLS_FTM_COMPLETE:
PRINTM(MEVENT, "EVENT: FTM_GENERIC_EVENT\n");
pevent->bss_index = pmpriv->bss_index;
event_ftm =
(Event_WLS_FTM_t *)(pmbuf->pbuf + pmbuf->data_offset);
if (event_ftm->sub_event_id == WLS_SUB_EVENT_RTT_RESULTS)
wlan_fill_hal_rtt_results(pmpriv, event_ftm,
pmbuf->data_len, pevent);
else {
pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU;
pevent->event_len = pmbuf->data_len;
memcpy_ext(pmadapter, (t_u8 *)pevent->event_buf,
pmbuf->pbuf + pmbuf->data_offset,
pevent->event_len, pevent->event_len);
}
wlan_recv_event(pmpriv, pevent->event_id, pevent);
break;
case EVENT_VDLL_IND:
wlan_process_vdll_event(pmpriv, pmbuf);
break;
@ -1460,23 +1378,6 @@ 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 EVENT_IMD3_CAL_START:
PRINTM(MEVENT, "EVENT: EVENT_IMD3_CAL_START\n");
break;
case EVENT_IMD3_CAL_END:
PRINTM(MEVENT, "EVENT: EVENT_IMD3_CAL_END\n");
break;
case EVENT_CHAN_LOAD: {
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

@ -3,20 +3,29 @@
* @brief This file contains the functions for station ioctl.
*
*
* Copyright 2008-2023 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -35,6 +44,9 @@ Change log:
#include "mlan_11ac.h"
#include "mlan_11ax.h"
#include "mlan_11h.h"
#ifdef DRV_EMBEDDED_SUPPLICANT
#include "authenticator_api.h"
#endif
/********************************************************
Local Variables
@ -292,7 +304,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 = pbss_desc->bss_band;
info->param.bss_info.bss_band = (t_u8)pbss_desc->bss_band;
/* Region code */
info->param.bss_info.region_code = pmadapter->region_code;
@ -425,8 +437,6 @@ static mlan_status wlan_get_info_ioctl(pmlan_adapter pmadapter,
pmadapter->getlog_enable;
pget_info->param.fw_info.hw_dev_mcs_support =
pmadapter->hw_dev_mcs_support;
pget_info->param.fw_info.hw_mpdu_density =
pmadapter->hw_mpdu_density;
pget_info->param.fw_info.hw_dot_11n_dev_cap =
pmadapter->hw_dot_11n_dev_cap;
pget_info->param.fw_info.usr_dev_mcs_support =
@ -445,8 +455,6 @@ 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;
@ -466,8 +474,6 @@ static mlan_status wlan_get_info_ioctl(pmlan_adapter pmadapter,
0x00;
pget_info->param.fw_info.fw_beacon_prot =
IS_FW_SUPPORT_BEACON_PROT(pmadapter) ? 0x01 : 0x00;
pget_info->param.fw_info.rtt_support =
IS_FW_SUPPORT_RTT(pmadapter) ? 0x01 : 0x00;
break;
case MLAN_OID_GET_BSS_INFO:
status = wlan_get_info_bss_info(pmadapter, pioctl_req);
@ -1017,6 +1023,12 @@ static mlan_status wlan_bss_ioctl_start(pmlan_adapter pmadapter,
ENTER();
if (pmadapter->enable_net_mon == CHANNEL_SPEC_SNIFFER_MODE) {
PRINTM(MINFO,
"Association is blocked in Channel Specified Network Monitor mode...\n");
LEAVE();
return MLAN_STATUS_FAILURE;
}
/* Before ASSOC REQ, If "port ctrl" mode is enabled,
* move the port to CLOSED state */
if (pmpriv->port_ctrl_mode == MTRUE) {
@ -1357,6 +1369,7 @@ static mlan_status wlan_query_passphrase(mlan_private *priv,
LEAVE();
return ret;
}
memset(pmadapter, sec, 0, sizeof(mlan_ds_sec_cfg));
sec_pp = (mlan_ds_passphrase *)&sec->param.passphrase;
sec_pp->psk_type = MLAN_PSK_QUERY;
if (ssid_bssid->ssid.ssid_len == 0) {
@ -1400,6 +1413,10 @@ static mlan_status wlan_bss_ioctl_find_bss(pmlan_adapter pmadapter,
{
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_status ret = MLAN_STATUS_SUCCESS;
#ifdef DRV_EMBEDDED_SUPPLICANT
mlan_ds_bss *bss = MNULL;
mlan_ssid_bssid *ssid_bssid = MNULL;
#endif
ENTER();
@ -1411,6 +1428,14 @@ static mlan_status wlan_bss_ioctl_find_bss(pmlan_adapter pmadapter,
return MLAN_STATUS_PENDING;
}
}
#ifdef DRV_EMBEDDED_SUPPLICANT
if (!IS_FW_SUPPORT_SUPPLICANT(pmpriv->adapter)) {
bss = (mlan_ds_bss *)pioctl_req->pbuf;
ssid_bssid = &bss->param.ssid_bssid;
supplicantQueryPassphraseAndEnable(pmpriv->psapriv,
(t_u8 *)ssid_bssid);
}
#endif
ret = wlan_find_bss(pmpriv, pioctl_req);
@ -1760,6 +1785,7 @@ static mlan_status wlan_power_ioctl_set_power(pmlan_adapter pmadapter,
ret = MLAN_STATUS_FAILURE;
goto exit;
}
memset(pmadapter, buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
txp_cfg = (HostCmd_DS_TXPWR_CFG *)buf;
txp_cfg->action = HostCmd_ACT_GEN_SET;
if (!power->param.power_cfg.is_power_auto) {
@ -1854,6 +1880,7 @@ static mlan_status wlan_power_ioctl_set_power_ext(pmlan_adapter pmadapter,
ret = MLAN_STATUS_FAILURE;
goto exit;
}
memset(pmadapter, buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
txp_cfg = (HostCmd_DS_TXPWR_CFG *)buf;
txp_cfg->action = HostCmd_ACT_GEN_SET;
pwr_grp = &power->param.power_ext.power_group[0];
@ -2925,9 +2952,7 @@ static mlan_status wlan_sec_ioctl_set_wep_key(pmlan_adapter pmadapter,
goto exit;
if (!sec->param.encrypt_key.key_len) {
sec->param.encrypt_key.key_index = pwep_key->key_index;
sec->param.encrypt_key.key_len =
MIN(pwep_key->key_length,
sizeof(pwep_key->key_material));
sec->param.encrypt_key.key_len = pwep_key->key_length;
memcpy_ext(pmadapter,
sec->param.encrypt_key.key_material,
pwep_key->key_material,
@ -3354,8 +3379,8 @@ static mlan_status wlan_sec_cfg_ioctl(pmlan_adapter pmadapter,
*
* @return MLAN_STATUS_SUCCESS --success, otherwise fail
*/
static mlan_status wlan_set_gen_ie_helper(mlan_private *priv, t_u8 *ie_data_ptr,
t_u16 ie_len)
static int 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;
@ -3938,9 +3963,9 @@ static mlan_status wlan_misc_ioctl_gen_ie(pmlan_adapter pmadapter,
pmpriv->wpa_ie, misc->param.gen_ie.len,
MAX_IE_SIZE);
} else {
ret = wlan_set_gen_ie_helper(
pmpriv, misc->param.gen_ie.ie_data,
(t_u16)misc->param.gen_ie.len);
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:
@ -3976,6 +4001,89 @@ static mlan_status wlan_misc_ioctl_gen_ie(pmlan_adapter pmadapter,
return ret;
}
/**
* @brief Perform warm reset
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pioctl_req A pointer to ioctl request buffer
*
* @return MLAN_STATUS_PENDING --success, MLAN_STATUS_FAILURE
*/
mlan_status wlan_misc_ioctl_warm_reset(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
pmlan_private pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_status ret = MLAN_STATUS_SUCCESS;
pmlan_callbacks pcb = &pmadapter->callbacks;
pmlan_buffer pmbuf;
t_s32 i = 0;
mlan_ds_misc_cfg *misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
ENTER();
mlan_block_rx_process(pmadapter, MTRUE);
/* Cancel all pending commands and complete ioctls */
if (misc->param.fw_reload)
wlan_cancel_all_pending_cmd(pmadapter, MTRUE);
/** Init all the head nodes and free all the locks here */
for (i = 0; i < pmadapter->priv_num; i++)
wlan_free_priv(pmadapter->priv[i]);
while ((pmbuf = (pmlan_buffer)util_dequeue_list(
pmadapter->pmoal_handle, &pmadapter->rx_data_queue,
pcb->moal_spin_lock, pcb->moal_spin_unlock))) {
pmadapter->ops.data_complete(pmadapter, pmbuf,
MLAN_STATUS_FAILURE);
}
pmadapter->rx_pkts_queued = 0;
/* Initialize adapter structure */
wlan_init_adapter(pmadapter);
pmadapter->hw_status = WlanHardwareStatusInitializing;
/* Initialize private structures */
for (i = 0; i < pmadapter->priv_num; i++) {
if (pmadapter->priv[i])
wlan_init_priv(pmadapter->priv[i]);
}
mlan_block_rx_process(pmadapter, MFALSE);
if (misc->param.fw_reload != MTRUE) {
/* Restart the firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_FUNC_SHUTDOWN,
HostCmd_ACT_GEN_SET, 0, MNULL, MNULL);
if (ret)
goto done;
}
/* Issue firmware initialize commands for first BSS,
* for other interfaces it will be called after getting
* the last init command response of previous interface
*/
pmpriv = wlan_get_priv(pmadapter, MLAN_BSS_ROLE_ANY);
if (!pmpriv) {
ret = MLAN_STATUS_FAILURE;
LEAVE();
return ret;
}
ret = wlan_adapter_get_hw_spec(pmpriv->adapter);
if (ret == MLAN_STATUS_FAILURE) {
LEAVE();
return ret;
}
ret = pmpriv->ops.init_cmd(pmpriv, MTRUE);
if (ret == MLAN_STATUS_FAILURE) {
LEAVE();
return ret;
}
if (ret == MLAN_STATUS_PENDING)
pmadapter->pwarm_reset_ioctl_req = pioctl_req;
done:
LEAVE();
return ret;
}
#ifdef SDIO
/**
* @brief Reconfigure SDIO multiport aggregation parameters
@ -4289,42 +4397,6 @@ 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
*
@ -4661,6 +4733,75 @@ done:
return ret;
}
/**
* @brief This function sets up country code and downloads CMD to FW
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pioctl_req Pointer to the IOCTL request buffer
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status wlan_misc_ioctl_country_code(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_ds_misc_country_code *country_code = MNULL;
mlan_ds_misc_cfg *cfg_misc = MNULL;
t_u8 cfp_bg = 0, cfp_a = 0;
ENTER();
cfg_misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
country_code = &cfg_misc->param.country_code;
if (pioctl_req->action == MLAN_ACT_SET) {
if (pmadapter->otp_region && pmadapter->otp_region->force_reg) {
PRINTM(MERROR,
"ForceRegionRule is set in the on-chip OTP"
"memory\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
/* Update region code and table based on country code */
if (wlan_misc_country_2_cfp_table_code(
pmadapter, country_code->country_code, &cfp_bg,
&cfp_a)) {
PRINTM(MERROR, "Country code not found!\n");
pioctl_req->status_code = MLAN_ERROR_INVALID_PARAMETER;
ret = MLAN_STATUS_FAILURE;
goto done;
}
pmadapter->cfp_code_bg = cfp_bg;
pmadapter->cfp_code_a = cfp_a;
if (cfp_a)
pmadapter->region_code = cfp_a;
else if (cfp_bg)
pmadapter->region_code = cfp_bg;
else
pmadapter->region_code = 0;
if (wlan_set_regiontable(pmpriv, pmadapter->region_code,
pmadapter->config_bands |
pmadapter->adhoc_start_band)) {
pioctl_req->status_code = MLAN_ERROR_INVALID_PARAMETER;
ret = MLAN_STATUS_FAILURE;
goto done;
}
memcpy_ext(pmadapter, pmadapter->country_code,
country_code->country_code, COUNTRY_CODE_LEN,
COUNTRY_CODE_LEN);
} else {
/* GET operation */
memcpy_ext(pmadapter, country_code->country_code,
pmadapter->country_code, COUNTRY_CODE_LEN,
COUNTRY_CODE_LEN);
}
done:
LEAVE();
return ret;
}
/**
* @brief Configure MFPC and MFPR for management frame protection
*
@ -4993,48 +5134,6 @@ static mlan_status wlan_misc_cloud_keep_alive(pmlan_adapter pmadapter,
return ret;
}
/**
* @brief cloud keep alive rx
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pioctl_req Pointer to the IOCTL request buffer
*
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
*/
static mlan_status wlan_misc_cloud_keep_alive_rx(pmlan_adapter pmadapter,
mlan_ioctl_req *pioctl_req)
{
pmlan_private pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_ds_misc_cfg *misc = MNULL;
t_u16 cmd_action = 0;
mlan_status ret = MLAN_STATUS_SUCCESS;
ENTER();
misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
if (pioctl_req->action == MLAN_ACT_SET)
cmd_action = HostCmd_ACT_GEN_SET;
else if (pioctl_req->action == MLAN_ACT_GET) {
cmd_action = HostCmd_ACT_GEN_GET;
} else if (pioctl_req->action == MLAN_ACT_RESET) {
cmd_action = HostCmd_ACT_GEN_RESET;
} else {
cmd_action = HostCmd_ACT_GEN_REMOVE;
}
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_AUTO_TX, cmd_action,
OID_CLOUD_KEEP_ALIVE_ACK, (t_void *)pioctl_req,
&misc->param.keep_alive_rx);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
LEAVE();
return ret;
}
/**
* @brief Miscellaneous configuration handler
*
@ -5164,16 +5263,9 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
case MLAN_OID_MISC_HOTSPOT_CFG:
status = wlan_misc_hotspot_cfg(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_MULTI_AP_CFG:
status = wlan_misc_multi_ap_cfg(pmadapter, pioctl_req);
break;
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);
@ -5185,23 +5277,20 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
case MLAN_OID_MISC_TXCONTROL:
status = wlan_misc_ioctl_txcontrol(pmadapter, pioctl_req);
break;
#ifdef STA_SUPPORT
case MLAN_OID_MISC_EXT_CAP_CFG:
status = wlan_misc_ext_capa_cfg(pmadapter, pioctl_req);
break;
#endif
case MLAN_OID_MISC_PMFCFG:
status = wlan_misc_pmfcfg(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_MULTI_CHAN_CFG:
status = wlan_misc_ioctl_multi_chan_config(pmadapter,
pioctl_req);
break;
case MLAN_OID_MISC_MULTI_CHAN_POLICY:
status = wlan_misc_ioctl_multi_chan_policy(pmadapter,
pioctl_req);
break;
case MLAN_OID_MISC_DRCS_CFG:
status = wlan_misc_ioctl_drcs_config(pmadapter, pioctl_req);
#ifdef RX_PACKET_COALESCE
case MLAN_OID_MISC_RX_PACKET_COALESCE:
status = wlan_misc_ioctl_rx_pkt_coalesce_config(pmadapter,
pioctl_req);
break;
#endif
case MLAN_OID_MISC_LOW_PWR_MODE:
status = wlan_misc_ioctl_low_pwr_mode(pmadapter, pioctl_req);
break;
@ -5247,16 +5336,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;
case MLAN_OID_MISC_CROSS_CHIP_SYNCH:
status =
wlan_misc_ioctl_cross_chip_synch(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_ROAM_OFFLOAD:
status = wlan_misc_roam_offload(pmadapter, pioctl_req);
break;
@ -5269,9 +5351,6 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
case MLAN_OID_MISC_CLOUD_KEEP_ALIVE:
status = wlan_misc_cloud_keep_alive(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_CLOUD_KEEP_ALIVE_RX:
status = wlan_misc_cloud_keep_alive_rx(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_DYN_BW:
status = wlan_misc_ioctl_dyn_bw(pmadapter, pioctl_req);
break;
@ -5287,15 +5366,6 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
case MLAN_OID_MISC_DMCS_CONFIG:
status = wlan_misc_dmcs_config(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_CONFIG_RTT:
status = wlan_config_rtt(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_CANCEL_RTT:
status = wlan_cancel_rtt(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_RTT_RESPONDER_CFG:
status = wlan_rtt_responder_cfg(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_GET_TX_RX_HISTOGRAM:
status = wlan_get_tx_rx_histogram(pmadapter, pioctl_req);
break;
@ -5328,18 +5398,9 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
case MLAN_OID_MISC_RX_ABORT_CFG:
status = wlan_misc_ioctl_rxabortcfg(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_OFDM_DESENSE_CFG:
status = wlan_misc_ioctl_ofdmdesense_cfg(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_RX_ABORT_CFG_EXT:
status = wlan_misc_ioctl_rxabortcfg_ext(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_NAV_MITIGATION:
status = wlan_misc_ioctl_nav_mitigation(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_LED_CONFIG:
status = wlan_misc_ioctl_led(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_TX_AMPDU_PROT_MODE:
status = wlan_misc_ioctl_tx_ampdu_prot_mode(pmadapter,
pioctl_req);
@ -5362,7 +5423,6 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
break;
case MLAN_OID_MISC_RF_TEST_GENERIC:
case MLAN_OID_MISC_RF_TEST_TX_CONT:
case MLAN_OID_MISC_RF_TEST_CONFIG_TRIGGER_FRAME:
case MLAN_OID_MISC_RF_TEST_TX_FRAME:
case MLAN_OID_MISC_RF_TEST_HE_POWER:
status = wlan_misc_ioctl_rf_test_cfg(pmadapter, pioctl_req);
@ -5373,20 +5433,12 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
case MLAN_OID_MISC_RANGE_EXT:
status = wlan_misc_ioctl_range_ext(pmadapter, pioctl_req);
break;
case MLAN_OID_11AX_TWT_CFG:
status = wlan_misc_ioctl_twt_report(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_TP_STATE:
status = wlan_misc_ioctl_tp_state(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_IPS_CFG:
status = wlan_misc_ioctl_ips_cfg(pmadapter, pioctl_req);
break;
case MLAN_OID_MISC_REORDER_FLUSH_TIME:
status = wlan_misc_ioctl_reorder_flush_time(pmadapter,
pioctl_req);
break;
default:
if (pioctl_req)
pioctl_req->status_code = MLAN_ERROR_IOCTL_INVALID;
@ -5471,7 +5523,8 @@ static mlan_status wlan_set_get_scan_cfg(pmlan_adapter pmadapter,
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING --success,
* otherwise fail
*/
mlan_status wlan_scan_ioctl(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
static mlan_status wlan_scan_ioctl(pmlan_adapter pmadapter,
pmlan_ioctl_req pioctl_req)
{
pmlan_private pmpriv = pmadapter->priv[pioctl_req->bss_index];
mlan_status status = MLAN_STATUS_SUCCESS;
@ -5490,6 +5543,13 @@ mlan_status wlan_scan_ioctl(pmlan_adapter pmadapter, pmlan_ioctl_req pioctl_req)
return status;
}
if (pmadapter->enable_net_mon == CHANNEL_SPEC_SNIFFER_MODE) {
PRINTM(MINFO,
"Scan is blocked in Channel Specified Network Monitor mode...\n");
LEAVE();
return MLAN_STATUS_FAILURE;
}
if (pmadapter->scan_block && pioctl_req->action == MLAN_ACT_SET) {
PRINTM(MERROR, "Scan is blocked during association...\n");
LEAVE();
@ -5588,20 +5648,10 @@ start_config:
pioctl_req->data_read_written =
sizeof(mlan_scan_resp) +
MLAN_SUB_COMMAND_SIZE;
if (pmadapter->scan_processing) {
pscan->param.scan_resp.pchan_stats =
(t_u8 *)pmadapter
->pold_chan_stats;
pscan->param.scan_resp
.num_in_chan_stats =
pmadapter->old_idx_chan_stats;
} else {
pscan->param.scan_resp.pchan_stats =
(t_u8 *)pmadapter->pchan_stats;
pscan->param.scan_resp
.num_in_chan_stats =
pmadapter->idx_chan_stats;
}
pscan->param.scan_resp.pchan_stats =
(t_u8 *)pmadapter->pchan_stats;
pscan->param.scan_resp.num_in_chan_stats =
pmadapter->num_in_chan_stats;
}
}
}
@ -5706,18 +5756,6 @@ mlan_status wlan_find_bss(mlan_private *pmpriv, pmlan_ioctl_req pioctl_req)
memcpy_ext(pmadapter, (t_u8 *)&bss->param.ssid_bssid.bssid,
(t_u8 *)&pbss_desc->mac_address,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
if (pbss_desc->owe_transition_mode) {
bss->param.ssid_bssid.owe_transition_mode =
pbss_desc->owe_transition_mode;
memcpy_ext(pmadapter, &bss->param.ssid_bssid.trans_ssid,
&pbss_desc->trans_ssid,
sizeof(mlan_802_11_ssid),
sizeof(mlan_802_11_ssid));
memcpy_ext(pmadapter,
(t_u8 *)&bss->param.ssid_bssid.trans_bssid,
(t_u8 *)&pbss_desc->trans_mac_address,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
}
bss->param.ssid_bssid.rssi = pbss_desc->rssi;
bss->param.ssid_bssid.channel = (t_u16)pbss_desc->channel;

View file

@ -6,18 +6,27 @@
*
* 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -33,12 +42,25 @@ 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
/********************************************************
Local Variables
********************************************************/
/** Ethernet II header */
typedef struct {
/** Ethernet II header destination address */
t_u8 dest_addr[MLAN_MAC_ADDR_LENGTH];
/** Ethernet II header source address */
t_u8 src_addr[MLAN_MAC_ADDR_LENGTH];
/** Ethernet II header length */
t_u16 ethertype;
} EthII_Hdr_t;
/** IPv4 ARP request header */
typedef MLAN_PACK_START struct {
/** Hardware type */
@ -292,14 +314,12 @@ 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
@ -405,8 +425,6 @@ void wlan_rxpdinfo_to_radiotapinfo(pmlan_private priv, RxPD *prx_pd,
t_u8 gi = 0;
t_u8 ldpc = 0;
t_u8 ext_rate_info = 0;
t_u8 nss = 0;
t_u8 dcm = 0;
memset(priv->adapter, &rt_info_tmp, 0x00, sizeof(rt_info_tmp));
rt_info_tmp.snr = prx_pd->snr;
@ -417,25 +435,10 @@ void wlan_rxpdinfo_to_radiotapinfo(pmlan_private priv, RxPD *prx_pd,
rt_info_tmp.antenna = prx_pd->antenna;
rx_rate_info = prx_pd->rate_info;
if ((rx_rate_info & 0x3) == MLAN_RATE_FORMAT_HE) {
t_u8 gi_he = 0;
/* HE rate */
format = MLAN_RATE_FORMAT_HE;
mcs_index = MIN(prx_pd->rx_rate & 0xF, 0xb);
nss = ((prx_pd->rx_rate & 0xF0) >> 4);
nss = MIN(nss + 1, 2);
/* 20M: bw=0, 40M: bw=1, 80M: bw=2, 160M: bw=3 */
bw = (rx_rate_info & 0xC) >> 2;
gi = (rx_rate_info & 0x10) >> 4;
gi_he = (rx_rate_info & 0x80) >> 7;
gi = gi | gi_he;
dcm = (prx_pd->rx_info & RXPD_DCM_MASK) >> 16;
} else if ((rx_rate_info & 0x3) == MLAN_RATE_FORMAT_VHT) {
if ((rx_rate_info & 0x3) == MLAN_RATE_FORMAT_VHT) {
/* VHT rate */
format = MLAN_RATE_FORMAT_VHT;
mcs_index = MIN(prx_pd->rx_rate & 0xF, 9);
nss = ((prx_pd->rx_rate & 0xF0) >> 4);
nss = MIN(nss + 1, 2);
/* 20M: bw=0, 40M: bw=1, 80M: bw=2, 160M: bw=3 */
bw = (rx_rate_info & 0xC) >> 2;
/* LGI: gi =0, SGI: gi = 1 */
@ -458,14 +461,8 @@ void wlan_rxpdinfo_to_radiotapinfo(pmlan_private priv, RxPD *prx_pd,
ldpc = rx_rate_info & 0x40;
rt_info_tmp.rate_info.mcs_index = mcs_index;
rt_info_tmp.rate_info.nss_index = nss;
rt_info_tmp.rate_info.dcm = dcm;
if (format == MLAN_RATE_FORMAT_HE) {
rt_info_tmp.rate_info.rate_info =
(ldpc << 5) | (format << 3) | (bw << 1) | (gi << 6);
} else
rt_info_tmp.rate_info.rate_info =
(ldpc << 5) | (format << 3) | (bw << 1) | gi;
rt_info_tmp.rate_info.rate_info =
(ldpc << 5) | (format << 3) | (bw << 1) | gi;
rt_info_tmp.rate_info.bitrate =
wlan_index_to_data_rate(priv->adapter, prx_pd->rx_rate,
prx_pd->rate_info, ext_rate_info);
@ -507,6 +504,9 @@ mlan_status wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
t_u8 appletalk_aarp_type[2] = {0x80, 0xf3};
t_u8 ipx_snap_type[2] = {0x81, 0x37};
t_u8 tdls_action_type[2] = {0x89, 0x0d};
#ifdef DRV_EMBEDDED_SUPPLICANT
t_u8 eapol_type[2] = {0x88, 0x8e};
#endif
t_u8 ext_rate_info = 0;
ENTER();
@ -620,11 +620,26 @@ mlan_status wlan_process_rx_packet(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
pmbuf->out_ts_sec, pmbuf->out_ts_usec, prx_pd->seq_num,
prx_pd->priority);
if (pmadapter->enable_net_mon) {
if (prx_pd->rx_pkt_type == PKT_TYPE_802DOT11) {
pmbuf->flags |= MLAN_BUF_FLAG_NET_MONITOR;
goto mon_process;
pmbuf->flags |= MLAN_BUF_FLAG_NET_MONITOR;
goto mon_process;
}
#ifdef DRV_EMBEDDED_SUPPLICANT
if (supplicantIsEnabled(priv->psapriv) &&
(!memcmp(pmadapter, &prx_pkt->eth803_hdr.h803_len, eapol_type,
sizeof(eapol_type)))) {
// BML_SET_OFFSET(bufDesc, offset);
if (ProcessEAPoLPkt(priv->psapriv, pmbuf)) {
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
ret = MLAN_STATUS_SUCCESS;
PRINTM(MMSG,
"host supplicant eapol pkt process done.\n");
LEAVE();
return ret;
}
}
#endif
mon_process:
if (pmbuf->flags & MLAN_BUF_FLAG_NET_MONITOR) {
@ -683,15 +698,6 @@ mlan_status wlan_ops_sta_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
mlan_status ret = MLAN_STATUS_SUCCESS;
RxPD *prx_pd;
RxPacketHdr_t *prx_pkt;
RxPD *prx_pd2;
EthII_Hdr_t *peth_hdr2;
wlan_802_11_header *pwlan_hdr;
IEEEtypes_FrameCtl_t *frmctl;
pmlan_buffer pmbuf2 = MNULL;
mlan_802_11_mac_addr dest_addr = {0x00};
mlan_802_11_mac_addr src_addr = {0x00};
t_u16 hdr_len;
t_u8 snap_eth_hdr[5] = {0xaa, 0xaa, 0x03, 0x00, 0x00};
pmlan_private priv = pmadapter->priv[pmbuf->bss_index];
t_u8 ta[MLAN_MAC_ADDR_LENGTH];
t_u16 rx_pkt_type = 0;
@ -719,13 +725,6 @@ mlan_status wlan_ops_sta_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
rxpd_rate_info_orig, prx_pd->rate_info);
}
rx_pkt_type = prx_pd->rx_pkt_type;
if (prx_pd->flags & RXPD_FLAG_PKT_EASYMESH) {
PRINTM_NETINTF(MDAT_D, priv);
PRINTM(MDAT_D, "Easymesh flags : 0x%x\n", prx_pd->flags);
ret = wlan_check_easymesh_pkt(priv, pmbuf, prx_pd);
if (ret != MLAN_STATUS_SUCCESS)
goto done;
}
prx_pkt = (RxPacketHdr_t *)((t_u8 *)prx_pd + prx_pd->rx_pkt_offset);
if ((prx_pd->rx_pkt_offset + prx_pd->rx_pkt_length) !=
@ -777,112 +776,6 @@ mlan_status wlan_ops_sta_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
}
}
if (pmadapter->enable_net_mon &&
(prx_pd->flags & RXPD_FLAG_UCAST_PKT)) {
pwlan_hdr = (wlan_802_11_header *)((t_u8 *)prx_pd +
prx_pd->rx_pkt_offset);
frmctl = (IEEEtypes_FrameCtl_t *)pwlan_hdr;
if (frmctl->type == 0x02) {
/* This is a valid unicast destined data packet, with
* 802.11 and rtap headers attached. Duplicate this
* packet and process this copy as a sniffed packet,
* meant for monitor iface
*/
pmbuf2 = wlan_alloc_mlan_buffer(pmadapter,
pmbuf->data_len,
MLAN_RX_HEADER_LEN,
MOAL_ALLOC_MLAN_BUFFER);
if (!pmbuf2) {
PRINTM(MERROR,
"Unable to allocate mlan_buffer for Rx");
PRINTM(MERROR, "sniffed packet\n");
} else {
pmbuf2->bss_index = pmbuf->bss_index;
pmbuf2->buf_type = pmbuf->buf_type;
pmbuf2->priority = pmbuf->priority;
pmbuf2->in_ts_sec = pmbuf->in_ts_sec;
pmbuf2->in_ts_usec = pmbuf->in_ts_usec;
pmbuf2->data_len = pmbuf->data_len;
memcpy(pmadapter,
pmbuf2->pbuf + pmbuf2->data_offset,
pmbuf->pbuf + pmbuf->data_offset,
pmbuf->data_len);
prx_pd2 = (RxPD *)(pmbuf2->pbuf +
pmbuf2->data_offset);
/* set pkt type of duplicated pkt to 802.11 */
prx_pd2->rx_pkt_type = PKT_TYPE_802DOT11;
wlan_process_rx_packet(pmadapter, pmbuf2);
}
/* Now, process this pkt as a normal data packet.
* rx_pkt_offset points to the 802.11 hdr. Construct
* 802.3 header from 802.11 hdr fields and attach it
* just before the payload.
*/
memcpy(pmadapter, (t_u8 *)&dest_addr, pwlan_hdr->addr1,
sizeof(pwlan_hdr->addr1));
memcpy(pmadapter, (t_u8 *)&src_addr, pwlan_hdr->addr2,
sizeof(pwlan_hdr->addr2));
hdr_len = sizeof(wlan_802_11_header);
/* subtract mac addr field size for 3 address mac80211
* header */
if (!(frmctl->from_ds && frmctl->to_ds))
hdr_len -= sizeof(mlan_802_11_mac_addr);
/* add 2 bytes of qos ctrl flags */
if (frmctl->sub_type & QOS_DATA)
hdr_len += 2;
if (prx_pd->rx_pkt_type == PKT_TYPE_AMSDU) {
/* no need to generate 802.3 hdr, update pkt
* offset */
prx_pd->rx_pkt_offset += hdr_len;
prx_pd->rx_pkt_length -= hdr_len;
} else {
/* skip 6-byte snap and 2-byte type */
if (memcmp(pmadapter,
(t_u8 *)pwlan_hdr + hdr_len,
snap_eth_hdr,
sizeof(snap_eth_hdr)) == 0)
hdr_len += 8;
peth_hdr2 =
(EthII_Hdr_t *)((t_u8 *)prx_pd +
prx_pd->rx_pkt_offset +
hdr_len -
sizeof(EthII_Hdr_t));
memcpy(pmadapter, peth_hdr2->dest_addr,
(t_u8 *)&dest_addr,
sizeof(peth_hdr2->dest_addr));
memcpy(pmadapter, peth_hdr2->src_addr,
(t_u8 *)&src_addr,
sizeof(peth_hdr2->src_addr));
/* Update the rx_pkt_offset to point the 802.3
* hdr */
prx_pd->rx_pkt_offset +=
(hdr_len - sizeof(EthII_Hdr_t));
prx_pd->rx_pkt_length -=
(hdr_len - sizeof(EthII_Hdr_t));
}
/* update the prx_pkt pointer */
prx_pkt = (RxPacketHdr_t *)((t_u8 *)prx_pd +
prx_pd->rx_pkt_offset);
} else {
pmbuf->status_code = MLAN_ERROR_PKT_SIZE_INVALID;
ret = MLAN_STATUS_FAILURE;
PRINTM(MERROR,
"Drop invalid unicast sniffer pkt, subType=0x%x, flag=0x%x, pkt_type=%d\n",
frmctl->sub_type, prx_pd->flags,
prx_pd->rx_pkt_type);
wlan_free_mlan_buffer(pmadapter, pmbuf);
goto done;
}
}
/*
* If the packet is not an unicast packet then send the packet
* directly to os. Don't pass thru rx reordering
@ -919,8 +812,7 @@ 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 &&
!sta_ptr->is_11ax_enabled)) {
if (!sta_ptr || !sta_ptr->is_11n_enabled) {
wlan_process_rx_packet(pmadapter, pmbuf);
goto done;
}
@ -937,14 +829,9 @@ mlan_status wlan_ops_sta_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
}
if ((priv->port_ctrl_mode == MTRUE && priv->port_open == MFALSE) &&
(rx_pkt_type != PKT_TYPE_BAR)) {
if (MLAN_STATUS_SUCCESS !=
mlan_11n_rxreorder_pkt(priv, prx_pd->seq_num,
prx_pd->priority, ta,
(t_u8)prx_pd->rx_pkt_type,
(t_void *)RX_PKT_DROPPED_IN_FW))
PRINTM(MINFO, "RX pkt reordering failure seq_num:%d\n",
prx_pd->seq_num);
mlan_11n_rxreorder_pkt(priv, prx_pd->seq_num, prx_pd->priority,
ta, (t_u8)prx_pd->rx_pkt_type,
(t_void *)RX_PKT_DROPPED_IN_FW);
if (rx_pkt_type == PKT_TYPE_AMSDU) {
pmbuf->data_len = prx_pd->rx_pkt_length;
pmbuf->data_offset += prx_pd->rx_pkt_offset;

View file

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -127,11 +136,6 @@ t_void *wlan_ops_sta_process_txpd(t_void *priv, pmlan_buffer pmbuf)
}
if (pmbuf->flags & MLAN_BUF_FLAG_TDLS)
plocal_tx_pd->flags |= MRVDRV_TxPD_FLAGS_TDLS_PACKET;
if (pmbuf->flags & MLAN_BUF_FLAG_EASYMESH) {
plocal_tx_pd->flags |= MRVDRV_TxPD_FLAGS_EASYMESH;
memcpy_ext(pmpriv->adapter, plocal_tx_pd->ra_mac, pmbuf->mac,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
}
/* Offset of actual data */
plocal_tx_pd->tx_pkt_offset = (t_u16)(
(t_ptr)pmbuf->pbuf + pmbuf->data_offset - (t_ptr)plocal_tx_pd);
@ -261,12 +265,6 @@ mlan_status wlan_send_null_packet(pmlan_private priv, t_u8 flags)
ret = MLAN_STATUS_FAILURE;
goto done;
}
#if defined(USB)
if (!wlan_is_port_ready(pmadapter, priv->port_index)) {
ret = MLAN_STATUS_FAILURE;
goto done;
}
#endif
pmbuf = wlan_alloc_mlan_buffer(pmadapter, data_len, 0,
MOAL_MALLOC_BUFFER);

View file

@ -6,18 +6,27 @@
*
* Copyright 2009-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -315,28 +324,7 @@ t_void wlan_add_buf_bypass_txqueue(mlan_adapter *pmadapter, pmlan_buffer pmbuf)
*/
INLINE t_u8 wlan_bypass_tx_list_empty(mlan_adapter *pmadapter)
{
#if defined(USB)
if (IS_USB(pmadapter->card_type)) {
pmlan_callbacks pcb = &pmadapter->callbacks;
pmlan_private priv;
int j = 0;
for (j = 0; j < pmadapter->priv_num; ++j) {
priv = pmadapter->priv[j];
if (priv) {
if (!wlan_is_port_ready(pmadapter,
priv->port_index))
continue;
if (util_peek_list(pmadapter->pmoal_handle,
&priv->bypass_txq,
pcb->moal_spin_lock,
pcb->moal_spin_unlock))
return MFALSE;
}
}
return MTRUE;
} else
#endif
return (pmadapter->bypass_pkt_count) ? MFALSE : MTRUE;
return (pmadapter->bypass_pkt_count) ? MFALSE : MTRUE;
}
/**
@ -385,11 +373,6 @@ t_void wlan_process_bypass_tx(pmlan_adapter pmadapter)
for (j = 0; j < pmadapter->priv_num; ++j) {
priv = pmadapter->priv[j];
if (priv) {
#if defined(USB)
if (!wlan_is_port_ready(pmadapter,
priv->port_index))
continue;
#endif
pmbuf = (pmlan_buffer)util_dequeue_list(
pmadapter->pmoal_handle,
&priv->bypass_txq,
@ -446,57 +429,3 @@ t_void wlan_process_bypass_tx(pmlan_adapter pmadapter)
!wlan_bypass_tx_list_empty(pmadapter));
LEAVE();
}
/**
* @brief This function will convert 802.11 header to 802.3 header
and save the backhaul station aid to pmbuf
*
* @param priv A pointer to mlan_private
* @param pmbuf A pointer to mlan_buffer
* @param prx_pd A pointer to RxPD
*
* @return MLAN_STATUS_PENDING --success, otherwise fail
*/
mlan_status wlan_check_easymesh_pkt(mlan_private *priv, pmlan_buffer pmbuf,
RxPD *prx_pd)
{
Eth803Hdr_t *eth_header = MNULL;
sta_node *sta_ptr = MNULL;
mlan_status ret = MLAN_STATUS_SUCCESS;
t_u8 *pos = MNULL;
t_u32 tmp = 0;
ENTER();
pos = (t_u8 *)prx_pd + prx_pd->rx_pkt_offset;
eth_header = (Eth803Hdr_t *)pos;
PRINTM(MDAT_D,
"Rx Easymesh ETH header destination address: " FULL_MACSTR
"\nETH header source address: " FULL_MACSTR "\n",
FULL_MAC2STR(eth_header->dest_addr),
FULL_MAC2STR(eth_header->src_addr));
if (priv->bss_type == MLAN_BSS_TYPE_UAP) {
pmbuf->flags |= MLAN_BUF_FLAG_EASYMESH;
memcpy_ext(priv->adapter, pmbuf->mac, prx_pd->ta_mac,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
sta_ptr = wlan_get_station_entry(priv, prx_pd->ta_mac);
if (!sta_ptr) {
PRINTM(MERROR,
"Easymesh Error! Can't find station in the station list\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
/* Save station aid to pmbuf and send it to moal */
tmp = (t_u32)sta_ptr->aid;
pmbuf->priority |= (tmp << 24);
PRINTM(MDAT_D, "Easymesh: Rx for VLAN " FULL_MACSTR "\n",
FULL_MAC2STR(prx_pd->ta_mac));
}
done:
LEAVE();
return ret;
}

View file

@ -6,18 +6,27 @@
*
* Copyright 2009-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/

File diff suppressed because it is too large Load diff

View file

@ -3,20 +3,29 @@
* @brief This file contains the handling of AP mode ioctls
*
*
* Copyright 2009-2023 NXP
* Copyright 2009-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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -62,7 +71,7 @@ static mlan_status wlan_uap_bss_ioctl_stop(pmlan_adapter pmadapter,
ENTER();
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_BSS_STOP,
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_BSS_STOP,
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
MNULL);
if (ret == MLAN_STATUS_SUCCESS)
@ -83,8 +92,7 @@ static t_bool wlan_can_radar_det_skip(mlan_private *priv)
* is off then 11n_radar detection is not required for subsequent BSSes
* since they will follow the primary bss.
*/
if (!priv->adapter->mc_policy &&
(GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP)) {
if ((GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP)) {
memset(pmadapter, priv_list, 0x00, sizeof(priv_list));
pcount = wlan_get_privs_by_cond(pmadapter, wlan_is_intf_active,
priv_list);
@ -125,6 +133,10 @@ 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.
@ -151,10 +163,7 @@ 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)) {
@ -253,7 +262,7 @@ static mlan_status wlan_uap_callback_bss_ioctl_start(t_void *priv)
prep_bss_start:
/* else okay to send command: not DFS channel or no radar */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_BSS_START,
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_BSS_START,
HostCmd_ACT_GEN_SET, 0,
(t_void *)puap_state_chan_cb->pioctl_req_curr,
MNULL);
@ -286,6 +295,13 @@ static mlan_status wlan_uap_bss_ioctl_start(pmlan_adapter pmadapter,
ENTER();
if (pmadapter->enable_net_mon == CHANNEL_SPEC_SNIFFER_MODE) {
PRINTM(MINFO,
"BSS start is blocked in Channel Specified Network Monitor mode...\n");
LEAVE();
return MLAN_STATUS_FAILURE;
}
bss = (mlan_ds_bss *)pioctl_req->pbuf;
pmpriv->uap_host_based = bss->param.host_based;
if (!pmpriv->intf_state_11h.is_11h_host &&
@ -304,7 +320,7 @@ static mlan_status wlan_uap_bss_ioctl_start(pmlan_adapter pmadapter,
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
} else {
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_BSS_START,
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_BSS_START,
HostCmd_ACT_GEN_SET, 0,
(t_void *)pioctl_req, MNULL);
if (ret == MLAN_STATUS_SUCCESS)
@ -355,7 +371,7 @@ static mlan_status wlan_uap_bss_ioctl_reset(pmlan_adapter pmadapter,
pmpriv->addba_reject[6] = pmpriv->addba_reject[7] =
ADDBA_RSP_STATUS_REJECT;
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_RESET,
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_SYS_RESET,
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
MNULL);
if (ret == MLAN_STATUS_SUCCESS)
@ -418,8 +434,8 @@ static mlan_status wlan_uap_bss_ioctl_mac_address(pmlan_adapter pmadapter,
} else
cmd_action = HostCmd_ACT_GEN_GET;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
cmd_action, 0, (t_void *)pioctl_req, MNULL);
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
0, (t_void *)pioctl_req, MNULL);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
@ -450,8 +466,8 @@ static mlan_status wlan_uap_bss_ioctl_uap_wmm_param(pmlan_adapter pmadapter,
else
cmd_action = HostCmd_ACT_GEN_GET;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
cmd_action, 0, (t_void *)pioctl_req, MNULL);
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
0, (t_void *)pioctl_req, MNULL);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
@ -481,8 +497,8 @@ wlan_uap_bss_ioctl_action_chan_switch(pmlan_adapter pmadapter,
cmd_action = HostCmd_ACT_GEN_SET;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
cmd_action, 0, (t_void *)pioctl_req, MNULL);
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
0, (t_void *)pioctl_req, MNULL);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
@ -514,8 +530,8 @@ wlan_uap_bss_ioctl_uap_scan_channels(pmlan_adapter pmadapter,
else
cmd_action = HostCmd_ACT_GEN_GET;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
cmd_action, 0, (t_void *)pioctl_req, MNULL);
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
0, (t_void *)pioctl_req, MNULL);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
@ -546,8 +562,8 @@ static mlan_status wlan_uap_bss_ioctl_uap_channel(pmlan_adapter pmadapter,
else
cmd_action = HostCmd_ACT_GEN_GET;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
cmd_action, 0, (t_void *)pioctl_req, MNULL);
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
0, (t_void *)pioctl_req, MNULL);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
@ -580,7 +596,7 @@ static mlan_status wlan_uap_bss_ioctl_uap_oper_ctrl(pmlan_adapter pmadapter,
else
cmd_action = HostCmd_ACT_GEN_GET;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_OPER_CTRL,
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_OPER_CTRL,
cmd_action, 0, (t_void *)pioctl_req,
(t_void *)pioctl_req->pbuf);
@ -690,8 +706,8 @@ static mlan_status wlan_uap_bss_ioctl_config(pmlan_adapter pmadapter,
cmd_action = HostCmd_ACT_GEN_GET;
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
cmd_action, 0, (t_void *)pioctl_req, MNULL);
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
0, (t_void *)pioctl_req, MNULL);
if (ret == MLAN_STATUS_SUCCESS)
ret = MLAN_STATUS_PENDING;
@ -718,7 +734,7 @@ static mlan_status wlan_uap_bss_ioctl_deauth_sta(pmlan_adapter pmadapter,
ENTER();
bss = (mlan_ds_bss *)pioctl_req->pbuf;
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_STA_DEAUTH,
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_STA_DEAUTH,
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
(t_void *)&bss->param.deauth_param);
if (ret == MLAN_STATUS_SUCCESS)
@ -745,7 +761,7 @@ static mlan_status wlan_uap_get_sta_list(pmlan_adapter pmadapter,
ENTER();
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_STA_LIST,
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_STA_LIST,
HostCmd_ACT_GEN_GET, 0, (t_void *)pioctl_req,
MNULL);
@ -908,7 +924,7 @@ static mlan_status wlan_uap_set_wapi_ie(mlan_private *priv,
}
/* Send request to firmware */
ret = wlan_prepare_cmd(priv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
ret = wlan_prepare_cmd(priv, HOST_CMD_APCMD_SYS_CONFIGURE,
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
MNULL);
@ -1013,7 +1029,7 @@ wlan_uap_sec_ioctl_report_mic_error(pmlan_adapter pmadapter,
ENTER();
sec = (mlan_ds_sec_cfg *)pioctl_req->pbuf;
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_REPORT_MIC,
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_REPORT_MIC,
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
(t_void *)sec->param.sta_mac);
if (ret == MLAN_STATUS_SUCCESS)
@ -1444,10 +1460,9 @@ static mlan_status wlan_uap_callback_11h_channel_check_req(t_void *priv)
dfs_state = wlan_get_chan_dfs_state(
pmpriv, BAND_A, puap_state_chan_cb->channel);
if (dfs_state == DFS_AVAILABLE) {
wlan_11h_set_dfs_check_chan(pmpriv,
puap_state_chan_cb->channel,
pband_cfg->chanWidth);
PRINTM(MCMND, "DFS: Channel %d is Avaliable\n",
wlan_11h_set_dfs_check_chan(
pmpriv, puap_state_chan_cb->channel);
PRINTM(MCMND, "ZERODFS: Channel %d is Avaliable\n",
puap_state_chan_cb->channel);
pcb->moal_ioctl_complete(pmpriv->adapter->pmoal_handle,
pioctl, MLAN_STATUS_COMPLETE);
@ -1532,28 +1547,6 @@ 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,
@ -1735,7 +1728,7 @@ static mlan_status wlan_uap_bss_ioctl_acs_scan(pmlan_adapter pmadapter,
return MLAN_STATUS_FAILURE;
}
/* Send request to firmware */
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_ACS_SCAN,
ret = wlan_prepare_cmd(pmpriv, HostCMD_APCMD_ACS_SCAN,
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
MNULL);
@ -1768,7 +1761,7 @@ mlan_status wlan_uap_get_channel(pmlan_private pmpriv)
tlv_chan_band.header.len = sizeof(MrvlIEtypes_channel_band_t) -
sizeof(MrvlIEtypesHeader_t);
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_SYS_CONFIGURE,
HostCmd_ACT_GEN_GET, 0, MNULL, &tlv_chan_band);
LEAVE();
return ret;
@ -1797,7 +1790,7 @@ mlan_status wlan_uap_set_channel(pmlan_private pmpriv,
tlv_chan_band.bandcfg = uap_band_cfg;
tlv_chan_band.channel = channel;
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_SYS_CONFIGURE,
HostCmd_ACT_GEN_SET, 0, MNULL, &tlv_chan_band);
LEAVE();
return ret;
@ -1833,45 +1826,12 @@ mlan_status wlan_uap_get_beacon_dtim(pmlan_private pmpriv)
ptlv_dtim_pd->header.len =
sizeof(MrvlIEtypes_dtim_period_t) - sizeof(MrvlIEtypesHeader_t);
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_SYS_CONFIGURE,
HostCmd_ACT_GEN_GET, 0, MNULL, tlv_buffer);
LEAVE();
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.
*
@ -1909,43 +1869,6 @@ 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
*
@ -1971,6 +1894,9 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
mlan_ds_rate *rate = MNULL;
mlan_ds_reg_mem *reg_mem = MNULL;
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
pmlan_ds_scan pscan;
#endif
ENTER();
switch (pioctl_req->req_id) {
@ -2035,9 +1961,25 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
status = wlan_uap_bss_ioctl_action_chan_switch(
pmadapter, pioctl_req);
break;
#ifdef STA_SUPPORT
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
case MLAN_IOCTL_SCAN:
status = wlan_scan_ioctl(pmadapter, pioctl_req);
pscan = (mlan_ds_scan *)pioctl_req->pbuf;
if ((pscan->sub_command == MLAN_OID_SCAN_NORMAL) &&
(pioctl_req->action == MLAN_ACT_GET)) {
PRINTM(MIOCTL, "Get scan table in uap\n");
pscan->param.scan_resp.pscan_table =
(t_u8 *)pmadapter->pscan_table;
pscan->param.scan_resp.num_in_scan_table =
pmadapter->num_in_scan_table;
pscan->param.scan_resp.age_in_secs =
pmadapter->age_in_secs;
pioctl_req->data_read_written =
sizeof(mlan_scan_resp) + MLAN_SUB_COMMAND_SIZE;
pscan->param.scan_resp.pchan_stats =
(t_u8 *)pmadapter->pchan_stats;
pscan->param.scan_resp.num_in_chan_stats =
pmadapter->num_in_chan_stats;
}
break;
#endif
case MLAN_IOCTL_GET_INFO:
@ -2076,8 +2018,6 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
pmadapter->getlog_enable;
pget_info->param.fw_info.hw_dev_mcs_support =
pmadapter->hw_dev_mcs_support;
pget_info->param.fw_info.hw_mpdu_density =
pmadapter->hw_mpdu_density;
pget_info->param.fw_info.hw_dot_11n_dev_cap =
pmadapter->hw_dot_11n_dev_cap;
pget_info->param.fw_info.usr_dev_mcs_support =
@ -2125,8 +2065,6 @@ 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;
@ -2142,17 +2080,6 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
if (misc->sub_command == MLAN_OID_MISC_SOFT_RESET)
status = wlan_uap_misc_ioctl_soft_reset(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_WARM_RESET) {
PRINTM(MCMND, "Request UAP WARM RESET\n");
util_enqueue_list_tail(
pmadapter->pmoal_handle,
&pmadapter->ioctl_pending_q,
(pmlan_linked_list)pioctl_req,
pmadapter->callbacks.moal_spin_lock,
pmadapter->callbacks.moal_spin_unlock);
pmadapter->pending_ioctl = MTRUE;
status = MLAN_STATUS_PENDING;
}
if (misc->sub_command == MLAN_OID_MISC_HOST_CMD)
status =
wlan_misc_ioctl_host_cmd(pmadapter, pioctl_req);
@ -2180,15 +2107,11 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
if (misc->sub_command == MLAN_OID_MISC_MAC_CONTROL)
status = wlan_misc_ioctl_mac_control(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_MULTI_CHAN_CFG)
status = wlan_misc_ioctl_multi_chan_config(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_MULTI_CHAN_POLICY)
status = wlan_misc_ioctl_multi_chan_policy(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_DRCS_CFG)
status = wlan_misc_ioctl_drcs_config(pmadapter,
pioctl_req);
#ifdef RX_PACKET_COALESCE
if (misc->sub_command == MLAN_OID_MISC_RX_PACKET_COALESCE)
status = wlan_misc_ioctl_rx_pkt_coalesce_config(
pmadapter, pioctl_req);
#endif
#ifdef WIFI_DIRECT_SUPPORT
if (misc->sub_command == MLAN_OID_MISC_WIFI_DIRECT_CONFIG)
status = wlan_misc_p2p_config(pmadapter, pioctl_req);
@ -2216,19 +2139,10 @@ 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_CROSS_CHIP_SYNCH) {
status = wlan_misc_ioctl_cross_chip_synch(pmadapter,
pioctl_req);
}
if (misc->sub_command == MLAN_OID_MISC_GET_CHAN_REGION_CFG)
status = wlan_misc_chan_reg_cfg(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_OPER_CLASS_CHECK)
@ -2251,17 +2165,9 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
if (misc->sub_command == MLAN_OID_MISC_RX_ABORT_CFG)
status = wlan_misc_ioctl_rxabortcfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_OFDM_DESENSE_CFG)
status = wlan_misc_ioctl_ofdmdesense_cfg(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_RX_ABORT_CFG_EXT)
status = wlan_misc_ioctl_rxabortcfg_ext(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_NAV_MITIGATION)
status = wlan_misc_ioctl_nav_mitigation(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_LED_CONFIG)
status = wlan_misc_ioctl_led(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_TX_AMPDU_PROT_MODE)
status = wlan_misc_ioctl_tx_ampdu_prot_mode(pmadapter,
pioctl_req);
@ -2280,12 +2186,6 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
status = wlan_misc_robustcoex(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_DMCS_CONFIG)
status = wlan_misc_dmcs_config(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CONFIG_RTT)
status = wlan_config_rtt(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_CANCEL_RTT)
status = wlan_cancel_rtt(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_RTT_RESPONDER_CFG)
status = wlan_rtt_responder_cfg(pmadapter, pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_GET_TX_RX_HISTOGRAM)
status =
wlan_get_tx_rx_histogram(pmadapter, pioctl_req);
@ -2313,14 +2213,6 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
if (misc->sub_command == MLAN_OID_MISC_WACP_MODE)
status = wlan_misc_ioctl_wacp_mode(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_COUNTRY_CODE)
status = wlan_misc_ioctl_country_code(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_REORDER_FLUSH_TIME)
status = wlan_misc_ioctl_reorder_flush_time(pmadapter,
pioctl_req);
if (misc->sub_command == MLAN_OID_MISC_EXT_CAP_CFG)
status = wlan_misc_ext_capa_cfg(pmadapter, pioctl_req);
break;
case MLAN_IOCTL_POWER_CFG:
power = (mlan_ds_power_cfg *)pioctl_req->pbuf;
@ -2357,9 +2249,6 @@ 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;
@ -2395,9 +2284,6 @@ 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);
@ -2410,8 +2296,6 @@ 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

@ -5,18 +5,27 @@
*
* Copyright 2009-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -36,6 +45,9 @@ Change log:
#include "mlan_wmm.h"
#include "mlan_11n_aggr.h"
#include "mlan_11n_rxreorder.h"
#ifdef DRV_EMBEDDED_AUTHENTICATOR
#include "authenticator_api.h"
#endif
/********************************************************
Local Functions
@ -62,13 +74,7 @@ static mlan_status wlan_upload_uap_rx_packet(pmlan_adapter pmadapter,
prx_pd = (RxPD *)(pmbuf->pbuf + pmbuf->data_offset);
/* Chop off RxPD */
if (pmbuf->data_len > prx_pd->rx_pkt_offset) {
pmbuf->data_len -= prx_pd->rx_pkt_offset;
} else {
PRINTM(MERROR,
"pmbuf->data_len is smaller than prx_pd->rx_pkt_offset\n");
pmbuf->status_code = MLAN_ERROR_PKT_INVALID;
}
pmbuf->data_len -= prx_pd->rx_pkt_offset;
pmbuf->data_offset += prx_pd->rx_pkt_offset;
pmbuf->pparent = MNULL;
@ -92,6 +98,7 @@ static mlan_status wlan_upload_uap_rx_packet(pmlan_adapter pmadapter,
"uAP Rx Error: moal_recv_packet returned error\n");
pmbuf->status_code = MLAN_ERROR_PKT_INVALID;
}
if (ret != MLAN_STATUS_PENDING)
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
#ifdef USB
@ -246,11 +253,6 @@ t_void *wlan_ops_uap_process_txpd(t_void *priv, pmlan_buffer pmbuf)
plocal_tx_pd->tx_pkt_type = (t_u16)pkt_type;
plocal_tx_pd->tx_control = tx_control;
}
if (pmbuf->flags & MLAN_BUF_FLAG_EASYMESH) {
plocal_tx_pd->flags |= MRVDRV_TxPD_FLAGS_EASYMESH;
memcpy_ext(pmpriv->adapter, plocal_tx_pd->ra_mac, pmbuf->mac,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
}
if (pmbuf->flags & MLAN_BUF_FLAG_TX_CTRL) {
if (pmbuf->u.tx_info.data_rate) {
@ -343,20 +345,14 @@ mlan_status wlan_ops_uap_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
t_u8 ta[MLAN_MAC_ADDR_LENGTH];
t_u16 rx_pkt_type = 0;
sta_node *sta_ptr = MNULL;
#ifdef DRV_EMBEDDED_AUTHENTICATOR
t_u8 eapol_type[2] = {0x88, 0x8e};
#endif
t_u16 adj_rx_rate = 0;
t_u8 antenna = 0;
t_u32 last_rx_sec = 0;
t_u32 last_rx_usec = 0;
RxPD *prx_pd2;
EthII_Hdr_t *peth_hdr2;
wlan_802_11_header *pwlan_hdr;
IEEEtypes_FrameCtl_t *frmctl;
pmlan_buffer pmbuf2 = MNULL;
mlan_802_11_mac_addr src_addr = {0x00};
mlan_802_11_mac_addr dest_addr = {0x00};
t_u16 hdr_len;
t_u8 snap_eth_hdr[5] = {0xaa, 0xaa, 0x03, 0x00, 0x00};
t_u8 ext_rate_info = 0;
ENTER();
@ -393,14 +389,6 @@ mlan_status wlan_ops_uap_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
}
rx_pkt_type = prx_pd->rx_pkt_type;
if (prx_pd->flags & RXPD_FLAG_PKT_EASYMESH) {
PRINTM_NETINTF(MDAT_D, priv);
PRINTM(MDAT_D, "UAP Rx Easymesh pkt flags : 0x%x\n",
prx_pd->flags);
ret = wlan_check_easymesh_pkt(priv, pmbuf, prx_pd);
if (ret != MLAN_STATUS_SUCCESS)
goto done;
}
prx_pkt = (RxPacketHdr_t *)((t_u8 *)prx_pd + prx_pd->rx_pkt_offset);
PRINTM(MINFO,
@ -441,112 +429,6 @@ mlan_status wlan_ops_uap_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
goto done;
}
if (pmadapter->enable_net_mon &&
(prx_pd->flags & RXPD_FLAG_UCAST_PKT)) {
pwlan_hdr = (wlan_802_11_header *)((t_u8 *)prx_pd +
prx_pd->rx_pkt_offset);
frmctl = (IEEEtypes_FrameCtl_t *)pwlan_hdr;
if (frmctl->type == 0x02) {
/* This is a valid unicast destined data packet, with
* 802.11 and rtap headers attached. Duplicate this
* packet and process this copy as a sniffed packet,
* meant for monitor iface
*/
pmbuf2 = wlan_alloc_mlan_buffer(pmadapter,
MLAN_RX_DATA_BUF_SIZE,
MLAN_RX_HEADER_LEN,
MOAL_ALLOC_MLAN_BUFFER);
if (!pmbuf2) {
PRINTM(MERROR,
"Unable to allocate mlan_buffer for Rx");
PRINTM(MERROR, "sniffed packet\n");
} else {
pmbuf2->bss_index = pmbuf->bss_index;
pmbuf2->buf_type = pmbuf->buf_type;
pmbuf2->priority = pmbuf->priority;
pmbuf2->in_ts_sec = pmbuf->in_ts_sec;
pmbuf2->in_ts_usec = pmbuf->in_ts_usec;
pmbuf2->data_len = pmbuf->data_len;
memcpy(pmadapter,
pmbuf2->pbuf + pmbuf2->data_offset,
pmbuf->pbuf + pmbuf->data_offset,
pmbuf->data_len);
prx_pd2 = (RxPD *)(pmbuf2->pbuf +
pmbuf2->data_offset);
/* set pkt type of duplicated pkt to 802.11 */
prx_pd2->rx_pkt_type = PKT_TYPE_802DOT11;
wlan_process_uap_rx_packet(priv, pmbuf2);
}
/* Now, process this pkt as a normal data packet.
* rx_pkt_offset points to the 802.11 hdr. Construct
* 802.3 header from 802.11 hdr fields and attach it
* just before the payload.
*/
memcpy(pmadapter, (t_u8 *)&dest_addr, pwlan_hdr->addr1,
sizeof(pwlan_hdr->addr1));
memcpy(pmadapter, (t_u8 *)&src_addr, pwlan_hdr->addr2,
sizeof(pwlan_hdr->addr2));
hdr_len = sizeof(wlan_802_11_header);
/* subtract mac addr field size for 3 address mac80211
* header */
if (!(frmctl->from_ds && frmctl->to_ds))
hdr_len -= sizeof(mlan_802_11_mac_addr);
/* add 2 bytes of qos ctrl flags */
if (frmctl->sub_type & QOS_DATA)
hdr_len += 2;
if (prx_pd->rx_pkt_type == PKT_TYPE_AMSDU) {
/* no need to generate 802.3 hdr, update pkt
* offset */
prx_pd->rx_pkt_offset += hdr_len;
prx_pd->rx_pkt_length -= hdr_len;
} else {
/* skip 6-byte snap and 2-byte type */
if (memcmp(pmadapter,
(t_u8 *)pwlan_hdr + hdr_len,
snap_eth_hdr,
sizeof(snap_eth_hdr)) == 0)
hdr_len += 8;
peth_hdr2 =
(EthII_Hdr_t *)((t_u8 *)prx_pd +
prx_pd->rx_pkt_offset +
hdr_len -
sizeof(EthII_Hdr_t));
memcpy(pmadapter, peth_hdr2->dest_addr,
(t_u8 *)&dest_addr,
sizeof(peth_hdr2->dest_addr));
memcpy(pmadapter, peth_hdr2->src_addr,
(t_u8 *)&src_addr,
sizeof(peth_hdr2->src_addr));
/* Update the rx_pkt_offset to point the 802.3
* hdr */
prx_pd->rx_pkt_offset +=
(hdr_len - sizeof(EthII_Hdr_t));
prx_pd->rx_pkt_length -=
(hdr_len - sizeof(EthII_Hdr_t));
}
/* update the prx_pkt pointer */
prx_pkt = (RxPacketHdr_t *)((t_u8 *)prx_pd +
prx_pd->rx_pkt_offset);
} else {
pmbuf->status_code = MLAN_ERROR_PKT_SIZE_INVALID;
ret = MLAN_STATUS_FAILURE;
PRINTM(MERROR,
"Drop invalid unicast sniffer pkt, subType=0x%x, flag=0x%x, pkt_type=%d\n",
frmctl->sub_type, prx_pd->flags,
prx_pd->rx_pkt_type);
wlan_free_mlan_buffer(pmadapter, pmbuf);
goto done;
}
}
if (rx_pkt_type != PKT_TYPE_BAR) {
priv->rxpd_rate = prx_pd->rx_rate;
priv->rxpd_rate_info = prx_pd->rate_info;
@ -562,11 +444,7 @@ mlan_status wlan_ops_uap_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
}
}
if (prx_pd->flags & RXPD_FLAG_PKT_EASYMESH)
sta_ptr = wlan_get_station_entry(priv, prx_pd->ta_mac);
else
sta_ptr = wlan_get_station_entry(priv,
prx_pkt->eth803_hdr.src_addr);
sta_ptr = wlan_get_station_entry(priv, prx_pkt->eth803_hdr.src_addr);
if (sta_ptr) {
sta_ptr->snr = prx_pd->snr;
sta_ptr->nf = prx_pd->nf;
@ -574,24 +452,26 @@ 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;
}
}
pmbuf->priority |= prx_pd->priority;
if (pmadapter->enable_net_mon &&
(prx_pd->rx_pkt_type == PKT_TYPE_802DOT11)) {
wlan_process_uap_rx_packet(priv, pmbuf);
goto done;
#ifdef DRV_EMBEDDED_AUTHENTICATOR
/**process eapol packet for uap*/
if (IsAuthenticatorEnabled(priv->psapriv) &&
(!memcmp(pmadapter, &prx_pkt->eth803_hdr.h803_len, eapol_type,
sizeof(eapol_type)))) {
ret = AuthenticatorProcessEapolPacket(
priv->psapriv, ((t_u8 *)prx_pd + prx_pd->rx_pkt_offset),
prx_pd->rx_pkt_length);
if (ret == MLAN_STATUS_SUCCESS) {
pmadapter->ops.data_complete(pmadapter, pmbuf, ret);
goto done;
}
}
if (prx_pd->flags & RXPD_FLAG_PKT_EASYMESH)
memcpy_ext(pmadapter, ta, prx_pd->ta_mac, MLAN_MAC_ADDR_LENGTH,
MLAN_MAC_ADDR_LENGTH);
else
memcpy_ext(pmadapter, ta, prx_pkt->eth803_hdr.src_addr,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
#endif
pmbuf->priority |= prx_pd->priority;
memcpy_ext(pmadapter, ta, prx_pkt->eth803_hdr.src_addr,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
if ((rx_pkt_type != PKT_TYPE_BAR) && (prx_pd->priority < MAX_NUM_TID)) {
sta_ptr = wlan_get_station_entry(priv, ta);
if (sta_ptr) {
@ -601,7 +481,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 && !priv->is_11ax_enabled) ||
if (!priv->is_11n_enabled ||
(!wlan_11n_get_rxreorder_tbl((mlan_private *)priv, prx_pd->priority,
ta) &&
(prx_pd->rx_pkt_type != PKT_TYPE_AMSDU))) {
@ -800,10 +680,8 @@ mlan_status wlan_process_uap_rx_packet(mlan_private *priv, pmlan_buffer pmbuf)
MAC2STR(prx_pkt->eth803_hdr.dest_addr));
if (pmadapter->enable_net_mon) {
if (prx_pd->rx_pkt_type == PKT_TYPE_802DOT11) {
pmbuf->flags |= MLAN_BUF_FLAG_NET_MONITOR;
goto upload;
}
pmbuf->flags |= MLAN_BUF_FLAG_NET_MONITOR;
goto upload;
}
/* don't do packet forwarding in disconnected state */

View file

@ -5,18 +5,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -44,7 +53,6 @@ static const struct _mlan_card_info mlan_card_info_usb8801 = {
.v16_fw_api = 0,
.supp_ps_handshake = 1,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_1X1,
.support_11mc = 0,
};
#endif
#ifdef USB8897
@ -53,7 +61,6 @@ static const struct _mlan_card_info mlan_card_info_usb8897 = {
.v16_fw_api = 0,
.supp_ps_handshake = 1,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 0,
};
#endif
@ -63,7 +70,6 @@ static const struct _mlan_card_info mlan_card_info_usb8997 = {
.v16_fw_api = 1,
.supp_ps_handshake = 1,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 1,
};
#endif
@ -73,7 +79,6 @@ static const struct _mlan_card_info mlan_card_info_usb8978 = {
.v16_fw_api = 1,
.supp_ps_handshake = 1,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 1,
};
#endif
@ -84,7 +89,6 @@ static const struct _mlan_card_info mlan_card_info_usb9098 = {
.v17_fw_api = 1,
.supp_ps_handshake = 1,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 1,
};
#endif
@ -95,18 +99,16 @@ static const struct _mlan_card_info mlan_card_info_usb9097 = {
.v17_fw_api = 1,
.supp_ps_handshake = 1,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 1,
};
#endif
#ifdef USBIW624
static const struct _mlan_card_info mlan_card_info_usbIW624 = {
#ifdef USBNW62X
static const struct _mlan_card_info mlan_card_info_usbNW62X = {
.max_tx_buf_size = MLAN_TX_DATA_BUF_SIZE_4K,
.v16_fw_api = 1,
.v17_fw_api = 1,
.supp_ps_handshake = 1,
.default_11n_tx_bf_cap = DEFAULT_11N_TX_BF_CAP_2X2,
.support_11mc = 1,
};
#endif
@ -262,8 +264,8 @@ static mlan_status wlan_usb_prog_fw_w_helper(pmlan_adapter pmadapter,
if (IS_USB9097(pmadapter->card_type))
check_fw_status = MTRUE;
#endif
#if defined(USBIW624)
if (IS_USBIW624(pmadapter->card_type))
#if defined(USBNW62X)
if (IS_USBNW62X(pmadapter->card_type))
check_fw_status = MTRUE;
#endif
@ -373,16 +375,6 @@ 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
@ -487,11 +479,10 @@ static int wlan_usb_deaggr_rx_num_pkts(pmlan_adapter pmadapter, t_u8 *pdata,
static inline t_u32 usb_tx_aggr_pad_len(t_u32 len,
usb_tx_aggr_params *pusb_tx_aggr)
{
return (t_u32)(
(len % pusb_tx_aggr->aggr_ctrl.aggr_align) ?
(len + (pusb_tx_aggr->aggr_ctrl.aggr_align -
(len % pusb_tx_aggr->aggr_ctrl.aggr_align))) :
len);
return (len % pusb_tx_aggr->aggr_ctrl.aggr_align) ?
(len + (pusb_tx_aggr->aggr_ctrl.aggr_align -
(len % pusb_tx_aggr->aggr_ctrl.aggr_align))) :
len;
}
/**
@ -696,8 +687,7 @@ static inline t_void wlan_usb_tx_send_aggr(pmlan_adapter pmadapter,
}
if (pmbuf_aggr && pmbuf_aggr->data_len) {
wlan_update_port_status(pmadapter, pusb_tx_aggr->port, MTRUE);
pmadapter->data_sent = wlan_usb_data_sent(pmadapter);
pmadapter->data_sent = MTRUE;
ret = pmadapter->callbacks.moal_write_data_async(
pmadapter->pmoal_handle, pmbuf_aggr,
pusb_tx_aggr->port);
@ -719,8 +709,6 @@ static inline t_void wlan_usb_tx_send_aggr(pmlan_adapter pmadapter,
wlan_write_data_complete(pmadapter, pmbuf_aggr, ret);
break;
case MLAN_STATUS_FAILURE:
wlan_update_port_status(pmadapter, pusb_tx_aggr->port,
MFALSE);
pmadapter->data_sent = MFALSE;
PRINTM(MERROR,
"Error: moal_write_data_async failed: 0x%X\n",
@ -730,8 +718,6 @@ static inline t_void wlan_usb_tx_send_aggr(pmlan_adapter pmadapter,
wlan_write_data_complete(pmadapter, pmbuf_aggr, ret);
break;
case MLAN_STATUS_PENDING:
wlan_update_port_status(pmadapter, pusb_tx_aggr->port,
MFALSE);
pmadapter->data_sent = MFALSE;
break;
case MLAN_STATUS_SUCCESS:
@ -806,9 +792,9 @@ mlan_status wlan_get_usb_device(pmlan_adapter pmadapter)
pmadapter->pcard_info = &mlan_card_info_usb9097;
break;
#endif
#ifdef USBIW624
case CARD_TYPE_USBIW624:
pmadapter->pcard_info = &mlan_card_info_usbIW624;
#ifdef USBNW62X
case CARD_TYPE_USBNW62X:
pmadapter->pcard_info = &mlan_card_info_usbNW62X;
break;
#endif
default:
@ -977,16 +963,13 @@ t_void wlan_usb_tx_aggr_timeout_func(t_void *function_context)
{
usb_tx_aggr_params *pusb_tx_aggr =
(usb_tx_aggr_params *)function_context;
t_u8 port_index = 0;
pmlan_adapter pmadapter = (mlan_adapter *)pusb_tx_aggr->phandle;
pmlan_callbacks pcb = &pmadapter->callbacks;
ENTER();
pcb->moal_spin_lock(pmadapter->pmoal_handle, pusb_tx_aggr->paggr_lock);
pusb_tx_aggr->aggr_hold_timer_is_set = MFALSE;
port_index = wlan_get_port_index(pmadapter, pusb_tx_aggr->port);
if (pusb_tx_aggr->pmbuf_aggr &&
wlan_is_port_ready(pmadapter, port_index) &&
if (pusb_tx_aggr->pmbuf_aggr && !pmadapter->data_sent &&
!wlan_is_port_tx_paused(pmadapter, pusb_tx_aggr))
wlan_usb_tx_send_aggr(pmadapter, pusb_tx_aggr);
pcb->moal_spin_unlock(pmadapter->pmoal_handle,
@ -1151,98 +1134,6 @@ mlan_status wlan_usb_host_to_card_aggr(pmlan_adapter pmadapter,
return ret;
}
/**
* @brief This function used to check if any USB port still available
*
* @param pmadapter A pointer to mlan_adapter
*
* @return MTRUE--non of the port is available.
* MFALSE -- still have port available.
*/
inline t_u8 wlan_usb_data_sent(pmlan_adapter pmadapter)
{
int i;
for (i = 0; i < MAX_USB_TX_PORT_NUM; i++) {
if (pmadapter->pcard_usb->usb_port_status[i] == MFALSE)
return MFALSE;
}
return MTRUE;
}
/**
* @brief This function resync the USB tx port
*
* @param pmadapter A pointer to mlan_adapter
*
* @return N/A
*/
void wlan_resync_usb_port(pmlan_adapter pmadapter)
{
t_u32 active_port = pmadapter->usb_tx_ports[0];
int i;
/* MC is enabled */
if (pmadapter->mc_status) {
for (i = 0; i < MIN(pmadapter->priv_num, MLAN_MAX_BSS_NUM);
i++) {
if (pmadapter->priv[i]) {
if (((GET_BSS_ROLE(pmadapter->priv[i]) ==
MLAN_BSS_ROLE_UAP) &&
!pmadapter->priv[i]->uap_bss_started) ||
((GET_BSS_ROLE(pmadapter->priv[i]) ==
MLAN_BSS_ROLE_STA) &&
!pmadapter->priv[i]->media_connected)) {
PRINTM(MINFO,
"Set deactive interface to default EP\n");
pmadapter->priv[i]->port =
pmadapter->usb_tx_ports[0];
;
pmadapter->priv[i]->port_index = 0;
}
}
}
/** Enable all the ports */
for (i = 0; i < MAX_USB_TX_PORT_NUM; i++)
pmadapter->pcard_usb->usb_port_status[i] = MFALSE;
} else {
/* Get active port from connected interface */
for (i = 0; i < MIN(pmadapter->priv_num, MLAN_MAX_BSS_NUM);
i++) {
if (pmadapter->priv[i]) {
if (((GET_BSS_ROLE(pmadapter->priv[i]) ==
MLAN_BSS_ROLE_UAP) &&
pmadapter->priv[i]->uap_bss_started) ||
((GET_BSS_ROLE(pmadapter->priv[i]) ==
MLAN_BSS_ROLE_STA) &&
pmadapter->priv[i]->media_connected)) {
active_port = pmadapter->priv[i]->port;
PRINTM(MEVENT, "active port=%d\n",
active_port);
break;
}
}
}
/** set all the interface to the same port */
for (i = 0; i < MIN(pmadapter->priv_num, MLAN_MAX_BSS_NUM);
i++) {
if (pmadapter->priv[i]) {
pmadapter->priv[i]->port = active_port;
pmadapter->priv[i]->port_index =
wlan_get_port_index(pmadapter,
active_port);
}
}
for (i = 0; i < MAX_USB_TX_PORT_NUM; i++) {
if (active_port == pmadapter->usb_tx_ports[i])
pmadapter->pcard_usb->usb_port_status[i] =
MFALSE;
else
pmadapter->pcard_usb->usb_port_status[i] =
MTRUE;
}
}
return;
}
/**
* @brief This function wakes up the card.
*
@ -1305,7 +1196,7 @@ static mlan_status wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
return MLAN_STATUS_FAILURE;
}
if (type == MLAN_TYPE_CMD
#if (defined(USB9098) || defined(USB9097) || defined(USBIW624))
#if (defined(USB9098) || defined(USB9097) || defined(USBNW62X))
|| type == MLAN_TYPE_VDLL
#endif
) {
@ -1322,9 +1213,7 @@ static mlan_status wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
ret = wlan_usb_host_to_card_aggr(pmadapter, pmbuf, tx_param,
pusb_tx_aggr);
} else {
pmadapter->pcard_usb->usb_port_status[pmpriv->port_index] =
MTRUE;
pmadapter->data_sent = wlan_usb_data_sent(pmadapter);
pmadapter->data_sent = MTRUE;
ret = pmadapter->callbacks.moal_write_data_async(
pmadapter->pmoal_handle, pmbuf, pmpriv->port);
switch (ret) {
@ -1335,13 +1224,9 @@ static mlan_status wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
break;
case MLAN_STATUS_FAILURE:
pmadapter->pcard_usb
->usb_port_status[pmpriv->port_index] = MFALSE;
pmadapter->data_sent = MFALSE;
break;
case MLAN_STATUS_PENDING:
pmadapter->pcard_usb
->usb_port_status[pmpriv->port_index] = MFALSE;
pmadapter->data_sent = MFALSE;
break;
case MLAN_STATUS_SUCCESS:
@ -1356,36 +1241,18 @@ static mlan_status wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
}
/**
* @brief This function handle event complete
* @brief This function handle event/cmd complete
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pmbuf A pointer to the mlan_buffer
* @return N/A
*/
static mlan_status wlan_usb_evt_complete(pmlan_adapter pmadapter,
mlan_buffer *pmbuf, mlan_status status)
static mlan_status wlan_usb_cmdevt_complete(pmlan_adapter pmadapter,
mlan_buffer *pmbuf,
mlan_status status)
{
ENTER();
pmadapter->event_cause = 0;
pmadapter->pmlan_buffer_event = MNULL;
pmadapter->callbacks.moal_recv_complete(pmadapter->pmoal_handle, pmbuf,
pmadapter->rx_cmd_ep, status);
LEAVE();
return MLAN_STATUS_SUCCESS;
}
/**
* @brief This function handle cmd complete
*
* @param pmadapter A pointer to mlan_adapter structure
* @param pmbuf A pointer to the mlan_buffer
* @return N/A
*/
static mlan_status wlan_usb_cmd_complete(pmlan_adapter pmadapter,
mlan_buffer *pmbuf, mlan_status status)
{
ENTER();
pmadapter->callbacks.moal_recv_complete(pmadapter->pmoal_handle, pmbuf,
pmadapter->rx_cmd_ep, status);
@ -1437,9 +1304,9 @@ mlan_adapter_operations mlan_usb_ops = {
.dnld_fw = wlan_usb_dnld_fw,
.host_to_card = wlan_usb_host_to_card,
.wakeup_card = wlan_pm_usb_wakeup_card,
.event_complete = wlan_usb_evt_complete,
.event_complete = wlan_usb_cmdevt_complete,
.data_complete = wlan_usb_data_complete,
.cmdrsp_complete = wlan_usb_cmd_complete,
.cmdrsp_complete = wlan_usb_cmdevt_complete,
.handle_rx_packet = wlan_usb_handle_rx_packet,
.intf_header_len = USB_INTF_HEADER_LEN,

View file

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -47,11 +56,6 @@ typedef struct _mlan_list_head {
t_void *plock;
} mlan_list_head, *pmlan_list_head;
struct reflective_enum_element {
int id;
const char *name;
};
/** MLAN MNULL pointer */
#define MNULL ((void *)0)
@ -408,10 +412,8 @@ static INLINE t_void util_scalar_decrement(
* @param moal_spin_lock A pointer to spin lock handler
* @param moal_spin_unlock A pointer to spin unlock handler
*
* @return Value after offset or 0 if (scalar_value + offset)
* overflows
* @return Value after offset
*/
#define INT_MAX 2147483647
static INLINE t_s32 util_scalar_offset(
t_void *pmoal_handle, pmlan_scalar pscalar, t_s32 offset,
mlan_status (*moal_spin_lock)(t_void *handle, t_void *plock),
@ -421,10 +423,7 @@ static INLINE t_s32 util_scalar_offset(
if (moal_spin_lock)
moal_spin_lock(pmoal_handle, pscalar->plock);
if (pscalar->value < (INT_MAX - offset))
newval = (pscalar->value += offset);
else
newval = 0;
newval = (pscalar->value += offset);
if (moal_spin_unlock)
moal_spin_unlock(pmoal_handle, pscalar->plock);
@ -502,17 +501,4 @@ static INLINE t_u32 bitcount(t_u32 num)
return count;
}
static INLINE const char *
reflective_enum_lookup_name(const struct reflective_enum_element *elements,
int id)
{
const struct reflective_enum_element *elem = elements;
while (elem->name && elem->id != id) {
elem++;
}
return elem->name;
}
#endif /* !_MLAN_UTIL_H_ */

View file

@ -5,18 +5,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -34,7 +43,6 @@ 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 */
@ -317,7 +325,8 @@ static mlan_wmm_ac_e wlan_wmm_eval_downgrade_ac(pmlan_private priv,
*
* @return WMM AC Queue mapping of the IP TOS field
*/
mlan_wmm_ac_e wlan_wmm_convert_tos_to_ac(pmlan_adapter pmadapter, t_u32 tos)
static INLINE mlan_wmm_ac_e wlan_wmm_convert_tos_to_ac(pmlan_adapter pmadapter,
t_u32 tos)
{
ENTER();
@ -660,18 +669,6 @@ static raListTbl *wlan_wmm_get_highest_priolist_ptr(pmlan_adapter pmadapter,
/* Ignore data pkts from a BSS if tx pause */
goto next_intf;
}
#if defined(USB)
if (!wlan_is_port_ready(pmadapter,
priv_tmp->port_index)) {
PRINTM(MINFO,
"get_highest_prio_ptr(): "
"usb port is busy,Ignore pkts from BSS%d\n",
priv_tmp->bss_index);
/* Ignore data pkts from a BSS if usb port is
* busy */
goto next_intf;
}
#endif
pmadapter->callbacks.moal_spin_lock(
pmadapter->pmoal_handle,
@ -1100,7 +1097,7 @@ static int wlan_dequeue_tx_packet(pmlan_adapter pmadapter)
pmadapter->pmoal_handle, &ptr->buf_head, MNULL, MNULL);
if (pmbuf) {
pmadapter->callbacks.moal_tp_accounting(
pmadapter->pmoal_handle, pmbuf, 3);
pmadapter->pmoal_handle, pmbuf->pdesc, 3);
if (pmadapter->tp_state_drop_point == 3) {
pmbuf = (pmlan_buffer)util_dequeue_list(
pmadapter->pmoal_handle, &ptr->buf_head,
@ -1122,7 +1119,7 @@ static int wlan_dequeue_tx_packet(pmlan_adapter pmadapter)
}
}
}
if (!ptr->is_wmm_enabled || priv->adapter->remain_on_channel ||
if (!ptr->is_wmm_enabled ||
(ptr->ba_status || ptr->del_ba_count >= DEL_BA_THRESHOLD)
#ifdef STA_SUPPORT
|| priv->wps.session_enable
@ -1148,7 +1145,7 @@ static int wlan_dequeue_tx_packet(pmlan_adapter pmadapter)
priv, tid, ptr->ra, MFALSE)) {
wlan_11n_create_txbastream_tbl(
priv, ptr->ra, tid,
BA_STREAM_SETUP_SENT_ADDBA);
BA_STREAM_SETUP_INPROGRESS);
wlan_send_addba(priv, tid, ptr->ra);
}
} else if (wlan_find_stream_to_delete(priv, ptr, tid,
@ -1160,9 +1157,6 @@ static int wlan_dequeue_tx_packet(pmlan_adapter pmadapter)
wlan_11n_create_txbastream_tbl(
priv, ptr->ra, tid,
BA_STREAM_SETUP_INPROGRESS);
wlan_11n_set_txbastream_status(
priv, tid_del, ra,
BA_STREAM_SENT_DELBA, MFALSE);
wlan_send_delba(priv, MNULL, tid_del,
ra, 1);
}
@ -1460,9 +1454,8 @@ t_u8 wlan_get_random_ba_threshold(pmlan_adapter pmadapter)
sec = (sec & 0xFFFF) + (sec >> 16);
usec = (usec & 0xFFFF) + (usec >> 16);
ba_threshold =
(t_u8)((((sec << 16) + usec) % BA_SETUP_MAX_PACKET_THRESHOLD) +
pmadapter->min_ba_threshold);
ba_threshold = (((sec << 16) + usec) % BA_SETUP_MAX_PACKET_THRESHOLD) +
pmadapter->min_ba_threshold;
PRINTM(MINFO, "pmadapter->min_ba_threshold = %d\n",
pmadapter->min_ba_threshold);
PRINTM(MINFO, "setup BA after %d packets\n", ba_threshold);
@ -1658,47 +1651,6 @@ 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
*
@ -1725,7 +1677,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_wmm_enabled(priv, ra);
ra_list->is_wmm_enabled = wlan_is_11n_enabled(priv, ra);
if (ra_list->is_wmm_enabled)
ra_list->max_amsdu =
get_station_max_amsdu_size(priv, ra);
@ -1736,7 +1688,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_wmm_enabled(priv, ra);
is_station_11n_enabled(priv, ra);
if (ra_list->is_wmm_enabled)
ra_list->max_amsdu =
get_station_max_amsdu_size(priv,
@ -1960,10 +1912,6 @@ int wlan_wmm_lists_empty(pmlan_adapter pmadapter)
}
if (priv->tx_pause)
continue;
#if defined(USB)
if (!wlan_is_port_ready(pmadapter, priv->port_index))
continue;
#endif
if (util_scalar_read(
pmadapter->pmoal_handle,
@ -2070,7 +2018,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_wmm_enabled(priv, new_ra);
wlan_is_11n_enabled(priv, new_ra);
if (ra_list->is_wmm_enabled)
ra_list->max_amsdu =
get_station_max_amsdu_size(
@ -2159,13 +2107,8 @@ t_void wlan_wmm_add_buf_txqueue(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
&priv->wmm.tid_tbl_ptr[tid_down].ra_list, MNULL,
MNULL);
} else {
if (pmbuf->flags & MLAN_BUF_FLAG_EASYMESH)
memcpy_ext(pmadapter, ra, pmbuf->mac,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
else
memcpy_ext(pmadapter, ra,
pmbuf->pbuf + pmbuf->data_offset,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
memcpy_ext(pmadapter, ra, pmbuf->pbuf + pmbuf->data_offset,
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
/** put multicast/broadcast packet in the same ralist */
if (ra[0] & 0x01)
memset(pmadapter, ra, 0xff, sizeof(ra));
@ -2173,8 +2116,6 @@ 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,
@ -2271,13 +2212,7 @@ mlan_status wlan_ret_wmm_get_status(pmlan_private priv, t_u8 *ptlv,
ENTER();
send_wmm_event = MFALSE;
if (resp_len < (int)sizeof(ptlv_hdr->header)) {
PRINTM(MINFO,
"WMM: WMM_GET_STATUS err: cmdresp low length received: %d\n",
resp_len);
LEAVE();
return MLAN_STATUS_FAILURE;
}
PRINTM(MINFO, "WMM: WMM_GET_STATUS cmdresp received: %d\n", resp_len);
HEXDUMP("CMD_RESP: WMM_GET_STATUS", pcurrent, resp_len);
@ -2304,11 +2239,6 @@ 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];
@ -2426,11 +2356,13 @@ 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_WmmParameter_t *pwmm_ie,
IEEEtypes_HTCap_t *pht_cap)
{
MrvlIEtypes_WmmParamSet_t *pwmm_tlv;
t_u32 ret_len = 0;
@ -2455,7 +2387,10 @@ 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 && pwmm_ie->vend_hdr.element_id == WMM_IE) {
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) {
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

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -166,7 +175,8 @@ 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_WmmParameter_t *pWmmIE,
IEEEtypes_HTCap_t *pHTCap);
#endif /* STA_SUPPORT */
/** setup wmm queue priorities */
@ -180,8 +190,6 @@ void wlan_wmm_setup_ac_downgrade(pmlan_private priv);
/** select WMM queue */
t_u8 wlan_wmm_select_queue(mlan_private *pmpriv, t_u8 tid);
t_void wlan_wmm_delete_peer_ralist(pmlan_private priv, t_u8 *mac);
/** Convert the IP TOS to an WMM AC Queue assignment */
mlan_wmm_ac_e wlan_wmm_convert_tos_to_ac(pmlan_adapter pmadapter, t_u32 tos);
#ifdef STA_SUPPORT
/*

View file

@ -6,18 +6,27 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/

View file

@ -5,18 +5,27 @@
*
* 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -24,7 +33,7 @@
#define _MLAN_DECL_H_
/** MLAN release version */
#define MLAN_RELEASE_VERSION "408.p2"
#define MLAN_RELEASE_VERSION "322.p3"
/** Re-define generic data types for MLAN/MOAL */
/** Signed char (1-byte) */
@ -129,8 +138,13 @@ 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
@ -157,10 +171,6 @@ typedef t_s32 t_sval;
/** This is current limit on Maximum Rx AMPDU allowed */
#define MLAN_MAX_RX_BASTREAM_SUPPORTED 16
#ifndef UINT_MAX
#define UINT_MAX (~0U)
#endif
#ifdef STA_SUPPORT
/** Default Win size attached during ADDBA request */
#define MLAN_STA_AMPDU_DEF_TXWINSIZE 64
@ -266,17 +276,12 @@ typedef t_s32 t_sval;
#define FW_RELOAD_NO_EMULATION 2
/** out band reset with interface re-emulation */
#define FW_RELOAD_WITH_EMULATION 3
#ifdef PCIE
/** pcie card reset */
#define FW_RELOAD_PCIE_RESET 4
/** sdio hw reset */
#define FW_RELOAD_SDIO_HW_RESET 5
/** pcie inband reset */
#define FW_RELOAD_PCIE_INBAND_RESET 6
#ifdef PCIE
/* Interrupt type */
enum { RX_DATA, RX_EVENT, TX_COMPLETE, RX_CMD_RESP };
#endif
#define FW_RELOAD_SDIO_HW_RESET 5
#ifdef USB
#define MLAN_USB_BLOCK_SIZE (512)
#define MLAN_USB_AGGR_MODE_NUM (0)
@ -382,9 +387,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** 8801 card type */
#define CARD_TYPE_8801 0x0a
/** OWL card type */
#define CARD_TYPE_IW624 0x0b
/** Black bird card type */
#define CARD_TYPE_AW693 0x0c
#define CARD_TYPE_NW62X 0x0b
/** 9098 A0 reverion num */
#define CHIP_9098_REV_A0 1
@ -416,10 +419,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define CARD_TYPE_SD9177 (CARD_TYPE_9177 | (INTF_SD << 8))
/** SD8801 card type */
#define CARD_TYPE_SD8801 (CARD_TYPE_8801 | (INTF_SD << 8))
/** SD_IW624 card type */
#define CARD_TYPE_SDIW624 (CARD_TYPE_IW624 | (INTF_SD << 8))
/** SD_IW624 card type */
#define CARD_TYPE_SDAW693 (CARD_TYPE_AW693 | (INTF_SD << 8))
/** SD_NW62X card type */
#define CARD_TYPE_SDNW62X (CARD_TYPE_NW62X | (INTF_SD << 8))
#define IS_SD8887(ct) (CARD_TYPE_SD8887 == (ct))
#define IS_SD8897(ct) (CARD_TYPE_SD8897 == (ct))
@ -431,8 +432,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define IS_SD9098(ct) (CARD_TYPE_SD9098 == (ct))
#define IS_SD9177(ct) (CARD_TYPE_SD9177 == (ct))
#define IS_SD8801(ct) (CARD_TYPE_SD8801 == (ct))
#define IS_SDIW624(ct) (CARD_TYPE_SDIW624 == (ct))
#define IS_SDAW693(ct) (CARD_TYPE_SDAW693 == (ct))
#define IS_SDNW62X(ct) (CARD_TYPE_SDNW62X == (ct))
/** SD8887 Card */
#define CARD_SD8887 "SD8887"
@ -441,7 +441,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** SD8977 Card */
#define CARD_SD8977 "SD8977"
/** SD8978 Card */
#define CARD_SD8978 "SDIW416"
#define CARD_SD8978 "SD8978"
/** SD8997 Card */
#define CARD_SD8997 "SD8997"
/** SD8987 Card */
@ -451,13 +451,11 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** SD9098 Card */
#define CARD_SD9098 "SD9098"
/** SD9177 Card */
#define CARD_SD9177 "SDIW612"
#define CARD_SD9177 "SD9177"
/** SD8801 Card */
#define CARD_SD8801 "SD8801"
/** SDIW624 Card */
#define CARD_SDIW624 "SDIW624"
/** SDAW693 Card */
#define CARD_SDAW693 "SDAW693"
/** SDNW62X Card */
#define CARD_SDNW62X "SDNW62X"
#endif
#ifdef PCIE
@ -469,17 +467,14 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define CARD_TYPE_PCIE9097 (CARD_TYPE_9097 | (INTF_PCIE << 8))
/** PCIE9098 card type */
#define CARD_TYPE_PCIE9098 (CARD_TYPE_9098 | (INTF_PCIE << 8))
/** PCIEIW624 card type */
#define CARD_TYPE_PCIEIW624 (CARD_TYPE_IW624 | (INTF_PCIE << 8))
/** PCIEAW693 card type */
#define CARD_TYPE_PCIEAW693 (CARD_TYPE_AW693 | (INTF_PCIE << 8))
/** PCIENW62X card type */
#define CARD_TYPE_PCIENW62X (CARD_TYPE_NW62X | (INTF_PCIE << 8))
#define IS_PCIE8897(ct) (CARD_TYPE_PCIE8897 == (ct))
#define IS_PCIE8997(ct) (CARD_TYPE_PCIE8997 == (ct))
#define IS_PCIE9097(ct) (CARD_TYPE_PCIE9097 == (ct))
#define IS_PCIE9098(ct) (CARD_TYPE_PCIE9098 == (ct))
#define IS_PCIEIW624(ct) (CARD_TYPE_PCIEIW624 == (ct))
#define IS_PCIEAW693(ct) (CARD_TYPE_PCIEAW693 == (ct))
#define IS_PCIENW62X(ct) (CARD_TYPE_PCIENW62X == (ct))
/** PCIE8897 Card */
#define CARD_PCIE8897 "PCIE8897"
@ -493,12 +488,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define CARD_PCIE9098 "PCIE9098"
/** PCIEAW690 Card */
#define CARD_PCIEAW690 "PCIEAW690"
/** PCIEIW624 Card */
#define CARD_PCIEIW624 "PCIEIW624"
/** PCIEAW693 Card */
#define CARD_PCIEAW693 "PCIEAW693"
/** PCIEIW629 Card */
#define CARD_PCIEIW629 "PCIEIW629"
/** PCIENW62X Card */
#define CARD_PCIENW62X "PCIENW62X"
#endif
#ifdef USB
@ -514,8 +505,8 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define CARD_TYPE_USB9098 (CARD_TYPE_9098 | (INTF_USB << 8))
/** USB9097 card type */
#define CARD_TYPE_USB9097 (CARD_TYPE_9097 | (INTF_USB << 8))
/** USBIW624 card type */
#define CARD_TYPE_USBIW624 (CARD_TYPE_IW624 | (INTF_USB << 8))
/** USBNW62X card type */
#define CARD_TYPE_USBNW62X (CARD_TYPE_NW62X | (INTF_USB << 8))
#define IS_USB8801(ct) (CARD_TYPE_USB8801 == (ct))
#define IS_USB8897(ct) (CARD_TYPE_USB8897 == (ct))
@ -523,7 +514,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define IS_USB8978(ct) (CARD_TYPE_USB8978 == (ct))
#define IS_USB9098(ct) (CARD_TYPE_USB9098 == (ct))
#define IS_USB9097(ct) (CARD_TYPE_USB9097 == (ct))
#define IS_USBIW624(ct) (CARD_TYPE_USBIW624 == (ct))
#define IS_USBNW62X(ct) (CARD_TYPE_USBNW62X == (ct))
/** USB8801 Card */
#define CARD_USB8801 "USB8801"
@ -532,13 +523,13 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** USB8997 Card */
#define CARD_USB8997 "USB8997"
/** USB8978 Card */
#define CARD_USB8978 "USBIW416"
#define CARD_USB8978 "USB8978"
/** USB9098 Card */
#define CARD_USB9098 "USB9098"
/** USB9097 Card */
#define CARD_USB9097 "USBIW620"
/** USBIW624 Card */
#define CARD_USBIW624 "USBIW624"
/** USBNW62X Card */
#define CARD_USBNW62X "USBNW62X"
#endif
#define IS_CARD8801(ct) (CARD_TYPE_8801 == ((ct)&0xf))
@ -550,8 +541,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
#define IS_CARD9098(ct) (CARD_TYPE_9098 == ((ct)&0xf))
#define IS_CARD9097(ct) (CARD_TYPE_9097 == ((ct)&0xf))
#define IS_CARD9177(ct) (CARD_TYPE_9177 == ((ct)&0xf))
#define IS_CARDIW624(ct) (CARD_TYPE_IW624 == ((ct)&0xf))
#define IS_CARDAW693(ct) (CARD_TYPE_AW693 == ((ct)&0xf))
#define IS_CARDNW62X(ct) (CARD_TYPE_NW62X == ((ct)&0xf))
typedef struct _card_type_entry {
t_u16 card_type;
@ -621,8 +611,6 @@ typedef enum {
#define MLAN_BUF_FLAG_TX_CTRL MBIT(14)
#define MLAN_BUF_FLAG_EASYMESH MBIT(16)
#define MLAN_BUF_FLAG_MC_AGGR_PKT MBIT(17)
#ifdef DEBUG_LEVEL1
@ -653,8 +641,6 @@ 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
@ -709,21 +695,10 @@ typedef enum _mlan_buf_type {
MLAN_BUF_TYPE_EVENT,
MLAN_BUF_TYPE_RAW_DATA,
#ifdef SDIO
MLAN_BUF_TYPE_SPA_DATA,
#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 {
@ -845,19 +820,11 @@ typedef enum _mlan_event_id {
MLAN_EVENT_ID_DRV_UAP_CHAN_INFO = 0x80000020,
#endif
MLAN_EVENT_ID_FW_ROAM_OFFLOAD_RESULT = 0x80000023,
MLAN_EVENT_ID_DRV_RTT_RESULT = 0x80000025,
MLAN_EVENT_ID_DRV_ASSOC_FAILURE_LOGGER = 0x80000026,
MLAN_EVENT_ID_DRV_ASSOC_SUCC_LOGGER = 0x80000027,
MLAN_EVENT_ID_DRV_DISCONNECT_LOGGER = 0x80000028,
MLAN_EVENT_ID_DRV_WIFI_STATUS = 0x80000029,
MLAN_EVENT_ID_STORE_HOST_CMD_RESP = 0x80000030,
MLAN_EVENT_ID_DRV_ADDBA_TIMEOUT = 0x80000031,
#ifdef PCIE
MLAN_EVENT_ID_DRV_DEFER_RX_DATA = 0x80000032,
MLAN_EVENT_ID_DRV_DEFER_RX_EVENT = 0x80000033,
MLAN_EVENT_ID_DRV_DEFER_CMDRESP = 0x80000034,
MLAN_EVENT_ID_DRV_DEFER_TX_COMPLTE = 0x80000035,
#endif
} mlan_event_id;
/** Data Structures */
@ -938,8 +905,8 @@ enum mlan_channel_type {
/** channel band */
enum { BAND_2GHZ = 0,
BAND_5GHZ = 1,
BAND_6GHZ = 2,
BAND_4GHZ = 3,
BAND_4GHZ = 2,
BAND_6GHZ = 3,
};
/** channel offset */
@ -988,27 +955,9 @@ 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 Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */
t_u8 chanWidth : 2;
/** Band Info - (00)=2.4GHz, (01)=5GHz, (10)=6GHz */
t_u8 chanBand : 2;
/** 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;
#else
/** Band Info - (00)=2.4GHz, (01)=5GHz, (10)=6GHz */
/** Band Info - (00)=2.4GHz, (01)=5GHz */
t_u8 chanBand : 2;
/** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */
t_u8 chanWidth : 2;
@ -1016,7 +965,6 @@ 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 */
@ -1183,10 +1131,6 @@ typedef MLAN_PACK_START struct _mix_rate_info {
t_u8 mcs_index;
/** bitrate, in 500Kbps */
t_u16 bitrate;
/** NSS */
t_u8 nss_index;
/** DCM */
t_u8 dcm;
} MLAN_PACK_END mix_rate_info, *pmix_rate_info;
typedef MLAN_PACK_START struct _rxpd_extra_info {
@ -1198,12 +1142,10 @@ typedef MLAN_PACK_START struct _rxpd_extra_info {
t_u8 mcs_known;
/** mcs.flags */
t_u8 mcs_flags;
/** vht/he sig1 */
t_u32 vht_he_sig1;
/** vht/he sig2 */
t_u32 vht_he_sig2;
/** HE user idx */
t_u32 user_idx;
/** vht sig1 */
t_u32 vht_sig1;
/** vht sig2 */
t_u32 vht_sig2;
} MLAN_PACK_END rxpd_extra_info, *prxpd_extra_info;
typedef MLAN_PACK_START struct _radiotap_info {
@ -1224,16 +1166,6 @@ 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] */
@ -1242,7 +1174,6 @@ 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 {
@ -1337,8 +1268,6 @@ typedef struct _mlan_buffer {
t_u32 extra_ts_sec;
/** Time stamp when packet is dequed from rx_q(micro seconds) */
t_u32 extra_ts_usec;
/** When TX ra mac address, When Rx Ta mac address*/
t_u8 mac[MLAN_MAC_ADDR_LENGTH];
/** Fields below are valid for MLAN module only */
/** Pointer to parent mlan_buffer */
struct _mlan_buffer *pparent;
@ -1729,14 +1658,6 @@ typedef struct _tdls_tear_down_event {
t_u16 reason_code;
} tdls_tear_down_event;
/** Event structure for addba timeout */
typedef struct _addba_timeout_event {
/** Peer mac address */
t_u8 peer_mac_addr[MLAN_MAC_ADDR_LENGTH];
/** Tid */
t_u8 tid;
} addba_timeout_event;
/** channel width */
typedef enum wifi_channel_width {
WIFI_CHAN_WIDTH_20 = 0,
@ -1794,15 +1715,6 @@ typedef struct {
t_u32 time_usec;
} wifi_timeval;
#define timeval_to_msec(timeval) \
(t_u64)((t_u64)(timeval.time_sec) * 1000 + \
(t_u64)(timeval.time_usec) / 1000)
#define timeval_to_usec(timeval) \
(t_u64)((t_u64)(timeval.time_sec) * 1000 * 1000 + \
(t_u64)(timeval.time_usec))
#define is_zero_timeval(timeval) \
((timeval.time_sec == 0) && (timeval.time_usec == 0))
#define MAX_NUM_RATE 32
#define MAX_RADIO 2
#define MAX_NUM_CHAN 1
@ -1884,6 +1796,15 @@ typedef struct {
t_u32 cca_busy_time;
} wifi_channel_stat;
#define timeval_to_msec(timeval) \
(t_u64)((t_u64)(timeval.time_sec) * 1000 + \
(t_u64)(timeval.time_usec) / 1000)
#define timeval_to_usec(timeval) \
(t_u64)((t_u64)(timeval.time_sec) * 1000 * 1000 + \
(t_u64)(timeval.time_usec))
#define is_zero_timeval(timeval) \
((timeval.time_sec == 0) && (timeval.time_usec == 0))
/** radio statistics */
typedef struct {
/** wifi radio (if multiple radio supported) */
@ -2077,320 +1998,9 @@ typedef struct {
0x00000080 /** all contention (min, max, avg) statistics (within ac \
statisctics) */
/** =========== Define Copied from HAL START =========== */
/** Ranging status */
typedef enum {
RTT_STATUS_SUCCESS = 0,
/** general failure status */
RTT_STATUS_FAILURE = 1,
/** target STA does not respond to request */
RTT_STATUS_FAIL_NO_RSP = 2,
/** request rejected. Applies to 2-sided RTT only */
RTT_STATUS_FAIL_REJECTED = 3,
RTT_STATUS_FAIL_NOT_SCHEDULED_YET = 4,
/** timing measurement times out */
RTT_STATUS_FAIL_TM_TIMEOUT = 5,
/** Target on different channel, cannot range */
RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL = 6,
/** ranging not supported */
RTT_STATUS_FAIL_NO_CAPABILITY = 7,
/** request aborted for unknown reason */
RTT_STATUS_ABORTED = 8,
/** Invalid T1-T4 timestamp */
RTT_STATUS_FAIL_INVALID_TS = 9,
/** 11mc protocol failed */
RTT_STATUS_FAIL_PROTOCOL = 10,
/** request could not be scheduled */
RTT_STATUS_FAIL_SCHEDULE = 11,
/** responder cannot collaborate at time of request */
RTT_STATUS_FAIL_BUSY_TRY_LATER = 12,
/** bad request args */
RTT_STATUS_INVALID_REQ = 13,
/** WiFi not enabled */
RTT_STATUS_NO_WIFI = 14,
/** Responder overrides param info, cannot range with new params */
RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE = 15
} wifi_rtt_status;
/** RTT peer type */
typedef enum {
RTT_PEER_AP = 0x1,
RTT_PEER_STA = 0x2,
RTT_PEER_P2P_GO = 0x3,
RTT_PEER_P2P_CLIENT = 0x4,
RTT_PEER_NAN = 0x5
} rtt_peer_type;
/** RTT Measurement Bandwidth */
typedef enum {
WIFI_RTT_BW_5 = 0x01,
WIFI_RTT_BW_10 = 0x02,
WIFI_RTT_BW_20 = 0x04,
WIFI_RTT_BW_40 = 0x08,
WIFI_RTT_BW_80 = 0x10,
WIFI_RTT_BW_160 = 0x20
} wifi_rtt_bw;
/** RTT Type */
typedef enum {
RTT_TYPE_1_SIDED = 0x1,
RTT_TYPE_2_SIDED = 0x2,
} wifi_rtt_type;
/** RTT configuration */
typedef struct {
/** peer device mac address */
t_u8 addr[MLAN_MAC_ADDR_LENGTH];
/** 1-sided or 2-sided RTT */
wifi_rtt_type type;
/** optional - peer device hint (STA, P2P, AP) */
rtt_peer_type peer;
/** Required for STA-AP mode, optional for P2P, NBD etc. */
wifi_channel_info channel;
/** Time interval between bursts (units: 100 ms).
* Applies to 1-sided and 2-sided RTT multi-burst requests.
* Range: 0-31, 0: no preference by initiator (2-sided RTT) */
t_u32 burst_period;
/** Total number of RTT bursts to be executed. It will be
* specified in the same way as the parameter "Number of
* Burst Exponent" found in the FTM frame format. It
* applies to both: 1-sided RTT and 2-sided RTT. Valid
* values are 0 to 15 as defined in 802.11mc std.
* 0 means single shot
* The implication of this parameter on the maximum
* number of RTT results is the following:
* for 1-sided RTT: max num of RTT results =
* (2^num_burst)*(num_frames_per_burst)
* for 2-sided RTT: max num of RTT results =
* (2^num_burst)*(num_frames_per_burst - 1) */
t_u32 num_burst;
/** num of frames per burst. Minimum value = 1, Maximum value = 31
* For 2-sided this equals the number of FTM frames to be attempted in a
* single burst. This also equals the number of FTM frames that the
* initiator will request that the responder send in a single frame. */
t_u32 num_frames_per_burst;
/** number of retries for a failed RTT frame. Applies
* to 1-sided RTT only. Minimum value = 0, Maximum value = 3 */
t_u32 num_retries_per_rtt_frame;
/** following fields are only valid for 2-side RTT */
/** Maximum number of retries that the initiator can retry an FTMR
* frame. Minimum value = 0, Maximum value = 3 */
t_u32 num_retries_per_ftmr;
/** 1: request LCI, 0: do not request LCI */
t_u8 LCI_request;
/** 1: request LCR, 0: do not request LCR */
t_u8 LCR_request;
/** Applies to 1-sided and 2-sided RTT. Valid values will
* be 2-11 and 15 as specified by the 802.11mc std for
* the FTM parameter burst duration. In a multi-burst
* request, if responder overrides with larger value,
* the initiator will return failure. In a single-burst
* request if responder overrides with larger value,
* the initiator will sent TMR_STOP to terminate RTT
* at the end of the burst_duration it requested. */
t_u32 burst_duration;
/** RTT preamble to be used in the RTT frames */
wifi_preamble preamble;
/** RTT BW to be used in the RTT frames */
wifi_rtt_bw bw;
} wifi_rtt_config;
/** Format of information elements found in the beacon */
typedef struct {
/** element identifier */
t_u8 id;
/** number of bytes to follow */
t_u8 len;
t_u8 data[];
} wifi_information_element;
/** RTT results */
typedef struct {
/** device mac address */
t_u8 addr[MLAN_MAC_ADDR_LENGTH];
/** burst number in a multi-burst request */
t_u32 burst_num;
/** Total RTT measurement frames attempted */
t_u32 measurement_number;
/** Total successful RTT measurement frames */
t_u32 success_number;
/** Maximum number of "FTM frames per burst" supported by
* the responder STA. Applies to 2-sided RTT only.
* If reponder overrides with larger value:
* - for single-burst request initiator will truncate the
* larger value and send a TMR_STOP after receiving as
* many frames as originally requested.
* - for multi-burst request, initiator will return
* failure right away */
t_u8 number_per_burst_peer;
/** ranging status */
wifi_rtt_status status;
/** When status == RTT_STATUS_FAIL_BUSY_TRY_LATER,
* this will be the time provided by the responder as to
* when the request can be tried again. Applies to 2-sided
* RTT only. In sec, 1-31sec. */
t_u8 retry_after_duration;
/** RTT type */
wifi_rtt_type type;
/** average rssi in 0.5 dB steps e.g. 143 implies -71.5 dB */
int rssi;
/** rssi spread in 0.5 dB steps e.g. 5 implies 2.5 dB spread (optional)
*/
int rssi_spread;
/** 1-sided RTT: TX rate of RTT frame.
* 2-sided RTT: TX rate of initiator's Ack in response to FTM frame. */
wifi_rate tx_rate;
/** 1-sided RTT: TX rate of Ack from other side.
* 2-sided RTT: TX rate of FTM frame coming from responder. */
wifi_rate rx_rate;
/** round trip time in picoseconds */
t_s64 rtt;
/** rtt standard deviation in picoseconds */
t_s64 rtt_sd;
/** difference between max and min rtt times recorded in picoseconds */
t_s64 rtt_spread;
/** distance in mm (optional) */
int distance_mm;
/** standard deviation in mm (optional) */
int distance_sd_mm;
/** difference between max and min distance recorded in mm (optional) */
int distance_spread_mm;
/** time of the measurement (in microseconds since boot) */
t_s64 ts;
/** in ms, actual time taken by the FW to finish one burst
* measurement. Applies to 1-sided and 2-sided RTT. */
int burst_duration;
/** Number of bursts allowed by the responder. Applies
* to 2-sided RTT only. */
int negotiated_burst_num;
/** for 11mc only */
wifi_information_element *LCI;
/** for 11mc only */
wifi_information_element *LCR;
} wifi_rtt_result;
/** Preamble definition for bit mask used in wifi_rtt_capabilities */
#define PREAMBLE_LEGACY 0x1
#define PREAMBLE_HT 0x2
#define PREAMBLE_VHT 0x4
/** BW definition for bit mask used in wifi_rtt_capabilities */
#define BW_5_SUPPORT 0x1
#define BW_10_SUPPORT 0x2
#define BW_20_SUPPORT 0x4
#define BW_40_SUPPORT 0x8
#define BW_80_SUPPORT 0x10
#define BW_160_SUPPORT 0x20
/** RTT Capabilities */
typedef struct {
/** if 1-sided rtt data collection is supported */
t_u8 rtt_one_sided_supported;
/** if ftm rtt data collection is supported */
t_u8 rtt_ftm_supported;
/** if initiator supports LCI request. Applies to 2-sided RTT */
t_u8 lci_support;
/** if initiator supports LCR request. Applies to 2-sided RTT */
t_u8 lcr_support;
/** bit mask indicates what preamble is supported by initiator */
t_u8 preamble_support;
/** bit mask indicates what BW is supported by initiator */
t_u8 bw_support;
/** if 11mc responder mode is supported */
t_u8 responder_supported;
/** draft 11mc spec version supported by chip. For instance,
* version 4.0 should be 40 and version 4.3 should be 43 etc. */
t_u8 mc_version;
} wifi_rtt_capabilities;
/** API for setting LCI/LCR information to be provided to a requestor */
typedef enum {
/** Not expected to change location */
WIFI_MOTION_NOT_EXPECTED = 0,
/** Expected to change location */
WIFI_MOTION_EXPECTED = 1,
/** Movement pattern unknown */
WIFI_MOTION_UNKNOWN = 2,
} wifi_motion_pattern;
/** LCI information */
typedef struct {
/** latitude in degrees * 2^25 , 2's complement */
long latitude;
/** latitude in degrees * 2^25 , 2's complement */
long longitude;
/** Altitude in units of 1/256 m */
int altitude;
/** As defined in Section 2.3.2 of IETF RFC 6225 */
t_u8 latitude_unc;
/** As defined in Section 2.3.2 of IETF RFC 6225 */
t_u8 longitude_unc;
/** As defined in Section 2.4.5 from IETF RFC 6225: */
t_u8 altitude_unc;
/** Following element for configuring the Z subelement */
wifi_motion_pattern motion_pattern;
/** floor in units of 1/16th of floor. 0x80000000 if unknown. */
int floor;
/** in units of 1/64 m */
int height_above_floor;
/** in units of 1/64 m. 0 if unknown */
int height_unc;
} wifi_lci_information;
/** LCR information */
typedef struct {
/** country code */
char country_code[2];
/** length of the info field */
int length;
/** Civic info to be copied in FTM frame */
char civic_info[256];
} wifi_lcr_information;
/**
* RTT Responder information
*/
typedef struct {
wifi_channel_info channel;
wifi_preamble preamble;
} wifi_rtt_responder;
/** =========== Define Copied from HAL END =========== */
#define MAX_RTT_CONFIG_NUM 10
/** RTT config params */
typedef struct wifi_rtt_config_params {
t_u8 rtt_config_num;
wifi_rtt_config rtt_config[MAX_RTT_CONFIG_NUM];
} wifi_rtt_config_params_t;
#define OID_RTT_REQUEST 0
#define OID_RTT_CANCEL 1
/** Pass RTT result element between mlan and moal */
typedef struct {
/** element identifier */
t_u16 id;
/** number of bytes to follow */
t_u16 len;
/** data: fill with one wifi_rtt_result */
t_u8 data[];
} wifi_rtt_result_element;
/** 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
@ -2538,6 +2148,12 @@ typedef struct _mlan_callbacks {
t_void (*moal_updata_peer_signal)(t_void *pmoal, t_u32 bss_index,
t_u8 *peer_addr, t_s8 snr, t_s8 nflr);
t_u64 (*moal_do_div)(t_u64 num, t_u32 base);
#if defined(DRV_EMBEDDED_AUTHENTICATOR) || defined(DRV_EMBEDDED_SUPPLICANT)
mlan_status (*moal_wait_hostcmd_complete)(t_void *pmoal,
t_u32 bss_index);
mlan_status (*moal_notify_hostcmd_complete)(t_void *pmoal,
t_u32 bss_index);
#endif
void (*moal_tp_accounting)(t_void *pmoal, t_void *buf,
t_u32 drop_point);
void (*moal_tp_accounting_rx_param)(t_void *pmoal, unsigned int type,
@ -2626,6 +2242,8 @@ typedef struct _mlan_device {
/** SDIO MPA Rx */
t_u32 mpa_rx_cfg;
#ifdef SDIO
/** SDIO Single port rx aggr */
t_u8 sdio_rx_aggr_enable;
/* see blk_queue_max_segment_size */
t_u32 max_seg_size;
/* see blk_queue_max_segments */
@ -2663,8 +2281,6 @@ typedef struct _mlan_device {
t_u8 indication_gpio;
/** Dynamic MIMO-SISO switch for hscfg*/
t_u8 hs_mimo_switch;
/** channel time and mode for DRCS*/
t_u32 drcs_chantime_mode;
#ifdef USB
/** Tx CMD endpoint address */
t_u8 tx_cmd_ep;
@ -2675,8 +2291,6 @@ typedef struct _mlan_device {
t_u8 rx_data_ep;
/** Tx data endpoint address */
t_u8 tx_data_ep;
/** Tx data second endpoint address */
t_u8 tx_data2_ep;
#endif
/** passive to active scan */
t_u8 passive_to_active_scan;
@ -2686,16 +2300,8 @@ 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;
/** second mac flag */
t_u8 second_mac;
/** napi */
t_u8 napi;
} mlan_device, *pmlan_device;
/** MLAN API function prototype */
@ -2776,9 +2382,6 @@ MLAN_API t_u8 mlan_select_wmm_queue(t_void *padapter, t_u8 bss_num, t_u8 tid);
MLAN_API mlan_status mlan_disable_host_int(t_void *padapter);
/** mlan unmask host interrupt */
MLAN_API mlan_status mlan_enable_host_int(t_void *padapter);
#ifdef PCIE
MLAN_API void mlan_process_pcie_interrupt_cb(t_void *pmadapter, int type);
#endif
#define CSI_SIGNATURE 0xABCD

View file

@ -4,20 +4,29 @@
* definitions used in MLAN and MOAL module.
*
*
* Copyright 2008-2023 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's
* prior express written permission.
*
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
* 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.
*
*/
@ -46,17 +55,10 @@ 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 0x0c00
/** 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)
@ -90,8 +92,6 @@ typedef MLAN_PACK_START enum _IEEEtypes_ElementId_e {
EXTEND_CHANNEL_SWITCH_ANN = 60,
QUIET = 40,
IBSS_DFS = 41,
MEASUREMENT_REQUEST = 38,
MEASUREMENT_REPORT = 39,
SUPPORTED_CHANNELS = 36,
REGULATORY_CLASS = 59,
HT_CAPABILITY = 45,
@ -179,50 +179,14 @@ typedef MLAN_PACK_START struct _IEEEtypes_Generic_t {
t_u8 data[IEEE_MAX_IE_SIZE - sizeof(IEEEtypes_Header_t)];
} MLAN_PACK_END IEEEtypes_Generic_t, *pIEEEtypes_Generic_t;
#define MEASURE_TYPE_CLI 8
#define MEASURE_TYPE_LOCATION_CIVIC 9
/** Measurement Report IE */
typedef MLAN_PACK_START struct _IEEEtypes_MeasurementReport_t {
/** Generic IE header */
IEEEtypes_Header_t ieee_hdr;
/** Measurement Token */
t_u8 ms_token;
/** Measurement Report Mode */
t_u8 ms_rp_mode;
/** Measurement Type, value in MEASURE_TYPE_XXX */
t_u8 ms_type;
/** variable */
t_u8 variable[];
} MLAN_PACK_END IEEEtypes_MeasurementReport_t;
/** Report */
typedef MLAN_PACK_START struct _IEEEtypes_Report_t {
/** Subelement ID */
t_u8 subelement_id;
/** length */
t_u8 length;
/** variable */
t_u8 variable[];
} MLAN_PACK_END IEEEtypes_Report_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 */
@ -355,25 +319,6 @@ 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;
@ -406,7 +351,6 @@ 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 {
@ -621,35 +565,16 @@ 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 */
@ -658,22 +583,14 @@ 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 */
@ -761,22 +678,6 @@ 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 */
@ -791,31 +692,19 @@ 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 */
@ -1156,26 +1045,6 @@ 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;
@ -1194,7 +1063,6 @@ 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;
@ -1303,24 +1171,6 @@ 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 */
@ -1337,7 +1187,6 @@ 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 {
@ -1364,59 +1213,29 @@ 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
/** Default PE Duration */
t_u16 default_pe_dur : 3; /* bit 0-2 */
/** TWT Required */
t_u16 twt_req : 1; /* bit 3 */
/** TXOP Duration RTS Threshold */
t_u16 txop_dur_rts_threshold : 10; /* bit 4-13 */
/** VHT Operation Info Present */
t_u16 vht_op_info_present : 1; /* bit 14 */
/** Co-Hosted BSS */
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 : 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 */
t_u16 twt_req : 1; /* bit 3 */
/** TXOP Duration RTS Threshold */
t_u16 txop_dur_rts_threshold : 10; /* bit 4-13 */
/** VHT Operation Info Present */
t_u16 vht_op_info_present : 1; /* bit 14 */
/** Co-Hosted BSS */
t_u16 co_located_bss : 1; /* bit 15 */
/** ER SU Disable */
t_u8 er_su_disable : 1; /* bit 16 */
/* 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
t_u8 reserved : 7; /* bit 17-23 */
} 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 {
@ -1578,20 +1397,6 @@ 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 */
@ -1604,7 +1409,6 @@ typedef MLAN_PACK_START struct {
t_u8 unmeasured : 1;
/**< Reserved */
t_u8 rsvd5_7 : 3;
#endif /* BIG_ENDIAN_SUPPORT */
} MLAN_PACK_END MeasRptBasicMap_t;
@ -1747,8 +1551,8 @@ typedef MLAN_PACK_START struct _wlan_user_scan_chan {
t_u8 radio_type;
/** Scan type: Active = 1, Passive = 2 */
t_u8 scan_type;
/** rnr_flag */
t_u8 rnr_flag;
/** Reserved */
t_u8 reserved;
/** Scan duration in milliseconds; if 0 default used */
t_u32 scan_time;
} MLAN_PACK_END wlan_user_scan_chan;
@ -1840,8 +1644,6 @@ 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*/
@ -1863,15 +1665,9 @@ typedef MLAN_PACK_START struct {
#define BG_SCAN_SSID_RSSI_MATCH 0x0004
/**wait for all channel scan to complete to report scan result*/
#define BG_SCAN_WAIT_ALL_CHAN_DONE 0x80000000
#define CHAN_MAX_6G 0
/** max bgscan chan number */
/** Maximum number of channels that can be sent in bg scan config */
#define WLAN_BG_SCAN_CHAN_MAX 38
/** max bgscan chan number, include UNII_4 channel */
#define WLAN_BG_SCAN_CHAN_MAX_UNII_4 41
/** Enumeration definition */
/** EES MODE */
typedef enum {
@ -1938,7 +1734,7 @@ typedef MLAN_PACK_START struct {
/** SSID filter list used in the to limit the scan results */
wlan_user_scan_ssid ssid_list[MRVDRV_MAX_SSID_LIST_LENGTH];
/** Variable number (fixed maximum) of channels to scan up */
wlan_user_scan_chan chan_list[WLAN_USER_SCAN_CHAN_MAX];
wlan_user_scan_chan chan_list[WLAN_BG_SCAN_CHAN_MAX];
/** scan channel gap */
t_u16 scan_chan_gap;
/** Enable EES configuration */
@ -1971,11 +1767,6 @@ typedef MLAN_PACK_START struct {
} MLAN_PACK_END wlan_bgscan_cfg;
#endif /* STA_SUPPORT */
/** The open AP in OWE transmition Mode */
#define OWE_TRANS_MODE_OPEN 1
/** The security AP in OWE trsnsition Mode */
#define OWE_TRANS_MODE_OWE 2
#ifdef PRAGMA_PACK
#pragma pack(pop)
#endif
@ -1990,15 +1781,6 @@ typedef struct _BSSDescriptor_t {
/** SSID */
mlan_802_11_ssid ssid;
/** Transition MAC address */
mlan_802_11_mac_addr trans_mac_address;
/** Transition SSID */
mlan_802_11_ssid trans_ssid;
/** OWE Transition mode */
t_u8 owe_transition_mode;
/** WEP encryption requirement */
t_u32 privacy;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -5,18 +5,26 @@
*
* Copyright 2011-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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
@ -58,6 +66,7 @@
/* define for custom ie operation */
#define MLAN_CUSTOM_IE_AUTO_IDX_MASK 0xffff
#define MLAN_CUSTOM_IE_NEW_MASK 0x8000
#define IE_MASK_WPS 0x0001
#define IE_MASK_P2P 0x0002
#define IE_MASK_WFD 0x0004
@ -66,10 +75,6 @@
#define MRVL_PKT_TYPE_MGMT_FRAME 0xE5
#if defined(UAP_CFG80211) || defined(STA_CFG80211)
#define MRVL_PKT_TYPE_MGMT_EASYMESH 0xCF
#endif
mlan_status woal_cfg80211_set_key(moal_private *priv, t_u8 is_enable_wep,
t_u32 cipher, const t_u8 *key, int key_len,
const t_u8 *seq, int seq_len, t_u8 key_index,
@ -118,7 +123,6 @@ 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,
@ -131,9 +135,6 @@ 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 ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index,
#if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE
bool pairwise,
@ -141,9 +142,6 @@ 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 ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index,
#if KERNEL_VERSION(2, 6, 36) < CFG80211_VERSION_CODE
bool pairwise,
@ -165,10 +163,6 @@ 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 || \
IMX_ANDROID_12_BACKPORT)
unsigned int link_id,
#endif
const u8 *peer,
const struct cfg80211_bitrate_mask *mask);
#if KERNEL_VERSION(2, 6, 38) <= CFG80211_VERSION_CODE
@ -217,9 +211,6 @@ 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 ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || 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,
@ -229,18 +220,12 @@ 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 ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || 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 ((KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE) || IMX_ANDROID_13)
int link_id,
#endif
t_u8 key_index);
#endif
@ -286,6 +271,10 @@ 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;
@ -297,11 +286,6 @@ 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,
@ -445,13 +429,7 @@ 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 || \
IMX_ANDROID_12_BACKPORT)
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);
@ -496,6 +474,7 @@ 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
@ -506,9 +485,7 @@ 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,
@ -519,8 +496,6 @@ mlan_status woal_chandef_create(moal_private *priv,
#if KERNEL_VERSION(4, 20, 0) <= CFG80211_VERSION_CODE
void woal_cfg80211_setup_he_cap(moal_private *priv,
struct ieee80211_supported_band *band);
#else
void woal_cfg80211_setup_uap_he_cap(moal_private *priv, t_u8 wait_option);
#endif
void woal_cfg80211_free_bands(struct wiphy *wiphy);
@ -537,8 +512,7 @@ int woal_cfg80211_mgmt_frame_ie(
int woal_get_active_intf_freq(moal_private *priv);
void woal_cfg80211_setup_ht_cap(struct ieee80211_sta_ht_cap *ht_info,
t_u32 dev_cap, t_u8 *mcs_set,
t_u8 mpdu_density);
t_u32 dev_cap, t_u8 *mcs_set);
#if KERNEL_VERSION(3, 6, 0) <= CFG80211_VERSION_CODE
void woal_cfg80211_setup_vht_cap(moal_private *priv,
struct ieee80211_sta_vht_cap *vht_cap);
@ -550,7 +524,4 @@ void woal_clear_wiphy_dfs_state(struct wiphy *wiphy);
void woal_update_channel_dfs_state(t_u8 channel, t_u8 dfs_state);
int woal_get_wiphy_chan_dfs_state(struct wiphy *wiphy,
mlan_ds_11h_chan_dfs_state *ch_dfs_state);
mlan_status woal_reset_wifi(moal_handle *handle, t_u8 cnt, char *reason);
#endif /* _MOAL_CFG80211_H_ */

File diff suppressed because it is too large Load diff

View file

@ -5,18 +5,26 @@
*
* Copyright 2015-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
@ -612,7 +620,6 @@ typedef enum wifi_attr {
ATTR_GET_CONCURRENCY_MATRIX_SET_SIZE_MAX = 8,
ATTR_GET_CONCURRENCY_MATRIX_SET_SIZE = 9,
ATTR_GET_CONCURRENCY_MATRIX_SET = 10,
ATTR_SCAN_BAND_SET = 11,
ATTR_WIFI_AFTER_LAST,
ATTR_WIFI_MAX = ATTR_WIFI_AFTER_LAST - 1
} wifi_attr_t;
@ -621,24 +628,11 @@ enum mrvl_wlan_vendor_attr_wifi_logger {
MRVL_WLAN_VENDOR_ATTR_NAME = 10,
};
enum ATTR_FW_RELOAD {
ATTR_FW_RELOAD_INVALID = 0,
ATTR_FW_RELOAD_MODE = 1,
ATTR_FW_RELOAD_AFTER_LAST,
ATTR_FW_RELOAD_MAX = ATTR_FW_RELOAD_AFTER_LAST - 1,
};
void woal_cfg80211_driver_hang_event(moal_private *priv, t_u8 reload_mode);
/**vendor event*/
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_rtt_result = 0x07,
event_set_key_mgmt_offload = 0x10001,
event_fw_roam_success = 0x10002,
event_cloud_keep_alive = 0x10003,
@ -708,18 +702,9 @@ enum vendor_sub_command {
sub_cmd_stop_keep_alive = 0x0004,
sub_cmd_dfs_capability = 0x0005,
sub_cmd_set_scan_mac_oui = 0x0007,
sub_cmd_set_scan_band = 0x0008,
sub_cmd_set_packet_filter = 0x0011,
sub_cmd_get_packet_filter_capability,
sub_cmd_nd_offload = 0x0100,
SUBCMD_RTT_GET_CAPA = 0x1100,
SUBCMD_RTT_RANGE_REQUEST,
SUBCMD_RTT_RANGE_CANCEL,
SUBCMD_RTT_GET_RESPONDER_INFO,
SUBCMD_RTT_ENABLE_RESPONDER,
SUBCMD_RTT_DISABLE_RESPONDER,
SUBCMD_RTT_SET_LCI,
SUBCMD_RTT_SET_LCR,
sub_cmd_link_statistic_set = 0x1200,
sub_cmd_link_statistic_get = 0x1201,
sub_cmd_link_statistic_clr = 0x1202,
@ -848,29 +833,6 @@ enum mrvl_wlan_vendor_attr_fw_roaming {
MRVL_WLAN_VENDOR_ATTR_FW_ROAMING_AFTER_LAST - 1
};
enum attr_rtt {
ATTR_RTT_INVALID = 0,
ATTR_RTT_CAPA,
ATTR_RTT_TARGET_NUM,
ATTR_RTT_TARGET_CONFIG,
ATTR_RTT_TARGET_ADDR,
ATTR_RTT_RESULT_COMPLETE,
ATTR_RTT_RESULT_NUM,
ATTR_RTT_RESULT_FULL,
ATTR_RTT_CHANNEL_INFO,
ATTR_RTT_MAX_DUR_SEC,
ATTR_RTT_PREAMBLE,
ATTR_RTT_LCI_INFO,
ATTR_RTT_LCR_INFO,
/* keep last */
ATTR_RTT_AFTER_LAST,
ATTR_RTT_MAX = ATTR_RTT_AFTER_LAST - 1
};
mlan_status woal_cfg80211_event_rtt_result(moal_private *priv, t_u8 *data,
int len);
enum attr_csi {
ATTR_CSI_INVALID = 0,
ATTR_CSI_CONFIG,

View file

@ -5,18 +5,26 @@
*
* 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
@ -117,7 +125,6 @@ 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),
@ -162,6 +169,8 @@ static struct debug_data items[] = {
INFO_ADDR | (INTF_SD << 8)},
{"mp_invalid_update", item_size(mp_invalid_update),
item_addr(mp_invalid_update), INFO_ADDR | (INTF_SD << 8)},
{"sdio_rx_aggr", item_size(sdio_rx_aggr), item_addr(sdio_rx_aggr),
INFO_ADDR | (INTF_SD << 8)},
{"mpa_sent_last_pkt", item_size(mpa_sent_last_pkt),
item_addr(mpa_sent_last_pkt), INFO_ADDR | (INTF_SD << 8)},
{"mpa_sent_no_ports", item_size(mpa_sent_no_ports),
@ -258,10 +267,6 @@ 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
@ -359,6 +364,8 @@ static struct debug_data uap_items[] = {
INFO_ADDR | (INTF_SD << 8)},
{"mp_invalid_update", item_size(mp_invalid_update),
item_addr(mp_invalid_update), INFO_ADDR | (INTF_SD << 8)},
{"sdio_rx_aggr", item_size(sdio_rx_aggr), item_addr(sdio_rx_aggr),
INFO_ADDR | (INTF_SD << 8)},
{"mpa_sent_last_pkt", item_size(mpa_sent_last_pkt),
item_addr(mpa_sent_last_pkt), INFO_ADDR | (INTF_SD << 8)},
{"mpa_sent_no_ports", item_size(mpa_sent_no_ports),

File diff suppressed because it is too large Load diff

View file

@ -1,23 +1,30 @@
/** @file moal_eth_ioctl.h
*
* @brief This file contains definition for private IOCTL call.
*
*
* Copyright 2008-2023 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
@ -82,9 +89,6 @@ Change log:
#define PRIV_CMD_GET_STA_LIST "getstalist"
#define PRIV_CMD_BSS_CONFIG "bssconfig"
#endif
#if defined(UAP_SUPPORT)
#define PRIV_CMD_SETMODE "setmode"
#endif
#ifdef WIFI_DIRECT_SUPPORT
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
#define PRIV_CMD_BSSROLE "bssrole"
@ -103,8 +107,6 @@ typedef struct _chan_stats {
#define PRIV_CMD_EXTCAPCFG "extcapcfg"
#define PRIV_CMD_CANCELSCAN "cancelscan"
#endif
#define PRIV_CMD_REORDER_FLUSH_TIME "flush_time"
#define PRIV_CMD_DEEPSLEEP "deepsleep"
#define PRIV_CMD_IPADDR "ipaddr"
#define PRIV_CMD_WPSSESSION "wpssession"
@ -115,7 +117,6 @@ 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"
@ -220,12 +221,13 @@ typedef struct _chan_stats {
#endif
#define PRIV_CMD_SLEEP_PARAMS "sleepparams"
#define PRIV_CMD_NET_MON "netmon"
#if defined(STA_CFG80211) && defined(UAP_CFG80211)
#define PRIV_CMD_MONITOR_MODE "monitormode"
#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"
@ -240,9 +242,9 @@ typedef struct _chan_stats {
#ifdef SDIO
#define PRIV_CMD_SD_CMD53_RW "sdcmd53rw"
#endif
#define PRIV_CMD_MULTI_CHAN_CFG "mc_cfg"
#define PRIV_CMD_MULTI_CHAN_POLICY "mc_policy"
#define PRIV_CMD_DRCS_CFG "mc_cfg_ext"
#ifdef RX_PACKET_COALESCE
#define PRIV_CMD_RX_COAL_CFG "rxpktcoal_cfg"
#endif
#ifdef WIFI_DIRECT_SUPPORT
#if defined(UAP_CFG80211)
#define PRIV_CMD_CFG_NOA "cfg_noa"
@ -276,7 +278,6 @@ typedef struct _chan_stats {
#define PRIV_CMD_GET_CFG_CHAN_LIST "getcfgchanlist"
#if defined(UAP_SUPPORT)
#define PRIV_CMD_EXTEND_CHAN_SWITCH "channel_switch"
#define PRIV_CMD_SET_CHAN_SWITCH_PARAM "chanswitch_param"
#endif
#define PRIV_CMD_TDLS_IDLE_TIME "tdls_idle_time"
@ -300,22 +301,14 @@ 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_CROSS_CHIP_SYNCH "crosssynch"
#define PRIV_CMD_ARB_CFG "arb"
/**Private command to configure static rx abort config */
#define PRIV_CMD_RX_ABORT_CFG "rx_abort_cfg"
/**Private command to configure static OFDM DESENSE config */
#define PRIV_CMD_OFDM_DESENSE_CFG "ofdm_desense_cfg"
/**Private command to configure dynamic rx abort config */
#define PRIV_CMD_RX_ABORT_CFG_EXT "rx_abort_cfg_ext"
/** configure NAV mitigation parameters. */
#define PRIV_CMD_NAV_MITIGATION "nav_mitigation"
#define PRIV_CMD_LED "led"
#define TX_AMPDU_RTS_CTS 0
#define TX_AMPDU_CTS_2_SELF 1
#define TX_AMPDU_DISABLE_PROTECTION 2
@ -386,12 +379,6 @@ 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 */
@ -402,8 +389,6 @@ typedef struct _ssu_params_cfg {
#define PRIV_CMD_TWT_SETUP "twt_setup"
/** Private command: TWT Teardown Cfg */
#define PRIV_CMD_TWT_TEARDOWN "twt_teardown"
/** Private command: TWT report Cfg */
#define PRIV_CMD_TWT_REPORT "twt_report"
#define PRIV_CMD_LPM "lpm"
@ -554,7 +539,6 @@ 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 {
@ -698,26 +682,6 @@ typedef struct _cloud_keep_alive {
/** packet content */
t_u8 pkt[255];
} __ATTRIB_PACK__ cloud_keep_alive;
/** cloud keep alive parameters */
#define PRIV_CMD_CLOUD_KEEP_ALIVE_RX "cloud_keep_alive_rx"
typedef struct _cloud_keep_alive_rx {
/** id */
t_u8 mkeep_alive_id;
/** enable/disable of this id */
t_u8 enable;
/** enable/disable reset*/
t_u8 reset;
/** Reserved */
t_u8 reserved;
/** Destination MAC address */
t_u8 dst_mac[ETH_ALEN];
/** Source MAC address */
t_u8 src_mac[ETH_ALEN];
/** packet length */
t_u8 pkt_len;
/** packet content */
t_u8 pkt[100];
} __ATTRIB_PACK__ cloud_keep_alive_rx;
#define TLV_TYPE_PER_PKT_CFG 0x0001
#define TX_PKT_CTRL MBIT(0)

View file

@ -6,18 +6,26 @@
*
* Copyright 2018-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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
#include "moal_main.h"
@ -29,7 +37,6 @@ 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;
@ -42,7 +49,6 @@ static char *mod_para;
/** Mfg mode */
int mfg_mode;
#endif
int rf_test_mode;
#if defined(SDIO)
/** SDIO interrupt mode (0: INT_MODE_SDIO, 1: INT_MODE_GPIO) */
@ -60,18 +66,15 @@ static int country_ie_ignore;
static int beacon_hints;
#endif
#endif
static int cfg80211_drcs;
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static int host_mlme = 1;
static int host_mlme;
#endif
#endif
static int roamoffload_in_hs;
static int drcs_chantime_mode;
/** Auto deep sleep */
static int auto_ds;
@ -134,24 +137,7 @@ static int shutdown_hs;
static int slew_rate = 3;
#endif
int tx_work = 0;
#if defined(CONFIG_RPS)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
/**
* RPS to steer packets to specific CPU
* Default value of 0 keeps rps disabled by default
*/
static int rps = 0;
/**
* rps cpu mask
* rps can be configure to any value between 0x1 - 0xf
* ex: value of 0x3(0011) indicates to use cpu-0 and cpu-1
*/
#define RPS_CPU_MASK 0xf
#endif
#endif
static int tx_skb_clone = 0;
#ifdef IMX_SUPPORT
static int pmqos = 1;
@ -160,9 +146,6 @@ static int pmqos = 0;
#endif
static int chan_track = 0;
static int mcs32 = 1;
/** hs_auto_arp setting */
static int hs_auto_arp = 0;
#if defined(STA_SUPPORT)
/** 802.11d configuration */
@ -275,6 +258,7 @@ static int indrstcfg = 0xffffffff;
#define DEFAULT_DEV_CAP_MASK 0xffffffff
static t_u32 dev_cap_mask = DEFAULT_DEV_CAP_MASK;
#ifdef SDIO
static int sdio_rx_aggr = MTRUE;
#endif
/** The global variable of scan beacon buffer **/
@ -288,19 +272,6 @@ static t_u16 multi_dtim;
static t_u16 inact_tmo;
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
/* default filter flag 0x27 Stands for
(MLAN_NETMON_NON_BSS_BCN | \
MLAN_NETMON_DATA | \
MLAN_NETMON_CONTROL | \
MLAN_NETMON_MANAGEMENT)
*/
#define DEFAULT_NETMON_FILTER 0x27
static int mon_filter = DEFAULT_NETMON_FILTER;
#endif
#endif
#ifdef DEBUG_LEVEL1
#ifdef DEBUG_LEVEL2
#define DEFAULT_DEBUG_MASK (0xffffffff)
@ -342,10 +313,9 @@ static card_type_entry card_type_map_tbl[] = {
#ifdef SD9177
{CARD_TYPE_SD9177, 0, CARD_SD9177},
#endif
#ifdef SDIW624
{CARD_TYPE_SDIW624, 0, CARD_SDIW624},
#ifdef SDNW62X
{CARD_TYPE_SDNW62X, 0, CARD_SDNW62X},
#endif
{CARD_TYPE_SDAW693, 0, CARD_SDAW693},
#ifdef PCIE8897
{CARD_TYPE_PCIE8897, 0, CARD_PCIE8897},
#endif
@ -358,9 +328,8 @@ static card_type_entry card_type_map_tbl[] = {
#ifdef PCIE9098
{CARD_TYPE_PCIE9098, 0, CARD_PCIE9098},
#endif
{CARD_TYPE_PCIEAW693, 0, CARD_PCIEAW693},
#ifdef PCIEIW624
{CARD_TYPE_PCIEIW624, 0, CARD_PCIEIW624},
#ifdef PCIENW62X
{CARD_TYPE_PCIENW62X, 0, CARD_PCIENW62X},
#endif
#ifdef USB8801
{CARD_TYPE_USB8801, 0, CARD_USB8801},
@ -381,16 +350,14 @@ static card_type_entry card_type_map_tbl[] = {
#ifdef USB9097
{CARD_TYPE_USB9097, 0, CARD_USB9097},
#endif
#ifdef USBIW624
{CARD_TYPE_USBIW624, 0, CARD_USBIW624},
#ifdef USBNW62X
{CARD_TYPE_USBNW62X, 0, CARD_USBNW62X},
#endif
};
static int dfs53cfg = DFS_W53_DEFAULT_FW;
static int keep_previous_scan = 1;
static int auto_11ax = 1;
/**
* @brief This function read a line in module parameter file
*
@ -406,8 +373,7 @@ static t_size parse_cfg_get_line(t_u8 *data, t_size size, t_u8 *line_pos)
ENTER();
if ((pos >= (t_s32)size) || (data == NULL) ||
(line_pos == NULL)) { /* reach the end */
if (pos >= (t_s32)size) { /* reach the end */
pos = 0; /* Reset position for rfkill */
LEAVE();
return -1;
@ -642,14 +608,6 @@ 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) !=
@ -685,33 +643,13 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
PRINTM(MMSG, "mfg_mode = %d\n", params->mfg_mode);
}
#endif
else if (strncmp(line, "rf_test_mode",
strlen("rf_test_mode")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->rf_test_mode = out_data;
PRINTM(MMSG, "rf_test_mode = %d\n",
params->rf_test_mode);
} else if (strncmp(line, "drv_mode", strlen("drv_mode")) == 0) {
else if (strncmp(line, "drv_mode", strlen("drv_mode")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->drv_mode = out_data;
PRINTM(MMSG, "drv_mode = %d\n", params->drv_mode);
}
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
else if (strncmp(line, "mon_filter", strlen("mon_filter")) ==
0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->mon_filter = out_data;
PRINTM(MMSG, "mon_filter = %d\n", params->mon_filter);
}
#endif
#endif
#ifdef DEBUG_LEVEL1
else if (strncmp(line, "drvdbg", strlen("drvdbg")) == 0) {
if (parse_line_read_int(line, &out_data) !=
@ -1077,6 +1015,20 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
PRINTM(MMSG, "dev_cap_mask=%d\n", params->dev_cap_mask);
}
#ifdef SDIO
else if (strncmp(line, "sdio_rx_aggr",
strlen("sdio_rx_aggr")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
if (out_data)
moal_extflg_set(handle, EXT_SDIO_RX_AGGR);
else
moal_extflg_clear(handle, EXT_SDIO_RX_AGGR);
PRINTM(MMSG, "sdio_rx_aggr %s\n",
moal_extflg_isset(handle, EXT_SDIO_RX_AGGR) ?
"on" :
"off");
}
#endif
else if (strncmp(line, "pmic", strlen("pmic")) == 0) {
if (parse_line_read_int(line, &out_data) !=
@ -1223,22 +1175,19 @@ 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");
}
#if defined(CONFIG_RPS)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
else if (strncmp(line, "rps", strlen("rps")) == 0) {
} else if (strncmp(line, "rps", strlen("rps")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
handle->params.rps = out_data & RPS_CPU_MASK;
PRINTM(MMSG, "rps set to %x from cfg\n",
handle->params.rps);
}
#endif
#endif
else if (strncmp(line, "tx_skb_clone",
strlen("tx_skb_clone")) == 0) {
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) !=
MLAN_STATUS_SUCCESS)
goto err;
@ -1278,29 +1227,8 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
"off");
}
#endif
else if (strncmp(line, "cfg80211_drcs",
strlen("cfg80211_drcs")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
if (out_data)
moal_extflg_set(handle, EXT_CFG80211_DRCS);
else
moal_extflg_clear(handle, EXT_CFG80211_DRCS);
PRINTM(MMSG, "cfg80211_drcs %s\n",
moal_extflg_isset(handle, EXT_CFG80211_DRCS) ?
"on" :
"off");
} else if (strncmp(line, "drcs_chantime_mode",
strlen("drcs_chantime_mode")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->drcs_chantime_mode = out_data;
PRINTM(MMSG, "drcs_chantime_mode=%d\n",
params->drcs_chantime_mode);
} else if (strncmp(line, "roamoffload_in_hs",
strlen("roamoffload_in_hs")) == 0) {
else if (strncmp(line, "roamoffload_in_hs",
strlen("roamoffload_in_hs")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
@ -1389,20 +1317,6 @@ 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);
} else if (strncmp(line, "hs_auto_arp",
strlen("hs_auto_arp")) == 0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->hs_auto_arp = out_data;
PRINTM(MMSG, "hs_auto_arp=%d\n", params->hs_auto_arp);
}
#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) {
@ -1437,21 +1351,6 @@ 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);
} else if (strncmp(line, "auto_11ax", strlen("auto_11ax")) ==
0) {
if (parse_line_read_int(line, &out_data) !=
MLAN_STATUS_SUCCESS)
goto err;
params->auto_11ax = out_data;
PRINTM(MMSG, "auto_11ax=%d\n", params->auto_11ax);
}
}
if (end)
@ -1492,10 +1391,6 @@ 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);
@ -1510,20 +1405,9 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
if (params)
handle->params.mfg_mode = params->mfg_mode;
#endif
handle->params.rf_test_mode = rf_test_mode;
if (params)
handle->params.rf_test_mode = params->rf_test_mode;
handle->params.drv_mode = drv_mode;
if (params)
handle->params.drv_mode = params->drv_mode;
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
handle->params.mon_filter = mon_filter;
if (params)
handle->params.mon_filter = params->mon_filter;
#endif
#endif
#ifdef DEBUG_LEVEL1
handle->params.drvdbg = drvdbg;
if (params)
@ -1543,20 +1427,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 */
handle->params.hs_auto_arp = hs_auto_arp;
if (params) {
handle->params.hs_auto_arp = params->hs_auto_arp;
}
#ifdef WIFI_DIRECT_SUPPORT
handle->params.max_wfd_bss = max_wfd_bss;
woal_dup_string(&handle->params.wfd_name, wfd_name);
@ -1689,6 +1566,8 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
if (params)
handle->params.dev_cap_mask = params->dev_cap_mask;
#ifdef SDIO
if (sdio_rx_aggr)
moal_extflg_set(handle, EXT_SDIO_RX_AGGR);
#endif
if (pmic)
moal_extflg_set(handle, EXT_PMIC);
@ -1731,14 +1610,8 @@ 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 defined(CONFIG_RPS)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
handle->params.rps = rps & RPS_CPU_MASK;
PRINTM(MMSG, "rps set to %x from module param\n", handle->params.rps);
#endif
#endif
if (rps)
moal_extflg_set(handle, EXT_RPS);
if (tx_skb_clone)
moal_extflg_set(handle, EXT_TX_SKB_CLONE);
if (pmqos)
@ -1759,11 +1632,6 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
moal_extflg_set(handle, EXT_HOST_MLME);
#endif
#endif
if (cfg80211_drcs)
moal_extflg_set(handle, EXT_CFG80211_DRCS);
handle->params.drcs_chantime_mode = drcs_chantime_mode;
if (params)
handle->params.drcs_chantime_mode = params->drcs_chantime_mode;
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
if (disable_regd_by_driver)
moal_extflg_set(handle, EXT_DISABLE_REGD_BY_DRIVER);
@ -1802,8 +1670,6 @@ 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;
handle->params.auto_11ax = auto_11ax;
}
/**
@ -1890,7 +1756,6 @@ static mlan_status woal_req_mod_param(moal_handle *handle, char *mod_file)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
struct device *dev = handle->hotplug_device;
int status;
if (dev == NULL) {
PRINTM(MERROR, "No device attached\n");
@ -1898,12 +1763,10 @@ static mlan_status woal_req_mod_param(moal_handle *handle, char *mod_file)
goto out;
}
status = request_firmware(&handle->param_data, mod_file, dev);
if (status < 0) {
ret = request_firmware(&handle->param_data, mod_file, dev);
if (ret < 0)
PRINTM(MERROR, "Request firmware: %s failed, error: %d\n",
mod_file, ret);
ret = MLAN_STATUS_FAILURE;
}
out:
return ret;
}
@ -1976,19 +1839,13 @@ void woal_init_from_dev_tree(void)
PRINTM(MIOCTL, "tx_work=0x%x\n", data);
tx_work = data;
}
}
#if defined(CONFIG_RPS)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
else if (!strncmp(prop->name, "rps", strlen("rps"))) {
} 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;
}
}
#endif
#endif
else if (!strncmp(prop->name, "tx_skb_clone",
strlen("tx_skb_clone"))) {
} else if (!strncmp(prop->name, "tx_skb_clone",
strlen("tx_skb_clone"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MIOCTL, "tx_skb_clone=0x%x\n", data);
tx_skb_clone = data;
@ -1998,19 +1855,6 @@ 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;
}
}
else if (!strncmp(prop->name, "hs_auto_arp",
strlen("hs_auto_arp"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MIOCTL, "hs_auto_arp=0x%x\n", data);
hs_auto_arp = data;
}
}
#ifdef MFG_CMD_SUPPORT
else if (!strncmp(prop->name, "mfg_mode", strlen("mfg_mode"))) {
@ -2020,14 +1864,7 @@ void woal_init_from_dev_tree(void)
}
}
#endif
else if (!strncmp(prop->name, "rf_test_mode",
strlen("rf_test_mode"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MIOCTL, "rf_test_mode=0x%x\n", data);
rf_test_mode = data;
}
} else if (!strncmp(prop->name, "mac_addr",
strlen("mac_addr"))) {
else if (!strncmp(prop->name, "mac_addr", strlen("mac_addr"))) {
if (!of_property_read_string(dt_node, prop->name,
&string_data)) {
mac_addr = (char *)string_data;
@ -2114,12 +1951,6 @@ void woal_init_from_dev_tree(void)
PRINTM(MIOCTL, "max_vir_bss=0x%x\n", data);
max_vir_bss = data;
}
} else if (!strncmp(prop->name, "cfg80211_drcs",
strlen("cfg80211_drcs"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MIOCTL, "cfg80211_drcs=0x%x\n", data);
cfg80211_drcs = data;
}
}
#endif
#endif
@ -2224,13 +2055,6 @@ void woal_init_from_dev_tree(void)
indrstcfg = data;
PRINTM(MIOCTL, "indrstcfg=%d\n", indrstcfg);
}
} else if (!strncmp(prop->name, "drcs_chantime_mode",
strlen("drcs_chantime_mode"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
drcs_chantime_mode = data;
PRINTM(MIOCTL, "drcs_chantime_mode=%d\n",
drcs_chantime_mode);
}
} else if (!strncmp(prop->name, "fixed_beacon_buffer",
strlen("fixed_beacon_buffer"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
@ -2301,13 +2125,8 @@ void woal_init_from_dev_tree(void)
}
}
#endif
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"))) {
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;
@ -2318,31 +2137,7 @@ 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;
}
} else if (!strncmp(prop->name, "auto_11ax",
strlen("auto_11ax"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MERROR, "auto_11ax=0x%x\n", data);
auto_11ax = data;
}
}
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
else if (!strncmp(prop->name, "mon_filter",
strlen("mon_filter"))) {
if (!of_property_read_u32(dt_node, prop->name, &data)) {
PRINTM(MERROR, "mon_filter=0x%x\n", data);
mon_filter = data;
}
}
#endif
#endif
}
LEAVE();
return;
@ -2467,7 +2262,7 @@ mlan_status woal_init_module_param(moal_handle *handle)
}
PRINTM(MMSG, "%s: init module param from usr cfg\n",
card_type_map_tbl[i].name);
size = (t_u32)handle->param_data->size;
size = handle->param_data->size;
data = (t_u8 *)handle->param_data->data;
while ((int)parse_cfg_get_line(data, size, line) != -1) {
if (line[0] == '#')
@ -2485,8 +2280,7 @@ mlan_status woal_init_module_param(moal_handle *handle)
if (blk_id == NULL)
handle->blk_id = 0;
else
(void)woal_atoi(&handle->blk_id,
blk_id);
woal_atoi(&handle->blk_id, blk_id);
PRINTM(MINFO,
"Validation check, %s, config block: %d\n",
card_type, handle->blk_id);
@ -2519,7 +2313,7 @@ out:
if (handle->param_data) {
release_firmware(handle->param_data);
/* rewind pos */
(void)parse_cfg_get_line(NULL, 0, NULL);
parse_cfg_get_line(NULL, 0, NULL);
}
if (ret != MLAN_STATUS_SUCCESS) {
PRINTM(MERROR, "Invalid block: %s\n", line);
@ -2549,14 +2343,6 @@ 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);
#ifdef PCIE
MODULE_PARM_DESC(auto_fw_reload,
"BIT0: enable auto fw_reload; BIT1:enable PCIe in-band reset");
#else
MODULE_PARM_DESC(auto_fw_reload, "BIT0: enable auto fw_reload");
#endif
module_param(fw_serial, int, 0);
MODULE_PARM_DESC(
fw_serial,
@ -2568,10 +2354,6 @@ module_param(mfg_mode, int, 0660);
MODULE_PARM_DESC(mfg_mode,
"0: Download normal firmware; 1: Download MFG firmware");
#endif /* MFG_CMD_SUPPORT */
module_param(rf_test_mode, int, 0660);
MODULE_PARM_DESC(
rf_test_mode,
"0: Download normal firmware; 1: Download RF_TEST_MODE firmware");
module_param(drv_mode, int, 0660);
MODULE_PARM_DESC(drv_mode,
"Bit 0: STA; Bit 1: uAP; Bit 2: WIFIDIRECT; Bit 7: ZERO_DFS");
@ -2655,23 +2437,13 @@ MODULE_PARM_DESC(
#endif
module_param(tx_work, uint, 0660);
MODULE_PARM_DESC(tx_work, "1: Enable tx_work; 0: Disable tx_work");
#if defined(CONFIG_RPS)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
module_param(rps, uint, 0660);
MODULE_PARM_DESC(
rps,
"bit0-bit4(0x1 - 0xf): Enables rps on specific cpu ; 0: Disables rps");
#endif
#endif
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(hs_auto_arp, uint, 0660);
MODULE_PARM_DESC(hs_auto_arp, "1: Enable hs_auto_arp; 0: Disable hs_auto_arp");
module_param(dpd_data_cfg, charp, 0);
MODULE_PARM_DESC(dpd_data_cfg, "DPD data file name");
@ -2745,6 +2517,9 @@ MODULE_PARM_DESC(amsdu_deaggr,
"0: default; 1: Try to avoid buf copy in amsud deaggregation");
#ifdef SDIO
module_param(sdio_rx_aggr, int, 0);
MODULE_PARM_DESC(sdio_rx_aggr,
"1: Enable SDIO rx aggr; 0: Disable SDIO rx aggr");
#endif
module_param(pmic, int, 0);
@ -2812,14 +2587,6 @@ module_param(dfs_offload, int, 0);
MODULE_PARM_DESC(dfs_offload, "1: enable dfs offload; 0: disable dfs offload.");
#endif
module_param(drcs_chantime_mode, int, 0);
MODULE_PARM_DESC(
drcs_chantime_mode,
"0: use default value;Bit31~Bit24:Channel time for channel index0;Bit23~Bit16:mode for channel index0;Bit15~Bit8:Channel time for channel index1;Bit7~Bit0:mode for channel index1; mode:0--PM1,1--Null2Self.");
module_param(cfg80211_drcs, int, 0);
MODULE_PARM_DESC(cfg80211_drcs,
"1: Enable DRCS support; 0: Disable DRCS support");
module_param(roamoffload_in_hs, int, 0);
MODULE_PARM_DESC(
roamoffload_in_hs,
@ -2836,9 +2603,8 @@ 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 (Default); 0: Disable Host MLME support");
MODULE_PARM_DESC(host_mlme,
"1: Enable Host MLME Support; 0: Disable Host MLME support");
#endif
#endif
@ -2867,20 +2633,3 @@ 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 ");
module_param(auto_11ax, int, 0);
MODULE_PARM_DESC(auto_11ax, "1: enable auto_11ax; 0: disable auto_11ax ");
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
module_param(mon_filter, int, 0);
MODULE_PARM_DESC(
mon_filter,
"Bit6:TX frames excluding control; Bit5:non-bss beacons; Bit3:unicast destined non-promiscuous frames only; Bit2:data frames; Bit1:control frames; Bit0:management frames");
#endif
#endif

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

@ -6,18 +6,26 @@
*
* 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
@ -28,10 +36,6 @@ 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)
@ -40,11 +44,9 @@ 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
@ -116,26 +118,10 @@ static const struct pci_device_id wlan_ids[] = {
0,
},
#endif
#ifdef PCIENW62X
{
PCIE_VENDOR_ID_NXP,
PCIE_DEVICE_ID_88WAW693_FN0,
PCI_ANY_ID,
PCI_ANY_ID,
0,
0,
},
{
PCIE_VENDOR_ID_NXP,
PCIE_DEVICE_ID_88WAW693_FN1,
PCI_ANY_ID,
PCI_ANY_ID,
0,
0,
},
#ifdef PCIEIW624
{
PCIE_VENDOR_ID_NXP,
PCIE_DEVICE_ID_88WIW624,
PCIE_DEVICE_ID_88WNW62X,
PCI_ANY_ID,
PCI_ANY_ID,
0,
@ -157,8 +143,6 @@ static moal_if_ops pcie_ops;
********************************************************/
static mlan_status woal_pcie_preinit(struct pci_dev *pdev);
static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag,
t_u8 resetflag);
/** @brief This function updates the card types
*
@ -226,11 +210,11 @@ static t_u16 woal_update_card_type(t_void *card)
strlen(KERN_VERSION));
}
#endif
if (cardp_pcie->dev->device == PCIE_DEVICE_ID_88WAW693_FN0 ||
cardp_pcie->dev->device == PCIE_DEVICE_ID_88WAW693_FN1) {
card_type = CARD_TYPE_PCIEAW693;
moal_memcpy_ext(NULL, driver_version, CARD_PCIEAW693,
strlen(CARD_PCIEAW693), strlen(driver_version));
#ifdef PCIENW62X
if (cardp_pcie->dev->device == PCIE_DEVICE_ID_88WNW62X) {
card_type = CARD_TYPE_PCIENW62X;
moal_memcpy_ext(NULL, driver_version, CARD_PCIENW62X,
strlen(CARD_PCIENW62X), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
@ -238,18 +222,6 @@ static t_u16 woal_update_card_type(t_void *card)
strlen(driver_version) - strlen(INTF_CARDTYPE) -
strlen(KERN_VERSION));
}
#ifdef PCIEIW624
if (cardp_pcie->dev->device == PCIE_DEVICE_ID_88WIW624) {
card_type = CARD_TYPE_PCIEIW624;
moal_memcpy_ext(NULL, driver_version, CARD_PCIEIW624,
strlen(CARD_PCIEIW624), strlen(driver_version));
moal_memcpy_ext(NULL,
driver_version + strlen(INTF_CARDTYPE) +
strlen(KERN_VERSION),
V18, strlen(V18),
strlen(driver_version) - strlen(INTF_CARDTYPE) -
strlen(KERN_VERSION));
}
#endif
return card_type;
@ -298,8 +270,7 @@ static mlan_status woal_do_flr(moal_handle *handle, bool prepare, bool flr_flag)
if (!IS_PCIE8997(handle->card_type) &&
!IS_PCIE9097(handle->card_type) &&
!IS_PCIEIW624(handle->card_type) &&
!IS_PCIEAW693(handle->card_type) &&
!IS_PCIENW62X(handle->card_type) &&
!IS_PCIE9098(handle->card_type)) {
LEAVE();
return status;
@ -314,7 +285,6 @@ static mlan_status woal_do_flr(moal_handle *handle, bool prepare, bool flr_flag)
/* Reset all interfaces */
priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY);
woal_reset_intf(priv, MOAL_IOCTL_WAIT, MTRUE);
woal_clean_up(handle);
/* Shutdown firmware */
handle->init_wait_q_woken = MFALSE;
@ -335,20 +305,10 @@ 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 */
for (i = 0; i < handle->priv_num; i++)
woal_remove_interface(handle, i);
@ -385,10 +345,11 @@ perform_init:
goto err_init_fw;
}
if ((card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1) ||
(card->dev->device == PCIE_DEVICE_ID_88WAW693_FN1))
#ifdef PCIE9098
if (card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1)
mlan_set_int_mode(handle->pmlan_adapter, pcie_int_mode, 1);
else
#endif
/* Update pcie_int_mode in mlan adapter */
mlan_set_int_mode(handle->pmlan_adapter,
handle->params.pcie_int_mode, 0);
@ -429,7 +390,7 @@ err_init_fw:
handle->init_wait_q_woken);
}
#ifdef ANDROID_KERNEL
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
wakeup_source_trash(&handle->ws);
#else
wake_lock_destroy(&handle->wake_lock);
@ -506,11 +467,7 @@ static int woal_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
ret = MLAN_STATUS_FAILURE;
goto err;
}
if (MLAN_STATUS_SUCCESS != woal_pcie_init(card)) {
PRINTM(MERROR, "woal_pcie_init failed\n");
ret = -EFAULT;
goto err;
}
woal_pcie_init(card);
if (woal_add_card(card, &card->dev->dev, &pcie_ops, card_type) ==
NULL) {
@ -574,44 +531,6 @@ 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 (IS_PCIE9098(handle->card_type) || IS_PCIEIW624(handle->card_type) ||
IS_PCIEAW693(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");
}
done:
handle->surprise_removed = MTRUE;
pci_disable_device(dev);
PRINTM(MCMND, "<--- Leave woal_pcie_shutdown --->\n");
LEAVE();
return;
}
/**
* @brief Handle suspend
*
@ -997,7 +916,6 @@ 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,
@ -1130,6 +1048,8 @@ static irqreturn_t woal_pcie_interrupt(int irq, void *dev_id)
PRINTM(MINTR, "Receive interrupt in hs_suspended\n");
goto exit;
}
queue_work(handle->workqueue, &handle->main_work);
exit:
if (ret == MLAN_STATUS_SUCCESS)
return IRQ_HANDLED;
@ -1214,21 +1134,13 @@ 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;
@ -1264,21 +1176,13 @@ 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;
@ -1306,7 +1210,7 @@ static mlan_status woal_pcie_init(pcie_service_card *card)
goto err_iomap2;
}
PRINTM(MMSG,
PRINTM(MINFO,
"PCI memory map Virt0: %p PCI memory map Virt2: "
"%p\n",
card->pci_mmap, card->pci_mmap1);
@ -1439,10 +1343,11 @@ static mlan_status woal_pcie_register_dev(moal_handle *handle)
break;
}
if ((card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1) ||
(card->dev->device == PCIE_DEVICE_ID_88WAW693_FN1))
#ifdef PCIE9098
if (card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1)
mlan_set_int_mode(handle->pmlan_adapter, pcie_int_mode, 1);
else
#endif
mlan_set_int_mode(handle->pmlan_adapter, pcie_int_mode, 0);
done:
@ -1565,20 +1470,24 @@ void woal_pcie_bus_unregister(void)
LEAVE();
}
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
#define PCIE9098_DUMP_CTRL_REG 0x1C94
#define PCIE9098_DUMP_START_REG 0x1C98
#define PCIE9098_DUMP_END_REG 0x1C9F
#endif
#if defined(PCIE8897) || defined(PCIE8997)
#define DEBUG_DUMP_CTRL_REG 0xCF4
#define DEBUG_DUMP_START_REG 0xCF8
#define DEBUG_DUMP_END_REG 0xCFF
#endif
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
#define PCIE9098_SCRATCH_12_REG 0x1C90
#define PCIE9098_SCRATCH_14_REG 0x1C98
#define PCIE9098_SCRATCH_15_REG 0x1C9C
#define PCIE9098_DUMP_REG_START 0x1C20
#define PCIE9098_DUMP_REG_END 0x1C9C
#endif
#if defined(PCIE8997) || defined(PCIE8897)
#define PCIE_SCRATCH_12_REG 0x0CF0;
@ -1608,9 +1517,11 @@ static int woal_pcie_dump_reg_info(moal_handle *phandle, t_u8 *buffer)
t_u32 dump_end_reg = 0;
t_u32 scratch_14_reg = 0;
t_u32 scratch_15_reg = 0;
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
/* Tx/Rx/Event AMDA start address */
t_u32 adma_reg_table[] = {0x10000, 0x10800, 0x10880, 0x11000, 0x11080};
t_u8 j;
#endif
ENTER();
mlan_pm_wakeup_card(phandle->pmlan_adapter, MTRUE);
drv_ptr += sprintf(drv_ptr,
@ -1634,9 +1545,9 @@ static int woal_pcie_dump_reg_info(moal_handle *phandle, t_u8 *buffer)
}
#endif
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (IS_PCIE9098(phandle->card_type) ||
IS_PCIEIW624(phandle->card_type) ||
IS_PCIEAW693(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
reg = PCIE9098_SCRATCH_12_REG;
dump_start_reg = PCIE9098_DUMP_REG_START;
@ -1644,6 +1555,7 @@ static int woal_pcie_dump_reg_info(moal_handle *phandle, t_u8 *buffer)
scratch_14_reg = PCIE9098_SCRATCH_14_REG;
scratch_15_reg = PCIE9098_SCRATCH_15_REG;
}
#endif
woal_pcie_read_reg(phandle, reg, &value);
drv_ptr += sprintf(drv_ptr, "reg:0x%x value=0x%x\n", reg, value);
@ -1677,9 +1589,9 @@ static int woal_pcie_dump_reg_info(moal_handle *phandle, t_u8 *buffer)
}
i++;
}
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (IS_PCIE9098(phandle->card_type) ||
IS_PCIEIW624(phandle->card_type) ||
IS_PCIEAW693(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
drv_ptr += sprintf(
drv_ptr,
@ -1700,8 +1612,7 @@ static int woal_pcie_dump_reg_info(moal_handle *phandle, t_u8 *buffer)
drv_ptr += sprintf(drv_ptr, "%s\n", buf);
}
if (IS_PCIE9098(phandle->card_type) ||
IS_PCIEIW624(phandle->card_type) ||
IS_PCIEAW693(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
drv_ptr += sprintf(drv_ptr,
"ADMA Tx/Rx/Event/Cmd/CmdResp registers:\n");
@ -1728,6 +1639,7 @@ static int woal_pcie_dump_reg_info(moal_handle *phandle, t_u8 *buffer)
drv_ptr += sprintf(drv_ptr, "%s\n", buf);
}
}
#endif
drv_ptr += sprintf(drv_ptr,
"-----------PCIe Registers dump End-----------\n");
mlan_pm_wakeup_card(phandle->pmlan_adapter, MFALSE);
@ -1754,9 +1666,11 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
t_u32 dump_end_reg = 0;
t_u32 scratch_14_reg = 0;
t_u32 scratch_15_reg = 0;
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
/* Tx/Rx/Event AMDA start address */
t_u32 adma_reg_table[] = {0x10000, 0x10800, 0x10880, 0x11000, 0x11080};
t_u8 j;
#endif
mlan_pm_wakeup_card(phandle->pmlan_adapter, MTRUE);
PRINTM(MMSG, "Config Space Registers:\n");
for (i = 0; i < ARRAY_SIZE(config_reg_table); i++) {
@ -1776,9 +1690,9 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
}
#endif
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (IS_PCIE9098(phandle->card_type) ||
IS_PCIEIW624(phandle->card_type) ||
IS_PCIEAW693(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
reg = PCIE9098_SCRATCH_12_REG;
dump_start_reg = PCIE9098_DUMP_START_REG;
@ -1786,6 +1700,7 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
scratch_14_reg = PCIE9098_SCRATCH_14_REG;
scratch_15_reg = PCIE9098_SCRATCH_15_REG;
}
#endif
woal_pcie_read_reg(phandle, reg, &value);
PRINTM(MERROR, "reg:0x%x value=0x%x\n", reg, value);
for (i = 0; i < 2; i++) {
@ -1814,9 +1729,9 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
}
i++;
}
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (IS_PCIE9098(phandle->card_type) ||
IS_PCIEIW624(phandle->card_type) ||
IS_PCIEAW693(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
PRINTM(MMSG, "PCIE registers from offset 0x1c20 to 0x1c9c:\n");
memset(buf, 0, sizeof(buf));
@ -1835,8 +1750,7 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
PRINTM(MMSG, "%s\n", buf);
}
if (IS_PCIE9098(phandle->card_type) ||
IS_PCIEIW624(phandle->card_type) ||
IS_PCIEAW693(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
PRINTM(MMSG, "ADMA Tx/Rx/Event/Cmd/CmdResp registers:\n");
for (j = 0; j < ARRAY_SIZE(adma_reg_table); j++) {
@ -1860,6 +1774,7 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
PRINTM(MMSG, "%s\n", buf);
}
}
#endif
mlan_pm_wakeup_card(phandle->pmlan_adapter, MFALSE);
}
@ -1902,12 +1817,17 @@ static memory_type_mapping mem_type_mapping_tbl_8897[] = {
};
#endif
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
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};
#endif
#if defined(PCIE8897) || defined(PCIE8997) || defined(PCIE9098) || \
defined(PCIE9097) || defined(PCIENW62X)
/**
* @brief This function reads data by 8 bit from card register
*
@ -1930,12 +1850,10 @@ 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,
t_u8 resetflag)
static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
{
int ret = 0;
int tries = 0;
@ -1957,44 +1875,41 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag,
}
#endif
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (IS_PCIE9098(phandle->card_type) ||
IS_PCIEIW624(phandle->card_type) ||
IS_PCIEAW693(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
if (phandle->event_fw_dump)
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, reg=0x%x debug_reay=0x%x\n",
dump_ctrl_reg, debug_host_ready);
PRINTM(MERROR, "PCIE Write ERR\n");
return RDWR_STATUS_FAILURE;
}
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (IS_PCIE9098(phandle->card_type) ||
IS_PCIEIW624(phandle->card_type) ||
IS_PCIEAW693(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
if (phandle->event_fw_dump || resetflag)
if (phandle->event_fw_dump)
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 0x%x fail\n",
dump_ctrl_reg);
PRINTM(MERROR, "PCIE Read DEBUG_DUMP_CTRL_REG fail\n");
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 reg 0x%x 8bit ERR\n",
dump_ctrl_reg);
PRINTM(MERROR, "PCIE READ ERR\n");
return RDWR_STATUS_FAILURE;
}
if (ctrl_data == DEBUG_FW_DONE)
@ -2002,9 +1917,7 @@ 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, ctrl_data=0x%x, host_ready:0x%x try again!\n",
ctrl_data, debug_host_ready);
PRINTM(MMSG, "The ctrl reg was changed, try again!\n");
ret = woal_pcie_write_reg(phandle, dump_ctrl_reg,
debug_host_ready);
if (ret) {
@ -2019,12 +1932,12 @@ 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=0x%x host_ready=0x%x\n",
ctrl_data, debug_host_ready);
PRINTM(MERROR, "Fail to pull ctrl_data\n");
return RDWR_STATUS_FAILURE;
}
return RDWR_STATUS_SUCCESS;
}
#endif
#ifdef PCIE8897
/**
@ -2048,9 +1961,6 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle)
t_u8 read_reg = 0;
t_u32 memory_size = 0;
t_u32 memdump_finsh = 0;
#ifndef DUMP_TO_PROC
t_u8 path_name[64], file_name[32], firmware_dump_file[128];
#endif
t_u8 *end_ptr = NULL;
memory_type_mapping *mem_type_mapping_tbl = mem_type_mapping_tbl_8897;
@ -2058,7 +1968,6 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle)
PRINTM(MERROR, "Could not dump firmwware info\n");
return;
}
#ifdef DUMP_TO_PROC
if (!phandle->fw_dump_buf) {
ret = moal_vmalloc(phandle, FW_DUMP_INFO_LEN,
&(phandle->fw_dump_buf));
@ -2070,25 +1979,12 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle)
memset(phandle->fw_dump_buf, 0x00, FW_DUMP_INFO_LEN);
}
phandle->fw_dump_len = 0;
#else
memdump_finsh = DEBUG_MEMDUMP_FINISH_8897;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
/** Create dump directory*/
woal_create_dump_dir(phandle, path_name, sizeof(path_name));
#else
memset(path_name, 0, sizeof(path_name));
strcpy(path_name, "/data");
#endif
PRINTM(MMSG, "Directory name is %s\n", path_name);
woal_dump_drv_info(phandle, path_name);
#endif
/* start dump fw memory */
moal_get_system_time(phandle, &sec, &usec);
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, 0))
if (RDWR_STATUS_FAILURE == woal_pcie_rdwr_firmware(phandle, doneflag))
goto done;
reg = DEBUG_DUMP_START_REG;
ret = woal_read_reg_eight_bit(phandle, reg, &dump_num);
@ -2102,7 +1998,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, 0))
woal_pcie_rdwr_firmware(phandle, doneflag))
goto done;
memory_size = 0;
reg = DEBUG_DUMP_START_REG;
@ -2146,7 +2042,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, 0);
stat = woal_pcie_rdwr_firmware(phandle, doneflag);
if (RDWR_STATUS_FAILURE == stat)
goto done;
@ -2171,25 +2067,11 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle)
(unsigned int)(dbg_ptr -
mem_type_mapping_tbl[idx]
.mem_Ptr));
#ifdef DUMP_TO_PROC
woal_save_dump_info_to_buf(
phandle,
mem_type_mapping_tbl[idx].mem_Ptr,
memory_size,
mem_type_mapping_tbl[idx].type);
#else
memset(file_name, 0, sizeof(file_name));
sprintf(file_name, "%s%s", "file_pcie_",
mem_type_mapping_tbl[idx].mem_name);
if (MLAN_STATUS_SUCCESS !=
woal_save_dump_info_to_file(
path_name, file_name,
mem_type_mapping_tbl[idx].mem_Ptr,
memory_size))
PRINTM(MMSG,
"Can't save dump file %s in %s\n",
file_name, path_name);
#endif
moal_vfree(phandle,
mem_type_mapping_tbl[idx].mem_Ptr);
mem_type_mapping_tbl[idx].mem_Ptr = NULL;
@ -2197,20 +2079,11 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle)
}
} while (1);
}
#ifdef DUMP_TO_PROC
woal_append_end_block(phandle);
#endif
moal_get_system_time(phandle, &sec, &usec);
PRINTM(MMSG, "====PCIE DEBUG MODE OUTPUT END: %u.%06u ====\n", sec,
usec);
/* end dump fw memory */
#ifndef DUMP_TO_PROC
memset(firmware_dump_file, 0, sizeof(firmware_dump_file));
sprintf(firmware_dump_file, "%s/%s", path_name, file_name);
moal_memcpy_ext(phandle, phandle->firmware_dump_file,
firmware_dump_file, sizeof(firmware_dump_file),
sizeof(phandle->firmware_dump_file));
#endif
done:
for (idx = 0;
idx < dump_num && idx < ARRAY_SIZE(mem_type_mapping_tbl_8897);
@ -2225,6 +2098,8 @@ done:
}
#endif
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
defined(PCIENW62X)
/**
* @brief This function dump firmware memory to file
*
@ -2243,10 +2118,6 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
t_u8 doneflag = 0;
rdwr_status stat;
t_u32 memory_size = 0;
#ifndef DUMP_TO_PROC
t_u8 path_name[64], file_name[32], firmware_dump_file[128];
moal_handle *ref_handle;
#endif
t_u8 *end_ptr = NULL;
memory_type_mapping *mem_type_mapping_tbl = &mem_type_mapping_tbl_8997;
t_u32 dump_start_reg = 0;
@ -2256,32 +2127,19 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
PRINTM(MERROR, "Could not dump firmwware info\n");
return;
}
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (IS_PCIE9098(phandle->card_type) ||
IS_PCIEIW624(phandle->card_type) ||
IS_PCIEAW693(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
if (phandle->event_fw_dump) {
if (RDWR_STATUS_FAILURE !=
woal_pcie_rdwr_firmware(phandle, doneflag, 0)) {
woal_pcie_rdwr_firmware(phandle, doneflag)) {
PRINTM(MMSG,
"====PCIE FW DUMP EVENT MODE START ====\n");
return;
}
}
}
#ifndef DUMP_TO_PROC
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
/** Create dump directory*/
woal_create_dump_dir(phandle, path_name, sizeof(path_name));
#else
memset(path_name, 0, sizeof(path_name));
strcpy(path_name, "/data");
#endif
PRINTM(MMSG, "Create DUMP directory success:dir_name=%s\n", path_name);
ref_handle = (moal_handle *)phandle->pref_mac;
if (ref_handle)
woal_dump_drv_info(ref_handle, path_name);
woal_dump_drv_info(phandle, path_name);
#endif
/* start dump fw memory */
@ -2289,16 +2147,16 @@ 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, 0))
if (RDWR_STATUS_FAILURE == woal_pcie_rdwr_firmware(phandle, doneflag))
goto done;
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
if (IS_PCIE9098(phandle->card_type) ||
IS_PCIEIW624(phandle->card_type) ||
IS_PCIEAW693(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
dump_start_reg = PCIE9098_DUMP_START_REG;
dump_end_reg = PCIE9098_DUMP_END_REG;
}
#endif
#ifdef PCIE8997
if (IS_PCIE8997(phandle->card_type)) {
dump_start_reg = DEBUG_DUMP_START_REG;
@ -2328,7 +2186,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, 0);
stat = woal_pcie_rdwr_firmware(phandle, doneflag);
if (RDWR_STATUS_FAILURE == stat)
goto done;
@ -2381,7 +2239,6 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
mem_type_mapping_tbl->mem_name,
dbg_ptr - mem_type_mapping_tbl->mem_Ptr);
#endif
#ifdef DUMP_TO_PROC
if (phandle->fw_dump_buf) {
moal_vfree(phandle, phandle->fw_dump_buf);
phandle->fw_dump_buf = NULL;
@ -2391,20 +2248,6 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
phandle->fw_dump_len =
dbg_ptr - mem_type_mapping_tbl->mem_Ptr;
mem_type_mapping_tbl->mem_Ptr = NULL;
#else
memset(file_name, 0, sizeof(file_name));
sprintf(file_name, "%s%s", "file_pcie_",
mem_type_mapping_tbl->mem_name);
if (MLAN_STATUS_SUCCESS !=
woal_save_dump_info_to_file(
path_name, file_name,
mem_type_mapping_tbl->mem_Ptr,
dbg_ptr - mem_type_mapping_tbl->mem_Ptr))
PRINTM(MMSG, "Can't save dump file %s in %s\n",
file_name, path_name);
moal_vfree(phandle, mem_type_mapping_tbl->mem_Ptr);
mem_type_mapping_tbl->mem_Ptr = NULL;
#endif
break;
}
} while (1);
@ -2412,13 +2255,6 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
PRINTM(MMSG, "====PCIE DEBUG MODE OUTPUT END: %u.%06u ====\n", sec,
usec);
/* end dump fw memory */
#ifndef DUMP_TO_PROC
memset(firmware_dump_file, 0, sizeof(firmware_dump_file));
sprintf(firmware_dump_file, "%s/%s", path_name, file_name);
moal_memcpy_ext(phandle, phandle->firmware_dump_file,
firmware_dump_file, sizeof(firmware_dump_file),
sizeof(phandle->firmware_dump_file));
#endif
done:
if (mem_type_mapping_tbl->mem_Ptr) {
moal_vfree(phandle, mem_type_mapping_tbl->mem_Ptr);
@ -2427,6 +2263,7 @@ done:
return;
}
#endif
/**
* @brief This function check if this is second mac
@ -2437,30 +2274,26 @@ done:
*/
static t_u8 woal_pcie_is_second_mac(moal_handle *handle)
{
#ifdef PCIE9098
pcie_service_card *card = (pcie_service_card *)handle->card;
if ((card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1) ||
(card->dev->device == PCIE_DEVICE_ID_88WAW693_FN1))
if (card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1)
return MTRUE;
#endif
return MFALSE;
}
static void woal_pcie_dump_fw_info(moal_handle *phandle)
{
#ifdef DUMP_TO_PROC
if (phandle->fw_dump_buf) {
PRINTM(MERROR, "FW dump already exist\n");
return;
}
#endif
mlan_pm_wakeup_card(phandle->pmlan_adapter, MTRUE);
phandle->fw_dump = MTRUE;
#ifdef PCIE8897
if (IS_PCIE8897(phandle->card_type))
woal_pcie_dump_fw_info_v1(phandle);
#endif
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
defined(PCIENW62X)
if (IS_PCIE8997(phandle->card_type) ||
IS_PCIEAW693(phandle->card_type) ||
IS_PCIEIW624(phandle->card_type) ||
IS_PCIENW62X(phandle->card_type) ||
IS_PCIE9098(phandle->card_type) ||
IS_PCIE9097(phandle->card_type)) {
woal_pcie_dump_fw_info_v2(phandle);
@ -2472,11 +2305,10 @@ static void woal_pcie_dump_fw_info(moal_handle *phandle)
return;
}
}
phandle->fw_dump = MFALSE;
if (!phandle->priv_num)
return;
#endif
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);
@ -2485,19 +2317,23 @@ static void woal_pcie_dump_fw_info(moal_handle *phandle)
static mlan_status woal_pcie_get_fw_name(moal_handle *handle)
{
mlan_status ret = MLAN_STATUS_SUCCESS;
#ifdef PCIE9098
pcie_service_card *card = (pcie_service_card *)handle->card;
moal_handle *ref_handle = NULL;
#endif
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
defined(PCIENW62X)
t_u32 rev_id_reg = handle->card_info->rev_id_reg;
t_u32 revision_id = 0;
#endif
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
defined(PCIENW62X)
t_u32 host_strap_reg = handle->card_info->host_strap_reg;
t_u32 magic_reg = handle->card_info->magic_reg;
t_u32 strap = 0;
t_u32 magic = 0;
#ifdef PCIEIW624
t_u32 boot_mode_reg = handle->card_info->boot_mode_reg;
t_u32 boot_mode;
#endif
ENTER();
@ -2651,56 +2487,24 @@ static mlan_status woal_pcie_get_fw_name(moal_handle *handle)
}
}
#endif
if (IS_PCIEAW693(handle->card_type)) {
if (card->dev->device == PCIE_DEVICE_ID_88WAW693_FN0) {
woal_pcie_read_reg(handle, rev_id_reg, &revision_id);
woal_pcie_read_reg(handle, host_strap_reg, &strap);
woal_pcie_read_reg(handle, magic_reg, &magic);
revision_id &= 0xff;
strap &= 0x7;
magic &= 0xff;
PRINTM(MCMND,
"magic=0x%x, strap=0x%x, revision_id=0x%x\n",
magic, strap, revision_id);
if (magic == CHIP_MAGIC_VALUE) {
if (strap == CARD_TYPE_PCIE_UART)
strcpy(handle->card_info->fw_name,
PCIEUARTAW693_DEFAULT_COMBO_FW_NAME);
else
strcpy(handle->card_info->fw_name,
PCIEAW693_DEFAULT_COMBO_FW_NAME);
}
} else {
ref_handle = (moal_handle *)handle->pref_mac;
if (ref_handle) {
strcpy(handle->card_info->fw_name,
ref_handle->card_info->fw_name);
strcpy(handle->card_info->fw_name_wlan,
ref_handle->card_info->fw_name_wlan);
}
}
}
#ifdef PCIEIW624
if (IS_PCIEIW624(handle->card_type)) {
#ifdef PCIENW62X
if (IS_PCIENW62X(handle->card_type)) {
woal_pcie_read_reg(handle, rev_id_reg, &revision_id);
woal_pcie_read_reg(handle, host_strap_reg, &strap);
woal_pcie_read_reg(handle, magic_reg, &magic);
woal_pcie_read_reg(handle, boot_mode_reg, &boot_mode);
revision_id &= 0xff;
strap &= 0x7;
magic &= 0xff;
boot_mode &= 0x03;
PRINTM(MCMND,
"magic=0x%x boot_mode=0x%x, strap=0x%x, revision_id=0x%x\n",
magic, boot_mode, strap, revision_id);
if (boot_mode == 0x03)
PRINTM(MMSG, "wlan: PCIE-IW624 in secure-boot mode\n");
if (strap == CARD_TYPE_PCIEIW624_UART)
strcpy(handle->card_info->fw_name,
PCIEUARTIW624_DEFAULT_COMBO_FW_NAME);
else
strcpy(handle->card_info->fw_name,
PCIEUSBIW624_DEFAULT_COMBO_FW_NAME);
PRINTM(MCMND, "magic=0x%x, strap=0x%x, revision_id=0x%x\n",
magic, strap, revision_id);
if (magic == CHIP_MAGIC_VALUE) {
if (strap == CARD_TYPE_PCIE_UART)
strcpy(handle->card_info->fw_name,
PCIEUARTNW62X_DEFAULT_COMBO_FW_NAME);
else
strcpy(handle->card_info->fw_name,
PCIEUSBNW62X_DEFAULT_COMBO_FW_NAME);
}
}
#endif
done:

View file

@ -4,20 +4,28 @@
* driver.
*
*
* Copyright 2014-2021 NXP
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
@ -47,20 +55,17 @@ Change log:
#define PCIE_DEVICE_ID_88W9097 (0x2b56)
#endif
#ifdef PCIE9098
/** PCIE device ID for 9098 card FN0 */
#define PCIE_DEVICE_ID_88W9098P_FN0 (0x2b43)
/** PCIE device ID for 9098 card FN1 */
#define PCIE_DEVICE_ID_88W9098P_FN1 (0x2b44)
#ifdef PCIEIW624
/** PCIE device ID for IW624 card FN0 */
#define PCIE_DEVICE_ID_88WIW624 (0x3000)
#endif
/** PCIE device ID for AW693 card FN0 */
#define PCIE_DEVICE_ID_88WAW693_FN0 (0x3003)
/** PCIE device ID for AW693 card FN1 */
#define PCIE_DEVICE_ID_88WAW693_FN1 (0x3004)
#ifdef PCIENW62X
/** PCIE device ID for NW62X card FN0 */
#define PCIE_DEVICE_ID_88WNW62X (0x3000)
#endif
#include <linux/version.h>
#include <linux/pci.h>
@ -87,10 +92,6 @@ Change log:
#define PCIE8897_DEFAULT_WLAN_FW_NAME "nxp/pcie8897_wlan.bin"
#endif /* PCIE8897*/
#define PCIEUARTAW693_DEFAULT_COMBO_FW_NAME "nxp/pcieuartAW693_combo.bin"
#define PCIEAW693_DEFAULT_COMBO_FW_NAME "nxp/pcieAW693_wlan.bin"
#define PCIEAW693_DEFAULT_WLAN_FW_NAME "nxp/pcieAW693_wlan.bin"
#ifdef PCIE9098
#define PCIE9098_Z1Z2 0x00
#define PCIE9098_A0 0x01
@ -120,14 +121,18 @@ Change log:
#define PCIE9097_WLAN_V1_FW_NAME "nxp/pcieiw620_wlan_v1.bin"
#endif /* PCIE9097 */
#ifdef PCIEIW624
#define PCIEIW624_DEFAULT_COMBO_FW_NAME "nxp/pcieusbiw624_combo.bin"
#define PCIEUARTIW624_DEFAULT_COMBO_FW_NAME "nxp/pcieuartiw624_combo.bin"
#define PCIEUSBIW624_DEFAULT_COMBO_FW_NAME "nxp/pcieusbiw624_combo.bin"
#define PCIEIW624_DEFAULT_WLAN_FW_NAME "nxp/pcieiw624_wlan.bin"
#endif /* PCIEIW624 */
#ifdef PCIENW62X
#define PCIENW62X_DEFAULT_COMBO_FW_NAME "nxp/pcieusbnw62x_combo.bin"
#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 */
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
#define PCIE_NUM_MSIX_VECTORS 32
#else
#define PCIE_NUM_MSIX_VECTORS 4
#endif
typedef struct _msix_context {
/** pci_dev structure pointer */

View file

@ -5,18 +5,26 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
@ -515,7 +523,7 @@ static int woal_deep_sleep_ioctl(moal_private *priv, struct iwreq *wrq)
*/
static int woal_11n_htcap_cfg(moal_private *priv, struct iwreq *wrq)
{
int data[2] = {0}, copy_len;
int data[2], copy_len;
mlan_ioctl_req *req = NULL;
mlan_ds_11n_cfg *cfg_11n = NULL;
int ret = 0;
@ -691,7 +699,7 @@ done:
*/
static int woal_11n_tx_cfg(moal_private *priv, struct iwreq *wrq)
{
int data[2] = {0}, copy_len;
int data[2], copy_len;
mlan_ioctl_req *req = NULL;
mlan_ds_11n_cfg *cfg_11n = NULL;
int ret = 0;
@ -794,7 +802,7 @@ done:
*/
static int woal_11n_prio_tbl(moal_private *priv, struct iwreq *wrq)
{
int data[MAX_NUM_TID * 2] = {0}, i, j, copy_len;
int data[MAX_NUM_TID * 2], i, j, copy_len;
mlan_ioctl_req *req = NULL;
mlan_ds_11n_cfg *cfg_11n = NULL;
int ret = 0;
@ -886,7 +894,7 @@ error:
*/
static int woal_addba_reject(moal_private *priv, struct iwreq *wrq)
{
int data[MAX_NUM_TID] = {0}, ret = 0, i, copy_len;
int data[MAX_NUM_TID], ret = 0, i, copy_len;
mlan_ioctl_req *req = NULL;
mlan_ds_11n_cfg *cfg_11n = NULL;
int data_length = wrq->u.data.length;
@ -968,7 +976,7 @@ error:
*/
static int woal_addba_para_updt(moal_private *priv, struct iwreq *wrq)
{
int data[5] = {0}, ret = 0, copy_len;
int data[5], ret = 0, copy_len;
mlan_ioctl_req *req = NULL;
mlan_ds_11n_cfg *cfg_11n = NULL;
int data_length = wrq->u.data.length;
@ -1160,9 +1168,7 @@ static int woal_hs_cfg(moal_private *priv, struct iwreq *wrq,
if (data_length && (data[0] != (int)HOST_SLEEP_CFG_CANCEL ||
invoke_hostcmd == MFALSE)) {
memset(&bss_info, 0, sizeof(bss_info));
if (MLAN_STATUS_SUCCESS !=
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info))
PRINTM(MINFO, "Fail to get bss_info\n");
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
if (bss_info.is_hs_configured) {
PRINTM(MERROR, "HS already configured\n");
ret = -EFAULT;
@ -1172,11 +1178,8 @@ static int woal_hs_cfg(moal_private *priv, struct iwreq *wrq,
/* Do a GET first if some arguments are not provided */
if (data_length >= 1 && data_length < 3) {
if (MLAN_STATUS_SUCCESS !=
woal_set_get_hs_params(priv, MLAN_ACT_GET, MOAL_IOCTL_WAIT,
&hscfg)) {
PRINTM(MERROR, "Unable to get HS params\n");
}
woal_set_get_hs_params(priv, MLAN_ACT_GET, MOAL_IOCTL_WAIT,
&hscfg);
}
if (data_length)
@ -1853,9 +1856,10 @@ static int woal_net_monitor_ioctl(moal_private *priv, struct iwreq *wrq)
goto done;
}
/* Supported filter flags */
if (!data[1] || data[1] & ~(MLAN_NETMON_DATA |
MLAN_NETMON_MANAGEMENT |
MLAN_NETMON_CONTROL)) {
if (!data[1] ||
data[1] & ~(MLAN_NETMON_DATA_FRAME |
MLAN_NETMON_MANAGEMENT_FRAME |
MLAN_NETMON_CONTROL_FRAME)) {
PRINTM(MERROR,
"NET_MON: Invalid filter flag\n");
ret = -EINVAL;
@ -1968,144 +1972,130 @@ static int woal_get_log(moal_private *priv, struct iwreq *wrq)
}
if (wrq->u.data.pointer) {
snprintf(buf, GETLOG_BUFSIZE,
"\n"
"mcasttxframe %u\n"
"failed %u\n"
"retry %u\n"
"multiretry %u\n"
"framedup %u\n"
"rtssuccess %u\n"
"rtsfailure %u\n"
"ackfailure %u\n"
"rxfrag %u\n"
"mcastrxframe %u\n"
"fcserror %u\n"
"txframe %u\n"
"wepicverrcnt-1 %u\n"
"wepicverrcnt-2 %u\n"
"wepicverrcnt-3 %u\n"
"wepicverrcnt-4 %u\n"
"beacon_rcnt %u\n"
"beacon_mcnt %u\n",
stats.mcast_tx_frame, stats.failed, stats.retry,
stats.multi_retry, stats.frame_dup, stats.rts_success,
stats.rts_failure, stats.ack_failure, stats.rx_frag,
stats.mcast_rx_frame, stats.fcs_error, stats.tx_frame,
stats.wep_icv_error[0], stats.wep_icv_error[1],
stats.wep_icv_error[2], stats.wep_icv_error[3],
stats.bcn_rcv_cnt, stats.bcn_miss_cnt);
sprintf(buf,
"\n"
"mcasttxframe %u\n"
"failed %u\n"
"retry %u\n"
"multiretry %u\n"
"framedup %u\n"
"rtssuccess %u\n"
"rtsfailure %u\n"
"ackfailure %u\n"
"rxfrag %u\n"
"mcastrxframe %u\n"
"fcserror %u\n"
"txframe %u\n"
"wepicverrcnt-1 %u\n"
"wepicverrcnt-2 %u\n"
"wepicverrcnt-3 %u\n"
"wepicverrcnt-4 %u\n"
"beacon_rcnt %u\n"
"beacon_mcnt %u\n",
stats.mcast_tx_frame, stats.failed, stats.retry,
stats.multi_retry, stats.frame_dup, stats.rts_success,
stats.rts_failure, stats.ack_failure, stats.rx_frag,
stats.mcast_rx_frame, stats.fcs_error, stats.tx_frame,
stats.wep_icv_error[0], stats.wep_icv_error[1],
stats.wep_icv_error[2], stats.wep_icv_error[3],
stats.bcn_rcv_cnt, stats.bcn_miss_cnt);
if (priv->phandle->fw_getlog_enable) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"tx_frag_cnt %u\n", stats.tx_frag_cnt);
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"qos_tx_frag_cnt ");
sprintf(buf + strlen(buf), "tx_frag_cnt %u\n",
stats.tx_frag_cnt);
sprintf(buf + strlen(buf), "qos_tx_frag_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_tx_frag_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_tx_frag_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_failed_cnt ");
sprintf(buf + strlen(buf), "\nqos_failed_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_failed_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_failed_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_retry_cnt ");
sprintf(buf + strlen(buf), "\nqos_retry_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_retry_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_retry_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_multi_retry_cnt ");
sprintf(buf + strlen(buf), "\nqos_multi_retry_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_multi_retry_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_multi_retry_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_frm_dup_cnt ");
sprintf(buf + strlen(buf), "\nqos_frm_dup_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_frm_dup_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_frm_dup_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_rts_suc_cnt ");
sprintf(buf + strlen(buf), "\nqos_rts_suc_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_rts_suc_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_rts_suc_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_rts_failure_cnt ");
sprintf(buf + strlen(buf),
"\nqos_rts_failure_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_rts_failure_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_rts_failure_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_ack_failure_cnt ");
sprintf(buf + strlen(buf), "\nqos_ack_failure_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_ack_failure_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_ack_failure_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_rx_frag_cnt ");
sprintf(buf + strlen(buf), "\nqos_rx_frag_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_rx_frag_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_rx_frag_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_tx_frm_cnt ");
sprintf(buf + strlen(buf), "\nqos_tx_frm_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_tx_frm_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_tx_frm_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_discarded_frm_cnt ");
sprintf(buf + strlen(buf), "\nqos_discarded_frm_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_discarded_frm_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_discarded_frm_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_mpdus_rx_cnt ");
sprintf(buf + strlen(buf), "\nqos_mpdus_rx_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_mpdus_rx_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_mpdus_rx_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nqos_retries_rx_cnt ");
sprintf(buf + strlen(buf), "\nqos_retries_rx_cnt ");
for (i = 0; i < 8; i++) {
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"%u ", stats.qos_retries_rx_cnt[i]);
sprintf(buf + strlen(buf), "%u ",
stats.qos_retries_rx_cnt[i]);
}
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
"\nmgmt_ccmp_replays %u\n"
"tx_amsdu_cnt %u\n"
"failed_amsdu_cnt %u\n"
"retry_amsdu_cnt %u\n"
"multi_retry_amsdu_cnt %u\n"
"tx_octets_in_amsdu_cnt %llu\n"
"amsdu_ack_failure_cnt %u\n"
"rx_amsdu_cnt %u\n"
"rx_octets_in_amsdu_cnt %llu\n"
"tx_ampdu_cnt %u\n"
"tx_mpdus_in_ampdu_cnt %u\n"
"tx_octets_in_ampdu_cnt %llu\n"
"ampdu_rx_cnt %u\n"
"mpdu_in_rx_ampdu_cnt %u\n"
"rx_octets_in_ampdu_cnt %llu\n"
"ampdu_delimiter_crc_error_cnt %u\n",
stats.mgmt_ccmp_replays, stats.tx_amsdu_cnt,
stats.failed_amsdu_cnt, stats.retry_amsdu_cnt,
stats.multi_retry_amsdu_cnt,
stats.tx_octets_in_amsdu_cnt,
stats.amsdu_ack_failure_cnt,
stats.rx_amsdu_cnt,
stats.rx_octets_in_amsdu_cnt,
stats.tx_ampdu_cnt,
stats.tx_mpdus_in_ampdu_cnt,
stats.tx_octets_in_ampdu_cnt,
stats.ampdu_rx_cnt, stats.mpdu_in_rx_ampdu_cnt,
stats.rx_octets_in_ampdu_cnt,
stats.ampdu_delimiter_crc_error_cnt);
sprintf(buf + strlen(buf),
"\nmgmt_ccmp_replays %u\n"
"tx_amsdu_cnt %u\n"
"failed_amsdu_cnt %u\n"
"retry_amsdu_cnt %u\n"
"multi_retry_amsdu_cnt %u\n"
"tx_octets_in_amsdu_cnt %llu\n"
"amsdu_ack_failure_cnt %u\n"
"rx_amsdu_cnt %u\n"
"rx_octets_in_amsdu_cnt %llu\n"
"tx_ampdu_cnt %u\n"
"tx_mpdus_in_ampdu_cnt %u\n"
"tx_octets_in_ampdu_cnt %llu\n"
"ampdu_rx_cnt %u\n"
"mpdu_in_rx_ampdu_cnt %u\n"
"rx_octets_in_ampdu_cnt %llu\n"
"ampdu_delimiter_crc_error_cnt %u\n",
stats.mgmt_ccmp_replays, stats.tx_amsdu_cnt,
stats.failed_amsdu_cnt, stats.retry_amsdu_cnt,
stats.multi_retry_amsdu_cnt,
stats.tx_octets_in_amsdu_cnt,
stats.amsdu_ack_failure_cnt, stats.rx_amsdu_cnt,
stats.rx_octets_in_amsdu_cnt,
stats.tx_ampdu_cnt, stats.tx_mpdus_in_ampdu_cnt,
stats.tx_octets_in_ampdu_cnt,
stats.ampdu_rx_cnt, stats.mpdu_in_rx_ampdu_cnt,
stats.rx_octets_in_ampdu_cnt,
stats.ampdu_delimiter_crc_error_cnt);
}
wrq->u.data.length = MIN(GETLOG_BUFSIZE - 1, strlen(buf) + 1);
if (copy_to_user(wrq->u.data.pointer, buf,
@ -2183,9 +2173,8 @@ static int woal_tx_power_cfg(moal_private *priv, struct iwreq *wrq)
ENTER();
memset(&bss_info, 0, sizeof(bss_info));
if (MLAN_STATUS_SUCCESS !=
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info))
PRINTM(MINFO, "Fail to get bss_info\n");
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
memset(data, 0, sizeof(data));
user_data_len = wrq->u.data.length;
copy_len = MIN(sizeof(data), sizeof(int) * user_data_len);
@ -2706,9 +2695,7 @@ static int woal_set_get_radio(moal_private *priv, struct iwreq *wrq)
ret = -EFAULT;
} else {
/* Get radio status */
if (MLAN_STATUS_SUCCESS !=
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info))
PRINTM(MINFO, "Fail to get bss_info\n");
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
wrq->u.data.length = 1;
if (copy_to_user(wrq->u.data.pointer, &bss_info.radio_on,
sizeof(bss_info.radio_on))) {
@ -3847,35 +3834,33 @@ static int woal_passphrase(moal_private *priv, struct iwreq *wrq)
if (action == 0) {
memset(buf, 0, sizeof(buf));
if (sec->param.passphrase.ssid.ssid_len) {
len += snprintf(buf + len, sizeof(buf), "ssid:");
len += sprintf(buf + len, "ssid:");
moal_memcpy_ext(priv->phandle, buf + len,
sec->param.passphrase.ssid.ssid,
sec->param.passphrase.ssid.ssid_len,
sizeof(buf) - len);
len += sec->param.passphrase.ssid.ssid_len;
len += snprintf(buf + len, sizeof(buf), " ");
len += sprintf(buf + len, " ");
}
if (memcmp(&sec->param.passphrase.bssid, zero_mac,
sizeof(zero_mac))) {
mac = (t_u8 *)&sec->param.passphrase.bssid;
len += snprintf(buf + len, sizeof(buf), "bssid:");
len += sprintf(buf + len, "bssid:");
for (i = 0; i < ETH_ALEN - 1; ++i)
len += snprintf(buf + len, sizeof(buf),
"%02x:", mac[i]);
len += snprintf(buf + len, sizeof(buf), "%02x ",
mac[i]);
len += sprintf(buf + len, "%02x:", mac[i]);
len += sprintf(buf + len, "%02x ", mac[i]);
}
if (sec->param.passphrase.psk_type == MLAN_PSK_PMK) {
len += snprintf(buf + len, sizeof(buf), "psk:");
len += sprintf(buf + len, "psk:");
for (i = 0; i < MLAN_MAX_KEY_LENGTH; ++i)
len += snprintf(
buf + len, sizeof(buf), "%02x",
len += sprintf(
buf + len, "%02x",
sec->param.passphrase.psk.pmk.pmk[i]);
len += snprintf(buf + len, sizeof(buf), "\n");
len += sprintf(buf + len, "\n");
}
if (sec->param.passphrase.psk_type == MLAN_PSK_PASSPHRASE) {
len += snprintf(
buf + len, sizeof(buf), "passphrase:%s\n",
len += sprintf(
buf + len, "passphrase:%s\n",
sec->param.passphrase.psk.passphrase.passphrase);
}
if (wrq->u.data.pointer) {
@ -3995,11 +3980,11 @@ static int woal_get_key_ioctl(moal_private *priv, struct iwreq *wrq)
goto done;
}
if (sec->param.encrypt_key.key_len) {
snprintf((char *)tmp, sizeof(key_ascii), "\n%s", "PTK: ");
sprintf((char *)tmp, "\n%s", "PTK: ");
tmp += 5;
for (i = 0; i < sec->param.encrypt_key.key_len; i++)
tmp += snprintf((char *)tmp, sizeof(key_ascii), "%02x",
sec->param.encrypt_key.key_material[i]);
tmp += sprintf((char *)tmp, "%02x",
sec->param.encrypt_key.key_material[i]);
}
/* Get Multicase Key */
@ -4016,11 +4001,11 @@ static int woal_get_key_ioctl(moal_private *priv, struct iwreq *wrq)
goto done;
}
if (sec->param.encrypt_key.key_len) {
snprintf((char *)tmp, sizeof(key_ascii), "\n%s", "GTK: ");
sprintf((char *)tmp, "\n%s", "GTK: ");
tmp += 5;
for (i = 0; i < sec->param.encrypt_key.key_len; i++)
tmp += snprintf((char *)tmp, sizeof(key_ascii), "%02x",
sec->param.encrypt_key.key_material[i]);
tmp += sprintf((char *)tmp, "%02x",
sec->param.encrypt_key.key_material[i]);
}
/* Get IGTK Key */
@ -4037,11 +4022,11 @@ static int woal_get_key_ioctl(moal_private *priv, struct iwreq *wrq)
goto done;
}
if (sec->param.encrypt_key.key_len) {
snprintf((char *)tmp, sizeof(key_ascii), "\n%s", "IGTK: ");
sprintf((char *)tmp, "\n%s", "IGTK: ");
tmp += 6;
for (i = 0; i < sec->param.encrypt_key.key_len; i++)
tmp += snprintf((char *)tmp, sizeof(key_ascii), "%02x",
sec->param.encrypt_key.key_material[i]);
tmp += sprintf((char *)tmp, "%02x",
sec->param.encrypt_key.key_material[i]);
}
wrq->u.data.length = sizeof(key_ascii) + 1;
@ -4359,7 +4344,7 @@ static int woal_tx_bf_cfg_ioctl(moal_private *priv, struct iwreq *wrq)
*token = '\0';
str = token + 1;
}
(void)woal_atoi(&tmp_val, pos);
woal_atoi(&tmp_val, pos);
switch (i) {
case BF_ENABLE_PARAM:
bf_global->bf_enbl =
@ -4456,11 +4441,11 @@ static int woal_tx_bf_cfg_ioctl(moal_private *priv, struct iwreq *wrq)
bf_cfg.action = BF_CFG_ACT_GET;
} else {
woal_mac2u8(tx_bf_peer->peer_mac, &buf[2]);
(void)woal_atoi(&tmp_val, &buf[20]);
woal_atoi(&tmp_val, &buf[20]);
tx_bf_peer->bf_enbl = (t_u8)tmp_val;
(void)woal_atoi(&tmp_val, &buf[22]);
woal_atoi(&tmp_val, &buf[22]);
tx_bf_peer->sounding_enbl = (t_u8)tmp_val;
(void)woal_atoi(&tmp_val, &buf[24]);
woal_atoi(&tmp_val, &buf[24]);
tx_bf_peer->fb_type = (t_u8)tmp_val;
action = MLAN_ACT_SET;
bf_cfg.action = BF_CFG_ACT_SET;
@ -4515,89 +4500,73 @@ static int woal_tx_bf_cfg_ioctl(moal_private *priv, struct iwreq *wrq)
memset(buf, 0, sizeof(buf));
switch (bf_action) {
case BF_GLOBAL_CONFIGURATION:
data_length += sprintf(buf + data_length, "%d ",
(int)bf_global->bf_enbl);
data_length += sprintf(buf + data_length, "%d ",
(int)bf_global->sounding_enbl);
data_length += sprintf(buf + data_length, "%d ",
(int)bf_global->fb_type);
data_length += sprintf(buf + data_length, "%d ",
(int)bf_global->snr_threshold);
data_length +=
snprintf(buf + data_length, MAX_IN_OUT_CHAR,
"%d ", (int)bf_global->bf_enbl);
data_length +=
snprintf(buf + data_length, MAX_IN_OUT_CHAR,
"%d ", (int)bf_global->sounding_enbl);
data_length +=
snprintf(buf + data_length, MAX_IN_OUT_CHAR,
"%d ", (int)bf_global->fb_type);
data_length +=
snprintf(buf + data_length, MAX_IN_OUT_CHAR,
"%d ", (int)bf_global->snr_threshold);
data_length +=
snprintf(buf + data_length, MAX_IN_OUT_CHAR,
"%d ",
(int)bf_global->sounding_interval);
data_length +=
snprintf(buf + data_length, MAX_IN_OUT_CHAR,
"%d ", (int)bf_global->bf_mode);
sprintf(buf + data_length, "%d ",
(int)bf_global->sounding_interval);
data_length += sprintf(buf + data_length, "%d ",
(int)bf_global->bf_mode);
break;
case SET_GET_BF_PERIODICITY:
data_length +=
snprintf(buf + data_length, MAX_IN_OUT_CHAR,
"%02x:%02x:%02x:%02x:%02x:%02x",
bf_periodicity->peer_mac[0],
bf_periodicity->peer_mac[1],
bf_periodicity->peer_mac[2],
bf_periodicity->peer_mac[3],
bf_periodicity->peer_mac[4],
bf_periodicity->peer_mac[5]);
data_length += snprintf(buf + data_length,
MAX_IN_OUT_CHAR, "%c", ' ');
data_length +=
snprintf(buf + data_length, MAX_IN_OUT_CHAR,
"%d", bf_periodicity->interval);
data_length += sprintf(buf + data_length,
"%02x:%02x:%02x:%02x:%02x:%02x",
bf_periodicity->peer_mac[0],
bf_periodicity->peer_mac[1],
bf_periodicity->peer_mac[2],
bf_periodicity->peer_mac[3],
bf_periodicity->peer_mac[4],
bf_periodicity->peer_mac[5]);
data_length += sprintf(buf + data_length, "%c", ' ');
data_length += sprintf(buf + data_length, "%d",
bf_periodicity->interval);
break;
case TX_BF_FOR_PEER_ENBL:
for (i = 0; i < (int)bf_cfg.no_of_peers; i++) {
data_length += snprintf(
buf + data_length, MAX_IN_OUT_CHAR,
"%02x:%02x:%02x:%02x:%02x:%02x",
tx_bf_peer->peer_mac[0],
tx_bf_peer->peer_mac[1],
tx_bf_peer->peer_mac[2],
tx_bf_peer->peer_mac[3],
tx_bf_peer->peer_mac[4],
tx_bf_peer->peer_mac[5]);
data_length +=
snprintf(buf + data_length,
MAX_IN_OUT_CHAR, "%c", ' ');
data_length += snprintf(buf + data_length,
MAX_IN_OUT_CHAR, "%d;",
tx_bf_peer->bf_enbl);
sprintf(buf + data_length,
"%02x:%02x:%02x:%02x:%02x:%02x",
tx_bf_peer->peer_mac[0],
tx_bf_peer->peer_mac[1],
tx_bf_peer->peer_mac[2],
tx_bf_peer->peer_mac[3],
tx_bf_peer->peer_mac[4],
tx_bf_peer->peer_mac[5]);
data_length +=
snprintf(buf + data_length,
MAX_IN_OUT_CHAR, "%d;",
tx_bf_peer->sounding_enbl);
data_length += snprintf(buf + data_length,
MAX_IN_OUT_CHAR, "%d ",
tx_bf_peer->fb_type);
sprintf(buf + data_length, "%c", ' ');
data_length += sprintf(buf + data_length, "%d;",
tx_bf_peer->bf_enbl);
data_length +=
sprintf(buf + data_length, "%d;",
tx_bf_peer->sounding_enbl);
data_length += sprintf(buf + data_length, "%d ",
tx_bf_peer->fb_type);
tx_bf_peer++;
}
break;
case SET_SNR_THR_PEER:
for (i = 0; i < (int)bf_cfg.no_of_peers; i++) {
data_length += snprintf(
buf + data_length, MAX_IN_OUT_CHAR,
"%02x:%02x:%02x:%02x:%02x:%02x",
bf_snr->peer_mac[0],
bf_snr->peer_mac[1],
bf_snr->peer_mac[2],
bf_snr->peer_mac[3],
bf_snr->peer_mac[4],
bf_snr->peer_mac[5]);
data_length +=
snprintf(buf + data_length,
MAX_IN_OUT_CHAR, "%c", ';');
data_length += snprintf(buf + data_length,
MAX_IN_OUT_CHAR, "%d",
bf_snr->snr);
sprintf(buf + data_length,
"%02x:%02x:%02x:%02x:%02x:%02x",
bf_snr->peer_mac[0],
bf_snr->peer_mac[1],
bf_snr->peer_mac[2],
bf_snr->peer_mac[3],
bf_snr->peer_mac[4],
bf_snr->peer_mac[5]);
data_length +=
snprintf(buf + data_length,
MAX_IN_OUT_CHAR, "%c", ' ');
sprintf(buf + data_length, "%c", ';');
data_length += sprintf(buf + data_length, "%d",
bf_snr->snr);
data_length +=
sprintf(buf + data_length, "%c", ' ');
bf_snr++;
}
break;
@ -4779,7 +4748,6 @@ 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;
}
@ -6135,7 +6103,7 @@ static int woal_dfs_testing(moal_private *priv, struct iwreq *wrq)
mlan_ioctl_req *req = NULL;
mlan_ds_11h_cfg *ds_11hcfg = NULL;
int ret = 0;
int data[4] = {0}, copy_len;
int data[4], copy_len;
int data_length = wrq->u.data.length;
mlan_status status = MLAN_STATUS_SUCCESS;
ENTER();
@ -6298,7 +6266,7 @@ done:
static int woal_cfp_code(moal_private *priv, struct iwreq *wrq)
{
int ret = 0;
int data[2] = {0}, copy_len;
int data[2], copy_len;
int data_length = wrq->u.data.length;
mlan_ioctl_req *req = NULL;
mlan_ds_misc_cfg *misc_cfg = NULL;
@ -6472,7 +6440,7 @@ done:
*/
static int woal_ind_rst_ioctl(moal_private *priv, struct iwreq *wrq)
{
int data[2] = {0}, data_length = wrq->u.data.length, copy_len;
int data[2], data_length = wrq->u.data.length, copy_len;
int ret = 0;
mlan_ds_misc_cfg *misc = NULL;
mlan_ioctl_req *req = NULL;

View file

@ -1,4 +1,3 @@
/** @file moal_priv.h
*
* @brief This file contains definition for extended private IOCTL call.
@ -6,18 +5,26 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/

View file

@ -1,22 +1,30 @@
/** @file moal_proc.c
/** @file moal_proc.c
*
* @brief This file contains functions for proc file.
*
*
* 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
@ -29,10 +37,6 @@ Change log:
#ifdef UAP_SUPPORT
#include "moal_uap.h"
#endif
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
#include "moal_cfg80211.h"
#include "moal_cfg80211_util.h"
#endif
#ifdef SDIO
#include "moal_sdio.h"
#endif
@ -64,9 +68,6 @@ static char *szModes[] = {
};
#endif
mlan_status parse_arguments(t_u8 *pos, int *data, int datalen,
int *user_data_len);
/********************************************************
Global Variables
********************************************************/
@ -88,7 +89,6 @@ 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;
@ -113,8 +113,6 @@ 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)
@ -164,11 +162,6 @@ 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)
@ -416,7 +409,6 @@ static int parse_cmd52_string(const char *buffer, size_t len, int *func,
{
int ret = MLAN_STATUS_SUCCESS;
char *string = NULL;
char *tmp;
char *pos = NULL;
gfp_t flag;
@ -428,7 +420,6 @@ static int parse_cmd52_string(const char *buffer, size_t len, int *func,
moal_memcpy_ext(NULL, string, buffer + strlen("sdcmd52rw="),
len - strlen("sdcmd52rw="), CMD52_STR_LEN - 1);
tmp = string;
string = strstrip(string);
*func = -1;
@ -449,140 +440,12 @@ static int parse_cmd52_string(const char *buffer, size_t len, int *func,
pos = strsep(&string, " \t");
if (pos)
*val = woal_string_to_number(pos);
kfree(tmp);
kfree(string);
LEAVE();
return ret;
}
#endif
void woal_priv_get_tx_rx_ant(struct seq_file *sfp, moal_private *priv)
{
int ret = 0;
int data[4] = {0};
mlan_ds_radio_cfg *radio = NULL;
mlan_ioctl_req *req = NULL;
mlan_status status = MLAN_STATUS_SUCCESS;
ENTER();
if (sfp == NULL) {
PRINTM(MERROR, "Sequence file pointer null\n");
LEAVE();
return;
}
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_radio_cfg));
if (req == NULL) {
PRINTM(MERROR, "Memory allocation failure \n");
LEAVE();
return;
}
radio = (mlan_ds_radio_cfg *)req->pbuf;
radio->sub_command = MLAN_OID_ANT_CFG;
req->req_id = MLAN_IOCTL_RADIO_CFG;
req->action = MLAN_ACT_GET;
status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
if (status == MLAN_STATUS_FAILURE) {
PRINTM(MERROR, "Failed to send IOCTL request to firmware\n");
kfree(req);
LEAVE();
return;
}
if (priv->phandle->feature_control & FEATURE_CTRL_STREAM_2X2) {
data[0] = radio->param.ant_cfg.tx_antenna;
data[1] = radio->param.ant_cfg.rx_antenna;
if (data[0] && data[1])
ret = sizeof(int) * 2;
else
ret = sizeof(int) * 1;
if (ret == sizeof(int) * 1)
seq_printf(sfp, "antcfg=0x%x\n", data[0]);
else if (ret == sizeof(int) * 2)
seq_printf(sfp, "antcfg=0x%x 0x%x\n", data[0], data[1]);
} else {
if (radio->param.ant_cfg_1x1.antenna == 0xffff) {
seq_printf(
sfp, "antcfg=0x%x %d %d\n",
(int)radio->param.ant_cfg_1x1.antenna,
(int)radio->param.ant_cfg_1x1.evaluate_time,
(int)radio->param.ant_cfg_1x1.current_antenna);
} else {
seq_printf(sfp, "antcfg=0x%x\n",
(int)radio->param.ant_cfg_1x1.antenna);
}
}
if (status != MLAN_STATUS_PENDING)
kfree(req);
LEAVE();
return;
}
mlan_status woal_priv_set_tx_rx_ant(moal_handle *handle, char *line)
{
moal_private *priv = NULL;
mlan_ioctl_req *req = NULL;
mlan_ds_radio_cfg *radio = NULL;
mlan_status status;
int data[5] = {0};
int user_data_len = 0;
ENTER();
memset((char *)data, 0, sizeof(data));
parse_arguments(line, data, ARRAY_SIZE(data), &user_data_len);
if (user_data_len > 2) {
PRINTM(MERROR, "Invalid number of args!\n");
LEAVE();
return MLAN_STATUS_FAILURE;
}
priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY);
if (!priv) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
/* Allocate an IOCTL request buffer */
req = (mlan_ioctl_req *)woal_alloc_mlan_ioctl_req(
sizeof(mlan_ds_radio_cfg));
if (req == NULL) {
LEAVE();
return MLAN_STATUS_FAILURE;
}
/* Fill request buffer */
radio = (mlan_ds_radio_cfg *)req->pbuf;
radio->sub_command = MLAN_OID_ANT_CFG;
req->req_id = MLAN_IOCTL_RADIO_CFG;
req->action = MLAN_ACT_SET;
if (handle->feature_control & FEATURE_CTRL_STREAM_2X2) {
radio->param.ant_cfg.tx_antenna = data[0];
radio->param.ant_cfg.rx_antenna = data[0];
if (user_data_len == 2)
radio->param.ant_cfg.rx_antenna = data[1];
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
if (IS_CARD9098(priv->phandle->card_type) ||
IS_CARD9097(priv->phandle->card_type) ||
IS_CARDIW624(priv->phandle->card_type)) {
woal_cfg80211_notify_antcfg(priv, priv->phandle->wiphy,
radio);
}
#endif
} else
radio->param.ant_cfg_1x1.antenna = data[0];
if (user_data_len == 2)
radio->param.ant_cfg_1x1.evaluate_time = data[1];
/* Send IOCTL request to MLAN */
status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
if (status != MLAN_STATUS_PENDING)
kfree(req);
LEAVE();
return status;
}
/**
* @brief config proc write function
*
@ -596,9 +459,8 @@ mlan_status woal_priv_set_tx_rx_ant(moal_handle *handle, char *line)
static ssize_t woal_config_write(struct file *f, const char __user *buf,
size_t count, loff_t *off)
{
char databuf[200];
char databuf[101];
char *line = NULL;
int ret = 0;
t_u32 config_data = 0;
struct seq_file *sfp = f->private_data;
moal_handle *handle = (moal_handle *)sfp->private;
@ -669,14 +531,18 @@ 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) {
handle->fw_dump_status = MTRUE;
#ifdef DEBUG_LEVEL1
drvdbg &= ~MFW_D;
#endif
woal_mlan_debug_info(priv);
woal_moal_debug_info(priv, NULL, MFALSE);
}
}
priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY);
if (priv) {
handle->fw_dump_status = MTRUE;
#ifdef DEBUG_LEVEL1
drvdbg &= ~MFW_D;
#endif
woal_mlan_debug_info(priv);
woal_moal_debug_info(priv, NULL, MFALSE);
handle->ops.dump_fw_info(handle);
@ -708,7 +574,7 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
config_data = FW_RELOAD_SDIO_INBAND_RESET;
#endif
PRINTM(MMSG, "Request fw_reload=%d\n", config_data);
ret = woal_request_fw_reload(handle, config_data);
woal_request_fw_reload(handle, config_data);
}
if (!strncmp(databuf, "drop_point=", strlen("drop_point="))) {
line += strlen("drop_point") + 1;
@ -737,11 +603,6 @@ 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);
@ -795,9 +656,7 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
if (!strncmp(databuf, "he_tb_tx=", strlen("he_tb_tx=")) &&
count > strlen("he_tb_tx="))
cmd = MFG_CMD_CONFIG_MAC_HE_TB_TX;
if (!strncmp(databuf, "trigger_frame=", strlen("trigger_frame=")) &&
count > strlen("trigger_frame="))
cmd = MFG_CMD_CONFIG_TRIGGER_FRAME;
if (cmd && handle->rf_test_mode &&
(woal_process_rf_test_mode_cmd(
handle, cmd, (const char *)databuf, (size_t)count,
@ -806,18 +665,8 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
}
if (cmd && !handle->rf_test_mode)
PRINTM(MERROR, "RF test mode is disabled\n");
if (!strncmp(databuf, "antcfg", strlen("antcfg"))) {
line += strlen("antcfg") + 1;
if (woal_priv_set_tx_rx_ant(handle, line) !=
MLAN_STATUS_SUCCESS)
PRINTM(MERROR, "Could not set Antenna Diversity!!\n");
}
MODULE_PUT;
LEAVE();
if (ret < 0)
return ret;
return (int)count;
}
@ -833,8 +682,6 @@ 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();
@ -846,13 +693,6 @@ 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));
(void)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",
@ -919,7 +759,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, " %d",
seq_printf(sfp, " %u",
handle->rf_data->tx_frame_data[i]);
seq_printf(sfp, " %02x:%02x:%02x:%02x:%02x:%02x",
handle->rf_data->bssid[0],
@ -935,117 +775,10 @@ static int woal_config_read(struct seq_file *sfp, void *data)
seq_printf(sfp, " %u", handle->rf_data->he_tb_tx[1]);
seq_printf(sfp, " %u", handle->rf_data->he_tb_tx[2]);
seq_printf(sfp, " %u", handle->rf_data->he_tb_tx[3]);
seq_printf(sfp, " %d",
handle->rf_data->he_tb_tx_power[0]);
}
seq_printf(sfp, "\n");
seq_printf(sfp, "trigger_frame=%u",
handle->rf_data->mfg_tx_trigger_config.enable_tx);
if (handle->rf_data->mfg_tx_trigger_config.enable_tx == MTRUE) {
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.standalone_hetb);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config.frmCtl
.type);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config.frmCtl
.sub_type);
seq_printf(
sfp, " %u",
handle->rf_data->mfg_tx_trigger_config.duration);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.trigger_type);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.ul_len);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.more_tf);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.cs_required);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.ul_bw);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.ltf_type);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.ltf_mode);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.ltf_symbol);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.ul_stbc);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.ldpc_ess);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.ap_tx_pwr);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.pre_fec_pad_fct);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.pe_disambig);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.spatial_reuse);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.doppler);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_common_field.he_sig2);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_user_info_field.aid12);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_user_info_field.ru_alloc_reg);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_user_info_field.ru_alloc);
seq_printf(
sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_user_info_field.ul_coding_type);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_user_info_field.ul_mcs);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_user_info_field.ul_dcm);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_user_info_field.ss_alloc);
seq_printf(
sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.trig_user_info_field.ul_target_rssi);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.basic_trig_user_info.mpdu_mu_sf);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.basic_trig_user_info.tid_al);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.basic_trig_user_info.ac_pl);
seq_printf(sfp, " %u",
handle->rf_data->mfg_tx_trigger_config
.basic_trig_user_info.pref_ac);
seq_printf(sfp, " %u", handle->rf_data->he_tb_tx[4]);
}
seq_printf(sfp, "\n");
}
// Read current antcfg configuration
woal_priv_get_tx_rx_ant(sfp, priv);
MODULE_PUT;
LEAVE();
return 0;
@ -1081,7 +814,6 @@ static const struct file_operations config_proc_fops = {
};
#endif
#ifdef DUMP_TO_PROC
static int woal_drv_dump_read(struct seq_file *sfp, void *data)
{
moal_handle *handle = (moal_handle *)sfp->private;
@ -1235,7 +967,6 @@ static const struct file_operations fw_dump_fops = {
.release = single_release,
};
#endif
#endif
/**
* @brief wifi status proc read function
@ -1307,11 +1038,11 @@ int woal_string_to_number(char *s)
if (!strncmp(s, "-", 1)) {
pn = -1;
s = (char *)(s + 1);
s++;
}
if (!strncmp(s, "0x", 2) || !strncmp(s, "0X", 2)) {
base = 16;
s = (char *)(s + 2);
s += 2;
} else
base = 10;
@ -1389,10 +1120,8 @@ void woal_proc_init(moal_handle *handle)
struct proc_dir_entry *pde = proc_mwlan;
#endif
char config_proc_dir[20];
#ifdef DUMP_TO_PROC
char drv_dump_dir[20];
char fw_dump_dir[20];
#endif
ENTER();
@ -1434,7 +1163,7 @@ void woal_proc_init(moal_handle *handle)
goto done;
}
strncpy(config_proc_dir, "config", sizeof(config_proc_dir));
strcpy(config_proc_dir, "config");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
r = proc_create_data(config_proc_dir, 0666, handle->proc_wlan,
&config_proc_fops, handle);
@ -1448,8 +1177,7 @@ void woal_proc_init(moal_handle *handle)
if (!r)
PRINTM(MERROR, "Fail to create proc config\n");
#ifdef DUMP_TO_PROC
strncpy(drv_dump_dir, "drv_dump", sizeof(drv_dump_dir));
strcpy(drv_dump_dir, "drv_dump");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
r = proc_create_data(drv_dump_dir, 0644, handle->proc_wlan,
&drv_dump_fops, handle);
@ -1463,7 +1191,7 @@ void woal_proc_init(moal_handle *handle)
if (!r)
PRINTM(MERROR, "Failed to create proc drv dump\n");
strncpy(fw_dump_dir, "fw_dump", sizeof(fw_dump_dir));
strcpy(fw_dump_dir, "fw_dump");
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
r = proc_create_data(fw_dump_dir, 0644, handle->proc_wlan,
&fw_dump_fops, handle);
@ -1476,7 +1204,6 @@ void woal_proc_init(moal_handle *handle)
#endif
if (!r)
PRINTM(MERROR, "Failed to create proc fw dump\n");
#endif
done:
LEAVE();
@ -1492,23 +1219,19 @@ done:
void woal_proc_exit(moal_handle *handle)
{
char config_proc_dir[20];
#ifdef DUMP_TO_PROC
char drv_dump_dir[20];
char fw_dump_dir[20];
#endif
ENTER();
PRINTM(MINFO, "Remove Proc Interface %s\n", handle->proc_wlan_name);
if (handle->proc_wlan) {
strncpy(config_proc_dir, "config", sizeof(config_proc_dir));
strcpy(config_proc_dir, "config");
remove_proc_entry(config_proc_dir, handle->proc_wlan);
#ifdef DUMP_TO_PROC
strncpy(drv_dump_dir, "drv_dump", sizeof(drv_dump_dir));
strcpy(drv_dump_dir, "drv_dump");
remove_proc_entry(drv_dump_dir, handle->proc_wlan);
strncpy(fw_dump_dir, "fw_dump", sizeof(fw_dump_dir));
strcpy(fw_dump_dir, "fw_dump");
remove_proc_entry(fw_dump_dir, handle->proc_wlan);
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
/* Remove only if we are the only instance using this */
@ -1526,7 +1249,6 @@ void woal_proc_exit(moal_handle *handle)
}
#endif
}
#ifdef DUMP_TO_PROC
if (handle->fw_dump_buf) {
moal_vfree(handle, handle->fw_dump_buf);
handle->fw_dump_buf = NULL;
@ -1537,7 +1259,6 @@ void woal_proc_exit(moal_handle *handle)
handle->drv_dump_len = 0;
handle->drv_dump_buf = NULL;
}
#endif
LEAVE();
}
@ -1572,7 +1293,7 @@ void woal_create_proc_entry(moal_private *priv)
LEAVE();
return;
}
strncat(proc_dir_name, dev->name, sizeof(proc_dir_name) - 1);
strcat(proc_dir_name, dev->name);
/* Try to create adapterX/dev_name directory first under
* /proc/mwlan/ */
priv->proc_entry = proc_mkdir(proc_dir_name, proc_mwlan);
@ -1611,7 +1332,7 @@ void woal_create_proc_entry(moal_private *priv)
atomic_inc(&(priv->phandle->proc_wlan->count));
#endif /* < 3.10.0 */
#endif /* < 2.6.26 */
strncpy(priv->proc_entry_name, dev->name, IFNAMSIZ);
strcpy(priv->proc_entry_name, dev->name);
if (priv->proc_entry) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
r = proc_create_data("info", 0, priv->proc_entry,

View file

@ -1,23 +1,30 @@
/** @file moal_sdio.h
*
* @brief This file contains definitions for SDIO interface.
* driver.
* @brief This file contains definitions for SDIO interface.
*
*
* 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
* (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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
/****************************************************
@ -139,17 +146,12 @@ Change log:
#define SD9097_WLAN_V1_FW_NAME "nxp/sdiw620_wlan_v1.bin"
#endif /* SD9097 */
#ifdef SDIW624
#define SDIW624_DEFAULT_COMBO_FW_NAME "nxp/sdsdiw624_combo.bin"
#define SDUARTIW624_COMBO_FW_NAME "nxp/sduartiw624_combo.bin"
#define SDSDIW624_COMBO_FW_NAME "sdsdiw624_combo.bin"
#define SDIW624_DEFAULT_WLAN_FW_NAME "nxp/sdiw624_wlan.bin"
#endif /* SDIW624 */
#define SDAW693_DEFAULT_COMBO_FW_NAME "nxp/sdsd_aw693.bin"
#define SDUARTAW693_COMBO_FW_NAME "nxp/sduart_aw693.bin"
#define SDSDAW693_COMBO_FW_NAME "sdsd_aw693.bin"
#define SDAW693_DEFAULT_WLAN_FW_NAME "nxp/sd_aw693.bin"
#ifdef SDNW62X
#define SDNW62X_DEFAULT_COMBO_FW_NAME "nxp/sdsd_nw62x.bin"
#define SDUARTNW62X_COMBO_FW_NAME "nxp/sduart_nw62x.bin"
#define SDSDNW62X_COMBO_FW_NAME "sdsd_nw62x.bin"
#define SDNW62X_DEFAULT_WLAN_FW_NAME "nxp/sd_nw62x.bin"
#endif /* SDNW62X */
#ifdef SD9177
#define SD9177_A0 0x00
@ -157,14 +159,11 @@ 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 "nxp/sdsd_nw61x.bin"
#define SDSD9177_DEFAULT_COMBO_FW_NAME "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 "nxp/sdsd_nw61x_v1.bin"
#define SDSD9177_DEFAULT_COMBO_V1_FW_NAME "sdsd_nw61x_v1.bin"
#define SD9177_DEFAULT_WLAN_V1_FW_NAME "nxp/sd_w61x_v1.bin"
#define SDUART9177_DEFAULT_RFTM_COMBO_V1_FW_NAME "nxp/sduart_nw61x_rftm_v1.bin"
#define SDSD9177_DEFAULT_RFTM_COMBO_V1_FW_NAME "nxp/sdsd_nw61x_rftm_v1.bin"
#define SD9177_DEFAULT_RFTM_WLAN_V1_FW_NAME "nxp/sd_w61x_rftm_v1.bin"
#endif /* SD9177 */
/********************************************************

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -6,18 +6,26 @@
*
* Copyright 2008-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/
/*************************************************************
@ -95,6 +103,10 @@ mlan_status moal_init_lock(t_void *pmoal, t_void **pplock);
mlan_status moal_free_lock(t_void *pmoal, t_void *plock);
mlan_status moal_spin_lock(t_void *pmoal, t_void *plock);
mlan_status moal_spin_unlock(t_void *pmoal, t_void *plock);
#if defined(DRV_EMBEDDED_AUTHENTICATOR) || defined(DRV_EMBEDDED_SUPPLICANT)
mlan_status moal_wait_hostcmd_complete(t_void *pmoal, t_u32 bss_index);
mlan_status moal_notify_hostcmd_complete(t_void *pmoal, t_u32 bss_index);
#endif
t_void moal_print(t_void *pmoal, t_u32 level, char *pformat, IN...);
t_void moal_print_netintf(t_void *pmoal, t_u32 bss_index, t_u32 level);
t_void moal_assert(t_void *pmoal, t_u32 cond);

File diff suppressed because it is too large Load diff

View file

@ -5,18 +5,26 @@
*
* Copyright 2011-2021 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.
* NXP CONFIDENTIAL
* The source code contained or described herein and all documents related to
* the source code (Materials) are owned by NXP, its
* suppliers and/or its licensors. Title to the Materials remains with NXP,
* its suppliers and/or its licensors. The Materials contain
* trade secrets and proprietary and confidential information of NXP, its
* suppliers and/or its licensors. The Materials are protected by worldwide
* copyright and trade secret laws and treaty provisions. No part of the
* Materials may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without NXP's prior
* express written permission.
*
* 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.
* No license under any patent, copyright, trade secret or other intellectual
* property right is granted to or conferred upon you by disclosure or delivery
* of the Materials, either expressly, by implication, inducement, estoppel or
* otherwise. Any license under such intellectual property rights must be
* express and approved by NXP in writing.
*
* Alternatively, this software may be distributed under the terms of GPL v2.
* SPDX-License-Identifier: GPL-2.0
*
*/

Some files were not shown because too many files have changed in this diff Show more