drivers: mediatek: connectivity: Port modules for in-kernel building and cleanup
This commit is contained in:
parent
c3592be768
commit
4218ce9996
|
@ -421,6 +421,15 @@ config MTK_MERGE_INTERFACE_SUPPORT
|
||||||
interface is set to 'y',
|
interface is set to 'y',
|
||||||
otherwise merge interface is not used.
|
otherwise merge interface is not used.
|
||||||
|
|
||||||
|
config MTK_CONNFEM
|
||||||
|
tristate "MediaTek connfem driver"
|
||||||
|
depends on MTK_COMBO
|
||||||
|
help
|
||||||
|
This config is used to choose
|
||||||
|
if need to compile connfem folder.
|
||||||
|
Will compile connfem folder if set to 'y',
|
||||||
|
otherwise will not compile connfem folder.
|
||||||
|
|
||||||
config MTK_COMBO_CHIP_DEEP_SLEEP_SUPPORT
|
config MTK_COMBO_CHIP_DEEP_SLEEP_SUPPORT
|
||||||
depends on MTK_COMBO_CHIP_MT6632
|
depends on MTK_COMBO_CHIP_MT6632
|
||||||
default y
|
default y
|
||||||
|
|
|
@ -50,14 +50,25 @@ endif
|
||||||
ifeq ($(CONFIG_WLAN_DRV_BUILD_IN),y)
|
ifeq ($(CONFIG_WLAN_DRV_BUILD_IN),y)
|
||||||
# for gen4m options
|
# for gen4m options
|
||||||
export CONFIG_MTK_COMBO_WIFI_HIF=axi
|
export CONFIG_MTK_COMBO_WIFI_HIF=axi
|
||||||
export MTK_COMBO_CHIP=CONNAC
|
export MTK_COMBO_CHIP=CONNAC2X2_SOC5_0
|
||||||
export WLAN_CHIP_ID=6765
|
export BT_PLATFORM=6877
|
||||||
|
export WLAN_CHIP_ID=6877
|
||||||
export MTK_ANDROID_WMT=y
|
export MTK_ANDROID_WMT=y
|
||||||
|
export MTK_ANDROID_EMI=y
|
||||||
|
export WIFI_IP_SET=1
|
||||||
|
export MTK_WLAN_SERVICE=yes
|
||||||
|
export CONNAC_VER=2_0
|
||||||
|
export CFG_BUILD_CONNAC2=true
|
||||||
|
|
||||||
# Do build-in for xxx.c checking
|
# Do build-in for xxx.c checking
|
||||||
subdir-ccflags-y += -D MTK_WCN_REMOVE_KERNEL_MODULE
|
subdir-ccflags-y += -D MTK_WCN_REMOVE_KERNEL_MODULE
|
||||||
subdir-ccflags-y += -D MTK_WCN_BUILT_IN_DRIVER
|
subdir-ccflags-y += -D MTK_WCN_BUILT_IN_DRIVER
|
||||||
obj-y += wmt_drv/
|
|
||||||
obj-y += wmt_chrdev_wifi/
|
|
||||||
obj-y += wlan_drv_gen4m/
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
obj-$(CONFIG_MTK_COMBO) += conninfra/
|
||||||
|
obj-$(CONFIG_MTK_COMBO_WIFI) += wlan/adaptor/
|
||||||
|
obj-$(CONFIG_MTK_COMBO_CHIP_CONSYS_6877) += wlan/core/gen4m/
|
||||||
|
obj-$(CONFIG_MTK_BTIF) += bt/mt66xx/btif/
|
||||||
|
obj-$(CONFIG_MTK_COMBO_GPS) += gps/
|
||||||
|
obj-$(CONFIG_MTK_FMRADIO) += fmradio/
|
||||||
|
obj-$(CONFIG_MTK_CONNFEM) += connfem/
|
||||||
|
|
|
@ -67,9 +67,9 @@ ccflags-y += -D CONFIG_MP_WAKEUP_SOURCE_SYSFS_STAT=1
|
||||||
# ---------------------------------------------------
|
# ---------------------------------------------------
|
||||||
# Include Path
|
# Include Path
|
||||||
# ---------------------------------------------------
|
# ---------------------------------------------------
|
||||||
CONN_INFRA_SRC := $(TOP)/vendor/mediatek/kernel_modules/connectivity/conninfra
|
CONN_INFRA_SRC := $(srctree)/drivers/misc/mediatek/connectivity/conninfra
|
||||||
CONNFEM_SRC := $(TOP)/vendor/mediatek/kernel_modules/connectivity/connfem
|
CONNFEM_SRC := $(srctree)/drivers/misc/mediatek/connectivity/connfem
|
||||||
WMT_SRC := $(TOP)/vendor/mediatek/kernel_modules/connectivity/common
|
WMT_SRC := $(srctree)/drivers/misc/mediatek/connectivity/common
|
||||||
BTIF_SRC := $(srctree)/drivers/misc/mediatek/btif
|
BTIF_SRC := $(srctree)/drivers/misc/mediatek/btif
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/connectivity/common
|
ccflags-y += -I$(srctree)/drivers/misc/mediatek/connectivity/common
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/
|
ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/
|
||||||
|
|
|
@ -58,7 +58,7 @@ endif
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# To include BT driver dependent header file
|
# To include BT driver dependent header file
|
||||||
|
|
||||||
WMT_SRC_FOLDER := $(TOP)/vendor/mediatek/kernel_modules/connectivity/common
|
WMT_SRC_FOLDER := $(srctree)/drivers/misc/mediatek/connectivity/common
|
||||||
ccflags-y += -I$(WMT_SRC_FOLDER)/common_main/include
|
ccflags-y += -I$(WMT_SRC_FOLDER)/common_main/include
|
||||||
ccflags-y += -I$(WMT_SRC_FOLDER)/common_main/linux/include
|
ccflags-y += -I$(WMT_SRC_FOLDER)/common_main/linux/include
|
||||||
ifneq ($(CONFIG_MTK_CONNSYS_DEDICATED_LOG_PATH),)
|
ifneq ($(CONFIG_MTK_CONNSYS_DEDICATED_LOG_PATH),)
|
||||||
|
|
|
@ -88,7 +88,7 @@ ccflags-y += -I$(srctree)/drivers/gpu/drm/mediatek/mediatek_v2
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
ccflags-y += -Werror $(call cc-disable-warning,unused-but-set-variable)
|
ccflags-y += $(call cc-disable-warning,unused-but-set-variable)
|
||||||
|
|
||||||
ifeq ($(CONFIG_MTK_COMBO_CHIP_MT6628),y)
|
ifeq ($(CONFIG_MTK_COMBO_CHIP_MT6628),y)
|
||||||
ccflags-y += -D MT6628
|
ccflags-y += -D MT6628
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
# Copyright (c) 2021 Mediatek Inc.
|
# Copyright (c) 2021 Mediatek Inc.
|
||||||
|
|
||||||
|
CFG_FM_CHIP := mt6635
|
||||||
|
CFG_FM_PLAT := connac2x
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Necessary Check
|
# Necessary Check
|
||||||
|
|
||||||
|
@ -154,13 +157,13 @@ $(FM_CHIP)-objs += core/fm_module.o \
|
||||||
core/fm_reg_utils.o
|
core/fm_reg_utils.o
|
||||||
|
|
||||||
ifeq ($(CFG_BUILD_CONNAC2), true)
|
ifeq ($(CFG_BUILD_CONNAC2), true)
|
||||||
CONNINFRA_SRC_FOLDER := $(TOP)/vendor/mediatek/kernel_modules/connectivity/conninfra
|
CONNINFRA_SRC_FOLDER := $(srctree)/drivers/misc/mediatek/connectivity/conninfra
|
||||||
|
|
||||||
ccflags-y += -I$(CONNINFRA_SRC_FOLDER)/include
|
ccflags-y += -I$(CONNINFRA_SRC_FOLDER)/include
|
||||||
ccflags-y += -DCFG_FM_CONNAC2=1
|
ccflags-y += -DCFG_FM_CONNAC2=1
|
||||||
$(FM_CHIP)-objs += plat/conn_infra.o
|
$(FM_CHIP)-objs += plat/conn_infra.o
|
||||||
else
|
else
|
||||||
WMT_SRC_FOLDER := $(TOP)/vendor/mediatek/kernel_modules/connectivity/common
|
WMT_SRC_FOLDER := $(srctree)/drivers/misc/mediatek/connectivity/common
|
||||||
WMT_INCLUDE_PATH := common_main
|
WMT_INCLUDE_PATH := common_main
|
||||||
|
|
||||||
ccflags-y += -I$(WMT_SRC_FOLDER)/$(WMT_INCLUDE_PATH)/include \
|
ccflags-y += -I$(WMT_SRC_FOLDER)/$(WMT_INCLUDE_PATH)/include \
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Necessary Check
|
# Necessary Check
|
||||||
|
|
||||||
|
CFG_FM_CHIP := mt6635
|
||||||
|
|
||||||
ifneq ($(KERNEL_OUT),)
|
ifneq ($(KERNEL_OUT),)
|
||||||
ccflags-y += -imacros $(KERNEL_OUT)/include/generated/autoconf.h
|
ccflags-y += -imacros $(KERNEL_OUT)/include/generated/autoconf.h
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -72,7 +72,7 @@ GPS_DRV_CONTROL_LNA := n
|
||||||
GPS_DL_SUPPORT := n
|
GPS_DL_SUPPORT := n
|
||||||
GPS_DL_HAS_MOCK := n
|
GPS_DL_HAS_MOCK := n
|
||||||
GPS_DL_HAS_CONNINFRA_DRV := n
|
GPS_DL_HAS_CONNINFRA_DRV := n
|
||||||
GPS_SRC_FOLDER := $(TOP)/vendor/mediatek/kernel_modules/connectivity/gps
|
GPS_SRC_FOLDER := $(srctree)/drivers/misc/mediatek/connectivity/gps
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_MTK_PROJECT),"k6833v1_64_swrgo")
|
ifeq ($(CONFIG_ARCH_MTK_PROJECT),"k6833v1_64_swrgo")
|
||||||
ccflags-y += -DCONFIG_GPSL5_SUPPORT
|
ccflags-y += -DCONFIG_GPSL5_SUPPORT
|
||||||
|
@ -132,7 +132,7 @@ ccflags-y += -I$(GPS_SRC_FOLDER)/data_link/plat/$(GPS_DL_PLATFORM)
|
||||||
ccflags-y += -I$(GPS_SRC_FOLDER)/data_link/plat/$(GPS_DL_PLATFORM)/inc
|
ccflags-y += -I$(GPS_SRC_FOLDER)/data_link/plat/$(GPS_DL_PLATFORM)/inc
|
||||||
ccflags-y += -I$(GPS_SRC_FOLDER)/data_link/plat/$(GPS_DL_PLATFORM)/hw/inc
|
ccflags-y += -I$(GPS_SRC_FOLDER)/data_link/plat/$(GPS_DL_PLATFORM)/hw/inc
|
||||||
ifeq ($(GPS_DL_HAS_CONNINFRA_DRV),y)
|
ifeq ($(GPS_DL_HAS_CONNINFRA_DRV),y)
|
||||||
CONNINFRA_SRC_FOLDER := $(TOP)/vendor/mediatek/kernel_modules/connectivity/conninfra
|
CONNINFRA_SRC_FOLDER := $(srctree)/drivers/misc/mediatek/connectivity/conninfra
|
||||||
ccflags-y += -I$(CONNINFRA_SRC_FOLDER)/include
|
ccflags-y += -I$(CONNINFRA_SRC_FOLDER)/include
|
||||||
ccflags-y += -I$(CONNINFRA_SRC_FOLDER)/debug_utility/metlog
|
ccflags-y += -I$(CONNINFRA_SRC_FOLDER)/debug_utility/metlog
|
||||||
ccflags-y += -DGPS_DL_HAS_CONNINFRA_DRV=1
|
ccflags-y += -DGPS_DL_HAS_CONNINFRA_DRV=1
|
||||||
|
@ -206,7 +206,7 @@ ccflags-y += -DGPS_DL_HAS_MOCK=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
else #Legacy drivers
|
else #Legacy drivers
|
||||||
WMT_SRC_FOLDER := $(TOP)/vendor/mediatek/kernel_modules/connectivity/common
|
WMT_SRC_FOLDER := $(srctree)/drivers/misc/mediatek/connectivity/common
|
||||||
|
|
||||||
ifeq ($(CONFIG_MTK_COMBO_CHIP),)
|
ifeq ($(CONFIG_MTK_COMBO_CHIP),)
|
||||||
ifneq ($(filter "y",$(CONFIG_MTK_COMBO_CHIP_MT6620) $(CONFIG_MTK_COMBO_CHIP_MT6628) $(CONFIG_MTK_COMBO_CHIP_MT6630) $(CONFIG_MTK_COMBO_CHIP_MT6632) $(CONFIG_MTK_COMBO_CHIP_MT7668)),)
|
ifneq ($(filter "y",$(CONFIG_MTK_COMBO_CHIP_MT6620) $(CONFIG_MTK_COMBO_CHIP_MT6628) $(CONFIG_MTK_COMBO_CHIP_MT6630) $(CONFIG_MTK_COMBO_CHIP_MT6632) $(CONFIG_MTK_COMBO_CHIP_MT7668)),)
|
||||||
|
|
|
@ -66,14 +66,14 @@ obj-m += $(MODULE_NAME).o
|
||||||
|
|
||||||
GPS_DRV_CONTROL_LNA := n
|
GPS_DRV_CONTROL_LNA := n
|
||||||
GPS_DL_HAS_MOCK := n
|
GPS_DL_HAS_MOCK := n
|
||||||
GPS_SRC_FOLDER := $(TOP)/vendor/mediatek/kernel_modules/connectivity/gps/data_link
|
GPS_SRC_FOLDER := $(srctree)/drivers/misc/mediatek/connectivity/gps/data_link
|
||||||
ccflags-y += -DMTK_GENERIC_HAL
|
ccflags-y += -DMTK_GENERIC_HAL
|
||||||
|
|
||||||
ccflags-y += -I$(GPS_SRC_FOLDER)/plat/$(GPS_PLATFORM)
|
ccflags-y += -I$(GPS_SRC_FOLDER)/plat/$(GPS_PLATFORM)
|
||||||
ccflags-y += -I$(GPS_SRC_FOLDER)/plat/$(GPS_PLATFORM)/inc
|
ccflags-y += -I$(GPS_SRC_FOLDER)/plat/$(GPS_PLATFORM)/inc
|
||||||
ccflags-y += -I$(GPS_SRC_FOLDER)/plat/$(GPS_PLATFORM)/hw/inc
|
ccflags-y += -I$(GPS_SRC_FOLDER)/plat/$(GPS_PLATFORM)/hw/inc
|
||||||
|
|
||||||
CONNINFRA_SRC_FOLDER := $(TOP)/vendor/mediatek/kernel_modules/connectivity/conninfra
|
CONNINFRA_SRC_FOLDER := $(srctree)/drivers/misc/mediatek/connectivity/conninfra
|
||||||
ccflags-y += -I$(CONNINFRA_SRC_FOLDER)/include
|
ccflags-y += -I$(CONNINFRA_SRC_FOLDER)/include
|
||||||
ccflags-y += -I$(CONNINFRA_SRC_FOLDER)/debug_utility/metlog
|
ccflags-y += -I$(CONNINFRA_SRC_FOLDER)/debug_utility/metlog
|
||||||
ccflags-y += -DGPS_DL_HAS_CONNINFRA_DRV=1
|
ccflags-y += -DGPS_DL_HAS_CONNINFRA_DRV=1
|
||||||
|
|
|
@ -65,12 +65,12 @@ MODULE_NAME := gps_drv_stp
|
||||||
obj-m += $(MODULE_NAME).o
|
obj-m += $(MODULE_NAME).o
|
||||||
|
|
||||||
GPS_DRV_CONTROL_LNA := y
|
GPS_DRV_CONTROL_LNA := y
|
||||||
GPS_SRC_FOLDER := $(TOP)/vendor/mediatek/kernel_modules/connectivity/gps/gps_stp
|
GPS_SRC_FOLDER := $(srctree)/drivers/misc/mediatek/connectivity/gps/gps_stp
|
||||||
ccflags-y += -DMTK_GENERIC_HAL
|
ccflags-y += -DMTK_GENERIC_HAL
|
||||||
ccflags-y += -DCONFIG_GPSL5_SUPPORT
|
ccflags-y += -DCONFIG_GPSL5_SUPPORT
|
||||||
ccflags-y += -DCONFIG_MTK_GPS_EMI
|
ccflags-y += -DCONFIG_MTK_GPS_EMI
|
||||||
|
|
||||||
WMT_SRC_FOLDER := $(TOP)/vendor/mediatek/kernel_modules/connectivity/common
|
WMT_SRC_FOLDER := $(srctree)/drivers/misc/mediatek/connectivity/common
|
||||||
ccflags-y += -DSOC_CO_CLOCK_FLAG=1
|
ccflags-y += -DSOC_CO_CLOCK_FLAG=1
|
||||||
ccflags-y += -DWMT_CREATE_NODE_DYNAMIC=1
|
ccflags-y += -DWMT_CREATE_NODE_DYNAMIC=1
|
||||||
ccflags-y += -DREMOVE_MK_NODE=0
|
ccflags-y += -DREMOVE_MK_NODE=0
|
||||||
|
|
|
@ -9,25 +9,27 @@ ifndef TOP
|
||||||
TOP := $(srctree)/..
|
TOP := $(srctree)/..
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
MODULE_NAME := wmt_chrdev_wifi
|
||||||
|
|
||||||
# Force build fail on modpost warning
|
# Force build fail on modpost warning
|
||||||
KBUILD_MODPOST_FAIL_ON_WARNINGS := y
|
KBUILD_MODPOST_FAIL_ON_WARNINGS := y
|
||||||
|
|
||||||
ccflags-y += \
|
ccflags-y += \
|
||||||
-I$(srctree)/drivers/misc/mediatek/include/mt-plat \
|
-I$(srctree)/drivers/misc/mediatek/include/mt-plat \
|
||||||
-I$(TOP)/vendor/mediatek/kernel_modules/connectivity/common/common_main/include \
|
-I$(srctree)/drivers/misc/mediatek/connectivity/common/common_main/include \
|
||||||
-I$(TOP)/vendor/mediatek/kernel_modules/connectivity/common/common_main/linux/include
|
-I$(srctree)/drivers/misc/mediatek/connectivity/common/common_main/linux/include
|
||||||
|
|
||||||
ifeq ($(CONNAC_VER), 2_0)
|
ifeq ($(CONNAC_VER), 2_0)
|
||||||
ccflags-y += -I$(TOP)/vendor/mediatek/kernel_modules/connectivity/conninfra/include
|
ccflags-y += -I$(srctree)/drivers/misc/mediatek/connectivity/conninfra/include
|
||||||
ccflags-y += -I$(TOP)/vendor/mediatek/kernel_modules/connectivity/conninfra/debug_utility
|
ccflags-y += -I$(srctree)/drivers/misc/mediatek/connectivity/conninfra/debug_utility
|
||||||
ccflags-y += -I$(TOP)/vendor/mediatek/kernel_modules/connectivity/conninfra/debug_utility/include
|
ccflags-y += -I$(srctree)/drivers/misc/mediatek/connectivity/conninfra/debug_utility/include
|
||||||
ccflags-y += -I$(TOP)/vendor/mediatek/kernel_modules/connectivity/conninfra/debug_utility/connsyslog
|
ccflags-y += -I$(srctree)/drivers/misc/mediatek/connectivity/conninfra/debug_utility/connsyslog
|
||||||
ccflags-y += -I$(TOP)/vendor/mediatek/kernel_modules/connectivity/conninfra/debug_utility/coredump
|
ccflags-y += -I$(srctree)/drivers/misc/mediatek/connectivity/conninfra/debug_utility/coredump
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(CONFIG_MTK_CONNSYS_DEDICATED_LOG_PATH),)
|
ifneq ($(CONFIG_MTK_CONNSYS_DEDICATED_LOG_PATH),)
|
||||||
ccflags-y += -DCONFIG_MTK_CONNSYS_DEDICATED_LOG_PATH
|
ccflags-y += -DCONFIG_MTK_CONNSYS_DEDICATED_LOG_PATH
|
||||||
ccflags-y += -I$(TOP)/vendor/mediatek/kernel_modules/connectivity/common/debug_utility
|
ccflags-y += -I$(srctree)/drivers/misc/mediatek/connectivity/common/debug_utility
|
||||||
ccflags-y += -I$(src)/include
|
ccflags-y += -I$(src)/include
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
LOCAL_PATH := $(call my-dir)
|
|
||||||
|
|
||||||
ifeq ($(MTK_WLAN_SUPPORT), yes)
|
|
||||||
|
|
||||||
# to decide using which generation wlan driver is in wlan_product_package.mk
|
|
||||||
# (gen2/gen3/gen4/connac/...)
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_MODULE := wlan_drv_gen2.ko
|
|
||||||
LOCAL_PROPRIETARY_MODULE := true
|
|
||||||
LOCAL_MODULE_OWNER := mtk
|
|
||||||
LOCAL_REQUIRED_MODULES := wmt_chrdev_wifi.ko
|
|
||||||
include $(MTK_KERNEL_MODULE)
|
|
||||||
|
|
||||||
endif
|
|
|
@ -1,361 +0,0 @@
|
||||||
MTK_PLATFORM := $(subst ",,$(CONFIG_MTK_PLATFORM))
|
|
||||||
###############################################################################
|
|
||||||
# Necessary Check
|
|
||||||
|
|
||||||
ifneq ($(KERNEL_OUT),)
|
|
||||||
ccflags-y += -imacros $(KERNEL_OUT)/include/generated/autoconf.h
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MTK_COMBO_CHIP),)
|
|
||||||
$(error CONFIG_MTK_COMBO_CHIP not defined)
|
|
||||||
endif
|
|
||||||
|
|
||||||
#Force to m
|
|
||||||
export CONFIG_MTK_COMBO_WIFI=m
|
|
||||||
|
|
||||||
# Force build fail on modpost warning
|
|
||||||
KBUILD_MODPOST_FAIL_ON_WARNINGS := y
|
|
||||||
###############################################################################
|
|
||||||
|
|
||||||
# Driver Configure
|
|
||||||
CONFIG_MTK_COMBO_WIFI_HIF=sdio
|
|
||||||
CONFIG_MTK_WIFI_ONLY=n
|
|
||||||
|
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/include
|
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include
|
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/$(MTK_PLATFORM)
|
|
||||||
|
|
||||||
DRIVER_BUILD_DATE=$(shell date +%Y%m%d%H%M%S)
|
|
||||||
ccflags-y += -DDRIVER_BUILD_DATE='"$(DRIVER_BUILD_DATE)"'
|
|
||||||
|
|
||||||
# ---------------------------------------------------
|
|
||||||
# Compile Options
|
|
||||||
# ---------------------------------------------------
|
|
||||||
ccflags-y += -DLINUX -DMT6628
|
|
||||||
|
|
||||||
ccflags-y += -DCFG_SUPPORT_WIFI_FW_LOG_UI=1
|
|
||||||
|
|
||||||
ccflags-y += -DCFG_SUPPORT_AGPS_ASSIST=1
|
|
||||||
ccflags-y += -DCFG_SUPPORT_TSF_USING_BOOTTIME=1
|
|
||||||
ccflags-y += -DCFG_P2P_LEGACY_COEX_REVISE=1
|
|
||||||
ccflags-y += -DARP_MONITER_ENABLE=1
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MTK_CONN_LTE_IDC_SUPPORT), y)
|
|
||||||
ccflags-y += -DWMT_IDC_SUPPORT=1
|
|
||||||
else
|
|
||||||
ccflags-y += -DWMT_IDC_SUPPORT=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MTK_WIFI_MCC_SUPPORT), y)
|
|
||||||
ccflags-y += -DCFG_SUPPORT_MCC=1
|
|
||||||
else
|
|
||||||
ccflags-y += -DCFG_SUPPORT_MCC=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_HAVE_XLOG_FEATURE), y)
|
|
||||||
ccflags-y += -DCFG_SUPPORT_XLOG=1
|
|
||||||
else
|
|
||||||
ccflags-y += -DCFG_SUPPORT_XLOG=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MTK_AEE_FEATURE), y)
|
|
||||||
ccflags-y += -DCFG_SUPPORT_AEE=1
|
|
||||||
else
|
|
||||||
ccflags-y += -DCFG_SUPPORT_AEE=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
#ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF_SDIO1), y)
|
|
||||||
# ccflags-y += -D_HIF_SDIO=1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MTK_PASSPOINT_R2_SUPPORT), y)
|
|
||||||
ccflags-y += -DCFG_SUPPORT_HOTSPOT_2_0=1
|
|
||||||
ccflags-y += -DCFG_HS20_DEBUG=1
|
|
||||||
ccflags-y += -DCFG_ENABLE_GTK_FRAME_FILTER=1
|
|
||||||
else
|
|
||||||
ccflags-y += -DCFG_SUPPORT_HOTSPOT_2_0=0
|
|
||||||
ccflags-y += -DCFG_HS20_DEBUG=0
|
|
||||||
ccflags-y += -DCFG_ENABLE_GTK_FRAME_FILTER=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
MTK_MET_PROFILING_SUPPORT = yes
|
|
||||||
ifeq ($(MTK_MET_PROFILING_SUPPORT), yes)
|
|
||||||
ccflags-y += -DCFG_SUPPORT_MET_PROFILING=1
|
|
||||||
else
|
|
||||||
ccflags-y += -DCFG_SUPPORT_MET_PROFILING=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MTK_TC1_FEATURE), y)
|
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/tc1_interface
|
|
||||||
ccflags-y += -DCFG_TC1_FEATURE=1
|
|
||||||
ccflags-y += -DCFG_SUPPORT_CFG_FILE=1
|
|
||||||
else
|
|
||||||
ccflags-y += -DCFG_TC1_FEATURE=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MTK_TC10_FEATURE), y)
|
|
||||||
ccflags-y += -DCFG_TC10_FEATURE=1
|
|
||||||
ccflags-y += -DCFG_SKIP_MAC_INFO_CHECK
|
|
||||||
else
|
|
||||||
ccflags-y += -DCFG_TC10_FEATURE=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
MTK_SRAM_SIZE_OPTION=0
|
|
||||||
ifeq ($(CONFIG_ARCH_MT6755), y)
|
|
||||||
MTK_SRAM_SIZE_OPTION=2
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_MACH_MT6757), y)
|
|
||||||
MTK_SRAM_SIZE_OPTION=2
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_ARCH_MT6735), y)
|
|
||||||
MTK_SRAM_SIZE_OPTION=1
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_ARCH_MT6735M), y)
|
|
||||||
MTK_SRAM_SIZE_OPTION=1
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_MACH_MT6739), y)
|
|
||||||
MTK_SRAM_SIZE_OPTION=2
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_ARCH_MT6753), y)
|
|
||||||
MTK_SRAM_SIZE_OPTION=1
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_MACH_MT6763), y)
|
|
||||||
MTK_SRAM_SIZE_OPTION=2
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_ARCH_MT6580), y)
|
|
||||||
MTK_SRAM_SIZE_OPTION=1
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_ARCH_MT6570), y)
|
|
||||||
MTK_SRAM_SIZE_OPTION=1
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_ARCH_MT8163), y)
|
|
||||||
MTK_SRAM_SIZE_OPTION=1
|
|
||||||
endif
|
|
||||||
ifeq ($(CONFIG_ARCH_MT8167), y)
|
|
||||||
MTK_SRAM_SIZE_OPTION=2
|
|
||||||
endif
|
|
||||||
ccflags-y += -DCFG_SRAM_SIZE_OPTION=$(MTK_SRAM_SIZE_OPTION)
|
|
||||||
|
|
||||||
ifeq ($(strip $(TRUSTONIC_TEE_SUPPORT)),yes)
|
|
||||||
ifeq ($(strip $(MTK_TEE_CCCI_SECURE_SHARE_MEM_SUPPORT)),yes)
|
|
||||||
ccflags-y += -DTRUSTONIC_TEE_SUPPORT
|
|
||||||
ccflags-y += -DMTK_TEE_CCCI_SECURE_SHARE_MEM_SUPPORT
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ccflags-y += -D_HIF_SDIO=1
|
|
||||||
|
|
||||||
ccflags-y += -DDBG=0
|
|
||||||
ccflags-y += -I$(src)/os -I$(src)/os/linux/include -I$(src)/os/linux/hif/ahb/include
|
|
||||||
ccflags-y += -I$(src)/include -I$(src)/include/nic -I$(src)/include/mgmt
|
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/include/
|
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/base/power/$(MTK_PLATFORM)/
|
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/emi/submodule
|
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/emi/$(MTK_PLATFORM)
|
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/connectivity/common
|
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat
|
|
||||||
ccflags-y += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include/mach/
|
|
||||||
ccflags-y += -I$(src)/../../../common/common_main/include
|
|
||||||
ccflags-y += -I$(src)/../../../common/common_main/linux/include
|
|
||||||
ccflags-y += -DMTK_WCN_WMT_STP_EXP_SYMBOL_ABSTRACT
|
|
||||||
|
|
||||||
MODULE_NAME := wlan_drv_gen2
|
|
||||||
#obj-$(CONFIG_MTK_COMBO_WIFI) += $(MODULE_NAME).o
|
|
||||||
|
|
||||||
#if CONFIG_MTK_COMBO_WIFI=m ==> obj-m means ko module, not build in obj-y
|
|
||||||
obj-m += $(MODULE_NAME).o
|
|
||||||
|
|
||||||
# ---------------------------------------------------
|
|
||||||
# Directory List
|
|
||||||
# ---------------------------------------------------
|
|
||||||
COMMON_DIR := common/
|
|
||||||
OS_DIR := os/linux/
|
|
||||||
HIF_DIR := os/linux/hif/ahb/
|
|
||||||
NIC_DIR := nic/
|
|
||||||
MGMT_DIR := mgmt/
|
|
||||||
FWCFG_DIR := $(srctree)/drivers/misc/mediatek/connectivity/wlan/gen2/$(MTK_PROJECT)/
|
|
||||||
DMA_DIR := ../../../../platform/$(call lc,$(MTK_PLATFORM))/kernel/drivers/wifi/
|
|
||||||
PLAT_DIR := os/linux/plat/$(MTK_PLATFORM)/
|
|
||||||
HIF_AHB_PDMA := $(HIF_DIR)$(MTK_PLATFORM)/
|
|
||||||
#$(call lc,$(MTK_PLATFORM))
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------
|
|
||||||
# Objects List
|
|
||||||
# ---------------------------------------------------
|
|
||||||
|
|
||||||
COMMON_OBJS := $(COMMON_DIR)dump.o \
|
|
||||||
$(COMMON_DIR)wlan_lib.o \
|
|
||||||
$(COMMON_DIR)wlan_oid.o \
|
|
||||||
$(COMMON_DIR)wlan_bow.o \
|
|
||||||
$(COMMON_DIR)debug.o
|
|
||||||
|
|
||||||
NIC_OBJS := $(NIC_DIR)nic.o \
|
|
||||||
$(NIC_DIR)nic_tx.o \
|
|
||||||
$(NIC_DIR)nic_rx.o \
|
|
||||||
$(NIC_DIR)nic_pwr_mgt.o \
|
|
||||||
$(NIC_DIR)cmd_buf.o \
|
|
||||||
$(NIC_DIR)que_mgt.o \
|
|
||||||
$(NIC_DIR)nic_cmd_event.o
|
|
||||||
|
|
||||||
OS_OBJS := $(OS_DIR)gl_init.o \
|
|
||||||
$(OS_DIR)gl_kal.o \
|
|
||||||
$(OS_DIR)gl_bow.o \
|
|
||||||
$(OS_DIR)gl_wext.o \
|
|
||||||
$(OS_DIR)gl_wext_priv.o \
|
|
||||||
$(OS_DIR)gl_rst.o \
|
|
||||||
$(OS_DIR)gl_cfg80211.o \
|
|
||||||
$(OS_DIR)gl_vendor.o \
|
|
||||||
$(OS_DIR)platform.o \
|
|
||||||
$(OS_DIR)gl_sys.o \
|
|
||||||
$(OS_DIR)gl_proc.o
|
|
||||||
|
|
||||||
MGMT_OBJS := $(MGMT_DIR)ais_fsm.o \
|
|
||||||
$(MGMT_DIR)aaa_fsm.o \
|
|
||||||
$(MGMT_DIR)assoc.o \
|
|
||||||
$(MGMT_DIR)auth.o \
|
|
||||||
$(MGMT_DIR)bss.o \
|
|
||||||
$(MGMT_DIR)cnm.o \
|
|
||||||
$(MGMT_DIR)cnm_timer.o \
|
|
||||||
$(MGMT_DIR)cnm_mem.o \
|
|
||||||
$(MGMT_DIR)hem_mbox.o \
|
|
||||||
$(MGMT_DIR)mib.o \
|
|
||||||
$(MGMT_DIR)privacy.o \
|
|
||||||
$(MGMT_DIR)rate.o \
|
|
||||||
$(MGMT_DIR)rlm.o \
|
|
||||||
$(MGMT_DIR)rlm_domain.o \
|
|
||||||
$(MGMT_DIR)rlm_obss.o \
|
|
||||||
$(MGMT_DIR)rlm_protection.o \
|
|
||||||
$(MGMT_DIR)rsn.o \
|
|
||||||
$(MGMT_DIR)saa_fsm.o \
|
|
||||||
$(MGMT_DIR)scan.o \
|
|
||||||
$(MGMT_DIR)scan_fsm.o \
|
|
||||||
$(MGMT_DIR)sec_fsm.o \
|
|
||||||
$(MGMT_DIR)swcr.o \
|
|
||||||
$(MGMT_DIR)swcr.o \
|
|
||||||
$(MGMT_DIR)roaming_fsm.o \
|
|
||||||
$(MGMT_DIR)hs20.o \
|
|
||||||
$(MGMT_DIR)wnm.o \
|
|
||||||
$(MGMT_DIR)qosmap.o \
|
|
||||||
|
|
||||||
# ---------------------------------------------------
|
|
||||||
# TDLS Objects List
|
|
||||||
# ---------------------------------------------------
|
|
||||||
MGMT_OBJS += $(MGMT_DIR)tdls.o \
|
|
||||||
$(MGMT_DIR)tdls_com.o
|
|
||||||
|
|
||||||
# ---------------------------------------------------
|
|
||||||
# STATS Objects List
|
|
||||||
# ---------------------------------------------------
|
|
||||||
MGMT_OBJS += $(MGMT_DIR)stats.o
|
|
||||||
|
|
||||||
# ---------------------------------------------------
|
|
||||||
# P2P Objects List
|
|
||||||
# ---------------------------------------------------
|
|
||||||
|
|
||||||
COMMON_OBJS += $(COMMON_DIR)wlan_p2p.o
|
|
||||||
|
|
||||||
NIC_OBJS += $(NIC_DIR)p2p_nic.o
|
|
||||||
|
|
||||||
OS_OBJS += $(OS_DIR)gl_p2p.o \
|
|
||||||
$(OS_DIR)gl_p2p_cfg80211.o \
|
|
||||||
$(OS_DIR)gl_p2p_init.o \
|
|
||||||
$(OS_DIR)gl_p2p_kal.o
|
|
||||||
|
|
||||||
MGMT_OBJS += $(MGMT_DIR)p2p_assoc.o \
|
|
||||||
$(MGMT_DIR)p2p_bss.o \
|
|
||||||
$(MGMT_DIR)p2p_fsm.o \
|
|
||||||
$(MGMT_DIR)p2p_func.o \
|
|
||||||
$(MGMT_DIR)p2p_rlm.o \
|
|
||||||
$(MGMT_DIR)p2p_rlm_obss.o \
|
|
||||||
$(MGMT_DIR)p2p_scan.o \
|
|
||||||
$(MGMT_DIR)p2p_ie.o \
|
|
||||||
$(MGMT_DIR)p2p_state.o \
|
|
||||||
$(MGMT_DIR)wnm.o \
|
|
||||||
$(MGMT_DIR)wmm.o
|
|
||||||
|
|
||||||
MGMT_OBJS += $(MGMT_DIR)wapi.o
|
|
||||||
|
|
||||||
ifeq ($(WLAN_PROC), y)
|
|
||||||
OS_OBJS += gl_proc.o
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_MT7623), y)
|
|
||||||
HIF_AHB_PDMA = $(HIF_DIR)mt8127/
|
|
||||||
endif
|
|
||||||
HIF_OBJS := $(HIF_DIR)arm.o \
|
|
||||||
$(HIF_DIR)ahb.o \
|
|
||||||
$(HIF_AHB_PDMA)ahb_pdma.o
|
|
||||||
ifeq ($(CONFIG_ARCH_MT6755), y)
|
|
||||||
PLAT_OBJS := $(PLAT_DIR)plat_priv.o
|
|
||||||
$(MODULE_NAME)-objs += $(PLAT_OBJS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MACH_MT6757), y)
|
|
||||||
PLAT_OBJS := $(PLAT_DIR)plat_priv.o
|
|
||||||
$(MODULE_NAME)-objs += $(PLAT_OBJS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_MT6570), y)
|
|
||||||
PLAT_OBJS := $(PLAT_DIR)plat_priv.o
|
|
||||||
$(MODULE_NAME)-objs += $(PLAT_OBJS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_MT6735), y)
|
|
||||||
PLAT_OBJS := $(PLAT_DIR)plat_priv.o
|
|
||||||
$(MODULE_NAME)-objs += $(PLAT_OBJS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_MT6735M), y)
|
|
||||||
PLAT_OBJS := $(PLAT_DIR)plat_priv.o
|
|
||||||
$(MODULE_NAME)-objs += $(PLAT_OBJS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MACH_MT6735M), y)
|
|
||||||
PLAT_OBJS := $(PLAT_DIR)plat_priv.o
|
|
||||||
$(MODULE_NAME)-objs += $(PLAT_OBJS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MACH_MT6763), y)
|
|
||||||
PLAT_OBJS := $(PLAT_DIR)plat_priv.o
|
|
||||||
$(MODULE_NAME)-objs += $(PLAT_OBJS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_MACH_MT6739), y)
|
|
||||||
PLAT_OBJS := $(PLAT_DIR)plat_priv.o
|
|
||||||
$(MODULE_NAME)-objs += $(PLAT_OBJS)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------
|
|
||||||
# FW customization
|
|
||||||
# ---------------------------------------------------
|
|
||||||
FW_CUSTOMIZATION = y
|
|
||||||
ifeq ($(FW_CUSTOMIZATION), y)
|
|
||||||
ifneq ($(wildcard $(FWCFG_DIR)fw_config.c),)
|
|
||||||
COMMON_OBJS += $(MTK_PROJECT)/fw_config.o
|
|
||||||
endif
|
|
||||||
COMMON_OBJS += $(COMMON_DIR)fwcfg.o
|
|
||||||
ccflags-y += -DFW_CFG_SUPPORT
|
|
||||||
ccflags-y += -DENABLED_IN_ENGUSERDEBUG
|
|
||||||
endif
|
|
||||||
# ---------------------------------------------------
|
|
||||||
# WLAN Parse BUILD VARINAT
|
|
||||||
# ---------------------------------------------------
|
|
||||||
ifeq ($(TARGET_BUILD_VARIANT), eng)
|
|
||||||
ccflags-y += -DWLAN_ENG_LOAD
|
|
||||||
endif
|
|
||||||
ifeq ($(TARGET_BUILD_VARIANT), userdebug)
|
|
||||||
ccflags-y += -DWLAN_USERDEBUG_LOAD
|
|
||||||
endif
|
|
||||||
ifeq ($(TARGET_BUILD_VARIANT), user)
|
|
||||||
ccflags-y += -DWLAN_USER_LOAD
|
|
||||||
endif
|
|
||||||
# ---------------------------------------------------
|
|
||||||
|
|
||||||
$(MODULE_NAME)-objs += $(COMMON_OBJS)
|
|
||||||
$(MODULE_NAME)-objs += $(NIC_OBJS)
|
|
||||||
$(MODULE_NAME)-objs += $(OS_OBJS)
|
|
||||||
$(MODULE_NAME)-objs += $(HIF_OBJS)
|
|
||||||
$(MODULE_NAME)-objs += $(MGMT_OBJS)
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
Wlan gen2 driver - kernel modules move out of kernel tree
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,357 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#include "precomp.h"
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*!
|
|
||||||
* \brief This routine is called to dump a segment of memory in bytes.
|
|
||||||
*
|
|
||||||
* \param[in] pucStartAddr Pointer to the starting address of the memory to be dumped.
|
|
||||||
* \param[in] u4Length Length of the memory to be dumped.
|
|
||||||
*
|
|
||||||
* \return (none)
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
#define BUF_MSG_LENGTH 1024
|
|
||||||
|
|
||||||
VOID dumpMemory8IEOneLine(IN PUINT_8 aucBSSID, IN PUINT_8 pucStartAddr, IN UINT_32 u4Length)
|
|
||||||
{
|
|
||||||
UINT_8 pucMsg[BUF_MSG_LENGTH];
|
|
||||||
UINT_32 offsetMsg;
|
|
||||||
UINT_32 i;
|
|
||||||
|
|
||||||
ASSERT(pucStartAddr);
|
|
||||||
|
|
||||||
kalMemZero(pucMsg, BUF_MSG_LENGTH);
|
|
||||||
offsetMsg = 0;
|
|
||||||
|
|
||||||
offsetMsg += kalSnprintf(pucMsg + offsetMsg, BUF_MSG_LENGTH - offsetMsg, "[%pM],Len:%u:[", aucBSSID, u4Length);
|
|
||||||
|
|
||||||
if (u4Length > CFG_IE_BUFFER_SIZE)
|
|
||||||
u4Length = CFG_IE_BUFFER_SIZE;
|
|
||||||
|
|
||||||
for (i = 0 ; i < u4Length ; i++)
|
|
||||||
offsetMsg += kalSnprintf(pucMsg + offsetMsg, BUF_MSG_LENGTH - offsetMsg, "%02x,", pucStartAddr[i]);
|
|
||||||
|
|
||||||
offsetMsg += kalSnprintf(pucMsg + offsetMsg, BUF_MSG_LENGTH - offsetMsg, "%s", "]");
|
|
||||||
|
|
||||||
LOG_FUNC("%s\n", pucMsg);
|
|
||||||
|
|
||||||
} /* end of dumpMemory8() */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*!
|
|
||||||
* \brief This routine is called to dump a segment of memory in bytes.
|
|
||||||
*
|
|
||||||
* \param[in] pucStartAddr Pointer to the starting address of the memory to be dumped.
|
|
||||||
* \param[in] u4Length Length of the memory to be dumped.
|
|
||||||
*
|
|
||||||
* \return (none)
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID dumpMemory8(IN PUINT_8 pucStartAddr, IN UINT_32 u4Length)
|
|
||||||
{
|
|
||||||
ASSERT(pucStartAddr);
|
|
||||||
|
|
||||||
LOG_FUNC("DUMP8 ADDRESS: %p, Length: %u\n", pucStartAddr, u4Length);
|
|
||||||
|
|
||||||
while (u4Length > 0) {
|
|
||||||
if (u4Length >= 16) {
|
|
||||||
LOG_FUNC(
|
|
||||||
"(%p) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
|
||||||
pucStartAddr, pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4], pucStartAddr[5], pucStartAddr[6], pucStartAddr[7], pucStartAddr[8],
|
|
||||||
pucStartAddr[9], pucStartAddr[10], pucStartAddr[11], pucStartAddr[12], pucStartAddr[13],
|
|
||||||
pucStartAddr[14], pucStartAddr[15]);
|
|
||||||
u4Length -= 16;
|
|
||||||
pucStartAddr += 16;
|
|
||||||
} else {
|
|
||||||
switch (u4Length) {
|
|
||||||
case 1:
|
|
||||||
LOG_FUNC("(%p) %02x\n", pucStartAddr, pucStartAddr[0]);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
LOG_FUNC("(%p) %02x %02x\n", pucStartAddr, pucStartAddr[0], pucStartAddr[1]);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x\n",
|
|
||||||
pucStartAddr, pucStartAddr[0], pucStartAddr[1], pucStartAddr[2]);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x %02x\n",
|
|
||||||
pucStartAddr,
|
|
||||||
pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3]);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x %02x %02x\n",
|
|
||||||
pucStartAddr,
|
|
||||||
pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4]);
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x %02x %02x %02x\n",
|
|
||||||
pucStartAddr,
|
|
||||||
pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4], pucStartAddr[5]);
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x %02x %02x %02x %02x\n",
|
|
||||||
pucStartAddr,
|
|
||||||
pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4], pucStartAddr[5], pucStartAddr[6]);
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
|
||||||
pucStartAddr,
|
|
||||||
pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4], pucStartAddr[5], pucStartAddr[6], pucStartAddr[7]);
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x %02x %02x %02x %02x %02x - %02x\n",
|
|
||||||
pucStartAddr,
|
|
||||||
pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4], pucStartAddr[5], pucStartAddr[6], pucStartAddr[7],
|
|
||||||
pucStartAddr[8]);
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x\n",
|
|
||||||
pucStartAddr,
|
|
||||||
pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4], pucStartAddr[5], pucStartAddr[6], pucStartAddr[7],
|
|
||||||
pucStartAddr[8], pucStartAddr[9]);
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x\n",
|
|
||||||
pucStartAddr,
|
|
||||||
pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4], pucStartAddr[5], pucStartAddr[6], pucStartAddr[7],
|
|
||||||
pucStartAddr[8], pucStartAddr[9], pucStartAddr[10]);
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x\n",
|
|
||||||
pucStartAddr,
|
|
||||||
pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4], pucStartAddr[5], pucStartAddr[6], pucStartAddr[7],
|
|
||||||
pucStartAddr[8], pucStartAddr[9], pucStartAddr[10], pucStartAddr[11]);
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x\n",
|
|
||||||
pucStartAddr,
|
|
||||||
pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4], pucStartAddr[5], pucStartAddr[6], pucStartAddr[7],
|
|
||||||
pucStartAddr[8], pucStartAddr[9], pucStartAddr[10], pucStartAddr[11],
|
|
||||||
pucStartAddr[12]);
|
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
LOG_FUNC("(%p) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x\n",
|
|
||||||
pucStartAddr, pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4], pucStartAddr[5], pucStartAddr[6], pucStartAddr[7],
|
|
||||||
pucStartAddr[8], pucStartAddr[9], pucStartAddr[10], pucStartAddr[11],
|
|
||||||
pucStartAddr[12], pucStartAddr[13]);
|
|
||||||
break;
|
|
||||||
case 15:
|
|
||||||
LOG_FUNC(
|
|
||||||
"(%p) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x\n",
|
|
||||||
pucStartAddr, pucStartAddr[0], pucStartAddr[1], pucStartAddr[2], pucStartAddr[3],
|
|
||||||
pucStartAddr[4], pucStartAddr[5], pucStartAddr[6], pucStartAddr[7],
|
|
||||||
pucStartAddr[8], pucStartAddr[9], pucStartAddr[10], pucStartAddr[11],
|
|
||||||
pucStartAddr[12], pucStartAddr[13], pucStartAddr[14]);
|
|
||||||
break;
|
|
||||||
/*
|
|
||||||
* default:
|
|
||||||
* break;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
u4Length = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG_FUNC("\n");
|
|
||||||
|
|
||||||
} /* end of dumpMemory8() */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*!
|
|
||||||
* \brief This routine is called to dump a segment of memory in double words.
|
|
||||||
*
|
|
||||||
* \param[in] pucStartAddr Pointer to the starting address of the memory to be dumped.
|
|
||||||
* \param[in] u4Length Length of the memory to be dumped.
|
|
||||||
*
|
|
||||||
* \return (none)
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID dumpMemory32(IN PUINT_32 pu4StartAddr, IN UINT_32 u4Length)
|
|
||||||
{
|
|
||||||
PUINT_8 pucAddr;
|
|
||||||
|
|
||||||
ASSERT(pu4StartAddr);
|
|
||||||
|
|
||||||
LOG_FUNC("DUMP32 ADDRESS: %p, Length: %u\n", pu4StartAddr, u4Length);
|
|
||||||
|
|
||||||
if (IS_NOT_ALIGN_4((ULONG) pu4StartAddr)) {
|
|
||||||
UINT_32 u4ProtrudeLen = sizeof(UINT_32) - ((ULONG) pu4StartAddr % 4);
|
|
||||||
|
|
||||||
u4ProtrudeLen = ((u4Length < u4ProtrudeLen) ? u4Length : u4ProtrudeLen);
|
|
||||||
LOG_FUNC("pu4StartAddr is not at DW boundary.\n");
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[0];
|
|
||||||
|
|
||||||
switch (u4ProtrudeLen) {
|
|
||||||
case 1:
|
|
||||||
LOG_FUNC("(%p) %02x------\n", pu4StartAddr, pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
LOG_FUNC("(%p) %02x%02x----\n", pu4StartAddr, pucAddr[1], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
LOG_FUNC("(%p) %02x%02x%02x--\n", pu4StartAddr, pucAddr[2], pucAddr[1], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
u4Length -= u4ProtrudeLen;
|
|
||||||
pu4StartAddr = (PUINT_32) ((ULONG) pu4StartAddr + u4ProtrudeLen);
|
|
||||||
}
|
|
||||||
|
|
||||||
while (u4Length > 0) {
|
|
||||||
if (u4Length >= 16) {
|
|
||||||
LOG_FUNC("(%p) %08x %08x %08x %08x\n",
|
|
||||||
pu4StartAddr, pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2], pu4StartAddr[3]);
|
|
||||||
pu4StartAddr += 4;
|
|
||||||
u4Length -= 16;
|
|
||||||
} else {
|
|
||||||
switch (u4Length) {
|
|
||||||
case 1:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[0];
|
|
||||||
LOG_FUNC("(%p) ------%02x\n", pu4StartAddr, pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[0];
|
|
||||||
LOG_FUNC("(%p) ----%02x%02x\n", pu4StartAddr, pucAddr[1], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[0];
|
|
||||||
LOG_FUNC("(%p) --%02x%02x%02x\n", pu4StartAddr, pucAddr[2], pucAddr[1], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
LOG_FUNC("(%p) %08x\n", pu4StartAddr, pu4StartAddr[0]);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[1];
|
|
||||||
LOG_FUNC("(%p) %08x ------%02x\n", pu4StartAddr, pu4StartAddr[0], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[1];
|
|
||||||
LOG_FUNC("(%p) %08x ----%02x%02x\n",
|
|
||||||
pu4StartAddr, pu4StartAddr[0], pucAddr[1], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[1];
|
|
||||||
LOG_FUNC("(%p) %08x --%02x%02x%02x\n",
|
|
||||||
pu4StartAddr, pu4StartAddr[0], pucAddr[2], pucAddr[1], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
LOG_FUNC("(%p) %08x %08x\n", pu4StartAddr, pu4StartAddr[0], pu4StartAddr[1]);
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[2];
|
|
||||||
LOG_FUNC("(%p) %08x %08x ------%02x\n",
|
|
||||||
pu4StartAddr, pu4StartAddr[0], pu4StartAddr[1], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[2];
|
|
||||||
LOG_FUNC("(%p) %08x %08x ----%02x%02x\n",
|
|
||||||
pu4StartAddr, pu4StartAddr[0], pu4StartAddr[1], pucAddr[1], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[2];
|
|
||||||
LOG_FUNC("(%p) %08x %08x --%02x%02x%02x\n",
|
|
||||||
pu4StartAddr,
|
|
||||||
pu4StartAddr[0], pu4StartAddr[1], pucAddr[2], pucAddr[1], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 12:
|
|
||||||
LOG_FUNC("(%p) %08x %08x %08x\n",
|
|
||||||
pu4StartAddr, pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2]);
|
|
||||||
break;
|
|
||||||
case 13:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[3];
|
|
||||||
LOG_FUNC("(%p) %08x %08x %08x ------%02x\n",
|
|
||||||
pu4StartAddr, pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 14:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[3];
|
|
||||||
LOG_FUNC("(%p) %08x %08x %08x ----%02x%02x\n",
|
|
||||||
pu4StartAddr,
|
|
||||||
pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2], pucAddr[1], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
case 15:
|
|
||||||
pucAddr = (PUINT_8) &pu4StartAddr[3];
|
|
||||||
LOG_FUNC("(%p) %08x %08x %08x --%02x%02x%02x\n",
|
|
||||||
pu4StartAddr,
|
|
||||||
pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2],
|
|
||||||
pucAddr[2], pucAddr[1], pucAddr[0]);
|
|
||||||
break;
|
|
||||||
/*
|
|
||||||
* default:
|
|
||||||
* break;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
u4Length = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} /* end of dumpMemory32() */
|
|
|
@ -1,283 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "fwcfg.h"
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
static char *strtok_r(char *s, const char *delim, char **last);
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
struct _FW_CFG __weak fwCfgArray[] = {
|
|
||||||
|
|
||||||
};
|
|
||||||
/* ******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
*********************************************************************************
|
|
||||||
*/
|
|
||||||
INT_32 __weak getFwCfgItemNum()
|
|
||||||
{
|
|
||||||
return ARRAY_SIZE(fwCfgArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
PUINT_8 __weak getFwCfgItemKey(UINT_8 i)
|
|
||||||
{
|
|
||||||
if (i < ARRAY_SIZE(fwCfgArray))
|
|
||||||
return fwCfgArray[i].key;
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
PUINT_8 __weak getFwCfgItemValue(UINT_8 i)
|
|
||||||
{
|
|
||||||
if (i < ARRAY_SIZE(fwCfgArray))
|
|
||||||
return fwCfgArray[i].value;
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wlanCfgFwSetParam(PUINT_8 fwBuffer, PCHAR cmdStr, PCHAR value, int num, int type)
|
|
||||||
{
|
|
||||||
struct _CMD_FORMAT_V1_T *cmd = (struct _CMD_FORMAT_V1_T *)fwBuffer + num;
|
|
||||||
|
|
||||||
kalMemSet(cmd, 0, sizeof(struct _CMD_FORMAT_V1_T));
|
|
||||||
cmd->itemType = type;
|
|
||||||
|
|
||||||
cmd->itemStringLength = strlen(cmdStr);
|
|
||||||
if (cmd->itemStringLength > MAX_CMD_NAME_MAX_LENGTH)
|
|
||||||
cmd->itemStringLength = MAX_CMD_NAME_MAX_LENGTH;
|
|
||||||
|
|
||||||
/* here will not ensure the end will be '\0' */
|
|
||||||
kalMemCopy(cmd->itemString, cmdStr, cmd->itemStringLength);
|
|
||||||
|
|
||||||
cmd->itemValueLength = strlen(value);
|
|
||||||
if (cmd->itemValueLength > MAX_CMD_VALUE_MAX_LENGTH)
|
|
||||||
cmd->itemValueLength = MAX_CMD_VALUE_MAX_LENGTH;
|
|
||||||
|
|
||||||
/* here will not ensure the end will be '\0' */
|
|
||||||
kalMemCopy(cmd->itemValue, value, cmd->itemValueLength);
|
|
||||||
}
|
|
||||||
|
|
||||||
WLAN_STATUS wlanCfgSetGetFw(IN P_ADAPTER_T prAdapter, const PCHAR fwBuffer, int cmdNum, enum _CMD_TYPE_T cmdType)
|
|
||||||
{
|
|
||||||
struct _CMD_HEADER_T *pcmdV1Header = NULL;
|
|
||||||
|
|
||||||
pcmdV1Header = (struct _CMD_HEADER_T *) kalMemAlloc(sizeof(struct _CMD_HEADER_T), VIR_MEM_TYPE);
|
|
||||||
|
|
||||||
if (pcmdV1Header == NULL)
|
|
||||||
return WLAN_STATUS_FAILURE;
|
|
||||||
|
|
||||||
kalMemSet(pcmdV1Header->buffer, 0, MAX_CMD_BUFFER_LENGTH);
|
|
||||||
pcmdV1Header->cmdType = cmdType;
|
|
||||||
pcmdV1Header->cmdVersion = CMD_VER_1_EXT;
|
|
||||||
pcmdV1Header->itemNum = cmdNum;
|
|
||||||
pcmdV1Header->cmdBufferLen = cmdNum * sizeof(struct _CMD_FORMAT_V1_T);
|
|
||||||
kalMemCopy(pcmdV1Header->buffer, fwBuffer, pcmdV1Header->cmdBufferLen);
|
|
||||||
|
|
||||||
wlanSendSetQueryCmd(prAdapter, CMD_ID_GET_SET_CUSTOMER_CFG,
|
|
||||||
TRUE, FALSE, FALSE,
|
|
||||||
NULL, NULL,
|
|
||||||
sizeof(struct _CMD_HEADER_T),
|
|
||||||
(PUINT_8) pcmdV1Header,
|
|
||||||
NULL, 0);
|
|
||||||
kalMemFree(pcmdV1Header, VIR_MEM_TYPE, sizeof(struct _CMD_HEADER_T));
|
|
||||||
return WLAN_STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
WLAN_STATUS wlanFwArrayCfg(IN P_ADAPTER_T prAdapter)
|
|
||||||
{
|
|
||||||
int kk = 0;
|
|
||||||
PUINT_8 cmdBuffer = NULL;
|
|
||||||
int fwCfgItemNum = getFwCfgItemNum();
|
|
||||||
|
|
||||||
if (!fwCfgItemNum)
|
|
||||||
return WLAN_STATUS_FAILURE;
|
|
||||||
|
|
||||||
cmdBuffer = kalMemAlloc(MAX_CMD_BUFFER_LENGTH, VIR_MEM_TYPE);
|
|
||||||
|
|
||||||
if (cmdBuffer == 0)
|
|
||||||
return WLAN_STATUS_FAILURE;
|
|
||||||
|
|
||||||
kalMemSet(cmdBuffer, 0, MAX_CMD_BUFFER_LENGTH);
|
|
||||||
|
|
||||||
for (; kk < fwCfgItemNum;) {
|
|
||||||
wlanCfgFwSetParam(cmdBuffer, getFwCfgItemKey(kk),
|
|
||||||
getFwCfgItemValue(kk), (kk % MAX_CMD_ITEM_MAX), 1);
|
|
||||||
kk++;
|
|
||||||
if (kk % MAX_CMD_ITEM_MAX == 0) {
|
|
||||||
wlanCfgSetGetFw(prAdapter, cmdBuffer, MAX_CMD_ITEM_MAX, CMD_TYPE_SET);
|
|
||||||
kalMemSet(cmdBuffer, 0, MAX_CMD_BUFFER_LENGTH);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (kk % MAX_CMD_ITEM_MAX)
|
|
||||||
wlanCfgSetGetFw(prAdapter, cmdBuffer, (kk % MAX_CMD_ITEM_MAX), CMD_TYPE_SET);
|
|
||||||
|
|
||||||
kalMemFree(cmdBuffer, VIR_MEM_TYPE, MAX_CMD_BUFFER_LENGTH);
|
|
||||||
return WLAN_STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
WLAN_STATUS wlanFwFileCfg(IN P_ADAPTER_T prAdapter)
|
|
||||||
{
|
|
||||||
UINT_32 u4FwCfgReadLen = 0;
|
|
||||||
PUINT_8 pucFwCfgBuf = (PUINT_8) kalMemAlloc(WLAN_CFG_FILE_BUF_SIZE, VIR_MEM_TYPE);
|
|
||||||
INT32 ret = WLAN_STATUS_FAILURE;
|
|
||||||
|
|
||||||
if (!pucFwCfgBuf) {
|
|
||||||
DBGLOG(INIT, INFO, "omega, pucFwCfgBuf alloc fail!");
|
|
||||||
return WLAN_STATUS_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
kalMemZero(pucFwCfgBuf, WLAN_CFG_FILE_BUF_SIZE);
|
|
||||||
|
|
||||||
if (kalReadToFile(FW_CFG_FILE_1, pucFwCfgBuf,
|
|
||||||
WLAN_CFG_FILE_BUF_SIZE, &u4FwCfgReadLen) == 0)
|
|
||||||
DBGLOG(INIT, INFO, "read wifi_fw.cfg :%s\n", FW_CFG_FILE_1);
|
|
||||||
else if (kalReadToFile(FW_CFG_FILE_2, pucFwCfgBuf,
|
|
||||||
WLAN_CFG_FILE_BUF_SIZE, &u4FwCfgReadLen) == 0)
|
|
||||||
DBGLOG(INIT, INFO, "read wifi_fw.cfg :%s\n", FW_CFG_FILE_2);
|
|
||||||
else if (kalReadToFile(FW_CFG_FILE_3, pucFwCfgBuf,
|
|
||||||
WLAN_CFG_FILE_BUF_SIZE, &u4FwCfgReadLen) == 0)
|
|
||||||
DBGLOG(INIT, INFO, "read wifi_fw.cfg :%s\n", FW_CFG_FILE_3);
|
|
||||||
|
|
||||||
if (pucFwCfgBuf[0] != '\0' && u4FwCfgReadLen > 0) {
|
|
||||||
/* Here limited the file length < 2048, bcz only for dbg purpose
|
|
||||||
* Meanwhile, if the file length == 2048, it MAY cause the last
|
|
||||||
* several <= 4 cmd failed
|
|
||||||
*/
|
|
||||||
if (u4FwCfgReadLen == WLAN_CFG_FILE_BUF_SIZE)
|
|
||||||
pucFwCfgBuf[WLAN_CFG_FILE_BUF_SIZE - 1] = '\0';
|
|
||||||
|
|
||||||
wlanFwCfgParse(prAdapter, pucFwCfgBuf);
|
|
||||||
|
|
||||||
ret = WLAN_STATUS_SUCCESS;
|
|
||||||
} else {
|
|
||||||
DBGLOG(INIT, INFO, "read wifi_fw.cfg fail\n");
|
|
||||||
ret = WLAN_STATUS_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
kalMemFree(pucFwCfgBuf, VIR_MEM_TYPE, WLAN_CFG_FILE_BUF_SIZE);
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
WLAN_STATUS wlanFwCfgParse(IN P_ADAPTER_T prAdapter, PUINT_8 pucConfigBuf)
|
|
||||||
{
|
|
||||||
/* here return a list should be better */
|
|
||||||
char *saveptr1 = NULL, *saveptr2 = NULL;
|
|
||||||
char *cfgItems = pucConfigBuf;
|
|
||||||
UINT_8 cmdNum = 0;
|
|
||||||
|
|
||||||
PUINT_8 cmdBuffer = kalMemAlloc(MAX_CMD_BUFFER_LENGTH, VIR_MEM_TYPE);
|
|
||||||
|
|
||||||
if (cmdBuffer == 0) {
|
|
||||||
DBGLOG(INIT, INFO, "omega, cmd buffer return fail!");
|
|
||||||
return WLAN_STATUS_FAILURE;
|
|
||||||
}
|
|
||||||
kalMemSet(cmdBuffer, 0, MAX_CMD_BUFFER_LENGTH);
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
char *keyStr = NULL;
|
|
||||||
char *valueStr = NULL;
|
|
||||||
char *cfgEntry = strtok_r(cfgItems, "\n\r", &saveptr1);
|
|
||||||
|
|
||||||
if (!cfgEntry) {
|
|
||||||
if (cmdNum)
|
|
||||||
wlanCfgSetGetFw(prAdapter, cmdBuffer, cmdNum, CMD_TYPE_SET);
|
|
||||||
|
|
||||||
if (cmdBuffer)
|
|
||||||
kalMemFree(cmdBuffer, VIR_MEM_TYPE, MAX_CMD_BUFFER_LENGTH);
|
|
||||||
return WLAN_STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
cfgItems = NULL;
|
|
||||||
|
|
||||||
keyStr = strtok_r(cfgEntry, " \t", &saveptr2);
|
|
||||||
valueStr = strtok_r(NULL, "\0", &saveptr2);
|
|
||||||
|
|
||||||
/* maybe a blank line, but with some tab or whitespace */
|
|
||||||
if (!keyStr)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* here take '#' at the beginning of line as comment */
|
|
||||||
if (keyStr[0] == '#')
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* remove the \t " " at the beginning of the valueStr */
|
|
||||||
while (valueStr && (*valueStr == '\t' || *valueStr == ' '))
|
|
||||||
valueStr++;
|
|
||||||
|
|
||||||
if (keyStr && valueStr) {
|
|
||||||
wlanCfgFwSetParam(cmdBuffer, keyStr, valueStr, cmdNum, 1);
|
|
||||||
cmdNum++;
|
|
||||||
if (cmdNum == MAX_CMD_ITEM_MAX) {
|
|
||||||
wlanCfgSetGetFw(prAdapter, cmdBuffer, MAX_CMD_ITEM_MAX, CMD_TYPE_SET);
|
|
||||||
kalMemSet(cmdBuffer, 0, MAX_CMD_BUFFER_LENGTH);
|
|
||||||
cmdNum = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* here will not to try send the cmd has been parsed, but not sent yet */
|
|
||||||
if (cmdBuffer)
|
|
||||||
kalMemFree(cmdBuffer, VIR_MEM_TYPE, MAX_CMD_BUFFER_LENGTH);
|
|
||||||
return WLAN_STATUS_FAILURE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This func is mainly from bionic's strtok.c
|
|
||||||
*/
|
|
||||||
static char *strtok_r(char *s, const char *delim, char **last)
|
|
||||||
{
|
|
||||||
char *spanp;
|
|
||||||
int c, sc;
|
|
||||||
char *tok;
|
|
||||||
|
|
||||||
|
|
||||||
if (s == NULL) {
|
|
||||||
s = *last;
|
|
||||||
if (s == 0)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cont:
|
|
||||||
c = *s++;
|
|
||||||
for (spanp = (char *)delim; (sc = *spanp++) != 0;) {
|
|
||||||
if (c == sc)
|
|
||||||
goto cont;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c == 0) { /* no non-delimiter characters */
|
|
||||||
*last = NULL;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
tok = s - 1;
|
|
||||||
|
|
||||||
for (;;) {
|
|
||||||
c = *s++;
|
|
||||||
spanp = (char *)delim;
|
|
||||||
do {
|
|
||||||
sc = *spanp++;
|
|
||||||
if (sc == c) {
|
|
||||||
if (c == 0)
|
|
||||||
s = NULL;
|
|
||||||
else
|
|
||||||
s[-1] = 0;
|
|
||||||
*last = s;
|
|
||||||
return tok;
|
|
||||||
}
|
|
||||||
} while (sc != 0);
|
|
||||||
}
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,215 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _CFG_WIFI_FILE_H
|
|
||||||
#define _CFG_WIFI_FILE_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#include "gl_typedef.h"
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* duplicated from nic_cmd_event.h to avoid header dependency */
|
|
||||||
typedef struct _TX_PWR_PARAM_T {
|
|
||||||
INT_8 cTxPwr2G4Cck; /* signed, in unit of 0.5dBm */
|
|
||||||
INT_8 acReserved[3]; /* form MT6628 acReserved[0]=cTxPwr2G4Dsss */
|
|
||||||
INT_8 cTxPwr2G4OFDM_BPSK;
|
|
||||||
INT_8 cTxPwr2G4OFDM_QPSK;
|
|
||||||
INT_8 cTxPwr2G4OFDM_16QAM;
|
|
||||||
INT_8 cTxPwr2G4OFDM_Reserved;
|
|
||||||
INT_8 cTxPwr2G4OFDM_48Mbps;
|
|
||||||
INT_8 cTxPwr2G4OFDM_54Mbps;
|
|
||||||
|
|
||||||
INT_8 cTxPwr2G4HT20_BPSK;
|
|
||||||
INT_8 cTxPwr2G4HT20_QPSK;
|
|
||||||
INT_8 cTxPwr2G4HT20_16QAM;
|
|
||||||
INT_8 cTxPwr2G4HT20_MCS5;
|
|
||||||
INT_8 cTxPwr2G4HT20_MCS6;
|
|
||||||
INT_8 cTxPwr2G4HT20_MCS7;
|
|
||||||
|
|
||||||
INT_8 cTxPwr2G4HT40_BPSK;
|
|
||||||
INT_8 cTxPwr2G4HT40_QPSK;
|
|
||||||
INT_8 cTxPwr2G4HT40_16QAM;
|
|
||||||
INT_8 cTxPwr2G4HT40_MCS5;
|
|
||||||
INT_8 cTxPwr2G4HT40_MCS6;
|
|
||||||
INT_8 cTxPwr2G4HT40_MCS7;
|
|
||||||
|
|
||||||
INT_8 cTxPwr5GOFDM_BPSK;
|
|
||||||
INT_8 cTxPwr5GOFDM_QPSK;
|
|
||||||
INT_8 cTxPwr5GOFDM_16QAM;
|
|
||||||
INT_8 cTxPwr5GOFDM_Reserved;
|
|
||||||
INT_8 cTxPwr5GOFDM_48Mbps;
|
|
||||||
INT_8 cTxPwr5GOFDM_54Mbps;
|
|
||||||
|
|
||||||
INT_8 cTxPwr5GHT20_BPSK;
|
|
||||||
INT_8 cTxPwr5GHT20_QPSK;
|
|
||||||
INT_8 cTxPwr5GHT20_16QAM;
|
|
||||||
INT_8 cTxPwr5GHT20_MCS5;
|
|
||||||
INT_8 cTxPwr5GHT20_MCS6;
|
|
||||||
INT_8 cTxPwr5GHT20_MCS7;
|
|
||||||
|
|
||||||
INT_8 cTxPwr5GHT40_BPSK;
|
|
||||||
INT_8 cTxPwr5GHT40_QPSK;
|
|
||||||
INT_8 cTxPwr5GHT40_16QAM;
|
|
||||||
INT_8 cTxPwr5GHT40_MCS5;
|
|
||||||
INT_8 cTxPwr5GHT40_MCS6;
|
|
||||||
INT_8 cTxPwr5GHT40_MCS7;
|
|
||||||
} TX_PWR_PARAM_T, *P_TX_PWR_PARAM_T;
|
|
||||||
|
|
||||||
typedef struct _PWR_5G_OFFSET_T {
|
|
||||||
INT_8 cOffsetBand0; /* 4.915-4.980G */
|
|
||||||
INT_8 cOffsetBand1; /* 5.000-5.080G */
|
|
||||||
INT_8 cOffsetBand2; /* 5.160-5.180G */
|
|
||||||
INT_8 cOffsetBand3; /* 5.200-5.280G */
|
|
||||||
INT_8 cOffsetBand4; /* 5.300-5.340G */
|
|
||||||
INT_8 cOffsetBand5; /* 5.500-5.580G */
|
|
||||||
INT_8 cOffsetBand6; /* 5.600-5.680G */
|
|
||||||
INT_8 cOffsetBand7; /* 5.700-5.825G */
|
|
||||||
} PWR_5G_OFFSET_T, *P_PWR_5G_OFFSET_T;
|
|
||||||
|
|
||||||
typedef struct _PWR_PARAM_T {
|
|
||||||
UINT_32 au4Data[28];
|
|
||||||
UINT_32 u4RefValue1;
|
|
||||||
UINT_32 u4RefValue2;
|
|
||||||
} PWR_PARAM_T, *P_PWR_PARAM_T;
|
|
||||||
|
|
||||||
typedef struct _MITIGATED_PWR_BY_CH_BY_MODE {
|
|
||||||
UINT_8 channel;
|
|
||||||
INT_8 mitigatedCckDsss;
|
|
||||||
INT_8 mitigatedOfdm;
|
|
||||||
INT_8 mitigatedHt20;
|
|
||||||
INT_8 mitigatedHt40;
|
|
||||||
} MITIGATED_PWR_BY_CH_BY_MODE, *P_MITIGATED_PWR_BY_CH_BY_MODE;
|
|
||||||
|
|
||||||
typedef struct _FCC_TX_PWR_ADJUST_T {
|
|
||||||
UINT_8 fgFccTxPwrAdjust;
|
|
||||||
UINT_8 uOffsetCCK;
|
|
||||||
UINT_8 uOffsetHT20;
|
|
||||||
UINT_8 uOffsetHT40;
|
|
||||||
UINT_8 aucChannelCCK[2];
|
|
||||||
UINT_8 aucChannelHT20[2];
|
|
||||||
UINT_8 aucChannelHT40[2];
|
|
||||||
} FCC_TX_PWR_ADJUST, *P_FCC_TX_PWR_ADJUST;
|
|
||||||
|
|
||||||
typedef struct _MT6620_CFG_PARAM_STRUCT {
|
|
||||||
/* 256 bytes of MP data */
|
|
||||||
UINT_16 u2Part1OwnVersion;
|
|
||||||
UINT_16 u2Part1PeerVersion;
|
|
||||||
UINT_8 aucMacAddress[6];
|
|
||||||
UINT_8 aucCountryCode[2];
|
|
||||||
TX_PWR_PARAM_T rTxPwr;
|
|
||||||
UINT_8 aucEFUSE[144];
|
|
||||||
UINT_8 ucTxPwrValid;
|
|
||||||
UINT_8 ucSupport5GBand;
|
|
||||||
UINT_8 fg2G4BandEdgePwrUsed;
|
|
||||||
INT_8 cBandEdgeMaxPwrCCK;
|
|
||||||
INT_8 cBandEdgeMaxPwrOFDM20;
|
|
||||||
INT_8 cBandEdgeMaxPwrOFDM40;
|
|
||||||
|
|
||||||
UINT_8 ucRegChannelListMap;
|
|
||||||
UINT_8 ucRegChannelListIndex;
|
|
||||||
UINT_8 aucRegSubbandInfo[36];
|
|
||||||
UINT_8 aucReserved2[256-248];
|
|
||||||
UINT_8 aucChannelBandEdge[2];
|
|
||||||
UINT_16 u2SizeOfNvram;
|
|
||||||
INT_8 bTxPowerLimitEnable2G;
|
|
||||||
INT_8 cTxBackOffMaxPower2G;
|
|
||||||
INT_8 bTxPowerLimitEnable5G;
|
|
||||||
INT_8 cTxBackOffMaxPower5G;
|
|
||||||
|
|
||||||
/* 256 bytes of function data */
|
|
||||||
UINT_16 u2Part2OwnVersion;
|
|
||||||
UINT_16 u2Part2PeerVersion;
|
|
||||||
UINT_8 uc2G4BwFixed20M;
|
|
||||||
UINT_8 uc5GBwFixed20M;
|
|
||||||
UINT_8 ucEnable5GBand;
|
|
||||||
UINT_8 aucPreTailReserved;
|
|
||||||
UINT_8 uc2GRssiCompensation;
|
|
||||||
UINT_8 uc5GRssiCompensation;
|
|
||||||
UINT_8 fgRssiCompensationValidbit;
|
|
||||||
UINT_8 ucRxAntennanumber;
|
|
||||||
/*support tx power back off [start]*/
|
|
||||||
MITIGATED_PWR_BY_CH_BY_MODE arRlmMitigatedPwrByChByMode[40];
|
|
||||||
UINT_8 fgRlmMitigatedPwrByChByMode;
|
|
||||||
FCC_TX_PWR_ADJUST rFccTxPwrAdjust;
|
|
||||||
/*support tx power back off [end]*/
|
|
||||||
UINT_8 aucTailReserved[768 - 12 - 211];
|
|
||||||
} MT6620_CFG_PARAM_STRUCT, *P_MT6620_CFG_PARAM_STRUCT, WIFI_CFG_PARAM_STRUCT, *P_WIFI_CFG_PARAM_STRUCT;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#ifndef DATA_STRUCT_INSPECTING_ASSERT
|
|
||||||
#define DATA_STRUCT_INSPECTING_ASSERT(expr) \
|
|
||||||
{ \
|
|
||||||
switch (0) {case 0: case (expr): default:; } \
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_FILE_WIFI_REC_SIZE sizeof(WIFI_CFG_PARAM_STRUCT)
|
|
||||||
#define EXTEND_NVRAM_SIZE 1024
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#ifndef _lint
|
|
||||||
/* We don't have to call following function to inspect the data structure.
|
|
||||||
* It will check automatically while at compile time.
|
|
||||||
* We'll need this to guarantee the same member order in different structures
|
|
||||||
* to simply handling effort in some functions.
|
|
||||||
*/
|
|
||||||
static inline VOID nvramOffsetCheck(VOID)
|
|
||||||
{
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(WIFI_CFG_PARAM_STRUCT, u2Part2OwnVersion) == 256);
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(sizeof(WIFI_CFG_PARAM_STRUCT) == EXTEND_NVRAM_SIZE);
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT((OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucEFUSE) & 0x0001) == 0);
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT((OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucRegSubbandInfo) & 0x0001) == 0);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _CFG_WIFI_FILE_H */
|
|
|
@ -1,975 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _CONFIG_H
|
|
||||||
#define _CONFIG_H
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef MT6620
|
|
||||||
#undef MT6620
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MT6628
|
|
||||||
#define MT6628
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* 2 Flags for OS capability */
|
|
||||||
|
|
||||||
#define MTK_WCN_SINGLE_MODULE 0 /* 1: without WMT */
|
|
||||||
|
|
||||||
#ifdef LINUX
|
|
||||||
#ifdef CONFIG_X86
|
|
||||||
#define MTK_WCN_HIF_SDIO 0
|
|
||||||
#else
|
|
||||||
#define MTK_WCN_HIF_SDIO 0 /* samp */
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define MTK_WCN_HIF_SDIO 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (CFG_SUPPORT_AEE == 1)
|
|
||||||
#define CFG_ENABLE_AEE_MSG 1
|
|
||||||
#else
|
|
||||||
#define CFG_ENABLE_AEE_MSG 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_ENABLE_AEE_MSG
|
|
||||||
#include <mt-plat/aee.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* 2 Flags for Driver Features */
|
|
||||||
#define CFG_TX_FRAGMENT 1 /*
|
|
||||||
* !< 1: Enable TX fragmentation
|
|
||||||
* 0: Disable
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_PERFORMANCE_TEST 0 /*Only for performance Test */
|
|
||||||
|
|
||||||
#define CFG_COUNTRY_CODE NULL /* "US" */
|
|
||||||
|
|
||||||
#ifndef LINUX
|
|
||||||
#define CFG_FW_FILENAME L"WIFI_RAM_CODE"
|
|
||||||
#define CFG_FW_FILENAME_E6 L"WIFI_RAM_CODE_E6"
|
|
||||||
#else
|
|
||||||
#define CFG_FW_FILENAME "WIFI_RAM_CODE"
|
|
||||||
#endif
|
|
||||||
#ifndef LINUX
|
|
||||||
#define CFG_SUPPORT_CFG_FILE 0
|
|
||||||
#else
|
|
||||||
#define CFG_SUPPORT_CFG_FILE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_FCC_DYNAMIC_TX_PWR_ADJUST 0 /* Support FCC/CE Dynamic Tx Power Adjust */
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_CE_FCC_TXPWR_LIMIT 0 /* Support CE FCC Tx Power limit */
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_802_11D 1 /*
|
|
||||||
* !< 1(default): Enable 802.11d
|
|
||||||
* 0: Disable
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_RRM 0 /* Radio Reasource Measurement (802.11k) */
|
|
||||||
#define CFG_SUPPORT_DFS 1 /* DFS (802.11h) */
|
|
||||||
|
|
||||||
#if (CFG_SUPPORT_DFS == 1) /* Add by Enlai */
|
|
||||||
#define CFG_SUPPORT_QUIET 1 /* Quiet (802.11h) */
|
|
||||||
#define CFG_SUPPORT_SPEC_MGMT 1 /* Spectrum Management (802.11h): TPC and DFS */
|
|
||||||
#else
|
|
||||||
#define CFG_SUPPORT_QUIET 0 /* Quiet (802.11h) */
|
|
||||||
#define CFG_SUPPORT_SPEC_MGMT 0 /* Spectrum Management (802.11h): TPC and DFS */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_RX_RDG 0 /* 11n feature. RX RDG capability */
|
|
||||||
#define CFG_SUPPORT_MFB 0 /* 802.11n MCS Feedback responder */
|
|
||||||
#define CFG_SUPPORT_RX_STBC 1 /* 802.11n RX STBC (1SS) */
|
|
||||||
#define CFG_SUPPORT_RX_SGI 1 /* 802.11n RX short GI for both 20M and 40M BW */
|
|
||||||
#define CFG_SUPPORT_RX_HT_GF 1 /* 802.11n RX HT green-field capability */
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_ROAMING_ENC 0 /* enahnced roaming */
|
|
||||||
#define CFG_SUPPORT_ROAMING_RETRY 1 /* enahnced roaming */
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_TDLS 1 /* IEEE802.11z TDLS */
|
|
||||||
#define CFG_SUPPORT_TDLS_DBG 0 /* TDLS debug */
|
|
||||||
#define CFG_SUPPORT_STATISTICS 1
|
|
||||||
#define CFG_SUPPORT_DBG_POWERMODE 1 /* for debugging power always active mode */
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_TXR_ENC 0 /* enhanced tx rate switch */
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_PERSIST_NETDEV 0 /* create NETDEV when system bootup */
|
|
||||||
|
|
||||||
#define CFG_FORCE_USE_20BW 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_RN 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_SET_CAM_BY_PROC 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_RSN_SCORE 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_GAMING_MODE 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_OSHARE 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_WAPI 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_DBDC 0
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of WPA3 support
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <linux/version.h>
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0)
|
|
||||||
#define CFG_SUPPORT_WPA3 0
|
|
||||||
#else
|
|
||||||
#define CFG_SUPPORT_WPA3 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (CFG_SUPPORT_WPA3 == 1)
|
|
||||||
#define CFG_REFACTORY_PMKSA 1
|
|
||||||
#else
|
|
||||||
#define CFG_REFACTORY_PMKSA 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of Random MAC support
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_SCAN_RANDOM_MAC 1
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* SLT Option
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SLT_SUPPORT 0
|
|
||||||
|
|
||||||
#ifdef NDIS60_MINIPORT
|
|
||||||
|
|
||||||
#define CFG_NATIVE_802_11 1
|
|
||||||
#define CFG_TX_MAX_PKT_SIZE 2304
|
|
||||||
#define CFG_TCP_IP_CHKSUM_OFFLOAD_NDIS_60 0 /*
|
|
||||||
* !< 1: Enable TCP/IP header checksum offload
|
|
||||||
* 0: Disable
|
|
||||||
*/
|
|
||||||
#define CFG_TCP_IP_CHKSUM_OFFLOAD 0
|
|
||||||
#define CFG_WHQL_DOT11_STATISTICS 1
|
|
||||||
#define CFG_WHQL_ADD_REMOVE_KEY 1
|
|
||||||
#define CFG_WHQL_CUSTOM_IE 1
|
|
||||||
#define CFG_WHQL_SAFE_MODE_ENABLED 1
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define CFG_NATIVE_802_11 0
|
|
||||||
#define CFG_TX_MAX_PKT_SIZE 1600
|
|
||||||
#define CFG_TCP_IP_CHKSUM_OFFLOAD 1 /*
|
|
||||||
* !< 1: Enable TCP/IP header checksum offload
|
|
||||||
* 0: Disable
|
|
||||||
*/
|
|
||||||
#define CFG_TCP_IP_CHKSUM_OFFLOAD_NDIS_60 0
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* 2 Flags for Driver Parameters */
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags for EHPI Interface in Colibri Platform
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_EHPI_FASTER_BUS_TIMING 0 /*
|
|
||||||
* !< 1: Do workaround for faster bus timing
|
|
||||||
* 0(default): Disable
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags for HIFSYS Interface
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#ifdef _lint
|
|
||||||
#define _HIF_SDIO 0 /* samp */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_SDIO_INTR_ENHANCE 1 /*
|
|
||||||
* !< 1(default): Enable SDIO ISR & TX/RX status enhance mode
|
|
||||||
* 0: Disable
|
|
||||||
*/
|
|
||||||
#define CFG_SDIO_RX_ENHANCE 0 /*
|
|
||||||
* !< 1(default): Enable SDIO ISR & TX/RX status enhance mode
|
|
||||||
* 0: Disable
|
|
||||||
*/
|
|
||||||
#define CFG_SDIO_TX_AGG 1 /*
|
|
||||||
* !< 1: Enable SDIO TX enhance
|
|
||||||
* mode(Multiple frames in single BLOCK CMD)
|
|
||||||
* 0(default): Disable
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define CFG_SDIO_RX_AGG 1 /*
|
|
||||||
* !< 1: Enable SDIO RX enhance
|
|
||||||
* mode(Multiple frames in single BLOCK CMD)
|
|
||||||
* 0(default): Disable
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if (CFG_SDIO_RX_AGG == 1) && (CFG_SDIO_INTR_ENHANCE == 0)
|
|
||||||
#error "CFG_SDIO_INTR_ENHANCE should be 1 once CFG_SDIO_RX_AGG equals to 1"
|
|
||||||
#elif (CFG_SDIO_INTR_ENHANCE == 1 || CFG_SDIO_RX_ENHANCE == 1) && (CFG_SDIO_RX_AGG == 0)
|
|
||||||
#error "CFG_SDIO_RX_AGG should be 1 once CFG_SDIO_INTR_ENHANCE and/or CFG_SDIO_RX_ENHANCE equals to 1"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_SDIO_MAX_RX_AGG_NUM 0 /*
|
|
||||||
* !< 1: Setting the maximum RX aggregation number
|
|
||||||
* 0(default): no limited
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef WINDOWS_CE
|
|
||||||
#define CFG_SDIO_PATHRU_MODE 1 /*
|
|
||||||
* !< 1: Support pass through (PATHRU) mode
|
|
||||||
* 0: Disable
|
|
||||||
*/
|
|
||||||
#else
|
|
||||||
#define CFG_SDIO_PATHRU_MODE 0 /*!< 0: Always disable if WINDOWS_CE is not defined */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_MAX_RX_ENHANCE_LOOP_COUNT 3
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags and Parameters for Integration
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#if defined(MT6620)
|
|
||||||
#define MT6620_FPGA_BWCS 0
|
|
||||||
#define MT6620_FPGA_V5 0
|
|
||||||
|
|
||||||
#if (MT6620_FPGA_BWCS == 1) && (MT6620_FPGA_V5 == 1)
|
|
||||||
#error
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (MTK_WCN_HIF_SDIO == 1)
|
|
||||||
#define CFG_MULTI_ECOVER_SUPPORT 1
|
|
||||||
#elif !defined(LINUX)
|
|
||||||
#define CFG_MULTI_ECOVER_SUPPORT 1
|
|
||||||
#else
|
|
||||||
#define CFG_MULTI_ECOVER_SUPPORT 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_ENABLE_CAL_LOG 0
|
|
||||||
#define CFG_REPORT_RFBB_VERSION 0
|
|
||||||
|
|
||||||
#elif defined(MT6628)
|
|
||||||
|
|
||||||
#define CFG_MULTI_ECOVER_SUPPORT 0
|
|
||||||
|
|
||||||
#define CFG_ENABLE_CAL_LOG 1
|
|
||||||
#define CFG_REPORT_RFBB_VERSION 1
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_CHIP_RESET_SUPPORT 1
|
|
||||||
|
|
||||||
#if defined(MT6628)
|
|
||||||
#define CFG_EMBED_FIRMWARE_BUILD_DATE_CODE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags for workaround
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#if defined(MT6620) && (MT6620_FPGA_BWCS == 0) && (MT6620_FPGA_V5 == 0)
|
|
||||||
#define MT6620_E1_ASIC_HIFSYS_WORKAROUND 0
|
|
||||||
#else
|
|
||||||
#define MT6620_E1_ASIC_HIFSYS_WORKAROUND 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* SPM issue: suspend current is higher than deep idle */
|
|
||||||
#define CFG_SPM_WORKAROUND_FOR_HOTSPOT 1
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags for driver version
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_DRV_OWN_VERSION \
|
|
||||||
((UINT_16)((NIC_DRIVER_MAJOR_VERSION << 8) | (NIC_DRIVER_MINOR_VERSION)))
|
|
||||||
#define CFG_DRV_PEER_VERSION ((UINT_16)0x0000)
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags for TX path which are OS dependent
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
/*! NOTE(Kevin): If the Network buffer is non-scatter-gather like structure(without
|
|
||||||
* NETIF_F_FRAGLIST in LINUX), then we can set CFG_TX_BUFFER_IS_SCATTER_LIST to "0"
|
|
||||||
* for zero copy TX packets.
|
|
||||||
* For scatter-gather like structure, we set "1", driver will do copy frame to
|
|
||||||
* internal coalescing buffer before write it to FIFO.
|
|
||||||
*/
|
|
||||||
#if defined(LINUX)
|
|
||||||
#define CFG_TX_BUFFER_IS_SCATTER_LIST 1 /*
|
|
||||||
* !< 1: Do frame copy before write to TX FIFO.
|
|
||||||
* Used when Network buffer is scatter-gather.
|
|
||||||
* 0(default): Do not copy frame
|
|
||||||
*/
|
|
||||||
#else /* WINDOWS/WINCE */
|
|
||||||
#define CFG_TX_BUFFER_IS_SCATTER_LIST 1
|
|
||||||
#endif /* LINUX */
|
|
||||||
|
|
||||||
#if CFG_SDIO_TX_AGG || CFG_TX_BUFFER_IS_SCATTER_LIST
|
|
||||||
#define CFG_COALESCING_BUFFER_SIZE (CFG_TX_MAX_PKT_SIZE * NIC_TX_BUFF_SUM)
|
|
||||||
#else
|
|
||||||
#define CFG_COALESCING_BUFFER_SIZE (CFG_TX_MAX_PKT_SIZE)
|
|
||||||
#endif /* CFG_SDIO_TX_AGG || CFG_TX_BUFFER_IS_SCATTER_LIST */
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags and Parameters for TX path
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! Maximum number of SW TX packet queue */
|
|
||||||
#define CFG_TX_MAX_PKT_NUM 4096 /*
|
|
||||||
* 256 must >= CFG_TX_STOP_NETIF_PER_QUEUE_THRESHOLD * 2;
|
|
||||||
* or wmm will fail when queue is full
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! Maximum number of SW TX CMD packet buffer */
|
|
||||||
#define CFG_TX_MAX_CMD_PKT_NUM 32
|
|
||||||
|
|
||||||
/*! Maximum number of associated STAs */
|
|
||||||
#define CFG_NUM_OF_STA_RECORD 20
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags and Parameters for RX path
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! Max. descriptor number - sync. with firmware */
|
|
||||||
#if CFG_SLT_SUPPORT
|
|
||||||
#define CFG_NUM_OF_RX0_HIF_DESC 42
|
|
||||||
#else
|
|
||||||
#define CFG_NUM_OF_RX0_HIF_DESC 16
|
|
||||||
#endif
|
|
||||||
#define CFG_NUM_OF_RX1_HIF_DESC 2
|
|
||||||
|
|
||||||
/*! Max. buffer hold by QM */
|
|
||||||
#define CFG_NUM_OF_QM_RX_PKT_NUM 4096
|
|
||||||
|
|
||||||
/*! Maximum number of SW RX packet buffer */
|
|
||||||
#define CFG_RX_MAX_PKT_NUM ((CFG_NUM_OF_RX0_HIF_DESC + CFG_NUM_OF_RX1_HIF_DESC) * 3 \
|
|
||||||
+ CFG_NUM_OF_QM_RX_PKT_NUM)
|
|
||||||
|
|
||||||
#define CFG_RX_REORDER_Q_THRESHOLD 8
|
|
||||||
|
|
||||||
#ifndef LINUX
|
|
||||||
#define CFG_RX_RETAINED_PKT_THRESHOLD \
|
|
||||||
(CFG_NUM_OF_RX0_HIF_DESC + CFG_NUM_OF_RX1_HIF_DESC + CFG_NUM_OF_QM_RX_PKT_NUM)
|
|
||||||
#else
|
|
||||||
#define CFG_RX_RETAINED_PKT_THRESHOLD 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*! Maximum RX packet size, if exceed this value, drop incoming packet */
|
|
||||||
/* 7.2.3 Maganement frames */
|
|
||||||
#define CFG_RX_MAX_PKT_SIZE (28 + 2312 + 12 /*HIF_RX_HEADER_T*/) /*
|
|
||||||
* TODO: it should be
|
|
||||||
* 4096 under emulation mode
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! Minimum RX packet size, if lower than this value, drop incoming packet */
|
|
||||||
#define CFG_RX_MIN_PKT_SIZE 10 /*!< 802.11 Control Frame is 10 bytes */
|
|
||||||
|
|
||||||
#if CFG_SDIO_RX_AGG
|
|
||||||
/* extra size for CS_STATUS and enhanced response */
|
|
||||||
#define CFG_RX_COALESCING_BUFFER_SIZE ((CFG_NUM_OF_RX0_HIF_DESC + 1) \
|
|
||||||
* CFG_RX_MAX_PKT_SIZE)
|
|
||||||
#else
|
|
||||||
#define CFG_RX_COALESCING_BUFFER_SIZE (CFG_RX_MAX_PKT_SIZE)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*! RX BA capability */
|
|
||||||
#define CFG_NUM_OF_RX_BA_AGREEMENTS 8
|
|
||||||
#define CFG_RX_BA_MAX_WINSIZE 16
|
|
||||||
#define CFG_RX_BA_INC_SIZE 4
|
|
||||||
#define CFG_RX_MAX_BA_TID_NUM 8
|
|
||||||
#define CFG_RX_REORDERING_ENABLED 1
|
|
||||||
#define CFG_RX_BA_REORDERING_ENHANCEMENT 1
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags and Parameters for CMD/RESPONSE
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_RESPONSE_POLLING_TIMEOUT 512
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags and Parameters for Protocol Stack
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
/*! Maximum number of BSS in the SCAN list */
|
|
||||||
#define CFG_MAX_NUM_BSS_LIST 128
|
|
||||||
|
|
||||||
#define CFG_MAX_NUM_ROAM_BSS_LIST 64
|
|
||||||
|
|
||||||
#define CFG_MAX_COMMON_IE_BUF_LEN ((1500 * CFG_MAX_NUM_BSS_LIST) / 3)
|
|
||||||
|
|
||||||
/*! Maximum size of Header buffer of each SCAN record */
|
|
||||||
#define CFG_RAW_BUFFER_SIZE 1024
|
|
||||||
|
|
||||||
/*! Maximum size of IE buffer of each SCAN record */
|
|
||||||
#define CFG_IE_BUFFER_SIZE 512
|
|
||||||
|
|
||||||
/*! Maximum number of STA records */
|
|
||||||
#define CFG_MAX_NUM_STA_RECORD 32
|
|
||||||
|
|
||||||
#define CFG_GOOG_RCPI_THRESHOLD 90
|
|
||||||
#define CFG_POOR_RCPI_THRESHOLD 67
|
|
||||||
#define CFG_GOOG_RCPI_SCAN_SKIP_TIMES 3
|
|
||||||
#define CFG_POOR_RCPI_SCAN_SKIP_TIMES 2
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags and Parameters for Power management
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_ENABLE_FULL_PM 1
|
|
||||||
#define CFG_ENABLE_WAKEUP_ON_LAN 0
|
|
||||||
#if defined(CONFIG_ARCH_MT6755) || defined(CONFIG_ARCH_MT6735) || defined(CONFIG_ARCH_MT6735M) || \
|
|
||||||
defined(CONFIG_ARCH_MT6753) || defined(CONFIG_ARCH_MT6580)
|
|
||||||
#define CFG_SUPPORT_WAKEUP_REASON_DEBUG 1 /* debug which packet wake up host */
|
|
||||||
#else
|
|
||||||
#define CFG_SUPPORT_WAKEUP_REASON_DEBUG 0 /* debug which packet wake up host */
|
|
||||||
#endif
|
|
||||||
#define CFG_INIT_POWER_SAVE_PROF ENUM_PSP_FAST_SWITCH
|
|
||||||
|
|
||||||
#define CFG_INIT_ENABLE_PATTERN_FILTER_ARP 0
|
|
||||||
|
|
||||||
#define CFG_INIT_UAPSD_AC_BMP 0 /* (BIT(3) | BIT(2) | BIT(1) | BIT(0)) */
|
|
||||||
|
|
||||||
/* #define CFG_SUPPORT_WAPI 0 */
|
|
||||||
#define CFG_SUPPORT_WPS 1
|
|
||||||
#define CFG_SUPPORT_WPS2 1
|
|
||||||
|
|
||||||
#if (CFG_REFACTORY_PMKSA == 0)
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* 802.11i RSN Pre-authentication PMKID cahce maximun number
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_MAX_PMKID_CACHE 16 /*
|
|
||||||
* !< max number of PMKID cache
|
|
||||||
* 16(default) : The Max PMKID cache
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Auto Channel Selection maximun channel number
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define MAX_CHN_NUM 39 /* CH1~CH14, CH36~CH48, CH52~CH64, CH100~CH144, CH149~CH165 */
|
|
||||||
#define MAX_2G_BAND_CHN_NUM 14
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* FAST SCAN
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_ENABLE_FAST_SCAN 0
|
|
||||||
#define CFG_CN_SUPPORT_CLASS121 0 /* Add Class 121, 5470-5725MHz, support for China domain */
|
|
||||||
#if CFG_ENABLE_FAST_SCAN
|
|
||||||
#define CFG_FAST_SCAN_DWELL_TIME 40
|
|
||||||
#define CFG_FAST_SCAN_REG_DOMAIN_DEF_IDX 10
|
|
||||||
#endif
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags and Parameters for Ad-Hoc
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_INIT_ADHOC_FREQ (2462000)
|
|
||||||
#define CFG_INIT_ADHOC_MODE AD_HOC_MODE_MIXED_11BG
|
|
||||||
#define CFG_INIT_ADHOC_BEACON_INTERVAL (100)
|
|
||||||
#define CFG_INIT_ADHOC_ATIM_WINDOW (0)
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags and Parameters for Maximum Scan SSID number
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_MULTI_SSID_SCAN 1
|
|
||||||
#if CFG_TC1_FEATURE
|
|
||||||
#define CFG_NLO_MSP 1 /* NLO/PNO Multiple Scan Plan */
|
|
||||||
#else
|
|
||||||
#define CFG_NLO_MSP 0
|
|
||||||
#endif
|
|
||||||
#define CFG_SUPPORT_SCHED_SCN_SSID_SETS 1 /*Sched-scan support hidden SSID*/
|
|
||||||
#define CFG_SCAN_SSID_MAX_NUM (10)
|
|
||||||
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_SCHED_SCN_SSID_SETS
|
|
||||||
#define CFG_SCAN_HIDDEN_SSID_MAX_NUM (7)
|
|
||||||
#endif
|
|
||||||
#define CFG_SCAN_SSID_MATCH_MAX_NUM (16)
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_DETECT_ATHEROS_AP 0
|
|
||||||
|
|
||||||
#define CFG_SCAN_ABORT_HANDLE 1
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags and Parameters for Support EMI DEBUG
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_EMI_DEBUG 1
|
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags and Parameters for Load Setup Default
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags for enable 802.11A Band setting
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags and Parameters for Interrupt Process
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#if defined(_HIF_SDIO) && defined(WINDOWS_CE)
|
|
||||||
#define CFG_IST_LOOP_COUNT 8
|
|
||||||
#else
|
|
||||||
#define CFG_IST_LOOP_COUNT 8
|
|
||||||
#endif /* _HIF_SDIO */
|
|
||||||
|
|
||||||
#define CFG_INT_WRITE_CLEAR 0
|
|
||||||
|
|
||||||
#if defined(LINUX)
|
|
||||||
#define CFG_DBG_GPIO_PINS 0 /* if 1, use MT6516 GPIO pin to log TX behavior */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* 2 Flags for Driver Debug Options */
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of TX Debug Option. NOTE(Kevin): Confirm with SA before modifying following flags.
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_DBG_MGT_BUF 1 /*
|
|
||||||
* !< 1: Debug statistics usage of MGMT Buffer
|
|
||||||
* 0: Disable
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define CFG_HIF_STATISTICS 0
|
|
||||||
|
|
||||||
#define CFG_HIF_RX_STARVATION_WARNING 0
|
|
||||||
|
|
||||||
#define CFG_STARTUP_DEBUG 0
|
|
||||||
|
|
||||||
#define CFG_RX_PKTS_DUMP 1
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of Firmware Download Option.
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_ENABLE_FW_DOWNLOAD 1
|
|
||||||
|
|
||||||
#define CFG_ENABLE_FW_DOWNLOAD_ACK 1
|
|
||||||
#define CFG_ENABLE_FW_ENCRYPTION 1
|
|
||||||
|
|
||||||
#if defined(MT6628)
|
|
||||||
#define CFG_ENABLE_FW_DOWNLOAD_AGGREGATION 0
|
|
||||||
#define CFG_ENABLE_FW_DIVIDED_DOWNLOAD 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(MT6620)
|
|
||||||
#if MT6620_FPGA_BWCS
|
|
||||||
#define CFG_FW_LOAD_ADDRESS 0x10014000
|
|
||||||
#define CFG_OVERRIDE_FW_START_ADDRESS 0
|
|
||||||
#define CFG_FW_START_ADDRESS 0x10014001
|
|
||||||
#elif MT6620_FPGA_V5
|
|
||||||
#define CFG_FW_LOAD_ADDRESS 0x10008000
|
|
||||||
#define CFG_OVERRIDE_FW_START_ADDRESS 0
|
|
||||||
#define CFG_FW_START_ADDRESS 0x10008001
|
|
||||||
#else
|
|
||||||
#define CFG_FW_LOAD_ADDRESS 0x10008000
|
|
||||||
#define CFG_OVERRIDE_FW_START_ADDRESS 0
|
|
||||||
#define CFG_FW_START_ADDRESS 0x10008001
|
|
||||||
#endif
|
|
||||||
#elif defined(MT6628)
|
|
||||||
#define CFG_FW_LOAD_ADDRESS 0x00060000
|
|
||||||
#define CFG_OVERRIDE_FW_START_ADDRESS 1
|
|
||||||
#define CFG_FW_START_ADDRESS 0x00060000
|
|
||||||
#define CFG_START_ADDRESS_IS_1ST_SECTION_ADDR 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of Bluetooth-over-WiFi (BT 3.0 + HS) support
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef LINUX
|
|
||||||
#ifdef CONFIG_X86
|
|
||||||
#define CFG_ENABLE_BT_OVER_WIFI 0
|
|
||||||
#else
|
|
||||||
#define CFG_ENABLE_BT_OVER_WIFI 1
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define CFG_ENABLE_BT_OVER_WIFI 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_BOW_SEPARATE_DATA_PATH 1
|
|
||||||
|
|
||||||
#define CFG_BOW_PHYSICAL_LINK_NUM 4
|
|
||||||
|
|
||||||
#define CFG_BOW_TEST 0
|
|
||||||
|
|
||||||
#define CFG_BOW_LIMIT_AIS_CHNL 1
|
|
||||||
|
|
||||||
#define CFG_BOW_SUPPORT_11N 0
|
|
||||||
|
|
||||||
#define CFG_BOW_RATE_LIMITATION 1
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of Wi-Fi Direct support
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#ifdef LINUX
|
|
||||||
#ifdef CONFIG_X86
|
|
||||||
#define CFG_ENABLE_WIFI_DIRECT 0
|
|
||||||
#define CFG_SUPPORT_802_11W 1
|
|
||||||
#else
|
|
||||||
#define CFG_ENABLE_WIFI_DIRECT 1
|
|
||||||
#define CFG_SUPPORT_802_11W 1
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define CFG_ENABLE_WIFI_DIRECT 0
|
|
||||||
#define CFG_SUPPORT_802_11W 0 /* Not support at WinXP */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_PERSISTENT_GROUP 0
|
|
||||||
|
|
||||||
#define CFG_TEST_WIFI_DIRECT_GO 0
|
|
||||||
|
|
||||||
#define CFG_TEST_ANDROID_DIRECT_GO 0
|
|
||||||
|
|
||||||
#define CFG_UNITEST_P2P 0
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Enable cfg80211 option after Android 2.2(Froyo) is suggested,
|
|
||||||
* cfg80211 on linux 2.6.29 is not mature yet
|
|
||||||
*/
|
|
||||||
#define CFG_ENABLE_WIFI_DIRECT_CFG_80211 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_HOTSPOT_OPTIMIZATION 1
|
|
||||||
#define CFG_HOTSPOT_OPTIMIZATION_BEACON_INTERVAL 300
|
|
||||||
#define CFG_HOTSPOT_OPTIMIZATION_DTIM 1
|
|
||||||
|
|
||||||
#define CFG_AUTO_CHANNEL_SEL_SUPPORT 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_SOFTAP_WPA3 1
|
|
||||||
|
|
||||||
#define CFG_SET_BCN_CAPINFO_BY_DRIVER 0
|
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Configuration Flags (Linux Only)
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_EXT_CONFIG 0
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Statistics Buffering Mechanism
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#if CFG_SUPPORT_PERFORMANCE_TEST
|
|
||||||
#define CFG_ENABLE_STATISTICS_BUFFERING 1
|
|
||||||
#else
|
|
||||||
#define CFG_ENABLE_STATISTICS_BUFFERING 0
|
|
||||||
#endif
|
|
||||||
#define CFG_STATISTICS_VALID_CYCLE 2000
|
|
||||||
#define CFG_LINK_QUALITY_VALID_PERIOD 1000
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Migration Option
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_ADHOC 0
|
|
||||||
#define CFG_SUPPORT_AAA 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_BCM 0
|
|
||||||
#define CFG_SUPPORT_BCM_BWCS 0
|
|
||||||
#define CFG_SUPPORT_BCM_BWCS_DEBUG 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_RDD_TEST_MODE 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_PWR_MGT 1
|
|
||||||
|
|
||||||
#define CFG_RSN_MIGRATION 1
|
|
||||||
|
|
||||||
#define CFG_PRIVACY_MIGRATION 1
|
|
||||||
|
|
||||||
#define CFG_ENABLE_HOTSPOT_PRIVACY_CHECK 1
|
|
||||||
|
|
||||||
#define CFG_MGMT_FRAME_HANDLING 1
|
|
||||||
|
|
||||||
#define CFG_MGMT_HW_ACCESS_REPLACEMENT 0
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_PERFORMANCE_TEST
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_AIS_5GHZ 1
|
|
||||||
#define CFG_SUPPORT_BEACON_CHANGE_DETECTION 0
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Option for NVRAM and Version Checking
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_NVRAM 1
|
|
||||||
#define CFG_NVRAM_EXISTENCE_CHECK 1
|
|
||||||
#define CFG_SW_NVRAM_VERSION_CHECK 1
|
|
||||||
#define CFG_SUPPORT_NIC_CAPABILITY 1
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* CONFIG_TITLE : Stress Test Option
|
|
||||||
* OWNER : Puff Wen
|
|
||||||
* Description : For stress test only. DO NOT enable it while normal operation
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_STRESS_TEST_SUPPORT 0
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags for LINT
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define LINT_SAVE_AND_DISABLE /*lint -save -e* */
|
|
||||||
|
|
||||||
#define LINT_RESTORE /*lint -restore */
|
|
||||||
|
|
||||||
#define LINT_EXT_HEADER_BEGIN LINT_SAVE_AND_DISABLE
|
|
||||||
|
|
||||||
#define LINT_EXT_HEADER_END LINT_RESTORE
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of Features
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_MULTITHREAD 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_QOS 1 /* Enable/disable QoS TX, AMPDU */
|
|
||||||
#define CFG_SUPPORT_AMPDU_TX 1
|
|
||||||
#define CFG_SUPPORT_AMPDU_RX 1
|
|
||||||
#define CFG_SUPPORT_TSPEC 0 /* Enable/disable TS-related Action frames handling */
|
|
||||||
#define CFG_SUPPORT_UAPSD 1
|
|
||||||
#define CFG_SUPPORT_UL_PSMP 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_ROAMING 1 /* Roaming System */
|
|
||||||
#define CFG_SUPPORT_DYNAMIC_ROAM 0
|
|
||||||
#define CFG_SUPPORT_SWCR 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_ANTI_PIRACY 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_OSC_SETTING 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_P2P_RSSI_QUERY 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_CHNL_CONFLICT_REVISE 0
|
|
||||||
|
|
||||||
#define CFG_SHOW_MACADDR_SOURCE 1
|
|
||||||
#define CFG_BSS_DISAPPEAR_THRESOLD 20 /*unit: sec */
|
|
||||||
#define CFG_NEIGHBOR_AP_CHANNEL_NUM 50
|
|
||||||
#define CFG_MAX_NUM_OF_CHNL_INFO 50
|
|
||||||
#define CFG_SELECT_BSS_BASE_ON_MULTI_PARAM 1
|
|
||||||
#define CFG_SUPPORT_VO_ENTERPRISE 1
|
|
||||||
#define CFG_NEIGHBOR_AP_CHANNEL_NUM 50
|
|
||||||
#define CFG_SUPPORT_WMM_AC 1
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_VO_ENTERPRISE
|
|
||||||
#define CFG_SUPPORT_802_11V_BSS_TRANSITION_MGT 1
|
|
||||||
#define CFG_SUPPORT_802_11R 1
|
|
||||||
#define CFG_SUPPORT_802_11V 1
|
|
||||||
#define CFG_SUPPORT_802_11K 1
|
|
||||||
#else
|
|
||||||
#define CFG_SUPPORT_802_11V_BSS_TRANSITION_MGT 0
|
|
||||||
#define CFG_SUPPORT_802_11R 0
|
|
||||||
#define CFG_SUPPORT_802_11V 0
|
|
||||||
#define CFG_SUPPORT_802_11K 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_802_11V_TIMING_MEASUREMENT 0
|
|
||||||
#define CFG_SUPPORT_OKC 1
|
|
||||||
|
|
||||||
#if (CFG_SUPPORT_802_11V_TIMING_MEASUREMENT == 1) || CFG_SUPPORT_802_11V_BSS_TRANSITION_MGT == 1 \
|
|
||||||
&& (CFG_SUPPORT_802_11V == 0)
|
|
||||||
#error "CFG_SUPPORT_802_11V should be 1 once CFG_SUPPORT_802_11V_TIMING_MEASUREMENT equals to 1"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define WNM_UNIT_TEST 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_PPR2 1
|
|
||||||
#define CFG_DRIVER_COMPOSE_ASSOC_REQ 1
|
|
||||||
|
|
||||||
#define CFG_STRICT_CHECK_CAPINFO_PRIVACY 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_WFD 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_WFD_COMPOSE_IE 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_CPU_BOOST 0
|
|
||||||
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_TX_POWER_BACK_OFF 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_FCC_POWER_BACK_OFF 0
|
|
||||||
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_P2P_ECSA 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_P2P_GO_OFFLOAD_PROBE_RSP 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_RLM_ACT_NETWORK 1
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_P2P_EAP_FAIL_WORKAROUND 1
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of Packet Lifetime Profiling Mechanism
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_ENABLE_PKT_LIFETIME_PROFILE 1
|
|
||||||
|
|
||||||
#define CFG_ENABLE_PER_STA_STATISTICS 1
|
|
||||||
#define CFG_ENABLE_PER_STA_STATISTICS_LOG 1
|
|
||||||
|
|
||||||
#define CFG_PRINT_RTP_PROFILE 0 /* If want to enable WFD Debug, please change it to 1. */
|
|
||||||
#define CFG_PRINT_RTP_SN_SKIP 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_PWR_LIMIT_COUNTRY 1
|
|
||||||
#define CFG_SUPPORT_MTK_SYNERGY 1
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of bus error tolerance
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_FORCE_RESET_UNDER_BUS_ERROR 0
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Build Date Code Integration
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_BUILD_DATE_CODE 1
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags for prepare the FW compile flag
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define COMPILE_FLAG0_GET_STA_LINK_STATUS (1 << 0)
|
|
||||||
#define COMPILE_FLAG0_WFD_ENHANCEMENT_PROTECT (1 << 1)
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of Batch Scan SUPPORT
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_BATCH_SCAN 0
|
|
||||||
#define CFG_BATCH_MAX_MSCAN 2
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of G-Scan SUPPORT and P-SCN SUPPORT, GSCN is one type of PSCN
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_SCN_PSCN 1
|
|
||||||
#if CFG_SUPPORT_SCN_PSCN
|
|
||||||
#define CFG_SUPPORT_GSCN 0 /* GSCN can be disabled here */
|
|
||||||
#else
|
|
||||||
#define CFG_SUPPORT_GSCN 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of Channel Environment SUPPORT
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_GET_CH_ENV 1
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of THERMO_THROTTLING SUPPORT
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_THERMO_THROTTLING 1
|
|
||||||
#define WLAN_INCLUDE_PROC 1
|
|
||||||
|
|
||||||
#if CFG_TC10_FEATURE
|
|
||||||
#define WLAN_INCLUDE_SYS 1
|
|
||||||
#else
|
|
||||||
#define WLAN_INCLUDE_SYS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_DETECT_SECURITY_MODE_CHANGE 0
|
|
||||||
#define CFG_IGNORE_INVALID_AUTH_TSN 0
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of drop multicast packet when device suspend
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_DROP_MC_PACKET 0
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of NCHO SUPPORT
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_SUPPORT_NCHO 0
|
|
||||||
#define CFG_SUPPORT_NCHO_AUTO_ENABLE 0
|
|
||||||
|
|
||||||
#define CFG_SUPPORT_ADD_CONN_AP 1
|
|
||||||
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* Flags of Key Word Exception Mechanism
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#define CFG_ENABLE_KEYWORD_EXCEPTION_MECHANISM 1
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*Driver naming rule: Mdoule_AndroidVersion_Branch_Date_SerialNum*/
|
|
||||||
/*Module: Gen2(0x01)/Gen3(0x02) | kernel-3.10(x00)/3.18(0x10),kernel-4.4(0x20)*/
|
|
||||||
/*AndroidVersion:7.0->70*/
|
|
||||||
/*Branch: 00 for Trunk, 01->mp1,02->mp2*/
|
|
||||||
/*Date: relase date*/
|
|
||||||
/*Serial Number :start form 1*/
|
|
||||||
#define WIFI_MODULE "11"
|
|
||||||
#define ANDROID_VER "70"
|
|
||||||
#define RELEASE_DATE "20170324"
|
|
||||||
#define SERIAL_NUMBER "1"
|
|
||||||
#define SP_BRANCH "TC10"
|
|
||||||
#define WIFI_DRIVER_VERSION WIFI_MODULE "_" ANDROID_VER "_" RELEASE_DATE "_" SERIAL_NUMBER "_" SP_BRANCH
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#endif /* _CONFIG_H */
|
|
|
@ -1,508 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _DEBUG_H
|
|
||||||
#define _DEBUG_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#ifndef BUILD_QA_DBG
|
|
||||||
#define BUILD_QA_DBG 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#include "gl_typedef.h"
|
|
||||||
|
|
||||||
extern UINT_8 aucDebugModule[];
|
|
||||||
|
|
||||||
extern UINT_32 u4DriverLogLevel;
|
|
||||||
extern UINT_32 u4FwLogLevel;
|
|
||||||
|
|
||||||
extern void set_logtoomuch_enable(int value);
|
|
||||||
extern int get_logtoomuch_enable(void);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Define debug category (class):
|
|
||||||
* (1) ERROR (2) WARN (3) STATE (4) EVENT (5) TRACE (6) INFO (7) LOUD (8) TEMP
|
|
||||||
*/
|
|
||||||
#define DBG_CLASS_ERROR BIT(0)
|
|
||||||
#define DBG_CLASS_WARN BIT(1)
|
|
||||||
#define DBG_CLASS_STATE BIT(2)
|
|
||||||
#define DBG_CLASS_EVENT BIT(3)
|
|
||||||
#define DBG_CLASS_TRACE BIT(4)
|
|
||||||
#define DBG_CLASS_INFO BIT(5)
|
|
||||||
#define DBG_CLASS_LOUD BIT(6)
|
|
||||||
#define DBG_CLASS_TEMP BIT(7)
|
|
||||||
#define DBG_CLASS_MASK BITS(0, 7)
|
|
||||||
|
|
||||||
#define DBG_LOG_LEVEL_OFF (DBG_CLASS_ERROR | DBG_CLASS_WARN | DBG_CLASS_INFO | DBG_CLASS_STATE)
|
|
||||||
#define DBG_LOG_LEVEL_DEFAULT (DBG_LOG_LEVEL_OFF | DBG_CLASS_EVENT | DBG_CLASS_TRACE)
|
|
||||||
#define DBG_LOG_LEVEL_EXTREME (DBG_LOG_LEVEL_DEFAULT | DBG_CLASS_LOUD | DBG_CLASS_TEMP)
|
|
||||||
|
|
||||||
enum PKT_PHASE {
|
|
||||||
PHASE_XMIT_RCV,
|
|
||||||
PHASE_ENQ_QM,
|
|
||||||
PHASE_HIF_TX,
|
|
||||||
};
|
|
||||||
#if defined(LINUX)
|
|
||||||
#define DBG_PRINTF_64BIT_DEC "lld"
|
|
||||||
|
|
||||||
#else /* Windows */
|
|
||||||
#define DBG_PRINTF_64BIT_DEC "I64d"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Define debug module index */
|
|
||||||
typedef enum _ENUM_DBG_MODULE_T {
|
|
||||||
DBG_INIT_IDX = 0, /* For driver initial */
|
|
||||||
DBG_HAL_IDX, /* For HAL(HW) Layer */
|
|
||||||
DBG_INTR_IDX, /* For Interrupt */
|
|
||||||
DBG_REQ_IDX,
|
|
||||||
DBG_TX_IDX,
|
|
||||||
DBG_RX_IDX,
|
|
||||||
DBG_RFTEST_IDX, /* For RF test mode */
|
|
||||||
DBG_EMU_IDX, /* Developer specific */
|
|
||||||
|
|
||||||
DBG_SW1_IDX, /* Developer specific */
|
|
||||||
DBG_SW2_IDX, /* Developer specific */
|
|
||||||
DBG_SW3_IDX, /* Developer specific */
|
|
||||||
DBG_SW4_IDX, /* Developer specific */
|
|
||||||
|
|
||||||
DBG_HEM_IDX, /* HEM */
|
|
||||||
DBG_AIS_IDX, /* AIS */
|
|
||||||
DBG_RLM_IDX, /* RLM */
|
|
||||||
DBG_MEM_IDX, /* RLM */
|
|
||||||
DBG_CNM_IDX, /* CNM */
|
|
||||||
DBG_RSN_IDX, /* RSN */
|
|
||||||
DBG_BSS_IDX, /* BSS */
|
|
||||||
DBG_SCN_IDX, /* SCN */
|
|
||||||
DBG_SAA_IDX, /* SAA */
|
|
||||||
DBG_AAA_IDX, /* AAA */
|
|
||||||
DBG_P2P_IDX, /* P2P */
|
|
||||||
DBG_QM_IDX, /* QUE_MGT */
|
|
||||||
DBG_SEC_IDX, /* SEC */
|
|
||||||
DBG_BOW_IDX, /* BOW */
|
|
||||||
DBG_WAPI_IDX, /* WAPI */
|
|
||||||
DBG_ROAMING_IDX, /* ROAMING */
|
|
||||||
DBG_TDLS_IDX, /* TDLS *//* CFG_SUPPORT_TDLS */
|
|
||||||
DBG_OID_IDX,
|
|
||||||
DBG_NIC_IDX,
|
|
||||||
DBG_WNM_IDX,
|
|
||||||
DBG_WMM_IDX,
|
|
||||||
|
|
||||||
DBG_MODULE_NUM /* Notice the XLOG check */
|
|
||||||
} ENUM_DBG_MODULE_T;
|
|
||||||
enum PKT_TYPE {
|
|
||||||
PKT_RX,
|
|
||||||
PKT_TX,
|
|
||||||
PKT_TX_DONE
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef enum _ENUM_DBG_SCAN_T {
|
|
||||||
DBG_SCAN_WRITE_BEFORE, /*Start send ScanRequest*/
|
|
||||||
DBG_SCAN_WRITE_DONE, /*hal write success and ScanRequest done*/
|
|
||||||
} ENUM_DBG_SCAN_T;
|
|
||||||
|
|
||||||
struct WLAN_DEBUG_INFO {
|
|
||||||
BOOLEAN fgVoE5_7Test:1;
|
|
||||||
BOOLEAN fgReserved:7;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Define debug TRAFFIC_CLASS index */
|
|
||||||
|
|
||||||
typedef enum _ENUM_DEBUG_TRAFFIC_CLASS_INDEX_T {
|
|
||||||
DEBUG_TC0_INDEX = 0, /* HIF TX0: AC0 packets */
|
|
||||||
DEBUG_TC1_INDEX, /* HIF TX0: AC1 packets & non-QoS packets */
|
|
||||||
DEBUG_TC2_INDEX, /* HIF TX0: AC2 packets */
|
|
||||||
DEBUG_TC3_INDEX, /* HIF TX0: AC3 packets */
|
|
||||||
DEBUG_TC4_INDEX, /* HIF TX1: Command packets or 802.1x packets */
|
|
||||||
DEBUG_TC5_INDEX, /* HIF TX0: BMCAST packets */
|
|
||||||
DEBUG_TC_NUM /* Maximum number of Traffic Classes. */
|
|
||||||
} ENUM_DEBUG_TRAFFIC_CLASS_INDEX_T;
|
|
||||||
|
|
||||||
/* XLOG */
|
|
||||||
/* #define XLOG_DBG_MODULE_IDX 28 */ /* DBG_MODULE_NUM */
|
|
||||||
/* #if (XLOG_DBG_MODULE_IDX != XLOG_DBG_MODULE_IDX) */
|
|
||||||
/* #error "Please modify the DBG_MODULE_NUM and make sure this include at XLOG" */
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
/* Define who owns developer specific index */
|
|
||||||
#define DBG_YARCO_IDX DBG_SW1_IDX
|
|
||||||
#define DBG_KEVIN_IDX DBG_SW2_IDX
|
|
||||||
#define DBG_CMC_IDX DBG_SW3_IDX
|
|
||||||
#define DBG_GEORGE_IDX DBG_SW4_IDX
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Debug print format string for the OS system time */
|
|
||||||
#define OS_SYSTIME_DBG_FORMAT "0x%08x"
|
|
||||||
|
|
||||||
/* Debug print argument for the OS system time */
|
|
||||||
#define OS_SYSTIME_DBG_ARGUMENT(systime) (systime)
|
|
||||||
|
|
||||||
/* Debug print format string for the MAC Address */
|
|
||||||
#define MACSTR "%pM"
|
|
||||||
/* "%02x:%02x:%02x:%02x:%02x:%02x" */
|
|
||||||
|
|
||||||
/* Debug print argument for the MAC Address */
|
|
||||||
#define MAC2STR(a) a
|
|
||||||
/* ((PUINT_8)a)[0], ((PUINT_8)a)[1], ((PUINT_8)a)[2], ((PUINT_8)a)[3], ((PUINT_8)a)[4], ((PUINT_8)a)[5] */
|
|
||||||
|
|
||||||
#if (CFG_REFACTORY_PMKSA == 1)
|
|
||||||
#define PMKSTR "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%03x%02x%02x"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The pre-defined format to dump the value of a varaible with its name shown. */
|
|
||||||
#define DUMPVAR(variable, format) (#variable " = " format "\n", variable)
|
|
||||||
|
|
||||||
/* The pre-defined format to dump the MAC type value with its name shown. */
|
|
||||||
#define DUMPMACADDR(addr) (#addr " = %pM\n", (addr))
|
|
||||||
|
|
||||||
/* for HIDE some information for user load */
|
|
||||||
#ifdef BUILD_QA_DBG
|
|
||||||
#define HIDE(_str) _str
|
|
||||||
#else
|
|
||||||
#define HIDE(_str) "***"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Basiclly, we just do renaming of KAL functions although they should
|
|
||||||
* be defined as "Nothing to do" if DBG=0. But in some compiler, the macro
|
|
||||||
* syntax does not support #define LOG_FUNC(x,...)
|
|
||||||
*
|
|
||||||
* A caller shall not invoke these three macros when DBG=0.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define LOG_FUNC kalPrint
|
|
||||||
#define LOG_FUNC_LIMITED kalPrintLimited
|
|
||||||
|
|
||||||
#if defined(LINUX)
|
|
||||||
#define DBGLOG(_Module, _Class, _Fmt, ...) \
|
|
||||||
do { \
|
|
||||||
if ((aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) == 0) \
|
|
||||||
break; \
|
|
||||||
LOG_FUNC("%s:(" #_Module " " #_Class ") " _Fmt, __func__, ##__VA_ARGS__); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define DBGLOGLIMITED(_Module, _Class, _Fmt, ...) \
|
|
||||||
do { \
|
|
||||||
if ((aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) == 0) \
|
|
||||||
break; \
|
|
||||||
LOG_FUNC_LIMITED("%s:(" #_Module " " #_Class ") " _Fmt, __func__, ##__VA_ARGS__); \
|
|
||||||
} while (0)
|
|
||||||
#else
|
|
||||||
#define DBGLOG(_Module, _Class, _Fmt)
|
|
||||||
#define DBGLOGLIMITED(_Module, _Class, _Fmt)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if DBG
|
|
||||||
|
|
||||||
#define TMP_BUF_LEN 256
|
|
||||||
#define TMP_WBUF_LEN (TMP_BUF_LEN * 2)
|
|
||||||
|
|
||||||
extern PINT_16 g_wbuf_p;
|
|
||||||
extern PINT_8 g_buf_p;
|
|
||||||
|
|
||||||
/* If __FUNCTION__ is already defined by compiler, we just use it. */
|
|
||||||
#if defined(__func__)
|
|
||||||
#define DEBUGFUNC(_Func)
|
|
||||||
#else
|
|
||||||
#define DEBUGFUNC(_Func) \
|
|
||||||
static const char __func__[] = _Func
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define DBGLOG_MEM8(_Module, _Class, _StartAddr, _Length) \
|
|
||||||
{ \
|
|
||||||
if (aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) { \
|
|
||||||
LOG_FUNC("%s:(" #_Module " " #_Class ")\n", __func__); \
|
|
||||||
dumpMemory8((PUINT_8) (_StartAddr), (UINT_32) (_Length)); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define DBGLOG_MEM32(_Module, _Class, _StartAddr, _Length) \
|
|
||||||
{ \
|
|
||||||
if (aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) { \
|
|
||||||
LOG_FUNC("%s:(" #_Module " " #_Class ")\n", __func__); \
|
|
||||||
dumpMemory32((PUINT_32) (_StartAddr), (UINT_32) (_Length)); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef ASSERT
|
|
||||||
|
|
||||||
#ifdef _lint
|
|
||||||
#define ASSERT(_exp) \
|
|
||||||
{ \
|
|
||||||
if (!(_exp)) { \
|
|
||||||
do {} while (1); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#define ASSERT(_exp) \
|
|
||||||
{ \
|
|
||||||
if (!(_exp)) { \
|
|
||||||
LOG_FUNC("Assertion failed: %s:%d %s\n", __FILE__, __LINE__, #_exp); \
|
|
||||||
kalBreakPoint(); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
#endif /* _lint */
|
|
||||||
|
|
||||||
#define ASSERT_REPORT(_exp, _fmt) \
|
|
||||||
{ \
|
|
||||||
if (!(_exp)) { \
|
|
||||||
LOG_FUNC("Assertion failed: %s:%d %s\n", __FILE__, __LINE__, #_exp); \
|
|
||||||
LOG_FUNC _fmt; \
|
|
||||||
kalBreakPoint(); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define DISP_STRING(_str) _str
|
|
||||||
|
|
||||||
#else /* !DBG */
|
|
||||||
|
|
||||||
#define DEBUGFUNC(_Func)
|
|
||||||
#define INITLOG(_Fmt)
|
|
||||||
#define ERRORLOG(_Fmt)
|
|
||||||
#define WARNLOG(_Fmt)
|
|
||||||
|
|
||||||
#define DBGLOG_MEM8(_Module, _Class, _StartAddr, _Length) \
|
|
||||||
{ \
|
|
||||||
if (aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) { \
|
|
||||||
LOG_FUNC("%s: (" #_Module " " #_Class ")\n", __func__); \
|
|
||||||
dumpMemory8((PUINT_8) (_StartAddr), (UINT_32) (_Length)); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define DBGLOG_MEM32(_Module, _Class, _StartAddr, _Length)
|
|
||||||
|
|
||||||
#undef ASSERT
|
|
||||||
|
|
||||||
#if BUILD_QA_DBG
|
|
||||||
#if defined(LINUX) /* For debugging in Linux w/o GDB */
|
|
||||||
#define ASSERT(_exp) \
|
|
||||||
{ \
|
|
||||||
if (!(_exp)) { \
|
|
||||||
LOG_FUNC("Assertion failed: %s:%d (%s)\n", __FILE__, __LINE__, #_exp); \
|
|
||||||
kalBreakPoint(); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSERT_REPORT(_exp, _fmt) \
|
|
||||||
{ \
|
|
||||||
if (!(_exp)) { \
|
|
||||||
LOG_FUNC("Assertion failed: %s:%d (%s)\n", __FILE__, __LINE__, #_exp); \
|
|
||||||
LOG_FUNC _fmt; \
|
|
||||||
kalBreakPoint(); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#ifdef WINDOWS_CE
|
|
||||||
#define UNICODE_TEXT(_msg) TEXT(_msg)
|
|
||||||
#define ASSERT(_exp) \
|
|
||||||
{ \
|
|
||||||
if (!(_exp)) { \
|
|
||||||
TCHAR rUbuf[256]; \
|
|
||||||
kalBreakPoint(); \
|
|
||||||
_stprintf(rUbuf, TEXT("Assertion failed: %s:%d %s\n"), \
|
|
||||||
UNICODE_TEXT(__FILE__), __LINE__, UNICODE_TEXT(#_exp)); \
|
|
||||||
MessageBox(NULL, rUbuf, TEXT("ASSERT!"), MB_OK); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSERT_REPORT(_exp, _fmt) \
|
|
||||||
{ \
|
|
||||||
if (!(_exp)) { \
|
|
||||||
TCHAR rUbuf[256]; \
|
|
||||||
kalBreakPoint(); \
|
|
||||||
_stprintf(rUbuf, TEXT("Assertion failed: %s:%d %s\n"), \
|
|
||||||
UNICODE_TEXT(__FILE__), __LINE__, UNICODE_TEXT(#_exp)); \
|
|
||||||
MessageBox(NULL, rUbuf, TEXT("ASSERT!"), MB_OK); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#define ASSERT(_exp) \
|
|
||||||
{ \
|
|
||||||
if (!(_exp)) { \
|
|
||||||
kalBreakPoint(); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSERT_REPORT(_exp, _fmt) \
|
|
||||||
{ \
|
|
||||||
if (!(_exp)) { \
|
|
||||||
kalBreakPoint(); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
#endif /* WINDOWS_CE */
|
|
||||||
#endif /* LINUX */
|
|
||||||
#else
|
|
||||||
#define ASSERT(_exp) \
|
|
||||||
{ \
|
|
||||||
if (!(_exp)) { \
|
|
||||||
LOG_FUNC("Warning at %s:%d (%s)\n", __func__, __LINE__, #_exp); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ASSERT_REPORT(_exp, _fmt) \
|
|
||||||
{ \
|
|
||||||
if (!(_exp)) { \
|
|
||||||
LOG_FUNC("Warning at %s:%d (%s)\n", __func__, __LINE__, #_exp); \
|
|
||||||
LOG_FUNC _fmt; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
#endif /* BUILD_QA_DBG */
|
|
||||||
|
|
||||||
#define DISP_STRING(_str) ""
|
|
||||||
|
|
||||||
#endif /* DBG */
|
|
||||||
|
|
||||||
#if CFG_STARTUP_DEBUG
|
|
||||||
#if defined(LINUX)
|
|
||||||
#define DBGPRINTF kalPrint
|
|
||||||
#else
|
|
||||||
#define DBGPRINTF DbgPrint
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define DBGPRINTF(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The following macro is used for debugging packed structures. */
|
|
||||||
#ifndef DATA_STRUCT_INSPECTING_ASSERT
|
|
||||||
#define DATA_STRUCT_INSPECTING_ASSERT(expr) \
|
|
||||||
{ \
|
|
||||||
switch (0) {case 0: case (expr): default:; } \
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#define DBGLOG_MEM8_IE_ONE_LINE(_Module, _Class, _String, _StartAddr, _Length) \
|
|
||||||
{ \
|
|
||||||
if (aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) { \
|
|
||||||
dumpMemory8IEOneLine((PUINT_8) (_String), (PUINT_8) (_StartAddr), (UINT_32) (_Length)); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID dumpMemory8IEOneLine(IN PUINT_8 aucBSSID, IN PUINT_8 pucStartAddr, IN UINT_32 u4Length);
|
|
||||||
|
|
||||||
VOID dumpMemory8(IN PUINT_8 pucStartAddr, IN UINT_32 u4Length);
|
|
||||||
|
|
||||||
VOID dumpMemory32(IN PUINT_32 pu4StartAddr, IN UINT_32 u4Length);
|
|
||||||
|
|
||||||
VOID wlanDebugInit(VOID);
|
|
||||||
|
|
||||||
VOID wlanDebugUninit(VOID);
|
|
||||||
|
|
||||||
VOID wlanTraceReleaseTcRes(P_ADAPTER_T prAdapter, PUINT_8 aucTxRlsCnt, UINT_8 ucAvailable);
|
|
||||||
|
|
||||||
VOID wlanTraceTxCmd(P_ADAPTER_T prAdapter, P_CMD_INFO_T prCmd);
|
|
||||||
|
|
||||||
VOID wlanReadFwStatus(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID wlanDumpTxReleaseCount(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID wlanDumpTcResAndTxedCmd(PUINT_8 pucBuf, UINT_32 maxLen);
|
|
||||||
|
|
||||||
VOID wlanDumpCommandFwStatus(VOID);
|
|
||||||
|
|
||||||
VOID wlanDebugScanTargetBSSRecord(P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
VOID wlanDebugScanTargetBSSDump(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID wlanPktDebugDumpInfo(P_ADAPTER_T prAdapter);
|
|
||||||
VOID wlanPktDebugTraceInfoIP(UINT_8 status, UINT_8 eventType, UINT_8 ucIpProto, UINT_16 u2IpId);
|
|
||||||
VOID wlanPktDebugTraceInfoARP(UINT_8 status, UINT_8 eventType, UINT_16 u2ArpOpCode);
|
|
||||||
VOID wlanPktDebugTraceInfo(UINT_8 status, UINT_8 eventType
|
|
||||||
, UINT_16 u2EtherType, UINT_8 ucIpProto, UINT_16 u2IpId, UINT_16 u2ArpOpCode);
|
|
||||||
VOID wlanDebugHifDescriptorDump(P_ADAPTER_T prAdapter, ENUM_AMPDU_TYPE type
|
|
||||||
, ENUM_DEBUG_TRAFFIC_CLASS_INDEX_T tcIndex);
|
|
||||||
VOID wlanDebugScanRecord(P_ADAPTER_T prAdapter, ENUM_DBG_SCAN_T recordType);
|
|
||||||
VOID wlanDebugScanDump(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
|
|
||||||
VOID wlanFWDLDebugInit(VOID);
|
|
||||||
|
|
||||||
VOID wlanFWDLDebugStartSectionPacketInfo(UINT_32 u4Section, UINT_32 u4DownloadSize,
|
|
||||||
UINT_32 u4ResponseTime);
|
|
||||||
|
|
||||||
VOID wlanFWDLDebugAddTxStartTime(UINT_32 u4TxStartTime);
|
|
||||||
|
|
||||||
VOID wlanFWDLDebugAddTxDoneTime(UINT_32 u4TxDoneTime);
|
|
||||||
|
|
||||||
VOID wlanFWDLDebugAddRxStartTime(UINT_32 u4RxStartTime);
|
|
||||||
|
|
||||||
VOID wlanFWDLDebugAddRxDoneTime(UINT_32 u4RxDoneTime);
|
|
||||||
|
|
||||||
VOID wlanFWDLDebugDumpInfo(VOID);
|
|
||||||
|
|
||||||
VOID wlanFWDLDebugUninit(VOID);
|
|
||||||
|
|
||||||
UINT_32 wlanFWDLDebugGetPktCnt(VOID);
|
|
||||||
|
|
||||||
VOID wlanDumpMcuChipId(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID wlanPktStausDebugUpdateProcessTime(UINT_32 u4DbgTxPktStatusIndex);
|
|
||||||
VOID wlanPktStatusDebugDumpInfo(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VOID wlanPktStatusDebugTraceInfoSeq(P_ADAPTER_T prAdapter, UINT_16 u2NoSeq);
|
|
||||||
VOID wlanPktStatusDebugTraceInfoARP(UINT_8 status, UINT_8 eventType, UINT_16 u2ArpOpCode, PUINT_8 pucPkt
|
|
||||||
, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
VOID wlanPktStatusDebugTraceInfoIP(UINT_8 status, UINT_8 eventType, UINT_8 ucIpProto, UINT_16 u2IpId
|
|
||||||
, PUINT_8 pucPkt, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
VOID wlanPktStatusDebugTraceInfo(UINT_8 status, UINT_8 eventType, UINT_16 u2EtherType
|
|
||||||
, UINT_8 ucIpProto, UINT_16 u2IpId, UINT_16 u2ArpOpCode, PUINT_8 pucPkt, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
VOID wlanDebugCommandRecodTime(P_CMD_INFO_T prCmdInfo);
|
|
||||||
VOID wlanDebugCommandRecodDump(VOID);
|
|
||||||
#if CFG_SUPPORT_EMI_DEBUG
|
|
||||||
VOID wlanReadFwInfoFromEmi(IN PUINT_32 pAddr);
|
|
||||||
|
|
||||||
VOID wlanFillTimestamp(P_ADAPTER_T prAdapter, PVOID pvPacket, UINT_8 ucPhase);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VOID wlanDbgLogLevelInit(VOID);
|
|
||||||
VOID wlanDbgLogLevelUninit(VOID);
|
|
||||||
UINT_32 wlanDbgLevelUiSupport(IN P_ADAPTER_T prAdapter, UINT_32 u4Version, UINT_32 ucModule);
|
|
||||||
UINT_32 wlanDbgGetLogLevelImpl(IN P_ADAPTER_T prAdapter, UINT_32 u4Version, UINT_32 ucModule);
|
|
||||||
VOID wlanDbgSetLogLevelImpl(IN P_ADAPTER_T prAdapter, UINT_32 u4Version,
|
|
||||||
UINT_32 u4Module, UINT_32 u4level);
|
|
||||||
VOID wlanDbgLevelSync(VOID);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#endif /* _DEBUG_H */
|
|
|
@ -1,129 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _FWCFG_H
|
|
||||||
#define _FWCFG_H
|
|
||||||
#include "precomp.h"
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#ifdef FW_CFG_SUPPORT
|
|
||||||
#define MAX_CMD_ITEM_MAX 4
|
|
||||||
#define MAX_CMD_NAME_MAX_LENGTH 32
|
|
||||||
#define MAX_CMD_VALUE_MAX_LENGTH 32
|
|
||||||
|
|
||||||
#define MAX_CMD_TYPE_LENGTH 1
|
|
||||||
#define MAX_CMD_RESERVE_LENGTH 1
|
|
||||||
#define MAX_CMD_STRING_LENGTH 1
|
|
||||||
#define MAX_CMD_VALUE_LENGTH 1
|
|
||||||
|
|
||||||
#define CMD_FORMAT_V1_LENGTH (MAX_CMD_NAME_MAX_LENGTH + \
|
|
||||||
MAX_CMD_VALUE_MAX_LENGTH + MAX_CMD_TYPE_LENGTH + \
|
|
||||||
MAX_CMD_STRING_LENGTH + MAX_CMD_VALUE_LENGTH + MAX_CMD_RESERVE_LENGTH)
|
|
||||||
|
|
||||||
#define MAX_CMD_BUFFER_LENGTH (CMD_FORMAT_V1_LENGTH * MAX_CMD_ITEM_MAX)
|
|
||||||
|
|
||||||
#define FW_CFG_FILE_1 "/etc/firmware/wifi_fw.cfg"
|
|
||||||
#define FW_CFG_FILE_2 "/vendor/firmware/wifi_fw.cfg"
|
|
||||||
#define FW_CFG_FILE_3 "/data/misc/wifi/wifi_fw.cfg"
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
enum _CMD_VER_T {
|
|
||||||
CMD_VER_1,
|
|
||||||
CMD_VER_1_EXT
|
|
||||||
};
|
|
||||||
|
|
||||||
enum _CMD_TYPE_T {
|
|
||||||
CMD_TYPE_QUERY,
|
|
||||||
CMD_TYPE_SET
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _CMD_FORMAT_V1_T {
|
|
||||||
UINT_8 itemType;
|
|
||||||
UINT_8 itemStringLength;
|
|
||||||
UINT_8 itemValueLength;
|
|
||||||
UINT_8 Reserved;
|
|
||||||
UINT_8 itemString[MAX_CMD_NAME_MAX_LENGTH];
|
|
||||||
UINT_8 itemValue[MAX_CMD_VALUE_MAX_LENGTH];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _CMD_HEADER_T {
|
|
||||||
enum _CMD_VER_T cmdVersion;
|
|
||||||
enum _CMD_TYPE_T cmdType;
|
|
||||||
UINT_8 itemNum;
|
|
||||||
UINT_16 cmdBufferLen;
|
|
||||||
UINT_8 buffer[MAX_CMD_BUFFER_LENGTH];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct WLAN_CFG_PARSE_STATE_S {
|
|
||||||
CHAR *ptr;
|
|
||||||
CHAR *text;
|
|
||||||
INT_32 nexttoken;
|
|
||||||
UINT_32 maxSize;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _FW_CFG {
|
|
||||||
PUINT_8 key;
|
|
||||||
PUINT_8 value;
|
|
||||||
};
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
INT_32 getFwCfgItemNum(void);
|
|
||||||
|
|
||||||
PUINT_8 getFwCfgItemKey(UINT_8 i);
|
|
||||||
|
|
||||||
PUINT_8 getFwCfgItemValue(UINT_8 i);
|
|
||||||
|
|
||||||
void wlanCfgFwSetParam(PUINT_8 fwBuffer, PCHAR cmdStr, PCHAR value, int num, int type);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanCfgSetGetFw(IN P_ADAPTER_T prAdapter, const PCHAR fwBuffer, int cmdNum, enum _CMD_TYPE_T cmdType);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanFwCfgParse(IN P_ADAPTER_T prAdapter, PUINT_8 pucConfigBuf);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanFwArrayCfg(IN P_ADAPTER_T prAdpter);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanFwFileCfg(IN P_ADAPTER_T prAdpter);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
|
@ -1,373 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _LINK_H
|
|
||||||
#define _LINK_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#include "gl_typedef.h"
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* May cause page fault & unalignment issue (data abort) */
|
|
||||||
#define INVALID_LINK_POISON1 ((VOID *) 0x00100101)
|
|
||||||
/* Used to verify that nonbody uses non-initialized link entries. */
|
|
||||||
#define INVALID_LINK_POISON2 ((VOID *) 0x00100201)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Simple Doubly Linked List Structures - Entry Part */
|
|
||||||
typedef struct _LINK_ENTRY_T {
|
|
||||||
struct _LINK_ENTRY_T *prNext, *prPrev;
|
|
||||||
} LINK_ENTRY_T, *P_LINK_ENTRY_T;
|
|
||||||
|
|
||||||
/* Simple Doubly Linked List Structures - List Part */
|
|
||||||
typedef struct _LINK_T {
|
|
||||||
P_LINK_ENTRY_T prNext;
|
|
||||||
P_LINK_ENTRY_T prPrev;
|
|
||||||
UINT_32 u4NumElem;
|
|
||||||
} LINK_T, *P_LINK_T;
|
|
||||||
|
|
||||||
struct LINK_MGMT {
|
|
||||||
LINK_T rUsingLink;
|
|
||||||
LINK_T rFreeLink;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#if 0 /* No one use it, temporarily mark it for [Lint - Info 773] */
|
|
||||||
#define LINK_ADDR(rLink) { (P_LINK_ENTRY_T)(&(rLink)), (P_LINK_ENTRY_T)(&(rLink)), 0 }
|
|
||||||
|
|
||||||
#define LINK_DECLARATION(rLink) \
|
|
||||||
struct _LINK_T rLink = LINK_ADDR(rLink)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LINK_INITIALIZE(prLink) \
|
|
||||||
do { \
|
|
||||||
((P_LINK_T)(prLink))->prNext = (P_LINK_ENTRY_T)(prLink); \
|
|
||||||
((P_LINK_T)(prLink))->prPrev = (P_LINK_ENTRY_T)(prLink); \
|
|
||||||
((P_LINK_T)(prLink))->u4NumElem = 0; \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define LINK_MGMT_INIT(prLinkMgmt) \
|
|
||||||
do { \
|
|
||||||
LINK_INITIALIZE(&((struct LINK_MGMT *)prLinkMgmt)->rUsingLink); \
|
|
||||||
LINK_INITIALIZE(&((struct LINK_MGMT *)prLinkMgmt)->rFreeLink); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define LINK_MGMT_GET_ENTRY(prLinkMgmt, prEntry, EntryType, memType) \
|
|
||||||
do { \
|
|
||||||
LINK_REMOVE_HEAD(&((struct LINK_MGMT *)prLinkMgmt)->rFreeLink, \
|
|
||||||
prEntry, EntryType*); \
|
|
||||||
if (!prEntry) \
|
|
||||||
prEntry = kalMemAlloc(sizeof(EntryType), memType); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define LINK_MGMT_UNINIT(prLinkMgmt, EntryType, memType) \
|
|
||||||
do { \
|
|
||||||
EntryType *prEntry = NULL; \
|
|
||||||
P_LINK_T prFreeList = &((struct LINK_MGMT *)prLinkMgmt)->rFreeLink; \
|
|
||||||
P_LINK_T prUsingList = &((struct LINK_MGMT *)prLinkMgmt)->rUsingLink; \
|
|
||||||
LINK_REMOVE_HEAD(prFreeList, prEntry, EntryType *); \
|
|
||||||
while (prEntry) { \
|
|
||||||
kalMemFree(prEntry, memType, sizeof(EntryType)); \
|
|
||||||
LINK_REMOVE_HEAD(prFreeList, prEntry, EntryType *); \
|
|
||||||
} \
|
|
||||||
LINK_REMOVE_HEAD(prUsingList, prEntry, EntryType *); \
|
|
||||||
while (prEntry) { \
|
|
||||||
kalMemFree(prEntry, memType, sizeof(EntryType)); \
|
|
||||||
LINK_REMOVE_HEAD(prUsingList, prEntry, EntryType *); \
|
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define LINK_ENTRY_INITIALIZE(prEntry) \
|
|
||||||
do { \
|
|
||||||
((P_LINK_ENTRY_T)(prEntry))->prNext = (P_LINK_ENTRY_T)NULL; \
|
|
||||||
((P_LINK_ENTRY_T)(prEntry))->prPrev = (P_LINK_ENTRY_T)NULL; \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define LINK_ENTRY_INVALID(prEntry) \
|
|
||||||
do { \
|
|
||||||
((P_LINK_ENTRY_T)(prEntry))->prNext = (P_LINK_ENTRY_T)INVALID_LINK_POISON1; \
|
|
||||||
((P_LINK_ENTRY_T)(prEntry))->prPrev = (P_LINK_ENTRY_T)INVALID_LINK_POISON2; \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define LINK_ENTRY_IS_VALID(prEntry) \
|
|
||||||
(((P_LINK_ENTRY_T)(prEntry))->prNext != (P_LINK_ENTRY_T)NULL && \
|
|
||||||
((P_LINK_ENTRY_T)(prEntry))->prNext != (P_LINK_ENTRY_T)INVALID_LINK_POISON1 && \
|
|
||||||
((P_LINK_ENTRY_T)(prEntry))->prPrev != (P_LINK_ENTRY_T)NULL && \
|
|
||||||
((P_LINK_ENTRY_T)(prEntry))->prPrev != (P_LINK_ENTRY_T)INVALID_LINK_POISON2)
|
|
||||||
|
|
||||||
#define LINK_IS_EMPTY(prLink) (((P_LINK_T)(prLink))->prNext == (P_LINK_ENTRY_T)(prLink))
|
|
||||||
|
|
||||||
/* NOTE: We should do memory zero before any LINK been initiated, so we can check
|
|
||||||
* if it is valid before parsing the LINK.
|
|
||||||
*/
|
|
||||||
#define LINK_IS_INVALID(prLink) (((P_LINK_T)(prLink))->prNext == (P_LINK_ENTRY_T)NULL)
|
|
||||||
|
|
||||||
#define LINK_IS_VALID(prLink) (((P_LINK_T)(prLink))->prNext != (P_LINK_ENTRY_T)NULL)
|
|
||||||
|
|
||||||
#define LINK_ENTRY(ptr, type, member) ENTRY_OF(ptr, type, member)
|
|
||||||
|
|
||||||
/* Insert an entry into a link list's head */
|
|
||||||
#define LINK_INSERT_HEAD(prLink, prEntry) \
|
|
||||||
{ \
|
|
||||||
linkAdd(prEntry, prLink); \
|
|
||||||
((prLink)->u4NumElem)++; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Append an entry into a link list's tail */
|
|
||||||
#define LINK_INSERT_TAIL(prLink, prEntry) \
|
|
||||||
{ \
|
|
||||||
linkAddTail(prEntry, prLink); \
|
|
||||||
((prLink)->u4NumElem)++; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Peek head entry, but keep still in link list */
|
|
||||||
#define LINK_PEEK_HEAD(prLink, _type, _member) \
|
|
||||||
( \
|
|
||||||
LINK_IS_EMPTY(prLink) ? \
|
|
||||||
(_type *)NULL : LINK_ENTRY((prLink)->prNext, _type, _member) \
|
|
||||||
)
|
|
||||||
|
|
||||||
/* Peek tail entry, but keep still in link list */
|
|
||||||
#define LINK_PEEK_TAIL(prLink, _type, _member) \
|
|
||||||
( \
|
|
||||||
LINK_IS_EMPTY(prLink) ? \
|
|
||||||
(_type *)NULL : LINK_ENTRY((prLink)->prPrev, _type, _member) \
|
|
||||||
)
|
|
||||||
|
|
||||||
/* Get first entry from a link list */
|
|
||||||
/* NOTE: We assume the link entry located at the beginning of "prEntry Type",
|
|
||||||
* so that we can cast the link entry to other data type without doubts.
|
|
||||||
* And this macro also decrease the total entry count at the same time.
|
|
||||||
*/
|
|
||||||
#define LINK_REMOVE_HEAD(prLink, prEntry, _P_TYPE) \
|
|
||||||
{ \
|
|
||||||
ASSERT(prLink); \
|
|
||||||
if (LINK_IS_EMPTY(prLink)) { \
|
|
||||||
prEntry = (_P_TYPE)NULL; \
|
|
||||||
} \
|
|
||||||
else { \
|
|
||||||
prEntry = (_P_TYPE)(((P_LINK_T)(prLink))->prNext); \
|
|
||||||
linkDel((P_LINK_ENTRY_T)prEntry); \
|
|
||||||
((prLink)->u4NumElem)--; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Assume the link entry located at the beginning of prEntry Type.
|
|
||||||
* And also decrease the total entry count.
|
|
||||||
*/
|
|
||||||
#define LINK_REMOVE_KNOWN_ENTRY(prLink, prEntry) \
|
|
||||||
{ \
|
|
||||||
ASSERT(prLink); \
|
|
||||||
ASSERT(prEntry); \
|
|
||||||
linkDel((P_LINK_ENTRY_T)prEntry); \
|
|
||||||
((prLink)->u4NumElem)--; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Iterate over a link list */
|
|
||||||
#define LINK_FOR_EACH(prEntry, prLink) \
|
|
||||||
for (prEntry = (prLink)->prNext; \
|
|
||||||
prEntry != (P_LINK_ENTRY_T)(prLink); \
|
|
||||||
prEntry = (P_LINK_ENTRY_T)prEntry->prNext)
|
|
||||||
|
|
||||||
/* Iterate over a link list backwards */
|
|
||||||
#define LINK_FOR_EACH_PREV(prEntry, prLink) \
|
|
||||||
for (prEntry = (prLink)->prPrev; \
|
|
||||||
prEntry != (P_LINK_ENTRY_T)(prLink); \
|
|
||||||
prEntry = (P_LINK_ENTRY_T)prEntry->prPrev)
|
|
||||||
|
|
||||||
/* Iterate over a link list safe against removal of link entry */
|
|
||||||
#define LINK_FOR_EACH_SAFE(prEntry, prNextEntry, prLink) \
|
|
||||||
for (prEntry = (prLink)->prNext, prNextEntry = prEntry->prNext; \
|
|
||||||
prEntry != (P_LINK_ENTRY_T)(prLink); \
|
|
||||||
prEntry = prNextEntry, prNextEntry = prEntry->prNext)
|
|
||||||
|
|
||||||
/* Iterate over a link list of given type */
|
|
||||||
#define LINK_FOR_EACH_ENTRY(prObj, prLink, rMember, _TYPE) \
|
|
||||||
for (prObj = LINK_ENTRY((prLink)->prNext, _TYPE, rMember); \
|
|
||||||
&prObj->rMember != (P_LINK_ENTRY_T)(prLink); \
|
|
||||||
prObj = LINK_ENTRY(prObj->rMember.prNext, _TYPE, rMember))
|
|
||||||
|
|
||||||
/* Iterate backwards over a link list of given type */
|
|
||||||
#define LINK_FOR_EACH_ENTRY_PREV(prObj, prLink, rMember, _TYPE) \
|
|
||||||
for (prObj = LINK_ENTRY((prLink)->prPrev, _TYPE, rMember); \
|
|
||||||
&prObj->rMember != (P_LINK_ENTRY_T)(prLink); \
|
|
||||||
prObj = LINK_ENTRY(prObj->rMember.prPrev, _TYPE, rMember))
|
|
||||||
|
|
||||||
/* Iterate over a link list of given type safe against removal of link entry */
|
|
||||||
#define LINK_FOR_EACH_ENTRY_SAFE(prObj, prNextObj, prLink, rMember, _TYPE) \
|
|
||||||
for (prObj = LINK_ENTRY((prLink)->prNext, _TYPE, rMember), \
|
|
||||||
prNextObj = LINK_ENTRY(prObj->rMember.prNext, _TYPE, rMember); \
|
|
||||||
&prObj->rMember != (P_LINK_ENTRY_T)(prLink); \
|
|
||||||
prObj = prNextObj, \
|
|
||||||
prNextObj = LINK_ENTRY(prNextObj->rMember.prNext, _TYPE, rMember))
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*!
|
|
||||||
* \brief This function is only for internal link list manipulation.
|
|
||||||
*
|
|
||||||
* \param[in] prNew Pointer of new link head
|
|
||||||
* \param[in] prPrev Pointer of previous link head
|
|
||||||
* \param[in] prNext Pointer of next link head
|
|
||||||
*
|
|
||||||
* \return (none)
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
static inline VOID __linkAdd(IN P_LINK_ENTRY_T prNew, IN P_LINK_ENTRY_T prPrev, IN P_LINK_ENTRY_T prNext)
|
|
||||||
{
|
|
||||||
prNext->prPrev = prNew;
|
|
||||||
prNew->prNext = prNext;
|
|
||||||
prNew->prPrev = prPrev;
|
|
||||||
prPrev->prNext = prNew;
|
|
||||||
|
|
||||||
} /* end of __linkAdd() */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*!
|
|
||||||
* \brief This function will add a new entry after the specified link head.
|
|
||||||
*
|
|
||||||
* \param[in] prNew New entry to be added
|
|
||||||
* \param[in] prHead Specified link head to add it after
|
|
||||||
*
|
|
||||||
* \return (none)
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
static inline VOID linkAdd(IN P_LINK_ENTRY_T prNew, IN P_LINK_T prLink)
|
|
||||||
{
|
|
||||||
__linkAdd(prNew, (P_LINK_ENTRY_T) prLink, prLink->prNext);
|
|
||||||
|
|
||||||
} /* end of linkAdd() */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*!
|
|
||||||
* \brief This function will add a new entry before the specified link head.
|
|
||||||
*
|
|
||||||
* \param[in] prNew New entry to be added
|
|
||||||
* \param[in] prHead Specified link head to add it before
|
|
||||||
*
|
|
||||||
* \return (none)
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
static inline VOID linkAddTail(IN P_LINK_ENTRY_T prNew, IN P_LINK_T prLink)
|
|
||||||
{
|
|
||||||
__linkAdd(prNew, prLink->prPrev, (P_LINK_ENTRY_T) prLink);
|
|
||||||
|
|
||||||
} /* end of linkAddTail() */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*!
|
|
||||||
* \brief This function is only for internal link list manipulation.
|
|
||||||
*
|
|
||||||
* \param[in] prPrev Pointer of previous link head
|
|
||||||
* \param[in] prNext Pointer of next link head
|
|
||||||
*
|
|
||||||
* \return (none)
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
static inline VOID __linkDel(IN P_LINK_ENTRY_T prPrev, IN P_LINK_ENTRY_T prNext)
|
|
||||||
{
|
|
||||||
prNext->prPrev = prPrev;
|
|
||||||
prPrev->prNext = prNext;
|
|
||||||
|
|
||||||
} /* end of __linkDel() */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*!
|
|
||||||
* \brief This function will delete a specified entry from link list.
|
|
||||||
* NOTE: the entry is in an initial state.
|
|
||||||
*
|
|
||||||
* \param prEntry Specified link head(entry)
|
|
||||||
*
|
|
||||||
* \return (none)
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
static inline VOID linkDel(IN P_LINK_ENTRY_T prEntry)
|
|
||||||
{
|
|
||||||
__linkDel(prEntry->prPrev, prEntry->prNext);
|
|
||||||
|
|
||||||
LINK_ENTRY_INITIALIZE(prEntry);
|
|
||||||
|
|
||||||
} /* end of linkDel() */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*!
|
|
||||||
* \brief This function will delete a specified entry from link list and then add it
|
|
||||||
* after the specified link head.
|
|
||||||
*
|
|
||||||
* \param[in] prEntry Specified link head(entry)
|
|
||||||
* \param[in] prOtherHead Another link head to add it after
|
|
||||||
*
|
|
||||||
* \return (none)
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
static inline VOID linkMove(IN P_LINK_ENTRY_T prEntry, IN P_LINK_T prLink)
|
|
||||||
{
|
|
||||||
__linkDel(prEntry->prPrev, prEntry->prNext);
|
|
||||||
linkAdd(prEntry, prLink);
|
|
||||||
|
|
||||||
} /* end of linkMove() */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/*!
|
|
||||||
* \brief This function will delete a specified entry from link list and then add it
|
|
||||||
* before the specified link head.
|
|
||||||
*
|
|
||||||
* \param[in] prEntry Specified link head(entry)
|
|
||||||
* \param[in] prOtherHead Another link head to add it before
|
|
||||||
*
|
|
||||||
* \return (none)
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
static inline VOID linkMoveTail(IN P_LINK_ENTRY_T prEntry, IN P_LINK_T prLink)
|
|
||||||
{
|
|
||||||
__linkDel(prEntry->prPrev, prEntry->prNext);
|
|
||||||
linkAddTail(prEntry, prLink);
|
|
||||||
|
|
||||||
} /* end of linkMoveTail() */
|
|
||||||
|
|
||||||
#endif /* _LINK_H */
|
|
|
@ -1,148 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _AA_FSM_H
|
|
||||||
#define _AA_FSM_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Retry interval for retransmiting authentication-request MMPDU. */
|
|
||||||
#define TX_AUTHENTICATION_RETRY_TIMEOUT_TU 100 /* TU. */
|
|
||||||
|
|
||||||
/* Retry interval for retransmiting association-request MMPDU. */
|
|
||||||
#define TX_ASSOCIATION_RETRY_TIMEOUT_TU 100 /* TU. */
|
|
||||||
|
|
||||||
/* Wait for a response to a transmitted authentication-request MMPDU. */
|
|
||||||
#define DOT11_AUTHENTICATION_RESPONSE_TIMEOUT_TU 512 /* TU. */
|
|
||||||
|
|
||||||
/* Wait for a response to a transmitted association-request MMPDU. */
|
|
||||||
#define DOT11_ASSOCIATION_RESPONSE_TIMEOUT_TU 512 /* TU. */
|
|
||||||
|
|
||||||
/* The maximum time to wait for JOIN process complete. */
|
|
||||||
#define JOIN_FAILURE_TIMEOUT_BEACON_INTERVAL 20 /* Beacon Interval, 20 * 100TU = 2 sec. */
|
|
||||||
|
|
||||||
/* Retry interval for next JOIN request. */
|
|
||||||
#define JOIN_RETRY_INTERVAL_SEC 10 /* Seconds */
|
|
||||||
|
|
||||||
/* Maximum Retry Count for accept a JOIN request. */
|
|
||||||
#define JOIN_MAX_RETRY_FAILURE_COUNT 2 /* Times */
|
|
||||||
|
|
||||||
#define JOIN_MAX_RETRY_OVERLOAD_RN 1 /* Times */
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef enum _ENUM_AA_STATE_T {
|
|
||||||
AA_STATE_IDLE = 0,
|
|
||||||
SAA_STATE_SEND_AUTH1,
|
|
||||||
SAA_STATE_WAIT_AUTH2,
|
|
||||||
SAA_STATE_SEND_AUTH3,
|
|
||||||
SAA_STATE_WAIT_AUTH4,
|
|
||||||
SAA_STATE_EXTERNAL_AUTH,
|
|
||||||
SAA_STATE_SEND_ASSOC1,
|
|
||||||
SAA_STATE_WAIT_ASSOC2,
|
|
||||||
AAA_STATE_SEND_AUTH2,
|
|
||||||
AAA_STATE_SEND_AUTH4, /* We may not use, because P2P GO didn't support WEP and 11r */
|
|
||||||
AAA_STATE_SEND_ASSOC2,
|
|
||||||
AA_STATE_RESOURCE, /* A state for debugging the case of out of msg buffer. */
|
|
||||||
AA_STATE_NUM
|
|
||||||
} ENUM_AA_STATE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_AA_FRM_TYPE_T {
|
|
||||||
FRM_DISASSOC = 0,
|
|
||||||
FRM_DEAUTH
|
|
||||||
} ENUM_AA_FRM_TYPE_T;
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines in saa_fsm.c */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID
|
|
||||||
saaFsmSteps(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_STA_RECORD_T prStaRec, IN ENUM_AA_STATE_T eNextState, IN P_SW_RFB_T prRetainedSwRfb);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
saaFsmSendEventJoinComplete(IN P_ADAPTER_T prAdapter,
|
|
||||||
WLAN_STATUS rJoinStatus, P_STA_RECORD_T prStaRec, P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID saaFsmRunEventStart(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
saaFsmRunEventTxDone(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
|
|
||||||
|
|
||||||
VOID saaFsmRunEventTxReqTimeOut(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID saaFsmRunEventRxRespTimeOut(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID saaFsmRunEventRxAuth(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
WLAN_STATUS saaFsmRunEventRxAssoc(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
WLAN_STATUS saaFsmRunEventRxDeauth(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
WLAN_STATUS saaFsmRunEventRxDisassoc(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID saaFsmRunEventAbort(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID saaSendDisconnectMsgHandler(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec,
|
|
||||||
IN P_BSS_INFO_T prAisBssInfo, IN ENUM_AA_FRM_TYPE_T eFrmType);
|
|
||||||
|
|
||||||
VOID saaFsmRunEventFTContinue(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
void saaFsmRunEventExternalAuthDone(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines in aaa_fsm.c */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID aaaFsmRunEventRxAuth(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
WLAN_STATUS aaaFsmRunEventRxAssoc(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
aaaFsmRunEventTxDone(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _AA_FSM_H */
|
|
|
@ -1,473 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _AIS_FSM_H
|
|
||||||
#define _AIS_FSM_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define AIS_BG_SCAN_INTERVAL_MIN_SEC 2 /* 30 // exponential to 960 */
|
|
||||||
#define AIS_BG_SCAN_INTERVAL_MAX_SEC 2 /* 960 // 16min */
|
|
||||||
|
|
||||||
#define AIS_DELAY_TIME_OF_DISC_SEC_ONLY_2G4 2 /* 2.4G scan need about 0.5s, so delay 2s to reconnect is enough */
|
|
||||||
#define AIS_DELAY_TIME_OF_DISC_SEC_DUALBAND 5 /* 2.4G scan need about 3.3s, so delay 5s to reconnect is enough */
|
|
||||||
|
|
||||||
#define AIS_IBSS_ALONE_TIMEOUT_SEC 20 /* seconds */
|
|
||||||
|
|
||||||
#define AIS_BEACON_TIMEOUT_COUNT_ADHOC 30
|
|
||||||
#define AIS_BEACON_TIMEOUT_COUNT_INFRA 10
|
|
||||||
#define AIS_BEACON_TIMEOUT_GUARD_TIME_SEC 1 /* Second */
|
|
||||||
|
|
||||||
#define AIS_BEACON_MAX_TIMEOUT_TU 100
|
|
||||||
#define AIS_BEACON_MIN_TIMEOUT_TU 5
|
|
||||||
#define AIS_BEACON_MAX_TIMEOUT_VALID TRUE
|
|
||||||
#define AIS_BEACON_MIN_TIMEOUT_VALID TRUE
|
|
||||||
|
|
||||||
#define AIS_BMC_MAX_TIMEOUT_TU 100
|
|
||||||
#define AIS_BMC_MIN_TIMEOUT_TU 5
|
|
||||||
#define AIS_BMC_MAX_TIMEOUT_VALID TRUE
|
|
||||||
#define AIS_BMC_MIN_TIMEOUT_VALID TRUE
|
|
||||||
|
|
||||||
#define AIS_JOIN_CH_GRANT_THRESHOLD 10
|
|
||||||
#define AIS_JOIN_CH_REQUEST_INTERVAL 4000
|
|
||||||
|
|
||||||
#define AIS_SCN_DONE_TIMEOUT_SEC 25 /* 25 for 2.4G + 5G */ /* 5 */
|
|
||||||
|
|
||||||
|
|
||||||
#define AIS_AUTORN_MIN_INTERVAL 20
|
|
||||||
#define AIS_BLACKLIST_TIMEOUT 15 /* seconds */
|
|
||||||
|
|
||||||
#define AIS_WAIT_OKC_PMKID_SEC 1000 /* unit: ms */
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef enum _ENUM_AIS_STATE_T {
|
|
||||||
AIS_STATE_IDLE = 0,
|
|
||||||
AIS_STATE_SEARCH,
|
|
||||||
AIS_STATE_SCAN,
|
|
||||||
AIS_STATE_ONLINE_SCAN,
|
|
||||||
AIS_STATE_LOOKING_FOR,
|
|
||||||
AIS_STATE_WAIT_FOR_NEXT_SCAN,
|
|
||||||
AIS_STATE_REQ_CHANNEL_JOIN,
|
|
||||||
AIS_STATE_JOIN,
|
|
||||||
AIS_STATE_IBSS_ALONE,
|
|
||||||
AIS_STATE_IBSS_MERGE,
|
|
||||||
AIS_STATE_NORMAL_TR,
|
|
||||||
AIS_STATE_DISCONNECTING,
|
|
||||||
AIS_STATE_REQ_REMAIN_ON_CHANNEL,
|
|
||||||
AIS_STATE_REMAIN_ON_CHANNEL,
|
|
||||||
AIS_STATE_COLLECT_ESS_INFO,
|
|
||||||
AIS_STATE_NUM
|
|
||||||
} ENUM_AIS_STATE_T;
|
|
||||||
|
|
||||||
/* reconnect level for determining if we should reconnect */
|
|
||||||
typedef enum _ENUM_RECONNECT_LEVEL_T {
|
|
||||||
RECONNECT_LEVEL_MIN = 0,
|
|
||||||
RECONNECT_LEVEL_ROAMING_FAIL, /* roaming failed */
|
|
||||||
RECONNECT_LEVEL_BEACON_TIMEOUT, /* driver beacon timeout */
|
|
||||||
RECONNECT_LEVEL_USER_SET, /* user set connect or disassociate */
|
|
||||||
RECONNECT_LEVEL_MAX
|
|
||||||
} ENUM_RECONNECT_LEVEL_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_AIS_ABORT_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucReasonOfDisconnect;
|
|
||||||
BOOLEAN fgDelayIndication;
|
|
||||||
} MSG_AIS_ABORT_T, *P_MSG_AIS_ABORT_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_AIS_IBSS_PEER_FOUND_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
BOOLEAN fgIsMergeIn; /* TRUE: Merge In, FALSE: Merge Out */
|
|
||||||
P_STA_RECORD_T prStaRec;
|
|
||||||
} MSG_AIS_IBSS_PEER_FOUND_T, *P_MSG_AIS_IBSS_PEER_FOUND_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_AIS_REQUEST_TYPE_T {
|
|
||||||
AIS_REQUEST_SCAN,
|
|
||||||
AIS_REQUEST_RECONNECT,
|
|
||||||
AIS_REQUEST_ROAMING_SEARCH,
|
|
||||||
AIS_REQUEST_ROAMING_CONNECT,
|
|
||||||
AIS_REQUEST_REMAIN_ON_CHANNEL,
|
|
||||||
AIS_REQUEST_NUM
|
|
||||||
} ENUM_AIS_REQUEST_TYPE_T;
|
|
||||||
|
|
||||||
typedef struct _AIS_REQ_HDR_T {
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
ENUM_AIS_REQUEST_TYPE_T eReqType;
|
|
||||||
/* temp save partial scan channel info */
|
|
||||||
PUINT_8 pu8ChannelInfo;
|
|
||||||
} AIS_REQ_HDR_T, *P_AIS_REQ_HDR_T;
|
|
||||||
|
|
||||||
typedef struct _AIS_REQ_CHNL_INFO {
|
|
||||||
ENUM_BAND_T eBand;
|
|
||||||
ENUM_CHNL_EXT_T eSco;
|
|
||||||
UINT_8 ucChannelNum;
|
|
||||||
UINT_32 u4DurationMs;
|
|
||||||
UINT_64 u8Cookie;
|
|
||||||
} AIS_REQ_CHNL_INFO, *P_AIS_REQ_CHNL_INFO;
|
|
||||||
|
|
||||||
typedef struct _AIS_MGMT_TX_REQ_INFO_T {
|
|
||||||
BOOLEAN fgIsMgmtTxRequested;
|
|
||||||
P_MSDU_INFO_T prMgmtTxMsdu;
|
|
||||||
UINT_64 u8Cookie;
|
|
||||||
} AIS_MGMT_TX_REQ_INFO_T, *P_AIS_MGMT_TX_REQ_INFO_T;
|
|
||||||
|
|
||||||
struct AIS_BLACKLIST_ITEM {
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN];
|
|
||||||
UINT_16 u2DeauthReason;
|
|
||||||
UINT_16 u2AuthStatus;
|
|
||||||
UINT_8 ucCount;
|
|
||||||
UINT_8 ucSSIDLen;
|
|
||||||
UINT_8 aucSSID[32];
|
|
||||||
OS_SYSTIME rAddTime;
|
|
||||||
UINT_32 u4DisapperTime;
|
|
||||||
BOOLEAN fgIsInFWKBlacklist;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct AIS_BEACON_TIMEOUT_BSS {
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
|
|
||||||
UINT_64 u8Tsf;
|
|
||||||
UINT_64 u8AddTime;
|
|
||||||
UINT_8 ucReserved;
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN];
|
|
||||||
UINT_8 ucSSIDLen;
|
|
||||||
UINT_8 aucSSID[32];
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct _AIS_FSM_INFO_T {
|
|
||||||
ENUM_AIS_STATE_T ePreviousState;
|
|
||||||
ENUM_AIS_STATE_T eCurrentState;
|
|
||||||
|
|
||||||
BOOLEAN fgTryScan;
|
|
||||||
|
|
||||||
BOOLEAN fgIsInfraChannelFinished;
|
|
||||||
BOOLEAN fgIsChannelRequested;
|
|
||||||
BOOLEAN fgIsChannelGranted;
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_ROAMING
|
|
||||||
BOOLEAN fgIsRoamingScanPending;
|
|
||||||
#endif /* CFG_SUPPORT_ROAMING */
|
|
||||||
|
|
||||||
UINT_8 ucAvailableAuthTypes; /* Used for AUTH_MODE_AUTO_SWITCH */
|
|
||||||
|
|
||||||
P_BSS_DESC_T prTargetBssDesc; /* For destination */
|
|
||||||
|
|
||||||
P_STA_RECORD_T prTargetStaRec; /* For JOIN Abort */
|
|
||||||
|
|
||||||
UINT_32 u4SleepInterval;
|
|
||||||
|
|
||||||
TIMER_T rBGScanTimer;
|
|
||||||
|
|
||||||
TIMER_T rIbssAloneTimer;
|
|
||||||
|
|
||||||
UINT_32 u4PostponeIndStartTime;
|
|
||||||
|
|
||||||
TIMER_T rJoinTimeoutTimer;
|
|
||||||
|
|
||||||
TIMER_T rChannelTimeoutTimer;
|
|
||||||
|
|
||||||
TIMER_T rScanDoneTimer;
|
|
||||||
|
|
||||||
TIMER_T rDeauthDoneTimer;
|
|
||||||
|
|
||||||
TIMER_T rWaitOkcPMKTimer;
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_DETECT_SECURITY_MODE_CHANGE
|
|
||||||
TIMER_T rSecModeChangeTimer;
|
|
||||||
#endif
|
|
||||||
UINT_8 ucSeqNumOfReqMsg;
|
|
||||||
UINT_8 ucSeqNumOfChReq;
|
|
||||||
UINT_8 ucSeqNumOfScanReq;
|
|
||||||
|
|
||||||
UINT_32 u4ChGrantedInterval;
|
|
||||||
|
|
||||||
UINT_8 ucConnTrialCount;
|
|
||||||
#if CFG_MULTI_SSID_SCAN
|
|
||||||
UINT_8 ucScanSSIDNum;
|
|
||||||
PARAM_SSID_T arScanSSID[SCN_SSID_MAX_NUM];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UINT_8 ucScanSSIDLen;
|
|
||||||
UINT_8 aucScanSSID[ELEM_MAX_LEN_SSID];
|
|
||||||
|
|
||||||
UINT_32 u4ScanIELength;
|
|
||||||
UINT_8 aucScanIEBuf[MAX_IE_LENGTH];
|
|
||||||
|
|
||||||
/* Pending Request List */
|
|
||||||
LINK_T rPendingReqList;
|
|
||||||
#if CFG_MULTI_SSID_SCAN
|
|
||||||
/* for roaming target */
|
|
||||||
PARAM_SSID_T rRoamingSSID;/* MULTI SSID */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Join Request Timestamp */
|
|
||||||
OS_SYSTIME rJoinReqTime;
|
|
||||||
|
|
||||||
/* for cfg80211 REMAIN_ON_CHANNEL support */
|
|
||||||
AIS_REQ_CHNL_INFO rChReqInfo;
|
|
||||||
|
|
||||||
/* Mgmt tx related. */
|
|
||||||
AIS_MGMT_TX_REQ_INFO_T rMgmtTxInfo;
|
|
||||||
|
|
||||||
/* Packet filter for AIS module. */
|
|
||||||
UINT_32 u4AisPacketFilter;
|
|
||||||
|
|
||||||
struct LINK_MGMT rBcnTimeout;
|
|
||||||
UINT_8 ucJoinFailCntAfterScan;
|
|
||||||
UINT_8 aucRandomMac[MAC_ADDR_LEN];
|
|
||||||
|
|
||||||
UINT_8 aucNeighborAPChnl[CFG_NEIGHBOR_AP_CHANNEL_NUM];
|
|
||||||
#if CFG_SUPPORT_DYNAMIC_ROAM
|
|
||||||
INT_8 cRoamTriggerThreshold;
|
|
||||||
#endif
|
|
||||||
#if CFG_SCAN_ABORT_HANDLE
|
|
||||||
BOOLEAN fgIsAbortEvnetDuringScan;
|
|
||||||
#endif
|
|
||||||
BOOLEAN fgTargetChnlScanIssued;
|
|
||||||
} AIS_FSM_INFO_T, *P_AIS_FSM_INFO_T;
|
|
||||||
|
|
||||||
enum WNM_AIS_BSS_TRANSITION {
|
|
||||||
BSS_TRANSITION_NO_MORE_ACTION,
|
|
||||||
BSS_TRANSITION_REQ_ROAMING,
|
|
||||||
BSS_TRANSITION_DISASSOC,
|
|
||||||
BSS_TRANSITION_MAX_NUM
|
|
||||||
};
|
|
||||||
struct MSG_AIS_BSS_TRANSITION_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
BOOLEAN fgNeedResponse;
|
|
||||||
enum WNM_AIS_BSS_TRANSITION eTransitionType;
|
|
||||||
};
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define aisChangeMediaState(_prAdapter, _eNewMediaState) \
|
|
||||||
(_prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].eConnectionState = (_eNewMediaState))
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID aisInitializeConnectionSettings(IN P_ADAPTER_T prAdapter, IN P_REG_INFO_T prRegInfo);
|
|
||||||
|
|
||||||
VOID aisFsmInit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID aisFsmUninit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID aisFsmStateInit_JOIN(IN P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
BOOLEAN aisFsmStateInit_RetryJOIN(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID aisFsmStateInit_IBSS_ALONE(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID aisFsmStateInit_IBSS_MERGE(IN P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
VOID aisFsmStateAbort(IN P_ADAPTER_T prAdapter, UINT_8 ucReasonOfDisconnect, BOOLEAN fgDelayIndication);
|
|
||||||
|
|
||||||
VOID aisFsmStateAbort_JOIN(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID aisFsmStateAbort_SCAN(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID aisFsmStateAbort_NORMAL_TR(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID aisFsmStateAbort_IBSS(IN P_ADAPTER_T prAdapter);
|
|
||||||
#if 0
|
|
||||||
VOID aisFsmSetChannelInfo(IN P_ADAPTER_T prAdapter, IN P_MSG_SCN_SCAN_REQ ScanReqMsg, IN ENUM_AIS_STATE_T CurrentState);
|
|
||||||
#endif
|
|
||||||
VOID aisFsmSteps(IN P_ADAPTER_T prAdapter, ENUM_AIS_STATE_T eNextState);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Mailbox Message Handling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID aisFsmRunEventScanDone(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID aisFsmRunEventAbort(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID aisFsmRunEventJoinComplete(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID aisFsmRunEventFoundIBSSPeer(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID aisFsmRunEventRemainOnChannel(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID aisFsmRunEventCancelRemainOnChannel(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Handling for Ad-Hoc Network */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID aisFsmCreateIBSS(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID aisFsmMergeIBSS(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Handling of Incoming Mailbox Message from CNM */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID aisFsmRunEventChGrant(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Generating Outgoing Mailbox Message to CNM */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID aisFsmReleaseCh(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Event Indication */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID
|
|
||||||
aisIndicationOfMediaStateToHost(IN P_ADAPTER_T prAdapter,
|
|
||||||
ENUM_PARAM_MEDIA_STATE_T eConnectionState, BOOLEAN fgDelayIndication);
|
|
||||||
|
|
||||||
VOID aisPostponedEventOfSchedScanReq(IN P_ADAPTER_T prAdapter, P_AIS_FSM_INFO_T prAisFsmInfo);
|
|
||||||
|
|
||||||
VOID aisPostponedEventOfDisconnTimeout(IN P_ADAPTER_T prAdapter, P_AIS_FSM_INFO_T prAisFsmInfo);
|
|
||||||
|
|
||||||
VOID aisUpdateBssInfoForJOIN(IN P_ADAPTER_T prAdapter, P_STA_RECORD_T prStaRec, P_SW_RFB_T prAssocRspSwRfb);
|
|
||||||
|
|
||||||
VOID aisUpdateBssInfoForCreateIBSS(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID aisUpdateBssInfoForMergeIBSS(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
BOOLEAN aisValidateProbeReq(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT PUINT_32 pu4ControlFlags);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
aisFsmRunEventMgmtFrameTxDone(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Disconnection Handling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID aisFsmDisconnect(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgDelayIndication);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Event Handling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID aisBssBeaconTimeout(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID aisBssSecurityChanged(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
aisDeauthXmitComplete(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_ROAMING
|
|
||||||
VOID aisFsmRunEventRoamingDiscovery(IN P_ADAPTER_T prAdapter, UINT_32 u4ReqScan);
|
|
||||||
|
|
||||||
ENUM_AIS_STATE_T aisFsmRoamingScanResultsUpdate(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID aisFsmRoamingDisconnectPrevAP(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prTargetStaRec);
|
|
||||||
|
|
||||||
VOID aisUpdateBssInfoForRoamingAP(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN P_SW_RFB_T prAssocRspSwRfb);
|
|
||||||
#endif /*CFG_SUPPORT_ROAMING */
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Timeout Handling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID aisFsmRunEventBGSleepTimeOut(IN P_ADAPTER_T prAdapter, ULONG ulParam);
|
|
||||||
|
|
||||||
VOID aisFsmRunEventIbssAloneTimeOut(IN P_ADAPTER_T prAdapter, ULONG ulParam);
|
|
||||||
|
|
||||||
VOID aisFsmRunEventJoinTimeout(IN P_ADAPTER_T prAdapter, ULONG ulParam);
|
|
||||||
|
|
||||||
VOID aisFsmRunEventChannelTimeout(IN P_ADAPTER_T prAdapter, ULONG ulParam);
|
|
||||||
|
|
||||||
VOID aisFsmRunEventScanDoneTimeOut(IN P_ADAPTER_T prAdapter, ULONG ulParam);
|
|
||||||
|
|
||||||
VOID aisFsmRunEventDeauthTimeout(IN P_ADAPTER_T prAdapter, ULONG ulParam);
|
|
||||||
#if CFG_SUPPORT_DETECT_SECURITY_MODE_CHANGE
|
|
||||||
VOID aisFsmRunEventSecModeChangeTimeout(IN P_ADAPTER_T prAdapter, ULONG ulParamPtr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* OID/IOCTL Handling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID aisFsmScanRequest(IN P_ADAPTER_T prAdapter, IN P_PARAM_SSID_T prSsid, IN PUINT_8 pucIe, IN UINT_32 u4IeLength);
|
|
||||||
|
|
||||||
#if 1 /* MULTI SSID */
|
|
||||||
VOID aisFsmScanRequestAdv(IN P_ADAPTER_T prAdapter, IN UINT_8 ucSsidNum, IN P_PARAM_SSID_T prSsid,
|
|
||||||
IN PUINT_8 pucIe, IN UINT_32 u4IeLength, IN PUINT_8 paucRandomMac);
|
|
||||||
#endif
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Internal State Checking */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
BOOLEAN aisFsmIsRequestPending(IN P_ADAPTER_T prAdapter, IN ENUM_AIS_REQUEST_TYPE_T eReqType, IN BOOLEAN bRemove);
|
|
||||||
|
|
||||||
P_AIS_REQ_HDR_T aisFsmGetNextRequest(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN aisFsmInsertRequest(IN P_ADAPTER_T prAdapter, IN ENUM_AIS_REQUEST_TYPE_T eReqType);
|
|
||||||
|
|
||||||
VOID aisFsmFlushRequest(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
aisFuncTxMgmtFrame(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_AIS_MGMT_TX_REQ_INFO_T prMgmtTxReqInfo, IN P_MSDU_INFO_T prMgmtTxMsdu, IN UINT_64 u8Cookie);
|
|
||||||
|
|
||||||
VOID aisFsmRunEventMgmtFrameTx(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
#if CFG_SUPPORT_NCHO
|
|
||||||
VOID aisFsmRunEventNchoActionFrameTx(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VOID aisFuncValidateRxActionFrame(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
#if (CFG_REFACTORY_PMKSA == 0)
|
|
||||||
VOID aisFsmRunEventSetOkcPmk(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VOID aisFsmRunEventBssTransition(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID aisCollectNeighborAPChannel(P_ADAPTER_T prAdapter, struct IE_NEIGHBOR_REPORT_T *prNeiRep, UINT_16 u2Length);
|
|
||||||
|
|
||||||
#if defined(CFG_TEST_MGMT_FSM) && (CFG_TEST_MGMT_FSM != 0)
|
|
||||||
VOID aisTest(VOID);
|
|
||||||
#endif /* CFG_TEST_MGMT_FSM */
|
|
||||||
|
|
||||||
VOID aisRefreshFWKBlacklist(P_ADAPTER_T prAdapter);
|
|
||||||
struct AIS_BLACKLIST_ITEM *aisAddBlacklist(P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
|
|
||||||
VOID aisRemoveBlackList(P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
|
|
||||||
VOID aisRemoveTimeoutBlacklist(P_ADAPTER_T prAdapter);
|
|
||||||
struct AIS_BLACKLIST_ITEM *aisQueryBlackList(P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
|
|
||||||
VOID aisRecordBeaconTimeout(P_ADAPTER_T prAdapter, P_BSS_INFO_T prAisBssInfo);
|
|
||||||
VOID aisRemoveBeaconTimeoutEntry(P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
|
|
||||||
UINT_16 aisCalculateBlackListScore(P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
|
|
||||||
VOID aisCollectNeighborAPChannel(P_ADAPTER_T prAdapter,
|
|
||||||
struct IE_NEIGHBOR_REPORT_T *prNeiRep, UINT_16 u2Length);
|
|
||||||
VOID aisRunEventChnlUtilRsp(P_ADAPTER_T prAdapter, P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _AIS_FSM_H */
|
|
|
@ -1,93 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _ASSOC_H
|
|
||||||
#define _ASSOC_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines in assoc.c */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
UINT_16 assocBuildCapabilityInfo(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
WLAN_STATUS assocSendReAssocReqFrame(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
WLAN_STATUS assocCheckTxReAssocReqFrame(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
WLAN_STATUS assocCheckTxReAssocRespFrame(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
assocCheckRxReAssocRspFrameStatus(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT PUINT_16 pu2StatusCode);
|
|
||||||
|
|
||||||
WLAN_STATUS assocSendDisAssocFrame(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN UINT_16 u2ReasonCode);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
assocProcessRxDisassocFrame(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb, IN UINT_8 aucBSSID[], OUT PUINT_16 pu2ReasonCode);
|
|
||||||
|
|
||||||
WLAN_STATUS assocProcessRxAssocReqFrame(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT PUINT_16 pu2StatusCode);
|
|
||||||
|
|
||||||
WLAN_STATUS assocSendReAssocRespFrame(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID assocGenerateMDIE(IN P_ADAPTER_T prAdapter, IN OUT P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
UINT_32 assocCalculateConnIELen(IN P_ADAPTER_T prAdapter,
|
|
||||||
ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
|
||||||
IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID assocGenerateConnIE(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN OUT P_MSDU_INFO_T prMsduInfo);
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _ASSOC_H */
|
|
|
@ -1,115 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _AUTH_H
|
|
||||||
#define _AUTH_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines in auth.c */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID authAddIEChallengeText(IN P_ADAPTER_T prAdapter, IN OUT P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
#if !CFG_SUPPORT_AAA
|
|
||||||
WLAN_STATUS authSendAuthFrame(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN UINT_16 u2TransactionSeqNum);
|
|
||||||
#else
|
|
||||||
WLAN_STATUS
|
|
||||||
authSendAuthFrame(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_STA_RECORD_T prStaRec,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
|
||||||
IN P_SW_RFB_T prFalseAuthSwRfb, IN UINT_16 u2TransactionSeqNum, IN UINT_16 u2StatusCode);
|
|
||||||
#endif /* CFG_SUPPORT_AAA */
|
|
||||||
|
|
||||||
WLAN_STATUS authCheckTxAuthFrame(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN UINT_16 u2TransactionSeqNum);
|
|
||||||
|
|
||||||
WLAN_STATUS authCheckRxAuthFrameTransSeq(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
authCheckRxAuthFrameStatus(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb, IN UINT_16 u2TransactionSeqNum, OUT PUINT_16 pu2StatusCode);
|
|
||||||
|
|
||||||
VOID authHandleIEChallengeText(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb, P_IE_HDR_T prIEHdr);
|
|
||||||
|
|
||||||
WLAN_STATUS authProcessRxAuth2_Auth4Frame(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
authSendDeauthFrame(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_STA_RECORD_T prStaRec,
|
|
||||||
IN P_SW_RFB_T prClassErrSwRfb, IN UINT_16 u2ReasonCode, IN PFN_TX_DONE_HANDLER pfTxDoneHandler);
|
|
||||||
|
|
||||||
WLAN_STATUS authProcessRxDeauthFrame(IN P_SW_RFB_T prSwRfb, IN UINT_8 aucBSSID[], OUT PUINT_16 pu2ReasonCode);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
authProcessRxAuth1Frame(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb,
|
|
||||||
IN UINT_8 aucExpectedBSSID[],
|
|
||||||
IN UINT_16 u2ExpectedAuthAlgNum,
|
|
||||||
IN UINT_16 u2ExpectedTransSeqNum, OUT PUINT_16 pu2ReturnStatusCode);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
authProcessRxAuthFrame(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb,
|
|
||||||
IN P_BSS_INFO_T prBssInfo,
|
|
||||||
OUT PUINT_16 pu2ReturnStatusCode);
|
|
||||||
|
|
||||||
VOID authAddMDIE(IN P_ADAPTER_T prAdapter, IN OUT P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
UINT_32 authCalculateRSNIELen(P_ADAPTER_T prAdapter, ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID authAddRSNIE(IN P_ADAPTER_T prAdapter, IN OUT P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID authHandleFtIEs(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb, P_IE_HDR_T prIEHdr);
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _AUTH_H */
|
|
|
@ -1,159 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _BOW_FSM_H
|
|
||||||
#define _BOW_FSM_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define BOW_BG_SCAN_INTERVAL_MIN_SEC 2 /* 30 // exponential to 960 */
|
|
||||||
#define BOW_BG_SCAN_INTERVAL_MAX_SEC 2 /* 960 // 16min */
|
|
||||||
|
|
||||||
#define BOW_DELAY_TIME_OF_DISCONNECT_SEC 10
|
|
||||||
|
|
||||||
#define BOW_BEACON_TIMEOUT_COUNT_STARTING 10
|
|
||||||
#define BOW_BEACON_TIMEOUT_GUARD_TIME_SEC 1 /* Second */
|
|
||||||
|
|
||||||
#define BOW_BEACON_MAX_TIMEOUT_TU 100
|
|
||||||
#define BOW_BEACON_MIN_TIMEOUT_TU 5
|
|
||||||
#define BOW_BEACON_MAX_TIMEOUT_VALID TRUE
|
|
||||||
#define BOW_BEACON_MIN_TIMEOUT_VALID TRUE
|
|
||||||
|
|
||||||
#define BOW_BMC_MAX_TIMEOUT_TU 100
|
|
||||||
#define BOW_BMC_MIN_TIMEOUT_TU 5
|
|
||||||
#define BOW_BMC_MAX_TIMEOUT_VALID TRUE
|
|
||||||
#define BOW_BMC_MIN_TIMEOUT_VALID TRUE
|
|
||||||
|
|
||||||
#define BOW_JOIN_CH_GRANT_THRESHOLD 10
|
|
||||||
#define BOW_JOIN_CH_REQUEST_INTERVAL 2000
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum _ENUM_BOW_STATE_T {
|
|
||||||
BOW_STATE_IDLE = 0,
|
|
||||||
BOW_STATE_SEARCH,
|
|
||||||
BOW_STATE_SCAN,
|
|
||||||
BOW_STATE_ONLINE_SCAN,
|
|
||||||
BOW_STATE_LOOKING_FOR,
|
|
||||||
BOW_STATE_WAIT_FOR_NEXT_SCAN,
|
|
||||||
BOW_STATE_REQ_CHANNEL_JOIN,
|
|
||||||
BOW_STATE_REQ_CHANNEL_ALONE,
|
|
||||||
BOW_STATE_REQ_CHANNEL_MERGE,
|
|
||||||
BOW_STATE_JOIN,
|
|
||||||
BOW_STATE_IBSS_ALONE,
|
|
||||||
BOW_STATE_IBSS_MERGE,
|
|
||||||
BOW_STATE_NORMAL_TR,
|
|
||||||
BOW_STATE_NUM
|
|
||||||
} ENUM_BOW_STATE_T;
|
|
||||||
|
|
||||||
typedef struct _BOW_FSM_INFO_T {
|
|
||||||
ENUM_BOW_STATE_T ePreviousState;
|
|
||||||
ENUM_BOW_STATE_T eCurrentState;
|
|
||||||
|
|
||||||
BOOLEAN fgTryScan;
|
|
||||||
|
|
||||||
/* Channel Privilege */
|
|
||||||
|
|
||||||
BOOLEAN fgIsInfraChannelFinished;
|
|
||||||
BOOLEAN fgIsChannelRequested;
|
|
||||||
BOOLEAN fgIsChannelGranted;
|
|
||||||
BOOLEAN fgIsScanPending;
|
|
||||||
UINT_32 u4ChGrantedInterval;
|
|
||||||
|
|
||||||
UINT_8 ucPrimaryChannel;
|
|
||||||
ENUM_BAND_T eBand;
|
|
||||||
UINT_16 u2BeaconInterval;
|
|
||||||
|
|
||||||
ENUM_BOW_STATE_T eReturnState; /* Return state after current activity finished or abort. */
|
|
||||||
ENUM_BOW_STATE_T eForwardState; /* Step to next state if ACTION frame is TX successfully. */
|
|
||||||
|
|
||||||
P_BSS_DESC_T prTargetBss; /* BSS of target P2P Device. For Connection/Service Discovery */
|
|
||||||
|
|
||||||
P_STA_RECORD_T prTargetStaRec;
|
|
||||||
P_BSS_DESC_T prTargetBssDesc; /* For destination */
|
|
||||||
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
|
|
||||||
UINT_8 ucRole;
|
|
||||||
|
|
||||||
BOOLEAN fgSupportQoS;
|
|
||||||
|
|
||||||
BOOLEAN fgIsRsponseProbe; /* Indicate if BOW can response probe request frame. */
|
|
||||||
|
|
||||||
/* Sequence number of requested message. */
|
|
||||||
UINT_8 ucSeqNumOfChReq;
|
|
||||||
UINT_8 ucSeqNumOfReqMsg;
|
|
||||||
UINT_8 ucSeqNumOfScnMsg;
|
|
||||||
UINT_8 ucSeqNumOfScanReq;
|
|
||||||
|
|
||||||
UINT_8 ucSeqNumOfCancelMsg;
|
|
||||||
|
|
||||||
UINT_8 ucDialogToken;
|
|
||||||
|
|
||||||
/* Timer */
|
|
||||||
TIMER_T rStartingBeaconTimer; /* For device discovery time of each discovery request from user. */
|
|
||||||
TIMER_T rStartingDiscoveryTimer;
|
|
||||||
TIMER_T rOperationListenTimer; /* For Find phase under operational state. */
|
|
||||||
TIMER_T rFSMTimer; /* A timer used for Action frame timeout usage. */
|
|
||||||
TIMER_T rIndicationOfDisconnectTimer;
|
|
||||||
TIMER_T rChGrantedTimer;
|
|
||||||
|
|
||||||
UINT_8 ucAvailableAuthTypes; /* Used for AUTH_MODE_AUTO_SWITCH */
|
|
||||||
|
|
||||||
} BOW_FSM_INFO_T, *P_BOW_FSM_INFO_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define bowChangeMediaState(_prAdapter, _eNewMediaState) \
|
|
||||||
(_prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX].eConnectionState = (_eNewMediaState))
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,162 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _BSS_H
|
|
||||||
#define _BSS_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* NOTE(Kevin): change define for george */
|
|
||||||
/* #define MAX_LEN_TIM_PARTIAL_BMP (((MAX_ASSOC_ID + 1) + 7) / 8) */ /* Required bits = (MAX_ASSOC_ID + 1) */
|
|
||||||
#define MAX_LEN_TIM_PARTIAL_BMP ((CFG_STA_REC_NUM + 7) / 8)
|
|
||||||
/* reserve length greater than maximum size of STA_REC */ /* obsoleted: Assume we only use AID:1~15 */
|
|
||||||
|
|
||||||
/* CTRL FLAGS for Probe Response */
|
|
||||||
#define BSS_PROBE_RESP_USE_P2P_DEV_ADDR BIT(0)
|
|
||||||
#define BSS_PROBE_RESP_INCLUDE_P2P_IE BIT(1)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define IS_BSS_INDEX_VALID(_ucBssIndex) ((_ucBssIndex) < NETWORK_TYPE_INDEX_NUM)
|
|
||||||
|
|
||||||
|
|
||||||
#define GET_BSS_INFO_BY_INDEX(_prAdapter, _ucBssIndex) \
|
|
||||||
(&((_prAdapter)->rWifiVar.arBssInfo[(_ucBssIndex)]))
|
|
||||||
|
|
||||||
|
|
||||||
#define bssAssignAssocID(_prStaRec) ((_prStaRec)->ucIndex + 1)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines for all Operation Modes */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
P_STA_RECORD_T
|
|
||||||
bssCreateStaRecFromBssDesc(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_STA_TYPE_T eStaType,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
VOID bssComposeNullFrame(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucBuffer, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
bssComposeQoSNullFrame(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PUINT_8 pucBuffer, IN P_STA_RECORD_T prStaRec, IN UINT_8 ucUP, IN BOOLEAN fgSetEOSP);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
bssSendNullFrame(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN PFN_TX_DONE_HANDLER pfTxDoneHandler);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
bssSendQoSNullFrame(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_STA_RECORD_T prStaRec, IN UINT_8 ucUP, IN PFN_TX_DONE_HANDLER pfTxDoneHandler);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines for both IBSS(AdHoc) and BSS(AP) */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID bssGenerateExtSuppRate_IE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
bssBuildBeaconProbeRespFrameCommonIEs(IN P_MSDU_INFO_T prMsduInfo, IN P_BSS_INFO_T prBssInfo, IN PUINT_8 pucDestAddr);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
bssComposeBeaconProbeRespFrameHeaderAndFF(IN PUINT_8 pucBuffer,
|
|
||||||
IN PUINT_8 pucDestAddr,
|
|
||||||
IN PUINT_8 pucOwnMACAddress,
|
|
||||||
IN PUINT_8 pucBSSID, IN UINT_16 u2BeaconInterval, IN UINT_16 u2CapInfo);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
bssSendBeaconProbeResponse(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
|
||||||
IN PUINT_8 pucDestAddr, IN UINT_32 u4ControlFlags);
|
|
||||||
|
|
||||||
WLAN_STATUS bssProcessProbeRequest(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID bssClearClientList(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
VOID bssAddStaRecToClientList(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID bssRemoveStaRecFromClientList(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines for IBSS(AdHoc) only */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID
|
|
||||||
ibssProcessMatchedBeacon(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_BSS_INFO_T prBssInfo, IN P_BSS_DESC_T prBssDesc, IN UINT_8 ucRCPI);
|
|
||||||
|
|
||||||
WLAN_STATUS ibssCheckCapabilityForAdHocMode(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
VOID ibssInitForAdHoc(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
WLAN_STATUS bssUpdateBeaconContent(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines for BSS(AP) only */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID bssInitForAP(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN BOOLEAN fgIsRateUpdate);
|
|
||||||
|
|
||||||
VOID bssUpdateDTIMCount(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex);
|
|
||||||
|
|
||||||
VOID bssSetTIMBitmap(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN UINT_16 u2AssocId);
|
|
||||||
|
|
||||||
P_STA_RECORD_T bssGetClientByAddress(IN P_BSS_INFO_T prBssInfo, PUINT_8 pucMacAddr);
|
|
||||||
|
|
||||||
/*link function to p2p module for txBcnIETable*/
|
|
||||||
|
|
||||||
/* WMM-2.2.2 WMM ACI to AC coding */
|
|
||||||
typedef enum _ENUM_ACI_T {
|
|
||||||
ACI_BE = 0,
|
|
||||||
ACI_BK = 1,
|
|
||||||
ACI_VI = 2,
|
|
||||||
ACI_VO = 3,
|
|
||||||
ACI_NUM
|
|
||||||
} ENUM_ACI_T, *P_ENUM_ACI_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_AC_PRIORITY_T {
|
|
||||||
AC_BK_PRIORITY = 0,
|
|
||||||
AC_BE_PRIORITY,
|
|
||||||
AC_VI_PRIORITY,
|
|
||||||
AC_VO_PRIORITY
|
|
||||||
} ENUM_AC_PRIORITY_T, *P_ENUM_AC_PRIORITY_T;
|
|
||||||
|
|
||||||
#endif /* _BSS_H */
|
|
|
@ -1,200 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _CNM_H
|
|
||||||
#define _CNM_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum _ENUM_CH_REQ_TYPE_T {
|
|
||||||
CH_REQ_TYPE_JOIN,
|
|
||||||
CH_REQ_TYPE_P2P_LISTEN,
|
|
||||||
|
|
||||||
CH_REQ_TYPE_NUM
|
|
||||||
} ENUM_CH_REQ_TYPE_T, *P_ENUM_CH_REQ_TYPE_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_CH_REQ_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
UINT_8 ucTokenID;
|
|
||||||
UINT_8 ucPrimaryChannel;
|
|
||||||
ENUM_CHNL_EXT_T eRfSco;
|
|
||||||
ENUM_BAND_T eRfBand;
|
|
||||||
ENUM_CH_REQ_TYPE_T eReqType;
|
|
||||||
UINT_32 u4MaxInterval; /* In unit of ms */
|
|
||||||
UINT_8 aucBSSID[6];
|
|
||||||
UINT_8 aucReserved[2];
|
|
||||||
} MSG_CH_REQ_T, *P_MSG_CH_REQ_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_CH_ABORT_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
UINT_8 ucTokenID;
|
|
||||||
} MSG_CH_ABORT_T, *P_MSG_CH_ABORT_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_CH_GRANT_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
UINT_8 ucTokenID;
|
|
||||||
UINT_8 ucPrimaryChannel;
|
|
||||||
ENUM_CHNL_EXT_T eRfSco;
|
|
||||||
ENUM_BAND_T eRfBand;
|
|
||||||
ENUM_CH_REQ_TYPE_T eReqType;
|
|
||||||
UINT_32 u4GrantInterval; /* In unit of ms */
|
|
||||||
} MSG_CH_GRANT_T, *P_MSG_CH_GRANT_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_CH_REOCVER_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
UINT_8 ucTokenID;
|
|
||||||
UINT_8 ucPrimaryChannel;
|
|
||||||
ENUM_CHNL_EXT_T eRfSco;
|
|
||||||
ENUM_BAND_T eRfBand;
|
|
||||||
ENUM_CH_REQ_TYPE_T eReqType;
|
|
||||||
} MSG_CH_RECOVER_T, *P_MSG_CH_RECOVER_T;
|
|
||||||
|
|
||||||
struct MSG_REQ_CH_UTIL {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_16 u2Duration;
|
|
||||||
UINT_16 u2ReturnMID;
|
|
||||||
UINT_8 ucChnlNum;
|
|
||||||
UINT_8 aucChnlList[100];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct MSG_CH_UTIL_RSP {
|
|
||||||
MSG_HDR_T rMsgHdr;
|
|
||||||
UINT_8 ucChnlNum;
|
|
||||||
UINT_8 aucChnlList[100];
|
|
||||||
UINT_8 aucChUtil[100];
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct _CNM_INFO_T {
|
|
||||||
UINT_32 u4Reserved;
|
|
||||||
|
|
||||||
UINT_16 u2ReturnMID;
|
|
||||||
TIMER_T rReqChnlUtilTimer;
|
|
||||||
} CNM_INFO_T, *P_CNM_INFO_T;
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
/* Moved from p2p_fsm.h */
|
|
||||||
typedef struct _DEVICE_TYPE_T {
|
|
||||||
UINT_16 u2CategoryId; /* Category ID */
|
|
||||||
UINT_8 aucOui[4]; /* OUI */
|
|
||||||
UINT_16 u2SubCategoryId; /* Sub Category ID */
|
|
||||||
} __KAL_ATTRIB_PACKED__ DEVICE_TYPE_T, *P_DEVICE_TYPE_T;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID cnmInit(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID cnmUninit(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID cnmChMngrRequestPrivilege(P_ADAPTER_T prAdapter, P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID cnmChMngrAbortPrivilege(P_ADAPTER_T prAdapter, P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID cnmChMngrHandleChEvent(P_ADAPTER_T prAdapter, P_WIFI_EVENT_T prEvent);
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
cnmPreferredChannel(P_ADAPTER_T prAdapter, P_ENUM_BAND_T prBand, PUINT_8 pucPrimaryChannel, P_ENUM_CHNL_EXT_T prBssSCO);
|
|
||||||
|
|
||||||
BOOLEAN cnmAisInfraChannelFixed(P_ADAPTER_T prAdapter, P_ENUM_BAND_T prBand, PUINT_8 pucPrimaryChannel);
|
|
||||||
|
|
||||||
VOID cnmAisInfraConnectNotify(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN cnmAisIbssIsPermitted(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN cnmP2PIsPermitted(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN cnmBowIsPermitted(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN cnmBss40mBwPermitted(P_ADAPTER_T prAdapter, ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx);
|
|
||||||
#if CFG_P2P_LEGACY_COEX_REVISE
|
|
||||||
BOOLEAN cnmAisDetectP2PChannel(P_ADAPTER_T prAdapter, P_ENUM_BAND_T prBand, PUINT_8 pucPrimaryChannel);
|
|
||||||
#endif
|
|
||||||
VOID cnmRunEventReqChnlUtilTimeout(IN P_ADAPTER_T prAdapter, ULONG ulParamPtr);
|
|
||||||
VOID cnmHandleChannelUtilization(P_ADAPTER_T prAdapter,
|
|
||||||
struct EVENT_RSP_CHNL_UTILIZATION *prChnlUtil);
|
|
||||||
VOID cnmRequestChannelUtilization(P_ADAPTER_T prAdapter, P_MSG_HDR_T prMsgHdr);
|
|
||||||
BOOLEAN cnmChUtilIsRunning(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#ifndef _lint
|
|
||||||
/* We don't have to call following function to inspect the data structure.
|
|
||||||
* It will check automatically while at compile time.
|
|
||||||
* We'll need this to guarantee the same member order in different structures
|
|
||||||
* to simply handling effort in some functions.
|
|
||||||
*/
|
|
||||||
static inline VOID cnmMsgDataTypeCheck(VOID)
|
|
||||||
{
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSG_CH_GRANT_T, rMsgHdr) == 0);
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSG_CH_GRANT_T, rMsgHdr) == OFFSET_OF(MSG_CH_RECOVER_T, rMsgHdr));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSG_CH_GRANT_T, ucNetTypeIndex) ==
|
|
||||||
OFFSET_OF(MSG_CH_RECOVER_T, ucNetTypeIndex));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSG_CH_GRANT_T, ucTokenID) == OFFSET_OF(MSG_CH_RECOVER_T, ucTokenID));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSG_CH_GRANT_T, ucPrimaryChannel) ==
|
|
||||||
OFFSET_OF(MSG_CH_RECOVER_T, ucPrimaryChannel));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSG_CH_GRANT_T, eRfSco) == OFFSET_OF(MSG_CH_RECOVER_T, eRfSco));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSG_CH_GRANT_T, eRfBand) == OFFSET_OF(MSG_CH_RECOVER_T, eRfBand));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSG_CH_GRANT_T, eReqType) == OFFSET_OF(MSG_CH_RECOVER_T, eReqType));
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif /* _lint */
|
|
||||||
|
|
||||||
#endif /* _CNM_H */
|
|
|
@ -1,777 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _CNM_MEM_H
|
|
||||||
#define _CNM_MEM_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#include "qosmap.h"
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef POWER_OF_2
|
|
||||||
#define POWER_OF_2(n) BIT(n)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Size of a basic management buffer block in power of 2 */
|
|
||||||
#define MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2 7 /* 7 to the power of 2 = 128 */
|
|
||||||
#define MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2 5 /* 5 to the power of 2 = 32 */
|
|
||||||
|
|
||||||
/* Size of a basic management buffer block */
|
|
||||||
#define MGT_BUF_BLOCK_SIZE POWER_OF_2(MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2)
|
|
||||||
#define MSG_BUF_BLOCK_SIZE POWER_OF_2(MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2)
|
|
||||||
|
|
||||||
/* Total size of (n) basic management buffer blocks */
|
|
||||||
#define MGT_BUF_BLOCKS_SIZE(n) ((UINT_32)(n) << MGT_BUF_BLOCK_SIZE_IN_POWER_OF_2)
|
|
||||||
#define MSG_BUF_BLOCKS_SIZE(n) ((UINT_32)(n) << MSG_BUF_BLOCK_SIZE_IN_POWER_OF_2)
|
|
||||||
|
|
||||||
/* Number of management buffer block */
|
|
||||||
#define MAX_NUM_OF_BUF_BLOCKS 32 /* Range: 1~32 */
|
|
||||||
|
|
||||||
/* Size of overall management frame buffer */
|
|
||||||
#define MGT_BUFFER_SIZE (MAX_NUM_OF_BUF_BLOCKS * MGT_BUF_BLOCK_SIZE)
|
|
||||||
#define MSG_BUFFER_SIZE (MAX_NUM_OF_BUF_BLOCKS * MSG_BUF_BLOCK_SIZE)
|
|
||||||
|
|
||||||
/* STA_REC related definitions */
|
|
||||||
#define STA_REC_INDEX_BMCAST 0xFF
|
|
||||||
#define STA_REC_INDEX_NOT_FOUND 0xFE
|
|
||||||
#define STA_WAIT_QUEUE_NUM 5 /* Number of SW queues in each STA_REC: AC0~AC4 */
|
|
||||||
#define SC_CACHE_INDEX_NUM 5 /* Number of SC caches in each STA_REC: AC0~AC4 */
|
|
||||||
|
|
||||||
/* P2P related definitions */
|
|
||||||
#ifdef CFG_ENABLE_WIFI_DIRECT
|
|
||||||
/* Moved from p2p_fsm.h */
|
|
||||||
#define WPS_ATTRI_MAX_LEN_DEVICE_NAME 32 /* 0x1011 */
|
|
||||||
#define P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT 8 /* NOTE(Kevin): Shall <= 16 */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#if ((MAX_NUM_OF_BUF_BLOCKS > 32) || (MAX_NUM_OF_BUF_BLOCKS <= 0))
|
|
||||||
#error > #define MAX_NUM_OF_MGT_BUF_BLOCKS : Out of boundary !
|
|
||||||
#elif MAX_NUM_OF_BUF_BLOCKS > 16
|
|
||||||
typedef UINT_32 BUF_BITMAP;
|
|
||||||
#elif MAX_NUM_OF_BUF_BLOCKS > 8
|
|
||||||
typedef UINT_16 BUF_BITMAP;
|
|
||||||
#else
|
|
||||||
typedef UINT_8 BUF_BITMAP;
|
|
||||||
#endif /* MAX_NUM_OF_MGT_BUF_BLOCKS */
|
|
||||||
|
|
||||||
/* Control variable of TX management memory pool */
|
|
||||||
typedef struct _BUF_INFO_T {
|
|
||||||
PUINT_8 pucBuf;
|
|
||||||
|
|
||||||
#if CFG_DBG_MGT_BUF
|
|
||||||
UINT_32 u4AllocCount;
|
|
||||||
UINT_32 u4FreeCount;
|
|
||||||
UINT_32 u4AllocNullCount;
|
|
||||||
#endif /* CFG_DBG_MGT_BUF */
|
|
||||||
|
|
||||||
BUF_BITMAP rFreeBlocksBitmap;
|
|
||||||
UINT_8 aucAllocatedBlockNum[MAX_NUM_OF_BUF_BLOCKS];
|
|
||||||
} BUF_INFO_T, *P_BUF_INFO_T;
|
|
||||||
|
|
||||||
/* Wi-Fi divides RAM into three types
|
|
||||||
* MSG: Mailbox message (Small size)
|
|
||||||
* BUF: HW DMA buffers (HIF/MAC)
|
|
||||||
*/
|
|
||||||
typedef enum _ENUM_RAM_TYPE_T {
|
|
||||||
RAM_TYPE_MSG = 0,
|
|
||||||
RAM_TYPE_BUF
|
|
||||||
} ENUM_RAM_TYPE_T, P_ENUM_RAM_TYPE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_BUFFER_SOURCE_T {
|
|
||||||
BUFFER_SOURCE_HIF_TX0 = 0,
|
|
||||||
BUFFER_SOURCE_HIF_TX1,
|
|
||||||
BUFFER_SOURCE_MAC_RX,
|
|
||||||
BUFFER_SOURCE_MNG,
|
|
||||||
BUFFER_SOURCE_BCN,
|
|
||||||
BUFFER_SOURCE_NUM
|
|
||||||
} ENUM_BUFFER_SOURCE_T, *P_ENUM_BUFFER_SOURCE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_SEC_STATE_T {
|
|
||||||
SEC_STATE_INIT,
|
|
||||||
SEC_STATE_INITIATOR_PORT_BLOCKED,
|
|
||||||
SEC_STATE_RESPONDER_PORT_BLOCKED,
|
|
||||||
SEC_STATE_CHECK_OK,
|
|
||||||
SEC_STATE_SEND_EAPOL,
|
|
||||||
SEC_STATE_SEND_DEAUTH,
|
|
||||||
SEC_STATE_COUNTERMEASURE,
|
|
||||||
SEC_STATE_NUM
|
|
||||||
} ENUM_SEC_STATE_T;
|
|
||||||
|
|
||||||
typedef struct _TSPEC_ENTRY_T {
|
|
||||||
UINT_8 ucStatus;
|
|
||||||
UINT_8 ucToken; /* Dialog Token in ADDTS_REQ or ADDTS_RSP */
|
|
||||||
UINT_16 u2MediumTime;
|
|
||||||
UINT_32 u4TsInfo;
|
|
||||||
/* PARAM_QOS_TS_INFO rParamTsInfo; */
|
|
||||||
/* Add other retained QoS parameters below */
|
|
||||||
} TSPEC_ENTRY_T, *P_TSPEC_ENTRY_T, TSPEC_TABLE_ENTRY_T, *P_TSPEC_TABLE_ENTRY_T;
|
|
||||||
|
|
||||||
typedef struct _SEC_INFO_T {
|
|
||||||
|
|
||||||
ENUM_SEC_STATE_T ePreviousState;
|
|
||||||
ENUM_SEC_STATE_T eCurrentState;
|
|
||||||
|
|
||||||
BOOLEAN fg2nd1xSend;
|
|
||||||
BOOLEAN fgKeyStored;
|
|
||||||
|
|
||||||
UINT_8 aucStoredKey[64];
|
|
||||||
|
|
||||||
BOOLEAN fgAllowOnly1x;
|
|
||||||
} SEC_INFO_T, *P_SEC_INFO_T;
|
|
||||||
|
|
||||||
#define MAX_NUM_CONCURRENT_FRAGMENTED_MSDUS 3
|
|
||||||
|
|
||||||
#define UPDATE_BSS_RSSI_INTERVAL_SEC 3 /* Seconds */
|
|
||||||
|
|
||||||
/* Fragment information structure */
|
|
||||||
typedef struct _FRAG_INFO_T {
|
|
||||||
UINT_16 u2NextFragSeqCtrl;
|
|
||||||
PUINT_8 pucNextFragStart;
|
|
||||||
P_SW_RFB_T pr1stFrag;
|
|
||||||
OS_SYSTIME rReceiveLifetimeLimit; /* The receive time of 1st fragment */
|
|
||||||
} FRAG_INFO_T, *P_FRAG_INFO_T;
|
|
||||||
|
|
||||||
typedef struct _STAT_CNT_INFO_FW_T {
|
|
||||||
UINT32 u4NumOfTx; /* number of packets sent from host */
|
|
||||||
UINT32 u4NumOfTxOK; /* number of packets sent to air OK */
|
|
||||||
UINT32 u4NumOfTxRetry; /* number of packets sent to air RETRY */
|
|
||||||
UINT32 u4TxDoneAirTimeMax; /* maximum tx done air time */
|
|
||||||
|
|
||||||
UINT32 u4NumOfPtiRspTxOk; /* number of PTI RSP sent to air OK */
|
|
||||||
UINT32 u4NumOfPtiRspTxErr; /* number of PTI RSP sent to air ERROR */
|
|
||||||
|
|
||||||
UINT32 u4NumOfTxErr; /* number of packets sent to air ERROR */
|
|
||||||
|
|
||||||
UINT32 u4NumOfRx; /* number of received packets */
|
|
||||||
UINT32 u4NumOfPtiRspRx; /* number of PTI RSP rcv */
|
|
||||||
|
|
||||||
#define STAT_CNT_INFO_TX_ERR_FLUSHED 0x00000001
|
|
||||||
#define STAT_CNT_INFO_TX_ERR_AGE_TIMEOUT 0x00000002
|
|
||||||
#define STAT_CNT_INFO_TX_ERR_MPDU 0x00000004
|
|
||||||
#define STAT_CNT_INFO_TX_ERR_RTS 0x00000010
|
|
||||||
#define STAT_CNT_INFO_TX_ERR_LIFETIME 0x00000020
|
|
||||||
#define STAT_CNT_INFO_TX_ERR_UNKNOWN 0x80000000
|
|
||||||
UINT32 u4TxErrBitmap; /* TX error type */
|
|
||||||
|
|
||||||
#define STAT_CNT_INFO_MAX_TX_RATE_OK_HIS_NUM 10 /* TX OK history */
|
|
||||||
UINT8 aucTxRateOkHis[STAT_CNT_INFO_MAX_TX_RATE_OK_HIS_NUM][2];
|
|
||||||
UINT32 u4TxRateOkHisId;
|
|
||||||
|
|
||||||
#define STAT_CNT_INFO_MAX_RATE_ID (32) /* MCS0 ~ MCS31 */
|
|
||||||
UINT32 aucTxRateMap[STAT_CNT_INFO_MAX_RATE_ID];
|
|
||||||
UINT32 aucRxRateMap[STAT_CNT_INFO_MAX_RATE_ID];
|
|
||||||
|
|
||||||
UINT8 aucStateHis[100][3]; /* State history */
|
|
||||||
UINT32 u4StateHisId; /* history ID */
|
|
||||||
} STAT_CNT_INFO_FW_T;
|
|
||||||
|
|
||||||
typedef struct _STAT_CNT_INFO_DRV_T {
|
|
||||||
|
|
||||||
UINT32 u4NumOfTxFromOs; /* number of packets sent from OS */
|
|
||||||
UINT32 u4NumOfTxQueFull; /* number of packets dropped due to queue full */
|
|
||||||
UINT32 u4NumOfTxToFw; /* number of packets sent to firmware */
|
|
||||||
|
|
||||||
STAT_CNT_INFO_FW_T rFw;
|
|
||||||
} STAT_CNT_INFO_DRV_T;
|
|
||||||
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_802_11W
|
|
||||||
/* AP PMF */
|
|
||||||
struct AP_PMF_CFG {
|
|
||||||
BOOLEAN fgMfpc;
|
|
||||||
BOOLEAN fgMfpr;
|
|
||||||
BOOLEAN fgSha256;
|
|
||||||
BOOLEAN fgAPApplyPmfReq;
|
|
||||||
BOOLEAN fgBipKeyInstalled;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct STA_PMF_CFG {
|
|
||||||
BOOLEAN fgMfpc;
|
|
||||||
BOOLEAN fgMfpr;
|
|
||||||
BOOLEAN fgSha256;
|
|
||||||
BOOLEAN fgSaeRequireMfp;
|
|
||||||
BOOLEAN fgApplyPmf;
|
|
||||||
BOOLEAN fgBipKeyInstalled;
|
|
||||||
|
|
||||||
/* for certification 4.3.3.1, 4.3.3.2 TX unprotected deauth */
|
|
||||||
BOOLEAN fgRxDeauthResp;
|
|
||||||
|
|
||||||
/* For PMF SA query TX request retry a timer */
|
|
||||||
/* record the start time of 1st SAQ request */
|
|
||||||
UINT_32 u4SAQueryStart;
|
|
||||||
UINT_32 u4SAQueryCount;
|
|
||||||
UINT_8 ucSAQueryTimedOut; /* retry more than 1000ms */
|
|
||||||
TIMER_T rSAQueryTimer;
|
|
||||||
UINT_16 u2TransactionID;
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define STA record structure */
|
|
||||||
struct _STA_RECORD_T {
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
UINT_8 ucIndex; /* Not modify it except initializing */
|
|
||||||
|
|
||||||
BOOLEAN fgIsInUse; /* Indicate if this entry is in use or not */
|
|
||||||
UINT_8 aucMacAddr[MAC_ADDR_LEN]; /* MAC address */
|
|
||||||
|
|
||||||
/* SAA/AAA */
|
|
||||||
ENUM_AA_STATE_T eAuthAssocState; /* Store STATE Value used in SAA/AAA */
|
|
||||||
UINT_8 ucAuthAssocReqSeqNum;
|
|
||||||
|
|
||||||
ENUM_STA_TYPE_T eStaType; /* Indicate the role of this STA in
|
|
||||||
* the network (for example, P2P GO)
|
|
||||||
*/
|
|
||||||
|
|
||||||
UINT_8 ucNetTypeIndex; /* ENUM_NETWORK_TYPE_INDEX_T */
|
|
||||||
|
|
||||||
UINT_8 ucStaState; /* STATE_1,2,3 */
|
|
||||||
|
|
||||||
UINT_8 ucPhyTypeSet; /* Available PHY Type Set of this peer
|
|
||||||
* (may deduced from received BSS_DESC_T)
|
|
||||||
*/
|
|
||||||
UINT_8 ucDesiredPhyTypeSet; /* The match result by AND operation of peer's
|
|
||||||
* PhyTypeSet and ours.
|
|
||||||
*/
|
|
||||||
BOOLEAN fgHasBasicPhyType; /* A flag to indicate a Basic Phy Type which
|
|
||||||
* is used to generate some Phy Attribute IE
|
|
||||||
* (e.g. capability, MIB) during association.
|
|
||||||
*/
|
|
||||||
UINT_8 ucNonHTBasicPhyType; /* The Basic Phy Type chosen among the
|
|
||||||
* ucDesiredPhyTypeSet.
|
|
||||||
*/
|
|
||||||
|
|
||||||
UINT_16 u2CapInfo; /* For Infra Mode, to store Capability Info. from Association Resp(SAA).
|
|
||||||
* For AP Mode, to store Capability Info. from Association Req(AAA).
|
|
||||||
*/
|
|
||||||
UINT_16 u2AssocId; /* For Infra Mode, to store AID from Association Resp(SAA).
|
|
||||||
* For AP Mode, to store the Assigned AID(AAA).
|
|
||||||
*/
|
|
||||||
|
|
||||||
UINT_16 u2ListenInterval; /* Listen Interval from STA(AAA) */
|
|
||||||
|
|
||||||
UINT_16 u2DesiredNonHTRateSet; /* Our Current Desired Rate Set after
|
|
||||||
* match with STA's Operational Rate Set
|
|
||||||
*/
|
|
||||||
|
|
||||||
UINT_16 u2OperationalRateSet; /* Operational Rate Set of peer BSS */
|
|
||||||
UINT_16 u2BSSBasicRateSet; /* Basic Rate Set of peer BSS */
|
|
||||||
|
|
||||||
BOOLEAN fgIsMerging; /* For IBSS Mode, to indicate that Merge is ongoing */
|
|
||||||
|
|
||||||
BOOLEAN fgDiagnoseConnection; /*
|
|
||||||
* For Infra/AP Mode, to diagnose the Connection with
|
|
||||||
* this peer by sending ProbeReq/Null frame
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
/* 802.11n HT capabilities when (prStaRec->ucPhyTypeSet & PHY_TYPE_BIT_HT) is true */
|
|
||||||
/* They have the same definition with fields of information element */
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
UINT_8 ucMcsSet; /* MCS0~7 rate set of peer BSS */
|
|
||||||
BOOLEAN fgSupMcs32; /* MCS32 is supported by peer BSS */
|
|
||||||
UINT_16 u2HtCapInfo; /* HT cap info field by HT cap IE */
|
|
||||||
UINT_8 ucAmpduParam; /* Field A-MPDU Parameters in HT cap IE */
|
|
||||||
UINT_16 u2HtExtendedCap; /* HT extended cap field by HT cap IE */
|
|
||||||
UINT_32 u4TxBeamformingCap; /* TX beamforming cap field by HT cap IE */
|
|
||||||
UINT_8 ucAselCap; /* ASEL cap field by HT cap IE */
|
|
||||||
|
|
||||||
UINT_8 ucRCPI; /* RCPI of peer */
|
|
||||||
|
|
||||||
UINT_8 ucDTIMPeriod; /* Target BSS's DTIM Period, we use this
|
|
||||||
* value for setup Listen Interval
|
|
||||||
* TODO(Kevin): TBD
|
|
||||||
*/
|
|
||||||
UINT_8 ucAuthAlgNum; /* For Infra/AP Mode, the Auth Algorithm Num used in Authentication(SAA/AAA) */
|
|
||||||
UINT_8 ucAuthTranNum; /* For Infra/AP Mode, the Auth Transaction Number */
|
|
||||||
BOOLEAN fgIsReAssoc; /* For Infra/AP Mode, to indicate ReAssoc Frame was in used(SAA/AAA) */
|
|
||||||
|
|
||||||
UINT_8 ucTxAuthAssocRetryCount; /* For Infra Mode, the Retry Count of TX Auth/Assod Frame(SAA) */
|
|
||||||
UINT_8 ucTxAuthAssocRetryLimit; /* For Infra Mode, the Retry Limit of TX Auth/Assod Frame(SAA) */
|
|
||||||
|
|
||||||
UINT_16 u2StatusCode; /* Status of Auth/Assoc Req */
|
|
||||||
UINT_16 u2ReasonCode; /* Reason that been Deauth/Disassoc */
|
|
||||||
|
|
||||||
P_IE_CHALLENGE_TEXT_T prChallengeText; /* Point to an allocated buffer for storing Challenge Text
|
|
||||||
* for Shared Key Authentication
|
|
||||||
*/
|
|
||||||
|
|
||||||
TIMER_T rTxReqDoneOrRxRespTimer; /* For Infra Mode, a timer used to send a timeout event
|
|
||||||
* while waiting for TX request done or RX response.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
/* Power Management related fields (for STA/ AP/ P2P/ BOW power saving mode) */
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
BOOLEAN fgSetPwrMgtBit; /* For Infra Mode, to indicate that outgoing frame need toggle
|
|
||||||
* the Pwr Mgt Bit in its Frame Control Field.
|
|
||||||
*/
|
|
||||||
|
|
||||||
BOOLEAN fgIsInPS; /*
|
|
||||||
* For AP Mode, to indicate the client PS state(PM).
|
|
||||||
* TRUE: In PS Mode; FALSE: In Active Mode.
|
|
||||||
*/
|
|
||||||
|
|
||||||
BOOLEAN fgIsInPsPollSP; /* For Infra Mode, to indicate we've sent a PS POLL to AP and start
|
|
||||||
* the PS_POLL Service Period(LP)
|
|
||||||
*/
|
|
||||||
|
|
||||||
BOOLEAN fgIsInTriggerSP; /* For Infra Mode, to indicate we've sent a Trigger Frame to AP and start
|
|
||||||
* the Delivery Service Period(LP)
|
|
||||||
*/
|
|
||||||
|
|
||||||
UINT_8 ucBmpDeliveryAC; /* 0: AC0, 1: AC1, 2: AC2, 3: AC3 */
|
|
||||||
|
|
||||||
UINT_8 ucBmpTriggerAC; /* 0: AC0, 1: AC1, 2: AC2, 3: AC3 */
|
|
||||||
|
|
||||||
UINT_8 ucUapsdSp; /* Max SP length */
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
BOOLEAN fgIsRtsEnabled;
|
|
||||||
|
|
||||||
OS_SYSTIME rUpdateTime; /* (4) System Timestamp of Successful TX and RX */
|
|
||||||
|
|
||||||
OS_SYSTIME rLastJoinTime; /* (4) System Timestamp of latest JOIN process */
|
|
||||||
|
|
||||||
UINT_8 ucJoinFailureCount; /* Retry Count of JOIN process */
|
|
||||||
|
|
||||||
LINK_T arStaWaitQueue[STA_WAIT_QUEUE_NUM]; /* For TXM to defer pkt forwarding to MAC TX DMA */
|
|
||||||
|
|
||||||
UINT_16 au2CachedSeqCtrl[TID_NUM + 1]; /* Duplicate removal for HT STA on a per-TID basis
|
|
||||||
* ("+1" is for MMPDU and non-QoS)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* RXM */
|
|
||||||
P_RX_BA_ENTRY_T aprRxBaTable[TID_NUM];
|
|
||||||
|
|
||||||
/* TXM */
|
|
||||||
P_TX_BA_ENTRY_T aprTxBaTable[TID_NUM];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FRAG_INFO_T rFragInfo[MAX_NUM_CONCURRENT_FRAGMENTED_MSDUS];
|
|
||||||
|
|
||||||
SEC_INFO_T rSecInfo; /* The security state machine */
|
|
||||||
|
|
||||||
BOOLEAN fgPortBlock; /* The 802.1x Port Control flag */
|
|
||||||
|
|
||||||
BOOLEAN fgTransmitKeyExist; /* Unicast key exist for this STA */
|
|
||||||
|
|
||||||
UINT_8 ucWTEntry;
|
|
||||||
|
|
||||||
BOOLEAN fgTxAmpduEn; /* Enable TX AMPDU for this Peer */
|
|
||||||
BOOLEAN fgRxAmpduEn; /* Enable RX AMPDU for this Peer */
|
|
||||||
|
|
||||||
PUINT_8 pucAssocReqIe;
|
|
||||||
UINT_16 u2AssocReqIeLen;
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
/* WMM/QoS related fields */
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
BOOLEAN fgIsQoS; /* If the STA is associated as a QSTA or QAP (for TX/RX) */
|
|
||||||
BOOLEAN fgIsWmmSupported; /* If the peer supports WMM, set to TRUE (for association) */
|
|
||||||
BOOLEAN fgIsUapsdSupported; /* Set according to the scan result (for association) */
|
|
||||||
BOOLEAN afgAcmRequired[ACI_NUM];
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
/* P2P related fields */
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
UINT_8 u2DevNameLen;
|
|
||||||
UINT_8 aucDevName[WPS_ATTRI_MAX_LEN_DEVICE_NAME];
|
|
||||||
|
|
||||||
UINT_8 aucDevAddr[MAC_ADDR_LEN]; /* P2P Device Address */
|
|
||||||
|
|
||||||
UINT_16 u2ConfigMethods;
|
|
||||||
|
|
||||||
UINT_8 ucDeviceCap;
|
|
||||||
|
|
||||||
UINT_8 ucSecondaryDevTypeCount;
|
|
||||||
|
|
||||||
DEVICE_TYPE_T rPrimaryDevTypeBE;
|
|
||||||
|
|
||||||
DEVICE_TYPE_T arSecondaryDevTypeBE[P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT];
|
|
||||||
#endif /* CFG_SUPPORT_P2P */
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
/* QM related fields */
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
UINT_8 ucFreeQuota; /*
|
|
||||||
* Per Sta flow controal. Valid when fgIsInPS is TRUE.
|
|
||||||
* Change it for per Queue flow control
|
|
||||||
*/
|
|
||||||
/* UINT_8 aucFreeQuotaPerQueue[NUM_OF_PER_STA_TX_QUEUES]; */ /* used in future */
|
|
||||||
UINT_8 ucFreeQuotaForDelivery;
|
|
||||||
UINT_8 ucFreeQuotaForNonDelivery;
|
|
||||||
#if CFG_ENABLE_PKT_LIFETIME_PROFILE && CFG_ENABLE_PER_STA_STATISTICS
|
|
||||||
UINT_32 u4TotalTxPktsNumber;
|
|
||||||
UINT_32 u4TotalTxPktsTime;
|
|
||||||
UINT_32 u4TotalTxPktsHifTime;
|
|
||||||
|
|
||||||
UINT_32 u4MaxTxPktsTime;
|
|
||||||
UINT_32 u4MaxTxPktsHifTime;
|
|
||||||
|
|
||||||
UINT_32 u4ThresholdCounter;
|
|
||||||
UINT_32 u4EnqeueuCounter;
|
|
||||||
UINT_32 u4DeqeueuCounter;
|
|
||||||
UINT_32 u4PrevIntCount;
|
|
||||||
UINT_32 u4ThisIntCount;
|
|
||||||
UINT_32 u4NoTcResource;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
/* To be removed, this is to make que_mgt compilation success only */
|
|
||||||
/*------------------------------------------------------------------------------------------*/
|
|
||||||
/* When this STA_REC is in use, set to TRUE. */
|
|
||||||
BOOLEAN fgIsValid;
|
|
||||||
|
|
||||||
BOOLEAN fgIsTxAllowed;
|
|
||||||
BOOLEAN fgIsTxKeyReady;
|
|
||||||
|
|
||||||
/* Per-STA Queues: [0] AC0, [1] AC1, [2] AC2, [3] AC3, [4] 802.1x */
|
|
||||||
QUE_T arTxQueue[NUM_OF_PER_STA_TX_QUEUES];
|
|
||||||
|
|
||||||
/* When this STA is in PS Mode, set to TRUE. */
|
|
||||||
/* BOOLEAN fgIsPS; */
|
|
||||||
|
|
||||||
/* When this STA enters Power-Saving, FW will notify the driver with a Session ID */
|
|
||||||
UINT_8 ucPsSessionID;
|
|
||||||
|
|
||||||
BOOLEAN fgIsAp;
|
|
||||||
|
|
||||||
/* Reorder Parameter reference table */
|
|
||||||
P_RX_BA_ENTRY_T aprRxReorderParamRefTbl[CFG_RX_MAX_BA_TID_NUM];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_802_11V_TIMING_MEASUREMENT
|
|
||||||
TIMINGMSMT_PARAM_T rWNMTimingMsmt;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (CFG_SUPPORT_TDLS == 1)
|
|
||||||
BOOLEAN fgTdlsIsProhibited; /* TRUE: AP prohibits TDLS links */
|
|
||||||
BOOLEAN fgTdlsIsChSwProhibited; /* TRUE: AP prohibits TDLS chan switch */
|
|
||||||
|
|
||||||
BOOLEAN flgTdlsIsInitiator; /* TRUE: the peer is the initiator */
|
|
||||||
IE_HT_CAP_T rTdlsHtCap; /* temp to queue HT capability element */
|
|
||||||
BOOLEAN fgTdlsInSecurityMode; /* TRUE: security mode */
|
|
||||||
PARAM_KEY_T rTdlsKeyTemp; /* temp to queue the key information */
|
|
||||||
|
|
||||||
#define TDLS_SETUP_TIMEOUT_SEC 5 /* unit: second */
|
|
||||||
OS_SYSTIME rTdlsSetupStartTime; /* time when link setup is started */
|
|
||||||
|
|
||||||
OS_SYSTIME rTdlsTxQuotaEmptyTime; /* time when TX quota is 0 */
|
|
||||||
|
|
||||||
STAT_CNT_INFO_DRV_T rTdlsStatistics;
|
|
||||||
#endif /* CFG_SUPPORT_TDLS */
|
|
||||||
|
|
||||||
#if (CFG_SUPPORT_STATISTICS == 1)
|
|
||||||
#define STATS_ENV_TIMEOUT_SEC 10 /* unit: second */
|
|
||||||
OS_SYSTIME rStatsEnvTxPeriodLastTime;
|
|
||||||
|
|
||||||
#define STATS_ENV_TX_CNT_REPORT_TRIGGER 2500 /* 6Mbps */
|
|
||||||
#define STATS_ENV_TX_CNT_REPORT_TRIGGER_SEC 5 /* unit: second */
|
|
||||||
OS_SYSTIME rStatsEnvTxLastTime;
|
|
||||||
UINT32 u4StatsEnvTxCnt;
|
|
||||||
|
|
||||||
UINT32 u4NumOfNoTxQuota;
|
|
||||||
|
|
||||||
UINT32 u4RxReorderFallAheadCnt;
|
|
||||||
UINT32 u4RxReorderFallBehindCnt;
|
|
||||||
UINT32 u4RxReorderFallBehindNoDropCnt;
|
|
||||||
UINT32 u4RxReorderHoleCnt;
|
|
||||||
UINT32 u4RxReorderHoleTimeoutCnt;
|
|
||||||
|
|
||||||
UINT32 u4StatsRxPassToOsCnt;
|
|
||||||
|
|
||||||
/* delay from HIF to pass to OS: us */
|
|
||||||
#define STATS_STAY_INT_BYTE_THRESHOLD 500
|
|
||||||
UINT32 u4StayIntMaxRx[3], u4StayIntMinRx[3], u4StayIntAvgRx[3];
|
|
||||||
|
|
||||||
UINT8 ucStatsGenDisplayCnt;
|
|
||||||
#endif /* CFG_SUPPORT_STATISTICS */
|
|
||||||
#if DSCP_SUPPORT
|
|
||||||
UINT_8 qosMapSet[64];
|
|
||||||
#endif
|
|
||||||
UINT_16 u2MaxIdlePeriod;
|
|
||||||
UINT_8 ucIdleOption;
|
|
||||||
BOOLEAN fgSupportBTM; /* flag to indicate Capbility for Bss Transition Management */
|
|
||||||
|
|
||||||
/* For Infra/GC Mode, a timer used to avoid the Deauth frame not be sent */
|
|
||||||
TIMER_T rDeauthTxDoneTimer;
|
|
||||||
#if CFG_SUPPORT_802_11W
|
|
||||||
/* AP PMF */
|
|
||||||
struct STA_PMF_CFG rPmfCfg;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* use nic_tx.h instead */
|
|
||||||
/* MSDU_INFO and SW_RFB structure */
|
|
||||||
typedef struct _MSDU_INFO_T {
|
|
||||||
|
|
||||||
/* 4 ----------------MSDU_INFO and SW_RFB Common Fields------------------ */
|
|
||||||
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
PUINT_8 pucBuffer; /* Pointer to the associated buffer */
|
|
||||||
|
|
||||||
UINT_8 ucBufferSource; /* HIF TX0, HIF TX1, MAC RX, or MNG Pool */
|
|
||||||
UINT_8 ucNetworkTypeIndex; /* Network type index that this TX packet is assocaited with */
|
|
||||||
UINT_8 ucTC; /* 0 to 5 (used by HIF TX to increment the corresponding TC counter) */
|
|
||||||
UINT_8 ucTID; /* Traffic Identification */
|
|
||||||
|
|
||||||
BOOLEAN fgIs802_11Frame; /* Set to TRUE for 802.11 frame */
|
|
||||||
UINT_8 ucMacHeaderLength;
|
|
||||||
UINT_16 u2PayloadLength;
|
|
||||||
PUINT_8 pucMacHeader; /* 802.11 header */
|
|
||||||
PUINT_8 pucPayload; /* 802.11 payload */
|
|
||||||
|
|
||||||
OS_SYSTIME rArrivalTime; /* System Timestamp (4) */
|
|
||||||
P_STA_RECORD_T prStaRec;
|
|
||||||
|
|
||||||
#if CFG_PROFILE_BUFFER_TRACING
|
|
||||||
ENUM_BUFFER_ACTIVITY_TYPE_T eActivity[2];
|
|
||||||
UINT_32 rActivityTime[2];
|
|
||||||
#endif
|
|
||||||
#if DBG && CFG_BUFFER_FREE_CHK
|
|
||||||
BOOLEAN fgBufferInSource;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UINT_8 ucControlFlag; /* For specify some Control Flags, e.g. Basic Rate */
|
|
||||||
|
|
||||||
/* 4 -----------------------Non-Common ------------------------- */
|
|
||||||
/* TODO: move flags to ucControlFlag */
|
|
||||||
|
|
||||||
BOOLEAN fgIs1xFrame; /* Set to TRUE for 802.1x frame */
|
|
||||||
|
|
||||||
/* TXM: For TX Done handling, callback function & parameter (5) */
|
|
||||||
BOOLEAN fgIsTxFailed; /* Set to TRUE if transmission failure */
|
|
||||||
|
|
||||||
PFN_TX_DONE_HANDLER pfTxDoneHandler;
|
|
||||||
|
|
||||||
UINT_64 u8TimeStamp; /* record the TX timestamp */
|
|
||||||
|
|
||||||
/* TXM: For PS forwarding control (per-STA flow control) */
|
|
||||||
UINT_8 ucPsForwardingType; /* Delivery-enabled, non-delivery-enabled, non-PS */
|
|
||||||
UINT_8 ucPsSessionID; /* The Power Save session id for PS forwarding control */
|
|
||||||
|
|
||||||
/* TXM: For MAC TX DMA operations */
|
|
||||||
UINT_8 ucMacTxQueIdx; /* MAC TX queue: AC0-AC6, BCM, or BCN */
|
|
||||||
BOOLEAN fgNoAck; /* Set to true if Ack is not required for this packet */
|
|
||||||
BOOLEAN fgBIP; /* Set to true if BIP is used for this packet */
|
|
||||||
UINT_8 ucFragTotalCount;
|
|
||||||
UINT_8 ucFragFinishedCount;
|
|
||||||
UINT_16 u2FragThreshold; /* Fragmentation threshold without WLAN Header & FCS */
|
|
||||||
BOOLEAN fgFixedRate; /* If a fixed rate is used, set to TRUE. */
|
|
||||||
UINT_8 ucFixedRateCode; /* The rate code copied to MAC TX Desc */
|
|
||||||
UINT_8 ucFixedRateRetryLimit; /* The retry limit when a fixed rate is used */
|
|
||||||
BOOLEAN fgIsBmcQueueEnd; /* Set to true if this packet is the end of BMC */
|
|
||||||
|
|
||||||
/* TXM: For flushing ACL frames */
|
|
||||||
UINT_16 u2PalLLH; /* 802.11 PAL LLH */
|
|
||||||
/* UINT_16 u2LLH; */
|
|
||||||
UINT_16 u2ACLSeq; /* u2LLH+u2ACLSeq for AM HCI flush ACL frame */
|
|
||||||
|
|
||||||
/* TXM for retransmitting a flushed packet */
|
|
||||||
BOOLEAN fgIsSnAssigned;
|
|
||||||
UINT_16 u2SequenceNumber; /* To remember the Sequence Control field of this MPDU */
|
|
||||||
|
|
||||||
} MSDU_INFO_T, *P_MSDU_INFO_T;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* nic_rx.h */
|
|
||||||
typedef struct _SW_RFB_T {
|
|
||||||
|
|
||||||
/* 4 ----------------MSDU_INFO and SW_RFB Common Fields------------------ */
|
|
||||||
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
PUINT_8 pucBuffer; /* Pointer to the associated buffer */
|
|
||||||
|
|
||||||
UINT_8 ucBufferSource; /* HIF TX0, HIF TX1, MAC RX, or MNG Pool */
|
|
||||||
UINT_8 ucNetworkTypeIndex; /* Network type index that this TX packet is assocaited with */
|
|
||||||
UINT_8 ucTC; /* 0 to 5 (used by HIF TX to increment the corresponding TC counter) */
|
|
||||||
UINT_8 ucTID; /* Traffic Identification */
|
|
||||||
|
|
||||||
BOOLEAN fgIs802_11Frame; /* Set to TRUE for 802.11 frame */
|
|
||||||
UINT_8 ucMacHeaderLength;
|
|
||||||
UINT_16 u2PayloadLength;
|
|
||||||
PUINT_8 pucMacHeader; /* 802.11 header */
|
|
||||||
PUINT_8 pucPayload; /* 802.11 payload */
|
|
||||||
|
|
||||||
OS_SYSTIME rArrivalTime; /* System Timestamp (4) */
|
|
||||||
P_STA_RECORD_T prStaRec;
|
|
||||||
|
|
||||||
#if CFG_PROFILE_BUFFER_TRACING
|
|
||||||
ENUM_BUFFER_ACTIVITY_TYPE_T eActivity[2];
|
|
||||||
UINT_32 rActivityTime[2];
|
|
||||||
#endif
|
|
||||||
#if DBG && CFG_BUFFER_FREE_CHK
|
|
||||||
BOOLEAN fgBufferInSource;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UINT_8 ucControlFlag; /* For specify some Control Flags, e.g. Basic Rate */
|
|
||||||
|
|
||||||
/* 4 -----------------------Non-Common ------------------------- */
|
|
||||||
|
|
||||||
/* For composing the HIF RX Header (TODO: move flags to ucControlFlag) */
|
|
||||||
PUINT_8 pucHifRxPacket; /* Pointer to the Response packet to HIF RX0 or RX1 */
|
|
||||||
UINT_16 u2HifRxPacketLength;
|
|
||||||
UINT_8 ucHeaderOffset;
|
|
||||||
UINT_8 ucHifRxPortIndex;
|
|
||||||
|
|
||||||
UINT_16 u2SequenceControl;
|
|
||||||
BOOLEAN fgIsA4Frame; /* (For MAC RX packet parsing) set to TRUE if 4 addresses are present */
|
|
||||||
BOOLEAN fgIsBAR;
|
|
||||||
BOOLEAN fgIsQoSData;
|
|
||||||
BOOLEAN fgIsAmsduSubframe; /* Set to TRUE for A-MSDU Subframe */
|
|
||||||
|
|
||||||
/* For HIF RX DMA Desc */
|
|
||||||
BOOLEAN fgTUChecksumCheckRequired;
|
|
||||||
BOOLEAN fgIPChecksumCheckRequired;
|
|
||||||
UINT_8 ucEtherTypeOffset;
|
|
||||||
|
|
||||||
} SW_RFB_T, *P_SW_RFB_T;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
P_MSDU_INFO_T cnmMgtPktAlloc(IN P_ADAPTER_T prAdapter, IN UINT_32 u4Length);
|
|
||||||
|
|
||||||
VOID cnmMgtPktFree(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID cnmMemInit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
PVOID cnmMemAlloc(IN P_ADAPTER_T prAdapter, IN ENUM_RAM_TYPE_T eRamType, IN UINT_32 u4Length);
|
|
||||||
|
|
||||||
VOID cnmMemFree(IN P_ADAPTER_T prAdapter, IN PVOID pvMemory);
|
|
||||||
|
|
||||||
VOID cnmStaRecInit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID cnmStaRecUninit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
P_STA_RECORD_T cnmStaRecAlloc(IN P_ADAPTER_T prAdapter, IN UINT_8 ucNetTypeIndex);
|
|
||||||
|
|
||||||
VOID cnmStaRecFree(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN BOOLEAN fgSyncToChip);
|
|
||||||
|
|
||||||
VOID cnmStaFreeAllStaByNetType(P_ADAPTER_T prAdapter, ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, BOOLEAN fgSyncToChip);
|
|
||||||
|
|
||||||
P_STA_RECORD_T cnmGetStaRecByIndex(IN P_ADAPTER_T prAdapter, IN UINT_8 ucIndex);
|
|
||||||
|
|
||||||
P_STA_RECORD_T cnmGetStaRecByAddress(IN P_ADAPTER_T prAdapter, IN UINT_8 ucNetTypeIndex, IN UINT_8 aucPeerMACAddress[]);
|
|
||||||
|
|
||||||
VOID cnmStaRecResetStatus(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex);
|
|
||||||
|
|
||||||
VOID cnmStaRecChangeState(IN P_ADAPTER_T prAdapter, IN OUT P_STA_RECORD_T prStaRec, IN UINT_8 ucNewState);
|
|
||||||
|
|
||||||
P_STA_RECORD_T
|
|
||||||
cnmStaTheTypeGet(P_ADAPTER_T prAdapter,
|
|
||||||
ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, ENUM_STA_TYPE_T eStaType, UINT32 *pu4StartIdx);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#ifndef _lint
|
|
||||||
/* Kevin: we don't have to call following function to inspect the data structure.
|
|
||||||
* It will check automatically while at compile time.
|
|
||||||
* We'll need this for porting driver to different RTOS.
|
|
||||||
*/
|
|
||||||
static inline VOID cnmMemDataTypeCheck(VOID)
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, rLinkEntry) == 0);
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, rLinkEntry) == OFFSET_OF(SW_RFB_T, rLinkEntry));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, pucBuffer) == OFFSET_OF(SW_RFB_T, pucBuffer));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, ucBufferSource) == OFFSET_OF(SW_RFB_T, ucBufferSource));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, pucMacHeader) == OFFSET_OF(SW_RFB_T, pucMacHeader));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, ucMacHeaderLength) ==
|
|
||||||
OFFSET_OF(SW_RFB_T, ucMacHeaderLength));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, pucPayload) == OFFSET_OF(SW_RFB_T, pucPayload));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, u2PayloadLength) == OFFSET_OF(SW_RFB_T, u2PayloadLength));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, prStaRec) == OFFSET_OF(SW_RFB_T, prStaRec));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, ucNetworkTypeIndex) ==
|
|
||||||
OFFSET_OF(SW_RFB_T, ucNetworkTypeIndex));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, ucTID) == OFFSET_OF(SW_RFB_T, ucTID));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, fgIs802_11Frame) == OFFSET_OF(SW_RFB_T, fgIs802_11Frame));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, ucControlFlag) == OFFSET_OF(SW_RFB_T, ucControlFlag));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, rArrivalTime) == OFFSET_OF(SW_RFB_T, rArrivalTime));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, ucTC) == OFFSET_OF(SW_RFB_T, ucTC));
|
|
||||||
|
|
||||||
#if CFG_PROFILE_BUFFER_TRACING
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, eActivity[0]) == OFFSET_OF(SW_RFB_T, eActivity[0]));
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, rActivityTime[0]) ==
|
|
||||||
OFFSET_OF(SW_RFB_T, rActivityTime[0]));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if DBG && CFG_BUFFER_FREE_CHK
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(MSDU_INFO_T, fgBufferInSource) ==
|
|
||||||
OFFSET_OF(SW_RFB_T, fgBufferInSource));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(OFFSET_OF(STA_RECORD_T, rLinkEntry) == 0);
|
|
||||||
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif /* _lint */
|
|
||||||
|
|
||||||
#endif /* _CNM_MEM_H */
|
|
|
@ -1,115 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _CNM_SCAN_H
|
|
||||||
#define _CNM_SCAN_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define SCN_CHANNEL_DWELL_TIME_MIN_MSEC 12
|
|
||||||
#define SCN_CHANNEL_DWELL_TIME_EXT_MSEC 98
|
|
||||||
|
|
||||||
#define SCN_TOTAL_PROBEREQ_NUM_FOR_FULL 3
|
|
||||||
#define SCN_SPECIFIC_PROBEREQ_NUM_FOR_FULL 1
|
|
||||||
|
|
||||||
#define SCN_TOTAL_PROBEREQ_NUM_FOR_PARTIAL 2
|
|
||||||
#define SCN_SPECIFIC_PROBEREQ_NUM_FOR_PARTIAL 1
|
|
||||||
|
|
||||||
#define SCN_INTERLACED_CHANNEL_GROUPS_NUM 3 /* Used by partial scan */
|
|
||||||
|
|
||||||
#define SCN_PARTIAL_SCAN_NUM 3
|
|
||||||
|
|
||||||
#define SCN_PARTIAL_SCAN_IDLE_MSEC 100
|
|
||||||
|
|
||||||
#define MAXIMUM_OPERATION_CHANNEL_LIST 46
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* The type of Scan Source */
|
|
||||||
typedef enum _ENUM_SCN_REQ_SOURCE_T {
|
|
||||||
SCN_REQ_SOURCE_HEM = 0,
|
|
||||||
SCN_REQ_SOURCE_NET_FSM,
|
|
||||||
SCN_REQ_SOURCE_ROAMING, /* ROAMING Module is independent of AIS FSM */
|
|
||||||
SCN_REQ_SOURCE_OBSS, /* 2.4G OBSS scan */
|
|
||||||
SCN_REQ_SOURCE_NUM
|
|
||||||
} ENUM_SCN_REQ_SOURCE_T, *P_ENUM_SCN_REQ_SOURCE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_SCAN_PROFILE_T {
|
|
||||||
SCAN_PROFILE_FULL = 0,
|
|
||||||
SCAN_PROFILE_PARTIAL,
|
|
||||||
SCAN_PROFILE_VOIP,
|
|
||||||
SCAN_PROFILE_FULL_2G4,
|
|
||||||
SCAN_PROFILE_NUM
|
|
||||||
} ENUM_SCAN_PROFILE_T, *P_ENUM_SCAN_PROFILE_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#if 0
|
|
||||||
VOID cnmScanInit(VOID);
|
|
||||||
|
|
||||||
VOID cnmScanRunEventScanRequest(IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
BOOLEAN cnmScanRunEventScanAbort(IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID cnmScanProfileSelection(VOID);
|
|
||||||
|
|
||||||
VOID cnmScanProcessStart(VOID);
|
|
||||||
|
|
||||||
VOID cnmScanProcessStop(VOID);
|
|
||||||
|
|
||||||
VOID cnmScanRunEventReqAISAbsDone(IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID cnmScanRunEventCancelAISAbsDone(IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID cnmScanPartialScanTimeout(UINT_32 u4Param);
|
|
||||||
|
|
||||||
VOID cnmScanRunEventScnFsmComplete(IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _CNM_SCAN_H */
|
|
|
@ -1,177 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _CNM_TIMER_H
|
|
||||||
#define _CNM_TIMER_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#undef MSEC_PER_SEC
|
|
||||||
#define MSEC_PER_SEC 1000
|
|
||||||
#undef USEC_PER_MSEC
|
|
||||||
#define USEC_PER_MSEC 1000
|
|
||||||
#define USEC_PER_TU 1024 /* microsecond */
|
|
||||||
|
|
||||||
#define MSEC_PER_MIN (60 * MSEC_PER_SEC)
|
|
||||||
|
|
||||||
#define MGMT_MAX_TIMEOUT_INTERVAL ((UINT_32)0x7fffffff)
|
|
||||||
|
|
||||||
#define WAKE_LOCK_MAX_TIME 5 /* Unit: sec */
|
|
||||||
|
|
||||||
/* If WAKE_LOCK_MAX_TIME is too large, the whole system may always keep awake
|
|
||||||
* because of periodic timer of OBSS scanning
|
|
||||||
*/
|
|
||||||
#if (WAKE_LOCK_MAX_TIME >= OBSS_SCAN_MIN_INTERVAL)
|
|
||||||
#error WAKE_LOCK_MAX_TIME is too large
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef VOID(*PFN_MGMT_TIMEOUT_FUNC) (P_ADAPTER_T, ULONG);
|
|
||||||
|
|
||||||
typedef struct _TIMER_T {
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
OS_SYSTIME rExpiredSysTime;
|
|
||||||
UINT_16 u2Minutes;
|
|
||||||
UINT_16 u2Reserved;
|
|
||||||
ULONG ulData;
|
|
||||||
PFN_MGMT_TIMEOUT_FUNC pfMgmtTimeOutFunc;
|
|
||||||
} TIMER_T, *P_TIMER_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Check if time "a" is before time "b" */
|
|
||||||
/* In 32-bit variable, 0x00000001~0x7fffffff -> positive number,
|
|
||||||
* 0x80000000~0xffffffff -> negative number
|
|
||||||
*/
|
|
||||||
#define TIME_BEFORE_64bit(a, b) (a < b)
|
|
||||||
|
|
||||||
#define TIME_BEFORE(a, b) ((UINT_32)((UINT_32)(a) - (UINT_32)(b)) > 0x7fffffff)
|
|
||||||
|
|
||||||
/* #define TIME_BEFORE(a,b) ((INT_32)((INT_32)(b) - (INT_32)(a)) > 0)
|
|
||||||
* may cause UNexpect result between Free build and Check build for WinCE
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define TIME_AFTER(a, b) TIME_BEFORE(b, a)
|
|
||||||
|
|
||||||
#define SYSTIME_TO_SEC(_systime) ((_systime) / KAL_HZ)
|
|
||||||
#define SEC_TO_SYSTIME(_sec) ((_sec) * KAL_HZ)
|
|
||||||
|
|
||||||
/* The macros to convert second & millisecond */
|
|
||||||
#define MSEC_TO_SEC(_msec) ((_msec) / MSEC_PER_SEC)
|
|
||||||
#define SEC_TO_MSEC(_sec) ((UINT_32)(_sec) * MSEC_PER_SEC)
|
|
||||||
|
|
||||||
/* The macros to convert millisecond & microsecond */
|
|
||||||
#define USEC_TO_MSEC(_usec) ((_usec) / USEC_PER_MSEC)
|
|
||||||
#define MSEC_TO_USEC(_msec) ((UINT_32)(_msec) * USEC_PER_MSEC)
|
|
||||||
|
|
||||||
/* The macros to convert TU & microsecond, TU & millisecond */
|
|
||||||
#define TU_TO_USEC(_tu) ((_tu) * USEC_PER_TU)
|
|
||||||
#define TU_TO_MSEC(_tu) USEC_TO_MSEC(TU_TO_USEC(_tu))
|
|
||||||
|
|
||||||
/* The macros to convert TU & & OS system time, round up by 0.5 */
|
|
||||||
#define TU_TO_SYSTIME(_tu) MSEC_TO_SYSTIME(TU_TO_MSEC(_tu))
|
|
||||||
#define SYSTIME_TO_TU(_systime) \
|
|
||||||
((SYSTIME_TO_USEC(_systime) + ((USEC_PER_TU / 2) - 1)) / USEC_PER_TU)
|
|
||||||
|
|
||||||
/* The macros to convert OS system time & microsecond */
|
|
||||||
#define SYSTIME_TO_USEC(_systime) (SYSTIME_TO_MSEC(_systime) * USEC_PER_MSEC)
|
|
||||||
|
|
||||||
/* The macro to get the current OS system time */
|
|
||||||
#define GET_CURRENT_SYSTIME(_systime_p) {*(_systime_p) = kalGetTimeTick(); }
|
|
||||||
|
|
||||||
/* The macro to copy the system time */
|
|
||||||
#define COPY_SYSTIME(_destTime, _srcTime) {(_destTime) = (_srcTime); }
|
|
||||||
|
|
||||||
/* The macro to get the system time difference between t1 and t2 (t1 - t2) */
|
|
||||||
/*
|
|
||||||
* #define GET_SYSTIME_DIFFERENCE(_time1, _time2, _diffTime) \
|
|
||||||
* (_diffTime) = (_time1) - (_time2)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* The macro to check for the expiration, if TRUE means _currentTime >= _expirationTime */
|
|
||||||
#define CHECK_FOR_EXPIRATION(_currentTime, _expirationTime) \
|
|
||||||
(((UINT_32)(_currentTime) - (UINT_32)(_expirationTime)) <= 0x7fffffffUL)
|
|
||||||
|
|
||||||
/* The macro to check for the timeout */
|
|
||||||
#define CHECK_FOR_TIMEOUT(_currentTime, _timeoutStartingTime, _timeout) \
|
|
||||||
CHECK_FOR_EXPIRATION((_currentTime), ((_timeoutStartingTime) + (_timeout)))
|
|
||||||
|
|
||||||
/* The macro to set the expiration time with a specified timeout *//* Watch out for round up. */
|
|
||||||
#define SET_EXPIRATION_TIME(_expirationTime, _timeout) \
|
|
||||||
{ \
|
|
||||||
GET_CURRENT_SYSTIME(&(_expirationTime)); \
|
|
||||||
(_expirationTime) += (OS_SYSTIME)(_timeout); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define timerRenewTimer(adapter, tmr, interval) \
|
|
||||||
timerStartTimer(adapter, tmr, interval, (tmr)->function, (tmr)->data)
|
|
||||||
|
|
||||||
#define MGMT_INIT_TIMER(_adapter_p, _timer, _callbackFunc) \
|
|
||||||
timerInitTimer(_adapter_p, &(_timer), (ULONG)(_callbackFunc))
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID cnmTimerInitialize(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID cnmTimerDestroy(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
cnmTimerInitTimer(IN P_ADAPTER_T prAdapter, IN P_TIMER_T prTimer, IN PFN_MGMT_TIMEOUT_FUNC pfFunc, IN ULONG ulData);
|
|
||||||
|
|
||||||
VOID cnmTimerStopTimer(IN P_ADAPTER_T prAdapter, IN P_TIMER_T prTimer);
|
|
||||||
|
|
||||||
VOID cnmTimerStartTimer(IN P_ADAPTER_T prAdapter, IN P_TIMER_T prTimer, IN UINT_32 u4TimeoutMs);
|
|
||||||
|
|
||||||
VOID cnmTimerDoTimeOutCheck(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
static inline INT_32 timerPendingTimer(IN P_TIMER_T prTimer)
|
|
||||||
{
|
|
||||||
ASSERT(prTimer);
|
|
||||||
|
|
||||||
return prTimer->rLinkEntry.prNext != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* _CNM_TIMER_H */
|
|
|
@ -1,278 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HEM_MBOX_H
|
|
||||||
#define _HEM_MBOX_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Message IDs */
|
|
||||||
typedef enum _ENUM_MSG_ID_T {
|
|
||||||
MID_MNY_CNM_CH_REQ, /* MANY notify CNM to obtain channel privilege */
|
|
||||||
MID_MNY_CNM_CH_ABORT, /* MANY notify CNM to abort/release channel privilege */
|
|
||||||
|
|
||||||
MID_CNM_AIS_CH_GRANT, /* CNM notify AIS for indicating channel granted */
|
|
||||||
MID_CNM_P2P_CH_GRANT, /* CNM notify P2P for indicating channel granted */
|
|
||||||
MID_CNM_BOW_CH_GRANT, /* CNM notify BOW for indicating channel granted */
|
|
||||||
|
|
||||||
/*--------------------------------------------------*/
|
|
||||||
/* SCN Module Mailbox Messages */
|
|
||||||
/*--------------------------------------------------*/
|
|
||||||
MID_AIS_SCN_SCAN_REQ, /* AIS notify SCN for starting scan */
|
|
||||||
MID_AIS_SCN_SCAN_REQ_V2, /* AIS notify SCN for starting scan with multiple SSID support */
|
|
||||||
MID_AIS_SCN_SCAN_CANCEL, /* AIS notify SCN for cancelling scan */
|
|
||||||
MID_P2P_SCN_SCAN_REQ, /* P2P notify SCN for starting scan */
|
|
||||||
MID_P2P_SCN_SCAN_REQ_V2, /* P2P notify SCN for starting scan with multiple SSID support */
|
|
||||||
MID_P2P_SCN_SCAN_CANCEL, /* P2P notify SCN for cancelling scan */
|
|
||||||
MID_BOW_SCN_SCAN_REQ, /* BOW notify SCN for starting scan */
|
|
||||||
MID_BOW_SCN_SCAN_REQ_V2, /* BOW notify SCN for starting scan with multiple SSID support */
|
|
||||||
MID_BOW_SCN_SCAN_CANCEL, /* BOW notify SCN for cancelling scan */
|
|
||||||
MID_RLM_SCN_SCAN_REQ, /* RLM notify SCN for starting scan (OBSS-SCAN) */
|
|
||||||
MID_RLM_SCN_SCAN_REQ_V2, /* RLM notify SCN for starting scan (OBSS-SCAN) with multiple SSID support */
|
|
||||||
MID_RLM_SCN_SCAN_CANCEL, /* RLM notify SCN for cancelling scan (OBSS-SCAN) */
|
|
||||||
MID_SCN_AIS_SCAN_DONE, /* SCN notify AIS for scan completion */
|
|
||||||
MID_SCN_P2P_SCAN_DONE, /* SCN notify P2P for scan completion */
|
|
||||||
MID_SCN_BOW_SCAN_DONE, /* SCN notify BOW for scan completion */
|
|
||||||
MID_SCN_RLM_SCAN_DONE, /* SCN notify RLM for scan completion (OBSS-SCAN) */
|
|
||||||
|
|
||||||
/*--------------------------------------------------*/
|
|
||||||
/* AIS Module Mailbox Messages */
|
|
||||||
/*--------------------------------------------------*/
|
|
||||||
MID_OID_AIS_FSM_JOIN_REQ, /* OID/IOCTL notify AIS for join */
|
|
||||||
MID_OID_AIS_FSM_ABORT, /* OID/IOCTL notify AIS for abort */
|
|
||||||
MID_AIS_SAA_FSM_START, /* AIS notify SAA for Starting authentication/association fsm */
|
|
||||||
MID_OID_SAA_FSM_CONTINUE, /* OID notify SAA to continue to do authentication/association fsm for FT */
|
|
||||||
MID_OID_SAA_FSM_EXTERNAL_AUTH, /* OID notify SAA to continue SAE authentication/association fsm */
|
|
||||||
MID_AIS_SAA_FSM_ABORT, /* AIS notify SAA for Aborting authentication/association fsm */
|
|
||||||
MID_SAA_AIS_JOIN_COMPLETE, /* SAA notify AIS for indicating join complete */
|
|
||||||
|
|
||||||
#if CFG_ENABLE_BT_OVER_WIFI
|
|
||||||
/*--------------------------------------------------*/
|
|
||||||
/* BOW Module Mailbox Messages */
|
|
||||||
/*--------------------------------------------------*/
|
|
||||||
MID_BOW_SAA_FSM_START, /* BOW notify SAA for Starting authentication/association fsm */
|
|
||||||
MID_BOW_SAA_FSM_ABORT, /* BOW notify SAA for Aborting authentication/association fsm */
|
|
||||||
MID_SAA_BOW_JOIN_COMPLETE, /* SAA notify BOW for indicating join complete */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
/*--------------------------------------------------*/
|
|
||||||
/* P2P Module Mailbox Messages */
|
|
||||||
/*--------------------------------------------------*/
|
|
||||||
MID_P2P_SAA_FSM_START, /* P2P notify SAA for Starting authentication/association fsm */
|
|
||||||
MID_P2P_SAA_FSM_ABORT, /* P2P notify SAA for Aborting authentication/association fsm */
|
|
||||||
MID_SAA_P2P_JOIN_COMPLETE, /* SAA notify P2P for indicating join complete */
|
|
||||||
|
|
||||||
MID_MNY_P2P_FUN_SWITCH, /* Enable P2P FSM. */
|
|
||||||
MID_MNY_P2P_DEVICE_DISCOVERY, /* Start device discovery. */
|
|
||||||
MID_MNY_P2P_CONNECTION_REQ, /* Connection request. */
|
|
||||||
MID_MNY_P2P_CONNECTION_ABORT, /* Abort connection request, P2P FSM return to IDLE. */
|
|
||||||
MID_MNY_P2P_BEACON_UPDATE,
|
|
||||||
MID_MNY_P2P_STOP_AP,
|
|
||||||
MID_MNY_P2P_CHNL_REQ,
|
|
||||||
MID_MNY_P2P_CHNL_ABORT,
|
|
||||||
MID_MNY_P2P_MGMT_TX,
|
|
||||||
MID_MNY_P2P_GROUP_DISSOLVE,
|
|
||||||
MID_MNY_P2P_MGMT_FRAME_REGISTER,
|
|
||||||
MID_MNY_P2P_NET_DEV_REGISTER,
|
|
||||||
MID_MNY_P2P_START_AP,
|
|
||||||
MID_MNY_P2P_MGMT_FRAME_UPDATE,
|
|
||||||
MID_MNY_P2P_EXTEND_LISTEN_INTERVAL,
|
|
||||||
#if CFG_SUPPORT_P2P_ECSA
|
|
||||||
MID_MNY_P2P_CSA,
|
|
||||||
MID_MNY_P2P_ECSA,
|
|
||||||
#endif
|
|
||||||
#if CFG_SUPPORT_WFD
|
|
||||||
MID_MNY_P2P_WFD_CFG_UPDATE,
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_ADHOC
|
|
||||||
MID_SCN_AIS_FOUND_IBSS, /* SCN notify AIS that an IBSS Peer has been found and can merge into */
|
|
||||||
#endif /* CFG_SUPPORT_ADHOC */
|
|
||||||
|
|
||||||
MID_SAA_AIS_FSM_ABORT, /* SAA notify AIS for indicating deauthentication/disassociation */
|
|
||||||
|
|
||||||
/*--------------------------------------------------*/
|
|
||||||
/* AIS MGMT-TX Support */
|
|
||||||
/*--------------------------------------------------*/
|
|
||||||
MID_MNY_AIS_REMAIN_ON_CHANNEL,
|
|
||||||
MID_MNY_AIS_CANCEL_REMAIN_ON_CHANNEL,
|
|
||||||
MID_MNY_AIS_MGMT_TX,
|
|
||||||
MID_MNY_CNM_REQ_CH_UTIL,
|
|
||||||
MID_CNM_AIS_RSP_CH_UTIL,
|
|
||||||
MID_MNY_CNM_SCAN_CONTINUE,
|
|
||||||
MID_WNM_AIS_BSS_TRANSITION,
|
|
||||||
MID_OID_WMM_TSPEC_OPERATE,
|
|
||||||
MID_RLM_RM_SCHEDULE,
|
|
||||||
#if CFG_SUPPORT_NCHO
|
|
||||||
MID_MNY_AIS_NCHO_ACTION_FRAME,
|
|
||||||
#endif
|
|
||||||
MID_MNY_P2P_ACS,
|
|
||||||
MID_TOTAL_NUM
|
|
||||||
} ENUM_MSG_ID_T, *P_ENUM_MSG_ID_T;
|
|
||||||
|
|
||||||
/* Message header of inter-components */
|
|
||||||
struct _MSG_HDR_T {
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
ENUM_MSG_ID_T eMsgId;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef VOID(*PFN_MSG_HNDL_FUNC) (P_ADAPTER_T, P_MSG_HDR_T);
|
|
||||||
|
|
||||||
typedef struct _MSG_HNDL_ENTRY {
|
|
||||||
ENUM_MSG_ID_T eMsgId;
|
|
||||||
PFN_MSG_HNDL_FUNC pfMsgHndl;
|
|
||||||
} MSG_HNDL_ENTRY_T, *P_MSG_HNDL_ENTRY_T;
|
|
||||||
|
|
||||||
typedef enum _EUNM_MSG_SEND_METHOD_T {
|
|
||||||
MSG_SEND_METHOD_BUF = 0, /*
|
|
||||||
* Message is put in the queue and will be
|
|
||||||
* executed when mailbox is checked.
|
|
||||||
*/
|
|
||||||
MSG_SEND_METHOD_UNBUF /*
|
|
||||||
* The handler function is called immediately
|
|
||||||
* in the same context of the sender
|
|
||||||
*/
|
|
||||||
} EUNM_MSG_SEND_METHOD_T, *P_EUNM_MSG_SEND_METHOD_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_MBOX_ID_T {
|
|
||||||
MBOX_ID_0 = 0,
|
|
||||||
MBOX_ID_TOTAL_NUM
|
|
||||||
} ENUM_MBOX_ID_T, *P_ENUM_MBOX_ID_T;
|
|
||||||
|
|
||||||
/* Define Mailbox structure */
|
|
||||||
typedef struct _MBOX_T {
|
|
||||||
LINK_T rLinkHead;
|
|
||||||
} MBOX_T, *P_MBOX_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_SAA_FSM_START_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
P_STA_RECORD_T prStaRec;
|
|
||||||
} MSG_SAA_FSM_START_T, *P_MSG_SAA_FSM_START_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_SAA_FSM_COMP_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
WLAN_STATUS rJoinStatus;
|
|
||||||
P_STA_RECORD_T prStaRec;
|
|
||||||
P_SW_RFB_T prSwRfb;
|
|
||||||
} MSG_SAA_FSM_COMP_T, *P_MSG_SAA_FSM_COMP_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_SAA_FSM_ABORT_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
P_STA_RECORD_T prStaRec;
|
|
||||||
} MSG_SAA_FSM_ABORT_T, *P_MSG_SAA_FSM_ABORT_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_CONNECTION_ABORT_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
} MSG_CONNECTION_ABORT_T, *P_MSG_CONNECTION_ABORT_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_REMAIN_ON_CHANNEL_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
ENUM_BAND_T eBand;
|
|
||||||
ENUM_CHNL_EXT_T eSco;
|
|
||||||
UINT_8 ucChannelNum;
|
|
||||||
UINT_32 u4DurationMs;
|
|
||||||
UINT_64 u8Cookie;
|
|
||||||
} MSG_REMAIN_ON_CHANNEL_T, *P_MSG_REMAIN_ON_CHANNEL_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_CANCEL_REMAIN_ON_CHANNEL_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_64 u8Cookie;
|
|
||||||
} MSG_CANCEL_REMAIN_ON_CHANNEL_T, *P_MSG_CANCEL_REMAIN_ON_CHANNEL_T;
|
|
||||||
|
|
||||||
typedef struct _MSG_MGMT_TX_REQUEST_T {
|
|
||||||
MSG_HDR_T rMsgHdr;
|
|
||||||
P_MSDU_INFO_T prMgmtMsduInfo;
|
|
||||||
UINT_64 u8Cookie; /* For indication. */
|
|
||||||
BOOLEAN fgNoneCckRate;
|
|
||||||
BOOLEAN fgIsWaitRsp;
|
|
||||||
} MSG_MGMT_TX_REQUEST_T, *P_MSG_MGMT_TX_REQUEST_T;
|
|
||||||
|
|
||||||
struct MSG_SAA_FT_CONTINUE {
|
|
||||||
MSG_HDR_T rMsgHdr;
|
|
||||||
P_STA_RECORD_T prStaRec;
|
|
||||||
BOOLEAN fgFTRicRequest; /* if fgFTRicRequest is TRUE, then will do FT Resource Request Protocol */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct MSG_SAA_EXTERNAL_AUTH_DONE {
|
|
||||||
MSG_HDR_T rMsgHdr;
|
|
||||||
P_STA_RECORD_T prStaRec;
|
|
||||||
uint16_t status;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* specific message data types */
|
|
||||||
typedef MSG_SAA_FSM_START_T MSG_JOIN_REQ_T, *P_MSG_JOIN_REQ_T;
|
|
||||||
typedef MSG_SAA_FSM_COMP_T MSG_JOIN_COMP_T, *P_MSG_JOIN_COMP_T;
|
|
||||||
typedef MSG_SAA_FSM_ABORT_T MSG_JOIN_ABORT_T, *P_MSG_JOIN_ABORT_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID mboxSetup(IN P_ADAPTER_T prAdapter, IN ENUM_MBOX_ID_T eMboxId);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
mboxSendMsg(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_MBOX_ID_T eMboxId, IN P_MSG_HDR_T prMsg, IN EUNM_MSG_SEND_METHOD_T eMethod);
|
|
||||||
|
|
||||||
VOID mboxRcvAllMsg(IN P_ADAPTER_T prAdapter, IN ENUM_MBOX_ID_T eMboxId);
|
|
||||||
|
|
||||||
VOID mboxInitialize(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID mboxDestroy(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID mboxDummy(IN P_ADAPTER_T prAdapter, P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _HEM_MBOX_H */
|
|
|
@ -1,142 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HS20_H
|
|
||||||
#define _HS20_H
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_HOTSPOT_2_0
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define BSSID_POOL_MAX_SIZE 8
|
|
||||||
#define HS20_SIGMA_SCAN_RESULT_TIMEOUT 30 /* sec */
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if CFG_ENABLE_GTK_FRAME_FILTER
|
|
||||||
/*For GTK Frame Filter*/
|
|
||||||
typedef struct _IPV4_NETWORK_ADDRESS_LIST {
|
|
||||||
UINT_8 ucAddrCount;
|
|
||||||
IPV4_NETWORK_ADDRESS arNetAddr[1];
|
|
||||||
} IPV4_NETWORK_ADDRESS_LIST, *P_IPV4_NETWORK_ADDRESS_LIST;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Entry of BSSID Pool - For SIGMA Test */
|
|
||||||
typedef struct _BSSID_ENTRY_T {
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN];
|
|
||||||
} BSSID_ENTRY_T, P_HS20_BSSID_POOL_ENTRY_T;
|
|
||||||
|
|
||||||
struct _HS20_INFO_T {
|
|
||||||
|
|
||||||
/*Hotspot 2.0 Information */
|
|
||||||
UINT_8 aucHESSID[MAC_ADDR_LEN];
|
|
||||||
UINT_8 ucAccessNetworkOptions;
|
|
||||||
UINT_8 ucVenueGroup; /* VenueInfo - Group */
|
|
||||||
UINT_8 ucVenueType;
|
|
||||||
UINT_8 ucHotspotConfig;
|
|
||||||
|
|
||||||
/*Roaming Consortium Information */
|
|
||||||
/* PARAM_HS20_ROAMING_CONSORTIUM_INFO rRCInfo; */
|
|
||||||
|
|
||||||
/*Hotspot 2.0 dummy AP Info */
|
|
||||||
|
|
||||||
/*Time Advertisement Information */
|
|
||||||
/* UINT_32 u4UTCOffsetTime; */
|
|
||||||
/* UINT_8 aucTimeZone[ELEM_MAX_LEN_TIME_ZONE]; */
|
|
||||||
/* UINT_8 ucLenTimeZone; */
|
|
||||||
|
|
||||||
/* For SIGMA Test */
|
|
||||||
/* BSSID Pool */
|
|
||||||
BSSID_ENTRY_T arBssidPool[BSSID_POOL_MAX_SIZE];
|
|
||||||
UINT_8 ucNumBssidPoolEntry;
|
|
||||||
BOOLEAN fgIsHS2SigmaMode;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*For GTK Frame Filter*/
|
|
||||||
#if DBG
|
|
||||||
#define FREE_IPV4_NETWORK_ADDR_LIST(_prAddrList) \
|
|
||||||
{ \
|
|
||||||
UINT_32 u4Size = OFFSET_OF(IPV4_NETWORK_ADDRESS_LIST, arNetAddr) + \
|
|
||||||
(((_prAddrList)->ucAddrCount) * sizeof(IPV4_NETWORK_ADDRESS)); \
|
|
||||||
kalMemFree((_prAddrList), VIR_MEM_TYPE, u4Size); \
|
|
||||||
(_prAddrList) = NULL; \
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#define FREE_IPV4_NETWORK_ADDR_LIST(_prAddrList) \
|
|
||||||
{ \
|
|
||||||
kalMemFree((_prAddrList), VIR_MEM_TYPE, 0); \
|
|
||||||
(_prAddrList) = NULL; \
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
VOID hs20FillExtCapIE(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID hs20FillProreqExtCapIE(IN P_ADAPTER_T prAdapter, OUT PUINT_8 pucIE);
|
|
||||||
|
|
||||||
VOID hs20FillHS20IE(IN P_ADAPTER_T prAdapter, OUT PUINT_8 pucIE);
|
|
||||||
|
|
||||||
UINT_32 hs20CalculateHS20RelatedIEForProbeReq(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucTargetBSSID);
|
|
||||||
|
|
||||||
WLAN_STATUS hs20GenerateHS20RelatedIEForProbeReq(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucTargetBSSID, OUT PUINT_8 prIE);
|
|
||||||
|
|
||||||
BOOLEAN hs20IsGratuitousArp(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prCurrSwRfb);
|
|
||||||
|
|
||||||
BOOLEAN hs20IsUnsolicitedNeighborAdv(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prCurrSwRfb);
|
|
||||||
|
|
||||||
#if CFG_ENABLE_GTK_FRAME_FILTER
|
|
||||||
BOOLEAN hs20IsForgedGTKFrame(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN P_SW_RFB_T prCurrSwRfb);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BOOLEAN hs20IsUnsecuredFrame(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN P_SW_RFB_T prCurrSwRfb);
|
|
||||||
|
|
||||||
BOOLEAN hs20IsFrameFilterEnabled(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
WLAN_STATUS hs20SetBssidPool(IN P_ADAPTER_T prAdapter, IN PVOID pvBuffer, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif
|
|
|
@ -1,129 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _MIB_H
|
|
||||||
#define _MIB_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Entry in SMT AuthenticationAlgorithms Table: dot11AuthenticationAlgorithmsEntry */
|
|
||||||
typedef struct _DOT11_AUTHENTICATION_ALGORITHMS_ENTRY {
|
|
||||||
BOOLEAN dot11AuthenticationAlgorithmsEnable; /* dot11AuthenticationAlgorithmsEntry 3 */
|
|
||||||
} DOT11_AUTHENTICATION_ALGORITHMS_ENTRY, *P_DOT11_AUTHENTICATION_ALGORITHMS_ENTRY;
|
|
||||||
|
|
||||||
/* Entry in SMT dot11RSNAConfigPairwiseCiphersTalbe Table: dot11RSNAConfigPairwiseCiphersEntry */
|
|
||||||
typedef struct _DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY {
|
|
||||||
UINT_32 dot11RSNAConfigPairwiseCipher; /* dot11RSNAConfigPairwiseCiphersEntry 2 */
|
|
||||||
BOOLEAN dot11RSNAConfigPairwiseCipherEnabled; /* dot11RSNAConfigPairwiseCiphersEntry 3 */
|
|
||||||
} DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY, *P_DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY;
|
|
||||||
|
|
||||||
/* Entry in SMT dot11RSNAConfigAuthenticationSuitesTalbe Table: dot11RSNAConfigAuthenticationSuitesEntry */
|
|
||||||
typedef struct _DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY {
|
|
||||||
UINT_32 dot11RSNAConfigAuthenticationSuite; /* dot11RSNAConfigAuthenticationSuitesEntry 2 */
|
|
||||||
BOOLEAN dot11RSNAConfigAuthenticationSuiteEnabled; /* dot11RSNAConfigAuthenticationSuitesEntry 3 */
|
|
||||||
} DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY, *P_DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY;
|
|
||||||
|
|
||||||
/* ----- IEEE 802.11 MIB Major sections ----- */
|
|
||||||
typedef struct _IEEE_802_11_MIB_T {
|
|
||||||
/* dot11PrivacyTable (dot11smt 5) */
|
|
||||||
UINT_8 dot11WEPDefaultKeyID; /* dot11PrivacyEntry 2 */
|
|
||||||
BOOLEAN dot11TranmitKeyAvailable;
|
|
||||||
UINT_32 dot11WEPICVErrorCount; /* dot11PrivacyEntry 5 */
|
|
||||||
UINT_32 dot11WEPExcludedCount; /* dot11PrivacyEntry 6 */
|
|
||||||
|
|
||||||
/* dot11RSNAConfigTable (dot11smt 8) */
|
|
||||||
UINT_32 dot11RSNAConfigGroupCipher; /* dot11RSNAConfigEntry 4 */
|
|
||||||
|
|
||||||
/* dot11RSNAConfigPairwiseCiphersTable (dot11smt 9) */
|
|
||||||
DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY dot11RSNAConfigPairwiseCiphersTable[MAX_NUM_SUPPORTED_CIPHER_SUITES];
|
|
||||||
|
|
||||||
/* dot11RSNAConfigAuthenticationSuitesTable (dot11smt 10) */
|
|
||||||
DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY
|
|
||||||
dot11RSNAConfigAuthenticationSuitesTable[MAX_NUM_SUPPORTED_AKM_SUITES];
|
|
||||||
|
|
||||||
#if 0 /* SUPPORT_WAPI */
|
|
||||||
BOOLEAN fgWapiKeyInstalled;
|
|
||||||
PARAM_WPI_KEY_T rWapiPairwiseKey[2];
|
|
||||||
BOOLEAN fgPairwiseKeyUsed[2];
|
|
||||||
UINT_8 ucWpiActivedPWKey; /* Must be 0 or 1, by wapi spec */
|
|
||||||
PARAM_WPI_KEY_T rWapiGroupKey[2];
|
|
||||||
BOOLEAN fgGroupKeyUsed[2];
|
|
||||||
#endif
|
|
||||||
} IEEE_802_11_MIB_T, *P_IEEE_802_11_MIB_T;
|
|
||||||
|
|
||||||
/* ------------------ IEEE 802.11 non HT PHY characteristics ---------------- */
|
|
||||||
typedef const struct _NON_HT_PHY_ATTRIBUTE_T {
|
|
||||||
UINT_16 u2SupportedRateSet;
|
|
||||||
|
|
||||||
BOOLEAN fgIsShortPreambleOptionImplemented;
|
|
||||||
|
|
||||||
BOOLEAN fgIsShortSlotTimeOptionImplemented;
|
|
||||||
|
|
||||||
} NON_HT_PHY_ATTRIBUTE_T, *P_NON_HT_PHY_ATTRIBUTE_T;
|
|
||||||
|
|
||||||
typedef const struct _NON_HT_ADHOC_MODE_ATTRIBUTE_T {
|
|
||||||
|
|
||||||
ENUM_PHY_TYPE_INDEX_T ePhyTypeIndex;
|
|
||||||
|
|
||||||
UINT_16 u2BSSBasicRateSet;
|
|
||||||
|
|
||||||
} NON_HT_ADHOC_MODE_ATTRIBUTE_T, *P_NON_HT_ADHOC_MODE_ATTRIBUTE_T;
|
|
||||||
|
|
||||||
typedef NON_HT_ADHOC_MODE_ATTRIBUTE_T NON_HT_AP_MODE_ATTRIBUTE_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
extern NON_HT_PHY_ATTRIBUTE_T rNonHTPhyAttributes[];
|
|
||||||
extern NON_HT_ADHOC_MODE_ATTRIBUTE_T rNonHTAdHocModeAttributes[];
|
|
||||||
extern NON_HT_AP_MODE_ATTRIBUTE_T rNonHTApModeAttributes[];
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _MIB_H */
|
|
|
@ -1,59 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_ASSOC_H
|
|
||||||
#define _P2P_ASSOC_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
PUINT_8 p2pBuildReAssocReqFrameCommonIEs(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN PUINT_8 pucBuffer);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,59 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_BSS_H
|
|
||||||
#define _P2P_BSS_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
UINT_32 p2pGetTxProbRspIeTableSize(VOID);
|
|
||||||
|
|
||||||
#endif
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,194 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_FUNC_H
|
|
||||||
#define _P2P_FUNC_H
|
|
||||||
|
|
||||||
#define P2P_EXT_LISTEN_TIME_MS 600
|
|
||||||
#define P2P_OFF_CHNL_TX_DEFAULT_TIME_MS 1000
|
|
||||||
|
|
||||||
VOID p2pFuncRequestScan(IN P_ADAPTER_T prAdapter, IN P_P2P_SCAN_REQ_INFO_T prScanReqInfo);
|
|
||||||
|
|
||||||
VOID p2pFuncCancelScan(IN P_ADAPTER_T prAdapter, IN P_P2P_SCAN_REQ_INFO_T prScanReqInfo);
|
|
||||||
|
|
||||||
VOID p2pFuncStartGO(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_BSS_INFO_T prBssInfo,
|
|
||||||
IN UINT_8 ucChannelNum, IN ENUM_BAND_T eBand, IN ENUM_CHNL_EXT_T eSco, IN BOOLEAN fgIsPureAP);
|
|
||||||
|
|
||||||
VOID p2pFuncAcquireCh(IN P_ADAPTER_T prAdapter, IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo);
|
|
||||||
|
|
||||||
VOID p2pFuncReleaseCh(IN P_ADAPTER_T prAdapter, IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo);
|
|
||||||
|
|
||||||
BOOLEAN p2pFuncRetryJOIN(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN P_P2P_JOIN_INFO_T prJoinInfo);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
p2pFuncUpdateBssInfoForJOIN(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_BSS_DESC_T prBssDesc, IN P_STA_RECORD_T prStaRec, IN P_SW_RFB_T prAssocRspSwRfb);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
p2pFuncTxMgmtFrame(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_P2P_MGMT_TX_REQ_INFO_T prMgmtTxReqInfo, IN P_MSDU_INFO_T prMgmtTxMsdu, IN UINT_64 u8Cookie);
|
|
||||||
|
|
||||||
WLAN_STATUS p2pFuncProcessBeacon(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_BSS_INFO_T prP2pBssInfo,
|
|
||||||
IN P_P2P_BEACON_UPDATE_INFO_T prBcnUpdateInfo,
|
|
||||||
IN PUINT_8 pucNewBcnHdr, IN UINT_32 u4NewHdrLen,
|
|
||||||
IN PUINT_8 pucNewBcnBody, IN UINT_32 u4NewBodyLen);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_P2P_GO_OFFLOAD_PROBE_RSP
|
|
||||||
WLAN_STATUS p2pFuncUpdateProbeRspIEs(IN P_ADAPTER_T prAdapter, IN P_MSG_P2P_BEACON_UPDATE_T prIETemp,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
p2pFuncValidateAuth(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb, IN PP_STA_RECORD_T pprStaRec, OUT PUINT_16 pu2StatusCode);
|
|
||||||
|
|
||||||
BOOLEAN p2pFuncValidateAssocReq(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT PUINT_16 pu2StatusCode);
|
|
||||||
|
|
||||||
VOID p2pFuncResetStaRecStatus(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID p2pFuncInitConnectionSettings(IN P_ADAPTER_T prAdapter, IN P_P2P_CONNECTION_SETTINGS_T prP2PConnSettings);
|
|
||||||
|
|
||||||
BOOLEAN p2pFuncParseCheckForP2PInfoElem(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucBuf, OUT PUINT_8 pucOuiType);
|
|
||||||
|
|
||||||
BOOLEAN p2pFuncValidateProbeReq(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT PUINT_32 pu4ControlFlags);
|
|
||||||
|
|
||||||
VOID p2pFuncValidateRxActionFrame(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
BOOLEAN p2pFuncIsAPMode(IN P_P2P_FSM_INFO_T prP2pFsmInfo);
|
|
||||||
|
|
||||||
VOID p2pFuncParseBeaconIEs(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_BSS_INFO_T prP2pBssInfo, IN PUINT_8 pucIEInfo, IN UINT_32 u4IELen);
|
|
||||||
|
|
||||||
P_BSS_DESC_T
|
|
||||||
p2pFuncKeepOnConnection(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo,
|
|
||||||
IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo, IN P_P2P_SCAN_REQ_INFO_T prScanReqInfo);
|
|
||||||
|
|
||||||
VOID p2pFuncStoreAssocRspIEBuffer(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
p2pFuncMgmtFrameRegister(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_16 u2FrameType, IN BOOLEAN fgIsRegistered, OUT PUINT_32 pu4P2pPacketFilter);
|
|
||||||
|
|
||||||
VOID p2pFuncUpdateMgmtFrameRegister(IN P_ADAPTER_T prAdapter, IN UINT_32 u4OsFilter);
|
|
||||||
|
|
||||||
VOID p2pFuncGetStationInfo(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucMacAddr, OUT P_P2P_STATION_INFO_T prStaInfo);
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
p2pFuncGetAttriList(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_8 ucOuiType,
|
|
||||||
IN PUINT_8 pucIE, IN UINT_16 u2IELength, OUT PPUINT_8 ppucAttriList, OUT PUINT_16 pu2AttriListLen);
|
|
||||||
|
|
||||||
P_MSDU_INFO_T p2pFuncProcessP2pProbeRsp(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMgmtTxMsdu);
|
|
||||||
|
|
||||||
#if 0 /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) */
|
|
||||||
UINT_32
|
|
||||||
p2pFuncCalculateExtra_IELenForBeacon(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID p2pFuncGenerateExtra_IEForBeacon(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
#else
|
|
||||||
UINT_32
|
|
||||||
p2pFuncCalculateP2p_IELenForBeacon(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID p2pFuncGenerateP2p_IEForBeacon(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
p2pFuncCalculateWSC_IELenForBeacon(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID p2pFuncGenerateWSC_IEForBeacon(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
#endif
|
|
||||||
UINT_32
|
|
||||||
p2pFuncCalculateP2p_IELenForAssocRsp(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID p2pFuncGenerateP2p_IEForAssocRsp(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
p2pFuncCalculateWSC_IELenForAssocRsp(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID p2pFuncGenerateWSC_IEForAssocRsp(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
p2pFuncCalculateP2P_IELen(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
|
||||||
IN P_STA_RECORD_T prStaRec,
|
|
||||||
IN APPEND_VAR_ATTRI_ENTRY_T arAppendAttriTable[], IN UINT_32 u4AttriTableSize);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
p2pFuncGenerateP2P_IE(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN BOOLEAN fgIsAssocFrame,
|
|
||||||
IN PUINT_16 pu2Offset,
|
|
||||||
IN PUINT_8 pucBuf,
|
|
||||||
IN UINT_16 u2BufSize,
|
|
||||||
IN APPEND_VAR_ATTRI_ENTRY_T arAppendAttriTable[], IN UINT_32 u4AttriTableSize);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
p2pFuncAppendAttriStatusForAssocRsp(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN BOOLEAN fgIsAssocFrame,
|
|
||||||
IN PUINT_16 pu2Offset, IN PUINT_8 pucBuf, IN UINT_16 u2BufSize);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
p2pFuncAppendAttriExtListenTiming(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN BOOLEAN fgIsAssocFrame,
|
|
||||||
IN PUINT_16 pu2Offset, IN PUINT_8 pucBuf, IN UINT_16 u2BufSize);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
p2pFuncDissolve(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_BSS_INFO_T prP2pBssInfo, IN BOOLEAN fgSendDeauth, IN UINT_16 u2ReasonCode);
|
|
||||||
|
|
||||||
P_IE_HDR_T
|
|
||||||
p2pFuncGetSpecIE(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PUINT_8 pucIEBuf, IN UINT_16 u2BufferLen, IN UINT_8 ucElemID, IN PBOOLEAN pfgIsMore);
|
|
||||||
|
|
||||||
P_ATTRIBUTE_HDR_T
|
|
||||||
p2pFuncGetSpecAttri(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_8 ucOuiType, IN PUINT_8 pucIEBuf, IN UINT_16 u2BufferLen, IN UINT_16 u2AttriID);
|
|
||||||
|
|
||||||
WLAN_STATUS wfdChangeMediaState(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx,
|
|
||||||
IN ENUM_PARAM_MEDIA_STATE_T eConnectionState);
|
|
||||||
#if CFG_SUPPORT_P2P_EAP_FAIL_WORKAROUND
|
|
||||||
VOID p2pFuncEAPfailureWorkaround(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PUINT_8 pucEvtBuf);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BOOLEAN p2pFuncValidateProbeResp(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMgmtTxMsdu);
|
|
||||||
|
|
||||||
BOOLEAN p2pFuncRetryGcDeauth(IN P_ADAPTER_T prAdapter, IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
|
||||||
IN P_STA_RECORD_T prStaRec, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
|
|
||||||
|
|
||||||
VOID p2pFuncClearGcDeauthRetry(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID p2pFuncDeauthComplete(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prP2pBssInfo);
|
|
||||||
|
|
||||||
void p2pFunCleanQueuedMgmtFrame(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN struct P2P_QUEUED_ACTION_FRAME *prFrame);
|
|
||||||
|
|
||||||
void p2pFunProcessAcsReport(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_PARAM_GET_CHN_INFO prLteSafeChnInfo,
|
|
||||||
IN struct P2P_ACS_REQ_INFO *prAcsReqInfo);
|
|
||||||
|
|
||||||
void p2pFunIndicateAcsResult(IN P_GLUE_INFO_T prGlueInfo,
|
|
||||||
IN struct P2P_ACS_REQ_INFO *prAcsReqInfo);
|
|
||||||
|
|
||||||
void p2pFunCalAcsChnScores(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_BAND_T eBand);
|
|
||||||
|
|
|
@ -1,171 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_IE_H
|
|
||||||
#define _P2P_IE_H
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_WFD
|
|
||||||
|
|
||||||
#define ELEM_MAX_LEN_WFD 62 /* TODO: Move to appropriate place */
|
|
||||||
|
|
||||||
/*---------------- WFD Data Element Definitions ----------------*/
|
|
||||||
/* WFD 4.1.1 - WFD IE format */
|
|
||||||
#define WFD_OUI_TYPE_LEN 4
|
|
||||||
#define WFD_IE_OUI_HDR (ELEM_HDR_LEN + WFD_OUI_TYPE_LEN) /*
|
|
||||||
* == OFFSET_OF(IE_P2P_T,
|
|
||||||
* aucP2PAttributes[0])
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* WFD 4.1.1 - General WFD Attribute */
|
|
||||||
#define WFD_ATTRI_HDR_LEN 3 /* ID(1 octet) + Length(2 octets) */
|
|
||||||
|
|
||||||
/* WFD Attribute Code */
|
|
||||||
#define WFD_ATTRI_ID_DEV_INFO 0
|
|
||||||
#define WFD_ATTRI_ID_ASSOC_BSSID 1
|
|
||||||
#define WFD_ATTRI_ID_COUPLED_SINK_INFO 6
|
|
||||||
#define WFD_ATTRI_ID_EXT_CAPABILITY 7
|
|
||||||
#define WFD_ATTRI_ID_SESSION_INFO 9
|
|
||||||
#define WFD_ATTRI_ID_ALTER_MAC_ADDRESS 10
|
|
||||||
|
|
||||||
/* Maximum Length of WFD Attributes */
|
|
||||||
#define WFD_ATTRI_MAX_LEN_DEV_INFO 6 /* 0 */
|
|
||||||
#define WFD_ATTRI_MAX_LEN_ASSOC_BSSID 6 /* 1 */
|
|
||||||
#define WFD_ATTRI_MAX_LEN_COUPLED_SINK_INFO 7 /* 6 */
|
|
||||||
#define WFD_ATTRI_MAX_LEN_EXT_CAPABILITY 2 /* 7 */
|
|
||||||
#define WFD_ATTRI_MAX_LEN_SESSION_INFO 0 /* 9 */ /* 24 * #Clients */
|
|
||||||
#define WFD_ATTRI_MAX_LEN_ALTER_MAC_ADDRESS 6 /* 10 */
|
|
||||||
|
|
||||||
/* WFD 1.10 5.1.1 */
|
|
||||||
typedef struct _IE_WFD_T {
|
|
||||||
UINT_8 ucId; /* Element ID */
|
|
||||||
UINT_8 ucLength; /* Length */
|
|
||||||
UINT_8 aucOui[3]; /* OUI */
|
|
||||||
UINT_8 ucOuiType; /* OUI Type */
|
|
||||||
UINT_8 aucWFDAttributes[1]; /* WFD Subelement */
|
|
||||||
} __KAL_ATTRIB_PACKED__ IE_WFD_T, *P_IE_WFD_T;
|
|
||||||
|
|
||||||
typedef struct _WFD_ATTRIBUTE_T {
|
|
||||||
UINT_8 ucElemID; /* Subelement ID */
|
|
||||||
UINT_16 u2Length; /* Length */
|
|
||||||
UINT_8 aucBody[1]; /* Body field */
|
|
||||||
} __KAL_ATTRIB_PACKED__ WFD_ATTRIBUTE_T, *P_WFD_ATTRIBUTE_T;
|
|
||||||
|
|
||||||
typedef struct _WFD_DEVICE_INFORMATION_IE_T {
|
|
||||||
UINT_8 ucElemID;
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_16 u2WfdDevInfo;
|
|
||||||
UINT_16 u2SessionMgmtCtrlPort;
|
|
||||||
UINT_16 u2WfdDevMaxSpeed;
|
|
||||||
} __KAL_ATTRIB_PACKED__ WFD_DEVICE_INFORMATION_IE_T, *P_WFD_DEVICE_INFORMATION_IE_T;
|
|
||||||
|
|
||||||
typedef struct _WFD_ASSOCIATED_BSSID_IE_T {
|
|
||||||
UINT_8 ucElemID;
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_8 aucAssocBssid[MAC_ADDR_LEN];
|
|
||||||
} __KAL_ATTRIB_PACKED__ WFD_ASSOCIATED_BSSID_IE_T, *P_WFD_ASSOCIATED_BSSID_IE_T;
|
|
||||||
|
|
||||||
typedef struct _WFD_COUPLE_SINK_INFORMATION_IE_T {
|
|
||||||
UINT_8 ucElemID;
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_8 ucCoupleSinkStatusBp;
|
|
||||||
UINT_8 aucCoupleSinkMac[MAC_ADDR_LEN];
|
|
||||||
} __KAL_ATTRIB_PACKED__ WFD_COUPLE_SINK_INFORMATION_IE_T, *P_WFD_COUPLE_SINK_INFORMATION_IE_T;
|
|
||||||
|
|
||||||
typedef struct _WFD_EXTENDED_CAPABILITY_IE_T {
|
|
||||||
UINT_8 ucElemID;
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_16 u2WfdExtCapabilityBp;
|
|
||||||
} __KAL_ATTRIB_PACKED__ WFD_EXTENDED_CAPABILITY_IE_T, *P_WFD_EXTENDED_CAPABILITY_IE_T;
|
|
||||||
|
|
||||||
typedef struct _WFD_SESSION_INFORMATION_IE_T {
|
|
||||||
UINT_8 ucElemID;
|
|
||||||
UINT_16 u2Length;
|
|
||||||
PUINT_8 pucWfdDevInfoDesc[1];
|
|
||||||
} __KAL_ATTRIB_PACKED__ WFD_SESSION_INFORMATION_IE_T, *P_WFD_SESSION_INFORMATION_IE_T;
|
|
||||||
|
|
||||||
typedef struct _WFD_DEVICE_INFORMATION_DESCRIPTOR_T {
|
|
||||||
UINT_8 ucLength;
|
|
||||||
UINT_8 aucDevAddr[MAC_ADDR_LEN];
|
|
||||||
UINT_8 aucAssocBssid[MAC_ADDR_LEN];
|
|
||||||
UINT_16 u2WfdDevInfo;
|
|
||||||
UINT_16 u2WfdDevMaxSpeed;
|
|
||||||
UINT_8 ucCoupleSinkStatusBp;
|
|
||||||
UINT_8 aucCoupleSinkMac[MAC_ADDR_LEN];
|
|
||||||
} __KAL_ATTRIB_PACKED__ WFD_DEVICE_INFORMATION_DESCRIPTOR_T, *P_WFD_DEVICE_INFORMATION_DESCRIPTOR_T;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
p2pCalculate_IEForAssocReq(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID p2pGenerate_IEForAssocReq(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_WFD
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
wfdFuncAppendAttriDevInfo(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN BOOLEAN fgIsAssocFrame, IN PUINT_16 pu2Offset, IN PUINT_8 pucBuf, IN UINT_16 u2BufSize);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
wfdFuncAppendAttriAssocBssid(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN BOOLEAN fgIsAssocFrame, IN PUINT_16 pu2Offset, IN PUINT_8 pucBuf, IN UINT_16 u2BufSize);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
wfdFuncAppendAttriCoupledSinkInfo(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN BOOLEAN fgIsAssocFrame,
|
|
||||||
IN PUINT_16 pu2Offset, IN PUINT_8 pucBuf, IN UINT_16 u2BufSize);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
wfdFuncAppendAttriExtCapability(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN BOOLEAN fgIsAssocFrame,
|
|
||||||
IN PUINT_16 pu2Offset, IN PUINT_8 pucBuf, IN UINT_16 u2BufSize);
|
|
||||||
|
|
||||||
UINT_32 wfdFuncCalculateAttriLenSessionInfo(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
wfdFuncAppendAttriSessionInfo(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN BOOLEAN fgIsAssocFrame,
|
|
||||||
IN PUINT_16 pu2Offset, IN PUINT_8 pucBuf, IN UINT_16 u2BufSize);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
wfdFuncCalculateWfdIELenForProbeResp(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID wfdFuncGenerateWfdIEForProbeResp(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
wfdFuncCalculateWfdIELenForAssocReq(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID wfdFuncGenerateWfdIEForAssocReq(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
wfdFuncCalculateWfdIELenForAssocRsp(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID wfdFuncGenerateWfdIEForAssocRsp(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
wfdFuncCalculateWfdIELenForBeacon(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID wfdFuncGenerateWfdIEForBeacon(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UINT_32 p2pFuncCalculateP2P_IE_NoA(IN P_ADAPTER_T prAdapter, IN UINT_32 ucBssIdx, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID p2pFuncGenerateP2P_IE_NoA(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,79 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_RLM_H
|
|
||||||
#define _P2P_RLM_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
extern VOID rlmSyncOperationParams(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
VOID rlmBssInitForAP(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
BOOLEAN rlmUpdateBwByChListForAP(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
VOID rlmUpdateParamsForAP(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo, BOOLEAN fgUpdateBeacon);
|
|
||||||
|
|
||||||
VOID rlmFuncInitialChannelList(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
rlmFuncCommonChannelList(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_CHANNEL_ENTRY_FIELD_T prChannelEntryII, IN UINT_8 ucChannelListSize);
|
|
||||||
|
|
||||||
UINT_8 rlmFuncFindOperatingClass(IN P_ADAPTER_T prAdapter, IN UINT_8 ucChannelNum);
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
rlmFuncFindAvailableChannel(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_8 ucCheckChnl,
|
|
||||||
IN PUINT_8 pucSuggestChannel, IN BOOLEAN fgIsSocialChannel, IN BOOLEAN fgIsDefaultChannel);
|
|
||||||
|
|
||||||
ENUM_CHNL_EXT_T rlmDecideScoForAP(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
|
|
||||||
ENUM_CHNL_EXT_T rlmDecideSco(P_ADAPTER_T prAdapter, UINT_8 ucPrimaryChannel, ENUM_BAND_T eBand);
|
|
||||||
#endif
|
|
|
@ -1,69 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_RLM_OBSS_H
|
|
||||||
#define _P2P_RLM_OBSS_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
VOID rlmRspGenerateObssScanIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rlmProcessPublicAction(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID rlmProcessHtAction(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID rlmHandleObssStatusEventPkt(P_ADAPTER_T prAdapter, P_EVENT_AP_OBSS_STATUS_T prObssStatus);
|
|
||||||
|
|
||||||
UINT_8 rlmObssChnlLevel(P_BSS_INFO_T prBssInfo, ENUM_BAND_T eBand, UINT_8 ucPriChannel, ENUM_CHNL_EXT_T eExtend);
|
|
||||||
|
|
||||||
VOID rlmObssScanExemptionRsp(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo, P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,85 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_SCAN_H
|
|
||||||
#define _P2P_SCAN_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
WLAN_STATUS scanSendDeviceDiscoverEvent(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
P_P2P_DEVICE_DESC_T
|
|
||||||
scanSearchTargetP2pDesc(IN P_ADAPTER_T prAdapter, IN UINT_8 aucDeviceID[], IN PP_BSS_DESC_T pprBssDesc);
|
|
||||||
|
|
||||||
P_P2P_DEVICE_DESC_T
|
|
||||||
scanFindP2pDeviceDesc(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_BSS_DESC_T prBssDesc,
|
|
||||||
IN UINT_8 aucMacAddr[], IN BOOLEAN fgIsDeviceAddr, IN BOOLEAN fgAddIfNoFound);
|
|
||||||
|
|
||||||
P_P2P_DEVICE_DESC_T scanGetP2pDeviceDesc(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
VOID scnEventReturnChannel(IN P_ADAPTER_T prAdapter, IN UINT_8 ucScnSeqNum);
|
|
||||||
|
|
||||||
BOOLEAN scanUpdateP2pDeviceDesc(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
scanP2pProcessBeaconAndProbeResp(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb,
|
|
||||||
IN P_WLAN_STATUS prStatus,
|
|
||||||
IN P_BSS_DESC_T prBssDesc, IN P_WLAN_BEACON_FRAME_T prWlanBeaconFrame);
|
|
||||||
|
|
||||||
VOID scanRemoveAllP2pBssDesc(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID scanRemoveP2pBssDesc(P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
P_BSS_DESC_T
|
|
||||||
scanP2pSearchDesc(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prP2pBssInfo, IN P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,56 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_STATE_H
|
|
||||||
#define _P2P_STATE_H
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
p2pStateInit_IDLE(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo, IN P_BSS_INFO_T prP2pBssInfo, OUT P_ENUM_P2P_STATE_T peNextState);
|
|
||||||
|
|
||||||
VOID p2pStateAbort_IDLE(IN P_ADAPTER_T prAdapter, IN P_P2P_FSM_INFO_T prP2pFsmInfo, IN ENUM_P2P_STATE_T eNextState);
|
|
||||||
|
|
||||||
VOID p2pStateInit_SCAN(IN P_ADAPTER_T prAdapter, IN P_P2P_FSM_INFO_T prP2pFsmInfo);
|
|
||||||
|
|
||||||
VOID p2pStateAbort_SCAN(IN P_ADAPTER_T prAdapter, IN P_P2P_FSM_INFO_T prP2pFsmInfo, IN ENUM_P2P_STATE_T eNextState);
|
|
||||||
|
|
||||||
VOID p2pStateInit_AP_CHANNEL_DETECT(IN P_ADAPTER_T prAdapter, IN P_P2P_FSM_INFO_T prP2pFsmInfo);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
p2pStateAbort_AP_CHANNEL_DETECT(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
|
||||||
IN P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo, IN ENUM_P2P_STATE_T eNextState);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
p2pStateInit_CHNL_ON_HAND(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prP2pBssInfo, IN P_P2P_FSM_INFO_T prP2pFsmInfo);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
p2pStateAbort_CHNL_ON_HAND(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
|
||||||
IN P_BSS_INFO_T prP2pBssInfo, IN ENUM_P2P_STATE_T eNextState);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
p2pStateAbort_REQING_CHANNEL(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo, IN ENUM_P2P_STATE_T eNextState);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
p2pStateInit_GC_JOIN(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
|
||||||
IN P_BSS_INFO_T prP2pBssInfo, IN P_P2P_JOIN_INFO_T prJoinInfo, IN P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
p2pStateAbort_GC_JOIN(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
|
||||||
IN P_P2P_JOIN_INFO_T prJoinInfo, IN ENUM_P2P_STATE_T eNextState);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,190 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _PRIVACY_H
|
|
||||||
#define _PRIVACY_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define MAX_KEY_NUM 4
|
|
||||||
#define WEP_40_LEN 5
|
|
||||||
#define WEP_104_LEN 13
|
|
||||||
#define LEGACY_KEY_MAX_LEN 16
|
|
||||||
#define CCMP_KEY_LEN 16
|
|
||||||
#define TKIP_KEY_LEN 32
|
|
||||||
#define MAX_KEY_LEN 32
|
|
||||||
#define MIC_RX_KEY_OFFSET 16
|
|
||||||
#define MIC_TX_KEY_OFFSET 24
|
|
||||||
#define MIC_KEY_LEN 8
|
|
||||||
|
|
||||||
#define WEP_KEY_ID_FIELD BITS(0, 29)
|
|
||||||
#define KEY_ID_FIELD BITS(0, 7)
|
|
||||||
|
|
||||||
#define IS_TRANSMIT_KEY BIT(31)
|
|
||||||
#define IS_UNICAST_KEY BIT(30)
|
|
||||||
#define IS_AUTHENTICATOR BIT(28)
|
|
||||||
|
|
||||||
#define CIPHER_SUITE_NONE 0
|
|
||||||
#define CIPHER_SUITE_WEP40 1
|
|
||||||
#define CIPHER_SUITE_TKIP 2
|
|
||||||
#define CIPHER_SUITE_TKIP_WO_MIC 3
|
|
||||||
#define CIPHER_SUITE_CCMP 4
|
|
||||||
#define CIPHER_SUITE_WEP104 5
|
|
||||||
#define CIPHER_SUITE_BIP 6
|
|
||||||
#define CIPHER_SUITE_WEP128 7
|
|
||||||
#define CIPHER_SUITE_WPI 8
|
|
||||||
|
|
||||||
#define WPA_KEY_INFO_KEY_TYPE BIT(3) /* 1 = Pairwise, 0 = Group key */
|
|
||||||
#define WPA_KEY_INFO_MIC BIT(8)
|
|
||||||
#define WPA_KEY_INFO_SECURE BIT(9)
|
|
||||||
|
|
||||||
#define MASK_2ND_EAPOL (WPA_KEY_INFO_KEY_TYPE | WPA_KEY_INFO_MIC)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _IEEE_802_1X_HDR {
|
|
||||||
UINT_8 ucVersion;
|
|
||||||
UINT_8 ucType;
|
|
||||||
UINT_16 u2Length;
|
|
||||||
/* followed by length octets of data */
|
|
||||||
} IEEE_802_1X_HDR, *P_IEEE_802_1X_HDR;
|
|
||||||
|
|
||||||
typedef struct _EAPOL_KEY {
|
|
||||||
UINT_8 ucType;
|
|
||||||
/* Note: key_info, key_length, and key_data_length are unaligned */
|
|
||||||
UINT_8 aucKeyInfo[2]; /* big endian */
|
|
||||||
UINT_8 aucKeyLength[2]; /* big endian */
|
|
||||||
UINT_8 aucReplayCounter[8];
|
|
||||||
UINT_8 aucKeyNonce[16];
|
|
||||||
UINT_8 aucKeyIv[16];
|
|
||||||
UINT_8 aucKeyRsc[8];
|
|
||||||
UINT_8 aucKeyId[8]; /* Reserved in IEEE 802.11i/RSN */
|
|
||||||
UINT_8 aucKeyMic[16];
|
|
||||||
UINT_8 aucKeyDataLength[2]; /* big endian */
|
|
||||||
/* followed by key_data_length bytes of key_data */
|
|
||||||
} EAPOL_KEY, *P_EAPOL_KEY;
|
|
||||||
|
|
||||||
/* WPA2 PMKID candicate structure */
|
|
||||||
typedef struct _PMKID_CANDICATE_T {
|
|
||||||
UINT_8 aucBssid[MAC_ADDR_LEN];
|
|
||||||
UINT_32 u4PreAuthFlags;
|
|
||||||
} PMKID_CANDICATE_T, *P_PMKID_CANDICATE_T;
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* WPA2 PMKID cache structure */
|
|
||||||
typedef struct _PMKID_ENTRY_T {
|
|
||||||
PARAM_BSSID_INFO_T rBssidInfo;
|
|
||||||
BOOLEAN fgPmkidExist;
|
|
||||||
} PMKID_ENTRY_T, *P_PMKID_ENTRY_T;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
enum ENUM_EAPOL_KEY_TYPE_T {
|
|
||||||
EAPOL_KEY_NOT_KEY = 0,
|
|
||||||
EAPOL_KEY_1_OF_4 = 1,
|
|
||||||
EAPOL_KEY_2_OF_4 = 2,
|
|
||||||
EAPOL_KEY_3_OF_4 = 3,
|
|
||||||
EAPOL_KEY_4_OF_4 = 4,
|
|
||||||
EAPOL_KEY_1_OF_2 = 5,
|
|
||||||
EAPOL_KEY_2_OF_2 = 6,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum ENUM_KEY_ACTION_TYPE_T {
|
|
||||||
SEC_DROP_KEY_COMMAND = 0,
|
|
||||||
SEC_QUEUE_KEY_COMMAND = 1,
|
|
||||||
SEC_TX_KEY_COMMAND = 2,
|
|
||||||
SEC_ACTION_KEY_NUM
|
|
||||||
};
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
VOID secInit(IN P_ADAPTER_T prAdapter, IN UINT_8 ucNetTypeIdx);
|
|
||||||
|
|
||||||
VOID secSetPortBlocked(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta, IN BOOLEAN fgPort);
|
|
||||||
|
|
||||||
BOOLEAN secCheckClassError(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
BOOLEAN secTxPortControlCheck(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
BOOLEAN secRxPortControlCheck(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSWRfb);
|
|
||||||
|
|
||||||
VOID secSetCipherSuite(IN P_ADAPTER_T prAdapter, IN UINT_32 u4CipherSuitesFlags);
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
secProcessEAPOL(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_MSDU_INFO_T prMsduInfo,
|
|
||||||
IN P_STA_RECORD_T prStaRec, IN PUINT_8 pucPayload, IN UINT_16 u2PayloadLen);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
secHandleTxDoneCallback(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_MSDU_INFO_T pMsduInfo, IN P_STA_RECORD_T prStaRec, IN WLAN_STATUS rStatus);
|
|
||||||
|
|
||||||
BOOLEAN secIsProtectedFrame(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsdu, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
#if (CFG_REFACTORY_PMKSA == 0)
|
|
||||||
VOID secClearPmkid(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BOOLEAN secRsnKeyHandshakeEnabled(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN secTransmitKeyExist(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
|
|
||||||
|
|
||||||
BOOLEAN secEnabledInAis(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN secWpaEnabledInAis(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
enum ENUM_EAPOL_KEY_TYPE_T secGetEapolKeyType(PUINT_8 pucPacket);
|
|
||||||
|
|
||||||
VOID secHandleTxStatus(ADAPTER_T *prAdapter, UINT_8 *pucEvtBuf);
|
|
||||||
|
|
||||||
VOID secHandleRxEapolPacket(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prRetSwRfb,
|
|
||||||
IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _PRIVACY_H */
|
|
|
@ -1,72 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _QOSMAP_H
|
|
||||||
#define _QOSMAP_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define DSCP_SUPPORT 1
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID handleQosMapConf(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
int qosHandleQosMapConfigure(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID qosMapSetInit(IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID qosParseQosMapSet(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN PUINT_8 qosMapSet);
|
|
||||||
|
|
||||||
UINT_8 getUpFromDscp(IN P_GLUE_INFO_T prGlueInfo, IN int type, IN int dscp);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _QOSMAP_H */
|
|
|
@ -1,78 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _RATE_H
|
|
||||||
#define _RATE_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines in rate.c */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID
|
|
||||||
rateGetRateSetFromIEs(IN P_IE_SUPPORTED_RATE_T prIeSupportedRate,
|
|
||||||
IN P_IE_EXT_SUPPORTED_RATE_T prIeExtSupportedRate,
|
|
||||||
OUT PUINT_16 pu2OperationalRateSet,
|
|
||||||
OUT PUINT_16 pu2BSSBasicRateSet, OUT PBOOLEAN pfgIsUnknownBSSBasicRate);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
rateGetDataRatesFromRateSet(IN UINT_16 u2OperationalRateSet,
|
|
||||||
IN UINT_16 u2BSSBasicRateSet, OUT PUINT_8 pucDataRates, OUT PUINT_8 pucDataRatesLen);
|
|
||||||
|
|
||||||
BOOLEAN rateGetHighestRateIndexFromRateSet(IN UINT_16 u2RateSet, OUT PUINT_8 pucHighestRateIndex);
|
|
||||||
|
|
||||||
BOOLEAN rateGetLowestRateIndexFromRateSet(IN UINT_16 u2RateSet, OUT PUINT_8 pucLowestRateIndex);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _RATE_H */
|
|
|
@ -1,404 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _RLM_H
|
|
||||||
#define _RLM_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define ELEM_EXT_CAP_DEFAULT_VAL \
|
|
||||||
(ELEM_EXT_CAP_20_40_COEXIST_SUPPORT /*| ELEM_EXT_CAP_PSMP_CAP*/)
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_RX_STBC
|
|
||||||
#define FIELD_HT_CAP_INFO_RX_STBC HT_CAP_INFO_RX_STBC_1_SS
|
|
||||||
#else
|
|
||||||
#define FIELD_HT_CAP_INFO_RX_STBC HT_CAP_INFO_RX_STBC_NO_SUPPORTED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_RX_SGI
|
|
||||||
#define FIELD_HT_CAP_INFO_SGI_20M HT_CAP_INFO_SHORT_GI_20M
|
|
||||||
#define FIELD_HT_CAP_INFO_SGI_40M HT_CAP_INFO_SHORT_GI_40M
|
|
||||||
#else
|
|
||||||
#define FIELD_HT_CAP_INFO_SGI_20M 0
|
|
||||||
#define FIELD_HT_CAP_INFO_SGI_40M 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_RX_HT_GF
|
|
||||||
#define FIELD_HT_CAP_INFO_HT_GF HT_CAP_INFO_HT_GF
|
|
||||||
#else
|
|
||||||
#define FIELD_HT_CAP_INFO_HT_GF 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HT_CAP_INFO_DEFAULT_VAL \
|
|
||||||
(HT_CAP_INFO_SUP_CHNL_WIDTH | FIELD_HT_CAP_INFO_HT_GF | \
|
|
||||||
FIELD_HT_CAP_INFO_SGI_20M | FIELD_HT_CAP_INFO_SGI_40M | \
|
|
||||||
FIELD_HT_CAP_INFO_RX_STBC | HT_CAP_INFO_DSSS_CCK_IN_40M)
|
|
||||||
|
|
||||||
#define AMPDU_PARAM_DEFAULT_VAL \
|
|
||||||
(AMPDU_PARAM_MAX_AMPDU_LEN_64K | AMPDU_PARAM_MSS_NO_RESTRICIT)
|
|
||||||
|
|
||||||
#define SUP_MCS_TX_DEFAULT_VAL \
|
|
||||||
SUP_MCS_TX_SET_DEFINED /* TX defined and TX/RX equal (TBD) */
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_MFB
|
|
||||||
#define FIELD_HT_EXT_CAP_MFB HT_EXT_CAP_MCS_FEEDBACK_BOTH
|
|
||||||
#else
|
|
||||||
#define FIELD_HT_EXT_CAP_MFB HT_EXT_CAP_MCS_FEEDBACK_NO_FB
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_RX_RDG
|
|
||||||
#define FIELD_HT_EXT_CAP_RDR HT_EXT_CAP_RD_RESPONDER
|
|
||||||
#else
|
|
||||||
#define FIELD_HT_EXT_CAP_RDR 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_MFB || CFG_SUPPORT_RX_RDG
|
|
||||||
#define FIELD_HT_EXT_CAP_HTC HT_EXT_CAP_HTC_SUPPORT
|
|
||||||
#else
|
|
||||||
#define FIELD_HT_EXT_CAP_HTC 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HT_EXT_CAP_DEFAULT_VAL \
|
|
||||||
(HT_EXT_CAP_PCO | HT_EXT_CAP_PCO_TRANS_TIME_NONE | \
|
|
||||||
FIELD_HT_EXT_CAP_MFB | FIELD_HT_EXT_CAP_HTC | \
|
|
||||||
FIELD_HT_EXT_CAP_RDR)
|
|
||||||
|
|
||||||
#define TX_BEAMFORMING_CAP_DEFAULT_VAL 0
|
|
||||||
#define ASEL_CAP_DEFAULT_VAL 0
|
|
||||||
|
|
||||||
/* Define bandwidth from user setting */
|
|
||||||
#define CONFIG_BW_20_40M 0
|
|
||||||
#define CONFIG_BW_20M 1 /* 20MHz only */
|
|
||||||
|
|
||||||
/* Radio Measurement Request Mode definition */
|
|
||||||
#define RM_REQ_MODE_PARALLEL_BIT BIT(0)
|
|
||||||
#define RM_REQ_MODE_ENABLE_BIT BIT(1)
|
|
||||||
#define RM_REQ_MODE_REQUEST_BIT BIT(2)
|
|
||||||
#define RM_REQ_MODE_REPORT_BIT BIT(3)
|
|
||||||
#define RM_REQ_MODE_DURATION_MANDATORY_BIT BIT(4)
|
|
||||||
#define RM_REP_MODE_LATE BIT(0)
|
|
||||||
#define RM_REP_MODE_INCAPABLE BIT(1)
|
|
||||||
#define RM_REP_MODE_REFUSED BIT(2)
|
|
||||||
|
|
||||||
/* Radio Measurement Report Frame Max Length */
|
|
||||||
#define RM_REPORT_FRAME_MAX_LENGTH 1600
|
|
||||||
#define RM_BCN_REPORT_SUB_ELEM_MAX_LENGTH 224
|
|
||||||
|
|
||||||
/* beacon request mode definition */
|
|
||||||
#define RM_BCN_REQ_PASSIVE_MODE 0
|
|
||||||
#define RM_BCN_REQ_ACTIVE_MODE 1
|
|
||||||
#define RM_BCN_REQ_TABLE_MODE 2
|
|
||||||
|
|
||||||
#define RLM_INVALID_POWER_LIMIT -127 /* dbm */
|
|
||||||
#define RLM_MAX_TX_PWR 20 /* dbm */
|
|
||||||
#define RLM_MIN_TX_PWR 8 /* dbm */
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
struct SUB_ELEMENT_LIST {
|
|
||||||
struct SUB_ELEMENT_LIST *prNext;
|
|
||||||
struct SUB_ELEMENT_T rSubIE;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum BCN_RM_STATE {
|
|
||||||
RM_NO_REQUEST,
|
|
||||||
RM_ON_GOING,
|
|
||||||
RM_WAITING, /*waiting normal scan done */
|
|
||||||
};
|
|
||||||
|
|
||||||
enum RM_REQ_PRIORITY {
|
|
||||||
RM_PRI_BROADCAST,
|
|
||||||
RM_PRI_MULTICAST,
|
|
||||||
RM_PRI_UNICAST
|
|
||||||
};
|
|
||||||
|
|
||||||
struct NORMAL_SCAN_PARAMS {
|
|
||||||
PARAM_SSID_T arSSID[SCN_SSID_MAX_NUM];
|
|
||||||
UINT_8 aucScanIEBuf[MAX_IE_LENGTH];
|
|
||||||
UINT_32 u4IELen;
|
|
||||||
UINT_8 ucSsidNum;
|
|
||||||
BOOLEAN fgExist;
|
|
||||||
BOOLEAN fgFull2Partial;
|
|
||||||
UINT_8 aucRandomMac[MAC_ADDR_LEN];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Beacon RM related parameters */
|
|
||||||
struct BCN_RM_PARAMS {
|
|
||||||
BOOLEAN fgExistBcnReq;
|
|
||||||
enum BCN_RM_STATE eState;
|
|
||||||
struct NORMAL_SCAN_PARAMS rNormalScan;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct RADIO_MEASUREMENT_REQ_PARAMS {
|
|
||||||
/* Remain Request Elements Length, started at prMeasElem. if it is 0, means RM is done */
|
|
||||||
UINT_16 u2RemainReqLen;
|
|
||||||
UINT_16 u2ReqIeBufLen;
|
|
||||||
P_IE_MEASUREMENT_REQ_T prCurrMeasElem;
|
|
||||||
OS_SYSTIME rStartTime;
|
|
||||||
UINT_16 u2Repetitions;
|
|
||||||
PUINT_8 pucReqIeBuf;
|
|
||||||
enum RM_REQ_PRIORITY ePriority;
|
|
||||||
BOOLEAN fgRmIsOngoing;
|
|
||||||
BOOLEAN fgInitialLoop;
|
|
||||||
|
|
||||||
struct BCN_RM_PARAMS rBcnRmParam;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct RADIO_MEASUREMENT_REPORT_PARAMS {
|
|
||||||
UINT_16 u2ReportFrameLen; /* the total length of Measurement Report elements */
|
|
||||||
PUINT_8 pucReportFrameBuff;
|
|
||||||
/* Variables to collect report */
|
|
||||||
LINK_T rReportLink; /* a link to save received report entry */
|
|
||||||
LINK_T rFreeReportLink;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef enum _ENUM_NET_ACTIVE_SRC_T {
|
|
||||||
NET_ACTIVE_SRC_NONE = 0,
|
|
||||||
NET_ACTIVE_SRC_CONNECT = 1,
|
|
||||||
NET_ACTIVE_SRC_SCAN = 2,
|
|
||||||
NET_ACTIVE_SRC_SCHED_SCAN = 4,
|
|
||||||
NET_ACTIVE_SRC_NUM
|
|
||||||
} ENUM_NET_ACTIVE_SRC_T, *P_ENUM_NET_ACTIVE_SRC_T;
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define RM_EXIST_REPORT(_prRmReportParam) \
|
|
||||||
(((struct RADIO_MEASUREMENT_REPORT_PARAMS *)_prRmReportParam)->u2ReportFrameLen == \
|
|
||||||
OFFSET_OF(ACTION_RM_REPORT_FRAME, aucInfoElem))
|
|
||||||
|
|
||||||
/* It is used for RLM module to judge if specific network is valid
|
|
||||||
* Note: Ad-hoc mode of AIS is not included now. (TBD)
|
|
||||||
*/
|
|
||||||
#define RLM_NET_PARAM_VALID(_prBssInfo) \
|
|
||||||
(IS_BSS_ACTIVE(_prBssInfo) && \
|
|
||||||
((_prBssInfo)->eConnectionState == PARAM_MEDIA_STATE_CONNECTED || \
|
|
||||||
(_prBssInfo)->eCurrentOPMode == OP_MODE_ACCESS_POINT || \
|
|
||||||
(_prBssInfo)->eCurrentOPMode == OP_MODE_IBSS || \
|
|
||||||
RLM_NET_IS_BOW(_prBssInfo)) \
|
|
||||||
)
|
|
||||||
|
|
||||||
#define RLM_NET_IS_11N(_prBssInfo) \
|
|
||||||
((_prBssInfo)->ucPhyTypeSet & PHY_TYPE_SET_802_11N)
|
|
||||||
#define RLM_NET_IS_11GN(_prBssInfo) \
|
|
||||||
((_prBssInfo)->ucPhyTypeSet & PHY_TYPE_SET_802_11GN)
|
|
||||||
|
|
||||||
/* This macro is used to sweep all 3 networks */
|
|
||||||
#define RLM_NET_FOR_EACH(_ucNetIdx) \
|
|
||||||
for ((_ucNetIdx) = 0; \
|
|
||||||
(_ucNetIdx) < NETWORK_TYPE_INDEX_NUM; \
|
|
||||||
(_ucNetIdx)++)
|
|
||||||
|
|
||||||
/* This macro is used to sweep all networks excluding BOW */
|
|
||||||
#if CFG_ENABLE_BT_OVER_WIFI
|
|
||||||
/* Note: value of enum NETWORK_TYPE_BOW_INDEX is validated in
|
|
||||||
* rlmStuctureCheck().
|
|
||||||
*/
|
|
||||||
#define RLM_NET_FOR_EACH_NO_BOW(_ucNetIdx) \
|
|
||||||
for ((_ucNetIdx) = 0; \
|
|
||||||
(_ucNetIdx) < NETWORK_TYPE_BOW_INDEX; \
|
|
||||||
(_ucNetIdx)++)
|
|
||||||
|
|
||||||
#define RLM_NET_IS_BOW(_prBssInfo) \
|
|
||||||
((_prBssInfo)->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX)
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define RLM_NET_FOR_EACH_NO_BOW(_ucNetIdx) RLM_NET_FOR_EACH(_ucNetIdx)
|
|
||||||
#define RLM_NET_IS_BOW(_prBssInfo) (FALSE)
|
|
||||||
|
|
||||||
#endif /* end of CFG_ENABLE_BT_OVER_WIFI */
|
|
||||||
|
|
||||||
/* The bandwidth modes are not used anymore. They represent if AP
|
|
||||||
* can use 20/40 bandwidth, not all modes. (20110411)
|
|
||||||
*/
|
|
||||||
#define RLM_AP_IS_BW_40_ALLOWED(_prAdapter, _prBssInfo) \
|
|
||||||
(((_prBssInfo)->eBand == BAND_2G4 && \
|
|
||||||
(_prAdapter)->rWifiVar.rConnSettings.uc2G4BandwidthMode \
|
|
||||||
== CONFIG_BW_20_40M) || \
|
|
||||||
((_prBssInfo)->eBand == BAND_5G && \
|
|
||||||
(_prAdapter)->rWifiVar.rConnSettings.uc5GBandwidthMode \
|
|
||||||
== CONFIG_BW_20_40M))
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID rlmFsmEventInit(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID rlmFsmEventUninit(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID rlmReqGenerateHtCapIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rlmReqGenerateExtCapIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rlmRspGenerateHtCapIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rlmRspGenerateExtCapIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rlmRspGenerateHtOpIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rlmRspGenerateErpIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
VOID rlmGenerateMTKOuiIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rlmProcessBcn(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb, PUINT_8 pucIE, UINT_16 u2IELength);
|
|
||||||
|
|
||||||
VOID rlmProcessAssocRsp(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb, PUINT_8 pucIE, UINT_16 u2IELength);
|
|
||||||
|
|
||||||
VOID rlmFillSyncCmdParam(P_CMD_SET_BSS_RLM_PARAM_T prCmdBody, P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
VOID rlmSyncOperationParams(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
VOID rlmBssInitForAPandIbss(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
VOID rlmProcessAssocReq(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb, PUINT_8 pucIE, UINT_16 u2IELength);
|
|
||||||
|
|
||||||
VOID rlmBssAborted(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
UINT32
|
|
||||||
rlmFillHtCapIEByParams(BOOLEAN fg40mAllowed,
|
|
||||||
BOOLEAN fgShortGIDisabled,
|
|
||||||
UINT_8 u8SupportRxSgi20,
|
|
||||||
UINT_8 u8SupportRxSgi40,
|
|
||||||
UINT_8 u8SupportRxGf, UINT_8 u8SupportRxSTBC, ENUM_OP_MODE_T eCurrentOPMode, UINT_8 *pOutBuf);
|
|
||||||
|
|
||||||
UINT32 rlmFillHtOpIeBody(P_BSS_INFO_T prBssInfo, UINT_8 *pFme);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_DFS /* Add by Enlai */
|
|
||||||
VOID rlmProcessSpecMgtAction(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID rlmProcessChannelSwitchIE(P_ADAPTER_T prAdapter, P_IE_CHANNEL_SWITCH_T prChannelSwitchIE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VOID
|
|
||||||
rlmTxRateEnhanceConfig(
|
|
||||||
P_ADAPTER_T prAdapter
|
|
||||||
);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
rlmCmd(
|
|
||||||
P_GLUE_INFO_T prGlueInfo,
|
|
||||||
UINT_8 *prInBuf,
|
|
||||||
UINT_32 u4InBufLen
|
|
||||||
);
|
|
||||||
VOID rlmProcessNeighborReportResonse(
|
|
||||||
P_ADAPTER_T prAdapter, P_WLAN_ACTION_FRAME prAction, UINT_16 u2PacketLen);
|
|
||||||
VOID rlmTxNeighborReportRequest(P_ADAPTER_T prAdapter, P_STA_RECORD_T prStaRec,
|
|
||||||
struct SUB_ELEMENT_LIST *prSubIEs);
|
|
||||||
|
|
||||||
VOID rlmGernerateRRMEnabledCapIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rlmGerneratePowerCapIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rlmProcessRadioMeasurementRequest(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID rlmProcessLinkMeasurementRequest(P_ADAPTER_T prAdapter, P_WLAN_ACTION_FRAME prAction);
|
|
||||||
|
|
||||||
VOID rlmProcessNeighborReportResonse(P_ADAPTER_T prAdapter, P_WLAN_ACTION_FRAME prAction, UINT_16 u2PacketLen);
|
|
||||||
|
|
||||||
VOID rlmFillRrmCapa(PUINT_8 pucCapa);
|
|
||||||
|
|
||||||
VOID rlmSetMaxTxPwrLimit(IN P_ADAPTER_T prAdapter, INT_8 cLimit, UINT_8 ucEnable);
|
|
||||||
|
|
||||||
VOID rlmStartNextMeasurement(P_ADAPTER_T prAdapter, BOOLEAN fgNewStarted);
|
|
||||||
|
|
||||||
BOOLEAN rlmBcnRmRunning(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN rlmFillScanMsg(P_ADAPTER_T prAdapter, P_MSG_SCN_SCAN_REQ prMsg);
|
|
||||||
|
|
||||||
VOID rlmDoBeaconMeasurement(P_ADAPTER_T prAdapter, ULONG ulParam);
|
|
||||||
|
|
||||||
VOID rlmTxNeighborReportRequest(P_ADAPTER_T prAdapter, P_STA_RECORD_T prStaRec, struct SUB_ELEMENT_LIST *prSubIEs);
|
|
||||||
|
|
||||||
VOID rlmTxRadioMeasurementReport(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID rlmCancelRadioMeasurement(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
enum RM_REQ_PRIORITY rlmGetRmRequestPriority(PUINT_8 pucDestAddr);
|
|
||||||
|
|
||||||
VOID rlmRunEventProcessNextRm(P_ADAPTER_T prAdapter, P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID rlmScheduleNextRm(P_ADAPTER_T prAdapter);
|
|
||||||
#if CFG_SUPPORT_P2P_ECSA
|
|
||||||
void rlmGenActionCSHdr(u8 *buf,
|
|
||||||
u8 *da, u8 *sa, u8 *bssid,
|
|
||||||
u8 category, u8 action);
|
|
||||||
|
|
||||||
void rlmGenActionCSA(u8 *buf,
|
|
||||||
u8 mode,
|
|
||||||
u8 channel,
|
|
||||||
u8 count,
|
|
||||||
u8 sco);
|
|
||||||
|
|
||||||
void rlmGenActionECSA(u8 *buf,
|
|
||||||
u8 mode,
|
|
||||||
u8 channel,
|
|
||||||
u8 count,
|
|
||||||
u8 op_class);
|
|
||||||
VOID rlmGenerateCSAIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
VOID rlmGenerateECSAIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
VOID rlmFreqToChannelExt(unsigned int freq,
|
|
||||||
int sec_channel,
|
|
||||||
u8 *op_class, u8 *channel);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_RLM_ACT_NETWORK
|
|
||||||
VOID rlmActivateNetwork(P_ADAPTER_T prAdapter, ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx,
|
|
||||||
ENUM_NET_ACTIVE_SRC_T eNetActiveSrcIdx);
|
|
||||||
|
|
||||||
VOID rlmDeactivateNetwork(P_ADAPTER_T prAdapter, ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx,
|
|
||||||
ENUM_NET_ACTIVE_SRC_T eNetActiveSrcIdx);
|
|
||||||
#endif
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _lint
|
|
||||||
static inline VOID rlmDataTypeCheck(VOID)
|
|
||||||
{
|
|
||||||
#if CFG_ENABLE_BT_OVER_WIFI
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(NETWORK_TYPE_AIS_INDEX < NETWORK_TYPE_BOW_INDEX);
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(NETWORK_TYPE_P2P_INDEX < NETWORK_TYPE_BOW_INDEX);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif /* _lint */
|
|
||||||
|
|
||||||
#endif /* _RLM_H */
|
|
|
@ -1,544 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _RLM_DOMAIN_H
|
|
||||||
#define _RLM_DOMAIN_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define MAX_SUBBAND_NUM 6
|
|
||||||
#define MAX_SUBBAND_NUM_5G 8
|
|
||||||
|
|
||||||
#define COUNTRY_CODE_NULL ((UINT_16)0x0)
|
|
||||||
|
|
||||||
/* ISO/IEC 3166-1 two-character country codes */
|
|
||||||
|
|
||||||
#define COUNTRY_CODE_AD (((UINT_16) 'A' << 8) | (UINT_16) 'D') /* Andorra */
|
|
||||||
#define COUNTRY_CODE_AE (((UINT_16) 'A' << 8) | (UINT_16) 'E') /* UAE */
|
|
||||||
#define COUNTRY_CODE_AF (((UINT_16) 'A' << 8) | (UINT_16) 'F') /* Afghanistan */
|
|
||||||
#define COUNTRY_CODE_AG (((UINT_16) 'A' << 8) | (UINT_16) 'G') /* Antigua & Barbuda */
|
|
||||||
#define COUNTRY_CODE_AI (((UINT_16) 'A' << 8) | (UINT_16) 'I') /* Anguilla */
|
|
||||||
#define COUNTRY_CODE_AL (((UINT_16) 'A' << 8) | (UINT_16) 'L') /* Albania */
|
|
||||||
#define COUNTRY_CODE_AM (((UINT_16) 'A' << 8) | (UINT_16) 'M') /* Armenia */
|
|
||||||
#define COUNTRY_CODE_AN (((UINT_16) 'A' << 8) | (UINT_16) 'N') /* Netherlands Antilles */
|
|
||||||
#define COUNTRY_CODE_AO (((UINT_16) 'A' << 8) | (UINT_16) 'O') /* Angola */
|
|
||||||
#define COUNTRY_CODE_AQ (((UINT_16) 'A' << 8) | (UINT_16) 'Q') /* South Pole */
|
|
||||||
#define COUNTRY_CODE_AR (((UINT_16) 'A' << 8) | (UINT_16) 'R') /* Argentina */
|
|
||||||
#define COUNTRY_CODE_AS (((UINT_16) 'A' << 8) | (UINT_16) 'S') /* American Samoa (USA) */
|
|
||||||
#define COUNTRY_CODE_AT (((UINT_16) 'A' << 8) | (UINT_16) 'T') /* Austria */
|
|
||||||
#define COUNTRY_CODE_AU (((UINT_16) 'A' << 8) | (UINT_16) 'U') /* Australia */
|
|
||||||
#define COUNTRY_CODE_AW (((UINT_16) 'A' << 8) | (UINT_16) 'W') /* Aruba */
|
|
||||||
#define COUNTRY_CODE_AX (((UINT_16) 'A' << 8) | (UINT_16) 'X') /* Aland Islands */
|
|
||||||
#define COUNTRY_CODE_AZ (((UINT_16) 'A' << 8) | (UINT_16) 'Z') /* Azerbaijan */
|
|
||||||
#define COUNTRY_CODE_BA (((UINT_16) 'B' << 8) | (UINT_16) 'A') /* Bosnia and Herzegovina */
|
|
||||||
#define COUNTRY_CODE_BB (((UINT_16) 'B' << 8) | (UINT_16) 'B') /* Barbados */
|
|
||||||
#define COUNTRY_CODE_BD (((UINT_16) 'B' << 8) | (UINT_16) 'D') /* Bangladesh */
|
|
||||||
#define COUNTRY_CODE_BE (((UINT_16) 'B' << 8) | (UINT_16) 'E') /* Belgium */
|
|
||||||
#define COUNTRY_CODE_BF (((UINT_16) 'B' << 8) | (UINT_16) 'F') /* Burkina Faso */
|
|
||||||
#define COUNTRY_CODE_BG (((UINT_16) 'B' << 8) | (UINT_16) 'G') /* Bulgaria */
|
|
||||||
#define COUNTRY_CODE_BH (((UINT_16) 'B' << 8) | (UINT_16) 'H') /* Bahrain */
|
|
||||||
#define COUNTRY_CODE_BI (((UINT_16) 'B' << 8) | (UINT_16) 'I') /* Burundi */
|
|
||||||
#define COUNTRY_CODE_BJ (((UINT_16) 'B' << 8) | (UINT_16) 'J') /* Benin */
|
|
||||||
#define COUNTRY_CODE_BM (((UINT_16) 'B' << 8) | (UINT_16) 'M') /* Bermuda */
|
|
||||||
#define COUNTRY_CODE_BN (((UINT_16) 'B' << 8) | (UINT_16) 'N') /* Brunei */
|
|
||||||
#define COUNTRY_CODE_BO (((UINT_16) 'B' << 8) | (UINT_16) 'O') /* Bolivia */
|
|
||||||
#define COUNTRY_CODE_BR (((UINT_16) 'B' << 8) | (UINT_16) 'R') /* Brazil */
|
|
||||||
#define COUNTRY_CODE_BS (((UINT_16) 'B' << 8) | (UINT_16) 'S') /* Bahamas */
|
|
||||||
#define COUNTRY_CODE_BT (((UINT_16) 'B' << 8) | (UINT_16) 'T') /* Bhutan */
|
|
||||||
#define COUNTRY_CODE_BV (((UINT_16) 'B' << 8) | (UINT_16) 'V') /* Bouvet Island */
|
|
||||||
#define COUNTRY_CODE_BW (((UINT_16) 'B' << 8) | (UINT_16) 'W') /* Botswana */
|
|
||||||
#define COUNTRY_CODE_BY (((UINT_16) 'B' << 8) | (UINT_16) 'Y') /* Belarus */
|
|
||||||
#define COUNTRY_CODE_BZ (((UINT_16) 'B' << 8) | (UINT_16) 'Z') /* Belize */
|
|
||||||
#define COUNTRY_CODE_CA (((UINT_16) 'C' << 8) | (UINT_16) 'A') /* Canada */
|
|
||||||
#define COUNTRY_CODE_CC (((UINT_16) 'C' << 8) | (UINT_16) 'C') /* Cocos Islands */
|
|
||||||
#define COUNTRY_CODE_CD (((UINT_16) 'C' << 8) | (UINT_16) 'D') /* Congo. Democratic Republic of the */
|
|
||||||
#define COUNTRY_CODE_CF (((UINT_16) 'C' << 8) | (UINT_16) 'F') /* Central African Republic */
|
|
||||||
#define COUNTRY_CODE_CG (((UINT_16) 'C' << 8) | (UINT_16) 'G') /* Congo. Republic of the */
|
|
||||||
#define COUNTRY_CODE_CH (((UINT_16) 'C' << 8) | (UINT_16) 'H') /* Switzerland */
|
|
||||||
#define COUNTRY_CODE_CI (((UINT_16) 'C' << 8) | (UINT_16) 'I') /* Cote d'lvoire */
|
|
||||||
#define COUNTRY_CODE_CK (((UINT_16) 'C' << 8) | (UINT_16) 'K') /* Cook Island */
|
|
||||||
#define COUNTRY_CODE_CL (((UINT_16) 'C' << 8) | (UINT_16) 'L') /* Chile */
|
|
||||||
#define COUNTRY_CODE_CM (((UINT_16) 'C' << 8) | (UINT_16) 'M') /* Cameroon */
|
|
||||||
#define COUNTRY_CODE_CN (((UINT_16) 'C' << 8) | (UINT_16) 'N') /* China */
|
|
||||||
#define COUNTRY_CODE_CO (((UINT_16) 'C' << 8) | (UINT_16) 'O') /* Columbia */
|
|
||||||
#define COUNTRY_CODE_CR (((UINT_16) 'C' << 8) | (UINT_16) 'R') /* Costa Rica */
|
|
||||||
#define COUNTRY_CODE_CU (((UINT_16) 'C' << 8) | (UINT_16) 'U') /* Cuba */
|
|
||||||
#define COUNTRY_CODE_CV (((UINT_16) 'C' << 8) | (UINT_16) 'V') /* Cape Verde */
|
|
||||||
#define COUNTRY_CODE_CX (((UINT_16) 'C' << 8) | (UINT_16) 'X') /* "Christmas Island(Australia) */
|
|
||||||
#define COUNTRY_CODE_CY (((UINT_16) 'C' << 8) | (UINT_16) 'Y') /* Cyprus */
|
|
||||||
#define COUNTRY_CODE_CZ (((UINT_16) 'C' << 8) | (UINT_16) 'Z') /* Czech */
|
|
||||||
#define COUNTRY_CODE_DE (((UINT_16) 'D' << 8) | (UINT_16) 'E') /* Germany */
|
|
||||||
#define COUNTRY_CODE_DJ (((UINT_16) 'D' << 8) | (UINT_16) 'J') /* Djibouti */
|
|
||||||
#define COUNTRY_CODE_DK (((UINT_16) 'D' << 8) | (UINT_16) 'K') /* Denmark */
|
|
||||||
#define COUNTRY_CODE_DM (((UINT_16) 'D' << 8) | (UINT_16) 'M') /* Dominica */
|
|
||||||
#define COUNTRY_CODE_DO (((UINT_16) 'D' << 8) | (UINT_16) 'O') /* Dominican Republic */
|
|
||||||
#define COUNTRY_CODE_DZ (((UINT_16) 'D' << 8) | (UINT_16) 'Z') /* Algeria */
|
|
||||||
#define COUNTRY_CODE_EC (((UINT_16) 'E' << 8) | (UINT_16) 'C') /* Ecuador */
|
|
||||||
#define COUNTRY_CODE_EE (((UINT_16) 'E' << 8) | (UINT_16) 'E') /* Estonia */
|
|
||||||
#define COUNTRY_CODE_EG (((UINT_16) 'E' << 8) | (UINT_16) 'G') /* Egypt */
|
|
||||||
#define COUNTRY_CODE_EH (((UINT_16) 'E' << 8) | (UINT_16) 'H') /* Western Sahara (Morocco) */
|
|
||||||
#define COUNTRY_CODE_ER (((UINT_16) 'E' << 8) | (UINT_16) 'R') /* Eritrea */
|
|
||||||
#define COUNTRY_CODE_ES (((UINT_16) 'E' << 8) | (UINT_16) 'S') /* Spain */
|
|
||||||
#define COUNTRY_CODE_ET (((UINT_16) 'E' << 8) | (UINT_16) 'T') /* Ethiopia */
|
|
||||||
#define COUNTRY_CODE_EU (((UINT_16) 'E' << 8) | (UINT_16) 'U') /* Europe */
|
|
||||||
#define COUNTRY_CODE_FI (((UINT_16) 'F' << 8) | (UINT_16) 'I') /* Finland */
|
|
||||||
#define COUNTRY_CODE_FJ (((UINT_16) 'F' << 8) | (UINT_16) 'J') /* Fiji */
|
|
||||||
#define COUNTRY_CODE_FK (((UINT_16) 'F' << 8) | (UINT_16) 'K') /* Falkland Island */
|
|
||||||
#define COUNTRY_CODE_FM (((UINT_16) 'F' << 8) | (UINT_16) 'M') /* Micronesia */
|
|
||||||
#define COUNTRY_CODE_FO (((UINT_16) 'F' << 8) | (UINT_16) 'O') /* Faroe Island */
|
|
||||||
#define COUNTRY_CODE_FR (((UINT_16) 'F' << 8) | (UINT_16) 'R') /* France */
|
|
||||||
#define COUNTRY_CODE_FR (((UINT_16) 'F' << 8) | (UINT_16) 'R') /* Wallis and Futuna (France) */
|
|
||||||
#define COUNTRY_CODE_GA (((UINT_16) 'G' << 8) | (UINT_16) 'A') /* Gabon */
|
|
||||||
#define COUNTRY_CODE_GB (((UINT_16) 'G' << 8) | (UINT_16) 'B') /* United Kingdom */
|
|
||||||
#define COUNTRY_CODE_GD (((UINT_16) 'G' << 8) | (UINT_16) 'D') /* Grenada */
|
|
||||||
#define COUNTRY_CODE_GE (((UINT_16) 'G' << 8) | (UINT_16) 'E') /* Georgia */
|
|
||||||
#define COUNTRY_CODE_GF (((UINT_16) 'G' << 8) | (UINT_16) 'F') /* French Guiana */
|
|
||||||
#define COUNTRY_CODE_GG (((UINT_16) 'G' << 8) | (UINT_16) 'G') /* Guernsey */
|
|
||||||
#define COUNTRY_CODE_GH (((UINT_16) 'G' << 8) | (UINT_16) 'H') /* Ghana */
|
|
||||||
#define COUNTRY_CODE_GI (((UINT_16) 'G' << 8) | (UINT_16) 'I') /* Gibraltar */
|
|
||||||
#define COUNTRY_CODE_GL (((UINT_16) 'G' << 8) | (UINT_16) 'L') /* Greenland */
|
|
||||||
#define COUNTRY_CODE_GM (((UINT_16) 'G' << 8) | (UINT_16) 'M') /* Gambia */
|
|
||||||
#define COUNTRY_CODE_GN (((UINT_16) 'G' << 8) | (UINT_16) 'N') /* Guinea */
|
|
||||||
#define COUNTRY_CODE_GP (((UINT_16) 'G' << 8) | (UINT_16) 'P') /* Guadeloupe */
|
|
||||||
#define COUNTRY_CODE_GQ (((UINT_16) 'G' << 8) | (UINT_16) 'Q') /* Equatorial Guinea */
|
|
||||||
#define COUNTRY_CODE_GR (((UINT_16) 'G' << 8) | (UINT_16) 'R') /* Greece */
|
|
||||||
#define COUNTRY_CODE_GS (((UINT_16) 'G' << 8) | (UINT_16) 'S') /* South Georgia and the South Sandwich Islands */
|
|
||||||
#define COUNTRY_CODE_GT (((UINT_16) 'G' << 8) | (UINT_16) 'T') /* Guatemala */
|
|
||||||
#define COUNTRY_CODE_GU (((UINT_16) 'G' << 8) | (UINT_16) 'U') /* Guam */
|
|
||||||
#define COUNTRY_CODE_GW (((UINT_16) 'G' << 8) | (UINT_16) 'W') /* Guinea-Bissau */
|
|
||||||
#define COUNTRY_CODE_GY (((UINT_16) 'G' << 8) | (UINT_16) 'Y') /* Guyana */
|
|
||||||
#define COUNTRY_CODE_HK (((UINT_16) 'H' << 8) | (UINT_16) 'K') /* Hong Kong */
|
|
||||||
#define COUNTRY_CODE_HM (((UINT_16) 'H' << 8) | (UINT_16) 'M') /* Heard and McDonald Islands */
|
|
||||||
#define COUNTRY_CODE_HN (((UINT_16) 'H' << 8) | (UINT_16) 'N') /* Honduras */
|
|
||||||
#define COUNTRY_CODE_HR (((UINT_16) 'H' << 8) | (UINT_16) 'R') /* Croatia */
|
|
||||||
#define COUNTRY_CODE_HT (((UINT_16) 'H' << 8) | (UINT_16) 'T') /* Haiti */
|
|
||||||
#define COUNTRY_CODE_HU (((UINT_16) 'H' << 8) | (UINT_16) 'U') /* Hungary */
|
|
||||||
#define COUNTRY_CODE_ID (((UINT_16) 'I' << 8) | (UINT_16) 'D') /* Indonesia */
|
|
||||||
#define COUNTRY_CODE_IE (((UINT_16) 'I' << 8) | (UINT_16) 'E') /* Ireland */
|
|
||||||
#define COUNTRY_CODE_IL (((UINT_16) 'I' << 8) | (UINT_16) 'L') /* Israel */
|
|
||||||
#define COUNTRY_CODE_IM (((UINT_16) 'I' << 8) | (UINT_16) 'M') /* Isle of Man */
|
|
||||||
#define COUNTRY_CODE_IN (((UINT_16) 'I' << 8) | (UINT_16) 'N') /* India */
|
|
||||||
#define COUNTRY_CODE_IO (((UINT_16) 'I' << 8) | (UINT_16) 'O') /* British Indian Ocean Territory */
|
|
||||||
#define COUNTRY_CODE_IQ (((UINT_16) 'I' << 8) | (UINT_16) 'Q') /* Iraq */
|
|
||||||
#define COUNTRY_CODE_IR (((UINT_16) 'I' << 8) | (UINT_16) 'R') /* Iran */
|
|
||||||
#define COUNTRY_CODE_IS (((UINT_16) 'I' << 8) | (UINT_16) 'S') /* Iceland */
|
|
||||||
#define COUNTRY_CODE_IT (((UINT_16) 'I' << 8) | (UINT_16) 'T') /* Italy */
|
|
||||||
#define COUNTRY_CODE_JE (((UINT_16) 'J' << 8) | (UINT_16) 'E') /* Jersey */
|
|
||||||
#define COUNTRY_CODE_JM (((UINT_16) 'J' << 8) | (UINT_16) 'M') /* Jameica */
|
|
||||||
#define COUNTRY_CODE_JO (((UINT_16) 'J' << 8) | (UINT_16) 'O') /* Jordan */
|
|
||||||
#define COUNTRY_CODE_JP (((UINT_16) 'J' << 8) | (UINT_16) 'P') /* Japan */
|
|
||||||
#define COUNTRY_CODE_KE (((UINT_16) 'K' << 8) | (UINT_16) 'E') /* Kenya */
|
|
||||||
#define COUNTRY_CODE_KG (((UINT_16) 'K' << 8) | (UINT_16) 'G') /* Kyrgyzstan */
|
|
||||||
#define COUNTRY_CODE_KH (((UINT_16) 'K' << 8) | (UINT_16) 'H') /* Cambodia */
|
|
||||||
#define COUNTRY_CODE_KI (((UINT_16) 'K' << 8) | (UINT_16) 'I') /* Kiribati */
|
|
||||||
#define COUNTRY_CODE_KM (((UINT_16) 'K' << 8) | (UINT_16) 'M') /* Comoros */
|
|
||||||
#define COUNTRY_CODE_KN (((UINT_16) 'K' << 8) | (UINT_16) 'N') /* Saint Kitts and Nevis */
|
|
||||||
#define COUNTRY_CODE_KP (((UINT_16) 'K' << 8) | (UINT_16) 'P') /* North Korea */
|
|
||||||
#define COUNTRY_CODE_KR (((UINT_16) 'K' << 8) | (UINT_16) 'R') /* South Korea */
|
|
||||||
#define COUNTRY_CODE_KW (((UINT_16) 'K' << 8) | (UINT_16) 'W') /* Kuwait */
|
|
||||||
#define COUNTRY_CODE_KY (((UINT_16) 'K' << 8) | (UINT_16) 'Y') /* Cayman Islands */
|
|
||||||
#define COUNTRY_CODE_KZ (((UINT_16) 'K' << 8) | (UINT_16) 'Z') /* Kazakhstan */
|
|
||||||
#define COUNTRY_CODE_LA (((UINT_16) 'L' << 8) | (UINT_16) 'A') /* Laos */
|
|
||||||
#define COUNTRY_CODE_LB (((UINT_16) 'L' << 8) | (UINT_16) 'B') /* Lebanon */
|
|
||||||
#define COUNTRY_CODE_LC (((UINT_16) 'L' << 8) | (UINT_16) 'C') /* Saint Lucia */
|
|
||||||
#define COUNTRY_CODE_LI (((UINT_16) 'L' << 8) | (UINT_16) 'I') /* Liechtenstein */
|
|
||||||
#define COUNTRY_CODE_LK (((UINT_16) 'L' << 8) | (UINT_16) 'K') /* Sri Lanka */
|
|
||||||
#define COUNTRY_CODE_LR (((UINT_16) 'L' << 8) | (UINT_16) 'R') /* Liberia */
|
|
||||||
#define COUNTRY_CODE_LS (((UINT_16) 'L' << 8) | (UINT_16) 'S') /* Lesotho */
|
|
||||||
#define COUNTRY_CODE_LT (((UINT_16) 'L' << 8) | (UINT_16) 'T') /* Lithuania */
|
|
||||||
#define COUNTRY_CODE_LU (((UINT_16) 'L' << 8) | (UINT_16) 'U') /* Luxemburg */
|
|
||||||
#define COUNTRY_CODE_LV (((UINT_16) 'L' << 8) | (UINT_16) 'V') /* Latvia */
|
|
||||||
#define COUNTRY_CODE_LY (((UINT_16) 'L' << 8) | (UINT_16) 'Y') /* Libya */
|
|
||||||
#define COUNTRY_CODE_MA (((UINT_16) 'M' << 8) | (UINT_16) 'A') /* Morocco */
|
|
||||||
#define COUNTRY_CODE_MC (((UINT_16) 'M' << 8) | (UINT_16) 'C') /* Monaco */
|
|
||||||
#define COUNTRY_CODE_MD (((UINT_16) 'M' << 8) | (UINT_16) 'D') /* Moldova */
|
|
||||||
#define COUNTRY_CODE_ME (((UINT_16) 'M' << 8) | (UINT_16) 'E') /* Montenegro */
|
|
||||||
#define COUNTRY_CODE_MF (((UINT_16) 'M' << 8) | (UINT_16) 'F') /*
|
|
||||||
* Saint Martin / Sint Marteen
|
|
||||||
* (Added on window's list)
|
|
||||||
*/
|
|
||||||
#define COUNTRY_CODE_MG (((UINT_16) 'M' << 8) | (UINT_16) 'G') /* Madagascar */
|
|
||||||
#define COUNTRY_CODE_MH (((UINT_16) 'M' << 8) | (UINT_16) 'H') /* Marshall Islands */
|
|
||||||
#define COUNTRY_CODE_MK (((UINT_16) 'M' << 8) | (UINT_16) 'K') /* Macedonia */
|
|
||||||
#define COUNTRY_CODE_ML (((UINT_16) 'M' << 8) | (UINT_16) 'L') /* Mali */
|
|
||||||
#define COUNTRY_CODE_MM (((UINT_16) 'M' << 8) | (UINT_16) 'M') /* Myanmar */
|
|
||||||
#define COUNTRY_CODE_MN (((UINT_16) 'M' << 8) | (UINT_16) 'N') /* Mongolia */
|
|
||||||
#define COUNTRY_CODE_MO (((UINT_16) 'M' << 8) | (UINT_16) 'O') /* Macao */
|
|
||||||
#define COUNTRY_CODE_MP (((UINT_16) 'M' << 8) | (UINT_16) 'P') /*
|
|
||||||
* Northern Mariana Islands (Rota Island.
|
|
||||||
* Saipan and Tinian Island)
|
|
||||||
*/
|
|
||||||
#define COUNTRY_CODE_MQ (((UINT_16) 'M' << 8) | (UINT_16) 'Q') /* Martinique (France) */
|
|
||||||
#define COUNTRY_CODE_MR (((UINT_16) 'M' << 8) | (UINT_16) 'R') /* Mauritania */
|
|
||||||
#define COUNTRY_CODE_MS (((UINT_16) 'M' << 8) | (UINT_16) 'S') /* Montserrat (UK) */
|
|
||||||
#define COUNTRY_CODE_MT (((UINT_16) 'M' << 8) | (UINT_16) 'T') /* Malta */
|
|
||||||
#define COUNTRY_CODE_MU (((UINT_16) 'M' << 8) | (UINT_16) 'U') /* Mauritius */
|
|
||||||
#define COUNTRY_CODE_MV (((UINT_16) 'M' << 8) | (UINT_16) 'V') /* Maldives */
|
|
||||||
#define COUNTRY_CODE_MW (((UINT_16) 'M' << 8) | (UINT_16) 'W') /* Malawi */
|
|
||||||
#define COUNTRY_CODE_MX (((UINT_16) 'M' << 8) | (UINT_16) 'X') /* Mexico */
|
|
||||||
#define COUNTRY_CODE_MY (((UINT_16) 'M' << 8) | (UINT_16) 'Y') /* Malaysia */
|
|
||||||
#define COUNTRY_CODE_MZ (((UINT_16) 'M' << 8) | (UINT_16) 'Z') /* Mozambique */
|
|
||||||
#define COUNTRY_CODE_NA (((UINT_16) 'N' << 8) | (UINT_16) 'A') /* Namibia */
|
|
||||||
#define COUNTRY_CODE_NC (((UINT_16) 'N' << 8) | (UINT_16) 'C') /* New Caledonia */
|
|
||||||
#define COUNTRY_CODE_NE (((UINT_16) 'N' << 8) | (UINT_16) 'E') /* Niger */
|
|
||||||
#define COUNTRY_CODE_NF (((UINT_16) 'N' << 8) | (UINT_16) 'F') /* Norfolk Island */
|
|
||||||
#define COUNTRY_CODE_NG (((UINT_16) 'N' << 8) | (UINT_16) 'G') /* Nigeria */
|
|
||||||
#define COUNTRY_CODE_NI (((UINT_16) 'N' << 8) | (UINT_16) 'I') /* Nicaragua */
|
|
||||||
#define COUNTRY_CODE_NL (((UINT_16) 'N' << 8) | (UINT_16) 'L') /* Netherlands */
|
|
||||||
#define COUNTRY_CODE_NO (((UINT_16) 'N' << 8) | (UINT_16) 'O') /* Norway */
|
|
||||||
#define COUNTRY_CODE_NP (((UINT_16) 'N' << 8) | (UINT_16) 'P') /* Nepal */
|
|
||||||
#define COUNTRY_CODE_NR (((UINT_16) 'N' << 8) | (UINT_16) 'R') /* Nauru */
|
|
||||||
#define COUNTRY_CODE_NU (((UINT_16) 'N' << 8) | (UINT_16) 'U') /* Niue */
|
|
||||||
#define COUNTRY_CODE_NZ (((UINT_16) 'N' << 8) | (UINT_16) 'Z') /* New Zealand */
|
|
||||||
#define COUNTRY_CODE_OM (((UINT_16) 'O' << 8) | (UINT_16) 'M') /* Oman */
|
|
||||||
#define COUNTRY_CODE_PA (((UINT_16) 'P' << 8) | (UINT_16) 'A') /* Panama */
|
|
||||||
#define COUNTRY_CODE_PE (((UINT_16) 'P' << 8) | (UINT_16) 'E') /* Peru */
|
|
||||||
#define COUNTRY_CODE_PF (((UINT_16) 'P' << 8) | (UINT_16) 'F') /* "French Polynesia */
|
|
||||||
#define COUNTRY_CODE_PG (((UINT_16) 'P' << 8) | (UINT_16) 'G') /* Papua New Guinea */
|
|
||||||
#define COUNTRY_CODE_PH (((UINT_16) 'P' << 8) | (UINT_16) 'H') /* Philippines */
|
|
||||||
#define COUNTRY_CODE_PK (((UINT_16) 'P' << 8) | (UINT_16) 'K') /* Pakistan */
|
|
||||||
#define COUNTRY_CODE_PL (((UINT_16) 'P' << 8) | (UINT_16) 'L') /* Poland */
|
|
||||||
#define COUNTRY_CODE_PM (((UINT_16) 'P' << 8) | (UINT_16) 'M') /* Saint Pierre and Miquelon */
|
|
||||||
#define COUNTRY_CODE_PN (((UINT_16) 'P' << 8) | (UINT_16) 'N') /* Pitcairn Islands */
|
|
||||||
#define COUNTRY_CODE_PR (((UINT_16) 'P' << 8) | (UINT_16) 'R') /* Puerto Rico (USA) */
|
|
||||||
#define COUNTRY_CODE_PS (((UINT_16) 'P' << 8) | (UINT_16) 'S') /* Palestinian Authority */
|
|
||||||
#define COUNTRY_CODE_PT (((UINT_16) 'P' << 8) | (UINT_16) 'T') /* Portugal */
|
|
||||||
#define COUNTRY_CODE_PW (((UINT_16) 'P' << 8) | (UINT_16) 'W') /* Palau */
|
|
||||||
#define COUNTRY_CODE_PY (((UINT_16) 'P' << 8) | (UINT_16) 'Y') /* Paraguay */
|
|
||||||
#define COUNTRY_CODE_QA (((UINT_16) 'Q' << 8) | (UINT_16) 'A') /* Qatar */
|
|
||||||
#define COUNTRY_CODE_RE (((UINT_16) 'R' << 8) | (UINT_16) 'E') /* Reunion (France) */
|
|
||||||
#define COUNTRY_CODE_RKS (((UINT_16) 'R' << 8) | (UINT_16) 'K') /* Kosvo (Added on window's list) */
|
|
||||||
#define COUNTRY_CODE_RO (((UINT_16) 'R' << 8) | (UINT_16) 'O') /* Romania */
|
|
||||||
#define COUNTRY_CODE_RS (((UINT_16) 'R' << 8) | (UINT_16) 'S') /* Serbia */
|
|
||||||
#define COUNTRY_CODE_RU (((UINT_16) 'R' << 8) | (UINT_16) 'U') /* Russia */
|
|
||||||
#define COUNTRY_CODE_RW (((UINT_16) 'R' << 8) | (UINT_16) 'W') /* Rwanda */
|
|
||||||
#define COUNTRY_CODE_SA (((UINT_16) 'S' << 8) | (UINT_16) 'A') /* Saudi Arabia */
|
|
||||||
#define COUNTRY_CODE_SB (((UINT_16) 'S' << 8) | (UINT_16) 'B') /* Solomon Islands */
|
|
||||||
#define COUNTRY_CODE_SC (((UINT_16) 'S' << 8) | (UINT_16) 'C') /* Seychelles */
|
|
||||||
#define COUNTRY_CODE_SD (((UINT_16) 'S' << 8) | (UINT_16) 'D') /* Sudan */
|
|
||||||
#define COUNTRY_CODE_SE (((UINT_16) 'S' << 8) | (UINT_16) 'E') /* Sweden */
|
|
||||||
#define COUNTRY_CODE_SG (((UINT_16) 'S' << 8) | (UINT_16) 'G') /* Singapole */
|
|
||||||
#define COUNTRY_CODE_SH (((UINT_16) 'S' << 8) | (UINT_16) 'H') /* Saint Helena */
|
|
||||||
#define COUNTRY_CODE_SI (((UINT_16) 'S' << 8) | (UINT_16) 'I') /* Slovenia */
|
|
||||||
#define COUNTRY_CODE_SJ (((UINT_16) 'S' << 8) | (UINT_16) 'J') /* Svalbard and Jan Mayen */
|
|
||||||
#define COUNTRY_CODE_SK (((UINT_16) 'S' << 8) | (UINT_16) 'K') /* Slovakia */
|
|
||||||
#define COUNTRY_CODE_SL (((UINT_16) 'S' << 8) | (UINT_16) 'L') /* Sierra Leone */
|
|
||||||
#define COUNTRY_CODE_SM (((UINT_16) 'S' << 8) | (UINT_16) 'M') /* San Marino */
|
|
||||||
#define COUNTRY_CODE_SN (((UINT_16) 'S' << 8) | (UINT_16) 'N') /* Senegal */
|
|
||||||
#define COUNTRY_CODE_SO (((UINT_16) 'S' << 8) | (UINT_16) 'O') /* Somalia */
|
|
||||||
#define COUNTRY_CODE_SR (((UINT_16) 'S' << 8) | (UINT_16) 'R') /* Suriname */
|
|
||||||
#define COUNTRY_CODE_SS (((UINT_16) 'S' << 8) | (UINT_16) 'S') /* South_Sudan */
|
|
||||||
#define COUNTRY_CODE_ST (((UINT_16) 'S' << 8) | (UINT_16) 'T') /* Sao Tome and Principe */
|
|
||||||
#define COUNTRY_CODE_SV (((UINT_16) 'S' << 8) | (UINT_16) 'V') /* El Salvador */
|
|
||||||
#define COUNTRY_CODE_SX (((UINT_16) 'S' << 8) | (UINT_16) 'X') /* Sint Maarten */
|
|
||||||
#define COUNTRY_CODE_SY (((UINT_16) 'S' << 8) | (UINT_16) 'Y') /* Syria */
|
|
||||||
#define COUNTRY_CODE_SZ (((UINT_16) 'S' << 8) | (UINT_16) 'Z') /* Swaziland */
|
|
||||||
#define COUNTRY_CODE_TC (((UINT_16) 'T' << 8) | (UINT_16) 'C') /* Turks and Caicos Islands (UK) */
|
|
||||||
#define COUNTRY_CODE_TD (((UINT_16) 'T' << 8) | (UINT_16) 'D') /* Chad */
|
|
||||||
#define COUNTRY_CODE_TF (((UINT_16) 'T' << 8) | (UINT_16) 'F') /* French Southern and Antarctic Lands */
|
|
||||||
#define COUNTRY_CODE_TG (((UINT_16) 'T' << 8) | (UINT_16) 'G') /* Togo */
|
|
||||||
#define COUNTRY_CODE_TH (((UINT_16) 'T' << 8) | (UINT_16) 'H') /* Thailand */
|
|
||||||
#define COUNTRY_CODE_TJ (((UINT_16) 'T' << 8) | (UINT_16) 'J') /* Tajikistan */
|
|
||||||
#define COUNTRY_CODE_TK (((UINT_16) 'T' << 8) | (UINT_16) 'K') /* Tokelau */
|
|
||||||
#define COUNTRY_CODE_TL (((UINT_16) 'T' << 8) | (UINT_16) 'L') /* East Timor */
|
|
||||||
#define COUNTRY_CODE_TM (((UINT_16) 'T' << 8) | (UINT_16) 'M') /* Turkmenistan */
|
|
||||||
#define COUNTRY_CODE_TN (((UINT_16) 'T' << 8) | (UINT_16) 'N') /* Tunisia */
|
|
||||||
#define COUNTRY_CODE_TO (((UINT_16) 'T' << 8) | (UINT_16) 'O') /* Tonga */
|
|
||||||
#define COUNTRY_CODE_TR (((UINT_16) 'T' << 8) | (UINT_16) 'R') /* Turkey */
|
|
||||||
#define COUNTRY_CODE_TT (((UINT_16) 'T' << 8) | (UINT_16) 'T') /* Trinidad and Tobago */
|
|
||||||
#define COUNTRY_CODE_TV (((UINT_16) 'T' << 8) | (UINT_16) 'V') /* Tuvalu */
|
|
||||||
#define COUNTRY_CODE_TW (((UINT_16) 'T' << 8) | (UINT_16) 'W') /* Taiwan */
|
|
||||||
#define COUNTRY_CODE_TZ (((UINT_16) 'T' << 8) | (UINT_16) 'Z') /* Tanzania */
|
|
||||||
#define COUNTRY_CODE_UA (((UINT_16) 'U' << 8) | (UINT_16) 'A') /* Ukraine */
|
|
||||||
#define COUNTRY_CODE_UG (((UINT_16) 'U' << 8) | (UINT_16) 'G') /* Ugnada */
|
|
||||||
#define COUNTRY_CODE_UM (((UINT_16) 'U' << 8) | (UINT_16) 'M') /* United States Minor Outlying Islands */
|
|
||||||
#define COUNTRY_CODE_US (((UINT_16) 'U' << 8) | (UINT_16) 'S') /* US */
|
|
||||||
#define COUNTRY_CODE_UY (((UINT_16) 'U' << 8) | (UINT_16) 'Y') /* Uruguay */
|
|
||||||
#define COUNTRY_CODE_UZ (((UINT_16) 'U' << 8) | (UINT_16) 'Z') /* Uzbekistan */
|
|
||||||
#define COUNTRY_CODE_VA (((UINT_16) 'V' << 8) | (UINT_16) 'A') /* Vatican (Holy See) */
|
|
||||||
#define COUNTRY_CODE_VC (((UINT_16) 'V' << 8) | (UINT_16) 'C') /* Saint Vincent and the Grenadines */
|
|
||||||
#define COUNTRY_CODE_VE (((UINT_16) 'V' << 8) | (UINT_16) 'E') /* Venezuela */
|
|
||||||
#define COUNTRY_CODE_VG (((UINT_16) 'V' << 8) | (UINT_16) 'G') /* British Virgin Islands */
|
|
||||||
#define COUNTRY_CODE_VI (((UINT_16) 'V' << 8) | (UINT_16) 'I') /* US Virgin Islands */
|
|
||||||
#define COUNTRY_CODE_VN (((UINT_16) 'V' << 8) | (UINT_16) 'N') /* Vietnam */
|
|
||||||
#define COUNTRY_CODE_VU (((UINT_16) 'V' << 8) | (UINT_16) 'U') /* Vanuatu */
|
|
||||||
#define COUNTRY_CODE_WF (((UINT_16) 'W' << 8) | (UINT_16) 'F') /* Walis and Futuna */
|
|
||||||
#define COUNTRY_CODE_WS (((UINT_16) 'W' << 8) | (UINT_16) 'S') /* Samoa */
|
|
||||||
#define COUNTRY_CODE_XK (((UINT_16) 'X' << 8) | (UINT_16) 'K') /* Republic of Kosovo */
|
|
||||||
#define COUNTRY_CODE_YE (((UINT_16) 'Y' << 8) | (UINT_16) 'E') /* Yemen */
|
|
||||||
#define COUNTRY_CODE_YT (((UINT_16) 'Y' << 8) | (UINT_16) 'T') /* Mayotte (France) */
|
|
||||||
#define COUNTRY_CODE_ZA (((UINT_16) 'Z' << 8) | (UINT_16) 'A') /* South Africa */
|
|
||||||
#define COUNTRY_CODE_ZM (((UINT_16) 'Z' << 8) | (UINT_16) 'M') /* Zambia */
|
|
||||||
#define COUNTRY_CODE_ZW (((UINT_16) 'Z' << 8) | (UINT_16) 'W') /* Zimbabwe */
|
|
||||||
#define COUNTRY_CODE_DF (((UINT_16) 'D' << 8) | (UINT_16) 'F') /* Default country domain */
|
|
||||||
#ifdef CONFIG_MTK_TC1_FEATURE
|
|
||||||
#define COUNTRY_CODE_UDF (((UINT_16) 'D' << 8) | (UINT_16) 'C') /*
|
|
||||||
* Default Country Code, for User
|
|
||||||
* Defined channel list and passive scan channel list
|
|
||||||
*/
|
|
||||||
#else
|
|
||||||
#define COUNTRY_CODE_UDF (((UINT_16) 'U' << 8) | (UINT_16) 'D') /*
|
|
||||||
* User defined supported channel list
|
|
||||||
* and passive scan channel list
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
#define COUNTRY_CODE_FF (((UINT_16) 'F' << 8) | (UINT_16) 'F') /* enable open for all channel for Certification */
|
|
||||||
#define COUNTRY_CODE_FE (((UINT_16) 'F' << 8) | (UINT_16) 'E') /* disable open for all channel for Certification */
|
|
||||||
/* dot11RegDomainsSupportValue */
|
|
||||||
#define MIB_REG_DOMAIN_FCC 0x10 /* FCC (US) */
|
|
||||||
#define MIB_REG_DOMAIN_IC 0x20 /* IC or DOC (Canada) */
|
|
||||||
#define MIB_REG_DOMAIN_ETSI 0x30 /* ETSI (Europe) */
|
|
||||||
#define MIB_REG_DOMAIN_SPAIN 0x31 /* Spain */
|
|
||||||
#define MIB_REG_DOMAIN_FRANCE 0x32 /* France */
|
|
||||||
#define MIB_REG_DOMAIN_JAPAN 0x40 /* MPHPT (Japan) */
|
|
||||||
#define MIB_REG_DOMAIN_OTHER 0x00 /* other */
|
|
||||||
|
|
||||||
/*2.4G*/
|
|
||||||
#define BAND_2G4_LOWER_BOUND 1
|
|
||||||
#define BAND_2G4_UPPER_BOUND 14
|
|
||||||
/*5G SubBand FCC spec*/
|
|
||||||
#define UNII1_LOWER_BOUND 36
|
|
||||||
#define UNII1_UPPER_BOUND 48
|
|
||||||
#define UNII2A_LOWER_BOUND 52
|
|
||||||
#define UNII2A_UPPER_BOUND 64
|
|
||||||
#define UNII2C_LOWER_BOUND 100
|
|
||||||
#define UNII2C_UPPER_BOUND 144
|
|
||||||
#define UNII3_LOWER_BOUND 149
|
|
||||||
#define UNII3_UPPER_BOUND 173
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_PWR_LIMIT_COUNTRY
|
|
||||||
|
|
||||||
#define POWER_LIMIT_TABLE_NULL 0xFFFF
|
|
||||||
#define MAX_TX_POWER 63
|
|
||||||
#define MIN_TX_POWER -64
|
|
||||||
#define MAX_CMD_SUPPORT_CHANNEL_NUM 64
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_PWR_LIMIT_COUNTRY
|
|
||||||
|
|
||||||
typedef enum _ENUM_POWER_LIMIT_T {
|
|
||||||
PWR_LIMIT_CCK,
|
|
||||||
PWR_LIMIT_20M,
|
|
||||||
PWR_LIMIT_40M,
|
|
||||||
PWR_LIMIT_80M,
|
|
||||||
PWR_LIMIT_160M,
|
|
||||||
PWR_LIMIT_NUM
|
|
||||||
} ENUM_POWER_LIMIT_T, *P_ENUM_POWER_LIMIT_T;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef enum _ENUM_POWER_LIMIT_SUBBAND_T {
|
|
||||||
POWER_LIMIT_2G4,
|
|
||||||
POWER_LIMIT_UNII1,
|
|
||||||
POWER_LIMIT_UNII2A,
|
|
||||||
POWER_LIMIT_UNII2C,
|
|
||||||
POWER_LIMIT_UNII3,
|
|
||||||
POWER_LIMIT_SUBAND_NUM
|
|
||||||
} ENUM_POWER_LIMIT_SUBBAND_T, *P_ENUM_POWER_LIMIT_SUBBAND_T;
|
|
||||||
|
|
||||||
/* Define channel offset in unit of 5MHz bandwidth */
|
|
||||||
typedef enum _ENUM_CHNL_SPAN_T {
|
|
||||||
CHNL_SPAN_5 = 1,
|
|
||||||
CHNL_SPAN_10 = 2,
|
|
||||||
CHNL_SPAN_20 = 4,
|
|
||||||
CHNL_SPAN_40 = 8
|
|
||||||
} ENUM_CHNL_SPAN_T, *P_ENUM_CHNL_SPAN_T;
|
|
||||||
|
|
||||||
/* Define BSS operating bandwidth */
|
|
||||||
typedef enum _ENUM_CHNL_BW_T {
|
|
||||||
CHNL_BW_20,
|
|
||||||
CHNL_BW_20_40,
|
|
||||||
CHNL_BW_10,
|
|
||||||
CHNL_BW_5
|
|
||||||
} ENUM_CHNL_BW_T, *P_ENUM_CHNL_BW_T;
|
|
||||||
|
|
||||||
/* In all bands, the first channel will be SCA and the second channel is SCB,
|
|
||||||
* then iteratively.
|
|
||||||
* Note the final channel will not be SCA.
|
|
||||||
*/
|
|
||||||
typedef struct _DOMAIN_SUBBAND_INFO {
|
|
||||||
/* Note1: regulation class depends on operation bandwidth and RF band.
|
|
||||||
* For example: 2.4GHz, 1~13, 20MHz ==> regulation class = 81
|
|
||||||
* 2.4GHz, 1~13, SCA ==> regulation class = 83
|
|
||||||
* 2.4GHz, 1~13, SCB ==> regulation class = 84
|
|
||||||
* Note2: TX power limit is not specified here because path loss is unknown
|
|
||||||
*/
|
|
||||||
UINT_8 ucRegClass; /* Regulation class for 20MHz */
|
|
||||||
UINT_8 ucBand; /* Type: ENUM_BAND_T */
|
|
||||||
UINT_8 ucChannelSpan; /* Type: ENUM_CHNL_SPAN_T */
|
|
||||||
UINT_8 ucFirstChannelNum;
|
|
||||||
UINT_8 ucNumChannels;
|
|
||||||
UINT_8 fgDfs; /* Type: BOOLEAN */
|
|
||||||
} DOMAIN_SUBBAND_INFO, *P_DOMAIN_SUBBAND_INFO;
|
|
||||||
|
|
||||||
/* Use it as all available channel list for STA */
|
|
||||||
typedef struct _DOMAIN_INFO_ENTRY {
|
|
||||||
PUINT_16 pu2CountryGroup;
|
|
||||||
UINT_32 u4CountryNum;
|
|
||||||
|
|
||||||
/* If different attributes, put them into different rSubBands.
|
|
||||||
* For example, DFS shall be used or not.
|
|
||||||
*/
|
|
||||||
DOMAIN_SUBBAND_INFO rSubBand[MAX_SUBBAND_NUM];
|
|
||||||
} DOMAIN_INFO_ENTRY, *P_DOMAIN_INFO_ENTRY;
|
|
||||||
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_PWR_LIMIT_COUNTRY
|
|
||||||
|
|
||||||
typedef struct _CHANNEL_POWER_LIMIT {
|
|
||||||
UINT_8 ucCentralCh;
|
|
||||||
INT_8 cPwrLimitCCK;
|
|
||||||
INT_8 cPwrLimit20;
|
|
||||||
INT_8 cPwrLimit40;
|
|
||||||
INT_8 cPwrLimit80;
|
|
||||||
INT_8 cPwrLimit160;
|
|
||||||
UINT_8 ucFlag;
|
|
||||||
UINT_8 aucReserved[1];
|
|
||||||
} CHANNEL_POWER_LIMIT, *P_CHANNEL_POWER_LIMIT;
|
|
||||||
|
|
||||||
typedef struct _COUNTRY_CHANNEL_POWER_LIMIT {
|
|
||||||
UINT_8 aucCountryCode[2];
|
|
||||||
UINT_8 ucCountryFlag;
|
|
||||||
UINT_8 ucChannelNum;
|
|
||||||
UINT_8 aucReserved[4];
|
|
||||||
CHANNEL_POWER_LIMIT rChannelPowerLimit[80];
|
|
||||||
} COUNTRY_CHANNEL_POWER_LIMIT, *P_COUNTRY_CHANNEL_POWER_LIMIT;
|
|
||||||
|
|
||||||
#define CHANNEL_PWR_LIMIT(_channel, _pwrLimit_cck, _pwrLimit_bw20, \
|
|
||||||
_pwrLimit_bw40, _pwrLimit_bw80, _pwrLimit_bw160, _ucFlag) \
|
|
||||||
{ \
|
|
||||||
.ucCentralCh = (_channel), \
|
|
||||||
.cPwrLimitCCK = (_pwrLimit_cck), \
|
|
||||||
.cPwrLimit20 = (_pwrLimit_bw20), \
|
|
||||||
.cPwrLimit40 = (_pwrLimit_bw40), \
|
|
||||||
.cPwrLimit80 = (_pwrLimit_bw80), \
|
|
||||||
.cPwrLimit160 = (_pwrLimit_bw160), \
|
|
||||||
.ucFlag = (_ucFlag), \
|
|
||||||
.aucReserved = {0} \
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef struct _COUNTRY_POWER_LIMIT_TABLE_DEFAULT {
|
|
||||||
UINT_8 aucCountryCode[2];
|
|
||||||
/* 0: ch 1 ~14 , 1: ch 36 ~48, 2: ch 52 ~64, 3: ch 100 ~144, 4: ch 149 ~165 */
|
|
||||||
INT_8 aucPwrLimitSubBand[POWER_LIMIT_SUBAND_NUM];
|
|
||||||
/*
|
|
||||||
* bit0: cPwrLimit2G4, bit1: cPwrLimitUnii1; bit2: cPwrLimitUnii2A;
|
|
||||||
* bit3: cPwrLimitUnii2C; bit4: cPwrLimitUnii3; mW: 0, mW\MHz : 1
|
|
||||||
*/
|
|
||||||
UINT_8 ucPwrUnit;
|
|
||||||
} COUNTRY_POWER_LIMIT_TABLE_DEFAULT, *P_COUNTRY_POWER_LIMIT_TABLE_DEFAULT;
|
|
||||||
|
|
||||||
typedef struct _COUNTRY_POWER_LIMIT_TABLE_CONFIGURATION {
|
|
||||||
UINT_8 aucCountryCode[2];
|
|
||||||
UINT_8 ucCentralCh;
|
|
||||||
INT_8 aucPwrLimit[PWR_LIMIT_NUM];
|
|
||||||
} COUNTRY_POWER_LIMIT_TABLE_CONFIGURATION, *P_COUNTRY_POWER_LIMIT_TABLE_CONFIGURATION;
|
|
||||||
|
|
||||||
typedef struct _SUBBAND_CHANNEL_T {
|
|
||||||
UINT_8 ucStartCh;
|
|
||||||
UINT_8 ucEndCh;
|
|
||||||
UINT_8 ucInterval;
|
|
||||||
UINT_8 ucReserved;
|
|
||||||
} SUBBAND_CHANNEL_T, *P_SUBBAND_CHANNEL_T;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define CAL_CH_OFFSET_80M(_PRIMARY_CH, _CENTRAL_CH) \
|
|
||||||
(((_PRIMARY_CH - _CENTRAL_CH) + 6) >> 2)
|
|
||||||
|
|
||||||
#define CAL_CH_OFFSET_160M(_PRIMARY_CH, _CENTRAL_CH) \
|
|
||||||
(((_PRIMARY_CH - _CENTRAL_CH) + 14) >> 2)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
P_DOMAIN_INFO_ENTRY rlmDomainGetDomainInfo(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID rlmDomainGetChnlList(P_ADAPTER_T prAdapter,
|
|
||||||
ENUM_BAND_T eSpecificBand, BOOLEAN fgNoDfs,
|
|
||||||
UINT_8 ucMaxChannelNum, PUINT_8 pucNumOfChannel, P_RF_CHANNEL_INFO_T paucChannelList);
|
|
||||||
|
|
||||||
VOID rlmDomainGetDfsChnls(P_ADAPTER_T prAdapter,
|
|
||||||
UINT_8 ucMaxChannelNum, PUINT_8 pucNumOfChannel, P_RF_CHANNEL_INFO_T paucChannelList);
|
|
||||||
|
|
||||||
VOID rlmDomainSendCmd(P_ADAPTER_T prAdapter, BOOLEAN fgIsOid);
|
|
||||||
|
|
||||||
VOID rlmDomainSendDomainInfoCmd(P_ADAPTER_T prAdapter, BOOLEAN fgIsOid);
|
|
||||||
|
|
||||||
VOID rlmDomainSendPassiveScanInfoCmd(P_ADAPTER_T prAdapter, BOOLEAN fgIsOid);
|
|
||||||
|
|
||||||
BOOLEAN rlmDomainIsLegalChannel(P_ADAPTER_T prAdapter, ENUM_BAND_T eBand, UINT_8 ucChannel);
|
|
||||||
|
|
||||||
UINT_32 rlmDomainSupOperatingClassIeFill(PUINT_8 pBuf);
|
|
||||||
|
|
||||||
BOOLEAN rlmDomainCheckChannelEntryValid(P_ADAPTER_T prAdapter, UINT_8 ucCentralCh);
|
|
||||||
|
|
||||||
UINT_8 rlmDomainGetCenterChannel(ENUM_BAND_T eBand, UINT_8 ucPriChannel, ENUM_CHNL_EXT_T eExtend);
|
|
||||||
|
|
||||||
BOOLEAN rlmDomainIsValidRfSetting(P_ADAPTER_T prAdapter, ENUM_BAND_T eBand,
|
|
||||||
UINT_8 ucPriChannel, ENUM_CHNL_EXT_T eExtend,
|
|
||||||
ENUM_CHANNEL_WIDTH_T eChannelWidth, UINT_8 ucChannelS1, UINT_8 ucChannelS2);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_PWR_LIMIT_COUNTRY
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
rlmDomainCheckPowerLimitValid(P_ADAPTER_T prAdapter,
|
|
||||||
COUNTRY_POWER_LIMIT_TABLE_CONFIGURATION rPowerLimitTableConfiguration,
|
|
||||||
UINT_8 ucPwrLimitNum);
|
|
||||||
|
|
||||||
VOID rlmDomainCheckCountryPowerLimitTable(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
UINT_16 rlmDomainPwrLimitDefaultTableDecision(P_ADAPTER_T prAdapter, UINT_16 u2CountryCode);
|
|
||||||
|
|
||||||
VOID rlmDomainSendPwrLimitCmd(P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _RLM_DOMAIN_H */
|
|
|
@ -1,98 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _RLM_OBSS_H
|
|
||||||
#define _RLM_OBSS_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define CHNL_LIST_SZ_2G 14
|
|
||||||
#define CHNL_LIST_SZ_5G 14
|
|
||||||
|
|
||||||
#define CHNL_LEVEL0 0
|
|
||||||
#define CHNL_LEVEL1 1
|
|
||||||
#define CHNL_LEVEL2 2
|
|
||||||
|
|
||||||
#define AFFECTED_CHNL_OFFSET 5
|
|
||||||
|
|
||||||
#define OBSS_SCAN_MIN_INTERVAL 10 /* In unit of sec */
|
|
||||||
|
|
||||||
#define PUBLIC_ACTION_MAX_LEN 200 /* In unit of byte */
|
|
||||||
|
|
||||||
/* P2P GO only */
|
|
||||||
/* Define default OBSS Scan parameters (from MIB in spec.) */
|
|
||||||
#define dot11OBSSScanPassiveDwell 20
|
|
||||||
#define dot11OBSSScanActiveDwell 10
|
|
||||||
#define dot11OBSSScanPassiveTotalPerChannel 200
|
|
||||||
#define dot11OBSSScanActiveTotalPerChannel 20
|
|
||||||
#define dot11BSSWidthTriggerScanInterval 300 /* Unit: sec */
|
|
||||||
#define dot11BSSWidthChannelTransitionDelayFactor 5
|
|
||||||
#define dot11OBSSScanActivityThreshold 25
|
|
||||||
|
|
||||||
#define OBSS_20_40M_TIMEOUT (dot11BSSWidthTriggerScanInterval + 10)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Control MAC PCO function */
|
|
||||||
typedef enum _ENUM_SYS_PCO_PHASE_T {
|
|
||||||
SYS_PCO_PHASE_DISABLED = 0,
|
|
||||||
SYS_PCO_PHASE_20M,
|
|
||||||
SYS_PCO_PHASE_40M
|
|
||||||
} ENUM_SYS_PCO_PHASE_T, *P_ENUM_SYS_PCO_PHASE_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID rlmObssInit(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID rlmObssScanDone(P_ADAPTER_T prAdapter, P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID rlmObssTriggerScan(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _RLM_OBSS_H */
|
|
|
@ -1,95 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _RLM_PROTECTION_H
|
|
||||||
#define _RLM_PROTECTION_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef enum _ENUM_SYS_PROTECT_MODE_T {
|
|
||||||
SYS_PROTECT_MODE_NONE = 0, /* Mode 0 */
|
|
||||||
SYS_PROTECT_MODE_ERP, /* Mode 1 */
|
|
||||||
SYS_PROTECT_MODE_NON_HT, /* Mode 2 */
|
|
||||||
SYS_PROTECT_MODE_20M, /* Mode 3 */
|
|
||||||
|
|
||||||
SYS_PROTECT_MODE_NUM
|
|
||||||
} ENUM_SYS_PROTECT_MODE_T, *P_ENUM_SYS_PROTECT_MODE_T;
|
|
||||||
|
|
||||||
/* This definition follows HT Protection field of HT Operation IE */
|
|
||||||
typedef enum _ENUM_HT_PROTECT_MODE_T {
|
|
||||||
HT_PROTECT_MODE_NONE = 0,
|
|
||||||
HT_PROTECT_MODE_NON_MEMBER,
|
|
||||||
HT_PROTECT_MODE_20M,
|
|
||||||
HT_PROTECT_MODE_NON_HT,
|
|
||||||
|
|
||||||
HT_PROTECT_MODE_NUM
|
|
||||||
} ENUM_HT_PROTECT_MODE_T, *P_ENUM_HT_PROTECT_MODE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_GF_MODE_T {
|
|
||||||
GF_MODE_NORMAL = 0,
|
|
||||||
GF_MODE_PROTECT,
|
|
||||||
GF_MODE_DISALLOWED,
|
|
||||||
|
|
||||||
GF_MODE_NUM
|
|
||||||
} ENUM_GF_MODE_T, *P_ENUM_GF_MODE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_RIFS_MODE_T {
|
|
||||||
RIFS_MODE_NORMAL = 0,
|
|
||||||
RIFS_MODE_DISALLOWED,
|
|
||||||
|
|
||||||
RIFS_MODE_NUM
|
|
||||||
} ENUM_RIFS_MODE_T, *P_ENUM_RIFS_MODE_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _RLM_PROTECTION_H */
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,138 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _ROAMING_FSM_H
|
|
||||||
#define _ROAMING_FSM_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Roaming Discovery interval, SCAN result need to be updated */
|
|
||||||
#define ROAMING_DISCOVERY_TIMEOUT_SEC 5 /* Seconds. */
|
|
||||||
|
|
||||||
/* #define ROAMING_NO_SWING_RCPI_STEP 5 //rcpi */
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef enum _ENUM_ROAMING_FAIL_REASON_T {
|
|
||||||
ROAMING_FAIL_REASON_CONNLIMIT = 0,
|
|
||||||
ROAMING_FAIL_REASON_NOCANDIDATE,
|
|
||||||
ROAMING_FAIL_REASON_NUM
|
|
||||||
} ENUM_ROAMING_FAIL_REASON_T;
|
|
||||||
|
|
||||||
/* events of roaming between driver and firmware */
|
|
||||||
typedef enum _ENUM_ROAMING_EVENT_T {
|
|
||||||
ROAMING_EVENT_START = 0,
|
|
||||||
ROAMING_EVENT_DISCOVERY,
|
|
||||||
ROAMING_EVENT_ROAM,
|
|
||||||
ROAMING_EVENT_FAIL,
|
|
||||||
ROAMING_EVENT_ABORT,
|
|
||||||
ROAMING_EVENT_NUM
|
|
||||||
} ENUM_ROAMING_EVENT_T;
|
|
||||||
|
|
||||||
#define ROAMING_EVENT_REASON_TX_ERR BIT(0)
|
|
||||||
#define ROAMING_EVENT_REASON_RCPI BIT(1)
|
|
||||||
|
|
||||||
typedef struct _ROAMING_PARAM_T {
|
|
||||||
UINT_16 u2Event;
|
|
||||||
UINT_16 u2Data;
|
|
||||||
UINT_16 u2Reason;
|
|
||||||
} ROAMING_PARAM_T, *P_ROAMING_PARAM_T;
|
|
||||||
|
|
||||||
/**/ typedef enum _ENUM_ROAMING_STATE_T {
|
|
||||||
ROAMING_STATE_IDLE = 0,
|
|
||||||
ROAMING_STATE_DECISION,
|
|
||||||
ROAMING_STATE_DISCOVERY,
|
|
||||||
ROAMING_STATE_ROAM,
|
|
||||||
ROAMING_STATE_NUM
|
|
||||||
} ENUM_ROAMING_STATE_T;
|
|
||||||
|
|
||||||
typedef struct _ROAMING_INFO_T {
|
|
||||||
BOOLEAN fgIsEnableRoaming;
|
|
||||||
|
|
||||||
ENUM_ROAMING_STATE_T eCurrentState;
|
|
||||||
|
|
||||||
OS_SYSTIME rRoamingDiscoveryUpdateTime;
|
|
||||||
|
|
||||||
#define ROAMING_ENTRY_TIMEOUT_SKIP_COUNT_MAX 2
|
|
||||||
UINT_32 RoamingEntryTimeoutSkipCount;
|
|
||||||
|
|
||||||
UINT_32 DrvRoamingAllow;
|
|
||||||
} ROAMING_INFO_T, *P_ROAMING_INFO_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_ROAMING
|
|
||||||
#define IS_ROAMING_ACTIVE(prAdapter) \
|
|
||||||
(prAdapter->rWifiVar.rRoamingInfo.eCurrentState == ROAMING_STATE_ROAM)
|
|
||||||
#else
|
|
||||||
#define IS_ROAMING_ACTIVE(prAdapter) FALSE
|
|
||||||
#endif /* CFG_SUPPORT_ROAMING */
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID roamingFsmInit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID roamingFsmUninit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID roamingFsmSendCmd(IN P_ADAPTER_T prAdapter, IN P_ROAMING_PARAM_T prParam);
|
|
||||||
|
|
||||||
VOID roamingFsmScanResultsUpdate(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID roamingFsmSteps(IN P_ADAPTER_T prAdapter, IN ENUM_ROAMING_STATE_T eNextState);
|
|
||||||
|
|
||||||
VOID roamingFsmRunEventStart(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID roamingFsmRunEventDiscovery(IN P_ADAPTER_T prAdapter, IN P_ROAMING_PARAM_T prParam);
|
|
||||||
|
|
||||||
VOID roamingFsmRunEventRoam(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID roamingFsmRunEventFail(IN P_ADAPTER_T prAdapter, IN UINT_32 u4Reason);
|
|
||||||
|
|
||||||
VOID roamingFsmRunEventAbort(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS roamingFsmProcessEvent(IN P_ADAPTER_T prAdapter, IN P_ROAMING_PARAM_T prParam);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _ROAMING_FSM_H */
|
|
|
@ -1,247 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _RSN_H
|
|
||||||
#define _RSN_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* ----- Definitions for Cipher Suite Selectors ----- */
|
|
||||||
#define RSN_CIPHER_SUITE_USE_GROUP_KEY 0x00AC0F00
|
|
||||||
#define RSN_CIPHER_SUITE_WEP40 0x01AC0F00
|
|
||||||
#define RSN_CIPHER_SUITE_TKIP 0x02AC0F00
|
|
||||||
#define RSN_CIPHER_SUITE_CCMP 0x04AC0F00
|
|
||||||
#define RSN_CIPHER_SUITE_WEP104 0x05AC0F00
|
|
||||||
#if CFG_SUPPORT_802_11W
|
|
||||||
#define RSN_CIPHER_SUITE_AES_128_CMAC 0x06AC0F00
|
|
||||||
#endif
|
|
||||||
#define RSN_CIPHER_SUITE_GROUP_NOT_USED 0x07AC0F00
|
|
||||||
#define RSN_CIPHER_SUITE_SAE 0x08AC0F00
|
|
||||||
#define RSN_CIPHER_SUITE_OWE 0x12AC0F00
|
|
||||||
|
|
||||||
#define WPA_CIPHER_SUITE_NONE 0x00F25000
|
|
||||||
#define WPA_CIPHER_SUITE_WEP40 0x01F25000
|
|
||||||
#define WPA_CIPHER_SUITE_TKIP 0x02F25000
|
|
||||||
#define WPA_CIPHER_SUITE_CCMP 0x04F25000
|
|
||||||
#define WPA_CIPHER_SUITE_WEP104 0x05F25000
|
|
||||||
|
|
||||||
/* ----- Definitions for Authentication and Key Management Suite Selectors ----- */
|
|
||||||
#define RSN_AKM_SUITE_NONE 0x00AC0F00
|
|
||||||
#define RSN_AKM_SUITE_802_1X 0x01AC0F00
|
|
||||||
#define RSN_AKM_SUITE_PSK 0x02AC0F00
|
|
||||||
#define RSN_AKM_SUITE_FT_802_1X 0x03AC0F00
|
|
||||||
#define RSN_AKM_SUITE_FT_PSK 0x04AC0F00
|
|
||||||
#if KERNEL_VERSION(4, 12, 0) > CFG80211_VERSION_CODE
|
|
||||||
#define WLAN_AKM_SUITE_FT_8021X 0x000FAC03
|
|
||||||
#define WLAN_AKM_SUITE_FT_PSK 0x000FAC04
|
|
||||||
#endif
|
|
||||||
/* Add AKM SUITE for OWE since kernel haven't defined it. */
|
|
||||||
#define WLAN_AKM_SUITE_OWE 0x000FAC12
|
|
||||||
#if CFG_SUPPORT_802_11W
|
|
||||||
#define RSN_AKM_SUITE_802_1X_SHA256 0x05AC0F00
|
|
||||||
#define RSN_AKM_SUITE_PSK_SHA256 0x06AC0F00
|
|
||||||
#endif
|
|
||||||
#define RSN_AKM_SUITE_SAE 0x08AC0F00
|
|
||||||
#define RSN_AKM_SUITE_8021X_SUITE_B 0x0BAC0F00
|
|
||||||
#define RSN_AKM_SUITE_8021X_SUITE_B_192 0x0CAC0F00
|
|
||||||
#define RSN_AKM_SUITE_OWE 0x12AC0F00
|
|
||||||
|
|
||||||
#define WPA_AKM_SUITE_NONE 0x00F25000
|
|
||||||
#define WPA_AKM_SUITE_802_1X 0x01F25000
|
|
||||||
#define WPA_AKM_SUITE_PSK 0x02F25000
|
|
||||||
|
|
||||||
#define WFA_AKM_SUITE_OSEN 0x019A6F50
|
|
||||||
/* this define should be in ieee80211.h, but kernel didn't update it. so we define here temporary */
|
|
||||||
#define WLAN_AKM_SUITE_OSEN 0x506f9a01
|
|
||||||
#define WLAN_CIPHER_SUITE_NO_GROUP_ADDR 0x000fac07
|
|
||||||
|
|
||||||
#define ELEM_ID_RSN_LEN_FIXED 20 /* The RSN IE len for associate request */
|
|
||||||
|
|
||||||
#define ELEM_ID_WPA_LEN_FIXED 22 /* The RSN IE len for associate request */
|
|
||||||
|
|
||||||
#define MASK_RSNIE_CAP_PREAUTH BIT(0)
|
|
||||||
|
|
||||||
#define GET_SELECTOR_TYPE(x) ((UINT_8)(((x) >> 24) & 0x000000FF))
|
|
||||||
#define SET_SELECTOR_TYPE(x, y) {x = (((x) & 0x00FFFFFF) | (((UINT_32)(y) << 24) & 0xFF000000))}
|
|
||||||
|
|
||||||
#define AUTH_CIPHER_CCMP 0x00000008
|
|
||||||
|
|
||||||
/* Cihpher suite flags */
|
|
||||||
#define CIPHER_FLAG_NONE 0x00000000
|
|
||||||
#define CIPHER_FLAG_WEP40 0x00000001 /* BIT 1 */
|
|
||||||
#define CIPHER_FLAG_TKIP 0x00000002 /* BIT 2 */
|
|
||||||
#define CIPHER_FLAG_CCMP 0x00000008 /* BIT 4 */
|
|
||||||
#define CIPHER_FLAG_WEP104 0x00000010 /* BIT 5 */
|
|
||||||
#define CIPHER_FLAG_WEP128 0x00000020 /* BIT 6 */
|
|
||||||
#if (CFG_REFACTORY_PMKSA == 0)
|
|
||||||
#define WAIT_TIME_IND_PMKID_CANDICATE_SEC 6 /* seconds */
|
|
||||||
#endif
|
|
||||||
#define TKIP_COUNTERMEASURE_SEC 60 /* seconds */
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_802_11W
|
|
||||||
#define RSN_AUTH_MFP_DISABLED 0 /* MFP disabled */
|
|
||||||
#define RSN_AUTH_MFP_OPTIONAL 1 /* MFP optional */
|
|
||||||
#define RSN_AUTH_MFP_REQUIRED 2 /* MFP required */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Flags for PMKID Candidate list structure */
|
|
||||||
#define EVENT_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01
|
|
||||||
|
|
||||||
#define CONTROL_FLAG_UC_MGMT_NO_ENC BIT(6)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define RSN_IE(fp) ((P_RSN_INFO_ELEM_T) fp)
|
|
||||||
#define WPA_IE(fp) ((P_WPA_INFO_ELEM_T) fp)
|
|
||||||
|
|
||||||
#define ELEM_MAX_LEN_TIMEOUT_IE (5)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
BOOLEAN rsnParseRsnIE(IN P_ADAPTER_T prAdapter, IN P_RSN_INFO_ELEM_T prInfoElem, OUT P_RSN_INFO_T prRsnInfo);
|
|
||||||
|
|
||||||
BOOLEAN rsnParseWpaIE(IN P_ADAPTER_T prAdapter, IN P_WPA_INFO_ELEM_T prInfoElem, OUT P_RSN_INFO_T prWpaInfo);
|
|
||||||
|
|
||||||
BOOLEAN rsnSearchSupportedCipher(IN P_ADAPTER_T prAdapter, IN UINT_32 u4Cipher, OUT PUINT_32 pu4Index);
|
|
||||||
|
|
||||||
BOOLEAN rsnSearchAKMSuite(IN P_ADAPTER_T prAdapter, IN UINT_32 u4AkmSuite, OUT PUINT_32 pu4Index);
|
|
||||||
|
|
||||||
BOOLEAN rsnPerformPolicySelection(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBss);
|
|
||||||
|
|
||||||
VOID rsnGenerateWpaNoneIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rsnGenerateWPAIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rsnGenerateRSNIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID rsnGenerateRSNXIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
rsnParseCheckForWFAInfoElem(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PUINT_8 pucBuf, OUT PUINT_8 pucOuiType, OUT PUINT_16 pu2SubTypeVersion);
|
|
||||||
|
|
||||||
BOOLEAN rsnIsSuitableBSS(IN P_ADAPTER_T prAdapter, IN P_RSN_INFO_T prBssRsnInfo);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_AAA
|
|
||||||
void rsnParserCheckForRSNCCMPPSK(P_ADAPTER_T prAdapter, P_RSN_INFO_ELEM_T prIe,
|
|
||||||
P_STA_RECORD_T prStaRec, PUINT_16 pu2StatusCode);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VOID rsnTkipHandleMICFailure(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta, IN BOOLEAN fgErrorKeyType);
|
|
||||||
|
|
||||||
#if (CFG_REFACTORY_PMKSA == 0)
|
|
||||||
VOID rsnSelectPmkidCandidateList(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
VOID rsnUpdatePmkidCandidateList(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
BOOLEAN rsnSearchPmkidEntry(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucBssid, OUT PUINT_32 pu4EntryIndex);
|
|
||||||
|
|
||||||
BOOLEAN rsnCheckPmkidCandicate(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID rsnCheckPmkidCache(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBss);
|
|
||||||
|
|
||||||
VOID rsnGeneratePmkidIndication(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID rsnIndicatePmkidCand(IN P_ADAPTER_T prAdapter, IN ULONG ulParm);
|
|
||||||
#else
|
|
||||||
P_PMKID_ENTRY_T rsnSearchPmkidEntry(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PUINT_8 pucBssid);
|
|
||||||
|
|
||||||
void rsnCheckPmkidCache(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_BSS_DESC_T prBss);
|
|
||||||
|
|
||||||
void rsnGeneratePmkidIndication(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_PARAM_PMKID_CANDIDATE_T prCandi);
|
|
||||||
|
|
||||||
WLAN_STATUS rsnSetPmkid(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_PARAM_PMKID_T prPmkid);
|
|
||||||
|
|
||||||
WLAN_STATUS rsnDelPmkid(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_PARAM_PMKID_T prPmkid);
|
|
||||||
|
|
||||||
WLAN_STATUS rsnFlushPmkid(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_802_11W
|
|
||||||
UINT_32 rsnCheckBipKeyInstalled(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
UINT_8 rsnCheckSaQueryTimeout(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
void rsnStartSaQueryTimer(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
void rsnStartSaQuery(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
void rsnStopSaQuery(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
void rsnSaQueryRequest(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
void rsnSaQueryAction(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
BOOLEAN rsnCheckRxMgmt(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, IN UINT_8 ucSubtype);
|
|
||||||
|
|
||||||
UINT_16 rsnPmfCapableValidation(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_BSS_INFO_T prBssInfo, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID rsnPmfGenerateTimeoutIE(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
void rsnApStartSaQuery(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
void rsnApSaQueryAction(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
#endif /* CFG_SUPPORT_802_11W */
|
|
||||||
|
|
||||||
BOOLEAN rsnCheckSecurityModeChanged(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo, P_BSS_DESC_T prBssDesc);
|
|
||||||
BOOLEAN rsnParseOsenIE(P_ADAPTER_T prAdapter, struct IE_WFA_OSEN *prInfoElem, P_RSN_INFO_T prOsenInfo);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
rsnCalculateFTIELen(P_ADAPTER_T prAdapter, ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID rsnGenerateFTIE(IN P_ADAPTER_T prAdapter, IN OUT P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _RSN_H */
|
|
|
@ -1,839 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _SCAN_H
|
|
||||||
#define _SCAN_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "gl_vendor.h"
|
|
||||||
|
|
||||||
/* TDLS test purpose */
|
|
||||||
extern BOOLEAN flgTdlsTestExtCapElm;
|
|
||||||
extern UINT8 aucTdlsTestExtCapElm[];
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*! Maximum buffer size of SCAN list */
|
|
||||||
#define SCN_MAX_BUFFER_SIZE (CFG_MAX_NUM_BSS_LIST * ALIGN_4(sizeof(BSS_DESC_T)))
|
|
||||||
#define SCN_ROAM_MAX_BUFFER_SIZE (CFG_MAX_NUM_ROAM_BSS_LIST * ALIGN_4(sizeof(ROAM_BSS_DESC_T)))
|
|
||||||
|
|
||||||
#define SCN_RM_POLICY_EXCLUDE_CONNECTED BIT(0) /* Remove SCAN result except the connected one. */
|
|
||||||
#define SCN_RM_POLICY_TIMEOUT BIT(1) /* Remove the timeout one */
|
|
||||||
#define SCN_RM_POLICY_OLDEST_HIDDEN BIT(2) /* Remove the oldest one with hidden ssid */
|
|
||||||
#define SCN_RM_POLICY_SMART_WEAKEST BIT(3) /* If there are more than half BSS which has the
|
|
||||||
* same ssid as connection setting, remove the
|
|
||||||
* weakest one from them
|
|
||||||
* Else remove the weakest one.
|
|
||||||
*/
|
|
||||||
#define SCN_RM_POLICY_ENTIRE BIT(4) /* Remove entire SCAN result */
|
|
||||||
|
|
||||||
#define SCN_BSS_DESC_SAME_SSID_THRESHOLD 20 /* This is used by POLICY SMART WEAKEST,
|
|
||||||
* If exceed this value, remove weakest BSS_DESC_T
|
|
||||||
* with same SSID first in large network.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* the scan time in WFD mode + 2.4G/5G is about 9s so we need to enlarge the value */
|
|
||||||
#define SCN_BSS_DESC_REMOVE_TIMEOUT_SEC 15 /* Second. */
|
|
||||||
/* This is used by POLICY TIMEOUT,
|
|
||||||
* If exceed this value, remove timeout BSS_DESC_T.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define SCN_PROBE_DELAY_MSEC 0
|
|
||||||
|
|
||||||
#define SCN_ADHOC_BSS_DESC_TIMEOUT_SEC 15 /* Second. */
|
|
||||||
|
|
||||||
#define SCN_NLO_NETWORK_CHANNEL_NUM (4)
|
|
||||||
|
|
||||||
#define REMOVE_TIMEOUT_TWO_DAY (60*60*24*2)
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* MSG_SCN_SCAN_REQ */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
#define SCAN_REQ_SSID_WILDCARD BIT(0)
|
|
||||||
#define SCAN_REQ_SSID_P2P_WILDCARD BIT(1)
|
|
||||||
#define SCAN_REQ_SSID_SPECIFIED BIT(2) /* two probe req will be sent, wildcard and specified */
|
|
||||||
#define SCAN_REQ_SSID_SPECIFIED_ONLY BIT(3) /* only a specified ssid probe request will be sent */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Support Multiple SSID SCAN */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
#define SCN_SSID_MAX_NUM CFG_SCAN_SSID_MAX_NUM
|
|
||||||
#define SCN_SSID_MATCH_MAX_NUM CFG_SCAN_SSID_MATCH_MAX_NUM
|
|
||||||
|
|
||||||
#define SWC_NUM_BSSID_THRESHOLD_DEFAULT 8
|
|
||||||
#define SWC_RSSI_WINDSIZE_DEFAULT 8
|
|
||||||
#define LOST_AP_WINDOW 16
|
|
||||||
#define MAX_CHANNEL_NUM_PER_BUCKETS 8
|
|
||||||
|
|
||||||
#define SCN_BSS_JOIN_FAIL_THRESOLD 4
|
|
||||||
#define SCN_BSS_JOIN_FAIL_CNT_RESET_SEC 15
|
|
||||||
#define SCN_BSS_JOIN_FAIL_RESET_STEP 2
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_BATCH_SCAN
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* SCAN_BATCH_REQ */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
#define SCAN_BATCH_REQ_START BIT(0)
|
|
||||||
#define SCAN_BATCH_REQ_STOP BIT(1)
|
|
||||||
#define SCAN_BATCH_REQ_RESULT BIT(2)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SCAN_NLO_DEFAULT_INTERVAL 30000
|
|
||||||
/* PNO min period 30s, max period 300s */
|
|
||||||
#define SCAN_NLO_MIN_INTERVAL 30
|
|
||||||
#define SCAN_NLO_MAX_INTERVAL 300
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef enum _ENUM_SCAN_TYPE_T {
|
|
||||||
SCAN_TYPE_PASSIVE_SCAN = 0,
|
|
||||||
SCAN_TYPE_ACTIVE_SCAN,
|
|
||||||
SCAN_TYPE_NUM
|
|
||||||
} ENUM_SCAN_TYPE_T, *P_ENUM_SCAN_TYPE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_SCAN_STATE_T {
|
|
||||||
SCAN_STATE_IDLE = 0,
|
|
||||||
SCAN_STATE_SCANNING,
|
|
||||||
SCAN_STATE_NUM
|
|
||||||
} ENUM_SCAN_STATE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_SCAN_CHANNEL_T {
|
|
||||||
SCAN_CHANNEL_FULL = 0,
|
|
||||||
SCAN_CHANNEL_2G4,
|
|
||||||
SCAN_CHANNEL_5G,
|
|
||||||
SCAN_CHANNEL_P2P_SOCIAL,
|
|
||||||
SCAN_CHANNEL_SPECIFIED,
|
|
||||||
SCAN_CHANNEL_NUM
|
|
||||||
} ENUM_SCAN_CHANNEL, *P_ENUM_SCAN_CHANNEL;
|
|
||||||
|
|
||||||
typedef struct _MSG_SCN_FSM_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_32 u4Dummy;
|
|
||||||
} MSG_SCN_FSM_T, *P_MSG_SCN_FSM_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_POSTPONE_SCHED_SCAN_REQUEST_T {
|
|
||||||
SCHED_SCAN_POSTPONE_START = 0,
|
|
||||||
SCHED_SCAN_POSTPONE_STOP,
|
|
||||||
SCHED_SCAN_POSTPONE_NUM
|
|
||||||
} ENUM_POSTPONE_SCHED_SCAN_REQUEST_T;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _ENUM_PSCAN_STATE_T {
|
|
||||||
PSCN_IDLE = 0,
|
|
||||||
PSCN_RESET,
|
|
||||||
PSCN_SCANNING,
|
|
||||||
PSCAN_STATE_T_NUM
|
|
||||||
} ENUM_PSCAN_STATE_T;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* BSS Descriptors */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
struct _BSS_DESC_T {
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
LINK_ENTRY_T rLinkEntryEss;
|
|
||||||
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN];
|
|
||||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* For IBSS, the SrcAddr is different from BSSID */
|
|
||||||
|
|
||||||
BOOLEAN fgIsConnecting; /* If we are going to connect to this BSS
|
|
||||||
* (JOIN or ROAMING to another BSS), don't
|
|
||||||
* remove this record from BSS List.
|
|
||||||
*/
|
|
||||||
BOOLEAN fgIsConnected; /* If we have connected to this BSS (NORMAL_TR),
|
|
||||||
* don't removed this record from BSS list.
|
|
||||||
*/
|
|
||||||
|
|
||||||
BOOLEAN fgIsValidSSID; /* This flag is TRUE if the SSID is not hidden */
|
|
||||||
BOOLEAN fgIsHiddenSSID; /* When this flag is TRUE, means the SSID
|
|
||||||
* of this BSS is not known yet.
|
|
||||||
*/
|
|
||||||
UINT_8 ucSSIDLen;
|
|
||||||
UINT_8 aucSSID[ELEM_MAX_LEN_SSID];
|
|
||||||
|
|
||||||
OS_SYSTIME rUpdateTime;
|
|
||||||
|
|
||||||
ENUM_BSS_TYPE_T eBSSType;
|
|
||||||
|
|
||||||
UINT_16 u2CapInfo;
|
|
||||||
|
|
||||||
UINT_16 u2BeaconInterval;
|
|
||||||
UINT_16 u2ATIMWindow;
|
|
||||||
|
|
||||||
UINT_16 u2OperationalRateSet;
|
|
||||||
UINT_16 u2BSSBasicRateSet;
|
|
||||||
BOOLEAN fgIsUnknownBssBasicRate;
|
|
||||||
|
|
||||||
BOOLEAN fgIsERPPresent;
|
|
||||||
BOOLEAN fgIsHTPresent;
|
|
||||||
|
|
||||||
UINT_8 ucPhyTypeSet; /* Available PHY Type Set of this BSS */
|
|
||||||
|
|
||||||
UINT_8 ucChannelNum;
|
|
||||||
|
|
||||||
ENUM_CHNL_EXT_T eSco; /*
|
|
||||||
* Record bandwidth for association process
|
|
||||||
* Some AP will send association resp by 40MHz BW
|
|
||||||
*/
|
|
||||||
ENUM_BAND_T eBand;
|
|
||||||
|
|
||||||
UINT_8 ucDTIMPeriod;
|
|
||||||
|
|
||||||
BOOLEAN fgIsLargerTSF; /* This BSS's TimeStamp is larger than us(TCL == 1 in RX_STATUS_T) */
|
|
||||||
|
|
||||||
UINT_8 ucRCPI;
|
|
||||||
|
|
||||||
UINT_8 ucWmmFlag; /* A flag to indicate this BSS's WMM capability */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* \brief The srbiter Search State will matched the scan result,
|
|
||||||
* and saved the selected cipher and akm, and report the score,
|
|
||||||
* for arbiter join state, join module will carry this target BSS
|
|
||||||
* to rsn generate ie function, for gen wpa/rsn ie
|
|
||||||
*/
|
|
||||||
UINT_32 u4RsnSelectedGroupCipher;
|
|
||||||
UINT_32 u4RsnSelectedPairwiseCipher;
|
|
||||||
UINT_32 u4RsnSelectedAKMSuite;
|
|
||||||
|
|
||||||
UINT_16 u2RsnCap;
|
|
||||||
|
|
||||||
RSN_INFO_T rRSNInfo;
|
|
||||||
RSN_INFO_T rWPAInfo;
|
|
||||||
#if 1 /* CFG_SUPPORT_WAPI */
|
|
||||||
WAPI_INFO_T rIEWAPI;
|
|
||||||
BOOLEAN fgIEWAPI;
|
|
||||||
#endif
|
|
||||||
BOOLEAN fgIERSN;
|
|
||||||
BOOLEAN fgIEWPA;
|
|
||||||
BOOLEAN fgIEOsen;
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_DETECT_ATHEROS_AP
|
|
||||||
BOOLEAN fgIsAtherosAP;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*! \brief RSN parameters selected for connection */
|
|
||||||
/*
|
|
||||||
* ! \brief The Select score for final AP selection,
|
|
||||||
* 0, no sec, 1,2,3 group cipher is WEP, TKIP, CCMP
|
|
||||||
*/
|
|
||||||
UINT_8 ucEncLevel;
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
BOOLEAN fgIsP2PPresent;
|
|
||||||
BOOLEAN fgIsP2PReport; /* TRUE: report to upper layer */
|
|
||||||
P_P2P_DEVICE_DESC_T prP2pDesc;
|
|
||||||
|
|
||||||
UINT_8 aucIntendIfAddr[MAC_ADDR_LEN]; /* For IBSS, the SrcAddr is different from BSSID */
|
|
||||||
/* UINT_8 ucDevCapabilityBitmap; */ /* Device Capability Attribute. (P2P_DEV_CAPABILITY_XXXX) */
|
|
||||||
/* UINT_8 ucGroupCapabilityBitmap; */ /* Group Capability Attribute. (P2P_GROUP_CAPABILITY_XXXX) */
|
|
||||||
|
|
||||||
LINK_T rP2pDeviceList;
|
|
||||||
|
|
||||||
/* P_LINK_T prP2pDeviceList; */
|
|
||||||
|
|
||||||
/* For
|
|
||||||
* 1. P2P Capability.
|
|
||||||
* 2. P2P Device ID. ( in aucSrcAddr[] )
|
|
||||||
* 3. NOA (TODO:)
|
|
||||||
* 4. Extend Listen Timing. (Probe Rsp) (TODO:)
|
|
||||||
* 5. P2P Device Info. (Probe Rsp)
|
|
||||||
* 6. P2P Group Info. (Probe Rsp)
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BOOLEAN fgIsIEOverflow; /* The received IE length exceed the maximum IE buffer size */
|
|
||||||
UINT_16 u2RawLength; /* The byte count of aucRawBuf[] */
|
|
||||||
UINT_16 u2IELength; /* The byte count of aucIEBuf[] */
|
|
||||||
|
|
||||||
ULARGE_INTEGER u8TimeStamp; /* Place u8TimeStamp before aucIEBuf[1] to force DW align */
|
|
||||||
UINT_8 aucRawBuf[CFG_RAW_BUFFER_SIZE];
|
|
||||||
UINT_8 aucIEBuf[CFG_IE_BUFFER_SIZE];
|
|
||||||
UINT_8 ucJoinFailureCount;
|
|
||||||
OS_SYSTIME rJoinFailTime;
|
|
||||||
struct AIS_BLACKLIST_ITEM *prBlack;
|
|
||||||
UINT_16 u2StaCnt;
|
|
||||||
UINT_16 u2AvaliableAC; /* Available Admission Capacity */
|
|
||||||
UINT_8 ucChnlUtilization;
|
|
||||||
UINT_8 ucSNR;
|
|
||||||
BOOLEAN fgSeenProbeResp;
|
|
||||||
BOOLEAN fgExsitBssLoadIE;
|
|
||||||
BOOLEAN fgMultiAnttenaAndSTBC;
|
|
||||||
BOOLEAN fgDeauthLastTime;
|
|
||||||
UINT_32 u4UpdateIdx;
|
|
||||||
#if CFG_SUPPORT_ROAMING_RETRY
|
|
||||||
BOOLEAN fgIsRoamFail;
|
|
||||||
#endif
|
|
||||||
INT_8 cPowerLimit;
|
|
||||||
#if CFG_SUPPORT_RSN_SCORE
|
|
||||||
BOOLEAN fgIsRSNSuitableBss;
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _ROAM_BSS_DESC_T {
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
UINT_8 ucSSIDLen;
|
|
||||||
UINT_8 aucSSID[ELEM_MAX_LEN_SSID];
|
|
||||||
OS_SYSTIME rUpdateTime;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct _SCAN_PARAM_T { /* Used by SCAN FSM */
|
|
||||||
/* Active or Passive */
|
|
||||||
ENUM_SCAN_TYPE_T eScanType;
|
|
||||||
|
|
||||||
/* Network Type */
|
|
||||||
ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex;
|
|
||||||
|
|
||||||
/* Specified SSID Type */
|
|
||||||
UINT_8 ucSSIDType;
|
|
||||||
UINT_8 ucSSIDNum;
|
|
||||||
|
|
||||||
/* Length of Specified SSID */
|
|
||||||
UINT_8 ucSpecifiedSSIDLen[SCN_SSID_MAX_NUM];
|
|
||||||
|
|
||||||
/* Specified SSID */
|
|
||||||
UINT_8 aucSpecifiedSSID[SCN_SSID_MAX_NUM][ELEM_MAX_LEN_SSID];
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
BOOLEAN fgFindSpecificDev; /* P2P: Discovery Protocol */
|
|
||||||
UINT_8 aucDiscoverDevAddr[MAC_ADDR_LEN];
|
|
||||||
BOOLEAN fgIsDevType;
|
|
||||||
P2P_DEVICE_TYPE_T rDiscoverDevType;
|
|
||||||
|
|
||||||
UINT_16 u2PassiveListenInterval;
|
|
||||||
/* TODO: Find Specific Device Type. */
|
|
||||||
#endif /* CFG_SUPPORT_P2P */
|
|
||||||
UINT_16 u2ChannelDwellTime;
|
|
||||||
UINT_16 u2MinChannelDwellTime;
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN];
|
|
||||||
BOOLEAN fgIsObssScan;
|
|
||||||
BOOLEAN fgIsScanV2;
|
|
||||||
|
|
||||||
/* Run time flags */
|
|
||||||
UINT_16 u2ProbeDelayTime;
|
|
||||||
|
|
||||||
/* channel information */
|
|
||||||
ENUM_SCAN_CHANNEL eScanChannel;
|
|
||||||
UINT_8 ucChannelListNum;
|
|
||||||
RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
|
|
||||||
|
|
||||||
/* Feedback information */
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
|
|
||||||
/* Information Element */
|
|
||||||
UINT_16 u2IELen;
|
|
||||||
UINT_8 aucIE[MAX_IE_LENGTH];
|
|
||||||
UINT_8 aucRandomMac[MAC_ADDR_LEN];
|
|
||||||
} SCAN_PARAM_T, *P_SCAN_PARAM_T;
|
|
||||||
|
|
||||||
typedef struct _NLO_PARAM_T { /* Used by SCAN FSM */
|
|
||||||
SCAN_PARAM_T rScanParam;
|
|
||||||
|
|
||||||
/* NLO */
|
|
||||||
BOOLEAN fgStopAfterIndication;
|
|
||||||
UINT_8 ucFastScanIteration;
|
|
||||||
UINT_16 u2FastScanPeriod;
|
|
||||||
UINT_16 u2SlowScanPeriod;
|
|
||||||
|
|
||||||
/* Match SSID */
|
|
||||||
UINT_8 ucMatchSSIDNum;
|
|
||||||
UINT_8 ucMatchSSIDLen[SCN_SSID_MATCH_MAX_NUM];
|
|
||||||
UINT_8 aucMatchSSID[SCN_SSID_MATCH_MAX_NUM][ELEM_MAX_LEN_SSID];
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_SCHED_SCN_SSID_SETS
|
|
||||||
/* SSID set*/
|
|
||||||
UINT_8 ucSSIDNum;
|
|
||||||
UINT_8 ucSSIDLen[CFG_SCAN_HIDDEN_SSID_MAX_NUM];
|
|
||||||
UINT_8 aucSSID[CFG_SCAN_HIDDEN_SSID_MAX_NUM][ELEM_MAX_LEN_SSID];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UINT_8 aucCipherAlgo[SCN_SSID_MATCH_MAX_NUM];
|
|
||||||
UINT_16 au2AuthAlgo[SCN_SSID_MATCH_MAX_NUM];
|
|
||||||
UINT_8 aucChannelHint[SCN_SSID_MATCH_MAX_NUM][SCN_NLO_NETWORK_CHANNEL_NUM];
|
|
||||||
P_BSS_DESC_T aprPendingBssDescToInd[SCN_SSID_MATCH_MAX_NUM];
|
|
||||||
} NLO_PARAM_T, *P_NLO_PARAM_T;
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
|
|
||||||
typedef struct _GSCN_CHANNEL_INFO_T {
|
|
||||||
UINT_8 ucBand;
|
|
||||||
UINT_8 ucChannelNumber; /* Channel Number */
|
|
||||||
UINT_8 ucPassive; /* 0 => active, 1 => passive scan; ignored for DFS */
|
|
||||||
UINT_8 aucReserved[1];
|
|
||||||
|
|
||||||
UINT_32 u4DwellTimeMs; /* dwell time hint */
|
|
||||||
/* Add channel class */
|
|
||||||
} GSCN_CHANNEL_INFO_T, *P_GSCN_CHANNEL_INFO_T;
|
|
||||||
|
|
||||||
typedef struct _GSCAN_BUCKET_T {
|
|
||||||
UINT_16 u2BucketIndex; /* bucket index, 0 based */
|
|
||||||
UINT_8 ucBucketFreqMultiple; /*
|
|
||||||
* desired period, in millisecond;
|
|
||||||
* if this is too low, the firmware should choose to generate
|
|
||||||
* results as fast as it can instead of failing the command
|
|
||||||
*/
|
|
||||||
UINT_8 ucReportFlag;
|
|
||||||
UINT_8 ucMaxBucketFreqMultiple; /* max_period / base_period */
|
|
||||||
UINT_8 ucStepCount;
|
|
||||||
UINT_8 ucNumChannels;
|
|
||||||
UINT_8 aucReserved[1];
|
|
||||||
WIFI_BAND eBand; /* when UNSPECIFIED, use channel list */
|
|
||||||
GSCN_CHANNEL_INFO_T arChannelList[GSCAN_MAX_CHANNELS]; /* channels to scan; these may include DFS channels */
|
|
||||||
} GSCAN_BUCKET_T, *P_GSCAN_BUCKET_T;
|
|
||||||
|
|
||||||
typedef struct _CMD_GSCN_REQ_T {
|
|
||||||
UINT_8 ucFlags;
|
|
||||||
UINT_8 ucNumScnToCache;
|
|
||||||
UINT_8 aucReserved[2];
|
|
||||||
UINT_32 u4BufferThreshold;
|
|
||||||
UINT_32 u4BasePeriod; /* base timer period in ms */
|
|
||||||
UINT_32 u4NumBuckets;
|
|
||||||
UINT_32 u4MaxApPerScan; /* number of APs to store in each scan in the */
|
|
||||||
/* BSSID/RSSI history buffer (keep the highest RSSI APs) */
|
|
||||||
|
|
||||||
GSCAN_BUCKET_T arBucket[GSCAN_MAX_BUCKETS];
|
|
||||||
} CMD_GSCN_REQ_T, *P_CMD_GSCN_REQ_T;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct _CMD_GSCN_SCN_COFIG_T {
|
|
||||||
UINT_8 ucNumApPerScn; /* GSCAN_ATTRIBUTE_NUM_AP_PER_SCAN */
|
|
||||||
UINT_32 u4BufferThreshold; /* GSCAN_ATTRIBUTE_REPORT_THRESHOLD */
|
|
||||||
UINT_32 u4NumScnToCache; /* GSCAN_ATTRIBUTE_NUM_SCANS_TO_CACHE */
|
|
||||||
} CMD_GSCN_SCN_COFIG_T, *P_CMD_GSCN_SCN_COFIG_T;
|
|
||||||
|
|
||||||
typedef struct _CMD_GET_GSCAN_RESULT {
|
|
||||||
UINT_8 ucVersion;
|
|
||||||
UINT_8 aucReserved[2];
|
|
||||||
UINT_8 ucFlush;
|
|
||||||
UINT_32 u4Num;
|
|
||||||
} CMD_GET_GSCAN_RESULT_T, *P_CMD_GET_GSCAN_RESULT_T;
|
|
||||||
|
|
||||||
typedef struct _CMD_BATCH_REQ_T {
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
UINT_8 ucCmd; /* Start/ Stop */
|
|
||||||
UINT_8 ucMScan; /* an integer number of scans per batch */
|
|
||||||
UINT_8 ucBestn; /* an integer number of the max AP to remember per scan */
|
|
||||||
UINT_8 ucRtt; /*
|
|
||||||
* an integer number of highest-strength AP for which we'd like
|
|
||||||
* approximate distance reported
|
|
||||||
*/
|
|
||||||
UINT_8 ucChannel; /* channels */
|
|
||||||
UINT_8 ucChannelType;
|
|
||||||
UINT_8 ucChannelListNum;
|
|
||||||
UINT_8 aucReserved[3];
|
|
||||||
UINT_32 u4Scanfreq; /* an integer number of seconds between scans */
|
|
||||||
CHANNEL_INFO_T arChannelList[32]; /* channels */
|
|
||||||
} CMD_BATCH_REQ_T, *P_CMD_BATCH_REQ_T;
|
|
||||||
|
|
||||||
typedef struct _CMD_SET_PSCAN_PARAM {
|
|
||||||
UINT_8 ucVersion;
|
|
||||||
CMD_NLO_REQ rCmdNloReq;
|
|
||||||
CMD_BATCH_REQ_T rCmdBatchReq;
|
|
||||||
CMD_GSCN_REQ_T rCmdGscnReq;
|
|
||||||
BOOLEAN fgNLOScnEnable;
|
|
||||||
BOOLEAN fgBatchScnEnable;
|
|
||||||
BOOLEAN fgGScnEnable;
|
|
||||||
UINT_32 u4BasePeriod; /* GSCAN_ATTRIBUTE_BASE_PERIOD */
|
|
||||||
} CMD_SET_PSCAN_PARAM, *P_CMD_SET_PSCAN_PARAM;
|
|
||||||
|
|
||||||
typedef struct _SCAN_INFO_T {
|
|
||||||
ENUM_SCAN_STATE_T eCurrentState; /* Store the STATE variable of SCAN FSM */
|
|
||||||
|
|
||||||
OS_SYSTIME rLastScanCompletedTime;
|
|
||||||
|
|
||||||
SCAN_PARAM_T rScanParam;
|
|
||||||
NLO_PARAM_T rNloParam;
|
|
||||||
|
|
||||||
UINT_32 u4NumOfBssDesc;
|
|
||||||
|
|
||||||
UINT_8 aucScanBuffer[SCN_MAX_BUFFER_SIZE];
|
|
||||||
|
|
||||||
LINK_T rBSSDescList;
|
|
||||||
|
|
||||||
LINK_T rFreeBSSDescList;
|
|
||||||
|
|
||||||
LINK_T rPendingMsgList;
|
|
||||||
|
|
||||||
UINT_8 aucScanRoamBuffer[SCN_ROAM_MAX_BUFFER_SIZE];
|
|
||||||
LINK_T rRoamFreeBSSDescList;
|
|
||||||
LINK_T rRoamBSSDescList;
|
|
||||||
|
|
||||||
/* Sparse Channel Detection */
|
|
||||||
BOOLEAN fgIsSparseChannelValid;
|
|
||||||
RF_CHANNEL_INFO_T rSparseChannel;
|
|
||||||
|
|
||||||
/* NLO scanning state tracking */
|
|
||||||
BOOLEAN fgNloScanning;
|
|
||||||
#if CFG_SUPPORT_SCN_PSCN
|
|
||||||
BOOLEAN fgPscnOngoing;
|
|
||||||
BOOLEAN fgGScnConfigSet;
|
|
||||||
BOOLEAN fgGScnParamSet;
|
|
||||||
BOOLEAN fgGScnAction;
|
|
||||||
P_CMD_SET_PSCAN_PARAM prPscnParam;
|
|
||||||
BOOLEAN fgIsPostponeSchedScan;
|
|
||||||
ENUM_POSTPONE_SCHED_SCAN_REQUEST_T eCurrendSchedScanReq;
|
|
||||||
PARAM_SCHED_SCAN_REQUEST rSchedScanRequest;
|
|
||||||
ENUM_PSCAN_STATE_T eCurrentPSCNState;
|
|
||||||
#endif
|
|
||||||
#if CFG_SUPPORT_GSCN
|
|
||||||
P_PARAM_WIFI_GSCAN_FULL_RESULT prGscnFullResult;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UINT_32 u4ScanUpdateIdx;
|
|
||||||
} SCAN_INFO_T, *P_SCAN_INFO_T;
|
|
||||||
|
|
||||||
/* use to save partial scan channel information */
|
|
||||||
typedef struct _PARTIAL_SCAN_INFO_T {
|
|
||||||
UINT_8 ucChannelListNum;
|
|
||||||
RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
|
|
||||||
} PARTIAL_SCAN_INFO, *P_PARTIAL_SCAN_INFO;
|
|
||||||
|
|
||||||
/* Incoming Mailbox Messages */
|
|
||||||
typedef struct _MSG_SCN_SCAN_REQ_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
ENUM_SCAN_TYPE_T eScanType;
|
|
||||||
UINT_8 ucSSIDType; /* BIT(0) wildcard / BIT(1) P2P-wildcard / BIT(2) specific */
|
|
||||||
UINT_8 ucSSIDLength;
|
|
||||||
UINT_8 aucSSID[PARAM_MAX_LEN_SSID];
|
|
||||||
UINT_16 u2ChannelDwellTime; /* In TU. 1024us. */
|
|
||||||
|
|
||||||
UINT_16 u2TimeoutValue; /* ms unit */ /* MULTI SSID */
|
|
||||||
UINT_16 u2MinChannelDwellTime; /* In TU. 1024us. */
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN];
|
|
||||||
|
|
||||||
ENUM_SCAN_CHANNEL eScanChannel;
|
|
||||||
UINT_8 ucChannelListNum;
|
|
||||||
RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
|
|
||||||
UINT_16 u2IELen;
|
|
||||||
UINT_8 aucIE[MAX_IE_LENGTH];
|
|
||||||
} MSG_SCN_SCAN_REQ, *P_MSG_SCN_SCAN_REQ;
|
|
||||||
|
|
||||||
typedef struct _MSG_SCN_SCAN_REQ_V2_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
ENUM_SCAN_TYPE_T eScanType;
|
|
||||||
UINT_8 ucSSIDType; /* BIT(0) wildcard / BIT(1) P2P-wildcard / BIT(2) specific */
|
|
||||||
UINT_8 ucSSIDNum;
|
|
||||||
P_PARAM_SSID_T prSsid;
|
|
||||||
UINT_16 u2ProbeDelay;
|
|
||||||
UINT_16 u2ChannelDwellTime; /* In TU. 1024us. */
|
|
||||||
#if CFG_MULTI_SSID_SCAN
|
|
||||||
UINT_16 u2TimeoutValue; /* ms unit */
|
|
||||||
#endif
|
|
||||||
ENUM_SCAN_CHANNEL eScanChannel;
|
|
||||||
UINT_8 ucChannelListNum;
|
|
||||||
RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
|
|
||||||
UINT_16 u2IELen;
|
|
||||||
UINT_8 aucIE[MAX_IE_LENGTH];
|
|
||||||
UINT_8 aucRandomMac[MAC_ADDR_LEN];
|
|
||||||
} MSG_SCN_SCAN_REQ_V2, *P_MSG_SCN_SCAN_REQ_V2;
|
|
||||||
|
|
||||||
typedef struct _MSG_SCN_SCAN_CANCEL_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
BOOLEAN fgIsChannelExt;
|
|
||||||
#endif
|
|
||||||
} MSG_SCN_SCAN_CANCEL, *P_MSG_SCN_SCAN_CANCEL;
|
|
||||||
|
|
||||||
/* Outgoing Mailbox Messages */
|
|
||||||
typedef enum _ENUM_SCAN_STATUS_T {
|
|
||||||
SCAN_STATUS_DONE = 0,
|
|
||||||
SCAN_STATUS_CANCELLED,
|
|
||||||
SCAN_STATUS_FAIL,
|
|
||||||
SCAN_STATUS_BUSY,
|
|
||||||
SCAN_STATUS_NUM
|
|
||||||
} ENUM_SCAN_STATUS, *P_ENUM_SCAN_STATUS;
|
|
||||||
|
|
||||||
typedef struct _MSG_SCN_SCAN_DONE_T {
|
|
||||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
ENUM_SCAN_STATUS eScanStatus;
|
|
||||||
} MSG_SCN_SCAN_DONE, *P_MSG_SCN_SCAN_DONE;
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_AGPS_ASSIST
|
|
||||||
typedef enum {
|
|
||||||
AGPS_PHY_A,
|
|
||||||
AGPS_PHY_B,
|
|
||||||
AGPS_PHY_G,
|
|
||||||
} AP_PHY_TYPE;
|
|
||||||
|
|
||||||
typedef struct _AGPS_AP_INFO_T {
|
|
||||||
UINT_8 aucBSSID[6];
|
|
||||||
INT_16 i2ApRssi; /* -127..128 */
|
|
||||||
UINT_16 u2Channel; /* 0..256 */
|
|
||||||
AP_PHY_TYPE ePhyType;
|
|
||||||
} AGPS_AP_INFO_T, *P_AGPS_AP_INFO_T;
|
|
||||||
|
|
||||||
typedef struct _AGPS_AP_LIST_T {
|
|
||||||
UINT_8 ucNum;
|
|
||||||
AGPS_AP_INFO_T arApInfo[32];
|
|
||||||
} AGPS_AP_LIST_T, *P_AGPS_AP_LIST_T;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct _CMD_SET_PSCAN_ADD_HOTLIST_BSSID {
|
|
||||||
UINT_8 aucMacAddr[6];
|
|
||||||
UINT_8 ucFlags;
|
|
||||||
UINT_8 aucReserved[5];
|
|
||||||
} CMD_SET_PSCAN_ADD_HOTLIST_BSSID, *P_CMD_SET_PSCAN_ADD_HOTLIST_BSSID;
|
|
||||||
|
|
||||||
typedef struct _CMD_SET_PSCAN_ADD_SWC_BSSID {
|
|
||||||
INT_32 i4RssiLowThreshold;
|
|
||||||
INT_32 i4RssiHighThreshold;
|
|
||||||
UINT_8 aucMacAddr[6];
|
|
||||||
UINT_8 aucReserved[6];
|
|
||||||
} CMD_SET_PSCAN_ADD_SWC_BSSID, *P_CMD_SET_PSCAN_ADD_SWC_BSSID;
|
|
||||||
|
|
||||||
typedef struct _CMD_SET_PSCAN_MAC_ADDR {
|
|
||||||
UINT_8 ucVersion;
|
|
||||||
UINT_8 ucFlags;
|
|
||||||
UINT_8 aucMacAddr[6];
|
|
||||||
UINT_8 aucReserved[8];
|
|
||||||
} CMD_SET_PSCAN_MAC_ADDR, *P_CMD_SET_PSCAN_MAC_ADDR;
|
|
||||||
|
|
||||||
struct RM_BEACON_REPORT_PARAMS {
|
|
||||||
UINT_8 ucChannel;
|
|
||||||
UINT_8 ucRCPI;
|
|
||||||
UINT_8 ucRSNI;
|
|
||||||
UINT_8 ucAntennaID;
|
|
||||||
UINT_8 ucFrameInfo;
|
|
||||||
UINT_8 aucBcnFixedField[12];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct RM_MEASURE_REPORT_ENTRY {
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
/* should greater than sizeof(struct RM_BCN_REPORT) +
|
|
||||||
** sizeof(IE_MEASUREMENT_REPORT_T) + RM_BCN_REPORT_SUB_ELEM_MAX_LENGTH
|
|
||||||
*/
|
|
||||||
UINT_8 aucMeasReport[260];
|
|
||||||
};
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines in scan.c */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID scnInit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID scnUninit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/* BSS-DESC Search */
|
|
||||||
P_BSS_DESC_T scanSearchBssDescByBssid(IN P_ADAPTER_T prAdapter, IN UINT_8 aucBSSID[]);
|
|
||||||
|
|
||||||
P_BSS_DESC_T
|
|
||||||
scanSearchBssDescByBssidAndSsid(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_8 aucBSSID[], IN BOOLEAN fgCheckSsid, IN P_PARAM_SSID_T prSsid);
|
|
||||||
|
|
||||||
P_BSS_DESC_T scanSearchBssDescByTA(IN P_ADAPTER_T prAdapter, IN UINT_8 aucSrcAddr[]);
|
|
||||||
|
|
||||||
P_BSS_DESC_T
|
|
||||||
scanSearchBssDescByTAAndSsid(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_8 aucSrcAddr[], IN BOOLEAN fgCheckSsid, IN P_PARAM_SSID_T prSsid);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_HOTSPOT_2_0
|
|
||||||
P_BSS_DESC_T scanSearchBssDescByBssidAndLatestUpdateTime(IN P_ADAPTER_T prAdapter, IN UINT_8 aucBSSID[]);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* BSS-DESC Search - Alternative */
|
|
||||||
P_BSS_DESC_T
|
|
||||||
scanSearchExistingBssDesc(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_BSS_TYPE_T eBSSType, IN UINT_8 aucBSSID[], IN UINT_8 aucSrcAddr[]);
|
|
||||||
|
|
||||||
P_BSS_DESC_T
|
|
||||||
scanSearchExistingBssDescWithSsid(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_BSS_TYPE_T eBSSType,
|
|
||||||
IN UINT_8 aucBSSID[],
|
|
||||||
IN UINT_8 aucSrcAddr[], IN BOOLEAN fgCheckSsid, IN P_PARAM_SSID_T prSsid);
|
|
||||||
|
|
||||||
/* BSS-DESC Allocation */
|
|
||||||
P_BSS_DESC_T scanAllocateBssDesc(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/* BSS-DESC Removal */
|
|
||||||
VOID scanRemoveBssDescsByPolicy(IN P_ADAPTER_T prAdapter, IN UINT_32 u4RemovePolicy);
|
|
||||||
|
|
||||||
VOID scanRemoveBssDescByBssid(IN P_ADAPTER_T prAdapter, IN UINT_8 aucBSSID[]);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
scanRemoveBssDescByBandAndNetwork(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_BAND_T eBand, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex);
|
|
||||||
|
|
||||||
/* BSS-DESC State Change */
|
|
||||||
VOID scanRemoveConnFlagOfBssDescByBssid(IN P_ADAPTER_T prAdapter, IN UINT_8 aucBSSID[]);
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* BSS-DESC Insertion */
|
|
||||||
P_BSS_DESC_T scanAddToInternalScanResult(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSWRfb, IN P_BSS_DESC_T prBssDesc);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* BSS-DESC Insertion - ALTERNATIVE */
|
|
||||||
P_BSS_DESC_T scanAddToBssDesc(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
WLAN_STATUS scanProcessBeaconAndProbeResp(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSWRfb);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
scanBuildProbeReqFrameCommonIEs(IN P_MSDU_INFO_T prMsduInfo,
|
|
||||||
IN PUINT_8 pucDesiredSsid, IN UINT_32 u4DesiredSsidLen, IN UINT_16 u2SupportedRateSet);
|
|
||||||
|
|
||||||
WLAN_STATUS scanSendProbeReqFrames(IN P_ADAPTER_T prAdapter, IN P_SCAN_PARAM_T prScanParam);
|
|
||||||
|
|
||||||
VOID scanUpdateBssDescForSearch(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
P_BSS_DESC_T scanSearchBssDescByPolicy(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex);
|
|
||||||
|
|
||||||
WLAN_STATUS scanAddScanResult(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
BOOLEAN scanCheckBssIsLegal(IN P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
VOID scanReportBss2Cfg80211(IN P_ADAPTER_T prAdapter, IN ENUM_BSS_TYPE_T eBSSType, IN P_BSS_DESC_T SpecificprBssDesc);
|
|
||||||
|
|
||||||
P_ROAM_BSS_DESC_T scanSearchRoamBssDescBySsid(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
|
|
||||||
P_ROAM_BSS_DESC_T scanAllocateRoamBssDesc(IN P_ADAPTER_T prAdapter);
|
|
||||||
VOID scanAddToRoamBssDesc(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
|
|
||||||
VOID scanSearchBssDescOfRoamSsid(IN P_ADAPTER_T prAdapter);
|
|
||||||
VOID scanRemoveRoamBssDescsByTime(IN P_ADAPTER_T prAdapter, IN UINT_32 u4RemoveTime);
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines in scan_fsm.c */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID scnFsmSteps(IN P_ADAPTER_T prAdapter, IN ENUM_SCAN_STATE_T eNextState);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Command Routines */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID scnSendScanReqExtCh(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID scnSendScanReq(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID scnSendScanReqV2ExtCh(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID scnSendScanReqV2(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* RX Event Handling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID scnEventScanDone(IN P_ADAPTER_T prAdapter, IN P_EVENT_SCAN_DONE prScanDone);
|
|
||||||
|
|
||||||
VOID scnEventNloDone(IN P_ADAPTER_T prAdapter, IN P_EVENT_NLO_DONE_T prNloDone);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Mailbox Message Handling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID scnFsmMsgStart(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID scnFsmMsgAbort(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID scnFsmHandleScanMsg(IN P_ADAPTER_T prAdapter, IN P_MSG_SCN_SCAN_REQ prScanReqMsg);
|
|
||||||
|
|
||||||
VOID scnFsmHandleScanMsgV2(IN P_ADAPTER_T prAdapter, IN P_MSG_SCN_SCAN_REQ_V2 prScanReqMsg);
|
|
||||||
|
|
||||||
VOID scnFsmRemovePendingMsg(IN P_ADAPTER_T prAdapter, IN UINT_8 ucSeqNum, IN UINT_8 ucNetTypeIndex);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Mailbox Message Generation */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID
|
|
||||||
scnFsmGenerateScanDoneMsg(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_8 ucSeqNum, IN UINT_8 ucNetTypeIndex, IN ENUM_SCAN_STATUS eScanStatus);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Query for sparse channel */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
BOOLEAN scnQuerySparseChannel(IN P_ADAPTER_T prAdapter, P_ENUM_BAND_T prSparseBand, PUINT_8 pucSparseChannel);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* OID/IOCTL Handling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
BOOLEAN scnFsmSchedScanRequest(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN scnFsmSchedScanStopRequest(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_SCN_PSCN
|
|
||||||
BOOLEAN scnFsmPSCNAction(IN P_ADAPTER_T prAdapter, IN ENUM_PSCAN_ACT_T ucPscanAct);
|
|
||||||
|
|
||||||
BOOLEAN scnFsmPSCNSetParam(IN P_ADAPTER_T prAdapter, IN P_CMD_SET_PSCAN_PARAM prCmdPscnParam);
|
|
||||||
|
|
||||||
BOOLEAN scnFsmGSCNSetHotlist(IN P_ADAPTER_T prAdapter, IN P_CMD_SET_PSCAN_PARAM prCmdPscnParam);
|
|
||||||
|
|
||||||
BOOLEAN scnFsmPSCNAddSWCBssId(IN P_ADAPTER_T prAdapter, IN P_CMD_SET_PSCAN_ADD_SWC_BSSID prCmdPscnAddSWCBssId);
|
|
||||||
|
|
||||||
BOOLEAN scnFsmPSCNSetMacAddr(IN P_ADAPTER_T prAdapter, IN P_CMD_SET_PSCAN_MAC_ADDR prCmdPscnSetMacAddr);
|
|
||||||
|
|
||||||
BOOLEAN scnCombineParamsIntoPSCN(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_CMD_NLO_REQ prCmdNloReq,
|
|
||||||
IN P_CMD_BATCH_REQ_T prCmdBatchReq,
|
|
||||||
IN P_CMD_GSCN_REQ_T prCmdGscnReq,
|
|
||||||
IN P_CMD_GSCN_SCN_COFIG_T prNewCmdGscnConfig,
|
|
||||||
IN BOOLEAN fgRemoveNLOfromPSCN,
|
|
||||||
IN BOOLEAN fgRemoveBatchSCNfromPSCN, IN BOOLEAN fgRemoveGSCNfromPSCN);
|
|
||||||
|
|
||||||
VOID scnPSCNFsm(IN P_ADAPTER_T prAdapter, IN ENUM_PSCAN_STATE_T eNextPSCNState);
|
|
||||||
#endif
|
|
||||||
#if CFG_NLO_MSP
|
|
||||||
VOID scnSetMspParameterIntoPSCN(IN P_ADAPTER_T prAdapter, IN P_CMD_SET_PSCAN_PARAM prCmdPscnParam);
|
|
||||||
#endif
|
|
||||||
#if CFG_SUPPORT_GSCN
|
|
||||||
BOOLEAN scnSetGSCNParam(IN P_ADAPTER_T prAdapter, IN P_PARAM_WIFI_GSCAN_CMD_PARAMS prCmdGscnParam);
|
|
||||||
|
|
||||||
BOOLEAN scnSetGSCNConfig(IN P_ADAPTER_T prAdapter, IN P_CMD_GSCN_SCN_COFIG_T prCmdGscnScnConfig);
|
|
||||||
|
|
||||||
BOOLEAN scnFsmGetGSCNResult(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_CMD_GET_GSCAN_RESULT_T prGetGscnResultCmd, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
BOOLEAN scnFsmGSCNResults(IN P_ADAPTER_T prAdapter, IN P_EVENT_GSCAN_RESULT_T prEventBuffer);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_AGPS_ASSIST
|
|
||||||
VOID scanReportScanResultToAgps(P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
P_BSS_DESC_T scanSearchBssDescByScoreForAis(P_ADAPTER_T prAdapter);
|
|
||||||
VOID scanGetCurrentEssChnlList(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID scanLogEssResult(P_ADAPTER_T prAdapter);
|
|
||||||
VOID scanInitEssResult(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
#endif /* _SCAN_H */
|
|
||||||
|
|
||||||
VOID scanCollectBeaconReport(IN P_ADAPTER_T prAdapter, PUINT_8 pucIEBuf,
|
|
||||||
UINT_16 u2Length, PUINT_8 pucBssid, struct RM_BEACON_REPORT_PARAMS *prRepParams);
|
|
|
@ -1,117 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _SEC_FSM_H
|
|
||||||
#define _SEC_FSM_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* TKIP CounterMeasure interval for Rejoin to Network. */
|
|
||||||
#define COUNTER_MEASURE_TIMEOUT_INTERVAL_SEC 60
|
|
||||||
|
|
||||||
/* Timeout to wait the EAPoL Error Report frame Send out. */
|
|
||||||
#define EAPOL_REPORT_SEND_TIMEOUT_INTERVAL_SEC 1
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef UINT_32 SEC_STATUS, *P_SEC_STATUS;
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* WPA2 PMKID candicate structure */
|
|
||||||
typedef struct _PMKID_CANDICATE_T {
|
|
||||||
UINT_8 aucBssid[MAC_ADDR_LEN]; /* MAC address */
|
|
||||||
UINT_32 u4PreAuthFlags;
|
|
||||||
} PMKID_CANDICATE_T, *P_PMKID_CANDICATE_T;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef SEC_STATUS(*PFN_SEC_FSM_STATE_HANDLER) (VOID);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define SEC_STATE_TRANSITION_FLAG fgIsTransition
|
|
||||||
#define SEC_NEXT_STATE_VAR eNextState
|
|
||||||
|
|
||||||
#define SEC_STATE_TRANSITION(prAdapter, prSta, eFromState, eToState) \
|
|
||||||
{ secFsmTrans_ ## eFromState ## _to_ ## eToState(prAdapter, prSta); \
|
|
||||||
SEC_NEXT_STATE_VAR = SEC_STATE_ ## eToState; \
|
|
||||||
SEC_STATE_TRANSITION_FLAG = (BOOLEAN)TRUE; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
/* Routines to handle the sec check */
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
/***** Routines in sec_fsm.c *****/
|
|
||||||
VOID secFsmInit(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
|
|
||||||
|
|
||||||
VOID secFsmEventInit(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
|
|
||||||
|
|
||||||
VOID secFsmEventStart(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
|
|
||||||
|
|
||||||
VOID secFsmEventAbort(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
|
|
||||||
|
|
||||||
BOOLEAN secFsmEventPTKInstalled(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
|
|
||||||
|
|
||||||
VOID secFsmEvent2ndEapolTx(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
|
|
||||||
|
|
||||||
VOID secFsmEvent4ndEapolTxDone(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
secFsmEventEapolTxDone(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
|
|
||||||
|
|
||||||
VOID secFsmEventEapolTxTimeout(IN P_ADAPTER_T prAdapter, IN ULONG ulParm);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
secFsmEventDeauthTxDone(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
|
|
||||||
|
|
||||||
VOID secFsmEventStartCounterMeasure(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prSta);
|
|
||||||
|
|
||||||
VOID secFsmEventEndOfCounterMeasure(IN P_ADAPTER_T prAdapter, IN ULONG ulParm);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#endif /* _SEC_FSM_H */
|
|
|
@ -1,372 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
extern UINT_64 u8DrvOwnStart, u8DrvOwnEnd;
|
|
||||||
extern UINT32 u4DrvOwnMax;
|
|
||||||
extern BOOLEAN fgIsUnderSuspend;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Command to TDLS core module */
|
|
||||||
typedef enum _STATS_CMD_CORE_ID {
|
|
||||||
STATS_CORE_CMD_ENV_REQUEST = 0x00
|
|
||||||
} STATS_CMD_CORE_ID;
|
|
||||||
|
|
||||||
typedef enum _STATS_EVENT_HOST_ID {
|
|
||||||
STATS_HOST_EVENT_ENV_REPORT = 0x00,
|
|
||||||
STATS_HOST_EVENT_RX_DROP
|
|
||||||
} STATS_EVENT_HOST_ID;
|
|
||||||
|
|
||||||
#define CFG_ARP BIT(0)
|
|
||||||
#define CFG_DNS BIT(1)
|
|
||||||
#define CFG_TCP BIT(2)
|
|
||||||
#define CFG_UDP BIT(3)
|
|
||||||
#define CFG_EAPOL BIT(4)
|
|
||||||
#define CFG_DHCP BIT(5)
|
|
||||||
#define CFG_ICMP BIT(6)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef struct _STATS_CMD_CORE_T {
|
|
||||||
|
|
||||||
UINT32 u4Command; /* STATS_CMD_CORE_ID */
|
|
||||||
|
|
||||||
UINT8 ucStaRecIdx;
|
|
||||||
UINT8 ucReserved[3];
|
|
||||||
|
|
||||||
UINT32 u4Reserved[4];
|
|
||||||
|
|
||||||
#define STATS_CMD_CORE_RESERVED_SIZE 50
|
|
||||||
union {
|
|
||||||
UINT8 Reserved[STATS_CMD_CORE_RESERVED_SIZE];
|
|
||||||
} Content;
|
|
||||||
|
|
||||||
} STATS_CMD_CORE_T;
|
|
||||||
|
|
||||||
typedef struct _STATS_INFO_ENV_T {
|
|
||||||
|
|
||||||
BOOLEAN fgIsUsed; /* TRUE: used */
|
|
||||||
|
|
||||||
/* ------------------- TX ------------------- */
|
|
||||||
BOOLEAN fgTxIsRtsUsed; /* TRUE: we use RTS/CTS currently */
|
|
||||||
BOOLEAN fgTxIsRtsEverUsed; /* TRUE: we ever use RTS/CTS */
|
|
||||||
BOOLEAN fgTxIsCtsSelfUsed; /* TRUE: we use CTS-self */
|
|
||||||
|
|
||||||
#define STATS_INFO_TX_PARAM_HW_BW40_OFFSET 0
|
|
||||||
#define STATS_INFO_TX_PARAM_HW_SHORT_GI20_OFFSET 1
|
|
||||||
#define STATS_INFO_TX_PARAM_HW_SHORT_GI40_OFFSET 2
|
|
||||||
#define STATS_INFO_TX_PARAM_USE_BW40_OFFSET 3
|
|
||||||
#define STATS_INFO_TX_PARAM_USE_SHORT_GI_OFFSET 4
|
|
||||||
#define STATS_INFO_TX_PARAM_NO_ACK_OFFSET 5
|
|
||||||
UINT_8 ucTxParam;
|
|
||||||
|
|
||||||
UINT_8 ucStaRecIdx;
|
|
||||||
UINT_8 ucReserved1[2];
|
|
||||||
|
|
||||||
UINT32 u4TxDataCntAll; /* total tx count from host */
|
|
||||||
UINT32 u4TxDataCntOK; /* total tx ok count to air */
|
|
||||||
UINT32 u4TxDataCntErr; /* total tx err count to air */
|
|
||||||
|
|
||||||
/* WLAN_STATUS_BUFFER_RETAINED ~ WLAN_STATUS_PACKET_LIFETIME_ERROR */
|
|
||||||
UINT32 u4TxDataCntErrType[6]; /* total tx err count for different type to air */
|
|
||||||
|
|
||||||
UINT_8 ucTxRate1NonHTMax;
|
|
||||||
UINT_8 ucTxRate1HTMax;
|
|
||||||
UINT32 u4TxRateCntNonHT[16]; /* tx done rate */
|
|
||||||
UINT32 u4TxRateCntHT[16]; /* tx done rate */
|
|
||||||
|
|
||||||
UINT_8 ucTxAggBitmap; /* TX BA sessions TID0 ~ TID7 */
|
|
||||||
UINT_8 ucTxPeerAggMaxSize;
|
|
||||||
|
|
||||||
/* ------------------- RX ------------------- */
|
|
||||||
BOOLEAN fgRxIsRtsUsed; /* TRUE: peer uses RTS/CTS currently */
|
|
||||||
BOOLEAN fgRxIsRtsEverUsed; /* TRUE: peer ever uses RTS/CTS */
|
|
||||||
|
|
||||||
UINT_8 ucRcvRcpi;
|
|
||||||
UINT_8 ucHwChanNum;
|
|
||||||
BOOLEAN fgRxIsShortGI;
|
|
||||||
UINT_8 ucReserved2[1];
|
|
||||||
|
|
||||||
UINT32 u4RxDataCntAll; /* total rx count from peer */
|
|
||||||
UINT32 u4RxDataCntErr; /* total rx err count */
|
|
||||||
UINT32 u4RxRateCnt[3][16]; /* [0]:CCK, [1]:OFDM, [2]:MIXED (skip green mode) */
|
|
||||||
|
|
||||||
UINT_8 ucRxAggBitmap; /* RX BA sessions TID0 ~ TID7 */
|
|
||||||
UINT_8 ucRxAggMaxSize;
|
|
||||||
|
|
||||||
#define STATS_INFO_PHY_MODE_CCK 0
|
|
||||||
#define STATS_INFO_PHY_MODE_OFDM 1
|
|
||||||
#define STATS_INFO_PHY_MODE_HT 2
|
|
||||||
#define STATS_INFO_PHY_MODE_VHT 3
|
|
||||||
UINT_8 ucBssSupPhyMode; /* CCK, OFDM, HT, or VHT BSS */
|
|
||||||
|
|
||||||
UINT_8 ucVersion; /* the version of statistics info environment */
|
|
||||||
|
|
||||||
/* ------------------- Delay ------------------- */
|
|
||||||
#define STATS_AIR_DELAY_INT 500 /* 500 byte */
|
|
||||||
|
|
||||||
/* delay in firmware from host to MAC */
|
|
||||||
/* unit: us, for 500B, 1000B, max */
|
|
||||||
UINT32 u4StayIntMaxH2M[3], u4StayIntMinH2M[3], u4StayIntAvgH2M[3];
|
|
||||||
|
|
||||||
/* delay in firmware from MAC to TX done */
|
|
||||||
/* unit: 32us, for 500B, 1000B, max */
|
|
||||||
UINT32 u4AirDelayMax[3], u4AirDelayMin[3], u4AirDelayAvg[3];
|
|
||||||
|
|
||||||
/* delay in firmware from host to TX done */
|
|
||||||
/* unit: us, for 500B, 1000B, max */
|
|
||||||
UINT32 u4StayIntMax[3], u4StayIntMin[3], u4StayIntAvg[3];
|
|
||||||
UINT32 u4StayIntMaxSysTime[3];
|
|
||||||
|
|
||||||
/* delay in firmware from driver to TX done */
|
|
||||||
/* unit: us, for 500B, 1000B, max */
|
|
||||||
UINT32 u4StayIntMaxD2T[3], u4StayIntMinD2T[3], u4StayIntAvgD2T[3];
|
|
||||||
|
|
||||||
/* delay count in firmware from host to TX done */
|
|
||||||
/* u4StayIntByConst: divide 4 fix partitions to count each delay in firmware */
|
|
||||||
#define STATS_STAY_INT_CONST 1 /* 1ms */
|
|
||||||
#define STATS_STAY_INT_CONST_2 5
|
|
||||||
#define STATS_STAY_INT_CONST_3 10
|
|
||||||
#define STATS_STAY_INT_CONST_4 15
|
|
||||||
#define STATS_STAY_INT_CONST_NUM 4
|
|
||||||
UINT32 u4StayIntByConst[STATS_STAY_INT_CONST_NUM];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* u4StayIntMaxPast: past maximum delay in firmware
|
|
||||||
* u4StayIntCnt[]: divide 4 partitions to count each delay in firmware
|
|
||||||
*/
|
|
||||||
#define STATS_STAY_INT_NUM 4
|
|
||||||
UINT32 u4StayIntMaxPast;
|
|
||||||
UINT32 u4StayIntCnt[STATS_STAY_INT_NUM + 1];
|
|
||||||
|
|
||||||
/* delay count in firmware from driver to HIF */
|
|
||||||
/* u4StayIntD2HByConst: divide 4 fix partitions to count each delay in firmware */
|
|
||||||
#define STATS_STAY_INT_D2H_CONST 10 /* 10ms */
|
|
||||||
#define STATS_STAY_INT_D2H_CONST_2 20
|
|
||||||
#define STATS_STAY_INT_D2H_CONST_3 30
|
|
||||||
#define STATS_STAY_INT_D2H_CONST_4 40
|
|
||||||
#define STATS_STAY_INT_D2H_CONST_NUM 4
|
|
||||||
UINT32 u4StayIntD2HByConst[STATS_STAY_INT_D2H_CONST_NUM];
|
|
||||||
|
|
||||||
/* unit: us, for 500B, 1000B, max */
|
|
||||||
UINT32 u4StayIntMaxRx[3], u4StayIntMinRx[3], u4StayIntAvgRx[3];
|
|
||||||
|
|
||||||
/* ------------------- Others ------------------- */
|
|
||||||
UINT32 u4NumOfChanChange; /* total channel change count */
|
|
||||||
UINT32 u4NumOfRetryCnt; /* total TX retry count */
|
|
||||||
UINT32 u4RxFifoFullCnt; /*
|
|
||||||
* counter of the number of the packets which
|
|
||||||
* pass RFCR but are dropped due to FIFO full.
|
|
||||||
*/
|
|
||||||
UINT32 u4PsIntMax; /* maximum time from ps to active */
|
|
||||||
UINT_8 ucNumOfPsChange; /* peer power save change count */
|
|
||||||
UINT_8 ucReserved3[3];
|
|
||||||
|
|
||||||
UINT32 u4ReportSysTime; /* firmware system time */
|
|
||||||
UINT32 u4RxDataCntOk; /* total rx count to hif */
|
|
||||||
|
|
||||||
/* V4 */
|
|
||||||
UINT32 u4RxRateRetryCnt[3][16]; /* [0]:CCK, [1]:OFDM, [2]:MIXED (skip green mode) */
|
|
||||||
UINT32 au4ChanIdleCnt[10]; /* past Channel idle count in unit of slot */
|
|
||||||
|
|
||||||
/* V5 */
|
|
||||||
UINT32 u4BtContUseTime; /* the air time that BT continuous occypy */
|
|
||||||
|
|
||||||
/* V6 */
|
|
||||||
UINT32 u4LastTxOkTime; /* last time we tx ok to the station */
|
|
||||||
|
|
||||||
/* V7 */
|
|
||||||
UINT_8 ucBtWfCoexGrantCnt[8]; /* [0]:WF Rx Grant Cnt[1]: WF Tx Grant Cnt[2]: WF Grant with Priority1 */
|
|
||||||
/* [4]:BT Rx Grant Cnt[5]: BT Tx Grant Cnt[6]: BT Grant with Priority1 */
|
|
||||||
|
|
||||||
/* V8 */
|
|
||||||
UINT_32 u4RxMacFreeDescCnt[6];
|
|
||||||
UINT_32 u4RxHifFreeDescCnt[6];
|
|
||||||
|
|
||||||
/* V9 */
|
|
||||||
#define STATS_MAX_RX_DROP_TYPE 20
|
|
||||||
UINT32 u4NumOfRxDrop[STATS_MAX_RX_DROP_TYPE];
|
|
||||||
|
|
||||||
/* V10 */
|
|
||||||
UINT_32 u4NumOfTxDone; /* number of all packets (data/man/ctrl) tx done */
|
|
||||||
UINT_32 u4NumOfTxDoneFixRate; /* number of done rate = 0 */
|
|
||||||
UINT_32 u4NumOfTxDoneErrRate; /* number of error done rate */
|
|
||||||
UINT_32 u4NumOfNullTxDone; /* number of null tx done */
|
|
||||||
UINT_32 u4NumOfQoSNullTxDone; /* number of QoS-null tx done */
|
|
||||||
|
|
||||||
/* V11 */
|
|
||||||
/* delay in firmware from HIF RX to HIF RX Done */
|
|
||||||
/* unit: us, for 500B, 1000B, max */
|
|
||||||
UINT32 u4StayIntMaxHR2HRD[3], u4StayIntMinHR2HRD[3], u4StayIntAvgHR2HRD[3];
|
|
||||||
|
|
||||||
/* V12 */
|
|
||||||
UINT32 u4AirDelayTotal; /* agg all the air delay */
|
|
||||||
|
|
||||||
/* V13 */
|
|
||||||
UINT32 u4CurrChnlInfo; /* add current channel information */
|
|
||||||
|
|
||||||
UINT_8 ucReserved_rate[4]; /* the field must be the last one */
|
|
||||||
} STATS_INFO_ENV_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#if (CFG_SUPPORT_STATISTICS == 1)
|
|
||||||
|
|
||||||
#define STATS_ENV_REPORT_DETECT statsEnvReportDetect
|
|
||||||
|
|
||||||
#define STATS_RX_REORDER_FALL_AHEAD_INC(__StaRec__) \
|
|
||||||
{ \
|
|
||||||
(__StaRec__)->u4RxReorderFallAheadCnt++; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define STATS_RX_REORDER_FALL_BEHIND_INC(__StaRec__) \
|
|
||||||
{ \
|
|
||||||
(__StaRec__)->u4RxReorderFallBehindCnt++; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define STATS_RX_REORDER_FALL_BEHIND_NO_DROP_INC(__StaRec__) \
|
|
||||||
{ \
|
|
||||||
(__StaRec__)->u4RxReorderFallBehindNoDropCnt++; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define STATS_RX_REORDER_HOLE_INC(__StaRec__) \
|
|
||||||
{ \
|
|
||||||
(__StaRec__)->u4RxReorderHoleCnt++; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define STATS_RX_REORDER_HOLE_TIMEOUT_INC(__StaRec__, __IsTimeout__) \
|
|
||||||
{ \
|
|
||||||
if ((__IsTimeout__) == TRUE) \
|
|
||||||
(__StaRec__)->u4RxReorderHoleTimeoutCnt++; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define STATS_RX_ARRIVE_TIME_RECORD(__SwRfb__) \
|
|
||||||
{ \
|
|
||||||
(__SwRfb__)->rRxTime = StatsEnvTimeGet(); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define STATS_RX_PASS2OS_INC StatsEnvRxDone
|
|
||||||
|
|
||||||
#define STATS_RX_PKT_INFO_DISPLAY StatsRxPktInfoDisplay
|
|
||||||
|
|
||||||
#define STATS_TX_TIME_ARRIVE(__Skb__) \
|
|
||||||
do { \
|
|
||||||
UINT_64 __SysTime; \
|
|
||||||
__SysTime = StatsEnvTimeGet(); /* us */ \
|
|
||||||
GLUE_SET_PKT_XTIME(__Skb__, __SysTime); \
|
|
||||||
} while (FALSE)
|
|
||||||
|
|
||||||
#define STATS_TX_TIME_TO_HIF StatsEnvTxTime2Hif
|
|
||||||
|
|
||||||
#define STATS_TX_PKT_CALLBACK StatsTxPktCallBack
|
|
||||||
#define STATS_TX_PKT_DONE_INFO_DISPLAY StatsTxPktDoneInfoDisplay
|
|
||||||
|
|
||||||
#define STATS_DRIVER_OWN_RESET() \
|
|
||||||
{ \
|
|
||||||
u4DrvOwnMax = 0; \
|
|
||||||
}
|
|
||||||
#define STATS_DRIVER_OWN_START_RECORD() \
|
|
||||||
{ \
|
|
||||||
u8DrvOwnStart = StatsEnvTimeGet(); \
|
|
||||||
}
|
|
||||||
#define STATS_DRIVER_OWN_END_RECORD() \
|
|
||||||
{ \
|
|
||||||
u8DrvOwnEnd = StatsEnvTimeGet(); \
|
|
||||||
}
|
|
||||||
#define STATS_DRIVER_OWN_STOP() \
|
|
||||||
do { \
|
|
||||||
UINT32 __Diff; \
|
|
||||||
__Diff = (UINT32)(u8DrvOwnEnd - u8DrvOwnStart); \
|
|
||||||
if (__Diff > u4DrvOwnMax) \
|
|
||||||
u4DrvOwnMax = __Diff; \
|
|
||||||
} while (FALSE)
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define STATS_ENV_REPORT_DETECT(__Adapter__, __StaRecIndex__)
|
|
||||||
|
|
||||||
#define STATS_RX_REORDER_FALL_AHEAD_INC(__StaRec__)
|
|
||||||
#define STATS_RX_REORDER_FALL_BEHIND_INC(__StaRec__)
|
|
||||||
#define STATS_RX_REORDER_HOLE_INC(__StaRec__)
|
|
||||||
#define STATS_RX_REORDER_HOLE_TIMEOUT_INC(__StaRec__, __IsTimeout__)
|
|
||||||
#define STATS_RX_PASS2OS_INC(__StaRec__, __SwRfb__)
|
|
||||||
#define STATS_RX_PKT_INFO_DISPLAY(__Pkt__)
|
|
||||||
|
|
||||||
#define STATS_TX_TIME_ARRIVE(__Skb__)
|
|
||||||
#define STATS_TX_TIME_TO_HIF(__MsduInfo__, __HwTxHeader__)
|
|
||||||
#define STATS_TX_PKT_CALLBACK(__Pkt__, __fgIsNeedAck__)
|
|
||||||
#define STATS_TX_PKT_DONE_INFO_DISPLAY(__Adapter__, __Event__)
|
|
||||||
|
|
||||||
#define STATS_DRIVER_OWN_RESET()
|
|
||||||
#define STATS_DRIVER_OWN_START_RECORD()
|
|
||||||
#define STATS_DRIVER_OWN_END_RECORD()
|
|
||||||
#define STATS_DRIVER_OWN_STOP()
|
|
||||||
#endif /* CFG_SUPPORT_STATISTICS */
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
VOID statsEnvReportDetect(ADAPTER_T *prAdapter, UINT8 ucStaRecIndex);
|
|
||||||
|
|
||||||
VOID StatsEnvRxDone(STA_RECORD_T *prStaRec, SW_RFB_T *prSwRfb);
|
|
||||||
|
|
||||||
UINT_64 StatsEnvTimeGet(VOID);
|
|
||||||
|
|
||||||
VOID StatsEnvTxTime2Hif(MSDU_INFO_T *prMsduInfo, HIF_TX_HEADER_T *prHwTxHeader);
|
|
||||||
|
|
||||||
VOID statsEventHandle(GLUE_INFO_T *prGlueInfo, UINT8 *prInBuf, UINT32 u4InBufLen);
|
|
||||||
|
|
||||||
VOID StatsRxPktInfoDisplay(UINT_8 *pPkt);
|
|
||||||
|
|
||||||
VOID StatsTxPktCallBack(UINT_8 *pPkt, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
VOID StatsTxPktDoneInfoDisplay(ADAPTER_T *prAdapter, UINT_8 *pucEvtBuf);
|
|
||||||
|
|
||||||
VOID StatsSetCfgTxDone(UINT_16 u2Cfg, BOOLEAN fgSet);
|
|
||||||
|
|
||||||
UINT_16 StatsGetCfgTxDone(VOID);
|
|
||||||
|
|
||||||
/* End of stats.h */
|
|
|
@ -1,189 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _SWCR_H
|
|
||||||
#define _SWCR_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#include "nic_cmd_event.h"
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
extern SWCR_MAP_ENTRY_T g_arRlmArSwCrMap[];
|
|
||||||
#endif
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define SWCR_VAR(x) ((VOID *)&x)
|
|
||||||
#define SWCR_FUNC(x) ((VOID *)x)
|
|
||||||
|
|
||||||
#define SWCR_T_FUNC BIT(7)
|
|
||||||
|
|
||||||
#define SWCR_L_32 3
|
|
||||||
#define SWCR_L_16 2
|
|
||||||
#define SWCR_L_8 1
|
|
||||||
|
|
||||||
#define SWCR_READ 0
|
|
||||||
#define SWCR_WRITE 1
|
|
||||||
|
|
||||||
#define SWCR_MAP_NUM(x) (ARRAY_SIZE(x))
|
|
||||||
|
|
||||||
#define SWCR_CR_NUM 7
|
|
||||||
|
|
||||||
#define SWCR_GET_RW_INDEX(action, rw, index) \
|
|
||||||
do { \
|
|
||||||
index = action & 0x7F; \
|
|
||||||
rw = action >> 7; \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
extern UINT_32 g_au4SwCr[]; /*: 0: command other: data */
|
|
||||||
|
|
||||||
typedef VOID(*PFN_SWCR_RW_T) (P_ADAPTER_T prAdapter, UINT_8 ucRead, UINT_16 u2Addr, UINT_32 *pu4Data);
|
|
||||||
typedef VOID(*PFN_CMD_RW_T) (P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0, UINT_8 ucOpt1);
|
|
||||||
|
|
||||||
typedef struct _SWCR_MAP_ENTRY_T {
|
|
||||||
UINT_16 u2Type;
|
|
||||||
PVOID u4Addr;
|
|
||||||
} SWCR_MAP_ENTRY_T, *P_SWCR_MAP_ENTRY_T;
|
|
||||||
|
|
||||||
typedef struct _SWCR_MOD_MAP_ENTRY_T {
|
|
||||||
UINT_8 ucMapNum;
|
|
||||||
P_SWCR_MAP_ENTRY_T prSwCrMap;
|
|
||||||
} SWCR_MOD_MAP_ENTRY_T, *P_SWCR_MOD_MAP_ENTRY_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_SWCR_DBG_TYPE_T {
|
|
||||||
SWCR_DBG_TYPE_ALL = 0,
|
|
||||||
SWCR_DBG_TYPE_TXRX,
|
|
||||||
SWCR_DBG_TYPE_RX_RATES,
|
|
||||||
SWCR_DBG_TYPE_PS,
|
|
||||||
SWCR_DBG_TYPE_NUM
|
|
||||||
} ENUM_SWCR_DBG_TYPE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_SWCR_DBG_ALL_T {
|
|
||||||
SWCR_DBG_ALL_TX_CNT = 0,
|
|
||||||
SWCR_DBG_ALL_TX_BCN_CNT,
|
|
||||||
SWCR_DBG_ALL_TX_FAILED_CNT,
|
|
||||||
SWCR_DBG_ALL_TX_RETRY_CNT,
|
|
||||||
SWCR_DBG_ALL_TX_AGING_TIMEOUT_CNT,
|
|
||||||
SWCR_DBG_ALL_TX_PS_OVERFLOW_CNT,
|
|
||||||
SWCR_DBG_ALL_TX_MGNT_DROP_CNT,
|
|
||||||
SWCR_DBG_ALL_TX_ERROR_CNT,
|
|
||||||
|
|
||||||
SWCR_DBG_ALL_RX_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_DROP_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_DUP_DROP_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_TYPE_ERROR_DROP_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_CLASS_ERROR_DROP_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_AMPDU_ERROR_DROP_CNT,
|
|
||||||
|
|
||||||
SWCR_DBG_ALL_RX_STATUS_ERROR_DROP_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_FORMAT_ERROR_DROP_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_ICV_ERROR_DROP_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_KEY_ERROR_DROP_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_TKIP_ERROR_DROP_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_MIC_ERROR_DROP_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_BIP_ERROR_DROP_CNT,
|
|
||||||
|
|
||||||
SWCR_DBG_ALL_RX_FCSERR_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_FIFOFULL_CNT,
|
|
||||||
SWCR_DBG_ALL_RX_PFDROP_CNT,
|
|
||||||
|
|
||||||
SWCR_DBG_ALL_PWR_PS_POLL_CNT,
|
|
||||||
SWCR_DBG_ALL_PWR_TRIGGER_NULL_CNT,
|
|
||||||
SWCR_DBG_ALL_PWR_BCN_IND_CNT,
|
|
||||||
SWCR_DBG_ALL_PWR_BCN_TIMEOUT_CNT,
|
|
||||||
SWCR_DBG_ALL_PWR_PM_STATE0,
|
|
||||||
SWCR_DBG_ALL_PWR_PM_STATE1,
|
|
||||||
SWCR_DBG_ALL_PWR_CUR_PS_PROF0,
|
|
||||||
SWCR_DBG_ALL_PWR_CUR_PS_PROF1,
|
|
||||||
|
|
||||||
SWCR_DBG_ALL_AR_STA0_RATE,
|
|
||||||
SWCR_DBG_ALL_AR_STA0_BWGI,
|
|
||||||
SWCR_DBG_ALL_AR_STA0_RX_RATE_RCPI,
|
|
||||||
|
|
||||||
SWCR_DBG_ALL_ROAMING_ENABLE,
|
|
||||||
SWCR_DBG_ALL_ROAMING_ROAM_CNT,
|
|
||||||
SWCR_DBG_ALL_ROAMING_INT_CNT,
|
|
||||||
|
|
||||||
SWCR_DBG_ALL_BB_RX_MDRDY_CNT,
|
|
||||||
SWCR_DBG_ALL_BB_RX_FCSERR_CNT,
|
|
||||||
SWCR_DBG_ALL_BB_CCK_PD_CNT,
|
|
||||||
SWCR_DBG_ALL_BB_OFDM_PD_CNT,
|
|
||||||
SWCR_DBG_ALL_BB_CCK_SFDERR_CNT,
|
|
||||||
SWCR_DBG_ALL_BB_CCK_SIGERR_CNT,
|
|
||||||
SWCR_DBG_ALL_BB_OFDM_TAGERR_CNT,
|
|
||||||
SWCR_DBG_ALL_BB_OFDM_SIGERR_CNT,
|
|
||||||
|
|
||||||
SWCR_DBG_ALL_NUM
|
|
||||||
} ENUM_SWCR_DBG_ALL_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID swCtrlCmdCategory0(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0, UINT_8 ucOpt1);
|
|
||||||
VOID swCtrlCmdCategory1(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0, UINT_8 ucOpt1);
|
|
||||||
VOID testPsCmdCategory0(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0, UINT_8 ucOpt1);
|
|
||||||
VOID testPsCmdCategory1(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0, UINT_8 ucOpt1);
|
|
||||||
void testWNMCmdCategory0(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0, UINT_8 ucOpt1);
|
|
||||||
VOID swCtrlSwCr(P_ADAPTER_T prAdapter, UINT_8 ucRead, UINT_16 u2Addr, UINT_32 *pu4Data);
|
|
||||||
UINT_32 swCrGetDNSRxFilter(VOID);
|
|
||||||
|
|
||||||
/* Support Debug */
|
|
||||||
VOID swCrDebugCheck(P_ADAPTER_T prAdapter, P_CMD_SW_DBG_CTRL_T prCmdSwCtrl);
|
|
||||||
VOID swCrDebugCheckTimeout(IN P_ADAPTER_T prAdapter, ULONG ulParam);
|
|
||||||
VOID swCrDebugQuery(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN PUINT_8 pucEventBuf);
|
|
||||||
VOID swCrDebugQueryTimeout(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
VOID swCrReadWriteCmd(P_ADAPTER_T prAdapter, UINT_8 ucRead, UINT_16 u2Addr, UINT_32 *pu4Data);
|
|
||||||
|
|
||||||
/* Debug Support */
|
|
||||||
VOID swCrFrameCheckEnable(P_ADAPTER_T prAdapter, UINT_32 u4DumpType);
|
|
||||||
VOID swCrDebugInit(P_ADAPTER_T prAdapter);
|
|
||||||
VOID swCrDebugCheckEnable(P_ADAPTER_T prAdapter, BOOLEAN fgIsEnable, UINT_8 ucType, UINT_32 u4Timeout);
|
|
||||||
VOID swCrDebugUninit(P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,322 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _TDLS_H
|
|
||||||
#define _TDLS_H
|
|
||||||
|
|
||||||
#if (CFG_SUPPORT_TDLS == 1)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define TDLS_CFG_CMD_TEST 1
|
|
||||||
#define TDLS_CFG_HT_SUP 1
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
extern int wlanHardStartXmit(struct sk_buff *prSkb, struct net_device *prDev);
|
|
||||||
extern int p2pHardStartXmit(struct sk_buff *prSkb, struct net_device *prDev);
|
|
||||||
extern BOOLEAN flgTdlsTestExtCapElm;
|
|
||||||
extern UINT8 aucTdlsTestExtCapElm[];
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef struct _TDLS_LINK_HIS_OTHERS_T {
|
|
||||||
BOOLEAN fgIsHt; /* TRUE: HT device */
|
|
||||||
|
|
||||||
} TDLS_LINK_HIS_OTHERS_T;
|
|
||||||
|
|
||||||
/* command */
|
|
||||||
typedef enum _TDLS_CMD_ID {
|
|
||||||
TDLS_CMD_TEST_TX_FRAME = 0x00,
|
|
||||||
TDLS_CMD_TEST_RCV_FRAME = 0x01,
|
|
||||||
TDLS_CMD_TEST_PEER_ADD = 0x02,
|
|
||||||
TDLS_CMD_TEST_PEER_UPDATE = 0x03,
|
|
||||||
TDLS_CMD_TEST_DATA_FRAME = 0x04,
|
|
||||||
TDLS_CMD_TEST_RCV_NULL = 0x05,
|
|
||||||
TDLS_CMD_MIB_UPDATE = 0x06,
|
|
||||||
TDLS_CMD_TEST_SKIP_TX_FAIL = 0x07,
|
|
||||||
TDLS_CMD_UAPSD_CONF = 0x08,
|
|
||||||
TDLS_CMD_CH_SW_CONF = 0x09,
|
|
||||||
TDLS_CMD_TEST_SKIP_KEEP_ALIVE = 0x0a,
|
|
||||||
TDLS_CMD_TEST_SKIP_CHSW_TIMEOUT = 0x0b,
|
|
||||||
TDLS_CMD_TEST_TX_TDLS_FRAME = 0x0c,
|
|
||||||
TDLS_CMD_TEST_PROHIBIT_SET_IN_AP = 0x0d,
|
|
||||||
TDLS_CMD_TEST_SCAN_DISABLE = 0x0e,
|
|
||||||
TDLS_CMD_TEST_DATA_FRAME_CONT = 0x0f,
|
|
||||||
TDLS_CMD_TEST_CH_SW_PROHIBIT_SET_IN_AP = 0x10,
|
|
||||||
TDLS_CMD_SETUP_CONF = 0x11,
|
|
||||||
TDLS_CMD_INFO = 0x12,
|
|
||||||
TDLS_CMD_TEST_DELAY = 0x13,
|
|
||||||
TDLS_CMD_KEY_INFO = 0x14,
|
|
||||||
TDLS_CMD_TEST_PTI_TX_FAIL = 0x15
|
|
||||||
} TDLS_CMD_ID;
|
|
||||||
|
|
||||||
typedef enum _TDLS_EVENT_HOST_ID {
|
|
||||||
TDLS_HOST_EVENT_TEAR_DOWN = 0x00, /* TDLS_EVENT_HOST_SUBID_TEAR_DOWN */
|
|
||||||
TDLS_HOST_EVENT_TX_DONE,
|
|
||||||
TDLS_HOST_EVENT_FME_STATUS, /* TDLS_EVENT_HOST_SUBID_SPECIFIC_FRAME */
|
|
||||||
TDLS_HOST_EVENT_STATISTICS
|
|
||||||
} TDLS_EVENT_HOST_ID;
|
|
||||||
|
|
||||||
typedef enum _TDLS_EVENT_HOST_SUBID_TEAR_DOWN {
|
|
||||||
TDLS_HOST_EVENT_TD_PTI_TIMEOUT = 0x00,
|
|
||||||
TDLS_HOST_EVENT_TD_AGE_TIMEOUT,
|
|
||||||
TDLS_HOST_EVENT_TD_PTI_SEND_FAIL,
|
|
||||||
TDLS_HOST_EVENT_TD_PTI_SEND_MAX_FAIL,
|
|
||||||
TDLS_HOST_EVENT_TD_WRONG_NETWORK_IDX,
|
|
||||||
TDLS_HOST_EVENT_TD_NON_STATE3,
|
|
||||||
TDLS_HOST_EVENT_TD_LOST_TEAR_DOWN
|
|
||||||
} TDLS_EVENT_HOST_SUBID_TEAR_DOWN;
|
|
||||||
|
|
||||||
typedef enum _TDLS_EVENT_HOST_SUBID_SPECIFIC_FRAME {
|
|
||||||
TDLS_HOST_EVENT_SF_BA,
|
|
||||||
TDLS_HOST_EVENT_SF_BA_OK,
|
|
||||||
TDLS_HOST_EVENT_SF_BA_DECLINE,
|
|
||||||
TDLS_HOST_EVENT_SF_BA_PEER,
|
|
||||||
TDLS_HOST_EVENT_SF_BA_RSP_OK,
|
|
||||||
TDLS_HOST_EVENT_SF_BA_RSP_DECLINE
|
|
||||||
} TDLS_EVENT_HOST_SUBID_SPECIFIC_FRAME;
|
|
||||||
|
|
||||||
/* payload specific type in the LLC/SNAP header */
|
|
||||||
#define TDLS_FRM_PAYLOAD_TYPE 2
|
|
||||||
|
|
||||||
#define TDLS_FRM_CATEGORY 12
|
|
||||||
|
|
||||||
typedef enum _TDLS_FRM_ACTION_ID {
|
|
||||||
TDLS_FRM_ACTION_SETUP_REQ = 0x00,
|
|
||||||
TDLS_FRM_ACTION_SETUP_RSP,
|
|
||||||
TDLS_FRM_ACTION_CONFIRM,
|
|
||||||
TDLS_FRM_ACTION_TEARDOWN,
|
|
||||||
TDLS_FRM_ACTION_PTI,
|
|
||||||
TDLS_FRM_ACTION_CHAN_SWITCH_REQ,
|
|
||||||
TDLS_FRM_ACTION_CHAN_SWITCH_RSP,
|
|
||||||
TDLS_FRM_ACTION_PEER_PSM_REQ,
|
|
||||||
TDLS_FRM_ACTION_PEER_PSM_RSP,
|
|
||||||
TDLS_FRM_ACTION_PTI_RSP, /* 0x09 */
|
|
||||||
TDLS_FRM_ACTION_DISCOVERY_REQ,
|
|
||||||
|
|
||||||
TDLS_FRM_ACTION_EVENT_TEAR_DOWN_TO_SUPPLICANT = 0x30,
|
|
||||||
|
|
||||||
TDLS_FRM_DATA_TEST_DATA = 0x80
|
|
||||||
} TDLS_FRM_ACTION_ID;
|
|
||||||
|
|
||||||
#define TDLS_FRM_ACTION_DISCOVERY_RESPONSE 14
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* 7.3.2.62 Link Identifier element */
|
|
||||||
#define ELEM_ID_LINK_IDENTIFIER 101
|
|
||||||
#define ELEM_LEN_LINK_IDENTIFIER 18
|
|
||||||
|
|
||||||
typedef struct _IE_LINK_IDENTIFIER_T {
|
|
||||||
UINT_8 ucId;
|
|
||||||
UINT_8 ucLength;
|
|
||||||
UINT_8 aBSSID[6];
|
|
||||||
UINT_8 aInitiator[6];
|
|
||||||
UINT_8 aResponder[6];
|
|
||||||
} __KAL_ATTRIB_PACKED__ IE_LINK_IDENTIFIER_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_FRAME_HEADER {
|
|
||||||
UINT_8 ucPayLoadType;
|
|
||||||
UINT_8 ucCategory;
|
|
||||||
UINT_8 ucAction;
|
|
||||||
} __KAL_ATTRIB_PACKED__ TDLS_FRAME_HEADER_T;
|
|
||||||
|
|
||||||
|
|
||||||
#define TDLS_LINK_IDENTIFIER_IE(__ie__) ((IE_LINK_IDENTIFIER_T *)(__ie__))
|
|
||||||
|
|
||||||
/* test command use */
|
|
||||||
typedef struct _PARAM_CUSTOM_TDLS_CMD_STRUCT_T {
|
|
||||||
|
|
||||||
UINT_8 ucFmeType; /* TDLS_FRM_ACTION_ID */
|
|
||||||
|
|
||||||
UINT_8 ucToken;
|
|
||||||
UINT_16 u2Cap;
|
|
||||||
|
|
||||||
/* bit0: TDLS, bit1: Peer U-APSD Buffer, bit2: Channel Switching */
|
|
||||||
#define TDLS_EX_CAP_PEER_UAPSD BIT(0)
|
|
||||||
#define TDLS_EX_CAP_CHAN_SWITCH BIT(1)
|
|
||||||
#define TDLS_EX_CAP_TDLS BIT(2)
|
|
||||||
UINT_8 ucExCap;
|
|
||||||
|
|
||||||
UINT_8 arSupRate[4];
|
|
||||||
UINT_8 arSupChan[4];
|
|
||||||
|
|
||||||
UINT_32 u4Timeout;
|
|
||||||
|
|
||||||
#define TDLS_FME_MAC_ADDR_LEN 6
|
|
||||||
UINT_8 arRspAddr[TDLS_FME_MAC_ADDR_LEN];
|
|
||||||
UINT_8 arBssid[TDLS_FME_MAC_ADDR_LEN];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Linux Kernel-3.10
|
|
||||||
* struct station_parameters {
|
|
||||||
* const u8 *supported_rates;
|
|
||||||
* struct net_device *vlan;
|
|
||||||
* u32 sta_flags_mask, sta_flags_set;
|
|
||||||
* u32 sta_modify_mask;
|
|
||||||
* int listen_interval;
|
|
||||||
* u16 aid;
|
|
||||||
* u8 supported_rates_len;
|
|
||||||
* u8 plink_action;
|
|
||||||
* u8 plink_state;
|
|
||||||
* const struct ieee80211_ht_cap *ht_capa;
|
|
||||||
* const struct ieee80211_vht_cap *vht_capa;
|
|
||||||
* u8 uapsd_queues;
|
|
||||||
* u8 max_sp;
|
|
||||||
* enum nl80211_mesh_power_mode local_pm;
|
|
||||||
* u16 capability;
|
|
||||||
* const u8 *ext_capab;
|
|
||||||
* u8 ext_capab_len;
|
|
||||||
* };
|
|
||||||
*/
|
|
||||||
struct ieee80211_ht_cap rHtCapa;
|
|
||||||
struct ieee80211_vht_cap rVhtCapa; /* LINUX_KERNEL_VERSION >= 3.10.0 */
|
|
||||||
struct station_parameters rPeerInfo;
|
|
||||||
|
|
||||||
} PARAM_CUSTOM_TDLS_CMD_STRUCT_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_MGMT_TX_INFO {
|
|
||||||
ENUM_NETWORK_TYPE_INDEX_T eNetworkType;
|
|
||||||
UINT8 aucPeer[6];
|
|
||||||
UINT8 ucActionCode;
|
|
||||||
UINT8 ucDialogToken;
|
|
||||||
UINT16 u2StatusCode;
|
|
||||||
UINT32 u4SecBufLen;
|
|
||||||
UINT8 aucSecBuf[1000];
|
|
||||||
} TDLS_MGMT_TX_INFO;
|
|
||||||
|
|
||||||
enum MTK_TDLS_STATUS {
|
|
||||||
MTK_TDLS_NOT_SETUP,
|
|
||||||
MTK_TDLS_SETUP_INPROCESS,
|
|
||||||
MTK_TDLS_SETUP_COMPLETE,
|
|
||||||
MTK_TDLS_SETUP_TEARDOWN,
|
|
||||||
MTK_TDLS_LINK_ENABLE,
|
|
||||||
MTK_TDLS_LINK_DOWN,
|
|
||||||
MTK_TDLS_LINK_DISABLE,
|
|
||||||
MTK_TDLS_SETUP_NUM
|
|
||||||
};
|
|
||||||
|
|
||||||
enum MTK_TDLS_ROLE {
|
|
||||||
MTK_TDLS_ROLE_IDLE,
|
|
||||||
MTK_TDLS_ROLE_RESPONDER,
|
|
||||||
MTK_TDLS_ROLE_INITOR,
|
|
||||||
MTK_TDLS_ROLE_NUM
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ksta_info {
|
|
||||||
struct ksta_info *pNext; /* next entry in sta list */
|
|
||||||
UCHAR aucAddr[6];
|
|
||||||
ENUM_NETWORK_TYPE_INDEX_T ucNetworkType;
|
|
||||||
UINT_32 u4Throughput;
|
|
||||||
UINT_32 u4RxThroughput;
|
|
||||||
ULONG ulTxBytes;
|
|
||||||
ULONG ulRxBytes;
|
|
||||||
enum MTK_TDLS_STATUS eTdlsStatus;
|
|
||||||
UINT32 u4SetupFailCount;
|
|
||||||
enum MTK_TDLS_ROLE eTdlsRole;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define SAMPLING_UT (2 * HZ)
|
|
||||||
#define TDLS_SETUP_TIMEOUT (4)
|
|
||||||
#define TDLS_MONITOR_UT (2)
|
|
||||||
/* TDLS setup threshold if TX throughput > the THD */
|
|
||||||
#define TDLS_SETUP_THD (1000)
|
|
||||||
#define TDLS_SETUP_COUNT (4)
|
|
||||||
#define TDLS_TEARDOWN_THD (500)
|
|
||||||
#define TDLS_TEARDOWN_RX_THD (100)
|
|
||||||
#define TDLS_LINK_ENABLED(prSta) (prSta->eTdlsStatus == MTK_TDLS_LINK_ENABLE)
|
|
||||||
|
|
||||||
enum sta_op {
|
|
||||||
STA_OP_FREE,
|
|
||||||
STA_OP_RESET,
|
|
||||||
STA_OP_GET_MAX_TP,
|
|
||||||
STA_OP_UPDATE_TX,
|
|
||||||
STA_OP_NUM
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#define STA_HASH_SIZE 256
|
|
||||||
#define STA_HASH(prSta) (prSta[5])
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* check any TDLS link */
|
|
||||||
#define TDLS_IS_NO_LINK_GOING(__GlueInfo__) \
|
|
||||||
((__GlueInfo__)->rTdlsLink.cLinkCnt == 0)
|
|
||||||
|
|
||||||
/* increase TDLS link count */
|
|
||||||
#define TDLS_LINK_INCREASE(__GlueInfo__) \
|
|
||||||
((__GlueInfo__)->rTdlsLink.cLinkCnt++)
|
|
||||||
|
|
||||||
/* decrease TDLS link count */
|
|
||||||
#define TDLS_LINK_DECREASE(__GlueInfo__) \
|
|
||||||
do { \
|
|
||||||
if ((__GlueInfo__)->rTdlsLink.cLinkCnt > 0) \
|
|
||||||
(__GlueInfo__)->rTdlsLink.cLinkCnt--; \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
/* get TDLS link count */
|
|
||||||
#define TDLS_LINK_COUNT(__GlueInfo__) \
|
|
||||||
((__GlueInfo__)->rTdlsLink.cLinkCnt)
|
|
||||||
|
|
||||||
/* reset TDLS link count */
|
|
||||||
#define TDLS_LINK_COUNT_RESET(__GlueInfo__) \
|
|
||||||
((__GlueInfo__)->rTdlsLink.cLinkCnt = 0)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Note: these functions are used only in tdls module, not other modules */
|
|
||||||
UINT_32 TdlsFrameGeneralIeAppend(ADAPTER_T *prAdapter, STA_RECORD_T *prStaRec, UINT_16 u2StatusCode, UINT_8 *pPkt);
|
|
||||||
|
|
||||||
TDLS_STATUS
|
|
||||||
TdlsDataFrameSend(ADAPTER_T *prAdapter,
|
|
||||||
STA_RECORD_T *prStaRec,
|
|
||||||
TDLS_MGMT_TX_INFO *prMsduInfo);
|
|
||||||
INT_32 MTKAutoTdlsP2P(P_GLUE_INFO_T prGlueInfo, P_NATIVE_PACKET prPacket);
|
|
||||||
BOOLEAN MTKTdlsEnvP2P(P_ADAPTER_T prAdapter);
|
|
||||||
VOID MTKTdlsSetup(P_GLUE_INFO_T prGlueInfo, struct ksta_info *prSta);
|
|
||||||
VOID MTKTdlsTearDown(P_GLUE_INFO_T prGlueInfo, struct ksta_info *prSta, CHAR *reason);
|
|
||||||
VOID MTKTdlsApStaUpdateTxRxStatus(P_GLUE_INFO_T prGlueInfo, unsigned long tx_bytes,
|
|
||||||
unsigned long rx_bytes, const u8 *addr);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* CFG_SUPPORT_TDLS */
|
|
||||||
|
|
||||||
#endif /* _TDLS_H */
|
|
|
@ -1,81 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _WAPI_H
|
|
||||||
#define _WAPI_H
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_WAPI
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define WAPI_CIPHER_SUITE_WPI 0x01721400 /* WPI_SMS4 */
|
|
||||||
#define WAPI_AKM_SUITE_802_1X 0x01721400 /* WAI */
|
|
||||||
#define WAPI_AKM_SUITE_PSK 0x02721400 /* WAI_PSK */
|
|
||||||
|
|
||||||
#define ELEM_ID_WAPI 68 /* WAPI IE */
|
|
||||||
|
|
||||||
#define WAPI_IE(fp) ((P_WAPI_INFO_ELEM_T) fp)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
BOOLEAN wapiParseWapiIE(IN P_WAPI_INFO_ELEM_T prInfoElem, OUT P_WAPI_INFO_T prWapiInfo);
|
|
||||||
|
|
||||||
BOOLEAN wapiPerformPolicySelection(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBss);
|
|
||||||
|
|
||||||
/* BOOLEAN */
|
|
||||||
/* wapiUpdateTxKeyIdx ( */
|
|
||||||
/* IN P_STA_RECORD_T prStaRec, */
|
|
||||||
/* IN UINT_8 ucWlanIdx */
|
|
||||||
/* ); */
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
#endif /* _WAPI_H */
|
|
|
@ -1,86 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _WLAN_TYPEDEF_H
|
|
||||||
#define _WLAN_TYPEDEF_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Type definition for BSS_INFO_T structure, to describe the attributes used in a
|
|
||||||
* common BSS.
|
|
||||||
*/
|
|
||||||
typedef struct _BSS_INFO_T BSS_INFO_T, *P_BSS_INFO_T;
|
|
||||||
|
|
||||||
typedef BSS_INFO_T AIS_BSS_INFO_T, *P_AIS_BSS_INFO_T;
|
|
||||||
typedef BSS_INFO_T P2P_BSS_INFO_T, *P_P2P_BSS_INFO_T;
|
|
||||||
typedef BSS_INFO_T BOW_BSS_INFO_T, *P_BOW_BSS_INFO_T;
|
|
||||||
|
|
||||||
typedef struct _AIS_SPECIFIC_BSS_INFO_T AIS_SPECIFIC_BSS_INFO_T, *P_AIS_SPECIFIC_BSS_INFO_T;
|
|
||||||
typedef struct _P2P_SPECIFIC_BSS_INFO_T P2P_SPECIFIC_BSS_INFO_T, *P_P2P_SPECIFIC_BSS_INFO_T;
|
|
||||||
typedef struct _BOW_SPECIFIC_BSS_INFO_T BOW_SPECIFIC_BSS_INFO_T, *P_BOW_SPECIFIC_BSS_INFO_T;
|
|
||||||
/* CFG_SUPPORT_WFD */
|
|
||||||
typedef struct _WFD_CFG_SETTINGS_T WFD_CFG_SETTINGS_T, *P_WFD_CFG_SETTINGS_T;
|
|
||||||
|
|
||||||
typedef struct _WFD_DBG_CFG_SETTINGS_T WFD_DBG_CFG_SETTINGS_T, *P_WFD_DBG_CFG_SETTINGS_T;
|
|
||||||
|
|
||||||
/* BSS related structures */
|
|
||||||
/* Type definition for BSS_DESC_T structure, to describe parameter sets of a particular BSS */
|
|
||||||
typedef struct _BSS_DESC_T BSS_DESC_T, *P_BSS_DESC_T, **PP_BSS_DESC_T;
|
|
||||||
typedef struct _ROAM_BSS_DESC_T ROAM_BSS_DESC_T, *P_ROAM_BSS_DESC_T, **PP_ROAM_BSS_DESC_T;
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_HOTSPOT_2_0
|
|
||||||
typedef struct _HS20_INFO_T HS20_INFO_T, *P_HS20_INFO_T;
|
|
||||||
#endif /* CFG_SUPPORT_HOTSPOT_2_0 */
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#endif /* _WLAN_TYPEDEF_H */
|
|
|
@ -1,212 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef WMM_HDR_H
|
|
||||||
#define WMM_HDR_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define VENDOR_OUI_TYPE_TSRS 8
|
|
||||||
#define VENDOR_OUI_TYPE_TSM 7
|
|
||||||
#define VENDOR_OUI_TYPE_EDCALIFE 9
|
|
||||||
#define WLAN_MAC_ACTION_ADDTS_LEN (WLAN_MAC_MGMT_HEADER_HTC_LEN + 66)
|
|
||||||
#define WLAN_MAC_ACTION_DELTS_LEN (WLAN_MAC_MGMT_HEADER_HTC_LEN + 7)
|
|
||||||
#define TSPEC_POLICY_CHECK_INTERVAL 2500 /* unit ms */
|
|
||||||
|
|
||||||
#define WMM_TS_STATUS_ADMISSION_ACCEPTED 0
|
|
||||||
#define WMM_TS_STATUS_ADDTS_INVALID_PARAM 1
|
|
||||||
#define WMM_TS_STATUS_ADDTS_REFUSED 3
|
|
||||||
#define WMM_TS_STATUS_ASSOC_QOS_FAILED 0xc8
|
|
||||||
#define WMM_TS_STATUS_POLICY_CONFIG_REFUSED 0xc9
|
|
||||||
#define WMM_TS_STATUS_ASSOC_INSUFFICIENT_BANDWIDTH 0xca
|
|
||||||
#define WMM_TS_STATUS_ASSOC_INVALID_PARAM 0xcb
|
|
||||||
|
|
||||||
/*
|
|
||||||
** In WMM, TSs are identified with TIDs values 0 through 7. Any TID may map onto any
|
|
||||||
** UP and thus onto any AC, however for each AC used between an RA and TA, only the
|
|
||||||
** following combinations are valid:
|
|
||||||
** No TS, One uplink TS, one Download link TS, one uplink and one uplink TS, one
|
|
||||||
** bi-directional TS.
|
|
||||||
** so maximum 8 TSs are allowed in a RA & TA context.
|
|
||||||
*/
|
|
||||||
#define WMM_TSPEC_ID_NUM 8
|
|
||||||
|
|
||||||
/*WMM-2.2.11 WMM TSPEC IE*/
|
|
||||||
#define ELEM_MAX_LEN_WMM_TSPEC 61
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
enum WMM_ADDTS_STATUS {
|
|
||||||
ADDTS_ACCEPTED = 0,
|
|
||||||
ADDTS_INVALID_PARAMS = 1,
|
|
||||||
ADDTS_REFUSED = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
enum TSPEC_OP_CODE {
|
|
||||||
TX_ADDTS_REQ,
|
|
||||||
RX_ADDTS_RSP,
|
|
||||||
TX_DELTS_REQ,
|
|
||||||
RX_DELTS_REQ,
|
|
||||||
DISC_DELTS_REQ,
|
|
||||||
UPDATE_TS_REQ
|
|
||||||
};
|
|
||||||
|
|
||||||
enum QOS_TS_STATE {
|
|
||||||
QOS_TS_INACTIVE,
|
|
||||||
QOS_TS_ACTIVE,
|
|
||||||
QOS_TS_SETUPING,
|
|
||||||
QOS_TS_STATE_MAX
|
|
||||||
};
|
|
||||||
|
|
||||||
enum TSPEC_DIR {
|
|
||||||
UPLINK_TS = 0,
|
|
||||||
DOWNLINK_TS = 1,
|
|
||||||
BI_DIR_TS = 3
|
|
||||||
};
|
|
||||||
|
|
||||||
struct TSPEC_INFO {
|
|
||||||
TIMER_T rAddTsTimer;
|
|
||||||
UINT_8 ucToken;
|
|
||||||
BOOLEAN fgUapsd;
|
|
||||||
ENUM_ACI_T eAC:8;
|
|
||||||
enum TSPEC_DIR eDir:8;
|
|
||||||
enum QOS_TS_STATE eState:8;
|
|
||||||
/* debug information */
|
|
||||||
UINT_16 u2MediumTime;
|
|
||||||
UINT_32 u4PhyRate;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct TSM_TRIGGER_COND {
|
|
||||||
UINT_8 ucCondition;
|
|
||||||
UINT_8 ucAvgErrThreshold;
|
|
||||||
UINT_8 ucConsecutiveErr;
|
|
||||||
UINT_8 ucDelayThreshold;
|
|
||||||
UINT_8 ucMeasureCount;
|
|
||||||
/* In this time frame, for one condition, only once report is allowed */
|
|
||||||
UINT_8 ucTriggerTimeout;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct RM_TSM_REQ {
|
|
||||||
UINT_16 u2Duration; /* unit: TUs */
|
|
||||||
UINT_8 aucPeerAddr[MAC_ADDR_LEN];
|
|
||||||
UINT_8 ucToken;
|
|
||||||
UINT_8 ucTID;
|
|
||||||
UINT_8 ucACI;
|
|
||||||
UINT_8 ucB0Range; /* 2^(i-1)*ucB0Range =< delay < 2^i * ucB0Range */
|
|
||||||
struct TSM_TRIGGER_COND rTriggerCond;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ACTIVE_RM_TSM_REQ {
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
struct RM_TSM_REQ *prTsmReq;
|
|
||||||
TIMER_T rTsmTimer;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct WMM_INFO {
|
|
||||||
/* A TS is identified uniquely by its TID value within the context of the RA and TA
|
|
||||||
** the index is TID for this array
|
|
||||||
*/
|
|
||||||
struct TSPEC_INFO arTsInfo[WMM_TSPEC_ID_NUM];
|
|
||||||
LINK_T rActiveTsmReq;
|
|
||||||
OS_SYSTIME rTriggeredTsmRptTime;
|
|
||||||
TIMER_T rTsmTimer;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct WMM_ADDTS_RSP_STEP_PARAM {
|
|
||||||
UINT_8 ucDlgToken;
|
|
||||||
UINT_8 ucStatusCode;
|
|
||||||
UINT_8 ucApsd;
|
|
||||||
enum TSPEC_DIR eDir:8;
|
|
||||||
UINT_16 u2EdcaLifeTime;
|
|
||||||
UINT_16 u2MediumTime;
|
|
||||||
UINT_32 u4PhyRate;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct MSG_TS_OPERATE {
|
|
||||||
MSG_HDR_T rMsgHdr;
|
|
||||||
enum TSPEC_OP_CODE eOpCode;
|
|
||||||
UINT_8 ucTid;
|
|
||||||
PARAM_QOS_TSPEC rTspecParam;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern UINT_8 const aucUp2ACIMap[8];
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define WMM_TSINFO_TRAFFIC_TYPE(tsinfo) (tsinfo & BIT(0))
|
|
||||||
#define WMM_TSINFO_TSID(tsinfo) ((tsinfo & BITS(1, 4)) >> 1)
|
|
||||||
#define WMM_TSINFO_DIR(tsinfo) ((tsinfo & BITS(5, 6)) >> 5)
|
|
||||||
#define WMM_TSINFO_AC(tsinfo) ((tsinfo & BITS(7, 8)) >> 7)
|
|
||||||
#define WMM_TSINFO_PSB(tsinfo) ((tsinfo & BIT(10)) >> 10)
|
|
||||||
#define WMM_TSINFO_UP(tsinfo) ((tsinfo & BITS(11, 13)) >> 11)
|
|
||||||
|
|
||||||
#define TSM_TRIGGER_CONDITION_ALL BITS(0, 2)
|
|
||||||
#define TSM_TRIGGER_AVG BIT(0)
|
|
||||||
#define TSM_TRIGGER_CONSECUTIVE BIT(1)
|
|
||||||
#define TSM_TIRGGER_DELAY BIT(2)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
VOID wmmFillTsinfo(P_PARAM_QOS_TSINFO prTsInfo, P_UINT_8 pucTsInfo);
|
|
||||||
VOID wmmSetupTspecTimeOut(P_ADAPTER_T prAdapter, ULONG ulParam);
|
|
||||||
void wmmStartTsmMeasurement(P_ADAPTER_T prAdapter, ULONG ulParam);
|
|
||||||
VOID wmmRunEventTSOperate(P_ADAPTER_T prAdapter, P_MSG_HDR_T prMsgHdr);
|
|
||||||
BOOLEAN wmmParseQosAction(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb);
|
|
||||||
BOOLEAN
|
|
||||||
wmmParseTspecIE(P_ADAPTER_T prAdapter, PUINT_8 pucIE, P_PARAM_QOS_TSPEC prTspec);
|
|
||||||
VOID
|
|
||||||
wmmTspecSteps(P_ADAPTER_T prAdapter, UINT_8 ucTid,
|
|
||||||
enum TSPEC_OP_CODE eOpCode, VOID *prStepParams);
|
|
||||||
UINT_8 wmmHasActiveTspec(struct WMM_INFO *prWmmInfo);
|
|
||||||
VOID wmmNotifyDisconnected(P_ADAPTER_T prAdapter);
|
|
||||||
void wmmComposeTsmRpt(P_ADAPTER_T prAdapter, P_CMD_INFO_T prCmdInfo, PUINT_8 pucEventBuf);
|
|
||||||
VOID wmmInit(IN P_ADAPTER_T prAdapter);
|
|
||||||
VOID wmmUnInit(IN P_ADAPTER_T prAdapter);
|
|
||||||
BOOLEAN wmmTsmIsOngoing(P_ADAPTER_T prAdapter);
|
|
||||||
VOID wmmNotifyDisconnected(P_ADAPTER_T prAdapter);
|
|
||||||
VOID wmmRemoveAllTsmMeasurement(P_ADAPTER_T prAdapter, BOOLEAN fgOnlyTriggered);
|
|
||||||
UINT_8 wmmCalculateUapsdSetting(P_ADAPTER_T prAdapter);
|
|
||||||
UINT_32 wmmDumpActiveTspecs(P_ADAPTER_T prAdapter, PUINT_8 pucBuffer, UINT_16 u2BufferLen);
|
|
||||||
#endif
|
|
|
@ -1,137 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _WNM_H
|
|
||||||
#define _WNM_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _TIMINGMSMT_PARAM_T {
|
|
||||||
BOOLEAN fgInitiator;
|
|
||||||
UINT_8 ucTrigger;
|
|
||||||
UINT_8 ucDialogToken; /* Dialog Token */
|
|
||||||
UINT_8 ucFollowUpDialogToken; /* Follow Up Dialog Token */
|
|
||||||
UINT_32 u4ToD; /* Timestamp of Departure [10ns] */
|
|
||||||
UINT_32 u4ToA; /* Timestamp of Arrival [10ns] */
|
|
||||||
} TIMINGMSMT_PARAM_T, *P_TIMINGMSMT_PARAM_T;
|
|
||||||
|
|
||||||
struct BSS_TRANSITION_MGT_PARAM_T {
|
|
||||||
/* for Query */
|
|
||||||
UINT_8 ucDialogToken;
|
|
||||||
UINT_8 ucQueryReason;
|
|
||||||
/* for Request */
|
|
||||||
UINT_8 ucRequestMode;
|
|
||||||
UINT_8 ucValidityInterval;
|
|
||||||
UINT_16 u2DisassocTimer;
|
|
||||||
UINT_16 u2TermDuration;
|
|
||||||
UINT_8 aucTermTsf[8];
|
|
||||||
UINT_8 ucSessionURLLen;
|
|
||||||
UINT_8 aucSessionURL[255];
|
|
||||||
/* for Respone */
|
|
||||||
UINT_8 ucStatusCode;
|
|
||||||
UINT_8 ucTermDelay;
|
|
||||||
UINT_8 aucTargetBssid[MAC_ADDR_LEN];
|
|
||||||
UINT_8 aucOurNeighborBss[CFG_MAX_NUM_BSS_LIST];
|
|
||||||
PUINT_8 pucPeerNeighborBss;
|
|
||||||
UINT_16 u2OurNeighborBssLen;
|
|
||||||
UINT_16 u2PeerNeighborBssLen;
|
|
||||||
};
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define BTM_REQ_MODE_CAND_INCLUDED_BIT BIT(0)
|
|
||||||
#define BTM_REQ_MODE_ABRIDGED BIT(1)
|
|
||||||
#define BTM_REQ_MODE_DISC_IMM BIT(2)
|
|
||||||
#define BTM_REQ_MODE_BSS_TERM_INCLUDE BIT(3)
|
|
||||||
#define BTM_REQ_MODE_ESS_DISC_IMM BIT(4)
|
|
||||||
|
|
||||||
#define BSS_TRANSITION_MGT_STATUS_ACCEPT 0
|
|
||||||
#define BSS_TRANSITION_MGT_STATUS_UNSPECIFIED 1
|
|
||||||
#define BSS_TRANSITION_MGT_STATUS_NEED_SCAN 2
|
|
||||||
#define BSS_TRANSITION_MGT_STATUS_CAND_NO_CAPACITY 3
|
|
||||||
#define BSS_TRANSITION_MGT_STATUS_TERM_UNDESIRED 4
|
|
||||||
#define BSS_TRANSITION_MGT_STATUS_TERM_DELAY_REQUESTED 5
|
|
||||||
#define BSS_TRANSITION_MGT_STATUS_CAND_LIST_PROVIDED 6
|
|
||||||
#define BSS_TRANSITION_MGT_STATUS_CAND_NO_CANDIDATES 7
|
|
||||||
#define BSS_TRANSITION_MGT_STATUS_LEAVING_ESS 8
|
|
||||||
|
|
||||||
/* 802.11v: define Transtion and Transition Query reasons */
|
|
||||||
#define BSS_TRANSITION_BETTER_AP_FOUND 6
|
|
||||||
#define BSS_TRANSITION_LOW_RSSI 16
|
|
||||||
#define BSS_TRANSITION_INCLUDE_PREFER_CAND_LIST 19
|
|
||||||
#define BSS_TRANSITION_LEAVING_ESS 20
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
WLAN_STATUS
|
|
||||||
wnmRunEventTimgingMeasTxDone(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
wnmComposeTimingMeasFrame(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN PFN_TX_DONE_HANDLER pfTxDoneHandler);
|
|
||||||
|
|
||||||
VOID wnmTimingMeasRequest(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID wnmWNMAction(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID wnmReportTimingMeas(IN P_ADAPTER_T prAdapter, IN UINT_8 ucStaRecIndex, IN UINT_32 u4ToD, IN UINT_32 u4ToA);
|
|
||||||
|
|
||||||
VOID wnmRecvBTMRequest(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID wnmSendBTMQueryFrame(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID wnmSendBTMResponseFrame(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
UINT_8 wnmGetBtmToken(VOID);
|
|
||||||
|
|
||||||
#if WNM_UNIT_TEST
|
|
||||||
VOID wnmTimingMeasUnitTest1(P_ADAPTER_T prAdapter, UINT_8 ucStaRecIndex);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _WNM_H */
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,224 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _BOW_H_
|
|
||||||
#define _BOW_H_
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define BOWDEVNAME "bow0"
|
|
||||||
|
|
||||||
#define MAX_BOW_NUMBER_OF_CHANNEL_2G4 14
|
|
||||||
#define MAX_BOW_NUMBER_OF_CHANNEL_5G 4
|
|
||||||
/* (MAX_BOW_NUMBER_OF_CHANNEL_2G4 + MAX_BOW_NUMBER_OF_CHANNEL_5G) */
|
|
||||||
#define MAX_BOW_NUMBER_OF_CHANNEL 18
|
|
||||||
|
|
||||||
#define MAX_ACTIVITY_REPORT 2
|
|
||||||
#define MAX_ACTIVITY_REPROT_TIME 660
|
|
||||||
|
|
||||||
#define ACTIVITY_REPORT_STATUS_SUCCESS 0
|
|
||||||
#define ACTIVITY_REPORT_STATUS_FAILURE 1
|
|
||||||
#define ACTIVITY_REPORT_STATUS_TIME_INVALID 2
|
|
||||||
#define ACTIVITY_REPORT_STATUS_OTHERS 3
|
|
||||||
|
|
||||||
#define ACTIVITY_REPORT_SCHEDULE_UNKNOWN 0 /* Does not know the schedule of the interference */
|
|
||||||
#define ACTIVITY_REPORT_SCHEDULE_KNOWN 1
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef struct _BT_OVER_WIFI_COMMAND_HEADER_T {
|
|
||||||
UINT_8 ucCommandId;
|
|
||||||
UINT_8 ucSeqNumber;
|
|
||||||
UINT_16 u2PayloadLength;
|
|
||||||
} AMPC_COMMAND_HEADER_T, *P_AMPC_COMMAND_HEADER_T;
|
|
||||||
|
|
||||||
typedef struct _BT_OVER_WIFI_COMMAND {
|
|
||||||
AMPC_COMMAND_HEADER_T rHeader;
|
|
||||||
UINT_8 aucPayload[0];
|
|
||||||
} AMPC_COMMAND, *P_AMPC_COMMAND;
|
|
||||||
|
|
||||||
typedef struct _BT_OVER_WIFI_EVENT_HEADER_T {
|
|
||||||
UINT_8 ucEventId;
|
|
||||||
UINT_8 ucSeqNumber;
|
|
||||||
UINT_16 u2PayloadLength;
|
|
||||||
} AMPC_EVENT_HEADER_T, *P_AMPC_EVENT_HEADER_T;
|
|
||||||
|
|
||||||
typedef struct _BT_OVER_WIFI_EVENT {
|
|
||||||
AMPC_EVENT_HEADER_T rHeader;
|
|
||||||
UINT_8 aucPayload[0];
|
|
||||||
} AMPC_EVENT, *P_AMPC_EVENT;
|
|
||||||
|
|
||||||
typedef struct _CHANNEL_DESC_T {
|
|
||||||
UINT_8 ucChannelBand;
|
|
||||||
UINT_8 ucChannelNum;
|
|
||||||
} CHANNEL_DESC, P_CHANNEL_DESC;
|
|
||||||
|
|
||||||
/* Command Structures */
|
|
||||||
typedef struct _BOW_SETUP_CONNECTION {
|
|
||||||
/* Fixed to 2.4G */
|
|
||||||
UINT_8 ucChannelNum;
|
|
||||||
UINT_8 ucReserved1;
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
UINT_16 u2BeaconInterval;
|
|
||||||
UINT_8 ucTimeoutDiscovery;
|
|
||||||
UINT_8 ucTimeoutInactivity;
|
|
||||||
UINT_8 ucRole;
|
|
||||||
UINT_8 ucPAL_Capabilities;
|
|
||||||
INT_8 cMaxTxPower;
|
|
||||||
UINT_8 ucReserved2;
|
|
||||||
|
|
||||||
/* Pending, for future BOW 5G supporting. */
|
|
||||||
/*
|
|
||||||
* UINT_8 aucPeerAddress[6];
|
|
||||||
* UINT_16 u2BeaconInterval;
|
|
||||||
* UINT_8 ucTimeoutDiscovery;
|
|
||||||
* UINT_8 ucTimeoutInactivity;
|
|
||||||
* UINT_8 ucRole;
|
|
||||||
* UINT_8 ucPAL_Capabilities;
|
|
||||||
* INT_8 cMaxTxPower;
|
|
||||||
* UINT_8 ucChannelListNum;
|
|
||||||
* CHANNEL_DESC arChannelList[1];
|
|
||||||
*/
|
|
||||||
} BOW_SETUP_CONNECTION, *P_BOW_SETUP_CONNECTION;
|
|
||||||
|
|
||||||
typedef struct _BOW_DESTROY_CONNECTION {
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
UINT_8 aucReserved[2];
|
|
||||||
} BOW_DESTROY_CONNECTION, *P_BOW_DESTROY_CONNECTION;
|
|
||||||
|
|
||||||
typedef struct _BOW_SET_PTK {
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
UINT_8 aucReserved[2];
|
|
||||||
UINT_8 aucTemporalKey[16];
|
|
||||||
} BOW_SET_PTK, *P_BOW_SET_PTK;
|
|
||||||
|
|
||||||
typedef struct _BOW_READ_RSSI {
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
UINT_8 aucReserved[2];
|
|
||||||
} BOW_READ_RSSI, *P_BOW_READ_RSSI;
|
|
||||||
|
|
||||||
typedef struct _BOW_READ_LINK_QUALITY {
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
UINT_8 aucReserved[2];
|
|
||||||
} BOW_READ_LINK_QUALITY, *P_BOW_READ_LINK_QUALITY;
|
|
||||||
|
|
||||||
typedef struct _BOW_SHORT_RANGE_MODE {
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
INT_8 cTxPower;
|
|
||||||
UINT_8 ucReserved;
|
|
||||||
} BOW_SHORT_RANGE_MODE, *P_BOW_SHORT_RANGE_MODE;
|
|
||||||
|
|
||||||
/* Event Structures */
|
|
||||||
typedef struct _BOW_COMMAND_STATUS {
|
|
||||||
UINT_8 ucStatus;
|
|
||||||
UINT_8 ucReserved[3];
|
|
||||||
} BOW_COMMAND_STATUS, *P_BOW_COMMAND_STATUS;
|
|
||||||
|
|
||||||
typedef struct _BOW_MAC_STATUS {
|
|
||||||
UINT_8 aucMacAddr[6];
|
|
||||||
UINT_8 ucAvailability;
|
|
||||||
UINT_8 ucNumOfChannel;
|
|
||||||
CHANNEL_DESC arChannelList[MAX_BOW_NUMBER_OF_CHANNEL];
|
|
||||||
} BOW_MAC_STATUS, *P_BOW_MAC_STATUS;
|
|
||||||
|
|
||||||
typedef struct _BOW_LINK_CONNECTED {
|
|
||||||
CHANNEL_DESC rChannel;
|
|
||||||
UINT_8 aucReserved;
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
} BOW_LINK_CONNECTED, *P_BOW_LINK_CONNECTED;
|
|
||||||
|
|
||||||
typedef struct _BOW_LINK_DISCONNECTED {
|
|
||||||
UINT_8 ucReason;
|
|
||||||
UINT_8 aucReserved;
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
} BOW_LINK_DISCONNECTED, *P_BOW_LINK_DISCONNECTED;
|
|
||||||
|
|
||||||
typedef struct _BOW_RSSI {
|
|
||||||
INT_8 cRssi;
|
|
||||||
UINT_8 aucReserved[3];
|
|
||||||
} BOW_RSSI, *P_BOW_RSSI;
|
|
||||||
|
|
||||||
typedef struct _BOW_LINK_QUALITY {
|
|
||||||
UINT_8 ucLinkQuality;
|
|
||||||
UINT_8 aucReserved[3];
|
|
||||||
} BOW_LINK_QUALITY, *P_BOW_LINK_QUALITY;
|
|
||||||
|
|
||||||
typedef enum _ENUM_BOW_CMD_ID_T {
|
|
||||||
BOW_CMD_ID_GET_MAC_STATUS = 1,
|
|
||||||
BOW_CMD_ID_SETUP_CONNECTION,
|
|
||||||
BOW_CMD_ID_DESTROY_CONNECTION,
|
|
||||||
BOW_CMD_ID_SET_PTK,
|
|
||||||
BOW_CMD_ID_READ_RSSI,
|
|
||||||
BOW_CMD_ID_READ_LINK_QUALITY,
|
|
||||||
BOW_CMD_ID_SHORT_RANGE_MODE,
|
|
||||||
BOW_CMD_ID_GET_CHANNEL_LIST,
|
|
||||||
} ENUM_BOW_CMD_ID_T, *P_ENUM_BOW_CMD_ID_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_BOW_EVENT_ID_T {
|
|
||||||
BOW_EVENT_ID_COMMAND_STATUS = 1,
|
|
||||||
BOW_EVENT_ID_MAC_STATUS,
|
|
||||||
BOW_EVENT_ID_LINK_CONNECTED,
|
|
||||||
BOW_EVENT_ID_LINK_DISCONNECTED,
|
|
||||||
BOW_EVENT_ID_RSSI,
|
|
||||||
BOW_EVENT_ID_LINK_QUALITY,
|
|
||||||
BOW_EVENT_ID_CHANNEL_LIST,
|
|
||||||
BOW_EVENT_ID_CHANNEL_SELECTED,
|
|
||||||
} ENUM_BOW_EVENT_ID_T, *P_ENUM_BOW_EVENT_ID_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_BOW_DEVICE_STATE {
|
|
||||||
BOW_DEVICE_STATE_DISCONNECTED = 0,
|
|
||||||
BOW_DEVICE_STATE_DISCONNECTING,
|
|
||||||
BOW_DEVICE_STATE_ACQUIRING_CHANNEL,
|
|
||||||
BOW_DEVICE_STATE_STARTING,
|
|
||||||
BOW_DEVICE_STATE_SCANNING,
|
|
||||||
BOW_DEVICE_STATE_CONNECTING,
|
|
||||||
BOW_DEVICE_STATE_CONNECTED,
|
|
||||||
BOW_DEVICE_STATE_NUM
|
|
||||||
} ENUM_BOW_DEVICE_STATE, *P_ENUM_BOW_DEVICE_STATE;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /*_BOW_H */
|
|
|
@ -1,128 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _CMD_BUF_H
|
|
||||||
#define _CMD_BUF_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum _COMMAND_TYPE {
|
|
||||||
COMMAND_TYPE_GENERAL_IOCTL,
|
|
||||||
COMMAND_TYPE_NETWORK_IOCTL,
|
|
||||||
COMMAND_TYPE_SECURITY_FRAME,
|
|
||||||
COMMAND_TYPE_MANAGEMENT_FRAME,
|
|
||||||
COMMAND_TYPE_KEY_IOCTL,
|
|
||||||
COMMAND_TYPE_NUM
|
|
||||||
} COMMAND_TYPE, *P_COMMAND_TYPE;
|
|
||||||
|
|
||||||
typedef VOID(*PFN_CMD_DONE_HANDLER) (IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN PUINT_8 pucEventBuf);
|
|
||||||
|
|
||||||
typedef VOID(*PFN_CMD_TIMEOUT_HANDLER) (IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
|
|
||||||
|
|
||||||
struct _CMD_INFO_T {
|
|
||||||
QUE_ENTRY_T rQueEntry;
|
|
||||||
|
|
||||||
COMMAND_TYPE eCmdType;
|
|
||||||
|
|
||||||
UINT_16 u2InfoBufLen; /* This is actual CMD buffer length */
|
|
||||||
PUINT_8 pucInfoBuffer; /* May pointer to structure in prAdapter */
|
|
||||||
P_NATIVE_PACKET prPacket; /* only valid when it's a security frame */
|
|
||||||
|
|
||||||
ENUM_NETWORK_TYPE_INDEX_T eNetworkType;
|
|
||||||
UINT_8 ucStaRecIndex; /* only valid when it's a security frame */
|
|
||||||
|
|
||||||
PFN_CMD_DONE_HANDLER pfCmdDoneHandler;
|
|
||||||
PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler;
|
|
||||||
|
|
||||||
BOOLEAN fgIsOid; /* Used to check if we need indicate */
|
|
||||||
|
|
||||||
UINT_8 ucCID;
|
|
||||||
BOOLEAN fgSetQuery;
|
|
||||||
BOOLEAN fgNeedResp;
|
|
||||||
BOOLEAN fgDriverDomainMCR; /* Access Driver Domain MCR, for CMD_ID_ACCESS_REG only */
|
|
||||||
UINT_8 ucCmdSeqNum;
|
|
||||||
UINT_32 u4SetInfoLen; /* Indicate how many byte we read for Set OID */
|
|
||||||
|
|
||||||
/* information indicating by OID/ioctl */
|
|
||||||
PVOID pvInformationBuffer;
|
|
||||||
UINT_32 u4InformationBufferLength;
|
|
||||||
|
|
||||||
/* private data */
|
|
||||||
UINT_32 u4PrivateData;
|
|
||||||
UINT_32 u4InqueTime;
|
|
||||||
UINT_32 u4SendToFwTime;
|
|
||||||
UINT_32 u4FwResponseTime;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID cmdBufInitialize(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
P_CMD_INFO_T cmdBufAllocateCmdInfo(IN P_ADAPTER_T prAdapter, IN UINT_32 u4Length);
|
|
||||||
|
|
||||||
VOID cmdBufFreeCmdInfo(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines for CMDs */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanSendSetQueryCmd(IN P_ADAPTER_T prAdapter,
|
|
||||||
UINT_8 ucCID,
|
|
||||||
BOOLEAN fgSetQuery,
|
|
||||||
BOOLEAN fgNeedResp,
|
|
||||||
BOOLEAN fgIsOid,
|
|
||||||
PFN_CMD_DONE_HANDLER pfCmdDoneHandler,
|
|
||||||
PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler,
|
|
||||||
UINT_32 u4SetQueryInfoLen,
|
|
||||||
PUINT_8 pucInfoBuffer, OUT PVOID pvSetQueryBuffer, IN UINT_32 u4SetQueryBufferLen);
|
|
||||||
VOID cmdBufDumpCmdQueue(P_QUE_T prQueue, CHAR *queName);
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#endif /* _CMD_BUF_H */
|
|
|
@ -1,555 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HAL_H
|
|
||||||
#define _HAL_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Macros for flag operations for the Adapter structure */
|
|
||||||
#define HAL_SET_FLAG(_M, _F) ((_M)->u4HwFlags |= (_F))
|
|
||||||
#define HAL_CLEAR_FLAG(_M, _F) ((_M)->u4HwFlags &= ~(_F))
|
|
||||||
#define HAL_TEST_FLAG(_M, _F) ((_M)->u4HwFlags & (_F))
|
|
||||||
#define HAL_TEST_FLAGS(_M, _F) (((_M)->u4HwFlags & (_F)) == (_F))
|
|
||||||
|
|
||||||
#if defined(_HIF_SDIO)
|
|
||||||
#define HAL_MCR_RD(_prAdapter, _u4Offset, _pu4Value) \
|
|
||||||
do { \
|
|
||||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
|
||||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
|
||||||
ASSERT(0); \
|
|
||||||
} \
|
|
||||||
if (kalDevRegRead(_prAdapter->prGlueInfo, _u4Offset, _pu4Value) == FALSE) {\
|
|
||||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
|
||||||
fgIsBusAccessFailed = TRUE; \
|
|
||||||
/* DBGLOG(HAL, ERROR, ("HAL_MCR_RD access fail! 0x%x: 0x%x\n", */ \
|
|
||||||
/* (UINT32)_u4Offset, (UINT32)*_pu4Value)); */ \
|
|
||||||
} \
|
|
||||||
} else { \
|
|
||||||
/* DBGLOG(HAL, WARN, ("ignore HAL_MCR_RD access! 0x%x\n", (UINT32)_u4Offset)); */ \
|
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define HAL_MCR_WR(_prAdapter, _u4Offset, _u4Value) \
|
|
||||||
do { \
|
|
||||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
|
||||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
|
||||||
ASSERT(0); \
|
|
||||||
} \
|
|
||||||
if (kalDevRegWrite(_prAdapter->prGlueInfo, _u4Offset, _u4Value) == FALSE) {\
|
|
||||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
|
||||||
fgIsBusAccessFailed = TRUE; \
|
|
||||||
/* DBGLOG(HAL, ERROR, ("HAL_MCR_WR access fail! 0x%x: 0x%x\n", */ \
|
|
||||||
/* (UINT32)_u4Offset, (UINT32)_u4Value)); */ \
|
|
||||||
} \
|
|
||||||
} else { \
|
|
||||||
/* DBGLOG(HAL, WARN, ("ignore HAL_MCR_WR access! 0x%x: 0x%x\n", */ \
|
|
||||||
/* (UINT32)_u4Offset, (UINT32)_u4Value)); */ \
|
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define HAL_PORT_RD(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
|
||||||
{ \
|
|
||||||
/*fgResult = FALSE; */\
|
|
||||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
|
||||||
ASSERT(0); \
|
|
||||||
} \
|
|
||||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
|
||||||
if (kalDevPortRead(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
|
||||||
== FALSE) {\
|
|
||||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
|
||||||
fgIsBusAccessFailed = TRUE; \
|
|
||||||
DBGLOG(HAL, ERROR, "HAL_PORT_RD access fail! 0x%x\n", _u4Port); \
|
|
||||||
GL_RESET_TRIGGER(_prAdapter, RST_FLAG_CHIP_RESET); \
|
|
||||||
} \
|
|
||||||
else { \
|
|
||||||
/*fgResult = TRUE;*/ } \
|
|
||||||
} else { \
|
|
||||||
DBGLOG(HAL, WARN, "ignore HAL_PORT_RD access! 0x%x\n", _u4Port); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_PORT_WR(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
|
||||||
{ \
|
|
||||||
/*fgResult = FALSE; */\
|
|
||||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
|
||||||
ASSERT(0); \
|
|
||||||
} \
|
|
||||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
|
||||||
if (kalDevPortWrite(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
|
||||||
== FALSE) {\
|
|
||||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
|
||||||
fgIsBusAccessFailed = TRUE; \
|
|
||||||
DBGLOG(HAL, ERROR, "HAL_PORT_WR access fail! 0x%x\n", _u4Port); \
|
|
||||||
GL_RESET_TRIGGER(_prAdapter, RST_FLAG_CHIP_RESET); \
|
|
||||||
} \
|
|
||||||
else { \
|
|
||||||
/*fgResult = TRUE;*/ } \
|
|
||||||
} else { \
|
|
||||||
DBGLOG(HAL, WARN, "ignore HAL_PORT_WR access! 0x%x\n", _u4Port); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0 /* only for SDIO */
|
|
||||||
#define HAL_BYTE_WR(_prAdapter, _u4Port, _ucBuf) \
|
|
||||||
{ \
|
|
||||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
|
||||||
ASSERT(0); \
|
|
||||||
} \
|
|
||||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
|
||||||
if (kalDevWriteWithSdioCmd52(_prAdapter->prGlueInfo, _u4Port, _ucBuf) == FALSE) {\
|
|
||||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
|
||||||
fgIsBusAccessFailed = TRUE; \
|
|
||||||
DBGLOG(HAL, ERROR, "HAL_BYTE_WR access fail! 0x%x\n", _u4Port); \
|
|
||||||
} \
|
|
||||||
else { \
|
|
||||||
/* Todo:: Nothing*/ \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
else { \
|
|
||||||
DBGLOG(HAL, WARN, "ignore HAL_BYTE_WR access! 0x%x\n", _u4Port); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAL_DRIVER_OWN_BY_SDIO_CMD52(_prAdapter, _pfgDriverIsOwnReady) \
|
|
||||||
{ \
|
|
||||||
UINT_8 ucBuf = BIT(1); \
|
|
||||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
|
||||||
ASSERT(0); \
|
|
||||||
} \
|
|
||||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
|
||||||
if (kalDevReadAfterWriteWithSdioCmd52(_prAdapter->prGlueInfo, MCR_WHLPCR_BYTE1, &ucBuf, 1) \
|
|
||||||
== FALSE) {\
|
|
||||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
|
||||||
fgIsBusAccessFailed = TRUE; \
|
|
||||||
DBGLOG(HAL, ERROR, "kalDevReadAfterWriteWithSdioCmd52 access fail!\n"); \
|
|
||||||
} \
|
|
||||||
else { \
|
|
||||||
*_pfgDriverIsOwnReady = (ucBuf & BIT(0)) ? TRUE : FALSE; \
|
|
||||||
} \
|
|
||||||
} else { \
|
|
||||||
DBGLOG(HAL, WARN, "ignore HAL_DRIVER_OWN_BY_SDIO_CMD52 access!\n"); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* #if defined(_HIF_SDIO) */
|
|
||||||
#define HAL_MCR_RD(_prAdapter, _u4Offset, _pu4Value) \
|
|
||||||
{ \
|
|
||||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
|
||||||
ASSERT(0); \
|
|
||||||
} \
|
|
||||||
if (kalDevRegRead(_prAdapter->prGlueInfo, _u4Offset, _pu4Value) \
|
|
||||||
== FALSE) \
|
|
||||||
fgIsBusAccessFailed = TRUE; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_MCR_WR(_prAdapter, _u4Offset, _u4Value) \
|
|
||||||
{ \
|
|
||||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
|
||||||
ASSERT(0); \
|
|
||||||
} \
|
|
||||||
if (kalDevRegWrite(_prAdapter->prGlueInfo, _u4Offset, _u4Value) \
|
|
||||||
== FALSE) \
|
|
||||||
fgIsBusAccessFailed = TRUE; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_PORT_RD(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
|
||||||
{ \
|
|
||||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
|
||||||
ASSERT(0); \
|
|
||||||
} \
|
|
||||||
if (kalDevPortRead(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
|
||||||
== FALSE) \
|
|
||||||
fgIsBusAccessFailed = TRUE; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_PORT_WR(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
|
||||||
{ \
|
|
||||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
|
||||||
ASSERT(0); \
|
|
||||||
} \
|
|
||||||
if (kalDevPortWrite(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
|
||||||
== FALSE) \
|
|
||||||
fgIsBusAccessFailed = TRUE; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 0 /* only for SDIO */
|
|
||||||
#define HAL_BYTE_WR(_prAdapter, _u4Port, _ucBuf) \
|
|
||||||
{ \
|
|
||||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
|
||||||
ASSERT(0); \
|
|
||||||
} \
|
|
||||||
kalDevWriteWithSdioCmd52(_prAdapter->prGlueInfo, _u4Port, _ucBuf); \
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* #if defined(_HIF_SDIO) */
|
|
||||||
|
|
||||||
#define HAL_READ_RX_PORT(prAdapter, u4PortId, u4Len, pvBuf, _u4ValidBufSize) \
|
|
||||||
{ \
|
|
||||||
ASSERT(u4PortId < 2); \
|
|
||||||
HAL_PORT_RD(prAdapter, \
|
|
||||||
((u4PortId == 0) ? MCR_WRDR0 : MCR_WRDR1), \
|
|
||||||
u4Len, \
|
|
||||||
pvBuf, \
|
|
||||||
_u4ValidBufSize/*temp!!*//*4Kbyte*/); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_WRITE_TX_PORT(_prAdapter, _ucTxPortIdx, _u4Len, _pucBuf, _u4ValidBufSize) \
|
|
||||||
{ \
|
|
||||||
ASSERT(_ucTxPortIdx < 2); \
|
|
||||||
if ((_u4ValidBufSize - _u4Len) >= sizeof(UINT_32)) { \
|
|
||||||
/* fill with single dword of zero as TX-aggregation termination */ \
|
|
||||||
*(PUINT_32) (&((_pucBuf)[ALIGN_4(_u4Len)])) = 0; \
|
|
||||||
} \
|
|
||||||
HAL_PORT_WR(_prAdapter, \
|
|
||||||
(_ucTxPortIdx == 0) ? MCR_WTDR0 : MCR_WTDR1, \
|
|
||||||
_u4Len, \
|
|
||||||
_pucBuf, \
|
|
||||||
_u4ValidBufSize/*temp!!*//*4KByte*/); \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The macro to read the given MCR several times to check if the wait
|
|
||||||
* condition come true.
|
|
||||||
*/
|
|
||||||
#define HAL_MCR_RD_AND_WAIT(_pAdapter, _offset, _pReadValue, _waitCondition, _waitDelay, _waitCount, _status) \
|
|
||||||
{ \
|
|
||||||
UINT_32 count; \
|
|
||||||
(_status) = FALSE; \
|
|
||||||
for (count = 0; count < (_waitCount); count++) { \
|
|
||||||
HAL_MCR_RD((_pAdapter), (_offset), (_pReadValue)); \
|
|
||||||
if ((_waitCondition)) { \
|
|
||||||
(_status) = TRUE; \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
kalUdelay((_waitDelay)); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The macro to write 1 to a R/S bit and read it several times to check if the
|
|
||||||
* command is done
|
|
||||||
*/
|
|
||||||
#define HAL_MCR_WR_AND_WAIT(_pAdapter, _offset, _writeValue, _busyMask, _waitDelay, _waitCount, _status) \
|
|
||||||
{ \
|
|
||||||
UINT_32 u4Temp; \
|
|
||||||
UINT_32 u4Count = _waitCount; \
|
|
||||||
(_status) = FALSE; \
|
|
||||||
HAL_MCR_WR((_pAdapter), (_offset), (_writeValue)); \
|
|
||||||
do { \
|
|
||||||
kalUdelay((_waitDelay)); \
|
|
||||||
HAL_MCR_RD((_pAdapter), (_offset), &u4Temp); \
|
|
||||||
if (!(u4Temp & (_busyMask))) { \
|
|
||||||
(_status) = TRUE; \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
u4Count--; \
|
|
||||||
} while (u4Count); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_GET_CHIP_ID_VER(_prAdapter, pu2ChipId, pu2Version) \
|
|
||||||
{ \
|
|
||||||
UINT_32 u4Value; \
|
|
||||||
HAL_MCR_RD(_prAdapter, \
|
|
||||||
MCR_WCIR, \
|
|
||||||
&u4Value); \
|
|
||||||
*pu2ChipId = (UINT_16)(u4Value & WCIR_CHIP_ID); \
|
|
||||||
*pu2Version = (UINT_16)(u4Value & WCIR_REVISION_ID) >> 16; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_WAIT_WIFI_FUNC_READY(_prAdapter) \
|
|
||||||
{ \
|
|
||||||
UINT_32 u4Value; \
|
|
||||||
UINT_32 i; \
|
|
||||||
for (i = 0; i < 100; i++) { \
|
|
||||||
HAL_MCR_RD(_prAdapter, \
|
|
||||||
MCR_WCIR, \
|
|
||||||
&u4Value); \
|
|
||||||
if (u4Value & WCIR_WLAN_READY) { \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
NdisMSleep(10); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_INTR_DISABLE(_prAdapter) \
|
|
||||||
HAL_MCR_WR(_prAdapter, \
|
|
||||||
MCR_WHLPCR, \
|
|
||||||
WHLPCR_INT_EN_CLR)
|
|
||||||
|
|
||||||
#define HAL_INTR_ENABLE(_prAdapter) \
|
|
||||||
HAL_MCR_WR(_prAdapter, \
|
|
||||||
MCR_WHLPCR, \
|
|
||||||
WHLPCR_INT_EN_SET)
|
|
||||||
|
|
||||||
#define HAL_INTR_ENABLE_AND_LP_OWN_SET(_prAdapter) \
|
|
||||||
HAL_MCR_WR(_prAdapter, \
|
|
||||||
MCR_WHLPCR, \
|
|
||||||
(WHLPCR_INT_EN_SET | WHLPCR_FW_OWN_REQ_SET))
|
|
||||||
|
|
||||||
#define HAL_LP_OWN_SET(_prAdapter) \
|
|
||||||
HAL_MCR_WR(_prAdapter, \
|
|
||||||
MCR_WHLPCR, \
|
|
||||||
WHLPCR_FW_OWN_REQ_SET)
|
|
||||||
|
|
||||||
#define HAL_LP_OWN_CLR_OK(_prAdapter, _pfgResult) \
|
|
||||||
{ \
|
|
||||||
UINT_32 i; \
|
|
||||||
UINT_32 u4RegValue; \
|
|
||||||
UINT_32 u4LoopCnt = 2048 / 8; \
|
|
||||||
*_pfgResult = TRUE; \
|
|
||||||
/* Software get LP ownership */ \
|
|
||||||
HAL_MCR_WR(_prAdapter, \
|
|
||||||
MCR_WHLPCR, \
|
|
||||||
WHLPCR_FW_OWN_REQ_CLR) \
|
|
||||||
for (i = 0; i < u4LoopCnt; i++) { \
|
|
||||||
HAL_MCR_RD(_prAdapter, MCR_WHLPCR, &u4RegValue); \
|
|
||||||
if (u4RegValue & WHLPCR_IS_DRIVER_OWN) { \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
else { \
|
|
||||||
kalUdelay(8); \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
if (i == u4LoopCnt) { \
|
|
||||||
*_pfgResult = FALSE; \
|
|
||||||
/*ERRORLOG(("LP cannot be own back (%ld)", u4LoopCnt));*/ \
|
|
||||||
/* check the time of LP instructions need to perform from Sleep to On */ \
|
|
||||||
/*ASSERT(0); */ \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_GET_ABNORMAL_INTERRUPT_REASON_CODE(_prAdapter, pu4AbnormalReason) \
|
|
||||||
{ \
|
|
||||||
HAL_MCR_RD(_prAdapter, \
|
|
||||||
MCR_WASR, \
|
|
||||||
pu4AbnormalReason); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_DISABLE_RX_ENHANCE_MODE(_prAdapter) \
|
|
||||||
{ \
|
|
||||||
UINT_32 u4Value; \
|
|
||||||
HAL_MCR_RD(_prAdapter, \
|
|
||||||
MCR_WHCR, \
|
|
||||||
&u4Value); \
|
|
||||||
HAL_MCR_WR(_prAdapter, \
|
|
||||||
MCR_WHCR, \
|
|
||||||
u4Value & ~WHCR_RX_ENHANCE_MODE_EN); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_ENABLE_RX_ENHANCE_MODE(_prAdapter) \
|
|
||||||
{ \
|
|
||||||
UINT_32 u4Value; \
|
|
||||||
HAL_MCR_RD(_prAdapter, \
|
|
||||||
MCR_WHCR, \
|
|
||||||
&u4Value); \
|
|
||||||
HAL_MCR_WR(_prAdapter, \
|
|
||||||
MCR_WHCR, \
|
|
||||||
u4Value | WHCR_RX_ENHANCE_MODE_EN); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_CFG_MAX_HIF_RX_LEN_NUM(_prAdapter, _ucNumOfRxLen) \
|
|
||||||
{ \
|
|
||||||
UINT_32 u4Value, ucNum; \
|
|
||||||
ucNum = ((_ucNumOfRxLen >= 16) ? 0 : _ucNumOfRxLen); \
|
|
||||||
u4Value = 0; \
|
|
||||||
HAL_MCR_RD(_prAdapter, \
|
|
||||||
MCR_WHCR, \
|
|
||||||
&u4Value); \
|
|
||||||
u4Value &= ~WHCR_MAX_HIF_RX_LEN_NUM; \
|
|
||||||
u4Value |= ((((UINT_32)ucNum) << 4) & WHCR_MAX_HIF_RX_LEN_NUM); \
|
|
||||||
HAL_MCR_WR(_prAdapter, \
|
|
||||||
MCR_WHCR, \
|
|
||||||
u4Value); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_SET_INTR_STATUS_READ_CLEAR(prAdapter) \
|
|
||||||
{ \
|
|
||||||
UINT_32 u4Value; \
|
|
||||||
HAL_MCR_RD(prAdapter, \
|
|
||||||
MCR_WHCR, \
|
|
||||||
&u4Value); \
|
|
||||||
HAL_MCR_WR(prAdapter, \
|
|
||||||
MCR_WHCR, \
|
|
||||||
u4Value & ~WHCR_W_INT_CLR_CTRL); \
|
|
||||||
prAdapter->prGlueInfo->rHifInfo.fgIntReadClear = TRUE;\
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_SET_INTR_STATUS_WRITE_1_CLEAR(prAdapter) \
|
|
||||||
{ \
|
|
||||||
UINT_32 u4Value; \
|
|
||||||
HAL_MCR_RD(prAdapter, \
|
|
||||||
MCR_WHCR, \
|
|
||||||
&u4Value); \
|
|
||||||
HAL_MCR_WR(prAdapter, \
|
|
||||||
MCR_WHCR, \
|
|
||||||
u4Value | WHCR_W_INT_CLR_CTRL); \
|
|
||||||
prAdapter->prGlueInfo->rHifInfo.fgIntReadClear = FALSE;\
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Note: enhance mode structure may also carried inside the buffer,
|
|
||||||
* if the length of the buffer is long enough
|
|
||||||
*/
|
|
||||||
#define HAL_READ_INTR_STATUS(prAdapter, length, pvBuf) \
|
|
||||||
HAL_PORT_RD(prAdapter, \
|
|
||||||
MCR_WHISR, \
|
|
||||||
length, \
|
|
||||||
pvBuf, \
|
|
||||||
length)
|
|
||||||
|
|
||||||
#define HAL_READ_TX_RELEASED_COUNT(_prAdapter, aucTxReleaseCount) \
|
|
||||||
{ \
|
|
||||||
PUINT_32 pu4Value = (PUINT_32)aucTxReleaseCount; \
|
|
||||||
HAL_MCR_RD(_prAdapter, \
|
|
||||||
MCR_WTSR0, \
|
|
||||||
&pu4Value[0]); \
|
|
||||||
HAL_MCR_RD(_prAdapter, \
|
|
||||||
MCR_WTSR1, \
|
|
||||||
&pu4Value[1]); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_READ_RX_LENGTH(prAdapter, pu2Rx0Len, pu2Rx1Len) \
|
|
||||||
{ \
|
|
||||||
UINT_32 u4Value; \
|
|
||||||
u4Value = 0; \
|
|
||||||
HAL_MCR_RD(prAdapter, \
|
|
||||||
MCR_WRPLR, \
|
|
||||||
&u4Value); \
|
|
||||||
*pu2Rx0Len = (UINT_16)u4Value; \
|
|
||||||
*pu2Rx1Len = (UINT_16)(u4Value >> 16); \
|
|
||||||
}
|
|
||||||
#define HAL_GET_APMCU_MEM(_prAdapter, _addr, _Offset, _index, _buf, _len) \
|
|
||||||
{ \
|
|
||||||
kalGetAPMCUMen(_prAdapter->prGlueInfo, _addr, _Offset, _index, _buf, _len); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_GET_INTR_STATUS_FROM_ENHANCE_MODE_STRUCT(pvBuf, u2Len, pu4Status) \
|
|
||||||
{ \
|
|
||||||
PUINT_32 pu4Buf = (PUINT_32)pvBuf; \
|
|
||||||
*pu4Status = pu4Buf[0]; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_GET_TX_STATUS_FROM_ENHANCE_MODE_STRUCT(pvInBuf, pu4BufOut, u4LenBufOut) \
|
|
||||||
{ \
|
|
||||||
PUINT_32 pu4Buf = (PUINT_32)pvInBuf; \
|
|
||||||
ASSERT(u4LenBufOut >= 8); \
|
|
||||||
pu4BufOut[0] = pu4Buf[1]; \
|
|
||||||
pu4BufOut[1] = pu4Buf[2]; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_GET_RX_LENGTH_FROM_ENHANCE_MODE_STRUCT(pvInBuf, pu2Rx0Num, au2Rx0Len, pu2Rx1Num, au2Rx1Len) \
|
|
||||||
{ \
|
|
||||||
PUINT_32 pu4Buf = (PUINT_32)pvInBuf; \
|
|
||||||
ASSERT((sizeof(au2Rx0Len) / sizeof(UINT_16)) >= 16); \
|
|
||||||
ASSERT((sizeof(au2Rx1Len) / sizeof(UINT_16)) >= 16); \
|
|
||||||
*pu2Rx0Num = (UINT_16)pu4Buf[3]; \
|
|
||||||
*pu2Rx1Num = (UINT_16)(pu4Buf[3] >> 16); \
|
|
||||||
kalMemCopy(au2Rx0Len, &pu4Buf[4], 8); \
|
|
||||||
kalMemCopy(au2Rx1Len, &pu4Buf[12], 8); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_GET_MAILBOX_FROM_ENHANCE_MODE_STRUCT(pvInBuf, pu4Mailbox0, pu4Mailbox1) \
|
|
||||||
{ \
|
|
||||||
PUINT_32 pu4Buf = (PUINT_32)pvInBuf; \
|
|
||||||
*pu4Mailbox0 = (UINT_16)pu4Buf[21]; \
|
|
||||||
*pu4Mailbox1 = (UINT_16)pu4Buf[22]; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_IS_TX_DONE_INTR(u4IntrStatus) \
|
|
||||||
((u4IntrStatus & WHISR_TX_DONE_INT) ? TRUE : FALSE)
|
|
||||||
|
|
||||||
#define HAL_IS_RX_DONE_INTR(u4IntrStatus) \
|
|
||||||
((u4IntrStatus & (WHISR_RX0_DONE_INT | WHISR_RX1_DONE_INT)) ? TRUE : FALSE)
|
|
||||||
|
|
||||||
#define HAL_IS_ABNORMAL_INTR(u4IntrStatus) \
|
|
||||||
((u4IntrStatus & WHISR_ABNORMAL_INT) ? TRUE : FALSE)
|
|
||||||
|
|
||||||
#define HAL_IS_FW_OWNBACK_INTR(u4IntrStatus) \
|
|
||||||
((u4IntrStatus & WHISR_FW_OWN_BACK_INT) ? TRUE : FALSE)
|
|
||||||
|
|
||||||
#define HAL_PUT_MAILBOX(prAdapter, u4MboxId, u4Data) \
|
|
||||||
{ \
|
|
||||||
ASSERT(u4MboxId < 2); \
|
|
||||||
HAL_MCR_WR(prAdapter, \
|
|
||||||
((u4MboxId == 0) ? MCR_H2DSM0R : MCR_H2DSM1R), \
|
|
||||||
u4Data); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_GET_MAILBOX(prAdapter, u4MboxId, pu4Data) \
|
|
||||||
{ \
|
|
||||||
ASSERT(u4MboxId < 2); \
|
|
||||||
HAL_MCR_RD(prAdapter, \
|
|
||||||
((u4MboxId == 0) ? MCR_D2HRM0R : MCR_D2HRM1R), \
|
|
||||||
pu4Data); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_SET_MAILBOX_READ_CLEAR(prAdapter, fgEnableReadClear) \
|
|
||||||
{ \
|
|
||||||
UINT_32 u4Value; \
|
|
||||||
HAL_MCR_RD(prAdapter, MCR_WHCR, &u4Value);\
|
|
||||||
HAL_MCR_WR(prAdapter, MCR_WHCR, \
|
|
||||||
(fgEnableReadClear) ? \
|
|
||||||
(u4Value | WHCR_W_MAILBOX_RD_CLR_EN) : \
|
|
||||||
(u4Value & ~WHCR_W_MAILBOX_RD_CLR_EN)); \
|
|
||||||
prAdapter->prGlueInfo->rHifInfo.fgMbxReadClear = fgEnableReadClear;\
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HAL_GET_MAILBOX_READ_CLEAR(prAdapter) (prAdapter->prGlueInfo->rHifInfo.fgMbxReadClear)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _HAL_H */
|
|
|
@ -1,175 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HIF_RX_H
|
|
||||||
#define _HIF_RX_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*! HIF_RX_HEADER_T */
|
|
||||||
/* DW 0, Byte 1 */
|
|
||||||
#define HIF_RX_HDR_PACKET_TYPE_MASK BITS(0, 1)
|
|
||||||
#define HIF_RX_HDR_SEC_MODE_MASK BITS(2, 5)
|
|
||||||
#define HIF_RX_HDR_SEC_MODE_OFFSET 2
|
|
||||||
|
|
||||||
/* DW 1, Byte 0 */
|
|
||||||
#define HIF_RX_HDR_HEADER_LEN BITS(2, 7)
|
|
||||||
#define HIF_RX_HDR_HEADER_LEN_OFFSET 2
|
|
||||||
#define HIF_RX_HDR_HEADER_OFFSET_MASK BITS(0, 1)
|
|
||||||
|
|
||||||
/* DW 1, Byte 1 */
|
|
||||||
#define HIF_RX_HDR_80211_HEADER_FORMAT BIT(0)
|
|
||||||
#define HIF_RX_HDR_DO_REORDER BIT(1)
|
|
||||||
#define HIF_RX_HDR_PAL BIT(2)
|
|
||||||
#define HIF_RX_HDR_TCL BIT(3)
|
|
||||||
#define HIF_RX_HDR_NETWORK_IDX_MASK BITS(4, 7)
|
|
||||||
#define HIF_RX_HDR_NETWORK_IDX_OFFSET 4
|
|
||||||
|
|
||||||
/* DW 1, Byte 2, 3 */
|
|
||||||
#define HIF_RX_HDR_SEQ_NO_MASK BITS(0, 11)
|
|
||||||
#define HIF_RX_HDR_TID_MASK BITS(12, 14)
|
|
||||||
#define HIF_RX_HDR_TID_OFFSET 12
|
|
||||||
#define HIF_RX_HDR_BAR_FRAME BIT(15)
|
|
||||||
|
|
||||||
#define HIF_RX_HDR_FLAG_AMP_WDS BIT(0)
|
|
||||||
#define HIF_RX_HDR_FLAG_802_11_FORMAT BIT(1)
|
|
||||||
#define HIF_RX_HDR_FLAG_BAR_FRAME BIT(2)
|
|
||||||
#define HIF_RX_HDR_FLAG_DO_REORDERING BIT(3)
|
|
||||||
#define HIF_RX_HDR_FLAG_CTRL_WARPPER_FRAME BIT(4)
|
|
||||||
|
|
||||||
#define HIF_RX_HW_APPENDED_LEN 4
|
|
||||||
|
|
||||||
/* For DW 2, Byte 3 - ucHwChannelNum */
|
|
||||||
#define HW_CHNL_NUM_MAX_2G4 (14)
|
|
||||||
#define HW_CHNL_NUM_MAX_4G_5G (255 - HW_CHNL_NUM_MAX_2G4)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _HIF_RX_HEADER_T {
|
|
||||||
UINT_16 u2PacketLen;
|
|
||||||
UINT_16 u2PacketType;
|
|
||||||
UINT_8 ucHerderLenOffset;
|
|
||||||
UINT_8 uc80211_Reorder_PAL_TCL;
|
|
||||||
UINT_16 u2SeqNoTid;
|
|
||||||
UINT_8 ucStaRecIdx;
|
|
||||||
UINT_8 ucRcpi;
|
|
||||||
UINT_8 ucHwChannelNum;
|
|
||||||
UINT_8 ucReserved;
|
|
||||||
} HIF_RX_HEADER_T, *P_HIF_RX_HEADER_T;
|
|
||||||
|
|
||||||
typedef struct _HIF_RX_DESC_T {
|
|
||||||
UINT_8 ucOwn;
|
|
||||||
UINT_8 ucDescChksum;
|
|
||||||
UINT_8 ucEtherTypeOffset;
|
|
||||||
UINT_8 ucChkSumInfo;
|
|
||||||
UINT_32 u4NextDesc;
|
|
||||||
UINT_32 u4BufStartAddr;
|
|
||||||
UINT_16 u2RxBufLen;
|
|
||||||
UINT_16 u2Rsrv1;
|
|
||||||
} HIF_RX_DESC_T, *P_HIF_RX_DESC_T;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum _ENUM_HIF_RX_PKT_TYPE_T {
|
|
||||||
HIF_RX_PKT_TYPE_DATA = 0,
|
|
||||||
HIF_RX_PKT_TYPE_EVENT,
|
|
||||||
HIF_RX_PKT_TYPE_TX_LOOPBACK,
|
|
||||||
HIF_RX_PKT_TYPE_MANAGEMENT,
|
|
||||||
HIF_RX_PKT_TYPE_NUM
|
|
||||||
} ENUM_HIF_RX_PKT_TYPE_T, *P_ENUM_HIF_RX_PKT_TYPE_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define HIF_RX_HDR_SIZE sizeof(HIF_RX_HEADER_T)
|
|
||||||
|
|
||||||
#define HIF_RX_HDR_GET_80211_FLAG(_prHifRxHdr) \
|
|
||||||
(((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_80211_HEADER_FORMAT) ? TRUE : FALSE))
|
|
||||||
#define HIF_RX_HDR_GET_REORDER_FLAG(_prHifRxHdr) \
|
|
||||||
(((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_DO_REORDER) ? TRUE : FALSE))
|
|
||||||
#define HIF_RX_HDR_GET_PAL_FLAG(_prHifRxHdr) \
|
|
||||||
(((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_PAL) ? TRUE : FALSE))
|
|
||||||
#define HIF_RX_HDR_GET_TCL_FLAG(_prHifRxHdr) \
|
|
||||||
(((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_TCL) ? TRUE : FALSE))
|
|
||||||
#define HIF_RX_HDR_GET_NETWORK_IDX(_prHifRxHdr) \
|
|
||||||
((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_NETWORK_IDX_MASK)\
|
|
||||||
>> HIF_RX_HDR_NETWORK_IDX_OFFSET)
|
|
||||||
|
|
||||||
#define HIF_RX_HDR_GET_SEC_MODE(_prHifRxHdr) \
|
|
||||||
((((_prHifRxHdr)->u2PacketType) & HIF_RX_HDR_SEC_MODE_MASK) >> HIF_RX_HDR_SEC_MODE_OFFSET)
|
|
||||||
|
|
||||||
#define HIF_RX_HDR_GET_TID(_prHifRxHdr) \
|
|
||||||
((((_prHifRxHdr)->u2SeqNoTid) & HIF_RX_HDR_TID_MASK)\
|
|
||||||
>> HIF_RX_HDR_TID_OFFSET)
|
|
||||||
#define HIF_RX_HDR_GET_SN(_prHifRxHdr) \
|
|
||||||
(((_prHifRxHdr)->u2SeqNoTid) & HIF_RX_HDR_SEQ_NO_MASK)
|
|
||||||
#define HIF_RX_HDR_GET_BAR_FLAG(_prHifRxHdr) \
|
|
||||||
(((((_prHifRxHdr)->u2SeqNoTid) & HIF_RX_HDR_BAR_FRAME) ? TRUE : FALSE))
|
|
||||||
|
|
||||||
#define HIF_RX_HDR_GET_CHNL_NUM(_prHifRxHdr) \
|
|
||||||
((((_prHifRxHdr)->ucHwChannelNum) > HW_CHNL_NUM_MAX_4G_5G) ? \
|
|
||||||
(((_prHifRxHdr)->ucHwChannelNum) - HW_CHNL_NUM_MAX_4G_5G) : \
|
|
||||||
((_prHifRxHdr)->ucHwChannelNum))
|
|
||||||
|
|
||||||
/* To do: support more bands other than 2.4G and 5G */
|
|
||||||
#define HIF_RX_HDR_GET_RF_BAND(_prHifRxHdr) \
|
|
||||||
((((_prHifRxHdr)->ucHwChannelNum) <= HW_CHNL_NUM_MAX_2G4) ? \
|
|
||||||
BAND_2G4 : BAND_5G)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
static inline VOID hifDataTypeCheck(VOID);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Kevin: we don't have to call following function to inspect the data structure.
|
|
||||||
* It will check automatically while at compile time.
|
|
||||||
* We'll need this for porting driver to different RTOS.
|
|
||||||
*/
|
|
||||||
static inline VOID hifDataTypeCheck(VOID)
|
|
||||||
{
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(sizeof(HIF_RX_HEADER_T) == 12);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,168 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _HIF_TX_H
|
|
||||||
#define _HIF_TX_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Maximum buffer size for individual HIF TCQ Buffer */
|
|
||||||
#define HIF_TX_BUFF_MAX_SIZE 1552 /* Reserved field was not included */
|
|
||||||
|
|
||||||
/* Maximum buffer count for individual HIF TCQ */
|
|
||||||
#define HIF_TX_BUFF_COUNT_TC0 3
|
|
||||||
#define HIF_TX_BUFF_COUNT_TC1 3
|
|
||||||
#define HIF_TX_BUFF_COUNT_TC2 3
|
|
||||||
#define HIF_TX_BUFF_COUNT_TC3 3
|
|
||||||
#define HIF_TX_BUFF_COUNT_TC4 2
|
|
||||||
|
|
||||||
#define TX_HDR_SIZE sizeof(HIF_TX_HEADER_T)
|
|
||||||
|
|
||||||
#define CMD_HDR_SIZE sizeof(WIFI_CMD_T)
|
|
||||||
|
|
||||||
#define CMD_PKT_SIZE_FOR_IMAGE 2048 /* !< 2048 Bytes CMD payload buffer */
|
|
||||||
|
|
||||||
/*! NIC_HIF_TX_HEADER_T */
|
|
||||||
/* DW 0, Byte 0,1 */
|
|
||||||
#define HIF_TX_HDR_TX_BYTE_COUNT_MASK BITS(0, 11)
|
|
||||||
#define HIF_TX_HDR_USER_PRIORITY_OFFSET 12
|
|
||||||
|
|
||||||
/* DW 0, Byte 2 */
|
|
||||||
#define HIF_TX_HDR_ETHER_TYPE_OFFSET_MASK BITS(0, 7)
|
|
||||||
|
|
||||||
/* DW 0, Byte 3 */
|
|
||||||
#define HIF_TX_HDR_IP_CSUM BIT(0)
|
|
||||||
#define HIF_TX_HDR_TCP_CSUM BIT(1)
|
|
||||||
#define HIF_TX_HDR_RESOURCE_MASK BITS(2, 5)
|
|
||||||
#define HIF_TX_HDR_RESOURCE_OFFSET 2
|
|
||||||
#define HIF_TX_HDR_PACKET_TYPE_MASK BITS(6, 7)
|
|
||||||
#define HIF_TX_HDR_PACKET_TYPE_OFFSET 6
|
|
||||||
|
|
||||||
/* DW 1, Byte 0 */
|
|
||||||
#define HIF_TX_HDR_WLAN_HEADER_LEN_MASK BITS(0, 5)
|
|
||||||
|
|
||||||
/* DW 1, Byte 1 */
|
|
||||||
#define HIF_TX_HDR_FORMAT_ID_MASK BITS(0, 2)
|
|
||||||
#define HIF_TX_HDR_NETWORK_TYPE_MASK BITS(4, 5)
|
|
||||||
#define HIF_TX_HDR_NETWORK_TYPE_OFFSET 4
|
|
||||||
#define HIF_TX_HDR_FLAG_1X_FRAME_MASK BIT(6)
|
|
||||||
#define HIF_TX_HDR_FLAG_1X_FRAME_OFFSET 6
|
|
||||||
#define HIF_TX_HDR_FLAG_802_11_FORMAT_MASK BIT(7)
|
|
||||||
#define HIF_TX_HDR_FLAG_802_11_FORMAT_OFFSET 7
|
|
||||||
|
|
||||||
/* DW2, Byte 3 */
|
|
||||||
#define HIF_TX_HDR_PS_FORWARDING_TYPE_MASK BITS(0, 1)
|
|
||||||
#define HIF_TX_HDR_PS_SESSION_ID_MASK BITS(2, 4)
|
|
||||||
#define HIF_TX_HDR_PS_SESSION_ID_OFFSET 2
|
|
||||||
#define HIF_TX_HDR_BURST_END_MASK BIT(5)
|
|
||||||
#define HIF_TX_HDR_BURST_END_OFFSET 5
|
|
||||||
|
|
||||||
/* DW3, Byte 1 */
|
|
||||||
#define HIF_TX_HDR_NEED_ACK BIT(0)
|
|
||||||
#define HIF_TX_HDR_BIP BIT(1)
|
|
||||||
#define HIF_TX_HDR_BASIC_RATE BIT(2)
|
|
||||||
#define HIF_TX_HDR_NEED_TX_DONE_STATUS BIT(3)
|
|
||||||
#define HIF_TX_HDR_RTS BIT(4)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef struct _HIF_HW_TX_HEADER_T {
|
|
||||||
UINT_16 u2TxByteCount;
|
|
||||||
UINT_8 ucEtherTypeOffset;
|
|
||||||
UINT_8 ucCSflags;
|
|
||||||
UINT_8 aucBuffer[0];
|
|
||||||
} HIF_HW_TX_HEADER_T, *P_HIF_HW_TX_HEADER_T;
|
|
||||||
|
|
||||||
typedef struct _HIF_TX_HEADER_T {
|
|
||||||
UINT_16 u2TxByteCount_UserPriority;
|
|
||||||
UINT_8 ucEtherTypeOffset;
|
|
||||||
UINT_8 ucResource_PktType_CSflags;
|
|
||||||
UINT_8 ucWlanHeaderLength;
|
|
||||||
UINT_8 ucPktFormtId_Flags;
|
|
||||||
UINT_16 u2LLH; /* for BOW */
|
|
||||||
UINT_16 u2SeqNo; /* for BOW */
|
|
||||||
UINT_8 ucStaRecIdx;
|
|
||||||
UINT_8 ucForwardingType_SessionID_Reserved;
|
|
||||||
UINT_8 ucPacketSeqNo;
|
|
||||||
UINT_8 ucAck_BIP_BasicRate;
|
|
||||||
UINT_8 aucReserved[2];
|
|
||||||
} HIF_TX_HEADER_T, *P_HIF_TX_HEADER_T;
|
|
||||||
|
|
||||||
typedef struct _HIF_TX_DESC_T {
|
|
||||||
UINT_8 ucOwn;
|
|
||||||
UINT_8 ucDescChksum;
|
|
||||||
UINT_16 u2Rsrv1;
|
|
||||||
UINT_32 u4NextDesc;
|
|
||||||
UINT_32 u4BufStartAddr;
|
|
||||||
UINT_32 u4Rsrv2;
|
|
||||||
} HIF_TX_DESC_T, *P_HIF_TX_DESC_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_HIF_TX_PKT_TYPE_T {
|
|
||||||
HIF_TX_PKT_TYPE_DATA = 0,
|
|
||||||
HIF_TX_PKT_TYPE_CMD,
|
|
||||||
HIF_TX_PKT_TYPE_HIF_LOOPBACK,
|
|
||||||
HIF_TX_PKT_TYPE_MANAGEMENT,
|
|
||||||
HIF_TX_PKT_TYPE_NUM
|
|
||||||
} ENUM_HIF_TX_PKT_TYPE_T, *P_ENUM_HIF_TX_PKT_TYPE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_HIF_OOB_CTRL_PKT_TYPE_T {
|
|
||||||
HIF_OOB_CTRL_PKT_TYPE_LOOPBACK = 1,
|
|
||||||
HIF_OOB_CTRL_PKT_TYP_NUM
|
|
||||||
} ENUM_HIF_OOB_CTRL_PKT_TYPE_T, *P_ENUM_HIF_OOB_CTRL_PKT_TYPE_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define TFCB_FRAME_PAD_TO_DW(u2Length) ALIGN_4(u2Length)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Kevin: we don't have to call following function to inspect the data structure.
|
|
||||||
* It will check automatically while at compile time.
|
|
||||||
*/
|
|
||||||
static inline VOID hif_txDataTypeCheck(VOID);
|
|
||||||
|
|
||||||
static inline VOID hif_txDataTypeCheck(VOID)
|
|
||||||
{
|
|
||||||
DATA_STRUCT_INSPECTING_ASSERT(sizeof(HIF_TX_HEADER_T) == 16);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /*_HIF_TX_H */
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,258 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _MTREG_H
|
|
||||||
#define _MTREG_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* 1 MT6628 MCR Definition */
|
|
||||||
|
|
||||||
/* 2 Host Interface */
|
|
||||||
|
|
||||||
/* 4 CHIP ID Register */
|
|
||||||
#define MCR_WCIR 0x0000
|
|
||||||
|
|
||||||
/* 4 HIF Low Power Control Register */
|
|
||||||
#define MCR_WHLPCR 0x0004
|
|
||||||
|
|
||||||
/* 4 Control Status Register */
|
|
||||||
#define MCR_WSDIOCSR 0x0008
|
|
||||||
#define MCR_WSPICSR 0x0008
|
|
||||||
|
|
||||||
/* 4 HIF Control Register */
|
|
||||||
#define MCR_WHCR 0x000C
|
|
||||||
|
|
||||||
/* 4 HIF Interrupt Status Register */
|
|
||||||
#define MCR_WHISR 0x0010
|
|
||||||
|
|
||||||
/* 4 HIF Interrupt Enable Register */
|
|
||||||
#define MCR_WHIER 0x0014
|
|
||||||
|
|
||||||
/* 4 Abnormal Status Register */
|
|
||||||
#define MCR_WASR 0x0018
|
|
||||||
|
|
||||||
/* 4 WLAN Software Interrupt Control Register */
|
|
||||||
#define MCR_WSICR 0x001C
|
|
||||||
|
|
||||||
/* 4 WLAN TX Status Register */
|
|
||||||
#define MCR_WTSR0 0x0020
|
|
||||||
|
|
||||||
/* 4 WLAN TX Status Register */
|
|
||||||
#define MCR_WTSR1 0x0024
|
|
||||||
|
|
||||||
/* 4 WLAN TX Data Register 0 */
|
|
||||||
#define MCR_WTDR0 0x0028
|
|
||||||
|
|
||||||
/* 4 WLAN TX Data Register 1 */
|
|
||||||
#define MCR_WTDR1 0x002C
|
|
||||||
|
|
||||||
/* 4 WLAN RX Data Register 0 */
|
|
||||||
#define MCR_WRDR0 0x0030
|
|
||||||
|
|
||||||
/* 4 WLAN RX Data Register 1 */
|
|
||||||
#define MCR_WRDR1 0x0034
|
|
||||||
|
|
||||||
/* 4 Host to Device Send Mailbox 0 Register */
|
|
||||||
#define MCR_H2DSM0R 0x0038
|
|
||||||
|
|
||||||
/* 4 Host to Device Send Mailbox 1 Register */
|
|
||||||
#define MCR_H2DSM1R 0x003c
|
|
||||||
|
|
||||||
/* 4 Device to Host Receive Mailbox 0 Register */
|
|
||||||
#define MCR_D2HRM0R 0x0040
|
|
||||||
|
|
||||||
/* 4 Device to Host Receive Mailbox 1 Register */
|
|
||||||
#define MCR_D2HRM1R 0x0044
|
|
||||||
|
|
||||||
/* 4 Device to Host Receive Mailbox 2 Register */
|
|
||||||
#define MCR_D2HRM2R 0x0048
|
|
||||||
|
|
||||||
/* 4 WLAN RX Packet Length Register */
|
|
||||||
#define MCR_WRPLR 0x0050
|
|
||||||
|
|
||||||
/* 4 HSIF Transaction Count Register */
|
|
||||||
#define MCR_HSTCR 0x0058
|
|
||||||
|
|
||||||
/* #if CFG_SDIO_INTR_ENHANCE */
|
|
||||||
typedef struct _ENHANCE_MODE_DATA_STRUCT_T {
|
|
||||||
UINT_32 u4WHISR;
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
UINT_8 ucTQ0Cnt;
|
|
||||||
UINT_8 ucTQ1Cnt;
|
|
||||||
UINT_8 ucTQ2Cnt;
|
|
||||||
UINT_8 ucTQ3Cnt;
|
|
||||||
UINT_8 ucTQ4Cnt;
|
|
||||||
UINT_8 ucTQ5Cnt;
|
|
||||||
UINT_16 u2Rsrv;
|
|
||||||
} u;
|
|
||||||
UINT_32 au4WTSR[2];
|
|
||||||
} rTxInfo;
|
|
||||||
union {
|
|
||||||
struct {
|
|
||||||
UINT_16 u2NumValidRx0Len;
|
|
||||||
UINT_16 u2NumValidRx1Len;
|
|
||||||
UINT_16 au2Rx0Len[16];
|
|
||||||
UINT_16 au2Rx1Len[16];
|
|
||||||
} u;
|
|
||||||
UINT_32 au4RxStatusRaw[17];
|
|
||||||
} rRxInfo;
|
|
||||||
UINT_32 u4RcvMailbox0;
|
|
||||||
UINT_32 u4RcvMailbox1;
|
|
||||||
} ENHANCE_MODE_DATA_STRUCT_T, *P_ENHANCE_MODE_DATA_STRUCT_T;
|
|
||||||
/* #endif */ /* ENHANCE_MODE_DATA_STRUCT_T */
|
|
||||||
|
|
||||||
/* 2 Definition in each register */
|
|
||||||
/* 3 WCIR 0x0000 */
|
|
||||||
#define WCIR_WLAN_READY BIT(21)
|
|
||||||
#define WCIR_POR_INDICATOR BIT(20)
|
|
||||||
#define WCIR_REVISION_ID BITS(16, 19)
|
|
||||||
#define WCIR_CHIP_ID BITS(0, 15)
|
|
||||||
|
|
||||||
#define MTK_CHIP_REV_72 0x00006572
|
|
||||||
#define MTK_CHIP_REV_82 0x00006582
|
|
||||||
#define MTK_CHIP_REV_92 0x00006592
|
|
||||||
#define MTK_CHIP_MP_REVERSION_ID 0x0
|
|
||||||
|
|
||||||
/* 3 WHLPCR 0x0004 */
|
|
||||||
#define WHLPCR_FW_OWN_REQ_CLR BIT(9)
|
|
||||||
#define WHLPCR_FW_OWN_REQ_SET BIT(8)
|
|
||||||
#define WHLPCR_IS_DRIVER_OWN BIT(8)
|
|
||||||
#define WHLPCR_INT_EN_CLR BIT(1)
|
|
||||||
#define WHLPCR_INT_EN_SET BIT(0)
|
|
||||||
|
|
||||||
/* 3 WSDIOCSR 0x0008 */
|
|
||||||
#define WSDIOCSR_SDIO_RE_INIT_EN BIT(0)
|
|
||||||
|
|
||||||
/* 3 WSPICSR 0x0008 */
|
|
||||||
#define WCSR_SPI_MODE_SEL BITS(3, 4)
|
|
||||||
#define WCSR_SPI_ENDIAN_BIG BIT(2)
|
|
||||||
#define WCSR_SPI_INT_OUT_MODE BIT(1)
|
|
||||||
#define WCSR_SPI_DATA_OUT_MODE BIT(0)
|
|
||||||
|
|
||||||
/* 3 WHCR 0x000C */
|
|
||||||
#define WHCR_RX_ENHANCE_MODE_EN BIT(16)
|
|
||||||
#define WHCR_MAX_HIF_RX_LEN_NUM BITS(4, 7)
|
|
||||||
#define WHCR_W_MAILBOX_RD_CLR_EN BIT(2)
|
|
||||||
#define WHCR_W_INT_CLR_CTRL BIT(1)
|
|
||||||
#define WHCR_MCU_DBG_EN BIT(0)
|
|
||||||
#define WHCR_OFFSET_MAX_HIF_RX_LEN_NUM 4
|
|
||||||
|
|
||||||
/* 3 WHISR 0x0010 */
|
|
||||||
#define WHISR_D2H_SW_INT BITS(8, 31)
|
|
||||||
#define WHISR_D2H_SW_ASSERT_INFO_INT BIT(31)
|
|
||||||
#define WHISR_FW_OWN_BACK_INT BIT(4)
|
|
||||||
#define WHISR_ABNORMAL_INT BIT(3)
|
|
||||||
#define WHISR_RX1_DONE_INT BIT(2)
|
|
||||||
#define WHISR_RX0_DONE_INT BIT(1)
|
|
||||||
#define WHISR_TX_DONE_INT BIT(0)
|
|
||||||
|
|
||||||
/* 3 WHIER 0x0014 */
|
|
||||||
#define WHIER_D2H_SW_INT BITS(8, 31)
|
|
||||||
#define WHIER_FW_OWN_BACK_INT_EN BIT(4)
|
|
||||||
#define WHIER_ABNORMAL_INT_EN BIT(3)
|
|
||||||
#define WHIER_RX1_DONE_INT_EN BIT(2)
|
|
||||||
#define WHIER_RX0_DONE_INT_EN BIT(1)
|
|
||||||
#define WHIER_TX_DONE_INT_EN BIT(0)
|
|
||||||
#define WHIER_DEFAULT (WHIER_RX0_DONE_INT_EN | \
|
|
||||||
WHIER_RX1_DONE_INT_EN | \
|
|
||||||
WHIER_TX_DONE_INT_EN | \
|
|
||||||
WHIER_ABNORMAL_INT_EN | \
|
|
||||||
WHIER_D2H_SW_INT \
|
|
||||||
)
|
|
||||||
|
|
||||||
/* 3 WASR 0x0018 */
|
|
||||||
#define WASR_FW_OWN_INVALID_ACCESS BIT(4)
|
|
||||||
#define WASR_RX1_UNDER_FLOW BIT(3)
|
|
||||||
#define WASR_RX0_UNDER_FLOW BIT(2)
|
|
||||||
#define WASR_TX1_OVER_FLOW BIT(1)
|
|
||||||
#define WASR_TX0_OVER_FLOW BIT(0)
|
|
||||||
|
|
||||||
/* 3 WSICR 0x001C */
|
|
||||||
#define WSICR_H2D_SW_INT_SET BITS(16, 31)
|
|
||||||
|
|
||||||
/* 3 WRPLR 0x0050 */
|
|
||||||
#define WRPLR_RX1_PACKET_LENGTH BITS(16, 31)
|
|
||||||
#define WRPLR_RX0_PACKET_LENGTH BITS(0, 15)
|
|
||||||
|
|
||||||
/* 3 HSTCR 0x0058 */
|
|
||||||
#define HSTCR_AFF_BURST_LEN BITS(24, 25)
|
|
||||||
#define HSTCR_AFF_BURST_LEN_OFFSET 24
|
|
||||||
#define HSTCR_TRANS_TARGET BITS(20, 22)
|
|
||||||
#define HSTCR_TRANS_TARGET_OFFSET 20
|
|
||||||
#define HSTCR_HSIF_TRANS_CNT BITS(2, 19)
|
|
||||||
#define HSTCR_HSIF_TRANS_CNT_OFFSET 2
|
|
||||||
|
|
||||||
/* HSTCR_TRANS_TARGET */
|
|
||||||
typedef enum _eTransTarget {
|
|
||||||
TRANS_TARGET_TXD0 = 0,
|
|
||||||
TRANS_TARGET_TXD1,
|
|
||||||
TRANS_TARGET_RXD0,
|
|
||||||
TRANS_TARGET_RXD1,
|
|
||||||
TRANS_TARGET_WHISR,
|
|
||||||
NUM_TRANS_TARGET
|
|
||||||
} E_TRANS_TARGET_T;
|
|
||||||
|
|
||||||
typedef enum _E_AFF_BURST_LEN {
|
|
||||||
BURST_1_DW = 0,
|
|
||||||
BURST_4_DW,
|
|
||||||
BURST_8_DW,
|
|
||||||
BURST_RSV,
|
|
||||||
NUM_AFF_BURST_LEN
|
|
||||||
} E_AFF_BURST_LEN;
|
|
||||||
|
|
||||||
#endif /* _MTREG_H */
|
|
|
@ -1,306 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _NIC_H
|
|
||||||
#define _NIC_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct _REG_ENTRY_T {
|
|
||||||
UINT_32 u4Offset;
|
|
||||||
UINT_32 u4Value;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _TABLE_ENTRY_T {
|
|
||||||
P_REG_ENTRY_T pu4TablePtr;
|
|
||||||
UINT_16 u2Size;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*! INT status to event map */
|
|
||||||
typedef struct _INT_EVENT_MAP_T {
|
|
||||||
UINT_32 u4Int;
|
|
||||||
UINT_32 u4Event;
|
|
||||||
} INT_EVENT_MAP_T, *P_INT_EVENT_MAP_T;
|
|
||||||
|
|
||||||
enum ENUM_INT_EVENT_T {
|
|
||||||
INT_EVENT_ABNORMAL,
|
|
||||||
INT_EVENT_SW_INT,
|
|
||||||
INT_EVENT_TX,
|
|
||||||
INT_EVENT_RX,
|
|
||||||
INT_EVENT_NUM
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef enum _ENUM_IE_UPD_METHOD_T {
|
|
||||||
IE_UPD_METHOD_UPDATE_RANDOM,
|
|
||||||
IE_UPD_METHOD_UPDATE_ALL,
|
|
||||||
IE_UPD_METHOD_DELETE_ALL,
|
|
||||||
#if CFG_SUPPORT_P2P_GO_OFFLOAD_PROBE_RSP
|
|
||||||
IE_UPD_METHOD_UPDATE_PROBE_RSP,
|
|
||||||
#endif
|
|
||||||
} ENUM_IE_UPD_METHOD_T, *P_ENUM_IE_UPD_METHOD_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
extern BOOLEAN fgIsResetting;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Routines in nic.c */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS nicAllocateAdapterMemory(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicReleaseAdapterMemory(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicDisableInterrupt(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicEnableInterrupt(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS nicProcessIST(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS nicProcessIST_impl(IN P_ADAPTER_T prAdapter, IN UINT_32 u4IntStatus);
|
|
||||||
|
|
||||||
WLAN_STATUS nicInitializeAdapter(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicMCRInit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN nicVerifyChipID(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
#if CFG_SDIO_INTR_ENHANCE
|
|
||||||
VOID nicSDIOInit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicSDIOReadIntStatus(IN P_ADAPTER_T prAdapter, OUT PUINT_32 pu4IntStatus);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BOOLEAN nicpmSetDriverOwn(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicpmSetFWOwn(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgEnableGlobalInt);
|
|
||||||
|
|
||||||
BOOLEAN nicpmSetAcpiPowerD0(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN nicpmSetAcpiPowerD3(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
#if defined(_HIF_SPI)
|
|
||||||
void nicRestoreSpiDefMode(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VOID nicProcessSoftwareInterrupt(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicProcessAbnormalInterrupt(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicPutMailbox(IN P_ADAPTER_T prAdapter, IN UINT_32 u4MailboxNum, IN UINT_32 u4Data);
|
|
||||||
|
|
||||||
VOID nicGetMailbox(IN P_ADAPTER_T prAdapter, IN UINT_32 u4MailboxNum, OUT PUINT_32 pu4Data);
|
|
||||||
|
|
||||||
VOID nicSetSwIntr(IN P_ADAPTER_T prAdapter, IN UINT_32 u4SwIntrBitmap);
|
|
||||||
|
|
||||||
P_CMD_INFO_T nicGetPendingCmdInfo(IN P_ADAPTER_T prAdapter, IN UINT_8 ucSeqNum);
|
|
||||||
|
|
||||||
P_MSDU_INFO_T nicGetPendingTxMsduInfo(IN P_ADAPTER_T prAdapter, IN UINT_8 ucSeqNum);
|
|
||||||
|
|
||||||
P_MSDU_INFO_T nicGetPendingStaMMPDU(IN P_ADAPTER_T prAdapter, IN UINT_8 ucStaRecIdx);
|
|
||||||
|
|
||||||
VOID nicFreePendingTxMsduInfoByNetwork(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType);
|
|
||||||
|
|
||||||
UINT_8 nicIncreaseCmdSeqNum(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
UINT_8 nicIncreaseTxSeqNum(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/* Media State Change */
|
|
||||||
WLAN_STATUS
|
|
||||||
nicMediaStateChange(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType, IN P_EVENT_CONNECTION_STATUS prConnectionStatus);
|
|
||||||
|
|
||||||
/* Utility function for channel number conversion */
|
|
||||||
UINT_32 nicChannelNum2Freq(IN UINT_32 u4ChannelNum);
|
|
||||||
|
|
||||||
UINT_32 nicFreq2ChannelNum(IN UINT_32 u4FreqInKHz);
|
|
||||||
|
|
||||||
/* firmware command wrapper */
|
|
||||||
/* NETWORK (WIFISYS) */
|
|
||||||
WLAN_STATUS nicActivateNetwork(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx);
|
|
||||||
|
|
||||||
WLAN_STATUS nicDeactivateNetwork(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx);
|
|
||||||
|
|
||||||
/* BSS-INFO */
|
|
||||||
WLAN_STATUS nicUpdateBss(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx);
|
|
||||||
|
|
||||||
/* BSS-INFO Indication (PM) */
|
|
||||||
WLAN_STATUS nicPmIndicateBssCreated(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx);
|
|
||||||
|
|
||||||
WLAN_STATUS nicPmIndicateBssConnected(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx);
|
|
||||||
|
|
||||||
WLAN_STATUS nicPmIndicateBssAbort(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx);
|
|
||||||
|
|
||||||
/* Beacon Template Update */
|
|
||||||
WLAN_STATUS
|
|
||||||
nicUpdateBeaconIETemplate(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_IE_UPD_METHOD_T eIeUpdMethod,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
|
||||||
IN UINT_16 u2Capability, IN PUINT_8 aucIe, IN UINT_16 u2IELen);
|
|
||||||
|
|
||||||
WLAN_STATUS nicQmUpdateWmmParms(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx);
|
|
||||||
|
|
||||||
WLAN_STATUS nicQmSetRxBASize(IN P_ADAPTER_T prAdapter, BOOLEAN enable, UINT32 size);
|
|
||||||
|
|
||||||
WLAN_STATUS nicSetAutoTxPower(IN P_ADAPTER_T prAdapter, IN P_CMD_AUTO_POWER_PARAM_T prAutoPwrParam);
|
|
||||||
|
|
||||||
WLAN_STATUS nicSetUApsdParam(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PARAM_CUSTOM_UAPSD_PARAM_STRUCT_T rUapsdParams, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Calibration Control */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS nicUpdateTxPower(IN P_ADAPTER_T prAdapter, IN P_CMD_TX_PWR_T prTxPwrParam);
|
|
||||||
#if CFG_SUPPORT_TX_POWER_BACK_OFF
|
|
||||||
WLAN_STATUS nicUpdateTxPowerOffset(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_CMD_MITIGATED_PWR_OFFSET_T prTxPwrOffsetParam);
|
|
||||||
WLAN_STATUS nicTxPowerBackOff(IN P_ADAPTER_T prAdapter, IN UINT32 TxPowerBackOffParam);
|
|
||||||
#endif
|
|
||||||
WLAN_STATUS nicUpdate5GOffset(IN P_ADAPTER_T prAdapter, IN P_CMD_5G_PWR_OFFSET_T pr5GPwrOffset);
|
|
||||||
|
|
||||||
WLAN_STATUS nicUpdateDPD(IN P_ADAPTER_T prAdapter, IN P_CMD_PWR_PARAM_T prDpdCalResult);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* PHY configuration */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID nicSetAvailablePhyTypeSet(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* MGMT and System Service Control */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID nicInitSystemService(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicResetSystemService(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicUninitSystemService(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicInitMGMT(IN P_ADAPTER_T prAdapter, IN P_REG_INFO_T prRegInfo);
|
|
||||||
|
|
||||||
VOID nicUninitMGMT(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
nicConfigPowerSaveProfile(IN P_ADAPTER_T prAdapter,
|
|
||||||
ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, PARAM_POWER_MODE ePwrMode, BOOLEAN fgEnCmdEvent);
|
|
||||||
|
|
||||||
WLAN_STATUS nicEnterCtiaMode(IN P_ADAPTER_T prAdapter, BOOLEAN fgEnterCtia, BOOLEAN fgEnCmdEvent);
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Scan Result Processing */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID
|
|
||||||
nicAddScanResult(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PARAM_MAC_ADDRESS rMacAddr,
|
|
||||||
IN P_PARAM_SSID_T prSsid,
|
|
||||||
IN UINT_16 u2CapInfo,
|
|
||||||
IN PARAM_RSSI rRssi,
|
|
||||||
IN ENUM_PARAM_NETWORK_TYPE_T eNetworkType,
|
|
||||||
IN P_PARAM_802_11_CONFIG_T prConfiguration,
|
|
||||||
IN ENUM_PARAM_OP_MODE_T eOpMode,
|
|
||||||
IN PARAM_RATES_EX rSupportedRates, IN UINT_16 u2IELength, IN PUINT_8 pucIEBuf);
|
|
||||||
|
|
||||||
VOID nicFreeScanResultIE(IN P_ADAPTER_T prAdapter, IN UINT_32 u4Idx);
|
|
||||||
|
|
||||||
#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1)
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Workaround Control */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS nicEnableClockGating(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS nicDisableClockGating(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Fixed Rate Hacking */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS
|
|
||||||
nicUpdateRateParams(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_REGISTRY_FIXED_RATE_T eRateSetting,
|
|
||||||
IN PUINT_8 pucDesiredPhyTypeSet,
|
|
||||||
IN PUINT_16 pu2DesiredNonHTRateSet,
|
|
||||||
IN PUINT_16 pu2BSSBasicRateSet,
|
|
||||||
IN PUINT_8 pucMcsSet, IN PUINT_8 pucSupMcs32, IN PUINT_16 u2HtCapInfo);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Write registers */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS nicWriteMcr(IN P_ADAPTER_T prAdapter, IN UINT_32 u4Address, IN UINT_32 u4Value);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Update auto rate */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS
|
|
||||||
nicRlmArUpdateParms(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_32 u4ArSysParam0,
|
|
||||||
IN UINT_32 u4ArSysParam1, IN UINT_32 u4ArSysParam2, IN UINT_32 u4ArSysParam3);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Enable/Disable Roaming */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS nicRoamingUpdateParams(IN P_ADAPTER_T prAdapter, IN UINT_32 u4EnableRoaming);
|
|
||||||
|
|
||||||
VOID nicPrintFirmwareAssertInfo(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Link Quality Updating */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID
|
|
||||||
nicUpdateLinkQuality(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx, IN P_EVENT_LINK_QUALITY prEventLinkQuality);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
nicUpdateRSSI(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx, IN INT_8 cRssi, IN INT_8 cLinkQuality);
|
|
||||||
|
|
||||||
VOID nicUpdateLinkSpeed(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx, IN UINT_16 u2LinkSpeed);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_RDD_TEST_MODE
|
|
||||||
WLAN_STATUS nicUpdateRddTestMode(IN P_ADAPTER_T prAdapter, IN P_CMD_RDD_CH_T prRddChParam);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_SET_CAM_BY_PROC
|
|
||||||
VOID nicForceSetCAM(BOOLEAN enabled);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _NIC_H */
|
|
|
@ -1,284 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _NIC_RX_H
|
|
||||||
#define _NIC_RX_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
extern void kalDevLoopbkRxHandle(IN P_ADAPTER_T prAdapter, IN OUT P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define MAX_SEQ_NO 4095
|
|
||||||
#define MAX_SEQ_NO_COUNT 4096
|
|
||||||
#define HALF_SEQ_NO_CNOUT 2048
|
|
||||||
|
|
||||||
#define HALF_SEQ_NO_COUNT 2048
|
|
||||||
|
|
||||||
#define MT6620_FIXED_WIN_SIZE 64
|
|
||||||
#define CFG_RX_MAX_BA_ENTRY 4
|
|
||||||
#define CFG_RX_MAX_BA_TID_NUM 8
|
|
||||||
|
|
||||||
#if (CFG_SRAM_SIZE_OPTION == 1)
|
|
||||||
/* set default RXBA size to 16, for DIR-635/DIR-655 IOT issue
|
|
||||||
* (ALPS02494017 BA size must be power of 2)
|
|
||||||
*/
|
|
||||||
#define IOT_RX_BA_SIZE 16
|
|
||||||
#elif (CFG_SRAM_SIZE_OPTION == 0)
|
|
||||||
#define IOT_RX_BA_SIZE 8
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define RX_STATUS_FLAG_MORE_PACKET BIT(30)
|
|
||||||
#define RX_STATUS_CHKSUM_MASK BITS(0, 10)
|
|
||||||
|
|
||||||
#define RX_RFB_LEN_FIELD_LEN 4
|
|
||||||
#define RX_HEADER_OFFSET 2
|
|
||||||
|
|
||||||
#define RX_RETURN_INDICATED_RFB_TIMEOUT_SEC 3
|
|
||||||
|
|
||||||
#define RX_FW_FLUSH_PKT_THRESHOLD 20
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(_HIF_SDIO) && defined(WINDOWS_DDK)
|
|
||||||
/*! On XP, maximum Tx+Rx Statue <= 64-4(HISR)*/
|
|
||||||
#define SDIO_MAXIMUM_RX_LEN_NUM 0 /*!< 0~15 (0: un-limited) */
|
|
||||||
#else
|
|
||||||
#define SDIO_MAXIMUM_RX_LEN_NUM 0 /*!< 0~15 (0: un-limited) */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef enum _ENUM_RX_STATISTIC_COUNTER_T {
|
|
||||||
RX_MPDU_TOTAL_COUNT = 0,
|
|
||||||
RX_SIZE_ERR_DROP_COUNT,
|
|
||||||
|
|
||||||
RX_DATA_INDICATION_COUNT,
|
|
||||||
RX_DATA_RETURNED_COUNT,
|
|
||||||
RX_DATA_RETAINED_COUNT,
|
|
||||||
|
|
||||||
RX_DROP_TOTAL_COUNT,
|
|
||||||
RX_TYPE_ERR_DROP_COUNT,
|
|
||||||
RX_CLASS_ERR_DROP_COUNT,
|
|
||||||
RX_DST_NULL_DROP_COUNT,
|
|
||||||
|
|
||||||
#if CFG_TCP_IP_CHKSUM_OFFLOAD || CFG_TCP_IP_CHKSUM_OFFLOAD_NDIS_60
|
|
||||||
RX_CSUM_TCP_FAILED_COUNT,
|
|
||||||
RX_CSUM_UDP_FAILED_COUNT,
|
|
||||||
RX_CSUM_IP_FAILED_COUNT,
|
|
||||||
RX_CSUM_TCP_SUCCESS_COUNT,
|
|
||||||
RX_CSUM_UDP_SUCCESS_COUNT,
|
|
||||||
RX_CSUM_IP_SUCCESS_COUNT,
|
|
||||||
RX_CSUM_UNKNOWN_L4_PKT_COUNT,
|
|
||||||
RX_CSUM_UNKNOWN_L3_PKT_COUNT,
|
|
||||||
RX_IP_V6_PKT_CCOUNT,
|
|
||||||
#endif
|
|
||||||
RX_STATISTIC_COUNTER_NUM
|
|
||||||
} ENUM_RX_STATISTIC_COUNTER_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_RX_PKT_DESTINATION_T {
|
|
||||||
RX_PKT_DESTINATION_HOST, /* to OS */
|
|
||||||
RX_PKT_DESTINATION_FORWARD, /* to TX queue for forward, AP mode */
|
|
||||||
RX_PKT_DESTINATION_HOST_WITH_FORWARD, /* to both TX and OS, AP mode broadcast packet */
|
|
||||||
RX_PKT_DESTINATION_NULL, /* packet to be freed */
|
|
||||||
RX_PKT_DESTINATION_NUM
|
|
||||||
} ENUM_RX_PKT_DESTINATION_T;
|
|
||||||
|
|
||||||
struct _SW_RFB_T {
|
|
||||||
QUE_ENTRY_T rQueEntry;
|
|
||||||
PVOID pvPacket; /*!< ptr to rx Packet Descriptor */
|
|
||||||
PUINT_8 pucRecvBuff; /*!< ptr to receive data buffer */
|
|
||||||
P_HIF_RX_HEADER_T prHifRxHdr;
|
|
||||||
UINT_32 u4HifRxHdrFlag;
|
|
||||||
PVOID pvHeader;
|
|
||||||
UINT_16 u2PacketLen;
|
|
||||||
UINT_16 u2HeaderLen;
|
|
||||||
UINT_16 u2SSN;
|
|
||||||
UINT_8 ucTid;
|
|
||||||
UINT_8 ucWlanIdx;
|
|
||||||
UINT_8 ucPacketType;
|
|
||||||
UINT_8 ucStaRecIdx;
|
|
||||||
|
|
||||||
ENUM_CSUM_RESULT_T aeCSUM[CSUM_TYPE_NUM];
|
|
||||||
ENUM_RX_PKT_DESTINATION_T eDst;
|
|
||||||
ENUM_TRAFFIC_CLASS_INDEX_T eTC; /* only valid when eDst == FORWARD */
|
|
||||||
|
|
||||||
UINT_64 rRxTime;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*! RX configuration type structure */
|
|
||||||
typedef struct _RX_CTRL_T {
|
|
||||||
UINT_32 u4RxCachedSize;
|
|
||||||
PUINT_8 pucRxCached;
|
|
||||||
QUE_T rFreeSwRfbList;
|
|
||||||
QUE_T rReceivedRfbList;
|
|
||||||
QUE_T rIndicatedRfbList;
|
|
||||||
QUE_T rUnInitializedRfbList;
|
|
||||||
|
|
||||||
#if CFG_SDIO_RX_AGG
|
|
||||||
PUINT_8 pucRxCoalescingBufPtr;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
PVOID apvIndPacket[CFG_RX_MAX_PKT_NUM];
|
|
||||||
PVOID apvRetainedPacket[CFG_RX_MAX_PKT_NUM];
|
|
||||||
|
|
||||||
UINT_8 ucNumIndPacket;
|
|
||||||
UINT_8 ucNumRetainedPacket;
|
|
||||||
UINT_64 au8Statistics[RX_STATISTIC_COUNTER_NUM]; /*!< RX Counters */
|
|
||||||
|
|
||||||
#if CFG_HIF_STATISTICS
|
|
||||||
UINT_32 u4TotalRxAccessNum;
|
|
||||||
UINT_32 u4TotalRxPacketNum;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_HIF_RX_STARVATION_WARNING
|
|
||||||
UINT_32 u4QueuedCnt;
|
|
||||||
UINT_32 u4DequeuedCnt;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_RX_PKTS_DUMP
|
|
||||||
UINT_32 u4RxPktsDumpTypeMask;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_MULTITHREAD
|
|
||||||
QUE_T rRxDataRfbList;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} RX_CTRL_T, *P_RX_CTRL_T;
|
|
||||||
|
|
||||||
typedef struct _RX_MAILBOX_T {
|
|
||||||
UINT_32 u4RxMailbox[2]; /* for Device-to-Host Mailbox */
|
|
||||||
} RX_MAILBOX_T, *P_RX_MAILBOX_T;
|
|
||||||
|
|
||||||
typedef WLAN_STATUS(*PROCESS_RX_MGT_FUNCTION) (P_ADAPTER_T, P_SW_RFB_T);
|
|
||||||
|
|
||||||
struct ACTION_FRAME_SIZE_MAP {
|
|
||||||
UINT_16 u2Index; /* High byte for Action, low byte for Category */
|
|
||||||
size_t len;
|
|
||||||
};
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define RX_INC_CNT(prRxCtrl, eCounter) \
|
|
||||||
{((P_RX_CTRL_T)prRxCtrl)->au8Statistics[eCounter]++; }
|
|
||||||
|
|
||||||
#define RX_ADD_CNT(prRxCtrl, eCounter, u8Amount) \
|
|
||||||
{((P_RX_CTRL_T)prRxCtrl)->au8Statistics[eCounter] += (UINT_64)u8Amount; }
|
|
||||||
|
|
||||||
#define RX_GET_CNT(prRxCtrl, eCounter) \
|
|
||||||
(((P_RX_CTRL_T)prRxCtrl)->au8Statistics[eCounter])
|
|
||||||
|
|
||||||
#define RX_RESET_ALL_CNTS(prRxCtrl) \
|
|
||||||
{kalMemZero(&prRxCtrl->au8Statistics[0], sizeof(prRxCtrl->au8Statistics)); }
|
|
||||||
|
|
||||||
#define RX_STATUS_TEST_MORE_FLAG(flag) \
|
|
||||||
((BOOLEAN)((flag & RX_STATUS_FLAG_MORE_PACKET) ? TRUE : FALSE))
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
VOID nicRxInitialize(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicRxUninitialize(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicRxProcessRFBs(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
#if !CFG_SDIO_INTR_ENHANCE
|
|
||||||
VOID nicRxReceiveRFBs(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS nicRxReadBuffer(IN P_ADAPTER_T prAdapter, IN OUT P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
#else
|
|
||||||
VOID nicRxSDIOReceiveRFBs(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
nicRxEnhanceReadBuffer(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_32 u4DataPort, IN UINT_16 u2RxLength, IN OUT P_SW_RFB_T prSwRfb);
|
|
||||||
#endif /* CFG_SDIO_INTR_ENHANCE */
|
|
||||||
|
|
||||||
#if CFG_SDIO_RX_AGG
|
|
||||||
VOID nicRxSDIOAggReceiveRFBs(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WLAN_STATUS nicRxSetupRFB(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prRfb);
|
|
||||||
|
|
||||||
VOID nicRxReturnRFB(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID nicRxReturnRFBwithUninit(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb
|
|
||||||
, IN BOOLEAN fgIsUninitRfb);
|
|
||||||
|
|
||||||
VOID nicProcessRxInterrupt(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicRxProcessPktWithoutReorder(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID nicRxProcessForwardPkt(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID nicRxProcessGOBroadcastPkt(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID nicRxFillRFB(IN P_ADAPTER_T prAdapter, IN OUT P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID nicRxProcessDataPacket(IN P_ADAPTER_T prAdapter, IN OUT P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID nicRxProcessEventPacket(IN P_ADAPTER_T prAdapter, IN OUT P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID nicRxProcessMgmtPacket(IN P_ADAPTER_T prAdapter, IN OUT P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
#if CFG_TCP_IP_CHKSUM_OFFLOAD
|
|
||||||
VOID nicRxFillChksumStatus(IN P_ADAPTER_T prAdapter, IN OUT P_SW_RFB_T prSwRfb, IN UINT_32 u4TcpUdpIpCksStatus);
|
|
||||||
|
|
||||||
VOID nicRxUpdateCSUMStatistics(IN P_ADAPTER_T prAdapter, IN const ENUM_CSUM_RESULT_T aeCSUM[]);
|
|
||||||
#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */
|
|
||||||
|
|
||||||
VOID nicRxQueryStatus(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucBuffer, OUT PUINT_32 pu4Count);
|
|
||||||
|
|
||||||
VOID nicRxClearStatistics(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicRxQueryStatistics(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucBuffer, OUT PUINT_32 pu4Count);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
nicRxWaitResponse(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_8 ucPortIdx, OUT PUINT_8 pucRspBuffer, IN UINT_32 u4MaxRespBufferLen, OUT PUINT_32 pu4Length);
|
|
||||||
|
|
||||||
VOID nicRxEnablePromiscuousMode(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicRxDisablePromiscuousMode(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS nicRxFlush(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS nicRxProcessActionFrame(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
#endif /* _NIC_RX_H */
|
|
|
@ -1,418 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _NIC_TX_H
|
|
||||||
#define _NIC_TX_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define NIC_TX_RESOURCE_POLLING_TIMEOUT 256
|
|
||||||
#define NIC_TX_RESOURCE_POLLING_DELAY_MSEC 50
|
|
||||||
|
|
||||||
/* Maximum buffer count for individual HIF TCQ */
|
|
||||||
|
|
||||||
#if defined(MT6620)
|
|
||||||
#if CFG_SLT_SUPPORT
|
|
||||||
/* 20101215 mtk01725 Redistributed the initial TC resources for SLT operation */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC0 0 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC1 16 /* First connection: 32 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC2 0 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC3 0 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC4 4 /* First connection: 2 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC5 0 /* First connection: 0 */
|
|
||||||
#else
|
|
||||||
/* 20100302 mtk02468 Redistributed the initial TC resources for normal operation */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC0 6 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC1 8 /* First connection: 32 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC2 8 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC3 8 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC4 4 /* First connection: 2 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC5 2 /* First connection: 0 */
|
|
||||||
#endif
|
|
||||||
#elif defined(MT6628)
|
|
||||||
#if (CFG_SRAM_SIZE_OPTION == 0)
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC0 1 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC1 20 /* First connection: 32 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC2 1 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC3 1 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC4 4 /* First connection: 2 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC5 1 /* First connection: 0 */
|
|
||||||
#elif (CFG_SRAM_SIZE_OPTION == 1)
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC0 1 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC1 36 /* First connection: 32 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC2 1 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC3 1 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC4 4 /* First connection: 2 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC5 1 /* First connection: 0 */
|
|
||||||
#elif (CFG_SRAM_SIZE_OPTION == 2)
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC0 1 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC1 48 /* First connection: 32 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC2 1 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC3 1 /* First connection: 0 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC4 4 /* First connection: 2 */
|
|
||||||
#define NIC_TX_BUFF_COUNT_TC5 1 /* First connection: 0 */
|
|
||||||
#else
|
|
||||||
#error "> Set TX_BUFF_COUNT_TC error!"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define NIC_TX_BUFF_SUM (NIC_TX_BUFF_COUNT_TC0 + \
|
|
||||||
NIC_TX_BUFF_COUNT_TC1 + \
|
|
||||||
NIC_TX_BUFF_COUNT_TC2 + \
|
|
||||||
NIC_TX_BUFF_COUNT_TC3 + \
|
|
||||||
NIC_TX_BUFF_COUNT_TC4 + \
|
|
||||||
NIC_TX_BUFF_COUNT_TC5)
|
|
||||||
#if CFG_ENABLE_FW_DOWNLOAD
|
|
||||||
|
|
||||||
#define NIC_TX_INIT_BUFF_COUNT_TC0 8
|
|
||||||
#define NIC_TX_INIT_BUFF_COUNT_TC1 0
|
|
||||||
#define NIC_TX_INIT_BUFF_COUNT_TC2 0
|
|
||||||
#define NIC_TX_INIT_BUFF_COUNT_TC3 0
|
|
||||||
#define NIC_TX_INIT_BUFF_COUNT_TC4 0
|
|
||||||
#define NIC_TX_INIT_BUFF_COUNT_TC5 0
|
|
||||||
|
|
||||||
#define NIC_TX_INIT_BUFF_SUM (NIC_TX_INIT_BUFF_COUNT_TC0 + \
|
|
||||||
NIC_TX_INIT_BUFF_COUNT_TC1 + \
|
|
||||||
NIC_TX_INIT_BUFF_COUNT_TC2 + \
|
|
||||||
NIC_TX_INIT_BUFF_COUNT_TC3 + \
|
|
||||||
NIC_TX_INIT_BUFF_COUNT_TC4 + \
|
|
||||||
NIC_TX_INIT_BUFF_COUNT_TC5)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_ENABLE_PKT_LIFETIME_PROFILE
|
|
||||||
#define NIC_TX_TIME_THRESHOLD 100 /* in unit of ms */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MSDU_OPT_PROTECTED_FRAME BIT(13)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* 3 Session for TX QUEUES */
|
|
||||||
/* The definition in this ENUM is used to categorize packet's Traffic Class according
|
|
||||||
* to the their TID(User Priority).
|
|
||||||
* In order to achieve QoS goal, a particular TC should not block the process of
|
|
||||||
* another packet with different TC.
|
|
||||||
* In current design we will have 5 categories(TCs) of SW resource.
|
|
||||||
*/
|
|
||||||
typedef enum _ENUM_TRAFFIC_CLASS_INDEX_T {
|
|
||||||
TC0_INDEX = 0, /* HIF TX0: AC0 packets */
|
|
||||||
TC1_INDEX, /* HIF TX0: AC1 packets & non-QoS packets */
|
|
||||||
TC2_INDEX, /* HIF TX0: AC2 packets */
|
|
||||||
TC3_INDEX, /* HIF TX0: AC3 packets */
|
|
||||||
TC4_INDEX, /* HIF TX1: Command packets or 802.1x packets */
|
|
||||||
TC5_INDEX, /* HIF TX0: BMCAST packets */
|
|
||||||
TC_NUM /* Maximum number of Traffic Classes. */
|
|
||||||
} ENUM_TRAFFIC_CLASS_INDEX_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_TX_STATISTIC_COUNTER_T {
|
|
||||||
TX_MPDU_TOTAL_COUNT = 0,
|
|
||||||
TX_INACTIVE_BSS_DROP,
|
|
||||||
TX_INACTIVE_STA_DROP,
|
|
||||||
TX_FORWARD_OVERFLOW_DROP,
|
|
||||||
TX_AP_BORADCAST_DROP,
|
|
||||||
TX_STATISTIC_COUNTER_NUM
|
|
||||||
} ENUM_TX_STATISTIC_COUNTER_T;
|
|
||||||
|
|
||||||
typedef struct _TX_TCQ_STATUS_T {
|
|
||||||
UINT_8 aucFreeBufferCount[TC_NUM];
|
|
||||||
UINT_8 aucMaxNumOfBuffer[TC_NUM];
|
|
||||||
} TX_TCQ_STATUS_T, *P_TX_TCQ_STATUS_T;
|
|
||||||
|
|
||||||
typedef struct _TX_TCQ_ADJUST_T {
|
|
||||||
INT_8 acVariation[TC_NUM];
|
|
||||||
} TX_TCQ_ADJUST_T, *P_TX_TCQ_ADJUST_T;
|
|
||||||
|
|
||||||
typedef struct _TX_CTRL_T {
|
|
||||||
UINT_32 u4TxCachedSize;
|
|
||||||
PUINT_8 pucTxCached;
|
|
||||||
|
|
||||||
/* Elements below is classified according to TC (Traffic Class) value. */
|
|
||||||
|
|
||||||
TX_TCQ_STATUS_T rTc;
|
|
||||||
|
|
||||||
PUINT_8 pucTxCoalescingBufPtr;
|
|
||||||
|
|
||||||
QUE_T rFreeMsduInfoList;
|
|
||||||
|
|
||||||
/* Management Frame Tracking */
|
|
||||||
/* number of management frames to be sent */
|
|
||||||
INT_32 i4TxMgmtPendingNum;
|
|
||||||
|
|
||||||
/* to tracking management frames need TX done callback */
|
|
||||||
QUE_T rTxMgmtTxingQueue;
|
|
||||||
|
|
||||||
#if CFG_HIF_STATISTICS
|
|
||||||
UINT_32 u4TotalTxAccessNum;
|
|
||||||
UINT_32 u4TotalTxPacketNum;
|
|
||||||
#endif
|
|
||||||
UINT_32 au4Statistics[TX_STATISTIC_COUNTER_NUM];
|
|
||||||
|
|
||||||
/* Number to track forwarding frames */
|
|
||||||
INT_32 i4PendingFwdFrameCount;
|
|
||||||
|
|
||||||
} TX_CTRL_T, *P_TX_CTRL_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_TX_PACKET_SRC_T {
|
|
||||||
TX_PACKET_OS,
|
|
||||||
TX_PACKET_OS_OID,
|
|
||||||
TX_PACKET_FORWARDING,
|
|
||||||
TX_PACKET_MGMT,
|
|
||||||
TX_PACKET_NUM
|
|
||||||
} ENUM_TX_PACKET_SRC_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_HIF_TX_PACKET_TYPE_T {
|
|
||||||
HIF_TX_PACKET_TYPE_DATA = 0,
|
|
||||||
HIF_TX_PACKET_TYPE_COMMAND,
|
|
||||||
HIF_TX_PACKET_TYPE_HIF_LB,
|
|
||||||
HIF_TX_PACKET_TYPE_MGMT
|
|
||||||
} ENUM_HIF_TX_PACKET_TYPE_T, *P_ENUM_HIF_TX_PACKET_TYPE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_TX_RESULT_CODE_T {
|
|
||||||
TX_RESULT_SUCCESS = 0,
|
|
||||||
TX_RESULT_LIFE_TIMEOUT,
|
|
||||||
TX_RESULT_RTS_ERROR,
|
|
||||||
TX_RESULT_MPDU_ERROR,
|
|
||||||
TX_RESULT_AGING_TIMEOUT,
|
|
||||||
TX_RESULT_FLUSHED,
|
|
||||||
TX_RESULT_DROPPED_IN_DRIVER = 32,
|
|
||||||
TX_RESULT_FW_FLUSH = 78,
|
|
||||||
TX_RESULT_NUM
|
|
||||||
} ENUM_TX_RESULT_CODE_T, *P_ENUM_TX_RESULT_CODE_T;
|
|
||||||
|
|
||||||
struct _WLAN_CFG_ENTRY_T {
|
|
||||||
UINT_8 aucKey[WLAN_CFG_KEY_LEN_MAX];
|
|
||||||
UINT_8 aucValue[WLAN_CFG_VALUE_LEN_MAX];
|
|
||||||
WLAN_CFG_SET_CB pfSetCb;
|
|
||||||
PVOID pPrivate;
|
|
||||||
UINT_32 u4Flags;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _WLAN_CFG_T {
|
|
||||||
UINT_32 u4WlanCfgEntryNumMax;
|
|
||||||
UINT_32 u4WlanCfgKeyLenMax;
|
|
||||||
UINT_32 u4WlanCfgValueLenMax;
|
|
||||||
WLAN_CFG_ENTRY_T arWlanCfgBuf[WLAN_CFG_ENTRY_NUM_MAX];
|
|
||||||
};
|
|
||||||
|
|
||||||
/* TX Call Back Function */
|
|
||||||
typedef WLAN_STATUS(*PFN_TX_DONE_HANDLER) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
|
|
||||||
|
|
||||||
#if CFG_ENABLE_PKT_LIFETIME_PROFILE
|
|
||||||
typedef struct _PKT_PROFILE_T {
|
|
||||||
BOOLEAN fgIsValid;
|
|
||||||
#if CFG_PRINT_RTP_PROFILE
|
|
||||||
BOOLEAN fgIsPrinted;
|
|
||||||
UINT_16 u2IpSn;
|
|
||||||
UINT_16 u2RtpSn;
|
|
||||||
UINT_8 ucTcxFreeCount;
|
|
||||||
#endif
|
|
||||||
OS_SYSTIME rHardXmitArrivalTimestamp;
|
|
||||||
OS_SYSTIME rEnqueueTimestamp;
|
|
||||||
OS_SYSTIME rDequeueTimestamp;
|
|
||||||
OS_SYSTIME rHifTxDoneTimestamp;
|
|
||||||
} PKT_PROFILE_T, *P_PKT_PROFILE_T;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* TX transactions could be divided into 4 kinds:
|
|
||||||
*
|
|
||||||
* 1) 802.1X / Bluetooth-over-Wi-Fi Security Frames
|
|
||||||
* [CMD_INFO_T] - [prPacket] - in skb or NDIS_PACKET form
|
|
||||||
*
|
|
||||||
* 2) MMPDU
|
|
||||||
* [CMD_INFO_T] - [prPacket] - [MSDU_INFO_T] - [prPacket] - direct buffer for frame body
|
|
||||||
*
|
|
||||||
* 3) Command Packets
|
|
||||||
* [CMD_INFO_T] - [pucInfoBuffer] - direct buffer for content of command packet
|
|
||||||
*
|
|
||||||
* 4) Normal data frame
|
|
||||||
* [MSDU_INFO_T] - [prPacket] - in skb or NDIS_PACKET form
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* PS_FORWARDING_TYPE_NON_PS means that the receiving STA is in Active Mode
|
|
||||||
* from the perspective of host driver (maybe not synchronized with FW --> SN is needed)
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct _MSDU_INFO_T {
|
|
||||||
QUE_ENTRY_T rQueEntry;
|
|
||||||
P_NATIVE_PACKET prPacket;
|
|
||||||
|
|
||||||
ENUM_TX_PACKET_SRC_T eSrc; /* specify OS/FORWARD packet */
|
|
||||||
UINT_8 ucUserPriority;
|
|
||||||
|
|
||||||
/* For composing HIF TX header */
|
|
||||||
UINT_8 ucTC; /* Traffic Class: 0~4 (HIF TX0), 5 (HIF TX1) */
|
|
||||||
UINT_8 ucPacketType; /* 0: Data, 1: Command, 2: HIF Loopback 3: Management Frame */
|
|
||||||
UINT_8 ucStaRecIndex;
|
|
||||||
UINT_8 ucBssIndex; /*BSS_INFO_T index*/
|
|
||||||
UINT_8 ucNetworkType; /* See ENUM_NETWORK_TYPE_T */
|
|
||||||
UINT_8 ucFormatID; /* 0: MAUI, Linux, Windows NDIS 5.1 */
|
|
||||||
BOOLEAN fgIs802_1x; /* TRUE: 802.1x frame */
|
|
||||||
BOOLEAN fgIs802_11; /* TRUE: 802.11 header is present */
|
|
||||||
UINT_16 u2PalLLH; /* PAL Logical Link Header (for BOW network) */
|
|
||||||
UINT_16 u2AclSN; /* ACL Sequence Number (for BOW network) */
|
|
||||||
UINT_8 ucPsForwardingType; /* See ENUM_PS_FORWARDING_TYPE_T */
|
|
||||||
UINT_8 ucPsSessionID; /* PS Session ID specified by the FW for the STA */
|
|
||||||
BOOLEAN fgIsBurstEnd; /* TRUE means this is the last packet of the burst for (STA, TID) */
|
|
||||||
BOOLEAN fgIsBIP; /* Management Frame Protection */
|
|
||||||
BOOLEAN fgIsBasicRate; /* Force Basic Rate Transmission */
|
|
||||||
|
|
||||||
/* flattened from PACKET_INFO_T */
|
|
||||||
UINT_8 ucMacHeaderLength;
|
|
||||||
UINT_8 ucLlcLength; /* w/o EtherType */
|
|
||||||
UINT_16 u2FrameLength;
|
|
||||||
UINT_8 aucEthDestAddr[MAC_ADDR_LEN]; /* Ethernet Destination Address */
|
|
||||||
|
|
||||||
/* for TX done tracking */
|
|
||||||
UINT_8 ucTxSeqNum;
|
|
||||||
PFN_TX_DONE_HANDLER pfTxDoneHandler;
|
|
||||||
BOOLEAN fgNeedTxDoneStatus;
|
|
||||||
|
|
||||||
#if CFG_ENABLE_PKT_LIFETIME_PROFILE
|
|
||||||
PKT_PROFILE_T rPktProfile;
|
|
||||||
#endif
|
|
||||||
UINT_64 u8Cookie;
|
|
||||||
COMMAND_TYPE eCmdType;
|
|
||||||
UINT_8 ucCID;
|
|
||||||
UINT_32 u4InqueTime;
|
|
||||||
UINT_32 u4DbgTxPktStatusIndex;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define TX_INC_CNT(prTxCtrl, eCounter) \
|
|
||||||
{((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter]++; }
|
|
||||||
|
|
||||||
#define TX_ADD_CNT(prTxCtrl, eCounter, u8Amount) \
|
|
||||||
{((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter] += (UINT_32)u8Amount; }
|
|
||||||
|
|
||||||
#define TX_GET_CNT(prTxCtrl, eCounter) \
|
|
||||||
(((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter])
|
|
||||||
|
|
||||||
#define TX_RESET_ALL_CNTS(prTxCtrl) \
|
|
||||||
{kalMemZero(&prTxCtrl->au4Statistics[0], sizeof(prTxCtrl->au4Statistics)); }
|
|
||||||
|
|
||||||
#if CFG_ENABLE_PKT_LIFETIME_PROFILE
|
|
||||||
#define PRINT_PKT_PROFILE(_pkt_profile, _note) \
|
|
||||||
{ \
|
|
||||||
if (!(_pkt_profile)->fgIsPrinted) { \
|
|
||||||
DBGLOG(TX, TRACE, "X[%u] E[%u] D[%u] HD[%u] B[%d] RTP[%d] %s\n", \
|
|
||||||
(UINT_32)((_pkt_profile)->rHardXmitArrivalTimestamp), \
|
|
||||||
(UINT_32)((_pkt_profile)->rEnqueueTimestamp), \
|
|
||||||
(UINT_32)((_pkt_profile)->rDequeueTimestamp), \
|
|
||||||
(UINT_32)((_pkt_profile)->rHifTxDoneTimestamp), \
|
|
||||||
(UINT_8)((_pkt_profile)->ucTcxFreeCount), \
|
|
||||||
(UINT_16)((_pkt_profile)->u2RtpSn), \
|
|
||||||
(_note)); \
|
|
||||||
(_pkt_profile)->fgIsPrinted = TRUE; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CHK_PROFILES_DELTA(_pkt1, _pkt2, _delta) \
|
|
||||||
(CHECK_FOR_TIMEOUT((_pkt1)->rHardXmitArrivalTimestamp, (_pkt2)->rHardXmitArrivalTimestamp, (_delta)) || \
|
|
||||||
CHECK_FOR_TIMEOUT((_pkt1)->rEnqueueTimestamp, (_pkt2)->rEnqueueTimestamp, (_delta)) || \
|
|
||||||
CHECK_FOR_TIMEOUT((_pkt1)->rDequeueTimestamp, (_pkt2)->rDequeueTimestamp, (_delta)) || \
|
|
||||||
CHECK_FOR_TIMEOUT((_pkt1)->rHifTxDoneTimestamp, (_pkt2)->rHifTxDoneTimestamp, (_delta)))
|
|
||||||
|
|
||||||
#define CHK_PROFILE_DELTA(_pkt, _delta) \
|
|
||||||
(CHECK_FOR_TIMEOUT((_pkt)->rEnqueueTimestamp, (_pkt)->rHardXmitArrivalTimestamp, (_delta)) || \
|
|
||||||
CHECK_FOR_TIMEOUT((_pkt)->rDequeueTimestamp, (_pkt)->rEnqueueTimestamp, (_delta)) || \
|
|
||||||
CHECK_FOR_TIMEOUT((_pkt)->rHifTxDoneTimestamp, (_pkt)->rDequeueTimestamp, (_delta)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
VOID nicTxInitialize(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS nicTxAcquireResource(IN P_ADAPTER_T prAdapter, IN UINT_8 ucTC, IN BOOLEAN pfgIsSecOrMgmt);
|
|
||||||
|
|
||||||
WLAN_STATUS nicTxPollingResource(IN P_ADAPTER_T prAdapter, IN UINT_8 ucTC);
|
|
||||||
|
|
||||||
BOOLEAN nicTxReleaseResource(IN P_ADAPTER_T prAdapter, IN UINT_8 *aucTxRlsCnt);
|
|
||||||
|
|
||||||
WLAN_STATUS nicTxResetResource(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
UINT_8 nicTxGetResource(IN P_ADAPTER_T prAdapter, IN UINT_8 ucTC);
|
|
||||||
|
|
||||||
WLAN_STATUS nicTxMsduInfoList(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfoListHead);
|
|
||||||
|
|
||||||
WLAN_STATUS nicTxMsduQueue(IN P_ADAPTER_T prAdapter, UINT_8 ucPortIdx, P_QUE_T prQue);
|
|
||||||
|
|
||||||
WLAN_STATUS nicTxCmd(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN UINT_8 ucTC);
|
|
||||||
|
|
||||||
VOID nicTxRelease(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicProcessTxInterrupt(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicTxFreeMsduInfoPacket(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfoListHead);
|
|
||||||
|
|
||||||
VOID nicTxReturnMsduInfo(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfoListHead);
|
|
||||||
|
|
||||||
BOOLEAN nicTxFillMsduInfo(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN P_NATIVE_PACKET prNdisPacket);
|
|
||||||
|
|
||||||
WLAN_STATUS nicTxAdjustTcq(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS nicTxFlush(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
#if CFG_ENABLE_FW_DOWNLOAD
|
|
||||||
WLAN_STATUS nicTxInitCmd(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN UINT_8 ucTC);
|
|
||||||
|
|
||||||
WLAN_STATUS nicTxInitResetResource(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WLAN_STATUS nicTxEnqueueMsdu(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
UINT_32 nicTxGetFreeCmdCount(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID nicTxConfigPktOption(IN P_MSDU_INFO_T prMsduInfo, IN UINT_32 u4OptionMask,
|
|
||||||
IN BOOLEAN fgSetOption);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _NIC_TX_H */
|
|
|
@ -1,165 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_H
|
|
||||||
#define _P2P_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* refer to 'Config Methods' in WPS */
|
|
||||||
#define WPS_CONFIG_USBA 0x0001
|
|
||||||
#define WPS_CONFIG_ETHERNET 0x0002
|
|
||||||
#define WPS_CONFIG_LABEL 0x0004
|
|
||||||
#define WPS_CONFIG_DISPLAY 0x0008
|
|
||||||
#define WPS_CONFIG_EXT_NFC 0x0010
|
|
||||||
#define WPS_CONFIG_INT_NFC 0x0020
|
|
||||||
#define WPS_CONFIG_NFC 0x0040
|
|
||||||
#define WPS_CONFIG_PBC 0x0080
|
|
||||||
#define WPS_CONFIG_KEYPAD 0x0100
|
|
||||||
|
|
||||||
/* refer to 'Device Password ID' in WPS */
|
|
||||||
#define WPS_DEV_PASSWORD_ID_PIN 0x0000
|
|
||||||
#define WPS_DEV_PASSWORD_ID_USER 0x0001
|
|
||||||
#define WPS_DEV_PASSWORD_ID_MACHINE 0x0002
|
|
||||||
#define WPS_DEV_PASSWORD_ID_REKEY 0x0003
|
|
||||||
#define WPS_DEV_PASSWORD_ID_PUSHBUTTON 0x0004
|
|
||||||
#define WPS_DEV_PASSWORD_ID_REGISTRAR 0x0005
|
|
||||||
|
|
||||||
#define P2P_DEVICE_TYPE_NUM 2
|
|
||||||
#define P2P_DEVICE_NAME_LENGTH 32
|
|
||||||
#define P2P_NETWORK_NUM 8
|
|
||||||
#define P2P_MEMBER_NUM 8
|
|
||||||
|
|
||||||
#define P2P_WILDCARD_SSID "DIRECT-"
|
|
||||||
|
|
||||||
#define MAX_GC_DEAUTH_RETRY_COUNT 1
|
|
||||||
|
|
||||||
#define P2P_DEAUTH_TIMEOUT_TIME_MS 1000
|
|
||||||
|
|
||||||
#define P2P_AP_CHNL_HOLD_TIME_MS 5000
|
|
||||||
|
|
||||||
#define P2P_CHNL_EXTEND_CHAN_TIME 500
|
|
||||||
|
|
||||||
#define AP_DEFAULT_CHANNEL_2G 6
|
|
||||||
#define AP_DEFAULT_CHANNEL_5G 36
|
|
||||||
|
|
||||||
#define P2P_MAX_AKM_SUITES 2
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct _P2P_INFO_T {
|
|
||||||
UINT_32 u4DeviceNum;
|
|
||||||
EVENT_P2P_DEV_DISCOVER_RESULT_T arP2pDiscoverResult[CFG_MAX_NUM_BSS_LIST];
|
|
||||||
PUINT_8 pucCurrIePtr;
|
|
||||||
UINT_8 aucCommIePool[CFG_MAX_COMMON_IE_BUF_LEN]; /* A common pool for IE of all scan results. */
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
ENUM_P2P_PEER_GROUP,
|
|
||||||
ENUM_P2P_PEER_DEVICE,
|
|
||||||
ENUM_P2P_PEER_NUM
|
|
||||||
} ENUM_P2P_PEER_TYPE, *P_ENUM_P2P_PEER_TYPE;
|
|
||||||
|
|
||||||
typedef struct _P2P_DEVICE_INFO {
|
|
||||||
UINT_8 aucDevAddr[PARAM_MAC_ADDR_LEN];
|
|
||||||
UINT_8 aucIfAddr[PARAM_MAC_ADDR_LEN];
|
|
||||||
UINT_8 ucDevCapabilityBitmap;
|
|
||||||
INT_32 i4ConfigMethod;
|
|
||||||
UINT_8 aucPrimaryDeviceType[8];
|
|
||||||
UINT_8 aucSecondaryDeviceType[8];
|
|
||||||
UINT_8 aucDeviceName[P2P_DEVICE_NAME_LENGTH];
|
|
||||||
} P2P_DEVICE_INFO, *P_P2P_DEVICE_INFO;
|
|
||||||
|
|
||||||
typedef struct _P2P_GROUP_INFO {
|
|
||||||
PARAM_SSID_T rGroupID;
|
|
||||||
P2P_DEVICE_INFO rGroupOwnerInfo;
|
|
||||||
UINT_8 ucMemberNum;
|
|
||||||
P2P_DEVICE_INFO arMemberInfo[P2P_MEMBER_NUM];
|
|
||||||
} P2P_GROUP_INFO, *P_P2P_GROUP_INFO;
|
|
||||||
|
|
||||||
typedef struct _P2P_NETWORK_INFO {
|
|
||||||
ENUM_P2P_PEER_TYPE eNodeType;
|
|
||||||
|
|
||||||
union {
|
|
||||||
P2P_GROUP_INFO rGroupInfo;
|
|
||||||
P2P_DEVICE_INFO rDeviceInfo;
|
|
||||||
} node;
|
|
||||||
|
|
||||||
} P2P_NETWORK_INFO, *P_P2P_NETWORK_INFO;
|
|
||||||
|
|
||||||
typedef struct _P2P_NETWORK_LIST {
|
|
||||||
UINT_8 ucNetworkNum;
|
|
||||||
P2P_NETWORK_INFO rP2PNetworkInfo[P2P_NETWORK_NUM];
|
|
||||||
} P2P_NETWORK_LIST, *P_P2P_NETWORK_LIST;
|
|
||||||
|
|
||||||
typedef struct _P2P_DISCONNECT_INFO {
|
|
||||||
UINT_8 ucRole;
|
|
||||||
UINT_8 ucRsv[3];
|
|
||||||
} P2P_DISCONNECT_INFO, *P_P2P_DISCONNECT_INFO;
|
|
||||||
|
|
||||||
/* P2P public action frames */
|
|
||||||
enum P2P_ACTION_FRAME_TYPE {
|
|
||||||
P2P_GO_NEG_REQ = 0,
|
|
||||||
P2P_GO_NEG_RESP = 1,
|
|
||||||
P2P_GO_NEG_CONF = 2,
|
|
||||||
P2P_INVITATION_REQ = 3,
|
|
||||||
P2P_INVITATION_RESP = 4,
|
|
||||||
P2P_DEV_DISC_REQ = 5,
|
|
||||||
P2P_DEV_DISC_RESP = 6,
|
|
||||||
P2P_PROV_DISC_REQ = 7,
|
|
||||||
P2P_PROV_DISC_RESP = 8
|
|
||||||
};
|
|
||||||
|
|
||||||
struct P2P_QUEUED_ACTION_FRAME {
|
|
||||||
int32_t u4Freq;
|
|
||||||
uint8_t *prHeader;
|
|
||||||
uint16_t u2Length;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /*_P2P_H */
|
|
|
@ -1,71 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_CMD_BUF_H
|
|
||||||
#define _P2P_CMD_BUF_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
/* Firmware Command Packer */
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSendSetQueryP2PCmd(IN P_ADAPTER_T prAdapter,
|
|
||||||
UINT_8 ucCID,
|
|
||||||
BOOLEAN fgSetQuery,
|
|
||||||
BOOLEAN fgNeedResp,
|
|
||||||
BOOLEAN fgIsOid,
|
|
||||||
PFN_CMD_DONE_HANDLER pfCmdDoneHandler,
|
|
||||||
PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler,
|
|
||||||
UINT_32 u4SetQueryInfoLen,
|
|
||||||
PUINT_8 pucInfoBuffer, OUT PVOID pvSetQueryBuffer, IN UINT_32 u4SetQueryBufferLen);
|
|
||||||
|
|
||||||
#endif /* _P2P_CMD_BUF_H */
|
|
|
@ -1,210 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_MAC_H
|
|
||||||
#define _P2P_MAC_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define ACTION_PUBLIC_WIFI_DIRECT 9
|
|
||||||
#define ACTION_GAS_INITIAL_REQUEST 10
|
|
||||||
#define ACTION_GAS_INITIAL_RESPONSE 11
|
|
||||||
#define ACTION_GAS_COMEBACK_REQUEST 12
|
|
||||||
#define ACTION_GAS_COMEBACK_RESPONSE 13
|
|
||||||
|
|
||||||
/* P2P 4.2.8.1 - P2P Public Action Frame Type. */
|
|
||||||
#define P2P_PUBLIC_ACTION_GO_NEGO_REQ 0
|
|
||||||
#define P2P_PUBLIC_ACTION_GO_NEGO_RSP 1
|
|
||||||
#define P2P_PUBLIC_ACTION_GO_NEGO_CFM 2
|
|
||||||
#define P2P_PUBLIC_ACTION_INVITATION_REQ 3
|
|
||||||
#define P2P_PUBLIC_ACTION_INVITATION_RSP 4
|
|
||||||
#define P2P_PUBLIC_ACTION_DEV_DISCOVER_REQ 5
|
|
||||||
#define P2P_PUBLIC_ACTION_DEV_DISCOVER_RSP 6
|
|
||||||
#define P2P_PUBLIC_ACTION_PROV_DISCOVERY_REQ 7
|
|
||||||
#define P2P_PUBLIC_ACTION_PROV_DISCOVERY_RSP 8
|
|
||||||
|
|
||||||
/* P2P 4.2.9.1 - P2P Action Frame Type */
|
|
||||||
#define P2P_ACTION_NOTICE_OF_ABSENCE 0
|
|
||||||
#define P2P_ACTION_P2P_PRESENCE_REQ 1
|
|
||||||
#define P2P_ACTION_P2P_PRESENCE_RSP 2
|
|
||||||
#define P2P_ACTION_GO_DISCOVER_REQ 3
|
|
||||||
|
|
||||||
#define P2P_PUBLIC_ACTION_FRAME_LEN (WLAN_MAC_MGMT_HEADER_LEN+8)
|
|
||||||
#define P2P_ACTION_FRAME_LEN (WLAN_MAC_MGMT_HEADER_LEN+7)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* P2P 4.2.8.2 P2P Public Action Frame Format */
|
|
||||||
typedef struct _P2P_PUBLIC_ACTION_FRAME_T {
|
|
||||||
/* MAC header */
|
|
||||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
|
||||||
UINT_16 u2Duration; /* Duration */
|
|
||||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
|
||||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
|
||||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
|
||||||
/* P2P Public Action Frame Body */
|
|
||||||
UINT_8 ucCategory; /* Category, 0x04 */
|
|
||||||
UINT_8 ucAction; /* Action Value, 0x09 */
|
|
||||||
UINT_8 aucOui[3]; /* 0x50, 0x6F, 0x9A */
|
|
||||||
UINT_8 ucOuiType; /* 0x09 */
|
|
||||||
UINT_8 ucOuiSubtype; /* GO Nego Req/Rsp/Cfm, P2P Invittion Req/Rsp, Device Discoverability Req/Rsp */
|
|
||||||
UINT_8 ucDialogToken; /* Dialog Token. */
|
|
||||||
UINT_8 aucInfoElem[1]; /* P2P IE, WSC IE. */
|
|
||||||
} __KAL_ATTRIB_PACKED__ P2P_PUBLIC_ACTION_FRAME_T, *P_P2P_PUBLIC_ACTION_FRAME_T;
|
|
||||||
|
|
||||||
/* P2P 4.2.9.1 - General Action Frame Format. */
|
|
||||||
typedef struct _P2P_ACTION_FRAME_T {
|
|
||||||
/* MAC header */
|
|
||||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
|
||||||
UINT_16 u2Duration; /* Duration */
|
|
||||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
|
||||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
|
||||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
|
||||||
/* P2P Action Frame Body */
|
|
||||||
UINT_8 ucCategory; /* 0x7F */
|
|
||||||
UINT_8 aucOui[3]; /* 0x50, 0x6F, 0x9A */
|
|
||||||
UINT_8 ucOuiType; /* 0x09 */
|
|
||||||
UINT_8 ucOuiSubtype; /* */
|
|
||||||
UINT_8 ucDialogToken;
|
|
||||||
UINT_8 aucInfoElem[1];
|
|
||||||
} __KAL_ATTRIB_PACKED__ P2P_ACTION_FRAME_T, *P_P2P_ACTION_FRAME_T;
|
|
||||||
|
|
||||||
/* P2P C.1 GAS Public Action Initial Request Frame Format */
|
|
||||||
typedef struct _GAS_PUBLIC_ACTION_INITIAL_REQUEST_FRAME_T {
|
|
||||||
/* MAC header */
|
|
||||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
|
||||||
UINT_16 u2Duration; /* Duration */
|
|
||||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
|
||||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
|
||||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
|
||||||
/* P2P Public Action Frame Body */
|
|
||||||
UINT_8 ucCategory; /* Category, 0x04 */
|
|
||||||
UINT_8 ucAction; /* Action Value, 0x09 */
|
|
||||||
UINT_8 ucDialogToken; /* Dialog Token. */
|
|
||||||
UINT_8 aucInfoElem[1]; /* Advertisement IE. */
|
|
||||||
} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_INITIAL_REQUEST_FRAME_T, *P_GAS_PUBLIC_ACTION_INITIAL_REQUEST_FRAME_T;
|
|
||||||
|
|
||||||
/* P2P C.2 GAS Public Action Initial Response Frame Format */
|
|
||||||
typedef struct _GAS_PUBLIC_ACTION_INITIAL_RESPONSE_FRAME_T {
|
|
||||||
/* MAC header */
|
|
||||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
|
||||||
UINT_16 u2Duration; /* Duration */
|
|
||||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
|
||||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
|
||||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
|
||||||
/* P2P Public Action Frame Body */
|
|
||||||
UINT_8 ucCategory; /* Category, 0x04 */
|
|
||||||
UINT_8 ucAction; /* Action Value, 0x09 */
|
|
||||||
UINT_8 ucDialogToken; /* Dialog Token. */
|
|
||||||
UINT_16 u2StatusCode; /* Initial Response. */
|
|
||||||
UINT_16 u2ComebackDelay; /* Initial Response. *//* In unit of TU. */
|
|
||||||
UINT_8 aucInfoElem[1]; /* Advertisement IE. */
|
|
||||||
} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_INITIAL_RESPONSE_FRAME_T, *P_GAS_PUBLIC_ACTION_INITIAL_RESPONSE_FRAME_T;
|
|
||||||
|
|
||||||
/* P2P C.3-1 GAS Public Action Comeback Request Frame Format */
|
|
||||||
typedef struct _GAS_PUBLIC_ACTION_COMEBACK_REQUEST_FRAME_T {
|
|
||||||
/* MAC header */
|
|
||||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
|
||||||
UINT_16 u2Duration; /* Duration */
|
|
||||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
|
||||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
|
||||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
|
||||||
/* P2P Public Action Frame Body */
|
|
||||||
UINT_8 ucCategory; /* Category, 0x04 */
|
|
||||||
UINT_8 ucAction; /* Action Value, 0x09 */
|
|
||||||
UINT_8 ucDialogToken; /* Dialog Token. */
|
|
||||||
} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_COMEBACK_REQUEST_FRAME_T, *P_GAS_PUBLIC_ACTION_COMEBACK_REQUEST_FRAME_T;
|
|
||||||
|
|
||||||
/* P2P C.3-2 GAS Public Action Comeback Response Frame Format */
|
|
||||||
typedef struct _GAS_PUBLIC_ACTION_COMEBACK_RESPONSE_FRAME_T {
|
|
||||||
/* MAC header */
|
|
||||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
|
||||||
UINT_16 u2Duration; /* Duration */
|
|
||||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
|
||||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
|
||||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
|
||||||
/* P2P Public Action Frame Body */
|
|
||||||
UINT_8 ucCategory; /* Category, 0x04 */
|
|
||||||
UINT_8 ucAction; /* Action Value, 0x09 */
|
|
||||||
UINT_8 ucDialogToken; /* Dialog Token. */
|
|
||||||
UINT_16 u2StatusCode; /* Comeback Response. */
|
|
||||||
UINT_8 ucFragmentID; /*Comeback Response. */
|
|
||||||
UINT_16 u2ComebackDelay; /* Comeback Response. */
|
|
||||||
UINT_8 aucInfoElem[1]; /* Advertisement IE. */
|
|
||||||
} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_COMEBACK_RESPONSE_FRAME_T, *P_GAS_PUBLIC_ACTION_COMEBACK_RESPONSE_FRAME_T;
|
|
||||||
|
|
||||||
typedef struct _P2P_SD_VENDER_SPECIFIC_CONTENT_T {
|
|
||||||
/* Service Discovery Vendor-specific Content. */
|
|
||||||
UINT_8 ucOuiSubtype; /* 0x09 */
|
|
||||||
UINT_16 u2ServiceUpdateIndicator;
|
|
||||||
UINT_8 aucServiceTLV[1];
|
|
||||||
} __KAL_ATTRIB_PACKED__ P2P_SD_VENDER_SPECIFIC_CONTENT_T, *P_P2P_SD_VENDER_SPECIFIC_CONTENT_T;
|
|
||||||
|
|
||||||
typedef struct _P2P_SERVICE_REQUEST_TLV_T {
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_8 ucServiceProtocolType;
|
|
||||||
UINT_8 ucServiceTransID;
|
|
||||||
UINT_8 aucQueryData[1];
|
|
||||||
} __KAL_ATTRIB_PACKED__ P2P_SERVICE_REQUEST_TLV_T, *P_P2P_SERVICE_REQUEST_TLV_T;
|
|
||||||
|
|
||||||
typedef struct _P2P_SERVICE_RESPONSE_TLV_T {
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_8 ucServiceProtocolType;
|
|
||||||
UINT_8 ucServiceTransID;
|
|
||||||
UINT_8 ucStatusCode;
|
|
||||||
UINT_8 aucResponseData[1];
|
|
||||||
} __KAL_ATTRIB_PACKED__ P2P_SERVICE_RESPONSE_TLV_T, *P_P2P_SERVICE_RESPONSE_TLV_T;
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,65 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_NIC_H
|
|
||||||
#define _P2P_NIC_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
VOID
|
|
||||||
nicP2pMediaStateChange(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType, IN P_EVENT_CONNECTION_STATUS prConnectionStatus);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
nicRxAddP2pDevice(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_EVENT_P2P_DEV_DISCOVER_RESULT_T prP2pResult, IN PUINT_8 pucRxIEBuf, IN UINT_16 u2RxIELength);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,75 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_NIC_CMD_EVENT_H
|
|
||||||
#define _P2P_NIC_CMD_EVENT_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _EVENT_P2P_DEV_DISCOVER_RESULT_T {
|
|
||||||
/* UINT_8 aucCommunicateAddr[MAC_ADDR_LEN]; // Deprecated. */
|
|
||||||
UINT_8 aucDeviceAddr[MAC_ADDR_LEN]; /* Device Address. */
|
|
||||||
UINT_8 aucInterfaceAddr[MAC_ADDR_LEN]; /* Device Address. */
|
|
||||||
UINT_8 ucDeviceCapabilityBitmap;
|
|
||||||
UINT_8 ucGroupCapabilityBitmap;
|
|
||||||
UINT_16 u2ConfigMethod; /* Configure Method. */
|
|
||||||
P2P_DEVICE_TYPE_T rPriDevType;
|
|
||||||
UINT_8 ucSecDevTypeNum;
|
|
||||||
P2P_DEVICE_TYPE_T arSecDevType[2];
|
|
||||||
UINT_16 u2NameLength;
|
|
||||||
UINT_8 aucName[32];
|
|
||||||
PUINT_8 pucIeBuf;
|
|
||||||
UINT_16 u2IELength;
|
|
||||||
UINT_8 aucBSSID[MAC_ADDR_LEN];
|
|
||||||
/* TODO: Service Information or PasswordID valid? */
|
|
||||||
} EVENT_P2P_DEV_DISCOVER_RESULT_T, *P_EVENT_P2P_DEV_DISCOVER_RESULT_T;
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,909 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _QUE_MGT_H
|
|
||||||
#define _QUE_MGT_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Queue Manager Features */
|
|
||||||
/* 1: Indicate the last TX packet to the FW for each burst */
|
|
||||||
#define QM_BURST_END_INFO_ENABLED 1
|
|
||||||
/* 1: To fairly share TX resource among active STAs */
|
|
||||||
#define QM_FORWARDING_FAIRNESS 1
|
|
||||||
/* 1: To adaptively adjust resource for each TC */
|
|
||||||
#define QM_ADAPTIVE_TC_RESOURCE_CTRL 1
|
|
||||||
/* 1: To print TC resource adjustment results */
|
|
||||||
#define QM_PRINT_TC_RESOURCE_CTRL 0
|
|
||||||
/* 1: If pkt with SSN is missing, auto advance the RX reordering window */
|
|
||||||
#define QM_RX_WIN_SSN_AUTO_ADVANCING 1
|
|
||||||
/* 1: Indicate the packets falling behind to OS before the frame with SSN is received */
|
|
||||||
#define QM_RX_INIT_FALL_BEHIND_PASS 1
|
|
||||||
/* 1: Count times of TC resource empty happened */
|
|
||||||
#define QM_TC_RESOURCE_EMPTY_COUNTER 1
|
|
||||||
/* Parameters */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* In TDLS or AP mode, peer maybe enter "sleep mode".
|
|
||||||
*
|
|
||||||
* If QM_INIT_TIME_TO_UPDATE_QUE_LEN = 60 when peer is in sleep mode,
|
|
||||||
* we need to wait 60 * u4TimeToAdjustTcResource = 180 packets
|
|
||||||
* u4TimeToAdjustTcResource = 3,
|
|
||||||
* then we will adjust TC resouce for VI or VO.
|
|
||||||
*
|
|
||||||
* But in TDLS test case, the throughput is very low, only 0.8Mbps in 5.7,
|
|
||||||
* we will to wait about 12 seconds to collect 180 packets.
|
|
||||||
* but the test time is only 20 seconds.
|
|
||||||
*/
|
|
||||||
#define QM_INIT_TIME_TO_UPDATE_QUE_LEN 60 /* p: Update queue lengths when p TX packets are enqueued */
|
|
||||||
#define QM_INIT_TIME_TO_UPDATE_QUE_LEN_MIN 5
|
|
||||||
|
|
||||||
#define QM_INIT_TIME_TO_ADJUST_TC_RSC 3 /* s: Adjust the TC resource every s updates of queue lengths */
|
|
||||||
#define QM_QUE_LEN_MOVING_AVE_FACTOR 3 /* Factor for Que Len averaging */
|
|
||||||
|
|
||||||
#define QM_MIN_RESERVED_TC0_RESOURCE 1
|
|
||||||
#define QM_MIN_RESERVED_TC1_RESOURCE 1
|
|
||||||
#define QM_MIN_RESERVED_TC2_RESOURCE 1
|
|
||||||
#define QM_MIN_RESERVED_TC3_RESOURCE 1
|
|
||||||
#define QM_MIN_RESERVED_TC4_RESOURCE 2 /* Resource for TC4 is not adjustable */
|
|
||||||
#define QM_MIN_RESERVED_TC5_RESOURCE 1
|
|
||||||
|
|
||||||
#if defined(MT6620)
|
|
||||||
|
|
||||||
#define QM_GUARANTEED_TC0_RESOURCE 4
|
|
||||||
#define QM_GUARANTEED_TC1_RESOURCE 4
|
|
||||||
#define QM_GUARANTEED_TC2_RESOURCE 9
|
|
||||||
#define QM_GUARANTEED_TC3_RESOURCE 11
|
|
||||||
#define QM_GUARANTEED_TC4_RESOURCE 2 /* Resource for TC4 is not adjustable */
|
|
||||||
#define QM_GUARANTEED_TC5_RESOURCE 4
|
|
||||||
|
|
||||||
#elif defined(MT6628)
|
|
||||||
|
|
||||||
#define QM_GUARANTEED_TC0_RESOURCE 4
|
|
||||||
#define QM_GUARANTEED_TC1_RESOURCE 4
|
|
||||||
#define QM_GUARANTEED_TC2_RESOURCE 6
|
|
||||||
#define QM_GUARANTEED_TC3_RESOURCE 6
|
|
||||||
#define QM_GUARANTEED_TC4_RESOURCE 2 /* Resource for TC4 is not adjustable */
|
|
||||||
#define QM_GUARANTEED_TC5_RESOURCE 4
|
|
||||||
|
|
||||||
#else
|
|
||||||
#error
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define QM_EXTRA_RESERVED_RESOURCE_WHEN_BUSY 0
|
|
||||||
|
|
||||||
#define QM_TOTAL_TC_RESOURCE (\
|
|
||||||
NIC_TX_BUFF_COUNT_TC0 + NIC_TX_BUFF_COUNT_TC1 +\
|
|
||||||
NIC_TX_BUFF_COUNT_TC2 + NIC_TX_BUFF_COUNT_TC3 +\
|
|
||||||
NIC_TX_BUFF_COUNT_TC5)
|
|
||||||
#define QM_AVERAGE_TC_RESOURCE 6
|
|
||||||
|
|
||||||
/* Note: QM_INITIAL_RESIDUAL_TC_RESOURCE shall not be less than 0 */
|
|
||||||
/* for 6628: QM_TOTAL_TC_RESOURCE = 28, RESIDUAL = 4 4 6 6 2 4 = 26 */
|
|
||||||
#define QM_INITIAL_RESIDUAL_TC_RESOURCE (QM_TOTAL_TC_RESOURCE - \
|
|
||||||
(QM_GUARANTEED_TC0_RESOURCE +\
|
|
||||||
QM_GUARANTEED_TC1_RESOURCE +\
|
|
||||||
QM_GUARANTEED_TC2_RESOURCE +\
|
|
||||||
QM_GUARANTEED_TC3_RESOURCE +\
|
|
||||||
QM_GUARANTEED_TC5_RESOURCE \
|
|
||||||
))
|
|
||||||
|
|
||||||
/* Hard-coded network type for Phase 3: NETWORK_TYPE_AIS/P2P/BOW */
|
|
||||||
#define QM_OPERATING_NETWORK_TYPE NETWORK_TYPE_AIS
|
|
||||||
|
|
||||||
#define QM_TEST_MODE 0
|
|
||||||
#define QM_TEST_TRIGGER_TX_COUNT 50
|
|
||||||
#define QM_TEST_STA_REC_DETERMINATION 0
|
|
||||||
#define QM_TEST_STA_REC_DEACTIVATION 0
|
|
||||||
#define QM_TEST_FAIR_FORWARDING 0
|
|
||||||
|
|
||||||
#define QM_DEBUG_COUNTER 0
|
|
||||||
|
|
||||||
/* Per-STA Queues: [0] AC0, [1] AC1, [2] AC2, [3] AC3, [4] 802.1x */
|
|
||||||
/* Per-Type Queues: [0] BMCAST */
|
|
||||||
#define NUM_OF_PER_STA_TX_QUEUES 5
|
|
||||||
#define NUM_OF_PER_TYPE_TX_QUEUES 1
|
|
||||||
|
|
||||||
/* These two constants are also used for FW to verify the STA_REC index */
|
|
||||||
#define STA_REC_INDEX_BMCAST 0xFF
|
|
||||||
#define STA_REC_INDEX_NOT_FOUND 0xFE
|
|
||||||
|
|
||||||
/* TX Queue Index */
|
|
||||||
#define TX_QUEUE_INDEX_BMCAST 0
|
|
||||||
#define TX_QUEUE_INDEX_NO_STA_REC 0
|
|
||||||
#define TX_QUEUE_INDEX_AC0 0
|
|
||||||
#define TX_QUEUE_INDEX_AC1 1
|
|
||||||
#define TX_QUEUE_INDEX_AC2 2
|
|
||||||
#define TX_QUEUE_INDEX_AC3 3
|
|
||||||
#define TX_QUEUE_INDEX_802_1X 4
|
|
||||||
#define TX_QUEUE_INDEX_NON_QOS 1
|
|
||||||
|
|
||||||
/* 1 WMM-related */
|
|
||||||
/* WMM FLAGS */
|
|
||||||
#define WMM_FLAG_SUPPORT_WMM BIT(0)
|
|
||||||
#define WMM_FLAG_SUPPORT_WMMSA BIT(1)
|
|
||||||
#define WMM_FLAG_AC_PARAM_PRESENT BIT(2)
|
|
||||||
#define WMM_FLAG_SUPPORT_UAPSD BIT(3)
|
|
||||||
|
|
||||||
/* WMM Admission Control Mandatory FLAGS */
|
|
||||||
#define ACM_FLAG_ADM_NOT_REQUIRED 0
|
|
||||||
#define ACM_FLAG_ADM_GRANTED BIT(0)
|
|
||||||
#define ACM_FLAG_ADM_REQUIRED BIT(1)
|
|
||||||
|
|
||||||
/* WMM Power Saving FLAGS */
|
|
||||||
#define AC_FLAG_TRIGGER_ENABLED BIT(1)
|
|
||||||
#define AC_FLAG_DELIVERY_ENABLED BIT(2)
|
|
||||||
|
|
||||||
/* WMM-2.2.1 WMM Information Element */
|
|
||||||
#define ELEM_MAX_LEN_WMM_INFO 7
|
|
||||||
|
|
||||||
/* WMM-2.2.2 WMM Parameter Element */
|
|
||||||
#define ELEM_MAX_LEN_WMM_PARAM 24
|
|
||||||
|
|
||||||
/* WMM-2.2.1 WMM QoS Info field */
|
|
||||||
#define WMM_QOS_INFO_PARAM_SET_CNT BITS(0, 3) /* Sent by AP */
|
|
||||||
#define WMM_QOS_INFO_UAPSD BIT(7)
|
|
||||||
|
|
||||||
#define WMM_QOS_INFO_VO_UAPSD BIT(0) /* Sent by non-AP STA */
|
|
||||||
#define WMM_QOS_INFO_VI_UAPSD BIT(1)
|
|
||||||
#define WMM_QOS_INFO_BK_UAPSD BIT(2)
|
|
||||||
#define WMM_QOS_INFO_BE_UAPSD BIT(3)
|
|
||||||
#define WMM_QOS_INFO_MAX_SP_LEN_MASK BITS(5, 6)
|
|
||||||
#define WMM_QOS_INFO_MAX_SP_ALL 0
|
|
||||||
#define WMM_QOS_INFO_MAX_SP_2 BIT(5)
|
|
||||||
#define WMM_QOS_INFO_MAX_SP_4 BIT(6)
|
|
||||||
#define WMM_QOS_INFO_MAX_SP_6 BITS(5, 6)
|
|
||||||
|
|
||||||
/* -- definitions for Max SP length field */
|
|
||||||
#define WMM_MAX_SP_LENGTH_ALL 0
|
|
||||||
#define WMM_MAX_SP_LENGTH_2 2
|
|
||||||
#define WMM_MAX_SP_LENGTH_4 4
|
|
||||||
#define WMM_MAX_SP_LENGTH_6 6
|
|
||||||
|
|
||||||
/* WMM-2.2.2 WMM ACI/AIFSN field */
|
|
||||||
/* -- subfields in the ACI/AIFSN field */
|
|
||||||
#define WMM_ACIAIFSN_AIFSN BITS(0, 3)
|
|
||||||
#define WMM_ACIAIFSN_ACM BIT(4)
|
|
||||||
#define WMM_ACIAIFSN_ACI BITS(5, 6)
|
|
||||||
#define WMM_ACIAIFSN_ACI_OFFSET 5
|
|
||||||
|
|
||||||
/* -- definitions for ACI field */
|
|
||||||
#define WMM_ACI_AC_BE 0
|
|
||||||
#define WMM_ACI_AC_BK BIT(5)
|
|
||||||
#define WMM_ACI_AC_VI BIT(6)
|
|
||||||
#define WMM_ACI_AC_VO BITS(5, 6)
|
|
||||||
|
|
||||||
#define WMM_ACI(_AC) (_AC << WMM_ACIAIFSN_ACI_OFFSET)
|
|
||||||
|
|
||||||
/* -- definitions for ECWmin/ECWmax field */
|
|
||||||
#define WMM_ECW_WMIN_MASK BITS(0, 3)
|
|
||||||
#define WMM_ECW_WMAX_MASK BITS(4, 7)
|
|
||||||
#define WMM_ECW_WMAX_OFFSET 4
|
|
||||||
|
|
||||||
#define TXM_DEFAULT_FLUSH_QUEUE_GUARD_TIME 0 /* Unit: 64 us */
|
|
||||||
|
|
||||||
#define DEFAULT_QM_RX_BA_ENTRY_MISS_TIMEOUT_MS (200)
|
|
||||||
#define SHORT_QM_RX_BA_ENTRY_MISS_TIMEOUT_MS (50)
|
|
||||||
|
|
||||||
#if CFG_RX_BA_REORDERING_ENHANCEMENT
|
|
||||||
#define QM_RX_MAX_FW_DROP_SSN_SIZE 8
|
|
||||||
#define QM_SSN_MASK 0xFFF0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
enum {
|
|
||||||
QM_DBG_CNT_00 = 0,
|
|
||||||
QM_DBG_CNT_01,
|
|
||||||
QM_DBG_CNT_02,
|
|
||||||
QM_DBG_CNT_03,
|
|
||||||
QM_DBG_CNT_04,
|
|
||||||
QM_DBG_CNT_05,
|
|
||||||
QM_DBG_CNT_06,
|
|
||||||
QM_DBG_CNT_07,
|
|
||||||
QM_DBG_CNT_08,
|
|
||||||
QM_DBG_CNT_09,
|
|
||||||
QM_DBG_CNT_10,
|
|
||||||
QM_DBG_CNT_11,
|
|
||||||
QM_DBG_CNT_12,
|
|
||||||
QM_DBG_CNT_13,
|
|
||||||
QM_DBG_CNT_14,
|
|
||||||
QM_DBG_CNT_15,
|
|
||||||
QM_DBG_CNT_16,
|
|
||||||
QM_DBG_CNT_17,
|
|
||||||
QM_DBG_CNT_18,
|
|
||||||
QM_DBG_CNT_19,
|
|
||||||
QM_DBG_CNT_20,
|
|
||||||
QM_DBG_CNT_21,
|
|
||||||
QM_DBG_CNT_22,
|
|
||||||
QM_DBG_CNT_23,
|
|
||||||
QM_DBG_CNT_24,
|
|
||||||
QM_DBG_CNT_25,
|
|
||||||
QM_DBG_CNT_26,
|
|
||||||
QM_DBG_CNT_27,
|
|
||||||
QM_DBG_CNT_28,
|
|
||||||
QM_DBG_CNT_29,
|
|
||||||
QM_DBG_CNT_30,
|
|
||||||
QM_DBG_CNT_31,
|
|
||||||
QM_DBG_CNT_NUM
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Used for MAC TX */
|
|
||||||
typedef enum _ENUM_MAC_TX_QUEUE_INDEX_T {
|
|
||||||
MAC_TX_QUEUE_AC0_INDEX = 0,
|
|
||||||
MAC_TX_QUEUE_AC1_INDEX,
|
|
||||||
MAC_TX_QUEUE_AC2_INDEX,
|
|
||||||
MAC_TX_QUEUE_AC3_INDEX,
|
|
||||||
MAC_TX_QUEUE_AC4_INDEX,
|
|
||||||
MAC_TX_QUEUE_AC5_INDEX,
|
|
||||||
MAC_TX_QUEUE_AC6_INDEX,
|
|
||||||
MAC_TX_QUEUE_BCN_INDEX,
|
|
||||||
MAC_TX_QUEUE_BMC_INDEX,
|
|
||||||
MAC_TX_QUEUE_NUM
|
|
||||||
} ENUM_MAC_TX_QUEUE_INDEX_T;
|
|
||||||
|
|
||||||
typedef struct _EVENT_CHECK_REORDER_BUBBLE_T {
|
|
||||||
/* Event header */
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
|
|
||||||
UINT_8 ucEID;
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 aucReserved2[2];
|
|
||||||
|
|
||||||
/* Event Body */
|
|
||||||
UINT_8 ucStaRecIdx;
|
|
||||||
UINT_8 ucTid;
|
|
||||||
} EVENT_CHECK_REORDER_BUBBLE_T, *P_EVENT_CHECK_REORDER_BUBBLE_T;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct _RX_BA_ENTRY_T {
|
|
||||||
BOOLEAN fgIsValid;
|
|
||||||
QUE_T rReOrderQue;
|
|
||||||
#if CFG_RX_BA_REORDERING_ENHANCEMENT
|
|
||||||
QUE_T rNoNeedWaitQue;
|
|
||||||
#endif
|
|
||||||
UINT_16 u2WinStart;
|
|
||||||
UINT_16 u2WinEnd;
|
|
||||||
UINT_16 u2WinSize;
|
|
||||||
|
|
||||||
/* For identifying the RX BA agreement */
|
|
||||||
UINT_8 ucStaRecIdx;
|
|
||||||
UINT_8 ucTid;
|
|
||||||
TIMER_T rReorderBubbleTimer;
|
|
||||||
UINT_16 u2FirstBubbleSn;
|
|
||||||
|
|
||||||
BOOLEAN fgIsWaitingForPktWithSsn;
|
|
||||||
BOOLEAN fgHasBubble;
|
|
||||||
BOOLEAN fgHasBubbleInQue;
|
|
||||||
|
|
||||||
/* UINT_8 ucTxBufferSize; */
|
|
||||||
/* BOOL fgIsAcConstrain; */
|
|
||||||
/* BOOL fgIsBaEnabled; */
|
|
||||||
} RX_BA_ENTRY_T, *P_RX_BA_ENTRY_T;
|
|
||||||
|
|
||||||
/* The mailbox message (could be used for Host-To-Device or Device-To-Host Mailbox) */
|
|
||||||
typedef struct _MAILBOX_MSG_T {
|
|
||||||
UINT_32 u4Msg[2]; /* [0]: D2HRM0R or H2DRM0R, [1]: D2HRM1R or H2DRM1R */
|
|
||||||
} MAILBOX_MSG_T, *P_MAILBOX_MSG_T;
|
|
||||||
|
|
||||||
/* Used for adaptively adjusting TC resources */
|
|
||||||
typedef struct _TC_RESOURCE_CTRL_T {
|
|
||||||
/* TC0, TC1, TC2, TC3, TC5 */
|
|
||||||
UINT_32 au4AverageQueLen[TC_NUM - 1];
|
|
||||||
} TC_RESOURCE_CTRL_T, *P_TC_RESOURCE_CTRL_T;
|
|
||||||
|
|
||||||
typedef struct _QUE_MGT_T { /* Queue Management Control Info */
|
|
||||||
|
|
||||||
/* Per-Type Queues: [0] BMCAST or UNKNOWN-STA packets */
|
|
||||||
QUE_T arTxQueue[NUM_OF_PER_TYPE_TX_QUEUES];
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* For TX Scheduling */
|
|
||||||
UINT_8 arRemainingTxOppt[NUM_OF_PER_STA_TX_QUEUES];
|
|
||||||
UINT_8 arCurrentTxStaIndex[NUM_OF_PER_STA_TX_QUEUES];
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Reordering Queue Parameters */
|
|
||||||
RX_BA_ENTRY_T arRxBaTable[CFG_NUM_OF_RX_BA_AGREEMENTS];
|
|
||||||
|
|
||||||
/* Current number of activated RX BA agreements <= CFG_NUM_OF_RX_BA_AGREEMENTS */
|
|
||||||
UINT_8 ucRxBaCount;
|
|
||||||
|
|
||||||
#if QM_TEST_MODE
|
|
||||||
UINT_32 u4PktCount;
|
|
||||||
P_ADAPTER_T prAdapter;
|
|
||||||
|
|
||||||
#if QM_TEST_FAIR_FORWARDING
|
|
||||||
UINT_32 u4CurrentStaRecIndexToEnqueue;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if QM_FORWARDING_FAIRNESS
|
|
||||||
/* The current TX count for a STA with respect to a TC index */
|
|
||||||
UINT_32 au4ForwardCount[NUM_OF_PER_STA_TX_QUEUES];
|
|
||||||
|
|
||||||
/* The current serving STA with respect to a TC index */
|
|
||||||
UINT_32 au4HeadStaRecIndex[NUM_OF_PER_STA_TX_QUEUES];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if QM_ADAPTIVE_TC_RESOURCE_CTRL
|
|
||||||
UINT_32 au4AverageQueLen[TC_NUM];
|
|
||||||
UINT_32 au4CurrentTcResource[TC_NUM];
|
|
||||||
UINT_32 au4MinReservedTcResource[TC_NUM]; /* The minimum amount of resource no matter busy or idle */
|
|
||||||
UINT_32 au4GuaranteedTcResource[TC_NUM]; /* The minimum amount of resource when extremely busy */
|
|
||||||
|
|
||||||
UINT_32 u4TimeToAdjustTcResource;
|
|
||||||
UINT_32 u4TimeToUpdateQueLen;
|
|
||||||
UINT_32 u4TxNumOfVi, u4TxNumOfVo; /* number of VI/VO packets */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Set to TRUE if the last TC adjustment has not been completely applied (i.e., waiting more TX-Done events
|
|
||||||
* to align the TC quotas to the TC resource assignment)
|
|
||||||
*/
|
|
||||||
BOOLEAN fgTcResourcePostAnnealing;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if QM_DEBUG_COUNTER
|
|
||||||
UINT_32 au4QmDebugCounters[QM_DBG_CNT_NUM];
|
|
||||||
#endif
|
|
||||||
#if QM_TC_RESOURCE_EMPTY_COUNTER
|
|
||||||
UINT_32 au4QmTcResourceEmptyCounter[NET_TYPE_NUM][TC_NUM];
|
|
||||||
UINT_32 au4QmTcResourceBackCounter[TC_NUM];
|
|
||||||
UINT_32 au4DequeueNoTcResourceCounter[TC_NUM];
|
|
||||||
|
|
||||||
UINT_32 au4ResourceUsedCounter[TC_NUM];
|
|
||||||
|
|
||||||
UINT_32 au4ResourceWantedCounter[TC_NUM];
|
|
||||||
|
|
||||||
UINT_32 u4EnqeueuCounter;
|
|
||||||
UINT_32 u4DequeueCounter;
|
|
||||||
#endif
|
|
||||||
} QUE_MGT_T, *P_QUE_MGT_T;
|
|
||||||
|
|
||||||
typedef struct _EVENT_RX_ADDBA_T {
|
|
||||||
/* Event header */
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
|
|
||||||
UINT_8 ucEID;
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 aucReserved2[2];
|
|
||||||
|
|
||||||
/* Fields not present in the received ADDBA_REQ */
|
|
||||||
UINT_8 ucStaRecIdx;
|
|
||||||
|
|
||||||
/* Fields that are present in the received ADDBA_REQ */
|
|
||||||
UINT_8 ucDialogToken; /* Dialog Token chosen by the sender */
|
|
||||||
UINT_16 u2BAParameterSet; /* BA policy, TID, buffer size */
|
|
||||||
UINT_16 u2BATimeoutValue;
|
|
||||||
UINT_16 u2BAStartSeqCtrl; /* SSN */
|
|
||||||
|
|
||||||
} EVENT_RX_ADDBA_T, *P_EVENT_RX_ADDBA_T;
|
|
||||||
|
|
||||||
typedef struct _EVENT_RX_DELBA_T {
|
|
||||||
/* Event header */
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
|
|
||||||
UINT_8 ucEID;
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 aucReserved2[2];
|
|
||||||
|
|
||||||
/* Fields not present in the received ADDBA_REQ */
|
|
||||||
UINT_8 ucStaRecIdx;
|
|
||||||
UINT_8 ucTid;
|
|
||||||
} EVENT_RX_DELBA_T, *P_EVENT_RX_DELBA_T;
|
|
||||||
|
|
||||||
typedef struct _EVENT_BSS_ABSENCE_PRESENCE_T {
|
|
||||||
/* Event header */
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
|
|
||||||
UINT_8 ucEID;
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 aucReserved2[2];
|
|
||||||
|
|
||||||
/* Event Body */
|
|
||||||
UINT_8 ucNetTypeIdx;
|
|
||||||
BOOLEAN fgIsAbsent;
|
|
||||||
UINT_8 ucBssFreeQuota;
|
|
||||||
UINT_8 aucReserved[1];
|
|
||||||
} EVENT_BSS_ABSENCE_PRESENCE_T, *P_EVENT_BSS_ABSENCE_PRESENCE_T;
|
|
||||||
|
|
||||||
typedef struct _EVENT_STA_CHANGE_PS_MODE_T {
|
|
||||||
/* Event header */
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
|
|
||||||
UINT_8 ucEID;
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 aucReserved2[2];
|
|
||||||
|
|
||||||
/* Event Body */
|
|
||||||
UINT_8 ucStaRecIdx;
|
|
||||||
BOOLEAN fgIsInPs;
|
|
||||||
UINT_8 ucUpdateMode;
|
|
||||||
UINT_8 ucFreeQuota;
|
|
||||||
} EVENT_STA_CHANGE_PS_MODE_T, *P_EVENT_STA_CHANGE_PS_MODE_T;
|
|
||||||
|
|
||||||
/* The free quota is used by PS only now */
|
|
||||||
/* The event may be used by per STA flow conttrol in general */
|
|
||||||
typedef struct _EVENT_STA_UPDATE_FREE_QUOTA_T {
|
|
||||||
/* Event header */
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
|
|
||||||
UINT_8 ucEID;
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 aucReserved2[2];
|
|
||||||
|
|
||||||
/* Event Body */
|
|
||||||
UINT_8 ucStaRecIdx;
|
|
||||||
UINT_8 ucUpdateMode;
|
|
||||||
UINT_8 ucFreeQuota;
|
|
||||||
UINT_8 aucReserved[1];
|
|
||||||
} EVENT_STA_UPDATE_FREE_QUOTA_T, *P_EVENT_STA_UPDATE_FREE_QUOTA_T;
|
|
||||||
|
|
||||||
/* WMM-2.2.1 WMM Information Element */
|
|
||||||
typedef struct _IE_WMM_INFO_T {
|
|
||||||
UINT_8 ucId; /* Element ID */
|
|
||||||
UINT_8 ucLength; /* Length */
|
|
||||||
UINT_8 aucOui[3]; /* OUI */
|
|
||||||
UINT_8 ucOuiType; /* OUI Type */
|
|
||||||
UINT_8 ucOuiSubtype; /* OUI Subtype */
|
|
||||||
UINT_8 ucVersion; /* Version */
|
|
||||||
UINT_8 ucQosInfo; /* QoS Info field */
|
|
||||||
UINT_8 ucDummy[3]; /* Dummy for pack */
|
|
||||||
} IE_WMM_INFO_T, *P_IE_WMM_INFO_T;
|
|
||||||
|
|
||||||
/* WMM-2.2.2 WMM Parameter Element */
|
|
||||||
typedef struct _IE_WMM_PARAM_T {
|
|
||||||
UINT_8 ucId; /* Element ID */
|
|
||||||
UINT_8 ucLength; /* Length */
|
|
||||||
|
|
||||||
/* IE Body */
|
|
||||||
UINT_8 aucOui[3]; /* OUI */
|
|
||||||
UINT_8 ucOuiType; /* OUI Type */
|
|
||||||
UINT_8 ucOuiSubtype; /* OUI Subtype */
|
|
||||||
UINT_8 ucVersion; /* Version */
|
|
||||||
|
|
||||||
/* WMM IE Body */
|
|
||||||
UINT_8 ucQosInfo; /* QoS Info field */
|
|
||||||
UINT_8 ucReserved;
|
|
||||||
|
|
||||||
/* AC Parameters */
|
|
||||||
UINT_8 ucAciAifsn_BE;
|
|
||||||
UINT_8 ucEcw_BE;
|
|
||||||
UINT_8 aucTxopLimit_BE[2];
|
|
||||||
|
|
||||||
UINT_8 ucAciAifsn_BG;
|
|
||||||
UINT_8 ucEcw_BG;
|
|
||||||
UINT_8 aucTxopLimit_BG[2];
|
|
||||||
|
|
||||||
UINT_8 ucAciAifsn_VI;
|
|
||||||
UINT_8 ucEcw_VI;
|
|
||||||
UINT_8 aucTxopLimit_VI[2];
|
|
||||||
|
|
||||||
UINT_8 ucAciAifsn_VO;
|
|
||||||
UINT_8 ucEcw_VO;
|
|
||||||
UINT_8 aucTxopLimit_VO[2];
|
|
||||||
|
|
||||||
} IE_WMM_PARAM_T, *P_IE_WMM_PARAM_T;
|
|
||||||
|
|
||||||
typedef struct _IE_WMM_TSPEC_T {
|
|
||||||
UINT_8 ucId; /* Element ID */
|
|
||||||
UINT_8 ucLength; /* Length */
|
|
||||||
UINT_8 aucOui[3]; /* OUI */
|
|
||||||
UINT_8 ucOuiType; /* OUI Type */
|
|
||||||
UINT_8 ucOuiSubtype; /* OUI Subtype */
|
|
||||||
UINT_8 ucVersion; /* Version */
|
|
||||||
/* WMM TSPEC body */
|
|
||||||
UINT_8 aucTsInfo[3]; /* TS Info */
|
|
||||||
UINT_8 aucTspecBodyPart[1]; /* Note: Utilize PARAM_QOS_TSPEC to fill (memory copy) */
|
|
||||||
} IE_WMM_TSPEC_T, *P_IE_WMM_TSPEC_T;
|
|
||||||
|
|
||||||
typedef struct _IE_WMM_HDR_T {
|
|
||||||
UINT_8 ucId; /* Element ID */
|
|
||||||
UINT_8 ucLength; /* Length */
|
|
||||||
UINT_8 aucOui[3]; /* OUI */
|
|
||||||
UINT_8 ucOuiType; /* OUI Type */
|
|
||||||
UINT_8 ucOuiSubtype; /* OUI Subtype */
|
|
||||||
UINT_8 ucVersion; /* Version */
|
|
||||||
UINT_8 aucBody[1]; /* IE body */
|
|
||||||
} IE_WMM_HDR_T, *P_IE_WMM_HDR_T;
|
|
||||||
|
|
||||||
typedef struct _AC_QUE_PARMS_T {
|
|
||||||
UINT_16 u2CWmin; /*!< CWmin */
|
|
||||||
UINT_16 u2CWmax; /*!< CWmax */
|
|
||||||
UINT_16 u2TxopLimit; /*!< TXOP limit */
|
|
||||||
UINT_16 u2Aifsn; /*!< AIFSN */
|
|
||||||
UINT_8 ucGuradTime; /*!< GuardTime for STOP/FLUSH. */
|
|
||||||
BOOLEAN fgIsACMSet;
|
|
||||||
} AC_QUE_PARMS_T, *P_AC_QUE_PARMS_T;
|
|
||||||
|
|
||||||
/* WMM ACI (AC index) */
|
|
||||||
typedef enum _ENUM_WMM_ACI_T {
|
|
||||||
WMM_AC_BE_INDEX = 0,
|
|
||||||
WMM_AC_BK_INDEX,
|
|
||||||
WMM_AC_VI_INDEX,
|
|
||||||
WMM_AC_VO_INDEX,
|
|
||||||
WMM_AC_INDEX_NUM
|
|
||||||
} ENUM_WMM_ACI_T, *P_ENUM_WMM_ACI_T;
|
|
||||||
|
|
||||||
/* WMM QOS user priority from 802.1D/802.11e */
|
|
||||||
enum ENUM_WMM_UP_T {
|
|
||||||
WMM_UP_BE_INDEX = 0,
|
|
||||||
WMM_UP_BK_INDEX,
|
|
||||||
WMM_UP_RESV_INDEX,
|
|
||||||
WMM_UP_EE_INDEX,
|
|
||||||
WMM_UP_CL_INDEX,
|
|
||||||
WMM_UP_VI_INDEX,
|
|
||||||
WMM_UP_VO_INDEX,
|
|
||||||
WMM_UP_NC_INDEX,
|
|
||||||
WMM_UP_INDEX_NUM
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Used for CMD Queue Operation */
|
|
||||||
typedef enum _ENUM_FRAME_ACTION_T {
|
|
||||||
FRAME_ACTION_DROP_PKT = 0,
|
|
||||||
FRAME_ACTION_QUEUE_PKT,
|
|
||||||
FRAME_ACTION_TX_PKT,
|
|
||||||
FRAME_ACTION_NUM
|
|
||||||
} ENUM_FRAME_ACTION_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_FRAME_TYPE_IN_CMD_Q_T {
|
|
||||||
FRAME_TYPE_802_1X = 0,
|
|
||||||
FRAME_TYPE_MMPDU,
|
|
||||||
FRAME_TYPE_NUM
|
|
||||||
} ENUM_FRAME_TYPE_IN_CMD_Q_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_FREE_QUOTA_MODET_T {
|
|
||||||
FREE_QUOTA_UPDATE_MODE_INIT = 0,
|
|
||||||
FREE_QUOTA_UPDATE_MODE_OVERWRITE,
|
|
||||||
FREE_QUOTA_UPDATE_MODE_INCREASE,
|
|
||||||
FREE_QUOTA_UPDATE_MODE_DECREASE
|
|
||||||
} ENUM_FREE_QUOTA_MODET_T, *P_ENUM_FREE_QUOTA_MODET_T;
|
|
||||||
|
|
||||||
typedef struct _CMD_UPDATE_WMM_PARMS_T {
|
|
||||||
AC_QUE_PARMS_T arACQueParms[AC_NUM];
|
|
||||||
UINT_8 ucNetTypeIndex;
|
|
||||||
UINT_8 fgIsQBSS;
|
|
||||||
UINT_8 aucReserved[2];
|
|
||||||
} CMD_UPDATE_WMM_PARMS_T, *P_CMD_UPDATE_WMM_PARMS_T;
|
|
||||||
|
|
||||||
typedef struct _CMD_TX_AMPDU_T {
|
|
||||||
BOOLEAN fgEnable;
|
|
||||||
UINT_8 aucReserved[3];
|
|
||||||
} CMD_TX_AMPDU_T, *P_CMD_TX_AMPDU_T;
|
|
||||||
|
|
||||||
typedef struct _CMD_ADDBA_REJECT {
|
|
||||||
BOOLEAN fgEnable;
|
|
||||||
UINT_8 aucReserved[3];
|
|
||||||
} CMD_ADDBA_REJECT_T, *P_CMD_ADDBA_REJECT_T;
|
|
||||||
|
|
||||||
typedef struct _CMD_SPECIFIC_RX_BA_WIN_SIZE_T {
|
|
||||||
BOOLEAN fgEnabled;
|
|
||||||
UINT_16 SpecificRxBAWinSize;
|
|
||||||
} CMD_SPECIFIC_RX_BA_WIN_SIZE_T, *P_CMD_SPECIFIC_RX_BA_WIN_SIZE_T;
|
|
||||||
|
|
||||||
#if CFG_RX_BA_REORDERING_ENHANCEMENT
|
|
||||||
typedef enum _ENUM_NO_NEED_WATIT_DROP_REASON_T {
|
|
||||||
PACKET_DROP_BY_FW = 0,
|
|
||||||
PACKET_DROP_BY_DRIVER,
|
|
||||||
PACKET_DROP_BY_INDEPENDENT_PKT
|
|
||||||
} ENUM_NO_NEED_WATIT_DROP_REASON_T, *P_ENUM_NO_NEED_WATIT_DROP_REASON_T;
|
|
||||||
|
|
||||||
typedef struct _NO_NEED_WAIT_PKT_T {
|
|
||||||
QUE_ENTRY_T rQueEntry;
|
|
||||||
UINT_16 u2SSN;
|
|
||||||
ENUM_NO_NEED_WATIT_DROP_REASON_T eDropReason;
|
|
||||||
} NO_NEED_WAIT_PKT_T, *P_NO_NEED_WAIT_PKT_T;
|
|
||||||
|
|
||||||
typedef struct _EVENT_PACKET_DROP_BY_FW_T {
|
|
||||||
/* Event header */
|
|
||||||
UINT_16 u2Length;
|
|
||||||
UINT_16 u2Reserved1; /* Must be filled with 0x0001 (EVENT Packet) */
|
|
||||||
UINT_8 ucEID;
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 aucReserved2[2];
|
|
||||||
|
|
||||||
/* Event Body */
|
|
||||||
UINT_8 ucStaRecIdx;
|
|
||||||
UINT_8 ucTid;
|
|
||||||
UINT_16 u2StartSSN;
|
|
||||||
UINT_8 au1BitmapSSN[QM_RX_MAX_FW_DROP_SSN_SIZE];
|
|
||||||
} EVENT_PACKET_DROP_BY_FW_T, *P_EVENT_PACKET_DROP_BY_FW_T;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define QM_TX_SET_NEXT_MSDU_INFO(_prMsduInfoPreceding, _prMsduInfoNext) \
|
|
||||||
((((_prMsduInfoPreceding)->rQueEntry).prNext) = (P_QUE_ENTRY_T)(_prMsduInfoNext))
|
|
||||||
|
|
||||||
#define QM_TX_SET_NEXT_SW_RFB(_prSwRfbPreceding, _prSwRfbNext) \
|
|
||||||
((((_prSwRfbPreceding)->rQueEntry).prNext) = (P_QUE_ENTRY_T)(_prSwRfbNext))
|
|
||||||
|
|
||||||
#define QM_TX_GET_NEXT_MSDU_INFO(_prMsduInfo) \
|
|
||||||
((P_MSDU_INFO_T)(((_prMsduInfo)->rQueEntry).prNext))
|
|
||||||
|
|
||||||
#define QM_RX_SET_NEXT_SW_RFB(_prSwRfbPreceding, _prSwRfbNext) \
|
|
||||||
((((_prSwRfbPreceding)->rQueEntry).prNext) = (P_QUE_ENTRY_T)(_prSwRfbNext))
|
|
||||||
|
|
||||||
#define QM_RX_GET_NEXT_SW_RFB(_prSwRfb) \
|
|
||||||
((P_SW_RFB_T)(((_prSwRfb)->rQueEntry).prNext))
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
#define QM_GET_STA_REC_PTR_FROM_INDEX(_prAdapter, _ucIndex) \
|
|
||||||
((((_ucIndex) != STA_REC_INDEX_BMCAST) && ((_ucIndex) != STA_REC_INDEX_NOT_FOUND)) ?\
|
|
||||||
&(_prAdapter->arStaRec[_ucIndex]) : NULL)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define QM_GET_STA_REC_PTR_FROM_INDEX(_prAdapter, _ucIndex) \
|
|
||||||
cnmGetStaRecByIndex(_prAdapter, _ucIndex)
|
|
||||||
|
|
||||||
#define QM_TX_SET_MSDU_INFO_FOR_DATA_PACKET(\
|
|
||||||
_prMsduInfo,\
|
|
||||||
_ucTC,\
|
|
||||||
_ucPacketType,\
|
|
||||||
_ucFormatID,\
|
|
||||||
_fgIs802_1x,\
|
|
||||||
_fgIs802_11,\
|
|
||||||
_u2PalLLH,\
|
|
||||||
_u2AclSN,\
|
|
||||||
_ucPsForwardingType,\
|
|
||||||
_ucPsSessionID\
|
|
||||||
) \
|
|
||||||
{\
|
|
||||||
ASSERT(_prMsduInfo);\
|
|
||||||
(_prMsduInfo)->ucTC = (_ucTC);\
|
|
||||||
(_prMsduInfo)->ucPacketType = (_ucPacketType);\
|
|
||||||
(_prMsduInfo)->ucFormatID = (_ucFormatID);\
|
|
||||||
(_prMsduInfo)->fgIs802_1x = (_fgIs802_1x);\
|
|
||||||
(_prMsduInfo)->fgIs802_11 = (_fgIs802_11);\
|
|
||||||
(_prMsduInfo)->u2PalLLH = (_u2PalLLH);\
|
|
||||||
(_prMsduInfo)->u2AclSN = (_u2AclSN);\
|
|
||||||
(_prMsduInfo)->ucPsForwardingType = (_ucPsForwardingType);\
|
|
||||||
(_prMsduInfo)->ucPsSessionID = (_ucPsSessionID);\
|
|
||||||
(_prMsduInfo)->fgIsBurstEnd = (FALSE);\
|
|
||||||
}
|
|
||||||
|
|
||||||
#define QM_INIT_STA_REC(\
|
|
||||||
_prStaRec,\
|
|
||||||
_fgIsValid,\
|
|
||||||
_fgIsQoS,\
|
|
||||||
_pucMacAddr\
|
|
||||||
)\
|
|
||||||
{\
|
|
||||||
ASSERT(_prStaRec);\
|
|
||||||
(_prStaRec)->fgIsValid = (_fgIsValid);\
|
|
||||||
(_prStaRec)->fgIsQoS = (_fgIsQoS);\
|
|
||||||
(_prStaRec)->fgIsInPS = FALSE; \
|
|
||||||
(_prStaRec)->ucPsSessionID = 0xFF;\
|
|
||||||
COPY_MAC_ADDR((_prStaRec)->aucMacAddr, (_pucMacAddr));\
|
|
||||||
}
|
|
||||||
|
|
||||||
#if QM_ADAPTIVE_TC_RESOURCE_CTRL
|
|
||||||
#define QM_GET_TX_QUEUE_LEN(_prAdapter, _u4QueIdx) \
|
|
||||||
((_prAdapter->rQM.au4AverageQueLen[(_u4QueIdx)] >> QM_QUE_LEN_MOVING_AVE_FACTOR))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define WMM_IE_OUI_TYPE(fp) (((P_IE_WMM_HDR_T)(fp))->ucOuiType)
|
|
||||||
#define WMM_IE_OUI_SUBTYPE(fp) (((P_IE_WMM_HDR_T)(fp))->ucOuiSubtype)
|
|
||||||
#define WMM_IE_OUI(fp) (((P_IE_WMM_HDR_T)(fp))->aucOui)
|
|
||||||
|
|
||||||
#if QM_DEBUG_COUNTER
|
|
||||||
#define QM_DBG_CNT_INC(_prQM, _index) { (_prQM)->au4QmDebugCounters[(_index)]++; }
|
|
||||||
#else
|
|
||||||
#define QM_DBG_CNT_INC(_prQM, _index) {}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_RX_BA_REORDERING_ENHANCEMENT
|
|
||||||
#define QM_GET_PREVIOUS_SSN(_u2CurrSSN) \
|
|
||||||
((UINT_16) (_u2CurrSSN == 0 ? (MAX_SEQ_NO_COUNT - 1) : (_u2CurrSSN - 1)))
|
|
||||||
#define QM_GET_DROP_BY_FW_SSN(_u2SSN) \
|
|
||||||
((UINT_16) (_u2SSN >>= 4))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Queue Management and STA_REC Initialization */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
VOID qmInit(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
#if QM_TEST_MODE
|
|
||||||
VOID qmTestCases(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VOID qmActivateStaRec(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
VOID qmDeactivateStaRec(IN P_ADAPTER_T prAdapter, IN UINT_32 u4StaRecIdx);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* TX-Related Queue Management */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
P_MSDU_INFO_T qmFlushTxQueues(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
P_MSDU_INFO_T qmFlushStaTxQueues(IN P_ADAPTER_T prAdapter, IN UINT_32 u4StaRecIdx);
|
|
||||||
|
|
||||||
P_MSDU_INFO_T qmEnqueueTxPackets(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfoListHead);
|
|
||||||
|
|
||||||
P_MSDU_INFO_T qmDequeueTxPackets(IN P_ADAPTER_T prAdapter, IN P_TX_TCQ_STATUS_T prTcqStatus);
|
|
||||||
|
|
||||||
VOID qmAdjustTcQuotas(IN P_ADAPTER_T prAdapter, OUT P_TX_TCQ_ADJUST_T prTcqAdjust, IN P_TX_TCQ_STATUS_T prTcqStatus);
|
|
||||||
|
|
||||||
#if QM_ADAPTIVE_TC_RESOURCE_CTRL
|
|
||||||
VOID qmReassignTcResource(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID qmUpdateAverageTxQueLen(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* RX-Related Queue Management */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
VOID qmInitRxQueues(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
P_SW_RFB_T qmFlushRxQueues(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
P_SW_RFB_T qmHandleRxPackets(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfbListHead);
|
|
||||||
|
|
||||||
VOID qmProcessPktWithReordering(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT P_QUE_T prReturnedQue);
|
|
||||||
|
|
||||||
VOID qmProcessBarFrame(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT P_QUE_T prReturnedQue);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
qmInsertFallWithinReorderPkt(IN P_SW_RFB_T prSwRfb, IN P_RX_BA_ENTRY_T prReorderQueParm, OUT P_QUE_T prReturnedQue);
|
|
||||||
|
|
||||||
VOID qmInsertFallAheadReorderPkt(IN P_SW_RFB_T prSwRfb, IN P_RX_BA_ENTRY_T prReorderQueParm, OUT P_QUE_T prReturnedQue);
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
qmPopOutDueToFallWithin(P_ADAPTER_T prAdapter, IN P_RX_BA_ENTRY_T prReorderQueParm,
|
|
||||||
OUT P_QUE_T prReturnedQue, OUT BOOLEAN *fgIsTimeout);
|
|
||||||
|
|
||||||
VOID qmPopOutDueToFallAhead(P_ADAPTER_T prAdapter, IN P_RX_BA_ENTRY_T prReorderQueParm, OUT P_QUE_T prReturnedQue);
|
|
||||||
|
|
||||||
VOID qmHandleMailboxRxMessage(IN MAILBOX_MSG_T prMailboxRxMsg);
|
|
||||||
|
|
||||||
BOOLEAN qmCompareSnIsLessThan(IN UINT_32 u4SnLess, IN UINT_32 u4SnGreater);
|
|
||||||
|
|
||||||
VOID qmHandleEventRxAddBa(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
|
|
||||||
|
|
||||||
VOID qmHandleEventRxDelBa(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
|
|
||||||
|
|
||||||
P_RX_BA_ENTRY_T qmLookupRxBaEntry(IN P_ADAPTER_T prAdapter, IN UINT_8 ucStaRecIdx, IN UINT_8 ucTid);
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
qmAddRxBaEntry(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_8 ucStaRecIdx, IN UINT_8 ucTid, IN UINT_16 u2WinStart, IN UINT_16 u2WinSize);
|
|
||||||
|
|
||||||
VOID qmDelRxBaEntry(IN P_ADAPTER_T prAdapter, IN UINT_8 ucStaRecIdx, IN UINT_8 ucTid, IN BOOLEAN fgFlushToHost);
|
|
||||||
|
|
||||||
#if CFG_RX_BA_REORDERING_ENHANCEMENT
|
|
||||||
VOID qmInsertNoNeedWaitPkt(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb, IN ENUM_NO_NEED_WATIT_DROP_REASON_T eDropReason);
|
|
||||||
|
|
||||||
VOID qmHandleEventDropByFW(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
|
|
||||||
|
|
||||||
VOID qmHandleNoNeedWaitPktList(IN P_RX_BA_ENTRY_T prReorderQueParm);
|
|
||||||
|
|
||||||
P_NO_NEED_WAIT_PKT_T qmSearchNoNeedWaitPktBySSN(IN P_RX_BA_ENTRY_T prReorderQueParm, IN UINT_32 u2SSN);
|
|
||||||
|
|
||||||
BOOLEAN qmIsIndependentPkt(IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID qmRemoveAllNoNeedWaitPkt(IN P_RX_BA_ENTRY_T prReorderQueParm);
|
|
||||||
|
|
||||||
VOID qmDumpNoNeedWaitPkt(IN P_RX_BA_ENTRY_T prReorderQueParm);
|
|
||||||
|
|
||||||
VOID qmProcessIndepentReorderQueue(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VOID mqmProcessAssocRsp(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, IN PUINT_8 pucIE, IN UINT_16 u2IELength);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
mqmParseEdcaParameters(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb, IN PUINT_8 pucIE, IN UINT_16 u2IELength, IN BOOLEAN fgForceOverride);
|
|
||||||
|
|
||||||
VOID mqmFillAcQueParam(IN P_IE_WMM_PARAM_T prIeWmmParam, IN UINT_32 u4AcOffset, OUT P_AC_QUE_PARMS_T prAcQueParams);
|
|
||||||
|
|
||||||
VOID mqmProcessScanResult(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prScanResult, OUT P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
/* Utility function: for deciding STA-REC index */
|
|
||||||
UINT_8 qmGetStaRecIdx(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucEthDestAddr, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType);
|
|
||||||
|
|
||||||
UINT_32
|
|
||||||
mqmGenerateWmmInfoIEByParam(BOOLEAN fgSupportUAPSD,
|
|
||||||
UINT_8 ucBmpDeliveryAC, UINT_8 ucBmpTriggerAC, UINT_8 ucUapsdSp, UINT_8 *pOutBuf);
|
|
||||||
|
|
||||||
VOID mqmGenerateWmmInfoIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
UINT_32 mqmGenerateWmmParamIEByParam(P_ADAPTER_T prAdapter,
|
|
||||||
P_BSS_INFO_T prBssInfo, UINT_8 *pOutBuf, ENUM_OP_MODE_T ucOpMode);
|
|
||||||
|
|
||||||
VOID mqmGenerateWmmParamIE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
ENUM_FRAME_ACTION_T
|
|
||||||
qmGetFrameAction(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType,
|
|
||||||
IN UINT_8 ucStaRecIdx, IN P_MSDU_INFO_T prMsduInfo, IN ENUM_FRAME_TYPE_IN_CMD_Q_T eFrameType);
|
|
||||||
|
|
||||||
VOID qmHandleEventBssAbsencePresence(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
|
|
||||||
|
|
||||||
VOID qmHandleEventStaChangePsMode(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
|
|
||||||
|
|
||||||
VOID mqmProcessAssocReq(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, IN PUINT_8 pucIE, IN UINT_16 u2IELength);
|
|
||||||
|
|
||||||
VOID qmHandleEventStaUpdateFreeQuota(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
qmUpdateFreeQuota(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_STA_RECORD_T prStaRec, IN UINT_8 ucUpdateMode, IN UINT_8 ucFreeQuota, IN UINT_8 ucNumOfTxDone);
|
|
||||||
|
|
||||||
VOID qmFreeAllByNetType(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx);
|
|
||||||
|
|
||||||
UINT_32 qmGetRxReorderQueuedBufferCount(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID qmHandleReorderBubbleTimeout(IN P_ADAPTER_T prAdapter, IN ULONG ulParamPtr);
|
|
||||||
VOID qmHandleEventCheckReorderBubble(IN P_ADAPTER_T prAdapter, IN P_WIFI_EVENT_T prEvent);
|
|
||||||
VOID qmHandleMissTimeout(IN P_RX_BA_ENTRY_T prReorderQueParm);
|
|
||||||
|
|
||||||
#if ARP_MONITER_ENABLE
|
|
||||||
VOID qmDetectArpNoResponse(P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
VOID qmResetArpDetect(VOID);
|
|
||||||
VOID qmHandleRxArpPackets(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb);
|
|
||||||
VOID qmHandleRxDhcpPackets(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb);
|
|
||||||
#endif
|
|
||||||
VOID qmHandleRxIpPackets(P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb, UINT_16 *flag);
|
|
||||||
|
|
||||||
VOID qmMoveStaTxQueue(P_STA_RECORD_T prSrcStaRec, P_STA_RECORD_T prDstStaRec);
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
VOID qmHandleDelTspec(P_ADAPTER_T prAdapter, ENUM_NETWORK_TYPE_INDEX_T eNetType,
|
|
||||||
P_STA_RECORD_T prStaRec, ENUM_ACI_T eAci);
|
|
||||||
|
|
||||||
#endif /* _QUE_MGT_H */
|
|
|
@ -1,875 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _WLAN_DEF_H
|
|
||||||
#define _WLAN_DEF_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* disconnect reason */
|
|
||||||
#define DISCONNECT_REASON_CODE_RESERVED 0
|
|
||||||
#define DISCONNECT_REASON_CODE_RADIO_LOST 1
|
|
||||||
#define DISCONNECT_REASON_CODE_DEAUTHENTICATED 2
|
|
||||||
#define DISCONNECT_REASON_CODE_DISASSOCIATED 3
|
|
||||||
#define DISCONNECT_REASON_CODE_NEW_CONNECTION 4
|
|
||||||
#define DISCONNECT_REASON_CODE_REASSOCIATION 5
|
|
||||||
#define DISCONNECT_REASON_CODE_ROAMING 6
|
|
||||||
|
|
||||||
/* The rate definitions */
|
|
||||||
#define TX_MODE_CCK 0x00
|
|
||||||
#define TX_MODE_OFDM 0x40
|
|
||||||
#define TX_MODE_HT_MM 0x80
|
|
||||||
#define TX_MODE_HT_GF 0xC0
|
|
||||||
|
|
||||||
#define RATE_CCK_SHORT_PREAMBLE 0x10
|
|
||||||
#define RATE_OFDM 0x20
|
|
||||||
|
|
||||||
#define PHY_RATE_1M 0x0
|
|
||||||
#define PHY_RATE_2M 0x1
|
|
||||||
#define PHY_RATE_5_5M 0x2
|
|
||||||
#define PHY_RATE_11M 0x3
|
|
||||||
#define PHY_RATE_6M 0xB
|
|
||||||
#define PHY_RATE_9M 0xF
|
|
||||||
#define PHY_RATE_12M 0xA
|
|
||||||
#define PHY_RATE_18M 0xE
|
|
||||||
#define PHY_RATE_24M 0x9
|
|
||||||
#define PHY_RATE_36M 0xD
|
|
||||||
#define PHY_RATE_48M 0x8
|
|
||||||
#define PHY_RATE_54M 0xC
|
|
||||||
#define PHY_RATE_MCS0 0x0
|
|
||||||
#define PHY_RATE_MCS1 0x1
|
|
||||||
#define PHY_RATE_MCS2 0x2
|
|
||||||
#define PHY_RATE_MCS3 0x3
|
|
||||||
#define PHY_RATE_MCS4 0x4
|
|
||||||
#define PHY_RATE_MCS5 0x5
|
|
||||||
#define PHY_RATE_MCS6 0x6
|
|
||||||
#define PHY_RATE_MCS7 0x7
|
|
||||||
#define PHY_RATE_MCS32 0x20
|
|
||||||
|
|
||||||
#define RATE_CCK_1M_LONG (TX_MODE_CCK | PHY_RATE_1M)
|
|
||||||
#define RATE_CCK_2M_LONG (TX_MODE_CCK | PHY_RATE_2M)
|
|
||||||
#define RATE_CCK_5_5M_LONG (TX_MODE_CCK | PHY_RATE_5_5M)
|
|
||||||
#define RATE_CCK_11M_LONG (TX_MODE_CCK | PHY_RATE_11M)
|
|
||||||
#define RATE_CCK_2M_SHORT (TX_MODE_CCK | PHY_RATE_2M | RATE_CCK_SHORT_PREAMBLE)
|
|
||||||
#define RATE_CCK_5_5M_SHORT (TX_MODE_CCK | PHY_RATE_5_5M | RATE_CCK_SHORT_PREAMBLE)
|
|
||||||
#define RATE_CCK_11M_SHORT (TX_MODE_CCK | PHY_RATE_11M | RATE_CCK_SHORT_PREAMBLE)
|
|
||||||
#define RATE_OFDM_6M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_6M)
|
|
||||||
#define RATE_OFDM_9M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_9M)
|
|
||||||
#define RATE_OFDM_12M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_12M)
|
|
||||||
#define RATE_OFDM_18M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_18M)
|
|
||||||
#define RATE_OFDM_24M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_24M)
|
|
||||||
#define RATE_OFDM_36M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_36M)
|
|
||||||
#define RATE_OFDM_48M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_48M)
|
|
||||||
#define RATE_OFDM_54M (TX_MODE_OFDM | RATE_OFDM | PHY_RATE_54M)
|
|
||||||
|
|
||||||
#define RATE_MM_MCS_0 (TX_MODE_HT_MM | PHY_RATE_MCS0)
|
|
||||||
#define RATE_MM_MCS_1 (TX_MODE_HT_MM | PHY_RATE_MCS1)
|
|
||||||
#define RATE_MM_MCS_2 (TX_MODE_HT_MM | PHY_RATE_MCS2)
|
|
||||||
#define RATE_MM_MCS_3 (TX_MODE_HT_MM | PHY_RATE_MCS3)
|
|
||||||
#define RATE_MM_MCS_4 (TX_MODE_HT_MM | PHY_RATE_MCS4)
|
|
||||||
#define RATE_MM_MCS_5 (TX_MODE_HT_MM | PHY_RATE_MCS5)
|
|
||||||
#define RATE_MM_MCS_6 (TX_MODE_HT_MM | PHY_RATE_MCS6)
|
|
||||||
#define RATE_MM_MCS_7 (TX_MODE_HT_MM | PHY_RATE_MCS7)
|
|
||||||
#define RATE_MM_MCS_32 (TX_MODE_HT_MM | PHY_RATE_MCS32)
|
|
||||||
|
|
||||||
#define RATE_GF_MCS_0 (TX_MODE_HT_GF | PHY_RATE_MCS0)
|
|
||||||
#define RATE_GF_MCS_1 (TX_MODE_HT_GF | PHY_RATE_MCS1)
|
|
||||||
#define RATE_GF_MCS_2 (TX_MODE_HT_GF | PHY_RATE_MCS2)
|
|
||||||
#define RATE_GF_MCS_3 (TX_MODE_HT_GF | PHY_RATE_MCS3)
|
|
||||||
#define RATE_GF_MCS_4 (TX_MODE_HT_GF | PHY_RATE_MCS4)
|
|
||||||
#define RATE_GF_MCS_5 (TX_MODE_HT_GF | PHY_RATE_MCS5)
|
|
||||||
#define RATE_GF_MCS_6 (TX_MODE_HT_GF | PHY_RATE_MCS6)
|
|
||||||
#define RATE_GF_MCS_7 (TX_MODE_HT_GF | PHY_RATE_MCS7)
|
|
||||||
#define RATE_GF_MCS_32 (TX_MODE_HT_GF | PHY_RATE_MCS32)
|
|
||||||
|
|
||||||
#define RATE_TX_MODE_MASK BITS(6, 7)
|
|
||||||
#define RATE_TX_MODE_OFFSET 6
|
|
||||||
#define RATE_CODE_GET_TX_MODE(_ucRateCode) ((_ucRateCode & RATE_TX_MODE_MASK) >> RATE_TX_MODE_OFFSET)
|
|
||||||
#define RATE_PHY_RATE_MASK BITS(0, 5)
|
|
||||||
#define RATE_PHY_RATE_OFFSET 0
|
|
||||||
#define RATE_CODE_GET_PHY_RATE(_ucRateCode) ((_ucRateCode & RATE_PHY_RATE_MASK) >> RATE_PHY_RATE_OFFSET)
|
|
||||||
#define RATE_PHY_RATE_SHORT_PREAMBLE BIT(4)
|
|
||||||
#define RATE_CODE_IS_SHORT_PREAMBLE(_ucRateCode) ((_ucRateCode & RATE_PHY_RATE_SHORT_PREAMBLE)?TRUE:FALSE)
|
|
||||||
|
|
||||||
#define CHNL_LIST_SZ_2G 14
|
|
||||||
#define CHNL_LIST_SZ_5G 14
|
|
||||||
|
|
||||||
/*! CNM(STA_RECORD_T) related definition */
|
|
||||||
#define CFG_STA_REC_NUM 20
|
|
||||||
|
|
||||||
/* PHY TYPE bit definitions */
|
|
||||||
#define PHY_TYPE_BIT_HR_DSSS BIT(PHY_TYPE_HR_DSSS_INDEX) /* HR/DSSS PHY (clause 18) */
|
|
||||||
#define PHY_TYPE_BIT_ERP BIT(PHY_TYPE_ERP_INDEX) /* ERP PHY (clause 19) */
|
|
||||||
#define PHY_TYPE_BIT_OFDM BIT(PHY_TYPE_OFDM_INDEX) /* OFDM 5 GHz PHY (clause 17) */
|
|
||||||
#define PHY_TYPE_BIT_HT BIT(PHY_TYPE_HT_INDEX) /* HT PHY (clause 20) */
|
|
||||||
|
|
||||||
/* PHY TYPE set definitions */
|
|
||||||
#define PHY_TYPE_SET_802_11ABGN (PHY_TYPE_BIT_OFDM | \
|
|
||||||
PHY_TYPE_BIT_HR_DSSS | \
|
|
||||||
PHY_TYPE_BIT_ERP | \
|
|
||||||
PHY_TYPE_BIT_HT)
|
|
||||||
|
|
||||||
#define PHY_TYPE_SET_802_11BGN (PHY_TYPE_BIT_HR_DSSS | \
|
|
||||||
PHY_TYPE_BIT_ERP | \
|
|
||||||
PHY_TYPE_BIT_HT)
|
|
||||||
|
|
||||||
#define PHY_TYPE_SET_802_11GN (PHY_TYPE_BIT_ERP | \
|
|
||||||
PHY_TYPE_BIT_HT)
|
|
||||||
|
|
||||||
#define PHY_TYPE_SET_802_11AN (PHY_TYPE_BIT_OFDM | \
|
|
||||||
PHY_TYPE_BIT_HT)
|
|
||||||
|
|
||||||
#define PHY_TYPE_SET_802_11ABG (PHY_TYPE_BIT_OFDM | \
|
|
||||||
PHY_TYPE_BIT_HR_DSSS | \
|
|
||||||
PHY_TYPE_BIT_ERP)
|
|
||||||
|
|
||||||
#define PHY_TYPE_SET_802_11BG (PHY_TYPE_BIT_HR_DSSS | \
|
|
||||||
PHY_TYPE_BIT_ERP)
|
|
||||||
|
|
||||||
#define PHY_TYPE_SET_802_11A (PHY_TYPE_BIT_OFDM)
|
|
||||||
|
|
||||||
#define PHY_TYPE_SET_802_11G (PHY_TYPE_BIT_ERP)
|
|
||||||
|
|
||||||
#define PHY_TYPE_SET_802_11B (PHY_TYPE_BIT_HR_DSSS)
|
|
||||||
|
|
||||||
#define PHY_TYPE_SET_802_11N (PHY_TYPE_BIT_HT)
|
|
||||||
|
|
||||||
/* Rate set bit definitions */
|
|
||||||
#define RATE_SET_BIT_1M BIT(RATE_1M_INDEX) /* Bit 0: 1M */
|
|
||||||
#define RATE_SET_BIT_2M BIT(RATE_2M_INDEX) /* Bit 1: 2M */
|
|
||||||
#define RATE_SET_BIT_5_5M BIT(RATE_5_5M_INDEX) /* Bit 2: 5.5M */
|
|
||||||
#define RATE_SET_BIT_11M BIT(RATE_11M_INDEX) /* Bit 3: 11M */
|
|
||||||
#define RATE_SET_BIT_22M BIT(RATE_22M_INDEX) /* Bit 4: 22M */
|
|
||||||
#define RATE_SET_BIT_33M BIT(RATE_33M_INDEX) /* Bit 5: 33M */
|
|
||||||
#define RATE_SET_BIT_6M BIT(RATE_6M_INDEX) /* Bit 6: 6M */
|
|
||||||
#define RATE_SET_BIT_9M BIT(RATE_9M_INDEX) /* Bit 7: 9M */
|
|
||||||
#define RATE_SET_BIT_12M BIT(RATE_12M_INDEX) /* Bit 8: 12M */
|
|
||||||
#define RATE_SET_BIT_18M BIT(RATE_18M_INDEX) /* Bit 9: 18M */
|
|
||||||
#define RATE_SET_BIT_24M BIT(RATE_24M_INDEX) /* Bit 10: 24M */
|
|
||||||
#define RATE_SET_BIT_36M BIT(RATE_36M_INDEX) /* Bit 11: 36M */
|
|
||||||
#define RATE_SET_BIT_48M BIT(RATE_48M_INDEX) /* Bit 12: 48M */
|
|
||||||
#define RATE_SET_BIT_54M BIT(RATE_54M_INDEX) /* Bit 13: 54M */
|
|
||||||
#define RATE_SET_BIT_HT_PHY BIT(RATE_HT_PHY_INDEX) /* Bit 14: BSS Selector */
|
|
||||||
|
|
||||||
/* Rate set definitions */
|
|
||||||
#define RATE_SET_HR_DSSS (RATE_SET_BIT_1M | \
|
|
||||||
RATE_SET_BIT_2M | \
|
|
||||||
RATE_SET_BIT_5_5M | \
|
|
||||||
RATE_SET_BIT_11M)
|
|
||||||
|
|
||||||
#define RATE_SET_ERP (RATE_SET_BIT_1M | \
|
|
||||||
RATE_SET_BIT_2M | \
|
|
||||||
RATE_SET_BIT_5_5M | \
|
|
||||||
RATE_SET_BIT_11M | \
|
|
||||||
RATE_SET_BIT_6M | \
|
|
||||||
RATE_SET_BIT_9M | \
|
|
||||||
RATE_SET_BIT_12M | \
|
|
||||||
RATE_SET_BIT_18M | \
|
|
||||||
RATE_SET_BIT_24M | \
|
|
||||||
RATE_SET_BIT_36M | \
|
|
||||||
RATE_SET_BIT_48M | \
|
|
||||||
RATE_SET_BIT_54M)
|
|
||||||
|
|
||||||
#define RATE_SET_ERP_P2P (RATE_SET_BIT_6M | \
|
|
||||||
RATE_SET_BIT_9M | \
|
|
||||||
RATE_SET_BIT_12M | \
|
|
||||||
RATE_SET_BIT_18M | \
|
|
||||||
RATE_SET_BIT_24M | \
|
|
||||||
RATE_SET_BIT_36M | \
|
|
||||||
RATE_SET_BIT_48M | \
|
|
||||||
RATE_SET_BIT_54M)
|
|
||||||
|
|
||||||
#define RATE_SET_OFDM (RATE_SET_BIT_6M | \
|
|
||||||
RATE_SET_BIT_9M | \
|
|
||||||
RATE_SET_BIT_12M | \
|
|
||||||
RATE_SET_BIT_18M | \
|
|
||||||
RATE_SET_BIT_24M | \
|
|
||||||
RATE_SET_BIT_36M | \
|
|
||||||
RATE_SET_BIT_48M | \
|
|
||||||
RATE_SET_BIT_54M)
|
|
||||||
|
|
||||||
#define RATE_SET_HT (RATE_SET_ERP)
|
|
||||||
/* #define RATE_SET_HT (RATE_SET_ERP | RATE_SET_BIT_HT_PHY) *//* NOTE(Kevin): TBD */
|
|
||||||
|
|
||||||
#define RATE_SET_ALL_ABG RATE_SET_ERP
|
|
||||||
|
|
||||||
#define BASIC_RATE_SET_HR_DSSS (RATE_SET_BIT_1M | \
|
|
||||||
RATE_SET_BIT_2M)
|
|
||||||
|
|
||||||
#define BASIC_RATE_SET_HR_DSSS_ERP (RATE_SET_BIT_1M | \
|
|
||||||
RATE_SET_BIT_2M | \
|
|
||||||
RATE_SET_BIT_5_5M | \
|
|
||||||
RATE_SET_BIT_11M)
|
|
||||||
|
|
||||||
#define BASIC_RATE_SET_ERP (RATE_SET_BIT_1M | \
|
|
||||||
RATE_SET_BIT_2M | \
|
|
||||||
RATE_SET_BIT_5_5M | \
|
|
||||||
RATE_SET_BIT_11M | \
|
|
||||||
RATE_SET_BIT_6M | \
|
|
||||||
RATE_SET_BIT_12M | \
|
|
||||||
RATE_SET_BIT_24M)
|
|
||||||
|
|
||||||
#define BASIC_RATE_SET_OFDM (RATE_SET_BIT_6M | \
|
|
||||||
RATE_SET_BIT_12M | \
|
|
||||||
RATE_SET_BIT_24M)
|
|
||||||
|
|
||||||
#define BASIC_RATE_SET_ERP_P2P (RATE_SET_BIT_6M | \
|
|
||||||
RATE_SET_BIT_12M | \
|
|
||||||
RATE_SET_BIT_24M)
|
|
||||||
|
|
||||||
#define INITIAL_RATE_SET_RCPI_100 RATE_SET_ALL_ABG
|
|
||||||
|
|
||||||
#define INITIAL_RATE_SET_RCPI_80 (RATE_SET_BIT_1M | \
|
|
||||||
RATE_SET_BIT_2M | \
|
|
||||||
RATE_SET_BIT_5_5M | \
|
|
||||||
RATE_SET_BIT_11M | \
|
|
||||||
RATE_SET_BIT_6M | \
|
|
||||||
RATE_SET_BIT_9M | \
|
|
||||||
RATE_SET_BIT_12M | \
|
|
||||||
RATE_SET_BIT_24M)
|
|
||||||
|
|
||||||
#define INITIAL_RATE_SET_RCPI_60 (RATE_SET_BIT_1M | \
|
|
||||||
RATE_SET_BIT_2M | \
|
|
||||||
RATE_SET_BIT_5_5M | \
|
|
||||||
RATE_SET_BIT_11M | \
|
|
||||||
RATE_SET_BIT_6M)
|
|
||||||
|
|
||||||
#define INITIAL_RATE_SET(_rcpi) (INITIAL_RATE_SET_ ## _rcpi)
|
|
||||||
|
|
||||||
#define RCPI_100 100 /* -60 dBm */
|
|
||||||
#define RCPI_80 80 /* -70 dBm */
|
|
||||||
#define RCPI_60 60 /* -80 dBm */
|
|
||||||
|
|
||||||
/* The number of RCPI records used to calculate their average value */
|
|
||||||
#define MAX_NUM_RCPI_RECORDS 10
|
|
||||||
|
|
||||||
/* The number of RCPI records used to calculate their average value */
|
|
||||||
#define NO_RCPI_RECORDS -128
|
|
||||||
#define MAX_RCPI_DBM 0
|
|
||||||
#define MIN_RCPI_DBM -100
|
|
||||||
|
|
||||||
#define MAC_TX_RESERVED_FIELD 0 /* NOTE(Kevin): Should defined in tx.h */
|
|
||||||
|
|
||||||
#define MAX_ASSOC_ID (CFG_STA_REC_NUM) /* Available AID: 1 ~ 20(STA_REC_NUM) */
|
|
||||||
|
|
||||||
#define MAX_DEAUTH_INFO_COUNT 4 /* NOTE(Kevin): Used in auth.c */
|
|
||||||
#define MIN_DEAUTH_INTERVAL_MSEC 500 /* The minimum interval if continuously send Deauth Frame */
|
|
||||||
|
|
||||||
/* Authentication Type */
|
|
||||||
#define AUTH_TYPE_OPEN_SYSTEM BIT(AUTH_ALGORITHM_NUM_OPEN_SYSTEM)
|
|
||||||
#define AUTH_TYPE_SHARED_KEY BIT(AUTH_ALGORITHM_NUM_SHARED_KEY)
|
|
||||||
#define AUTH_TYPE_FAST_BSS_TRANSITION BIT(AUTH_ALGORITHM_NUM_FAST_BSS_TRANSITION)
|
|
||||||
#define AUTH_TYPE_SAE BIT(AUTH_ALGORITHM_NUM_SAE)
|
|
||||||
|
|
||||||
/* Authentication Retry Limit */
|
|
||||||
#define TX_AUTH_ASSOCI_RETRY_LIMIT 2
|
|
||||||
#define TX_AUTH_ASSOCI_RETRY_LIMIT_FOR_ROAMING 1
|
|
||||||
|
|
||||||
/* WMM-2.2.1 WMM Information Element */
|
|
||||||
#define ELEM_MAX_LEN_WMM_INFO 7
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef UINT_16 PHY_TYPE, *P_PHY_TYPE;
|
|
||||||
typedef UINT_8 RCPI, *P_RCPI;
|
|
||||||
typedef UINT_8 ALC_VAL, *P_ALC_VAL;
|
|
||||||
|
|
||||||
typedef enum _ENUM_HW_BSSID_T {
|
|
||||||
BSSID_0 = 0,
|
|
||||||
BSSID_1,
|
|
||||||
BSSID_NUM
|
|
||||||
} ENUM_HW_BSSID_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_HW_MAC_ADDR_T {
|
|
||||||
MAC_ADDR_0 = 0,
|
|
||||||
MAC_ADDR_1,
|
|
||||||
MAC_ADDR_NUM
|
|
||||||
} ENUM_HW_MAC_ADDR_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_HW_OP_MODE_T {
|
|
||||||
HW_OP_MODE_STA = 0,
|
|
||||||
HW_OP_MODE_AP,
|
|
||||||
HW_OP_MODE_ADHOC,
|
|
||||||
HW_OP_MODE_NUM
|
|
||||||
} ENUM_HW_OP_MODE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_TSF_T {
|
|
||||||
ENUM_LOCAL_TSF_0,
|
|
||||||
ENUM_LOCAL_TSF_1,
|
|
||||||
ENUM_LOCAL_TSF_NUM
|
|
||||||
} ENUM_LOCAL_TSF_T, *P_ENUM_LOCAL_TSF_T;
|
|
||||||
|
|
||||||
typedef enum _HAL_TS_HW_UPDATE_MODE {
|
|
||||||
HAL_TSF_HW_UPDATE_BY_TICK_AND_RECEIVED_FRAME,
|
|
||||||
HAL_TSF_HW_UPDATE_BY_TICK_ONLY,
|
|
||||||
HAL_TSF_HW_UPDATE_BY_RECEIVED_FRAME_ONLY,
|
|
||||||
HAL_TSF_HW_UPDATE_BY_TICK_AND_RECEIVED_FRAME_AD_HOC
|
|
||||||
} HAL_TSF_HW_UPDATE_MODE;
|
|
||||||
|
|
||||||
typedef enum _ENUM_AC_T {
|
|
||||||
AC0 = 0,
|
|
||||||
AC1,
|
|
||||||
AC2,
|
|
||||||
AC3,
|
|
||||||
AC_NUM
|
|
||||||
} ENUM_AC_T, *P_ENUM_AC_T;
|
|
||||||
|
|
||||||
/* The Type of Network been activated */
|
|
||||||
typedef enum _ENUM_NETWORK_TYPE_INDEX_T {
|
|
||||||
NETWORK_TYPE_AIS_INDEX = 0,
|
|
||||||
NETWORK_TYPE_P2P_INDEX,
|
|
||||||
NETWORK_TYPE_BOW_INDEX,
|
|
||||||
NETWORK_TYPE_INDEX_NUM
|
|
||||||
} ENUM_NETWORK_TYPE_INDEX_T;
|
|
||||||
|
|
||||||
/* The Type of STA Type. */
|
|
||||||
typedef enum _ENUM_STA_TYPE_INDEX_T {
|
|
||||||
STA_TYPE_LEGACY_INDEX = 0,
|
|
||||||
STA_TYPE_P2P_INDEX,
|
|
||||||
STA_TYPE_BOW_INDEX,
|
|
||||||
STA_TYPE_INDEX_NUM
|
|
||||||
} ENUM_STA_TYPE_INDEX_T;
|
|
||||||
|
|
||||||
#define STA_ROLE_BASE_INDEX 4
|
|
||||||
|
|
||||||
typedef enum _ENUM_STA_ROLE_INDEX_T {
|
|
||||||
STA_ROLE_ADHOC_INDEX = STA_ROLE_BASE_INDEX, /* 4 */
|
|
||||||
STA_ROLE_CLIENT_INDEX,
|
|
||||||
STA_ROLE_AP_INDEX,
|
|
||||||
STA_ROLE_TDLS_INDEX,
|
|
||||||
STA_ROLE_DLS_INDEX /* Note: need to extend P_CMD_UPDATE_STA_RECORD_T */
|
|
||||||
} ENUM_STA_ROLE_INDEX_T;
|
|
||||||
|
|
||||||
/* The Power State of a specific Network */
|
|
||||||
typedef enum _ENUM_PWR_STATE_T {
|
|
||||||
PWR_STATE_IDLE = 0,
|
|
||||||
PWR_STATE_ACTIVE,
|
|
||||||
PWR_STATE_PS,
|
|
||||||
PWR_STATE_NUM
|
|
||||||
} ENUM_PWR_STATE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_PHY_TYPE_INDEX_T {
|
|
||||||
/* PHY_TYPE_DSSS_INDEX, *//* DSSS PHY (clause 15) -- Not used anymore */
|
|
||||||
PHY_TYPE_HR_DSSS_INDEX = 0, /* HR/DSSS PHY (clause 18) */
|
|
||||||
PHY_TYPE_ERP_INDEX, /* ERP PHY (clause 19) */
|
|
||||||
PHY_TYPE_ERP_P2P_INDEX, /* ERP PHY (clause 19) w/o HR/DSSS */
|
|
||||||
PHY_TYPE_OFDM_INDEX, /* OFDM 5 GHz PHY (clause 17) */
|
|
||||||
PHY_TYPE_HT_INDEX, /* HT PHY (clause 20) */
|
|
||||||
PHY_TYPE_INDEX_NUM /* 5 */
|
|
||||||
} ENUM_PHY_TYPE_INDEX_T, *P_ENUM_PHY_TYPE_INDEX_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_ACPI_STATE_T {
|
|
||||||
ACPI_STATE_D0 = 0,
|
|
||||||
ACPI_STATE_D1,
|
|
||||||
ACPI_STATE_D2,
|
|
||||||
ACPI_STATE_D3
|
|
||||||
} ENUM_ACPI_STATE_T;
|
|
||||||
|
|
||||||
/* The operation mode of a specific Network */
|
|
||||||
typedef enum _ENUM_OP_MODE_T {
|
|
||||||
OP_MODE_INFRASTRUCTURE = 0, /* Infrastructure/GC */
|
|
||||||
OP_MODE_IBSS, /* AdHoc */
|
|
||||||
OP_MODE_ACCESS_POINT, /* For GO */
|
|
||||||
OP_MODE_P2P_DEVICE, /* P2P Device */
|
|
||||||
OP_MODE_BOW,
|
|
||||||
OP_MODE_NUM
|
|
||||||
} ENUM_OP_MODE_T, *P_ENUM_OP_MODE_T;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* NL80211 interface type.
|
|
||||||
* Refer to the definition of nl80211_iftype in kernel/nl80211.h
|
|
||||||
*/
|
|
||||||
enum ENUM_IFTYPE {
|
|
||||||
IFTYPE_UNSPECIFIED = 0,
|
|
||||||
IFTYPE_ADHOC,
|
|
||||||
IFTYPE_STATION,
|
|
||||||
IFTYPE_AP,
|
|
||||||
IFTYPE_AP_VLAN,
|
|
||||||
IFTYPE_WDS,
|
|
||||||
IFTYPE_MONITOR,
|
|
||||||
IFTYPE_MESH_POINT,
|
|
||||||
IFTYPE_P2P_CLIENT,
|
|
||||||
IFTYPE_P2P_GO,
|
|
||||||
IFTYPE_P2P_DEVICE,
|
|
||||||
IFTYPE_OCB,
|
|
||||||
IFTYPE_NAN,
|
|
||||||
IFTYPE_NUM
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef enum _ENUM_CHNL_EXT_T {
|
|
||||||
CHNL_EXT_SCN = 0,
|
|
||||||
CHNL_EXT_SCA = 1,
|
|
||||||
CHNL_EXT_RES = 2,
|
|
||||||
CHNL_EXT_SCB = 3
|
|
||||||
} ENUM_CHNL_EXT_T, *P_ENUM_CHNL_EXT_T;
|
|
||||||
|
|
||||||
/* This starting freq of the band is unit of kHz */
|
|
||||||
typedef enum _ENUM_BAND_T {
|
|
||||||
BAND_NULL,
|
|
||||||
BAND_2G4,
|
|
||||||
BAND_5G,
|
|
||||||
BAND_NUM
|
|
||||||
} ENUM_BAND_T, *P_ENUM_BAND_T;
|
|
||||||
|
|
||||||
/* Provide supported channel list to other components in array format */
|
|
||||||
typedef struct _RF_CHANNEL_INFO_T {
|
|
||||||
ENUM_BAND_T eBand;
|
|
||||||
UINT_8 ucChannelNum;
|
|
||||||
enum nl80211_dfs_state eDFS;
|
|
||||||
} RF_CHANNEL_INFO_T, *P_RF_CHANNEL_INFO_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_RATE_INDEX_T {
|
|
||||||
RATE_1M_INDEX = 0, /* 1M */
|
|
||||||
RATE_2M_INDEX, /* 2M */
|
|
||||||
RATE_5_5M_INDEX, /* 5.5M */
|
|
||||||
RATE_11M_INDEX, /* 11M */
|
|
||||||
RATE_22M_INDEX, /* 22M */
|
|
||||||
RATE_33M_INDEX, /* 33M */
|
|
||||||
RATE_6M_INDEX, /* 6M */
|
|
||||||
RATE_9M_INDEX, /* 9M */
|
|
||||||
RATE_12M_INDEX, /* 12M */
|
|
||||||
RATE_18M_INDEX, /* 18M */
|
|
||||||
RATE_24M_INDEX, /* 24M */
|
|
||||||
RATE_36M_INDEX, /* 36M */
|
|
||||||
RATE_48M_INDEX, /* 48M */
|
|
||||||
RATE_54M_INDEX, /* 54M */
|
|
||||||
RATE_HT_PHY_INDEX, /* BSS Selector - HT PHY */
|
|
||||||
RATE_NUM /* 15 */
|
|
||||||
} ENUM_RATE_INDEX_T, *P_ENUM_RATE_INDEX_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_HT_RATE_INDEX_T {
|
|
||||||
HT_RATE_MCS0_INDEX = 0,
|
|
||||||
HT_RATE_MCS1_INDEX,
|
|
||||||
HT_RATE_MCS2_INDEX,
|
|
||||||
HT_RATE_MCS3_INDEX,
|
|
||||||
HT_RATE_MCS4_INDEX,
|
|
||||||
HT_RATE_MCS5_INDEX,
|
|
||||||
HT_RATE_MCS6_INDEX,
|
|
||||||
HT_RATE_MCS7_INDEX,
|
|
||||||
HT_RATE_MCS32_INDEX,
|
|
||||||
HT_RATE_NUM /* 9 */
|
|
||||||
} ENUM_HT_RATE_INDEX_T, *P_ENUM_HT_RATE_INDEX_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_PREMABLE_OPTION_T {
|
|
||||||
PREAMBLE_DEFAULT_LONG_NONE = 0, /* LONG for PHY_TYPE_HR_DSSS, NONE for PHY_TYPE_OFDM */
|
|
||||||
PREAMBLE_OPTION_SHORT, /* SHORT mandatory for PHY_TYPE_ERP, SHORT option for PHY_TYPE_HR_DSSS */
|
|
||||||
PREAMBLE_HT_MIXED_MODE,
|
|
||||||
PREAMBLE_HT_GREEN_FIELD,
|
|
||||||
PREAMBLE_OPTION_NUM
|
|
||||||
} ENUM_PREMABLE_OPTION_T, *P_ENUM_PREMABLE_OPTION_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_CHANNEL_WIDTH_T {
|
|
||||||
CW_20_40MHZ = 0,
|
|
||||||
CW_80MHZ = 1,
|
|
||||||
CW_160MHZ = 2,
|
|
||||||
CW_80P80MHZ = 3
|
|
||||||
} ENUM_CHANNEL_WIDTH_T, *P_ENUM_CHANNEL_WIDTH_P;
|
|
||||||
|
|
||||||
typedef enum _ENUM_MODULATION_SYSTEM_T {
|
|
||||||
MODULATION_SYSTEM_CCK = 0,
|
|
||||||
MODULATION_SYSTEM_OFDM,
|
|
||||||
MODULATION_SYSTEM_HT20,
|
|
||||||
MODULATION_SYSTEM_HT40,
|
|
||||||
MODULATION_SYSTEM_NUM
|
|
||||||
} ENUM_MODULATION_SYSTEM_T, *P_ENUM_MODULATION_SYSTEM_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_MODULATION_TYPE_T {
|
|
||||||
MODULATION_TYPE_CCK_BPSK = 0,
|
|
||||||
MODULATION_TYPE_QPSK,
|
|
||||||
MODULATION_TYPE_16QAM,
|
|
||||||
MODULATION_TYPE_64QAM,
|
|
||||||
MODULATION_TYPE_NUM
|
|
||||||
} ENUM_MODULATION_TYPE_T, *P_ENUM_MODULATION_TYPE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_PS_FORWARDING_TYPE_T {
|
|
||||||
PS_FORWARDING_TYPE_NON_PS = 0,
|
|
||||||
PS_FORWARDING_TYPE_DELIVERY_ENABLED,
|
|
||||||
PS_FORWARDING_TYPE_NON_DELIVERY_ENABLED,
|
|
||||||
PS_FORWARDING_MORE_DATA_ENABLED,
|
|
||||||
PS_FORWARDING_TYPE_NUM
|
|
||||||
} ENUM_PS_FORWARDING_TYPE_T, *P_ENUM_PS_FORWARDING_TYPE_T;
|
|
||||||
|
|
||||||
typedef struct _DEAUTH_INFO_T {
|
|
||||||
UINT_8 aucRxAddr[MAC_ADDR_LEN];
|
|
||||||
OS_SYSTIME rLastSendTime;
|
|
||||||
} DEAUTH_INFO_T, *P_DEAUTH_INFO_T;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Information Element (IE) handlers */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
typedef VOID(*PFN_APPEND_IE_FUNC) (P_ADAPTER_T, P_MSDU_INFO_T);
|
|
||||||
typedef VOID(*PFN_HANDLE_IE_FUNC) (P_ADAPTER_T, P_SW_RFB_T, P_IE_HDR_T);
|
|
||||||
typedef VOID(*PFN_VERIFY_IE_FUNC) (P_ADAPTER_T, P_SW_RFB_T, P_IE_HDR_T, PUINT_16);
|
|
||||||
typedef UINT_32(*PFN_CALCULATE_VAR_IE_LEN_FUNC) (P_ADAPTER_T, ENUM_NETWORK_TYPE_INDEX_T, P_STA_RECORD_T);
|
|
||||||
|
|
||||||
typedef struct _APPEND_IE_ENTRY_T {
|
|
||||||
UINT_16 u2EstimatedIELen;
|
|
||||||
PFN_APPEND_IE_FUNC pfnAppendIE;
|
|
||||||
} APPEND_IE_ENTRY_T, *P_APPEND_IE_ENTRY_T;
|
|
||||||
|
|
||||||
typedef struct _APPEND_VAR_IE_ENTRY_T {
|
|
||||||
UINT_16 u2EstimatedFixedIELen; /* For Fixed Length */
|
|
||||||
PFN_CALCULATE_VAR_IE_LEN_FUNC pfnCalculateVariableIELen;
|
|
||||||
PFN_APPEND_IE_FUNC pfnAppendIE;
|
|
||||||
} APPEND_VAR_IE_ENTRY_T, *P_APPEND_VAR_IE_ENTRY_T;
|
|
||||||
|
|
||||||
typedef struct _HANDLE_IE_ENTRY_T {
|
|
||||||
UINT_8 ucElemID;
|
|
||||||
PFN_HANDLE_IE_FUNC pfnHandleIE;
|
|
||||||
} HANDLE_IE_ENTRY_T, *P_HANDLE_IE_ENTRY_T;
|
|
||||||
|
|
||||||
typedef struct _VERIFY_IE_ENTRY_T {
|
|
||||||
UINT_8 ucElemID;
|
|
||||||
PFN_VERIFY_IE_FUNC pfnVarifyIE;
|
|
||||||
} VERIFY_IE_ENTRY_T, *P_VERIFY_IE_ENTRY_T;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Parameters of User Configuration */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
typedef enum _ENUM_PARAM_CONNECTION_POLICY_T {
|
|
||||||
CONNECT_BY_SSID_BEST_RSSI = 0,
|
|
||||||
CONNECT_BY_SSID_GOOD_RSSI_MIN_CH_LOAD,
|
|
||||||
CONNECT_BY_SSID_ANY, /* NOTE(Kevin): Needed by WHQL */
|
|
||||||
CONNECT_BY_BSSID,
|
|
||||||
CONNECT_BY_CUSTOMIZED_RULE /* NOTE(Kevin): TBD */
|
|
||||||
} ENUM_PARAM_CONNECTION_POLICY_T, *P_ENUM_PARAM_CONNECTION_POLICY_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_PARAM_PREAMBLE_TYPE_T {
|
|
||||||
PREAMBLE_TYPE_LONG = 0,
|
|
||||||
PREAMBLE_TYPE_SHORT,
|
|
||||||
PREAMBLE_TYPE_AUTO /*!< Try preamble short first, if fail tray preamble long. */
|
|
||||||
} ENUM_PARAM_PREAMBLE_TYPE_T, *P_ENUM_PARAM_PREAMBLE_TYPE_T;
|
|
||||||
|
|
||||||
/* This is enum defined for user to select a phy config listed in combo box */
|
|
||||||
typedef enum _ENUM_PARAM_PHY_CONFIG_T {
|
|
||||||
/*!< Can associated with 802.11abg AP but without n capability, Scan dual band. */
|
|
||||||
PHY_CONFIG_802_11ABG = 0,
|
|
||||||
PHY_CONFIG_802_11BG, /*!< Can associated with 802_11bg AP, Scan single band and not report 5G BSSs. */
|
|
||||||
PHY_CONFIG_802_11G, /*!< Can associated with 802_11g only AP, Scan single band and not report 5G BSSs. */
|
|
||||||
PHY_CONFIG_802_11A, /*!< Can associated with 802_11a only AP, Scan single band and not report 2.4G BSSs. */
|
|
||||||
PHY_CONFIG_802_11B, /*!< Can associated with 802_11b only AP, Scan single band and not report 5G BSSs. */
|
|
||||||
PHY_CONFIG_802_11ABGN, /*!< Can associated with 802.11abgn AP, Scan dual band. */
|
|
||||||
PHY_CONFIG_802_11BGN, /*!< Can associated with 802_11bgn AP, Scan single band and not report 5G BSSs. */
|
|
||||||
PHY_CONFIG_802_11AN, /*!< Can associated with 802_11an AP, Scan single band and not report 2.4G BSSs. */
|
|
||||||
PHY_CONFIG_802_11GN, /*!< Can associated with 802_11gn AP, Scan single band and not report 5G BSSs. */
|
|
||||||
PHY_CONFIG_NUM /* 9 */
|
|
||||||
} ENUM_PARAM_PHY_CONFIG_T, *P_ENUM_PARAM_PHY_CONFIG_T;
|
|
||||||
|
|
||||||
/* This is enum defined for user to select an AP Mode */
|
|
||||||
typedef enum _ENUM_PARAM_AP_MODE_T {
|
|
||||||
AP_MODE_11B = 0, /*!< Create 11b BSS if we support 802.11abg/802.11bg. */
|
|
||||||
AP_MODE_MIXED_11BG, /*!< Create 11bg mixed BSS if we support 802.11abg/802.11bg/802.11g. */
|
|
||||||
AP_MODE_11G, /*!< Create 11g only BSS if we support 802.11abg/802.11bg/802.11g. */
|
|
||||||
AP_MODE_11G_P2P, /*!< Create 11g only BSS for P2P if we support 802.11abg/802.11bg/802.11g. */
|
|
||||||
AP_MODE_11A, /*!< Create 11a only BSS if we support 802.11abg. */
|
|
||||||
AP_MODE_NUM /* 4 */
|
|
||||||
} ENUM_PARAM_AP_MODE_T, *P_ENUM_PARAM_AP_MODE_T;
|
|
||||||
|
|
||||||
/* Masks for determining the Network Type or the Station Role, given the ENUM_STA_TYPE_T */
|
|
||||||
#define NETWORK_TYPE_AIS_MASK BIT(NETWORK_TYPE_AIS_INDEX)
|
|
||||||
#define NETWORK_TYPE_P2P_MASK BIT(NETWORK_TYPE_P2P_INDEX)
|
|
||||||
#define NETWORK_TYPE_BOW_MASK BIT(NETWORK_TYPE_BOW_INDEX)
|
|
||||||
#define STA_TYPE_LEGACY_MASK BIT(STA_TYPE_LEGACY_INDEX)
|
|
||||||
#define STA_TYPE_P2P_MASK BIT(STA_TYPE_P2P_INDEX)
|
|
||||||
#define STA_TYPE_BOW_MASK BIT(STA_TYPE_BOW_INDEX)
|
|
||||||
#define STA_TYPE_ADHOC_MASK BIT(STA_ROLE_ADHOC_INDEX)
|
|
||||||
#define STA_TYPE_CLIENT_MASK BIT(STA_ROLE_CLIENT_INDEX)
|
|
||||||
#define STA_TYPE_AP_MASK BIT(STA_ROLE_AP_INDEX)
|
|
||||||
#define STA_TYPE_DLS_MASK BIT(STA_ROLE_DLS_INDEX)
|
|
||||||
#define STA_TYPE_TDLS_MASK BIT(STA_ROLE_TDLS_INDEX)
|
|
||||||
|
|
||||||
/* Macros for obtaining the Network Type or the Station Role, given the ENUM_STA_TYPE_T */
|
|
||||||
#define IS_STA_IN_AIS(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX)
|
|
||||||
#define IS_STA_IN_P2P(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX)
|
|
||||||
#define IS_STA_IN_BOW(_prStaRec) ((_prStaRec)->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX)
|
|
||||||
#define IS_STA_LEGACY_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_LEGACY_MASK)
|
|
||||||
#define IS_STA_P2P_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_P2P_MASK)
|
|
||||||
#define IS_STA_BOW_TYPE(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_BOW_MASK)
|
|
||||||
#define IS_ADHOC_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_ADHOC_MASK)
|
|
||||||
#define IS_CLIENT_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_CLIENT_MASK)
|
|
||||||
#define IS_AP_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_AP_MASK)
|
|
||||||
#define IS_DLS_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_DLS_MASK)
|
|
||||||
#define IS_TDLS_STA(_prStaRec) ((_prStaRec->eStaType) & STA_TYPE_TDLS_MASK)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The ENUM_STA_TYPE_T accounts for ENUM_NETWORK_TYPE_T and ENUM_STA_ROLE_INDEX_T.
|
|
||||||
* It is a merged version of Network Type and STA Role.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef enum _ENUM_STA_TYPE_T {
|
|
||||||
STA_TYPE_LEGACY_AP = (STA_TYPE_LEGACY_MASK | STA_TYPE_AP_MASK),
|
|
||||||
STA_TYPE_LEGACY_CLIENT = (STA_TYPE_LEGACY_MASK | STA_TYPE_CLIENT_MASK),
|
|
||||||
STA_TYPE_ADHOC_PEER = (STA_TYPE_LEGACY_MASK | STA_TYPE_ADHOC_MASK),
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
STA_TYPE_P2P_GO = (STA_TYPE_P2P_MASK | STA_TYPE_AP_MASK),
|
|
||||||
STA_TYPE_P2P_GC = (STA_TYPE_P2P_MASK | STA_TYPE_CLIENT_MASK),
|
|
||||||
#endif
|
|
||||||
#if CFG_ENABLE_BT_OVER_WIFI
|
|
||||||
STA_TYPE_BOW_AP = (STA_TYPE_BOW_MASK | STA_TYPE_AP_MASK),
|
|
||||||
STA_TYPE_BOW_CLIENT = (STA_TYPE_BOW_MASK | STA_TYPE_CLIENT_MASK),
|
|
||||||
#endif
|
|
||||||
STA_TYPE_DLS_PEER = (STA_TYPE_LEGACY_MASK | STA_TYPE_DLS_MASK),
|
|
||||||
STA_TYPE_TDLS_PEER = (STA_TYPE_LEGACY_MASK | STA_TYPE_TDLS_MASK)
|
|
||||||
} ENUM_STA_TYPE_T, *P_ENUM_STA_TYPE_T;
|
|
||||||
|
|
||||||
/* The type of BSS we discovered */
|
|
||||||
typedef enum _ENUM_BSS_TYPE_T {
|
|
||||||
BSS_TYPE_INFRASTRUCTURE = 1,
|
|
||||||
BSS_TYPE_IBSS,
|
|
||||||
BSS_TYPE_P2P_DEVICE,
|
|
||||||
BSS_TYPE_BOW_DEVICE,
|
|
||||||
BSS_TYPE_NUM
|
|
||||||
} ENUM_BSS_TYPE_T, *P_ENUM_BSS_TYPE_T;
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* RSN structures */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* #if defined(WINDOWS_DDK) || defined(WINDOWS_CE) */
|
|
||||||
/* #pragma pack(1) */
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
#define MAX_NUM_SUPPORTED_CIPHER_SUITES 9 /* max number of supported cipher suites */
|
|
||||||
#if CFG_SUPPORT_802_11W
|
|
||||||
#define MAX_NUM_SUPPORTED_AKM_SUITES 13 /* max number of supported AKM suites */
|
|
||||||
#else
|
|
||||||
#define MAX_NUM_SUPPORTED_AKM_SUITES 9 /* max number of supported AKM suites */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Structure of RSN Information */
|
|
||||||
typedef struct _RSN_INFO_T {
|
|
||||||
UINT_8 ucElemId;
|
|
||||||
UINT_16 u2Version;
|
|
||||||
UINT_32 u4GroupKeyCipherSuite;
|
|
||||||
UINT_32 u4PairwiseKeyCipherSuiteCount;
|
|
||||||
UINT_32 au4PairwiseKeyCipherSuite[MAX_NUM_SUPPORTED_CIPHER_SUITES];
|
|
||||||
UINT_32 u4AuthKeyMgtSuiteCount;
|
|
||||||
UINT_32 au4AuthKeyMgtSuite[MAX_NUM_SUPPORTED_AKM_SUITES];
|
|
||||||
UINT_16 u2RsnCap;
|
|
||||||
BOOLEAN fgRsnCapPresent;
|
|
||||||
UINT_16 u2PmkidCount;
|
|
||||||
UINT_8 aucPmkid[IW_PMKID_LEN];
|
|
||||||
} /*__KAL_ATTRIB_PACKED__*/ RSN_INFO_T, *P_RSN_INFO_T;
|
|
||||||
|
|
||||||
#define MAX_NUM_SUPPORTED_WAPI_AKM_SUITES 1 /* max number of supported AKM suites */
|
|
||||||
#define MAX_NUM_SUPPORTED_WAPI_CIPHER_SUITES 1 /* max number of supported cipher suites */
|
|
||||||
|
|
||||||
/* Structure of WAPI Information */
|
|
||||||
typedef struct _WAPI_INFO_T {
|
|
||||||
UINT_8 ucElemId;
|
|
||||||
UCHAR ucLength;
|
|
||||||
UINT_16 u2Version;
|
|
||||||
UINT_32 u4AuthKeyMgtSuiteCount;
|
|
||||||
UINT_32 au4AuthKeyMgtSuite[MAX_NUM_SUPPORTED_WAPI_AKM_SUITES];
|
|
||||||
UINT_32 u4PairwiseKeyCipherSuiteCount;
|
|
||||||
UINT_32 au4PairwiseKeyCipherSuite[MAX_NUM_SUPPORTED_WAPI_CIPHER_SUITES];
|
|
||||||
UINT_32 u4GroupKeyCipherSuite;
|
|
||||||
UINT_16 u2WapiCap;
|
|
||||||
UINT_16 u2Bkid;
|
|
||||||
UINT_8 aucBkid[1][16];
|
|
||||||
} /* __KAL_ATTRIB_PACKED__ */ WAPI_INFO_T, *P_WAPI_INFO_T;
|
|
||||||
|
|
||||||
/* #if defined(WINDOWS_DDK) || defined(WINDOWS_CE) */
|
|
||||||
/* #pragma pack() */
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
|
|
||||||
typedef struct _P2P_DEVICE_TYPE_T {
|
|
||||||
UINT_16 u2CategoryID;
|
|
||||||
UINT_16 u2SubCategoryID;
|
|
||||||
} P2P_DEVICE_TYPE_T, *P_P2P_DEVICE_TYPE_T;
|
|
||||||
|
|
||||||
typedef struct _P2P_DEVICE_DESC_T {
|
|
||||||
LINK_ENTRY_T rLinkEntry;
|
|
||||||
BOOLEAN fgDevInfoValid;
|
|
||||||
UINT_8 aucDeviceAddr[MAC_ADDR_LEN]; /* Device Address. */
|
|
||||||
UINT_8 aucInterfaceAddr[MAC_ADDR_LEN]; /* Interface Address. */
|
|
||||||
UINT_8 ucDeviceCapabilityBitmap;
|
|
||||||
UINT_8 ucGroupCapabilityBitmap;
|
|
||||||
UINT_16 u2ConfigMethod; /* Configure Method support. */
|
|
||||||
P2P_DEVICE_TYPE_T rPriDevType;
|
|
||||||
UINT_8 ucSecDevTypeNum;
|
|
||||||
P2P_DEVICE_TYPE_T arSecDevType[8]; /* Reference to P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT */
|
|
||||||
UINT_16 u2NameLength;
|
|
||||||
UINT_8 aucName[32]; /* Reference to WPS_ATTRI_MAX_LEN_DEVICE_NAME */
|
|
||||||
/* TODO: Service Information or PasswordID valid? */
|
|
||||||
} P2P_DEVICE_DESC_T, *P_P2P_DEVICE_DESC_T;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
static const UINT_8 aucRateIndex2RateCode[PREAMBLE_OPTION_NUM][RATE_NUM] = {
|
|
||||||
{ /* Long Preamble */
|
|
||||||
RATE_CCK_1M_LONG, /* RATE_1M_INDEX = 0 */
|
|
||||||
RATE_CCK_2M_LONG, /* RATE_2M_INDEX */
|
|
||||||
RATE_CCK_5_5M_LONG, /* RATE_5_5M_INDEX */
|
|
||||||
RATE_CCK_11M_LONG, /* RATE_11M_INDEX */
|
|
||||||
RATE_CCK_1M_LONG, /* RATE_22M_INDEX - Not supported */
|
|
||||||
RATE_CCK_1M_LONG, /* RATE_33M_INDEX - Not supported */
|
|
||||||
RATE_OFDM_6M, /* RATE_6M_INDEX */
|
|
||||||
RATE_OFDM_9M, /* RATE_9M_INDEX */
|
|
||||||
RATE_OFDM_12M, /* RATE_12M_INDEX */
|
|
||||||
RATE_OFDM_18M, /* RATE_18M_INDEX */
|
|
||||||
RATE_OFDM_24M, /* RATE_24M_INDEX */
|
|
||||||
RATE_OFDM_36M, /* RATE_36M_INDEX */
|
|
||||||
RATE_OFDM_48M, /* RATE_48M_INDEX */
|
|
||||||
RATE_OFDM_54M, /* RATE_54M_INDEX */
|
|
||||||
},
|
|
||||||
{ /* Short Preamble */
|
|
||||||
RATE_CCK_1M_LONG, /* RATE_1M_INDEX = 0 */
|
|
||||||
RATE_CCK_2M_SHORT, /* RATE_2M_INDEX */
|
|
||||||
RATE_CCK_5_5M_SHORT, /* RATE_5_5M_INDEX */
|
|
||||||
RATE_CCK_11M_SHORT, /* RATE_11M_INDEX */
|
|
||||||
RATE_CCK_1M_LONG, /* RATE_22M_INDEX - Not supported */
|
|
||||||
RATE_CCK_1M_LONG, /* RATE_33M_INDEX - Not supported */
|
|
||||||
RATE_OFDM_6M, /* RATE_6M_INDEX */
|
|
||||||
RATE_OFDM_9M, /* RATE_9M_INDEX */
|
|
||||||
RATE_OFDM_12M, /* RATE_12M_INDEX */
|
|
||||||
RATE_OFDM_18M, /* RATE_18M_INDEX */
|
|
||||||
RATE_OFDM_24M, /* RATE_24M_INDEX */
|
|
||||||
RATE_OFDM_36M, /* RATE_36M_INDEX */
|
|
||||||
RATE_OFDM_48M, /* RATE_48M_INDEX */
|
|
||||||
RATE_OFDM_54M, /* RATE_54M_INDEX */
|
|
||||||
},
|
|
||||||
{ /* Mixed Mode(Option) */
|
|
||||||
RATE_MM_MCS_0, /* RATE_MCS0_INDEX, */
|
|
||||||
RATE_MM_MCS_1, /* RATE_MCS1_INDEX, */
|
|
||||||
RATE_MM_MCS_2, /* RATE_MCS2_INDEX, */
|
|
||||||
RATE_MM_MCS_3, /* RATE_MCS3_INDEX, */
|
|
||||||
RATE_MM_MCS_4, /* RATE_MCS4_INDEX, */
|
|
||||||
RATE_MM_MCS_5, /* RATE_MCS5_INDEX, */
|
|
||||||
RATE_MM_MCS_6, /* RATE_MCS6_INDEX, */
|
|
||||||
RATE_MM_MCS_7, /* RATE_MCS7_INDEX, */
|
|
||||||
RATE_MM_MCS_32 /* RATE_MCS32_INDEX, */
|
|
||||||
},
|
|
||||||
{ /* Green Field(Option) */
|
|
||||||
RATE_GF_MCS_0, /* RATE_MCS0_INDEX, */
|
|
||||||
RATE_GF_MCS_1, /* RATE_MCS1_INDEX, */
|
|
||||||
RATE_GF_MCS_2, /* RATE_MCS2_INDEX, */
|
|
||||||
RATE_GF_MCS_3, /* RATE_MCS3_INDEX, */
|
|
||||||
RATE_GF_MCS_4, /* RATE_MCS4_INDEX, */
|
|
||||||
RATE_GF_MCS_5, /* RATE_MCS5_INDEX, */
|
|
||||||
RATE_GF_MCS_6, /* RATE_MCS6_INDEX, */
|
|
||||||
RATE_GF_MCS_7, /* RATE_MCS7_INDEX, */
|
|
||||||
RATE_GF_MCS_32 /* RATE_MCS32_INDEX, */
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static const UINT_8 aucRateTableSize[PREAMBLE_OPTION_NUM] = {
|
|
||||||
RATE_HT_PHY_INDEX,
|
|
||||||
RATE_HT_PHY_INDEX,
|
|
||||||
HT_RATE_NUM,
|
|
||||||
HT_RATE_NUM
|
|
||||||
};
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Macros to get and set the wireless LAN frame fields those are 16/32 bits in
|
|
||||||
* length.
|
|
||||||
*/
|
|
||||||
#define WLAN_GET_FIELD_16(_memAddr_p, _value_p) \
|
|
||||||
{ \
|
|
||||||
PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
|
|
||||||
*(PUINT_16)(_value_p) = ((UINT_16) __cp[0]) | ((UINT_16) __cp[1] << 8); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define WLAN_GET_FIELD_BE16(_memAddr_p, _value_p) \
|
|
||||||
{ \
|
|
||||||
PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
|
|
||||||
*(PUINT_16)(_value_p) = ((UINT_16) __cp[0] << 8) | ((UINT_16) __cp[1]); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define WLAN_GET_FIELD_32(_memAddr_p, _value_p) \
|
|
||||||
{ \
|
|
||||||
PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
|
|
||||||
*(PUINT_32)(_value_p) = ((UINT_32) __cp[0]) | ((UINT_32) __cp[1] << 8) | \
|
|
||||||
((UINT_32) __cp[2] << 16) | ((UINT_32) __cp[3] << 24); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define WLAN_GET_FIELD_BE32(_memAddr_p, _value_p) \
|
|
||||||
{ \
|
|
||||||
PUINT_8 __cp = (PUINT_8)(_memAddr_p); \
|
|
||||||
*(PUINT_32)(_value_p) = ((UINT_32)__cp[0] << 24) | \
|
|
||||||
((UINT_32)__cp[1] << 16) | ((UINT_32)__cp[2] << 8) | \
|
|
||||||
((UINT_32)__cp[3]); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define WLAN_GET_FIELD_64(_memAddr_p, _value_p) \
|
|
||||||
{ \
|
|
||||||
PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
|
|
||||||
*(PUINT_64)(_value_p) = \
|
|
||||||
((UINT_64) __cp[0]) | ((UINT_64) __cp[1] << 8) | \
|
|
||||||
((UINT_64) __cp[2] << 16) | ((UINT_64) __cp[3] << 24) | \
|
|
||||||
((UINT_64) __cp[4] << 32) | ((UINT_64) __cp[5] << 40) | \
|
|
||||||
((UINT_64) __cp[6] << 48) | ((UINT_64) __cp[7] << 56); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define WLAN_SET_FIELD_16(_memAddr_p, _value) \
|
|
||||||
{ \
|
|
||||||
PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
|
|
||||||
__cp[0] = (UINT_8) (_value); \
|
|
||||||
__cp[1] = (UINT_8) ((_value) >> 8); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define WLAN_SET_FIELD_BE16(_memAddr_p, _value) \
|
|
||||||
{ \
|
|
||||||
PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
|
|
||||||
__cp[0] = (UINT_8) ((_value) >> 8); \
|
|
||||||
__cp[1] = (UINT_8) (_value); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define WLAN_SET_FIELD_32(_memAddr_p, _value) \
|
|
||||||
{ \
|
|
||||||
PUINT_8 __cp = (PUINT_8) (_memAddr_p); \
|
|
||||||
__cp[0] = (UINT_8) (_value); \
|
|
||||||
__cp[1] = (UINT_8) ((_value) >> 8); \
|
|
||||||
__cp[2] = (UINT_8) ((_value) >> 16); \
|
|
||||||
__cp[3] = (UINT_8) ((_value) >> 24); \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _WLAN_DEF_H */
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,149 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _NIC_INIT_CMD_EVENT_H
|
|
||||||
#define _NIC_INIT_CMD_EVENT_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "gl_typedef.h"
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define INIT_CMD_STATUS_SUCCESS 0
|
|
||||||
#define INIT_CMD_STATUS_REJECTED_INVALID_PARAMS 1
|
|
||||||
#define INIT_CMD_STATUS_REJECTED_CRC_ERROR 2
|
|
||||||
#define INIT_CMD_STATUS_REJECTED_DECRYPT_FAIL 3
|
|
||||||
#define INIT_CMD_STATUS_UNKNOWN 4
|
|
||||||
|
|
||||||
#define EVENT_HDR_SIZE OFFSET_OF(WIFI_EVENT_T, aucBuffer[0])
|
|
||||||
|
|
||||||
typedef enum _ENUM_INIT_CMD_ID {
|
|
||||||
INIT_CMD_ID_DOWNLOAD_BUF = 1,
|
|
||||||
INIT_CMD_ID_WIFI_START,
|
|
||||||
INIT_CMD_ID_ACCESS_REG,
|
|
||||||
INIT_CMD_ID_QUERY_PENDING_ERROR
|
|
||||||
} ENUM_INIT_CMD_ID, *P_ENUM_INIT_CMD_ID;
|
|
||||||
|
|
||||||
typedef enum _ENUM_INIT_EVENT_ID {
|
|
||||||
INIT_EVENT_ID_CMD_RESULT = 1,
|
|
||||||
INIT_EVENT_ID_ACCESS_REG,
|
|
||||||
INIT_EVENT_ID_PENDING_ERROR
|
|
||||||
} ENUM_INIT_EVENT_ID, *P_ENUM_INIT_EVENT_ID;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef UINT_8 CMD_STATUS;
|
|
||||||
|
|
||||||
/* commands */
|
|
||||||
typedef struct _INIT_WIFI_CMD_T {
|
|
||||||
UINT_8 ucCID;
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_16 u2Reserved;
|
|
||||||
UINT_8 aucBuffer[0];
|
|
||||||
} INIT_WIFI_CMD_T, *P_INIT_WIFI_CMD_T;
|
|
||||||
|
|
||||||
typedef struct _INIT_HIF_TX_HEADER_T {
|
|
||||||
UINT_16 u2TxByteCount;
|
|
||||||
UINT_8 ucEtherTypeOffset;
|
|
||||||
UINT_8 ucCSflags;
|
|
||||||
INIT_WIFI_CMD_T rInitWifiCmd;
|
|
||||||
} INIT_HIF_TX_HEADER_T, *P_INIT_HIF_TX_HEADER_T;
|
|
||||||
|
|
||||||
#define DOWNLOAD_BUF_ENCRYPTION_MODE BIT(0)
|
|
||||||
#define DOWNLOAD_BUF_NO_CRC_CHECKING BIT(30)
|
|
||||||
#define DOWNLOAD_BUF_ACK_OPTION BIT(31)
|
|
||||||
typedef struct _INIT_CMD_DOWNLOAD_BUF {
|
|
||||||
UINT_32 u4Address;
|
|
||||||
UINT_32 u4Length;
|
|
||||||
UINT_32 u4CRC32;
|
|
||||||
UINT_32 u4DataMode;
|
|
||||||
UINT_8 aucBuffer[0];
|
|
||||||
} INIT_CMD_DOWNLOAD_BUF, *P_INIT_CMD_DOWNLOAD_BUF;
|
|
||||||
|
|
||||||
typedef struct _INIT_CMD_WIFI_START {
|
|
||||||
UINT_32 u4Override;
|
|
||||||
UINT_32 u4Address;
|
|
||||||
} INIT_CMD_WIFI_START, *P_INIT_CMD_WIFI_START;
|
|
||||||
|
|
||||||
typedef struct _INIT_CMD_ACCESS_REG {
|
|
||||||
UINT_8 ucSetQuery;
|
|
||||||
UINT_8 aucReserved[3];
|
|
||||||
UINT_32 u4Address;
|
|
||||||
UINT_32 u4Data;
|
|
||||||
} INIT_CMD_ACCESS_REG, *P_INIT_CMD_ACCESS_REG;
|
|
||||||
|
|
||||||
/* Events */
|
|
||||||
typedef struct _INIT_WIFI_EVENT_T {
|
|
||||||
UINT_16 u2RxByteCount;
|
|
||||||
UINT_8 ucEID;
|
|
||||||
UINT_8 ucSeqNum;
|
|
||||||
UINT_8 aucBuffer[0];
|
|
||||||
} INIT_WIFI_EVENT_T, *P_INIT_WIFI_EVENT_T;
|
|
||||||
|
|
||||||
typedef struct _INIT_HIF_RX_HEADER_T {
|
|
||||||
INIT_WIFI_EVENT_T rInitWifiEvent;
|
|
||||||
} INIT_HIF_RX_HEADER_T, *P_INIT_HIF_RX_HEADER_T;
|
|
||||||
|
|
||||||
typedef struct _INIT_EVENT_CMD_RESULT {
|
|
||||||
UINT_8 ucStatus; /* 0: success */
|
|
||||||
/* 1: rejected by invalid param */
|
|
||||||
/* 2: rejected by incorrect CRC */
|
|
||||||
/* 3: rejected by decryption failure */
|
|
||||||
/* 4: unknown CMD */
|
|
||||||
UINT_8 aucReserved[3];
|
|
||||||
} INIT_EVENT_CMD_RESULT, *P_INIT_EVENT_CMD_RESULT, INIT_EVENT_PENDING_ERROR, *P_INIT_EVENT_PENDING_ERROR;
|
|
||||||
|
|
||||||
typedef struct _INIT_EVENT_ACCESS_REG {
|
|
||||||
UINT_32 u4Address;
|
|
||||||
UINT_32 u4Data;
|
|
||||||
} INIT_EVENT_ACCESS_REG, *P_INIT_EVENT_ACCESS_REG;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _NIC_INIT_CMD_EVENT_H */
|
|
|
@ -1,205 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_PRECOMP_H
|
|
||||||
#define _P2P_PRECOMP_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#include "gl_os.h" /* Include "config.h" */
|
|
||||||
|
|
||||||
#include "gl_p2p_os.h"
|
|
||||||
|
|
||||||
#include "debug.h"
|
|
||||||
|
|
||||||
#include "link.h"
|
|
||||||
#include "queue.h"
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* .\include\mgmt
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#include "wlan_typedef.h"
|
|
||||||
|
|
||||||
#include "mac.h"
|
|
||||||
|
|
||||||
/* Dependency: mac.h (MAC_ADDR_LEN) */
|
|
||||||
#include "wlan_def.h"
|
|
||||||
|
|
||||||
#include "roaming_fsm.h"
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* .\include\nic
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
/* Dependency: wlan_def.h (ENUM_NETWORK_TYPE_T) */
|
|
||||||
#include "cmd_buf.h"
|
|
||||||
|
|
||||||
/* Dependency: mac.h (MAC_ADDR_LEN) */
|
|
||||||
#include "nic_cmd_event.h"
|
|
||||||
|
|
||||||
/* Dependency: nic_cmd_event.h (P_EVENT_CONNECTION_STATUS) */
|
|
||||||
#include "nic.h"
|
|
||||||
|
|
||||||
#include "nic_init_cmd_event.h"
|
|
||||||
|
|
||||||
#include "hif_rx.h"
|
|
||||||
#include "hif_tx.h"
|
|
||||||
|
|
||||||
#include "nic_tx.h"
|
|
||||||
|
|
||||||
/* Dependency: hif_rx.h (P_HIF_RX_HEADER_T) */
|
|
||||||
#include "nic_rx.h"
|
|
||||||
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
#include "p2p_typedef.h"
|
|
||||||
#include "p2p_cmd_buf.h"
|
|
||||||
#include "p2p_nic_cmd_event.h"
|
|
||||||
#include "p2p_mac.h"
|
|
||||||
#include "p2p_nic.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* .\include\mgmt
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "hem_mbox.h"
|
|
||||||
|
|
||||||
#include "scan.h"
|
|
||||||
#include "bss.h"
|
|
||||||
|
|
||||||
#include "wlan_lib.h"
|
|
||||||
#include "wlan_oid.h"
|
|
||||||
#include "wlan_bow.h"
|
|
||||||
|
|
||||||
#include "wlan_p2p.h"
|
|
||||||
|
|
||||||
#include "hal.h"
|
|
||||||
|
|
||||||
#if defined(MT6620)
|
|
||||||
#include "mt6620_reg.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "rlm.h"
|
|
||||||
#include "rlm_domain.h"
|
|
||||||
#include "rlm_protection.h"
|
|
||||||
#include "rlm_obss.h"
|
|
||||||
#include "rate.h"
|
|
||||||
#include "wnm.h"
|
|
||||||
|
|
||||||
#include "aa_fsm.h"
|
|
||||||
|
|
||||||
#include "cnm_timer.h"
|
|
||||||
#include "que_mgt.h"
|
|
||||||
#include "wmm.h"
|
|
||||||
|
|
||||||
#if CFG_ENABLE_BT_OVER_WIFI
|
|
||||||
#include "bow.h"
|
|
||||||
#include "bow_fsm.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "pwr_mgt.h"
|
|
||||||
|
|
||||||
#include "cnm.h"
|
|
||||||
/* Dependency: aa_fsm.h (ENUM_AA_STATE_T), p2p_fsm.h (WPS_ATTRI_MAX_LEN_DEVICE_NAME) */
|
|
||||||
#include "cnm_mem.h"
|
|
||||||
#include "cnm_scan.h"
|
|
||||||
|
|
||||||
#include "p2p_rlm_obss.h"
|
|
||||||
#include "p2p_bss.h"
|
|
||||||
#include "p2p.h"
|
|
||||||
/* Dependency: cnm_timer.h (TIMER_T) */
|
|
||||||
#include "p2p_fsm.h"
|
|
||||||
#include "p2p_scan.h"
|
|
||||||
#include "p2p_state.h"
|
|
||||||
#include "p2p_func.h"
|
|
||||||
#include "p2p_rlm.h"
|
|
||||||
#include "p2p_assoc.h"
|
|
||||||
#include "p2p_ie.h"
|
|
||||||
|
|
||||||
#include "privacy.h"
|
|
||||||
|
|
||||||
#include "mib.h"
|
|
||||||
|
|
||||||
#include "auth.h"
|
|
||||||
#include "assoc.h"
|
|
||||||
|
|
||||||
#include "ais_fsm.h"
|
|
||||||
|
|
||||||
#include "adapter.h"
|
|
||||||
|
|
||||||
#include "que_mgt.h"
|
|
||||||
#include "rftest.h"
|
|
||||||
|
|
||||||
#if CFG_RSN_MIGRATION
|
|
||||||
#include "rsn.h"
|
|
||||||
#include "sec_fsm.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_WAPI
|
|
||||||
#include "wapi.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* NVRAM structure
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#include "CFG_Wifi_File.h"
|
|
||||||
|
|
||||||
#include "gl_p2p_kal.h"
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /*_P2P_PRECOMP_H */
|
|
|
@ -1,167 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _P2P_TYPEDEF_H
|
|
||||||
#define _P2P_TYPEDEF_H
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* type definition of pointer to p2p structure
|
|
||||||
*/
|
|
||||||
/* typedef struct _GL_P2P_INFO_T GL_P2P_INFO_T, *P_GL_P2P_INFO_T; */
|
|
||||||
typedef struct _P2P_INFO_T P2P_INFO_T, *P_P2P_INFO_T;
|
|
||||||
|
|
||||||
typedef struct _P2P_FSM_INFO_T P2P_FSM_INFO_T, *P_P2P_FSM_INFO_T;
|
|
||||||
|
|
||||||
typedef struct _P2P_CONNECTION_SETTINGS_T P2P_CONNECTION_SETTINGS_T, *P_P2P_CONNECTION_SETTINGS_T;
|
|
||||||
|
|
||||||
/* Type definition for function pointer to p2p function*/
|
|
||||||
typedef BOOLEAN(*P2P_LAUNCH) (P_GLUE_INFO_T prGlueInfo);
|
|
||||||
|
|
||||||
typedef BOOLEAN(*P2P_REMOVE) (P_GLUE_INFO_T prGlueInfo, BOOLEAN fgIsWlanLaunched);
|
|
||||||
|
|
||||||
typedef BOOLEAN(*KAL_P2P_GET_CIPHER) (IN P_GLUE_INFO_T prGlueInfo);
|
|
||||||
|
|
||||||
typedef BOOLEAN(*KAL_P2P_GET_TKIP_CIPHER) (IN P_GLUE_INFO_T prGlueInfo);
|
|
||||||
|
|
||||||
typedef BOOLEAN(*KAL_P2P_GET_CCMP_CIPHER) (IN P_GLUE_INFO_T prGlueInfo);
|
|
||||||
|
|
||||||
typedef BOOLEAN(*KAL_P2P_GET_WSC_MODE) (IN P_GLUE_INFO_T prGlueInfo);
|
|
||||||
|
|
||||||
typedef struct net_device *(*KAL_P2P_GET_DEV_HDLR) (P_GLUE_INFO_T prGlueInfo);
|
|
||||||
|
|
||||||
typedef VOID(*KAL_P2P_SET_MULTICAST_WORK_ITEM) (P_GLUE_INFO_T prGlueInfo);
|
|
||||||
|
|
||||||
typedef VOID(*P2P_NET_REGISTER) (P_GLUE_INFO_T prGlueInfo);
|
|
||||||
|
|
||||||
typedef VOID(*P2P_NET_UNREGISTER) (P_GLUE_INFO_T prGlueInfo);
|
|
||||||
|
|
||||||
typedef VOID(*KAL_P2P_UPDATE_ASSOC_INFO) (IN P_GLUE_INFO_T prGlueInfo,
|
|
||||||
IN PUINT_8 pucFrameBody,
|
|
||||||
IN UINT_32 u4FrameBodyLen, IN BOOLEAN fgReassocRequest);
|
|
||||||
|
|
||||||
typedef BOOLEAN(*P2P_VALIDATE_AUTH) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb, IN PP_STA_RECORD_T pprStaRec, OUT PUINT_16 pu2StatusCode);
|
|
||||||
|
|
||||||
typedef BOOLEAN(*P2P_VALIDATE_ASSOC_REQ) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb, OUT PUINT_16 pu4ControlFlags);
|
|
||||||
|
|
||||||
typedef VOID(*P2P_RUN_EVENT_AAA_TX_FAIL) (IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
typedef BOOLEAN(*P2P_PARSE_CHECK_FOR_P2P_INFO_ELEM) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PUINT_8 pucBuf, OUT PUINT_8 pucOuiType);
|
|
||||||
|
|
||||||
typedef WLAN_STATUS(*P2P_RUN_EVENT_AAA_COMPLETE) (IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
typedef VOID(*P2P_PROCESS_EVENT_UPDATE_NOA_PARAM) (IN P_ADAPTER_T prAdapter,
|
|
||||||
UINT_8 ucNetTypeIndex,
|
|
||||||
P_EVENT_UPDATE_NOA_PARAMS_T prEventUpdateNoaParam);
|
|
||||||
|
|
||||||
typedef VOID(*SCAN_P2P_PROCESS_BEACON_AND_PROBE_RESP) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb,
|
|
||||||
IN P_WLAN_STATUS prStatus,
|
|
||||||
IN P_BSS_DESC_T prBssDesc,
|
|
||||||
IN P_WLAN_BEACON_FRAME_T prWlanBeaconFrame);
|
|
||||||
|
|
||||||
typedef VOID(*P2P_RX_PUBLIC_ACTION_FRAME) (P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
typedef VOID(*RLM_RSP_GENERATE_OBSS_SCAN_IE) (P_ADAPTER_T prAdapter, P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
typedef VOID(*RLM_UPDATE_BW_BY_CH_LIST_FOR_AP) (P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
typedef VOID(*RLM_PROCESS_PUBLIC_ACTION) (P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
typedef VOID(*RLM_PROCESS_HT_ACTION) (P_ADAPTER_T prAdapter, P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
typedef VOID(*RLM_UPDATE_PARAMS_FOR_AP) (P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo, BOOLEAN fgUpdateBeacon);
|
|
||||||
|
|
||||||
typedef VOID(*RLM_HANDLE_OBSS_STATUS_EVENT_PKT) (P_ADAPTER_T prAdapter, P_EVENT_AP_OBSS_STATUS_T prObssStatus);
|
|
||||||
|
|
||||||
typedef BOOLEAN(*P2P_FUNC_VALIDATE_PROBE_REQ) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb, OUT PUINT_32 pu4ControlFlags);
|
|
||||||
|
|
||||||
typedef VOID(*RLM_BSS_INIT_FOR_AP) (P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo);
|
|
||||||
|
|
||||||
typedef UINT_32(*P2P_GET_PROB_RSP_IE_TABLE_SIZE) (VOID);
|
|
||||||
|
|
||||||
typedef PUINT_8(*P2P_BUILD_REASSOC_REQ_FRAME_COMMON_IES) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_MSDU_INFO_T prMsduInfo, IN PUINT_8 pucBuffer);
|
|
||||||
|
|
||||||
typedef VOID(*P2P_FUNC_DISCONNECT) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_STA_RECORD_T prStaRec, IN BOOLEAN fgSendDeauth, IN UINT_16 u2ReasonCode);
|
|
||||||
|
|
||||||
typedef VOID(*P2P_FSM_RUN_EVENT_RX_DEAUTH) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_STA_RECORD_T prStaRec, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
typedef VOID(*P2P_FSM_RUN_EVENT_RX_DISASSOC) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_STA_RECORD_T prStaRec, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
typedef BOOLEAN(*P2P_FUN_IS_AP_MODE) (IN P_P2P_FSM_INFO_T prP2pFsmInfo);
|
|
||||||
|
|
||||||
typedef VOID(*P2P_FSM_RUN_EVENT_BEACON_TIMEOUT) (IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
typedef VOID(*P2P_FUNC_STORE_ASSOC_RSP_IE_BUFFER) (IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
typedef VOID(*P2P_GENERATE_P2P_IE) (IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
|
|
||||||
|
|
||||||
typedef UINT_32(*P2P_CALCULATE_P2P_IE_LEN) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#endif /*CFG_ENABLE_WIFI_DIRECT */
|
|
||||||
|
|
||||||
#endif /* _P2P_TYPEDEF_H */
|
|
|
@ -1,239 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _PRECOMP_H
|
|
||||||
#define _PRECOMP_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#include "gl_os.h" /* Include "config.h" */
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
#include "gl_p2p_os.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "debug.h"
|
|
||||||
|
|
||||||
#include "link.h"
|
|
||||||
#include "queue.h"
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* .\include\mgmt
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#include "wlan_typedef.h"
|
|
||||||
|
|
||||||
#include "mac.h"
|
|
||||||
|
|
||||||
/* Dependency: mac.h (MAC_ADDR_LEN) */
|
|
||||||
#include "wlan_def.h"
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_SWCR
|
|
||||||
#include "swcr.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* .\include\nic
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
/* Dependency: wlan_def.h (ENUM_NETWORK_TYPE_T) */
|
|
||||||
#include "cmd_buf.h"
|
|
||||||
|
|
||||||
/* Dependency: mac.h (MAC_ADDR_LEN) */
|
|
||||||
#include "nic_cmd_event.h"
|
|
||||||
|
|
||||||
/* Dependency: nic_cmd_event.h (P_EVENT_CONNECTION_STATUS) */
|
|
||||||
#include "nic.h"
|
|
||||||
|
|
||||||
#include "nic_init_cmd_event.h"
|
|
||||||
|
|
||||||
#include "hif_rx.h"
|
|
||||||
#include "hif_tx.h"
|
|
||||||
|
|
||||||
#include "nic_tx.h"
|
|
||||||
|
|
||||||
/* Dependency: hif_rx.h (P_HIF_RX_HEADER_T) */
|
|
||||||
#include "nic_rx.h"
|
|
||||||
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
#include "p2p_typedef.h"
|
|
||||||
#include "p2p_cmd_buf.h"
|
|
||||||
#include "p2p_nic_cmd_event.h"
|
|
||||||
#include "p2p_mac.h"
|
|
||||||
#include "p2p_nic.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* .\include\mgmt
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "hem_mbox.h"
|
|
||||||
|
|
||||||
#include "scan.h"
|
|
||||||
#include "bss.h"
|
|
||||||
|
|
||||||
#include "wlan_lib.h"
|
|
||||||
#include "wlan_oid.h"
|
|
||||||
#include "wlan_bow.h"
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
#include "wlan_p2p.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "hal.h"
|
|
||||||
|
|
||||||
#if defined(MT6620)
|
|
||||||
#include "mt6620_reg.h"
|
|
||||||
#elif defined(MT6628)
|
|
||||||
/* #include "mt6628_reg.h" */
|
|
||||||
#include "mtreg.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "rlm.h"
|
|
||||||
#include "rlm_domain.h"
|
|
||||||
#include "rlm_protection.h"
|
|
||||||
#include "rlm_obss.h"
|
|
||||||
#include "rate.h"
|
|
||||||
#include "wnm.h"
|
|
||||||
|
|
||||||
#include "qosmap.h"
|
|
||||||
|
|
||||||
#include "aa_fsm.h"
|
|
||||||
|
|
||||||
#include "cnm_timer.h"
|
|
||||||
|
|
||||||
#include "que_mgt.h"
|
|
||||||
|
|
||||||
#include "wmm.h"
|
|
||||||
|
|
||||||
#if CFG_ENABLE_BT_OVER_WIFI
|
|
||||||
#include "bow.h"
|
|
||||||
#include "bow_fsm.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "pwr_mgt.h"
|
|
||||||
|
|
||||||
#if (CFG_SUPPORT_STATISTICS == 1)
|
|
||||||
#include "stats.h"
|
|
||||||
#endif /* CFG_SUPPORT_STATISTICS */
|
|
||||||
|
|
||||||
#include "cnm.h"
|
|
||||||
/* Dependency: aa_fsm.h (ENUM_AA_STATE_T), p2p_fsm.h (WPS_ATTRI_MAX_LEN_DEVICE_NAME) */
|
|
||||||
#include "cnm_mem.h"
|
|
||||||
#include "cnm_scan.h"
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
#include "p2p_rlm_obss.h"
|
|
||||||
#include "p2p_bss.h"
|
|
||||||
#include "p2p.h"
|
|
||||||
#include "p2p_fsm.h"
|
|
||||||
#include "p2p_scan.h"
|
|
||||||
#include "p2p_state.h"
|
|
||||||
#include "p2p_func.h"
|
|
||||||
#include "p2p_rlm.h"
|
|
||||||
#include "p2p_assoc.h"
|
|
||||||
#include "p2p_ie.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "privacy.h"
|
|
||||||
|
|
||||||
#include "mib.h"
|
|
||||||
|
|
||||||
#include "auth.h"
|
|
||||||
#include "assoc.h"
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_ROAMING
|
|
||||||
#include "roaming_fsm.h"
|
|
||||||
#endif /* CFG_SUPPORT_ROAMING */
|
|
||||||
|
|
||||||
#include "ais_fsm.h"
|
|
||||||
|
|
||||||
#include "adapter.h"
|
|
||||||
|
|
||||||
#include "que_mgt.h"
|
|
||||||
#include "rftest.h"
|
|
||||||
|
|
||||||
#if CFG_RSN_MIGRATION
|
|
||||||
#include "rsn.h"
|
|
||||||
#include "sec_fsm.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_WAPI
|
|
||||||
#include "wapi.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
* NVRAM structure
|
|
||||||
*------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#include "CFG_Wifi_File.h"
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
#include "gl_p2p_kal.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef int (*set_p2p_mode) (struct net_device *netdev, PARAM_CUSTOM_P2P_SET_STRUCT_T p2pmode);
|
|
||||||
|
|
||||||
extern void wlanRegisterNotifier(void);
|
|
||||||
extern void wlanUnregisterNotifier(void);
|
|
||||||
extern void register_set_p2p_mode_handler(set_p2p_mode handler);
|
|
||||||
|
|
||||||
extern BOOLEAN fgIsResetting;
|
|
||||||
|
|
||||||
extern UINT_8 g_aucBufIpAddr[32];
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _PRECOMP_H */
|
|
|
@ -1,100 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _PWR_MGT_H
|
|
||||||
#define _PWR_MGT_H
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define PM_UAPSD_AC0 (BIT(0))
|
|
||||||
#define PM_UAPSD_AC1 (BIT(1))
|
|
||||||
#define PM_UAPSD_AC2 (BIT(2))
|
|
||||||
#define PM_UAPSD_AC3 (BIT(3))
|
|
||||||
|
|
||||||
#define PM_UAPSD_ALL (PM_UAPSD_AC0 | PM_UAPSD_AC1 | PM_UAPSD_AC2 | PM_UAPSD_AC3)
|
|
||||||
#define PM_UAPSD_NONE 0
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef struct _PM_PROFILE_SETUP_INFO_T {
|
|
||||||
/* Profile setup */
|
|
||||||
UINT_8 ucBmpDeliveryAC; /* 0: AC_BE, 1: AC_BK, 2: AC_VI, 3: AC_VO */
|
|
||||||
UINT_8 ucBmpTriggerAC; /* 0: AC_BE, 1: AC_BK, 2: AC_VI, 3: AC_VO */
|
|
||||||
|
|
||||||
UINT_8 ucUapsdSp; /* Number of triggered packets in UAPSD */
|
|
||||||
|
|
||||||
} PM_PROFILE_SETUP_INFO_T, *P_PM_PROFILE_SETUP_INFO_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !CFG_ENABLE_FULL_PM
|
|
||||||
#define ACQUIRE_POWER_CONTROL_FROM_PM(_prAdapter)
|
|
||||||
#define RECLAIM_POWER_CONTROL_TO_PM(_prAdapter, _fgEnableGINT_in_IST)
|
|
||||||
#else
|
|
||||||
#define ACQUIRE_POWER_CONTROL_FROM_PM(_prAdapter) \
|
|
||||||
{ \
|
|
||||||
if (_prAdapter->fgIsFwOwn) { \
|
|
||||||
nicpmSetDriverOwn(_prAdapter); \
|
|
||||||
} \
|
|
||||||
/* Increase Block to Enter Low Power Semaphore count */ \
|
|
||||||
GLUE_INC_REF_CNT(_prAdapter->u4PwrCtrlBlockCnt); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define RECLAIM_POWER_CONTROL_TO_PM(_prAdapter, _fgEnableGINT_in_IST) \
|
|
||||||
{ \
|
|
||||||
ASSERT(_prAdapter->u4PwrCtrlBlockCnt != 0); \
|
|
||||||
/* Decrease Block to Enter Low Power Semaphore count */ \
|
|
||||||
GLUE_DEC_REF_CNT(_prAdapter->u4PwrCtrlBlockCnt); \
|
|
||||||
if (_prAdapter->fgWiFiInSleepyState && (_prAdapter->u4PwrCtrlBlockCnt == 0)) { \
|
|
||||||
nicpmSetFWOwn(_prAdapter, _fgEnableGINT_in_IST); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _PWR_MGT_H */
|
|
|
@ -1,170 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _QUEUE_H
|
|
||||||
#define _QUEUE_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#include "gl_typedef.h"
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Singly Queue Structures - Entry Part */
|
|
||||||
typedef struct _QUE_ENTRY_T {
|
|
||||||
struct _QUE_ENTRY_T *prNext;
|
|
||||||
struct _QUE_ENTRY_T *prPrev; /* For Rx buffer reordering used only */
|
|
||||||
} QUE_ENTRY_T, *P_QUE_ENTRY_T;
|
|
||||||
|
|
||||||
/* Singly Queue Structures - Queue Part */
|
|
||||||
typedef struct _QUE_T {
|
|
||||||
P_QUE_ENTRY_T prHead;
|
|
||||||
P_QUE_ENTRY_T prTail;
|
|
||||||
UINT_32 u4NumElem;
|
|
||||||
} QUE_T, *P_QUE_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* To resolve compiler warning of address check -Waddress
|
|
||||||
* Redefine a ASSERT dedicate for queue operation
|
|
||||||
*/
|
|
||||||
#if DBG
|
|
||||||
#define QUE_ASSERT ASSERT
|
|
||||||
#else
|
|
||||||
#define QUE_ASSERT(_exp)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define QUEUE_INITIALIZE(prQueue) \
|
|
||||||
{ \
|
|
||||||
(prQueue)->prHead = (P_QUE_ENTRY_T)NULL; \
|
|
||||||
(prQueue)->prTail = (P_QUE_ENTRY_T)NULL; \
|
|
||||||
(prQueue)->u4NumElem = 0; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define QUEUE_IS_EMPTY(prQueue) (((P_QUE_T)(prQueue))->prHead == (P_QUE_ENTRY_T)NULL)
|
|
||||||
|
|
||||||
#define QUEUE_IS_NOT_EMPTY(prQueue) ((prQueue)->u4NumElem > 0)
|
|
||||||
|
|
||||||
#define QUEUE_GET_HEAD(prQueue) ((prQueue)->prHead)
|
|
||||||
|
|
||||||
#define QUEUE_GET_TAIL(prQueue) ((prQueue)->prTail)
|
|
||||||
|
|
||||||
#define QUEUE_GET_NEXT_ENTRY(prQueueEntry) ((prQueueEntry)->prNext)
|
|
||||||
|
|
||||||
#define QUEUE_INSERT_HEAD(prQueue, prQueueEntry) \
|
|
||||||
{ \
|
|
||||||
QUE_ASSERT(prQueue); \
|
|
||||||
QUE_ASSERT(prQueueEntry); \
|
|
||||||
(prQueueEntry)->prNext = (prQueue)->prHead; \
|
|
||||||
(prQueue)->prHead = (prQueueEntry); \
|
|
||||||
if ((prQueue)->prTail == (P_QUE_ENTRY_T)NULL) { \
|
|
||||||
(prQueue)->prTail = (prQueueEntry); \
|
|
||||||
} \
|
|
||||||
((prQueue)->u4NumElem)++; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define QUEUE_INSERT_TAIL(prQueue, prQueueEntry) \
|
|
||||||
{ \
|
|
||||||
QUE_ASSERT(prQueue); \
|
|
||||||
QUE_ASSERT(prQueueEntry); \
|
|
||||||
(prQueueEntry)->prNext = (P_QUE_ENTRY_T)NULL; \
|
|
||||||
if ((prQueue)->prTail) { \
|
|
||||||
((prQueue)->prTail)->prNext = (prQueueEntry); \
|
|
||||||
} else { \
|
|
||||||
(prQueue)->prHead = (prQueueEntry); \
|
|
||||||
} \
|
|
||||||
(prQueue)->prTail = (prQueueEntry); \
|
|
||||||
((prQueue)->u4NumElem)++; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* NOTE: We assume the queue entry located at the beginning of "prQueueEntry Type",
|
|
||||||
* so that we can cast the queue entry to other data type without doubts.
|
|
||||||
* And this macro also decrease the total entry count at the same time.
|
|
||||||
*/
|
|
||||||
#define QUEUE_REMOVE_HEAD(prQueue, prQueueEntry, _P_TYPE) \
|
|
||||||
{ \
|
|
||||||
QUE_ASSERT(prQueue); \
|
|
||||||
prQueueEntry = (_P_TYPE)((prQueue)->prHead); \
|
|
||||||
if (prQueueEntry) { \
|
|
||||||
(prQueue)->prHead = ((P_QUE_ENTRY_T)(prQueueEntry))->prNext; \
|
|
||||||
if ((prQueue)->prHead == (P_QUE_ENTRY_T)NULL) { \
|
|
||||||
(prQueue)->prTail = (P_QUE_ENTRY_T)NULL; \
|
|
||||||
} \
|
|
||||||
((P_QUE_ENTRY_T)(prQueueEntry))->prNext = (P_QUE_ENTRY_T)NULL; \
|
|
||||||
((prQueue)->u4NumElem)--; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define QUEUE_MOVE_ALL(prDestQueue, prSrcQueue) \
|
|
||||||
{ \
|
|
||||||
QUE_ASSERT(prDestQueue); \
|
|
||||||
QUE_ASSERT(prSrcQueue); \
|
|
||||||
*(P_QUE_T)prDestQueue = *(P_QUE_T)prSrcQueue; \
|
|
||||||
QUEUE_INITIALIZE(prSrcQueue); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define QUEUE_CONCATENATE_QUEUES(prDestQueue, prSrcQueue) \
|
|
||||||
{ \
|
|
||||||
QUE_ASSERT(prDestQueue); \
|
|
||||||
QUE_ASSERT(prSrcQueue); \
|
|
||||||
if (prSrcQueue->u4NumElem > 0) { \
|
|
||||||
if ((prDestQueue)->prTail) { \
|
|
||||||
((prDestQueue)->prTail)->prNext = (prSrcQueue)->prHead; \
|
|
||||||
} else { \
|
|
||||||
(prDestQueue)->prHead = (prSrcQueue)->prHead; \
|
|
||||||
} \
|
|
||||||
(prDestQueue)->prTail = (prSrcQueue)->prTail; \
|
|
||||||
((prDestQueue)->u4NumElem) += ((prSrcQueue)->u4NumElem); \
|
|
||||||
QUEUE_INITIALIZE(prSrcQueue); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* _QUEUE_H */
|
|
|
@ -1,260 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _RFTEST_H
|
|
||||||
#define _RFTEST_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Table Version */
|
|
||||||
#define RF_AUTO_TEST_FUNCTION_TABLE_VERSION 0x01000001
|
|
||||||
|
|
||||||
/* Power */
|
|
||||||
#define RF_AT_PARAM_POWER_MASK BITS(0, 7)
|
|
||||||
#define RF_AT_PARAM_POWER_MAX RF_AT_PARAM_POWER_MASK
|
|
||||||
|
|
||||||
/* Rate */
|
|
||||||
#define RF_AT_PARAM_RATE_MCS_MASK BIT(31)
|
|
||||||
#define RF_AT_PARAM_RATE_MASK BITS(0, 7)
|
|
||||||
#define RF_AT_PARAM_RATE_CCK_MAX 3
|
|
||||||
#define RF_AT_PARAM_RATE_1M 0
|
|
||||||
#define RF_AT_PARAM_RATE_2M 1
|
|
||||||
#define RF_AT_PARAM_RATE_5_5M 2
|
|
||||||
#define RF_AT_PARAM_RATE_11M 3
|
|
||||||
#define RF_AT_PARAM_RATE_6M 4
|
|
||||||
#define RF_AT_PARAM_RATE_9M 5
|
|
||||||
#define RF_AT_PARAM_RATE_12M 6
|
|
||||||
#define RF_AT_PARAM_RATE_18M 7
|
|
||||||
#define RF_AT_PARAM_RATE_24M 8
|
|
||||||
#define RF_AT_PARAM_RATE_36M 9
|
|
||||||
#define RF_AT_PARAM_RATE_48M 10
|
|
||||||
#define RF_AT_PARAM_RATE_54M 11
|
|
||||||
|
|
||||||
/* Antenna */
|
|
||||||
#define RF_AT_PARAM_ANTENNA_ID_MASK BITS(0, 7)
|
|
||||||
#define RF_AT_PARAM_ANTENNA_ID_MAX 1
|
|
||||||
|
|
||||||
/* Packet Length */
|
|
||||||
#define RF_AT_PARAM_TX_80211HDR_BYTE_MAX (32)
|
|
||||||
#define RF_AT_PARAM_TX_80211PAYLOAD_BYTE_MAX (2048)
|
|
||||||
|
|
||||||
#define RF_AT_PARAM_TX_PKTLEN_BYTE_DEFAULT 1024
|
|
||||||
#define RF_AT_PARAM_TX_PKTLEN_BYTE_MAX \
|
|
||||||
((UINT_16)(RF_AT_PARAM_TX_80211HDR_BYTE_MAX + RF_AT_PARAM_TX_80211PAYLOAD_BYTE_MAX))
|
|
||||||
|
|
||||||
/* Packet Count */
|
|
||||||
#define RF_AT_PARAM_TX_PKTCNT_DEFAULT 1000
|
|
||||||
#define RF_AT_PARAM_TX_PKTCNT_UNLIMITED 0
|
|
||||||
|
|
||||||
/* Packet Interval */
|
|
||||||
#define RF_AT_PARAM_TX_PKT_INTERVAL_US_DEFAULT 50
|
|
||||||
|
|
||||||
/* ALC */
|
|
||||||
#define RF_AT_PARAM_ALC_DISABLE 0
|
|
||||||
#define RF_AT_PARAM_ALC_ENABLE 1
|
|
||||||
|
|
||||||
/* TXOP */
|
|
||||||
#define RF_AT_PARAM_TXOP_DEFAULT 0
|
|
||||||
#define RF_AT_PARAM_TXOPQUE_QMASK BITS(16, 31)
|
|
||||||
#define RF_AT_PARAM_TXOPQUE_TMASK BITS(0, 15)
|
|
||||||
#define RF_AT_PARAM_TXOPQUE_AC0 (0<<16)
|
|
||||||
#define RF_AT_PARAM_TXOPQUE_AC1 (1<<16)
|
|
||||||
#define RF_AT_PARAM_TXOPQUE_AC2 (2<<16)
|
|
||||||
#define RF_AT_PARAM_TXOPQUE_AC3 (3<<16)
|
|
||||||
#define RF_AT_PARAM_TXOPQUE_AC4 (4<<16)
|
|
||||||
#define RF_AT_PARAM_TXOPQUE_QOFFSET 16
|
|
||||||
|
|
||||||
/* Retry Limit */
|
|
||||||
#define RF_AT_PARAM_TX_RETRY_DEFAULT 0
|
|
||||||
#define RF_AT_PARAM_TX_RETRY_MAX 6
|
|
||||||
|
|
||||||
/* QoS Queue */
|
|
||||||
#define RF_AT_PARAM_QOSQUE_AC0 0
|
|
||||||
#define RF_AT_PARAM_QOSQUE_AC1 1
|
|
||||||
#define RF_AT_PARAM_QOSQUE_AC2 2
|
|
||||||
#define RF_AT_PARAM_QOSQUE_AC3 3
|
|
||||||
#define RF_AT_PARAM_QOSQUE_AC4 4
|
|
||||||
#define RF_AT_PARAM_QOSQUE_DEFAULT RF_AT_PARAM_QOSQUE_AC0
|
|
||||||
|
|
||||||
/* Bandwidth */
|
|
||||||
#define RF_AT_PARAM_BANDWIDTH_20MHZ 0
|
|
||||||
#define RF_AT_PARAM_BANDWIDTH_40MHZ 1
|
|
||||||
#define RF_AT_PARAM_BANDWIDTH_U20_IN_40MHZ 2
|
|
||||||
#define RF_AT_PARAM_BANDWIDTH_D20_IN_40MHZ 3
|
|
||||||
#define RF_AT_PARAM_BANDWIDTH_DEFAULT RF_AT_PARAM_BANDWIDTH_20MHZ
|
|
||||||
|
|
||||||
/* GI (Guard Interval) */
|
|
||||||
#define RF_AT_PARAM_GI_800NS 0
|
|
||||||
#define RF_AT_PARAM_GI_400NS 1
|
|
||||||
#define RF_AT_PARAM_GI_DEFAULT RF_AT_PARAM_GI_800NS
|
|
||||||
|
|
||||||
/* STBC */
|
|
||||||
#define RF_AT_PARAM_STBC_DISABLE 0
|
|
||||||
#define RF_AT_PARAM_STBC_ENABLE 1
|
|
||||||
|
|
||||||
/* RIFS */
|
|
||||||
#define RF_AT_PARAM_RIFS_DISABLE 0
|
|
||||||
#define RF_AT_PARAM_RIFS_ENABLE 1
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Function ID List */
|
|
||||||
typedef enum _ENUM_RF_AT_FUNCID_T {
|
|
||||||
RF_AT_FUNCID_VERSION = 0,
|
|
||||||
RF_AT_FUNCID_COMMAND,
|
|
||||||
RF_AT_FUNCID_POWER,
|
|
||||||
RF_AT_FUNCID_RATE,
|
|
||||||
RF_AT_FUNCID_PREAMBLE,
|
|
||||||
RF_AT_FUNCID_ANTENNA,
|
|
||||||
RF_AT_FUNCID_PKTLEN,
|
|
||||||
RF_AT_FUNCID_PKTCNT,
|
|
||||||
RF_AT_FUNCID_PKTINTERVAL,
|
|
||||||
RF_AT_FUNCID_TEMP_COMPEN,
|
|
||||||
RF_AT_FUNCID_TXOPLIMIT,
|
|
||||||
RF_AT_FUNCID_ACKPOLICY,
|
|
||||||
RF_AT_FUNCID_PKTCONTENT,
|
|
||||||
RF_AT_FUNCID_RETRYLIMIT,
|
|
||||||
RF_AT_FUNCID_QUEUE,
|
|
||||||
RF_AT_FUNCID_BANDWIDTH,
|
|
||||||
RF_AT_FUNCID_GI,
|
|
||||||
RF_AT_FUNCID_STBC,
|
|
||||||
RF_AT_FUNCID_CHNL_FREQ,
|
|
||||||
RF_AT_FUNCID_RIFS,
|
|
||||||
RF_AT_FUNCID_TRSW_TYPE,
|
|
||||||
RF_AT_FUNCID_RF_SX_SHUTDOWN,
|
|
||||||
RF_AT_FUNCID_PLL_SHUTDOWN,
|
|
||||||
RF_AT_FUNCID_SLOW_CLK_MODE,
|
|
||||||
RF_AT_FUNCID_ADC_CLK_MODE,
|
|
||||||
RF_AT_FUNCID_MEASURE_MODE,
|
|
||||||
RF_AT_FUNCID_VOLT_COMPEN,
|
|
||||||
RF_AT_FUNCID_DPD_TX_GAIN,
|
|
||||||
RF_AT_FUNCID_DPD_MODE,
|
|
||||||
RF_AT_FUNCID_TSSI_MODE,
|
|
||||||
RF_AT_FUNCID_TX_GAIN_CODE,
|
|
||||||
RF_AT_FUNCID_TX_PWR_MODE,
|
|
||||||
|
|
||||||
/* Query command */
|
|
||||||
RF_AT_FUNCID_TXED_COUNT = 32,
|
|
||||||
RF_AT_FUNCID_TXOK_COUNT,
|
|
||||||
RF_AT_FUNCID_RXOK_COUNT,
|
|
||||||
RF_AT_FUNCID_RXERROR_COUNT,
|
|
||||||
RF_AT_FUNCID_RESULT_INFO,
|
|
||||||
RF_AT_FUNCID_TRX_IQ_RESULT,
|
|
||||||
RF_AT_FUNCID_TSSI_RESULT,
|
|
||||||
RF_AT_FUNCID_DPD_RESULT,
|
|
||||||
RF_AT_FUNCID_RXV_DUMP,
|
|
||||||
RF_AT_FUNCID_RX_PHY_STATIS,
|
|
||||||
RF_AT_FUNCID_MEASURE_RESULT,
|
|
||||||
RF_AT_FUNCID_TEMP_SENSOR,
|
|
||||||
RF_AT_FUNCID_VOLT_SENSOR,
|
|
||||||
RF_AT_FUNCID_READ_EFUSE,
|
|
||||||
RF_AT_FUNCID_RX_RSSI,
|
|
||||||
RF_AT_FUNCID_FW_INFO,
|
|
||||||
RF_AT_FUNCID_DRV_INFO,
|
|
||||||
|
|
||||||
/* Set command */
|
|
||||||
RF_AT_FUNCID_SET_DPD_RESULT = 64,
|
|
||||||
RF_AT_FUNCID_SET_CW_MODE,
|
|
||||||
RF_AT_FUNCID_SET_JAPAN_CH14_FILTER,
|
|
||||||
RF_AT_FUNCID_WRITE_EFUSE,
|
|
||||||
RF_AT_FUNCID_SET_MAC_ADDRESS
|
|
||||||
} ENUM_RF_AT_FUNCID_T;
|
|
||||||
|
|
||||||
/* Command */
|
|
||||||
typedef enum _ENUM_RF_AT_COMMAND_T {
|
|
||||||
RF_AT_COMMAND_STOPTEST = 0,
|
|
||||||
RF_AT_COMMAND_STARTTX,
|
|
||||||
RF_AT_COMMAND_STARTRX,
|
|
||||||
RF_AT_COMMAND_RESET,
|
|
||||||
RF_AT_COMMAND_OUTPUT_POWER, /* Payload */
|
|
||||||
RF_AT_COMMAND_LO_LEAKAGE, /* Local freq is renamed to Local leakage */
|
|
||||||
RF_AT_COMMAND_CARRIER_SUPPR, /* OFDM (LTF/STF), CCK (PI,PI/2) */
|
|
||||||
RF_AT_COMMAND_TRX_IQ_CAL,
|
|
||||||
RF_AT_COMMAND_TSSI_CAL,
|
|
||||||
RF_AT_COMMAND_DPD_CAL,
|
|
||||||
RF_AT_COMMAND_CW,
|
|
||||||
RF_AT_COMMAND_NUM
|
|
||||||
} ENUM_RF_AT_COMMAND_T;
|
|
||||||
|
|
||||||
/* Preamble */
|
|
||||||
typedef enum _ENUM_RF_AT_PREAMBLE_T {
|
|
||||||
RF_AT_PREAMBLE_NORMAL = 0,
|
|
||||||
RF_AT_PREAMBLE_CCK_SHORT,
|
|
||||||
RF_AT_PREAMBLE_11N_MM,
|
|
||||||
RF_AT_PREAMBLE_11N_GF,
|
|
||||||
RF_AT_PREAMBLE_NUM
|
|
||||||
} ENUM_RF_AT_PREAMBLE_T;
|
|
||||||
|
|
||||||
/* Ack Policy */
|
|
||||||
typedef enum _ENUM_RF_AT_ACK_POLICY_T {
|
|
||||||
RF_AT_ACK_POLICY_NORMAL = 0,
|
|
||||||
RF_AT_ACK_POLICY_NOACK,
|
|
||||||
RF_AT_ACK_POLICY_NOEXPLICTACK,
|
|
||||||
RF_AT_ACK_POLICY_BLOCKACK,
|
|
||||||
RF_AT_ACK_POLICY_NUM
|
|
||||||
} ENUM_RF_AT_ACK_POLICY_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_RF_AUTOTEST_STATE_T {
|
|
||||||
RF_AUTOTEST_STATE_STANDBY = 0,
|
|
||||||
RF_AUTOTEST_STATE_TX,
|
|
||||||
RF_AUTOTEST_STATE_RX,
|
|
||||||
RF_AUTOTEST_STATE_RESET,
|
|
||||||
RF_AUTOTEST_STATE_OUTPUT_POWER,
|
|
||||||
RF_AUTOTEST_STATE_LOCA_FREQUENCY,
|
|
||||||
RF_AUTOTEST_STATE_CARRIER_SUPRRESION,
|
|
||||||
RF_AUTOTEST_STATE_NUM
|
|
||||||
} ENUM_RF_AUTOTEST_STATE_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
WLAN_STATUS rftestSetATInfo(IN P_ADAPTER_T prAdapter, UINT_32 u4FuncIndex, UINT_32 u4FuncData);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
rftestQueryATInfo(IN P_ADAPTER_T prAdapter,
|
|
||||||
UINT_32 u4FuncIndex, UINT_32 u4FuncData, OUT PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen);
|
|
||||||
|
|
||||||
WLAN_STATUS rftestSetFrequency(IN P_ADAPTER_T prAdapter, IN UINT_32 u4FreqInKHz, IN PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
#endif /* _RFTEST_H */
|
|
|
@ -1,424 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _TDLS_EXTR_H
|
|
||||||
#define _TDLS_EXTR_H
|
|
||||||
|
|
||||||
#if (CFG_SUPPORT_TDLS == 1)
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define TDLS_TX_QUOTA_EMPTY_TIMEOUT 10
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* protocol */
|
|
||||||
#define TDLS_FRM_PROT_TYPE 0x890d
|
|
||||||
|
|
||||||
/* TDLS uses Ethertype 89-0d frames. The UP shall be AC_VI, unless otherwise specified. */
|
|
||||||
#define USER_PRIORITY_TDLS 5
|
|
||||||
|
|
||||||
/* Status code */
|
|
||||||
#define TDLS_STATUS WLAN_STATUS
|
|
||||||
|
|
||||||
#define TDLS_STATUS_SUCCESS WLAN_STATUS_SUCCESS
|
|
||||||
#define TDLS_STATUS_FAILURE WLAN_STATUS_FAILURE
|
|
||||||
#define TDLS_STATUS_INVALID_LENGTH WLAN_STATUS_INVALID_LENGTH
|
|
||||||
#define TDLS_STATUS_RESOURCES WLAN_STATUS_RESOURCES
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define TDLS_U32 UINT32
|
|
||||||
#define TDLS_U16 UINT16
|
|
||||||
#define TDLS_U8 UINT8
|
|
||||||
|
|
||||||
typedef enum _TDLS_REASON_CODE {
|
|
||||||
TDLS_REASON_CODE_UNREACHABLE = 25,
|
|
||||||
TDLS_REASON_CODE_UNSPECIFIED = 26,
|
|
||||||
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_UNKNOWN = 0x80, /* 128 */
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_WIFI_OFF = 0x81, /* 129 */
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_ROAMING = 0x82, /* 130 */
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_PTI_TIMEOUT = 0x83, /* 131 */
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_AGE_TIMEOUT = 0x84, /* 132 */
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_REKEY = 0x85, /* 133 */
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_PTI_SEND_FAIL = 0x86, /* 134 */
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_PTI_SEND_MAX_FAIL = 0x87, /* 135 */
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_WRONG_NETWORK_IDX = 0x88, /* 136 */
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_NON_STATE3 = 0x89, /* 137 */
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_TX_QUOTA_EMPTY = 0x8a, /* 138 */
|
|
||||||
TDLS_REASON_CODE_MTK_DIS_BY_US_DUE_TO_LOST_TEAR_DOWN = 0x8b /* 139 */
|
|
||||||
} TDLS_REASON_CODE;
|
|
||||||
|
|
||||||
/* TDLS FSM */
|
|
||||||
typedef struct _TDLS_CMD_PEER_ADD_T {
|
|
||||||
|
|
||||||
TDLS_U8 aucPeerMac[6];
|
|
||||||
ENUM_NETWORK_TYPE_INDEX_T eNetworkType;
|
|
||||||
#if 0
|
|
||||||
ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex;
|
|
||||||
UINT_16 u2CapInfo;
|
|
||||||
|
|
||||||
UINT_16 u2OperationalRateSet;
|
|
||||||
UINT_16 u2BSSBasicRateSet;
|
|
||||||
BOOLEAN fgIsUnknownBssBasicRate;
|
|
||||||
|
|
||||||
UINT_8 ucPhyTypeSet;
|
|
||||||
#endif
|
|
||||||
} TDLS_CMD_PEER_ADD_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_LINK_T {
|
|
||||||
ENUM_NETWORK_TYPE_INDEX_T eNetworkType;
|
|
||||||
TDLS_U8 aucPeerMac[6];
|
|
||||||
BOOLEAN fgIsEnabled;
|
|
||||||
} TDLS_CMD_LINK_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_PEER_UPDATE_HT_CAP_MCS_INFO_T {
|
|
||||||
TDLS_U8 arRxMask[10];
|
|
||||||
TDLS_U16 u2RxHighest;
|
|
||||||
TDLS_U8 ucTxParams;
|
|
||||||
TDLS_U8 Reserved[3];
|
|
||||||
} TDLS_CMD_PEER_UPDATE_HT_CAP_MCS_INFO_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_PEER_UPDATE_HT_CAP_T {
|
|
||||||
TDLS_U16 u2CapInfo;
|
|
||||||
TDLS_U8 ucAmpduParamsInfo;
|
|
||||||
|
|
||||||
/* 16 bytes MCS information */
|
|
||||||
TDLS_CMD_PEER_UPDATE_HT_CAP_MCS_INFO_T rMCS;
|
|
||||||
|
|
||||||
TDLS_U16 u2ExtHtCapInfo;
|
|
||||||
TDLS_U32 u4TxBfCapInfo;
|
|
||||||
TDLS_U8 ucAntennaSelInfo;
|
|
||||||
} TDLS_CMD_PEER_UPDATE_HT_CAP_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_PEER_UPDATE_T {
|
|
||||||
|
|
||||||
ENUM_NETWORK_TYPE_INDEX_T eNetworkType;
|
|
||||||
TDLS_U8 aucPeerMac[6];
|
|
||||||
|
|
||||||
#define TDLS_CMD_PEER_UPDATE_SUP_CHAN_MAX 50
|
|
||||||
TDLS_U8 aucSupChan[TDLS_CMD_PEER_UPDATE_SUP_CHAN_MAX];
|
|
||||||
|
|
||||||
TDLS_U16 u2StatusCode;
|
|
||||||
|
|
||||||
#define TDLS_CMD_PEER_UPDATE_SUP_RATE_MAX 50
|
|
||||||
TDLS_U8 aucSupRate[TDLS_CMD_PEER_UPDATE_SUP_RATE_MAX];
|
|
||||||
TDLS_U16 u2SupRateLen;
|
|
||||||
|
|
||||||
TDLS_U8 UapsdBitmap;
|
|
||||||
TDLS_U8 UapsdMaxSp; /* MAX_SP */
|
|
||||||
|
|
||||||
TDLS_U16 u2Capability;
|
|
||||||
#define TDLS_CMD_PEER_UPDATE_EXT_CAP_MAXLEN 5
|
|
||||||
TDLS_U8 aucExtCap[TDLS_CMD_PEER_UPDATE_EXT_CAP_MAXLEN];
|
|
||||||
TDLS_U16 u2ExtCapLen;
|
|
||||||
|
|
||||||
TDLS_CMD_PEER_UPDATE_HT_CAP_T rHtCap;
|
|
||||||
BOOLEAN fgIsSupHt;
|
|
||||||
|
|
||||||
} TDLS_CMD_PEER_UPDATE_T;
|
|
||||||
|
|
||||||
/* Command to TDLS core module */
|
|
||||||
typedef enum _TDLS_CMD_CORE_ID {
|
|
||||||
TDLS_CORE_CMD_TEST_NULL_RCV = 0x00,
|
|
||||||
TDLS_CORE_CMD_TEST_PTI_RSP = 0x01,
|
|
||||||
TDLS_CORE_CMD_MIB_UPDATE = 0x02,
|
|
||||||
TDLS_CORE_CMD_TEST_TX_FAIL_SKIP = 0x03,
|
|
||||||
TDLS_CORE_CMD_UAPSD_CONF = 0x04,
|
|
||||||
TDLS_CORE_CMD_TEST_DATA_RCV = 0x05,
|
|
||||||
TDLS_CORE_CMD_TEST_PTI_REQ = 0x06,
|
|
||||||
TDLS_CORE_CMD_TEST_CHSW_REQ = 0x07,
|
|
||||||
TDLS_CORE_CMD_CHSW_CONF = 0x08,
|
|
||||||
TDLS_CORE_CMD_TEST_KEEP_ALIVE_SKIP = 0x09,
|
|
||||||
TDLS_CORE_CMD_TEST_CHSW_TIMEOUT_SKIP = 0x0a,
|
|
||||||
TDLS_CORE_CMD_TEST_CHSW_RSP = 0x0b,
|
|
||||||
TDLS_CORE_CMD_TEST_SCAN_SKIP = 0x0c,
|
|
||||||
TDLS_CORE_CMD_SETUP_CONF = 0x0d,
|
|
||||||
TDLS_CORE_CMD_TEST_TEAR_DOWN = 0x0e,
|
|
||||||
TDLS_CORE_CMD_KEY_INFO = 0x0f,
|
|
||||||
TDLS_CORE_CMD_TEST_PTI_TX_FAIL = 0x10
|
|
||||||
} TDLS_CMD_CORE_ID;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_NULL_RCV_T {
|
|
||||||
|
|
||||||
TDLS_U32 u4PM;
|
|
||||||
} TDLS_CMD_CORE_TEST_NULL_RCV_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_PTI_REQ_RCV_T {
|
|
||||||
|
|
||||||
TDLS_U32 u4DialogToken;
|
|
||||||
} TDLS_CMD_CORE_TEST_PTI_REQ_RCV_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_PTI_RSP_RCV_T {
|
|
||||||
|
|
||||||
TDLS_U32 u4DialogToken;
|
|
||||||
TDLS_U32 u4PM;
|
|
||||||
} TDLS_CMD_CORE_TEST_PTI_RSP_RCV_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_TEAR_DOWN_RCV_T {
|
|
||||||
|
|
||||||
TDLS_U32 u4ReasonCode;
|
|
||||||
} TDLS_CMD_CORE_TEST_TEAR_DOWN_RCV_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_CHST_REQ_RCV_T {
|
|
||||||
|
|
||||||
TDLS_U32 u4Chan;
|
|
||||||
TDLS_U32 u4RegClass;
|
|
||||||
TDLS_U32 u4SecChanOff;
|
|
||||||
TDLS_U32 u4SwitchTime;
|
|
||||||
TDLS_U32 u4SwitchTimeout;
|
|
||||||
} TDLS_CMD_CORE_TEST_CHST_REQ_RCV_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_CHST_RSP_RCV_T {
|
|
||||||
|
|
||||||
TDLS_U32 u4Chan;
|
|
||||||
TDLS_U32 u4SwitchTime;
|
|
||||||
TDLS_U32 u4SwitchTimeout;
|
|
||||||
TDLS_U32 u4StatusCode;
|
|
||||||
} TDLS_CMD_CORE_TEST_CHST_RSP_RCV_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_DATA_RCV_T {
|
|
||||||
|
|
||||||
TDLS_U32 u4PM;
|
|
||||||
TDLS_U32 u4UP;
|
|
||||||
TDLS_U32 u4EOSP;
|
|
||||||
TDLS_U32 u4IsNull;
|
|
||||||
} TDLS_CMD_CORE_TEST_DATA_RCV_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_MIB_PARAM_UPDATE_T {
|
|
||||||
|
|
||||||
BOOLEAN Tdlsdot11TunneledDirectLinkSetupImplemented;
|
|
||||||
BOOLEAN Tdlsdot11TDLSPeerUAPSDBufferSTAActivated;
|
|
||||||
BOOLEAN Tdlsdot11TDLSPeerPSMActivated;
|
|
||||||
TDLS_U16 Tdlsdot11TDLSPeerUAPSDIndicationWindow;
|
|
||||||
BOOLEAN Tdlsdot11TDLSChannelSwitchingActivated;
|
|
||||||
TDLS_U8 Tdlsdot11TDLSPeerSTAMissingAckRetryLimit;
|
|
||||||
TDLS_U8 Tdlsdot11TDLSResponseTimeout;
|
|
||||||
TDLS_U16 Tdlsdot11TDLSProbeDelay;
|
|
||||||
TDLS_U8 Tdlsdot11TDLSDiscoveryRequestWindow;
|
|
||||||
TDLS_U8 Tdlsdot11TDLSACDeterminationInterval;
|
|
||||||
} TDLS_CMD_CORE_MIB_PARAM_UPDATE_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_TX_FAIL_SKIP_T {
|
|
||||||
|
|
||||||
BOOLEAN fgIsEnable;
|
|
||||||
} TDLS_CMD_CORE_TEST_TX_FAIL_SKIP_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_UAPSD_CONFIG_T {
|
|
||||||
|
|
||||||
BOOLEAN fgIsSpTimeoutSkip;
|
|
||||||
BOOLEAN fgIsPtiTimeoutSkip;
|
|
||||||
} TDLS_CMD_CORE_UAPSD_CONFIG_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_SETUP_CONFIG_T {
|
|
||||||
|
|
||||||
BOOLEAN fgIs2040Supported;
|
|
||||||
} TDLS_CMD_CORE_SETUP_CONFIG_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_CHSW_CONFIG_T {
|
|
||||||
|
|
||||||
TDLS_U8 ucNetTypeIndex;
|
|
||||||
BOOLEAN fgIsChSwEnabled;
|
|
||||||
BOOLEAN fgIsChSwStarted;
|
|
||||||
TDLS_U8 ucRegClass;
|
|
||||||
TDLS_U8 ucTargetChan;
|
|
||||||
TDLS_U8 ucSecChanOff;
|
|
||||||
BOOLEAN fgIsChSwRegular;
|
|
||||||
} TDLS_CMD_CORE_CHSW_CONFIG_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_KEEP_ALIVE_SKIP_T {
|
|
||||||
|
|
||||||
BOOLEAN fgIsEnable;
|
|
||||||
} TDLS_CMD_CORE_TEST_KEEP_ALIVE_SKIP_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_CHSW_TIMEOUT_SKIP_T {
|
|
||||||
|
|
||||||
BOOLEAN fgIsEnable;
|
|
||||||
} TDLS_CMD_CORE_TEST_CHSW_TIMEOUT_SKIP_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_PROHIBIT_T {
|
|
||||||
|
|
||||||
BOOLEAN fgIsEnable;
|
|
||||||
BOOLEAN fgIsSet;
|
|
||||||
} TDLS_CMD_CORE_TEST_PROHIBIT_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_SCAN_SKIP_T {
|
|
||||||
|
|
||||||
BOOLEAN fgIsEnable;
|
|
||||||
} TDLS_CMD_CORE_TEST_SCAN_SKIP_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_INFO_DISPLAY_T {
|
|
||||||
|
|
||||||
BOOLEAN fgIsToClearAllHistory;
|
|
||||||
} TDLS_CMD_CORE_INFO_DISPLAY_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_TEST_PTI_TX_FAIL_T {
|
|
||||||
|
|
||||||
BOOLEAN fgIsEnable;
|
|
||||||
} TDLS_CMD_CORE_TEST_PTI_TX_FAIL_T;
|
|
||||||
|
|
||||||
typedef struct _TDLS_CMD_CORE_T {
|
|
||||||
|
|
||||||
TDLS_U32 u4Command; /* TDLS_CMD_CORE_ID */
|
|
||||||
|
|
||||||
TDLS_U8 aucPeerMac[6];
|
|
||||||
TDLS_U8 ucNetTypeIndex;
|
|
||||||
|
|
||||||
#define TDLS_CMD_CORE_RESERVED_SIZE 50
|
|
||||||
union {
|
|
||||||
TDLS_CMD_CORE_TEST_NULL_RCV_T rCmdNullRcv;
|
|
||||||
TDLS_CMD_CORE_TEST_PTI_REQ_RCV_T rCmdPtiReqRcv;
|
|
||||||
TDLS_CMD_CORE_TEST_PTI_RSP_RCV_T rCmdPtiRspRcv;
|
|
||||||
TDLS_CMD_CORE_TEST_TEAR_DOWN_RCV_T rCmdTearDownRcv;
|
|
||||||
TDLS_CMD_CORE_TEST_CHST_REQ_RCV_T rCmdChStReqRcv;
|
|
||||||
TDLS_CMD_CORE_TEST_CHST_RSP_RCV_T rCmdChStRspRcv;
|
|
||||||
TDLS_CMD_CORE_TEST_DATA_RCV_T rCmdDatRcv;
|
|
||||||
TDLS_CMD_CORE_TEST_TX_FAIL_SKIP_T rCmdTxFailSkip;
|
|
||||||
TDLS_CMD_CORE_TEST_KEEP_ALIVE_SKIP_T rCmdKeepAliveSkip;
|
|
||||||
TDLS_CMD_CORE_TEST_CHSW_TIMEOUT_SKIP_T rCmdChSwTimeoutSkip;
|
|
||||||
TDLS_CMD_CORE_TEST_PROHIBIT_T rCmdProhibit;
|
|
||||||
TDLS_CMD_CORE_TEST_SCAN_SKIP_T rCmdScanSkip;
|
|
||||||
TDLS_CMD_CORE_TEST_PTI_TX_FAIL_T rCmdPtiTxFail;
|
|
||||||
|
|
||||||
TDLS_CMD_CORE_MIB_PARAM_UPDATE_T rCmdMibUpdate;
|
|
||||||
TDLS_CMD_CORE_UAPSD_CONFIG_T rCmdUapsdConf;
|
|
||||||
TDLS_CMD_CORE_CHSW_CONFIG_T rCmdChSwConf;
|
|
||||||
TDLS_CMD_CORE_SETUP_CONFIG_T rCmdSetupConf;
|
|
||||||
TDLS_CMD_CORE_INFO_DISPLAY_T rCmdInfoDisplay;
|
|
||||||
TDLS_U8 Reserved[TDLS_CMD_CORE_RESERVED_SIZE];
|
|
||||||
} Content;
|
|
||||||
} TDLS_CMD_CORE_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* assign station record idx for the packet only when STA_STATE_3
|
|
||||||
* Or we will try to send data frame when the TDLS peer's state is STA_STATE_1
|
|
||||||
* EX:
|
|
||||||
* 1. mtk_cfg80211_add_station: First create the STA_RECORD_T;
|
|
||||||
* 2. TdlsexCfg80211TdlsMgmt: Send a TDLS request frame.
|
|
||||||
* 3. mtk_cfg80211_add_station: Change state to STA_STATE_1.
|
|
||||||
* 4. TdlsexCfg80211TdlsMgmt: Send a TDLS request frame.
|
|
||||||
*/
|
|
||||||
#define TDLSEX_STA_REC_IDX_GET(__prAdapter__, __MsduInfo__) \
|
|
||||||
{ \
|
|
||||||
STA_RECORD_T *__StaRec__; \
|
|
||||||
__MsduInfo__->ucStaRecIndex = STA_REC_INDEX_NOT_FOUND; \
|
|
||||||
__StaRec__ = cnmGetStaRecByAddress(__prAdapter__, \
|
|
||||||
(UINT_8) NETWORK_TYPE_AIS_INDEX, \
|
|
||||||
__MsduInfo__->aucEthDestAddr); \
|
|
||||||
if ((__StaRec__ != NULL) && \
|
|
||||||
((__StaRec__)->ucStaState == STA_STATE_3) && \
|
|
||||||
(IS_TDLS_STA(__StaRec__))) { \
|
|
||||||
__MsduInfo__->ucStaRecIndex = __StaRec__->ucIndex; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
/* fill wiphy flag */
|
|
||||||
#define TDLSEX_WIPHY_FLAGS_INIT(__fgFlag__)\
|
|
||||||
{ \
|
|
||||||
__fgFlag__ |= (WIPHY_FLAG_SUPPORTS_TDLS | WIPHY_FLAG_TDLS_EXTERNAL_SETUP);\
|
|
||||||
}
|
|
||||||
|
|
||||||
/* assign user priority of a TDLS action frame */
|
|
||||||
/*
|
|
||||||
* According to 802.11z: Setup req/resp are sent in AC_BK, otherwise we should default
|
|
||||||
* to AC_VI.
|
|
||||||
*/
|
|
||||||
#define TDLSEX_UP_ASSIGN(__UserPriority__) \
|
|
||||||
{ \
|
|
||||||
__UserPriority__ = USER_PRIORITY_TDLS; \
|
|
||||||
}
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
TdlsexCfg80211TdlsMgmt(struct wiphy *wiphy, struct net_device *dev,
|
|
||||||
const u8 *peer, u8 action_code, u8 dialog_token,
|
|
||||||
u16 status_code, u32 peer_capability,
|
|
||||||
bool initiator, const u8 *buf, size_t len);
|
|
||||||
|
|
||||||
int TdlsexCfg80211TdlsOper(struct wiphy *wiphy, struct net_device *dev,
|
|
||||||
const u8 *peer, enum nl80211_tdls_operation oper);
|
|
||||||
|
|
||||||
VOID TdlsexCmd(P_GLUE_INFO_T prGlueInfo, UINT_8 *prInBuf, UINT_32 u4InBufLen);
|
|
||||||
|
|
||||||
VOID TdlsexBssExtCapParse(STA_RECORD_T *prStaRec, UINT_8 *pucIE);
|
|
||||||
|
|
||||||
VOID TdlsexEventHandle(P_GLUE_INFO_T prGlueInfo, UINT8 *prInBuf, UINT32 u4InBufLen);
|
|
||||||
|
|
||||||
TDLS_STATUS TdlsexKeyHandle(ADAPTER_T *prAdapter, PARAM_KEY_T *prNewKey, ENUM_NETWORK_TYPE_INDEX_T eNetworkType);
|
|
||||||
|
|
||||||
VOID TdlsexInit(ADAPTER_T *prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN TdlsexIsAnyPeerInPowerSave(ADAPTER_T *prAdapter);
|
|
||||||
|
|
||||||
TDLS_STATUS TdlsexLinkCtrl(ADAPTER_T *prAdapter, VOID *pvSetBuffer, UINT_32 u4SetBufferLen, UINT_32 *pu4SetInfoLen);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
TdlsexLinkHistoryRecord(GLUE_INFO_T *prGlueInfo,
|
|
||||||
BOOLEAN fgIsTearDown, UINT8 *pucPeerMac, BOOLEAN fgIsFromUs, UINT16 u2ReasonCode);
|
|
||||||
|
|
||||||
TDLS_STATUS TdlsexMgmtCtrl(ADAPTER_T *prAdapter, VOID *pvSetBuffer, UINT_32 u4SetBufferLen, UINT_32 *pu4SetInfoLen);
|
|
||||||
|
|
||||||
TDLS_STATUS TdlsexPeerAdd(P_ADAPTER_T prAdapter, PVOID pvSetBuffer, UINT_32 u4SetBufferLen, PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
TDLS_STATUS TdlsexPeerUpdate(P_ADAPTER_T prAdapter, PVOID pvSetBuffer, UINT_32 u4SetBufferLen, PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
BOOLEAN TdlsexRxFrameDrop(GLUE_INFO_T *prGlueInfo, struct sk_buff *skb);
|
|
||||||
|
|
||||||
VOID TdlsexRxFrameHandle(GLUE_INFO_T *prGlueInfo, struct sk_buff *skb);
|
|
||||||
|
|
||||||
TDLS_STATUS TdlsexStaRecIdxGet(ADAPTER_T *prAdapter, MSDU_INFO_T *prMsduInfo);
|
|
||||||
|
|
||||||
VOID TdlsexTxQuotaCheck(GLUE_INFO_T *prGlueInfo, STA_RECORD_T *prStaRec, UINT8 FreeQuota);
|
|
||||||
|
|
||||||
VOID TdlsexUninit(ADAPTER_T *prAdapter);
|
|
||||||
|
|
||||||
VOID TdlsexForwardFrameTag(struct sk_buff *skb, BOOLEAN fgDrop);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif /* CFG_SUPPORT_TDLS */
|
|
||||||
|
|
||||||
#endif /* _TDLS_EXTR_H */
|
|
|
@ -1,155 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _TYPEDEF_H
|
|
||||||
#define _TYPEDEF_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* ieee80211.h of linux has duplicated definitions */
|
|
||||||
#if defined(WLAN_STATUS_SUCCESS)
|
|
||||||
#undef WLAN_STATUS_SUCCESS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define WLAN_STATUS_SUCCESS ((WLAN_STATUS) 0x00000000L)
|
|
||||||
#define WLAN_STATUS_PENDING ((WLAN_STATUS) 0x00000103L)
|
|
||||||
#define WLAN_STATUS_NOT_ACCEPTED ((WLAN_STATUS) 0x00010003L)
|
|
||||||
|
|
||||||
#define WLAN_STATUS_MEDIA_CONNECT ((WLAN_STATUS) 0x4001000BL)
|
|
||||||
#define WLAN_STATUS_MEDIA_DISCONNECT ((WLAN_STATUS) 0x4001000CL)
|
|
||||||
#define WLAN_STATUS_MEDIA_DISCONNECT_LOCALLY ((WLAN_STATUS) 0x4001000DL)
|
|
||||||
|
|
||||||
#define WLAN_STATUS_MEDIA_SPECIFIC_INDICATION ((WLAN_STATUS) 0x40010012L)
|
|
||||||
|
|
||||||
#define WLAN_STATUS_SCAN_COMPLETE ((WLAN_STATUS) 0x60010001L)
|
|
||||||
#define WLAN_STATUS_MSDU_OK ((WLAN_STATUS) 0x60010002L)
|
|
||||||
|
|
||||||
/* TODO(Kevin): double check if 0x60010001 & 0x60010002 is proprietary */
|
|
||||||
#define WLAN_STATUS_ROAM_OUT_FIND_BEST ((WLAN_STATUS) 0x60010101L)
|
|
||||||
#define WLAN_STATUS_ROAM_DISCOVERY ((WLAN_STATUS) 0x60010102L)
|
|
||||||
|
|
||||||
#define WLAN_STATUS_FAILURE ((WLAN_STATUS) 0xC0000001L)
|
|
||||||
#define WLAN_STATUS_RESOURCES ((WLAN_STATUS) 0xC000009AL)
|
|
||||||
#define WLAN_STATUS_NOT_SUPPORTED ((WLAN_STATUS) 0xC00000BBL)
|
|
||||||
|
|
||||||
#define WLAN_STATUS_MULTICAST_FULL ((WLAN_STATUS) 0xC0010009L)
|
|
||||||
#define WLAN_STATUS_INVALID_PACKET ((WLAN_STATUS) 0xC001000FL)
|
|
||||||
#define WLAN_STATUS_ADAPTER_NOT_READY ((WLAN_STATUS) 0xC0010011L)
|
|
||||||
#define WLAN_STATUS_NOT_INDICATING ((WLAN_STATUS) 0xC0010013L)
|
|
||||||
#define WLAN_STATUS_INVALID_LENGTH ((WLAN_STATUS) 0xC0010014L)
|
|
||||||
#define WLAN_STATUS_INVALID_DATA ((WLAN_STATUS) 0xC0010015L)
|
|
||||||
#define WLAN_STATUS_BUFFER_TOO_SHORT ((WLAN_STATUS) 0xC0010016L)
|
|
||||||
#define WLAN_STATUS_BWCS_UPDATE ((WLAN_STATUS) 0xC0010017L)
|
|
||||||
|
|
||||||
#define WLAN_STATUS_JOIN_FAILURE ((WLAN_STATUS) 0xC0010018L)
|
|
||||||
|
|
||||||
/* NIC status flags */
|
|
||||||
#define ADAPTER_FLAG_HW_ERR 0x00400000
|
|
||||||
|
|
||||||
/* Type Length */
|
|
||||||
#define TL_IPV4 0x0008
|
|
||||||
#define TL_IPV6 0xDD86
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/* Type definition for GLUE_INFO structure */
|
|
||||||
typedef struct _GLUE_INFO_T GLUE_INFO_T, *P_GLUE_INFO_T;
|
|
||||||
|
|
||||||
/* Type definition for WLAN STATUS */
|
|
||||||
typedef UINT_32 WLAN_STATUS, *P_WLAN_STATUS;
|
|
||||||
|
|
||||||
/* Type definition for ADAPTER structure */
|
|
||||||
typedef struct _ADAPTER_T ADAPTER_T, *P_ADAPTER_T;
|
|
||||||
|
|
||||||
/* Type definition for MESSAGE HEADER structure */
|
|
||||||
typedef struct _MSG_HDR_T MSG_HDR_T, *P_MSG_HDR_T;
|
|
||||||
|
|
||||||
/* Type definition for WLAN configuration */
|
|
||||||
typedef struct _WLAN_CFG_T WLAN_CFG_T, *P_WLAN_CFG_T;
|
|
||||||
|
|
||||||
/* Type definition for WLAN configuration entry */
|
|
||||||
typedef struct _WLAN_CFG_ENTRY_T WLAN_CFG_ENTRY_T, *P_WLAN_CFG_ENTRY_T;
|
|
||||||
|
|
||||||
/* Type definition for WLAN configuration callback */
|
|
||||||
typedef WLAN_STATUS(*WLAN_CFG_SET_CB) (P_ADAPTER_T prAdapter,
|
|
||||||
PUINT_8 pucKey, PUINT_8 pucValue, PVOID pPrivate, UINT_32 u4Flags);
|
|
||||||
|
|
||||||
/* Type definition for Pointer to OS Native Packet */
|
|
||||||
typedef void *P_NATIVE_PACKET;
|
|
||||||
|
|
||||||
/* Type definition for STA_RECORD_T structure to handle the connectivity and packet reception
|
|
||||||
* for a particular STA.
|
|
||||||
*/
|
|
||||||
typedef struct _STA_RECORD_T STA_RECORD_T, *P_STA_RECORD_T, **PP_STA_RECORD_T;
|
|
||||||
|
|
||||||
/* CMD_INFO_T is used by Glue Layer to send a cluster of Command(OID) information to
|
|
||||||
* the TX Path to reduce the parameters of a function call.
|
|
||||||
*/
|
|
||||||
typedef struct _CMD_INFO_T CMD_INFO_T, *P_CMD_INFO_T;
|
|
||||||
|
|
||||||
/* Following typedef should be removed later, because Glue Layer should not
|
|
||||||
* be aware of following data type.
|
|
||||||
*/
|
|
||||||
typedef struct _SW_RFB_T SW_RFB_T, *P_SW_RFB_T, **PP_SW_RFB_T;
|
|
||||||
|
|
||||||
typedef struct _MSDU_INFO_T MSDU_INFO_T, *P_MSDU_INFO_T;
|
|
||||||
|
|
||||||
typedef struct _REG_ENTRY_T REG_ENTRY_T, *P_REG_ENTRY_T;
|
|
||||||
|
|
||||||
/* IST handler definition */
|
|
||||||
typedef VOID(*IST_EVENT_FUNCTION) (P_ADAPTER_T);
|
|
||||||
|
|
||||||
/* Type definition for function pointer of timer handler */
|
|
||||||
typedef VOID(*PFN_TIMER_CALLBACK) (IN P_GLUE_INFO_T);
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#endif /* _TYPEDEF_H */
|
|
|
@ -1,250 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _WLAN_BOW_H
|
|
||||||
#define _WLAN_BOW_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#include "nic/bow.h"
|
|
||||||
#include "nic/cmd_buf.h"
|
|
||||||
|
|
||||||
#if CFG_ENABLE_BT_OVER_WIFI
|
|
||||||
|
|
||||||
#if CFG_BOW_TEST
|
|
||||||
extern UINT_32 g_arBowRevPalPacketTime[32];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define BOWCMD_STATUS_SUCCESS 0
|
|
||||||
#define BOWCMD_STATUS_FAILURE 1
|
|
||||||
#define BOWCMD_STATUS_UNACCEPTED 2
|
|
||||||
#define BOWCMD_STATUS_INVALID 3
|
|
||||||
#define BOWCMD_STATUS_TIMEOUT 4
|
|
||||||
|
|
||||||
#define BOW_WILDCARD_SSID "AMP"
|
|
||||||
#define BOW_WILDCARD_SSID_LEN 3
|
|
||||||
#define BOW_SSID_LEN 21
|
|
||||||
|
|
||||||
/* 0: query, 1: setup, 2: destroy */
|
|
||||||
#define BOW_QUERY_CMD 0
|
|
||||||
#define BOW_SETUP_CMD 1
|
|
||||||
#define BOW_DESTROY_CMD 2
|
|
||||||
|
|
||||||
#define BOW_INITIATOR 0
|
|
||||||
#define BOW_RESPONDER 1
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _BOW_TABLE_T {
|
|
||||||
UINT_8 ucAcquireID;
|
|
||||||
BOOLEAN fgIsValid;
|
|
||||||
ENUM_BOW_DEVICE_STATE eState;
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
/* UINT_8 ucRole; */
|
|
||||||
/* UINT_8 ucChannelNum; */
|
|
||||||
UINT_16 u2Reserved;
|
|
||||||
} BOW_TABLE_T, *P_BOW_TABLE_T;
|
|
||||||
|
|
||||||
typedef WLAN_STATUS(*PFN_BOW_CMD_HANDLE) (P_ADAPTER_T, P_AMPC_COMMAND);
|
|
||||||
|
|
||||||
typedef struct _BOW_CMD_T {
|
|
||||||
UINT_8 uCmdID;
|
|
||||||
PFN_BOW_CMD_HANDLE pfCmdHandle;
|
|
||||||
} BOW_CMD_T, *P_BOW_CMD_T;
|
|
||||||
|
|
||||||
typedef struct _BOW_EVENT_ACTIVITY_REPORT_T {
|
|
||||||
UINT_8 ucReason;
|
|
||||||
UINT_8 aucReserved;
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
} BOW_EVENT_ACTIVITY_REPORT_T, *P_BOW_EVENT_ACTIVITY_REPORT_T;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ucReason: 0: success
|
|
||||||
* 1: general failure
|
|
||||||
* 2: too much time (> 2/3 second totally) requested for scheduling.
|
|
||||||
* Others: reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _BOW_EVENT_SYNC_TSF_T {
|
|
||||||
UINT_64 u4TsfTime;
|
|
||||||
UINT_32 u4TsfSysTime;
|
|
||||||
UINT_32 u4ScoTime;
|
|
||||||
UINT_32 u4ScoSysTime;
|
|
||||||
} BOW_EVENT_SYNC_TSF_T, *P_BOW_EVENT_SYNC_TSF_T;
|
|
||||||
|
|
||||||
typedef struct _BOW_ACTIVITY_REPORT_BODY_T {
|
|
||||||
UINT_32 u4StartTime;
|
|
||||||
UINT_32 u4Duration;
|
|
||||||
UINT_32 u4Periodicity;
|
|
||||||
} BOW_ACTIVITY_REPORT_BODY_T, *P_BOW_ACTIVITY_REPORT_BODY_T;
|
|
||||||
|
|
||||||
typedef struct _BOW_ACTIVITY_REPORT_T {
|
|
||||||
UINT_8 aucPeerAddress[6];
|
|
||||||
UINT_8 ucScheduleKnown;
|
|
||||||
UINT_8 ucNumReports;
|
|
||||||
BOW_ACTIVITY_REPORT_BODY_T arBowActivityReportBody[MAX_ACTIVITY_REPORT];
|
|
||||||
} BOW_ACTIVITY_REPORT_T, *P_BOW_ACTIVITY_REPORT_T;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
/* Firmware Command Packer */
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSendSetQueryBowCmd(IN P_ADAPTER_T prAdapter,
|
|
||||||
UINT_8 ucCID,
|
|
||||||
BOOLEAN fgSetQuery,
|
|
||||||
BOOLEAN fgNeedResp,
|
|
||||||
PFN_CMD_DONE_HANDLER pfCmdDoneHandler,
|
|
||||||
PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler,
|
|
||||||
UINT_32 u4SetQueryInfoLen, PUINT_8 pucInfoBuffer, IN UINT_8 ucSeqNumber);
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
/* Command Dispatcher */
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanbowHandleCommand(IN P_ADAPTER_T prAdapter, IN P_AMPC_COMMAND prCmd);
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
/* Routines to handle command */
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS bowCmdGetMacStatus(IN P_ADAPTER_T prAdapter, IN P_AMPC_COMMAND prCmd);
|
|
||||||
|
|
||||||
WLAN_STATUS bowCmdSetupConnection(IN P_ADAPTER_T prAdapter, IN P_AMPC_COMMAND prCmd);
|
|
||||||
|
|
||||||
WLAN_STATUS bowCmdDestroyConnection(IN P_ADAPTER_T prAdapter, IN P_AMPC_COMMAND prCmd);
|
|
||||||
|
|
||||||
WLAN_STATUS bowCmdSetPTK(IN P_ADAPTER_T prAdapter, IN P_AMPC_COMMAND prCmd);
|
|
||||||
|
|
||||||
WLAN_STATUS bowCmdReadRSSI(IN P_ADAPTER_T prAdapter, IN P_AMPC_COMMAND prCmd);
|
|
||||||
|
|
||||||
WLAN_STATUS bowCmdReadLinkQuality(IN P_ADAPTER_T prAdapter, IN P_AMPC_COMMAND prCmd);
|
|
||||||
|
|
||||||
WLAN_STATUS bowCmdShortRangeMode(IN P_ADAPTER_T prAdapter, IN P_AMPC_COMMAND prCmd);
|
|
||||||
|
|
||||||
WLAN_STATUS bowCmdGetChannelList(IN P_ADAPTER_T prAdapter, IN P_AMPC_COMMAND prCmd);
|
|
||||||
|
|
||||||
VOID wlanbowCmdEventSetStatus(IN P_ADAPTER_T prAdapter, IN P_AMPC_COMMAND prCmd, IN UINT_8 ucEventBuf);
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
/* Callbacks for event indication */
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
VOID wlanbowCmdEventSetCommon(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN PUINT_8 pucEventBuf);
|
|
||||||
|
|
||||||
VOID wlanbowCmdEventLinkConnected(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN PUINT_8 pucEventBuf);
|
|
||||||
|
|
||||||
VOID wlanbowCmdEventLinkDisconnected(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN PUINT_8 pucEventBuf);
|
|
||||||
|
|
||||||
VOID wlanbowCmdEventSetSetupConnection(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN PUINT_8 pucEventBuf);
|
|
||||||
|
|
||||||
VOID wlanbowCmdEventReadLinkQuality(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN PUINT_8 pucEventBuf);
|
|
||||||
|
|
||||||
VOID wlanbowCmdEventReadRssi(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN PUINT_8 pucEventBuf);
|
|
||||||
|
|
||||||
VOID wlanbowCmdTimeoutHandler(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
|
|
||||||
|
|
||||||
VOID bowStopping(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID bowStarting(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID bowAssignSsid(IN PUINT_8 pucSsid, IN PUINT_8 pucSsidLen);
|
|
||||||
|
|
||||||
BOOLEAN bowValidateProbeReq(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT PUINT_32 pu4ControlFlags);
|
|
||||||
|
|
||||||
VOID bowSendBeacon(IN P_ADAPTER_T prAdapter, ULONG ulParam);
|
|
||||||
|
|
||||||
VOID bowResponderScan(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID bowResponderScanDone(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID bowResponderCancelScan(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgIsChannelExtention);
|
|
||||||
|
|
||||||
VOID bowResponderJoin(IN P_ADAPTER_T prAdapter, P_BSS_DESC_T prBssDesc);
|
|
||||||
|
|
||||||
VOID bowFsmRunEventJoinComplete(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID
|
|
||||||
bowIndicationOfMediaStateToHost(IN P_ADAPTER_T prAdapter,
|
|
||||||
ENUM_PARAM_MEDIA_STATE_T eConnectionState, BOOLEAN fgDelayIndication);
|
|
||||||
|
|
||||||
VOID bowRunEventAAATxFail(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
WLAN_STATUS bowRunEventAAAComplete(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec);
|
|
||||||
|
|
||||||
WLAN_STATUS bowRunEventRxDeAuth(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN P_SW_RFB_T prSwRfb);
|
|
||||||
|
|
||||||
VOID bowDisconnectLink(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo, IN ENUM_TX_RESULT_CODE_T rTxDoneStatus);
|
|
||||||
|
|
||||||
BOOLEAN bowValidateAssocReq(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb, OUT PUINT_16 pu2StatusCode);
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
bowValidateAuth(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_SW_RFB_T prSwRfb, IN PP_STA_RECORD_T pprStaRec, OUT PUINT_16 pu2StatusCode);
|
|
||||||
|
|
||||||
VOID bowRunEventChGrant(IN P_ADAPTER_T prAdapter, IN P_MSG_HDR_T prMsgHdr);
|
|
||||||
|
|
||||||
VOID bowRequestCh(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID bowReleaseCh(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID bowChGrantedTimeout(IN P_ADAPTER_T prAdapter, IN ULONG ulParam);
|
|
||||||
|
|
||||||
BOOLEAN bowNotifyAllLinkDisconnected(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN bowCheckBowTableIfVaild(IN P_ADAPTER_T prAdapter, IN UINT_8 aucPeerAddress[6]);
|
|
||||||
|
|
||||||
BOOLEAN bowGetBowTableContent(IN P_ADAPTER_T prAdapter, IN UINT_8 ucBowTableIdx, OUT P_BOW_TABLE_T prBowTable);
|
|
||||||
|
|
||||||
BOOLEAN
|
|
||||||
bowGetBowTableEntryByPeerAddress(IN P_ADAPTER_T prAdapter, IN UINT_8 aucPeerAddress[6], OUT PUINT_8 pucBowTableIdx);
|
|
||||||
|
|
||||||
BOOLEAN bowGetBowTableFreeEntry(IN P_ADAPTER_T prAdapter, OUT PUINT_8 pucBowTableIdx);
|
|
||||||
|
|
||||||
ENUM_BOW_DEVICE_STATE bowGetBowTableState(IN P_ADAPTER_T prAdapter, IN UINT_8 aucPeerAddress[6]);
|
|
||||||
|
|
||||||
BOOLEAN bowSetBowTableState(IN P_ADAPTER_T prAdapter, IN UINT_8 aucPeerAddress[6], IN ENUM_BOW_DEVICE_STATE eState);
|
|
||||||
|
|
||||||
BOOLEAN bowSetBowTableContent(IN P_ADAPTER_T prAdapter, IN UINT_8 ucBowTableIdx, IN P_BOW_TABLE_T prBowTable);
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif /* _WLAN_BOW_H */
|
|
|
@ -1,697 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _WLAN_LIB_H
|
|
||||||
#define _WLAN_LIB_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#include "CFG_Wifi_File.h"
|
|
||||||
#include "rlm_domain.h"
|
|
||||||
#include "wlan_typedef.h"
|
|
||||||
#include "queue.h"
|
|
||||||
|
|
||||||
extern BOOLEAN fgIsResetting;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MAX_NUM_GROUP_ADDR 32 /* max number of group addresses */
|
|
||||||
|
|
||||||
#define TX_CS_TCP_UDP_GEN BIT(1)
|
|
||||||
#define TX_CS_IP_GEN BIT(0)
|
|
||||||
|
|
||||||
#define CSUM_OFFLOAD_EN_TX_TCP BIT(0)
|
|
||||||
#define CSUM_OFFLOAD_EN_TX_UDP BIT(1)
|
|
||||||
#define CSUM_OFFLOAD_EN_TX_IP BIT(2)
|
|
||||||
#define CSUM_OFFLOAD_EN_RX_TCP BIT(3)
|
|
||||||
#define CSUM_OFFLOAD_EN_RX_UDP BIT(4)
|
|
||||||
#define CSUM_OFFLOAD_EN_RX_IPv4 BIT(5)
|
|
||||||
#define CSUM_OFFLOAD_EN_RX_IPv6 BIT(6)
|
|
||||||
#define CSUM_OFFLOAD_EN_TX_MASK BITS(0, 2)
|
|
||||||
#define CSUM_OFFLOAD_EN_ALL BITS(0, 6)
|
|
||||||
|
|
||||||
/* TCP, UDP, IP Checksum */
|
|
||||||
#define RX_CS_TYPE_UDP BIT(7)
|
|
||||||
#define RX_CS_TYPE_TCP BIT(6)
|
|
||||||
#define RX_CS_TYPE_IPv6 BIT(5)
|
|
||||||
#define RX_CS_TYPE_IPv4 BIT(4)
|
|
||||||
|
|
||||||
#define RX_CS_STATUS_UDP BIT(3)
|
|
||||||
#define RX_CS_STATUS_TCP BIT(2)
|
|
||||||
#define RX_CS_STATUS_IP BIT(0)
|
|
||||||
|
|
||||||
#define CSUM_NOT_SUPPORTED 0x0
|
|
||||||
|
|
||||||
#define TXPWR_USE_PDSLOPE 0
|
|
||||||
|
|
||||||
/* NVRAM error code definitions */
|
|
||||||
#define NVRAM_ERROR_VERSION_MISMATCH BIT(1)
|
|
||||||
#define NVRAM_ERROR_INVALID_TXPWR BIT(2)
|
|
||||||
#define NVRAM_ERROR_INVALID_DPD BIT(3)
|
|
||||||
#define NVRAM_ERROR_INVALID_MAC_ADDR BIT(4)
|
|
||||||
#if CFG_SUPPORT_PWR_LIMIT_COUNTRY
|
|
||||||
#define NVRAM_POWER_LIMIT_TABLE_INVALID BIT(5)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define NUM_TC_RESOURCE_TO_STATISTICS 4
|
|
||||||
#if CFG_SUPPORT_NCHO
|
|
||||||
#define WLAN_CFG_ARGV_MAX 64
|
|
||||||
#else
|
|
||||||
#define WLAN_CFG_ARGV_MAX 8
|
|
||||||
#endif
|
|
||||||
#define WLAN_CFG_ENTRY_NUM_MAX 128
|
|
||||||
#define WLAN_CFG_KEY_LEN_MAX 32 /* include \x00 EOL */
|
|
||||||
#define WLAN_CFG_VALUE_LEN_MAX 32 /* include \x00 EOL */
|
|
||||||
#define WLAN_CFG_FLAG_SKIP_CB BIT(0)
|
|
||||||
#define WLAN_CFG_FILE_BUF_SIZE 2048
|
|
||||||
|
|
||||||
#define WLAN_CFG_SET_CHIP_LEN_MAX 10
|
|
||||||
#define WLAN_CFG_SET_DEBUG_LEVEL_LEN_MAX 10
|
|
||||||
#define WLAN_CFG_SET_SW_CTRL_LEN_MAX 10
|
|
||||||
|
|
||||||
#define WLAN_OID_TIMEOUT_THRESHOLD 2000 /* OID timeout (in ms) */
|
|
||||||
#define WLAN_OID_TIMEOUT_THRESHOLD_IN_RESETTING 300 /* OID timeout during chip-resetting (in ms) */
|
|
||||||
|
|
||||||
#define WLAN_OID_NO_ACK_THRESHOLD 3
|
|
||||||
|
|
||||||
#define WLAN_TX_THREAD_TASK_PRIORITY 0 /* If not setting the priority, 0 is the default */
|
|
||||||
#define WLAN_TX_THREAD_TASK_NICE (-10) /* If not setting the nice, -10 is the default */
|
|
||||||
|
|
||||||
#define WLAN_DOWNLOAD_IMAGE_TIMEOUT 2500 /*ms*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* D A T A T Y P E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
typedef WLAN_STATUS(*PFN_OID_HANDLER_FUNC) (IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvBuf, IN UINT_32 u4BufLen, OUT PUINT_32 pu4OutInfoLen);
|
|
||||||
|
|
||||||
typedef enum _ENUM_CSUM_TYPE_T {
|
|
||||||
CSUM_TYPE_IPV4,
|
|
||||||
CSUM_TYPE_IPV6,
|
|
||||||
CSUM_TYPE_TCP,
|
|
||||||
CSUM_TYPE_UDP,
|
|
||||||
CSUM_TYPE_NUM
|
|
||||||
} ENUM_CSUM_TYPE_T, *P_ENUM_CSUM_TYPE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_CSUM_RESULT_T {
|
|
||||||
CSUM_RES_NONE,
|
|
||||||
CSUM_RES_SUCCESS,
|
|
||||||
CSUM_RES_FAILED,
|
|
||||||
CSUM_RES_NUM
|
|
||||||
} ENUM_CSUM_RESULT_T, *P_ENUM_CSUM_RESULT_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_PHY_MODE_T {
|
|
||||||
ENUM_PHY_2G4_CCK,
|
|
||||||
ENUM_PHY_2G4_OFDM_BPSK,
|
|
||||||
ENUM_PHY_2G4_OFDM_QPSK,
|
|
||||||
ENUM_PHY_2G4_OFDM_16QAM,
|
|
||||||
ENUM_PHY_2G4_OFDM_48M,
|
|
||||||
ENUM_PHY_2G4_OFDM_54M,
|
|
||||||
ENUM_PHY_2G4_HT20_BPSK,
|
|
||||||
ENUM_PHY_2G4_HT20_QPSK,
|
|
||||||
ENUM_PHY_2G4_HT20_16QAM,
|
|
||||||
ENUM_PHY_2G4_HT20_MCS5,
|
|
||||||
ENUM_PHY_2G4_HT20_MCS6,
|
|
||||||
ENUM_PHY_2G4_HT20_MCS7,
|
|
||||||
ENUM_PHY_2G4_HT40_BPSK,
|
|
||||||
ENUM_PHY_2G4_HT40_QPSK,
|
|
||||||
ENUM_PHY_2G4_HT40_16QAM,
|
|
||||||
ENUM_PHY_2G4_HT40_MCS5,
|
|
||||||
ENUM_PHY_2G4_HT40_MCS6,
|
|
||||||
ENUM_PHY_2G4_HT40_MCS7,
|
|
||||||
ENUM_PHY_5G_OFDM_BPSK,
|
|
||||||
ENUM_PHY_5G_OFDM_QPSK,
|
|
||||||
ENUM_PHY_5G_OFDM_16QAM,
|
|
||||||
ENUM_PHY_5G_OFDM_48M,
|
|
||||||
ENUM_PHY_5G_OFDM_54M,
|
|
||||||
ENUM_PHY_5G_HT20_BPSK,
|
|
||||||
ENUM_PHY_5G_HT20_QPSK,
|
|
||||||
ENUM_PHY_5G_HT20_16QAM,
|
|
||||||
ENUM_PHY_5G_HT20_MCS5,
|
|
||||||
ENUM_PHY_5G_HT20_MCS6,
|
|
||||||
ENUM_PHY_5G_HT20_MCS7,
|
|
||||||
ENUM_PHY_5G_HT40_BPSK,
|
|
||||||
ENUM_PHY_5G_HT40_QPSK,
|
|
||||||
ENUM_PHY_5G_HT40_16QAM,
|
|
||||||
ENUM_PHY_5G_HT40_MCS5,
|
|
||||||
ENUM_PHY_5G_HT40_MCS6,
|
|
||||||
ENUM_PHY_5G_HT40_MCS7,
|
|
||||||
ENUM_PHY_MODE_NUM
|
|
||||||
} ENUM_PHY_MODE_T, *P_ENUM_PHY_MODE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_POWER_SAVE_POLL_MODE_T {
|
|
||||||
ENUM_POWER_SAVE_POLL_DISABLE,
|
|
||||||
ENUM_POWER_SAVE_POLL_LEGACY_NULL,
|
|
||||||
ENUM_POWER_SAVE_POLL_QOS_NULL,
|
|
||||||
ENUM_POWER_SAVE_POLL_NUM
|
|
||||||
} ENUM_POWER_SAVE_POLL_MODE_T, *P_ENUM_POWER_SAVE_POLL_MODE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_AC_TYPE_T {
|
|
||||||
ENUM_AC_TYPE_AC0,
|
|
||||||
ENUM_AC_TYPE_AC1,
|
|
||||||
ENUM_AC_TYPE_AC2,
|
|
||||||
ENUM_AC_TYPE_AC3,
|
|
||||||
ENUM_AC_TYPE_AC4,
|
|
||||||
ENUM_AC_TYPE_AC5,
|
|
||||||
ENUM_AC_TYPE_AC6,
|
|
||||||
ENUM_AC_TYPE_BMC,
|
|
||||||
ENUM_AC_TYPE_NUM
|
|
||||||
} ENUM_AC_TYPE_T, *P_ENUM_AC_TYPE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_ADV_AC_TYPE_T {
|
|
||||||
ENUM_ADV_AC_TYPE_RX_NSW,
|
|
||||||
ENUM_ADV_AC_TYPE_RX_PTA,
|
|
||||||
ENUM_ADV_AC_TYPE_RX_SP,
|
|
||||||
ENUM_ADV_AC_TYPE_TX_PTA,
|
|
||||||
ENUM_ADV_AC_TYPE_TX_RSP,
|
|
||||||
ENUM_ADV_AC_TYPE_NUM
|
|
||||||
} ENUM_ADV_AC_TYPE_T, *P_ENUM_ADV_AC_TYPE_T;
|
|
||||||
|
|
||||||
typedef enum _ENUM_REG_CH_MAP_T {
|
|
||||||
REG_CH_MAP_COUNTRY_CODE,
|
|
||||||
REG_CH_MAP_TBL_IDX,
|
|
||||||
REG_CH_MAP_CUSTOMIZED,
|
|
||||||
REG_CH_MAP_NUM
|
|
||||||
} ENUM_REG_CH_MAP_T, *P_ENUM_REG_CH_MAP_T;
|
|
||||||
|
|
||||||
#define CHIP_CONFIG_RESP_SIZE 320
|
|
||||||
enum {
|
|
||||||
CHIP_CONFIG_TYPE_WO_RESPONSE = 0x00,
|
|
||||||
CHIP_CONFIG_TYPE_MEM8 = 0x01,
|
|
||||||
CHIP_CONFIG_TYPE_MEM32 = 0x02,
|
|
||||||
CHIP_CONFIG_TYPE_ASCII = 0x03,
|
|
||||||
CHIP_CONFIG_TYPE_BINARY = 0x04,
|
|
||||||
CHIP_CONFIG_TYPE_DRV_PASSTHROUGH = 0x05,
|
|
||||||
CHIP_CONFIG_TYPE_END
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct _SET_TXPWR_CTRL_T {
|
|
||||||
INT_8 c2GLegacyStaPwrOffset; /* Unit: 0.5dBm, default: 0 */
|
|
||||||
INT_8 c2GHotspotPwrOffset;
|
|
||||||
INT_8 c2GP2pPwrOffset;
|
|
||||||
INT_8 c2GBowPwrOffset;
|
|
||||||
INT_8 c5GLegacyStaPwrOffset; /* Unit: 0.5dBm, default: 0 */
|
|
||||||
INT_8 c5GHotspotPwrOffset;
|
|
||||||
INT_8 c5GP2pPwrOffset;
|
|
||||||
INT_8 c5GBowPwrOffset;
|
|
||||||
UINT_8 ucConcurrencePolicy; /*
|
|
||||||
* TX power policy when concurrence
|
|
||||||
* in the same channel
|
|
||||||
* 0: Highest power has priority
|
|
||||||
* 1: Lowest power has priority
|
|
||||||
*/
|
|
||||||
INT_8 acReserved1[3]; /* Must be zero */
|
|
||||||
|
|
||||||
/* Power limit by channel for all data rates */
|
|
||||||
INT_8 acTxPwrLimit2G[14]; /* Channel 1~14, Unit: 0.5dBm */
|
|
||||||
INT_8 acTxPwrLimit5G[4]; /* UNII 1~4 */
|
|
||||||
INT_8 acReserved2[2]; /* Must be zero */
|
|
||||||
#if CFG_SUPPORT_TX_POWER_BACK_OFF
|
|
||||||
MITIGATED_PWR_BY_CH_BY_MODE arRlmMitigatedPwrByChByMode[40];
|
|
||||||
#endif
|
|
||||||
} SET_TXPWR_CTRL_T, *P_SET_TXPWR_CTRL_T;
|
|
||||||
|
|
||||||
/* For storing driver initialization value from glue layer */
|
|
||||||
typedef struct _REG_INFO_T {
|
|
||||||
UINT_32 u4SdBlockSize; /* SDIO block size */
|
|
||||||
UINT_32 u4SdBusWidth; /* SDIO bus width. 1 or 4 */
|
|
||||||
UINT_32 u4SdClockRate; /* SDIO clock rate. (in unit of HZ) */
|
|
||||||
UINT_32 u4StartAddress; /* Starting address of Wi-Fi Firmware */
|
|
||||||
UINT_32 u4LoadAddress; /* Load address of Wi-Fi Firmware */
|
|
||||||
UINT_16 aucFwImgFilename[65]; /* Firmware filename */
|
|
||||||
UINT_16 aucFwImgFilenameE6[65]; /* Firmware filename for E6 */
|
|
||||||
UINT_32 u4StartFreq; /* Start Frequency for Ad-Hoc network : in unit of KHz */
|
|
||||||
UINT_32 u4AdhocMode; /* Default mode for Ad-Hoc network : ENUM_PARAM_AD_HOC_MODE_T */
|
|
||||||
UINT_32 u4RddStartFreq;
|
|
||||||
UINT_32 u4RddStopFreq;
|
|
||||||
UINT_32 u4RddTestMode;
|
|
||||||
UINT_32 u4RddShutFreq;
|
|
||||||
UINT_32 u4RddDfs;
|
|
||||||
INT_32 i4HighRssiThreshold;
|
|
||||||
INT_32 i4MediumRssiThreshold;
|
|
||||||
INT_32 i4LowRssiThreshold;
|
|
||||||
INT_32 au4TxPriorityTag[ENUM_AC_TYPE_NUM];
|
|
||||||
INT_32 au4RxPriorityTag[ENUM_AC_TYPE_NUM];
|
|
||||||
INT_32 au4AdvPriorityTag[ENUM_ADV_AC_TYPE_NUM];
|
|
||||||
UINT_32 u4FastPSPoll;
|
|
||||||
UINT_32 u4PTA; /* 0: disable, 1: enable */
|
|
||||||
UINT_32 u4TXLimit; /* 0: disable, 1: enable */
|
|
||||||
UINT_32 u4SilenceWindow; /* range: 100 - 625, unit: us */
|
|
||||||
UINT_32 u4TXLimitThreshold; /* range: 250 - 1250, unit: us */
|
|
||||||
UINT_32 u4PowerMode;
|
|
||||||
UINT_32 fgEnArpFilter;
|
|
||||||
UINT_32 u4PsCurrentMeasureEn;
|
|
||||||
UINT_32 u4UapsdAcBmp;
|
|
||||||
UINT_32 u4MaxSpLen;
|
|
||||||
UINT_32 fgDisOnlineScan; /* 0: enable online scan, non-zero: disable online scan */
|
|
||||||
UINT_32 fgDisBcnLostDetection; /* 0: enable online scan, non-zero: disable online scan */
|
|
||||||
UINT_32 u4FixedRate; /* 0: automatic, non-zero: fixed rate */
|
|
||||||
UINT_32 u4ArSysParam0;
|
|
||||||
UINT_32 u4ArSysParam1;
|
|
||||||
UINT_32 u4ArSysParam2;
|
|
||||||
UINT_32 u4ArSysParam3;
|
|
||||||
UINT_32 fgDisRoaming; /* 0:enable roaming 1:disable */
|
|
||||||
|
|
||||||
/* NVRAM - MP Data -START- */
|
|
||||||
UINT_8 aucMacAddr[6];
|
|
||||||
UINT_16 au2CountryCode[4]; /* Country code (in ISO 3166-1 expression, ex: "US", "TW") */
|
|
||||||
TX_PWR_PARAM_T rTxPwr;
|
|
||||||
UINT_8 aucEFUSE[144];
|
|
||||||
UINT_8 ucTxPwrValid;
|
|
||||||
UINT_8 ucSupport5GBand;
|
|
||||||
UINT_8 fg2G4BandEdgePwrUsed;
|
|
||||||
INT_8 cBandEdgeMaxPwrCCK;
|
|
||||||
INT_8 cBandEdgeMaxPwrOFDM20;
|
|
||||||
INT_8 cBandEdgeMaxPwrOFDM40;
|
|
||||||
ENUM_REG_CH_MAP_T eRegChannelListMap;
|
|
||||||
UINT_8 ucRegChannelListIndex;
|
|
||||||
DOMAIN_INFO_ENTRY rDomainInfo;
|
|
||||||
/* NVRAM - MP Data -END- */
|
|
||||||
|
|
||||||
/* NVRAM - Functional Data -START- */
|
|
||||||
UINT_8 uc2G4BwFixed20M;
|
|
||||||
UINT_8 uc5GBwFixed20M;
|
|
||||||
UINT_8 ucEnable5GBand;
|
|
||||||
UINT_8 uc2GRssiCompensation;
|
|
||||||
UINT_8 uc5GRssiCompensation;
|
|
||||||
UINT_8 fgRssiCompensationValidbit;
|
|
||||||
UINT_8 ucRxAntennanumber;
|
|
||||||
#if CFG_SUPPORT_TX_POWER_BACK_OFF
|
|
||||||
MITIGATED_PWR_BY_CH_BY_MODE arRlmMitigatedPwrByChByMode[40];
|
|
||||||
UINT_8 fgRlmMitigatedPwrByChByMode;
|
|
||||||
BOOLEAN bTxPowerLimitEnable2G;
|
|
||||||
BOOLEAN bTxPowerLimitEnable5G;
|
|
||||||
UINT8 cTxBackOffMaxPower2G;
|
|
||||||
UINT8 cTxBackOffMaxPower5G;
|
|
||||||
#endif
|
|
||||||
#if CFG_SUPPORT_FCC_POWER_BACK_OFF
|
|
||||||
FCC_TX_PWR_ADJUST rFccTxPwrAdjust;
|
|
||||||
UINT_8 aucChannelBandEdge[2];
|
|
||||||
#endif
|
|
||||||
/* NVRAM - Functional Data -END- */
|
|
||||||
|
|
||||||
} REG_INFO_T, *P_REG_INFO_T;
|
|
||||||
|
|
||||||
/* for divided firmware loading */
|
|
||||||
typedef struct _FWDL_SECTION_INFO_T {
|
|
||||||
UINT_32 u4Offset;
|
|
||||||
UINT_32 u4Reserved;
|
|
||||||
UINT_32 u4Length;
|
|
||||||
UINT_32 u4DestAddr;
|
|
||||||
} FWDL_SECTION_INFO_T, *P_FWDL_SECTION_INFO_T;
|
|
||||||
|
|
||||||
typedef struct _FIRMWARE_DIVIDED_DOWNLOAD_T {
|
|
||||||
UINT_32 u4Signature;
|
|
||||||
UINT_32 u4CRC; /* CRC calculated without first 8 bytes included */
|
|
||||||
UINT_32 u4NumOfEntries;
|
|
||||||
UINT_32 u4Reserved;
|
|
||||||
FWDL_SECTION_INFO_T arSection[];
|
|
||||||
} FIRMWARE_DIVIDED_DOWNLOAD_T, *P_FIRMWARE_DIVIDED_DOWNLOAD_T;
|
|
||||||
|
|
||||||
typedef struct _PARAM_MCR_RW_STRUCT_T {
|
|
||||||
UINT_32 u4McrOffset;
|
|
||||||
UINT_32 u4McrData;
|
|
||||||
} PARAM_MCR_RW_STRUCT_T, *P_PARAM_MCR_RW_STRUCT_T;
|
|
||||||
|
|
||||||
typedef struct _PARAM_GET_STA_STATISTICS {
|
|
||||||
UINT_8 ucInvalid;
|
|
||||||
UINT_8 ucVersion;
|
|
||||||
/* Per-STA statistic */
|
|
||||||
UINT_8 aucMacAddr[MAC_ADDR_LEN];
|
|
||||||
UINT_32 u4LinkScore;
|
|
||||||
UINT_32 u4Flag;
|
|
||||||
|
|
||||||
/* From FW */
|
|
||||||
UINT_8 ucPer; /* base: 128 */
|
|
||||||
UINT_8 ucRcpi;
|
|
||||||
UINT_32 u4PhyMode;
|
|
||||||
UINT_16 u2LinkSpeed; /* unit is 0.5 Mbits */
|
|
||||||
|
|
||||||
UINT_32 u4TxFailCount;
|
|
||||||
UINT_32 u4TxLifeTimeoutCount;
|
|
||||||
UINT_32 u4TxAverageAirTime;
|
|
||||||
|
|
||||||
/* From driver */
|
|
||||||
UINT_32 u4TxTotalCount;
|
|
||||||
UINT_32 u4TxExceedThresholdCount;
|
|
||||||
UINT_32 u4TxAverageProcessTime;
|
|
||||||
|
|
||||||
UINT_32 u4TxMaxTime;
|
|
||||||
UINT_32 u4TxMaxHifTime;
|
|
||||||
UINT_32 u4TxAverageHifTime;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* How many packages Enqueue/Deqeue during statistics interval
|
|
||||||
*/
|
|
||||||
UINT_32 u4EnqueueCounter;
|
|
||||||
UINT_32 u4DequeueCounter;
|
|
||||||
|
|
||||||
UINT_32 u4EnqueueStaCounter;
|
|
||||||
UINT_32 u4DequeueStaCounter;
|
|
||||||
|
|
||||||
UINT_32 IsrCnt;
|
|
||||||
UINT_32 IsrPassCnt;
|
|
||||||
UINT_32 TaskIsrCnt;
|
|
||||||
|
|
||||||
UINT_32 IsrAbnormalCnt;
|
|
||||||
UINT_32 IsrSoftWareCnt;
|
|
||||||
UINT_32 IsrRxCnt;
|
|
||||||
UINT_32 IsrTxCnt;
|
|
||||||
|
|
||||||
UINT_32 au4TcResourceEmptyCount[NUM_TC_RESOURCE_TO_STATISTICS];
|
|
||||||
UINT_32 au4DequeueNoTcResource[NUM_TC_RESOURCE_TO_STATISTICS];
|
|
||||||
UINT_32 au4TcResourceBackCount[NUM_TC_RESOURCE_TO_STATISTICS];
|
|
||||||
|
|
||||||
UINT_32 au4TcResourceUsedCount[NUM_TC_RESOURCE_TO_STATISTICS];
|
|
||||||
UINT_32 au4TcResourceWantedCount[NUM_TC_RESOURCE_TO_STATISTICS];
|
|
||||||
|
|
||||||
UINT_32 au4TcQueLen[NUM_TC_RESOURCE_TO_STATISTICS];
|
|
||||||
/* Global queue management statistic */
|
|
||||||
UINT_32 au4TcAverageQueLen[NUM_TC_RESOURCE_TO_STATISTICS];
|
|
||||||
UINT_32 au4TcCurrentQueLen[NUM_TC_RESOURCE_TO_STATISTICS];
|
|
||||||
|
|
||||||
/* Reserved fields */
|
|
||||||
UINT_8 au4Reserved[32];
|
|
||||||
} PARAM_GET_STA_STA_STATISTICS, *P_PARAM_GET_STA_STATISTICS;
|
|
||||||
|
|
||||||
typedef enum _ENUM_BAND_EDGE_CERT_T {
|
|
||||||
BAND_EDGE_CERT_FCC = 0,
|
|
||||||
BAND_EDGE_CERT_KCC = 1,
|
|
||||||
BAND_EDGE_CERT_NUM = 2
|
|
||||||
} ENUM_BAND_EDGE_CERT_T, *P_ENUM_BAND_EDGE_CERT_T;
|
|
||||||
|
|
||||||
enum ENUM_MAX_BANDWIDTH_SETTING {
|
|
||||||
MAX_BW_20MHZ = 0,
|
|
||||||
MAX_BW_40MHZ,
|
|
||||||
MAX_BW_80MHZ,
|
|
||||||
MAX_BW_160MHZ,
|
|
||||||
MAX_BW_80_80_MHZ,
|
|
||||||
MAX_BW_UNKNOWN
|
|
||||||
};
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
#define BUILD_SIGN(ch0, ch1, ch2, ch3) \
|
|
||||||
((UINT_32)(UINT_8)(ch0) | ((UINT_32)(UINT_8)(ch1) << 8) | \
|
|
||||||
((UINT_32)(UINT_8)(ch2) << 16) | ((UINT_32)(UINT_8)(ch3) << 24))
|
|
||||||
|
|
||||||
#define MTK_WIFI_SIGNATURE BUILD_SIGN('M', 'T', 'K', 'W')
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
P_ADAPTER_T wlanAdapterCreate(IN P_GLUE_INFO_T prGlueInfo);
|
|
||||||
|
|
||||||
VOID wlanAdapterDestroy(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID wlanCardEjected(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID wlanIST(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN wlanISR(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgGlobalIntrCtrl);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanProcessCommandQueue(IN P_ADAPTER_T prAdapter, IN P_QUE_T prCmdQue);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanSendCommand(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
|
|
||||||
|
|
||||||
VOID wlanReleaseCommand(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
|
|
||||||
|
|
||||||
VOID wlanReleasePendingOid(IN P_ADAPTER_T prAdapter, IN ULONG ulData);
|
|
||||||
|
|
||||||
VOID wlanReleasePendingCMDbyNetwork(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType);
|
|
||||||
|
|
||||||
VOID wlanReturnPacket(IN P_ADAPTER_T prAdapter, IN PVOID pvPacket);
|
|
||||||
|
|
||||||
VOID wlanReturnIndicatedPacketsTimeOut(IN P_ADAPTER_T prAdapter, IN ULONG ulData);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanQueryInformation(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PFN_OID_HANDLER_FUNC pfOidQryHandler,
|
|
||||||
IN PVOID pvInfoBuf, IN UINT_32 u4InfoBufLen, OUT PUINT_32 pu4QryInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanSetInformation(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PFN_OID_HANDLER_FUNC pfOidSetHandler,
|
|
||||||
IN PVOID pvInfoBuf, IN UINT_32 u4InfoBufLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanAdapterStart(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN P_REG_INFO_T prRegInfo, IN PVOID pvFwImageMapFile, IN UINT_32 u4FwImageFileLength);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanAdapterStop(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_WAPI
|
|
||||||
BOOLEAN wlanQueryWapiMode(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VOID wlanReturnRxPacket(IN PVOID pvAdapter, IN PVOID pvPacket);
|
|
||||||
|
|
||||||
VOID wlanRxSetBroadcast(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgEnableBroadcast);
|
|
||||||
|
|
||||||
BOOLEAN wlanIsHandlerNeedHwAccess(IN PFN_OID_HANDLER_FUNC pfnOidHandler, IN BOOLEAN fgSetInfo);
|
|
||||||
|
|
||||||
VOID wlanSetPromiscuousMode(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgEnablePromiscuousMode);
|
|
||||||
|
|
||||||
#if CFG_ENABLE_FW_DOWNLOAD
|
|
||||||
#if CFG_ENABLE_FW_DOWNLOAD_AGGREGATION
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanImageSectionDownloadAggregated(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_32 u4DestAddr, IN UINT_32 u4ImgSecSize, IN PUINT_8 pucImgSecBuf);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanImageSectionDownload(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN UINT_32 u4DestAddr, IN UINT_32 u4ImgSecSize, IN PUINT_8 pucImgSecBuf);
|
|
||||||
|
|
||||||
#if !CFG_ENABLE_FW_DOWNLOAD_ACK
|
|
||||||
WLAN_STATUS wlanImageQueryStatus(IN P_ADAPTER_T prAdapter);
|
|
||||||
#else
|
|
||||||
WLAN_STATUS wlanImageSectionDownloadStatus(IN P_ADAPTER_T prAdapter, IN UINT_8 ucCmdSeqNum);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WLAN_STATUS wlanConfigWifiFunc(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgEnable, IN UINT_32 u4StartAddress);
|
|
||||||
|
|
||||||
UINT_32 wlanCRC32(PUINT_8 buf, UINT_32 len);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WLAN_STATUS wlanSendNicPowerCtrlCmd(IN P_ADAPTER_T prAdapter, IN UINT_8 ucPowerMode);
|
|
||||||
|
|
||||||
BOOLEAN wlanIsHandlerAllowedInRFTest(IN PFN_OID_HANDLER_FUNC pfnOidHandler, IN BOOLEAN fgSetInfo);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanProcessQueuedSwRfb(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfbListHead);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanProcessQueuedMsduInfo(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfoListHead);
|
|
||||||
|
|
||||||
BOOLEAN wlanoidTimeoutCheck(IN P_ADAPTER_T prAdapter, IN PFN_OID_HANDLER_FUNC pfnOidHandler);
|
|
||||||
|
|
||||||
VOID wlanoidClearTimeoutCheck(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanUpdateNetworkAddress(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
BOOLEAN wlanQueryTestMode(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/* Security Frame Handling */
|
|
||||||
BOOLEAN wlanProcessSecurityFrame(IN P_ADAPTER_T prAdapter, IN P_NATIVE_PACKET prPacket);
|
|
||||||
|
|
||||||
VOID wlanSecurityFrameTxDone(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo, IN PUINT_8 pucEventBuf);
|
|
||||||
|
|
||||||
VOID wlanSecurityFrameTxTimeout(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* OID/IOCTL Handling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID wlanClearScanningResult(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID wlanClearBssInScanningResult(IN P_ADAPTER_T prAdapter, IN PUINT_8 arBSSID);
|
|
||||||
|
|
||||||
#if CFG_TEST_WIFI_DIRECT_GO
|
|
||||||
VOID wlanEnableP2pFunction(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID wlanEnableATGO(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Address Retrieve by Polling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanQueryPermanentAddress(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* NIC Capability Retrieve by Polling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanQueryNicCapability(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* NIC Capability Retrieve by Polling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanQueryDebugCode(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Compiler Flags Retrieve by Polling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanQueryCompileFlags(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* PD MCR Retrieve by Polling */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanQueryPdMcr(IN P_ADAPTER_T prAdapter, IN P_PARAM_MCR_RW_STRUCT_T prMcrRdInfo);
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Loading Manufacture Data */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanLoadManufactureData(IN P_ADAPTER_T prAdapter, IN P_REG_INFO_T prRegInfo);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Media Stream Mode */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
BOOLEAN wlanResetMediaStreamMode(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Timer Timeout Check (for Glue Layer) */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanTimerTimeoutCheck(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Mailbox Message Check (for Glue Layer) */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanProcessMboxMessage(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* TX Pending Packets Handling (for Glue Layer) */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanEnqueueTxPacket(IN P_ADAPTER_T prAdapter, IN P_NATIVE_PACKET prNativePacket);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanFlushTxPendingPackets(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanTxPendingPackets(IN P_ADAPTER_T prAdapter, IN OUT PBOOLEAN pfgHwAccess);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Low Power Acquire/Release (for Glue Layer) */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanAcquirePowerControl(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanReleasePowerControl(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* Pending Packets Number Reporting (for Glue Layer) */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
UINT_32 wlanGetTxPendingFrameCount(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* ACPI state inquiry (for Glue Layer) */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
ENUM_ACPI_STATE_T wlanGetAcpiState(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
VOID wlanSetAcpiState(IN P_ADAPTER_T prAdapter, IN ENUM_ACPI_STATE_T ePowerState);
|
|
||||||
|
|
||||||
VOID wlanDefTxPowerCfg(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* get ECO version from Revision ID register (for Win32) */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
UINT_8 wlanGetEcoVersion(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* set preferred band configuration corresponding to network type */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
VOID
|
|
||||||
wlanSetPreferBandByNetwork(IN P_ADAPTER_T prAdapter, IN ENUM_BAND_T eBand, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* get currently operating channel information */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
UINT_8 wlanGetChannelNumberByNetwork(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* get BSS Descriptor information */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
P_BSS_DESC_T wlanGetTargetBssDescByNetwork(IN P_ADAPTER_T prAdapter, IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_ADD_CONN_AP
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* check for system configuration to generate message on scan list */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanCheckConnectedAP(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* check for system configuration to generate message on scan list */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS wlanCheckSystemConfiguration(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
/* query sta statistics information from driver and firmware */
|
|
||||||
/*----------------------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidQueryStaStatistics(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen, OUT PUINT_32 pu4QueryInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanCfgParseArgument(CHAR *cmdLine, INT_32 *argc, CHAR *argv[]);
|
|
||||||
|
|
||||||
P_WLAN_CFG_ENTRY_T wlanCfgGetEntry(IN P_ADAPTER_T prAdapter, const PCHAR pucKey);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanCfgGet(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, PCHAR pucValue, PCHAR pucValueDef, UINT_32 u4Flags);
|
|
||||||
|
|
||||||
UINT_32 wlanCfgGetUint32(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, UINT_32 u4ValueDef);
|
|
||||||
|
|
||||||
INT_32 wlanCfgGetInt32(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, INT_32 i4ValueDef);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanCfgSetUint32(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, UINT_32 u4Value);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanCfgSet(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, PCHAR pucValue, UINT_32 u4Flags);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanCfgSetCb(IN P_ADAPTER_T prAdapter, const PCHAR pucKey, WLAN_CFG_SET_CB pfSetCb, void *pPrivate, UINT_32 u4Flags);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_CFG_FILE
|
|
||||||
WLAN_STATUS wlanCfgInit(IN P_ADAPTER_T prAdapter, PUINT_8 pucConfigBuf, UINT_32 u4ConfigBufLen, UINT_32 u4Flags);
|
|
||||||
|
|
||||||
VOID wlanCfgApply(IN P_ADAPTER_T prAdapter);
|
|
||||||
#endif /* CFG_SUPPORT_CFG_FILE */
|
|
||||||
|
|
||||||
extern VOID mtk_wcn_wmt_set_wifi_ver(UINT_32 Value);
|
|
||||||
VOID wlanReleasePendingCmdById(P_ADAPTER_T prAdapter, UINT_8 ucCid);
|
|
||||||
|
|
||||||
UINT_32 wlanDecimalStr2Hexadecimals(PUINT_8 pucDecimalStr, PUINT_16 pu2Out);
|
|
||||||
|
|
||||||
WLAN_STATUS wlanQueryLteSafeChannel(IN P_ADAPTER_T prAdapter);
|
|
||||||
|
|
||||||
uint8_t
|
|
||||||
wlanGetChannelIndex(IN uint8_t channel);
|
|
||||||
|
|
||||||
#endif /* _WLAN_LIB_H */
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,221 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2016 MediaTek Inc.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2 as
|
|
||||||
* published by the Free Software Foundation.
|
|
||||||
*
|
|
||||||
* 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 http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _WLAN_P2P_H
|
|
||||||
#define _WLAN_P2P_H
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O M P I L E R F L A G S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* E X T E R N A L R E F E R E N C E S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if CFG_ENABLE_WIFI_DIRECT
|
|
||||||
/*******************************************************************************
|
|
||||||
* C O N S T A N T S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P U B L I C D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Service Discovery */
|
|
||||||
typedef struct _PARAM_P2P_SEND_SD_RESPONSE {
|
|
||||||
PARAM_MAC_ADDRESS rReceiverAddr;
|
|
||||||
UINT_8 fgNeedTxDoneIndication;
|
|
||||||
UINT_8 ucChannelNum;
|
|
||||||
UINT_16 u2PacketLength;
|
|
||||||
UINT_8 aucPacketContent[0]; /*native 802.11 */
|
|
||||||
} PARAM_P2P_SEND_SD_RESPONSE, *P_PARAM_P2P_SEND_SD_RESPONSE;
|
|
||||||
|
|
||||||
typedef struct _PARAM_P2P_GET_SD_REQUEST {
|
|
||||||
PARAM_MAC_ADDRESS rTransmitterAddr;
|
|
||||||
UINT_16 u2PacketLength;
|
|
||||||
UINT_8 aucPacketContent[0]; /*native 802.11 */
|
|
||||||
} PARAM_P2P_GET_SD_REQUEST, *P_PARAM_P2P_GET_SD_REQUEST;
|
|
||||||
|
|
||||||
typedef struct _PARAM_P2P_GET_SD_REQUEST_EX {
|
|
||||||
PARAM_MAC_ADDRESS rTransmitterAddr;
|
|
||||||
UINT_16 u2PacketLength;
|
|
||||||
UINT_8 ucChannelNum; /* Channel Number Where SD Request is received. */
|
|
||||||
UINT_8 ucSeqNum; /* Get SD Request by sequence number. */
|
|
||||||
UINT_8 aucPacketContent[0]; /*native 802.11 */
|
|
||||||
} PARAM_P2P_GET_SD_REQUEST_EX, *P_PARAM_P2P_GET_SD_REQUEST_EX;
|
|
||||||
|
|
||||||
typedef struct _PARAM_P2P_SEND_SD_REQUEST {
|
|
||||||
PARAM_MAC_ADDRESS rReceiverAddr;
|
|
||||||
UINT_8 fgNeedTxDoneIndication;
|
|
||||||
UINT_8 ucVersionNum; /* Indicate the Service Discovery Supplicant Version. */
|
|
||||||
UINT_16 u2PacketLength;
|
|
||||||
UINT_8 aucPacketContent[0]; /*native 802.11 */
|
|
||||||
} PARAM_P2P_SEND_SD_REQUEST, *P_PARAM_P2P_SEND_SD_REQUEST;
|
|
||||||
|
|
||||||
/* Service Discovery 1.0. */
|
|
||||||
typedef struct _PARAM_P2P_GET_SD_RESPONSE {
|
|
||||||
PARAM_MAC_ADDRESS rTransmitterAddr;
|
|
||||||
UINT_16 u2PacketLength;
|
|
||||||
UINT_8 aucPacketContent[0]; /*native 802.11 */
|
|
||||||
} PARAM_P2P_GET_SD_RESPONSE, *P_PARAM_P2P_GET_SD_RESPONSE;
|
|
||||||
|
|
||||||
/* Service Discovery 2.0. */
|
|
||||||
typedef struct _PARAM_P2P_GET_SD_RESPONSE_EX {
|
|
||||||
PARAM_MAC_ADDRESS rTransmitterAddr;
|
|
||||||
UINT_16 u2PacketLength;
|
|
||||||
UINT_8 ucSeqNum; /* Get SD Response by sequence number. */
|
|
||||||
UINT_8 aucPacketContent[0]; /*native 802.11 */
|
|
||||||
} PARAM_P2P_GET_SD_RESPONSE_EX, *P_PARAM_P2P_GET_SD_RESPONSE_EX;
|
|
||||||
|
|
||||||
typedef struct _PARAM_P2P_TERMINATE_SD_PHASE {
|
|
||||||
PARAM_MAC_ADDRESS rPeerAddr;
|
|
||||||
} PARAM_P2P_TERMINATE_SD_PHASE, *P_PARAM_P2P_TERMINATE_SD_PHASE;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* P R I V A T E D A T A
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* M A C R O S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N D E C L A R A T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
/* Routines to handle command */
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetAddP2PKey(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
_wlanoidSetAddP2PTDLSKey(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetRemoveP2PKey(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetNetworkAddress(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetP2PMulticastList(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
/* Service Discovery Subroutines */
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSendP2PSDRequest(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSendP2PSDResponse(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidGetP2PSDRequest(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidGetP2PSDResponse(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen, OUT PUINT_32 puQueryInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetP2PTerminateSDPhase(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen, OUT PUINT_32 pu4QueryInfoLen);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_ANTI_PIRACY
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetSecCheckRequest(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidGetSecCheckResponse(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen, OUT PUINT_32 pu4QueryInfoLen);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetNoaParam(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetOppPsParam(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetUApsdParam(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidQueryP2pPowerSaveProfile(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen, OUT PUINT_32 pu4QueryInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetP2pPowerSaveProfile(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetP2pSetNetworkAddress(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidQueryP2pOpChannel(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen, OUT PUINT_32 pu4QueryInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidQueryP2pVersion(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen, OUT PUINT_32 pu4QueryInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetP2pSupplicantVersion(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvSetBuffer, IN UINT_32 u4SetBufferLen, OUT PUINT_32 pu4SetInfoLen);
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidSetP2pWPSmode(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen, OUT PUINT_32 pu4QueryInfoLen);
|
|
||||||
|
|
||||||
#if CFG_SUPPORT_P2P_RSSI_QUERY
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidQueryP2pRssi(IN P_ADAPTER_T prAdapter,
|
|
||||||
IN PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen, OUT PUINT_32 pu4QueryInfoLen);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
WLAN_STATUS
|
|
||||||
wlanoidAbortP2pScan(IN P_ADAPTER_T prAdapter,
|
|
||||||
OUT PVOID pvQueryBuffer, IN UINT_32 u4QueryBufferLen,
|
|
||||||
OUT PUINT_32 pu4QueryInfoLen);
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
/* Callbacks for event indication */
|
|
||||||
/*--------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
* F U N C T I O N S
|
|
||||||
********************************************************************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#endif /* _WLAN_P2P_H */
|
|
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue