Driver commit for mxm5x17405_FP68_p70_v0v1-mgpl

This commit is contained in:
Yuvraj Singh 2026-07-07 11:47:23 +05:30
parent f505e82f54
commit 1776f9c98f
217 changed files with 361386 additions and 0 deletions

21
BUILD.bazel Normal file
View 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__",
],
)

725
Makefile Normal file
View file

@ -0,0 +1,725 @@
# File: Makefile
#
# Copyright 2008-2026 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.
#
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)
endif
LD ?= $(CROSS_COMPILE)ld
BACKUP= /root/backup
YMD= `date +%Y%m%d%H%M`
#############################################################################
# Configuration Options
#############################################################################
# Multi-chipsets
CONFIG_PCIE8897=n
CONFIG_PCIE8997=n
CONFIG_PCIE9097=y
CONFIG_PCIE9098=y
# Debug Option
# DEBUG LEVEL n/1/2:
# n: NO DEBUG
# 1: Only PRINTM(MMSG,...), PRINTM(MFATAL,...), ...
# 2: All PRINTM()
CONFIG_DEBUG=1
# Enable STA mode support
CONFIG_STA_SUPPORT=y
# Enable uAP mode support
CONFIG_UAP_SUPPORT=y
# Enable WIFIDIRECT support
CONFIG_WIFI_DIRECT_SUPPORT=y
# Enable WIFIDISPLAY support
CONFIG_WIFI_DISPLAY_SUPPORT=y
# Re-association in driver
CONFIG_REASSOCIATION=y
# Manufacturing firmware support
CONFIG_MFG_CMD_SUPPORT=y
# OpenWrt support
CONFIG_OPENWRT_SUPPORT=n
# Big-endian platform
CONFIG_BIG_ENDIAN=n
# DFS testing support
CONFIG_DFS_TESTING_SUPPORT=y
# Multi-channel support
CONFIG_MULTI_CHAN_SUPPORT=y
CONFIG_ANDROID_KERNEL=n
CONFIG_DUMP_TO_PROC=n
CONFIG_FWDUMP_VIA_PRINT=n
CONFIG_TASKLET_SUPPORT=n
#32bit app over 64bit kernel support
CONFIG_USERSPACE_32BIT_OVER_KERNEL_64BIT=n
##########################
ccflags-y += -Wall
ccflags-y += -Wstrict-prototypes
ccflags-y += -Wunused-variable
ccflags-y += -Wno-misleading-indentation
ccflags-y += -Wundef
ccflags-y += -Werror=strict-prototypes
ccflags-y += -Werror=implicit-function-declaration
ccflags-y += -Werror=implicit-int
ccflags-y += -Werror=return-type
ccflags-y += -Wframe-larger-than=4096
ccflags-y += -Werror
ccflags-y += -Wvla
ccflags-y += -Wno-trigraphs
ccflags-y += -Wno-format-security
ccflags-y += -Wno-unused-const-variable
ccflags-y += -Wno-frame-address
ccflags-y += -Wno-address-of-packed-member
ccflags-y += -Wno-pointer-sign
ccflags-y += -Wno-array-bounds
ccflags-y += -Werror=date-time
ccflags-y += -Werror=incompatible-pointer-types
ccflags-y += -Wno-format
ccflags-y += -Wno-sign-compare
ccflags-y += -Wno-format-zero-length
ccflags-y += -Wno-psabi
IS_CLANG := $(shell $(CC) --version | grep -i clang)
ifneq ($(IS_CLANG),)
# add clang specific flags which are not available in gcc
ccflags-y += -Werror=unknown-warning-option
ccflags-y += -Werror=ignored-optimization-argument
ccflags-y += -Wdeclaration-after-statement
ccflags-y += -Wno-gnu
ccflags-y += -Wno-initializer-overrides
ccflags-y += -Wno-pointer-to-enum-cast
ccflags-y += -Wno-tautological-constant-out-of-range-compare
# clang version specific flags
CLANG_VERSION := $(shell $(CC) --version | head -n1 | sed -E 's/.*version ([0-9]+)\.([0-9]+)\.([0-9]+).*/\1/')
CLANG_MAJOR := $(word 1, $(CLANG_VERSION))
# Add extra flags if Clang version is > 12.0.0
ifeq ($(shell [ $(CLANG_MAJOR) -gt 12 ] && echo yes),yes)
ccflags-y += -Wno-unused-but-set-variable
endif # CLANG_MAJOR > 12
ifeq ($(shell [ $(CLANG_MAJOR) -ge 15 ] && echo yes),yes)
ccflags-y += -Wno-unaligned-access
endif # CLANG_MAJOR >= 15
endif # IS_CLANG
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
#ccflags-y += -Wunused-but-set-variable
#ccflags-y += -Wmissing-prototypes
#ccflags-y += -Wold-style-definition
#ccflags-y += -Wtype-limits
#ccflags-y += -Wsuggest-attribute=format
#ccflags-y += -Wmissing-include-dirs
#ccflags-y += -Wshadow
#ccflags-y += -Wsign-compare
#ccflags-y += -Wunused-macros
#ccflags-y += -Wmissing-field-initializers
#ccflags-y += -Wstringop-truncation
#ccflags-y += -Wmisleading-indentation
#ccflags-y += -Wunused-const-variable
#############################################################################
# Select Platform Tools
#############################################################################
ifeq ($(ANDROID_BUILD), 1)
KERNEL_CFLAGS += -DANDROID
PWD := $(shell pwd)
KERNELDIR ?= $(KERNEL_SRC)
ccflags-y += -DANDROID_SDK_VERSION=$(ANDROID_SDK_VERSION)
endif
MODEXT = ko
ccflags-y += -I$(PWD)/mlan
ccflags-y += -DLINUX
KERNELVERSION_X86 := $(shell uname -r)
KERNELDIR ?= /lib/modules/$(KERNELVERSION_X86)/build
LD += -S
BINDIR = ../bin_wlan
APPDIR= $(shell if test -d "mapp"; then echo mapp; fi)
#############################################################################
# Compiler Flags
#############################################################################
ccflags-y += -I$(KERNELDIR)/include
ccflags-y += -DMLAN_RELEASE_VERSION='"405.p70"'
ccflags-y += -DFPNUM='"68"'
ifeq ($(CONFIG_DEBUG),1)
ccflags-y += -DDEBUG_LEVEL1
endif
ifeq ($(CONFIG_DEBUG),2)
ccflags-y += -DDEBUG_LEVEL1
ccflags-y += -DDEBUG_LEVEL2
DBG= -dbg
endif
ifeq ($(CONFIG_64BIT), y)
ccflags-y += -DMLAN_64BIT
endif
ifeq ($(CONFIG_STA_SUPPORT),y)
ccflags-y += -DSTA_SUPPORT
ifeq ($(CONFIG_REASSOCIATION),y)
ccflags-y += -DREASSOCIATION
endif
else
CONFIG_WIFI_DIRECT_SUPPORT=n
CONFIG_WIFI_DISPLAY_SUPPORT=n
CONFIG_STA_WEXT=n
CONFIG_STA_CFG80211=n
endif
ifeq ($(CONFIG_UAP_SUPPORT),y)
ccflags-y += -DUAP_SUPPORT
else
CONFIG_WIFI_DIRECT_SUPPORT=n
CONFIG_WIFI_DISPLAY_SUPPORT=n
CONFIG_UAP_WEXT=n
CONFIG_UAP_CFG80211=n
endif
ifeq ($(CONFIG_WIFI_DIRECT_SUPPORT),y)
ccflags-y += -DWIFI_DIRECT_SUPPORT
endif
ifeq ($(CONFIG_WIFI_DISPLAY_SUPPORT),y)
ccflags-y += -DWIFI_DISPLAY_SUPPORT
endif
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
ifeq ($(CONFIG_MULTI_CHAN_SUPPORT),y)
ccflags-y += -DMULTI_CHAN_SUPPORT
endif
ifeq ($(CONFIG_DFS_TESTING_SUPPORT),y)
ccflags-y += -DDFS_TESTING_SUPPORT
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_FWDUMP_VIA_PRINT), y)
ccflags-y += -DFWDUMP_VIA_PRINT
endif
ifeq ($(CONFIG_TASKLET_SUPPORT), y)
ccflags-y += -DTASKLET_SUPPORT
endif
ifeq ($(CONFIG_OPENWRT_SUPPORT), y)
ccflags-y += -DOPENWRT
endif
ifeq ($(CONFIG_T50), y)
ccflags-y += -DT50
ccflags-y += -DT40
ccflags-y += -DT3T
endif
ifeq ($(CONFIG_PCIE8897),y)
CONFIG_PCIE=y
ccflags-y += -DPCIE8897
endif
ifeq ($(CONFIG_PCIE8997),y)
CONFIG_PCIE=y
ccflags-y += -DPCIE8997
endif
ifeq ($(CONFIG_PCIE9097),y)
CONFIG_PCIE=y
ccflags-y += -DPCIE9097
endif
ifeq ($(CONFIG_PCIE9098),y)
CONFIG_PCIE=y
ccflags-y += -DPCIE9098
endif
ifeq ($(CONFIG_PCIE),y)
ccflags-y += -DPCIE
endif
CONFIG_MAC80211_SUPPORT=n
CONFIG_MAC80211_SUPPORT_UAP=n
CONFIG_MAC80211_SUPPORT_MESH=n
ifeq ($(CONFIG_MAC80211_SUPPORT),y)
ccflags-y += -DMAC80211_SUPPORT
endif
ifeq ($(CONFIG_MAC80211_SUPPORT_UAP),y)
ccflags-y += -DMAC80211_SUPPORT_UAP
endif
ifeq ($(CONFIG_MAC80211_SUPPORT_MESH),y)
ccflags-y += -DMAC80211_SUPPORT_MESH
endif
# add -Wno-packed-bitfield-compat when GCC version greater than 4.4
#############################################################################
# Make Targets
#############################################################################
ifneq ($(KERNELRELEASE),)
ifeq ($(CONFIG_WIRELESS_EXT),y)
ifeq ($(CONFIG_WEXT_PRIV),y)
# Enable WEXT for STA
CONFIG_STA_WEXT=y
# Enable WEXT for uAP
CONFIG_UAP_WEXT=y
else
# Disable WEXT for STA
CONFIG_STA_WEXT=n
# Disable WEXT for uAP
CONFIG_UAP_WEXT=n
endif
endif
# Enable CFG80211 for STA
ifeq ($(CONFIG_CFG80211),y)
CONFIG_STA_CFG80211=y
else
ifeq ($(CONFIG_CFG80211),m)
CONFIG_STA_CFG80211=y
else
CONFIG_STA_CFG80211=n
endif
endif
# OpenWrt
ifeq ($(CONFIG_OPENWRT_SUPPORT), y)
ifeq ($(CPTCFG_CFG80211),y)
CONFIG_STA_CFG80211=y
else
ifeq ($(CPTCFG_CFG80211),m)
CONFIG_STA_CFG80211=y
else
CONFIG_STA_CFG80211=n
endif
endif
endif
# Enable CFG80211 for uAP
ifeq ($(CONFIG_CFG80211),y)
CONFIG_UAP_CFG80211=y
else
ifeq ($(CONFIG_CFG80211),m)
CONFIG_UAP_CFG80211=y
else
CONFIG_UAP_CFG80211=n
endif
endif
# OpenWrt
ifeq ($(CONFIG_OPENWRT_SUPPORT), y)
ifeq ($(CPTCFG_CFG80211),y)
CONFIG_STA_CFG80211=y
else
ifeq ($(CPTCFG_CFG80211),m)
CONFIG_STA_CFG80211=y
else
CONFIG_STA_CFG80211=n
endif
endif
endif
ifneq ($(CONFIG_STA_SUPPORT),y)
CONFIG_WIFI_DIRECT_SUPPORT=n
CONFIG_WIFI_DISPLAY_SUPPORT=n
CONFIG_STA_WEXT=n
CONFIG_STA_CFG80211=n
endif
ifneq ($(CONFIG_UAP_SUPPORT),y)
CONFIG_WIFI_DIRECT_SUPPORT=n
CONFIG_WIFI_DISPLAY_SUPPORT=n
CONFIG_UAP_WEXT=n
CONFIG_UAP_CFG80211=n
endif
ifeq ($(CONFIG_STA_SUPPORT),y)
ifeq ($(CONFIG_STA_WEXT),y)
ccflags-y += -DSTA_WEXT
endif
ifeq ($(CONFIG_STA_CFG80211),y)
ccflags-y += -DSTA_CFG80211
endif
endif
ifeq ($(CONFIG_UAP_SUPPORT),y)
ifeq ($(CONFIG_UAP_WEXT),y)
ccflags-y += -DUAP_WEXT
endif
ifeq ($(CONFIG_UAP_CFG80211),y)
ccflags-y += -DUAP_CFG80211
endif
endif
print:
ifeq ($(CONFIG_STA_SUPPORT),y)
ifeq ($(CONFIG_STA_WEXT),n)
ifeq ($(CONFIG_STA_CFG80211),n)
@echo "Can not build STA without WEXT or CFG80211"
exit 2
endif
endif
endif
ifeq ($(CONFIG_UAP_SUPPORT),y)
ifeq ($(CONFIG_UAP_WEXT),n)
ifeq ($(CONFIG_UAP_CFG80211),n)
@echo "Can not build UAP without WEXT or CFG80211"
exit 2
endif
endif
endif
MOALOBJS = mlinux/moal_main.o \
mlinux/moal_ioctl.o \
mlinux/moal_shim.o \
mlinux/moal_eth_ioctl.o \
mlinux/moal_init.o
MLANOBJS = mlan/mlan_shim.o mlan/mlan_init.o \
mlan/mlan_txrx.o \
mlan/mlan_cmdevt.o mlan/mlan_misc.o \
mlan/mlan_cfp.o \
mlan/mlan_module.o
MLANOBJS += mlan/mlan_wmm.o
ifeq ($(CONFIG_PCIE),y)
MLANOBJS += mlan/mlan_pcie.o
endif
MLANOBJS += mlan/mlan_11n_aggr.o
MLANOBJS += mlan/mlan_11n_rxreorder.o
MLANOBJS += mlan/mlan_11n.o
MLANOBJS += mlan/mlan_11ac.o
MLANOBJS += mlan/mlan_11ax.o
MLANOBJS += mlan/mlan_11d.o
MLANOBJS += mlan/mlan_11h.o
ifeq ($(CONFIG_STA_SUPPORT),y)
MLANOBJS += mlan/mlan_meas.o
MLANOBJS += mlan/mlan_scan.o \
mlan/mlan_sta_ioctl.o \
mlan/mlan_sta_rx.o \
mlan/mlan_sta_tx.o \
mlan/mlan_sta_event.o \
mlan/mlan_sta_cmd.o \
mlan/mlan_sta_cmdresp.o \
mlan/mlan_join.o
ifeq ($(CONFIG_STA_WEXT),y)
MOALOBJS += mlinux/moal_priv.o \
mlinux/moal_wext.o
endif
endif
ifeq ($(CONFIG_UAP_SUPPORT),y)
MLANOBJS += mlan/mlan_uap_ioctl.o
MLANOBJS += mlan/mlan_uap_cmdevent.o
MLANOBJS += mlan/mlan_uap_txrx.o
MOALOBJS += mlinux/moal_uap.o
ifeq ($(CONFIG_UAP_WEXT),y)
MOALOBJS += mlinux/moal_uap_priv.o
MOALOBJS += mlinux/moal_uap_wext.o
endif
endif
ifeq ($(CONFIG_STA_CFG80211),y)
MOALOBJS += mlinux/moal_cfg80211.o
MOALOBJS += mlinux/moal_cfg80211_util.o
MOALOBJS += mlinux/moal_sta_cfg80211.o
endif
ifeq ($(CONFIG_UAP_CFG80211),y)
MOALOBJS += mlinux/moal_cfg80211.o
MOALOBJS += mlinux/moal_cfg80211_util.o
MOALOBJS += mlinux/moal_uap_cfg80211.o
endif
ifdef CONFIG_PROC_FS
MOALOBJS += mlinux/moal_proc.o
MOALOBJS += mlinux/moal_debug.o
endif
ifeq ($(CONFIG_MAC80211_SUPPORT),y)
MOALOBJS += mlinux/moal_mac80211.o
MLANOBJS += mlan/mlan_mac80211.o
endif
obj-m := mlan.o
mlan-objs := $(MLANOBJS)
ifeq ($(CONFIG_PCIE),y)
MOALOBJS += mlinux/moal_pcie.o
endif
obj-m += moal.o
moal-objs := $(MOALOBJS)
# Otherwise we were called directly from the command line; invoke the kernel build system.
else
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif
###############################################################
export CC LD ccflags-y KERNELDIR
ifeq ($(CONFIG_STA_SUPPORT),y)
ifeq ($(CONFIG_UAP_SUPPORT),y)
.PHONY: mapp/mlanconfig mapp/mlan2040coex mapp/mlanevent mapp/uaputl mapp/mlanutl clean distclean
else
.PHONY: mapp/mlanconfig mapp/mlanevent mapp/mlan2040coex mapp/mlanutl mapp/mlanwls mapp/mlancsi mapp/nanapp clean distclean
endif
else
ifeq ($(CONFIG_UAP_SUPPORT),y)
.PHONY: mapp/mlanevent mapp/uaputl clean distclean
endif
endif
@echo "Finished Making NXP Wlan Linux Driver"
ifeq ($(CONFIG_STA_SUPPORT),y)
mapp/mlanconfig:
$(MAKE) -C $@
mapp/mlanutl:
$(MAKE) -C $@
mapp/mlan2040coex:
$(MAKE) -C $@
endif
ifeq ($(CONFIG_UAP_SUPPORT),y)
mapp/uaputl:
$(MAKE) -C $@
endif
ifeq ($(CONFIG_WIFI_DIRECT_SUPPORT),y)
mapp/wifidirectutl:
$(MAKE) -C $@
endif
mapp/mlanevent:
$(MAKE) -C $@
echo:
appsbuild:
@if [ ! -d $(BINDIR) ]; then \
mkdir $(BINDIR); \
fi
ifeq ($(CONFIG_STA_SUPPORT),y)
cp -f README_MLAN $(BINDIR)
cp -f README $(BINDIR)
cp -f README_RBC $(BINDIR)
ifneq ($(APPDIR),)
$(MAKE) -C mapp/mlanconfig $@ INSTALLDIR=$(BINDIR)
$(MAKE) -C mapp/mlanutl $@ INSTALLDIR=$(BINDIR)
$(MAKE) -C mapp/mlan2040coex $@ INSTALLDIR=$(BINDIR)
endif
endif
ifeq ($(CONFIG_UAP_SUPPORT),y)
cp -f README_UAP $(BINDIR)
ifneq ($(APPDIR),)
$(MAKE) -C mapp/uaputl $@ INSTALLDIR=$(BINDIR)
endif
endif
ifeq ($(CONFIG_WIFI_DIRECT_SUPPORT),y)
cp -f README_WIFIDIRECT $(BINDIR)
cp -rpf script/wifidirect $(BINDIR)
ifeq ($(CONFIG_WIFI_DISPLAY_SUPPORT),y)
cp -rpf script/wifidisplay $(BINDIR)
endif
ifneq ($(APPDIR),)
$(MAKE) -C mapp/wifidirectutl $@ INSTALLDIR=$(BINDIR)
endif
endif
ifneq ($(APPDIR),)
$(MAKE) -C mapp/mlanevent $@ INSTALLDIR=$(BINDIR)
endif
build: echo default
@if [ ! -d $(BINDIR) ]; then \
mkdir $(BINDIR); \
fi
cp -f mlan.$(MODEXT) $(BINDIR)/mlan$(DBG).$(MODEXT)
cp -f moal.$(MODEXT) $(BINDIR)/moal$(DBG).$(MODEXT)
cp -rpf script/load $(BINDIR)/
cp -rpf script/unload $(BINDIR)/
ifeq ($(CONFIG_STA_SUPPORT),y)
cp -f README_MLAN $(BINDIR)
cp -f README $(BINDIR)
cp -f README_RBC $(BINDIR)
ifneq ($(APPDIR),)
$(MAKE) -C mapp/mlanconfig $@ INSTALLDIR=$(BINDIR)
$(MAKE) -C mapp/mlanutl $@ INSTALLDIR=$(BINDIR)
$(MAKE) -C mapp/mlan2040coex $@ INSTALLDIR=$(BINDIR)
endif
endif
ifeq ($(CONFIG_UAP_SUPPORT),y)
cp -f README_UAP $(BINDIR)
ifneq ($(APPDIR),)
$(MAKE) -C mapp/uaputl $@ INSTALLDIR=$(BINDIR)
endif
endif
ifeq ($(CONFIG_WIFI_DIRECT_SUPPORT),y)
cp -f README_WIFIDIRECT $(BINDIR)
cp -rpf script/wifidirect $(BINDIR)
ifeq ($(CONFIG_WIFI_DISPLAY_SUPPORT),y)
cp -rpf script/wifidisplay $(BINDIR)
endif
ifneq ($(APPDIR),)
$(MAKE) -C mapp/wifidirectutl $@ INSTALLDIR=$(BINDIR)
endif
endif
ifneq ($(APPDIR),)
$(MAKE) -C mapp/mlanevent $@ INSTALLDIR=$(BINDIR)
endif
clean:
-find . -name "*.o" -exec rm {} \;
-find . -name "*.ko" -exec rm {} \;
-find . -name ".*.cmd" -exec rm {} \;
-find . -name "*.mod.c" -exec rm {} \;
-find . -name "Module.symvers" -exec rm {} \;
-find . -name "Module.markers" -exec rm {} \;
-find . -name "modules.order" -exec rm {} \;
-find . -name ".*.dwo" -exec rm {} \;
-find . -name "*dwo" -exec rm {} \;
-rm -rf .tmp_versions
ifneq ($(APPDIR),)
ifeq ($(CONFIG_STA_SUPPORT),y)
$(MAKE) -C mapp/mlanconfig $@
$(MAKE) -C mapp/mlanutl $@
$(MAKE) -C mapp/mlan2040coex $@
endif
ifeq ($(CONFIG_UAP_SUPPORT),y)
$(MAKE) -C mapp/uaputl $@
endif
ifeq ($(CONFIG_WIFI_DIRECT_SUPPORT),y)
$(MAKE) -C mapp/wifidirectutl $@
endif
$(MAKE) -C mapp/mlanevent $@
endif
install: default
cp -f mlan.$(MODEXT) $(INSTALLDIR)/mlan$(DBG).$(MODEXT)
cp -f moal.$(MODEXT) $(INSTALLDIR)/moal$(DBG).$(MODEXT)
echo $(INSTALLDIR)
echo "MX Driver Installed"
distclean:
-find . -name "*.o" -exec rm {} \;
-find . -name "*.orig" -exec rm {} \;
-find . -name "*.swp" -exec rm {} \;
-find . -name "*.*~" -exec rm {} \;
-find . -name "*~" -exec rm {} \;
-find . -name "*.d" -exec rm {} \;
-find . -name "*.a" -exec rm {} \;
-find . -name "tags" -exec rm {} \;
-find . -name ".*" -exec rm -rf 2> /dev/null \;
-find . -name "*.ko" -exec rm {} \;
-find . -name ".*.cmd" -exec rm {} \;
-find . -name "*.mod.c" -exec rm {} \;
-find . -name ".*.dwo" -exec rm {} \;
-find . -name "*dwo" -exec rm {} \;
-rm -rf .tmp_versions
ifneq ($(APPDIR),)
ifeq ($(CONFIG_STA_SUPPORT),y)
$(MAKE) -C mapp/mlanconfig $@
$(MAKE) -C mapp/mlanutl $@
$(MAKE) -C mapp/mlan2040coex $@
endif
ifeq ($(CONFIG_UAP_SUPPORT),y)
$(MAKE) -C mapp/uaputl $@
endif
ifeq ($(CONFIG_WIFI_DIRECT_SUPPORT),y)
$(MAKE) -C mapp/wifidirectutl $@
endif
$(MAKE) -C mapp/mlanevent $@
endif
# End of file

156
README Normal file
View file

@ -0,0 +1,156 @@
===============================================================================
U S E R M A N U A L
Copyright 2008-2026 NXP
1) FOR DRIVER BUILD
Goto source code directory wlan_src/.
make [clean] build
The driver and utility binaries can be found in ../bin_xxxx directory.
The driver code supports Linux kernel from 2.6.32 to 6.9.0.
2) FOR DRIVER INSTALL
a) Copy firmware image to /lib/firmware/nxp/, copy wifi_mod_para.conf to /lib/firmware/nxp/.
b) Install WLAN driver
There are drv_mode, max_sta_bss, max_uap_bss etc. module parameters.
The bit settings of drv_mode are,
Bit 0 : STA
Bit 1 : uAP
Bit 2 : WIFIDIRECT
Bit 4 : NAN
max_sta_bss: Maximum number of STA BSS (default 1, max 1)
sta_name: Name of the STA interface (default: "mlan")
max_uap_bss: Maximum number of uAP BSS (default 1, max 2)
uap_name: Name of the uAP interface (default: "uap")
max_wfd_bss: Maximum number of WIFIDIRECT BSS (default 1, max 1)
wfd_name: Name of the WIFIDIRECT interface (default: "wfd")
max_vir_bss: Number of Virtual interfaces (default 1)
nan_name: Name of the NAN interface (default: "nan")
max_nan_bss: Number of NAN interfaces (default 1)
uap_oper_ctrl: uAP operation control when in-STA disconnect with ext-AP
0: default do nothing, 2: uAP stops and restarts automatically
For example, to install multi-chip driver,
insmod mlan.ko
insmod moal.ko mod_para=nxp/wifi_mod_para.conf [drvdbg=0x7]
wifi_mod_para.conf is used to support multi-chips which has different load module parameters. It contains
the module parameters for different chips.
c) Uninstall WLAN driver,
ifconfig mlanX down
ifconfig uapX down
rmmod moal
rmmod mlan
To load driver with MFG firmware file, use mfg_mode=1 when insmod WLAN driver and
specify MFG firmware name if needed.
To load driver with rf_test firmware file, use rf_test_mode=1 when insmod WLAN driver.
This parameter only used for 9177(FC)
There are some other parameters for debugging purpose etc. Use modinfo to check details.
drvdbg=<bit mask of driver debug message control>
dev_cap_mask=<Bit mask of the device capability>
mac_addr=xx:xx:xx:xx:xx:xx <override the MAC address (in hex)>
auto_ds=0|1|2 <use MLAN default | enable auto deepsleep | disable auto deepsleep>
ext_scan=0|1|2 <use MLAN default | Enable Extended Scan| Enable Enhanced Extended Scan>
net_rx=0|1 <use netif_rx_ni in rx | use netif_receive_skb in rx>
amsdu_deaggr=0|1 <default | Try avoid buf copy in amsud deaggregation>
ps_mode=0|1|2 <use MLAN default | enable IEEE PS mode | disable IEEE PS mode>
tcpackenh=0|1 <disable TCP ACK enhancement | enable TCP ACK enhancement (default)>
sched_scan=0|1 <disable sched_scan | enable sched_scan default>
max_tx_buf=2048|4096|8192 <maximum AMSDU Tx buffer size>
cfg_11d=0|1|2 <use MLAN default | enable 11d | disable 11d>
dts_enable=0|1 <Disable DTS | Enable DTS (default)>
fw_name = <FW file name>
e.g. copy pcieuart9098_combo_v1.bin to firmware directory, fw_name=nxp/pcieuart9098_combo_v1.bin
hw_name = <hardware name>
reg_work=0|1 <Disable register work queue| Enable register work queue>
hw_test=0|1 <Disable hardware test (default) | Enable hardware test>
fw_serial=0|1 <support parallel download FW | support serial download FW (default)>
req_fw_nowait=0|1 <use request_firmware API (default) | use request_firmware_nowait API>
dfs53cfg=0|1|2 <use Fw Default | New W53 | Old W53>
mcs32=0|1 <disable HT MCS32 support | enable HT MCS32 (default)>
plinkstats=0|1|2 <Disable plinkstats (default) | Enable plinkstats | Restore plinkstats>
Example usage:
insmod moal.ko plinkstats=0 : Disable link statistics prints
insmod moal.ko plinkstats=1 : Enable link statistics prints
insmod moal.ko plinkstats=2 : Reset link statistics prints
insmod moal.ko plinkstats=1,0x7,5,0 : Enable Num TX Packets, Num RX Packets and Channel prints on dmesg.
insmod moal.ko plinkstats=1,0xf,5,1 : Enable Num TX Packets, Num RX Packets, Channel and Region prints on dmesg, and netlink event also enabled.
Note:
1. For more details about plinkstats parameters, refer plinkstats command details in README_MLAN file.
2. When changing drvdbg mask dynamically while running test, set MLSTATS bit(0x800) along with the change, if wifi logging feature is enabled.
init_cfg=<init config (MAC addresses, registers etc.) file name>
e.g. copy init_cfg.conf to firmware directory, init_cfg=nxp/init_cfg.conf
cal_data_cfg=<CAL data config file name>
e.g. copy cal_data.conf to firmware directory, cal_data_cfg=nxp/cal_data.conf
dpd_data_cfg=<DPD data config file name>
e.g. copy dpd_data.conf to firmware directory, dpd_data_cfg=nxp/dpd_data.conf
txpwrlimit_cfg=<Tx power limit config file name>
e.g. copy txpwrlimit_cfg_set.conf to firmware directory, txpwrlimit_cfg=nxp/txpwrlimit_cfg_set.conf
cntry_txpwr=0|1|2
0: Disable setting tx power table of country (default)
1: Enable setting tx power table of country
2: Enable setting rgpower table of country
init_hostcmd_cfg=<init hostcmd config file name>
e.g. copy init_hostcmd_cfg.conf to firmware directory, init_hostcmd_cfg=nxp/init_hostcmd_cfg.conf
band_steer_cfg=<band steer config file name>
e.g. generate bscfg.conf by band_steer_cfg.conf, then copy bscfg.conf to firmware directory, band_steer_cfg=nxp/bscfg.conf
cfg80211_wext=<bit mask of CFG80211 and WEXT control>
Bit 0: STA WEXT
Bit 1: uAP WEXT
Bit 2: STA CFG80211
Bit 3: uAP CFG80211
cfg80211_drcs=1|0 <Enable DRCS support (default) | Disable DRCS support>
reg_alpha2=<Regulatory alpha2 (default NULL)>
wq_sched_prio: Priority for work queue
wq_sched_policy: Scheduling policy for work queue
(0: SCHED_NORMAL, 1: SCHED_FIFO, 2: SCHED_RR, 3: SCHED_BATCH, 5: SCHED_IDLE)
Please note that, both wq_sched_prio and wq_sched_policy should be provided
as module parameters. If wq_sched_policy is (0, 3 or 5), then wq_sched_prio
must be 0. wq_sched_prio should be 1 to 99 otherwise.
rx_work=0|1|2 <default | Enable rx_work_queue | Disable rx_work_queue>
pcie_int_mode=0|1|2 <Legacy mode, MSI mode (default), MSI-X mode>
pcie_int_mode=0|1 <Legacy mode, MSI mode (default)>
ring_size=32|64|128|256|512 <adma ring size for 9097/9098>
low_power_mode_enable=0|1 <disable low power mode (default)| enable low power mode>
When low power mode is enabled, the output power will be clipped at ~+10dBm and the
expected PA current is expected to be in the 80-90 mA range for b/g/n modes
wakelock_timeout=<set wakelock_timeout value (ms)>
pmic=0|1 <No pmic configure cmd sent to firmware | Send pmic configure cmd to firmware>
indication_gpio=0xXY <GPIO to indicate wakeup source and its level; high four bits X:
level(0/1) for normal wakeup; low four bits Y: GPIO pin number. This parameter
only works with specific board and firmware.>
hs_wake_interval=<Host sleep wakeup interval,it will round to nearest multiple dtim*beacon_period in fw>
disconnect_on_suspend=0|1 <Disable disconnect wifi on suspend (default) | Enable disconnect wifi on suspend>
hs_mimo_switch=0|1 <Disable dynamic MIMO-SISO switch during host sleep (default) | Enable dynamic MIMO-SISO switch during host sleep>
hs_auto_arp=0|1 <disable hs_auto_arp (default) | enable hs_auto_arp>
gtk_rekey_offload=0|1|2 <disable gtk_rekey_offload|enable gtk_rekey_offload (default) | enable gtk_rekey_offload in suspend mode only>
napi=0|1 <disable napi | enable napi>
fixed_beacon_buffer=0|1 <allocate default buffer size (default) | allocate max buffer size>
GoAgeoutTime=0|x <use default ageout time (default) | set Go age out time xTU(TU 100ms)>
multi_dtim=0|x <use default DTIM interval(default) | set x*beacon_period as DTIM interval>
inact_tmo=0|x <use default IEEE ps inactivity timout value (default) | use IEEE ps inactivity timeout value x ms>
drcs_chantime_mode=0|x <channel time and mode for DRCS, use default value (default) | use setting value>
Bit31~Bit24:Channel time for channel index0;
Bit23~Bit16:mode for channel index0; 0|1 <PM1 | Null2Self>
Bit15~Bit8:Channel time for channel index1;
Bit7~Bit0:mode for channel index1; 0|1 <PM1 | Null2Self>
roamoffload_in_hs=0|1 <always enable fw roaming (default) | enable fw roaming only when host suspend>
uap_max_sta: Maximum number of STA for UAP/GO (default 0, max 10)
host_mlme=0|1 <Operate in non-host_mlme mode | Operate in host_mlme mode (default)>
for supplicant/authenticator running on host side, WPA3 support is available only in host_mlme mode
for chipset 89xx FP-92, 90xx and later, host_mlme restricted to 1
country_ie_ignore=0|1 <Follow countryIE from AP and beacon hint enable (default) | Ignore countryIE from AP and beacon hint disable>
beacon_hints=0|1 <enable beacon hints(default) | disable beacon hints>
chan_track=0|1 <restore channel tracking parameters(default) | set channel tracking new parameters> for 9098 only
keep_previous_scan=0|1, <Flush previous scan result before start scan | Keep previous scan result(default)>
auto_11ax=0|1, <disable auto_11ax | enable auto_11ax(default)>
ifdef PROBE_REQ_RAND_SN
probe_req_rand_sn=0|1, <disable random SN in probe req(default) | enable random SN in probe req>

5325
README_MLAN Normal file

File diff suppressed because it is too large Load diff

112
README_RBC Normal file
View file

@ -0,0 +1,112 @@
===============================================================================
U S E R M A N U A L for Robust BT-WLAN coex (RBC)
Copyright 2014-2020 NXP
===============================================================================
###############################
# Abbreviations and acronyms
###############################
RBC - Robust BT-WLAN co-existence
TMD - Time Distribute
SMPS - Spatial Multiplexing Power Save
###############################
# Default RBC modes:
###############################
1. For systems where BT and WLAN have seperate antennas, RBC mode is
automatically disabled in FW after detecting this from FEM cal data. e.g.
For 1x1 Dual-Ant system and 2x2 3-Ant system RBC mode is disabled.
2. For systems where BT and WLAN share an antenna, RBC mode is automatically
enabled in FW after detecting this from FEM cal data.
Default modes:
1x1 single antenna system: TMD RBC
2x2 2-antenna system: 1x1 SMPS RBC
#################################
# 2x2 2-antenna system RBC modes
#################################
There are three mutually exclusive RBC modes for a 2x2 system.
The default RBC mode is 1x1 SMPS RBC. The required RBC mode must be
configured before starting uAP or associating in-STA. The mode cannot be
changed dynamically when any of these connections is active. The modes are
described below:
1. 1x1 SMPS RBC mode: WLAN switches to 1x1 FEM when BT is turned on. Also,
in-STA goes to SMPS mode w.r.t. ext-AP. When BT is turned off, WLAN
switches back to 2x2 FEM setting and in-STA moves out of SMPS.
uAP starts bss with only 1-stream even BT is off because it cannot
dynamically move between 1-stream and 2-stream rates like in-STA. To start
uAP with 2-stream, RBC mode has to be disabled.
2. 1x2 SMPS RBC mode: Similar as 1x1 SMPS RBC mode. WLAN switches to 1x2 FEM
when BT is turned on. In this mode, it is expected that when BT is not
actively transmitting, WLAN can receive on both the antennas to enhance
the range. Note that 1-stream rates are used for receive and transmit.
3. 2x2 TMD RBC mode: WLAN uses 2x2 antenna setting and timeshares the antenna
with BT.
###############################
# RBC mode select:
###############################
User can use robust_btc.conf and hostcmd to select different RBC mode:
hostcmd mode_get
hostcmd mode_timeshare
hostcmd mode_spatial
This command is used to get/set Robust BT Coex.
mode_get: get the current mode
mode_timeshare: set Robust BT Coex to timeshare mode (default on 1x1 chips)
mode_spatial: set Robust BT Coex to spatial mode (only for, and default on 2x2 chips)
Usage:
mlanconfig mlanX hostcmd config/robust_btc.conf mode_get
mlanconfig mlanX hostcmd config/robust_btc.conf mode_timeshare
mlanconfig mlanX hostcmd config/robust_btc.conf mode_spatial
hostcmd gpio_cfg
This command is used to enable/disable GPIO cfg.
gpio_cfg: enable/disable GPIO cfg for external bt request (default is enable with High Polarity)
Usage:
mlanconfig mlanX hostcmd config/robust_btc.conf gpio_cfg
hostcmd generictime
hostcmd a2dptime
hostcmd inquirytime
hostcmd ap_generictime
hostcmd ap_a2dptime
hostcmd ap_inquirytime
This command is used to configure the time slice of COEX (only works in timeshare mode)
generictime: configure the Bttime and Wlantime in Station Generic case
a2dptime: configure the Bttime and Wlantime in Station A2DP case
inquirytime: configure the Bttime and Wlantime in Station Inquiry case
ap_generictime: configure the Bttime and Wlantime in Ap Generic case
ap_a2dptime: configure the Bttime and Wlantime in Ap A2DP case
ap_inquirytime: configure the Bttime and Wlantime in Ap Inquiry case
Usage:
mlanutl mlanX hostcmd config/robust_btc.conf generictime
mlanutl mlanX hostcmd config/robust_btc.conf a2dptime
mlanutl mlanX hostcmd config/robust_btc.conf inquirytim
mlanutl mlanX hostcmd config/robust_btc.conf ap_generictime
mlanutl mlanX hostcmd config/robust_btc.conf ap_a2dptime
mlanutl mlanX hostcmd config/robust_btc.conf ap_inquirytime
hostcmd external_coex_uart_gpio_config
This command is used to configure the UART+GPIO external coex mode with following parameters
Enabled: configure the feature and ouutput on GPIO 0x00 disable, 0x07 enable
ExtCoexHwIntWci2: Enable UART for coex interface 0x00 disable, 0x01 enable
Usase:
mlanutl mlanX hostcmd config/robust_btc.conf external_coex_uart_gpio_config

2994
README_UAP Normal file

File diff suppressed because it is too large Load diff

448
README_WIFIDIRECT Normal file
View file

@ -0,0 +1,448 @@
===============================================================================
S E T U P I N S T R U C T I O N S F O R *WifiDirect*
Driver,FW release:
1. Make sure, bg_scan.conf,uaputl.conf has SSID starting with "DIRECT-"
2. Download uAP configuration and BG scan configuration.
3. This version of wifidirectutl breaks the backward compatibility and will work
with following releases -
8797 >= 14.xx.16.p15
>= 14.xx.11.p138
8766 >= 14.xx.11.p138
8787 >= 14.xx.9.p89
However, In case one needs to run the utility in backward compatibility mode
he can do so by running following command before running the utility -
# export WIFIDIR_USE_FIXED_IE_INDICES=1
To disable backward comaptibility mode run following command -
# export WIFIDIR_USE_FIXED_IE_INDICES=0
WPSWIFIDIRECT release:
1. Modify the wifidirect.conf file to specify the correct HW addresses of
devices. The DUT mac address and peer mac address needs to be correctly
entered.
===============================================================================
U S E R M A N U A L F O R WIFIDIRECTUTL
NAME
wifidirectutl
This tool can be used to configure WifiDirect parameters.
------------------
Supported Commands
------------------
wifidirect_mode [MODE]
wifidirect_config [*.conf]
wifidirect_params_config [*.conf]
wifidirect_action_frame <*.conf> | [<PeerAddr> <Category> <OuiSubtype> <DialogToken>]
wifidirect_discovery_request <*.conf>
wifidirect_discovery_response <*.conf>
wifidirect_cfg_discovery_period [<MinDiscPeriod> <MaxDiscPeriod>]
wifidirect_cfg_intent [IntentValue]
wifidirect_cfg_capability [<DeviceCapability> <GroupCapability>]
wifidirect_cfg_noa <enable|disable> <index> [<counttype> <duration> <interval>]
wifidirect_cfg_opp_ps <enable|disable> [<CTWindow>]
wifidirect_cfg_invitation_list [mac_addr]
wifidirect_cfg_listen_channel [ListenChannel]
wifidirect_cfg_op_channel [OperatingChannel]
wifidirect_cfg_persistent_group_record [index] [role]
[<groupbss> <deviceId> <ssid> <psk>] [peermac1] [peermac2]
wifidirect_cfg_persistent_group_invoke [index] | <cancel>
wifidirect_cfg_presence_req_params [<type> <duration> <interval>]
wifidirect_cfg_ext_listen_time [<duration> <interval>]
wifidirect_cfg_provisioning_params [<action> <configMethods> <devicePassword>]
wifidirect_cfg_wps_params [<action>]
wifidirect_mode [mode]
----------
"./wifidirectutl <iface> wifidirect_mode [mode]"
This command is used to setup various modes for wifidirect device.
The mode 2 can be used only when wifidirect is started using mode 1.
The mode 3 should not be used for uAP.
The supported options are:
mode : 0 - stop wifidirect mode
1 - start wifidirect mode
2 - start wifidirect group owner mode
3 - start wifidirect client mode
4 - start wifidirect find phase
5 - stop wifidirect find phase
empty - Get current wifidirect mode
Example:
./wifidirectutl <iface> wifidirect_mode 0
Stop wifidirect mode.
./wifidirectutl <iface> wifidirect_mode 1
Start wifidirect mode.
./wifidirectutl <iface> wifidirect_mode
Get current WIFIDIRECT start/stop mode.
wifidirect_config
----------
"./wifidirectutl <iface> wifidirect_config [*.conf]"
This command is used to set/get the wifidirect configuration.
Example:
./wifidirectutl <iface> wifidirect_config wifidirect.conf
Read configuration from wifidirect.conf and apply it.
./wifidirectutl <iface> wifidirect_config
Read existing wifidirect configuration and display it.
wifidirect_params_config
----------
"./wifidirectutl <iface> wifidirect_params_config [*.conf]"
This command is used to set/get the wifidirect parameters configuration.
Example:
./wifidirectutl <iface> wifidirect_params_config wifidirect.conf
Read parameter configuration from wifidirect.conf and apply it.
./wifidirectutl <iface> wifidirect_params_config
Read existing wifidirect parameters's configuration and display it.
wifidirect_action_frame
----------
"./wifidirectutl <iface> wifidirect_action_frame <*.conf> | <PeerAddr> <Category> <OUISubtype> <DialogToken>"
This command is used to send action frames as specified in config file or on command line.
Example:
./wifidirectutl <iface> wifidirect_action_frame wifidirect.conf
Read action_frame from wifidirect.conf and send to peer.
./wifidirectutl <iface> wifidirect_action_frame <PeerAddr> <Category> <OUISubtype> <DialogToken>
Read action frame parameters from command line and send to peer.
wifidirect_discovery_request
----------
"./wifidirectutl <iface> wifidirect_discovery_request <*.conf>"
This command is used to send wifidirect discovery request packet.
Example:
./wifidirectutl <iface> wifidirect_discovery_request wifidirect.conf
Read discovery packet from wifidirect.conf and send to peer.
wifidirect_discovery_response
----------
"./wifidirectutl <iface> wifidirect_discovery_response <*.conf>"
This command is used to send wifidirect discovery response packet.
Example:
./wifidirectutl <iface> wifidirect_discovery_response wifidirect.conf
Read discovery packet from wifidirect.conf and send to peer.
wifidirect_cfg_discovery_period
----------
"./wifidirectutl <iface> wifidirect_cfg_discovery_period [<MinDiscPeriod> <MaxDiscPeriod>]"
This command is used to set or get minimum and maximum discovery period.
Example:
./wifidirectutl <iface> wifidirect_cfg_discovery_period 10 20
Set minimum discovery interval to 10 and maximum discovery
interval to 20.
./wifidirectutl <iface> wifidirect_cfg_discovery_period
Get minimum and maximum discovery interval.
wifidirect_cfg_intent
----------
"./wifidirectutl <iface> wifidirect_cfg_intent [IntentValue]"
This command is used to set or get intent value.
Example:
./wifidirectutl <iface> wifidirect_cfg_intent 12
Set intent value to 12.
./wifidirectutl <iface> wifidirect_cfg_intent
Get Group Owner Intent.
wifidirect_cfg_capability
----------
"./wifidirectutl <iface> wifidirect_cfg_capability [<DeviceCapability> <GroupCapability>]"
This command is used to set or get device capability and group capability.
Example:
./wifidirectutl <iface> wifidirect_cfg_capability 10 20
Set Device capability to 10 and group capability to 20
./wifidirectutl <iface> wifidirect_cfg_capability
Get Device capability and group capability.
wifidirect_cfg_noa
----------
"./wifidirectutl <iface> wifidirect_cfg_noa <enable|disable> <index> [<counttype> <duration> <interval>]"
This command is used to set or get NoA parameters like count_type, duration and
interval in ms when NoA is enabled. Valid value of index is [0, 1].
Example:
./wifidirectutl <iface> wifidirect_cfg_noa enable 0 10 50 100
Enable NoA and set count to 10, duration to 50ms and interval to 100 ms
for index 0.
./wifidirectutl <iface> wifidirect_cfg_noa disable 1
Disable NoA at index 1.
./wifidirectutl <iface> wifidirect_cfg_noa
Get NoA settings.
wifidirect_cfg_opp_ps
----------
"./wifidirectutl <iface> wifidirect_cfg_opp_ps <enable|disable> [<CTWindow>]"
This command is used to set or get Opportunistic power save and CT window.
Example:
./wifidirectutl <iface> wifidirect_cfg_opp_ps enable 50
Set OppPS and CTwindow value to 50.
./wifidirectutl <iface> wifidirect_cfg_opp_ps disable
Disable OppPS.
./wifidirectutl <iface> wifidirect_cfg_opp_ps
Get OppPS and CT window.
wifidirect_cfg_invitation_list
----------
"./wifidirectutl <iface> wifidirect_cfg_invitation_list [mac_addr]"
This command is used to set or get invitation list of peers.
Example:
./wifidirectutl <iface> wifidirect_cfg_invitation_list 00:50:43:20:23:34
Set 00:50:43:20:23:34 in invitation list of peers.
./wifidirectutl <iface> wifidirect_cfg_invitation_list
Get Invitation list of peers.
wifidirect_cfg_listen_channel
----------
"./wifidirectutl <iface> wifidirect_cfg_listen_channel [ListenChannel]"
This command is used to set or get Listen channel.
Example:
./wifidirectutl <iface> wifidirect_cfg_listen_channel 11
Set Listen channel to 11.
./wifidirectutl <iface> wifidirect_cfg_listen_channel
Get Listen channel.
wifidirect_cfg_op_channel
----------
"./wifidirectutl <iface> wifidirect_cfg_op_channel [OperatingChannel]"
This command is used to set or get Operating channel.
Example:
./wifidirectutl <iface> wifidirect_cfg_op_channel 11
Set Operating channel to 11.
./wifidirectutl <iface> wifidirect_cfg_op_channel
Get Operating channel.
wifidirect_cfg_persistent_group_record
----------
"./wifidirectutl <iface> [index] [role]
[<groupbss> <deviceId> <ssid> <psk>] [peermac1] [peermac2]"
This command is used to set or get the persistent group record
maintained in the device. Valid index is from 0 to 3. The role should be
0 for client, 1 for group-owner.
Example:
./wifidirectutl <iface> wifidirect_cfg_persistent_group_record 0 1
00:50:43:12:24:36 00:50:43:13:26:39 "DIRECT-" "1234567890"
00:50:43:20:c2:d0
Set persistent group record with index 0, role as group owner, bssId and
device Id, ssid="DIRECT-", passphrase="1234567890", and peer mac address.
The passphrase get converted to PSK.
./wifidirectutl <iface> wifidirect_cfg_persistent_group_record 1 1
00:50:43:12:24:36 00:50:43:13:26:39 "DIRECT-" "1234567890"
0x1234567890123456789012345678901234567890123456789012345678901234
Set persistent group record with index 1, role as group owner, bssId and
device Id, ssid="DIRECT-", passphrase="1234567890", and peer mac address.
The passphrase get converted to PSK.
PSK is specified with "0x" prefix and 32 bytes (64 characters).
./wifidirectutl <iface> wifidirect_cfg_persistent_group_record 1
Get persistent group record with index 1.
./wifidirectutl <iface> wifidirect_cfg_persistent_group_record
Get persistent group record for all indices.
wifidirect_cfg_persistent_group_invoke
----------
"./wifidirectutl <iface> wifidirect_cfg_persistent_group_invoke [index] | <cancel>"
This command is used to invoke a particular persistent group record
from the list. Valid index is from 0 to 3.
./wifidirectutl <iface> wifidirect_cfg_persistent_group_invoke 2
Invoke persistent group record with index 1.
./wifidirectutl <iface> wifidirect_cfg_persistent_group_invoke cancel
Cancel invokation of persistent groups.
wifidirect_cfg_presence_req_params
----------
"./wifidirectutl <iface> wifidirect_cfg_presence_req_params [<type> <duration> <interval>]"
This command is used to set/get presence request parameters. Type should
be 1 for preferred values and 2 for acceptable values.
./wifidirectutl <iface> wifidirect_cfg_presence_req_params 1 50 100
Set duration to 50ms and interval to 100ms.
./wifidirectutl <iface> wifidirect_cfg_presence_req_params
Get presence request parameters.
wifidirect_cfg_ext_listen_time
----------
"./wifidirectutl <iface> wifidirect_cfg_ext_listen_time [<duration> <interval>]"
This command is used to set/get extended listen timing parameters.
./wifidirectutl <iface> wifidirect_cfg_ext_listen_time 1200 1300
Set availability period to 1200ms and availability interval to 1300 ms.
./wifidirectutl <iface> wifidirect_cfg_ext_listen_time
Get extended listen timing parameters.
wifidirect_cfg_provisioning_params
----------
"./wifidirectutl <iface> wifidirect_cfg_provisioning_params [<action> <configMethod> <devicePassword>]"
This command is used to set/get provisioning protocol parameters. Action should
be 1 for request parameters and 2 for response parameters.
./wifidirectutl <iface> wifidirect_cfg_provisioning_params 1 0x80 0x04
Set config method to 0x86 and device password to 0x04.
./wifidirectutl <iface> wifidirect_cfg_provisioning_params
Get Provision protocol parameters.
wifidirect_cfg_wps_params
----------
"./wifidirectutl <iface> wifidirect_cfg_wps_params [<action>]"
This command is used to set WPS action. action can be "pin" (pin entered),
"pbc"(button pressed) or "none".
Example:
./wifidirectutl <iface> wifidirect_cfg_wps_params pin
Indicates pin operation
./wifidirectutl <iface> wifidirect_cfg_wps_params none
Indicates no operation
===============================================================================
U S E R M A N U A L F O R WIFIDISPLAY
wifidisplay_mode
-----------
"./wifidirectutl <iface> wifidisplay_mode [<action>]"
This command is used to enable or disable wifi-display. The possible values are either 1 or 0.
Example:
./wifidirectutl <iface> wifidisplay_mode 1
Indicates enable wifi_display
./wifidirectutl <iface> wifidisplay_mode 0
Indicates disable wifi_display
wifidisplay_config
-----------
"./wifidirectutl <iface> wifidisplay_config [*.conf]"
This command is used to set/get the wifidisplay configuration.
Example:
./wifidirectutl <iface> wifidisplay_config wifidisplay.conf
Read configuration from wifidisplay.conf and apply it.
./wifidirectutl <iface> wifidisplay_config
Read existing wifidisplay configuration and display it.
wifidisplay_update_devinfo
----------
"./wifidirectutl <iface> wifidisplay_update_devinfo [value]"
This command is used to set the device information of wifidisplay device information subelement.
This command will overwrite the new device information with user defined value.
Example:
./wifidirectutl <iface> wifidisplay_update_devinfo 10
Update device information programmed with new value 10 by overwritting existing value.
wifidisplay_discovery_request
----------
"./wifidirectutl <iface> wifidisplay_discovery_request [*.config]"
This command is used to send wifi display service discovery request.
Example:
./wifidirectutl <iface> wifidisplay_discovery_request wifidisplay.conf
Read discovery packet from wifidisplay.conf and send to peer.
wifidisplay_discovery_response
----------
"./wifidirectutl <iface> wifidisplay_discovery_response <*.conf>"
This command is used to send wifidisplay discovery response packet.
Example:
./wifidirectutl <iface> wifidisplay_discovery_response wifidisplay.conf
Read discovery packet from wifidisplay.conf and send to peer.
===============================================================================
U S E R M A N U A L F O R MLANEVENT
NAME
mlanevent.exe
This tool can be used to listen for and obtain events from the driver
through the netlink layer. This is only used for display/debugging purpose.
----------------
Supported events
----------------
WIFIDIRECT_GENERIC_EVENT
WIFIDIRECT_SERVICE_DISCOVERY
-----------------
Details of events
-----------------
WIFIDIRECT_GENERIC_EVENT
-----------------
For this event, the following information is shown:
+ Event length.
+ Event Type indicating Negociation, Invitation, Discoverability,
Provision discovery related Request or Response.
+ Event SubType indicating Client or Group owner role.
+ Peer MAC address.
+ Associated WIFIDIRECT IE elements.
WIFIDIRECT_SERVICE_DISCOVERY
---------------------
For this event, the following information is shown:
+ Peer MAC address.
+ Service discovery packet details.

View file

@ -0,0 +1,59 @@
{
"SPDXID": "SPDXRef-DOCUMENT",
"spdxVersion": "SPDX-2.3",
"creationInfo": {
"created": "2026-07-02T08:31:46Z",
"creators": [
"Organization: NXP"
],
"licenseListVersion": "3.28"
},
"name": "WSW driver-mxmdriver-linux-mxm405.p70_MGPL",
"dataLicense": "CC0-1.0",
"documentNamespace": "https://nxp.com/spdx/594e564e-de81-4868-8bf3-208f4c7a914d",
"packages": [
{
"SPDXID": "SPDXRef-package-594e564e-de81-4868-8bf3-208f4c7a914d",
"name": "WSW driver",
"versionInfo": "mxmdriver-linux-mxm405.p70_MGPL",
"licenseConcluded": "(GPL-2.0-only)",
"licenseDeclared": "(GPL-2.0-only)",
"downloadLocation": "NOASSERTION",
"originator": "Organization: NXP",
"supplier": "NOASSERTION",
"externalRefs": [],
"filesAnalyzed": false
},
{
"SPDXID": "SPDXRef-package-594e564e-de81-4868-8bf3-208f4c7a914d---cad73bd9-d9d2-4715-adfb-fa1e1265ad20",
"name": "hostapd",
"versionInfo": "2.10",
"licenseConcluded": "BSD-3-Clause",
"licenseDeclared": "BSD-3-Clause",
"homepage": "http://w1.fi/hostapd/",
"downloadLocation": "https://w1.fi/hostapd/",
"originator": "Person: Jouni Malinen and others",
"supplier": "NOASSERTION",
"externalRefs": [
{
"referenceCategory": "SECURITY",
"referenceLocator": "cpe:2.3:a:opensuse_package:hostapd:2.10:*:*:*:*:*:*:*",
"referenceType": "cpe23Type"
}
],
"filesAnalyzed": false
}
],
"relationships": [
{
"spdxElementId": "SPDXRef-DOCUMENT",
"relationshipType": "DESCRIBES",
"relatedSpdxElement": "SPDXRef-package-594e564e-de81-4868-8bf3-208f4c7a914d"
},
{
"spdxElementId": "SPDXRef-package-594e564e-de81-4868-8bf3-208f4c7a914d",
"relationshipType": "DYNAMIC_LINK",
"relatedSpdxElement": "SPDXRef-package-594e564e-de81-4868-8bf3-208f4c7a914d---cad73bd9-d9d2-4715-adfb-fa1e1265ad20"
}
]
}

339
gpl-2.0.txt Normal file
View file

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View file

@ -0,0 +1,56 @@
#
# File : mlan2040coex/Makefile
#
# Copyright 2009-2022,2025 NXP
# Path to the top directory of the mlandriver distribution
PATH_TO_TOP = ../..
ifeq ($(findstring IMX_ANDROID,$(ccflags-y)),IMX_ANDROID)
CC=/usr/local/arm/android-ndk-r23-beta5/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang
endif
# 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 += -Wno-error
# Enable or disable debug outputs
CFLAGS += -DDEBUG=0
#
# List of application executables to create
#
libobjs:= mlan2040coex.o mlan2040misc.o
exectarget=mlan2040coex
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 appsbuild install: $(TARGETS)
@cp -f $(exectarget) $(INSTALLPATH)
clean:
@rm -f $(exectarget)
@rm -f *.o
distclean: clean
@rm -f *~ core
@rm -f tags

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,232 @@
/** @file mlan2040coex.h
*
* @brief This file contains definitions for application
*
*
* Copyright 2009-2021,2025 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:
06/24/2009: initial version
************************************************************************/
#ifndef _COEX_H_
#define _COEX_H_
#include <endian.h>
/** NXP private command identifier */
#define CMD_NXP "MRVL_CMD"
/** IOCTL number */
#define MLAN_ETH_PRIV (SIOCDEVPRIVATE + 14)
#if (BYTE_ORDER == LITTLE_ENDIAN)
#undef BIG_ENDIAN_SUPPORT
#endif
/** 16 bits byte swap */
#define swap_byte_16(x) \
((t_u16)((((t_u16)(x)&0x00ffU) << 8) | (((t_u16)(x)&0xff00U) >> 8)))
/** 32 bits byte swap */
#define swap_byte_32(x) \
((t_u32)((((t_u32)(x)&0x000000ffUL) << 24) | \
(((t_u32)(x)&0x0000ff00UL) << 8) | \
(((t_u32)(x)&0x00ff0000UL) >> 8) | \
(((t_u32)(x)&0xff000000UL) >> 24)))
/** 64 bits byte swap */
#define swap_byte_64(x) \
((t_u64)((t_u64)(((t_u64)(x)&0x00000000000000ffULL) << 56) | \
(t_u64)(((t_u64)(x)&0x000000000000ff00ULL) << 40) | \
(t_u64)(((t_u64)(x)&0x0000000000ff0000ULL) << 24) | \
(t_u64)(((t_u64)(x)&0x00000000ff000000ULL) << 8) | \
(t_u64)(((t_u64)(x)&0x000000ff00000000ULL) >> 8) | \
(t_u64)(((t_u64)(x)&0x0000ff0000000000ULL) >> 24) | \
(t_u64)(((t_u64)(x)&0x00ff000000000000ULL) >> 40) | \
(t_u64)(((t_u64)(x)&0xff00000000000000ULL) >> 56)))
/** Convert to correct endian format */
#ifdef BIG_ENDIAN_SUPPORT
/** CPU to little-endian convert for 16-bit */
#define cpu_to_le16(x) swap_byte_16(x)
/** CPU to little-endian convert for 32-bit */
#define cpu_to_le32(x) swap_byte_32(x)
/** CPU to little-endian convert for 64-bit */
#define cpu_to_le64(x) swap_byte_64(x)
/** Little-endian to CPU convert for 16-bit */
#define le16_to_cpu(x) swap_byte_16(x)
/** Little-endian to CPU convert for 32-bit */
#define le32_to_cpu(x) swap_byte_32(x)
/** Little-endian to CPU convert for 64-bit */
#define le64_to_cpu(x) swap_byte_64(x)
#else
/** Do nothing */
#define cpu_to_le16(x) (x)
/** Do nothing */
#define cpu_to_le32(x) (x)
/** Do nothing */
#define cpu_to_le64(x) (x)
/** Do nothing */
#define le16_to_cpu(x) (x)
/** Do nothing */
#define le32_to_cpu(x) (x)
/** Do nothing */
#define le64_to_cpu(x) (x)
#endif
#ifdef __GNUC__
/** Structure packing begins */
#define PACK_START
/** Structure packeing end */
#define PACK_END __attribute__((packed))
#else
/** Structure packing begins */
#define PACK_START __packed
/** Structure packeing end */
#define PACK_END
#endif
/** Character, 1 byte */
typedef signed char t_s8;
/** Unsigned character, 1 byte */
typedef unsigned char t_u8;
/** Short integer */
typedef signed short t_s16;
/** Unsigned short integer */
typedef unsigned short t_u16;
/** Integer */
typedef signed int t_s32;
/** Unsigned integer */
typedef unsigned int t_u32;
/** Long long integer */
typedef signed long long t_s64;
/** Unsigned long long integer */
typedef unsigned long long t_u64;
/** Void pointer (4-bytes) */
typedef void t_void;
#ifdef FALSE
#undef FALSE
#endif
#ifdef TRUE
#undef TRUE
#endif
#ifndef MIN
/** Find minimum value */
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif /* MIN */
/** Type definition: boolean */
typedef enum { FALSE, TRUE } boolean;
/** Find number of elements */
#define NELEMENTS(x) (sizeof(x) / sizeof(x[0]))
/** Success */
#define MLAN_STATUS_SUCCESS (0)
/** Failure */
#define MLAN_STATUS_FAILURE (-1)
/** Enumeration for host-command index */
enum COMMANDS {
CMD_2040COEX = 1,
};
/** Maximum number of channels that can be sent in a setuserscan ioctl */
#define WLAN_IOCTL_USER_SCAN_CHAN_MAX 50
#ifndef ETH_ALEN
/** MAC address length */
#define ETH_ALEN 6
#endif
/** Netlink protocol number */
#define NETLINK_NXP (MAX_LINKS - 1)
/** Netlink maximum payload size */
#define NL_MAX_PAYLOAD 1024
/** Netlink multicast group number */
#define NL_MULTICAST_GROUP RTMGRP_LINK
/** 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
/** Event header */
typedef PACK_START struct _event_header {
/** Event ID */
t_u32 event_id;
/** Event data */
t_u8 event_data[];
} PACK_END event_header;
/** Event ID length */
#define EVENT_ID_LEN 4
/** Custom events definitions */
/** AP connected event */
#define CUS_EVT_AP_CONNECTED "EVENT=AP_CONNECTED"
/** Custom event : BW changed */
#define CUS_EVT_BW_CHANGED "EVENT=BW_CHANGED"
/** Custom event : OBSS scan parameter */
#define CUS_EVT_OBSS_SCAN_PARAM "EVENT=OBSS_SCAN_PARAM"
/** Custom events definitions end */
/** Structure defination of chan_intol_t*/
typedef struct _chan_intol_t {
/** Channel numer */
t_u8 chan_num;
/** Flag: Is any 40MHz intolerant AP found in this channel */
t_u8 is_intol_set;
} chan_intol_t;
/** Private command structure */
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
struct eth_priv_cmd {
/** Command buffer pointer */
t_u64 buf;
/** buffer updated by driver */
int used_len;
/** buffer sent by application */
int total_len;
} __ATTRIB_PACK__;
#else
struct eth_priv_cmd {
/** Command buffer */
t_u8 *buf;
/** Used length */
int used_len;
/** Total length */
int total_len;
};
#endif
int get_region_code(int *reg_code);
int process_host_cmd(int cmd, t_u8 *chan_list, t_u8 chan_num, t_u8 reg_class,
t_u8 is_intol_ap_present);
int is_intolerant_sta(int *intol);
#endif /* _COEX_H_ */

View file

@ -0,0 +1,281 @@
/** @file mlan2040misc.c
*
* @brief This file contains helper functions for coex application
*
*
* Copyright 2009-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* 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:
06/24/2009: initial version
************************************************************************/
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include "mlan2040coex.h"
#include "mlan2040misc.h"
/********************************************************
Local Variables
********************************************************/
/** Regulatory class and Channel mapping for various regions */
static class_chan_t us_class_chan_t[] = {{32, {1, 2, 3, 4, 5, 6, 7}, 7},
{33, {5, 6, 7, 8, 9, 10, 11}, 7}};
static class_chan_t europe_class_chan_t[] = {
{11, {1, 2, 3, 4, 5, 6, 7, 8, 9}, 9},
{12, {5, 6, 7, 8, 9, 10, 11, 12, 13}, 9}};
static class_chan_t japan_class_chan_t[] = {
{56, {1, 2, 3, 4, 5, 6, 7, 8, 9}, 9},
{57, {5, 6, 7, 8, 9, 10, 11, 12, 13}, 9},
{58, {14}, 1}};
/** Region-code(Regulatory domain) and Class-channel table mapping */
static region_class_chan_t region_class_chan_table[] = {
{0x10, us_class_chan_t,
sizeof(us_class_chan_t) / sizeof(class_chan_t)} /* US */
,
{0x20, us_class_chan_t,
sizeof(us_class_chan_t) / sizeof(class_chan_t)} /* CANADA */
,
{0x30, europe_class_chan_t,
sizeof(europe_class_chan_t) / sizeof(class_chan_t)} /* EUROPE */
,
{0x32, europe_class_chan_t,
sizeof(europe_class_chan_t) / sizeof(class_chan_t)} /* FRANCE */
,
{0x40, japan_class_chan_t,
sizeof(japan_class_chan_t) / sizeof(class_chan_t)} /* JAPAN */
,
{0x41, japan_class_chan_t,
sizeof(japan_class_chan_t) / sizeof(class_chan_t)} /* JAPAN */
,
{0x50, europe_class_chan_t,
sizeof(europe_class_chan_t) / sizeof(class_chan_t)} /* CHINA */
};
/********************************************************
Global Variables
********************************************************/
extern t_u8 num_leg_ap_chan;
extern chan_intol_t leg_ap_chan_list[WLAN_IOCTL_USER_SCAN_CHAN_MAX];
/********************************************************
Local Functions
********************************************************/
/**
* @brief This function prepares the channel list for a particular
* regulatory class from channel number for legacy AP
* @param cur_class_chan_table A pointer to the class_chan_t
* @param num_entry Number of entry in cur_class_chan_table table
* @param chan_list A pointer to the output channel list
* @param chan_num total number of channel in output channel
* list
* @param reg_domain regulatory domain
* @param reg_class regulatory class
* @param is_intol_ap_present It sets TRUE when 40MHz intolerant AP is found
* otherwise FALSE
* @return None
*/
static void
get_channels_for_specified_reg_class(class_chan_t *cur_class_chan_table,
int num_entry, t_u8 *chan_list,
t_u8 *chan_num, t_u8 reg_domain,
t_u8 reg_class, t_u8 *is_intol_ap_present)
{
int i, j, k, idx = 0;
*is_intol_ap_present = FALSE;
/* For each regulatory class */
for (i = 0; i < num_entry; i++) {
if (cur_class_chan_table[i].reg_class == reg_class) {
/* For each channel of the regulatory class */
for (j = 0; j < cur_class_chan_table[i].total_chan;
j++) {
for (k = 0; k < num_leg_ap_chan; k++) {
if (cur_class_chan_table[i].channels[j] ==
leg_ap_chan_list[k].chan_num) {
*(chan_list + idx) =
leg_ap_chan_list[k]
.chan_num;
idx++;
if (leg_ap_chan_list[k]
.is_intol_set)
*is_intol_ap_present =
TRUE;
}
}
}
break;
}
}
/* update the total number of channel */
*chan_num = idx--;
return;
}
/********************************************************
Global Functions
********************************************************/
/**
* @brief Prepare 2040 coex command buffer
* @param buf A pointer to the command buffer
* @param chan_list Channel list
* @param num_of_chan Number of channel present in channel list
* @param reg_class Regulatory class
* @param is_intol_ap_present Flag: is any 40 MHz intolerant AP
* is present in these chaanel set
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
void prepare_coex_cmd_buff(t_u8 *buf, t_u8 *chan_list, t_u8 num_of_chan,
t_u8 reg_class, t_u8 is_intol_ap_present)
{
HostCmd_DS_GEN *hostcmd;
MrvlIETypes_2040COEX_t *coex_ie = NULL;
MrvlIETypes_2040BssIntolerantChannelReport_t *bss_intol_ie = NULL;
t_u8 *pos = NULL;
int intol;
hostcmd = (HostCmd_DS_GEN *)(buf + sizeof(t_u32));
hostcmd->command = cpu_to_le16(HostCmd_CMD_11N_2040COEX);
hostcmd->size = S_DS_GEN;
pos = buf + sizeof(t_u32) + S_DS_GEN;
{
coex_ie = (MrvlIETypes_2040COEX_t *)pos;
coex_ie->header.element_id = TLV_ID_2040COEX;
coex_ie->header.len = sizeof(coex_ie->coex_elem);
/* Check STA is 40 MHz intolerant or not */
is_intolerant_sta(&intol);
if (intol)
coex_ie->coex_elem |= MBIT(1);
if (is_intol_ap_present)
coex_ie->coex_elem |= MBIT(2);
pos += sizeof(MrvlIETypes_2040COEX_t);
hostcmd->size += sizeof(MrvlIETypes_2040COEX_t);
}
{
bss_intol_ie =
(MrvlIETypes_2040BssIntolerantChannelReport_t *)pos;
bss_intol_ie->header.element_id =
TLV_ID_2040BSS_INTOL_CHAN_REPORT;
hostcmd->size +=
sizeof(MrvlIETypes_2040BssIntolerantChannelReport_t) -
sizeof(bss_intol_ie->chan_num);
bss_intol_ie->reg_class = reg_class;
memcpy(bss_intol_ie->chan_num, chan_list, num_of_chan);
bss_intol_ie->header.len =
sizeof(bss_intol_ie->reg_class) + num_of_chan;
hostcmd->size += num_of_chan;
}
hostcmd->size = cpu_to_le16(hostcmd->size);
return;
}
/**
* @brief Invoke multiple 2040Coex commands for multiple regulatory classes
*
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int invoke_coex_command(void)
{
int cur_reg_domain;
t_u8 chan_list[MAX_CHAN], is_intol_ap_present;
t_u8 num_of_chan;
int i, num_entry, ret = MLAN_STATUS_SUCCESS;
class_chan_t *cur_class_chan_table = NULL;
/** get region code */
ret = get_region_code(&cur_reg_domain);
if (ret != MLAN_STATUS_SUCCESS)
return ret;
/** Find region_class_chan_table for this region */
for (i = 0; (unsigned int)i < (sizeof(region_class_chan_table) /
sizeof(region_class_chan_t));
i++) {
if (region_class_chan_table[i].reg_domain == cur_reg_domain) {
cur_class_chan_table =
region_class_chan_table[i].class_chan_list;
num_entry =
region_class_chan_table[i].num_class_chan_entry;
break;
}
}
if (cur_class_chan_table == NULL) {
printf("No region_class_chan table found for this region\n");
return MLAN_STATUS_FAILURE;
}
for (i = 0; i < num_entry; i++) {
/** Get channels for the specified regulatory class */
get_channels_for_specified_reg_class(
cur_class_chan_table, num_entry, chan_list,
&num_of_chan, cur_reg_domain,
cur_class_chan_table[i].reg_class,
&is_intol_ap_present);
/** If any channel found for this regulatory class, then invoke
* the 2040coex command */
if (num_of_chan > 0) {
ret = process_host_cmd(
CMD_2040COEX, chan_list, num_of_chan,
cur_class_chan_table[i].reg_class,
is_intol_ap_present);
if (ret)
break;
}
}
return ret;
}
/**
* @brief Process host_cmd response
*
* @param cmd_name The command string
* @param buf A pointer to the response buffer
*
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int process_host_cmd_resp(char *cmd_name, t_u8 *buf)
{
t_u32 hostcmd_size = 0;
HostCmd_DS_GEN *hostcmd = NULL;
int ret = MLAN_STATUS_SUCCESS;
buf += strlen(CMD_NXP) + strlen(cmd_name);
memcpy((t_u8 *)&hostcmd_size, buf, sizeof(t_u32));
buf += sizeof(t_u32);
hostcmd = (HostCmd_DS_GEN *)buf;
hostcmd->command = le16_to_cpu(hostcmd->command);
hostcmd->size = le16_to_cpu(hostcmd->size);
hostcmd->command &= ~HostCmd_RET_BIT;
if (!le16_to_cpu(hostcmd->result)) {
switch (hostcmd->command) {
}
} else {
printf("HOSTCMD failed: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
ret = MLAN_STATUS_FAILURE;
}
return ret;
}

View file

@ -0,0 +1,420 @@
/** @file mlan2040misc.h
*
* @brief This file contains command definitions for application
*
*
* Copyright 2009-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* 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:
06/24/2009: initial version
************************************************************************/
#ifndef _COEX_MISC_H_
#define _COEX_MISC_H_
/** MLAN MAC Address Length */
#define MLAN_MAC_ADDR_LENGTH (6)
/** Size of command buffer */
#define MRVDRV_SIZE_OF_CMD_BUFFER (3 * 1024)
/** Command RET code, MSB is set to 1 */
#define HostCmd_RET_BIT 0x8000
/** General purpose action : Get */
#define HostCmd_ACT_GEN_GET 0x0000
/** General purpose action : Set */
#define HostCmd_ACT_GEN_SET 0x0001
/** TLV Id for 2040Coex IE */
#define TLV_ID_2040COEX 0x48
/** TLV Id for 2040BSS intolarent channel report IE */
#define TLV_ID_2040BSS_INTOL_CHAN_REPORT 0x49
/** Host-command for 2040coex command */
#define HostCmd_CMD_11N_2040COEX 0x00e9
/** Maximum scan response buffer size */
#define SCAN_RESP_BUF_SIZE 2000
/** Maximum length of SSID */
#define MRVDRV_MAX_SSID_LENGTH 32
/** Length of ethernet address */
#ifndef ETH_ALEN
#define ETH_ALEN 6
#endif
/** Maximum length of SSID list */
#define MRVDRV_MAX_SSID_LIST_LENGTH 10
/** Default scan interval in second*/
#define DEFAULT_SCAN_INTERVAL 300
/** BIT value */
#define MBIT(x) (((t_u32)1) << (x))
/** Check intolerent bit set */
#define IS_INTOL_BIT_SET(cap_info) (cap_info & MBIT(14))
/** Check OBSS non-HT STAs present bit set */
#define IS_NON_HT_STA_PRESENT(ht_info) (ht_info.field3 & MBIT(4))
/** IEEE Type definitions */
typedef enum _IEEEtypes_ElementId_e {
SSID = 0,
SUPPORTED_RATES = 1,
FH_PARAM_SET = 2,
DS_PARAM_SET = 3,
CF_PARAM_SET = 4,
IBSS_PARAM_SET = 6,
HT_CAPABILITY = 45,
HT_OPERATION = 61,
BSSCO_2040 = 72,
OVERLAPBSSSCANPARAM = 74,
EXT_CAPABILITY = 127,
ERP_INFO = 42,
EXTENDED_SUPPORTED_RATES = 50,
VENDOR_SPECIFIC_221 = 221,
WMM_IE = VENDOR_SPECIFIC_221,
RSN_IE = 48,
} __attribute__((packed)) IEEEtypes_ElementId_e;
/** HT Capabilities Data */
typedef struct _HTCap_t {
/** HT Capabilities Info field */
t_u16 ht_cap_info;
/** A-MPDU Parameters field */
t_u8 ampdu_param;
/** Supported MCS Set field */
t_u8 supported_mcs_set[16];
/** HT Extended Capabilities field */
t_u16 ht_ext_cap;
/** Transmit Beamforming Capabilities field */
t_u32 tx_bf_cap;
/** Antenna Selection Capability field */
t_u8 asel;
/** Reserved set to 0 */
t_u16 reserved;
} __attribute__((packed)) HTCap_t, *pHTCap_t;
/** HT Information Data */
typedef struct _HTInfo_t {
/** Primary channel */
t_u8 pri_chan;
/** Field 2 */
t_u8 field2;
/** Field 3 */
t_u16 field3;
/** Field 4 */
t_u16 field4;
/** Bitmap indicating MCSs supported by all HT STAs in the BSS */
t_u8 basic_mcs_set[16];
/** Reserved set to 0 */
t_u16 reserved;
} __attribute__((packed)) HTInfo_t, *pHTInfo_t;
/** 20/40 BSS Coexistence Data */
typedef struct _BSSCo2040_t {
/** 20/40 BSS Coexistence value */
t_u8 bss_co_2040_value;
/** Reserve field */
t_u8 reserved[3];
} __attribute__((packed)) BSSCo2040_t, *pBSSCo2040_t;
/** Extended Capabilities Data */
typedef struct _ExtCap_t {
/** Extended Capabilities value */
t_u8 ext_cap_value;
/** Reserved field */
t_u8 reserved[3];
} __attribute__((packed)) ExtCap_t, *pExtCap_t;
/** Overlapping BSS Scan Parameters Data */
typedef struct _OverlapBSSScanParam_t {
/** OBSS Scan Passive Dwell */
t_u16 obss_scan_passive_dwell;
/** OBSS Scan Active Dwell */
t_u16 obss_scan_active_dwell;
/** BSS Channel Width Trigger Scan Interval */
t_u16 bss_chan_width_trigger_scan_int;
/** OBSS Scan Passive Total Per Channel */
t_u16 obss_scan_passive_total;
/** OBSS Scan Active Total Per Channel */
t_u16 obss_scan_active_total;
/** BSS Width Channel Transition Delay Factor */
t_u16 bss_width_chan_trans_delay;
/** OBSS Scan Activity Threshold */
t_u16 obss_scan_active_threshold;
} __attribute__((packed)) OBSSScanParam_t, *pOBSSScanParam_t;
/** IEEEtypes_CapInfo_t structure*/
typedef struct _IEEEtypes_CapInfo_t {
/** Capability Bit Map : ESS */
t_u8 ess : 1;
/** Capability Bit Map : IBSS */
t_u8 ibss : 1;
/** Capability Bit Map : CF pollable */
t_u8 cf_pollable : 1;
/** Capability Bit Map : CF poll request */
t_u8 cf_poll_rqst : 1;
/** Capability Bit Map : privacy */
t_u8 privacy : 1;
/** Capability Bit Map : Short preamble */
t_u8 short_preamble : 1;
/** Capability Bit Map : PBCC */
t_u8 pbcc : 1;
/** Capability Bit Map : Channel agility */
t_u8 chan_agility : 1;
/** Capability Bit Map : Spectrum management */
t_u8 spectrum_mgmt : 1;
/** Capability Bit Map : Reserved */
t_u8 rsrvd3 : 1;
/** Capability Bit Map : Short slot time */
t_u8 short_slot_time : 1;
/** Capability Bit Map : APSD */
t_u8 apsd : 1;
/** Capability Bit Map : Reserved */
t_u8 rsvrd2 : 1;
/** Capability Bit Map : DSS OFDM */
t_u8 dsss_ofdm : 1;
/** Capability Bit Map : Reserved */
t_u8 rsrvd1 : 2;
} __attribute__((packed)) IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
typedef struct {
t_u8 chan_number; /**< Channel Number to scan */
t_u8 radio_type; /**< Radio type: 'B/G' Band = 0, 'A' Band = 1 */
t_u8 scan_type; /**< Scan type: Active = 1, Passive = 2 */
t_u8 reserved; /**< Reserved */
t_u32 scan_time; /**< Scan duration in milliseconds; if 0 default used
*/
} __attribute__((packed)) wlan_ioctl_user_scan_chan;
typedef struct {
char ssid[MRVDRV_MAX_SSID_LENGTH + 1]; /**< SSID */
t_u8 max_len; /**< Maximum length of SSID */
} __attribute__((packed)) wlan_ioctl_user_scan_ssid;
typedef struct {
/** Flag set to keep the previous scan table intact */
t_u8 keep_previous_scan; /* Do not erase the existing scan results */
/** BSS mode to be sent in the firmware command */
t_u8 bss_mode;
/** Configure the number of probe requests for active chan scans */
t_u8 num_probes;
/** Reserved */
t_u8 reserved;
/** BSSID filter sent in the firmware command to limit the results */
t_u8 specific_bssid[ETH_ALEN];
/** SSID filter list used in the to limit the scan results */
wlan_ioctl_user_scan_ssid ssid_list[MRVDRV_MAX_SSID_LIST_LENGTH];
/** Variable number (fixed maximum) of channels to scan up */
wlan_ioctl_user_scan_chan chan_list[WLAN_IOCTL_USER_SCAN_CHAN_MAX];
} __attribute__((packed)) wlan_ioctl_user_scan_cfg;
/** IEEE IE header */
typedef struct _IEEEtypes_Header_t {
/** Element ID */
t_u8 element_id;
/** Length */
t_u8 len;
} __attribute__((packed)) IEEEtypes_Header_t, *pIEEEtypes_Header_t;
/** HT Capabilities IE */
typedef struct _IEEEtypes_HTCap_t {
/** Generic IE header */
IEEEtypes_Header_t ieee_hdr;
/** HTCap struct */
HTCap_t ht_cap;
} __attribute__((packed)) IEEEtypes_HTCap_t, *pIEEEtypes_HTCap_t;
/** HT Information IE */
typedef struct _IEEEtypes_HTInfo_t {
/** Generic IE header */
IEEEtypes_Header_t ieee_hdr;
/** HTInfo struct */
HTInfo_t ht_info;
} __attribute__((packed)) IEEEtypes_HTInfo_t, *pIEEEtypes_HTInfo_t;
/** 20/40 BSS Coexistence IE */
typedef struct _IEEEtypes_2040BSSCo_t {
/** Generic IE header */
IEEEtypes_Header_t ieee_hdr;
/** BSSCo2040_t struct */
BSSCo2040_t bss_co_2040;
} __attribute__((packed)) IEEEtypes_2040BSSCo_t, *pIEEEtypes_2040BSSCo_t;
/** Extended Capabilities IE */
typedef struct _IEEEtypes_ExtCap_t {
/** Generic IE header */
IEEEtypes_Header_t ieee_hdr;
/** ExtCap_t struct */
ExtCap_t ext_cap;
} __attribute__((packed)) IEEEtypes_ExtCap_t, *pIEEEtypes_ExtCap_t;
/** Overlapping BSS Scan Parameters IE */
typedef struct _IEEEtypes_OverlapBSSScanParam_t {
/** Generic IE header */
IEEEtypes_Header_t ieee_hdr;
/** OBSSScanParam_t struct */
OBSSScanParam_t obss_scan_param;
} __attribute__((packed)) IEEEtypes_OverlapBSSScanParam_t,
*pIEEEtypes_OverlapBSSScanParam_t;
typedef struct _wlan_get_scan_table_fixed {
/** BSSID of this network */
t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
/** Channel this beacon/probe response was detected */
t_u8 channel;
/** RSSI for the received packet */
t_u8 rssi;
/** TSF value from the firmware at packet reception */
t_u64 network_tsf;
} wlan_get_scan_table_fixed;
/**
* Structure passed in the wlan_ioctl_get_scan_table_info for each
* BSS returned in the WLAN_GET_SCAN_RESP IOCTL
*/
typedef struct _wlan_ioctl_get_scan_table_entry {
/**
* Fixed field length included in the response.
*
* Length value is included so future fixed fields can be added to the
* response without breaking backwards compatibility. Use the length
* to find the offset for the bssInfoLength field, not a sizeof()
* calc.
*/
t_u32 fixed_field_length;
/**
* Length of the BSS Information (probe resp or beacon) that
* follows starting at bssInfoBuffer
*/
t_u32 bss_info_length;
/**
* Always present, fixed length data fields for the BSS
*/
wlan_get_scan_table_fixed fixed_fields;
/*
* Probe response or beacon scanned for the BSS.
*
* Field layout:
* - TSF 8 octets
* - Beacon Interval 2 octets
* - Capability Info 2 octets
*
* - IEEE Infomation Elements; variable number & length per 802.11
* spec
*/
/* t_u8 bss_info_buffer[1]; */
} wlan_ioctl_get_scan_table_entry;
/**
* Sructure to retrieve the scan table
*/
typedef struct {
/**
* - Zero based scan entry to start retrieval in command request
* - Number of scans entries returned in command response
*/
t_u32 scan_number;
/**
* Buffer marker for multiple wlan_ioctl_get_scan_table_entry
* structures. Each struct is padded to the nearest 32 bit boundary.
*/
t_u8 scan_table_entry_buf[1];
} wlan_ioctl_get_scan_table_info;
/* Define general hostcmd data structure */
/** HostCmd_DS_GEN */
typedef struct _HostCmd_DS_GEN {
/** Command */
t_u16 command;
/** Size */
t_u16 size;
/** Sequence number */
t_u16 seq_num;
/** Result */
t_u16 result;
} __attribute__((packed)) HostCmd_DS_GEN;
/** Size of HostCmd_DS_GEN */
#define S_DS_GEN sizeof(HostCmd_DS_GEN)
/** TLV related data structures*/
/** MrvlIEtypesHeader_t */
typedef struct _MrvlIEtypesHeader {
/** Header type */
t_u16 type;
/** Header length */
t_u16 len;
} __attribute__((packed)) MrvlIEtypesHeader_t;
/** _MrvlIETypes_2040BssIntolerantChannelReport_t */
typedef struct _MrvlIETypes_2040BssIntolerantChannelReport_t {
/** Header */
IEEEtypes_Header_t header;
/** regulatory class */
t_u8 reg_class;
/** channel numbers for legacy AP */
t_u8 chan_num[1];
} __attribute__((packed)) MrvlIETypes_2040BssIntolerantChannelReport_t;
/** MrvlIETypes_2040COEX_t */
typedef struct _MrvlIETypes_2040COEX_t {
/** Header */
IEEEtypes_Header_t header;
/** 2040 coex element */
t_u8 coex_elem;
} __attribute__((packed)) MrvlIETypes_2040COEX_t;
typedef struct _HostCmd_DS_CMD_11N_2040COEX {
/** 2040 coex element */
MrvlIETypes_2040COEX_t coex;
/** 2040 BSS intolerant channel report*/
MrvlIETypes_2040BssIntolerantChannelReport_t chan_intol_report;
} __attribute__((packed)) HostCmd_DS_CMD_11N_2040COEX;
/** Maximum number of channel per regulatory class */
#define MAX_CHAN 20
typedef struct _class_chan_t {
/** Regulatory class */
t_u8 reg_class;
/** Channel numbers */
t_u8 channels[MAX_CHAN];
/** Total number of channels */
t_u8 total_chan;
} class_chan_t;
typedef struct _region_class_chan_t {
/** Regulatory domain */
int reg_domain;
/** Channel numbers */
class_chan_t *class_chan_list;
/** Number of class channel table entry */
int num_class_chan_entry;
} region_class_chan_t;
int process_host_cmd_resp(char *cmd_name, t_u8 *buf);
void prepare_coex_cmd_buff(t_u8 *buf, t_u8 *chan_list, t_u8 num_of_chan,
t_u8 reg_class, t_u8 is_intol_ap_present);
int invoke_coex_command(void);
#endif /* _COEX_MISC_H_ */

49
mapp/mlanconfig/Makefile Normal file
View file

@ -0,0 +1,49 @@
#
# File : mlanconfig/Makefile
#
# Copyright 2008-2022,2025 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))
CFLAGS += -Wno-error
#
# List of application executables to create
#
libobjs:= mlanconfig.o mlanhostcmd.o mlanmisc.o
exectarget=mlanconfig
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 appsbuild install: $(TARGETS)
@cp -rf config $(INSTALLPATH)
clean:
@rm -f $(exectarget)
@rm -f *.o
distclean: clean
@rm -f *~ core
@rm -f tags

View file

@ -0,0 +1,49 @@
#Band config
[Band]
# band config, 1: 2.4G, 2: 5G
02
[/Band]
# HE Capability
[HECap]
# ID
ff 00
# Length
1a 00
# he capability id
23
# HE MAC capability info
01 08 00 82 00 08
# HE PHY capability info
04 70 7e c9 fd 01 a0 0a 02 3d 00
# Tx Rx HE-MCS NSS support
fa ff fa ff
# PPE Thresholds (optional)
# PE: 16 us
e1 ff c7 71
[/HECap]
####### UAP HE cap ############
#Band config
#[Band]
# band config, 1: 2.4G, 2: 5G
#02
#[/Band]
# HE Capability
#[HECap]
# ID
#ff 00
# Length
#1a 00
# he capability id
#23
# HE MAC capability info
#00 00 00 00 00 00
# Enable PPE Threshold
#04 20 0e c9 fe 0b a0 0e 01 20 00
# Tx Rx HE-MCS NSS support
#fa ff fa ff
# PPE Thresholds (optional)
# PE: 16 us
#e1 ff c7 71
#[/HECap]

View file

@ -0,0 +1,21 @@
# File : 11n_2040coex.conf
######################### 20/40 Coex command ##################
2040coex={
CmdCode=0x00e9 # do NOT change this line
2040CoexTlvType:1=0x48
2040CoexTlvLen:1={
2040CoexElement:1=0x04
}
2040BssIntlChanTlvType:1=0x49
2040BssIntlChanTlvLen:1={
RegulatoryDomain:1=32 # USA: 32 (1-7), 33 (5-11)
ChannelNum:1=1
ChannelNum:1=2
# ...
}
}
##################################################################

View file

@ -0,0 +1,29 @@
# File : arpfilter.conf
######################### Host Sleep ARP/IP filtering command ##################
# add arp filter
# firmware supports 8 entries of ARP_FILTER. Each entry has 8 bytes.
# must not exceed 8x8+4=68 bytes
arpfilter={
TlvType:2=0x0115
TlvLength:2={
AddrType:2=3 # multicast
EthType:2=0xffff # Any
Ipv4Addr:4=0xffffffff # Any
AddrType:2=1 # broadcast
EthType:2=0x0608 # ARP: 0x0806
Ipv4Addr:4=0x6200a8c0 # 192.168.0.98
AddrType:2=2 # unicast
EthType:2=0xffff # Any
Ipv4Addr:4=0xffffffff # Any
}
}
# remove arp filter
#arpfilter={
# TlvType:2=0x0115
# TlvLength:2={
# }
#}
######################### Host Sleep ARP/IP filtering command ##################

View file

@ -0,0 +1,75 @@
# File : auto_tx.conf
######################### Auto-TX command ##################
auto_tx_get={
CmdCode=0x0082 # do NOT change this line
Action:2=0 # GET
}
auto_tx_unreg={
CmdCode=0x0082 # do NOT change this line
Action:2=1 # SET
}
nat_keep_alive={
CmdCode=0x0082 # do NOT change this line
Action:2=1 # SET
AutoTxTlvType:2=0x0118
AutoTxTlvLength:2={ # 58 = 6 + 52 (FrameLen)
Interval:2=0x80C8 # 1 - 32968 in seconds. Use 2 = Other-Chips, 0x80C8 = Nighthawk Chip
Priority:1=7 # Priority, ignored if non-WMM
Reserved:1=0
GetTodToA:1=0
FrameLength:2={ # 52 = 6 (DA) + 6 (SA) + 2 + 38 (Length)
DestMacAddr:6='0x00,0x40,0xf4,0xbf,0x24,0xee'
SrcMacAddr:6='0x00,0x00,0x00,0x00,0x00,0x00'
Length:2='0x00,38' # 38 = 8 (SNAP hdr) + 29 (IP) + 1 (padding)
DSAP:1=0xaa # SNAP header
SSAP:1=0xaa
Ctrl:1=0x03
SNAP_OUI:3='0x00,0x00,0x00'
SNAP_PID:2='0x08,0x00' # IP Packet
IPv4:1=0x45
IP_TOS:1=0x00
IP_LEN:2='0x00,29' # IP hdr 20 + payload 9 = 29
IP_ID:2=0xefbe
IP_Flag_FragOffset:2=0x0000
IP_TTL:1=128
IP_Prot:1=17 # UDP protocol
IPhdr_cksum:2=0xc5f9 # may need re-calculation if changed
IPsrcAddr:4='192,168,0,201' # 192.168.0.201
IPdstAddr:4='192,168,0,1' # 192.168.0.1
UDPsrcPort:2='0x11,0x94' # 4500
UDPdstPort:2='0x11,0x94' # 4500
UDPlength:2='0x00,9' # UDP hdr 8 + payload 1 = 9
UDPcksum:2=0x985b # may need re-calculation if changed
UDPpayload:1=0xff
padding:1=0 # MAC Padding for 32bit alignment, set to 0
}
}
}
QoS_NULL_packet={
CmdCode=0x0082 # do NOT change this line
Action:2=1 # SET
AutoTxTlvType:2=0x0118
AutoTxTlvLength:2={
Interval:2=1 # 1 - 3600 seconds
Priority:1=7 # Priority, ignored if non-WMM
Reserved:1=0
GetTodToA:1=0
FrameLength:2={ # 52 = 6 (DA) + 6 (SA) + 2
DestMacAddr:6='0x6C,0xCD,0xD6,0xB4,0xFA,0x58'
SrcMacAddr:6='0xA0,0xCD,0xF3,0x77,0xE7,0x9C'
Length:2='0x00,0x00'
}
}
}
######################### Auto-TX command ##################

View file

@ -0,0 +1,13 @@
#File autodfs.conf
autodfs_cfg={
cac_start_chan=52 #Start zero dfs CAC on this channel
cac_timer=60 #CAC timer in seconds
bw=0 #Bandwidth
#0: 20MHz
#1: 40Mz above
#3: 40MHz below
#4: Bandwidth 80MHz
uap_chan_switch=0 #disable/enable uap chan switch after first CAC finished
multi_chan_dfs=1 #enable multi-channel dfs support
user_chan_list=52, 54, 56, 100 #user dfs channel list
}

View file

@ -0,0 +1,60 @@
######################### band steering configure command ##################
band_steering_cfg={
CmdCode=0x026f # do NOT change this line
Action:1=31 # Action = BIT0|BIT1|BIT2|BIT3|BIT4
# BIT0: State take effect
# BIT1: or this bit if want change Block2gPrbReq
# BIT2: or this bit if want change MaxBtmReqAllowed
# BIT3: or this if want to change Block2gPrbReqP2P
# BIT4: or this if want to enable/disable disassoc imminent
State:1=1 # 0: disable Band steering, 1: enable bandsteering
Block2gPrbReq:1=5 # 0~15, the number of probe requests to block before allowing response for the STA
MaxBtmReqAllowed:1=6 # 0~15,max bss_transition requests to station
Block2gPrbReqP2p:1=90 # percentage of probe requests to block before allowing response for the P2P client. This must be between 50 and 98. Else fw will not update the value
PrbRspBlockingCfg:1=0 #Enable/Disable sending Probe responses in Pre-Assoc method for STA. 1 to send probe responses. 0 to block probe resposes.
BtmDisassocImminent:1=0 #Enable/Disable Disassoc Imminent in BTM. 1=Enable, 0=Disable.
# STA MAC addresses for blacklisting
# Max number of MACs supported is 20
pattenHeaderType:2=0x0137
patternHeaderLen:2={
Type:1=0 #Type 0 for Blacklisted MAC Addresses
BlacklistState:1=1 #BlacklistState=1 to enable blacklisting
#BlacklistState=0 for disable blacklisting
Timeout:2=100 #Blacklisting timeout in TBTT
MAC1:6='0x11,0x22,0x33,0x44,0x55,0x66'
MAC2:6='0xaa,0xbb,0xcc,0xdd,0xee,0xff'
MAC3:6='0x11,0x22,0x33,0xaa,0xbb,0xcc'
MAC4:6='0x12,0x21,0x33,0x44,0x55,0x66'
MAC5:6='0x12,0x21,0x12,0x21,0x12,0x21'
MAC6:6='0xac,0x37,0x43,0x52,0xc7,0x34'
MAC7:6='0xaa,0xb7,0x43,0xc2,0x7c,0x33'
MAC8:6='0x07,0xb7,0x43,0xc2,0x7c,0x33'
MAC9:6='0xda,0xb7,0x43,0xc2,0x7c,0x33'
}
# band steering patterns to detetct dual band capability of STA
# Max number of patterns supported is 10
# Max pattern length (for individual pattern) supported is 10
pattenHeaderType:2=0x0137
patternHeaderLen:2={
Type:1=1 #Type 1 for Patterns
Len1:1=0x04 #This is pattern1 length in bytes
pattern1:4='0x11,0x22,0x33,0x44' #This is pattern represented in HEX
Len2:1=0x05
pattern2:5='0x01,0x02,0x03,0x04,0x05'
Len3:1=0x02
pattern3:2='0x03,0x04'
Len4:1=0x01
pattern4:1='0x0a'
Len2:1=0x0a
pattern2:10='0x01,0x02,0x03,0x04,0x05,0x01,0x02,0x03,0x04,0x05'
}
}

View file

@ -0,0 +1,166 @@
# File : bg_scan.conf
# ./mlanutl mlan0 hostcmd bg_scan.conf bgscfg
# ./mlanutl mlan0 hostcmd bg_scan.conf bgs_query
######################### BG Scan Configuration command ##################
########### Sample configuration for Get BG Scan Configuration #####################
#bgscfg={
# CmdCode=0x006b # do NOT change this line
# Action:1=0 # 0- Get, 1- Set
# ConfigType:1=0 # 0- normal BG Scan config, 1-PPS or UAPSD BG Scan config
# Enable:1=1 # 0- Disable, 1-Enable
# BssType:1=0 # 1 - Infrastructure,2 - IBSS,3 - Any
# ChannelsPerScan:1=0 # Number of Channel to scan at one scan; maximum 14
# Reserved1:3=0
# ScanInterval:4=0 # Interval between consecutive scan (in milliseconds)
# Reserved2:4=0
# ReportConditions:4=0 # bit0 - SSID match
# bit1 - SNR above SNR threshold
# bit2 - RSSI above RSSI threshold
# bit31 - All channels scanned at least once
# Reserved3:2=0
#}
########### SET BG Scan Configuration #####################
bgscfg={
CmdCode=0x006b # do NOT change this line
Action:1=1 # 0- Get, 1- Set
ConfigType:1=0 # 0- normal BG Scan config, 1-PPS or UAPSD BG Scan config
Enable:1=1 # 0- Disable, 1-Enable
BssType:1=3 # 1 - Infrastructure,2 - IBSS,3 - Any
ChannelsPerScan:1=14 # Number of Channel to scan at one scan; maximum 14
Reserved1:3=0
ScanInterval:4=1000 # Interval between consecutive scan (in milliseconds)
Reserved2:4=0
ReportConditions:4=1 # bit0 - SSID match
# bit1 - SNR above SNR threshold
# bit2 - RSSI above RSSI threshold
# bit31 - All channels scanned at least once
Reserved3:2=0
# SSID parameter set:
#
# MaxSSIDLen entries:
#
# 1. MaxSSIDLen:1=0x00 - to denote match AP name exactly,
# generate SSID specific probes
# 2. MaxSSIDLen:1=maxlen - to denote AP name will be use to base match the
# SSID and SSID's max length is 'maxlen',
# do not generate SSID specific probes
# 3. MaxSSIDLen:1=wildcard match char ('*' or '?')
# - to denote wildcard AP name will be use to match the SSID
# 4. MaxSSIDLen:1=0xff - to denote unix pattern matching
#
# SSID entries:
#
# SSID="AP_NAME" - to mention the SSID to match
# SSID Examples:
#
#
# Match SSID name "NXPAP" exactly, generate SSID specific probes
#
SSIDHeaderType:2=0x0112
SSIDHeaderLen:2={
MaxSSIDLen:1=0x00
SSID:9="NXPAP"
}
#
# NXPAP will be use to base match the SSID and SSID's max length is 12
#
# SSIDHeaderType:2=0x0112
# SSIDHeaderLen:2={
# MaxSSIDLen:1=0x0c
# SSID:9="NXPAP"
# }
#
# Match "NXPAP*" where '*' is a single char
#
# SSIDHeaderType:2=0x0112
# SSIDHeaderLen:2={
# MaxSSIDLen:1='*'
# SSID:10="NXPAP*"
# }
#
# Match "Mar?ell*" with unix pattern matching
#
# SSIDHeaderType:2=0x0112
# SSIDHeaderLen:2={
# MaxSSIDLen:1=0xff # For unix pattern matching
# SSID:8="Mar?ell*"
# }
# Number Probe requests to be sent for broadcast and
# for each SSID specific scan required.
#
# If any SSID in the list has a non-zero modifier (wildcard match char,
# unix pattern match, maxlen), "Numprobes" of broadcast probe requests
# will be transmitted once per channel and the results matched against
# all entries.
#
# Set to 0 to use global scan probes setting
#
ProbeHeaderType:2=0x0102
ProbeHeaderLen:2={
NumProbes:2=2
}
# ChannelList contains the channels to scan
# The ChannelList should be specified in the form of
#
# RadioType, ChanNumber, ScanType, MinScanTime, ScanTime;
#
# RadioType - 0 [B/G Band], 1 [A Band]
# ScanType - 2 [Active], 3 [Passive]
#
ChannHeaderType:2=0x0101
ChannHeaderLen:2={
Chan1_RadioType:1=0
Chan1_ChanNumber:1=10
Chan1_ScanType:1=2
Chan1_MinScanTime:2=10
Chan1_ScanTime:2=100
Chan2_RadioType:1=0
Chan2_ChanNumber:1=6
Chan2_ScanType:1=3
Chan2_MinScanTime:2=10
Chan2_ScanTime:2=100
}
# SNR threshold used when ReportConditions bit1 is set
SNRHeaderType:2=0x0105
SNRHeaderLen:2={
SNRValue:1=40 #SNR Thereshold Value
SNRFreq:1=0
}
# RSSI threshold used when ReportConditions bit2 is set
#
# Threshold is absolute value and match value would
# therefore be less than or equal to trigger a report
RSSIHeaderType:2=0x0104
RSSIHeaderLen:2={
RSSIValue:1=50 #RSSI Thereshold Value
RSSIFreq:1=0
}
# StartLaterValue: 0 - BGScan start immediately
# 1 - BGScan will start later after "Scan Interval"
StartLaterHeaderType:2=0x011e
StartLaterHeaderLen:2={
StartLaterValue:2=0
}
}
######################### BG Scan Configuration command ##################
########### BG Scan Query #####################
bgs_query={
CmdCode=0x006c
flush:1=1
}
########### BG Scan Query #####################

View file

@ -0,0 +1,88 @@
# File : bg_scan_wifidirect.conf
######################### BG Scan Configuration command ##################
########### SET BG Scan Configuration #####################
bgscfg={
CmdCode=0x006b # do NOT change this line
Action:1=1 # 0- Get, 1- Set
ConfigType:1=0 # 0- normal BG Scan config, 1-PPS or UAPSD BG Scan config
Enable:1=1 # 0- Disable, 1-Enable
BssType:1=3 # 1 - Infrastructure,2 - IBSS,3 - Any
ChannelsPerScan:1=3 # Number of Channel to scan at one scan; maximum 14
Reserved1:3=0
ScanInterval:4=1000 # Interval between consecutive scan (in milliseconds)
StoreCondition:4=1 # 1 - SSID match (bit 0)
# 2 - SSID match AND SNR above SNR threshold (bit 1)
ReportConditions:4=1 # 1 - SSID match (bit 0)
# 2 - SSID match AND SNR above SNR threshold (bit 1)
Reserved3:2=0
# SSID parameter set:
#
SSIDHeaderType:2=0x0112
SSIDHeaderLen:2={
MaxSSIDLen:1=0x00
SSID:7="DIRECT-"
}
# Number Probe requests to be sent for broadcast and
# for each SSID specific scan required.
#
# If any SSID in the list has a non-zero modifier (wildcard match char,
# unix pattern match, maxlen), "Numprobes" of broadcast probe requests
# will be transmitted once per channel and the results matched against
# all entries.
#
# Set to 0 to use global scan probes setting
#
ProbeHeaderType:2=0x0102
ProbeHeaderLen:2={
NumProbes:2=2
}
# ChannelList contains the channels to scan
# The ChannelList should be specified in the form of
#
# RadioType, ChanNumber, ScanType, MinScanTime, ScanTime;
#
# RadioType - 0 [B/G Band], 1 [A Band]
# ScanType - 2 [Active], 3 [Passive]
#
ChannHeaderType:2=0x0101
ChannHeaderLen:2={
Chan1_RadioType:1=0
Chan1_ChanNumber:1=1
Chan1_ScanType:1=2
Chan1_MinScanTime:2=10
Chan1_ScanTime:2=100
Chan2_RadioType:1=0
Chan2_ChanNumber:1=6
Chan2_ScanType:1=2
Chan2_MinScanTime:2=10
Chan2_ScanTime:2=100
Chan3_RadioType:1=0
Chan3_ChanNumber:1=11
Chan3_ScanType:1=2
Chan3_MinScanTime:2=10
Chan3_ScanTime:2=100
}
# SNR threshold to match, when StoreCondition
# or ReportConditions been set to 2
SNRHeaderType:2=0x0105
SNRHeaderLen:2={
SNRValue:1=40 #SNR Thereshold Value
SNRFreq:1=0
}
# StartLaterValue: 0 - BGScan start immediately
# 1 - BGScan will start later after "Scan Interval"
StartLaterHeaderType:2=0x011e
StartLaterHeaderLen:2={
StartLaterValue:2=0
}
}
######################### BG Scan Configuration command ##################

View file

@ -0,0 +1,42 @@
01 00 0c 00 58 02
00 40 68 0c 00 00 00 40 00 00 00 00 00 11 00 00
00 11 00 10 00 00 00 00 00 00 00 00 00 00 00 00
10 12 00 10 10 86 40 89 01 03 02 00 01 02 05 00
01 03 05 00 17 17 00 05 00 00 00 00 00 00 00 00
00 30 1f 11 00 00 00 70 00 00 00 00 13 00 1e 01
00 1e 5e 15 29 5e 15 13 5c 1d 0d 0b 1d 0d 0b 29
0d 0b 29 5c 0b 29 5c 1d 00 5c 1d 0d 00 00 00 00
00 5c c0 0e 00 00 00 cc 00 5f 00 00 07 01 04 00
00 00 0e 0d 00 00 00 00 00 00 00 00 00 00 00 ff
00 00 00 01 00 00 00 00 00 00 00 ff 00 00 00 01
00 00 00 00 00 00 00 ff 00 00 00 01 00 00 00 00
00 00 00 ff 00 00 00 01 00 00 00 00 06 3c 06 3d
00 00 00 00 00 00 00 00 00 00 00 00
00 5c dc 25 00 00 01 28 00 6f 00 00 07 01 04 00
00 00 0e 0d 00 00 00 00 00 00 00 00 00 08 00 07
00 00 00 09 00 00 00 00 00 08 00 07 00 00 00 09
00 00 00 00 00 08 00 07 00 00 00 09 00 00 00 00
00 08 00 07 00 00 00 09 00 00 00 00 06 3c 06 3d
00 00 00 00 00 00 00 00 00 00 00 00
00 14 9f 1f 00 00 01 3c 03 00 00 00 00 f1 0a f1
00 fb 0d fb
00 20 dd 28 00 00 01 5c 08 86 00 88 ff 06 b1 05
24 24 3c 42 00 00 24 18 a4 24 bc bc 3d 00 a0 8f
00 14 00 2a 00 00 01 70 00 00 30 00 01 05 1b 00
00 00 00 01
00 74 2c 10 00 00 01 e4 00 00 00 00 09 6a 09 b0
0b 12 00 6c 04 0a 00 6c 03 03 00 6c 03 03 00 6c
3f ff ff 00 3f ff ff 01 3f ff ff 02 3f ff ff 03
15 00 00 04 17 00 00 05 19 00 00 06 1b 00 00 07
1d 00 00 08 1f 00 00 09 21 00 00 0a 23 00 00 0b
25 00 00 0c 28 00 00 0d 2a 00 00 0e 2d 00 00 0f
2f 00 00 10 32 00 00 11 34 00 00 12 3f ff ff 13
3f ff ff 14
00 74 84 10 ff ff ff ff 01 00 00 00 09 b0 09 ba
0a 0f 00 6c 04 09 00 6c 03 03 00 6c 03 03 00 6c
3f ff ff 00 3f ff ff 01 3f ff ff 02 3f ff ff 03
15 00 00 04 17 00 00 05 1a 00 00 06 1c 00 00 07
1f 00 00 08 21 00 00 09 23 00 00 0a 26 00 00 0b
2a 00 00 0c 2d 00 00 0d 31 00 00 0e 34 00 00 0f
3f ff ff 10 3f ff ff 11 3f ff ff 12 3f ff ff 13
3f ff ff 14

View file

@ -0,0 +1,58 @@
# File : crypto_test.conf
######################### crypto_test command configuration ##################
# support algorithm:1-RC4, 2-AES, 3-AES_KEY_WRAP,4-AES-CCM
crypto_test={
CmdCode=0x0078 # do NOT change this line
#EncDec: 0-Decrypt, 1-Encrypt
EncDec:2=0
#Algorithm: 1-RC4, 2-AES, 3-AES_KEY_WRAP
Algorithm:2=1
#KeyIVLength: Length of KeyIV (bytes)
KeyIVLength:2=8
#KeyIV: Key IV
KeyIV:32='0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11'
#KeyLength: Length of Key (bytes)
KeyLength:2=16
#Key: Key
Key:32='0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22'
#DataType: DataType
DataType:2=0x0111
#DataLength: Data Length
DataLength:2={
#Data: Data
Data:8='0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33'
}
}
#####Sample crypto_test command configuration for AES-CCM algorithm #########
#crypto_test={
# CmdCode=0x0078 # do NOT change this line
# #EncDec: 0-Decrypt, 1-Encrypt
# EncDec:2=1
# #Algorithm: 4-AES-CCM
# Algorithm:2=4
# #KeyLength: Length of Key (bytes)
# KeyLength:2=16
# #Key: Key
# Key:32='0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22'
# #NonceLength: Length of Nonce (bytes)
# NonceLength:2=10
# #Nonce: Nonce
# Nonce:14='0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11'
# #AADLength: Length of AAD (bytes)
# AADLength:2=12
# #AAD: AAD
# AAD:32='0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33'
# #DataType: DataType
# DataType:2=0x0111
# #DataLength: Data Length
# DataLength:2={
# #Data: Data
# Data:8='0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33'
# }
#}
######################### End of crypto_test configuration command ##################

View file

@ -0,0 +1,40 @@
[headID]
00 01 02 03
[/headID]
[tailID]
00 01 02 03
[/tailID]
[chipID]
aa
[/chipID]
[bandConfig]
01
[/bandConfig]
[channel]
24
[/channel]
[csi_monitor_enable]
1
[/csi_monitor_enable]
[ra4us]
1
[/ra4us]
[commonAGCflag]
00
[/commonAGCflag]
[csiformat]
01
[/csiformat]
[csifilter0]
#MAC address
C0 56 27 D6 2E 3C
#Packet Type
01
#Subtype
0D
#Other filter flags
#bit0 reserved, must be 0
#bit1 set to 1: wait for trigger
#bit2 set to 1: send CSI error event when timeout
00
[/csifilter0]

View file

@ -0,0 +1,51 @@
#CW_MODE settings configuration
#
CW_MODE={
#Mode of operation 0: Disable current Tx Mode, 1: Continuous Tx Packet, 2: Continuous Wave/Tone
Mode=1
#Channel number
Channel=6
#channel Info
#bit [3:0] - channel offset 0: no secondary channel, 1: secondary channel above, 2: reserved, 3: secondary channel below
#bit [4:7] - channel band 0: 2.4G, 1: 5G, 2: 4G, 3: reserved
Chaninfo=0x00
#Tx power for Cont Tx in dbm
TxPower=12
# Packet Length for Cont Tx
# legacy rates: upto 2312, HT/VHT rates: upto 8K
PktLength=2048
#RateInfo for Cont Tx
RateInfo=0x0000
#rateInfo = 0x0732 : format = VHT, Bandwidth = 80MHz, datarate/MCS index = MCS7
#rateInfo = 0x0000 : format = legacy, Bandwidth = 20MHz, datarate/MCS index = 1Mbps
#rateInfo = 0x0521 : format = HT, Bandwidth = 40MHz, datarate/MCS index = MCS5
#rateInfo = 0x4521 : format = HT, Bandwidth = 40MHz, datarate/MCS index = MCS5, NSS = 1
#rateInfo = 0x8921 : format = HT, Bandwidth = 40MHz, datarate/MCS index = MCS9, NSS = 2
#bit [1:0] - Format 0: legacy, 1: 11n (HT), 2: 11ac (VHT)
#bit 2 - STBC (Not used for Cont Tx test)
#bit 3 - Beamforming (Not used for Cont Tx test)
#bit [5:4] - Bandwidth 0: 20MHz, 2: 40MHz, 3: 80MHz
#bit [7:6] - reserved
#bit [13:8] - index : data rate or MCS
#bit [15:14]- NSS (Used for 2x2 chips). Used in FW only for 2x2 chips.
#<index> can take following values.
#If <format> is 0 (LG), #If <format> is 1 (HT) #If <format> is 2 (VHT)
# NSS = 1 NSS = 1 or 2
# 0 1 Mbps 0 MCS0 0 MCS0
# 1 2 Mbps 1 MCS1 1 MCS1
# 2 5.5 Mbps 2 MCS2 2 MCS2
# 3 11 Mbps 3 MCS3 3 MCS3
# 5 6 Mbps 4 MCS4 4 MCS4
# 6 9 Mbps 5 MCS5 5 MCS5
# 7 12 Mbps 6 MCS6 6 MCS6
# 8 18 Mbps 7 MCS7 7 MCS7
# Used only for NSS = 2
# 9 24 Mbps 8 MCS8
# 10 36 Mbps 9 MCS9
# 11 48 Mbps 10 MCS10
# 12 54 Mbps 11 MCS11
# 12 MCS12
# 13 MCS13
# 14 MCS14
# 15 MCS15
}

View file

@ -0,0 +1,729 @@
#
# File: debug.conf
# 11ax configuration commands
#
stop_su={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x101 # DOT11AX_ULOFDMA
Value:4=1 # 1 -- stop_su;
# 0 -- resume su;
}
start_su={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x101 # DOT11AX_ULOFDMA
Value:4=0 # 1 -- stop_su;
# 0 -- resume su;
}
stop_forceRTS={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x104 # DOT11AX_ULOFDMA
Value:1=0 # 1 -- stop forceRTS;
# 0 -- start forceRTS;
}
start_forceRTS={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x104 # DOT11AX_ULOFDMA
Value:1=1 # 1 -- start forceRTS;
# 0 -- stop forceRTS;
}
#Nav mitigate command
stop_nav_mitigate={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x105 # NAV MITGATION
Value:1=0 # 0 -- stop_mitigate;
}
start_nav_mitigate={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x105 # NAV MITIGATION
Value:1=1 # 1 -- start_mitigate;
Option:1=0 # 1 -- disable rts for nav
}
get_nav_mitigate={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 1 - GET
SUBID:2=0x105 # NAV MITIGATION
Value:1=0 # 0: ignore;
nav_detect_cnt:2=0 # 0: ignore;
nav_stop_cnt:2=0 # 0: ignore;
}
enable_thermal_mgmt={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x113 # THERMAL_MANAGEMENT
Value:1=1 # 1 -- ENABLE;
}
disable_thermal_mgmt={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x113 # THERMAL_MANAGEMENT
Value:1=0 # 0 -- DISABLE;
}
get_thermal_mgmt={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x113 # THERMAL_MANAGEMENT
Value:1=0 # 1 -- ENABLE;
# 0 -- DISABLE;
}
set_nonampdu_txctrl_watermark={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x116 # NON_AMPDU_TX_CTRL
non_ampdu_tx_water_mark.TlvType:2=0x101
non_ampdu_tx_water_mark.TlvLength:2={
non_ampdu_tx_high_water_mark:1=0x20
non_ampdu_tx_low_water_mark:1=0x8
}
}
enable_nonampdu_txctrl={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x116 # NON_AMPDU_TX_CTRL
non_ampdu_tx_ctrl.TlvType:2=0x102
non_ampdu_tx_ctrl.TlvLength:2={
non_ampdu_tx_ctrl:1=0x1
}
}
disable_nonampdu_txctrl={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x116 # NON_AMPDU_TX_CTRL
non_ampdu_tx_ctrl.TlvType:2=0x102
non_ampdu_tx_ctrl.TlvLength:2={
non_ampdu_tx_ctrl:1=0x0
}
}
set_bcntx={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1: SET
SUBID:2=0x118 # BCN TX Config
update:1=0x0 # Update - 1: update; 0: default
txformat:1=0x3 # Format - 3: HE; 2: VHT; 1: HT; 0: legacy
txmcsnss:1=0x0 # NSS&CS - Bit[3:0]: MCS; Bit[5:4]: NSS (0: 1SS; 1: 2SS)
txratecfg:2=0x2161 # HE ER - Refer to txratecfg:
# 0x2265: RU106, 4xHELTF+3.2GI LDPC, DCM = 0
# 0x2065: RU106, 4xHELTF+3.2GI BCC, DCM = 0
# 0x2365: RU106, 4xHELTF+3.2GI LDPC, DCM = 1
# 0x2165: RU106, 4xHELTF+3.2GI BCC, DCM = 1
# 0x2261: RU204, 4xHELTF+3.2GI LDPC, DCM = 0
# 0x2061: RU204, 4xHELTF+3.2GI BCC, DCM = 0
# 0x2361: RU204, 4xHELTF+3.2GI LDPC, DCM = 1
# 0x2161: RU204, 4xHELTF+3.2GI BCC, DCM = 1
}
get_bcntx={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0: GET
SUBID:2=0x118 # BCN TX Config
update:1=0x0 # 0: ignore;
txformat:1=0x0 # 0: ignore;
txmcsnss:1=0x0 # 0: ignore;
txratecfg:2=0 # 0: ignore;
}
enable_nonHT_duplicate={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x119 # NON-HT DUPLICATE
Value:1=1 # 1 -- ENABLE;
}
disable_nonHT_duplicate={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x119 # NON-HT DUPLICATE
Value:1=0 # 0 -- DISABLE;
}
get_nonHT_duplicate={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x119 # NON-HT DUPLICATE
Value:1=0 # 1 -- ENABLE;
# 0 -- DISABLE;
}
stop_2NSS_Steering={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x120 # HE_CONFIG_2NSS_STEERING
Value:1=0 # 0 -- stop 2NSS steering;
}
start_2NSS_Steering={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x120 # HE_CONFIG_2NSS_STEERING
Value:1=1 # 1 -- start 2NSS steering;
}
set_ifb_rate={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x11a # IFB rate
checkBcnInterval:1=0x2 # specify the number of beacons elapsed for checking beacon RSSI;
bcnRssiThreshold:1=-70 # specify the beacon RSSI threshold;
}
get_ifb_rate={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x11a # IFB rate
checkBcnInterval:1=0x0 # get the number of beacons elapsed for checking beacon RSSI ;
bcnRssiThreshold:1=0x0 # get the beacon RSSI threshold;
}
set_null2self_count={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x121 # null2self duplicate count
Value:1=0x0 # specify the null2self duplicate count;
}
get_null2self_count={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x121 # null2self duplicate count
Value:1=0x0 # get the null2self duplicate count;
}
set_mgmttx={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1: SET
SUBID:2=0x11c # MGMT TX Config
update:1=0x1 # Update - 1: update; 0: default
txformat:1=0x3 # Format - 3: HE; 2: VHT; 1: HT; 0: legacy
txmcsnss:1=0x0 # NSS&CS - Bit[3:0]: MCS; Bit[5:4]: NSS (0: 1SS; 1: 2SS)
txratecfg:2=0x2361 # HE ER - Refer to txratecfg:
# 0x2265: RU106, 4xHELTF+3.2GI LDPC, DCM = 0
# 0x2065: RU106, 4xHELTF+3.2GI BCC, DCM = 0
# 0x2365: RU106, 4xHELTF+3.2GI LDPC, DCM = 1
# 0x2165: RU106, 4xHELTF+3.2GI BCC, DCM = 1
# 0x2261: RU204, 4xHELTF+3.2GI LDPC, DCM = 0
# 0x2061: RU204, 4xHELTF+3.2GI BCC, DCM = 0
# 0x2361: RU204, 4xHELTF+3.2GI LDPC, DCM = 1
# 0x2161: RU204, 4xHELTF+3.2GI BCC, DCM = 1
}
get_mgmttx={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0: GET
SUBID:2=0x11c # MGMT TX Config
update:1=0x0 # 0: ignore;
txformat:1=0x0 # 0: ignore;
txmcsnss:1=0x0 # 0: ignore;
txratecfg:2=0 # 0: ignore;
}
enable_nonAmpdu_rts={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x122 # NON-AMPDU RTS
Value:1=1 # 1 -- ENABLE;
}
disable_nonAmpdu_rts={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x122 # NON-AMPDU RTS
Value:1=0 # 0 -- DISABLE;
}
get_nonAmpdu_rts={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x122 # NON-AMPDU RTS
Value:1=0 # 1 -- ENABLE;
# 0 -- DISABLE;
}
set_htc_cap={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x124 # Enable HTC+ in HE MAC CAP
Value:1=0x1 # 1 -- ENABLE; 0 -- DISABLE
}
get_htc_cap={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x124 # Enable HTC+ in HE MAC CAP
Value:1=0 # NA
}
set_rsptx={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1: SET
SUBID:2=0x11d # RSP TX Config
update:1=0x1 # Update - 1: update; 0: default
frmtype:1=0x35 # frame type [type and subtype: b2-b7]
# 110101 - ACK
txformat:1=0x0 # Format - 3: HE; 2: VHT; 1: HT; 0: legacy
txmcsnss:1=0x0 # NSS&CS - Bit[3:0]: MCS; Bit[5:4]: NSS (0: 1SS; 1: 2SS)
txratecfg:2=0x0 # Legacy: 1 Mbps
}
get_rsptx={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0: GET
SUBID:2=0x11d # RSP TX Config
update:1=0x0 # 0: ignore;
frmtype:1=0x0 # frame type [type and subtype: b2-b7]
txformat:1=0x0 # 0: ignore;
txmcsnss:1=0x0 # 0: ignore;
txratecfg:2=0 # 0: ignore;
}
set_time_slot={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x11E # Time Slot
Value:1=20 # valid value: 9 and 20
}
get_time_slot={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x11E # Time Slot
Value:1=0 # NA
}
test_independent_reset={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x117 # TEST IR
}
enable_auto_iq_cal={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x126 # AUTO_IQ_CAL
Value:1=1 # 1 -- ENABLE;
}
disable_auto_iq_cal={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x126 # AUTO_IQ_CAL
Value:1=0 # 0 -- DISABLE;
}
get_auto_iq_cal={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x126 # AUTO_IQ_CAL
Value:1=0 # 1 -- ENABLE;
# 0 -- DISABLE;
}
#TXOP limit WAR
enable_txop_limit={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x127 # TXOP Limit
Value:1=1 # valid value: 1: enable; 0: disable
}
disable_txop_limit={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x127 # TXOP Limit
Value:1=0 # valid value: 1: enable; 0: disable
}
get_txop_limit={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x127 # TXOP Limit
Value:1=0 # N/A
}
set_ru_busy={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x128 # RU BUSY
Value:1=0 # valid value: 1: enable; 0: disable; 0xFF: origin
}
get_ru_busy={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x128 # RU BUSY
Value:1=0 # N/A
}
recover_ru_busy={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x128 # RU BUSY
Value:1=0xFF # valid value: 1: enable; 0: disable; 0xFF: origin
}
#Enable Dropping Rx AMPDUs
set_drop_rxampdu={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x129 # DROP RX AMPDU
Value:4=1 # valid value: 1: enable; 0: disable;
}
#Disable Dropping Rx AMPDUs
unset_drop_rxampdu={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x129 # DROP RX AMPDU
Value:4=0 # valid value: 1: enable; 0: disable;
}
#Get the number of Rx AMPDUs dropped.
get_drop_rxampdu={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x129 # DROP RX AMPDU
Value:4=0 # N/A
}
#Set MAC recovery
set_mac_recovery={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x12a # MAC RECOVERY
Value:4=1 # valid value: 1: tx watch dog recovery; 2: Rx MAC reset; 3: tx watch dog and rx MAC;
}
#Get MAC recovery
get_mac_recovery={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x12a # MAC RECOVERY
Value:4=1 # valid value: 1: tx watch dog recovery; 2: Rx MAC reset; 3: tx watch dog and rx MAC;
}
set_refDesignSepcific_dfs_settings={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x12b # REFDESIGNSPECIFIC_DFS_SETTINGS
Value:1=1 # 1 -- value;
}
clear_refDesignSepcific_dfs_settings={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x12b # REFDESIGNSPECIFIC_DFS_SETTINGS
Value:1=0 # 0 -- value;
}
get_refDesignSepcific_dfs_settings={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x12b # REFDESIGNSPECIFIC_DFS_SETTINGS
Value:1=0 # NA
}
#Trigger IMD3 calibration
imd3_cal_trigger={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x12C # IMD3 cal trigger
}
#Set A-MPDU density for MMSF
enable_mmsf={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x12D # MMSF WAR
MMSF:1=1 # 1 - enable MMSF; 0 - disable MMSF;
Density:1=0x30 # Do not change the value unless necessary
}
disable_mmsf={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x12D # MMSF WAR
MMSF:1=0 # 1 - enable MMSF; 0 - disable MMSF;
Density:1=0x30 # Do not change the value unless necessary
}
get_mmsf={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x12D # MMSF WAR
MMSF:1=0 # 1 -- enable MMSF; # 0 -- disable MMSF;
Density:1=0x00 #
}
#RSSI CAP for SR Rate Adaptation.
enable_rssi_cap={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x12E # Enable RSSI CAP
Value:1=0x1 # 1 -- ENABLE; 0 -- DISABLE
}
disable_rssi_cap={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x12E # Enable RSSI CAP
Value:1=0x0 # 1 -- ENABLE; 0 -- DISABLE
}
get_rssi_cap={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x12E # Enable RSSI CAP
Value:1=0 # NA
}
#Enable Tx Queue Size reported in HE SU QoS data packet
enable_qsz_rpt={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x12F # Tx Queue Size Report
QszRpt:1=1 # 1 - enable; 0 - disable;
}
disable_qsz_rpt={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x12F # Tx Queue Size Report
QszRpt:1=0 # 1 - enable; 0 - disable;
}
get_qsz_rpt={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x12F # Tx Queue Size Report
QszRpt:1=0 # N/A
}
#AMPDU MAX AIR TIME: [min, max] = [1504, 5484] us
set_max_air_time={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x130 # AMPDU MAX AIR TIME
Value:2=5400 # max air time in us
}
get_max_air_time={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x130 # AMPDU MAX AIR TIME
Value:2=0 # NA
}
#NEW DATA RATE DROP TABLE
set_rate_drop_table={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x133 # NEW DATA RATE DROP TABLE
Value:1=0x0 # 1: new table (default); 0: old table
}
get_rate_drop_table={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x133 # NEW DATA RATE DROP TABLE
Value:1=0 # NA
}
#CONFIG HE ER
#BASIC HE ER: HE ER without DCM or tone106
#DCM HE ER: Basic HE ER + HE ER with DCM
#TONE106 HE ER: Basic HE ER + HE ER with TONE 106
#DEFAULT HE ER: HE ER + HE ER with DCM or TONE 106.
config_he_er_basic={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x134 # CONFIG HE ER
BasicHeEr:1=1 # enable basic HE ER
DcmHeEr:1=0 # disable DCM for HE ER
Tone106HeEr:1=0 # disable tone106 for HE ER
}
config_he_er_dcm={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x134 # CONFIG HE ER
BasicHeEr:1=1 # enable basic HE ER
DcmHeEr:1=1 # enable DCM for HE ER
Tone106HeEr:1=0 # disable tone106 for HE ER
}
config_he_er_tone106={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x134 # CONFIG HE ER
BasicHeEr:1=1 # enable basic HE ER
DcmHeEr:1=0 # disable DCM for HE ER
Tone106HeEr:1=1 # enable tone106 for HE ER
}
config_he_er_all={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x134 # CONFIG HE ER
BasicHeEr:1=1 # enable basic HE ER
DcmHeEr:1=1 # enable DCM for HE ER
Tone106HeEr:1=1 # enable tone106 for HE ER
}
config_he_er_default={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x134 # CONFIG HE ER
BasicHeEr:1=0 # disable basic HE ER
DcmHeEr:1=1 # enable DCM for HE ER
Tone106HeEr:1=1 # enable tone106 for HE ER
}
get_he_er_config={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x134 # CONFIG HE ER
BasicHeER:1=0 # NA
HeErDcm:1=0 # NA
HeErTone106:1=0 # NA
}
#Have HT MCS0/Legacy 6 Mbps in the place of BASIC HE ER in 5G
#if BASIC HE ER is not supported by the peer.
#BASIC LG: HT MCS0/LG 6Mbps after HE20 MCS0
#DCM LG: BASIC LG + HE ER with DCM
#TONE106 LG: BASIC LG + HE ER with TONE 106
#DEFAULT: BASIC LG + HE ER with DCM or TONE 106.
config_he_lg_basic={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x134 # CONFIG HE ER
BasicHeEr:1=0 # enable basic HE ER
DcmHeEr:1=0 # disable DCM for HE ER
Tone106HeEr:1=0 # disable tone106 for HE ER
}
config_he_lg_dcm={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x134 # CONFIG HE ER
BasicHeEr:1=0 # enable basic HE ER
DcmHeEr:1=1 # enable DCM for HE ER
Tone106HeEr:1=0 # disable tone106 for HE ER
}
config_he_lg_tone106={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x134 # CONFIG HE ER
BasicHeEr:1=0 # enable basic HE ER
DcmHeEr:1=0 # disable DCM for HE ER
Tone106HeEr:1=1 # enable tone106 for HE ER
}
trigger_timeout={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x135 # Trigger Timeout
Value:1=1 # 1 - Wakeupcard Timeout; 2 - Tx Timeout
}
cm3_debugMon_handle={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x136 # CM3 debug monitor handle enable
enable:1=0x1 # 0 - Disable the exception (Clear breakpoint),
# 1 - enable the exception (set breakpoint)
recurring_bkpt:1=0x1 # 0 - bkpt will hit only once, 1 - bkpt can hit every time
# if it is 1, it ignores dump_gen_allow value
# This option is available only for data breakpoint
addr:4=0x90002114 # Code/data breakpoint Address
mask:4=0x0 # Mask (1 means that bit will be ignored)
# Please use mask as 0 only. If you use other than 0, it gives unpredictable result
add_size:1=0x2 # 0 - byte, 1 - half word, 2 - word (size for comparison)
bkpt_type:1=1 # 0 - Code, 1 - data
data_bkpt_cond:1=2 # 0 - read, 1 - write, 2 - read or write
data_bkpt_match_val_en:1=0 # 0 - match value will be ignored, 1 - match value will be compared
data_bkpt_match_val:4=0x0 # Value to be matched
dump_gen_allow:1=1 # 0 - don't generate dump, 1 - generate dump
bkpt_hit_cnt:4=0x0 # breakpoint hit count (do NOT change this line)
}
profiling_start={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x137 # CONFIG PROFILING
profiling_command:1=1 # start profiliing
}
profiling_stop={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x137 # CONFIG PROFILING
profiling_command:1=0 # stop profiliing
}
profiling_report={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x137 # CONFIG PROFILING
profiling_command:1=2 # report profiliing results
}
#Debug log
enable_debug_log={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x138 # Debug log
Value:1=1 # 1 -- enable
}
disable_debug_log={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x138 # Debug log
Value:1=0 # 0 -- disable
}
get_debug_log={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x138 # Debug log
Value:1=0 # NA
}
#on demand IQ cal and DPD re-trigger - To mimic / stress test temperature triggered IQ cal and DPD
trigger_runtime_cal_and_dpd={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x151 # trigger_runtime_cal follower by dpd on demand
Value:1=0 # 0;
}

View file

@ -0,0 +1,49 @@
#
# File: debug_ci_mode.conf
# C/I performance mode
#
ci_mode_get={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x110 # C/I performance mode
Value:1=0 # 1 - high sensitivity mode
# 2 - high linearity mode
# 3 - dynamic switch mode
}
ci_mode_set_hs={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x110 # C/I performance mode
Value:1=1 # 1 - high sensitivity mode
}
ci_mode_set_hl={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x110 # C/I performance mode
Value:1=2 # 2 - high linearity mode
}
ci_mode_set_ds={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x110 # C/I performance mode
Value:1=3 # 3 - dynamic switch mode
}
ci_s1_timer_get={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x123 # C/I dynamic switch S1_Timer
Value:1=0 # S1_Timer (default value is 10, about 5s)
}
ci_s1_timer_set={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x123 # C/I dynamic switch S1_Timer
Value:1=20 # S1_Timer (if value is 20, timer is about 10s)
}

View file

@ -0,0 +1,29 @@
# File : ed_mac_ctrl_V2_8897.conf
#
# ed_mac_ctrl_v2 is used for 88W8897, 88W8887, 88W8797, 88W8782, 88W8787
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V2_8897.conf ed_mac_ctrl_v2
#
## Set Energy Detect Threshold for EU Adaptivity test
ed_mac_ctrl_v2={
CmdCode=0x0130 #Command code, DO NOT change this line
ed_ctrl_2g.enable:2=0x1 # 0 - disable EU adaptivity for 2.4GHz band
# 1 - enable EU adaptivity for 2.4GHz band
ed_ctrl_2g.offset:2=0x0 # 0 - Default Energy Detect threshold
#offset value range: 0x80 to 0x7F
ed_ctrl_2g.on_period:2=0x12 #DO NOT Change this line
ed_ctrl_2g.off_period:2=0x0 #DO NOT Change this line
ed_ctrl_2g.bitmap:2=0x1 #DO NOT Change this line
ed_ctrl_5g.enable:2=0x1 # 0 - disable EU adaptivity for 5GHz band
# 1 - enable EU adaptivity for 5GHz band
ed_ctrl_5g.offset:2=0x4 # 0 - Default Energy Detect threshold
#offset value range: 0x80 to 0x7F
ed_ctrl_5g.on_period:2=0x12 #DO NOT Change this line
ed_ctrl_5g.off_period:2=0x0 #DO NOT Change this line
ed_ctrl_5g.bitmap:2=0x1 #DO NOT Change this line
}

View file

@ -0,0 +1,22 @@
# File : ed_mac_ctrl_V2_8997.conf
#
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V2_8997.conf ed_mac_ctrl_v2
#
## Set Energy Detect Threshold for EU Adaptivity test
ed_mac_ctrl_v2={
CmdCode=0x0130 #Command code, DO NOT change this line
ed_ctrl_2g.enable:2=0x1 # 0 - disable EU adaptivity for 2.4GHz band
# 1 - enable EU adaptivity for 2.4GHz band
ed_ctrl_2g.offset:2=0x0 # 0 - Default Energy Detect threshold
#offset value range: 0x80 to 0x7F
ed_ctrl_5g.enable:2=0x1 # 0 - disable EU adaptivity for 5GHz band
# 1 - enable EU adaptivity for 5GHz band
ed_ctrl_5g.offset:2=0x4 # 0 - Default Energy Detect threshold
#offset value range: 0x80 to 0x7F
ed_ctrl_txq_lock:4=0xFF #DO NOT Change this line
}

View file

@ -0,0 +1,29 @@
# File : ed_mac_ctrl_V2_909x.conf
#
# ed_mac_ctrl_v2 is used for 88W9098, 88W9097
# ./mlanutl mlan0 hostcmd config/ed_mac_ctrl_V2_909x.conf ed_mac_ctrl_v2
#
## Get/Set Energy Detect Threshold for EU Adaptivity test
# Command name for GET action: DO NOT change/add.
ed_mac_ctrl_v2_get={
CmdCode=0x0130 #Command code, DO NOT change this line
}
# Command name for SET action.
ed_mac_ctrl_v2={
CmdCode=0x0130 #Command code, DO NOT change this line
ed_ctrl_2g.enable:2=0x1 # 0 - disable EU adaptivity for 2.4GHz band
# 1 - enable EU adaptivity for 2.4GHz band
ed_ctrl_2g.offset:2=0x8 # 0 - Default Energy Detect threshold
#offset value range: 0x80 to 0x7F
ed_ctrl_5g.enable:2=0x1 # 0 - disable EU adaptivity for 5GHz band
# 1 - enable EU adaptivity for 5GHz band
ed_ctrl_5g.offset:2=0x8 # 0 - Default Energy Detect threshold
#offset value range: 0x80 to 0x7F
ed_ctrl_txq_lock:4=0x1e00FF #DO NOT Change this line
}

View file

@ -0,0 +1,120 @@
#
# File: ftm.conf
#
# Copyright 2022, 2025-2026 NXP
#
# NXP CONFIDENTIAL
# Copyright 2022, NXP .
# The source code contained or described herein and all documents related to
# the source code ("Material") are owned by NXP NXPor its
# suppliers or licensors. Title to the Material remains with NXP
# or its suppliers and licensors. The Material contains trade secrets and
# proprietary and confidential information of NXP or its suppliers and
# licensors. The Material is protected by worldwide copyright and trade secret
# laws and treaty provisions. No part of the Material may be used, copied,
# reproduced, modified, published, uploaded, posted, transmitted, distributed,
# or disclosed in any way without NXP's prior express written permission.
#
# No license under any patent, copyright, trade secret or other intellectual
# property right is granted to or conferred upon you by disclosure or delivery
# of the Materials, either expressly, by implication, inducement, estoppel or
# otherwise. Any license under such intellectual property rights must be
# express and approved by NXP in writing.
#################################################################################
# LOCATION configuration file
# Lines that start with # are treated as comments
# Each line should not exceed 80 characters
# Format: TYPE=value
#
#################################################################################
#################################################################################
DOT11MC_CFG={
# Indicates how many burst instances are requested for the FTM session
BURST_EXP=0
# Burst Duration
# 0 - 1: Reserved
# 2: 250 micro seconds
# 3: 500 micro seconds
# 4: 1 ms
# 5: 2 ms
# 6: 4 ms
# 7: 8 ms
# 8: 16 ms
# 9: 32 ms
# 10: 64 ms
# 11: 128 ms
# 12-14 reserved
BURST_DURATION=10
# Indicates minimum time between consecutive Fine Timing Measurement
# frames. It is specified in in units of 100 micro seconds.
MIN_DELTA=10
# ASAP
IS_ASAP=1
# FTM frames per burst
FTM_PER_BURST=10
# Bandwidth
# 9 - HT20
# 10 - VHT20
# 11 - HT40
# 12 - VHT40
# 13 - VHT80
BW=13
# Burst Period in units of 100 milli seconds
BURST_PERIOD=5
# Timeout in units of ms to receive RSTA's response to IFTM request (IFTMR)
# Default =10ms
# Note: For RSTA that take longer than 10ms to respond to IFTM request,negotiation timeout happens
# Adjust this value to be 10ms< & >256ms to avoid negotiation/burst timeouts
IFTM_TMO=10
}
LCI={
##### FOR LCI REQUEST #######
LATITIUDE=-33.8570095
LONGITUDE=+151.2152005
LATITUDE_UNCERTAINITY=18
LONGITUDE_UNCERTAINITY=18
ALTITUDE=11.2
ALTITUDE_UNCERTAINITY=15
}
CIVIC_LOC={
##### FOR CIVIC LOCATION #######
CIVIC_LOCATION_TYPE=1
COUNTRY_CODE=0 #US
CIVIC_ADDRESS_TYPE=22
ADDRESS="123, NXP India Pvt Ltd, Pune"
}
##### FOR FQDN support in ANQP frames #####
FQDN_SUPPORT=0
ANQP_DIALOG_TOKEN=1
CIVIC_LOCATION=1
LCI_REQUEST=1
##### FOR NEIGHBOR Request frames #####
NBOR_DIALOG_TOKEN=1
DOT11AZ_RANGING_CFG={
##### For FTM with NTB ranging #####
FORMAT_BW=0
# Maximum number of space-time streams to be used in DL/UL NDP frames in the session upto 80MHz
MAX_I2R_STS_UPTO80=0
MAX_R2I_STS_UPTO80=1
# Measurement freq in Hz to calculate measurement interval in ms. Recommended values ( 1-5 Hz )
# 1Hz = 1000ms ; 2Hz = 500ms ; 3Hz= 333ms ; 4Hz = 250ms ; 5Hz = 200ms
AZ_MEASUREMENT_FREQ=2
AZ_NUMBER_OF_MEASUREMENTS=6
I2R_LMR_FEEDBACK=0
}
#################################################################################

View file

@ -0,0 +1,11 @@
# File : hal_phy_cfg.conf
######################### HAL PHY PARAMETERS configuration ######################
# starts with a command name with parameters embedded inside
hal_phy_cfg={
11b_psd_mask_cfg=1 # 1: 11b_psd_mask_enable, 0: 11b_psd_mask_disable
}
######################### HAL PHY PARAMETERS configuration ######################

View file

@ -0,0 +1,22 @@
# File : host_tdls.conf
######################### HOST TDLS commands configuration ##################
# starts with a command name with parameters embedded inside
host_tdls_config={
uapsd_support=1 # 1: suport uapsd, 0: uapsd not support
cs_support=1 # 1: support channel switch, 0: don't support channel switch
SupportedChannels={
FirstChannelNo=1
NumberofSubBandChannels=11
# multiple instances of First Channel No, Number of SubBand Channels
}
SupportedRegulatoryClasses={
CurrentRegulatoryClass=1
NumofRegulatoryClasses=15
ListOfRegulatoryClasses=1,2,3,4,12,22,23,24,25,27,28,29,30,32,33
}
}
######################### HOST TDLS commands configuration ##################

View file

@ -0,0 +1,14 @@
# File : init_cfg.conf
# MAC address (interface: address)
mac_addr=mlan0: 00:50:43:20:12:34
mac_addr=mmlan0: 00:50:43:20:42:64
mac_addr=uap0: 00:50:43:20:12:35
mac_addr=muap0: 00:50:43:20:42:65
mac_addr=wfd0: 00:50:43:20:12:36
mac_addr=mwfd0: 00:40:43:20:42:66
# Register (type, offset, value)
# type 1:MAC/SOC, 2:BBP, 3:RF, 5:CAU
#wlan_reg=1,0xA794,0x55FF55FF

View file

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

View file

@ -0,0 +1,167 @@
# File : mef.conf
######################### MEF Configuration command ##################
mefcfg={
#Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
Criteria=2 # Unicast frames are received during hostsleepmode
NumEntries=1 # Number of activated MEF entries
#mef_entry_0: example filters to match TCP destination port 80 send by 192.168.0.88 pkt or magic pkt.
mef_entry_0={
#mode: bit0--hostsleep mode, bit1--non hostsleep mode
mode=1 # HostSleep mode
#action: 0--discard and not wake host, 1--discard and wake host 3--allow and wake host
action=3 # Allow and Wake host
filter_num=3 # Number of filter
#RPN only support "&&" and "||" operator,space can not be removed between operator.
RPN=Filter_0 && Filter_1 || Filter_2
#Byte comparison filter's type is 0x41,Decimal comparison filter's type is 0x42,
#Bit comparison filter's type is 0x43
#Filter_0 is decimal comparison filter, it always with type=0x42
#Decimal filter always has type, pattern, offset, numbyte 4 field
#Filter_0 will match rx pkt with TCP destination port 80
Filter_0={
type=0x42 # decimal comparison filter
pattern=80 # 80 is the decimal constant to be compared
offset=44 # 44 is the byte offset of the field in RX pkt to be compare
numbyte=2 # 2 is the number of bytes of the field
}
#Filter_1 is Byte comparison filter, it always with type=0x41
#Byte filter always has type, byte, repeat, offset 4 filed
#Filter_1 will match rx pkt send by IP address 192.168.0.88
Filter_1={
type=0x41 # Byte comparison filter
repeat=1 # 1 copies of 'c0:a8:00:58'
byte=c0:a8:00:58 # 'c0:a8:00:58' is the byte sequence constant with each byte
# in hex format, with ':' as delimiter between two byte.
offset=34 # 34 is the byte offset of the equal length field of rx'd pkt.
}
#Filter_2 is Magic packet, it will looking for 16 contiguous copies of '00:50:43:20:01:02' from
# the rx pkt's offset 14
Filter_2={
type=0x41 # Byte comparison filter
repeat=16 # 16 copies of '00:50:43:20:01:02'
byte=00:50:43:20:01:02 # '00:50:43:20:01:02' is the byte sequence constant
offset=14 # 14 is the byte offset of the equal length field of rx'd pkt.
}
}
}
#--------------------------examples for MEF filters--------------------------------
# example: filters to match ARP packet with protocol addr 192.168.0.104
# mef_entry_0={
# mode=1 # HostSleep mode
# action=3 # Allow and Wake host
# filter_num=3 # Number of filter
# RPN=Filter_0 && Filter_1 && Filter_2
# #Filter_0 looking for rx pkt with DA is broadcast address
# Filter_0={
# type=0x41
# repeat=6
# byte=ff
# offset=0
# }
# #Filter_1 looking for rx pkt with EtherType is 0x0806(ARP)
# Filter_1={
# type=0x41
# repeat=1
# byte=08:06
# offset=20
# }
# #Filter_2 looking for rx pkt with ARP target protocol addr 192.168.0.104
# Filter_2={
# type=0x41
# repeat=1
# byte=c0:a8:00:68
# offset=46
# }
# }
#-------------------------------------------------------------------------------------
# example: filter to check if the destination MAC address is unicast pkt
# mef_entry_0={
# mode=1 # HostSleep mode
# action=3 # Allow and Wake host
# filter_num=3 # Number of filter
# RPN=Filter_0
# #Filter_0 is Bit comparison filter, it always with type=0x43
# #Byte filter always has type, byte, mask, offset 4 filed
# #"byte" is the byte sequence constant with each byte in hex format, with ':' as delimiter between two byte
# #"mask" is also with each byte in hex format, with ':' as delimiter between two byte
# #"byte" should has the same length as "mask"
# #Filter_0 will check if the destination MAC address is unicast pkt
# Filter_0={
# type=0x43 #Bit comparison filter
# byte=00 #00 is the 1-byte sequence constant
# offset=0 #0 is the byte offset of the rx pkt
# mask=01 #1 is the 1-byte mask
# }
# }
#--------------------------------------------------------------------------------------------------
# example: Disable MEF filters
# mefcfg={
# #Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
# Criteria=2 # Unicast frames are received during hostsleepmode
# NumEntries=0 # Number of activated MEF entries
# }
#--------------------------------------------------------------------------------------------------
# example: Test MEF filters
# mefcfg={
# Criteria=1
# NumEntries=1
# mef_entry_0={
# mode=4 # Test Mode
# action=16 # Invoke Test
# filter_num=0
# }
# }
#-----------------------------------------------------------------------------------------------------
# example: Test MEF filters
# mefcfg={
# Criteria=1
# NumEntries=1
# mef_entry_0={
# mode=4
# action=0
# filter_num=1
# RPN=Filter_0
# Filter_0={
# type=0x44 # test filter
# repeat=2 # 2 copies of 'BE:EF'
# byte=BE:EF # 'BE:EF' is the byte sequence constant
# offset=18 # 18 is the byte offset of the equal length field of rx'd pkt.
# dest=00:50:43:20:5a:82 # '00:50:43:20:5a:82' is the byte sequence constant
# }
# }
# }
#----------------------------------------------------------------------------------------------------
#example: Filter broadcast/ipv4 multicast/ipv6 multicast packets in non hostsleep mode
#mefcfg={
# Criteria=9 # broadcast and multicast frames
# NumEntries=1 # Number of activated MEF entries
# mef_entry_0={
# mode=2 # non HostSleep mode
# action=0 # discard and not wake host
# filter_num=3 # Number of filter
# RPN=Filter_0 || Filter_1 || Filter_2
# Filter_0={ # IPV4 multicast
# type=0x41 # byte comparison filter
# byte=01:00:5e # 01:00:5e is the byte constant to be compared
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
# repeat=1 #
# }
# Filter_1={ # broadcast packet check
# type=0x41 # Byte comparison filter
# repeat=6 # 6 copies of 'ff', means broadcast
# byte=ff # 'ff'(0xff) is the byte sequence constant with each byte
# # in hex format, with ':' as delimiter between two byte.
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
# }
# Filter_2={ # IPV6 multicast
# type=0x41 # byte comparison filter
# byte=33:33 # 33:33 is the byte constant to be compared
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
# repeat=1 #
# }
# }
#}
#------------------------------------------------------------------------------------------------------

View file

@ -0,0 +1,204 @@
# File : mef_mdns.conf
######################### MEF Configuration command ##################
mefcfg={
#Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
Criteria=8 # Multicast frames are received during hostsleepmode
NumEntries=2 # Number of activated MEF entries
#mef_entry_0: example filters to match WS-Discovery pkt for IPv4.
mef_entry_0={
#mode: bit0--hostsleep mode, bit1--non hostsleep mode
mode=1 # HostSleep mode
#action: 0--discard and not wake host, 1--discard and wake host 3--allow and wake host
action=3 # Allow and Wake host
filter_num=4 # Number of filter
#RPN only support "&&" and "||" operator,space can not be removed between operator.
RPN=Filter_0 && Filter_1 && Filter_2 && Filter_3
#Filter_0 will match IPv4 protocol packet
Filter_0={
type=0x41
repeat=1
byte=08:00
offset=20
}
#Filter_1 will match dest multicast IPv4 address 224.0.0.251
Filter_1={
type=0x41
repeat=1
byte=e0:00:00:fb
offset=38
}
#Filter_2 will match UDP packet
Filter_2={
type=0x42
pattern=17
offset=31
numbyte=1
}
#Filter_3 will match UDP port 5353
Filter_3={
type=0x42
pattern=5353
offset=44
numbyte=2
}
}
#mef_entry_1: example filters to match WS-Discovery pkt for IPv6.
mef_entry_1={
#mode: bit0--hostsleep mode, bit1--non hostsleep mode
mode=1 # HostSleep mode
#action: 0--discard and not wake host, 1--discard and wake host 3--allow and wake host
action=3 # Allow and Wake host
filter_num=4 # Number of filter
#RPN only support "&&" and "||" operator,space can not be removed between operator.
RPN=Filter_0 && Filter_1 && Filter_2 && Filter_3
#Filter_0 will match IPv4 protocol packet
Filter_0={
type=0x41
repeat=1
byte=86:dd
offset=20
}
#Filter_1 will match dest multicast IPv6 address FF02::FB
Filter_1={
type=0x41
repeat=1
byte=ff:02:00:00:00:00:00:00:00:00:00:00:00:00:00:fb
offset=46
}
#Filter_2 will match UDP packet
Filter_2={
type=0x42
pattern=17
offset=28
numbyte=1
}
#Filter_3 will match UDP port 5353
Filter_3={
type=0x42
pattern=5353
offset=64
numbyte=2
}
}
}
#--------------------------examples for MEF filters--------------------------------
# example: filters to match ARP packet with protocol addr 192.168.0.104
# mef_entry_0={
# mode=1 # HostSleep mode
# action=3 # Allow and Wake host
# filter_num=3 # Number of filter
# RPN=Filter_0 && Filter_1 && Filter_2
# #Filter_0 looking for rx pkt with DA is broadcast address
# Filter_0={
# type=0x41
# repeat=6
# byte=ff
# offset=0
# }
# #Filter_1 looking for rx pkt with EtherType is 0x0806(ARP)
# Filter_1={
# type=0x41
# repeat=1
# byte=08:06
# offset=20
# }
# #Filter_2 looking for rx pkt with ARP target protocol addr 192.168.0.104
# Filter_2={
# type=0x41
# repeat=1
# byte=c0:a8:00:68
# offset=46
# }
# }
#-------------------------------------------------------------------------------------
# example: filter to check if the destination MAC address is unicast pkt
# mef_entry_0={
# mode=1 # HostSleep mode
# action=3 # Allow and Wake host
# filter_num=3 # Number of filter
# RPN=Filter_0
# #Filter_0 is Bit comparison filter, it always with type=0x43
# #Byte filter always has type, byte, mask, offset 4 filed
# #"byte" is the byte sequence constant with each byte in hex format, with ':' as delimiter between two byte
# #"mask" is also with each byte in hex format, with ':' as delimiter between two byte
# #"byte" should has the same length as "mask"
# #Filter_0 will check if the destination MAC address is unicast pkt
# Filter_0={
# type=0x43 #Bit comparison filter
# byte=00 #00 is the 1-byte sequence constant
# offset=0 #0 is the byte offset of the rx pkt
# mask=01 #1 is the 1-byte mask
# }
# }
#--------------------------------------------------------------------------------------------------
# example: Disable MEF filters
# mefcfg={
# #Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
# Criteria=2 # Unicast frames are received during hostsleepmode
# NumEntries=0 # Number of activated MEF entries
# }
#--------------------------------------------------------------------------------------------------
# example: Test MEF filters
# mefcfg={
# Criteria=1
# NumEntries=1
# mef_entry_0={
# mode=4 # Test Mode
# action=16 # Invoke Test
# filter_num=0
# }
# }
#-----------------------------------------------------------------------------------------------------
# example: Test MEF filters
# mefcfg={
# Criteria=1
# NumEntries=1
# mef_entry_0={
# mode=4
# action=0
# filter_num=1
# RPN=Filter_0
# Filter_0={
# type=0x44 # test filter
# repeat=2 # 2 copies of 'BE:EF'
# byte=BE:EF # 'BE:EF' is the byte sequence constant
# offset=18 # 18 is the byte offset of the equal length field of rx'd pkt.
# dest=00:50:43:20:5a:82 # '00:50:43:20:5a:82' is the byte sequence constant
# }
# }
# }
#----------------------------------------------------------------------------------------------------
#example: Filter broadcast/ipv4 multicast/ipv6 multicast packets in non hostsleep mode
#mefcfg={
# Criteria=9 # broadcast and multicast frames
# NumEntries=1 # Number of activated MEF entries
# mef_entry_0={
# mode=2 # non HostSleep mode
# action=0 # discard and not wake host
# filter_num=3 # Number of filter
# RPN=Filter_0 || Filter_1 || Filter_2
# Filter_0={ # IPV4 multicast
# type=0x41 # byte comparison filter
# byte=01:00:5e # 01:00:5e is the byte constant to be compared
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
# repeat=1 #
# }
# Filter_1={ # broadcast packet check
# type=0x41 # Byte comparison filter
# repeat=6 # 6 copies of 'ff', means broadcast
# byte=ff # 'ff'(0xff) is the byte sequence constant with each byte
# # in hex format, with ':' as delimiter between two byte.
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
# }
# Filter_2={ # IPV6 multicast
# type=0x41 # byte comparison filter
# byte=33:33 # 33:33 is the byte constant to be compared
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
# repeat=1 #
# }
# }
#}
#------------------------------------------------------------------------------------------------------

View file

@ -0,0 +1,204 @@
# File : mef_ws_discovery.conf
######################### MEF Configuration command ##################
mefcfg={
#Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
Criteria=8 # Multicast frames are received during hostsleepmode
NumEntries=2 # Number of activated MEF entries
#mef_entry_0: example filters to match WS-Discovery pkt for IPv4.
mef_entry_0={
#mode: bit0--hostsleep mode, bit1--non hostsleep mode
mode=1 # HostSleep mode
#action: 0--discard and not wake host, 1--discard and wake host 3--allow and wake host
action=3 # Allow and Wake host
filter_num=4 # Number of filter
#RPN only support "&&" and "||" operator,space can not be removed between operator.
RPN=Filter_0 && Filter_1 && Filter_2 && Filter_3
#Filter_0 will match IPv4 protocol packet
Filter_0={
type=0x41
repeat=1
byte=08:00
offset=20
}
#Filter_1 will match dest multicast IPv4 address 239.255.255.250
Filter_1={
type=0x41
repeat=1
byte=ef:ff:ff:fa
offset=38
}
#Filter_2 will match UDP packet
Filter_2={
type=0x42
pattern=17
offset=31
numbyte=1
}
#Filter_3 will match UDP port 3702
Filter_3={
type=0x42
pattern=3702
offset=44
numbyte=2
}
}
#mef_entry_1: example filters to match WS-Discovery pkt for IPv6.
mef_entry_1={
#mode: bit0--hostsleep mode, bit1--non hostsleep mode
mode=1 # HostSleep mode
#action: 0--discard and not wake host, 1--discard and wake host 3--allow and wake host
action=3 # Allow and Wake host
filter_num=4 # Number of filter
#RPN only support "&&" and "||" operator,space can not be removed between operator.
RPN=Filter_0 && Filter_1 && Filter_2 && Filter_3
#Filter_0 will match IPv4 protocol packet
Filter_0={
type=0x41
repeat=1
byte=86:dd
offset=20
}
#Filter_1 will match dest multicast IPv6 address FF02::C
Filter_1={
type=0x41
repeat=1
byte=ff:02:00:00:00:00:00:00:00:00:00:00:00:00:00:0c
offset=46
}
#Filter_2 will match UDP packet
Filter_2={
type=0x42
pattern=17
offset=28
numbyte=1
}
#Filter_3 will match UDP port 3702
Filter_3={
type=0x42
pattern=3702
offset=64
numbyte=2
}
}
}
#--------------------------examples for MEF filters--------------------------------
# example: filters to match ARP packet with protocol addr 192.168.0.104
# mef_entry_0={
# mode=1 # HostSleep mode
# action=3 # Allow and Wake host
# filter_num=3 # Number of filter
# RPN=Filter_0 && Filter_1 && Filter_2
# #Filter_0 looking for rx pkt with DA is broadcast address
# Filter_0={
# type=0x41
# repeat=6
# byte=ff
# offset=0
# }
# #Filter_1 looking for rx pkt with EtherType is 0x0806(ARP)
# Filter_1={
# type=0x41
# repeat=1
# byte=08:06
# offset=20
# }
# #Filter_2 looking for rx pkt with ARP target protocol addr 192.168.0.104
# Filter_2={
# type=0x41
# repeat=1
# byte=c0:a8:00:68
# offset=46
# }
# }
#-------------------------------------------------------------------------------------
# example: filter to check if the destination MAC address is unicast pkt
# mef_entry_0={
# mode=1 # HostSleep mode
# action=3 # Allow and Wake host
# filter_num=3 # Number of filter
# RPN=Filter_0
# #Filter_0 is Bit comparison filter, it always with type=0x43
# #Byte filter always has type, byte, mask, offset 4 filed
# #"byte" is the byte sequence constant with each byte in hex format, with ':' as delimiter between two byte
# #"mask" is also with each byte in hex format, with ':' as delimiter between two byte
# #"byte" should has the same length as "mask"
# #Filter_0 will check if the destination MAC address is unicast pkt
# Filter_0={
# type=0x43 #Bit comparison filter
# byte=00 #00 is the 1-byte sequence constant
# offset=0 #0 is the byte offset of the rx pkt
# mask=01 #1 is the 1-byte mask
# }
# }
#--------------------------------------------------------------------------------------------------
# example: Disable MEF filters
# mefcfg={
# #Criteria: bit0-broadcast, bit1-unicast, bit3-multicast
# Criteria=2 # Unicast frames are received during hostsleepmode
# NumEntries=0 # Number of activated MEF entries
# }
#--------------------------------------------------------------------------------------------------
# example: Test MEF filters
# mefcfg={
# Criteria=1
# NumEntries=1
# mef_entry_0={
# mode=4 # Test Mode
# action=16 # Invoke Test
# filter_num=0
# }
# }
#-----------------------------------------------------------------------------------------------------
# example: Test MEF filters
# mefcfg={
# Criteria=1
# NumEntries=1
# mef_entry_0={
# mode=4
# action=0
# filter_num=1
# RPN=Filter_0
# Filter_0={
# type=0x44 # test filter
# repeat=2 # 2 copies of 'BE:EF'
# byte=BE:EF # 'BE:EF' is the byte sequence constant
# offset=18 # 18 is the byte offset of the equal length field of rx'd pkt.
# dest=00:50:43:20:5a:82 # '00:50:43:20:5a:82' is the byte sequence constant
# }
# }
# }
#----------------------------------------------------------------------------------------------------
#example: Filter broadcast/ipv4 multicast/ipv6 multicast packets in non hostsleep mode
#mefcfg={
# Criteria=9 # broadcast and multicast frames
# NumEntries=1 # Number of activated MEF entries
# mef_entry_0={
# mode=2 # non HostSleep mode
# action=0 # discard and not wake host
# filter_num=3 # Number of filter
# RPN=Filter_0 || Filter_1 || Filter_2
# Filter_0={ # IPV4 multicast
# type=0x41 # byte comparison filter
# byte=01:00:5e # 01:00:5e is the byte constant to be compared
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
# repeat=1 #
# }
# Filter_1={ # broadcast packet check
# type=0x41 # Byte comparison filter
# repeat=6 # 6 copies of 'ff', means broadcast
# byte=ff # 'ff'(0xff) is the byte sequence constant with each byte
# # in hex format, with ':' as delimiter between two byte.
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
# }
# Filter_2={ # IPV6 multicast
# type=0x41 # byte comparison filter
# byte=33:33 # 33:33 is the byte constant to be compared
# offset=0 # 0 is the byte offset of the equal length field of rx'd pkt.
# repeat=1 #
# }
# }
#}
#------------------------------------------------------------------------------------------------------

View file

@ -0,0 +1,17 @@
#File : memory/register update
# memory/register update file
mem_set={
CmdCode=0x0086 #do NOT change this line
Action:2=1 # 1 - SET
Rsrvd:2=0
Addr:4=0x8000a584 # memory/register address
Value:4=0x16161669 #Value
}
mem_get={
CmdCode=0x0086 #do NOT change this line
Action:2=0 # 1 - SET
Rsrvd:2=0
Addr:4=0x8000a584 # memory/register address
Result:4=0
}

View file

@ -0,0 +1,30 @@
# Format of the packet data to be sent.
# Update the TxControl value for TxPD, else zero is sent.
# all packet data is written under "Data" block
PktType=0x00 # should be zero for MGMT frames
PktSubType=0x05
# Assoc Request 0
# Assoc Response 1
# Re-Assoc Request 2
# Re-Assoc Response 3
# Probe Request 4
# Probe Response 5
# Beacon 8
# Atim 9
# Dis-assoc 10
# Auth 11
# Deauth 12
# Action Frame 13
FromDS=0
ToDS=0
Addr1=00:50:43:27:B0:41 # Destination address
Addr2=00:50:43:21:0F:84 # Source address
Addr3=00:50:43:21:0F:84 # BSSID
Data=0x01,0x01,0x00,0x0c,0x00,0x58,0x02,0x40
SeqNum=0
FragNum=0

View file

@ -0,0 +1,15 @@
##############management frame filter to wake up host ###########
##### support two entries currently ######
mgmtfilter={
entry_num=1
entry_0={
action=1 # discard and wakeup host
type=0x1 # p2p frames
frame_mask=0x7 # Go neg req & rsp & cfm frame
}
# entry_1={
# action=0 # discard and not wakeup host
# type=0xff # management frames
# frame_mask=0x3 # assoc req & rsp frame
# }
}

View file

@ -0,0 +1,40 @@
# auto send qos null data packet
qos_null_tx={
CmdCode=0x0082 # do NOT change this line
Action:2=1 # do NOT change this line
AutoTxTlvType:2=0x0118 # do NOT change this line
AutoTxTlvLength:2={ # do NOT change this line
Interval:2=0x8064 # bit15:14 unit: 00-s 01-us 10-ms 11-one_shot bit13-0: interval
Priority:1=0x27 # bit7-4: bandwidth. bit3-0: priority, ignored if non-WMM
Index:1=0 # packet index. Valid 0-15
FrameLength:2={ # do NOT change this line
DestMacAddr:6='0xc0,0x56,0x27,0xd6,0x2e,0x3c' # Peer's MAC address
SrcMacAddr:6='0x00,0x00,0x00,0x00,0x00,0x00' # do NOT change this line
Length:2='0x00,0x00' # do NOT change this line
}
}
}
# stop auto send qos null data packet
qos_null_tx_stop={
CmdCode=0x0082 # do NOT change this line
Action:2=1 # do NOT change this line
}
# send qos null data packet one time only
qos_null_one_shot={
CmdCode=0x0082 # do NOT change this line
Action:2=1 # do NOT change this line
AutoTxTlvType:2=0x0118 # do NOT change this line
AutoTxTlvLength:2={ # do NOT change this line
Interval:2=0xc064 # bit15:14 unit: 00-s 01-us 10-ms 11-one_shot bit13-0: interval
Priority:1=0x27 # bit7-4: bandwidth. bit3-0: priority, ignored if non-WMM
Index:1=0 # packet index. Valid 0-15
FrameLength:2={ # do NOT change this line
DestMacAddr:6='0xc0,0x56,0x27,0xd6,0x2e,0x3c' # Peer's MAC address
SrcMacAddr:6='0x00,0x00,0x00,0x00,0x00,0x00' # do NOT change this line
Length:2='0x00,0x00' # do NOT change this line
}
}
}

View file

@ -0,0 +1,7 @@
07 01 03 3A 80 00 3A 00 ff ff 00 17 03 00 07 03
09 00 0e 10 16 02 19 25 1a 04 1c ff 32 5e 33 15
35 29 36 17 4b 74 4c 64 4d 3b 50 27 61 d6 62 98
6b ae 6f 5b 77 f2 79 ff 7f 2d
07 01 12 16 c0 00 ff ff ff ff 00 05 03 10 32 5c
33 1a 6b a2 7f 20

View file

@ -0,0 +1,29 @@
# File : pad_cfg.conf
## Get CFG data for PAD OR
pad_cfg_get={
CmdCode=0x008f # do NOT change this line
Action:2=0 # 0 - GET
Type:2=5 # 5 - optimized pad reg
CfgLen:2={
}
}
## Set CFG data for PAD OR
#pad_cfg_set={
# CmdCode=0x008f # do NOT change this line
# Action:2=1 # 1 - SET
# Type:2=5 # 5 - optimized pad reg
# CfgLen:2={ # 9 entries for W8787
# CFG1:4=0x00000000 # SDIO in sleep
# CFG2:4=0x55550004 # GPIO in sleep
# CFG3:4=0x00000001
# CFG4:4=0x00000000 # RFCTRL in sleep
# CFG5:4=0x00000000
# CFG6:4=0x0E001800 # GPIO/RFCTRL in power down
# CFG7:4=0x249A0000
# CFG8:4=0x000000D2
# CFG9:4=0x00000000
# }
#}

View file

@ -0,0 +1,62 @@
# File : coalesce_cfg.conf
######################### coalesce_cfg command configuration ##################
coalesce_cfg={
CmdCode=0x010a # do NOT change this line
#Action
Action:2=1
#NumRules: Number of rules
NumRules:2=1
RuleTlvType:2=0x019a
RuleTlvLength:2={
#Number of filter fields, up to 4 entries
NumFilterField:1=2
#Packet type
PktType:1=1
#Max coalescing delay
MaxDelay:2=400
# Dest MAC address: 00:50:43:21:53:7A
#First filter field
#Operation: 0x80 equal or 0x81 no equal
Operation:1=0x80
#Compare bytes length, up to 4 bytes
OperandLen:1=0x04
#Offset from incoming MAC packet
Offset:2=8
#Operand bytes stream
Bytes:4='0x43,0x21,0x53,0x7a'
#Second filter field
Operation:1=0x80
OperandLen:1=0x02
Offset:2=6
Bytes:4='0x00,0x50,0x00,0x00'
#Third filter field
#Operation:1=0x80
#OperandLen:1=0x02
#Offset:2=34
#Bytes:4='0xc0,0xa8,0x00,0x58'
#Fourth filter field
#Operation:1=0x80
#OperandLen:1=0x02
#Offset:2=34
#Bytes:4='0xc0,0xa8,0x00,0x58'
}
}
##### Sample coalesce_cfg command configuration to reset all the previous rules #####
#coalesce_cfg={
# CmdCode=0x010a # do NOT change this line
# #NumRules: Number of rules
# NumRules:2=0
#}
######################### End of coalesce_cfg command configuration ##################

View file

@ -0,0 +1,15 @@
# File : requesttpc.conf
######################### requesttpc command configuration ##################
requesttpc={
CmdCode=0x0060 # do NOT change this line
#DestMac: Destination STA address
DestMac:6='0x02,0x04,0x0e,0x06,0x01,0x12'
#RateIndex: IEEE Rate index to send request
RateIndex:1=22
#Timeout: Response timeout in ms
Timeout:2=10
}
######################### End of requesttpc command configuration ##################

View file

@ -0,0 +1,323 @@
# File : robust_btc.conf
######################### Robust Coex command ###############
mode_get={
CmdCode=0x00e0 # do NOT change this line
Action:2=0 # GET
RSVD:2=0
# Robust Coex Mode TLV
RobustCoexTlvType:2=0x0160
RobustCoexTlvLength:2={
Enable:1=0x00 # Read-back Coex mode(s)
Reserved:3=0
}
}
mode_timeshare={
CmdCode=0x00e0 # do NOT change this line
Action:2=1 # SET
RSVD:2=0
# Robust Coex Mode TLV
RobustCoexTlvType:2=0x0160
RobustCoexTlvLength:2={
# All the modes below are mutually exclusive of each other;
Enable:1=0x01 # Bit0: Enable 2x2 or 1x1 Time Distribute(TMD)
# Robust Coex(RBC) mode, when uAP bss start,
# uAP TMD RBC scheme is enabled,
# STA TMD RBC scheme is disabled.
Reserved:3=0
}
}
mode_spatial={
CmdCode=0x00e0 # do NOT change this line
Action:2=1 # SET
RSVD:2=0
# Robust Coex Mode TLV
RobustCoexTlvType:2=0x0160
RobustCoexTlvLength:2={
# All the modes below are mutually exclusive of each other;
Enable:1=0x82 # Bit1: Enable 1x1 SMPS Spatial RBC Mode, e.g. 0x02
# Bit7: Enable uAP+STA SMPS RBC Mode,
# when uAP bss start, uAP SMPS RBC scheme enable,
# must combined with BIT1 or BIT2, e.g. 0x82, 0x84.
Reserved:3=0
}
}
mode_none={
CmdCode=0x00e0 # do NOT change this line
Action:2=1 # SET
RSVD:2=0
# Robust Coex Mode TLV
RobustCoexTlvType:2=0x0160
RobustCoexTlvLength:2={
Enable:1=0 # Concurrent Coex mode. Used for chips which has
# separate antenna for BT
Reserved:3=0
}
}
mode_bca={
CmdCode=0x00e0 # do NOT change this line
Action:2=1 # SET
RSVD:2=0
# Robust Coex Mode TLV
RobustCoexTlvType:2=0x0160
RobustCoexTlvLength:2={
Enable:1=0x08 # BCA Coex mode.
# Pure HW BCA based WLAN and BT traffic arbitration.
Reserved:3=0
}
}
mode_2={
CmdCode=0x00e0 # do NOT change this line
Action:2=1 # SET
RSVD:2=0
# Robust Coex Mode TLV
RobustCoexTlvType:2=0x0160
RobustCoexTlvLength:2={
Enable:1=0x20 # Concurrent Coex mode with Tx power control and Rx De-sense.
# Used for chips which has separate antenna for BT
Reserved:3=0
}
}
gpio_cfg={
CmdCode=0x00e0 # do NOT change this line
Action:2=1 # SET
RSVD:2=0
# Robust Coex Mode TLV
RobustCoexTlvType:2=0x021B
RobustCoexTlvLength:2={
Enable:1=0x1 # enable GPIO cfg for external bt request
gpionum:1=4 # gpio 4
gpiopolarity:1=1 # Polarity High
}
}
external_coex_config={
CmdCode=0x00e0
Action:2=1 //0x0 get, 0x1 set
RSVD:2=0
RobustCoexTlvType:2=0x0238 //TLV ID
RobustCoexTlvLength:2={
Enabled:1=0x01 // 0x00 disable, 0x01 enable
ExtHighInputPriority:1=0x02 // Input priority: 0x00 Input Low Priority, 0x01 Input Medium Priority, 0x02 Input High Priority
ExtLowInputPriority:1=0x02
ExtPriGPIONum:1=0x06; // Input Priority signal GPIO pin number
ExtPriGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High
ExtReqGPIONum:1=0x07; // Input Request signal GPIO pin number
ExtReqGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High
ExtGrntGPIONum:1=0x05; // Output Grant signal GPIO pin number
ExtGrntGPIOPolarity:1=0x01; // Polarity: 0x00 Active Low, 0x01 Active High
}
}
external_coex_uwb_config={
CmdCode=0x00e0
Action:2=1 # 0x0 get, 0x1 set
RSVD:2=0
RobustCoexTlvType:2=0x0238 # TLV ID
RobustCoexTlvLength:2={
Enabled:1=0x03 # 0x03 to configure UWB
}
}
external_coex_config_2={
CmdCode=0x00e0
Action:2=1 //0x0 get, 0x1 set
RSVD:2=0
RobustCoexTlvType:2=0x0238 //TLV ID
RobustCoexTlvLength:2={
Enabled:1=0x02 // 0x00 disable, 0x02 enable (KF2, Fixed GPIO external COEX)
ExtHighInputPriority:1=0x02 // Input priority: 0x00 Input Low Priority, 0x01 Input Medium Priority, 0x02 Input High Priority
ExtLowInputPriority:1=0x02
}
}
external_coex_uart_config={
CmdCode=0x00e0
Action:2=1 //0x0 get, 0x1 set
RSVD:2=0
RobustCoexTlvType:2=0x0238 //TLV ID
RobustCoexTlvLength:2={
Enabled:1=0x04 // 0x00 disable, 0x04: UART enable
Loopback:1=0x00 // 0x00 Loopback disable, 0x01 Loopback enable 0x02 UARTGPIO, 0x06 Get LTE Stats, 0x05 Clear LTE stats
BaudRate:4=4000000 // UART Baud Rate, 4000000: 4M baudrate, 3000000 = 3M baudrate
}
}
external_coex_pta_config={
CmdCode=0x00e0
Action:2=1 // 0x0 get, 0x1 set
RSVD:2=0
RobustCoexTlvType:2=0x0238 // TLV ID
RobustCoexTlvLength:2={
Enabled:1=0x05 // 0x05 Select PTA interface, 0x06 Select WCI-2 interface
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)
}
}
external_coex_uart_gpio_config={
CmdCode=0x00e0
Action:2=1 // 0x0 get, 0x1 set
RSVD:2=0
RobustCoexTlvType:2=0x0238 // TLV ID
RobustCoexTlvLength:2={
Enabled:1=0x07 // 0x00 disable, 0x07 enable UART + GPIO feature
ExtCoexHwIntWci2:1=0x01 // 0x00 disable, 0x01 enable(coex uart 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
}
}
#Single Antenna Duty Cycle
#Time for 15.4 acitvity is set as Ieee154Duration
#Time for Duty cycle duration is set as TotalDuration
single_ant_duty_cycle={
CmdCode=0x00e0
Action:2=1
RSVD:2=0
RobustCoexTlvType:2=0x0390
RobustCoexTlvLength:2={
Enable:2=0x02 # Enable = 0x1 generic time, 0x02 Enable Duty cycle
Ieee154Duration:2=10 # (10ms) Enter value in Units (1Unit = 1ms), time for 15.4 activity within TotalDuration
TotalDuration:2=21 # (21ms) Enter value in Units (1Unit = 1ms), total duty cycle time, must be <= 100
}
}
#Dual Antenna Duty Cycle
#Time for 15.4 acitvity is set as Ieee154Duration
#Time for Duty cycle duration is set as TotalDuration
#Time for 15.4 far range activity is as Ieee154FarRangeDuration. Is in-addition to TotalDuration.
dual_ant_duty_cycle={
CmdCode=0x00e0
Action:2=1
RSVD:2=0
RobustCoexTlvType:2=0x0390
RobustCoexTlvLength:2={
Enable:2=0x02 # Enable:0x1 generic time, 0x02 Enable Dutycycle
Ieee154Duration:2=100 # (100ms) Enter value in Units (1Unit = 1ms), should be than TotalTime
TotalDuration:2=240 # (240ms) Enter value in Units (1Unit = 1ms), TotalTime must be <= 160
Ieee154FarRangeDuration:2=60 # (60ms) Enter value in Units (1Unit = 1ms)
}
}
#In Station A2DP case
#BT time is set as BTTime
#Wlan time is set as Wlan Time
a2dptime={
CmdCode=0x00e0
Action:2=1
RSVD:2=0
RobustCoexTlvType:2=0x0391
RobustCoexTlvLength:2={
Enable:2=0x01
BtTime:2=10000 #(10ms) BTTime must be less than 65535
WlanTime:2=39500 #(39.5ms) WlanTime must be less than 65535
}
}
#In Station inquiry case
#BT time is set as BTTime
#Wlan time is set as Wlan Time
inquirytime={
CmdCode=0x00e0
Action:2=1
RSVD:2=0
RobustCoexTlvType:2=0x0392
RobustCoexTlvLength:2={
Enable:2=0x01
BtTime:2=21215 #(21.215ms) BTTime must be less than 65535
WlanTime:2=11000 #(11ms) WlanTime must be less than 65535
}
}
#In Ap generic case
#BT time is BTTimeBusy when BT has traffic
#BT time is BTTimeIdle when BT is idle
#Wlan time is WlanTimeBusy when Wlan has traffic
#Wlan time is WlanTimeIdle when Wlan is idle
ap_generictime={
CmdCode=0x00e0
Action:2=1
RSVD:2=0
RobustCoexTlvType:2=0x0393
RobustCoexTlvLength:2={
Enable:2=0x01
BtTime_MAX:2=23000 #(23ms) BTTime(BT Busy) must be less than 28767
BtTime_MIN:2=6500 #(6.5ms) BTTime(BT Idle) must be less than 28767
WlanTime_MAX:2=18000 #(18ms) WlanTime(Wlan Busy) must be less than 32767
WlanTime_MIN:2=5750 #(5.75ms) WlanTime(Wlan Idle) must be less than 32767
}
}
#In Ap A2DP case
#BT time is change from BTTimeMax to BTTimeMin
#Wlan time is change from WlanTimeMax to WlanTimeMin
ap_a2dptime={
CmdCode=0x00e0
Action:2=1
RSVD:2=0
RobustCoexTlvType:2=0x0394
RobustCoexTlvLength:2={
Enable:2=0x01
BtTimebusy:2=23000 #(23ms) Maximum BTTime must be less than 32767
BtTimeidle:2=6500 #(6.5ms) Minimum BTTime must be less than 32767
WlanTimebusy:2=18000 #(18ms) Maximum WlanTime must be less than 32767
WlanTimeidle:2=5750 #(5.75ms) Minimum WlanTime must be less than 32767
}
}
#In Ap inquiry case
#BT time is set as BTTime
#Wlan time is set as Wlan Time
ap_inquirytime={
CmdCode=0x00e0
Action:2=1
RSVD:2=0
RobustCoexTlvType:2=0x0395
RobustCoexTlvLength:2={
Enable:2=0x01
BtTime:2=28750 #(28.75ms) BTTime must less than 32767
WlanTime:2=20000 #(20ms) WlanTime must be less than 32767
}
}
######################### Robust Coex command ###############

View file

@ -0,0 +1,674 @@
# File: rutxpower_limit.conf
## Get CFG data for RU based Tx power limit
rutxpowerlimit_cfg_get={
CmdCode=0x026d #do not change this line
Action:2=0 #0 - GET
SubID:2=0x117 #RU POWER
}
## Set CFG data for RU based Tx power limit
##
## TLVStartFreq: Starting Frequency of the band for this channel
## 2407, 2414 or 2400 for 2.4 GHz
## 5000
## 4000
## TLVChanWidth: Channel Width
## 20 40 80
## TLVChanNum : Channel Number
## TLVPwr[] : Power Limit in dBm (RU=26,52,106,242,484,996)
## range from -64dBm to +63dBm in steps of 1dBm
##
rutxpowerlimit_cfg_set={
CmdCode=0x026d #do not change this line
Action:2=1 #1 - SET
SubID:2=0x117 #RU POWER
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=1
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=2
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=3
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=4
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=5
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=6
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=7
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=8
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=9
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=10
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=11
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=12
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=2407
TlvChanWidth:1=20
TlvChanNum:1=13
TlvPwr:6='-1,2,5,8,0,0'
}
}
rutxpowerlimit_5g_cfg_set={
CmdCode=0x026d #do not change this line
Action:2=1 #1 - SET
SubID:2=0x117 #RU POWER
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=36
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=40
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=44
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=48
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=52
TlvPwr:6='-2,1,4,7,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=56
TlvPwr:6='-2,1,4,7,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=60
TlvPwr:6='-2,1,4,7,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=64
TlvPwr:6='-2,1,4,7,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=100
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=104
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=108
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=112
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=116
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=120
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=124
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=128
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=132
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=136
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=140
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=144
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=149
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=153
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=157
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=161
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=20
TlvChanNum:1=165
TlvPwr:6='-1,2,5,8,0,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=36
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=40
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=44
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=48
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=52
TlvPwr:6='-5,-2,1,4,7,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=56
TlvPwr:6='-5,-2,1,4,7,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=60
TlvPwr:6='-5,-2,1,4,7,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=64
TlvPwr:6='-5,-2,1,4,7,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=100
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=104
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=108
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=112
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=116
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=120
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=124
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=128
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=132
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=136
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=149
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=153
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=157
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=40
TlvChanNum:1=161
TlvPwr:6='-4,-1,2,5,8,0'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=36
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=40
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=44
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=48
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=52
TlvPwr:6='-8,-5,-2,1,4,7'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=56
TlvPwr:6='-8,-5,-2,1,4,7'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=60
TlvPwr:6='-8,-5,-2,1,4,7'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=64
TlvPwr:6='-8,-5,-2,1,4,7'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=100
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=104
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=108
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=112
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=116
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=120
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=124
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=128
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=149
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=153
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=157
TlvPwr:6='-7,-4,-1,2,5,8'
}
PwrVal.TlvType:2=0x0244
PwrVal.TlvLength:2={
TLVStartFreq:2=5000
TlvChanWidth:1=80
TlvChanNum:1=161
TlvPwr:6='-7,-4,-1,2,5,8'
}
}

View file

@ -0,0 +1,62 @@
# File : small_debug.conf
######################### DBG Config command ###############
small_debug_enable={
CmdCode=0x008b # do NOT change this line
Dst:1=0x06 # dbgs_cfg_t
Air_Chan:1=0x00
RSVD:1=0
Num_Entries:1=0x81 # one entry global enable
# dbgs_t
En_Mask:2=0x0000 # en_mask_id
BaseId:2=0x0000 # base_id
}
small_debug_disable={
CmdCode=0x008b # do NOT change this line
Dst:1=0x00
Air_Chan:1=0x00
RSVD:1=0
Num_Entries:1=0x00
}
######################### DBG Get Trace Memory ###############
# Disable Air and Host destinations to disable dbgs_drain
# Enable only the Power save ID - Host interface is a course enable - not on specific event
trace_enable={
CmdCode=0x008b # do NOT change this line
Dst:1=0x00 # dbgs_cfg_t - don't drain debug
Air_Chan:1=0x00
RSVD:1=0
Num_Entries:1=0x02 # 2 entry
# dbgs_t
En_Mask:2=0x5fff # en_mask_id - enable single ID=0x80
BaseId:2=0x0020 # base_id
En_Mask:2=0x5fff # en_mask_id - enable single ID=0x80
BaseId:2=0x0021 # base_id
}
get_trace={
CmdCode=0x008c # do NOT change this line
startAddress:4=0x02 # read trace memeory - not a generic memory read
len:2=0x0000 # First read=0 - for next reads use the returned next start
}
trace_disable={
CmdCode=0x008b # do NOT change this line
Dst:1=0x00 # dbgs_cfg_t - don't drain debug
Air_Chan:1=0x00
RSVD:1=0
Num_Entries:1=0x01 # one entry
# dbgs_t
En_Mask:2=0x0000 # en_mask_id
BaseId:2=0x0000 # base_id
}

View file

@ -0,0 +1,124 @@
# File : smc.conf
smc_get={
CmdCode=0x012d #do not change this
Action:2=0 # GET
}
smc_set={
CmdCode=0x012d #do not change this
Action:2=1 # SET
# SSID
SSIDHeaderType:2=0x0000
SSIDHeaderLen:2={
SSID:10="NXP_SMC_1"
}
# Beacon Period.
# This should be smaller than than MinScanTime.
BeaconHeaderType:2=0x012c
BeaconHeaderLen:2={
beaconPeriod:2=30
}
# Channel list.
# ChanNumber, MinScanTime and ScanTime are mandatory.
# MinScanTime is minimum dwelling time for ChanNumber channel.
# ScanTime is maximum dwelling time for ChanNumber channel.
ChannHeaderType:2=0x0101
ChannHeaderLen:2={
# Following four line define one channel.
# Please add similar four lines with different channel number for new channel.
Chan1_RadioType:1=0
Chan1_ChanNumber:1=1
Chan1_ScanType:1=2
Chan1_MinScanTime:2=40
Chan1_ScanTime:2=200
Chan2_RadioType:1=0
Chan2_ChanNumber:1=6
Chan2_ScanType:1=3
Chan2_MinScanTime:2=40
Chan2_ScanTime:2=200
Chan3_RadioType:1=0
Chan3_ChanNumber:1=9
Chan3_ScanType:1=2
Chan3_MinScanTime:2=40
Chan3_ScanTime:2=100
Chan2_RadioType:1=0
Chan2_ChanNumber:1=11
Chan2_ScanType:1=3
Chan2_MinScanTime:2=40
Chan2_ScanTime:2=200
}
#Custom IE
#Currently max size of custom IE supported is 50 bytes.
#
# CustomHeaderType:2=0x010a
# CustomHeaderLen:2={
# start:1=0xdd
# start:1=0x10
# start:1=0x00
# start:1=0x01
# start:1=0x02
# start:1=0x03
# start:1=0x04
# start:1=0x05
# start:1=0x06
# start:1=0x07
# start:1=0x08
# start:1=0x09
# start:1=0x0a
# start:1=0x0b
# start:1=0x0c
# start:1=0x0d
# start:1=0x0e
# start:1=0x0f
# }
#Multicast mac filtering address
#All the multicast packets from starting mac address to ending mac address would
#be captured and sent to the host.
MACHeaderType:2=0x01cc
MACHeaderLen:2={
#Staring Multicast mac address
start:1=0x01
start:1=0x00
start:1=0x5e
start:1=0x00
start:1=0x00
start:1=0x01
#Ending Multicast mac address
end:1=0x01
end:1=0x00
end:1=0x5e
end:1=0x7f
end:1=0xff
end:1=0xff
#FilterType
# 1 for RX AP frames
# 2 for RX STA frames
# 3 for both
Filter:2=0x3
}
}
smc_start={
CmdCode=0x012d #do not change this
Action:2=2 # START
}
smc_stop={
CmdCode=0x012d #do not change this
Action:2=3 # STOP
}

View file

@ -0,0 +1,13 @@
# File ssu.conf
ssu_params_cfg={
nskip=3 #0-3; # of FFT samples to skip
nsel=2 #0-3: # of FFT samples selected to dump
adcdownsample=1 #0-3: Down sample ADC input for buffering
mask_adc_pkt=1 #0-1: Mask out ADC Data from spectral packet
out_16bits=1 #0-1: Enable 16-Bit FFT output data precision in spectral packet
spec_pwr_enable=1 #0-1: Enable power spectrum in dB for spectral packet
rate_reduction=1 #0-1: Enable spectral packet rae reduction in DB output format
n_pkt_avg=6 #0-7: Number of spectral packets over which spectral data is to be averaged.
}

View file

@ -0,0 +1,103 @@
# File : subevent.conf
######################### Subscribe Events command ##################
subevent_get={
CmdCode=0x0075 # do NOT change this line
Action:2=0 # GET
Events:2=0
}
subevent_set={
CmdCode=0x0075 # do NOT change this line
Action:2=1 # SET
Events:2=0xbc8 # bit0 - Beacon RSSI_LOW
# bit1 - Beacon SNR_LOW
# bit2 - FAILED_COUNT
# bit3 - Beacon Missed
# bit4 - Beacon RSSI_HIGH
# bit5 - Beacon SNR_HIGH
# bit6 - Data RSSI_LOW
# bit7 - Data SNR_LOW
# bit8 - Data RSSI_HIGH
# bit9 - Data SNR_HIGH
# bit10 - LINK_QUALITY
# bit11 - PRE_BCN_LOST
# bit12-15 - Reserved
LowRssiTlvType:2=0x0104
LowRssiTlvLength:2={
Threshold:1=70
ReportingFreq:1=0
}
LowSnrTlvType:2=0x0105
LowSnrTlvLength:2={
Threshold:1=56
ReportingFreq:1=0
}
FailedCountTlvType:2=0x0106
FailedCountTlvLength:2={
Threshold:1=5
ReportingFreq:1=0
}
BeaconMissTlvType:2=0x0107
BeaconMissTlvLength:2={
BeaconMissed:1=60
Reserved:1=0
}
HighRssiTlvType:2=0x0116
HighRssiTlvLength:2={
Threshold:1=40
ReportingFreq:1=0
}
HighSnrTlvType:2=0x0117
HighSnrTlvLength:2={
Threshold:1=86
ReportingFreq:1=0
}
DataLowRssiTlvType:2=0x0126
DataLowRssiTlvLength:2={
Threshold:1=10
ReportingFreq:1=0
}
DataLowSnrTlvType:2=0x0127
DataLowSnrTlvLength:2={
Threshold:1=66
ReportingFreq:1=0
}
DataHighRssiTlvType:2=0x0128
DataHighRssiTlvLength:2={
Threshold:1=50
ReportingFreq:1=0
}
DataHighSnrTlvType:2=0x0129
DataHighSnrTlvLength:2={
Threshold:1=96
ReportingFreq:1=1
}
LinkQualityTlvType:2=0x0124
LinkQualityTlvType:2={
LinkSNRThreshold:2=0x0056
LinkSNRFrequency:2=0x0003
MinRateVal:2=0x0014
MinRateFreq:2=0x0003
TxLatencyVal:4=0x00C8
TxLatencyThreshold:4=0x0003
}
PreBcnLostTlvType:2=0x0149
PreBcnLostTlvLength:2={
PreBeaconCnt:1=30
Reserved:1=0
}
}
######################### Subscribe Events command ##################

View file

@ -0,0 +1,118 @@
# File : tdls.conf
######################### TDLS commands configuration ##################
# starts with a command name with parameters embedded inside
tdls_setinfo={
CapInfo=0x2421
Rate=0x02,0x04,0x0b,0x16,0x0C,0x12,0x18,0x24,0x30,0x48,0x60,0x6c
QosInfo=0x0F # 1 byte qos capability field. Valid values 0x00 or 0x0F
# For AMPDU over direct link, this should be 0x00
ExtendCapabilities=0x00,0x00,0x00,0x50,0x20 # Enable Peer U-APSD(Bit28), TDLS channel switch(Bit30), TDLS(Bit37)
HTCapability={
HTCapabilityInfo=0x62 # 2 byte HT capability field.
AMPDUParam=0x3
SupportedMCSSet=0xFF,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
HTExtCapability=0x00
TxBfCapability=0x00
AntennaSel=0x00
}
HTInformation={
PrimaryChannel=1
Field2=0x0
Field3=0x5
Field4=0x0
BasicMCSSet=0xFF,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
# 16 elements as per the structure.
}
2040BSSCoex=0x01 # 1 byte 2040 Coex field.
VHTCapability={
VHTCapabilityInfo=0x33C00000 # 4 byte VHT capability field.
RxMCSMap=0xFFFC
RxMaxRate=0x0000 #bit 29-31 reserved
TxMCSMap=0xFFFC
TxMaxRate=0x0000 #bit 61-63 reserved
}
VHTOper={
ChanWidth=0x01;
ChanCF1=0x01;
ChanCF2=0x01;
BasicMCSMap=0xFF, 0XFF; #Basic MCS set map, each 2 bits stands for a Nss
}
# Uncomment the RSNInfo while testing open-secure network.
RSNInfo={
GroupCipherSuite=0x00,0x0F,0xAC,0x07
PairwiseCipherCount=1
PairwiseCipherSuite=0x00,0x0F,0xAC,0x04 # CCMP
#PairwiseCipherSuite=0x00,0x0F,0xAC,0x02 # TKIP multiple Pairwise Cipher Suite if count > 1.
AKMSuiteCount=1
AKMSuite=0x00,0x0F,0xAC,0x07 # multiple AKM Suite if count > 1.
#AKMSuite=0x00,0x0F,0xAC,0x07 # multiple AKM Suite if count > 1.
RSNCapability=0x200 # Enable PeerKey
PMKIDCount=0
}
SupportedChannels={
FirstChannelNo=1
NumberofSubBandChannels=11
# multiple instances of First Channel No, Number of SubBand Channels
}
SupportedRegulatoryClasses={
CurrentRegulatoryClass=1
NumofRegulatoryClasses=15
ListOfRegulatoryClasses=1,2,3,4,12,22,23,24,25,27,28,29,30,32,33
}
# CountryInfo={
# CountryString="US" # 3 byte country string
# FirstChannel=1
# NumberofChannels=11
# TxPower=30
# # multiple instances of First Channel, Number of Channels, Tx Power
# }
}
tdls_discovery={
PeerMAC=00:50:43:27:B0:41 # MAC address of Peer
}
tdls_setup={
PeerMAC=00:50:43:27:B0:41 # MAC address of Peer
WaitTimems=3000 # Time in milliseconds to wait
# for setup response from peer
KeyLifetime=301 # Lifetime of security key in seconds.
}
tdls_teardown={
PeerMAC=00:50:43:27:B0:41 # MAC address of Peer
ReasonCode=26 # Tear down reason code
}
tdls_channel_switch={
PeerMAC=00:50:43:27:B0:41 # MAC address of Peer
Band=0 # Band
PrimaryChannel=6 # Primary channel no for channel switching
SecondaryChannelOffset=0 # Secondary channel offset
Periodicity=1 # Channel switch periodicity
ChannelSwitchTime=10 # Channel switch time in ms.
ChannelSwitchTimeout=14 # Channel switch timeout in ms
RegulatoryClass=12 # Target regulatory class
}
tdls_cs_params={
UnitTime=2 # Unit time, multiples of 10 ms
ThresholdOtherLink=10 # Threshold for other link
ThresholdDirectLink=1 # Threshold for direct link
}
tdls_stop_channel_switch={
PeerMAC=00:50:43:27:B0:41 # MAC address of Peer
}
tdls_powermode={
PeerMAC=00:50:43:27:B0:41 # MAC address of Peer
PowerMode=1 # 0: Active, 1 : Power Save
}
######################### TDLS commands configuration ##################

View file

@ -0,0 +1,163 @@
#This is reference file to set parameters for trigger frame configuration through
#rf test mode cmd.
#Example : echo "trigger_frame=1 0 1 2 5484 0 256 0 0 2 1 0 0 0 1 60 1 0 65535 0 511 5 0 67 0 0 0 0 90 0 0 0 0" > /proc/mwlan/adapter0/config
############## TF_Config_80MHz ########################
#Enable_tx = 1
#standalone_hetb = 0 # standalone HE TB support is not present for Skyhawk. This filed is required for Firecrest
#FRAME_CTRL_TYPE=1 #IEEE_TYPE_CONTROL
#FRAME_CTRL_SUBTYPE=2 #TRIGGER
#configure Duration field
# Max Duration time
#FRAME_DURATION=5484 #0x156C
#configure commoninfo field of trigger frame
# HE_trigger_frame.TrigCommonField.TriggerType = BASIC_TRIGGER;
# HE_trigger_frame.TrigCommonField.UlLen = 256; # Max
# HE_trigger_frame.TrigCommonField.MoreTF = FALSE;
# HE_trigger_frame.TrigCommonField.CSRequired = FALSE;
# HE_trigger_frame.TrigCommonField.UlBw = TB_BW_20MHZ;
# HE_trigger_frame.TrigCommonField.LTFType = LTF_1_GI_1_6uS;
# HE_trigger_frame.TrigCommonField.LTFMode = MU_MIMO_SINGLE_STREAM;
# HE_trigger_frame.TrigCommonField.LTFSymbol = 1;
# HE_trigger_frame.TrigCommonField.UlSTBC = FALSE;
# HE_trigger_frame.TrigCommonField.LdpcESS = FALSE;
# HE_trigger_frame.TrigCommonField.ApTxPwr = 10
# HE_trigger_frame.TrigCommonField.PreFecPadFct = 0;
# HE_trigger_frame.TrigCommonField.PeDisambig = 1;
# HE_trigger_frame.TrigCommonField.SpatialReuse = 0;
# HE_trigger_frame.TrigCommonField.Doppler = FALSE;
# HE_trigger_frame.TrigCommonField.HeSig2 = 0x1FF; # reserved
#TrigCommonField=0;256;0;0;2;1;0;0;0;1;60;1;0;65535;0;511
#configure userinfo field of trigger frame
# HE_trigger_frame.TrigUserInfoField.AID12 = (AID & 0xFFF);
# HE_trigger_frame.TrigUserInfoField.RUAllocReg = 0;
# HE_trigger_frame.TrigUserInfoField.RUAlloc = 0x35; # 53 (106 tones)
# HE_trigger_frame.TrigUserInfoField.UlCodingType = CODING_TYPE_LDPC;
# HE_trigger_frame.TrigUserInfoField.UlMCS = 0xB;
# HE_trigger_frame.TrigUserInfoField.UlDCM = FALSE;
# HE_trigger_frame.TrigUserInfoField.SSAlloc = 0x8;
# HE_trigger_frame.TrigUserInfoField.UlTargetRSSI = 40;
#TrigUserInfoField=5;0;67;0;0;0;0;90
#configure trigger dependent user info field
# HE_trigger_frame.BasicTrigUserInfo.MPDU_MU_SF = MPDU_SPACING_MULT_1;
# HE_trigger_frame.BasicTrigUserInfo.TID_AL = 1;
# HE_trigger_frame.BasicTrigUserInfo.AC_PL = FALSE;
# HE_trigger_frame.BasicTrigUserInfo.Pref_AC = TB_AC_VO;
#BasicTrigUserInfo=0;0;0;0
#RF Test Mode Command:
echo "trigger_frame=1 0 1 2 5484 0 256 0 0 2 1 0 0 0 1 60 1 0 65535 0 511 5 0 67 0 0 0 0 90 0 0 0 0" > /proc/mwlan/adapter0/config
############## Trigger_frame_40Mhz_RU65 ########################
#Enable_tx = 1
#standalone_hetb = 0 # standalone HE TB support is not present for Skyhawk. This filed is required for Firecrest
#FRAME_CTRL_TYPE=1 #IEEE_TYPE_CONTROL
#FRAME_CTRL_SUBTYPE=2 #TRIGGER
#configure Duration field
# Max Duration time
#FRAME_DURATION=5484 #0x156C
#configure commoninfo field of trigger frame
# HE_trigger_frame.TrigCommonField.TriggerType = BASIC_TRIGGER;
# HE_trigger_frame.TrigCommonField.UlLen = 256; # Max
# HE_trigger_frame.TrigCommonField.MoreTF = FALSE;
# HE_trigger_frame.TrigCommonField.CSRequired = FALSE;
# HE_trigger_frame.TrigCommonField.UlBw = TB_BW_20MHZ;
# HE_trigger_frame.TrigCommonField.LTFType = LTF_1_GI_1_6uS;
# HE_trigger_frame.TrigCommonField.LTFMode = MU_MIMO_SINGLE_STREAM;
# HE_trigger_frame.TrigCommonField.LTFSymbol = 1;
# HE_trigger_frame.TrigCommonField.UlSTBC = FALSE;
# HE_trigger_frame.TrigCommonField.LdpcESS = FALSE;
# HE_trigger_frame.TrigCommonField.ApTxPwr = 10
# HE_trigger_frame.TrigCommonField.PreFecPadFct = 0;
# HE_trigger_frame.TrigCommonField.PeDisambig = 1;
# HE_trigger_frame.TrigCommonField.SpatialReuse = 0;
# HE_trigger_frame.TrigCommonField.Doppler = FALSE;
# HE_trigger_frame.TrigCommonField.HeSig2 = 0x1FF; # reserved
#TrigCommonField=0;256;0;1;0;1;0;0;0;1;60;1;0;65535;0;511
#configure userinfo field of trigger frame
# HE_trigger_frame.TrigUserInfoField.AID12 = (AID & 0xFFF);
# HE_trigger_frame.TrigUserInfoField.RUAllocReg = 0;
# HE_trigger_frame.TrigUserInfoField.RUAlloc = 0x35; # 53 (106 tones)
# HE_trigger_frame.TrigUserInfoField.UlCodingType = CODING_TYPE_LDPC;
# HE_trigger_frame.TrigUserInfoField.UlMCS = 0xB;
# HE_trigger_frame.TrigUserInfoField.UlDCM = FALSE;
# HE_trigger_frame.TrigUserInfoField.SSAlloc = 0x8;
# HE_trigger_frame.TrigUserInfoField.UlTargetRSSI = 40;
#TrigUserInfoField=5;0;65;0;0;0;0;90
#configure trigger dependent user info field
# HE_trigger_frame.BasicTrigUserInfo.MPDU_MU_SF = MPDU_SPACING_MULT_1;
# HE_trigger_frame.BasicTrigUserInfo.TID_AL = 1;
# HE_trigger_frame.BasicTrigUserInfo.AC_PL = FALSE;
# HE_trigger_frame.BasicTrigUserInfo.Pref_AC = TB_AC_VO;
#BasicTrigUserInfo=0;0;0;0
#RF Test Mode Command:
echo "trigger_frame=1 0 1 2 5484 0 256 0 1 0 1 0 0 0 1 60 1 0 65535 0 511 5 0 65 0 0 0 0 90 0 0 0 0" > /proc/mwlan/adapter0/config
############## Trigger_frame_20Mhz_RU61 ########################
#Enable_tx = 1
#standalone_hetb = 0 # standalone HE TB support is not present for Skyhawk. This filed is required for Firecrest
#FRAME_CTRL_TYPE=1 #IEEE_TYPE_CONTROL
#FRAME_CTRL_SUBTYPE=2 #TRIGGER
#configure Duration field
# Max Duration time
#FRAME_DURATION=5484 #0x156C
#configure commoninfo field of trigger frame
# HE_trigger_frame.TrigCommonField.TriggerType = BASIC_TRIGGER;
# HE_trigger_frame.TrigCommonField.UlLen = 256; # Max
# HE_trigger_frame.TrigCommonField.MoreTF = FALSE;
# HE_trigger_frame.TrigCommonField.CSRequired = FALSE;
# HE_trigger_frame.TrigCommonField.UlBw = TB_BW_20MHZ;
# HE_trigger_frame.TrigCommonField.LTFType = LTF_1_GI_1_6uS;
# HE_trigger_frame.TrigCommonField.LTFMode = MU_MIMO_SINGLE_STREAM;
# HE_trigger_frame.TrigCommonField.LTFSymbol = 1;
# HE_trigger_frame.TrigCommonField.UlSTBC = FALSE;
# HE_trigger_frame.TrigCommonField.LdpcESS = FALSE;
# HE_trigger_frame.TrigCommonField.ApTxPwr = 10
# HE_trigger_frame.TrigCommonField.PreFecPadFct = 0;
# HE_trigger_frame.TrigCommonField.PeDisambig = 1;
# HE_trigger_frame.TrigCommonField.SpatialReuse = 0;
# HE_trigger_frame.TrigCommonField.Doppler = FALSE;
# HE_trigger_frame.TrigCommonField.HeSig2 = 0x1FF; # reserved
#TrigCommonField=0;256;0;0;0;1;0;0;0;1;60;1;0;65535;0;511
#configure userinfo field of trigger frame
# HE_trigger_frame.TrigUserInfoField.AID12 = (AID & 0xFFF);
# HE_trigger_frame.TrigUserInfoField.RUAllocReg = 0;
# HE_trigger_frame.TrigUserInfoField.RUAlloc = 0x35; # 53 (106 tones)
# HE_trigger_frame.TrigUserInfoField.UlCodingType = CODING_TYPE_LDPC;
# HE_trigger_frame.TrigUserInfoField.UlMCS = 0xB;
# HE_trigger_frame.TrigUserInfoField.UlDCM = FALSE;
# HE_trigger_frame.TrigUserInfoField.SSAlloc = 0x8;
# HE_trigger_frame.TrigUserInfoField.UlTargetRSSI = 40;
#TrigUserInfoField=5;0;61;0;0;0;0;90
#configure trigger dependent user info field
# HE_trigger_frame.BasicTrigUserInfo.MPDU_MU_SF = MPDU_SPACING_MULT_1;
# HE_trigger_frame.BasicTrigUserInfo.TID_AL = 1;
# HE_trigger_frame.BasicTrigUserInfo.AC_PL = FALSE;
# HE_trigger_frame.BasicTrigUserInfo.Pref_AC = TB_AC_VO;
#BasicTrigUserInfo=0;0;0;0
#RF Test Mode Command:
echo "trigger_frame=1 0 1 2 5484 0 256 0 0 0 1 0 0 0 1 60 1 0 65535 0 511 5 0 61 0 0 0 0 90 0 0 0 0" > /proc/mwlan/adapter0/config

View file

@ -0,0 +1,100 @@
# TSPEC contents for TID=0, UserPriority = 6
[tspec0]
# Element ID
dd
# Length
3d
# OUI
00 50 f2
# OUI Type
02
# OUI SubType
02
# Version
01
# TSInfo
e0 34 00
# Nominal MSDU Size
d0 80
# Maximum MSDU Size
d0 00
# Min Service Interval
20 4e 00 00
# Max Service Interval
20 4e 00 00
# Inactivity Interval
80 96 98 00
# Suspension Interval
ff ff ff ff
# Service Start Time
00 00 00 00
# Minimum Data Rate
00 45 01 00
# Mean Data Rate
00 45 01 00
# Peak Data Rate
00 45 01 00
# Max Burst Size
00 00 00 00
# Delay Bound
00 00 00 00
# Min PHY Rate
00 1b b7 00
# Surplus Bandwidth Allowance
00 30
# Medium Time
00 00
# Extra Data Bytes
[/tspec0]
# TSPEC contents for TID=1, UserPriority = 4
[tspec1]
# Element ID
dd
# Length
3d
# OUI
00 50 f2
# OUI Type
02
# OUI SubType
02
# Version
01
# TSInfo
e3 20 00
# Nominal MSDU Size
96 00
# Maximum MSDU Size
dc 05
# Min Service Interval
00 00 00 00
# Max Service Interval
00 00 00 00
# Inactivity Interval
00 00 00 00
# Suspension Interval
ff ff ff ff
# Service Start Time
00 00 00 00
# Minimum Data Rate
a0 00 00 00
# Mean Data Rate
a0 00 00 00
# Peak Data Rate
a0 00 00 00
# Max Burst Size
00 00 00 00
# Delay Bound
00 00 00 00
# Min PHY Rate
80 8d 5b 00
# Surplus Bandwidth Allowance
00 30
# Medium Time
00 00
# Extra Data Bytes
dd 04 00 50 43 ff
[/tspec1]

View file

@ -0,0 +1,48 @@
# File : twt.conf
######################### TWT commands configuration ##################
# starts with a command name with parameters embedded inside
# The TWT setup command sets or gets the TWT configuration.
twt_setup={
Implicit=1 # Indicates that TWT session is implicit which TWT negotiation decides the TWT Wake Interval.
# 0: Explicit
# 1: Implicit
Announced=0 # Indicates that TWT requesting STA may be at doze state at beginning of TWT SP.
# 0: Unannounced
# 1: Announced TWT
TriggerEnabled=0 # Indicates that at least one trigger frame is transmitted in TWT SP.
# 0: Non-Trigger enabled
# 1: Trigger enabled TWT
TWTInformationDisabled=1 # Indicates if TWT information frames are acceptable or not during the TWT session.
# 0: TWT information enabled
# 1: TWT information disabled
NegotiationType=0 # Indicates if TWT session is Individual or Broadcast.
# 0: Future Individual TWT SP start time
# 1: Next Wake TBTT time
# 3: B-TWT Support
TWTWakeupDuration=64 # Indicates the time after which the TWT requesting STA can transition to doze state.
# Range: [0-sizeof(UINT8)]
FlowIdentifier=0 # As per specification, upto 8 implicit TWT sessions can exist in parallel based on different
# flow identifiers. For now, we can mark it as 0.
# Range: [0-7]
HardConstraint=1 # Identifies if firmware can internally change any of the TWT params in case AP sends
# TWT_REJECT to TWT Setup.
# 0: FW can tweak the TWT setup parameters if it is rejected by AP.
# 1: Firmware should not tweak any parameters.
TWTExponent=10 # Range: [0-63]
TWTMantissa=512 # Range: [0-sizeof(UINT16)]
# TWTExponent and TWTMantissa determine the time interval between successive TWT SP for
# individual TWT according to the formula Mantissa * (2^Exponent)
TWTRequestType=0 # Range: [0-7]
# 0: REQUEST_TWT
# 1: SUGGEST_TWT
}
# The TWT teardown command is used to terminate the TWT session.
twt_teardown={
FlowIdentifier=0 # TWT Flow Identifier. Range: [0-7]
NegotiationType=0 # 0: Future Individual TWT SP start time
# 1: Next Wake TBTT time
TearDownAllTWT=0 # 1: To teardown all TWT, 0 otherwise
}

View file

@ -0,0 +1,25 @@
bcast_twt_get={
CmdCode=0x008b # do NOT change this line
Action:2=0 # 0 - GET
SUBID:2=0x125 # Broadcast TWT AP config
Value:1=255 # Nominal Wake To be given in integer between 64-255
Value:1=4 # Max STA Support, Do not change this value.
Value:2=796 # TWT Mantissa
Value:2=448 # TWT Offset
Value:1=9 # TWT Exponent
Value:1=0 #SP Gap
}
bcast_twt_set={
CmdCode=0x008b # do NOT change this line
Action:2=1 # 1 - SET
SUBID:2=0x125 # Broadcast TWT AP config
Value:1=64 # Nominal Wake To be given in integer between 64-255
Value:1=4 # Max STA Support, Do not change this value.
Value:2=99 # TWT Mantissa
Value:2=624 # TWT Offset
Value:1=10 # TWT Exponent
Value:1=5 # SP Gap
}
# Service Period and Gap should be such that it can accomodate All STA within 1 Beacon Period i.e. TWT Period in this case

View file

@ -0,0 +1,58 @@
#protocol
Protocol=0x88dc
# configure data rate in unit of 0.5Mbps
# 0 - auto rate determined by firmware
# Any other data rate except these data rates will
# be overwritten by default data rate.
# datarate index, unit in 0.5Mbps
# Index | 20MHz | 10MHz
# 12 | 6Mbps | 3Mbps
# 18 | 9Mbps | 4.5Mbps
# 24 | 12Mbps | 6Mbps
# 36 | 18Mbps | 9Mbps
# 48 | 24Mbps | 12Mbps
# 72 | 36Mbps | 18Mbps
# 96 | 48Mbps | 24Mbps
# 108 | 54Mbps | 27.5Mbps
Datarate=12
# configure Channel for the packet
# 0 - the channel set during the enable would be used
Channel=0
# configure Bandwith (only for 11p)
# 0: auto bandwith setting by firmware
# bit4: 1 use bit[3:0] bandwith setting
# bit[3:0]:
# 0 - 5MHz
# 1 - 10MHz
# 2 - 20MHz
# 3 - 40MHz
# 4 - 80MHz
Bandwidth=0x00
# configure power settings
# bit[7] host tx power control flag
# 0x0: use fw setting for tx power
# 0x1: value specified in bit[6] and bit[5:0] are valid
# bit[6] sign of the power specified in bit[5:0]
# 0x0: power specified in bit[5:0] is postive (+)
# 0x1: power specified in bit[5:0] is negative (-)
# bit[5:0] power to be used for transmission (in dBm)
Power=0x00
# configure Priority of the packet
# 1,2 - BK
# 0,3 - BE
# 4,5 - VI
# 6,7 - VO
Priority=0
# configure tx retry time
Retry_limit=0
# Destination MAC Address
Addr=00:50:43:22:0f:b0
Data=0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x8,0x9,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x8,0x9,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x8,0x9,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,621 @@
# File : txpwrlimit_cfg.conf
## Get CFG data for Tx power limitation
txpwrlimit_2g_cfg_get={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x00 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub0={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x10 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub1={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x11 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub2={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x12 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
txpwrlimit_5g_cfg_get_sub3={
CmdCode=0x00fb # do NOT change this line
Action:2=0 # 0 - GET
SubBand:2=0x13 # 0x00 2G subband (2.4G: channel 1-14)
# 0x10 5G subband0 (5G: channel 36,40,44,48,
# 52,56,60,64)
# 0x11 5G subband1 (5G: channel 100,104,108,112,
# 116,120,124,128,
# 132,136,140,144)
# 0x12 5G subband2 (5G: channel 149,153,157,161,165,172)
# 0x13 5G subband3 (5G: channel 183,184,185,187,188,
# 189, 192,196;
# 5G: channel 7,8,11,12,16,34)
}
## Set CFG data for Tx power limitation
##
## TLVStartFreq: Starting Frequency of the band for this channel
## 2407, 2414 or 2400 for 2.4 GHz
## 5000
## 4000
## TLVChanWidth: Channel Width
## 20
## TLVChanNum : Channel Number
## TLVPwr[] : ModulationGroup
## 0: CCK (1,2,5.5,11 Mbps)
## 1: OFDM (6,9,12,18 Mbps)
## 2: OFDM (24,36 Mbps)
## 3: OFDM (48,54 Mbps)
## 4: HT20 (MCS0,1,2)
## 5: HT20 (MCS3,4)
## 6: HT20 (MCS5,6,7)
## 7: HT40 (MCS0,1,2)
## 8: HT40 (MCS3,4)
## 9: HT40 (MCS5,6,7)
## 10: HT2_20 (MCS8,9,10)
## 11: HT2_20 (MCS11,12)
## 12: HT2_20 (MCS13,14,15)
## 13: HT2_40 (MCS8,9,10)
## 14: HT2_40 (MCS11,12)
## 15: HT2_40 (MCS13,14,15)
## 16: VHT_QAM256 (MCS8)
## 17: VHT_40_QAM256 (MCS8,9)
## 18: VHT_80_PSK (MCS0,1,2)
## 19: VHT_80_QAM16 (MCS3,4)
## 20: VHT_80_QAM64 (MCS5,6,7)
## 21: VHT_80_QAM256 (MCS8,9)
## 22: VHT2_20_QAM256 (MCS8,9)
## 23: VHT2_40_QAM256 (MCS8,9)
## 24: VHT2_80_PSK (MCS0, 1, 2)
## 25: VHT2_80_QAM16 (MCS3,4)
## 26: VHT2_80_QAM64 (MCS5,6,7)
## 27: VHT2_80_QAM256 (MCS8,9)
## Power Limit in dBm
## For 40MHz modulation groups, specify same Tx power value for a set of
## two consecutive channel frequencies
## Valid channel sets:
## (36, 40), (44, 48), (52, 56), (60, 64)
## (100, 104), (108, 112), (116, 120), (124, 128), (132, 136), (140, 144)
## (149, 153), (157, 161)
##
## For 80MHz modulation groups, specify same Tx power value for a set of
## four consecutive channel frequencies
## Valid channel sets:
## (36, 40, 44, 48), (52, 56, 60, 64)
## (100, 104, 108, 112), (116, 120, 124, 128), (132, 136, 140, 144)
## (149, 153, 157, 161)
## 2G subband0 Tx power limit CFG
txpwrlimit_2g_cfg_set={
CmdCode=0x00fb # do NOT change this line
Action:2=1 # 1 - SET
SubBand:2=0 # do NOT use this member in set cmd
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=1
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=2
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=3
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=4
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=5
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=6
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=7
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=8
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=9
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=10
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=11
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=12
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=13
TLVPwr:32='0,17,1,15,2,15,3,13,4,15,5,15,6,13,7,15,8,15,9,13,10,15,11,15,12,15,13,15,14,15,15,15'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=2407
TLVChanWidth:1=20
TLVChanNum:1=14
TLVPwr:32='0,12,1,12,2,12,3,12,4,12,5,12,6,12,7,12,8,12,9,12,10,12,11,12,12,12,13,12,14,12,15,12'
}
}
## 5G subband1 Tx power limit CFG
txpwrlimit_5g_cfg_set_sub0={
CmdCode=0x00fb # do NOT change this line
Action:2=1 # 1 - SET
SubBand:2=0 # do NOT use this member in set cmd
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=36
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=40
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=44
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=48
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=52
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=56
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=60
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=64
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
}
## 5G subband2 Tx power limit CFG
txpwrlimit_5g_cfg_set_sub1={
CmdCode=0x00fb # do NOT change this line
Action:2=1 # 1 - SET
SubBand:2=0 # do NOT use this member in set cmd
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=100
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=104
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=108
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=112
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=116
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=120
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=124
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=128
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=132
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=136
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=140
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=144
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
}
## 5G subband3 Tx power limit CFG
txpwrlimit_5g_cfg_set_sub2={
CmdCode=0x00fb # do NOT change this line
Action:2=1 # 1 - SET
SubBand:2=0 # do NOT use this member in set cmd
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=149
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=153
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=157
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=161
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=165
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
}
## 5G subband4 Tx power limit CFG
txpwrlimit_5g_cfg_set_sub3={
CmdCode=0x00fb # do NOT change this line
Action:2=1 # 1 - SET
SubBand:2=0 # do NOT use this in set cmd
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=183
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=184
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=185
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=187
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=188
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=189
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=192
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=4000
TLVChanWidth:1=20
TLVChanNum:1=196
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=7
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=8
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=11
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=12
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=16
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
ChanTRPC.TlvType:2=0x0189
ChanTRPC.TlvLength:2={
TLVStartFreq:2=5000
TLVChanWidth:1=20
TLVChanNum:1=34
TLVPwr:56='0,17,1,15,2,15,3,11,4,15,5,15,6,11,7,15,8,15,9,11,10,15,11,15,12,14,13,15,14,15,15,14,16,11,17,11,18,13,19,13,20,10,21,10,22,11,23,11,24,13,25,13,26,12,27,10'
}
}

View file

@ -0,0 +1,240 @@
# File : txrate_cfg.conf
## Tx Rate Configuration command
txrate_cfg_get={
CmdCode=0x00d6 # do NOT change this line
Action:2=0 # 0 - GET
Index:2=0 # do NOT change this line
TxRateScope.TlvType:2=0x0153
TxRateScope.TlvLength:2={
}
}
txrate_cfg_set_bg={
CmdCode=0x00d6 # do NOT change this line
Action:2=1 # 1 - SET
Index:2=0 # do NOT change this line
TxRateScope.TlvType:2=0x0153
TxRateScope.TlvLength:2={
################# TXRATE SCOPE ######################
# The following table shows the bitmap of the rates:
# (bit 0 is the least significant bit)
# Bit Data rate
# 0 1 Mbps
# 1 2 Mbps
# 2 5.5 Mbps
# 3 11 Mbps
# 4 Reserved
HRDSSS.RateScope:2=0x0000
# The following table shows the bitmap of the rates:
# (bit 0 is the least significant bit)
# Bit Data rate
# 0 6 Mbps
# 1 9 Mbps
# 2 12 Mbps
# 3 18 Mbps
# 4 24 Mbps
# 5 36 Mbps
# 6 48 Mbps
# 7 54 Mbps
OFDM.RateScope:2=0x0080
# The following table shows the bitmap of the rates:
# (bit 0 is the least significant bit)
# Bit Data rate
# 0 MCS0
# 1 MCS1
# 2 MCS2
# 3 MCS3
# 4 MCS4
# 5 MCS5
# 6 MCS6
# 7 MCS7
# 32 MCS32
HT.RateScopeDword0:4=0x00000000
HT.RateScopeDword1:4=0x00000000
HT.RateScopeDword2:4=0x00000000
HT.RateScopeDword3:4=0x00000000
}
TxRateDrop.TlvType:2=0x0151
TxRateDrop.TlvLength:2={
RateDrop.Mode:4=0x00000001
}
}
txrate_cfg_set_bgn={
CmdCode=0x00d6 # do NOT change this line
Action:2=1 # 1 - SET
Index:2=0 # do NOT change this line
TxRateScope.TlvType:2=0x0153
TxRateScope.TlvLength:2={
################# TXRATE SCOPE ######################
# The following table shows the bitmap of the rates:
# (bit 0 is the least significant bit)
# Bit Data rate
# 0 1 Mbps
# 1 2 Mbps
# 2 5.5 Mbps
# 3 11 Mbps
# 4 Reserved
HRDSSS.RateScope:2=0x0000
# The following table shows the bitmap of the rates:
# (bit 0 is the least significant bit)
# Bit Data rate
# 0 6 Mbps
# 1 9 Mbps
# 2 12 Mbps
# 3 18 Mbps
# 4 24 Mbps
# 5 36 Mbps
# 6 48 Mbps
# 7 54 Mbps
OFDM.RateScope:2=0x0000
# The following table shows the bitmap of the rates:
# (bit 0 is the least significant bit)
# Bit Data rate
# 0 MCS0
# 1 MCS1
# 2 MCS2
# 3 MCS3
# 4 MCS4
# 5 MCS5
# 6 MCS6
# 7 MCS7
# 32 MCS32
HT.RateScopeDword0:4=0x00000080
HT.RateScopeDword1:4=0x00000000
HT.RateScopeDword2:4=0x00000000
HT.RateScopeDword3:4=0x00000000
}
TxRateDrop.TlvType:2=0x0151
TxRateDrop.TlvLength:2={
RateDrop.Mode:4=0x00000001
}
}
txrate_cfg_set_bgn_ac_ax={
CmdCode=0x00d6 # do NOT change this line
Action:2=1 # 1 - SET
Index:2=0 # do NOT change this line
TxRateScope.TlvType:2=0x0153
TxRateScope.TlvLength:2={
################# TXRATE SCOPE ######################
# The following table shows the bitmap of the rates:
# (bit 0 is the least significant bit)
# Bit Data rate
# 0 1 Mbps
# 1 2 Mbps
# 2 5.5 Mbps
# 3 11 Mbps
# 4 Reserved
HRDSSS.RateScope:2=0x0000
# The following table shows the bitmap of the rates:
# (bit 0 is the least significant bit)
# Bit Data rate
# 0 6 Mbps
# 1 9 Mbps
# 2 12 Mbps
# 3 18 Mbps
# 4 24 Mbps
# 5 36 Mbps
# 6 48 Mbps
# 7 54 Mbps
OFDM.RateScope:2=0x0000
# The following table shows the bitmap of the rates:
# (bit 0 is the least significant bit)
# Bit Data rate
# 0 MCS0
# 1 MCS1
# 2 MCS2
# 3 MCS3
# 4 MCS4
# 5 MCS5
# 6 MCS6
# 7 MCS7
# 32 MCS32
HT.RateScopeDword0:4=0x00000080
HT.RateScopeDword1:4=0x00000000
HT.RateScopeDword2:4=0x00000000
HT.RateScopeDword3:4=0x00000000
VHT.RateScopeDword0:4=0xffffffff
VHT.RateScopeDword1:4=0x00000000
VHT.RateScopeDword2:4=0x00000000
VHT.RateScopeDword3:4=0x00000000
HE.RateScopeDword0:4=0xffffffff
HE.RateScopeDword1:4=0x00000000
HE.RateScopeDword2:4=0x00000000
HE.RateScopeDword3:4=0x00000000
}
TxRateDrop.TlvType:2=0x0151
TxRateDrop.TlvLength:2={
RateDrop.Mode:4=0x00000001
}
}
########supported BasicRate setting###########
basic_rate_get={
CmdCode=0x00d6 # do NOT change this line
Action:2=0 # 0 - GET
Index:2=0 # do NOT change this line
TlvType:2=0x21a
TlvLength:2={
}
}
basic_rate_set={
CmdCode=0x00d6 # do NOT change this line
Action:2=1 # 1 - SET
Index:2=0 # do NOT change this line
TlvType:2=0x21a
TlvLength:2={
BasicRateSupport:2=0x000f #defalt value
# The following table shows the bitmap of the rates:
# (bit 0 is the least significant bit)
# Bit BasicRateSupport
# 0 DBPSK1Mbps
# 1 DQPSK2Mbps
# 2 CCK5_5Mbps
# 3 CCK11Mbps
# 4 Not used.
# 5 OFDM6Mbps
# 6 OFDM9Mbps
# 7 OFDM12Mbps
# 8 OFDM18Mbps
# 9 OFDM24Mbps
# 10 OFDM36Mbps
# 11 OFDM48Mbps
# 12 OFDM54Mbps
# 13-15 Reserved
#note: value0x0 represents no setting value
#For example:
#BasicRateSupport:2=0x3 set supported BasicRate to DBPSK1Mbps, DQPSK2Mbps
#BasicRateSupport:2=0x180 set supported BasicRate to OFDM18Mbps, OFDM12Mbps
}
}

View file

@ -0,0 +1,93 @@
# Not matter how many spaces or tabs are inserted in a line,
# components and ending format must be exactly same as given
# example:
#
# <card_type>[_<block_id>] = {
# key=value
# }
#
# card_type : 8XXX (mandatory)
# block_id : configuration block id (optional )
# key : module parameter name
# value : value for module parameter
# for string value, no need to add ""
#
# card_type supported: 8887/8897/8997/8977/8987/9098
# block_id: support same chipset with
# different module parameter.
# For example to support mutiple SD8997 cards, usr can
# specify the configuration block id number [0 - 9], if not
# specified, it is taken as 0 by default.
#
# debug related module parameters could not be set via module
# configure file, ex. drvdbg could not be set in this file
#
# line started with "#" will be ignored
# refer to the USB8997_1 for parameters that could be set in
# this configuration file, and set the corresponding value
# according to your real needs
SD8997 = {
txpwrlimit_cfg=nxp/rgpower_8997.bin
cal_data_cfg=none
}
SD8987 = {
txpwrlimit_cfg=nxp/rgpower_8987.bin
cal_data_cfg=none
}
PCIE8997 = {
txpwrlimit_cfg=nxp/rgpower_8997.bin
cal_data_cfg=none
}
PCIE9098_0 = {
txpwrlimit_cfg=nxp/rgpower_9098.bin
}
PCIE9098_1 = {
txpwrlimit_cfg=nxp/rgpower_9098.bin
}
PCIEAW693_0 = {
txpwrlimit_cfg=nxp/aw693_rgpower_WW_V3_1.bin
}
PCIEAW693_1 = {
txpwrlimit_cfg=nxp/aw693_rgpower_WW_V3_1.bin
}
SDAW693_0 = {
txpwrlimit_cfg=nxp/aw693_rgpower_WW_V3_1.bin
}
SDAW693_1 = {
txpwrlimit_cfg=nxp/aw693_rgpower_WW_V3_1.bin
}
SD9098_0 = {
txpwrlimit_cfg=nxp/rgpower_9098.bin
}
SD9098_1 = {
txpwrlimit_cfg=nxp/rgpower_9098.bin
}
SDIW416 = {
cal_data_cfg=none
txpwrlimit_cfg=nxp/rgpower_iw416.bin
}
SD8801 = {
}
SDIW610 = {
txpwrlimit_cfg=nxp/iw610_rgpower_WW_V3_1.bin
}
USBIW610 = {
txpwrlimit_cfg=nxp/iw610_rgpower_WW_V3_1.bin
}
SDIW612 = {
txpwrlimit_cfg=nxp/rgpower_IW612.bin
}

4877
mapp/mlanconfig/mlanconfig.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,797 @@
/** @file mlanconfig.h
*
* @brief This file contains definitions for application
*
*
* Copyright 2008-2021,2025 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
11/26/2008: initial version
************************************************************************/
#ifndef _MLANCONFIG_H_
#define _MLANCONFIG_H_
/** Include header files */
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <linux/if.h>
#include <linux/wireless.h>
#include <sys/types.h>
#include <linux/if_ether.h>
#include <time.h>
#include <endian.h>
#if (BYTE_ORDER == LITTLE_ENDIAN)
#undef BIG_ENDIAN_SUPPORT
#endif
/** Type definition: boolean */
typedef enum { FALSE, TRUE } boolean;
/**
* This macro specifies the attribute pack used for structure packing
*/
#ifndef __ATTRIB_PACK__
#define __ATTRIB_PACK__ __attribute__((packed))
#endif
/** 16 bits byte swap */
#define swap_byte_16(x) \
((t_u16)((((t_u16)(x)&0x00ffU) << 8) | (((t_u16)(x)&0xff00U) >> 8)))
/** 32 bits byte swap */
#define swap_byte_32(x) \
((t_u32)((((t_u32)(x)&0x000000ffUL) << 24) | \
(((t_u32)(x)&0x0000ff00UL) << 8) | \
(((t_u32)(x)&0x00ff0000UL) >> 8) | \
(((t_u32)(x)&0xff000000UL) >> 24)))
/** Convert to correct endian format */
#ifdef BIG_ENDIAN_SUPPORT
/** CPU to little-endian convert for 16-bit */
#define cpu_to_le16(x) swap_byte_16(x)
/** CPU to little-endian convert for 32-bit */
#define cpu_to_le32(x) swap_byte_32(x)
/** Little-endian to CPU convert for 16-bit */
#define le16_to_cpu(x) swap_byte_16(x)
/** Little-endian to CPU convert for 32-bit */
#define le32_to_cpu(x) swap_byte_32(x)
#else
/** Do nothing */
#define cpu_to_le16(x) (x)
/** Do nothing */
#define cpu_to_le32(x) (x)
/** Do nothing */
#define le16_to_cpu(x) (x)
/** Do nothing */
#define le32_to_cpu(x) (x)
#endif
/** Character, 1 byte */
typedef char t_s8;
/** Unsigned character, 1 byte */
typedef unsigned char t_u8;
/** Short integer */
typedef signed short t_s16;
/** Unsigned short integer */
typedef unsigned short t_u16;
/** Integer */
typedef signed int t_s32;
/** Unsigned integer */
typedef unsigned int t_u32;
/** Long long integer */
typedef signed long long t_s64;
/** Unsigned long long integer */
typedef unsigned long long t_u64;
/** Void pointer (4-bytes) */
typedef void t_void;
/** Success */
#define MLAN_STATUS_SUCCESS (0)
/** Failure */
#define MLAN_STATUS_FAILURE (-1)
t_s8 *mlan_config_get_line(FILE *fp, t_s8 *s, t_s32 size, int *line);
int get_priv_ioctl(char *ioctl_name, int *ioctl_val, int *subioctl_val);
int fparse_for_hex(FILE *fp, t_u8 *dst);
/**
* Hex or Decimal to Integer
* @param num string to convert into decimal or hex
*/
#define A2HEXDECIMAL(num) \
(strncasecmp("0x", (num), 2) ? (unsigned int)strtoll((num), NULL, 0) : \
a2hex((num)))
/** Convert character to integer */
#define CHAR2INT(x) (((x) >= 'A') ? ((x) - 'A' + 10) : ((x) - '0'))
/** Convert TLV header from little endian format to CPU format */
#define endian_convert_tlv_header_in(x) \
{ \
(x)->tag = le16_to_cpu((x)->tag); \
(x)->length = le16_to_cpu((x)->length); \
}
/** Convert TLV header to little endian format from CPU format */
#define endian_convert_tlv_header_out(x) \
{ \
(x)->tag = cpu_to_le16((x)->tag); \
(x)->length = cpu_to_le16((x)->length); \
}
/** Private command ID to pass custom IE list */
#define CUSTOM_IE_CFG (SIOCDEVPRIVATE + 13)
/* TLV Definitions */
/** TLV header */
#define TLVHEADER /** Tag */ \
t_u16 tag; \
/** Length */ \
t_u16 length
/** Maximum IE buffer length */
#define MAX_IE_BUFFER_LEN 256
/** TLV: Management IE list */
#define MRVL_MGMT_IE_LIST_TLV_ID (PROPRIETARY_TLV_BASE_ID + 0x69) // 0x0169
/** TLV: Max Management IE */
#define MRVL_MAX_MGMT_IE_TLV_ID (PROPRIETARY_TLV_BASE_ID + 0xaa) // 0x01aa
/** custom IE info */
typedef struct _custom_ie_info {
/** size of buffer */
t_u16 buf_size;
/** no of buffers of buf_size */
t_u16 buf_count;
} __ATTRIB_PACK__ custom_ie_info;
/** TLV buffer : custom IE */
typedef struct _tlvbuf_max_mgmt_ie {
/** Header */
TLVHEADER;
/** No of tuples */
t_u16 count;
/** custom IE info tuples */
custom_ie_info info[];
} __ATTRIB_PACK__ tlvbuf_max_mgmt_ie;
/** custom IE */
typedef struct _custom_ie {
/** IE Index */
t_u16 ie_index;
/** Mgmt Subtype Mask */
t_u16 mgmt_subtype_mask;
/** IE Length */
t_u16 ie_length;
/** IE buffer */
t_u8 ie_buffer[];
} __ATTRIB_PACK__ custom_ie;
/** TLV buffer : custom IE */
typedef struct _tlvbuf_custom_ie {
/** Header */
TLVHEADER;
/** custom IE data */
custom_ie ie_data[];
} __ATTRIB_PACK__ tlvbuf_custom_ie;
/** Maximum length of lines in configuration file */
#define MAX_CONFIG_LINE 1024
/** Ethernet address length */
#define ETH_ALEN 6
/** MAC BROADCAST */
#define MAC_BROADCAST 0x1FF
/** MAC MULTICAST */
#define MAC_MULTICAST 0x1FE
/** pkt_header */
typedef struct _pkt_header {
/** pkt_len */
t_u32 pkt_len;
/** pkt_type */
t_u32 TxPktType;
/** tx control */
t_u32 TxControl;
} pkt_header;
/** wlan_802_11_header packet from FW with length */
typedef struct _wlan_mgmt_frame_tx {
/** Packet Length */
t_u16 frm_len;
/** Frame Control */
t_u16 frm_ctl;
/** Duration ID */
t_u16 duration_id;
/** Address1 */
t_u8 addr1[ETH_ALEN];
/** Address2 */
t_u8 addr2[ETH_ALEN];
/** Address3 */
t_u8 addr3[ETH_ALEN];
/** Sequence Control */
t_u16 seq_ctl;
/** Address4 */
t_u8 addr4[ETH_ALEN];
/** Frame payload */
t_u8 payload[];
} __ATTRIB_PACK__ wlan_mgmt_frame_tx;
/** frame tx ioctl number */
#define FRAME_TX_IOCTL (SIOCDEVPRIVATE + 12)
/** band BG */
#define BAND_BG 0
/** band A */
#define BAND_A 1
/** secondary channel is above */
#define SECOND_CHANNEL_ABOVE 0x1
/** secondary channel is below */
#define SECOND_CHANNEL_BELOW 0x3
/** NO PERIODIC SWITCH */
#define NO_PERIODIC_SWITCH 0
/** Enable periodic channel switch */
#define ENABLE_PERIODIC_SWITCH 1
/** Min channel value for BG band */
#define MIN_BG_CHANNEL 1
/** Max channel value for BG band */
#define MAX_BG_CHANNEL 14
/** Max channel value for A band */
#define MIN_A_CHANNEL 36
/** Max channel value for A band */
#define MAX_A_CHANNEL 252
/** Host Command ioctl number */
#define TDLS_IOCTL (SIOCDEVPRIVATE + 5)
/** TDLS action definitions */
/** Action ID for TDLS config */
#define ACTION_TDLS_CONFIG 0x0000
/** Action ID for TDLS setinfo request */
#define ACTION_TDLS_SETINFO 0x0001
/** Action ID for TDLS Discovery request */
#define ACTION_TDLS_DISCOVERY 0x0002
/** Action ID for TDLS setup request */
#define ACTION_TDLS_SETUP 0x0003
/** Action ID for TDLS Teardown request */
#define ACTION_TDLS_TEARDOWN 0x0004
/** Action ID for TDLS power mode */
#define ACTION_TDLS_POWER_MODE 0x0005
/**Action ID for init TDLS Channel Switch*/
#define ACTION_TDLS_INIT_CHAN_SWITCH 0x06
/** Action ID for stop TDLS Channel Switch */
#define ACTION_TDLS_STOP_CHAN_SWITCH 0x07
/** Action ID for configure CS related parameters */
#define ACTION_TDLS_CS_PARAMS 0x08
/** Action ID for TDLS Disable Channel switch */
#define ACTION_TDLS_CS_DISABLE 0x09
/** Action ID for TDLS Link status */
#define ACTION_TDLS_LINK_STATUS 0x000A
/** Action ID for TDLS CS immediate return */
#define ACTION_TDLS_DEBUG_CS_RET_IM 0xFFF7
/** Action ID for TDLS Stop RX */
#define ACTION_TDLS_DEBUG_STOP_RX 0xFFF8
/** Action ID for TDLS Allow weak security */
#define ACTION_TDLS_DEBUG_ALLOW_WEAK_SECURITY 0xFFF9
/** Action ID for TDLS Ignore key lifetime expiry */
#define ACTION_TDLS_DEBUG_IGNORE_KEY_EXPIRY 0xFFFA
/** Action ID for TDLS Higher/Lower mac Test */
#define ACTION_TDLS_DEBUG_HIGHER_LOWER_MAC 0xFFFB
/** Action ID for TDLS Prohibited Test */
#define ACTION_TDLS_DEBUG_SETUP_PROHIBITED 0xFFFC
/** Action ID for TDLS Existing link Test */
#define ACTION_TDLS_DEBUG_SETUP_SAME_LINK 0xFFFD
/** Action ID for TDLS Fail Setup Confirm */
#define ACTION_TDLS_DEBUG_FAIL_SETUP_CONFIRM 0xFFFE
/** Action ID for TDLS WRONG BSS Test */
#define ACTION_TDLS_DEBUG_WRONG_BSS 0xFFFF
/** TLV type : Rates */
#define TLV_TYPE_RATES 0x0001
/** TLV type : Domain */
#define TLV_TYPE_DOMAIN 0x0007
/** TLV type : Supported channels */
#define TLV_TYPE_SUPPORTED_CHANNELS 0x0024
/** TLV type : HT Capabilities */
#define TLV_TYPE_HT_CAP 0x002d
/** TLV type : Qos Info */
#define TLV_TYPE_QOSINFO 0x002e
/** TLV type : RSN IE */
#define TLV_TYPE_RSN_IE 0x0030
/** TLV type : extended supported rates */
#define TLV_EXTENDED_SUPPORTED_RATES 0x0032
/** TLV type : timeout interval */
#define TLV_TIMEOUT_INTERVAL 0x0038
/** TLV type : Regulatory classes */
#define TLV_TYPE_REGULATORY_CLASSES 0x003b
/** TLV type : HT Information */
#define TLV_TYPE_HT_INFO 0x003d
/** TLV type : 20/40 BSS Coexistence */
#define TLV_TYPE_2040BSS_COEXISTENCE 0x0048
/** TLv Type : Link identifier */
#define TLV_LINK_IDENTIFIER 0x0065
/** TLV type : Extended capabilities */
#define TLV_TYPE_EXTCAP 0x007f
/** TLV type : VHT capabilities */
#define TLV_TYPE_VHT_CAP 0x00BF
/** TLV type : VHT operations */
#define TLV_TYPE_VHT_OPER 0x00C0
/** Length of Basic MCS MAP */
#define VHT_MCS_MAP_LEN 2
/** Country code length */
#define COUNTRY_CODE_LEN 3
/** Length of Group Cipher Suite */
#define GROUP_CIPHER_SUITE_LEN 4
/** Length of Pairwise Cipher Suite */
#define PAIRWISE_CIPHER_SUITE_LEN 4
/** Length of AKM Suite */
#define AKM_SUITE_LEN 4
/** PMKID length */
#define PMKID_LEN 16
/** Maximum number of pairwise_cipher_suite */
#define MAX_PAIRWISE_CIPHER_SUITE_COUNT 2
/** Maximum number of AKM suite */
#define MAX_AKM_SUITE_COUNT 2
/** Maximum number of PMKID list count */
#define MAX_PMKID_COUNT 2
/** Length of MCS set */
#define MCS_SET_LEN 16
/** Version in RSN IE */
#define VERSION_RSN_IE 0x0001
/** tdls setinfo */
typedef struct _tdls_setinfo {
/** Action */
t_u16 action;
/** (TLV + capInfo) length */
t_u16 tlv_len;
/** Capability Info */
t_u16 cap_info;
/** tdls info */
t_u8 tlv_buffer[];
} __ATTRIB_PACK__ tdls_setinfo;
/** tdls discovery */
typedef struct _tdls_discovery {
/** Action */
t_u16 action;
/** Peer MAC address */
t_u8 peer_mac[ETH_ALEN];
} __ATTRIB_PACK__ tdls_discovery;
/** tdls link status */
typedef struct _tdls_links_status {
/** Action */
t_u16 action;
} __ATTRIB_PACK__ tdls_link_status;
/** tdls discovery response */
typedef struct _tdls_discovery_resp {
/** Action */
t_u16 action;
/** payload length */
t_u16 payload_len;
/** peer mac Address */
t_u8 peer_mac[ETH_ALEN];
/** RSSI */
signed char rssi;
/** Cap Info */
t_u16 cap_info;
/** TLV buffer */
t_u8 tlv_buffer[];
} __ATTRIB_PACK__ tdls_discovery_resp;
/** tdls each link rate information */
typedef struct _tdls_link_rate_info {
/** Tx Data Rate */
t_u8 tx_data_rate;
/** Tx Rate HT info*/
t_u8 tx_rate_htinfo;
} __ATTRIB_PACK__ tdls_link_rate_info;
/** tdls each link status */
typedef struct _tdls_each_link_status {
/** peer mac Address */
t_u8 peer_mac[ETH_ALEN];
/** Link Flags */
t_u8 link_flags;
/** Traffic Status */
t_u8 traffic_status;
/** Tx Failure Count */
t_u8 tx_fail_count;
/** Channel Number */
t_u32 active_channel;
/** Last Data RSSI in dBm */
t_s16 data_rssi_last;
/** Last Data NF in dBm */
t_s16 data_nf_last;
/** AVG DATA RSSI in dBm */
t_s16 data_rssi_avg;
/** AVG DATA NF in dBm */
t_s16 data_nf_avg;
union {
/** tdls rate info */
tdls_link_rate_info rate_info;
/** final rate value*/
t_u16 final_data_rate;
} u;
/** Security Method */
t_u8 security_method;
/** Key Lifetime */
t_u32 key_lifetime;
/** Key Length */
t_u8 key_length;
/** actual key */
t_u8 key[];
} __ATTRIB_PACK__ tdls_each_link_status;
/** tdls link status response */
typedef struct _tdls_link_status_resp {
/** Action */
t_u16 action;
/** payload length */
t_u16 payload_len;
/** number of links */
t_u8 active_links;
/** structure for link status */
tdls_each_link_status link_stats[1];
} __ATTRIB_PACK__ tdls_link_status_resp;
/** tdls setup */
typedef struct _tdls_setup {
/** Action */
t_u16 action;
/** Peer MAC address */
t_u8 peer_mac[ETH_ALEN];
/** Time to wait for response from peer*/
t_u32 wait_time;
/** Key Life Time */
t_u32 key_life_time;
} __ATTRIB_PACK__ tdls_setup;
/** tdls tear down */
typedef struct _tdls_tear_down {
/** Action */
t_u16 action;
/** Peer MAC address */
t_u8 peer_mac[ETH_ALEN];
/** Reason code */
t_u16 reason_code;
} __ATTRIB_PACK__ tdls_teardown;
/** tdls power mode */
typedef struct _tdls_power_mode {
/** Action */
t_u16 action;
/** Peer MAC address */
t_u8 peer_mac[ETH_ALEN];
/** Power mode */
t_u16 power_mode;
} __ATTRIB_PACK__ tdls_powermode;
/** tdls channel switch info */
typedef struct _tdls_channel_switch {
/** Action */
t_u16 action;
/** peer mac Address */
t_u8 peer_mac[ETH_ALEN];
/** Channel Switch primary channel no */
t_u8 primary_channel;
/** Channel Switch secondary channel offset */
t_u8 secondary_channel_offset;
/** Channel Switch Band */
t_u8 band;
/** Channel Switch time*/
t_u16 switch_time;
/** Channel Switch timeout*/
t_u16 switch_timeout;
/** Channel Regulatory class*/
t_u8 regulatory_class;
/** Channel Switch periodicity*/
t_u8 periodicity;
} __ATTRIB_PACK__ tdls_channel_switch;
/** tdls stop channel switch */
typedef struct _tdls_stop_chan_switch {
/** Action */
t_u16 action;
/** Peer MAC address */
t_u8 peer_mac[ETH_ALEN];
} __ATTRIB_PACK__ tdls_stop_chan_switch;
/** tdls disable channel switch */
typedef struct _tdls_disable_cs {
/** Action */
t_u16 action;
/** Data*/
t_u16 data;
} __ATTRIB_PACK__ tdls_disable_cs, tdls_config;
/** tdls channel switch parameters */
typedef struct _tdls_cs_params {
/** Action */
t_u16 action;
/** unit time, multiples of 10ms */
t_u8 unit_time;
/** threshold for other link */
t_u8 threshold_otherlink;
/** threshold for direct link */
t_u8 threshold_directlink;
} __ATTRIB_PACK__ tdls_cs_params;
/** tdls debug */
typedef struct _tdls_debug {
/** Action */
t_u16 action;
/** Data */
t_u8 data[];
} __ATTRIB_PACK__ tdls_debug;
/** TLV header */
#define TLVHEADER /** Tag */ \
t_u16 tag; \
/** Length */ \
t_u16 length
/** Length of TLV header */
#define TLVHEADER_LEN 4
/** Data structure for subband set */
typedef struct _IEEEtypes_SubbandSet_t {
/** First channel */
t_u8 first_chan;
/** Number of channels */
t_u8 no_of_chan;
/** Maximum Tx power */
t_u8 max_tx_pwr;
} __ATTRIB_PACK__ IEEEtypes_SubbandSet_t, *pIEEEtypes_SubbandSet_t;
/** tlvbuf_DomainParamSet_t */
typedef struct _tlvbuf_DomainParamSet {
/** Header */
TLVHEADER;
/** Country code */
t_u8 country_code[COUNTRY_CODE_LEN];
/** Set of subbands */
IEEEtypes_SubbandSet_t sub_band[];
} __ATTRIB_PACK__ tlvbuf_DomainParamSet_t;
/** Data structure of WMM QoS information */
typedef struct _IEEEtypes_WmmQosInfo_t {
#ifdef BIG_ENDIAN_SUPPORT
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
/** Reserved */
t_u8 reserved : 3;
/** Parameter set count */
t_u8 para_set_count : 4;
#else
/** Parameter set count */
t_u8 para_set_count : 4;
/** Reserved */
t_u8 reserved : 3;
/** QoS UAPSD */
t_u8 qos_uapsd : 1;
#endif /* BIG_ENDIAN_SUPPORT */
} __ATTRIB_PACK__ IEEEtypes_WmmQosInfo_t;
/** Qos Info TLV */
typedef struct _tlvbuf_QosInfo_t {
/** Header */
TLVHEADER;
/** QosInfo */
union {
/** QosInfo bitfield */
IEEEtypes_WmmQosInfo_t qos_info;
/** QosInfo byte */
t_u8 qos_info_byte;
} u;
} __ATTRIB_PACK__ tlvbuf_QosInfo_t;
/** HT Capabilities Data */
typedef struct _HTCap_t {
/** HT Capabilities Info field */
t_u16 ht_cap_info;
/** A-MPDU Parameters field */
t_u8 ampdu_param;
/** Supported MCS Set field */
t_u8 supported_mcs_set[16];
/** HT Extended Capabilities field */
t_u16 ht_ext_cap;
/** Transmit Beamforming Capabilities field */
t_u32 tx_bf_cap;
/** Antenna Selection Capability field */
t_u8 asel;
} __ATTRIB_PACK__ HTCap_t, *pHTCap_t;
/** HT Information Data */
typedef struct _HTInfo_t {
/** Primary channel */
t_u8 pri_chan;
/** Field 2 */
t_u8 field2;
/** Field 3 */
t_u16 field3;
/** Field 4 */
t_u16 field4;
/** Bitmap indicating MCSs supported by all HT STAs in the BSS */
t_u8 basic_mcs_set[16];
} __ATTRIB_PACK__ HTInfo_t, *pHTInfo_t;
/** 20/40 BSS Coexistence Data */
typedef struct _BSSCo2040_t {
/** 20/40 BSS Coexistence value */
t_u8 bss_co_2040_value;
} __ATTRIB_PACK__ BSSCo2040_t, *pBSSCo2040_t;
/** HT Capabilities element */
typedef struct _tlvbuf_HTCap_t {
/** Header */
TLVHEADER;
/** HTCap struct */
HTCap_t ht_cap;
} __ATTRIB_PACK__ tlvbuf_HTCap_t;
/** HT Information element */
typedef struct _tlvbuf_HTInfo_t {
/** Header */
TLVHEADER;
/** HTInfo struct */
HTInfo_t ht_info;
} __ATTRIB_PACK__ tlvbuf_HTInfo_t;
/** VHT MCS rate set field, refer to 802.11ac */
typedef struct _VHT_MCS_set {
t_u16 rx_mcs_map;
t_u16 rx_max_rate; /* bit 29-31 reserved */
t_u16 tx_mcs_map;
t_u16 tx_max_rate; /* bit 61-63 reserved */
} __ATTRIB_PACK__ VHT_MCS_set_t, *pVHT_MCS_set_t;
typedef struct _VHT_capa {
t_u32 vht_cap_info;
VHT_MCS_set_t mcs_sets;
} __ATTRIB_PACK__ VHT_capa_t, *pVHT_capa_t;
/** VHT Capabilities IE */
typedef struct _IEEEtypes_VHTCap_t {
/** Header */
TLVHEADER;
/** VHTInfo struct */
VHT_capa_t vht_cap;
} __ATTRIB_PACK__ tlvbuf_VHTCap_t, *ptlvbuf_VHTCap_t;
/** VHT Operations IE */
typedef struct _IEEEtypes_VHTOprat_t {
/** Header */
TLVHEADER;
/** VHTOpra struct */
t_u8 chan_width;
t_u8 chan_cf1;
t_u8 chan_cf2;
/** Basic MCS set map, each 2 bits stands for a Nss */
t_u8 basic_mcs_map[VHT_MCS_MAP_LEN];
} __ATTRIB_PACK__ tlvbuf_VHTOpra_t, *ptlvbuf_VHTOpra_t;
/** 20/40 BSS Coexistence element */
typedef struct _tlvbuf_2040BSSCo_t {
/** Header */
TLVHEADER;
/** BSSCo2040_t struct */
BSSCo2040_t bss_co_2040;
} __ATTRIB_PACK__ tlvbuf_2040BSSCo_t;
/** Extended Capabilities element */
typedef struct _tlvbuf_ExtCap_t {
/** Header */
TLVHEADER;
/** ExtCap_t struct */
t_u8 ext_cap[];
} __ATTRIB_PACK__ tlvbuf_ExtCap_t;
/** tlvbuf_RatesParamSet_t */
typedef struct _tlvbuf_RatesParamSet_t {
/** Header */
TLVHEADER;
/** Rates */
t_u8 rates[];
} __ATTRIB_PACK__ tlvbuf_RatesParamSet_t;
/* IEEE Supported Channel sub-band description (7.3.2.19) */
/* Sub-band description used in the supported channels element. */
typedef struct _IEEEtypes_SupportChan_Subband_t {
t_u8 start_chan; /**< Starting channel in the subband */
t_u8 num_chans; /**< Number of channels in the subband */
} __ATTRIB_PACK__ IEEEtypes_SupportChan_Subband_t;
/* IEEE Supported Channel element (7.3.2.19) */
/**
* Sent in association requests. Details the sub-bands and number
* of channels supported in each subband
*/
typedef struct _tlvbuf_SupportedChannels_t {
/** Header */
TLVHEADER; /**< IEEE Element ID = 36 */
/** Configured sub-bands information in the element */
IEEEtypes_SupportChan_Subband_t subband[];
} __ATTRIB_PACK__ tlvbuf_SupportedChannels_t;
/* IEEE Supported Regulatory Classes description (7.3.2.54) */
typedef struct _IEEEtypes_RegulatoryClass_t {
/** current regulatory class */
t_u8 cur_regulatory_class;
/** supported regulatory class list */
t_u8 regulatory_classes_list[];
} __ATTRIB_PACK__ IEEEtypes_RegulatoryClass_t;
/* IEEE Supported Regulatory Classes TLV (7.3.2.54) */
typedef struct _tlvbuf_RegulatoryClass_t {
/** Header */
TLVHEADER; /**< IEEE Element ID = 59 */
/** supported regulatory class */
IEEEtypes_RegulatoryClass_t regulatory_class;
} __ATTRIB_PACK__ tlvbuf_RegulatoryClass_t;
/** tlvbuf_RsnParamSet_t */
typedef struct _tlvbuf_RsnParamSet_t {
/** Header */
TLVHEADER;
/** Version */
t_u16 version;
/** Group Cipher Suite */
t_u8 group_cipher_suite[4];
/** Pairwise Cipher Suite count */
t_u16 pairwise_cipher_count;
/** Pairwise Cipher Suite */
t_u8 pairwise_cipher_suite[];
#if 0
/* below is only to keep a reference
* of the remaining elements in the
* structure
*/
/** AKM Suite Sount */
t_u16 akm_suite_count;
/** AKM Suite */
t_u8 akm_suite[0];
/** RSN Capability */
t_u16 rsn_capability;
/** PMKID Count */
t_u16 pmkid_count;
/** PMKID list */
t_u8 pmkid_list[];
#endif
} __ATTRIB_PACK__ tlvbuf_RsnParamSet_t;
extern t_s32 sockfd; /**< socket */
extern t_s8 dev_name[IFNAMSIZ]; /**< device name */
#endif /* _MLANCONFIG_H_ */

View file

@ -0,0 +1,969 @@
/** @file mlanhostcmd.c
*
* @brief This file contains mlanconfig helper functions
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
11/26/2008: initial version
************************************************************************/
#include "mlanconfig.h"
#include "mlanhostcmd.h"
#ifndef MIN
/** Find minimum value */
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif /* MIN */
/********************************************************
Local Variables
********************************************************/
/********************************************************
Global Variables
********************************************************/
/********************************************************
Local Functions
********************************************************/
/**
* @brief get hostcmd data
*
* @param ln A pointer to line number
* @param buf A pointer to hostcmd data
* @param size A pointer to the return size of hostcmd buffer
* @return MLAN_STATUS_SUCCESS
*/
static int mlan_get_hostcmd_data(FILE *fp, int *ln, t_u8 *buf, t_u16 *size)
{
t_s32 errors = 0, i;
t_s8 line[512], *pos, *pos1, *pos2, *pos3;
t_u16 len;
while ((pos = mlan_config_get_line(fp, line, sizeof(line), ln))) {
(*ln)++;
if (strcmp(pos, "}") == 0) {
break;
}
pos1 = strchr(pos, ':');
if (pos1 == NULL) {
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
pos);
errors++;
continue;
}
*pos1++ = '\0';
pos2 = strchr(pos1, '=');
if (pos2 == NULL) {
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
pos);
errors++;
continue;
}
*pos2++ = '\0';
len = a2hex_or_atoi(pos1);
if (len < 1 || len > MRVDRV_SIZE_OF_CMD_BUFFER) {
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
pos);
errors++;
continue;
}
*size += len;
if (*pos2 == '"') {
pos2++;
if ((pos3 = strchr(pos2, '"')) == NULL) {
printf("Line %d: invalid quotation '%s'\n", *ln,
pos);
errors++;
continue;
}
*pos3 = '\0';
memset(buf, 0, len);
memmove(buf, pos2, MIN(strlen(pos2), len));
buf += len;
} else if (*pos2 == '\'') {
pos2++;
if ((pos3 = strchr(pos2, '\'')) == NULL) {
printf("Line %d: invalid quotation '%s'\n", *ln,
pos);
errors++;
continue;
}
*pos3 = ',';
for (i = 0; i < len; i++) {
if ((pos3 = strchr(pos2, ',')) != NULL) {
*pos3 = '\0';
*buf++ = (t_u8)a2hex_or_atoi(pos2);
pos2 = pos3 + 1;
} else
*buf++ = 0;
}
} else if (*pos2 == '{') {
t_u16 tlvlen = 0, tmp_tlvlen;
mlan_get_hostcmd_data(fp, ln, buf + len, &tlvlen);
tmp_tlvlen = tlvlen;
while (len--) {
*buf++ = (t_u8)(tmp_tlvlen & 0xff);
tmp_tlvlen >>= 8;
}
*size += tlvlen;
buf += tlvlen;
} else {
t_u32 value = a2hex_or_atoi(pos2);
while (len--) {
*buf++ = (t_u8)(value & 0xff);
value >>= 8;
}
}
}
return MLAN_STATUS_SUCCESS;
}
/********************************************************
Global Functions
********************************************************/
/**
* @brief convert char to hex integer
*
* @param chr char to convert
* @return hex integer or 0
*/
int hexval(t_s32 chr)
{
if (chr >= '0' && chr <= '9')
return chr - '0';
if (chr >= 'A' && chr <= 'F')
return chr - 'A' + 10;
if (chr >= 'a' && chr <= 'f')
return chr - 'a' + 10;
return 0;
}
/**
* @brief Hump hex data
*
* @param prompt A pointer prompt buffer
* @param p A pointer to data buffer
* @param len the len of data buffer
* @param delim delim char
* @return hex integer
*/
t_void hexdump(t_s8 *prompt, t_void *p, t_s32 len, t_s8 delim)
{
t_s32 i;
t_u8 *s = p;
if (prompt) {
printf("%s: len=%d\n", prompt, (int)len);
}
for (i = 0; i < len; i++) {
if (i != len - 1)
printf("%02x%c", *s++, delim);
else
printf("%02x\n", *s);
if ((i + 1) % 16 == 0)
printf("\n");
}
printf("\n");
}
/**
* @brief convert char to hex integer
*
* @param chr char
* @return hex integer
*/
t_u8 hexc2bin(t_s8 chr)
{
if (chr >= '0' && chr <= '9')
chr -= '0';
else if (chr >= 'A' && chr <= 'F')
chr -= ('A' - 10);
else if (chr >= 'a' && chr <= 'f')
chr -= ('a' - 10);
return chr;
}
/**
* @brief convert string to hex integer
*
* @param s A pointer string buffer
* @return hex integer
*/
t_u32 a2hex(t_s8 *s)
{
t_u32 val = 0;
if (!strncasecmp("0x", s, 2)) {
s += 2;
}
while (*s && isxdigit((unsigned char)*s)) {
val = (val << 4) + hexc2bin(*s++);
}
return val;
}
/*
* @brief convert String to integer
*
* @param value A pointer to string
* @return integer
*/
t_u32 a2hex_or_atoi(t_s8 *value)
{
if (value[0] == '0' && (value[1] == 'X' || value[1] == 'x')) {
return a2hex(value + 2);
} else if (isdigit((unsigned char)*value)) {
return atoi(value);
} else {
return *value;
}
}
/**
* @brief convert string to hex
*
* @param ptr A pointer to data buffer
* @param chr A pointer to return integer
* @return A pointer to next data field
*/
t_s8 *convert2hex(t_s8 *ptr, t_u8 *chr)
{
t_u8 val;
for (val = 0; *ptr && isxdigit((unsigned char)*ptr); ptr++) {
val = (val * 16) + hexval(*ptr);
}
*chr = val;
return ptr;
}
/**
* @brief Check the Hex String
* @param s A pointer to the string
* @return MLAN_STATUS_SUCCESS --HexString, MLAN_STATUS_FAILURE --not
* HexString
*/
int ishexstring(t_s8 *s)
{
int ret = MLAN_STATUS_FAILURE;
t_s32 tmp;
if (!strncasecmp("0x", s, 2)) {
s += 2;
}
while (*s) {
tmp = toupper((unsigned char)*s);
if (((tmp >= 'A') && (tmp <= 'F')) ||
((tmp >= '0') && (tmp <= '9'))) {
ret = MLAN_STATUS_SUCCESS;
} else {
ret = MLAN_STATUS_FAILURE;
break;
}
s++;
}
return ret;
}
/**
* @brief Convert String to Integer
* @param buf A pointer to the string
* @return Integer
*/
int atoval(t_s8 *buf)
{
if (!strncasecmp(buf, "0x", 2))
return a2hex(buf + 2);
else if (!ishexstring(buf))
return a2hex(buf);
else
return atoi(buf);
}
/**
* @brief Prepare host-command buffer
* @param fp File handler
* @param cmd_name Command name
* @param buf A pointer to comand buffer
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int prepare_host_cmd_buffer(FILE *fp, char *cmd_name, t_u8 *buf)
{
t_s8 line[256], cmdname[256], *pos, cmdcode[10];
HostCmd_DS_GEN *hostcmd;
int ln = 0;
int cmdname_found = 0, cmdcode_found = 0;
memset(buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
hostcmd = (HostCmd_DS_GEN *)buf;
hostcmd->command = 0xffff;
snprintf(cmdname, sizeof(cmdname), "%s={", cmd_name);
cmdname_found = 0;
while ((pos = mlan_config_get_line(fp, line, sizeof(line), &ln))) {
if (strcmp(pos, cmdname) == 0) {
t_u16 len = 0;
cmdname_found = 1;
snprintf(cmdcode, sizeof(cmdcode), "CmdCode=");
cmdcode_found = 0;
while ((pos = mlan_config_get_line(
fp, line, sizeof(line), &ln))) {
if (strncmp(pos, cmdcode, strlen(cmdcode)) ==
0) {
cmdcode_found = 1;
hostcmd->command = a2hex_or_atoi(
pos + strlen(cmdcode));
hostcmd->size = S_DS_GEN;
mlan_get_hostcmd_data(
fp, &ln, buf + hostcmd->size,
&len);
hostcmd->size += len;
break;
}
}
if (!cmdcode_found) {
fprintf(stderr,
"mlanconfig: CmdCode not found in conf file\n");
return MLAN_STATUS_FAILURE;
}
break;
}
}
if (!cmdname_found) {
fprintf(stderr,
"mlanconfig: cmdname '%s' is not found in conf file\n",
cmd_name);
return MLAN_STATUS_FAILURE;
}
hostcmd->seq_num = 0;
hostcmd->result = 0;
hostcmd->command = cpu_to_le16(hostcmd->command);
hostcmd->size = cpu_to_le16(hostcmd->size);
return MLAN_STATUS_SUCCESS;
}
/** Config data header length */
#define CFG_DATA_HEADER_LEN 6
/**
* @brief Prepare cfg-data buffer
* @param argc number of arguments
* @param argv A pointer to arguments array
* @param fp File handler
* @param buf A pointer to comand buffer
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int prepare_cfg_data_buffer(int argc, char *argv[], FILE *fp, t_u8 *buf)
{
int ln = 0, type;
HostCmd_DS_GEN *hostcmd;
HostCmd_DS_802_11_CFG_DATA *pcfg_data;
memset(buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
hostcmd = (HostCmd_DS_GEN *)buf;
hostcmd->command = cpu_to_le16(HostCmd_CMD_CFG_DATA);
pcfg_data = (HostCmd_DS_802_11_CFG_DATA *)(buf + S_DS_GEN);
pcfg_data->action =
(argc == 4) ? HostCmd_ACT_GEN_GET : HostCmd_ACT_GEN_SET;
type = atoi(argv[3]);
if ((type < 1) || (type > 2)) {
fprintf(stderr, "mlanconfig: Invalid register type\n");
return MLAN_STATUS_FAILURE;
} else {
pcfg_data->type = type;
}
if (argc == 5) {
ln = fparse_for_hex(fp, pcfg_data->data);
}
pcfg_data->data_len = ln;
hostcmd->size = cpu_to_le16(pcfg_data->data_len + S_DS_GEN +
CFG_DATA_HEADER_LEN);
pcfg_data->data_len = cpu_to_le16(pcfg_data->data_len);
pcfg_data->type = cpu_to_le16(pcfg_data->type);
pcfg_data->action = cpu_to_le16(pcfg_data->action);
hostcmd->seq_num = 0;
hostcmd->result = 0;
return MLAN_STATUS_SUCCESS;
}
/**
* @brief Process host_cmd response
* @param buf A pointer to the response buffer
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int process_host_cmd_resp(t_u8 *buf)
{
HostCmd_DS_GEN *hostcmd = (HostCmd_DS_GEN *)buf;
int ret = MLAN_STATUS_SUCCESS;
hostcmd->command = le16_to_cpu(hostcmd->command);
hostcmd->size = le16_to_cpu(hostcmd->size);
hostcmd->seq_num = le16_to_cpu(hostcmd->seq_num);
hostcmd->result = le16_to_cpu(hostcmd->result);
hostcmd->command &= ~HostCmd_RET_BIT;
if (!hostcmd->result) {
switch (hostcmd->command) {
case HostCmd_CMD_CFG_DATA: {
HostCmd_DS_802_11_CFG_DATA *pstcfgData =
(HostCmd_DS_802_11_CFG_DATA *)(buf + S_DS_GEN);
pstcfgData->data_len =
le16_to_cpu(pstcfgData->data_len);
pstcfgData->action = le16_to_cpu(pstcfgData->action);
if (pstcfgData->action == HostCmd_ACT_GEN_GET) {
hexdump("cfgdata", pstcfgData->data,
pstcfgData->data_len, ' ');
}
break;
}
case HostCmd_CMD_802_11_TPC_ADAPT_REQ: {
mlan_ioctl_11h_tpc_resp *tpcIoctlResp =
(mlan_ioctl_11h_tpc_resp *)(buf + S_DS_GEN);
if (tpcIoctlResp->status_code == 0) {
printf("tpcrequest: txPower(%d), linkMargin(%d), rssi(%d)\n",
tpcIoctlResp->tx_power,
tpcIoctlResp->link_margin,
tpcIoctlResp->rssi);
} else {
printf("tpcrequest: failure, status = %d\n",
tpcIoctlResp->status_code);
}
break;
}
case HostCmd_CMD_802_11_CRYPTO: {
t_u16 alg = le16_to_cpu(
(t_u16) * (buf + S_DS_GEN + sizeof(t_u16)));
if (alg == CIPHER_TEST_AES_CCM ||
alg == CIPHER_TEST_GCMP) {
HostCmd_DS_802_11_CRYPTO_AES_CCM *cmd_aes_ccm =
(HostCmd_DS_802_11_CRYPTO_AES_CCM
*)(buf + S_DS_GEN);
cmd_aes_ccm->encdec =
le16_to_cpu(cmd_aes_ccm->encdec);
cmd_aes_ccm->algorithm =
le16_to_cpu(cmd_aes_ccm->algorithm);
cmd_aes_ccm->key_length =
le16_to_cpu(cmd_aes_ccm->key_length);
cmd_aes_ccm->nonce_length =
le16_to_cpu(cmd_aes_ccm->nonce_length);
cmd_aes_ccm->AAD_length =
le16_to_cpu(cmd_aes_ccm->AAD_length);
cmd_aes_ccm->data.header.type = le16_to_cpu(
cmd_aes_ccm->data.header.type);
cmd_aes_ccm->data.header.len = le16_to_cpu(
cmd_aes_ccm->data.header.len);
printf("crypto_result: encdec=%d algorithm=%d, KeyLen=%d,"
" NonceLen=%d,AADLen=%d,dataLen=%d\n",
cmd_aes_ccm->encdec,
cmd_aes_ccm->algorithm,
cmd_aes_ccm->key_length,
cmd_aes_ccm->nonce_length,
cmd_aes_ccm->AAD_length,
cmd_aes_ccm->data.header.len);
hexdump("Key", cmd_aes_ccm->key,
cmd_aes_ccm->key_length, ' ');
hexdump("Nonce", cmd_aes_ccm->nonce,
cmd_aes_ccm->nonce_length, ' ');
hexdump("AAD", cmd_aes_ccm->AAD,
cmd_aes_ccm->AAD_length, ' ');
hexdump("Data", cmd_aes_ccm->data.data,
cmd_aes_ccm->data.header.len, ' ');
} else if (alg == CIPHER_TEST_WAPI) {
HostCmd_DS_802_11_CRYPTO_WAPI *cmd_wapi =
(HostCmd_DS_802_11_CRYPTO_WAPI
*)(buf + S_DS_GEN);
cmd_wapi->encdec =
le16_to_cpu(cmd_wapi->encdec);
cmd_wapi->algorithm =
le16_to_cpu(cmd_wapi->algorithm);
cmd_wapi->key_length =
le16_to_cpu(cmd_wapi->key_length);
cmd_wapi->nonce_length =
le16_to_cpu(cmd_wapi->nonce_length);
cmd_wapi->AAD_length =
le16_to_cpu(cmd_wapi->AAD_length);
printf("crypto_result: encdec=%d algorithm=%d, KeyLen=%d,"
" NonceLen=%d,AADLen=%d,dataLen=%d\n",
cmd_wapi->encdec, cmd_wapi->algorithm,
cmd_wapi->key_length,
cmd_wapi->nonce_length,
cmd_wapi->AAD_length,
cmd_wapi->data_length);
hexdump("Key", cmd_wapi->key,
cmd_wapi->key_length, ' ');
hexdump("Nonce", cmd_wapi->nonce,
cmd_wapi->nonce_length, ' ');
hexdump("AAD", cmd_wapi->AAD,
cmd_wapi->AAD_length, ' ');
} else {
HostCmd_DS_802_11_CRYPTO *cmd =
(HostCmd_DS_802_11_CRYPTO *)(buf +
S_DS_GEN);
cmd->encdec = le16_to_cpu(cmd->encdec);
cmd->algorithm = le16_to_cpu(cmd->algorithm);
cmd->key_IV_length =
le16_to_cpu(cmd->key_IV_length);
cmd->key_length = le16_to_cpu(cmd->key_length);
cmd->data.header.type =
le16_to_cpu(cmd->data.header.type);
cmd->data.header.len =
le16_to_cpu(cmd->data.header.len);
printf("crypto_result: encdec=%d algorithm=%d,KeyIVLen=%d,"
" KeyLen=%d,dataLen=%d\n",
cmd->encdec, cmd->algorithm,
cmd->key_IV_length, cmd->key_length,
cmd->data.header.len);
hexdump("KeyIV", cmd->keyIV, cmd->key_IV_length,
' ');
hexdump("Key", cmd->key, cmd->key_length, ' ');
hexdump("Data", cmd->data.data,
cmd->data.header.len, ' ');
}
break;
}
case HostCmd_CMD_802_11_AUTO_TX: {
HostCmd_DS_802_11_AUTO_TX *at =
(HostCmd_DS_802_11_AUTO_TX *)(buf + S_DS_GEN);
if (le16_to_cpu(at->action) == HostCmd_ACT_GEN_GET) {
if (S_DS_GEN + sizeof(at->action) ==
hostcmd->size) {
printf("auto_tx not configured\n");
} else {
MrvlIEtypesHeader_t *header =
&at->auto_tx.header;
header->type =
le16_to_cpu(header->type);
header->len = le16_to_cpu(header->len);
if ((S_DS_GEN + sizeof(at->action) +
sizeof(MrvlIEtypesHeader_t) +
header->len ==
hostcmd->size) &&
(header->type ==
TLV_TYPE_AUTO_TX)) {
AutoTx_MacFrame_t *atmf =
&at->auto_tx
.auto_tx_mac_frame;
printf("Interval: %d second(s)\n",
le16_to_cpu(
atmf->interval));
printf("Priority: %#x\n",
atmf->priority);
printf("Frame Length: %d\n",
le16_to_cpu(
atmf->frame_len));
printf("Dest Mac Address: "
"%02x:%02x:%02x:%02x:%02x:%02x\n",
atmf->dest_mac_addr[0],
atmf->dest_mac_addr[1],
atmf->dest_mac_addr[2],
atmf->dest_mac_addr[3],
atmf->dest_mac_addr[4],
atmf->dest_mac_addr[5]);
printf("Src Mac Address: "
"%02x:%02x:%02x:%02x:%02x:%02x\n",
atmf->src_mac_addr[0],
atmf->src_mac_addr[1],
atmf->src_mac_addr[2],
atmf->src_mac_addr[3],
atmf->src_mac_addr[4],
atmf->src_mac_addr[5]);
hexdump("Frame Payload",
atmf->payload,
le16_to_cpu(
atmf->frame_len) -
MLAN_MAC_ADDR_LENGTH *
2,
' ');
} else {
printf("incorrect auto_tx command response\n");
}
}
}
break;
}
case HostCmd_CMD_802_11_SUBSCRIBE_EVENT: {
HostCmd_DS_802_11_SUBSCRIBE_EVENT *se =
(HostCmd_DS_802_11_SUBSCRIBE_EVENT *)(buf +
S_DS_GEN);
if (le16_to_cpu(se->action) == HostCmd_ACT_GEN_GET) {
int len =
S_DS_GEN +
sizeof(HostCmd_DS_802_11_SUBSCRIBE_EVENT);
printf("\nEvent\t\tValue\tFreq\tsubscribed\n\n");
while (len < hostcmd->size) {
MrvlIEtypesHeader_t *header =
(MrvlIEtypesHeader_t *)(buf +
len);
switch (le16_to_cpu(header->type)) {
case TLV_TYPE_RSSI_LOW: {
MrvlIEtypes_RssiThreshold_t *low_rssi =
(MrvlIEtypes_RssiThreshold_t
*)(buf + len);
printf("Beacon Low RSSI\t%d\t%d\t%s\n",
low_rssi->RSSI_value,
low_rssi->RSSI_freq,
(le16_to_cpu(se->events) &
0x0001) ?
"yes" :
"no");
break;
}
case TLV_TYPE_SNR_LOW: {
MrvlIEtypes_SnrThreshold_t *low_snr =
(MrvlIEtypes_SnrThreshold_t
*)(buf + len);
printf("Beacon Low SNR\t%d\t%d\t%s\n",
low_snr->SNR_value,
low_snr->SNR_freq,
(le16_to_cpu(se->events) &
0x0002) ?
"yes" :
"no");
break;
}
case TLV_TYPE_FAILCOUNT: {
MrvlIEtypes_FailureCount_t
*failure_count =
(MrvlIEtypes_FailureCount_t
*)(buf +
len);
printf("Failure Count\t%d\t%d\t%s\n",
failure_count->fail_value,
failure_count->fail_freq,
(le16_to_cpu(se->events) &
0x0004) ?
"yes" :
"no");
break;
}
case TLV_TYPE_BCNMISS: {
MrvlIEtypes_BeaconsMissed_t
*bcn_missed =
(MrvlIEtypes_BeaconsMissed_t
*)(buf +
len);
printf("Beacon Missed\t%d\tN/A\t%s\n",
bcn_missed->beacon_missed,
(le16_to_cpu(se->events) &
0x0008) ?
"yes" :
"no");
break;
}
case TLV_TYPE_RSSI_HIGH: {
MrvlIEtypes_RssiThreshold_t
*high_rssi =
(MrvlIEtypes_RssiThreshold_t
*)(buf +
len);
printf("Bcn High RSSI\t%d\t%d\t%s\n",
high_rssi->RSSI_value,
high_rssi->RSSI_freq,
(le16_to_cpu(se->events) &
0x0010) ?
"yes" :
"no");
break;
}
case TLV_TYPE_SNR_HIGH: {
MrvlIEtypes_SnrThreshold_t *high_snr =
(MrvlIEtypes_SnrThreshold_t
*)(buf + len);
printf("Beacon High SNR\t%d\t%d\t%s\n",
high_snr->SNR_value,
high_snr->SNR_freq,
(le16_to_cpu(se->events) &
0x0020) ?
"yes" :
"no");
break;
}
case TLV_TYPE_RSSI_LOW_DATA: {
MrvlIEtypes_RssiThreshold_t *low_rssi =
(MrvlIEtypes_RssiThreshold_t
*)(buf + len);
printf("Data Low RSSI\t%d\t%d\t%s\n",
low_rssi->RSSI_value,
low_rssi->RSSI_freq,
(le16_to_cpu(se->events) &
0x0040) ?
"yes" :
"no");
break;
}
case TLV_TYPE_SNR_LOW_DATA: {
MrvlIEtypes_SnrThreshold_t *low_snr =
(MrvlIEtypes_SnrThreshold_t
*)(buf + len);
printf("Data Low SNR\t%d\t%d\t%s\n",
low_snr->SNR_value,
low_snr->SNR_freq,
(le16_to_cpu(se->events) &
0x0080) ?
"yes" :
"no");
break;
}
case TLV_TYPE_RSSI_HIGH_DATA: {
MrvlIEtypes_RssiThreshold_t
*high_rssi =
(MrvlIEtypes_RssiThreshold_t
*)(buf +
len);
printf("Data High RSSI\t%d\t%d\t%s\n",
high_rssi->RSSI_value,
high_rssi->RSSI_freq,
(le16_to_cpu(se->events) &
0x0100) ?
"yes" :
"no");
break;
}
case TLV_TYPE_SNR_HIGH_DATA: {
MrvlIEtypes_SnrThreshold_t *high_snr =
(MrvlIEtypes_SnrThreshold_t
*)(buf + len);
printf("Data High SNR\t%d\t%d\t%s\n",
high_snr->SNR_value,
high_snr->SNR_freq,
(le16_to_cpu(se->events) &
0x0200) ?
"yes" :
"no");
break;
}
case TLV_TYPE_LINK_QUALITY: {
MrvlIEtypes_LinkQuality_t *link_qual =
(MrvlIEtypes_LinkQuality_t
*)(buf + len);
printf("Link Quality Parameters:\n");
printf("------------------------\n");
printf("Link Quality Event Subscribed\t%s\n",
(le16_to_cpu(se->events) &
0x0400) ?
"yes" :
"no");
printf("Link SNR Threshold = %d\n",
le16_to_cpu(
link_qual
->link_SNR_thrs));
printf("Link SNR Frequency = %d\n",
le16_to_cpu(
link_qual
->link_SNR_freq));
printf("Min Rate Value = %d\n",
le16_to_cpu(
link_qual
->min_rate_val));
printf("Min Rate Frequency = %d\n",
le16_to_cpu(
link_qual
->min_rate_freq));
printf("Tx Latency Value = %d\n",
le32_to_cpu(
link_qual
->tx_latency_val));
printf("Tx Latency Threshold = %d\n",
le32_to_cpu(
link_qual
->tx_latency_thrs));
break;
}
case TLV_TYPE_PRE_BEACON_LOST: {
MrvlIEtypes_PreBeaconLost_t
*pre_bcn_lost =
(MrvlIEtypes_PreBeaconLost_t
*)(buf +
len);
printf("------------------------\n");
printf("Pre-Beacon Lost Event Subscribed\t%s\n",
(le16_to_cpu(se->events) &
0x0800) ?
"yes" :
"no");
printf("Pre-Beacon Lost: %d\n",
pre_bcn_lost
->pre_beacon_lost);
break;
}
default:
printf("Unknown subscribed event TLV Type=%#x,"
" Len=%d\n",
le16_to_cpu(
header->type),
le16_to_cpu(
header->len));
break;
}
len += (sizeof(MrvlIEtypesHeader_t) +
le16_to_cpu(header->len));
}
}
break;
}
case HostCmd_CMD_MAC_REG_ACCESS:
case HostCmd_CMD_BBP_REG_ACCESS:
case HostCmd_CMD_RF_REG_ACCESS:
case HostCmd_CMD_CAU_REG_ACCESS: {
HostCmd_DS_REG *preg =
(HostCmd_DS_REG *)(buf + S_DS_GEN);
preg->action = le16_to_cpu(preg->action);
if (preg->action == HostCmd_ACT_GEN_GET) {
preg->value = le32_to_cpu(preg->value);
printf("value = 0x%08x\n", preg->value);
}
break;
}
case HostCmd_CMD_MEM_ACCESS: {
HostCmd_DS_MEM *pmem =
(HostCmd_DS_MEM *)(buf + S_DS_GEN);
pmem->action = le16_to_cpu(pmem->action);
if (pmem->action == HostCmd_ACT_GEN_GET) {
pmem->value = le32_to_cpu(pmem->value);
printf("value = 0x%08x\n", pmem->value);
}
break;
}
default:
printf("HOSTCMD_RESP: CmdCode=%#04x, Size=%#04x,"
" SeqNum=%#04x, Result=%#04x\n",
hostcmd->command, hostcmd->size,
hostcmd->seq_num, hostcmd->result);
hexdump("payload", (t_void *)(buf + S_DS_GEN),
hostcmd->size - S_DS_GEN, ' ');
break;
}
} else {
printf("HOSTCMD failed: CmdCode=%#04x, Size=%#04x,"
" SeqNum=%#04x, Result=%#04x\n",
hostcmd->command, hostcmd->size, hostcmd->seq_num,
hostcmd->result);
}
return ret;
}
/**
* @brief Prepare ARP filter buffer
* @param fp File handler
* @param buf A pointer to the buffer
* @param length A pointer to the length of buffer
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int prepare_arp_filter_buffer(FILE *fp, t_u8 *buf, t_u16 *length)
{
t_s8 line[256], *pos;
int ln = 0;
int ret = MLAN_STATUS_SUCCESS;
int arpfilter_found = 0;
memset(buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
while ((pos = mlan_config_get_line(fp, line, sizeof(line), &ln))) {
if (strcmp(pos, "arpfilter={") == 0) {
arpfilter_found = 1;
mlan_get_hostcmd_data(fp, &ln, buf, length);
break;
}
}
if (!arpfilter_found) {
fprintf(stderr,
"mlanconfig: 'arpfilter' not found in conf file");
ret = MLAN_STATUS_FAILURE;
}
return ret;
}
/**
* @brief Prepare the hostcmd for register access
* @param type Register type
* @param offset Register offset
* @param value Pointer to value (NULL for read)
* @param buf Pointer to hostcmd buffer
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int prepare_hostcmd_regrdwr(t_u32 type, t_u32 offset, t_u32 *value, t_u8 *buf)
{
HostCmd_DS_GEN *hostcmd;
HostCmd_DS_REG *preg;
hostcmd = (HostCmd_DS_GEN *)buf;
switch (type) {
case 1:
hostcmd->command = cpu_to_le16(HostCmd_CMD_MAC_REG_ACCESS);
break;
case 2:
hostcmd->command = cpu_to_le16(HostCmd_CMD_BBP_REG_ACCESS);
break;
case 3:
hostcmd->command = cpu_to_le16(HostCmd_CMD_RF_REG_ACCESS);
break;
case 5:
hostcmd->command = cpu_to_le16(HostCmd_CMD_CAU_REG_ACCESS);
break;
default:
printf("Invalid register set specified\n");
return -EINVAL;
}
preg = (HostCmd_DS_REG *)(buf + S_DS_GEN);
preg->action = (value) ? HostCmd_ACT_GEN_SET : HostCmd_ACT_GEN_GET;
preg->action = cpu_to_le16(preg->action);
preg->offset = cpu_to_le16((t_u16)offset);
if (value)
preg->value = cpu_to_le32(*value);
else
preg->value = 0;
hostcmd->size = cpu_to_le16(S_DS_GEN + sizeof(HostCmd_DS_REG));
hostcmd->seq_num = 0;
hostcmd->result = 0;
return MLAN_STATUS_SUCCESS;
}

View file

@ -0,0 +1,387 @@
/** @file mlanhostcmd.h
*
* @brief This file contains command structures for mlanconfig application
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
11/26/2008: initial version
************************************************************************/
#ifndef _MLANHOSTCMD_H_
#define _MLANHOSTCMD_H_
/** Find number of elements */
#define NELEMENTS(x) (sizeof(x) / sizeof(x[0]))
/** MLAN MAC Address Length */
#define MLAN_MAC_ADDR_LENGTH (6)
/** Size of command buffer */
#define MRVDRV_SIZE_OF_CMD_BUFFER (4 * 1024)
/** Command RET code, MSB is set to 1 */
#define HostCmd_RET_BIT 0x8000
/** General purpose action : Get */
#define HostCmd_ACT_GEN_GET 0x0000
/** General purpose action : Set */
#define HostCmd_ACT_GEN_SET 0x0001
/** General purpose action : Clear */
#define HostCmd_ACT_GEN_CLEAR 0x0004
/** General purpose action : Remove */
#define HostCmd_ACT_GEN_REMOVE 0x0004
/** Host Command ID : Memory access */
#define HostCmd_CMD_MEM_ACCESS 0x0086
/** Pre-Authenticate - 11r only */
#define HostCmd_CMD_802_11_AUTHENTICATE 0x0011
/** Read/Write Mac register */
#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
/** Read/Write BBP register */
#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
/** Read/Write RF register */
#define HostCmd_CMD_RF_REG_ACCESS 0x001b
/** Get TX Power data */
#define HostCmd_CMD_802_11_RF_TX_POWER 0x001e
/** Get the current TSF */
#define HostCmd_CMD_GET_TSF 0x0080
/** Host Command ID : CAU register access */
#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
/** Host Command ID : 802.11 BG scan configuration */
#define HostCmd_CMD_802_11_BG_SCAN_CONFIG 0x006b
/** Host Command ID : Configuration data */
#define HostCmd_CMD_CFG_DATA 0x008f
/** Host Command ID : 802.11 TPC adapt req */
#define HostCmd_CMD_802_11_TPC_ADAPT_REQ 0x0060
/** Host Command ID : 802.11 crypto */
#define HostCmd_CMD_802_11_CRYPTO 0x0078
/** Host Command ID : 802.11 auto Tx */
#define HostCmd_CMD_802_11_AUTO_TX 0x0082
/** Host Command ID : 802.11 subscribe event */
#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
#ifdef OPCHAN
/** Host Command ID : Operating channel config */
#define HostCmd_CMD_OPCHAN_CONFIG 0x00f8
/** Host Command ID : Opchan channel group config */
#define HostCmd_CMD_OPCHAN_CHANGROUP_CONFIG 0x00f9
#endif
/** Host Command ID : Channel TRPC config */
#define HostCmd_CMD_CHAN_TRPC_CONFIG 0x00fb
/** TLV type ID definition */
#define PROPRIETARY_TLV_BASE_ID 0x0100
/** TLV type : Beacon RSSI low */
#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 0x04) // 0x0104
/** TLV type : Beacon SNR low */
#define TLV_TYPE_SNR_LOW (PROPRIETARY_TLV_BASE_ID + 0x05) // 0x0105
/** TLV type : Fail count */
#define TLV_TYPE_FAILCOUNT (PROPRIETARY_TLV_BASE_ID + 0x06) // 0x0106
/** TLV type : BCN miss */
#define TLV_TYPE_BCNMISS (PROPRIETARY_TLV_BASE_ID + 0x07) // 0x0107
/** TLV type : Beacon RSSI high */
#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 0x16) // 0x0116
/** TLV type : Beacon SNR high */
#define TLV_TYPE_SNR_HIGH (PROPRIETARY_TLV_BASE_ID + 0x17) // 0x0117
/** TLV type : Auto Tx */
#define TLV_TYPE_AUTO_TX (PROPRIETARY_TLV_BASE_ID + 0x18) // 0x0118
/** TLV type :Link Quality */
#define TLV_TYPE_LINK_QUALITY (PROPRIETARY_TLV_BASE_ID + 0x24) // 0x0124
/** TLV type : Data RSSI low */
#define TLV_TYPE_RSSI_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 0x26) // 0x0126
/** TLV type : Data SNR low */
#define TLV_TYPE_SNR_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 0x27) // 0x0127
/** TLV type : Data RSSI high */
#define TLV_TYPE_RSSI_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 0x28) // 0x0128
/** TLV type : Data SNR high */
#define TLV_TYPE_SNR_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 0x29) // 0x0129
/** TLV type: Pre-Beacon Lost */
#define TLV_TYPE_PRE_BEACON_LOST (PROPRIETARY_TLV_BASE_ID + 0x49) // 0x0149
#ifdef OPCHAN
/** TLV type : Operating channel control description */
#define TLV_TYPE_OPCHAN_CONTROL_DESC (PROPRIETARY_TLV_BASE_ID + 0x79) // 0x0179
/** TLV type : Operating channel group control */
#define TLV_TYPE_OPCHAN_CHANGRP_CTRL (PROPRIETARY_TLV_BASE_ID + 0x7a) // 0x017a
#endif
/** TLV type : Channel TRPC */
#define TLV_TYPE_CHAN_TRPC (PROPRIETARY_TLV_BASE_ID + 0x89) // 0x0189
/* Define general hostcmd data structure */
/** HostCmd_DS_GEN */
typedef struct MAPP_HostCmd_DS_GEN {
/** Command */
t_u16 command;
/** Size */
t_u16 size;
/** Sequence number */
t_u16 seq_num;
/** Result */
t_u16 result;
} __ATTRIB_PACK__ HostCmd_DS_GEN;
typedef struct _HostCmd_DS_MEF_CFG {
/** Criteria */
t_u32 Criteria;
/** Number of entries */
t_u16 NumEntries;
} __ATTRIB_PACK__ HostCmd_DS_MEF_CFG;
typedef struct _MEF_CFG_DATA {
/** Size */
t_u16 size;
/** Data */
HostCmd_DS_MEF_CFG data;
} __ATTRIB_PACK__ MEF_CFG_DATA;
/** Size of HostCmd_DS_GEN */
#define S_DS_GEN sizeof(HostCmd_DS_GEN)
/** HostCmd_DS_REG */
typedef struct MAPP_HostCmd_DS_REG {
/** Read or write */
t_u16 action;
/** Register offset */
t_u16 offset;
/** Value */
t_u32 value;
} __ATTRIB_PACK__ HostCmd_DS_REG;
/** HostCmd_DS_MEM */
typedef struct MAPP_HostCmd_DS_MEM {
/** Read or write */
t_u16 action;
/** Reserved */
t_u16 reserved;
/** Address */
t_u32 addr;
/** Value */
t_u32 value;
} __ATTRIB_PACK__ HostCmd_DS_MEM;
/** HostCmd_DS_802_11_CFG_DATA */
typedef struct MAPP_HostCmd_DS_802_11_CFG_DATA {
/** Action */
t_u16 action;
/** Type */
t_u16 type;
/** Data length */
t_u16 data_len;
/** Data */
t_u8 data[1];
} __ATTRIB_PACK__ HostCmd_DS_802_11_CFG_DATA;
/** mlan_ioctl_11h_tpc_resp */
typedef struct {
int status_code; /**< Firmware command result status code */
int tx_power; /**< Reported TX Power from the TPC Report */
int link_margin; /**< Reported Link margin from the TPC Report */
int rssi; /**< RSSI of the received TPC Report frame */
} __ATTRIB_PACK__ mlan_ioctl_11h_tpc_resp;
/** MrvlIEtypesHeader_t */
typedef struct MrvlIEtypesHeader {
/** Header type */
t_u16 type;
/** Header length */
t_u16 len;
} __ATTRIB_PACK__ MrvlIEtypesHeader_t;
/** MrvlIEtypes_Data_t */
typedef struct MrvlIEtypes_Data_t {
/** Header */
MrvlIEtypesHeader_t header;
/** Data */
t_u8 data[1];
} __ATTRIB_PACK__ MrvlIEtypes_Data_t;
/** HostCmd_DS_802_11_CRYPTO */
typedef struct MAPP_HostCmd_DS_802_11_CRYPTO {
t_u16 encdec; /**< Decrypt=0, Encrypt=1 */
t_u16 algorithm; /**< RC4=1 AES=2 , AES_KEY_WRAP=3 */
t_u16 key_IV_length; /**< Length of Key IV (bytes) */
t_u8 keyIV[32]; /**< Key IV */
t_u16 key_length; /**< Length of Key (bytes) */
t_u8 key[32]; /**< Key */
MrvlIEtypes_Data_t data; /**< Plain text if encdec=Encrypt, Ciphertext
data if encdec=Decrypt*/
} __ATTRIB_PACK__ HostCmd_DS_802_11_CRYPTO;
/** HostCmd_DS_802_11_CRYPTO_AES_CCM */
typedef struct MAPP_HostCmd_DS_802_11_CRYPTO_AES_CCM {
t_u16 encdec; /**< Decrypt=0, Encrypt=1 */
t_u16 algorithm; /**< AES_CCM=4 */
t_u16 key_length; /**< Length of Key (bytes) */
t_u8 key[32]; /**< Key */
t_u16 nonce_length; /**< Length of Nonce (bytes) */
t_u8 nonce[14]; /**< Nonce */
t_u16 AAD_length; /**< Length of AAD (bytes) */
t_u8 AAD[32]; /**< AAD */
MrvlIEtypes_Data_t data; /**< Plain text if encdec=Encrypt, Ciphertext
data if encdec=Decrypt*/
} __ATTRIB_PACK__ HostCmd_DS_802_11_CRYPTO_AES_CCM;
/** HostCmd_DS_802_11_CRYPTO_WAPI */
typedef struct MAPP_HostCmd_DS_802_11_CRYPTO_WAPI {
t_u16 encdec; /**< Decrypt=0, Encrypt=1 */
t_u16 algorithm; /**< WAPI =5 */
t_u16 key_length; /**< Length of Key (bytes) */
t_u8 key[32]; /**< Key */
t_u16 nonce_length; /**< Length of Nonce (bytes) */
t_u8 nonce[16]; /**< Nonce */
t_u16 AAD_length; /**< Length of AAD (bytes) */
t_u8 AAD[48]; /**< AAD */
t_u16 data_length; /**< Length of data (bytes) */
} __ATTRIB_PACK__ HostCmd_DS_802_11_CRYPTO_WAPI;
/** WAPI cipher test */
#define CIPHER_TEST_WAPI (5)
/** AES CCM cipher test */
#define CIPHER_TEST_AES_CCM (4)
/** GCMP cipher test */
#define CIPHER_TEST_GCMP (6)
/** AutoTx_MacFrame_t */
typedef struct AutoTx_MacFrame {
t_u16 interval; /**< in seconds */
t_u8 priority; /**< User Priority: 0~7, ignored if non-WMM */
t_u8 reserved; /**< set to 0 */
t_u16 frame_len; /**< Length of MAC frame payload */
t_u8 dest_mac_addr[MLAN_MAC_ADDR_LENGTH]; /**< Destination MAC address
*/
t_u8 src_mac_addr[MLAN_MAC_ADDR_LENGTH]; /**< Source MAC address */
t_u8 payload[]; /**< Payload */
} __ATTRIB_PACK__ AutoTx_MacFrame_t;
/** MrvlIEtypes_AutoTx_t */
typedef struct MrvlIEtypes_AutoTx {
MrvlIEtypesHeader_t header; /**< Header */
AutoTx_MacFrame_t auto_tx_mac_frame; /**< Auto Tx MAC frame */
} __ATTRIB_PACK__ MrvlIEtypes_AutoTx_t;
/** HostCmd_DS_802_11_AUTO_TX */
typedef struct MAPP_HostCmd_DS_802_11_AUTO_TX {
/** Action */
t_u16 action; /* 0 = ACT_GET; 1 = ACT_SET; */
MrvlIEtypes_AutoTx_t auto_tx; /**< Auto Tx */
} __ATTRIB_PACK__ HostCmd_DS_802_11_AUTO_TX;
/** HostCmd_DS_802_11_SUBSCRIBE_EVENT */
typedef struct MAPP_HostCmd_DS_802_11_SUBSCRIBE_EVENT {
/** Action */
t_u16 action;
/** Events */
t_u16 events;
} __ATTRIB_PACK__ HostCmd_DS_802_11_SUBSCRIBE_EVENT;
/** MrvlIEtypes_RssiParamSet_t */
typedef struct MrvlIEtypes_RssiThreshold {
/** Header */
MrvlIEtypesHeader_t header;
/** RSSI value */
t_u8 RSSI_value;
/** RSSI frequency */
t_u8 RSSI_freq;
} __ATTRIB_PACK__ MrvlIEtypes_RssiThreshold_t;
/** MrvlIEtypes_SnrThreshold_t */
typedef struct MrvlIEtypes_SnrThreshold {
/** Header */
MrvlIEtypesHeader_t header;
/** SNR value */
t_u8 SNR_value;
/** SNR frequency */
t_u8 SNR_freq;
} __ATTRIB_PACK__ MrvlIEtypes_SnrThreshold_t;
/** MrvlIEtypes_FailureCount_t */
typedef struct MrvlIEtypes_FailureCount {
/** Header */
MrvlIEtypesHeader_t header;
/** Failure value */
t_u8 fail_value;
/** Failure frequency */
t_u8 fail_freq;
} __ATTRIB_PACK__ MrvlIEtypes_FailureCount_t;
/** MrvlIEtypes_BeaconsMissed_t */
typedef struct MrvlIEtypes_BeaconsMissed {
/** Header */
MrvlIEtypesHeader_t header;
/** Number of beacons missed */
t_u8 beacon_missed;
/** Reserved */
t_u8 reserved;
} __ATTRIB_PACK__ MrvlIEtypes_BeaconsMissed_t;
/** MrvlIEtypes_LinkQuality_t */
typedef struct MrvlIEtypes_LinkQuality {
/** Header */
MrvlIEtypesHeader_t header;
/** Link SNR threshold */
t_u16 link_SNR_thrs;
/** Link SNR frequency */
t_u16 link_SNR_freq;
/** Minimum rate value */
t_u16 min_rate_val;
/** Minimum rate frequency */
t_u16 min_rate_freq;
/** Tx latency value */
t_u32 tx_latency_val;
/** Tx latency threshold */
t_u32 tx_latency_thrs;
} __ATTRIB_PACK__ MrvlIEtypes_LinkQuality_t;
/** MrvlIEtypes_PreBeaconLost_t */
typedef struct MrvlIEtypes_PreBeaconLost {
/** Header */
MrvlIEtypesHeader_t header;
/** Pre-Beacon Lost */
t_u8 pre_beacon_lost;
/** Reserved */
t_u8 reserved;
} __ATTRIB_PACK__ MrvlIEtypes_PreBeaconLost_t;
/* String helper functions */
/** Convert char to hex integer */
int hexval(t_s32 chr);
/** Convert char to hex integer */
t_u8 hexc2bin(t_s8 chr);
/** Convert string to hex integer */
t_u32 a2hex(t_s8 *s);
/** Check the Hex String */
int ishexstring(t_s8 *s);
/** Convert String to integer */
t_u32 a2hex_or_atoi(t_s8 *value);
/** Convert String to Integer */
int atoval(t_s8 *buf);
/** Hump hex data */
void hexdump(t_s8 *prompt, void *p, t_s32 len, t_s8 delim);
/** Convert String to Hex */
t_s8 *convert2hex(t_s8 *ptr, t_u8 *chr);
int process_host_cmd_resp(t_u8 *buf);
int prepare_host_cmd_buffer(FILE *fp, char *cmd_name, t_u8 *buf);
int prepare_arp_filter_buffer(FILE *fp, t_u8 *buf, t_u16 *length);
int prepare_cfg_data_buffer(int argc, char *argv[], FILE *fp, t_u8 *buf);
int prepare_hostcmd_regrdwr(t_u32 type, t_u32 offset, t_u32 *value, t_u8 *buf);
#endif /* _MLANHOSTCMD_H_ */

1024
mapp/mlanconfig/mlanmisc.c Normal file

File diff suppressed because it is too large Load diff

668
mapp/mlanconfig/mlanmisc.h Normal file
View file

@ -0,0 +1,668 @@
/** @file mlanmisc.h
*
* @brief This file contains command definitions for application
*
*
* Copyright 2014-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
03/10/2009: initial version
************************************************************************/
#ifndef _MLANMISC_H_
#define _MLANMISC_H_
/** Maximum size of IEEE Information Elements */
#define IEEE_MAX_IE_SIZE 256
/** Maximum scan response buffer size */
#define SCAN_RESP_BUF_SIZE 2000
#ifdef FALSE
#undef FALSE
#endif
#ifdef TRUE
#undef TRUE
#endif
#ifndef MIN
/** Find minimum value */
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif /* MIN */
#ifndef MAX
/** Find maximum value */
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif /* MAX */
/** Type enumeration of WMM AC_QUEUES */
typedef enum _mlan_wmm_ac_e {
WMM_AC_BK,
WMM_AC_BE,
WMM_AC_VI,
WMM_AC_VO
} __ATTRIB_PACK__ mlan_wmm_ac_e;
/** Maximum length of SSID */
#define MRVDRV_MAX_SSID_LENGTH 32
/** Enumeration for scan mode */
enum { MLAN_SCAN_MODE_UNCHANGED = 0,
MLAN_SCAN_MODE_BSS,
MLAN_SCAN_MODE_IBSS,
MLAN_SCAN_MODE_ANY };
/** Enumeration for scan type */
enum { MLAN_SCAN_TYPE_UNCHANGED = 0,
MLAN_SCAN_TYPE_ACTIVE,
MLAN_SCAN_TYPE_PASSIVE };
/** Length of ethernet address */
#ifndef ETH_ALEN
#define ETH_ALEN 6
#endif
/** Maximum length of SSID list */
#define MRVDRV_MAX_SSID_LIST_LENGTH 10
/** Maximum number of channels that can be sent in a setuserscan ioctl */
#define WLAN_IOCTL_USER_SCAN_CHAN_MAX 50
/** IEEE Type definitions */
typedef enum _IEEEtypes_ElementId_e {
SSID = 0,
SUPPORTED_RATES = 1,
FH_PARAM_SET = 2,
DS_PARAM_SET = 3,
CF_PARAM_SET = 4,
IBSS_PARAM_SET = 6,
COUNTRY_INFO = 7,
POWER_CONSTRAINT = 32,
POWER_CAPABILITY = 33,
TPC_REQUEST = 34,
TPC_REPORT = 35,
SUPPORTED_CHANNELS = 36,
CHANNEL_SWITCH_ANN = 37,
QUIET = 40,
IBSS_DFS = 41,
HT_CAPABILITY = 45,
HT_OPERATION = 61,
BSSCO_2040 = 72,
OVERLAPBSSSCANPARAM = 74,
EXT_CAPABILITY = 127,
VHT_CAPABILITY = 191,
VHT_OPERATION = 192,
EXT_BSS_LOAD = 193,
BW_CHANNEL_SWITCH = 194,
VHT_TX_POWER_ENV = 195,
EXT_POWER_CONSTR = 196,
AID_INFO = 197,
QUIET_CHAN = 198,
ERP_INFO = 42,
EXTENDED_SUPPORTED_RATES = 50,
VENDOR_SPECIFIC_221 = 221,
WMM_IE = VENDOR_SPECIFIC_221,
WPS_IE = VENDOR_SPECIFIC_221,
WPA_IE = VENDOR_SPECIFIC_221,
RSN_IE = 48,
} __ATTRIB_PACK__ IEEEtypes_ElementId_e;
/** Capability Bit Map*/
#ifdef BIG_ENDIAN_SUPPORT
typedef struct _IEEEtypes_CapInfo_t {
t_u8 rsrvd1 : 2;
t_u8 dsss_ofdm : 1;
t_u8 rsvrd2 : 2;
t_u8 short_slot_time : 1;
t_u8 rsrvd3 : 1;
t_u8 spectrum_mgmt : 1;
t_u8 chan_agility : 1;
t_u8 pbcc : 1;
t_u8 short_preamble : 1;
t_u8 privacy : 1;
t_u8 cf_poll_rqst : 1;
t_u8 cf_pollable : 1;
t_u8 ibss : 1;
t_u8 ess : 1;
} __ATTRIB_PACK__ IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
#else
typedef struct _IEEEtypes_CapInfo_t {
/** Capability Bit Map : ESS */
t_u8 ess : 1;
/** Capability Bit Map : IBSS */
t_u8 ibss : 1;
/** Capability Bit Map : CF pollable */
t_u8 cf_pollable : 1;
/** Capability Bit Map : CF poll request */
t_u8 cf_poll_rqst : 1;
/** Capability Bit Map : privacy */
t_u8 privacy : 1;
/** Capability Bit Map : Short preamble */
t_u8 short_preamble : 1;
/** Capability Bit Map : PBCC */
t_u8 pbcc : 1;
/** Capability Bit Map : Channel agility */
t_u8 chan_agility : 1;
/** Capability Bit Map : Spectrum management */
t_u8 spectrum_mgmt : 1;
/** Capability Bit Map : Reserved */
t_u8 rsrvd3 : 1;
/** Capability Bit Map : Short slot time */
t_u8 short_slot_time : 1;
/** Capability Bit Map : APSD */
t_u8 apsd : 1;
/** Capability Bit Map : Reserved */
t_u8 rsvrd2 : 1;
/** Capability Bit Map : DSS OFDM */
t_u8 dsss_ofdm : 1;
/** Capability Bit Map : Reserved */
t_u8 rsrvd1 : 2;
} __ATTRIB_PACK__ IEEEtypes_CapInfo_t, *pIEEEtypes_CapInfo_t;
#endif /* BIG_ENDIAN_SUPPORT */
/** IEEE IE header */
typedef struct _IEEEtypes_Header_t {
/** Element ID */
t_u8 element_id;
/** Length */
t_u8 len;
} __ATTRIB_PACK__ IEEEtypes_Header_t, *pIEEEtypes_Header_t;
/** IEEE IE header */
#define IEEE_HEADER_LEN sizeof(IEEEtypes_Header_t)
/** Vendor specific IE header */
typedef struct _IEEEtypes_VendorHeader_t {
/** Element ID */
t_u8 element_id;
/** Length */
t_u8 len;
/** OUI */
t_u8 oui[3];
/** OUI type */
t_u8 oui_type;
/** OUI subtype */
t_u8 oui_subtype;
/** Version */
t_u8 version;
} __ATTRIB_PACK__ IEEEtypes_VendorHeader_t, *pIEEEtypes_VendorHeader_t;
/** Vendor specific IE */
typedef struct _IEEEtypes_VendorSpecific_t {
/** Vendor specific IE header */
IEEEtypes_VendorHeader_t vend_hdr;
/** IE Max - size of previous fields */
t_u8 data[IEEE_MAX_IE_SIZE - sizeof(IEEEtypes_VendorHeader_t)];
} __ATTRIB_PACK__ IEEEtypes_VendorSpecific_t, *pIEEEtypes_VendorSpecific_t;
/** IEEE IE */
typedef struct _IEEEtypes_Generic_t {
/** Generic IE header */
IEEEtypes_Header_t ieee_hdr;
/** IE Max - size of previous fields */
t_u8 data[IEEE_MAX_IE_SIZE - sizeof(IEEEtypes_Header_t)];
} __ATTRIB_PACK__ IEEEtypes_Generic_t, *pIEEEtypes_Generic_t;
/** Size of a TSPEC. Used to allocate necessary buffer space in commands */
#define WMM_TSPEC_SIZE 63
/** Maximum number of AC QOS queues available in the driver/firmware */
#define MAX_AC_QUEUES 4
/** Maximum number of User Priorities */
#define MAX_USER_PRIORITIES 8
/** Extra IE bytes allocated in messages for appended IEs after a TSPEC */
#define WMM_ADDTS_EXTRA_IE_BYTES 256
/**
* @brief Enumeration for the command result from an ADDTS or DELTS command
*/
typedef enum {
TSPEC_RESULT_SUCCESS = 0,
TSPEC_RESULT_EXEC_FAILURE = 1,
TSPEC_RESULT_TIMEOUT = 2,
TSPEC_RESULT_DATA_INVALID = 3,
} __ATTRIB_PACK__ mlan_wmm_tspec_result_e;
/**
* @brief Enumeration for the action field in the Queue configure command
*/
typedef enum {
WMM_QUEUE_CONFIG_ACTION_GET = 0,
WMM_QUEUE_CONFIG_ACTION_SET = 1,
WMM_QUEUE_CONFIG_ACTION_DEFAULT = 2,
WMM_QUEUE_CONFIG_ACTION_MAX
} __ATTRIB_PACK__ mlan_wmm_queue_config_action_e;
/**
* @brief Enumeration for the action field in the queue stats command
*/
typedef enum {
WMM_STATS_ACTION_START = 0,
WMM_STATS_ACTION_STOP = 1,
WMM_STATS_ACTION_GET_CLR = 2,
WMM_STATS_ACTION_SET_CFG = 3, /* Not currently used */
WMM_STATS_ACTION_GET_CFG = 4, /* Not currently used */
WMM_STATS_ACTION_MAX
} __ATTRIB_PACK__ mlan_wmm_stats_action_e;
/** Data structure of WMM Aci/Aifsn */
typedef struct _IEEEtypes_WmmAciAifsn_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 reserved : 1;
/** Aci */
t_u8 aci : 2;
/** Acm */
t_u8 acm : 1;
/** Aifsn */
t_u8 aifsn : 4;
#else
/** Aifsn */
t_u8 aifsn : 4;
/** Acm */
t_u8 acm : 1;
/** Aci */
t_u8 aci : 2;
/** Reserved */
t_u8 reserved : 1;
#endif
} __ATTRIB_PACK__ IEEEtypes_WmmAciAifsn_t, *pIEEEtypes_WmmAciAifsn_t;
/** Data structure of WMM ECW */
typedef struct _IEEEtypes_WmmEcw_t {
#ifdef BIG_ENDIAN_SUPPORT
/** Maximum Ecw */
t_u8 ecw_max : 4;
/** Minimum Ecw */
t_u8 ecw_min : 4;
#else
/** Minimum Ecw */
t_u8 ecw_min : 4;
/** Maximum Ecw */
t_u8 ecw_max : 4;
#endif
} __ATTRIB_PACK__ IEEEtypes_WmmEcw_t, *pIEEEtypes_WmmEcw_t;
/** Data structure of WMM AC parameters */
typedef struct _IEEEtypes_WmmAcParameters_t {
IEEEtypes_WmmAciAifsn_t aci_aifsn; /**< AciAifSn */
IEEEtypes_WmmEcw_t ecw; /**< Ecw */
t_u16 tx_op_limit; /**< Tx op limit */
} __ATTRIB_PACK__ IEEEtypes_WmmAcParameters_t, *pIEEEtypes_WmmAcParameters_t;
/** Data structure of WMM Info IE */
typedef struct _IEEEtypes_WmmInfo_t {
/**
* WMM Info IE - Vendor Specific Header:
* element_id [221/0xdd]
* Len [7]
* Oui [00:50:f2]
* OuiType [2]
* OuiSubType [0]
* Version [1]
*/
IEEEtypes_VendorHeader_t vend_hdr;
/** QoS information */
IEEEtypes_WmmQosInfo_t qos_info;
} __ATTRIB_PACK__ IEEEtypes_WmmInfo_t, *pIEEEtypes_WmmInfo_t;
/** Data structure of WMM parameter IE */
typedef struct _IEEEtypes_WmmParameter_t {
/**
* WMM Parameter IE - Vendor Specific Header:
* element_id [221/0xdd]
* Len [24]
* Oui [00:50:f2]
* OuiType [2]
* OuiSubType [1]
* Version [1]
*/
IEEEtypes_VendorHeader_t vend_hdr;
/** QoS information */
IEEEtypes_WmmQosInfo_t qos_info;
/** Reserved */
t_u8 reserved;
/** AC Parameters Record WMM_AC_BE, WMM_AC_BK, WMM_AC_VI, WMM_AC_VO */
IEEEtypes_WmmAcParameters_t ac_params[MAX_AC_QUEUES];
} __ATTRIB_PACK__ IEEEtypes_WmmParameter_t, *pIEEEtypes_WmmParameter_t;
/**
* @brief IOCTL structure to send an ADDTS request and retrieve the response.
*
* IOCTL structure from the application layer relayed to firmware to
* instigate an ADDTS management frame with an appropriate TSPEC IE as well
* as any additional IEs appended in the ADDTS Action frame.
*
* @sa wlan_wmm_addts_req_ioctl
*/
typedef struct {
mlan_wmm_tspec_result_e commandResult; /**< Firmware execution result */
t_u32 timeout_ms; /**< Timeout value in milliseconds */
t_u8 ieeeStatusCode; /**< IEEE status code */
t_u32 ieDataLen;
t_u8 ieData[WMM_TSPEC_SIZE /**< TSPEC to send in the ADDTS */
+ WMM_ADDTS_EXTRA_IE_BYTES]; /**< ADDTS extra IE buf */
} wlan_ioctl_wmm_addts_req_t;
/**
* @brief IOCTL structure to send a DELTS request.
*
* IOCTL structure from the application layer relayed to firmware to
* instigate an DELTS management frame with an appropriate TSPEC IE.
*
* @sa wlan_wmm_delts_req_ioctl
*/
typedef struct {
mlan_wmm_tspec_result_e commandResult; /**< Firmware execution result */
t_u8 ieeeReasonCode; /**< IEEE reason code sent, unused for WMM */
t_u32 ieDataLen;
t_u8 ieData[WMM_TSPEC_SIZE]; /**< TSPEC to send in the DELTS */
} wlan_ioctl_wmm_delts_req_t;
/**
* @brief IOCTL structure to configure a specific AC Queue's parameters
*
* IOCTL structure from the application layer relayed to firmware to
* get, set, or default the WMM AC queue parameters.
*
* - msduLifetimeExpiry is ignored if set to 0 on a set command
*
* @sa wlan_wmm_queue_config_ioctl
*/
typedef struct {
mlan_wmm_queue_config_action_e action; /**< Set, Get, or Default */
mlan_wmm_ac_e accessCategory; /**< WMM_AC_BK(0) to WMM_AC_VO(3) */
t_u16 msduLifetimeExpiry; /**< lifetime expiry in TUs */
t_u8 supportedRates[10]; /**< Not supported yet */
} wlan_ioctl_wmm_queue_config_t;
/** Number of bins in the histogram for the HostCmd_DS_WMM_QUEUE_STATS */
#define WMM_STATS_PKTS_HIST_BINS 7
/**
* @brief IOCTL structure to start, stop, and get statistics for a WMM AC
*
* IOCTL structure from the application layer relayed to firmware to
* start or stop statistical collection for a given AC. Also used to
* retrieve and clear the collected stats on a given AC.
*
* @sa wlan_wmm_queue_stats_ioctl
*/
typedef struct {
mlan_wmm_stats_action_e action; /**< Start, Stop, or Get */
t_u8 userPriority; /**< User Priority (0 to 7) */
t_u16 pktCount; /**< Number of successful packets transmitted */
t_u16 pktLoss; /**< Packets lost; not included in pktCount */
t_u32 avgQueueDelay; /**< Average Queue delay in microseconds */
t_u32 avgTxDelay; /**< Average Transmission delay in microseconds */
t_u16 usedTime; /**< Calculated used time - units of 32 microsec */
t_u16 policedTime; /**< Calculated policed time - units of 32 microsec
*/
/** @brief Queue Delay Histogram; number of packets per queue delay
* range
*
* [0] - 0ms <= delay < 5ms
* [1] - 5ms <= delay < 10ms
* [2] - 10ms <= delay < 20ms
* [3] - 20ms <= delay < 30ms
* [4] - 30ms <= delay < 40ms
* [5] - 40ms <= delay < 50ms
* [6] - 50ms <= delay < msduLifetime (TUs)
*/
t_u16 delayHistogram[WMM_STATS_PKTS_HIST_BINS];
} wlan_ioctl_wmm_queue_stats_t;
/**
* @brief IOCTL and command sub structure for a Traffic stream status.
*/
typedef struct {
t_u8 tid; /**< TSID: Range: 0->7 */
t_u8 valid; /**< TSID specified is valid */
t_u8 accessCategory; /**< AC TSID is active on */
t_u8 userPriority; /**< UP specified for the TSID */
t_u8 psb; /**< Power save mode for TSID: 0 (legacy), 1 (UAPSD) */
t_u8 flowDir; /**< Upstream (0), Downlink(1), Bidirectional(3) */
t_u16 mediumTime; /**< Medium time granted for the TSID */
} __ATTRIB_PACK__ HostCmd_DS_WMM_TS_STATUS, wlan_ioctl_wmm_ts_status_t,
wlan_cmd_wmm_ts_status_t;
/**
* @brief IOCTL sub structure for a specific WMM AC Status
*/
typedef struct {
/** WMM Acm */
t_u8 wmmAcm;
/** Flow required flag */
t_u8 flowRequired;
/** Flow created flag */
t_u8 flowCreated;
/** Disabled flag */
t_u8 disabled;
/** delivery enabled */
t_u8 deliveryEnabled;
/** trigger enabled */
t_u8 triggerEnabled;
} wlan_ioctl_wmm_queue_status_ac_t;
/**
* @brief IOCTL structure to retrieve the WMM AC Queue status
*
* IOCTL structure from the application layer to retrieve:
* - ACM bit setting for the AC
* - Firmware status (flow required, flow created, flow disabled)
*
* @sa wlan_wmm_queue_status_ioctl
*/
typedef struct {
/** WMM AC queue status */
wlan_ioctl_wmm_queue_status_ac_t acStatus[MAX_AC_QUEUES];
} wlan_ioctl_wmm_queue_status_t;
typedef struct _wlan_get_scan_table_fixed {
/** BSSID of this network */
t_u8 bssid[MLAN_MAC_ADDR_LENGTH];
/** Channel this beacon/probe response was detected */
t_u8 channel;
/** RSSI for the received packet */
t_u8 rssi;
/** TSF value from the firmware at packet reception */
t_u64 network_tsf;
} wlan_get_scan_table_fixed;
/**
* Structure passed in the wlan_ioctl_get_scan_table_info for each
* BSS returned in the WLAN_GET_SCAN_RESP IOCTL
*/
typedef struct _wlan_ioctl_get_scan_table_entry {
/**
* Fixed field length included in the response.
*
* Length value is included so future fixed fields can be added to the
* response without breaking backwards compatibility. Use the length
* to find the offset for the bssInfoLength field, not a sizeof()
* calc.
*/
t_u32 fixed_field_length;
/**
* Length of the BSS Information (probe resp or beacon) that
* follows after the fixed_field_length
*/
t_u32 bss_info_length;
/**
* Always present, fixed length data fields for the BSS
*/
wlan_get_scan_table_fixed fixed_fields;
/*
* Probe response or beacon scanned for the BSS.
*
* Field layout:
* - TSF 8 octets
* - Beacon Interval 2 octets
* - Capability Info 2 octets
*
* - IEEE Infomation Elements; variable number & length per 802.11
* spec
*/
/* t_u8 bss_info_buffer[1];*/
} wlan_ioctl_get_scan_table_entry;
/**
* Structure to store BSS info (probe resp or beacon) & IEEE IE info for each
* BSS returned in WLAN_GET_SCAN_RESP IOCTL
*/
typedef struct _wlan_ioctl_get_bss_info {
/**
* Length of the BSS Information (probe resp or beacon) that
* follows after the fixed_field
*/
t_u32 bss_info_length;
/**
* Probe response or beacon scanned for the BSS.
*
* Field layout:
*/
/** TSF 8 octets */
t_u8 tsf[8];
/** Beacon Interval 2 octets */
t_u16 beacon_interval;
/** Capability Info 2 octets */
IEEEtypes_CapInfo_t cap_info;
/**
* IEEE Infomation Elements; variable number & length per 802.11 spec
*/
/** SSID */
char ssid[MRVDRV_MAX_SSID_LENGTH + 1];
/** SSID Length */
t_u32 ssid_len;
/** WMM Capability */
char wmm_cap;
/** WPS Capability */
char wps_cap;
/** Privacy Capability - WEP/WPA/RSN */
char priv_cap;
/** HT (11N) Capability */
char ht_cap;
/** VHT (11AC) Capability */
char vht_cap[2];
/* 802.11k Capability */
char dot11k_cap;
/** 802.11r Capability */
char dot11r_cap;
} wlan_ioctl_get_bss_info;
/**
* Structure to save of scan table info for each BSS returned
* in WLAN_GET_SCAN_RESP IOCTL
*/
struct wlan_ioctl_get_scan_list {
/** fixed info */
wlan_ioctl_get_scan_table_entry fixed_buf;
/** variable info - BSS info (probe resp or beacon) & IEEE IE info */
wlan_ioctl_get_bss_info bss_info_buf;
/** pointer to next node in list */
struct wlan_ioctl_get_scan_list *next;
};
/**
* Sructure to retrieve the scan table
*/
typedef struct {
/**
* - Zero based scan entry to start retrieval in command request
* - Number of scans entries returned in command response
*/
t_u32 scan_number;
/**
* Buffer marker for multiple wlan_ioctl_get_scan_table_entry
* structures. Each struct is padded to the nearest 32 bit boundary.
*/
t_u8 scan_table_entry_buf[1];
} wlan_ioctl_get_scan_table_info;
typedef struct {
t_u8 chan_number; /**< Channel Number to scan */
t_u8 radio_type; /**< Radio type: 'B/G' Band = 0, 'A' Band = 1 */
t_u8 scan_type; /**< Scan type: Active = 1, Passive = 2 */
t_u8 reserved; /**< Reserved */
t_u32 scan_time; /**< Scan duration in milliseconds; if 0 default used
*/
} __ATTRIB_PACK__ wlan_ioctl_user_scan_chan;
typedef struct {
char ssid[MRVDRV_MAX_SSID_LENGTH + 1]; /**< SSID */
t_u8 max_len; /**< Maximum length of SSID */
} __ATTRIB_PACK__ wlan_ioctl_user_scan_ssid;
typedef struct {
/** Flag set to keep the previous scan table intact */
t_u8 keep_previous_scan; /* Do not erase the existing scan results */
/** BSS mode to be sent in the firmware command */
t_u8 bss_mode;
/** Configure the number of probe requests for active chan scans */
t_u8 num_probes;
/** Reserved */
t_u8 reserved;
/** BSSID filter sent in the firmware command to limit the results */
t_u8 specific_bssid[ETH_ALEN];
/** SSID filter list used in the to limit the scan results */
wlan_ioctl_user_scan_ssid ssid_list[MRVDRV_MAX_SSID_LIST_LENGTH];
/** Variable number (fixed maximum) of channels to scan up */
wlan_ioctl_user_scan_chan chan_list[WLAN_IOCTL_USER_SCAN_CHAN_MAX];
} __ATTRIB_PACK__ wlan_ioctl_user_scan_cfg;
int process_setuserscan(int argc, char *argv[]);
int process_getscantable(int argc, char *argv[]);
int process_getscantable_idx(wlan_ioctl_get_scan_table_info *prsp_info_req);
#endif /* _MLANMISC_H_ */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,560 @@
/** @file mlanoffload.h
*
* @brief This files contains mlanconfig offload command handling.
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
08/11/2009: initial version
************************************************************************/
#ifndef _MLANOFFLOAD_H_
#define _MLANOFFLOAD_H_
/** Key length */
#define KEY_LEN 32
/** Phrase length */
#define PHRASE_LEN 32
/** WEP Key count */
#define WEP_KEY_CNT 4
/* Bitmap for OFFLoad Enable - Feature*/
#ifdef BIG_ENDIAN_SUPPORT
/** Roaming Feature */
#define PROFILE_DB_FEATURE_ROAMING 0x8000
/** CCX Feature */
#define PROFILE_DB_FEATURE_CCX 0x4000
/** UNUSED Feature */
#define PROFILE_DB_FEATURE_UNUSED 0x2000
/** adhoc/infra mode */
#define PROFILE_DB_FEATURE_MODE 0x1000
#else
/** Roaming Feature */
#define PROFILE_DB_FEATURE_ROAMING 0x0001
/** CCX Feature */
#define PROFILE_DB_FEATURE_CCX 0x0002
/** UNUSED Feature */
#define PROFILE_DB_FEATURE_UNUSED 0x0004
/** adhoc/infra mode */
#define PROFILE_DB_FEATURE_MODE 0x0008
#endif
/* Bitmap for profile AKMP Support */
#ifdef BIG_ENDIAN_SUPPORT
/** Key Management EAP */
#define PROFILE_DB_KEY_MGMT_IEEE8021X 0x8000
/** Key Management PSK */
#define PROFILE_DB_KEY_MGMT_PSK 0x4000
/** Key Management NONE */
#define PROFILE_DB_KEY_MGMT_NONE 0x2000
/** Key Management CCKM */
#define PROFILE_DB_KEY_MGMT_CCKM 0x1000
/** Key Management UNUSED */
#define PROFILE_DB_KEY_MGMT_UNUSED 0x0800
/** Key Management FT 802.1x */
#define PROFILE_DB_KEY_MGMT_FT_IEEE8021X 0x0400
/** Key Management FT PSK */
#define PROFILE_DB_KEY_MGMT_FT_PSK 0x0200
/** Key Management SHA256 802.1x */
#define PROFILE_DB_KEY_MGMT_SHA256_IEEE8021X 0x0100
/** Key Management SHA256 PSK*/
#define PROFILE_DB_KEY_MGMT_SHA256_PSK 0x0080
#else
/** Key Management EAP */
#define PROFILE_DB_KEY_MGMT_IEEE8021X 0x0001
/** Key Management PSK */
#define PROFILE_DB_KEY_MGMT_PSK 0x0002
/** Key Management NONE */
#define PROFILE_DB_KEY_MGMT_NONE 0x0004
/** Key Management CCKM */
#define PROFILE_DB_KEY_MGMT_CCKM 0x0008
/** Key Management UNUSED */
#define PROFILE_DB_KEY_MGMT_UNUSED 0x0010
/** Key Management FT 802.1x */
#define PROFILE_DB_KEY_MGMT_FT_IEEE8021X 0x0020
/** Key Management FT PSK */
#define PROFILE_DB_KEY_MGMT_FT_PSK 0x0040
/** Key Management SHA256 802.1x */
#define PROFILE_DB_KEY_MGMT_SHA256_IEEE8021X 0x0080
/** Key Management SHA256 PSK*/
#define PROFILE_DB_KEY_MGMT_SHA256_PSK 0x0100
#endif
/* Bitmap for profile Encryption protocol support */
#ifdef BIG_ENDIAN_SUPPORT
/** Encryption protocol noRsn */
#define PROFILE_DB_PROTO_NO_RSN 0x8000
/** Encryption protocol static wep */
#define PROFILE_DB_PROTO_WEP_STATIC 0x4000
/** Encryption protocol dynamic wep */
#define PROFILE_DB_PROTO_WEP_DYNAMIC 0x2000
/** Encryption protocol WPA */
#define PROFILE_DB_PROTO_WPA 0x1000
/** Encryption protocol WPA-none
* Ad-hoc Networks */
#define PROFILE_DB_PROTO_WPA_NONE 0x0800
/** Encryption protocol WPA2 */
#define PROFILE_DB_PROTO_WPA2 0x0400
/** Encryption protocol CCKM */
#define PROFILE_DB_PROTO_CCKM 0x0200
#else
/** Encryption protocol noRsn */
#define PROFILE_DB_PROTO_NO_RSN 0x0001
/** Encryption protocol static wep */
#define PROFILE_DB_PROTO_WEP_STATIC 0x0002
/** Encryption protocol dynamic wep */
#define PROFILE_DB_PROTO_WEP_DYNAMIC 0x0004
/** Encryption protocol WPA */
#define PROFILE_DB_PROTO_WPA 0x0008
/** Encryption protocol WPA-none
* Ad-hoc Networks */
#define PROFILE_DB_PROTO_WPA_NONE 0x0010
/** Encryption protocol WPA2 */
#define PROFILE_DB_PROTO_WPA2 0x0020
/** Encryption protocol CCKM */
#define PROFILE_DB_PROTO_CCKM 0x0040
#endif
#ifdef BIG_ENDIAN_SUPPORT
/** Cipher wep40 */
#define PROFILE_DB_CIPHER_WEP40 0x80
/** Cipher wep104 */
#define PROFILE_DB_CIPHER_WEP104 0x40
/** Cipher tkip */
#define PROFILE_DB_CIPHER_TKIP 0x20
/** Cipher ccmp */
#define PROFILE_DB_CIPHER_CCMP 0x10
#else
/** Cipher wep40 */
#define PROFILE_DB_CIPHER_WEP40 0x01
/** Cipher wep104 */
#define PROFILE_DB_CIPHER_WEP104 0x02
/** Cipher tkip */
#define PROFILE_DB_CIPHER_TKIP 0x04
/** Cipher ccmp */
#define PROFILE_DB_CIPHER_CCMP 0x08
#endif
typedef struct {
t_u16 startFreq;
t_u8 chanWidth;
t_u8 chanNum;
} __ATTRIB_PACK__ MrvlChannelDesc_t;
typedef struct {
/** Header */
MrvlIEtypesHeader_t header;
t_u32 mode; /**< Mode */
t_u32 max_off_channel; /**< Maximum off-channel measurement duration
(ms) */
t_u32 max_on_channel; /**< Maximum on-channel measurement duration (ms)
*/
} __ATTRIB_PACK__ MrvlIETypes_MeasTiming_t;
typedef struct {
/** Action Set or get */
t_u16 action;
/** TLV buffer starts here */
t_u8 tlv_buffer[1];
/*
* MrvlIETypes_MeasTiming_t
*/
} __ATTRIB_PACK__ HostCmd_DS_MEASUREMENT_Timing;
/** helper structure for profile parsing */
typedef struct {
/** SSID name string */
t_u8 ssid[IW_ESSID_MAX_SIZE + 1];
/** SSID len */
t_u32 ssid_len;
/** BSSID network name */
t_u8 bssid[ETH_ALEN];
/** passphrase configured */
t_s8 passphrase[PHRASE_LEN];
/** passphrase length */
t_u32 passphrase_len;
/** Pre-shared key config flag */
int psk_config;
/** Pre-shared key */
t_u8 psk[KEY_LEN];
/** wep keys */
t_u8 wep_key[WEP_KEY_CNT][KEY_LEN];
/** wep keys lengths */
t_u8 wep_key_len[WEP_KEY_CNT];
/** wep key index */
int wep_key_idx;
/** protocol fields */
t_u16 protocol;
/** pairwise Cipher values */
t_u8 pairwise_cipher;
/** Group Cipher values */
t_u8 groupwise_cipher;
/** key management */
t_u16 key_mgmt;
/** offload specific parameter(roaming) */
t_u16 roaming;
/** offload specific parameter */
t_u16 reserved;
/** offload specific parameter--ccx */
t_u16 ccx;
/** offload specific parameter--mode */
t_u16 mode;
} profile_entry_t;
typedef struct {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 Reserved : 3;
/** Channel not measured */
t_u8 Unmeasured : 1;
/** Radar detected */
t_u8 Radar : 1;
/** Unidentified signal received */
t_u8 Unidentified : 1;
/** OFDM Preamble received */
t_u8 OFDM_Preamble : 1;
/** BSS found */
t_u8 BSS : 1;
#else
/** BSS found */
t_u8 BSS : 1;
/** OFDM Preamble received */
t_u8 OFDM_Preamble : 1;
/** Unidentified signal received */
t_u8 Unidentified : 1;
/** Radar detected */
t_u8 Radar : 1;
/** Channel not measured */
t_u8 Unmeasured : 1;
/** Reserved */
t_u8 Reserved : 3;
#endif
} __ATTRIB_PACK__ IEEEtypes_DFS_Map_t;
typedef struct {
MrvlChannelDesc_t chanDesc; /**< Channel band, number */
t_u32 millisecDwellTime; /**< Channel dwell time in milliseconds */
} __ATTRIB_PACK__ HostCmd_DS_CHAN_RPT_REQ;
typedef struct {
t_u32 commandResult; /**< Rpt request command result (0 == SUCCESS) */
t_u64 startTsf; /**< TSF Measurement started */
t_u32 duration; /**< Duration of measurement in microsecs */
t_u8 tlvBuffer[1]; /**< TLV Buffer */
} __ATTRIB_PACK__ HostCmd_DS_CHAN_RPT_RSP;
typedef struct {
MrvlIEtypesHeader_t Header; /**< Header */
t_u8 scanReqId; /**< Scan request id assigned in table */
} __ATTRIB_PACK__ MrvlIEtypes_ChanRptBcn_t;
typedef struct {
MrvlIEtypesHeader_t Header; /**< Header */
t_u8 ccaBusyFraction; /**< Parts per 255 channel was busy */
} __ATTRIB_PACK__ MrvlIEtypes_ChanRptChanLoad_t;
typedef struct {
MrvlIEtypesHeader_t header; /**< Header */
t_s16 anpi; /**< ANPI calculated from the histogram */
/** RPI histogram bins. The number of bins utilized is variable and must
be calculated by the header length */
t_u8 rpiDensities[11];
} __ATTRIB_PACK__ MrvlIEtypes_ChanRptNoiseHist_t;
typedef struct {
MrvlIEtypesHeader_t Header; /**< Header */
IEEEtypes_DFS_Map_t map; /**< IEEE 802.11h basic meas report */
} __ATTRIB_PACK__ MrvlIEtypes_ChanRpt11hBasic_t;
typedef struct {
MrvlIEtypesHeader_t Header; /**< Header */
t_u8 sourceAddr[ETH_ALEN]; /**< Source MAC */
t_u8 bssid[ETH_ALEN]; /**< BSSID MAC */
t_s16 rssi; /**< Avg RSSI of frames */
t_u16 frameCnt; /**< # of frames */
} __ATTRIB_PACK__ MrvlIEtypes_ChanRptFrame_t;
#ifdef OPCHAN
typedef struct {
MrvlIEtypesHeader_t header; /**< Header */
MrvlChannelDesc_t chanDesc;
t_u16 controlFlags;
t_u16 reserved;
t_u8 actPower;
t_u8 mdMinPower;
t_u8 mdMaxPower;
t_u8 mdPower;
} __ATTRIB_PACK__ MrvlIEtypes_ChanControlDesc_t;
typedef struct {
#ifdef BIG_ENDIAN
/** Reserved */
t_u8 reserved_4_7 : 4;
/** Disble channel filtering flag */
t_u8 disable_chan_filt : 1;
/** Channel scan mode passive flag */
t_u8 passive_scan : 1;
/** Multidomain scan mode */
t_u8 multidomain_scan : 1;
/** Enable probe response timeout */
t_u8 rsp_timeout_en : 1;
#else
/** Enable probe response timeout */
t_u8 rsp_timeout_en : 1;
/** Multidomain scan mode */
t_u8 multidomain_scan : 1;
/** Channel scan mode passive flag */
t_u8 passive_scan : 1;
/** Disble channel filtering flag */
t_u8 disable_chan_filt : 1;
/** Reserved */
t_u8 reserved_4_7 : 4;
#endif
} __ATTRIB_PACK__ ChanScanMode_t;
typedef struct {
MrvlIEtypesHeader_t header; /**< Header */
t_u32 chanGroupBitmap;
ChanScanMode_t scanMode;
t_u8 numChan;
MrvlChannelDesc_t chanDesc[50];
} __ATTRIB_PACK__ MrvlIEtypes_ChanGroupControl_t;
typedef struct {
t_u16 action; /**< CMD Action Get/Set*/
t_u8 tlv_buffer[1];
} __ATTRIB_PACK__ HostCmd_DS_OPCHAN_CONFIG;
typedef struct {
t_u16 action; /**< CMD Action Get/Set*/
t_u8 tlv_buffer[1];
} __ATTRIB_PACK__ HostCmd_DS_OPCHAN_CHANGROUP_CONFIG;
#endif
typedef struct {
t_u8 modGroup;
t_u8 txPower;
} __ATTRIB_PACK__ MrvlChanTrpcEntry_t;
typedef struct {
MrvlIEtypesHeader_t header; /**< Header */
MrvlChannelDesc_t chanDesc;
MrvlChanTrpcEntry_t chanTrpcEntry[1];
} __ATTRIB_PACK__ MrvlIEtypes_ChanTrpcCfg_t;
typedef struct {
t_u16 action; /**< CMD Action Get/Set*/
t_u16 reserved;
t_u8 tlv_buffer[1]; /** MrvlIEtypes_ChanTrpcCfg_t TLVs */
} __ATTRIB_PACK__ HostCmd_DS_CHAN_TRPC_CONFIG;
typedef struct {
t_u8 controlSelect;
t_u8 controlBitmap[1]; /* Variable length # of byte bitmaps */
} __ATTRIB_PACK__ HostCmd_DS_OFFLOAD_FEATURE_CONTROL;
#define IAPP_DATA_MAX 1000
/**
* @brief Enumeration for the command result from an IAPP Proxy command
*/
typedef enum {
IAPP_PROXY_RESULT_SUCCESS = 0,
IAPP_PROXY_RESULT_EXEC_FAILURE = 1,
IAPP_PROXY_RESULT_TIMEOUT = 2,
IAPP_PROXY_RESULT_DATA_INVALID = 3,
} __ATTRIB_PACK__ mlan_iapp_proxy_result_e;
typedef struct {
mlan_iapp_proxy_result_e commandResult; /**< Firmware execution result
*/
t_u32 timeout_ms; /**< Timeout value in milliseconds */
t_u8 iappType;
t_u8 iappSubType;
t_u32 iappDataLen;
t_u8 iappData[IAPP_DATA_MAX];
} __ATTRIB_PACK__ HostCmd_DS_IAPP_PROXY;
typedef struct {
/** Action: GET/SET */
t_u16 Action;
/** Reserved */
t_u16 Reserved;
/** Association timeout */
t_u32 AssocTimeout;
/** Reassociation timeout */
t_u32 ReassocTimeout;
/** Hand shake timeout */
t_u32 HandShakeTimeout;
/** Frame exchange timeout */
t_u32 FrameExchangeTimeout;
/** Deauth of old AP in millisec; 0 to disable */
t_u32 PriorApDeauthDelay;
/** Maximum time after a disconnect where a reassoc frame will be sent
*/
t_u32 ReassocDiscMax;
} __ATTRIB_PACK__ HostCmd_DS_AssociationTiming_t;
/** 16 bit unsigned integer */
typedef t_u16 IEEEtypes_AId_t;
/** 16 bit unsigned integer */
typedef t_u16 IEEEtypes_StatusCode_t;
typedef struct {
/** Capability information */
IEEEtypes_CapInfo_t Capability;
/** Association response status code */
IEEEtypes_StatusCode_t StatusCode;
/** Association ID */
IEEEtypes_AId_t AId;
/** IE data buffer */
t_u8 IEBuffer[1];
} __ATTRIB_PACK__ IEEEtypes_AssocRsp_t;
/** Maximum number of AC QOS queues available in the driver/firmware */
#define MAX_AC_QUEUES 4
typedef struct {
t_u32 timeSinceLastQuery_ms; /**< Duration of stats collection */
t_u16 bcnCnt; /**< Number of beacons received */
t_u16 bcnMiss; /**< Estimate of beacons missed */
t_s16 bcnRssiAvg; /**< Avg beacon RSSI */
t_s16 bcnSnrAvg; /**< Avg beacon SNR */
t_u32 rxPkts; /**< Number of packets received */
t_s16 rxRssiAvg; /**< Avg received packet RSSI */
t_s16 rxSnrAvg; /**< Avg received packet SNR */
t_u32 txPkts; /**< Number of packets transmitted */
t_u32 txAttempts; /**< Number of attempts made */
t_u32 txFailures; /**< Number of pkts that failed */
t_u8 txInitRate; /**< Current rate adaptation TX rateid */
t_u8 reserved[3]; /**< Reserved */
t_u16 txQueuePktCnt[MAX_AC_QUEUES]; /**< Number of packets per AC */
t_u32 txQueueDelay[MAX_AC_QUEUES]; /**< Averge queue delay per AC*/
} __ATTRIB_PACK__ HostCmd_DS_LINK_STATS_SUMMARY;
/** timing select structure */
typedef struct {
char *str; /**< Timing mode string */
int match_len; /**< match length */
t_u8 sel; /**< flag */
} timing_sel_t;
/** ENUM definition: reg_chan_table */
typedef enum {
REGTABLE_DEFAULT = 0,
REGTABLE_ESS = 1,
REGTABLE_USER = 2,
REGTABLE_MULTIDOMAIN = 3,
REGTABLE_MAX = 0xFFFF,
} reg_chan_table_e;
/** Sub-command callback */
typedef int (*sub_cmd_callback_t)(int argc, char *argv[]);
/** Sub-command execution data */
typedef struct {
char *str; /**< Command string */
int match_len; /**< Length */
int display; /**< display as valid cmd */
sub_cmd_callback_t callback; /**< Sub-command callback */
} sub_cmd_exec_t;
/** HostCmd_CMD_802_11_RF_TX_POWER */
typedef struct {
t_u16 action;
t_s16 current_level;
t_s8 max_power;
t_s8 min_power;
} __ATTRIB_PACK__ HostCmd_DS_802_11_RF_TX_POWER;
/** HostCmd_CMD_802_11_AUTHENTICATE */
typedef struct {
/** MAC address */
t_u8 MacAddr[ETH_ALEN];
/** Authentication type */
t_u8 AuthType;
} __ATTRIB_PACK__ HostCmd_DS_802_11_AUTHENTICATE;
boolean reg_class_table_select(char *tableStr, reg_chan_table_e *pTable);
int process_sub_cmd(sub_cmd_exec_t *sub_cmd, int num_sub_cmds, int argc,
char *argv[]);
int process_regclass(int argc, char *argv[]);
int process_scanagent(int argc, char *argv[]);
int process_measurement(int argc, char *argv[]);
int process_profile_entry(int argc, char *argv[]);
int process_get_ra_config(int argc, char *argv[]);
int process_set_ra_config(int argc, char *argv[]);
int process_chanrpt(int argc, char *argv[]);
int process_chan_graph(int argc, char *argv[]);
int process_assoc_timing(int argc, char *argv[]);
int process_get_assocrsp(void);
int process_link_stats(int argc, char *argv[]);
int process_opchan(int argc, char *argv[]);
int process_changroup(int argc, char *argv[]);
int process_fcontrol(int argc, char *argv[]);
int process_iapp(int argc, char *argv[]);
int process_dscpmap(int argc, char *argv[]);
int process_rf_tx_power(int argc, char *argv[]);
int process_authenticate(int argc, char *argv[]);
int process_txpowdisp(int argc, char *argv[]);
int process_tsf(int argc, char *argv[]);
#endif /* _MLANOFFLOAD_H_ */

View file

@ -0,0 +1,430 @@
/** @file mlanregclass.c
*
* @brief This files contains mlanconfig regclass command handling.
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
08/11/2009: initial version
************************************************************************/
#include "mlanconfig.h"
#include "mlanhostcmd.h"
#include "mlanmisc.h"
#include "mlanoffload.h"
#include "mlanregclass.h"
/********************************************************
Local Variables
********************************************************/
/********************************************************
Global Variables
********************************************************/
/********************************************************
Local Functions
********************************************************/
/**
* @brief Convert reg domain number to string
*
* @param reg_domain Reg Domain
*
* @return Reg Domain type
*/
static char *reg_domain_to_str(reg_domain_e reg_domain)
{
switch (reg_domain) {
case REGDOMAIN_FCC:
return "FCC";
case REGDOMAIN_ETSI:
return "ETSI";
case REGDOMAIN_MIC:
return "MIC";
case REGDOMAIN_OTHER:
return "MULTI";
default:
break;
}
return "UNKN";
}
/**
* @brief Convert reg channel table number to string
*
* @param table_select Reg channel table
*
* @return Reg channel table type
*/
static char *table_num_to_str(reg_chan_table_e table_select)
{
switch (table_select) {
case REGTABLE_USER:
return "User";
case REGTABLE_MULTIDOMAIN:
return "MultiDomain";
case REGTABLE_ESS:
return "ESS";
case REGTABLE_DEFAULT:
return "Default";
default:
break;
}
return "UNKN";
}
/**
* @brief Regclass dump channel table
*
* @param argc Number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
static int reg_class_dump_chan_table(int argc, char *argv[])
{
int ioctl_val, subioctl_val;
struct iwreq iwr;
HostCmd_DS_GEN *hostcmd;
HostCmd_DS_REGCLASS_GET_CHAN_TABLE *get_table;
t_u8 *buf, *pos;
int idx, cmd_len;
t_u16 regLimits;
boolean invalid_cmd = FALSE;
buf = 0;
if (argv[0] == NULL) {
invalid_cmd = TRUE;
} else {
if (get_priv_ioctl("hostcmd", &ioctl_val, &subioctl_val) ==
MLAN_STATUS_FAILURE) {
return -EOPNOTSUPP;
}
cmd_len = sizeof(HostCmd_DS_GEN) +
sizeof(HostCmd_DS_REGCLASS_GET_CHAN_TABLE);
buf = (t_u8 *)calloc(sizeof(t_u8), cmd_len);
hostcmd = (HostCmd_DS_GEN *)buf;
hostcmd->command = HostCmd_CMD_REGCLASS_CHAN_TABLE;
hostcmd->size = 0;
hostcmd->seq_num = 0;
hostcmd->result = 0;
pos = buf + sizeof(HostCmd_DS_GEN);
get_table = (HostCmd_DS_REGCLASS_GET_CHAN_TABLE *)pos;
get_table->action = cpu_to_le16(HostCmd_ACT_GEN_GET);
if (reg_class_table_select(
argv[0],
(reg_chan_table_e *)&get_table->table_select) ==
FALSE) {
invalid_cmd = TRUE;
}
}
if (invalid_cmd) {
printf("\nValid tables table; valid [user, md, ess, default]\n\n");
if (buf) {
free(buf);
}
return MLAN_STATUS_FAILURE;
}
hostcmd->command = cpu_to_le16(hostcmd->command);
hostcmd->size = cpu_to_le16(cmd_len);
get_table->table_select = cpu_to_le16((t_u16)(get_table->table_select));
memset(&iwr, 0, sizeof(iwr));
strncpy(iwr.ifr_name, dev_name, IFNAMSIZ);
iwr.u.data.pointer = (caddr_t)buf;
iwr.u.data.length = cmd_len;
iwr.u.data.flags = 0;
if (ioctl(sockfd, ioctl_val, &iwr) < 0) {
perror("mlanconfig: regClassIoctl ioctl");
free(buf);
return -EFAULT;
}
if (!le16_to_cpu(hostcmd->result)) {
printf("HOSTCMD_RESP: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
} else {
printf("HOSTCMD failed: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
}
get_table->table_select = le16_to_cpu(get_table->table_select);
get_table->chan = le32_to_cpu(get_table->chan);
printf("---------------------------------------");
printf("---------------------------------------\n");
printf("%35s: %s [%d]\n", "Channel Table",
table_num_to_str(get_table->table_select), (int)get_table->chan);
printf("---------------------------------------");
printf("---------------------------------------\n");
printf(" chn | freq | sfrq | sp | class | maxP | behavior limits\n");
printf("---------------------------------------");
printf("---------------------------------------\n");
for (idx = 0; (unsigned int)idx < get_table->chan; idx++) {
char regDisp[8];
sprintf(regDisp, "%4s-%02u",
reg_domain_to_str(
get_table->chan_entry[idx].reg_domain),
get_table->chan_entry[idx].regulatory_class);
printf(" %03u | %04u | %04u | %02u | %-8s | %02u |",
get_table->chan_entry[idx].chan_num,
(get_table->chan_entry[idx].start_freq +
(get_table->chan_entry[idx].chan_num * 5)),
le16_to_cpu(get_table->chan_entry[idx].start_freq),
le16_to_cpu(get_table->chan_entry[idx].chan_spacing),
regDisp, get_table->chan_entry[idx].max_tx_power);
regLimits = le16_to_cpu(get_table->chan_entry[idx].reg_limits);
if (regLimits & BLIMIT_NOMADIC)
printf(" nomadic");
if (regLimits & BLIMIT_INDOOR_ONLY)
printf(" indoor");
if (regLimits & BLIMIT_TPC)
printf(" tpc");
if (regLimits & BLIMIT_DFS)
printf(" dfs");
if (regLimits & BLIMIT_IBSS_PROHIBIT)
printf(" no_ibss");
if (regLimits & BLIMIT_FOUR_MS_CS)
printf(" 4ms_cs");
if (regLimits & BLIMIT_LIC_BASE_STA)
printf(" base_sta");
if (regLimits & BLIMIT_MOBILE_STA)
printf(" mobile");
if (regLimits & BLIMIT_PUBLIC_SAFETY)
printf(" safety");
if (regLimits & BLIMIT_ISM_BANDS)
printf(" ism");
printf("\n");
}
printf("---------------------------------------");
printf("---------------------------------------\n");
printf("\n");
free(buf);
return MLAN_STATUS_SUCCESS;
}
/**
* @brief Regclass configure user table
*
* @param argc Number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
static int reg_class_config_user_table(int argc, char *argv[])
{
int ioctl_val, subioctl_val, cmd_len;
struct iwreq iwr;
t_u8 *buf, *pos;
HostCmd_DS_GEN *hostcmd;
HostCmd_DS_REGCLASS_CONFIG_USER_TABLE *cfg_user_table;
if (argv[0] == NULL) {
printf("\nCountry string not specified\n");
return MLAN_STATUS_FAILURE;
}
if (get_priv_ioctl("hostcmd", &ioctl_val, &subioctl_val) ==
MLAN_STATUS_FAILURE) {
return -EOPNOTSUPP;
}
cmd_len = sizeof(HostCmd_DS_GEN) +
sizeof(HostCmd_DS_REGCLASS_CONFIG_USER_TABLE);
buf = (t_u8 *)calloc(sizeof(t_u8), cmd_len);
hostcmd = (HostCmd_DS_GEN *)buf;
hostcmd->command = HostCmd_CMD_REGCLASS_CONFIG_USER_TABLE;
hostcmd->size = 0;
hostcmd->seq_num = 0;
hostcmd->result = 0;
pos = buf + sizeof(HostCmd_DS_GEN);
cfg_user_table = (HostCmd_DS_REGCLASS_CONFIG_USER_TABLE *)pos;
cfg_user_table->action = cpu_to_le16(HostCmd_ACT_GEN_SET);
memcpy(cfg_user_table->regulatory_str, argv[0],
MIN(strlen(argv[0]), sizeof(cfg_user_table->regulatory_str)));
hostcmd->command = cpu_to_le16(hostcmd->command);
hostcmd->size = cpu_to_le16(cmd_len);
strncpy(iwr.ifr_name, dev_name, IFNAMSIZ);
iwr.u.data.flags = 0;
iwr.u.data.pointer = (caddr_t)buf;
iwr.u.data.length = cmd_len;
if (ioctl(sockfd, ioctl_val, &iwr) < 0) {
perror("mlanconfig: regClassIoctl ioctl");
free(buf);
return -EFAULT;
}
if (!le16_to_cpu(hostcmd->result)) {
printf("HOSTCMD_RESP: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
} else {
printf("HOSTCMD failed: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
}
free(buf);
return MLAN_STATUS_SUCCESS;
}
/**
* @brief Issue regclass multi-domain command
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
static int reg_class_multidomain(int argc, char *argv[])
{
int ioctl_val, subioctl_val, cmd_len;
struct iwreq iwr;
t_u8 *buf, *pos;
HostCmd_DS_GEN *hostcmd;
HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL *multidomain_ctrl;
boolean invalid_cmd = FALSE;
if (argv[0] == NULL) {
invalid_cmd = TRUE;
} else {
if (get_priv_ioctl("hostcmd", &ioctl_val, &subioctl_val) ==
MLAN_STATUS_FAILURE) {
return -EOPNOTSUPP;
}
cmd_len = sizeof(HostCmd_DS_GEN) +
sizeof(HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL);
buf = (t_u8 *)calloc(sizeof(t_u8), cmd_len);
hostcmd = (HostCmd_DS_GEN *)buf;
hostcmd->command = HostCmd_CMD_REGCLASS_MULTIDOMAIN_CONTROL;
hostcmd->size = 0;
hostcmd->seq_num = 0;
hostcmd->result = 0;
pos = buf + sizeof(HostCmd_DS_GEN);
multidomain_ctrl =
(HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL *)pos;
if (strcmp(argv[0], "on") == 0) {
multidomain_ctrl->multidomain_enable = 1;
} else if (strcmp(argv[0], "off") == 0) {
multidomain_ctrl->multidomain_enable = 0;
} else {
invalid_cmd = TRUE;
free(buf);
}
}
if (invalid_cmd) {
printf("\nUnknown multiDomain command; valid [on, off]\n\n");
return MLAN_STATUS_FAILURE;
}
multidomain_ctrl->multidomain_enable =
cpu_to_le32(multidomain_ctrl->multidomain_enable);
hostcmd->command = cpu_to_le16(hostcmd->command);
hostcmd->size = cpu_to_le16(cmd_len);
strncpy(iwr.ifr_name, dev_name, IFNAMSIZ);
iwr.u.data.flags = 0;
iwr.u.data.pointer = (caddr_t)buf;
iwr.u.data.length = cmd_len;
if (ioctl(sockfd, ioctl_val, &iwr) < 0) {
perror("mlanconfig: regClass ioctl");
free(buf);
return -EFAULT;
} else {
printf("\nMultiDomain: %s\n",
le32_to_cpu(multidomain_ctrl->multidomain_enable) ?
"Enabled" :
"Disabled");
}
if (!le16_to_cpu(hostcmd->result)) {
printf("HOSTCMD_RESP: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
} else {
printf("HOSTCMD failed: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
}
free(buf);
return MLAN_STATUS_SUCCESS;
}
/**
* @brief Issue a regclass command
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int process_regclass(int argc, char *argv[])
{
sub_cmd_exec_t sub_cmd[] = {
{"table", 1, 1, reg_class_dump_chan_table},
{"multidomain", 1, 1, reg_class_multidomain},
{"country", 1, 1, reg_class_config_user_table}};
return (process_sub_cmd(sub_cmd, NELEMENTS(sub_cmd), argc, argv));
}

View file

@ -0,0 +1,96 @@
/** @file mlanregclass.h
*
* @brief This files contains mlanconfig regclass command handling.
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
08/11/2009: initial version
************************************************************************/
#ifndef _MLANREGCLASS_H
#define _MLANREGCLASS_H
/** Nomadic */
#define BLIMIT_NOMADIC (1 << 0)
/** Indoor */
#define BLIMIT_INDOOR_ONLY (1 << 1)
/** Tpc */
#define BLIMIT_TPC (1 << 2)
/** Dfs */
#define BLIMIT_DFS (1 << 3)
/** IBSS Prohibit */
#define BLIMIT_IBSS_PROHIBIT (1 << 4)
/** Four MS CS */
#define BLIMIT_FOUR_MS_CS (1 << 5)
/** LIC Base STA */
#define BLIMIT_LIC_BASE_STA (1 << 6)
/** Mobile STA */
#define BLIMIT_MOBILE_STA (1 << 7)
/** Public Safety */
#define BLIMIT_PUBLIC_SAFETY (1 << 8)
/** ISM Bands */
#define BLIMIT_ISM_BANDS (1 << 9)
/** Enum Definitions: reg_domain */
typedef enum {
REGDOMAIN_NULL = 0x00,
REGDOMAIN_FCC = 0x01,
REGDOMAIN_ETSI = 0x02,
REGDOMAIN_MIC = 0x03,
REGDOMAIN_OTHER = 0xFF,
} reg_domain_e;
typedef struct {
t_u8 reg_domain; /**< Domain */
t_u8 regulatory_class; /**< Regulatory class */
t_u8 chan_num; /**< Channel Number */
t_u8 reserved1; /**< Reserved */
t_u16 start_freq; /**< Start frequency */
t_u16 chan_spacing; /**< channel spacing */
t_u8 max_tx_power; /**< Max. tx power */
t_u8 coverage_class; /**< Coverage class */
t_u16 reg_limits; /**< Limits */
} __ATTRIB_PACK__ chan_entry_t;
typedef struct {
/** Action: GET/SET */
t_u16 action;
/** Reg channel table */
t_u16 table_select;
/** Channel number */
t_u32 chan;
/** Channel entry */
chan_entry_t chan_entry[75];
} __ATTRIB_PACK__ HostCmd_DS_REGCLASS_GET_CHAN_TABLE;
typedef struct {
t_u16 action; /**< Action: GET/SET */
t_u16 reserved; /**< Reserved */
char regulatory_str[3]; /**< Regulatory String */
} __ATTRIB_PACK__ HostCmd_DS_REGCLASS_CONFIG_USER_TABLE;
typedef struct {
t_u32 multidomain_enable; /**< Multi domain enable */
} __ATTRIB_PACK__ HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL;
#endif /* _MLANREGCLASS_H */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,321 @@
/** @file mlanroamagent.h
*
* @brief This files contains mlanconfig roamagent command handling.
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
08/11/2009: initial version
************************************************************************/
#ifndef _MLANROAMAGENT_H_
#define _MLANROAMAGENT_H_
/** Bit definitions */
#ifndef BIT
#define BIT(x) (1UL << (x))
#endif
/* Define actionsd for HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST_MAINTENANCE */
/** Blacklist */
#define HostCmd_ACT_ADD_TO_BLACKLIST 0x0001
/** Flushing blacklisted entry */
#define HostCmd_ACT_REMOVE_FROM_BLACKLIST 0x0002
/** Roaming scanmode: discovery */
#define DISCOVERY_MODE 1
/** Roaming scanmode: tracking */
#define TRACKING_MODE 2
/** Threshold configuration: RSSI */
#define RSSI_THRESHOLD 1
/** Threshold configuration: SNR */
#define SNR_THRESHOLD 2
#ifdef BIG_ENDIAN_SUPPORT
/** Bit values for Qualified Neighbor RSSI Entry */
#define BIT_NEIGHFLAG_RSSI 0x80000000
/** Bit values for Qualified Neighbor AGE Entry */
#define BIT_NEIGHFLAG_AGE 0x40000000
/** Bit values for Qualified Neighbor Blacklist Entry */
#define BIT_NEIGHFLAG_BLACKLIST 0x20000000
/** Bit values for Qualified Neighbor Admission Capacity */
#define BIT_NEIGHFLAG_ADMISSION_CAP 0x10000000
/** Bit values for Qualified Neighbor Uplink RSSI */
#define BIT_NEIGHFLAG_UPLINK_RSSI 0x08000000
#else
/** Bit values for Qualified Neighbor RSSI Entry */
#define BIT_NEIGHFLAG_RSSI 0x01
/** Bit values for Qualified Neighbor AGE Entry */
#define BIT_NEIGHFLAG_AGE 0x02
/** Bit values for Qualified Neighbor Blacklist Entry */
#define BIT_NEIGHFLAG_BLACKLIST 0x04
/** Bit values for Qualified Neighbor Admission Capacity */
#define BIT_NEIGHFLAG_ADMISSION_CAP 0x08
/** Bit values for Qualified Neighbor Uplink RSSI */
#define BIT_NEIGHFLAG_UPLINK_RSSI 0x10
#endif
/** milliseconds time conversion data */
typedef struct exactTime {
t_u16 hrs; /**< Number of hours */
t_u16 mins; /**< Number of minutes */
t_u16 secs; /**< Number of seconds */
t_u16 msecs; /**< Number of milliseconds left */
} ExactTime_t;
/** ROAMAGENT HostEvent bitmasks */
typedef enum {
HOST_EVENT_NBOR_DISABLE = 6, /* reset bit 0 */
HOST_EVENT_NBOR_ENABLE = 1, /* set bit 0 */
HOST_EVENT_ROAM_DISABLE = 5, /* reset bit 1 */
HOST_EVENT_ROAM_ENABLE = 2, /* set bit 1 */
HOST_EVENT_STATE_DISABLE = 3, /* reset bit 2 */
HOST_EVENT_STATE_ENABLE = 4, /* reset bit 2 */
} __ATTRIB_PACK__ HostEvent_e;
/** ROAMAGENT_CONTROL command identifiers */
typedef enum {
ROAM_CONTROL_DISABLE = 6, /* reset bit 0 */
ROAM_CONTROL_ENABLE = 1, /* set bit 0 */
ROAM_CONTROL_RESUME = 5, /* reset bit 1 */
ROAM_CONTROL_SUSPEND = 2, /* set bit 1 */
CROSSBAND_DISABLE = 3, /* reset bit 2 */
CROSSBAND_ENABLE = 4 /* set bit 2 */
} __ATTRIB_PACK__ RoamControl_e;
/*
* Definitions of roaming state and other constants
*/
/** Enum Definitations: Roaming agent state */
typedef enum {
STATE_DISCONNECTED,
STATE_STABLE,
STATE_DEGRADING,
STATE_UNACCEPTABLE,
STATE_HARDROAM,
STATE_LINKLOSS,
STATE_SOFTROAM,
STATE_SUSPEND,
STATE_CMD_SUSPEND,
STATE_ASYNCASSOC_SUSPEND
} RoamingAgentState;
/** statistics threshold High RSSI */
typedef struct {
/** Header */
MrvlIEtypesHeader_t Header;
/** RSSI threshold (dBm) */
t_u8 Value;
/** reporting frequency */
t_u8 Frequency;
} __ATTRIB_PACK__ MrvlIEtypes_BeaconHighRssiThreshold_t,
MrvlIEtypes_BeaconLowRssiThreshold_t,
MrvlIEtypes_BeaconHighSnrThreshold_t,
MrvlIEtypes_BeaconLowSnrThreshold_t;
/** HostCmd_DS_CMD_ROAMAGENT_STATISTICS_THRESHOLD */
typedef struct {
/** Action */
t_u16 action;
/** roaming state */
t_u8 State;
/** active/configured user */
t_u8 Profile;
/** TLV buffer */
t_u8 TlvBuffer[1];
/* MrvlIEtypes_BeaconHighRssiThreshold_t BeaconHighRssiThreshold;
* MrvlIEtypes_BeaconLowRssiThreshold_t BeaconLowRssiThreshold;
* MrvlIEtypes_BeaconHighSnrThreshold_t BeaconHighSnrThreshold;
* MrvlIEtypes_BeaconLowSnrThreshold_t BeaconLowSnrThreshold;
* MrvlIEtypes_BeaconsMissed_t PreBeaconMissed;
* MrvlIEtypes_FailureCount_t FailureCnt;
*/
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_STATISTICS_THRESHOLD;
typedef struct {
/** */
signed char RssiHighLevel;
/** */
signed char RssiLowLevel;
/** */
signed char RssiNborDiff;
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_ROAM_THRESHOLD;
#define ROAM_THRESH_MAX 4
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_ASSESSMENT */
typedef struct {
/** Action */
t_u16 action;
/** configured qualifying snr */
signed char ConfQualSignalStrength;
/** active qualifying snr */
signed char ActiveQualSignalStrength;
/** qualifying neighbor count */
t_u16 QualifyingNumNeighbor;
/** inactivity in # scans */
t_u16 StaleCount;
/** inactivity in time (ms) */
t_u32 StalePeriod;
/** blacklist duration in ms due to minor failures */
t_u32 ShortBlacklistPeriod;
/** blacklist duration in ms due to severe failures */
t_u32 LongBlacklistPeriod;
HostCmd_DS_CMD_ROAMAGENT_ROAM_THRESHOLD RoamThresh[ROAM_THRESH_MAX];
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_ASSESSMENT;
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST */
typedef struct {
/** Action */
t_u16 action;
/** Reserved */
t_u16 Reserved;
/** TLV buffer */
t_u8 TlvBuffer[1];
/* MrvlIEtypes_NeighborEntry_t Neighbors[MRVL_ROAM_MAX_NEIGHBORS];
* MRVL_ROAM_MAX_NEIGHBORS = 5
*/
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST;
/** neighbor entry details roaming agent */
typedef struct {
/** Header */
MrvlIEtypesHeader_t Header;
/** bssid of neighbor */
t_u8 Bssid[ETH_ALEN];
/** Reserved */
t_u16 Reserved;
/** neighbor snr */
t_s16 SignalStrength;
/** neighbor age */
t_u16 Age;
/** bit map for qualified neighbor */
t_u32 QualifiedNeighborBitmap;
/** blacklist duration in ms */
t_u32 BlackListDuration;
} __ATTRIB_PACK__ MrvlIEtypes_NeighborEntry_t;
/** HostCmd_DS_ROAMAGENT_ADV_METRIC_THRESHOLD */
typedef struct {
/** Action */
t_u16 action;
/** Beacon RSSI Metrics,Data RSSI Metrics or PER Metrics */
t_u16 Metrics;
/** Percentage FER Threshold value to exceed for making a roam decision
*/
t_u8 UcFerThresholdValue;
/** Percentage PER Threshold value to exceed for making a roam decision
*/
t_u8 UcPerThresholdValue;
/** Reserved for later use */
t_u8 Reserved[2];
/** Time (ms) for which FER should prevail in stable state */
t_u32 StableFERPeriod_ms;
/** Time (ms) for which FER should prevail in degrading state */
t_u32 DegradingFERPeriod_ms;
/** Time (ms) for which FER should prevail in unacceptable state */
t_u32 UnacceptableFERPeriod_ms;
/** Time (ms) for which FER should prevail in stable state */
t_u32 StablePERPeriod_ms;
/** Time (ms) for which PER should prevail in degrading state */
t_u32 DegradingPERPeriod_ms;
/** Time (ms) for which PER should prevail in unacceptable state */
t_u32 UnacceptablePERPeriod_ms;
/** Number of TX packets to exceed in period_ms ms for the FER for Roam
*/
t_u32 UiFerPktThreshold;
/** Number of TX packets to exceed in period_ms ms for the PER for Roam
*/
t_u32 UiPerPktThreshold;
/** Time in ms for which inactivity should prevail for state transition
*/
t_u32 InactivityPeriodThreshold_ms;
/** With Data RSSI Metrics, Roam only when RX packets in period_ms ms
* exceeds this */
t_u32 UiRxPktThreshold;
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_ADV_METRIC_THRESHOLD;
/** scan period for each search mode and state for roaming agent */
typedef struct {
/** Header */
MrvlIEtypesHeader_t Header;
/** search mode */
t_u16 SearchMode;
/** roaming state */
t_u16 State;
/** scan period value */
t_u32 ScanPeriod;
} __ATTRIB_PACK__ MrvlIEtypes_NeighborScanPeriod_t;
/** HostCmd_DS_CMD_ROAMAGENT_CONTROL */
typedef struct {
/** Action */
t_u16 action;
/** enable control */
t_u8 Control;
/** host event control */
t_u8 HostEvent;
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_CONTROL;
/** HostCmd_DS_CMD_ROAMAGENT_BACKOFF */
typedef struct {
/** Action */
t_u16 action;
/** minimum scans */
t_u16 Scans;
/** backoff period */
t_u32 Period;
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_BACKOFF;
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD */
typedef struct {
/** Action */
t_u16 action;
/** Reserved */
t_u16 Reserved;
/** scanPeriod TLV */
MrvlIEtypes_NeighborScanPeriod_t scanPeriod;
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD;
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD_RSP */
typedef struct {
/** Action */
t_u16 action;
/** Reserved */
t_u16 Reserved;
/** TLV buffer */
t_u8 TlvBuffer[1];
/* MrvlIEtypes_NeighborScanPeriod_t scanPeriod[MRVL_ROAM_SCAN_PERIODS];
* MRVL_ROAM_SCAN_PERIODS = 6
*/
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD_RSP;
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST_MAINTENANCE */
typedef struct {
/** Action */
t_u16 action;
/** BSSID */
t_u8 BSSID[ETH_ALEN];
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST_MAINTENANCE;
#endif /* _MLANROAMAGENT_H_ */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,147 @@
/** @file mlanscanagent.h
*
* @brief This files contains mlanconfig scanagent command handling.
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
08/11/2009: initial version
************************************************************************/
#ifndef _MLAN_SCANAGENT_H_
#define _MLAN_SCANAGENT_H_
typedef struct {
/** Action GET or SET */
t_u16 action;
/** scan interval */
t_u16 scan_interval;
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_CONFIG_PROFILE_SCAN;
typedef struct {
t_u32 scan_req_id_out; /**< Scan request id */
t_u32 delay; /**< Delay */
t_u32 chan_group; /**< Channel Group */
t_u16 scan_type; /**< Scan type */
t_u16 reserved; /**< Reserved */
t_u8 tlv_buffer[1]; /**< Rest is TLV buffer */
/* MrvlIEtypes_SsIdParamSet_t
* MrvlIEtypes_Bssid_List_t
* MrvlIEtypes_ConfigScanTiming_t
*/
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_SCAN_EXEC;
typedef struct {
/** Action Set or get */
t_u16 action;
/** Reserved */
t_u16 reserved;
/** Table age limit */
t_u16 table_age_limit;
/** Table hold limit */
t_u16 table_hold_limit;
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_SCAN_TABLE_LIMITS;
typedef struct {
/** Action Set or get */
t_u16 action;
/** TLV buffer starts here */
t_u8 tlv_buffer[1];
/* MrvlIEtypes_ConfigScanTiming_t */
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_CONFIG_TIMING;
typedef struct {
/** HostCmd_DS_ScanagentTableMaintenance_e action */
t_u16 action;
/** Reserved */
t_u16 reserved;
/** Request Id, 0 to disable */
t_u32 scan_request_id;
/** Age, 0 to disable */
t_u32 age;
/** TLV Buffer follows */
t_u8 tlv_buffer[1];
/* MrvlIEtypes_SsIdParamSet_t
* MrvlIEtypes_Bssid_List_t
*/
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_TABLE_MAINTENANCE;
/** ENUM definition: Scanagent Table Maintenance */
typedef enum {
SCAN_TABLE_OP_INVALID = 0,
SCAN_TABLE_OP_LOCK = 1,
SCAN_TABLE_OP_UNLOCK = 2,
SCAN_TABLE_OP_PURGE = 3,
} __ATTRIB_PACK__ HostCmd_DS_ScanagentTableMaintenance_e;
/** MrvlIEtypes_SsIdParamSet_t */
typedef struct _MrvlIEtypes_SsIdParamSet_t {
/** Header */
MrvlIEtypesHeader_t header;
/** SSID */
t_u8 ssid[1];
} __ATTRIB_PACK__ MrvlIEtypes_SsIdParamSet_t;
/** _MrvlIEtypes_Bssid_List_t */
typedef struct _MrvlIEtypes_Bssid_List_t {
/** Header */
MrvlIEtypesHeader_t header;
/** BSSID */
t_u8 bssid[ETH_ALEN];
} __ATTRIB_PACK__ MrvlIEtypes_Bssid_List_t;
typedef struct {
/** Header */
MrvlIEtypesHeader_t header;
t_u32 mode; /**< Mode */
t_u32 dwell; /**< Dwell */
t_u32 max_off; /**< Max. off */
t_u32 min_link; /**< Minimum Link */
t_u32 rsp_timeout; /**< Rsp Timeout */
} __ATTRIB_PACK__ MrvlIEtypes_ConfigScanTiming_t;
/** ENUM definition: ScanAgentScanType */
typedef enum {
CONFIG_SITE_SURVEY = 0,
CONFIG_NEIGHBOR = 1,
CONFIG_PROFILE = 2,
CONFIG_ARBITRARY_CHANNEL = 3,
} __ATTRIB_PACK__ HostCmd_DS_ScanagentScanType_e;
/** ENUM definition: ScanAgentScanTimingMode */
typedef enum {
TIMING_MODE_INVALID = 0,
TIMING_MODE_DISCONNECTED = 1,
TIMING_MODE_ADHOC = 2,
TIMING_MODE_FULL_POWER = 3,
TIMING_MODE_IEEE_PS = 4,
TIMING_MODE_PERIODIC_PS = 5,
} __ATTRIB_PACK__HostCmd_DS_ScanagentTimingMode_e;
#endif /* _MLAN_SCANAGENT_H_ */

59
mapp/mlanevent/Makefile Normal file
View file

@ -0,0 +1,59 @@
# File : mlanevent/Makefile
#
# Copyright 2008-2022 NXP
# Path to the top directory of the wlan distribution
PATH_TO_TOP = ../..
ifeq ($(findstring IMX_ANDROID,$(ccflags-y)),IMX_ANDROID)
CC=/usr/local/arm/android-ndk-r23-beta5/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang
endif
# 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
#ECHO = @
ifeq (,$(findstring ANDROID_KERNEL, $(CFLAGS)))
LIBS=-lrt
endif
.PHONY: default tags all
OBJECTS = mlanevent.o
HEADERS = mlanevent.h
TARGET = mlanevent.exe
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

2673
mapp/mlanevent/mlanevent.c Normal file

File diff suppressed because it is too large Load diff

1397
mapp/mlanevent/mlanevent.h Normal file

File diff suppressed because it is too large Load diff

68
mapp/mlanutl/Makefile Normal file
View file

@ -0,0 +1,68 @@
# File : mlanutl/Makefile
#
# Copyright 2011-2026 NXP
# Path to the top directory of the wlan distribution
PATH_TO_TOP = ../..
ifeq ($(findstring IMX_ANDROID,$(ccflags-y)),IMX_ANDROID)
CC=/usr/local/arm/android-ndk-r23-beta5/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang
endif
# 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
ifneq (,$(findstring gcc,$(shell $(CC) --version)))
CFLAGS += -Wno-stringop-truncation
endif
# Enable or disable debug outputs
CFLAGS += -DDEBUG=0
#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

940
mapp/mlanutl/mlanhostcmd.c Normal file
View file

@ -0,0 +1,940 @@
/** @file mlanhostcmd.c
*
* @brief This file contains mlanutl helper functions
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
11/26/2008: initial version
************************************************************************/
#include "mlanhostcmd.h"
#ifndef MIN
/** Find minimum value */
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif /* MIN */
/********************************************************
Local Variables
********************************************************/
/********************************************************
Global Variables
********************************************************/
/********************************************************
Local Functions
********************************************************/
/**
* @brief get hostcmd data
*
* @param ln A pointer to line number
* @param buf A pointer to hostcmd data
* @param size A pointer to the return size of hostcmd buffer
* @return MLAN_STATUS_SUCCESS
*/
static int mlan_get_hostcmd_data(FILE *fp, int *ln, t_u8 *buf, t_u16 *size)
{
t_s32 errors = 0, i;
t_s8 line[512], *pos, *pos1, *pos2, *pos3;
t_u16 len;
while ((pos = mlan_config_get_line(fp, line, sizeof(line), ln))) {
(*ln)++;
if (strcmp(pos, "}") == 0) {
break;
}
pos1 = strchr(pos, ':');
if (pos1 == NULL) {
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
pos);
errors++;
continue;
}
*pos1++ = '\0';
pos2 = strchr(pos1, '=');
if (pos2 == NULL) {
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
pos);
errors++;
continue;
}
*pos2++ = '\0';
len = a2hex_or_atoi(pos1);
if (len < 1 || len > MRVDRV_SIZE_OF_CMD_BUFFER) {
printf("Line %d: Invalid hostcmd line '%s'\n", *ln,
pos);
errors++;
continue;
}
*size += len;
if (*pos2 == '"') {
pos2++;
pos3 = strchr(pos2, '"');
if (pos3 == NULL) {
printf("Line %d: invalid quotation '%s'\n", *ln,
pos);
errors++;
continue;
}
*pos3 = '\0';
memset(buf, 0, len);
memmove(buf, pos2, MIN(strlen(pos2), len));
buf += len;
} else if (*pos2 == '\'') {
pos2++;
pos3 = strchr(pos2, '\'');
if (pos3 == NULL) {
printf("Line %d: invalid quotation '%s'\n", *ln,
pos);
errors++;
continue;
}
*pos3 = ',';
for (i = 0; i < len; i++) {
pos3 = strchr(pos2, ',');
if (pos3 != NULL) {
*pos3 = '\0';
*buf++ = (t_u8)a2hex_or_atoi(pos2);
pos2 = pos3 + 1;
} else
*buf++ = 0;
}
} else if (*pos2 == '{') {
t_u16 tlvlen = 0, tmp_tlvlen;
mlan_get_hostcmd_data(fp, ln, buf + len, &tlvlen);
tmp_tlvlen = tlvlen;
while (len--) {
*buf++ = (t_u8)(tmp_tlvlen & 0xff);
tmp_tlvlen >>= 8;
}
*size += tlvlen;
buf += tlvlen;
} else {
t_u32 value = a2hex_or_atoi(pos2);
while (len--) {
*buf++ = (t_u8)(value & 0xff);
value >>= 8;
}
}
}
return MLAN_STATUS_SUCCESS;
}
/********************************************************
Global Functions
********************************************************/
/**
* @brief convert char to hex integer
*
* @param chr char to convert
* @return hex integer or 0
*/
int hexval(t_s32 chr)
{
if (chr >= '0' && chr <= '9')
return chr - '0';
if (chr >= 'A' && chr <= 'F')
return chr - 'A' + 10;
if (chr >= 'a' && chr <= 'f')
return chr - 'a' + 10;
return 0;
}
/**
* @brief Hump hex data
*
* @param prompt A pointer prompt buffer
* @param p A pointer to data buffer
* @param len the len of data buffer
* @param delim delim char
* @return hex integer
*/
t_void hexdump(t_s8 *prompt, t_void *p, t_s32 len, t_s8 delim)
{
t_s32 i;
t_u8 *s = p;
if (prompt) {
printf("%s: len=%d\n", prompt, (int)len);
}
for (i = 0; i < len; i++) {
if (i != len - 1)
printf("%02x%c", *s++, delim);
else
printf("%02x\n", *s);
if ((i + 1) % 16 == 0)
printf("\n");
}
printf("\n");
}
/**
* @brief convert char to hex integer
*
* @param chr char
* @return hex integer
*/
t_u8 hexc2bin(t_s8 chr)
{
if (chr >= '0' && chr <= '9')
chr -= '0';
else if (chr >= 'A' && chr <= 'F')
chr -= ('A' - 10);
else if (chr >= 'a' && chr <= 'f')
chr -= ('a' - 10);
return chr;
}
/**
* @brief convert string to hex integer
*
* @param s A pointer string buffer
* @return hex integer
*/
t_u32 a2hex(t_s8 *s)
{
t_u32 val = 0;
if (!strncasecmp("0x", s, 2)) {
s += 2;
}
while (*s && isxdigit((unsigned char)*s)) {
val = (val << 4) + hexc2bin(*s++);
}
return val;
}
/*
* @brief convert String to integer
*
* @param value A pointer to string
* @return integer
*/
t_u32 a2hex_or_atoi(t_s8 *value)
{
if (value[0] == '0' && (value[1] == 'X' || value[1] == 'x')) {
return a2hex(value + 2);
} else if (isdigit((unsigned char)*value)) {
return atoi(value);
} else {
return *value;
}
}
/**
* @brief convert string to hex
*
* @param ptr A pointer to data buffer
* @param chr A pointer to return integer
* @return A pointer to next data field
*/
t_s8 *convert2hex(t_s8 *ptr, t_u8 *chr)
{
t_u8 val;
for (val = 0; *ptr && isxdigit(*ptr); ptr++) {
val = (val * 16) + hexval(*ptr);
}
*chr = val;
return ptr;
}
/**
* @brief Check the Hex String
* @param s A pointer to the string
* @return MLAN_STATUS_SUCCESS --HexString, MLAN_STATUS_FAILURE --not
* HexString
*/
int ishexstring(t_s8 *s)
{
int ret = MLAN_STATUS_FAILURE;
t_s32 tmp;
if (!strncasecmp("0x", s, 2)) {
s += 2;
}
while (*s) {
tmp = toupper(*s);
if (((tmp >= 'A') && (tmp <= 'F')) ||
((tmp >= '0') && (tmp <= '9'))) {
ret = MLAN_STATUS_SUCCESS;
} else {
ret = MLAN_STATUS_FAILURE;
break;
}
s++;
}
return ret;
}
/**
* @brief Convert String to Integer
* @param buf A pointer to the string
* @return Integer
*/
int atoval(t_s8 *buf)
{
if (!strncasecmp(buf, "0x", 2))
return a2hex(buf + 2);
else if (!ishexstring(buf))
return a2hex(buf);
else
return atoi(buf);
}
/**
* @brief Prepare host-command buffer
* @param fp File handler
* @param cmd_name Command name
* @param buf A pointer to comand buffer
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int prepare_host_cmd_buffer(FILE *fp, char *cmd_name, t_u8 *buf)
{
t_s8 line[256], cmdname[256], *pos, cmdcode[10];
HostCmd_DS_GEN *hostcmd;
int ln = 0;
int cmdname_found = 0, cmdcode_found = 0;
memset(buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
hostcmd = (HostCmd_DS_GEN *)buf;
hostcmd->command = 0xffff;
snprintf(cmdname, sizeof(cmdname), "%s={", cmd_name);
cmdname_found = 0;
while ((pos = mlan_config_get_line(fp, line, sizeof(line), &ln))) {
if (strcmp(pos, cmdname) == 0) {
t_u16 len = 0;
cmdname_found = 1;
snprintf(cmdcode, sizeof(cmdcode), "CmdCode=");
cmdcode_found = 0;
while ((pos = mlan_config_get_line(
fp, line, sizeof(line), &ln))) {
if (strncmp(pos, cmdcode, strlen(cmdcode)) ==
0) {
cmdcode_found = 1;
hostcmd->command = a2hex_or_atoi(
pos + strlen(cmdcode));
hostcmd->size = S_DS_GEN;
mlan_get_hostcmd_data(
fp, &ln, buf + hostcmd->size,
&len);
hostcmd->size += len;
break;
}
}
if (!cmdcode_found) {
fprintf(stderr,
"mlanutl: CmdCode not found in conf file\n");
return MLAN_STATUS_FAILURE;
}
break;
}
}
if (!cmdname_found) {
fprintf(stderr,
"mlanutl: cmdname '%s' is not found in conf file\n",
cmd_name);
return MLAN_STATUS_FAILURE;
}
hostcmd->seq_num = 0;
hostcmd->result = 0;
hostcmd->command = cpu_to_le16(hostcmd->command);
hostcmd->size = cpu_to_le16(hostcmd->size);
return MLAN_STATUS_SUCCESS;
}
/** Config data header length */
#define CFG_DATA_HEADER_LEN 6
/**
* @brief Prepare cfg-data buffer
* @param argc number of arguments
* @param argv A pointer to arguments array
* @param fp File handler
* @param buf A pointer to comand buffer
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int prepare_cfg_data_buffer(int argc, char *argv[], FILE *fp, t_u8 *buf)
{
int ln = 0, type;
HostCmd_DS_GEN *hostcmd;
HostCmd_DS_802_11_CFG_DATA *pcfg_data;
memset(buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
hostcmd = (HostCmd_DS_GEN *)buf;
hostcmd->command = cpu_to_le16(HostCmd_CMD_CFG_DATA);
pcfg_data = (HostCmd_DS_802_11_CFG_DATA *)(buf + S_DS_GEN);
pcfg_data->action =
(argc == 4) ? HostCmd_ACT_GEN_GET : HostCmd_ACT_GEN_SET;
type = atoi(argv[3]);
if ((type < 1) || (type > 2)) {
fprintf(stderr, "mlanutl: Invalid register type\n");
return MLAN_STATUS_FAILURE;
} else {
pcfg_data->type = type;
}
if (argc == 5) {
ln = fparse_for_hex(fp, pcfg_data->data);
}
pcfg_data->data_len = ln;
hostcmd->size = cpu_to_le16(pcfg_data->data_len + S_DS_GEN +
CFG_DATA_HEADER_LEN);
pcfg_data->data_len = cpu_to_le16(pcfg_data->data_len);
pcfg_data->type = cpu_to_le16(pcfg_data->type);
pcfg_data->action = cpu_to_le16(pcfg_data->action);
hostcmd->seq_num = 0;
hostcmd->result = 0;
return MLAN_STATUS_SUCCESS;
}
/**
* @brief Process host_cmd response
* @param buf A pointer to the response buffer
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int process_host_cmd_resp(t_u8 *buf)
{
HostCmd_DS_GEN *hostcmd = (HostCmd_DS_GEN *)buf;
int ret = MLAN_STATUS_SUCCESS;
hostcmd->command = le16_to_cpu(hostcmd->command);
hostcmd->size = le16_to_cpu(hostcmd->size);
hostcmd->seq_num = le16_to_cpu(hostcmd->seq_num);
hostcmd->result = le16_to_cpu(hostcmd->result);
hostcmd->command &= ~HostCmd_RET_BIT;
if (!hostcmd->result) {
switch (hostcmd->command) {
case HostCmd_CMD_CFG_DATA: {
HostCmd_DS_802_11_CFG_DATA *pstcfgData =
(HostCmd_DS_802_11_CFG_DATA *)(buf + S_DS_GEN);
pstcfgData->data_len =
le16_to_cpu(pstcfgData->data_len);
pstcfgData->action = le16_to_cpu(pstcfgData->action);
if (pstcfgData->action == HostCmd_ACT_GEN_GET) {
hexdump("cfgdata", pstcfgData->data,
pstcfgData->data_len, ' ');
}
break;
}
case HostCmd_CMD_802_11_TPC_ADAPT_REQ: {
mlan_ioctl_11h_tpc_resp *tpcIoctlResp =
(mlan_ioctl_11h_tpc_resp *)(buf + S_DS_GEN);
if (tpcIoctlResp->status_code == 0) {
printf("tpcrequest: txPower(%d), linkMargin(%d), rssi(%d)\n",
tpcIoctlResp->tx_power,
tpcIoctlResp->link_margin,
tpcIoctlResp->rssi);
} else {
printf("tpcrequest: failure, status = %d\n",
tpcIoctlResp->status_code);
}
break;
}
case HostCmd_CMD_802_11_CRYPTO: {
t_u16 alg = le16_to_cpu(
(t_u16) * (buf + S_DS_GEN + sizeof(t_u16)));
if (alg != CIPHER_TEST_AES_CCM &&
alg != CIPHER_TEST_GCMP) {
HostCmd_DS_802_11_CRYPTO *cmd =
(HostCmd_DS_802_11_CRYPTO *)(buf +
S_DS_GEN);
cmd->encdec = le16_to_cpu(cmd->encdec);
cmd->algorithm = le16_to_cpu(cmd->algorithm);
cmd->key_IV_length =
le16_to_cpu(cmd->key_IV_length);
cmd->key_length = le16_to_cpu(cmd->key_length);
cmd->data.header.type =
le16_to_cpu(cmd->data.header.type);
cmd->data.header.len =
le16_to_cpu(cmd->data.header.len);
printf("crypto_result: encdec=%d algorithm=%d,KeyIVLen=%d,"
" KeyLen=%d,dataLen=%d\n",
cmd->encdec, cmd->algorithm,
cmd->key_IV_length, cmd->key_length,
cmd->data.header.len);
hexdump("KeyIV", cmd->keyIV, cmd->key_IV_length,
' ');
hexdump("Key", cmd->key, cmd->key_length, ' ');
hexdump("Data", cmd->data.data,
cmd->data.header.len, ' ');
} else {
HostCmd_DS_802_11_CRYPTO_AES_CCM *cmd_aes_ccm =
(HostCmd_DS_802_11_CRYPTO_AES_CCM
*)(buf + S_DS_GEN);
cmd_aes_ccm->encdec =
le16_to_cpu(cmd_aes_ccm->encdec);
cmd_aes_ccm->algorithm =
le16_to_cpu(cmd_aes_ccm->algorithm);
cmd_aes_ccm->key_length =
le16_to_cpu(cmd_aes_ccm->key_length);
cmd_aes_ccm->nonce_length =
le16_to_cpu(cmd_aes_ccm->nonce_length);
cmd_aes_ccm->AAD_length =
le16_to_cpu(cmd_aes_ccm->AAD_length);
cmd_aes_ccm->data.header.type = le16_to_cpu(
cmd_aes_ccm->data.header.type);
cmd_aes_ccm->data.header.len = le16_to_cpu(
cmd_aes_ccm->data.header.len);
printf("crypto_result: encdec=%d algorithm=%d, KeyLen=%d,"
" NonceLen=%d,AADLen=%d,dataLen=%d\n",
cmd_aes_ccm->encdec,
cmd_aes_ccm->algorithm,
cmd_aes_ccm->key_length,
cmd_aes_ccm->nonce_length,
cmd_aes_ccm->AAD_length,
cmd_aes_ccm->data.header.len);
hexdump("Key", cmd_aes_ccm->key,
cmd_aes_ccm->key_length, ' ');
hexdump("Nonce", cmd_aes_ccm->nonce,
cmd_aes_ccm->nonce_length, ' ');
hexdump("AAD", cmd_aes_ccm->AAD,
cmd_aes_ccm->AAD_length, ' ');
hexdump("Data", cmd_aes_ccm->data.data,
cmd_aes_ccm->data.header.len, ' ');
}
break;
}
case HostCmd_CMD_802_11_AUTO_TX: {
HostCmd_DS_802_11_AUTO_TX *at =
(HostCmd_DS_802_11_AUTO_TX *)(buf + S_DS_GEN);
if (le16_to_cpu(at->action) == HostCmd_ACT_GEN_GET) {
if (S_DS_GEN + sizeof(at->action) ==
hostcmd->size) {
printf("auto_tx not configured\n");
} else {
MrvlIEtypesHeader_t *header =
&at->auto_tx.header;
header->type =
le16_to_cpu(header->type);
header->len = le16_to_cpu(header->len);
if ((S_DS_GEN + sizeof(at->action) +
sizeof(MrvlIEtypesHeader_t) +
header->len ==
hostcmd->size) &&
(header->type ==
TLV_TYPE_AUTO_TX)) {
AutoTx_MacFrame_t *atmf =
&at->auto_tx
.auto_tx_mac_frame;
printf("Interval: %d second(s)\n",
le16_to_cpu(
atmf->interval));
printf("Priority: %#x\n",
atmf->priority);
printf("Frame Length: %d\n",
le16_to_cpu(
atmf->frame_len));
printf("Dest Mac Address: "
"%02x:%02x:%02x:%02x:%02x:%02x\n",
atmf->dest_mac_addr[0],
atmf->dest_mac_addr[1],
atmf->dest_mac_addr[2],
atmf->dest_mac_addr[3],
atmf->dest_mac_addr[4],
atmf->dest_mac_addr[5]);
printf("Src Mac Address: "
"%02x:%02x:%02x:%02x:%02x:%02x\n",
atmf->src_mac_addr[0],
atmf->src_mac_addr[1],
atmf->src_mac_addr[2],
atmf->src_mac_addr[3],
atmf->src_mac_addr[4],
atmf->src_mac_addr[5]);
hexdump("Frame Payload",
atmf->payload,
le16_to_cpu(
atmf->frame_len) -
MLAN_MAC_ADDR_LENGTH *
2,
' ');
} else {
printf("incorrect auto_tx command response\n");
}
}
}
break;
}
case HostCmd_CMD_802_11_SUBSCRIBE_EVENT: {
HostCmd_DS_802_11_SUBSCRIBE_EVENT *se =
(HostCmd_DS_802_11_SUBSCRIBE_EVENT *)(buf +
S_DS_GEN);
if (le16_to_cpu(se->action) == HostCmd_ACT_GEN_GET) {
int len =
S_DS_GEN +
sizeof(HostCmd_DS_802_11_SUBSCRIBE_EVENT);
printf("\nEvent\t\tValue\tFreq\tsubscribed\n\n");
while (len < hostcmd->size) {
MrvlIEtypesHeader_t *header =
(MrvlIEtypesHeader_t *)(buf +
len);
switch (le16_to_cpu(header->type)) {
case TLV_TYPE_RSSI_LOW: {
MrvlIEtypes_RssiThreshold_t *low_rssi =
(MrvlIEtypes_RssiThreshold_t
*)(buf + len);
printf("Beacon Low RSSI\t%d\t%d\t%s\n",
low_rssi->RSSI_value,
low_rssi->RSSI_freq,
(le16_to_cpu(se->events) &
0x0001) ?
"yes" :
"no");
break;
}
case TLV_TYPE_SNR_LOW: {
MrvlIEtypes_SnrThreshold_t *low_snr =
(MrvlIEtypes_SnrThreshold_t
*)(buf + len);
printf("Beacon Low SNR\t%d\t%d\t%s\n",
low_snr->SNR_value,
low_snr->SNR_freq,
(le16_to_cpu(se->events) &
0x0002) ?
"yes" :
"no");
break;
}
case TLV_TYPE_FAILCOUNT: {
MrvlIEtypes_FailureCount_t
*failure_count =
(MrvlIEtypes_FailureCount_t
*)(buf +
len);
printf("Failure Count\t%d\t%d\t%s\n",
failure_count->fail_value,
failure_count->fail_freq,
(le16_to_cpu(se->events) &
0x0004) ?
"yes" :
"no");
break;
}
case TLV_TYPE_BCNMISS: {
MrvlIEtypes_BeaconsMissed_t
*bcn_missed =
(MrvlIEtypes_BeaconsMissed_t
*)(buf +
len);
printf("Beacon Missed\t%d\tN/A\t%s\n",
bcn_missed->beacon_missed,
(le16_to_cpu(se->events) &
0x0008) ?
"yes" :
"no");
break;
}
case TLV_TYPE_RSSI_HIGH: {
MrvlIEtypes_RssiThreshold_t
*high_rssi =
(MrvlIEtypes_RssiThreshold_t
*)(buf +
len);
printf("Bcn High RSSI\t%d\t%d\t%s\n",
high_rssi->RSSI_value,
high_rssi->RSSI_freq,
(le16_to_cpu(se->events) &
0x0010) ?
"yes" :
"no");
break;
}
case TLV_TYPE_SNR_HIGH: {
MrvlIEtypes_SnrThreshold_t *high_snr =
(MrvlIEtypes_SnrThreshold_t
*)(buf + len);
printf("Beacon High SNR\t%d\t%d\t%s\n",
high_snr->SNR_value,
high_snr->SNR_freq,
(le16_to_cpu(se->events) &
0x0020) ?
"yes" :
"no");
break;
}
case TLV_TYPE_RSSI_LOW_DATA: {
MrvlIEtypes_RssiThreshold_t *low_rssi =
(MrvlIEtypes_RssiThreshold_t
*)(buf + len);
printf("Data Low RSSI\t%d\t%d\t%s\n",
low_rssi->RSSI_value,
low_rssi->RSSI_freq,
(le16_to_cpu(se->events) &
0x0040) ?
"yes" :
"no");
break;
}
case TLV_TYPE_SNR_LOW_DATA: {
MrvlIEtypes_SnrThreshold_t *low_snr =
(MrvlIEtypes_SnrThreshold_t
*)(buf + len);
printf("Data Low SNR\t%d\t%d\t%s\n",
low_snr->SNR_value,
low_snr->SNR_freq,
(le16_to_cpu(se->events) &
0x0080) ?
"yes" :
"no");
break;
}
case TLV_TYPE_RSSI_HIGH_DATA: {
MrvlIEtypes_RssiThreshold_t
*high_rssi =
(MrvlIEtypes_RssiThreshold_t
*)(buf +
len);
printf("Data High RSSI\t%d\t%d\t%s\n",
high_rssi->RSSI_value,
high_rssi->RSSI_freq,
(le16_to_cpu(se->events) &
0x0100) ?
"yes" :
"no");
break;
}
case TLV_TYPE_SNR_HIGH_DATA: {
MrvlIEtypes_SnrThreshold_t *high_snr =
(MrvlIEtypes_SnrThreshold_t
*)(buf + len);
printf("Data High SNR\t%d\t%d\t%s\n",
high_snr->SNR_value,
high_snr->SNR_freq,
(le16_to_cpu(se->events) &
0x0200) ?
"yes" :
"no");
break;
}
case TLV_TYPE_LINK_QUALITY: {
MrvlIEtypes_LinkQuality_t *link_qual =
(MrvlIEtypes_LinkQuality_t
*)(buf + len);
printf("Link Quality Parameters:\n");
printf("------------------------\n");
printf("Link Quality Event Subscribed\t%s\n",
(le16_to_cpu(se->events) &
0x0400) ?
"yes" :
"no");
printf("Link SNR Threshold = %d\n",
le16_to_cpu(
link_qual
->link_SNR_thrs));
printf("Link SNR Frequency = %d\n",
le16_to_cpu(
link_qual
->link_SNR_freq));
printf("Min Rate Value = %d\n",
le16_to_cpu(
link_qual
->min_rate_val));
printf("Min Rate Frequency = %d\n",
le16_to_cpu(
link_qual
->min_rate_freq));
printf("Tx Latency Value = %d\n",
le32_to_cpu(
link_qual
->tx_latency_val));
printf("Tx Latency Threshold = %d\n",
le32_to_cpu(
link_qual
->tx_latency_thrs));
break;
}
case TLV_TYPE_PRE_BEACON_LOST: {
MrvlIEtypes_PreBeaconLost_t
*pre_bcn_lost =
(MrvlIEtypes_PreBeaconLost_t
*)(buf +
len);
printf("------------------------\n");
printf("Pre-Beacon Lost Event Subscribed\t%s\n",
(le16_to_cpu(se->events) &
0x0800) ?
"yes" :
"no");
printf("Pre-Beacon Lost: %d\n",
pre_bcn_lost
->pre_beacon_lost);
break;
}
default:
printf("Unknown subscribed event TLV Type=%#x,"
" Len=%d\n",
le16_to_cpu(
header->type),
le16_to_cpu(
header->len));
break;
}
len += (sizeof(MrvlIEtypesHeader_t) +
le16_to_cpu(header->len));
}
}
break;
}
case HostCmd_CMD_MAC_REG_ACCESS:
case HostCmd_CMD_BBP_REG_ACCESS:
case HostCmd_CMD_RF_REG_ACCESS:
case HostCmd_CMD_CAU_REG_ACCESS: {
HostCmd_DS_REG *preg =
(HostCmd_DS_REG *)(buf + S_DS_GEN);
preg->action = le16_to_cpu(preg->action);
if (preg->action == HostCmd_ACT_GEN_GET) {
preg->value = le32_to_cpu(preg->value);
printf("value = 0x%08x\n", preg->value);
}
break;
}
case HostCmd_CMD_MEM_ACCESS: {
HostCmd_DS_MEM *pmem =
(HostCmd_DS_MEM *)(buf + S_DS_GEN);
pmem->action = le16_to_cpu(pmem->action);
if (pmem->action == HostCmd_ACT_GEN_GET) {
pmem->value = le32_to_cpu(pmem->value);
printf("value = 0x%08x\n", pmem->value);
}
break;
}
default:
printf("HOSTCMD_RESP: CmdCode=%#04x, Size=%#04x,"
" SeqNum=%#04x, Result=%#04x\n",
hostcmd->command, hostcmd->size,
hostcmd->seq_num, hostcmd->result);
hexdump("payload", (t_void *)(buf + S_DS_GEN),
hostcmd->size - S_DS_GEN, ' ');
break;
}
} else {
printf("HOSTCMD failed: CmdCode=%#04x, Size=%#04x,"
" SeqNum=%#04x, Result=%#04x\n",
hostcmd->command, hostcmd->size, hostcmd->seq_num,
hostcmd->result);
}
return ret;
}
/**
* @brief Prepare ARP filter buffer
* @param fp File handler
* @param buf A pointer to the buffer
* @param length A pointer to the length of buffer
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int prepare_arp_filter_buffer(FILE *fp, t_u8 *buf, t_u16 *length)
{
t_s8 line[256], *pos;
int ln = 0;
int ret = MLAN_STATUS_SUCCESS;
int arpfilter_found = 0;
memset(buf, 0, MRVDRV_SIZE_OF_CMD_BUFFER);
while ((pos = mlan_config_get_line(fp, line, sizeof(line), &ln))) {
if (strcmp(pos, "arpfilter={") == 0) {
arpfilter_found = 1;
mlan_get_hostcmd_data(fp, &ln, buf, length);
break;
}
}
if (!arpfilter_found) {
fprintf(stderr, "mlanutl: 'arpfilter' not found in conf file");
ret = MLAN_STATUS_FAILURE;
}
return ret;
}
/**
* @brief Prepare the hostcmd for register access
* @param type Register type
* @param offset Register offset
* @param value Pointer to value (NULL for read)
* @param buf Pointer to hostcmd buffer
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int prepare_hostcmd_regrdwr(t_u32 type, t_u32 offset, t_u32 *value, t_u8 *buf)
{
HostCmd_DS_GEN *hostcmd;
HostCmd_DS_REG *preg;
hostcmd = (HostCmd_DS_GEN *)buf;
switch (type) {
case 1:
hostcmd->command = cpu_to_le16(HostCmd_CMD_MAC_REG_ACCESS);
break;
case 2:
hostcmd->command = cpu_to_le16(HostCmd_CMD_BBP_REG_ACCESS);
break;
case 3:
hostcmd->command = cpu_to_le16(HostCmd_CMD_RF_REG_ACCESS);
break;
case 5:
hostcmd->command = cpu_to_le16(HostCmd_CMD_CAU_REG_ACCESS);
break;
default:
printf("Invalid register set specified\n");
return -EINVAL;
}
preg = (HostCmd_DS_REG *)(buf + S_DS_GEN);
preg->action = (value) ? HostCmd_ACT_GEN_SET : HostCmd_ACT_GEN_GET;
preg->action = cpu_to_le16(preg->action);
preg->offset = cpu_to_le16((t_u16)offset);
if (value)
preg->value = cpu_to_le32(*value);
else
preg->value = 0;
hostcmd->size = cpu_to_le16(S_DS_GEN + sizeof(HostCmd_DS_REG));
hostcmd->seq_num = 0;
hostcmd->result = 0;
return MLAN_STATUS_SUCCESS;
}

134
mapp/mlanutl/mlanhostcmd.h Normal file
View file

@ -0,0 +1,134 @@
/** @file mlanhostcmd.h
*
* @brief This file contains command structures for mlanutl application
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
11/26/2008: initial version
************************************************************************/
#ifndef _MLANHOSTCMD_H_
#define _MLANHOSTCMD_H_
/** Find number of elements */
#define NELEMENTS(x) (sizeof(x) / sizeof(x[0]))
/** Size of command buffer */
#define MRVDRV_SIZE_OF_CMD_BUFFER (3 * 1024)
/** Host Command ID : Memory access */
#define HostCmd_CMD_MEM_ACCESS 0x0086
/** Pre-Authenticate - 11r only */
#define HostCmd_CMD_802_11_AUTHENTICATE 0x0011
/** Read/Write Mac register */
#define HostCmd_CMD_MAC_REG_ACCESS 0x0019
/** Read/Write BBP register */
#define HostCmd_CMD_BBP_REG_ACCESS 0x001a
/** Read/Write RF register */
#define HostCmd_CMD_RF_REG_ACCESS 0x001b
/** Get TX Power data */
#define HostCmd_CMD_802_11_RF_TX_POWER 0x001e
/** Host Command ID : CAU register access */
#define HostCmd_CMD_CAU_REG_ACCESS 0x00ed
/** Host Command ID : 802.11 BG scan configuration */
#define HostCmd_CMD_802_11_BG_SCAN_CONFIG 0x006b
/** Host Command ID : Configuration data */
#define HostCmd_CMD_CFG_DATA 0x008f
/** Host Command ID : 802.11 TPC adapt req */
#define HostCmd_CMD_802_11_TPC_ADAPT_REQ 0x0060
/** Host Command ID : 802.11 crypto */
#define HostCmd_CMD_802_11_CRYPTO 0x0078
/** Host Command ID : 802.11 auto Tx */
#define HostCmd_CMD_802_11_AUTO_TX 0x0082
/** Host Command ID : 802.11 subscribe event */
#define HostCmd_CMD_802_11_SUBSCRIBE_EVENT 0x0075
#ifdef OPCHAN
/** Host Command ID : Operating channel config */
#define HostCmd_CMD_OPCHAN_CONFIG 0x00f8
/** Host Command ID : Opchan channel group config */
#define HostCmd_CMD_OPCHAN_CHANGROUP_CONFIG 0x00f9
#endif
/** Host Command ID : Channel TRPC config */
#define HostCmd_CMD_CHAN_TRPC_CONFIG 0x00fb
/** TLV type ID definition */
#define PROPRIETARY_TLV_BASE_ID 0x0100
/** TLV type : Beacon RSSI low */
#define TLV_TYPE_RSSI_LOW (PROPRIETARY_TLV_BASE_ID + 0x04) /* 0x0104 */
/** TLV type : Beacon SNR low */
#define TLV_TYPE_SNR_LOW (PROPRIETARY_TLV_BASE_ID + 0x05) /* 0x0105 */
/** TLV type : Fail count */
#define TLV_TYPE_FAILCOUNT (PROPRIETARY_TLV_BASE_ID + 0x06) /* 0x0106 */
/** TLV type : BCN miss */
#define TLV_TYPE_BCNMISS (PROPRIETARY_TLV_BASE_ID + 0x07) /* 0x0107 */
/** TLV type : Beacon RSSI high */
#define TLV_TYPE_RSSI_HIGH (PROPRIETARY_TLV_BASE_ID + 0x16) /* 0x0116 */
/** TLV type : Beacon SNR high */
#define TLV_TYPE_SNR_HIGH (PROPRIETARY_TLV_BASE_ID + 0x17) /* 0x0117 */
/** TLV type : Auto Tx */
#define TLV_TYPE_AUTO_TX (PROPRIETARY_TLV_BASE_ID + 0x18) /* 0x0118 */
/** TLV type :Link Quality */
#define TLV_TYPE_LINK_QUALITY (PROPRIETARY_TLV_BASE_ID + 0x24) /* 0x0124 */
/** TLV type : Data RSSI low */
#define TLV_TYPE_RSSI_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 0x26) /* 0x0126 */
/** TLV type : Data SNR low */
#define TLV_TYPE_SNR_LOW_DATA (PROPRIETARY_TLV_BASE_ID + 0x27) /* 0x0127 */
/** TLV type : Data RSSI high */
#define TLV_TYPE_RSSI_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 0x28) /* 0x0128 */
/** TLV type : Data SNR high */
#define TLV_TYPE_SNR_HIGH_DATA (PROPRIETARY_TLV_BASE_ID + 0x29) /* 0x0129 */
/** TLV type: Pre-Beacon Lost */
#define TLV_TYPE_PRE_BEACON_LOST (PROPRIETARY_TLV_BASE_ID + 0x49) /* 0x0149 */
#ifdef OPCHAN
/** TLV type : Operating channel control description */
#define TLV_TYPE_OPCHAN_CONTROL_DESC \
(PROPRIETARY_TLV_BASE_ID + 0x79) /* 0x0179 */
/** TLV type : Operating channel group control */
#define TLV_TYPE_OPCHAN_CHANGRP_CTRL \
(PROPRIETARY_TLV_BASE_ID + 0x7a) /* 0x017a */
#endif
/** TLV type : Channel TRPC */
#define TLV_TYPE_CHAN_TRPC (PROPRIETARY_TLV_BASE_ID + 0x89) /* 0x0189 */
/** mlan_ioctl_11h_tpc_resp */
typedef struct {
int status_code; /**< Firmware command result status code */
int tx_power; /**< Reported TX Power from the TPC Report */
int link_margin; /**< Reported Link margin from the TPC Report */
int rssi; /**< RSSI of the received TPC Report frame */
} __ATTRIB_PACK__ mlan_ioctl_11h_tpc_resp;
/* Define general hostcmd data structure */
/** Convert String to integer */
t_u32 a2hex_or_atoi(char *value);
char *mlan_config_get_line(FILE *fp, char *str, t_s32 size, int *lineno);
int prepare_host_cmd_buffer(FILE *fp, char *cmd_name, t_u8 *buf);
int prepare_hostcmd_regrdwr(t_u32 type, t_u32 offset, t_u32 *value, t_u8 *buf);
#endif /* _MLANHOSTCMD_H_ */

3024
mapp/mlanutl/mlanoffload.c Normal file

File diff suppressed because it is too large Load diff

505
mapp/mlanutl/mlanoffload.h Normal file
View file

@ -0,0 +1,505 @@
/** @file mlanoffload.h
*
* @brief This files contains mlanutl offload command handling.
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
08/11/2009: initial version
************************************************************************/
#ifndef _MLANOFFLOAD_H_
#define _MLANOFFLOAD_H_
#ifndef MAX
/** Find maximum value */
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif /* MAX */
/** Key length */
#define KEY_LEN 32
/** Phrase length */
#define PHRASE_LEN 32
/** WEP Key count */
#define WEP_KEY_CNT 4
/* Bitmap for OFFLoad Enable - Feature*/
#ifdef BIG_ENDIAN_SUPPORT
/** Roaming Feature */
#define PROFILE_DB_FEATURE_ROAMING 0x8000
/** CCX Feature */
#define PROFILE_DB_FEATURE_CCX 0x4000
/** UNUSED Feature */
#define PROFILE_DB_FEATURE_UNUSED 0x2000
/** adhoc/infra mode */
#define PROFILE_DB_FEATURE_MODE 0x1000
#else
/** Roaming Feature */
#define PROFILE_DB_FEATURE_ROAMING 0x0001
/** CCX Feature */
#define PROFILE_DB_FEATURE_CCX 0x0002
/** UNUSED Feature */
#define PROFILE_DB_FEATURE_UNUSED 0x0004
/** adhoc/infra mode */
#define PROFILE_DB_FEATURE_MODE 0x0008
#endif
/* Bitmap for profile AKMP Support */
#ifdef BIG_ENDIAN_SUPPORT
/** Key Management EAP */
#define PROFILE_DB_KEY_MGMT_IEEE8021X 0x8000
/** Key Management PSK */
#define PROFILE_DB_KEY_MGMT_PSK 0x4000
/** Key Management NONE */
#define PROFILE_DB_KEY_MGMT_NONE 0x2000
/** Key Management CCKM */
#define PROFILE_DB_KEY_MGMT_CCKM 0x1000
/** Key Management UNUSED */
#define PROFILE_DB_KEY_MGMT_UNUSED 0x0800
/** Key Management FT 802.1x */
#define PROFILE_DB_KEY_MGMT_FT_IEEE8021X 0x0400
/** Key Management FT PSK */
#define PROFILE_DB_KEY_MGMT_FT_PSK 0x0200
/** Key Management SHA256 802.1x */
#define PROFILE_DB_KEY_MGMT_SHA256_IEEE8021X 0x0100
/** Key Management SHA256 PSK*/
#define PROFILE_DB_KEY_MGMT_SHA256_PSK 0x0080
#else
/** Key Management EAP */
#define PROFILE_DB_KEY_MGMT_IEEE8021X 0x0001
/** Key Management PSK */
#define PROFILE_DB_KEY_MGMT_PSK 0x0002
/** Key Management NONE */
#define PROFILE_DB_KEY_MGMT_NONE 0x0004
/** Key Management CCKM */
#define PROFILE_DB_KEY_MGMT_CCKM 0x0008
/** Key Management UNUSED */
#define PROFILE_DB_KEY_MGMT_UNUSED 0x0010
/** Key Management FT 802.1x */
#define PROFILE_DB_KEY_MGMT_FT_IEEE8021X 0x0020
/** Key Management FT PSK */
#define PROFILE_DB_KEY_MGMT_FT_PSK 0x0040
/** Key Management SHA256 802.1x */
#define PROFILE_DB_KEY_MGMT_SHA256_IEEE8021X 0x0080
/** Key Management SHA256 PSK*/
#define PROFILE_DB_KEY_MGMT_SHA256_PSK 0x0100
#endif
/* Bitmap for profile Encryption protocol support */
#ifdef BIG_ENDIAN_SUPPORT
/** Encryption protocol noRsn */
#define PROFILE_DB_PROTO_NO_RSN 0x8000
/** Encryption protocol static wep */
#define PROFILE_DB_PROTO_WEP_STATIC 0x4000
/** Encryption protocol dynamic wep */
#define PROFILE_DB_PROTO_WEP_DYNAMIC 0x2000
/** Encryption protocol WPA */
#define PROFILE_DB_PROTO_WPA 0x1000
/** Encryption protocol WPA-none
* Ad-hoc Networks */
#define PROFILE_DB_PROTO_WPA_NONE 0x0800
/** Encryption protocol WPA2 */
#define PROFILE_DB_PROTO_WPA2 0x0400
/** Encryption protocol CCKM */
#define PROFILE_DB_PROTO_CCKM 0x0200
#else
/** Encryption protocol noRsn */
#define PROFILE_DB_PROTO_NO_RSN 0x0001
/** Encryption protocol static wep */
#define PROFILE_DB_PROTO_WEP_STATIC 0x0002
/** Encryption protocol dynamic wep */
#define PROFILE_DB_PROTO_WEP_DYNAMIC 0x0004
/** Encryption protocol WPA */
#define PROFILE_DB_PROTO_WPA 0x0008
/** Encryption protocol WPA-none
* Ad-hoc Networks */
#define PROFILE_DB_PROTO_WPA_NONE 0x0010
/** Encryption protocol WPA2 */
#define PROFILE_DB_PROTO_WPA2 0x0020
/** Encryption protocol CCKM */
#define PROFILE_DB_PROTO_CCKM 0x0040
#endif
#ifdef BIG_ENDIAN_SUPPORT
/** Cipher wep40 */
#define PROFILE_DB_CIPHER_WEP40 0x80
/** Cipher wep104 */
#define PROFILE_DB_CIPHER_WEP104 0x40
/** Cipher tkip */
#define PROFILE_DB_CIPHER_TKIP 0x20
/** Cipher ccmp */
#define PROFILE_DB_CIPHER_CCMP 0x10
#else
/** Cipher wep40 */
#define PROFILE_DB_CIPHER_WEP40 0x01
/** Cipher wep104 */
#define PROFILE_DB_CIPHER_WEP104 0x02
/** Cipher tkip */
#define PROFILE_DB_CIPHER_TKIP 0x04
/** Cipher ccmp */
#define PROFILE_DB_CIPHER_CCMP 0x08
#endif
typedef struct {
/** Header */
MrvlIEtypesHeader_t header;
t_u32 mode; /**< Mode */
t_u32 max_off_channel; /**< Maximum off-channel measurement duration
(ms) */
t_u32 max_on_channel; /**< Maximum on-channel measurement duration (ms)
*/
} __ATTRIB_PACK__ MrvlIETypes_MeasTiming_t;
typedef struct {
/** Action Set or get */
t_u16 action;
/** TLV buffer starts here */
t_u8 tlv_buffer[1];
/*
* MrvlIETypes_MeasTiming_t
*/
} __ATTRIB_PACK__ HostCmd_DS_MEASUREMENT_Timing;
/** helper structure for profile parsing */
typedef struct {
/** SSID name string */
t_u8 ssid[IW_ESSID_MAX_SIZE + 1];
/** SSID len */
t_u32 ssid_len;
/** BSSID network name */
t_u8 bssid[ETH_ALEN];
/** passphrase configured */
t_s8 passphrase[PHRASE_LEN];
/** passphrase length */
t_u32 passphrase_len;
/** Pre-shared key config flag */
int psk_config;
/** Pre-shared key */
t_u8 psk[KEY_LEN];
/** wep keys */
t_u8 wep_key[WEP_KEY_CNT][KEY_LEN];
/** wep keys lengths */
t_u8 wep_key_len[WEP_KEY_CNT];
/** wep key index */
int wep_key_idx;
/** protocol fields */
t_u16 protocol;
/** pairwise Cipher values */
t_u8 pairwise_cipher;
/** Group Cipher values */
t_u8 groupwise_cipher;
/** key management */
t_u16 key_mgmt;
/** offload specific parameter(roaming) */
t_u16 roaming;
/** offload specific parameter */
t_u16 reserved;
/** offload specific parameter--ccx */
t_u16 ccx;
/** offload specific parameter--mode */
t_u16 mode;
} profile_entry_t;
typedef struct {
#ifdef BIG_ENDIAN_SUPPORT
/** Reserved */
t_u8 Reserved : 3;
/** Channel not measured */
t_u8 Unmeasured : 1;
/** Radar detected */
t_u8 Radar : 1;
/** Unidentified signal received */
t_u8 Unidentified : 1;
/** OFDM Preamble received */
t_u8 OFDM_Preamble : 1;
/** BSS found */
t_u8 BSS : 1;
#else
/** BSS found */
t_u8 BSS : 1;
/** OFDM Preamble received */
t_u8 OFDM_Preamble : 1;
/** Unidentified signal received */
t_u8 Unidentified : 1;
/** Radar detected */
t_u8 Radar : 1;
/** Channel not measured */
t_u8 Unmeasured : 1;
/** Reserved */
t_u8 Reserved : 3;
#endif
} __ATTRIB_PACK__ IEEEtypes_DFS_Map_t;
typedef struct {
MrvlIEtypesHeader_t Header; /**< Header */
t_u8 scanReqId; /**< Scan request id assigned in table */
} __ATTRIB_PACK__ MrvlIEtypes_ChanRptBcn_t;
typedef struct {
MrvlIEtypesHeader_t Header; /**< Header */
IEEEtypes_DFS_Map_t map; /**< IEEE 802.11h basic meas report */
} __ATTRIB_PACK__ MrvlIEtypes_ChanRpt11hBasic_t;
typedef struct {
MrvlIEtypesHeader_t Header; /**< Header */
t_u8 sourceAddr[ETH_ALEN]; /**< Source MAC */
t_u8 bssid[ETH_ALEN]; /**< BSSID MAC */
t_s16 rssi; /**< Avg RSSI of frames */
t_u16 frameCnt; /**< # of frames */
} __ATTRIB_PACK__ MrvlIEtypes_ChanRptFrame_t;
#ifdef OPCHAN
typedef struct {
MrvlIEtypesHeader_t header; /**< Header */
MrvlChannelDesc_t chanDesc;
t_u16 controlFlags;
t_u16 reserved;
t_u8 actPower;
t_u8 mdMinPower;
t_u8 mdMaxPower;
t_u8 mdPower;
} __ATTRIB_PACK__ MrvlIEtypes_ChanControlDesc_t;
typedef struct {
#ifdef BIG_ENDIAN
/** Reserved */
t_u8 reserved_4_7 : 4;
/** Disble channel filtering flag */
t_u8 disable_chan_filt : 1;
/** Channel scan mode passive flag */
t_u8 passive_scan : 1;
/** Multidomain scan mode */
t_u8 multidomain_scan : 1;
/** Enable probe response timeout */
t_u8 rsp_timeout_en : 1;
#else
/** Enable probe response timeout */
t_u8 rsp_timeout_en : 1;
/** Multidomain scan mode */
t_u8 multidomain_scan : 1;
/** Channel scan mode passive flag */
t_u8 passive_scan : 1;
/** Disble channel filtering flag */
t_u8 disable_chan_filt : 1;
/** Reserved */
t_u8 reserved_4_7 : 4;
#endif
} __ATTRIB_PACK__ ChanScanMode_t;
typedef struct {
MrvlIEtypesHeader_t header; /**< Header */
t_u32 chanGroupBitmap;
ChanScanMode_t scanMode;
t_u8 numChan;
MrvlChannelDesc_t chanDesc[50];
} __ATTRIB_PACK__ MrvlIEtypes_ChanGroupControl_t;
typedef struct {
t_u16 action; /**< CMD Action Get/Set*/
t_u8 tlv_buffer[1];
} __ATTRIB_PACK__ HostCmd_DS_OPCHAN_CONFIG;
typedef struct {
t_u16 action; /**< CMD Action Get/Set*/
t_u8 tlv_buffer[1];
} __ATTRIB_PACK__ HostCmd_DS_OPCHAN_CHANGROUP_CONFIG;
#endif
typedef struct {
t_u8 modGroup;
t_u8 txPower;
} __ATTRIB_PACK__ MrvlChanTrpcEntry_t;
typedef struct {
MrvlIEtypesHeader_t header; /**< Header */
MrvlChannelDesc_t chanDesc;
MrvlChanTrpcEntry_t chanTrpcEntry[1];
} __ATTRIB_PACK__ MrvlIEtypes_ChanTrpcCfg_t;
typedef struct {
t_u16 action; /**< CMD Action Get/Set*/
t_u16 reserved;
t_u8 tlv_buffer[1]; /** MrvlIEtypes_ChanTrpcCfg_t TLVs */
} __ATTRIB_PACK__ HostCmd_DS_CHAN_TRPC_CONFIG;
typedef struct {
t_u8 controlSelect;
t_u8 controlBitmap[1]; /* Variable length # of byte bitmaps */
} __ATTRIB_PACK__ HostCmd_DS_OFFLOAD_FEATURE_CONTROL;
#define IAPP_DATA_MAX 1000
/**
* @brief Enumeration for the command result from an IAPP Proxy command
*/
typedef enum {
IAPP_PROXY_RESULT_SUCCESS = 0,
IAPP_PROXY_RESULT_EXEC_FAILURE = 1,
IAPP_PROXY_RESULT_TIMEOUT = 2,
IAPP_PROXY_RESULT_DATA_INVALID = 3,
} __ATTRIB_PACK__ mlan_iapp_proxy_result_e;
typedef struct {
mlan_iapp_proxy_result_e commandResult; /**< Firmware execution result
*/
t_u32 timeout_ms; /**< Timeout value in milliseconds */
t_u8 iappType;
t_u8 iappSubType;
t_u32 iappDataLen;
t_u8 iappData[IAPP_DATA_MAX];
} __ATTRIB_PACK__ HostCmd_DS_IAPP_PROXY;
typedef struct {
/** Action: GET/SET */
t_u16 Action;
/** Reserved */
t_u16 Reserved;
/** Association timeout */
t_u32 AssocTimeout;
/** Reassociation timeout */
t_u32 ReassocTimeout;
/** Hand shake timeout */
t_u32 HandShakeTimeout;
/** Frame exchange timeout */
t_u32 FrameExchangeTimeout;
/** Deauth of old AP in millisec; 0 to disable */
t_u32 PriorApDeauthDelay;
/** Maximum time after a disconnect where a reassoc frame will be sent
*/
t_u32 ReassocDiscMax;
} __ATTRIB_PACK__ HostCmd_DS_AssociationTiming_t;
/** 16 bit unsigned integer */
typedef t_u16 IEEEtypes_AId_t;
/** 16 bit unsigned integer */
typedef t_u16 IEEEtypes_StatusCode_t;
typedef struct {
/** Capability information */
IEEEtypes_CapInfo_t Capability;
/** Association response status code */
IEEEtypes_StatusCode_t StatusCode;
/** Association ID */
IEEEtypes_AId_t AId;
/** IE data buffer */
t_u8 IEBuffer[1];
} __ATTRIB_PACK__ IEEEtypes_AssocRsp_t;
/** Maximum number of AC QOS queues available in the driver/firmware */
#define MAX_AC_QUEUES 4
/** timing select structure */
typedef struct {
char *str; /**< Timing mode string */
int match_len; /**< match length */
t_u8 sel; /**< flag */
} timing_sel_t;
/** ENUM definition: reg_chan_table */
typedef enum {
REGTABLE_DEFAULT = 0,
REGTABLE_ESS = 1,
REGTABLE_USER = 2,
REGTABLE_MULTIDOMAIN = 3,
REGTABLE_MAX = 0xFFFF,
} reg_chan_table_e;
/** Sub-command callback */
typedef int (*sub_cmd_callback_t)(int argc, char *argv[]);
/** Sub-command execution data */
typedef struct {
char *str; /**< Command string */
int match_len; /**< Length */
int display; /**< display as valid cmd */
sub_cmd_callback_t callback; /**< Sub-command callback */
} sub_cmd_exec_t;
/** HostCmd_CMD_802_11_RF_TX_POWER */
typedef struct {
t_u16 action;
t_s16 current_level;
t_s8 max_power;
t_s8 min_power;
} __ATTRIB_PACK__ HostCmd_DS_802_11_RF_TX_POWER;
/** HostCmd_CMD_802_11_AUTHENTICATE */
typedef struct {
/** MAC address */
t_u8 MacAddr[ETH_ALEN];
/** Authentication type */
t_u8 AuthType;
} __ATTRIB_PACK__ HostCmd_DS_802_11_AUTHENTICATE;
boolean reg_class_table_select(char *tableStr, reg_chan_table_e *pTable);
int process_sub_cmd(sub_cmd_exec_t *sub_cmd, int num_sub_cmds, int argc,
char *argv[]);
int process_regclass(int argc, char *argv[]);
int process_scanagent(int argc, char *argv[]);
int process_measurement(int argc, char *argv[]);
int process_profile_entry(int argc, char *argv[]);
int process_get_ra_config(int argc, char *argv[]);
int process_set_ra_config(int argc, char *argv[]);
int process_chanrpt(int argc, char *argv[]);
int process_assoc_timing(int argc, char *argv[]);
int process_get_assocrsp(int argc, char *argv[]);
int process_link_stats(int argc, char *argv[]);
int process_opchan(int argc, char *argv[]);
int process_changroup(int argc, char *argv[]);
int process_fcontrol(int argc, char *argv[]);
int process_iapp(int argc, char *argv[]);
int process_rf_tx_power(int argc, char *argv[]);
int process_authenticate(int argc, char *argv[]);
int process_txpowdisp(int argc, char *argv[]);
#endif /* _MLANOFFLOAD_H_ */

534
mapp/mlanutl/mlanregclass.c Normal file
View file

@ -0,0 +1,534 @@
/** @file mlanregclass.c
*
* @brief This files contains mlanutl regclass command handling.
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
08/11/2009: initial version
************************************************************************/
#include "mlanutl.h"
#include "mlanhostcmd.h"
#include "mlanoffload.h"
#include "mlanregclass.h"
/********************************************************
Local Variables
********************************************************/
/********************************************************
Global Variables
********************************************************/
/********************************************************
Local Functions
********************************************************/
/**
* @brief Convert reg domain number to string
*
* @param reg_domain Reg Domain
*
* @return Reg Domain type
*/
static char *reg_domain_to_str(reg_domain_e reg_domain)
{
switch (reg_domain) {
case REGDOMAIN_FCC:
return "FCC";
case REGDOMAIN_ETSI:
return "ETSI";
case REGDOMAIN_MIC:
return "MIC";
case REGDOMAIN_OTHER:
return "MULTI";
default:
break;
}
return "UNKN";
}
/**
* @brief Convert reg channel table number to string
*
* @param table_select Reg channel table
*
* @return Reg channel table type
*/
static char *table_num_to_str(reg_chan_table_e table_select)
{
switch (table_select) {
case REGTABLE_USER:
return "User";
case REGTABLE_MULTIDOMAIN:
return "MultiDomain";
case REGTABLE_ESS:
return "ESS";
case REGTABLE_DEFAULT:
return "Default";
default:
break;
}
return "UNKN";
}
/**
* @brief Regclass dump channel table
*
* @param argc Number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
static int reg_class_dump_chan_table(int argc, char *argv[])
{
int ret = MLAN_STATUS_SUCCESS;
struct ifreq ifr;
t_u8 *buffer = NULL, *pos = NULL;
t_u32 cmd_len = 0, cmd_header_len;
struct eth_priv_cmd *cmd = NULL;
HostCmd_DS_GEN *hostcmd;
HostCmd_DS_REGCLASS_GET_CHAN_TABLE *get_table;
int idx;
t_u16 regLimits;
boolean invalid_cmd = FALSE;
printf("ERR:Cannot allocate buffer for command!\n");
if (argv[0] == NULL) {
invalid_cmd = TRUE;
} else {
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
if (buffer == NULL) {
fprintf(stderr, "Cannot alloc memory\n");
ret = -ENOMEM;
goto done;
}
memset(buffer, 0, BUFFER_LENGTH);
cmd = (struct eth_priv_cmd *)malloc(
sizeof(struct eth_priv_cmd));
if (!cmd) {
printf("ERR:Cannot allocate buffer for command!\n");
ret = -ENOMEM;
goto done;
}
/* Fill up buffer */
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
memset(cmd, 0, sizeof(struct eth_priv_cmd));
memcpy(&cmd->buf, &buffer, sizeof(buffer));
#else
cmd->buf = buffer;
#endif
cmd->used_len = 0;
cmd->total_len = BUFFER_LENGTH;
/* buffer = MRVL_CMD<cmd> */
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD,
strlen(HOSTCMD));
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS>
*/
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len +
sizeof(t_u32));
/* Point after host command header */
pos = (t_u8 *)hostcmd + S_DS_GEN;
cmd_len = S_DS_GEN + sizeof(HostCmd_DS_REGCLASS_GET_CHAN_TABLE);
hostcmd->command = cpu_to_le16(HostCmd_CMD_REGCLASS_CHAN_TABLE);
hostcmd->size = cpu_to_le16(cmd_len);
hostcmd->seq_num = 0;
hostcmd->result = 0;
get_table = (HostCmd_DS_REGCLASS_GET_CHAN_TABLE *)pos;
get_table->action = cpu_to_le16(HostCmd_ACT_GEN_GET);
if (reg_class_table_select(
argv[0],
(reg_chan_table_e *)&get_table->table_select) ==
FALSE) {
invalid_cmd = TRUE;
}
}
if (invalid_cmd) {
printf("\nValid tables table; valid [user, md, ess, default]\n\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
get_table->table_select = cpu_to_le16((t_u16)(get_table->table_select));
/* Put buffer length */
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
/* Initialize the ifr structure */
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
ifr.ifr_ifru.ifru_data = (void *)cmd;
/* Perform ioctl */
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
perror("ioctl[regClassIoctl]");
printf("ERR:Command sending failed!\n");
ret = -EFAULT;
goto done;
}
if (!le16_to_cpu(hostcmd->result)) {
printf("HOSTCMD_RESP: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
} else {
printf("HOSTCMD failed: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
}
get_table->table_select = le16_to_cpu(get_table->table_select);
get_table->chan = le32_to_cpu(get_table->chan);
printf("---------------------------------------");
printf("---------------------------------------\n");
printf("%35s: %s [%d]\n", "Channel Table",
table_num_to_str(get_table->table_select), (int)get_table->chan);
printf("---------------------------------------");
printf("---------------------------------------\n");
printf(" chn | freq | sfrq | sp | class | maxP | behavior limits\n");
printf("---------------------------------------");
printf("---------------------------------------\n");
for (idx = 0; (unsigned int)idx < get_table->chan; idx++) {
char regDisp[8];
sprintf(regDisp, "%4s-%02u",
reg_domain_to_str(
get_table->chan_entry[idx].reg_domain),
get_table->chan_entry[idx].regulatory_class);
printf(" %03u | %04u | %04u | %02u | %-8s | %02u |",
get_table->chan_entry[idx].chan_num,
(get_table->chan_entry[idx].start_freq +
(get_table->chan_entry[idx].chan_num * 5)),
le16_to_cpu(get_table->chan_entry[idx].start_freq),
le16_to_cpu(get_table->chan_entry[idx].chan_spacing),
regDisp, get_table->chan_entry[idx].max_tx_power);
regLimits = le16_to_cpu(get_table->chan_entry[idx].reg_limits);
if (regLimits & BLIMIT_NOMADIC)
printf(" nomadic");
if (regLimits & BLIMIT_INDOOR_ONLY)
printf(" indoor");
if (regLimits & BLIMIT_TPC)
printf(" tpc");
if (regLimits & BLIMIT_DFS)
printf(" dfs");
if (regLimits & BLIMIT_IBSS_PROHIBIT)
printf(" no_ibss");
if (regLimits & BLIMIT_FOUR_MS_CS)
printf(" 4ms_cs");
if (regLimits & BLIMIT_LIC_BASE_STA)
printf(" base_sta");
if (regLimits & BLIMIT_MOBILE_STA)
printf(" mobile");
if (regLimits & BLIMIT_PUBLIC_SAFETY)
printf(" safety");
if (regLimits & BLIMIT_ISM_BANDS)
printf(" ism");
printf("\n");
}
printf("---------------------------------------");
printf("---------------------------------------\n");
printf("\n");
done:
if (buffer)
free(buffer);
if (cmd)
free(cmd);
return ret;
}
/**
* @brief Regclass configure user table
*
* @param argc Number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
static int reg_class_config_user_table(int argc, char *argv[])
{
int ret = MLAN_STATUS_SUCCESS;
struct ifreq ifr;
t_u8 *buffer = NULL, *pos = NULL;
t_u32 cmd_len = 0, cmd_header_len;
struct eth_priv_cmd *cmd = NULL;
HostCmd_DS_GEN *hostcmd;
HostCmd_DS_REGCLASS_CONFIG_USER_TABLE *cfg_user_table;
if (argv[0] == NULL) {
printf("\nCountry string not specified\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
if (buffer == NULL) {
fprintf(stderr, "Cannot alloc memory\n");
ret = -ENOMEM;
goto done;
}
memset(buffer, 0, BUFFER_LENGTH);
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
if (!cmd) {
printf("ERR:Cannot allocate buffer for command!\n");
ret = -ENOMEM;
goto done;
}
/* Fill up buffer */
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
memset(cmd, 0, sizeof(struct eth_priv_cmd));
memcpy(&cmd->buf, &buffer, sizeof(buffer));
#else
cmd->buf = buffer;
#endif
cmd->used_len = 0;
cmd->total_len = BUFFER_LENGTH;
/* buffer = MRVL_CMD<cmd> */
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
/* Point after host command header */
pos = (t_u8 *)hostcmd + S_DS_GEN;
cmd_len = S_DS_GEN + sizeof(HostCmd_DS_REGCLASS_CONFIG_USER_TABLE);
hostcmd->command = cpu_to_le16(HostCmd_CMD_REGCLASS_CONFIG_USER_TABLE);
hostcmd->size = cpu_to_le16(cmd_len);
hostcmd->seq_num = 0;
hostcmd->result = 0;
cfg_user_table = (HostCmd_DS_REGCLASS_CONFIG_USER_TABLE *)pos;
cfg_user_table->action = cpu_to_le16(HostCmd_ACT_GEN_SET);
memcpy(cfg_user_table->regulatory_str, argv[0],
MIN(strlen(argv[0]), sizeof(cfg_user_table->regulatory_str)));
/* Put buffer length */
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
/* Initialize the ifr structure */
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
ifr.ifr_ifru.ifru_data = (void *)cmd;
/* Perform ioctl */
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
perror("ioctl[regClassIoctl]");
printf("ERR:Command sending failed!\n");
ret = -EFAULT;
goto done;
}
if (!le16_to_cpu(hostcmd->result)) {
printf("HOSTCMD_RESP: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
} else {
printf("HOSTCMD failed: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
}
done:
if (buffer)
free(buffer);
if (cmd)
free(cmd);
return ret;
}
/**
* @brief Issue regclass multi-domain command
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
static int reg_class_multidomain(int argc, char *argv[])
{
int ret = MLAN_STATUS_SUCCESS;
struct ifreq ifr;
t_u8 *buffer = NULL, *pos = NULL;
t_u32 cmd_len = 0, cmd_header_len;
struct eth_priv_cmd *cmd = NULL;
HostCmd_DS_GEN *hostcmd;
HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL *multidomain_ctrl;
boolean invalid_cmd = FALSE;
if (argv[0] == NULL) {
invalid_cmd = TRUE;
} else {
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
if (buffer == NULL) {
fprintf(stderr, "Cannot alloc memory\n");
ret = -ENOMEM;
goto done;
}
memset(buffer, 0, BUFFER_LENGTH);
cmd = (struct eth_priv_cmd *)malloc(
sizeof(struct eth_priv_cmd));
if (!cmd) {
printf("ERR:Cannot allocate buffer for command!\n");
ret = -ENOMEM;
goto done;
}
/* Fill up buffer */
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
memset(cmd, 0, sizeof(struct eth_priv_cmd));
memcpy(&cmd->buf, &buffer, sizeof(buffer));
#else
cmd->buf = buffer;
#endif
cmd->used_len = 0;
cmd->total_len = BUFFER_LENGTH;
/* buffer = MRVL_CMD<cmd> */
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD,
strlen(HOSTCMD));
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS>
*/
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len +
sizeof(t_u32));
/* Point after host command header */
pos = (t_u8 *)hostcmd + S_DS_GEN;
cmd_len = S_DS_GEN +
sizeof(HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL);
hostcmd->command =
cpu_to_le16(HostCmd_CMD_REGCLASS_MULTIDOMAIN_CONTROL);
hostcmd->size = cpu_to_le16(cmd_len);
hostcmd->seq_num = 0;
hostcmd->result = 0;
multidomain_ctrl =
(HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL *)pos;
if (strcmp(argv[0], "on") == 0) {
multidomain_ctrl->multidomain_enable = 1;
} else if (strcmp(argv[0], "off") == 0) {
multidomain_ctrl->multidomain_enable = 0;
} else {
invalid_cmd = TRUE;
}
}
if (invalid_cmd) {
printf("\nUnknown multiDomain command; valid [on, off]\n\n");
ret = MLAN_STATUS_FAILURE;
goto done;
}
multidomain_ctrl->multidomain_enable =
cpu_to_le32(multidomain_ctrl->multidomain_enable);
/* Put buffer length */
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
/* Initialize the ifr structure */
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
ifr.ifr_ifru.ifru_data = (void *)cmd;
/* Perform ioctl */
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
perror("ioctl[regClass]");
printf("ERR:Command sending failed!\n");
ret = -EFAULT;
goto done;
} else {
printf("\nMultiDomain: %s\n",
le32_to_cpu(multidomain_ctrl->multidomain_enable) ?
"Enabled" :
"Disabled");
}
if (!le16_to_cpu(hostcmd->result)) {
printf("HOSTCMD_RESP: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
} else {
printf("HOSTCMD failed: ReturnCode=%#04x, Result=%#04x\n",
le16_to_cpu(hostcmd->command),
le16_to_cpu(hostcmd->result));
}
done:
if (buffer)
free(buffer);
if (cmd)
free(cmd);
return ret;
}
/**
* @brief Issue a regclass command
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int process_regclass(int argc, char *argv[])
{
sub_cmd_exec_t sub_cmd[] = {
{"table", 1, 1, reg_class_dump_chan_table},
{"multidomain", 1, 1, reg_class_multidomain},
{"country", 1, 1, reg_class_config_user_table}};
return process_sub_cmd(sub_cmd, NELEMENTS(sub_cmd), argc, argv);
}

View file

@ -0,0 +1,96 @@
/** @file mlanregclass.h
*
* @brief This files contains mlanutl regclass command handling.
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
08/11/2009: initial version
************************************************************************/
#ifndef _MLANREGCLASS_H
#define _MLANREGCLASS_H
/** Nomadic */
#define BLIMIT_NOMADIC (1 << 0)
/** Indoor */
#define BLIMIT_INDOOR_ONLY (1 << 1)
/** Tpc */
#define BLIMIT_TPC (1 << 2)
/** Dfs */
#define BLIMIT_DFS (1 << 3)
/** IBSS Prohibit */
#define BLIMIT_IBSS_PROHIBIT (1 << 4)
/** Four MS CS */
#define BLIMIT_FOUR_MS_CS (1 << 5)
/** LIC Base STA */
#define BLIMIT_LIC_BASE_STA (1 << 6)
/** Mobile STA */
#define BLIMIT_MOBILE_STA (1 << 7)
/** Public Safety */
#define BLIMIT_PUBLIC_SAFETY (1 << 8)
/** ISM Bands */
#define BLIMIT_ISM_BANDS (1 << 9)
/** Enum Definitions: reg_domain */
typedef enum {
REGDOMAIN_NULL = 0x00,
REGDOMAIN_FCC = 0x01,
REGDOMAIN_ETSI = 0x02,
REGDOMAIN_MIC = 0x03,
REGDOMAIN_OTHER = 0xFF,
} reg_domain_e;
typedef struct {
t_u8 reg_domain; /**< Domain */
t_u8 regulatory_class; /**< Regulatory class */
t_u8 chan_num; /**< Channel Number */
t_u8 reserved1; /**< Reserved */
t_u16 start_freq; /**< Start frequency */
t_u16 chan_spacing; /**< channel spacing */
t_u8 max_tx_power; /**< Max. tx power */
t_u8 coverage_class; /**< Coverage class */
t_u16 reg_limits; /**< Limits */
} __ATTRIB_PACK__ chan_entry_t;
typedef struct {
/** Action: GET/SET */
t_u16 action;
/** Reg channel table */
t_u16 table_select;
/** Channel number */
t_u32 chan;
/** Channel entry */
chan_entry_t chan_entry[75];
} __ATTRIB_PACK__ HostCmd_DS_REGCLASS_GET_CHAN_TABLE;
typedef struct {
t_u16 action; /**< Action: GET/SET */
t_u16 reserved; /**< Reserved */
char regulatory_str[3]; /**< Regulatory String */
} __ATTRIB_PACK__ HostCmd_DS_REGCLASS_CONFIG_USER_TABLE;
typedef struct {
t_u32 multidomain_enable; /**< Multi domain enable */
} __ATTRIB_PACK__ HostCmd_DS_REGCLASS_MULTIDOMAIN_CONTROL;
#endif /* _MLANREGCLASS_H */

3600
mapp/mlanutl/mlanroamagent.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,321 @@
/** @file mlanroamagent.h
*
* @brief This files contains mlanutl roamagent command handling.
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
08/11/2009: initial version
************************************************************************/
#ifndef _MLANROAMAGENT_H_
#define _MLANROAMAGENT_H_
/** Bit definitions */
#ifndef BIT
#define BIT(x) (1UL << (x))
#endif
/* Define actionsd for HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST_MAINTENANCE */
/** Blacklist */
#define HostCmd_ACT_ADD_TO_BLACKLIST 0x0001
/** Flushing blacklisted entry */
#define HostCmd_ACT_REMOVE_FROM_BLACKLIST 0x0002
/** Roaming scanmode: discovery */
#define DISCOVERY_MODE 1
/** Roaming scanmode: tracking */
#define TRACKING_MODE 2
/** Threshold configuration: RSSI */
#define RSSI_THRESHOLD 1
/** Threshold configuration: SNR */
#define SNR_THRESHOLD 2
#ifdef BIG_ENDIAN_SUPPORT
/** Bit values for Qualified Neighbor RSSI Entry */
#define BIT_NEIGHFLAG_RSSI 0x80000000
/** Bit values for Qualified Neighbor AGE Entry */
#define BIT_NEIGHFLAG_AGE 0x40000000
/** Bit values for Qualified Neighbor Blacklist Entry */
#define BIT_NEIGHFLAG_BLACKLIST 0x20000000
/** Bit values for Qualified Neighbor Admission Capacity */
#define BIT_NEIGHFLAG_ADMISSION_CAP 0x10000000
/** Bit values for Qualified Neighbor Uplink RSSI */
#define BIT_NEIGHFLAG_UPLINK_RSSI 0x08000000
#else
/** Bit values for Qualified Neighbor RSSI Entry */
#define BIT_NEIGHFLAG_RSSI 0x01
/** Bit values for Qualified Neighbor AGE Entry */
#define BIT_NEIGHFLAG_AGE 0x02
/** Bit values for Qualified Neighbor Blacklist Entry */
#define BIT_NEIGHFLAG_BLACKLIST 0x04
/** Bit values for Qualified Neighbor Admission Capacity */
#define BIT_NEIGHFLAG_ADMISSION_CAP 0x08
/** Bit values for Qualified Neighbor Uplink RSSI */
#define BIT_NEIGHFLAG_UPLINK_RSSI 0x10
#endif
/** milliseconds time conversion data */
typedef struct exactTime {
t_u16 hrs; /**< Number of hours */
t_u16 mins; /**< Number of minutes */
t_u16 secs; /**< Number of seconds */
t_u16 msecs; /**< Number of milliseconds left */
} ExactTime_t;
/** ROAMAGENT HostEvent bitmasks */
typedef enum {
HOST_EVENT_NBOR_DISABLE = 6, /* reset bit 0 */
HOST_EVENT_NBOR_ENABLE = 1, /* set bit 0 */
HOST_EVENT_ROAM_DISABLE = 5, /* reset bit 1 */
HOST_EVENT_ROAM_ENABLE = 2, /* set bit 1 */
HOST_EVENT_STATE_DISABLE = 3, /* reset bit 2 */
HOST_EVENT_STATE_ENABLE = 4, /* reset bit 2 */
} __ATTRIB_PACK__ HostEvent_e;
/** ROAMAGENT_CONTROL command identifiers */
typedef enum {
ROAM_CONTROL_DISABLE = 6, /* reset bit 0 */
ROAM_CONTROL_ENABLE = 1, /* set bit 0 */
ROAM_CONTROL_RESUME = 5, /* reset bit 1 */
ROAM_CONTROL_SUSPEND = 2, /* set bit 1 */
CROSSBAND_DISABLE = 3, /* reset bit 2 */
CROSSBAND_ENABLE = 4 /* set bit 2 */
} __ATTRIB_PACK__ RoamControl_e;
/*
* Definitions of roaming state and other constants
*/
/** Enum Definitations: Roaming agent state */
typedef enum {
STATE_DISCONNECTED,
STATE_STABLE,
STATE_DEGRADING,
STATE_UNACCEPTABLE,
STATE_HARDROAM,
STATE_LINKLOSS,
STATE_SOFTROAM,
STATE_SUSPEND,
STATE_CMD_SUSPEND,
STATE_ASYNCASSOC_SUSPEND
} RoamingAgentState;
/** statistics threshold High RSSI */
typedef struct {
/** Header */
MrvlIEtypesHeader_t Header;
/** RSSI threshold (dBm) */
t_u8 Value;
/** reporting frequency */
t_u8 Frequency;
} __ATTRIB_PACK__ MrvlIEtypes_BeaconHighRssiThreshold_t,
MrvlIEtypes_BeaconLowRssiThreshold_t,
MrvlIEtypes_BeaconHighSnrThreshold_t,
MrvlIEtypes_BeaconLowSnrThreshold_t;
/** HostCmd_DS_CMD_ROAMAGENT_STATISTICS_THRESHOLD */
typedef struct {
/** Action */
t_u16 action;
/** roaming state */
t_u8 State;
/** active/configured user */
t_u8 Profile;
/** TLV buffer */
t_u8 TlvBuffer[1];
/* MrvlIEtypes_BeaconHighRssiThreshold_t BeaconHighRssiThreshold;
* MrvlIEtypes_BeaconLowRssiThreshold_t BeaconLowRssiThreshold;
* MrvlIEtypes_BeaconHighSnrThreshold_t BeaconHighSnrThreshold;
* MrvlIEtypes_BeaconLowSnrThreshold_t BeaconLowSnrThreshold;
* MrvlIEtypes_BeaconsMissed_t PreBeaconMissed;
* MrvlIEtypes_FailureCount_t FailureCnt;
*/
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_STATISTICS_THRESHOLD;
typedef struct {
/** */
signed char RssiHighLevel;
/** */
signed char RssiLowLevel;
/** */
signed char RssiNborDiff;
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_ROAM_THRESHOLD;
#define ROAM_THRESH_MAX 4
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_ASSESSMENT */
typedef struct {
/** Action */
t_u16 action;
/** configured qualifying snr */
signed char ConfQualSignalStrength;
/** active qualifying snr */
signed char ActiveQualSignalStrength;
/** qualifying neighbor count */
t_u16 QualifyingNumNeighbor;
/** inactivity in # scans */
t_u16 StaleCount;
/** inactivity in time (ms) */
t_u32 StalePeriod;
/** blacklist duration in ms due to minor failures */
t_u32 ShortBlacklistPeriod;
/** blacklist duration in ms due to severe failures */
t_u32 LongBlacklistPeriod;
HostCmd_DS_CMD_ROAMAGENT_ROAM_THRESHOLD RoamThresh[ROAM_THRESH_MAX];
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_ASSESSMENT;
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST */
typedef struct {
/** Action */
t_u16 action;
/** Reserved */
t_u16 Reserved;
/** TLV buffer */
t_u8 TlvBuffer[1];
/* MrvlIEtypes_NeighborEntry_t Neighbors[MRVL_ROAM_MAX_NEIGHBORS];
* MRVL_ROAM_MAX_NEIGHBORS = 5
*/
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST;
/** neighbor entry details roaming agent */
typedef struct {
/** Header */
MrvlIEtypesHeader_t Header;
/** bssid of neighbor */
t_u8 Bssid[ETH_ALEN];
/** Reserved */
t_u16 Reserved;
/** neighbor snr */
t_s16 SignalStrength;
/** neighbor age */
t_u16 Age;
/** bit map for qualified neighbor */
t_u32 QualifiedNeighborBitmap;
/** blacklist duration in ms */
t_u32 BlackListDuration;
} __ATTRIB_PACK__ MrvlIEtypes_NeighborEntry_t;
/** HostCmd_DS_ROAMAGENT_ADV_METRIC_THRESHOLD */
typedef struct {
/** Action */
t_u16 action;
/** Beacon RSSI Metrics,Data RSSI Metrics or PER Metrics */
t_u16 Metrics;
/** Percentage FER Threshold value to exceed for making a roam decision
*/
t_u8 UcFerThresholdValue;
/** Percentage PER Threshold value to exceed for making a roam decision
*/
t_u8 UcPerThresholdValue;
/** Reserved for later use */
t_u8 Reserved[2];
/** Time (ms) for which FER should prevail in stable state */
t_u32 StableFERPeriod_ms;
/** Time (ms) for which FER should prevail in degrading state */
t_u32 DegradingFERPeriod_ms;
/** Time (ms) for which FER should prevail in unacceptable state */
t_u32 UnacceptableFERPeriod_ms;
/** Time (ms) for which FER should prevail in stable state */
t_u32 StablePERPeriod_ms;
/** Time (ms) for which PER should prevail in degrading state */
t_u32 DegradingPERPeriod_ms;
/** Time (ms) for which PER should prevail in unacceptable state */
t_u32 UnacceptablePERPeriod_ms;
/** Number of TX packets to exceed in period_ms ms for the FER for Roam
*/
t_u32 UiFerPktThreshold;
/** Number of TX packets to exceed in period_ms ms for the PER for Roam
*/
t_u32 UiPerPktThreshold;
/** Time in ms for which inactivity should prevail for state transition
*/
t_u32 InactivityPeriodThreshold_ms;
/** With Data RSSI Metrics, Roam only when RX packets in period_ms ms
* exceeds this */
t_u32 UiRxPktThreshold;
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_ADV_METRIC_THRESHOLD;
/** scan period for each search mode and state for roaming agent */
typedef struct {
/** Header */
MrvlIEtypesHeader_t Header;
/** search mode */
t_u16 SearchMode;
/** roaming state */
t_u16 State;
/** scan period value */
t_u32 ScanPeriod;
} __ATTRIB_PACK__ MrvlIEtypes_NeighborScanPeriod_t;
/** HostCmd_DS_CMD_ROAMAGENT_CONTROL */
typedef struct {
/** Action */
t_u16 action;
/** enable control */
t_u8 Control;
/** host event control */
t_u8 HostEvent;
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_CONTROL;
/** HostCmd_DS_CMD_ROAMAGENT_BACKOFF */
typedef struct {
/** Action */
t_u16 action;
/** minimum scans */
t_u16 Scans;
/** backoff period */
t_u32 Period;
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_BACKOFF;
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD */
typedef struct {
/** Action */
t_u16 action;
/** Reserved */
t_u16 Reserved;
/** scanPeriod TLV */
MrvlIEtypes_NeighborScanPeriod_t scanPeriod;
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD;
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD_RSP */
typedef struct {
/** Action */
t_u16 action;
/** Reserved */
t_u16 Reserved;
/** TLV buffer */
t_u8 TlvBuffer[1];
/* MrvlIEtypes_NeighborScanPeriod_t scanPeriod[MRVL_ROAM_SCAN_PERIODS];
* MRVL_ROAM_SCAN_PERIODS = 6
*/
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBOR_SCANPERIOD_RSP;
/** HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST_MAINTENANCE */
typedef struct {
/** Action */
t_u16 action;
/** BSSID */
t_u8 BSSID[ETH_ALEN];
} __ATTRIB_PACK__ HostCmd_DS_CMD_ROAMAGENT_NEIGHBORLIST_MAINTENANCE;
#endif /* _MLANROAMAGENT_H_ */

View file

@ -0,0 +1,823 @@
/** @file mlanscanagent.c
*
* @brief This files contains mlanutl scanagent command handling.
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
08/11/2009: initial version
************************************************************************/
#include "mlanutl.h"
#include "mlanhostcmd.h"
#include "mlanoffload.h"
#include "mlanscanagent.h"
/********************************************************
Local Variables
********************************************************/
/********************************************************
Global Variables
********************************************************/
/********************************************************
Local Functions
********************************************************/
/**
* @brief scanagent configure scan table
*
* @param age_limit age limit
* @param hold_limit hold limit
*
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
*/
static int scanagent_cfg_scan_table_limits(t_u32 age_limit, t_u32 hold_limit)
{
int ret = 0;
struct ifreq ifr;
t_u8 *buffer = NULL, *pos = NULL;
t_u32 cmd_len = 0, cmd_header_len;
struct eth_priv_cmd *cmd = NULL;
HostCmd_DS_GEN *hostcmd = NULL;
HostCmd_DS_SCANAGENT_SCAN_TABLE_LIMITS *scan_table_limits = NULL;
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
cmd_len = S_DS_GEN + sizeof(HostCmd_DS_SCANAGENT_SCAN_TABLE_LIMITS);
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
if (buffer == NULL) {
fprintf(stderr, "Cannot alloc memory\n");
return -ENOMEM;
}
memset(buffer, 0, BUFFER_LENGTH);
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
if (!cmd) {
printf("ERR:Cannot allocate buffer for command!\n");
free(buffer);
return -ENOMEM;
}
/* Fill up buffer */
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
memset(cmd, 0, sizeof(struct eth_priv_cmd));
memcpy(&cmd->buf, &buffer, sizeof(buffer));
#else
cmd->buf = buffer;
#endif
cmd->used_len = 0;
cmd->total_len = BUFFER_LENGTH;
/* buffer = MRVL_CMD<cmd> */
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
hostcmd->command = cpu_to_le16(HostCmd_CMD_SCANAGENT_SCAN_TABLE_LIMITS);
hostcmd->size = cpu_to_le16(cmd_len);
hostcmd->seq_num = 0;
hostcmd->result = 0;
/* Put buffer length */
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
/* Point after host command header */
pos = (t_u8 *)hostcmd + S_DS_GEN;
scan_table_limits = (HostCmd_DS_SCANAGENT_SCAN_TABLE_LIMITS *)pos;
scan_table_limits->table_age_limit = cpu_to_le16(age_limit);
scan_table_limits->table_hold_limit = cpu_to_le16(hold_limit);
/* 0 set values are ignored by firmware */
scan_table_limits->action = cpu_to_le16(HostCmd_ACT_GEN_SET);
/* Initialize the ifr structure */
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
ifr.ifr_ifru.ifru_data = (void *)cmd;
/* Perform ioctl */
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
perror("ioctl[scanAgentIoctl]");
printf("ERR:Command sending failed!\n");
ret = -EFAULT;
goto done;
}
printf("\nAge limit = %7d seconds\n",
le16_to_cpu(scan_table_limits->table_age_limit));
printf("Hold limit = %7d seconds\n\n",
le16_to_cpu(scan_table_limits->table_hold_limit));
done:
if (buffer)
free(buffer);
if (cmd)
free(cmd);
return ret;
}
/**
* @brief Set scanagent age limit
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
*/
static int scanagent_age_limit(int argc, char *argv[])
{
t_u32 age_limit = 0;
if (argc) {
age_limit = atoi(argv[0]);
}
return scanagent_cfg_scan_table_limits(age_limit, 0);
}
/**
* @brief Set scanagent hold limit
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
*/
static int scanagent_hold_limit(int argc, char *argv[])
{
t_u32 hold_limit = 0;
if (argc) {
hold_limit = atoi(argv[0]);
}
return scanagent_cfg_scan_table_limits(0, hold_limit);
}
/**
* @brief Set scanagent scan timing
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
*/
static int scanagent_timing(int argc, char *argv[])
{
int ret = 0;
struct ifreq ifr;
int idx;
t_u8 *buffer = NULL, *pos = NULL;
t_u32 cmd_len = 0, cmd_header_len = 0, sel = 0;
struct eth_priv_cmd *cmd = NULL;
HostCmd_DS_GEN *hostcmd = NULL;
HostCmd_DS_SCANAGENT_CONFIG_TIMING *cfg_timing_cmd = NULL;
MrvlIEtypes_ConfigScanTiming_t *cfg_timing_tlv = NULL;
timing_sel_t sel_str[] = {{"disconnected", 1},
{"adhoc", 1},
{"fullpower", 1},
{"ieeeps", 1},
{"periodic", 1}};
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
cmd_len = S_DS_GEN + sizeof(t_u16);
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
if (buffer == NULL) {
fprintf(stderr, "Cannot alloc memory\n");
return -ENOMEM;
}
memset(buffer, 0, BUFFER_LENGTH);
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
if (!cmd) {
printf("ERR:Cannot allocate buffer for command!\n");
free(buffer);
return -ENOMEM;
}
/* Fill up buffer */
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
memset(cmd, 0, sizeof(struct eth_priv_cmd));
memcpy(&cmd->buf, &buffer, sizeof(buffer));
#else
cmd->buf = buffer;
#endif
cmd->used_len = 0;
cmd->total_len = BUFFER_LENGTH;
/* buffer = MRVL_CMD<cmd> */
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
hostcmd->command = cpu_to_le16(HostCmd_CMD_SCANAGENT_SCAN_TIMING);
hostcmd->seq_num = 0;
hostcmd->result = 0;
/* Point after host command header */
pos = (t_u8 *)hostcmd + S_DS_GEN;
cfg_timing_cmd = (HostCmd_DS_SCANAGENT_CONFIG_TIMING *)pos;
cfg_timing_cmd->action = cpu_to_le16(HostCmd_ACT_GEN_GET);
cfg_timing_tlv =
(MrvlIEtypes_ConfigScanTiming_t *)cfg_timing_cmd->tlv_buffer;
if (argc == 5) {
cfg_timing_cmd->action = cpu_to_le16(HostCmd_ACT_GEN_SET);
cfg_timing_tlv->header.type = cpu_to_le16(TLV_TYPE_SCAN_TIMING);
cfg_timing_tlv->header.len =
cpu_to_le16(sizeof(MrvlIEtypes_ConfigScanTiming_t) -
sizeof(cfg_timing_tlv->header));
for (idx = 0; (unsigned int)idx < NELEMENTS(sel_str); idx++) {
if (strncmp(argv[0], sel_str[idx].str,
sel_str[idx].match_len) == 0) {
sel = idx + 1;
break;
}
}
if (idx == NELEMENTS(sel_str)) {
printf("Wrong argument for mode selected \"%s\"\n",
argv[0]);
ret = -EINVAL;
goto done;
}
/*
* HostCmd_DS_ScanagentTimingMode_e;
* TIMING_MODE_INVALID = 0,
* TIMING_MODE_DISCONNECTED = 1,
* TIMING_MODE_ADHOC = 2,
* TIMING_MODE_FULL_POWER = 3,
* TIMING_MODE_IEEE_PS = 4,
* TIMING_MODE_PERIODIC_PS = 5,
*/
cfg_timing_tlv->mode = cpu_to_le32(sel);
cfg_timing_tlv->dwell = cpu_to_le32(atoi(argv[1]));
cfg_timing_tlv->max_off = cpu_to_le32(atoi(argv[2]));
cfg_timing_tlv->min_link = cpu_to_le32(atoi(argv[3]));
cfg_timing_tlv->rsp_timeout = cpu_to_le32(atoi(argv[4]));
cmd_len += sizeof(MrvlIEtypes_ConfigScanTiming_t);
}
hostcmd->size = cpu_to_le16(cmd_len);
/* Put buffer length */
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
/* Initialize the ifr structure */
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
ifr.ifr_ifru.ifru_data = (void *)cmd;
/* Perform ioctl */
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
perror("ioctl[scanAgentIoctl]");
printf("ERR:Command sending failed!\n");
ret = -EFAULT;
goto done;
}
ret = process_host_cmd_resp(HOSTCMD, buffer);
done:
if (buffer)
free(buffer);
if (cmd)
free(cmd);
return ret;
}
/**
* @brief Set scanagent profile scan period
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
*/
static int scanagent_profile_period(int argc, char *argv[])
{
int ret = 0;
struct ifreq ifr;
t_u8 *buffer = NULL, *pos = NULL;
t_u32 cmd_len = 0, cmd_header_len = 0;
struct eth_priv_cmd *cmd = NULL;
HostCmd_DS_GEN *hostcmd = NULL;
HostCmd_DS_SCANAGENT_CONFIG_PROFILE_SCAN *cfg_profile_scan = NULL;
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
cmd_len = S_DS_GEN + sizeof(HostCmd_DS_SCANAGENT_CONFIG_PROFILE_SCAN);
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
if (buffer == NULL) {
fprintf(stderr, "Cannot alloc memory\n");
return -ENOMEM;
}
memset(buffer, 0, BUFFER_LENGTH);
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
if (!cmd) {
printf("ERR:Cannot allocate buffer for command!\n");
free(buffer);
return -ENOMEM;
}
/* Fill up buffer */
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
memset(cmd, 0, sizeof(struct eth_priv_cmd));
memcpy(&cmd->buf, &buffer, sizeof(buffer));
#else
cmd->buf = buffer;
#endif
cmd->used_len = 0;
cmd->total_len = BUFFER_LENGTH;
/* buffer = MRVL_CMD<cmd> */
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
hostcmd->command =
cpu_to_le16(HostCmd_CMD_SCANAGENT_CONFIG_PROFILE_SCAN);
hostcmd->size = cpu_to_le16(cmd_len);
hostcmd->seq_num = 0;
hostcmd->result = 0;
/* Point after host command header */
pos = (t_u8 *)hostcmd + S_DS_GEN;
cfg_profile_scan = (HostCmd_DS_SCANAGENT_CONFIG_PROFILE_SCAN *)pos;
if (argc == 1) {
cfg_profile_scan->action = cpu_to_le16(HostCmd_ACT_GEN_SET);
cfg_profile_scan->scan_interval = cpu_to_le16(atoi(argv[0]));
} else {
cfg_profile_scan->action = cpu_to_le16(HostCmd_ACT_GEN_GET);
}
/* Put buffer length */
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
/* Initialize the ifr structure */
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
ifr.ifr_ifru.ifru_data = (void *)cmd;
/* Perform ioctl */
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
perror("ioctl[scanAgentIoctl]");
printf("ERR:Command sending failed!\n");
ret = -EFAULT;
goto done;
}
cfg_profile_scan->scan_interval =
le16_to_cpu(cfg_profile_scan->scan_interval);
if ((int)cfg_profile_scan->scan_interval == 0)
printf("\nProfile Scan interval: <disabled>\n\n");
else
printf("\nProfile Scan interval: %d seconds\n\n",
(int)cfg_profile_scan->scan_interval);
done:
if (buffer)
free(buffer);
if (cmd)
free(cmd);
return ret;
}
/**
* @brief scanagent parse entry selection
*
* @param argc number of arguments
* @param argv A pointer to arguments array
* @param psel A pointer to scanagent entry selection
*
* @return None
*/
static void scanAgentParseEntrySel(int argc, char *argv[],
HostCmd_DS_SCANAGENT_TABLE_MAINTENANCE *psel,
int *cmd_len)
{
int arg_idx, tmp_idx;
t_u8 *tlv_pos;
MrvlIEtypes_SsIdParamSet_t *ssid;
MrvlIEtypes_Bssid_List_t *bssid;
unsigned int mac[ETH_ALEN];
tlv_pos = (t_u8 *)psel->tlv_buffer;
for (arg_idx = 0; arg_idx < argc; arg_idx++) {
if (strncmp(argv[arg_idx], "ssid=", strlen("ssid=")) == 0) {
ssid = (MrvlIEtypes_SsIdParamSet_t *)tlv_pos;
ssid->header.type = cpu_to_le16(TLV_TYPE_SSID);
ssid->header.len =
strlen(argv[arg_idx]) - strlen("ssid=");
strncpy((char *)ssid->ssid,
(argv[arg_idx] + strlen("ssid=")),
ssid->header.len);
tlv_pos +=
ssid->header.len + sizeof(MrvlIEtypesHeader_t);
ssid->header.len = cpu_to_le16(ssid->header.len);
} else if (strncmp(argv[arg_idx], "bssid=", strlen("bssid=")) ==
0) {
bssid = (MrvlIEtypes_Bssid_List_t *)tlv_pos;
bssid->header.type = cpu_to_le16(TLV_TYPE_BSSID);
bssid->header.len = ETH_ALEN;
/*
* "bssid" token string handler
*/
sscanf(argv[arg_idx] + strlen("bssid="),
"%2x:%2x:%2x:%2x:%2x:%2x", mac + 0, mac + 1,
mac + 2, mac + 3, mac + 4, mac + 5);
for (tmp_idx = 0;
(unsigned int)tmp_idx < NELEMENTS(mac);
tmp_idx++) {
bssid->bssid[tmp_idx] = (t_u8)mac[tmp_idx];
}
tlv_pos +=
bssid->header.len + sizeof(MrvlIEtypesHeader_t);
bssid->header.len = cpu_to_le16(bssid->header.len);
} else if (strncmp(argv[arg_idx], "age=", strlen("age=")) ==
0) {
psel->age = cpu_to_le32(
atoi(argv[arg_idx] + strlen("age=")));
} else if (strncmp(argv[arg_idx], "id=", strlen("id=")) == 0) {
psel->scan_request_id = cpu_to_le32(
atoi(argv[arg_idx] + strlen("id=")));
}
}
*cmd_len += (tlv_pos - psel->tlv_buffer);
}
/**
* @brief scanagent execute scan
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
*/
static int scanagent_exec_scan(int argc, char *argv[])
{
int ret = 0;
struct ifreq ifr;
int arg_idx, tmp_idx;
t_u32 cmd_len = 0, cmd_header_len = 0;
t_u8 *buffer = NULL, *pos = NULL, *tlv_pos = NULL;
struct eth_priv_cmd *cmd = NULL;
HostCmd_DS_GEN *hostcmd = NULL;
HostCmd_DS_SCANAGENT_SCAN_EXEC *scan_exec = NULL;
MrvlIEtypes_SsIdParamSet_t *ssid = NULL;
MrvlIEtypes_Bssid_List_t *bssid = NULL;
MrvlIEtypes_ConfigScanTiming_t *cfg_timing_tlv = NULL;
unsigned int mac[ETH_ALEN];
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
cmd_len = (S_DS_GEN + sizeof(HostCmd_DS_SCANAGENT_SCAN_EXEC) -
sizeof(scan_exec->tlv_buffer));
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
if (buffer == NULL) {
fprintf(stderr, "Cannot alloc memory\n");
return -ENOMEM;
}
memset(buffer, 0, BUFFER_LENGTH);
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
if (!cmd) {
printf("ERR:Cannot allocate buffer for command!\n");
free(buffer);
return -ENOMEM;
}
/* Fill up buffer */
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
memset(cmd, 0, sizeof(struct eth_priv_cmd));
memcpy(&cmd->buf, &buffer, sizeof(buffer));
#else
cmd->buf = buffer;
#endif
cmd->used_len = 0;
cmd->total_len = BUFFER_LENGTH;
/* buffer = MRVL_CMD<cmd> */
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
hostcmd->command = cpu_to_le16(HostCmd_CMD_SCANAGENT_SCAN_EXEC);
hostcmd->size = 0;
hostcmd->seq_num = 0;
hostcmd->result = 0;
/* Point after host command header */
pos = (t_u8 *)hostcmd + S_DS_GEN;
scan_exec = (HostCmd_DS_SCANAGENT_SCAN_EXEC *)pos;
tlv_pos = scan_exec->tlv_buffer;
for (arg_idx = 0; arg_idx < argc; arg_idx++) {
if (strncmp(argv[arg_idx], "ssid=", strlen("ssid=")) == 0) {
/*
* "ssid" token string handler
*/
ssid = (MrvlIEtypes_SsIdParamSet_t *)tlv_pos;
ssid->header.type = cpu_to_le16(TLV_TYPE_SSID);
ssid->header.len =
strlen(argv[arg_idx]) - strlen("ssid=");
strncpy((char *)ssid->ssid,
argv[arg_idx] + strlen("ssid="),
ssid->header.len);
tlv_pos +=
ssid->header.len + sizeof(MrvlIEtypesHeader_t);
ssid->header.len = cpu_to_le16(ssid->header.len);
} else if (strncmp(argv[arg_idx], "bssid=", strlen("bssid=")) ==
0) {
bssid = (MrvlIEtypes_Bssid_List_t *)tlv_pos;
bssid->header.type = cpu_to_le16(TLV_TYPE_BSSID);
bssid->header.len = ETH_ALEN;
/*
* "bssid" token string handler
*/
sscanf(argv[arg_idx] + strlen("bssid="),
"%2x:%2x:%2x:%2x:%2x:%2x", mac + 0, mac + 1,
mac + 2, mac + 3, mac + 4, mac + 5);
for (tmp_idx = 0;
(unsigned int)tmp_idx < NELEMENTS(mac);
tmp_idx++) {
bssid->bssid[tmp_idx] = (t_u8)mac[tmp_idx];
}
tlv_pos +=
bssid->header.len + sizeof(MrvlIEtypesHeader_t);
bssid->header.len = cpu_to_le16(bssid->header.len);
} else if (strncmp(argv[arg_idx], "type=", strlen("type=")) ==
0) {
/*
if (strcmp(argv[arg_idx] + strlen("type="), "prof") ==
0) { scan_exec->scan_type = CONFIG_PROFILE; } else {
scan_exec->scan_type = CONFIG_SITE_SURVEY;
}
*/
scan_exec->scan_type = CONFIG_SITE_SURVEY;
scan_exec->scan_type =
cpu_to_le16(scan_exec->scan_type);
} else if (strncmp(argv[arg_idx], "group=", strlen("group=")) ==
0) {
sscanf(argv[arg_idx] + strlen("group="), "0x%x",
&tmp_idx);
scan_exec->chan_group = cpu_to_le32(tmp_idx);
} else if (strncmp(argv[arg_idx], "delay=", strlen("delay=")) ==
0) {
/*
* "delay" token string handler
*/
sscanf(argv[arg_idx] + strlen("delay="), "%d",
(int *)&scan_exec->delay);
scan_exec->delay = cpu_to_le32(scan_exec->delay);
} else if (strncmp(argv[arg_idx],
"timing=", strlen("timing=")) == 0) {
cfg_timing_tlv =
(MrvlIEtypes_ConfigScanTiming_t *)tlv_pos;
cfg_timing_tlv->header.type =
cpu_to_le16(TLV_TYPE_SCAN_TIMING);
cfg_timing_tlv->header.len =
((sizeof(cfg_timing_tlv) -
sizeof(cfg_timing_tlv->header)));
/*
* "timing" token string handler
*/
sscanf(argv[arg_idx] + strlen("timing="), "%d,%d,%d,%d",
(int *)&cfg_timing_tlv->dwell,
(int *)&cfg_timing_tlv->max_off,
(int *)&cfg_timing_tlv->min_link,
(int *)&cfg_timing_tlv->rsp_timeout);
cfg_timing_tlv->mode = 0;
cfg_timing_tlv->dwell =
cpu_to_le32(cfg_timing_tlv->dwell);
cfg_timing_tlv->max_off =
cpu_to_le32(cfg_timing_tlv->max_off);
cfg_timing_tlv->min_link =
cpu_to_le32(cfg_timing_tlv->min_link);
cfg_timing_tlv->rsp_timeout =
cpu_to_le32(cfg_timing_tlv->rsp_timeout);
tlv_pos += sizeof(MrvlIEtypesHeader_t);
tlv_pos += cfg_timing_tlv->header.len;
cfg_timing_tlv->header.len =
cpu_to_le16(cfg_timing_tlv->header.len);
}
}
cmd_len += (tlv_pos - scan_exec->tlv_buffer);
hostcmd->size = cpu_to_le16(cmd_len);
/* Put buffer length */
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
/* Initialize the ifr structure */
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
ifr.ifr_ifru.ifru_data = (void *)cmd;
/* Perform ioctl */
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
perror("ioctl[scanAgentIoctl]");
printf("ERR:Command sending failed!\n");
ret = -EFAULT;
goto done;
} else {
printf("\nScan Scheduled, ID = %d\n\n",
(int)le32_to_cpu(scan_exec->scan_req_id_out));
}
done:
if (buffer)
free(buffer);
if (cmd)
free(cmd);
return ret;
}
/**
* @brief Issue a scanagent cmd_type subcommand
*
* @param argc number of arguments
* @param argv A pointer to arguments array
* @param cmd_type command type
*
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
*/
static int
scanagent_table_entry_sub_cmd(int argc, char *argv[],
HostCmd_DS_ScanagentTableMaintenance_e cmd_type)
{
int ret = 0;
struct ifreq ifr;
t_u8 *buffer = NULL, *pos = NULL;
t_u32 cmd_len = 0, cmd_header_len = 0;
struct eth_priv_cmd *cmd = NULL;
HostCmd_DS_GEN *hostcmd = NULL;
HostCmd_DS_SCANAGENT_TABLE_MAINTENANCE *table_maintenance = NULL;
cmd_header_len = strlen(CMD_NXP) + strlen(HOSTCMD);
cmd_len = (S_DS_GEN + sizeof(HostCmd_DS_SCANAGENT_TABLE_MAINTENANCE) -
sizeof(table_maintenance->tlv_buffer));
buffer = (t_u8 *)malloc(BUFFER_LENGTH);
if (buffer == NULL) {
fprintf(stderr, "Cannot alloc memory\n");
return -ENOMEM;
}
memset(buffer, 0, BUFFER_LENGTH);
cmd = (struct eth_priv_cmd *)malloc(sizeof(struct eth_priv_cmd));
if (!cmd) {
printf("ERR:Cannot allocate buffer for command!\n");
free(buffer);
return -ENOMEM;
}
/* Fill up buffer */
#ifdef USERSPACE_32BIT_OVER_KERNEL_64BIT
memset(cmd, 0, sizeof(struct eth_priv_cmd));
memcpy(&cmd->buf, &buffer, sizeof(buffer));
#else
cmd->buf = buffer;
#endif
cmd->used_len = 0;
cmd->total_len = BUFFER_LENGTH;
/* buffer = MRVL_CMD<cmd> */
strncpy((char *)buffer, CMD_NXP, strlen(CMD_NXP));
strncpy((char *)buffer + strlen(CMD_NXP), HOSTCMD, strlen(HOSTCMD));
/* buffer = MRVL_CMD<cmd><hostcmd_size><HostCmd_DS_GEN><CMD_DS> */
hostcmd = (HostCmd_DS_GEN *)(buffer + cmd_header_len + sizeof(t_u32));
hostcmd->command = cpu_to_le16(HostCmd_CMD_SCANAGENT_TABLE_MAINTENANCE);
hostcmd->size = 0;
hostcmd->seq_num = 0;
hostcmd->result = 0;
/* Point after host command header */
pos = (t_u8 *)hostcmd + S_DS_GEN;
table_maintenance = (HostCmd_DS_SCANAGENT_TABLE_MAINTENANCE *)pos;
table_maintenance->action = cpu_to_le16((t_u16)cmd_type);
scanAgentParseEntrySel(argc, argv, table_maintenance, (int *)&cmd_len);
hostcmd->size = cpu_to_le16(cmd_len);
/* Put buffer length */
memcpy(buffer + cmd_header_len, &cmd_len, sizeof(t_u32));
/* Initialize the ifr structure */
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
ifr.ifr_ifru.ifru_data = (void *)cmd;
/* Perform ioctl */
if (ioctl(sockfd, MLAN_ETH_PRIV, &ifr)) {
perror("ioctl[scanAgentIoctl]");
printf("ERR:Command sending failed!\n");
ret = -EFAULT;
goto done;
}
done:
if (buffer)
free(buffer);
if (cmd)
free(cmd);
return ret;
}
/**
* @brief Issue a scanagent table lock subcommand
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
*/
static int scanagent_table_lock(int argc, char *argv[])
{
return scanagent_table_entry_sub_cmd(argc, argv, SCAN_TABLE_OP_LOCK);
}
/**
* @brief Issue a scanagent table unlock subcommand
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
*/
static int scanagent_table_unlock(int argc, char *argv[])
{
return scanagent_table_entry_sub_cmd(argc, argv, SCAN_TABLE_OP_UNLOCK);
}
/**
* @brief Issue a scanagent table purge subcommand
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS on success, otherwise error code
*/
static int scanagent_table_purge(int argc, char *argv[])
{
return scanagent_table_entry_sub_cmd(argc, argv, SCAN_TABLE_OP_PURGE);
}
/**
* @brief Issue a scanagent command
*
* @param argc number of arguments
* @param argv A pointer to arguments array
*
* @return MLAN_STATUS_SUCCESS--success, otherwise--fail
*/
int process_scanagent(int argc, char *argv[])
{
sub_cmd_exec_t sub_cmd[] = {{"timing", 2, 1, scanagent_timing},
{"scan", 2, 1, scanagent_exec_scan},
{"lock", 2, 1, scanagent_table_lock},
{"unlock", 2, 1, scanagent_table_unlock},
{"purge", 2, 1, scanagent_table_purge},
{"profile", 2, 1, scanagent_profile_period},
{"holdlimit", 2, 1, scanagent_hold_limit},
{"agelimit", 2, 1, scanagent_age_limit}};
return process_sub_cmd(sub_cmd, NELEMENTS(sub_cmd), argc, argv);
}

View file

@ -0,0 +1,148 @@
/** @file mlanscanagent.h
*
* @brief This files contains mlanutl scanagent command handling.
*
*
* Copyright 2008-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
/************************************************************************
Change log:
08/11/2009: initial version
************************************************************************/
#ifndef _MLAN_SCANAGENT_H_
#define _MLAN_SCANAGENT_H_
typedef struct {
/** Action GET or SET */
t_u16 action;
/** scan interval */
t_u16 scan_interval;
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_CONFIG_PROFILE_SCAN;
typedef struct {
t_u32 scan_req_id_out; /**< Scan request id */
t_u32 delay; /**< Delay */
t_u32 chan_group; /**< Channel Group */
t_u16 scan_type; /**< Scan type */
t_u16 reserved; /**< Reserved */
t_u8 tlv_buffer[1]; /**< Rest is TLV buffer */
/* MrvlIEtypes_SsIdParamSet_t
* MrvlIEtypes_Bssid_List_t
* MrvlIEtypes_ConfigScanTiming_t
*/
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_SCAN_EXEC;
typedef struct {
/** Action Set or get */
t_u16 action;
/** Reserved */
t_u16 reserved;
/** Table age limit */
t_u16 table_age_limit;
/** Table hold limit */
t_u16 table_hold_limit;
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_SCAN_TABLE_LIMITS;
typedef struct {
/** Action Set or get */
t_u16 action;
/** TLV buffer starts here */
t_u8 tlv_buffer[1];
/* MrvlIEtypes_ConfigScanTiming_t */
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_CONFIG_TIMING;
typedef struct {
/** HostCmd_DS_ScanagentTableMaintenance_e action */
t_u16 action;
/** Reserved */
t_u16 reserved;
/** Request Id, 0 to disable */
t_u32 scan_request_id;
/** Age, 0 to disable */
t_u32 age;
/** TLV Buffer follows */
t_u8 tlv_buffer[1];
/* MrvlIEtypes_SsIdParamSet_t
* MrvlIEtypes_Bssid_List_t
*/
} __ATTRIB_PACK__ HostCmd_DS_SCANAGENT_TABLE_MAINTENANCE;
/** ENUM definition: Scanagent Table Maintenance */
typedef enum {
SCAN_TABLE_OP_INVALID = 0,
SCAN_TABLE_OP_LOCK = 1,
SCAN_TABLE_OP_UNLOCK = 2,
SCAN_TABLE_OP_PURGE = 3,
} __ATTRIB_PACK__ HostCmd_DS_ScanagentTableMaintenance_e;
/** MrvlIEtypes_SsIdParamSet_t */
typedef struct _MrvlIEtypes_SsIdParamSet_t {
/** Header */
MrvlIEtypesHeader_t header;
/** SSID */
t_u8 ssid[1];
} __ATTRIB_PACK__ MrvlIEtypes_SsIdParamSet_t;
/** _MrvlIEtypes_Bssid_List_t */
typedef struct _MrvlIEtypes_Bssid_List_t {
/** Header */
MrvlIEtypesHeader_t header;
/** BSSID */
t_u8 bssid[ETH_ALEN];
} __ATTRIB_PACK__ MrvlIEtypes_Bssid_List_t;
typedef struct {
/** Header */
MrvlIEtypesHeader_t header;
t_u32 mode; /**< Mode */
t_u32 dwell; /**< Dwell */
t_u32 max_off; /**< Max. off */
t_u32 min_link; /**< Minimum Link */
t_u32 rsp_timeout; /**< Rsp Timeout */
} __ATTRIB_PACK__ MrvlIEtypes_ConfigScanTiming_t;
/** ENUM definition: ScanAgentScanType */
typedef enum {
CONFIG_SITE_SURVEY = 0,
CONFIG_NEIGHBOR = 1,
CONFIG_PROFILE = 2,
CONFIG_ARBITRARY_CHANNEL = 3,
} __ATTRIB_PACK__ HostCmd_DS_ScanagentScanType_e;
/** ENUM definition: ScanAgentScanTimingMode */
typedef enum {
TIMING_MODE_INVALID = 0,
TIMING_MODE_DISCONNECTED = 1,
TIMING_MODE_ADHOC = 2,
TIMING_MODE_FULL_POWER = 3,
TIMING_MODE_IEEE_PS = 4,
TIMING_MODE_PERIODIC_PS = 5,
} __ATTRIB_PACK__HostCmd_DS_ScanagentTimingMode_e;
int process_host_cmd_resp(char *cmd_name, t_u8 *buf);
#endif /* _MLAN_SCANAGENT_H_ */

26721
mapp/mlanutl/mlanutl.c Normal file

File diff suppressed because it is too large Load diff

3994
mapp/mlanutl/mlanutl.h Normal file

File diff suppressed because it is too large Load diff

1790
mapp/mlanutl/mlanwls.c Normal file

File diff suppressed because it is too large Load diff

373
mapp/mlanutl/mlanwls.h Normal file
View file

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

413
mapp/mlanutl/timestamp.c Normal file
View file

@ -0,0 +1,413 @@
/** @file timestamp.c
*
* @brief Functions for timestamping feature
*
*
* Copyright 2011-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
#include "timestamp.h"
#include "time.h"
/* GLobal Declarations */
struct timespec send_time;
struct interface_data inter;
/**
*@brief Receive Timestamps
*
*@param argc Number of arguments
*@param argv Pointer to the arguments array
*
* @return MLAN_STATUS_SUCCESS/MLAN_STATUS_FAILURE
**/
void receive_timestamp(int argc, char *argv[])
{
int sockfd;
int sockopt;
char ifName[IFNAMSIZ];
struct ifreq if_ip; /* get ip addr */
int so_timestamping_flags = 0;
int siocgstamp = 0;
int siocgstampns = 0;
struct timeval now;
int res;
struct ifreq if_idx;
struct ifreq if_mac;
fd_set readfs, errorfs;
/* Get interface name */
if (argc > 2)
strcpy(ifName, argv[1]);
else {
fprintf(stderr,
"invalid no. of arguments to receive_timestamp \n");
exit(1);
}
/* Header structures */
so_timestamping_flags |= SOF_TIMESTAMPING_SOFTWARE;
so_timestamping_flags |= SOF_TIMESTAMPING_RAW_HARDWARE;
memset(&if_ip, 0, sizeof(struct ifreq));
/* Open PF_PACKET socket, listening for EtherType ETHER_TYPE */
if ((sockfd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_802_EX1))) ==
-1) {
perror("listener: socket");
}
/* Get the index of the interface to receive on */
memset(&if_idx, 0, sizeof(struct ifreq));
strncpy(if_idx.ifr_name, ifName, IFNAMSIZ - 1);
if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0)
perror("SIOCGIFINDEX");
/* Get the MAC address of the interface to receive on */
memset(&if_mac, 0, sizeof(struct ifreq));
strncpy(if_mac.ifr_name, ifName, IFNAMSIZ - 1);
if (ioctl(sockfd, SIOCGIFHWADDR, &if_mac) < 0)
perror("SIOCGIFHWADDR");
/* Allow the socket to be reused - incase connection is closed
* prematurely */
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &sockopt,
sizeof sockopt) == -1) {
perror("setsockopt");
close(sockfd);
exit(1);
}
/* Bind to device */
if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, ifName,
IFNAMSIZ - 1) == -1) {
perror("SO_BINDTODEVICE");
close(sockfd);
exit(1);
}
if (so_timestamping_flags &&
setsockopt(sockfd, SOL_SOCKET, SO_TIMESTAMPING,
&so_timestamping_flags,
sizeof(so_timestamping_flags)) < 0)
perror("setsockopt SO_TIMESTAMPING");
while (1) {
FD_ZERO(&readfs);
FD_ZERO(&errorfs);
FD_SET(sockfd, &readfs);
FD_SET(sockfd, &errorfs);
gettimeofday(&now, NULL);
res = select(sockfd + 1, &readfs, 0, &errorfs, NULL);
if (res > 0) {
recvpacket(sockfd, 0, siocgstamp, siocgstampns);
}
}
}
/**
*@brief Send Timestamps
*
*@param argc Number of arguments
*@param argv Pointer to the arguments array
*
*@return MLAN_STATUS_SUCCESS/MLAN_STATUS_FAILURE
**/
int send_timestamp(int argc, char *argv[])
{
int sockfd;
struct ifreq if_idx;
struct ifreq if_mac;
int tx_len = 0, i;
char sendbuf[BUF_SIZ];
char buff[BUF_SIZ];
struct ether_header *eh = (struct ether_header *)sendbuf;
struct sockaddr_ll socket_address;
char ifName[IFNAMSIZ], ip[50];
struct timeval delta;
fd_set readfs, errorfs;
int res, siocgstamp = 1, siocgstampns = 1;
int so_timestamping_flags = SOF_TIMESTAMPING_TX_HARDWARE;
struct ifreq hwtstamp;
struct hwtstamp_config hwconfig;
so_timestamping_flags |= SOF_TIMESTAMPING_RAW_HARDWARE;
so_timestamping_flags |= SOF_TIMESTAMPING_TX_HARDWARE;
so_timestamping_flags |= SOF_TIMESTAMPING_SYS_HARDWARE;
/* Get interface name */
if (argc > 4) {
strcpy(ifName, argv[1]);
strcpy(ip, argv[4]);
} else {
fprintf(stderr, "invalid no. of args for send_timestamp\n");
exit(1);
}
/* Open RAW socket to send on */
if ((sockfd = socket(PF_PACKET, SOCK_RAW, ETH_P_802_EX1)) == -1) {
perror("socket");
}
memset(&hwtstamp, 0, sizeof(hwtstamp));
strncpy(hwtstamp.ifr_name, ifName, sizeof(hwtstamp.ifr_name));
hwtstamp.ifr_data = (void *)&hwconfig;
memset(&hwconfig, 0, sizeof(hwconfig));
hwconfig.tx_type =
(so_timestamping_flags & SOF_TIMESTAMPING_TX_HARDWARE) ?
HWTSTAMP_TX_ON :
HWTSTAMP_TX_OFF;
hwconfig.rx_filter =
(so_timestamping_flags & SOF_TIMESTAMPING_RX_HARDWARE) ?
HWTSTAMP_FILTER_PTP_V1_L4_SYNC :
HWTSTAMP_FILTER_NONE;
/* Get the index of the interface to send on */
memset(&if_idx, 0, sizeof(struct ifreq));
strncpy(if_idx.ifr_name, ifName, IFNAMSIZ - 1);
if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0)
perror("SIOCGIFINDEX");
/* Get the MAC address of the interface to send on */
memset(&if_mac, 0, sizeof(struct ifreq));
strncpy(if_mac.ifr_name, ifName, IFNAMSIZ - 1);
if (ioctl(sockfd, SIOCGIFHWADDR, &if_mac) < 0)
perror("SIOCGIFHWADDR");
if (so_timestamping_flags &&
setsockopt(sockfd, SOL_SOCKET, SO_TIMESTAMPING,
&so_timestamping_flags,
sizeof(so_timestamping_flags)) < 0)
perror("setsockopt SO_TIMESTAMPING");
if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, ifName,
IFNAMSIZ - 1) == -1) {
perror("bind");
exit(1);
}
/* Construct the Ethernet header */
memset(sendbuf, 0, BUF_SIZ);
/* Ethernet header */
memcpy(eh->ether_shost, (u_int8_t *)&if_mac.ifr_hwaddr.sa_data,
MLAN_MAC_ADDR_LENGTH);
eh->ether_type = htons(ETH_P_802_EX1);
tx_len += sizeof(struct ether_header);
get_mac(ifName, ip);
for (i = 0; i < MLAN_MAC_ADDR_LENGTH; i++) {
eh->ether_dhost[i] = (uint8_t)inter.mac[i];
}
/* Index of the network device */
socket_address.sll_ifindex = if_idx.ifr_ifindex;
/* Address length*/
socket_address.sll_halen = ETH_ALEN;
memcpy(&socket_address.sll_addr, (uint8_t *)&inter.mac,
MLAN_MAC_ADDR_LENGTH);
clock_gettime(CLOCK_REALTIME, &send_time);
sprintf(buff, "%lld.%lld", (long long)send_time.tv_sec,
(long long)send_time.tv_nsec);
strcpy((sendbuf + tx_len), buff);
/* Send packet */
res = sendto(sockfd, sendbuf, tx_len + strlen(buff), 0,
(struct sockaddr *)&socket_address,
sizeof(struct sockaddr_ll));
if (res < 0)
perror("Send ");
fprintf(stdout, "Application time : %lld.%09lld (sent)\n",
(long long)send_time.tv_sec, (long long)send_time.tv_nsec);
delta.tv_sec = 5;
delta.tv_usec = 0;
FD_ZERO(&readfs);
FD_ZERO(&errorfs);
FD_SET(sockfd, &readfs);
FD_SET(sockfd, &errorfs);
res = select(sockfd + 1, &readfs, 0, &errorfs, &delta);
if (res > 0) {
recvpacket(sockfd, MSG_ERRQUEUE, siocgstamp, siocgstampns);
}
return MLAN_STATUS_SUCCESS;
}
/**
*@brief get destination mac address
*
*@param ifc interface from which packet has to be sent
*@param ip IP Address of destination
*
*@return N/A
**/
void get_mac(char *ifc, char *ip)
{
char ipAddr[20];
char hwAddr[20];
char device[10], temp[3], in[50];
int i = 0, j = 0, k = 0, res = 0, retry = 0;
FILE *arpCache = fopen("/proc/net/arp", "r");
if (!arpCache) {
fprintf(stderr,
"Arp Cache: Failed to open file \"/proc/net/arp\"");
}
/* Ignore the first line, which contains the header */
char header[ARP_FILE_BUFFER_LEN];
retry_again:
if (!fgets(header, sizeof(header), arpCache))
fprintf(stderr, "error getting mac from proc files");
while (3 == fscanf(arpCache, ARP_FORMAT, ipAddr, hwAddr, device)) {
if ((!strcmp(ipAddr, ip)) && (!strcmp(ifc, device))) {
printf("Sending Packet to Peer : %s\n", hwAddr);
strcpy(inter.ip, ipAddr);
strcpy(inter.interface, device);
while (hwAddr[i] != '\0') {
if (hwAddr[i] == ':') {
inter.mac[j++] = strtol(temp, NULL, 16);
i++;
k = 0;
} else
temp[k++] = hwAddr[i++];
}
inter.mac[j] = strtol(temp, NULL, 16);
res = 1;
}
}
if (res != 1 && retry == 0) {
sprintf(in, "ping -c 2 %s > /dev/null", ip);
system(in);
retry = 1;
rewind(arpCache);
goto retry_again;
} else if (res != 1 && retry == 1) {
printf("cannot find mac address for the specified ip\n");
fclose(arpCache);
exit(1);
}
fclose(arpCache);
}
/*
*@brief Receive Sync Packets
*
*@param sock socket from which packet must be recieved
*@param recvmsg_flags flags for recvmsg
*@param siocgstamp timestamp flag
*@param siocgstampns timestamp flag for nano secs
*
*@return N/A
**/
void recvpacket(int sock, int recvmsg_flags, int siocgstamp, int siocgstampns)
{
unsigned char data[256];
struct msghdr msg;
struct iovec entry;
struct sockaddr_in from_addr;
struct {
struct cmsghdr cm;
char control[512];
} control;
int res, i;
memset(&msg, 0, sizeof(msg));
msg.msg_iov = &entry;
msg.msg_iovlen = 1;
entry.iov_base = data;
entry.iov_len = sizeof(data);
msg.msg_name = (caddr_t)&from_addr;
msg.msg_namelen = sizeof(from_addr);
msg.msg_control = &control;
msg.msg_controllen = sizeof(control);
res = recvmsg(sock, &msg, recvmsg_flags | MSG_DONTWAIT);
if (res < 0) {
fprintf(stderr, "%s %s: %s\n", "recvmsg",
(recvmsg_flags & MSG_ERRQUEUE) ? "error" : "regular",
strerror(errno));
} else {
if (!(recvmsg_flags & MSG_ERRQUEUE)) {
printf("Received Packet from Peer : ");
for (i = 6; i < 12; i++)
printf("%02x:", data[i]);
printf("\n");
}
printpacket(&msg, res, sock, recvmsg_flags, siocgstamp,
siocgstampns);
}
}
/**
* @brief Prints Sent/Received Sync packets
*
* @param msg msghdr structure variable
* @param res result of recvmsg call
* @param sock socket variable
* @param recvmsg_flags flags for receive message
* @param siocgstamp timestamp flag
* @param siocgstampns timestamp flag for nano secs
*
* @return N/A
**/
void printpacket(struct msghdr *msg, int res, int sock, int recvmsg_flags,
int siocgstamp, int siocgstampns)
{
struct cmsghdr *cmsg;
struct timespec now;
struct timespec *stamp;
clock_gettime(CLOCK_REALTIME, &now);
if (!(recvmsg_flags & MSG_ERRQUEUE)) {
printf("Application time : %ld.%09ld (received)\n",
(long)now.tv_sec, (long)now.tv_nsec);
}
for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) {
if (cmsg->cmsg_level == SOL_SOCKET &&
cmsg->cmsg_type == SO_TIMESTAMPING) {
stamp = (struct timespec *)CMSG_DATA(cmsg);
stamp++;
/* skip deprecated HW transformed */
stamp++;
fprintf(stdout, "HW time : %ld.%09ld\n",
(long)stamp->tv_sec, (long)stamp->tv_nsec);
if (!(recvmsg_flags & MSG_ERRQUEUE))
fprintf(stdout, "Delta in nsecs= %lld\n",
((long long)(now.tv_sec -
stamp->tv_sec) *
1000000000L +
now.tv_nsec) -
(stamp->tv_nsec));
else
fprintf(stdout, "Delta in nsecs= %lld",
((long long)(stamp->tv_sec -
send_time.tv_sec) *
1000000000L +
(stamp->tv_nsec) - send_time.tv_nsec));
}
}
fprintf(stdout, "\n");
}

55
mapp/mlanutl/timestamp.h Normal file
View file

@ -0,0 +1,55 @@
/** @file timestamp.h
*
* @brief This file contains definitions used for application
*
*
* Copyright 2011-2021 NXP
*
* This software file (the File) is distributed by NXP
* under the terms of the GNU General Public License Version 2, June 1991
* (the License). You may use, redistribute and/or modify the File in
* accordance with the terms and conditions of the License, a copy of which
* is available by writing to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or on the
* worldwide web at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*
*/
#ifndef _TIMESTAMP_H_
#define _TIMESTAMP_H_
#include "mlanutl.h"
#include <linux/if_packet.h>
#include <netinet/ether.h>
#include <linux/net_tstamp.h>
#define BUF_SIZ 1024
#define ARP_FORMAT "%s %*s %*s %s %*s %s"
#define ARP_FILE_BUFFER_LEN (1024)
struct interface_data {
char ip[20];
int mac[20];
char interface[20];
};
/**
* 802.1 Local Experimental 1.
*/
#ifndef ETH_P_802_EX1
#define ETH_P_802_EX1 0x88B5
#endif
void receive_timestamp(int argc, char *argv[]);
int send_timestamp(int argc, char *argv[]);
void get_mac(char *ifc, char *ip);
void recvpacket(int sock, int recvmsg_flags, int siocgstamp, int siocgstampns);
void printpacket(struct msghdr *msg, int res, int sock, int recvmsg_flags,
int siocgstamp, int siocgstampns);
#endif //_TIMESTAMP_H_

61
mapp/uaputl/Makefile Normal file
View file

@ -0,0 +1,61 @@
# File : uaputl/Makefile
#
# Copyright 2008-2022,2025 NXP
# Path to the top directory of the wlan distribution
PATH_TO_TOP = ../..
ifeq ($(findstring IMX_ANDROID,$(ccflags-y)),IMX_ANDROID)
CC=/usr/local/arm/android-ndk-r23-beta5/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang
endif
# 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 += -Wno-error
#ECHO = @
ifeq (,$(findstring ANDROID_KERNEL, $(CFLAGS)))
LIBS=-lrt
endif
.PHONY: default tags all
OBJECTS = uaputl.o uapcmd.o uaphostcmd.o
HEADERS = uaputl.h uapcmd.h
TARGET = uaputl.exe
build appsbuild default: $(TARGET)
@cp -f $(TARGET) $(INSTALLPATH)
@cp -rf config $(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

View file

@ -0,0 +1,49 @@
/* Domain and country mapping are in this section */
/* Domain name followed by supported countries */
COUNTRY: DOMAIN_CODE_FCC AE AM AN AR AZ BH BL BN BR CL CN CR CS DZ EC EG GE HN HK ID IL IR JM JO KP KW KZ LB LK MA MO NP OM PE PG PH PK PT QA SA SG SV SY TH TT TN UY YE ZA ZW VN KR
COUNTRY: DOMAIN_CODE_FCC1 US UZ CA CO DO GT MX PA PR TW NZ BO BZ VE
COUNTRY: DOMAIN_CODE_MKK JP
COUNTRY: DOMAIN_CODE_ETSI AL AD AT AU BE BA BG HR CY CZ DK EE FI FR MK DE GB GR HU IS IE IT LV LI LT LU MT MD MC ME NL NO PL RO SM RS SI SK ES SE CH TR UA UK NE NZ DZ AO AM AW BH BD BT BO BQ BW VG BF BI KH CL KM CG CD CW EG FO GF PF GE GI GP HK IN ID IM IL JE KE XK KW LA LR MW MV MQ MR YT MA MZ MM NA NC NG OM PS PT QA RW RE BL MF VC SA SC ZA SZ SY TZ TG TN AE VA EH YE ZM ZW
COUNTRY: DOMAIN_CODE_IN IN
COUNTRY: DOMAIN_CODE_MY MY
COUNTRY: DOMAIN_CODE_MX MX
/* Domain specific sub-band information */
/* Domain name followed by set of triplets separated by comma */
/* 1st number in triplet is First channel, */
/* 2nd number in triplet is Number of channels followed from the First channel */
/* 3rd number in triplet is Max-TX-power in dbm */
DOMAIN: DOMAIN_CODE_FCC 1 13 20
DOMAIN: DOMAIN_CODE_FCC1 1 11 30
DOMAIN: DOMAIN_CODE_ETSI 1 13 20
DOMAIN: DOMAIN_CODE_MKK 1 14 23
DOMAIN: DOMAIN_CODE_IN 1 11 30
DOMAIN: DOMAIN_CODE_MY 1 13 20
DOMAIN: DOMAIN_CODE_MX 1 13 20
DOMAIN: DOMAIN_CODE_TEST 1 1 20, 2 1 16, 3 6 30, 11 1 10
DOMAIN: DOMAIN_CODE_TEST1 1 11 30, 36 1 17, 40 1 17, 44 1 17, 48 1 17, 52 1 24, 56 1 24, 60 1 24, 64 1 24, 149 1 23, 153 1 23, 157 1 23, 161 1 23, 165 1 23,
DOMAIN: DOMAIN_CODE_END
/*
* Information for channels in A Band.
*/
*** 5GHz ***
DOMAIN: DOMAIN_CODE_FCC 36 1 20, 40 1 20, 44 1 20, 48 1 20, 52 1 20, 56 1 20, 60 1 20, 64 1 20, 100 1 20, 104 1 20, 108 1 20, 112 1 20, 116 1 20, 120 1 20, 124 1 20, 128 1 20, 132 1 20, 136 1 20, 140 1 20, 144 1 20, 149 1 20, 153 1 20, 157 1 20, 161 1 20, 165 1 20,
DOMAIN: DOMAIN_CODE_FCC1 36 1 30, 40 1 30, 44 1 30, 48 1 30, 52 1 30, 56 1 30, 60 1 30, 64 1 30, 100 1 30, 104 1 30, 108 1 30, 112 1 30, 116 1 30, 120 1 30, 124 1 30, 128 1 30, 132 1 30, 136 1 30, 140 1 30, 144 1 30, 149 1 30, 153 1 30, 157 1 30, 161 1 30, 165 1 30, 169 1 30, 173 1 30, 177 1 30
DOMAIN: DOMAIN_CODE_MKK 8 1 24, 12 1 24, 16 1 24, 36 1 23, 40 1 23, 44 1 23, 48 1 23, 52 1 23, 56 1 23, 60 1 23, 64 1 23, 100 1 23, 104 1 23, 108 1 23, 112 1 23, 116 1 23, 120 1 23, 124 1 23, 128 1 23, 132 1 23, 136 1 23, 140 1 23, 144 1 23,
DOMAIN: DOMAIN_CODE_ETSI 36 1 20, 40 1 20, 44 1 20, 48 1 20, 52 1 20, 56 1 20, 60 1 20, 64 1 20, 100 1 20, 104 1 20, 108 1 20, 112 1 20, 116 1 20, 120 1 20, 124 1 20, 128 1 20, 132 1 20, 136 1 20, 140 1 20, 144 1 20, 149 1 20, 153 1 20, 157 1 20, 161 1 20, 165 1 20,
DOMAIN: DOMAIN_CODE_IN 36 1 30, 40 1 30, 44 1 30, 48 1 30, 52 1 30, 56 1 30, 60 1 30, 64 1 30, 149 1 30, 153 1 30, 157 1 30, 161 1 30, 165 1 30,
DOMAIN: DOMAIN_CODE_MY 36 1 20, 40 1 20, 44 1 20, 48 1 20, 52 1 20, 56 1 20, 60 1 20, 64 1 20, 149 1 20, 153 1 20, 157 1 20, 161 1 20, 165 1 20,
DOMAIN: DOMAIN_CODE_MX 36 1 20, 40 1 20, 44 1 20, 48 1 20, 52 1 20, 56 1 20, 60 1 20, 64 1 20, 100 1 20, 104 1 20, 108 1 20, 112 1 20, 116 1 20,132 1 20, 136 1 20, 140 1 20, 144 1 20, 149 1 20, 153 1 20, 157 1 20, 161 1 20, 165 1 20,
DOMAIN: DOMAIN_CODE_5G_END

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