mirror of
https://github.com/nxp-imx/mwifiex.git
synced 2024-06-02 08:59:23 +00:00
Compare commits
45 commits
lf-5.15.32
...
android-14
Author | SHA1 | Date | |
---|---|---|---|
91f6b99cf0 | |||
44ed1ebb6a | |||
1cda5f90c7 | |||
33e644c3e1 | |||
e6e7751008 | |||
5de735a978 | |||
cb6c58e463 | |||
000443c54d | |||
4304ad6450 | |||
f84ecea53f | |||
5778995884 | |||
9fdb8ae8f0 | |||
781effe72a | |||
952cbd9afd | |||
b23acc414c | |||
1d96ff12f2 | |||
b4a6d35c78 | |||
5d6a2cc546 | |||
a7f96835dc | |||
c847fbe032 | |||
e1b6635d62 | |||
8a2d3d5f7f | |||
cbd4075ca1 | |||
002406b866 | |||
ecebb751f7 | |||
e53ca7fd5f | |||
7baf4ff40d | |||
d212de6a8a | |||
be8812297a | |||
038b0cfd14 | |||
61277b67f5 | |||
b75d3eed93 | |||
ecb4c6f27f | |||
5a38226a47 | |||
65ddf89682 | |||
d88bd98445 | |||
fb098b07fc | |||
a036032a76 | |||
3bcb60dc2b | |||
9a15e44e49 | |||
30f40263eb | |||
880a3f5b7b | |||
a0835444f1 | |||
c874a3d10c | |||
638d8eae2a |
13
SCR.txt
Normal file
13
SCR.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
NXP Software Content Register
|
||||
|
||||
--------------------------------------------
|
||||
|
||||
Package: mwifiex.git
|
||||
Outgoing License: GPL-2.0
|
||||
License File: mxm_wifiex/wlan_src/gpl-2.0.txt
|
||||
Type of content: source
|
||||
Description and comments: NXP Wi-Fi linux SDK
|
||||
Release Location: https://github.com/nxp-imx/mwifiex
|
||||
Origin: NXP (GPL-2.0)
|
||||
|
||||
--------------------------------------------
|
44
mxm_wifiex/mxmwifi.mk
Normal file
44
mxm_wifiex/mxmwifi.mk
Normal file
|
@ -0,0 +1,44 @@
|
|||
# Copyright 2021 NXP
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
KERNEL_SRC := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ
|
||||
TARGET_ARCH := $(TARGET_KERNEL_ARCH)
|
||||
MXMWIFI_CROSS_COMPILE := aarch64-linux-gnu-
|
||||
|
||||
MXMWIFI_SRC_PATH := $(MXMWIFI_PATH)/mxm_wifiex/wlan_src
|
||||
MXMWIFI_OUT := $(TARGET_OUT_INTERMEDIATES)/MXMWIFI_OBJ
|
||||
|
||||
KERNEL_CFLAGS ?= KCFLAGS=-mno-android
|
||||
ARCH ?= $(TARGET_ARCH)
|
||||
|
||||
MXMWIFI_KERNELENVSH := $(MXMWIFI_OUT)/kernelenv.sh
|
||||
.PHONY: $(MXMWIFI_KERNELENVSH)
|
||||
$(MXMWIFI_KERNELENVSH):
|
||||
mkdir -p $(MXMWIFI_OUT)
|
||||
echo 'export KERNEL_SRC=$(KERNEL_SRC)' > $(MXMWIFI_KERNELENVSH)
|
||||
echo 'export CROSS_COMPILE=$(MXMWIFI_CROSS_COMPILE)' >> $(MXMWIFI_KERNELENVSH)
|
||||
echo 'export ARCH=$(ARCH)' >> $(MXMWIFI_KERNELENVSH)
|
||||
|
||||
mxmwifi: $(MXMWIFI_KERNELENVSH) $(MXMWIFI_SRC_PATH)
|
||||
$(hide) if [ ${clean_build} = 1 ]; then \
|
||||
PATH=$$PATH $(MAKE) -C $(MXMWIFI_SRC_PATH) ANDROID=yes clean; \
|
||||
fi
|
||||
@ . $(MXMWIFI_KERNELENVSH); $(kernel_build_shell_env) \
|
||||
$(MAKE) -C $(MXMWIFI_SRC_PATH) ANDROID=yes \
|
||||
$(CLANG_TO_COMPILE) \
|
||||
$(KERNEL_CFLAGS) \
|
||||
ARCH=$(ARCH) \
|
||||
DEBUG=$(DEBUG);
|
||||
cp $(MXMWIFI_SRC_PATH)/mlan.ko $(MXMWIFI_OUT);
|
||||
cp $(MXMWIFI_SRC_PATH)/moal.ko $(MXMWIFI_OUT);
|
21
mxm_wifiex/wlan_src/BUILD.bazel
Normal file
21
mxm_wifiex/wlan_src/BUILD.bazel
Normal file
|
@ -0,0 +1,21 @@
|
|||
# NOTE: THIS FILE IS EXPERIMENTAL FOR THE BAZEL MIGRATION AND NOT USED FOR
|
||||
# YOUR BUILDS CURRENTLY.
|
||||
#
|
||||
# It is not yet the source of truth for your build. If you're looking to modify
|
||||
# the build file, modify the Android.bp file instead. Do *not* modify this file
|
||||
# unless you have coordinated with the team managing the Soong to Bazel
|
||||
# migration.
|
||||
|
||||
load("//build/kernel/kleaf:kernel.bzl", "kernel_module")
|
||||
|
||||
kernel_module(
|
||||
name = "wlan.imx",
|
||||
outs = [
|
||||
"mlan.ko",
|
||||
"moal.ko",
|
||||
],
|
||||
kernel_build = "//common:imx",
|
||||
visibility = [
|
||||
"//common:__pkg__",
|
||||
],
|
||||
)
|
|
@ -1,6 +1,6 @@
|
|||
# File: Makefile
|
||||
#
|
||||
# Copyright 2008-2022 NXP
|
||||
# Copyright 2008-2023 NXP
|
||||
#
|
||||
# This software file (the File) is distributed by NXP
|
||||
# under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -20,13 +20,13 @@ 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
|
||||
BACKUP= /root/backup
|
||||
YMD= `date +%Y%m%d%H%M`
|
||||
PWD := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
M ?= $(shell pwd)
|
||||
|
||||
#############################################################################
|
||||
# Configuration Options
|
||||
|
@ -44,7 +44,7 @@ CONFIG_USB8997=n
|
|||
CONFIG_PCIE8997=y
|
||||
CONFIG_SD8987=y
|
||||
CONFIG_SD9097=n
|
||||
CONFIG_SD9177=n
|
||||
CONFIG_SD9177=y
|
||||
CONFIG_SD8801=y
|
||||
CONFIG_USB8801=n
|
||||
CONFIG_USB9097=n
|
||||
|
@ -52,9 +52,12 @@ CONFIG_PCIE9097=n
|
|||
CONFIG_SD9098=y
|
||||
CONFIG_USB9098=n
|
||||
CONFIG_PCIE9098=y
|
||||
CONFIG_SDNW62X=n
|
||||
CONFIG_PCIENW62X=n
|
||||
CONFIG_USBNW62X=n
|
||||
CONFIG_SDIW624=n
|
||||
CONFIG_SDAW693=n
|
||||
CONFIG_PCIEIW624=n
|
||||
CONFIG_USBIW624=n
|
||||
CONFIG_PCIEAW693=n
|
||||
|
||||
|
||||
|
||||
# Debug Option
|
||||
|
@ -84,30 +87,27 @@ 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
|
||||
CONFIG_SDIO_SUSPEND_RESUME=y
|
||||
#endif
|
||||
|
||||
# DFS testing support
|
||||
CONFIG_DFS_TESTING_SUPPORT=y
|
||||
|
||||
# Multi-channel support
|
||||
CONFIG_MULTI_CHAN_SUPPORT=y
|
||||
|
||||
|
||||
|
||||
# Use static link for app build
|
||||
export CONFIG_STATIC_LINK=y
|
||||
CONFIG_ANDROID_KERNEL=n
|
||||
CONFIG_DUMP_TO_PROC=y
|
||||
|
||||
CONFIG_TASKLET_SUPPORT=y
|
||||
|
||||
|
||||
#32bit app over 64bit kernel support
|
||||
CONFIG_USERSPACE_32BIT_OVER_KERNEL_64BIT=n
|
||||
|
@ -118,9 +118,10 @@ CONFIG_USERSPACE_32BIT_OVER_KERNEL_64BIT=n
|
|||
#############################################################################
|
||||
|
||||
MODEXT = ko
|
||||
ccflags-y += -I$(PWD)/mlan
|
||||
ccflags-y += -I$(M)/mlan
|
||||
ccflags-y += -DLINUX
|
||||
|
||||
KERNELDIR ?= $(KERNEL_SRC)
|
||||
|
||||
|
||||
|
||||
|
@ -130,13 +131,16 @@ 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
|
||||
|
||||
BINDIR = ../bin_wlan
|
||||
BINDIR = ../bin_mxm_wifiex
|
||||
APPDIR= $(shell if test -d "mapp"; then echo mapp; fi)
|
||||
|
||||
#############################################################################
|
||||
|
@ -188,16 +192,21 @@ 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
|
||||
|
||||
#ifdef SDIO_MMC
|
||||
ifeq ($(CONFIG_SDIO_SUSPEND_RESUME),y)
|
||||
ccflags-y += -DSDIO_SUSPEND_RESUME
|
||||
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
|
||||
|
@ -206,6 +215,15 @@ 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_TASKLET_SUPPORT), y)
|
||||
ccflags-y += -DTASKLET_SUPPORT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OPENWRT_SUPPORT), y)
|
||||
|
@ -246,9 +264,13 @@ ifeq ($(CONFIG_SD9097),y)
|
|||
CONFIG_SDIO=y
|
||||
ccflags-y += -DSD9097
|
||||
endif
|
||||
ifeq ($(CONFIG_SDNW62X),y)
|
||||
ifeq ($(CONFIG_SDIW624),y)
|
||||
CONFIG_SDIO=y
|
||||
ccflags-y += -DSDNW62X
|
||||
ccflags-y += -DSDIW624
|
||||
endif
|
||||
ifeq ($(CONFIG_SDAW693),y)
|
||||
CONFIG_SDIO=y
|
||||
ccflags-y += -DSDAW693
|
||||
endif
|
||||
ifeq ($(CONFIG_SD9177),y)
|
||||
CONFIG_SDIO=y
|
||||
|
@ -282,9 +304,9 @@ ifeq ($(CONFIG_USB9097),y)
|
|||
CONFIG_MUSB=y
|
||||
ccflags-y += -DUSB9097
|
||||
endif
|
||||
ifeq ($(CONFIG_USBNW62X),y)
|
||||
ifeq ($(CONFIG_USBIW624),y)
|
||||
CONFIG_MUSB=y
|
||||
ccflags-y += -DUSBNW62X
|
||||
ccflags-y += -DUSBIW624
|
||||
endif
|
||||
ifeq ($(CONFIG_USB9098),y)
|
||||
CONFIG_MUSB=y
|
||||
|
@ -306,9 +328,13 @@ ifeq ($(CONFIG_PCIE9098),y)
|
|||
CONFIG_PCIE=y
|
||||
ccflags-y += -DPCIE9098
|
||||
endif
|
||||
ifeq ($(CONFIG_PCIENW62X),y)
|
||||
ifeq ($(CONFIG_PCIEIW624),y)
|
||||
CONFIG_PCIE=y
|
||||
ccflags-y += -DPCIENW62X
|
||||
ccflags-y += -DPCIEIW624
|
||||
endif
|
||||
ifeq ($(CONFIG_PCIEAW693),y)
|
||||
CONFIG_PCIE=y
|
||||
ccflags-y += -DPCIEAW693
|
||||
endif
|
||||
ifeq ($(CONFIG_SDIO),y)
|
||||
ccflags-y += -DSDIO
|
||||
|
@ -332,14 +358,14 @@ ifeq ($(CONFIG_MAC80211_SUPPORT_MESH),y)
|
|||
endif
|
||||
|
||||
# add -Wno-packed-bitfield-compat when GCC version greater than 4.4
|
||||
GCC_VERSION := $(shell echo `gcc -dumpversion | cut -f1-2 -d.` \>= 4.4 | sed -e 's/\./*100+/g' | bc )
|
||||
ifeq ($(GCC_VERSION),1)
|
||||
ccflags-y += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
WimpGCC_VERSION := $(shell echo `gcc -dumpversion | cut -f1 -d.`| bc )
|
||||
ifeq ($(shell test $(WimpGCC_VERSION) -ge 7; echo $$?),0)
|
||||
ccflags-y += -Wimplicit-fallthrough=3
|
||||
endif
|
||||
#GCC_VERSION := $(shell echo `gcc -dumpversion | cut -f1-2 -d.` \>= 4.4 | sed -e 's/\./*100+/g' | bc )
|
||||
#ifeq ($(GCC_VERSION),1)
|
||||
#ccflags-y += -Wno-packed-bitfield-compat
|
||||
#endif
|
||||
|
||||
#ifeq ($(shell test $(WimpGCC_VERSION) -ge 7; echo $$?),0)
|
||||
#ccflags-y += -Wimplicit-fallthrough=3
|
||||
#endif
|
||||
#ccflags-y += -Wunused-but-set-variable
|
||||
#ccflags-y += -Wmissing-prototypes
|
||||
#ccflags-y += -Wold-style-definition
|
||||
|
@ -353,7 +379,6 @@ endif
|
|||
#ccflags-y += -Wstringop-truncation
|
||||
#ccflags-y += -Wmisleading-indentation
|
||||
#ccflags-y += -Wunused-const-variable
|
||||
ccflags-y += -Wno-array-bounds
|
||||
#############################################################################
|
||||
# Make Targets
|
||||
#############################################################################
|
||||
|
@ -472,7 +497,6 @@ endif
|
|||
|
||||
|
||||
|
||||
|
||||
MOALOBJS = mlinux/moal_main.o \
|
||||
mlinux/moal_ioctl.o \
|
||||
mlinux/moal_shim.o \
|
||||
|
@ -573,19 +597,19 @@ moal-objs := $(MOALOBJS)
|
|||
else
|
||||
|
||||
default:
|
||||
$(MAKE) -C $(KERNELDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
|
||||
$(MAKE) -C $(KERNELDIR) M=$(M) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
|
||||
|
||||
modules_install:
|
||||
$(MAKE) -C $(KERNELDIR) M=$(M) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules_install
|
||||
endif
|
||||
|
||||
###############################################################
|
||||
|
||||
export CC LD ccflags-y KERNELDIR
|
||||
|
||||
.PHONY: mapp/mlanconfig mapp/mlanutl clean distclean
|
||||
.PHONY: mapp/mlanutl clean distclean
|
||||
@echo "Finished Making NXP Wlan Linux Driver"
|
||||
|
||||
mapp/mlanconfig:
|
||||
$(MAKE) -C $@
|
||||
mapp/mlanutl:
|
||||
$(MAKE) -C $@
|
||||
|
||||
|
@ -597,9 +621,10 @@ appsbuild:
|
|||
mkdir $(BINDIR); \
|
||||
fi
|
||||
|
||||
cp -f README_MLAN $(BINDIR)
|
||||
cp -f README $(BINDIR)
|
||||
cp -rf mapp/mlanconfig/config $(BINDIR)
|
||||
|
||||
ifneq ($(APPDIR),)
|
||||
$(MAKE) -C mapp/mlanconfig $@ INSTALLDIR=$(BINDIR)
|
||||
$(MAKE) -C mapp/mlanutl $@ INSTALLDIR=$(BINDIR)
|
||||
endif
|
||||
|
||||
|
@ -615,9 +640,10 @@ build: echo default
|
|||
cp -rpf script/load $(BINDIR)/
|
||||
cp -rpf script/unload $(BINDIR)/
|
||||
|
||||
cp -f README_MLAN $(BINDIR)
|
||||
cp -f README $(BINDIR)
|
||||
cp -rf mapp/mlanconfig/config $(BINDIR)
|
||||
|
||||
ifneq ($(APPDIR),)
|
||||
$(MAKE) -C mapp/mlanconfig $@ INSTALLDIR=$(BINDIR)
|
||||
$(MAKE) -C mapp/mlanutl $@ INSTALLDIR=$(BINDIR)
|
||||
endif
|
||||
|
||||
|
@ -633,7 +659,6 @@ clean:
|
|||
-find . -name "*dwo" -exec rm {} \;
|
||||
-rm -rf .tmp_versions
|
||||
ifneq ($(APPDIR),)
|
||||
$(MAKE) -C mapp/mlanconfig $@
|
||||
$(MAKE) -C mapp/mlanutl $@
|
||||
endif
|
||||
#ifdef SDIO
|
||||
|
@ -663,7 +688,6 @@ distclean:
|
|||
-find . -name "*dwo" -exec rm {} \;
|
||||
-rm -rf .tmp_versions
|
||||
ifneq ($(APPDIR),)
|
||||
$(MAKE) -C mapp/mlanconfig $@
|
||||
$(MAKE) -C mapp/mlanutl $@
|
||||
endif
|
||||
|
||||
|
|
1191
mxm_wifiex/wlan_src/README
Executable file
1191
mxm_wifiex/wlan_src/README
Executable file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
9
mxm_wifiex/wlan_src/mapp/mlanconfig/Android.mk
Normal file
9
mxm_wifiex/wlan_src/mapp/mlanconfig/Android.mk
Normal file
|
@ -0,0 +1,9 @@
|
|||
LOCAL_PATH := $(my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := mlanconfig
|
||||
OBJS = mlanconfig.c mlanhostcmd.c mlanmisc.c
|
||||
LOCAL_SRC_FILES := $(OBJS)
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
||||
include $(BUILD_EXECUTABLE)
|
|
@ -1,46 +0,0 @@
|
|||
#
|
||||
# File : mlanconfig/Makefile
|
||||
#
|
||||
# Copyright 2008-2020 NXP
|
||||
|
||||
# Path to the top directory of the mlandriver distribution
|
||||
PATH_TO_TOP = ../..
|
||||
|
||||
# Determine how we should copy things to the install directory
|
||||
ABSPATH := $(filter /%, $(INSTALLDIR))
|
||||
RELPATH := $(filter-out /%, $(INSTALLDIR))
|
||||
INSTALLPATH := $(ABSPATH)
|
||||
ifeq ($(strip $(INSTALLPATH)),)
|
||||
INSTALLPATH := $(PATH_TO_TOP)/$(RELPATH)
|
||||
endif
|
||||
|
||||
# Override CFLAGS for application sources, remove __ kernel namespace defines
|
||||
CFLAGS := $(filter-out -D__%, $(ccflags-y))
|
||||
# remove KERNEL include dir
|
||||
CFLAGS := $(filter-out -I$(KERNELDIR)%, $(CFLAGS))
|
||||
|
||||
#
|
||||
# List of application executables to create
|
||||
#
|
||||
TARGETS := $(exectarget)
|
||||
|
||||
#
|
||||
# Make target rules
|
||||
#
|
||||
|
||||
# All rule compiles list of TARGETS using builtin program target from src rule
|
||||
all :
|
||||
$(exectarget): $(libobjs)
|
||||
$(CC) $(CFLAGS) $(libobjs) -o $(exectarget)
|
||||
|
||||
# Update any needed TARGETS and then copy to the install path
|
||||
build install: $(TARGETS)
|
||||
@cp -rf config $(INSTALLPATH)
|
||||
|
||||
clean:
|
||||
@rm -f $(exectarget)
|
||||
@rm -f *.o
|
||||
|
||||
distclean: clean
|
||||
@rm -f *~ core
|
||||
@rm -f tags
|
|
@ -106,21 +106,8 @@ get_15_4_stats={
|
|||
BCAArbitrationTLVType:2=0x024F # do NOT change this line
|
||||
RobustCoexTlvLength:2={
|
||||
Version:2=0x1 # Firecrest
|
||||
Action:2=1 # GET 15.4 Statistics
|
||||
Action:2=2 # 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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# File : robust_btc_MM.conf
|
||||
# File : robust_btc.conf
|
||||
|
||||
######################### Robust Coex command ###############
|
||||
mode_get={
|
||||
|
@ -14,9 +14,43 @@ mode_get={
|
|||
}
|
||||
}
|
||||
|
||||
mode_timeshare={
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=1 # SET
|
||||
RSVD:2=0
|
||||
|
||||
# Robust Coex Mode TLV
|
||||
RobustCoexTlvType:2=0x0160
|
||||
RobustCoexTlvLength:2={
|
||||
# All the modes below are mutually exclusive of each other;
|
||||
Enable:1=0x01 # Bit0: Enable 2x2 or 1x1 Time Distribute(TMD)
|
||||
# Robust Coex(RBC) mode, when uAP bss start,
|
||||
# uAP TMD RBC scheme is enabled,
|
||||
# STA TMD RBC scheme is disabled.
|
||||
Reserved:3=0
|
||||
}
|
||||
}
|
||||
|
||||
mode_spatial={
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=1 # SET
|
||||
RSVD:2=0
|
||||
|
||||
# Robust Coex Mode TLV
|
||||
RobustCoexTlvType:2=0x0160
|
||||
RobustCoexTlvLength:2={
|
||||
# All the modes below are mutually exclusive of each other;
|
||||
Enable:1=0x82 # Bit1: Enable 1x1 SMPS Spatial RBC Mode, e.g. 0x02
|
||||
# Bit7: Enable uAP+STA SMPS RBC Mode,
|
||||
# when uAP bss start, uAP SMPS RBC scheme enable,
|
||||
# must combined with BIT1 or BIT2, e.g. 0x82, 0x84.
|
||||
Reserved:3=0
|
||||
}
|
||||
}
|
||||
|
||||
mode_none={
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=1 # SET
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=1 # SET
|
||||
RSVD:2=0
|
||||
|
||||
# Robust Coex Mode TLV
|
||||
|
@ -41,3 +75,221 @@ mode_bca={
|
|||
Reserved:3=0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mode_2={
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=1 # SET
|
||||
RSVD:2=0
|
||||
|
||||
# Robust Coex Mode TLV
|
||||
RobustCoexTlvType:2=0x0160
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:1=0x20 # Concurrent Coex mode with Tx power control and Rx De-sense.
|
||||
# Used for chips which has separate antenna for BT
|
||||
Reserved:3=0
|
||||
}
|
||||
}
|
||||
|
||||
gpio_cfg={
|
||||
CmdCode=0x00e0 # do NOT change this line
|
||||
Action:2=1 # SET
|
||||
RSVD:2=0
|
||||
|
||||
# Robust Coex Mode TLV
|
||||
RobustCoexTlvType:2=0x021B
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:1=0x1 # enable GPIO cfg for external bt request
|
||||
gpionum:1=4 # gpio 4
|
||||
gpiopolarity:1=1 # Polarity High
|
||||
}
|
||||
}
|
||||
|
||||
external_coex_config={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1 //0x0 get, 0x1 set
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0238 //TLV ID
|
||||
RobustCoexTlvLength:2={
|
||||
Enabled:1=0x01 // 0x00 disable, 0x01 enable
|
||||
|
||||
ExtHighInputPriority:1=0x02 // Input priority: 0x00 Input Low Priority, 0x01 Input Medium Priority, 0x02 Input High Priority
|
||||
ExtLowInputPriority:1=0x02
|
||||
|
||||
ExtPriGPIONum:1=0x06; // Input Priority signal GPIO pin number
|
||||
ExtPriGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High
|
||||
|
||||
ExtReqGPIONum:1=0x07; // Input Request signal GPIO pin number
|
||||
ExtReqGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High
|
||||
|
||||
ExtGrntGPIONum:1=0x05; // Output Grant signal GPIO pin number
|
||||
ExtGrntGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
external_coex_uwb_config={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1 # 0x0 get, 0x1 set
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0238 # TLV ID
|
||||
RobustCoexTlvLength:2={
|
||||
Enabled:1=0x03 # 0x03 to configure UWB
|
||||
}
|
||||
}
|
||||
|
||||
external_coex_config_2={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1 //0x0 get, 0x1 set
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0238 //TLV ID
|
||||
RobustCoexTlvLength:2={
|
||||
Enabled:1=0x02 // 0x00 disable, 0x02 enable (KF2, Fixed GPIO external COEX)
|
||||
|
||||
ExtHighInputPriority:1=0x02 // Input priority: 0x00 Input Low Priority, 0x01 Input Medium Priority, 0x02 Input High Priority
|
||||
ExtLowInputPriority:1=0x02
|
||||
}
|
||||
}
|
||||
|
||||
external_coex_uart_config={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1 //0x0 get, 0x1 set
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0238 //TLV ID
|
||||
RobustCoexTlvLength:2={
|
||||
Enabled:1=0x04 // 0x00 disable, 0x04: UART enable
|
||||
Loopback:1=0x00 // 0x00 Loopback disable, 0x01 Loopback enable 0x02 UARTGPIO, 0x06 Get LTE Stats, 0x05 Clear LTE stats
|
||||
BaudRate:4=4000000 // UART Baud Rate, 4000000: 4M baudrate, 3000000 = 3M baudrate
|
||||
}
|
||||
}
|
||||
|
||||
external_coex_pta_config={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1 // 0x0 get, 0x1 set
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0238 // TLV ID
|
||||
RobustCoexTlvLength:2={
|
||||
Enabled:1=0x05 // 0x00 disable, 0x01 enable
|
||||
ExtWifiBtArb:1=0x01 // 0x00 disable, 0x01 enable
|
||||
PolGrantPin:1=0x01 // 0x00 active high, 0x01 active low
|
||||
EnablePriPtaInt:1=0x01 // 0x00 disable, 0x01 enable
|
||||
EnableStateFromPta:1=0x02 // 0x00 state input disable
|
||||
// 0x01 state info is from state pin
|
||||
// 0x02 state info is sampled on priority pin.
|
||||
SetPriSampTiming:2=100 // Timing to sample Priority bit
|
||||
SetStateInfoSampTiming:2=100 // Timing to sample Tx/Rx info
|
||||
ExtRadioTrafficPrio:1=0x01 // 0x00 disable, 0x01 enable external traffic Tx/Rx Priority.
|
||||
ExtCoexHwIntWci2:1=0x00 // 0x00 disable, 0x01 enable(wci-2 interface)
|
||||
}
|
||||
}
|
||||
|
||||
#In Station generic case
|
||||
#BT time is set as BTTime
|
||||
#Wlan time is set as Wlan Time
|
||||
generictime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0390
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTime:2=10 #(12.5ms)Enter value in Units (1Unit = 1.25ms), BTTime must be less than 65535
|
||||
WlanTime:2=20 #(25ms)Enter value in Units (1Unit = 1.25ms), WlanTime must be less than 65535
|
||||
}
|
||||
}
|
||||
|
||||
#WLAN duty low prio time is set as WlanLowPrioTime
|
||||
#WLAN duty total time is set as TotalTime
|
||||
wlandutytime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0390
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x02 # Enable = 1 is for generic time, 0x02 for Dutycycle feature, 0x03 disables DutyCycle feature
|
||||
WlanLowPrioTime:2=30 #(30ms)Enter value in Units (1Unit = 1ms), keep it less than TotalTime
|
||||
TotalTime:2=100 #(100ms)Enter value in Units (1Unit = 1ms), TotalTime must be <= 100
|
||||
}
|
||||
}
|
||||
|
||||
#In Station A2DP case
|
||||
#BT time is set as BTTime
|
||||
#Wlan time is set as Wlan Time
|
||||
a2dptime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0391
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTime:2=10000 #(10ms) BTTime must be less than 65535
|
||||
WlanTime:2=39500 #(39.5ms) WlanTime must be less than 65535
|
||||
}
|
||||
}
|
||||
|
||||
#In Station inquiry case
|
||||
#BT time is set as BTTime
|
||||
#Wlan time is set as Wlan Time
|
||||
inquirytime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0392
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTime:2=21215 #(21.215ms) BTTime must be less than 65535
|
||||
WlanTime:2=11000 #(11ms) WlanTime must be less than 65535
|
||||
}
|
||||
}
|
||||
|
||||
#In Ap generic case
|
||||
#BT time is BTTimeBusy when BT has traffic
|
||||
#BT time is BTTimeIdle when BT is idle
|
||||
#Wlan time is WlanTimeBusy when Wlan has traffic
|
||||
#Wlan time is WlanTimeIdle when Wlan is idle
|
||||
ap_generictime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0393
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTime_MAX:2=23000 #(23ms) BTTime(BT Busy) must be less than 28767
|
||||
BtTime_MIN:2=6500 #(6.5ms) BTTime(BT Idle) must be less than 28767
|
||||
WlanTime_MAX:2=18000 #(18ms) WlanTime(Wlan Busy) must be less than 32767
|
||||
WlanTime_MIN:2=5750 #(5.75ms) WlanTime(Wlan Idle) must be less than 32767
|
||||
}
|
||||
}
|
||||
|
||||
#In Ap A2DP case
|
||||
#BT time is change from BTTimeMax to BTTimeMin
|
||||
#Wlan time is change from WlanTimeMax to WlanTimeMin
|
||||
ap_a2dptime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0394
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTimebusy:2=23000 #(23ms) Maximum BTTime must be less than 32767
|
||||
BtTimeidle:2=6500 #(6.5ms) Minimum BTTime must be less than 32767
|
||||
WlanTimebusy:2=18000 #(18ms) Maximum WlanTime must be less than 32767
|
||||
WlanTimeidle:2=5750 #(5.75ms) Minimum WlanTime must be less than 32767
|
||||
}
|
||||
}
|
||||
|
||||
#In Ap inquiry case
|
||||
#BT time is set as BTTime
|
||||
#Wlan time is set as Wlan Time
|
||||
ap_inquirytime={
|
||||
CmdCode=0x00e0
|
||||
Action:2=1
|
||||
RSVD:2=0
|
||||
RobustCoexTlvType:2=0x0395
|
||||
RobustCoexTlvLength:2={
|
||||
Enable:2=0x01
|
||||
BtTime:2=28750 #(28.75ms) BTTime must less than 32767
|
||||
WlanTime:2=20000 #(20ms) WlanTime must be less than 32767
|
||||
}
|
||||
}
|
||||
######################### Robust Coex command ###############
|
||||
|
|
|
@ -67,7 +67,7 @@ SD8997 = {
|
|||
# drv_mode=7
|
||||
#}
|
||||
|
||||
#SD8978 = {
|
||||
#SDIW416 = {
|
||||
# cfg80211_wext=0xf
|
||||
# wfd_name=p2p
|
||||
# hw_name=SDIW416
|
||||
|
@ -84,10 +84,10 @@ SD8997 = {
|
|||
# drv_mode=7
|
||||
#}
|
||||
|
||||
#SD9177 = {
|
||||
#SDIW612 = {
|
||||
# cfg80211_wext=0xf
|
||||
# wfd_name=p2p
|
||||
# hw_name=SDNW611
|
||||
# hw_name=SDIW612
|
||||
# max_vir_bss=1
|
||||
# drv_mode=7
|
||||
#}
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
# File : mlanutl/Makefile
|
||||
#
|
||||
# Copyright 2011-2022 NXP
|
||||
|
||||
# Path to the top directory of the wlan distribution
|
||||
PATH_TO_TOP = ../..
|
||||
|
||||
# Determine how we should copy things to the install directory
|
||||
ABSPATH := $(filter /%, $(INSTALLDIR))
|
||||
RELPATH := $(filter-out /%, $(INSTALLDIR))
|
||||
INSTALLPATH := $(ABSPATH)
|
||||
ifeq ($(strip $(INSTALLPATH)),)
|
||||
INSTALLPATH := $(PATH_TO_TOP)/$(RELPATH)
|
||||
endif
|
||||
|
||||
# Override CFLAGS for application sources, remove __ kernel namespace defines
|
||||
CFLAGS := $(filter-out -D__%, $(ccflags-y))
|
||||
# remove KERNEL include dir
|
||||
CFLAGS := $(filter-out -I$(KERNELDIR)%, $(CFLAGS))
|
||||
|
||||
|
||||
#CFLAGS += -DAP22 -fshort-enums
|
||||
CFLAGS += -Wall
|
||||
CFLAGS += -Wno-stringop-truncation
|
||||
#ECHO = @
|
||||
ifeq (,$(findstring ANDROID_KERNEL, $(CFLAGS)))
|
||||
LIBS=-lrt
|
||||
endif
|
||||
|
||||
.PHONY: default tags all
|
||||
|
||||
OBJECTS = mlanutl.o
|
||||
HEADERS = mlanutl.h
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
exectarget=mlanutl
|
||||
TARGET := $(exectarget)
|
||||
|
||||
build appsbuild default: $(TARGET)
|
||||
@cp -f $(TARGET) $(INSTALLPATH)
|
||||
|
||||
all : tags default
|
||||
|
||||
$(TARGET): $(OBJECTS) $(HEADERS)
|
||||
$(ECHO)$(CC) $(LIBS) -o $@ $(OBJECTS)
|
||||
|
||||
%.o: %.c $(HEADERS)
|
||||
$(ECHO)$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
tags:
|
||||
ctags -R -f tags.txt
|
||||
|
||||
distclean clean:
|
||||
$(ECHO)$(RM) $(OBJECTS) $(TARGET)
|
||||
$(ECHO)$(RM) tags.txt
|
||||
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,375 +0,0 @@
|
|||
/** @file mlanwls.h
|
||||
*
|
||||
* @brief 11mc/11az Wifi location services application
|
||||
*
|
||||
*
|
||||
* Copyright 2022 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
* (the License). You may use, redistribute and/or modify the File in
|
||||
* accordance with the terms and conditions of the License, a copy of which
|
||||
* is available by writing to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
|
||||
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
|
||||
*
|
||||
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
|
||||
* this warranty disclaimer.
|
||||
*
|
||||
*/
|
||||
/************************************************************************
|
||||
Change log:
|
||||
01/24/2022: initial version
|
||||
************************************************************************/
|
||||
#ifndef _WLS_H_
|
||||
#define _WLS_H_
|
||||
|
||||
/** Size of command buffer */
|
||||
#define MRVDRV_SIZE_OF_CMD_BUFFER (3 * 1024)
|
||||
|
||||
/** MAC BROADCAST */
|
||||
#define MAC_BROADCAST 0x1FF
|
||||
/** MAC MULTICAST */
|
||||
#define MAC_MULTICAST 0x1FE
|
||||
/** Default scan interval in second*/
|
||||
#define DEFAULT_SCAN_INTERVAL 300
|
||||
|
||||
/** Netlink protocol number */
|
||||
#define NETLINK_NXP (MAX_LINKS - 1)
|
||||
/** Netlink maximum payload size */
|
||||
#define NL_MAX_PAYLOAD 1024
|
||||
/** Default wait time in seconds for events */
|
||||
#define UAP_RECV_WAIT_DEFAULT 10
|
||||
#ifndef NLMSG_HDRLEN
|
||||
/** NL message header length */
|
||||
#define NLMSG_HDRLEN ((int)NLMSG_ALIGN(sizeof(struct nlmsghdr)))
|
||||
#endif
|
||||
|
||||
/** Host Command ID : FTM session config and control */
|
||||
#define HostCmd_CMD_FTM_SESSION_CFG 0x024d
|
||||
#define HostCmd_CMD_FTM_SESSION_CTRL 0x024E
|
||||
#define HostCmd_CMD_FTM_FEATURE_CTRL 0x024f
|
||||
#define HostCmd_CMD_WLS_REQ_FTM_RANGE 0x0250
|
||||
|
||||
/** Events*/
|
||||
#define EVENT_WLS_FTM_COMPLETE 0x00000086
|
||||
#define WLS_SUB_EVENT_FTM_COMPLETE 0
|
||||
#define WLS_SUB_EVENT_RADIO_RECEIVED 1
|
||||
#define WLS_SUB_EVENT_RADIO_RPT_RECEIVED 2
|
||||
#define WLS_SUB_EVENT_ANQP_RESP_RECEIVED 3
|
||||
#define WLS_SUB_EVENT_RTT_RESULTS 4
|
||||
|
||||
/** Custom events definitions */
|
||||
/** AP connected event */
|
||||
#define CUS_EVT_AP_CONNECTED "EVENT=AP_CONNECTED"
|
||||
/** Custom events definitions end */
|
||||
|
||||
/*TLVs*/
|
||||
/** TLV type ID definition */
|
||||
#define PROPRIETARY_TLV_BASE_ID 0x0100
|
||||
#define FTM_SESSION_CFG_INITATOR_TLV_ID (PROPRIETARY_TLV_BASE_ID + 273)
|
||||
#define FTM_NTB_RANGING_CFG_TLV_ID (PROPRIETARY_TLV_BASE_ID + 343)
|
||||
#define FTM_RANGE_REPORT_TLV_ID \
|
||||
(PROPRIETARY_TLV_BASE_ID + 0x10C) /* 0x0100 + 0x10C = 0x20C */
|
||||
#define FTM_SESSION_CFG_LCI_TLV_ID (PROPRIETARY_TLV_BASE_ID + 270)
|
||||
#define FTM_SESSION_CFG_LOCATION_CIVIC_TLV_ID (PROPRIETARY_TLV_BASE_ID + 271)
|
||||
|
||||
/** Structure of command table*/
|
||||
typedef struct {
|
||||
/** User Command ID*/
|
||||
int cmd_id;
|
||||
/** Command name */
|
||||
char *cmd;
|
||||
/** Command function pointer */
|
||||
int (*func)(int argc, char *argv[], void *param);
|
||||
/** Command usuage */
|
||||
char **help;
|
||||
} wls_app_command_table;
|
||||
|
||||
/** Structure of FTM_SESSION_CFG_NTB_RANGING TLV data*/
|
||||
typedef struct _ntb_ranging_cfg {
|
||||
/** Indicates the channel BW for session*/
|
||||
/*0: HE20, 1: HE40, 2: HE80, 3: HE80+80, 4: HE160, 5:HE160_SRF*/
|
||||
t_u8 format_bw;
|
||||
/** indicates for bandwidths less than or equal to 80 MHz the maximum
|
||||
* number of space-time streams to be used in DL/UL NDP frames in the
|
||||
* session*/
|
||||
t_u8 max_i2r_sts_upto80;
|
||||
/**indicates for bandwidths less than or equal to 80 MHz the maximum
|
||||
* number of space-time streams to be used in DL/UL NDP frames in the
|
||||
* session*/
|
||||
t_u8 max_r2i_sts_upto80;
|
||||
/**Specify measurement freq in Hz to calculate measurement interval*/
|
||||
t_u8 az_measurement_freq;
|
||||
/**Indicates the number of measurements to be done for session*/
|
||||
t_u8 az_number_of_measurements;
|
||||
/**Include location civic request (Expect location civic from
|
||||
* responder)*/
|
||||
t_u8 civic_req;
|
||||
/**Include LCI request (Expect LCI info from responder)*/
|
||||
t_u8 lci_req;
|
||||
} __ATTRIB_PACK__ ntb_ranging_cfg_t;
|
||||
|
||||
/** Structure of FTM_SESSION_CFG TLV data*/
|
||||
typedef struct _ftm_session_cfg {
|
||||
/** Indicates how many burst instances are requested for the FTM
|
||||
* session*/
|
||||
t_u8 burst_exponent;
|
||||
/** Indicates the duration of a burst instance*/
|
||||
t_u8 burst_duration;
|
||||
/**Minimum time between consecutive FTM frames*/
|
||||
t_u8 min_delta_FTM;
|
||||
/**ASAP/non-ASAP casel*/
|
||||
t_u8 is_ASAP;
|
||||
/**Number of FTMs per burst*/
|
||||
t_u8 per_burst_FTM;
|
||||
/**FTM channel spacing: HT20/HT40/VHT80/…*/
|
||||
t_u8 channel_spacing;
|
||||
/**Indicates the interval between two consecutive burst instances*/
|
||||
t_u16 burst_period;
|
||||
} __ATTRIB_PACK__ ftm_session_cfg_t;
|
||||
|
||||
/** Structure for FTM_SESSION_CFG_LOCATION_CIVIC TLV data*/
|
||||
typedef struct _civic_loc_cfg {
|
||||
/**Civic location type*/
|
||||
t_u8 civic_location_type;
|
||||
/**Country code*/
|
||||
t_u16 country_code;
|
||||
/**Civic address type*/
|
||||
t_u8 civic_address_type;
|
||||
/**Civic address length*/
|
||||
t_u8 civic_address_length;
|
||||
/**Civic Address*/
|
||||
t_u8 civic_address[];
|
||||
} __ATTRIB_PACK__ civic_loc_cfg_t;
|
||||
|
||||
/** Structure for FTM_SESSION_CFG_LCI TLV data*/
|
||||
typedef struct _lci_cfg {
|
||||
/** known longitude*/
|
||||
double longitude;
|
||||
/** known Latitude*/
|
||||
double latitude;
|
||||
/** known altitude*/
|
||||
double altitude;
|
||||
/** known Latitude uncertainty*/
|
||||
t_u8 lat_unc;
|
||||
/** known Longitude uncertainty*/
|
||||
t_u8 long_unc;
|
||||
/** Known Altitude uncertainty*/
|
||||
t_u8 alt_unc;
|
||||
/** 1 word for additional Z information */
|
||||
t_u32 z_info;
|
||||
} __ATTRIB_PACK__ lci_cfg_t;
|
||||
|
||||
/** Structure for FTM_SESSION_CFG_NTB_RANGING TLV*/
|
||||
typedef struct _ntb_ranging_cfg_tlv {
|
||||
/** Type*/
|
||||
t_u16 type;
|
||||
/** Length*/
|
||||
t_u16 len;
|
||||
/** Value*/
|
||||
ntb_ranging_cfg_t val;
|
||||
} __ATTRIB_PACK__ ntb_ranging_cfg_tlv_t;
|
||||
|
||||
/** Structure for FTM_SESSION_CFG TLV*/
|
||||
typedef struct _ftm_session_cfg_tlv {
|
||||
/** Type*/
|
||||
t_u16 type;
|
||||
/** Length*/
|
||||
t_u16 len;
|
||||
/** Value*/
|
||||
ftm_session_cfg_t val;
|
||||
t_u8 civic_req;
|
||||
t_u8 lci_req;
|
||||
} __ATTRIB_PACK__ ftm_session_cfg_tlv_t;
|
||||
|
||||
/** Structure for FTM_SESSION_CFG_LOCATION_CIVIC TLV*/
|
||||
typedef struct _civic_loc_tlv {
|
||||
/** Type*/
|
||||
t_u16 type;
|
||||
/** Length*/
|
||||
t_u16 len;
|
||||
/** Value*/
|
||||
civic_loc_cfg_t val;
|
||||
} __ATTRIB_PACK__ civic_loc_tlv_t;
|
||||
|
||||
/** Structure for FTM_SESSION_CFG_LCI TLV*/
|
||||
typedef struct _lci_tlv {
|
||||
/** Type*/
|
||||
t_u16 type;
|
||||
/** Length*/
|
||||
t_u16 len;
|
||||
/** Value*/
|
||||
lci_cfg_t val;
|
||||
} __ATTRIB_PACK__ lci_tlv_t;
|
||||
|
||||
/** Structure for DOT11MC FTM_SESSION_CFG */
|
||||
typedef struct _dot11mc_ftm_cfg {
|
||||
/** FTM session cfg*/
|
||||
ftm_session_cfg_tlv_t sess_tlv;
|
||||
/** Location Request cfg*/
|
||||
lci_tlv_t lci_tlv;
|
||||
/** Civic location cfg*/
|
||||
civic_loc_tlv_t civic_tlv;
|
||||
|
||||
} __ATTRIB_PACK__ dot11mc_ftm_cfg_t;
|
||||
|
||||
/** Structure for DOT11AZ FTM_SESSION_CFG */
|
||||
typedef struct _dot11az_ftmcfg_ntb_t {
|
||||
/** NTB session cfg */
|
||||
ntb_ranging_cfg_tlv_t ntb_tlv;
|
||||
} __ATTRIB_PACK__ dot11az_ftm_cfg_t;
|
||||
|
||||
/** Type definition for hostcmd_ftm_session_cfg */
|
||||
typedef struct _hostcmd_ftm_session_cfg {
|
||||
/** 0:Get, 1:Set */
|
||||
t_u16 action;
|
||||
/** FTM_SESSION_CFG_TLVs*/
|
||||
union {
|
||||
/**11az cfg*/
|
||||
dot11az_ftm_cfg_t cfg_11az;
|
||||
/** 11mc cfg*/
|
||||
dot11mc_ftm_cfg_t cfg_11mc;
|
||||
} tlv;
|
||||
} __ATTRIB_PACK__ hostcmd_ftm_session_cfg;
|
||||
|
||||
/** Type definition for hostcmd_ftm_session_ctrl */
|
||||
typedef struct _hostcmd_ftm_session_ctrl {
|
||||
/** 0: Not used, 1: Start, 2: Stop*/
|
||||
t_u16 action;
|
||||
/*FTM for ranging*/
|
||||
t_u8 for_ranging;
|
||||
/** Mac address of the peer with whom FTM session is required*/
|
||||
t_u8 peer_mac[ETH_ALEN];
|
||||
/** Channel on which FTM must be started */
|
||||
t_u8 chan;
|
||||
} __ATTRIB_PACK__ hostcmd_ftm_session_ctrl;
|
||||
|
||||
/** Type definition for generic Hostcmd for 11AZ FTM Session */
|
||||
typedef struct _hostcmd_ds_ftm_session_cmd {
|
||||
/** HostCmd_DS_GEN */
|
||||
HostCmd_DS_GEN cmd_hdr;
|
||||
/** Command Body */
|
||||
union {
|
||||
/** hostcmd for session_ctrl user command */
|
||||
hostcmd_ftm_session_ctrl ftm_session_ctrl;
|
||||
/** hostcmd for session_cfg user command */
|
||||
hostcmd_ftm_session_cfg ftm_session_cfg;
|
||||
} cmd;
|
||||
} __ATTRIB_PACK__ hostcmd_ds_ftm_session_cmd;
|
||||
|
||||
/** Type definition for FTM Session Events */
|
||||
|
||||
/** Event ID length */
|
||||
#define EVENT_ID_LEN 4
|
||||
|
||||
/**Structure for RTT results subevent*/
|
||||
typedef struct _wls_subevent_rtt_results_t {
|
||||
/** complete */
|
||||
t_u8 complete;
|
||||
/** tlv buffer */
|
||||
/** MrvlIEtypes_RTTResult_t */
|
||||
t_u8 tlv_buffer[];
|
||||
} __ATTRIB_PACK__ wls_subevent_rtt_results_t;
|
||||
|
||||
/**Structure for FTM complete subevent*/
|
||||
typedef struct _wls_subevent_ftm_complete {
|
||||
/** BSS Number */
|
||||
t_u8 bssNum;
|
||||
/** BSS Type */
|
||||
t_u8 bssType;
|
||||
/** MAC address of the responder */
|
||||
t_u8 mac[ETH_ALEN];
|
||||
/** Average RTT */
|
||||
t_u32 avg_rtt;
|
||||
/** Average Clock offset */
|
||||
t_u32 avg_clk_offset;
|
||||
/** Measure start timestamp */
|
||||
t_u32 meas_start_tsf;
|
||||
} __ATTRIB_PACK__ wls_subevent_ftm_complete_t;
|
||||
|
||||
/** TLV for FTM Range Report */
|
||||
typedef struct _range_report_tlv_t {
|
||||
/**Type*/
|
||||
t_u16 type;
|
||||
/**Length*/
|
||||
t_u16 len;
|
||||
/** MAC address of the responder */
|
||||
t_u8 mac[ETH_ALEN];
|
||||
/** Average RTT */
|
||||
t_u32 avg_rtt;
|
||||
/** Average Clock offset */
|
||||
t_u32 avg_clk_offset;
|
||||
/** LCI and Location Civic TLV */
|
||||
} __ATTRIB_PACK__ range_report_tlv_t;
|
||||
|
||||
/** Structure for FTM events*/
|
||||
typedef struct _wls_event_t {
|
||||
/** Event ID */
|
||||
t_u16 event_id;
|
||||
/** BSS index number for multiple BSS support */
|
||||
t_u8 bss_index;
|
||||
/** BSS type */
|
||||
t_u8 bss_type;
|
||||
/** sub event id */
|
||||
t_u8 sub_event_id;
|
||||
union {
|
||||
/** FTM Complete Sub event*/
|
||||
wls_subevent_ftm_complete_t ftm_complete;
|
||||
} e;
|
||||
} __ATTRIB_PACK__ wls_event_t;
|
||||
|
||||
/*Application Global Data*/
|
||||
typedef struct {
|
||||
/** Average RTT */
|
||||
t_u32 avg_rtt;
|
||||
/** Average Clock offset */
|
||||
t_u32 avg_clk_offset;
|
||||
/*Range*/
|
||||
t_s64 range;
|
||||
} range_results_t;
|
||||
|
||||
/** Structure for ftm command private data*/
|
||||
typedef struct _wls_app_data {
|
||||
/** 0 : 80211mc, 1:80211az*/
|
||||
t_u8 protocol_type;
|
||||
/** num of times to run FTM*/
|
||||
t_u8 loop_cnt;
|
||||
/** flag to run nonstop*/
|
||||
t_u8 run_nonstop;
|
||||
/** flag is associated */
|
||||
t_u8 associated;
|
||||
/** 0 - STA, 1- AP*/
|
||||
t_u8 bss_type;
|
||||
/**flag for ftm started */
|
||||
t_u8 ftm_started;
|
||||
/** flag for app to terminate ftm session*/
|
||||
t_u8 terminate_app;
|
||||
/**flag for debug print level */
|
||||
t_u8 debug_level;
|
||||
/**peer mac address */
|
||||
t_u8 peer_mac[ETH_ALEN];
|
||||
/**AP mac address */
|
||||
t_u8 ap_mac[ETH_ALEN];
|
||||
/** Channel number for FTM session*/
|
||||
t_u8 channel;
|
||||
/**SET/GET action */
|
||||
t_u8 hostcmd_action;
|
||||
/**Is LCI data available in cfg*/
|
||||
t_u8 lci_request;
|
||||
/** Is civic data available in cfg*/
|
||||
t_u8 civic_request;
|
||||
/**ntb cfg param*/
|
||||
ntb_ranging_cfg_t ntb_cfg;
|
||||
/** 11mc session cfg param*/
|
||||
ftm_session_cfg_t session_cfg;
|
||||
/** lci cfg data*/
|
||||
lci_cfg_t lci_cfg;
|
||||
/** civic cfg data - this should be last field*/
|
||||
civic_loc_cfg_t civic_cfg;
|
||||
} __ATTRIB_PACK__ wls_app_data_t;
|
||||
|
||||
int mlanwls_main(int argc, char *argv[]);
|
||||
#endif /* _WLS_H_ */
|
|
@ -53,97 +53,84 @@ 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)
|
||||
{
|
||||
t_u8 center_freq_idx = 0;
|
||||
struct center_freq_desc {
|
||||
t_u8 pri_chan;
|
||||
t_u8 ch_40;
|
||||
t_u8 ch_80;
|
||||
t_u8 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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
return center_freq_idx;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -228,8 +215,8 @@ static mlan_status wlan_11ac_ioctl_vhtcfg(pmlan_adapter pmadapter,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
t_u16 rx_nss = 0;
|
||||
t_u16 tx_nss = 0;
|
||||
#endif
|
||||
|
@ -312,11 +299,12 @@ 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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if (IS_CARD9098(pmadapter->card_type) ||
|
||||
IS_CARDNW62X(pmadapter->card_type) ||
|
||||
IS_CARD9097(pmadapter->card_type)) {
|
||||
IS_CARDIW624(pmadapter->card_type) ||
|
||||
IS_CARD9097(pmadapter->card_type) ||
|
||||
IS_CARDAW693(pmadapter->card_type)) {
|
||||
if (cfg->param.vht_cfg.band == BAND_SELECT_A) {
|
||||
rx_nss = GET_RXMCSSUPP(
|
||||
pmadapter->user_htstream >> 8);
|
||||
|
@ -346,8 +334,8 @@ static mlan_status wlan_11ac_ioctl_vhtcfg(pmlan_adapter pmadapter,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if ((rx_nss != 0) && (nss > rx_nss))
|
||||
cfg_value = NO_NSS_SUPPORT;
|
||||
#endif
|
||||
|
@ -374,8 +362,8 @@ static mlan_status wlan_11ac_ioctl_vhtcfg(pmlan_adapter pmadapter,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if ((tx_nss != 0) && (nss > tx_nss))
|
||||
cfg_value = NO_NSS_SUPPORT;
|
||||
#endif
|
||||
|
@ -800,8 +788,8 @@ void wlan_fill_vht_cap_tlv(mlan_private *priv, MrvlIETypes_VHTCap_t *pvht_cap,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
t_u16 rx_nss = 0, tx_nss = 0;
|
||||
#endif
|
||||
ENTER();
|
||||
|
@ -822,11 +810,12 @@ void wlan_fill_vht_cap_tlv(mlan_private *priv, MrvlIETypes_VHTCap_t *pvht_cap,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if (IS_CARD9098(priv->adapter->card_type) ||
|
||||
IS_CARDNW62X(priv->adapter->card_type) ||
|
||||
IS_CARD9097(priv->adapter->card_type)) {
|
||||
IS_CARDIW624(priv->adapter->card_type) ||
|
||||
IS_CARD9097(priv->adapter->card_type) ||
|
||||
IS_CARDAW693(priv->adapter->card_type)) {
|
||||
if (bands & BAND_A) {
|
||||
rx_nss = GET_RXMCSSUPP(priv->adapter->user_htstream >>
|
||||
8);
|
||||
|
@ -848,8 +837,8 @@ void wlan_fill_vht_cap_tlv(mlan_private *priv, MrvlIETypes_VHTCap_t *pvht_cap,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if ((rx_nss != 0) && (nss > rx_nss))
|
||||
mcs_user = NO_NSS_SUPPORT;
|
||||
#endif
|
||||
|
@ -881,8 +870,8 @@ void wlan_fill_vht_cap_tlv(mlan_private *priv, MrvlIETypes_VHTCap_t *pvht_cap,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if ((tx_nss != 0) && (nss > tx_nss))
|
||||
mcs_user = NO_NSS_SUPPORT;
|
||||
#endif
|
||||
|
@ -1080,7 +1069,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_AAC, pbss_desc->channel, chan_bw);
|
||||
priv, BAND_5GHZ, pbss_desc->channel, chan_bw);
|
||||
|
||||
LEAVE();
|
||||
return;
|
||||
|
@ -1098,8 +1087,8 @@ 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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
t_u16 rx_nss = 0, tx_nss = 0;
|
||||
IEEEtypes_VHTCap_t *pvht_cap = pbss_desc->pvht_cap;
|
||||
MrvlIEtypes_He_cap_t *phecap = MNULL;
|
||||
|
@ -1109,11 +1098,12 @@ t_u8 wlan_is_80_80_support(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc)
|
|||
ENTER();
|
||||
|
||||
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
|
||||
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
|
||||
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if (!IS_CARD9098(pmpriv->adapter->card_type) &&
|
||||
!IS_CARDNW62X(pmpriv->adapter->card_type) &&
|
||||
!IS_CARD9097(pmpriv->adapter->card_type))
|
||||
!IS_CARDIW624(pmpriv->adapter->card_type) &&
|
||||
!IS_CARD9097(pmpriv->adapter->card_type) &&
|
||||
!IS_CARDAW693(pmpriv->adapter->card_type))
|
||||
return ret;
|
||||
/** check band A */
|
||||
if (!(pbss_desc->bss_band & BAND_A))
|
||||
|
@ -1164,8 +1154,8 @@ int wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
t_u16 rx_nss = 0;
|
||||
#endif
|
||||
|
||||
|
@ -1236,11 +1226,12 @@ int wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
|
|||
/** 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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if (IS_CARD9098(pmadapter->card_type) ||
|
||||
IS_CARDNW62X(pmadapter->card_type) ||
|
||||
IS_CARD9097(pmadapter->card_type)) {
|
||||
IS_CARDIW624(pmadapter->card_type) ||
|
||||
IS_CARD9097(pmadapter->card_type) ||
|
||||
IS_CARDAW693(pmadapter->card_type)) {
|
||||
if (pbss_desc->bss_band & BAND_A)
|
||||
rx_nss = GET_RXMCSSUPP(
|
||||
pmadapter->user_htstream >> 8);
|
||||
|
@ -1254,11 +1245,12 @@ int wlan_cmd_append_11ac_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if (IS_CARD9098(pmadapter->card_type) ||
|
||||
IS_CARDNW62X(pmadapter->card_type) ||
|
||||
IS_CARD9097(pmadapter->card_type)) {
|
||||
IS_CARDIW624(pmadapter->card_type) ||
|
||||
IS_CARD9097(pmadapter->card_type) ||
|
||||
IS_CARDAW693(pmadapter->card_type)) {
|
||||
PRINTM(MCMND, "rx_nss=%d nss=%d\n", rx_nss, nss);
|
||||
nss = MIN(rx_nss, nss);
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ static t_u8 wlan_check_ap_11ax_twt_supported(BSSDescriptor_t *pbss_desc)
|
|||
{
|
||||
if (!pbss_desc->phe_cap)
|
||||
return MFALSE;
|
||||
if (!(pbss_desc->phe_cap->he_mac_cap[0] & HE_MAC_CAP_TWT_REQ_SUPPORT))
|
||||
if (!(pbss_desc->phe_cap->he_mac_cap[0] & HE_MAC_CAP_TWT_RESP_SUPPORT))
|
||||
return MFALSE;
|
||||
if (!pbss_desc->pext_cap)
|
||||
return MFALSE;
|
||||
|
@ -99,12 +99,14 @@ t_u8 wlan_check_11ax_twt_supported(mlan_private *pmpriv,
|
|||
(MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap;
|
||||
MrvlIEtypes_He_cap_t *hw_he_cap =
|
||||
(MrvlIEtypes_He_cap_t *)&pmpriv->adapter->hw_he_cap;
|
||||
t_u16 band_selected = BAND_A;
|
||||
|
||||
if (pbss_desc && !wlan_check_ap_11ax_twt_supported(pbss_desc)) {
|
||||
PRINTM(MINFO, "AP don't support twt feature\n");
|
||||
return MFALSE;
|
||||
}
|
||||
if (pbss_desc) {
|
||||
if (pbss_desc->bss_band & BAND_A) {
|
||||
if (pbss_desc->bss_band & band_selected) {
|
||||
hw_he_cap = (MrvlIEtypes_He_cap_t *)&pmpriv->adapter
|
||||
->hw_he_cap;
|
||||
phecap = (MrvlIEtypes_He_cap_t *)&pmpriv->user_he_cap;
|
||||
|
@ -186,9 +188,9 @@ t_u8 wlan_fill_he_cap_ie(mlan_private *pmpriv, IEEEtypes_HECap_t *hecap_ie,
|
|||
|
||||
he_mcsnss = (IEEEtypes_HeMcsNss_t *)hecap_ie->he_txrx_mcs_support;
|
||||
|
||||
cfg_value = GET_HE_NSSMCS(user_hecap_tlv->rx_mcs_80, nss);
|
||||
hw_value = GET_HE_NSSMCS(hw_hecap_tlv->rx_mcs_80, nss);
|
||||
for (nss = 1; nss <= 8; nss++) {
|
||||
cfg_value = GET_HE_NSSMCS(user_hecap_tlv->rx_mcs_80, nss);
|
||||
hw_value = GET_HE_NSSMCS(hw_hecap_tlv->rx_mcs_80, nss);
|
||||
if ((hw_value == NO_NSS_SUPPORT) ||
|
||||
(cfg_value == NO_NSS_SUPPORT)) {
|
||||
SET_HE_NSSMCS(he_mcsnss->rx_mcs, nss, NO_NSS_SUPPORT);
|
||||
|
@ -198,9 +200,10 @@ t_u8 wlan_fill_he_cap_ie(mlan_private *pmpriv, IEEEtypes_HECap_t *hecap_ie,
|
|||
}
|
||||
}
|
||||
|
||||
cfg_value = GET_HE_NSSMCS(user_hecap_tlv->tx_mcs_80, nss);
|
||||
hw_value = GET_HE_NSSMCS(hw_hecap_tlv->tx_mcs_80, nss);
|
||||
for (nss = 1; nss <= 8; nss++) {
|
||||
cfg_value = GET_HE_NSSMCS(user_hecap_tlv->tx_mcs_80, nss);
|
||||
hw_value = GET_HE_NSSMCS(hw_hecap_tlv->tx_mcs_80, nss);
|
||||
|
||||
if ((hw_value == NO_NSS_SUPPORT) ||
|
||||
(cfg_value == NO_NSS_SUPPORT)) {
|
||||
SET_HE_NSSMCS(he_mcsnss->tx_mcs, nss, NO_NSS_SUPPORT);
|
||||
|
@ -293,8 +296,8 @@ 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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
t_u16 rx_nss = 0, tx_nss = 0;
|
||||
#endif
|
||||
MrvlIEtypes_He_cap_t *phecap = MNULL;
|
||||
|
@ -323,10 +326,11 @@ 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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if (IS_CARD9098(pmpriv->adapter->card_type) ||
|
||||
IS_CARD9097(pmpriv->adapter->card_type)) {
|
||||
IS_CARD9097(pmpriv->adapter->card_type) ||
|
||||
IS_CARDAW693(pmpriv->adapter->card_type)) {
|
||||
if (band & BAND_AAX) {
|
||||
rx_nss = GET_RXMCSSUPP(pmpriv->adapter->user_htstream >>
|
||||
8);
|
||||
|
@ -345,8 +349,8 @@ t_u16 wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u16 band,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if ((rx_nss != 0) && (nss > rx_nss))
|
||||
cfg_value = NO_NSS_SUPPORT;
|
||||
#endif
|
||||
|
@ -361,8 +365,8 @@ t_u16 wlan_fill_he_cap_tlv(mlan_private *pmpriv, t_u16 band,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if ((tx_nss != 0) && (nss > tx_nss))
|
||||
cfg_value = NO_NSS_SUPPORT;
|
||||
#endif
|
||||
|
@ -398,14 +402,15 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
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();
|
||||
|
||||
|
@ -425,7 +430,7 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
|
|||
}
|
||||
bw_80p80 = wlan_is_80_80_support(pmpriv, pbss_desc);
|
||||
phecap = (MrvlIEtypes_He_cap_t *)*ppbuffer;
|
||||
if (pbss_desc->bss_band & BAND_A) {
|
||||
if (pbss_desc->bss_band & band_selected) {
|
||||
memcpy_ext(pmadapter, *ppbuffer, pmpriv->user_he_cap,
|
||||
pmpriv->user_hecap_len, pmpriv->user_hecap_len);
|
||||
*ppbuffer += pmpriv->user_hecap_len;
|
||||
|
@ -442,12 +447,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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if (IS_CARD9098(pmpriv->adapter->card_type) ||
|
||||
IS_CARDNW62X(pmpriv->adapter->card_type) ||
|
||||
IS_CARD9097(pmpriv->adapter->card_type)) {
|
||||
if (pbss_desc->bss_band & BAND_A) {
|
||||
IS_CARDIW624(pmpriv->adapter->card_type) ||
|
||||
IS_CARD9097(pmpriv->adapter->card_type) ||
|
||||
IS_CARDAW693(pmpriv->adapter->card_type)) {
|
||||
if (pbss_desc->bss_band & band_selected) {
|
||||
rx_nss = GET_RXMCSSUPP(pmpriv->adapter->user_htstream >>
|
||||
8);
|
||||
tx_nss = GET_TXMCSSUPP(pmpriv->adapter->user_htstream >>
|
||||
|
@ -467,8 +473,8 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if ((rx_nss != 0) && (nss > rx_nss))
|
||||
cfg_value = NO_NSS_SUPPORT;
|
||||
#endif
|
||||
|
@ -483,8 +489,8 @@ int wlan_cmd_append_11ax_tlv(mlan_private *pmpriv, BSSDescriptor_t *pbss_desc,
|
|||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if ((tx_nss != 0) && (nss > tx_nss))
|
||||
cfg_value = NO_NSS_SUPPORT;
|
||||
#endif
|
||||
|
@ -522,6 +528,7 @@ void wlan_update_11ax_cap(mlan_adapter *pmadapter,
|
|||
MrvlIEtypes_He_cap_t *phe_cap = MNULL;
|
||||
t_u8 i = 0;
|
||||
t_u8 he_cap_2g = 0;
|
||||
MrvlIEtypes_He_cap_t *user_he_cap_tlv = MNULL;
|
||||
|
||||
ENTER();
|
||||
if ((hw_he_cap->len + sizeof(MrvlIEtypesHeader_t)) >
|
||||
|
@ -580,6 +587,28 @@ void wlan_update_11ax_cap(mlan_adapter *pmadapter,
|
|||
pmadapter->hw_hecap_len,
|
||||
sizeof(pmadapter->priv[i]->user_he_cap));
|
||||
}
|
||||
/**
|
||||
* Clear TWT bits in he_mac_cap by bss role
|
||||
* STA mode should clear TWT responder bit
|
||||
* UAP mode should clear TWT request bit
|
||||
*/
|
||||
if (he_cap_2g)
|
||||
user_he_cap_tlv =
|
||||
(MrvlIEtypes_He_cap_t *)&pmadapter
|
||||
->priv[i]
|
||||
->user_2g_he_cap;
|
||||
else
|
||||
user_he_cap_tlv =
|
||||
(MrvlIEtypes_He_cap_t *)&pmadapter
|
||||
->priv[i]
|
||||
->user_he_cap;
|
||||
|
||||
if (pmadapter->priv[i]->bss_role == MLAN_BSS_ROLE_STA)
|
||||
user_he_cap_tlv->he_mac_cap[0] &=
|
||||
~HE_MAC_CAP_TWT_RESP_SUPPORT;
|
||||
else
|
||||
user_he_cap_tlv->he_mac_cap[0] &=
|
||||
~HE_MAC_CAP_TWT_REQ_SUPPORT;
|
||||
}
|
||||
}
|
||||
LEAVE();
|
||||
|
@ -632,15 +661,6 @@ static mlan_status wlan_11ax_ioctl_hecfg(pmlan_adapter pmadapter,
|
|||
|
||||
ENTER();
|
||||
|
||||
if (pioctl_req->buf_len < sizeof(mlan_ds_11ax_cfg)) {
|
||||
PRINTM(MINFO, "MLAN bss IOCTL length is too short.\n");
|
||||
pioctl_req->data_read_written = 0;
|
||||
pioctl_req->buf_len_needed = sizeof(mlan_ds_11ax_cfg);
|
||||
pioctl_req->status_code = MLAN_ERROR_INVALID_PARAMETER;
|
||||
LEAVE();
|
||||
return MLAN_STATUS_RESOURCE;
|
||||
}
|
||||
|
||||
cfg = (mlan_ds_11ax_cfg *)pioctl_req->pbuf;
|
||||
|
||||
if ((cfg->param.he_cfg.band & MBIT(0)) &&
|
||||
|
@ -906,6 +926,10 @@ 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();
|
||||
|
@ -939,14 +963,25 @@ 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(t_u16), sizeof(t_u16));
|
||||
cmd->size += sizeof(t_u16);
|
||||
sizeof(mlan_ds_11ax_txomi_cmd),
|
||||
sizeof(mlan_ds_11ax_txomi_cmd));
|
||||
cmd->size += sizeof(mlan_ds_11ax_txomi_cmd);
|
||||
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;
|
||||
|
@ -1016,12 +1051,21 @@ 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(t_u16), sizeof(t_u16));
|
||||
sizeof(mlan_ds_11ax_txomi_cmd),
|
||||
sizeof(mlan_ds_11ax_txomi_cmd));
|
||||
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;
|
||||
|
@ -1051,6 +1095,7 @@ 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();
|
||||
|
@ -1103,6 +1148,13 @@ 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;
|
||||
|
|
|
@ -409,8 +409,7 @@ static mlan_status wlan_11d_update_chan_pwr_table(mlan_private *pmpriv,
|
|||
/* Channel not found. Update the channel in the channel-power
|
||||
table */
|
||||
parsed_region_chan->chan_pwr[i].chan = chan;
|
||||
parsed_region_chan->chan_pwr[i].band =
|
||||
(t_u8)pbss_desc->bss_band;
|
||||
parsed_region_chan->chan_pwr[i].band = pbss_desc->bss_band;
|
||||
parsed_region_chan->chan_pwr[i].pwr = tx_power;
|
||||
parsed_region_chan->chan_pwr[i].ap_seen = MTRUE;
|
||||
parsed_region_chan->no_of_chan++;
|
||||
|
@ -854,6 +853,8 @@ mlan_status wlan_cmd_802_11d_domain_info(mlan_private *pmpriv,
|
|||
MrvlIEtypes_DomainParamSet_t *domain = &pdomain_info->domain;
|
||||
t_u8 no_of_sub_band = pmadapter->domain_reg.no_of_sub_band;
|
||||
MrvlIEtypes_Rgn_dom_code_t *rgn = MNULL;
|
||||
t_u8 *tlv = MNULL;
|
||||
|
||||
t_u8 i;
|
||||
|
||||
ENTER();
|
||||
|
@ -882,7 +883,10 @@ mlan_status wlan_cmd_802_11d_domain_info(mlan_private *pmpriv,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
tlv = (t_u8 *)&pdomain_info->domain;
|
||||
|
||||
/* Set domain info fields */
|
||||
domain = (MrvlIEtypes_DomainParamSet_t *)tlv;
|
||||
domain->header.type = wlan_cpu_to_le16(TLV_TYPE_DOMAIN);
|
||||
memcpy_ext(pmadapter, domain->country_code,
|
||||
pmadapter->domain_reg.country_code,
|
||||
|
@ -899,20 +903,22 @@ mlan_status wlan_cmd_802_11d_domain_info(mlan_private *pmpriv,
|
|||
MRVDRV_MAX_SUBBAND_802_11D *
|
||||
sizeof(IEEEtypes_SubbandSet_t));
|
||||
|
||||
pcmd->size = sizeof(pdomain_info->action) + domain->header.len +
|
||||
sizeof(MrvlIEtypesHeader_t) + S_DS_GEN;
|
||||
pcmd->size += sizeof(pdomain_info->action) +
|
||||
domain->header.len + sizeof(MrvlIEtypesHeader_t) +
|
||||
S_DS_GEN;
|
||||
|
||||
tlv += domain->header.len + sizeof(MrvlIEtypesHeader_t);
|
||||
|
||||
if (pmadapter->domain_reg.dfs_region != NXP_DFS_UNKNOWN) {
|
||||
rgn = (MrvlIEtypes_Rgn_dom_code_t
|
||||
*)((t_u8 *)&pdomain_info->domain +
|
||||
domain->header.len +
|
||||
sizeof(MrvlIEtypesHeader_t));
|
||||
rgn = (MrvlIEtypes_Rgn_dom_code_t *)tlv;
|
||||
rgn->header.type =
|
||||
wlan_cpu_to_le16(TLV_TYPE_REGION_DOMAIN_CODE);
|
||||
rgn->header.len = 2;
|
||||
rgn->domain_code = pmadapter->domain_reg.dfs_region;
|
||||
pcmd->size += sizeof(MrvlIEtypes_Rgn_dom_code_t);
|
||||
tlv += sizeof(MrvlIEtypes_Rgn_dom_code_t);
|
||||
}
|
||||
|
||||
} else {
|
||||
pcmd->size = sizeof(pdomain_info->action) + S_DS_GEN;
|
||||
}
|
||||
|
@ -1524,8 +1530,11 @@ mlan_status wlan_11d_cfg_domain_info(pmlan_adapter pmadapter,
|
|||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
if (!wlan_fw_11d_is_enabled(pmpriv))
|
||||
wlan_11d_enable(pmpriv, MNULL, ENABLE_11D);
|
||||
if (!wlan_fw_11d_is_enabled(pmpriv)) {
|
||||
ret = wlan_11d_enable(pmpriv, MNULL, ENABLE_11D);
|
||||
if (ret)
|
||||
PRINTM(MERROR, "Enabling 11D in FW failed\n");
|
||||
}
|
||||
|
||||
cfg_11d = (mlan_ds_11d_cfg *)pioctl_req->pbuf;
|
||||
domain_info = &cfg_11d->param.domain_info;
|
||||
|
@ -1588,7 +1597,8 @@ mlan_status wlan_11d_handle_uap_domain_info(mlan_private *pmpriv, t_u16 band,
|
|||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
mlan_adapter *pmadapter = pmpriv->adapter;
|
||||
MrvlIEtypes_DomainParamSet_t *pdomain_tlv;
|
||||
MrvlIEtypes_DomainParamSet_t *pdomain_tlv = MNULL;
|
||||
MrvlIEtypes_Rgn_dom_code_t *pregdomain_tlv = MNULL;
|
||||
t_u8 num_sub_band = 0;
|
||||
t_u8 cfp_bg = 0, cfp_a = 0;
|
||||
|
||||
|
@ -1596,6 +1606,12 @@ mlan_status wlan_11d_handle_uap_domain_info(mlan_private *pmpriv, t_u16 band,
|
|||
|
||||
pdomain_tlv = (MrvlIEtypes_DomainParamSet_t *)domain_tlv;
|
||||
|
||||
if (pdomain_tlv->header.type == TLV_TYPE_DOMAIN) {
|
||||
pregdomain_tlv =
|
||||
(MrvlIEtypes_Rgn_dom_code_t
|
||||
*)(domain_tlv + sizeof(MrvlIEtypesHeader_t) +
|
||||
pdomain_tlv->header.len);
|
||||
}
|
||||
/* update region code & table based on country string */
|
||||
if (wlan_misc_country_2_cfp_table_code(
|
||||
pmadapter, pdomain_tlv->country_code, &cfp_bg, &cfp_a) ==
|
||||
|
@ -1625,9 +1641,18 @@ mlan_status wlan_11d_handle_uap_domain_info(mlan_private *pmpriv, t_u16 band,
|
|||
/* TODO: don't just clobber pmadapter->domain_reg.
|
||||
* Add some checking or merging between STA & UAP domain_info
|
||||
*/
|
||||
wlan_11d_set_domain_info(pmpriv, band, pdomain_tlv->country_code,
|
||||
num_sub_band, pdomain_tlv->sub_band,
|
||||
NXP_DFS_UNKNOWN);
|
||||
if (pregdomain_tlv &&
|
||||
(pregdomain_tlv->header.type == TLV_TYPE_REGION_DOMAIN_CODE)) {
|
||||
wlan_11d_set_domain_info(pmpriv, band,
|
||||
pdomain_tlv->country_code,
|
||||
num_sub_band, pdomain_tlv->sub_band,
|
||||
pregdomain_tlv->domain_code);
|
||||
} else
|
||||
wlan_11d_set_domain_info(pmpriv, band,
|
||||
pdomain_tlv->country_code,
|
||||
num_sub_band, pdomain_tlv->sub_band,
|
||||
NXP_DFS_UNKNOWN);
|
||||
|
||||
ret = wlan_11d_send_domain_info(pmpriv, pioctl_buf);
|
||||
|
||||
done:
|
||||
|
|
|
@ -197,7 +197,118 @@ static t_u32 wlan_11h_convert_ieee_to_mrvl_ie(mlan_adapter *pmadapter,
|
|||
|
||||
LEAVE();
|
||||
/* Return the number of bytes appended to pout_buf */
|
||||
return sizeof(mrvl_ie_hdr) + pin_ie[1];
|
||||
return (t_u32)(sizeof(mrvl_ie_hdr) + pin_ie[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief find all bonded channel.
|
||||
*
|
||||
* @param pri_chan primary channel
|
||||
* @param bw channel bandwidth
|
||||
* @param chan_list buffer to return channel list.
|
||||
*
|
||||
* @return number of channel
|
||||
*/
|
||||
static t_u8 woal_get_bonded_channels(t_u8 pri_chan, t_u8 bw, t_u8 *chan_list)
|
||||
{
|
||||
t_u8 ht40_plus[] = {52, 60, 100, 108, 116, 124, 132, 140};
|
||||
t_u8 ht40_minus[] = {56, 64, 104, 112, 120, 128, 136, 144};
|
||||
t_u8 vht80_dfs[4][4] = {{52, 56, 60, 64},
|
||||
{100, 104, 108, 112},
|
||||
{116, 120, 124, 128},
|
||||
{132, 136, 140, 144}};
|
||||
t_u8 find = MFALSE;
|
||||
int j;
|
||||
int i;
|
||||
t_u8 sec_chan = 0;
|
||||
t_u8 n_chan = 1;
|
||||
ENTER();
|
||||
|
||||
if (bw == CHAN_BW_20MHZ) {
|
||||
chan_list[0] = pri_chan;
|
||||
} else if (bw == CHAN_BW_40MHZ) {
|
||||
chan_list[0] = pri_chan;
|
||||
for (i = 0; i < sizeof(ht40_minus); i++) {
|
||||
if (pri_chan == (t_u8)ht40_plus[i]) {
|
||||
sec_chan = pri_chan + 4;
|
||||
n_chan = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < sizeof(ht40_minus); i++) {
|
||||
if (pri_chan == (t_u8)ht40_minus[i]) {
|
||||
sec_chan = pri_chan - 4;
|
||||
n_chan = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
chan_list[1] = sec_chan;
|
||||
} else if (bw == CHAN_BW_80MHZ) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (pri_chan == (t_u8)vht80_dfs[i][j]) {
|
||||
find = MTRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (find)
|
||||
break;
|
||||
}
|
||||
if (find) {
|
||||
n_chan = 4;
|
||||
for (j = 0; j < n_chan; j++) {
|
||||
chan_list[j] = (t_u8)vht80_dfs[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
LEAVE();
|
||||
return n_chan;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set channel's dfs state
|
||||
*
|
||||
* @param priv Private driver information structure
|
||||
* @param chan primary channel
|
||||
* @param bw channel bandwidth
|
||||
* @param dfs_state dfs state
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
t_void wlan_11h_set_chan_dfs_state(mlan_private *priv, t_u8 chan, t_u8 bw,
|
||||
dfs_state_t dfs_state)
|
||||
{
|
||||
t_u8 n_chan;
|
||||
t_u8 chan_list[4] = {0};
|
||||
t_u8 i;
|
||||
n_chan = woal_get_bonded_channels(chan, bw, chan_list);
|
||||
for (i = 0; i < n_chan; i++)
|
||||
wlan_set_chan_dfs_state(priv, BAND_A, chan_list[i], dfs_state);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief reset dfs_checking_chan's dfs state
|
||||
*
|
||||
* @param priv Private driver information structure
|
||||
* @param dfs_state dfs state
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
t_void wlan_11h_reset_dfs_checking_chan_dfs_state(mlan_private *priv,
|
||||
dfs_state_t dfs_state)
|
||||
{
|
||||
wlan_dfs_device_state_t *pstate_dfs = &priv->adapter->state_dfs;
|
||||
dfs_state_t state;
|
||||
ENTER();
|
||||
if (pstate_dfs->dfs_check_channel) {
|
||||
state = wlan_get_chan_dfs_state(priv, BAND_A,
|
||||
pstate_dfs->dfs_check_channel);
|
||||
if (state == DFS_AVAILABLE)
|
||||
wlan_11h_set_chan_dfs_state(
|
||||
priv, pstate_dfs->dfs_check_channel,
|
||||
pstate_dfs->dfs_check_bandwidth, dfs_state);
|
||||
}
|
||||
LEAVE();
|
||||
}
|
||||
|
||||
#ifdef STA_SUPPORT
|
||||
|
@ -677,28 +788,29 @@ static mlan_status wlan_11h_cmd_chan_rpt_req(mlan_private *priv,
|
|||
ptlv_zero_dfs->Header.len = wlan_cpu_to_le16(sizeof(t_u8));
|
||||
if (!is_cancel_req) {
|
||||
ptlv_zero_dfs->zero_dfs_enbl = MTRUE;
|
||||
PRINTM(MCMND, "ZeroDFS: START: chan=%d\n",
|
||||
pchan_rpt_req->chan_desc.chanNum);
|
||||
PRINTM(MCMND, "DFS: START: chan=%d bw=%d\n",
|
||||
pchan_rpt_req->chan_desc.chanNum,
|
||||
pchan_rpt_req->chan_desc.bandcfg.chanWidth);
|
||||
} else {
|
||||
ptlv_zero_dfs->zero_dfs_enbl = MFALSE;
|
||||
PRINTM(MCMND, "ZeroDFS: STOP\n");
|
||||
PRINTM(MCMND, "DFS: STOP\n");
|
||||
}
|
||||
pcmd_ptr->size += sizeof(MrvlIEtypes_ZeroDfsOperation_t);
|
||||
pcmd_ptr->size = wlan_cpu_to_le16(pcmd_ptr->size);
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
pcmd_ptr->size = wlan_cpu_to_le16(pcmd_ptr->size);
|
||||
|
||||
/* update dfs sturcture.
|
||||
* dfs_check_pending is set when we receive CMD_RESP == SUCCESS */
|
||||
pstate_dfs->dfs_check_pending = MFALSE;
|
||||
pstate_dfs->dfs_radar_found = MFALSE;
|
||||
pstate_dfs->dfs_check_priv = MNULL;
|
||||
|
||||
if (!is_cancel_req)
|
||||
if (!is_cancel_req) {
|
||||
pstate_dfs->dfs_check_channel =
|
||||
pchan_rpt_req->chan_desc.chanNum;
|
||||
pstate_dfs->dfs_check_bandwidth =
|
||||
pchan_rpt_req->chan_desc.bandcfg.chanWidth;
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
|
@ -993,6 +1105,34 @@ static t_bool wlan_11h_is_slave_active_on_dfs_chan(mlan_private *priv)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if the current input channel is on radar channel
|
||||
*
|
||||
*
|
||||
* @param priv Private driver information structure
|
||||
* @param channel Channel to determine radar detection requirements
|
||||
*
|
||||
* @return
|
||||
* - MTRUE if radar detection is required
|
||||
* - MFALSE otherwise
|
||||
*/
|
||||
t_bool wlan_11h_is_radar_channel(mlan_private *priv, t_u8 channel)
|
||||
{
|
||||
t_bool required = MFALSE;
|
||||
|
||||
ENTER();
|
||||
|
||||
/*
|
||||
* No checks for 11h or measurement code being enabled is placed here
|
||||
* since regulatory requirements exist whether we support them or not.
|
||||
*/
|
||||
|
||||
required = wlan_get_cfp_radar_detect(priv, channel);
|
||||
|
||||
LEAVE();
|
||||
return required;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return whether the master interface is active, and on DFS channel.
|
||||
* priv is assumed to already be a dfs master interface, doesn't check this.
|
||||
|
@ -1254,14 +1394,12 @@ wlan_11h_prepare_custom_ie_chansw(mlan_adapter *pmadapter,
|
|||
sizeof(mlan_ioctl_req));
|
||||
|
||||
/* prepare mlan_ioctl_req */
|
||||
memset(pmadapter, pioctl_req, 0x00, sizeof(mlan_ioctl_req));
|
||||
pioctl_req->req_id = MLAN_IOCTL_MISC_CFG;
|
||||
pioctl_req->action = MLAN_ACT_SET;
|
||||
pioctl_req->pbuf = (t_u8 *)pds_misc_cfg;
|
||||
pioctl_req->buf_len = sizeof(mlan_ds_misc_cfg);
|
||||
|
||||
/* prepare mlan_ds_misc_cfg */
|
||||
memset(pmadapter, pds_misc_cfg, 0x00, sizeof(mlan_ds_misc_cfg));
|
||||
pds_misc_cfg->sub_command = MLAN_OID_MISC_CUSTOM_IE;
|
||||
pds_misc_cfg->param.cust_ie.type = TLV_TYPE_MGMT_IE;
|
||||
pds_misc_cfg->param.cust_ie.len = (sizeof(custom_ie) - MAX_IE_SIZE);
|
||||
|
@ -1616,9 +1754,6 @@ static mlan_status wlan_11h_add_dfs_timestamp(mlan_adapter *pmadapter,
|
|||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
memset(pmadapter, (t_u8 *)pdfs_ts, 0,
|
||||
sizeof(wlan_dfs_timestamp_t));
|
||||
|
||||
util_enqueue_list_tail(pmadapter->pmoal_handle,
|
||||
&pmadapter->state_dfs.dfs_ts_head,
|
||||
(pmlan_linked_list)pdfs_ts, MNULL,
|
||||
|
@ -1643,6 +1778,27 @@ static mlan_status wlan_11h_add_dfs_timestamp(mlan_adapter *pmadapter,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Add all bonded channel's dfs timestamp to the list
|
||||
*
|
||||
* @param pmadapter Pointer to mlan_adapter
|
||||
* @param repr Timestamp 'represents' value (see _dfs_timestamp_repr_e)
|
||||
* @param channel Channel number
|
||||
* @param bandwidth Channel bandwidth
|
||||
*
|
||||
* @return Pointer to timestamp if found, or MNULL
|
||||
*/
|
||||
static void wlan_11h_add_all_dfs_timestamp(mlan_adapter *pmadapter, t_u8 repr,
|
||||
t_u8 channel, t_u8 bandwidth)
|
||||
{
|
||||
t_u8 n_chan;
|
||||
t_u8 chan_list[4] = {0};
|
||||
t_u8 i;
|
||||
n_chan = woal_get_bonded_channels(channel, bandwidth, chan_list);
|
||||
for (i = 0; i < n_chan; i++)
|
||||
wlan_11h_add_dfs_timestamp(pmadapter, repr, chan_list[i]);
|
||||
}
|
||||
|
||||
/********************************************************
|
||||
Global functions
|
||||
********************************************************/
|
||||
|
@ -1726,6 +1882,217 @@ mlan_status wlan_11h_config_slave_radar_det(mlan_private *priv, t_bool enable)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/**
|
||||
* @brief Return whether the slave interface is on DFS channel.
|
||||
* priv is assumed to already be a dfs slave interface, doesn't check this.
|
||||
*
|
||||
* @param priv Private driver information structure
|
||||
*
|
||||
* @return
|
||||
* - MTRUE if priv is slave, and meets both conditions
|
||||
* - MFALSE otherwise
|
||||
*/
|
||||
static t_bool wlan_11h_is_slave_on_dfs_chan(mlan_private *priv)
|
||||
{
|
||||
t_bool ret = MFALSE;
|
||||
|
||||
ENTER();
|
||||
if ((priv->media_connected == MTRUE) &&
|
||||
(priv->curr_bss_params.band & BAND_A) &&
|
||||
wlan_11h_is_radar_channel(
|
||||
priv, priv->curr_bss_params.bss_descriptor.channel))
|
||||
ret = MTRUE;
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief check if dfs_master and dfs_slave are in same channel
|
||||
*
|
||||
* @param pmadapter Pointer to mlan_adapter structure
|
||||
*
|
||||
* @return MTRUE-dfs_master and dfs_slave interface on same DFS channel
|
||||
*
|
||||
*/
|
||||
t_u8 static wlan_11h_check_dfs_channel(mlan_adapter *pmadapter)
|
||||
{
|
||||
mlan_private *priv_master = MNULL;
|
||||
mlan_private *priv_slave = MNULL;
|
||||
mlan_private *priv_list[MLAN_MAX_BSS_NUM] = {MNULL};
|
||||
|
||||
if (wlan_get_privs_by_two_cond(
|
||||
pmadapter, wlan_11h_is_master_active_on_dfs_chan,
|
||||
wlan_11h_is_dfs_master, MTRUE, priv_list)) {
|
||||
priv_master = priv_list[0];
|
||||
PRINTM(MINFO, "%s: found dfs_master priv=%p\n", __func__,
|
||||
priv_master);
|
||||
}
|
||||
if (wlan_get_privs_by_two_cond(pmadapter, wlan_11h_is_slave_on_dfs_chan,
|
||||
wlan_11h_is_dfs_slave, MTRUE,
|
||||
priv_list)) {
|
||||
priv_slave = priv_list[0];
|
||||
PRINTM(MINFO, "%s: found dfs_slave priv=%p\n", __func__,
|
||||
priv_slave);
|
||||
}
|
||||
if (!priv_slave || !priv_master)
|
||||
return MFALSE;
|
||||
if (priv_master->uap_state_chan_cb.channel !=
|
||||
priv_slave->curr_bss_params.bss_descriptor.channel)
|
||||
return MFALSE;
|
||||
return MTRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief disable 11h and DFS function
|
||||
*
|
||||
* @param priv Private driver information structure
|
||||
* @param pioctl_buf A pointer to MLAN IOCTL Request buffer
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
|
||||
*/
|
||||
mlan_status static wlan_11h_disable_dfs(mlan_private *priv, t_void *pioctl_buf)
|
||||
{
|
||||
t_u32 enable = 0;
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
|
||||
ENTER();
|
||||
|
||||
/*
|
||||
* Send cmd to FW to enable/disable 11h function in firmware
|
||||
*/
|
||||
ret = wlan_prepare_cmd(priv, HostCmd_CMD_802_11_SNMP_MIB,
|
||||
HostCmd_ACT_GEN_SET, Dot11H_i,
|
||||
(t_void *)pioctl_buf, &enable);
|
||||
if (ret)
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
else
|
||||
/* Set boolean flag in driver 11h state */
|
||||
priv->intf_state_11h.is_11h_active = MFALSE;
|
||||
|
||||
PRINTM(MINFO, "11h: DFS %s\n", "Deactivate");
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief check if we need enable dfs_master
|
||||
*
|
||||
* @param priv Pointer to mlan_private structure
|
||||
* priv should be UAP priv
|
||||
*
|
||||
* @return N/A
|
||||
*
|
||||
*/
|
||||
void wlan_11h_update_dfs_master_state_by_uap(mlan_private *pmpriv)
|
||||
{
|
||||
mlan_adapter *pmadapter = pmpriv->adapter;
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
if (pmadapter->dfs_mode && wlan_11h_check_dfs_channel(pmadapter)) {
|
||||
PRINTM(MCMND,
|
||||
"11h: disable DFS master when AP+STA on same DFS channel\n");
|
||||
ret = wlan_11h_disable_dfs(pmpriv, MNULL);
|
||||
return;
|
||||
}
|
||||
if (!wlan_11h_is_active(pmpriv)) {
|
||||
/* active 11h extention in Fw */
|
||||
PRINTM(MCMND,
|
||||
"11h: Enable DFS master after AP up or chan_switch\n");
|
||||
ret = wlan_11h_activate(pmpriv, MNULL, MTRUE);
|
||||
ret = wlan_11h_config_master_radar_det(pmpriv, MTRUE);
|
||||
ret = wlan_11h_check_update_radar_det_state(pmpriv);
|
||||
}
|
||||
if (pmpriv->uap_host_based && !pmpriv->adapter->init_para.dfs_offload)
|
||||
pmpriv->intf_state_11h.is_11h_host = MTRUE;
|
||||
wlan_11h_set_dfs_check_chan(pmpriv, pmpriv->uap_channel,
|
||||
pmpriv->uap_bandwidth);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief check if dfs_master and dfs_slave are in same channel
|
||||
*
|
||||
* @param pmadapter Pointer to mlan_adapter structure
|
||||
*
|
||||
* @return MTRUE-dfs_master and dfs_slave interface on same DFS channel
|
||||
*
|
||||
*/
|
||||
void wlan_11h_update_dfs_master_state_by_sta(mlan_private *pmpriv)
|
||||
{
|
||||
mlan_private *priv_master = MNULL;
|
||||
mlan_private *priv_slave = MNULL;
|
||||
mlan_private *priv_list[MLAN_MAX_BSS_NUM] = {MNULL};
|
||||
mlan_adapter *pmadapter = pmpriv->adapter;
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
|
||||
if (wlan_get_privs_by_two_cond(
|
||||
pmadapter, wlan_11h_is_master_active_on_dfs_chan,
|
||||
wlan_11h_is_dfs_master, MTRUE, priv_list)) {
|
||||
priv_master = priv_list[0];
|
||||
PRINTM(MINFO, "%s: found dfs_master priv=%p\n", __func__,
|
||||
priv_master);
|
||||
}
|
||||
if (wlan_get_privs_by_two_cond(pmadapter, wlan_11h_is_slave_on_dfs_chan,
|
||||
wlan_11h_is_dfs_slave, MTRUE,
|
||||
priv_list)) {
|
||||
priv_slave = priv_list[0];
|
||||
PRINTM(MINFO, "%s: found dfs_slave priv=%p\n", __func__,
|
||||
priv_slave);
|
||||
}
|
||||
if (!priv_slave || !priv_master)
|
||||
return;
|
||||
if (priv_master->uap_state_chan_cb.channel ==
|
||||
priv_slave->curr_bss_params.bss_descriptor.channel) {
|
||||
PRINTM(MCMND,
|
||||
"11h: disable DFS master when AP+STA on same DFS channel\n");
|
||||
ret = wlan_11h_disable_dfs(priv_master, MNULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief update the dfs master state on station disconnect
|
||||
*
|
||||
* @param priv Pointer to mlan_private structure
|
||||
* priv should be UAP priv
|
||||
*
|
||||
* @return N/A
|
||||
*
|
||||
*/
|
||||
void wlan_11h_update_dfs_master_state_on_disconect(mlan_private *priv)
|
||||
{
|
||||
mlan_private *priv_master = MNULL;
|
||||
mlan_private *priv_list[MLAN_MAX_BSS_NUM] = {MNULL};
|
||||
mlan_adapter *pmadapter = priv->adapter;
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
if (wlan_get_privs_by_two_cond(
|
||||
pmadapter, wlan_11h_is_master_active_on_dfs_chan,
|
||||
wlan_11h_is_dfs_master, MTRUE, priv_list)) {
|
||||
priv_master = priv_list[0];
|
||||
PRINTM(MINFO, "%s: found dfs_master priv=%p\n", __func__,
|
||||
priv_master);
|
||||
}
|
||||
if (!priv_master) {
|
||||
wlan_11h_check_update_radar_det_state(priv);
|
||||
return;
|
||||
}
|
||||
if (!wlan_11h_is_active(priv_master)) {
|
||||
PRINTM(MCMND, "11h: Enable DFS master after STA disconnect\n");
|
||||
/* active 11h extention in Fw */
|
||||
ret = wlan_11h_activate(priv_master, MNULL, MTRUE);
|
||||
ret = wlan_11h_config_master_radar_det(priv_master, MTRUE);
|
||||
ret = wlan_11h_check_update_radar_det_state(priv_master);
|
||||
}
|
||||
if (priv_master->uap_host_based && !pmadapter->init_para.dfs_offload)
|
||||
priv_master->intf_state_11h.is_11h_host = MTRUE;
|
||||
wlan_11h_set_dfs_check_chan(priv_master, priv_master->uap_channel,
|
||||
priv_master->uap_bandwidth);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Checks all interfaces and determines if radar_detect flag states
|
||||
* have/should be changed. If so, sends SNMP_MIB 11H command to FW.
|
||||
|
@ -1956,7 +2323,6 @@ t_void wlan_11h_cleanup(mlan_adapter *adapter)
|
|||
{
|
||||
wlan_dfs_device_state_t *pstate_dfs = &adapter->state_dfs;
|
||||
wlan_dfs_timestamp_t *pdfs_ts;
|
||||
mlan_private *priv = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
@ -1967,10 +2333,6 @@ t_void wlan_11h_cleanup(mlan_adapter *adapter)
|
|||
util_unlink_list(adapter->pmoal_handle,
|
||||
&pstate_dfs->dfs_ts_head,
|
||||
(pmlan_linked_list)pdfs_ts, MNULL, MNULL);
|
||||
priv = wlan_get_priv(adapter, MLAN_BSS_ROLE_ANY);
|
||||
if (priv)
|
||||
wlan_set_chan_dfs_state(priv, BAND_A, pdfs_ts->channel,
|
||||
DFS_USABLE);
|
||||
adapter->callbacks.moal_mfree(adapter->pmoal_handle,
|
||||
(t_u8 *)pdfs_ts);
|
||||
|
||||
|
@ -1978,7 +2340,6 @@ t_void wlan_11h_cleanup(mlan_adapter *adapter)
|
|||
adapter->pmoal_handle, &pstate_dfs->dfs_ts_head, MNULL,
|
||||
MNULL);
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
}
|
||||
|
||||
|
@ -2417,10 +2778,15 @@ t_s32 wlan_11h_process_start(mlan_private *priv, t_u8 **ppbuffer,
|
|||
((adapter->adhoc_start_band & BAND_A))) {
|
||||
if (!wlan_fw_11d_is_enabled(priv)) {
|
||||
/* No use having 11h enabled without 11d enabled */
|
||||
wlan_11d_enable(priv, MNULL, ENABLE_11D);
|
||||
if (wlan_11d_enable(priv, MNULL, ENABLE_11D)) {
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
#ifdef STA_SUPPORT
|
||||
wlan_11d_create_dnld_countryinfo(
|
||||
priv, adapter->adhoc_start_band);
|
||||
if (wlan_11d_create_dnld_countryinfo(
|
||||
priv, adapter->adhoc_start_band))
|
||||
PRINTM(MERROR, "Dnld_countryinfo_11d failed\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -2489,8 +2855,7 @@ t_s32 wlan_11h_process_start(mlan_private *priv, t_u8 **ppbuffer,
|
|||
* network that was parsed out of the scan response.
|
||||
*
|
||||
* @return Integer number of bytes appended to the TLV output
|
||||
* buffer (ppbuffer), MLAN_STATUS_FAILURE (-1),
|
||||
* or MLAN_STATUS_SUCCESS (0)
|
||||
* buffer (ppbuffer)
|
||||
*/
|
||||
t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
|
||||
IEEEtypes_CapInfo_t *pcap_info, t_u16 band,
|
||||
|
@ -2507,11 +2872,12 @@ t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
|
|||
* long as the current & next APs have the same spectrum
|
||||
* mgmt capability bit setting
|
||||
*/
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
|
||||
PRINTM(MINFO,
|
||||
"Assume DFS parameters are the same for roaming\n");
|
||||
} else {
|
||||
/* No support for roaming between DFS/non-DFS yet */
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
PRINTM(MINFO,
|
||||
"No support for roaming between DFS/non-DFS yet\n");
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
|
@ -2521,7 +2887,11 @@ t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
|
|||
if (p11h_bss_info->sensed_11h) {
|
||||
if (!wlan_fw_11d_is_enabled(priv)) {
|
||||
/* No use having 11h enabled without 11d enabled */
|
||||
wlan_11d_enable(priv, MNULL, ENABLE_11D);
|
||||
if (wlan_11d_enable(priv, MNULL, ENABLE_11D)) {
|
||||
PRINTM(MERROR, "Fail to enable 11D\n");
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
#ifdef STA_SUPPORT
|
||||
wlan_11d_parse_dnld_countryinfo(
|
||||
priv, priv->pattempted_bss_desc);
|
||||
|
@ -2552,10 +2922,12 @@ t_s32 wlan_11h_process_join(mlan_private *priv, t_u8 **ppbuffer,
|
|||
priv, ppbuffer, band, channel, p11h_bss_info);
|
||||
}
|
||||
} else {
|
||||
/* Deactivate 11h functions in the firmware */
|
||||
wlan_11h_activate(priv, MNULL, MFALSE);
|
||||
pcap_info->spectrum_mgmt = MFALSE;
|
||||
wlan_11h_check_update_radar_det_state(priv);
|
||||
if (pcap_info->ibss) {
|
||||
/* Deactivate 11h functions in the firmware */
|
||||
wlan_11h_activate(priv, MNULL, MFALSE);
|
||||
pcap_info->spectrum_mgmt = MFALSE;
|
||||
wlan_11h_check_update_radar_det_state(priv);
|
||||
}
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
|
@ -2820,7 +3192,10 @@ mlan_status wlan_11h_handle_event_chanswann(mlan_private *priv)
|
|||
|
||||
ENTER();
|
||||
#ifdef UAP_SUPPORT
|
||||
if (priv->adapter->state_11h.is_master_radar_det_active) {
|
||||
/** No need handle AP if mc_policy is disabled, FW will move the AP to
|
||||
* client's new channel */
|
||||
if (pmadapter->mc_policy &&
|
||||
priv->adapter->state_11h.is_master_radar_det_active) {
|
||||
for (i = 0; i < MIN(pmadapter->priv_num, MLAN_MAX_BSS_NUM);
|
||||
i++) {
|
||||
if (pmadapter->priv[i] &&
|
||||
|
@ -2880,14 +3255,14 @@ mlan_status wlan_11h_handle_event_chanswann(mlan_private *priv)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (pmadapter->ecsa_enable) {
|
||||
t_u8 stop_tx = *(t_u8 *)pmadapter->event_body;
|
||||
#endif /* UAP_SUPPORT */
|
||||
if (priv->adapter->ecsa_enable) {
|
||||
t_u8 stop_tx = *(t_u8 *)priv->adapter->event_body;
|
||||
if (stop_tx)
|
||||
pmadapter->state_rdh.tx_block = MTRUE;
|
||||
priv->adapter->state_rdh.tx_block = MTRUE;
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
priv->adapter->state_11h.recvd_chanswann_event = MTRUE;
|
||||
|
||||
/* unlikely: clean up previous csa if still on-going */
|
||||
|
@ -2924,7 +3299,7 @@ mlan_status wlan_11h_handle_event_chanswann(mlan_private *priv)
|
|||
"11h: handle_event_chanswann() - scan blacklist csa channel\n");
|
||||
wlan_set_chan_blacklist(priv, BAND_A,
|
||||
priv->intf_state_11h.dfs_slave_csa_chan, MTRUE);
|
||||
#endif
|
||||
#endif /* STA_SUPPORT */
|
||||
|
||||
priv->adapter->state_11h.recvd_chanswann_event = MFALSE;
|
||||
LEAVE();
|
||||
|
@ -2978,6 +3353,53 @@ mlan_status wlan_11h_ioctl_dfs_testing(pmlan_adapter pmadapter,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 802.11h IOCTL to get nop channel list
|
||||
*
|
||||
* @param pmadapter Pointer to mlan_adapter
|
||||
* @param pioctl_req Pointer to mlan_ioctl_req
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
|
||||
*/
|
||||
mlan_status wlan_11h_ioctl_nop_channel_list(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req)
|
||||
{
|
||||
mlan_ds_11h_cfg *ds_11hcfg = MNULL;
|
||||
int i, j;
|
||||
chan_freq_power_t *pcfp = MNULL;
|
||||
t_u8 num_chan = 0;
|
||||
ENTER();
|
||||
|
||||
ds_11hcfg = (mlan_ds_11h_cfg *)pioctl_req->pbuf;
|
||||
/*get the cfp table first */
|
||||
for (i = 0; i < MAX_REGION_CHANNEL_NUM; i++) {
|
||||
if (pmadapter->region_channel[i].band == BAND_A) {
|
||||
pcfp = pmadapter->region_channel[i].pcfp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!pcfp) {
|
||||
/* This means operation in BAND-A is not support, we can
|
||||
* just return false here, it's harmless
|
||||
*/
|
||||
goto done;
|
||||
}
|
||||
/*get the radar detection requirements according to chan num */
|
||||
for (j = 0; j < pmadapter->region_channel[i].num_cfp; j++) {
|
||||
if (pcfp[j].passive_scan_or_radar_detect) {
|
||||
if (wlan_11h_is_channel_under_nop(pmadapter,
|
||||
pcfp[j].channel)) {
|
||||
ds_11hcfg->param.nop_chan_list
|
||||
.chan_list[num_chan] = pcfp[j].channel;
|
||||
num_chan++;
|
||||
}
|
||||
}
|
||||
}
|
||||
done:
|
||||
ds_11hcfg->param.nop_chan_list.num_chan = num_chan;
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 802.11h IOCTL to handle channel NOP status check/clear
|
||||
* @brief If given channel is under NOP, return a new non-dfs
|
||||
|
@ -3007,7 +3429,8 @@ mlan_status wlan_11h_ioctl_channel_nop_info(pmlan_adapter pmadapter,
|
|||
ch_nop_info->chan_under_nop =
|
||||
wlan_11h_is_channel_under_nop(
|
||||
pmadapter, ch_nop_info->curr_chan);
|
||||
if (ch_nop_info->chan_under_nop) {
|
||||
if (ch_nop_info->chan_under_nop &&
|
||||
ch_nop_info->check_new_chan) {
|
||||
wlan_11h_switch_non_dfs_chan(
|
||||
pmpriv, &ch_nop_info->new_chan.channel);
|
||||
if (ch_nop_info->chan_width == CHAN_BW_80MHZ ||
|
||||
|
@ -3019,13 +3442,18 @@ mlan_status wlan_11h_ioctl_channel_nop_info(pmlan_adapter pmadapter,
|
|||
if (ch_nop_info->chan_width == CHAN_BW_80MHZ)
|
||||
ch_nop_info->new_chan.center_chan =
|
||||
wlan_get_center_freq_idx(
|
||||
pmpriv, BAND_AAC,
|
||||
pmpriv,
|
||||
ch_nop_info->new_chan
|
||||
.bandcfg
|
||||
.chanBand,
|
||||
ch_nop_info->new_chan
|
||||
.channel,
|
||||
ch_nop_info->chan_width);
|
||||
}
|
||||
} else if (pioctl_req->action == MLAN_ACT_CLEAR) {
|
||||
wlan_11h_cleanup(pmadapter);
|
||||
wlan_reset_all_chan_dfs_state(pmpriv, BAND_A,
|
||||
DFS_USABLE);
|
||||
}
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -3078,17 +3506,20 @@ mlan_status wlan_11h_ioctl_chan_dfs_state(pmlan_adapter pmadapter,
|
|||
{
|
||||
mlan_ds_11h_cfg *ds_11hcfg = MNULL;
|
||||
t_s32 ret = MLAN_STATUS_FAILURE;
|
||||
pmlan_private priv = pmadapter->priv[pioctl_req->bss_index];
|
||||
pmlan_private priv = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (pioctl_req) {
|
||||
ds_11hcfg = (mlan_ds_11h_cfg *)pioctl_req->pbuf;
|
||||
priv = pmadapter->priv[pioctl_req->bss_index];
|
||||
|
||||
if (pioctl_req->action == MLAN_ACT_GET) {
|
||||
wlan_11h_is_channel_under_nop(
|
||||
pmadapter,
|
||||
ds_11hcfg->param.ch_dfs_state.channel);
|
||||
if (MFALSE ==
|
||||
wlan_11h_is_channel_under_nop(
|
||||
pmadapter,
|
||||
ds_11hcfg->param.ch_dfs_state.channel))
|
||||
PRINTM(MINFO, "Channel is not in NOP\n");
|
||||
ds_11hcfg->param.ch_dfs_state.dfs_required =
|
||||
wlan_11h_radar_detect_required(
|
||||
priv,
|
||||
|
@ -3099,6 +3530,21 @@ mlan_status wlan_11h_ioctl_chan_dfs_state(pmlan_adapter pmadapter,
|
|||
priv, BAND_A,
|
||||
ds_11hcfg->param.ch_dfs_state.channel);
|
||||
} else {
|
||||
if (ds_11hcfg->param.ch_dfs_state.dfs_state ==
|
||||
DFS_UNAVAILABLE) {
|
||||
wlan_11h_add_dfs_timestamp(
|
||||
pmadapter, DFS_TS_REPR_NOP_START,
|
||||
ds_11hcfg->param.ch_dfs_state.channel);
|
||||
} else if (ds_11hcfg->param.ch_dfs_state.dfs_state ==
|
||||
DFS_AVAILABLE) {
|
||||
if (MFALSE ==
|
||||
wlan_11h_is_channel_under_nop(
|
||||
pmadapter,
|
||||
ds_11hcfg->param.ch_dfs_state
|
||||
.channel))
|
||||
PRINTM(MINFO,
|
||||
"Channel is not in NOP\n");
|
||||
}
|
||||
wlan_set_chan_dfs_state(
|
||||
priv, BAND_A,
|
||||
ds_11hcfg->param.ch_dfs_state.channel,
|
||||
|
@ -3203,12 +3649,15 @@ t_bool wlan_11h_is_channel_under_nop(mlan_adapter *pmadapter, t_u8 channel)
|
|||
*
|
||||
* @param priv Pointer to mlan_private
|
||||
* @param pevent Pointer to mlan_event
|
||||
* @param radar_chan Pointer to radar channel
|
||||
* @param bandwidth Pointer to band width
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
|
||||
*/
|
||||
mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
|
||||
mlan_event *pevent,
|
||||
t_u8 *radar_chan)
|
||||
t_u8 *radar_chan,
|
||||
t_u8 *bandwidth)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
HostCmd_DS_CHAN_RPT_RSP *pchan_rpt_rsp;
|
||||
|
@ -3221,6 +3670,7 @@ mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
|
|||
wlan_dfs_device_state_t *pstate_dfs = &priv->adapter->state_dfs;
|
||||
t_u8 dfs_radar_found = MFALSE;
|
||||
t_u8 dfs_check_channel = pstate_dfs->dfs_check_channel;
|
||||
t_u8 dfs_check_bandwidth = pstate_dfs->dfs_check_bandwidth;
|
||||
MrvlIEtypes_channel_band_t *tlv;
|
||||
|
||||
ENTER();
|
||||
|
@ -3228,8 +3678,10 @@ mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
|
|||
DBG_HEXDUMP(MCMD_D, "11h: Event ChanRptReady (HostCmd_DS_CHAN_RPT_RSP)",
|
||||
(t_u8 *)pchan_rpt_rsp, pevent->event_len);
|
||||
|
||||
if (priv->bss_type == MLAN_BSS_TYPE_DFS)
|
||||
if (priv->bss_type == MLAN_BSS_TYPE_DFS) {
|
||||
dfs_check_channel = priv->chan_rep_req.chanNum;
|
||||
dfs_check_bandwidth = priv->chan_rep_req.bandcfg.chanWidth;
|
||||
}
|
||||
|
||||
if (wlan_le32_to_cpu(pchan_rpt_rsp->cmd_result) ==
|
||||
MLAN_CMD_RESULT_SUCCESS) {
|
||||
|
@ -3252,6 +3704,7 @@ mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
|
|||
case TLV_TYPE_CHANNELBANDLIST:
|
||||
tlv = (MrvlIEtypes_channel_band_t *)ptlv;
|
||||
dfs_check_channel = tlv->channel;
|
||||
dfs_check_bandwidth = tlv->bandcfg.chanWidth;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -3265,19 +3718,23 @@ mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
|
|||
ret = MLAN_STATUS_FAILURE;
|
||||
}
|
||||
if (dfs_radar_found) {
|
||||
PRINTM(MMSG, "RADAR Detected on channel %d!\n",
|
||||
dfs_check_channel);
|
||||
PRINTM(MMSG, "RADAR Detected on channel %d bw=%d !\n",
|
||||
dfs_check_channel, dfs_check_bandwidth);
|
||||
/* add channel to NOP list */
|
||||
wlan_11h_add_dfs_timestamp(priv->adapter, DFS_TS_REPR_NOP_START,
|
||||
dfs_check_channel);
|
||||
wlan_11h_add_all_dfs_timestamp(priv->adapter,
|
||||
DFS_TS_REPR_NOP_START,
|
||||
dfs_check_channel,
|
||||
dfs_check_bandwidth);
|
||||
}
|
||||
*radar_chan = dfs_check_channel;
|
||||
*bandwidth = dfs_check_bandwidth;
|
||||
if (dfs_radar_found)
|
||||
wlan_set_chan_dfs_state(priv, BAND_A, dfs_check_channel,
|
||||
DFS_UNAVAILABLE);
|
||||
wlan_11h_set_chan_dfs_state(priv, dfs_check_channel,
|
||||
dfs_check_bandwidth,
|
||||
DFS_UNAVAILABLE);
|
||||
else
|
||||
wlan_set_chan_dfs_state(priv, BAND_A, dfs_check_channel,
|
||||
DFS_AVAILABLE);
|
||||
wlan_11h_set_chan_dfs_state(priv, dfs_check_channel,
|
||||
dfs_check_bandwidth, DFS_AVAILABLE);
|
||||
pstate_dfs->dfs_radar_found = dfs_radar_found;
|
||||
/* Update DFS structure. */
|
||||
priv->adapter->callbacks.moal_get_system_time(
|
||||
|
@ -3296,28 +3753,38 @@ mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
|
|||
* @param priv Pointer to mlan_private
|
||||
* @param pevent Pointer to mlan_event
|
||||
* @param radar_chan Pointer to radar channel
|
||||
* @param bandwidth Pointer to band width
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
|
||||
*/
|
||||
mlan_status wlan_11h_print_event_radar_detected(mlan_private *priv,
|
||||
mlan_event *pevent,
|
||||
t_u8 *radar_chan)
|
||||
t_u8 *radar_chan,
|
||||
t_u8 *bandwidth)
|
||||
{
|
||||
wlan_dfs_device_state_t *pstate_dfs = &priv->adapter->state_dfs;
|
||||
t_u8 dfs_check_bandwidth = pstate_dfs->dfs_check_bandwidth;
|
||||
MrvlIEtypes_channel_band_t *tlv;
|
||||
ENTER();
|
||||
*radar_chan = pstate_dfs->dfs_check_channel;
|
||||
if (pevent->event_len >= sizeof(MrvlIEtypes_channel_band_t)) {
|
||||
tlv = (MrvlIEtypes_channel_band_t *)&pevent->event_buf;
|
||||
*radar_chan = tlv->channel;
|
||||
dfs_check_bandwidth = tlv->bandcfg.chanWidth;
|
||||
} else {
|
||||
if (priv->bss_type == MLAN_BSS_TYPE_DFS)
|
||||
if (priv->bss_type == MLAN_BSS_TYPE_DFS) {
|
||||
*radar_chan = priv->chan_rep_req.chanNum;
|
||||
dfs_check_bandwidth =
|
||||
priv->chan_rep_req.bandcfg.chanWidth;
|
||||
}
|
||||
}
|
||||
wlan_11h_add_dfs_timestamp(priv->adapter, DFS_TS_REPR_NOP_START,
|
||||
*radar_chan);
|
||||
wlan_set_chan_dfs_state(priv, BAND_A, *radar_chan, DFS_UNAVAILABLE);
|
||||
PRINTM(MEVENT, "ZeroDFS: Radar detected on %d\n", *radar_chan);
|
||||
*bandwidth = dfs_check_bandwidth;
|
||||
wlan_11h_add_all_dfs_timestamp(priv->adapter, DFS_TS_REPR_NOP_START,
|
||||
*radar_chan, dfs_check_bandwidth);
|
||||
wlan_11h_set_chan_dfs_state(priv, *radar_chan, dfs_check_bandwidth,
|
||||
DFS_UNAVAILABLE);
|
||||
PRINTM(MEVENT, "DFS: Radar detected on %d bw=%d\n", *radar_chan,
|
||||
dfs_check_bandwidth);
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -3386,8 +3853,14 @@ void wlan_dfs_rep_disconnect(mlan_adapter *pmadapter)
|
|||
|
||||
if (wlan_11h_radar_detect_required(pmpriv,
|
||||
pmadapter->dfsr_channel)) {
|
||||
wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_BSS_STOP,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL, MNULL);
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
ret = wlan_prepare_cmd(pmpriv,
|
||||
HostCmd_CMD_APCMD_BSS_STOP,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL,
|
||||
MNULL);
|
||||
if (ret) {
|
||||
PRINTM(MMSG, "Error sending message to FW\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3404,6 +3877,7 @@ void wlan_dfs_rep_bw_change(mlan_adapter *pmadapter)
|
|||
mlan_private *priv_list[MLAN_MAX_BSS_NUM];
|
||||
mlan_private *pmpriv = MNULL;
|
||||
t_u8 pcount, i;
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
|
||||
memset(pmadapter, priv_list, 0x00, sizeof(priv_list));
|
||||
pcount = wlan_get_privs_by_cond(pmadapter, wlan_is_intf_active,
|
||||
|
@ -3430,8 +3904,13 @@ void wlan_dfs_rep_bw_change(mlan_adapter *pmadapter)
|
|||
pmpriv, pmadapter->dfsr_channel))
|
||||
return;
|
||||
|
||||
wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_BSS_STOP,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL, MNULL);
|
||||
ret = wlan_prepare_cmd(pmpriv,
|
||||
HostCmd_CMD_APCMD_BSS_STOP,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL,
|
||||
MNULL);
|
||||
if (ret) {
|
||||
PRINTM(MERROR, "Error sending message to FW\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3440,8 +3919,13 @@ void wlan_dfs_rep_bw_change(mlan_adapter *pmadapter)
|
|||
pmpriv = priv_list[i];
|
||||
|
||||
if (GET_BSS_ROLE(pmpriv) == MLAN_BSS_ROLE_UAP) {
|
||||
wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_BSS_START,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL, MNULL);
|
||||
ret = wlan_prepare_cmd(pmpriv,
|
||||
HostCmd_CMD_APCMD_BSS_START,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL,
|
||||
MNULL);
|
||||
if (ret) {
|
||||
PRINTM(MERROR, "Error sending message to FW\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3475,6 +3959,7 @@ void wlan_11h_update_bandcfg(mlan_private *pmpriv, Band_Config_t *uap_band_cfg,
|
|||
LEAVE();
|
||||
}
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/**
|
||||
* @brief Get priv current index -- this is used to enter correct rdh_state
|
||||
* during radar handling
|
||||
|
@ -3503,6 +3988,7 @@ wlan_11h_get_priv_curr_idx(mlan_private *pmpriv,
|
|||
}
|
||||
return (found == MTRUE) ? MLAN_STATUS_SUCCESS : MLAN_STATUS_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Driver handling for remove customeie
|
||||
|
@ -3731,10 +4217,9 @@ mlan_status wlan_11h_radar_detected_handling(mlan_adapter *pmadapter,
|
|||
__func__);
|
||||
#ifdef UAP_SUPPORT
|
||||
if (GET_BSS_ROLE(pmpriv) == MLAN_BSS_ROLE_UAP) {
|
||||
ret = wlan_prepare_cmd(pmpriv,
|
||||
HOST_CMD_APCMD_BSS_STOP,
|
||||
HostCmd_ACT_GEN_SET, 0,
|
||||
MNULL, MNULL);
|
||||
ret = wlan_prepare_cmd(
|
||||
pmpriv, HostCmd_CMD_APCMD_BSS_STOP,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL, MNULL);
|
||||
PRINTM(MERROR,
|
||||
"STOP UAP and exit radar handling...\n");
|
||||
pstate_rdh->stage = RDH_OFF;
|
||||
|
@ -3788,7 +4273,8 @@ mlan_status wlan_11h_radar_detected_handling(mlan_adapter *pmadapter,
|
|||
|
||||
/* check next intf */
|
||||
while ((++pstate_rdh->priv_curr_idx) <
|
||||
pstate_rdh->priv_list_count) {
|
||||
pstate_rdh->priv_list_count &&
|
||||
(pstate_rdh->priv_curr_idx < MLAN_MAX_BSS_NUM)) {
|
||||
pmpriv =
|
||||
pstate_rdh->priv_list[pstate_rdh->priv_curr_idx];
|
||||
|
||||
|
@ -3966,10 +4452,9 @@ mlan_status wlan_11h_radar_detected_handling(mlan_adapter *pmadapter,
|
|||
pstate_rdh->priv_list[pstate_rdh->priv_curr_idx];
|
||||
#ifdef UAP_SUPPORT
|
||||
if (GET_BSS_ROLE(pmpriv) == MLAN_BSS_ROLE_UAP) {
|
||||
ret = wlan_prepare_cmd(pmpriv,
|
||||
HOST_CMD_APCMD_BSS_STOP,
|
||||
HostCmd_ACT_GEN_SET, 0,
|
||||
MNULL, MNULL);
|
||||
ret = wlan_prepare_cmd(
|
||||
pmpriv, HostCmd_CMD_APCMD_BSS_STOP,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL, MNULL);
|
||||
break; /* leads to exit case */
|
||||
}
|
||||
#endif
|
||||
|
@ -4075,10 +4560,9 @@ mlan_status wlan_11h_radar_detected_handling(mlan_adapter *pmadapter,
|
|||
ret = wlan_11h_check_update_radar_det_state(
|
||||
pmpriv);
|
||||
}
|
||||
ret = wlan_prepare_cmd(pmpriv,
|
||||
HOST_CMD_APCMD_BSS_START,
|
||||
HostCmd_ACT_GEN_SET, 0,
|
||||
MNULL, MNULL);
|
||||
ret = wlan_prepare_cmd(
|
||||
pmpriv, HostCmd_CMD_APCMD_BSS_START,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL, MNULL);
|
||||
break; /* leads to exit case */
|
||||
}
|
||||
#endif
|
||||
|
@ -4362,14 +4846,16 @@ done:
|
|||
* @param priv Void pointer to mlan_private
|
||||
*
|
||||
* @param chan pointer to channel
|
||||
* @param bandwidth band width
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
void wlan_11h_set_dfs_check_chan(mlan_private *priv, t_u8 chan)
|
||||
void wlan_11h_set_dfs_check_chan(mlan_private *priv, t_u8 chan, t_u8 bandwidth)
|
||||
{
|
||||
wlan_dfs_device_state_t *pstate_dfs = &priv->adapter->state_dfs;
|
||||
ENTER();
|
||||
pstate_dfs->dfs_check_channel = chan;
|
||||
pstate_dfs->dfs_check_bandwidth = bandwidth;
|
||||
PRINTM(MCMND, "Set dfs_check_channel=%d\n", chan);
|
||||
LEAVE();
|
||||
}
|
||||
|
@ -4403,3 +4889,29 @@ mlan_status wlan_11h_ioctl_dfs_w53_cfg(pmlan_adapter pmadapter,
|
|||
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 802.11h DFS mode configuration
|
||||
*
|
||||
* @param pmadapter Pointer to mlan_adapter
|
||||
* @param pioctl_req Pointer to mlan_ioctl_req
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
|
||||
*/
|
||||
mlan_status wlan_11h_ioctl_dfs_mode(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req)
|
||||
{
|
||||
mlan_ds_11h_cfg *ds_11hcfg = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
ds_11hcfg = (mlan_ds_11h_cfg *)pioctl_req->pbuf;
|
||||
|
||||
if (pioctl_req->action == MLAN_ACT_GET) {
|
||||
ds_11hcfg->param.dfs_mode = pmadapter->dfs_mode;
|
||||
} else {
|
||||
pmadapter->dfs_mode = ds_11hcfg->param.dfs_mode;
|
||||
}
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -63,6 +63,14 @@ extern mlan_status wlan_11h_config_slave_radar_det(mlan_private *priv,
|
|||
|
||||
/** Checks all interfaces and updates radar detect flags if necessary */
|
||||
extern mlan_status wlan_11h_check_update_radar_det_state(mlan_private *pmpriv);
|
||||
#ifdef UAP_SUPPORT
|
||||
/** update dfs master state from uap interface */
|
||||
void wlan_11h_update_dfs_master_state_by_uap(mlan_private *pmpriv);
|
||||
/** update dfs master when station disconnected */
|
||||
void wlan_11h_update_dfs_master_state_on_disconect(mlan_private *priv);
|
||||
/** update dfs master state from STA interface */
|
||||
void wlan_11h_update_dfs_master_state_by_sta(mlan_private *pmpriv);
|
||||
#endif
|
||||
|
||||
/** Return 1 if 11h is active in the firmware, 0 if it is inactive */
|
||||
extern t_bool wlan_11h_is_active(mlan_private *priv);
|
||||
|
@ -135,12 +143,14 @@ extern mlan_status wlan_11h_handle_event_chanswann(mlan_private *priv);
|
|||
/** Handler for EVENT_CHANNEL_REPORT_RDY */
|
||||
extern mlan_status wlan_11h_handle_event_chanrpt_ready(mlan_private *priv,
|
||||
mlan_event *pevent,
|
||||
t_u8 *radar_chan);
|
||||
t_u8 *radar_chan,
|
||||
t_u8 *bandwidth);
|
||||
|
||||
/** Debug output for EVENT_RADAR_DETECTED */
|
||||
mlan_status wlan_11h_print_event_radar_detected(mlan_private *priv,
|
||||
mlan_event *pevent,
|
||||
t_u8 *radar_chan);
|
||||
t_u8 *radar_chan,
|
||||
t_u8 *bandwidth);
|
||||
|
||||
t_s32 wlan_11h_cancel_radar_detect(mlan_private *priv);
|
||||
/** Handler for DFS_TESTING IOCTL */
|
||||
|
@ -148,6 +158,8 @@ extern mlan_status wlan_11h_ioctl_dfs_testing(pmlan_adapter pmadapter,
|
|||
pmlan_ioctl_req pioctl_req);
|
||||
extern mlan_status wlan_11h_ioctl_channel_nop_info(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
extern mlan_status wlan_11h_ioctl_nop_channel_list(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
||||
extern mlan_status wlan_11h_ioctl_dfs_chan_report(mlan_private *priv,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
@ -157,11 +169,16 @@ 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);
|
||||
|
@ -172,7 +189,7 @@ extern t_bool wlan_11h_radar_detected_tx_blocked(mlan_adapter *pmadapter);
|
|||
/** Callback for RADAR_DETECTED (for UAP cmdresp) */
|
||||
extern mlan_status wlan_11h_radar_detected_callback(t_void *priv);
|
||||
/** set dfs check channel */
|
||||
void wlan_11h_set_dfs_check_chan(mlan_private *priv, t_u8 chan);
|
||||
void wlan_11h_set_dfs_check_chan(mlan_private *priv, t_u8 chan, t_u8 bandwidth);
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
/** BW_change event Handler for dfs_repeater */
|
||||
|
|
|
@ -61,9 +61,24 @@ 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;
|
||||
|
||||
|
@ -383,6 +398,7 @@ 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);
|
||||
}
|
||||
|
@ -454,6 +470,7 @@ 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;
|
||||
}
|
||||
|
@ -744,6 +761,8 @@ 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))
|
||||
|
@ -1007,6 +1026,8 @@ 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,
|
||||
|
@ -1050,7 +1071,7 @@ static void wlan_update_all_stations_ampdu(mlan_private *priv)
|
|||
}
|
||||
while (sta_ptr != (sta_node *)&priv->sta_list) {
|
||||
for (i = 0; i < MAX_NUM_TID; i++) {
|
||||
if (sta_ptr->is_11n_enabled)
|
||||
if (sta_ptr->is_11n_enabled || sta_ptr->is_11ax_enabled)
|
||||
sta_ptr->ampdu_sta[i] =
|
||||
priv->aggr_prio_tbl[i].ampdu_user;
|
||||
}
|
||||
|
@ -1233,7 +1254,8 @@ static mlan_status wlan_11n_ioctl_supported_mcs_set(pmlan_adapter pmadapter,
|
|||
if ((ISSUPP_CHANWIDTH40(pmpriv->usr_dot_11n_dev_cap_bg) ||
|
||||
ISSUPP_CHANWIDTH40(pmpriv->usr_dot_11n_dev_cap_a)) &&
|
||||
!(pmpriv->curr_chan_flags & CHAN_FLAGS_NO_HT40PLUS &&
|
||||
pmpriv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS))
|
||||
pmpriv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS) &&
|
||||
pmadapter->init_para.mcs32 == 1)
|
||||
SETHT_MCS32(mcs_set);
|
||||
|
||||
cfg = (mlan_ds_11n_cfg *)pioctl_req->pbuf;
|
||||
|
@ -1510,15 +1532,17 @@ 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, 0);
|
||||
SETAMPDU_SPACING(pht_cap->ht_cap.ampdu_param,
|
||||
pmadapter->hw_mpdu_density);
|
||||
|
||||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if (IS_CARD9098(pmadapter->card_type) ||
|
||||
IS_CARDNW62X(pmadapter->card_type) ||
|
||||
IS_CARD9097(pmadapter->card_type)) {
|
||||
IS_CARDIW624(pmadapter->card_type) ||
|
||||
IS_CARD9097(pmadapter->card_type) ||
|
||||
IS_CARDAW693(pmadapter->card_type)) {
|
||||
if (bands & BAND_A)
|
||||
rx_mcs_supp = MIN(
|
||||
rx_mcs_supp,
|
||||
|
@ -1541,7 +1565,8 @@ void wlan_fill_ht_cap_tlv(mlan_private *priv, MrvlIETypes_HTCap_t *pht_cap,
|
|||
* supprot*/
|
||||
if (ISSUPP_CHANWIDTH40(usr_dot_11n_dev_cap) &&
|
||||
!(priv->curr_chan_flags & CHAN_FLAGS_NO_HT40PLUS &&
|
||||
priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS))
|
||||
priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS) &&
|
||||
pmadapter->init_para.mcs32 == 1)
|
||||
SETHT_MCS32(pht_cap->ht_cap.supported_mcs_set);
|
||||
|
||||
/* Clear RD responder bit */
|
||||
|
@ -1590,11 +1615,12 @@ void wlan_fill_ht_cap_ie(mlan_private *priv, IEEEtypes_HTCap_t *pht_cap,
|
|||
|
||||
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)
|
||||
defined(PCIE9097) || defined(USB9097) || defined(SDIW624) || \
|
||||
defined(PCIEIW624) || defined(USBIW624) || defined(SD9097)
|
||||
if (IS_CARD9098(pmadapter->card_type) ||
|
||||
IS_CARDNW62X(pmadapter->card_type) ||
|
||||
IS_CARD9097(pmadapter->card_type)) {
|
||||
IS_CARDIW624(pmadapter->card_type) ||
|
||||
IS_CARD9097(pmadapter->card_type) ||
|
||||
IS_CARDAW693(pmadapter->card_type)) {
|
||||
if (bands & BAND_A)
|
||||
rx_mcs_supp = MIN(
|
||||
rx_mcs_supp,
|
||||
|
@ -1617,7 +1643,8 @@ void wlan_fill_ht_cap_ie(mlan_private *priv, IEEEtypes_HTCap_t *pht_cap,
|
|||
* supprot*/
|
||||
if (ISSUPP_CHANWIDTH40(usr_dot_11n_dev_cap) &&
|
||||
!(priv->curr_chan_flags & CHAN_FLAGS_NO_HT40PLUS &&
|
||||
priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS))
|
||||
priv->curr_chan_flags & CHAN_FLAGS_NO_HT40MINUS) &&
|
||||
pmadapter->init_para.mcs32 == 1)
|
||||
SETHT_MCS32(pht_cap->ht_cap.supported_mcs_set);
|
||||
|
||||
/* Clear RD responder bit */
|
||||
|
@ -1743,8 +1770,12 @@ 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)
|
||||
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;
|
||||
wlan_send_addba(priv, ptx_ba_tbl->tid, ptx_ba_tbl->ra);
|
||||
}
|
||||
} else { /*
|
||||
* In case of failure, recreate
|
||||
* the deleted stream in case
|
||||
|
@ -1752,11 +1783,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);
|
||||
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);
|
||||
wlan_11n_set_txbastream_status(priv, tid,
|
||||
pdel_ba->peer_mac_addr,
|
||||
BA_STREAM_SETUP_COMPLETE,
|
||||
MFALSE);
|
||||
|
||||
ptx_ba_tbl = wlan_11n_get_txbastream_status(
|
||||
priv, BA_STREAM_SETUP_INPROGRESS);
|
||||
wlan_release_ralist_lock(priv);
|
||||
|
@ -1855,12 +1886,27 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2859,6 +2905,58 @@ 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.
|
||||
|
@ -2885,7 +2983,7 @@ void wlan_11n_create_txbastream_tbl(mlan_private *priv, t_u8 *ra, int tid,
|
|||
|
||||
if (pmadapter->callbacks.moal_malloc(
|
||||
pmadapter->pmoal_handle, sizeof(TxBAStreamTbl),
|
||||
MLAN_MEM_DEF, (t_u8 **)&new_node)) {
|
||||
MLAN_MEM_DEF | MLAN_MEM_FLAG_ATOMIC, (t_u8 **)&new_node)) {
|
||||
PRINTM(MERROR,
|
||||
"wlan_11n_create_txbastream_tbl Failed to allocate new_node\n");
|
||||
LEAVE();
|
||||
|
@ -2928,8 +3026,8 @@ int wlan_send_addba(mlan_private *priv, int tid, t_u8 *peer_mac)
|
|||
|
||||
ENTER();
|
||||
|
||||
PRINTM(MCMND, "Send addba: TID %d\n", tid);
|
||||
DBG_HEXDUMP(MCMD_D, "Send addba RA", peer_mac, MLAN_MAC_ADDR_LENGTH);
|
||||
PRINTM(MCMND, "Send addba: TID %d, " MACSTR "\n", tid,
|
||||
MAC2STR(peer_mac));
|
||||
|
||||
add_ba_req.block_ack_param_set = (t_u16)(
|
||||
(tid << BLOCKACKPARAM_TID_POS) |
|
||||
|
@ -2977,6 +3075,9 @@ 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);
|
||||
|
||||
|
|
|
@ -87,6 +87,10 @@ 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);
|
||||
|
@ -376,14 +380,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 (tid > priv->aggr_prio_tbl[ptx_tbl->tid].ampdu_user) {
|
||||
if ((ptx_tbl->ba_status == BA_STREAM_SETUP_COMPLETE) &&
|
||||
(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();
|
||||
|
|
|
@ -120,8 +120,6 @@ 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 */
|
||||
|
@ -156,6 +154,9 @@ 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)) {
|
||||
|
@ -168,21 +169,48 @@ static INLINE void wlan_11n_update_pktlen_amsdu_txpd(mlan_private *priv,
|
|||
LEAVE();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief check if UAP AMSDU packet need forward out to connected peers
|
||||
*
|
||||
* @param priv A pointer to mlan_private
|
||||
*
|
||||
* @return MTRUE--packet need forward
|
||||
*
|
||||
*/
|
||||
static t_u8 wlan_uap_check_forward(mlan_private *priv, Eth803Hdr_t *hdr)
|
||||
{
|
||||
/** include multicast packet */
|
||||
if (hdr->dest_addr[0] & 0x01)
|
||||
return MTRUE;
|
||||
/** include unicast packet to another station */
|
||||
if (wlan_get_station_entry(priv, hdr->dest_addr))
|
||||
return MTRUE;
|
||||
return MFALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get number of aggregated packets
|
||||
*
|
||||
* @param priv A pointer to mlan_private structure
|
||||
* @param data A pointer to packet data
|
||||
* @param total_pkt_len Total packet length
|
||||
* @param forward A pointer forward flag
|
||||
*
|
||||
* @return Number of packets
|
||||
*/
|
||||
static int wlan_11n_get_num_aggrpkts(t_u8 *data, int total_pkt_len)
|
||||
static int wlan_11n_get_num_aggrpkts(mlan_private *priv, t_u8 *data,
|
||||
int total_pkt_len, t_u8 *forward)
|
||||
{
|
||||
int pkt_count = 0, pkt_len, pad;
|
||||
t_u8 hdr_len = sizeof(Eth803Hdr_t);
|
||||
|
||||
t_u8 forward_flag = MFALSE;
|
||||
|
||||
ENTER();
|
||||
while (total_pkt_len >= hdr_len) {
|
||||
if (priv->bss_role == MLAN_BSS_ROLE_UAP &&
|
||||
wlan_uap_check_forward(priv, (Eth803Hdr_t *)data))
|
||||
forward_flag = MTRUE;
|
||||
/* Length will be in network format, change it to host */
|
||||
pkt_len = mlan_ntohs(
|
||||
(*(t_u16 *)(data + (2 * MLAN_MAC_ADDR_LENGTH))));
|
||||
|
@ -198,6 +226,7 @@ static int wlan_11n_get_num_aggrpkts(t_u8 *data, int total_pkt_len)
|
|||
total_pkt_len -= pkt_len + pad + sizeof(Eth803Hdr_t);
|
||||
++pkt_count;
|
||||
}
|
||||
*forward = forward_flag;
|
||||
LEAVE();
|
||||
return pkt_count;
|
||||
}
|
||||
|
@ -228,6 +257,7 @@ mlan_status wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
|
|||
t_u8 rfc1042_eth_hdr[MLAN_MAC_ADDR_LENGTH] = {0xaa, 0xaa, 0x03,
|
||||
0x00, 0x00, 0x00};
|
||||
t_u8 hdr_len = sizeof(Eth803Hdr_t);
|
||||
t_u8 forward = MFALSE;
|
||||
t_u8 eapol_type[2] = {0x88, 0x8e};
|
||||
t_u8 tdls_action_type[2] = {0x89, 0x0d};
|
||||
t_u32 in_ts_sec, in_ts_usec;
|
||||
|
@ -236,6 +266,7 @@ mlan_status wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
|
|||
t_u32 out_copy_ts_sec, out_copy_ts_usec;
|
||||
t_u32 copy_delay = 0;
|
||||
t_u32 delay = 0;
|
||||
t_u8 num_subframes = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
@ -269,7 +300,8 @@ mlan_status wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
|
|||
if (pmadapter->tp_state_on)
|
||||
pmadapter->callbacks.moal_get_system_time(
|
||||
pmadapter->pmoal_handle, &in_ts_sec, &in_ts_usec);
|
||||
pmbuf->use_count = wlan_11n_get_num_aggrpkts(data, total_pkt_len);
|
||||
num_subframes = pmbuf->use_count =
|
||||
wlan_11n_get_num_aggrpkts(priv, data, total_pkt_len, &forward);
|
||||
|
||||
// rx_trace 7
|
||||
if (pmadapter->tp_state_on) {
|
||||
|
@ -281,13 +313,13 @@ mlan_status wlan_11n_deaggregate_pkt(mlan_private *priv, pmlan_buffer pmbuf)
|
|||
if (pmadapter->tp_state_drop_point == 7 /*RX_DROP_P3*/)
|
||||
goto done;
|
||||
prx_pkt = (RxPacketHdr_t *)data;
|
||||
if (pmbuf->pdesc && !memcmp(pmadapter, prx_pkt->eth803_hdr.dest_addr,
|
||||
priv->curr_addr, MLAN_MAC_ADDR_LENGTH)) {
|
||||
/** check if packet need send to host only */
|
||||
if (pmbuf->pdesc && !forward) {
|
||||
if (pmadapter->callbacks.moal_recv_amsdu_packet) {
|
||||
ret = pmadapter->callbacks.moal_recv_amsdu_packet(
|
||||
pmadapter->pmoal_handle, pmbuf);
|
||||
if (ret == MLAN_STATUS_PENDING) {
|
||||
priv->msdu_in_rx_amsdu_cnt += pmbuf->use_count;
|
||||
priv->msdu_in_rx_amsdu_cnt += num_subframes;
|
||||
priv->amsdu_rx_cnt++;
|
||||
return ret;
|
||||
}
|
||||
|
@ -474,9 +506,9 @@ int wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
|
|||
pmbuf_src = (pmlan_buffer)util_peek_list(
|
||||
pmadapter->pmoal_handle, &pra_list->buf_head, MNULL, MNULL);
|
||||
if (pmbuf_src) {
|
||||
pmbuf_aggr = wlan_alloc_mlan_buffer(pmadapter,
|
||||
pmadapter->tx_buf_size, 0,
|
||||
MOAL_MALLOC_BUFFER);
|
||||
pmbuf_aggr = wlan_alloc_mlan_buffer(
|
||||
pmadapter, pmadapter->tx_buf_size, 0,
|
||||
MOAL_MALLOC_BUFFER | MOAL_MEM_FLAG_ATOMIC);
|
||||
if (!pmbuf_aggr) {
|
||||
PRINTM(MERROR, "Error allocating mlan_buffer\n");
|
||||
pmadapter->callbacks.moal_spin_unlock(
|
||||
|
@ -494,6 +526,8 @@ 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)
|
||||
|
@ -522,7 +556,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->pdesc, 3);
|
||||
pmadapter->pmoal_handle, pmbuf_src, 3);
|
||||
pra_list->total_pkts--;
|
||||
|
||||
/* decrement for every PDU taken from the list */
|
||||
|
@ -670,5 +704,5 @@ int wlan_11n_aggregate_pkt(mlan_private *priv, raListTbl *pra_list,
|
|||
|
||||
exit:
|
||||
LEAVE();
|
||||
return pkt_size + headroom;
|
||||
return MIN((pkt_size + headroom), INT_MAX);
|
||||
}
|
||||
|
|
|
@ -134,13 +134,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 = 0;
|
||||
t_u16 min_flush_time = pmadapter->flush_time_ac_be_bk;
|
||||
mlan_wmm_ac_e wmm_ac;
|
||||
ENTER();
|
||||
|
||||
if (rx_reor_tbl_ptr->win_size >= 32)
|
||||
min_flush_time = MIN_FLUSH_TIMER_15_MS;
|
||||
else
|
||||
min_flush_time = MIN_FLUSH_TIMER_MS;
|
||||
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->timer_context.timer_is_set)
|
||||
pmadapter->callbacks.moal_stop_timer(
|
||||
|
@ -149,7 +149,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, (rx_reor_tbl_ptr->win_size * min_flush_time));
|
||||
MFALSE, min_flush_time);
|
||||
|
||||
rx_reor_tbl_ptr->timer_context.timer_is_set = MTRUE;
|
||||
LEAVE();
|
||||
|
@ -168,7 +168,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)
|
||||
{
|
||||
int no_pkt_to_send, i, xchg;
|
||||
t_u32 no_pkt_to_send, i, xchg;
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
void *rx_tmp_ptr = MNULL;
|
||||
mlan_private *pmpriv = (mlan_private *)priv;
|
||||
|
@ -208,6 +208,13 @@ 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 */
|
||||
if (no_pkt_to_send < (8 * (sizeof(rx_reor_tbl_ptr->bitmap))))
|
||||
rx_reor_tbl_ptr->bitmap =
|
||||
rx_reor_tbl_ptr->bitmap >> no_pkt_to_send;
|
||||
else
|
||||
rx_reor_tbl_ptr->bitmap = 0;
|
||||
|
||||
rx_reor_tbl_ptr->start_win = start_win;
|
||||
pmpriv->adapter->callbacks.moal_spin_unlock(
|
||||
pmpriv->adapter->pmoal_handle, pmpriv->rx_pkt_lock);
|
||||
|
@ -286,6 +293,12 @@ static mlan_status wlan_11n_scan_and_dispatch(t_void *priv,
|
|||
}
|
||||
}
|
||||
|
||||
/* clear the bits of reorder bitmap that has been dispatched */
|
||||
if (i < (8 * sizeof(rx_reor_tbl_ptr->bitmap)))
|
||||
rx_reor_tbl_ptr->bitmap = rx_reor_tbl_ptr->bitmap >> i;
|
||||
else
|
||||
rx_reor_tbl_ptr->bitmap = 0;
|
||||
|
||||
rx_reor_tbl_ptr->start_win =
|
||||
(rx_reor_tbl_ptr->start_win + i) & (MAX_TID_VALUE - 1);
|
||||
|
||||
|
@ -517,6 +530,8 @@ 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;
|
||||
|
@ -614,10 +629,62 @@ 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.
|
||||
|
@ -636,7 +703,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;
|
||||
int win_size = 0;
|
||||
t_u32 win_size = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
@ -681,21 +748,26 @@ 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;
|
||||
|
||||
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;
|
||||
/*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;
|
||||
|
||||
if (win_size == 0)
|
||||
padd_ba_rsp->status_code =
|
||||
wlan_cpu_to_le16(ADDBA_RSP_STATUS_DECLINED);
|
||||
padd_ba_rsp->block_ack_param_set |= win_size
|
||||
<< BLOCKACKPARAM_WINSIZE_POS;
|
||||
|
||||
padd_ba_rsp->block_ack_param_set =
|
||||
wlan_cpu_to_le16(padd_ba_rsp->block_ack_param_set);
|
||||
|
@ -789,6 +861,11 @@ 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 {
|
||||
|
@ -956,6 +1033,8 @@ 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 +
|
||||
|
@ -969,6 +1048,9 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -984,11 +1066,20 @@ mlan_status mlan_11n_rxreorder_pkt(void *priv, t_u16 seq_num, t_u16 tid,
|
|||
}
|
||||
|
||||
done:
|
||||
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->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);
|
||||
}
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
@ -1023,7 +1114,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);
|
||||
|
||||
|
@ -1058,14 +1149,13 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1152,11 +1242,19 @@ 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);
|
||||
|
@ -1165,7 +1263,10 @@ 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;
|
||||
wlan_prepare_cmd(priv, HostCmd_CMD_11N_DELBA, 0, 0, MNULL, &delba);
|
||||
ret = wlan_prepare_cmd(priv, HostCmd_CMD_11N_DELBA, 0, 0, MNULL,
|
||||
&delba);
|
||||
if (ret)
|
||||
PRINTM(MERROR, "Failed to send cmd to FW\n");
|
||||
|
||||
LEAVE();
|
||||
return;
|
||||
|
@ -1412,6 +1513,7 @@ void wlan_flush_rxreorder_tbl(pmlan_adapter pmadapter)
|
|||
static void wlan_update_ampdu_rxwinsize(pmlan_adapter pmadapter, t_u8 coex_flag)
|
||||
{
|
||||
t_u8 i;
|
||||
t_u8 j;
|
||||
t_u32 rx_win_size = 0;
|
||||
pmlan_private priv = MNULL;
|
||||
|
||||
|
@ -1436,12 +1538,17 @@ static void wlan_update_ampdu_rxwinsize(pmlan_adapter pmadapter, t_u8 coex_flag)
|
|||
priv->add_ba_param.rx_win_size =
|
||||
MLAN_WFD_COEX_AMPDU_DEF_RXWINSIZE;
|
||||
#endif
|
||||
if (priv->bss_type == MLAN_BSS_TYPE_NAN)
|
||||
priv->add_ba_param.rx_win_size =
|
||||
MLAN_NAN_COEX_AMPDU_DEF_RXWINSIZE;
|
||||
#ifdef UAP_SUPPORT
|
||||
if (priv->bss_type == MLAN_BSS_TYPE_UAP)
|
||||
priv->add_ba_param.rx_win_size =
|
||||
MLAN_UAP_COEX_AMPDU_DEF_RXWINSIZE;
|
||||
#endif
|
||||
|
||||
priv->add_ba_param.rx_win_size =
|
||||
MIN(priv->add_ba_param.rx_win_size,
|
||||
priv->user_rxwinsize);
|
||||
} else {
|
||||
priv->add_ba_param.rx_win_size =
|
||||
priv->user_rxwinsize;
|
||||
|
@ -1452,8 +1559,8 @@ static void wlan_update_ampdu_rxwinsize(pmlan_adapter pmadapter, t_u8 coex_flag)
|
|||
pmadapter->coex_rx_win_size;
|
||||
if (rx_win_size != priv->add_ba_param.rx_win_size) {
|
||||
if (priv->media_connected == MTRUE) {
|
||||
for (i = 0; i < MAX_NUM_TID; i++)
|
||||
wlan_11n_delba(priv, i);
|
||||
for (j = 0; j < MAX_NUM_TID; j++)
|
||||
wlan_11n_delba(priv, j);
|
||||
wlan_recv_event(
|
||||
priv,
|
||||
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
|
||||
|
|
|
@ -82,6 +82,7 @@ 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,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* related code
|
||||
*
|
||||
*
|
||||
* Copyright 2009-2022 NXP
|
||||
* Copyright 2009-2023 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -32,6 +32,7 @@
|
|||
#include "mlan_fw.h"
|
||||
#include "mlan_join.h"
|
||||
#include "mlan_main.h"
|
||||
#include "mlan_11h.h"
|
||||
|
||||
/********************************************************
|
||||
* Local Variables
|
||||
|
@ -87,7 +88,7 @@ static country_code_mapping_t country_code_mapping[] = {
|
|||
{"IN", 0x10, 0x06}, /* India */
|
||||
{"MY", 0x30, 0x06}, /* Malaysia */
|
||||
{"NZ", 0x30, 0x30}, /* New Zeland */
|
||||
{"MX", 0x10, 0x07}, /* Mexico */
|
||||
{"MX", 0x30, 0x07}, /* Mexico */
|
||||
};
|
||||
|
||||
/** Country code for ETSI */
|
||||
|
@ -159,8 +160,8 @@ static chan_freq_power_t channel_freq_power_EU_BG[] = {
|
|||
{9, 2452, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{10, 2457, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{11, 2462, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{12, 2467, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1d, 0, 0}},
|
||||
{13, 2472, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1d, 0, 0}}};
|
||||
{12, 2467, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{13, 2472, WLAN_TX_PWR_EMEA_DEFAULT, MFALSE, {0x1c, 0, 0}}};
|
||||
|
||||
/** Band: 'B/G', Region: Japan */
|
||||
static chan_freq_power_t channel_freq_power_JPN41_BG[] = {
|
||||
|
@ -175,8 +176,8 @@ static chan_freq_power_t channel_freq_power_JPN41_BG[] = {
|
|||
{9, 2452, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{10, 2457, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{11, 2462, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}},
|
||||
{13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}}};
|
||||
{12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}};
|
||||
|
||||
/** Band: 'B/G', Region: Japan */
|
||||
static chan_freq_power_t channel_freq_power_JPN40_BG[] = {
|
||||
|
@ -211,8 +212,8 @@ static chan_freq_power_t channel_freq_power_BR_BG[] = {
|
|||
{9, 2452, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}},
|
||||
{10, 2457, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}},
|
||||
{11, 2462, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}},
|
||||
{12, 2467, WLAN_TX_PWR_1000MW, MFALSE, {0x1d, 0, 0}},
|
||||
{13, 2472, WLAN_TX_PWR_1000MW, MFALSE, {0x1d, 0, 0}}};
|
||||
{12, 2467, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}},
|
||||
{13, 2472, WLAN_TX_PWR_1000MW, MFALSE, {0x1c, 0, 0}}};
|
||||
|
||||
/** Band : 'B/G', Region: Special */
|
||||
static chan_freq_power_t channel_freq_power_SPECIAL_BG[] = {
|
||||
|
@ -227,9 +228,9 @@ static chan_freq_power_t channel_freq_power_SPECIAL_BG[] = {
|
|||
{9, 2452, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{10, 2457, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{11, 2462, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}},
|
||||
{13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}},
|
||||
{14, 2484, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1d, 0, 0}}};
|
||||
{12, 2467, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{13, 2472, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}},
|
||||
{14, 2484, WLAN_TX_PWR_JP_BG_DEFAULT, MFALSE, {0x1c, 0, 0}}};
|
||||
|
||||
/**
|
||||
* The 2.4GHz CFP tables
|
||||
|
@ -397,6 +398,7 @@ 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}},
|
||||
|
@ -578,10 +580,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, 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}},
|
||||
{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}},
|
||||
{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}},
|
||||
|
@ -2446,9 +2448,6 @@ 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();
|
||||
|
@ -2461,11 +2460,12 @@ 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 oper_class, t_u8 bandwidth)
|
||||
{
|
||||
int arraysize = 0, i = 0, channum = 0;
|
||||
oper_bw_chan *poper_bw_chan = MNULL;
|
||||
|
@ -2488,7 +2488,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_AAC, channel, CHANNEL_BW_80MHZ);
|
||||
pmpriv, BAND_5GHZ, channel, CHANNEL_BW_80MHZ);
|
||||
channel = center_freq_idx;
|
||||
}
|
||||
poper_bw_chan = wlan_get_nonglobal_operclass_table(pmpriv, &arraysize);
|
||||
|
@ -2558,7 +2558,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_AAC, channel, CHANNEL_BW_80MHZ);
|
||||
pmpriv, BAND_5GHZ, channel, CHANNEL_BW_80MHZ);
|
||||
channel = center_freq_idx;
|
||||
}
|
||||
|
||||
|
@ -2579,7 +2579,7 @@ mlan_status wlan_get_curr_oper_class(mlan_private *pmpriv, t_u8 channel,
|
|||
}
|
||||
}
|
||||
|
||||
PRINTM(MCMND, "Operating class not find!\n");
|
||||
PRINTM(MCMND, "Operating class not found!\n");
|
||||
LEAVE();
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
@ -2596,14 +2596,16 @@ 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[] = {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 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 country_code[][COUNTRY_CODE_LEN] = {"US", "JP", "CN"};
|
||||
int country_id = 0, ret = 0;
|
||||
MrvlIETypes_SuppOperClass_t *poper_class = MNULL;
|
||||
|
@ -2713,11 +2715,12 @@ 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, cfp_no,
|
||||
wlan_cfp_copy_dynamic(pmadapter, cfp, (t_u8)cfp_no,
|
||||
region_chan_old[j].pcfp,
|
||||
region_chan_old[j].num_cfp);
|
||||
} else if (cfp) {
|
||||
wlan_cfp_copy_dynamic(pmadapter, cfp, cfp_no, MNULL, 0);
|
||||
wlan_cfp_copy_dynamic(pmadapter, cfp, (t_u8)cfp_no,
|
||||
MNULL, 0);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
@ -2745,11 +2748,12 @@ 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, cfp_no,
|
||||
wlan_cfp_copy_dynamic(pmadapter, cfp, (t_u8)cfp_no,
|
||||
region_chan_old[j].pcfp,
|
||||
region_chan_old[j].num_cfp);
|
||||
} else if (cfp) {
|
||||
wlan_cfp_copy_dynamic(pmadapter, cfp, cfp_no, MNULL, 0);
|
||||
wlan_cfp_copy_dynamic(pmadapter, cfp, (t_u8)cfp_no,
|
||||
MNULL, 0);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
@ -3101,6 +3105,41 @@ dfs_state_t wlan_get_chan_dfs_state(mlan_private *priv, t_u16 band, t_u8 chan)
|
|||
return dfs_state;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief reset all channel's dfs state
|
||||
*
|
||||
* @param priv Private driver information structure
|
||||
* @param band Band to check
|
||||
* @param dfs_state dfs state
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
t_void wlan_reset_all_chan_dfs_state(mlan_private *priv, t_u16 band,
|
||||
dfs_state_t dfs_state)
|
||||
{
|
||||
int i, j;
|
||||
chan_freq_power_t *pcfp = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
/*get the cfp table first*/
|
||||
for (i = 0; i < MAX_REGION_CHANNEL_NUM; i++) {
|
||||
if (priv->adapter->region_channel[i].band & band) {
|
||||
pcfp = priv->adapter->region_channel[i].pcfp;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (pcfp) {
|
||||
/*check table according to chan num*/
|
||||
for (j = 0; j < priv->adapter->region_channel[i].num_cfp; j++) {
|
||||
pcfp[j].dynamic.dfs_state = dfs_state;
|
||||
}
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convert rateid in IEEE format to MRVL format
|
||||
*
|
||||
|
@ -3330,27 +3369,49 @@ 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;
|
||||
pmadapter->country_code[0] =
|
||||
pmadapter->otp_region->country_code[0];
|
||||
pmadapter->country_code[1] =
|
||||
pmadapter->otp_region->country_code[1];
|
||||
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[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 =
|
||||
|
@ -3667,6 +3728,13 @@ 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
|
@ -24,7 +24,7 @@
|
|||
#define _MLAN_DECL_H_
|
||||
|
||||
/** MLAN release version */
|
||||
#define MLAN_RELEASE_VERSION "322"
|
||||
#define MLAN_RELEASE_VERSION "423.p6"
|
||||
|
||||
/** Re-define generic data types for MLAN/MOAL */
|
||||
/** Signed char (1-byte) */
|
||||
|
@ -129,13 +129,8 @@ typedef t_s32 t_sval;
|
|||
/** Return aligned offset */
|
||||
#define OFFSET_ALIGN_ADDR(p, a) (t_u32)(ALIGN_ADDR(p, a) - (t_ptr)p)
|
||||
|
||||
#if defined(WIFI_DIRECT_SUPPORT)
|
||||
/** Maximum BSS numbers */
|
||||
#define MLAN_MAX_BSS_NUM (16)
|
||||
#else
|
||||
/** Maximum BSS numbers */
|
||||
#define MLAN_MAX_BSS_NUM (2)
|
||||
#endif
|
||||
|
||||
/** NET IP alignment */
|
||||
#define MLAN_NET_IP_ALIGN 2
|
||||
|
@ -186,6 +181,11 @@ typedef t_s32 t_sval;
|
|||
#define MLAN_WFD_COEX_AMPDU_DEF_RXWINSIZE 16
|
||||
#endif
|
||||
|
||||
/** NAN use the same window size for tx/rx */
|
||||
#define MLAN_NAN_AMPDU_DEF_TXRXWINSIZE 16
|
||||
/** RX winsize for COEX */
|
||||
#define MLAN_NAN_COEX_AMPDU_DEF_RXWINSIZE 16
|
||||
|
||||
/** Block ack timeout value */
|
||||
#define MLAN_DEFAULT_BLOCK_ACK_TIMEOUT 0xffff
|
||||
/** Maximum Tx Win size configured for ADDBA request [10 bits] */
|
||||
|
@ -267,12 +267,22 @@ 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
|
||||
#endif
|
||||
/** sdio hw reset */
|
||||
#define FW_RELOAD_SDIO_HW_RESET 5
|
||||
/** pcie inband reset */
|
||||
#define FW_RELOAD_PCIE_INBAND_RESET 6
|
||||
|
||||
/** auto fw reload enable */
|
||||
#define AUTO_FW_RELOAD_ENABLE MBIT(0)
|
||||
/** auto fw reload enable pcie inband reset */
|
||||
#define AUTO_FW_RELOAD_PCIE_INBAND_RESET MBIT(1)
|
||||
|
||||
#ifdef PCIE
|
||||
/* Interrupt type */
|
||||
enum { RX_DATA, RX_EVENT, TX_COMPLETE, RX_CMD_RESP, RX_CMD_DNLD };
|
||||
#endif
|
||||
#ifdef USB
|
||||
#define MLAN_USB_BLOCK_SIZE (512)
|
||||
#define MLAN_USB_AGGR_MODE_NUM (0)
|
||||
|
@ -378,7 +388,9 @@ 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_NW62X 0x0b
|
||||
#define CARD_TYPE_IW624 0x0b
|
||||
/** Black bird card type */
|
||||
#define CARD_TYPE_AW693 0x0c
|
||||
|
||||
/** 9098 A0 reverion num */
|
||||
#define CHIP_9098_REV_A0 1
|
||||
|
@ -410,8 +422,10 @@ 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_NW62X card type */
|
||||
#define CARD_TYPE_SDNW62X (CARD_TYPE_NW62X | (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))
|
||||
|
||||
#define IS_SD8887(ct) (CARD_TYPE_SD8887 == (ct))
|
||||
#define IS_SD8897(ct) (CARD_TYPE_SD8897 == (ct))
|
||||
|
@ -423,7 +437,8 @@ 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_SDNW62X(ct) (CARD_TYPE_SDNW62X == (ct))
|
||||
#define IS_SDIW624(ct) (CARD_TYPE_SDIW624 == (ct))
|
||||
#define IS_SDAW693(ct) (CARD_TYPE_SDAW693 == (ct))
|
||||
|
||||
/** SD8887 Card */
|
||||
#define CARD_SD8887 "SD8887"
|
||||
|
@ -432,7 +447,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
/** SD8977 Card */
|
||||
#define CARD_SD8977 "SD8977"
|
||||
/** SD8978 Card */
|
||||
#define CARD_SD8978 "SD8978"
|
||||
#define CARD_SD8978 "SDIW416"
|
||||
/** SD8997 Card */
|
||||
#define CARD_SD8997 "SD8997"
|
||||
/** SD8987 Card */
|
||||
|
@ -442,11 +457,13 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
/** SD9098 Card */
|
||||
#define CARD_SD9098 "SD9098"
|
||||
/** SD9177 Card */
|
||||
#define CARD_SD9177 "SD9177"
|
||||
#define CARD_SD9177 "SDIW612"
|
||||
/** SD8801 Card */
|
||||
#define CARD_SD8801 "SD8801"
|
||||
/** SDNW62X Card */
|
||||
#define CARD_SDNW62X "SDNW62X"
|
||||
/** SDIW624 Card */
|
||||
#define CARD_SDIW624 "SDIW624"
|
||||
/** SDAW693 Card */
|
||||
#define CARD_SDAW693 "SDAW693"
|
||||
#endif
|
||||
|
||||
#ifdef PCIE
|
||||
|
@ -458,14 +475,17 @@ 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))
|
||||
/** PCIENW62X card type */
|
||||
#define CARD_TYPE_PCIENW62X (CARD_TYPE_NW62X | (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))
|
||||
|
||||
#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_PCIENW62X(ct) (CARD_TYPE_PCIENW62X == (ct))
|
||||
#define IS_PCIEIW624(ct) (CARD_TYPE_PCIEIW624 == (ct))
|
||||
#define IS_PCIEAW693(ct) (CARD_TYPE_PCIEAW693 == (ct))
|
||||
|
||||
/** PCIE8897 Card */
|
||||
#define CARD_PCIE8897 "PCIE8897"
|
||||
|
@ -479,8 +499,12 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_PCIE9098 "PCIE9098"
|
||||
/** PCIEAW690 Card */
|
||||
#define CARD_PCIEAW690 "PCIEAW690"
|
||||
/** PCIENW62X Card */
|
||||
#define CARD_PCIENW62X "PCIENW62X"
|
||||
/** PCIEIW624 Card */
|
||||
#define CARD_PCIEIW624 "PCIEIW624"
|
||||
/** PCIEAW693 Card */
|
||||
#define CARD_PCIEAW693 "PCIEAW693"
|
||||
/** PCIEIW629 Card */
|
||||
#define CARD_PCIEIW629 "PCIEIW629"
|
||||
#endif
|
||||
|
||||
#ifdef USB
|
||||
|
@ -496,8 +520,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))
|
||||
/** USBNW62X card type */
|
||||
#define CARD_TYPE_USBNW62X (CARD_TYPE_NW62X | (INTF_USB << 8))
|
||||
/** USBIW624 card type */
|
||||
#define CARD_TYPE_USBIW624 (CARD_TYPE_IW624 | (INTF_USB << 8))
|
||||
|
||||
#define IS_USB8801(ct) (CARD_TYPE_USB8801 == (ct))
|
||||
#define IS_USB8897(ct) (CARD_TYPE_USB8897 == (ct))
|
||||
|
@ -505,7 +529,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_USBNW62X(ct) (CARD_TYPE_USBNW62X == (ct))
|
||||
#define IS_USBIW624(ct) (CARD_TYPE_USBIW624 == (ct))
|
||||
|
||||
/** USB8801 Card */
|
||||
#define CARD_USB8801 "USB8801"
|
||||
|
@ -514,13 +538,13 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
/** USB8997 Card */
|
||||
#define CARD_USB8997 "USB8997"
|
||||
/** USB8978 Card */
|
||||
#define CARD_USB8978 "USB8978"
|
||||
#define CARD_USB8978 "USBIW416"
|
||||
/** USB9098 Card */
|
||||
#define CARD_USB9098 "USB9098"
|
||||
/** USB9097 Card */
|
||||
#define CARD_USB9097 "USBIW620"
|
||||
/** USBNW62X Card */
|
||||
#define CARD_USBNW62X "USBNW62X"
|
||||
/** USBIW624 Card */
|
||||
#define CARD_USBIW624 "USBIW624"
|
||||
#endif
|
||||
|
||||
#define IS_CARD8801(ct) (CARD_TYPE_8801 == ((ct)&0xf))
|
||||
|
@ -532,7 +556,8 @@ 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_CARDNW62X(ct) (CARD_TYPE_NW62X == ((ct)&0xf))
|
||||
#define IS_CARDIW624(ct) (CARD_TYPE_IW624 == ((ct)&0xf))
|
||||
#define IS_CARDAW693(ct) (CARD_TYPE_AW693 == ((ct)&0xf))
|
||||
|
||||
typedef struct _card_type_entry {
|
||||
t_u16 card_type;
|
||||
|
@ -602,6 +627,8 @@ 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
|
||||
|
@ -632,6 +659,8 @@ typedef enum {
|
|||
|
||||
/** Memory allocation type: DMA */
|
||||
#define MLAN_MEM_DMA MBIT(0)
|
||||
/** Memory allocation flag: ATOMIC */
|
||||
#define MLAN_MEM_FLAG_ATOMIC MBIT(1)
|
||||
|
||||
/** Default memory allocation flag */
|
||||
#define MLAN_MEM_DEF 0
|
||||
|
@ -686,10 +715,21 @@ 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 {
|
||||
|
@ -713,6 +753,7 @@ typedef enum _mlan_bss_type {
|
|||
#ifdef WIFI_DIRECT_SUPPORT
|
||||
MLAN_BSS_TYPE_WIFIDIRECT = 2,
|
||||
#endif
|
||||
MLAN_BSS_TYPE_NAN = 4,
|
||||
MLAN_BSS_TYPE_DFS = 8,
|
||||
MLAN_BSS_TYPE_ANY = 0xff,
|
||||
} mlan_bss_type;
|
||||
|
@ -769,6 +810,8 @@ typedef enum _mlan_event_id {
|
|||
MLAN_EVENT_ID_FW_RADAR_DETECTED = 0x00000024,
|
||||
MLAN_EVENT_ID_FW_CHANNEL_REPORT_RDY = 0x00000025,
|
||||
MLAN_EVENT_ID_FW_BW_CHANGED = 0x00000026,
|
||||
MLAN_EVENT_ID_FW_IBSS_CONNECT = 0x00000028,
|
||||
MLAN_EVENT_ID_FW_IBSS_DISCONNECT = 0x00000029,
|
||||
MLAN_EVENT_ID_FW_REMAIN_ON_CHAN_EXPIRED = 0x0000002B,
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
|
@ -811,11 +854,22 @@ 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_NAN_STARTED = 0x80000024,
|
||||
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,
|
||||
MLAN_EVENT_ID_DRV_DELAY_TX_COMPLETE = 0x80000036,
|
||||
#endif
|
||||
MLAN_EVENT_ID_DRV_RGPWR_KEY_MISMATCH = 0x80000037,
|
||||
} mlan_event_id;
|
||||
|
||||
/** Data Structures */
|
||||
|
@ -865,7 +919,9 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_Data_t {
|
|||
|
||||
#define OID_TYPE_CAL 0x2
|
||||
#define OID_TYPE_DPD 0xa
|
||||
#define NONE_TYPE_DPD 0xb
|
||||
#define UNKNOW_DPD_LENGTH 0xffffffff
|
||||
#define NONE_DPD_LENGTH 0xfafafafa
|
||||
|
||||
/** Custom data structure */
|
||||
typedef struct _mlan_init_param {
|
||||
|
@ -896,8 +952,8 @@ enum mlan_channel_type {
|
|||
/** channel band */
|
||||
enum { BAND_2GHZ = 0,
|
||||
BAND_5GHZ = 1,
|
||||
BAND_4GHZ = 2,
|
||||
BAND_6GHZ = 3,
|
||||
BAND_6GHZ = 2,
|
||||
BAND_4GHZ = 3,
|
||||
};
|
||||
|
||||
/** channel offset */
|
||||
|
@ -946,9 +1002,27 @@ typedef enum _dfs_w53_cfg_t {
|
|||
DFS_W53_OLD = 2
|
||||
} dfs_w53_cfg_t;
|
||||
|
||||
typedef enum _dfs_moe_t {
|
||||
/** driver default DFS behavior */
|
||||
DFS_MODE_DEFAULT = 0,
|
||||
/* disable DFS master when uap and station operate in same DFS channel
|
||||
*/
|
||||
DFS_MODE_ENH = 1,
|
||||
} dfs_mode_t;
|
||||
|
||||
/** Band_Config_t */
|
||||
typedef MLAN_PACK_START struct _Band_Config_t {
|
||||
/** Band Info - (00)=2.4GHz, (01)=5GHz */
|
||||
#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 */
|
||||
t_u8 chanBand : 2;
|
||||
/** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */
|
||||
t_u8 chanWidth : 2;
|
||||
|
@ -956,6 +1030,7 @@ typedef MLAN_PACK_START struct _Band_Config_t {
|
|||
t_u8 chan2Offset : 2;
|
||||
/** Channel Selection Mode - (00)=manual, (01)=ACS, (02)=Adoption mode*/
|
||||
t_u8 scanMode : 2;
|
||||
#endif
|
||||
} MLAN_PACK_END Band_Config_t;
|
||||
|
||||
/** channel_band_t */
|
||||
|
@ -1122,6 +1197,10 @@ 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 {
|
||||
|
@ -1133,10 +1212,12 @@ typedef MLAN_PACK_START struct _rxpd_extra_info {
|
|||
t_u8 mcs_known;
|
||||
/** mcs.flags */
|
||||
t_u8 mcs_flags;
|
||||
/** vht sig1 */
|
||||
t_u32 vht_sig1;
|
||||
/** vht sig2 */
|
||||
t_u32 vht_sig2;
|
||||
/** vht/he sig1 */
|
||||
t_u32 vht_he_sig1;
|
||||
/** vht/he sig2 */
|
||||
t_u32 vht_he_sig2;
|
||||
/** HE user idx */
|
||||
t_u32 user_idx;
|
||||
} MLAN_PACK_END rxpd_extra_info, *prxpd_extra_info;
|
||||
|
||||
typedef MLAN_PACK_START struct _radiotap_info {
|
||||
|
@ -1157,6 +1238,16 @@ typedef MLAN_PACK_START struct _radiotap_info {
|
|||
|
||||
/** txpower structure */
|
||||
typedef MLAN_PACK_START struct {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Host tx power ctrl:
|
||||
0x0: use fw setting for TX power
|
||||
0x1: value specified in bit[6] and bit[5:0] are valid */
|
||||
t_u8 hostctl : 1;
|
||||
/** Sign of the power specified in bit[5:0] */
|
||||
t_u8 sign : 1;
|
||||
/** Power to be used for transmission(in dBm) */
|
||||
t_u8 abs_val : 6;
|
||||
#else
|
||||
/** Power to be used for transmission(in dBm) */
|
||||
t_u8 abs_val : 6;
|
||||
/** Sign of the power specified in bit[5:0] */
|
||||
|
@ -1165,6 +1256,7 @@ typedef MLAN_PACK_START struct {
|
|||
0x0: use fw setting for TX power
|
||||
0x1: value specified in bit[6] and bit[5:0] are valid */
|
||||
t_u8 hostctl : 1;
|
||||
#endif
|
||||
} MLAN_PACK_END tx_power_t;
|
||||
/* pkt_txctrl */
|
||||
typedef MLAN_PACK_START struct _pkt_txctrl {
|
||||
|
@ -1213,7 +1305,19 @@ typedef MLAN_PACK_START struct _mc_txcontrol {
|
|||
/** mc_pkt_flags */
|
||||
t_u8 mc_pkt_flags;
|
||||
} MLAN_PACK_END mc_txcontrol, *pmc_txcontrol;
|
||||
|
||||
typedef MLAN_PACK_START struct MAPP_Stats_Mcast_drv {
|
||||
t_u32 cycle_recv_under_2300usec;
|
||||
t_u32 cycle_recv_in_time;
|
||||
t_u32 cycle_recv_over_2900usec;
|
||||
t_u32 cycle_recv_over_3500usec;
|
||||
t_u32 cycle_recv_over_5000usec;
|
||||
t_u32 cycle_recv_over_10000usec;
|
||||
t_u32 cycle_recv_over_15000usec;
|
||||
t_u32 spent_time_under_1000usec;
|
||||
t_u32 spent_time_over_1000usec;
|
||||
t_u32 spent_time_over_2000usec;
|
||||
t_u32 spent_time_over_3000usec;
|
||||
} MLAN_PACK_END Stats_mcast_drv_t, *pStats_mcast_drv_t;
|
||||
/** mlan_buffer data structure */
|
||||
typedef struct _mlan_buffer {
|
||||
/** Pointer to previous mlan_buffer */
|
||||
|
@ -1259,6 +1363,8 @@ 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;
|
||||
|
@ -1649,6 +1755,14 @@ 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,
|
||||
|
@ -1706,6 +1820,15 @@ 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
|
||||
|
@ -1787,15 +1910,6 @@ 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) */
|
||||
|
@ -1989,9 +2103,320 @@ 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
|
||||
|
@ -2139,12 +2564,6 @@ 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,
|
||||
|
@ -2233,8 +2652,6 @@ 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 */
|
||||
|
@ -2272,6 +2689,8 @@ 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;
|
||||
|
@ -2282,6 +2701,8 @@ 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;
|
||||
|
@ -2291,8 +2712,16 @@ 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 */
|
||||
|
@ -2373,7 +2802,103 @@ 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
|
||||
|
||||
/** secure add/sub **/
|
||||
#ifndef SINT8_MAX
|
||||
#define SINT8_MAX 0x7f
|
||||
#endif
|
||||
|
||||
#ifndef SINT8_MIN
|
||||
#define SINT8_MIN 0x80
|
||||
#endif
|
||||
|
||||
#ifndef UINT8_MAX
|
||||
#define UINT8_MAX 0xff
|
||||
#endif
|
||||
|
||||
#ifndef SINT16_MAX
|
||||
#define SINT16_MAX 0x7fff
|
||||
#endif
|
||||
|
||||
#ifndef SINT16_MIN
|
||||
#define SINT16_MIN 0x8000
|
||||
#endif
|
||||
|
||||
#ifndef UINT16_MAX
|
||||
#define UINT16_MAX 0xffff
|
||||
#endif
|
||||
|
||||
#ifndef SINT32_MAX
|
||||
#define SINT32_MAX 0x7fffffff
|
||||
#endif
|
||||
|
||||
#ifndef SINT32_MIN
|
||||
#define SINT32_MIN 0x80000000
|
||||
#endif
|
||||
|
||||
#ifndef UINT32_MAX
|
||||
#define UINT32_MAX 0xffffffff
|
||||
#endif
|
||||
|
||||
#ifndef SINT64_MAX
|
||||
#define SINT64_MAX 0x7fffffffffffffff
|
||||
#endif
|
||||
|
||||
#ifndef SINT64_MIN
|
||||
#define SINT64_MIN 0x8000000000000000
|
||||
#endif
|
||||
|
||||
#ifndef UINT64_MAX
|
||||
#define UINT64_MAX 0xffffffffffffffff
|
||||
#endif
|
||||
|
||||
#ifndef PTR_MAX
|
||||
#ifdef MLAN_64BIT
|
||||
#define PTR_MAX UINT64_MAX
|
||||
#else
|
||||
#define PTR_MAX UINT32_MAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SINT_MAX
|
||||
#ifdef MLAN_64BIT
|
||||
#define SINT_MAX SINT64_MAX
|
||||
#else
|
||||
#define SINT_MAX SINT32_MAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SINT_MIN
|
||||
#ifdef MLAN_64BIT
|
||||
#define SINT_MIN SINT64_MIN
|
||||
#else
|
||||
#define SINT_MIN SINT32_MIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT_MAX
|
||||
#ifdef MLAN_64BIT
|
||||
#define UINT_MAX UINT64_MAX
|
||||
#else
|
||||
#define UINT_MAX UINT32_MAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
TYPE_SINT8,
|
||||
TYPE_UINT8,
|
||||
TYPE_SINT16,
|
||||
TYPE_UINT16,
|
||||
TYPE_SINT32,
|
||||
TYPE_UINT32,
|
||||
TYPE_SINT64,
|
||||
TYPE_UINT64,
|
||||
TYPE_PTR,
|
||||
} data_type;
|
||||
|
||||
#endif /* !_MLAN_DECL_H_ */
|
||||
|
|
221
mxm_wifiex/wlan_src/mlan/mlan_event_ids.h
Normal file
221
mxm_wifiex/wlan_src/mlan/mlan_event_ids.h
Normal file
|
@ -0,0 +1,221 @@
|
|||
/** @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_NAN_GENERIC, 0x0075),
|
||||
|
||||
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),
|
||||
ENUM_ELEMENT(EVENT_DPD_LOG, 0x0091),
|
||||
/** 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 */
|
||||
ENUM_ELEMENT_LAST(__HostEvent_Last)
|
File diff suppressed because it is too large
Load diff
466
mxm_wifiex/wlan_src/mlan/mlan_hostcmd_ids.h
Normal file
466
mxm_wifiex/wlan_src/mlan/mlan_hostcmd_ids.h
Normal file
|
@ -0,0 +1,466 @@
|
|||
/** @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 : 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 : GPIO Configuration */
|
||||
ENUM_ELEMENT(HostCmd_CMD_GPIO_CFG, 0x0041),
|
||||
|
||||
/** 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),
|
||||
|
||||
ENUM_ELEMENT(HostCmd_CMD_EDMAC_CFG, 0x0130),
|
||||
|
||||
/** 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: NAN Parameters cofiguration */
|
||||
ENUM_ELEMENT(HostCmd_CMD_NAN_PARAMS_CONFIG, 0x0228),
|
||||
/** Host Command ID: NAN mode cofiguration */
|
||||
ENUM_ELEMENT(HostCmd_CMD_NAN_MODE_CONFIG, 0x0229),
|
||||
/** Host Command ID: NAN service discovery functionality */
|
||||
ENUM_ELEMENT(HostCmd_CMD_NAN_SDF, 0x022a),
|
||||
/** Host Command ID: NAN service hash */
|
||||
ENUM_ELEMENT(HostCmd_CMD_NAN_SERVICE_HASH, 0x022b),
|
||||
/** Host Command ID: NAN service state info (get/set) */
|
||||
ENUM_ELEMENT(HostCmd_CMD_NAN_STATE_INFO, 0x022c),
|
||||
|
||||
/** 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),
|
||||
|
||||
/** Host Command ID: Tx Frame */
|
||||
ENUM_ELEMENT(HostCmd_CMD_802_11_TX_FRAME, 0x0283),
|
||||
|
||||
/* Always keep this last */
|
||||
ENUM_ELEMENT_LAST(__HostCmd_CMD_Last)
|
|
@ -4,7 +4,7 @@
|
|||
* definitions used in MLAN and MOAL module.
|
||||
*
|
||||
*
|
||||
* Copyright 2008-2022 NXP
|
||||
* Copyright 2008-2023 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -46,10 +46,17 @@ typedef enum _WLAN_802_11_NETWORK_TYPE {
|
|||
Wlan802_11NetworkTypeMax
|
||||
} WLAN_802_11_NETWORK_TYPE;
|
||||
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Frame control: Type Mgmt frame */
|
||||
#define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 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)
|
||||
|
@ -83,6 +90,8 @@ 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,
|
||||
|
@ -170,14 +179,50 @@ 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 */
|
||||
|
@ -274,6 +319,27 @@ typedef MLAN_PACK_START struct {
|
|||
t_u8 variablep[];
|
||||
} MLAN_PACK_END IEEEtypes_assoc_req;
|
||||
|
||||
/** Assoc Request */
|
||||
#define SUBTYPE_ASSOC_REQUEST 0
|
||||
/** Assoc Response */
|
||||
#define SUBTYPE_ASSOC_RESP 1
|
||||
/** ReAssoc Request */
|
||||
#define SUBTYPE_REASSOC_REQUEST 2
|
||||
/** ReAssoc Request */
|
||||
#define SUBTYPE_REASSOC_RESP 3
|
||||
/** Probe Resp */
|
||||
#define SUBTYPE_PROBE_RESP 5
|
||||
/** Disassoc Request */
|
||||
#define SUBTYPE_DISASSOC 10
|
||||
/** Auth Request */
|
||||
#define SUBTYPE_AUTH 11
|
||||
/** Deauth Request */
|
||||
#define SUBTYPE_DEAUTH 12
|
||||
/** Action frame */
|
||||
#define SUBTYPE_ACTION 13
|
||||
/** beacon */
|
||||
#define SUBTYPE_BEACON 8
|
||||
|
||||
/*Mgmt frame*/
|
||||
typedef MLAN_PACK_START struct {
|
||||
/** frame control */
|
||||
|
@ -310,6 +376,25 @@ typedef MLAN_PACK_START struct _TLV_Generic_t {
|
|||
#define CAPINFO_MASK (~(MBIT(15) | MBIT(14) | MBIT(11) | MBIT(9)))
|
||||
|
||||
/** Capability Bit Map*/
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
|
||||
t_u8 rsrvd1 : 2;
|
||||
t_u8 dsss_ofdm : 1;
|
||||
t_u8 radio_measurement : 1;
|
||||
t_u8 rsvrd2 : 1;
|
||||
t_u8 short_slot_time : 1;
|
||||
t_u8 rsrvd3 : 1;
|
||||
t_u8 spectrum_mgmt : 1;
|
||||
t_u8 chan_agility : 1;
|
||||
t_u8 pbcc : 1;
|
||||
t_u8 short_preamble : 1;
|
||||
t_u8 privacy : 1;
|
||||
t_u8 cf_poll_rqst : 1;
|
||||
t_u8 cf_pollable : 1;
|
||||
t_u8 ibss : 1;
|
||||
t_u8 ess : 1;
|
||||
} MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
|
||||
#else
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
|
||||
/** Capability Bit Map : ESS */
|
||||
t_u8 ess : 1;
|
||||
|
@ -342,6 +427,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
|
|||
/** Capability Bit Map : Reserved */
|
||||
t_u8 rsrvd1 : 2;
|
||||
} MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
|
||||
/** IEEEtypes_Ssid_t */
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_Ssid_t {
|
||||
|
@ -556,16 +642,35 @@ typedef MLAN_PACK_START struct _IEEEtypes_Wpa_t {
|
|||
|
||||
/** Data structure of WMM QoS information */
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_WmmQosInfo_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** QoS UAPSD */
|
||||
t_u8 qos_uapsd : 1;
|
||||
/** Reserved */
|
||||
t_u8 reserved : 3;
|
||||
/** Parameter set count */
|
||||
t_u8 para_set_count : 4;
|
||||
#else
|
||||
/** Parameter set count */
|
||||
t_u8 para_set_count : 4;
|
||||
/** Reserved */
|
||||
t_u8 reserved : 3;
|
||||
/** QoS UAPSD */
|
||||
t_u8 qos_uapsd : 1;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
} MLAN_PACK_END IEEEtypes_WmmQosInfo_t, *pIEEEtypes_WmmQosInfo_t;
|
||||
|
||||
/** Data structure of WMM Aci/Aifsn */
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Reserved */
|
||||
t_u8 reserved : 1;
|
||||
/** Aci */
|
||||
t_u8 aci : 2;
|
||||
/** Acm */
|
||||
t_u8 acm : 1;
|
||||
/** Aifsn */
|
||||
t_u8 aifsn : 4;
|
||||
#else
|
||||
/** Aifsn */
|
||||
t_u8 aifsn : 4;
|
||||
/** Acm */
|
||||
|
@ -574,14 +679,22 @@ typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t {
|
|||
t_u8 aci : 2;
|
||||
/** Reserved */
|
||||
t_u8 reserved : 1;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
} MLAN_PACK_END IEEEtypes_WmmAciAifsn_t, *pIEEEtypes_WmmAciAifsn_t;
|
||||
|
||||
/** Data structure of WMM ECW */
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_WmmEcw_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Maximum Ecw */
|
||||
t_u8 ecw_max : 4;
|
||||
/** Minimum Ecw */
|
||||
t_u8 ecw_min : 4;
|
||||
#else
|
||||
/** Minimum Ecw */
|
||||
t_u8 ecw_min : 4;
|
||||
/** Maximum Ecw */
|
||||
t_u8 ecw_max : 4;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
} MLAN_PACK_END IEEEtypes_WmmEcw_t, *pIEEEtypes_WmmEcw_t;
|
||||
|
||||
/** Data structure of WMM AC parameters */
|
||||
|
@ -669,6 +782,22 @@ typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e {
|
|||
|
||||
/** Data structure of WMM TSPEC information */
|
||||
typedef MLAN_PACK_START struct {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
t_u8 Reserved17_23 : 7; /* ! Reserved */
|
||||
t_u8 Schedule : 1;
|
||||
IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2;
|
||||
t_u8 UserPri : 3; /* ! 802.1d User Priority */
|
||||
// IEEEtypes_WMM_TSPEC_TS_Info_PSB_e PowerSaveBehavior : 1; /*
|
||||
// !Legacy/Trigg*/
|
||||
t_u8 PowerSaveBehavior : 1;
|
||||
t_u8 Aggregation : 1; /* ! Reserved */
|
||||
t_u8 AccessPolicy2 : 1; /* ! */
|
||||
t_u8 AccessPolicy1 : 1; /* ! */
|
||||
IEEEtypes_WMM_TSPEC_TS_Info_Direction_e Direction : 2;
|
||||
t_u8 TID : 4; /* ! Unique identifier */
|
||||
// IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1;
|
||||
t_u8 TrafficType : 1;
|
||||
#else
|
||||
// IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1;
|
||||
t_u8 TrafficType : 1;
|
||||
t_u8 TID : 4; /* ! Unique identifier */
|
||||
|
@ -683,19 +812,31 @@ typedef MLAN_PACK_START struct {
|
|||
IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2;
|
||||
t_u8 Schedule : 1;
|
||||
t_u8 Reserved17_23 : 7; /* ! Reserved */
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_t;
|
||||
|
||||
/** Data structure of WMM TSPEC Nominal Size */
|
||||
typedef MLAN_PACK_START struct {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is
|
||||
nominal */
|
||||
t_u16 Size : 15; /* ! Nominal size in octets */
|
||||
#else
|
||||
t_u16 Size : 15; /* ! Nominal size in octets */
|
||||
t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is
|
||||
nominal */
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_NomMSDUSize_t;
|
||||
|
||||
/** Data structure of WMM TSPEC SBWA */
|
||||
typedef MLAN_PACK_START struct {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
t_u16 Whole : 3; /* ! Whole portion */
|
||||
t_u16 Fractional : 13; /* ! Fractional portion */
|
||||
#else
|
||||
t_u16 Fractional : 13; /* ! Fractional portion */
|
||||
t_u16 Whole : 3; /* ! Whole portion */
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_SBWA;
|
||||
|
||||
/** Data structure of WMM TSPEC Body */
|
||||
|
@ -1036,6 +1177,26 @@ typedef MLAN_PACK_START struct _VHT_MCS_set {
|
|||
/** VHT Capabilities info field, reference 802.11ac D1.4 p89 */
|
||||
typedef MLAN_PACK_START struct _VHT_capa {
|
||||
#if 0
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
t_u8 mpdu_max_len:2;
|
||||
t_u8 chan_width:2;
|
||||
t_u8 rx_LDPC:1;
|
||||
t_u8 sgi_80:1;
|
||||
t_u8 sgi_160:1;
|
||||
t_u8 tx_STBC:1;
|
||||
t_u8 rx_STBC:3;
|
||||
t_u8 SU_beamformer_capa:1;
|
||||
t_u8 SU_beamformee_capa:1;
|
||||
t_u8 beamformer_ante_num:3;
|
||||
t_u8 sounding_dim_num:3;
|
||||
t_u8 MU_beamformer_capa:1;
|
||||
t_u8 MU_beamformee_capa:1;
|
||||
t_u8 VHT_TXOP_ps:1;
|
||||
t_u8 HTC_VHT_capa:1;
|
||||
t_u8 max_ampdu_len:3;
|
||||
t_u8 link_apapt_capa:2;
|
||||
t_u8 reserved_1:4;
|
||||
#else
|
||||
t_u8 reserved_1:4;
|
||||
t_u8 link_apapt_capa:2;
|
||||
t_u8 max_ampdu_len:3;
|
||||
|
@ -1054,6 +1215,7 @@ typedef MLAN_PACK_START struct _VHT_capa {
|
|||
t_u8 rx_LDPC:1;
|
||||
t_u8 chan_width:2;
|
||||
t_u8 mpdu_max_len:2;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
#endif
|
||||
t_u32 vht_cap_info;
|
||||
VHT_MCS_set_t mcs_sets;
|
||||
|
@ -1162,6 +1324,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_Extension_t {
|
|||
} MLAN_PACK_END IEEEtypes_Extension_t, *pIEEEtypes_Extension_t;
|
||||
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Max HE-MAC for 8 SS */
|
||||
t_u8 max_mcs_8ss : 2;
|
||||
/** Max HE-MAC for 7 SS */
|
||||
t_u8 max_mcs_7ss : 2;
|
||||
/** Max HE-MAC for 6 SS */
|
||||
t_u8 max_mcs_6ss : 2;
|
||||
/** Max HE-MAC for 5 SS */
|
||||
t_u8 max_mcs_5ss : 2;
|
||||
/** Max HE-MAC for 4 SS */
|
||||
t_u8 max_mcs_4ss : 2;
|
||||
/** Max HE-MAC for 3 SS */
|
||||
t_u8 max_mcs_3ss : 2;
|
||||
/** Max HE-MAC for 2 SS */
|
||||
t_u8 max_mcs_2ss : 2;
|
||||
/** Max HE-MAC for 1 SS */
|
||||
t_u8 max_mcs_1ss : 2;
|
||||
#else
|
||||
/** Max HE-MAC for 1 SS */
|
||||
t_u8 max_mcs_1ss : 2;
|
||||
/** Max HE-MAC for 2 SS */
|
||||
|
@ -1178,6 +1358,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t {
|
|||
t_u8 max_mcs_7ss : 2;
|
||||
/** Max HE-MAC for 8 SS */
|
||||
t_u8 max_mcs_8ss : 2;
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_HeMcsMap_t, *pIEEEtypes_HeMcsMap_t;
|
||||
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_HeMcsNss_t {
|
||||
|
@ -1204,6 +1385,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_HECap_t {
|
|||
} MLAN_PACK_END IEEEtypes_HECap_t, *pIEEEtypes_HECap_t;
|
||||
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Reserved, including 6G Operation Info Pressent (bit17) */
|
||||
t_u8 reserved : 6; /* bit 18-23 */
|
||||
/* 6g operation info present */
|
||||
t_u8 he_6g_op_info_present : 1; /* bit 17 */
|
||||
/** ER SU Disable */
|
||||
t_u8 er_su_disable : 1; /* bit 16 */
|
||||
/** Co-Hosted BSS */
|
||||
t_u16 co_located_bss : 1; /* bit 15 */
|
||||
/** VHT Operation Info Present */
|
||||
t_u16 vht_op_info_present : 1; /* bit 14 */
|
||||
/** TXOP Duration RTS Threshold */
|
||||
t_u16 txop_dur_rts_threshold : 10; /* bit 4-13 */
|
||||
/** TWT Required */
|
||||
t_u16 twt_req : 1; /* bit 3 */
|
||||
/** Default PE Duration */
|
||||
t_u16 default_pe_dur : 3; /* bit 0-2 */
|
||||
#else
|
||||
/** Default PE Duration */
|
||||
t_u16 default_pe_dur : 3; /* bit 0-2 */
|
||||
/** TWT Required */
|
||||
|
@ -1216,17 +1415,29 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t {
|
|||
t_u16 co_located_bss : 1; /* bit 15 */
|
||||
/** ER SU Disable */
|
||||
t_u8 er_su_disable : 1; /* bit 16 */
|
||||
/** Reserved, including 6G Operation Info Pressent (bit17) */
|
||||
t_u8 reserved : 7; /* bit 17-23 */
|
||||
/* 6g operation info present */
|
||||
t_u8 he_6g_op_info_present : 1; /* bit 17 */
|
||||
/** Reserved bit 18-23 */
|
||||
t_u8 reserved : 6; /* bit 18-23 */
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_HeOpParam_t;
|
||||
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_HeBssColorInfo_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** BSS Color Disabled */
|
||||
t_u8 bss_color_disabled : 1; /* bit 7 */
|
||||
/** Partial BSS Color */
|
||||
t_u8 partial_bss_color : 1; /* bit 6 */
|
||||
/** BSS Color */
|
||||
t_u8 bss_color : 6; /* bit 0-5 */
|
||||
#else
|
||||
/** BSS Color */
|
||||
t_u8 bss_color : 6; /* bit 0-5 */
|
||||
/** Partial BSS Color */
|
||||
t_u8 partial_bss_color : 1; /* bit 6 */
|
||||
/** BSS Color Disabled */
|
||||
t_u8 bss_color_disabled : 1; /* bit 7 */
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_HeBssColorInfo_t;
|
||||
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_HeOp_t {
|
||||
|
@ -1388,6 +1599,20 @@ typedef MLAN_PACK_START struct {
|
|||
*** @brief Map octet of the basic measurement report (7.3.2.22.1)
|
||||
**/
|
||||
typedef MLAN_PACK_START struct {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/**< Reserved */
|
||||
t_u8 rsvd5_7 : 3;
|
||||
/**< Channel is unmeasured */
|
||||
t_u8 unmeasured : 1;
|
||||
/**< Radar detected on channel */
|
||||
t_u8 radar : 1;
|
||||
/**< Unidentified signal found on channel */
|
||||
t_u8 unidentified_sig : 1;
|
||||
/**< OFDM preamble detected on channel */
|
||||
t_u8 ofdm_preamble : 1;
|
||||
/**< At least one valid MPDU received on channel */
|
||||
t_u8 bss : 1;
|
||||
#else
|
||||
/**< At least one valid MPDU received on channel */
|
||||
t_u8 bss : 1;
|
||||
/**< OFDM preamble detected on channel */
|
||||
|
@ -1400,6 +1625,7 @@ typedef MLAN_PACK_START struct {
|
|||
t_u8 unmeasured : 1;
|
||||
/**< Reserved */
|
||||
t_u8 rsvd5_7 : 3;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
|
||||
} MLAN_PACK_END MeasRptBasicMap_t;
|
||||
|
||||
|
@ -1542,8 +1768,8 @@ typedef MLAN_PACK_START struct _wlan_user_scan_chan {
|
|||
t_u8 radio_type;
|
||||
/** Scan type: Active = 1, Passive = 2 */
|
||||
t_u8 scan_type;
|
||||
/** Reserved */
|
||||
t_u8 reserved;
|
||||
/** rnr_flag */
|
||||
t_u8 rnr_flag;
|
||||
/** Scan duration in milliseconds; if 0 default used */
|
||||
t_u32 scan_time;
|
||||
} MLAN_PACK_END wlan_user_scan_chan;
|
||||
|
@ -1635,6 +1861,8 @@ typedef MLAN_PACK_START struct {
|
|||
t_u8 bssid_num;
|
||||
/** BSSID filter list used in the to limit the scan results */
|
||||
mlan_802_11_mac_addr bssid_list[MAX_BSSID_FILTER_LIST];
|
||||
/** use scan setting from scan_cfg only */
|
||||
t_u8 scan_cfg_only;
|
||||
} MLAN_PACK_END wlan_user_scan_cfg;
|
||||
|
||||
/** Default scan interval in millisecond*/
|
||||
|
@ -1656,9 +1884,15 @@ 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
|
||||
/** Maximum number of channels that can be sent in bg scan config */
|
||||
|
||||
#define CHAN_MAX_6G 0
|
||||
|
||||
/** max bgscan chan number */
|
||||
#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 {
|
||||
|
@ -1725,7 +1959,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_BG_SCAN_CHAN_MAX];
|
||||
wlan_user_scan_chan chan_list[WLAN_USER_SCAN_CHAN_MAX];
|
||||
/** scan channel gap */
|
||||
t_u16 scan_chan_gap;
|
||||
/** Enable EES configuration */
|
||||
|
@ -1758,6 +1992,11 @@ 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
|
||||
|
@ -1772,6 +2011,15 @@ 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;
|
||||
|
||||
|
|
|
@ -45,9 +45,6 @@ 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"
|
||||
|
||||
/********************************************************
|
||||
|
@ -317,6 +314,20 @@ 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 */
|
||||
|
@ -596,7 +607,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, 0, sizeof(priv->rx_seq));
|
||||
memset(pmadapter, priv->rx_seq, 0xff, sizeof(priv->rx_seq));
|
||||
priv->port_ctrl_mode = MTRUE;
|
||||
priv->port_open = MFALSE;
|
||||
priv->prior_port_status = MFALSE;
|
||||
|
@ -604,6 +615,7 @@ 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)) {
|
||||
|
@ -614,12 +626,10 @@ 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;
|
||||
|
@ -808,9 +818,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 =
|
||||
|
@ -823,6 +833,9 @@ 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;
|
||||
|
@ -842,7 +855,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->tx_data_ep;
|
||||
pmadapter->usb_tx_ports[i];
|
||||
pmadapter->pcard_usb->usb_tx_aggr[i].phandle =
|
||||
(t_void *)pmadapter;
|
||||
}
|
||||
|
@ -864,7 +877,12 @@ 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;
|
||||
pmadapter->hs_cfg.gap = HOST_SLEEP_DEF_GAP;
|
||||
#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_activated = MFALSE;
|
||||
pmadapter->min_wake_holdoff = HOST_SLEEP_DEF_WAKE_HOLDOFF;
|
||||
pmadapter->hs_inactivity_timeout = HOST_SLEEP_DEF_INACTIVITY_TIMEOUT;
|
||||
|
@ -933,6 +951,9 @@ 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;
|
||||
|
@ -946,12 +967,15 @@ 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;
|
||||
pmadapter->pcard_pcie->txbd_rdptr = 0;
|
||||
pmadapter->pcard_pcie->rxbd_rdptr = 0;
|
||||
pmadapter->pcard_pcie->evtbd_rdptr = 0;
|
||||
pmadapter->pcard_pcie->txbd_pending = 0;
|
||||
#if defined(PCIE8997) || defined(PCIE8897)
|
||||
if (!pmadapter->pcard_pcie->reg->use_adma) {
|
||||
pmadapter->pcard_pcie->rxbd_wrptr =
|
||||
|
@ -961,11 +985,13 @@ t_void wlan_init_adapter(pmlan_adapter pmadapter)
|
|||
EVT_RW_PTR_ROLLOVER_IND;
|
||||
}
|
||||
#endif
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
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;
|
||||
pmadapter->pcard_pcie->last_write_index_with_irq =
|
||||
0xffffffff;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1125,6 +1151,33 @@ 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++) {
|
||||
|
@ -1206,6 +1259,20 @@ 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++) {
|
||||
|
@ -1470,6 +1537,7 @@ done:
|
|||
static void wlan_update_hw_spec(pmlan_adapter pmadapter)
|
||||
{
|
||||
t_u32 i;
|
||||
MrvlIEtypes_He_cap_t *user_he_cap_tlv = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
@ -1582,6 +1650,28 @@ static void wlan_update_hw_spec(pmlan_adapter pmadapter)
|
|||
pmadapter->hw_he_cap,
|
||||
pmadapter->hw_hecap_len,
|
||||
sizeof(pmadapter->priv[i]->user_he_cap));
|
||||
user_he_cap_tlv =
|
||||
(MrvlIEtypes_He_cap_t *)&pmadapter
|
||||
->priv[i]
|
||||
->user_2g_he_cap;
|
||||
if (pmadapter->priv[i]->bss_role ==
|
||||
MLAN_BSS_ROLE_STA)
|
||||
user_he_cap_tlv->he_mac_cap[0] &=
|
||||
~HE_MAC_CAP_TWT_RESP_SUPPORT;
|
||||
else
|
||||
user_he_cap_tlv->he_mac_cap[0] &=
|
||||
~HE_MAC_CAP_TWT_REQ_SUPPORT;
|
||||
user_he_cap_tlv =
|
||||
(MrvlIEtypes_He_cap_t *)&pmadapter
|
||||
->priv[i]
|
||||
->user_he_cap;
|
||||
if (pmadapter->priv[i]->bss_role ==
|
||||
MLAN_BSS_ROLE_STA)
|
||||
user_he_cap_tlv->he_mac_cap[0] &=
|
||||
~HE_MAC_CAP_TWT_RESP_SUPPORT;
|
||||
else
|
||||
user_he_cap_tlv->he_mac_cap[0] &=
|
||||
~HE_MAC_CAP_TWT_REQ_SUPPORT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1734,6 +1824,15 @@ 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,
|
||||
|
@ -1842,10 +1941,6 @@ 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();
|
||||
}
|
||||
|
@ -2026,11 +2121,16 @@ 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);
|
||||
|
|
|
@ -104,9 +104,22 @@ typedef MLAN_PACK_START struct _FWSyncPkt {
|
|||
t_u32 fw_ready;
|
||||
} MLAN_PACK_END FWSyncPkt;
|
||||
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Convert sequence number and command fields
|
||||
* of fwheader to correct endian format
|
||||
*/
|
||||
#define endian_convert_syncfwheader(x) \
|
||||
{ \
|
||||
(x)->cmd = wlan_le32_to_cpu((x)->cmd); \
|
||||
(x)->seq_num = wlan_le32_to_cpu((x)->seq_num); \
|
||||
(x)->status = wlan_le32_to_cpu((x)->status); \
|
||||
(x)->offset = wlan_le32_to_cpu((x)->offset); \
|
||||
}
|
||||
#else
|
||||
/** Convert sequence number and command fields
|
||||
* of fwheader to correct endian format
|
||||
*/
|
||||
#define endian_convert_syncfwheader(x)
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
|
||||
#endif /* _MLAN_INIT_H_ */
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -7,7 +7,7 @@
|
|||
* to the firmware.
|
||||
*
|
||||
*
|
||||
* Copyright 2008-2021 NXP
|
||||
* Copyright 2008-2023 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -39,9 +39,6 @@ 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
|
||||
********************************************************/
|
||||
|
@ -282,7 +279,7 @@ static mlan_status wlan_get_common_rates(mlan_private *pmpriv, t_u8 *rate1,
|
|||
ENTER();
|
||||
|
||||
ret = pcb->moal_malloc(pmpriv->adapter->pmoal_handle, rate1_size,
|
||||
MLAN_MEM_DEF, &tmp);
|
||||
MLAN_MEM_DEF | MLAN_MEM_FLAG_ATOMIC, &tmp);
|
||||
if (ret != MLAN_STATUS_SUCCESS || !tmp) {
|
||||
PRINTM(MERROR, "Failed to allocate buffer\n");
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
|
@ -309,12 +306,13 @@ 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 (*ptr) {
|
||||
while (rate1_size && *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 "
|
||||
|
@ -351,7 +349,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];
|
||||
t_u8 card_rates[WLAN_SUPPORTED_RATES] = {0};
|
||||
t_u32 card_rates_size = 0;
|
||||
ENTER();
|
||||
/* Copy AP supported rates */
|
||||
|
@ -550,33 +548,53 @@ 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)
|
||||
static t_u16 wlan_get_rsn_cap(t_u8 *data, t_u8 len)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@ -598,10 +616,12 @@ 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);
|
||||
sta_rsn_cap =
|
||||
wlan_get_rsn_cap(pmpriv->wpa_ie + 2, *(pmpriv->wpa_ie + 1));
|
||||
if (!pbss_desc->prsn_ie)
|
||||
return 0;
|
||||
ap_rsn_cap = wlan_get_rsn_cap(pbss_desc->prsn_ie->data);
|
||||
ap_rsn_cap = wlan_get_rsn_cap(pbss_desc->prsn_ie->data,
|
||||
pbss_desc->prsn_ie->ieee_hdr.len);
|
||||
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));
|
||||
|
@ -625,23 +645,65 @@ 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)
|
||||
MrvlIEtypes_RsnParamSet_t *ptlv_rsn_ie,
|
||||
t_u16 *rsn_ie_len, t_u8 *akm_type)
|
||||
{
|
||||
t_u16 *prsn_cap;
|
||||
t_u16 *ptr;
|
||||
t_u16 *akm_suite_count_ptr;
|
||||
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 pmf_mask = 0x00;
|
||||
t_u8 *temp;
|
||||
t_u16 pairwise_cipher_count = 0;
|
||||
t_u16 akm_suite_count = 0;
|
||||
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};
|
||||
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};
|
||||
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));
|
||||
|
@ -650,99 +712,205 @@ 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
|
||||
*/
|
||||
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;
|
||||
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)) {
|
||||
break;
|
||||
}
|
||||
} else if (!memcmp(pmadapter, temp, sha_256_oui,
|
||||
AKM_SUITE_LEN)) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
temp += AKM_SUITE_LEN;
|
||||
temp_akm_suite_count--;
|
||||
ptr += AKM_SUITE_LEN;
|
||||
}
|
||||
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 (i == akm_suite_count) {
|
||||
akm_type_selected = 0; // not found
|
||||
} else {
|
||||
akm_type_selected = akm_preference[ptr[3]];
|
||||
akm_type_id = ptr[3];
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
ap_mfpc = ((*prsn_cap & (0x1 << MFPC_BIT)) == (0x1 << MFPC_BIT));
|
||||
ap_mfpr = ((*prsn_cap & (0x1 << MFPR_BIT)) == (0x1 << MFPR_BIT));
|
||||
|
||||
/* Check for negative case
|
||||
* If WPA3SAE AP has PMF=0, block the association */
|
||||
if ((*akm_type == AssocAgentAuth_Wpa3Sae) && (!ap_mfpc && !ap_mfpr)) {
|
||||
PRINTM(MERROR,
|
||||
"RSNE: WPA3-SAE AP with incorrect PMF setting, can't associate to AP\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
if ((!ap_mfpc && !ap_mfpr && pmpriv->pmfcfg.mfpr) ||
|
||||
((!ap_mfpc) && ap_mfpr) ||
|
||||
(ap_mfpc && ap_mfpr && (!pmpriv->pmfcfg.mfpc))) {
|
||||
PRINTM(MERROR,
|
||||
"Mismatch in PMF config of STA and AP, can't associate to AP\n");
|
||||
"RSNE: Mismatch in PMF config of STA and AP, can't associate to AP\n");
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
if ((pmpriv->pmfcfg.mfpr && pmpriv->pmfcfg.mfpc) ||
|
||||
pmpriv->pmfcfg.mfpc) {
|
||||
*prsn_cap |= PMF_MASK;
|
||||
*prsn_cap &= pmf_mask;
|
||||
}
|
||||
*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;
|
||||
}
|
||||
|
||||
|
@ -871,21 +1039,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();
|
||||
|
||||
|
@ -896,6 +1064,9 @@ 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;
|
||||
|
@ -960,7 +1131,8 @@ 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)) {
|
||||
if ((pmpriv->sec_info.authentication_mode != MLAN_AUTH_MODE_AUTO) ||
|
||||
(pbss_desc->owe_transition_mode == OWE_TRANS_MODE_OWE)) {
|
||||
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);
|
||||
|
@ -977,9 +1149,16 @@ 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(MLAN_AUTH_MODE_OPEN);
|
||||
wlan_cpu_to_le16(AssocAgentAuth_Open);
|
||||
pos += sizeof(pauth_tlv->header) + pauth_tlv->header.len;
|
||||
pauth_tlv->header.len = wlan_cpu_to_le16(pauth_tlv->header.len);
|
||||
}
|
||||
|
@ -996,8 +1175,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 =
|
||||
sizeof(psae_pwe_mode_tlv->pwe);
|
||||
psae_pwe_mode_tlv->header.len = wlan_cpu_to_le16(
|
||||
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) +
|
||||
|
@ -1028,7 +1207,6 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
|
|||
|
||||
pchan_tlv->chan_scan_param[0].bandcfg.chanBand =
|
||||
wlan_band_to_radio_type(pbss_desc->bss_band);
|
||||
|
||||
PRINTM(MINFO, "Assoc: TLV Bandcfg = %x\n",
|
||||
pchan_tlv->chan_scan_param[0].bandcfg);
|
||||
pos += sizeof(pchan_tlv->header) + sizeof(ChanScanParamSet_t);
|
||||
|
@ -1083,21 +1261,13 @@ 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;
|
||||
}
|
||||
#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) {
|
||||
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)) {
|
||||
prsn_ie_tlv = (MrvlIEtypes_RsnParamSet_t *)pos;
|
||||
if (pbss_desc->pwpa_ie) {
|
||||
prsn_ie_tlv->header.type =
|
||||
|
@ -1156,8 +1326,16 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
|
|||
.data[0]),
|
||||
prsn_ie_tlv->header.len,
|
||||
prsn_ie_tlv->header.len);
|
||||
ret = wlan_update_rsn_ie(pmpriv,
|
||||
prsn_ie_tlv);
|
||||
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);
|
||||
if (ret != MLAN_STATUS_SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
|
@ -1174,6 +1352,58 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1209,8 +1439,14 @@ mlan_status wlan_cmd_802_11_associate(mlan_private *pmpriv,
|
|||
wlan_11ax_bandconfig_allowed(pmpriv, pbss_desc))
|
||||
wlan_cmd_append_11ax_tlv(pmpriv, pbss_desc, &pos);
|
||||
|
||||
wlan_wmm_process_association_req(pmpriv, &pos, &pbss_desc->wmm_ie,
|
||||
pbss_desc->pht_cap);
|
||||
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);
|
||||
if (pmpriv->sec_info.wapi_enabled && pmpriv->wapi_ie_len)
|
||||
wlan_cmd_append_wapi_ie(pmpriv, &pos);
|
||||
|
||||
|
@ -1228,18 +1464,20 @@ 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 =
|
||||
wlan_cpu_to_le16(sizeof(host_mlme_tlv->host_mlme));
|
||||
host_mlme_tlv->header.len = 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 = MLAN_MAC_ADDR_LENGTH;
|
||||
prev_bssid_tlv->header.len =
|
||||
wlan_cpu_to_le16(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);
|
||||
|
@ -1248,6 +1486,18 @@ 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;
|
||||
|
@ -1277,6 +1527,9 @@ 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);
|
||||
|
@ -1382,21 +1635,22 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
|
|||
assoc_logger_data *assoc_succ;
|
||||
mlan_ds_bss *bss;
|
||||
IEEEtypes_MgmtHdr_t *hdr;
|
||||
t_u16 sub_type = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (pmpriv->curr_bss_params.host_mlme) {
|
||||
hdr = (IEEEtypes_MgmtHdr_t *)&resp->params;
|
||||
if (!memcmp(pmpriv->adapter, hdr->BssId,
|
||||
pmpriv->pattempted_bss_desc->mac_address,
|
||||
MLAN_MAC_ADDR_LENGTH))
|
||||
passoc_rsp = (IEEEtypes_AssocRsp_t
|
||||
*)((t_u8 *)(&resp->params) +
|
||||
hdr = (IEEEtypes_MgmtHdr_t *)&resp->params;
|
||||
sub_type = IEEE80211_GET_FC_MGMT_FRAME_SUBTYPE(hdr->FrmCtl);
|
||||
if (!memcmp(pmpriv->adapter, hdr->BssId,
|
||||
pmpriv->pattempted_bss_desc->mac_address,
|
||||
MLAN_MAC_ADDR_LENGTH) &&
|
||||
((sub_type == SUBTYPE_ASSOC_RESP) ||
|
||||
(sub_type == SUBTYPE_REASSOC_RESP))) {
|
||||
passoc_rsp =
|
||||
(IEEEtypes_AssocRsp_t *)((t_u8 *)(&resp->params) +
|
||||
sizeof(IEEEtypes_MgmtHdr_t));
|
||||
else
|
||||
passoc_rsp = (IEEEtypes_AssocRsp_t *)&resp->params;
|
||||
pmpriv->curr_bss_params.host_mlme = MTRUE;
|
||||
} else
|
||||
|
||||
passoc_rsp = (IEEEtypes_AssocRsp_t *)&resp->params;
|
||||
passoc_rsp->status_code = wlan_le16_to_cpu(passoc_rsp->status_code);
|
||||
if (pmpriv->media_connected == MTRUE)
|
||||
|
@ -1429,11 +1683,19 @@ 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
|
||||
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);
|
||||
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++;
|
||||
|
@ -1460,6 +1722,7 @@ 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;
|
||||
|
@ -1480,7 +1743,7 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
|
|||
pmpriv->curr_bss_params.bss_descriptor.channel =
|
||||
pbss_desc->phy_param_set.ds_param_set.current_chan;
|
||||
|
||||
pmpriv->curr_bss_params.band = (t_u8)pbss_desc->bss_band;
|
||||
pmpriv->curr_bss_params.band = pbss_desc->bss_band;
|
||||
|
||||
/* Store current channel for further reference.
|
||||
* This would save one extra call to get current
|
||||
|
@ -1489,7 +1752,7 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
|
|||
pmpriv->adapter->dfsr_channel =
|
||||
pmpriv->curr_bss_params.bss_descriptor.channel;
|
||||
|
||||
/*
|
||||
/*`
|
||||
* Adjust the timestamps in the scan table to be relative to the newly
|
||||
* associated AP's TSF
|
||||
*/
|
||||
|
@ -1500,10 +1763,7 @@ mlan_status wlan_ret_802_11_associate(mlan_private *pmpriv,
|
|||
else
|
||||
pmpriv->curr_bss_params.wmm_enabled = MFALSE;
|
||||
|
||||
if ((pmpriv->wmm_required ||
|
||||
(pbss_desc->pht_cap &&
|
||||
(pbss_desc->pht_cap->ieee_hdr.element_id == HT_CAPABILITY))) &&
|
||||
pmpriv->curr_bss_params.wmm_enabled)
|
||||
if (pmpriv->wmm_required && pmpriv->curr_bss_params.wmm_enabled)
|
||||
pmpriv->wmm_enabled = MTRUE;
|
||||
else
|
||||
pmpriv->wmm_enabled = MFALSE;
|
||||
|
@ -1595,18 +1855,16 @@ 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
|
||||
#ifdef DRV_EMBEDDED_SUPPLICANT
|
||||
&& !supplicantIsEnabled(pmpriv->psapriv)
|
||||
#endif
|
||||
) {
|
||||
!pmpriv->wps.session_enable && !pmpriv->sec_info.osen_enabled) {
|
||||
/* We are in Open/WEP mode, open port immediately */
|
||||
if (pmpriv->port_ctrl_mode == MTRUE) {
|
||||
pmpriv->port_open = MTRUE;
|
||||
|
@ -1615,22 +1873,9 @@ 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
|
||||
#ifdef DRV_EMBEDDED_SUPPLICANT
|
||||
|| (supplicantIsEnabled(pmpriv->psapriv))
|
||||
#endif
|
||||
)
|
||||
pmpriv->wps.session_enable || pmpriv->sec_info.osen_enabled)
|
||||
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;
|
||||
|
@ -1667,7 +1912,6 @@ done:
|
|||
pioctl_req->status_code = MLAN_ERROR_NO_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
@ -1950,6 +2194,19 @@ mlan_status wlan_cmd_802_11_ad_hoc_start(mlan_private *pmpriv,
|
|||
wlan_cpu_to_le16(prsn_ie_tlv->header.len);
|
||||
}
|
||||
|
||||
if (pmpriv->curr_bss_params.host_mlme) {
|
||||
MrvlIEtypes_HostMlme_t *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->host_mlme = MTRUE;
|
||||
pos += sizeof(host_mlme_tlv->header) +
|
||||
host_mlme_tlv->header.len;
|
||||
cmd_append_size += sizeof(MrvlIEtypes_HostMlme_t);
|
||||
host_mlme_tlv->header.len =
|
||||
wlan_cpu_to_le16(host_mlme_tlv->header.len);
|
||||
}
|
||||
cmd->size = (t_u16)wlan_cpu_to_le16(
|
||||
(t_u16)(sizeof(HostCmd_DS_802_11_AD_HOC_START) + S_DS_GEN +
|
||||
cmd_append_size));
|
||||
|
@ -1997,6 +2254,7 @@ mlan_status wlan_cmd_802_11_ad_hoc_join(mlan_private *pmpriv,
|
|||
t_u32 i, rates_size = 0;
|
||||
t_u32 curr_pkt_filter;
|
||||
t_u8 *pos = (t_u8 *)padhoc_join + sizeof(HostCmd_DS_802_11_AD_HOC_JOIN);
|
||||
t_s32 append_size_11h = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
@ -2089,7 +2347,7 @@ mlan_status wlan_cmd_802_11_ad_hoc_join(mlan_private *pmpriv,
|
|||
|
||||
/* Copy the channel information */
|
||||
pmpriv->curr_bss_params.bss_descriptor.channel = pbss_desc->channel;
|
||||
pmpriv->curr_bss_params.band = (t_u8)pbss_desc->bss_band;
|
||||
pmpriv->curr_bss_params.band = pbss_desc->bss_band;
|
||||
|
||||
if (pmpriv->sec_info.wep_status == Wlan802_11WEPEnabled ||
|
||||
pmpriv->sec_info.wpa_enabled || pmpriv->sec_info.ewpa_enabled)
|
||||
|
@ -2135,10 +2393,17 @@ mlan_status wlan_cmd_802_11_ad_hoc_join(mlan_private *pmpriv,
|
|||
* adhoc/infra 11h behavior can be properly triggered.
|
||||
* pos modified if data is appended
|
||||
*/
|
||||
cmd_append_size += wlan_11h_process_join(
|
||||
pmpriv, &pos, &padhoc_join->bss_descriptor.cap,
|
||||
(t_u8)pbss_desc->bss_band, pbss_desc->channel,
|
||||
&pbss_desc->wlan_11h_bss_info);
|
||||
append_size_11h +=
|
||||
wlan_11h_process_join(pmpriv, &pos,
|
||||
&padhoc_join->bss_descriptor.cap,
|
||||
pbss_desc->bss_band, pbss_desc->channel,
|
||||
&pbss_desc->wlan_11h_bss_info);
|
||||
if (append_size_11h >= 0)
|
||||
cmd_append_size += append_size_11h;
|
||||
else {
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (pmpriv->sec_info.wpa_enabled) {
|
||||
prsn_ie_tlv = (MrvlIEtypes_RsnParamSet_t *)pos;
|
||||
|
@ -2237,6 +2502,20 @@ mlan_status wlan_cmd_802_11_ad_hoc_join(mlan_private *pmpriv,
|
|||
}
|
||||
}
|
||||
|
||||
if (pmpriv->curr_bss_params.host_mlme) {
|
||||
MrvlIEtypes_HostMlme_t *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->host_mlme = MTRUE;
|
||||
pos += sizeof(host_mlme_tlv->header) +
|
||||
host_mlme_tlv->header.len;
|
||||
cmd_append_size += sizeof(MrvlIEtypes_HostMlme_t);
|
||||
host_mlme_tlv->header.len =
|
||||
wlan_cpu_to_le16(host_mlme_tlv->header.len);
|
||||
}
|
||||
|
||||
cmd->size = (t_u16)wlan_cpu_to_le16(
|
||||
(t_u16)(sizeof(HostCmd_DS_802_11_AD_HOC_JOIN) + S_DS_GEN +
|
||||
cmd_append_size));
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* in MLAN module.
|
||||
*
|
||||
*
|
||||
* Copyright 2008-2022 NXP
|
||||
* Copyright 2008-2023 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -308,6 +308,56 @@ 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 */
|
||||
|
@ -341,6 +391,7 @@ extern t_u32 mlan_drvdbg;
|
|||
#define endian_convert_RxPD_extra_header(x) \
|
||||
do { \
|
||||
} while (0)
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
|
||||
/** Global moal_assert_callback */
|
||||
extern t_void (*assert_callback)(t_void *pmoal_handle, t_u32 cond);
|
||||
|
@ -507,19 +558,11 @@ 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)
|
||||
defined(SDIW624) || defined(SD8978) || defined(SD9177)
|
||||
#define MAX_MP_REGS 196
|
||||
#else
|
||||
/* upto 0xB7 */
|
||||
|
@ -561,10 +604,14 @@ 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 */
|
||||
|
@ -620,6 +667,12 @@ 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 */
|
||||
|
@ -654,11 +707,6 @@ 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;
|
||||
|
||||
|
@ -692,7 +740,9 @@ typedef struct _txAggr_t {
|
|||
typedef enum _baStatus_e {
|
||||
BA_STREAM_NOT_SETUP = 0,
|
||||
BA_STREAM_SETUP_INPROGRESS,
|
||||
BA_STREAM_SETUP_COMPLETE
|
||||
BA_STREAM_SETUP_SENT_ADDBA,
|
||||
BA_STREAM_SETUP_COMPLETE,
|
||||
BA_STREAM_SENT_DELBA,
|
||||
} baStatus_e;
|
||||
|
||||
/** RA list table */
|
||||
|
@ -820,7 +870,10 @@ 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;
|
||||
|
||||
|
@ -1147,6 +1200,8 @@ typedef struct _mlan_private {
|
|||
t_bool uap_host_based;
|
||||
/**UAP operating channel*/
|
||||
t_u8 uap_channel;
|
||||
/**UAP bandwidth*/
|
||||
t_u8 uap_bandwidth;
|
||||
/** state variable for UAP Get Info callback */
|
||||
wlan_uap_get_info_cb_t uap_state_chan_cb;
|
||||
#endif /* UAP_SUPPORT */
|
||||
|
@ -1282,6 +1337,7 @@ 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;
|
||||
|
@ -1291,12 +1347,11 @@ 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*/
|
||||
|
@ -1307,6 +1362,12 @@ typedef struct _mlan_private {
|
|||
t_u32 amsdu_tx_cnt;
|
||||
/** tx msdu count in amsdu*/
|
||||
t_u32 msdu_in_tx_amsdu_cnt;
|
||||
/** channel load info for current channel */
|
||||
t_u16 ch_load_param;
|
||||
/** Noise floor value for current channel */
|
||||
t_s16 noise;
|
||||
/** rx quality info */
|
||||
t_u16 rx_quality;
|
||||
} mlan_private, *pmlan_private;
|
||||
|
||||
typedef struct _assoc_logger {
|
||||
|
@ -1347,6 +1408,14 @@ 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 */
|
||||
|
@ -1378,6 +1447,8 @@ struct _RxReorderTbl {
|
|||
t_u8 pkt_count;
|
||||
/** flush data flag */
|
||||
t_u8 flush_data;
|
||||
/** BA window bitmap */
|
||||
t_u64 bitmap;
|
||||
};
|
||||
|
||||
/** BSS priority node */
|
||||
|
@ -1519,10 +1590,9 @@ 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 */
|
||||
|
@ -1589,6 +1659,8 @@ typedef struct {
|
|||
t_bool dfs_radar_found;
|
||||
/** Channel radar is being checked on. BAND_A is assumed. */
|
||||
t_u8 dfs_check_channel;
|
||||
/** Channel radar is being checked on bandwidth*/
|
||||
t_u8 dfs_check_bandwidth;
|
||||
/** point to the priv which start the DFS check */
|
||||
t_void *dfs_check_priv;
|
||||
/** Timestamp when we got last report,
|
||||
|
@ -1757,7 +1829,7 @@ typedef struct _usb_rx_deaggr_params {
|
|||
usb_aggr_ctrl_cfg aggr_ctrl;
|
||||
} usb_rx_deaggr_params;
|
||||
|
||||
#define MAX_USB_TX_PORT_NUM 1
|
||||
#define MAX_USB_TX_PORT_NUM 2
|
||||
/** data structure for USB Tx Aggregation */
|
||||
typedef struct _usb_tx_aggr_params {
|
||||
/** Tx aggregation control */
|
||||
|
@ -1799,7 +1871,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;
|
||||
|
@ -1860,17 +1932,22 @@ 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
|
||||
|
@ -2028,10 +2105,6 @@ 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
|
||||
|
||||
|
@ -2099,7 +2172,12 @@ 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 */
|
||||
|
@ -2118,6 +2196,8 @@ typedef struct _mlan_pcie_card {
|
|||
t_u32 pcie_int_mode;
|
||||
/** PCIE function number */
|
||||
t_u8 func_num;
|
||||
/** rx interrupt pending */
|
||||
t_u8 rx_pending;
|
||||
/** pending num of tx ring buffer in firmware */
|
||||
t_u8 txbd_pending;
|
||||
/** Write pointer for TXBD ring */
|
||||
|
@ -2181,8 +2261,11 @@ typedef struct _mlan_pcie_card {
|
|||
mlan_buffer *cmdrsp_buf;
|
||||
/** Command buffer */
|
||||
mlan_buffer *vdll_cmd_buf;
|
||||
/** last write index where we have tx_done interrupt enabled */
|
||||
t_u32 last_write_index_with_irq;
|
||||
/** last tx_pkt_size */
|
||||
t_u32 last_tx_pkt_size[MLAN_MAX_TXRX_BD];
|
||||
|
||||
} mlan_pcie_card, *pmlan_pcie_card;
|
||||
#endif
|
||||
|
||||
|
@ -2195,6 +2278,8 @@ 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
|
||||
|
@ -2212,6 +2297,7 @@ 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;
|
||||
|
@ -2223,7 +2309,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);
|
||||
mlan_status (*process_int_status)(pmlan_adapter pmadapter, t_u8 type);
|
||||
/**host to card handler*/
|
||||
mlan_status (*host_to_card)(pmlan_private pmpriv, t_u8 type,
|
||||
mlan_buffer *pmbuf,
|
||||
|
@ -2255,7 +2341,7 @@ typedef struct _adapter_operations {
|
|||
} mlan_adapter_operations;
|
||||
|
||||
/** Adapter data structure for MLAN */
|
||||
typedef struct _mlan_adapter {
|
||||
struct _mlan_adapter {
|
||||
/** MOAL handle structure */
|
||||
t_void *pmoal_handle;
|
||||
/** BSS Attributes */
|
||||
|
@ -2274,6 +2360,26 @@ typedef 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;
|
||||
/** PCIe rx process */
|
||||
t_u8 pcie_rx_processing;
|
||||
/** PCIe event process */
|
||||
t_u8 pcie_event_processing;
|
||||
/** PCIe tx process */
|
||||
t_u8 pcie_tx_processing;
|
||||
/** pcie cmd_dnld_int flag */
|
||||
t_u8 pcie_cmd_dnld_int;
|
||||
/** more_tx_task_flag */
|
||||
t_u32 more_tx_task_flag;
|
||||
/** 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 */
|
||||
|
@ -2292,6 +2398,10 @@ typedef 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 */
|
||||
|
@ -2338,7 +2448,7 @@ typedef struct _mlan_adapter {
|
|||
t_u32 fw_cap_ext;
|
||||
#if defined(PCIE9098) || defined(SD9098) || defined(USB9098) || \
|
||||
defined(PCIE9097) || defined(SD9097) || defined(USB9097) || \
|
||||
defined(SDNW62X) || defined(PCIENW62X) || defined(USBNW62X)
|
||||
defined(SDIW624) || defined(PCIEIW624) || defined(USBIW624)
|
||||
/** High byte for 5G, low byte for 2G, like 0x2211 0x22 for 5G, 0x11 for
|
||||
* 2G */
|
||||
t_u16 user_htstream;
|
||||
|
@ -2439,6 +2549,8 @@ typedef struct _mlan_adapter {
|
|||
pmlan_private pending_disconnect_priv;
|
||||
/** mlan_processing */
|
||||
t_u32 scan_processing;
|
||||
/** scan state */
|
||||
t_u32 scan_state;
|
||||
/** firmware support for roaming*/
|
||||
t_u8 fw_roaming;
|
||||
/** User set passphrase*/
|
||||
|
@ -2494,6 +2606,8 @@ typedef struct _mlan_adapter {
|
|||
wlan_dfs_testing_settings_t dfs_test_params;
|
||||
/** dfs w53 cfg */
|
||||
t_u8 dfs53cfg;
|
||||
/** dfs_mode */
|
||||
t_u8 dfs_mode;
|
||||
/** FSM variable for MEAS support */
|
||||
wlan_meas_state_t state_meas;
|
||||
/** Scan table */
|
||||
|
@ -2508,6 +2622,9 @@ typedef 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 */
|
||||
|
@ -2566,6 +2683,14 @@ typedef 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;
|
||||
|
@ -2632,6 +2757,8 @@ typedef struct _mlan_adapter {
|
|||
t_u8 wakeup_fw_timer_is_set;
|
||||
/** Number of wake up timeouts */
|
||||
t_u32 pm_wakeup_timeout;
|
||||
/** Card wakeup flag */
|
||||
t_u8 pm_wakeup_flag;
|
||||
|
||||
/** Host Sleep configured flag */
|
||||
t_u8 is_hs_configured;
|
||||
|
@ -2647,6 +2774,8 @@ typedef 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;
|
||||
|
@ -2741,6 +2870,7 @@ typedef 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;
|
||||
|
@ -2761,15 +2891,26 @@ typedef 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;
|
||||
} mlan_adapter, *pmlan_adapter;
|
||||
/** 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;
|
||||
};
|
||||
|
||||
/** Check if stream 2X2 enabled */
|
||||
#define IS_STREAM_2X2(x) ((x)&FEATURE_CTRL_STREAM_2X2)
|
||||
|
@ -2788,6 +2929,19 @@ typedef 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);
|
||||
|
||||
|
@ -2862,6 +3016,21 @@ static inline t_u8 wlan_is_tx_pending(mlan_adapter *pmadapter)
|
|||
return MFALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief check if Rx pending
|
||||
*
|
||||
* @param pmadapter Pointer to mlan_adapter
|
||||
* @return MTRUE/MFALSE;
|
||||
*/
|
||||
static inline t_u8 wlan_is_rx_pending(mlan_adapter *pmadapter)
|
||||
{
|
||||
#ifdef PCIE
|
||||
if (IS_PCIE(pmadapter->card_type) && pmadapter->pcard_pcie->rx_pending)
|
||||
return MTRUE;
|
||||
#endif
|
||||
return MFALSE;
|
||||
}
|
||||
|
||||
/** process host cmd */
|
||||
mlan_status wlan_misc_ioctl_host_cmd(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
@ -2872,7 +3041,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,
|
||||
|
@ -3042,11 +3211,17 @@ t_void wlan_process_bypass_tx(mlan_adapter *pmadapter);
|
|||
t_void wlan_cleanup_bypass_txq(pmlan_private priv);
|
||||
t_u8 wlan_bypass_tx_list_empty(mlan_adapter *pmadapter);
|
||||
|
||||
mlan_status wlan_misc_ioctl_tx_frame(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
mlan_status wlan_cmd_tx_frame(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action, t_void *pdata_buf);
|
||||
|
||||
/** Check if this is the last packet */
|
||||
t_u8 wlan_check_last_packet_indication(pmlan_private priv);
|
||||
|
||||
#define MOAL_ALLOC_MLAN_BUFFER (0)
|
||||
#define MOAL_MALLOC_BUFFER (1)
|
||||
#define MOAL_ALLOC_MLAN_BUFFER MBIT(0)
|
||||
#define MOAL_MALLOC_BUFFER MBIT(1)
|
||||
#define MOAL_MEM_FLAG_ATOMIC MBIT(2)
|
||||
|
||||
#ifdef PCIE
|
||||
/* This defines the direction arg to the DMA mapping routines. */
|
||||
|
@ -3144,6 +3319,14 @@ 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 */
|
||||
|
@ -3247,19 +3430,61 @@ mlan_status wlan_adapter_init_cmd(pmlan_adapter pmadapter);
|
|||
mlan_status wlan_radio_ioctl_band_cfg(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
||||
#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);
|
||||
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;
|
||||
}
|
||||
|
||||
#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 */
|
||||
|
@ -3306,6 +3531,10 @@ 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,
|
||||
|
@ -3449,12 +3678,28 @@ 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);
|
||||
|
@ -3497,8 +3742,14 @@ 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,
|
||||
|
@ -3515,6 +3766,10 @@ 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,
|
||||
|
@ -3544,6 +3799,8 @@ t_bool wlan_set_chan_blacklist(mlan_private *priv, t_u16 band, t_u8 chan,
|
|||
dfs_state_t wlan_get_chan_dfs_state(mlan_private *priv, t_u16 band, t_u8 chan);
|
||||
t_void wlan_set_chan_dfs_state(mlan_private *priv, t_u16 band, t_u8 chan,
|
||||
dfs_state_t dfs_state);
|
||||
t_void wlan_reset_all_chan_dfs_state(mlan_private *priv, t_u16 band,
|
||||
dfs_state_t dfs_state);
|
||||
/* 802.11D related functions */
|
||||
/** Initialize 11D */
|
||||
t_void wlan_11d_priv_init(mlan_private *pmpriv);
|
||||
|
@ -3597,6 +3854,10 @@ 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,
|
||||
|
@ -3620,9 +3881,18 @@ 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_u8 ie_len,
|
||||
t_u8 *wlan_get_specific_ie(pmlan_private priv, t_u8 *ie_buf, t_u16 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
|
||||
|
@ -3713,6 +3983,29 @@ 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);
|
||||
|
@ -3732,10 +4025,6 @@ 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,
|
||||
|
@ -3745,12 +4034,6 @@ mlan_status wlan_cmd_mac_control(pmlan_private pmpriv, HostCmd_DS_COMMAND *pcmd,
|
|||
mlan_status wlan_ret_mac_control(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf);
|
||||
|
||||
mlan_status wlan_cmd_cw_mode_ctrl(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action, t_void *pdata_buf);
|
||||
mlan_status wlan_ret_cw_mode_ctrl(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf);
|
||||
|
||||
mlan_status wlan_cmd_802_11_radio_control(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action, t_void *pdata_buf);
|
||||
|
@ -3770,6 +4053,9 @@ mlan_status wlan_ret_reg_access(mlan_adapter *pmadapter, t_u16 type,
|
|||
mlan_ioctl_req *pioctl_buf);
|
||||
mlan_status wlan_ret_mem_access(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf);
|
||||
mlan_status wlan_ret_gpio_cfg_ops(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf);
|
||||
|
||||
mlan_status wlan_reg_mem_ioctl_reg_rw(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
@ -3781,6 +4067,8 @@ mlan_status wlan_cmd_reg_access(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
|
|||
t_u16 cmd_action, t_void *pdata_buf);
|
||||
mlan_status wlan_cmd_mem_access(HostCmd_DS_COMMAND *cmd, t_u16 cmd_action,
|
||||
t_void *pdata_buf);
|
||||
mlan_status wlan_cmd_gpio_cfg_ops(HostCmd_DS_COMMAND *cmd, t_u16 cmd_action,
|
||||
t_void *pdata_buf);
|
||||
mlan_status wlan_cmd_802_11_mac_address(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action);
|
||||
|
@ -3810,6 +4098,33 @@ 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);
|
||||
|
||||
|
@ -3836,12 +4151,13 @@ mlan_status wlan_set_drvdbg(pmlan_adapter pmadapter,
|
|||
mlan_status wlan_misc_hotspot_cfg(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
||||
#ifdef STA_SUPPORT
|
||||
mlan_status wlan_misc_multi_ap_cfg(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
||||
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,
|
||||
|
@ -3854,14 +4170,6 @@ 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
|
||||
|
@ -3871,7 +4179,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 oper_class, t_u8 bandwidth);
|
||||
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,
|
||||
|
@ -3904,10 +4212,37 @@ mlan_status wlan_misc_ioctl_txcontrol(pmlan_adapter pmadapter,
|
|||
mlan_status wlan_misc_ioctl_region(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
||||
#ifdef RX_PACKET_COALESCE
|
||||
mlan_status wlan_misc_ioctl_rx_pkt_coalesce_config(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
#endif
|
||||
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);
|
||||
|
||||
void wlan_bt_coex_wlan_param_update_event(pmlan_private priv,
|
||||
pmlan_buffer pevent);
|
||||
|
@ -3926,9 +4261,6 @@ mlan_status wlan_misc_ioctl_low_pwr_mode(pmlan_adapter pmadapter,
|
|||
mlan_status wlan_misc_ioctl_pmic_configure(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
||||
mlan_status wlan_misc_ioctl_cwmode_ctrl(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
||||
mlan_status wlan_set_mef_entry(mlan_private *pmpriv, pmlan_adapter pmadapter,
|
||||
mef_cfg_data *pmef);
|
||||
mlan_status wlan_process_mef_cfg_cmd(mlan_private *pmpriv,
|
||||
|
@ -3962,6 +4294,8 @@ mlan_status wlan_misc_ioctl_mc_aggr_cfg(pmlan_adapter pmadapter,
|
|||
mlan_ioctl_req *pioctl_req);
|
||||
mlan_status wlan_misc_ioctl_ch_load(pmlan_adapter pmadapter,
|
||||
mlan_ioctl_req *pioctl_req);
|
||||
mlan_status wlan_misc_ioctl_ch_load_results(pmlan_adapter pmadapter,
|
||||
mlan_ioctl_req *pioctl_req);
|
||||
mlan_status wlan_cmd_get_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action, t_void *pdata_buf);
|
||||
mlan_status wlan_ret_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
|
||||
|
@ -3970,11 +4304,12 @@ mlan_status wlan_ret_ch_load(pmlan_private pmpriv, HostCmd_DS_COMMAND *resp,
|
|||
mlan_status wlan_misc_ioctl_get_tsf(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
void wlan_add_fw_cfp_tables(pmlan_private pmpriv, t_u8 *buf, t_u16 buf_left);
|
||||
|
||||
void wlan_free_fw_cfp_tables(mlan_adapter *pmadapter);
|
||||
|
||||
mlan_status wlan_misc_chan_reg_cfg(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
mlan_status wlan_misc_region_power_cfg(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
||||
mlan_status wlan_get_cfp_table(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
@ -4022,6 +4357,9 @@ mlan_status wlan_cmd_fw_dump_event(pmlan_private pmpriv,
|
|||
HostCmd_DS_COMMAND *cmd, t_u16 cmd_action,
|
||||
t_void *pdata_buf);
|
||||
|
||||
mlan_status wlan_misc_gpiocfg(pmlan_adapter pmadapter,
|
||||
mlan_ioctl_req *pioctl_req);
|
||||
|
||||
mlan_status wlan_misc_bootsleep(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
|
||||
|
@ -4062,6 +4400,15 @@ mlan_status wlan_ret_get_sensor_temp(pmlan_private pmpriv,
|
|||
HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf);
|
||||
|
||||
mlan_status wlan_misc_ioctl_edmac_cfg(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req);
|
||||
mlan_status wlan_cmd_edmac_cfg(pmlan_private pmpriv, HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action, t_void *pdata_buf);
|
||||
|
||||
/** Set/Get Country code */
|
||||
mlan_status wlan_misc_ioctl_country_code(pmlan_adapter pmadapter,
|
||||
mlan_ioctl_req *pioctl_req);
|
||||
|
||||
/**
|
||||
* @brief RA based queueing
|
||||
*
|
||||
|
@ -4147,6 +4494,23 @@ 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,
|
||||
|
@ -4403,4 +4767,10 @@ wlan_get_privs_by_two_cond(mlan_adapter *pmadapter,
|
|||
|
||||
return count;
|
||||
}
|
||||
|
||||
t_bool wlan_secure_add(t_void *datain, t_s32 add, t_void *dataout,
|
||||
data_type type);
|
||||
t_bool wlan_secure_sub(t_void *datain, t_s32 sub, t_void *dataout,
|
||||
data_type type);
|
||||
|
||||
#endif /* !_MLAN_MAIN_H_ */
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -29,7 +29,9 @@ 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
|
@ -169,8 +169,12 @@ 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 */
|
||||
|
@ -182,7 +186,7 @@ Change log:
|
|||
/** PF start bit */
|
||||
#define ADMA_MSIX_PF_BIT 24
|
||||
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
/** PCIE9098 dev_id/vendor id reg */
|
||||
#define PCIE9098_DEV_ID_REG 0x0000
|
||||
/** PCIE revision ID register */
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* for sending scan commands to the firmware.
|
||||
*
|
||||
*
|
||||
* Copyright 2008-2022 NXP
|
||||
* Copyright 2008-2023 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -37,9 +37,6 @@ 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
|
||||
********************************************************/
|
||||
|
@ -508,6 +505,7 @@ 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,
|
||||
|
@ -532,7 +530,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;
|
||||
|
@ -688,6 +686,7 @@ 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;
|
||||
|
||||
|
@ -711,7 +710,6 @@ 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
|
||||
|
@ -763,12 +761,15 @@ 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), Dur(%d)\n",
|
||||
"Scan: Chan(%3d), bandcfg(%x), Mode(%d,%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) {
|
||||
|
@ -808,7 +809,8 @@ wlan_scan_channel_list(mlan_private *pmpriv, t_void *pioctl_buf,
|
|||
ret = pcb->moal_malloc(
|
||||
pmadapter->pmoal_handle,
|
||||
MAX_SCAN_CFG_ALLOC - CHAN_TLV_MAX_SIZE,
|
||||
MLAN_MEM_DEF, (t_u8 **)&ptlv_temp);
|
||||
MLAN_MEM_DEF | MOAL_MEM_FLAG_ATOMIC,
|
||||
(t_u8 **)&ptlv_temp);
|
||||
if (ret != MLAN_STATUS_SUCCESS || !ptlv_temp) {
|
||||
PRINTM(MERROR,
|
||||
"Memory allocation for pscan_cfg_out failed!\n");
|
||||
|
@ -1027,7 +1029,9 @@ wlan_scan_channel_list(mlan_private *pmpriv, t_void *pioctl_buf,
|
|||
wlan_cpu_to_le16(pvht_cap->header.len);
|
||||
}
|
||||
|
||||
if (IS_FW_SUPPORT_11AX(pmadapter)) {
|
||||
if (IS_FW_SUPPORT_11AX(pmadapter) &&
|
||||
((pmpriv->config_bands & BAND_GAX) ||
|
||||
(pmpriv->config_bands & BAND_AAX))) {
|
||||
phe_cap = (MrvlIEtypes_Extension_t *)ptlv_pos;
|
||||
len = wlan_fill_he_cap_tlv(pmpriv, pmpriv->config_bands,
|
||||
phe_cap, MFALSE);
|
||||
|
@ -1125,7 +1129,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;
|
||||
t_u32 chan_idx = 0;
|
||||
t_u32 chan_list_idx = 0;
|
||||
t_u32 scan_type;
|
||||
t_u16 scan_dur;
|
||||
|
@ -1496,17 +1500,20 @@ static mlan_status wlan_scan_setup_scan_config(
|
|||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (wlan_is_chan_passive(pmpriv,
|
||||
radio_type_to_band(radio_type),
|
||||
channel)) {
|
||||
/* do not send probe requests on this channel */
|
||||
scan_type = MLAN_SCAN_TYPE_PASSIVE;
|
||||
if (!puser_scan_in->scan_cfg_only) {
|
||||
if (wlan_is_chan_passive(
|
||||
pmpriv,
|
||||
radio_type_to_band(radio_type),
|
||||
channel)) {
|
||||
/* do not send probe requests on this
|
||||
* channel */
|
||||
scan_type = MLAN_SCAN_TYPE_PASSIVE;
|
||||
}
|
||||
}
|
||||
/* Prevent active scanning on a radar controlled channel
|
||||
*/
|
||||
if (radio_type == BAND_5GHZ &&
|
||||
scan_type != MLAN_SCAN_TYPE_PASSIVE) {
|
||||
scan_type == MLAN_SCAN_TYPE_PASSIVE) {
|
||||
if (pmadapter->active_scan_triggered == MFALSE)
|
||||
if (wlan_11h_radar_detect_required(
|
||||
pmpriv, channel)) {
|
||||
|
@ -1515,6 +1522,7 @@ static mlan_status wlan_scan_setup_scan_config(
|
|||
}
|
||||
}
|
||||
if (radio_type == BAND_2GHZ &&
|
||||
!puser_scan_in->scan_cfg_only &&
|
||||
scan_type != MLAN_SCAN_TYPE_PASSIVE) {
|
||||
if (pmadapter->active_scan_triggered == MFALSE)
|
||||
if (wlan_bg_scan_type_is_passive(
|
||||
|
@ -1587,7 +1595,6 @@ 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,
|
||||
|
@ -1733,6 +1740,7 @@ 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;
|
||||
|
@ -2072,6 +2080,54 @@ 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 =
|
||||
|
@ -3071,14 +3127,14 @@ static t_u8 wlan_get_chan_rssi(mlan_adapter *pmadapter, t_u8 channel,
|
|||
for (i = 0; i < (int)pmadapter->num_in_scan_table; i++) {
|
||||
if (pmadapter->pscan_table[i].channel == channel) {
|
||||
if (rssi == 0)
|
||||
rssi = (t_s32)pmadapter->pscan_table[i].rssi;
|
||||
rssi = (t_u8)pmadapter->pscan_table[i].rssi;
|
||||
else {
|
||||
if (min_flag)
|
||||
rssi = MIN(
|
||||
rssi = (t_u8)MIN(
|
||||
rssi,
|
||||
pmadapter->pscan_table[i].rssi);
|
||||
else
|
||||
rssi = MAX(
|
||||
rssi = (t_u8)MAX(
|
||||
rssi,
|
||||
pmadapter->pscan_table[i].rssi);
|
||||
}
|
||||
|
@ -3321,7 +3377,8 @@ static t_void wlan_scan_process_results(mlan_private *pmpriv)
|
|||
* Prepares domain info from scan table and downloads the
|
||||
* domain info command to the FW.
|
||||
*/
|
||||
wlan_11d_prepare_dnld_domain_info_cmd(pmpriv);
|
||||
if (pmpriv->bss_role == MLAN_BSS_ROLE_STA)
|
||||
wlan_11d_prepare_dnld_domain_info_cmd(pmpriv);
|
||||
PRINTM(MMSG, "wlan: SCAN COMPLETED: scanned AP count=%d\n",
|
||||
pmadapter->num_in_scan_table);
|
||||
LEAVE();
|
||||
|
@ -3774,6 +3831,13 @@ 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 ==
|
||||
|
@ -3788,11 +3852,9 @@ 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
|
||||
#ifdef DRV_EMBEDDED_SUPPLICANT
|
||||
|| supplicantIsEnabled(pmpriv->psapriv)
|
||||
#endif
|
||||
)) {
|
||||
(pmpriv->sec_info.ewpa_enabled == MTRUE ||
|
||||
pmpriv->sec_info.authentication_mode == MLAN_AUTH_MODE_OWE ||
|
||||
pbss_desc->owe_transition_mode == OWE_TRANS_MODE_OWE)) {
|
||||
if (((pbss_desc->pwpa_ie) &&
|
||||
((*(pbss_desc->pwpa_ie)).vend_hdr.element_id == WPA_IE)) ||
|
||||
((pbss_desc->prsn_ie) &&
|
||||
|
@ -4140,7 +4202,8 @@ mlan_status wlan_scan_networks(mlan_private *pmpriv, t_void *pioctl_buf,
|
|||
ENTER();
|
||||
|
||||
ret = pcb->moal_malloc(pmadapter->pmoal_handle,
|
||||
sizeof(wlan_scan_cmd_config_tlv), MLAN_MEM_DEF,
|
||||
sizeof(wlan_scan_cmd_config_tlv),
|
||||
MLAN_MEM_DEF | MLAN_MEM_FLAG_ATOMIC,
|
||||
(t_u8 **)&pscan_cfg_out);
|
||||
if (ret != MLAN_STATUS_SUCCESS || !pscan_cfg_out) {
|
||||
PRINTM(MERROR, "Memory allocation for pscan_cfg_out failed!\n");
|
||||
|
@ -4151,7 +4214,8 @@ mlan_status wlan_scan_networks(mlan_private *pmpriv, t_void *pioctl_buf,
|
|||
}
|
||||
|
||||
buf_size = sizeof(ChanScanParamSet_t) * WLAN_USER_SCAN_CHAN_MAX;
|
||||
ret = pcb->moal_malloc(pmadapter->pmoal_handle, buf_size, MLAN_MEM_DEF,
|
||||
ret = pcb->moal_malloc(pmadapter->pmoal_handle, buf_size,
|
||||
MLAN_MEM_DEF | MLAN_MEM_FLAG_ATOMIC,
|
||||
(t_u8 **)&pscan_chan_list);
|
||||
if (ret != MLAN_STATUS_SUCCESS || !pscan_chan_list) {
|
||||
PRINTM(MERROR, "Failed to allocate scan_chan_list\n");
|
||||
|
@ -4164,10 +4228,6 @@ 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,
|
||||
|
@ -4200,6 +4260,15 @@ 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;
|
||||
|
@ -4218,6 +4287,7 @@ mlan_status wlan_scan_networks(mlan_private *pmpriv, t_void *pioctl_buf,
|
|||
&pmadapter->scan_pending_q, MNULL, MNULL);
|
||||
pmadapter->pscan_ioctl_req = pioctl_req;
|
||||
pmadapter->scan_processing = MTRUE;
|
||||
pmadapter->scan_state = SCAN_STATE_SCAN_START;
|
||||
wlan_insert_cmd_to_pending_q(pmadapter, pcmd_node,
|
||||
MTRUE);
|
||||
}
|
||||
|
@ -4301,10 +4371,11 @@ 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;
|
||||
wlan_user_scan_cfg *user_scan_cfg = MNULL;
|
||||
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();
|
||||
|
||||
|
@ -4328,7 +4399,6 @@ 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,
|
||||
|
@ -4375,12 +4445,15 @@ 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) &&
|
||||
(user_scan_cfg->chan_list[i]
|
||||
.radio_type &
|
||||
(band &
|
||||
pmadapter->pscan_table[bss_idx]
|
||||
.bss_band)) {
|
||||
chan_listed = MTRUE;
|
||||
|
@ -4402,6 +4475,9 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4421,16 +4497,20 @@ 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;
|
||||
}
|
||||
|
@ -4478,7 +4558,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;
|
||||
t_u32 tlv_buf_size = 0;
|
||||
t_u64 tsf_val;
|
||||
chan_freq_power_t *cfp;
|
||||
MrvlIEtypes_ChanBandListParamSet_t *pchan_band_tlv = MNULL;
|
||||
|
@ -4529,10 +4609,21 @@ 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)
|
||||
*/
|
||||
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)
|
||||
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 -= sizeof(
|
||||
resp->params.bg_scan_query_resp.report_condition);
|
||||
|
||||
|
@ -4834,6 +4925,26 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get ext_scan state from ext_scan_type
|
||||
*
|
||||
*
|
||||
* @param pcmd A pointer to HostCmd_DS_COMMAND structure to be sent to
|
||||
* firmware with the HostCmd_DS_802_11_SCAN_EXT structure
|
||||
*
|
||||
* @return
|
||||
* SCAN_STATE_EXT_SCAN_ENH/SCAN_STATE_EXT_SCAN_CANCEL/SCAN_STATE_EXT_SCAN_ENH
|
||||
*/
|
||||
t_u8 wlan_get_ext_scan_state(HostCmd_DS_COMMAND *pcmd)
|
||||
{
|
||||
HostCmd_DS_802_11_SCAN_EXT *pext_scan_cmd = &pcmd->params.ext_scan;
|
||||
if (pext_scan_cmd->ext_scan_type == EXT_SCAN_ENHANCE)
|
||||
return SCAN_STATE_EXT_SCAN_ENH;
|
||||
if (pext_scan_cmd->ext_scan_type == EXT_SCAN_CANCEL)
|
||||
return SCAN_STATE_EXT_SCAN_CANCEL;
|
||||
return SCAN_STATE_EXT_SCAN;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Prepare an extended scan command to be sent to the firmware
|
||||
*
|
||||
|
@ -4923,11 +5034,13 @@ mlan_status wlan_ret_802_11_scan_ext(mlan_private *pmpriv,
|
|||
ENTER();
|
||||
|
||||
PRINTM(MINFO, "EXT scan returns successfully\n");
|
||||
pmadapter->scan_state |= wlan_get_ext_scan_state(resp);
|
||||
ext_scan_type = pext_scan_cmd->ext_scan_type;
|
||||
if (ext_scan_type == EXT_SCAN_CANCEL) {
|
||||
PRINTM(MCMND, "Cancel scan command completed!\n");
|
||||
wlan_request_cmd_lock(pmadapter);
|
||||
pmadapter->scan_processing = MFALSE;
|
||||
pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE;
|
||||
pmadapter->ext_scan_type = EXT_SCAN_DEFAULT;
|
||||
wlan_release_cmd_lock(pmadapter);
|
||||
/* Need to indicate IOCTL complete */
|
||||
|
@ -5276,7 +5389,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_s8 left_len = pbss_profile->ieee_hdr.len;
|
||||
t_u8 left_len = pbss_profile->ieee_hdr.len;
|
||||
t_u8 ret = MFALSE;
|
||||
mlan_callbacks *pcb = (pmlan_callbacks)&pmadapter->callbacks;
|
||||
BSSDescriptor_t *bss_new_entry = MNULL;
|
||||
|
@ -5747,6 +5860,13 @@ mlan_status wlan_handle_event_ext_scan_report(mlan_private *pmpriv,
|
|||
|
||||
DBG_HEXDUMP(MCMD_D, "EVENT EXT_SCAN", pmbuf->pbuf + pmbuf->data_offset,
|
||||
pmbuf->data_len);
|
||||
|
||||
if (!pevent_scan->more_event)
|
||||
pmadapter->scan_state |= SCAN_STATE_EXT_SCAN_RESULT |
|
||||
SCAN_STATE_LAST_EXT_SCAN_RESULT;
|
||||
else
|
||||
pmadapter->scan_state |= SCAN_STATE_EXT_SCAN_RESULT;
|
||||
|
||||
wlan_parse_ext_scan_result(pmpriv, pevent_scan->num_of_set, ptlv,
|
||||
tlv_buf_left);
|
||||
if (!pevent_scan->more_event &&
|
||||
|
@ -5780,6 +5900,7 @@ mlan_status wlan_handle_event_ext_scan_report(mlan_private *pmpriv,
|
|||
wlan_scan_process_results(pmpriv);
|
||||
wlan_request_cmd_lock(pmadapter);
|
||||
pmadapter->scan_processing = MFALSE;
|
||||
pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE;
|
||||
pioctl_req = pmadapter->pscan_ioctl_req;
|
||||
pmadapter->pscan_ioctl_req = MNULL;
|
||||
/* Need to indicate IOCTL complete */
|
||||
|
@ -5805,6 +5926,9 @@ mlan_status wlan_handle_event_ext_scan_report(mlan_private *pmpriv,
|
|||
wlan_flush_scan_queue(pmadapter);
|
||||
wlan_request_cmd_lock(pmadapter);
|
||||
pmadapter->scan_processing = MFALSE;
|
||||
pmadapter->scan_state |=
|
||||
SCAN_STATE_SCAN_COMPLETE;
|
||||
|
||||
pioctl_req = pmadapter->pscan_ioctl_req;
|
||||
pmadapter->pscan_ioctl_req = MNULL;
|
||||
/* Indicate IOCTL complete */
|
||||
|
@ -5855,7 +5979,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;
|
||||
t_u8 status = 0;
|
||||
cmd_ctrl_node *pcmd_node = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
@ -5865,6 +5989,7 @@ mlan_status wlan_handle_event_ext_scan_status(mlan_private *pmpriv,
|
|||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
pmadapter->scan_state |= SCAN_STATE_EXT_SCAN_STATUS;
|
||||
|
||||
scan_event =
|
||||
(pmlan_event_scan_status)(pmbuf->pbuf + pmbuf->data_offset);
|
||||
|
@ -5911,6 +6036,7 @@ done:
|
|||
wlan_flush_scan_queue(pmadapter);
|
||||
wlan_request_cmd_lock(pmadapter);
|
||||
pmadapter->scan_processing = MFALSE;
|
||||
pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE;
|
||||
pioctl_req = pmadapter->pscan_ioctl_req;
|
||||
pmadapter->pscan_ioctl_req = MNULL;
|
||||
/* Indicate IOCTL complete */
|
||||
|
@ -5971,6 +6097,7 @@ done:
|
|||
/** Complete scan ioctl */
|
||||
wlan_request_cmd_lock(pmadapter);
|
||||
pmadapter->scan_processing = MFALSE;
|
||||
pmadapter->scan_state |= SCAN_STATE_SCAN_COMPLETE;
|
||||
pioctl_req = pmadapter->pscan_ioctl_req;
|
||||
pmadapter->pscan_ioctl_req = MNULL;
|
||||
/* Need to indicate IOCTL complete */
|
||||
|
@ -5983,7 +6110,8 @@ done:
|
|||
wlan_release_cmd_lock(pmadapter);
|
||||
wlan_move_cmd_to_cmd_pending_q(pmadapter);
|
||||
pmadapter->bgscan_reported = MFALSE;
|
||||
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_SCAN_REPORT, MNULL);
|
||||
if (!status)
|
||||
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_SCAN_REPORT, MNULL);
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
@ -6030,10 +6158,9 @@ 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)
|
||||
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)
|
||||
{
|
||||
mlan_adapter *pmadapter = pmpriv->adapter;
|
||||
region_chan_t *pscan_region;
|
||||
|
@ -6082,7 +6209,7 @@ wlan_bgscan_create_channel_list(mlan_private *pmpriv,
|
|||
continue;
|
||||
for (next_chan = 0; next_chan < pscan_region->num_cfp;
|
||||
next_chan++, chan_idx++) {
|
||||
if (chan_idx >= WLAN_BG_SCAN_CHAN_MAX)
|
||||
if (chan_idx >= max_bgscan_chan)
|
||||
break;
|
||||
/*
|
||||
* Set the default scan type to ACTIVE SCAN type, will
|
||||
|
@ -6190,6 +6317,7 @@ 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;
|
||||
|
@ -6203,10 +6331,21 @@ 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;
|
||||
|
@ -6274,6 +6413,22 @@ 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));
|
||||
|
@ -6304,7 +6459,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 < WLAN_BG_SCAN_CHAN_MAX &&
|
||||
for (chan_idx = 0; chan_idx < max_bgscan_chan &&
|
||||
bg_scan_in->chan_list[chan_idx].chan_number;
|
||||
chan_idx++) {
|
||||
radio_type = bg_scan_in->chan_list[chan_idx].radio_type;
|
||||
|
@ -6360,6 +6515,15 @@ 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 =
|
||||
|
@ -6376,8 +6540,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);
|
||||
chan_num = wlan_bgscan_create_channel_list(
|
||||
pmpriv, bg_scan_in, tlv_chan_list, max_bgscan_chan);
|
||||
tlv_chan_list->header.type =
|
||||
wlan_cpu_to_le16(TLV_TYPE_CHANLIST);
|
||||
tlv_chan_list->header.len =
|
||||
|
@ -6388,7 +6552,8 @@ 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 = bg_scan_in->chan_per_scan;
|
||||
bg_scan->chan_per_scan =
|
||||
MIN(max_bgscan_chan, 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;
|
||||
|
@ -6426,7 +6591,9 @@ mlan_status wlan_cmd_bgscan_config(mlan_private *pmpriv,
|
|||
pvht_cap->header.len = wlan_cpu_to_le16(pvht_cap->header.len);
|
||||
}
|
||||
|
||||
if (IS_FW_SUPPORT_11AX(pmadapter)) {
|
||||
if (IS_FW_SUPPORT_11AX(pmadapter) &&
|
||||
((pmpriv->config_bands & BAND_GAX) ||
|
||||
(pmpriv->config_bands & BAND_AAX))) {
|
||||
phe_cap = (MrvlIEtypes_Extension_t *)tlv;
|
||||
len = wlan_fill_he_cap_tlv(pmpriv, pmpriv->config_bands,
|
||||
phe_cap, MFALSE);
|
||||
|
@ -6943,7 +7110,8 @@ mlan_status wlan_scan_specific_ssid(mlan_private *pmpriv, t_void *pioctl_buf,
|
|||
wlan_scan_delete_ssid_table_entry(pmpriv, preq_ssid);
|
||||
|
||||
ret = pcb->moal_malloc(pmpriv->adapter->pmoal_handle,
|
||||
sizeof(wlan_user_scan_cfg), MLAN_MEM_DEF,
|
||||
sizeof(wlan_user_scan_cfg),
|
||||
MLAN_MEM_DEF | MLAN_MEM_FLAG_ATOMIC,
|
||||
(t_u8 **)&pscan_cfg);
|
||||
|
||||
if (ret != MLAN_STATUS_SUCCESS || !pscan_cfg) {
|
||||
|
@ -6954,8 +7122,6 @@ 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;
|
||||
|
@ -7006,7 +7172,8 @@ t_void wlan_save_curr_bcn(mlan_private *pmpriv)
|
|||
if (pmpriv->curr_bcn_size) {
|
||||
ret = pcb->moal_malloc(pmadapter->pmoal_handle,
|
||||
pcurr_bss->beacon_buf_size,
|
||||
MLAN_MEM_DEF,
|
||||
MLAN_MEM_DEF |
|
||||
MLAN_MEM_FLAG_ATOMIC,
|
||||
&pmpriv->pcurr_bcn_buf);
|
||||
|
||||
if ((ret == MLAN_STATUS_SUCCESS) &&
|
||||
|
|
|
@ -107,6 +107,7 @@ 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
|
||||
|
||||
|
@ -147,6 +148,7 @@ 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
|
||||
|
||||
|
@ -217,11 +219,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(SD9098) || defined(SD9097) || defined(SDIW624) || \
|
||||
defined(SD8978) || defined(SD9177)
|
||||
static const struct _mlan_sdio_card_reg mlan_reg_sd8977_sd8997 = {
|
||||
.start_rd_port = 0,
|
||||
|
@ -297,6 +300,7 @@ 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,16 +311,18 @@ 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 SDNW62X
|
||||
static const struct _mlan_card_info mlan_card_info_sdnw62x = {
|
||||
#ifdef SDIW624
|
||||
static const struct _mlan_card_info mlan_card_info_sdiw624 = {
|
||||
.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
|
||||
|
||||
|
@ -327,6 +333,7 @@ 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
|
||||
|
@ -336,6 +343,7 @@ 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
|
||||
|
||||
|
@ -345,6 +353,7 @@ 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
|
||||
|
||||
|
@ -354,6 +363,7 @@ 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
|
||||
|
||||
|
@ -976,7 +986,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, base1;
|
||||
t_u32 base0 = 0, base1 = 0;
|
||||
t_void *tmpfwbuf = MNULL;
|
||||
t_u32 tmpfwbufsz;
|
||||
t_u8 *fwbuf;
|
||||
|
@ -1015,7 +1025,6 @@ 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)
|
||||
|
@ -1035,9 +1044,10 @@ 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 defined(SD9097) || defined(SD9177) || defined(SDIW624)
|
||||
if (IS_SD9097(pmadapter->card_type) ||
|
||||
IS_SDNW62X(pmadapter->card_type) || IS_SD9177(pmadapter->card_type))
|
||||
IS_SDIW624(pmadapter->card_type) ||
|
||||
IS_SDAW693(pmadapter->card_type) || IS_SD9177(pmadapter->card_type))
|
||||
check_fw_status = MTRUE;
|
||||
#endif
|
||||
|
||||
|
@ -1163,7 +1173,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, ".");
|
||||
PRINTM(MINFO, ".\n");
|
||||
|
||||
tx_blocks = (txlen + MLAN_SDIO_BLOCK_SIZE_FW_DNLD - 1) /
|
||||
MLAN_SDIO_BLOCK_SIZE_FW_DNLD;
|
||||
|
@ -1251,32 +1261,6 @@ 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) {
|
||||
|
@ -1334,6 +1318,8 @@ static mlan_status wlan_decode_rx_packet(mlan_adapter *pmadapter,
|
|||
|
||||
case MLAN_TYPE_CMD:
|
||||
PRINTM(MINFO, "--- Rx: Cmd Response ---\n");
|
||||
if (pmadapter->cmd_sent && !pmadapter->vdll_ctrl.vdll_len)
|
||||
pmadapter->cmd_sent = MFALSE;
|
||||
/* take care of curr_cmd = NULL case */
|
||||
if (!pmadapter->curr_cmd) {
|
||||
cmd_buf = pmadapter->upld_buf;
|
||||
|
@ -1370,6 +1356,7 @@ 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);
|
||||
|
@ -1428,7 +1415,7 @@ static mlan_status wlan_receive_single_packet(mlan_adapter *pmadapter)
|
|||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
if (pkt_type != MLAN_TYPE_DATA && pkt_type != MLAN_TYPE_SPA_DATA) {
|
||||
if (pkt_type != MLAN_TYPE_DATA) {
|
||||
PRINTM(MERROR,
|
||||
"receive a wrong pkt from DATA PORT: type=%d, len=%dd\n",
|
||||
pkt_type, pmbuf->data_len);
|
||||
|
@ -1562,8 +1549,7 @@ 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 ||
|
||||
pkt_type == MLAN_TYPE_SPA_DATA) &&
|
||||
if ((pkt_type == MLAN_TYPE_DATA) &&
|
||||
(pkt_len <=
|
||||
pmadapter->pcard_sd->mpa_rx.len_arr[pind])) {
|
||||
memcpy_ext(pmadapter,
|
||||
|
@ -1724,8 +1710,7 @@ rx_curr_single:
|
|||
goto done;
|
||||
}
|
||||
if (new_mode || (port != CTRL_PORT)) {
|
||||
if (pkt_type != MLAN_TYPE_DATA &&
|
||||
pkt_type != MLAN_TYPE_SPA_DATA) {
|
||||
if (pkt_type != MLAN_TYPE_DATA) {
|
||||
PRINTM(MERROR,
|
||||
"receive a wrong pkt from DATA PORT: type=%d, len=%dd\n",
|
||||
pkt_type, pmbuf->data_len);
|
||||
|
@ -2159,7 +2144,7 @@ static mlan_status wlan_sdio_check_fw_status(mlan_adapter *pmadapter,
|
|||
ret = MLAN_STATUS_SUCCESS;
|
||||
break;
|
||||
} else {
|
||||
wlan_mdelay(pmadapter, 100);
|
||||
wlan_mdelay(pmadapter, 10);
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -2284,10 +2269,6 @@ poll_fw:
|
|||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
#ifdef SD9177
|
||||
if (IS_SD9177(pmadapter->card_type))
|
||||
wlan_mdelay(pmadapter, 1000);
|
||||
#endif
|
||||
done:
|
||||
|
||||
/* re-enable host interrupt for mlan after fw dnld is successful */
|
||||
|
@ -2417,10 +2398,10 @@ mlan_status wlan_get_sdio_device(pmlan_adapter pmadapter)
|
|||
pmadapter->pcard_info = &mlan_card_info_sd9097;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SDNW62X
|
||||
case CARD_TYPE_SDNW62X:
|
||||
#ifdef SDIW624
|
||||
case CARD_TYPE_SDIW624:
|
||||
pmadapter->pcard_sd->reg = &mlan_reg_sd8977_sd8997;
|
||||
pmadapter->pcard_info = &mlan_card_info_sdnw62x;
|
||||
pmadapter->pcard_info = &mlan_card_info_sdiw624;
|
||||
break;
|
||||
#endif
|
||||
#ifdef SD9177
|
||||
|
@ -2499,6 +2480,9 @@ 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)
|
||||
|
@ -2576,6 +2560,7 @@ 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);
|
||||
|
@ -2629,7 +2614,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 && pkt_type != MLAN_TYPE_SPA_DATA) {
|
||||
if (pkt_type != MLAN_TYPE_DATA) {
|
||||
PRINTM(MERROR,
|
||||
"Recovery: Receive a wrong pkt: type=%d, len=%d\n",
|
||||
pkt_type, pmadapter->upld_len);
|
||||
|
@ -2639,12 +2624,6 @@ 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);
|
||||
|
@ -2658,9 +2637,11 @@ 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)
|
||||
static mlan_status wlan_process_sdio_int_status(mlan_adapter *pmadapter,
|
||||
t_u8 type)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
|
@ -2858,7 +2839,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) >
|
||||
pmadapter->pcard_sd->mpa_rx.buf_size) {
|
||||
ALLOC_BUF_SIZE) {
|
||||
PRINTM(MERROR, "invalid rx_len=%d\n", rx_len);
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
|
@ -3032,7 +3013,7 @@ exit:
|
|||
return ret;
|
||||
}
|
||||
|
||||
#if (defined(SD9098) || defined(SD9097) || defined(SDNW62X) || defined(SD9177))
|
||||
#if (defined(SD9098) || defined(SD9097) || defined(SDIW624) || defined(SD9177))
|
||||
/**
|
||||
* @brief This function sends vdll data to the card.
|
||||
*
|
||||
|
@ -3093,7 +3074,7 @@ 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 (defined(SD9098) || defined(SD9097) || defined(SDIW624) || defined(SD9177))
|
||||
if (type == MLAN_TYPE_VDLL)
|
||||
return wlan_sdio_send_vdll(pmadapter, pmbuf);
|
||||
#endif
|
||||
|
@ -3106,94 +3087,6 @@ 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
|
||||
|
@ -3210,6 +3103,7 @@ mlan_status wlan_alloc_sdio_mpa_buffers(mlan_adapter *pmadapter,
|
|||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
t_u32 buf_size = 0;
|
||||
t_u8 mp_aggr_pkt_limit = pmadapter->pcard_sd->mp_aggr_pkt_limit;
|
||||
|
||||
ENTER();
|
||||
|
@ -3217,9 +3111,12 @@ mlan_status wlan_alloc_sdio_mpa_buffers(mlan_adapter *pmadapter,
|
|||
if ((pmadapter->pcard_sd->max_segs < mp_aggr_pkt_limit) ||
|
||||
(pmadapter->pcard_sd->max_seg_size <
|
||||
pmadapter->pcard_sd->max_sp_tx_size)) {
|
||||
if (!wlan_secure_add(&mpa_tx_buf_size, DMA_ALIGNMENT, &buf_size,
|
||||
TYPE_UINT32))
|
||||
PRINTM(MERROR, "%s:tx_buf_size overflow \n", __func__);
|
||||
|
||||
ret = pcb->moal_malloc(
|
||||
pmadapter->pmoal_handle,
|
||||
mpa_tx_buf_size + DMA_ALIGNMENT,
|
||||
pmadapter->pmoal_handle, buf_size,
|
||||
MLAN_MEM_DEF | MLAN_MEM_DMA,
|
||||
(t_u8 **)&pmadapter->pcard_sd->mpa_tx.head_ptr);
|
||||
if (ret != MLAN_STATUS_SUCCESS ||
|
||||
|
@ -3241,9 +3138,12 @@ mlan_status wlan_alloc_sdio_mpa_buffers(mlan_adapter *pmadapter,
|
|||
if ((pmadapter->pcard_sd->max_segs < mp_aggr_pkt_limit) ||
|
||||
(pmadapter->pcard_sd->max_seg_size <
|
||||
pmadapter->pcard_sd->max_sp_rx_size)) {
|
||||
if (!wlan_secure_add(&mpa_rx_buf_size, DMA_ALIGNMENT, &buf_size,
|
||||
TYPE_UINT32))
|
||||
PRINTM(MERROR, "%s:rx_buf_size overflow \n", __func__);
|
||||
|
||||
ret = pcb->moal_malloc(
|
||||
pmadapter->pmoal_handle,
|
||||
mpa_rx_buf_size + DMA_ALIGNMENT,
|
||||
pmadapter->pmoal_handle, buf_size,
|
||||
MLAN_MEM_DEF | MLAN_MEM_DMA,
|
||||
(t_u8 **)&pmadapter->pcard_sd->mpa_rx.head_ptr);
|
||||
if (ret != MLAN_STATUS_SUCCESS ||
|
||||
|
@ -3302,80 +3202,6 @@ 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.
|
||||
*
|
||||
|
@ -3392,7 +3218,10 @@ static mlan_status wlan_pm_sdio_wakeup_card(pmlan_adapter pmadapter,
|
|||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
|
||||
ENTER();
|
||||
PRINTM(MEVENT, "Wakeup device...\n");
|
||||
if (pmadapter->second_mac)
|
||||
PRINTM(MEVENT, "#2 Wakeup device...\n");
|
||||
else
|
||||
PRINTM(MEVENT, "Wakeup device...\n");
|
||||
pmadapter->callbacks.moal_get_system_time(pmadapter->pmoal_handle,
|
||||
&pmadapter->pm_wakeup_in_secs,
|
||||
&age_ts_usec);
|
||||
|
@ -3400,7 +3229,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_3S);
|
||||
MFALSE, MRVDRV_TIMER_5S);
|
||||
pmadapter->wakeup_fw_timer_is_set = MTRUE;
|
||||
}
|
||||
|
||||
|
@ -3556,7 +3385,7 @@ mlan_status wlan_reset_fw(pmlan_adapter pmadapter)
|
|||
goto done;
|
||||
}
|
||||
#if defined(SD8997) || defined(SD8977) || defined(SD8987) || \
|
||||
defined(SD9098) || defined(SD9097) || defined(SDNW62X) || \
|
||||
defined(SD9098) || defined(SD9097) || defined(SDIW624) || \
|
||||
defined(SD8978) || defined(SD9177)
|
||||
if (MFALSE
|
||||
#ifdef SD8997
|
||||
|
@ -3577,8 +3406,8 @@ mlan_status wlan_reset_fw(pmlan_adapter pmadapter)
|
|||
#ifdef SD9097
|
||||
|| IS_SD9097(pmadapter->card_type)
|
||||
#endif
|
||||
#ifdef SDNW62X
|
||||
|| IS_SDNW62X(pmadapter->card_type)
|
||||
#ifdef SDIW624
|
||||
|| IS_SDIW624(pmadapter->card_type)
|
||||
#endif
|
||||
#ifdef SD9177
|
||||
|| IS_SD9177(pmadapter->card_type)
|
||||
|
@ -3620,13 +3449,34 @@ done:
|
|||
* @param pmbuf A pointer to the mlan_buffer
|
||||
* @return N/A
|
||||
*/
|
||||
static mlan_status wlan_sdio_data_evt_complete(pmlan_adapter pmadapter,
|
||||
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,
|
||||
mlan_buffer *pmbuf,
|
||||
mlan_status status)
|
||||
{
|
||||
ENTER();
|
||||
|
||||
wlan_free_mlan_buffer(pmadapter, pmbuf);
|
||||
if (pmbuf)
|
||||
wlan_free_mlan_buffer(pmadapter, pmbuf);
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
|
@ -3644,7 +3494,7 @@ static mlan_status wlan_sdio_handle_rx_packet(mlan_adapter *pmadapter,
|
|||
{
|
||||
ENTER();
|
||||
|
||||
wlan_sdio_deaggr_rx_pkt(pmadapter, pmbuf);
|
||||
wlan_handle_rx_packet(pmadapter, pmbuf);
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
|
@ -3657,9 +3507,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_data_evt_complete,
|
||||
.data_complete = wlan_sdio_data_evt_complete,
|
||||
.cmdrsp_complete = wlan_sdio_data_evt_complete,
|
||||
.event_complete = wlan_sdio_evt_complete,
|
||||
.data_complete = wlan_sdio_data_cmd_complete,
|
||||
.cmdrsp_complete = wlan_sdio_data_cmd_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,
|
||||
|
|
|
@ -358,10 +358,6 @@ 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);
|
||||
|
|
|
@ -44,9 +44,6 @@ Change log:
|
|||
#endif
|
||||
#include "mlan_11h.h"
|
||||
#include "mlan_11n_rxreorder.h"
|
||||
#ifdef DRV_EMBEDDED_AUTHENTICATOR
|
||||
#include "authenticator_api.h"
|
||||
#endif
|
||||
|
||||
/********************************************************
|
||||
Local Variables
|
||||
|
@ -170,7 +167,6 @@ 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) {
|
||||
|
@ -179,7 +175,6 @@ static void wlan_process_pending_ioctl(mlan_adapter *pmadapter)
|
|||
pioctl_buf);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -330,6 +325,7 @@ mlan_status mlan_register(pmlan_device pmdevice, t_void **ppmlan_adapter)
|
|||
pmadapter->card_type = pmdevice->card_type;
|
||||
pmadapter->card_rev = pmdevice->card_rev;
|
||||
pmadapter->init_para.uap_max_sta = pmdevice->uap_max_sta;
|
||||
pmadapter->init_para.mcs32 = pmdevice->mcs32;
|
||||
|
||||
#ifdef SDIO
|
||||
if (IS_SD(pmadapter->card_type)) {
|
||||
|
@ -364,8 +360,6 @@ 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
|
||||
|
||||
|
@ -441,6 +435,9 @@ 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;
|
||||
|
@ -458,9 +455,12 @@ 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,18 +1050,6 @@ 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);
|
||||
|
@ -1105,6 +1093,16 @@ 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;
|
||||
|
@ -1176,7 +1174,7 @@ process_start:
|
|||
pmadapter->pending_disconnect_priv, MTRUE);
|
||||
pmadapter->pending_disconnect_priv = MNULL;
|
||||
}
|
||||
#if defined(SDIO) || defined(PCIE)
|
||||
#if defined(SDIO)
|
||||
if (!IS_USB(pmadapter->card_type)) {
|
||||
if (pmadapter->rx_pkts_queued > HIGH_RX_PENDING) {
|
||||
pcb->moal_tp_accounting_rx_param(
|
||||
|
@ -1190,13 +1188,35 @@ process_start:
|
|||
if (pmadapter->ireg) {
|
||||
if (pmadapter->hs_activated == MTRUE)
|
||||
wlan_process_hs_config(pmadapter);
|
||||
pmadapter->ops.process_int_status(pmadapter);
|
||||
pmadapter->ops.process_int_status(pmadapter, 0);
|
||||
if (pmadapter->data_received)
|
||||
mlan_queue_rx_work(pmadapter);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef PCIE
|
||||
if (IS_PCIE(pmadapter->card_type) &&
|
||||
pmadapter->pcie_cmd_dnld_int) {
|
||||
pmadapter->pcie_cmd_dnld_int = MFALSE;
|
||||
mlan_process_pcie_interrupt_cb(pmadapter, RX_CMD_DNLD);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* wake up timeout happened */
|
||||
if ((pmadapter->ps_state == PS_STATE_SLEEP) &&
|
||||
pmadapter->pm_wakeup_flag) {
|
||||
pmadapter->pm_wakeup_flag = MFALSE;
|
||||
if (pmadapter->pm_wakeup_timeout > 2)
|
||||
wlan_recv_event(
|
||||
wlan_get_priv(pmadapter,
|
||||
MLAN_BSS_ROLE_ANY),
|
||||
MLAN_EVENT_ID_DRV_DBG_DUMP, MNULL);
|
||||
else {
|
||||
pmadapter->ops.wakeup_card(pmadapter, MTRUE);
|
||||
pmadapter->pm_wakeup_fw_try = MTRUE;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
/* Need to wake up the card ? */
|
||||
if ((pmadapter->ps_state == PS_STATE_SLEEP) &&
|
||||
(pmadapter->pm_wakeup_card_req &&
|
||||
|
@ -1260,8 +1280,11 @@ process_start:
|
|||
}
|
||||
|
||||
/* Check for Cmd Resp */
|
||||
wlan_request_cmd_lock(pmadapter);
|
||||
if (pmadapter->cmd_resp_received) {
|
||||
pmadapter->cmd_resp_received = MFALSE;
|
||||
wlan_release_cmd_lock(pmadapter);
|
||||
|
||||
wlan_process_cmdresp(pmadapter);
|
||||
|
||||
/* call moal back when init_fw is done */
|
||||
|
@ -1275,6 +1298,8 @@ process_start:
|
|||
WlanHardwareStatusInitializing;
|
||||
wlan_get_hw_spec_complete(pmadapter);
|
||||
}
|
||||
} else {
|
||||
wlan_release_cmd_lock(pmadapter);
|
||||
}
|
||||
|
||||
/* Check for event */
|
||||
|
@ -1282,7 +1307,6 @@ 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)
|
||||
|
@ -1361,7 +1385,19 @@ process_start:
|
|||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PCIE
|
||||
if (IS_PCIE(pmadapter->card_type)) {
|
||||
if (pmadapter->pcard_pcie->reg->use_adma) {
|
||||
if (wlan_is_tx_pending(pmadapter)) {
|
||||
wlan_recv_event(
|
||||
wlan_get_priv(pmadapter,
|
||||
MLAN_BSS_ROLE_ANY),
|
||||
MLAN_EVENT_ID_DRV_DELAY_TX_COMPLETE,
|
||||
MNULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} while (MTRUE);
|
||||
|
||||
pcb->moal_spin_lock(pmadapter->pmoal_handle,
|
||||
|
@ -1378,7 +1414,8 @@ process_start:
|
|||
|
||||
exit_main_proc:
|
||||
if (pmadapter->hw_status == WlanHardwareStatusClosing)
|
||||
mlan_shutdown_fw(pmadapter);
|
||||
if (MLAN_STATUS_SUCCESS != mlan_shutdown_fw(pmadapter))
|
||||
PRINTM(MERROR, "ERR:mlan_shutdown_fw failed\n");
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
@ -1414,10 +1451,9 @@ mlan_status mlan_send_packet(t_void *padapter, pmlan_buffer pmbuf)
|
|||
eth_type =
|
||||
mlan_ntohs(*(t_u16 *)&pmbuf->pbuf[pmbuf->data_offset +
|
||||
MLAN_ETHER_PKT_TYPE_OFFSET]);
|
||||
if (((pmadapter->priv[pmbuf->bss_index]->port_ctrl_mode == MTRUE) &&
|
||||
((eth_type == MLAN_ETHER_PKT_TYPE_EAPOL) ||
|
||||
(eth_type == MLAN_ETHER_PKT_TYPE_ARP) ||
|
||||
(eth_type == MLAN_ETHER_PKT_TYPE_WAPI))) ||
|
||||
if ((eth_type == MLAN_ETHER_PKT_TYPE_EAPOL) ||
|
||||
(eth_type == MLAN_ETHER_PKT_TYPE_ARP) ||
|
||||
(eth_type == MLAN_ETHER_PKT_TYPE_WAPI) ||
|
||||
(eth_type == MLAN_ETHER_PKT_TYPE_TDLS_ACTION) ||
|
||||
(pmbuf->buf_type == MLAN_BUF_TYPE_RAW_DATA)
|
||||
|
||||
|
@ -1458,6 +1494,22 @@ mlan_status mlan_send_packet(t_void *padapter, pmlan_buffer pmbuf)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief clean up txrx
|
||||
*
|
||||
* @param adapter A pointer to mlan_adapter structure
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
static t_void wlan_free_txrx(pmlan_adapter pmadapter)
|
||||
{
|
||||
t_u8 i;
|
||||
for (i = 0; i < pmadapter->priv_num; i++) {
|
||||
if (pmadapter->priv[i])
|
||||
wlan_clean_txrx(pmadapter->priv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MLAN ioctl handler
|
||||
*
|
||||
|
@ -1476,13 +1528,9 @@ mlan_status mlan_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
|
|||
ENTER();
|
||||
|
||||
if (pioctl_req == MNULL) {
|
||||
PRINTM(MMSG, "Cancel all pending cmd!\n");
|
||||
PRINTM(MMSG, "Cancel all pending cmd and txrx queue\n");
|
||||
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;
|
||||
wlan_free_txrx(pmadapter);
|
||||
goto exit;
|
||||
}
|
||||
pmpriv = pmadapter->priv[pioctl_req->bss_index];
|
||||
|
@ -1518,6 +1566,9 @@ 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);
|
||||
}
|
||||
|
||||
|
@ -1541,9 +1592,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;
|
||||
t_u32 event_cause = 0;
|
||||
#ifdef DEBUG_LEVEL1
|
||||
t_u32 sec, usec;
|
||||
t_u32 sec = 0, usec = 0;
|
||||
#endif
|
||||
t_u32 max_rx_data_size = MLAN_RX_DATA_BUF_SIZE;
|
||||
|
||||
|
@ -1592,11 +1643,13 @@ mlan_status mlan_recv(t_void *padapter, pmlan_buffer pmbuf, t_u32 port)
|
|||
}
|
||||
PRINTM(MINFO, "mlan_recv: no curr_cmd\n");
|
||||
} else {
|
||||
wlan_request_cmd_lock(pmadapter);
|
||||
pmadapter->upld_len = len;
|
||||
pmbuf->data_offset += MLAN_TYPE_LEN;
|
||||
pmbuf->data_len -= MLAN_TYPE_LEN;
|
||||
pmadapter->curr_cmd->respbuf = pmbuf;
|
||||
pmadapter->cmd_resp_received = MTRUE;
|
||||
wlan_release_cmd_lock(pmadapter);
|
||||
}
|
||||
break;
|
||||
case MLAN_USB_TYPE_EVENT:
|
||||
|
@ -1742,8 +1795,12 @@ void mlan_process_deaggr_pkt(t_void *padapter, pmlan_buffer pmbuf, t_u8 *drop)
|
|||
PRINTM(MEVENT, "Recevie AMSDU EAPOL frame\n");
|
||||
if (pmpriv->sec_info.ewpa_enabled) {
|
||||
*drop = MTRUE;
|
||||
wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11_EAPOL_PKT,
|
||||
0, 0, MNULL, pmbuf);
|
||||
if (MLAN_STATUS_FAILURE ==
|
||||
wlan_prepare_cmd(pmpriv,
|
||||
HostCmd_CMD_802_11_EAPOL_PKT, 0, 0,
|
||||
MNULL, pmbuf)) {
|
||||
PRINTM(MERROR, "Preparing the CMD failed\n");
|
||||
}
|
||||
wlan_recv_event(pmpriv,
|
||||
MLAN_EVENT_ID_DRV_DEFER_HANDLING,
|
||||
MNULL);
|
||||
|
@ -1845,4 +1902,76 @@ 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->ps_state == PS_STATE_SLEEP) ||
|
||||
(pmadapter->ps_state == PS_STATE_SLEEP_CFM)) {
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
} else if (type == TX_COMPLETE && !wlan_is_tx_pending(pmadapter)) {
|
||||
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 TX_COMPLETE: // Tx data complete
|
||||
wlan_recv_event(wlan_get_priv(pmadapter, MLAN_BSS_ROLE_ANY),
|
||||
MLAN_EVENT_ID_DRV_DEFER_HANDLING, MNULL);
|
||||
if (pmadapter->pcard_pcie->reg->use_adma) {
|
||||
if (wlan_is_tx_pending(pmadapter))
|
||||
wlan_recv_event(
|
||||
wlan_get_priv(pmadapter,
|
||||
MLAN_BSS_ROLE_ANY),
|
||||
MLAN_EVENT_ID_DRV_DELAY_TX_COMPLETE,
|
||||
MNULL);
|
||||
}
|
||||
break;
|
||||
case RX_EVENT: // Rx event
|
||||
case RX_CMD_RESP: // Rx CMD Resp
|
||||
if (mlan_main_process(pmadapter) == MLAN_STATUS_FAILURE)
|
||||
PRINTM(MERROR, "mlan_main_process failed.\n");
|
||||
break;
|
||||
case RX_CMD_DNLD:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* it is ready.
|
||||
*
|
||||
*
|
||||
* Copyright 2008-2022 NXP
|
||||
* Copyright 2008-2023 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -424,6 +424,55 @@ 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.
|
||||
*
|
||||
|
@ -495,6 +544,10 @@ 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:
|
||||
|
@ -949,6 +1002,10 @@ 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);
|
||||
|
@ -1112,7 +1169,7 @@ static mlan_status wlan_cmd_802_11_key_material(pmlan_private pmpriv,
|
|||
PRINTM(MCMND, "Remove Key\n");
|
||||
goto done;
|
||||
}
|
||||
pkey_material->action = wlan_cpu_to_le16(HostCmd_ACT_GEN_SET);
|
||||
pkey_material->action = wlan_cpu_to_le16(cmd_action);
|
||||
pkey_material->key_param_set.key_idx = pkey->key_index & KEY_INDEX_MASK;
|
||||
pkey_material->key_param_set.type =
|
||||
wlan_cpu_to_le16(TLV_TYPE_KEY_PARAM_V2);
|
||||
|
@ -1228,7 +1285,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) {
|
||||
|
@ -1252,7 +1309,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 &&
|
||||
|
@ -1319,7 +1376,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
|
||||
.cmac_aes.ipn,
|
||||
.gmac_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));
|
||||
|
@ -1327,10 +1384,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.cmac_aes.key_len =
|
||||
pkey_material->key_param_set.key_params.gmac_aes.key_len =
|
||||
wlan_cpu_to_le16(pkey->key_len);
|
||||
memcpy_ext(pmpriv->adapter,
|
||||
pkey_material->key_param_set.key_params.cmac_aes.key,
|
||||
pkey_material->key_param_set.key_params.gmac_aes.key,
|
||||
pkey->key_material, pkey->key_len,
|
||||
WPA_IGTK_256_KEY_LEN);
|
||||
pkey_material->key_param_set.length = wlan_cpu_to_le16(
|
||||
|
@ -2489,6 +2546,46 @@ static mlan_status wlan_cmd_otp_user_data(pmlan_private pmpriv,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function prepares command of fw auto re-connect.
|
||||
*
|
||||
* @param pmpriv A pointer to mlan_private structure
|
||||
* @param cmd A pointer to HostCmd_DS_COMMAND structure
|
||||
* @param cmd_action the action: GET or SET
|
||||
* @param pdata_buf A pointer to data buffer
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
static mlan_status wlan_cmd_fw_auto_reconnect(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *cmd,
|
||||
t_u16 cmd_action,
|
||||
t_void *pdata_buf)
|
||||
{
|
||||
HostCmd_DS_FW_AUTO_RECONNECT *fw_auto_reconnect =
|
||||
&cmd->params.fw_auto_reconnect_cmd;
|
||||
mlan_ds_fw_reconnect *fw_auto_reconn =
|
||||
(mlan_ds_fw_reconnect *)pdata_buf;
|
||||
|
||||
ENTER();
|
||||
|
||||
cmd->command = wlan_cpu_to_le16(HostCmd_CMD_FW_AUTO_RECONNECT);
|
||||
cmd->size = wlan_cpu_to_le16((sizeof(HostCmd_DS_FW_AUTO_RECONNECT)) +
|
||||
S_DS_GEN);
|
||||
|
||||
fw_auto_reconnect->action = wlan_cpu_to_le16(cmd_action);
|
||||
|
||||
if (cmd_action == HostCmd_ACT_GEN_SET) {
|
||||
fw_auto_reconnect->reconnect_counter =
|
||||
fw_auto_reconn->fw_reconn_counter;
|
||||
fw_auto_reconnect->reconnect_interval =
|
||||
fw_auto_reconn->fw_reconn_interval;
|
||||
fw_auto_reconnect->flags =
|
||||
wlan_cpu_to_le16(fw_auto_reconn->fw_reconn_flags);
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef USB
|
||||
/**
|
||||
* @brief This function prepares command of packet aggragation
|
||||
|
@ -2596,6 +2693,8 @@ 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();
|
||||
|
@ -2629,13 +2728,15 @@ 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) {
|
||||
pchan_band =
|
||||
&cmd_net_mon->monitor_chan.chan_band_param[0];
|
||||
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->monitor_chan.header.type =
|
||||
wlan_cpu_to_le16(TLV_TYPE_CHANNELBANDLIST);
|
||||
cmd_net_mon->monitor_chan.header.len =
|
||||
|
@ -3220,7 +3321,7 @@ static t_u16 mlan_prepare_roam_offload_tlv(pmlan_private pmpriv, t_u32 type,
|
|||
pos += sizeof(MrvlIEtypes_RepeatCount_t);
|
||||
}
|
||||
LEAVE();
|
||||
return (pos - begin);
|
||||
return ((t_u16)(pos - begin));
|
||||
}
|
||||
/**
|
||||
* @brief This function sends enable/disable roam offload command to firmware.
|
||||
|
@ -3363,6 +3464,8 @@ 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();
|
||||
|
@ -3457,6 +3560,46 @@ 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;
|
||||
|
@ -3583,9 +3726,6 @@ 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,
|
||||
|
@ -3610,10 +3750,6 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
ret = wlan_cmd_802_11_rf_antenna(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_CW_MODE_CTRL:
|
||||
ret = wlan_cmd_cw_mode_ctrl(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_TXPWR_CFG:
|
||||
ret = wlan_cmd_tx_power_cfg(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
|
@ -3654,7 +3790,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 HOST_CMD_PMIC_CONFIGURE:
|
||||
case HostCmd_CMD_PMIC_CONFIGURE:
|
||||
cmd_ptr->command = wlan_cpu_to_le16(cmd_no);
|
||||
cmd_ptr->size = wlan_cpu_to_le16(S_DS_GEN);
|
||||
break;
|
||||
|
@ -3699,6 +3835,14 @@ 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;
|
||||
|
@ -3886,6 +4030,9 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
case HostCmd_CMD_MEM_ACCESS:
|
||||
ret = wlan_cmd_mem_access(cmd_ptr, cmd_action, pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_GPIO_CFG:
|
||||
ret = wlan_cmd_gpio_cfg_ops(cmd_ptr, cmd_action, pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_INACTIVITY_TIMEOUT_EXT:
|
||||
ret = wlan_cmd_inactivity_timeout(cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
|
@ -3937,7 +4084,7 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
pdata_buf);
|
||||
break;
|
||||
#ifdef WIFI_DIRECT_SUPPORT
|
||||
case HOST_CMD_WIFI_DIRECT_MODE_CONFIG:
|
||||
case HostCmd_CMD_WIFI_DIRECT_MODE_CONFIG:
|
||||
ret = wlan_cmd_wifi_direct_mode(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
|
@ -3950,6 +4097,10 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
ret = wlan_cmd_otp_user_data(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_FW_AUTO_RECONNECT:
|
||||
ret = wlan_cmd_fw_auto_reconnect(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_HS_WAKEUP_REASON:
|
||||
ret = wlan_cmd_hs_wakeup_reason(pmpriv, cmd_ptr, pdata_buf);
|
||||
break;
|
||||
|
@ -3967,16 +4118,21 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
pmpriv, cmd_ptr, cmd_action, pdata_buf);
|
||||
break;
|
||||
#endif
|
||||
#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);
|
||||
case HostCmd_CMD_MULTI_CHAN_CONFIG:
|
||||
ret = wlan_cmd_multi_chan_cfg(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
#endif
|
||||
case HostCMD_CONFIG_LOW_POWER_MODE:
|
||||
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:
|
||||
ret = wlan_cmd_low_pwr_mode(pmpriv, cmd_ptr, pdata_buf);
|
||||
break;
|
||||
case HostCmd_DFS_REPEATER_MODE:
|
||||
case HostCmd_CMD_DFS_REPEATER_MODE:
|
||||
ret = wlan_cmd_dfs_repeater_cfg(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
|
@ -3984,7 +4140,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_DS_GET_SENSOR_TEMP:
|
||||
case HostCmd_CMD_DS_GET_SENSOR_TEMP:
|
||||
ret = wlan_cmd_get_sensor_temp(pmpriv, cmd_ptr, cmd_action);
|
||||
break;
|
||||
case HostCmd_CMD_802_11_MIMO_SWITCH:
|
||||
|
@ -4018,11 +4174,18 @@ mlan_status wlan_ops_sta_prepare_cmd(t_void *priv, t_u16 cmd_no,
|
|||
sizeof(HostCmd_DS_CHAN_REGION_CFG) + S_DS_GEN);
|
||||
cmd_ptr->params.reg_cfg.action = wlan_cpu_to_le16(cmd_action);
|
||||
break;
|
||||
case HostCmd_CMD_REGION_POWER_CFG:
|
||||
cmd_ptr->command = wlan_cpu_to_le16(cmd_no);
|
||||
cmd_ptr->size = wlan_cpu_to_le16(
|
||||
sizeof(HostCmd_DS_REGION_POWER_CFG) + S_DS_GEN);
|
||||
cmd_ptr->params.rg_power_cfg.action =
|
||||
wlan_cpu_to_le16(cmd_action);
|
||||
break;
|
||||
case HostCmd_CMD_AUTO_TX:
|
||||
ret = wlan_cmd_auto_tx(pmpriv, cmd_ptr, cmd_action, cmd_oid,
|
||||
pdata_buf);
|
||||
break;
|
||||
case HOST_CMD_TX_RX_PKT_STATS:
|
||||
case HostCmd_CMD_TX_RX_PKT_STATS:
|
||||
ret = wlan_cmd_tx_rx_pkt_stats(pmpriv, cmd_ptr,
|
||||
(pmlan_ioctl_req)pioctl_buf,
|
||||
pdata_buf);
|
||||
|
@ -4039,11 +4202,6 @@ 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;
|
||||
|
@ -4057,7 +4215,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 HOST_CMD_GPIO_TSF_LATCH_PARAM_CONFIG:
|
||||
case HostCmd_CMD_GPIO_TSF_LATCH_PARAM_CONFIG:
|
||||
ret = wlan_cmd_gpio_tsf_latch(pmpriv, cmd_ptr, cmd_action,
|
||||
pioctl_buf, pdata_buf);
|
||||
break;
|
||||
|
@ -4065,10 +4223,22 @@ 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;
|
||||
|
@ -4088,7 +4258,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_CHANNEL_TRPC_CONFIG:
|
||||
case HostCmd_CMD_CHANNEL_TRPC_CONFIG:
|
||||
ret = wlan_cmd_get_chan_trpc_config(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
|
@ -4107,6 +4277,17 @@ 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;
|
||||
case HostCmd_CMD_802_11_TX_FRAME:
|
||||
ret = wlan_cmd_tx_frame(pmpriv, cmd_ptr, cmd_action, pdata_buf);
|
||||
break;
|
||||
case HostCmd_CMD_EDMAC_CFG:
|
||||
ret = wlan_cmd_edmac_cfg(pmpriv, cmd_ptr, cmd_action,
|
||||
pdata_buf);
|
||||
break;
|
||||
default:
|
||||
PRINTM(MERROR, "PREP_CMD: unknown command- %#x\n", cmd_no);
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* responses generated by firmware.
|
||||
*
|
||||
*
|
||||
* Copyright 2008-2022 NXP
|
||||
* Copyright 2008-2023 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -101,7 +101,8 @@ wlan_process_cmdreps_error_tdls_operation(mlan_private *pmpriv,
|
|||
if (ISSUPP_EXTCAP_TDLS_CHAN_SWITCH(
|
||||
sta_ptr->ExtCap.ext_cap))
|
||||
wlan_tdls_config(pmpriv, MFALSE);
|
||||
if (sta_ptr->is_11n_enabled) {
|
||||
if (sta_ptr->is_11n_enabled ||
|
||||
sta_ptr->is_11ax_enabled) {
|
||||
wlan_cleanup_reorder_tbl(
|
||||
pmpriv, ptdls_oper_data->peer_mac);
|
||||
wlan_11n_cleanup_txbastream_tbl(
|
||||
|
@ -157,7 +158,8 @@ static mlan_status wlan_process_cmdresp_error(mlan_private *pmpriv,
|
|||
|
||||
ENTER();
|
||||
if (resp->command != HostCmd_CMD_WMM_PARAM_CONFIG &&
|
||||
resp->command != HostCmd_CMD_CHAN_REGION_CFG)
|
||||
resp->command != HostCmd_CMD_CHAN_REGION_CFG &&
|
||||
resp->command != HostCmd_CMD_REGION_POWER_CFG)
|
||||
PRINTM(MERROR, "CMD_RESP: cmd %#x error, result=%#x\n",
|
||||
resp->command, resp->result);
|
||||
if (pioctl_buf)
|
||||
|
@ -180,6 +182,8 @@ 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);
|
||||
|
||||
|
@ -257,13 +261,15 @@ 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;
|
||||
#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");
|
||||
case HostCmd_CMD_802_11_REMAIN_ON_CHANNEL:
|
||||
if (resp->result == HostCmd_RESULT_BUSY)
|
||||
pmadapter->dbg.num_remain_chan_err++;
|
||||
break;
|
||||
#ifdef SDIO
|
||||
#endif
|
||||
|
||||
case HostCmd_CMD_MGMT_IE_LIST: {
|
||||
|
@ -321,7 +327,8 @@ static mlan_status wlan_process_cmdresp_error(mlan_private *pmpriv,
|
|||
}
|
||||
} break;
|
||||
case HostCmd_CMD_ROAM_OFFLOAD:
|
||||
wlan_clear_fw_roaming_pmk(pmpriv);
|
||||
if (MLAN_STATUS_SUCCESS != wlan_clear_fw_roaming_pmk(pmpriv))
|
||||
PRINTM(MERROR, "wlan_clear_fw_roaming_pmk fail\n");
|
||||
pmpriv->adapter->fw_roaming = MFALSE;
|
||||
PRINTM(MERROR, "FW do not support roaming!\n");
|
||||
break;
|
||||
|
@ -329,12 +336,10 @@ 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);
|
||||
case HostCmd_CMD_REGION_POWER_CFG:
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
PRINTM(MCMND, "FW don't support region power cfg command!\n");
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -627,6 +632,7 @@ static mlan_status wlan_ret_802_11_snmp_mib(pmlan_private pmpriv,
|
|||
/* Update state for 11h */
|
||||
if (oid == Dot11H_i) {
|
||||
ul_temp = wlan_le16_to_cpu(*((t_u16 *)(psmib->value)));
|
||||
PRINTM(MCMND, "wlan: Dot11H_i=%d\n", ul_temp);
|
||||
/* Set 11h state to priv */
|
||||
pmpriv->intf_state_11h.is_11h_active =
|
||||
(ul_temp & ENABLE_11H_MASK);
|
||||
|
@ -717,8 +723,10 @@ 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_recovery_cnt =
|
||||
wlan_le32_to_cpu(pget_log->rx_stuck_recovery_cnt);
|
||||
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_tsf[0] =
|
||||
wlan_le64_to_cpu(pget_log->rx_stuck_tsf[0]);
|
||||
pget_info->param.stats.rx_stuck_tsf[1] =
|
||||
|
@ -885,7 +893,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_u16 length = 0;
|
||||
t_s32 length = 0;
|
||||
t_s8 max_power = -1, min_power = -1;
|
||||
MrvlTypes_Power_Group_t *ppg_tlv = MNULL;
|
||||
Power_Group_t *pg = MNULL;
|
||||
|
@ -904,7 +912,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) {
|
||||
while (length > 0) {
|
||||
pg++;
|
||||
if (max_power < pg->power_max)
|
||||
max_power = pg->power_max;
|
||||
|
@ -1315,11 +1323,16 @@ 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) {
|
||||
wlan_prepare_cmd(
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
ret = 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));
|
||||
}
|
||||
|
@ -1388,13 +1401,16 @@ 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);
|
||||
memcpy_ext(
|
||||
pmpriv->adapter,
|
||||
sec->param.encrypt_key.key_material,
|
||||
pkey->key_param_set.key_params.aes.key,
|
||||
sec->param.encrypt_key
|
||||
.key_len = MIN(
|
||||
sec->param.encrypt_key.key_len,
|
||||
sizeof(sec->param.encrypt_key
|
||||
.key_material));
|
||||
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));
|
||||
memcpy_ext(
|
||||
pmpriv->adapter,
|
||||
sec->param.encrypt_key.pn,
|
||||
|
@ -1407,13 +1423,16 @@ 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);
|
||||
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));
|
||||
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.pn,
|
||||
pkey->key_param_set.key_params
|
||||
|
@ -1426,13 +1445,16 @@ 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);
|
||||
memcpy_ext(
|
||||
pmpriv->adapter,
|
||||
sec->param.encrypt_key.key_material,
|
||||
pkey->key_param_set.key_params.wep.key,
|
||||
sec->param.encrypt_key
|
||||
.key_len = MIN(
|
||||
sec->param.encrypt_key.key_len,
|
||||
sizeof(sec->param.encrypt_key
|
||||
.key_material));
|
||||
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));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1838,7 +1860,8 @@ static mlan_status wlan_ret_tdls_config(pmlan_private pmpriv,
|
|||
sta_ptr = wlan_get_station_entry(
|
||||
pmpriv, tdls_all_cfg->u.tdls_tear_down.peer_mac_addr);
|
||||
if (sta_ptr) {
|
||||
if (sta_ptr->is_11n_enabled) {
|
||||
if (sta_ptr->is_11n_enabled ||
|
||||
sta_ptr->is_11ax_enabled) {
|
||||
wlan_cleanup_reorder_tbl(
|
||||
pmpriv, tdls_all_cfg->u.tdls_tear_down
|
||||
.peer_mac_addr);
|
||||
|
@ -2010,7 +2033,8 @@ static mlan_status wlan_ret_tdls_oper(pmlan_private pmpriv,
|
|||
if (ISSUPP_EXTCAP_TDLS_CHAN_SWITCH(
|
||||
sta_ptr->ExtCap.ext_cap))
|
||||
wlan_tdls_config(pmpriv, MFALSE);
|
||||
if (sta_ptr->is_11n_enabled) {
|
||||
if (sta_ptr->is_11n_enabled ||
|
||||
sta_ptr->is_11ax_enabled) {
|
||||
wlan_cleanup_reorder_tbl(pmpriv,
|
||||
ptdls_oper->peer_mac);
|
||||
wlan_11n_cleanup_txbastream_tbl(
|
||||
|
@ -2109,6 +2133,8 @@ 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();
|
||||
|
@ -2236,6 +2262,42 @@ static mlan_status wlan_ret_otp_user_data(pmlan_private pmpriv,
|
|||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles the command response of
|
||||
* fw auto re-connect
|
||||
*
|
||||
* @param pmpriv A pointer to mlan_private structure
|
||||
* @param resp A pointer to HostCmd_DS_COMMAND
|
||||
* @param pioctl_buf A pointer to command buffer
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
static mlan_status wlan_ret_fw_auto_reconnect(pmlan_private pmpriv,
|
||||
HostCmd_DS_COMMAND *resp,
|
||||
mlan_ioctl_req *pioctl_buf)
|
||||
{
|
||||
HostCmd_DS_FW_AUTO_RECONNECT *fw_auto_reconnect =
|
||||
(HostCmd_DS_FW_AUTO_RECONNECT *)&resp->params
|
||||
.fw_auto_reconnect_cmd;
|
||||
mlan_ds_misc_cfg *misc = MNULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (pioctl_buf && (pioctl_buf->action == MLAN_ACT_GET)) {
|
||||
misc = (mlan_ds_misc_cfg *)pioctl_buf->pbuf;
|
||||
misc->param.fw_auto_reconnect.fw_reconn_counter =
|
||||
fw_auto_reconnect->reconnect_counter;
|
||||
misc->param.fw_auto_reconnect.fw_reconn_interval =
|
||||
fw_auto_reconnect->reconnect_interval;
|
||||
misc->param.fw_auto_reconnect.fw_reconn_flags =
|
||||
wlan_le16_to_cpu(fw_auto_reconnect->flags);
|
||||
pioctl_buf->data_read_written = sizeof(mlan_ds_misc_cfg);
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef USB
|
||||
/**
|
||||
* @brief This function handles the command response of
|
||||
|
@ -2577,20 +2639,22 @@ 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;
|
||||
bss->param.sta_channel.bandcfg =
|
||||
tlv_band_channel->bandcfg;
|
||||
*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 (bss->param.sta_channel.bandcfg.chanWidth ==
|
||||
CHAN_BW_80MHZ)
|
||||
if (bandcfg->chanWidth == CHAN_BW_80MHZ)
|
||||
bss->param.sta_channel.center_chan =
|
||||
wlan_get_center_freq_idx(
|
||||
pmpriv, BAND_AAC,
|
||||
pmpriv,
|
||||
bandcfg->chanBand,
|
||||
bss->param.sta_channel
|
||||
.channel,
|
||||
CHANNEL_BW_80MHZ);
|
||||
|
@ -2626,10 +2690,6 @@ mlan_status wlan_clear_fw_roaming_pmk(pmlan_private pmpriv)
|
|||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_SUPPLICANT_PMK,
|
||||
HostCmd_ACT_GEN_REMOVE, 0, MNULL, MNULL);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS) {
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
@ -2666,7 +2726,10 @@ static mlan_status wlan_ret_roam_offload(pmlan_private pmpriv,
|
|||
pmpriv->adapter->fw_roaming = MTRUE;
|
||||
else {
|
||||
pmpriv->adapter->fw_roaming = MFALSE;
|
||||
wlan_clear_fw_roaming_pmk(pmpriv);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
wlan_clear_fw_roaming_pmk(pmpriv))
|
||||
PRINTM(MERROR,
|
||||
"wlan_clear_fw_roaming_pmk failed\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2698,6 +2761,8 @@ 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();
|
||||
|
||||
|
@ -2774,6 +2839,65 @@ 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();
|
||||
|
@ -2874,6 +2998,53 @@ 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
|
||||
|
@ -2929,6 +3100,9 @@ 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) {
|
||||
|
@ -2945,6 +3119,10 @@ 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:
|
||||
|
@ -2964,7 +3142,20 @@ 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);
|
||||
cfg->data1 = wlan_le32_to_cpu(mcmd->data1);
|
||||
|
||||
#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->data2 = wlan_le32_to_cpu(mcmd->data2);
|
||||
cfg->data3 = wlan_le32_to_cpu(mcmd->data3);
|
||||
cmd_mfg_done:
|
||||
|
@ -2972,6 +3163,39 @@ 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
|
||||
*
|
||||
|
@ -3009,9 +3233,6 @@ 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);
|
||||
|
@ -3109,6 +3330,14 @@ 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;
|
||||
|
@ -3130,9 +3359,6 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
case HostCmd_CMD_802_11_RF_ANTENNA:
|
||||
ret = wlan_ret_802_11_rf_antenna(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_CW_MODE_CTRL:
|
||||
ret = wlan_ret_cw_mode_ctrl(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_VERSION_EXT:
|
||||
ret = wlan_ret_ver_ext(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
|
@ -3176,6 +3402,10 @@ 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);
|
||||
|
@ -3283,6 +3513,9 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
case HostCmd_CMD_MEM_ACCESS:
|
||||
ret = wlan_ret_mem_access(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_GPIO_CFG:
|
||||
ret = wlan_ret_gpio_cfg_ops(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_INACTIVITY_TIMEOUT_EXT:
|
||||
ret = wlan_ret_inactivity_timeout(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
|
@ -3310,7 +3543,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 HOST_CMD_WIFI_DIRECT_MODE_CONFIG:
|
||||
case HostCmd_CMD_WIFI_DIRECT_MODE_CONFIG:
|
||||
ret = wlan_ret_wifi_direct_mode(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
#endif
|
||||
|
@ -3320,6 +3553,9 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
case HostCmd_CMD_OTP_READ_USER_DATA:
|
||||
ret = wlan_ret_otp_user_data(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_FW_AUTO_RECONNECT:
|
||||
ret = wlan_ret_fw_auto_reconnect(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_HS_WAKEUP_REASON:
|
||||
ret = wlan_ret_hs_wakeup_reason(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
|
@ -3335,14 +3571,18 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
pioctl_buf);
|
||||
break;
|
||||
#endif
|
||||
#ifdef RX_PACKET_COALESCE
|
||||
case HostCmd_CMD_RX_PKT_COALESCE_CFG:
|
||||
ret = wlan_ret_rx_pkt_coalesce_cfg(pmpriv, resp, pioctl_buf);
|
||||
case HostCmd_CMD_MULTI_CHAN_CONFIG:
|
||||
ret = wlan_ret_multi_chan_cfg(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
#endif
|
||||
case HostCMD_CONFIG_LOW_POWER_MODE:
|
||||
case HostCmd_CMD_MULTI_CHAN_POLICY:
|
||||
ret = wlan_ret_multi_chan_policy(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_DFS_REPEATER_MODE:
|
||||
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:
|
||||
ret = wlan_ret_dfs_repeater_cfg(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_COALESCE_CFG:
|
||||
|
@ -3350,7 +3590,7 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
break;
|
||||
case HostCmd_CMD_MEF_CFG:
|
||||
break;
|
||||
case HostCmd_DS_GET_SENSOR_TEMP:
|
||||
case HostCmd_CMD_DS_GET_SENSOR_TEMP:
|
||||
ret = wlan_ret_get_sensor_temp(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_802_11_MIMO_SWITCH:
|
||||
|
@ -3361,7 +3601,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 HOST_CMD_PMIC_CONFIGURE:
|
||||
case HostCmd_CMD_PMIC_CONFIGURE:
|
||||
break;
|
||||
case HostCmd_CMD_INDEPENDENT_RESET_CFG:
|
||||
ret = wlan_ret_ind_rst_cfg(pmpriv, resp, pioctl_buf);
|
||||
|
@ -3377,10 +3617,12 @@ mlan_status wlan_ops_sta_process_cmdresp(t_void *priv, t_u16 cmdresp_no,
|
|||
case HostCmd_CMD_CHAN_REGION_CFG:
|
||||
ret = wlan_ret_chan_region_cfg(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_REGION_POWER_CFG:
|
||||
break;
|
||||
case HostCmd_CMD_AUTO_TX:
|
||||
ret = wlan_ret_auto_tx(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HOST_CMD_TX_RX_PKT_STATS:
|
||||
case HostCmd_CMD_TX_RX_PKT_STATS:
|
||||
ret = wlan_ret_tx_rx_pkt_stats(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_DYN_BW:
|
||||
|
@ -3389,11 +3631,6 @@ 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;
|
||||
|
@ -3404,16 +3641,26 @@ 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 HOST_CMD_GPIO_TSF_LATCH_PARAM_CONFIG:
|
||||
case HostCmd_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;
|
||||
|
@ -3436,7 +3683,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_CHANNEL_TRPC_CONFIG:
|
||||
case HostCmd_CMD_CHANNEL_TRPC_CONFIG:
|
||||
ret = wlan_ret_get_chan_trpc_config(pmpriv, resp, pioctl_buf);
|
||||
break;
|
||||
case HostCmd_CMD_LOW_POWER_MODE_CFG:
|
||||
|
@ -3452,6 +3699,13 @@ 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;
|
||||
case HostCmd_CMD_802_11_TX_FRAME:
|
||||
break;
|
||||
case HostCmd_CMD_EDMAC_CFG:
|
||||
break;
|
||||
default:
|
||||
PRINTM(MERROR, "CMD_RESP: Unknown command response %#x\n",
|
||||
resp->command);
|
||||
|
|
|
@ -33,9 +33,6 @@ 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 */
|
||||
|
@ -65,6 +62,49 @@ static t_void wlan_handle_disconnect_event(pmlan_private pmpriv)
|
|||
LEAVE();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function iterates over station list and notifies
|
||||
* mac address of each sta to respective event handler.
|
||||
*
|
||||
* @param priv A pointer to mlan_private structure
|
||||
* @event_id A reference to mlan event
|
||||
* @return N/A
|
||||
*/
|
||||
static void wlan_notify_stations(mlan_private *priv, mlan_event_id event_id)
|
||||
{
|
||||
sta_node *sta_ptr;
|
||||
t_u8 event_buf[128];
|
||||
mlan_event *pevent = (mlan_event *)event_buf;
|
||||
t_u8 *pbuf;
|
||||
|
||||
ENTER();
|
||||
sta_ptr = (sta_node *)util_peek_list(
|
||||
priv->adapter->pmoal_handle, &priv->sta_list,
|
||||
priv->adapter->callbacks.moal_spin_lock,
|
||||
priv->adapter->callbacks.moal_spin_unlock);
|
||||
|
||||
if (!sta_ptr) {
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
|
||||
while (sta_ptr != (sta_node *)&priv->sta_list) {
|
||||
memset(priv->adapter, event_buf, 0, sizeof(event_buf));
|
||||
pevent->bss_index = priv->bss_index;
|
||||
pevent->event_id = event_id;
|
||||
pevent->event_len = MLAN_MAC_ADDR_LENGTH + 2;
|
||||
pbuf = (t_u8 *)pevent->event_buf;
|
||||
/* reason field set to 0, Unspecified */
|
||||
memcpy_ext(priv->adapter, pbuf + 2, sta_ptr->mac_addr,
|
||||
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
|
||||
wlan_recv_event(priv, pevent->event_id, pevent);
|
||||
sta_ptr = sta_ptr->pnext;
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function will parse the TDLS event for further wlan action
|
||||
*
|
||||
|
@ -139,7 +179,8 @@ static void wlan_parse_tdls_event(pmlan_private priv, pmlan_buffer pevent)
|
|||
}
|
||||
}
|
||||
for (i = 0; i < MAX_NUM_TID; i++) {
|
||||
if (sta_ptr->is_11n_enabled)
|
||||
if (sta_ptr->is_11n_enabled ||
|
||||
sta_ptr->is_11ax_enabled)
|
||||
sta_ptr->ampdu_sta[i] =
|
||||
priv->aggr_prio_tbl[i]
|
||||
.ampdu_user;
|
||||
|
@ -170,6 +211,7 @@ 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;
|
||||
|
@ -182,10 +224,13 @@ static void wlan_parse_tdls_event(pmlan_private priv, pmlan_buffer pevent)
|
|||
MLAN_MAC_ADDR_LENGTH);
|
||||
/* Send command to firmware to delete tdls
|
||||
* link*/
|
||||
wlan_prepare_cmd(priv,
|
||||
HostCmd_CMD_TDLS_OPERATION,
|
||||
HostCmd_ACT_GEN_SET, 0,
|
||||
(t_void *)MNULL, &tdls_oper);
|
||||
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");
|
||||
ptdls_event->bss_index = priv->bss_index;
|
||||
ptdls_event->event_id =
|
||||
MLAN_EVENT_ID_DRV_TDLS_TEARDOWN_REQ;
|
||||
|
@ -212,7 +257,8 @@ static void wlan_parse_tdls_event(pmlan_private priv, pmlan_buffer pevent)
|
|||
wlan_restore_tdls_packets(priv,
|
||||
tdls_event->peer_mac_addr,
|
||||
TDLS_TEAR_DOWN);
|
||||
if (sta_ptr->is_11n_enabled) {
|
||||
if (sta_ptr->is_11n_enabled ||
|
||||
sta_ptr->is_11ax_enabled) {
|
||||
wlan_cleanup_reorder_tbl(
|
||||
priv, tdls_event->peer_mac_addr);
|
||||
wlan_11n_cleanup_txbastream_tbl(
|
||||
|
@ -331,6 +377,75 @@ static void wlan_send_tdls_tear_down_request(pmlan_private priv)
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function will handle the generic NAN event for further wlan
|
||||
* action based on the Event subtypes
|
||||
*
|
||||
* @param pmpriv A pointer to mlan_private
|
||||
* @param evt_buf A pointer to mlan_event
|
||||
* @param pmbuf A pointer to mlan buffer
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
static void wlan_process_nan_event(pmlan_private pmpriv, pmlan_buffer pmbuf)
|
||||
{
|
||||
t_u8 *evt_buf = MNULL;
|
||||
mlan_event *pevent;
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
event_nan_generic *nan_event =
|
||||
(event_nan_generic *)(pmbuf->pbuf + pmbuf->data_offset +
|
||||
sizeof(mlan_event_id));
|
||||
pmlan_adapter pmadapter = pmpriv->adapter;
|
||||
pmlan_callbacks pcb = &pmadapter->callbacks;
|
||||
|
||||
ENTER();
|
||||
|
||||
ret = pcb->moal_malloc(pmadapter->pmoal_handle, MAX_EVENT_SIZE,
|
||||
MLAN_MEM_DEF, &evt_buf);
|
||||
if (ret != MLAN_STATUS_SUCCESS || !evt_buf) {
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
|
||||
pevent = (pmlan_event)evt_buf;
|
||||
|
||||
pevent->bss_index = pmpriv->bss_index;
|
||||
if (wlan_le16_to_cpu(nan_event->event_sub_type) ==
|
||||
NAN_EVT_SUBTYPE_SD_EVENT ||
|
||||
wlan_le16_to_cpu(nan_event->event_sub_type) ==
|
||||
NAN_EVT_SUBTYPE_SDF_TX_DONE) {
|
||||
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);
|
||||
pcb->moal_mfree(pmadapter->pmoal_handle, evt_buf);
|
||||
} else {
|
||||
t_u8 test_mac[MLAN_MAC_ADDR_LENGTH] = {0x00, 0x11, 0x22,
|
||||
0x33, 0x44, 0x55};
|
||||
pevent->event_id = MLAN_EVENT_ID_DRV_CONNECTED;
|
||||
pevent->event_len = MLAN_MAC_ADDR_LENGTH;
|
||||
memcpy_ext(pmpriv->adapter, (t_u8 *)pevent->event_buf, test_mac,
|
||||
MLAN_MAC_ADDR_LENGTH, pevent->event_len);
|
||||
wlan_ralist_add(pmpriv, test_mac);
|
||||
memcpy_ext(pmpriv->adapter,
|
||||
pmpriv->curr_bss_params.bss_descriptor.mac_address,
|
||||
test_mac, MLAN_MAC_ADDR_LENGTH,
|
||||
MLAN_MAC_ADDR_LENGTH);
|
||||
wlan_recv_event(pmpriv, MLAN_EVENT_ID_DRV_CONNECTED, pevent);
|
||||
if (pmpriv->port_ctrl_mode == MTRUE)
|
||||
pmpriv->port_open = MTRUE;
|
||||
pmpriv->media_connected = MTRUE;
|
||||
PRINTM_NETINTF(MEVENT, pmpriv);
|
||||
PRINTM(MEVENT, "nan interface - opened\n");
|
||||
pcb->moal_mfree(pmadapter->pmoal_handle, evt_buf);
|
||||
}
|
||||
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
|
||||
/********************************************************
|
||||
Global Functions
|
||||
********************************************************/
|
||||
|
@ -368,7 +483,12 @@ t_void wlan_reset_connect_state(pmlan_private priv, t_u8 drv_disconnect)
|
|||
if (drv_disconnect) {
|
||||
priv->media_connected = MFALSE;
|
||||
pmadapter->state_rdh.tx_block = MFALSE;
|
||||
wlan_11h_check_update_radar_det_state(priv);
|
||||
#ifdef UAP_SUPPORT
|
||||
if (pmadapter->dfs_mode)
|
||||
wlan_11h_update_dfs_master_state_on_disconect(priv);
|
||||
else
|
||||
#endif
|
||||
wlan_11h_check_update_radar_det_state(priv);
|
||||
}
|
||||
|
||||
if (priv->port_ctrl_mode == MTRUE) {
|
||||
|
@ -394,17 +514,13 @@ 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;
|
||||
|
@ -463,11 +579,6 @@ 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);
|
||||
|
@ -552,17 +663,9 @@ static void wlan_process_sta_tx_pause_event(pmlan_private priv,
|
|||
PRINTM(MCMND, "TxPause: " MACSTR " pause=%d, pkts=%d\n",
|
||||
MAC2STR(tx_pause_tlv->peermac),
|
||||
tx_pause_tlv->tx_pause, tx_pause_tlv->pkt_cnt);
|
||||
|
||||
if (bssid &&
|
||||
!memcmp(priv->adapter, bssid, tx_pause_tlv->peermac,
|
||||
MLAN_MAC_ADDR_LENGTH)) {
|
||||
if (tx_pause_tlv->tx_pause)
|
||||
priv->tx_pause = MTRUE;
|
||||
else
|
||||
priv->tx_pause = MFALSE;
|
||||
} else {
|
||||
status = wlan_get_tdls_link_status(
|
||||
priv, tx_pause_tlv->peermac);
|
||||
status = wlan_get_tdls_link_status(
|
||||
priv, tx_pause_tlv->peermac);
|
||||
if (status != TDLS_NOT_SETUP) {
|
||||
if (MTRUE == wlan_is_tdls_link_setup(status)) {
|
||||
sta_ptr = wlan_get_station_entry(
|
||||
priv, tx_pause_tlv->peermac);
|
||||
|
@ -581,6 +684,11 @@ static void wlan_process_sta_tx_pause_event(pmlan_private priv,
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (tx_pause_tlv->tx_pause)
|
||||
priv->tx_pause = MTRUE;
|
||||
else
|
||||
priv->tx_pause = MFALSE;
|
||||
}
|
||||
}
|
||||
tlv_buf_left -= (sizeof(MrvlIEtypesHeader_t) + tlv_len);
|
||||
|
@ -668,9 +776,12 @@ 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();
|
||||
|
||||
|
@ -752,20 +863,61 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
|
|||
break;
|
||||
|
||||
case EVENT_LINK_LOST:
|
||||
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;
|
||||
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;
|
||||
}
|
||||
pmadapter->dbg.num_event_link_lost++;
|
||||
wlan_handle_disconnect_event(pmpriv);
|
||||
break;
|
||||
|
||||
case EVENT_PS_SLEEP:
|
||||
PRINTM(MINFO, "EVENT: SLEEP\n");
|
||||
PRINTM_NETINTF(MEVENT, pmpriv);
|
||||
PRINTM(MEVENT, "_");
|
||||
if (pmadapter->second_mac)
|
||||
PRINTM(MEVENT, "__");
|
||||
else
|
||||
PRINTM(MEVENT, "_");
|
||||
|
||||
/* Handle unexpected PS SLEEP event */
|
||||
if (pmadapter->ps_state == PS_STATE_SLEEP_CFM)
|
||||
|
@ -777,8 +929,10 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
|
|||
|
||||
case EVENT_PS_AWAKE:
|
||||
PRINTM(MINFO, "EVENT: AWAKE\n");
|
||||
PRINTM_NETINTF(MEVENT, pmpriv);
|
||||
PRINTM(MEVENT, "|");
|
||||
if (pmadapter->second_mac)
|
||||
PRINTM(MEVENT, "||");
|
||||
else
|
||||
PRINTM(MEVENT, "|");
|
||||
if (!pmadapter->pps_uapsd_mode && pmpriv->media_connected &&
|
||||
(pmpriv->port_open || !pmpriv->port_ctrl_mode) &&
|
||||
pmadapter->sleep_period.period) {
|
||||
|
@ -792,14 +946,19 @@ 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 (!pmadapter->data_sent
|
||||
#if defined(USB)
|
||||
&& wlan_is_port_ready(pmadapter,
|
||||
pmpriv->port_index)
|
||||
#endif
|
||||
) {
|
||||
if (wlan_send_null_packet(
|
||||
pmpriv,
|
||||
MRVDRV_TxPD_POWER_MGMT_NULL_PACKET |
|
||||
MRVDRV_TxPD_POWER_MGMT_LAST_PACKET) ==
|
||||
MLAN_STATUS_SUCCESS) {
|
||||
LEAVE();
|
||||
return MLAN_STATUS_SUCCESS;
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -833,6 +992,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
|
|||
wlan_clean_txrx(pmpriv);
|
||||
wlan_recv_event(pmpriv, MLAN_EVENT_ID_FW_ADHOC_LINK_LOST,
|
||||
MNULL);
|
||||
/* Notify IBSS disconnect handler to delete stations if any. */
|
||||
wlan_notify_stations(pmpriv, MLAN_EVENT_ID_FW_IBSS_DISCONNECT);
|
||||
break;
|
||||
case EVENT_ASSOC_REQ_IE:
|
||||
pmpriv->assoc_req_size = pmbuf->data_len - sizeof(eventcause);
|
||||
|
@ -876,6 +1037,8 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
|
|||
}
|
||||
pmadapter->scan_block = MFALSE;
|
||||
wlan_recv_event(pmpriv, MLAN_EVENT_ID_FW_PORT_RELEASE, MNULL);
|
||||
/* Send OBSS scan param to the application */
|
||||
wlan_2040_coex_event(pmpriv);
|
||||
break;
|
||||
|
||||
case EVENT_STOP_TX:
|
||||
|
@ -915,6 +1078,10 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
|
|||
cfp->freq;
|
||||
else
|
||||
pmpriv->curr_bss_params.bss_descriptor.freq = 0;
|
||||
#ifdef UAP_SUPPORT
|
||||
if (pmpriv->adapter->dfs_mode)
|
||||
wlan_11h_update_dfs_master_state_by_sta(pmpriv);
|
||||
#endif
|
||||
if (pmpriv->adapter->state_rdh.stage ==
|
||||
RDH_SET_CUSTOM_IE) {
|
||||
pmadapter->state_rdh.stage =
|
||||
|
@ -936,11 +1103,10 @@ 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, BAND_AAC,
|
||||
pchan_info->channel,
|
||||
CHANNEL_BW_80MHZ);
|
||||
pchan_band_info
|
||||
->center_chan = wlan_get_center_freq_idx(
|
||||
priv, pchan_band_info->bandcfg.chanBand,
|
||||
pchan_info->channel, CHANNEL_BW_80MHZ);
|
||||
wlan_recv_event(pmpriv,
|
||||
MLAN_EVENT_ID_FW_CHAN_SWITCH_COMPLETE,
|
||||
pevent);
|
||||
|
@ -989,8 +1155,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);
|
||||
ret = wlan_11h_handle_event_chanrpt_ready(
|
||||
pmpriv, pevent, &radar_chan, &bandwidth);
|
||||
/* Also send this event as passthru */
|
||||
pevent->event_id = MLAN_EVENT_ID_DRV_PASSTHRU;
|
||||
pevent->event_len = pmbuf->data_len;
|
||||
|
@ -1104,18 +1270,17 @@ 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)
|
||||
ret = wlan_prepare_cmd(pmpriv,
|
||||
HostCmd_CMD_11N_ADDBA_RSP,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL,
|
||||
pmadapter->event_body);
|
||||
if (pmpriv->media_connected == MTRUE &&
|
||||
!pmpriv->adapter->remain_on_channel)
|
||||
wlan_11n_add_bastream(pmpriv, 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)
|
||||
if (pmpriv->media_connected == MTRUE &&
|
||||
!pmpriv->adapter->remain_on_channel)
|
||||
wlan_11n_delete_bastream(pmpriv, pmadapter->event_body);
|
||||
else
|
||||
PRINTM(MERROR,
|
||||
|
@ -1123,7 +1288,8 @@ 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)
|
||||
if (pmpriv->media_connected == MTRUE &&
|
||||
!pmpriv->adapter->remain_on_channel)
|
||||
wlan_11n_ba_stream_timeout(
|
||||
pmpriv, (HostCmd_DS_11N_BATIMEOUT *)
|
||||
pmadapter->event_body);
|
||||
|
@ -1210,6 +1376,7 @@ 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);
|
||||
|
@ -1232,8 +1399,22 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
|
|||
break;
|
||||
|
||||
case EVENT_IBSS_STATION_CONNECT:
|
||||
pevent->bss_index = pmpriv->bss_index;
|
||||
pevent->event_id = MLAN_EVENT_ID_FW_IBSS_CONNECT;
|
||||
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_IBSS_STATION_DISCONNECT:
|
||||
pevent->bss_index = pmpriv->bss_index;
|
||||
pevent->event_id = MLAN_EVENT_ID_FW_IBSS_DISCONNECT;
|
||||
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_SAD_REPORT: {
|
||||
#ifdef DEBUG_LEVEL1
|
||||
|
@ -1245,6 +1426,10 @@ 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");
|
||||
|
@ -1271,6 +1456,10 @@ mlan_status wlan_ops_sta_process_event(t_void *priv)
|
|||
PRINTM(MEVENT, "EVENT: BT coex wlan param update\n");
|
||||
wlan_bt_coex_wlan_param_update_event(pmpriv, pmbuf);
|
||||
break;
|
||||
case EVENT_NAN_GENERIC:
|
||||
PRINTM(MEVENT, "EVENT: NAN_GENERIC_EVENT\n");
|
||||
wlan_process_nan_event(pmpriv, pmbuf);
|
||||
break;
|
||||
|
||||
#if defined(PCIE)
|
||||
case EVENT_SSU_DUMP_DMA:
|
||||
|
@ -1344,14 +1533,37 @@ 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*/
|
||||
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);
|
||||
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");
|
||||
}
|
||||
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;
|
||||
|
@ -1369,6 +1581,23 @@ 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);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* @brief This file contains the functions for station ioctl.
|
||||
*
|
||||
*
|
||||
* Copyright 2008-2022 NXP
|
||||
* Copyright 2008-2023 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -35,9 +35,6 @@ 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
|
||||
|
@ -295,7 +292,7 @@ static mlan_status wlan_get_info_bss_info(pmlan_adapter pmadapter,
|
|||
info->param.bss_info.beacon_interval = pbss_desc->beacon_period;
|
||||
|
||||
/* Band */
|
||||
info->param.bss_info.bss_band = (t_u8)pbss_desc->bss_band;
|
||||
info->param.bss_info.bss_band = pbss_desc->bss_band;
|
||||
|
||||
/* Region code */
|
||||
info->param.bss_info.region_code = pmadapter->region_code;
|
||||
|
@ -428,6 +425,8 @@ 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 =
|
||||
|
@ -446,6 +445,8 @@ static mlan_status wlan_get_info_ioctl(pmlan_adapter pmadapter,
|
|||
pmpriv->usr_dot_11ac_mcs_support;
|
||||
pget_info->param.fw_info.usr_dot_11ac_dev_cap_a =
|
||||
pmpriv->usr_dot_11ac_dev_cap_a;
|
||||
pget_info->param.fw_info.uuid_lo = pmadapter->uuid_lo;
|
||||
pget_info->param.fw_info.uuid_hi = pmadapter->uuid_hi;
|
||||
pget_info->param.fw_info.hw_hecap_len = pmadapter->hw_hecap_len;
|
||||
pget_info->param.fw_info.hw_2g_hecap_len =
|
||||
pmadapter->hw_2g_hecap_len;
|
||||
|
@ -465,6 +466,12 @@ 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;
|
||||
pget_info->param.fw_info.cmd_tx_data =
|
||||
IS_FW_SUPPORT_CMD_TX_DATA(pmadapter) ? 0x01 : 0x00;
|
||||
pget_info->param.fw_info.sec_rgpower =
|
||||
IS_FW_SUPPORT_SEC_RG_POWER(pmadapter) ? 0x01 : 0x00;
|
||||
break;
|
||||
case MLAN_OID_GET_BSS_INFO:
|
||||
status = wlan_get_info_bss_info(pmadapter, pioctl_req);
|
||||
|
@ -1014,12 +1021,6 @@ 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) {
|
||||
|
@ -1360,7 +1361,6 @@ 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) {
|
||||
|
@ -1404,10 +1404,6 @@ 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();
|
||||
|
||||
|
@ -1419,14 +1415,6 @@ 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);
|
||||
|
||||
|
@ -1520,6 +1508,7 @@ static mlan_status wlan_bss_ioctl(pmlan_adapter pmadapter,
|
|||
{
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
mlan_ds_bss *bss = MNULL;
|
||||
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
|
||||
|
||||
ENTER();
|
||||
|
||||
|
@ -1535,6 +1524,9 @@ static mlan_status wlan_bss_ioctl(pmlan_adapter pmadapter,
|
|||
bss = (mlan_ds_bss *)pioctl_req->pbuf;
|
||||
|
||||
switch (bss->sub_command) {
|
||||
case MLAN_OID_BSS_HOST_MLME:
|
||||
pmpriv->curr_bss_params.host_mlme = MTRUE;
|
||||
break;
|
||||
case MLAN_OID_BSS_START:
|
||||
status = wlan_bss_ioctl_start(pmadapter, pioctl_req);
|
||||
break;
|
||||
|
@ -1776,7 +1768,6 @@ 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) {
|
||||
|
@ -1871,7 +1862,6 @@ 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];
|
||||
|
@ -2943,7 +2933,9 @@ 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 = pwep_key->key_length;
|
||||
sec->param.encrypt_key.key_len =
|
||||
MIN(pwep_key->key_length,
|
||||
sizeof(pwep_key->key_material));
|
||||
memcpy_ext(pmadapter,
|
||||
sec->param.encrypt_key.key_material,
|
||||
pwep_key->key_material,
|
||||
|
@ -3014,7 +3006,7 @@ static mlan_status wlan_sec_ioctl_set_wpa_key(pmlan_adapter pmadapter,
|
|||
}
|
||||
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11_KEY_MATERIAL,
|
||||
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
|
||||
pioctl_req->action, 0, (t_void *)pioctl_req,
|
||||
&sec->param.encrypt_key);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
|
@ -3129,7 +3121,9 @@ static mlan_status wlan_sec_ioctl_encrypt_key(pmlan_adapter pmadapter,
|
|||
mlan_ds_sec_cfg *sec = MNULL;
|
||||
ENTER();
|
||||
sec = (mlan_ds_sec_cfg *)pioctl_req->pbuf;
|
||||
if (pioctl_req->action == MLAN_ACT_SET) {
|
||||
if ((pioctl_req->action == MLAN_ACT_SET) ||
|
||||
(pioctl_req->action == MLAN_ACT_PASN_KEY_DNLD) ||
|
||||
(pioctl_req->action == MLAN_ACT_CLEAR)) {
|
||||
if (sec->param.encrypt_key.is_wapi_key)
|
||||
status = wlan_sec_ioctl_set_wapi_key(pmadapter,
|
||||
pioctl_req);
|
||||
|
@ -3370,8 +3364,8 @@ static mlan_status wlan_sec_cfg_ioctl(pmlan_adapter pmadapter,
|
|||
*
|
||||
* @return MLAN_STATUS_SUCCESS --success, otherwise fail
|
||||
*/
|
||||
static int wlan_set_gen_ie_helper(mlan_private *priv, t_u8 *ie_data_ptr,
|
||||
t_u16 ie_len)
|
||||
static mlan_status wlan_set_gen_ie_helper(mlan_private *priv, t_u8 *ie_data_ptr,
|
||||
t_u16 ie_len)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
IEEEtypes_VendorHeader_t *pvendor_ie;
|
||||
|
@ -3954,9 +3948,9 @@ static mlan_status wlan_misc_ioctl_gen_ie(pmlan_adapter pmadapter,
|
|||
pmpriv->wpa_ie, misc->param.gen_ie.len,
|
||||
MAX_IE_SIZE);
|
||||
} else {
|
||||
wlan_set_gen_ie_helper(pmpriv,
|
||||
misc->param.gen_ie.ie_data,
|
||||
(t_u16)misc->param.gen_ie.len);
|
||||
ret = wlan_set_gen_ie_helper(
|
||||
pmpriv, misc->param.gen_ie.ie_data,
|
||||
(t_u16)misc->param.gen_ie.len);
|
||||
}
|
||||
break;
|
||||
case MLAN_IE_TYPE_ARP_FILTER:
|
||||
|
@ -3992,89 +3986,6 @@ 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
|
||||
|
@ -4388,6 +4299,42 @@ static mlan_status wlan_misc_ioctl_subscribe_evt(pmlan_adapter pmadapter,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get/Set fw auto reconnect
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @param pioctl_req A pointer to ioctl request buffer
|
||||
*
|
||||
* @return MLAN_STATUS_PENDING -- success, otherwise fail
|
||||
*/
|
||||
static mlan_status wlan_misc_ioctl_fw_auto_reconnect(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req)
|
||||
{
|
||||
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
mlan_ds_misc_cfg *misc = MNULL;
|
||||
t_u16 cmd_action = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
|
||||
if (pioctl_req->action == MLAN_ACT_SET)
|
||||
cmd_action = HostCmd_ACT_GEN_SET;
|
||||
else
|
||||
cmd_action = HostCmd_ACT_GEN_GET;
|
||||
|
||||
/* Send command to firmware */
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_FW_AUTO_RECONNECT,
|
||||
cmd_action, 0, (t_void *)pioctl_req,
|
||||
&misc->param.fw_auto_reconnect);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set ARP filter based on IP address
|
||||
*
|
||||
|
@ -4724,75 +4671,6 @@ 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
|
||||
*
|
||||
|
@ -5125,6 +5003,48 @@ 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
|
||||
*
|
||||
|
@ -5254,9 +5174,16 @@ 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);
|
||||
|
@ -5268,29 +5195,29 @@ 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;
|
||||
#ifdef RX_PACKET_COALESCE
|
||||
case MLAN_OID_MISC_RX_PACKET_COALESCE:
|
||||
status = wlan_misc_ioctl_rx_pkt_coalesce_config(pmadapter,
|
||||
pioctl_req);
|
||||
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);
|
||||
break;
|
||||
#endif
|
||||
case MLAN_OID_MISC_LOW_PWR_MODE:
|
||||
status = wlan_misc_ioctl_low_pwr_mode(pmadapter, pioctl_req);
|
||||
break;
|
||||
case MLAN_OID_MISC_PMIC_CFG:
|
||||
status = wlan_misc_ioctl_pmic_configure(pmadapter, pioctl_req);
|
||||
break;
|
||||
case MLAN_OID_MISC_CWMODE_CTRL:
|
||||
status = wlan_misc_ioctl_cwmode_ctrl(pmadapter, pioctl_req);
|
||||
break;
|
||||
case MLAN_OID_MISC_MEF_FLT_CFG:
|
||||
status = wlan_misc_ioctl_mef_flt_cfg(pmadapter, pioctl_req);
|
||||
break;
|
||||
|
@ -5327,9 +5254,16 @@ 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;
|
||||
|
@ -5339,9 +5273,15 @@ static mlan_status wlan_misc_cfg_ioctl(pmlan_adapter pmadapter,
|
|||
case MLAN_OID_MISC_GET_CHAN_REGION_CFG:
|
||||
status = wlan_misc_chan_reg_cfg(pmadapter, pioctl_req);
|
||||
break;
|
||||
case MLAN_OID_MISC_REGION_POWER_CFG:
|
||||
status = wlan_misc_region_power_cfg(pmadapter, pioctl_req);
|
||||
break;
|
||||
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;
|
||||
|
@ -5357,9 +5297,21 @@ 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;
|
||||
case MLAN_OID_MISC_GPIO_CFG:
|
||||
status = wlan_misc_gpiocfg(pmadapter, pioctl_req);
|
||||
break;
|
||||
case MLAN_OID_MISC_BOOT_SLEEP:
|
||||
status = wlan_misc_bootsleep(pmadapter, pioctl_req);
|
||||
break;
|
||||
|
@ -5389,9 +5341,18 @@ 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);
|
||||
|
@ -5414,6 +5375,7 @@ 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);
|
||||
|
@ -5424,12 +5386,25 @@ 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;
|
||||
case MLAN_OID_MISC_TX_FRAME:
|
||||
status = wlan_misc_ioctl_tx_frame(pmadapter, pioctl_req);
|
||||
break;
|
||||
case MLAN_OID_MISC_EDMAC_CONFIG:
|
||||
status = wlan_misc_ioctl_edmac_cfg(pmadapter, pioctl_req);
|
||||
break;
|
||||
default:
|
||||
if (pioctl_req)
|
||||
pioctl_req->status_code = MLAN_ERROR_IOCTL_INVALID;
|
||||
|
@ -5514,8 +5489,7 @@ static mlan_status wlan_set_get_scan_cfg(pmlan_adapter pmadapter,
|
|||
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING --success,
|
||||
* otherwise fail
|
||||
*/
|
||||
static mlan_status wlan_scan_ioctl(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req)
|
||||
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;
|
||||
|
@ -5534,13 +5508,6 @@ static mlan_status wlan_scan_ioctl(pmlan_adapter pmadapter,
|
|||
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();
|
||||
|
@ -5639,10 +5606,20 @@ start_config:
|
|||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5747,6 +5724,18 @@ 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;
|
||||
|
||||
|
|
|
@ -33,25 +33,12 @@ Change log:
|
|||
#include "mlan_main.h"
|
||||
#include "mlan_11n_aggr.h"
|
||||
#include "mlan_11n_rxreorder.h"
|
||||
#ifdef DRV_EMBEDDED_SUPPLICANT
|
||||
#include "authenticator_api.h"
|
||||
#endif
|
||||
#include "mlan_11ax.h"
|
||||
|
||||
/********************************************************
|
||||
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 */
|
||||
|
@ -305,12 +292,14 @@ void wlan_process_tdls_action_frame(pmlan_private priv, t_u8 *pbuf, t_u32 len)
|
|||
break;
|
||||
case QOS_INFO:
|
||||
sta_ptr->qos_info = pos[2];
|
||||
sta_ptr->is_wmm_enabled = MTRUE;
|
||||
PRINTM(MDAT_D, "TDLS qos info %x\n", sta_ptr->qos_info);
|
||||
break;
|
||||
case VENDOR_SPECIFIC_221:
|
||||
pvendor_ie = (IEEEtypes_VendorHeader_t *)pos;
|
||||
if (!memcmp(priv->adapter, pvendor_ie->oui, wmm_oui,
|
||||
sizeof(wmm_oui))) {
|
||||
sta_ptr->is_wmm_enabled = MTRUE;
|
||||
sta_ptr->qos_info = pos[8]; /** qos info in wmm
|
||||
parameters in
|
||||
response and
|
||||
|
@ -416,6 +405,8 @@ 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;
|
||||
|
@ -426,10 +417,25 @@ 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_VHT) {
|
||||
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) {
|
||||
/* 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 */
|
||||
|
@ -452,8 +458,14 @@ 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.rate_info =
|
||||
(ldpc << 5) | (format << 3) | (bw << 1) | gi;
|
||||
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.bitrate =
|
||||
wlan_index_to_data_rate(priv->adapter, prx_pd->rx_rate,
|
||||
prx_pd->rate_info, ext_rate_info);
|
||||
|
@ -495,9 +507,6 @@ 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();
|
||||
|
@ -611,26 +620,11 @@ 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) {
|
||||
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;
|
||||
if (prx_pd->rx_pkt_type == PKT_TYPE_802DOT11) {
|
||||
pmbuf->flags |= MLAN_BUF_FLAG_NET_MONITOR;
|
||||
goto mon_process;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
mon_process:
|
||||
if (pmbuf->flags & MLAN_BUF_FLAG_NET_MONITOR) {
|
||||
|
@ -689,6 +683,15 @@ 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;
|
||||
|
@ -716,6 +719,13 @@ 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) !=
|
||||
|
@ -767,6 +777,112 @@ 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
|
||||
|
@ -803,7 +919,8 @@ mlan_status wlan_ops_sta_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
|
|||
prx_pd->nf);
|
||||
}
|
||||
}
|
||||
if (!sta_ptr || !sta_ptr->is_11n_enabled) {
|
||||
if (!sta_ptr || (!sta_ptr->is_11n_enabled &&
|
||||
!sta_ptr->is_11ax_enabled)) {
|
||||
wlan_process_rx_packet(pmadapter, pmbuf);
|
||||
goto done;
|
||||
}
|
||||
|
@ -820,9 +937,14 @@ 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)) {
|
||||
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 (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);
|
||||
|
||||
if (rx_pkt_type == PKT_TYPE_AMSDU) {
|
||||
pmbuf->data_len = prx_pd->rx_pkt_length;
|
||||
pmbuf->data_offset += prx_pd->rx_pkt_offset;
|
||||
|
|
|
@ -127,6 +127,11 @@ 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);
|
||||
|
@ -256,6 +261,12 @@ 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);
|
||||
|
|
|
@ -89,7 +89,85 @@ done:
|
|||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
Stats_mcast_drv_t gmcast_stats = {0};
|
||||
/* This flag is used to protect the mcast drv stat update
|
||||
* when it's value is copied to provide to mlanutl
|
||||
* MTRUE = Update is allowed
|
||||
* MFALSE = Update is not allowed
|
||||
*/
|
||||
t_u8 mcast_drv_update_allow_flag = MTRUE;
|
||||
#define DEST_MAC_OFFSET 10
|
||||
#define CYCLE_START 1
|
||||
#define FIVE_SEC 5000000 /* 1000000 usec = 1sec*/
|
||||
/**
|
||||
* @brief This function calculates the cycle delta and driver time delta
|
||||
* for Mcast packets
|
||||
*
|
||||
* @param pmadapter A pointer to pmlan_adapter structure
|
||||
* @param pmbuf A pointer to the mlan_buffer for process
|
||||
*
|
||||
* @return Nothing
|
||||
*/
|
||||
void wlan_drv_mcast_cycle_delay_calulation(pmlan_adapter pmadapter,
|
||||
pmlan_buffer pmbuf)
|
||||
{
|
||||
static t_u32 prev_mcast_sec = 0;
|
||||
static t_u32 prev_mcast_usec = 0;
|
||||
t_u32 curr_ts_sec = 0;
|
||||
t_u32 curr_ts_usec = 0;
|
||||
t_u64 cycle_delta = 0;
|
||||
t_u64 profile_delta = 0;
|
||||
|
||||
if (mcast_drv_update_allow_flag == MFALSE)
|
||||
return;
|
||||
/* Take current time */
|
||||
if (pmadapter && pmadapter->pmoal_handle)
|
||||
pmadapter->callbacks.moal_get_system_time(
|
||||
pmadapter->pmoal_handle, &curr_ts_sec, &curr_ts_usec);
|
||||
else
|
||||
PRINTM(MERROR, "ERR: pmadapter or pmoal_handle NULL\n",
|
||||
__func__);
|
||||
|
||||
if (curr_ts_sec || curr_ts_usec) {
|
||||
/* Calculate profile delta */
|
||||
profile_delta = (curr_ts_sec - pmbuf->in_ts_sec) * 1000000;
|
||||
profile_delta += (t_s32)(curr_ts_usec - pmbuf->in_ts_usec);
|
||||
|
||||
if ((profile_delta >= 0) && (profile_delta <= 1000))
|
||||
gmcast_stats.spent_time_under_1000usec++;
|
||||
else if ((profile_delta > 1000) && (profile_delta <= 2000))
|
||||
gmcast_stats.spent_time_over_1000usec++;
|
||||
else if ((profile_delta > 2000) && (profile_delta <= 3000))
|
||||
gmcast_stats.spent_time_over_2000usec++;
|
||||
else if (profile_delta > 3000)
|
||||
gmcast_stats.spent_time_over_3000usec++;
|
||||
}
|
||||
/* Process the start cycle data */
|
||||
cycle_delta = (pmbuf->in_ts_sec - prev_mcast_sec) * 1000000;
|
||||
cycle_delta += (t_s32)(pmbuf->in_ts_usec - prev_mcast_usec);
|
||||
|
||||
/* If start cycle delta is more than 5 sec ignore*/
|
||||
if ((pmbuf->u.mc_tx_info.mc_pkt_flags & (1 << CYCLE_START)) &&
|
||||
(cycle_delta < FIVE_SEC)) {
|
||||
if ((cycle_delta >= 0) && (cycle_delta <= 2300))
|
||||
gmcast_stats.cycle_recv_under_2300usec++;
|
||||
if ((cycle_delta > 2300) && (cycle_delta <= 2900))
|
||||
gmcast_stats.cycle_recv_in_time++;
|
||||
if ((cycle_delta > 2900) && (cycle_delta <= 3500))
|
||||
gmcast_stats.cycle_recv_over_2900usec++;
|
||||
if ((cycle_delta > 3500) && (cycle_delta <= 5000))
|
||||
gmcast_stats.cycle_recv_over_3500usec++;
|
||||
if ((cycle_delta > 5000) && (cycle_delta <= 10000))
|
||||
gmcast_stats.cycle_recv_over_5000usec++;
|
||||
if ((cycle_delta > 10000) && (cycle_delta <= 15000))
|
||||
gmcast_stats.cycle_recv_over_10000usec++;
|
||||
if (cycle_delta > 15000)
|
||||
gmcast_stats.cycle_recv_over_15000usec++;
|
||||
}
|
||||
/* Update the last received mcast cycle value */
|
||||
prev_mcast_sec = pmbuf->in_ts_sec;
|
||||
prev_mcast_usec = pmbuf->in_ts_usec;
|
||||
}
|
||||
/**
|
||||
* @brief This function checks the conditions and sends packet to device
|
||||
*
|
||||
|
@ -112,6 +190,7 @@ mlan_status wlan_process_tx(pmlan_private priv, pmlan_buffer pmbuf,
|
|||
#ifdef STA_SUPPORT
|
||||
PTxPD plocal_tx_pd = MNULL;
|
||||
#endif
|
||||
t_u8 dest_mac_first_octet = 0;
|
||||
|
||||
ENTER();
|
||||
head_ptr = (t_u8 *)priv->ops.process_txpd(priv, pmbuf);
|
||||
|
@ -124,6 +203,11 @@ mlan_status wlan_process_tx(pmlan_private priv, pmlan_buffer pmbuf,
|
|||
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_STA)
|
||||
plocal_tx_pd = (TxPD *)(head_ptr + priv->intf_hr_len);
|
||||
#endif
|
||||
dest_mac_first_octet = *(head_ptr + priv->intf_hr_len + sizeof(TxPD) +
|
||||
DEST_MAC_OFFSET);
|
||||
|
||||
if (dest_mac_first_octet & 0x01)
|
||||
wlan_drv_mcast_cycle_delay_calulation(pmadapter, pmbuf);
|
||||
if (pmadapter->tp_state_on)
|
||||
pmadapter->callbacks.moal_tp_accounting(pmadapter->pmoal_handle,
|
||||
pmbuf, 4);
|
||||
|
@ -315,7 +399,28 @@ t_void wlan_add_buf_bypass_txqueue(mlan_adapter *pmadapter, pmlan_buffer pmbuf)
|
|||
*/
|
||||
INLINE t_u8 wlan_bypass_tx_list_empty(mlan_adapter *pmadapter)
|
||||
{
|
||||
return (pmadapter->bypass_pkt_count) ? MFALSE : MTRUE;
|
||||
#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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -364,6 +469,11 @@ 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,
|
||||
|
@ -420,3 +530,57 @@ 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;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -3,7 +3,7 @@
|
|||
* @brief This file contains the handling of AP mode ioctls
|
||||
*
|
||||
*
|
||||
* Copyright 2009-2022 NXP
|
||||
* Copyright 2009-2023 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -62,7 +62,7 @@ static mlan_status wlan_uap_bss_ioctl_stop(pmlan_adapter pmadapter,
|
|||
|
||||
ENTER();
|
||||
|
||||
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_BSS_STOP,
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_BSS_STOP,
|
||||
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
|
||||
MNULL);
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
|
@ -83,7 +83,8 @@ 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 ((GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP)) {
|
||||
if (!priv->adapter->mc_policy &&
|
||||
(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);
|
||||
|
@ -124,10 +125,6 @@ static mlan_status wlan_uap_callback_bss_ioctl_start(t_void *priv)
|
|||
!wlan_can_radar_det_skip(pmpriv) &&
|
||||
wlan_11h_radar_detect_required(pmpriv,
|
||||
puap_state_chan_cb->channel)) {
|
||||
dfs_state = wlan_get_chan_dfs_state(
|
||||
pmpriv, BAND_A, puap_state_chan_cb->channel);
|
||||
if (dfs_state == DFS_AVAILABLE)
|
||||
goto prep_bss_start;
|
||||
/* If DFS repeater mode is on then before starting the uAP
|
||||
* make sure that mlan0 is connected to some external AP
|
||||
* for DFS channel operations.
|
||||
|
@ -154,7 +151,10 @@ static mlan_status wlan_uap_callback_bss_ioctl_start(t_void *priv)
|
|||
goto prep_bss_start;
|
||||
}
|
||||
}
|
||||
|
||||
dfs_state = wlan_get_chan_dfs_state(
|
||||
pmpriv, BAND_A, puap_state_chan_cb->channel);
|
||||
if (dfs_state == DFS_AVAILABLE)
|
||||
goto prep_bss_start;
|
||||
/* first check if channel is under NOP */
|
||||
if (wlan_11h_is_channel_under_nop(
|
||||
pmpriv->adapter, puap_state_chan_cb->channel)) {
|
||||
|
@ -253,7 +253,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, HOST_CMD_APCMD_BSS_START,
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_BSS_START,
|
||||
HostCmd_ACT_GEN_SET, 0,
|
||||
(t_void *)puap_state_chan_cb->pioctl_req_curr,
|
||||
MNULL);
|
||||
|
@ -286,13 +286,6 @@ 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 &&
|
||||
|
@ -311,7 +304,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, HOST_CMD_APCMD_BSS_START,
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_BSS_START,
|
||||
HostCmd_ACT_GEN_SET, 0,
|
||||
(t_void *)pioctl_req, MNULL);
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
|
@ -362,7 +355,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, HOST_CMD_APCMD_SYS_RESET,
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_RESET,
|
||||
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
|
||||
MNULL);
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
|
@ -425,8 +418,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, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
|
||||
0, (t_void *)pioctl_req, MNULL);
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
|
||||
cmd_action, 0, (t_void *)pioctl_req, MNULL);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
|
@ -457,8 +450,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, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
|
||||
0, (t_void *)pioctl_req, MNULL);
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
|
||||
cmd_action, 0, (t_void *)pioctl_req, MNULL);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
|
@ -488,8 +481,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, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
|
||||
0, (t_void *)pioctl_req, MNULL);
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
|
||||
cmd_action, 0, (t_void *)pioctl_req, MNULL);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
|
@ -521,8 +514,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, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
|
||||
0, (t_void *)pioctl_req, MNULL);
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
|
||||
cmd_action, 0, (t_void *)pioctl_req, MNULL);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
|
@ -553,8 +546,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, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
|
||||
0, (t_void *)pioctl_req, MNULL);
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
|
||||
cmd_action, 0, (t_void *)pioctl_req, MNULL);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
|
@ -587,7 +580,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, HOST_CMD_APCMD_OPER_CTRL,
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_OPER_CTRL,
|
||||
cmd_action, 0, (t_void *)pioctl_req,
|
||||
(t_void *)pioctl_req->pbuf);
|
||||
|
||||
|
@ -697,8 +690,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, HOST_CMD_APCMD_SYS_CONFIGURE, cmd_action,
|
||||
0, (t_void *)pioctl_req, MNULL);
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
|
||||
cmd_action, 0, (t_void *)pioctl_req, MNULL);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
|
@ -725,7 +718,14 @@ 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, HOST_CMD_APCMD_STA_DEAUTH,
|
||||
|
||||
/*
|
||||
* Clean up station's ralist, to stop and flush pending traffic
|
||||
* before uAP sending deauth command to FW.
|
||||
*/
|
||||
wlan_wmm_delete_peer_ralist(pmpriv, bss->param.deauth_param.mac_addr);
|
||||
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_STA_DEAUTH,
|
||||
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
|
||||
(t_void *)&bss->param.deauth_param);
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
|
@ -752,7 +752,7 @@ static mlan_status wlan_uap_get_sta_list(pmlan_adapter pmadapter,
|
|||
ENTER();
|
||||
|
||||
/* Send request to firmware */
|
||||
ret = wlan_prepare_cmd(pmpriv, HOST_CMD_APCMD_STA_LIST,
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_STA_LIST,
|
||||
HostCmd_ACT_GEN_GET, 0, (t_void *)pioctl_req,
|
||||
MNULL);
|
||||
|
||||
|
@ -915,7 +915,7 @@ static mlan_status wlan_uap_set_wapi_ie(mlan_private *priv,
|
|||
}
|
||||
|
||||
/* Send request to firmware */
|
||||
ret = wlan_prepare_cmd(priv, HOST_CMD_APCMD_SYS_CONFIGURE,
|
||||
ret = wlan_prepare_cmd(priv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
|
||||
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
|
||||
MNULL);
|
||||
|
||||
|
@ -1020,7 +1020,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, HOST_CMD_APCMD_REPORT_MIC,
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_REPORT_MIC,
|
||||
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
|
||||
(t_void *)sec->param.sta_mac);
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
|
@ -1049,7 +1049,8 @@ wlan_uap_sec_ioctl_set_encrypt_key(pmlan_adapter pmadapter,
|
|||
|
||||
ENTER();
|
||||
sec = (mlan_ds_sec_cfg *)pioctl_req->pbuf;
|
||||
if (pioctl_req->action != MLAN_ACT_SET) {
|
||||
if ((pioctl_req->action != MLAN_ACT_SET) &&
|
||||
(pioctl_req->action != MLAN_ACT_PASN_KEY_DNLD)) {
|
||||
pioctl_req->status_code = MLAN_ERROR_IOCTL_INVALID;
|
||||
LEAVE();
|
||||
return MLAN_STATUS_FAILURE;
|
||||
|
@ -1062,7 +1063,7 @@ wlan_uap_sec_ioctl_set_encrypt_key(pmlan_adapter pmadapter,
|
|||
}
|
||||
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11_KEY_MATERIAL,
|
||||
HostCmd_ACT_GEN_SET, KEY_INFO_ENABLED,
|
||||
pioctl_req->action, KEY_INFO_ENABLED,
|
||||
(t_void *)pioctl_req, &sec->param.encrypt_key);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
|
@ -1451,9 +1452,10 @@ static mlan_status wlan_uap_callback_11h_channel_check_req(t_void *priv)
|
|||
dfs_state = wlan_get_chan_dfs_state(
|
||||
pmpriv, BAND_A, puap_state_chan_cb->channel);
|
||||
if (dfs_state == DFS_AVAILABLE) {
|
||||
wlan_11h_set_dfs_check_chan(
|
||||
pmpriv, puap_state_chan_cb->channel);
|
||||
PRINTM(MCMND, "ZERODFS: Channel %d is Avaliable\n",
|
||||
wlan_11h_set_dfs_check_chan(pmpriv,
|
||||
puap_state_chan_cb->channel,
|
||||
pband_cfg->chanWidth);
|
||||
PRINTM(MCMND, "DFS: Channel %d is Avaliable\n",
|
||||
puap_state_chan_cb->channel);
|
||||
pcb->moal_ioctl_complete(pmpriv->adapter->pmoal_handle,
|
||||
pioctl, MLAN_STATUS_COMPLETE);
|
||||
|
@ -1538,6 +1540,28 @@ static mlan_status wlan_uap_11h_channel_check_req(pmlan_adapter pmadapter,
|
|||
pmpriv->adapter->dfs_test_params
|
||||
.user_cac_period_msec;
|
||||
}
|
||||
if (pmpriv->adapter->dfs_test_params.cac_restart &&
|
||||
p11h_cfg->param.chan_rpt_req.millisec_dwell_time) {
|
||||
pmpriv->adapter->dfs_test_params.chan =
|
||||
p11h_cfg->param.chan_rpt_req.chanNum;
|
||||
pmpriv->adapter->dfs_test_params
|
||||
.millisec_dwell_time =
|
||||
p11h_cfg->param.chan_rpt_req
|
||||
.millisec_dwell_time;
|
||||
memcpy_ext(
|
||||
pmpriv->adapter,
|
||||
&pmpriv->adapter->dfs_test_params
|
||||
.bandcfg,
|
||||
&p11h_cfg->param.chan_rpt_req.bandcfg,
|
||||
sizeof(Band_Config_t),
|
||||
sizeof(Band_Config_t));
|
||||
}
|
||||
if (p11h_cfg->param.chan_rpt_req.millisec_dwell_time)
|
||||
PRINTM(MMSG,
|
||||
"11h: issuing DFS Radar check for channel=%d."
|
||||
" Please wait for response...\n",
|
||||
p11h_cfg->param.chan_rpt_req.chanNum);
|
||||
|
||||
ret = wlan_prepare_cmd(
|
||||
pmpriv, HostCmd_CMD_CHAN_REPORT_REQUEST,
|
||||
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
|
||||
|
@ -1719,7 +1743,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_APCMD_ACS_SCAN,
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_ACS_SCAN,
|
||||
HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
|
||||
MNULL);
|
||||
|
||||
|
@ -1752,7 +1776,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, HOST_CMD_APCMD_SYS_CONFIGURE,
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
|
||||
HostCmd_ACT_GEN_GET, 0, MNULL, &tlv_chan_band);
|
||||
LEAVE();
|
||||
return ret;
|
||||
|
@ -1781,7 +1805,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, HOST_CMD_APCMD_SYS_CONFIGURE,
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_APCMD_SYS_CONFIGURE,
|
||||
HostCmd_ACT_GEN_SET, 0, MNULL, &tlv_chan_band);
|
||||
LEAVE();
|
||||
return ret;
|
||||
|
@ -1817,12 +1841,45 @@ 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, HOST_CMD_APCMD_SYS_CONFIGURE,
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_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.
|
||||
*
|
||||
|
@ -1860,6 +1917,43 @@ static mlan_status wlan_uap_snmp_mib_ctrl_deauth(pmlan_adapter pmadapter,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set/Get channel tracking control.
|
||||
*
|
||||
* @param pmadapter A pointer to mlan_adapter structure
|
||||
* @param pioctl_req A pointer to ioctl request buffer
|
||||
*
|
||||
* @return MLAN_STATUS_PENDING --success, otherwise fail
|
||||
*/
|
||||
static mlan_status wlan_uap_snmp_mib_chan_track(pmlan_adapter pmadapter,
|
||||
pmlan_ioctl_req pioctl_req)
|
||||
{
|
||||
mlan_private *pmpriv = pmadapter->priv[pioctl_req->bss_index];
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
mlan_ds_snmp_mib *mib = (mlan_ds_snmp_mib *)pioctl_req->pbuf;
|
||||
t_u16 cmd_action = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
mib = (mlan_ds_snmp_mib *)pioctl_req->pbuf;
|
||||
if (pioctl_req->action == MLAN_ACT_SET) {
|
||||
cmd_action = HostCmd_ACT_GEN_SET;
|
||||
} else {
|
||||
cmd_action = HostCmd_ACT_GEN_GET;
|
||||
}
|
||||
|
||||
/* Send command to firmware */
|
||||
ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_802_11_SNMP_MIB, cmd_action,
|
||||
ChanTrackParam_i, (t_void *)pioctl_req,
|
||||
&mib->param.chan_track);
|
||||
|
||||
if (ret == MLAN_STATUS_SUCCESS)
|
||||
ret = MLAN_STATUS_PENDING;
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MLAN uap ioctl handler
|
||||
*
|
||||
|
@ -1885,9 +1979,6 @@ 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) {
|
||||
|
@ -1952,25 +2043,9 @@ 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;
|
||||
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
|
||||
#ifdef STA_SUPPORT
|
||||
case MLAN_IOCTL_SCAN:
|
||||
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;
|
||||
}
|
||||
status = wlan_scan_ioctl(pmadapter, pioctl_req);
|
||||
break;
|
||||
#endif
|
||||
case MLAN_IOCTL_GET_INFO:
|
||||
|
@ -2009,6 +2084,8 @@ 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 =
|
||||
|
@ -2056,6 +2133,15 @@ 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;
|
||||
pget_info->param.fw_info.cmd_tx_data =
|
||||
IS_FW_SUPPORT_CMD_TX_DATA(pmadapter) ? 0x01 :
|
||||
0x00;
|
||||
pget_info->param.fw_info.sec_rgpower =
|
||||
IS_FW_SUPPORT_SEC_RG_POWER(pmadapter) ? 0x01 :
|
||||
0x00;
|
||||
|
||||
} else if (pget_info->sub_command == MLAN_OID_LINK_STATS)
|
||||
status = wlan_ioctl_link_statistic(pmpriv, pioctl_req);
|
||||
break;
|
||||
|
@ -2071,6 +2157,17 @@ 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);
|
||||
|
@ -2098,11 +2195,15 @@ 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);
|
||||
#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
|
||||
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 WIFI_DIRECT_SUPPORT
|
||||
if (misc->sub_command == MLAN_OID_MISC_WIFI_DIRECT_CONFIG)
|
||||
status = wlan_misc_p2p_config(pmadapter, pioctl_req);
|
||||
|
@ -2130,10 +2231,19 @@ 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)
|
||||
|
@ -2156,9 +2266,17 @@ 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);
|
||||
|
@ -2177,6 +2295,12 @@ 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);
|
||||
|
@ -2196,6 +2320,9 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
|
|||
pioctl_req);
|
||||
if (misc->sub_command == MLAN_OID_MISC_GET_REGIONPWR_CFG)
|
||||
status = wlan_get_rgchnpwr_cfg(pmadapter, pioctl_req);
|
||||
if (misc->sub_command == MLAN_OID_MISC_REGION_POWER_CFG)
|
||||
status = wlan_misc_region_power_cfg(pmadapter,
|
||||
pioctl_req);
|
||||
if (misc->sub_command == MLAN_OID_MISC_CFP_TABLE)
|
||||
status = wlan_get_cfp_table(pmadapter, pioctl_req);
|
||||
if (misc->sub_command == MLAN_OID_MISC_RANGE_EXT)
|
||||
|
@ -2204,6 +2331,20 @@ 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);
|
||||
if (misc->sub_command == MLAN_OID_MISC_TX_FRAME)
|
||||
status =
|
||||
wlan_misc_ioctl_tx_frame(pmadapter, pioctl_req);
|
||||
if (misc->sub_command == MLAN_OID_MISC_EDMAC_CONFIG)
|
||||
status = wlan_misc_ioctl_edmac_cfg(pmadapter,
|
||||
pioctl_req);
|
||||
break;
|
||||
case MLAN_IOCTL_POWER_CFG:
|
||||
power = (mlan_ds_power_cfg *)pioctl_req->pbuf;
|
||||
|
@ -2240,6 +2381,9 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
|
|||
if (snmp->sub_command == MLAN_OID_SNMP_MIB_DOT11H_FAKERADAR)
|
||||
status = wlan_uap_snmp_mib_11h_fakeradar(pmadapter,
|
||||
pioctl_req);
|
||||
if (snmp->sub_command == MLAN_OID_SNMP_MIB_CHAN_TRACK)
|
||||
status = wlan_uap_snmp_mib_chan_track(pmadapter,
|
||||
pioctl_req);
|
||||
break;
|
||||
case MLAN_IOCTL_SEC_CFG:
|
||||
sec = (mlan_ds_sec_cfg *)pioctl_req->pbuf;
|
||||
|
@ -2275,6 +2419,9 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
|
|||
if (cfg11h->sub_command == MLAN_OID_11H_CHAN_NOP_INFO)
|
||||
status = wlan_11h_ioctl_channel_nop_info(pmadapter,
|
||||
pioctl_req);
|
||||
if (cfg11h->sub_command == MLAN_OID_11H_NOP_CHAN_LIST)
|
||||
status = wlan_11h_ioctl_nop_channel_list(pmadapter,
|
||||
pioctl_req);
|
||||
if (cfg11h->sub_command == MLAN_OID_11H_CHAN_REPORT_REQUEST)
|
||||
status = wlan_11h_ioctl_dfs_chan_report(pmpriv,
|
||||
pioctl_req);
|
||||
|
@ -2287,6 +2434,8 @@ mlan_status wlan_ops_uap_ioctl(t_void *adapter, pmlan_ioctl_req pioctl_req)
|
|||
if (cfg11h->sub_command == MLAN_OID_11H_DFS_W53_CFG)
|
||||
status = wlan_11h_ioctl_dfs_w53_cfg(pmadapter,
|
||||
pioctl_req);
|
||||
if (cfg11h->sub_command == MLAN_OID_11H_DFS_MODE)
|
||||
status = wlan_11h_ioctl_dfs_mode(pmadapter, pioctl_req);
|
||||
break;
|
||||
case MLAN_IOCTL_RADIO_CFG:
|
||||
radiocfg = (mlan_ds_radio_cfg *)pioctl_req->pbuf;
|
||||
|
|
|
@ -36,9 +36,6 @@ 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
|
||||
|
@ -65,7 +62,13 @@ static mlan_status wlan_upload_uap_rx_packet(pmlan_adapter pmadapter,
|
|||
prx_pd = (RxPD *)(pmbuf->pbuf + pmbuf->data_offset);
|
||||
|
||||
/* Chop off RxPD */
|
||||
pmbuf->data_len -= prx_pd->rx_pkt_offset;
|
||||
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_offset += prx_pd->rx_pkt_offset;
|
||||
pmbuf->pparent = MNULL;
|
||||
|
||||
|
@ -89,7 +92,6 @@ 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
|
||||
|
@ -244,6 +246,11 @@ 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) {
|
||||
|
@ -336,14 +343,20 @@ 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();
|
||||
|
@ -380,6 +393,14 @@ 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,
|
||||
|
@ -420,6 +441,112 @@ 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;
|
||||
|
@ -435,7 +562,11 @@ mlan_status wlan_ops_uap_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
|
|||
}
|
||||
}
|
||||
|
||||
sta_ptr = wlan_get_station_entry(priv, prx_pkt->eth803_hdr.src_addr);
|
||||
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);
|
||||
if (sta_ptr) {
|
||||
sta_ptr->snr = prx_pd->snr;
|
||||
sta_ptr->nf = prx_pd->nf;
|
||||
|
@ -443,26 +574,24 @@ 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;
|
||||
}
|
||||
|
||||
#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 (rx_pkt_type != PKT_TYPE_BAR) {
|
||||
sta_ptr->stats.rx_packets++;
|
||||
sta_ptr->stats.rx_bytes += prx_pd->rx_pkt_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 (pmadapter->enable_net_mon &&
|
||||
(prx_pd->rx_pkt_type == PKT_TYPE_802DOT11)) {
|
||||
wlan_process_uap_rx_packet(priv, pmbuf);
|
||||
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);
|
||||
if ((rx_pkt_type != PKT_TYPE_BAR) && (prx_pd->priority < MAX_NUM_TID)) {
|
||||
sta_ptr = wlan_get_station_entry(priv, ta);
|
||||
if (sta_ptr) {
|
||||
|
@ -472,7 +601,7 @@ mlan_status wlan_ops_uap_process_rx_packet(t_void *adapter, pmlan_buffer pmbuf)
|
|||
}
|
||||
}
|
||||
/* check if UAP enable 11n */
|
||||
if (!priv->is_11n_enabled ||
|
||||
if ((!priv->is_11n_enabled && !priv->is_11ax_enabled) ||
|
||||
(!wlan_11n_get_rxreorder_tbl((mlan_private *)priv, prx_pd->priority,
|
||||
ta) &&
|
||||
(prx_pd->rx_pkt_type != PKT_TYPE_AMSDU))) {
|
||||
|
@ -671,8 +800,10 @@ 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) {
|
||||
pmbuf->flags |= MLAN_BUF_FLAG_NET_MONITOR;
|
||||
goto upload;
|
||||
if (prx_pd->rx_pkt_type == PKT_TYPE_802DOT11) {
|
||||
pmbuf->flags |= MLAN_BUF_FLAG_NET_MONITOR;
|
||||
goto upload;
|
||||
}
|
||||
}
|
||||
|
||||
/* don't do packet forwarding in disconnected state */
|
||||
|
|
|
@ -44,6 +44,7 @@ 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
|
||||
|
@ -52,6 +53,7 @@ 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
|
||||
|
||||
|
@ -61,6 +63,7 @@ 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
|
||||
|
||||
|
@ -70,6 +73,7 @@ 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
|
||||
|
||||
|
@ -80,6 +84,7 @@ 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
|
||||
|
||||
|
@ -90,16 +95,18 @@ 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 USBNW62X
|
||||
static const struct _mlan_card_info mlan_card_info_usbNW62X = {
|
||||
#ifdef USBIW624
|
||||
static const struct _mlan_card_info mlan_card_info_usbIW624 = {
|
||||
.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
|
||||
|
||||
|
@ -255,8 +262,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(USBNW62X)
|
||||
if (IS_USBNW62X(pmadapter->card_type))
|
||||
#if defined(USBIW624)
|
||||
if (IS_USBIW624(pmadapter->card_type))
|
||||
check_fw_status = MTRUE;
|
||||
#endif
|
||||
|
||||
|
@ -366,6 +373,16 @@ static mlan_status wlan_usb_prog_fw_w_helper(pmlan_adapter pmadapter,
|
|||
break;
|
||||
}
|
||||
|
||||
if (check_fw_status &&
|
||||
(SyncFWHeader.status & MBIT(9))) {
|
||||
PRINTM(MERROR,
|
||||
"FW received Blk with SE_BOOT error 0x%x\n",
|
||||
SyncFWHeader.status);
|
||||
retries = 0;
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check the firmware block response for CRC errors */
|
||||
if (SyncFWHeader.cmd) {
|
||||
/* Check firmware block response for CRC and MIC
|
||||
|
@ -470,10 +487,11 @@ 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 (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 (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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -678,7 +696,8 @@ static inline t_void wlan_usb_tx_send_aggr(pmlan_adapter pmadapter,
|
|||
}
|
||||
|
||||
if (pmbuf_aggr && pmbuf_aggr->data_len) {
|
||||
pmadapter->data_sent = MTRUE;
|
||||
wlan_update_port_status(pmadapter, pusb_tx_aggr->port, MTRUE);
|
||||
pmadapter->data_sent = wlan_usb_data_sent(pmadapter);
|
||||
ret = pmadapter->callbacks.moal_write_data_async(
|
||||
pmadapter->pmoal_handle, pmbuf_aggr,
|
||||
pusb_tx_aggr->port);
|
||||
|
@ -700,6 +719,8 @@ 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",
|
||||
|
@ -709,6 +730,8 @@ 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:
|
||||
|
@ -783,9 +806,9 @@ mlan_status wlan_get_usb_device(pmlan_adapter pmadapter)
|
|||
pmadapter->pcard_info = &mlan_card_info_usb9097;
|
||||
break;
|
||||
#endif
|
||||
#ifdef USBNW62X
|
||||
case CARD_TYPE_USBNW62X:
|
||||
pmadapter->pcard_info = &mlan_card_info_usbNW62X;
|
||||
#ifdef USBIW624
|
||||
case CARD_TYPE_USBIW624:
|
||||
pmadapter->pcard_info = &mlan_card_info_usbIW624;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
@ -954,13 +977,16 @@ 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;
|
||||
if (pusb_tx_aggr->pmbuf_aggr && !pmadapter->data_sent &&
|
||||
port_index = wlan_get_port_index(pmadapter, pusb_tx_aggr->port);
|
||||
if (pusb_tx_aggr->pmbuf_aggr &&
|
||||
wlan_is_port_ready(pmadapter, port_index) &&
|
||||
!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,
|
||||
|
@ -1125,6 +1151,98 @@ 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.
|
||||
*
|
||||
|
@ -1187,7 +1305,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(USBNW62X))
|
||||
#if (defined(USB9098) || defined(USB9097) || defined(USBIW624))
|
||||
|| type == MLAN_TYPE_VDLL
|
||||
#endif
|
||||
) {
|
||||
|
@ -1204,7 +1322,9 @@ 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->data_sent = MTRUE;
|
||||
pmadapter->pcard_usb->usb_port_status[pmpriv->port_index] =
|
||||
MTRUE;
|
||||
pmadapter->data_sent = wlan_usb_data_sent(pmadapter);
|
||||
ret = pmadapter->callbacks.moal_write_data_async(
|
||||
pmadapter->pmoal_handle, pmbuf, pmpriv->port);
|
||||
switch (ret) {
|
||||
|
@ -1215,9 +1335,13 @@ 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:
|
||||
|
@ -1232,18 +1356,36 @@ static mlan_status wlan_usb_host_to_card(pmlan_private pmpriv, t_u8 type,
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief This function handle event/cmd complete
|
||||
* @brief This function handle event 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_cmdevt_complete(pmlan_adapter pmadapter,
|
||||
mlan_buffer *pmbuf,
|
||||
mlan_status status)
|
||||
static mlan_status wlan_usb_evt_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);
|
||||
|
||||
|
@ -1295,9 +1437,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_cmdevt_complete,
|
||||
.event_complete = wlan_usb_evt_complete,
|
||||
.data_complete = wlan_usb_data_complete,
|
||||
.cmdrsp_complete = wlan_usb_cmdevt_complete,
|
||||
.cmdrsp_complete = wlan_usb_cmd_complete,
|
||||
.handle_rx_packet = wlan_usb_handle_rx_packet,
|
||||
|
||||
.intf_header_len = USB_INTF_HEADER_LEN,
|
||||
|
|
|
@ -47,6 +47,11 @@ 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)
|
||||
|
||||
|
@ -403,8 +408,10 @@ 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
|
||||
* @return Value after offset or 0 if (scalar_value + offset)
|
||||
* overflows
|
||||
*/
|
||||
#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),
|
||||
|
@ -414,7 +421,10 @@ static INLINE t_s32 util_scalar_offset(
|
|||
|
||||
if (moal_spin_lock)
|
||||
moal_spin_lock(pmoal_handle, pscalar->plock);
|
||||
newval = (pscalar->value += offset);
|
||||
if (pscalar->value < (INT_MAX - offset))
|
||||
newval = (pscalar->value += offset);
|
||||
else
|
||||
newval = 0;
|
||||
if (moal_spin_unlock)
|
||||
moal_spin_unlock(pmoal_handle, pscalar->plock);
|
||||
|
||||
|
@ -492,4 +502,17 @@ 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_ */
|
||||
|
|
|
@ -34,6 +34,7 @@ Change log:
|
|||
#include "mlan_main.h"
|
||||
#include "mlan_wmm.h"
|
||||
#include "mlan_11n.h"
|
||||
#include "mlan_11ax.h"
|
||||
#ifdef SDIO
|
||||
#include "mlan_sdio.h"
|
||||
#endif /* SDIO */
|
||||
|
@ -316,8 +317,7 @@ static mlan_wmm_ac_e wlan_wmm_eval_downgrade_ac(pmlan_private priv,
|
|||
*
|
||||
* @return WMM AC Queue mapping of the IP TOS field
|
||||
*/
|
||||
static INLINE mlan_wmm_ac_e wlan_wmm_convert_tos_to_ac(pmlan_adapter pmadapter,
|
||||
t_u32 tos)
|
||||
mlan_wmm_ac_e wlan_wmm_convert_tos_to_ac(pmlan_adapter pmadapter, t_u32 tos)
|
||||
{
|
||||
ENTER();
|
||||
|
||||
|
@ -660,6 +660,18 @@ 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,
|
||||
|
@ -1088,7 +1100,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->pdesc, 3);
|
||||
pmadapter->pmoal_handle, pmbuf, 3);
|
||||
if (pmadapter->tp_state_drop_point == 3) {
|
||||
pmbuf = (pmlan_buffer)util_dequeue_list(
|
||||
pmadapter->pmoal_handle, &ptr->buf_head,
|
||||
|
@ -1110,7 +1122,7 @@ static int wlan_dequeue_tx_packet(pmlan_adapter pmadapter)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!ptr->is_wmm_enabled ||
|
||||
if (!ptr->is_wmm_enabled || priv->adapter->remain_on_channel ||
|
||||
(ptr->ba_status || ptr->del_ba_count >= DEL_BA_THRESHOLD)
|
||||
#ifdef STA_SUPPORT
|
||||
|| priv->wps.session_enable
|
||||
|
@ -1136,7 +1148,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_INPROGRESS);
|
||||
BA_STREAM_SETUP_SENT_ADDBA);
|
||||
wlan_send_addba(priv, tid, ptr->ra);
|
||||
}
|
||||
} else if (wlan_find_stream_to_delete(priv, ptr, tid,
|
||||
|
@ -1148,6 +1160,9 @@ 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);
|
||||
}
|
||||
|
@ -1445,8 +1460,9 @@ t_u8 wlan_get_random_ba_threshold(pmlan_adapter pmadapter)
|
|||
sec = (sec & 0xFFFF) + (sec >> 16);
|
||||
usec = (usec & 0xFFFF) + (usec >> 16);
|
||||
|
||||
ba_threshold = (((sec << 16) + usec) % BA_SETUP_MAX_PACKET_THRESHOLD) +
|
||||
pmadapter->min_ba_threshold;
|
||||
ba_threshold =
|
||||
(t_u8)((((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);
|
||||
|
@ -1642,6 +1658,47 @@ void wlan_wmm_setup_ac_downgrade(pmlan_private priv)
|
|||
LEAVE();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function checks whether a station has WMM enabled or not
|
||||
*
|
||||
* @param priv A pointer to mlan_private
|
||||
* @param mac station mac address
|
||||
* @return MTRUE or MFALSE
|
||||
*/
|
||||
static t_u8 is_station_wmm_enabled(mlan_private *priv, t_u8 *mac)
|
||||
{
|
||||
sta_node *sta_ptr = MNULL;
|
||||
sta_ptr = wlan_get_station_entry(priv, mac);
|
||||
if (sta_ptr) {
|
||||
if (sta_ptr->is_11n_enabled || sta_ptr->is_11ax_enabled)
|
||||
return MTRUE;
|
||||
}
|
||||
return MFALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function checks whether wmm is supported
|
||||
*
|
||||
* @param priv A pointer to mlan_private
|
||||
* @param ra Address of the receiver STA
|
||||
*
|
||||
* @return MTRUE or MFALSE
|
||||
*/
|
||||
static int wlan_is_wmm_enabled(mlan_private *priv, t_u8 *ra)
|
||||
{
|
||||
int ret = MFALSE;
|
||||
ENTER();
|
||||
#ifdef UAP_SUPPORT
|
||||
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_UAP) {
|
||||
if ((!(ra[0] & 0x01)) &&
|
||||
(priv->is_11n_enabled || priv->is_11ax_enabled))
|
||||
ret = is_station_wmm_enabled(priv, ra);
|
||||
}
|
||||
#endif /* UAP_SUPPORT */
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Allocate and add a RA list for all TIDs with the given RA
|
||||
*
|
||||
|
@ -1668,7 +1725,7 @@ void wlan_ralist_add(mlan_private *priv, t_u8 *ra)
|
|||
ra_list->ba_status = BA_STREAM_NOT_SETUP;
|
||||
ra_list->amsdu_in_ampdu = MFALSE;
|
||||
if (queuing_ra_based(priv)) {
|
||||
ra_list->is_wmm_enabled = wlan_is_11n_enabled(priv, ra);
|
||||
ra_list->is_wmm_enabled = wlan_is_wmm_enabled(priv, ra);
|
||||
if (ra_list->is_wmm_enabled)
|
||||
ra_list->max_amsdu =
|
||||
get_station_max_amsdu_size(priv, ra);
|
||||
|
@ -1679,7 +1736,7 @@ void wlan_ralist_add(mlan_private *priv, t_u8 *ra)
|
|||
status = wlan_get_tdls_link_status(priv, ra);
|
||||
if (MTRUE == wlan_is_tdls_link_setup(status)) {
|
||||
ra_list->is_wmm_enabled =
|
||||
is_station_11n_enabled(priv, ra);
|
||||
is_station_wmm_enabled(priv, ra);
|
||||
if (ra_list->is_wmm_enabled)
|
||||
ra_list->max_amsdu =
|
||||
get_station_max_amsdu_size(priv,
|
||||
|
@ -1819,6 +1876,12 @@ t_void wlan_wmm_init(pmlan_adapter pmadapter)
|
|||
MLAN_WFD_AMPDU_DEF_TXRXWINSIZE;
|
||||
}
|
||||
#endif
|
||||
if (priv->bss_type == MLAN_BSS_TYPE_NAN) {
|
||||
priv->add_ba_param.tx_win_size =
|
||||
MLAN_NAN_AMPDU_DEF_TXRXWINSIZE;
|
||||
priv->add_ba_param.rx_win_size =
|
||||
MLAN_NAN_AMPDU_DEF_TXRXWINSIZE;
|
||||
}
|
||||
#ifdef UAP_SUPPORT
|
||||
if (priv->bss_type == MLAN_BSS_TYPE_UAP) {
|
||||
priv->add_ba_param.tx_win_size =
|
||||
|
@ -1903,6 +1966,10 @@ 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,
|
||||
|
@ -2009,7 +2076,7 @@ int wlan_ralist_update(mlan_private *priv, t_u8 *old_ra, t_u8 *new_ra)
|
|||
|
||||
if (queuing_ra_based(priv)) {
|
||||
ra_list->is_wmm_enabled =
|
||||
wlan_is_11n_enabled(priv, new_ra);
|
||||
wlan_is_wmm_enabled(priv, new_ra);
|
||||
if (ra_list->is_wmm_enabled)
|
||||
ra_list->max_amsdu =
|
||||
get_station_max_amsdu_size(
|
||||
|
@ -2098,8 +2165,13 @@ 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 {
|
||||
memcpy_ext(pmadapter, ra, pmbuf->pbuf + pmbuf->data_offset,
|
||||
MLAN_MAC_ADDR_LENGTH, MLAN_MAC_ADDR_LENGTH);
|
||||
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);
|
||||
/** put multicast/broadcast packet in the same ralist */
|
||||
if (ra[0] & 0x01)
|
||||
memset(pmadapter, ra, 0xff, sizeof(ra));
|
||||
|
@ -2107,6 +2179,8 @@ t_void wlan_wmm_add_buf_txqueue(pmlan_adapter pmadapter, pmlan_buffer pmbuf)
|
|||
else if (priv->bss_type == MLAN_BSS_TYPE_UAP) {
|
||||
sta_ptr = wlan_get_station_entry(priv, ra);
|
||||
if (sta_ptr) {
|
||||
sta_ptr->stats.tx_bytes += pmbuf->data_len;
|
||||
sta_ptr->stats.tx_packets++;
|
||||
if (!sta_ptr->is_wmm_enabled &&
|
||||
!priv->is_11ac_enabled) {
|
||||
tid_down = wlan_wmm_downgrade_tid(priv,
|
||||
|
@ -2203,7 +2277,13 @@ 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);
|
||||
|
||||
|
@ -2230,6 +2310,11 @@ mlan_status wlan_ret_wmm_get_status(pmlan_private priv, t_u8 *ptlv,
|
|||
ptlv_wmm_q_status->flow_required,
|
||||
ptlv_wmm_q_status->disabled);
|
||||
|
||||
/* Pick the minimum among these to avoid array out of
|
||||
* bounds */
|
||||
ptlv_wmm_q_status->queue_index = MIN(
|
||||
ptlv_wmm_q_status->queue_index, MAX_AC_QUEUES);
|
||||
|
||||
pac_status =
|
||||
&priv->wmm.ac_status[ptlv_wmm_q_status
|
||||
->queue_index];
|
||||
|
@ -2347,13 +2432,11 @@ mlan_status wlan_ret_wmm_get_status(pmlan_private priv, t_u8 *ptlv,
|
|||
* @param ppassoc_buf Output parameter: Pointer to the TLV output buffer,
|
||||
* modified on return to point after the appended WMM TLV
|
||||
* @param pwmm_ie Pointer to the WMM IE for the BSS we are joining
|
||||
* @param pht_cap Pointer to the HT IE for the BSS we are joining
|
||||
*
|
||||
* @return Length of data appended to the association tlv buffer
|
||||
*/
|
||||
t_u32 wlan_wmm_process_association_req(pmlan_private priv, t_u8 **ppassoc_buf,
|
||||
IEEEtypes_WmmParameter_t *pwmm_ie,
|
||||
IEEEtypes_HTCap_t *pht_cap)
|
||||
IEEEtypes_WmmParameter_t *pwmm_ie)
|
||||
{
|
||||
MrvlIEtypes_WmmParamSet_t *pwmm_tlv;
|
||||
t_u32 ret_len = 0;
|
||||
|
@ -2378,10 +2461,7 @@ t_u32 wlan_wmm_process_association_req(pmlan_private priv, t_u8 **ppassoc_buf,
|
|||
PRINTM(MINFO, "WMM: process assoc req: bss->wmmIe=0x%x\n",
|
||||
pwmm_ie->vend_hdr.element_id);
|
||||
|
||||
if ((priv->wmm_required ||
|
||||
(pht_cap && (pht_cap->ieee_hdr.element_id == HT_CAPABILITY) &&
|
||||
(priv->config_bands & BAND_GN || priv->config_bands & BAND_AN))) &&
|
||||
pwmm_ie->vend_hdr.element_id == WMM_IE) {
|
||||
if (priv->wmm_required && pwmm_ie->vend_hdr.element_id == WMM_IE) {
|
||||
pwmm_tlv = (MrvlIEtypes_WmmParamSet_t *)*ppassoc_buf;
|
||||
pwmm_tlv->header.type = (t_u16)wmm_info_ie[0];
|
||||
pwmm_tlv->header.type = wlan_cpu_to_le16(pwmm_tlv->header.type);
|
||||
|
@ -2428,7 +2508,7 @@ t_u8 wlan_wmm_compute_driver_packet_delay(pmlan_private priv,
|
|||
t_u8 ret_val = 0;
|
||||
t_u32 out_ts_sec, out_ts_usec;
|
||||
t_s32 queue_delay;
|
||||
|
||||
t_s32 temp_delay = 0;
|
||||
ENTER();
|
||||
|
||||
priv->adapter->callbacks.moal_get_system_time(
|
||||
|
@ -2440,9 +2520,17 @@ t_u8 wlan_wmm_compute_driver_packet_delay(pmlan_private priv,
|
|||
priv->adapter->callbacks.moal_tp_accounting(
|
||||
priv->adapter->pmoal_handle, pmbuf, 11);
|
||||
}
|
||||
queue_delay = (t_s32)(out_ts_sec - pmbuf->in_ts_sec) * 1000;
|
||||
queue_delay += (t_s32)(out_ts_usec - pmbuf->in_ts_usec) / 1000;
|
||||
if (!wlan_secure_sub(&out_ts_sec, pmbuf->in_ts_sec, &temp_delay,
|
||||
TYPE_SINT32))
|
||||
PRINTM(MERROR, "%s:TS(sec) not valid \n", __func__);
|
||||
|
||||
queue_delay = temp_delay * 1000;
|
||||
|
||||
if (!wlan_secure_sub(&out_ts_usec, pmbuf->in_ts_usec, &temp_delay,
|
||||
TYPE_SINT32))
|
||||
PRINTM(MERROR, "%s:TS(usec) not valid \n", __func__);
|
||||
|
||||
queue_delay += temp_delay / 1000;
|
||||
/*
|
||||
* Queue delay is passed as a uint8 in units of 2ms (ms shifted
|
||||
* by 1). Min value (other than 0) is therefore 2ms, max is 510ms.
|
||||
|
@ -3615,8 +3703,8 @@ void wlan_dump_ralist(mlan_private *priv)
|
|||
tx_pkts_queued =
|
||||
util_scalar_read(pmadapter->pmoal_handle,
|
||||
&priv->wmm.tx_pkts_queued, MNULL, MNULL);
|
||||
PRINTM(MERROR, "bss_index = %d, tx_pkts_queued = %d\n", priv->bss_index,
|
||||
tx_pkts_queued);
|
||||
PRINTM(MERROR, "bss_index = %d, tx_pkts_queued = %d tx_pause\n",
|
||||
priv->bss_index, tx_pkts_queued, priv->tx_pause);
|
||||
if (!tx_pkts_queued)
|
||||
return;
|
||||
for (i = 0; i < MAX_NUM_TID; i++) {
|
||||
|
|
|
@ -166,8 +166,7 @@ mlan_status wlan_ret_wmm_param_config(pmlan_private pmpriv,
|
|||
/** Process WMM association request */
|
||||
extern t_u32 wlan_wmm_process_association_req(pmlan_private priv,
|
||||
t_u8 **ppAssocBuf,
|
||||
IEEEtypes_WmmParameter_t *pWmmIE,
|
||||
IEEEtypes_HTCap_t *pHTCap);
|
||||
IEEEtypes_WmmParameter_t *pWmmIE);
|
||||
#endif /* STA_SUPPORT */
|
||||
|
||||
/** setup wmm queue priorities */
|
||||
|
@ -181,6 +180,8 @@ 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
|
||||
/*
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#define _MLAN_DECL_H_
|
||||
|
||||
/** MLAN release version */
|
||||
#define MLAN_RELEASE_VERSION "322"
|
||||
#define MLAN_RELEASE_VERSION "423.p6"
|
||||
|
||||
/** Re-define generic data types for MLAN/MOAL */
|
||||
/** Signed char (1-byte) */
|
||||
|
@ -129,13 +129,8 @@ typedef t_s32 t_sval;
|
|||
/** Return aligned offset */
|
||||
#define OFFSET_ALIGN_ADDR(p, a) (t_u32)(ALIGN_ADDR(p, a) - (t_ptr)p)
|
||||
|
||||
#if defined(WIFI_DIRECT_SUPPORT)
|
||||
/** Maximum BSS numbers */
|
||||
#define MLAN_MAX_BSS_NUM (16)
|
||||
#else
|
||||
/** Maximum BSS numbers */
|
||||
#define MLAN_MAX_BSS_NUM (2)
|
||||
#endif
|
||||
|
||||
/** NET IP alignment */
|
||||
#define MLAN_NET_IP_ALIGN 2
|
||||
|
@ -186,6 +181,11 @@ typedef t_s32 t_sval;
|
|||
#define MLAN_WFD_COEX_AMPDU_DEF_RXWINSIZE 16
|
||||
#endif
|
||||
|
||||
/** NAN use the same window size for tx/rx */
|
||||
#define MLAN_NAN_AMPDU_DEF_TXRXWINSIZE 16
|
||||
/** RX winsize for COEX */
|
||||
#define MLAN_NAN_COEX_AMPDU_DEF_RXWINSIZE 16
|
||||
|
||||
/** Block ack timeout value */
|
||||
#define MLAN_DEFAULT_BLOCK_ACK_TIMEOUT 0xffff
|
||||
/** Maximum Tx Win size configured for ADDBA request [10 bits] */
|
||||
|
@ -267,12 +267,22 @@ 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
|
||||
#endif
|
||||
/** sdio hw reset */
|
||||
#define FW_RELOAD_SDIO_HW_RESET 5
|
||||
/** pcie inband reset */
|
||||
#define FW_RELOAD_PCIE_INBAND_RESET 6
|
||||
|
||||
/** auto fw reload enable */
|
||||
#define AUTO_FW_RELOAD_ENABLE MBIT(0)
|
||||
/** auto fw reload enable pcie inband reset */
|
||||
#define AUTO_FW_RELOAD_PCIE_INBAND_RESET MBIT(1)
|
||||
|
||||
#ifdef PCIE
|
||||
/* Interrupt type */
|
||||
enum { RX_DATA, RX_EVENT, TX_COMPLETE, RX_CMD_RESP, RX_CMD_DNLD };
|
||||
#endif
|
||||
#ifdef USB
|
||||
#define MLAN_USB_BLOCK_SIZE (512)
|
||||
#define MLAN_USB_AGGR_MODE_NUM (0)
|
||||
|
@ -378,7 +388,9 @@ 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_NW62X 0x0b
|
||||
#define CARD_TYPE_IW624 0x0b
|
||||
/** Black bird card type */
|
||||
#define CARD_TYPE_AW693 0x0c
|
||||
|
||||
/** 9098 A0 reverion num */
|
||||
#define CHIP_9098_REV_A0 1
|
||||
|
@ -410,8 +422,10 @@ 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_NW62X card type */
|
||||
#define CARD_TYPE_SDNW62X (CARD_TYPE_NW62X | (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))
|
||||
|
||||
#define IS_SD8887(ct) (CARD_TYPE_SD8887 == (ct))
|
||||
#define IS_SD8897(ct) (CARD_TYPE_SD8897 == (ct))
|
||||
|
@ -423,7 +437,8 @@ 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_SDNW62X(ct) (CARD_TYPE_SDNW62X == (ct))
|
||||
#define IS_SDIW624(ct) (CARD_TYPE_SDIW624 == (ct))
|
||||
#define IS_SDAW693(ct) (CARD_TYPE_SDAW693 == (ct))
|
||||
|
||||
/** SD8887 Card */
|
||||
#define CARD_SD8887 "SD8887"
|
||||
|
@ -432,7 +447,7 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
/** SD8977 Card */
|
||||
#define CARD_SD8977 "SD8977"
|
||||
/** SD8978 Card */
|
||||
#define CARD_SD8978 "SD8978"
|
||||
#define CARD_SD8978 "SDIW416"
|
||||
/** SD8997 Card */
|
||||
#define CARD_SD8997 "SD8997"
|
||||
/** SD8987 Card */
|
||||
|
@ -442,11 +457,13 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
/** SD9098 Card */
|
||||
#define CARD_SD9098 "SD9098"
|
||||
/** SD9177 Card */
|
||||
#define CARD_SD9177 "SD9177"
|
||||
#define CARD_SD9177 "SDIW612"
|
||||
/** SD8801 Card */
|
||||
#define CARD_SD8801 "SD8801"
|
||||
/** SDNW62X Card */
|
||||
#define CARD_SDNW62X "SDNW62X"
|
||||
/** SDIW624 Card */
|
||||
#define CARD_SDIW624 "SDIW624"
|
||||
/** SDAW693 Card */
|
||||
#define CARD_SDAW693 "SDAW693"
|
||||
#endif
|
||||
|
||||
#ifdef PCIE
|
||||
|
@ -458,14 +475,17 @@ 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))
|
||||
/** PCIENW62X card type */
|
||||
#define CARD_TYPE_PCIENW62X (CARD_TYPE_NW62X | (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))
|
||||
|
||||
#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_PCIENW62X(ct) (CARD_TYPE_PCIENW62X == (ct))
|
||||
#define IS_PCIEIW624(ct) (CARD_TYPE_PCIEIW624 == (ct))
|
||||
#define IS_PCIEAW693(ct) (CARD_TYPE_PCIEAW693 == (ct))
|
||||
|
||||
/** PCIE8897 Card */
|
||||
#define CARD_PCIE8897 "PCIE8897"
|
||||
|
@ -479,8 +499,12 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
#define CARD_PCIE9098 "PCIE9098"
|
||||
/** PCIEAW690 Card */
|
||||
#define CARD_PCIEAW690 "PCIEAW690"
|
||||
/** PCIENW62X Card */
|
||||
#define CARD_PCIENW62X "PCIENW62X"
|
||||
/** PCIEIW624 Card */
|
||||
#define CARD_PCIEIW624 "PCIEIW624"
|
||||
/** PCIEAW693 Card */
|
||||
#define CARD_PCIEAW693 "PCIEAW693"
|
||||
/** PCIEIW629 Card */
|
||||
#define CARD_PCIEIW629 "PCIEIW629"
|
||||
#endif
|
||||
|
||||
#ifdef USB
|
||||
|
@ -496,8 +520,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))
|
||||
/** USBNW62X card type */
|
||||
#define CARD_TYPE_USBNW62X (CARD_TYPE_NW62X | (INTF_USB << 8))
|
||||
/** USBIW624 card type */
|
||||
#define CARD_TYPE_USBIW624 (CARD_TYPE_IW624 | (INTF_USB << 8))
|
||||
|
||||
#define IS_USB8801(ct) (CARD_TYPE_USB8801 == (ct))
|
||||
#define IS_USB8897(ct) (CARD_TYPE_USB8897 == (ct))
|
||||
|
@ -505,7 +529,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_USBNW62X(ct) (CARD_TYPE_USBNW62X == (ct))
|
||||
#define IS_USBIW624(ct) (CARD_TYPE_USBIW624 == (ct))
|
||||
|
||||
/** USB8801 Card */
|
||||
#define CARD_USB8801 "USB8801"
|
||||
|
@ -514,13 +538,13 @@ typedef t_u8 mlan_802_11_mac_addr[MLAN_MAC_ADDR_LENGTH];
|
|||
/** USB8997 Card */
|
||||
#define CARD_USB8997 "USB8997"
|
||||
/** USB8978 Card */
|
||||
#define CARD_USB8978 "USB8978"
|
||||
#define CARD_USB8978 "USBIW416"
|
||||
/** USB9098 Card */
|
||||
#define CARD_USB9098 "USB9098"
|
||||
/** USB9097 Card */
|
||||
#define CARD_USB9097 "USBIW620"
|
||||
/** USBNW62X Card */
|
||||
#define CARD_USBNW62X "USBNW62X"
|
||||
/** USBIW624 Card */
|
||||
#define CARD_USBIW624 "USBIW624"
|
||||
#endif
|
||||
|
||||
#define IS_CARD8801(ct) (CARD_TYPE_8801 == ((ct)&0xf))
|
||||
|
@ -532,7 +556,8 @@ 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_CARDNW62X(ct) (CARD_TYPE_NW62X == ((ct)&0xf))
|
||||
#define IS_CARDIW624(ct) (CARD_TYPE_IW624 == ((ct)&0xf))
|
||||
#define IS_CARDAW693(ct) (CARD_TYPE_AW693 == ((ct)&0xf))
|
||||
|
||||
typedef struct _card_type_entry {
|
||||
t_u16 card_type;
|
||||
|
@ -602,6 +627,8 @@ 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
|
||||
|
@ -632,6 +659,8 @@ typedef enum {
|
|||
|
||||
/** Memory allocation type: DMA */
|
||||
#define MLAN_MEM_DMA MBIT(0)
|
||||
/** Memory allocation flag: ATOMIC */
|
||||
#define MLAN_MEM_FLAG_ATOMIC MBIT(1)
|
||||
|
||||
/** Default memory allocation flag */
|
||||
#define MLAN_MEM_DEF 0
|
||||
|
@ -686,10 +715,21 @@ 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 {
|
||||
|
@ -713,6 +753,7 @@ typedef enum _mlan_bss_type {
|
|||
#ifdef WIFI_DIRECT_SUPPORT
|
||||
MLAN_BSS_TYPE_WIFIDIRECT = 2,
|
||||
#endif
|
||||
MLAN_BSS_TYPE_NAN = 4,
|
||||
MLAN_BSS_TYPE_DFS = 8,
|
||||
MLAN_BSS_TYPE_ANY = 0xff,
|
||||
} mlan_bss_type;
|
||||
|
@ -769,6 +810,8 @@ typedef enum _mlan_event_id {
|
|||
MLAN_EVENT_ID_FW_RADAR_DETECTED = 0x00000024,
|
||||
MLAN_EVENT_ID_FW_CHANNEL_REPORT_RDY = 0x00000025,
|
||||
MLAN_EVENT_ID_FW_BW_CHANGED = 0x00000026,
|
||||
MLAN_EVENT_ID_FW_IBSS_CONNECT = 0x00000028,
|
||||
MLAN_EVENT_ID_FW_IBSS_DISCONNECT = 0x00000029,
|
||||
MLAN_EVENT_ID_FW_REMAIN_ON_CHAN_EXPIRED = 0x0000002B,
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
|
@ -811,11 +854,22 @@ 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_NAN_STARTED = 0x80000024,
|
||||
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,
|
||||
MLAN_EVENT_ID_DRV_DELAY_TX_COMPLETE = 0x80000036,
|
||||
#endif
|
||||
MLAN_EVENT_ID_DRV_RGPWR_KEY_MISMATCH = 0x80000037,
|
||||
} mlan_event_id;
|
||||
|
||||
/** Data Structures */
|
||||
|
@ -865,7 +919,9 @@ typedef MLAN_PACK_START struct _MrvlIEtypes_Data_t {
|
|||
|
||||
#define OID_TYPE_CAL 0x2
|
||||
#define OID_TYPE_DPD 0xa
|
||||
#define NONE_TYPE_DPD 0xb
|
||||
#define UNKNOW_DPD_LENGTH 0xffffffff
|
||||
#define NONE_DPD_LENGTH 0xfafafafa
|
||||
|
||||
/** Custom data structure */
|
||||
typedef struct _mlan_init_param {
|
||||
|
@ -896,8 +952,8 @@ enum mlan_channel_type {
|
|||
/** channel band */
|
||||
enum { BAND_2GHZ = 0,
|
||||
BAND_5GHZ = 1,
|
||||
BAND_4GHZ = 2,
|
||||
BAND_6GHZ = 3,
|
||||
BAND_6GHZ = 2,
|
||||
BAND_4GHZ = 3,
|
||||
};
|
||||
|
||||
/** channel offset */
|
||||
|
@ -946,9 +1002,27 @@ typedef enum _dfs_w53_cfg_t {
|
|||
DFS_W53_OLD = 2
|
||||
} dfs_w53_cfg_t;
|
||||
|
||||
typedef enum _dfs_moe_t {
|
||||
/** driver default DFS behavior */
|
||||
DFS_MODE_DEFAULT = 0,
|
||||
/* disable DFS master when uap and station operate in same DFS channel
|
||||
*/
|
||||
DFS_MODE_ENH = 1,
|
||||
} dfs_mode_t;
|
||||
|
||||
/** Band_Config_t */
|
||||
typedef MLAN_PACK_START struct _Band_Config_t {
|
||||
/** Band Info - (00)=2.4GHz, (01)=5GHz */
|
||||
#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 */
|
||||
t_u8 chanBand : 2;
|
||||
/** Channel Width - (00)=20MHz, (10)=40MHz, (11)=80MHz */
|
||||
t_u8 chanWidth : 2;
|
||||
|
@ -956,6 +1030,7 @@ typedef MLAN_PACK_START struct _Band_Config_t {
|
|||
t_u8 chan2Offset : 2;
|
||||
/** Channel Selection Mode - (00)=manual, (01)=ACS, (02)=Adoption mode*/
|
||||
t_u8 scanMode : 2;
|
||||
#endif
|
||||
} MLAN_PACK_END Band_Config_t;
|
||||
|
||||
/** channel_band_t */
|
||||
|
@ -1122,6 +1197,10 @@ 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 {
|
||||
|
@ -1133,10 +1212,12 @@ typedef MLAN_PACK_START struct _rxpd_extra_info {
|
|||
t_u8 mcs_known;
|
||||
/** mcs.flags */
|
||||
t_u8 mcs_flags;
|
||||
/** vht sig1 */
|
||||
t_u32 vht_sig1;
|
||||
/** vht sig2 */
|
||||
t_u32 vht_sig2;
|
||||
/** vht/he sig1 */
|
||||
t_u32 vht_he_sig1;
|
||||
/** vht/he sig2 */
|
||||
t_u32 vht_he_sig2;
|
||||
/** HE user idx */
|
||||
t_u32 user_idx;
|
||||
} MLAN_PACK_END rxpd_extra_info, *prxpd_extra_info;
|
||||
|
||||
typedef MLAN_PACK_START struct _radiotap_info {
|
||||
|
@ -1157,6 +1238,16 @@ typedef MLAN_PACK_START struct _radiotap_info {
|
|||
|
||||
/** txpower structure */
|
||||
typedef MLAN_PACK_START struct {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Host tx power ctrl:
|
||||
0x0: use fw setting for TX power
|
||||
0x1: value specified in bit[6] and bit[5:0] are valid */
|
||||
t_u8 hostctl : 1;
|
||||
/** Sign of the power specified in bit[5:0] */
|
||||
t_u8 sign : 1;
|
||||
/** Power to be used for transmission(in dBm) */
|
||||
t_u8 abs_val : 6;
|
||||
#else
|
||||
/** Power to be used for transmission(in dBm) */
|
||||
t_u8 abs_val : 6;
|
||||
/** Sign of the power specified in bit[5:0] */
|
||||
|
@ -1165,6 +1256,7 @@ typedef MLAN_PACK_START struct {
|
|||
0x0: use fw setting for TX power
|
||||
0x1: value specified in bit[6] and bit[5:0] are valid */
|
||||
t_u8 hostctl : 1;
|
||||
#endif
|
||||
} MLAN_PACK_END tx_power_t;
|
||||
/* pkt_txctrl */
|
||||
typedef MLAN_PACK_START struct _pkt_txctrl {
|
||||
|
@ -1213,7 +1305,19 @@ typedef MLAN_PACK_START struct _mc_txcontrol {
|
|||
/** mc_pkt_flags */
|
||||
t_u8 mc_pkt_flags;
|
||||
} MLAN_PACK_END mc_txcontrol, *pmc_txcontrol;
|
||||
|
||||
typedef MLAN_PACK_START struct MAPP_Stats_Mcast_drv {
|
||||
t_u32 cycle_recv_under_2300usec;
|
||||
t_u32 cycle_recv_in_time;
|
||||
t_u32 cycle_recv_over_2900usec;
|
||||
t_u32 cycle_recv_over_3500usec;
|
||||
t_u32 cycle_recv_over_5000usec;
|
||||
t_u32 cycle_recv_over_10000usec;
|
||||
t_u32 cycle_recv_over_15000usec;
|
||||
t_u32 spent_time_under_1000usec;
|
||||
t_u32 spent_time_over_1000usec;
|
||||
t_u32 spent_time_over_2000usec;
|
||||
t_u32 spent_time_over_3000usec;
|
||||
} MLAN_PACK_END Stats_mcast_drv_t, *pStats_mcast_drv_t;
|
||||
/** mlan_buffer data structure */
|
||||
typedef struct _mlan_buffer {
|
||||
/** Pointer to previous mlan_buffer */
|
||||
|
@ -1259,6 +1363,8 @@ 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;
|
||||
|
@ -1649,6 +1755,14 @@ 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,
|
||||
|
@ -1706,6 +1820,15 @@ 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
|
||||
|
@ -1787,15 +1910,6 @@ 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) */
|
||||
|
@ -1989,9 +2103,320 @@ 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
|
||||
|
@ -2139,12 +2564,6 @@ 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,
|
||||
|
@ -2233,8 +2652,6 @@ 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 */
|
||||
|
@ -2272,6 +2689,8 @@ 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;
|
||||
|
@ -2282,6 +2701,8 @@ 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;
|
||||
|
@ -2291,8 +2712,16 @@ 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 */
|
||||
|
@ -2373,7 +2802,103 @@ 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
|
||||
|
||||
/** secure add/sub **/
|
||||
#ifndef SINT8_MAX
|
||||
#define SINT8_MAX 0x7f
|
||||
#endif
|
||||
|
||||
#ifndef SINT8_MIN
|
||||
#define SINT8_MIN 0x80
|
||||
#endif
|
||||
|
||||
#ifndef UINT8_MAX
|
||||
#define UINT8_MAX 0xff
|
||||
#endif
|
||||
|
||||
#ifndef SINT16_MAX
|
||||
#define SINT16_MAX 0x7fff
|
||||
#endif
|
||||
|
||||
#ifndef SINT16_MIN
|
||||
#define SINT16_MIN 0x8000
|
||||
#endif
|
||||
|
||||
#ifndef UINT16_MAX
|
||||
#define UINT16_MAX 0xffff
|
||||
#endif
|
||||
|
||||
#ifndef SINT32_MAX
|
||||
#define SINT32_MAX 0x7fffffff
|
||||
#endif
|
||||
|
||||
#ifndef SINT32_MIN
|
||||
#define SINT32_MIN 0x80000000
|
||||
#endif
|
||||
|
||||
#ifndef UINT32_MAX
|
||||
#define UINT32_MAX 0xffffffff
|
||||
#endif
|
||||
|
||||
#ifndef SINT64_MAX
|
||||
#define SINT64_MAX 0x7fffffffffffffff
|
||||
#endif
|
||||
|
||||
#ifndef SINT64_MIN
|
||||
#define SINT64_MIN 0x8000000000000000
|
||||
#endif
|
||||
|
||||
#ifndef UINT64_MAX
|
||||
#define UINT64_MAX 0xffffffffffffffff
|
||||
#endif
|
||||
|
||||
#ifndef PTR_MAX
|
||||
#ifdef MLAN_64BIT
|
||||
#define PTR_MAX UINT64_MAX
|
||||
#else
|
||||
#define PTR_MAX UINT32_MAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SINT_MAX
|
||||
#ifdef MLAN_64BIT
|
||||
#define SINT_MAX SINT64_MAX
|
||||
#else
|
||||
#define SINT_MAX SINT32_MAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SINT_MIN
|
||||
#ifdef MLAN_64BIT
|
||||
#define SINT_MIN SINT64_MIN
|
||||
#else
|
||||
#define SINT_MIN SINT32_MIN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef UINT_MAX
|
||||
#ifdef MLAN_64BIT
|
||||
#define UINT_MAX UINT64_MAX
|
||||
#else
|
||||
#define UINT_MAX UINT32_MAX
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
TYPE_SINT8,
|
||||
TYPE_UINT8,
|
||||
TYPE_SINT16,
|
||||
TYPE_UINT16,
|
||||
TYPE_SINT32,
|
||||
TYPE_UINT32,
|
||||
TYPE_SINT64,
|
||||
TYPE_UINT64,
|
||||
TYPE_PTR,
|
||||
} data_type;
|
||||
|
||||
#endif /* !_MLAN_DECL_H_ */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* definitions used in MLAN and MOAL module.
|
||||
*
|
||||
*
|
||||
* Copyright 2008-2022 NXP
|
||||
* Copyright 2008-2023 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -46,10 +46,17 @@ typedef enum _WLAN_802_11_NETWORK_TYPE {
|
|||
Wlan802_11NetworkTypeMax
|
||||
} WLAN_802_11_NETWORK_TYPE;
|
||||
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Frame control: Type Mgmt frame */
|
||||
#define IEEE80211_FC_MGMT_FRAME_TYPE_MASK 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)
|
||||
|
@ -83,6 +90,8 @@ 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,
|
||||
|
@ -170,14 +179,50 @@ 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 */
|
||||
|
@ -274,6 +319,27 @@ typedef MLAN_PACK_START struct {
|
|||
t_u8 variablep[];
|
||||
} MLAN_PACK_END IEEEtypes_assoc_req;
|
||||
|
||||
/** Assoc Request */
|
||||
#define SUBTYPE_ASSOC_REQUEST 0
|
||||
/** Assoc Response */
|
||||
#define SUBTYPE_ASSOC_RESP 1
|
||||
/** ReAssoc Request */
|
||||
#define SUBTYPE_REASSOC_REQUEST 2
|
||||
/** ReAssoc Request */
|
||||
#define SUBTYPE_REASSOC_RESP 3
|
||||
/** Probe Resp */
|
||||
#define SUBTYPE_PROBE_RESP 5
|
||||
/** Disassoc Request */
|
||||
#define SUBTYPE_DISASSOC 10
|
||||
/** Auth Request */
|
||||
#define SUBTYPE_AUTH 11
|
||||
/** Deauth Request */
|
||||
#define SUBTYPE_DEAUTH 12
|
||||
/** Action frame */
|
||||
#define SUBTYPE_ACTION 13
|
||||
/** beacon */
|
||||
#define SUBTYPE_BEACON 8
|
||||
|
||||
/*Mgmt frame*/
|
||||
typedef MLAN_PACK_START struct {
|
||||
/** frame control */
|
||||
|
@ -310,6 +376,25 @@ typedef MLAN_PACK_START struct _TLV_Generic_t {
|
|||
#define CAPINFO_MASK (~(MBIT(15) | MBIT(14) | MBIT(11) | MBIT(9)))
|
||||
|
||||
/** Capability Bit Map*/
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
|
||||
t_u8 rsrvd1 : 2;
|
||||
t_u8 dsss_ofdm : 1;
|
||||
t_u8 radio_measurement : 1;
|
||||
t_u8 rsvrd2 : 1;
|
||||
t_u8 short_slot_time : 1;
|
||||
t_u8 rsrvd3 : 1;
|
||||
t_u8 spectrum_mgmt : 1;
|
||||
t_u8 chan_agility : 1;
|
||||
t_u8 pbcc : 1;
|
||||
t_u8 short_preamble : 1;
|
||||
t_u8 privacy : 1;
|
||||
t_u8 cf_poll_rqst : 1;
|
||||
t_u8 cf_pollable : 1;
|
||||
t_u8 ibss : 1;
|
||||
t_u8 ess : 1;
|
||||
} MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
|
||||
#else
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
|
||||
/** Capability Bit Map : ESS */
|
||||
t_u8 ess : 1;
|
||||
|
@ -342,6 +427,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_CapInfo_t {
|
|||
/** Capability Bit Map : Reserved */
|
||||
t_u8 rsrvd1 : 2;
|
||||
} MLAN_PACK_END IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
|
||||
/** IEEEtypes_Ssid_t */
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_Ssid_t {
|
||||
|
@ -556,16 +642,35 @@ typedef MLAN_PACK_START struct _IEEEtypes_Wpa_t {
|
|||
|
||||
/** Data structure of WMM QoS information */
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_WmmQosInfo_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** QoS UAPSD */
|
||||
t_u8 qos_uapsd : 1;
|
||||
/** Reserved */
|
||||
t_u8 reserved : 3;
|
||||
/** Parameter set count */
|
||||
t_u8 para_set_count : 4;
|
||||
#else
|
||||
/** Parameter set count */
|
||||
t_u8 para_set_count : 4;
|
||||
/** Reserved */
|
||||
t_u8 reserved : 3;
|
||||
/** QoS UAPSD */
|
||||
t_u8 qos_uapsd : 1;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
} MLAN_PACK_END IEEEtypes_WmmQosInfo_t, *pIEEEtypes_WmmQosInfo_t;
|
||||
|
||||
/** Data structure of WMM Aci/Aifsn */
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Reserved */
|
||||
t_u8 reserved : 1;
|
||||
/** Aci */
|
||||
t_u8 aci : 2;
|
||||
/** Acm */
|
||||
t_u8 acm : 1;
|
||||
/** Aifsn */
|
||||
t_u8 aifsn : 4;
|
||||
#else
|
||||
/** Aifsn */
|
||||
t_u8 aifsn : 4;
|
||||
/** Acm */
|
||||
|
@ -574,14 +679,22 @@ typedef MLAN_PACK_START struct _IEEEtypes_WmmAciAifsn_t {
|
|||
t_u8 aci : 2;
|
||||
/** Reserved */
|
||||
t_u8 reserved : 1;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
} MLAN_PACK_END IEEEtypes_WmmAciAifsn_t, *pIEEEtypes_WmmAciAifsn_t;
|
||||
|
||||
/** Data structure of WMM ECW */
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_WmmEcw_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Maximum Ecw */
|
||||
t_u8 ecw_max : 4;
|
||||
/** Minimum Ecw */
|
||||
t_u8 ecw_min : 4;
|
||||
#else
|
||||
/** Minimum Ecw */
|
||||
t_u8 ecw_min : 4;
|
||||
/** Maximum Ecw */
|
||||
t_u8 ecw_max : 4;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
} MLAN_PACK_END IEEEtypes_WmmEcw_t, *pIEEEtypes_WmmEcw_t;
|
||||
|
||||
/** Data structure of WMM AC parameters */
|
||||
|
@ -669,6 +782,22 @@ typedef MLAN_PACK_START enum _IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e {
|
|||
|
||||
/** Data structure of WMM TSPEC information */
|
||||
typedef MLAN_PACK_START struct {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
t_u8 Reserved17_23 : 7; /* ! Reserved */
|
||||
t_u8 Schedule : 1;
|
||||
IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2;
|
||||
t_u8 UserPri : 3; /* ! 802.1d User Priority */
|
||||
// IEEEtypes_WMM_TSPEC_TS_Info_PSB_e PowerSaveBehavior : 1; /*
|
||||
// !Legacy/Trigg*/
|
||||
t_u8 PowerSaveBehavior : 1;
|
||||
t_u8 Aggregation : 1; /* ! Reserved */
|
||||
t_u8 AccessPolicy2 : 1; /* ! */
|
||||
t_u8 AccessPolicy1 : 1; /* ! */
|
||||
IEEEtypes_WMM_TSPEC_TS_Info_Direction_e Direction : 2;
|
||||
t_u8 TID : 4; /* ! Unique identifier */
|
||||
// IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1;
|
||||
t_u8 TrafficType : 1;
|
||||
#else
|
||||
// IEEEtypes_WMM_TSPEC_TS_TRAFFIC_TYPE_e TrafficType : 1;
|
||||
t_u8 TrafficType : 1;
|
||||
t_u8 TID : 4; /* ! Unique identifier */
|
||||
|
@ -683,19 +812,31 @@ typedef MLAN_PACK_START struct {
|
|||
IEEEtypes_WMM_TSPEC_TS_Info_AckPolicy_e AckPolicy : 2;
|
||||
t_u8 Schedule : 1;
|
||||
t_u8 Reserved17_23 : 7; /* ! Reserved */
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_TS_Info_t;
|
||||
|
||||
/** Data structure of WMM TSPEC Nominal Size */
|
||||
typedef MLAN_PACK_START struct {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is
|
||||
nominal */
|
||||
t_u16 Size : 15; /* ! Nominal size in octets */
|
||||
#else
|
||||
t_u16 Size : 15; /* ! Nominal size in octets */
|
||||
t_u16 Fixed : 1; /* ! 1: Fixed size given in Size, 0: Var, size is
|
||||
nominal */
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_NomMSDUSize_t;
|
||||
|
||||
/** Data structure of WMM TSPEC SBWA */
|
||||
typedef MLAN_PACK_START struct {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
t_u16 Whole : 3; /* ! Whole portion */
|
||||
t_u16 Fractional : 13; /* ! Fractional portion */
|
||||
#else
|
||||
t_u16 Fractional : 13; /* ! Fractional portion */
|
||||
t_u16 Whole : 3; /* ! Whole portion */
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_WMM_TSPEC_SBWA;
|
||||
|
||||
/** Data structure of WMM TSPEC Body */
|
||||
|
@ -1036,6 +1177,26 @@ typedef MLAN_PACK_START struct _VHT_MCS_set {
|
|||
/** VHT Capabilities info field, reference 802.11ac D1.4 p89 */
|
||||
typedef MLAN_PACK_START struct _VHT_capa {
|
||||
#if 0
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
t_u8 mpdu_max_len:2;
|
||||
t_u8 chan_width:2;
|
||||
t_u8 rx_LDPC:1;
|
||||
t_u8 sgi_80:1;
|
||||
t_u8 sgi_160:1;
|
||||
t_u8 tx_STBC:1;
|
||||
t_u8 rx_STBC:3;
|
||||
t_u8 SU_beamformer_capa:1;
|
||||
t_u8 SU_beamformee_capa:1;
|
||||
t_u8 beamformer_ante_num:3;
|
||||
t_u8 sounding_dim_num:3;
|
||||
t_u8 MU_beamformer_capa:1;
|
||||
t_u8 MU_beamformee_capa:1;
|
||||
t_u8 VHT_TXOP_ps:1;
|
||||
t_u8 HTC_VHT_capa:1;
|
||||
t_u8 max_ampdu_len:3;
|
||||
t_u8 link_apapt_capa:2;
|
||||
t_u8 reserved_1:4;
|
||||
#else
|
||||
t_u8 reserved_1:4;
|
||||
t_u8 link_apapt_capa:2;
|
||||
t_u8 max_ampdu_len:3;
|
||||
|
@ -1054,6 +1215,7 @@ typedef MLAN_PACK_START struct _VHT_capa {
|
|||
t_u8 rx_LDPC:1;
|
||||
t_u8 chan_width:2;
|
||||
t_u8 mpdu_max_len:2;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
#endif
|
||||
t_u32 vht_cap_info;
|
||||
VHT_MCS_set_t mcs_sets;
|
||||
|
@ -1162,6 +1324,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_Extension_t {
|
|||
} MLAN_PACK_END IEEEtypes_Extension_t, *pIEEEtypes_Extension_t;
|
||||
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Max HE-MAC for 8 SS */
|
||||
t_u8 max_mcs_8ss : 2;
|
||||
/** Max HE-MAC for 7 SS */
|
||||
t_u8 max_mcs_7ss : 2;
|
||||
/** Max HE-MAC for 6 SS */
|
||||
t_u8 max_mcs_6ss : 2;
|
||||
/** Max HE-MAC for 5 SS */
|
||||
t_u8 max_mcs_5ss : 2;
|
||||
/** Max HE-MAC for 4 SS */
|
||||
t_u8 max_mcs_4ss : 2;
|
||||
/** Max HE-MAC for 3 SS */
|
||||
t_u8 max_mcs_3ss : 2;
|
||||
/** Max HE-MAC for 2 SS */
|
||||
t_u8 max_mcs_2ss : 2;
|
||||
/** Max HE-MAC for 1 SS */
|
||||
t_u8 max_mcs_1ss : 2;
|
||||
#else
|
||||
/** Max HE-MAC for 1 SS */
|
||||
t_u8 max_mcs_1ss : 2;
|
||||
/** Max HE-MAC for 2 SS */
|
||||
|
@ -1178,6 +1358,7 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeMcsMap_t {
|
|||
t_u8 max_mcs_7ss : 2;
|
||||
/** Max HE-MAC for 8 SS */
|
||||
t_u8 max_mcs_8ss : 2;
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_HeMcsMap_t, *pIEEEtypes_HeMcsMap_t;
|
||||
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_HeMcsNss_t {
|
||||
|
@ -1204,6 +1385,24 @@ typedef MLAN_PACK_START struct _IEEEtypes_HECap_t {
|
|||
} MLAN_PACK_END IEEEtypes_HECap_t, *pIEEEtypes_HECap_t;
|
||||
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** Reserved, including 6G Operation Info Pressent (bit17) */
|
||||
t_u8 reserved : 6; /* bit 18-23 */
|
||||
/* 6g operation info present */
|
||||
t_u8 he_6g_op_info_present : 1; /* bit 17 */
|
||||
/** ER SU Disable */
|
||||
t_u8 er_su_disable : 1; /* bit 16 */
|
||||
/** Co-Hosted BSS */
|
||||
t_u16 co_located_bss : 1; /* bit 15 */
|
||||
/** VHT Operation Info Present */
|
||||
t_u16 vht_op_info_present : 1; /* bit 14 */
|
||||
/** TXOP Duration RTS Threshold */
|
||||
t_u16 txop_dur_rts_threshold : 10; /* bit 4-13 */
|
||||
/** TWT Required */
|
||||
t_u16 twt_req : 1; /* bit 3 */
|
||||
/** Default PE Duration */
|
||||
t_u16 default_pe_dur : 3; /* bit 0-2 */
|
||||
#else
|
||||
/** Default PE Duration */
|
||||
t_u16 default_pe_dur : 3; /* bit 0-2 */
|
||||
/** TWT Required */
|
||||
|
@ -1216,17 +1415,29 @@ typedef MLAN_PACK_START struct _IEEEtypes_HeOpParam_t {
|
|||
t_u16 co_located_bss : 1; /* bit 15 */
|
||||
/** ER SU Disable */
|
||||
t_u8 er_su_disable : 1; /* bit 16 */
|
||||
/** Reserved, including 6G Operation Info Pressent (bit17) */
|
||||
t_u8 reserved : 7; /* bit 17-23 */
|
||||
/* 6g operation info present */
|
||||
t_u8 he_6g_op_info_present : 1; /* bit 17 */
|
||||
/** Reserved bit 18-23 */
|
||||
t_u8 reserved : 6; /* bit 18-23 */
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_HeOpParam_t;
|
||||
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_HeBssColorInfo_t {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/** BSS Color Disabled */
|
||||
t_u8 bss_color_disabled : 1; /* bit 7 */
|
||||
/** Partial BSS Color */
|
||||
t_u8 partial_bss_color : 1; /* bit 6 */
|
||||
/** BSS Color */
|
||||
t_u8 bss_color : 6; /* bit 0-5 */
|
||||
#else
|
||||
/** BSS Color */
|
||||
t_u8 bss_color : 6; /* bit 0-5 */
|
||||
/** Partial BSS Color */
|
||||
t_u8 partial_bss_color : 1; /* bit 6 */
|
||||
/** BSS Color Disabled */
|
||||
t_u8 bss_color_disabled : 1; /* bit 7 */
|
||||
#endif
|
||||
} MLAN_PACK_END IEEEtypes_HeBssColorInfo_t;
|
||||
|
||||
typedef MLAN_PACK_START struct _IEEEtypes_HeOp_t {
|
||||
|
@ -1388,6 +1599,20 @@ typedef MLAN_PACK_START struct {
|
|||
*** @brief Map octet of the basic measurement report (7.3.2.22.1)
|
||||
**/
|
||||
typedef MLAN_PACK_START struct {
|
||||
#ifdef BIG_ENDIAN_SUPPORT
|
||||
/**< Reserved */
|
||||
t_u8 rsvd5_7 : 3;
|
||||
/**< Channel is unmeasured */
|
||||
t_u8 unmeasured : 1;
|
||||
/**< Radar detected on channel */
|
||||
t_u8 radar : 1;
|
||||
/**< Unidentified signal found on channel */
|
||||
t_u8 unidentified_sig : 1;
|
||||
/**< OFDM preamble detected on channel */
|
||||
t_u8 ofdm_preamble : 1;
|
||||
/**< At least one valid MPDU received on channel */
|
||||
t_u8 bss : 1;
|
||||
#else
|
||||
/**< At least one valid MPDU received on channel */
|
||||
t_u8 bss : 1;
|
||||
/**< OFDM preamble detected on channel */
|
||||
|
@ -1400,6 +1625,7 @@ typedef MLAN_PACK_START struct {
|
|||
t_u8 unmeasured : 1;
|
||||
/**< Reserved */
|
||||
t_u8 rsvd5_7 : 3;
|
||||
#endif /* BIG_ENDIAN_SUPPORT */
|
||||
|
||||
} MLAN_PACK_END MeasRptBasicMap_t;
|
||||
|
||||
|
@ -1542,8 +1768,8 @@ typedef MLAN_PACK_START struct _wlan_user_scan_chan {
|
|||
t_u8 radio_type;
|
||||
/** Scan type: Active = 1, Passive = 2 */
|
||||
t_u8 scan_type;
|
||||
/** Reserved */
|
||||
t_u8 reserved;
|
||||
/** rnr_flag */
|
||||
t_u8 rnr_flag;
|
||||
/** Scan duration in milliseconds; if 0 default used */
|
||||
t_u32 scan_time;
|
||||
} MLAN_PACK_END wlan_user_scan_chan;
|
||||
|
@ -1635,6 +1861,8 @@ typedef MLAN_PACK_START struct {
|
|||
t_u8 bssid_num;
|
||||
/** BSSID filter list used in the to limit the scan results */
|
||||
mlan_802_11_mac_addr bssid_list[MAX_BSSID_FILTER_LIST];
|
||||
/** use scan setting from scan_cfg only */
|
||||
t_u8 scan_cfg_only;
|
||||
} MLAN_PACK_END wlan_user_scan_cfg;
|
||||
|
||||
/** Default scan interval in millisecond*/
|
||||
|
@ -1656,9 +1884,15 @@ 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
|
||||
/** Maximum number of channels that can be sent in bg scan config */
|
||||
|
||||
#define CHAN_MAX_6G 0
|
||||
|
||||
/** max bgscan chan number */
|
||||
#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 {
|
||||
|
@ -1725,7 +1959,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_BG_SCAN_CHAN_MAX];
|
||||
wlan_user_scan_chan chan_list[WLAN_USER_SCAN_CHAN_MAX];
|
||||
/** scan channel gap */
|
||||
t_u16 scan_chan_gap;
|
||||
/** Enable EES configuration */
|
||||
|
@ -1758,6 +1992,11 @@ 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
|
||||
|
@ -1772,6 +2011,15 @@ 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
|
@ -58,7 +58,6 @@
|
|||
|
||||
/* 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
|
||||
|
@ -67,10 +66,14 @@
|
|||
|
||||
#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,
|
||||
const t_u8 *addr, int disable,
|
||||
const t_u8 *addr, int disable, t_u8 pairwise,
|
||||
t_u8 wait_option);
|
||||
|
||||
mlan_status woal_cfg80211_set_wep_keys(moal_private *priv, const t_u8 *key,
|
||||
|
@ -115,6 +118,7 @@ void woal_regulatory_work_queue(struct work_struct *work);
|
|||
#endif
|
||||
|
||||
t_u8 woal_band_cfg_to_ieee_band(t_u32 band);
|
||||
t_u8 woal_ieee_band_to_radio_type(t_u8 ieee_band);
|
||||
|
||||
int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy,
|
||||
struct net_device *dev,
|
||||
|
@ -127,6 +131,9 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy,
|
|||
int woal_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
|
||||
|
||||
int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
|
||||
#if ((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,
|
||||
|
@ -134,6 +141,9 @@ int woal_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
|
|||
const t_u8 *mac_addr, struct key_params *params);
|
||||
|
||||
int woal_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
|
||||
#if ((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,
|
||||
|
@ -155,6 +165,10 @@ 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
|
||||
|
@ -203,6 +217,9 @@ int woal_cfg80211_set_channel(struct wiphy *wiphy,
|
|||
|
||||
#if KERNEL_VERSION(2, 6, 37) < CFG80211_VERSION_CODE
|
||||
int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev,
|
||||
#if ((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,
|
||||
|
@ -212,12 +229,18 @@ int woal_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *dev,
|
|||
#if KERNEL_VERSION(2, 6, 30) <= CFG80211_VERSION_CODE
|
||||
int woal_cfg80211_set_default_mgmt_key(struct wiphy *wiphy,
|
||||
struct net_device *netdev,
|
||||
#if ((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
|
||||
|
||||
|
@ -263,10 +286,6 @@ int woal_cfg80211_mgmt_tx(struct wiphy *wiphy,
|
|||
#endif
|
||||
u64 *cookie);
|
||||
|
||||
#if KERNEL_VERSION(3, 14, 0) <= CFG80211_VERSION_CODE
|
||||
void woal_update_radar_chans_dfs_state(struct wiphy *wiphy);
|
||||
#endif
|
||||
|
||||
mlan_status woal_register_cfg80211(moal_private *priv);
|
||||
|
||||
extern struct ieee80211_supported_band cfg80211_band_2ghz;
|
||||
|
@ -278,6 +297,11 @@ extern struct ieee80211_supported_band mac1_cfg80211_band_5ghz;
|
|||
int woal_cfg80211_bss_role_cfg(moal_private *priv, t_u16 action,
|
||||
t_u8 *bss_role);
|
||||
#endif
|
||||
|
||||
#ifdef UAP_SUPPORT
|
||||
void woal_cancel_cac(moal_private *priv);
|
||||
#endif
|
||||
|
||||
#if KERNEL_VERSION(4, 1, 0) <= CFG80211_VERSION_CODE
|
||||
struct wireless_dev *
|
||||
woal_cfg80211_add_virtual_intf(struct wiphy *wiphy, const char *name,
|
||||
|
@ -421,7 +445,13 @@ 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);
|
||||
|
@ -466,7 +496,6 @@ void woal_channel_switch_event(moal_private *priv, chan_band_info *pchan_info);
|
|||
#if KERNEL_VERSION(3, 2, 0) <= CFG80211_VERSION_CODE
|
||||
void woal_bgscan_stop_event(moal_private *priv);
|
||||
void woal_cfg80211_notify_sched_scan_stop(moal_private *priv);
|
||||
void woal_sched_scan_work_queue(struct work_struct *work);
|
||||
void woal_report_sched_scan_result(moal_private *priv);
|
||||
#endif
|
||||
#endif
|
||||
|
@ -477,7 +506,9 @@ void woal_cfg80211_notify_antcfg(moal_private *priv, struct wiphy *wiphy,
|
|||
mlan_ds_radio_cfg *radio);
|
||||
#endif
|
||||
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
|
||||
void woal_deauth_event(moal_private *priv, int reason_code);
|
||||
#endif
|
||||
|
||||
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
|
||||
mlan_status woal_chandef_create(moal_private *priv,
|
||||
|
@ -488,6 +519,8 @@ 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);
|
||||
|
@ -504,7 +537,8 @@ 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_u32 dev_cap, t_u8 *mcs_set,
|
||||
t_u8 mpdu_density);
|
||||
#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);
|
||||
|
@ -516,4 +550,7 @@ 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
|
@ -612,19 +612,47 @@ 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;
|
||||
enum mrvl_wlan_vendor_attr_secure_ranging_ctx {
|
||||
MRVL_WLAN_VENDOR_ATTR_SECURE_RANGING_CTX_INVALID = 0,
|
||||
MRVL_WLAN_VENDOR_ATTR_SECURE_RANGING_CTX_ACTION = 1,
|
||||
MRVL_WLAN_VENDOR_ATTR_SECURE_RANGING_CTX_SRC_ADDR = 2,
|
||||
MRVL_WLAN_VENDOR_ATTR_SECURE_RANGING_CTX_PEER_MAC_ADDR = 3,
|
||||
MRVL_WLAN_VENDOR_ATTR_SECURE_RANGING_CTX_SHA_TYPE = 4,
|
||||
MRVL_WLAN_VENDOR_ATTR_SECURE_RANGING_CTX_TK = 5,
|
||||
MRVL_WLAN_VENDOR_ATTR_SECURE_RANGING_CTX_CIPHER = 6,
|
||||
MRVL_WLAN_VENDOR_ATTR_SECURE_RANGING_CTX_LTF_KEYSEED = 7,
|
||||
|
||||
/* keep last */
|
||||
MRVL_WLAN_VENDOR_ATTR_SECURE_RANGING_CTX_AFTER_LAST,
|
||||
MRVL_WLAN_VENDOR_ATTR_SECURE_RANGING_CTX_MAX =
|
||||
MRVL_WLAN_VENDOR_ATTR_SECURE_RANGING_CTX_AFTER_LAST - 1,
|
||||
};
|
||||
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,
|
||||
|
@ -694,9 +722,19 @@ 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_secure_ranging_ctx = 0x0009,
|
||||
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,
|
||||
|
@ -825,6 +863,29 @@ 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,
|
||||
|
|
|
@ -113,10 +113,12 @@ static struct debug_data items[] = {
|
|||
{"tx_lock_flag", item_size(tx_lock_flag), item_addr(tx_lock_flag),
|
||||
INFO_ADDR},
|
||||
{"port_open", item_size(port_open), item_addr(port_open), INFO_ADDR},
|
||||
{"tx_pause", item_size(tx_pause), item_addr(tx_pause), INFO_ADDR},
|
||||
{"bypass_pkt_count", item_size(bypass_pkt_count),
|
||||
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),
|
||||
|
@ -161,8 +163,6 @@ 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),
|
||||
|
@ -259,6 +259,10 @@ static struct debug_data items[] = {
|
|||
item_handle_addr(hs_skip_count), HANDLE_ADDR},
|
||||
{"hs_force_count", item_handle_size(hs_force_count),
|
||||
item_handle_addr(hs_force_count), HANDLE_ADDR},
|
||||
#ifdef STA_CFG80211
|
||||
{"scan_timeout", item_handle_size(scan_timeout),
|
||||
item_handle_addr(scan_timeout), HANDLE_ADDR},
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -306,6 +310,7 @@ static struct debug_data uap_items[] = {
|
|||
INFO_ADDR},
|
||||
{"tx_pkts_queued", item_size(tx_pkts_queued), item_addr(tx_pkts_queued),
|
||||
INFO_ADDR},
|
||||
{"tx_pause", item_size(tx_pause), item_addr(tx_pause), INFO_ADDR},
|
||||
{"bypass_pkt_count", item_size(bypass_pkt_count),
|
||||
item_addr(bypass_pkt_count), INFO_ADDR},
|
||||
{"num_bridge_pkts", item_size(num_bridge_pkts),
|
||||
|
@ -356,8 +361,6 @@ 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),
|
||||
|
@ -1201,6 +1204,7 @@ static ssize_t woal_debug_write(struct file *f, const char __user *buf,
|
|||
t_u32 last_drvdbg = drvdbg;
|
||||
#endif
|
||||
gfp_t flag;
|
||||
t_u32 temp_count = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
@ -1209,7 +1213,11 @@ static ssize_t woal_debug_write(struct file *f, const char __user *buf,
|
|||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
flag = (in_atomic() || irqs_disabled()) ? GFP_ATOMIC : GFP_KERNEL;
|
||||
pdata = kzalloc(count + 1, flag);
|
||||
|
||||
if (!woal_secure_add(&count, 1, &temp_count, TYPE_UINT32))
|
||||
PRINTM(MERROR, "%s:count param overflow \n", __func__);
|
||||
|
||||
pdata = kzalloc(temp_count, flag);
|
||||
if (pdata == NULL) {
|
||||
MODULE_PUT;
|
||||
LEAVE();
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -4,7 +4,7 @@
|
|||
* @brief This file contains definition for private IOCTL call.
|
||||
*
|
||||
*
|
||||
* Copyright 2008-2022 NXP
|
||||
* Copyright 2008-2023 NXP
|
||||
*
|
||||
* This software file (the File) is distributed by NXP
|
||||
* under the terms of the GNU General Public License Version 2, June 1991
|
||||
|
@ -82,6 +82,9 @@ 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"
|
||||
|
@ -100,6 +103,8 @@ 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"
|
||||
|
@ -110,6 +115,7 @@ typedef struct _chan_stats {
|
|||
#define PRIV_CMD_ASSOCESSID "assocessid"
|
||||
#define PRIV_CMD_ASSOCBSSID "assocessid_bssid"
|
||||
#endif
|
||||
#define PRIV_CMD_AUTOASSOC "assocctrl"
|
||||
#define PRIV_CMD_WAKEUPREASON "wakeupreason"
|
||||
#ifdef STA_SUPPORT
|
||||
#define PRIV_CMD_LISTENINTERVAL "listeninterval"
|
||||
|
@ -145,6 +151,7 @@ typedef struct _chan_stats {
|
|||
#define PRIV_CMD_REGRDWR "regrdwr"
|
||||
#define PRIV_CMD_RDEEPROM "rdeeprom"
|
||||
#define PRIV_CMD_MEMRDWR "memrdwr"
|
||||
#define PRIV_CMD_GPIOCFG "gpiocfg"
|
||||
#ifdef SDIO
|
||||
#define PRIV_CMD_SDCMD52RW "sdcmd52rw"
|
||||
#endif
|
||||
|
@ -214,17 +221,15 @@ 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"
|
||||
#define PRIV_CMD_CWMODE "cwmode"
|
||||
#define PRIV_CMD_ANT_CFG "antcfg"
|
||||
#define PRIV_CMD_SYSCLOCK "sysclock"
|
||||
#define PRIV_CMD_GET_KEY "getkey"
|
||||
|
@ -235,9 +240,9 @@ typedef struct _chan_stats {
|
|||
#ifdef SDIO
|
||||
#define PRIV_CMD_SD_CMD53_RW "sdcmd53rw"
|
||||
#endif
|
||||
#ifdef RX_PACKET_COALESCE
|
||||
#define PRIV_CMD_RX_COAL_CFG "rxpktcoal_cfg"
|
||||
#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 WIFI_DIRECT_SUPPORT
|
||||
#if defined(UAP_CFG80211)
|
||||
#define PRIV_CMD_CFG_NOA "cfg_noa"
|
||||
|
@ -271,6 +276,7 @@ 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"
|
||||
|
@ -294,14 +300,22 @@ 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
|
||||
|
@ -372,6 +386,12 @@ typedef struct _ssu_params_cfg {
|
|||
|
||||
#define PRIV_CMD_BOOTSLEEP "bootsleep"
|
||||
|
||||
/** Private command ID to config txwatchdog enable/disable */
|
||||
#define PRIV_CMD_TXWATCHDOG "txwatchdog"
|
||||
|
||||
/** Private command to get secure boot uuid */
|
||||
#define PRIV_CMD_GET_SB_UUID "getuuid"
|
||||
|
||||
/** Private command: 11AX Cfg */
|
||||
#define PRIV_CMD_11AXCFG "11axcfg"
|
||||
/** Private command: 11AX Cmd */
|
||||
|
@ -382,6 +402,8 @@ 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"
|
||||
|
||||
|
@ -532,6 +554,7 @@ typedef struct woal_priv_addba {
|
|||
#define ACTION_ADD 2
|
||||
/** Action field value: remove */
|
||||
#define ACTION_REMOVE 3
|
||||
|
||||
#define MC_AGGR_CTRL MBIT(0)
|
||||
/* mcast_aggr_group */
|
||||
typedef struct _mcast_aggr_group {
|
||||
|
@ -675,6 +698,26 @@ 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)
|
||||
|
@ -694,13 +737,6 @@ typedef struct _tx_rx_histogram {
|
|||
t_u8 action;
|
||||
} __ATTRIB_PACK__ tx_rx_histogram;
|
||||
|
||||
/* Enum for different CW mode type */
|
||||
typedef enum _cw_modes_e {
|
||||
CWMODE_DISABLE,
|
||||
CWMODE_TXCONTPKT,
|
||||
CWMODE_TXCONTWAVE,
|
||||
} cw_modes_e;
|
||||
|
||||
/** wlan_ieee80211_chan */
|
||||
typedef struct {
|
||||
/** center freq */
|
||||
|
|
|
@ -29,6 +29,11 @@ extern pmoal_handle m_handle[];
|
|||
static char *fw_name;
|
||||
static int req_fw_nowait;
|
||||
int fw_reload;
|
||||
#ifdef PCIE
|
||||
int auto_fw_reload = AUTO_FW_RELOAD_ENABLE | AUTO_FW_RELOAD_PCIE_INBAND_RESET;
|
||||
#else
|
||||
int auto_fw_reload = AUTO_FW_RELOAD_ENABLE;
|
||||
#endif
|
||||
|
||||
static char *hw_name;
|
||||
|
||||
|
@ -41,6 +46,7 @@ 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) */
|
||||
|
@ -58,22 +64,25 @@ 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;
|
||||
static int host_mlme = 1;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static int roamoffload_in_hs;
|
||||
|
||||
static int drcs_chantime_mode;
|
||||
|
||||
/** Auto deep sleep */
|
||||
static int auto_ds;
|
||||
|
||||
/** net_rx mode*/
|
||||
static int net_rx;
|
||||
/** amsdu deaggr mode */
|
||||
static int amsdu_deaggr;
|
||||
static int amsdu_deaggr = 1;
|
||||
|
||||
static int ext_scan;
|
||||
|
||||
|
@ -117,6 +126,11 @@ static int max_vir_bss = DEF_VIRTUAL_BSS;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/** Max NAN interfaces */
|
||||
static int max_nan_bss = DEF_NAN_BSS;
|
||||
/** NAN interface name */
|
||||
static char *nan_name;
|
||||
|
||||
/** PM keep power */
|
||||
static int pm_keep_power = 1;
|
||||
#ifdef SDIO_SUSPEND_RESUME
|
||||
|
@ -129,7 +143,30 @@ 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
|
||||
|
||||
/**
|
||||
* EDMAC for EU adaptivity
|
||||
* Default value of 0 keeps edmac disabled by default
|
||||
*/
|
||||
static int edmac_ctrl = 0;
|
||||
|
||||
static int tx_skb_clone = 0;
|
||||
#ifdef IMX_SUPPORT
|
||||
static int pmqos = 1;
|
||||
|
@ -138,6 +175,9 @@ 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 */
|
||||
|
@ -250,7 +290,6 @@ 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 **/
|
||||
|
@ -264,6 +303,21 @@ 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
|
||||
|
||||
int dual_nb;
|
||||
|
||||
#ifdef DEBUG_LEVEL1
|
||||
#ifdef DEBUG_LEVEL2
|
||||
#define DEFAULT_DEBUG_MASK (0xffffffff)
|
||||
|
@ -305,8 +359,8 @@ static card_type_entry card_type_map_tbl[] = {
|
|||
#ifdef SD9177
|
||||
{CARD_TYPE_SD9177, 0, CARD_SD9177},
|
||||
#endif
|
||||
#ifdef SDNW62X
|
||||
{CARD_TYPE_SDNW62X, 0, CARD_SDNW62X},
|
||||
#ifdef SDIW624
|
||||
{CARD_TYPE_SDIW624, 0, CARD_SDIW624},
|
||||
#endif
|
||||
#ifdef PCIE8897
|
||||
{CARD_TYPE_PCIE8897, 0, CARD_PCIE8897},
|
||||
|
@ -320,8 +374,8 @@ static card_type_entry card_type_map_tbl[] = {
|
|||
#ifdef PCIE9098
|
||||
{CARD_TYPE_PCIE9098, 0, CARD_PCIE9098},
|
||||
#endif
|
||||
#ifdef PCIENW62X
|
||||
{CARD_TYPE_PCIENW62X, 0, CARD_PCIENW62X},
|
||||
#ifdef PCIEIW624
|
||||
{CARD_TYPE_PCIEIW624, 0, CARD_PCIEIW624},
|
||||
#endif
|
||||
#ifdef USB8801
|
||||
{CARD_TYPE_USB8801, 0, CARD_USB8801},
|
||||
|
@ -342,14 +396,16 @@ static card_type_entry card_type_map_tbl[] = {
|
|||
#ifdef USB9097
|
||||
{CARD_TYPE_USB9097, 0, CARD_USB9097},
|
||||
#endif
|
||||
#ifdef USBNW62X
|
||||
{CARD_TYPE_USBNW62X, 0, CARD_USBNW62X},
|
||||
#ifdef USBIW624
|
||||
{CARD_TYPE_USBIW624, 0, CARD_USBIW624},
|
||||
#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
|
||||
*
|
||||
|
@ -365,7 +421,8 @@ static t_size parse_cfg_get_line(t_u8 *data, t_size size, t_u8 *line_pos)
|
|||
|
||||
ENTER();
|
||||
|
||||
if (pos >= (t_s32)size) { /* reach the end */
|
||||
if ((pos >= (t_s32)size) || (data == NULL) ||
|
||||
(line_pos == NULL)) { /* reach the end */
|
||||
pos = 0; /* Reset position for rfkill */
|
||||
LEAVE();
|
||||
return -1;
|
||||
|
@ -511,7 +568,9 @@ static mlan_status parse_line_read_card_info(t_u8 *line, char **type,
|
|||
|
||||
p = strstr(line, "_");
|
||||
if (p != NULL) {
|
||||
*p++ = '\0';
|
||||
*p = '\0';
|
||||
if (!woal_secure_add(&p, 1, &p, TYPE_PTR))
|
||||
PRINTM(MERROR, "%s:ERR:pointer overflow \n", __func__);
|
||||
*if_id = p;
|
||||
} else {
|
||||
*if_id = NULL;
|
||||
|
@ -600,6 +659,14 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
|
|||
goto err;
|
||||
params->fw_reload = out_data;
|
||||
PRINTM(MMSG, "fw_reload %d\n", params->fw_reload);
|
||||
} else if (strncmp(line, "auto_fw_reload",
|
||||
strlen("auto_fw_reload")) == 0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
params->auto_fw_reload = out_data;
|
||||
PRINTM(MMSG, "auto_fw_reload %d\n",
|
||||
params->auto_fw_reload);
|
||||
} else if (strncmp(line, "fw_serial", strlen("fw_serial")) ==
|
||||
0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
|
@ -635,13 +702,33 @@ 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, "drv_mode", strlen("drv_mode")) == 0) {
|
||||
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) {
|
||||
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) !=
|
||||
|
@ -702,7 +789,20 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
|
|||
}
|
||||
#endif
|
||||
#endif
|
||||
else if (strncmp(line, "auto_ds", strlen("auto_ds")) == 0) {
|
||||
else if (strncmp(line, "nan_name", strlen("nan_name")) == 0) {
|
||||
if (parse_line_read_string(line, &out_str) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
woal_dup_string(¶ms->nan_name, out_str);
|
||||
PRINTM(MMSG, "nan_name=%s\n", params->nan_name);
|
||||
} else if (strncmp(line, "max_nan_bss",
|
||||
strlen("max_nan_bss")) == 0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
params->max_nan_bss = out_data;
|
||||
PRINTM(MMSG, "max_nan_bss = %d\n", params->max_nan_bss);
|
||||
} else if (strncmp(line, "auto_ds", strlen("auto_ds")) == 0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
|
@ -1007,20 +1107,6 @@ 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) !=
|
||||
|
@ -1167,17 +1253,29 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
|
|||
PRINTM(MMSG, "tx_work %s\n",
|
||||
moal_extflg_isset(handle, EXT_TX_WORK) ? "on" :
|
||||
"off");
|
||||
} else if (strncmp(line, "rps", strlen("rps")) == 0) {
|
||||
}
|
||||
#if defined(CONFIG_RPS)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
|
||||
else if (strncmp(line, "rps", strlen("rps")) == 0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
if (out_data)
|
||||
moal_extflg_set(handle, EXT_RPS);
|
||||
else
|
||||
moal_extflg_clear(handle, EXT_RPS);
|
||||
PRINTM(MMSG, "rps %s\n",
|
||||
moal_extflg_isset(handle, EXT_RPS) ? "on" :
|
||||
"off");
|
||||
|
||||
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, "edmac_ctrl", strlen("edmac_ctrl")) ==
|
||||
0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
|
||||
handle->params.edmac_ctrl = out_data;
|
||||
PRINTM(MMSG, "edmac_ctrl set to %x from cfg\n",
|
||||
handle->params.edmac_ctrl);
|
||||
} else if (strncmp(line, "tx_skb_clone",
|
||||
strlen("tx_skb_clone")) == 0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
|
@ -1219,8 +1317,29 @@ static mlan_status parse_cfg_read_block(t_u8 *data, t_u32 size,
|
|||
"off");
|
||||
}
|
||||
#endif
|
||||
else if (strncmp(line, "roamoffload_in_hs",
|
||||
strlen("roamoffload_in_hs")) == 0) {
|
||||
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) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
|
@ -1309,6 +1428,20 @@ 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) {
|
||||
|
@ -1343,6 +1476,27 @@ 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);
|
||||
} else if (strncmp(line, "dual_nb", strlen("dual_nb")) == 0) {
|
||||
if (parse_line_read_int(line, &out_data) !=
|
||||
MLAN_STATUS_SUCCESS)
|
||||
goto err;
|
||||
params->dual_nb = out_data;
|
||||
PRINTM(MMSG, "dual_nb=%d\n", params->dual_nb);
|
||||
}
|
||||
}
|
||||
if (end)
|
||||
|
@ -1383,6 +1537,10 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
|
|||
}
|
||||
if (params)
|
||||
handle->params.fw_reload = params->fw_reload;
|
||||
|
||||
handle->params.auto_fw_reload = auto_fw_reload;
|
||||
if (params)
|
||||
handle->params.auto_fw_reload = params->auto_fw_reload;
|
||||
if (fw_serial)
|
||||
moal_extflg_set(handle, EXT_FW_SERIAL);
|
||||
woal_dup_string(&handle->params.hw_name, hw_name);
|
||||
|
@ -1397,9 +1555,20 @@ 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)
|
||||
|
@ -1419,13 +1588,20 @@ 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);
|
||||
|
@ -1439,6 +1615,12 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
|
|||
handle->params.max_vir_bss = params->max_vir_bss;
|
||||
#endif
|
||||
#endif /* WIFI_DIRECT_SUPPORT */
|
||||
handle->params.max_nan_bss = max_nan_bss;
|
||||
woal_dup_string(&handle->params.nan_name, nan_name);
|
||||
if (params) {
|
||||
handle->params.max_nan_bss = params->max_nan_bss;
|
||||
woal_dup_string(&handle->params.nan_name, params->nan_name);
|
||||
}
|
||||
handle->params.auto_ds = auto_ds;
|
||||
if (params)
|
||||
handle->params.auto_ds = params->auto_ds;
|
||||
|
@ -1558,8 +1740,6 @@ 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);
|
||||
|
@ -1602,8 +1782,15 @@ static void woal_setup_module_param(moal_handle *handle, moal_mod_para *params)
|
|||
moal_extflg_set(handle, EXT_NAPI);
|
||||
if (tx_work)
|
||||
moal_extflg_set(handle, EXT_TX_WORK);
|
||||
if (rps)
|
||||
moal_extflg_set(handle, EXT_RPS);
|
||||
|
||||
#if 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
|
||||
handle->params.edmac_ctrl = edmac_ctrl;
|
||||
|
||||
if (tx_skb_clone)
|
||||
moal_extflg_set(handle, EXT_TX_SKB_CLONE);
|
||||
if (pmqos)
|
||||
|
@ -1624,6 +1811,11 @@ 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);
|
||||
|
@ -1662,6 +1854,11 @@ 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;
|
||||
handle->params.dual_nb = dual_nb;
|
||||
if (params)
|
||||
handle->params.dual_nb = params->dual_nb;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1706,6 +1903,10 @@ void woal_free_module_param(moal_handle *handle)
|
|||
params->wfd_name = NULL;
|
||||
}
|
||||
#endif /* WIFI_DIRECT_SUPPORT */
|
||||
if (params->nan_name) {
|
||||
kfree(params->nan_name);
|
||||
params->nan_name = NULL;
|
||||
}
|
||||
if (params->dpd_data_cfg) {
|
||||
kfree(params->dpd_data_cfg);
|
||||
params->dpd_data_cfg = NULL;
|
||||
|
@ -1748,6 +1949,7 @@ 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");
|
||||
|
@ -1755,10 +1957,12 @@ static mlan_status woal_req_mod_param(moal_handle *handle, char *mod_file)
|
|||
goto out;
|
||||
}
|
||||
|
||||
ret = request_firmware(&handle->param_data, mod_file, dev);
|
||||
if (ret < 0)
|
||||
status = request_firmware(&handle->param_data, mod_file, dev);
|
||||
if (status < 0) {
|
||||
PRINTM(MERROR, "Request firmware: %s failed, error: %d\n",
|
||||
mod_file, ret);
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
}
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
@ -1831,11 +2035,23 @@ void woal_init_from_dev_tree(void)
|
|||
PRINTM(MIOCTL, "tx_work=0x%x\n", data);
|
||||
tx_work = data;
|
||||
}
|
||||
} else if (!strncmp(prop->name, "rps", strlen("rps"))) {
|
||||
}
|
||||
#if defined(CONFIG_RPS)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
|
||||
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, "edmac_ctrl",
|
||||
strlen("edmac_ctrl"))) {
|
||||
if (!of_property_read_u32(dt_node, prop->name, &data)) {
|
||||
PRINTM(MIOCTL, "edmac_ctrl=0x%x\n", data);
|
||||
edmac_ctrl = data;
|
||||
}
|
||||
} else if (!strncmp(prop->name, "tx_skb_clone",
|
||||
strlen("tx_skb_clone"))) {
|
||||
if (!of_property_read_u32(dt_node, prop->name, &data)) {
|
||||
|
@ -1847,6 +2063,19 @@ 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"))) {
|
||||
|
@ -1856,7 +2085,14 @@ void woal_init_from_dev_tree(void)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
else if (!strncmp(prop->name, "mac_addr", strlen("mac_addr"))) {
|
||||
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"))) {
|
||||
if (!of_property_read_string(dt_node, prop->name,
|
||||
&string_data)) {
|
||||
mac_addr = (char *)string_data;
|
||||
|
@ -1943,6 +2179,12 @@ 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
|
||||
|
@ -2047,6 +2289,13 @@ 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)) {
|
||||
|
@ -2117,8 +2366,13 @@ void woal_init_from_dev_tree(void)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
else if (!strncmp(prop->name, "sched_scan",
|
||||
strlen("sched_scan"))) {
|
||||
else if (!strncmp(prop->name, "mcs32", strlen("mcs32"))) {
|
||||
if (!of_property_read_u32(dt_node, prop->name, &data)) {
|
||||
PRINTM(MERROR, "mcs32=0x%x\n", data);
|
||||
mcs32 = data;
|
||||
}
|
||||
} else if (!strncmp(prop->name, "sched_scan",
|
||||
strlen("sched_scan"))) {
|
||||
if (!of_property_read_u32(dt_node, prop->name, &data)) {
|
||||
PRINTM(MIOCTL, "sched_scan=%d\n", data);
|
||||
sched_scan = data;
|
||||
|
@ -2129,7 +2383,31 @@ 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;
|
||||
|
@ -2254,7 +2532,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 = handle->param_data->size;
|
||||
size = (t_u32)handle->param_data->size;
|
||||
data = (t_u8 *)handle->param_data->data;
|
||||
while ((int)parse_cfg_get_line(data, size, line) != -1) {
|
||||
if (line[0] == '#')
|
||||
|
@ -2272,7 +2550,8 @@ mlan_status woal_init_module_param(moal_handle *handle)
|
|||
if (blk_id == NULL)
|
||||
handle->blk_id = 0;
|
||||
else
|
||||
woal_atoi(&handle->blk_id, blk_id);
|
||||
(void)woal_atoi(&handle->blk_id,
|
||||
blk_id);
|
||||
PRINTM(MINFO,
|
||||
"Validation check, %s, config block: %d\n",
|
||||
card_type, handle->blk_id);
|
||||
|
@ -2305,7 +2584,7 @@ out:
|
|||
if (handle->param_data) {
|
||||
release_firmware(handle->param_data);
|
||||
/* rewind pos */
|
||||
parse_cfg_get_line(NULL, 0, NULL);
|
||||
(void)parse_cfg_get_line(NULL, 0, NULL);
|
||||
}
|
||||
if (ret != MLAN_STATUS_SUCCESS) {
|
||||
PRINTM(MERROR, "Invalid block: %s\n", line);
|
||||
|
@ -2335,6 +2614,15 @@ 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: 0: enable PCIE FLR, 1: 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,
|
||||
|
@ -2346,9 +2634,14 @@ 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");
|
||||
MODULE_PARM_DESC(
|
||||
drv_mode,
|
||||
"Bit 0: STA; Bit 1: uAP; Bit 2: WIFIDIRECT; Bit 4: NAN; Bit 7: ZERO_DFS");
|
||||
|
||||
#ifdef STA_SUPPORT
|
||||
module_param(max_sta_bss, int, 0);
|
||||
|
@ -2372,6 +2665,10 @@ module_param(max_vir_bss, int, 0);
|
|||
MODULE_PARM_DESC(max_vir_bss, "Number of Virtual interfaces (0)");
|
||||
#endif
|
||||
#endif /* WIFI_DIRECT_SUPPORT */
|
||||
module_param(nan_name, charp, 0);
|
||||
MODULE_PARM_DESC(nan_name, "NAN interface name");
|
||||
module_param(max_nan_bss, int, 0);
|
||||
MODULE_PARM_DESC(max_nan_bss, "Number of NAN interfaces (1)");
|
||||
#ifdef DEBUG_LEVEL1
|
||||
module_param(drvdbg, uint, 0660);
|
||||
MODULE_PARM_DESC(drvdbg, "Driver debug");
|
||||
|
@ -2429,13 +2726,25 @@ 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, "1: Enable rps; 0: Disable rps");
|
||||
MODULE_PARM_DESC(
|
||||
rps,
|
||||
"bit0-bit4(0x1 - 0xf): Enables rps on specific cpu ; 0: Disables rps");
|
||||
#endif
|
||||
#endif
|
||||
module_param(edmac_ctrl, int, 0660);
|
||||
MODULE_PARM_DESC(edmac_ctrl, "0: Disable edmac; 1: Enable edmac");
|
||||
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");
|
||||
|
@ -2505,13 +2814,11 @@ module_param(net_rx, int, 0);
|
|||
MODULE_PARM_DESC(net_rx,
|
||||
"0: use netif_rx_ni in rx; 1: use netif_receive_skb in rx");
|
||||
module_param(amsdu_deaggr, int, 0);
|
||||
MODULE_PARM_DESC(amsdu_deaggr,
|
||||
"0: default; 1: Try to avoid buf copy in amsud deaggregation");
|
||||
MODULE_PARM_DESC(
|
||||
amsdu_deaggr,
|
||||
"0: buf copy in amsud deaggregation; 1: avoid buf copy in amsud deaggregation (default)");
|
||||
|
||||
#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);
|
||||
|
@ -2579,6 +2886,14 @@ 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,
|
||||
|
@ -2595,8 +2910,9 @@ MODULE_PARM_DESC(
|
|||
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
|
||||
module_param(host_mlme, int, 0);
|
||||
MODULE_PARM_DESC(host_mlme,
|
||||
"1: Enable Host MLME Support; 0: Disable Host MLME support");
|
||||
MODULE_PARM_DESC(
|
||||
host_mlme,
|
||||
"1: Enable Host MLME Support (Default); 0: Disable Host MLME support");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -2625,3 +2941,23 @@ 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
|
||||
|
||||
module_param(dual_nb, int, 0);
|
||||
MODULE_PARM_DESC(dual_nb, "0: Single BT (Default); 1: Dual BT");
|
||||
|
|
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
|
@ -28,6 +28,10 @@ Change log:
|
|||
|
||||
#include <linux/firmware.h>
|
||||
|
||||
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
|
||||
#include "moal_cfg80211.h"
|
||||
#endif
|
||||
|
||||
#include "moal_pcie.h"
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 70)
|
||||
|
@ -36,9 +40,11 @@ Change log:
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
#include <net/addrconf.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/********************************************************
|
||||
Local Variables
|
||||
|
@ -110,10 +116,10 @@ static const struct pci_device_id wlan_ids[] = {
|
|||
0,
|
||||
},
|
||||
#endif
|
||||
#ifdef PCIENW62X
|
||||
#ifdef PCIEIW624
|
||||
{
|
||||
PCIE_VENDOR_ID_NXP,
|
||||
PCIE_DEVICE_ID_88WNW62X,
|
||||
PCIE_DEVICE_ID_88WIW624,
|
||||
PCI_ANY_ID,
|
||||
PCI_ANY_ID,
|
||||
0,
|
||||
|
@ -126,6 +132,8 @@ static const struct pci_device_id wlan_ids[] = {
|
|||
/* moal interface ops */
|
||||
static moal_if_ops pcie_ops;
|
||||
|
||||
MODULE_DEVICE_TABLE(pci, wlan_ids);
|
||||
|
||||
/********************************************************
|
||||
Global Variables
|
||||
********************************************************/
|
||||
|
@ -135,6 +143,11 @@ static moal_if_ops pcie_ops;
|
|||
********************************************************/
|
||||
|
||||
static mlan_status woal_pcie_preinit(struct pci_dev *pdev);
|
||||
#if defined(PCIE8897) || defined(PCIE8997) || defined(PCIE9098) || \
|
||||
defined(PCIE9097) || defined(PCIEIW624)
|
||||
static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag,
|
||||
t_u8 resetflag);
|
||||
#endif
|
||||
|
||||
/** @brief This function updates the card types
|
||||
*
|
||||
|
@ -202,15 +215,15 @@ static t_u16 woal_update_card_type(t_void *card)
|
|||
strlen(KERN_VERSION));
|
||||
}
|
||||
#endif
|
||||
#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));
|
||||
#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),
|
||||
V17, strlen(V17),
|
||||
V18, strlen(V18),
|
||||
strlen(driver_version) - strlen(INTF_CARDTYPE) -
|
||||
strlen(KERN_VERSION));
|
||||
}
|
||||
|
@ -220,6 +233,49 @@ static t_u16 woal_update_card_type(t_void *card)
|
|||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
|
||||
/**
|
||||
* @brief Function to program scratch register to ask device to clear ADMA
|
||||
*
|
||||
* @param handle A pointer to moal_handle structure
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
|
||||
*/
|
||||
|
||||
static mlan_status woal_reset_adma(moal_handle *handle)
|
||||
{
|
||||
int tries = 0;
|
||||
int ret = MLAN_STATUS_SUCCESS;
|
||||
t_u32 value;
|
||||
t_u32 reset_reg = handle->card_info->fw_reset_reg;
|
||||
t_u8 reset_adma_val = 0x97;
|
||||
|
||||
if (handle->ops.write_reg(handle, reset_reg, reset_adma_val) !=
|
||||
MLAN_STATUS_SUCCESS) {
|
||||
PRINTM(MERROR, "Failed to write register.\n");
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto done;
|
||||
}
|
||||
|
||||
for (tries = 0; tries < 100; ++tries) {
|
||||
ret = handle->ops.read_reg(handle, reset_reg, &value);
|
||||
if (value == 0) {
|
||||
break;
|
||||
}
|
||||
moal_usleep_range(handle, 100, 200);
|
||||
}
|
||||
|
||||
if (value == 0) {
|
||||
PRINTM(MMSG, "%s:ADMA reset done\n", __func__);
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
} else {
|
||||
PRINTM(MERROR, "%s:ADMA reset failed(value:%x)\n", __func__,
|
||||
value);
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
}
|
||||
done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function to process pre/post PCIe function level reset
|
||||
*
|
||||
|
@ -262,7 +318,8 @@ 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_PCIENW62X(handle->card_type) &&
|
||||
!IS_PCIEIW624(handle->card_type) &&
|
||||
!IS_PCIEAW693(handle->card_type) &&
|
||||
!IS_PCIE9098(handle->card_type)) {
|
||||
LEAVE();
|
||||
return status;
|
||||
|
@ -277,6 +334,8 @@ 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);
|
||||
mlan_ioctl(handle->pmlan_adapter, NULL);
|
||||
|
||||
/* Shutdown firmware */
|
||||
handle->init_wait_q_woken = MFALSE;
|
||||
|
@ -297,10 +356,20 @@ 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);
|
||||
|
@ -337,8 +406,9 @@ perform_init:
|
|||
goto err_init_fw;
|
||||
}
|
||||
|
||||
#ifdef PCIE9098
|
||||
if (card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1)
|
||||
#if defined(PCIE9098)
|
||||
if ((card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1) ||
|
||||
(card->dev->device == PCIE_DEVICE_ID_88WAW693_FN1))
|
||||
mlan_set_int_mode(handle->pmlan_adapter, pcie_int_mode, 1);
|
||||
else
|
||||
#endif
|
||||
|
@ -382,7 +452,7 @@ err_init_fw:
|
|||
handle->init_wait_q_woken);
|
||||
}
|
||||
#ifdef ANDROID_KERNEL
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0)
|
||||
wakeup_source_trash(&handle->ws);
|
||||
#else
|
||||
wake_lock_destroy(&handle->wake_lock);
|
||||
|
@ -459,7 +529,11 @@ static int woal_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
|||
ret = MLAN_STATUS_FAILURE;
|
||||
goto err;
|
||||
}
|
||||
woal_pcie_init(card);
|
||||
if (MLAN_STATUS_SUCCESS != woal_pcie_init(card)) {
|
||||
PRINTM(MERROR, "woal_pcie_init failed\n");
|
||||
ret = -EFAULT;
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (woal_add_card(card, &card->dev->dev, &pcie_ops, card_type) ==
|
||||
NULL) {
|
||||
|
@ -523,6 +597,46 @@ static void woal_pcie_remove(struct pci_dev *dev)
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles PCIE driver remove
|
||||
*
|
||||
* @param pdev A pointer to pci_dev structure
|
||||
*
|
||||
* @return error code
|
||||
*/
|
||||
static void woal_pcie_shutdown(struct pci_dev *dev)
|
||||
{
|
||||
pcie_service_card *card;
|
||||
moal_handle *handle;
|
||||
|
||||
ENTER();
|
||||
PRINTM(MCMND, "<--- Enter woal_pcie_shutdown --->\n");
|
||||
|
||||
card = pci_get_drvdata(dev);
|
||||
if (!card) {
|
||||
PRINTM(MINFO, "PCIE card removed from slot\n");
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
handle = card->handle;
|
||||
if (handle->second_mac)
|
||||
goto done;
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
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");
|
||||
}
|
||||
#endif
|
||||
done:
|
||||
handle->surprise_removed = MTRUE;
|
||||
pci_disable_device(dev);
|
||||
PRINTM(MCMND, "<--- Leave woal_pcie_shutdown --->\n");
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Handle suspend
|
||||
*
|
||||
|
@ -762,6 +876,12 @@ static void woal_pcie_reset_prepare(struct pci_dev *pdev)
|
|||
}
|
||||
}
|
||||
handle->surprise_removed = MTRUE;
|
||||
// TODO: Can add more chips once the related code has been ported to fw
|
||||
// v18
|
||||
if (IS_PCIE9097(handle->card_type) || IS_PCIE9098(handle->card_type)) {
|
||||
woal_reset_adma(handle);
|
||||
}
|
||||
|
||||
woal_do_flr(handle, true, true);
|
||||
if (ref_handle) {
|
||||
ref_handle->surprise_removed = MTRUE;
|
||||
|
@ -866,6 +986,12 @@ static void woal_pcie_reset_notify(struct pci_dev *pdev, bool prepare)
|
|||
* Note. FW might not be healthy.
|
||||
*/
|
||||
handle->surprise_removed = MTRUE;
|
||||
// TODO: Can add more chips once the related code has been
|
||||
// ported to fw v18
|
||||
if (IS_PCIE9097(handle->card_type) ||
|
||||
IS_PCIE9098(handle->card_type)) {
|
||||
woal_reset_adma(handle);
|
||||
}
|
||||
woal_do_flr(handle, prepare, true);
|
||||
if (ref_handle) {
|
||||
ref_handle->surprise_removed = MTRUE;
|
||||
|
@ -908,6 +1034,7 @@ static struct pci_driver REFDATA wlan_pcie = {
|
|||
.id_table = wlan_ids,
|
||||
.probe = woal_pcie_probe,
|
||||
.remove = woal_pcie_remove,
|
||||
.shutdown = woal_pcie_shutdown,
|
||||
#ifdef CONFIG_PM
|
||||
/* Power Management Hooks */
|
||||
.suspend = woal_pcie_suspend,
|
||||
|
@ -1040,8 +1167,6 @@ 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;
|
||||
|
@ -1126,13 +1251,21 @@ static mlan_status woal_pcie_preinit(struct pci_dev *pdev)
|
|||
pci_set_master(pdev);
|
||||
|
||||
PRINTM(MINFO, "Try set_consistent_dma_mask(32)\n");
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||
ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
|
||||
#else
|
||||
ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
|
||||
#endif
|
||||
if (ret) {
|
||||
PRINTM(MERROR, "set_dma_mask(32) failed\n");
|
||||
goto err_set_dma_mask;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
|
||||
#else
|
||||
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
|
||||
#endif
|
||||
if (ret) {
|
||||
PRINTM(MERROR, "set_consistent_dma_mask(64) failed\n");
|
||||
goto err_set_dma_mask;
|
||||
|
@ -1168,13 +1301,21 @@ static mlan_status woal_pcie_init(pcie_service_card *card)
|
|||
pci_set_master(pdev);
|
||||
|
||||
PRINTM(MINFO, "Try set_consistent_dma_mask(32)\n");
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||
ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
|
||||
#else
|
||||
ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
|
||||
#endif
|
||||
if (ret) {
|
||||
PRINTM(MERROR, "set_dma_mask(32) failed\n");
|
||||
goto err_set_dma_mask;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||
ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
|
||||
#else
|
||||
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
|
||||
#endif
|
||||
if (ret) {
|
||||
PRINTM(MERROR, "set_consistent_dma_mask(64) failed\n");
|
||||
goto err_set_dma_mask;
|
||||
|
@ -1202,7 +1343,7 @@ static mlan_status woal_pcie_init(pcie_service_card *card)
|
|||
goto err_iomap2;
|
||||
}
|
||||
|
||||
PRINTM(MINFO,
|
||||
PRINTM(MMSG,
|
||||
"PCI memory map Virt0: %p PCI memory map Virt2: "
|
||||
"%p\n",
|
||||
card->pci_mmap, card->pci_mmap1);
|
||||
|
@ -1335,8 +1476,9 @@ static mlan_status woal_pcie_register_dev(moal_handle *handle)
|
|||
break;
|
||||
}
|
||||
|
||||
#ifdef PCIE9098
|
||||
if (card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1)
|
||||
#if defined(PCIE9098)
|
||||
if ((card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1) ||
|
||||
(card->dev->device == PCIE_DEVICE_ID_88WAW693_FN1))
|
||||
mlan_set_int_mode(handle->pmlan_adapter, pcie_int_mode, 1);
|
||||
else
|
||||
#endif
|
||||
|
@ -1462,7 +1604,7 @@ void woal_pcie_bus_unregister(void)
|
|||
LEAVE();
|
||||
}
|
||||
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
#define PCIE9098_DUMP_CTRL_REG 0x1C94
|
||||
#define PCIE9098_DUMP_START_REG 0x1C98
|
||||
#define PCIE9098_DUMP_END_REG 0x1C9F
|
||||
|
@ -1473,7 +1615,7 @@ void woal_pcie_bus_unregister(void)
|
|||
#define DEBUG_DUMP_END_REG 0xCFF
|
||||
#endif
|
||||
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
#define PCIE9098_SCRATCH_12_REG 0x1C90
|
||||
#define PCIE9098_SCRATCH_14_REG 0x1C98
|
||||
#define PCIE9098_SCRATCH_15_REG 0x1C9C
|
||||
|
@ -1509,7 +1651,7 @@ 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)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
/* Tx/Rx/Event AMDA start address */
|
||||
t_u32 adma_reg_table[] = {0x10000, 0x10800, 0x10880, 0x11000, 0x11080};
|
||||
t_u8 j;
|
||||
|
@ -1537,9 +1679,10 @@ static int woal_pcie_dump_reg_info(moal_handle *phandle, t_u8 *buffer)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
if (IS_PCIE9098(phandle->card_type) ||
|
||||
IS_PCIENW62X(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIEAW693(phandle->card_type) ||
|
||||
IS_PCIE9097(phandle->card_type)) {
|
||||
reg = PCIE9098_SCRATCH_12_REG;
|
||||
dump_start_reg = PCIE9098_DUMP_REG_START;
|
||||
|
@ -1581,9 +1724,10 @@ static int woal_pcie_dump_reg_info(moal_handle *phandle, t_u8 *buffer)
|
|||
}
|
||||
i++;
|
||||
}
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
if (IS_PCIE9098(phandle->card_type) ||
|
||||
IS_PCIENW62X(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIEAW693(phandle->card_type) ||
|
||||
IS_PCIE9097(phandle->card_type)) {
|
||||
drv_ptr += sprintf(
|
||||
drv_ptr,
|
||||
|
@ -1604,7 +1748,8 @@ 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_PCIENW62X(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIEAW693(phandle->card_type) ||
|
||||
IS_PCIE9097(phandle->card_type)) {
|
||||
drv_ptr += sprintf(drv_ptr,
|
||||
"ADMA Tx/Rx/Event/Cmd/CmdResp registers:\n");
|
||||
|
@ -1658,7 +1803,7 @@ 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)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
/* Tx/Rx/Event AMDA start address */
|
||||
t_u32 adma_reg_table[] = {0x10000, 0x10800, 0x10880, 0x11000, 0x11080};
|
||||
t_u8 j;
|
||||
|
@ -1682,9 +1827,10 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
if (IS_PCIE9098(phandle->card_type) ||
|
||||
IS_PCIENW62X(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIEAW693(phandle->card_type) ||
|
||||
IS_PCIE9097(phandle->card_type)) {
|
||||
reg = PCIE9098_SCRATCH_12_REG;
|
||||
dump_start_reg = PCIE9098_DUMP_START_REG;
|
||||
|
@ -1721,9 +1867,10 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
|
|||
}
|
||||
i++;
|
||||
}
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
if (IS_PCIE9098(phandle->card_type) ||
|
||||
IS_PCIENW62X(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIEAW693(phandle->card_type) ||
|
||||
IS_PCIE9097(phandle->card_type)) {
|
||||
PRINTM(MMSG, "PCIE registers from offset 0x1c20 to 0x1c9c:\n");
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
@ -1742,7 +1889,8 @@ static void woal_pcie_reg_dbg(moal_handle *phandle)
|
|||
PRINTM(MMSG, "%s\n", buf);
|
||||
}
|
||||
if (IS_PCIE9098(phandle->card_type) ||
|
||||
IS_PCIENW62X(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIEAW693(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++) {
|
||||
|
@ -1810,16 +1958,17 @@ static memory_type_mapping mem_type_mapping_tbl_8897[] = {
|
|||
#endif
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIENW62X)
|
||||
defined(PCIEIW624)
|
||||
#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)
|
||||
defined(PCIE9097) || defined(PCIEIW624)
|
||||
/**
|
||||
* @brief This function reads data by 8 bit from card register
|
||||
*
|
||||
|
@ -1842,10 +1991,12 @@ static mlan_status woal_read_reg_eight_bit(moal_handle *handle, t_u32 reg,
|
|||
*
|
||||
* @param phandle A pointer to moal_handle
|
||||
* @param doneflag done flag
|
||||
* @param resetflag reset flag;
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS
|
||||
*/
|
||||
static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
|
||||
static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag,
|
||||
t_u8 resetflag)
|
||||
{
|
||||
int ret = 0;
|
||||
int tries = 0;
|
||||
|
@ -1867,41 +2018,48 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
if (IS_PCIE9098(phandle->card_type) ||
|
||||
IS_PCIENW62X(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIEAW693(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\n");
|
||||
PRINTM(MERROR, "PCIE Write ERR, reg=0x%x debug_reay=0x%x\n",
|
||||
dump_ctrl_reg, debug_host_ready);
|
||||
return RDWR_STATUS_FAILURE;
|
||||
}
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
if (IS_PCIE9098(phandle->card_type) ||
|
||||
IS_PCIENW62X(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIEAW693(phandle->card_type) ||
|
||||
IS_PCIE9097(phandle->card_type)) {
|
||||
if (phandle->event_fw_dump)
|
||||
if (phandle->event_fw_dump || resetflag)
|
||||
return RDWR_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
ret = woal_pcie_read_reg(phandle, dump_ctrl_reg, ®_data);
|
||||
if (ret) {
|
||||
PRINTM(MERROR, "PCIE Read DEBUG_DUMP_CTRL_REG fail\n");
|
||||
PRINTM(MERROR, "PCIE Read DEBUG_DUMP_CTRL_REG 0x%x fail\n",
|
||||
dump_ctrl_reg);
|
||||
return RDWR_STATUS_FAILURE;
|
||||
}
|
||||
for (tries = 0; tries < MAX_POLL_TRIES; tries++) {
|
||||
ret = woal_read_reg_eight_bit(phandle, dump_ctrl_reg,
|
||||
&ctrl_data);
|
||||
if (ret) {
|
||||
PRINTM(MERROR, "PCIE READ ERR\n");
|
||||
PRINTM(MERROR, "PCIE READ reg 0x%x 8bit ERR\n",
|
||||
dump_ctrl_reg);
|
||||
return RDWR_STATUS_FAILURE;
|
||||
}
|
||||
if (ctrl_data == DEBUG_FW_DONE)
|
||||
|
@ -1909,7 +2067,9 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
|
|||
if (doneflag && ctrl_data == doneflag)
|
||||
return RDWR_STATUS_DONE;
|
||||
if (ctrl_data != debug_host_ready) {
|
||||
PRINTM(MMSG, "The ctrl reg was changed, try again!\n");
|
||||
PRINTM(MMSG,
|
||||
"The ctrl reg was changed, ctrl_data=0x%x, host_ready:0x%x try again!\n",
|
||||
ctrl_data, debug_host_ready);
|
||||
ret = woal_pcie_write_reg(phandle, dump_ctrl_reg,
|
||||
debug_host_ready);
|
||||
if (ret) {
|
||||
|
@ -1924,7 +2084,8 @@ static rdwr_status woal_pcie_rdwr_firmware(moal_handle *phandle, t_u8 doneflag)
|
|||
#endif
|
||||
}
|
||||
if (ctrl_data == debug_host_ready) {
|
||||
PRINTM(MERROR, "Fail to pull ctrl_data\n");
|
||||
PRINTM(MERROR, "Fail to pull ctrl_data=0x%x host_ready=0x%x\n",
|
||||
ctrl_data, debug_host_ready);
|
||||
return RDWR_STATUS_FAILURE;
|
||||
}
|
||||
return RDWR_STATUS_SUCCESS;
|
||||
|
@ -1953,6 +2114,9 @@ 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;
|
||||
|
||||
|
@ -1960,6 +2124,7 @@ 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));
|
||||
|
@ -1971,12 +2136,25 @@ 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))
|
||||
if (RDWR_STATUS_FAILURE ==
|
||||
woal_pcie_rdwr_firmware(phandle, doneflag, 0))
|
||||
goto done;
|
||||
reg = DEBUG_DUMP_START_REG;
|
||||
ret = woal_read_reg_eight_bit(phandle, reg, &dump_num);
|
||||
|
@ -1990,7 +2168,7 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle)
|
|||
idx < dump_num && idx < ARRAY_SIZE(mem_type_mapping_tbl_8897);
|
||||
idx++) {
|
||||
if (RDWR_STATUS_FAILURE ==
|
||||
woal_pcie_rdwr_firmware(phandle, doneflag))
|
||||
woal_pcie_rdwr_firmware(phandle, doneflag, 0))
|
||||
goto done;
|
||||
memory_size = 0;
|
||||
reg = DEBUG_DUMP_START_REG;
|
||||
|
@ -2034,7 +2212,7 @@ static void woal_pcie_dump_fw_info_v1(moal_handle *phandle)
|
|||
PRINTM(MMSG, "Start %s output %u.%06u, please wait...\n",
|
||||
mem_type_mapping_tbl[idx].mem_name, sec, usec);
|
||||
do {
|
||||
stat = woal_pcie_rdwr_firmware(phandle, doneflag);
|
||||
stat = woal_pcie_rdwr_firmware(phandle, doneflag, 0);
|
||||
if (RDWR_STATUS_FAILURE == stat)
|
||||
goto done;
|
||||
|
||||
|
@ -2059,11 +2237,25 @@ 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;
|
||||
|
@ -2071,11 +2263,20 @@ 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);
|
||||
|
@ -2091,7 +2292,7 @@ done:
|
|||
#endif
|
||||
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIENW62X)
|
||||
defined(PCIEIW624)
|
||||
/**
|
||||
* @brief This function dump firmware memory to file
|
||||
*
|
||||
|
@ -2110,6 +2311,10 @@ 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;
|
||||
|
@ -2119,13 +2324,14 @@ 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 defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
if (IS_PCIE9098(phandle->card_type) ||
|
||||
IS_PCIENW62X(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIEAW693(phandle->card_type) ||
|
||||
IS_PCIE9097(phandle->card_type)) {
|
||||
if (phandle->event_fw_dump) {
|
||||
if (RDWR_STATUS_FAILURE !=
|
||||
woal_pcie_rdwr_firmware(phandle, doneflag)) {
|
||||
woal_pcie_rdwr_firmware(phandle, doneflag, 0)) {
|
||||
PRINTM(MMSG,
|
||||
"====PCIE FW DUMP EVENT MODE START ====\n");
|
||||
return;
|
||||
|
@ -2133,17 +2339,33 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
#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 */
|
||||
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))
|
||||
if (RDWR_STATUS_FAILURE ==
|
||||
woal_pcie_rdwr_firmware(phandle, doneflag, 0))
|
||||
goto done;
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
if (IS_PCIE9098(phandle->card_type) ||
|
||||
IS_PCIENW62X(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIEAW693(phandle->card_type) ||
|
||||
IS_PCIE9097(phandle->card_type)) {
|
||||
dump_start_reg = PCIE9098_DUMP_START_REG;
|
||||
dump_end_reg = PCIE9098_DUMP_END_REG;
|
||||
|
@ -2178,7 +2400,7 @@ static void woal_pcie_dump_fw_info_v2(moal_handle *phandle)
|
|||
PRINTM(MMSG, "Start %s output %u.%06u, please wait...\n",
|
||||
mem_type_mapping_tbl->mem_name, sec, usec);
|
||||
do {
|
||||
stat = woal_pcie_rdwr_firmware(phandle, doneflag);
|
||||
stat = woal_pcie_rdwr_firmware(phandle, doneflag, 0);
|
||||
if (RDWR_STATUS_FAILURE == stat)
|
||||
goto done;
|
||||
|
||||
|
@ -2231,6 +2453,7 @@ 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;
|
||||
|
@ -2240,6 +2463,20 @@ 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);
|
||||
|
@ -2247,6 +2484,13 @@ 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);
|
||||
|
@ -2266,9 +2510,10 @@ done:
|
|||
*/
|
||||
static t_u8 woal_pcie_is_second_mac(moal_handle *handle)
|
||||
{
|
||||
#ifdef PCIE9098
|
||||
#if defined(PCIE9098)
|
||||
pcie_service_card *card = (pcie_service_card *)handle->card;
|
||||
if (card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1)
|
||||
if ((card->dev->device == PCIE_DEVICE_ID_88W9098P_FN1) ||
|
||||
(card->dev->device == PCIE_DEVICE_ID_88WAW693_FN1))
|
||||
return MTRUE;
|
||||
#endif
|
||||
return MFALSE;
|
||||
|
@ -2276,6 +2521,12 @@ static t_u8 woal_pcie_is_second_mac(moal_handle *handle)
|
|||
|
||||
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
|
||||
|
@ -2283,9 +2534,10 @@ static void woal_pcie_dump_fw_info(moal_handle *phandle)
|
|||
woal_pcie_dump_fw_info_v1(phandle);
|
||||
#endif
|
||||
#if defined(PCIE8997) || defined(PCIE9098) || defined(PCIE9097) || \
|
||||
defined(PCIENW62X)
|
||||
defined(PCIEIW624)
|
||||
if (IS_PCIE8997(phandle->card_type) ||
|
||||
IS_PCIENW62X(phandle->card_type) ||
|
||||
IS_PCIEAW693(phandle->card_type) ||
|
||||
IS_PCIEIW624(phandle->card_type) ||
|
||||
IS_PCIE9098(phandle->card_type) ||
|
||||
IS_PCIE9097(phandle->card_type)) {
|
||||
woal_pcie_dump_fw_info_v2(phandle);
|
||||
|
@ -2298,9 +2550,11 @@ static void woal_pcie_dump_fw_info(moal_handle *phandle)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
phandle->fw_dump = MFALSE;
|
||||
if (!phandle->priv_num)
|
||||
return;
|
||||
woal_send_fw_dump_complete_event(
|
||||
woal_get_priv(phandle, MLAN_BSS_ROLE_ANY));
|
||||
phandle->fw_dump = MFALSE;
|
||||
mlan_pm_wakeup_card(phandle->pmlan_adapter, MFALSE);
|
||||
queue_work(phandle->workqueue, &phandle->main_work);
|
||||
woal_process_hang(phandle);
|
||||
|
@ -2309,24 +2563,28 @@ 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
|
||||
#if defined(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)
|
||||
defined(PCIEIW624)
|
||||
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)
|
||||
defined(PCIEIW624)
|
||||
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;
|
||||
#endif
|
||||
#ifdef PCIEIW624
|
||||
t_u32 boot_mode_reg = handle->card_info->boot_mode_reg;
|
||||
t_u32 boot_mode;
|
||||
#endif
|
||||
|
||||
ENTER();
|
||||
|
||||
|
@ -2479,23 +2737,42 @@ static mlan_status woal_pcie_get_fw_name(moal_handle *handle)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef PCIENW62X
|
||||
if (IS_PCIENW62X(handle->card_type)) {
|
||||
#ifdef PCIEIW624
|
||||
if (IS_PCIEIW624(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;
|
||||
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)
|
||||
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_UARTUART) {
|
||||
if (handle->params.dual_nb)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
PCIEUARTNW62X_DEFAULT_COMBO_FW_NAME);
|
||||
PCIEUARTUARTIW624_DEFAULT_COMBO_FW_NAME);
|
||||
else
|
||||
strcpy(handle->card_info->fw_name,
|
||||
PCIEUSBNW62X_DEFAULT_COMBO_FW_NAME);
|
||||
PCIEUARTIW624_DEFAULT_COMBO_FW_NAME);
|
||||
} else if (strap == CARD_TYPE_PCIEIW624_UARTSPI) {
|
||||
if (handle->params.dual_nb)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
PCIEUARTSPIIW624_DEFAULT_COMBO_FW_NAME);
|
||||
else
|
||||
strcpy(handle->card_info->fw_name,
|
||||
PCIEUARTIW624_DEFAULT_COMBO_FW_NAME);
|
||||
} else {
|
||||
if (handle->params.dual_nb)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
PCIEUSBUSBIW624_DEFAULT_COMBO_FW_NAME);
|
||||
else
|
||||
strcpy(handle->card_info->fw_name,
|
||||
PCIEUSBIW624_DEFAULT_COMBO_FW_NAME);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -47,16 +47,23 @@ Change log:
|
|||
#define PCIE_DEVICE_ID_88W9097 (0x2b56)
|
||||
#endif
|
||||
|
||||
#ifdef PCIE9098
|
||||
#if defined(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)
|
||||
#endif
|
||||
|
||||
#ifdef PCIENW62X
|
||||
/** PCIE device ID for NW62X card FN0 */
|
||||
#define PCIE_DEVICE_ID_88WNW62X (0x3000)
|
||||
#ifdef PCIEIW624
|
||||
/** PCIE device ID for IW624 card FN0 */
|
||||
#define PCIE_DEVICE_ID_88WIW624 (0x3000)
|
||||
#endif
|
||||
|
||||
#if defined(PCIE9098)
|
||||
/** 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)
|
||||
#endif
|
||||
|
||||
#include <linux/version.h>
|
||||
|
@ -113,14 +120,18 @@ Change log:
|
|||
#define PCIE9097_WLAN_V1_FW_NAME "nxp/pcieiw620_wlan_v1.bin"
|
||||
#endif /* PCIE9097 */
|
||||
|
||||
#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 */
|
||||
#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 PCIEUARTUARTIW624_DEFAULT_COMBO_FW_NAME \
|
||||
"nxp/pcieuartuartiw624_combo.bin"
|
||||
#define PCIEUARTSPIIW624_DEFAULT_COMBO_FW_NAME "nxp/pcieuartspiiw624_combo.bin"
|
||||
#define PCIEUSBUSBIW624_DEFAULT_COMBO_FW_NAME "nxp/pcieusbusbiw624_combo.bin"
|
||||
#define PCIEIW624_DEFAULT_WLAN_FW_NAME "nxp/pcieiw624_wlan.bin"
|
||||
#endif /* PCIEIW624 */
|
||||
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIENW62X)
|
||||
#if defined(PCIE9098) || defined(PCIE9097) || defined(PCIEIW624)
|
||||
#define PCIE_NUM_MSIX_VECTORS 32
|
||||
#else
|
||||
#define PCIE_NUM_MSIX_VECTORS 4
|
||||
|
|
|
@ -515,7 +515,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], copy_len;
|
||||
int data[2] = {0}, copy_len;
|
||||
mlan_ioctl_req *req = NULL;
|
||||
mlan_ds_11n_cfg *cfg_11n = NULL;
|
||||
int ret = 0;
|
||||
|
@ -691,7 +691,7 @@ done:
|
|||
*/
|
||||
static int woal_11n_tx_cfg(moal_private *priv, struct iwreq *wrq)
|
||||
{
|
||||
int data[2], copy_len;
|
||||
int data[2] = {0}, copy_len;
|
||||
mlan_ioctl_req *req = NULL;
|
||||
mlan_ds_11n_cfg *cfg_11n = NULL;
|
||||
int ret = 0;
|
||||
|
@ -794,7 +794,7 @@ done:
|
|||
*/
|
||||
static int woal_11n_prio_tbl(moal_private *priv, struct iwreq *wrq)
|
||||
{
|
||||
int data[MAX_NUM_TID * 2], i, j, copy_len;
|
||||
int data[MAX_NUM_TID * 2] = {0}, i, j, copy_len;
|
||||
mlan_ioctl_req *req = NULL;
|
||||
mlan_ds_11n_cfg *cfg_11n = NULL;
|
||||
int ret = 0;
|
||||
|
@ -886,7 +886,7 @@ error:
|
|||
*/
|
||||
static int woal_addba_reject(moal_private *priv, struct iwreq *wrq)
|
||||
{
|
||||
int data[MAX_NUM_TID], ret = 0, i, copy_len;
|
||||
int data[MAX_NUM_TID] = {0}, 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 +968,7 @@ error:
|
|||
*/
|
||||
static int woal_addba_para_updt(moal_private *priv, struct iwreq *wrq)
|
||||
{
|
||||
int data[5], ret = 0, copy_len;
|
||||
int data[5] = {0}, ret = 0, copy_len;
|
||||
mlan_ioctl_req *req = NULL;
|
||||
mlan_ds_11n_cfg *cfg_11n = NULL;
|
||||
int data_length = wrq->u.data.length;
|
||||
|
@ -1160,7 +1160,9 @@ 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));
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info))
|
||||
PRINTM(MINFO, "Fail to get bss_info\n");
|
||||
if (bss_info.is_hs_configured) {
|
||||
PRINTM(MERROR, "HS already configured\n");
|
||||
ret = -EFAULT;
|
||||
|
@ -1170,8 +1172,11 @@ 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) {
|
||||
woal_set_get_hs_params(priv, MLAN_ACT_GET, MOAL_IOCTL_WAIT,
|
||||
&hscfg);
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
if (data_length)
|
||||
|
@ -1848,10 +1853,9 @@ 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_FRAME |
|
||||
MLAN_NETMON_MANAGEMENT_FRAME |
|
||||
MLAN_NETMON_CONTROL_FRAME)) {
|
||||
if (!data[1] || data[1] & ~(MLAN_NETMON_DATA |
|
||||
MLAN_NETMON_MANAGEMENT |
|
||||
MLAN_NETMON_CONTROL)) {
|
||||
PRINTM(MERROR,
|
||||
"NET_MON: Invalid filter flag\n");
|
||||
ret = -EINVAL;
|
||||
|
@ -1964,130 +1968,144 @@ static int woal_get_log(moal_private *priv, struct iwreq *wrq)
|
|||
}
|
||||
|
||||
if (wrq->u.data.pointer) {
|
||||
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);
|
||||
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);
|
||||
if (priv->phandle->fw_getlog_enable) {
|
||||
sprintf(buf + strlen(buf), "tx_frag_cnt %u\n",
|
||||
stats.tx_frag_cnt);
|
||||
sprintf(buf + strlen(buf), "qos_tx_frag_cnt ");
|
||||
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 ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_tx_frag_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_tx_frag_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf), "\nqos_failed_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_failed_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_failed_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_failed_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf), "\nqos_retry_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_retry_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_retry_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_retry_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf), "\nqos_multi_retry_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_multi_retry_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_multi_retry_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_multi_retry_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf), "\nqos_frm_dup_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_frm_dup_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_frm_dup_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_frm_dup_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf), "\nqos_rts_suc_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_rts_suc_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_rts_suc_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_rts_suc_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf),
|
||||
"\nqos_rts_failure_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_rts_failure_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_rts_failure_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_rts_failure_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf), "\nqos_ack_failure_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_ack_failure_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_ack_failure_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_ack_failure_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf), "\nqos_rx_frag_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_rx_frag_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_rx_frag_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_rx_frag_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf), "\nqos_tx_frm_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_tx_frm_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_tx_frm_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_tx_frm_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf), "\nqos_discarded_frm_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_discarded_frm_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_discarded_frm_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_discarded_frm_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf), "\nqos_mpdus_rx_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_mpdus_rx_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_mpdus_rx_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_mpdus_rx_cnt[i]);
|
||||
}
|
||||
sprintf(buf + strlen(buf), "\nqos_retries_rx_cnt ");
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"\nqos_retries_rx_cnt ");
|
||||
for (i = 0; i < 8; i++) {
|
||||
sprintf(buf + strlen(buf), "%u ",
|
||||
stats.qos_retries_rx_cnt[i]);
|
||||
snprintf(buf + strlen(buf), GETLOG_BUFSIZE,
|
||||
"%u ", stats.qos_retries_rx_cnt[i]);
|
||||
}
|
||||
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);
|
||||
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);
|
||||
}
|
||||
wrq->u.data.length = MIN(GETLOG_BUFSIZE - 1, strlen(buf) + 1);
|
||||
if (copy_to_user(wrq->u.data.pointer, buf,
|
||||
|
@ -2165,8 +2183,9 @@ static int woal_tx_power_cfg(moal_private *priv, struct iwreq *wrq)
|
|||
ENTER();
|
||||
|
||||
memset(&bss_info, 0, sizeof(bss_info));
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
|
||||
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info))
|
||||
PRINTM(MINFO, "Fail to get bss_info\n");
|
||||
memset(data, 0, sizeof(data));
|
||||
user_data_len = wrq->u.data.length;
|
||||
copy_len = MIN(sizeof(data), sizeof(int) * user_data_len);
|
||||
|
@ -2687,7 +2706,9 @@ static int woal_set_get_radio(moal_private *priv, struct iwreq *wrq)
|
|||
ret = -EFAULT;
|
||||
} else {
|
||||
/* Get radio status */
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info))
|
||||
PRINTM(MINFO, "Fail to get bss_info\n");
|
||||
wrq->u.data.length = 1;
|
||||
if (copy_to_user(wrq->u.data.pointer, &bss_info.radio_on,
|
||||
sizeof(bss_info.radio_on))) {
|
||||
|
@ -3826,33 +3847,35 @@ 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 += sprintf(buf + len, "ssid:");
|
||||
len += snprintf(buf + len, sizeof(buf), "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 += sprintf(buf + len, " ");
|
||||
len += snprintf(buf + len, sizeof(buf), " ");
|
||||
}
|
||||
if (memcmp(&sec->param.passphrase.bssid, zero_mac,
|
||||
sizeof(zero_mac))) {
|
||||
mac = (t_u8 *)&sec->param.passphrase.bssid;
|
||||
len += sprintf(buf + len, "bssid:");
|
||||
len += snprintf(buf + len, sizeof(buf), "bssid:");
|
||||
for (i = 0; i < ETH_ALEN - 1; ++i)
|
||||
len += sprintf(buf + len, "%02x:", mac[i]);
|
||||
len += sprintf(buf + len, "%02x ", mac[i]);
|
||||
len += snprintf(buf + len, sizeof(buf),
|
||||
"%02x:", mac[i]);
|
||||
len += snprintf(buf + len, sizeof(buf), "%02x ",
|
||||
mac[i]);
|
||||
}
|
||||
if (sec->param.passphrase.psk_type == MLAN_PSK_PMK) {
|
||||
len += sprintf(buf + len, "psk:");
|
||||
len += snprintf(buf + len, sizeof(buf), "psk:");
|
||||
for (i = 0; i < MLAN_MAX_KEY_LENGTH; ++i)
|
||||
len += sprintf(
|
||||
buf + len, "%02x",
|
||||
len += snprintf(
|
||||
buf + len, sizeof(buf), "%02x",
|
||||
sec->param.passphrase.psk.pmk.pmk[i]);
|
||||
len += sprintf(buf + len, "\n");
|
||||
len += snprintf(buf + len, sizeof(buf), "\n");
|
||||
}
|
||||
if (sec->param.passphrase.psk_type == MLAN_PSK_PASSPHRASE) {
|
||||
len += sprintf(
|
||||
buf + len, "passphrase:%s\n",
|
||||
len += snprintf(
|
||||
buf + len, sizeof(buf), "passphrase:%s\n",
|
||||
sec->param.passphrase.psk.passphrase.passphrase);
|
||||
}
|
||||
if (wrq->u.data.pointer) {
|
||||
|
@ -3972,11 +3995,11 @@ static int woal_get_key_ioctl(moal_private *priv, struct iwreq *wrq)
|
|||
goto done;
|
||||
}
|
||||
if (sec->param.encrypt_key.key_len) {
|
||||
sprintf((char *)tmp, "\n%s", "PTK: ");
|
||||
snprintf((char *)tmp, sizeof(key_ascii), "\n%s", "PTK: ");
|
||||
tmp += 5;
|
||||
for (i = 0; i < sec->param.encrypt_key.key_len; i++)
|
||||
tmp += sprintf((char *)tmp, "%02x",
|
||||
sec->param.encrypt_key.key_material[i]);
|
||||
tmp += snprintf((char *)tmp, sizeof(key_ascii), "%02x",
|
||||
sec->param.encrypt_key.key_material[i]);
|
||||
}
|
||||
|
||||
/* Get Multicase Key */
|
||||
|
@ -3993,11 +4016,11 @@ static int woal_get_key_ioctl(moal_private *priv, struct iwreq *wrq)
|
|||
goto done;
|
||||
}
|
||||
if (sec->param.encrypt_key.key_len) {
|
||||
sprintf((char *)tmp, "\n%s", "GTK: ");
|
||||
snprintf((char *)tmp, sizeof(key_ascii), "\n%s", "GTK: ");
|
||||
tmp += 5;
|
||||
for (i = 0; i < sec->param.encrypt_key.key_len; i++)
|
||||
tmp += sprintf((char *)tmp, "%02x",
|
||||
sec->param.encrypt_key.key_material[i]);
|
||||
tmp += snprintf((char *)tmp, sizeof(key_ascii), "%02x",
|
||||
sec->param.encrypt_key.key_material[i]);
|
||||
}
|
||||
|
||||
/* Get IGTK Key */
|
||||
|
@ -4014,11 +4037,11 @@ static int woal_get_key_ioctl(moal_private *priv, struct iwreq *wrq)
|
|||
goto done;
|
||||
}
|
||||
if (sec->param.encrypt_key.key_len) {
|
||||
sprintf((char *)tmp, "\n%s", "IGTK: ");
|
||||
snprintf((char *)tmp, sizeof(key_ascii), "\n%s", "IGTK: ");
|
||||
tmp += 6;
|
||||
for (i = 0; i < sec->param.encrypt_key.key_len; i++)
|
||||
tmp += sprintf((char *)tmp, "%02x",
|
||||
sec->param.encrypt_key.key_material[i]);
|
||||
tmp += snprintf((char *)tmp, sizeof(key_ascii), "%02x",
|
||||
sec->param.encrypt_key.key_material[i]);
|
||||
}
|
||||
|
||||
wrq->u.data.length = sizeof(key_ascii) + 1;
|
||||
|
@ -4336,7 +4359,7 @@ static int woal_tx_bf_cfg_ioctl(moal_private *priv, struct iwreq *wrq)
|
|||
*token = '\0';
|
||||
str = token + 1;
|
||||
}
|
||||
woal_atoi(&tmp_val, pos);
|
||||
(void)woal_atoi(&tmp_val, pos);
|
||||
switch (i) {
|
||||
case BF_ENABLE_PARAM:
|
||||
bf_global->bf_enbl =
|
||||
|
@ -4433,11 +4456,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]);
|
||||
woal_atoi(&tmp_val, &buf[20]);
|
||||
(void)woal_atoi(&tmp_val, &buf[20]);
|
||||
tx_bf_peer->bf_enbl = (t_u8)tmp_val;
|
||||
woal_atoi(&tmp_val, &buf[22]);
|
||||
(void)woal_atoi(&tmp_val, &buf[22]);
|
||||
tx_bf_peer->sounding_enbl = (t_u8)tmp_val;
|
||||
woal_atoi(&tmp_val, &buf[24]);
|
||||
(void)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;
|
||||
|
@ -4492,73 +4515,89 @@ 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 +=
|
||||
sprintf(buf + data_length, "%d ",
|
||||
(int)bf_global->sounding_interval);
|
||||
data_length += sprintf(buf + data_length, "%d ",
|
||||
(int)bf_global->bf_mode);
|
||||
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);
|
||||
break;
|
||||
case SET_GET_BF_PERIODICITY:
|
||||
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);
|
||||
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);
|
||||
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 +=
|
||||
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]);
|
||||
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);
|
||||
data_length +=
|
||||
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);
|
||||
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);
|
||||
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 +=
|
||||
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]);
|
||||
snprintf(buf + data_length,
|
||||
MAX_IN_OUT_CHAR, "%c", ';');
|
||||
data_length += snprintf(buf + data_length,
|
||||
MAX_IN_OUT_CHAR, "%d",
|
||||
bf_snr->snr);
|
||||
data_length +=
|
||||
sprintf(buf + data_length, "%c", ';');
|
||||
data_length += sprintf(buf + data_length, "%d",
|
||||
bf_snr->snr);
|
||||
data_length +=
|
||||
sprintf(buf + data_length, "%c", ' ');
|
||||
snprintf(buf + data_length,
|
||||
MAX_IN_OUT_CHAR, "%c", ' ');
|
||||
bf_snr++;
|
||||
}
|
||||
break;
|
||||
|
@ -4740,6 +4779,7 @@ static int woal_set_user_scan_ext_ioctl(moal_private *priv, struct iwreq *wrq)
|
|||
MIN(wrq->u.data.length,
|
||||
sizeof(wlan_user_scan_cfg)))) {
|
||||
PRINTM(MINFO, "Copy from user failed\n");
|
||||
kfree(scan_req);
|
||||
LEAVE();
|
||||
return -EFAULT;
|
||||
}
|
||||
|
@ -6095,7 +6135,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], copy_len;
|
||||
int data[4] = {0}, copy_len;
|
||||
int data_length = wrq->u.data.length;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
ENTER();
|
||||
|
@ -6258,7 +6298,7 @@ done:
|
|||
static int woal_cfp_code(moal_private *priv, struct iwreq *wrq)
|
||||
{
|
||||
int ret = 0;
|
||||
int data[2], copy_len;
|
||||
int data[2] = {0}, copy_len;
|
||||
int data_length = wrq->u.data.length;
|
||||
mlan_ioctl_req *req = NULL;
|
||||
mlan_ds_misc_cfg *misc_cfg = NULL;
|
||||
|
@ -6381,9 +6421,14 @@ static int woal_set_get_tx_rx_ant(moal_private *priv, struct iwreq *wrq)
|
|||
radio->param.ant_cfg.rx_antenna = data[1];
|
||||
} else {
|
||||
radio->param.ant_cfg_1x1.antenna = data[0];
|
||||
if (wrq->u.data.length == 2)
|
||||
if (wrq->u.data.length == 2) {
|
||||
if (data[1] > 0xffff) {
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
radio->param.ant_cfg_1x1.evaluate_time =
|
||||
data[1];
|
||||
}
|
||||
}
|
||||
req->action = MLAN_ACT_SET;
|
||||
} else
|
||||
|
@ -6432,7 +6477,7 @@ done:
|
|||
*/
|
||||
static int woal_ind_rst_ioctl(moal_private *priv, struct iwreq *wrq)
|
||||
{
|
||||
int data[2], data_length = wrq->u.data.length, copy_len;
|
||||
int data[2] = {0}, data_length = wrq->u.data.length, copy_len;
|
||||
int ret = 0;
|
||||
mlan_ds_misc_cfg *misc = NULL;
|
||||
mlan_ioctl_req *req = NULL;
|
||||
|
|
|
@ -29,6 +29,10 @@ 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
|
||||
|
@ -60,6 +64,9 @@ static char *szModes[] = {
|
|||
};
|
||||
#endif
|
||||
|
||||
mlan_status parse_arguments(t_u8 *pos, int *data, int datalen,
|
||||
int *user_data_len);
|
||||
|
||||
/********************************************************
|
||||
Global Variables
|
||||
********************************************************/
|
||||
|
@ -81,6 +88,7 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data)
|
|||
struct net_device *netdev = (struct net_device *)sfp->private;
|
||||
char fmt[MLAN_MAX_VER_STR_LEN];
|
||||
moal_private *priv = (moal_private *)netdev_priv(netdev);
|
||||
mlan_fw_info fw_info;
|
||||
#ifdef STA_SUPPORT
|
||||
int i = 0;
|
||||
moal_handle *handle = NULL;
|
||||
|
@ -105,6 +113,8 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data)
|
|||
t_u8 c[4];
|
||||
} ver;
|
||||
|
||||
fw_info.uuid_lo = fw_info.uuid_hi = 0x0ULL;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (priv == NULL)
|
||||
|
@ -154,6 +164,11 @@ static int woal_info_proc_read(struct seq_file *sfp, void *data)
|
|||
ver.l = handle->fw_release_number;
|
||||
seq_printf(sfp, "firmware_major_version=%u.%u.%u\n", ver.c[2], ver.c[1],
|
||||
ver.c[0]);
|
||||
|
||||
woal_request_get_fw_info(priv, MOAL_IOCTL_WAIT, &fw_info);
|
||||
if (fw_info.uuid_lo || fw_info.uuid_hi)
|
||||
seq_printf(sfp, "uuid = %llx%llx\n", fw_info.uuid_lo,
|
||||
fw_info.uuid_hi);
|
||||
#ifdef WIFI_DIRECT_SUPPORT
|
||||
if (priv->bss_type == MLAN_BSS_TYPE_WIFIDIRECT) {
|
||||
if (GET_BSS_ROLE(priv) == MLAN_BSS_ROLE_STA)
|
||||
|
@ -401,6 +416,7 @@ 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;
|
||||
|
||||
|
@ -412,6 +428,7 @@ 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;
|
||||
|
@ -432,12 +449,147 @@ 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(string);
|
||||
kfree(tmp);
|
||||
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) ||
|
||||
IS_CARDAW693(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) {
|
||||
if (data[1] > 0xffff) {
|
||||
kfree(req);
|
||||
LEAVE();
|
||||
return MLAN_STATUS_FAILURE;
|
||||
}
|
||||
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
|
||||
*
|
||||
|
@ -451,8 +603,9 @@ static int parse_cmd52_string(const char *buffer, size_t len, int *func,
|
|||
static ssize_t woal_config_write(struct file *f, const char __user *buf,
|
||||
size_t count, loff_t *off)
|
||||
{
|
||||
char databuf[101];
|
||||
char databuf[200];
|
||||
char *line = NULL;
|
||||
int ret = 0;
|
||||
t_u32 config_data = 0;
|
||||
struct seq_file *sfp = f->private_data;
|
||||
moal_handle *handle = (moal_handle *)sfp->private;
|
||||
|
@ -523,18 +676,14 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
|
|||
if (ref_handle) {
|
||||
priv = woal_get_priv(ref_handle, MLAN_BSS_ROLE_ANY);
|
||||
if (priv) {
|
||||
#ifdef DEBUG_LEVEL1
|
||||
drvdbg &= ~MFW_D;
|
||||
#endif
|
||||
ref_handle->fw_dump_status = MTRUE;
|
||||
woal_mlan_debug_info(priv);
|
||||
woal_moal_debug_info(priv, NULL, MFALSE);
|
||||
}
|
||||
}
|
||||
priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY);
|
||||
if (priv) {
|
||||
#ifdef DEBUG_LEVEL1
|
||||
drvdbg &= ~MFW_D;
|
||||
#endif
|
||||
handle->fw_dump_status = MTRUE;
|
||||
woal_mlan_debug_info(priv);
|
||||
woal_moal_debug_info(priv, NULL, MFALSE);
|
||||
handle->ops.dump_fw_info(handle);
|
||||
|
@ -566,7 +715,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);
|
||||
woal_request_fw_reload(handle, config_data);
|
||||
ret = woal_request_fw_reload(handle, config_data);
|
||||
}
|
||||
if (!strncmp(databuf, "drop_point=", strlen("drop_point="))) {
|
||||
line += strlen("drop_point") + 1;
|
||||
|
@ -595,6 +744,11 @@ static ssize_t woal_config_write(struct file *f, const char __user *buf,
|
|||
PRINTM(MMSG, "on=%d drop_point=%d\n", handle->tp_acnt.on,
|
||||
handle->tp_acnt.drop_point);
|
||||
}
|
||||
if (!strncmp(databuf, "hssetpara=", strlen("hssetpara="))) {
|
||||
line += strlen("hssetpara") + 1;
|
||||
PRINTM(MCMND, "hssetpara=%s\n", line);
|
||||
woal_process_proc_hssetpara(handle, line);
|
||||
}
|
||||
if (!strncmp(databuf, "rf_test_mode", strlen("rf_test_mode"))) {
|
||||
line += strlen("rf_test_mode") + 1;
|
||||
config_data = (t_u32)woal_string_to_number(line);
|
||||
|
@ -648,7 +802,9 @@ 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,
|
||||
|
@ -657,8 +813,18 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -674,6 +840,8 @@ static int woal_config_read(struct seq_file *sfp, void *data)
|
|||
{
|
||||
moal_handle *handle = (moal_handle *)sfp->private;
|
||||
int i;
|
||||
moal_private *priv = woal_get_priv(handle, MLAN_BSS_ROLE_ANY);
|
||||
mlan_ds_hs_cfg hscfg;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
@ -685,6 +853,13 @@ static int woal_config_read(struct seq_file *sfp, void *data)
|
|||
seq_printf(sfp, "hardware_status=%d\n", (int)handle->hardware_status);
|
||||
seq_printf(sfp, "netlink_num=%d\n", (int)handle->netlink_num);
|
||||
seq_printf(sfp, "drv_mode=%d\n", (int)handle->params.drv_mode);
|
||||
if (priv) {
|
||||
memset(&hscfg, 0, sizeof(mlan_ds_hs_cfg));
|
||||
(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",
|
||||
|
@ -751,7 +926,7 @@ static int woal_config_read(struct seq_file *sfp, void *data)
|
|||
seq_printf(sfp, " %u",
|
||||
handle->rf_data->tx_frame_data[i]);
|
||||
for (i = 13; i < 20; i++)
|
||||
seq_printf(sfp, " %u",
|
||||
seq_printf(sfp, " %d",
|
||||
handle->rf_data->tx_frame_data[i]);
|
||||
seq_printf(sfp, " %02x:%02x:%02x:%02x:%02x:%02x",
|
||||
handle->rf_data->bssid[0],
|
||||
|
@ -767,10 +942,117 @@ 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, " %u", handle->rf_data->he_tb_tx[4]);
|
||||
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, "\n");
|
||||
}
|
||||
// Read current antcfg configuration
|
||||
woal_priv_get_tx_rx_ant(sfp, priv);
|
||||
|
||||
MODULE_PUT;
|
||||
LEAVE();
|
||||
return 0;
|
||||
|
@ -806,6 +1088,7 @@ 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;
|
||||
|
@ -959,6 +1242,7 @@ static const struct file_operations fw_dump_fops = {
|
|||
.release = single_release,
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief wifi status proc read function
|
||||
|
@ -1030,11 +1314,11 @@ int woal_string_to_number(char *s)
|
|||
|
||||
if (!strncmp(s, "-", 1)) {
|
||||
pn = -1;
|
||||
s++;
|
||||
s = (char *)(s + 1);
|
||||
}
|
||||
if (!strncmp(s, "0x", 2) || !strncmp(s, "0X", 2)) {
|
||||
base = 16;
|
||||
s += 2;
|
||||
s = (char *)(s + 2);
|
||||
} else
|
||||
base = 10;
|
||||
|
||||
|
@ -1112,8 +1396,10 @@ 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();
|
||||
|
||||
|
@ -1155,7 +1441,7 @@ void woal_proc_init(moal_handle *handle)
|
|||
goto done;
|
||||
}
|
||||
|
||||
strcpy(config_proc_dir, "config");
|
||||
strncpy(config_proc_dir, "config", sizeof(config_proc_dir));
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
|
||||
r = proc_create_data(config_proc_dir, 0666, handle->proc_wlan,
|
||||
&config_proc_fops, handle);
|
||||
|
@ -1169,7 +1455,8 @@ void woal_proc_init(moal_handle *handle)
|
|||
if (!r)
|
||||
PRINTM(MERROR, "Fail to create proc config\n");
|
||||
|
||||
strcpy(drv_dump_dir, "drv_dump");
|
||||
#ifdef DUMP_TO_PROC
|
||||
strncpy(drv_dump_dir, "drv_dump", sizeof(drv_dump_dir));
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
|
||||
r = proc_create_data(drv_dump_dir, 0644, handle->proc_wlan,
|
||||
&drv_dump_fops, handle);
|
||||
|
@ -1183,7 +1470,7 @@ void woal_proc_init(moal_handle *handle)
|
|||
if (!r)
|
||||
PRINTM(MERROR, "Failed to create proc drv dump\n");
|
||||
|
||||
strcpy(fw_dump_dir, "fw_dump");
|
||||
strncpy(fw_dump_dir, "fw_dump", sizeof(fw_dump_dir));
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
|
||||
r = proc_create_data(fw_dump_dir, 0644, handle->proc_wlan,
|
||||
&fw_dump_fops, handle);
|
||||
|
@ -1196,6 +1483,7 @@ void woal_proc_init(moal_handle *handle)
|
|||
#endif
|
||||
if (!r)
|
||||
PRINTM(MERROR, "Failed to create proc fw dump\n");
|
||||
#endif
|
||||
|
||||
done:
|
||||
LEAVE();
|
||||
|
@ -1211,19 +1499,23 @@ 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) {
|
||||
strcpy(config_proc_dir, "config");
|
||||
strncpy(config_proc_dir, "config", sizeof(config_proc_dir));
|
||||
remove_proc_entry(config_proc_dir, handle->proc_wlan);
|
||||
strcpy(drv_dump_dir, "drv_dump");
|
||||
#ifdef DUMP_TO_PROC
|
||||
strncpy(drv_dump_dir, "drv_dump", sizeof(drv_dump_dir));
|
||||
remove_proc_entry(drv_dump_dir, handle->proc_wlan);
|
||||
strcpy(fw_dump_dir, "fw_dump");
|
||||
strncpy(fw_dump_dir, "fw_dump", sizeof(fw_dump_dir));
|
||||
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 */
|
||||
|
@ -1241,6 +1533,7 @@ 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;
|
||||
|
@ -1251,6 +1544,7 @@ void woal_proc_exit(moal_handle *handle)
|
|||
handle->drv_dump_len = 0;
|
||||
handle->drv_dump_buf = NULL;
|
||||
}
|
||||
#endif
|
||||
LEAVE();
|
||||
}
|
||||
|
||||
|
@ -1285,7 +1579,7 @@ void woal_create_proc_entry(moal_private *priv)
|
|||
LEAVE();
|
||||
return;
|
||||
}
|
||||
strcat(proc_dir_name, dev->name);
|
||||
strncat(proc_dir_name, dev->name, sizeof(proc_dir_name) - 1);
|
||||
/* Try to create adapterX/dev_name directory first under
|
||||
* /proc/mwlan/ */
|
||||
priv->proc_entry = proc_mkdir(proc_dir_name, proc_mwlan);
|
||||
|
@ -1324,7 +1618,7 @@ void woal_create_proc_entry(moal_private *priv)
|
|||
atomic_inc(&(priv->phandle->proc_wlan->count));
|
||||
#endif /* < 3.10.0 */
|
||||
#endif /* < 2.6.26 */
|
||||
strcpy(priv->proc_entry_name, dev->name);
|
||||
strncpy(priv->proc_entry_name, dev->name, IFNAMSIZ);
|
||||
if (priv->proc_entry) {
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
|
||||
r = proc_create_data("info", 0, priv->proc_entry,
|
||||
|
|
|
@ -139,12 +139,14 @@ Change log:
|
|||
#define SD9097_WLAN_V1_FW_NAME "nxp/sdiw620_wlan_v1.bin"
|
||||
#endif /* SD9097 */
|
||||
|
||||
#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 SDIW624
|
||||
#define SDIW624_DEFAULT_COMBO_FW_NAME "nxp/sdsdiw624_combo.bin"
|
||||
#define SDUARTIW624_COMBO_FW_NAME "nxp/sduartiw624_combo.bin"
|
||||
#define SDUARTSPIIW624_COMBO_FW_NAME "nxp/sduartspiiw624_combo.bin"
|
||||
#define SDUARTUARTIW624_COMBO_FW_NAME "nxp/sduartuartiw624_combo.bin"
|
||||
#define SDSDIW624_COMBO_FW_NAME "sdsdiw624_combo.bin"
|
||||
#define SDIW624_DEFAULT_WLAN_FW_NAME "nxp/sdiw624_wlan.bin"
|
||||
#endif /* SDIW624 */
|
||||
|
||||
#ifdef SD9177
|
||||
#define SD9177_A0 0x00
|
||||
|
@ -152,11 +154,14 @@ Change log:
|
|||
#define SD9177_DEFAULT_COMBO_FW_NAME "nxp/sdsd_nw61x.bin"
|
||||
#define SD9177_DEFAULT_COMBO_V1_FW_NAME "nxp/sduart_nw61x_v1.bin"
|
||||
#define SDUART9177_DEFAULT_COMBO_FW_NAME "nxp/sduart_nw61x.bin"
|
||||
#define SDSD9177_DEFAULT_COMBO_FW_NAME "sdsd_nw61x.bin"
|
||||
#define SDSD9177_DEFAULT_COMBO_FW_NAME "nxp/sdsd_nw61x.bin"
|
||||
#define SD9177_DEFAULT_WLAN_FW_NAME "nxp/sd_w61x.bin"
|
||||
#define SDUART9177_DEFAULT_COMBO_V1_FW_NAME "nxp/sduart_nw61x_v1.bin"
|
||||
#define SDSD9177_DEFAULT_COMBO_V1_FW_NAME "sdsd_nw61x_v1.bin"
|
||||
#define SDSD9177_DEFAULT_COMBO_V1_FW_NAME "nxp/sdsd_nw61x_v1.bin"
|
||||
#define SD9177_DEFAULT_WLAN_V1_FW_NAME "nxp/sd_w61x_v1.bin"
|
||||
#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
|
@ -95,10 +95,6 @@ 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
|
@ -35,6 +35,9 @@ Change log:
|
|||
#if defined(STA_CFG80211) && defined(UAP_CFG80211)
|
||||
#include "moal_cfg80211.h"
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
|
||||
#include <linux/compat.h>
|
||||
#endif
|
||||
|
||||
/********************************************************
|
||||
Local Variables
|
||||
|
@ -429,7 +432,7 @@ static int woal_uap_band_steer(struct net_device *dev, struct ifreq *req)
|
|||
}
|
||||
DBG_HEXDUMP(MCMD_D, "band_steer_para", (t_u8 *)¶m, sizeof(param));
|
||||
|
||||
ioctl_req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_band_steer_cfg));
|
||||
ioctl_req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
|
||||
if (ioctl_req == NULL) {
|
||||
LEAVE();
|
||||
return -ENOMEM;
|
||||
|
@ -505,8 +508,7 @@ static int woal_uap_beacon_stuck(struct net_device *dev, struct ifreq *req)
|
|||
DBG_HEXDUMP(MCMD_D, "beacon_stuck_detect_para", (t_u8 *)¶m,
|
||||
sizeof(param));
|
||||
|
||||
ioctl_req = woal_alloc_mlan_ioctl_req(
|
||||
sizeof(mlan_ds_beacon_stuck_param_cfg));
|
||||
ioctl_req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
|
||||
if (ioctl_req == NULL) {
|
||||
LEAVE();
|
||||
return -ENOMEM;
|
||||
|
@ -834,6 +836,7 @@ static int woal_uap_snmp_mib(struct net_device *dev, struct ifreq *req)
|
|||
snmp->sub_command = MLAN_OID_SNMP_MIB_DOT11H;
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
PRINTM(MERROR, "%s: Unsupported SNMP_MIB OID (%d).\n", __func__,
|
||||
param.oid);
|
||||
goto done;
|
||||
|
@ -889,14 +892,14 @@ static int woal_uap_domain_info(struct net_device *dev, struct ifreq *req)
|
|||
mlan_ioctl_req *ioctl_req = NULL;
|
||||
mlan_ds_11d_cfg *cfg11d = NULL;
|
||||
domain_info_para param;
|
||||
t_u8 tlv[MAX_DOMAIN_TLV_LEN];
|
||||
t_u8 tlv[MAX_DOMAIN_TLV_LEN + MAX_REG_DOMAIN_TLV_LEN];
|
||||
t_u16 tlv_data_len = 0;
|
||||
int ret = 0;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
|
||||
ENTER();
|
||||
memset(¶m, 0, sizeof(param));
|
||||
memset(tlv, 0, MAX_DOMAIN_TLV_LEN);
|
||||
memset(tlv, 0, MAX_DOMAIN_TLV_LEN + MAX_REG_DOMAIN_TLV_LEN);
|
||||
|
||||
/* Sanity check */
|
||||
if (req->ifr_data == NULL) {
|
||||
|
@ -914,13 +917,14 @@ static int woal_uap_domain_info(struct net_device *dev, struct ifreq *req)
|
|||
DBG_HEXDUMP(MCMD_D, "domain_info_para", (t_u8 *)¶m, sizeof(param));
|
||||
if (param.action) {
|
||||
/* get tlv header */
|
||||
if (copy_from_user(tlv, req->ifr_data + sizeof(param),
|
||||
if (copy_from_user(&tlv[0], req->ifr_data + sizeof(param),
|
||||
TLV_HEADER_LEN)) {
|
||||
PRINTM(MERROR, "Copy from user failed\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
tlv_data_len = ((t_u16 *)(tlv))[1];
|
||||
tlv_data_len += MAX_REG_DOMAIN_TLV_LEN;
|
||||
if ((TLV_HEADER_LEN + tlv_data_len) > (int)sizeof(tlv)) {
|
||||
PRINTM(MERROR, "TLV buffer is overflowed");
|
||||
ret = -EINVAL;
|
||||
|
@ -1080,8 +1084,6 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef UAP_CFG80211
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
|
||||
/**
|
||||
* @brief uap channel NOP status check ioctl handler
|
||||
*
|
||||
|
@ -1135,8 +1137,6 @@ done:
|
|||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief configure channel switch count
|
||||
|
@ -1549,7 +1549,12 @@ static int woal_uap_hs_cfg(struct net_device *dev, struct ifreq *req,
|
|||
(hs_cfg.conditions != HOST_SLEEP_CFG_CANCEL ||
|
||||
invoke_hostcmd == MFALSE)) {
|
||||
memset(&bss_info, 0, sizeof(bss_info));
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info)) {
|
||||
PRINTM(MERROR, "ERR: failed in getting bss info\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
if (bss_info.is_hs_configured) {
|
||||
PRINTM(MERROR, "HS already configured\n");
|
||||
ret = -EFAULT;
|
||||
|
@ -1560,8 +1565,12 @@ static int woal_uap_hs_cfg(struct net_device *dev, struct ifreq *req,
|
|||
if (hs_cfg.flags & HS_CFG_FLAG_SET) {
|
||||
action = MLAN_ACT_SET;
|
||||
if (hs_cfg.flags != HS_CFG_FLAG_ALL) {
|
||||
woal_set_get_hs_params(priv, MLAN_ACT_GET,
|
||||
MOAL_IOCTL_WAIT, &hscfg);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_set_get_hs_params(priv, MLAN_ACT_GET,
|
||||
MOAL_IOCTL_WAIT, &hscfg)) {
|
||||
PRINTM(MERROR,
|
||||
"Unable to get HS Configuration\n");
|
||||
}
|
||||
}
|
||||
if (hs_cfg.flags & HS_CFG_FLAG_CONDITION)
|
||||
hscfg.conditions = hs_cfg.conditions;
|
||||
|
@ -1918,7 +1927,9 @@ static int woal_uap_antenna_cfg(struct net_device *dev, struct ifreq *req)
|
|||
radio->param.ant_cfg.rx_antenna = antenna_config.rx_mode;
|
||||
#if defined(STA_CFG80211) || defined(UAP_CFG80211)
|
||||
if (IS_CARD9098(priv->phandle->card_type) ||
|
||||
IS_CARD9097(priv->phandle->card_type)) {
|
||||
IS_CARD9097(priv->phandle->card_type) ||
|
||||
IS_CARDIW624(priv->phandle->card_type) ||
|
||||
IS_CARDAW693(priv->phandle->card_type)) {
|
||||
if (IS_STA_CFG80211(
|
||||
priv->phandle->params.cfg80211_wext))
|
||||
woal_cfg80211_notify_antcfg(
|
||||
|
@ -2102,27 +2113,8 @@ int woal_11h_chan_dfs_state(moal_private *priv, t_u8 action,
|
|||
mlan_ioctl_req *req = NULL;
|
||||
mlan_ds_11h_cfg *ds_11hcfg = NULL;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
#ifdef UAP_CFG80211
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
|
||||
int cfg80211_wext = priv->phandle->params.cfg80211_wext;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ENTER();
|
||||
#ifdef UAP_CFG80211
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
|
||||
if (action == MLAN_ACT_GET) {
|
||||
if (IS_UAP_CFG80211(cfg80211_wext)) {
|
||||
ret = woal_get_wiphy_chan_dfs_state(priv->wdev->wiphy,
|
||||
ch_dfs_state);
|
||||
if (!ret) {
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_11h_cfg));
|
||||
if (req == NULL) {
|
||||
ret = -ENOMEM;
|
||||
|
@ -2153,6 +2145,190 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief find all bonded channel.
|
||||
*
|
||||
* @param pri_chan primary channel
|
||||
* @param bw channel bandwidth
|
||||
* @param ch_dfs_state a pointer to mlan_ds_11h_chan_dfs_state array
|
||||
*
|
||||
* @return number of channel
|
||||
*/
|
||||
static int woal_uap_get_dfs_chan(t_u8 pri_chan, t_u8 bw,
|
||||
mlan_ds_11h_chan_dfs_state *ch_dfs_state)
|
||||
{
|
||||
int ht40_plus[] = {52, 60, 100, 108, 116, 124, 132, 140};
|
||||
int ht40_minus[] = {56, 64, 104, 112, 120, 128, 136, 144};
|
||||
int vht80_dfs[4][4] = {{52, 56, 60, 64},
|
||||
{100, 104, 108, 112},
|
||||
{116, 120, 124, 128},
|
||||
{132, 136, 140, 144}};
|
||||
t_u8 find = false;
|
||||
int i, j;
|
||||
t_u8 sec_chan = 0;
|
||||
mlan_ds_11h_chan_dfs_state *pos = ch_dfs_state;
|
||||
t_u8 n_chan = 1;
|
||||
|
||||
if (bw == CHAN_BW_20MHZ) {
|
||||
pos->channel = pri_chan;
|
||||
} else if (bw == CHAN_BW_40MHZ) {
|
||||
pos->channel = pri_chan;
|
||||
pos++;
|
||||
for (i = 0; i < (sizeof(ht40_minus) / sizeof(int)); i++) {
|
||||
if (pri_chan == (t_u8)ht40_plus[i]) {
|
||||
sec_chan = pri_chan + 4;
|
||||
n_chan = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < (sizeof(ht40_minus) / sizeof(int)); i++) {
|
||||
if (pri_chan == (t_u8)ht40_minus[i]) {
|
||||
sec_chan = pri_chan - 4;
|
||||
n_chan = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
pos->channel = sec_chan;
|
||||
} else if (bw == CHAN_BW_80MHZ) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (pri_chan == (t_u8)vht80_dfs[i][j]) {
|
||||
find = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (find)
|
||||
break;
|
||||
}
|
||||
if (find) {
|
||||
n_chan = 4;
|
||||
for (j = 0; j < n_chan; j++) {
|
||||
pos->channel = (t_u8)vht80_dfs[i][j];
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return n_chan;
|
||||
}
|
||||
|
||||
#ifdef UAP_CFG80211
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
|
||||
/**
|
||||
* @brief update channel dfs state in mlan module
|
||||
*
|
||||
* @param channel given radar channel
|
||||
* @param dfs_state dfs_state
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
void woal_set_channel_dfs_state(t_u8 channel, t_u8 dfs_state)
|
||||
{
|
||||
int index;
|
||||
mlan_ds_11h_chan_dfs_state ch_dfs_state;
|
||||
moal_private *priv;
|
||||
memset(&ch_dfs_state, 0, sizeof(ch_dfs_state));
|
||||
ch_dfs_state.channel = channel;
|
||||
ch_dfs_state.dfs_state = dfs_state;
|
||||
for (index = 0; index < MAX_MLAN_ADAPTER; index++) {
|
||||
if (m_handle[index]) {
|
||||
priv = woal_get_priv(m_handle[index],
|
||||
MLAN_BSS_ROLE_UAP);
|
||||
if (priv) {
|
||||
if (woal_11h_chan_dfs_state(priv, MLAN_ACT_SET,
|
||||
&ch_dfs_state))
|
||||
PRINTM(MERROR,
|
||||
"Set DFS state for chan:%d failed\n",
|
||||
ch_dfs_state.channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief update channel dfs state to all wiphy
|
||||
*
|
||||
* @param priv Pointer to the moal_private driver data struct
|
||||
* @param channel given radar channel
|
||||
* @param bandwidth channel's bandwidth
|
||||
* @param dfs_state dfs_state
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
void woal_update_channels_dfs_state(moal_private *priv, t_u8 channel,
|
||||
t_u8 bandwidth, t_u8 dfs_state)
|
||||
{
|
||||
mlan_ds_11h_chan_dfs_state ch_dfs_state[4];
|
||||
int cfg80211_wext = priv->phandle->params.cfg80211_wext;
|
||||
t_u8 n_chan;
|
||||
int i;
|
||||
ENTER();
|
||||
memset(ch_dfs_state, 0, sizeof(ch_dfs_state));
|
||||
n_chan = woal_uap_get_dfs_chan(channel, bandwidth, &ch_dfs_state[0]);
|
||||
if (IS_UAP_CFG80211(cfg80211_wext)) {
|
||||
for (i = 0; i < n_chan; i++) {
|
||||
woal_update_channel_dfs_state(ch_dfs_state[i].channel,
|
||||
dfs_state);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < n_chan; i++) {
|
||||
woal_set_channel_dfs_state(ch_dfs_state[i].channel, dfs_state);
|
||||
}
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief reset uap channel dfs_state to DFS_USABLE
|
||||
*
|
||||
* @param priv Pointer to the moal_private driver data struct
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
void woal_update_uap_channel_dfs_state(moal_private *priv)
|
||||
{
|
||||
mlan_ds_11h_chan_dfs_state ch_dfs_state;
|
||||
t_u8 channel;
|
||||
t_u8 bandwidth;
|
||||
ENTER();
|
||||
if (woal_is_etsi_country(priv->phandle->country_code)) {
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
if (priv->bss_role == MLAN_BSS_ROLE_UAP && priv->bss_started &&
|
||||
priv->uap_host_based) {
|
||||
channel = priv->chan.chan->hw_value;
|
||||
memset(&ch_dfs_state, 0, sizeof(ch_dfs_state));
|
||||
ch_dfs_state.channel = channel;
|
||||
if (woal_11h_chan_dfs_state(priv, MLAN_ACT_GET,
|
||||
&ch_dfs_state)) {
|
||||
PRINTM(MERROR, "%s: woal_11h_chan_dfs_state failed \n",
|
||||
__func__);
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
|
||||
if (ch_dfs_state.dfs_required &&
|
||||
ch_dfs_state.dfs_state == DFS_AVAILABLE) {
|
||||
switch (priv->chan.width) {
|
||||
case NL80211_CHAN_WIDTH_40:
|
||||
bandwidth = CHAN_BW_40MHZ;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_80:
|
||||
bandwidth = CHAN_BW_80MHZ;
|
||||
break;
|
||||
default:
|
||||
bandwidth = CHAN_BW_20MHZ;
|
||||
break;
|
||||
}
|
||||
woal_update_channels_dfs_state(priv, channel, bandwidth,
|
||||
DFS_USABLE);
|
||||
}
|
||||
}
|
||||
LEAVE();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief skip cac on specific channel
|
||||
* @and Wext
|
||||
|
@ -2173,7 +2349,9 @@ static int woal_uap_skip_cac(struct net_device *dev, struct ifreq *req)
|
|||
#endif
|
||||
#endif
|
||||
dfs_state_t dfs_state;
|
||||
mlan_ds_11h_chan_dfs_state ch_dfs_state;
|
||||
mlan_ds_11h_chan_dfs_state ch_dfs_state[4];
|
||||
t_u8 n_chan;
|
||||
int i = 0;
|
||||
ENTER();
|
||||
|
||||
/* Sanity check */
|
||||
|
@ -2194,27 +2372,39 @@ static int woal_uap_skip_cac(struct net_device *dev, struct ifreq *req)
|
|||
else
|
||||
dfs_state = DFS_USABLE;
|
||||
memset(&ch_dfs_state, 0, sizeof(ch_dfs_state));
|
||||
ch_dfs_state.channel = param.channel;
|
||||
woal_11h_chan_dfs_state(priv, MLAN_ACT_GET, &ch_dfs_state);
|
||||
if (ch_dfs_state.dfs_state == dfs_state)
|
||||
goto done;
|
||||
if (param.skip_cac && ch_dfs_state.dfs_state == DFS_USABLE)
|
||||
PRINTM(MMSG,
|
||||
"ZeroDFS: Requst skip cac on the channel %d which hasn't do CAC before!\n",
|
||||
param.channel);
|
||||
ch_dfs_state.dfs_state = dfs_state;
|
||||
woal_11h_chan_dfs_state(priv, MLAN_ACT_SET, &ch_dfs_state);
|
||||
PRINTM(MCMND, "ZeroDFS: Skip CAC on chan %d %d\n", param.channel,
|
||||
param.skip_cac);
|
||||
n_chan = woal_uap_get_dfs_chan(param.channel, param.bw,
|
||||
&ch_dfs_state[0]);
|
||||
for (i = 0; i < n_chan; i++) {
|
||||
if (woal_11h_chan_dfs_state(priv, MLAN_ACT_GET,
|
||||
&ch_dfs_state[i]))
|
||||
PRINTM(MERROR, "Get DFS state for chan:%d failed\n",
|
||||
ch_dfs_state[i].channel);
|
||||
}
|
||||
for (i = 0; i < n_chan; i++) {
|
||||
if (param.skip_cac && ch_dfs_state[i].dfs_state == DFS_USABLE)
|
||||
PRINTM(MMSG,
|
||||
"DFS: Requst skip cac on the channel %d which hasn't do CAC before!\n",
|
||||
ch_dfs_state[i].channel);
|
||||
ch_dfs_state[i].dfs_state = dfs_state;
|
||||
if (woal_11h_chan_dfs_state(priv, MLAN_ACT_SET,
|
||||
&ch_dfs_state[i]))
|
||||
PRINTM(MERROR, "Set DFS state for chan:%d failed\n",
|
||||
ch_dfs_state[i].channel);
|
||||
else
|
||||
PRINTM(MCMND, "DFS: Skip CAC on chan %d %d\n",
|
||||
ch_dfs_state[i].channel, param.skip_cac);
|
||||
}
|
||||
#ifdef UAP_CFG80211
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
|
||||
if (IS_UAP_CFG80211(cfg80211_wext)) {
|
||||
if (param.skip_cac)
|
||||
woal_update_channel_dfs_state(param.channel,
|
||||
DFS_AVAILABLE);
|
||||
else
|
||||
woal_update_channel_dfs_state(param.channel,
|
||||
DFS_USABLE);
|
||||
for (i = 0; i < n_chan; i++) {
|
||||
if (param.skip_cac)
|
||||
woal_update_channel_dfs_state(
|
||||
ch_dfs_state[i].channel, DFS_AVAILABLE);
|
||||
else
|
||||
woal_update_channel_dfs_state(
|
||||
ch_dfs_state[i].channel, DFS_USABLE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -2599,7 +2789,12 @@ static int woal_uap_radio_ctl(struct net_device *dev, struct ifreq *req)
|
|||
} else {
|
||||
/* Get radio status */
|
||||
memset(&bss_info, 0, sizeof(bss_info));
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info)) {
|
||||
PRINTM(MERROR, "ERR: failed in getting bss info\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
data[1] = bss_info.radio_on;
|
||||
if (copy_to_user(req->ifr_data, data, sizeof(data))) {
|
||||
|
@ -2791,8 +2986,8 @@ done:
|
|||
*
|
||||
* @return MLAN_STATUS_SUCCESS -- success, otherwise fail
|
||||
*/
|
||||
int woal_set_get_uap_power_mode(moal_private *priv, t_u32 action,
|
||||
mlan_ds_ps_mgmt *ps_mgmt)
|
||||
mlan_status woal_set_get_uap_power_mode(moal_private *priv, t_u32 action,
|
||||
mlan_ds_ps_mgmt *ps_mgmt)
|
||||
{
|
||||
mlan_ioctl_req *ioctl_req = NULL;
|
||||
mlan_ds_pm_cfg *pm_cfg = NULL;
|
||||
|
@ -3046,7 +3241,8 @@ static int woal_uap_get_sta_list_ioctl(struct net_device *dev,
|
|||
|
||||
/* Allocate an IOCTL request buffer */
|
||||
ioctl_req = (mlan_ioctl_req *)woal_alloc_mlan_ioctl_req(
|
||||
sizeof(mlan_ds_get_info));
|
||||
sizeof(mlan_ds_get_info) +
|
||||
(MAX_STA_LIST_IE_SIZE * MAX_NUM_CLIENTS));
|
||||
if (ioctl_req == NULL) {
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
|
@ -3192,8 +3388,10 @@ static mlan_status woal_enable_wapi(moal_private *priv, t_u8 enable)
|
|||
"Set AP setting failed! status=%d, error_code=0x%x\n",
|
||||
status, req->status_code);
|
||||
}
|
||||
if (enable)
|
||||
woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_START);
|
||||
if (enable) {
|
||||
if (woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_START))
|
||||
PRINTM(MERROR, "%s: uap bss start failed \n", __func__);
|
||||
}
|
||||
done:
|
||||
if (status != MLAN_STATUS_PENDING)
|
||||
kfree(req);
|
||||
|
@ -3224,7 +3422,11 @@ static int woal_uap_set_wapi_flag_ioctl(moal_private *priv, wapi_msg *msg)
|
|||
|
||||
ENTER();
|
||||
|
||||
woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_STOP);
|
||||
if (woal_uap_bss_ctrl(priv, MOAL_IOCTL_WAIT, UAP_BSS_STOP)) {
|
||||
PRINTM(MERROR, "%s: uap bss stop failed \n", __func__);
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
|
||||
if (req == NULL) {
|
||||
|
@ -3573,10 +3775,12 @@ done:
|
|||
* @param priv A pointer to moal_private structure
|
||||
* @param action MLAN_ACT_SET or MLAN_ACT_GET
|
||||
* @param he_cfg a pointer to mlan_ds_11ax_he_cfg
|
||||
* @param wait_option wait_option
|
||||
*
|
||||
* @return 0--success, otherwise failure
|
||||
*/
|
||||
int woal_11ax_cfg(moal_private *priv, t_u8 action, mlan_ds_11ax_he_cfg *he_cfg)
|
||||
int woal_11ax_cfg(moal_private *priv, t_u8 action, mlan_ds_11ax_he_cfg *he_cfg,
|
||||
t_u8 wait_option)
|
||||
{
|
||||
int ret = 0;
|
||||
mlan_status status = MLAN_STATUS_SUCCESS;
|
||||
|
@ -3594,14 +3798,12 @@ int woal_11ax_cfg(moal_private *priv, t_u8 action, mlan_ds_11ax_he_cfg *he_cfg)
|
|||
moal_memcpy_ext(priv->phandle, &cfg_11ax->param.he_cfg, he_cfg,
|
||||
sizeof(mlan_ds_11ax_he_cfg),
|
||||
sizeof(mlan_ds_11ax_he_cfg));
|
||||
status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
|
||||
if (status != MLAN_STATUS_SUCCESS) {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
status = woal_request_ioctl(priv, req, wait_option);
|
||||
if (status == MLAN_STATUS_SUCCESS) {
|
||||
moal_memcpy_ext(priv->phandle, he_cfg, &cfg_11ax->param.he_cfg,
|
||||
sizeof(mlan_ds_11ax_he_cfg),
|
||||
sizeof(mlan_ds_11ax_he_cfg));
|
||||
}
|
||||
moal_memcpy_ext(priv->phandle, he_cfg, &cfg_11ax->param.he_cfg,
|
||||
sizeof(mlan_ds_11ax_he_cfg),
|
||||
sizeof(mlan_ds_11ax_he_cfg));
|
||||
done:
|
||||
if (status != MLAN_STATUS_PENDING)
|
||||
kfree(req);
|
||||
|
@ -3645,7 +3847,7 @@ int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band,
|
|||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
if (woal_11ax_cfg(priv, MLAN_ACT_GET, &he_cfg)) {
|
||||
if (woal_11ax_cfg(priv, MLAN_ACT_GET, &he_cfg, MOAL_IOCTL_WAIT)) {
|
||||
PRINTM(MERROR, "Fail to get 11ax cfg!\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
|
@ -3671,7 +3873,7 @@ int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band,
|
|||
}
|
||||
}
|
||||
DBG_HEXDUMP(MCMD_D, "HE_CFG ", (t_u8 *)&he_cfg, sizeof(he_cfg));
|
||||
ret = woal_11ax_cfg(priv, MLAN_ACT_SET, &he_cfg);
|
||||
ret = woal_11ax_cfg(priv, MLAN_ACT_SET, &he_cfg, MOAL_IOCTL_WAIT);
|
||||
done:
|
||||
LEAVE();
|
||||
return ret;
|
||||
|
@ -3906,6 +4108,61 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
#if defined(UAP_CFG80211)
|
||||
#if defined(STA_WEXT) || defined(UAP_WEXT)
|
||||
/**
|
||||
* @brief Set/Get multi AP mode
|
||||
*
|
||||
* @param priv A pointer to moal_private structure
|
||||
* @param wrq A pointer to structure iwreq
|
||||
*
|
||||
* @return 0 --success, otherwise fail
|
||||
*/
|
||||
int woal_uap_set_get_multi_ap_mode(moal_private *priv, struct iwreq *wrq)
|
||||
{
|
||||
int ret = 0;
|
||||
int mode = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
if (wrq->u.data.length) {
|
||||
if (wrq->u.data.length > 1) {
|
||||
PRINTM(MERROR, "Invalid no of arguments!\n");
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
if (copy_from_user(&mode, wrq->u.data.pointer, sizeof(int))) {
|
||||
PRINTM(MERROR, "copy from user failed\n");
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
if (mode == EASY_MESH_MULTI_AP_BSS_MODE_3)
|
||||
/* Supports backhaul and fronthaul BSS */
|
||||
priv->multi_ap_flag = EASY_MESH_MULTI_AP_BH_AND_FH_BSS;
|
||||
else if (mode == EASY_MESH_MULTI_AP_BSS_MODE_2)
|
||||
/* Supports backhaul BSS */
|
||||
priv->multi_ap_flag = EASY_MESH_MULTI_AP_BH_BSS;
|
||||
else if (mode == EASY_MESH_MULTI_AP_BSS_MODE_1)
|
||||
/* Supports fronthaul BSS */
|
||||
priv->multi_ap_flag = EASY_MESH_MULTI_AP_FH_BSS;
|
||||
} else {
|
||||
if (priv->multi_ap_flag == EASY_MESH_MULTI_AP_BH_AND_FH_BSS)
|
||||
mode = EASY_MESH_MULTI_AP_BSS_MODE_3;
|
||||
else if (priv->multi_ap_flag == EASY_MESH_MULTI_AP_BH_BSS)
|
||||
mode = EASY_MESH_MULTI_AP_BSS_MODE_2;
|
||||
else if (priv->multi_ap_flag == EASY_MESH_MULTI_AP_FH_BSS)
|
||||
mode = EASY_MESH_MULTI_AP_BSS_MODE_1;
|
||||
wrq->u.data.length = 1;
|
||||
if (copy_to_user(wrq->u.data.pointer, &mode, sizeof(int)))
|
||||
ret = -EFAULT;
|
||||
}
|
||||
done:
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Set AP configuration
|
||||
*
|
||||
|
@ -4235,12 +4492,7 @@ int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data)
|
|||
ENTER();
|
||||
|
||||
PRINTM(MIOCTL, "ioctl bss ctrl=%d\n", data);
|
||||
if ((data != UAP_BSS_START) && (data != UAP_BSS_STOP) &&
|
||||
(data != UAP_BSS_RESET)) {
|
||||
PRINTM(MERROR, "Invalid parameter: %d\n", data);
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
||||
req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_bss));
|
||||
if (req == NULL) {
|
||||
ret = -ENOMEM;
|
||||
|
@ -4257,7 +4509,9 @@ int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data)
|
|||
|| moal_extflg_isset(priv->phandle, EXT_DFS_OFFLOAD)
|
||||
#endif
|
||||
) {
|
||||
woal_do_acs_check(priv);
|
||||
status = woal_do_acs_check(priv);
|
||||
if (status)
|
||||
PRINTM(MMSG, "woal_do_acs_check fails\n");
|
||||
/* about to start bss: issue channel check */
|
||||
status = woal_11h_channel_check_ioctl(priv,
|
||||
MOAL_IOCTL_WAIT);
|
||||
|
@ -4298,6 +4552,11 @@ int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data)
|
|||
bss->sub_command = MLAN_OID_UAP_BSS_RESET;
|
||||
woal_cancel_cac_block(priv);
|
||||
break;
|
||||
default:
|
||||
PRINTM(MMSG, "We don't support this uap_bss_ctrl cmd %d\n",
|
||||
data);
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
req->req_id = MLAN_IOCTL_BSS;
|
||||
req->action = MLAN_ACT_SET;
|
||||
|
@ -4312,8 +4571,12 @@ int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data)
|
|||
woal_stop_queue(priv->netdev);
|
||||
if (netif_carrier_ok(priv->netdev))
|
||||
netif_carrier_off(priv->netdev);
|
||||
if (data == UAP_BSS_RESET)
|
||||
woal_request_set_mac_address(priv, wait_option);
|
||||
if (data == UAP_BSS_RESET) {
|
||||
if (MLAN_STATUS_FAILURE ==
|
||||
woal_request_set_mac_address(priv, wait_option))
|
||||
PRINTM(MERROR,
|
||||
"Fail to set mac address after UAP_BSS_RESET\n");
|
||||
}
|
||||
woal_flush_tcp_sess_queue(priv);
|
||||
}
|
||||
done:
|
||||
|
@ -4355,9 +4618,11 @@ int woal_uap_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
|
|||
int ret = 0;
|
||||
ENTER();
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
|
||||
if (in_compat_syscall()) /* not implemented yet */
|
||||
return -EOPNOTSUPP;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
switch (cmd) {
|
||||
|
|
|
@ -28,9 +28,6 @@ Change log:
|
|||
#ifndef _MOAL_UAP_H
|
||||
#define _MOAL_UAP_H
|
||||
|
||||
/** Maximum buffer length for WOAL_UAP_SET_GET_256_CHAR */
|
||||
#define MAX_BUF_LEN 256
|
||||
|
||||
/** Private command ID to send ioctl */
|
||||
#define UAP_IOCTL_CMD (SIOCDEVPRIVATE + 2)
|
||||
/** Updating ADDBA variables */
|
||||
|
@ -207,6 +204,8 @@ typedef struct _skip_cac_para {
|
|||
t_u16 skip_cac;
|
||||
/** channel */
|
||||
t_u8 channel;
|
||||
/** bandwidth */
|
||||
t_u8 bw;
|
||||
} skip_cac_para;
|
||||
|
||||
/** radio control command */
|
||||
|
@ -532,12 +531,24 @@ typedef struct _domain_info_param {
|
|||
#define MAX_DOMAIN_TLV_LEN \
|
||||
(TLV_HEADER_LEN + COUNTRY_CODE_LEN + (SUB_BAND_LEN * MAX_SUB_BANDS))
|
||||
|
||||
/** DOMAIN_INFO param size of dfs_region */
|
||||
#define DFS_REGION_LEN 1
|
||||
/** MAX reg domain TLV length*/
|
||||
#define MAX_REG_DOMAIN_TLV_LEN (TLV_HEADER_LEN + DFS_REGION_LEN)
|
||||
|
||||
/** Get/Set channel DFS state */
|
||||
int woal_11h_chan_dfs_state(moal_private *priv, t_u8 action,
|
||||
mlan_ds_11h_chan_dfs_state *ch_dfs_state);
|
||||
#ifdef UAP_CFG80211
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)
|
||||
void woal_update_channels_dfs_state(moal_private *priv, t_u8 channel,
|
||||
t_u8 bandwidth, t_u8 dfs_state);
|
||||
void woal_update_uap_channel_dfs_state(moal_private *priv);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int woal_set_get_uap_power_mode(moal_private *priv, t_u32 action,
|
||||
mlan_ds_ps_mgmt *ps_mgmt);
|
||||
mlan_status woal_set_get_uap_power_mode(moal_private *priv, t_u32 action,
|
||||
mlan_ds_ps_mgmt *ps_mgmt);
|
||||
void woal_uap_set_multicast_list(struct net_device *dev);
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
|
||||
|
@ -548,12 +559,10 @@ int woal_uap_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd);
|
|||
#endif
|
||||
|
||||
int woal_uap_bss_ctrl(moal_private *priv, t_u8 wait_option, int data);
|
||||
#ifdef UAP_CFG80211
|
||||
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 12, 0)
|
||||
|
||||
int woal_uap_get_channel_nop_info(moal_private *priv, t_u8 wait_option,
|
||||
pmlan_ds_11h_chan_nop_info ch_info);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
mlan_status woal_set_get_ap_channel(moal_private *priv, t_u16 action,
|
||||
t_u8 wait_option,
|
||||
chan_band_info *uap_channel);
|
||||
|
@ -579,9 +588,16 @@ mlan_status woal_set_get_ap_wmm_para(moal_private *priv, t_u16 action,
|
|||
wmm_parameter_t *ap_wmm_para);
|
||||
int woal_uap_set_ap_cfg(moal_private *priv, t_u8 *data, int len);
|
||||
|
||||
#if defined(UAP_CFG80211)
|
||||
#if defined(STA_WEXT) || defined(UAP_WEXT)
|
||||
int woal_uap_set_get_multi_ap_mode(moal_private *priv, struct iwreq *wrq);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int woal_uap_set_11ac_status(moal_private *priv, t_u8 action, t_u8 vht20_40,
|
||||
IEEEtypes_VHTCap_t *vhtcap_ie);
|
||||
int woal_11ax_cfg(moal_private *priv, t_u8 action, mlan_ds_11ax_he_cfg *he_cfg);
|
||||
int woal_11ax_cfg(moal_private *priv, t_u8 action, mlan_ds_11ax_he_cfg *he_cfg,
|
||||
t_u8 wait_option);
|
||||
int woal_uap_set_11ax_status(moal_private *priv, t_u8 action, t_u8 band,
|
||||
IEEEtypes_HECap_t *hecap_ie);
|
||||
int woal_set_uap_ht_tx_cfg(moal_private *priv, Band_Config_t bandcfg,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -119,6 +119,16 @@ int woal_uap_do_priv_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
|
|||
ret = woal_set_get_bss_role(priv, wrq);
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(UAP_CFG80211)
|
||||
#if defined(STA_WEXT) || defined(UAP_WEXT)
|
||||
case WOAL_UAP_SET_MODE:
|
||||
PRINTM(MINFO,
|
||||
"%s: setting multi_ap flag through user command\n",
|
||||
__func__);
|
||||
ret = woal_uap_set_get_multi_ap_mode(priv, wrq);
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
|
|
|
@ -65,6 +65,11 @@ Change log:
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(UAP_CFG80211)
|
||||
/** Private command ID for set multi-AP BSS mode */
|
||||
#define WOAL_UAP_SET_MODE 27
|
||||
#endif
|
||||
|
||||
/** Private command ID for hostcmd */
|
||||
#define WOAL_UAP_HOST_CMD (WOAL_UAP_IOCTL + 17)
|
||||
|
||||
|
|
|
@ -84,6 +84,10 @@ static const struct iw_priv_args woal_uap_priv_args[] = {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(UAP_CFG80211)
|
||||
{WOAL_UAP_SET_MODE, IW_PRIV_TYPE_INT | 1, IW_PRIV_TYPE_INT | 1,
|
||||
"setmode"},
|
||||
#endif
|
||||
{WOAL_UAP_SET_GET_256_CHAR, IW_PRIV_TYPE_CHAR | 256,
|
||||
IW_PRIV_TYPE_CHAR | 256, ""},
|
||||
{WOAL_WL_FW_RELOAD, IW_PRIV_TYPE_CHAR | 256, IW_PRIV_TYPE_CHAR | 256,
|
||||
|
@ -197,7 +201,7 @@ static int woal_get_name(struct net_device *dev, struct iw_request_info *info,
|
|||
{
|
||||
char *cwrq = wrqu->name;
|
||||
ENTER();
|
||||
strcpy(cwrq, "IEEE 802.11-DS");
|
||||
strncpy(cwrq, "IEEE 802.11-DS", IFNAMSIZ);
|
||||
LEAVE();
|
||||
return 0;
|
||||
}
|
||||
|
@ -224,7 +228,11 @@ static int woal_get_wap(struct net_device *dev, struct iw_request_info *info,
|
|||
if (priv->bss_started)
|
||||
moal_memcpy_ext(priv->phandle, awrq->sa_data,
|
||||
priv->current_addr, MLAN_MAC_ADDR_LENGTH,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
|
||||
sizeof(awrq->sa_data_min));
|
||||
#else
|
||||
sizeof(awrq->sa_data));
|
||||
#endif
|
||||
else
|
||||
memset(awrq->sa_data, 0, MLAN_MAC_ADDR_LENGTH);
|
||||
awrq->sa_family = ARPHRD_ETHER;
|
||||
|
@ -401,7 +409,7 @@ static int woal_get_freq(struct net_device *dev, struct iw_request_info *info,
|
|||
return -EFAULT;
|
||||
}
|
||||
|
||||
band = (ap_cfg->bandcfg.chanBand == BAND_5GHZ);
|
||||
band = (((ap_cfg->bandcfg.chanBand == BAND_5GHZ) ? 1 : 0));
|
||||
fwrq->m = (long)channel_to_frequency(ap_cfg->channel, band);
|
||||
fwrq->i = (long)ap_cfg->channel;
|
||||
fwrq->e = 6;
|
||||
|
@ -736,7 +744,10 @@ static int woal_get_encode(struct net_device *dev, struct iw_request_info *info,
|
|||
moal_memcpy_ext(priv->phandle, extra,
|
||||
ap_cfg->wpa_cfg.passphrase,
|
||||
ap_cfg->wpa_cfg.length, ap_cfg->wpa_cfg.length);
|
||||
dwrq->length = ap_cfg->wpa_cfg.length;
|
||||
if (ap_cfg->wpa_cfg.length)
|
||||
dwrq->length = ap_cfg->wpa_cfg.length;
|
||||
else
|
||||
dwrq->length = 16;
|
||||
dwrq->flags |= 1;
|
||||
dwrq->flags &= ~IW_ENCODE_DISABLED;
|
||||
break;
|
||||
|
@ -1123,7 +1134,8 @@ static int woal_set_mlme(struct net_device *dev, struct iw_request_info *info,
|
|||
if (!memcmp(bc_addr, sta_addr, ETH_ALEN)) {
|
||||
PRINTM(MIOCTL, "Deauth all stations\n");
|
||||
req = woal_alloc_mlan_ioctl_req(
|
||||
sizeof(mlan_ds_get_info));
|
||||
sizeof(mlan_ds_get_info) +
|
||||
(MAX_STA_LIST_IE_SIZE * MAX_NUM_CLIENTS));
|
||||
if (req == NULL) {
|
||||
LEAVE();
|
||||
return -ENOMEM;
|
||||
|
|
|
@ -35,7 +35,7 @@ extern struct semaphore AddRemoveCardSem;
|
|||
********************************************************/
|
||||
|
||||
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || \
|
||||
defined(USB8978) || defined(USBNW62X)
|
||||
defined(USB8978) || defined(USBIW624)
|
||||
/** Card-type detection frame response */
|
||||
typedef struct {
|
||||
/** 32-bit ACK+WINNER field */
|
||||
|
@ -95,10 +95,10 @@ static struct usb_device_id woal_usb_table[] = {
|
|||
{NXP_USB_DEVICE(USB9097_VID_1, USB9097_PID_1, "NXP WLAN USB Adapter")},
|
||||
{NXP_USB_DEVICE(USB9097_VID_1, USB9097_PID_2, "NXP WLAN USB Adapter")},
|
||||
#endif
|
||||
#ifdef USBNW62X
|
||||
{NXP_USB_DEVICE(USBNW62X_VID_1, USBNW62X_PID_1,
|
||||
#ifdef USBIW624
|
||||
{NXP_USB_DEVICE(USBIW624_VID_1, USBIW624_PID_1,
|
||||
"NXP WLAN USB Adapter")},
|
||||
{NXP_USB_DEVICE(USBNW62X_VID_1, USBNW62X_PID_2,
|
||||
{NXP_USB_DEVICE(USBIW624_VID_1, USBIW624_PID_2,
|
||||
"NXP WLAN USB Adapter")},
|
||||
#endif
|
||||
/* Terminating entry */
|
||||
|
@ -128,8 +128,8 @@ static struct usb_device_id woal_usb_table_skip_fwdnld[] = {
|
|||
#ifdef USB9097
|
||||
{NXP_USB_DEVICE(USB9097_VID_1, USB9097_PID_2, "NXP WLAN USB Adapter")},
|
||||
#endif
|
||||
#ifdef USBNW62X
|
||||
{NXP_USB_DEVICE(USBNW62X_VID_1, USBNW62X_PID_2,
|
||||
#ifdef USBIW624
|
||||
{NXP_USB_DEVICE(USBIW624_VID_1, USBIW624_PID_2,
|
||||
"NXP WLAN USB Adapter")},
|
||||
#endif
|
||||
/* Terminating entry */
|
||||
|
@ -406,6 +406,8 @@ static void woal_usb_tx_complete(struct urb *urb)
|
|||
atomic_dec(&cardp->tx_cmd_urb_pending);
|
||||
else if (context->ep == cardp->tx_data_ep)
|
||||
atomic_dec(&cardp->tx_data_urb_pending);
|
||||
else if (context->ep == cardp->tx_data2_ep)
|
||||
atomic_dec(&cardp->tx_data2_urb_pending);
|
||||
|
||||
queue_work(handle->workqueue, &handle->main_work);
|
||||
|
||||
|
@ -495,19 +497,20 @@ rx_ret:
|
|||
********************************************************/
|
||||
|
||||
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || \
|
||||
defined(USB8978) || defined(USBNW62X)
|
||||
defined(USB8978) || defined(USBIW624)
|
||||
/**
|
||||
* @brief Check chip revision
|
||||
*
|
||||
* @param handle A pointer to moal_handle structure
|
||||
* @param usb_chip_rev A pointer to usb_chip_rev variable
|
||||
* @param usb_strap A pointer to usb_strap
|
||||
* @param boot_mode A pointer to boot_mode
|
||||
*
|
||||
* @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
|
||||
*/
|
||||
static mlan_status woal_check_chip_revision(moal_handle *handle,
|
||||
t_u32 *usb_chip_rev,
|
||||
t_u32 *usb_strap)
|
||||
t_u32 *usb_strap, t_u32 *boot_mode)
|
||||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
mlan_buffer mbuf;
|
||||
|
@ -580,7 +583,7 @@ static mlan_status woal_check_chip_revision(moal_handle *handle,
|
|||
ack_pkt.strap = woal_le32_to_cpu(ack_pkt.strap);
|
||||
|
||||
if ((ack_pkt.extend & 0xffff0000) == EXTEND_HDR) {
|
||||
extend_ver = ack_pkt.extend & 0x0000ffff;
|
||||
extend_ver = ack_pkt.extend & 0x000000ff;
|
||||
*usb_chip_rev = ack_pkt.chip_rev & 0x000000ff;
|
||||
if (extend_ver >= EXTEND_V2) {
|
||||
PRINTM(MINFO, "chip_rev=0x%x, strap=0x%x\n",
|
||||
|
@ -588,6 +591,8 @@ static mlan_status woal_check_chip_revision(moal_handle *handle,
|
|||
*usb_strap = ack_pkt.strap & 0x7;
|
||||
} else
|
||||
PRINTM(MINFO, "chip_rev=0x%x\n", *usb_chip_rev);
|
||||
if (extend_ver >= EXTEND_V3)
|
||||
*boot_mode = (ack_pkt.extend & 0x0000ff00) >> 8;
|
||||
}
|
||||
cleanup:
|
||||
kfree(recv_buff);
|
||||
|
@ -635,6 +640,10 @@ static void woal_usb_unlink_urb(void *card_desc)
|
|||
usb_kill_urb(
|
||||
cardp->tx_data_list[i].urb);
|
||||
}
|
||||
if (cardp->tx_data2_list[i].urb) {
|
||||
usb_kill_urb(
|
||||
cardp->tx_data2_list[i].urb);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -674,6 +683,10 @@ void woal_usb_free(struct usb_card_rec *cardp)
|
|||
usb_free_urb(cardp->tx_data_list[i].urb);
|
||||
cardp->tx_data_list[i].urb = NULL;
|
||||
}
|
||||
if (cardp->tx_data2_list[i].urb) {
|
||||
usb_free_urb(cardp->tx_data2_list[i].urb);
|
||||
cardp->tx_data2_list[i].urb = NULL;
|
||||
}
|
||||
}
|
||||
/* Free Tx cmd URB */
|
||||
if (cardp->tx_cmd.urb) {
|
||||
|
@ -797,18 +810,18 @@ static t_u16 woal_update_card_type(t_void *card)
|
|||
strlen(KERN_VERSION));
|
||||
}
|
||||
#endif
|
||||
#ifdef USBNW62X
|
||||
#ifdef USBIW624
|
||||
if (woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
|
||||
(__force __le16)USBNW62X_PID_1 ||
|
||||
(__force __le16)USBIW624_PID_1 ||
|
||||
woal_cpu_to_le16(cardp_usb->udev->descriptor.idProduct) ==
|
||||
(__force __le16)USBNW62X_PID_2) {
|
||||
card_type = CARD_TYPE_USBNW62X;
|
||||
moal_memcpy_ext(NULL, driver_version, CARD_USBNW62X,
|
||||
strlen(CARD_USBNW62X), strlen(driver_version));
|
||||
(__force __le16)USBIW624_PID_2) {
|
||||
card_type = CARD_TYPE_USBIW624;
|
||||
moal_memcpy_ext(NULL, driver_version, CARD_USBIW624,
|
||||
strlen(CARD_USBIW624), strlen(driver_version));
|
||||
moal_memcpy_ext(NULL,
|
||||
driver_version + strlen(INTF_CARDTYPE) +
|
||||
strlen(KERN_VERSION),
|
||||
V17, strlen(V17),
|
||||
V18, strlen(V18),
|
||||
strlen(driver_version) - strlen(INTF_CARDTYPE) -
|
||||
strlen(KERN_VERSION));
|
||||
}
|
||||
|
@ -880,9 +893,9 @@ static int woal_usb_probe(struct usb_interface *intf,
|
|||
#ifdef USB9097
|
||||
case (__force __le16)USB9097_PID_1:
|
||||
#endif /* USB9097 */
|
||||
#ifdef USBNW62X
|
||||
case (__force __le16)USBNW62X_PID_1:
|
||||
#endif /* USBNW62X */
|
||||
#ifdef USBIW624
|
||||
case (__force __le16)USBIW624_PID_1:
|
||||
#endif /* USBIW624 */
|
||||
|
||||
/* If skip FW is set, we must return error so
|
||||
* the next driver can download the FW */
|
||||
|
@ -910,9 +923,9 @@ static int woal_usb_probe(struct usb_interface *intf,
|
|||
#ifdef USB9097
|
||||
case (__force __le16)USB9097_PID_2:
|
||||
#endif /* USB9097 */
|
||||
#ifdef USBNW62X
|
||||
case (__force __le16)USBNW62X_PID_2:
|
||||
#endif /* USBNW62X */
|
||||
#ifdef USBIW624
|
||||
case (__force __le16)USBIW624_PID_2:
|
||||
#endif /* USBIW624 */
|
||||
|
||||
usb_cardp->boot_state = USB_FW_READY;
|
||||
break;
|
||||
|
@ -1003,6 +1016,24 @@ static int woal_usb_probe(struct usb_interface *intf,
|
|||
(__force int)woal_le16_to_cpu(
|
||||
endpoint->wMaxPacketSize);
|
||||
}
|
||||
if (usb_endpoint_is_bulk_out(endpoint) &&
|
||||
(usb_endpoint_num(endpoint) ==
|
||||
MLAN_USB_EP_DATA_CH2 ||
|
||||
usb_endpoint_num(endpoint) ==
|
||||
MLAN_USB_EP_DATA_CH2_IF2)) {
|
||||
/* We found a bulk out data endpoint */
|
||||
PRINTM(MCMND,
|
||||
"Bulk OUT2: max packet size = %d, address = %d\n",
|
||||
woal_le16_to_cpu(
|
||||
endpoint->wMaxPacketSize),
|
||||
endpoint->bEndpointAddress);
|
||||
usb_cardp->tx_data2_ep =
|
||||
endpoint->bEndpointAddress;
|
||||
atomic_set(&usb_cardp->tx_data2_urb_pending, 0);
|
||||
usb_cardp->tx_data2_maxpktsize =
|
||||
(__force int)woal_le16_to_cpu(
|
||||
endpoint->wMaxPacketSize);
|
||||
}
|
||||
|
||||
if ((usb_endpoint_is_bulk_out(endpoint) ||
|
||||
usb_endpoint_is_int_out(endpoint)) &&
|
||||
|
@ -1041,6 +1072,14 @@ static int woal_usb_probe(struct usb_interface *intf,
|
|||
__FUNCTION__);
|
||||
goto error;
|
||||
}
|
||||
if (!usb_cardp->tx_data2_ep) {
|
||||
PRINTM(MERROR,
|
||||
"%s: invalid endpoint assignment\n",
|
||||
__FUNCTION__);
|
||||
PRINTM(MERROR,
|
||||
"%s: DATA2 endpoint is not enumarated\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
}
|
||||
|
||||
usb_cardp->tx_aggr_ctrl.enable = MFALSE;
|
||||
|
@ -1198,6 +1237,7 @@ static int woal_usb_suspend(struct usb_interface *intf, pm_message_t message)
|
|||
{
|
||||
struct usb_card_rec *cardp = usb_get_intfdata(intf);
|
||||
moal_handle *handle = NULL;
|
||||
mlan_ds_ps_info pm_info;
|
||||
int i;
|
||||
int ret = 0;
|
||||
|
||||
|
@ -1222,6 +1262,27 @@ static int woal_usb_suspend(struct usb_interface *intf, pm_message_t message)
|
|||
woal_cancel_scan(handle->priv[i], MOAL_IOCTL_WAIT);
|
||||
}
|
||||
#endif
|
||||
|
||||
memset(&pm_info, 0, sizeof(pm_info));
|
||||
#define MAX_RETRY_USB 8
|
||||
for (i = 0; i < MAX_RETRY_USB; i++) {
|
||||
if (MLAN_STATUS_SUCCESS ==
|
||||
woal_get_pm_info(woal_get_priv(handle, MLAN_BSS_ROLE_ANY),
|
||||
&pm_info)) {
|
||||
if (pm_info.is_suspend_allowed == MTRUE)
|
||||
break;
|
||||
else
|
||||
PRINTM(MMSG,
|
||||
"Suspend not allowed and retry again\n");
|
||||
}
|
||||
woal_sched_timeout(100);
|
||||
}
|
||||
if (pm_info.is_suspend_allowed == MFALSE) {
|
||||
PRINTM(MMSG, "Suspend not allowed\n");
|
||||
ret = -EBUSY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* Enable Host Sleep */
|
||||
woal_enable_hs(woal_get_priv(handle, MLAN_BSS_ROLE_ANY));
|
||||
|
||||
|
@ -1244,7 +1305,6 @@ static int woal_usb_suspend(struct usb_interface *intf, pm_message_t message)
|
|||
for (i = 0; i < MVUSB_RX_DATA_URB; i++) {
|
||||
if (cardp->rx_data_list[i].urb) {
|
||||
usb_kill_urb(cardp->rx_data_list[i].urb);
|
||||
usb_init_urb(cardp->rx_data_list[i].urb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1254,6 +1314,9 @@ static int woal_usb_suspend(struct usb_interface *intf, pm_message_t message)
|
|||
if (cardp->tx_data_list[i].urb) {
|
||||
usb_kill_urb(cardp->tx_data_list[i].urb);
|
||||
}
|
||||
if (cardp->tx_data2_list[i].urb) {
|
||||
usb_kill_urb(cardp->tx_data2_list[i].urb);
|
||||
}
|
||||
}
|
||||
/* Unlink Tx cmd URB */
|
||||
if (cardp->tx_cmd.urb) {
|
||||
|
@ -1385,6 +1448,15 @@ mlan_status woal_usb_tx_init(moal_handle *handle)
|
|||
ret = MLAN_STATUS_FAILURE;
|
||||
goto init_exit;
|
||||
}
|
||||
cardp->tx_data2_list[i].handle = handle;
|
||||
cardp->tx_data2_list[i].ep = cardp->tx_data2_ep;
|
||||
/* Allocate URB for data */
|
||||
cardp->tx_data2_list[i].urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if (!cardp->tx_data2_list[i].urb) {
|
||||
PRINTM(MERROR, "Tx data URB allocation failed\n");
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
goto init_exit;
|
||||
}
|
||||
}
|
||||
|
||||
init_exit:
|
||||
|
@ -1513,6 +1585,8 @@ static mlan_status woal_usb_write_data_sync(moal_handle *handle,
|
|||
bulk_out_maxpktsize = cardp->tx_cmd_maxpktsize;
|
||||
else if (ep == cardp->tx_data_ep)
|
||||
bulk_out_maxpktsize = cardp->tx_data_maxpktsize;
|
||||
else if (ep == cardp->tx_data2_ep)
|
||||
bulk_out_maxpktsize = cardp->tx_data2_maxpktsize;
|
||||
|
||||
if (length % bulk_out_maxpktsize == 0)
|
||||
length++;
|
||||
|
@ -1599,6 +1673,11 @@ mlan_status woal_write_data_async(moal_handle *handle, mlan_buffer *pmbuf,
|
|||
(atomic_read(&cardp->tx_data_urb_pending) >= MVUSB_TX_HIGH_WMARK)) {
|
||||
ret = MLAN_STATUS_RESOURCE;
|
||||
goto tx_ret;
|
||||
} else if ((ep == cardp->tx_data2_ep) &&
|
||||
(atomic_read(&cardp->tx_data2_urb_pending) >=
|
||||
MVUSB_TX_HIGH_WMARK)) {
|
||||
ret = MLAN_STATUS_RESOURCE;
|
||||
goto tx_ret;
|
||||
}
|
||||
PRINTM(MINFO, "woal_write_data_async: ep=%d\n", ep);
|
||||
|
||||
|
@ -1611,6 +1690,11 @@ mlan_status woal_write_data_async(moal_handle *handle, mlan_buffer *pmbuf,
|
|||
if (cardp->tx_data_ix >= MVUSB_TX_HIGH_WMARK)
|
||||
cardp->tx_data_ix = 0;
|
||||
context = &cardp->tx_data_list[cardp->tx_data_ix++];
|
||||
} else if (ep == cardp->tx_data2_ep) {
|
||||
bulk_out_maxpktsize = cardp->tx_data2_maxpktsize;
|
||||
if (cardp->tx_data2_ix >= MVUSB_TX_HIGH_WMARK)
|
||||
cardp->tx_data2_ix = 0;
|
||||
context = &cardp->tx_data2_list[cardp->tx_data2_ix++];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1652,6 +1736,8 @@ mlan_status woal_write_data_async(moal_handle *handle, mlan_buffer *pmbuf,
|
|||
atomic_inc(&cardp->tx_cmd_urb_pending);
|
||||
else if (ep == cardp->tx_data_ep)
|
||||
atomic_inc(&cardp->tx_data_urb_pending);
|
||||
else if (ep == cardp->tx_data2_ep)
|
||||
atomic_inc(&cardp->tx_data2_urb_pending);
|
||||
if (usb_submit_urb(tx_urb, GFP_ATOMIC)) {
|
||||
/* Submit URB failure */
|
||||
PRINTM(MERROR, "Submit EP %d Tx URB failed: %d\n", ep, ret);
|
||||
|
@ -1664,6 +1750,13 @@ mlan_status woal_write_data_async(moal_handle *handle, mlan_buffer *pmbuf,
|
|||
cardp->tx_data_ix--;
|
||||
else
|
||||
cardp->tx_data_ix = MVUSB_TX_HIGH_WMARK;
|
||||
} else if (ep == cardp->tx_data2_ep) {
|
||||
atomic_dec(&cardp->tx_data2_urb_pending);
|
||||
if (cardp->tx_data2_ix)
|
||||
cardp->tx_data2_ix--;
|
||||
else
|
||||
cardp->tx_data2_ix =
|
||||
MVUSB_TX_HIGH_WMARK;
|
||||
}
|
||||
}
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
|
@ -1672,6 +1765,10 @@ mlan_status woal_write_data_async(moal_handle *handle, mlan_buffer *pmbuf,
|
|||
(atomic_read(&cardp->tx_data_urb_pending) ==
|
||||
MVUSB_TX_HIGH_WMARK))
|
||||
ret = MLAN_STATUS_PRESOURCE;
|
||||
else if (ep == cardp->tx_data2_ep &&
|
||||
(atomic_read(&cardp->tx_data2_urb_pending) ==
|
||||
MVUSB_TX_HIGH_WMARK))
|
||||
ret = MLAN_STATUS_PRESOURCE;
|
||||
else
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -1967,9 +2064,10 @@ static mlan_status woal_usb_get_fw_name(moal_handle *handle)
|
|||
{
|
||||
mlan_status ret = MLAN_STATUS_SUCCESS;
|
||||
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || \
|
||||
defined(USB8978) || defined(USBNW62X)
|
||||
defined(USB8978) || defined(USBIW624)
|
||||
t_u32 revision_id = 0;
|
||||
t_u32 strap = 0;
|
||||
t_u32 boot_mode = 0;
|
||||
#endif
|
||||
struct usb_card_rec *cardp = (struct usb_card_rec *)handle->card;
|
||||
#if defined(USB9098)
|
||||
|
@ -1987,8 +2085,9 @@ static mlan_status woal_usb_get_fw_name(moal_handle *handle)
|
|||
#endif
|
||||
|
||||
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || \
|
||||
defined(USB8978) || defined(USBNW62X)
|
||||
ret = woal_check_chip_revision(handle, &revision_id, &strap);
|
||||
defined(USB8978) || defined(USBIW624)
|
||||
ret = woal_check_chip_revision(handle, &revision_id, &strap,
|
||||
&boot_mode);
|
||||
if (ret != MLAN_STATUS_SUCCESS) {
|
||||
PRINTM(MFATAL, "Chip revision check failure!\n");
|
||||
ret = MLAN_STATUS_FAILURE;
|
||||
|
@ -2000,22 +2099,26 @@ static mlan_status woal_usb_get_fw_name(moal_handle *handle)
|
|||
#ifdef USB8997
|
||||
if (IS_USB8997(handle->card_type)) {
|
||||
if (strap == CARD_TYPE_USB_UART)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUART8997_DEFAULT_COMBO_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUART8997_DEFAULT_COMBO_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
else if (strap != 0)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUSB8997_DEFAULT_COMBO_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUSB8997_DEFAULT_COMBO_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USB8978
|
||||
if (IS_USB8978(handle->card_type)) {
|
||||
if (strap == CARD_TYPE_USB_UART)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUART8978_DEFAULT_COMBO_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUART8978_DEFAULT_COMBO_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
else if (strap != 0)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUSB8978_DEFAULT_COMBO_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUSB8978_DEFAULT_COMBO_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2024,10 +2127,12 @@ static mlan_status woal_usb_get_fw_name(moal_handle *handle)
|
|||
if (cardp->second_mac) {
|
||||
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);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
ref_handle->card_info->fw_name,
|
||||
FW_NAMW_MAX_LEN);
|
||||
strncpy(handle->card_info->fw_name_wlan,
|
||||
ref_handle->card_info->fw_name_wlan,
|
||||
FW_NAMW_MAX_LEN);
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
|
@ -2035,28 +2140,32 @@ static mlan_status woal_usb_get_fw_name(moal_handle *handle)
|
|||
case USB9098_Z1Z2:
|
||||
if (strap != 0) {
|
||||
if (strap == CARD_TYPE_USB_UART)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUART9098_DEFAULT_COMBO_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUART9098_DEFAULT_COMBO_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
else
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUSB9098_DEFAULT_COMBO_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUSB9098_DEFAULT_COMBO_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
}
|
||||
strcpy(handle->card_info->fw_name_wlan,
|
||||
USB9098_DEFAULT_WLAN_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name_wlan,
|
||||
USB9098_DEFAULT_WLAN_FW_NAME, FW_NAMW_MAX_LEN);
|
||||
break;
|
||||
case USB9098_A0:
|
||||
case USB9098_A1:
|
||||
case USB9098_A2:
|
||||
if (strap != 0) {
|
||||
if (strap == CARD_TYPE_USB_UART)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUART9098_COMBO_V1_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUART9098_COMBO_V1_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
else
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUSB9098_COMBO_V1_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUSB9098_COMBO_V1_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
}
|
||||
strcpy(handle->card_info->fw_name_wlan,
|
||||
USB9098_WLAN_V1_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name_wlan,
|
||||
USB9098_WLAN_V1_FW_NAME, FW_NAMW_MAX_LEN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2068,26 +2177,30 @@ static mlan_status woal_usb_get_fw_name(moal_handle *handle)
|
|||
case USB9097_B1:
|
||||
if (strap != 0) {
|
||||
if (strap == CARD_TYPE_USB_UART)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUART9097_COMBO_V1_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUART9097_COMBO_V1_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
else
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUSB9097_COMBO_V1_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUSB9097_COMBO_V1_FW_NAME,
|
||||
FW_NAMW_MAX_LEN);
|
||||
}
|
||||
strcpy(handle->card_info->fw_name_wlan,
|
||||
USB9097_WLAN_V1_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name_wlan,
|
||||
USB9097_WLAN_V1_FW_NAME, FW_NAMW_MAX_LEN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef USBNW62X
|
||||
if (IS_USBNW62X(handle->card_type)) {
|
||||
#ifdef USBIW624
|
||||
if (IS_USBIW624(handle->card_type)) {
|
||||
if (boot_mode == 0x03)
|
||||
PRINTM(MMSG, "wlan: USB-IW624 in secure-boot mode\n");
|
||||
if (strap == CARD_TYPE_USB_UART)
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUARTNW62X_COMBO_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUARTIW624_COMBO_FW_NAME, FW_NAMW_MAX_LEN);
|
||||
else
|
||||
strcpy(handle->card_info->fw_name,
|
||||
USBUSBNW62X_COMBO_FW_NAME);
|
||||
strncpy(handle->card_info->fw_name,
|
||||
USBUSBIW624_COMBO_FW_NAME, FW_NAMW_MAX_LEN);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -89,14 +89,14 @@ Change Log:
|
|||
#define USB9097_PID_2 0x2061
|
||||
#endif /* USB9097 */
|
||||
|
||||
#ifdef USBNW62X
|
||||
#ifdef USBIW624
|
||||
/** USB VID 1 */
|
||||
#define USBNW62X_VID_1 0x0471
|
||||
#define USBIW624_VID_1 0x0471
|
||||
/** USB PID 1 */
|
||||
#define USBNW62X_PID_1 0x020E
|
||||
#define USBIW624_PID_1 0x020E
|
||||
/** USB PID 2 */
|
||||
#define USBNW62X_PID_2 0x020F
|
||||
#endif /* USBNW62X */
|
||||
#define USBIW624_PID_2 0x020F
|
||||
#endif /* USBIW624 */
|
||||
|
||||
/** Boot state: FW download */
|
||||
#define USB_FW_DNLD 1
|
||||
|
@ -110,7 +110,7 @@ Change Log:
|
|||
#define MVUSB_RX_DATA_URB 6
|
||||
|
||||
#if defined(USB8997) || defined(USB9098) || defined(USB9097) || \
|
||||
defined(USB8978) || defined(USB8801) || defined(USBNW62X)
|
||||
defined(USB8978) || defined(USB8801) || defined(USBIW624)
|
||||
/* Transmit buffer size for chip revision check */
|
||||
#define CHIP_REV_TX_BUF_SIZE 16
|
||||
/* Receive buffer size for chip revision check */
|
||||
|
@ -120,6 +120,7 @@ Change Log:
|
|||
#define EXTEND_HDR (0xAB950000)
|
||||
#define EXTEND_V1 (0x00000001)
|
||||
#define EXTEND_V2 (0x00000002)
|
||||
#define EXTEND_V3 (0x00000003)
|
||||
#ifdef USB8801
|
||||
#define USB8801_DEFAULT_WLAN_FW_NAME "nxp/usb8801_uapsta.bin"
|
||||
#endif /* USB8801 */
|
||||
|
@ -171,12 +172,12 @@ Change Log:
|
|||
#define USBUSB9097_COMBO_V1_FW_NAME "nxp/usbusbiw620_combo_v1.bin"
|
||||
#endif /* USB9097 */
|
||||
|
||||
#ifdef USBNW62X
|
||||
#define USBNW62X_DEFAULT_COMBO_FW_NAME "nxp/usbusbnw62x_combo.bin"
|
||||
#define USBUARTNW62X_COMBO_FW_NAME "nxp/usbuartnw62x_combo.bin"
|
||||
#define USBUSBNW62X_COMBO_FW_NAME "nxp/usbusbnw62x_combo.bin"
|
||||
#define USBNW62X_DEFAULT_WLAN_FW_NAME "nxp/usbnw62x_wlan.bin"
|
||||
#endif /* USBNW62X */
|
||||
#ifdef USBIW624
|
||||
#define USBIW624_DEFAULT_COMBO_FW_NAME "nxp/usbusbiw624_combo.bin"
|
||||
#define USBUARTIW624_COMBO_FW_NAME "nxp/usbusbiw624_combo.bin"
|
||||
#define USBUSBIW624_COMBO_FW_NAME "nxp/usbusbiw624_combo.bin"
|
||||
#define USBIW624_DEFAULT_WLAN_FW_NAME "nxp/usbiw624_wlan.bin"
|
||||
#endif /* USBIW624 */
|
||||
|
||||
/** urb context */
|
||||
typedef struct _urb_context {
|
||||
|
@ -243,6 +244,16 @@ struct usb_card_rec {
|
|||
t_u8 resubmit_urbs;
|
||||
/** USB card type */
|
||||
t_u16 card_type;
|
||||
/** Tx data endpoint address */
|
||||
t_u8 tx_data2_ep;
|
||||
/** Tx data endpoint max pkt size */
|
||||
int tx_data2_maxpktsize;
|
||||
/** Tx data2 URB pending count */
|
||||
atomic_t tx_data2_urb_pending;
|
||||
/** Index to point to next data urb to use */
|
||||
int tx_data2_ix;
|
||||
/** Pre-allocated urb for data */
|
||||
urb_context tx_data2_list[MVUSB_TX_HIGH_WMARK];
|
||||
t_u8 second_mac;
|
||||
};
|
||||
|
||||
|
|
|
@ -417,7 +417,7 @@ static int woal_get_name(struct net_device *dev, struct iw_request_info *info,
|
|||
{
|
||||
char *cwrq = wrqu->name;
|
||||
ENTER();
|
||||
strcpy(cwrq, "IEEE 802.11-DS");
|
||||
strncpy(cwrq, "IEEE 802.11-DS", IFNAMSIZ);
|
||||
LEAVE();
|
||||
return 0;
|
||||
}
|
||||
|
@ -608,15 +608,24 @@ static int woal_get_wap(struct net_device *dev, struct iw_request_info *info,
|
|||
|
||||
memset(&bss_info, 0, sizeof(bss_info));
|
||||
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info)) {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (bss_info.media_connected == MTRUE)
|
||||
moal_memcpy_ext(priv->phandle, awrq->sa_data, &bss_info.bssid,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
|
||||
MLAN_MAC_ADDR_LENGTH,
|
||||
sizeof(awrq->sa_data_min));
|
||||
#else
|
||||
MLAN_MAC_ADDR_LENGTH, sizeof(awrq->sa_data));
|
||||
#endif
|
||||
else
|
||||
memset(awrq->sa_data, 0, MLAN_MAC_ADDR_LENGTH);
|
||||
awrq->sa_family = ARPHRD_ETHER;
|
||||
|
||||
done:
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
@ -790,30 +799,32 @@ static int woal_get_sens(struct net_device *dev, struct iw_request_info *info,
|
|||
*
|
||||
* @param dev A pointer to net_device structure
|
||||
* @param info A pointer to iw_request_info structure
|
||||
* @param vwrq A pointer to iw_param structure
|
||||
* @param vwrq A pointer to iwreq_data structure
|
||||
* @param extra A pointer to extra data buf
|
||||
*
|
||||
* @return 0 --success, otherwise fail
|
||||
*/
|
||||
static int woal_set_txpow(struct net_device *dev, struct iw_request_info *info,
|
||||
struct iw_param *vwrq, char *extra)
|
||||
union iwreq_data *vwrq, char *extra)
|
||||
{
|
||||
int ret = 0;
|
||||
struct iw_param *vwrq_ = (struct iw_param *)vwrq;
|
||||
moal_private *priv = (moal_private *)netdev_priv(dev);
|
||||
mlan_power_cfg_t power_cfg;
|
||||
|
||||
ENTER();
|
||||
if (vwrq->disabled) {
|
||||
memset(&power_cfg, 0, sizeof(mlan_power_cfg_t));
|
||||
if (vwrq_->disabled) {
|
||||
woal_set_radio(priv, 0);
|
||||
goto done;
|
||||
}
|
||||
woal_set_radio(priv, 1);
|
||||
|
||||
if (!vwrq->fixed)
|
||||
if (!vwrq_->fixed)
|
||||
power_cfg.is_power_auto = 1;
|
||||
else {
|
||||
power_cfg.is_power_auto = 0;
|
||||
power_cfg.power_level = vwrq->value;
|
||||
power_cfg.power_level = vwrq_->value;
|
||||
}
|
||||
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
|
@ -832,15 +843,16 @@ done:
|
|||
*
|
||||
* @param dev A pointer to net_device structure
|
||||
* @param info A pointer to iw_request_info structure
|
||||
* @param vwrq A pointer to iw_param structure
|
||||
* @param vwrq A pointer to iwreq_data structure
|
||||
* @param extra A pointer to extra data buf
|
||||
*
|
||||
* @return 0 --success, otherwise fail
|
||||
*/
|
||||
static int woal_get_txpow(struct net_device *dev, struct iw_request_info *info,
|
||||
struct iw_param *vwrq, char *extra)
|
||||
union iwreq_data *vwrq, char *extra)
|
||||
{
|
||||
int ret = 0;
|
||||
struct iw_param *vwrq_ = (struct iw_param *)vwrq;
|
||||
moal_private *priv = (moal_private *)netdev_priv(dev);
|
||||
mlan_power_cfg_t power_cfg;
|
||||
mlan_bss_info bss_info;
|
||||
|
@ -849,7 +861,11 @@ static int woal_get_txpow(struct net_device *dev, struct iw_request_info *info,
|
|||
|
||||
memset(&power_cfg, 0, sizeof(mlan_power_cfg_t));
|
||||
memset(&bss_info, 0, sizeof(bss_info));
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info)) {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_set_get_tx_power(priv, MLAN_ACT_GET, &power_cfg)) {
|
||||
|
@ -857,16 +873,16 @@ static int woal_get_txpow(struct net_device *dev, struct iw_request_info *info,
|
|||
goto done;
|
||||
}
|
||||
|
||||
vwrq->value = power_cfg.power_level;
|
||||
vwrq_->value = power_cfg.power_level;
|
||||
if (power_cfg.is_power_auto)
|
||||
vwrq->fixed = 0;
|
||||
vwrq_->fixed = 0;
|
||||
else
|
||||
vwrq->fixed = 1;
|
||||
vwrq_->fixed = 1;
|
||||
if (bss_info.radio_on) {
|
||||
vwrq->disabled = 0;
|
||||
vwrq->flags = IW_TXPOW_DBM;
|
||||
vwrq_->disabled = 0;
|
||||
vwrq_->flags = IW_TXPOW_DBM;
|
||||
} else {
|
||||
vwrq->disabled = 1;
|
||||
vwrq_->disabled = 1;
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -1262,6 +1278,8 @@ static int woal_set_rate(struct net_device *dev, struct iw_request_info *info,
|
|||
|
||||
ENTER();
|
||||
|
||||
memset(&rate_cfg, 0, sizeof(mlan_rate_cfg_t));
|
||||
|
||||
if (vwrq->value == -1) {
|
||||
rate_cfg.is_rate_auto = 1;
|
||||
} else {
|
||||
|
@ -1970,6 +1988,7 @@ static int woal_get_range(struct net_device *dev, struct iw_request_info *info,
|
|||
mlan_chan_list *pchan_list = NULL;
|
||||
mlan_bss_info bss_info;
|
||||
gfp_t flag;
|
||||
int ret = 0;
|
||||
|
||||
ENTER();
|
||||
|
||||
|
@ -2099,7 +2118,11 @@ static int woal_get_range(struct net_device *dev, struct iw_request_info *info,
|
|||
|
||||
memset(&bss_info, 0, sizeof(bss_info));
|
||||
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_get_bss_info(priv, MOAL_IOCTL_WAIT, &bss_info)) {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
range->txpower[0] = bss_info.min_power_level;
|
||||
range->txpower[1] = bss_info.max_power_level;
|
||||
|
@ -2110,8 +2133,9 @@ static int woal_get_range(struct net_device *dev, struct iw_request_info *info,
|
|||
range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
|
||||
IW_ENC_CAPA_CIPHER_CCMP | IW_ENC_CAPA_CIPHER_TKIP;
|
||||
#endif
|
||||
done:
|
||||
LEAVE();
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef MEF_CFG_RX_FILTER
|
||||
|
@ -2214,7 +2238,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
|
@ -2232,11 +2256,12 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
len = sprintf(buf, "%s rssi %d\n", bss_info.ssid.ssid,
|
||||
signal.bcn_rssi_avg) +
|
||||
len = snprintf(buf, MAX_BUF_LEN, "%s rssi %d\n",
|
||||
bss_info.ssid.ssid,
|
||||
signal.bcn_rssi_avg) +
|
||||
1;
|
||||
} else {
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
}
|
||||
} else if (strncmp(buf, "LINKSPEED", strlen("LINKSPEED")) == 0) {
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
|
@ -2245,14 +2270,15 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
goto done;
|
||||
}
|
||||
PRINTM(MIOCTL, "tx rate=%d\n", (int)rate.rate);
|
||||
len = sprintf(buf, "LinkSpeed %d\n",
|
||||
(int)(rate.rate * 500000 / 1000000)) +
|
||||
len = snprintf(buf, MAX_BUF_LEN, "LinkSpeed %d\n",
|
||||
(int)(rate.rate * 500000 / 1000000)) +
|
||||
1;
|
||||
} else if (strncmp(buf, "MACADDR", strlen("MACADDR")) == 0) {
|
||||
len = sprintf(buf, "Macaddr = %02X:%02X:%02X:%02X:%02X:%02X\n",
|
||||
priv->current_addr[0], priv->current_addr[1],
|
||||
priv->current_addr[2], priv->current_addr[3],
|
||||
priv->current_addr[4], priv->current_addr[5]) +
|
||||
len = snprintf(buf, MAX_BUF_LEN,
|
||||
"Macaddr = %02X:%02X:%02X:%02X:%02X:%02X\n",
|
||||
priv->current_addr[0], priv->current_addr[1],
|
||||
priv->current_addr[2], priv->current_addr[3],
|
||||
priv->current_addr[4], priv->current_addr[5]) +
|
||||
1;
|
||||
} else if (strncmp(buf, "GETPOWER", strlen("GETPOWER")) == 0) {
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
|
@ -2260,7 +2286,9 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
len = sprintf(buf, "powermode = %d\n", power_mode) + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "powermode = %d\n",
|
||||
power_mode) +
|
||||
1;
|
||||
} else if (strncmp(buf, "SCAN-ACTIVE", strlen("SCAN-ACTIVE")) == 0) {
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_set_scan_type(priv, MLAN_SCAN_TYPE_ACTIVE)) {
|
||||
|
@ -2269,7 +2297,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
}
|
||||
priv->scan_type = MLAN_SCAN_TYPE_ACTIVE;
|
||||
PRINTM(MIOCTL, "Set Active Scan\n");
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "SCAN-PASSIVE", strlen("SCAN-PASSIVE")) == 0) {
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_set_scan_type(priv, MLAN_SCAN_TYPE_PASSIVE)) {
|
||||
|
@ -2278,7 +2306,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
}
|
||||
priv->scan_type = MLAN_SCAN_TYPE_PASSIVE;
|
||||
PRINTM(MIOCTL, "Set Passive Scan\n");
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "POWERMODE", strlen("POWERMODE")) == 0) {
|
||||
if (dwrq->length > strlen("POWERMODE") + 1) {
|
||||
pdata = buf + strlen("POWERMODE") + 1;
|
||||
|
@ -2289,7 +2317,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
goto done;
|
||||
}
|
||||
}
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
|
@ -2309,7 +2337,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (memcmp(buf, WEXT_CSCAN_HEADER, strlen(WEXT_CSCAN_HEADER)) ==
|
||||
0) {
|
||||
PRINTM(MIOCTL, "Set Combo Scan\n");
|
||||
|
@ -2318,38 +2346,38 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "GETBAND", strlen("GETBAND")) == 0) {
|
||||
if (MLAN_STATUS_SUCCESS != woal_get_band(priv, &band)) {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
len = sprintf(buf, "Band %d\n", band) + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "Band %d\n", band) + 1;
|
||||
} else if (strncmp(buf, "SETBAND", strlen("SETBAND")) == 0) {
|
||||
pband = buf + strlen("SETBAND") + 1;
|
||||
if (MLAN_STATUS_SUCCESS != woal_set_band(priv, pband)) {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "START", strlen("START")) == 0) {
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "STOP", strlen("STOP")) == 0) {
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "SETSUSPENDOPT", strlen("SETSUSPENDOPT")) ==
|
||||
0) {
|
||||
/* it will be done by GUI */
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "BTCOEXMODE", strlen("BTCOEXMODE")) == 0) {
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "BTCOEXSCAN-START",
|
||||
strlen("BTCOEXSCAN-START")) == 0) {
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "BTCOEXSCAN-STOP", strlen("BTCOEXSCAN-STOP")) ==
|
||||
0) {
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "BGSCAN-START", strlen("BGSCAN-START")) == 0) {
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "BGSCAN-CONFIG", strlen("BGSCAN-CONFIG")) ==
|
||||
0) {
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
|
@ -2359,7 +2387,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
}
|
||||
priv->bg_scan_start = MTRUE;
|
||||
priv->bg_scan_reported = MFALSE;
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "BGSCAN-STOP", strlen("BGSCAN-STOP")) == 0) {
|
||||
if (priv->bg_scan_start && !priv->scan_cfg.rssi_threshold) {
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
|
@ -2370,7 +2398,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
priv->bg_scan_start = MFALSE;
|
||||
priv->bg_scan_reported = MFALSE;
|
||||
}
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "RXFILTER-START", strlen("RXFILTER-START")) ==
|
||||
0) {
|
||||
#ifdef MEF_CFG_RX_FILTER
|
||||
|
@ -2378,7 +2406,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
if (ret)
|
||||
goto done;
|
||||
#endif
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "RXFILTER-STOP", strlen("RXFILTER-STOP")) ==
|
||||
0) {
|
||||
#ifdef MEF_CFG_RX_FILTER
|
||||
|
@ -2386,7 +2414,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
if (ret)
|
||||
goto done;
|
||||
#endif
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else if (strncmp(buf, "RXFILTER-ADD", strlen("RXFILTER-ADD")) == 0) {
|
||||
if (dwrq->length > strlen("RXFILTER-ADD") + 1) {
|
||||
pdata = buf + strlen("RXFILTER-ADD") + 1;
|
||||
|
@ -2395,7 +2423,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
|
@ -2409,7 +2437,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
|
@ -2422,7 +2450,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
|
@ -2435,7 +2463,7 @@ static int woal_set_priv(struct net_device *dev, struct iw_request_info *info,
|
|||
ret = -EFAULT;
|
||||
goto done;
|
||||
}
|
||||
len = sprintf(buf, "OK\n") + 1;
|
||||
len = snprintf(buf, MAX_BUF_LEN, "OK\n") + 1;
|
||||
} else {
|
||||
ret = -EFAULT;
|
||||
goto done;
|
||||
|
@ -2491,7 +2519,9 @@ static mlan_status woal_wext_request_scan(moal_private *priv, t_u8 wait_option,
|
|||
MLAN_MAX_SSID_LENGTH);
|
||||
scan_req->ssid_list[0].max_len = 0;
|
||||
}
|
||||
woal_get_scan_config(priv, &scan_cfg);
|
||||
if (MLAN_STATUS_SUCCESS != woal_get_scan_config(priv, &scan_cfg)) {
|
||||
PRINTM(MERROR, "Unable to get scan configuration\n");
|
||||
}
|
||||
if (scan_cfg.scan_chan_gap)
|
||||
scan_req->scan_chan_gap = scan_cfg.scan_chan_gap;
|
||||
else
|
||||
|
@ -2586,6 +2616,60 @@ done:
|
|||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Request scan based on connect parameter
|
||||
*
|
||||
* @param priv A pointer to moal_private structure
|
||||
* @param ssid_bssid A pointer to mlan_ssid_bssid structure
|
||||
*
|
||||
* @return 0 -- success, otherwise fail
|
||||
*/
|
||||
static int woal_owe_specific_scan(moal_private *priv,
|
||||
mlan_ssid_bssid *ssid_bssid)
|
||||
{
|
||||
moal_handle *handle = priv->phandle;
|
||||
int ret = 0;
|
||||
wlan_user_scan_cfg *scan_req;
|
||||
ENTER();
|
||||
if (handle->scan_pending_on_block == MTRUE) {
|
||||
PRINTM(MINFO, "scan already in processing...\n");
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
scan_req = (wlan_user_scan_cfg *)kmalloc(sizeof(wlan_user_scan_cfg),
|
||||
GFP_KERNEL);
|
||||
if (!scan_req) {
|
||||
PRINTM(MERROR, "Malloc buffer failed\n");
|
||||
LEAVE();
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
priv->report_scan_result = MTRUE;
|
||||
memset(scan_req, 0x00, sizeof(wlan_user_scan_cfg));
|
||||
scan_req->keep_previous_scan = MTRUE;
|
||||
moal_memcpy_ext(priv->phandle, scan_req->ssid_list[0].ssid,
|
||||
ssid_bssid->trans_ssid.ssid,
|
||||
MIN(ssid_bssid->trans_ssid.ssid_len,
|
||||
MLAN_MAX_SSID_LENGTH),
|
||||
sizeof(scan_req->ssid_list[0].ssid));
|
||||
scan_req->ssid_list[0].max_len = 0;
|
||||
scan_req->chan_list[0].chan_number = ssid_bssid->channel;
|
||||
if (ssid_bssid->bss_band == BAND_A)
|
||||
scan_req->chan_list[0].radio_type = BAND_5GHZ;
|
||||
else
|
||||
scan_req->chan_list[0].radio_type = BAND_2GHZ;
|
||||
scan_req->chan_list[0].scan_time = 0;
|
||||
// TODO need set to PASSIVE TO ACTIVE on DFS channel
|
||||
scan_req->chan_list[0].scan_type = MLAN_SCAN_TYPE_ACTIVE;
|
||||
|
||||
moal_memcpy_ext(priv->phandle, scan_req->random_mac, priv->random_mac,
|
||||
ETH_ALEN, sizeof(scan_req->random_mac));
|
||||
ret = woal_request_userscan(priv, MOAL_IOCTL_WAIT, scan_req);
|
||||
kfree(scan_req);
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set essid
|
||||
*
|
||||
|
@ -2603,6 +2687,7 @@ static int woal_set_essid(struct net_device *dev, struct iw_request_info *info,
|
|||
struct iw_point *dwrq = &wrqu->data;
|
||||
mlan_802_11_ssid req_ssid;
|
||||
mlan_ssid_bssid ssid_bssid;
|
||||
mlan_ssid_bssid *owe_ssid_bssid = NULL;
|
||||
#ifdef REASSOCIATION
|
||||
moal_handle *handle = priv->phandle;
|
||||
mlan_bss_info bss_info;
|
||||
|
@ -2680,6 +2765,38 @@ static int woal_set_essid(struct net_device *dev, struct iw_request_info *info,
|
|||
goto setessid_ret;
|
||||
}
|
||||
|
||||
priv->auto_assoc_priv.drv_assoc.status = MFALSE;
|
||||
priv->auto_assoc_priv.drv_reconnect.status = MFALSE;
|
||||
#ifdef REASSOCIATION
|
||||
if (priv->reassoc_on == MTRUE) {
|
||||
if (priv->auto_assoc_priv.auto_assoc_type_on &
|
||||
(0x1 << (AUTO_ASSOC_TYPE_DRV_ASSOC - 1))) {
|
||||
if (priv->scan_type == MLAN_SCAN_TYPE_PASSIVE)
|
||||
woal_set_scan_type(
|
||||
priv, MLAN_SCAN_TYPE_PASSIVE);
|
||||
MOAL_REL_SEMAPHORE(&handle->reassoc_sem);
|
||||
moal_memcpy_ext(
|
||||
priv->phandle,
|
||||
&priv->prev_ssid_bssid.ssid, &req_ssid,
|
||||
sizeof(mlan_802_11_ssid),
|
||||
sizeof(priv->prev_ssid_bssid.ssid));
|
||||
priv->auto_assoc_priv.auto_assoc_trigger_flag =
|
||||
AUTO_ASSOC_TYPE_DRV_ASSOC;
|
||||
priv->auto_assoc_priv.drv_assoc.status = MTRUE;
|
||||
priv->reassoc_required = MTRUE;
|
||||
priv->phandle->is_reassoc_timer_set = MTRUE;
|
||||
PRINTM(MINFO,
|
||||
" auto assoc: trigger driver auto assoc\n");
|
||||
woal_mod_timer(&priv->phandle->reassoc_timer,
|
||||
0);
|
||||
ret = MLAN_STATUS_SUCCESS;
|
||||
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (dwrq->flags != 0xFFFF) {
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_find_essid(priv, &ssid_bssid,
|
||||
|
@ -2698,8 +2815,12 @@ static int woal_set_essid(struct net_device *dev, struct iw_request_info *info,
|
|||
mode = woal_get_mode(priv, MOAL_IOCTL_WAIT);
|
||||
if (mode == IW_MODE_ADHOC)
|
||||
/* disconnect before try to associate */
|
||||
woal_disconnect(priv, MOAL_IOCTL_WAIT, NULL,
|
||||
DEF_DEAUTH_REASON_CODE);
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_disconnect(priv, MOAL_IOCTL_WAIT, NULL,
|
||||
DEF_DEAUTH_REASON_CODE)) {
|
||||
PRINTM(MERROR,
|
||||
"Disconnect before association failed\n");
|
||||
}
|
||||
|
||||
if (mode != IW_MODE_ADHOC) {
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
|
@ -2708,6 +2829,34 @@ static int woal_set_essid(struct net_device *dev, struct iw_request_info *info,
|
|||
ret = -EFAULT;
|
||||
goto setessid_ret;
|
||||
}
|
||||
if (ssid_bssid.trans_ssid.ssid_len &&
|
||||
(ssid_bssid.owe_transition_mode == OWE_TRANS_MODE_OPEN)) {
|
||||
// We need scan for OWE AP
|
||||
owe_ssid_bssid = (mlan_ssid_bssid *)kmalloc(
|
||||
sizeof(mlan_ssid_bssid), GFP_KERNEL);
|
||||
if (!owe_ssid_bssid) {
|
||||
PRINTM(MERROR, "Malloc buffer failed\n");
|
||||
ret = -ENOMEM;
|
||||
goto setessid_ret;
|
||||
}
|
||||
woal_owe_specific_scan(priv, &ssid_bssid);
|
||||
memset(owe_ssid_bssid, 0, sizeof(mlan_ssid_bssid));
|
||||
moal_memcpy_ext(priv->phandle, &owe_ssid_bssid->ssid,
|
||||
&ssid_bssid.trans_ssid,
|
||||
sizeof(mlan_802_11_ssid),
|
||||
sizeof(owe_ssid_bssid->ssid));
|
||||
moal_memcpy_ext(priv->phandle, &owe_ssid_bssid->bssid,
|
||||
&ssid_bssid.trans_bssid,
|
||||
sizeof(mlan_802_11_mac_addr),
|
||||
sizeof(owe_ssid_bssid->bssid));
|
||||
if (MLAN_STATUS_SUCCESS ==
|
||||
woal_find_essid(priv, owe_ssid_bssid,
|
||||
MOAL_IOCTL_WAIT))
|
||||
moal_memcpy_ext(priv->phandle, &ssid_bssid,
|
||||
owe_ssid_bssid,
|
||||
sizeof(mlan_ssid_bssid),
|
||||
sizeof(ssid_bssid));
|
||||
}
|
||||
if (MLAN_STATUS_SUCCESS !=
|
||||
woal_11d_check_ap_channel(priv, MOAL_IOCTL_WAIT,
|
||||
&ssid_bssid)) {
|
||||
|
@ -2761,6 +2910,8 @@ setessid_ret:
|
|||
#ifdef REASSOCIATION
|
||||
MOAL_REL_SEMAPHORE(&handle->reassoc_sem);
|
||||
#endif
|
||||
if (owe_ssid_bssid)
|
||||
kfree(owe_ssid_bssid);
|
||||
LEAVE();
|
||||
return ret;
|
||||
}
|
||||
|
@ -2914,7 +3065,11 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
|
|||
iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
|
||||
moal_memcpy_ext(priv->phandle, iwe.u.ap_addr.sa_data,
|
||||
&scan_table[i].mac_address, ETH_ALEN,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
|
||||
sizeof(iwe.u.ap_addr.sa_data_min));
|
||||
#else
|
||||
sizeof(iwe.u.ap_addr.sa_data));
|
||||
#endif
|
||||
|
||||
iwe.len = IW_EV_ADDR_LEN;
|
||||
current_ev = IWE_STREAM_ADD_EVENT(info, current_ev, end_buf,
|
||||
|
@ -3032,8 +3187,8 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
|
|||
/* Beacon Interval */
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
ptr = buf;
|
||||
ptr += sprintf(ptr, "Beacon interval=%d",
|
||||
scan_table[i].beacon_period);
|
||||
ptr += snprintf(ptr, MAX_BUF_LEN, "Beacon interval=%d",
|
||||
scan_table[i].beacon_period);
|
||||
|
||||
iwe.u.data.length = strlen(buf);
|
||||
iwe.cmd = IWEVCUSTOM;
|
||||
|
@ -3092,9 +3247,6 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
|
|||
current_ev = IWE_STREAM_ADD_POINT(
|
||||
info, current_ev, end_buf, &iwe,
|
||||
buf);
|
||||
current_val = current_ev +
|
||||
IW_EV_LCP_LEN +
|
||||
strlen(buf);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
@ -3111,12 +3263,12 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
|
|||
memset(&iwe, 0, sizeof(iwe));
|
||||
memset(buf, 0, buf_size);
|
||||
ptr = buf;
|
||||
ptr += sprintf(ptr, "band=");
|
||||
ptr += snprintf(ptr, MAX_BUF_LEN, "band=");
|
||||
memset(&iwe, 0, sizeof(iwe));
|
||||
if (scan_table[i].bss_band == BAND_A)
|
||||
ptr += sprintf(ptr, "a");
|
||||
snprintf(ptr, MAX_BUF_LEN, "a");
|
||||
else
|
||||
ptr += sprintf(ptr, "bg");
|
||||
snprintf(ptr, MAX_BUF_LEN, "bg");
|
||||
iwe.u.data.length = strlen(buf);
|
||||
PRINTM(MINFO, "iwe.u.data.length %d\n", iwe.u.data.length);
|
||||
PRINTM(MINFO, "BUF: %s\n", buf);
|
||||
|
@ -3124,7 +3276,6 @@ static int woal_get_scan(struct net_device *dev, struct iw_request_info *info,
|
|||
iwe.len = IW_EV_POINT_LEN + iwe.u.data.length;
|
||||
current_ev = IWE_STREAM_ADD_POINT(info, current_ev, end_buf,
|
||||
&iwe, buf);
|
||||
current_val = current_ev + IW_EV_LCP_LEN + strlen(buf);
|
||||
#endif
|
||||
current_val = current_ev + IW_EV_LCP_LEN;
|
||||
|
||||
|
@ -3257,9 +3408,14 @@ static const iw_handler woal_private_handler[] = {
|
|||
void woal_send_iwevcustom_event(moal_private *priv, char *str)
|
||||
{
|
||||
union iwreq_data iwrq;
|
||||
char buf[IW_CUSTOM_MAX];
|
||||
char buf[256];
|
||||
|
||||
ENTER();
|
||||
/* Check register_netdevice is completed before sending*/
|
||||
if (priv->netdev->reg_state != NETREG_REGISTERED) {
|
||||
LEAVE();
|
||||
return;
|
||||
}
|
||||
|
||||
memset(&iwrq, 0, sizeof(union iwreq_data));
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
|
|
@ -3,6 +3,8 @@ ifconfig mlan0 down
|
|||
ifconfig uap0 down
|
||||
ifconfig mmlan0 down
|
||||
ifconfig muap0 down
|
||||
ifconfig uap1 down
|
||||
ifconfig muap1 down
|
||||
ifconfig wfd0 down
|
||||
ifconfig wfd1 down
|
||||
ifconfig mwfd0 down
|
||||
|
|
Loading…
Reference in a new issue