mirror of
https://github.com/revyos/thead-kernel.git
synced 2026-06-21 09:12:26 +02:00
wifi is okay
This commit is contained in:
@@ -15,12 +15,28 @@ EXTRA_CFLAGS += -Wno-unused-variable
|
||||
#EXTRA_CFLAGS += -Wno-unused
|
||||
#EXTRA_CFLAGS += -Wno-uninitialized
|
||||
|
||||
############ ANDROID COMMON KERNEL ############
|
||||
# clang
|
||||
ifeq ($(CC), clang)
|
||||
EXTRA_CFLAGS += -Wno-uninitialized
|
||||
EXTRA_CFLAGS += -Wno-enum-conversion
|
||||
EXTRA_CFLAGS += -Wno-fortify-source
|
||||
EXTRA_CFLAGS += -Wno-invalid-source-encoding
|
||||
EXTRA_CFLAGS += -Wno-tautological-pointer-compare
|
||||
EXTRA_CFLAGS += -Wno-tautological-overlap-compare
|
||||
EXTRA_CFLAGS += -Wno-pointer-bool-conversion
|
||||
EXTRA_CFLAGS += -Wno-misleading-indentation
|
||||
EXTRA_CFLAGS += -Wno-parentheses-equality
|
||||
EXTRA_CFLAGS += -Wno-self-assign
|
||||
EXTRA_CFLAGS += -Wno-header-guard
|
||||
endif
|
||||
|
||||
GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )
|
||||
ifeq ($(GCC_VER_49),1)
|
||||
EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later
|
||||
endif
|
||||
|
||||
EXTRA_CFLAGS += -I$(srctree)/$(src)/include
|
||||
EXTRA_CFLAGS += -I$(src)/include
|
||||
|
||||
EXTRA_LDFLAGS += --strip-debug
|
||||
|
||||
@@ -46,6 +62,7 @@ CONFIG_RTL8822C = y
|
||||
CONFIG_RTL8814B = n
|
||||
CONFIG_RTL8814C = n
|
||||
CONFIG_RTL8723F = n
|
||||
CONFIG_RTL8822E = n
|
||||
######################### Interface ###########################
|
||||
CONFIG_USB_HCI = n
|
||||
CONFIG_PCI_HCI = n
|
||||
@@ -56,8 +73,8 @@ CONFIG_AP_MODE = y
|
||||
CONFIG_P2P = y
|
||||
CONFIG_MP_INCLUDED = y
|
||||
CONFIG_POWER_SAVING = y
|
||||
CONFIG_IPS_MODE = default
|
||||
CONFIG_LPS_MODE = default
|
||||
CONFIG_IPS_MODE = 0
|
||||
CONFIG_LPS_MODE = 0
|
||||
CONFIG_USB_AUTOSUSPEND = n
|
||||
CONFIG_HW_PWRP_DETECTION = n
|
||||
CONFIG_BT_COEXIST = y
|
||||
@@ -70,10 +87,31 @@ CONFIG_TXPWR_BY_RATE = y
|
||||
CONFIG_TXPWR_BY_RATE_EN = y
|
||||
CONFIG_TXPWR_LIMIT = y
|
||||
CONFIG_TXPWR_LIMIT_EN = n
|
||||
CONFIG_RTW_REGDB = rtk
|
||||
########################## Initial Channel Plan ##########################
|
||||
# XX: unspecified
|
||||
CONFIG_RTW_COUNTRY_CODE = XX
|
||||
# 0xFFFF: unspecified
|
||||
CONFIG_RTW_CHPLAN = 0xFFFF
|
||||
CONFIG_RTW_ADAPTIVITY_EN = disable
|
||||
CONFIG_RTW_ADAPTIVITY_MODE = normal
|
||||
CONFIG_80211D = n
|
||||
# 0xFFFF: unspecified
|
||||
CONFIG_RTW_CHPLAN_6G = 0xFFFF
|
||||
|
||||
########################## 802.11d (country IE slave) ##########################
|
||||
CONFIG_80211D = y
|
||||
# 0: disable, 1: enable, 2: enable when INIT/USER set world wide mode
|
||||
CONFIG_RTW_COUNTRY_IE_SLAVE_EN_MODE = 0
|
||||
# BIT0: take intersection when having multiple received IEs, otherwise choose effected one from received IEs
|
||||
# BIT1: consider all environment BSSs, otherwise associated BSSs only
|
||||
CONFIG_RTW_COUNTRY_IE_SLAVE_FLAGS = 0x01
|
||||
|
||||
########################## EDCCA for regulatory ##########################
|
||||
# NORMAL: Without regulatory consideration
|
||||
# CS : Force Carrier Sense
|
||||
# ADAPT : Force Adaptivity
|
||||
# CBP : Force Contention Based Protocol
|
||||
# AUTO : According to regulatory
|
||||
CONFIG_RTW_EDCCA_MODE_SEL = NORMAL
|
||||
|
||||
CONFIG_SIGNAL_SCALE_MAPPING = n
|
||||
CONFIG_80211W = y
|
||||
CONFIG_REDUCE_TX_CPU_LOADING = n
|
||||
@@ -91,10 +129,12 @@ CONFIG_ICMP_VOQ = n
|
||||
CONFIG_IP_R_MONITOR = n #arp VOQ and high rate
|
||||
# user priority mapping rule : tos, dscp
|
||||
CONFIG_RTW_UP_MAPPING_RULE = tos
|
||||
CONFIG_RTW_MBO = n
|
||||
CONFIG_RTW_MBO = y
|
||||
CONFIG_WAKE_ON_BT = n
|
||||
CONFIG_RTW_NBI = n
|
||||
|
||||
CONFIG_HIGH_PRIORITY_CMD_THREAD = n
|
||||
CONFIG_RTW_DISABLE_HW_PDN = n
|
||||
# CONFIG_RTKM - n/m/y for not support / standalone / built-in
|
||||
CONFIG_RTKM ?= n
|
||||
########################## Android ###########################
|
||||
# CONFIG_RTW_ANDROID - 0: no Android, 4/5/6/7/8/9/10/11 : Android version
|
||||
CONFIG_RTW_ANDROID = 0
|
||||
@@ -104,7 +144,7 @@ EXTRA_CFLAGS += -DCONFIG_RTW_ANDROID=$(CONFIG_RTW_ANDROID)
|
||||
endif
|
||||
|
||||
########################## Debug ###########################
|
||||
CONFIG_RTW_DEBUG = n
|
||||
CONFIG_RTW_DEBUG = y
|
||||
# default log level is _DRV_INFO_ = 4,
|
||||
# please refer to "How_to_set_driver_debug_log_level.doc" to set the available level.
|
||||
CONFIG_RTW_LOG_LEVEL = 4
|
||||
@@ -116,6 +156,8 @@ CONFIG_PROC_DEBUG = y
|
||||
CONFIG_WOWLAN = n
|
||||
#bit2: deauth, bit1: unicast, bit0: magic pkt.
|
||||
CONFIG_WAKEUP_TYPE = 0x7
|
||||
CONFIG_GOOGLE_CAST_WAKEUP = n
|
||||
CONFIG_WOW_IPS_MODE = default
|
||||
CONFIG_WOW_LPS_MODE = default
|
||||
#bit0: disBBRF off, #bit1: Wireless remote controller (WRC)
|
||||
CONFIG_SUSPEND_TYPE = 0
|
||||
@@ -130,9 +172,10 @@ CONFIG_ONE_PIN_GPIO = n
|
||||
CONFIG_HIGH_ACTIVE_HST2DEV = n
|
||||
CONFIG_PNO_SUPPORT = n
|
||||
CONFIG_PNO_SET_DEBUG = n
|
||||
CONFIG_MDNS_OFFLOAD = n
|
||||
CONFIG_AP_WOWLAN = n
|
||||
######### Notify SDIO Host Keep Power During Syspend ##########
|
||||
CONFIG_RTW_SDIO_PM_KEEP_POWER = n
|
||||
CONFIG_RTW_SDIO_PM_KEEP_POWER = y
|
||||
###################### MP HW TX MODE FOR VHT #######################
|
||||
CONFIG_MP_VHT_HW_TX_MODE = n
|
||||
###################### ROAMING #####################################
|
||||
@@ -141,11 +184,11 @@ CONFIG_LAYER2_ROAMING = y
|
||||
CONFIG_ROAMING_FLAG = 0x3
|
||||
####################### Security Memory ############################
|
||||
# Define for using dma_declare_coherent_memory DMA API.
|
||||
# User Must set the SECURITY_MEM_ADDR and SECURITY_MEM_SIZE.
|
||||
# If SECURITY_MEM_ADDR is NULL, driver will show WARN_ON for notification.
|
||||
CONFIG_SECURITY_MEM = n
|
||||
CONFIG_SECURITY_MEM_ADDR = 0
|
||||
CONFIG_SECURITY_MEM_SIZE = 3686400
|
||||
# User Must set the SECURE_DMA_MEM_ADDR and SECURE_DMA_MEM_SIZE.
|
||||
# If SECURE_DMA_MEM_ADDR is NULL, driver will show WARN_ON for notification.
|
||||
CONFIG_SECURE_DMA = n
|
||||
CONFIG_SECURE_DMA_MEM_ADDR = 0
|
||||
CONFIG_SECURE_DMA_MEM_SIZE = 3686400
|
||||
###################### Platform Related #######################
|
||||
CONFIG_PLATFORM_I386_PC = y
|
||||
CONFIG_PLATFORM_ANDROID_X86 = n
|
||||
@@ -209,6 +252,7 @@ CONFIG_PLATFORM_NV_TK1_UBUNTU = n
|
||||
CONFIG_PLATFORM_RTL8197D = n
|
||||
CONFIG_PLATFORM_AML_S905 = n
|
||||
CONFIG_PLATFORM_ZTE_ZX296716 = n
|
||||
CONFIG_PLATFORM_MTK9612 = n
|
||||
########### CUSTOMER ################################
|
||||
CONFIG_CUSTOMER_HUAWEI_GENERAL = n
|
||||
|
||||
@@ -244,6 +288,7 @@ _OS_INTFS_FILES := os_dep/osdep_service.o \
|
||||
os_dep/linux/recv_linux.o \
|
||||
os_dep/linux/ioctl_cfg80211.o \
|
||||
os_dep/linux/rtw_cfgvendor.o \
|
||||
os_dep/linux/os_ch_utils.o \
|
||||
os_dep/linux/wifi_regd.o \
|
||||
os_dep/linux/rtw_android.o \
|
||||
os_dep/linux/rtw_proc.o \
|
||||
@@ -271,6 +316,8 @@ _HAL_INTFS_FILES := hal/hal_intf.o \
|
||||
hal/hal_phy.o \
|
||||
hal/hal_dm.o \
|
||||
hal/hal_dm_acs.o \
|
||||
hal/hal_pwr_table.o \
|
||||
hal/hal_dfs.o \
|
||||
hal/hal_btcoex_wifionly.o \
|
||||
hal/hal_btcoex.o \
|
||||
hal/hal_mp.o \
|
||||
@@ -1027,6 +1074,24 @@ endif
|
||||
|
||||
endif
|
||||
|
||||
########### HAL_RTL8822E #################################
|
||||
ifeq ($(CONFIG_RTL8822E), y)
|
||||
RTL871X := rtl8822e
|
||||
ifeq ($(CONFIG_USB_HCI), y)
|
||||
ifeq ($(CONFIG_BT_COEXIST), n)
|
||||
MODULE_NAME = 8812eu
|
||||
else
|
||||
MODULE_NAME = 88x2eu
|
||||
endif
|
||||
endif
|
||||
ifeq ($(CONFIG_PCI_HCI), y)
|
||||
MODULE_NAME = 88x2ee
|
||||
endif
|
||||
ifeq ($(CONFIG_SDIO_HCI), y)
|
||||
MODULE_NAME = 88x2es
|
||||
endif
|
||||
endif
|
||||
|
||||
########### AUTO_CFG #################################
|
||||
|
||||
ifeq ($(CONFIG_AUTOCFG_CP), y)
|
||||
@@ -1078,6 +1143,9 @@ endif
|
||||
ifneq ($(CONFIG_LPS_MODE), default)
|
||||
EXTRA_CFLAGS += -DRTW_LPS_MODE=$(CONFIG_LPS_MODE)
|
||||
endif
|
||||
ifneq ($(CONFIG_WOW_IPS_MODE), default)
|
||||
EXTRA_CFLAGS += -DRTW_WOW_IPS_MODE=$(CONFIG_WOW_IPS_MODE)
|
||||
endif
|
||||
ifneq ($(CONFIG_WOW_LPS_MODE), default)
|
||||
EXTRA_CFLAGS += -DRTW_WOW_LPS_MODE=$(CONFIG_WOW_LPS_MODE)
|
||||
endif
|
||||
@@ -1162,9 +1230,15 @@ else ifeq ($(CONFIG_TXPWR_LIMIT_EN), auto)
|
||||
EXTRA_CFLAGS += -DCONFIG_TXPWR_LIMIT_EN=2
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_RTW_COUNTRY_CODE), XX)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_COUNTRY_CODE=\"$(CONFIG_RTW_COUNTRY_CODE)\"
|
||||
endif
|
||||
ifneq ($(CONFIG_RTW_CHPLAN), 0xFFFF)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_CHPLAN=$(CONFIG_RTW_CHPLAN)
|
||||
endif
|
||||
ifneq ($(CONFIG_RTW_CHPLAN_6G), 0xFFFF)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_CHPLAN_6G=$(CONFIG_RTW_CHPLAN_6G)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_CALIBRATE_TX_POWER_BY_REGULATORY
|
||||
@@ -1174,6 +1248,18 @@ ifeq ($(CONFIG_CALIBRATE_TX_POWER_TO_MAX), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_CALIBRATE_TX_POWER_TO_MAX
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RTW_EDCCA_MODE_SEL), NORMAL)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_EDCCA_MODE_SEL=0
|
||||
else ifeq ($(CONFIG_RTW_EDCCA_MODE_SEL), CS)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_EDCCA_MODE_SEL=1
|
||||
else ifeq ($(CONFIG_RTW_EDCCA_MODE_SEL), ADAPT)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_EDCCA_MODE_SEL=2
|
||||
else ifeq ($(CONFIG_RTW_EDCCA_MODE_SEL), CBP)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_EDCCA_MODE_SEL=3
|
||||
else ifeq ($(CONFIG_RTW_EDCCA_MODE_SEL), AUTO)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_EDCCA_MODE_SEL=0xFF
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RTW_ADAPTIVITY_EN), disable)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_ADAPTIVITY_EN=0
|
||||
else ifeq ($(CONFIG_RTW_ADAPTIVITY_EN), enable)
|
||||
@@ -1190,6 +1276,12 @@ endif
|
||||
|
||||
ifeq ($(CONFIG_80211D), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_80211D
|
||||
ifneq ($(CONFIG_RTW_COUNTRY_IE_SLAVE_EN_MODE), )
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_COUNTRY_IE_SLAVE_EN_MODE=$(CONFIG_RTW_COUNTRY_IE_SLAVE_EN_MODE)
|
||||
endif
|
||||
ifneq ($(CONFIG_RTW_COUNTRY_IE_SLAVE_FLAGS), )
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_COUNTRY_IE_SLAVE_FLAGS=$(CONFIG_RTW_COUNTRY_IE_SLAVE_FLAGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SIGNAL_SCALE_MAPPING), y)
|
||||
@@ -1203,6 +1295,9 @@ endif
|
||||
ifeq ($(CONFIG_WOWLAN), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_WOWLAN -DRTW_WAKEUP_EVENT=$(CONFIG_WAKEUP_TYPE)
|
||||
EXTRA_CFLAGS += -DRTW_SUSPEND_TYPE=$(CONFIG_SUSPEND_TYPE)
|
||||
ifeq ($(CONFIG_GOOGLE_CAST_WAKEUP), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_GOOGLE_CAST_WAKEUP
|
||||
endif
|
||||
ifeq ($(CONFIG_WOW_STA_MIX), y)
|
||||
EXTRA_CFLAGS += -DRTW_WOW_STA_MIX
|
||||
endif
|
||||
@@ -1232,6 +1327,10 @@ EXTRA_CFLAGS += -DCONFIG_PNO_SET_DEBUG
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MDNS_OFFLOAD), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_MDNS_OFFLOAD
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_GPIO_WAKEUP), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_GPIO_WAKEUP
|
||||
ifeq ($(CONFIG_ONE_PIN_GPIO), y)
|
||||
@@ -1254,11 +1353,11 @@ ifneq ($(CONFIG_WAKEUP_GPIO_IDX), default)
|
||||
EXTRA_CFLAGS += -DWAKEUP_GPIO_IDX=$(CONFIG_WAKEUP_GPIO_IDX)
|
||||
endif
|
||||
|
||||
#ifeq ($(CONFIG_RTW_SDIO_PM_KEEP_POWER), y)
|
||||
#ifeq ($(CONFIG_SDIO_HCI), y)
|
||||
#EXTRA_CFLAGS += -DCONFIG_RTW_SDIO_PM_KEEP_POWER
|
||||
#endif
|
||||
#endif
|
||||
ifeq ($(CONFIG_RTW_SDIO_PM_KEEP_POWER), y)
|
||||
ifeq ($(CONFIG_SDIO_HCI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_SDIO_PM_KEEP_POWER
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_REDUCE_TX_CPU_LOADING), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_REDUCE_TX_CPU_LOADING
|
||||
@@ -1349,26 +1448,31 @@ EXTRA_CFLAGS += -DDM_ODM_SUPPORT_TYPE=0x04
|
||||
ifeq ($(CONFIG_RTW_MBO), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_MBO -DCONFIG_RTW_80211K -DCONFIG_RTW_WNM -DCONFIG_RTW_BTM_ROAM
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_80211R
|
||||
EXTRA_CFLAGS += -DRTW_FT_DBG=0 -DRTW_WNM_DBG=0 -DRTW_MBO_DBG=0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_WAKE_ON_BT), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_WAKE_ON_BT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RTW_NBI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_NBI
|
||||
ifeq ($(CONFIG_HIGH_PRIORITY_CMD_THREAD), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_HIGH_PRIORITY_CMD_THREAD
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SECURITY_MEM), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_SECURITY_MEM
|
||||
EXTRA_CFLAGS += -DSECURITY_MEM_ADDR=$(CONFIG_SECURITY_MEM_ADDR)
|
||||
EXTRA_CFLAGS += -DSECURITY_MEM_SIZE=$(CONFIG_SECURITY_MEM_SIZE)
|
||||
ifeq ($(CONFIG_SECURE_DMA), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_SECURE_DMA
|
||||
EXTRA_CFLAGS += -DSECURE_DMA_MEM_ADDR=$(CONFIG_SECURE_DMA_MEM_ADDR)
|
||||
EXTRA_CFLAGS += -DSECURE_DMA_MEM_SIZE=$(CONFIG_SECURE_DMA_MEM_SIZE)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RTW_DISABLE_HW_PDN), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTW_DISABLE_HW_PDN
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_I386_PC), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_USB_INBAND
|
||||
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
|
||||
EXTRA_CFLAGS += -DCONFIG_RESUME_IN_WORKQUEUE
|
||||
EXTRA_CFLAGS += -DCONFIG_PLATFORM_I386_PC
|
||||
|
||||
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
|
||||
ARCH ?= $(SUBARCH)
|
||||
@@ -1817,6 +1921,12 @@ ifeq ($(CONFIG_SDIO_HCI), y)
|
||||
_PLATFORM_FILES += platform/platform_ARM_SUNxI_sdio.o
|
||||
endif
|
||||
|
||||
ifeq ($(shell test $(CONFIG_RTW_ANDROID) -ge 11; echo $$?), 0)
|
||||
# GKI build for Allwinner A527
|
||||
ARCH ?= arm64
|
||||
KSRC ?= $(KERNEL_SRC)
|
||||
else
|
||||
# Other Allwinner platform
|
||||
ARCH := arm
|
||||
#CROSS_COMPILE := arm-none-linux-gnueabi-
|
||||
CROSS_COMPILE=/home/android_sdk/Allwinner/a10/android-jb42/lichee-jb42/buildroot/output/external-toolchain/bin/arm-none-linux-gnueabi-
|
||||
@@ -1825,6 +1935,8 @@ KVER := 3.0.8
|
||||
KSRC=/home/android_sdk/Allwinner/a10/android-jb42/lichee-jb42/linux-3.0
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_SUN6I), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN6I
|
||||
@@ -2281,11 +2393,14 @@ endif
|
||||
ARCH ?= arm64
|
||||
CROSS_COMPILE ?= /4.4_S905L_8822bs_compile/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/bin/aarch64-linux-gnu-
|
||||
ifndef KSRC
|
||||
KSRC := /4.4_S905L_8822bs_compile/common
|
||||
############ ANDROID COMMON KERNEL ############
|
||||
KSRC := $(KERNEL_SRC)
|
||||
#KSRC := /4.4_S905L_8822bs_compile/common
|
||||
# To locate output files in a separate directory.
|
||||
KSRC += O=/4.4_S905L_8822bs_compile/KERNEL_OBJ
|
||||
#KSRC += O=/4.4_S905L_8822bs_compile/KERNEL_OBJ
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_RTL8822B), y)
|
||||
ifeq ($(CONFIG_SDIO_HCI), y)
|
||||
CONFIG_RTL8822BS ?= m
|
||||
@@ -2325,6 +2440,25 @@ endif
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_MTK9612), y)
|
||||
WLAN_DIR ?= /vendor/mediatek/proprietary_tv/apollo/linux_mts/ko_modules/wlan_driver/rtl8822cu
|
||||
ROOT_DIR ?= $(word 1, $(subst $(WLAN_DIR),, $(shell pwd)))
|
||||
#default setting for Special funcion
|
||||
KVER := 4.19
|
||||
KSRC =$(ROOT_DIR)/kernel/fusion/4.19
|
||||
CROSS_COMPILE=$(ROOT_DIR)/prebuilts/mtk_toolchain/linaro-4.9.3-2014.11-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
|
||||
export ARCH := arm
|
||||
MODULE_NAME := wlan_rtl8822cu
|
||||
EXTRA_CFLAGS += -DCONFIG_PLATFORM_MTK9612
|
||||
EXTRA_CFLAGS += -DCONFIG_HIGH_PRIORITY_CMD_THREAD
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DCONFIG_RADIO_WORK
|
||||
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
|
||||
#EXTRA_CFLAGS += -DCONFIG_DEBUG_CFG80211
|
||||
ifeq ($(CONFIG_USB_HCI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX -DCONFIG_FIX_NR_BULKIN_BUFFER
|
||||
endif
|
||||
endif
|
||||
########### CUSTOMER ################################
|
||||
ifeq ($(CONFIG_CUSTOMER_HUAWEI_GENERAL), y)
|
||||
CONFIG_CUSTOMER_HUAWEI = y
|
||||
@@ -2334,6 +2468,15 @@ ifeq ($(CONFIG_CUSTOMER_HUAWEI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_HUAWEI_PROC
|
||||
endif
|
||||
|
||||
############ ANDROID COMMON KERNEL ############
|
||||
export M ?= $(shell pwd)
|
||||
export OUT_DIR ?= $(shell pwd)
|
||||
ifneq ($(LLVM),)
|
||||
export CC_STRIP = llvm-strip
|
||||
else
|
||||
export CC_STRIP = $(CROSS_COMPILE)strip
|
||||
endif
|
||||
|
||||
CONFIG_PLATFORM_CMAP_INTFS = n
|
||||
ifeq ($(CONFIG_PLATFORM_CMAP_INTFS), y)
|
||||
PLATFORM_CMAP_INTFS_TYPE = 00
|
||||
@@ -2397,6 +2540,11 @@ ifeq ($(CONFIG_RTL8723F), y)
|
||||
include $(src)/rtl8723f.mk
|
||||
endif
|
||||
|
||||
########### HAL_RTL8822E #################################
|
||||
ifeq ($(CONFIG_RTL8822E), y)
|
||||
include $(src)/rtl8822e.mk
|
||||
endif
|
||||
|
||||
rtk_core := core/rtw_cmd.o \
|
||||
core/rtw_security.o \
|
||||
core/rtw_debug.o \
|
||||
@@ -2412,6 +2560,10 @@ rtk_core := core/rtw_cmd.o \
|
||||
core/rtw_pwrctrl.o \
|
||||
core/rtw_rf.o \
|
||||
core/rtw_chplan.o \
|
||||
core/rtw_regdb_$(CONFIG_RTW_REGDB).o \
|
||||
core/rtw_chset.o \
|
||||
core/rtw_dfs.o \
|
||||
core/rtw_txpwr.o \
|
||||
core/monitor/rtw_radiotap.o \
|
||||
core/rtw_recv.o \
|
||||
core/rtw_sta_mgt.o \
|
||||
@@ -2480,6 +2632,24 @@ endif
|
||||
|
||||
obj-$(CONFIG_RTL8822CS) := $(MODULE_NAME).o
|
||||
|
||||
############# MEMORY MANAGMENT #############
|
||||
ifneq ($(CONFIG_RTKM), n)
|
||||
_MEMM_FILES = core/rtw_prealloc.o
|
||||
ifeq ($(CONFIG_RTKM), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_RTKM -DCONFIG_RTKM_BUILT_IN
|
||||
EXTRA_CFLAGS += -DCONFIG_PREALLOC_RX_SKB_BUFFER
|
||||
$(MODULE_NAME)-y += $(_MEMM_FILES)
|
||||
else ifeq ($(CONFIG_RTKM), m)
|
||||
RTKM_MODULE = rtkm
|
||||
EXTRA_CFLAGS += -DCONFIG_RTKM -DCONFIG_RTKM_STANDALONE
|
||||
EXTRA_CFLAGS += -DCONFIG_PREALLOC_RX_SKB_BUFFER
|
||||
_MEMM_FILES += core/rtw_mem.o
|
||||
_MEMM_FILES += os_dep/osdep_service.o
|
||||
$(RTKM_MODULE)-y += $(_MEMM_FILES)
|
||||
obj-$(CONFIG_RTL8822CS) += $(RTKM_MODULE).o
|
||||
endif
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
export CONFIG_RTL8822CS = m
|
||||
@@ -2487,10 +2657,11 @@ export CONFIG_RTL8822CS = m
|
||||
all: modules
|
||||
|
||||
modules:
|
||||
$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules
|
||||
$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(M) modules
|
||||
# $(CC_STRIP) --strip-unneeded ${OUT_DIR}/$(M)/$(MODULE_NAME).ko
|
||||
|
||||
strip:
|
||||
$(CROSS_COMPILE)strip $(MODULE_NAME).ko --strip-unneeded
|
||||
$(CC_STRIP) $(MODULE_NAME).ko --strip-unneeded
|
||||
|
||||
install:
|
||||
install -p -m 644 $(MODULE_NAME).ko $(MODDESTDIR)
|
||||
@@ -2500,6 +2671,12 @@ uninstall:
|
||||
rm -f $(MODDESTDIR)/$(MODULE_NAME).ko
|
||||
/sbin/depmod -a ${KVER}
|
||||
|
||||
modules_install:
|
||||
$(MAKE) INSTALL_MOD_STRIP=1 M=$(M) -C $(KSRC) modules_install
|
||||
# mkdir -p ${OUT_DIR}/../vendor_lib/modules
|
||||
# cd ${OUT_DIR}/$(M)/; find -name $(MODULE_NAME).ko -exec cp {} ${OUT_DIR}/../vendor_lib/modules/ \;
|
||||
|
||||
|
||||
backup_rtlwifi:
|
||||
@echo "Making backup rtlwifi drivers"
|
||||
ifneq (,$(wildcard $(STAGINGMODDIR)/rtl*))
|
||||
@@ -2557,3 +2734,21 @@ clean:
|
||||
rm -fr .tmp_versions
|
||||
endif
|
||||
|
||||
|
||||
############ ANDROID COMMON KERNEL ############
|
||||
# Convert to absolute path
|
||||
ifneq ($(srctree),)
|
||||
_EXTRA_CFLAGS :=
|
||||
_INC_CFLAGS :=
|
||||
$(foreach flag,$(EXTRA_CFLAGS),\
|
||||
$(if $(shell echo $(flag) | grep "\-I"),\
|
||||
$(eval _INC_CFLAGS += $(flag)),\
|
||||
$(eval _EXTRA_CFLAGS += $(flag))\
|
||||
)\
|
||||
)
|
||||
_INC_CFLAGS := \
|
||||
$(foreach flag,$(subst -I,,$(_INC_CFLAGS)),\
|
||||
$(shell if test -d $(srctree)/$(flag); then echo -I$$(cd $(srctree)/$(flag) && pwd); else echo -I$(flag); fi)\
|
||||
)
|
||||
EXTRA_CFLAGS := $(_EXTRA_CFLAGS) $(_INC_CFLAGS)
|
||||
endif
|
||||
|
||||
@@ -40,7 +40,7 @@ static void aes_ccm_auth_start(void *aes, size_t M, size_t L, const u8 *nonce,
|
||||
WPA_PUT_BE16(&b[AES_BLOCK_SIZE - L], plain_len);
|
||||
|
||||
wpa_hexdump_key(_MSG_EXCESSIVE_, "CCM B_0", b, AES_BLOCK_SIZE);
|
||||
aes_encrypt1(aes, b, x); /* X_1 = E(K, B_0) */
|
||||
wpa_aes_encrypt(aes, b, x); /* X_1 = E(K, B_0) */
|
||||
|
||||
if (!aad_len)
|
||||
return;
|
||||
@@ -50,12 +50,12 @@ static void aes_ccm_auth_start(void *aes, size_t M, size_t L, const u8 *nonce,
|
||||
os_memset(aad_buf + 2 + aad_len, 0, sizeof(aad_buf) - 2 - aad_len);
|
||||
|
||||
xor_aes_block(aad_buf, x);
|
||||
aes_encrypt1(aes, aad_buf, x); /* X_2 = E(K, X_1 XOR B_1) */
|
||||
wpa_aes_encrypt(aes, aad_buf, x); /* X_2 = E(K, X_1 XOR B_1) */
|
||||
|
||||
if (aad_len > AES_BLOCK_SIZE - 2) {
|
||||
xor_aes_block(&aad_buf[AES_BLOCK_SIZE], x);
|
||||
/* X_3 = E(K, X_2 XOR B_2) */
|
||||
aes_encrypt1(aes, &aad_buf[AES_BLOCK_SIZE], x);
|
||||
wpa_aes_encrypt(aes, &aad_buf[AES_BLOCK_SIZE], x);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,13 +69,13 @@ static void aes_ccm_auth(void *aes, const u8 *data, size_t len, u8 *x)
|
||||
/* X_i+1 = E(K, X_i XOR B_i) */
|
||||
xor_aes_block(x, data);
|
||||
data += AES_BLOCK_SIZE;
|
||||
aes_encrypt1(aes, x, x);
|
||||
wpa_aes_encrypt(aes, x, x);
|
||||
}
|
||||
if (last) {
|
||||
/* XOR zero-padded last block */
|
||||
for (i = 0; i < last; i++)
|
||||
x[i] ^= *data++;
|
||||
aes_encrypt1(aes, x, x);
|
||||
wpa_aes_encrypt(aes, x, x);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,14 +98,14 @@ static void aes_ccm_encr(void *aes, size_t L, const u8 *in, size_t len, u8 *out,
|
||||
for (i = 1; i <= len / AES_BLOCK_SIZE; i++) {
|
||||
WPA_PUT_BE16(&a[AES_BLOCK_SIZE - 2], i);
|
||||
/* S_i = E(K, A_i) */
|
||||
aes_encrypt1(aes, a, out);
|
||||
wpa_aes_encrypt(aes, a, out);
|
||||
xor_aes_block(out, in);
|
||||
out += AES_BLOCK_SIZE;
|
||||
in += AES_BLOCK_SIZE;
|
||||
}
|
||||
if (last) {
|
||||
WPA_PUT_BE16(&a[AES_BLOCK_SIZE - 2], i);
|
||||
aes_encrypt1(aes, a, out);
|
||||
wpa_aes_encrypt(aes, a, out);
|
||||
/* XOR zero-padded last block */
|
||||
for (i = 0; i < last; i++)
|
||||
*out++ ^= *in++;
|
||||
@@ -121,7 +121,7 @@ static void aes_ccm_encr_auth(void *aes, size_t M, u8 *x, u8 *a, u8 *auth)
|
||||
wpa_hexdump_key(_MSG_EXCESSIVE_, "CCM T", x, M);
|
||||
/* U = T XOR S_0; S_0 = E(K, A_0) */
|
||||
WPA_PUT_BE16(&a[AES_BLOCK_SIZE - 2], 0);
|
||||
aes_encrypt1(aes, a, tmp);
|
||||
wpa_aes_encrypt(aes, a, tmp);
|
||||
for (i = 0; i < M; i++)
|
||||
auth[i] = x[i] ^ tmp[i];
|
||||
wpa_hexdump_key(_MSG_EXCESSIVE_, "CCM U", auth, M);
|
||||
@@ -136,7 +136,7 @@ static void aes_ccm_decr_auth(void *aes, size_t M, u8 *a, const u8 *auth, u8 *t)
|
||||
wpa_hexdump_key(_MSG_EXCESSIVE_, "CCM U", auth, M);
|
||||
/* U = T XOR S_0; S_0 = E(K, A_0) */
|
||||
WPA_PUT_BE16(&a[AES_BLOCK_SIZE - 2], 0);
|
||||
aes_encrypt1(aes, a, tmp);
|
||||
wpa_aes_encrypt(aes, a, tmp);
|
||||
for (i = 0; i < M; i++)
|
||||
t[i] = auth[i] ^ tmp[i];
|
||||
wpa_hexdump_key(_MSG_EXCESSIVE_, "CCM T", t, M);
|
||||
|
||||
@@ -36,7 +36,7 @@ int aes_ctr_encrypt(const u8 *key, size_t key_len, const u8 *nonce,
|
||||
os_memcpy(counter, nonce, AES_BLOCK_SIZE);
|
||||
|
||||
while (left > 0) {
|
||||
aes_encrypt1(ctx, counter, buf);
|
||||
wpa_aes_encrypt(ctx, counter, buf);
|
||||
|
||||
len = (left < AES_BLOCK_SIZE) ? left : AES_BLOCK_SIZE;
|
||||
for (j = 0; j < len; j++)
|
||||
|
||||
@@ -154,7 +154,7 @@ static void aes_gctr(void *aes, const u8 *icb, const u8 *x, size_t xlen, u8 *y)
|
||||
os_memcpy(cb, icb, AES_BLOCK_SIZE);
|
||||
/* Full blocks */
|
||||
for (i = 0; i < n; i++) {
|
||||
aes_encrypt1(aes, cb, ypos);
|
||||
wpa_aes_encrypt(aes, cb, ypos);
|
||||
xor_block(ypos, xpos);
|
||||
xpos += AES_BLOCK_SIZE;
|
||||
ypos += AES_BLOCK_SIZE;
|
||||
@@ -164,7 +164,7 @@ static void aes_gctr(void *aes, const u8 *icb, const u8 *x, size_t xlen, u8 *y)
|
||||
last = x + xlen - xpos;
|
||||
if (last) {
|
||||
/* Last, partial block */
|
||||
aes_encrypt1(aes, cb, tmp);
|
||||
wpa_aes_encrypt(aes, cb, tmp);
|
||||
for (i = 0; i < last; i++)
|
||||
*ypos++ = *xpos++ ^ tmp[i];
|
||||
}
|
||||
@@ -181,7 +181,7 @@ static void * aes_gcm_init_hash_subkey(const u8 *key, size_t key_len, u8 *H)
|
||||
|
||||
/* Generate hash subkey H = AES_K(0^128) */
|
||||
os_memset(H, 0, AES_BLOCK_SIZE);
|
||||
aes_encrypt1(aes, H, H);
|
||||
wpa_aes_encrypt(aes, H, H);
|
||||
wpa_hexdump_key(_MSG_EXCESSIVE_, "Hash subkey H for GHASH",
|
||||
H, AES_BLOCK_SIZE);
|
||||
return aes;
|
||||
|
||||
@@ -114,7 +114,7 @@ void * aes_encrypt_init(const u8 *key, size_t len)
|
||||
}
|
||||
|
||||
|
||||
int aes_encrypt1(void *ctx, const u8 *plain, u8 *crypt)
|
||||
int wpa_aes_encrypt(void *ctx, const u8 *plain, u8 *crypt)
|
||||
{
|
||||
u32 *rk = ctx;
|
||||
rijndaelEncrypt(ctx, rk[AES_PRIV_NR_POS], plain, crypt);
|
||||
|
||||
@@ -81,12 +81,12 @@ int omac1_aes_vector(const u8 *key, size_t key_len, size_t num_elem,
|
||||
}
|
||||
}
|
||||
if (left > AES_BLOCK_SIZE)
|
||||
aes_encrypt1(ctx, cbc, cbc);
|
||||
wpa_aes_encrypt(ctx, cbc, cbc);
|
||||
left -= AES_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
os_memset(pad, 0, AES_BLOCK_SIZE);
|
||||
aes_encrypt1(ctx, pad, pad);
|
||||
wpa_aes_encrypt(ctx, pad, pad);
|
||||
gf_mulx(pad);
|
||||
|
||||
if (left || total_len == 0) {
|
||||
@@ -110,7 +110,7 @@ int omac1_aes_vector(const u8 *key, size_t key_len, size_t num_elem,
|
||||
|
||||
for (i = 0; i < AES_BLOCK_SIZE; i++)
|
||||
pad[i] ^= cbc[i];
|
||||
aes_encrypt1(ctx, pad, mac);
|
||||
wpa_aes_encrypt(ctx, pad, mac);
|
||||
aes_encrypt_deinit(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define AES_BLOCK_SIZE 16
|
||||
|
||||
void * aes_encrypt_init(const u8 *key, size_t len);
|
||||
int aes_encrypt1(void *ctx, const u8 *plain, u8 *crypt);
|
||||
int wpa_aes_encrypt(void *ctx, const u8 *plain, u8 *crypt);
|
||||
void aes_encrypt_deinit(void *ctx);
|
||||
void * aes_decrypt_init(const u8 *key, size_t len);
|
||||
int aes_decrypt(void *ctx, const u8 *crypt, u8 *plain);
|
||||
|
||||
1519
drivers/net/wireless/rtl8822cs/core/def_module_country_chplan.h
Normal file
1519
drivers/net/wireless/rtl8822cs/core/def_module_country_chplan.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -36,8 +36,8 @@ u8 fakeBTEfuseContent[EFUSE_MAX_BT_BANK][EFUSE_MAX_HW_SIZE];
|
||||
u8 fakeBTEfuseInitMap[EFUSE_BT_MAX_MAP_LEN] = {0};
|
||||
u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN] = {0};
|
||||
|
||||
u8 maskfileBuffer[64];
|
||||
u8 btmaskfileBuffer[64];
|
||||
u8 maskfileBuffer[192];
|
||||
u8 btmaskfileBuffer[192];
|
||||
|
||||
/*------------------------Define local variable------------------------------*/
|
||||
BOOLEAN rtw_file_efuse_IsMasked(PADAPTER pAdapter, u16 Offset, u8 *maskbuf)
|
||||
@@ -89,6 +89,21 @@ BOOLEAN efuse_IsBT_Masked(PADAPTER pAdapter, u16 Offset)
|
||||
return (IS_BT_MASKED(8723F, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#endif /*#ifdef CONFIG_RTL8723F*/
|
||||
#ifdef CONFIG_RTL8822E
|
||||
#ifdef CONFIG_USB_HCI
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
return (IS_BT_MASKED(8822E, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
return (IS_BT_MASKED(8822E, _MPCIE, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
return (IS_BT_MASKED(8822E, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#endif /* CONFIG_RTL8822E */
|
||||
|
||||
#endif /* CONFIG_BT_EFUSE_MASK */
|
||||
return FALSE;
|
||||
}
|
||||
@@ -122,6 +137,21 @@ if (IS_HARDWARE_TYPE_8822CU(pAdapter))
|
||||
GET_BT_MASK_ARRAY(8723F, _MSDIO, pArray);
|
||||
#endif
|
||||
#endif /*#ifdef CONFIG_RTL8723F*/
|
||||
#ifdef CONFIG_RTL8822E
|
||||
#ifdef CONFIG_USB_HCI
|
||||
if (IS_HARDWARE_TYPE_8822EU(pAdapter))
|
||||
GET_BT_MASK_ARRAY(8822E, _MUSB, pArray);
|
||||
#endif
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
if (IS_HARDWARE_TYPE_8822EE(pAdapter))
|
||||
GET_BT_MASK_ARRAY(8822E, _MPCIE, pArray);
|
||||
#endif
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
if (IS_HARDWARE_TYPE_8822ES(pAdapter))
|
||||
GET_BT_MASK_ARRAY(8822E, _MSDIO, pArray);
|
||||
#endif
|
||||
#endif /* CONFIG_RTL8822E */
|
||||
|
||||
#endif /* CONFIG_BT_EFUSE_MASK */
|
||||
|
||||
}
|
||||
@@ -155,6 +185,21 @@ u16 rtw_get_bt_efuse_mask_arraylen(PADAPTER pAdapter)
|
||||
return GET_BT_MASK_ARRAY_LEN(8723F, _MSDIO);
|
||||
#endif
|
||||
#endif /*CONFIG_RTL8723F*/
|
||||
#ifdef CONFIG_RTL8822E
|
||||
#ifdef CONFIG_USB_HCI
|
||||
if (IS_HARDWARE_TYPE_8822EU(pAdapter))
|
||||
return GET_BT_MASK_ARRAY_LEN(8822E, _MUSB);
|
||||
#endif
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
if (IS_HARDWARE_TYPE_8822EE(pAdapter))
|
||||
return GET_BT_MASK_ARRAY_LEN(8822E, _MPCIE);
|
||||
#endif
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
if (IS_HARDWARE_TYPE_8822ES(pAdapter))
|
||||
return GET_BT_MASK_ARRAY_LEN(8822E, _MSDIO);
|
||||
#endif
|
||||
#endif /* CONFIG_RTL8822E */
|
||||
|
||||
#endif /* CONFIG_BT_EFUSE_MASK */
|
||||
|
||||
return 0;
|
||||
@@ -240,6 +285,10 @@ BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
|
||||
if (IS_HARDWARE_TYPE_8723F(pAdapter))
|
||||
return (IS_MASKED(8723F, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
return (IS_MASKED(8822E, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#endif /*CONFIG_USB_HCI*/
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
@@ -288,6 +337,10 @@ BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
|
||||
if (IS_HARDWARE_TYPE_8814B(pAdapter))
|
||||
return (IS_MASKED(8814B, _MPCIE, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
return (IS_MASKED(8822E, _MPCIE, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#endif /*CONFIG_PCI_HCI*/
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
@@ -335,6 +388,10 @@ BOOLEAN efuse_IsMasked(PADAPTER pAdapter, u16 Offset)
|
||||
if (IS_HARDWARE_TYPE_8723F(pAdapter))
|
||||
return (IS_MASKED(8723F, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
return (IS_MASKED(8822E, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#endif /*CONFIG_SDIO_HCI*/
|
||||
|
||||
return FALSE;
|
||||
@@ -404,6 +461,10 @@ void rtw_efuse_mask_array(PADAPTER pAdapter, u8 *pArray)
|
||||
if (IS_HARDWARE_TYPE_8723F(pAdapter))
|
||||
GET_MASK_ARRAY(8723F, _MUSB, pArray);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
GET_MASK_ARRAY(8822E, _MUSB, pArray);
|
||||
#endif
|
||||
#endif /*CONFIG_USB_HCI*/
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
@@ -451,6 +512,10 @@ void rtw_efuse_mask_array(PADAPTER pAdapter, u8 *pArray)
|
||||
if (IS_HARDWARE_TYPE_8814B(pAdapter))
|
||||
GET_MASK_ARRAY(8814B, _MPCIE, pArray);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
GET_MASK_ARRAY(8822E, _MPCIE, pArray);
|
||||
#endif
|
||||
#endif /*CONFIG_PCI_HCI*/
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
@@ -498,6 +563,10 @@ void rtw_efuse_mask_array(PADAPTER pAdapter, u8 *pArray)
|
||||
if (IS_HARDWARE_TYPE_8723F(pAdapter))
|
||||
GET_MASK_ARRAY(8723F, _MSDIO, pArray);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
GET_MASK_ARRAY(8822E , _MSDIO, pArray);
|
||||
#endif
|
||||
#endif /*CONFIG_SDIO_HCI*/
|
||||
}
|
||||
|
||||
@@ -566,6 +635,10 @@ u16 rtw_get_efuse_mask_arraylen(PADAPTER pAdapter)
|
||||
if (IS_HARDWARE_TYPE_8723F(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8723F, _MUSB);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8822E, _MUSB);
|
||||
#endif
|
||||
#endif /*CONFIG_USB_HCI*/
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
@@ -613,6 +686,10 @@ u16 rtw_get_efuse_mask_arraylen(PADAPTER pAdapter)
|
||||
if (IS_HARDWARE_TYPE_8814B(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8814B, _MPCIE);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8822E, _MPCIE);
|
||||
#endif
|
||||
#endif /*CONFIG_PCI_HCI*/
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
@@ -660,10 +737,53 @@ u16 rtw_get_efuse_mask_arraylen(PADAPTER pAdapter)
|
||||
if (IS_HARDWARE_TYPE_8723F(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8723F, _MSDIO);
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
return GET_MASK_ARRAY_LEN(8822E, _MSDIO);
|
||||
#endif
|
||||
#endif/*CONFIG_SDIO_HCI*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rtw_get_efuse_ver_array(PADAPTER pAdapter, u8 *pArray)
|
||||
{
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
GET_VER_ARRAY(8822E , _MUSB, pArray);
|
||||
#endif
|
||||
#endif/*CONFIG_USB_HCI*/
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
GET_VER_ARRAY(8822E , _MSDIO, pArray);
|
||||
#endif
|
||||
#endif/*CONFIG_SDIO_HCI*/
|
||||
|
||||
}
|
||||
|
||||
u16 rtw_get_efuse_ver_arraylen(PADAPTER pAdapter)
|
||||
{
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
return GET_VER_ARRAY_LEN(8822E, _MUSB);
|
||||
#endif
|
||||
#endif/*CONFIG_SDIO_HCI*/
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter))
|
||||
return GET_VER_ARRAY_LEN(8822E, _MSDIO);
|
||||
#endif
|
||||
#endif/*CONFIG_SDIO_HCI*/
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
static void rtw_mask_map_read(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
||||
{
|
||||
u16 i = 0;
|
||||
@@ -970,11 +1090,11 @@ void rtw_efuse_analyze(PADAPTER padapter, u8 Type, u8 Fake)
|
||||
for (i = 0; i < mapLen; i++) {
|
||||
if (i % 16 == 0)
|
||||
RTW_PRINT_SEL(RTW_DBGDUMP, "0x%03x: ", i);
|
||||
_RTW_PRINT_SEL(RTW_DBGDUMP, "%02X%s"
|
||||
, pEfuseHal->fakeEfuseInitMap[i]
|
||||
, ((i + 1) % 16 == 0) ? "\n" : (((i + 1) % 8 == 0) ? " " : " ")
|
||||
);
|
||||
}
|
||||
_RTW_PRINT_SEL(RTW_DBGDUMP, "%02X%s"
|
||||
, pEfuseHal->fakeEfuseInitMap[i]
|
||||
, ((i + 1) % 16 == 0) ? "\n" : (((i + 1) % 8 == 0) ? " " : " ")
|
||||
);
|
||||
}
|
||||
_RTW_PRINT_SEL(RTW_DBGDUMP, "\n");
|
||||
|
||||
out_free_buffer:
|
||||
@@ -1308,17 +1428,23 @@ u8 rtw_efuse_map_write(PADAPTER adapter, u16 addr, u16 cnts, u8 *data)
|
||||
{
|
||||
struct dvobj_priv *d;
|
||||
u8 *efuse = NULL;
|
||||
u32 alloc_size;
|
||||
u16 mask_alloc_size;
|
||||
u32 size;
|
||||
int err;
|
||||
u8 mask_buf[64] = "";
|
||||
u16 mask_len = sizeof(u8) * rtw_get_efuse_mask_arraylen(adapter);
|
||||
u8 *mask_buf = NULL;
|
||||
u8 *ver_buf = NULL;
|
||||
u16 mask_len = 0;
|
||||
u32 backupRegs[4] = {0};
|
||||
u8 status = _SUCCESS;;
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(adapter);
|
||||
PEFUSE_HAL pEfuseHal = &pHalData->EfuseHal;
|
||||
u8 status = _SUCCESS;
|
||||
|
||||
efuse_PreUpdateAction(adapter, backupRegs);
|
||||
|
||||
d = adapter_to_dvobj(adapter);
|
||||
err = rtw_halmac_get_logical_efuse_size(d, &size);
|
||||
RTW_INFO("halmac get log efuse size: %d\n", size);
|
||||
if (err) {
|
||||
status = _FAIL;
|
||||
goto exit;
|
||||
@@ -1329,15 +1455,47 @@ u8 rtw_efuse_map_write(PADAPTER adapter, u16 addr, u16 cnts, u8 *data)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
efuse = rtw_zmalloc(size);
|
||||
if (pEfuseHal->EfuseVerCompare == _TRUE)
|
||||
alloc_size = size + EFUSE_VER_LEN;
|
||||
else
|
||||
alloc_size = size;
|
||||
|
||||
efuse = rtw_zmalloc(alloc_size);
|
||||
if (!efuse) {
|
||||
status = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ver_buf = rtw_zmalloc(EFUSE_VER_LEN);
|
||||
if (!ver_buf) {
|
||||
status = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
_rtw_memset(ver_buf, 0, EFUSE_VER_LEN);
|
||||
rtw_get_efuse_ver_array(adapter, ver_buf);
|
||||
|
||||
|
||||
mask_len = sizeof(u8) * rtw_get_efuse_mask_arraylen(adapter);
|
||||
|
||||
if (pEfuseHal->EfuseVerCompare == _TRUE)
|
||||
mask_alloc_size = mask_len + EFUSE_VER_LEN;
|
||||
else
|
||||
mask_alloc_size = mask_len;
|
||||
|
||||
if (mask_alloc_size > 0) {
|
||||
mask_buf = rtw_zmalloc(mask_alloc_size);
|
||||
if (!mask_buf) {
|
||||
status = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
_rtw_memset(mask_buf, 0, mask_alloc_size);
|
||||
} else {
|
||||
RTW_INFO("Error mask alloc buf Len: %d\n", mask_alloc_size);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
err = rtw_halmac_read_logical_efuse_map(d, efuse, size, NULL, 0);
|
||||
if (err) {
|
||||
rtw_mfree(efuse, size);
|
||||
status = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
@@ -1348,29 +1506,48 @@ u8 rtw_efuse_map_write(PADAPTER adapter, u16 addr, u16 cnts, u8 *data)
|
||||
RTW_INFO("Use mask Array Len: %d\n", mask_len);
|
||||
|
||||
if (mask_len != 0) {
|
||||
if (adapter->registrypriv.bFileMaskEfuse == _TRUE)
|
||||
_rtw_memcpy(mask_buf, maskfileBuffer, mask_len);
|
||||
else
|
||||
if (adapter->registrypriv.bFileMaskEfuse == _TRUE) {
|
||||
|
||||
if (pEfuseHal->EfuseVerCompare == _TRUE) {
|
||||
_rtw_memcpy(mask_buf, maskfileBuffer, pEfuseHal->EfuseMaskUsedBytes);
|
||||
} else
|
||||
_rtw_memcpy(mask_buf, maskfileBuffer, mask_len);
|
||||
|
||||
} else {
|
||||
rtw_efuse_mask_array(adapter, mask_buf);
|
||||
|
||||
if (pEfuseHal->EfuseVerCompare == _TRUE) {
|
||||
_rtw_memcpy(mask_buf + mask_len, ver_buf, EFUSE_VER_LEN);
|
||||
_rtw_memcpy(efuse + size, ver_buf, EFUSE_VER_LEN);
|
||||
}
|
||||
}
|
||||
|
||||
err = rtw_halmac_write_logical_efuse_map(d, efuse, size, mask_buf, mask_len);
|
||||
} else
|
||||
err = rtw_halmac_write_logical_efuse_map(d, efuse, size, NULL, 0);
|
||||
} else {
|
||||
_rtw_memset(mask_buf, 0xFF, sizeof(mask_buf));
|
||||
_rtw_memset(mask_buf, 0xFF, mask_len);
|
||||
RTW_INFO("Efuse mask off\n");
|
||||
err = rtw_halmac_write_logical_efuse_map(d, efuse, size, mask_buf, size/16);
|
||||
if (pEfuseHal->EfuseVerCompare == _TRUE) {
|
||||
_rtw_memcpy(mask_buf + mask_len, ver_buf, EFUSE_VER_LEN);
|
||||
_rtw_memcpy(efuse + size, ver_buf, EFUSE_VER_LEN);
|
||||
mask_len = mask_len + EFUSE_VER_LEN;
|
||||
}
|
||||
err = rtw_halmac_write_logical_efuse_map(d, efuse, size, mask_buf, mask_len);
|
||||
}
|
||||
|
||||
if (err) {
|
||||
rtw_mfree(efuse, size);
|
||||
if (err)
|
||||
status = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
rtw_mfree(efuse, size);
|
||||
status = _SUCCESS;
|
||||
else
|
||||
status = _SUCCESS;
|
||||
exit :
|
||||
if (efuse)
|
||||
rtw_mfree(efuse, alloc_size);
|
||||
if (mask_buf)
|
||||
rtw_mfree(mask_buf, mask_alloc_size);
|
||||
if (ver_buf)
|
||||
rtw_mfree(ver_buf, EFUSE_VER_LEN);
|
||||
|
||||
efuse_PostUpdateAction(adapter, backupRegs);
|
||||
|
||||
return status;
|
||||
@@ -1668,7 +1845,7 @@ void hal_ReadEFuse_BT_logic_map(
|
||||
u8 efuseHeader, efuseExtHdr, efuseData;
|
||||
u8 offset, wden;
|
||||
u16 i, total, used;
|
||||
u8 efuse_usage;
|
||||
/*u8 efuse_usage;*/
|
||||
|
||||
|
||||
/* */
|
||||
@@ -1772,12 +1949,12 @@ void hal_ReadEFuse_BT_logic_map(
|
||||
total = EFUSE_BT_REAL_BANK_CONTENT_LEN;
|
||||
|
||||
used = eFuse_Addr - 1;
|
||||
|
||||
#if 0
|
||||
if (total)
|
||||
efuse_usage = (u8)((used * 100) / total);
|
||||
else
|
||||
efuse_usage = 100;
|
||||
|
||||
#endif
|
||||
fakeBTEfuseUsedBytes = used;
|
||||
RTW_INFO("%s: BTEfuseUsed last Bytes = %#x\n", __FUNCTION__, fakeBTEfuseUsedBytes);
|
||||
|
||||
@@ -3129,7 +3306,7 @@ EFUSE_ShadowRead(
|
||||
PADAPTER pAdapter,
|
||||
u8 Type,
|
||||
u16 Offset,
|
||||
u32 *Value)
|
||||
void *Value)
|
||||
{
|
||||
if (Type == 1)
|
||||
efuse_ShadowRead1Byte(pAdapter, Offset, (u8 *)Value);
|
||||
@@ -3369,23 +3546,23 @@ int retriveAdaptorInfoFile(char *path, u8 *efuse_data)
|
||||
}
|
||||
#endif /* CONFIG_ADAPTOR_INFO_CACHING_FILE */
|
||||
|
||||
u8 rtw_efuse_file_read(PADAPTER padapter, u8 *filepath, u8 *buf, u32 len)
|
||||
u32 rtw_efuse_file_read(PADAPTER padapter, u8 *filepath, u8 *buf, u32 len)
|
||||
{
|
||||
char *ptmpbuf = NULL, *ptr;
|
||||
u8 val8;
|
||||
u32 count, i, j;
|
||||
int err;
|
||||
u32 bufsize = 4096;
|
||||
u32 bufsize = 6656;
|
||||
|
||||
ptmpbuf = rtw_zmalloc(bufsize);
|
||||
if (ptmpbuf == NULL)
|
||||
return _FALSE;
|
||||
return 0;
|
||||
|
||||
count = rtw_retrieve_from_file(filepath, ptmpbuf, bufsize);
|
||||
if (count <= 90) {
|
||||
rtw_mfree(ptmpbuf, bufsize);
|
||||
RTW_ERR("%s, filepatch %s, size=%d, FAIL!!\n", __FUNCTION__, filepath, count);
|
||||
return _FALSE;
|
||||
return 0;
|
||||
}
|
||||
i = 0;
|
||||
j = 0;
|
||||
@@ -3410,14 +3587,14 @@ u8 rtw_efuse_file_read(PADAPTER padapter, u8 *filepath, u8 *buf, u32 len)
|
||||
RTW_WARN("Something wrong to parse efuse file, string=%s\n", &ptmpbuf[i]);
|
||||
} else {
|
||||
buf[j] = val8;
|
||||
RTW_DBG("i=%d, j=%d, 0x%02x\n", i, j, buf[j]);
|
||||
RTW_INFO("i=%d, j=%d, 0x%02x\n", i, j, buf[j]);
|
||||
j++;
|
||||
}
|
||||
i = ptr - ptmpbuf + 1;
|
||||
}
|
||||
rtw_mfree(ptmpbuf, bufsize);
|
||||
RTW_INFO("%s, filepatch %s, size=%d, done\n", __FUNCTION__, filepath, count);
|
||||
return _TRUE;
|
||||
RTW_INFO("%s,target len:%d filepatch %s, size=%d, done\n", __FUNCTION__,len , filepath, count);
|
||||
return j;
|
||||
}
|
||||
|
||||
#if !defined(CONFIG_RTW_ANDROID_GKI)
|
||||
|
||||
@@ -468,11 +468,11 @@ struct sta_info *rtw_mesh_acnode_prevent_pick_sacrifice(_adapter *adapter)
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
struct sta_info *sacrifice = NULL;
|
||||
|
||||
enter_critical_bh(&stapriv->asoc_list_lock);
|
||||
rtw_stapriv_asoc_list_lock(stapriv);
|
||||
|
||||
sacrifice = _rtw_mesh_acnode_prevent_pick_sacrifice(adapter);
|
||||
|
||||
exit_critical_bh(&stapriv->asoc_list_lock);
|
||||
rtw_stapriv_asoc_list_unlock(stapriv);
|
||||
|
||||
return sacrifice;
|
||||
}
|
||||
@@ -780,7 +780,7 @@ void rtw_mesh_peer_status_chk(_adapter *adapter)
|
||||
enter_critical_bh(&(plink_ctl->lock));
|
||||
|
||||
/* check established peers */
|
||||
enter_critical_bh(&stapriv->asoc_list_lock);
|
||||
rtw_stapriv_asoc_list_lock(stapriv);
|
||||
|
||||
head = &stapriv->asoc_list;
|
||||
list = get_next(head);
|
||||
@@ -843,14 +843,7 @@ void rtw_mesh_peer_status_chk(_adapter *adapter)
|
||||
|
||||
flush_add:
|
||||
if (flush) {
|
||||
rtw_list_delete(&sta->asoc_list);
|
||||
stapriv->asoc_list_cnt--;
|
||||
#ifdef CONFIG_RTW_TOKEN_BASED_XMIT
|
||||
if (sta->tbtx_enable)
|
||||
stapriv->tbtx_asoc_list_cnt--;
|
||||
#endif
|
||||
STA_SET_MESH_PLINK(sta, NULL);
|
||||
|
||||
rtw_stapriv_asoc_list_del(stapriv, sta);
|
||||
stainfo_offset = rtw_stainfo_offset(stapriv, sta);
|
||||
if (stainfo_offset_valid(stainfo_offset))
|
||||
flush_list[flush_num++] = stainfo_offset;
|
||||
@@ -859,7 +852,7 @@ flush_add:
|
||||
}
|
||||
}
|
||||
|
||||
exit_critical_bh(&stapriv->asoc_list_lock);
|
||||
rtw_stapriv_asoc_list_unlock(stapriv);
|
||||
|
||||
/* check non-established peers */
|
||||
for (i = 0; i < RTW_MESH_MAX_PEER_CANDIDATES; i++) {
|
||||
@@ -896,7 +889,7 @@ flush_add:
|
||||
sta = rtw_get_stainfo_by_offset(stapriv, flush_list[i]);
|
||||
_rtw_memcpy(sta_addr, sta->cmn.mac_addr, ETH_ALEN);
|
||||
|
||||
updated |= ap_free_sta(adapter, sta, _TRUE, WLAN_REASON_DEAUTH_LEAVING, _FALSE);
|
||||
updated |= ap_free_sta(adapter, sta, _TRUE, 0, WLAN_REASON_DEAUTH_LEAVING, _FALSE);
|
||||
rtw_mesh_expire_peer(adapter, sta_addr);
|
||||
}
|
||||
|
||||
@@ -998,7 +991,7 @@ exit:
|
||||
*/
|
||||
u8 rtw_mesh_select_operating_ch(_adapter *adapter)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
struct rtw_chset *chset = adapter_to_chset(adapter);
|
||||
struct rtw_mesh_cfg *mcfg = &adapter->mesh_cfg;
|
||||
struct mlme_priv *mlme = &adapter->mlmepriv;
|
||||
_queue *queue = &(mlme->scanned_queue);
|
||||
@@ -1036,11 +1029,11 @@ u8 rtw_mesh_select_operating_ch(_adapter *adapter)
|
||||
&& rtw_mesh_cto_mgate_network_filter(adapter, scanned)
|
||||
#endif
|
||||
) {
|
||||
int ch_set_idx = rtw_chset_search_ch(rfctl->channel_set, scanned->network.Configuration.DSConfig);
|
||||
int ch_set_idx = rtw_chset_search_ch(chset, scanned->network.Configuration.DSConfig);
|
||||
|
||||
if (ch_set_idx >= 0
|
||||
&& !(rfctl->channel_set[ch_set_idx].flags & RTW_CHF_NO_IR)
|
||||
&& !CH_IS_NON_OCP(&rfctl->channel_set[ch_set_idx])
|
||||
&& !(chset->chs[ch_set_idx].flags & RTW_CHF_NO_IR)
|
||||
&& !CH_IS_NON_OCP(&chset->chs[ch_set_idx])
|
||||
) {
|
||||
u8 nop, accept;
|
||||
|
||||
@@ -1048,13 +1041,13 @@ u8 rtw_mesh_select_operating_ch(_adapter *adapter)
|
||||
cand_cnt[ch_set_idx]++;
|
||||
if (max_cand_cnt < cand_cnt[ch_set_idx]) {
|
||||
max_cand_cnt = cand_cnt[ch_set_idx];
|
||||
max_cand_ch = rfctl->channel_set[ch_set_idx].ChannelNum;
|
||||
max_cand_ch = chset->chs[ch_set_idx].ChannelNum;
|
||||
}
|
||||
if (accept) {
|
||||
cand_ap_cnt[ch_set_idx]++;
|
||||
if (max_cand_ap_cnt < cand_ap_cnt[ch_set_idx]) {
|
||||
max_cand_ap_cnt = cand_ap_cnt[ch_set_idx];
|
||||
max_cand_ap_ch = rfctl->channel_set[ch_set_idx].ChannelNum;
|
||||
max_cand_ap_ch = chset->chs[ch_set_idx].ChannelNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1756,26 +1749,18 @@ bypass_sync_bss:
|
||||
|
||||
if (sac) {
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
_irqL irqL;
|
||||
u8 sta_addr[ETH_ALEN];
|
||||
u8 updated = _FALSE;
|
||||
|
||||
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
if (!rtw_is_list_empty(&sac->asoc_list)) {
|
||||
rtw_list_delete(&sac->asoc_list);
|
||||
stapriv->asoc_list_cnt--;
|
||||
#ifdef CONFIG_RTW_TOKEN_BASED_XMIT
|
||||
if (sac->tbtx_enable)
|
||||
stapriv->tbtx_asoc_list_cnt--;
|
||||
#endif
|
||||
STA_SET_MESH_PLINK(sac, NULL);
|
||||
}
|
||||
_exit_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(stapriv);
|
||||
if (!rtw_is_list_empty(&sac->asoc_list))
|
||||
rtw_stapriv_asoc_list_del(stapriv, sac);
|
||||
rtw_stapriv_asoc_list_unlock(stapriv);
|
||||
RTW_INFO(FUNC_ADPT_FMT" sacrifice "MAC_FMT" for acnode\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(sac->cmn.mac_addr));
|
||||
|
||||
_rtw_memcpy(sta_addr, sac->cmn.mac_addr, ETH_ALEN);
|
||||
updated = ap_free_sta(adapter, sac, 0, 0, 1);
|
||||
updated = ap_free_sta(adapter, sac, 0, 0, 0, 1);
|
||||
rtw_mesh_expire_peer(stapriv->padapter, sta_addr);
|
||||
|
||||
associated_clients_update(adapter, updated, STA_INFO_UPDATE_ALL);
|
||||
@@ -2477,13 +2462,9 @@ static int rtw_mesh_peer_establish(_adapter *adapter, struct mesh_plink_ent *pli
|
||||
u8 *tlv_ies;
|
||||
u16 tlv_ieslen;
|
||||
struct rtw_ieee802_11_elems elems;
|
||||
_irqL irqL;
|
||||
int i;
|
||||
u16 status = 0;
|
||||
int ret = _FAIL;
|
||||
#ifdef CONFIG_RTW_TOKEN_BASED_XMIT
|
||||
u8 sta_tbtx_enable = _FALSE;
|
||||
#endif
|
||||
|
||||
if (!plink->rx_conf_ies || !plink->rx_conf_ies_len) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" no rx confirm from sta "MAC_FMT"\n"
|
||||
@@ -2553,9 +2534,8 @@ static int rtw_mesh_peer_establish(_adapter *adapter, struct mesh_plink_ent *pli
|
||||
|
||||
#ifdef CONFIG_RTW_TOKEN_BASED_XMIT
|
||||
if (elems.tbtx_cap && elems.tbtx_cap_len != 0) {
|
||||
if(rtw_is_tbtx_capabilty(elems.tbtx_cap, elems.tbtx_cap_len)) {
|
||||
sta_tbtx_enable = _TRUE;
|
||||
}
|
||||
if(rtw_is_tbtx_capabilty(elems.tbtx_cap, elems.tbtx_cap_len))
|
||||
sta->tbtx_enable = _TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2583,21 +2563,14 @@ static int rtw_mesh_peer_establish(_adapter *adapter, struct mesh_plink_ent *pli
|
||||
sta->metrics.data_rate = 10;
|
||||
sta->alive = _TRUE;
|
||||
|
||||
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(stapriv);
|
||||
if (rtw_is_list_empty(&sta->asoc_list)) {
|
||||
STA_SET_MESH_PLINK(sta, plink);
|
||||
/* TBD: up layer timeout mechanism */
|
||||
/* sta->expire_to = mcfg->plink_timeout / 2; */
|
||||
rtw_list_insert_tail(&sta->asoc_list, &stapriv->asoc_list);
|
||||
stapriv->asoc_list_cnt++;
|
||||
#ifdef CONFIG_RTW_TOKEN_BASED_XMIT
|
||||
if (sta_tbtx_enable) {
|
||||
sta->tbtx_enable = _TRUE;
|
||||
stapriv->tbtx_asoc_list_cnt++;
|
||||
}
|
||||
#endif
|
||||
rtw_stapriv_asoc_list_add(stapriv, sta);
|
||||
}
|
||||
_exit_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(stapriv);
|
||||
|
||||
bss_cap_update_on_sta_join(adapter, sta);
|
||||
sta_info_update(adapter, sta);
|
||||
@@ -2617,7 +2590,6 @@ int rtw_mesh_set_plink_state(_adapter *adapter, const u8 *mac, u8 plink_state)
|
||||
_irqL irqL2;
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
struct sta_info *sta = NULL;
|
||||
_irqL irqL;
|
||||
struct sta_info *del_sta = NULL;
|
||||
int ret = _SUCCESS;
|
||||
|
||||
@@ -2640,17 +2612,10 @@ int rtw_mesh_set_plink_state(_adapter *adapter, const u8 *mac, u8 plink_state)
|
||||
|
||||
if (sac) {
|
||||
del_sta = sac;
|
||||
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
if (!rtw_is_list_empty(&del_sta->asoc_list)) {
|
||||
rtw_list_delete(&del_sta->asoc_list);
|
||||
stapriv->asoc_list_cnt--;
|
||||
#ifdef CONFIG_RTW_TOKEN_BASED_XMIT
|
||||
if (del_sta->tbtx_enable)
|
||||
stapriv->tbtx_asoc_list_cnt--;
|
||||
#endif
|
||||
STA_SET_MESH_PLINK(del_sta, NULL);
|
||||
}
|
||||
_exit_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(stapriv);
|
||||
if (!rtw_is_list_empty(&del_sta->asoc_list))
|
||||
rtw_stapriv_asoc_list_del(stapriv, del_sta);
|
||||
rtw_stapriv_asoc_list_unlock(stapriv);
|
||||
RTW_INFO(FUNC_ADPT_FMT" sacrifice "MAC_FMT" for acnode\n"
|
||||
, FUNC_ADPT_ARG(adapter), MAC_ARG(del_sta->cmn.mac_addr));
|
||||
}
|
||||
@@ -2681,17 +2646,10 @@ int rtw_mesh_set_plink_state(_adapter *adapter, const u8 *mac, u8 plink_state)
|
||||
if (!del_sta)
|
||||
goto release_plink_ctl;
|
||||
|
||||
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
if (!rtw_is_list_empty(&del_sta->asoc_list)) {
|
||||
rtw_list_delete(&del_sta->asoc_list);
|
||||
stapriv->asoc_list_cnt--;
|
||||
#ifdef CONFIG_RTW_TOKEN_BASED_XMIT
|
||||
if (del_sta->tbtx_enable)
|
||||
stapriv->tbtx_asoc_list_cnt--;
|
||||
#endif
|
||||
STA_SET_MESH_PLINK(del_sta, NULL);
|
||||
}
|
||||
_exit_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(stapriv);
|
||||
if (!rtw_is_list_empty(&del_sta->asoc_list))
|
||||
rtw_stapriv_asoc_list_del(stapriv, del_sta);
|
||||
rtw_stapriv_asoc_list_unlock(stapriv);
|
||||
}
|
||||
|
||||
release_plink_ctl:
|
||||
@@ -2702,7 +2660,7 @@ release_plink_ctl:
|
||||
u8 updated = _FALSE;
|
||||
|
||||
_rtw_memcpy(sta_addr, del_sta->cmn.mac_addr, ETH_ALEN);
|
||||
updated = ap_free_sta(adapter, del_sta, 0, 0, 1);
|
||||
updated = ap_free_sta(adapter, del_sta, 0, 0, 0, 1);
|
||||
rtw_mesh_expire_peer(stapriv->padapter, sta_addr);
|
||||
|
||||
associated_clients_update(adapter, updated, STA_INFO_UPDATE_ALL);
|
||||
@@ -2914,7 +2872,6 @@ exit:
|
||||
|
||||
u8 rtw_mesh_ps_annc(_adapter *adapter, u8 ps)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *head, *list;
|
||||
struct sta_info *sta;
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
@@ -2925,7 +2882,7 @@ u8 rtw_mesh_ps_annc(_adapter *adapter, u8 ps)
|
||||
if (rtw_linked_check(adapter) == _FALSE)
|
||||
goto exit;
|
||||
|
||||
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(stapriv);
|
||||
|
||||
head = &stapriv->asoc_list;
|
||||
list = get_next(head);
|
||||
@@ -2939,14 +2896,14 @@ u8 rtw_mesh_ps_annc(_adapter *adapter, u8 ps)
|
||||
if (stainfo_offset_valid(stainfo_offset))
|
||||
sta_alive_list[sta_alive_num++] = stainfo_offset;
|
||||
}
|
||||
_exit_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(stapriv);
|
||||
|
||||
for (i = 0; i < sta_alive_num; i++) {
|
||||
sta = rtw_get_stainfo_by_offset(stapriv, sta_alive_list[i]);
|
||||
if (!sta)
|
||||
continue;
|
||||
|
||||
issue_qos_nulldata(adapter, sta->cmn.mac_addr, 7, ps, 3, 500);
|
||||
issue_qos_nulldata(adapter, sta->cmn.mac_addr, 7, ps, 3, PS_ANNC_DRV_RETRY_INT_MS);
|
||||
annc_cnt++;
|
||||
}
|
||||
|
||||
@@ -3551,7 +3508,6 @@ static bool rtw_mesh_data_bmc_to_uc(_adapter *adapter
|
||||
{
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
struct xmit_priv *xmitpriv = &adapter->xmitpriv;
|
||||
_irqL irqL;
|
||||
_list *head, *list;
|
||||
struct sta_info *sta;
|
||||
char b2u_sta_id[NUM_STA];
|
||||
@@ -3559,7 +3515,7 @@ static bool rtw_mesh_data_bmc_to_uc(_adapter *adapter
|
||||
bool bmc_need = _FALSE;
|
||||
int i;
|
||||
|
||||
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(stapriv);
|
||||
head = &stapriv->asoc_list;
|
||||
list = get_next(head);
|
||||
|
||||
@@ -3573,7 +3529,7 @@ static bool rtw_mesh_data_bmc_to_uc(_adapter *adapter
|
||||
if (stainfo_offset_valid(stainfo_offset))
|
||||
b2u_sta_id[b2u_sta_num++] = stainfo_offset;
|
||||
}
|
||||
_exit_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(stapriv);
|
||||
|
||||
if (!b2u_sta_num)
|
||||
goto exit;
|
||||
|
||||
@@ -93,6 +93,16 @@
|
||||
#define IEEE80211_RADIOTAP_AMPDU_EOF_KNOWN 0x0080
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22))
|
||||
/* For IEEE80211_RADIOTAP_TX_FLAGS */
|
||||
#define IEEE80211_RADIOTAP_F_TX_FAIL 0x0001 /* failed due to excessive
|
||||
* retries */
|
||||
#define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */
|
||||
#define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */
|
||||
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0))
|
||||
#define IEEE80211_RADIOTAP_F_TX_NOACK 0x0008 /* don't expect an ack */
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39))
|
||||
#define IEEE80211_RADIOTAP_MCS 19
|
||||
/* For IEEE80211_RADIOTAP_MCS */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -499,7 +499,7 @@ void expire_timeout_chk(_adapter *padapter)
|
||||
psta = NULL;
|
||||
}
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(pstapriv);
|
||||
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
@@ -673,7 +673,7 @@ void expire_timeout_chk(_adapter *padapter)
|
||||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(pstapriv);
|
||||
|
||||
if (chk_alive_num) {
|
||||
#if defined(CONFIG_ACTIVE_KEEP_ALIVE_CHECK)
|
||||
@@ -751,17 +751,10 @@ void expire_timeout_chk(_adapter *padapter)
|
||||
|
||||
psta->keep_alive_trycnt = 0;
|
||||
del_asoc_list[i] = chk_alive_list[i];
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
if (rtw_is_list_empty(&psta->asoc_list) == _FALSE) {
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
pstapriv->asoc_list_cnt--;
|
||||
#ifdef CONFIG_RTW_TOKEN_BASED_XMIT
|
||||
if (psta->tbtx_enable)
|
||||
pstapriv->tbtx_asoc_list_cnt--;
|
||||
#endif
|
||||
STA_SET_MESH_PLINK(psta, NULL);
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(pstapriv);
|
||||
if (rtw_is_list_empty(&psta->asoc_list) == _FALSE)
|
||||
rtw_stapriv_asoc_list_del(pstapriv, psta);
|
||||
rtw_stapriv_asoc_list_unlock(pstapriv);
|
||||
}
|
||||
|
||||
/* delete loop */
|
||||
@@ -776,7 +769,7 @@ void expire_timeout_chk(_adapter *padapter)
|
||||
|
||||
RTW_INFO(FUNC_ADPT_FMT" asoc expire "MAC_FMT", state=0x%x\n"
|
||||
, FUNC_ADPT_ARG(padapter), MAC_ARG(psta->cmn.mac_addr), psta->state);
|
||||
updated |= ap_free_sta(padapter, psta, _FALSE, WLAN_REASON_DEAUTH_LEAVING, _FALSE);
|
||||
updated |= ap_free_sta(padapter, psta, _FALSE, 0, WLAN_REASON_DEAUTH_LEAVING, _FALSE);
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
if (MLME_IS_MESH(padapter))
|
||||
rtw_mesh_expire_peer(padapter, sta_addr);
|
||||
@@ -847,13 +840,12 @@ void rtw_ap_update_sta_ra_info(_adapter *padapter, struct sta_info *psta)
|
||||
#ifdef CONFIG_BMC_TX_RATE_SELECT
|
||||
u8 rtw_ap_find_mini_tx_rate(_adapter *adapter)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
u8 miini_tx_rate = ODM_RATEVHTSS4MCS9, sta_tx_rate;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(pstapriv);
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
|
||||
@@ -864,7 +856,7 @@ u8 rtw_ap_find_mini_tx_rate(_adapter *adapter)
|
||||
if (sta_tx_rate < miini_tx_rate)
|
||||
miini_tx_rate = sta_tx_rate;
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(pstapriv);
|
||||
|
||||
return miini_tx_rate;
|
||||
}
|
||||
@@ -1102,6 +1094,35 @@ void update_sta_info_apmode_ht_bf_cap(_adapter *padapter, struct sta_info *psta)
|
||||
}
|
||||
#endif /*CONFIG_80211N_HT && CONFIG_BEAMFORMING*/
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
void update_sta_bw_apmode(_adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct ht_priv *phtpriv_ap = &pmlmepriv->htpriv;
|
||||
struct ht_priv *phtpriv_sta = &psta->htpriv;
|
||||
|
||||
if (phtpriv_sta->ht_option) {
|
||||
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH))
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_40;
|
||||
else
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_20;
|
||||
|
||||
if (phtpriv_sta->op_present
|
||||
&& !GET_HT_OP_ELE_STA_CHL_WIDTH(phtpriv_sta->ht_op))
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_20;
|
||||
|
||||
if ((psta->ht_40mhz_intolerant)||(pmlmepriv->sw_to_20mhz))
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_20;
|
||||
|
||||
if (pmlmeext->cur_bwmode < psta->cmn.bw_mode)
|
||||
psta->cmn.bw_mode = pmlmeext->cur_bwmode;
|
||||
|
||||
phtpriv_sta->ch_offset = pmlmepriv->sw_to_20mhz ? CHAN_OFFSET_NO_EXT : pmlmeext->cur_ch_offset;
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
|
||||
/* notes:
|
||||
* AID: 1~MAX for sta and 0 for bc/mc in ap/adhoc mode */
|
||||
void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
|
||||
@@ -1140,24 +1161,7 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta)
|
||||
|
||||
phtpriv_sta->rx_ampdu_min_spacing = (phtpriv_sta->ht_cap.ampdu_params_info & IEEE80211_HT_CAP_AMPDU_DENSITY) >> 2;
|
||||
|
||||
/* bwmode */
|
||||
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH))
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_40;
|
||||
else
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_20;
|
||||
|
||||
if (phtpriv_sta->op_present
|
||||
&& !GET_HT_OP_ELE_STA_CHL_WIDTH(phtpriv_sta->ht_op))
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_20;
|
||||
|
||||
if ((psta->ht_40mhz_intolerant)||(pmlmepriv->sw_to_20mhz))
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_20;
|
||||
|
||||
if (pmlmeext->cur_bwmode < psta->cmn.bw_mode)
|
||||
psta->cmn.bw_mode = pmlmeext->cur_bwmode;
|
||||
|
||||
phtpriv_sta->ch_offset = pmlmeext->cur_ch_offset;
|
||||
|
||||
update_sta_bw_apmode(padapter, psta);
|
||||
|
||||
/* check if sta support s Short GI 20M */
|
||||
if ((phtpriv_sta->ht_cap.cap_info & phtpriv_ap->ht_cap.cap_info) & cpu_to_le16(IEEE80211_HT_CAP_SGI_20))
|
||||
@@ -1673,6 +1677,7 @@ void start_bss_network(_adapter *padapter, struct createbss_parm *parm)
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
WLAN_BSSID_EX *pnetwork_mlmeext = &(pmlmeinfo->network);
|
||||
struct dvobj_priv *pdvobj = padapter->dvobj;
|
||||
struct rf_ctl_t *rfctl = dvobj_to_rfctl(pdvobj);
|
||||
s16 req_ch = REQ_CH_NONE, req_bw = REQ_BW_NONE, req_offset = REQ_OFFSET_NONE;
|
||||
u8 u_ch = 0, u_bw, u_offset;
|
||||
bool set_u_ch;
|
||||
@@ -1681,6 +1686,9 @@ void start_bss_network(_adapter *padapter, struct createbss_parm *parm)
|
||||
u8 chbw_allow = _TRUE;
|
||||
int i;
|
||||
u8 ifbmp_ch_changed = 0;
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
u8 start_mcc_ret = NO_NEED_MCC;
|
||||
#endif
|
||||
|
||||
if (parm->req_ch != 0) {
|
||||
/* bypass other setting, go checking ch, bw, offset */
|
||||
@@ -1775,8 +1783,8 @@ chbw_decision:
|
||||
rtw_set_hw_wmm_param(pdvobj->padapters[i]);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DFS_MASTER)
|
||||
rtw_dfs_rd_en_decision(padapter, mlme_act, parm->excl_ifbmp);
|
||||
#if CONFIG_DFS && CONFIG_IEEE80211_BAND_5GHZ
|
||||
rtw_dfs_rd_en_dec_on_mlme_act(padapter, NULL, mlme_act, parm->excl_ifbmp);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
@@ -1804,15 +1812,20 @@ chbw_decision:
|
||||
rtw_hal_set_hwreg(padapter , HW_VAR_DO_IQK , &doiqk);
|
||||
}
|
||||
|
||||
if (set_u_ch)
|
||||
if (set_u_ch
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
|| (MCC_EN(padapter) && chbw_allow == _FALSE)
|
||||
#endif
|
||||
)
|
||||
set_channel_bwmode(padapter, u_ch, u_offset, u_bw);
|
||||
|
||||
doiqk = _FALSE;
|
||||
rtw_hal_set_hwreg(padapter , HW_VAR_DO_IQK , &doiqk);
|
||||
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
start_mcc_ret = rtw_hal_set_mcc_setting_start_bss_network(padapter, chbw_allow);
|
||||
/* after set_channel_bwmode for backup IQK */
|
||||
if (rtw_hal_set_mcc_setting_start_bss_network(padapter, chbw_allow) == _FAIL) {
|
||||
if (start_mcc_ret == _FAIL) {
|
||||
/* MCC setting fail, update to buddy's channel */
|
||||
rtw_mi_get_ch_setting_union_no_self(padapter, &u_ch, &u_bw, &u_offset);
|
||||
pnetwork->Configuration.DSConfig = u_ch;
|
||||
@@ -1833,6 +1846,9 @@ chbw_decision:
|
||||
, padapter->mlmeextpriv.cur_ch_offset
|
||||
, ht_option, 0);
|
||||
}
|
||||
} else if (start_mcc_ret == NO_NEED_MCC) {
|
||||
RTW_INFO(FUNC_ADPT_FMT": NO_NEED_MCC\n"
|
||||
, FUNC_ADPT_ARG(padapter));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1857,7 +1873,7 @@ chbw_decision:
|
||||
}
|
||||
#endif /* defined(CONFIG_IOCTL_CFG80211) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)) */
|
||||
|
||||
rtw_rfctl_update_op_mode(adapter_to_rfctl(padapter), parm->ifbmp, 1);
|
||||
rtw_rfctl_update_op_mode(adapter_to_rfctl(padapter), parm->ifbmp, 1, parm->excl_ifbmp);
|
||||
|
||||
if (DUMP_ADAPTERS_STATUS) {
|
||||
RTW_INFO(FUNC_ADPT_FMT" done\n", FUNC_ADPT_ARG(padapter));
|
||||
@@ -1928,8 +1944,11 @@ update_beacon:
|
||||
rtw_scan_wait_completed(padapter);
|
||||
|
||||
_rtw_iface_undersurvey_chk(__func__, padapter);
|
||||
|
||||
/* send beacon */
|
||||
ResumeTxBeacon(padapter);
|
||||
if (rfctl->ap_csa_en == AP_CSA_DISABLE)
|
||||
ResumeTxBeacon(padapter);
|
||||
|
||||
{
|
||||
#if !defined(CONFIG_INTERRUPT_BASED_TXBCN)
|
||||
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) || defined(CONFIG_PCI_BCN_POLLING)
|
||||
@@ -2090,7 +2109,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
||||
if (p && ie_len != 0)
|
||||
pmlmepriv->active_tpc_report = 1;
|
||||
else if (REGSTY_IS_ACTIVE_TPC_REPORT_AUTO(pregistrypriv)) {
|
||||
rtw_set_ie_tpc_report(pbss_network->IEs + pbss_network->IELength, &pbss_network->IELength, 0, 0);
|
||||
rtw_bss_ex_set_tpc_report(pbss_network, 0, 0);
|
||||
pmlmepriv->active_tpc_report = 1;
|
||||
}
|
||||
}
|
||||
@@ -2504,6 +2523,14 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
||||
pbss_network->Configuration.DSConfig <= 14 && padapter->registrypriv.wifi_spec == 1 &&
|
||||
pbss_network->IELength + 10 <= MAX_IE_SZ) {
|
||||
|
||||
#ifdef CONFIG_RTW_WNM
|
||||
rtw_wnm_add_btm_ext_cap(pmlmepriv->ext_capab_ie_data,
|
||||
&(pmlmepriv->ext_capab_ie_len));
|
||||
#endif
|
||||
#ifdef CONFIG_RTW_MBO
|
||||
rtw_mbo_add_internw_ext_cap(pmlmepriv->ext_capab_ie_data,
|
||||
&(pmlmepriv->ext_capab_ie_len));
|
||||
#endif
|
||||
rtw_add_ext_cap_info(pmlmepriv->ext_capab_ie_data, &(pmlmepriv->ext_capab_ie_len), BSS_COEXT);
|
||||
rtw_update_ext_cap_ie(pmlmepriv->ext_capab_ie_data, pmlmepriv->ext_capab_ie_len, pbss_network->IEs, \
|
||||
&(pbss_network->IELength), _BEACON_IE_OFFSET_);
|
||||
@@ -3025,14 +3052,13 @@ static void associated_stainfo_update(_adapter *padapter, struct sta_info *psta,
|
||||
RTW_INFO("%s: "MAC_FMT", updated_type=0x%x\n", __func__, MAC_ARG(psta->cmn.mac_addr), sta_info_type);
|
||||
#ifdef CONFIG_80211N_HT
|
||||
if (sta_info_type & STA_INFO_UPDATE_BW) {
|
||||
|
||||
if ((psta->flags & WLAN_STA_HT) && !psta->ht_20mhz_set) {
|
||||
if (pmlmepriv->sw_to_20mhz) {
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_20;
|
||||
/*psta->htpriv.ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;*/
|
||||
psta->htpriv.sgi_40m = _FALSE;
|
||||
} else {
|
||||
/*TODO: Switch back to 40MHZ?80MHZ*/
|
||||
if ((pmlmepriv->sw_to_20mhz && psta->cmn.bw_mode != CHANNEL_WIDTH_20)
|
||||
|| (!pmlmepriv->sw_to_20mhz && psta->cmn.bw_mode == CHANNEL_WIDTH_20)
|
||||
) {
|
||||
update_sta_bw_apmode(padapter, psta);
|
||||
psta->cmn.ra_info.is_support_sgi = query_ra_short_GI(psta, rtw_get_tx_bw_mode(padapter, psta));
|
||||
rtw_dm_ra_mask_wk_cmd(padapter, psta);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3327,6 +3353,9 @@ static void ap_process_csa(_adapter *padapter)
|
||||
if (rfctl->ap_csa_switch_cnt != 0)
|
||||
return;
|
||||
|
||||
/* Stop beacon until update beacon from hostapd */
|
||||
bcn_control_cmd(padapter, 0);
|
||||
|
||||
if (rfctl->ap_csa_en == AP_SWITCH_CH_CSA) {
|
||||
ifbmp = BIT(padapter->iface_id);
|
||||
rtw_change_bss_chbw_cmd(padapter, 0, ifbmp, 0, rfctl->ap_csa_ch,
|
||||
@@ -3459,7 +3488,15 @@ static u8 update_ecsa_ie(_adapter *padapter, bool *process_ecsa)
|
||||
|
||||
static void update_bcn_vendor_spec_ie(_adapter *padapter, u8 *oui)
|
||||
{
|
||||
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
if (MCC_EN(padapter)) {
|
||||
if (!rtw_hal_check_mcc_status(padapter, MCC_STATUS_DOING_MCC))
|
||||
RTW_INFO("%s\n", __FUNCTION__);
|
||||
}
|
||||
#else
|
||||
RTW_INFO("%s\n", __FUNCTION__);
|
||||
#endif
|
||||
|
||||
if (_rtw_memcmp(RTW_WPA_OUI, oui, 4))
|
||||
update_bcn_wpa_ie(padapter);
|
||||
@@ -3591,18 +3628,17 @@ void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_l
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
u8 *frame_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
uint frame_body_len = frame_len - sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
u8 category, action;
|
||||
/*u8 category, action;*/
|
||||
struct macid_ctl_t *macid_ctl = &padapter->dvobj->macid_ctl;
|
||||
int i;
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, get_addr2_ptr(pframe));
|
||||
if (psta == NULL)
|
||||
return;
|
||||
|
||||
|
||||
#if 0
|
||||
category = frame_body[0];
|
||||
action = frame_body[1];
|
||||
|
||||
#endif
|
||||
if (frame_body_len > 0) {
|
||||
if ((frame_body[2] == EID_BSSCoexistence) && (frame_body[3] > 0)) {
|
||||
u8 ie_data = frame_body[4];
|
||||
@@ -3635,23 +3671,9 @@ void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_l
|
||||
}
|
||||
|
||||
if (beacon_updated) {
|
||||
|
||||
update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE, 0);
|
||||
|
||||
associated_stainfo_update(padapter, psta, STA_INFO_UPDATE_BW);
|
||||
if (pmlmepriv->sw_to_20mhz) {
|
||||
for (i = 0; i < MACID_NUM_SW_LIMIT; i++) {
|
||||
psta = macid_ctl->sta[i];
|
||||
if (psta && !is_broadcast_mac_addr(psta->cmn.mac_addr)) {
|
||||
psta->cmn.bw_mode = CHANNEL_WIDTH_20;
|
||||
rtw_dm_ra_mask_wk_cmd(padapter, (u8 *)psta);
|
||||
}
|
||||
}
|
||||
}
|
||||
associated_clients_update(padapter, _TRUE, STA_INFO_UPDATE_BW);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void rtw_process_ht_action_smps(_adapter *padapter, u8 *ta, u8 ctrl_field)
|
||||
@@ -3772,12 +3794,11 @@ void associated_clients_update(_adapter *padapter, u8 updated, u32 sta_info_type
|
||||
{
|
||||
/* update associcated stations cap. */
|
||||
if (updated == _TRUE) {
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(pstapriv);
|
||||
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
@@ -3791,7 +3812,7 @@ void associated_clients_update(_adapter *padapter, u8 updated, u32 sta_info_type
|
||||
associated_stainfo_update(padapter, psta, sta_info_type);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(pstapriv);
|
||||
|
||||
}
|
||||
|
||||
@@ -4062,6 +4083,7 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta)
|
||||
if (rtw_ht_operation_update(padapter) > 0) {
|
||||
update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE, 0);
|
||||
update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _FALSE, 0);
|
||||
beacon_updated = _TRUE;
|
||||
}
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
|
||||
@@ -4088,7 +4110,7 @@ u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta)
|
||||
|
||||
}
|
||||
|
||||
u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reason, bool enqueue)
|
||||
u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u8 subtype, u16 reason, bool enqueue)
|
||||
{
|
||||
_irqL irqL;
|
||||
u8 beacon_updated = _FALSE;
|
||||
@@ -4106,8 +4128,12 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso
|
||||
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
|
||||
if (!MLME_IS_MESH(padapter))
|
||||
issue_deauth(padapter, psta->cmn.mac_addr, reason);
|
||||
if (!MLME_IS_MESH(padapter)) {
|
||||
if (subtype == RTW_IEEE80211_STYPE_DISASSOC >> 4)
|
||||
issue_disasoc(padapter, psta->cmn.mac_addr, reason);
|
||||
else /* if not specified or not valid, use deauth by default */
|
||||
issue_deauth(padapter, psta->cmn.mac_addr, reason);
|
||||
}
|
||||
|
||||
/* Flush buffered management frames */
|
||||
if (psta->state & WIFI_SLEEP_STATE)
|
||||
@@ -4173,45 +4199,8 @@ u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reaso
|
||||
return beacon_updated;
|
||||
}
|
||||
|
||||
int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
int ret = 0;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
|
||||
return ret;
|
||||
|
||||
RTW_INFO(FUNC_NDEV_FMT" with ch:%u, offset:%u\n",
|
||||
FUNC_NDEV_ARG(padapter->pnetdev), new_ch, ch_offset);
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
|
||||
/* for each sta in asoc_queue */
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
|
||||
plist = get_next(plist);
|
||||
|
||||
issue_action_spct_ch_switch(padapter, psta->cmn.mac_addr, new_ch, ch_offset);
|
||||
psta->expire_to = ((pstapriv->expire_to * 2) > 5) ? 5 : (pstapriv->expire_to * 2);
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
|
||||
issue_action_spct_ch_switch(padapter, bc_addr, new_ch, ch_offset);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rtw_sta_flush(_adapter *padapter, bool enqueue)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
int ret = 0;
|
||||
struct sta_info *psta = NULL;
|
||||
@@ -4227,7 +4216,7 @@ int rtw_sta_flush(_adapter *padapter, bool enqueue)
|
||||
RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(padapter->pnetdev));
|
||||
|
||||
/* pick sta from sta asoc_queue */
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(pstapriv);
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
|
||||
@@ -4236,13 +4225,7 @@ int rtw_sta_flush(_adapter *padapter, bool enqueue)
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list);
|
||||
plist = get_next(plist);
|
||||
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
pstapriv->asoc_list_cnt--;
|
||||
#ifdef CONFIG_RTW_TOKEN_BASED_XMIT
|
||||
if (psta->tbtx_enable)
|
||||
pstapriv->tbtx_asoc_list_cnt--;
|
||||
#endif
|
||||
STA_SET_MESH_PLINK(psta, NULL);
|
||||
rtw_stapriv_asoc_list_del(pstapriv, psta);
|
||||
|
||||
stainfo_offset = rtw_stainfo_offset(pstapriv, psta);
|
||||
if (stainfo_offset_valid(stainfo_offset))
|
||||
@@ -4250,7 +4233,7 @@ int rtw_sta_flush(_adapter *padapter, bool enqueue)
|
||||
else
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(pstapriv);
|
||||
|
||||
/* call ap_free_sta() for each sta picked */
|
||||
for (i = 0; i < flush_num; i++) {
|
||||
@@ -4259,7 +4242,7 @@ int rtw_sta_flush(_adapter *padapter, bool enqueue)
|
||||
psta = rtw_get_stainfo_by_offset(pstapriv, flush_list[i]);
|
||||
_rtw_memcpy(sta_addr, psta->cmn.mac_addr, ETH_ALEN);
|
||||
|
||||
ap_free_sta(padapter, psta, _TRUE, WLAN_REASON_DEAUTH_LEAVING, enqueue);
|
||||
ap_free_sta(padapter, psta, _TRUE, 0, WLAN_REASON_DEAUTH_LEAVING, enqueue);
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
if (MLME_IS_MESH(padapter))
|
||||
rtw_mesh_expire_peer(padapter, sta_addr);
|
||||
@@ -4332,7 +4315,6 @@ void rtw_ap_restore_network(_adapter *padapter)
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct security_priv *psecuritypriv = &(padapter->securitypriv);
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
u8 chk_alive_num = 0;
|
||||
char chk_alive_list[NUM_STA];
|
||||
@@ -4353,7 +4335,7 @@ void rtw_ap_restore_network(_adapter *padapter)
|
||||
rtw_set_key(padapter, psecuritypriv, psecuritypriv->dot118021XGrpKeyid, 0, _FALSE);
|
||||
}
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(pstapriv);
|
||||
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
@@ -4369,7 +4351,7 @@ void rtw_ap_restore_network(_adapter *padapter)
|
||||
chk_alive_list[chk_alive_num++] = stainfo_offset;
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(pstapriv);
|
||||
|
||||
for (i = 0; i < chk_alive_num; i++) {
|
||||
psta = rtw_get_stainfo_by_offset(pstapriv, chk_alive_list[i]);
|
||||
@@ -4487,7 +4469,7 @@ void stop_ap_mode(_adapter *padapter)
|
||||
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
|
||||
rtw_rfctl_update_op_mode(adapter_to_rfctl(padapter), BIT(padapter->iface_id), 0);
|
||||
rtw_rfctl_update_op_mode(adapter_to_rfctl(padapter), BIT(padapter->iface_id), 0, 0);
|
||||
|
||||
/* free scan queue */
|
||||
rtw_free_network_queue(padapter, _TRUE);
|
||||
@@ -4562,6 +4544,10 @@ void stop_ap_mode(_adapter *padapter)
|
||||
rtw_btcoex_MediaStatusNotify(padapter, 0); /* disconnect */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
rtw_indicate_cac_state_on_bss_stop(padapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTW_WDS
|
||||
if (MLME_IS_AP(padapter))
|
||||
rtw_wds_pathtbl_unregister(padapter);
|
||||
@@ -4575,6 +4561,53 @@ void stop_ap_mode(_adapter *padapter)
|
||||
|
||||
#endif /* CONFIG_NATIVEAP_MLME */
|
||||
|
||||
static void rtw_csa_ap_update_sta_rainfo(_adapter *adapter,
|
||||
struct sta_info *psta, const struct sta_info *ap_self_psta)
|
||||
{
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
u8 vht_enable = ap_self_psta->vhtpriv.vht_option;
|
||||
#endif
|
||||
|
||||
psta->cmn.bw_mode = adapter->mlmeextpriv.cur_bwmode;
|
||||
psta->htpriv.ch_offset = adapter->mlmeextpriv.cur_ch_offset;
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
psta->vhtpriv.vht_option = vht_enable;
|
||||
psta->cmn.ra_info.is_vht_enable = vht_enable;
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtw_csa_update_clients_ramask(_adapter *adapter)
|
||||
{
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct wlan_network *cur_network = &(adapter->mlmepriv.cur_network);
|
||||
const struct sta_info *ap_self_psta = rtw_get_stainfo(pstapriv, cur_network->network.MacAddress);
|
||||
const struct sta_info *bmc_psta = rtw_get_bcmc_stainfo(adapter);
|
||||
_list *plist, *phead;
|
||||
_irqL irqL;
|
||||
u8 i;
|
||||
|
||||
RTW_INFO("csa : "FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter));
|
||||
/* update RA mask of all clients */
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
for (i = 0; i < NUM_STA; i++) {
|
||||
phead = &(pstapriv->sta_hash[i]);
|
||||
plist = get_next(phead);
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
plist = get_next(plist);
|
||||
|
||||
if (psta && psta != ap_self_psta && psta != bmc_psta) {
|
||||
rtw_csa_ap_update_sta_rainfo(adapter, psta, ap_self_psta);
|
||||
/* update RA mask */
|
||||
rtw_dm_ra_mask_wk_cmd(adapter, psta);
|
||||
}
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
}
|
||||
|
||||
void rtw_ap_update_bss_chbw(_adapter *adapter, WLAN_BSSID_EX *bss, u8 ch, u8 bw, u8 offset)
|
||||
{
|
||||
#define UPDATE_VHT_CAP 1
|
||||
@@ -4754,15 +4787,8 @@ static u8 rtw_ap_update_chbw_by_ifbmp(struct dvobj_priv *dvobj, u8 ifbmp
|
||||
|| mlmeext->cur_ch_offset != dec_offset[i])
|
||||
) {
|
||||
if (rtw_linked_check(iface) == _TRUE) {
|
||||
#ifdef CONFIG_SPCT_CH_SWITCH
|
||||
if (1)
|
||||
rtw_ap_inform_ch_switch(iface, dec_ch[i], dec_offset[i]);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if(rfctl->ap_csa_en == AP_CSA_DISABLE)
|
||||
rtw_sta_flush(iface, _FALSE);
|
||||
}
|
||||
if (rfctl->ap_csa_en == AP_CSA_DISABLE)
|
||||
rtw_sta_flush(iface, _FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4779,7 +4805,7 @@ static u8 rtw_ap_update_chbw_by_ifbmp(struct dvobj_priv *dvobj, u8 ifbmp
|
||||
static u8 rtw_ap_ch_specific_chk(_adapter *adapter, u8 ch, u8 *bw, u8 *offset, const char *caller)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
RT_CHANNEL_INFO *chset = rfctl->channel_set;
|
||||
struct rtw_chset *chset = adapter_to_chset(adapter);
|
||||
int ch_idx;
|
||||
u8 ret = _SUCCESS;
|
||||
|
||||
@@ -4789,7 +4815,7 @@ static u8 rtw_ap_ch_specific_chk(_adapter *adapter, u8 ch, u8 *bw, u8 *offset, c
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
if (chset[ch_idx].flags & RTW_CHF_NO_IR) {
|
||||
if (chset->chs[ch_idx].flags & RTW_CHF_NO_IR) {
|
||||
RTW_WARN("%s ch:%u is passive\n", caller, ch);
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
@@ -4804,7 +4830,7 @@ static u8 rtw_ap_ch_specific_chk(_adapter *adapter, u8 ch, u8 *bw, u8 *offset, c
|
||||
}
|
||||
|
||||
while (!rtw_chset_is_chbw_valid(chset, ch, *bw, *offset, 0, 0)
|
||||
|| (rtw_rfctl_dfs_domain_unknown(rfctl) && rtw_chset_is_dfs_chbw(chset, ch, *bw, *offset))
|
||||
|| (!rtw_rfctl_radar_detect_supported(rfctl) && rtw_chset_is_dfs_chbw(chset, ch, *bw, *offset))
|
||||
) {
|
||||
if (*bw > CHANNEL_WIDTH_20)
|
||||
(*bw)--;
|
||||
@@ -4814,7 +4840,7 @@ static u8 rtw_ap_ch_specific_chk(_adapter *adapter, u8 ch, u8 *bw, u8 *offset, c
|
||||
}
|
||||
}
|
||||
|
||||
if (rtw_rfctl_dfs_domain_unknown(rfctl) && rtw_chset_is_dfs_chbw(chset, ch, *bw, *offset)) {
|
||||
if (!rtw_rfctl_radar_detect_supported(rfctl) && rtw_chset_is_dfs_chbw(chset, ch, *bw, *offset)) {
|
||||
RTW_WARN("%s DFS channel %u can't be used\n", caller, ch);
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
@@ -4824,68 +4850,12 @@ exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool rtw_ap_choose_chbw(_adapter *adapter, u8 sel_ch, u8 max_bw, u8 cur_ch
|
||||
, u8 *ch, u8 *bw, u8 *offset, bool by_int_info, u8 mesh_only, const char *caller)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
bool ch_avail = _FALSE;
|
||||
|
||||
#if defined(CONFIG_DFS_MASTER)
|
||||
if (!rtw_rfctl_dfs_domain_unknown(rfctl)) {
|
||||
if (rfctl->radar_detected
|
||||
&& rfctl->dbg_dfs_choose_dfs_ch_first
|
||||
) {
|
||||
ch_avail = rtw_choose_shortest_waiting_ch(rfctl, sel_ch, max_bw
|
||||
, ch, bw, offset
|
||||
, RTW_CHF_DFS, 0
|
||||
, cur_ch, by_int_info, mesh_only);
|
||||
if (ch_avail == _TRUE) {
|
||||
RTW_INFO("%s choose 5G DFS channel for debug\n", caller);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (rfctl->radar_detected
|
||||
&& (rfctl->dfs_ch_sel_e_flags || rfctl->dfs_ch_sel_d_flags)
|
||||
) {
|
||||
ch_avail = rtw_choose_shortest_waiting_ch(rfctl, sel_ch, max_bw
|
||||
, ch, bw, offset
|
||||
, rfctl->dfs_ch_sel_e_flags, rfctl->dfs_ch_sel_d_flags
|
||||
, cur_ch, by_int_info, mesh_only);
|
||||
if (ch_avail == _TRUE) {
|
||||
RTW_INFO("%s choose with dfs_ch_sel_ e_flags:0x%02x d_flags:0x%02x for debug\n"
|
||||
, caller, rfctl->dfs_ch_sel_e_flags, rfctl->dfs_ch_sel_d_flags);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
ch_avail = rtw_choose_shortest_waiting_ch(rfctl, sel_ch, max_bw
|
||||
, ch, bw, offset
|
||||
, 0, 0
|
||||
, cur_ch, by_int_info, mesh_only);
|
||||
} else
|
||||
#endif /* defined(CONFIG_DFS_MASTER) */
|
||||
{
|
||||
ch_avail = rtw_choose_shortest_waiting_ch(rfctl, sel_ch, max_bw
|
||||
, ch, bw, offset
|
||||
, 0, RTW_CHF_DFS
|
||||
, cur_ch, by_int_info, mesh_only);
|
||||
}
|
||||
#if defined(CONFIG_DFS_MASTER)
|
||||
exit:
|
||||
#endif
|
||||
if (ch_avail == _FALSE)
|
||||
RTW_WARN("%s no available channel\n", caller);
|
||||
|
||||
return ch_avail;
|
||||
}
|
||||
|
||||
u8 rtw_ap_chbw_decision(_adapter *adapter, u8 ifbmp, u8 excl_ifbmp
|
||||
, s16 req_ch, s8 req_bw, s8 req_offset
|
||||
, u8 *ch, u8 *bw, u8 *offset, u8 *chbw_allow, bool *set_u_ch)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
RT_CHANNEL_INFO *chset = adapter_to_chset(adapter);
|
||||
struct rtw_chset *chset = adapter_to_chset(adapter);
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
bool ch_avail = _FALSE;
|
||||
u8 cur_ie_ch[CONFIG_IFACE_NUMBER] = {0};
|
||||
@@ -5087,7 +5057,7 @@ u8 rtw_ap_chbw_decision(_adapter *adapter, u8 ifbmp, u8 excl_ifbmp
|
||||
|
||||
} else {
|
||||
/* autonomous decision */
|
||||
u8 ori_ch = 0;
|
||||
u8 ori_ch = 0, ori_offset = CHAN_OFFSET_NO_EXT;
|
||||
u8 max_bw;
|
||||
bool by_int_info;
|
||||
|
||||
@@ -5166,20 +5136,35 @@ choose_chbw:
|
||||
}
|
||||
|
||||
if (MSTATE_AP_NUM(&mstate) || MSTATE_MESH_NUM(&mstate)) {
|
||||
if (ori_ch == 0)
|
||||
if (ori_ch == 0) {
|
||||
ori_ch = mlmeext->cur_channel;
|
||||
else if (ori_ch != mlmeext->cur_channel)
|
||||
ori_offset = mlmeext->cur_ch_offset;
|
||||
} else if (ori_ch != mlmeext->cur_channel) {
|
||||
rtw_warn_on(1);
|
||||
} else if (mlmeext->cur_ch_offset != CHAN_OFFSET_NO_EXT) {
|
||||
if (ori_offset == CHAN_OFFSET_NO_EXT)
|
||||
ori_offset = mlmeext->cur_ch_offset;
|
||||
else if (ori_offset != mlmeext->cur_ch_offset)
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
} else {
|
||||
if (ori_ch == 0)
|
||||
if (ori_ch == 0) {
|
||||
ori_ch = cur_ie_ch[i];
|
||||
else if (ori_ch != cur_ie_ch[i])
|
||||
ori_offset = cur_ie_offset[i];
|
||||
} else if (ori_ch != cur_ie_ch[i]) {
|
||||
rtw_warn_on(1);
|
||||
} else if (cur_ie_offset[i] != CHAN_OFFSET_NO_EXT) {
|
||||
if (ori_offset == CHAN_OFFSET_NO_EXT)
|
||||
ori_offset = cur_ie_offset[i];
|
||||
else if (ori_offset != cur_ie_offset[i])
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
req_offset = req_offset > REQ_OFFSET_NONE ? req_offset : CHAN_OFFSET_NO_EXT;
|
||||
|
||||
ch_avail = rtw_ap_choose_chbw(adapter, req_ch, max_bw
|
||||
, ori_ch, &u_ch, &u_bw, &u_offset, by_int_info, ifbmp_all_mesh, __func__);
|
||||
ch_avail = rtw_rfctl_choose_chbw(rfctl, req_ch, max_bw, req_offset
|
||||
, ori_ch, ori_offset, &u_ch, &u_bw, &u_offset, by_int_info, ifbmp_all_mesh, __func__);
|
||||
if (ch_avail == _FALSE)
|
||||
goto exit;
|
||||
|
||||
@@ -5235,7 +5220,6 @@ u8 rtw_ap_sta_states_check(_adapter *adapter)
|
||||
struct sta_info *psta;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
_list *plist, *phead;
|
||||
_irqL irqL;
|
||||
u8 rst = _FALSE;
|
||||
|
||||
if (!MLME_IS_AP(adapter) && !MLME_IS_MESH(adapter))
|
||||
@@ -5244,7 +5228,7 @@ u8 rtw_ap_sta_states_check(_adapter *adapter)
|
||||
if (pstapriv->auth_list_cnt !=0)
|
||||
return _TRUE;
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(pstapriv);
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
|
||||
@@ -5262,7 +5246,7 @@ u8 rtw_ap_sta_states_check(_adapter *adapter)
|
||||
break;
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(pstapriv);
|
||||
return rst;
|
||||
}
|
||||
|
||||
@@ -5393,10 +5377,8 @@ void tx_beacon_handlder(struct dvobj_priv *pdvobj)
|
||||
#ifdef DBG_SWTIMER_BASED_TXBCN
|
||||
RTW_INFO("padapter=%p, PORT=%d\n", padapter, padapter->hw_port);
|
||||
#endif
|
||||
/* bypass TX BCN queue if op ch is switching/waiting */
|
||||
if (!check_fwstate(&padapter->mlmepriv, WIFI_OP_CH_SWITCHING)
|
||||
&& !IS_CH_WAITING(adapter_to_rfctl(padapter))
|
||||
) {
|
||||
/* bypass TX BCN queue if op ch is switching */
|
||||
if (!check_fwstate(&padapter->mlmepriv, WIFI_OP_CH_SWITCHING)) {
|
||||
/*update_beacon(padapter, _TIM_IE_, NULL, _FALSE, 0);*/
|
||||
/*issue_beacon(padapter, 0);*/
|
||||
send_beacon(padapter);
|
||||
@@ -5821,7 +5803,6 @@ static bool rtw_ap_data_bmc_to_uc(_adapter *adapter
|
||||
{
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
struct xmit_priv *xmitpriv = &adapter->xmitpriv;
|
||||
_irqL irqL;
|
||||
_list *head, *list;
|
||||
struct sta_info *sta;
|
||||
char b2u_sta_id[NUM_STA];
|
||||
@@ -5829,7 +5810,7 @@ static bool rtw_ap_data_bmc_to_uc(_adapter *adapter
|
||||
bool bmc_need = _FALSE;
|
||||
int i;
|
||||
|
||||
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(stapriv);
|
||||
head = &stapriv->asoc_list;
|
||||
list = get_next(head);
|
||||
|
||||
@@ -5843,7 +5824,7 @@ static bool rtw_ap_data_bmc_to_uc(_adapter *adapter
|
||||
if (stainfo_offset_valid(stainfo_offset))
|
||||
b2u_sta_id[b2u_sta_num++] = stainfo_offset;
|
||||
}
|
||||
_exit_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(stapriv);
|
||||
|
||||
if (!b2u_sta_num)
|
||||
goto exit;
|
||||
@@ -5919,14 +5900,13 @@ static void rtw_ap_data_flood_for_unknown_da(_adapter *adapter
|
||||
{
|
||||
struct sta_priv *stapriv = &adapter->stapriv;
|
||||
struct xmit_priv *xmitpriv = &adapter->xmitpriv;
|
||||
_irqL irqL;
|
||||
_list *head, *list;
|
||||
struct sta_info *sta;
|
||||
char sta_id[NUM_STA];
|
||||
u8 sta_num = 0;
|
||||
int i;
|
||||
|
||||
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(stapriv);
|
||||
head = &stapriv->asoc_list;
|
||||
list = get_next(head);
|
||||
|
||||
@@ -5940,7 +5920,7 @@ static void rtw_ap_data_flood_for_unknown_da(_adapter *adapter
|
||||
if (stainfo_offset_valid(stainfo_offset))
|
||||
sta_id[sta_num++] = stainfo_offset;
|
||||
}
|
||||
_exit_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(stapriv);
|
||||
|
||||
if (!sta_num)
|
||||
goto exit;
|
||||
@@ -6297,7 +6277,7 @@ void rtw_issue_action_token_req(_adapter *padapter, struct sta_info *pstat)
|
||||
WLAN_BSSID_EX *pnetwork = &(pmlmeinfo->network);
|
||||
|
||||
|
||||
if (rtw_rfctl_is_tx_blocked_by_ch_waiting(adapter_to_rfctl(padapter)))
|
||||
if (adapter_is_tx_blocked_by_ch_waiting(padapter))
|
||||
return;
|
||||
|
||||
RTW_DBG("%s: %6ph\n", __FUNCTION__, pstat->cmn.mac_addr);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -115,7 +115,7 @@ static void _get_sta_beamform_cap(PADAPTER adapter, struct sta_info *sta,
|
||||
mlme = &adapter->mlmepriv;
|
||||
|
||||
if (is_supported_ht(sta->wireless_mode) == _FALSE)
|
||||
goto get_bfcap_next;
|
||||
return;
|
||||
|
||||
/* HT */
|
||||
if (check_fwstate(mlme, WIFI_AP_STATE)) {
|
||||
@@ -154,7 +154,6 @@ static void _get_sta_beamform_cap(PADAPTER adapter, struct sta_info *sta,
|
||||
}
|
||||
}
|
||||
|
||||
get_bfcap_next:
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
if (is_supported_vht(sta->wireless_mode) == _FALSE)
|
||||
return;
|
||||
@@ -386,7 +385,7 @@ static u8 _send_vht_ndpa_packet(PADAPTER adapter, u8 *ra, u16 aid, enum channel_
|
||||
set_frame_sub_type(pframe, attrib->subtype);
|
||||
|
||||
/* Duration */
|
||||
if (is_supported_5g(pmlmeext->cur_wireless_mode) || is_supported_ht(pmlmeext->cur_wireless_mode))
|
||||
if (is_supported_5g(pmlmeext->cur_wireless_mode) || is_highest_support_ht(pmlmeext->cur_wireless_mode))
|
||||
aSifsTime = 16;
|
||||
else
|
||||
aSifsTime = 10;
|
||||
@@ -503,7 +502,7 @@ static u8 _send_vht_mu_ndpa_packet(PADAPTER adapter, enum channel_width bw)
|
||||
set_frame_sub_type(pframe, attrib->subtype);
|
||||
|
||||
/* Duration */
|
||||
if (is_supported_5g(pmlmeext->cur_wireless_mode) || is_supported_ht(pmlmeext->cur_wireless_mode))
|
||||
if (is_supported_5g(pmlmeext->cur_wireless_mode) || is_highest_support_ht(pmlmeext->cur_wireless_mode))
|
||||
aSifsTime = 16;
|
||||
else
|
||||
aSifsTime = 10;
|
||||
@@ -1066,7 +1065,6 @@ static struct beamformer_entry *_bfer_get_entry_by_addr(PADAPTER adapter, u8 *ra
|
||||
static struct beamformer_entry *_bfer_add_entry(PADAPTER adapter,
|
||||
struct sta_info *sta, u8 bf_cap, u8 sounding_dim, u8 comp_steering)
|
||||
{
|
||||
struct mlme_priv *mlme;
|
||||
struct beamforming_info *info;
|
||||
struct beamformer_entry *bfer;
|
||||
u8 *bssid;
|
||||
@@ -1074,7 +1072,6 @@ static struct beamformer_entry *_bfer_add_entry(PADAPTER adapter,
|
||||
u8 i;
|
||||
|
||||
|
||||
mlme = &adapter->mlmepriv;
|
||||
info = GET_BEAMFORM_INFO(adapter);
|
||||
|
||||
bfer = _bfer_get_entry_by_addr(adapter, sta->cmn.mac_addr);
|
||||
@@ -1251,7 +1248,6 @@ static u8 _bfee_get_first_mu_entry_idx(PADAPTER adapter, struct beamformee_entry
|
||||
static struct beamformee_entry *_bfee_add_entry(PADAPTER adapter,
|
||||
struct sta_info *sta, u8 bf_cap, u8 sounding_dim, u8 comp_steering)
|
||||
{
|
||||
struct mlme_priv *mlme;
|
||||
struct beamforming_info *info;
|
||||
struct beamformee_entry *bfee;
|
||||
u8 *bssid;
|
||||
@@ -1259,7 +1255,6 @@ static struct beamformee_entry *_bfee_add_entry(PADAPTER adapter,
|
||||
u8 i;
|
||||
|
||||
|
||||
mlme = &adapter->mlmepriv;
|
||||
info = GET_BEAMFORM_INFO(adapter);
|
||||
|
||||
bfee = _bfee_get_entry_by_addr(adapter, sta->cmn.mac_addr);
|
||||
@@ -1429,7 +1424,6 @@ static void _beamforming_enter(PADAPTER adapter, void *p)
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
struct vht_priv *vhtpriv;
|
||||
#endif
|
||||
struct mlme_ext_priv *mlme_ext;
|
||||
struct sta_info *sta, *sta_copy;
|
||||
struct beamforming_info *info;
|
||||
struct beamformer_entry *bfer = NULL;
|
||||
@@ -1445,7 +1439,6 @@ static void _beamforming_enter(PADAPTER adapter, void *p)
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
vhtpriv = &mlme->vhtpriv;
|
||||
#endif
|
||||
mlme_ext = &adapter->mlmeextpriv;
|
||||
info = GET_BEAMFORM_INFO(adapter);
|
||||
|
||||
sta_copy = (struct sta_info *)p;
|
||||
@@ -1466,8 +1459,8 @@ static void _beamforming_enter(PADAPTER adapter, void *p)
|
||||
|
||||
/* The current setting does not support Beaforming */
|
||||
wireless_mode = sta->wireless_mode;
|
||||
if ((is_supported_ht(wireless_mode) == _FALSE)
|
||||
&& (is_supported_vht(wireless_mode) == _FALSE)) {
|
||||
if ((is_highest_support_ht(wireless_mode) == _FALSE)
|
||||
&& (is_highest_support_vht(wireless_mode) == _FALSE)) {
|
||||
RTW_WARN("%s: Not support HT or VHT mode\n", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
@@ -1679,20 +1672,21 @@ u32 rtw_bf_get_report_packet(PADAPTER adapter, union recv_frame *precv_frame)
|
||||
struct beamforming_info *info;
|
||||
struct beamformee_entry *bfee = NULL;
|
||||
u8 *pframe;
|
||||
u32 frame_len;
|
||||
/*u32 frame_len;*/
|
||||
u8 *ta;
|
||||
u8 *frame_body;
|
||||
u8 category, action;
|
||||
u8 *pMIMOCtrlField, *pCSIMatrix;
|
||||
u8 *pMIMOCtrlField;
|
||||
/*u8 *pCSIMatrix;*/
|
||||
u8 Nc = 0, Nr = 0, CH_W = 0, Ng = 0, CodeBook = 0;
|
||||
u16 CSIMatrixLen = 0;
|
||||
/*u16 CSIMatrixLen = 0;*/
|
||||
|
||||
|
||||
RTW_INFO("+%s\n", __FUNCTION__);
|
||||
|
||||
info = GET_BEAMFORM_INFO(adapter);
|
||||
pframe = precv_frame->u.hdr.rx_data;
|
||||
frame_len = precv_frame->u.hdr.len;
|
||||
/*frame_len = precv_frame->u.hdr.len;*/
|
||||
|
||||
/* Memory comparison to see if CSI report is the same with previous one */
|
||||
ta = get_addr2_ptr(pframe);
|
||||
@@ -1716,8 +1710,8 @@ u32 rtw_bf_get_report_packet(PADAPTER adapter, union recv_frame *precv_frame)
|
||||
* 24+(1+1+3)+2
|
||||
* ==> MAC header+(Category+ActionCode+MIMOControlField)+SNR(Nc=2)
|
||||
*/
|
||||
pCSIMatrix = pMIMOCtrlField + 3 + Nc;
|
||||
CSIMatrixLen = frame_len - 26 - 3 - Nc;
|
||||
/*pCSIMatrix = pMIMOCtrlField + 3 + Nc;*/
|
||||
/*CSIMatrixLen = frame_len - 26 - 3 - Nc;*/
|
||||
info->TargetCSIInfo.bVHT = _TRUE;
|
||||
} else if ((category == RTW_WLAN_CATEGORY_HT)
|
||||
&& (action == RTW_WLAN_ACTION_HT_COMPRESS_BEAMFORMING)) {
|
||||
@@ -1731,8 +1725,8 @@ u32 rtw_bf_get_report_packet(PADAPTER adapter, union recv_frame *precv_frame)
|
||||
* 24+(1+1+6)+2
|
||||
* ==> MAC header+(Category+ActionCode+MIMOControlField)+SNR(Nc=2)
|
||||
*/
|
||||
pCSIMatrix = pMIMOCtrlField + 6 + Nr;
|
||||
CSIMatrixLen = frame_len - 26 - 6 - Nr;
|
||||
/*pCSIMatrix = pMIMOCtrlField + 6 + Nr;*/
|
||||
/*CSIMatrixLen = frame_len - 26 - 6 - Nr;*/
|
||||
info->TargetCSIInfo.bVHT = _FALSE;
|
||||
}
|
||||
|
||||
@@ -1992,7 +1986,7 @@ void rtw_bf_c2h_handler(PADAPTER adapter, u8 id, u8 *buf, u8 buf_len)
|
||||
void rtw_bf_update_traffic(PADAPTER adapter)
|
||||
{
|
||||
struct beamforming_info *info;
|
||||
struct sounding_info *sounding;
|
||||
/*struct sounding_info *sounding;*/
|
||||
struct beamformee_entry *bfee;
|
||||
struct sta_info *sta;
|
||||
u8 bfee_cnt, sounding_idx, i;
|
||||
@@ -2005,7 +1999,7 @@ void rtw_bf_update_traffic(PADAPTER adapter)
|
||||
|
||||
|
||||
info = GET_BEAMFORM_INFO(adapter);
|
||||
sounding = &info->sounding_info;
|
||||
/*sounding = &info->sounding_info;*/
|
||||
|
||||
/* Check any bfee exist? */
|
||||
bfee_cnt = info->beamformee_su_cnt + info->beamformee_mu_cnt;
|
||||
|
||||
@@ -17,7 +17,10 @@
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/if_arp.h>
|
||||
#include <net/ip.h>
|
||||
#include <linux/version.h>
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0))
|
||||
#include <net/ipx.h>
|
||||
#endif
|
||||
#include <linux/atalk.h>
|
||||
#include <linux/udp.h>
|
||||
#include <linux/if_pppox.h>
|
||||
@@ -169,6 +172,7 @@ static __inline__ void __nat25_generate_ipv4_network_addr(unsigned char *network
|
||||
}
|
||||
|
||||
|
||||
#ifdef _NET_INET_IPX_H_
|
||||
static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
|
||||
unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
|
||||
{
|
||||
@@ -200,6 +204,7 @@ static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networ
|
||||
memcpy(networkAddr + 1, (unsigned char *)network, 2);
|
||||
networkAddr[3] = *node;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static __inline__ void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
|
||||
@@ -330,6 +335,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
||||
x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
|
||||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
#ifdef _NET_INET_IPX_H_
|
||||
} else if (networkAddr[0] == NAT25_IPX) {
|
||||
unsigned long x;
|
||||
|
||||
@@ -343,6 +349,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
|
||||
x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3];
|
||||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
#endif
|
||||
} else if (networkAddr[0] == NAT25_PPPOE) {
|
||||
unsigned long x;
|
||||
|
||||
@@ -889,6 +896,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _NET_INET_IPX_H
|
||||
/*---------------------------------------------------*/
|
||||
/* Handle IPX and Apple Talk frame */
|
||||
/*---------------------------------------------------*/
|
||||
@@ -1109,6 +1117,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------*/
|
||||
/* Handle PPPoE frame */
|
||||
|
||||
@@ -200,6 +200,17 @@ void rtw_btcoex_BtInfoNotify(PADAPTER padapter, u8 length, u8 *tmpBuf)
|
||||
hal_btcoex_BtInfoNotify(padapter, length, tmpBuf);
|
||||
}
|
||||
|
||||
void rtw_btcoex_le_audio_info_notify(PADAPTER padapter, u8 length, u8 *tmpBuf)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData;
|
||||
|
||||
pHalData = GET_HAL_DATA(padapter);
|
||||
if (_FALSE == pHalData->EEPROMBluetoothCoexist)
|
||||
return;
|
||||
|
||||
hal_btcoex_le_audio_info_notify(padapter, length, tmpBuf);
|
||||
}
|
||||
|
||||
void rtw_btcoex_BtMpRptNotify(PADAPTER padapter, u8 length, u8 *tmpBuf)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData;
|
||||
@@ -259,11 +270,6 @@ void rtw_btcoex_WlFwDbgInfoNotify(PADAPTER padapter, u8* tmpBuf, u8 length)
|
||||
hal_btcoex_WlFwDbgInfoNotify(padapter, tmpBuf, length);
|
||||
}
|
||||
|
||||
void rtw_btcoex_rx_rate_change_notify(PADAPTER padapter, u8 is_data_frame, u8 rate_id)
|
||||
{
|
||||
hal_btcoex_rx_rate_change_notify(padapter, is_data_frame, rate_id);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SwitchBtTRxMask(PADAPTER padapter)
|
||||
{
|
||||
hal_btcoex_SwitchBtTRxMask(padapter);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2018 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -15,29 +15,31 @@
|
||||
#ifndef __RTW_CHPLAN_H__
|
||||
#define __RTW_CHPLAN_H__
|
||||
|
||||
#define RTW_CHPLAN_IOCTL_NULL 0xFFFE /* special value by ioctl: null(empty) chplan */
|
||||
#define RTW_CHPLAN_IOCTL_NULL 0xFFFE /* special value by ioctl: null(empty) chplan */
|
||||
#define RTW_CHPLAN_IOCTL_UNSPECIFIED 0xFFFF /* special value by ioctl: no change (keep original) */
|
||||
|
||||
#define RTW_CHPLAN_NULL 0x1A
|
||||
#define RTW_CHPLAN_NULL 0x0A
|
||||
#define RTW_CHPLAN_WORLDWIDE 0x7F
|
||||
#define RTW_CHPLAN_UNSPECIFIED 0xFF
|
||||
#define RTW_CHPLAN_6G_NULL 0x00
|
||||
#define RTW_CHPLAN_6G_NULL 0x00
|
||||
#define RTW_CHPLAN_6G_WORLDWIDE 0x7F
|
||||
#define RTW_CHPLAN_6G_UNSPECIFIED 0xFF
|
||||
|
||||
u8 rtw_chplan_get_default_regd_2g(u8 id);
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
u8 rtw_chplan_get_default_regd_5g(u8 id);
|
||||
#endif
|
||||
bool rtw_is_channel_plan_valid(u8 id);
|
||||
bool rtw_regsty_is_excl_chs(struct registry_priv *regsty, u8 ch);
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
u8 rtw_chplan_get_default_regd_6g(u8 id);
|
||||
bool rtw_is_channel_plan_6g_valid(u8 id);
|
||||
bool rtw_regsty_is_excl_chs_6g(struct registry_priv *regsty, u8 ch);
|
||||
#endif
|
||||
|
||||
u8 rtw_chplan_is_chbw_valid(u8 id, u8 id_6g, BAND_TYPE band, u8 ch, u8 bw, u8 offset
|
||||
, bool allow_primary_passive, bool allow_passive, struct registry_priv *regsty);
|
||||
void rtw_rfctl_addl_ch_disable_conf_init(struct rf_ctl_t *rfctl, struct registry_priv *regsty);
|
||||
|
||||
u8 rtw_chplan_is_bchbw_valid(u8 id, u8 id_6g, enum band_type band, u8 ch, u8 bw, u8 offset
|
||||
, bool allow_primary_passive, bool allow_passive, struct rf_ctl_t *rfctl);
|
||||
|
||||
enum regd_src_t {
|
||||
REGD_SRC_RTK_PRIV = 0, /* Regulatory settings from Realtek framework (Realtek defined or customized) */
|
||||
@@ -50,36 +52,25 @@ enum regd_src_t {
|
||||
extern const char *_regd_src_str[];
|
||||
#define regd_src_str(src) ((src) >= REGD_SRC_NUM ? _regd_src_str[REGD_SRC_NUM] : _regd_src_str[src])
|
||||
|
||||
struct _RT_CHANNEL_INFO;
|
||||
u8 init_channel_set(_adapter *adapter);
|
||||
bool rtw_chset_is_dfs_range(struct _RT_CHANNEL_INFO *chset, u32 hi, u32 lo);
|
||||
bool rtw_chset_is_dfs_ch(struct _RT_CHANNEL_INFO *chset, u8 ch);
|
||||
bool rtw_chset_is_dfs_chbw(struct _RT_CHANNEL_INFO *chset, u8 ch, u8 bw, u8 offset);
|
||||
void rtw_rfctl_chset_apply_regulatory(struct dvobj_priv *dvobj, bool req_lock);
|
||||
|
||||
bool rtw_rfctl_reg_allow_beacon_hint(struct rf_ctl_t *rfctl);
|
||||
bool rtw_chinfo_allow_beacon_hint(struct _RT_CHANNEL_INFO *chinfo);
|
||||
u8 rtw_process_beacon_hint(_adapter *adapter, WLAN_BSSID_EX *bss);
|
||||
u8 rtw_process_beacon_hint(struct rf_ctl_t *rfctl, WLAN_BSSID_EX *bss);
|
||||
void rtw_beacon_hint_ch_change_notifier(struct rf_ctl_t *rfctl);
|
||||
|
||||
#define ALPHA2_FMT "%c%c"
|
||||
#define ALPHA2_ARG(a2) ((is_alpha(a2[0]) || is_decimal(a2[0])) ? a2[0] : '-'), ((is_alpha(a2[1]) || is_decimal(a2[1])) ? a2[1] : '-')
|
||||
|
||||
#define WORLDWIDE_ALPHA2 "00"
|
||||
#define UNSPEC_ALPHA2 "99"
|
||||
#define INTERSECTED_ALPHA2 "98"
|
||||
|
||||
#define IS_ALPHA2_WORLDWIDE(_alpha2) (strncmp(_alpha2, WORLDWIDE_ALPHA2, 2) == 0)
|
||||
#define IS_ALPHA2_UNSPEC(_alpha2) (strncmp(_alpha2, UNSPEC_ALPHA2, 2) == 0)
|
||||
#define IS_ALPHA2_UNSPEC(_alpha2) (strncmp(_alpha2, UNSPEC_ALPHA2, 2) == 0)
|
||||
#define IS_ALPHA2_INTERSECTED(_alpha2) (strncmp(_alpha2, INTERSECTED_ALPHA2, 2) == 0)
|
||||
#define SET_UNSPEC_ALPHA2(_alpha2) do { _rtw_memcpy(_alpha2, UNSPEC_ALPHA2, 2); } while (0)
|
||||
|
||||
#define RTW_MODULE_RTL8821AE_HMC_M2 BIT0 /* RTL8821AE(HMC + M.2) */
|
||||
#define RTW_MODULE_RTL8821AU BIT1 /* RTL8821AU */
|
||||
#define RTW_MODULE_RTL8812AENF_NGFF BIT2 /* RTL8812AENF(8812AE+8761)_NGFF */
|
||||
#define RTW_MODULE_RTL8812AEBT_HMC BIT3 /* RTL8812AEBT(8812AE+8761)_HMC */
|
||||
#define RTW_MODULE_RTL8188EE_HMC_M2 BIT4 /* RTL8188EE(HMC + M.2) */
|
||||
#define RTW_MODULE_RTL8723BE_HMC_M2 BIT5 /* RTL8723BE(HMC + M.2) */
|
||||
#define RTW_MODULE_RTL8723BS_NGFF1216 BIT6 /* RTL8723BS(NGFF1216) */
|
||||
#define RTW_MODULE_RTL8192EEBT_HMC_M2 BIT7 /* RTL8192EEBT(8192EE+8761AU)_(HMC + M.2) */
|
||||
#define RTW_MODULE_RTL8723DE_NGFF1630 BIT8 /* RTL8723DE(NGFF1630) */
|
||||
#define RTW_MODULE_RTL8822BE BIT9 /* RTL8822BE */
|
||||
#define RTW_MODULE_RTL8821CE BIT10 /* RTL8821CE */
|
||||
#define RTW_MODULE_RTL8822CE BIT11 /* RTL8822CE */
|
||||
#define SET_INTERSECTEDC_ALPHA2(_alpha2) do { _rtw_memcpy(_alpha2, INTERSECTED_ALPHA2, 2); } while (0)
|
||||
|
||||
enum rtw_regd_inr {
|
||||
RTW_REGD_SET_BY_INIT = 0,
|
||||
@@ -114,28 +105,32 @@ enum rtw_regd {
|
||||
extern const char *const _regd_str[];
|
||||
#define regd_str(regd) (((regd) >= RTW_REGD_NUM) ? _regd_str[RTW_REGD_NA] : _regd_str[(regd)])
|
||||
|
||||
enum rtw_edcca_mode {
|
||||
RTW_EDCCA_NORMAL = 0, /* normal */
|
||||
RTW_EDCCA_ADAPT = 1, /* adaptivity */
|
||||
RTW_EDCCA_CS = 2, /* carrier sense */
|
||||
|
||||
enum rtw_edcca_mode_t {
|
||||
RTW_EDCCA_NORM = 0, /* normal */
|
||||
RTW_EDCCA_CS = 1, /* carrier sense */
|
||||
RTW_EDCCA_ADAPT = 2, /* adaptivity */
|
||||
RTW_EDCCA_CBP = 3, /* contention based protocol */
|
||||
RTW_EDCCA_MODE_NUM,
|
||||
RTW_EDCCA_DEF = RTW_EDCCA_MODE_NUM, /* default (ref to domain code), used at country chplan map's override field */
|
||||
RTW_EDCCA_AUTO = 0xFF, /* follow channel plan */
|
||||
};
|
||||
|
||||
extern const char *const _rtw_edcca_mode_str[];
|
||||
#define rtw_edcca_mode_str(mode) (((mode) >= RTW_EDCCA_MODE_NUM) ? _rtw_edcca_mode_str[RTW_EDCCA_NORMAL] : _rtw_edcca_mode_str[(mode)])
|
||||
#define rtw_edcca_mode_str(mode) (((mode) >= RTW_EDCCA_MODE_NUM) ? _rtw_edcca_mode_str[RTW_EDCCA_NORM] : _rtw_edcca_mode_str[(mode)])
|
||||
|
||||
enum rtw_dfs_regd {
|
||||
RTW_DFS_REGD_NONE = 0,
|
||||
RTW_DFS_REGD_FCC = 1,
|
||||
RTW_DFS_REGD_MKK = 2,
|
||||
RTW_DFS_REGD_ETSI = 3,
|
||||
RTW_DFS_REGD_KCC = 4,
|
||||
RTW_DFS_REGD_NUM,
|
||||
RTW_DFS_REGD_AUTO = 0xFF, /* follow channel plan */
|
||||
};
|
||||
|
||||
extern const char *_rtw_dfs_regd_str[];
|
||||
#define RTW_DFS_REGD_IS_UNKNOWN(regd) ((regd) == RTW_DFS_REGD_NONE || (regd) >= RTW_DFS_REGD_NUM)
|
||||
|
||||
extern const char *const _rtw_dfs_regd_str[];
|
||||
#define rtw_dfs_regd_str(region) (((region) >= RTW_DFS_REGD_NUM) ? _rtw_dfs_regd_str[RTW_DFS_REGD_NONE] : _rtw_dfs_regd_str[(region)])
|
||||
|
||||
typedef enum _REGULATION_TXPWR_LMT {
|
||||
@@ -152,6 +147,7 @@ typedef enum _REGULATION_TXPWR_LMT {
|
||||
TXPWR_LMT_MEXICO = 10,
|
||||
TXPWR_LMT_CN = 11,
|
||||
TXPWR_LMT_QATAR = 12,
|
||||
TXPWR_LMT_UK = 13,
|
||||
TXPWR_LMT_WW, /* smallest of all available limit, keep last */
|
||||
|
||||
TXPWR_LMT_NUM,
|
||||
@@ -166,53 +162,107 @@ extern const REGULATION_TXPWR_LMT _txpwr_lmt_alternate[];
|
||||
|
||||
#define TXPWR_LMT_ALTERNATE_DEFINED(txpwr_lmt) (txpwr_lmt_alternate(txpwr_lmt) != txpwr_lmt)
|
||||
|
||||
extern const enum rtw_edcca_mode _rtw_regd_to_edcca_mode[RTW_REGD_NUM];
|
||||
#define rtw_regd_to_edcca_mode(regd) (((regd) >= RTW_REGD_NUM) ? RTW_EDCCA_NORMAL : _rtw_regd_to_edcca_mode[(regd)])
|
||||
extern const enum rtw_edcca_mode_t _rtw_regd_to_edcca_mode[RTW_REGD_NUM];
|
||||
#define rtw_regd_to_edcca_mode(regd) (((regd) >= RTW_REGD_NUM) ? RTW_EDCCA_NORM : _rtw_regd_to_edcca_mode[(regd)])
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
extern const enum rtw_edcca_mode_t _rtw_regd_to_edcca_mode_6g[RTW_REGD_NUM];
|
||||
#define rtw_regd_to_edcca_mode_6g(regd) (((regd) >= RTW_REGD_NUM) ? RTW_EDCCA_NORM : _rtw_regd_to_edcca_mode_6g[(regd)])
|
||||
#endif
|
||||
|
||||
extern const REGULATION_TXPWR_LMT _rtw_regd_to_txpwr_lmt[];
|
||||
#define rtw_regd_to_txpwr_lmt(regd) (((regd) >= RTW_REGD_NUM) ? TXPWR_LMT_WW : _rtw_regd_to_txpwr_lmt[(regd)])
|
||||
|
||||
#define EDCCA_MODES_STR_LEN (((6 + 3 + 1) * BAND_MAX) + 1)
|
||||
char *rtw_get_edcca_modes_str(char *buf, u8 modes[]);
|
||||
void rtw_edcca_mode_update(struct dvobj_priv *dvobj);
|
||||
u8 rtw_get_edcca_mode(struct dvobj_priv *dvobj, BAND_TYPE band);
|
||||
#define REGD_INR_BMP_STR_LEN (33)
|
||||
char *rtw_get_regd_inr_bmp_str(char *buf, u8 bmp);
|
||||
|
||||
#define TXPWR_NAMES_STR_LEN (((1 + 7 + 1) * BAND_MAX) + 1)
|
||||
char *rtw_get_txpwr_lmt_names_str(char *buf, const char *names[], u8 unknown_bmp);
|
||||
#define EDCCA_MODE_OF_BANDS_STR_LEN (((6 + 3 + 1) * BAND_MAX) + 1)
|
||||
char *rtw_get_edcca_mode_of_bands_str(char *buf, u8 mode_of_band[]);
|
||||
void rtw_edcca_mode_update(struct dvobj_priv *dvobj, bool req_lock);
|
||||
u8 rtw_get_edcca_mode(struct dvobj_priv *dvobj, enum band_type band);
|
||||
|
||||
#define CHPLAN_PROTO_EN_AC BIT0
|
||||
#define CHPLAN_PROTO_EN_AX BIT1
|
||||
#if CONFIG_TXPWR_LIMIT
|
||||
#define TXPWR_NAME_OF_BANDS_STR_LEN (((1 + 7 + 1) * BAND_MAX) + 1)
|
||||
char *rtw_get_txpwr_lmt_name_of_bands_str(char *buf, const char *name_of_band[], u8 unknown_bmp);
|
||||
void rtw_txpwr_update_cur_lmt_regs(struct dvobj_priv *dvobj, bool req_lock);
|
||||
#endif
|
||||
|
||||
#define CHPLAN_PROTO_EN_A BIT0
|
||||
#define CHPLAN_PROTO_EN_AC BIT1
|
||||
#define CHPLAN_PROTO_EN_AX BIT2
|
||||
#define CHPLAN_PROTO_EN_ALL 0xFF
|
||||
|
||||
struct country_chplan {
|
||||
char alpha2[2];
|
||||
u8 chplan;
|
||||
|
||||
u8 domain_code;
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
u8 chplan_6g;
|
||||
u8 domain_code_6g;
|
||||
#endif
|
||||
u8 edcca_mode_2g_override:2;
|
||||
|
||||
/* will override edcca mode get by domain code (/6g) */
|
||||
u8 edcca_mode_2g_override:3;
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
u8 edcca_mode_5g_override:2;
|
||||
u8 edcca_mode_5g_override:3;
|
||||
#endif
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
u8 edcca_mode_6g_override:2;
|
||||
u8 edcca_mode_6g_override:3;
|
||||
#endif
|
||||
|
||||
/* will override txpwr_lmt get by domain code (/6g) */
|
||||
u8 txpwr_lmt_override;
|
||||
#if defined(CONFIG_80211AX_HE) || defined(CONFIG_80211AC_VHT)
|
||||
|
||||
#if defined(CONFIG_80211AX_HE) || defined(CONFIG_80211AC_VHT) || CONFIG_IEEE80211_BAND_5GHZ
|
||||
u8 proto_en;
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
#define COUNTRY_CHPLAN_EN_11AC(_ent) (((_ent)->proto_en & CHPLAN_PROTO_EN_AC) ? 1 : 0)
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
#define COUNTRY_CHPLAN_ASSIGN_EDCCA_MODE_5G_OVERRIDE(_val) , .edcca_mode_5g_override = (_val)
|
||||
#else
|
||||
#define COUNTRY_CHPLAN_EN_11AC(_ent) 0
|
||||
#define COUNTRY_CHPLAN_ASSIGN_EDCCA_MODE_5G_OVERRIDE(_val)
|
||||
#endif
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
#define COUNTRY_CHPLAN_ASSIGN_CHPLAN_6G(_val) , .domain_code_6g = (_val)
|
||||
#define COUNTRY_CHPLAN_ASSIGN_EDCCA_MODE_6G_OVERRIDE(_val) , .edcca_mode_6g_override = (_val)
|
||||
#else
|
||||
#define COUNTRY_CHPLAN_ASSIGN_CHPLAN_6G(_val)
|
||||
#define COUNTRY_CHPLAN_ASSIGN_EDCCA_MODE_6G_OVERRIDE(_val)
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_80211AX_HE) || defined(CONFIG_80211AC_VHT) || CONFIG_IEEE80211_BAND_5GHZ
|
||||
#define COUNTRY_CHPLAN_ASSIGN_PROTO_EN(_val) , .proto_en = (_val)
|
||||
#else
|
||||
#define COUNTRY_CHPLAN_ASSIGN_PROTO_EN(_val)
|
||||
#endif
|
||||
|
||||
#define COUNTRY_CHPLAN_ENT(_alpha2, _chplan, _chplan_6g, _txpwr_lmt_override, _en_11ax, _en_11ac, _en_11a) \
|
||||
{.alpha2 = (_alpha2), .domain_code = (_chplan) \
|
||||
COUNTRY_CHPLAN_ASSIGN_CHPLAN_6G(_chplan_6g) \
|
||||
, .edcca_mode_2g_override = RTW_EDCCA_DEF \
|
||||
COUNTRY_CHPLAN_ASSIGN_EDCCA_MODE_5G_OVERRIDE(RTW_EDCCA_DEF) \
|
||||
COUNTRY_CHPLAN_ASSIGN_EDCCA_MODE_6G_OVERRIDE(RTW_EDCCA_DEF) \
|
||||
, .txpwr_lmt_override = TXPWR_LMT_##_txpwr_lmt_override \
|
||||
COUNTRY_CHPLAN_ASSIGN_PROTO_EN((_en_11ax ? CHPLAN_PROTO_EN_AX : 0) | (_en_11ac ? CHPLAN_PROTO_EN_AC : 0) | (_en_11a ? CHPLAN_PROTO_EN_A : 0)) \
|
||||
}
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
#define COUNTRY_CHPLAN_EN_11A(_ent) (((_ent)->proto_en & CHPLAN_PROTO_EN_A) ? true : false)
|
||||
#else
|
||||
#define COUNTRY_CHPLAN_EN_11A(_ent) false
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
#define COUNTRY_CHPLAN_EN_11AC(_ent) (((_ent)->proto_en & CHPLAN_PROTO_EN_AC) ? true : false)
|
||||
#else
|
||||
#define COUNTRY_CHPLAN_EN_11AC(_ent) false
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_80211AX_HE
|
||||
#define COUNTRY_CHPLAN_EN_11AX(_ent) (((_ent)->proto_en & CHPLAN_PROTO_EN_AX) ? 1 : 0)
|
||||
#define COUNTRY_CHPLAN_EN_11AX(_ent) (((_ent)->proto_en & CHPLAN_PROTO_EN_AX) ? true : false)
|
||||
#else
|
||||
#define COUNTRY_CHPLAN_EN_11AX(_ent) 0
|
||||
#define COUNTRY_CHPLAN_EN_11AX(_ent) false
|
||||
#endif
|
||||
|
||||
void rtw_get_chplan_worldwide(struct country_chplan *ent);
|
||||
@@ -221,23 +271,38 @@ bool rtw_get_chplan_from_country(const char *country_code, struct country_chplan
|
||||
void rtw_chplan_ioctl_input_mapping(u16 *chplan, u16 *chplan_6g);
|
||||
bool rtw_chplan_ids_is_world_wide(u8 chplan, u8 chplan_6g);
|
||||
|
||||
u8 rtw_country_chplan_is_chbw_valid(struct country_chplan *ent, BAND_TYPE band, u8 ch, u8 bw, u8 offset
|
||||
, bool allow_primary_passive, bool allow_passive, struct registry_priv *regsty);
|
||||
u8 rtw_country_chplan_is_bchbw_valid(struct country_chplan *ent, enum band_type band, u8 ch, u8 bw, u8 offset
|
||||
, bool allow_primary_passive, bool allow_passive, struct rf_ctl_t *rfctl);
|
||||
|
||||
enum country_ie_slave_en_mode {
|
||||
CISEM_DISABLE = 0, /* disable */
|
||||
CISEM_ENABLE = 1, /* enable */
|
||||
CISEM_ENABLE_WW = 2, /* enable when INIT/USER set world wide mode */
|
||||
CISEM_NUM,
|
||||
};
|
||||
|
||||
#define CIS_EN_MODE_IS_VALID(mode) ((mode) < CISEM_NUM)
|
||||
|
||||
enum country_ie_slave_flags {
|
||||
CISF_INTERSECT = BIT0, /* if not set, choose effected one from received IEs */
|
||||
CISF_ENV_BSS = BIT1, /* if not set, consider IEs of associated BSSs only */
|
||||
};
|
||||
|
||||
enum country_ie_slave_status {
|
||||
COUNTRY_IE_SLAVE_NOCOUNTRY = 0,
|
||||
COUNTRY_IE_SLAVE_UNKNOWN = 1,
|
||||
COUNTRY_IE_SLAVE_NOCOUNTRY = 0,
|
||||
COUNTRY_IE_SLAVE_UNKNOWN = 1,
|
||||
COUNTRY_IE_SLAVE_OPCH_NOEXIST = 2,
|
||||
COUNTRY_IE_SLAVE_APPLICABLE = 3,
|
||||
COUNTRY_IE_SLAVE_APPLICABLE = 3,
|
||||
|
||||
COUNTRY_IE_SLAVE_STATUS_NUM,
|
||||
};
|
||||
|
||||
struct country_ie_slave_record {
|
||||
char alpha2[2]; /* country code get from connected AP of STA ifaces, "\x00\x00" is not set */
|
||||
BAND_TYPE band;
|
||||
enum band_type band;
|
||||
u8 opch;
|
||||
enum country_ie_slave_status status;
|
||||
struct country_chplan chplan;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_80211D
|
||||
@@ -246,12 +311,9 @@ extern const char *const _cis_status_str[];
|
||||
|
||||
void dump_country_ie_slave_records(void *sel, struct rf_ctl_t *rfctl, bool skip_noset);
|
||||
|
||||
enum country_ie_slave_status rtw_get_chplan_from_recv_country_ie(_adapter *adapter
|
||||
, BAND_TYPE band, u8 opch, const u8 *country_ie, struct country_chplan *ent
|
||||
, struct country_ie_slave_record *cisr, const char *caller_msg);
|
||||
|
||||
enum country_ie_slave_status rtw_get_chplan_from_cisrs(struct rf_ctl_t *rfctl
|
||||
, struct country_chplan *ent, const char *caller_msg);
|
||||
enum country_ie_slave_status rtw_get_cisr_from_recv_country_ie(struct rf_ctl_t *rfctl
|
||||
, enum band_type band, u8 opch, const u8 *country_ie
|
||||
, struct country_ie_slave_record *cisr, const char *caller_msg);
|
||||
#endif
|
||||
|
||||
void dump_country_chplan(void *sel, const struct country_chplan *ent, bool regd_info);
|
||||
@@ -268,4 +330,196 @@ void dump_chplan_test(void *sel);
|
||||
#endif
|
||||
void dump_chplan_ver(void *sel);
|
||||
|
||||
struct regd_req_t {
|
||||
_list list;
|
||||
int ref_cnt; /* used by RTK_PRIV's COUNTRY_IE req */
|
||||
bool applied;
|
||||
|
||||
enum regd_src_t src;
|
||||
enum rtw_regd_inr inr;
|
||||
|
||||
struct country_chplan chplan;
|
||||
};
|
||||
|
||||
void rtw_regd_req_list_init(struct rf_ctl_t *rfctl, struct registry_priv *regsty);
|
||||
void rtw_regd_req_list_free(struct rf_ctl_t *rfctl);
|
||||
|
||||
void rtw_regd_watchdog_hdl(struct dvobj_priv *dvobj);
|
||||
|
||||
struct _ADAPTER_LINK;
|
||||
enum channel_width alink_adjust_linking_bw_by_regd(struct _ADAPTER_LINK *alink
|
||||
, enum band_type band, u8 ch, enum channel_width bw, enum chan_offset offset);
|
||||
enum channel_width adapter_adjust_linking_bw_by_regd(_adapter *adapter
|
||||
, enum band_type band, u8 ch, enum channel_width bw, enum chan_offset offset);
|
||||
|
||||
void rtw_rfctl_decide_init_chplan(struct rf_ctl_t *rfctl,
|
||||
const char *hw_alpha2, u8 hw_chplan, u8 hw_chplan_6g, u8 hw_force_chplan);
|
||||
|
||||
bool rtw_rfctl_is_disable_sw_channel_plan(struct dvobj_priv *dvobj);
|
||||
|
||||
enum chplan_confs_type {
|
||||
CHPLAN_CONFS_DIS_CH_FLAGS,
|
||||
CHPLAN_CONFS_EXCL_CHS,
|
||||
CHPLAN_CONFS_EXCL_CHS_6G,
|
||||
CHPLAN_CONFS_INIT_REGD_ALWAYS_APPLY,
|
||||
CHPLAN_CONFS_USER_REGD_ALWAYS_APPLY,
|
||||
CHPLAN_CONFS_BCN_HINT_VALID_MS,
|
||||
CHPLAN_CONFS_CIS_EN_MODE,
|
||||
CHPLAN_CONFS_CIS_FLAGS,
|
||||
CHPLAN_CONFS_CIS_EN_ROLE,
|
||||
CHPLAN_CONFS_CIS_EN_IFBMP,
|
||||
CHPLAN_CONFS_CIS_SCAN_INT_MS,
|
||||
CHPLAN_CONFS_NUM,
|
||||
};
|
||||
|
||||
struct chplan_confs {
|
||||
u16 set_types; /* bitmap of chplan_confs_type */
|
||||
u8 dis_ch_flags;
|
||||
u8 excl_chs[MAX_CHANNEL_NUM_2G_5G];
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
u8 excl_chs_6g[MAX_CHANNEL_NUM_6G];
|
||||
#endif
|
||||
bool init_regd_always_apply;
|
||||
bool user_regd_always_apply;
|
||||
u32 bcn_hint_valid_ms;
|
||||
#ifdef CONFIG_80211D
|
||||
u8 cis_en_mode;
|
||||
u8 cis_flags;
|
||||
u8 cis_en_role;
|
||||
u8 cis_en_ifbmp;
|
||||
u32 cis_scan_int_ms;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct SetChannelPlan_param {
|
||||
enum regd_src_t regd_src;
|
||||
enum rtw_regd_inr inr;
|
||||
struct country_chplan country_ent;
|
||||
bool has_country;
|
||||
u8 channel_plan;
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
u8 channel_plan_6g;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_80211D
|
||||
/* used for regd_src == RTK_PRIV and inr == COUNTRY_IE */
|
||||
struct country_ie_slave_record cisr;
|
||||
u8 cisr_alink_id;
|
||||
bool has_cisr;
|
||||
#endif
|
||||
|
||||
struct chplan_confs confs;
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
bool rtnl_lock_needed;
|
||||
#endif
|
||||
};
|
||||
|
||||
u8 rtw_set_chplan_hdl(_adapter *adapter, u8 *pbuf);
|
||||
|
||||
u8 rtw_set_chplan_cmd(_adapter *adapter, int flags, u8 chplan, u8 chplan_6g, enum rtw_regd_inr inr);
|
||||
u8 rtw_set_country_cmd(_adapter *adapter, int flags, const char *country_code, enum rtw_regd_inr inr);
|
||||
#ifdef CONFIG_80211D
|
||||
u8 rtw_alink_apply_recv_country_ie_cmd(struct _ADAPTER_LINK *alink, int flags, enum band_type band,u8 opch, const u8 *country_ie);
|
||||
u8 rtw_apply_recv_country_ie_cmd(_adapter *adapter, int flags, enum band_type band,u8 opch, const u8 *country_ie);
|
||||
u8 rtw_apply_scan_network_country_ie_cmd(_adapter *adapter, int flags);
|
||||
#endif
|
||||
#ifdef CONFIG_REGD_SRC_FROM_OS
|
||||
u8 rtw_sync_os_regd_cmd(_adapter *adapter, int flags, const char *country_code, u8 dfs_region, enum rtw_regd_inr inr);
|
||||
#endif
|
||||
u8 rtw_set_chplan_confs_cmd(_adapter *adapter, int flags, struct chplan_confs *confs);
|
||||
#ifdef CONFIG_PROC_DEBUG
|
||||
u16 rtw_parse_chplan_confs_cmd_str(struct chplan_confs *confs, char *str);
|
||||
#endif
|
||||
|
||||
struct get_chplan_resp {
|
||||
enum regd_src_t regd_src;
|
||||
u8 regd_inr_bmp;
|
||||
char alpha2[2];
|
||||
u8 channel_plan;
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
u8 chplan_6g;
|
||||
#endif
|
||||
|
||||
#if CONFIG_TXPWR_LIMIT
|
||||
/* point to content of txpwr_lmt_names of specific band (after content of chset) */
|
||||
const char *txpwr_lmt_names[BAND_MAX];
|
||||
int txpwr_lmt_names_len[BAND_MAX];
|
||||
int txpwr_lmt_names_len_total; /* ease for free operation */
|
||||
#endif
|
||||
u8 edcca_mode_2g;
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
u8 edcca_mode_5g;
|
||||
#endif
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
u8 edcca_mode_6g;
|
||||
#endif
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
u8 dfs_domain;
|
||||
#endif
|
||||
u8 proto_en;
|
||||
|
||||
struct chplan_confs confs;
|
||||
|
||||
u8 chs_len;
|
||||
RT_CHANNEL_INFO chs[0];
|
||||
};
|
||||
|
||||
struct get_channel_plan_param {
|
||||
struct get_chplan_resp *chplan;
|
||||
};
|
||||
|
||||
u8 rtw_get_chplan_hdl(_adapter *adapter, u8 *pbuf);
|
||||
struct cmd_obj;
|
||||
void rtw_get_chplan_callback(_adapter *adapter, struct cmd_obj *cmdobj);
|
||||
|
||||
u8 rtw_get_chplan_cmd(_adapter *adapter, int flags, struct get_chplan_resp **chplan);
|
||||
void rtw_free_get_chplan_resp(struct get_chplan_resp *chplan);
|
||||
|
||||
#ifdef CONFIG_80211D
|
||||
void rtw_alink_joinbss_update_regulatory(struct _ADAPTER_LINK *alink, const WLAN_BSSID_EX *network);
|
||||
void rtw_alink_leavebss_update_regulatory(struct _ADAPTER_LINK * alink);
|
||||
void rtw_alink_csa_update_regulatory(struct _ADAPTER_LINK *alink, enum band_type req_band, u8 req_ch);
|
||||
void alink_process_country_ie(struct _ADAPTER_LINK *alink, u8 *ies, uint ies_len);
|
||||
|
||||
void rtw_joinbss_update_regulatory(_adapter *adapter, const WLAN_BSSID_EX *network);
|
||||
void rtw_leavebss_update_regulatory(_adapter *adapter);
|
||||
void rtw_csa_update_regulatory(_adapter *adapter, enum band_type req_band, u8 req_ch);
|
||||
void process_country_ie(_adapter *adapter, u8 *ies, uint ies_len);
|
||||
|
||||
bool rtw_update_scanned_network_cisr(struct rf_ctl_t *rfctl, struct wlan_network *network);
|
||||
|
||||
void rtw_rfctl_cis_init(struct rf_ctl_t *rfctl, struct registry_priv *regsty);
|
||||
void rtw_rfctl_cis_deinit(struct rf_ctl_t *rfctl);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PROC_DEBUG
|
||||
void dump_cur_chplan_confs(void *sel, struct rf_ctl_t *rfctl);
|
||||
void dump_cur_country(void *sel, struct rf_ctl_t *rfctl);
|
||||
void dump_cur_chplan(void *sel, struct rf_ctl_t *rfctl);
|
||||
#endif
|
||||
|
||||
#define CHPLAN_VER_STR_BUF_LEN 16
|
||||
|
||||
struct rtw_regdb_ops {
|
||||
u8 (*get_default_regd_2g)(u8 id);
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
u8 (*get_default_regd_5g)(u8 id);
|
||||
#endif
|
||||
bool (*is_domain_code_valid)(u8 id);
|
||||
bool (*domain_get_ch)(u8 id, u32 ch, u8 *flags);
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
u8 (*get_default_regd_6g)(u8 id);
|
||||
bool (*is_domain_code_6g_valid)(u8 id);
|
||||
bool (*domain_6g_get_ch)(u8 id, u32 ch, u8 *flags);
|
||||
#endif
|
||||
|
||||
bool (*get_chplan_from_alpha2)(const char *alpha2, struct country_chplan *ent);
|
||||
|
||||
#ifdef CONFIG_RTW_DEBUG
|
||||
void (*dump_chplan_test)(void *sel);
|
||||
#endif
|
||||
void (*get_ver_str)(char *buf, size_t buf_len);
|
||||
};
|
||||
|
||||
#endif /* __RTW_CHPLAN_H__ */
|
||||
|
||||
382
drivers/net/wireless/rtl8822cs/core/rtw_chset.c
Normal file
382
drivers/net/wireless/rtl8822cs/core/rtw_chset.c
Normal file
@@ -0,0 +1,382 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define _RTW_CHSET_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
const char *const _rtw_ch_type_str[] = {
|
||||
[RTW_CHT_DIS] = "DIS",
|
||||
[RTW_CHT_NO_IR] = "NO_IR",
|
||||
[RTW_CHT_DFS] = "DFS",
|
||||
[RTW_CHT_NO_HT40U] = "NO_40M+",
|
||||
[RTW_CHT_NO_HT40L] = "NO_40M-",
|
||||
[RTW_CHT_NO_80MHZ] = "NO_80M",
|
||||
[RTW_CHT_NO_160MHZ] = "NO_160M",
|
||||
[RTW_CHT_NUM] = "UNKNOWN",
|
||||
};
|
||||
|
||||
enum rtw_ch_type get_ch_type_from_str(const char *str, size_t str_len)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
for (i = 0; i < RTW_CHT_NUM; i++)
|
||||
if (str_len == strlen(rtw_ch_type_str(i))
|
||||
&& strncmp(str, rtw_ch_type_str(i), str_len) == 0)
|
||||
return i;
|
||||
return RTW_CHT_NUM;
|
||||
}
|
||||
|
||||
char *rtw_get_ch_flags_str(char *buf, u8 flags, char delim)
|
||||
{
|
||||
char *pos = buf;
|
||||
char d_str[2] = {delim, '\0'};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < RTW_CHT_NUM; i++) {
|
||||
if (!(flags & BIT(i)))
|
||||
continue;
|
||||
pos += snprintf(pos, RTW_CH_FLAGS_STR_LEN - (pos - buf), "%s%s"
|
||||
, pos == buf ? "" : d_str, rtw_ch_type_str(i));
|
||||
if (pos >= buf + RTW_CH_FLAGS_STR_LEN - 1)
|
||||
break;
|
||||
}
|
||||
if (pos == buf)
|
||||
*buf = '\0';
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
int rtw_chset_init(struct rtw_chset *chset, u8 band_bmp)
|
||||
{
|
||||
u8 ch_num = 0;
|
||||
int band, i;
|
||||
|
||||
_rtw_memset(chset->chs, 0, sizeof(RT_CHANNEL_INFO) * MAX_CHANNEL_NUM);
|
||||
|
||||
for (band = 0; band < BAND_MAX; band++) {
|
||||
u8 center_ch_num;
|
||||
u8 (*center_chs)(u8, u8);
|
||||
|
||||
if (!(band_bmp & band_to_band_cap(band)))
|
||||
continue;
|
||||
|
||||
center_ch_num = center_chs_num_of_band[band](CHANNEL_WIDTH_20);
|
||||
center_chs = center_chs_of_band[band];
|
||||
|
||||
chset->chs_of_band[band] = &chset->chs[ch_num];
|
||||
chset->chs_len_of_band[band] = 0;
|
||||
|
||||
for (i = 0; i < center_ch_num; i++) {
|
||||
chset->chs[ch_num].band = band;
|
||||
chset->chs[ch_num].ChannelNum = center_chs(CHANNEL_WIDTH_20, i);
|
||||
chset->chs_len_of_band[band]++;;
|
||||
ch_num++;
|
||||
}
|
||||
}
|
||||
|
||||
chset->chs_len = ch_num;
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
#if CONFIG_ALLOW_FUNC_2G_5G_ONLY
|
||||
/*
|
||||
* Search enabled channel with the @param ch in given @param ch_set
|
||||
* @ch_set: the given channel set
|
||||
* @ch: the given channel number
|
||||
*
|
||||
* return the index of channel_num in channel_set, -1 if not found
|
||||
*/
|
||||
RTW_FUNC_2G_5G_ONLY static int _rtw_chset_search_ch(const struct rtw_chset *chset, u32 ch, bool include_dis)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (ch == 0)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < chset->chs_len; i++) {
|
||||
if (ch == chset->chs[i].ChannelNum
|
||||
&& (include_dis || !(chset->chs[i].flags & RTW_CHF_DIS)))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
RTW_FUNC_2G_5G_ONLY int rtw_chset_search_ch(const struct rtw_chset *chset, u32 ch)
|
||||
{
|
||||
return _rtw_chset_search_ch(chset, ch, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Search enabled channel with the @param ch of @param band in given @param ch_set
|
||||
* @ch_set: the given channel set
|
||||
* @band: the given band
|
||||
* @ch: the given channel number
|
||||
*
|
||||
* return the index of channel_num in channel_set, -1 if not found
|
||||
*/
|
||||
static int _rtw_chset_search_bch(const struct rtw_chset *chset, enum band_type band, u32 ch, bool include_dis)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (ch == 0)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < chset->chs_len; i++) {
|
||||
if (band == chset->chs[i].band && ch == chset->chs[i].ChannelNum
|
||||
&& (include_dis || !(chset->chs[i].flags & RTW_CHF_DIS)))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int rtw_chset_search_bch(const struct rtw_chset *chset, enum band_type band, u32 ch)
|
||||
{
|
||||
return _rtw_chset_search_bch(chset, band, ch, false);
|
||||
}
|
||||
|
||||
RT_CHANNEL_INFO *rtw_chset_get_chinfo_by_bch(struct rtw_chset *chset, enum band_type band, u32 ch, bool include_dis)
|
||||
{
|
||||
int i = _rtw_chset_search_bch(chset, band, ch, include_dis);
|
||||
|
||||
return i >= 0 ? &chset->chs[i] : NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the @param ch, bw, offset is valid for the given @param ch_set
|
||||
* @ch_set: the given channel set
|
||||
* @ch: the given channel number
|
||||
* @bw: the given bandwidth
|
||||
* @offset: the given channel offset
|
||||
*
|
||||
* return valid (1) or not (0)
|
||||
*/
|
||||
static u8 _rtw_chset_is_bchbw_valid(const struct rtw_chset *chset, enum band_type band, u8 ch, u8 bw, u8 offset
|
||||
, bool allow_primary_passive, bool allow_passive)
|
||||
{
|
||||
u8 cch;
|
||||
u8 *op_chs;
|
||||
u8 op_ch_num;
|
||||
u8 valid = 0;
|
||||
int i;
|
||||
int ch_idx;
|
||||
|
||||
cch = rtw_get_center_ch_by_band(band, ch, bw, offset);
|
||||
|
||||
if (!rtw_get_op_chs_by_bcch_bw(band, cch, bw, &op_chs, &op_ch_num))
|
||||
goto exit;
|
||||
|
||||
for (i = 0; i < op_ch_num; i++) {
|
||||
if (0)
|
||||
RTW_INFO("%u,%u,%u,%u - cch:%u, bw:%u, op_ch:%u\n", band, ch, bw, offset, cch, bw, *(op_chs + i));
|
||||
ch_idx = rtw_chset_search_bch(chset, band, *(op_chs + i));
|
||||
if (ch_idx == -1)
|
||||
break;
|
||||
if (!allow_passive && chset->chs[ch_idx].flags & RTW_CHF_NO_IR) {
|
||||
/* all sub chs are passive is not allowed and one of sub ch is NO_IR */
|
||||
if (!allow_primary_passive) /* even primary ch is not allow to be NO_IR */
|
||||
break;
|
||||
if (chset->chs[ch_idx].ChannelNum != ch) /* allow primary ch NO_IR, but this is not primary ch */
|
||||
break;
|
||||
}
|
||||
if (bw >= CHANNEL_WIDTH_40) {
|
||||
if ((chset->chs[ch_idx].flags & RTW_CHF_NO_HT40U) && i % 2 == 0)
|
||||
break;
|
||||
if ((chset->chs[ch_idx].flags & RTW_CHF_NO_HT40L) && i % 2 == 1)
|
||||
break;
|
||||
}
|
||||
if (bw >= CHANNEL_WIDTH_80 && (chset->chs[ch_idx].flags & RTW_CHF_NO_80MHZ))
|
||||
break;
|
||||
if (bw >= CHANNEL_WIDTH_160 && (chset->chs[ch_idx].flags & RTW_CHF_NO_160MHZ))
|
||||
break;
|
||||
}
|
||||
|
||||
if (op_ch_num != 0 && i == op_ch_num)
|
||||
valid = 1;
|
||||
|
||||
exit:
|
||||
return valid;
|
||||
}
|
||||
|
||||
#if CONFIG_ALLOW_FUNC_2G_5G_ONLY
|
||||
RTW_FUNC_2G_5G_ONLY u8 rtw_chset_is_chbw_valid(const struct rtw_chset *chset, u8 ch, u8 bw, u8 offset, bool allow_primary_passive, bool allow_passive)
|
||||
{
|
||||
return _rtw_chset_is_bchbw_valid(chset, rtw_is_2g_ch(ch) ? BAND_ON_24G : BAND_ON_5G, ch, bw, offset, allow_primary_passive, allow_passive);
|
||||
}
|
||||
#endif
|
||||
|
||||
u8 rtw_chset_is_bchbw_valid(const struct rtw_chset *chset, enum band_type band, u8 ch, u8 bw, u8 offset
|
||||
, bool allow_primary_passive, bool allow_passive)
|
||||
{
|
||||
return _rtw_chset_is_bchbw_valid(chset, band, ch, bw, offset, allow_primary_passive, allow_passive);
|
||||
}
|
||||
|
||||
/**
|
||||
* rtw_chset_sync_bchbw - obey g_ch, adjust g_bw, g_offset, bw, offset to fit in channel plan
|
||||
* @ch_set: channel plan to check
|
||||
* @req_ch: pointer of the request ch, may be modified further
|
||||
* @req_bw: pointer of the request bw, may be modified further
|
||||
* @req_offset: pointer of the request offset, may be modified further
|
||||
* @g_ch: pointer of the ongoing group ch
|
||||
* @g_bw: pointer of the ongoing group bw, may be modified further
|
||||
* @g_offset: pointer of the ongoing group offset, may be modified further
|
||||
* @allow_primary_passive: if allow passive primary ch when deciding chbw
|
||||
* @allow_passive: if allow passive ch (not primary) when deciding chbw
|
||||
*/
|
||||
void rtw_chset_sync_bchbw(const struct rtw_chset *chset, enum band_type *req_band, u8 *req_ch, u8 *req_bw, u8 *req_offset
|
||||
, enum band_type *g_band, u8 *g_ch, u8 *g_bw, u8 *g_offset, bool allow_primary_passive, bool allow_passive)
|
||||
{
|
||||
enum band_type r_band;
|
||||
u8 r_ch, r_bw, r_offset;
|
||||
enum band_type u_band;
|
||||
u8 u_ch, u_bw, u_offset;
|
||||
u8 cur_bw = *req_bw;
|
||||
|
||||
while (1) {
|
||||
r_band = *req_band;
|
||||
r_ch = *req_ch;
|
||||
r_bw = cur_bw;
|
||||
r_offset = *req_offset;
|
||||
u_band = *g_band;
|
||||
u_ch = *g_ch;
|
||||
u_bw = *g_bw;
|
||||
u_offset = *g_offset;
|
||||
|
||||
rtw_sync_bchbw(&r_band, &r_ch, &r_bw, &r_offset, &u_band, &u_ch, &u_bw, &u_offset);
|
||||
|
||||
if (rtw_chset_is_bchbw_valid(chset, r_band, r_ch, r_bw, r_offset, allow_primary_passive, allow_passive))
|
||||
break;
|
||||
if (cur_bw == CHANNEL_WIDTH_20) {
|
||||
rtw_warn_on(1);
|
||||
break;
|
||||
}
|
||||
cur_bw--;
|
||||
};
|
||||
|
||||
*req_band = r_band;
|
||||
*req_ch = r_ch;
|
||||
*req_bw = r_bw;
|
||||
*req_offset = r_offset;
|
||||
*g_band = u_band;
|
||||
*g_ch = u_ch;
|
||||
*g_bw = u_bw;
|
||||
*g_offset = u_offset;
|
||||
}
|
||||
|
||||
#if CONFIG_ALLOW_FUNC_2G_5G_ONLY
|
||||
RTW_FUNC_2G_5G_ONLY void rtw_chset_sync_chbw(const struct rtw_chset *chset, u8 *req_ch, u8 *req_bw, u8 *req_offset
|
||||
, u8 *g_ch, u8 *g_bw, u8 *g_offset, bool allow_primary_passive, bool allow_passive)
|
||||
{
|
||||
enum band_type band = rtw_is_2g_ch(*g_ch) ? BAND_ON_24G : BAND_ON_5G; /* follow g_ch's band */
|
||||
|
||||
rtw_chset_sync_bchbw(chset, &band, req_ch, req_bw, req_offset, &band, g_ch, g_bw, g_offset, allow_primary_passive, allow_passive);
|
||||
}
|
||||
#endif
|
||||
|
||||
u8 *rtw_chset_set_spt_chs_ie(struct rtw_chset *chset, u8 *buf_pos, uint *buf_len)
|
||||
{
|
||||
u8 i = 0;
|
||||
u8 fch = 0, lch = 0, ch;
|
||||
u8 *cont = buf_pos + 2;
|
||||
RT_CHANNEL_INFO *chinfo;
|
||||
|
||||
while (i < chset->chs_len) {
|
||||
chinfo = &chset->chs[i++];
|
||||
|
||||
if (chinfo->flags & RTW_CHF_DIS)
|
||||
continue;
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
/* don't appnd 6G chs now, how to distinguish 2G/5G chs with 6G? */
|
||||
if (chinfo->band == BAND_ON_6G)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
ch = chinfo->ChannelNum;
|
||||
if (fch == 0) {
|
||||
fch = ch;
|
||||
lch = ch;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (lch + 1 != ch) {
|
||||
*cont = fch;
|
||||
*(cont + 1) = lch - fch + 1;
|
||||
cont += 2;
|
||||
fch = ch;
|
||||
}
|
||||
lch = ch;
|
||||
}
|
||||
if (fch) {
|
||||
/* last subband */
|
||||
*cont = fch;
|
||||
*(cont + 1) = lch - fch + 1;
|
||||
cont += 2;
|
||||
}
|
||||
|
||||
if (cont > buf_pos + 2) {
|
||||
*buf_pos = WLAN_EID_SUPPORTED_CHANNELS;
|
||||
*(buf_pos + 1) = cont - buf_pos - 2;
|
||||
*buf_len += cont - buf_pos;
|
||||
return cont;
|
||||
}
|
||||
return buf_pos;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PROC_DEBUG
|
||||
void dump_chinfos(void *sel, const RT_CHANNEL_INFO *chinfos, u8 chinfo_num)
|
||||
{
|
||||
u32 bhint_sec;
|
||||
char bhint_buf[8];
|
||||
u16 non_ocp_sec;
|
||||
char non_ocp_buf[8];
|
||||
char flags_buf[RTW_CH_FLAGS_STR_LEN];
|
||||
u8 enable_ch_num = 0;
|
||||
u8 i;
|
||||
|
||||
RTW_PRINT_SEL(sel, "%-3s %-4s %-5s %-4s flags\n", "ch", "freq", "bhint", "nocp");
|
||||
|
||||
for (i = 0; i < chinfo_num; i++) {
|
||||
if (chinfos[i].flags & RTW_CHF_DIS)
|
||||
continue;
|
||||
enable_ch_num++;
|
||||
|
||||
bhint_sec = 0;
|
||||
if (CH_IS_BCN_HINT(&chinfos[i])) {
|
||||
bhint_sec = rtw_systime_to_ms(chinfos[i].bcn_hint_end_time - rtw_get_current_time()) / 1000;
|
||||
if (bhint_sec > 99999)
|
||||
bhint_sec = 99999;
|
||||
}
|
||||
snprintf(bhint_buf, 8, "%d", bhint_sec);
|
||||
|
||||
non_ocp_sec = 0;
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
if (CH_IS_NON_OCP(&chinfos[i]))
|
||||
non_ocp_sec = rtw_systime_to_ms(chinfos[i].non_ocp_end_time - rtw_get_current_time()) / 1000;
|
||||
#endif
|
||||
snprintf(non_ocp_buf, 8, "%d", non_ocp_sec);
|
||||
|
||||
RTW_PRINT_SEL(sel, "%3u %4u %5s %4s %s\n"
|
||||
, chinfos[i].ChannelNum, rtw_bch2freq(chinfos[i].band, chinfos[i].ChannelNum)
|
||||
, bhint_buf, non_ocp_buf, rtw_get_ch_flags_str(flags_buf, chinfos[i].flags, ' ')
|
||||
);
|
||||
}
|
||||
|
||||
RTW_PRINT_SEL(sel, "total ch number:%d\n", enable_ch_num);
|
||||
}
|
||||
#endif /* CONFIG_PROC_DEBUG */
|
||||
112
drivers/net/wireless/rtl8822cs/core/rtw_chset.h
Normal file
112
drivers/net/wireless/rtl8822cs/core/rtw_chset.h
Normal file
@@ -0,0 +1,112 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __RTW_CHSET_H__
|
||||
#define __RTW_CHSET_H__
|
||||
|
||||
enum rtw_ch_type {
|
||||
RTW_CHT_DIS = 0,
|
||||
RTW_CHT_NO_IR = 1,
|
||||
RTW_CHT_DFS = 2,
|
||||
RTW_CHT_NO_HT40U = 3,
|
||||
RTW_CHT_NO_HT40L = 4,
|
||||
RTW_CHT_NO_80MHZ = 5,
|
||||
RTW_CHT_NO_160MHZ = 6,
|
||||
RTW_CHT_NUM,
|
||||
};
|
||||
|
||||
extern const char *const _rtw_ch_type_str[];
|
||||
#define rtw_ch_type_str(type) (((type) >= RTW_CHT_NUM) ? _rtw_ch_type_str[RTW_CHT_NUM] : _rtw_ch_type_str[(type)])
|
||||
|
||||
enum rtw_ch_type get_ch_type_from_str(const char *str, size_t str_len);
|
||||
|
||||
enum {
|
||||
RTW_CHF_DIS = BIT(RTW_CHT_DIS),
|
||||
RTW_CHF_NO_IR = BIT(RTW_CHT_NO_IR),
|
||||
RTW_CHF_DFS = BIT(RTW_CHT_DFS),
|
||||
RTW_CHF_NO_HT40U = BIT(RTW_CHT_NO_HT40U),
|
||||
RTW_CHF_NO_HT40L = BIT(RTW_CHT_NO_HT40L),
|
||||
RTW_CHF_NO_80MHZ = BIT(RTW_CHT_NO_80MHZ),
|
||||
RTW_CHF_NO_160MHZ = BIT(RTW_CHT_NO_160MHZ),
|
||||
};
|
||||
|
||||
#define RTW_CH_FLAGS_STR_LEN (45)
|
||||
char *rtw_get_ch_flags_str(char *buf, u8 flags, char delim);
|
||||
|
||||
/* The channel information about this channel including joining, scanning, and power constraints. */
|
||||
typedef struct _RT_CHANNEL_INFO {
|
||||
u8 band; /* enum band_type */
|
||||
u8 ChannelNum; /* The channel number. */
|
||||
|
||||
/*
|
||||
* Bitmap and its usage:
|
||||
* RTW_CHF_DIS, RTW_CHF_NO_IR, RTW_CHF_DFS: is used to check for status
|
||||
* RTW_CHF_NO_HT40U, RTW_CHF_NO_HT40L, RTW_CHF_NO_80MHZ, RTW_CHF_NO_160MHZ: extra bandwidth limitation (ex: from regulatory)
|
||||
*/
|
||||
u8 flags;
|
||||
|
||||
bool reg_no_ir;
|
||||
systime bcn_hint_end_time;
|
||||
|
||||
#ifdef CONFIG_FIND_BEST_CHANNEL
|
||||
u32 rx_count;
|
||||
#endif
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ && CONFIG_DFS
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
bool cac_done;
|
||||
systime non_ocp_end_time;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
u8 hidden_bss_cnt; /* per scan count */
|
||||
|
||||
#if defined(CONFIG_IOCTL_CFG80211) && !RTW_PER_ADAPTER_WIPHY
|
||||
void *os_chan;
|
||||
#endif
|
||||
} RT_CHANNEL_INFO, *PRT_CHANNEL_INFO;
|
||||
|
||||
#define RTW_BCN_HINT_STOPPED 0 /* used by bcn_hint_end_time time stamps */
|
||||
#define CH_IS_BCN_HINT_STOPPED(rt_ch_info) ((rt_ch_info)->bcn_hint_end_time == RTW_BCN_HINT_STOPPED)
|
||||
#define CH_IS_BCN_HINT(rt_ch_info) (!CH_IS_BCN_HINT_STOPPED(rt_ch_info) && rtw_time_after((rt_ch_info)->bcn_hint_end_time, rtw_get_current_time()))
|
||||
|
||||
struct rtw_chset {
|
||||
RT_CHANNEL_INFO chs[MAX_CHANNEL_NUM];
|
||||
u8 chs_len;
|
||||
RT_CHANNEL_INFO *chs_of_band[BAND_MAX];
|
||||
u8 chs_len_of_band[BAND_MAX];
|
||||
u8 enable_ch_num;
|
||||
};
|
||||
|
||||
int rtw_chset_init(struct rtw_chset *chset, u8 band_bmp);
|
||||
|
||||
RTW_FUNC_2G_5G_ONLY int rtw_chset_search_ch(const struct rtw_chset *chset, u32 ch);
|
||||
RTW_FUNC_2G_5G_ONLY u8 rtw_chset_is_chbw_valid(const struct rtw_chset *chset, u8 ch, u8 bw, u8 offset
|
||||
, bool allow_primary_passive, bool allow_passive);
|
||||
RTW_FUNC_2G_5G_ONLY void rtw_chset_sync_chbw(const struct rtw_chset *chset, u8 *req_ch, u8 *req_bw, u8 *req_offset
|
||||
, u8 *g_ch, u8 *g_bw, u8 *g_offset, bool allow_primary_passive, bool allow_passive);
|
||||
int rtw_chset_search_bch(const struct rtw_chset *chset, enum band_type band, u32 ch);
|
||||
RT_CHANNEL_INFO *rtw_chset_get_chinfo_by_bch(struct rtw_chset *chset, enum band_type band, u32 ch, bool include_dis);
|
||||
u8 rtw_chset_is_bchbw_valid(const struct rtw_chset *chset, enum band_type band, u8 ch, u8 bw, u8 offset
|
||||
, bool allow_primary_passive, bool allow_passive);
|
||||
void rtw_chset_sync_bchbw(const struct rtw_chset *chset, enum band_type *req_band, u8 *req_ch, u8 *req_bw, u8 *req_offset
|
||||
, enum band_type *g_band, u8 *g_ch, u8 *g_bw, u8 *g_offset, bool allow_primary_passive, bool allow_passive);
|
||||
|
||||
u8 *rtw_chset_set_spt_chs_ie(struct rtw_chset *chset, u8 *buf_pos, uint *buf_len);
|
||||
|
||||
#ifdef CONFIG_PROC_DEBUG
|
||||
void dump_chinfos(void *sel, const RT_CHANNEL_INFO *chinfos, u8 chinfo_num);
|
||||
#endif
|
||||
|
||||
#endif /* __RTW_CHSET_H__ */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1612
drivers/net/wireless/rtl8822cs/core/rtw_dfs.c
Normal file
1612
drivers/net/wireless/rtl8822cs/core/rtw_dfs.c
Normal file
File diff suppressed because it is too large
Load Diff
95
drivers/net/wireless/rtl8822cs/core/rtw_dfs.h
Normal file
95
drivers/net/wireless/rtl8822cs/core/rtw_dfs.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __RTW_DFS_H__
|
||||
#define __RTW_DFS_H__
|
||||
|
||||
#define CAC_TIME_MS (60*1000)
|
||||
#define CAC_TIME_CE_MS (10*60*1000)
|
||||
#define NON_OCP_TIME_MS (30*60*1000)
|
||||
|
||||
#define RTW_CAC_STOPPED 0 /* used by cac_start_time, cac_end_time time stamps */
|
||||
#define RTW_NON_OCP_STOPPED 0 /* used by non_ocp_end_time time stamps */
|
||||
|
||||
bool rtw_chset_is_dfs_range(const struct rtw_chset *chset, u32 hi, u32 lo);
|
||||
RTW_FUNC_2G_5G_ONLY bool rtw_chset_is_dfs_ch(const struct rtw_chset *chset, u8 ch);
|
||||
RTW_FUNC_2G_5G_ONLY bool rtw_chset_is_dfs_chbw(const struct rtw_chset *chset, u8 ch, u8 bw, u8 offset);
|
||||
bool rtw_chset_is_dfs_bch(const struct rtw_chset *chset, enum band_type band, u8 ch);
|
||||
bool rtw_chset_is_dfs_bchbw(const struct rtw_chset *chset, enum band_type band, u8 ch, u8 bw, u8 offset);
|
||||
|
||||
enum rtw_dfs_regd rtw_rfctl_get_dfs_domain(struct rf_ctl_t *rfctl);
|
||||
bool rtw_rfctl_radar_detect_supported(struct rf_ctl_t *rfctl);
|
||||
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
struct rf_ctl_t;
|
||||
enum phl_band_idx;
|
||||
|
||||
#define CH_IS_NON_OCP_STOPPED(rt_ch_info) ((rt_ch_info)->non_ocp_end_time == RTW_NON_OCP_STOPPED)
|
||||
#define CH_IS_NON_OCP(rt_ch_info) (!CH_IS_NON_OCP_STOPPED(rt_ch_info) && rtw_time_after((rt_ch_info)->non_ocp_end_time, rtw_get_current_time()))
|
||||
|
||||
bool rtw_rfctl_overlap_radar_detect_ch(struct rf_ctl_t *rfctl, enum band_type band, u8 ch, u8 bw, u8 offset);
|
||||
bool rtw_rfctl_hwband_is_tx_blocked_by_ch_waiting(struct rf_ctl_t *rfctl, enum phl_band_idx hwband);
|
||||
bool adapter_is_tx_blocked_by_ch_waiting(_adapter *adapter);
|
||||
bool alink_is_tx_blocked_by_ch_waiting(struct _ADAPTER_LINK *alink);
|
||||
|
||||
RTW_FUNC_2G_5G_ONLY bool rtw_chset_is_chbw_non_ocp(const struct rtw_chset *chset, u8 ch, u8 bw, u8 offset);
|
||||
RTW_FUNC_2G_5G_ONLY bool rtw_chset_is_ch_non_ocp(const struct rtw_chset *chset, u8 ch);
|
||||
bool rtw_chset_is_bchbw_non_ocp(const struct rtw_chset *chset, enum band_type band, u8 ch, u8 bw, u8 offset);
|
||||
bool rtw_chset_is_bch_non_ocp(const struct rtw_chset *chset, enum band_type band, u8 ch);
|
||||
|
||||
void rtw_rfctl_chset_chk_non_ocp_finish(struct rf_ctl_t *rfctl);
|
||||
|
||||
void rtw_rfctl_force_update_non_ocp_ms(struct rf_ctl_t *rfctl, enum band_type band, u8 ch, u8 bw, u8 offset, int ms);
|
||||
|
||||
u32 rtw_get_ch_waiting_ms(struct rf_ctl_t *rfctl, enum band_type band, u8 ch, u8 bw, u8 offset, u32 *r_non_ocp_ms, u32 *r_cac_ms);
|
||||
|
||||
u32 rtw_force_stop_cac(struct rf_ctl_t *rfctl, u32 timeout_ms);
|
||||
|
||||
u8 rtw_dfs_rd_hdl(struct dvobj_priv *dvobj, enum phl_band_idx hwband, u8 radar_cch, enum channel_width radar_bw);
|
||||
|
||||
void rtw_dfs_rd_en_dec_update(struct dvobj_priv *dvobj, enum phl_band_idx hwband);
|
||||
u8 rtw_dfs_rd_en_decision_cmd(struct dvobj_priv *dvobj, enum phl_band_idx hwband);
|
||||
|
||||
void rtw_indicate_cac_state_on_bss_start(_adapter *adapter);
|
||||
void rtw_indicate_cac_state_on_bss_stop(_adapter *adapter);
|
||||
|
||||
#else
|
||||
#define CH_IS_NON_OCP(rt_ch_info) 0
|
||||
#define rtw_rfctl_hwband_is_tx_blocked_by_ch_waiting(rfctl, hwband) false
|
||||
#define adapter_is_tx_blocked_by_ch_waiting(adapter) false
|
||||
#define alink_is_tx_blocked_by_ch_waiting(alink) false
|
||||
|
||||
RTW_FUNC_2G_5G_ONLY static inline bool rtw_chset_is_chbw_non_ocp(const struct rtw_chset *chset, u8 ch, u8 bw, u8 offset) { return false; }
|
||||
RTW_FUNC_2G_5G_ONLY static inline bool rtw_chset_is_ch_non_ocp(const struct rtw_chset *chset, u8 ch) { return false; }
|
||||
#define rtw_chset_is_bchbw_non_ocp(chset, band, ch, bw, offset) false
|
||||
#define rtw_chset_is_bch_non_ocp(chset, band, ch) false
|
||||
#endif /* CONFIG_DFS_MASTER */
|
||||
|
||||
#if CONFIG_DFS && CONFIG_IEEE80211_BAND_5GHZ
|
||||
void rtw_dfs_rd_en_dec_on_mlme_act(_adapter *adapter, struct _ADAPTER_LINK *alink, u8 mlme_act, u8 excl_ifbmp);
|
||||
void dump_radar_detect_status(void *sel, struct rf_ctl_t *rfctl, const char *title);
|
||||
#endif
|
||||
|
||||
bool rtw_rfctl_choose_bchbw(struct rf_ctl_t *rfctl
|
||||
, enum band_type sel_band, u8 sel_ch, u8 max_bw, enum chan_offset sel_offset
|
||||
, enum band_type cur_band, u8 cur_ch, enum chan_offset cur_offset
|
||||
, enum band_type *band, u8 *ch, u8 *bw, u8 *offset
|
||||
, bool by_int_info, u8 mesh_only, const char *caller);
|
||||
|
||||
RTW_FUNC_2G_5G_ONLY bool rtw_rfctl_choose_chbw(struct rf_ctl_t *rfctl, u8 sel_ch, u8 max_bw, enum chan_offset sel_offset
|
||||
, u8 cur_ch, enum chan_offset cur_offset, u8 *ch, u8 *bw, u8 *offset, bool by_int_info, u8 mesh_only, const char *caller);
|
||||
|
||||
void rtw_rfctl_dfs_init(struct rf_ctl_t *rfctl, struct registry_priv *regsty);
|
||||
|
||||
#endif /* __RTW_DFS_H__ */
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
#ifdef CONFIG_RTW_80211R
|
||||
#if defined(CONFIG_IOCTL_CFG80211) && defined(CONFIG_RTW_80211R)
|
||||
|
||||
#ifndef RTW_FT_DBG
|
||||
#define RTW_FT_DBG 0
|
||||
@@ -36,7 +36,7 @@ void rtw_ft_info_init(struct ft_roam_info *pft)
|
||||
_rtw_memset(pft, 0, sizeof(struct ft_roam_info));
|
||||
pft->ft_flags = 0
|
||||
| RTW_FT_EN
|
||||
/* | RTW_FT_OTD_EN */
|
||||
| RTW_FT_OTD_EN
|
||||
#ifdef CONFIG_RTW_BTM_ROAM
|
||||
| RTW_FT_BTM_ROAM
|
||||
#endif
|
||||
@@ -89,11 +89,11 @@ u8 rtw_ft_chk_roaming_candidate(
|
||||
u32 mdie_len = 0;
|
||||
struct ft_roam_info *pft_roam = &(padapter->mlmepriv.ft_roam);
|
||||
|
||||
if (!(pmdie = rtw_get_ie(&competitor->network.IEs[12],
|
||||
_MDIE_, &mdie_len, competitor->network.IELength-12))) {
|
||||
if (!(pmdie = rtw_get_ie(&competitor->network.IEs[12], _MDIE_,
|
||||
&mdie_len, competitor->network.IELength-12))) {
|
||||
RTW_INFO("FT : MDIE not foud in competitor!\n");
|
||||
return _FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!_rtw_memcmp(&pft_roam->mdid, (pmdie+2), 2)) {
|
||||
RTW_INFO("FT : unmatched MDIE!\n");
|
||||
@@ -103,47 +103,52 @@ u8 rtw_ft_chk_roaming_candidate(
|
||||
/*The candidate don't support over-the-DS*/
|
||||
if (rtw_ft_valid_otd_candidate(padapter, pmdie)) {
|
||||
RTW_INFO("FT: ignore the candidate("
|
||||
MAC_FMT ") for over-the-DS\n",
|
||||
MAC_FMT ") for over-the-DS\n",
|
||||
MAC_ARG(competitor->network.MacAddress));
|
||||
/* rtw_ft_clr_flags(padapter, RTW_FT_PEER_OTD_EN); */
|
||||
return _FALSE;
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
if (rtw_ft_chk_flags(padapter, RTW_FT_TEST_RSSI_ROAM)) {
|
||||
if (!_rtw_memcmp(padapter->mlmepriv.cur_network.network.MacAddress,
|
||||
if (!_rtw_memcmp(
|
||||
padapter->mlmepriv.cur_network.network.MacAddress,
|
||||
competitor->network.MacAddress, ETH_ALEN) ) {
|
||||
competitor->network.Rssi +=20;
|
||||
RTW_FT_INFO("%s : update "MAC_FMT" RSSI to %d for RTW_FT_TEST_RSSI_ROAM\n",
|
||||
RTW_FT_INFO("%s : update "MAC_FMT
|
||||
" RSSI to %d for RTW_FT_TEST_RSSI_ROAM\n",
|
||||
__func__, MAC_ARG(competitor->network.MacAddress),
|
||||
(int)competitor->network.Rssi);
|
||||
rtw_ft_clr_flags(padapter, RTW_FT_TEST_RSSI_ROAM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
void rtw_ft_update_stainfo(_adapter *padapter, WLAN_BSSID_EX *pnetwork)
|
||||
{
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta = NULL;
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, pnetwork->MacAddress);
|
||||
if (psta == NULL)
|
||||
psta = rtw_alloc_stainfo(pstapriv, pnetwork->MacAddress);
|
||||
|
||||
if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
|
||||
|
||||
if (psta && (padapter->securitypriv.dot11AuthAlgrthm ==
|
||||
dot11AuthAlgrthm_8021X)) {
|
||||
padapter->securitypriv.binstallGrpkey = _FALSE;
|
||||
padapter->securitypriv.busetkipkey = _FALSE;
|
||||
padapter->securitypriv.bgrpkey_handshake = _FALSE;
|
||||
|
||||
psta->ieee8021x_blocked = _TRUE;
|
||||
psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
|
||||
|
||||
_rtw_memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype));
|
||||
_rtw_memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof(union Keytype));
|
||||
_rtw_memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof(union Keytype));
|
||||
psta->dot118021XPrivacy = \
|
||||
padapter->securitypriv.dot11PrivacyAlgrthm;
|
||||
_rtw_memset((u8 *)&psta->dot118021x_UncstKey,
|
||||
0, sizeof(union Keytype));
|
||||
_rtw_memset((u8 *)&psta->dot11tkiprxmickey,
|
||||
0, sizeof(union Keytype));
|
||||
_rtw_memset((u8 *)&psta->dot11tkiptxmickey,
|
||||
0, sizeof(union Keytype));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -163,37 +168,40 @@ void rtw_ft_reassoc_event_callback(_adapter *padapter, u8 *pbuf)
|
||||
rtw_ft_update_stainfo(padapter, pnetwork);
|
||||
ft_evt_parms.ies_len = pft_roam->ft_event.ies_len;
|
||||
ft_evt_parms.ies = rtw_zmalloc(ft_evt_parms.ies_len);
|
||||
if (ft_evt_parms.ies)
|
||||
_rtw_memcpy((void *)ft_evt_parms.ies, pft_roam->ft_event.ies, ft_evt_parms.ies_len);
|
||||
else
|
||||
if (ft_evt_parms.ies) {
|
||||
_rtw_memcpy((void *)ft_evt_parms.ies,
|
||||
pft_roam->ft_event.ies, ft_evt_parms.ies_len);
|
||||
} else
|
||||
goto err_2;
|
||||
|
||||
ft_evt_parms.target_ap = rtw_zmalloc(ETH_ALEN);
|
||||
if (ft_evt_parms.target_ap)
|
||||
_rtw_memcpy((void *)ft_evt_parms.target_ap, pstassoc->macaddr, ETH_ALEN);
|
||||
else
|
||||
if (ft_evt_parms.target_ap) {
|
||||
_rtw_memcpy((void *)ft_evt_parms.target_ap,
|
||||
pstassoc->macaddr, ETH_ALEN);
|
||||
} else
|
||||
goto err_1;
|
||||
|
||||
ft_evt_parms.ric_ies = pft_roam->ft_event.ric_ies;
|
||||
ft_evt_parms.ric_ies_len = pft_roam->ft_event.ric_ies_len;
|
||||
|
||||
/* It's a KERNEL issue between v4.11 ~ v4.16,
|
||||
/* It's a KERNEL issue between v4.11 ~ v4.16,
|
||||
* <= v4.10, NLMSG_DEFAULT_SIZE is used for nlmsg_new().
|
||||
* v4.11 ~ v4.16, only used "100 + >ric_ies_len" for nlmsg_new()
|
||||
* v4.11 ~ v4.16, only used "100 + >ric_ies_len" for nlmsg_new()
|
||||
* even then DRIVER don't support RIC.
|
||||
* >= v4.17, issue should correct as "100 + ies_len + ric_ies_len".
|
||||
*/
|
||||
*/
|
||||
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)) && \
|
||||
(LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)))
|
||||
if (!ft_evt_parms.ric_ies_len)
|
||||
ft_evt_parms.ric_ies_len = ft_evt_parms.ies_len;
|
||||
else
|
||||
ft_evt_parms.ric_ies_len += ft_evt_parms.ies_len;
|
||||
#endif
|
||||
|
||||
else
|
||||
ft_evt_parms.ric_ies_len += ft_evt_parms.ies_len;
|
||||
#endif
|
||||
|
||||
rtw_ft_lock_set_status(padapter, RTW_FT_AUTHENTICATED_STA, &irqL);
|
||||
rtw_cfg80211_ft_event(padapter, &ft_evt_parms);
|
||||
RTW_INFO("%s: to "MAC_FMT"\n", __func__, MAC_ARG(ft_evt_parms.target_ap));
|
||||
RTW_INFO("%s: to "MAC_FMT"\n", __func__,
|
||||
MAC_ARG(ft_evt_parms.target_ap));
|
||||
|
||||
rtw_mfree((u8 *)pft_roam->ft_event.target_ap, ETH_ALEN);
|
||||
err_1:
|
||||
@@ -203,7 +211,7 @@ err_2:
|
||||
}
|
||||
|
||||
void rtw_ft_validate_akm_type(_adapter *padapter,
|
||||
struct wlan_network *pnetwork)
|
||||
WLAN_BSSID_EX *network)
|
||||
{
|
||||
struct security_priv *psecuritypriv = &(padapter->securitypriv);
|
||||
struct ft_roam_info *pft_roam = &(padapter->mlmepriv.ft_roam);
|
||||
@@ -212,31 +220,50 @@ void rtw_ft_validate_akm_type(_adapter *padapter,
|
||||
|
||||
/*IEEE802.11-2012 Std. Table 8-101-AKM suite selectors*/
|
||||
if (rtw_ft_valid_akm(padapter, psecuritypriv->rsn_akm_suite_type)) {
|
||||
ptmp = rtw_get_ie(&pnetwork->network.IEs[12],
|
||||
_MDIE_, &tmp_len, (pnetwork->network.IELength-12));
|
||||
ptmp = rtw_get_ie(&network->IEs[12],
|
||||
_MDIE_, &tmp_len,
|
||||
(network->IELength-12));
|
||||
if (ptmp) {
|
||||
pft_roam->mdid = *(u16 *)(ptmp+2);
|
||||
pft_roam->ft_cap = *(ptmp+4);
|
||||
|
||||
RTW_INFO("FT: target " MAC_FMT " mdid=(0x%2x), capacity=(0x%2x)\n",
|
||||
MAC_ARG(pnetwork->network.MacAddress), pft_roam->mdid, pft_roam->ft_cap);
|
||||
RTW_INFO("FT: target "MAC_FMT
|
||||
" mdid=(0x%2x), capacity=(0x%2x)\n",
|
||||
MAC_ARG(network->MacAddress),
|
||||
pft_roam->mdid, pft_roam->ft_cap);
|
||||
|
||||
rtw_ft_set_flags(padapter, RTW_FT_PEER_EN);
|
||||
RTW_FT_INFO("%s : peer support FTOTA(0x%02x)\n", __func__, pft_roam->ft_flags);
|
||||
|
||||
RTW_FT_INFO("%s : peer support FTOTA(0x%02x),"
|
||||
" ft_roam_on_expired=0x%02x\n",
|
||||
__func__, pft_roam->ft_flags,
|
||||
pft_roam->ft_roam_on_expired);
|
||||
|
||||
if (rtw_ft_otd_roam_en(padapter)) {
|
||||
rtw_ft_set_flags(padapter, RTW_FT_PEER_OTD_EN);
|
||||
RTW_FT_INFO("%s : peer support FTOTD(0x%02x)\n", __func__, pft_roam->ft_flags);
|
||||
RTW_FT_INFO("%s : peer support FTOTD(0x%02x)\n",
|
||||
__func__, pft_roam->ft_flags);
|
||||
} else {
|
||||
pft_roam->ft_cap &= ~BIT(0);
|
||||
rtw_ft_clr_flags(padapter, RTW_FT_PEER_OTD_EN);
|
||||
RTW_FT_INFO("%s : update mdid=0x%02x, "
|
||||
"cap=0x%02x, flag=0x%02x\n",
|
||||
__func__, pft_roam->mdid,
|
||||
pft_roam->ft_cap,
|
||||
pft_roam->ft_flags);
|
||||
}
|
||||
} else {
|
||||
/* Don't use FT roaming if target AP cannot support FT */
|
||||
rtw_ft_clr_flags(padapter, (RTW_FT_PEER_EN|RTW_FT_PEER_OTD_EN));
|
||||
rtw_ft_clr_flags(padapter,
|
||||
(RTW_FT_PEER_EN|RTW_FT_PEER_OTD_EN));
|
||||
rtw_ft_reset_status(padapter);
|
||||
}
|
||||
} else {
|
||||
/* It could be a non-FT connection */
|
||||
rtw_ft_clr_flags(padapter, (RTW_FT_PEER_EN|RTW_FT_PEER_OTD_EN));
|
||||
rtw_ft_clr_flags(padapter,
|
||||
(RTW_FT_PEER_EN|RTW_FT_PEER_OTD_EN));
|
||||
rtw_ft_reset_status(padapter);
|
||||
}
|
||||
}
|
||||
|
||||
RTW_FT_INFO("%s : ft_flags=0x%02x\n", __func__, pft_roam->ft_flags);
|
||||
}
|
||||
@@ -250,29 +277,51 @@ void rtw_ft_update_bcn(_adapter *padapter, union recv_frame *precv_frame)
|
||||
uint len = precv_frame->u.hdr.len;
|
||||
WLAN_BSSID_EX *pbss;
|
||||
|
||||
if (rtw_ft_chk_status(padapter,RTW_FT_ASSOCIATED_STA)
|
||||
if (rtw_ft_chk_status(padapter,RTW_FT_ASSOCIATED_STA)
|
||||
&& (pmlmepriv->ft_roam.ft_updated_bcn == _FALSE)) {
|
||||
pbss = (WLAN_BSSID_EX*)rtw_malloc(sizeof(WLAN_BSSID_EX));
|
||||
if (pbss) {
|
||||
if (collect_bss_info(padapter, precv_frame, pbss) == _SUCCESS) {
|
||||
if (collect_bss_info(
|
||||
padapter, precv_frame, pbss) == _SUCCESS) {
|
||||
struct beacon_keys recv_beacon;
|
||||
|
||||
update_network(&(pmlmepriv->cur_network.network), pbss, padapter, _TRUE);
|
||||
update_network(
|
||||
&(pmlmepriv->cur_network.network),
|
||||
pbss, padapter, _TRUE);
|
||||
|
||||
/* Move into rtw_get_bcn_keys */
|
||||
/* rtw_get_bcn_info(&(pmlmepriv->cur_network)); */
|
||||
|
||||
|
||||
/* update bcn keys */
|
||||
if (rtw_get_bcn_keys(padapter, pframe, len, &recv_beacon) == _TRUE) {
|
||||
RTW_FT_INFO("%s: beacon keys ready\n", __func__);
|
||||
_rtw_memcpy(&pmlmepriv->cur_beacon_keys,
|
||||
&recv_beacon, sizeof(recv_beacon));
|
||||
if (is_hidden_ssid(recv_beacon.ssid, recv_beacon.ssid_len)) {
|
||||
_rtw_memcpy(pmlmepriv->cur_beacon_keys.ssid, pmlmeinfo->network.Ssid.Ssid, IW_ESSID_MAX_SIZE);
|
||||
pmlmepriv->cur_beacon_keys.ssid_len = pmlmeinfo->network.Ssid.SsidLength;
|
||||
if (rtw_get_bcn_keys(padapter, pframe, len,
|
||||
&recv_beacon) == _TRUE) {
|
||||
|
||||
RTW_FT_INFO("%s: beacon keys ready\n",
|
||||
__func__);
|
||||
|
||||
_rtw_memcpy(
|
||||
&pmlmepriv->cur_beacon_keys,
|
||||
&recv_beacon,
|
||||
sizeof(recv_beacon));
|
||||
|
||||
if (is_hidden_ssid(
|
||||
recv_beacon.ssid,
|
||||
recv_beacon.ssid_len)) {
|
||||
|
||||
_rtw_memcpy(
|
||||
pmlmepriv->cur_beacon_keys.ssid,
|
||||
pmlmeinfo->network.Ssid.Ssid,
|
||||
IW_ESSID_MAX_SIZE);
|
||||
|
||||
pmlmepriv->cur_beacon_keys.ssid_len = \
|
||||
pmlmeinfo->network.Ssid.SsidLength;
|
||||
}
|
||||
} else {
|
||||
RTW_ERR("%s: get beacon keys failed\n", __func__);
|
||||
_rtw_memset(&pmlmepriv->cur_beacon_keys, 0, sizeof(recv_beacon));
|
||||
RTW_ERR("%s: get beacon keys failed\n",
|
||||
__func__);
|
||||
_rtw_memset(
|
||||
&pmlmepriv->cur_beacon_keys,
|
||||
0, sizeof(recv_beacon));
|
||||
}
|
||||
#ifdef CONFIG_BCN_CNT_CONFIRM_HDL
|
||||
pmlmepriv->new_beacon_cnts = 0;
|
||||
@@ -282,9 +331,11 @@ void rtw_ft_update_bcn(_adapter *padapter, union recv_frame *precv_frame)
|
||||
}
|
||||
|
||||
/* check the vendor of the assoc AP */
|
||||
pmlmeinfo->assoc_AP_vendor =
|
||||
check_assoc_AP(pframe+sizeof(struct rtw_ieee80211_hdr_3addr),
|
||||
(len - sizeof(struct rtw_ieee80211_hdr_3addr)));
|
||||
pmlmeinfo->assoc_AP_vendor =
|
||||
check_assoc_AP(
|
||||
pframe + sizeof(struct rtw_ieee80211_hdr_3addr),
|
||||
(len - sizeof(struct rtw_ieee80211_hdr_3addr))
|
||||
);
|
||||
|
||||
rtw_phydm_update_ap_vendor_ie(padapter);
|
||||
|
||||
@@ -306,9 +357,11 @@ void rtw_ft_start_clnt_join(_adapter *padapter)
|
||||
if (rtw_ft_otd_roam(padapter)) {
|
||||
pmlmeinfo->state = WIFI_FW_AUTH_SUCCESS | WIFI_FW_STATION_STATE;
|
||||
pft_roam->ft_event.ies =
|
||||
(pft_roam->ft_action + sizeof(struct rtw_ieee80211_hdr_3addr) + 16);
|
||||
(pft_roam->ft_action + \
|
||||
sizeof(struct rtw_ieee80211_hdr_3addr) + 16);
|
||||
pft_roam->ft_event.ies_len =
|
||||
(pft_roam->ft_action_len - sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
(pft_roam->ft_action_len - \
|
||||
sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
|
||||
/*Not support RIC*/
|
||||
pft_roam->ft_event.ric_ies = NULL;
|
||||
@@ -352,10 +405,10 @@ static u8 rtw_ft_update_mdie(
|
||||
u32 len = 3;
|
||||
|
||||
if (rtw_ft_roam(padapter)) {
|
||||
if ((pie = rtw_get_ie(pft_roam->updated_ft_ies, _MDIE_,
|
||||
if ((pie = rtw_get_ie(pft_roam->updated_ft_ies, _MDIE_,
|
||||
&len, pft_roam->updated_ft_ies_len))) {
|
||||
pie = (pie + 2); /* ignore md-id & length */
|
||||
} else
|
||||
} else
|
||||
return _FAIL;
|
||||
} else {
|
||||
*((u16 *)&mdie[0]) = pft_roam->mdid;
|
||||
@@ -363,8 +416,9 @@ static u8 rtw_ft_update_mdie(
|
||||
pie = &mdie[0];
|
||||
}
|
||||
|
||||
*pframe = rtw_set_ie(((u8 *)*pframe), _MDIE_, len , pie, &(pattrib->pktlen));
|
||||
return _SUCCESS;
|
||||
*pframe = rtw_set_ie(((u8 *)*pframe), _MDIE_,
|
||||
len , pie, &(pattrib->pktlen));
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
static u8 rtw_ft_update_ftie(
|
||||
@@ -374,17 +428,17 @@ static u8 rtw_ft_update_ftie(
|
||||
u8 *pie;
|
||||
u32 len;
|
||||
|
||||
if ((pie = rtw_get_ie(pft_roam->updated_ft_ies, _FTIE_, &len,
|
||||
if ((pie = rtw_get_ie(pft_roam->updated_ft_ies, _FTIE_, &len,
|
||||
pft_roam->updated_ft_ies_len)) != NULL) {
|
||||
*pframe = rtw_set_ie(*pframe, _FTIE_, len ,
|
||||
*pframe = rtw_set_ie(*pframe, _FTIE_, len ,
|
||||
(pie+2), &(pattrib->pktlen));
|
||||
} else
|
||||
return _FAIL;
|
||||
|
||||
return _SUCCESS;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void rtw_ft_build_auth_req_ies(_adapter *padapter,
|
||||
void rtw_ft_build_auth_req_ies(_adapter *padapter,
|
||||
struct pkt_attrib *pattrib, u8 **pframe)
|
||||
{
|
||||
u8 ftie_append = _TRUE;
|
||||
@@ -434,13 +488,15 @@ u8 rtw_ft_update_auth_rsp_ies(_adapter *padapter, u8 *pframe, u32 len)
|
||||
|
||||
if (!pframe || !len)
|
||||
return _FAIL;
|
||||
|
||||
rtw_buf_update(&pmlmepriv->auth_rsp,
|
||||
|
||||
rtw_buf_update(&pmlmepriv->auth_rsp,
|
||||
&pmlmepriv->auth_rsp_len, pframe, len);
|
||||
pft_roam->ft_event.ies =
|
||||
(pmlmepriv->auth_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6);
|
||||
(pmlmepriv->auth_rsp + \
|
||||
sizeof(struct rtw_ieee80211_hdr_3addr) + 6);
|
||||
pft_roam->ft_event.ies_len =
|
||||
(pmlmepriv->auth_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6);
|
||||
(pmlmepriv->auth_rsp_len - \
|
||||
sizeof(struct rtw_ieee80211_hdr_3addr) - 6);
|
||||
|
||||
/*Not support RIC*/
|
||||
pft_roam->ft_event.ric_ies = NULL;
|
||||
@@ -448,7 +504,7 @@ u8 rtw_ft_update_auth_rsp_ies(_adapter *padapter, u8 *pframe, u32 len)
|
||||
_rtw_memcpy(target_ap_addr, pmlmepriv->assoc_bssid, ETH_ALEN);
|
||||
rtw_ft_report_reassoc_evt(padapter, target_ap_addr);
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void rtw_ft_start_clnt_action(_adapter *padapter, u8 *pTargetAddr)
|
||||
@@ -468,7 +524,8 @@ void rtw_ft_start_roam(_adapter *padapter, u8 *pTargetAddr)
|
||||
RTW_FT_INFO("%s : try OTD roaming\n", __func__);
|
||||
rtw_ft_start_clnt_action(padapter, pTargetAddr);
|
||||
} else {
|
||||
/*wait a little time to retrieve packets buffered in the current ap while scan*/
|
||||
/* wait a little time to retrieve packets buffered
|
||||
in the current ap while scan*/
|
||||
RTW_FT_INFO("%s : start roaming timer\n", __func__);
|
||||
_set_timer(&pmlmeext->ft_roam_timer, 30);
|
||||
}
|
||||
@@ -499,9 +556,11 @@ void rtw_ft_issue_action_req(_adapter *padapter, u8 *pTargetAddr)
|
||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
|
||||
pwlanhdr->frame_ctl = 0;
|
||||
|
||||
_rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&pmlmeinfo->network), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr1,
|
||||
get_my_bssid(&pmlmeinfo->network), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&pmlmeinfo->network), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3,
|
||||
get_my_bssid(&pmlmeinfo->network), ETH_ALEN);
|
||||
|
||||
SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
|
||||
pmlmeext->mgnt_seq++;
|
||||
@@ -548,32 +607,34 @@ void rtw_ft_report_evt(_adapter *padapter)
|
||||
|
||||
ft_evt_parms.ies_len = pft_roam->ft_event.ies_len;
|
||||
ft_evt_parms.ies = rtw_zmalloc(ft_evt_parms.ies_len);
|
||||
if (ft_evt_parms.ies)
|
||||
_rtw_memcpy((void *)ft_evt_parms.ies, pft_roam->ft_event.ies, ft_evt_parms.ies_len);
|
||||
else
|
||||
if (ft_evt_parms.ies) {
|
||||
_rtw_memcpy((void *)ft_evt_parms.ies,
|
||||
pft_roam->ft_event.ies, ft_evt_parms.ies_len);
|
||||
} else
|
||||
goto err_2;
|
||||
|
||||
ft_evt_parms.target_ap = rtw_zmalloc(ETH_ALEN);
|
||||
if (ft_evt_parms.target_ap)
|
||||
_rtw_memcpy((void *)ft_evt_parms.target_ap, pnetwork->MacAddress, ETH_ALEN);
|
||||
else
|
||||
if (ft_evt_parms.target_ap) {
|
||||
_rtw_memcpy((void *)ft_evt_parms.target_ap,
|
||||
pnetwork->MacAddress, ETH_ALEN);
|
||||
} else
|
||||
goto err_1;
|
||||
|
||||
ft_evt_parms.ric_ies = pft_roam->ft_event.ric_ies;
|
||||
ft_evt_parms.ric_ies_len = pft_roam->ft_event.ric_ies_len;
|
||||
|
||||
/* It's a KERNEL issue between v4.11 ~ v4.16,
|
||||
/* It's a KERNEL issue between v4.11 ~ v4.16,
|
||||
* <= v4.10, NLMSG_DEFAULT_SIZE is used for nlmsg_new().
|
||||
* v4.11 ~ v4.16, only used "100 + >ric_ies_len" for nlmsg_new()
|
||||
* v4.11 ~ v4.16, only used "100 + >ric_ies_len" for nlmsg_new()
|
||||
* even then DRIVER don't support RIC.
|
||||
* >= v4.17, issue should correct as "100 + ies_len + ric_ies_len".
|
||||
*/
|
||||
*/
|
||||
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)) && \
|
||||
(LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)))
|
||||
ft_evt_parms.ric_ies_len = (ft_evt_parms.ies_len <= 100 )?
|
||||
(0):(ft_evt_parms.ies_len - 100);
|
||||
#endif
|
||||
|
||||
|
||||
rtw_ft_lock_set_status(padapter, RTW_FT_AUTHENTICATED_STA, &irqL);
|
||||
rtw_cfg80211_ft_event(padapter, &ft_evt_parms);
|
||||
RTW_INFO("FT: rtw_ft_report_evt\n");
|
||||
@@ -617,8 +678,11 @@ void rtw_ft_report_reassoc_evt(_adapter *padapter, u8 *pMacAddr)
|
||||
evt_hdr->id = EVT_FT_REASSOC;
|
||||
evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq);
|
||||
|
||||
passoc_sta_evt = (struct stassoc_event *)(pevtcmd + sizeof(struct rtw_evt_header));
|
||||
_rtw_memcpy((unsigned char *)(&(passoc_sta_evt->macaddr)), pMacAddr, ETH_ALEN);
|
||||
passoc_sta_evt = \
|
||||
(struct stassoc_event *)(pevtcmd + \
|
||||
sizeof(struct rtw_evt_header));
|
||||
_rtw_memcpy((unsigned char *)(&(passoc_sta_evt->macaddr)),
|
||||
pMacAddr, ETH_ALEN);
|
||||
rtw_enqueue_cmd(pcmdpriv, pcmd_obj);
|
||||
}
|
||||
|
||||
@@ -633,13 +697,15 @@ void rtw_ft_link_timer_hdl(void *ctx)
|
||||
if (rtw_ft_chk_status(padapter, RTW_FT_REQUESTING_STA)) {
|
||||
if (pft_roam->ft_req_retry_cnt < RTW_FT_ACTION_REQ_LMT) {
|
||||
pft_roam->ft_req_retry_cnt++;
|
||||
rtw_ft_issue_action_req(padapter, (u8 *)pmlmepriv->roam_network->network.MacAddress);
|
||||
rtw_ft_issue_action_req(padapter,
|
||||
(u8 *)pmlmepriv->roam_network->network.MacAddress);
|
||||
_set_timer(&pmlmeext->ft_link_timer, REASSOC_TO);
|
||||
} else {
|
||||
pft_roam->ft_req_retry_cnt = 0;
|
||||
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)
|
||||
rtw_ft_set_status(padapter, RTW_FT_ASSOCIATED_STA);
|
||||
else
|
||||
pft_roam->ft_req_retry_cnt = 0;
|
||||
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) {
|
||||
rtw_ft_set_status(padapter,
|
||||
RTW_FT_ASSOCIATED_STA);
|
||||
} else
|
||||
rtw_ft_reset_status(padapter);
|
||||
}
|
||||
}
|
||||
@@ -651,20 +717,218 @@ void rtw_ft_roam_timer_hdl(void *ctx)
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
RTW_FT_INFO("%s : try roaming\n", __func__);
|
||||
receive_disconnect(padapter, pmlmepriv->cur_network.network.MacAddress
|
||||
, WLAN_REASON_ACTIVE_ROAM, _FALSE);
|
||||
receive_disconnect(padapter,
|
||||
pmlmepriv->cur_network.network.MacAddress,
|
||||
WLAN_REASON_ACTIVE_ROAM, _FALSE);
|
||||
}
|
||||
|
||||
void rtw_ft_roam_status_reset(_adapter *padapter)
|
||||
{
|
||||
struct ft_roam_info *pft_roam = &(padapter->mlmepriv.ft_roam);
|
||||
|
||||
if ((rtw_to_roam(padapter) > 0) &&
|
||||
if ((rtw_to_roam(padapter) > 0) &&
|
||||
(!rtw_ft_chk_status(padapter, RTW_FT_REQUESTED_STA))) {
|
||||
rtw_ft_reset_status(padapter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
padapter->mlmepriv.ft_roam.ft_updated_bcn = _FALSE;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_RTW_80211R */
|
||||
void rtw_ft_peer_info_init(struct sta_info *psta)
|
||||
{
|
||||
struct rtw_sta_ft_info_t *peer = &(psta->ft_peer);
|
||||
_rtw_memset(peer, 0, sizeof(struct rtw_sta_ft_info_t));
|
||||
}
|
||||
|
||||
void rtw_ft_peer_info_free(struct sta_info *psta)
|
||||
{
|
||||
struct rtw_sta_ft_info_t *peer = &(psta->ft_peer);
|
||||
|
||||
rtw_buf_free(&peer->md_ie, &peer->md_len);
|
||||
rtw_buf_free(&peer->rsn_ie, &peer->rsn_len);
|
||||
rtw_buf_free(&peer->ft_ie, &peer->ft_len);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RTW_80211R_AP
|
||||
int rtw_ft_update_sta_ies(_adapter *padapter,
|
||||
struct cfg80211_update_ft_ies_params *ie)
|
||||
{
|
||||
struct security_priv *psecuritypriv = &(padapter->securitypriv);
|
||||
struct sta_priv *pstapriv = &(padapter->stapriv);
|
||||
struct sta_info *psta;
|
||||
struct rtw_sta_ft_info_t *peer_info;
|
||||
u8 *ptr, *paddr;
|
||||
u32 len;
|
||||
int ret = 0;
|
||||
|
||||
if (!CHECK_BIT(WLAN_AKM_TYPE_FT_PSK, psecuritypriv->akmp)
|
||||
&& !CHECK_BIT(WLAN_AKM_TYPE_FT_8021X, psecuritypriv->akmp)
|
||||
&& !CHECK_BIT(WLAN_AKM_TYPE_FT_OVER_SAE, psecuritypriv->akmp)) {
|
||||
RTW_FT_INFO("%s : AKM=0x%x\n", __func__, psecuritypriv->akmp);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if ((ie->ie_len == 0) ||
|
||||
(ie->ie_len >= RTW_FT_MAX_IE_SZ)) {
|
||||
ret = - EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if ((ptr = rtw_get_ie(ie->ie, WLAN_EID_VENDOR_SPECIFIC,
|
||||
&len , ie->ie_len)) == NULL) {
|
||||
RTW_ERR("FT : no station mac address found in ies\n");
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (len != ETH_ALEN) {
|
||||
RTW_ERR("FT : invalid station mac length(%u)\n", len);
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
paddr = ptr + 2;
|
||||
if ((psta = rtw_get_stainfo(pstapriv, paddr)) == NULL) {
|
||||
RTW_ERR("FT : sta "MAC_FMT" not found!\n", MAC_ARG(paddr));
|
||||
ret = -EINVAL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
RTW_FT_INFO("%s : update sta "MAC_FMT" ie, len=%lu\n",
|
||||
__func__, MAC_ARG(paddr), ie->ie_len);
|
||||
RTW_FT_DUMP("ie = ", ie->ie, ie->ie_len);
|
||||
|
||||
peer_info = &(psta->ft_peer);
|
||||
if ((ptr = rtw_get_ie(ie->ie, EID_WPA2, &len , ie->ie_len)) != NULL) {
|
||||
rtw_buf_update(&peer_info->rsn_ie,
|
||||
&peer_info->rsn_len, ptr + 2, len);
|
||||
RTW_FT_DUMP("rsn_ie = ", peer_info->rsn_ie,
|
||||
peer_info->rsn_len);
|
||||
}
|
||||
|
||||
if ((ptr = rtw_get_ie(ie->ie, _MDIE_, &len , ie->ie_len)) != NULL) {
|
||||
rtw_buf_update(&peer_info->md_ie,
|
||||
&peer_info->md_len, ptr + 2, len);
|
||||
RTW_FT_DUMP("md_ie = ",
|
||||
peer_info->md_ie, peer_info->md_len);
|
||||
}
|
||||
|
||||
if ((ptr = rtw_get_ie(ie->ie, _FTIE_, &len , ie->ie_len)) != NULL) {
|
||||
rtw_buf_update(&peer_info->ft_ie,
|
||||
&peer_info->ft_len, ptr + 2, len);
|
||||
RTW_FT_DUMP("ft_ie = ",
|
||||
peer_info->ft_ie, peer_info->ft_len);
|
||||
}
|
||||
|
||||
if (psta->authalg == WLAN_AUTH_FT)
|
||||
issue_asocrsp(padapter, 0, psta, WIFI_REASSOCRSP);
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void rtw_ft_update_assocresp_ies(struct net_device *net,
|
||||
struct cfg80211_ap_settings *settings)
|
||||
{
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(net);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct ft_roam_info *pinfo = &(pmlmepriv->ft_roam);
|
||||
u8 *ie, *bcn_tail_ies, *assocrsp_ies;
|
||||
int ielen, bcn_tail_len, assocrsp_ies_len, ret = 0;
|
||||
|
||||
bcn_tail_ies = (u8 *)settings->beacon.tail;
|
||||
bcn_tail_len = (u32)settings->beacon.tail_len;
|
||||
assocrsp_ies = (u8 *)settings->beacon.assocresp_ies;
|
||||
assocrsp_ies_len = (u32)settings->beacon.assocresp_ies_len;
|
||||
|
||||
if ((bcn_tail_len > 0) &&
|
||||
((ie = rtw_get_ie(bcn_tail_ies, _MDIE_,
|
||||
&ielen , bcn_tail_len)) != NULL)) {
|
||||
pinfo->mdid = *(u16 *)(ie + 2);
|
||||
pinfo->ft_cap = *(ie + 4);
|
||||
RTW_FT_INFO("%s : mdid = 0x%04x, cap=0x%02x\n",
|
||||
__func__, pinfo->mdid, pinfo->ft_cap);
|
||||
}
|
||||
|
||||
if ((assocrsp_ies_len > 0) &&
|
||||
((ie = rtw_get_ie(assocrsp_ies, _FTIE_,
|
||||
&ielen , assocrsp_ies_len)) != NULL)) {
|
||||
_rtw_memset(pinfo->updated_ft_ies, 0, RTW_FT_MAX_IE_SZ);
|
||||
_rtw_memcpy(pinfo->updated_ft_ies, ie + 2, ielen);
|
||||
pinfo->updated_ft_ies_len = ielen;
|
||||
RTW_FT_DUMP("FT : ft ie = ", ie + 2, ielen);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void rtw_ft_process_ft_auth_rsp(_adapter *padapter, u8 *pframe, u32 len)
|
||||
{
|
||||
struct sta_priv *pstapriv = &(padapter->stapriv);
|
||||
struct sta_info *psta = NULL;
|
||||
_irqL irqL;
|
||||
/* u8 *ptr; */
|
||||
/* u32 plen; */
|
||||
|
||||
/* ptr = pframe + IEEE80211_3ADDR_LEN + _AUTH_IE_OFFSET_; */
|
||||
/* plen = len - IEEE80211_3ADDR_LEN - _AUTH_IE_OFFSET_; */
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, GetAddr1Ptr(pframe));
|
||||
if (psta) {
|
||||
_enter_critical_bh(&psta->lock, &irqL);
|
||||
psta->state &= ~WIFI_FW_AUTH_NULL;
|
||||
psta->state |= WIFI_FW_AUTH_SUCCESS;
|
||||
psta->expire_to = pstapriv->assoc_to;
|
||||
_exit_critical_bh(&psta->lock, &irqL);
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_ft_build_assoc_rsp_ies(_adapter *padapter,
|
||||
struct sta_info *psta, struct pkt_attrib *pattrib, u8 **pframe)
|
||||
{
|
||||
struct ft_roam_info *prinfo = &(padapter->mlmepriv.ft_roam);
|
||||
struct rtw_sta_ft_info_t *peer_info;
|
||||
u8 *pie, mdie[3] = {0};
|
||||
u32 ielen;
|
||||
|
||||
if (psta == NULL)
|
||||
return;
|
||||
|
||||
if (psta->authalg != WLAN_AUTH_FT) {
|
||||
*((u16 *)&mdie[0]) = prinfo->mdid;
|
||||
mdie[2] = prinfo->ft_cap;
|
||||
pie = mdie;
|
||||
ielen = 3;
|
||||
|
||||
if (prinfo->mdid > 0) {
|
||||
*pframe = rtw_set_ie(((u8 *)*pframe),
|
||||
_MDIE_, ielen , pie, &(pattrib->pktlen));
|
||||
}
|
||||
|
||||
if (prinfo->updated_ft_ies_len > 0) {
|
||||
*pframe = rtw_set_ie(((u8 *)*pframe),
|
||||
_FTIE_, prinfo->updated_ft_ies_len,
|
||||
prinfo->updated_ft_ies, &(pattrib->pktlen));
|
||||
}
|
||||
} else {
|
||||
peer_info = &(psta->ft_peer);
|
||||
if (peer_info->rsn_len > 0) {
|
||||
*pframe = rtw_set_ie(((u8 *)*pframe), EID_WPA2,
|
||||
peer_info->rsn_len, peer_info->rsn_ie,
|
||||
&(pattrib->pktlen));
|
||||
}
|
||||
|
||||
if (peer_info->md_len > 0) {
|
||||
*pframe = rtw_set_ie(((u8 *)*pframe), _MDIE_,
|
||||
peer_info->md_len, peer_info->md_ie,
|
||||
&(pattrib->pktlen));
|
||||
}
|
||||
|
||||
if (peer_info->ft_len > 0) {
|
||||
*pframe = rtw_set_ie(((u8 *)*pframe), _FTIE_,
|
||||
peer_info->ft_len, peer_info->ft_ie,
|
||||
&(pattrib->pktlen));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif /* CONFIG_RTW_80211R_AP */
|
||||
#endif /* CONFIG_IOCTL_CFG80211 && CONFIG_RTW_80211R */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -293,6 +293,14 @@ u8 *rtw_set_ie_tpc_report(u8 *buf, u32 *buf_len, u8 tx_power, u8 link_margin)
|
||||
return rtw_set_ie(buf, WLAN_EID_TPC_REPORT, 2, ie_data, buf_len);
|
||||
}
|
||||
|
||||
void rtw_bss_ex_set_tpc_report(WLAN_BSSID_EX *bss, u8 tx_power, u8 link_margin)
|
||||
{
|
||||
if (bss->IELength + 4 <= MAX_IE_SZ)
|
||||
rtw_set_ie_tpc_report(bss->IEs + bss->IELength, &bss->IELength, tx_power, link_margin);
|
||||
else
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
|
||||
inline u8 *rtw_set_ie_ch_switch(u8 *buf, u32 *buf_len, u8 ch_switch_mode,
|
||||
u8 new_ch, u8 ch_switch_cnt)
|
||||
{
|
||||
@@ -1065,10 +1073,15 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher,
|
||||
}
|
||||
|
||||
if (gmcs) {
|
||||
if (info.gmcs)
|
||||
if (info.gmcs) {
|
||||
*gmcs = rtw_get_rsn_cipher_suite(info.gmcs);
|
||||
else
|
||||
*gmcs = WPA_CIPHER_BIP_CMAC_128; /* default value when absent */
|
||||
} else {
|
||||
if (info.cap &&
|
||||
GET_RSN_CAP_MFP_OPTION(info.cap) > MFP_INVALID)
|
||||
*gmcs = WPA_CIPHER_BIP_CMAC_128;
|
||||
else
|
||||
*gmcs = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (akm) {
|
||||
@@ -1142,7 +1155,7 @@ int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len)
|
||||
|
||||
int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, u16 *wpa_len)
|
||||
{
|
||||
u8 authmode, sec_idx;
|
||||
u8 authmode;
|
||||
u8 wpa_oui[4] = {0x0, 0x50, 0xf2, 0x01};
|
||||
uint cnt;
|
||||
|
||||
@@ -1151,8 +1164,6 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie,
|
||||
|
||||
cnt = (_TIMESTAMP_ + _BEACON_ITERVAL_ + _CAPABILITY_);
|
||||
|
||||
sec_idx = 0;
|
||||
|
||||
while (cnt < in_len) {
|
||||
authmode = in_ie[cnt];
|
||||
|
||||
@@ -1178,9 +1189,7 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie,
|
||||
|
||||
}
|
||||
|
||||
|
||||
return *rsn_len + *wpa_len;
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen)
|
||||
@@ -1234,7 +1243,7 @@ u8 *rtw_get_wps_ie_from_scan_queue(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps
|
||||
*
|
||||
* Returns: The address of the WPS IE found, or NULL
|
||||
*/
|
||||
u8 *rtw_get_wps_ie(const u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
|
||||
u8 *rtw_get_wps_ie(const u8 *in_ie, int in_len, u8 *wps_ie, uint *wps_ielen)
|
||||
{
|
||||
uint cnt;
|
||||
const u8 *wpsie_ptr = NULL;
|
||||
@@ -1626,23 +1635,16 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen,
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ieee802_11_parse_elems - Parse information elements in management frames
|
||||
* @start: Pointer to the start of IEs
|
||||
* @len: Length of IE buffer in octets
|
||||
* @elems: Data structure for parsed elements
|
||||
* @show_errors: Whether to show parsing errors in debug log
|
||||
* Returns: Parsing result
|
||||
*/
|
||||
ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
||||
static ParseRes _rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
||||
struct rtw_ieee802_11_elems *elems,
|
||||
int show_errors)
|
||||
int show_errors, bool reset)
|
||||
{
|
||||
uint left = len;
|
||||
u8 *pos = start;
|
||||
int unknown = 0;
|
||||
|
||||
_rtw_memset(elems, 0, sizeof(*elems));
|
||||
if (reset)
|
||||
_rtw_memset(elems, 0, sizeof(*elems));
|
||||
|
||||
while (left >= 2) {
|
||||
u8 id, elen;
|
||||
@@ -1773,6 +1775,16 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
||||
elems->rann = pos;
|
||||
elems->rann_len = elen;
|
||||
break;
|
||||
#endif
|
||||
#ifdef CONFIG_STA_MULTIPLE_BSSID
|
||||
case WLAN_EID_MULTIPLE_BSSID:
|
||||
elems->mbssid = pos;
|
||||
elems->mbssid_len = elen;
|
||||
break;
|
||||
case WLAN_EID_NON_TX_BSSID_CAP:
|
||||
elems->non_tx_bssid_cap = pos;
|
||||
elems->non_tx_bssid_cap_len = elen;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
unknown++;
|
||||
@@ -1795,8 +1807,123 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
||||
|
||||
}
|
||||
|
||||
static u8 key_char2num(u8 ch);
|
||||
static u8 key_char2num(u8 ch)
|
||||
/**
|
||||
* ieee802_11_parse_elems - Parse information elements in management frames
|
||||
* @start: Pointer to the start of IEs
|
||||
* @len: Length of IE buffer in octets
|
||||
* @elems: Data structure for parsed elements
|
||||
* @show_errors: Whether to show parsing errors in debug log
|
||||
* Returns: Parsing result
|
||||
*/
|
||||
ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len,
|
||||
struct rtw_ieee802_11_elems *elems,
|
||||
int show_errors)
|
||||
{
|
||||
return _rtw_ieee802_11_parse_elems(start, len, elems, show_errors, true);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_STA_MULTIPLE_BSSID
|
||||
static bool rtw_mbssid_ntbssid_profile_match_id(u8 *profile, uint len, u8 mbssid_idx)
|
||||
{
|
||||
uint left = len;
|
||||
u8 *pos = profile;
|
||||
|
||||
while (left >= 2) {
|
||||
u8 id, elen;
|
||||
|
||||
id = *pos++;
|
||||
elen = *pos++;
|
||||
left -= 2;
|
||||
|
||||
if (elen > left)
|
||||
return false;
|
||||
|
||||
switch (id) {
|
||||
case WLAN_EID_MULTI_BSSID_IDX:
|
||||
if (GET_MULTIPLE_BSSID_IDX_INDEX(pos - 2) == mbssid_idx)
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
left -= elen;
|
||||
pos += elen;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* rtw_ieee802_11_override_elems_by_mbssid - override information elements in management frames
|
||||
* @mbssid_ie: Pointer to the start of mbssid IE
|
||||
* @mbssid_ie_len: Length of IE buffer in octets
|
||||
* @mbssid_idx: the specific mbssid index to get for override
|
||||
* @elems: Data structure for parsed elements
|
||||
* @show_errors: Whether to show parsing errors in debug log
|
||||
* Returns: Parsing result
|
||||
*/
|
||||
ParseRes rtw_ieee802_11_override_elems_by_mbssid(
|
||||
u8 *mbssid_ie, uint mbssid_ie_len, u8 mbssid_idx, struct rtw_ieee802_11_elems *elems
|
||||
, int show_errors)
|
||||
{
|
||||
uint left = mbssid_ie_len;
|
||||
u8 *pos = mbssid_ie;
|
||||
u8 max_bssid_indicator;
|
||||
int unknown = 0;
|
||||
|
||||
if (left < 3) {
|
||||
RTW_WARN("%s mbssid_ie_len < 3\n", __func__);
|
||||
return ParseFailed;
|
||||
}
|
||||
|
||||
max_bssid_indicator = GET_MBSSID_MAX_BSSID_INDOCATOR(pos);
|
||||
if (mbssid_idx >= (1 << max_bssid_indicator)) {
|
||||
RTW_WARN("%s mbssid_idx >= max_bssid_indicator(%u)\n"
|
||||
, __func__, 1 << max_bssid_indicator);
|
||||
return ParseFailed;
|
||||
}
|
||||
|
||||
pos += MBSSID_MAX_BSSID_INDICATOR_OFFSET;
|
||||
left -= MBSSID_MAX_BSSID_INDICATOR_OFFSET;
|
||||
|
||||
while (left >= 2) {
|
||||
u8 id, elen;
|
||||
|
||||
id = *pos++;
|
||||
elen = *pos++;
|
||||
left -= 2;
|
||||
|
||||
if (elen > left) {
|
||||
if (show_errors) {
|
||||
RTW_INFO("%s parse failed (id=%d elen=%d left=%lu)\n"
|
||||
, __func__, id, elen, (unsigned long) left);
|
||||
}
|
||||
return ParseFailed;
|
||||
}
|
||||
|
||||
switch (id) {
|
||||
case MBSSID_NONTRANSMITTED_BSSID_PROFILE_ID:
|
||||
if (rtw_mbssid_ntbssid_profile_match_id(pos, elen, mbssid_idx))
|
||||
_rtw_ieee802_11_parse_elems(pos, elen, elems, show_errors, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
left -= elen;
|
||||
pos += elen;
|
||||
}
|
||||
|
||||
if (left)
|
||||
return ParseFailed;
|
||||
|
||||
return unknown ? ParseUnknown : ParseOK;
|
||||
|
||||
}
|
||||
#endif /* CONFIG_STA_MULTIPLE_BSSID */
|
||||
|
||||
u8 key_char2num(u8 ch);
|
||||
u8 key_char2num(u8 ch)
|
||||
{
|
||||
if ((ch >= '0') && (ch <= '9'))
|
||||
return ch - '0';
|
||||
@@ -1918,7 +2045,7 @@ extern char *rtw_initmac;
|
||||
void rtw_macaddr_cfg(u8 *out, const u8 *hw_mac_addr)
|
||||
{
|
||||
#define DEFAULT_RANDOM_MACADDR 1
|
||||
u8 mac[ETH_ALEN];
|
||||
u8 mac[ETH_ALEN]= {0};
|
||||
|
||||
if (out == NULL) {
|
||||
rtw_warn_on(1);
|
||||
@@ -2103,7 +2230,8 @@ void dump_ies(void *sel, const u8 *buf, u32 buf_len)
|
||||
* @ht: check HT IEs
|
||||
* @vht: check VHT IEs, if true imply ht is true
|
||||
*/
|
||||
void rtw_ies_get_chbw(u8 *ies, int ies_len, u8 *ch, u8 *bw, u8 *offset, u8 ht, u8 vht)
|
||||
#if CONFIG_ALLOW_FUNC_2G_5G_ONLY
|
||||
RTW_FUNC_2G_5G_ONLY void rtw_ies_get_chbw(u8 *ies, int ies_len, u8 *ch, u8 *bw, u8 *offset, u8 ht, u8 vht)
|
||||
{
|
||||
u8 *p;
|
||||
int ie_len;
|
||||
@@ -2167,6 +2295,7 @@ void rtw_ies_get_chbw(u8 *ies, int ies_len, u8 *ch, u8 *bw, u8 *offset, u8 ht, u
|
||||
}
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
}
|
||||
#endif
|
||||
|
||||
void rtw_bss_get_chbw(WLAN_BSSID_EX *bss, u8 *ch, u8 *bw, u8 *offset, u8 ht, u8 vht)
|
||||
{
|
||||
@@ -2184,95 +2313,6 @@ void rtw_bss_get_chbw(WLAN_BSSID_EX *bss, u8 *ch, u8 *bw, u8 *offset, u8 ht, u8
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* rtw_is_chbw_grouped - test if the two ch settings can be grouped together
|
||||
* @ch_a: ch of set a
|
||||
* @bw_a: bw of set a
|
||||
* @offset_a: offset of set a
|
||||
* @ch_b: ch of set b
|
||||
* @bw_b: bw of set b
|
||||
* @offset_b: offset of set b
|
||||
*/
|
||||
bool rtw_is_chbw_grouped(u8 ch_a, u8 bw_a, u8 offset_a
|
||||
, u8 ch_b, u8 bw_b, u8 offset_b)
|
||||
{
|
||||
bool is_grouped = _FALSE;
|
||||
|
||||
if (ch_a != ch_b) {
|
||||
/* ch is different */
|
||||
goto exit;
|
||||
} else if ((bw_a == CHANNEL_WIDTH_40 || bw_a == CHANNEL_WIDTH_80)
|
||||
&& (bw_b == CHANNEL_WIDTH_40 || bw_b == CHANNEL_WIDTH_80)
|
||||
) {
|
||||
if (offset_a != offset_b)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
is_grouped = _TRUE;
|
||||
|
||||
exit:
|
||||
return is_grouped;
|
||||
}
|
||||
|
||||
/**
|
||||
* rtw_sync_chbw - obey g_ch, adjust g_bw, g_offset, bw, offset
|
||||
* @req_ch: pointer of the request ch, may be modified further
|
||||
* @req_bw: pointer of the request bw, may be modified further
|
||||
* @req_offset: pointer of the request offset, may be modified further
|
||||
* @g_ch: pointer of the ongoing group ch
|
||||
* @g_bw: pointer of the ongoing group bw, may be modified further
|
||||
* @g_offset: pointer of the ongoing group offset, may be modified further
|
||||
*/
|
||||
void rtw_sync_chbw(u8 *req_ch, u8 *req_bw, u8 *req_offset
|
||||
, u8 *g_ch, u8 *g_bw, u8 *g_offset)
|
||||
{
|
||||
|
||||
*req_ch = *g_ch;
|
||||
|
||||
if (*req_bw == CHANNEL_WIDTH_80 && *g_ch <= 14) {
|
||||
/*2.4G ch, downgrade to 40Mhz */
|
||||
*req_bw = CHANNEL_WIDTH_40;
|
||||
}
|
||||
|
||||
switch (*req_bw) {
|
||||
case CHANNEL_WIDTH_80:
|
||||
if (*g_bw == CHANNEL_WIDTH_40 || *g_bw == CHANNEL_WIDTH_80)
|
||||
*req_offset = *g_offset;
|
||||
else if (*g_bw == CHANNEL_WIDTH_20)
|
||||
rtw_get_offset_by_chbw(*req_ch, *req_bw, req_offset);
|
||||
|
||||
if (*req_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE) {
|
||||
RTW_ERR("%s req 80MHz BW without offset, down to 20MHz\n", __func__);
|
||||
rtw_warn_on(1);
|
||||
*req_bw = CHANNEL_WIDTH_20;
|
||||
}
|
||||
break;
|
||||
case CHANNEL_WIDTH_40:
|
||||
if (*g_bw == CHANNEL_WIDTH_40 || *g_bw == CHANNEL_WIDTH_80)
|
||||
*req_offset = *g_offset;
|
||||
else if (*g_bw == CHANNEL_WIDTH_20)
|
||||
rtw_get_offset_by_chbw(*req_ch, *req_bw, req_offset);
|
||||
|
||||
if (*req_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE) {
|
||||
RTW_ERR("%s req 40MHz BW without offset, down to 20MHz\n", __func__);
|
||||
rtw_warn_on(1);
|
||||
*req_bw = CHANNEL_WIDTH_20;
|
||||
}
|
||||
break;
|
||||
case CHANNEL_WIDTH_20:
|
||||
*req_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
break;
|
||||
default:
|
||||
RTW_ERR("%s req unsupported BW:%u\n", __func__, *req_bw);
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
|
||||
if (*req_bw > *g_bw) {
|
||||
*g_bw = *req_bw;
|
||||
*g_offset = *req_offset;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
/**
|
||||
* rtw_get_p2p_merged_len - Get merged ie length from muitiple p2p ies.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2019 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -27,7 +27,7 @@ extern void indicate_wx_scan_complete_event(_adapter *padapter);
|
||||
(addr[4] == 0xff) && (addr[5] == 0xff)) ? _TRUE : _FALSE \
|
||||
)
|
||||
|
||||
u8 rtw_validate_bssid(u8 *bssid)
|
||||
u8 rtw_validate_bssid(const u8 *bssid)
|
||||
{
|
||||
u8 ret = _TRUE;
|
||||
|
||||
@@ -76,11 +76,13 @@ u8 rtw_do_join(_adapter *padapter)
|
||||
_list *plist, *phead;
|
||||
u8 *pibss = NULL;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct sitesurvey_parm parm;
|
||||
struct sitesurvey_parm *parm = NULL;
|
||||
_queue *queue = &(pmlmepriv->scanned_queue);
|
||||
u8 ret = _SUCCESS;
|
||||
|
||||
|
||||
parm = (struct sitesurvey_parm *)rtw_zmalloc(sizeof(struct sitesurvey_parm));
|
||||
if (!parm)
|
||||
return _FAIL;
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
@@ -94,14 +96,14 @@ u8 rtw_do_join(_adapter *padapter)
|
||||
|
||||
pmlmepriv->to_join = _TRUE;
|
||||
|
||||
rtw_init_sitesurvey_parm(padapter, &parm);
|
||||
_rtw_memcpy(&parm.ssid[0], &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID));
|
||||
parm.ssid_num = 1;
|
||||
rtw_init_sitesurvey_parm(padapter, parm);
|
||||
_rtw_memcpy(&(parm->ssid[0]), &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID));
|
||||
parm->ssid_num = 1;
|
||||
|
||||
if (pmlmepriv->assoc_ch) {
|
||||
parm.ch_num = 1;
|
||||
parm.ch[0].hw_value = pmlmepriv->assoc_ch;
|
||||
parm.ch[0].flags = 0;
|
||||
parm->ch_num = 1;
|
||||
parm->ch[0].hw_value = pmlmepriv->assoc_ch;
|
||||
parm->ch[0].flags = 0;
|
||||
}
|
||||
|
||||
if (_rtw_queue_empty(queue) == _TRUE) {
|
||||
@@ -118,7 +120,7 @@ u8 rtw_do_join(_adapter *padapter)
|
||||
|
||||
if ((ssc_chk == SS_ALLOW) || (ssc_chk == SS_DENY_BUSY_TRAFFIC) ){
|
||||
/* submit site_survey_cmd */
|
||||
ret = rtw_sitesurvey_cmd(padapter, &parm);
|
||||
ret = rtw_sitesurvey_cmd(padapter, parm);
|
||||
if (_SUCCESS != ret)
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
} else {
|
||||
@@ -188,7 +190,7 @@ u8 rtw_do_join(_adapter *padapter)
|
||||
|
||||
if ((ssc_chk == SS_ALLOW) || (ssc_chk == SS_DENY_BUSY_TRAFFIC)){
|
||||
/* RTW_INFO(("rtw_do_join() when no desired bss in scanning queue\n"); */
|
||||
ret = rtw_sitesurvey_cmd(padapter, &parm);
|
||||
ret = rtw_sitesurvey_cmd(padapter, parm);
|
||||
if (_SUCCESS != ret)
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
} else {
|
||||
@@ -208,7 +210,8 @@ u8 rtw_do_join(_adapter *padapter)
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
if (parm)
|
||||
rtw_mfree(parm, sizeof(struct sitesurvey_parm));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -382,7 +385,7 @@ exit:
|
||||
}
|
||||
|
||||
u8 rtw_set_802_11_connect(_adapter *padapter,
|
||||
u8 *bssid, NDIS_802_11_SSID *ssid, u16 ch)
|
||||
const u8 *bssid, NDIS_802_11_SSID *ssid, u16 ch)
|
||||
{
|
||||
_irqL irqL;
|
||||
u8 status = _SUCCESS;
|
||||
@@ -641,7 +644,7 @@ exit:
|
||||
u8 rtw_set_acs_sitesurvey(_adapter *adapter)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
struct sitesurvey_parm parm;
|
||||
struct sitesurvey_parm *parm = NULL;
|
||||
u8 uch;
|
||||
u8 ch_num = 0;
|
||||
int i;
|
||||
@@ -653,10 +656,12 @@ u8 rtw_set_acs_sitesurvey(_adapter *adapter)
|
||||
if (!rtw_mi_get_ch_setting_union(adapter, &uch, NULL, NULL))
|
||||
goto exit;
|
||||
|
||||
_rtw_memset(&parm, 0, sizeof(struct sitesurvey_parm));
|
||||
parm.scan_mode = SCAN_PASSIVE;
|
||||
parm.bw = CHANNEL_WIDTH_20;
|
||||
parm.acs = 1;
|
||||
parm = (struct sitesurvey_parm *)rtw_zmalloc(sizeof(struct sitesurvey_parm));
|
||||
if (!parm)
|
||||
return ret;
|
||||
parm->scan_mode = SCAN_PASSIVE;
|
||||
parm->bw = CHANNEL_WIDTH_20;
|
||||
parm->acs = 1;
|
||||
|
||||
for (band = BAND_ON_2_4G; band < BAND_MAX; band++) {
|
||||
if (band == BAND_ON_2_4G) {
|
||||
@@ -686,16 +691,17 @@ u8 rtw_set_acs_sitesurvey(_adapter *adapter)
|
||||
#endif
|
||||
}
|
||||
|
||||
ch_num = center_chs_num(CHANNEL_WIDTH_20);
|
||||
for (i = 0; i < ch_num && parm.ch_num < RTW_CHANNEL_SCAN_AMOUNT; i++) {
|
||||
parm.ch[parm.ch_num].hw_value = center_chs(CHANNEL_WIDTH_20, i);
|
||||
parm.ch[parm.ch_num].flags = RTW_IEEE80211_CHAN_PASSIVE_SCAN;
|
||||
parm.ch_num++;
|
||||
ch_num = center_chs_num(CHANNEL_WIDTH_20);
|
||||
for (i = 0; i < ch_num && parm->ch_num < RTW_CHANNEL_SCAN_AMOUNT; i++) {
|
||||
parm->ch[parm->ch_num].hw_value = center_chs(CHANNEL_WIDTH_20, i);
|
||||
parm->ch[parm->ch_num].flags = RTW_IEEE80211_CHAN_PASSIVE_SCAN;
|
||||
parm->ch_num++;
|
||||
}
|
||||
}
|
||||
|
||||
ret = rtw_set_802_11_bssid_list_scan(adapter, &parm);
|
||||
|
||||
ret = rtw_set_802_11_bssid_list_scan(adapter, parm);
|
||||
if (parm)
|
||||
rtw_mfree(parm, sizeof(struct sitesurvey_parm));
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
@@ -734,15 +740,15 @@ u8 rtw_set_802_11_authentication_mode(_adapter *padapter, NDIS_802_11_AUTHENTICA
|
||||
u8 rtw_set_802_11_add_wep(_adapter *padapter, NDIS_802_11_WEP *wep)
|
||||
{
|
||||
|
||||
u8 bdefaultkey;
|
||||
u8 btransmitkey;
|
||||
/*u8 bdefaultkey;*/
|
||||
/*u8 btransmitkey;*/
|
||||
sint keyid, res;
|
||||
struct security_priv *psecuritypriv = &(padapter->securitypriv);
|
||||
u8 ret = _SUCCESS;
|
||||
|
||||
|
||||
bdefaultkey = (wep->KeyIndex & 0x40000000) > 0 ? _FALSE : _TRUE; /* for ??? */
|
||||
btransmitkey = (wep->KeyIndex & 0x80000000) > 0 ? _TRUE : _FALSE; /* for ??? */
|
||||
/*bdefaultkey = (wep->KeyIndex & 0x40000000) > 0 ? _FALSE : _TRUE;*/
|
||||
/*btransmitkey = (wep->KeyIndex & 0x80000000) > 0 ? _TRUE : _FALSE;*/
|
||||
keyid = wep->KeyIndex & 0x3fffffff;
|
||||
|
||||
if (keyid >= 4) {
|
||||
@@ -774,11 +780,9 @@ u8 rtw_set_802_11_add_wep(_adapter *padapter, NDIS_802_11_WEP *wep)
|
||||
|
||||
if (res == _FAIL)
|
||||
ret = _FALSE;
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -817,14 +821,14 @@ u16 rtw_get_cur_max_rate(_adapter *adapter)
|
||||
short_GI = query_ra_short_GI(psta, rtw_get_tx_bw_mode(adapter, psta));
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
if (is_supported_ht(psta->wireless_mode)) {
|
||||
if (is_highest_support_ht(psta->wireless_mode)) {
|
||||
max_rate = rtw_ht_mcs_rate((psta->cmn.bw_mode == CHANNEL_WIDTH_40) ? 1 : 0
|
||||
, short_GI
|
||||
, psta->htpriv.ht_cap.supp_mcs_set
|
||||
);
|
||||
}
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
else if (is_supported_vht(psta->wireless_mode))
|
||||
else if (is_highest_support_vht(psta->wireless_mode))
|
||||
max_rate = ((rtw_vht_mcs_to_data_rate(psta->cmn.bw_mode, short_GI, pmlmepriv->vhtpriv.vht_highest_rate) + 1) >> 1) * 10;
|
||||
#endif /* CONFIG_80211AC_VHT */
|
||||
else
|
||||
@@ -909,6 +913,15 @@ int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan, u8 chplan_6g, enum
|
||||
int rtw_set_country(_adapter *adapter, const char *country_code, enum rtw_regd_inr inr)
|
||||
{
|
||||
#ifdef CONFIG_RTW_IOCTL_SET_COUNTRY
|
||||
#if ((0 - CONFIG_RTW_IOCTL_SET_COUNTRY - 1) == 1) && ((CONFIG_RTW_IOCTL_SET_COUNTRY + 0) != -2) /* defined to empty */
|
||||
#undef CONFIG_RTW_IOCTL_SET_COUNTRY
|
||||
#define CONFIG_RTW_IOCTL_SET_COUNTRY 1
|
||||
#endif
|
||||
#else /* not defined */
|
||||
#define CONFIG_RTW_IOCTL_SET_COUNTRY 1
|
||||
#endif
|
||||
|
||||
#if CONFIG_RTW_IOCTL_SET_COUNTRY
|
||||
struct registry_priv *regsty = adapter_to_regsty(adapter);
|
||||
|
||||
if (!REGSTY_REGD_SRC_FROM_OS(regsty))
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2016 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -13,159 +13,28 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtw_mem.h>
|
||||
|
||||
extern int rtkm_prealloc_init(void);
|
||||
extern void rtkm_prealloc_destroy(void);
|
||||
|
||||
static int __init rtw_mem_init(void)
|
||||
{
|
||||
rtkm_prealloc_init();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit rtw_mem_exit(void)
|
||||
{
|
||||
rtkm_prealloc_destroy();
|
||||
}
|
||||
|
||||
module_init(rtw_mem_init);
|
||||
module_exit(rtw_mem_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("Realtek Wireless Lan Driver");
|
||||
MODULE_AUTHOR("Realtek Semiconductor Corp.");
|
||||
MODULE_VERSION("DRIVERVERSION");
|
||||
|
||||
/* for MAX_RECVBUF_SZ */
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
#include <rtl8188e_hal.h>
|
||||
#elif defined(CONFIG_RTL8188F)
|
||||
#include <rtl8188f_hal.h>
|
||||
#elif defined(CONFIG_RTL8188GTV)
|
||||
#include <rtl8188gtv_hal.h>
|
||||
#elif defined(CONFIG_RTL8710B)
|
||||
#include <rtl8710b_hal.h>
|
||||
#elif defined(CONFIG_RTL8192E)
|
||||
#include <rtl8192e_hal.h>
|
||||
#elif defined(CONFIG_RTL8192F)
|
||||
#include <rtl8192f_hal.h>
|
||||
#elif defined(CONFIG_RTL8723B)
|
||||
#include <rtl8723b_hal.h>
|
||||
#elif defined(CONFIG_RTL8703B)
|
||||
#include <rtl8703b_hal.h>
|
||||
#elif defined(CONFIG_RTL8723D)
|
||||
#include <rtl8723d_hal.h>
|
||||
#elif defined(CONFIG_RTL8812A) || defined(CONFIG_RTL8821A)
|
||||
#include <rtl8812a_hal.h>
|
||||
#elif defined(CONFIG_RTL8822B)
|
||||
#include <rtl8822b_hal.h>
|
||||
#elif defined(CONFIG_RTL8822C)
|
||||
#include <rtl8822c_hal.h>
|
||||
#elif defined(CONFIG_RTL8814A)
|
||||
#include <rtl8814a_hal.h>
|
||||
#elif defined(CONFIG_RTL8814B)
|
||||
#include <rtl8814b_hal.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
|
||||
#define MAX_RTKM_RECVBUF_SZ MAX_RECVBUF_SZ
|
||||
#define MAX_RTKM_NR_PREALLOC_RECV_SKB NR_RECVBUFF
|
||||
#else /* !CONFIG_SDIO_HCI */
|
||||
#ifdef CONFIG_PLATFORM_MSTAR_HIGH
|
||||
#define MAX_RTKM_RECVBUF_SZ (31744) /* 31k */
|
||||
#else
|
||||
#define MAX_RTKM_RECVBUF_SZ (15360) /* 15k */
|
||||
#endif /* CONFIG_PLATFORM_MSTAR_HIGH */
|
||||
#define MAX_RTKM_NR_PREALLOC_RECV_SKB 16
|
||||
#endif /* !CONFIG_SDIO_HCI */
|
||||
|
||||
struct sk_buff_head rtk_skb_mem_q;
|
||||
struct u8 *rtk_buf_mem[NR_RECVBUFF];
|
||||
|
||||
struct u8 *rtw_get_buf_premem(int index)
|
||||
{
|
||||
printk("%s, rtk_buf_mem index : %d\n", __func__, index);
|
||||
return rtk_buf_mem[index];
|
||||
}
|
||||
|
||||
u16 rtw_rtkm_get_buff_size(void)
|
||||
{
|
||||
return MAX_RTKM_RECVBUF_SZ;
|
||||
}
|
||||
EXPORT_SYMBOL(rtw_rtkm_get_buff_size);
|
||||
|
||||
u8 rtw_rtkm_get_nr_recv_skb(void)
|
||||
{
|
||||
return MAX_RTKM_NR_PREALLOC_RECV_SKB;
|
||||
}
|
||||
EXPORT_SYMBOL(rtw_rtkm_get_nr_recv_skb);
|
||||
|
||||
struct sk_buff *rtw_alloc_skb_premem(u16 in_size)
|
||||
{
|
||||
struct sk_buff *skb = NULL;
|
||||
|
||||
if (in_size > MAX_RTKM_RECVBUF_SZ) {
|
||||
pr_info("warning %s: driver buffer size(%d) > rtkm buffer size(%d)\n", __func__, in_size, MAX_RTKM_RECVBUF_SZ);
|
||||
WARN_ON(1);
|
||||
return skb;
|
||||
}
|
||||
|
||||
skb = skb_dequeue(&rtk_skb_mem_q);
|
||||
|
||||
printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q));
|
||||
|
||||
return skb;
|
||||
}
|
||||
EXPORT_SYMBOL(rtw_alloc_skb_premem);
|
||||
|
||||
int rtw_free_skb_premem(struct sk_buff *pskb)
|
||||
{
|
||||
if (!pskb)
|
||||
return -1;
|
||||
|
||||
if (skb_queue_len(&rtk_skb_mem_q) >= MAX_RTKM_NR_PREALLOC_RECV_SKB)
|
||||
return -1;
|
||||
|
||||
skb_queue_tail(&rtk_skb_mem_q, pskb);
|
||||
|
||||
printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q));
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(rtw_free_skb_premem);
|
||||
|
||||
static int __init rtw_mem_init(void)
|
||||
{
|
||||
int i;
|
||||
SIZE_PTR tmpaddr = 0;
|
||||
SIZE_PTR alignment = 0;
|
||||
struct sk_buff *pskb = NULL;
|
||||
|
||||
printk("%s\n", __func__);
|
||||
pr_info("MAX_RTKM_NR_PREALLOC_RECV_SKB: %d\n", MAX_RTKM_NR_PREALLOC_RECV_SKB);
|
||||
pr_info("MAX_RTKM_RECVBUF_SZ: %d\n", MAX_RTKM_RECVBUF_SZ);
|
||||
|
||||
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
for (i = 0; i < NR_RECVBUFF; i++)
|
||||
rtk_buf_mem[i] = usb_buffer_alloc(dev, size, (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL), dma);
|
||||
#endif /* CONFIG_USE_USB_BUFFER_ALLOC_RX */
|
||||
|
||||
skb_queue_head_init(&rtk_skb_mem_q);
|
||||
|
||||
for (i = 0; i < MAX_RTKM_NR_PREALLOC_RECV_SKB; i++) {
|
||||
pskb = __dev_alloc_skb(MAX_RTKM_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
|
||||
if (pskb) {
|
||||
tmpaddr = (SIZE_PTR)pskb->data;
|
||||
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ - 1);
|
||||
skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignment));
|
||||
|
||||
skb_queue_tail(&rtk_skb_mem_q, pskb);
|
||||
} else
|
||||
printk("%s, alloc skb memory fail!\n", __func__);
|
||||
|
||||
pskb = NULL;
|
||||
}
|
||||
|
||||
printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q));
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
static void __exit rtw_mem_exit(void)
|
||||
{
|
||||
if (skb_queue_len(&rtk_skb_mem_q))
|
||||
printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q));
|
||||
|
||||
skb_queue_purge(&rtk_skb_mem_q);
|
||||
|
||||
printk("%s\n", __func__);
|
||||
}
|
||||
|
||||
module_init(rtw_mem_init);
|
||||
module_exit(rtw_mem_exit);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2019 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -53,7 +53,7 @@ static u8 _rtw_mi_p2p_listen_scan_chk(_adapter *adapter)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
u8 rtw_mi_stayin_union_ch_chk(_adapter *adapter)
|
||||
u8 rtw_mi_stayin_union_ch_chk(_adapter *adapter, bool fail_detail)
|
||||
{
|
||||
u8 rst = _TRUE;
|
||||
u8 u_ch, u_bw, u_offset;
|
||||
@@ -70,20 +70,20 @@ u8 rtw_mi_stayin_union_ch_chk(_adapter *adapter)
|
||||
if ((u_ch != o_ch) || (u_bw != o_bw) || (u_offset != o_offset))
|
||||
rst = _FALSE;
|
||||
|
||||
#ifdef DBG_IFACE_STATUS
|
||||
if (rst == _FALSE) {
|
||||
if (rst == _FALSE && fail_detail) {
|
||||
RTW_ERR("%s Not stay in union channel\n", __func__);
|
||||
if (GET_HAL_DATA(adapter)->bScanInProcess == _TRUE)
|
||||
RTW_ERR("ScanInProcess\n");
|
||||
#ifdef DBG_IFACE_STATUS
|
||||
#ifdef CONFIG_P2P
|
||||
if (_rtw_mi_p2p_listen_scan_chk(adapter))
|
||||
RTW_ERR("P2P in listen or scan state\n");
|
||||
#endif
|
||||
#endif
|
||||
RTW_ERR("union ch, bw, offset: %u,%u,%u\n", u_ch, u_bw, u_offset);
|
||||
RTW_ERR("oper ch, bw, offset: %u,%u,%u\n", o_ch, o_bw, o_offset);
|
||||
RTW_ERR("=========================\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
return rst;
|
||||
}
|
||||
|
||||
@@ -187,6 +187,38 @@ inline int rtw_mi_get_ch_setting_union_no_self(_adapter *adapter, u8 *ch, u8 *bw
|
||||
return rtw_mi_get_ch_setting_union_by_ifbmp(adapter_to_dvobj(adapter), 0xFF & ~BIT(adapter->iface_id), ch, bw, offset);
|
||||
}
|
||||
|
||||
int rtw_mi_get_bch_setting_union_by_hwband(struct dvobj_priv *dvobj, u8 band_idx
|
||||
, enum band_type *band, u8 *ch, u8 *bw, u8 *offset)
|
||||
{
|
||||
/* this driver has only one hwband and 2G/5G only */
|
||||
int ret = rtw_mi_get_ch_setting_union_by_ifbmp(dvobj, 0xFF, ch, bw, offset);
|
||||
|
||||
if (band) {
|
||||
if (ret && ch)
|
||||
*band = rtw_is_2g_ch(*ch) ? BAND_ON_24G : BAND_ON_5G;
|
||||
else
|
||||
*band = BAND_MAX;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rtw_mi_get_bch_setting_union_by_hwband_ifbmp(struct dvobj_priv *dvobj, u8 band_idx, u8 ifbmp
|
||||
, enum band_type *band, u8 *ch, u8 *bw, u8 *offset)
|
||||
{
|
||||
/* this driver has only one hwband and 2G/5G only */
|
||||
int ret = rtw_mi_get_ch_setting_union_by_ifbmp(dvobj, ifbmp, ch, bw, offset);
|
||||
|
||||
if (band) {
|
||||
if (ret && ch)
|
||||
*band = rtw_is_2g_ch(*ch) ? BAND_ON_24G : BAND_ON_5G;
|
||||
else
|
||||
*band = BAND_MAX;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void rtw_mi_status_by_ifbmp(struct dvobj_priv *dvobj, u8 ifbmp, struct mi_state *mstate)
|
||||
{
|
||||
_adapter *iface;
|
||||
@@ -289,6 +321,18 @@ inline void rtw_mi_status_no_others(_adapter *adapter, struct mi_state *mstate)
|
||||
return rtw_mi_status_by_ifbmp(adapter_to_dvobj(adapter), BIT(adapter->iface_id), mstate);
|
||||
}
|
||||
|
||||
void rtw_mi_status_by_hwband(struct dvobj_priv *dvobj, u8 band_idx, struct mi_state *mstate)
|
||||
{
|
||||
/* this driver has only one hwband, bypass band_idx */
|
||||
rtw_mi_status_by_ifbmp(dvobj, 0xFF, mstate);
|
||||
}
|
||||
|
||||
void rtw_mi_status_by_hwband_ifbmp(struct dvobj_priv *dvobj, u8 band_idx, u8 ifbmp, struct mi_state *mstate)
|
||||
{
|
||||
/* this driver has only one hwband, bypass band_idx */
|
||||
rtw_mi_status_by_ifbmp(dvobj, ifbmp, mstate);
|
||||
}
|
||||
|
||||
inline void rtw_mi_status_merge(struct mi_state *d, struct mi_state *a)
|
||||
{
|
||||
d->sta_num += a->sta_num;
|
||||
@@ -989,6 +1033,14 @@ u8 rtw_mi_buddy_check_fwstate(_adapter *padapter, sint state)
|
||||
return _rtw_mi_process(padapter, _TRUE, &in_data, _rtw_mi_check_fwstate);
|
||||
}
|
||||
|
||||
u8 rtw_mi_check_fwstate_by_hwband(struct dvobj_priv *dvobj, u8 band_idx, sint state)
|
||||
{
|
||||
sint in_data = state;
|
||||
|
||||
/* this driver has only one hwband, bypass band_idx */
|
||||
return _rtw_mi_process(dvobj_get_primary_adapter(dvobj), _FALSE, &in_data, _rtw_mi_check_fwstate);
|
||||
}
|
||||
|
||||
static u8 _rtw_mi_traffic_statistics(_adapter *padapter , void *data)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
|
||||
@@ -1333,11 +1385,12 @@ _adapter *rtw_get_iface_by_hwport(_adapter *padapter, u8 hw_port)
|
||||
#ifdef DBG_SKB_PROCESS
|
||||
void rtw_dbg_skb_process(_adapter *padapter, union recv_frame *precvframe, union recv_frame *pcloneframe)
|
||||
{
|
||||
/*
|
||||
_pkt *pkt_copy, *pkt_org;
|
||||
|
||||
pkt_org = precvframe->u.hdr.pkt;
|
||||
pkt_copy = pcloneframe->u.hdr.pkt;
|
||||
/*
|
||||
|
||||
RTW_INFO("%s ===== ORG SKB =====\n", __func__);
|
||||
RTW_INFO(" SKB head(%p)\n", pkt_org->head);
|
||||
RTW_INFO(" SKB data(%p)\n", pkt_org->data);
|
||||
@@ -1382,8 +1435,8 @@ static s32 _rtw_mi_buddy_clone_bcmc_packet(_adapter *adapter, union recv_frame *
|
||||
s32 ret = _SUCCESS;
|
||||
#ifdef CONFIG_SKB_ALLOCATED
|
||||
u8 *pbuf = precvframe->u.hdr.rx_data;
|
||||
#endif
|
||||
struct rx_pkt_attrib *pattrib = NULL;
|
||||
#endif
|
||||
|
||||
if (pcloneframe) {
|
||||
pcloneframe->u.hdr.adapter = adapter;
|
||||
@@ -1394,8 +1447,8 @@ static s32 _rtw_mi_buddy_clone_bcmc_packet(_adapter *adapter, union recv_frame *
|
||||
|
||||
_rtw_memcpy(&pcloneframe->u.hdr.attrib, &precvframe->u.hdr.attrib, sizeof(struct rx_pkt_attrib));
|
||||
|
||||
pattrib = &pcloneframe->u.hdr.attrib;
|
||||
#ifdef CONFIG_SKB_ALLOCATED
|
||||
pattrib = &pcloneframe->u.hdr.attrib;
|
||||
if (rtw_os_alloc_recvframe(adapter, pcloneframe, pbuf, NULL) == _SUCCESS)
|
||||
#else
|
||||
if (rtw_os_recvframe_duplicate_skb(adapter, pcloneframe, precvframe->u.hdr.pkt) == _SUCCESS)
|
||||
@@ -1456,7 +1509,6 @@ void rtw_mi_buddy_clone_bcmc_packet(_adapter *padapter, union recv_frame *precvf
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
/*API be created temporary for MI, caller is interrupt-handler, PCIE's interrupt handler cannot apply to multi-AP*/
|
||||
_adapter *rtw_mi_get_ap_adapter(_adapter *padapter)
|
||||
{
|
||||
@@ -1476,9 +1528,43 @@ _adapter *rtw_mi_get_ap_adapter(_adapter *padapter)
|
||||
}
|
||||
return iface;
|
||||
}
|
||||
#endif
|
||||
|
||||
u8 rtw_mi_get_ld_sta_ifbmp(_adapter *adapter)
|
||||
u8 rtw_mi_get_ifbmp_by_hwband(struct dvobj_priv *dvobj, u8 band_idx)
|
||||
{
|
||||
int i;
|
||||
_adapter *iface;
|
||||
u8 ifbmp = 0;
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
iface = dvobj->padapters[i];
|
||||
if (!iface)
|
||||
continue;
|
||||
#if 0 /* this driver has only one hwband, bypass band_idx */
|
||||
if (!rtw_iface_is_operate_at_hwband(iface, band_idx))
|
||||
continue;
|
||||
#endif
|
||||
ifbmp |= BIT(i);
|
||||
}
|
||||
|
||||
return ifbmp;
|
||||
}
|
||||
|
||||
_adapter *rtw_mi_get_iface_by_hwband(struct dvobj_priv *dvobj, u8 band_idx)
|
||||
{
|
||||
u8 ifbmp = rtw_mi_get_ifbmp_by_hwband(dvobj, band_idx);
|
||||
|
||||
if (ifbmp) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
if ((ifbmp & BIT(i)) && dvobj->padapters[i])
|
||||
return dvobj->padapters[i];
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static u8 rtw_mi_get_sta_ifbmp(_adapter *adapter, u32 mlme_sbmp)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
int i;
|
||||
@@ -1490,13 +1576,35 @@ u8 rtw_mi_get_ld_sta_ifbmp(_adapter *adapter)
|
||||
if (!iface)
|
||||
continue;
|
||||
|
||||
if (MLME_IS_STA(iface) && MLME_IS_ASOC(iface))
|
||||
if (MLME_IS_STA(iface) && (!mlme_sbmp || CHK_MLME_STATE(iface, mlme_sbmp)))
|
||||
ifbmp |= BIT(i);
|
||||
}
|
||||
|
||||
return ifbmp;
|
||||
}
|
||||
|
||||
u8 rtw_mi_get_ld_sta_ifbmp(_adapter *adapter)
|
||||
{
|
||||
return rtw_mi_get_sta_ifbmp(adapter, WIFI_ASOC_STATE);
|
||||
}
|
||||
|
||||
u8 rtw_mi_get_ld_sta_ifbmp_by_hwband(struct dvobj_priv *dvobj, u8 band_idx)
|
||||
{
|
||||
/* this driver has only one hwband, bypass band_idx */
|
||||
return rtw_mi_get_ld_sta_ifbmp(dvobj_get_primary_adapter(dvobj));
|
||||
}
|
||||
|
||||
u8 rtw_mi_get_lgd_sta_ifbmp(_adapter *adapter)
|
||||
{
|
||||
return rtw_mi_get_sta_ifbmp(adapter, WIFI_UNDER_LINKING | WIFI_ASOC_STATE);
|
||||
}
|
||||
|
||||
u8 rtw_mi_get_lgd_sta_ifbmp_by_hwband(struct dvobj_priv *dvobj, u8 band_idx)
|
||||
{
|
||||
/* this driver has only one hwband, bypass band_idx */
|
||||
return rtw_mi_get_lgd_sta_ifbmp(dvobj_get_primary_adapter(dvobj));
|
||||
}
|
||||
|
||||
u8 rtw_mi_get_ap_mesh_ifbmp(_adapter *adapter)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
@@ -1517,6 +1625,33 @@ u8 rtw_mi_get_ap_mesh_ifbmp(_adapter *adapter)
|
||||
return ifbmp;
|
||||
}
|
||||
|
||||
u8 rtw_mi_get_ap_mesh_ifbmp_by_hwband(struct dvobj_priv *dvobj, u8 band_idx)
|
||||
{
|
||||
/* this driver has only one hwband, bypass band_idx */
|
||||
return rtw_mi_get_ap_mesh_ifbmp(dvobj_get_primary_adapter(dvobj));
|
||||
}
|
||||
|
||||
_adapter *rtw_mi_get_ap_mesh_iface_by_hwband(struct dvobj_priv *dvobj, u8 band_idx)
|
||||
{
|
||||
u8 ifbmp = rtw_mi_get_ap_mesh_ifbmp_by_hwband(dvobj, band_idx);
|
||||
|
||||
if (ifbmp) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
if ((ifbmp & BIT(i)) && dvobj->padapters[i])
|
||||
return dvobj->padapters[i];
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool rtw_iface_is_operate_at_hwband(_adapter *adapter, u8 band_idx)
|
||||
{
|
||||
/* this driver has only one hwband */
|
||||
return band_idx < HW_BAND_MAX ? true : false;
|
||||
}
|
||||
|
||||
void rtw_mi_update_ap_bmc_camid(_adapter *padapter, u8 camid_a, u8 camid_b)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
@@ -1576,4 +1711,30 @@ _adapter *rtw_mi_get_linking_adapter(_adapter *adapter)
|
||||
iface = NULL;
|
||||
}
|
||||
return iface;
|
||||
}
|
||||
}
|
||||
|
||||
u32 ifbmp_to_iflbmp(u8 ifbmp)
|
||||
{
|
||||
u8 i, j;
|
||||
u32 iflbmp = 0;
|
||||
|
||||
for (i = 0; i < CONFIG_IFACE_NUMBER; i++) {
|
||||
for (j = 0; j < RTW_RLINK_MAX; j++) {
|
||||
iflbmp |= (ifbmp & BIT(i)) << (j * CONFIG_IFACE_NUMBER);
|
||||
}
|
||||
}
|
||||
return iflbmp;
|
||||
}
|
||||
|
||||
u8 iflbmp_to_ifbmp(u32 iflbmp)
|
||||
{
|
||||
u8 i, j;
|
||||
u8 ifbmp = 0;
|
||||
|
||||
for (i = 0; i < CONFIG_IFACE_NUMBER; i++) {
|
||||
for (j = 0; j < RTW_RLINK_MAX; j++) {
|
||||
ifbmp |= (iflbmp >> (j * CONFIG_IFACE_NUMBER)) & BIT(i);
|
||||
}
|
||||
}
|
||||
return ifbmp;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -227,7 +227,7 @@ s32 init_mp_priv(PADAPTER padapter)
|
||||
|
||||
_init_mp_priv_(pmppriv);
|
||||
pmppriv->papdater = padapter;
|
||||
if (IS_HARDWARE_TYPE_8822C(padapter))
|
||||
if (IS_HARDWARE_TYPE_8822C(padapter) || IS_HARDWARE_TYPE_8822E(padapter))
|
||||
pmppriv->mp_dm = 1;/* default enable dpk tracking */
|
||||
else
|
||||
pmppriv->mp_dm = 0;
|
||||
@@ -403,6 +403,20 @@ void mpt_InitHWConfig(PADAPTER Adapter)
|
||||
*/
|
||||
}
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
else if( IS_HARDWARE_TYPE_8822E(Adapter)) {
|
||||
rtw_write16(Adapter, REG_RXFLTMAP1_8822E, 0x2000);
|
||||
/* 0x7D8[31] : time out enable when cca is not assert
|
||||
0x60D[7:0] : time out value (Unit : us)*/
|
||||
rtw_write8(Adapter, 0x7db, 0xc0);
|
||||
RTW_INFO(" 0x7d8 = 0x%x\n", rtw_read8(Adapter, 0x7d8));
|
||||
rtw_write8(Adapter, 0x60d, 0x0c);
|
||||
RTW_INFO(" 0x60d = 0x%x\n", rtw_read8(Adapter, 0x60d));
|
||||
phy_set_bb_reg(Adapter, 0x1c44, BIT10, 0x1);
|
||||
RTW_INFO(" 0x1c44 = 0x%x\n", phy_query_bb_reg(Adapter, 0x1c44, bMaskDWord));
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
static void PHY_IQCalibrate(PADAPTER padapter, u8 bReCovery)
|
||||
@@ -531,6 +545,10 @@ static void PHY_SetRFPathSwitch(PADAPTER padapter , BOOLEAN bMain) {
|
||||
} else if (IS_HARDWARE_TYPE_8723F(padapter)) {
|
||||
#ifdef CONFIG_RTL8723F
|
||||
phy_set_rf_path_switch_8723f(phydm, bMain);
|
||||
#endif
|
||||
} else if (IS_HARDWARE_TYPE_8822E(padapter)) {
|
||||
#ifdef CONFIG_RTL8822E
|
||||
phy_set_rf_path_switch_8822e(phydm, bMain);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -784,7 +802,7 @@ void MPT_PwrCtlDM(PADAPTER padapter, u32 trk_type)
|
||||
halrf_cmn_info_set(pDM_Odm, HALRF_CMNINFO_POWER_TRACK_CONTROL, trk_type);
|
||||
halrf_set_pwr_track(pDM_Odm, FALSE);
|
||||
pDM_Odm->rf_calibrate_info.txpowertrack_control = trk_type;
|
||||
if (IS_HARDWARE_TYPE_8822C(padapter))
|
||||
if (IS_HARDWARE_TYPE_8822C(padapter) || IS_HARDWARE_TYPE_8822E(padapter))
|
||||
padapter->mppriv.mp_dm = 1; /* default enable dpk tracking */
|
||||
else
|
||||
padapter->mppriv.mp_dm = 0;
|
||||
@@ -824,7 +842,7 @@ void MPT_PwrCtlDM(PADAPTER padapter, u32 trk_type)
|
||||
|
||||
u32 mp_join(PADAPTER padapter, u8 mode)
|
||||
{
|
||||
WLAN_BSSID_EX bssid;
|
||||
WLAN_BSSID_EX *bssid = NULL;
|
||||
struct sta_info *psta;
|
||||
u32 length;
|
||||
_irqL irqL;
|
||||
@@ -838,31 +856,33 @@ u32 mp_join(PADAPTER padapter, u8 mode)
|
||||
WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX *)(&(pmlmeinfo->network));
|
||||
|
||||
/* 1. initialize a new WLAN_BSSID_EX */
|
||||
_rtw_memset(&bssid, 0, sizeof(WLAN_BSSID_EX));
|
||||
bssid = (WLAN_BSSID_EX *)rtw_zmalloc(sizeof(WLAN_BSSID_EX));
|
||||
if (!bssid)
|
||||
return _FAIL;
|
||||
RTW_INFO("%s ,pmppriv->network_macaddr=%x %x %x %x %x %x\n", __func__,
|
||||
pmppriv->network_macaddr[0], pmppriv->network_macaddr[1], pmppriv->network_macaddr[2], pmppriv->network_macaddr[3], pmppriv->network_macaddr[4],
|
||||
pmppriv->network_macaddr[5]);
|
||||
_rtw_memcpy(bssid.MacAddress, pmppriv->network_macaddr, ETH_ALEN);
|
||||
_rtw_memcpy(bssid->MacAddress, pmppriv->network_macaddr, ETH_ALEN);
|
||||
|
||||
if (mode == WIFI_FW_ADHOC_STATE) {
|
||||
bssid.Ssid.SsidLength = strlen("mp_pseudo_adhoc");
|
||||
_rtw_memcpy(bssid.Ssid.Ssid, (u8 *)"mp_pseudo_adhoc", bssid.Ssid.SsidLength);
|
||||
bssid.InfrastructureMode = Ndis802_11IBSS;
|
||||
bssid.IELength = 0;
|
||||
bssid.Configuration.DSConfig = pmppriv->channel;
|
||||
bssid->Ssid.SsidLength = strlen("mp_pseudo_adhoc");
|
||||
_rtw_memcpy(bssid->Ssid.Ssid, (u8 *)"mp_pseudo_adhoc", bssid->Ssid.SsidLength);
|
||||
bssid->InfrastructureMode = Ndis802_11IBSS;
|
||||
bssid->IELength = 0;
|
||||
bssid->Configuration.DSConfig = pmppriv->channel;
|
||||
|
||||
} else if (mode == WIFI_FW_STATION_STATE) {
|
||||
bssid.Ssid.SsidLength = strlen("mp_pseudo_STATION");
|
||||
_rtw_memcpy(bssid.Ssid.Ssid, (u8 *)"mp_pseudo_STATION", bssid.Ssid.SsidLength);
|
||||
bssid.InfrastructureMode = Ndis802_11Infrastructure;
|
||||
bssid.IELength = 0;
|
||||
bssid->Ssid.SsidLength = strlen("mp_pseudo_STATION");
|
||||
_rtw_memcpy(bssid->Ssid.Ssid, (u8 *)"mp_pseudo_STATION", bssid->Ssid.SsidLength);
|
||||
bssid->InfrastructureMode = Ndis802_11Infrastructure;
|
||||
bssid->IELength = 0;
|
||||
}
|
||||
|
||||
length = get_WLAN_BSSID_EX_sz(&bssid);
|
||||
length = get_WLAN_BSSID_EX_sz(bssid);
|
||||
if (length % 4)
|
||||
bssid.Length = ((length >> 2) + 1) << 2; /* round up to multiple of 4 bytes. */
|
||||
bssid->Length = ((length >> 2) + 1) << 2; /* round up to multiple of 4 bytes. */
|
||||
else
|
||||
bssid.Length = length;
|
||||
bssid->Length = length;
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
@@ -887,7 +907,7 @@ u32 mp_join(PADAPTER padapter, u8 mode)
|
||||
if (psta)
|
||||
rtw_free_stainfo(padapter, psta);
|
||||
|
||||
psta = rtw_alloc_stainfo(&padapter->stapriv, bssid.MacAddress);
|
||||
psta = rtw_alloc_stainfo(&padapter->stapriv, bssid->MacAddress);
|
||||
if (psta == NULL) {
|
||||
/*pmlmepriv->fw_state = pmppriv->prev_fw_state;*/
|
||||
init_fwstate(pmlmepriv, pmppriv->prev_fw_state);
|
||||
@@ -902,7 +922,7 @@ u32 mp_join(PADAPTER padapter, u8 mode)
|
||||
tgt_network->join_res = 1;
|
||||
tgt_network->aid = psta->cmn.aid = 1;
|
||||
|
||||
_rtw_memcpy(&padapter->registrypriv.dev_network, &bssid, length);
|
||||
_rtw_memcpy(&padapter->registrypriv.dev_network, bssid, length);
|
||||
rtw_update_registrypriv_dev_network(padapter);
|
||||
_rtw_memcpy(&tgt_network->network, &padapter->registrypriv.dev_network, padapter->registrypriv.dev_network.Length);
|
||||
_rtw_memcpy(pnetwork, &padapter->registrypriv.dev_network, padapter->registrypriv.dev_network.Length);
|
||||
@@ -914,7 +934,8 @@ u32 mp_join(PADAPTER padapter, u8 mode)
|
||||
end_of_mp_start_test:
|
||||
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
if (bssid)
|
||||
rtw_mfree(bssid, sizeof(WLAN_BSSID_EX));
|
||||
if (1) { /* (res == _SUCCESS) */
|
||||
/* set MSR to WIFI_FW_ADHOC_STATE */
|
||||
if (mode == WIFI_FW_ADHOC_STATE) {
|
||||
@@ -2028,6 +2049,12 @@ void SetPacketTx(PADAPTER padapter)
|
||||
rtl8723f_prepare_mp_txdesc(padapter, pmp_priv);
|
||||
#endif /* CONFIG_RTL8723F */
|
||||
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822E(padapter))
|
||||
rtl8822e_prepare_mp_txdesc(padapter, pmp_priv);
|
||||
#endif /* CONFIG_RTL8822E */
|
||||
|
||||
|
||||
/* 3 4. make wlan header, make_wlanhdr() */
|
||||
hdr = (struct rtw_ieee80211_hdr *)pkt_start;
|
||||
set_frame_sub_type(&hdr->frame_ctl, pattrib->subtype);
|
||||
@@ -2146,7 +2173,8 @@ void SetPacketRx(PADAPTER pAdapter, u8 bStartRx, u8 bAB)
|
||||
pHalData->ReceiveConfig |= RCR_CBSSID_DATA | RCR_CBSSID_BCN |RCR_APM | RCR_AM | RCR_AB |RCR_AMF;
|
||||
pHalData->ReceiveConfig |= RCR_APP_PHYST_RXFF;
|
||||
|
||||
#if defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C)
|
||||
#if defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) \
|
||||
|| defined(CONFIG_RTL8822E)
|
||||
/* todo: 8723F */
|
||||
write_bbreg(pAdapter, 0x550, BIT3, bEnable);
|
||||
#endif
|
||||
@@ -2471,7 +2499,8 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data)
|
||||
psd_stop = 1920;
|
||||
}
|
||||
|
||||
if (IS_HARDWARE_TYPE_8822C(pAdapter) || IS_HARDWARE_TYPE_8723F(pAdapter)) {
|
||||
if (IS_HARDWARE_TYPE_8822C(pAdapter) || IS_HARDWARE_TYPE_8723F(pAdapter)
|
||||
|| IS_HARDWARE_TYPE_8822E(pAdapter)) {
|
||||
u32 *psdbuf = rtw_zmalloc(sizeof(u32)*256);
|
||||
|
||||
if (psdbuf == NULL) {
|
||||
@@ -3994,4 +4023,12 @@ void VHT_Delimiter_generator(
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef RTW_HALMAC
|
||||
int SetGpio(PADAPTER pAdapter, u8 gpio_id, u8 gpio_enable, u8 gpio_func_offset, u8 gpio_mode)
|
||||
{
|
||||
return hal_mpt_SetGpio(pAdapter, gpio_id, gpio_enable, gpio_func_offset, gpio_mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -64,96 +64,60 @@ void rtw_odm_init_ic_type(_adapter *adapter)
|
||||
odm_cmn_info_init(odm, ODM_CMNINFO_IC_TYPE, ic_type);
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_ver_msg(void *sel, _adapter *adapter)
|
||||
static bool rtw_edcca_hal_mode_supported(struct dvobj_priv* dvobj, enum rtw_edcca_mode_t mode)
|
||||
{
|
||||
RTW_PRINT_SEL(sel, "ADAPTIVITY_VERSION "ADAPTIVITY_VERSION"\n");
|
||||
return mode <= RTW_EDCCA_ADAPT;
|
||||
}
|
||||
|
||||
#define RTW_ADAPTIVITY_EN_DISABLE 0
|
||||
#define RTW_ADAPTIVITY_EN_ENABLE 1
|
||||
#define RTW_ADAPTIVITY_EN_AUTO 2
|
||||
|
||||
void rtw_odm_adaptivity_en_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct registry_priv *regsty = &adapter->registrypriv;
|
||||
|
||||
RTW_PRINT_SEL(sel, "RTW_ADAPTIVITY_EN_");
|
||||
|
||||
if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_DISABLE)
|
||||
_RTW_PRINT_SEL(sel, "DISABLE\n");
|
||||
else if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_ENABLE)
|
||||
_RTW_PRINT_SEL(sel, "ENABLE\n");
|
||||
else if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_AUTO)
|
||||
_RTW_PRINT_SEL(sel, "AUTO\n");
|
||||
else
|
||||
_RTW_PRINT_SEL(sel, "INVALID\n");
|
||||
}
|
||||
|
||||
#define RTW_ADAPTIVITY_MODE_NORMAL 0
|
||||
#define RTW_ADAPTIVITY_MODE_CARRIER_SENSE 1
|
||||
|
||||
void rtw_odm_adaptivity_mode_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct registry_priv *regsty = &adapter->registrypriv;
|
||||
|
||||
if (regsty->adaptivity_en != RTW_ADAPTIVITY_EN_ENABLE)
|
||||
return;
|
||||
|
||||
RTW_PRINT_SEL(sel, "RTW_ADAPTIVITY_MODE_");
|
||||
|
||||
if (regsty->adaptivity_mode == RTW_ADAPTIVITY_MODE_NORMAL)
|
||||
_RTW_PRINT_SEL(sel, "NORMAL\n");
|
||||
else if (regsty->adaptivity_mode == RTW_ADAPTIVITY_MODE_CARRIER_SENSE)
|
||||
_RTW_PRINT_SEL(sel, "CARRIER_SENSE\n");
|
||||
else
|
||||
_RTW_PRINT_SEL(sel, "INVALID\n");
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_config_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
rtw_odm_adaptivity_ver_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_en_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_mode_msg(sel, adapter);
|
||||
}
|
||||
|
||||
bool rtw_odm_adaptivity_needed(_adapter *adapter)
|
||||
{
|
||||
struct registry_priv *regsty = &adapter->registrypriv;
|
||||
bool ret = _FALSE;
|
||||
|
||||
if (regsty->adaptivity_en)
|
||||
ret = _TRUE;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_update(struct dvobj_priv *dvobj)
|
||||
void rtw_edcca_hal_update(struct dvobj_priv *dvobj)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(dvobj_get_primary_adapter(dvobj));
|
||||
struct rf_ctl_t *rfctl = dvobj_to_rfctl(dvobj);
|
||||
struct dm_struct *odm = dvobj_to_phydm(dvobj);
|
||||
u8 edcca_mode = RTW_EDCCA_NORMAL;
|
||||
u8 mode;
|
||||
BAND_TYPE band;
|
||||
u8 uch;
|
||||
|
||||
if (hal_data->current_band_type == BAND_ON_2_4G)
|
||||
edcca_mode = rfctl->edcca_mode_2g;
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
else if (hal_data->current_band_type == BAND_ON_5G)
|
||||
edcca_mode = rfctl->edcca_mode_5g;
|
||||
#endif
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
else if (hal_data->current_band_type == BAND_ON_6G)
|
||||
edcca_mode = rfctl->edcca_mode_6g;
|
||||
#endif
|
||||
#ifndef CONFIG_DIRECT_EDCCA_MODE_SETTING
|
||||
if (rtw_mi_get_ch_setting_union(dvobj_get_primary_adapter(dvobj), &uch, NULL, NULL)) {
|
||||
band = uch > 14 ? BAND_ON_5G : BAND_ON_2_4G;
|
||||
rfctl->last_edcca_mode_op_band = band;
|
||||
} else if (rfctl->last_edcca_mode_op_band != BAND_MAX)
|
||||
band = rfctl->last_edcca_mode_op_band;
|
||||
else
|
||||
#endif
|
||||
band = hal_data->current_band_type;
|
||||
|
||||
rfctl->adaptivity_en = (edcca_mode == RTW_EDCCA_NORMAL || edcca_mode == RTW_EDCCA_MODE_NUM) ? 0 : 1;
|
||||
phydm_adaptivity_info_init(odm, PHYDM_ADAPINFO_CARRIER_SENSE_ENABLE, edcca_mode == RTW_EDCCA_CS ? TRUE : FALSE);
|
||||
mode = rtw_get_edcca_mode(dvobj, band);
|
||||
/*
|
||||
* may get band not existing in current channel plan
|
||||
* then edcca mode RTW_EDCCA_MODE_NUM is got
|
||||
* this is not a real problem because this band is not used for TX
|
||||
* change to RTW_EDCCA_NORM to avoid warning calltrace below
|
||||
*/
|
||||
if (mode == RTW_EDCCA_MODE_NUM)
|
||||
mode = RTW_EDCCA_NORM;
|
||||
|
||||
if (!rtw_edcca_hal_mode_supported(dvobj, mode)) {
|
||||
RTW_WARN("%s %s edcca mode %s is not supported by HAL, set to %s\n", __func__
|
||||
, band_str(band), rtw_edcca_mode_str(mode), rtw_edcca_mode_str(RTW_EDCCA_NORM));
|
||||
mode = RTW_EDCCA_NORM;
|
||||
}
|
||||
|
||||
rfctl->adaptivity_en = mode == RTW_EDCCA_NORM ? false : true;
|
||||
phydm_adaptivity_info_init(odm, PHYDM_ADAPINFO_CARRIER_SENSE_ENABLE, mode == RTW_EDCCA_CS ? true : false);
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_ver_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
RTW_PRINT_SEL(sel, "ADAPTIVITY_VERSION "ADAPTIVITY_VERSION"\n");
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_parm_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct dm_struct *odm = adapter_to_phydm(adapter);
|
||||
|
||||
rtw_odm_adaptivity_config_msg(sel, adapter);
|
||||
rtw_cfg_adaptivity_config_msg(sel, adapter);
|
||||
|
||||
RTW_PRINT_SEL(sel, "%10s %16s\n"
|
||||
, "th_l2h_ini", "th_edcca_hl_diff");
|
||||
@@ -213,29 +177,63 @@ s16 rtw_odm_get_tx_power_mbm(struct dm_struct *dm, u8 rfpath, u8 rate, u8 bw, u8
|
||||
return phy_get_txpwr_single_mbm(dm->adapter, rfpath, mgn_rate_to_rs(rate), rate, bw, cch, 0, 0, 0, NULL);
|
||||
}
|
||||
|
||||
#if CONFIG_TXPWR_LIMIT
|
||||
enum txpwr_lmt_reg_exc_match rtw_txpwr_hal_lmt_reg_exc_search(struct dvobj_priv* dvobj, const char *country, u8 domain, const char **reg_name)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(dvobj_get_primary_adapter(dvobj));
|
||||
struct lmt_reg_exc *exc;
|
||||
|
||||
exc = hal_txpwr_lmt_reg_exc_search(hal_data, country, domain);
|
||||
if (exc) {
|
||||
*reg_name = exc->reg_name;
|
||||
if ((exc->country[0] != '\0' || exc->country[1] != '\0')
|
||||
&& _rtw_memcmp(country, exc->country, 2) == _TRUE)
|
||||
return TXPWR_LMT_REG_EXC_MATCH_COUNTRY;
|
||||
else if (exc->domain != 0xFF && domain == exc->domain)
|
||||
return TXPWR_LMT_REG_EXC_MATCH_DOMAIN;
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
return TXPWR_LMT_REG_EXC_MATCH_NONE;
|
||||
}
|
||||
|
||||
bool rtw_txpwr_hal_lmt_reg_search(struct dvobj_priv* dvobj, enum band_type band, const char *name)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(dvobj_get_primary_adapter(dvobj));
|
||||
struct lmt_reg *ent = hal_txpwr_lmt_reg_get_by_name(hal_data, name);
|
||||
|
||||
if (ent) {
|
||||
if (band == BAND_ON_24G && ent->lmt_2g)
|
||||
return true;
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
if (band == BAND_ON_5G && ent->lmt_5g)
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void rtw_txpwr_hal_set_current_lmt_regs_by_name(struct dvobj_priv* dvobj, char *names_of_band[], int names_len_of_band[])
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(dvobj_get_primary_adapter(dvobj));
|
||||
enum band_type band;
|
||||
|
||||
for (band = 0; band < BAND_MAX; band++)
|
||||
hal_txpwr_set_current_lmt_regs(hal_data, band, names_of_band[band], names_len_of_band[band]);
|
||||
}
|
||||
|
||||
void rtw_txpwr_hal_get_current_lmt_regs_name(struct dvobj_priv* dvobj, char *names_of_band[], int names_len_of_band[])
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(dvobj_get_primary_adapter(dvobj));
|
||||
enum band_type band;
|
||||
|
||||
for (band = 0; band < BAND_MAX; band++)
|
||||
hal_txpwr_get_current_lmt_regs(hal_data, band, &names_of_band[band], &names_len_of_band[band]);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
inline void rtw_odm_radar_detect_reset(_adapter *adapter)
|
||||
{
|
||||
phydm_radar_detect_reset(adapter_to_phydm(adapter));
|
||||
}
|
||||
|
||||
inline void rtw_odm_radar_detect_disable(_adapter *adapter)
|
||||
{
|
||||
phydm_radar_detect_disable(adapter_to_phydm(adapter));
|
||||
}
|
||||
|
||||
/* called after ch, bw is set */
|
||||
inline void rtw_odm_radar_detect_enable(_adapter *adapter)
|
||||
{
|
||||
phydm_radar_detect_enable(adapter_to_phydm(adapter));
|
||||
}
|
||||
|
||||
inline BOOLEAN rtw_odm_radar_detect(_adapter *adapter)
|
||||
{
|
||||
return phydm_radar_detect(adapter_to_phydm(adapter));
|
||||
}
|
||||
|
||||
static enum phydm_dfs_region_domain _rtw_dfs_regd_to_phydm[] = {
|
||||
static const enum phydm_dfs_region_domain _rtw_dfs_regd_to_phydm[RTW_DFS_REGD_NUM] = {
|
||||
/* elements not listed here will get PHYDM_DFS_DOMAIN_UNKNOWN(0) */
|
||||
[RTW_DFS_REGD_NONE] = PHYDM_DFS_DOMAIN_UNKNOWN,
|
||||
[RTW_DFS_REGD_FCC] = PHYDM_DFS_DOMAIN_FCC,
|
||||
[RTW_DFS_REGD_MKK] = PHYDM_DFS_DOMAIN_MKK,
|
||||
@@ -244,12 +242,71 @@ static enum phydm_dfs_region_domain _rtw_dfs_regd_to_phydm[] = {
|
||||
|
||||
#define rtw_dfs_regd_to_phydm(region) (((region) >= RTW_DFS_REGD_NUM) ? _rtw_dfs_regd_to_phydm[RTW_DFS_REGD_NONE] : _rtw_dfs_regd_to_phydm[(region)])
|
||||
|
||||
void rtw_odm_update_dfs_region(struct dvobj_priv *dvobj)
|
||||
bool rtw_dfs_hal_region_supported(struct dvobj_priv* dvobj, enum rtw_dfs_regd domain)
|
||||
{
|
||||
odm_cmn_info_init(dvobj_to_phydm(dvobj), ODM_CMNINFO_DFS_REGION_DOMAIN, rtw_dfs_regd_to_phydm(rtw_rfctl_get_dfs_domain(dvobj_to_rfctl(dvobj))));
|
||||
return domain == RTW_DFS_REGD_NONE
|
||||
|| rtw_dfs_regd_to_phydm(domain) != PHYDM_DFS_DOMAIN_UNKNOWN;
|
||||
}
|
||||
|
||||
inline u8 rtw_odm_radar_detect_polling_int_ms(struct dvobj_priv *dvobj)
|
||||
void rtw_dfs_hal_update_region(struct dvobj_priv *dvobj, u8 band_idx, enum rtw_dfs_regd domain)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(dvobj_get_primary_adapter(dvobj));
|
||||
|
||||
rtw_hal_dfs_change_domain(hal_data, band_idx, rtw_dfs_regd_to_phydm(domain));
|
||||
}
|
||||
|
||||
void rtw_dfs_hal_radar_detect_disable(struct dvobj_priv *dvobj, u8 band_idx)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(dvobj_get_primary_adapter(dvobj));
|
||||
|
||||
rtw_hal_dfs_rd_disable(hal_data, band_idx);
|
||||
}
|
||||
|
||||
void rtw_dfs_hal_radar_detect_enable(struct dvobj_priv *dvobj, u8 band_idx, bool cac, u32 rd_freq_hi, u32 rd_freq_lo)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(dvobj_get_primary_adapter(dvobj));
|
||||
|
||||
rtw_hal_dfs_rd_enable_with_sp_freq_range(hal_data, band_idx, cac, rd_freq_hi, rd_freq_lo);
|
||||
}
|
||||
|
||||
void rtw_dfs_hal_set_cac_status(struct dvobj_priv *dvobj, u8 band_idx, bool cac)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(dvobj_get_primary_adapter(dvobj));
|
||||
|
||||
rtw_hal_dfs_rd_set_cac_status(hal_data, band_idx, cac);
|
||||
}
|
||||
|
||||
void rtw_dfs_hal_radar_detect_result_polling(struct dvobj_priv *dvobj, u8 band_idx, u8 *radar_cch, u8 *radar_bw)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = dvobj_to_rfctl(dvobj);
|
||||
u32 cur_hi, cur_lo;
|
||||
|
||||
*radar_cch = 0;
|
||||
*radar_bw = CHANNEL_WIDTH_MAX;
|
||||
|
||||
if (!rfctl->radar_detect_enabled || rfctl->radar_detect_hwband != band_idx)
|
||||
return;
|
||||
|
||||
if (rtw_chbw_to_freq_range(dvobj->oper_channel, dvobj->oper_bwmode, dvobj->oper_ch_offset
|
||||
, &cur_hi, &cur_lo) == _FALSE)
|
||||
return;
|
||||
|
||||
if (!rtw_is_range_overlap(cur_hi, cur_lo
|
||||
, rfctl->radar_detect_freq_hi[band_idx], rfctl->radar_detect_freq_lo[band_idx])
|
||||
|| rtw_get_passing_time_ms(rtw_get_on_oper_ch_time(dvobj_get_primary_adapter(dvobj))) < 300
|
||||
) {
|
||||
/* offchannel, bypass radar detect */
|
||||
return;
|
||||
}
|
||||
|
||||
if (phydm_radar_detect(dvobj_to_phydm(dvobj))) {
|
||||
/* TODO: PHYDM info for specific band and range */
|
||||
*radar_cch = rfctl->radar_detect_cch[band_idx];
|
||||
*radar_bw = rfctl->radar_detect_bw[band_idx];
|
||||
}
|
||||
}
|
||||
|
||||
u8 rtw_dfs_hal_radar_detect_polling_int_ms(struct dvobj_priv *dvobj)
|
||||
{
|
||||
return phydm_dfs_polling_time(dvobj_to_phydm(dvobj));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -38,7 +38,6 @@ int is_any_client_associated(_adapter *padapter)
|
||||
|
||||
static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
u32 len = 0;
|
||||
u16 attr_len = 0;
|
||||
@@ -59,7 +58,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
||||
pstart = pdata_attr;
|
||||
pcur = pdata_attr;
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(pstapriv);
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
|
||||
@@ -126,7 +125,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
||||
|
||||
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(pstapriv);
|
||||
|
||||
if (attr_len > 0)
|
||||
len = rtw_set_p2p_attr_content(pbuf, P2P_ATTR_GROUP_INFO, attr_len, pdata_attr);
|
||||
@@ -390,16 +389,19 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8
|
||||
unsigned char category = RTW_WLAN_CATEGORY_P2P;/* P2P action frame */
|
||||
u32 p2poui = cpu_to_be32(P2POUI);
|
||||
u8 oui_subtype = P2P_PRESENCE_RESPONSE;
|
||||
u8 p2pie[MAX_P2P_IE_LEN] = { 0x00 };
|
||||
u8 *p2pie = NULL;
|
||||
u8 noa_attr_content[32] = { 0x00 };
|
||||
u32 p2pielen = 0;
|
||||
|
||||
RTW_INFO("[%s]\n", __FUNCTION__);
|
||||
|
||||
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
|
||||
if (pmgntframe == NULL)
|
||||
p2pie = (u8 *)rtw_zmalloc(MAX_P2P_IE_LEN);
|
||||
if (!p2pie)
|
||||
return;
|
||||
|
||||
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
|
||||
if (pmgntframe == NULL){
|
||||
rtw_mfree(p2pie, MAX_P2P_IE_LEN);
|
||||
return;
|
||||
}
|
||||
/* update attribute */
|
||||
pattrib = &pmgntframe->attrib;
|
||||
update_mgntframe_attrib(padapter, pattrib);
|
||||
@@ -457,16 +459,18 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8
|
||||
pattrib->last_txcmdsz = pattrib->pktlen;
|
||||
|
||||
dump_mgntframe(padapter, pmgntframe);
|
||||
|
||||
rtw_mfree(p2pie, MAX_P2P_IE_LEN);
|
||||
}
|
||||
|
||||
u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
||||
{
|
||||
u8 p2pie[MAX_P2P_IE_LEN] = { 0x00 };
|
||||
u8 *p2pie = NULL;
|
||||
u16 capability = 0;
|
||||
u32 len = 0, p2pielen = 0;
|
||||
|
||||
|
||||
p2pie = (u8 *)rtw_zmalloc(MAX_P2P_IE_LEN);
|
||||
if (!p2pie)
|
||||
return 0;
|
||||
/* P2P OUI */
|
||||
p2pielen = 0;
|
||||
p2pie[p2pielen++] = 0x50;
|
||||
@@ -512,7 +516,7 @@ u32 build_beacon_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
||||
|
||||
pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len);
|
||||
|
||||
|
||||
rtw_mfree(p2pie, MAX_P2P_IE_LEN);
|
||||
return len;
|
||||
|
||||
}
|
||||
@@ -1867,9 +1871,12 @@ exit:
|
||||
|
||||
u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
||||
{
|
||||
u8 p2pie[MAX_P2P_IE_LEN] = { 0x00 };
|
||||
u8 *p2pie;
|
||||
u32 len = 0, p2pielen = 0;
|
||||
|
||||
p2pie = (u8 *)rtw_zmalloc(MAX_P2P_IE_LEN);
|
||||
if (!p2pie)
|
||||
return 0;
|
||||
/* P2P OUI */
|
||||
p2pielen = 0;
|
||||
p2pie[p2pielen++] = 0x50;
|
||||
@@ -2011,16 +2018,18 @@ u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
|
||||
|
||||
pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len);
|
||||
|
||||
|
||||
rtw_mfree(p2pie, MAX_P2P_IE_LEN);
|
||||
return len;
|
||||
|
||||
}
|
||||
|
||||
u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 *pssid, u8 ussidlen, u8 *pdev_raddr)
|
||||
{
|
||||
u8 p2pie[MAX_P2P_IE_LEN] = { 0x00 };
|
||||
u8 *p2pie = NULL;
|
||||
u32 len = 0, p2pielen = 0;
|
||||
|
||||
p2pie = (u8 *)rtw_zmalloc(MAX_P2P_IE_LEN);
|
||||
if (!p2pie)
|
||||
return 0;
|
||||
/* P2P OUI */
|
||||
p2pielen = 0;
|
||||
p2pie[p2pielen++] = 0x50;
|
||||
@@ -2140,7 +2149,7 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
|
||||
|
||||
pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len);
|
||||
|
||||
|
||||
rtw_mfree(p2pie, MAX_P2P_IE_LEN);
|
||||
return len;
|
||||
|
||||
}
|
||||
@@ -2148,9 +2157,12 @@ u32 build_prov_disc_request_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8
|
||||
|
||||
u32 build_assoc_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 status_code)
|
||||
{
|
||||
u8 p2pie[MAX_P2P_IE_LEN] = { 0x00 };
|
||||
u8 *p2pie = NULL;
|
||||
u32 len = 0, p2pielen = 0;
|
||||
|
||||
p2pie = (u8 *)rtw_zmalloc(MAX_P2P_IE_LEN);
|
||||
if (!p2pie)
|
||||
return 0;
|
||||
/* P2P OUI */
|
||||
p2pielen = 0;
|
||||
p2pie[p2pielen++] = 0x50;
|
||||
@@ -2175,6 +2187,7 @@ u32 build_assoc_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 status
|
||||
|
||||
pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, p2pielen, (unsigned char *) p2pie, &len);
|
||||
|
||||
rtw_mfree(p2pie, MAX_P2P_IE_LEN);
|
||||
return len;
|
||||
|
||||
}
|
||||
@@ -2390,10 +2403,9 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
|
||||
_rtw_memcmp(pwdinfo->p2p_group_ssid, groupid + ETH_ALEN, pwdinfo->p2p_group_ssid_len)) {
|
||||
attr_contentlen = sizeof(dev_addr);
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_DEVICE_ID, dev_addr, &attr_contentlen)) {
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(pstapriv);
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
|
||||
@@ -2406,10 +2418,10 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
|
||||
if (psta->is_p2p_device && (psta->dev_cap & P2P_DEVCAP_CLIENT_DISCOVERABILITY) &&
|
||||
_rtw_memcmp(psta->dev_addr, dev_addr, ETH_ALEN)) {
|
||||
|
||||
/* _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL); */
|
||||
/* rtw_stapriv_asoc_list_unlock(pstapriv); */
|
||||
/* issue GO Discoverability Request */
|
||||
issue_group_disc_req(pwdinfo, psta->cmn.mac_addr);
|
||||
/* _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL); */
|
||||
/* rtw_stapriv_asoc_list_lock(pstapriv); */
|
||||
|
||||
status = P2P_STATUS_SUCCESS;
|
||||
|
||||
@@ -2418,7 +2430,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
|
||||
status = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
|
||||
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(pstapriv);
|
||||
|
||||
} else
|
||||
status = P2P_STATUS_FAIL_INVALID_PARAM;
|
||||
@@ -2515,13 +2527,15 @@ u8 rtw_p2p_get_peer_ch_list(struct wifidirect_info *pwdinfo, u8 *ch_content, u8
|
||||
|
||||
u8 rtw_p2p_ch_inclusion(_adapter *adapter, u8 *peer_ch_list, u8 peer_ch_num, u8 *ch_list_inclusioned)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
struct rtw_chset *chset = adapter_to_chset(adapter);
|
||||
int i = 0, j = 0, temp = 0;
|
||||
u8 ch_no = 0;
|
||||
|
||||
for (i = 0; i < peer_ch_num; i++) {
|
||||
for (j = temp; j < rfctl->max_chan_nums; j++) {
|
||||
if (*(peer_ch_list + i) == rfctl->channel_set[j].ChannelNum) {
|
||||
for (j = temp; j < chset->chs_len; j++) {
|
||||
if (chset->chs[j].flags & RTW_CHF_DIS)
|
||||
continue;
|
||||
if (*(peer_ch_list + i) == chset->chs[j].ChannelNum) {
|
||||
ch_list_inclusioned[ch_no++] = *(peer_ch_list + i);
|
||||
temp = j;
|
||||
break;
|
||||
@@ -2548,6 +2562,21 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe,
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
#endif /* CONFIG_TDLS */
|
||||
#endif /* CONFIG_WFD */
|
||||
u8 *ch_content = NULL, *peer_ch_list = NULL, *ch_list_inclusioned = NULL;
|
||||
|
||||
ch_content = (u8 *)rtw_zmalloc(100);
|
||||
peer_ch_list = (u8 *)rtw_zmalloc(100);
|
||||
ch_list_inclusioned = (u8 *)rtw_zmalloc(100);
|
||||
if ((!ch_content) || (!peer_ch_list) || (!ch_list_inclusioned)) {
|
||||
if (ch_content)
|
||||
rtw_mfree(ch_content, 100);
|
||||
if (peer_ch_list)
|
||||
rtw_mfree(peer_ch_list, 100);
|
||||
if (ch_list_inclusioned)
|
||||
rtw_mfree(ch_list_inclusioned, 100);
|
||||
return P2P_STATUS_FAIL_LIMIT_REACHED;
|
||||
}
|
||||
|
||||
wpsie = rtw_get_wps_ie(pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, NULL, &wps_ielen);
|
||||
if (wpsie) {
|
||||
/* Commented by Kurt 20120113 */
|
||||
@@ -2586,15 +2615,15 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe,
|
||||
while (p2p_ie) {
|
||||
u8 attr_content = 0x00;
|
||||
u32 attr_contentlen = 0;
|
||||
u8 ch_content[100] = { 0x00 };
|
||||
uint ch_cnt = 0;
|
||||
u8 peer_ch_list[100] = { 0x00 };
|
||||
u8 peer_ch_num = 0;
|
||||
u8 ch_list_inclusioned[100] = { 0x00 };
|
||||
u8 ch_num_inclusioned = 0;
|
||||
u16 cap_attr;
|
||||
u8 listen_ch_attr[5] = { 0x00 };
|
||||
|
||||
_rtw_memset(ch_content, 0, 100);
|
||||
_rtw_memset(peer_ch_list, 0, 100);
|
||||
_rtw_memset(ch_list_inclusioned, 0, 100);
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING);
|
||||
|
||||
/* Check P2P Capability ATTR */
|
||||
@@ -2648,7 +2677,7 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe,
|
||||
_rtw_memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN);
|
||||
}
|
||||
|
||||
ch_cnt = sizeof(ch_content);
|
||||
ch_cnt = 100;
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, ch_content, &ch_cnt)) {
|
||||
peer_ch_num = rtw_p2p_get_peer_ch_list(pwdinfo, ch_content, ch_cnt, peer_ch_list);
|
||||
ch_num_inclusioned = rtw_p2p_ch_inclusion(padapter, peer_ch_list, peer_ch_num, ch_list_inclusioned);
|
||||
@@ -2696,10 +2725,15 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the next P2P IE */
|
||||
p2p_ie = rtw_get_p2p_ie(p2p_ie + p2p_ielen, ies_len - (p2p_ie - ies + p2p_ielen), NULL, &p2p_ielen);
|
||||
}
|
||||
if (ch_content)
|
||||
rtw_mfree(ch_content, 100);
|
||||
if (peer_ch_list)
|
||||
rtw_mfree(peer_ch_list, 100);
|
||||
if (ch_list_inclusioned)
|
||||
rtw_mfree(ch_list_inclusioned, 100);
|
||||
|
||||
if (pwdinfo->ui_got_wps_info == P2P_NO_WPSINFO) {
|
||||
result = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
|
||||
@@ -2727,6 +2761,17 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
#endif /* CONFIG_TDLS */
|
||||
#endif /* CONFIG_WFD */
|
||||
u8 *peer_ch_list = NULL;
|
||||
u8 *ch_list_inclusioned = NULL;
|
||||
|
||||
peer_ch_list = (u8 *)rtw_zmalloc(100);
|
||||
if (!peer_ch_list)
|
||||
return P2P_STATUS_FAIL_LIMIT_REACHED;
|
||||
ch_list_inclusioned = (u8 *)rtw_zmalloc(100);
|
||||
if (!ch_list_inclusioned) {
|
||||
rtw_mfree(peer_ch_list, 100);
|
||||
return P2P_STATUS_FAIL_LIMIT_REACHED;
|
||||
}
|
||||
|
||||
ies = pframe + _PUBLIC_ACTION_IE_OFFSET_;
|
||||
ies_len = len - _PUBLIC_ACTION_IE_OFFSET_;
|
||||
@@ -2753,9 +2798,7 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe
|
||||
u8 operatingch_info[5] = { 0x00 };
|
||||
u8 groupid[38];
|
||||
u16 cap_attr;
|
||||
u8 peer_ch_list[100] = { 0x00 };
|
||||
u8 peer_ch_num = 0;
|
||||
u8 ch_list_inclusioned[100] = { 0x00 };
|
||||
u8 ch_num_inclusioned = 0;
|
||||
|
||||
while (p2p_ie) { /* Found the P2P IE. */
|
||||
@@ -2908,7 +2951,10 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (peer_ch_list)
|
||||
rtw_mfree(peer_ch_list, 100);
|
||||
if (ch_list_inclusioned)
|
||||
rtw_mfree(ch_list_inclusioned, 100);
|
||||
#ifdef CONFIG_WFD
|
||||
rtw_process_wfd_ies(padapter, pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, __func__);
|
||||
#endif
|
||||
@@ -3022,23 +3068,23 @@ void find_phase_handler(_adapter *padapter)
|
||||
{
|
||||
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct sitesurvey_parm parm;
|
||||
struct sitesurvey_parm *parm = NULL;
|
||||
_irqL irqL;
|
||||
u8 _status = 0;
|
||||
|
||||
|
||||
rtw_init_sitesurvey_parm(padapter, &parm);
|
||||
_rtw_memcpy(&parm.ssid[0].Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN);
|
||||
parm.ssid[0].SsidLength = P2P_WILDCARD_SSID_LEN;
|
||||
parm.ssid_num = 1;
|
||||
parm = (struct sitesurvey_parm *)rtw_zmalloc(sizeof(struct sitesurvey_parm));
|
||||
if (!parm)
|
||||
return;
|
||||
rtw_init_sitesurvey_parm(padapter, parm);
|
||||
_rtw_memcpy(&(parm->ssid[0].Ssid), pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN);
|
||||
parm->ssid[0].SsidLength = P2P_WILDCARD_SSID_LEN;
|
||||
parm->ssid_num = 1;
|
||||
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH);
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
_status = rtw_sitesurvey_cmd(padapter, &parm);
|
||||
rtw_sitesurvey_cmd(padapter, parm);
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
|
||||
rtw_mfree(parm, sizeof(struct sitesurvey_parm));
|
||||
}
|
||||
|
||||
void restore_p2p_state_handler(_adapter *padapter)
|
||||
@@ -3201,6 +3247,13 @@ static bool rtw_chk_p2pie_ch_list_with_buddy(_adapter *padapter, const u8 *frame
|
||||
u32 ies_len, p2p_ielen;
|
||||
u8 union_ch = rtw_mi_get_union_chan(padapter);
|
||||
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
if (MCC_EN(padapter)) {
|
||||
fit = _TRUE;
|
||||
return fit;
|
||||
}
|
||||
#endif /* CONFIG_MCC_MODE */
|
||||
|
||||
ies = (u8 *)(frame_body + _PUBLIC_ACTION_IE_OFFSET_);
|
||||
ies_len = len - _PUBLIC_ACTION_IE_OFFSET_;
|
||||
|
||||
@@ -3354,7 +3407,10 @@ u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
|
||||
u8 *frame = xframe->buf_addr + TXDESC_OFFSET;
|
||||
u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr);
|
||||
u8 *frame_tail = frame + xframe->attrib.pktlen;
|
||||
u8 category, action, OUI_Subtype, dialogToken = 0;
|
||||
u8 category, action, OUI_Subtype;
|
||||
#ifdef CONFIG_DEBUG_CFG80211
|
||||
u8 dialogToken = 0;
|
||||
#endif
|
||||
u32 wfdielen = 0;
|
||||
|
||||
category = frame_body[0];
|
||||
@@ -3364,7 +3420,7 @@ u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
|
||||
&& _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE
|
||||
) {
|
||||
OUI_Subtype = frame_body[6];
|
||||
dialogToken = frame_body[7];
|
||||
/*dialogToken = frame_body[7];*/
|
||||
|
||||
switch (OUI_Subtype) {
|
||||
case P2P_GO_NEGO_REQ:
|
||||
@@ -3397,9 +3453,9 @@ u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
|
||||
}
|
||||
} else if (category == RTW_WLAN_CATEGORY_P2P) {
|
||||
OUI_Subtype = frame_body[5];
|
||||
#ifdef CONFIG_DEBUG_CFG80211
|
||||
dialogToken = frame_body[6];
|
||||
|
||||
#ifdef CONFIG_DEBUG_CFG80211
|
||||
RTW_INFO("ACTION_CATEGORY_P2P: OUI=0x%x, OUI_Subtype=%d, dialogToken=%d\n"
|
||||
, cpu_to_be32(*((u32 *)(frame_body + 1))), OUI_Subtype, dialogToken);
|
||||
#endif
|
||||
@@ -3503,21 +3559,30 @@ u8 *dump_p2p_attr_ch_list(u8 *p2p_ie, uint p2p_ielen, u8 *buf, u32 buf_len)
|
||||
u8 *pattr = NULL;
|
||||
int w_sz = 0;
|
||||
u8 ch_cnt = 0;
|
||||
u8 ch_list[40];
|
||||
u8 ch_list[MAX_CHANNEL_NUM];
|
||||
|
||||
pattr = rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, NULL, &attr_contentlen);
|
||||
if (pattr != NULL) {
|
||||
int i, j;
|
||||
u32 num_of_ch;
|
||||
u8 op_class;
|
||||
u8 *pattr_temp = pattr + 3 ;
|
||||
|
||||
attr_contentlen -= 3;
|
||||
|
||||
_rtw_memset(ch_list, 0, 40);
|
||||
_rtw_memset(ch_list, 0, MAX_CHANNEL_NUM);
|
||||
|
||||
while (attr_contentlen > 0) {
|
||||
op_class = *pattr_temp;
|
||||
num_of_ch = *(pattr_temp + 1);
|
||||
|
||||
/* skip 6GHz channels in P2P attribute when 6GHz band is not supported */
|
||||
if (!CONFIG_IEEE80211_BAND_6GHZ && (op_class >= 131)) {
|
||||
pattr_temp += (2 + num_of_ch);
|
||||
attr_contentlen -= (2 + num_of_ch);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_of_ch; i++) {
|
||||
for (j = 0; j < ch_cnt; j++) {
|
||||
if (ch_list[j] == *(pattr_temp + 2 + i))
|
||||
@@ -3525,13 +3590,17 @@ u8 *dump_p2p_attr_ch_list(u8 *p2p_ie, uint p2p_ielen, u8 *buf, u32 buf_len)
|
||||
}
|
||||
if (j >= ch_cnt)
|
||||
ch_list[ch_cnt++] = *(pattr_temp + 2 + i);
|
||||
|
||||
if (ch_cnt == MAX_CHANNEL_NUM) {
|
||||
RTW_INFO("channel list array is used up, may need to increase array size\n");
|
||||
goto make_str;
|
||||
}
|
||||
}
|
||||
|
||||
pattr_temp += (2 + num_of_ch);
|
||||
attr_contentlen -= (2 + num_of_ch);
|
||||
}
|
||||
|
||||
make_str:
|
||||
for (j = 0; j < ch_cnt; j++) {
|
||||
if (j == 0)
|
||||
w_sz += snprintf(buf + w_sz, buf_len - w_sz, "%u", ch_list[j]);
|
||||
@@ -3568,7 +3637,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
||||
uint p2p_ielen = 0;
|
||||
struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(padapter);
|
||||
int status = -1;
|
||||
u8 ch_list_buf[128] = {'\0'};
|
||||
u8 *ch_list_buf = NULL;
|
||||
int op_ch = -1;
|
||||
int listen_ch = -1;
|
||||
u8 intent = 0;
|
||||
@@ -3577,6 +3646,9 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
||||
|
||||
frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr));
|
||||
category = frame_body[0];
|
||||
ch_list_buf = (u8 *)rtw_zmalloc(128);
|
||||
if (!ch_list_buf)
|
||||
return is_p2p_frame;
|
||||
/* just for check */
|
||||
if (category == RTW_WLAN_CATEGORY_PUBLIC) {
|
||||
action = frame_body[1];
|
||||
@@ -3722,7 +3794,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
||||
}
|
||||
case P2P_GO_NEGO_CONF: {
|
||||
struct rtw_wdev_nego_info *nego_info = &pwdev_priv->nego_info;
|
||||
bool is_go = _FALSE;
|
||||
/*bool is_go = _FALSE;*/
|
||||
|
||||
if (tx) {
|
||||
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
|
||||
@@ -3744,12 +3816,12 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
||||
nego_info->status = (status == -1) ? 0xff : status;
|
||||
nego_info->conf_op_ch = (op_ch == -1) ? 0 : op_ch;
|
||||
nego_info->state = 2;
|
||||
|
||||
#if 0
|
||||
if (status == 0) {
|
||||
if (rtw_p2p_nego_intent_compare(nego_info->req_intent, nego_info->rsp_intent) ^ !tx)
|
||||
is_go = _TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
nego_info->token = 0; /* init */
|
||||
}
|
||||
|
||||
@@ -3945,7 +4017,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
rtw_mfree(ch_list_buf, 128);
|
||||
return is_p2p_frame;
|
||||
}
|
||||
#endif /* CONFIG_IOCTL_CFG80211 */
|
||||
@@ -4011,7 +4083,7 @@ int process_p2p_cross_connect_ie(PADAPTER padapter, u8 *IEs, u32 IELength)
|
||||
u32 ies_len;
|
||||
u8 *p2p_ie;
|
||||
u32 p2p_ielen = 0;
|
||||
u8 p2p_attr[MAX_P2P_IE_LEN] = { 0x00 };/* NoA length should be n*(13) + 2 */
|
||||
u8 *p2p_attr = NULL; /* NoA length should be n*(13) + 2 */
|
||||
u32 attr_contentlen = 0;
|
||||
|
||||
|
||||
@@ -4019,6 +4091,10 @@ int process_p2p_cross_connect_ie(PADAPTER padapter, u8 *IEs, u32 IELength)
|
||||
if (IELength <= _BEACON_IE_OFFSET_)
|
||||
return ret;
|
||||
|
||||
p2p_attr = (u8 *)rtw_zmalloc(MAX_P2P_IE_LEN);
|
||||
if (!p2p_attr)
|
||||
return ret;
|
||||
|
||||
ies = IEs + _BEACON_IE_OFFSET_;
|
||||
ies_len = IELength - _BEACON_IE_OFFSET_;
|
||||
|
||||
@@ -4026,7 +4102,7 @@ int process_p2p_cross_connect_ie(PADAPTER padapter, u8 *IEs, u32 IELength)
|
||||
|
||||
while (p2p_ie) {
|
||||
/* Get P2P Manageability IE. */
|
||||
attr_contentlen = sizeof(p2p_attr);
|
||||
attr_contentlen = MAX_P2P_IE_LEN;
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_MANAGEABILITY, p2p_attr, &attr_contentlen)) {
|
||||
if ((p2p_attr[0] & (BIT(0) | BIT(1))) == 0x01)
|
||||
ret = _FALSE;
|
||||
@@ -4035,7 +4111,7 @@ int process_p2p_cross_connect_ie(PADAPTER padapter, u8 *IEs, u32 IELength)
|
||||
/* Get the next P2P IE */
|
||||
p2p_ie = rtw_get_p2p_ie(p2p_ie + p2p_ielen, ies_len - (p2p_ie - ies + p2p_ielen), NULL, &p2p_ielen);
|
||||
}
|
||||
|
||||
rtw_mfree(p2p_attr, MAX_P2P_IE_LEN);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -4178,6 +4254,8 @@ void p2p_ps_wk_hdl(_adapter *padapter, u8 p2p_ps_state)
|
||||
return;
|
||||
}
|
||||
if (pwdinfo->p2p_ps_mode > P2P_PS_NONE) {
|
||||
/* do not need thise warning message due to FW already handle this case*/
|
||||
#if 0
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
if (MCC_EN(padapter)) {
|
||||
if (rtw_hal_check_mcc_status(padapter, MCC_STATUS_DOING_MCC)) {
|
||||
@@ -4187,6 +4265,7 @@ void p2p_ps_wk_hdl(_adapter *padapter, u8 p2p_ps_state)
|
||||
|
||||
}
|
||||
#endif /* CONFIG_MCC_MODE */
|
||||
#endif
|
||||
pwdinfo->p2p_ps_state = p2p_ps_state;
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
|
||||
598
drivers/net/wireless/rtl8822cs/core/rtw_prealloc.c
Normal file
598
drivers/net/wireless/rtl8822cs/core/rtw_prealloc.c
Normal file
@@ -0,0 +1,598 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtw_mem.h>
|
||||
|
||||
#ifndef RTKM_MAX_RECVBUF_SZ
|
||||
#define RTKM_MAX_RECVBUF_SZ (0x8000) /* 32k */
|
||||
#endif /* RTKM_MAX_RECVBUF_SZ */
|
||||
|
||||
#ifndef RTKM_MAX_NR_PREALLOC_RECV_SKB
|
||||
#ifndef NR_PREALLOC_RECV_SKB
|
||||
#define NR_PREALLOC_RECV_SKB 8
|
||||
#endif /* NR_PREALLOC_RECV_SKB */
|
||||
#define RTKM_MAX_NR_PREALLOC_RECV_SKB \
|
||||
(NR_PREALLOC_RECV_SKB * CONFIG_IFACE_NUMBER)
|
||||
#endif /* RTKM_MAX_NR_PREALLOC_RECV_SKB */
|
||||
|
||||
#if defined(CONFIG_STACKTRACE) && \
|
||||
(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0))
|
||||
#define STACKTRACE 1
|
||||
#define MAX_STACK_TRACE 4
|
||||
#endif /* CONFIG_STACKTRACE */
|
||||
|
||||
#define TRACE_ORDER(a, b) ((a) && (((a)&BIT(b)) > 0))
|
||||
|
||||
#if (defined(CONFIG_RTKM) && defined(CONFIG_RTKM_STANDALONE))
|
||||
#ifdef pr_fmt
|
||||
#undef pr_fmt
|
||||
#endif
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
|
||||
#undef RTW_PRINT
|
||||
#define RTW_PRINT pr_info
|
||||
unsigned int rtw_drv_log_level = 0; /* for compiler */
|
||||
#else /* !CONFIG_RTKM */
|
||||
#ifdef pr_fmt
|
||||
#undef pr_fmt
|
||||
#endif
|
||||
#define pr_fmt(fmt) "RTKM: " fmt
|
||||
#endif /* CONFIG_RTKM */
|
||||
|
||||
struct sk_buff_head rtkm_skb_q;
|
||||
|
||||
struct phy_mem_list {
|
||||
_lock lock;
|
||||
_list list;
|
||||
struct rb_root rb_tree;
|
||||
unsigned short entries;
|
||||
unsigned short used;
|
||||
unsigned short peak;
|
||||
unsigned char order;
|
||||
} rtkm_phy_list[MAX_ORDER];
|
||||
|
||||
struct mem_entry {
|
||||
_list list;
|
||||
struct rb_node rbn;
|
||||
void *data;
|
||||
size_t size;
|
||||
#ifdef STACKTRACE
|
||||
#ifndef CONFIG_ARCH_STACKWALK
|
||||
struct stack_trace trace;
|
||||
#endif /* CONFIG_ARCH_STACKWALK */
|
||||
unsigned long stack_entries[MAX_STACK_TRACE];
|
||||
#endif /* STACKTRACE */
|
||||
unsigned char order;
|
||||
unsigned char is_use;
|
||||
};
|
||||
|
||||
#ifdef STACKTRACE
|
||||
#ifdef CONFIG_ARCH_STACKWALK
|
||||
static inline void stacktrace_print(const struct mem_entry *entries,
|
||||
unsigned int nr_entries, int spaces)
|
||||
{
|
||||
stack_trace_print(entries->stack_entries, nr_entries, spaces);
|
||||
}
|
||||
|
||||
static inline int stacktrace_save(struct mem_entry *store)
|
||||
{
|
||||
return stack_trace_save(store->stack_entries,
|
||||
ARRAY_SIZE(store->stack_entries), 1);
|
||||
}
|
||||
#else /* !CONFIG_ARCH_STACKWALK */
|
||||
static inline void stacktrace_print(const struct mem_entry *entries,
|
||||
unsigned int nr_entries, int spaces)
|
||||
{
|
||||
stack_trace_print(entries->trace.entries, nr_entries, spaces);
|
||||
}
|
||||
|
||||
static inline void stacktrace_save(struct mem_entry *store)
|
||||
{
|
||||
store->trace.skip = 0;
|
||||
store->trace.nr_entries = 0;
|
||||
store->trace.entries = store->stack_entries;
|
||||
store->trace.max_entries = MAX_STACK_TRACE;
|
||||
save_stack_trace(&store->trace);
|
||||
}
|
||||
#endif /* CONFIG_ARCH_STACKWALK */
|
||||
#else /* !STACKTRACE */
|
||||
#define stacktrace_print(a, b, c)
|
||||
#define stacktrace_save(a)
|
||||
#endif /* STACKTRACE */
|
||||
|
||||
/* Trace mpool */
|
||||
static unsigned int rtkm_trace = 0;
|
||||
module_param(rtkm_trace, uint, 0644);
|
||||
MODULE_PARM_DESC(rtkm_trace, "Trace memory pool");
|
||||
|
||||
/* Preallocated memory expansion */
|
||||
static bool rtkm_mem_exp = 1;
|
||||
module_param(rtkm_mem_exp, bool, 0644);
|
||||
MODULE_PARM_DESC(rtkm_mem_exp, "Preallocated memory expansion");
|
||||
|
||||
#ifndef RTKM_MPOOL_0
|
||||
#define RTKM_MPOOL_0 0
|
||||
#endif
|
||||
#ifndef RTKM_MPOOL_1
|
||||
#define RTKM_MPOOL_1 0
|
||||
#endif
|
||||
#ifndef RTKM_MPOOL_2
|
||||
#define RTKM_MPOOL_2 0
|
||||
#endif
|
||||
#ifndef RTKM_MPOOL_3
|
||||
#define RTKM_MPOOL_3 0
|
||||
#endif
|
||||
#ifndef RTKM_MPOOL_4
|
||||
#define RTKM_MPOOL_4 0
|
||||
#endif
|
||||
#ifndef RTKM_MPOOL_5
|
||||
#define RTKM_MPOOL_5 0
|
||||
#endif
|
||||
#ifndef RTKM_MPOOL_6
|
||||
#define RTKM_MPOOL_6 0
|
||||
#endif
|
||||
#ifndef RTKM_MPOOL_7
|
||||
#define RTKM_MPOOL_7 0
|
||||
#endif
|
||||
#ifndef RTKM_MPOOL_8
|
||||
#define RTKM_MPOOL_8 0
|
||||
#endif
|
||||
|
||||
/* Preallocated memory pool */
|
||||
static int mpool[MAX_ORDER] = {
|
||||
[0] = RTKM_MPOOL_0, [1] = RTKM_MPOOL_1, [2] = RTKM_MPOOL_2,
|
||||
[3] = RTKM_MPOOL_3, [4] = RTKM_MPOOL_4, [5] = RTKM_MPOOL_5,
|
||||
[6] = RTKM_MPOOL_6, [7] = RTKM_MPOOL_7, [8] = RTKM_MPOOL_8
|
||||
};
|
||||
static int n_mpool = 1;
|
||||
module_param_array(mpool, int, &n_mpool, 0644);
|
||||
MODULE_PARM_DESC(mpool, "Preallocated memory pool");
|
||||
|
||||
static inline void dump_mstatus(void *sel)
|
||||
{
|
||||
int i;
|
||||
unsigned int a, b, c;
|
||||
long unsigned int musage = 0;
|
||||
|
||||
a = b = c = 0;
|
||||
|
||||
RTW_PRINT_SEL(sel,
|
||||
"====================== RTKM ======================\n");
|
||||
RTW_PRINT_SEL(sel, "%6s %10s %10s %10s %10s\n", "order", "use", "peak",
|
||||
rtkm_mem_exp ? "alloc+" : "alloc", "size");
|
||||
RTW_PRINT_SEL(sel,
|
||||
"--------------------------------------------------\n");
|
||||
for (i = 0; i < MAX_ORDER; i++) {
|
||||
if (rtkm_phy_list[i].entries) {
|
||||
RTW_PRINT_SEL(
|
||||
sel, "%6d %10d %10d %10d %10lu\n", i,
|
||||
rtkm_phy_list[i].used, rtkm_phy_list[i].peak,
|
||||
rtkm_phy_list[i].entries,
|
||||
(rtkm_phy_list[i].entries) * (PAGE_SIZE << i));
|
||||
a += rtkm_phy_list[i].used;
|
||||
b += rtkm_phy_list[i].peak;
|
||||
c += rtkm_phy_list[i].entries;
|
||||
musage += (rtkm_phy_list[i].entries) * (PAGE_SIZE << i);
|
||||
}
|
||||
}
|
||||
RTW_PRINT_SEL(sel, "%6s %10d %10d %10d %10lu\n", "sum", a, b, c,
|
||||
musage);
|
||||
}
|
||||
|
||||
void rtkm_dump_mstatus(void *sel)
|
||||
{
|
||||
dump_mstatus(sel);
|
||||
}
|
||||
EXPORT_SYMBOL(rtkm_dump_mstatus);
|
||||
|
||||
void rtkm_set_trace(unsigned int mask)
|
||||
{
|
||||
rtkm_trace = mask;
|
||||
}
|
||||
EXPORT_SYMBOL(rtkm_set_trace);
|
||||
|
||||
static void rb_insert_mem(struct phy_mem_list *mlist, struct mem_entry *entry)
|
||||
{
|
||||
struct rb_node **p = &mlist->rb_tree.rb_node;
|
||||
struct rb_node *parent = NULL;
|
||||
struct mem_entry *tmp = NULL;
|
||||
|
||||
while (*p) {
|
||||
parent = *p;
|
||||
tmp = rb_entry(parent, struct mem_entry, rbn);
|
||||
|
||||
if (tmp->data < entry->data)
|
||||
p = &(*p)->rb_left;
|
||||
else
|
||||
p = &(*p)->rb_right;
|
||||
}
|
||||
|
||||
rb_link_node(&entry->rbn, parent, p);
|
||||
rb_insert_color(&entry->rbn, &mlist->rb_tree);
|
||||
}
|
||||
|
||||
static struct mem_entry *rb_find_mem(struct phy_mem_list *mlist,
|
||||
const void *objp)
|
||||
{
|
||||
struct rb_node *n = mlist->rb_tree.rb_node;
|
||||
struct mem_entry *entry = NULL;
|
||||
|
||||
while (n) {
|
||||
entry = rb_entry(n, struct mem_entry, rbn);
|
||||
|
||||
if (entry->data == objp)
|
||||
return entry;
|
||||
else if (entry->data < objp)
|
||||
n = n->rb_left;
|
||||
else
|
||||
n = n->rb_right;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void *create_mem_entry(int order)
|
||||
{
|
||||
struct mem_entry *entry;
|
||||
|
||||
entry = rtw_malloc(sizeof(struct mem_entry));
|
||||
if (entry == NULL) {
|
||||
pr_warn("%s: alloc memory entry fail!\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
entry->order = order;
|
||||
entry->is_use = _FALSE;
|
||||
/* get memory by pages */
|
||||
entry->data = (void *)__get_free_pages(
|
||||
in_interrupt() ? GFP_ATOMIC : GFP_KERNEL, entry->order);
|
||||
if (entry->data == NULL) {
|
||||
rtw_mfree(entry, sizeof(struct mem_entry));
|
||||
pr_warn("%s: alloc memory oreder-%d fail!\n", __func__, order);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
static inline void *_kmalloc(size_t size, gfp_t flags, int clear)
|
||||
{
|
||||
int order = 0;
|
||||
int warn = _FALSE;
|
||||
struct mem_entry *entry = NULL;
|
||||
struct mem_entry *temp_entry = NULL;
|
||||
_irqL irqL;
|
||||
|
||||
order = get_order(size);
|
||||
if (order >= MAX_ORDER) {
|
||||
pr_warn("%s: Out-of-bounds size %zu (order-%d)\n", __func__,
|
||||
size, order);
|
||||
WARN_ON(1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (rtkm_phy_list[order].entries == rtkm_phy_list[order].used) {
|
||||
if (rtkm_mem_exp) {
|
||||
warn = _TRUE;
|
||||
pr_warn("%s: No enough order-%d pool\n", __func__,
|
||||
order);
|
||||
entry = create_mem_entry(order);
|
||||
if (entry) {
|
||||
_enter_critical(&rtkm_phy_list[order].lock,
|
||||
&irqL);
|
||||
list_add_tail(
|
||||
&entry->list,
|
||||
&rtkm_phy_list[entry->order].list);
|
||||
rtkm_phy_list[entry->order].entries++;
|
||||
_exit_critical(&rtkm_phy_list[order].lock,
|
||||
&irqL);
|
||||
}
|
||||
}
|
||||
|
||||
if (entry == NULL) {
|
||||
pr_warn("%s: No more memory for size %zu\n", __func__,
|
||||
size);
|
||||
WARN_ON(1);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
_enter_critical(&rtkm_phy_list[order].lock, &irqL);
|
||||
list_for_each_entry_safe(entry, temp_entry, &rtkm_phy_list[order].list, list) {
|
||||
if (entry->is_use == _FALSE) {
|
||||
entry->is_use = _TRUE;
|
||||
entry->size = size;
|
||||
if (clear == _TRUE)
|
||||
memset(entry->data, 0, size);
|
||||
stacktrace_save(entry);
|
||||
rtkm_phy_list[order].used++;
|
||||
list_move_tail(&entry->list, &rtkm_phy_list[order].list);
|
||||
rb_insert_mem(&rtkm_phy_list[order], entry);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rtkm_phy_list[order].peak < rtkm_phy_list[order].used)
|
||||
rtkm_phy_list[order].peak = rtkm_phy_list[order].used;
|
||||
_exit_critical(&rtkm_phy_list[order].lock, &irqL);
|
||||
|
||||
if ((warn) || TRACE_ORDER(rtkm_trace, order)) {
|
||||
pr_info("%s: require(%p, %zu) usage(%d %u/%u)\n", __func__,
|
||||
entry->data, entry->size, order,
|
||||
rtkm_phy_list[order].used,
|
||||
rtkm_phy_list[order].entries);
|
||||
stacktrace_print(entry, MAX_STACK_TRACE, 0);
|
||||
}
|
||||
|
||||
return entry->data;
|
||||
}
|
||||
|
||||
static inline void _kfree(const void *objp, size_t size)
|
||||
{
|
||||
int order = 0;
|
||||
struct mem_entry *entry;
|
||||
_irqL irqL;
|
||||
|
||||
order = get_order(size);
|
||||
if (order >= MAX_ORDER) {
|
||||
pr_warn("%s: not found (%p, %zu)\n", __func__, objp, size);
|
||||
pr_warn("%s: Out-of-bounds size %zu (order-%d)\n", __func__,
|
||||
size, order);
|
||||
WARN_ON(1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (list_empty(&rtkm_phy_list[order].list)) {
|
||||
pr_warn("%s: list is empty (%p, %zu)\n", __func__, objp, size);
|
||||
return;
|
||||
}
|
||||
|
||||
_enter_critical(&rtkm_phy_list[order].lock, &irqL);
|
||||
entry = rb_find_mem(&rtkm_phy_list[order], objp);
|
||||
if (entry && (entry->is_use == _TRUE) && (entry->data == objp)) {
|
||||
if (TRACE_ORDER(rtkm_trace, order)) {
|
||||
pr_info("%s: release(%p, %zu)\n", __func__, objp, size);
|
||||
}
|
||||
rtw_list_delete(&entry->list);
|
||||
rtkm_phy_list[order].used--;
|
||||
entry->is_use = _FALSE;
|
||||
entry->size = 0;
|
||||
rb_erase(&entry->rbn, &rtkm_phy_list[order].rb_tree);
|
||||
list_add(&entry->list, &rtkm_phy_list[order].list);
|
||||
} else {
|
||||
pr_warn("%s: not found (%p, %zu)\n", __func__, objp, size);
|
||||
}
|
||||
_exit_critical(&rtkm_phy_list[order].lock, &irqL);
|
||||
}
|
||||
|
||||
void *rtkm_kmalloc(size_t size, gfp_t flags)
|
||||
{
|
||||
if (size > RTKM_MGMT_SIZE)
|
||||
return _kmalloc(size, flags, _FALSE);
|
||||
else
|
||||
return kmalloc(size, flags);
|
||||
}
|
||||
EXPORT_SYMBOL(rtkm_kmalloc);
|
||||
|
||||
void *rtkm_kzalloc(size_t size, gfp_t flags)
|
||||
{
|
||||
if (size > RTKM_MGMT_SIZE)
|
||||
return _kmalloc(size, flags, _TRUE);
|
||||
else
|
||||
return kzalloc(size, flags);
|
||||
}
|
||||
EXPORT_SYMBOL(rtkm_kzalloc);
|
||||
|
||||
void rtkm_kfree(const void *objp, size_t size)
|
||||
{
|
||||
if (size > RTKM_MGMT_SIZE)
|
||||
return _kfree(objp, size);
|
||||
else
|
||||
return kfree(objp);
|
||||
}
|
||||
EXPORT_SYMBOL(rtkm_kfree);
|
||||
|
||||
static inline int rtkm_init_phy(void)
|
||||
{
|
||||
int ret = 0, i, j;
|
||||
struct mem_entry *entry;
|
||||
|
||||
pr_info("%s", __func__);
|
||||
pr_info("%s: memory expansion:%d\n", __func__, rtkm_mem_exp);
|
||||
|
||||
for (i = (MAX_ORDER - 1); i >= 0; i--) {
|
||||
INIT_LIST_HEAD(&rtkm_phy_list[i].list);
|
||||
_rtw_spinlock_init(&rtkm_phy_list[i].lock);
|
||||
rtkm_phy_list[i].rb_tree = RB_ROOT;
|
||||
|
||||
for (j = 0; (ret == 0) && (j < mpool[i]); j++) {
|
||||
entry = create_mem_entry(i);
|
||||
if (entry == NULL) {
|
||||
ret = -ENOMEM;
|
||||
break;
|
||||
}
|
||||
|
||||
list_add_tail(&entry->list,
|
||||
&rtkm_phy_list[entry->order].list);
|
||||
rtkm_phy_list[entry->order].entries++;
|
||||
}
|
||||
}
|
||||
if (ret == 0)
|
||||
dump_mstatus(RTW_DBGDUMP);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline void rtkm_destroy_phy(void)
|
||||
{
|
||||
int i = 0;
|
||||
struct mem_entry *entry;
|
||||
|
||||
pr_info("%s", __func__);
|
||||
dump_mstatus(RTW_DBGDUMP);
|
||||
|
||||
for (i = 0; i < MAX_ORDER; i++) {
|
||||
if (rtkm_phy_list[i].used)
|
||||
pr_err("%s: memory leak! order=%d num=%d\n", __func__,
|
||||
i, rtkm_phy_list[i].used);
|
||||
|
||||
if (rtkm_phy_list[i].rb_tree.rb_node != NULL)
|
||||
pr_err("%s: rb tree leak! order=%d\n", __func__, i);
|
||||
|
||||
while (!list_empty(&rtkm_phy_list[i].list)) {
|
||||
entry = list_entry(rtkm_phy_list[i].list.next,
|
||||
struct mem_entry, list);
|
||||
list_del_init(&entry->list);
|
||||
if (entry->is_use == _TRUE) {
|
||||
rb_erase(&entry->rbn,
|
||||
&rtkm_phy_list[i].rb_tree);
|
||||
pr_err("%s: memory leak! (%p, %zu)\n", __func__,
|
||||
entry->data, entry->size);
|
||||
stacktrace_print(entry, MAX_STACK_TRACE, 0);
|
||||
}
|
||||
if (entry->data)
|
||||
free_pages((unsigned long)(entry->data),
|
||||
entry->order);
|
||||
entry->data = NULL;
|
||||
entry->size = 0;
|
||||
entry->is_use = _FALSE;
|
||||
rtw_mfree(entry, sizeof(struct mem_entry));
|
||||
entry = NULL;
|
||||
rtkm_phy_list[i].entries--;
|
||||
}
|
||||
_rtw_spinlock_free(&rtkm_phy_list[i].lock);
|
||||
}
|
||||
}
|
||||
|
||||
u16 rtkm_get_max_buff_size(void)
|
||||
{
|
||||
return RTKM_MAX_RECVBUF_SZ;
|
||||
}
|
||||
EXPORT_SYMBOL(rtkm_get_max_buff_size);
|
||||
|
||||
u8 rtkm_get_max_nr_rx_skb(void)
|
||||
{
|
||||
return RTKM_MAX_NR_PREALLOC_RECV_SKB;
|
||||
}
|
||||
EXPORT_SYMBOL(rtkm_get_max_nr_rx_skb);
|
||||
|
||||
inline struct sk_buff *rtkm_alloc_skb(unsigned int length)
|
||||
{
|
||||
struct sk_buff *skb = NULL;
|
||||
|
||||
if (length > (RTKM_MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ)) {
|
||||
pr_warn("%s: allocate size(%u) > MAX_SZ(%d + %d)\n", __func__,
|
||||
length, RTKM_MAX_RECVBUF_SZ, RECVBUFF_ALIGN_SZ);
|
||||
WARN_ON(1);
|
||||
return skb;
|
||||
}
|
||||
|
||||
skb = skb_dequeue(&rtkm_skb_q);
|
||||
|
||||
return skb;
|
||||
}
|
||||
EXPORT_SYMBOL(rtkm_alloc_skb);
|
||||
|
||||
void rtkm_kfree_skb_any(struct sk_buff *skb)
|
||||
{
|
||||
skb_queue_tail(&rtkm_skb_q, skb);
|
||||
}
|
||||
EXPORT_SYMBOL(rtkm_kfree_skb_any);
|
||||
|
||||
inline int rtkm_init_skb(void)
|
||||
{
|
||||
int i;
|
||||
int ret = 0;
|
||||
SIZE_PTR tmpaddr = 0;
|
||||
SIZE_PTR alignment = 0;
|
||||
struct sk_buff *pskb = NULL;
|
||||
|
||||
pr_info("%s: RTKM_MAX_NR_PREALLOC_RECV_SKB: %d\n", __func__,
|
||||
RTKM_MAX_NR_PREALLOC_RECV_SKB);
|
||||
pr_info("%s: RTKM_MAX_RECVBUF_SZ: %d\n", __func__, RTKM_MAX_RECVBUF_SZ);
|
||||
|
||||
skb_queue_head_init(&rtkm_skb_q);
|
||||
|
||||
for (i = 0; i < RTKM_MAX_NR_PREALLOC_RECV_SKB; i++) {
|
||||
pskb = __dev_alloc_skb(RTKM_MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ,
|
||||
in_interrupt() ? GFP_ATOMIC :
|
||||
GFP_KERNEL);
|
||||
if (pskb) {
|
||||
tmpaddr = (SIZE_PTR)pskb->data;
|
||||
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ - 1);
|
||||
skb_reserve(pskb, (RECVBUFF_ALIGN_SZ - alignment));
|
||||
|
||||
skb_queue_tail(&rtkm_skb_q, pskb);
|
||||
} else {
|
||||
printk("%s: alloc skb memory fail!\n", __func__);
|
||||
ret = -ENOMEM;
|
||||
}
|
||||
|
||||
pskb = NULL;
|
||||
}
|
||||
|
||||
printk("%s: rtkm_skb_q len : %d\n", __func__,
|
||||
skb_queue_len(&rtkm_skb_q));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline void rtkm_destroy_skb(void)
|
||||
{
|
||||
pr_info("%s", __func__);
|
||||
|
||||
if (skb_queue_len(&rtkm_skb_q))
|
||||
pr_info("%s: rtkm_skb_q len : %d\n", __func__,
|
||||
skb_queue_len(&rtkm_skb_q));
|
||||
|
||||
skb_queue_purge(&rtkm_skb_q);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int rtkm_prealloc_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
pr_info("%s\n", __func__);
|
||||
|
||||
ret = rtkm_init_phy();
|
||||
if (ret == -ENOMEM) {
|
||||
pr_err("No enough memory for phiscal.");
|
||||
rtkm_destroy_phy();
|
||||
}
|
||||
|
||||
ret = rtkm_init_skb();
|
||||
if (ret == -ENOMEM) {
|
||||
pr_err("No enough memory for skb.");
|
||||
rtkm_destroy_skb();
|
||||
}
|
||||
|
||||
pr_info("%s: done ret=%d\n", __func__, ret);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(rtkm_prealloc_init);
|
||||
|
||||
void rtkm_prealloc_destroy(void)
|
||||
{
|
||||
pr_info("%s\n", __func__);
|
||||
|
||||
rtkm_destroy_phy();
|
||||
rtkm_destroy_skb();
|
||||
|
||||
pr_info("%s: done\n", __func__);
|
||||
}
|
||||
EXPORT_SYMBOL(rtkm_prealloc_destroy);
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -40,7 +40,8 @@ int rtw_fw_ps_state(PADAPTER padapter)
|
||||
, rtw_is_drv_stopped(padapter) ? "True" : "False");
|
||||
goto exit_fw_ps_state;
|
||||
}
|
||||
#if defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C)
|
||||
#if defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) \
|
||||
|| defined(CONFIG_RTL8822E)
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_FW_PS_STATE, (u8 *)&fw_ps_state);
|
||||
if ((fw_ps_state & BIT_LPS_STATUS) == 0)
|
||||
ret = _SUCCESS;
|
||||
@@ -91,9 +92,6 @@ void _ips_enter(_adapter *padapter)
|
||||
pwrpriv->bpower_saving = _TRUE;
|
||||
RTW_PRINT("nolinked power save enter\n");
|
||||
|
||||
if (pwrpriv->ips_mode == IPS_LEVEL_2)
|
||||
pwrpriv->bkeepfwalive = _TRUE;
|
||||
|
||||
#ifdef CONFIG_RTW_CFGVENDOR_LLSTATS
|
||||
pwrpriv->pwr_saving_start_time = rtw_get_current_time();
|
||||
#endif /* CONFIG_RTW_CFGVENDOR_LLSTATS */
|
||||
@@ -204,9 +202,6 @@ bool rtw_pwr_unassociated_idle(_adapter *adapter)
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
struct xmit_priv *pxmit_priv = &adapter->xmitpriv;
|
||||
struct mlme_priv *pmlmepriv;
|
||||
#ifdef CONFIG_P2P
|
||||
struct wifidirect_info *pwdinfo;
|
||||
#endif
|
||||
|
||||
bool ret = _FALSE;
|
||||
|
||||
@@ -224,9 +219,7 @@ bool rtw_pwr_unassociated_idle(_adapter *adapter)
|
||||
iface = dvobj->padapters[i];
|
||||
if ((iface) && rtw_is_adapter_up(iface)) {
|
||||
pmlmepriv = &(iface->mlmepriv);
|
||||
#ifdef CONFIG_P2P
|
||||
pwdinfo = &(iface->wdinfo);
|
||||
#endif
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE | WIFI_UNDER_SURVEY)
|
||||
|| check_fwstate(pmlmepriv, WIFI_UNDER_LINKING | WIFI_UNDER_WPS)
|
||||
|| MLME_IS_AP(iface)
|
||||
@@ -237,8 +230,8 @@ bool rtw_pwr_unassociated_idle(_adapter *adapter)
|
||||
|| (rtw_cfg80211_is_ro_ch_once(adapter)
|
||||
&& rtw_cfg80211_get_last_ro_ch_passing_ms(adapter) < 3000)
|
||||
#elif defined(CONFIG_P2P)
|
||||
|| rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE)
|
||||
|| rtw_p2p_chk_state(pwdinfo, P2P_STATE_LISTEN)
|
||||
|| rtw_p2p_chk_state(&iface->wdinfo, P2P_STATE_IDLE)
|
||||
|| rtw_p2p_chk_state(&iface->wdinfo, P2P_STATE_LISTEN)
|
||||
#endif
|
||||
)
|
||||
goto exit;
|
||||
@@ -352,7 +345,7 @@ exit:
|
||||
void pwr_state_check_handler(void *ctx)
|
||||
{
|
||||
_adapter *padapter = (_adapter *)ctx;
|
||||
rtw_ps_cmd(padapter);
|
||||
rtw_ips_ctrl_wk_cmd(padapter, IPS_CTRL_ENTER, -1, 0);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
@@ -696,12 +689,14 @@ u8 PS_RDY_CHECK(_adapter *padapter)
|
||||
void rtw_set_lps_lclk(_adapter *padapter, u8 enable)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter);
|
||||
struct hal_spec_t *hal_spec = GET_HAL_SPEC(padapter);
|
||||
u8 val8 = 0;
|
||||
u8 polling_cnt = 0;
|
||||
u8 cpwm_orig = 0;
|
||||
u8 cpwm_now = 0;
|
||||
u8 result = _FAIL;
|
||||
systime start_time;
|
||||
u8 is_mac_off_access = _TRUE; /* check the off area of mac can be access */
|
||||
|
||||
if (enable) {
|
||||
/* set rpwm to enter 32k */
|
||||
@@ -717,17 +712,37 @@ void rtw_set_lps_lclk(_adapter *padapter, u8 enable)
|
||||
* may not see 0xEA at this point.
|
||||
*/
|
||||
if (!pwrctl->wowlan_pno_enable) {
|
||||
do {
|
||||
val8 = rtw_read8(padapter, REG_CR);
|
||||
polling_cnt++;
|
||||
RTW_INFO("%s polling 0x100=0x%x, cnt=%d\n",
|
||||
__func__, val8, polling_cnt);
|
||||
RTW_INFO("%s 0x08:%02x, 0x03:%02x\n",
|
||||
__func__,
|
||||
rtw_read8(padapter, 0x08),
|
||||
rtw_read8(padapter, 0x03));
|
||||
rtw_mdelay_os(10);
|
||||
} while (polling_cnt < 20 && (val8 != 0xEA));
|
||||
#ifdef CONFIG_USB_HCI
|
||||
if (hal_spec->mac_off_access_limit_in_low_clock == _FALSE)
|
||||
is_mac_off_access = _TRUE;
|
||||
else
|
||||
is_mac_off_access = _FALSE;
|
||||
#endif /* CONFIG_USB_HCI */
|
||||
|
||||
if (is_mac_off_access == _TRUE) {
|
||||
do {
|
||||
val8 = rtw_read8(padapter, REG_CR);
|
||||
polling_cnt++;
|
||||
RTW_DBG("%s polling 0x100=0x%x, cnt=%d\n",
|
||||
__func__, val8, polling_cnt);
|
||||
RTW_DBG("%s 0x08:%02x, 0x03:%02x\n",
|
||||
__func__,
|
||||
rtw_read8(padapter, 0x08),
|
||||
rtw_read8(padapter, 0x03));
|
||||
rtw_mdelay_os(10);
|
||||
} while (polling_cnt < 20 && (val8 != 0xEA));
|
||||
} else {
|
||||
do {
|
||||
/* polling mac register 0x8[4]=1 to check that mac */
|
||||
/* switches clock to 32K. It was an alternative method */
|
||||
/* by RS suggested. */
|
||||
val8 = rtw_read8(padapter, REG_SYS_CLK_CTRL);
|
||||
polling_cnt++;
|
||||
RTW_DBG("%s polling 0x8=0x%x, cnt=%d\n",
|
||||
__func__, val8, polling_cnt);
|
||||
rtw_mdelay_os(10);
|
||||
} while (polling_cnt < 20 && ((val8 & BIT(4)) > 0));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* for polling cpwm */
|
||||
@@ -789,9 +804,11 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
||||
u8 val8 = 0;
|
||||
u8 parm[H2C_INACTIVE_PS_LEN] = {0};
|
||||
|
||||
if (padapter->netif_up == _FALSE) {
|
||||
RTW_INFO("%s: ERROR, netif is down\n", __func__);
|
||||
return;
|
||||
if (pwrpriv->wowlan_pno_enable) {
|
||||
if (padapter->netif_up == _FALSE) {
|
||||
RTW_INFO("%s: ERROR, netif is down\n", __func__);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* u8 cmd_param; */ /* BIT0:enable, BIT1:NoConnect32k */
|
||||
@@ -804,9 +821,11 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
||||
|
||||
parm[0] = 0x1;/* suggest by Isaac.Hsu*/
|
||||
#ifdef CONFIG_PNO_SUPPORT
|
||||
if (pwrpriv->pno_inited) {
|
||||
parm[1] = pwrpriv->pnlo_info->fast_scan_iterations;
|
||||
parm[2] = pwrpriv->pnlo_info->slow_scan_period;
|
||||
if (pwrpriv->wowlan_pno_enable) {
|
||||
if (pwrpriv->pno_inited) {
|
||||
parm[1] = pwrpriv->pnlo_info->fast_scan_iterations;
|
||||
parm[2] = pwrpriv->pnlo_info->slow_scan_period;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -817,22 +836,24 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
||||
do {
|
||||
val8 = rtw_read8(padapter, REG_HMETFR);
|
||||
cnt++;
|
||||
RTW_INFO("%s polling REG_HMETFR=0x%x, cnt=%d\n",
|
||||
RTW_DBG("%s polling REG_HMETFR=0x%x, cnt=%d\n",
|
||||
__func__, val8, cnt);
|
||||
rtw_mdelay_os(10);
|
||||
} while (cnt < 100 && (val8 != 0));
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
/* H2C done, enter 32k */
|
||||
if (val8 == 0)
|
||||
rtw_set_lps_lclk(padapter, _TRUE);
|
||||
if (rtw_is_fw_ips_lclk_mode(padapter) == _TRUE) {
|
||||
if (val8 == 0)
|
||||
rtw_set_lps_lclk(padapter, _TRUE);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
/* Leave IPS */
|
||||
RTW_INFO("%s: Leaving IPS in FWLPS state\n", __func__);
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
rtw_set_lps_lclk(padapter, _FALSE);
|
||||
if (rtw_is_fw_ips_lclk_mode(padapter) == _TRUE)
|
||||
rtw_set_lps_lclk(padapter, _FALSE);
|
||||
#endif
|
||||
parm[0] = 0x0;
|
||||
parm[1] = 0x0;
|
||||
@@ -844,6 +865,90 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
u8 rtw_fw_ips_init(_adapter *padapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
#endif /* DBG_CONFIG_ERROR_DETECT */
|
||||
struct debug_priv *pdbgpriv = &adapter_to_dvobj(padapter)->drv_dbg;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
u8 bMacPwrCtrlOn = _TRUE;
|
||||
|
||||
if (pwrpriv->bips_processing == _TRUE &&
|
||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||
psrtpriv->silent_reset_inprogress == _FALSE &&
|
||||
#endif /* DBG_CONFIG_ERROR_DETECT */
|
||||
pHalData->bFWReady == _TRUE &&
|
||||
pwrpriv->pre_ips_type == 0) {
|
||||
|
||||
rtw_set_fw_in_ips_mode(padapter, _FALSE);
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
if (rtw_fw_ps_state(padapter) == _FAIL) {
|
||||
RTW_INFO("after hal init, fw ps state in 32k\n");
|
||||
pdbgpriv->dbg_ips_drvopen_fail_cnt++;
|
||||
}
|
||||
#endif /* DBG_CHECK_FW_PS_STATE */
|
||||
#endif /* CONFIG_LPS_LCLK */
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
u8 rtw_fw_ips_deinit(_adapter *padapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
#endif /* DBG_CONFIG_ERROR_DETECT */
|
||||
struct debug_priv *pdbgpriv = &adapter_to_dvobj(padapter)->drv_dbg;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct hal_spec_t *hal_spec = GET_HAL_SPEC(padapter);
|
||||
u8 is_mac_off_access = _TRUE; /* check the off area of mac can be access */
|
||||
|
||||
if (pwrpriv->bips_processing == _TRUE &&
|
||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||
psrtpriv->silent_reset_inprogress == _FALSE &&
|
||||
#endif /* DBG_CONFIG_ERROR_DETECT */
|
||||
pHalData->bFWReady == _TRUE &&
|
||||
padapter->netif_up == _TRUE) {
|
||||
|
||||
rtw_set_fw_in_ips_mode(padapter, _TRUE);
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
if(rtw_is_fw_ips_lclk_mode(padapter) == _TRUE) {
|
||||
#ifdef CONFIG_USB_HCI
|
||||
if (hal_spec->mac_off_access_limit_in_low_clock == _FALSE)
|
||||
is_mac_off_access = _TRUE;
|
||||
else
|
||||
is_mac_off_access = _FALSE;
|
||||
#endif /* CONFIG_USB_HCI */
|
||||
|
||||
if (is_mac_off_access == _TRUE) {
|
||||
RTW_INFO("polling done when entering FW_IPS_LCLK, check result : 0x100=0x%x\n",
|
||||
rtw_read8(padapter, REG_CR));
|
||||
} else {
|
||||
RTW_INFO("polling done when entering FW_IPS_LCLK, check result : 0x8[4]=%d\n",
|
||||
(rtw_read8(padapter, REG_SYS_CLK_CTRL) & BIT(4)) ? 1 : 0);
|
||||
}
|
||||
|
||||
pwrpriv->pre_ips_type = 0;
|
||||
}
|
||||
#endif /* CONFIG_LPS_LCLK */
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
pdbgpriv->dbg_carddisable_cnt++;
|
||||
pwrpriv->pre_ips_type = 1;
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
#endif /* CONFIG_FWLPS_IN_IPS */
|
||||
|
||||
void rtw_exec_lps(_adapter *padapter, u8 ps_mode)
|
||||
@@ -1109,8 +1214,12 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if (pwrpriv->wowlan_mode == _TRUE)
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_INACTIVE_IPS, (u8 *)(&ps_mode));
|
||||
#ifdef CONFIG_FWLPS_IN_IPS
|
||||
if (rtw_is_fw_ips_mode(padapter) == _TRUE) {
|
||||
if (pwrpriv->wowlan_mode == _TRUE)
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_INACTIVE_IPS, (u8 *)(&ps_mode));
|
||||
}
|
||||
#endif /* CONFIG_FWLPS_IN_IPS */
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
|
||||
rtw_exec_lps(padapter, ps_mode);
|
||||
@@ -1197,8 +1306,12 @@ void rtw_set_ps_mode(PADAPTER padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode
|
||||
rtw_exec_lps(padapter, ps_mode);
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if (pwrpriv->wowlan_mode == _TRUE)
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_INACTIVE_IPS, (u8 *)(&ps_mode));
|
||||
#ifdef CONFIG_FWLPS_IN_IPS
|
||||
if (rtw_is_fw_ips_mode(padapter) == _TRUE) {
|
||||
if (pwrpriv->wowlan_mode == _TRUE)
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_INACTIVE_IPS, (u8 *)(&ps_mode));
|
||||
}
|
||||
#endif /* CONFIG_FWLPS_IN_IPS */
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
|
||||
#ifdef CONFIG_P2P_PS
|
||||
@@ -1412,8 +1525,8 @@ void LeaveAllPowerSaveModeDirect(PADAPTER Adapter)
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
#ifndef CONFIG_DETECT_CPWM_BY_POLLING
|
||||
u8 cpwm_orig;
|
||||
#endif /* CONFIG_DETECT_CPWM_BY_POLLING */
|
||||
u8 rpwm;
|
||||
#endif /* CONFIG_DETECT_CPWM_BY_POLLING */
|
||||
#endif
|
||||
int i;
|
||||
|
||||
@@ -1434,16 +1547,15 @@ void LeaveAllPowerSaveModeDirect(PADAPTER Adapter)
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
#ifndef CONFIG_DETECT_CPWM_BY_POLLING
|
||||
#ifdef CONFIG_DETECT_CPWM_BY_POLLING
|
||||
rtw_set_rpwm(Adapter, PS_STATE_S4);
|
||||
#else /* !CONFIG_DETECT_CPWM_BY_POLLING */
|
||||
cpwm_orig = 0;
|
||||
rtw_hal_get_hwreg(Adapter, HW_VAR_CPWM, &cpwm_orig);
|
||||
#endif /* CONFIG_DETECT_CPWM_BY_POLLING */
|
||||
rpwm = rtw_set_rpwm(Adapter, PS_STATE_S4);
|
||||
|
||||
#ifndef CONFIG_DETECT_CPWM_BY_POLLING
|
||||
if (rpwm != 0xFF && rpwm & PS_ACK)
|
||||
rtw_cpwm_polling(Adapter, rpwm, cpwm_orig);
|
||||
#endif /* CONFIG_DETECT_CPWM_BY_POLLING */
|
||||
#endif /* !CONFIG_DETECT_CPWM_BY_POLLING */
|
||||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
#endif/*CONFIG_LPS_LCLK*/
|
||||
@@ -1464,13 +1576,14 @@ void LeaveAllPowerSaveModeDirect(PADAPTER Adapter)
|
||||
} else {
|
||||
if (pwrpriv->rf_pwrstate == rf_off) {
|
||||
|
||||
#if defined(CONFIG_FWLPS_IN_IPS) || defined(CONFIG_SWLPS_IN_IPS) || defined(CONFIG_RTL8188E) || defined(CONFIG_PNO_SUPPORT)
|
||||
#ifdef CONFIG_IPS
|
||||
if (_FALSE == ips_leave(pri_padapter))
|
||||
RTW_INFO("======> ips_leave fail.............\n");
|
||||
#if defined(CONFIG_FWLPS_IN_IPS) || defined(CONFIG_SWLPS_IN_IPS)
|
||||
if (rtw_is_fw_ips_mode(Adapter) == _TRUE) {
|
||||
if (_FALSE == ips_leave(pri_padapter))
|
||||
RTW_INFO("======> ips_leave fail.............\n");
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif /* CONFIG_SWLPS_IN_IPS || (CONFIG_PLATFORM_SPRD && CONFIG_RTL8188E) */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1527,12 +1640,14 @@ void LeaveAllPowerSaveMode(PADAPTER Adapter)
|
||||
} else {
|
||||
if (adapter_to_pwrctl(Adapter)->rf_pwrstate == rf_off) {
|
||||
|
||||
#if defined(CONFIG_FWLPS_IN_IPS) || defined(CONFIG_SWLPS_IN_IPS) || (defined(CONFIG_PLATFORM_SPRD) && defined(CONFIG_RTL8188E))
|
||||
#ifdef CONFIG_IPS
|
||||
if (_FALSE == ips_leave(Adapter))
|
||||
RTW_INFO("======> ips_leave fail.............\n");
|
||||
#if defined(CONFIG_FWLPS_IN_IPS) || defined(CONFIG_SWLPS_IN_IPS)
|
||||
if (rtw_is_fw_ips_mode(Adapter) == _TRUE) {
|
||||
if (_FALSE == ips_leave(Adapter))
|
||||
RTW_INFO("======> ips_leave fail.............\n");
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif /* CONFIG_SWLPS_IN_IPS || (CONFIG_PLATFORM_SPRD && CONFIG_RTL8188E) */
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1660,7 +1775,7 @@ static void dma_event_callback(struct work_struct *work)
|
||||
|
||||
#define DBG_CPWM_CHK_FAIL
|
||||
#if defined(DBG_CPWM_CHK_FAIL) && (defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) \
|
||||
|| defined(CONFIG_RTL8723F))
|
||||
|| defined(CONFIG_RTL8723F) || defined(CONFIG_RTL8822E))
|
||||
#define CPU_EXCEPTION_CODE 0xFAFAFAFA
|
||||
static void rtw_cpwm_chk_fail_debug(_adapter *padapter)
|
||||
{
|
||||
@@ -1730,7 +1845,7 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work)
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
#if defined(DBG_CPWM_CHK_FAIL) && (defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) \
|
||||
|| defined(CONFIG_RTL8723F))
|
||||
|| defined(CONFIG_RTL8723F) || defined(CONFIG_RTL8822E))
|
||||
RTW_INFO("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
|
||||
rtw_cpwm_chk_fail_debug(padapter);
|
||||
#endif
|
||||
@@ -2228,6 +2343,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
#endif
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
|
||||
u8 val8 = 0;
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
@@ -2309,7 +2425,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
|
||||
#ifdef CONFIG_LPS_PG
|
||||
pwrctrlpriv->lpspg_info.name = "LPSPG_INFO";
|
||||
#ifdef CONFIG_RTL8822C
|
||||
#if (defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8822E))
|
||||
pwrctrlpriv->lpspg_dpk_info.name = "LPSPG_DPK_INFO";
|
||||
pwrctrlpriv->lpspg_iqk_info.name = "LPSPG_IQK_INFO";
|
||||
#endif
|
||||
@@ -2325,7 +2441,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
_init_workitem(&pwrctrlpriv->resume_work, resume_workitem_callback, NULL);
|
||||
pwrctrlpriv->rtw_workqueue = create_freezable_workqueue("rtw_workqueue");
|
||||
pwrctrlpriv->rtw_workqueue = create_singlethread_workqueue("rtw_workqueue");
|
||||
#endif /* CONFIG_RESUME_IN_WORKQUEUE */
|
||||
|
||||
#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
|
||||
@@ -2335,7 +2451,7 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
pwrctrlpriv->wowlan_gpio_index = WAKEUP_GPIO_IDX;
|
||||
/* set output low state in initial */
|
||||
/* driver always sets output low state except it gets into wowlan mode. */
|
||||
pwrctrlpriv->wowlan_gpio_output_state = GPIO_OUTPUT_LOW;
|
||||
/*default low active*/
|
||||
pwrctrlpriv->is_high_active = HIGH_ACTIVE_DEV2HST;
|
||||
@@ -2359,12 +2475,11 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
rtw_hal_set_output_gpio(padapter, pwrctrlpriv->wowlan_gpio_index,
|
||||
GPIO_OUTPUT_LOW);
|
||||
#else
|
||||
rtw_hal_set_output_gpio(padapter, pwrctrlpriv->wowlan_gpio_index
|
||||
, pwrctrlpriv->wowlan_gpio_output_state);
|
||||
rtw_hal_switch_gpio_wl_ctrl(padapter, pwrctrlpriv->wowlan_gpio_index, _TRUE);
|
||||
val8 = (pwrctrlpriv->is_high_active == 0) ? 1 : 0;
|
||||
rtw_hal_set_output_gpio(padapter, pwrctrlpriv->wowlan_gpio_index, val8);
|
||||
RTW_INFO("%s: set GPIO_%d to OUTPUT %s state in initial and %s_ACTIVE.\n",
|
||||
__func__, pwrctrlpriv->wowlan_gpio_index,
|
||||
pwrctrlpriv->wowlan_gpio_output_state ? "HIGH" : "LOW",
|
||||
__func__, pwrctrlpriv->wowlan_gpio_index, val8 ? "HIGH" : "LOW",
|
||||
pwrctrlpriv->is_high_active ? "HIGI" : "LOW");
|
||||
#endif /*CONFIG_WAKEUP_GPIO_INPUT_MODE*/
|
||||
#endif /* CONFIG_RTW_ONE_PIN_GPIO */
|
||||
@@ -2379,14 +2494,15 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
#define WOW_LPS_1T1R_ARG
|
||||
#endif
|
||||
|
||||
pwrctrlpriv->wowlan_ips_mode = padapter->registrypriv.wow_ips_mode;
|
||||
pwrctrlpriv->wowlan_power_mgmt = padapter->registrypriv.wow_power_mgnt;
|
||||
pwrctrlpriv->wowlan_lps_level = padapter->registrypriv.wow_lps_level;
|
||||
#ifdef CONFIG_LPS_1T1R
|
||||
pwrctrlpriv->wowlan_lps_1t1r = padapter->registrypriv.wow_lps_1t1r;
|
||||
#endif
|
||||
|
||||
RTW_INFO("%s: WOW_LPS_mode=%d, WOW_LPS_level=%d"WOW_LPS_1T1R_FMT"\n",
|
||||
__func__, pwrctrlpriv->wowlan_power_mgmt, pwrctrlpriv->wowlan_lps_level
|
||||
RTW_INFO("%s: WOW_IPS_mode=%d, WOW_LPS_mode=%d, WOW_LPS_level=%d"WOW_LPS_1T1R_FMT"\n",
|
||||
__func__, pwrctrlpriv->wowlan_ips_mode, pwrctrlpriv->wowlan_power_mgmt, pwrctrlpriv->wowlan_lps_level
|
||||
WOW_LPS_1T1R_ARG
|
||||
);
|
||||
|
||||
@@ -2418,6 +2534,11 @@ void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
rtw_wow_war_mdns_parms_reset(padapter, _TRUE);
|
||||
#endif /* defined(CONFIG_OFFLOAD_MDNS_V4) || defined(CONFIG_OFFLOAD_MDNS_V6) */
|
||||
#endif /* CONFIG_WAR_OFFLOAD */
|
||||
|
||||
#ifdef CONFIG_MDNS_OFFLOAD
|
||||
_rtw_memset(&pwrctrlpriv->mdns_ofld_info, 0,
|
||||
sizeof(struct rtw_mdns_ofld_info));
|
||||
#endif
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
|
||||
#ifdef CONFIG_LPS_POFF
|
||||
@@ -2446,8 +2567,8 @@ void rtw_free_pwrctrl_priv(PADAPTER adapter)
|
||||
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
if (pwrctrlpriv->rtw_workqueue) {
|
||||
// flush_workqueue(pwrctrlpriv->rtw_workqueue);
|
||||
// destroy_workqueue(pwrctrlpriv->rtw_workqueue);
|
||||
flush_workqueue(pwrctrlpriv->rtw_workqueue);
|
||||
destroy_workqueue(pwrctrlpriv->rtw_workqueue);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2465,7 +2586,7 @@ void rtw_free_pwrctrl_priv(PADAPTER adapter)
|
||||
|
||||
#ifdef CONFIG_LPS_PG
|
||||
rsvd_page_cache_free(&pwrctrlpriv->lpspg_info);
|
||||
#ifdef CONFIG_RTL8822C
|
||||
#if (defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8822E))
|
||||
rsvd_page_cache_free(&pwrctrlpriv->lpspg_dpk_info);
|
||||
rsvd_page_cache_free(&pwrctrlpriv->lpspg_iqk_info);
|
||||
#endif
|
||||
@@ -2661,6 +2782,45 @@ u8 rtw_interface_ps_func(_adapter *padapter, HAL_INTF_PS_FUNC efunc_id, u8 *val)
|
||||
return bResult;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FWLPS_IN_IPS
|
||||
BOOLEAN rtw_is_fw_ips_mode(_adapter *padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
u8 ips_mode;
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if (pwrpriv->wowlan_mode == _TRUE)
|
||||
ips_mode = pwrpriv->wowlan_ips_mode;
|
||||
else
|
||||
#endif
|
||||
ips_mode = pwrpriv->ips_mode_req;
|
||||
|
||||
if (ips_mode == IPS_FWIPS || ips_mode == IPS_FWIPS_LCLK)
|
||||
return _TRUE;
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
BOOLEAN rtw_is_fw_ips_lclk_mode(_adapter *padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
u8 ips_mode;
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
if (pwrpriv->wowlan_mode == _TRUE)
|
||||
ips_mode = pwrpriv->wowlan_ips_mode;
|
||||
else
|
||||
#endif
|
||||
ips_mode = pwrpriv->ips_mode_req;
|
||||
|
||||
if (ips_mode == IPS_FWIPS_LCLK)
|
||||
return _TRUE;
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
#endif /* CONFIG_LPS_LCLK */
|
||||
#endif /* CONFIG_FWLPS_IN_IPS */
|
||||
|
||||
inline void rtw_set_ips_deny(_adapter *padapter, u32 ms)
|
||||
{
|
||||
@@ -2837,6 +2997,41 @@ inline void rtw_set_lps_deny(_adapter *adapter, u32 ms)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
int rtw_pm_set_wow_ips(_adapter *padapter, u8 mode)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
|
||||
int ret = 0;
|
||||
char str[80] = {0};
|
||||
|
||||
if (mode >= IPS_NONE && mode < IPS_NUM) {
|
||||
if (pwrctrlpriv->wowlan_ips_mode != mode) {
|
||||
pwrctrlpriv->wowlan_ips_mode = mode;
|
||||
|
||||
if (mode == IPS_NONE)
|
||||
strcpy(str, "IPS_NONE");
|
||||
else if (mode == IPS_NORMAL)
|
||||
strcpy(str, "IPS_NORMAL");
|
||||
#ifdef CONFIG_FWLPS_IN_IPS
|
||||
else if (mode == IPS_FWIPS)
|
||||
strcpy(str, "IPS_FWIPS");
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
else if (mode == IPS_FWIPS_LCLK)
|
||||
strcpy(str, "IPS_FWIPS_LCLK");
|
||||
#endif /* CONFIG_LPS_LCLK */
|
||||
#endif /* CONFIG_FWLPS_IN_IPS */
|
||||
else
|
||||
strcpy(str, "Invalid");
|
||||
}
|
||||
} else {
|
||||
sprintf(str, "Invalid value(%d)", mode);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
RTW_INFO("%s WOW IPS mode: %s\n", __func__, str);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rtw_pm_set_wow_lps(_adapter *padapter, u8 mode)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -2879,20 +3074,65 @@ int rtw_pm_set_wow_lps_1t1r(_adapter *padapter, u8 en)
|
||||
|
||||
int rtw_pm_set_ips(_adapter *padapter, u8 mode)
|
||||
{
|
||||
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
|
||||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
int ret = 0;
|
||||
u8 flags = 0;
|
||||
char str[80] = {0};
|
||||
|
||||
if (mode == IPS_NORMAL || mode == IPS_LEVEL_2) {
|
||||
rtw_ips_mode_req(pwrctrlpriv, mode);
|
||||
RTW_INFO("%s %s\n", __FUNCTION__, mode == IPS_NORMAL ? "IPS_NORMAL" : "IPS_LEVEL_2");
|
||||
return 0;
|
||||
} else if (mode == IPS_NONE) {
|
||||
rtw_ips_mode_req(pwrctrlpriv, mode);
|
||||
RTW_INFO("%s %s\n", __FUNCTION__, "IPS_NONE");
|
||||
if (!rtw_is_surprise_removed(padapter) && (_FAIL == rtw_pwr_wakeup(padapter)))
|
||||
if (mode >= IPS_NONE && mode < IPS_NUM) {
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RTW_ERR("%s: Surprise Removed occured !\n", __func__);
|
||||
return -EFAULT;
|
||||
} else
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pwrctrlpriv->ips_mode_req != mode) {
|
||||
if ((pwrctrlpriv->ips_mode_req != IPS_NONE) &&
|
||||
(ATOMIC_READ(&(pcmdpriv->cmdthd_running)) == _TRUE)) {
|
||||
if (pdvobj->processing_dev_remove == _TRUE
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
|| rtw_mp_mode_check(padapter)
|
||||
#endif
|
||||
)
|
||||
flags |= RTW_CMDF_DIRECTLY;
|
||||
else
|
||||
flags |= RTW_CMDF_WAIT_ACK;
|
||||
|
||||
if (rtw_ips_ctrl_wk_cmd(padapter, IPS_CTRL_LEAVE_SET_MODE,
|
||||
mode, flags) != _SUCCESS) {
|
||||
RTW_INFO("Set IPS mode Fail!\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
} else {
|
||||
rtw_ips_mode_req(pwrctrlpriv, mode);
|
||||
}
|
||||
|
||||
if (mode == IPS_NONE)
|
||||
strcpy(str, "IPS_NONE");
|
||||
else if (mode == IPS_NORMAL)
|
||||
strcpy(str, "IPS_NORMAL");
|
||||
#ifdef CONFIG_FWLPS_IN_IPS
|
||||
else if (mode == IPS_FWIPS)
|
||||
strcpy(str, "IPS_FWIPS");
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
else if (mode == IPS_FWIPS_LCLK)
|
||||
strcpy(str, "IPS_FWIPS_LCLK");
|
||||
#endif /* CONFIG_LPS_LCLK */
|
||||
#endif /* CONFIG_FWLPS_IN_IPS */
|
||||
else
|
||||
strcpy(str, "Invalid");
|
||||
} else {
|
||||
strcpy(str, "the input is the same with current ips_mode !");
|
||||
}
|
||||
} else {
|
||||
sprintf(str, "Invalid value(%d)", mode);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
RTW_INFO("%s IPS mode: %s\n", __func__, str);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -93,6 +93,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter)
|
||||
precvpriv->sink_udpport = 0;
|
||||
precvpriv->pre_rtp_rxseq = 0;
|
||||
precvpriv->cur_rtp_rxseq = 0;
|
||||
precvpriv->rtp_drop_count = 0;
|
||||
|
||||
#ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA
|
||||
precvpriv->store_law_data_flag = 1;
|
||||
@@ -146,8 +147,6 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter)
|
||||
|
||||
precvpriv->signal_stat_sampling_interval = 2000; /* ms */
|
||||
/* precvpriv->signal_stat_converging_constant = 5000; */ /* ms */
|
||||
|
||||
rtw_set_signal_stat_timer(precvpriv);
|
||||
#endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
|
||||
|
||||
_rtw_memset(&precvpriv->ip_statistic, 0,
|
||||
@@ -531,11 +530,19 @@ sint recvframe_chkmic(_adapter *adapter, union recv_frame *precvframe)
|
||||
mickey = &stainfo->dot11tkiprxmickey.skey[0];
|
||||
}
|
||||
|
||||
if (precvframe->u.hdr.len <= prxattrib->hdrlen) {
|
||||
RTW_INFO("%s pkt_len <= hdrlen!!!\n", __func__);
|
||||
return _FAIL;
|
||||
}
|
||||
datalen = precvframe->u.hdr.len - prxattrib->hdrlen - prxattrib->iv_len - prxattrib->icv_len - 8; /* icv_len included the mic code */
|
||||
pframe = precvframe->u.hdr.rx_data;
|
||||
payload = pframe + prxattrib->hdrlen + prxattrib->iv_len;
|
||||
|
||||
|
||||
if (datalen > precvframe->u.hdr.rx_tail - precvframe->u.hdr.rx_data || datalen > precvframe->u.hdr.rx_end - precvframe->u.hdr.rx_data){
|
||||
RTW_INFO("%s datalen is abnormal, too big!!!\n", __func__);
|
||||
return _FAIL;
|
||||
}
|
||||
/* rtw_seccalctkipmic(&stainfo->dot11tkiprxmickey.skey[0],pframe,payload, datalen ,&miccode[0],(unsigned char)prxattrib->priority); */ /* care the length of the data */
|
||||
|
||||
rtw_seccalctkipmic(mickey, pframe, payload, datalen , &miccode[0], (unsigned char)prxattrib->priority); /* care the length of the data */
|
||||
@@ -817,7 +824,6 @@ union recv_frame *portctrl(_adapter *adapter, union recv_frame *precv_frame)
|
||||
*/
|
||||
#define PN_LESS_CHK(a, b) (((a-b) & 0x800000000000) != 0)
|
||||
#define VALID_PN_CHK(new, old) (((old) == 0) || PN_LESS_CHK(old, new))
|
||||
#define CCMPH_2_KEYID(ch) (((ch) & 0x00000000c0000000) >> 30)
|
||||
sint recv_ucast_pn_decache(union recv_frame *precv_frame);
|
||||
sint recv_ucast_pn_decache(union recv_frame *precv_frame)
|
||||
{
|
||||
@@ -826,17 +832,20 @@ sint recv_ucast_pn_decache(union recv_frame *precv_frame)
|
||||
struct stainfo_rxcache *prxcache = &sta->sta_recvpriv.rxcache;
|
||||
u8 *pdata = precv_frame->u.hdr.rx_data;
|
||||
sint tid = precv_frame->u.hdr.attrib.priority;
|
||||
u64 tmp_iv_hdr = 0;
|
||||
u64 curr_pn = 0, pkt_pn = 0;
|
||||
u8 pn[8] = {0};
|
||||
|
||||
if (tid > 15)
|
||||
return _FAIL;
|
||||
|
||||
if (pattrib->encrypt == _AES_) {
|
||||
tmp_iv_hdr = le64_to_cpu(*(u64*)(pdata + pattrib->hdrlen));
|
||||
pkt_pn = CCMPH_2_PN(tmp_iv_hdr);
|
||||
tmp_iv_hdr = le64_to_cpu(*(u64*)prxcache->iv[tid]);
|
||||
curr_pn = CCMPH_2_PN(tmp_iv_hdr);
|
||||
if (pattrib->encrypt == _TKIP_ || pattrib->encrypt == _AES_ ||
|
||||
pattrib->encrypt == _GCMP_ || pattrib->encrypt == _CCMP_256_ ||
|
||||
pattrib->encrypt == _GCMP_256_) {
|
||||
rtw_iv_to_pn((pdata + pattrib->hdrlen), pn, NULL, pattrib->encrypt);
|
||||
pkt_pn = RTW_GET_LE64(pn);
|
||||
|
||||
rtw_iv_to_pn(prxcache->iv[tid], pn, NULL, pattrib->encrypt);
|
||||
curr_pn = RTW_GET_LE64(pn);
|
||||
|
||||
if (!VALID_PN_CHK(pkt_pn, curr_pn)) {
|
||||
/* return _FAIL; */
|
||||
@@ -855,23 +864,21 @@ sint recv_bcast_pn_decache(union recv_frame *precv_frame);
|
||||
sint recv_bcast_pn_decache(union recv_frame *precv_frame)
|
||||
{
|
||||
_adapter *padapter = precv_frame->u.hdr.adapter;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
u8 *pdata = precv_frame->u.hdr.rx_data;
|
||||
u64 tmp_iv_hdr = 0;
|
||||
u64 curr_pn = 0, pkt_pn = 0;
|
||||
u8 pn[8] = {0};
|
||||
u8 key_id;
|
||||
|
||||
if ((pattrib->encrypt == _AES_) &&
|
||||
(check_fwstate(pmlmepriv, WIFI_STATION_STATE) == _TRUE)) {
|
||||
|
||||
tmp_iv_hdr = le64_to_cpu(*(u64*)(pdata + pattrib->hdrlen));
|
||||
key_id = CCMPH_2_KEYID(tmp_iv_hdr);
|
||||
pkt_pn = CCMPH_2_PN(tmp_iv_hdr);
|
||||
|
||||
if ((pattrib->encrypt == _TKIP_ || pattrib->encrypt == _AES_ ||
|
||||
pattrib->encrypt == _GCMP_ || pattrib->encrypt == _CCMP_256_ ||
|
||||
pattrib->encrypt == _GCMP_256_) &&
|
||||
(MLME_IS_STA(padapter))) {
|
||||
rtw_iv_to_pn((pdata + pattrib->hdrlen), pn, &key_id,
|
||||
pattrib->encrypt);
|
||||
pkt_pn = RTW_GET_LE64(pn);
|
||||
curr_pn = le64_to_cpu(*(u64*)psecuritypriv->iv_seq[key_id]);
|
||||
curr_pn &= 0x0000ffffffffffff;
|
||||
|
||||
if (!VALID_PN_CHK(pkt_pn, curr_pn))
|
||||
return _FAIL;
|
||||
@@ -1837,7 +1844,7 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
struct sta_info *psta = precv_frame->u.hdr.psta;
|
||||
u8 *ptr;
|
||||
u8 type;
|
||||
/*u8 type;*/
|
||||
u8 subtype;
|
||||
u8 is_bmc;
|
||||
u8 category = 0xFF;
|
||||
@@ -1864,7 +1871,7 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra
|
||||
return _SUCCESS;
|
||||
|
||||
ptr = precv_frame->u.hdr.rx_data;
|
||||
type = GetFrameType(ptr);
|
||||
/*type = GetFrameType(ptr);*/
|
||||
subtype = get_frame_sub_type(ptr); /* bit(7)~bit(2) */
|
||||
is_bmc = IS_MCAST(GetAddr1Ptr(ptr));
|
||||
|
||||
@@ -1926,7 +1933,11 @@ static sint validate_mgmt_protect(_adapter *adapter, union recv_frame *precv_fra
|
||||
/* unicast cases */
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC) {
|
||||
if (!MLME_IS_MESH(adapter)) {
|
||||
if (!MLME_IS_MESH(adapter)
|
||||
#ifdef CONFIG_RTW_WNM
|
||||
&& (rtw_wnm_try_btm_roam_imnt(adapter) > 0)
|
||||
#endif
|
||||
) {
|
||||
unsigned short reason = le16_to_cpu(*(unsigned short *)(ptr + WLAN_HDR_A3_LEN));
|
||||
|
||||
#if DBG_VALIDATE_MGMT_PROTECT
|
||||
@@ -2069,7 +2080,6 @@ exit:
|
||||
|
||||
fail:
|
||||
return _FAIL;
|
||||
|
||||
}
|
||||
#endif /* defined(CONFIG_IEEE80211W) || defined(CONFIG_RTW_MESH) */
|
||||
|
||||
@@ -2121,14 +2131,15 @@ exit:
|
||||
|
||||
sint validate_recv_data_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
{
|
||||
u8 bretry, a4_shift;
|
||||
/*u8 bretry;*/
|
||||
u8 a4_shift;
|
||||
struct sta_info *psta = NULL;
|
||||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
sint ret = _SUCCESS;
|
||||
|
||||
bretry = GetRetry(ptr);
|
||||
/*bretry = GetRetry(ptr);*/
|
||||
a4_shift = (pattrib->to_fr_ds == 3) ? ETH_ALEN : 0;
|
||||
|
||||
/* some address fields are different when using AMSDU */
|
||||
@@ -2394,7 +2405,7 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
u8 *ptr = precv_frame->u.hdr.rx_data;
|
||||
u8 ver = (unsigned char)(*ptr) & 0x3 ;
|
||||
#ifdef CONFIG_FIND_BEST_CHANNEL
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
struct rtw_chset *chset = adapter_to_chset(adapter);
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
#endif
|
||||
|
||||
@@ -2412,9 +2423,9 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
|
||||
#ifdef CONFIG_FIND_BEST_CHANNEL
|
||||
if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) {
|
||||
int ch_set_idx = rtw_chset_search_ch(rfctl->channel_set, rtw_get_oper_ch(adapter));
|
||||
int ch_set_idx = rtw_chset_search_ch(chset, rtw_get_oper_ch(adapter));
|
||||
if (ch_set_idx >= 0)
|
||||
rfctl->channel_set[ch_set_idx].rx_count++;
|
||||
chset->chs[ch_set_idx].rx_count++;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2504,7 +2515,8 @@ sint validate_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
phdr->bIsWaiPacket = wai_pkt;
|
||||
|
||||
if (wai_pkt != 0) {
|
||||
if (sc != adapter->wapiInfo.wapiSeqnumAndFragNum)
|
||||
if ((sc != adapter->wapiInfo.wapiSeqnumAndFragNum)||
|
||||
(sc == 0))
|
||||
adapter->wapiInfo.wapiSeqnumAndFragNum = sc;
|
||||
else {
|
||||
retval = _FAIL;
|
||||
@@ -2686,7 +2698,7 @@ union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q);
|
||||
union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q)
|
||||
{
|
||||
_list *plist, *phead;
|
||||
u8 *data, wlanhdr_offset;
|
||||
u8 wlanhdr_offset;
|
||||
u8 curfragnum;
|
||||
struct recv_frame_hdr *pfhdr, *pnfhdr;
|
||||
union recv_frame *prframe, *pnextrframe;
|
||||
@@ -2735,8 +2747,6 @@ union recv_frame *recvframe_defrag(_adapter *adapter, _queue *defrag_q)
|
||||
|
||||
plist = get_next(plist);
|
||||
|
||||
data = get_recvframe_data(prframe);
|
||||
|
||||
while (rtw_end_of_queue_search(phead, plist) == _FALSE) {
|
||||
pnextrframe = LIST_CONTAINOR(plist, union recv_frame , u);
|
||||
pnfhdr = &pnextrframe->u.hdr;
|
||||
@@ -2973,7 +2983,7 @@ static int rtw_recv_indicatepkt_check(union recv_frame *rframe, u8 *ehdr_pos, u3
|
||||
#endif
|
||||
|
||||
if (recvpriv->sink_udpport > 0)
|
||||
rtw_sink_rtp_seq_dbg(adapter, ehdr_pos);
|
||||
rtw_sink_rtp_seq_dbg(adapter, ehdr_pos, rframe->u.hdr.attrib.seq_num);
|
||||
|
||||
#ifdef DBG_UDP_PKT_LOSE_11AC
|
||||
#define PAYLOAD_LEN_LOC_OF_IP_HDR 0x10 /*ethernet payload length location of ip header (DA + SA+eth_type+(version&hdr_len)) */
|
||||
@@ -3898,11 +3908,11 @@ int validate_mp_recv_frame(_adapter *adapter, union recv_frame *precv_frame)
|
||||
for (i = 0; i < precv_frame->u.hdr.len; i = i + 8)
|
||||
RTW_INFO("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:\n", *(ptr + i),
|
||||
*(ptr + i + 1), *(ptr + i + 2) , *(ptr + i + 3) , *(ptr + i + 4), *(ptr + i + 5), *(ptr + i + 6), *(ptr + i + 7));
|
||||
RTW_INFO("#############################\n");
|
||||
_rtw_memset(pmppriv->mplink_buf, '\0' , sizeof(pmppriv->mplink_buf));
|
||||
_rtw_memcpy(pmppriv->mplink_buf, ptr, precv_frame->u.hdr.len);
|
||||
pmppriv->mplink_rx_len = precv_frame->u.hdr.len;
|
||||
pmppriv->mplink_brx =_TRUE;
|
||||
RTW_INFO("#############################\n");
|
||||
_rtw_memset(pmppriv->mplink_buf, '\0' , sizeof(pmppriv->mplink_buf));
|
||||
_rtw_memcpy(pmppriv->mplink_buf, ptr, precv_frame->u.hdr.len);
|
||||
pmppriv->mplink_rx_len = precv_frame->u.hdr.len;
|
||||
pmppriv->mplink_brx =_TRUE;
|
||||
}
|
||||
}
|
||||
if (pmppriv->bloopback) {
|
||||
@@ -4441,7 +4451,9 @@ static void rtw_signal_stat_timer_hdl(void *ctx)
|
||||
u8 avg_signal_strength = 0;
|
||||
u8 avg_signal_qual = 0;
|
||||
u32 num_signal_strength = 0;
|
||||
#ifdef DBG_RX_SIGNAL_DISPLAY_PROCESSING
|
||||
u32 num_signal_qual = 0;
|
||||
#endif
|
||||
u8 ratio_pre_stat = 0, ratio_curr_stat = 0, ratio_total = 0, ratio_profile = SIGNAL_STAT_CALC_PROFILE_0;
|
||||
|
||||
if (adapter->recvpriv.is_signal_dbg) {
|
||||
@@ -4459,7 +4471,9 @@ static void rtw_signal_stat_timer_hdl(void *ctx)
|
||||
|
||||
if (recvpriv->signal_qual_data.update_req == 0) { /* update_req is clear, means we got rx */
|
||||
avg_signal_qual = recvpriv->signal_qual_data.avg_val;
|
||||
#ifdef DBG_RX_SIGNAL_DISPLAY_PROCESSING
|
||||
num_signal_qual = recvpriv->signal_qual_data.total_num;
|
||||
#endif
|
||||
/* after avg_vals are accquired, we can re-stat the signal values */
|
||||
recvpriv->signal_qual_data.update_req = 1;
|
||||
}
|
||||
@@ -4940,6 +4954,7 @@ thread_return rtw_recv_thread(thread_context context)
|
||||
err = _rtw_down_sema(&recvpriv->recv_sema);
|
||||
if (_FAIL == err) {
|
||||
RTW_ERR(FUNC_ADPT_FMT" down recv_sema fail!\n", FUNC_ADPT_ARG(adapter));
|
||||
flush_signals_thread();
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
931
drivers/net/wireless/rtl8822cs/core/rtw_regdb_rtk.c
Normal file
931
drivers/net/wireless/rtl8822cs/core/rtw_regdb_rtk.c
Normal file
@@ -0,0 +1,931 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define _RTW_REGDB_RTK_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
#define RTW_DOMAIN_MAP_VER "64"
|
||||
#define RTW_DOMAIN_MAP_M_VER ""
|
||||
#define RTW_COUNTRY_MAP_VER "42"
|
||||
#define RTW_COUNTRY_MAP_M_VER ""
|
||||
|
||||
#define rtw_is_5g_band1(ch) ((ch) >= 36 && (ch) <= 48)
|
||||
#define rtw_is_5g_band2(ch) ((ch) >= 52 && (ch) <= 64)
|
||||
#define rtw_is_5g_band3(ch) ((ch) >= 100 && (ch) <= 144)
|
||||
#define rtw_is_5g_band4(ch) ((ch) >= 149 && (ch) <= 177)
|
||||
|
||||
#define rtw_is_6g_band1(ch) ((ch) >= 1 && (ch) <= 93)
|
||||
#define rtw_is_6g_band2(ch) ((ch) >= 97 && (ch) <= 117)
|
||||
#define rtw_is_6g_band3(ch) ((ch) >= 121 && (ch) <= 189)
|
||||
#define rtw_is_6g_band4(ch) ((ch) >= 193 && (ch) <= 237)
|
||||
|
||||
struct ch_list_t {
|
||||
u8 *len_ch_attr;
|
||||
};
|
||||
|
||||
#define CLA_2G_12_14_PASSIVE BIT0
|
||||
|
||||
#define CLA_5G_B1_PASSIVE BIT0
|
||||
#define CLA_5G_B2_PASSIVE BIT1
|
||||
#define CLA_5G_B3_PASSIVE BIT2
|
||||
#define CLA_5G_B4_PASSIVE BIT3
|
||||
#define CLA_5G_B2_DFS BIT4
|
||||
#define CLA_5G_B3_DFS BIT5
|
||||
#define CLA_5G_B4_DFS BIT6
|
||||
|
||||
#define CLA_6G_B1_PASSIVE BIT0
|
||||
#define CLA_6G_B2_PASSIVE BIT1
|
||||
#define CLA_6G_B3_PASSIVE BIT2
|
||||
#define CLA_6G_B4_PASSIVE BIT3
|
||||
|
||||
#define CH_LIST_ENT(_len, arg...) \
|
||||
{.len_ch_attr = (u8[_len + 2]) {_len, ##arg}, }
|
||||
|
||||
#define CH_LIST_LEN(_ch_list) (_ch_list.len_ch_attr[0])
|
||||
#define CH_LIST_CH(_ch_list, _i) (_ch_list.len_ch_attr[_i + 1])
|
||||
#define CH_LIST_ATTRIB(_ch_list) (_ch_list.len_ch_attr[CH_LIST_LEN(_ch_list) + 1])
|
||||
|
||||
enum rtw_chd_2g {
|
||||
RTW_CHD_2G_INVALID = 0,
|
||||
|
||||
RTW_CHD_2G_00,
|
||||
RTW_CHD_2G_01,
|
||||
RTW_CHD_2G_02,
|
||||
RTW_CHD_2G_03,
|
||||
RTW_CHD_2G_04,
|
||||
RTW_CHD_2G_05,
|
||||
RTW_CHD_2G_06,
|
||||
|
||||
RTW_CHD_2G_MAX,
|
||||
RTW_CHD_2G_NULL = RTW_CHD_2G_00,
|
||||
};
|
||||
|
||||
enum rtw_chd_5g {
|
||||
RTW_CHD_5G_INVALID = 0,
|
||||
|
||||
RTW_CHD_5G_00,
|
||||
RTW_CHD_5G_01,
|
||||
RTW_CHD_5G_02,
|
||||
RTW_CHD_5G_03,
|
||||
RTW_CHD_5G_04,
|
||||
RTW_CHD_5G_05,
|
||||
RTW_CHD_5G_06,
|
||||
RTW_CHD_5G_07,
|
||||
RTW_CHD_5G_08,
|
||||
RTW_CHD_5G_09,
|
||||
RTW_CHD_5G_10,
|
||||
RTW_CHD_5G_11,
|
||||
RTW_CHD_5G_12,
|
||||
RTW_CHD_5G_13,
|
||||
RTW_CHD_5G_14,
|
||||
RTW_CHD_5G_15,
|
||||
RTW_CHD_5G_16,
|
||||
RTW_CHD_5G_17,
|
||||
RTW_CHD_5G_18,
|
||||
RTW_CHD_5G_19,
|
||||
RTW_CHD_5G_20,
|
||||
RTW_CHD_5G_21,
|
||||
RTW_CHD_5G_22,
|
||||
RTW_CHD_5G_23,
|
||||
RTW_CHD_5G_24,
|
||||
RTW_CHD_5G_25,
|
||||
RTW_CHD_5G_26,
|
||||
RTW_CHD_5G_27,
|
||||
RTW_CHD_5G_28,
|
||||
RTW_CHD_5G_29,
|
||||
RTW_CHD_5G_30,
|
||||
RTW_CHD_5G_31,
|
||||
RTW_CHD_5G_32,
|
||||
RTW_CHD_5G_33,
|
||||
RTW_CHD_5G_34,
|
||||
RTW_CHD_5G_35,
|
||||
RTW_CHD_5G_36,
|
||||
RTW_CHD_5G_37,
|
||||
RTW_CHD_5G_38,
|
||||
RTW_CHD_5G_39,
|
||||
RTW_CHD_5G_40,
|
||||
RTW_CHD_5G_41,
|
||||
RTW_CHD_5G_42,
|
||||
RTW_CHD_5G_43,
|
||||
RTW_CHD_5G_44,
|
||||
RTW_CHD_5G_45,
|
||||
RTW_CHD_5G_46,
|
||||
RTW_CHD_5G_47,
|
||||
RTW_CHD_5G_48,
|
||||
RTW_CHD_5G_49,
|
||||
RTW_CHD_5G_50,
|
||||
RTW_CHD_5G_51,
|
||||
RTW_CHD_5G_52,
|
||||
RTW_CHD_5G_53,
|
||||
RTW_CHD_5G_54,
|
||||
RTW_CHD_5G_55,
|
||||
RTW_CHD_5G_57,
|
||||
RTW_CHD_5G_58,
|
||||
|
||||
RTW_CHD_5G_MAX,
|
||||
RTW_CHD_5G_NULL = RTW_CHD_5G_00,
|
||||
};
|
||||
|
||||
static const struct ch_list_t rtw_channel_def_2g[] = {
|
||||
/* RTW_CHD_2G_INVALID */ CH_LIST_ENT(0, 0),
|
||||
/* RTW_CHD_2G_00 */ CH_LIST_ENT(0, 0),
|
||||
/* RTW_CHD_2G_01 */ CH_LIST_ENT(13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, CLA_2G_12_14_PASSIVE),
|
||||
/* RTW_CHD_2G_02 */ CH_LIST_ENT(13, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 0),
|
||||
/* RTW_CHD_2G_03 */ CH_LIST_ENT(11, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0),
|
||||
/* RTW_CHD_2G_04 */ CH_LIST_ENT(14, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0),
|
||||
/* RTW_CHD_2G_05 */ CH_LIST_ENT(4, 10, 11, 12, 13, 0),
|
||||
/* RTW_CHD_2G_06 */ CH_LIST_ENT(14, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, CLA_2G_12_14_PASSIVE),
|
||||
};
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
static const struct ch_list_t rtw_channel_def_5g[] = {
|
||||
/* RTW_CHD_5G_INVALID */ CH_LIST_ENT(0, 0),
|
||||
/* RTW_CHD_5G_00 */ CH_LIST_ENT(0, 0),
|
||||
/* RTW_CHD_5G_01 */ CH_LIST_ENT(21, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_02 */ CH_LIST_ENT(19, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_03 */ CH_LIST_ENT(24, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_04 */ CH_LIST_ENT(22, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_05 */ CH_LIST_ENT(19, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 149, 153, 157, 161, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_06 */ CH_LIST_ENT(9, 36, 40, 44, 48, 149, 153, 157, 161, 165, 0),
|
||||
/* RTW_CHD_5G_07 */ CH_LIST_ENT(13, 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165, CLA_5G_B2_DFS),
|
||||
/* RTW_CHD_5G_08 */ CH_LIST_ENT(12, 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, CLA_5G_B2_DFS),
|
||||
/* RTW_CHD_5G_09 */ CH_LIST_ENT(5, 149, 153, 157, 161, 165, 0),
|
||||
/* RTW_CHD_5G_10 */ CH_LIST_ENT(8, 36, 40, 44, 48, 52, 56, 60, 64, CLA_5G_B2_DFS),
|
||||
/* RTW_CHD_5G_11 */ CH_LIST_ENT(11, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_12 */ CH_LIST_ENT(16, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_13 */ CH_LIST_ENT(8, 56, 60, 64, 149, 153, 157, 161, 165, CLA_5G_B2_DFS),
|
||||
/* RTW_CHD_5G_14 */ CH_LIST_ENT(4, 36, 40, 44, 48, 0),
|
||||
/* RTW_CHD_5G_15 */ CH_LIST_ENT(4, 149, 153, 157, 161, 0),
|
||||
/* RTW_CHD_5G_16 */ CH_LIST_ENT(11, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 0),
|
||||
/* RTW_CHD_5G_17 */ CH_LIST_ENT(16, 36, 40, 44, 48, 52, 56, 60, 64, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_18 */ CH_LIST_ENT(17, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_19 */ CH_LIST_ENT(16, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_20 */ CH_LIST_ENT(20, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_21 */ CH_LIST_ENT(11, 36, 40, 44, 48, 52, 56, 60, 64, 132, 136, 140, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_22 */ CH_LIST_ENT(25, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_23 */ CH_LIST_ENT(21, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_24 */ CH_LIST_ENT(24, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B2_PASSIVE | CLA_5G_B3_PASSIVE | CLA_5G_B4_PASSIVE),
|
||||
/* RTW_CHD_5G_25 */ CH_LIST_ENT(24, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B2_PASSIVE | CLA_5G_B3_PASSIVE),
|
||||
/* RTW_CHD_5G_26 */ CH_LIST_ENT(24, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_PASSIVE | CLA_5G_B3_PASSIVE),
|
||||
/* RTW_CHD_5G_27 */ CH_LIST_ENT(21, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B2_PASSIVE | CLA_5G_B3_PASSIVE),
|
||||
/* RTW_CHD_5G_28 */ CH_LIST_ENT(13, 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165, CLA_5G_B2_PASSIVE),
|
||||
/* RTW_CHD_5G_29 */ CH_LIST_ENT(13, 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_PASSIVE),
|
||||
/* RTW_CHD_5G_30 */ CH_LIST_ENT(9, 36, 40, 44, 48, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B4_PASSIVE),
|
||||
/* RTW_CHD_5G_31 */ CH_LIST_ENT(24, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_PASSIVE | CLA_5G_B3_PASSIVE | CLA_5G_B4_PASSIVE),
|
||||
/* RTW_CHD_5G_32 */ CH_LIST_ENT(9, 52, 56, 60, 64, 149, 153, 157, 161, 165, CLA_5G_B2_DFS),
|
||||
/* RTW_CHD_5G_33 */ CH_LIST_ENT(22, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 144, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_34 */ CH_LIST_ENT(13, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_35 */ CH_LIST_ENT(8, 100, 104, 108, 112, 116, 132, 136, 140, CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_36 */ CH_LIST_ENT(25, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_PASSIVE | CLA_5G_B2_DFS | CLA_5G_B3_PASSIVE | CLA_5G_B3_DFS | CLA_5G_B4_PASSIVE),
|
||||
/* RTW_CHD_5G_37 */ CH_LIST_ENT(8, 36, 40, 44, 48, 52, 56, 60, 64, CLA_5G_B1_PASSIVE | CLA_5G_B2_PASSIVE),
|
||||
/* RTW_CHD_5G_38 */ CH_LIST_ENT(16, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_39 */ CH_LIST_ENT(21, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_DFS | CLA_5G_B3_DFS | CLA_5G_B4_DFS),
|
||||
/* RTW_CHD_5G_40 */ CH_LIST_ENT(21, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_41 */ CH_LIST_ENT(24, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS | CLA_5G_B4_PASSIVE),
|
||||
/* RTW_CHD_5G_42 */ CH_LIST_ENT(24, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_DFS | CLA_5G_B3_DFS | CLA_5G_B4_PASSIVE),
|
||||
/* RTW_CHD_5G_43 */ CH_LIST_ENT(23, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_PASSIVE | CLA_5G_B3_PASSIVE | CLA_5G_B4_PASSIVE),
|
||||
/* RTW_CHD_5G_44 */ CH_LIST_ENT(21, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_PASSIVE | CLA_5G_B3_PASSIVE | CLA_5G_B4_PASSIVE),
|
||||
/* RTW_CHD_5G_45 */ CH_LIST_ENT(13, 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_PASSIVE | CLA_5G_B4_PASSIVE),
|
||||
/* RTW_CHD_5G_46 */ CH_LIST_ENT(12, 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, CLA_5G_B2_PASSIVE),
|
||||
/* RTW_CHD_5G_47 */ CH_LIST_ENT(19, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, CLA_5G_B2_PASSIVE | CLA_5G_B3_PASSIVE),
|
||||
/* RTW_CHD_5G_48 */ CH_LIST_ENT(20, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_49 */ CH_LIST_ENT(17, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_50 */ CH_LIST_ENT(17, 36, 40, 44, 48, 52, 56, 60, 64, 132, 136, 140, 144, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_51 */ CH_LIST_ENT(13, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_52 */ CH_LIST_ENT(28, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165, 169, 173, 177, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_53 */ CH_LIST_ENT(17, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 149, 153, 157, 161, 165, CLA_5G_B2_DFS | CLA_5G_B3_DFS),
|
||||
/* RTW_CHD_5G_54 */ CH_LIST_ENT(8, 36, 40, 44, 48, 149, 153, 157, 161, 0),
|
||||
/* RTW_CHD_5G_55 */ CH_LIST_ENT(28, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165, 169, 173, 177, CLA_5G_B1_PASSIVE | CLA_5G_B2_PASSIVE | CLA_5G_B2_DFS | CLA_5G_B3_PASSIVE | CLA_5G_B3_DFS | CLA_5G_B4_PASSIVE),
|
||||
/* RTW_CHD_5G_57 */ CH_LIST_ENT(25, 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_PASSIVE | CLA_5G_B3_PASSIVE | CLA_5G_B4_PASSIVE),
|
||||
/* RTW_CHD_5G_58 */ CH_LIST_ENT(16, 36, 40, 44, 48, 52, 56, 60, 64, 132, 136, 140, 149, 153, 157, 161, 165, CLA_5G_B1_PASSIVE | CLA_5G_B2_PASSIVE | CLA_5G_B3_PASSIVE | CLA_5G_B4_PASSIVE),
|
||||
};
|
||||
#endif /* CONFIG_IEEE80211_BAND_5GHZ */
|
||||
|
||||
struct chplan_ent_t {
|
||||
u8 regd_2g; /* value of enum rtw_regd */
|
||||
u8 chd_2g;
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
u8 regd_5g; /* value of enum rtw_regd */
|
||||
u8 chd_5g;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
#define CHPLAN_ENT(_regd_2g, _chd_2g, _regd_5g, _chd_5g) {.regd_2g = RTW_REGD_##_regd_2g, .chd_2g = RTW_CHD_2G_##_chd_2g, .regd_5g = RTW_REGD_##_regd_5g, .chd_5g = RTW_CHD_5G_##_chd_5g}
|
||||
#else
|
||||
#define CHPLAN_ENT(_regd_2g, _chd_2g, _regd_5g, _chd_5g) {.regd_2g = RTW_REGD_##_regd_2g, .chd_2g = RTW_CHD_2G_##_chd_2g}
|
||||
#endif
|
||||
|
||||
#define CHPLAN_ENT_NOT_DEFINED CHPLAN_ENT(NA, INVALID, NA, INVALID)
|
||||
|
||||
static const struct chplan_ent_t RTW_ChannelPlanMap[] = {
|
||||
[0x00] = CHPLAN_ENT(ETSI , 02, ETSI , 49),
|
||||
[0x01] = CHPLAN_ENT(ETSI , 02, ETSI , 50),
|
||||
[0x02] = CHPLAN_ENT(ETSI , 03, ETSI , 07),
|
||||
[0x03] = CHPLAN_ENT(ACMA , 02, ACMA , 33),
|
||||
[0x04] = CHPLAN_ENT(ETSI , 02, ETSI , 51),
|
||||
[0x05] = CHPLAN_ENT(ETSI , 02, ETSI , 06),
|
||||
[0x06] = CHPLAN_ENT(ETSI , 02, ETSI , 07),
|
||||
[0x07] = CHPLAN_ENT(ETSI , 02, ETSI , 23),
|
||||
[0x08] = CHPLAN_ENT(ETSI , 02, ETSI , 21),
|
||||
[0x09] = CHPLAN_ENT(ETSI , 02, ETSI , 17),
|
||||
[0x0A] = CHPLAN_ENT(NA , 00, NA , 00),
|
||||
[0x0B] = CHPLAN_ENT(ETSI , 02, ETSI , 22),
|
||||
[0x0C] = CHPLAN_ENT(FCC , 03, FCC , 54),
|
||||
[0x0D] = CHPLAN_ENT(MKK , 04, MKK , 14),
|
||||
[0x0E] = CHPLAN_ENT(ETSI , 01, ETSI , 57),
|
||||
[0x0F] = CHPLAN_ENT(ETSI , 01, ETSI , 58),
|
||||
[0x1B] = CHPLAN_ENT(FCC , 02, FCC , 52),
|
||||
[0x1C] = CHPLAN_ENT(KCC , 02, KCC , 53),
|
||||
[0x20] = CHPLAN_ENT(WW , 01, NA , 00),
|
||||
[0x21] = CHPLAN_ENT(ETSI , 02, NA , 00),
|
||||
[0x22] = CHPLAN_ENT(FCC , 03, NA , 00),
|
||||
[0x23] = CHPLAN_ENT(MKK , 04, NA , 00),
|
||||
[0x24] = CHPLAN_ENT(ETSI , 05, NA , 00),
|
||||
[0x25] = CHPLAN_ENT(FCC , 03, FCC , 03),
|
||||
[0x26] = CHPLAN_ENT(ETSI , 01, ETSI , 02),
|
||||
[0x27] = CHPLAN_ENT(MKK , 04, MKK , 02),
|
||||
[0x28] = CHPLAN_ENT(KCC , 01, KCC , 05),
|
||||
[0x29] = CHPLAN_ENT(FCC , 01, FCC , 06),
|
||||
[0x2A] = CHPLAN_ENT(FCC , 02, NA , 00),
|
||||
[0x2B] = CHPLAN_ENT(IC , 02, IC , 33),
|
||||
[0x2C] = CHPLAN_ENT(MKK , 02, NA , 00),
|
||||
[0x2D] = CHPLAN_ENT(CHILE, 01, CHILE, 22),
|
||||
[0x2E] = CHPLAN_ENT(WW , 03, WW , 37),
|
||||
[0x2F] = CHPLAN_ENT(CHILE, 01, CHILE, 38),
|
||||
[0x30] = CHPLAN_ENT(FCC , 01, FCC , 07),
|
||||
[0x31] = CHPLAN_ENT(FCC , 01, FCC , 08),
|
||||
[0x32] = CHPLAN_ENT(FCC , 01, FCC , 09),
|
||||
[0x33] = CHPLAN_ENT(FCC , 01, FCC , 10),
|
||||
[0x34] = CHPLAN_ENT(FCC , 03, FCC , 01),
|
||||
[0x35] = CHPLAN_ENT(ETSI , 01, ETSI , 03),
|
||||
[0x36] = CHPLAN_ENT(ETSI , 01, ETSI , 04),
|
||||
[0x37] = CHPLAN_ENT(MKK , 04, MKK , 10),
|
||||
[0x38] = CHPLAN_ENT(MKK , 04, MKK , 11),
|
||||
[0x39] = CHPLAN_ENT(NCC , 03, NCC , 12),
|
||||
[0x3A] = CHPLAN_ENT(ETSI , 02, ETSI , 02),
|
||||
[0x3B] = CHPLAN_ENT(ACMA , 02, ACMA , 01),
|
||||
[0x3C] = CHPLAN_ENT(ETSI , 02, ETSI , 10),
|
||||
[0x3D] = CHPLAN_ENT(ETSI , 02, ETSI , 15),
|
||||
[0x3E] = CHPLAN_ENT(KCC , 02, KCC , 03),
|
||||
[0x3F] = CHPLAN_ENT(FCC , 03, FCC , 22),
|
||||
[0x40] = CHPLAN_ENT(NCC , 03, NCC , 13),
|
||||
[0x41] = CHPLAN_ENT(WW , 06, NA , 00),
|
||||
[0x42] = CHPLAN_ENT(ETSI , 02, ETSI , 14),
|
||||
[0x43] = CHPLAN_ENT(FCC , 03, FCC , 06),
|
||||
[0x44] = CHPLAN_ENT(NCC , 03, NCC , 09),
|
||||
[0x45] = CHPLAN_ENT(ACMA , 01, ACMA , 01),
|
||||
[0x46] = CHPLAN_ENT(FCC , 03, FCC , 15),
|
||||
[0x47] = CHPLAN_ENT(ETSI , 01, ETSI , 10),
|
||||
[0x48] = CHPLAN_ENT(ETSI , 01, ETSI , 07),
|
||||
[0x49] = CHPLAN_ENT(ETSI , 01, ETSI , 06),
|
||||
[0x4A] = CHPLAN_ENT(IC , 03, IC , 33),
|
||||
[0x4B] = CHPLAN_ENT(KCC , 02, KCC , 22),
|
||||
[0x4C] = CHPLAN_ENT(FCC , 03, FCC , 28),
|
||||
[0x4D] = CHPLAN_ENT(MEX , 02, MEX , 01),
|
||||
[0x4E] = CHPLAN_ENT(ETSI , 02, ETSI , 42),
|
||||
[0x4F] = CHPLAN_ENT(NA , 00, MKK , 43),
|
||||
[0x50] = CHPLAN_ENT(ETSI , 01, ETSI , 16),
|
||||
[0x51] = CHPLAN_ENT(ETSI , 01, ETSI , 09),
|
||||
[0x52] = CHPLAN_ENT(ETSI , 01, ETSI , 17),
|
||||
[0x53] = CHPLAN_ENT(NCC , 03, NCC , 18),
|
||||
[0x54] = CHPLAN_ENT(ETSI , 01, ETSI , 15),
|
||||
[0x55] = CHPLAN_ENT(FCC , 03, FCC , 01),
|
||||
[0x56] = CHPLAN_ENT(ETSI , 01, ETSI , 19),
|
||||
[0x57] = CHPLAN_ENT(FCC , 03, FCC , 20),
|
||||
[0x58] = CHPLAN_ENT(MKK , 02, MKK , 14),
|
||||
[0x59] = CHPLAN_ENT(ETSI , 01, ETSI , 21),
|
||||
[0x5A] = CHPLAN_ENT(NA , 00, FCC , 44),
|
||||
[0x5B] = CHPLAN_ENT(NA , 00, FCC , 45),
|
||||
[0x5C] = CHPLAN_ENT(NA , 00, FCC , 43),
|
||||
[0x5D] = CHPLAN_ENT(ETSI , 02, ETSI , 08),
|
||||
[0x5E] = CHPLAN_ENT(ETSI , 02, ETSI , 03),
|
||||
[0x5F] = CHPLAN_ENT(MKK , 02, MKK , 47),
|
||||
[0x60] = CHPLAN_ENT(FCC , 03, FCC , 09),
|
||||
[0x61] = CHPLAN_ENT(FCC , 02, FCC , 01),
|
||||
[0x62] = CHPLAN_ENT(FCC , 02, FCC , 03),
|
||||
[0x63] = CHPLAN_ENT(ETSI , 01, ETSI , 23),
|
||||
[0x64] = CHPLAN_ENT(MKK , 02, MKK , 24),
|
||||
[0x65] = CHPLAN_ENT(ETSI , 02, ETSI , 24),
|
||||
[0x66] = CHPLAN_ENT(FCC , 03, FCC , 27),
|
||||
[0x67] = CHPLAN_ENT(FCC , 03, FCC , 25),
|
||||
[0x68] = CHPLAN_ENT(FCC , 02, FCC , 27),
|
||||
[0x69] = CHPLAN_ENT(FCC , 02, FCC , 25),
|
||||
[0x6A] = CHPLAN_ENT(ETSI , 02, ETSI , 25),
|
||||
[0x6B] = CHPLAN_ENT(FCC , 01, FCC , 29),
|
||||
[0x6C] = CHPLAN_ENT(FCC , 01, FCC , 26),
|
||||
[0x6D] = CHPLAN_ENT(FCC , 02, FCC , 28),
|
||||
[0x6E] = CHPLAN_ENT(FCC , 01, FCC , 25),
|
||||
[0x6F] = CHPLAN_ENT(NA , 00, ETSI , 06),
|
||||
[0x70] = CHPLAN_ENT(NA , 00, ETSI , 30),
|
||||
[0x71] = CHPLAN_ENT(NA , 00, ETSI , 25),
|
||||
[0x72] = CHPLAN_ENT(NA , 00, ETSI , 31),
|
||||
[0x73] = CHPLAN_ENT(FCC , 01, FCC , 01),
|
||||
[0x74] = CHPLAN_ENT(FCC , 02, FCC , 19),
|
||||
[0x75] = CHPLAN_ENT(ETSI , 01, ETSI , 32),
|
||||
[0x76] = CHPLAN_ENT(FCC , 02, FCC , 22),
|
||||
[0x77] = CHPLAN_ENT(ETSI , 01, ETSI , 34),
|
||||
[0x78] = CHPLAN_ENT(FCC , 03, FCC , 35),
|
||||
[0x79] = CHPLAN_ENT(MKK , 02, MKK , 02),
|
||||
[0x7A] = CHPLAN_ENT(ETSI , 02, ETSI , 28),
|
||||
[0x7B] = CHPLAN_ENT(ETSI , 02, ETSI , 46),
|
||||
[0x7C] = CHPLAN_ENT(ETSI , 02, ETSI , 47),
|
||||
[0x7D] = CHPLAN_ENT(MKK , 04, MKK , 48),
|
||||
[0x7E] = CHPLAN_ENT(MKK , 02, MKK , 48),
|
||||
[0x7F] = CHPLAN_ENT(WW , 01, WW , 55),
|
||||
};
|
||||
|
||||
static const int RTW_ChannelPlanMap_size = sizeof(RTW_ChannelPlanMap) / sizeof(RTW_ChannelPlanMap[0]);
|
||||
|
||||
static u8 rtk_regdb_get_default_regd_2g(u8 id)
|
||||
{
|
||||
if (id < RTW_ChannelPlanMap_size)
|
||||
return RTW_ChannelPlanMap[id].regd_2g;
|
||||
return RTW_REGD_NA;
|
||||
}
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
static u8 rtk_regdb_get_default_regd_5g(u8 id)
|
||||
{
|
||||
if (id < RTW_ChannelPlanMap_size)
|
||||
return RTW_ChannelPlanMap[id].regd_5g;
|
||||
return RTW_REGD_NA;
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool rtk_regdb_is_domain_code_valid(u8 id)
|
||||
{
|
||||
if (id < RTW_ChannelPlanMap_size) {
|
||||
const struct chplan_ent_t *chplan_map = &RTW_ChannelPlanMap[id];
|
||||
|
||||
if (chplan_map->chd_2g != RTW_CHD_2G_INVALID
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
&& chplan_map->chd_5g != RTW_CHD_5G_INVALID
|
||||
#endif
|
||||
)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool rtk_regdb_domain_get_ch(u8 id, u32 ch, u8 *flags)
|
||||
{
|
||||
u8 index, attrib;
|
||||
|
||||
if (flags)
|
||||
*flags = 0;
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
if (ch > 14) {
|
||||
u8 chd_5g = RTW_ChannelPlanMap[id].chd_5g;
|
||||
|
||||
attrib = CH_LIST_ATTRIB(rtw_channel_def_5g[chd_5g]);
|
||||
|
||||
for (index = 0; index < CH_LIST_LEN(rtw_channel_def_5g[chd_5g]); index++) {
|
||||
if (CH_LIST_CH(rtw_channel_def_5g[chd_5g], index) == ch) {
|
||||
if (flags) {
|
||||
if ((rtw_is_5g_band1(ch) && (attrib & CLA_5G_B1_PASSIVE)) /* band1 passive */
|
||||
|| (rtw_is_5g_band2(ch) && (attrib & CLA_5G_B2_PASSIVE)) /* band2 passive */
|
||||
|| (rtw_is_5g_band3(ch) && (attrib & CLA_5G_B3_PASSIVE)) /* band3 passive */
|
||||
|| (rtw_is_5g_band4(ch) && (attrib & CLA_5G_B4_PASSIVE)) /* band4 passive */
|
||||
)
|
||||
*flags |= RTW_CHF_NO_IR;
|
||||
|
||||
if ((rtw_is_5g_band2(ch) && (attrib & CLA_5G_B2_DFS))
|
||||
|| (rtw_is_5g_band3(ch) && (attrib & CLA_5G_B3_DFS))
|
||||
|| (rtw_is_5g_band4(ch) && (attrib & CLA_5G_B4_DFS)))
|
||||
*flags |= RTW_CHF_DFS;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else
|
||||
#endif /* CONFIG_IEEE80211_BAND_5GHZ */
|
||||
{
|
||||
u8 chd_2g = RTW_ChannelPlanMap[id].chd_2g;
|
||||
|
||||
attrib = CH_LIST_ATTRIB(rtw_channel_def_2g[chd_2g]);
|
||||
|
||||
for (index = 0; index < CH_LIST_LEN(rtw_channel_def_2g[chd_2g]); index++) {
|
||||
if (CH_LIST_CH(rtw_channel_def_2g[chd_2g], index) == ch) {
|
||||
if (flags) {
|
||||
if (ch >= 12 && ch <= 14 && (attrib & CLA_2G_12_14_PASSIVE))
|
||||
*flags |= RTW_CHF_NO_IR;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
enum rtw_chd_6g {
|
||||
RTW_CHD_6G_INVALID = 0,
|
||||
|
||||
RTW_CHD_6G_00,
|
||||
RTW_CHD_6G_01,
|
||||
RTW_CHD_6G_02,
|
||||
RTW_CHD_6G_03,
|
||||
RTW_CHD_6G_04,
|
||||
RTW_CHD_6G_05, /* 6G Worldwide */
|
||||
RTW_CHD_6G_06,
|
||||
|
||||
RTW_CHD_6G_MAX,
|
||||
RTW_CHD_6G_NULL = RTW_CHD_6G_00,
|
||||
};
|
||||
|
||||
static const struct ch_list_t rtw_channel_def_6g[] = {
|
||||
/* RTW_CHD_6G_INVALID */ CH_LIST_ENT(0, 0),
|
||||
/* RTW_CHD_6G_00 */ CH_LIST_ENT(0, 0),
|
||||
/* RTW_CHD_6G_01 */ CH_LIST_ENT(24, 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 0),
|
||||
/* RTW_CHD_6G_02 */ CH_LIST_ENT(6, 97, 101, 105, 109, 113, 117, 0),
|
||||
/* RTW_CHD_6G_03 */ CH_LIST_ENT(18, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 169, 173, 177, 181, 185, 189, 0),
|
||||
/* RTW_CHD_6G_04 */ CH_LIST_ENT(11, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 233, 0),
|
||||
/* RTW_CHD_6G_05 */ CH_LIST_ENT(59, 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 169, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 233, CLA_6G_B1_PASSIVE | CLA_6G_B2_PASSIVE | CLA_6G_B3_PASSIVE | CLA_6G_B4_PASSIVE),
|
||||
/* RTW_CHD_6G_06 */ CH_LIST_ENT(59, 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 169, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 233, 0),
|
||||
};
|
||||
|
||||
struct chplan_6g_ent_t {
|
||||
u8 regd; /* value of enum rtw_regd */
|
||||
u8 chd;
|
||||
};
|
||||
|
||||
#define CHPLAN_6G_ENT(_regd, _chd) {.regd = RTW_REGD_##_regd, .chd = RTW_CHD_6G_##_chd}
|
||||
|
||||
#define CHPLAN_6G_ENT_NOT_DEFINED CHPLAN_6G_ENT(NA, INVALID)
|
||||
|
||||
static const struct chplan_6g_ent_t rtw_chplan_6g_map[] = {
|
||||
[0x00] = CHPLAN_6G_ENT(NA , 00),
|
||||
[0x01] = CHPLAN_6G_ENT(FCC , 01),
|
||||
[0x02] = CHPLAN_6G_ENT(FCC , 02),
|
||||
[0x03] = CHPLAN_6G_ENT(FCC , 03),
|
||||
[0x04] = CHPLAN_6G_ENT(FCC , 04),
|
||||
[0x05] = CHPLAN_6G_ENT(FCC , 06),
|
||||
[0x06] = CHPLAN_6G_ENT(ETSI , 01),
|
||||
[0x07] = CHPLAN_6G_ENT(IC , 06),
|
||||
[0x08] = CHPLAN_6G_ENT(KCC , 06),
|
||||
[0x09] = CHPLAN_6G_ENT(KCC , 01),
|
||||
[0x1B] = CHPLAN_6G_ENT(ACMA , 01),
|
||||
[0x1C] = CHPLAN_6G_ENT(MKK , 01),
|
||||
[0x7F] = CHPLAN_6G_ENT(WW , 05),
|
||||
};
|
||||
|
||||
static const int rtw_chplan_6g_map_size = sizeof(rtw_chplan_6g_map) / sizeof(rtw_chplan_6g_map[0]);
|
||||
|
||||
static u8 rtk_regdb_get_default_regd_6g(u8 id)
|
||||
{
|
||||
if (id < rtw_chplan_6g_map_size)
|
||||
return rtw_chplan_6g_map[id].regd;
|
||||
return RTW_REGD_NA;
|
||||
}
|
||||
|
||||
static bool rtk_regdb_is_domain_code_6g_valid(u8 id)
|
||||
{
|
||||
if (id < rtw_chplan_6g_map_size) {
|
||||
const struct chplan_6g_ent_t *chplan_map = &rtw_chplan_6g_map[id];
|
||||
|
||||
if (chplan_map->chd != RTW_CHD_6G_INVALID)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool rtk_regdb_domain_6g_get_ch(u8 id, u32 ch, u8 *flags)
|
||||
{
|
||||
u8 index, attrib;
|
||||
u8 chd_6g;
|
||||
|
||||
if (flags)
|
||||
*flags = 0;
|
||||
|
||||
chd_6g = rtw_chplan_6g_map[id].chd;
|
||||
|
||||
attrib = CH_LIST_ATTRIB(rtw_channel_def_6g[chd_6g]);
|
||||
|
||||
for (index = 0; index < CH_LIST_LEN(rtw_channel_def_6g[chd_6g]); index++) {
|
||||
if (CH_LIST_CH(rtw_channel_def_6g[chd_6g], index) == ch) {
|
||||
if (flags) {
|
||||
if ((rtw_is_6g_band1(ch) && (attrib & CLA_6G_B1_PASSIVE)) /* band1 passive */
|
||||
|| (rtw_is_6g_band2(ch) && (attrib & CLA_6G_B2_PASSIVE)) /* band2 passive */
|
||||
|| (rtw_is_6g_band3(ch) && (attrib & CLA_6G_B3_PASSIVE)) /* band3 passive */
|
||||
|| (rtw_is_6g_band4(ch) && (attrib & CLA_6G_B4_PASSIVE)) /* band4 passive */
|
||||
)
|
||||
*flags |= RTW_CHF_NO_IR;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211_BAND_6GHZ */
|
||||
|
||||
static const struct country_chplan country_chplan_map[] = {
|
||||
COUNTRY_CHPLAN_ENT("AD", 0x3A, 0x00, DEF , 1, 1, 1), /* Andorra */
|
||||
COUNTRY_CHPLAN_ENT("AE", 0x5E, 0x06, DEF , 1, 1, 1), /* United Arab Emirates */
|
||||
COUNTRY_CHPLAN_ENT("AF", 0x42, 0x00, DEF , 1, 1, 1), /* Afghanistan */
|
||||
COUNTRY_CHPLAN_ENT("AG", 0x76, 0x05, DEF , 1, 1, 1), /* Antigua & Barbuda */
|
||||
COUNTRY_CHPLAN_ENT("AI", 0x5E, 0x06, DEF , 1, 1, 1), /* Anguilla(UK) */
|
||||
COUNTRY_CHPLAN_ENT("AL", 0x5E, 0x00, DEF , 1, 1, 1), /* Albania */
|
||||
COUNTRY_CHPLAN_ENT("AM", 0x5E, 0x06, DEF , 1, 1, 1), /* Armenia */
|
||||
COUNTRY_CHPLAN_ENT("AN", 0x76, 0x05, DEF , 1, 1, 1), /* Netherlands Antilles */
|
||||
COUNTRY_CHPLAN_ENT("AO", 0x5E, 0x00, DEF , 1, 1, 1), /* Angola */
|
||||
COUNTRY_CHPLAN_ENT("AQ", 0x26, 0x00, DEF , 1, 1, 1), /* Antarctica */
|
||||
COUNTRY_CHPLAN_ENT("AR", 0x4D, 0x05, DEF , 1, 1, 1), /* Argentina */
|
||||
COUNTRY_CHPLAN_ENT("AS", 0x76, 0x00, DEF , 1, 1, 1), /* American Samoa */
|
||||
COUNTRY_CHPLAN_ENT("AT", 0x5E, 0x06, DEF , 1, 1, 1), /* Austria */
|
||||
COUNTRY_CHPLAN_ENT("AU", 0x03, 0x1B, DEF , 1, 1, 1), /* Australia */
|
||||
COUNTRY_CHPLAN_ENT("AW", 0x76, 0x05, DEF , 1, 1, 1), /* Aruba */
|
||||
COUNTRY_CHPLAN_ENT("AZ", 0x5E, 0x06, DEF , 1, 1, 1), /* Azerbaijan */
|
||||
COUNTRY_CHPLAN_ENT("BA", 0x5E, 0x00, DEF , 1, 1, 1), /* Bosnia & Herzegovina */
|
||||
COUNTRY_CHPLAN_ENT("BB", 0x76, 0x05, DEF , 1, 1, 1), /* Barbados */
|
||||
COUNTRY_CHPLAN_ENT("BD", 0x5E, 0x00, DEF , 1, 1, 1), /* Bangladesh */
|
||||
COUNTRY_CHPLAN_ENT("BE", 0x5E, 0x06, DEF , 1, 1, 1), /* Belgium */
|
||||
COUNTRY_CHPLAN_ENT("BF", 0x5E, 0x06, DEF , 1, 1, 1), /* Burkina Faso */
|
||||
COUNTRY_CHPLAN_ENT("BG", 0x5E, 0x06, DEF , 1, 1, 1), /* Bulgaria */
|
||||
COUNTRY_CHPLAN_ENT("BH", 0x06, 0x06, DEF , 1, 1, 1), /* Bahrain */
|
||||
COUNTRY_CHPLAN_ENT("BI", 0x3A, 0x06, DEF , 1, 1, 1), /* Burundi */
|
||||
COUNTRY_CHPLAN_ENT("BJ", 0x3A, 0x00, DEF , 1, 1, 1), /* Benin */
|
||||
COUNTRY_CHPLAN_ENT("BM", 0x76, 0x05, DEF , 1, 1, 1), /* Bermuda (UK) */
|
||||
COUNTRY_CHPLAN_ENT("BN", 0x06, 0x00, DEF , 1, 1, 1), /* Brunei */
|
||||
COUNTRY_CHPLAN_ENT("BO", 0x61, 0x05, DEF , 1, 1, 1), /* Bolivia */
|
||||
COUNTRY_CHPLAN_ENT("BR", 0x62, 0x05, DEF , 1, 1, 1), /* Brazil */
|
||||
COUNTRY_CHPLAN_ENT("BS", 0x76, 0x05, DEF , 1, 1, 1), /* Bahamas */
|
||||
COUNTRY_CHPLAN_ENT("BT", 0x5E, 0x00, DEF , 1, 1, 1), /* Bhutan */
|
||||
COUNTRY_CHPLAN_ENT("BV", 0x5E, 0x00, DEF , 1, 1, 1), /* Bouvet Island (Norway) */
|
||||
COUNTRY_CHPLAN_ENT("BW", 0x5E, 0x06, DEF , 1, 1, 1), /* Botswana */
|
||||
COUNTRY_CHPLAN_ENT("BY", 0x08, 0x00, DEF , 0, 1, 1), /* Belarus */
|
||||
COUNTRY_CHPLAN_ENT("BZ", 0x76, 0x00, DEF , 1, 1, 1), /* Belize */
|
||||
COUNTRY_CHPLAN_ENT("CA", 0x2B, 0x07, DEF , 1, 1, 1), /* Canada */
|
||||
COUNTRY_CHPLAN_ENT("CC", 0x03, 0x00, DEF , 1, 1, 1), /* Cocos (Keeling) Islands (Australia) */
|
||||
COUNTRY_CHPLAN_ENT("CD", 0x5E, 0x00, DEF , 1, 1, 1), /* Congo, Republic of the */
|
||||
COUNTRY_CHPLAN_ENT("CF", 0x3A, 0x00, DEF , 1, 1, 1), /* Central African Republic */
|
||||
COUNTRY_CHPLAN_ENT("CG", 0x5E, 0x00, DEF , 1, 1, 1), /* Congo, Democratic Republic of the. Zaire */
|
||||
COUNTRY_CHPLAN_ENT("CH", 0x5E, 0x06, DEF , 1, 1, 1), /* Switzerland */
|
||||
COUNTRY_CHPLAN_ENT("CI", 0x42, 0x00, DEF , 1, 1, 1), /* Cote d'Ivoire */
|
||||
COUNTRY_CHPLAN_ENT("CK", 0x5E, 0x00, DEF , 1, 1, 1), /* Cook Islands */
|
||||
COUNTRY_CHPLAN_ENT("CL", 0x76, 0x01, CHILE , 1, 1, 1), /* Chile */
|
||||
COUNTRY_CHPLAN_ENT("CM", 0x5E, 0x00, DEF , 1, 1, 1), /* Cameroon */
|
||||
COUNTRY_CHPLAN_ENT("CN", 0x06, 0x00, CN , 1, 1, 1), /* China */
|
||||
COUNTRY_CHPLAN_ENT("CO", 0x76, 0x05, DEF , 1, 1, 1), /* Colombia */
|
||||
COUNTRY_CHPLAN_ENT("CR", 0x76, 0x05, DEF , 1, 1, 1), /* Costa Rica */
|
||||
COUNTRY_CHPLAN_ENT("CV", 0x5E, 0x00, DEF , 1, 1, 1), /* Cape Verde */
|
||||
COUNTRY_CHPLAN_ENT("CX", 0x03, 0x00, DEF , 1, 1, 1), /* Christmas Island (Australia) */
|
||||
COUNTRY_CHPLAN_ENT("CY", 0x5E, 0x06, DEF , 1, 1, 1), /* Cyprus */
|
||||
COUNTRY_CHPLAN_ENT("CZ", 0x5E, 0x06, DEF , 1, 1, 1), /* Czech Republic */
|
||||
COUNTRY_CHPLAN_ENT("DE", 0x5E, 0x06, DEF , 1, 1, 1), /* Germany */
|
||||
COUNTRY_CHPLAN_ENT("DJ", 0x5E, 0x06, DEF , 1, 1, 1), /* Djibouti */
|
||||
COUNTRY_CHPLAN_ENT("DK", 0x5E, 0x06, DEF , 1, 1, 1), /* Denmark */
|
||||
COUNTRY_CHPLAN_ENT("DM", 0x76, 0x00, DEF , 1, 1, 1), /* Dominica */
|
||||
COUNTRY_CHPLAN_ENT("DO", 0x76, 0x00, DEF , 1, 1, 1), /* Dominican Republic */
|
||||
COUNTRY_CHPLAN_ENT("DZ", 0x00, 0x06, DEF , 1, 1, 1), /* Algeria */
|
||||
COUNTRY_CHPLAN_ENT("EC", 0x76, 0x00, DEF , 1, 1, 1), /* Ecuador */
|
||||
COUNTRY_CHPLAN_ENT("EE", 0x5E, 0x06, DEF , 1, 1, 1), /* Estonia */
|
||||
COUNTRY_CHPLAN_ENT("EG", 0x3C, 0x00, DEF , 1, 1, 1), /* Egypt */
|
||||
COUNTRY_CHPLAN_ENT("EH", 0x3C, 0x00, DEF , 1, 1, 1), /* Western Sahara */
|
||||
COUNTRY_CHPLAN_ENT("ER", 0x3A, 0x00, DEF , 1, 1, 1), /* Eritrea */
|
||||
COUNTRY_CHPLAN_ENT("ES", 0x5E, 0x06, DEF , 1, 1, 1), /* Spain, Canary Islands, Ceuta, Melilla */
|
||||
COUNTRY_CHPLAN_ENT("ET", 0x3A, 0x00, DEF , 1, 1, 1), /* Ethiopia */
|
||||
COUNTRY_CHPLAN_ENT("FI", 0x5E, 0x06, DEF , 1, 1, 1), /* Finland */
|
||||
COUNTRY_CHPLAN_ENT("FJ", 0x76, 0x00, DEF , 1, 1, 1), /* Fiji */
|
||||
COUNTRY_CHPLAN_ENT("FK", 0x5E, 0x00, DEF , 1, 1, 1), /* Falkland Islands (Islas Malvinas) (UK) */
|
||||
COUNTRY_CHPLAN_ENT("FM", 0x76, 0x00, DEF , 1, 1, 1), /* Micronesia, Federated States of (USA) */
|
||||
COUNTRY_CHPLAN_ENT("FO", 0x5E, 0x00, DEF , 1, 1, 1), /* Faroe Islands (Denmark) */
|
||||
COUNTRY_CHPLAN_ENT("FR", 0x5E, 0x06, DEF , 1, 1, 1), /* France */
|
||||
COUNTRY_CHPLAN_ENT("GA", 0x5E, 0x00, DEF , 1, 1, 1), /* Gabon */
|
||||
COUNTRY_CHPLAN_ENT("GB", 0x0B, 0x06, UK , 1, 1, 1), /* Great Britain (United Kingdom; England) */
|
||||
COUNTRY_CHPLAN_ENT("GD", 0x76, 0x00, DEF , 1, 1, 1), /* Grenada */
|
||||
COUNTRY_CHPLAN_ENT("GE", 0x5E, 0x00, DEF , 1, 1, 1), /* Georgia */
|
||||
COUNTRY_CHPLAN_ENT("GF", 0x3A, 0x00, DEF , 1, 1, 1), /* French Guiana */
|
||||
COUNTRY_CHPLAN_ENT("GG", 0x5E, 0x00, DEF , 1, 1, 1), /* Guernsey (UK) */
|
||||
COUNTRY_CHPLAN_ENT("GH", 0x5E, 0x06, DEF , 1, 1, 1), /* Ghana */
|
||||
COUNTRY_CHPLAN_ENT("GI", 0x5E, 0x00, DEF , 1, 1, 1), /* Gibraltar (UK) */
|
||||
COUNTRY_CHPLAN_ENT("GL", 0x5E, 0x00, DEF , 1, 1, 1), /* Greenland (Denmark) */
|
||||
COUNTRY_CHPLAN_ENT("GM", 0x5E, 0x06, DEF , 1, 1, 1), /* Gambia */
|
||||
COUNTRY_CHPLAN_ENT("GN", 0x5E, 0x06, DEF , 1, 1, 1), /* Guinea */
|
||||
COUNTRY_CHPLAN_ENT("GP", 0x5E, 0x00, DEF , 1, 1, 1), /* Guadeloupe (France) */
|
||||
COUNTRY_CHPLAN_ENT("GQ", 0x5E, 0x06, DEF , 1, 1, 1), /* Equatorial Guinea */
|
||||
COUNTRY_CHPLAN_ENT("GR", 0x5E, 0x06, DEF , 1, 1, 1), /* Greece */
|
||||
COUNTRY_CHPLAN_ENT("GS", 0x3A, 0x00, DEF , 1, 1, 1), /* South Georgia and the Sandwich Islands (UK) */
|
||||
COUNTRY_CHPLAN_ENT("GT", 0x76, 0x05, DEF , 1, 1, 1), /* Guatemala */
|
||||
COUNTRY_CHPLAN_ENT("GU", 0x76, 0x00, DEF , 1, 1, 1), /* Guam (USA) */
|
||||
COUNTRY_CHPLAN_ENT("GW", 0x5E, 0x00, DEF , 1, 1, 1), /* Guinea-Bissau */
|
||||
COUNTRY_CHPLAN_ENT("GY", 0x76, 0x00, DEF , 1, 1, 1), /* Guyana */
|
||||
COUNTRY_CHPLAN_ENT("HK", 0x5E, 0x06, DEF , 1, 1, 1), /* Hong Kong */
|
||||
COUNTRY_CHPLAN_ENT("HM", 0x03, 0x00, DEF , 1, 1, 1), /* Heard and McDonald Islands (Australia) */
|
||||
COUNTRY_CHPLAN_ENT("HN", 0x76, 0x05, DEF , 1, 1, 1), /* Honduras */
|
||||
COUNTRY_CHPLAN_ENT("HR", 0x5E, 0x06, DEF , 1, 1, 1), /* Croatia */
|
||||
COUNTRY_CHPLAN_ENT("HT", 0x76, 0x01, DEF , 0, 1, 1), /* Haiti */
|
||||
COUNTRY_CHPLAN_ENT("HU", 0x5E, 0x06, DEF , 1, 1, 1), /* Hungary */
|
||||
COUNTRY_CHPLAN_ENT("ID", 0x5D, 0x00, DEF , 1, 1, 1), /* Indonesia */
|
||||
COUNTRY_CHPLAN_ENT("IE", 0x5E, 0x06, DEF , 1, 1, 1), /* Ireland */
|
||||
COUNTRY_CHPLAN_ENT("IL", 0x5E, 0x06, DEF , 1, 1, 1), /* Israel */
|
||||
COUNTRY_CHPLAN_ENT("IM", 0x5E, 0x00, DEF , 1, 1, 1), /* Isle of Man (UK) */
|
||||
COUNTRY_CHPLAN_ENT("IN", 0x5E, 0x00, DEF , 1, 1, 1), /* India */
|
||||
COUNTRY_CHPLAN_ENT("IO", 0x3A, 0x00, DEF , 1, 1, 1), /* British Indian Ocean Territory (UK) */
|
||||
COUNTRY_CHPLAN_ENT("IQ", 0x05, 0x00, DEF , 1, 1, 1), /* Iraq */
|
||||
COUNTRY_CHPLAN_ENT("IR", 0x3A, 0x00, DEF , 0, 0, 0), /* Iran */
|
||||
COUNTRY_CHPLAN_ENT("IS", 0x5E, 0x06, DEF , 1, 1, 1), /* Iceland */
|
||||
COUNTRY_CHPLAN_ENT("IT", 0x5E, 0x06, DEF , 1, 1, 1), /* Italy */
|
||||
COUNTRY_CHPLAN_ENT("JE", 0x5E, 0x00, DEF , 1, 1, 1), /* Jersey (UK) */
|
||||
COUNTRY_CHPLAN_ENT("JM", 0x76, 0x05, DEF , 1, 1, 1), /* Jamaica */
|
||||
COUNTRY_CHPLAN_ENT("JO", 0x5E, 0x06, DEF , 1, 1, 1), /* Jordan */
|
||||
COUNTRY_CHPLAN_ENT("JP", 0x7D, 0x1C, DEF , 1, 1, 1), /* Japan- Telec */
|
||||
COUNTRY_CHPLAN_ENT("KE", 0x5E, 0x06, DEF , 1, 1, 1), /* Kenya */
|
||||
COUNTRY_CHPLAN_ENT("KG", 0x5E, 0x06, DEF , 1, 1, 1), /* Kyrgyzstan */
|
||||
COUNTRY_CHPLAN_ENT("KH", 0x5E, 0x00, DEF , 1, 1, 1), /* Cambodia */
|
||||
COUNTRY_CHPLAN_ENT("KI", 0x5E, 0x00, DEF , 1, 1, 1), /* Kiribati */
|
||||
COUNTRY_CHPLAN_ENT("KM", 0x5E, 0x06, DEF , 1, 1, 1), /* Comoros */
|
||||
COUNTRY_CHPLAN_ENT("KN", 0x76, 0x05, DEF , 1, 1, 1), /* Saint Kitts and Nevis */
|
||||
COUNTRY_CHPLAN_ENT("KR", 0x4B, 0x08, DEF , 1, 1, 1), /* South Korea */
|
||||
COUNTRY_CHPLAN_ENT("KW", 0x5E, 0x06, DEF , 1, 1, 1), /* Kuwait */
|
||||
COUNTRY_CHPLAN_ENT("KY", 0x76, 0x05, DEF , 1, 1, 1), /* Cayman Islands (UK) */
|
||||
COUNTRY_CHPLAN_ENT("KZ", 0x5E, 0x00, DEF , 1, 1, 1), /* Kazakhstan */
|
||||
COUNTRY_CHPLAN_ENT("LA", 0x5E, 0x06, DEF , 1, 1, 1), /* Laos */
|
||||
COUNTRY_CHPLAN_ENT("LB", 0x5E, 0x06, DEF , 1, 1, 1), /* Lebanon */
|
||||
COUNTRY_CHPLAN_ENT("LC", 0x76, 0x05, DEF , 1, 1, 1), /* Saint Lucia */
|
||||
COUNTRY_CHPLAN_ENT("LI", 0x5E, 0x06, DEF , 1, 1, 1), /* Liechtenstein */
|
||||
COUNTRY_CHPLAN_ENT("LK", 0x5E, 0x00, DEF , 1, 1, 1), /* Sri Lanka */
|
||||
COUNTRY_CHPLAN_ENT("LR", 0x5E, 0x00, DEF , 1, 1, 1), /* Liberia */
|
||||
COUNTRY_CHPLAN_ENT("LS", 0x5E, 0x00, DEF , 1, 1, 1), /* Lesotho */
|
||||
COUNTRY_CHPLAN_ENT("LT", 0x5E, 0x06, DEF , 1, 1, 1), /* Lithuania */
|
||||
COUNTRY_CHPLAN_ENT("LU", 0x5E, 0x06, DEF , 1, 1, 1), /* Luxembourg */
|
||||
COUNTRY_CHPLAN_ENT("LV", 0x5E, 0x06, DEF , 1, 1, 1), /* Latvia */
|
||||
COUNTRY_CHPLAN_ENT("LY", 0x5E, 0x00, DEF , 1, 1, 1), /* Libya */
|
||||
COUNTRY_CHPLAN_ENT("MA", 0x3C, 0x06, DEF , 1, 1, 1), /* Morocco */
|
||||
COUNTRY_CHPLAN_ENT("MC", 0x5E, 0x06, DEF , 1, 1, 1), /* Monaco */
|
||||
COUNTRY_CHPLAN_ENT("MD", 0x5E, 0x06, DEF , 1, 1, 1), /* Moldova */
|
||||
COUNTRY_CHPLAN_ENT("ME", 0x3A, 0x00, DEF , 1, 1, 1), /* Montenegro */
|
||||
COUNTRY_CHPLAN_ENT("MF", 0x76, 0x00, DEF , 1, 1, 1), /* Saint Martin */
|
||||
COUNTRY_CHPLAN_ENT("MG", 0x5E, 0x06, DEF , 1, 1, 1), /* Madagascar */
|
||||
COUNTRY_CHPLAN_ENT("MH", 0x76, 0x00, DEF , 1, 1, 1), /* Marshall Islands (USA) */
|
||||
COUNTRY_CHPLAN_ENT("MK", 0x5E, 0x00, DEF , 1, 1, 1), /* Republic of Macedonia (FYROM) */
|
||||
COUNTRY_CHPLAN_ENT("ML", 0x5E, 0x00, DEF , 1, 1, 1), /* Mali */
|
||||
COUNTRY_CHPLAN_ENT("MM", 0x3A, 0x00, DEF , 1, 1, 1), /* Burma (Myanmar) */
|
||||
COUNTRY_CHPLAN_ENT("MN", 0x5E, 0x06, DEF , 1, 1, 1), /* Mongolia */
|
||||
COUNTRY_CHPLAN_ENT("MO", 0x5E, 0x00, DEF , 1, 1, 1), /* Macau */
|
||||
COUNTRY_CHPLAN_ENT("MP", 0x76, 0x00, DEF , 1, 1, 1), /* Northern Mariana Islands (USA) */
|
||||
COUNTRY_CHPLAN_ENT("MQ", 0x3A, 0x00, DEF , 1, 1, 1), /* Martinique (France) */
|
||||
COUNTRY_CHPLAN_ENT("MR", 0x5E, 0x00, DEF , 1, 1, 1), /* Mauritania */
|
||||
COUNTRY_CHPLAN_ENT("MS", 0x3A, 0x00, DEF , 1, 1, 1), /* Montserrat (UK) */
|
||||
COUNTRY_CHPLAN_ENT("MT", 0x5E, 0x06, DEF , 1, 1, 1), /* Malta */
|
||||
COUNTRY_CHPLAN_ENT("MU", 0x5E, 0x06, DEF , 1, 1, 1), /* Mauritius */
|
||||
COUNTRY_CHPLAN_ENT("MV", 0x3C, 0x00, DEF , 1, 1, 1), /* Maldives */
|
||||
COUNTRY_CHPLAN_ENT("MW", 0x5E, 0x00, DEF , 1, 1, 1), /* Malawi */
|
||||
COUNTRY_CHPLAN_ENT("MX", 0x4D, 0x01, DEF , 1, 1, 1), /* Mexico */
|
||||
COUNTRY_CHPLAN_ENT("MY", 0x07, 0x06, DEF , 1, 1, 1), /* Malaysia */
|
||||
COUNTRY_CHPLAN_ENT("MZ", 0x5E, 0x00, DEF , 1, 1, 1), /* Mozambique */
|
||||
COUNTRY_CHPLAN_ENT("NA", 0x5E, 0x00, DEF , 1, 1, 1), /* Namibia */
|
||||
COUNTRY_CHPLAN_ENT("NC", 0x3A, 0x00, DEF , 1, 1, 1), /* New Caledonia */
|
||||
COUNTRY_CHPLAN_ENT("NE", 0x5E, 0x00, DEF , 1, 1, 1), /* Niger */
|
||||
COUNTRY_CHPLAN_ENT("NF", 0x03, 0x00, DEF , 1, 1, 1), /* Norfolk Island (Australia) */
|
||||
COUNTRY_CHPLAN_ENT("NG", 0x75, 0x00, DEF , 1, 1, 1), /* Nigeria */
|
||||
COUNTRY_CHPLAN_ENT("NI", 0x76, 0x00, DEF , 1, 1, 1), /* Nicaragua */
|
||||
COUNTRY_CHPLAN_ENT("NL", 0x5E, 0x06, DEF , 1, 1, 1), /* Netherlands */
|
||||
COUNTRY_CHPLAN_ENT("NO", 0x5E, 0x06, DEF , 1, 1, 1), /* Norway */
|
||||
COUNTRY_CHPLAN_ENT("NP", 0x06, 0x00, DEF , 1, 1, 1), /* Nepal */
|
||||
COUNTRY_CHPLAN_ENT("NR", 0x5E, 0x00, DEF , 1, 1, 1), /* Nauru */
|
||||
COUNTRY_CHPLAN_ENT("NU", 0x03, 0x00, DEF , 1, 1, 1), /* Niue */
|
||||
COUNTRY_CHPLAN_ENT("NZ", 0x03, 0x1B, DEF , 1, 1, 1), /* New Zealand */
|
||||
COUNTRY_CHPLAN_ENT("OM", 0x5E, 0x00, DEF , 1, 1, 1), /* Oman */
|
||||
COUNTRY_CHPLAN_ENT("PA", 0x76, 0x00, DEF , 1, 1, 1), /* Panama */
|
||||
COUNTRY_CHPLAN_ENT("PE", 0x76, 0x05, DEF , 1, 1, 1), /* Peru */
|
||||
COUNTRY_CHPLAN_ENT("PF", 0x3A, 0x00, DEF , 1, 1, 1), /* French Polynesia (France) */
|
||||
COUNTRY_CHPLAN_ENT("PG", 0x5E, 0x06, DEF , 1, 1, 1), /* Papua New Guinea */
|
||||
COUNTRY_CHPLAN_ENT("PH", 0x5E, 0x00, DEF , 1, 1, 1), /* Philippines */
|
||||
COUNTRY_CHPLAN_ENT("PK", 0x5E, 0x00, DEF , 1, 1, 1), /* Pakistan */
|
||||
COUNTRY_CHPLAN_ENT("PL", 0x5E, 0x06, DEF , 1, 1, 1), /* Poland */
|
||||
COUNTRY_CHPLAN_ENT("PM", 0x5E, 0x00, DEF , 1, 1, 1), /* Saint Pierre and Miquelon (France) */
|
||||
COUNTRY_CHPLAN_ENT("PR", 0x76, 0x00, DEF , 1, 1, 1), /* Puerto Rico */
|
||||
COUNTRY_CHPLAN_ENT("PS", 0x5E, 0x00, DEF , 1, 1, 1), /* Palestine */
|
||||
COUNTRY_CHPLAN_ENT("PT", 0x5E, 0x06, DEF , 1, 1, 1), /* Portugal */
|
||||
COUNTRY_CHPLAN_ENT("PW", 0x76, 0x00, DEF , 1, 1, 1), /* Palau */
|
||||
COUNTRY_CHPLAN_ENT("PY", 0x76, 0x00, DEF , 1, 1, 1), /* Paraguay */
|
||||
COUNTRY_CHPLAN_ENT("QA", 0x5E, 0x06, QATAR , 1, 1, 1), /* Qatar */
|
||||
COUNTRY_CHPLAN_ENT("RE", 0x5E, 0x00, DEF , 1, 1, 1), /* Reunion (France) */
|
||||
COUNTRY_CHPLAN_ENT("RO", 0x5E, 0x06, DEF , 1, 1, 1), /* Romania */
|
||||
COUNTRY_CHPLAN_ENT("RS", 0x5E, 0x06, DEF , 1, 1, 1), /* Serbia */
|
||||
COUNTRY_CHPLAN_ENT("RU", 0x09, 0x00, DEF , 1, 1, 1), /* Russia(fac/gost), Kaliningrad */
|
||||
COUNTRY_CHPLAN_ENT("RW", 0x5E, 0x00, DEF , 1, 1, 1), /* Rwanda */
|
||||
COUNTRY_CHPLAN_ENT("SA", 0x5E, 0x06, DEF , 1, 1, 1), /* Saudi Arabia */
|
||||
COUNTRY_CHPLAN_ENT("SB", 0x3A, 0x00, DEF , 1, 1, 1), /* Solomon Islands */
|
||||
COUNTRY_CHPLAN_ENT("SC", 0x76, 0x00, DEF , 1, 1, 1), /* Seychelles */
|
||||
COUNTRY_CHPLAN_ENT("SE", 0x5E, 0x06, DEF , 1, 1, 1), /* Sweden */
|
||||
COUNTRY_CHPLAN_ENT("SG", 0x5E, 0x00, DEF , 1, 1, 1), /* Singapore */
|
||||
COUNTRY_CHPLAN_ENT("SH", 0x5E, 0x00, DEF , 1, 1, 1), /* Saint Helena (UK) */
|
||||
COUNTRY_CHPLAN_ENT("SI", 0x5E, 0x06, DEF , 1, 1, 1), /* Slovenia */
|
||||
COUNTRY_CHPLAN_ENT("SJ", 0x5E, 0x00, DEF , 1, 1, 1), /* Svalbard (Norway) */
|
||||
COUNTRY_CHPLAN_ENT("SK", 0x5E, 0x06, DEF , 1, 1, 1), /* Slovakia */
|
||||
COUNTRY_CHPLAN_ENT("SL", 0x5E, 0x06, DEF , 1, 1, 1), /* Sierra Leone */
|
||||
COUNTRY_CHPLAN_ENT("SM", 0x3A, 0x00, DEF , 1, 1, 1), /* San Marino */
|
||||
COUNTRY_CHPLAN_ENT("SN", 0x3A, 0x00, DEF , 1, 1, 1), /* Senegal */
|
||||
COUNTRY_CHPLAN_ENT("SO", 0x3A, 0x00, DEF , 1, 1, 1), /* Somalia */
|
||||
COUNTRY_CHPLAN_ENT("SR", 0x74, 0x05, DEF , 1, 1, 1), /* Suriname */
|
||||
COUNTRY_CHPLAN_ENT("ST", 0x5E, 0x00, DEF , 1, 1, 1), /* Sao Tome and Principe */
|
||||
COUNTRY_CHPLAN_ENT("SV", 0x76, 0x05, DEF , 1, 1, 1), /* El Salvador */
|
||||
COUNTRY_CHPLAN_ENT("SX", 0x76, 0x00, DEF , 1, 1, 1), /* Sint Marteen */
|
||||
COUNTRY_CHPLAN_ENT("SZ", 0x5E, 0x00, DEF , 1, 1, 1), /* Swaziland */
|
||||
COUNTRY_CHPLAN_ENT("TC", 0x3A, 0x00, DEF , 1, 1, 1), /* Turks and Caicos Islands (UK) */
|
||||
COUNTRY_CHPLAN_ENT("TD", 0x3A, 0x06, DEF , 1, 1, 1), /* Chad */
|
||||
COUNTRY_CHPLAN_ENT("TF", 0x3A, 0x00, DEF , 1, 1, 1), /* French Southern and Antarctic Lands (FR Southern Territories) */
|
||||
COUNTRY_CHPLAN_ENT("TG", 0x5E, 0x06, DEF , 1, 1, 1), /* Togo */
|
||||
COUNTRY_CHPLAN_ENT("TH", 0x5E, 0x06, DEF , 1, 1, 1), /* Thailand */
|
||||
COUNTRY_CHPLAN_ENT("TJ", 0x5E, 0x06, DEF , 1, 1, 1), /* Tajikistan */
|
||||
COUNTRY_CHPLAN_ENT("TK", 0x03, 0x00, DEF , 1, 1, 1), /* Tokelau */
|
||||
COUNTRY_CHPLAN_ENT("TM", 0x3A, 0x00, DEF , 1, 1, 1), /* Turkmenistan */
|
||||
COUNTRY_CHPLAN_ENT("TN", 0x04, 0x00, DEF , 1, 1, 1), /* Tunisia */
|
||||
COUNTRY_CHPLAN_ENT("TO", 0x3A, 0x00, DEF , 1, 1, 1), /* Tonga */
|
||||
COUNTRY_CHPLAN_ENT("TR", 0x5E, 0x06, DEF , 1, 1, 1), /* Turkey, Northern Cyprus */
|
||||
COUNTRY_CHPLAN_ENT("TT", 0x76, 0x00, DEF , 1, 1, 1), /* Trinidad & Tobago */
|
||||
COUNTRY_CHPLAN_ENT("TV", 0x21, 0x00, DEF , 0, 0, 0), /* Tuvalu */
|
||||
COUNTRY_CHPLAN_ENT("TW", 0x76, 0x00, DEF , 1, 1, 1), /* Taiwan */
|
||||
COUNTRY_CHPLAN_ENT("TZ", 0x5E, 0x00, DEF , 1, 1, 1), /* Tanzania */
|
||||
COUNTRY_CHPLAN_ENT("UA", 0x5E, 0x00, UKRAINE, 1, 1, 1), /* Ukraine */
|
||||
COUNTRY_CHPLAN_ENT("UG", 0x3A, 0x00, DEF , 1, 1, 1), /* Uganda */
|
||||
COUNTRY_CHPLAN_ENT("US", 0x1B, 0x05, DEF , 1, 1, 1), /* United States of America (USA) */
|
||||
COUNTRY_CHPLAN_ENT("UY", 0x30, 0x00, DEF , 1, 1, 1), /* Uruguay */
|
||||
COUNTRY_CHPLAN_ENT("UZ", 0x3A, 0x06, DEF , 1, 1, 1), /* Uzbekistan */
|
||||
COUNTRY_CHPLAN_ENT("VA", 0x5E, 0x00, DEF , 1, 1, 1), /* Holy See (Vatican City) */
|
||||
COUNTRY_CHPLAN_ENT("VC", 0x76, 0x00, DEF , 1, 1, 1), /* Saint Vincent and the Grenadines */
|
||||
COUNTRY_CHPLAN_ENT("VE", 0x30, 0x00, DEF , 1, 1, 1), /* Venezuela */
|
||||
COUNTRY_CHPLAN_ENT("VG", 0x76, 0x05, DEF , 1, 1, 1), /* British Virgin Islands (UK) */
|
||||
COUNTRY_CHPLAN_ENT("VI", 0x76, 0x00, DEF , 1, 1, 1), /* United States Virgin Islands (USA) */
|
||||
COUNTRY_CHPLAN_ENT("VN", 0x5E, 0x00, DEF , 1, 1, 1), /* Vietnam */
|
||||
COUNTRY_CHPLAN_ENT("VU", 0x26, 0x00, DEF , 1, 1, 1), /* Vanuatu */
|
||||
COUNTRY_CHPLAN_ENT("WF", 0x3A, 0x00, DEF , 1, 1, 1), /* Wallis and Futuna (France) */
|
||||
COUNTRY_CHPLAN_ENT("WS", 0x76, 0x00, DEF , 1, 1, 1), /* Samoa */
|
||||
COUNTRY_CHPLAN_ENT("XK", 0x5E, 0x00, DEF , 1, 1, 1), /* Kosovo */
|
||||
COUNTRY_CHPLAN_ENT("YE", 0x3A, 0x00, DEF , 1, 1, 1), /* Yemen */
|
||||
COUNTRY_CHPLAN_ENT("YT", 0x5E, 0x00, DEF , 1, 1, 1), /* Mayotte (France) */
|
||||
COUNTRY_CHPLAN_ENT("ZA", 0x5E, 0x06, DEF , 1, 1, 1), /* South Africa */
|
||||
COUNTRY_CHPLAN_ENT("ZM", 0x5E, 0x00, DEF , 1, 1, 1), /* Zambia */
|
||||
COUNTRY_CHPLAN_ENT("ZW", 0x5E, 0x00, DEF , 1, 1, 1), /* Zimbabwe */
|
||||
};
|
||||
|
||||
static bool rtk_regdb_get_chplan_from_alpha2(const char *alpha2, struct country_chplan *ent)
|
||||
{
|
||||
const struct country_chplan *map = country_chplan_map;
|
||||
u16 map_sz = sizeof(country_chplan_map) / sizeof(struct country_chplan);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < map_sz; i++) {
|
||||
if (strncmp(alpha2, map[i].alpha2, 2) == 0) {
|
||||
if (ent)
|
||||
_rtw_memcpy(ent, &map[i], sizeof(*ent));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RTW_DEBUG
|
||||
static void rtk_regdb_dump_chplan_test(void *sel)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
/* check 2G CHD redundent */
|
||||
for (i = RTW_CHD_2G_00; i < RTW_CHD_2G_MAX; i++) {
|
||||
for (j = RTW_CHD_2G_00; j < i; j++) {
|
||||
if (CH_LIST_LEN(rtw_channel_def_2g[i]) == CH_LIST_LEN(rtw_channel_def_2g[j])
|
||||
&& _rtw_memcmp(&CH_LIST_CH(rtw_channel_def_2g[i], 0), &CH_LIST_CH(rtw_channel_def_2g[j], 0), CH_LIST_LEN(rtw_channel_def_2g[i]) + 1) == _TRUE)
|
||||
RTW_PRINT_SEL(sel, "2G chd:%u and %u is the same\n", i, j);
|
||||
}
|
||||
}
|
||||
|
||||
/* check 2G CHD invalid channel */
|
||||
for (i = RTW_CHD_2G_00; i < RTW_CHD_2G_MAX; i++) {
|
||||
for (j = 0; j < CH_LIST_LEN(rtw_channel_def_2g[i]); j++) {
|
||||
if (rtw_bch2freq(BAND_ON_24G, CH_LIST_CH(rtw_channel_def_2g[i], j)) == 0)
|
||||
RTW_PRINT_SEL(sel, "2G invalid ch:%u at (%d,%d)\n", CH_LIST_CH(rtw_channel_def_2g[i], j), i, j);
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
/* check 5G CHD redundent */
|
||||
for (i = RTW_CHD_5G_00; i < RTW_CHD_5G_MAX; i++) {
|
||||
for (j = RTW_CHD_5G_00; j < i; j++) {
|
||||
if (CH_LIST_LEN(rtw_channel_def_5g[i]) == CH_LIST_LEN(rtw_channel_def_5g[j])
|
||||
&& _rtw_memcmp(&CH_LIST_CH(rtw_channel_def_5g[i], 0), &CH_LIST_CH(rtw_channel_def_5g[j], 0), CH_LIST_LEN(rtw_channel_def_5g[i]) + 1) == _TRUE)
|
||||
RTW_PRINT_SEL(sel, "5G chd:%u and %u is the same\n", i, j);
|
||||
}
|
||||
}
|
||||
|
||||
/* check 5G CHD invalid channel */
|
||||
for (i = RTW_CHD_5G_00; i < RTW_CHD_5G_MAX; i++) {
|
||||
for (j = 0; j < CH_LIST_LEN(rtw_channel_def_5g[i]); j++) {
|
||||
if (rtw_bch2freq(BAND_ON_5G, CH_LIST_CH(rtw_channel_def_5g[i], j)) == 0)
|
||||
RTW_PRINT_SEL(sel, "5G invalid ch:%u at (%d,%d)\n", CH_LIST_CH(rtw_channel_def_5g[i], j), i, j);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
/* check 6G CHD redundent */
|
||||
for (i = RTW_CHD_6G_00; i < RTW_CHD_6G_MAX; i++) {
|
||||
for (j = RTW_CHD_6G_00; j < i; j++) {
|
||||
if (CH_LIST_LEN(rtw_channel_def_6g[i]) == CH_LIST_LEN(rtw_channel_def_6g[j])
|
||||
&& _rtw_memcmp(&CH_LIST_CH(rtw_channel_def_6g[i], 0), &CH_LIST_CH(rtw_channel_def_6g[j], 0), CH_LIST_LEN(rtw_channel_def_6g[i]) + 1) == _TRUE)
|
||||
RTW_PRINT_SEL(sel, "6G chd:%u and %u is the same\n", i, j);
|
||||
}
|
||||
}
|
||||
|
||||
/* check 6G CHD invalid channel */
|
||||
for (i = RTW_CHD_6G_00; i < RTW_CHD_6G_MAX; i++) {
|
||||
for (j = 0; j < CH_LIST_LEN(rtw_channel_def_6g[i]); j++) {
|
||||
if (rtw_bch2freq(BAND_ON_6G, CH_LIST_CH(rtw_channel_def_6g[i], j)) == 0)
|
||||
RTW_PRINT_SEL(sel, "6G invalid ch:%u at (%d,%d)\n", CH_LIST_CH(rtw_channel_def_6g[i], j), i, j);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* check chplan 2G_5G redundent */
|
||||
for (i = 0; i < RTW_ChannelPlanMap_size; i++) {
|
||||
if (!rtw_is_channel_plan_valid(i))
|
||||
continue;
|
||||
for (j = 0; j < i; j++) {
|
||||
if (!rtw_is_channel_plan_valid(j))
|
||||
continue;
|
||||
if (_rtw_memcmp(&RTW_ChannelPlanMap[i], &RTW_ChannelPlanMap[j], sizeof(RTW_ChannelPlanMap[i])) == _TRUE)
|
||||
RTW_PRINT_SEL(sel, "channel plan 0x%02x and 0x%02x is the same\n", i, j);
|
||||
}
|
||||
}
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
/* check chplan 6G redundent */
|
||||
for (i = 0; i < rtw_chplan_6g_map_size; i++) {
|
||||
if (!rtw_is_channel_plan_6g_valid(i))
|
||||
continue;
|
||||
for (j = 0; j < i; j++) {
|
||||
if (!rtw_is_channel_plan_6g_valid(j))
|
||||
continue;
|
||||
if (_rtw_memcmp(&rtw_chplan_6g_map[i], &rtw_chplan_6g_map[j], sizeof(rtw_chplan_6g_map[i])) == _TRUE)
|
||||
RTW_PRINT_SEL(sel, "channel plan 6g 0x%02x and 0x%02x is the same\n", i, j);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* check country invalid chplan/chplan_6g */
|
||||
{
|
||||
struct country_chplan ent;
|
||||
u8 code[2];
|
||||
|
||||
for (code[0] = 'A'; code[0] <= 'Z'; code[0]++) {
|
||||
for (code[1] = 'A'; code[1] <= 'Z'; code[1]++) {
|
||||
if (!rtw_get_chplan_from_country(code, &ent))
|
||||
continue;
|
||||
if (!rtw_is_channel_plan_valid(ent.domain_code))
|
||||
RTW_PRINT_SEL(sel, "country \"%c%c\" has invalid domain_code:0x%02X\n", code[0], code[1], ent.domain_code);
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
if (!rtw_is_channel_plan_6g_valid(ent.domain_code_6g))
|
||||
RTW_PRINT_SEL(sel, "country \"%c%c\" has invalid domain_code_6g:0x%02X\n", code[0], code[1], ent.domain_code_6g);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_RTW_DEBUG */
|
||||
|
||||
static void rtk_regdb_get_ver_str(char *buf, size_t buf_len)
|
||||
{
|
||||
snprintf(buf, buf_len, "%s%s-%s%s", RTW_DOMAIN_MAP_VER, RTW_DOMAIN_MAP_M_VER, RTW_COUNTRY_MAP_VER, RTW_COUNTRY_MAP_M_VER);
|
||||
}
|
||||
|
||||
struct rtw_regdb_ops regdb_ops = {
|
||||
.get_default_regd_2g = rtk_regdb_get_default_regd_2g,
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
.get_default_regd_5g = rtk_regdb_get_default_regd_5g,
|
||||
#endif
|
||||
.is_domain_code_valid = rtk_regdb_is_domain_code_valid,
|
||||
.domain_get_ch = rtk_regdb_domain_get_ch,
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
.get_default_regd_6g = rtk_regdb_get_default_regd_6g,
|
||||
.is_domain_code_6g_valid = rtk_regdb_is_domain_code_6g_valid,
|
||||
.domain_6g_get_ch = rtk_regdb_domain_6g_get_ch,
|
||||
#endif
|
||||
|
||||
.get_chplan_from_alpha2 = rtk_regdb_get_chplan_from_alpha2,
|
||||
|
||||
#ifdef CONFIG_RTW_DEBUG
|
||||
.dump_chplan_test = rtk_regdb_dump_chplan_test,
|
||||
#endif
|
||||
.get_ver_str = rtk_regdb_get_ver_str,
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -293,9 +293,9 @@ void rm_set_rep_mode(struct rm_obj *prm, u8 mode)
|
||||
|
||||
RTW_INFO("RM: rmid=%x set %s\n",
|
||||
prm->rmid,
|
||||
mode|MEAS_REP_MOD_INCAP?"INCAP":
|
||||
mode|MEAS_REP_MOD_REFUSE?"REFUSE":
|
||||
mode|MEAS_REP_MOD_LATE?"LATE":"");
|
||||
mode&MEAS_REP_MOD_INCAP?"INCAP":
|
||||
mode&MEAS_REP_MOD_REFUSE?"REFUSE":
|
||||
mode&MEAS_REP_MOD_LATE?"LATE":"");
|
||||
|
||||
prm->p.m_mode |= mode;
|
||||
}
|
||||
@@ -310,17 +310,17 @@ int issue_null_reply(struct rm_obj *prm)
|
||||
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
|
||||
|
||||
|
||||
m_mode = prm->p.m_mode;
|
||||
if (m_mode || prm->p.rpt == 0) {
|
||||
m_mode = prm->q.m_mode;
|
||||
if (m_mode || prm->q.rpt == 0) {
|
||||
RTW_INFO("RM: rmid=%x reply (%s repeat=%d)\n",
|
||||
prm->rmid,
|
||||
m_mode&MEAS_REP_MOD_INCAP?"INCAP":
|
||||
m_mode&MEAS_REP_MOD_REFUSE?"REFUSE":
|
||||
m_mode&MEAS_REP_MOD_LATE?"LATE":"no content",
|
||||
prm->p.rpt);
|
||||
prm->q.rpt);
|
||||
}
|
||||
|
||||
switch (prm->p.action_code) {
|
||||
switch (prm->q.action_code) {
|
||||
case RM_ACT_RADIO_MEAS_REQ:
|
||||
len = 8;
|
||||
break;
|
||||
@@ -376,15 +376,11 @@ int ready_for_scan(struct rm_obj *prm)
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
int rm_sitesurvey(struct rm_obj *prm)
|
||||
int rm_get_chset(struct rm_obj *prm)
|
||||
{
|
||||
int meas_ch_amount=0;
|
||||
int i,meas_ch_amount=0;
|
||||
u8 op_class=0, val8;
|
||||
struct rtw_ieee80211_channel *pch_set;
|
||||
struct sitesurvey_parm parm;
|
||||
|
||||
|
||||
RTW_INFO("RM: rmid=%x %s\n",prm->rmid, __func__);
|
||||
|
||||
pch_set = &prm->q.ch_set[0];
|
||||
|
||||
@@ -412,24 +408,39 @@ int rm_sitesurvey(struct rm_obj *prm)
|
||||
#if (RM_MORE_DBG_MSG)
|
||||
RTW_INFO("survey (%d) chaannels\n", meas_ch_amount);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
_rtw_memset(&parm, 0, sizeof(struct sitesurvey_parm));
|
||||
_rtw_memcpy(parm.ch, pch_set,
|
||||
sizeof(struct rtw_ieee80211_channel) *
|
||||
MIN(meas_ch_amount, RTW_CHANNEL_SCAN_AMOUNT));
|
||||
int rm_sitesurvey(struct rm_obj *prm)
|
||||
{
|
||||
int meas_ch_amount=0;
|
||||
u8 op_class=0, val8;
|
||||
struct rtw_ieee80211_channel *pch_set;
|
||||
struct sitesurvey_parm *parm = NULL;
|
||||
|
||||
_rtw_memcpy(&parm.ssid[0], &prm->q.opt.bcn.ssid, IW_ESSID_MAX_SIZE);
|
||||
|
||||
parm.ssid_num = 1;
|
||||
parm.scan_mode = prm->q.m_mode;
|
||||
parm.ch_num = meas_ch_amount;
|
||||
parm.igi = 0;
|
||||
parm.token = prm->rmid;
|
||||
parm.duration = prm->q.meas_dur;
|
||||
RTW_INFO("RM: rmid=%x %s\n",prm->rmid, __func__);
|
||||
parm = (struct sitesurvey_parm *)rtw_zmalloc(sizeof(struct sitesurvey_parm));
|
||||
if (!parm)
|
||||
return _FALSE;
|
||||
rm_get_chset(prm);
|
||||
pch_set = &prm->q.ch_set[0];
|
||||
|
||||
meas_ch_amount = MIN(prm->q.ch_set_ch_amount, RTW_CHANNEL_SCAN_AMOUNT);
|
||||
_rtw_memcpy(parm->ch, pch_set, sizeof(struct rtw_ieee80211_channel) * meas_ch_amount);
|
||||
|
||||
_rtw_memcpy(&(parm->ssid[0]), &prm->q.opt.bcn.ssid, IW_ESSID_MAX_SIZE);
|
||||
|
||||
parm->ssid_num = 1;
|
||||
parm->scan_mode = prm->q.m_mode;
|
||||
parm->ch_num = meas_ch_amount;
|
||||
parm->igi = 0;
|
||||
parm->token = prm->rmid;
|
||||
parm->duration = prm->q.meas_dur;
|
||||
/* parm.bw = BW_20M; */
|
||||
|
||||
rtw_sitesurvey_cmd(prm->psta->padapter, &parm);
|
||||
|
||||
rtw_sitesurvey_cmd(prm->psta->padapter, parm);
|
||||
rtw_mfree(parm, sizeof(struct sitesurvey_parm));
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
@@ -828,14 +839,16 @@ int rm_recv_radio_mens_rep(_adapter *padapter,
|
||||
u8 bcn_rpt_cnt;
|
||||
|
||||
|
||||
rmid = psta->cmn.aid << 16
|
||||
| pdiag_body[2] << 8
|
||||
rmid = ((u32)(psta->cmn.aid << 16))
|
||||
| ((u32)(pdiag_body[2] << 8))
|
||||
| RM_MASTER;
|
||||
|
||||
prm = rm_get_rmobj(padapter, rmid);
|
||||
if (prm == NULL) {
|
||||
/* not belong to us, report to upper */
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_cfg80211_rx_rrm_action(psta->padapter, precv_frame);
|
||||
#endif
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
@@ -940,14 +953,16 @@ int rm_recv_link_mens_rep(_adapter *padapter,
|
||||
s8 val;
|
||||
|
||||
|
||||
rmid = psta->cmn.aid << 16
|
||||
| pdiag_body[2] << 8
|
||||
rmid = ((u32)(psta->cmn.aid << 16))
|
||||
| ((u32)(pdiag_body[2] << 8))
|
||||
| RM_MASTER;
|
||||
|
||||
prm = rm_get_rmobj(padapter, rmid);
|
||||
if (prm == NULL) {
|
||||
/* not belong to us, report to upper */
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_cfg80211_rx_rrm_action(psta->padapter, precv_frame);
|
||||
#endif
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
@@ -985,15 +1000,17 @@ int rm_radio_mens_nb_rep(_adapter *padapter,
|
||||
struct rm_obj *prm;
|
||||
|
||||
|
||||
rmid = psta->cmn.aid << 16
|
||||
| pdiag_body[2] << 8
|
||||
rmid = ((u32)(psta->cmn.aid << 16))
|
||||
| ((u32)(pdiag_body[2] << 8))
|
||||
| RM_MASTER;
|
||||
|
||||
prm = rm_get_rmobj(padapter, rmid);
|
||||
|
||||
if (prm == NULL) {
|
||||
/* not belong to us, report to upper */
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_cfg80211_rx_rrm_action(psta->padapter, precv_frame);
|
||||
#endif
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
@@ -1017,8 +1034,9 @@ int rm_radio_mens_nb_rep(_adapter *padapter,
|
||||
,_FALSE) == _FAIL)
|
||||
return _FALSE;
|
||||
#endif
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_cfg80211_rx_rrm_action(padapter, precv_frame);
|
||||
|
||||
#endif
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
@@ -1028,7 +1046,9 @@ unsigned int rm_on_action(_adapter *padapter, union recv_frame *precv_frame)
|
||||
u8 *pframe = NULL;
|
||||
u8 *pframe_body = NULL;
|
||||
u8 action_code = 0;
|
||||
#if (RM_MORE_DBG_MSG)
|
||||
u8 diag_token = 0;
|
||||
#endif
|
||||
struct rtw_ieee80211_hdr_3addr *whdr;
|
||||
struct sta_info *psta;
|
||||
|
||||
@@ -1057,9 +1077,8 @@ unsigned int rm_on_action(_adapter *padapter, union recv_frame *precv_frame)
|
||||
/* Figure 8-438 radio measurement request frame Action field format */
|
||||
/* Category = pframe_body[0] = 5 (Radio Measurement) */
|
||||
action_code = pframe_body[1];
|
||||
diag_token = pframe_body[2];
|
||||
|
||||
#if (RM_MORE_DBG_MSG)
|
||||
diag_token = pframe_body[2];
|
||||
RTW_INFO("RM: %s radio_action=%x, diag_token=%x\n", __func__,
|
||||
action_code, diag_token);
|
||||
#endif
|
||||
@@ -1111,7 +1130,7 @@ static u8 *rm_gen_bcn_detail_elem(_adapter *padapter, u8 *pframe,
|
||||
{
|
||||
WLAN_BSSID_EX *pbss = &pnetwork->network;
|
||||
unsigned int my_len;
|
||||
int j, k, len;
|
||||
int j = 0, k, len;
|
||||
u8 *plen;
|
||||
u8 *ptr;
|
||||
u8 val8, eid;
|
||||
@@ -1268,7 +1287,7 @@ u8 rm_bcn_req_cond_mach(struct rm_obj *prm, struct wlan_network *pnetwork)
|
||||
static u8 *rm_gen_bcn_rep_ie (struct rm_obj *prm,
|
||||
u8 *pframe, struct wlan_network *pnetwork, unsigned int *fr_len)
|
||||
{
|
||||
int snr, i;
|
||||
int snr, i = 0;
|
||||
u8 val8, *plen;
|
||||
u16 val16;
|
||||
u32 val32;
|
||||
@@ -1854,8 +1873,6 @@ static u8 *rm_gen_bcn_req_s_elem(_adapter *padapter,
|
||||
*/
|
||||
l = MIN(32, (int)prm->q.opt.bcn.ssid.SsidLength);
|
||||
|
||||
l = (int)prm->q.opt.bcn.ssid.SsidLength;
|
||||
|
||||
if (l > 32)
|
||||
RTW_ERR("RM: %s SSID len over size %d! skip it!\n",__func__, l);
|
||||
|
||||
@@ -2516,7 +2533,8 @@ int rm_send_bcn_reqs(_adapter *padapter, u8 *sta_addr, u8 op_class, u8 ch,
|
||||
struct sta_info *psta;
|
||||
struct _RT_OPERATING_CLASS *prpt;
|
||||
void *ptr;
|
||||
int i,j,sz;
|
||||
/* int i,j,sz; */
|
||||
int i, sz;
|
||||
u8 bcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
|
||||
@@ -2567,7 +2585,7 @@ int rm_send_bcn_reqs(_adapter *padapter, u8 *sta_addr, u8 op_class, u8 ch,
|
||||
|
||||
if (n_ap_ch_rpt > 0) {
|
||||
prm->q.opt.bcn.ap_ch_rpt_num = n_ap_ch_rpt;
|
||||
j = 0;
|
||||
/* j = 0; */
|
||||
for (i = 0; i < n_ap_ch_rpt; i++) {
|
||||
prpt = rpt++;
|
||||
if (prpt == NULL)
|
||||
@@ -2735,7 +2753,7 @@ static void rm_dbg_list_meas(_adapter *padapter, char *s)
|
||||
int meas_amount;
|
||||
_irqL irqL;
|
||||
struct rm_obj *prm;
|
||||
struct sta_info *psta;
|
||||
/* struct sta_info *psta; */
|
||||
struct rm_priv *prmpriv = &padapter->rmpriv;
|
||||
_queue *queue = &prmpriv->rm_queue;
|
||||
_list *plist, *phead;
|
||||
@@ -2751,7 +2769,7 @@ static void rm_dbg_list_meas(_adapter *padapter, char *s)
|
||||
prm = LIST_CONTAINOR(plist, struct rm_obj, list);
|
||||
meas_amount++;
|
||||
plist = get_next(plist);
|
||||
psta = prm->psta;
|
||||
/* psta = prm->psta; */
|
||||
sprintf(pstr(s), "=========================================\n");
|
||||
|
||||
rm_dbg_show_meas(prm, s);
|
||||
|
||||
@@ -572,30 +572,31 @@ static int rm_state_idle(struct rm_obj *prm, enum RM_EV_ID evid)
|
||||
} /* switch() */
|
||||
|
||||
if (prm->rmid & RM_MASTER) {
|
||||
if (rm_issue_meas_req(prm) == _SUCCESS)
|
||||
if (rm_issue_meas_req(prm) == _SUCCESS) {
|
||||
rm_state_goto(prm, RM_ST_WAIT_MEAS);
|
||||
else
|
||||
} else {
|
||||
issue_null_reply(prm);
|
||||
rm_state_goto(prm, RM_ST_END);
|
||||
return _SUCCESS;
|
||||
}
|
||||
} else {
|
||||
rm_state_goto(prm, RM_ST_DO_MEAS);
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
if (prm->p.m_mode) {
|
||||
issue_null_reply(prm);
|
||||
rm_state_goto(prm, RM_ST_END);
|
||||
return _SUCCESS;
|
||||
}
|
||||
if (prm->q.rand_intvl) {
|
||||
/* get low tsf to generate random interval */
|
||||
#ifdef CONFIG_RTL8814B
|
||||
val32 = rtw_read32(padapter, REG_TSFTR_LOW_8814B);
|
||||
#else
|
||||
val32 = rtw_read32(padapter, REG_TSFTR);
|
||||
#endif
|
||||
val32 = val32 % prm->q.rand_intvl;
|
||||
RTW_INFO("RM: rmid=%x rand_intval=%d, rand=%d\n",
|
||||
prm->rmid, (int)prm->q.rand_intvl,val32);
|
||||
rm_set_clock(prm, prm->q.rand_intvl,
|
||||
RM_EV_delay_timer_expire);
|
||||
return _SUCCESS;
|
||||
} else {
|
||||
rm_state_goto(prm, RM_ST_DO_MEAS);
|
||||
}
|
||||
break;
|
||||
case RM_EV_delay_timer_expire:
|
||||
@@ -629,6 +630,7 @@ static int rm_state_do_meas(struct rm_obj *prm, enum RM_EV_ID evid)
|
||||
if (prm->q.m_mode == bcn_req_bcn_table) {
|
||||
RTW_INFO("RM: rmid=%x Beacon table\n",
|
||||
prm->rmid);
|
||||
rm_get_chset(prm);
|
||||
_rm_post_event(padapter, prm->rmid,
|
||||
RM_EV_survey_done);
|
||||
return _SUCCESS;
|
||||
@@ -873,9 +875,9 @@ static int rm_state_recv_report(struct rm_obj *prm, enum RM_EV_ID evid)
|
||||
if (val8) {
|
||||
RTW_INFO("RM: rmid=%x peer reject (%s repeat=%d)\n",
|
||||
prm->rmid,
|
||||
val8|MEAS_REP_MOD_INCAP?"INCAP":
|
||||
val8|MEAS_REP_MOD_REFUSE?"REFUSE":
|
||||
val8|MEAS_REP_MOD_LATE?"LATE":"",
|
||||
val8&MEAS_REP_MOD_INCAP?"INCAP":
|
||||
val8&MEAS_REP_MOD_REFUSE?"REFUSE":
|
||||
val8&MEAS_REP_MOD_LATE?"LATE":"",
|
||||
prm->p.rpt);
|
||||
rm_state_goto(prm, RM_ST_END);
|
||||
return _SUCCESS;
|
||||
@@ -976,9 +978,9 @@ char *rm_event_name(enum RM_EV_ID evid)
|
||||
case RM_EV_max:
|
||||
return "RM_EV_max";
|
||||
default:
|
||||
return "RM_EV_unknown";
|
||||
break;
|
||||
}
|
||||
return "UNKNOWN";
|
||||
return "RM_EV_unknown";
|
||||
}
|
||||
|
||||
static void rm_state_initial(struct rm_obj *prm)
|
||||
|
||||
@@ -386,6 +386,7 @@ int rm_get_path_a_max_tx_power(_adapter *adapter, s8 *path_a)
|
||||
s8 max_pwr[RF_PATH_MAX], pwr;
|
||||
|
||||
|
||||
_rtw_memset(max_pwr, -127, RF_PATH_MAX);
|
||||
band = hal_data->current_band_type;
|
||||
bw = hal_data->current_channel_bw;
|
||||
ch = hal_data->current_channel;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2020 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2023 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -55,9 +55,7 @@ static int rtw_ro_ch_handler(_adapter *adapter, u8 *buf)
|
||||
struct rtw_roch_parm *roch_parm = (struct rtw_roch_parm *)buf;
|
||||
struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(adapter);
|
||||
struct roch_info *prochinfo = &adapter->rochinfo;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
#endif
|
||||
u8 ready_on_channel = _FALSE;
|
||||
u8 remain_ch;
|
||||
unsigned int duration;
|
||||
@@ -70,8 +68,11 @@ static int rtw_ro_ch_handler(_adapter *adapter, u8 *buf)
|
||||
remain_ch = (u8)ieee80211_frequency_to_channel(roch_parm->ch.center_freq);
|
||||
duration = roch_parm->duration;
|
||||
|
||||
RTW_INFO(FUNC_ADPT_FMT" ch:%u duration:%d, cookie:0x%llx\n"
|
||||
, FUNC_ADPT_ARG(adapter), remain_ch, roch_parm->duration, roch_parm->cookie);
|
||||
RTW_INFO(FUNC_ADPT_FMT" ch:%u duration:%d, cookie:0x%llx, "
|
||||
"op_ch:%u, union_ch:%u, cur_ch:%u\n",
|
||||
FUNC_ADPT_ARG(adapter), remain_ch, roch_parm->duration, roch_parm->cookie,
|
||||
rtw_get_oper_ch(adapter), rtw_mi_get_union_chan(adapter),
|
||||
pmlmeext->cur_channel);
|
||||
|
||||
if (roch_parm->wdev && roch_parm->cookie) {
|
||||
if (prochinfo->ro_ch_wdev != roch_parm->wdev) {
|
||||
@@ -94,8 +95,8 @@ static int rtw_ro_ch_handler(_adapter *adapter, u8 *buf)
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (rtw_mi_check_status(adapter, MI_LINKED) && (0 != rtw_mi_get_union_chan(adapter))) {
|
||||
if ((remain_ch != rtw_mi_get_union_chan(adapter)) && !check_fwstate(&adapter->mlmepriv, WIFI_ASOC_STATE)) {
|
||||
if (remain_ch != pmlmeext->cur_channel
|
||||
if (remain_ch != rtw_get_oper_ch(adapter)) {
|
||||
if (rtw_get_oper_ch(adapter) == rtw_mi_get_union_chan(adapter)
|
||||
#ifdef RTW_ROCH_BACK_OP
|
||||
|| ATOMIC_READ(&pwdev_priv->switch_ch_to) == 1
|
||||
#endif
|
||||
@@ -118,6 +119,13 @@ static int rtw_ro_ch_handler(_adapter *adapter, u8 *buf)
|
||||
{
|
||||
if (remain_ch != rtw_get_oper_ch(adapter))
|
||||
ready_on_channel = _TRUE;
|
||||
|
||||
/* if connected and remain_ch is not same as AP's channel
|
||||
* Note : cur_channel is AP's channel, oper_channel is the channel driver is now on.
|
||||
*/
|
||||
if (check_fwstate(&adapter->mlmepriv, WIFI_ASOC_STATE) &&
|
||||
remain_ch != pmlmeext->cur_channel)
|
||||
rtw_leave_opch(adapter);
|
||||
}
|
||||
|
||||
if (ready_on_channel == _TRUE) {
|
||||
|
||||
@@ -384,14 +384,23 @@ int rtw_rson_isupdate_roamcan(struct mlme_priv *mlme
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
void rtw_rson_show_survey_info(struct seq_file *m, _list *plist, _list *phead)
|
||||
void rtw_rson_show_survey_info(void *sel, _adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
_queue *queue = &(pmlmepriv->scanned_queue);
|
||||
_irqL irqL;
|
||||
_list *plist, *phead;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
struct rtw_rson_struct rson_data;
|
||||
s16 rson_score;
|
||||
u16 index = 0;
|
||||
|
||||
RTW_PRINT_SEL(m, "%5s %-17s %3s %5s %14s %10s %-3s %5s %32s\n", "index", "bssid", "ch", "id", "hop_cnt", "loading", "RSSI", "score", "ssid");
|
||||
RTW_PRINT_SEL(sel, "%5s %-17s %3s %5s %14s %10s %-3s %5s %32s\n", "index", "bssid", "ch", "id", "hop_cnt", "loading", "RSSI", "score", "ssid");
|
||||
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
|
||||
phead = get_list_head(queue);
|
||||
plist = get_next(phead);
|
||||
while (1) {
|
||||
if (rtw_end_of_queue_search(phead, plist) == _TRUE)
|
||||
break;
|
||||
@@ -404,7 +413,7 @@ void rtw_rson_show_survey_info(struct seq_file *m, _list *plist, _list *phead)
|
||||
rson_score = 0;
|
||||
if (rtw_get_rson_struct(&(pnetwork->network), &rson_data) == _TRUE)
|
||||
rson_score = rtw_cal_rson_score(&rson_data, pnetwork->network.Rssi);
|
||||
RTW_PRINT_SEL(m, "%5d "MAC_FMT" %3d 0x%08x %6d %10d %6d %6d %32s\n",
|
||||
RTW_PRINT_SEL(sel, "%5d "MAC_FMT" %3d 0x%08x %6d %10d %6d %6d %32s\n",
|
||||
++index,
|
||||
MAC_ARG(pnetwork->network.MacAddress),
|
||||
pnetwork->network.Configuration.DSConfig,
|
||||
@@ -415,8 +424,9 @@ void rtw_rson_show_survey_info(struct seq_file *m, _list *plist, _list *phead)
|
||||
rson_score,
|
||||
pnetwork->network.Ssid.Ssid);
|
||||
plist = get_next(plist);
|
||||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -26,27 +26,24 @@ static const char *_security_type_str[] = {
|
||||
"WEP104",
|
||||
"SMS4",
|
||||
"GCMP",
|
||||
};
|
||||
|
||||
static const char *_security_type_bip_str[] = {
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
"BIP_CMAC_128",
|
||||
"BIP_GMAC_128",
|
||||
"BIP_GMAC_256",
|
||||
"BIP_CMAC_256",
|
||||
#endif
|
||||
};
|
||||
|
||||
const char *security_type_str(u8 value)
|
||||
{
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if ((_BIP_MAX_ > value) && (value >= _BIP_CMAC_128_))
|
||||
return _security_type_bip_str[value & ~_SEC_TYPE_BIT_];
|
||||
#endif
|
||||
|
||||
if (_CCMP_256_ == value)
|
||||
return "CCMP_256";
|
||||
if (_GCMP_256_ == value)
|
||||
return "GCMP_256";
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (_BIP_CMAC_256_ == value)
|
||||
return "BIP_CMAC_256";
|
||||
if (_BIP_GMAC_256_ == value)
|
||||
return "BIP_GMAC_256";
|
||||
#endif
|
||||
if (_SEC_TYPE_MAX_ > value)
|
||||
return _security_type_str[value];
|
||||
|
||||
@@ -735,7 +732,7 @@ u32 rtw_tkip_encrypt(_adapter *padapter, u8 *pxmitframe)
|
||||
u8 hw_hdr_offset = 0;
|
||||
struct arc4context mycontext;
|
||||
sint curfragnum, length;
|
||||
u32 prwskeylen;
|
||||
/*u32 prwskeylen;*/
|
||||
|
||||
u8 *pframe, *payload, *iv, *prwskey;
|
||||
union pn48 dot11txpn;
|
||||
@@ -791,7 +788,7 @@ u32 rtw_tkip_encrypt(_adapter *padapter, u8 *pxmitframe)
|
||||
prwskey = pattrib->dot118021x_UncstKey.skey;
|
||||
}
|
||||
|
||||
prwskeylen = 16;
|
||||
/*prwskeylen = 16;*/
|
||||
|
||||
for (curfragnum = 0; curfragnum < pattrib->nr_frags; curfragnum++) {
|
||||
iv = pframe + pattrib->hdrlen;
|
||||
@@ -838,10 +835,8 @@ u32 rtw_tkip_encrypt(_adapter *padapter, u8 *pxmitframe)
|
||||
|
||||
}
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* The hlen isn't include the IV */
|
||||
u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe)
|
||||
{
|
||||
@@ -853,7 +848,7 @@ u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe)
|
||||
u8 crc[4];
|
||||
struct arc4context mycontext;
|
||||
sint length;
|
||||
u32 prwskeylen;
|
||||
/*u32 prwskeylen;*/
|
||||
|
||||
u8 *pframe, *payload, *iv, *prwskey;
|
||||
union pn48 dot11txpn;
|
||||
@@ -911,10 +906,10 @@ u32 rtw_tkip_decrypt(_adapter *padapter, u8 *precvframe)
|
||||
/* RTW_INFO("rx bc/mc packets, to perform sw rtw_tkip_decrypt\n"); */
|
||||
/* prwskey = psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey; */
|
||||
prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey;
|
||||
prwskeylen = 16;
|
||||
/*prwskeylen = 16;*/
|
||||
} else {
|
||||
prwskey = &stainfo->dot118021x_UncstKey.skey[0];
|
||||
prwskeylen = 16;
|
||||
/*prwskeylen = 16;*/
|
||||
}
|
||||
|
||||
iv = pframe + prxattrib->hdrlen;
|
||||
@@ -2870,3 +2865,66 @@ BIP_exit:
|
||||
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
/* IV is encryption header index of packet,
|
||||
* PN is sequence number after correct mapping.
|
||||
*/
|
||||
u8 rtw_iv_to_pn(u8 *iv, u8 *pn, u8 *key_id, u32 enc_algo)
|
||||
{
|
||||
/* iv and pn must be Little Endian format */
|
||||
switch (enc_algo) {
|
||||
case _TKIP_:
|
||||
*(pn) = *(iv + 2);
|
||||
*(pn + 1) = *(iv);
|
||||
break;
|
||||
case _AES_:
|
||||
case _GCMP_:
|
||||
case _CCMP_256_:
|
||||
case _GCMP_256_:
|
||||
*(pn) = *(iv);
|
||||
*(pn + 1) = *(iv + 1);
|
||||
break;
|
||||
default:
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
*(pn + 2) = *(iv + 4);
|
||||
*(pn + 3) = *(iv + 5);
|
||||
*(pn + 4) = *(iv + 6);
|
||||
*(pn + 5) = *(iv + 7);
|
||||
|
||||
if (key_id)
|
||||
*key_id = *(iv + 3) >> 6;
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
u8 rtw_pn_to_iv(u8 *pn, u8 *iv, u8 key_id, u32 enc_algo)
|
||||
{
|
||||
/* iv and pn must be Little Endian format */
|
||||
switch (enc_algo) {
|
||||
case _TKIP_:
|
||||
*(iv) = *(pn + 1);
|
||||
*(iv + 1) = (*(pn + 1) | 0x20) & 0x7F;
|
||||
*(iv + 2) = *(pn);
|
||||
break;
|
||||
case _AES_:
|
||||
case _GCMP_:
|
||||
case _CCMP_256_:
|
||||
case _GCMP_256_:
|
||||
*(iv) = *(pn);
|
||||
*(iv + 1) = *(pn + 1);
|
||||
*(iv + 2) = 0;
|
||||
break;
|
||||
default:
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
*(iv + 3) = BIT(5) | ((key_id & 0x3) << 6);
|
||||
*(iv + 4) = *(pn + 2);
|
||||
*(iv + 5) = *(pn + 3);
|
||||
*(iv + 6) = *(pn + 4);
|
||||
*(iv + 7) = *(pn + 5);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -282,11 +282,18 @@ void sreset_reset(_adapter *padapter)
|
||||
systime start = rtw_get_current_time();
|
||||
struct dvobj_priv *psdpriv = padapter->dvobj;
|
||||
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
|
||||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
u8 ips_mode_bk;
|
||||
u8 ips_changed = _FALSE;
|
||||
|
||||
RTW_INFO("%s\n", __FUNCTION__);
|
||||
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
if (!rtw_is_hw_init_completed(padapter)){
|
||||
RTW_INFO("hardware init not yet done\n");
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "SRESET");
|
||||
@@ -298,9 +305,34 @@ void sreset_reset(_adapter *padapter)
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
|
||||
rtw_mi_sreset_adapter_hdl(padapter, _FALSE);/*sreset_stop_adapter*/
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
/* 1. If driver state is in ips, leaving ips at first */
|
||||
if (pwrpriv->rf_pwrstate == rf_off || pwrpriv->bips_processing == _TRUE) {
|
||||
if (ATOMIC_READ(&(pcmdpriv->cmdthd_running)) == _TRUE) {
|
||||
if (rtw_ips_ctrl_wk_cmd(padapter, IPS_CTRL_LEAVE_SRESET, -1,
|
||||
RTW_CMDF_DIRECTLY) != _SUCCESS) {
|
||||
RTW_ERR(FUNC_ADPT_FMT" Fail to leave IPS (current mode=%d).\n"
|
||||
, FUNC_ADPT_ARG(padapter), pwrpriv->ips_mode_req);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 2. If current ips mode is NOT IPS_NORMAL, replacing it to IPS_NORMAL */
|
||||
/* in order to use card disable to execute sreset. */
|
||||
if (pwrpriv->ips_mode_req != IPS_NORMAL) {
|
||||
ips_mode_bk = pwrpriv->ips_mode_req;
|
||||
pwrpriv->ips_mode_req = IPS_NORMAL;
|
||||
ips_changed = _TRUE;
|
||||
}
|
||||
|
||||
/* 3. Do card disable/enable to achieve sreset. */
|
||||
_ips_enter(padapter);
|
||||
_ips_leave(padapter);
|
||||
|
||||
/* 4. Restore the original ips mode setting. */
|
||||
if (ips_changed)
|
||||
pwrpriv->ips_mode_req = ips_mode_bk;
|
||||
#endif
|
||||
#if defined(CONFIG_AP_MODE) && defined(CONFIG_CONCURRENT_MODE)
|
||||
rtw_mi_ap_info_restore(padapter);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2019 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -190,15 +190,24 @@ void dump_st_ctl(void *sel, struct st_ctl_t *st_ctl)
|
||||
|
||||
}
|
||||
|
||||
void _rtw_init_stainfo(struct sta_info *psta);
|
||||
void _rtw_init_stainfo(struct sta_info *psta)
|
||||
static void _rtw_init_stainfo(struct sta_priv *stapriv, struct sta_info *psta)
|
||||
{
|
||||
bool pool_init = psta->padapter ? false : true; /* called by _rtw_init_sta_priv() */
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
if (!pool_init) {
|
||||
rtw_warn_on(!rtw_is_list_empty(&psta->asoc_list));
|
||||
rtw_warn_on(!rtw_is_list_empty(&psta->auth_list));
|
||||
}
|
||||
#endif
|
||||
|
||||
_rtw_memset((u8 *)psta, 0, sizeof(struct sta_info));
|
||||
|
||||
psta->padapter = stapriv->padapter;
|
||||
|
||||
_rtw_spinlock_init(&psta->lock);
|
||||
_rtw_init_listhead(&psta->list);
|
||||
_rtw_init_listhead(&psta->hash_list);
|
||||
/* _rtw_init_listhead(&psta->asoc_list); */
|
||||
/* _rtw_init_listhead(&psta->sleep_list); */
|
||||
/* _rtw_init_listhead(&psta->wakeup_list); */
|
||||
|
||||
@@ -214,6 +223,9 @@ void _rtw_init_stainfo(struct sta_info *psta)
|
||||
_rtw_init_listhead(&psta->auth_list);
|
||||
psta->bpairwise_key_installed = _FALSE;
|
||||
|
||||
#ifdef CONFIG_RTW_80211R_AP
|
||||
rtw_ft_peer_info_init(psta);
|
||||
#endif
|
||||
#ifdef CONFIG_RTW_80211R
|
||||
psta->ft_pairwise_key_installed = _FALSE;
|
||||
#endif
|
||||
@@ -226,6 +238,9 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
|
||||
{
|
||||
_adapter *adapter = container_of(pstapriv, _adapter, stapriv);
|
||||
struct macid_ctl_t *macid_ctl = adapter_to_macidctl(adapter);
|
||||
#ifdef CONFIG_AP_MODE
|
||||
struct registry_priv *regsty = adapter_to_regsty(adapter);
|
||||
#endif
|
||||
struct sta_info *psta;
|
||||
s32 i;
|
||||
u32 ret = _FAIL;
|
||||
@@ -255,7 +270,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
|
||||
|
||||
|
||||
for (i = 0; i < NUM_STA; i++) {
|
||||
_rtw_init_stainfo(psta);
|
||||
_rtw_init_stainfo(pstapriv, psta);
|
||||
|
||||
_rtw_init_listhead(&(pstapriv->sta_hash[i]));
|
||||
|
||||
@@ -268,6 +283,8 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
pstapriv->max_aid = macid_ctl->num;
|
||||
if (regsty->max_ap_assoc_sta)
|
||||
pstapriv->max_aid = rtw_min(pstapriv->max_aid, regsty->max_ap_assoc_sta);
|
||||
pstapriv->rr_aid = 0;
|
||||
pstapriv->started_aid = 1;
|
||||
pstapriv->sta_aid = rtw_zmalloc(pstapriv->max_aid * sizeof(struct sta_info *));
|
||||
@@ -304,6 +321,8 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
|
||||
_rtw_memset(pstapriv->atmel_rc_pattern, 0, ETH_ALEN);
|
||||
#endif
|
||||
pstapriv->max_num_sta = NUM_STA;
|
||||
if (regsty->max_ap_assoc_sta)
|
||||
pstapriv->max_num_sta = rtw_min(pstapriv->max_num_sta, regsty->max_ap_assoc_sta);
|
||||
|
||||
#if CONFIG_RTW_MACADDR_ACL
|
||||
for (i = 0; i < RTW_ACL_PERIOD_NUM; i++)
|
||||
@@ -390,9 +409,7 @@ void rtw_mfree_stainfo(struct sta_info *psta);
|
||||
void rtw_mfree_stainfo(struct sta_info *psta)
|
||||
{
|
||||
|
||||
if (&psta->lock != NULL)
|
||||
_rtw_spinlock_free(&psta->lock);
|
||||
|
||||
_rtw_spinlock_free(&psta->lock);
|
||||
_rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
|
||||
_rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv);
|
||||
|
||||
@@ -462,6 +479,10 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
|
||||
int i;
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info , hash_list);
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
_cancel_timer_ex(&psta->dot11w_expire_timer);
|
||||
#endif
|
||||
_cancel_timer_ex(&psta->addba_retry_timer);
|
||||
plist = get_next(plist);
|
||||
|
||||
for (i = 0; i < 16 ; i++) {
|
||||
@@ -539,9 +560,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr)
|
||||
rtw_list_delete(&(psta->list));
|
||||
|
||||
/* _exit_critical_bh(&(pfree_sta_queue->lock), &irqL); */
|
||||
_rtw_init_stainfo(psta);
|
||||
|
||||
psta->padapter = pstapriv->padapter;
|
||||
_rtw_init_stainfo(pstapriv, psta);
|
||||
|
||||
_rtw_memcpy(psta->cmn.mac_addr, hwaddr, ETH_ALEN);
|
||||
|
||||
@@ -748,7 +767,7 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
|
||||
|
||||
#ifdef CONFIG_RTW_MGMT_QUEUE
|
||||
/* mgmt */
|
||||
rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->mgmt_q.sta_pending);
|
||||
rtw_free_mgmt_xmitframe_queue(pxmitpriv, &pstaxmitpriv->mgmt_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->mgmt_q.tx_pending));
|
||||
phwxmit = pxmitpriv->hwxmits + 4;
|
||||
phwxmit->accnt -= pstaxmitpriv->mgmt_q.qcnt;
|
||||
@@ -827,12 +846,11 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
|
||||
rtw_release_macid(pstapriv->padapter, psta);
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
rtw_stapriv_asoc_list_lock(pstapriv);
|
||||
if (!rtw_is_list_empty(&psta->asoc_list))
|
||||
rtw_stapriv_asoc_list_del(pstapriv, psta);
|
||||
rtw_stapriv_asoc_list_unlock(pstapriv);
|
||||
|
||||
/*
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
|
||||
*/
|
||||
_enter_critical_bh(&pstapriv->auth_list_lock, &irqL0);
|
||||
if (!rtw_is_list_empty(&psta->auth_list)) {
|
||||
rtw_list_delete(&psta->auth_list);
|
||||
@@ -875,10 +893,14 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
|
||||
psta->under_exist_checking = 0;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTW_80211R_AP
|
||||
rtw_ft_peer_info_free(psta);
|
||||
#endif
|
||||
#endif /* CONFIG_AP_MODE */
|
||||
|
||||
rtw_st_ctl_deinit(&psta->st_ctl);
|
||||
|
||||
psta->is_freeing = false;
|
||||
if (is_pre_link_sta == _FALSE) {
|
||||
_rtw_spinlock_free(&psta->lock);
|
||||
|
||||
@@ -946,22 +968,15 @@ exit:
|
||||
}
|
||||
|
||||
/* any station allocated can be searched by hash list */
|
||||
struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr)
|
||||
static struct sta_info *_rtw_get_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr, bool to_free)
|
||||
{
|
||||
|
||||
_irqL irqL;
|
||||
|
||||
_list *plist, *phead;
|
||||
|
||||
struct sta_info *psta = NULL;
|
||||
|
||||
u32 index;
|
||||
|
||||
const u8 *addr;
|
||||
|
||||
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
|
||||
if (hwaddr == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -977,13 +992,13 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr)
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) {
|
||||
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
||||
if ((_rtw_memcmp(psta->cmn.mac_addr, addr, ETH_ALEN)) == _TRUE) {
|
||||
/* if found the matched address */
|
||||
if (to_free)
|
||||
psta->is_freeing = true;
|
||||
break;
|
||||
}
|
||||
psta = NULL;
|
||||
@@ -991,35 +1006,56 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr)
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
return psta;
|
||||
|
||||
return psta;
|
||||
}
|
||||
|
||||
struct sta_info *rtw_get_stainfo(struct sta_priv *stapriv, const u8 *hwaddr)
|
||||
{
|
||||
return _rtw_get_stainfo(stapriv, hwaddr, false);
|
||||
}
|
||||
|
||||
struct sta_info *rtw_get_stainfo_to_free(struct sta_priv *stapriv, const u8 *hwaddr)
|
||||
{
|
||||
return _rtw_get_stainfo(stapriv, hwaddr, true);
|
||||
}
|
||||
|
||||
void rtw_stainfo_claim_to_free_no_lock(struct sta_info *sta)
|
||||
{
|
||||
if (!rtw_is_list_empty(&sta->hash_list))
|
||||
sta->is_freeing = true;
|
||||
}
|
||||
|
||||
void rtw_stainfo_claim_to_free(struct sta_info *sta)
|
||||
{
|
||||
_rtw_spinlock_bh(&sta->padapter->stapriv.sta_hash_lock);
|
||||
rtw_stainfo_claim_to_free_no_lock(sta);
|
||||
_rtw_spinunlock_bh(&sta->padapter->stapriv.sta_hash_lock);
|
||||
}
|
||||
|
||||
u32 rtw_init_bcmc_stainfo(_adapter *padapter)
|
||||
{
|
||||
|
||||
struct sta_info *psta;
|
||||
struct tx_servq *ptxservq;
|
||||
u32 res = _SUCCESS;
|
||||
/*struct tx_servq *ptxservq;*/
|
||||
NDIS_802_11_MAC_ADDRESS bcast_addr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
|
||||
psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
|
||||
|
||||
if (psta == NULL) {
|
||||
res = _FAIL;
|
||||
if (!psta) {
|
||||
RTW_ERR(FUNC_ADPT_FMT ": missing stainfo of " MAC_FMT " !\n",
|
||||
FUNC_ADPT_ARG(padapter), MAC_ARG(bcast_addr));
|
||||
goto exit;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BEAMFORMING
|
||||
psta->cmn.bf_info.g_id = 63;
|
||||
psta->cmn.bf_info.p_aid = 0;
|
||||
#endif
|
||||
|
||||
/*
|
||||
ptxservq = &(psta->sta_xmitpriv.be_q);
|
||||
|
||||
/*
|
||||
_enter_critical(&pstapending->lock, &irqL0);
|
||||
|
||||
if (rtw_is_list_empty(&ptxservq->tx_pending))
|
||||
@@ -1030,10 +1066,8 @@ u32 rtw_init_bcmc_stainfo(_adapter *padapter)
|
||||
|
||||
exit:
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
struct sta_info *rtw_get_bcmc_stainfo(_adapter *padapter)
|
||||
{
|
||||
struct sta_info *psta;
|
||||
@@ -1098,6 +1132,39 @@ void dump_aid_status(void *sel, _adapter *adapter)
|
||||
|
||||
rtw_mfree(aid_bmp, stapriv->aid_bmp_len);
|
||||
}
|
||||
|
||||
void rtw_stapriv_asoc_list_lock(struct sta_priv *stapriv)
|
||||
{
|
||||
_rtw_spinlock_bh(&stapriv->asoc_list_lock);
|
||||
}
|
||||
|
||||
void rtw_stapriv_asoc_list_unlock(struct sta_priv *stapriv)
|
||||
{
|
||||
_rtw_spinunlock_bh(&stapriv->asoc_list_lock);
|
||||
}
|
||||
|
||||
void rtw_stapriv_asoc_list_add(struct sta_priv *stapriv, struct sta_info *sta)
|
||||
{
|
||||
rtw_warn_on(!_rtw_spin_is_locked(&stapriv->asoc_list_lock));
|
||||
rtw_list_insert_tail(&sta->asoc_list, &stapriv->asoc_list);
|
||||
stapriv->asoc_list_cnt++;
|
||||
#ifdef CONFIG_RTW_TOKEN_BASED_XMIT
|
||||
if (sta->tbtx_enable)
|
||||
stapriv->tbtx_asoc_list_cnt++;
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtw_stapriv_asoc_list_del(struct sta_priv *stapriv, struct sta_info *sta)
|
||||
{
|
||||
rtw_warn_on(!_rtw_spin_is_locked(&stapriv->asoc_list_lock));
|
||||
rtw_list_delete(&sta->asoc_list);
|
||||
stapriv->asoc_list_cnt--;
|
||||
#ifdef CONFIG_RTW_TOKEN_BASED_XMIT
|
||||
if (sta->tbtx_enable)
|
||||
stapriv->tbtx_asoc_list_cnt--;
|
||||
#endif
|
||||
STA_SET_MESH_PLINK(sta, NULL);
|
||||
}
|
||||
#endif /* CONFIG_AP_MODE */
|
||||
|
||||
#if CONFIG_RTW_MACADDR_ACL
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*****************************************************************************/
|
||||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
#include "crypto/aes.h"
|
||||
#include <crypto/aes.h>
|
||||
#include "crypto/aes_siv.h"
|
||||
#include "crypto/aes_wrap.h"
|
||||
#include "crypto/sha256.h"
|
||||
|
||||
@@ -522,7 +522,7 @@ u8 *rtw_tdls_set_ht_cap(_adapter *padapter, u8 *pframe, struct pkt_attrib *pattr
|
||||
padapter->mlmepriv.htpriv.sgi_40m = _FALSE;
|
||||
}
|
||||
|
||||
rtw_restructure_ht_ie(padapter, NULL, pframe, 0, &(pattrib->pktlen), padapter->mlmeextpriv.cur_channel, NULL);
|
||||
rtw_restructure_ht_ie(padapter, NULL, pframe, 0, &(pattrib->pktlen), padapter->mlmeextpriv.cur_channel);
|
||||
|
||||
return pframe + pattrib->pktlen;
|
||||
}
|
||||
@@ -704,22 +704,7 @@ u8 *rtw_tdls_set_vht_op_mode_notify(_adapter *padapter, u8 *pframe, struct pkt_a
|
||||
|
||||
u8 *rtw_tdls_set_sup_ch(_adapter *adapter, u8 *pframe, struct pkt_attrib *pattrib)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
u8 sup_ch[30 * 2] = {0x00}, ch_set_idx = 0, sup_ch_idx = 2;
|
||||
|
||||
while (ch_set_idx < rfctl->max_chan_nums && rfctl->channel_set[ch_set_idx].ChannelNum != 0) {
|
||||
if (rfctl->channel_set[ch_set_idx].ChannelNum <= 14) {
|
||||
/* TODO: fix 2.4G supported channel when channel doesn't start from 1 and continuous */
|
||||
sup_ch[0] = 1; /* First channel number */
|
||||
sup_ch[1] = rfctl->channel_set[ch_set_idx].ChannelNum; /* Number of channel */
|
||||
} else {
|
||||
sup_ch[sup_ch_idx++] = rfctl->channel_set[ch_set_idx].ChannelNum;
|
||||
sup_ch[sup_ch_idx++] = 1;
|
||||
}
|
||||
ch_set_idx++;
|
||||
}
|
||||
|
||||
return rtw_set_ie(pframe, _SUPPORTED_CH_IE_, sup_ch_idx, sup_ch, &(pattrib->pktlen));
|
||||
return rtw_chset_set_spt_chs_ie(adapter_to_chset(adapter), pframe, &(pattrib->pktlen));
|
||||
}
|
||||
|
||||
u8 *rtw_tdls_set_rsnie(struct tdls_txmgmt *ptxmgmt, u8 *pframe, struct pkt_attrib *pattrib, int init, struct sta_info *ptdls_sta)
|
||||
@@ -1839,7 +1824,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
_irqL irqL;
|
||||
struct rx_pkt_attrib *prx_pkt_attrib = &precv_frame->u.hdr.attrib;
|
||||
u8 *prsnie, *ppairwise_cipher;
|
||||
u8 *pftie = NULL, *prsnie, *ppairwise_cipher;
|
||||
u8 i, k;
|
||||
u8 ccmp_included = 0, rsnie_included = 0;
|
||||
u16 j, pairwise_count;
|
||||
@@ -1938,19 +1923,18 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct
|
||||
rsnie_included = 1;
|
||||
if (prx_pkt_attrib->encrypt) {
|
||||
prsnie = (u8 *)pIE;
|
||||
if (pIE->Length <= sizeof(ptdls_sta->TDLS_RSNIE)) {
|
||||
/* Check CCMP pairwise_cipher presence. */
|
||||
ppairwise_cipher = prsnie + 10;
|
||||
_rtw_memcpy(ptdls_sta->TDLS_RSNIE, pIE->data, pIE->Length);
|
||||
pairwise_count = *(u16 *)(ppairwise_cipher - 2);
|
||||
for (k = 0; k < pairwise_count; k++) {
|
||||
if (_rtw_memcmp(ppairwise_cipher + 4 * k, RSN_CIPHER_SUITE_CCMP, 4) == _TRUE)
|
||||
ccmp_included = 1;
|
||||
}
|
||||
|
||||
if (ccmp_included == 0)
|
||||
txmgmt.status_code = _STATS_INVALID_RSNIE_;
|
||||
/* Check CCMP pairwise_cipher presence. */
|
||||
ppairwise_cipher = prsnie + 10;
|
||||
_rtw_memcpy(ptdls_sta->TDLS_RSNIE, pIE->data,
|
||||
(pIE->Length <= sizeof(ptdls_sta->TDLS_RSNIE) ? pIE->Length : sizeof(ptdls_sta->TDLS_RSNIE)));
|
||||
pairwise_count = *(u16 *)(ppairwise_cipher - 2);
|
||||
for (k = 0; k < pairwise_count; k++) {
|
||||
if (_rtw_memcmp(ppairwise_cipher + 4 * k, RSN_CIPHER_SUITE_CCMP, 4) == _TRUE)
|
||||
ccmp_included = 1;
|
||||
}
|
||||
|
||||
if (ccmp_included == 0)
|
||||
txmgmt.status_code = _STATS_INVALID_RSNIE_;
|
||||
}
|
||||
break;
|
||||
case WLAN_EID_EXT_CAP:
|
||||
@@ -1958,6 +1942,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct
|
||||
case _VENDOR_SPECIFIC_IE_:
|
||||
break;
|
||||
case _FTIE_:
|
||||
pftie = (u8 *)pIE;
|
||||
if (prx_pkt_attrib->encrypt)
|
||||
_rtw_memcpy(SNonce, (ptr + j + 52), 32);
|
||||
break;
|
||||
@@ -2011,7 +1996,10 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct
|
||||
|
||||
ptdls_sta->tdls_sta_state |= TDLS_INITIATOR_STATE;
|
||||
if (prx_pkt_attrib->encrypt) {
|
||||
_rtw_memcpy(ptdls_sta->SNonce, SNonce, 32);
|
||||
if (pftie == NULL)
|
||||
RTW_WARN("%s: SNonce is null\n", __func__);
|
||||
else
|
||||
_rtw_memcpy(ptdls_sta->SNonce, SNonce, 32);
|
||||
|
||||
if (timeout_interval <= 300)
|
||||
ptdls_sta->TDLS_PeerKey_Lifetime = TDLS_TPK_RESEND_COUNT;
|
||||
@@ -2129,6 +2117,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct
|
||||
if (_rtw_memcmp(ppairwise_cipher + 4 * k, RSN_CIPHER_SUITE_CCMP, 4) == _TRUE)
|
||||
verify_ccmp = 1;
|
||||
}
|
||||
break;
|
||||
case WLAN_EID_EXT_CAP:
|
||||
break;
|
||||
case _VENDOR_SPECIFIC_IE_:
|
||||
@@ -2179,7 +2168,11 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct
|
||||
|
||||
ptdls_sta->bssratelen = supportRateNum;
|
||||
_rtw_memcpy(ptdls_sta->bssrateset, supportRate, supportRateNum);
|
||||
_rtw_memcpy(ptdls_sta->ANonce, ANonce, 32);
|
||||
|
||||
if (pftie == NULL)
|
||||
RTW_WARN("%s: ANonce is null\n", __func__);
|
||||
else
|
||||
_rtw_memcpy(ptdls_sta->ANonce, ANonce, 32);
|
||||
|
||||
#ifdef CONFIG_WFD
|
||||
rtw_tdls_process_wfd_ie(ptdlsinfo, ptr + FIXED_IE, parsing_length);
|
||||
@@ -2575,11 +2568,11 @@ sint On_TDLS_Ch_Switch_Req(_adapter *padapter, union recv_frame *precv_frame, st
|
||||
switch (pIE->ElementID) {
|
||||
case EID_SecondaryChnlOffset:
|
||||
switch (*(pIE->data)) {
|
||||
case EXTCHNL_OFFSET_UPPER:
|
||||
case SCA:
|
||||
pchsw_info->ch_offset = HAL_PRIME_CHNL_OFFSET_LOWER;
|
||||
break;
|
||||
|
||||
case EXTCHNL_OFFSET_LOWER:
|
||||
case SCB:
|
||||
pchsw_info->ch_offset = HAL_PRIME_CHNL_OFFSET_UPPER;
|
||||
break;
|
||||
|
||||
@@ -2597,6 +2590,7 @@ sint On_TDLS_Ch_Switch_Req(_adapter *padapter, union recv_frame *precv_frame, st
|
||||
RTW_GET_LE16(pIE->data + 2) : TDLS_CH_SWITCH_TIMEOUT * 1000;
|
||||
RTW_INFO("[TDLS] %s ch_switch_time:%d, ch_switch_timeout:%d\n"
|
||||
, __FUNCTION__, RTW_GET_LE16(pIE->data), RTW_GET_LE16(pIE->data + 2));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -3369,11 +3363,6 @@ void _tdls_handshake_timer_hdl(void *FunctionContext)
|
||||
{
|
||||
struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext;
|
||||
_adapter *padapter = NULL;
|
||||
struct tdls_txmgmt txmgmt;
|
||||
|
||||
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
|
||||
_rtw_memcpy(txmgmt.peer, ptdls_sta->cmn.mac_addr, ETH_ALEN);
|
||||
txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_;
|
||||
|
||||
if (ptdls_sta != NULL) {
|
||||
padapter = ptdls_sta->padapter;
|
||||
@@ -3390,11 +3379,6 @@ void _tdls_pti_timer_hdl(void *FunctionContext)
|
||||
{
|
||||
struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext;
|
||||
_adapter *padapter = NULL;
|
||||
struct tdls_txmgmt txmgmt;
|
||||
|
||||
_rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt));
|
||||
_rtw_memcpy(txmgmt.peer, ptdls_sta->cmn.mac_addr, ETH_ALEN);
|
||||
txmgmt.status_code = _RSON_TDLS_TEAR_TOOFAR_;
|
||||
|
||||
if (ptdls_sta != NULL) {
|
||||
padapter = ptdls_sta->padapter;
|
||||
@@ -3402,7 +3386,7 @@ void _tdls_pti_timer_hdl(void *FunctionContext)
|
||||
if (ptdls_sta->tdls_sta_state & TDLS_WAIT_PTR_STATE) {
|
||||
RTW_INFO("[TDLS] Doesn't receive PTR from peer dev:"MAC_FMT"; "
|
||||
"Send TDLS Tear Down\n", MAC_ARG(ptdls_sta->cmn.mac_addr));
|
||||
rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_TEARDOWN_STA);
|
||||
rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_TEARDOWN_STA_TOOFAR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
96
drivers/net/wireless/rtl8822cs/core/rtw_txpwr.c
Normal file
96
drivers/net/wireless/rtl8822cs/core/rtw_txpwr.c
Normal file
@@ -0,0 +1,96 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define _RTW_TXPWR_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
void rtw_update_txpwr_level(struct dvobj_priv *dvobj, enum phl_band_idx band_idx)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = dvobj_to_rfctl(dvobj);
|
||||
#ifdef CONFIG_ACTIVE_TPC_REPORT
|
||||
int i;
|
||||
#endif
|
||||
|
||||
rtw_txpwr_hal_update_pwr(dvobj, band_idx);
|
||||
rtw_rfctl_update_op_mode(rfctl, 0, 0, 0);
|
||||
|
||||
#ifdef CONFIG_ACTIVE_TPC_REPORT
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
struct mlme_priv *mlme;
|
||||
|
||||
if (!dvobj->padapters[i])
|
||||
continue;
|
||||
if (!CHK_MLME_STATE(dvobj->padapters[i], WIFI_AP_STATE | WIFI_MESH_STATE)
|
||||
|| !MLME_IS_ASOC(dvobj->padapters[i]) || MLME_IS_OPCH_SW(dvobj->padapters[i]))
|
||||
continue;
|
||||
if (dvobj->padapters[i]->mlmeextpriv.bstart_bss != _TRUE)
|
||||
continue;
|
||||
|
||||
mlme = &(dvobj->padapters[i]->mlmepriv);
|
||||
if (MLME_ACTIVE_TPC_REPORT(mlme))
|
||||
update_beacon(dvobj->padapters[i], WLAN_EID_TPC_REPORT, NULL, 1, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtw_update_txpwr_level_all_hwband(struct dvobj_priv *dvobj)
|
||||
{
|
||||
rtw_update_txpwr_level(dvobj, HW_BAND_MAX);
|
||||
}
|
||||
|
||||
void dump_tx_power_ext_info(void *sel, struct dvobj_priv *dvobj)
|
||||
{
|
||||
struct tx_power_ext_info info;
|
||||
struct {
|
||||
const char *str;
|
||||
struct txpwr_param_status *status;
|
||||
} params[] = {
|
||||
{"tx_power_by_rate", &info.by_rate},
|
||||
{"tx_power_limit", &info.lmt},
|
||||
#ifdef CONFIG_80211AX_HE
|
||||
{"tx_power_limit_ru", &info.lmt_ru},
|
||||
#endif
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
{"tx_power_limit_6g", &info.lmt_6g},
|
||||
{"tx_power_limit_ru_6g", &info.lmt_ru_6g},
|
||||
#endif
|
||||
};
|
||||
u8 num_of_param = sizeof(params) / sizeof(params[0]);
|
||||
u8 i;
|
||||
|
||||
rtw_txpwr_hal_dump_target_info(sel, dvobj);
|
||||
if (rtw_txpwr_hal_get_ext_info(dvobj, &info)) {
|
||||
for (i = 0; i < num_of_param; i++) {
|
||||
RTW_PRINT_SEL(sel, "%s: %s, %s, %s\n", params[i].str
|
||||
, params[i].status->enable ? "enabled" : "disabled"
|
||||
, params[i].status->loaded ? "loaded" : "unloaded"
|
||||
, params[i].status->external_src ? "file" : "default"
|
||||
);
|
||||
}
|
||||
} else
|
||||
RTW_PRINT_SEL(sel, "not ready\n");
|
||||
}
|
||||
|
||||
void dump_txpwr_tpc_settings(void *sel, struct dvobj_priv *dvobj)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = dvobj_to_rfctl(dvobj);
|
||||
|
||||
if (rfctl->tpc_mode == TPC_MODE_DISABLE)
|
||||
RTW_PRINT_SEL(sel, "mode:DISABLE(%d)\n", rfctl->tpc_mode);
|
||||
else if (rfctl->tpc_mode == TPC_MODE_MANUAL) {
|
||||
RTW_PRINT_SEL(sel, "mode:MANUAL(%d)\n", rfctl->tpc_mode);
|
||||
RTW_PRINT_SEL(sel, "constraint:%d (mB)\n", rfctl->tpc_manual_constraint);
|
||||
}
|
||||
}
|
||||
55
drivers/net/wireless/rtl8822cs/core/rtw_txpwr.h
Normal file
55
drivers/net/wireless/rtl8822cs/core/rtw_txpwr.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef __RTW_TXPWR_H__
|
||||
#define __RTW_TXPWR_H__
|
||||
|
||||
#define TPC_MODE_DISABLE 0
|
||||
#define TPC_MODE_MANUAL 1
|
||||
#define TPC_MODE_INVALID 2 /* keep last */
|
||||
|
||||
#define TPC_MANUAL_CONSTRAINT_MAX 600 /* mB */
|
||||
|
||||
struct txpwr_param_status {
|
||||
bool enable;
|
||||
bool loaded;
|
||||
bool external_src;
|
||||
};
|
||||
|
||||
#define SET_TXPWR_PARAM_STATUS(_status, _enable, _loaded, _ext_src) \
|
||||
do { \
|
||||
(_status)->enable = _enable; \
|
||||
(_status)->loaded = _loaded; \
|
||||
(_status)->external_src = _ext_src; \
|
||||
} while (0)
|
||||
|
||||
struct tx_power_ext_info {
|
||||
struct txpwr_param_status by_rate;
|
||||
struct txpwr_param_status lmt;
|
||||
#ifdef CONFIG_80211AX_HE
|
||||
struct txpwr_param_status lmt_ru;
|
||||
#endif
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
struct txpwr_param_status lmt_6g;
|
||||
struct txpwr_param_status lmt_ru_6g;
|
||||
#endif
|
||||
};
|
||||
|
||||
void rtw_update_txpwr_level(struct dvobj_priv *dvobj, enum phl_band_idx band_idx);
|
||||
void rtw_update_txpwr_level_all_hwband(struct dvobj_priv *dvobj);
|
||||
|
||||
void dump_tx_power_ext_info(void *sel, struct dvobj_priv *dvobj);
|
||||
void dump_txpwr_tpc_settings(void *sel, struct dvobj_priv *dvobj);
|
||||
|
||||
#endif /* __RTW_TXPWR_H__ */
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -237,7 +237,8 @@ void rtw_vht_use_default_setting(_adapter *padapter)
|
||||
BOOLEAN bHwSupportBeamformer = _FALSE, bHwSupportBeamformee = _FALSE;
|
||||
u8 mu_bfer, mu_bfee;
|
||||
#endif /* CONFIG_BEAMFORMING */
|
||||
u8 tx_nss, rx_nss;
|
||||
/*u8 tx_nss;*/
|
||||
u8 rx_nss;
|
||||
u8 rf_type = 0;
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
@@ -347,7 +348,7 @@ void rtw_vht_use_default_setting(_adapter *padapter)
|
||||
|
||||
pvhtpriv->ampdu_len = pregistrypriv->ampdu_factor;
|
||||
|
||||
tx_nss = GET_HAL_TX_NSS(padapter);
|
||||
/*tx_nss = GET_HAL_TX_NSS(padapter);*/
|
||||
rx_nss = GET_HAL_RX_NSS(padapter);
|
||||
|
||||
/* for now, vhtpriv.vht_mcs_map comes from RX NSS */
|
||||
@@ -751,7 +752,7 @@ void rtw_process_vht_op_mode_notify(_adapter *padapter, u8 *pframe, void *sta)
|
||||
}
|
||||
|
||||
if (update_ra)
|
||||
rtw_dm_ra_mask_wk_cmd(padapter, (u8 *)psta);
|
||||
rtw_dm_ra_mask_wk_cmd(padapter, psta);
|
||||
}
|
||||
|
||||
u32 rtw_build_vht_operation_ie(_adapter *padapter, u8 *pbuf, u8 channel)
|
||||
@@ -979,7 +980,11 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
|
||||
/* find the largest bw supported by both registry and hal */
|
||||
bw = hal_largest_bw(padapter, REGSTY_BW_5G(pregistrypriv));
|
||||
|
||||
HighestRate = VHT_MCS_DATA_RATE[bw][pvhtpriv->sgi_80m][((pvhtpriv->vht_highest_rate - MGN_VHT1SS_MCS0) & 0x3f)];
|
||||
if(bw >= ARRAY_SIZE(VHT_MCS_DATA_RATE)){
|
||||
RTW_WARN("BW parameter value is out of range:%u\n", bw);
|
||||
bw = ARRAY_SIZE(VHT_MCS_DATA_RATE) - 1;
|
||||
}
|
||||
HighestRate = VHT_MCS_DATA_RATE[bw][0][((pvhtpriv->vht_highest_rate - MGN_VHT1SS_MCS0) & 0x3f)];
|
||||
HighestRate = (HighestRate + 1) >> 1;
|
||||
|
||||
SET_VHT_CAPABILITY_ELE_MCS_RX_HIGHEST_RATE(pcap, HighestRate); /* indicate we support highest rx rate is 600Mbps. */
|
||||
@@ -987,17 +992,17 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
|
||||
|
||||
pbuf = rtw_set_ie(pbuf, EID_VHTCapability, 12, pcap, &len);
|
||||
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len, struct country_chplan *req_chplan)
|
||||
u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len, u8 channel)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(padapter);
|
||||
RT_CHANNEL_INFO *chset = rfctl->channel_set;
|
||||
u32 ielen;
|
||||
u8 max_bw;
|
||||
u8 oper_ch, oper_bw = CHANNEL_WIDTH_20, oper_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
u8 *out_vht_op_ie, *ht_op_ie, *vht_cap_ie, *vht_op_ie;
|
||||
BAND_TYPE band = rtw_is_2g_ch(channel) ? BAND_ON_2_4G : BAND_ON_5G;
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
@@ -1026,7 +1031,10 @@ u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_le
|
||||
oper_ch = GET_HT_OP_ELE_PRI_CHL(ht_op_ie + 2);
|
||||
|
||||
/* find the largest bw supported by both registry and hal */
|
||||
max_bw = hal_largest_bw(padapter, REGSTY_BW_5G(pregistrypriv));
|
||||
if (band == BAND_ON_5G)
|
||||
max_bw = hal_largest_bw(padapter, REGSTY_BW_5G(pregistrypriv));
|
||||
else if (band == BAND_ON_2_4G)
|
||||
max_bw = hal_largest_bw(padapter, REGSTY_BW_2G(pregistrypriv));
|
||||
|
||||
if (max_bw >= CHANNEL_WIDTH_40) {
|
||||
/* get bw offset form HT_OP_IE */
|
||||
@@ -1053,27 +1061,13 @@ u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_le
|
||||
}
|
||||
|
||||
oper_bw = rtw_min(oper_bw, max_bw);
|
||||
|
||||
/* try downgrage bw to fit in channel plan setting */
|
||||
while ((req_chplan && !rtw_country_chplan_is_chbw_valid(req_chplan, BAND_ON_5G, oper_ch, oper_bw, oper_offset, 1, 1, pregistrypriv))
|
||||
|| (!req_chplan && !rtw_chset_is_chbw_valid(chset, oper_ch, oper_bw, oper_offset, 1, 1))
|
||||
|| (IS_DFS_SLAVE_WITH_RD(rfctl)
|
||||
&& !rtw_rfctl_dfs_domain_unknown(rfctl)
|
||||
&& rtw_chset_is_chbw_non_ocp(chset, oper_ch, oper_bw, oper_offset))
|
||||
) {
|
||||
oper_bw--;
|
||||
if (oper_bw == CHANNEL_WIDTH_20) {
|
||||
oper_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rtw_warn_on(req_chplan && !rtw_country_chplan_is_chbw_valid(req_chplan, BAND_ON_5G, oper_ch, oper_bw, oper_offset, 1, 1, pregistrypriv));
|
||||
rtw_warn_on(!req_chplan && !rtw_chset_is_chbw_valid(chset, oper_ch, oper_bw, oper_offset, 1, 1));
|
||||
if (IS_DFS_SLAVE_WITH_RD(rfctl) && !rtw_rfctl_dfs_domain_unknown(rfctl))
|
||||
rtw_warn_on(rtw_chset_is_chbw_non_ocp(chset, oper_ch, oper_bw, oper_offset));
|
||||
/* try downgrage bw to fit in channel plan setting */
|
||||
oper_bw = adapter_adjust_linking_bw_by_regd(padapter, band, oper_ch, oper_bw, oper_offset);
|
||||
if (oper_bw == CHANNEL_WIDTH_20)
|
||||
oper_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
|
||||
/* update VHT_OP_IE */
|
||||
if (oper_bw < CHANNEL_WIDTH_80) {
|
||||
@@ -1266,15 +1260,13 @@ void rtw_reattach_vht_ies(_adapter *padapter, WLAN_BSSID_EX *pnetwork)
|
||||
|
||||
RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (pnetwork->IEs != NULL) {
|
||||
vht_op_ie = rtw_set_ie(vht_cap_ie, EID_VHTCapability, VHT_CAP_IE_LEN,
|
||||
pvhtpriv->vht_cap_ie_backup, &(pnetwork->IELength));
|
||||
vht_op_ie = rtw_set_ie(vht_cap_ie, EID_VHTCapability, VHT_CAP_IE_LEN,
|
||||
pvhtpriv->vht_cap_ie_backup, &(pnetwork->IELength));
|
||||
|
||||
rtw_set_ie(vht_op_ie, EID_VHTOperation, VHT_OP_IE_LEN,
|
||||
pvhtpriv->vht_op_ie_backup, &(pnetwork->IELength));
|
||||
rtw_set_ie(vht_op_ie, EID_VHTOperation, VHT_OP_IE_LEN,
|
||||
pvhtpriv->vht_op_ie_backup, &(pnetwork->IELength));
|
||||
|
||||
rtw_set_vht_ext_cap(padapter, pnetwork);
|
||||
}
|
||||
rtw_set_vht_ext_cap(padapter, pnetwork);
|
||||
|
||||
pmlmepriv->vhtpriv.vht_option = _TRUE;
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ u8 WapiWriteOneCamEntry(
|
||||
usConfig |= (0x01 << 5);
|
||||
}
|
||||
|
||||
write_cam(padapter, EntryId, usConfig, pMacAddr, pKey);
|
||||
write_cam(padapter, EntryId, usConfig, pMacAddr, pKey, false);
|
||||
|
||||
WAPI_TRACE(WAPI_API, "===========> %s\n", __FUNCTION__);
|
||||
return 1;
|
||||
@@ -628,7 +628,7 @@ void rtw_build_assoc_req_wapi_ie(_adapter *padapter, unsigned char *pframe, stru
|
||||
WAPI_TRACE(WAPI_MLME, "<========== %s\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
void rtw_wapi_on_assoc_ok(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
||||
void rtw_wapi_on_assoc_ok(_adapter *padapter)
|
||||
{
|
||||
PRT_WAPI_T pWapiInfo = &(padapter->wapiInfo);
|
||||
PRT_WAPI_STA_INFO pWapiSta;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2019 Realtek Corporation.
|
||||
* Copyright(c) 2007 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -573,7 +573,7 @@ void rtw_get_adapter_tx_rate_bmp(_adapter *adapter, u16 r_bmp_cck_ofdm[], u32 r_
|
||||
bmp_vht |= tmp_vht;
|
||||
}
|
||||
if (bw == CHANNEL_WIDTH_20)
|
||||
r_bmp_cck_ofdm[bw] = bmp_cck_ofdm;
|
||||
r_bmp_cck_ofdm[0] = bmp_cck_ofdm;
|
||||
if (bw <= CHANNEL_WIDTH_40)
|
||||
r_bmp_ht[bw] = bmp_ht;
|
||||
if (bw <= CHANNEL_WIDTH_160)
|
||||
@@ -685,7 +685,7 @@ void rtw_update_tx_rate_bmp(struct dvobj_priv *dvobj)
|
||||
|
||||
/* TODO: per rfpath and rate section handling? */
|
||||
if (update_ht_rs == _TRUE || update_vht_rs == _TRUE)
|
||||
rtw_hal_update_txpwr_level(adapter);
|
||||
rtw_update_txpwr_level(dvobj, HW_BAND_MAX);
|
||||
}
|
||||
#endif /* CONFIG_TXPWR_LIMIT */
|
||||
}
|
||||
@@ -848,18 +848,23 @@ s16 rtw_get_oper_txpwr_max_mbm(struct dvobj_priv *dvobj, bool eirp)
|
||||
return mbm;
|
||||
}
|
||||
|
||||
s16 rtw_rfctl_get_reg_max_txpwr_mbm(struct rf_ctl_t *rfctl, u8 ch, u8 bw, u8 offset, bool eirp)
|
||||
s16 rtw_rfctl_get_reg_max_txpwr_mbm(struct rf_ctl_t *rfctl, enum band_type band, u8 ch, u8 bw, u8 offset, bool eirp)
|
||||
{
|
||||
struct dvobj_priv *dvobj = rfctl_to_dvobj(rfctl);
|
||||
struct registry_priv *regsty = dvobj_to_regsty(dvobj);
|
||||
_adapter *adapter = dvobj_get_primary_adapter(dvobj);
|
||||
s16 mbm = -100 * MBM_PDBM;
|
||||
u8 cch = rtw_get_center_ch(ch, bw, offset);
|
||||
u8 cch = rtw_get_center_ch_by_band(band, ch, bw, offset);
|
||||
u16 bmp_cck_ofdm = 0;
|
||||
u32 bmp_ht = 0;
|
||||
u64 bmp_vht = 0;
|
||||
|
||||
if (ch <= 14)
|
||||
#if CONFIG_IEEE80211_BAND_6GHZ
|
||||
if (band == BAND_ON_6G) /* TODO: 6G */
|
||||
return 1300;
|
||||
#endif
|
||||
|
||||
if (band == BAND_ON_2_4G)
|
||||
bmp_cck_ofdm |= RATE_BMP_CCK;
|
||||
|
||||
/* TODO: NO OFDM? */
|
||||
@@ -1471,7 +1476,7 @@ static u8 tos_to_up(u8 tos)
|
||||
return up;
|
||||
}
|
||||
|
||||
static void set_qos(_pkt *pkt, struct pkt_attrib *pattrib)
|
||||
static void set_qos(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattrib)
|
||||
{
|
||||
s32 UserPriority = 0;
|
||||
|
||||
@@ -1507,6 +1512,21 @@ static void set_qos(_pkt *pkt, struct pkt_attrib *pattrib)
|
||||
UserPriority = 7;
|
||||
#endif/*CONFIG_IP_R_MONITOR*/
|
||||
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
if (MCC_EN(padapter)) {
|
||||
/* Under MCC */
|
||||
if (rtw_hal_check_mcc_status(padapter, MCC_STATUS_NEED_MCC)) {
|
||||
if (padapter->mcc_adapterpriv.role == MCC_ROLE_GO
|
||||
|| padapter->mcc_adapterpriv.role == MCC_ROLE_GC
|
||||
|| padapter->mcc_adapterpriv.role == MCC_ROLE_AP) {
|
||||
UserPriority = 7;
|
||||
} else {
|
||||
UserPriority = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_MCC_MODE */
|
||||
|
||||
null_pkt:
|
||||
pattrib->priority = UserPriority;
|
||||
pattrib->hdrlen = XATTRIB_GET_WDS(pattrib) ? WLAN_HDR_A4_QOS_LEN : WLAN_HDR_A3_QOS_LEN;
|
||||
@@ -1605,7 +1625,7 @@ inline u8 rtw_get_hwseq_no(_adapter *padapter)
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
#if defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8814B) \
|
||||
|| defined(CONFIG_RTL8723F)
|
||||
|| defined(CONFIG_RTL8723F) || defined(CONFIG_RTL8822E)
|
||||
hwseq_num = padapter->iface_id;
|
||||
if (hwseq_num > 3)
|
||||
hwseq_num = 3;
|
||||
@@ -1644,7 +1664,6 @@ static u8 _rtw_lps_chk_packet_type(struct pkt_attrib *pattrib)
|
||||
#endif
|
||||
static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattrib)
|
||||
{
|
||||
uint i;
|
||||
struct pkt_file pktfile;
|
||||
struct sta_info *psta = NULL;
|
||||
struct ethhdr etherhdr;
|
||||
@@ -1663,7 +1682,7 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr
|
||||
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib);
|
||||
|
||||
_rtw_open_pktfile(pkt, &pktfile);
|
||||
i = _rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
|
||||
_rtw_pktfile_read(&pktfile, (u8 *)ðerhdr, ETH_HLEN);
|
||||
|
||||
pattrib->ether_type = ntohs(etherhdr.h_proto);
|
||||
|
||||
@@ -1870,7 +1889,7 @@ get_sta_info:
|
||||
| WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE)
|
||||
) {
|
||||
if (pattrib->qos_en) {
|
||||
set_qos(pkt, pattrib);
|
||||
set_qos(padapter, pkt, pattrib);
|
||||
#ifdef CONFIG_RTW_MESH
|
||||
if (MLME_IS_MESH(padapter))
|
||||
rtw_mesh_tx_set_whdr_mctrl_len(pattrib->mesh_frame_mode, pattrib);
|
||||
@@ -1880,12 +1899,12 @@ get_sta_info:
|
||||
#ifdef CONFIG_TDLS
|
||||
if (pattrib->direct_link == _TRUE) {
|
||||
if (pattrib->qos_en)
|
||||
set_qos(pkt, pattrib);
|
||||
set_qos(padapter, pkt, pattrib);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (pqospriv->qos_option) {
|
||||
set_qos(pkt, pattrib);
|
||||
set_qos(padapter, pkt, pattrib);
|
||||
|
||||
if (pmlmepriv->acm_mask != 0)
|
||||
pattrib->priority = qos_acm(pmlmepriv->acm_mask, pattrib->priority);
|
||||
@@ -1922,8 +1941,6 @@ get_sta_info:
|
||||
rtw_set_tx_chksum_offload(pkt, pattrib);
|
||||
|
||||
exit:
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -4102,7 +4119,7 @@ void rtw_free_mgmt_xmitframe_queue(struct xmit_priv *pxmitpriv, _queue *mgmt_que
|
||||
RTW_INFO("%s seq_num = %u\n", __func__, pxmitframe->attrib.seqnum);
|
||||
#endif
|
||||
|
||||
rtw_free_xmitbuf_ext(pxmitpriv, pxmitframe->pxmitbuf);
|
||||
rtw_free_xmitbuf(pxmitpriv, pxmitframe->pxmitbuf);
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
}
|
||||
_exit_critical_bh(&(mgmt_queue->lock), &irqL);
|
||||
@@ -4195,35 +4212,12 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str
|
||||
xmitframe_phead = get_list_head(pframe_queue);
|
||||
xmitframe_plist = get_next(xmitframe_phead);
|
||||
|
||||
while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) {
|
||||
if ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) {
|
||||
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
|
||||
|
||||
/* xmitframe_plist = get_next(xmitframe_plist); */
|
||||
|
||||
/*#ifdef RTK_DMP_PLATFORM
|
||||
#ifdef CONFIG_USB_TX_AGGREGATION
|
||||
if((ptxservq->qcnt>0) && (ptxservq->qcnt<=2))
|
||||
{
|
||||
pxmitframe = NULL;
|
||||
|
||||
tasklet_schedule(&pxmitpriv->xmit_tasklet);
|
||||
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#endif*/
|
||||
rtw_list_delete(&pxmitframe->list);
|
||||
|
||||
ptxservq->qcnt--;
|
||||
|
||||
/* rtw_list_insert_tail(&pxmitframe->list, &phwxmit->pending); */
|
||||
|
||||
/* ptxservq->qcnt--; */
|
||||
|
||||
break;
|
||||
|
||||
/* pxmitframe = NULL; */
|
||||
|
||||
}
|
||||
|
||||
return pxmitframe;
|
||||
@@ -4237,10 +4231,8 @@ static struct xmit_frame *get_one_xmitframe(struct xmit_priv *pxmitpriv, struct
|
||||
xmitframe_phead = get_list_head(pframe_queue);
|
||||
xmitframe_plist = get_next(xmitframe_phead);
|
||||
|
||||
while ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE) {
|
||||
if ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == _FALSE)
|
||||
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
|
||||
break;
|
||||
}
|
||||
|
||||
return pxmitframe;
|
||||
}
|
||||
@@ -4830,27 +4822,7 @@ static void do_queue_select(_adapter *padapter, struct pkt_attrib *pattrib)
|
||||
|
||||
qsel = pattrib->priority;
|
||||
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
if (MCC_EN(padapter)) {
|
||||
/* Under MCC */
|
||||
if (rtw_hal_check_mcc_status(padapter, MCC_STATUS_NEED_MCC)) {
|
||||
if (padapter->mcc_adapterpriv.role == MCC_ROLE_GO
|
||||
|| padapter->mcc_adapterpriv.role == MCC_ROLE_AP) {
|
||||
pattrib->qsel = QSLT_VO; /* AP interface VO queue */
|
||||
pattrib->priority = QSLT_VO;
|
||||
} else {
|
||||
pattrib->qsel = QSLT_BE; /* STA interface BE queue */
|
||||
pattrib->priority = QSLT_BE;
|
||||
}
|
||||
} else
|
||||
/* Not Under MCC */
|
||||
pattrib->qsel = qsel;
|
||||
} else
|
||||
/* Not enable MCC */
|
||||
pattrib->qsel = qsel;
|
||||
#else /* !CONFIG_MCC_MODE */
|
||||
pattrib->qsel = qsel;
|
||||
#endif /* CONFIG_MCC_MODE */
|
||||
|
||||
/* high priority packet */
|
||||
if (pattrib->hipriority_pkt) {
|
||||
@@ -4870,41 +4842,139 @@ static void do_queue_select(_adapter *padapter, struct pkt_attrib *pattrib)
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
|
||||
s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
|
||||
{
|
||||
u16 frame_ctl;
|
||||
struct ieee80211_radiotap_header rtap_hdr;
|
||||
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
|
||||
struct pkt_file pktfile;
|
||||
struct rtw_ieee80211_hdr *pwlanhdr;
|
||||
struct pkt_attrib *pattrib;
|
||||
struct xmit_frame *pmgntframe;
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
|
||||
unsigned char *pframe;
|
||||
u8 dummybuf[32];
|
||||
int len = skb->len, rtap_len;
|
||||
|
||||
struct pkt_attrib *pattrib;
|
||||
struct xmit_frame *pmgntframe;
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
|
||||
unsigned char *pframe;
|
||||
u16 frame_ctl;
|
||||
u8 retry_ctrl = _FALSE;
|
||||
u8 fixed_rate = MGN_1M;
|
||||
u8 sgi = 0;
|
||||
u8 bwidth = CHANNEL_WIDTH_20;
|
||||
u8 ldpc = 0;
|
||||
u8 stbc = 0;
|
||||
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
struct ieee80211_radiotap_header *rtap_hdr;
|
||||
struct ieee80211_radiotap_iterator iterator;
|
||||
int rtap_len;
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
|
||||
|
||||
#ifndef CONFIG_CUSTOMER_ALIBABA_GENERAL
|
||||
if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))
|
||||
goto fail;
|
||||
goto no_rtap_tx;
|
||||
|
||||
_rtw_open_pktfile((_pkt *)skb, &pktfile);
|
||||
_rtw_pktfile_read(&pktfile, (u8 *)(&rtap_hdr), sizeof(struct ieee80211_radiotap_header));
|
||||
rtap_len = ieee80211_get_radiotap_len((u8 *)(&rtap_hdr));
|
||||
if (unlikely(rtap_hdr.it_version))
|
||||
goto fail;
|
||||
rtap_hdr = (struct ieee80211_radiotap_header *)skb->data;
|
||||
if (unlikely(rtap_hdr->it_version))
|
||||
goto no_rtap_tx;
|
||||
|
||||
rtap_len = ieee80211_get_radiotap_len(skb->data);
|
||||
if (unlikely(skb->len < rtap_len))
|
||||
goto fail;
|
||||
goto no_rtap_tx;
|
||||
|
||||
if (rtap_len != 12) {
|
||||
RTW_INFO("radiotap len (should be 14): %d\n", rtap_len);
|
||||
goto fail;
|
||||
ret = ieee80211_radiotap_iterator_init(&iterator, rtap_hdr, skb->len, NULL);
|
||||
while (!ret) {
|
||||
ret = ieee80211_radiotap_iterator_next(&iterator);
|
||||
|
||||
if (ret)
|
||||
continue;
|
||||
|
||||
/* see if this argument is something we can use */
|
||||
switch (iterator.this_arg_index) {
|
||||
case IEEE80211_RADIOTAP_RATE:
|
||||
/* This rate is in units of 500kb, but we did not check
|
||||
if this value is in the enum MGN_RATE. */
|
||||
fixed_rate = *iterator.this_arg;
|
||||
break;
|
||||
|
||||
case IEEE80211_RADIOTAP_TX_FLAGS: {
|
||||
u16 txflags;
|
||||
txflags = get_unaligned_le16(iterator.this_arg);
|
||||
if ((txflags & IEEE80211_RADIOTAP_F_TX_NOACK) == 0)
|
||||
retry_ctrl = _TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
case IEEE80211_RADIOTAP_MCS: {
|
||||
u8 mcs_known = iterator.this_arg[0];
|
||||
u8 mcs_flags = iterator.this_arg[1];
|
||||
if (!(mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_MCS))
|
||||
break;
|
||||
|
||||
fixed_rate = iterator.this_arg[2] & 0x7f;
|
||||
|
||||
if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_MCS) {
|
||||
fixed_rate = iterator.this_arg[2] & 0x7f;
|
||||
if (fixed_rate > 31)
|
||||
fixed_rate = 0;
|
||||
fixed_rate += MGN_MCS0;
|
||||
}
|
||||
if ((mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_GI) &&
|
||||
(mcs_flags & IEEE80211_RADIOTAP_MCS_SGI))
|
||||
sgi = 1;
|
||||
if ((mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_BW) &&
|
||||
(mcs_flags & IEEE80211_RADIOTAP_MCS_BW_40))
|
||||
bwidth = CHANNEL_WIDTH_40;
|
||||
if ((mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_FEC) &&
|
||||
(mcs_flags & IEEE80211_RADIOTAP_MCS_FEC_LDPC))
|
||||
ldpc = 1;
|
||||
if ((mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_STBC)) {
|
||||
stbc = (mcs_flags &
|
||||
IEEE80211_RADIOTAP_MCS_STBC_MASK) >>
|
||||
IEEE80211_RADIOTAP_MCS_STBC_SHIFT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IEEE80211_RADIOTAP_VHT: {
|
||||
u16 vht_known = get_unaligned_le16(iterator.this_arg);
|
||||
u8 vht_flags = iterator.this_arg[2];
|
||||
unsigned int mcs, nss;
|
||||
|
||||
if ((vht_known & IEEE80211_RADIOTAP_VHT_KNOWN_GI) &&
|
||||
(vht_flags & IEEE80211_RADIOTAP_VHT_FLAG_SGI))
|
||||
sgi = 1;
|
||||
if (vht_known &
|
||||
IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH) {
|
||||
bwidth = iterator.this_arg[3] & 0x1f;
|
||||
if(bwidth >= 1 && bwidth <= 3)
|
||||
bwidth = CHANNEL_WIDTH_40;
|
||||
else if(bwidth >= 4 && bwidth <= 10)
|
||||
bwidth = CHANNEL_WIDTH_80;
|
||||
else
|
||||
bwidth = CHANNEL_WIDTH_20;
|
||||
}
|
||||
if((vht_known & IEEE80211_RADIOTAP_VHT_KNOWN_STBC) &&
|
||||
(vht_flags & IEEE80211_RADIOTAP_VHT_FLAG_STBC))
|
||||
stbc = 1;
|
||||
if (vht_known & IEEE80211_RADIOTAP_VHT_KNOWN_LDPC_EXTRA_OFDM_SYM &&
|
||||
vht_flags & IEEE80211_RADIOTAP_VHT_FLAG_LDPC_EXTRA_OFDM_SYM &&
|
||||
iterator.this_arg[8] & 0x0f)
|
||||
ldpc = 1;
|
||||
mcs = (iterator.this_arg[4] >> 4) & 0x0f;
|
||||
nss = iterator.this_arg[4] & 0x0f;
|
||||
if(nss > 0) {
|
||||
if(nss > 4) nss = 4;
|
||||
if(mcs > 9) mcs = 9;
|
||||
fixed_rate = MGN_VHT1SS_MCS0 + ((nss - 1) * 10 + mcs);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
_rtw_pktfile_read(&pktfile, dummybuf, rtap_len-sizeof(struct ieee80211_radiotap_header));
|
||||
len = len - rtap_len;
|
||||
|
||||
/* Skip the ratio tap header */
|
||||
skb_pull(skb, rtap_len);
|
||||
|
||||
no_rtap_tx:
|
||||
#endif
|
||||
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
|
||||
if (pmgntframe == NULL) {
|
||||
@@ -4914,36 +4984,36 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
|
||||
|
||||
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
|
||||
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
|
||||
// _rtw_memcpy(pframe, (void *)checking, len);
|
||||
_rtw_pktfile_read(&pktfile, pframe, len);
|
||||
|
||||
skb_copy_bits(skb, 0, (void*)pframe, skb->len);
|
||||
|
||||
pattrib = &pmgntframe->attrib;
|
||||
|
||||
/* Check DATA/MGNT frames */
|
||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
|
||||
frame_ctl = le16_to_cpu(pwlanhdr->frame_ctl);
|
||||
if ((frame_ctl & RTW_IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) {
|
||||
|
||||
pattrib = &pmgntframe->attrib;
|
||||
update_monitor_frame_attrib(padapter, pattrib);
|
||||
|
||||
if (is_broadcast_mac_addr(pwlanhdr->addr3) || is_broadcast_mac_addr(pwlanhdr->addr1))
|
||||
pattrib->rate = MGN_24M;
|
||||
|
||||
} else {
|
||||
|
||||
pattrib = &pmgntframe->attrib;
|
||||
update_mgntframe_attrib(padapter, pattrib);
|
||||
|
||||
}
|
||||
pattrib->retry_ctrl = _FALSE;
|
||||
pattrib->pktlen = len;
|
||||
if ((frame_ctl & RTW_IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA)
|
||||
update_monitor_frame_attrib(padapter, &pmgntframe->attrib);
|
||||
else
|
||||
update_mgntframe_attrib(padapter, &pmgntframe->attrib);
|
||||
pattrib->pktlen = skb->len;
|
||||
pattrib->rate = fixed_rate;
|
||||
pattrib->retry_ctrl = retry_ctrl;
|
||||
pmlmeext->mgnt_seq = GetSequence(pwlanhdr);
|
||||
pattrib->seqnum = pmlmeext->mgnt_seq;
|
||||
pmlmeext->mgnt_seq++;
|
||||
pattrib->last_txcmdsz = pattrib->pktlen;
|
||||
pattrib->sgi = sgi;
|
||||
pattrib->bwmode = bwidth;
|
||||
pattrib->ldpc = ldpc;
|
||||
pattrib->stbc = stbc;
|
||||
|
||||
dump_mgntframe(padapter, pmgntframe);
|
||||
|
||||
DBG_COUNTER(padapter->tx_logs.core_tx);
|
||||
pxmitpriv->tx_pkts++;
|
||||
pxmitpriv->tx_bytes += skb->len;
|
||||
|
||||
fail:
|
||||
rtw_skb_free(skb);
|
||||
return 0;
|
||||
@@ -6611,6 +6681,7 @@ void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms)
|
||||
init_completion(&sctx->done);
|
||||
#endif
|
||||
sctx->status = RTW_SCTX_SUBMITTED;
|
||||
sctx->rsp = NULL;
|
||||
}
|
||||
|
||||
int rtw_sctx_wait(struct submit_ctx *sctx, const char *msg)
|
||||
|
||||
@@ -61,7 +61,8 @@ static const struct btc_coex_table_para table_sant_8822c[] = {
|
||||
{0xdaffdaff, 0xdaffdaff},
|
||||
{0x6a555a5a, 0x5a5a5a5a},
|
||||
{0xe5555555, 0xe5555555}, /*case-35*/
|
||||
{0xea5a5a5a, 0xea5a5a5a} };
|
||||
{0xea5a5a5a, 0xea5a5a5a},
|
||||
{0xea6a6a6a, 0xea6a6a6a} };
|
||||
|
||||
/* Non-Shared-Antenna Coex Table */
|
||||
static const struct btc_coex_table_para table_nsant_8822c[] = {
|
||||
@@ -89,7 +90,7 @@ static const struct btc_coex_table_para table_nsant_8822c[] = {
|
||||
{0x55ff55ff, 0x5afa5afa},
|
||||
{0x55ff55ff, 0xaaaaaaaa},
|
||||
{0x55ff55ff, 0x55ff55ff},
|
||||
{0x6a555a5a, 0xfafafafa} };
|
||||
{0x6f555f5f, 0xfafafafa} };
|
||||
|
||||
/* Shared-Antenna TDMA*/
|
||||
static const struct btc_tdma_para tdma_sant_8822c[] = {
|
||||
@@ -189,40 +190,42 @@ static const struct btc_rf_para rf_para_rx_8822c[] = {
|
||||
{13, 6, TRUE, 5},
|
||||
{6, 9, TRUE, 5},
|
||||
{4, 11, TRUE, 5},
|
||||
{16, 4, TRUE, 4}, /* 6 for RCU OFC */
|
||||
{15, 5, TRUE, 4},
|
||||
{7, 8, TRUE, 4},
|
||||
{6, 10, TRUE, 4},
|
||||
{16, 4, TRUE, 4}, /* 10 for A2DP SDR */
|
||||
{15, 5, TRUE, 4},
|
||||
{7, 8, TRUE, 4},
|
||||
{6, 10, TRUE, 4},
|
||||
{16, 4, TRUE, 4}, /* 14 for A2DP OFC */
|
||||
{15, 5, TRUE, 4},
|
||||
{7, 8, TRUE, 4},
|
||||
{6, 10, TRUE, 4},
|
||||
{16, 4, TRUE, 4}, /* 18 for A2DP+RCU SDR */
|
||||
{15, 5, TRUE, 4},
|
||||
{7, 8, TRUE, 4},
|
||||
{6, 10, TRUE, 4},
|
||||
{16, 4, TRUE, 4}, /* 22 for A2DP+RCU OFC */
|
||||
{15, 5, TRUE, 4},
|
||||
{7, 8, TRUE, 4},
|
||||
{6, 10, TRUE, 4} };
|
||||
{16, 4, TRUE, 5}, /* 6 for RCU OFC */
|
||||
{15, 5, TRUE, 5},
|
||||
{7, 8, TRUE, 5},
|
||||
{6, 10, TRUE, 5},
|
||||
{16, 4, TRUE, 5}, /* 10 for A2DP SDR */
|
||||
{15, 5, TRUE, 5},
|
||||
{7, 8, TRUE, 5},
|
||||
{6, 10, TRUE, 5},
|
||||
{16, 4, TRUE, 5}, /* 14 for A2DP OFC */
|
||||
{15, 5, TRUE, 5},
|
||||
{7, 8, TRUE, 5},
|
||||
{6, 10, TRUE, 5},
|
||||
{16, 4, TRUE, 5}, /* 18 for A2DP+RCU SDR */
|
||||
{15, 5, TRUE, 5},
|
||||
{7, 8, TRUE, 5},
|
||||
{6, 10, TRUE, 5},
|
||||
{16, 4, TRUE, 5}, /* 22 for A2DP+RCU OFC */
|
||||
{15, 5, TRUE, 5},
|
||||
{7, 8, TRUE, 5},
|
||||
{6, 10, TRUE, 5} };
|
||||
|
||||
const struct btc_5g_afh_map afh_5g_8822c[] = { {0, 0, 0} };
|
||||
|
||||
const struct btc_chip_para btc_chip_para_8822c = {
|
||||
"8822c", /*.chip_name */
|
||||
20211210, /*.para_ver_date */
|
||||
0x27, /*.para_ver */
|
||||
20221118, /*.para_ver_date */
|
||||
0x30, /*.para_ver */
|
||||
0x20, /* bt_desired_ver */
|
||||
0x7001c, /* wl_desired_ver */
|
||||
TRUE, /* scbd_support */
|
||||
0xaa, /* scbd_reg*/
|
||||
BTC_SCBD_16_BIT, /* scbd_bit_num */
|
||||
FALSE, /* le_audio_support */
|
||||
TRUE, /* mailbox_support*/
|
||||
TRUE, /* lte_indirect_access */
|
||||
FALSE, /* new_scbd9_def */
|
||||
TRUE, /* new_scbd10_def */
|
||||
BTC_INDIRECT_1700, /* indirect_type */
|
||||
BTC_PSTDMA_FORCE_LPSOFF, /* pstdma_type */
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
#if (BT_SUPPORT == 1 && COEX_SUPPORT == 1)
|
||||
|
||||
static u8 *trace_buf = &gl_btc_trace_buf[0];
|
||||
static const u32 coex_ver_date = 20211210;
|
||||
static const u32 coex_ver = 0x27;
|
||||
static const u32 coex_ver_date = 20221215;
|
||||
static const u32 coex_ver = 0x31;
|
||||
|
||||
static u8
|
||||
rtw_btc_rssi_state(struct btc_coexist *btc, u8 pre_state,
|
||||
@@ -58,7 +58,8 @@ rtw_btc_limited_tx(struct btc_coexist *btc, boolean force_exec,
|
||||
|
||||
/* Force Max Tx retry limit = 8 */
|
||||
if (!force_exec && tx_limit_en == coex_sta->wl_tx_limit_en &&
|
||||
ampdu_limit_en == coex_sta->wl_ampdu_limit_en)
|
||||
ampdu_limit_en == coex_sta->wl_ampdu_limit_en &&
|
||||
!link_info_ext->is_port_num_change)
|
||||
return;
|
||||
|
||||
/* backup MAC reg */
|
||||
@@ -84,6 +85,8 @@ rtw_btc_limited_tx(struct btc_coexist *btc, boolean force_exec,
|
||||
*/
|
||||
btc->btc_write_1byte_bitmask(btc, REG_TX_HANG_CTRL,
|
||||
BIT_EN_GNT_BT_AWAKE, 0x1);
|
||||
btc->btc_write_1byte_bitmask(btc, REG_TX_HANG_CTRL_OPT,
|
||||
BIT_GNT_BT_OPT, 0x1);
|
||||
|
||||
/* queue life time can't on if 2-port */
|
||||
if (link_info_ext->num_of_active_port <= 1)
|
||||
@@ -112,6 +115,8 @@ rtw_btc_limited_tx(struct btc_coexist *btc, boolean force_exec,
|
||||
*/
|
||||
btc->btc_write_1byte_bitmask(btc, REG_TX_HANG_CTRL,
|
||||
BIT_EN_GNT_BT_AWAKE, 0x0);
|
||||
btc->btc_write_1byte_bitmask(btc, REG_TX_HANG_CTRL_OPT,
|
||||
BIT_GNT_BT_OPT, 0x0);
|
||||
|
||||
/* Set queue life time to avoid can't reach tx retry limit
|
||||
* if tx is always break by GNT_BT.
|
||||
@@ -194,6 +199,9 @@ rtw_btc_limited_wl(struct btc_coexist *btc)
|
||||
struct btc_coex_sta *coex_sta = &btc->coex_sta;
|
||||
struct btc_wifi_link_info_ext *link_info_ext = &btc->wifi_link_info_ext;
|
||||
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE, "[BTCoex], %s()\n", __func__);
|
||||
BTC_TRACE(trace_buf);
|
||||
|
||||
if (link_info_ext->is_all_under_5g ||
|
||||
link_info_ext->num_of_active_port == 0 ||
|
||||
coex_dm->bt_status == BTC_BTSTATUS_NCON_IDLE) {
|
||||
@@ -216,13 +224,17 @@ rtw_btc_limited_wl(struct btc_coexist *btc)
|
||||
else
|
||||
rtw_btc_limited_tx(btc, NM_EXCU, TRUE, FALSE);
|
||||
|
||||
/*COEX-361, solve wifi poor performance when BLE HID exists*/
|
||||
if ((coex_sta->bt_ble_hid_exist || coex_sta->bt_hfp_exist) &&
|
||||
coex_sta->wl_iot_peer != BTC_IOT_PEER_ATHEROS &&
|
||||
btc->board_info.btdm_ant_num == 1)
|
||||
rtw_btc_limited_rx(btc, NM_EXCU, FALSE, TRUE, 4);
|
||||
else
|
||||
if (strcmp(btc->chip_para->chip_name, "8822c") == 0) {
|
||||
/*COEX-361, solve wifi poor performance when BLE HID exists*/
|
||||
if ((coex_sta->bt_ble_hid_exist || coex_sta->bt_hfp_exist) &&
|
||||
coex_sta->wl_iot_peer != BTC_IOT_PEER_ATHEROS &&
|
||||
btc->board_info.btdm_ant_num == 1)
|
||||
rtw_btc_limited_rx(btc, NM_EXCU, FALSE, TRUE, 4);
|
||||
else
|
||||
rtw_btc_limited_rx(btc, NM_EXCU, FALSE, TRUE, 64);
|
||||
} else {
|
||||
rtw_btc_limited_rx(btc, NM_EXCU, FALSE, TRUE, 64);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -546,6 +558,7 @@ static void
|
||||
rtw_btc_query_bt_info(struct btc_coexist *btc)
|
||||
{
|
||||
struct btc_coex_sta *coex_sta = &btc->coex_sta;
|
||||
const struct btc_chip_para *chip_para = btc->chip_para;
|
||||
u8 h2c_parameter[1] = {0x1};
|
||||
|
||||
if (coex_sta->bt_disabled)
|
||||
@@ -555,6 +568,10 @@ rtw_btc_query_bt_info(struct btc_coexist *btc)
|
||||
BTC_TRACE(trace_buf);
|
||||
|
||||
rtw_btc_mailbox_operation(btc, 0x61, 1, h2c_parameter);
|
||||
|
||||
/* query le audio info*/
|
||||
if (chip_para->le_audio_support)
|
||||
rtw_btc_mailbox_operation(btc, 0x74, 1, h2c_parameter);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -700,6 +717,7 @@ rtw_btc_update_wl_link_info(struct btc_coexist *btc, u8 reason)
|
||||
btc->btc_get(btc, BTC_GET_U4_WIFI_BW, &linfo_ext->wifi_bw);
|
||||
btc->btc_get(btc, BTC_GET_U4_WIFI_LINK_STATUS, &wifi_link_status);
|
||||
linfo_ext->port_connect_status = wifi_link_status & 0xffff;
|
||||
linfo_ext->is_port_num_change = FALSE;
|
||||
|
||||
btc->btc_get(btc, BTC_GET_BL_WIFI_LINK_INFO, &linfo);
|
||||
btc->wifi_link_info = linfo;
|
||||
@@ -814,6 +832,10 @@ rtw_btc_update_wl_link_info(struct btc_coexist *btc, u8 reason)
|
||||
is_p2p_connected = TRUE;
|
||||
}
|
||||
|
||||
/* WQCPC-6129: To set REG_LIFETIME_EN correctly */
|
||||
if (linfo_ext->num_of_active_port != num_of_wifi_link)
|
||||
linfo_ext->is_port_num_change = TRUE;
|
||||
|
||||
linfo_ext->num_of_active_port = num_of_wifi_link;
|
||||
linfo_ext->is_p2p_connected = is_p2p_connected;
|
||||
|
||||
@@ -983,9 +1005,20 @@ rtw_btc_update_bt_link_info(struct btc_coexist *btc)
|
||||
}
|
||||
}
|
||||
|
||||
/* update le audio info*/
|
||||
if (coex_sta->bt_le_audio_exist) {
|
||||
if (coex_sta->bt_le_audio_BIS) {
|
||||
coex_sta->bt_profile_num++;
|
||||
}
|
||||
if (coex_sta->bt_le_audio_CIS) {
|
||||
coex_sta->bt_profile_num++;
|
||||
}
|
||||
}
|
||||
|
||||
if (coex_sta->bt_info_lb2 & BTC_INFO_INQ_PAGE) {
|
||||
coex_dm->bt_status = BTC_BTSTATUS_INQ_PAGE;
|
||||
} else if (!(coex_sta->bt_info_lb2 & BTC_INFO_CONNECTION)) {
|
||||
} else if (!(coex_sta->bt_info_lb2 & BTC_INFO_CONNECTION) &&
|
||||
!coex_sta->bt_le_audio_exist) {
|
||||
coex_dm->bt_status = BTC_BTSTATUS_NCON_IDLE;
|
||||
coex_sta->bt_multi_link_remain = FALSE;
|
||||
} else if (coex_sta->bt_info_lb2 == BTC_INFO_CONNECTION) {
|
||||
@@ -1001,6 +1034,8 @@ rtw_btc_update_bt_link_info(struct btc_coexist *btc)
|
||||
coex_dm->bt_status = BTC_BTSTATUS_SCO_BUSY;
|
||||
} else if (coex_sta->bt_info_lb2 & BTC_INFO_ACL_BUSY) {
|
||||
coex_dm->bt_status = BTC_BTSTATUS_ACL_BUSY;
|
||||
} else if (coex_sta->bt_le_audio_exist) {
|
||||
coex_dm->bt_status = BTC_BTSTATUS_LE_AUDIO_BUSY;
|
||||
} else {
|
||||
coex_dm->bt_status = BTC_BTSTATUS_MAX;
|
||||
}
|
||||
@@ -1077,11 +1112,19 @@ rtw_btc_update_wl_ch_info(struct btc_coexist *btc, u8 type)
|
||||
} else if(btc->board_info.btdm_ant_num == 1 && wl_center_ch <= 14) {
|
||||
h2c_para[0] = 0x1;
|
||||
h2c_para[1] = wl_center_ch;
|
||||
/* 8723f shared ant, BT should avoid wifi channel */
|
||||
if (link_info_ext->wifi_bw == BTC_WIFI_BW_HT40)
|
||||
h2c_para[2] = 0x28;
|
||||
else
|
||||
h2c_para[2] = 0x14;
|
||||
/* 8723f shared ant, BT should avoid wifi channel
|
||||
for 1T1R, BT should avoid more channel */
|
||||
if (link_info_ext->wifi_bw == BTC_WIFI_BW_HT40) {
|
||||
if (coex_sta->wl_coex_mode == BTC_WLINK_2GFREE)
|
||||
h2c_para[2] = 0x36;
|
||||
else
|
||||
h2c_para[2] = 0x28;
|
||||
} else {
|
||||
if (coex_sta->wl_coex_mode == BTC_WLINK_2GFREE)
|
||||
h2c_para[2] = 0x24;
|
||||
else
|
||||
h2c_para[2] = 0x14;
|
||||
}
|
||||
} else if (wl_center_ch <= 14) {
|
||||
h2c_para[0] = 0x1;
|
||||
h2c_para[1] = wl_center_ch;
|
||||
@@ -1161,15 +1204,17 @@ rtw_btc_set_bt_tx_power(struct btc_coexist *btc,
|
||||
|
||||
static void
|
||||
rtw_btc_set_wl_rx_gain(struct btc_coexist *btc, boolean force_exec,
|
||||
boolean low_gain_en)
|
||||
boolean low_gain_en, u8 lna2_level)
|
||||
{
|
||||
struct btc_coex_dm *coex_dm = &btc->coex_dm;
|
||||
const struct btc_chip_para *chip_para = btc->chip_para;
|
||||
|
||||
if (!force_exec && low_gain_en == coex_dm->cur_wl_rx_low_gain_en)
|
||||
if (!force_exec && low_gain_en == coex_dm->cur_wl_rx_low_gain_en &&
|
||||
lna2_level == coex_dm->lna2_level)
|
||||
return;
|
||||
|
||||
coex_dm->cur_wl_rx_low_gain_en = low_gain_en;
|
||||
coex_dm->lna2_level = lna2_level;
|
||||
|
||||
if (low_gain_en)
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE, "[BTCoex], Hi-L Rx!\n");
|
||||
@@ -1212,21 +1257,78 @@ rtw_btc_set_bt_rx_gain(struct btc_coexist *btc, boolean force_exec, u8 lna_lvl)
|
||||
BTC_TRACE(trace_buf);
|
||||
}
|
||||
|
||||
static void
|
||||
rtw_btc_set_bt_rx_agc(struct btc_coexist *btc)
|
||||
{
|
||||
struct btc_coex_sta *coex_sta = &btc->coex_sta;
|
||||
struct btc_wifi_link_info linfo;
|
||||
struct btc_wifi_link_info_ext *linfo_ext = &btc->wifi_link_info_ext;
|
||||
boolean bt_hi_lna_rx = FALSE;
|
||||
|
||||
btc->btc_get(btc, BTC_GET_BL_WIFI_LINK_INFO, &linfo);
|
||||
btc->wifi_link_info = linfo;
|
||||
|
||||
/* true: bt use Hi-LNA rx gain table in -3x~-9xdBm for co-rx
|
||||
* false: bt use original rx gain table
|
||||
*/
|
||||
if (linfo_ext->is_all_under_5g || btc->board_info.btdm_ant_num != 1 ||
|
||||
linfo.link_mode == BTC_LINK_NONE)
|
||||
bt_hi_lna_rx = FALSE;
|
||||
else
|
||||
bt_hi_lna_rx = TRUE;
|
||||
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
|
||||
"[BTCoex], %s(): bt_hi_lna_rx = %d\n",
|
||||
__func__, bt_hi_lna_rx);
|
||||
BTC_TRACE(trace_buf);
|
||||
|
||||
if (coex_sta->bt_hi_lna_rx == bt_hi_lna_rx)
|
||||
return;
|
||||
|
||||
coex_sta->bt_hi_lna_rx = bt_hi_lna_rx;
|
||||
|
||||
if (btc->chip_para->scbd_bit_num == BTC_SCBD_16_BIT)
|
||||
btc->btc_write_scbd(btc, BTC_SCBD_BT_HILNA, bt_hi_lna_rx);
|
||||
else
|
||||
btc->btc_write_scbd_32bit(btc, BTC_SCBD_BT_HILNA, bt_hi_lna_rx);
|
||||
}
|
||||
|
||||
static void
|
||||
rtw_btc_set_rf_para(struct btc_coexist *btc, boolean force_exec,
|
||||
struct btc_rf_para para)
|
||||
{
|
||||
struct btc_coex_sta *coex_sta = &btc->coex_sta;
|
||||
u8 tmp = 0;
|
||||
struct btc_coex_dm *coex_dm = &btc->coex_dm;
|
||||
u8 tmp = 0, lna2_level = 0;
|
||||
|
||||
if (coex_sta->coex_freerun) {
|
||||
if (coex_sta->cnt_wl[BTC_CNT_WL_SCANAP] <= 5)
|
||||
tmp = 3;
|
||||
}
|
||||
|
||||
/* fix LNA2 + TIA gain not change by GNT_BT */
|
||||
if (btc->board_info.btdm_ant_num == 1) { /* Shared-Ant */
|
||||
if (coex_sta->bt_profile_num == 0) {
|
||||
lna2_level = 0;
|
||||
} else {
|
||||
lna2_level = 1;
|
||||
}
|
||||
} else { /* Non-Shared-Ant */
|
||||
if (coex_sta->coex_freerun) {
|
||||
lna2_level = 1;
|
||||
} else {
|
||||
lna2_level = 0;
|
||||
}
|
||||
}
|
||||
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
|
||||
"[BTCoex], %s(): lna2 level = %d\n",
|
||||
__func__, lna2_level);
|
||||
BTC_TRACE(trace_buf);
|
||||
|
||||
rtw_btc_set_wl_tx_power(btc, force_exec, para.wl_pwr_dec_lvl);
|
||||
rtw_btc_set_bt_tx_power(btc, force_exec, para.bt_pwr_dec_lvl + tmp);
|
||||
rtw_btc_set_wl_rx_gain(btc, force_exec, para.wl_low_gain_en);
|
||||
rtw_btc_set_wl_rx_gain(btc, force_exec, para.wl_low_gain_en, lna2_level);
|
||||
rtw_btc_set_bt_rx_gain(btc, force_exec, para.bt_lna_lvl);
|
||||
}
|
||||
|
||||
@@ -1655,18 +1757,32 @@ void rtw_btc_tdma(struct btc_coexist *btc, boolean force_exec, u32 tcase)
|
||||
"[BTCoex], ***** TDMA - %d *****\n", type);
|
||||
BTC_TRACE(trace_buf);
|
||||
|
||||
/* TRUE -> Page scan > ACL */
|
||||
if (!wifi_busy ||
|
||||
(coex_sta->bt_a2dp_exist && coex_sta->bt_inq_page_remain)) {
|
||||
if (chip_para->scbd_bit_num == BTC_SCBD_16_BIT)
|
||||
btc->btc_write_scbd(btc, BTC_SCBD_TDMA, FALSE);
|
||||
else
|
||||
btc->btc_write_scbd_32bit(btc, BTC_SCBD_TDMA, FALSE);
|
||||
if (chip_para->new_scbd9_def) {
|
||||
if (turn_on) {
|
||||
if (chip_para->scbd_bit_num == BTC_SCBD_16_BIT)
|
||||
btc->btc_write_scbd(btc, BTC_SCBD_TDMA, TRUE);
|
||||
else
|
||||
btc->btc_write_scbd_32bit(btc, BTC_SCBD_TDMA, TRUE);
|
||||
} else {
|
||||
if (chip_para->scbd_bit_num == BTC_SCBD_16_BIT)
|
||||
btc->btc_write_scbd(btc, BTC_SCBD_TDMA, FALSE);
|
||||
else
|
||||
btc->btc_write_scbd_32bit(btc, BTC_SCBD_TDMA, FALSE);
|
||||
}
|
||||
} else {
|
||||
if (chip_para->scbd_bit_num == BTC_SCBD_16_BIT)
|
||||
btc->btc_write_scbd(btc, BTC_SCBD_TDMA, TRUE);
|
||||
else
|
||||
btc->btc_write_scbd_32bit(btc, BTC_SCBD_TDMA, TRUE);
|
||||
/* TRUE -> Page scan > ACL */
|
||||
if (!wifi_busy || !coex_sta->wl_gl_busy ||
|
||||
(coex_sta->bt_a2dp_exist && coex_sta->bt_inq_page_remain)) {
|
||||
if (chip_para->scbd_bit_num == BTC_SCBD_16_BIT)
|
||||
btc->btc_write_scbd(btc, BTC_SCBD_TDMA, FALSE);
|
||||
else
|
||||
btc->btc_write_scbd_32bit(btc, BTC_SCBD_TDMA, FALSE);
|
||||
} else {
|
||||
if (chip_para->scbd_bit_num == BTC_SCBD_16_BIT)
|
||||
btc->btc_write_scbd(btc, BTC_SCBD_TDMA, TRUE);
|
||||
else
|
||||
btc->btc_write_scbd_32bit(btc, BTC_SCBD_TDMA, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
if (btc->board_info.btdm_ant_num == 1) {
|
||||
@@ -2334,10 +2450,7 @@ static void rtw_btc_action_bt_relink(struct btc_coexist *btc)
|
||||
tdma_case = 0;
|
||||
}
|
||||
} else { /* Non-Shared-Ant */
|
||||
if (coex_sta->wl_gl_busy)
|
||||
table_case = 115;
|
||||
else
|
||||
table_case = 100;
|
||||
table_case = 100;
|
||||
tdma_case = 100;
|
||||
|
||||
if (coex_sta->wl_gl_busy &&
|
||||
@@ -2403,13 +2516,14 @@ static void rtw_btc_action_bt_idle(struct btc_coexist *btc)
|
||||
table_case = 26;
|
||||
tdma_case = 7;
|
||||
} else if (coex_dm->bt_status == BTC_BTSTATUS_NCON_IDLE) {
|
||||
table_case = 11;
|
||||
|
||||
if (coex_sta->bt_ctr_ok &&
|
||||
(coex_sta->lo_pri_rx + coex_sta->lo_pri_tx > 250))
|
||||
tdma_case = 17;
|
||||
else
|
||||
tdma_case = 7;
|
||||
(coex_sta->lo_pri_rx + coex_sta->lo_pri_tx > 250)) {
|
||||
table_case = 11;
|
||||
tdma_case = 19;
|
||||
} else {
|
||||
table_case = 37;
|
||||
tdma_case = 0;
|
||||
}
|
||||
} else {
|
||||
table_case = 12;
|
||||
tdma_case = 7;
|
||||
@@ -2554,17 +2668,12 @@ static void rtw_btc_action_bt_hfp(struct btc_coexist *btc)
|
||||
table_case = 33;
|
||||
tdma_case = 0;
|
||||
} else {
|
||||
table_case = 10;
|
||||
tdma_case = 5;
|
||||
table_case = 36;
|
||||
tdma_case = 0;
|
||||
}
|
||||
} else { /* Non-Shared-Ant */
|
||||
if (coex_sta->bt_multi_link) {
|
||||
table_case = 112;
|
||||
tdma_case = 117;
|
||||
} else {
|
||||
table_case = 105;
|
||||
tdma_case = 100;
|
||||
}
|
||||
table_case = 105;
|
||||
tdma_case = 100;
|
||||
}
|
||||
|
||||
rtw_btc_table(btc, NM_EXCU, table_case);
|
||||
@@ -2623,8 +2732,8 @@ static void rtw_btc_action_bt_hid(struct btc_coexist *btc)
|
||||
tdma_case = 27;
|
||||
} else if (coex_sta->bt_ble_hid_exist &&
|
||||
coex_sta->wl_gl_busy) {
|
||||
table_case = 32;
|
||||
tdma_case = 9;
|
||||
table_case = 36;
|
||||
tdma_case = 0;
|
||||
} else {
|
||||
table_case = 9;
|
||||
tdma_case = 9;
|
||||
@@ -2952,6 +3061,57 @@ static void rtw_btc_action_bt_a2dp_pan_hid(struct btc_coexist *btc)
|
||||
rtw_btc_tdma(btc, NM_EXCU, tdma_case);
|
||||
}
|
||||
|
||||
static void rtw_btc_action_bt_BIS(struct btc_coexist *btc)
|
||||
{
|
||||
struct btc_coex_sta *coex_sta = &btc->coex_sta;
|
||||
u8 table_case, tdma_case;
|
||||
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE, "[BTCoex], %s()\n", __func__);
|
||||
BTC_TRACE(trace_buf);
|
||||
|
||||
rtw_btc_set_ant_path(btc, NM_EXCU, BTC_ANT_2G);
|
||||
rtw_btc_set_rf_para(btc, NM_EXCU, btc->chip_para->wl_rf_para_rx[0]);
|
||||
|
||||
if (btc->board_info.btdm_ant_num == 1) { /* Shared-Ant */
|
||||
coex_sta->wl_coex_mode = BTC_WLINK_2GFREE;
|
||||
table_case = 39;
|
||||
tdma_case = 0;
|
||||
#if 0
|
||||
/* TDMA by wifi fw */
|
||||
table_case = 38;
|
||||
tdma_case = 28;
|
||||
#endif
|
||||
} else { /* Non-Shared-Ant */
|
||||
table_case = 100;
|
||||
tdma_case = 100;
|
||||
}
|
||||
|
||||
rtw_btc_table(btc, NM_EXCU, table_case);
|
||||
rtw_btc_tdma(btc, NM_EXCU, tdma_case);
|
||||
}
|
||||
|
||||
static void rtw_btc_action_bt_CIS(struct btc_coexist *btc)
|
||||
{
|
||||
struct btc_coex_sta *coex_sta = &btc->coex_sta;
|
||||
u8 table_case, tdma_case;
|
||||
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE, "[BTCoex], %s()\n", __func__);
|
||||
BTC_TRACE(trace_buf);
|
||||
|
||||
rtw_btc_set_ant_path(btc, NM_EXCU, BTC_ANT_2G);
|
||||
rtw_btc_set_rf_para(btc, NM_EXCU, btc->chip_para->wl_rf_para_rx[0]);
|
||||
if (btc->board_info.btdm_ant_num == 1) { /* Shared-Ant */
|
||||
table_case = 36;
|
||||
tdma_case = 0;
|
||||
} else { /* Non-Shared-Ant */
|
||||
table_case = 100;
|
||||
tdma_case = 100;
|
||||
}
|
||||
|
||||
rtw_btc_table(btc, NM_EXCU, table_case);
|
||||
rtw_btc_tdma(btc, NM_EXCU, tdma_case);
|
||||
}
|
||||
|
||||
static void rtw_btc_action_wl_off(struct btc_coexist *btc)
|
||||
{
|
||||
const struct btc_chip_para *chip_para = btc->chip_para;
|
||||
@@ -3073,7 +3233,11 @@ static void rtw_btc_action_wl_linkscan(struct btc_coexist *btc)
|
||||
} else if (coex_sta->bt_a2dp_exist) {
|
||||
slot_type = TDMA_4SLOT;
|
||||
table_case = 9;
|
||||
tdma_case = 11;
|
||||
if (coex_sta->bt_a2dp_sink) {
|
||||
tdma_case = 10;
|
||||
} else {
|
||||
tdma_case = 11;
|
||||
}
|
||||
} else if (coex_sta->bt_hid_exist) {
|
||||
if (link_info_ext->is_connected) {
|
||||
table_case = 36;
|
||||
@@ -3090,9 +3254,8 @@ static void rtw_btc_action_wl_linkscan(struct btc_coexist *btc)
|
||||
table_case = 124;
|
||||
tdma_case = 108;
|
||||
} else if (coex_sta->bt_a2dp_exist) {
|
||||
slot_type = TDMA_4SLOT;
|
||||
table_case = 124;
|
||||
tdma_case = 126;
|
||||
table_case = 100;
|
||||
tdma_case = 100;
|
||||
} else {
|
||||
table_case = 112;
|
||||
tdma_case = 107;
|
||||
@@ -3147,15 +3310,28 @@ static void rtw_btc_action_wl_connected(struct btc_coexist *btc)
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE, "[BTCoex], %s()\n", __func__);
|
||||
BTC_TRACE(trace_buf);
|
||||
|
||||
/*Leap-AP protection will reopen when connecting AP*/
|
||||
rtw_btc_wl_leakap(btc, TRUE);
|
||||
|
||||
if ((btc->board_info.btdm_ant_num == 2) &&
|
||||
(btc->board_info.ext_chip_id != BTC_EXT_CHIP_NONE)) {
|
||||
rtw_btc_action_ext_chip(btc);
|
||||
return;
|
||||
}
|
||||
|
||||
if (coex_sta->bt_le_audio_BIS) {
|
||||
if (rtw_btc_freerun_check(btc))
|
||||
rtw_btc_action_freerun(btc);
|
||||
else
|
||||
rtw_btc_action_bt_BIS(btc);
|
||||
return;
|
||||
}
|
||||
|
||||
if (coex_sta->bt_le_audio_CIS) {
|
||||
if (rtw_btc_freerun_check(btc))
|
||||
rtw_btc_action_freerun(btc);
|
||||
else
|
||||
rtw_btc_action_bt_CIS(btc);
|
||||
return;
|
||||
}
|
||||
|
||||
algorithm = rtw_btc_algorithm(btc);
|
||||
|
||||
switch (algorithm) {
|
||||
@@ -3426,14 +3602,7 @@ static void rtw_btc_action_wl_p2p2g(struct btc_coexist *btc)
|
||||
case BTC_LINK_ONLY_GO:
|
||||
case BTC_LINK_ONLY_GC:
|
||||
rtw_btc_set_ant_path(btc, NM_EXCU, BTC_ANT_2G);
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
if (btc->chip_interface == BTC_INTF_PCI &&
|
||||
coex_sta->bt_a2dp_exist && !coex_sta->bt_multi_link)
|
||||
table_case = 3;
|
||||
else
|
||||
#endif
|
||||
table_case = 2;
|
||||
|
||||
table_case = 3;
|
||||
tdma_case = 0;
|
||||
break;
|
||||
default:
|
||||
@@ -3602,6 +3771,14 @@ exit:
|
||||
|
||||
rtw_btc_gnt_workaround(btc, NM_EXCU, coex_sta->wl_coex_mode);
|
||||
rtw_btc_limited_wl(btc);
|
||||
rtw_btc_set_bt_rx_agc(btc);
|
||||
|
||||
if (reason == BTC_RSN_2GMEDIA) {
|
||||
/*Leap-AP protection will reopen when connecting AP*/
|
||||
rtw_btc_wl_leakap(btc, TRUE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void rtw_btc_init_coex_var(struct btc_coexist *btc)
|
||||
@@ -3733,7 +3910,7 @@ void rtw_btc_ex_power_on_setting(struct btc_coexist *btc)
|
||||
/* SD1 Chunchu red x issue */
|
||||
btc->btc_write_1byte(btc, 0xff1a, 0x0);
|
||||
|
||||
rtw_btc_gnt_debug(btc, TRUE);
|
||||
rtw_btc_gnt_debug(btc, FALSE);
|
||||
|
||||
board_info->btdm_ant_pos = BTC_ANTENNA_AT_MAIN_PORT;
|
||||
}
|
||||
@@ -3936,25 +4113,25 @@ void rtw_btc_ex_display_coex_info(struct btc_coexist *btc)
|
||||
coex_sta->bt_slave_latency = FALSE;
|
||||
}
|
||||
|
||||
if (strcmp(btc->chip_para->chip_name, "8723f") == 0) {
|
||||
/*8723f cannot read ae because ALIGNMENT_UNIT = 4byte
|
||||
8723f should read bt vendor reg 0xdac*/
|
||||
if (coex_sta->bt_reg_vendor_dac == 0xffffffff) {
|
||||
val = btc->btc_get_bt_reg(btc, 3, 0xdac);
|
||||
coex_sta->bt_reg_vendor_dac = val;
|
||||
}
|
||||
} else {
|
||||
if (coex_sta->bt_reg_vendor_ac == 0xffff) {
|
||||
val = btc->btc_get_bt_reg(btc, 3, 0xac);
|
||||
coex_sta->bt_reg_vendor_ac = (u16)(val & 0xffff);
|
||||
}
|
||||
|
||||
if (coex_sta->bt_reg_vendor_ae == 0xffff) {
|
||||
val = btc->btc_get_bt_reg(btc, 3, 0xae);
|
||||
coex_sta->bt_reg_vendor_ae = (u16)(val & 0xffff);
|
||||
}
|
||||
/* COEX-731: 8723f/8822e need to match bt fw version
|
||||
* to avoid 4 byte alignment issue
|
||||
*/
|
||||
if (coex_sta->bt_reg_vendor_dae == 0xffff) {
|
||||
val = btc->btc_get_bt_reg(btc, 3, 0xdae);
|
||||
coex_sta->bt_reg_vendor_dae = (u16)(val & 0xffff);
|
||||
}
|
||||
|
||||
if (coex_sta->bt_reg_vendor_ac == 0xffff) {
|
||||
val = btc->btc_get_bt_reg(btc, 3, 0xac);
|
||||
coex_sta->bt_reg_vendor_ac = (u16)(val & 0xffff);
|
||||
}
|
||||
|
||||
if (coex_sta->bt_reg_vendor_ae == 0xffff) {
|
||||
val = btc->btc_get_bt_reg(btc, 3, 0xae);
|
||||
coex_sta->bt_reg_vendor_ae = (u16)(val & 0xffff);
|
||||
}
|
||||
|
||||
|
||||
val = btc->btc_get_bt_reg(btc, 4, 0x200);
|
||||
coex_sta->bt_reg_le_200 = (u16)(val & 0xffff);
|
||||
|
||||
@@ -4043,7 +4220,7 @@ void rtw_btc_ex_display_coex_info(struct btc_coexist *btc)
|
||||
|
||||
if (coex_sta->bt_profile_num != 0) {
|
||||
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE,
|
||||
"\r\n %-35s = %s%s%s%s%s%s (multilink = %d)",
|
||||
"\r\n %-35s = %s%s%s%s%s%s%s%s (multilink = %d)",
|
||||
"Profiles", ((coex_sta->bt_a2dp_exist) ?
|
||||
((coex_sta->bt_a2dp_sink) ? "A2DP sink," :
|
||||
"A2DP,") : ""),
|
||||
@@ -4056,6 +4233,8 @@ void rtw_btc_ex_display_coex_info(struct btc_coexist *btc)
|
||||
((coex_sta->bt_opp_exist) ? "OPP," : "PAN,") :
|
||||
""), ((coex_sta->bt_ble_voice) ? "Voice," : ""),
|
||||
((coex_sta->bt_msft_mr_exist) ? "MR" : ""),
|
||||
((coex_sta->bt_le_audio_BIS) ? "BIS," : ""),
|
||||
((coex_sta->bt_le_audio_CIS) ? "CIS," : ""),
|
||||
coex_sta->bt_multi_link);
|
||||
CL_PRINTF(cli_buf);
|
||||
|
||||
@@ -4138,19 +4317,20 @@ void rtw_btc_ex_display_coex_info(struct btc_coexist *btc)
|
||||
|
||||
if (coex_sta->bt_reg_vendor_ae != 0xffff ||
|
||||
coex_sta->bt_reg_vendor_ac != 0xffff ||
|
||||
coex_sta->bt_reg_vendor_dac != 0xffffffff) {
|
||||
coex_sta->bt_reg_vendor_dae != 0xffff) {
|
||||
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE,
|
||||
"\r\n %-35s = 0x%x/ 0x%x/ 0x%x/ 0x%x/ 0x%x/ %s",
|
||||
"ae/ac/dac/m_a[8:6]/ScBd(B->W)/path",
|
||||
"ae/ac/dae/m_a[8:6]/ScBd(B->W)/path",
|
||||
coex_sta->bt_reg_vendor_ae,
|
||||
coex_sta->bt_reg_vendor_ac,
|
||||
coex_sta->bt_reg_vendor_dac,
|
||||
coex_sta->bt_reg_vendor_dae,
|
||||
coex_sta->bt_reg_modem_a,
|
||||
((chip_para->scbd_bit_num == BTC_SCBD_16_BIT) ?
|
||||
btc->btc_read_scbd(btc, &scbd) :
|
||||
btc->btc_read_scbd_32bit(btc, &scbd_32)),
|
||||
((coex_sta->bt_reg_vendor_ae & BIT(4)) ? "S1" : "S0"
|
||||
));
|
||||
((strcmp(btc->chip_para->chip_name, "8822c") == 0) ?
|
||||
((coex_sta->bt_reg_vendor_ae & BIT(4)) ? "S1" : "S0") :
|
||||
((coex_sta->bt_reg_vendor_dae & BIT(4)) ? "S1" : "S0")));
|
||||
CL_PRINTF(cli_buf);
|
||||
|
||||
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE,
|
||||
@@ -4161,7 +4341,7 @@ void rtw_btc_ex_display_coex_info(struct btc_coexist *btc)
|
||||
} else {
|
||||
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE,
|
||||
"\r\n %-35s = x/ x/ x/ 0x%x",
|
||||
"0xae[4]/0xac[1:0]/0xdac/ScBd(B->W)",
|
||||
"0xae[4]/0xac[1:0]/0xdae/ScBd(B->W)",
|
||||
((chip_para->scbd_bit_num == BTC_SCBD_16_BIT) ?
|
||||
btc->btc_read_scbd(btc, &scbd) :
|
||||
btc->btc_read_scbd_32bit(btc, &scbd_32)));
|
||||
@@ -4209,6 +4389,25 @@ void rtw_btc_ex_display_coex_info(struct btc_coexist *btc)
|
||||
}
|
||||
}
|
||||
|
||||
if (chip_para->le_audio_support) {
|
||||
for (i = 0; i < BTC_BT_LE_AUDIO_INFO_SRC_MAX; i++) {
|
||||
if (coex_sta->cnt_bt_le_audio_info_c2h[i]) {
|
||||
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE,
|
||||
"\r\n %-35s = %02x %02x %02x %02x %02x %02x %02x (%d)",
|
||||
glbt_le_audio_info_src[i],
|
||||
coex_sta->bt_le_audio_info_c2h[i][0],
|
||||
coex_sta->bt_le_audio_info_c2h[i][1],
|
||||
coex_sta->bt_le_audio_info_c2h[i][2],
|
||||
coex_sta->bt_le_audio_info_c2h[i][3],
|
||||
coex_sta->bt_le_audio_info_c2h[i][4],
|
||||
coex_sta->bt_le_audio_info_c2h[i][5],
|
||||
coex_sta->bt_le_audio_info_c2h[i][6],
|
||||
coex_sta->cnt_bt_le_audio_info_c2h[i]);
|
||||
CL_PRINTF(cli_buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (btc->manual_control) {
|
||||
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s",
|
||||
"============[mechanisms] (under Manual)============");
|
||||
@@ -4302,6 +4501,12 @@ void rtw_btc_ex_display_coex_info(struct btc_coexist *btc)
|
||||
coex_dm->cur_bt_lna_lvl);
|
||||
CL_PRINTF(cli_buf);
|
||||
|
||||
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %s",
|
||||
"WL_lna2_Lvl/BT_lna_rx",
|
||||
coex_dm->lna2_level,
|
||||
((coex_sta->bt_hi_lna_rx) ? "High" : "Org"));
|
||||
CL_PRINTF(cli_buf);
|
||||
|
||||
CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d/ %d/ %s",
|
||||
"MIMO_PS On/Recover/BlackAP",
|
||||
coex_sta->cnt_wl[BTC_CNT_WL_2G_FDDSTAY],
|
||||
@@ -4854,7 +5059,7 @@ void rtw_btc_ex_bt_info_notify(struct btc_coexist *btc, u8 *tmp_buf, u8 length)
|
||||
if (rsp_source >= BTC_BTINFO_SRC_MAX)
|
||||
return;
|
||||
|
||||
/* COEX-649, prevent TDMA parametet change in LeisurePSEnter()*/
|
||||
/* COEX-649, prevent TDMA parameter change in LeisurePSEnter()*/
|
||||
if (coex_sta->wl_in_lps_enter) {
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
|
||||
"[BTCoex], %s(): wl_in_LPSenter = %d\n",
|
||||
@@ -5150,6 +5355,101 @@ void rtw_btc_ex_bt_info_notify(struct btc_coexist *btc, u8 *tmp_buf, u8 length)
|
||||
|
||||
rtw_btc_update_bt_link_info(btc);
|
||||
|
||||
/* COEX-649, prevent TDMA parameter change in LeisurePSEnter()*/
|
||||
if (!coex_sta->wl_in_lps_enter)
|
||||
rtw_btc_run_coex(btc, BTC_RSN_BTINFO);
|
||||
}
|
||||
|
||||
void rtw_btc_ex_bt_le_audio_info_notify(struct btc_coexist *btc, u8 *tmp_buf, u8 length)
|
||||
{
|
||||
struct btc_coex_sta *coex_sta = &btc->coex_sta;
|
||||
u8 rsp_source = 0, i = 0;
|
||||
|
||||
rsp_source = tmp_buf[0] & 0xf;
|
||||
if (rsp_source >= BTC_BT_LE_AUDIO_INFO_SRC_MAX)
|
||||
return;
|
||||
|
||||
/* COEX-649, prevent TDMA parameter change in LeisurePSEnter()*/
|
||||
if (coex_sta->wl_in_lps_enter) {
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
|
||||
"[BTCoex], %s(): wl_in_LPSenter = %d\n",
|
||||
__func__, coex_sta->wl_in_lps_enter);
|
||||
BTC_TRACE(trace_buf);
|
||||
}
|
||||
|
||||
coex_sta->cnt_bt_le_audio_info_c2h[rsp_source]++;
|
||||
|
||||
if (rsp_source == BTC_BT_LE_AUDIO_INFO_SRC_BT_RSP ||
|
||||
rsp_source == BTC_BT_LE_AUDIO_INFO_SRC_BT_ACT) {
|
||||
if (coex_sta->bt_disabled) {
|
||||
coex_sta->bt_disabled = FALSE;
|
||||
coex_sta->bt_reenable = TRUE;
|
||||
btc->btc_set_timer(btc, BTC_TIMER_BT_REENABLE, 15);
|
||||
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
|
||||
"[BTCoex], %s(): BT enable detected by bt_info\n",
|
||||
__func__);
|
||||
BTC_TRACE(trace_buf);
|
||||
}
|
||||
}
|
||||
|
||||
if (length != 7) {
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
|
||||
"[BTCoex], %s(): Bt_le_audio_info length = %d invalid!!\n",
|
||||
__func__, length);
|
||||
BTC_TRACE(trace_buf);
|
||||
return;
|
||||
}
|
||||
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
|
||||
"[BTCoex], %s(): Bt_le_audio_info[%d], len=%d, data=[%02x %02x %02x %02x %02x %02x]\n",
|
||||
__func__, tmp_buf[0], length, tmp_buf[1], tmp_buf[2],
|
||||
tmp_buf[3], tmp_buf[4], tmp_buf[5], tmp_buf[6]);
|
||||
BTC_TRACE(trace_buf);
|
||||
|
||||
for (i = 0; i < 7; i++)
|
||||
coex_sta->bt_le_audio_info_c2h[rsp_source][i] = tmp_buf[i];
|
||||
|
||||
if (coex_sta->bt_le_audio_info_c2h[rsp_source][1] == coex_sta->bt_le_audio_info_lb2 &&
|
||||
coex_sta->bt_le_audio_info_c2h[rsp_source][2] == coex_sta->bt_le_audio_info_lb3 &&
|
||||
coex_sta->bt_le_audio_info_c2h[rsp_source][3] == coex_sta->bt_le_audio_info_hb0 &&
|
||||
coex_sta->bt_le_audio_info_c2h[rsp_source][4] == coex_sta->bt_le_audio_info_hb1 &&
|
||||
coex_sta->bt_le_audio_info_c2h[rsp_source][5] == coex_sta->bt_le_audio_info_hb2 &&
|
||||
coex_sta->bt_le_audio_info_c2h[rsp_source][6] == coex_sta->bt_le_audio_info_hb3) {
|
||||
BTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,
|
||||
"[BTCoex], Return because Bt le audio info duplicate!!\n");
|
||||
BTC_TRACE(trace_buf);
|
||||
return;
|
||||
}
|
||||
|
||||
coex_sta->bt_le_audio_info_lb2 = coex_sta->bt_le_audio_info_c2h[rsp_source][1];
|
||||
coex_sta->bt_le_audio_info_lb3 = coex_sta->bt_le_audio_info_c2h[rsp_source][2];
|
||||
coex_sta->bt_le_audio_info_hb0 = coex_sta->bt_le_audio_info_c2h[rsp_source][3];
|
||||
coex_sta->bt_le_audio_info_hb1 = coex_sta->bt_le_audio_info_c2h[rsp_source][4];
|
||||
coex_sta->bt_le_audio_info_hb2 = coex_sta->bt_le_audio_info_c2h[rsp_source][5];
|
||||
coex_sta->bt_le_audio_info_hb3 = coex_sta->bt_le_audio_info_c2h[rsp_source][6];
|
||||
|
||||
/* ========== BT LE audio info Low-Byte2 ========== */
|
||||
coex_sta->bt_le_audio_exist =
|
||||
((coex_sta->bt_le_audio_info_lb2 & BIT(0)) == BIT(0));
|
||||
|
||||
coex_sta->bt_le_audio_BIS =
|
||||
((coex_sta->bt_le_audio_info_lb2 & BIT(1)) == BIT(1));
|
||||
|
||||
coex_sta->bt_le_audio_CIS =
|
||||
((coex_sta->bt_le_audio_info_lb2 & BIT(2)) == BIT(2));
|
||||
|
||||
/* ========== BT info Low-Byte3 ========== */
|
||||
if (coex_sta->bt_le_audio_info_lb3 <= 127)
|
||||
coex_sta->bt_le_audio_rssi = 100;
|
||||
else if (256 - coex_sta->bt_le_audio_info_lb3 <= 100)
|
||||
coex_sta->bt_le_audio_rssi = 100 - (256 - coex_sta->bt_le_audio_info_lb3);
|
||||
else
|
||||
coex_sta->bt_le_audio_rssi = 0;
|
||||
|
||||
rtw_btc_update_bt_link_info(btc);
|
||||
|
||||
/* COEX-649, prevent TDMA parameter change in LeisurePSEnter()*/
|
||||
if (!coex_sta->wl_in_lps_enter)
|
||||
rtw_btc_run_coex(btc, BTC_RSN_BTINFO);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ void rtw_btc_ex_connect_notify(struct btc_coexist *btc, u8 type);
|
||||
void rtw_btc_ex_media_status_notify(struct btc_coexist *btc, u8 type);
|
||||
void rtw_btc_ex_specific_packet_notify(struct btc_coexist *btc, u8 type);
|
||||
void rtw_btc_ex_bt_info_notify(struct btc_coexist *btc, u8 *tmp_buf, u8 length);
|
||||
void rtw_btc_ex_bt_le_audio_info_notify(struct btc_coexist *btc, u8 *tmp_buf, u8 length);
|
||||
void rtw_btc_ex_wl_fwdbginfo_notify(struct btc_coexist *btc, u8 *tmp_buf,
|
||||
u8 length);
|
||||
void rtw_btc_ex_rx_rate_change_notify(struct btc_coexist *btc,
|
||||
@@ -68,6 +69,7 @@ void rtw_btc_ex_wl_rfk_notify(struct btc_coexist *btc, u8 path,
|
||||
#define rtw_btc_ex_media_status_notify(btc, type)
|
||||
#define rtw_btc_ex_specific_packet_notify(btc, type)
|
||||
#define rtw_btc_ex_bt_info_notify(btc, tmp_buf, length)
|
||||
#define rtw_btc_ex_bt_le_audio_info_notify(btc, tmp_buf, length)
|
||||
#define rtw_btc_ex_wl_fwdbginfo_notify(btc, tmp_buf, length)
|
||||
#define rtw_btc_ex_rx_rate_change_notify(btc, is_data_frame, btc_rate_id)
|
||||
#define rtw_btc_ex_tx_rate_change_notify(btcoexist, tx_rate, tx_retry_ratio, \
|
||||
|
||||
@@ -184,6 +184,7 @@ do {\
|
||||
#define REG_CCK_CHECK 0x0454
|
||||
#define REG_AMPDU_MAX_TIME_V1 0x0455
|
||||
#define REG_TX_HANG_CTRL 0x045E
|
||||
#define REG_TX_HANG_CTRL_OPT 0x04FC
|
||||
#define REG_LIFETIME_EN 0x0426
|
||||
#define REG_BT_COEX_TABLE0 0x06C0
|
||||
#define REG_BT_COEX_TABLE1 0x06C4
|
||||
@@ -194,6 +195,7 @@ do {\
|
||||
#define REG_BT_STAT_CTRL 0x0778
|
||||
|
||||
#define BIT_EN_GNT_BT_AWAKE BIT(3)
|
||||
#define BIT_GNT_BT_OPT BIT(0)
|
||||
#define BIT_EN_BCN_FUNCTION BIT(3)
|
||||
#define BIT_EN_BCN_PKT_REL BIT(6)
|
||||
#define BIT_FEN_BB_GLB_RST BIT(1)
|
||||
@@ -244,6 +246,7 @@ typedef enum _BTC_CHIP_TYPE {
|
||||
BTC_CHIP_RTL8703B = 11,
|
||||
BTC_CHIP_RTL8725A = 12,
|
||||
BTC_CHIP_RTL8723F = 13,
|
||||
BTC_CHIP_RTL8822E = 14,
|
||||
BTC_CHIP_MAX
|
||||
} BTC_CHIP_TYPE, *PBTC_CHIP_TYPE;
|
||||
|
||||
@@ -265,6 +268,12 @@ static const char *const glbt_info_src[] = {
|
||||
"BT Info[bt auto report]",
|
||||
};
|
||||
|
||||
static const char *const glbt_le_audio_info_src[] = {
|
||||
"BT LE audio Info[wifi fw]",
|
||||
"BT LE audio Info[bt rsp]",
|
||||
"BT LE audio Info[bt auto report]"
|
||||
};
|
||||
|
||||
#define BTC_INFO_FTP BIT(7)
|
||||
#define BTC_INFO_A2DP BIT(6)
|
||||
#define BTC_INFO_HID BIT(5)
|
||||
@@ -336,6 +345,13 @@ enum btc_btinfo_src {
|
||||
BTC_BTINFO_SRC_MAX
|
||||
};
|
||||
|
||||
enum btc_bt_le_audio_info_src {
|
||||
BTC_BT_LE_AUDIO_INFO_SRC_WL_FW = 0x0,
|
||||
BTC_BT_LE_AUDIO_INFO_SRC_BT_RSP = 0x1,
|
||||
BTC_BT_LE_AUDIO_INFO_SRC_BT_ACT = 0x2,
|
||||
BTC_BT_LE_AUDIO_INFO_SRC_MAX
|
||||
};
|
||||
|
||||
enum btc_bt_profile {
|
||||
BTC_BTPROFILE_NONE = 0,
|
||||
BTC_BTPROFILE_HFP = BIT(0),
|
||||
@@ -371,6 +387,7 @@ enum btc_bt_status {
|
||||
BTC_BTSTATUS_ACL_BUSY = 0x3,
|
||||
BTC_BTSTATUS_SCO_BUSY = 0x4,
|
||||
BTC_BTSTATUS_ACL_SCO_BUSY = 0x5,
|
||||
BTC_BTSTATUS_LE_AUDIO_BUSY = 0x6,
|
||||
BTC_BTSTATUS_MAX
|
||||
};
|
||||
|
||||
@@ -381,6 +398,8 @@ static const char *const bt_status_string[] = {
|
||||
"BT ACL-busy",
|
||||
"BT SCO-busy",
|
||||
"BT ACL-SCO-busy",
|
||||
"BT LE-audio-BIS-busy",
|
||||
"BT LE-audio-CIS-busy",
|
||||
"BT Non-Defined-state"
|
||||
};
|
||||
|
||||
@@ -463,6 +482,7 @@ enum btc_wl2bt_scoreboard {
|
||||
BTC_SCBD_EXTFEM = BIT(8),
|
||||
BTC_SCBD_TDMA = BIT(9),
|
||||
BTC_SCBD_FIX2M = BIT(10),
|
||||
BTC_SCBD_BT_HILNA = BIT(13),
|
||||
BTC_SCBD_MAILBOX_DBG = BIT(14),
|
||||
BTC_SCBD_ALL = 0xffff,
|
||||
BTC_SCBD_ALL_32BIT = 0xffffffff
|
||||
@@ -702,6 +722,16 @@ enum btc_wl_rfk_state {
|
||||
BTC_RFK_STATE_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
BTC_BT_SS_GROUP_NON_SHARED_ANT = 0x0,
|
||||
BTC_BT_TX_GROUP_NON_SHARED_ANT = 0x1,
|
||||
BTC_BT_RX_GROUP_NON_SHARED_ANT = 0x2,
|
||||
BTC_BT_SS_GROUP_SHARED_ANT = 0x3,
|
||||
BTC_BT_TX_GROUP_SHARED_ANT = 0x4,
|
||||
BTC_BT_RX_GROUP_SHARED_ANT = 0x5,
|
||||
BTC_BT_MAX_GROUP
|
||||
};
|
||||
|
||||
struct btc_board_info {
|
||||
/* The following is some board information */
|
||||
u8 bt_chip_type;
|
||||
@@ -748,6 +778,7 @@ struct btc_coex_dm {
|
||||
u8 cur_toggle_para[6];
|
||||
u8 bt_slot_length1[10];
|
||||
u8 bt_slot_length2[10];
|
||||
u8 lna2_level;
|
||||
u32 cur_ant_pos_type;
|
||||
u32 cur_switch_status;
|
||||
u32 setting_tdma;
|
||||
@@ -796,6 +827,10 @@ struct btc_coex_sta {
|
||||
boolean bt_ble_hid_exist;
|
||||
boolean bt_mesh;
|
||||
boolean bt_ctr_ok;
|
||||
boolean bt_hi_lna_rx;
|
||||
boolean bt_le_audio_exist;
|
||||
boolean bt_le_audio_BIS;
|
||||
boolean bt_le_audio_CIS;
|
||||
|
||||
boolean wl_under_lps;
|
||||
boolean wl_in_lps_enter;
|
||||
@@ -831,15 +866,23 @@ struct btc_coex_sta {
|
||||
u8 gnt_workaround_state;
|
||||
u8 tdma_timer_base;
|
||||
u8 bt_rssi;
|
||||
u8 bt_le_audio_rssi;
|
||||
u8 bt_profile_num;
|
||||
u8 bt_profile_num_pre;
|
||||
u8 bt_info_c2h[BTC_BTINFO_SRC_MAX][BTC_BTINFO_LENGTH_MAX];
|
||||
u8 bt_le_audio_info_c2h[BTC_BT_LE_AUDIO_INFO_SRC_MAX][BTC_BTINFO_LENGTH_MAX];
|
||||
u8 bt_info_lb2;
|
||||
u8 bt_info_lb3;
|
||||
u8 bt_info_hb0;
|
||||
u8 bt_info_hb1;
|
||||
u8 bt_info_hb2;
|
||||
u8 bt_info_hb3;
|
||||
u8 bt_le_audio_info_lb2;
|
||||
u8 bt_le_audio_info_lb3;
|
||||
u8 bt_le_audio_info_hb0;
|
||||
u8 bt_le_audio_info_hb1;
|
||||
u8 bt_le_audio_info_hb2;
|
||||
u8 bt_le_audio_info_hb3;
|
||||
u8 bt_ble_scan_type;
|
||||
u8 bt_afh_map[10];
|
||||
u8 bt_a2dp_vendor_id;
|
||||
@@ -874,7 +917,7 @@ struct btc_coex_sta {
|
||||
u32 score_board_WB;
|
||||
u16 bt_reg_vendor_ac;
|
||||
u16 bt_reg_vendor_ae;
|
||||
u32 bt_reg_vendor_dac;
|
||||
u16 bt_reg_vendor_dae;
|
||||
u16 bt_reg_modem_a;
|
||||
u16 bt_reg_rf_2;
|
||||
u16 bt_reg_rf_9;
|
||||
@@ -897,6 +940,7 @@ struct btc_coex_sta {
|
||||
u32 wl_traffic_dir;
|
||||
u32 wl_bw;
|
||||
u32 cnt_bt_info_c2h[BTC_BTINFO_SRC_MAX];
|
||||
u32 cnt_bt_le_audio_info_c2h[BTC_BT_LE_AUDIO_INFO_SRC_MAX];
|
||||
u32 cnt_bt[BTC_CNT_BT_MAX];
|
||||
u32 cnt_wl[BTC_CNT_WL_MAX];
|
||||
u32 cnt_timer[BTC_TIMER_MAX];
|
||||
@@ -930,6 +974,7 @@ struct btc_wifi_link_info_ext {
|
||||
boolean is_4way;
|
||||
boolean is_32k;
|
||||
boolean is_connected;
|
||||
boolean is_port_num_change;
|
||||
u8 num_of_active_port;
|
||||
u32 port_connect_status;
|
||||
u32 traffic_dir;
|
||||
@@ -1668,6 +1713,12 @@ typedef VOID
|
||||
IN u1Byte type
|
||||
);
|
||||
|
||||
typedef VOID
|
||||
(*BTC_PHYDM_SET_AGC_TBL)(
|
||||
IN PVOID pDM_Odm,
|
||||
IN BOOLEAN bt_is_linked
|
||||
);
|
||||
|
||||
typedef u1Byte
|
||||
(*BFP_BTC_GET_ANT_DET_VAL_FROM_BT)(
|
||||
|
||||
@@ -1772,6 +1823,7 @@ struct btc_statistics {
|
||||
u32 cnt_media_status_notify;
|
||||
u32 cnt_specific_packet_notify;
|
||||
u32 cnt_bt_info_notify;
|
||||
u32 cnt_bt_le_audio_info_notify;
|
||||
u32 cnt_rf_status_notify;
|
||||
u32 cnt_periodical;
|
||||
u32 cnt_coex_dm_switch;
|
||||
@@ -1865,6 +1917,7 @@ struct btc_coexist {
|
||||
BTC_PHYDM_CMNINFOQUERY btc_phydm_query_PHY_counter;
|
||||
BTC_REDUCE_WL_TX_POWER btc_reduce_wl_tx_power;
|
||||
BTC_PHYDM_MODIFY_ANTDIV_HWSW btc_phydm_modify_antdiv_hwsw;
|
||||
BTC_PHYDM_SET_AGC_TBL btc_phydm_set_agc_table;
|
||||
BFP_BTC_GET_ANT_DET_VAL_FROM_BT btc_get_ant_det_val_from_bt;
|
||||
BFP_BTC_GET_BLE_SCAN_TYPE_FROM_BT btc_get_ble_scan_type_from_bt;
|
||||
BFP_BTC_GET_BLE_SCAN_PARA_FROM_BT btc_get_ble_scan_para_from_bt;
|
||||
@@ -1942,8 +1995,10 @@ struct btc_chip_para {
|
||||
boolean scbd_support;
|
||||
u32 scbd_reg;
|
||||
u8 scbd_bit_num;
|
||||
boolean le_audio_support;
|
||||
boolean mailbox_support;
|
||||
boolean lte_indirect_access;
|
||||
boolean new_scbd9_def; /* TRUE: 1:TDMA on(8723f/8822e) */
|
||||
boolean new_scbd10_def; /* TRUE: 1:fix 2M(8822c) */
|
||||
u8 indirect_type; /* 0:17xx, 1:7cx */
|
||||
u8 pstdma_type; /* 0: LPSoff, 1:LPSon */
|
||||
@@ -2159,15 +2214,16 @@ EXhalbtcoutsrc_DisplayAntDetection(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
||||
#define MASKBYTE0 0xff
|
||||
#define MASKBYTE1 0xff00
|
||||
#define MASKBYTE2 0xff0000
|
||||
#define MASKBYTE3 0xff000000
|
||||
#define MASKBYTE0 0xff
|
||||
#define MASKBYTE1 0xff00
|
||||
#define MASKBYTE2 0xff0000
|
||||
#define MASKBYTE3 0xff000000
|
||||
#define MASKHWORD 0xffff0000
|
||||
#define MASKLWORD 0x0000ffff
|
||||
#define MASKLWORD 0x0000ffff
|
||||
#define MASKDWORD 0xffffffff
|
||||
#define MASK12BITS 0xfff
|
||||
#define MASKH4BITS 0xf0000000
|
||||
#define MASK12BITS 0xfff
|
||||
#define MASK20BITS 0xfffff
|
||||
#define MASKH4BITS 0xf0000000
|
||||
#define MASKOFDM_D 0xffc00000
|
||||
#define MASKCCK 0x3f3f3f3f
|
||||
|
||||
|
||||
@@ -133,6 +133,11 @@ struct btc_coexist;
|
||||
#include "halbtc8192f.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822E
|
||||
#include "halbtc8822ewifionly.h"
|
||||
#include "halbtc8822e.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "halbtcoutsrc.h"
|
||||
@@ -163,6 +168,11 @@ struct btc_coexist;
|
||||
#include "halbtc8814bwifionly.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822E
|
||||
#include "halbtc8822ewifionly.h"
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CONFIG_BT_COEXIST */
|
||||
|
||||
#endif /* __MP_PRECOMP_H__ */
|
||||
|
||||
@@ -80,6 +80,10 @@
|
||||
#if defined(CONFIG_RTL8723F)
|
||||
#include "rtl8723f/HalEfuseMask8723F_USB.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
#include "rtl8822e/HalEfuseMask8822E_USB.h"
|
||||
#endif
|
||||
#endif /*CONFIG_USB_HCI*/
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
@@ -131,6 +135,9 @@
|
||||
#if defined(CONFIG_RTL8814B)
|
||||
#include "rtl8814b/HalEfuseMask8814B_PCIE.h"
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
#include "rtl8822e/HalEfuseMask8822E_PCIE.h"
|
||||
#endif
|
||||
#endif /*CONFIG_PCI_HCI*/
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#if defined(CONFIG_RTL8723B)
|
||||
@@ -185,4 +192,8 @@
|
||||
#if defined(CONFIG_RTL8723F)
|
||||
#include "rtl8723f/HalEfuseMask8723F_SDIO.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8822E)
|
||||
#include "rtl8822e/HalEfuseMask8822E_SDIO.h"
|
||||
#endif
|
||||
#endif /*CONFIG_SDIO_HCI*/
|
||||
|
||||
@@ -375,8 +375,6 @@ void halbtcoutsrc_LeaveLowPower(PBTC_COEXIST pBtCoexist)
|
||||
{
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
PADAPTER padapter;
|
||||
PHAL_DATA_TYPE pHalData;
|
||||
struct pwrctrl_priv *pwrctrl;
|
||||
s32 ready;
|
||||
systime stime;
|
||||
s32 utime;
|
||||
@@ -384,8 +382,6 @@ void halbtcoutsrc_LeaveLowPower(PBTC_COEXIST pBtCoexist)
|
||||
|
||||
|
||||
padapter = pBtCoexist->Adapter;
|
||||
pHalData = GET_HAL_DATA(padapter);
|
||||
pwrctrl = adapter_to_pwrctl(padapter);
|
||||
ready = _FAIL;
|
||||
#ifdef LPS_RPWM_WAIT_MS
|
||||
timeout = LPS_RPWM_WAIT_MS;
|
||||
@@ -895,7 +891,6 @@ s32 halbtcoutsrc_GetWifiRssi(PADAPTER padapter)
|
||||
u32 halbtcoutsrc_GetBtCoexSupportedFeature(void *pBtcContext)
|
||||
{
|
||||
PBTC_COEXIST pBtCoexist;
|
||||
u32 ret = BT_STATUS_BT_OP_SUCCESS;
|
||||
u32 data = 0;
|
||||
|
||||
pBtCoexist = (PBTC_COEXIST)pBtcContext;
|
||||
@@ -912,13 +907,10 @@ u32 halbtcoutsrc_GetBtCoexSupportedFeature(void *pBtcContext)
|
||||
status = _btmpoper_cmd(pBtCoexist, op_code, 0, buf, 0);
|
||||
if (status == BT_STATUS_BT_OP_SUCCESS)
|
||||
data = le16_to_cpu(*(u16 *)GLBtcBtMpRptRsp);
|
||||
else
|
||||
ret = SET_BT_MP_OPER_RET(op_code, status);
|
||||
|
||||
_exit_critical_mutex(&GLBtcBtMpOperLock, &irqL);
|
||||
|
||||
} else
|
||||
ret = BT_STATUS_NOT_IMPLEMENT;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -926,7 +918,6 @@ u32 halbtcoutsrc_GetBtCoexSupportedFeature(void *pBtcContext)
|
||||
u32 halbtcoutsrc_GetBtCoexSupportedVersion(void *pBtcContext)
|
||||
{
|
||||
PBTC_COEXIST pBtCoexist;
|
||||
u32 ret = BT_STATUS_BT_OP_SUCCESS;
|
||||
u32 data = 0xFFFF;
|
||||
|
||||
pBtCoexist = (PBTC_COEXIST)pBtcContext;
|
||||
@@ -943,13 +934,10 @@ u32 halbtcoutsrc_GetBtCoexSupportedVersion(void *pBtcContext)
|
||||
status = _btmpoper_cmd(pBtCoexist, op_code, 0, buf, 0);
|
||||
if (status == BT_STATUS_BT_OP_SUCCESS)
|
||||
data = le16_to_cpu(*(u16 *)GLBtcBtMpRptRsp);
|
||||
else
|
||||
ret = SET_BT_MP_OPER_RET(op_code, status);
|
||||
|
||||
_exit_critical_mutex(&GLBtcBtMpOperLock, &irqL);
|
||||
|
||||
} else
|
||||
ret = BT_STATUS_NOT_IMPLEMENT;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -957,7 +945,6 @@ u32 halbtcoutsrc_GetBtCoexSupportedVersion(void *pBtcContext)
|
||||
u32 halbtcoutsrc_GetBtDeviceInfo(void *pBtcContext)
|
||||
{
|
||||
PBTC_COEXIST pBtCoexist;
|
||||
u32 ret = BT_STATUS_BT_OP_SUCCESS;
|
||||
u32 btDeviceInfo = 0;
|
||||
|
||||
pBtCoexist = (PBTC_COEXIST)pBtcContext;
|
||||
@@ -974,13 +961,10 @@ u32 halbtcoutsrc_GetBtDeviceInfo(void *pBtcContext)
|
||||
status = _btmpoper_cmd(pBtCoexist, op_code, 0, buf, 0);
|
||||
if (status == BT_STATUS_BT_OP_SUCCESS)
|
||||
btDeviceInfo = le32_to_cpu(*(u32 *)GLBtcBtMpRptRsp);
|
||||
else
|
||||
ret = SET_BT_MP_OPER_RET(op_code, status);
|
||||
|
||||
_exit_critical_mutex(&GLBtcBtMpOperLock, &irqL);
|
||||
|
||||
} else
|
||||
ret = BT_STATUS_NOT_IMPLEMENT;
|
||||
}
|
||||
|
||||
return btDeviceInfo;
|
||||
}
|
||||
@@ -988,7 +972,6 @@ u32 halbtcoutsrc_GetBtDeviceInfo(void *pBtcContext)
|
||||
u32 halbtcoutsrc_GetBtForbiddenSlotVal(void *pBtcContext)
|
||||
{
|
||||
PBTC_COEXIST pBtCoexist;
|
||||
u32 ret = BT_STATUS_BT_OP_SUCCESS;
|
||||
u32 btForbiddenSlotVal = 0;
|
||||
|
||||
pBtCoexist = (PBTC_COEXIST)pBtcContext;
|
||||
@@ -1005,13 +988,10 @@ u32 halbtcoutsrc_GetBtForbiddenSlotVal(void *pBtcContext)
|
||||
status = _btmpoper_cmd(pBtCoexist, op_code, 0, buf, 0);
|
||||
if (status == BT_STATUS_BT_OP_SUCCESS)
|
||||
btForbiddenSlotVal = le32_to_cpu(*(u32 *)GLBtcBtMpRptRsp);
|
||||
else
|
||||
ret = SET_BT_MP_OPER_RET(op_code, status);
|
||||
|
||||
_exit_critical_mutex(&GLBtcBtMpOperLock, &irqL);
|
||||
|
||||
} else
|
||||
ret = BT_STATUS_NOT_IMPLEMENT;
|
||||
}
|
||||
|
||||
return btForbiddenSlotVal;
|
||||
}
|
||||
@@ -1019,12 +999,10 @@ u32 halbtcoutsrc_GetBtForbiddenSlotVal(void *pBtcContext)
|
||||
static u8 halbtcoutsrc_GetWifiScanAPNum(PADAPTER padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext;
|
||||
static u8 scan_AP_num = 0;
|
||||
|
||||
|
||||
pmlmepriv = &padapter->mlmepriv;
|
||||
pmlmeext = &padapter->mlmeextpriv;
|
||||
|
||||
if (GLBtcWiFiInScanState == _FALSE) {
|
||||
if (pmlmepriv->num_of_scanned > 0xFF)
|
||||
@@ -1093,6 +1071,10 @@ u32 halbtcoutsrc_GetPhydmVersion(void *pBtcContext)
|
||||
return RELEASE_VERSION_8723F;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822E
|
||||
return RELEASE_VERSION_8822E;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf)
|
||||
@@ -1102,7 +1084,6 @@ u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf)
|
||||
PHAL_DATA_TYPE pHalData;
|
||||
struct mlme_ext_priv *mlmeext;
|
||||
struct btc_wifi_link_info *wifi_link_info;
|
||||
u8 bSoftApExist, bVwifiExist;
|
||||
u8 *pu8;
|
||||
s32 *pS4Tmp;
|
||||
u32 *pU4Tmp;
|
||||
@@ -1118,8 +1099,6 @@ u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf)
|
||||
padapter = pBtCoexist->Adapter;
|
||||
pHalData = GET_HAL_DATA(padapter);
|
||||
mlmeext = &padapter->mlmeextpriv;
|
||||
bSoftApExist = _FALSE;
|
||||
bVwifiExist = _FALSE;
|
||||
pu8 = (u8 *)pOutBuf;
|
||||
pS4Tmp = (s32 *)pOutBuf;
|
||||
pU4Tmp = (u32 *)pOutBuf;
|
||||
@@ -1318,6 +1297,19 @@ u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf)
|
||||
*pU4Tmp = halbtcoutsrc_GetBtForbiddenSlotVal(pBtCoexist);
|
||||
break;
|
||||
|
||||
#if (CONFIG_BTCOEX_GET_IQK_CNT_FROM_IQK_INFO == 1)
|
||||
case BTC_GET_U4_WIFI_IQK_TOTAL:
|
||||
*pU4Tmp = pHalData->odmpriv.IQK_info.iqk_times;
|
||||
break;
|
||||
|
||||
case BTC_GET_U4_WIFI_IQK_OK:
|
||||
*pU4Tmp = pHalData->odmpriv.IQK_info.kcount;
|
||||
break;
|
||||
|
||||
case BTC_GET_U4_WIFI_IQK_FAIL:
|
||||
*pU4Tmp = pHalData->odmpriv.IQK_info.fail_count;
|
||||
break;
|
||||
#else
|
||||
case BTC_GET_U4_WIFI_IQK_TOTAL:
|
||||
*pU4Tmp = pHalData->odmpriv.n_iqk_cnt;
|
||||
break;
|
||||
@@ -1329,6 +1321,7 @@ u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf)
|
||||
case BTC_GET_U4_WIFI_IQK_FAIL:
|
||||
*pU4Tmp = pHalData->odmpriv.n_iqk_fail_cnt;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case BTC_GET_U1_WIFI_DOT11_CHNL:
|
||||
*pU1Tmp = padapter->mlmeextpriv.cur_channel;
|
||||
@@ -1445,12 +1438,9 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf)
|
||||
{
|
||||
PBTC_COEXIST pBtCoexist;
|
||||
PADAPTER padapter;
|
||||
PHAL_DATA_TYPE pHalData;
|
||||
u8 *pu8;
|
||||
u8 *pU1Tmp;
|
||||
u16 *pU2Tmp;
|
||||
u32 *pU4Tmp;
|
||||
u8 ret;
|
||||
u8 result = _TRUE;
|
||||
|
||||
|
||||
@@ -1459,12 +1449,9 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf)
|
||||
return _FALSE;
|
||||
|
||||
padapter = pBtCoexist->Adapter;
|
||||
pHalData = GET_HAL_DATA(padapter);
|
||||
pu8 = (u8 *)pInBuf;
|
||||
pU1Tmp = (u8 *)pInBuf;
|
||||
pU2Tmp = (u16*)pInBuf;
|
||||
pU4Tmp = (u32 *)pInBuf;
|
||||
ret = _TRUE;
|
||||
|
||||
switch (setType) {
|
||||
/* set some u8 type variables. */
|
||||
@@ -1518,14 +1505,6 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf)
|
||||
break;
|
||||
|
||||
/* the following are some action which will be triggered */
|
||||
case BTC_SET_ACT_GET_BT_RSSI:
|
||||
#if 0
|
||||
BT_SendGetBtRssiEvent(padapter);
|
||||
#else
|
||||
ret = _FALSE;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case BTC_SET_ACT_AGGREGATE_CTRL:
|
||||
halbtcoutsrc_AggregationCheck(pBtCoexist);
|
||||
break;
|
||||
@@ -1612,8 +1591,6 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf)
|
||||
_rtw_memcpy(tmpBuf, pU1Tmp + 1, dataLen);
|
||||
BT_SendEventExtBtInfoControl(padapter, dataLen, &tmpBuf[0]);
|
||||
}
|
||||
#else /* !CONFIG_BT_COEXIST_SOCKET_TRX */
|
||||
ret = _FALSE;
|
||||
#endif /* CONFIG_BT_COEXIST_SOCKET_TRX */
|
||||
break;
|
||||
|
||||
@@ -1626,23 +1603,8 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf)
|
||||
_rtw_memcpy(tmpBuf, pU1Tmp + 1, dataLen);
|
||||
BT_SendEventExtBtCoexControl(padapter, _FALSE, dataLen, &tmpBuf[0]);
|
||||
}
|
||||
#else /* !CONFIG_BT_COEXIST_SOCKET_TRX */
|
||||
ret = _FALSE;
|
||||
#endif /* CONFIG_BT_COEXIST_SOCKET_TRX */
|
||||
break;
|
||||
case BTC_SET_ACT_CTRL_8723B_ANT:
|
||||
#if 0
|
||||
{
|
||||
u8 dataLen = *pU1Tmp;
|
||||
u8 tmpBuf[BTC_TMP_BUF_SHORT];
|
||||
if (dataLen)
|
||||
PlatformMoveMemory(&tmpBuf[0], pU1Tmp + 1, dataLen);
|
||||
BT_Set8723bAnt(Adapter, dataLen, &tmpBuf[0]);
|
||||
}
|
||||
#else
|
||||
ret = _FALSE;
|
||||
#endif
|
||||
break;
|
||||
case BTC_SET_BL_BT_LNA_CONSTRAIN_LEVEL:
|
||||
halbtcoutsrc_LnaConstrainLvl(pBtCoexist, pu8);
|
||||
break;
|
||||
@@ -1681,8 +1643,9 @@ u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf)
|
||||
}
|
||||
break;
|
||||
/* ===================== */
|
||||
case BTC_SET_ACT_GET_BT_RSSI:
|
||||
case BTC_SET_ACT_CTRL_8723B_ANT:
|
||||
default:
|
||||
ret = _FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2662,16 +2625,13 @@ void halbtcoutsrc_FillH2cCmd(void *pBtcContext, u8 elementId, u32 cmdLen, u8 *pC
|
||||
{
|
||||
PBTC_COEXIST pBtCoexist;
|
||||
PADAPTER padapter;
|
||||
s32 ret = 0;
|
||||
|
||||
|
||||
pBtCoexist = (PBTC_COEXIST)pBtcContext;
|
||||
padapter = pBtCoexist->Adapter;
|
||||
|
||||
ret = rtw_hal_fill_h2c_cmd(padapter, elementId, cmdLen, pCmdBuffer);
|
||||
|
||||
#ifdef CONFIG_RTL8192F
|
||||
if (ret == _SUCCESS) {
|
||||
if (_SUCCESS == rtw_hal_fill_h2c_cmd(padapter, elementId, cmdLen, pCmdBuffer)) {
|
||||
switch (elementId) {
|
||||
case H2C_BT_INFO:
|
||||
case H2C_BT_IGNORE_WLANACT:
|
||||
@@ -2682,6 +2642,8 @@ void halbtcoutsrc_FillH2cCmd(void *pBtcContext, u8 elementId, u32 cmdLen, u8 *pC
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
rtw_hal_fill_h2c_cmd(padapter, elementId, cmdLen, pCmdBuffer);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2824,7 +2786,6 @@ u8 halbtcoutsrc_GetAntDetValFromBt(void *pBtcContext)
|
||||
u8 halbtcoutsrc_GetBleScanTypeFromBt(void *pBtcContext)
|
||||
{
|
||||
PBTC_COEXIST pBtCoexist;
|
||||
u32 ret = BT_STATUS_BT_OP_SUCCESS;
|
||||
u8 data = 0;
|
||||
|
||||
pBtCoexist = (PBTC_COEXIST)pBtcContext;
|
||||
@@ -2842,13 +2803,10 @@ u8 halbtcoutsrc_GetBleScanTypeFromBt(void *pBtcContext)
|
||||
status = _btmpoper_cmd(pBtCoexist, op_code, 0, buf, 0);
|
||||
if (status == BT_STATUS_BT_OP_SUCCESS)
|
||||
data = *(u8 *)GLBtcBtMpRptRsp;
|
||||
else
|
||||
ret = SET_BT_MP_OPER_RET(op_code, status);
|
||||
|
||||
_exit_critical_mutex(&GLBtcBtMpOperLock, &irqL);
|
||||
|
||||
} else
|
||||
ret = BT_STATUS_NOT_IMPLEMENT;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -2856,7 +2814,6 @@ u8 halbtcoutsrc_GetBleScanTypeFromBt(void *pBtcContext)
|
||||
u32 halbtcoutsrc_GetBleScanParaFromBt(void *pBtcContext, u8 scanType)
|
||||
{
|
||||
PBTC_COEXIST pBtCoexist;
|
||||
u32 ret = BT_STATUS_BT_OP_SUCCESS;
|
||||
u32 data = 0;
|
||||
|
||||
pBtCoexist = (PBTC_COEXIST)pBtcContext;
|
||||
@@ -2875,13 +2832,10 @@ u32 halbtcoutsrc_GetBleScanParaFromBt(void *pBtcContext, u8 scanType)
|
||||
status = _btmpoper_cmd(pBtCoexist, op_code, 0, buf, 1);
|
||||
if (status == BT_STATUS_BT_OP_SUCCESS)
|
||||
data = le32_to_cpu(*(u32 *)GLBtcBtMpRptRsp);
|
||||
else
|
||||
ret = SET_BT_MP_OPER_RET(op_code, status);
|
||||
|
||||
_exit_critical_mutex(&GLBtcBtMpOperLock, &irqL);
|
||||
|
||||
} else
|
||||
ret = BT_STATUS_NOT_IMPLEMENT;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -2987,13 +2941,23 @@ u32 halbtcoutsrc_phydm_query_PHY_counter(void *pBtcContext, u8 info_type)
|
||||
#endif
|
||||
}
|
||||
|
||||
void halbtcoutsrc_phydm_set_agc_table(void *pBtcContext, BOOLEAN bt_is_linked)
|
||||
{
|
||||
#ifdef CONFIG_RTL8822E
|
||||
struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext;
|
||||
|
||||
phydm_set_agc_table_8822e((struct dm_struct *)pBtCoexist->odm_priv, bt_is_linked);
|
||||
#endif
|
||||
}
|
||||
|
||||
void halbtcoutsrc_reduce_wl_tx_power(void *pBtcContext, s8 tx_power)
|
||||
{
|
||||
struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA((PADAPTER)pBtCoexist->Adapter);
|
||||
|
||||
/* The reduction of wl tx pwr should be processed inside the set tx pwr lvl function */
|
||||
if (IS_HARDWARE_TYPE_8822C(pBtCoexist->Adapter) || IS_HARDWARE_TYPE_8723F(pBtCoexist->Adapter))
|
||||
if (IS_HARDWARE_TYPE_8822C(pBtCoexist->Adapter) || IS_HARDWARE_TYPE_8723F(pBtCoexist->Adapter)
|
||||
|| IS_HARDWARE_TYPE_8822E(pBtCoexist->Adapter))
|
||||
rtw_hal_set_tx_power_level(pBtCoexist->Adapter, pHalData->current_channel);
|
||||
}
|
||||
|
||||
@@ -3266,6 +3230,12 @@ u8 EXhalbtcoutsrc_BindBtCoexWithAdapter(void *padapter)
|
||||
pBtCoexist->chip_para = &btc_chip_para_8723f;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8822E
|
||||
else if(IS_HARDWARE_TYPE_8822E(padapter)) {
|
||||
pBtCoexist->chip_type = BTC_CHIP_RTL8822E;
|
||||
pBtCoexist->chip_para = &btc_chip_para_8822e;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
pBtCoexist->chip_type = BTC_CHIP_UNDEF;
|
||||
@@ -3374,6 +3344,7 @@ u8 EXhalbtcoutsrc_InitlizeVariables(void *padapter)
|
||||
pBtCoexist->btc_phydm_query_PHY_counter = halbtcoutsrc_phydm_query_PHY_counter;
|
||||
pBtCoexist->btc_reduce_wl_tx_power = halbtcoutsrc_reduce_wl_tx_power;
|
||||
pBtCoexist->btc_phydm_modify_antdiv_hwsw = halbtcoutsrc_phydm_modify_AntDiv_HwSw;
|
||||
pBtCoexist->btc_phydm_set_agc_table = halbtcoutsrc_phydm_set_agc_table;
|
||||
|
||||
pBtCoexist->cli_buf = &GLBtcDbgBuf[0];
|
||||
|
||||
@@ -3405,13 +3376,9 @@ u8 EXhalbtcoutsrc_InitlizeVariables(void *padapter)
|
||||
|
||||
void EXhalbtcoutsrc_PowerOnSetting(PBTC_COEXIST pBtCoexist)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = NULL;
|
||||
|
||||
if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist))
|
||||
return;
|
||||
|
||||
pHalData = GET_HAL_DATA((PADAPTER)pBtCoexist->Adapter);
|
||||
|
||||
#if (CONFIG_BTCOEX_SUPPORT_BTC_CMN == 1)
|
||||
rtw_btc_ex_power_on_setting(pBtCoexist);
|
||||
|
||||
@@ -3451,7 +3418,13 @@ void EXhalbtcoutsrc_PowerOnSetting(PBTC_COEXIST pBtCoexist)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822B
|
||||
else if ((IS_HARDWARE_TYPE_8822B(pBtCoexist->Adapter)) && (pHalData->EEPROMBluetoothCoexist == _TRUE)) {
|
||||
else if (IS_HARDWARE_TYPE_8822B(pBtCoexist->Adapter)) {
|
||||
HAL_DATA_TYPE *pHalData = NULL;
|
||||
|
||||
pHalData = GET_HAL_DATA((PADAPTER)pBtCoexist->Adapter);
|
||||
if (pHalData->EEPROMBluetoothCoexist == _FALSE)
|
||||
return;
|
||||
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
ex_halbtc8822b1ant_power_on_setting(pBtCoexist);
|
||||
else if (pBtCoexist->board_info.btdm_ant_num == 2)
|
||||
@@ -3460,7 +3433,13 @@ void EXhalbtcoutsrc_PowerOnSetting(PBTC_COEXIST pBtCoexist)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8821C
|
||||
else if ((IS_HARDWARE_TYPE_8821C(pBtCoexist->Adapter)) && (pHalData->EEPROMBluetoothCoexist == _TRUE)) {
|
||||
else if (IS_HARDWARE_TYPE_8821C(pBtCoexist->Adapter)) {
|
||||
HAL_DATA_TYPE *pHalData = NULL;
|
||||
|
||||
pHalData = GET_HAL_DATA((PADAPTER)pBtCoexist->Adapter);
|
||||
if (pHalData->EEPROMBluetoothCoexist == _FALSE)
|
||||
return;
|
||||
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 2)
|
||||
ex_halbtc8821c2ant_power_on_setting(pBtCoexist);
|
||||
else if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
@@ -4486,6 +4465,18 @@ void EXhalbtcoutsrc_bt_info_notify(PBTC_COEXIST pBtCoexist, u8 *tmpBuf, u8 lengt
|
||||
/* halbtcoutsrc_NormalLowPower(pBtCoexist); */
|
||||
}
|
||||
|
||||
void EXhalbtcoutsrc_bt_le_audio_info_notify(PBTC_COEXIST pBtCoexist, u8 *tmpBuf, u8 length)
|
||||
{
|
||||
#if (CONFIG_BTCOEX_SUPPORT_BTC_CMN == 1)
|
||||
#if (CONFIG_BTCOEX_SUPPORT_BT_LE_AUDIO == 1)
|
||||
if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist))
|
||||
return;
|
||||
|
||||
rtw_btc_ex_bt_le_audio_info_notify(pBtCoexist, tmpBuf, length);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void EXhalbtcoutsrc_WlFwDbgInfoNotify(PBTC_COEXIST pBtCoexist, u8* tmpBuf, u8 length)
|
||||
{
|
||||
if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist))
|
||||
@@ -4523,6 +4514,40 @@ void EXhalbtcoutsrc_WlFwDbgInfoNotify(PBTC_COEXIST pBtCoexist, u8* tmpBuf, u8 le
|
||||
#endif
|
||||
}
|
||||
|
||||
void EXhalbtcoutsrc_tx_rate_change_notify(PBTC_COEXIST pBtCoexist, u8 btc_rate_id, u8 tx_retry_ratio, u8 macid)
|
||||
{
|
||||
if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist))
|
||||
return;
|
||||
|
||||
#if (CONFIG_BTCOEX_SUPPORT_BTC_CMN == 1)
|
||||
rtw_btc_ex_tx_rate_change_notify(pBtCoexist, btc_rate_id, tx_retry_ratio, macid);
|
||||
#else
|
||||
|
||||
#ifdef CONFIG_RTL8822B
|
||||
else if (IS_HARDWARE_TYPE_8822B(pBtCoexist->Adapter)) {
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
ex_halbtc8822b1ant_tx_rate_change_notify(pBtCoexist, btc_rate_id,
|
||||
tx_retry_ratio, macid);
|
||||
else if (pBtCoexist->board_info.btdm_ant_num == 2)
|
||||
ex_halbtc8822b2ant_tx_rate_change_notify(pBtCoexist, btc_rate_id,
|
||||
tx_retry_ratio, macid);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8821C
|
||||
else if (IS_HARDWARE_TYPE_8821C(pBtCoexist->Adapter)) {
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
ex_halbtc8821c1ant_tx_rate_change_notify(pBtCoexist, btc_rate_id,
|
||||
tx_retry_ratio, macid);
|
||||
else if (pBtCoexist->board_info.btdm_ant_num == 2)
|
||||
ex_halbtc8821c2ant_tx_rate_change_notify(pBtCoexist, btc_rate_id,
|
||||
tx_retry_ratio, macid);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void EXhalbtcoutsrc_rx_rate_change_notify(PBTC_COEXIST pBtCoexist, u8 is_data_frame, u8 btc_rate_id)
|
||||
{
|
||||
if (!halbtcoutsrc_IsBtCoexistAvailable(pBtCoexist))
|
||||
@@ -4533,29 +4558,56 @@ void EXhalbtcoutsrc_rx_rate_change_notify(PBTC_COEXIST pBtCoexist, u8 is_data_fr
|
||||
#if (CONFIG_BTCOEX_SUPPORT_BTC_CMN == 1)
|
||||
rtw_btc_ex_rx_rate_change_notify(pBtCoexist, is_data_frame, btc_rate_id);
|
||||
#else
|
||||
|
||||
if (IS_HARDWARE_TYPE_8703B(pBtCoexist->Adapter)) {
|
||||
#ifdef CONFIG_RTL8703B
|
||||
if (IS_HARDWARE_TYPE_8821(pBtCoexist->Adapter)) {
|
||||
#ifdef CONFIG_RTL8821A
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
ex_halbtc8703b1ant_rx_rate_change_notify(pBtCoexist, is_data_frame, btc_rate_id);
|
||||
ex_halbtc8821a1ant_rx_rate_change_notify(pBtCoexist, is_data_frame,
|
||||
btc_rate_id);
|
||||
else if (pBtCoexist->board_info.btdm_ant_num == 2)
|
||||
ex_halbtc8821a2ant_rx_rate_change_notify(pBtCoexist, is_data_frame,
|
||||
btc_rate_id);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RTL8703B
|
||||
else if (IS_HARDWARE_TYPE_8703B(pBtCoexist->Adapter)) {
|
||||
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
ex_halbtc8703b1ant_rx_rate_change_notify(pBtCoexist, is_data_frame,
|
||||
btc_rate_id);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8723D
|
||||
else if (IS_HARDWARE_TYPE_8723D(pBtCoexist->Adapter)) {
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
ex_halbtc8723d1ant_rx_rate_change_notify(pBtCoexist, is_data_frame, btc_rate_id);
|
||||
ex_halbtc8723d1ant_rx_rate_change_notify(pBtCoexist, is_data_frame,
|
||||
btc_rate_id);
|
||||
else if (pBtCoexist->board_info.btdm_ant_num == 2)
|
||||
ex_halbtc8723d2ant_rx_rate_change_notify(pBtCoexist, is_data_frame, btc_rate_id);
|
||||
ex_halbtc8723d2ant_rx_rate_change_notify(pBtCoexist, is_data_frame,
|
||||
btc_rate_id);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822B
|
||||
else if (IS_HARDWARE_TYPE_8822B(pBtCoexist->Adapter)) {
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
ex_halbtc8822b1ant_rx_rate_change_notify(pBtCoexist, is_data_frame,
|
||||
btc_rate_id);
|
||||
else if (pBtCoexist->board_info.btdm_ant_num == 2)
|
||||
ex_halbtc8822b2ant_rx_rate_change_notify(pBtCoexist, is_data_frame,
|
||||
btc_rate_id);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8821C
|
||||
else if (IS_HARDWARE_TYPE_8821C(pBtCoexist->Adapter)) {
|
||||
if (pBtCoexist->board_info.btdm_ant_num == 1)
|
||||
ex_halbtc8821c1ant_rx_rate_change_notify(pBtCoexist, is_data_frame, btc_rate_id);
|
||||
ex_halbtc8821c1ant_rx_rate_change_notify(pBtCoexist, is_data_frame,
|
||||
btc_rate_id);
|
||||
else if (pBtCoexist->board_info.btdm_ant_num == 2)
|
||||
ex_halbtc8821c2ant_rx_rate_change_notify(pBtCoexist, is_data_frame, btc_rate_id);
|
||||
ex_halbtc8821c2ant_rx_rate_change_notify(pBtCoexist, is_data_frame,
|
||||
btc_rate_id);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -5806,7 +5858,7 @@ u8 EXhalbtcoutsrc_rate_id_to_btc_rate_id(u8 rate_id)
|
||||
btc_rate_id = BTC_VHT_4SS_MCS_9;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return btc_rate_id;
|
||||
}
|
||||
|
||||
@@ -5900,7 +5952,7 @@ void hal_btcoex_PowerOffSetting(PADAPTER padapter)
|
||||
/* Clear the WiFi on/off bit in scoreboard reg. if necessary */
|
||||
if (IS_HARDWARE_TYPE_8703B(padapter) || IS_HARDWARE_TYPE_8723D(padapter)
|
||||
|| IS_HARDWARE_TYPE_8821C(padapter) || IS_HARDWARE_TYPE_8822B(padapter)
|
||||
|| IS_HARDWARE_TYPE_8822C(padapter))
|
||||
|| IS_HARDWARE_TYPE_8822C(padapter) || IS_HARDWARE_TYPE_8822E(padapter))
|
||||
rtw_write16(padapter, 0xaa, 0x8000);
|
||||
}
|
||||
|
||||
@@ -5984,6 +6036,14 @@ void hal_btcoex_BtInfoNotify(PADAPTER padapter, u8 length, u8 *tmpBuf)
|
||||
EXhalbtcoutsrc_bt_info_notify(&GLBtCoexist, tmpBuf, length);
|
||||
}
|
||||
|
||||
void hal_btcoex_le_audio_info_notify(PADAPTER padapter, u8 length, u8 *tmpBuf)
|
||||
{
|
||||
if (GLBtcWiFiInIQKState == _TRUE)
|
||||
return;
|
||||
|
||||
EXhalbtcoutsrc_bt_le_audio_info_notify(&GLBtCoexist, tmpBuf, length);
|
||||
}
|
||||
|
||||
void hal_btcoex_BtMpRptNotify(PADAPTER padapter, u8 length, u8 *tmpBuf)
|
||||
{
|
||||
u8 extid, status, len, seq;
|
||||
@@ -6066,10 +6126,41 @@ void hal_btcoex_SwitchBtTRxMask(PADAPTER padapter)
|
||||
EXhalbtcoutsrc_SwitchBtTRxMask(&GLBtCoexist);
|
||||
}
|
||||
|
||||
static void hal_btcoex_trx_rate_info_notify(PADAPTER padapter)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
struct dm_struct *podmpriv = adapter_to_phydm(padapter);
|
||||
struct sta_info *psta = NULL;
|
||||
struct ra_sta_info *ra_info = NULL;
|
||||
u8 curr_tx_rate = 0, curr_rx_rate = 0;
|
||||
|
||||
if (!MLME_IS_STA(padapter) || !MLME_IS_ASOC(padapter))
|
||||
return;
|
||||
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, get_my_bssid(&(pmlmeinfo->network)));
|
||||
if (psta == NULL)
|
||||
return;
|
||||
|
||||
ra_info = &psta->cmn.ra_info;
|
||||
curr_tx_rate = EXhalbtcoutsrc_rate_id_to_btc_rate_id(rtw_get_current_tx_rate(padapter, psta));
|
||||
curr_tx_rate |= (rtw_get_current_tx_sgi(padapter, psta) << 7);
|
||||
|
||||
EXhalbtcoutsrc_tx_rate_change_notify(&GLBtCoexist, curr_tx_rate,
|
||||
ra_info->curr_retry_ratio,
|
||||
psta->cmn.mac_id);
|
||||
|
||||
curr_rx_rate = EXhalbtcoutsrc_rate_id_to_btc_rate_id(podmpriv->rx_rate_plurality);
|
||||
|
||||
EXhalbtcoutsrc_rx_rate_change_notify(&GLBtCoexist, _TRUE, curr_rx_rate);
|
||||
}
|
||||
|
||||
void hal_btcoex_Hanlder(PADAPTER padapter)
|
||||
{
|
||||
u32 bt_patch_ver;
|
||||
|
||||
hal_btcoex_trx_rate_info_notify(padapter);
|
||||
|
||||
EXhalbtcoutsrc_periodical(&GLBtCoexist);
|
||||
|
||||
if (GLBtCoexist.bt_info.bt_get_fw_ver == 0) {
|
||||
@@ -6630,11 +6721,6 @@ void hal_btcoex_WlFwDbgInfoNotify(PADAPTER padapter, u8* tmpBuf, u8 length)
|
||||
EXhalbtcoutsrc_WlFwDbgInfoNotify(&GLBtCoexist, tmpBuf, length);
|
||||
}
|
||||
|
||||
void hal_btcoex_rx_rate_change_notify(PADAPTER padapter, u8 is_data_frame, u8 rate_id)
|
||||
{
|
||||
EXhalbtcoutsrc_rx_rate_change_notify(&GLBtCoexist, is_data_frame, EXhalbtcoutsrc_rate_id_to_btc_rate_id(rate_id));
|
||||
}
|
||||
|
||||
u16 hal_btcoex_btset_testode(PADAPTER padapter, u8 type)
|
||||
{
|
||||
u16 ret = 0;
|
||||
|
||||
@@ -106,6 +106,9 @@ void halwifionly_phy_set_bb_reg(void *pwifionlyContext, u32 RegAddr, u32 BitMask
|
||||
|
||||
void hal_btcoex_wifionly_switchband_notify(PADAPTER padapter)
|
||||
{
|
||||
#ifdef CONFIG_RTL8723B
|
||||
return;
|
||||
#else
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
u8 is_5g = _FALSE;
|
||||
|
||||
@@ -137,10 +140,20 @@ void hal_btcoex_wifionly_switchband_notify(PADAPTER padapter)
|
||||
else if (IS_HARDWARE_TYPE_8723F(padapter))
|
||||
ex_hal8723f_wifi_only_switchbandnotify(&GLBtCoexistWifiOnly, is_5g);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822E
|
||||
else if (IS_HARDWARE_TYPE_8822E(padapter))
|
||||
ex_hal8822e_wifi_only_switchbandnotify(&GLBtCoexistWifiOnly, is_5g);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void hal_btcoex_wifionly_scan_notify(PADAPTER padapter)
|
||||
{
|
||||
#ifdef CONFIG_RTL8723B
|
||||
return;
|
||||
#else
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
u8 is_5g = _FALSE;
|
||||
|
||||
@@ -167,10 +180,25 @@ void hal_btcoex_wifionly_scan_notify(PADAPTER padapter)
|
||||
else if (IS_HARDWARE_TYPE_8814B(padapter))
|
||||
ex_hal8814b_wifi_only_scannotify(&GLBtCoexistWifiOnly, is_5g);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8723F
|
||||
else if (IS_HARDWARE_TYPE_8723F(padapter))
|
||||
ex_hal8723f_wifi_only_scannotify(&GLBtCoexistWifiOnly, is_5g);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822E
|
||||
else if (IS_HARDWARE_TYPE_8822E(padapter))
|
||||
ex_hal8822e_wifi_only_scannotify(&GLBtCoexistWifiOnly, is_5g);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void hal_btcoex_wifionly_connect_notify(PADAPTER padapter)
|
||||
{
|
||||
#ifdef CONFIG_RTL8723B
|
||||
return;
|
||||
#else
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
u8 is_5g = _FALSE;
|
||||
|
||||
@@ -202,6 +230,13 @@ void hal_btcoex_wifionly_connect_notify(PADAPTER padapter)
|
||||
else if (IS_HARDWARE_TYPE_8723F(padapter))
|
||||
ex_hal8723f_wifi_only_connectnotify(&GLBtCoexistWifiOnly, is_5g);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822E
|
||||
else if (IS_HARDWARE_TYPE_8822E(padapter))
|
||||
ex_hal8822e_wifi_only_connectnotify(&GLBtCoexistWifiOnly, is_5g);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void hal_btcoex_wifionly_hw_config(PADAPTER padapter)
|
||||
@@ -238,6 +273,11 @@ void hal_btcoex_wifionly_hw_config(PADAPTER padapter)
|
||||
else if (IS_HARDWARE_TYPE_8723F(padapter))
|
||||
ex_hal8723f_wifi_only_hw_config(pwifionlycfg);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822E
|
||||
else if (IS_HARDWARE_TYPE_8822E(padapter))
|
||||
ex_hal8822e_wifi_only_hw_config(pwifionlycfg);
|
||||
#endif
|
||||
}
|
||||
|
||||
void hal_btcoex_wifionly_initlizevariables(PADAPTER padapter)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -67,6 +67,7 @@ typedef enum _C2H_EVT {
|
||||
C2H_MAC_HIDDEN_RPT = 0x19,
|
||||
C2H_MAC_HIDDEN_RPT_2 = 0x1A,
|
||||
C2H_BCN_EARLY_RPT = 0x1E,
|
||||
C2H_TX_PAUSE_RPT = 0x20,
|
||||
C2H_DEFEATURE_DBG = 0x22,
|
||||
C2H_CUSTOMER_STR_RPT = 0x24,
|
||||
C2H_CUSTOMER_STR_RPT_2 = 0x25,
|
||||
@@ -75,6 +76,7 @@ typedef enum _C2H_EVT {
|
||||
C2H_PER_RATE_RPT = 0x2c,
|
||||
#endif
|
||||
C2H_LPS_STATUS_RPT = 0x32,
|
||||
C2H_BT_LE_AUDIO_INFO = 0x46,
|
||||
C2H_SET_TXPWR_FINISH = 0x70,
|
||||
C2H_DEFEATURE_RSVD = 0xFD,
|
||||
C2H_EXTEND = 0xff,
|
||||
@@ -105,6 +107,12 @@ int hal_read_mac_hidden_rpt(_adapter *adapter);
|
||||
#define hal_read_mac_hidden_rpt(adapter) _SUCCESS
|
||||
#endif /* CONFIG_RTW_MAC_HIDDEN_RPT */
|
||||
|
||||
#ifdef CONFIG_TX_PAUSE_FW_CTRL
|
||||
/* C2H_TX_PAUSE_RPT, 0x20 */
|
||||
#define TX_PAUSE_RPT_LEN 3
|
||||
int c2h_tx_pause_rpt_hdl(_adapter *adapter, u8 *data, u8 len);
|
||||
#endif
|
||||
|
||||
/* C2H_DEFEATURE_DBG, 0x22 */
|
||||
#define DEFEATURE_DBG_LEN 1
|
||||
int c2h_defeature_dbg_hdl(_adapter *adapter, u8 *data, u8 len);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
471
drivers/net/wireless/rtl8822cs/hal/hal_dfs.c
Normal file
471
drivers/net/wireless/rtl8822cs/hal/hal_dfs.c
Normal file
@@ -0,0 +1,471 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define _HAL_DFS_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
/* be careful about the sychronization with phydm */
|
||||
#define PHYDM_DFS_DOMAIN_NUM PHYDM_DFS_DOMAIN_ETSI + 1
|
||||
#define PHYDM_DFS_DOMAIN_IS_UNKNOWN(domain) ((domain) == PHYDM_DFS_DOMAIN_UNKNOWN || (domain) >= PHYDM_DFS_DOMAIN_NUM)
|
||||
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
struct dfs_rd_ctl_param {
|
||||
/*
|
||||
* DFS region domain set from core
|
||||
* >=PHYDM_DFS_DOMAIN_NUM => not set (keep original)
|
||||
* < PHYDM_DFS_DOMAIN_NUM => change domain (if needed) and ignore other parameters
|
||||
*/
|
||||
enum phydm_dfs_region_domain domain;
|
||||
|
||||
/*
|
||||
* enable=true, cac=1 => enable radar detect and is under CAC
|
||||
* enable=true, cac=0 => enalbe radar detect, in-service monitoring
|
||||
* enable=true, cac<0 => enable radar detect w/o changing CAC status
|
||||
* enable=false, cac=any => disable radar detect
|
||||
*/
|
||||
bool enable;
|
||||
|
||||
/*
|
||||
* CAC status set from core
|
||||
* < 0: not set (keep original)
|
||||
* 0: not under CAC
|
||||
* 1: under CAC
|
||||
*/
|
||||
s8 cac;
|
||||
|
||||
/*
|
||||
* configuration for specific radar detect range (5G band is implicit), the value of sp_ch:
|
||||
* < 0: not set (keep original)
|
||||
* 0: all detectable range
|
||||
* > 0: specific detect range (by ch, bw, offset)
|
||||
*/
|
||||
s16 sp_ch;
|
||||
enum channel_width sp_bw;
|
||||
enum chan_offset sp_offset;
|
||||
|
||||
/*
|
||||
* configuration for specific radar detect range in freqency, valid when sp_ch < 0
|
||||
* 0: not set (keep original)
|
||||
*/
|
||||
u32 sp_freq_hi;
|
||||
u32 sp_freq_lo;
|
||||
};
|
||||
|
||||
static bool hal_bchbw_in_radar_domain(enum band_type band, u8 ch
|
||||
, enum channel_width bw, enum chan_offset offset)
|
||||
{
|
||||
return band == BAND_ON_5G
|
||||
&& ((ch >= 52 && ch <= 64) || (ch >= 100 && ch <= 144))
|
||||
;
|
||||
}
|
||||
|
||||
static bool hal_radar_detect_range_specified(struct rtw_dfs_t *dfs_info)
|
||||
{
|
||||
return dfs_info->sp_detect_range_hi != 0;
|
||||
}
|
||||
|
||||
static bool hal_overlap_radar_detect_range(struct rtw_dfs_t *dfs_info
|
||||
, enum band_type band, u8 ch, enum channel_width bw, enum chan_offset offset)
|
||||
{
|
||||
bool ret = false;
|
||||
u32 hi = 0, lo = 0;
|
||||
int i;
|
||||
|
||||
if (!rtw_bchbw_to_freq_range(band, ch, bw, offset, &hi, &lo)) {
|
||||
rtw_warn_on(1);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (rtw_is_range_overlap(hi, lo, dfs_info->sp_detect_range_hi, dfs_info->sp_detect_range_lo))
|
||||
ret = true;
|
||||
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool hal_should_radar_detect_enable_by_ch(struct hal_com_data *hal_data, u8 band_idx,
|
||||
enum band_type band, u8 channel, enum channel_width bwmode, enum chan_offset offset)
|
||||
{
|
||||
struct rtw_dfs_t *dfs_info = &hal_data->dfs_info;
|
||||
|
||||
if (dfs_info->enable && !PHYDM_DFS_DOMAIN_IS_UNKNOWN(dfs_info->region_domain)
|
||||
&& hal_bchbw_in_radar_domain(band, channel, bwmode, offset)
|
||||
) {
|
||||
if (!hal_radar_detect_range_specified(dfs_info)
|
||||
|| hal_overlap_radar_detect_range(dfs_info, band, channel, bwmode, offset))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void hal_dfs_handle_pending_domain_change(struct hal_com_data *hal_data, u8 band_idx
|
||||
, enum band_type band, u8 ch, enum channel_width bw, enum chan_offset offset)
|
||||
{
|
||||
struct rtw_dfs_t *dfs_info = &hal_data->dfs_info;
|
||||
|
||||
if (dfs_info->pending_domain_change) {
|
||||
if (dfs_info->radar_detect_enabled)
|
||||
phydm_radar_detect_disable(&hal_data->odmpriv);
|
||||
odm_cmn_info_init(&hal_data->odmpriv, ODM_CMNINFO_DFS_REGION_DOMAIN
|
||||
, hal_data->dfs_info.region_domain);
|
||||
if (dfs_info->radar_detect_enabled)
|
||||
phydm_radar_detect_enable(&hal_data->odmpriv);
|
||||
|
||||
dfs_info->pending_domain_change = false;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
hal_radar_detect_switch(struct hal_com_data *hal_data, u8 band_idx, bool enable)
|
||||
{
|
||||
struct rtw_dfs_t *dfs_info = &hal_data->dfs_info;
|
||||
|
||||
if (enable)
|
||||
phydm_radar_detect_enable(&hal_data->odmpriv);
|
||||
else
|
||||
phydm_radar_detect_disable(&hal_data->odmpriv);
|
||||
|
||||
dfs_info->radar_detect_enabled = enable;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
bool hal_is_radar_detect_enabled(struct hal_com_data *hal_data, u8 band_idx)
|
||||
{
|
||||
return hal_data->dfs_info.radar_detect_enabled;
|
||||
}
|
||||
|
||||
static void hal_set_under_cac(struct hal_com_data *hal_data, u8 band_idx, bool under)
|
||||
{
|
||||
hal_data->dfs_info.under_cac = under;
|
||||
}
|
||||
|
||||
bool hal_is_under_cac(struct hal_com_data *hal_data, u8 band_idx)
|
||||
{
|
||||
return hal_data->dfs_info.under_cac;
|
||||
}
|
||||
|
||||
static int
|
||||
hal_cac_tx_pause_switch(struct hal_com_data *hal_data, u8 band_idx, bool enable)
|
||||
{
|
||||
struct rtw_dfs_t *dfs_info = &hal_data->dfs_info;
|
||||
|
||||
if (rtw_hal_tx_pause(hal_data->adapter, PAUSE_RSON_DFS_CAC, enable) == _SUCCESS) {
|
||||
dfs_info->cac_tx_paused = enable;
|
||||
return _SUCCESS;
|
||||
}
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
bool hal_is_cac_tx_paused(struct hal_com_data *hal_data, u8 band_idx)
|
||||
{
|
||||
return hal_data->dfs_info.cac_tx_paused;
|
||||
}
|
||||
|
||||
void hal_dfs_rd_setting_before_ch_switch(struct hal_com_data *hal_data, u8 band_idx
|
||||
, enum band_type band, u8 ch, enum channel_width bw, enum chan_offset offset, struct dfs_rd_ch_switch_ctx *ctx)
|
||||
{
|
||||
ctx->should_rd_en_on_new_ch = hal_should_radar_detect_enable_by_ch(hal_data
|
||||
, band_idx, band, ch, bw, offset);
|
||||
ctx->under_cac = hal_is_under_cac(hal_data, band_idx);
|
||||
ctx->cac_tx_paused = hal_is_cac_tx_paused(hal_data, band_idx);
|
||||
|
||||
ctx->rd_enabled = hal_is_radar_detect_enabled(hal_data, band_idx);
|
||||
|
||||
if (!ctx->should_rd_en_on_new_ch && ctx->rd_enabled) {
|
||||
/* turn off radar detect before channel setting (ex: leaving detection range) */
|
||||
int rst = hal_radar_detect_switch(hal_data, band_idx, false);
|
||||
|
||||
if (rst == _SUCCESS)
|
||||
RTW_INFO("[DFS] new ch=%d,%u,%d,%d disable radar detect\n", band, ch, bw, offset);
|
||||
else
|
||||
RTW_ERR("[DFS] new ch=%d,%u,%d,%d disable radar detect failed\n", band, ch, bw, offset);
|
||||
|
||||
ctx->rd_enabled = hal_is_radar_detect_enabled(hal_data, band_idx);
|
||||
}
|
||||
|
||||
if (ctx->should_rd_en_on_new_ch && ctx->under_cac && !ctx->cac_tx_paused) {
|
||||
/* turn on CAC tx pause before channel setting (ex: entering detection range) */
|
||||
int rst = hal_cac_tx_pause_switch(hal_data, band_idx, true);
|
||||
|
||||
if (rst == _SUCCESS)
|
||||
RTW_INFO("[DFS] new ch=%d,%u,%d,%d enable CAC tx pause\n", band, ch, bw, offset);
|
||||
else
|
||||
RTW_ERR("[DFS] new ch=%d,%u,%d,%d enable CAC tx pause failed\n", band, ch, bw, offset);
|
||||
}
|
||||
}
|
||||
|
||||
void hal_dfs_rd_setting_after_ch_switch(struct hal_com_data *hal_data, u8 band_idx
|
||||
, enum band_type band, u8 ch, enum channel_width bw, enum chan_offset offset, struct dfs_rd_ch_switch_ctx *ctx)
|
||||
{
|
||||
if (ctx->should_rd_en_on_new_ch && !ctx->rd_enabled) {
|
||||
/* turn on radar detect after channel setting (ex: entered radar detect range) */
|
||||
int rst = hal_radar_detect_switch(hal_data, band_idx, true);
|
||||
|
||||
if (rst == _SUCCESS)
|
||||
RTW_INFO("[DFS] new ch=%d,%u,%d,%d enable radar detect\n", band, ch, bw, offset);
|
||||
else
|
||||
RTW_ERR("[DFS] new ch=%d,%u,%d,%d enable radar detect failed\n", band, ch, bw, offset);
|
||||
}
|
||||
|
||||
if ((!ctx->should_rd_en_on_new_ch || !ctx->under_cac) && ctx->cac_tx_paused) {
|
||||
/* turn off CAC tx pause after channel setting (ex: leaved detection range) */
|
||||
int rst = hal_cac_tx_pause_switch(hal_data, band_idx, false);
|
||||
|
||||
if (rst == _SUCCESS)
|
||||
RTW_INFO("[DFS] new ch=%d,%u,%d,%d disable CAC tx pause\n", band, ch, bw, offset);
|
||||
else
|
||||
RTW_ERR("[DFS] new ch=%d,%u,%d,%d disable CAC tx pause failed\n", band, ch, bw, offset);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
hal_radar_detect_confs_apply(struct hal_com_data *hal_data, u8 band_idx)
|
||||
{
|
||||
struct rtw_dfs_t *dfs_info = &hal_data->dfs_info;
|
||||
int rd_rst = _SUCCESS;
|
||||
int cac_rst = _SUCCESS;
|
||||
u8 band, ch, bw, offset;
|
||||
bool should_rd_enable;
|
||||
bool under_cac;
|
||||
bool cac_tx_paused;
|
||||
|
||||
ch = rtw_get_oper_ch(hal_data->adapter);
|
||||
bw = rtw_get_oper_bw(hal_data->adapter);
|
||||
offset = rtw_get_oper_choffset(hal_data->adapter);
|
||||
band = rtw_is_2g_ch(ch) ? BAND_ON_24G : BAND_ON_5G;
|
||||
|
||||
hal_dfs_handle_pending_domain_change(hal_data, band_idx
|
||||
, band, ch, bw, offset);
|
||||
|
||||
should_rd_enable = hal_should_radar_detect_enable_by_ch(hal_data, band_idx
|
||||
, band, ch, bw, offset);
|
||||
under_cac = hal_is_under_cac(hal_data, band_idx);
|
||||
cac_tx_paused = hal_is_cac_tx_paused(hal_data, band_idx);
|
||||
|
||||
if (!dfs_info->radar_detect_enabled) {
|
||||
if (should_rd_enable) {
|
||||
rd_rst = hal_radar_detect_switch(hal_data, band_idx, true);
|
||||
if (rd_rst == _SUCCESS)
|
||||
RTW_INFO("[DFS] ch=%d,%u,%d,%d enable radar detect\n", band, ch, bw, offset);
|
||||
else
|
||||
RTW_ERR("[DFS] ch=%d,%u,%d,%d enable radar detect failed\n", band, ch, bw, offset);
|
||||
}
|
||||
|
||||
} else if (dfs_info->radar_detect_enabled) {
|
||||
if (!should_rd_enable) {
|
||||
rd_rst = hal_radar_detect_switch(hal_data, band_idx, false);
|
||||
if (rd_rst == _SUCCESS)
|
||||
RTW_INFO("[DFS] ch=%d,%u,%d,%d disable radar detect\n", band, ch, bw, offset);
|
||||
else
|
||||
RTW_ERR("[DFS] ch=%d,%u,%d,%d disable radar detect failed\n", band, ch, bw, offset);
|
||||
}
|
||||
}
|
||||
|
||||
if (!cac_tx_paused) {
|
||||
if (under_cac && dfs_info->radar_detect_enabled) {
|
||||
cac_rst = hal_cac_tx_pause_switch(hal_data, band_idx, true);
|
||||
if (cac_rst == _SUCCESS)
|
||||
RTW_INFO("[DFS] ch=%d,%u,%d,%d enable CAC tx pause\n", band, ch, bw, offset);
|
||||
else
|
||||
RTW_INFO("[DFS] ch=%d,%u,%d,%d enable CAC tx pause failed\n", band, ch, bw, offset);
|
||||
}
|
||||
|
||||
} else if (cac_tx_paused) {
|
||||
if (!under_cac) {
|
||||
/*
|
||||
* Release CAC tx pause only when not under CAC
|
||||
* Keep CAC tx pause when under CAC and radar detect is turned off by
|
||||
* specifying new detect range which doesn't overlap current channel setting
|
||||
* (ex: operating channel switching to new DFS channel)
|
||||
*/
|
||||
cac_rst = hal_cac_tx_pause_switch(hal_data, band_idx, false);
|
||||
if (cac_rst == _SUCCESS)
|
||||
RTW_INFO("[DFS] ch=%d,%u,%d,%d disable CAC tx pause\n", band, ch, bw, offset);
|
||||
else
|
||||
RTW_INFO("[DFS] ch=%d,%u,%d,%d disable CAC tx pause failed\n", band, ch, bw, offset);
|
||||
}
|
||||
}
|
||||
|
||||
if (rd_rst == _SUCCESS && cac_rst == _SUCCESS)
|
||||
return _SUCCESS;
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
static int
|
||||
hal_dfs_rd_ctl_hdl(struct hal_com_data *hal_data, struct dfs_rd_ctl_param *rd_ctl_param)
|
||||
{
|
||||
struct rtw_dfs_t *dfs_info = &hal_data->dfs_info;
|
||||
u8 band_idx = HW_BAND_0; /* multi band/phy capable? */
|
||||
|
||||
if (rd_ctl_param->domain < PHYDM_DFS_DOMAIN_NUM) {
|
||||
if (rd_ctl_param->domain != dfs_info->region_domain) {
|
||||
RTW_INFO("%s set domain to %d\n", __func__, rd_ctl_param->domain);
|
||||
dfs_info->region_domain = rd_ctl_param->domain;
|
||||
dfs_info->pending_domain_change = true;
|
||||
}
|
||||
goto apply;
|
||||
}
|
||||
|
||||
if (rd_ctl_param->enable) {
|
||||
if (!dfs_info->enable) {
|
||||
RTW_INFO("%s enable\n", __func__);
|
||||
dfs_info->enable = true;
|
||||
}
|
||||
if (rd_ctl_param->cac == 1) {
|
||||
if (!hal_is_under_cac(hal_data, band_idx)) {
|
||||
RTW_INFO("%s under CAC\n", __func__);
|
||||
hal_set_under_cac(hal_data, band_idx, true);
|
||||
}
|
||||
} else if (rd_ctl_param->cac == 0) {
|
||||
if (hal_is_under_cac(hal_data, band_idx)) {
|
||||
RTW_INFO("%s CAC done\n", __func__);
|
||||
hal_set_under_cac(hal_data, band_idx, false);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (dfs_info->enable) {
|
||||
RTW_INFO("%s disable\n", __func__);
|
||||
dfs_info->enable = false;
|
||||
}
|
||||
hal_set_under_cac(hal_data, band_idx, false);
|
||||
}
|
||||
|
||||
if (rd_ctl_param->sp_ch > 0) {
|
||||
u32 hi, lo;
|
||||
|
||||
if (rtw_bchbw_to_freq_range(BAND_ON_5G
|
||||
, rd_ctl_param->sp_ch, rd_ctl_param->sp_bw, rd_ctl_param->sp_offset
|
||||
, &hi, &lo)
|
||||
) {
|
||||
if (dfs_info->sp_detect_range_hi != hi || dfs_info->sp_detect_range_lo != lo) {
|
||||
RTW_INFO("%s sp_ch:%u,%d,%d is set\n", __func__
|
||||
, rd_ctl_param->sp_ch, rd_ctl_param->sp_bw, rd_ctl_param->sp_offset);
|
||||
dfs_info->sp_detect_range_hi = hi;
|
||||
dfs_info->sp_detect_range_lo = lo;
|
||||
}
|
||||
} else {
|
||||
RTW_WARN("%s sp_ch:%u,%d,%d to freq range fail, all range applied\n", __func__
|
||||
, rd_ctl_param->sp_ch, rd_ctl_param->sp_bw, rd_ctl_param->sp_offset);
|
||||
dfs_info->sp_detect_range_hi = 0;
|
||||
}
|
||||
} else if (rd_ctl_param->sp_ch == 0) {
|
||||
if (dfs_info->sp_detect_range_hi != 0) {
|
||||
RTW_INFO("%s all range applied\n", __func__);
|
||||
dfs_info->sp_detect_range_hi = 0;
|
||||
}
|
||||
} else if (rd_ctl_param->sp_freq_hi) {
|
||||
if (rd_ctl_param->sp_freq_hi <= rd_ctl_param->sp_freq_lo) {
|
||||
RTW_WARN("%s sp_freq_hi:%u <= sp_freq_lo:%u, all range applied\n", __func__
|
||||
, rd_ctl_param->sp_freq_hi, rd_ctl_param->sp_freq_lo);
|
||||
} else {
|
||||
if (dfs_info->sp_detect_range_hi != rd_ctl_param->sp_freq_hi
|
||||
|| dfs_info->sp_detect_range_lo != rd_ctl_param->sp_freq_lo
|
||||
) {
|
||||
RTW_INFO("%s sp_freq %u to %u is set\n", __func__
|
||||
, rd_ctl_param->sp_freq_lo, rd_ctl_param->sp_freq_hi);
|
||||
dfs_info->sp_detect_range_hi = rd_ctl_param->sp_freq_hi;
|
||||
dfs_info->sp_detect_range_lo = rd_ctl_param->sp_freq_lo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apply:
|
||||
/* apply new configs on cur channel */
|
||||
return hal_radar_detect_confs_apply(hal_data, band_idx);
|
||||
}
|
||||
|
||||
static int
|
||||
_rtw_hal_dfs_rd_ctl(struct hal_com_data *hal_data, enum phl_band_idx hw_band
|
||||
, enum phydm_dfs_region_domain domain, bool enable, s8 cac, s16 sp_ch, enum channel_width sp_bw, enum chan_offset sp_offset
|
||||
, u32 sp_freq_hi, u32 sp_freq_lo)
|
||||
{
|
||||
int ret;
|
||||
struct dfs_rd_ctl_param param;
|
||||
|
||||
param.domain = domain;
|
||||
param.enable = enable;
|
||||
param.cac = cac;
|
||||
param.sp_ch = sp_ch;
|
||||
param.sp_bw = sp_bw;
|
||||
param.sp_offset = sp_offset;
|
||||
param.sp_freq_hi = sp_freq_hi;
|
||||
param.sp_freq_lo = sp_freq_lo;
|
||||
|
||||
ret = hal_dfs_rd_ctl_hdl(hal_data, ¶m);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
rtw_hal_dfs_change_domain(struct hal_com_data *hal_data, enum phl_band_idx hw_band
|
||||
, enum phydm_dfs_region_domain domain)
|
||||
{
|
||||
if (domain >= PHYDM_DFS_DOMAIN_NUM) {
|
||||
RTW_WARN("%s(), invalid domain:%d\n", __func__, domain);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
return _rtw_hal_dfs_rd_ctl(hal_data, hw_band
|
||||
, domain /* change domain, other parameters will be ignored */
|
||||
, false, 0, -1, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
int
|
||||
rtw_hal_dfs_rd_enable_all_range(struct hal_com_data *hal_data, enum phl_band_idx hw_band)
|
||||
{
|
||||
return _rtw_hal_dfs_rd_ctl(hal_data, hw_band
|
||||
, PHYDM_DFS_DOMAIN_NUM
|
||||
, true, -1 /* enable radar detect w/o changing CAC status */
|
||||
, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
int
|
||||
rtw_hal_dfs_rd_enable_with_sp_chbw(struct hal_com_data *hal_data, enum phl_band_idx hw_band
|
||||
, bool cac, u8 sp_ch, enum channel_width sp_bw, enum chan_offset sp_offset)
|
||||
{
|
||||
return _rtw_hal_dfs_rd_ctl(hal_data, hw_band
|
||||
, PHYDM_DFS_DOMAIN_NUM
|
||||
, true, cac ? 1 : 0, sp_ch, sp_bw, sp_offset, 0, 0);
|
||||
}
|
||||
|
||||
int
|
||||
rtw_hal_dfs_rd_enable_with_sp_freq_range(struct hal_com_data *hal_data, enum phl_band_idx hw_band
|
||||
, bool cac, u32 sp_freq_hi, u32 sp_freq_lo)
|
||||
{
|
||||
return _rtw_hal_dfs_rd_ctl(hal_data, hw_band
|
||||
, PHYDM_DFS_DOMAIN_NUM
|
||||
, true, cac ? 1 : 0, -1, 0, 0, sp_freq_hi, sp_freq_lo);
|
||||
}
|
||||
|
||||
int
|
||||
rtw_hal_dfs_rd_set_cac_status(struct hal_com_data *hal_data, enum phl_band_idx hw_band, bool cac)
|
||||
{
|
||||
return _rtw_hal_dfs_rd_ctl(hal_data, hw_band
|
||||
, PHYDM_DFS_DOMAIN_NUM
|
||||
, true /* CAC status only valid when radar detect enable */
|
||||
, cac ? 1 : 0, -1, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
int
|
||||
rtw_hal_dfs_rd_disable(struct hal_com_data *hal_data, enum phl_band_idx hw_band)
|
||||
{
|
||||
return _rtw_hal_dfs_rd_ctl(hal_data, hw_band
|
||||
, PHYDM_DFS_DOMAIN_NUM
|
||||
, false, 0, -1, 0, 0, 0, 0);
|
||||
}
|
||||
#endif
|
||||
83
drivers/net/wireless/rtl8822cs/hal/hal_dfs.h
Normal file
83
drivers/net/wireless/rtl8822cs/hal/hal_dfs.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef _HAL_DFS_H_
|
||||
#define _HAL_DFS_H_
|
||||
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
struct rtw_dfs_t {
|
||||
enum phydm_dfs_region_domain region_domain;
|
||||
bool enable; /* set by core layer to enable/disable radar detection */
|
||||
bool under_cac; /* set by core layer to indicate CAC status */
|
||||
|
||||
/*
|
||||
* set by core to specify detect range
|
||||
* sp_detect_range_hi = 0 means no specified range, whole range allowed
|
||||
* by HAL will enable radar detection
|
||||
*/
|
||||
u32 sp_detect_range_hi;
|
||||
u32 sp_detect_range_lo;
|
||||
|
||||
bool radar_detect_enabled; /* if radar detection is enabled */
|
||||
bool cac_tx_paused; /* if tx paused by CAC */
|
||||
bool pending_domain_change; /* if there is domain change under process */
|
||||
|
||||
bool is_radar_detectd; /* if radar is detected */
|
||||
};
|
||||
|
||||
struct hal_com_data;
|
||||
|
||||
bool hal_is_radar_detect_enabled(struct hal_com_data *hal_data, u8 band_idx);
|
||||
|
||||
bool hal_is_under_cac(struct hal_com_data *hal_data, u8 band_idx);
|
||||
|
||||
bool hal_is_cac_tx_paused(struct hal_com_data *hal_data, u8 band_idx);
|
||||
|
||||
struct dfs_rd_ch_switch_ctx {
|
||||
bool rd_enabled;
|
||||
bool should_rd_en_on_new_ch;
|
||||
bool under_cac;
|
||||
bool cac_tx_paused;
|
||||
};
|
||||
|
||||
void hal_dfs_rd_setting_before_ch_switch(struct hal_com_data *hal_data, u8 band_idx
|
||||
, enum band_type band, u8 ch, enum channel_width bw, enum chan_offset offset, struct dfs_rd_ch_switch_ctx *ctx);
|
||||
|
||||
void hal_dfs_rd_setting_after_ch_switch(struct hal_com_data *hal_data, u8 band_idx
|
||||
, enum band_type band, u8 ch, enum channel_width bw, enum chan_offset offset, struct dfs_rd_ch_switch_ctx *ctx);
|
||||
|
||||
int
|
||||
rtw_hal_dfs_change_domain(struct hal_com_data *hal_data, enum phl_band_idx hw_band
|
||||
, enum phydm_dfs_region_domain domain);
|
||||
|
||||
int
|
||||
rtw_hal_dfs_rd_enable_all_range(struct hal_com_data *hal_data, enum phl_band_idx hw_band);
|
||||
|
||||
int
|
||||
rtw_hal_dfs_rd_enable_with_sp_chbw(struct hal_com_data *hal_data, enum phl_band_idx hw_band
|
||||
, bool cac, u8 sp_ch, enum channel_width sp_bw, enum chan_offset sp_offset);
|
||||
|
||||
int
|
||||
rtw_hal_dfs_rd_enable_with_sp_freq_range(struct hal_com_data *hal_data, enum phl_band_idx hw_band
|
||||
, bool cac, u32 sp_freq_hi, u32 sp_freq_lo);
|
||||
|
||||
int
|
||||
rtw_hal_dfs_rd_set_cac_status(struct hal_com_data *hal_data, enum phl_band_idx hw_band, bool cac);
|
||||
|
||||
int
|
||||
rtw_hal_dfs_rd_disable(struct hal_com_data *hal_data, enum phl_band_idx hw_band);
|
||||
#endif
|
||||
|
||||
#endif /* _HAL_DFS_H_ */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2014 - 2017 Realtek Corporation.
|
||||
* Copyright(c) 2014 - 2021 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -86,8 +86,8 @@ void rtw_hal_update_iqk_fw_offload_cap(_adapter *adapter)
|
||||
}
|
||||
}
|
||||
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8822C_SUPPORT == 1) \
|
||||
|| (RTL8723F_SUPPORT == 1))
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) \
|
||||
|| (RTL8822C_SUPPORT == 1) || (RTL8723F_SUPPORT == 1) || (RTL8822E_SUPPORT == 1))
|
||||
void rtw_phydm_iqk_trigger(_adapter *adapter)
|
||||
{
|
||||
struct dm_struct *p_dm_odm = adapter_to_phydm(adapter);
|
||||
@@ -96,7 +96,8 @@ void rtw_phydm_iqk_trigger(_adapter *adapter)
|
||||
u8 rfk_forbidden = _FALSE;
|
||||
|
||||
halrf_cmn_info_set(p_dm_odm, HALRF_CMNINFO_RFK_FORBIDDEN, rfk_forbidden);
|
||||
#if (RTL8822C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8723F_SUPPORT == 1)
|
||||
#if (RTL8822C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8723F_SUPPORT == 1) \
|
||||
|| (RTL8822E_SUPPORT == 1)
|
||||
/* halrf_cmn_info_set(p_dm_odm, HALRF_CMNINFO_IQK_SEGMENT, segment); to do */
|
||||
halrf_rf_k_connect_trigger(p_dm_odm, _TRUE, SEGMENT_FREE);
|
||||
#else
|
||||
@@ -114,10 +115,11 @@ void rtw_phydm_iqk_trigger_all(_adapter *adapter)
|
||||
u8 segment = _FALSE;
|
||||
u8 rfk_forbidden = _FALSE;
|
||||
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8822C_SUPPORT == 1) \
|
||||
|| (RTL8723F_SUPPORT == 1))
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) \
|
||||
|| (RTL8822C_SUPPORT == 1) || (RTL8723F_SUPPORT == 1) || (RTL8822E_SUPPORT == 1))
|
||||
halrf_cmn_info_set(p_dm_odm, HALRF_CMNINFO_RFK_FORBIDDEN, rfk_forbidden);
|
||||
#if (RTL8822C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8723F_SUPPORT == 1)
|
||||
#if (RTL8822C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8723F_SUPPORT == 1) \
|
||||
|| (RTL8822E_SUPPORT == 1)
|
||||
/* halrf_cmn_info_set(p_dm_odm, HALRF_CMNINFO_IQK_SEGMENT, segment); to do */
|
||||
halrf_rf_k_connect_trigger(p_dm_odm, _TRUE, SEGMENT_FREE);
|
||||
#else
|
||||
@@ -135,7 +137,8 @@ void rtw_phydm_iqk_trigger_dbg(_adapter *adapter, bool recovery, bool clear, boo
|
||||
{
|
||||
struct dm_struct *p_dm_odm = adapter_to_phydm(adapter);
|
||||
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8822C_SUPPORT == 1))
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) \
|
||||
|| (RTL8822C_SUPPORT == 1) || (RTL8822E_SUPPORT == 1))
|
||||
halrf_segment_iqk_trigger(p_dm_odm, clear, segment);
|
||||
#else
|
||||
halrf_iqk_trigger(p_dm_odm, recovery);
|
||||
@@ -350,6 +353,15 @@ void rtw_phydm_priv_init(_adapter *adapter)
|
||||
odm_cmn_info_init(phydm, ODM_CMNINFO_PLATFORM, ODM_CE);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_LITTLE_ENDIAN
|
||||
static u8 *convert_to_big_endian(void *value, int size)
|
||||
{
|
||||
u8 *temp;
|
||||
temp = (u8 *)value + size - 1;
|
||||
return temp;
|
||||
}
|
||||
#endif
|
||||
|
||||
void Init_ODM_ComInfo(_adapter *adapter)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
@@ -357,10 +369,18 @@ void Init_ODM_ComInfo(_adapter *adapter)
|
||||
struct dm_struct *pDM_Odm = &(pHalData->odmpriv);
|
||||
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(adapter);
|
||||
struct rf_ctl_t *rfctl = dvobj_to_rfctl(dvobj);
|
||||
struct registry_priv *regsty = dvobj_to_regsty(dvobj);
|
||||
int i;
|
||||
|
||||
/*phydm_op_mode could be change for different scenarios: ex: SoftAP - PHYDM_BALANCE_MODE*/
|
||||
pHalData->phydm_op_mode = PHYDM_PERFORMANCE_MODE;/*Service one device*/
|
||||
if (regsty->def_bb_opmode > PHYDM_BALANCE_MODE) {
|
||||
pHalData->phydm_op_mode = PHYDM_PERFORMANCE_MODE;/*Service one device*/
|
||||
RTW_WARN("%s bb_opmode: %d is not supported, set to %d\n", __func__
|
||||
, regsty->def_bb_opmode, pHalData->phydm_op_mode);
|
||||
} else {
|
||||
pHalData->phydm_op_mode = regsty->def_bb_opmode;
|
||||
RTW_INFO("%s bb_opmode set to %d\n", __func__, pHalData->phydm_op_mode);
|
||||
}
|
||||
|
||||
rtw_odm_init_ic_type(adapter);
|
||||
|
||||
if (rtw_get_intf_type(adapter) == RTW_GSPI)
|
||||
@@ -407,8 +427,7 @@ void Init_ODM_ComInfo(_adapter *adapter)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
rtw_odm_update_dfs_region(dvobj);
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_DFS_MASTER_ENABLE, &(adapter_to_rfctl(adapter)->radar_detect_enabled));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_DFS_MASTER_ENABLE, &rfctl->radar_detect_enabled);
|
||||
#endif
|
||||
|
||||
odm_cmn_info_init(pDM_Odm, ODM_CMNINFO_GPA, pHalData->TypeGPA);
|
||||
@@ -433,8 +452,6 @@ void Init_ODM_ComInfo(_adapter *adapter)
|
||||
odm_cmn_info_init(pDM_Odm, ODM_CMNINFO_EFUSE0X3D7, pHalData->efuse0x3d7);
|
||||
odm_cmn_info_init(pDM_Odm, ODM_CMNINFO_EFUSE0X3D8, pHalData->efuse0x3d8);
|
||||
|
||||
odm_cmn_info_init(pDM_Odm, ODM_CMNINFO_EN_NBI_DETECT, adapter->registrypriv.nbi_en);
|
||||
|
||||
/* waiting for PhyDMV034 support*/
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_MANUAL_SUPPORTABILITY, &(adapter->registrypriv.phydm_ability));
|
||||
|
||||
@@ -442,15 +459,14 @@ void Init_ODM_ComInfo(_adapter *adapter)
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_ADAPTIVITY, &rfctl->adaptivity_en);
|
||||
phydm_adaptivity_info_init(pDM_Odm, PHYDM_ADAPINFO_TH_L2H_INI, adapter->registrypriv.adaptivity_th_l2h_ini);
|
||||
phydm_adaptivity_info_init(pDM_Odm, PHYDM_ADAPINFO_TH_EDCCA_HL_DIFF, adapter->registrypriv.adaptivity_th_edcca_hl_diff);
|
||||
rtw_odm_adaptivity_update(dvobj);
|
||||
|
||||
/*halrf info init*/
|
||||
halrf_cmn_info_init(pDM_Odm, HALRF_CMNINFO_EEPROM_THERMAL_VALUE, pHalData->eeprom_thermal_meter);
|
||||
halrf_cmn_info_init(pDM_Odm, HALRF_CMNINFO_PWT_TYPE, 0);
|
||||
halrf_cmn_info_init(pDM_Odm, HALRF_CMNINFO_MP_POWER_TRACKING_TYPE, pHalData->txpwr_pg_mode);
|
||||
|
||||
if (rtw_odm_adaptivity_needed(adapter) == _TRUE)
|
||||
rtw_odm_adaptivity_config_msg(RTW_DBGDUMP, adapter);
|
||||
if (rtw_cfg_adaptivity_needed(adapter) == _TRUE)
|
||||
rtw_cfg_adaptivity_config_msg(RTW_DBGDUMP, adapter);
|
||||
|
||||
#ifdef CONFIG_IQK_PA_OFF
|
||||
odm_cmn_info_init(pDM_Odm, ODM_CMNINFO_IQKPAOFF, 1);
|
||||
@@ -469,11 +485,9 @@ void Init_ODM_ComInfo(_adapter *adapter)
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_TX_UNI, &(dvobj->traffic_stat.tx_bytes));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_RX_UNI, &(dvobj->traffic_stat.rx_bytes));
|
||||
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_BAND, &(pHalData->current_band_type));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_FORCED_RATE, &(pHalData->ForcedDataRate));
|
||||
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_SEC_CHNL_OFFSET, &(pHalData->nCur40MhzPrimeSC));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_SEC_MODE, &(adapter->securitypriv.dot11PrivacyAlgrthm));
|
||||
#ifdef CONFIG_NARROWBAND_SUPPORTING
|
||||
if ((adapter->registrypriv.rtw_nb_config == RTW_NB_CONFIG_WIDTH_10)
|
||||
|| (adapter->registrypriv.rtw_nb_config == RTW_NB_CONFIG_WIDTH_5)) {
|
||||
@@ -481,9 +495,19 @@ void Init_ODM_ComInfo(_adapter *adapter)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LITTLE_ENDIAN
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_BW, &(pHalData->current_channel_bw));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_CHNL, &(pHalData->current_channel));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_BAND, &(pHalData->current_band_type));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_SEC_MODE, &(adapter->securitypriv.dot11PrivacyAlgrthm));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_NET_CLOSED, &(adapter->net_closed));
|
||||
#else /* CONFIG_BIG_ENDIAN */
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_BW, convert_to_big_endian(&(pHalData->current_channel_bw), sizeof(enum channel_width)));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_BAND, convert_to_big_endian(&(pHalData->current_band_type), sizeof(BAND_TYPE)));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_SEC_MODE, convert_to_big_endian(&(adapter->securitypriv.dot11PrivacyAlgrthm), sizeof(u32)));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_NET_CLOSED, convert_to_big_endian(&(adapter->net_closed), sizeof(int)));
|
||||
#endif
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_CHNL, &(pHalData->current_channel));
|
||||
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_SCAN, &(pHalData->bScanInProcess));
|
||||
odm_cmn_info_hook(pDM_Odm, ODM_CMNINFO_POWER_SAVING, &(pwrctl->bpower_saving));
|
||||
@@ -723,7 +747,9 @@ void rtw_hal_turbo_edca(_adapter *adapter)
|
||||
if (interface_type == RTW_PCIE &&
|
||||
((ic_type == RTL8822B)
|
||||
|| (ic_type == RTL8822C)
|
||||
|| (ic_type == RTL8814A) || (ic_type == RTL8814B))) {
|
||||
|| (ic_type == RTL8814A)
|
||||
|| (ic_type == RTL8814B)
|
||||
|| (ic_type == RTL8822E))) {
|
||||
EDCA_BE_UL = 0x6ea42b;
|
||||
EDCA_BE_DL = 0x6ea42b;
|
||||
}
|
||||
@@ -1268,7 +1294,7 @@ void rtw_phydm_watchdog_in_lps_lclk(_adapter *adapter)
|
||||
|
||||
void dump_sta_traffic(void *sel, _adapter *adapter, struct sta_info *psta)
|
||||
{
|
||||
struct ra_sta_info *ra_info;
|
||||
/*struct ra_sta_info *ra_info;*/
|
||||
u8 curr_sgi = _FALSE;
|
||||
u32 tx_tp_mbips, rx_tp_mbips, bi_tp_mbips;
|
||||
|
||||
@@ -1282,7 +1308,7 @@ void dump_sta_traffic(void *sel, _adapter *adapter, struct sta_info *psta)
|
||||
RTW_PRINT_SEL(sel, "BCN counts : %d (per-%d second), DTIM Period:%d\n",
|
||||
rtw_get_bcn_cnt(psta->padapter) / 2, 1, rtw_get_bcn_dtim_period(psta->padapter));
|
||||
|
||||
ra_info = &psta->cmn.ra_info;
|
||||
/*ra_info = &psta->cmn.ra_info;*/
|
||||
curr_sgi = rtw_get_current_tx_sgi(adapter, psta);
|
||||
RTW_PRINT_SEL(sel, "tx_rate : %s(%s) rx_rate : %s, rx_rate_bmc : %s, rssi : %d %%\n"
|
||||
, HDATA_RATE(rtw_get_current_tx_rate(adapter, psta)), (curr_sgi) ? "S" : "L"
|
||||
@@ -1460,7 +1486,8 @@ u8 rtw_hal_runtime_trx_path_decision(_adapter *adapter)
|
||||
tx_path_nss_set_default(hal_data->txpath_nss, hal_data->txpath_num_nss
|
||||
, GET_HAL_TX_PATH_BMP(adapter));
|
||||
|
||||
#if defined(CONFIG_RTL8192F) || defined(CONFIG_RTL8822B) ||defined(CONFIG_RTL8822C)
|
||||
#if defined(CONFIG_RTL8192F) || defined(CONFIG_RTL8822B) \
|
||||
|| defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8822E)
|
||||
{
|
||||
enum bb_path txpath_1ss;
|
||||
|
||||
@@ -1542,7 +1569,8 @@ static u8 rtw_phydm_config_trx_path(_adapter *adapter)
|
||||
{
|
||||
u8 rst = _SUCCESS;
|
||||
|
||||
#if defined(CONFIG_RTL8192F) || defined(CONFIG_RTL8822B) ||defined(CONFIG_RTL8822C)
|
||||
#if defined(CONFIG_RTL8192F) || defined(CONFIG_RTL8822B) \
|
||||
|| defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8822E)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
enum bb_path txpath = hal_data->txpath;
|
||||
@@ -1683,12 +1711,14 @@ static u8 _rtw_phydm_rfk_condition_check(_adapter *adapter, u8 is_scaning, u8 if
|
||||
#endif
|
||||
|
||||
if (ifs_linked) {
|
||||
if (is_scaning) {
|
||||
if (adapter_to_rfctl(adapter)->offch_state != OFFCHS_NONE) {
|
||||
rfk_allowed = _FALSE;
|
||||
RTW_DBG("[RFK-CHK] RF-K not allowed due to offch_state\n");
|
||||
} else if (is_scaning) {
|
||||
rfk_allowed = _FALSE;
|
||||
RTW_DBG("[RFK-CHK] RF-K not allowed due to ifaces under site-survey\n");
|
||||
}
|
||||
else {
|
||||
rfk_allowed = rtw_mi_stayin_union_ch_chk(adapter) ? _TRUE : _FALSE;
|
||||
} else {
|
||||
rfk_allowed = rtw_mi_stayin_union_ch_chk(adapter, true) ? _TRUE : _FALSE;
|
||||
if (rfk_allowed == _FALSE)
|
||||
RTW_ERR("[RFK-CHK] RF-K not allowed due to ld_iface not stayin union ch\n");
|
||||
}
|
||||
@@ -1697,7 +1727,8 @@ static u8 _rtw_phydm_rfk_condition_check(_adapter *adapter, u8 is_scaning, u8 if
|
||||
return rfk_allowed;
|
||||
}
|
||||
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8822C_SUPPORT == 1))
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) \
|
||||
|| (RTL8822C_SUPPORT == 1) || (RTL8822E_SUPPORT == 1))
|
||||
static u8 _rtw_phydm_iqk_segment_chk(_adapter *adapter, u8 ifs_linked)
|
||||
{
|
||||
u8 iqk_sgt = _FALSE;
|
||||
@@ -1889,7 +1920,8 @@ void rtw_phydm_watchdog(_adapter *adapter, bool in_lps)
|
||||
u8 bsta_state = _FALSE;
|
||||
u8 bBtDisabled = _TRUE;
|
||||
u8 rfk_forbidden = _FALSE;
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8822C_SUPPORT == 1))
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) \
|
||||
|| (RTL8822C_SUPPORT == 1) || (RTL8822E_SUPPORT == 1))
|
||||
u8 segment_iqk = _FALSE;
|
||||
#endif
|
||||
u8 tx_unlinked_low_rate = 0xFF;
|
||||
@@ -1924,7 +1956,8 @@ void rtw_phydm_watchdog(_adapter *adapter, bool in_lps)
|
||||
rfk_forbidden = (_rtw_phydm_rfk_condition_check(adapter, pHalData->bScanInProcess, bLinked) == _TRUE) ? _FALSE : _TRUE;
|
||||
halrf_cmn_info_set(&pHalData->odmpriv, HALRF_CMNINFO_RFK_FORBIDDEN, rfk_forbidden);
|
||||
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8822C_SUPPORT == 1))
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) \
|
||||
|| (RTL8822C_SUPPORT == 1) || (RTL8822E_SUPPORT == 1))
|
||||
segment_iqk = _rtw_phydm_iqk_segment_chk(adapter, bLinked);
|
||||
halrf_cmn_info_set(&pHalData->odmpriv, HALRF_CMNINFO_IQK_SEGMENT, segment_iqk);
|
||||
#endif
|
||||
|
||||
@@ -96,8 +96,8 @@ enum phy_cnt {
|
||||
CRC32_ERROR_CCK,
|
||||
};
|
||||
u32 rtw_phydm_get_phy_cnt(_adapter *adapter, enum phy_cnt cnt);
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) || (RTL8822C_SUPPORT == 1) \
|
||||
|| (RTL8723F_SUPPORT == 1))
|
||||
#if ((RTL8822B_SUPPORT == 1) || (RTL8821C_SUPPORT == 1) || (RTL8814B_SUPPORT == 1) \
|
||||
|| (RTL8822C_SUPPORT == 1) || (RTL8723F_SUPPORT == 1) || (RTL8822E_SUPPORT == 1))
|
||||
void rtw_phydm_iqk_trigger(_adapter *adapter);
|
||||
#endif
|
||||
void rtw_phydm_read_efuse(_adapter *adapter);
|
||||
|
||||
@@ -61,13 +61,11 @@ static void _rtw_bss_nums_count(_adapter *adapter, u8 *pbss_nums)
|
||||
|
||||
u8 rtw_get_ch_num_by_idx(_adapter *adapter, u8 idx)
|
||||
{
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
RT_CHANNEL_INFO *pch_set = rfctl->channel_set;
|
||||
u8 max_chan_nums = rfctl->max_chan_nums;
|
||||
struct rtw_chset *chset = adapter_to_chset(adapter);
|
||||
|
||||
if (idx >= max_chan_nums)
|
||||
if (idx >= chset->chs_len)
|
||||
return 0;
|
||||
return pch_set[idx].ChannelNum;
|
||||
return chset->chs[idx].ChannelNum;
|
||||
}
|
||||
#endif /*defined(CONFIG_RTW_ACS) || defined(CONFIG_BACKGROUND_NOISE_MONITOR)*/
|
||||
|
||||
@@ -144,20 +142,21 @@ void rtw_acs_trigger(_adapter *adapter, u16 scan_time_ms, u8 scan_chan, enum NHM
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
struct dm_struct *phydm = adapter_to_phydm(adapter);
|
||||
#if (RTK_ACS_VERSION == 3)
|
||||
struct clm_para_info clm_para;
|
||||
struct nhm_para_info nhm_para;
|
||||
struct env_trig_rpt trig_rpt;
|
||||
struct clm_para_info clm_para = {0};
|
||||
struct nhm_para_info nhm_para = {0};
|
||||
struct env_trig_rpt trig_rpt = {0};
|
||||
bool en_1db_mode = _FALSE;
|
||||
|
||||
scan_time_ms -= 10;
|
||||
|
||||
init_acs_clm(clm_para, scan_time_ms);
|
||||
|
||||
if (pid == NHM_PID_IEEE_11K_HIGH)
|
||||
init_11K_high_nhm(nhm_para, scan_time_ms);
|
||||
init_11K_high_nhm(nhm_para, scan_time_ms, en_1db_mode);
|
||||
else if (pid == NHM_PID_IEEE_11K_LOW)
|
||||
init_11K_low_nhm(nhm_para, scan_time_ms);
|
||||
init_11K_low_nhm(nhm_para, scan_time_ms, en_1db_mode);
|
||||
else
|
||||
init_acs_nhm(nhm_para, scan_time_ms);
|
||||
init_acs_nhm(nhm_para, scan_time_ms, en_1db_mode);
|
||||
|
||||
hal_data->acs.trig_rst = phydm_env_mntr_trigger(phydm, &nhm_para, &clm_para, &trig_rpt);
|
||||
if (hal_data->acs.trig_rst == (NHM_SUCCESS | CLM_SUCCESS)) {
|
||||
@@ -245,7 +244,7 @@ void rtw_acs_get_rst(_adapter *adapter)
|
||||
void _rtw_phydm_acs_select_best_chan(_adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
struct rtw_chset *chset = adapter_to_chset(adapter);
|
||||
u8 ch_idx;
|
||||
u8 ch_idx_24g = 0xFF, ch_idx_5g = 0xFF;
|
||||
u8 min_itf_24g = 0xFF, min_itf_5g = 0xFF;
|
||||
@@ -253,9 +252,10 @@ void _rtw_phydm_acs_select_best_chan(_adapter *adapter)
|
||||
u8 *pclm_ratio = hal_data->acs.clm_ratio;
|
||||
u8 *pnhm_ratio = hal_data->acs.nhm_ratio;
|
||||
u8 *pinterference_time = hal_data->acs.interference_time;
|
||||
u8 max_chan_nums = rfctl->max_chan_nums;
|
||||
|
||||
for (ch_idx = 0; ch_idx < max_chan_nums; ch_idx++) {
|
||||
for (ch_idx = 0; ch_idx < chset->chs_len; ch_idx++) {
|
||||
if (chset->chs[ch_idx].flags & RTW_CHF_DIS)
|
||||
continue;
|
||||
if (pbss_nums[ch_idx])
|
||||
pinterference_time[ch_idx] = (pclm_ratio[ch_idx] / 2) + (pnhm_ratio[ch_idx] / 2);
|
||||
else
|
||||
@@ -285,8 +285,7 @@ void _rtw_phydm_acs_select_best_chan(_adapter *adapter)
|
||||
void rtw_acs_info_dump(void *sel, _adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
u8 max_chan_nums = rfctl->max_chan_nums;
|
||||
struct rtw_chset *chset = adapter_to_chset(adapter);
|
||||
u8 ch_idx, ch_num;
|
||||
|
||||
_RTW_PRINT_SEL(sel, "========== ACS (VER-%d) ==========\n", RTK_ACS_VERSION);
|
||||
@@ -301,7 +300,9 @@ void rtw_acs_info_dump(void *sel, _adapter *adapter)
|
||||
_RTW_PRINT_SEL(sel, "%5s %3s %3s %3s(%%) %3s(%%) %3s\n",
|
||||
"Index", "CH", "BSS", "CLM", "NHM", "ITF");
|
||||
|
||||
for (ch_idx = 0; ch_idx < max_chan_nums; ch_idx++) {
|
||||
for (ch_idx = 0; ch_idx < chset->chs_len; ch_idx++) {
|
||||
if (chset->chs[ch_idx].flags & RTW_CHF_DIS)
|
||||
continue;
|
||||
ch_num = rtw_get_ch_num_by_idx(adapter, ch_idx);
|
||||
_RTW_PRINT_SEL(sel, "%5d %3d %3d %6d %6d %3d\n",
|
||||
ch_idx, ch_num, hal_data->acs.bss_nums[ch_idx],
|
||||
@@ -395,8 +396,7 @@ u8 rtw_acs_get_num_ratio_by_ch_idx(_adapter *adapter, u8 ch_idx)
|
||||
void rtw_acs_chan_info_dump(void *sel, _adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
u8 max_chan_nums = rfctl->max_chan_nums;
|
||||
struct rtw_chset *chset = adapter_to_chset(adapter);
|
||||
u8 ch_idx, ch_num;
|
||||
u8 utilization;
|
||||
|
||||
@@ -405,7 +405,9 @@ void rtw_acs_chan_info_dump(void *sel, _adapter *adapter)
|
||||
"Index", "CH", "Quality", "Availability", "Utilization",
|
||||
"WIFI Util", "Interference Util");
|
||||
|
||||
for (ch_idx = 0; ch_idx < max_chan_nums; ch_idx++) {
|
||||
for (ch_idx = 0; ch_idx < chset->chs_len; ch_idx++) {
|
||||
if (chset->chs[ch_idx].flags & RTW_CHF_DIS)
|
||||
continue;
|
||||
ch_num = rtw_get_ch_num_by_idx(adapter, ch_idx);
|
||||
utilization = hal_data->acs.clm_ratio[ch_idx] + hal_data->acs.nhm_ratio[ch_idx];
|
||||
_RTW_PRINT_SEL(sel, "%5d %3d %7d %12d %12d %12d %12d\n",
|
||||
@@ -500,8 +502,7 @@ void rtw_nm_disable(_adapter *adapter)
|
||||
void rtw_noise_info_dump(void *sel, _adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
struct rf_ctl_t *rfctl = adapter_to_rfctl(adapter);
|
||||
u8 max_chan_nums = rfctl->max_chan_nums;
|
||||
struct rtw_chset *chset = adapter_to_chset(adapter);
|
||||
u8 ch_idx, ch_num;
|
||||
|
||||
_RTW_PRINT_SEL(sel, "========== NM (VER-%d) ==========\n", RTK_NOISE_MONITOR_VERSION);
|
||||
@@ -510,7 +511,9 @@ void rtw_noise_info_dump(void *sel, _adapter *adapter)
|
||||
|
||||
_rtw_bss_nums_count(adapter, hal_data->nm.bss_nums);
|
||||
|
||||
for (ch_idx = 0; ch_idx < max_chan_nums; ch_idx++) {
|
||||
for (ch_idx = 0; ch_idx < chset->chs_len; ch_idx++) {
|
||||
if (chset->chs[ch_idx].flags & RTW_CHF_DIS)
|
||||
continue;
|
||||
ch_num = rtw_get_ch_num_by_idx(adapter, ch_idx);
|
||||
_RTW_PRINT_SEL(sel, "%5d %3d %3d %10d\n",
|
||||
ch_idx, ch_num, hal_data->nm.bss_nums[ch_idx],
|
||||
|
||||
@@ -31,7 +31,7 @@ enum NHM_PID {
|
||||
clm.mntr_time = time;\
|
||||
} while (0)
|
||||
|
||||
#define init_nhm_param(nhm, txon, cca, cnt_opt, app, lv, time) \
|
||||
#define init_nhm_param(nhm, txon, cca, cnt_opt, app, lv, time, en_1db_mode) \
|
||||
do {\
|
||||
nhm.incld_txon = txon;\
|
||||
nhm.incld_cca = cca;\
|
||||
@@ -39,20 +39,21 @@ enum NHM_PID {
|
||||
nhm.nhm_app = app;\
|
||||
nhm.nhm_lv = lv;\
|
||||
nhm.mntr_time = time;\
|
||||
nhm.en_1db_mode = en_1db_mode;\
|
||||
} while (0)
|
||||
|
||||
|
||||
#define init_acs_clm(clm, time) \
|
||||
init_clm_param(clm, CLM_ACS, CLM_LV_2, time)
|
||||
|
||||
#define init_acs_nhm(nhm, time) \
|
||||
init_nhm_param(nhm, NHM_EXCLUDE_TXON, NHM_EXCLUDE_CCA, NHM_CNT_ALL, NHM_ACS, NHM_LV_2, time)
|
||||
#define init_acs_nhm(nhm, time, en_1db_mode) \
|
||||
init_nhm_param(nhm, NHM_EXCLUDE_TXON, NHM_EXCLUDE_CCA, NHM_CNT_ALL, NHM_ACS, NHM_LV_2, time, en_1db_mode)
|
||||
|
||||
#define init_11K_high_nhm(nhm, time) \
|
||||
init_nhm_param(nhm, NHM_EXCLUDE_TXON, NHM_EXCLUDE_CCA, NHM_CNT_ALL, IEEE_11K_HIGH, NHM_LV_2, time)
|
||||
#define init_11K_high_nhm(nhm, time, en_1db_mode) \
|
||||
init_nhm_param(nhm, NHM_EXCLUDE_TXON, NHM_EXCLUDE_CCA, NHM_CNT_ALL, IEEE_11K_HIGH, NHM_LV_2, time, en_1db_mode)
|
||||
|
||||
#define init_11K_low_nhm(nhm, time) \
|
||||
init_nhm_param(nhm, NHM_EXCLUDE_TXON, NHM_EXCLUDE_CCA, NHM_CNT_ALL, IEEE_11K_LOW, NHM_LV_2, time)
|
||||
#define init_11K_low_nhm(nhm, time, en_1db_mode) \
|
||||
init_nhm_param(nhm, NHM_EXCLUDE_TXON, NHM_EXCLUDE_CCA, NHM_CNT_ALL, IEEE_11K_LOW, NHM_LV_2, time, en_1db_mode)
|
||||
|
||||
|
||||
#endif /*(RTK_ACS_VERSION == 3)*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2015 - 2021 Realtek Corporation.
|
||||
* Copyright(c) 2015 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -1206,7 +1206,7 @@ void rtw_halmac_get_version(char *str, u32 len)
|
||||
return;
|
||||
|
||||
rtw_sprintf(str, len, "V%d_%02d_%02d_%02d",
|
||||
ver.major_ver, ver.prototype_ver, ver.minor_ver, HALMAC_PATCH_VER);
|
||||
ver.major_ver, ver.prototype_ver, ver.minor_ver, ver.patch_ver);
|
||||
}
|
||||
|
||||
int rtw_halmac_init_adapter(struct dvobj_priv *d, struct halmac_platform_api *pf_api)
|
||||
@@ -1279,6 +1279,9 @@ int rtw_halmac_init_adapter(struct dvobj_priv *d, struct halmac_platform_api *pf
|
||||
/* Convert clock speed unit to MHz from Hz */
|
||||
info.clock_speed = RTW_DIV_ROUND_UP(rtw_sdio_get_clock(d), 1000000);
|
||||
info.block_size = rtw_sdio_get_block_size(d);
|
||||
#ifndef CONFIG_HALMAC_RS
|
||||
info.tx_512_by_byte_mode = (d->intf_data.max_byte_size >= 512) ? 1 : 0;
|
||||
#endif
|
||||
if (d->hmpriv.sdio_io_indir == 2)
|
||||
info.io_indir_flag = 0;
|
||||
else
|
||||
@@ -2698,6 +2701,10 @@ int rtw_halmac_poweron(struct dvobj_priv *d)
|
||||
struct halmac_api *api;
|
||||
enum halmac_ret_status status;
|
||||
int err = -1;
|
||||
#ifdef CONFIG_NARROWBAND_SUPPORTING
|
||||
struct registry_priv *regsty = dvobj_to_regsty(d);
|
||||
u32 bw_type;
|
||||
#endif /* CONFIG_NARROWBAND_SUPPORTING */
|
||||
#if defined(CONFIG_PCI_HCI) && defined(CONFIG_RTL8822B)
|
||||
struct _ADAPTER *a;
|
||||
u8 v8;
|
||||
@@ -2734,6 +2741,16 @@ int rtw_halmac_poweron(struct dvobj_priv *d)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NARROWBAND_SUPPORTING
|
||||
if (regsty->rtw_nb_config == RTW_NB_CONFIG_WIDTH_10)
|
||||
bw_type = HALMAC_BW_10;
|
||||
else if (regsty->rtw_nb_config == RTW_NB_CONFIG_WIDTH_5)
|
||||
bw_type = HALMAC_BW_5;
|
||||
|
||||
if ((bw_type == HALMAC_BW_10) || (bw_type == HALMAC_BW_5))
|
||||
api->halmac_set_hw_value(dvobj_to_halmac(d), HALMAC_HW_BANDWIDTH, &bw_type);
|
||||
#endif /* CONFIG_NARROWBAND_SUPPORTING */
|
||||
|
||||
status = _power_switch(halmac, api, HALMAC_MAC_POWER_ON);
|
||||
if (HALMAC_RET_PWR_UNCHANGE == status) {
|
||||
|
||||
@@ -2881,6 +2898,8 @@ static enum halmac_drv_rsvd_pg_num _rsvd_page_num_drv2halmac(u16 num)
|
||||
return HALMAC_RSVD_PG_NUM64;
|
||||
if (num <= 128)
|
||||
return HALMAC_RSVD_PG_NUM128;
|
||||
|
||||
#ifndef CONFIG_HALMAC_RS
|
||||
if (num <= 256)
|
||||
return HALMAC_RSVD_PG_NUM256;
|
||||
if (num <= 512)
|
||||
@@ -2894,6 +2913,14 @@ static enum halmac_drv_rsvd_pg_num _rsvd_page_num_drv2halmac(u16 num)
|
||||
__FUNCTION__, num);
|
||||
|
||||
return HALMAC_RSVD_PG_NUM1460;
|
||||
#else
|
||||
if (num > 256)
|
||||
RTW_WARN("%s: Fail to allocate RSVD page(%d)!!"
|
||||
" The MAX RSVD page number is 256...\n",
|
||||
__FUNCTION__, num);
|
||||
|
||||
return HALMAC_RSVD_PG_NUM256;
|
||||
#endif
|
||||
}
|
||||
|
||||
static u16 _rsvd_page_num_halmac2drv(enum halmac_drv_rsvd_pg_num rsvd_page_number)
|
||||
@@ -2930,6 +2957,7 @@ static u16 _rsvd_page_num_halmac2drv(enum halmac_drv_rsvd_pg_num rsvd_page_numbe
|
||||
num = 256;
|
||||
break;
|
||||
|
||||
#ifndef CONFIG_HALMAC_RS
|
||||
case HALMAC_RSVD_PG_NUM512:
|
||||
num = 512;
|
||||
break;
|
||||
@@ -2941,6 +2969,7 @@ static u16 _rsvd_page_num_halmac2drv(enum halmac_drv_rsvd_pg_num rsvd_page_numbe
|
||||
case HALMAC_RSVD_PG_NUM1460:
|
||||
num = 1460;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
return num;
|
||||
@@ -3135,7 +3164,7 @@ static int _send_general_info(struct dvobj_priv *d)
|
||||
case HALMAC_RET_NO_DLFW:
|
||||
RTW_WARN("%s: halmac_send_general_info() fail because fw not dl!\n",
|
||||
__FUNCTION__);
|
||||
/* fall through */
|
||||
fallthrough;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
@@ -5243,7 +5272,7 @@ static enum halmac_gpio_func _gpio_to_func_for_rfe_ctrl(u8 gpio)
|
||||
enum halmac_gpio_func f = HALMAC_GPIO_FUNC_UNDEFINE;
|
||||
|
||||
|
||||
#ifdef CONFIG_RTL8822C
|
||||
#if defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8822E)
|
||||
switch (gpio) {
|
||||
case 1:
|
||||
f = HALMAC_GPIO_FUNC_ANTSWB;
|
||||
@@ -5264,7 +5293,7 @@ static enum halmac_gpio_func _gpio_to_func_for_rfe_ctrl(u8 gpio)
|
||||
f = HALMAC_GPIO_FUNC_ANTSW;
|
||||
break;
|
||||
}
|
||||
#endif /* CONFIG_RTL8822C */
|
||||
#endif /* CONFIG_RTL8822C || CONFIG_RTL8822E */
|
||||
|
||||
return f;
|
||||
}
|
||||
@@ -5320,8 +5349,7 @@ static int _halmac_scanoffload(struct dvobj_priv *d, u32 enable, u8 nlo,
|
||||
u32 len = 0;
|
||||
int i = 0;
|
||||
struct pno_ssid pnossid;
|
||||
struct rf_ctl_t *rfctl = NULL;
|
||||
struct _RT_CHANNEL_INFO *ch_set;
|
||||
struct rtw_chset *chset;
|
||||
|
||||
|
||||
tbl = d->hmpriv.indicator;
|
||||
@@ -5333,8 +5361,7 @@ static int _halmac_scanoffload(struct dvobj_priv *d, u32 enable, u8 nlo,
|
||||
id_update = HALMAC_FEATURE_UPDATE_PACKET;
|
||||
id_ch_sw = HALMAC_FEATURE_CHANNEL_SWITCH;
|
||||
pmlmeext = &(adapter->mlmeextpriv);
|
||||
rfctl = adapter_to_rfctl(adapter);
|
||||
ch_set = rfctl->channel_set;
|
||||
chset = adapter_to_chset(adapter);
|
||||
|
||||
RTW_INFO("%s: %s scanoffload, mode: %s\n",
|
||||
__FUNCTION__, enable?"Enable":"Disable",
|
||||
@@ -5382,10 +5409,12 @@ static int _halmac_scanoffload(struct dvobj_priv *d, u32 enable, u8 nlo,
|
||||
|
||||
api->halmac_clear_ch_info(mac);
|
||||
|
||||
for (i = 0; i < rfctl->max_chan_nums && ch_set[i].ChannelNum != 0; i++) {
|
||||
for (i = 0; i < chset->chs_len; i++) {
|
||||
if (chset->chs[i].flags & RTW_CHF_DIS)
|
||||
continue;
|
||||
_rtw_memset(&ch_info, 0, sizeof(ch_info));
|
||||
ch_info.extra_info = 0;
|
||||
ch_info.channel = ch_set[i].ChannelNum;
|
||||
ch_info.channel = chset->chs[i].ChannelNum;
|
||||
ch_info.bw = HALMAC_BW_20;
|
||||
ch_info.pri_ch_idx = HALMAC_CH_IDX_1;
|
||||
ch_info.action_id = HALMAC_CS_ACTIVE_SCAN;
|
||||
@@ -5950,3 +5979,39 @@ int rtw_halmac_bf_cfg_mu_mimo(struct dvobj_priv *d, enum halmac_snd_role role,
|
||||
|
||||
#endif /* RTW_BEAMFORMING_VERSION_2 */
|
||||
#endif /* CONFIG_BEAMFORMING */
|
||||
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
#ifdef RTW_HALMAC
|
||||
int rtw_halmac_set_gpio(struct dvobj_priv *d, u8 gpio_id, u8 gpio_enable, u8 gpio_func_offset, u8 gpio_mode)
|
||||
{
|
||||
struct halmac_adapter *halmac;
|
||||
struct halmac_api *api;
|
||||
enum halmac_ret_status status;
|
||||
|
||||
halmac = dvobj_to_halmac(d);
|
||||
api = HALMAC_GET_API(halmac);
|
||||
|
||||
status = api->halmac_pinmux_free_func(halmac, gpio_id + gpio_func_offset);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
status = api->halmac_pinmux_set_func(halmac, gpio_id + gpio_func_offset);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
status = api->halmac_pinmux_gpio_mode(halmac, gpio_id, gpio_mode);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
status = api->halmac_pinmux_gpio_output(halmac, gpio_id, gpio_enable);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -37,6 +37,7 @@ const u32 _chip_type_to_odm_ic_type[] = {
|
||||
ODM_RTL8822C,
|
||||
ODM_RTL8814B,
|
||||
ODM_RTL8723F,
|
||||
ODM_RTL8822E,
|
||||
0,
|
||||
};
|
||||
|
||||
@@ -133,6 +134,11 @@ void rtw_hal_def_value_init(_adapter *padapter)
|
||||
|
||||
GET_HAL_DATA(padapter)->rx_tsf_addr_filter_config = 0;
|
||||
}
|
||||
#ifdef CONFIG_NARROWBAND_SUPPORTING
|
||||
if ((padapter->registrypriv.rtw_nb_config == RTW_NB_CONFIG_WIDTH_10)
|
||||
|| (padapter->registrypriv.rtw_nb_config == RTW_NB_CONFIG_WIDTH_5))
|
||||
GET_HAL_DATA(padapter)->dis_turboedca = 1;
|
||||
#endif /* CONFIG_NARROWBAND_SUPPORTING */
|
||||
}
|
||||
|
||||
u8 rtw_hal_data_init(_adapter *padapter)
|
||||
@@ -144,6 +150,13 @@ u8 rtw_hal_data_init(_adapter *padapter)
|
||||
RTW_INFO("cant not alloc memory for HAL DATA\n");
|
||||
return _FAIL;
|
||||
}
|
||||
GET_HAL_DATA(padapter)->adapter = padapter;
|
||||
#ifdef CONFIG_TX_PAUSE_FW_CTRL
|
||||
_rtw_spinlock_init(&((HAL_DATA_TYPE*)padapter->HalData)->tx_pause_sctx_lock);
|
||||
#endif
|
||||
#if CONFIG_TXPWR_LIMIT
|
||||
hal_txpwr_lmt_tb_init(padapter->HalData);
|
||||
#endif
|
||||
rtw_phydm_priv_init(padapter);
|
||||
}
|
||||
return _SUCCESS;
|
||||
@@ -153,8 +166,14 @@ void rtw_hal_data_deinit(_adapter *padapter)
|
||||
{
|
||||
if (is_primary_adapter(padapter)) {
|
||||
if (padapter->HalData) {
|
||||
#if CONFIG_TXPWR_LIMIT
|
||||
hal_txpwr_lmt_tb_deinit(padapter->HalData);
|
||||
#endif
|
||||
#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE
|
||||
phy_free_filebuf(padapter);
|
||||
#endif
|
||||
#ifdef CONFIG_TX_PAUSE_FW_CTRL
|
||||
_rtw_spinlock_free(&((HAL_DATA_TYPE*)padapter->HalData)->tx_pause_sctx_lock);
|
||||
#endif
|
||||
rtw_vmfree(padapter->HalData, padapter->hal_data_sz);
|
||||
padapter->HalData = NULL;
|
||||
@@ -275,9 +294,11 @@ void _dump_rf_path(void *sel, _adapter *adapter)
|
||||
PHAL_DATA_TYPE hal_data = GET_HAL_DATA(adapter);
|
||||
struct hal_spec_t *hal_spec = GET_HAL_SPEC(adapter);
|
||||
struct registry_priv *regsty = adapter_to_regsty(adapter);
|
||||
u8 rf_type = 0;
|
||||
|
||||
RTW_PRINT_SEL(sel, "[RF_PATH] ver_id.RF_TYPE:%s\n"
|
||||
, rf_type_to_rfpath_str(rtw_chip_rftype_to_hal_rftype(adapter, 0)));
|
||||
rf_type = rtw_chip_rftype_to_hal_rftype(adapter, 0);
|
||||
RTW_PRINT_SEL(sel, "[RF_PATH] ver_id.RF_TYPE:%s\n",
|
||||
rf_type_to_rfpath_str(rf_type));
|
||||
RTW_PRINT_SEL(sel, "[RF_PATH] HALSPEC's rf_reg_trx_path_bmp:0x%02x, rf_reg_path_avail_num:%u, max_tx_cnt:%u\n"
|
||||
, hal_spec->rf_reg_trx_path_bmp, hal_spec->rf_reg_path_avail_num, hal_spec->max_tx_cnt);
|
||||
RTW_PRINT_SEL(sel, "[RF_PATH] PG's trx_path_bmp:0x%02x, max_tx_cnt:%u\n"
|
||||
@@ -407,7 +428,7 @@ u8 rtw_hal_trxnss_init(_adapter *adapter)
|
||||
/* these IC is capable of full-TX when macro defined */
|
||||
|| IS_HARDWARE_TYPE_8192E(adapter) || IS_HARDWARE_TYPE_8192F(adapter)
|
||||
|| IS_HARDWARE_TYPE_8812(adapter) || IS_HARDWARE_TYPE_8822B(adapter)
|
||||
|| IS_HARDWARE_TYPE_8822C(adapter)
|
||||
|| IS_HARDWARE_TYPE_8822C(adapter) || IS_HARDWARE_TYPE_8822E(adapter)
|
||||
#endif
|
||||
)
|
||||
hal_data->txpath_cap_num_nss[i] = hal_data->max_tx_cnt;
|
||||
@@ -591,6 +612,13 @@ uint rtw_hal_init(_adapter *padapter)
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
|
||||
int i;
|
||||
|
||||
#ifdef CONFIG_HAL_PREINIT
|
||||
if (rtw_get_hal_pre_inited(padapter) == _TRUE) {
|
||||
rtw_set_hal_pre_inited(padapter, _FALSE);
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
halrf_set_rfsupportability(adapter_to_phydm(padapter));
|
||||
|
||||
status = padapter->hal_func.hal_init(padapter);
|
||||
@@ -665,6 +693,12 @@ uint rtw_hal_deinit(_adapter *padapter)
|
||||
if (status == _SUCCESS) {
|
||||
rtw_led_control(padapter, LED_CTL_POWER_OFF);
|
||||
rtw_set_hw_init_completed(padapter, _FALSE);
|
||||
#ifdef CONFIG_HAL_PREINIT
|
||||
if (rtw_get_hal_pre_inited(padapter) == _TRUE) {
|
||||
RTW_INFO("rtw_hal_deinit with hal_pre_inited\n");
|
||||
rtw_set_hal_pre_inited(padapter, _FALSE);
|
||||
}
|
||||
#endif
|
||||
} else
|
||||
RTW_INFO("\n rtw_hal_deinit: hal_init fail\n");
|
||||
|
||||
@@ -672,6 +706,11 @@ uint rtw_hal_deinit(_adapter *padapter)
|
||||
return status;
|
||||
}
|
||||
|
||||
bool rtw_hw_is_init_completed(struct dvobj_priv *dvobj)
|
||||
{
|
||||
return rtw_get_hw_init_completed(dvobj_get_primary_adapter(dvobj));
|
||||
}
|
||||
|
||||
u8 rtw_hal_set_hwreg(_adapter *padapter, u8 variable, u8 *val)
|
||||
{
|
||||
return padapter->hal_func.set_hw_reg_handler(padapter, variable, val);
|
||||
@@ -1084,13 +1123,25 @@ void rtw_hal_interrupt_handler(_adapter *padapter, u16 pkt_len, u8 *pbuf)
|
||||
}
|
||||
#endif
|
||||
|
||||
void rtw_hal_set_chnl_bw(_adapter *padapter, u8 channel, enum channel_width Bandwidth, u8 Offset40, u8 Offset80)
|
||||
void rtw_hal_set_chnl_bw(_adapter *padapter, u8 cch, enum channel_width Bandwidth, u8 Offset40, u8 Offset80)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
|
||||
/*u8 cch_160 = Bandwidth == CHANNEL_WIDTH_160 ? channel : 0;*/
|
||||
u8 cch_80 = Bandwidth == CHANNEL_WIDTH_80 ? channel : 0;
|
||||
u8 cch_40 = Bandwidth == CHANNEL_WIDTH_40 ? channel : 0;
|
||||
u8 cch_20 = Bandwidth == CHANNEL_WIDTH_20 ? channel : 0;
|
||||
/*u8 cch_160 = Bandwidth == CHANNEL_WIDTH_160 ? cch : 0;*/
|
||||
u8 cch_80 = Bandwidth == CHANNEL_WIDTH_80 ? cch : 0;
|
||||
u8 cch_40 = Bandwidth == CHANNEL_WIDTH_40 ? cch : 0;
|
||||
u8 cch_20 = Bandwidth == CHANNEL_WIDTH_20 ? cch : 0;
|
||||
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
struct dfs_rd_ch_switch_ctx dfs_rd_cs_ctx;
|
||||
u8 band_idx = HW_BAND_0;
|
||||
enum band_type band;
|
||||
u8 ch, bw, offset;
|
||||
|
||||
rtw_get_oper_bchbw_by_hwband(adapter_to_dvobj(padapter), band_idx, &band, &ch, &bw, &offset);
|
||||
|
||||
hal_dfs_rd_setting_before_ch_switch(pHalData, band_idx
|
||||
, band, ch, bw, offset, &dfs_rd_cs_ctx);
|
||||
#endif
|
||||
|
||||
if (rtw_phydm_is_iqk_in_progress(padapter))
|
||||
RTW_ERR("%s, %d, IQK may race condition\n", __func__, __LINE__);
|
||||
@@ -1116,16 +1167,24 @@ void rtw_hal_set_chnl_bw(_adapter *padapter, u8 channel, enum channel_width Band
|
||||
|
||||
if (0)
|
||||
RTW_INFO("%s cch:%u, %s, offset40:%u, offset80:%u (%u, %u, %u)\n", __func__
|
||||
, channel, ch_width_str(Bandwidth), Offset40, Offset80
|
||||
, cch, ch_width_str(Bandwidth), Offset40, Offset80
|
||||
, pHalData->cch_80, pHalData->cch_40, pHalData->cch_20);
|
||||
|
||||
padapter->hal_func.set_chnl_bw_handler(padapter, channel, Bandwidth, Offset40, Offset80);
|
||||
padapter->hal_func.set_chnl_bw_handler(padapter, cch, Bandwidth, Offset40, Offset80);
|
||||
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
hal_dfs_rd_setting_after_ch_switch(pHalData, band_idx
|
||||
, band, ch, bw, offset, &dfs_rd_cs_ctx);
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtw_hal_dm_watchdog(_adapter *padapter)
|
||||
{
|
||||
|
||||
rtw_hal_turbo_edca(padapter);
|
||||
#ifndef CONFIG_DIRECT_EDCCA_MODE_SETTING
|
||||
rtw_edcca_hal_update(adapter_to_dvobj(padapter));
|
||||
#endif
|
||||
padapter->hal_func.hal_dm_watchdog(padapter);
|
||||
}
|
||||
|
||||
@@ -1296,6 +1355,9 @@ s32 c2h_handler(_adapter *adapter, u8 id, u8 seq, u8 plen, u8 *payload)
|
||||
case C2H_BT_INFO:
|
||||
rtw_btcoex_BtInfoNotify(adapter, plen, payload);
|
||||
break;
|
||||
case C2H_BT_LE_AUDIO_INFO:
|
||||
rtw_btcoex_le_audio_info_notify(adapter, plen, payload);
|
||||
break;
|
||||
case C2H_BT_MP_INFO:
|
||||
#if defined(CONFIG_MP_INCLUDED) && defined(CONFIG_RTL8723B)
|
||||
MPTBT_FwC2hBtMpCtrl(adapter, payload, plen);
|
||||
@@ -1326,6 +1388,12 @@ s32 c2h_handler(_adapter *adapter, u8 id, u8 seq, u8 plen, u8 *payload)
|
||||
rtw_hal_bcn_early_rpt_c2h_handler(adapter);
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_TX_PAUSE_FW_CTRL
|
||||
case C2H_TX_PAUSE_RPT:
|
||||
c2h_tx_pause_rpt_hdl(adapter, payload, plen);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MCC_MODE
|
||||
case C2H_MCC:
|
||||
rtw_hal_mcc_c2h_handler(adapter, plen, payload);
|
||||
@@ -1372,7 +1440,6 @@ s32 c2h_handler(_adapter *adapter, u8 id, u8 seq, u8 plen, u8 *payload)
|
||||
sub_id = payload[0];
|
||||
/* no handle, goto default */
|
||||
fallthrough;
|
||||
/* fall through */
|
||||
|
||||
default:
|
||||
if (phydm_c2H_content_parsing(adapter_to_phydm(adapter), id, plen, payload) != TRUE)
|
||||
@@ -1411,6 +1478,7 @@ s32 rtw_hal_c2h_id_handle_directly(_adapter *adapter, u8 id, u8 seq, u8 plen, u8
|
||||
case C2H_IQK_FINISH:
|
||||
case C2H_MCC:
|
||||
case C2H_BCN_EARLY_RPT:
|
||||
case C2H_TX_PAUSE_RPT:
|
||||
case C2H_AP_REQ_TXRPT:
|
||||
case C2H_SPC_STAT:
|
||||
case C2H_SET_TXPWR_FINISH:
|
||||
@@ -1942,6 +2010,13 @@ void rtw_hal_fw_correct_bcn(_adapter *padapter)
|
||||
}
|
||||
#endif
|
||||
|
||||
bool rtw_txpwr_hal_get_pwr_lmt_en(struct dvobj_priv *dvobj)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(dvobj_get_primary_adapter(dvobj));
|
||||
|
||||
return hal_data->txpwr_limit_loaded;
|
||||
}
|
||||
|
||||
void rtw_hal_set_tx_power_level(_adapter *adapter, u8 channel)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
@@ -1957,36 +2032,6 @@ void rtw_hal_set_tx_power_level(_adapter *adapter, u8 channel)
|
||||
hal_data->set_entire_txpwr = 0;
|
||||
}
|
||||
|
||||
void rtw_hal_update_txpwr_level(_adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
#ifdef CONFIG_ACTIVE_TPC_REPORT
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
int i;
|
||||
#endif
|
||||
|
||||
rtw_hal_set_tx_power_level(adapter, hal_data->current_channel);
|
||||
rtw_rfctl_update_op_mode(adapter_to_rfctl(adapter), 0, 0);
|
||||
|
||||
#ifdef CONFIG_ACTIVE_TPC_REPORT
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
struct mlme_priv *mlme;
|
||||
|
||||
if (!dvobj->padapters[i])
|
||||
continue;
|
||||
if (!CHK_MLME_STATE(dvobj->padapters[i], WIFI_AP_STATE | WIFI_MESH_STATE)
|
||||
|| !MLME_IS_ASOC(dvobj->padapters[i]) || MLME_IS_OPCH_SW(dvobj->padapters[i]))
|
||||
continue;
|
||||
if (dvobj->padapters[i]->mlmeextpriv.bstart_bss != _TRUE)
|
||||
continue;
|
||||
|
||||
mlme = &(dvobj->padapters[i]->mlmepriv);
|
||||
if (MLME_ACTIVE_TPC_REPORT(mlme))
|
||||
update_beacon(dvobj->padapters[i], WLAN_EID_TPC_REPORT, NULL, 1, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtw_hal_set_txpwr_done(_adapter *adapter)
|
||||
{
|
||||
if (adapter->hal_func.set_txpwr_done)
|
||||
@@ -2020,6 +2065,68 @@ s8 rtw_hal_get_txpwr_target_extra_bias(_adapter *adapter, enum rf_path rfpath
|
||||
return val;
|
||||
}
|
||||
|
||||
int rtw_hal_tx_pause(_adapter *adapter, enum tx_pause_rson rson, bool tx_pause)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
u8 *tx_off;
|
||||
enum tx_pause_rson i;
|
||||
u8 tx_cfg = 0, val;
|
||||
int ret = _FAIL;
|
||||
|
||||
tx_off = &hal_data->tx_pause[rson];
|
||||
if (tx_pause == true) {
|
||||
switch (rson) {
|
||||
case PAUSE_RSON_DFS_CAC:
|
||||
case PAUSE_RSON_TOKEN_BASED_XMIT:
|
||||
*tx_off = (u8)StopAll;
|
||||
break;
|
||||
case PAUSE_RSON_DFS_CSA:
|
||||
*tx_off = (u8)~StopBecon;
|
||||
break;
|
||||
case PAUSE_RSON_DFS_CSA_MG:
|
||||
*tx_off = (u8)~(StopBecon | StopMgt);
|
||||
break;
|
||||
case PAUSE_RSON_SCAN:
|
||||
case PAUSE_RSON_JOIN:
|
||||
case PAUSE_RSON_CORRECT_TSF:
|
||||
case PAUSE_RSON_OTHER_BCN_CTRL:
|
||||
*tx_off = (u8)StopBecon;
|
||||
break;
|
||||
default:
|
||||
RTW_ERR("Unknow pause reason:%d\n", rson);
|
||||
goto _error;
|
||||
}
|
||||
} else {
|
||||
*tx_off = 0;
|
||||
}
|
||||
*tx_off &= StopAll;
|
||||
if (((*tx_off) & (StopBecon | StopHigh | StopMgt)) == (StopBecon | StopHigh | StopMgt))
|
||||
*tx_off |= StopBcnHiMgt;
|
||||
|
||||
tx_off = hal_data->tx_pause;
|
||||
for (i = 0; (i < PAUSE_RSON_MAX) && (tx_cfg != StopAll); i++)
|
||||
if (tx_off[i])
|
||||
tx_cfg |= tx_off[i];
|
||||
|
||||
RTW_DBG("TX %sPause - Reason(%d) final tx_cfg(0x%02x)\n",
|
||||
tx_pause?"":"Un-", rson, tx_cfg);
|
||||
|
||||
#ifdef CONFIG_TX_PAUSE_FW_CTRL
|
||||
if (GET_HAL_SPEC(adapter)->txpause_cap & TXPAUSE_CAP_FW_CTRL)
|
||||
ret = rtw_hal_h2c_tx_pause_ctrl(adapter, tx_cfg);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
rtw_hal_get_hwreg(adapter, HW_VAR_TXPAUSE, &val);
|
||||
ret = _SUCCESS;
|
||||
if (val != tx_cfg)
|
||||
ret = rtw_hal_set_hwreg(adapter, HW_VAR_TXPAUSE, &tx_cfg);
|
||||
}
|
||||
|
||||
_error:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef RTW_HALMAC
|
||||
/*
|
||||
* Description:
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
#define TU 1024 /* 1 TU equals 1024 microseconds */
|
||||
/* druration, TSF sync offset, start time offset, interval (unit:TU (1024 microseconds))*/
|
||||
u8 mcc_switch_channel_policy_table[][7]={
|
||||
{20, 50, 40, 100, 0, 0, 30},
|
||||
{80, 50, 10, 100, 0, 0, 30},
|
||||
{36, 50, 32, 100, 0, 0, 30},
|
||||
{30, 50, 35, 100, 0, 0, 30},
|
||||
{20, 50, 40, 100, 2, 1, 30},
|
||||
{80, 50, 10, 100, 2, 1, 30},
|
||||
{36, 50, 32, 100, 2, 1, 30},
|
||||
{30, 50, 35, 100, 2, 1, 30},
|
||||
};
|
||||
|
||||
const int mcc_max_policy_num = sizeof(mcc_switch_channel_policy_table) /sizeof(u8) /7;
|
||||
@@ -500,7 +500,6 @@ static void mcc_cfg_phdym_offload(_adapter *adapter, u8 enable)
|
||||
struct sta_priv *stapriv = NULL;
|
||||
struct sta_info *sta = NULL;
|
||||
struct wlan_network *cur_network = NULL;
|
||||
_irqL irqL;
|
||||
_list *head = NULL, *list = NULL;
|
||||
u8 i = 0;
|
||||
|
||||
@@ -527,7 +526,7 @@ static void mcc_cfg_phdym_offload(_adapter *adapter, u8 enable)
|
||||
break;
|
||||
case MCC_ROLE_AP:
|
||||
case MCC_ROLE_GO:
|
||||
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(stapriv);
|
||||
|
||||
head = &stapriv->asoc_list;
|
||||
list = get_next(head);
|
||||
@@ -538,7 +537,7 @@ static void mcc_cfg_phdym_offload(_adapter *adapter, u8 enable)
|
||||
mcc_cfg_phdym_update_macid(iface, _TRUE, sta->cmn.mac_id);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&stapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(stapriv);
|
||||
break;
|
||||
default:
|
||||
RTW_INFO("Unknown role\n");
|
||||
@@ -595,7 +594,6 @@ static void rtw_hal_config_mcc_role_setting(PADAPTER padapter, u8 order)
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta = NULL;
|
||||
struct registry_priv *preg = &padapter->registrypriv;
|
||||
_irqL irqL;
|
||||
_list *phead =NULL, *plist = NULL;
|
||||
u8 policy_index = 0;
|
||||
u8 mcc_duration = 0;
|
||||
@@ -670,7 +668,7 @@ static void rtw_hal_config_mcc_role_setting(PADAPTER padapter, u8 order)
|
||||
|
||||
rtw_hal_mcc_assign_tx_threshold(padapter);
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_lock(pstapriv);
|
||||
|
||||
phead = &pstapriv->asoc_list;
|
||||
plist = get_next(phead);
|
||||
@@ -685,7 +683,7 @@ static void rtw_hal_config_mcc_role_setting(PADAPTER padapter, u8 order)
|
||||
#endif
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
rtw_stapriv_asoc_list_unlock(pstapriv);
|
||||
|
||||
psta = rtw_get_bcmc_stainfo(padapter);
|
||||
|
||||
@@ -1273,9 +1271,13 @@ u8 rtw_hal_dl_mcc_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 *index,
|
||||
struct hal_com_data *hal = GET_HAL_DATA(adapter);
|
||||
struct hal_spec_t *hal_spec = GET_HAL_SPEC(adapter);
|
||||
struct mcc_adapter_priv *mccadapriv = NULL;
|
||||
#if defined(CONFIG_RTL8822C)
|
||||
#if defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8822E)
|
||||
struct dm_struct *phydm = adapter_to_phydm(adapter);
|
||||
#if defined(CONFIG_RTL8822C)
|
||||
struct txagc_table_8822c tab;
|
||||
#elif defined(CONFIG_RTL8822E)
|
||||
struct txagc_table_8822e tab;
|
||||
#endif
|
||||
u8 agc_buff[2][NUM_RATE_AC_2SS]; /* tatol 0x40 rate index for PATH A/B */
|
||||
#endif
|
||||
|
||||
@@ -1288,7 +1290,7 @@ u8 rtw_hal_dl_mcc_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 *index,
|
||||
if (!hal->RegIQKFWOffload)
|
||||
RTW_WARN("[MCC] must enable FW IQK for New IC\n");
|
||||
#endif /* CONFIG_MCC_MODE_V2 */
|
||||
*total_page_num += (2 * MAX_MCC_NUM+ 1);
|
||||
*total_page_num += (2 * MAX_MCC_NUM + 1);
|
||||
RTW_INFO("[MCC] allocate mcc rsvd page num = %d\n", *total_page_num);
|
||||
goto exit;
|
||||
}
|
||||
@@ -1327,7 +1329,7 @@ u8 rtw_hal_dl_mcc_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 *index,
|
||||
CurtPktPageNum = (u8)PageNum(tx_desc + len, page_size);
|
||||
*total_page_num += CurtPktPageNum;
|
||||
*index += (CurtPktPageNum * page_size);
|
||||
RSVD_PAGE_CFG("LocNull", CurtPktPageNum, *total_page_num, *index);
|
||||
RSVD_PAGE_CFG("LocNull", CurtPktPageNum, *total_page_num);
|
||||
break;
|
||||
case MCC_ROLE_AP:
|
||||
/* Bulid CTS */
|
||||
@@ -1342,7 +1344,7 @@ u8 rtw_hal_dl_mcc_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 *index,
|
||||
CurtPktPageNum = (u8)PageNum(tx_desc + len, page_size);
|
||||
*total_page_num += CurtPktPageNum;
|
||||
*index += (CurtPktPageNum * page_size);
|
||||
RSVD_PAGE_CFG("LocCTS", CurtPktPageNum, *total_page_num, *index);
|
||||
RSVD_PAGE_CFG("LocCTS", CurtPktPageNum, *total_page_num);
|
||||
break;
|
||||
case MCC_ROLE_GO:
|
||||
/* To DO */
|
||||
@@ -1383,7 +1385,7 @@ u8 rtw_hal_dl_mcc_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 *index,
|
||||
i, pmccobjpriv->mcc_pwr_idx_rsvd_page[i]);
|
||||
|
||||
total_rate_offset = start;
|
||||
#if !defined(CONFIG_RTL8822C)
|
||||
#if !defined(CONFIG_RTL8822C) && !defined(CONFIG_RTL8822E)
|
||||
for (path = RF_PATH_A; path < hal_spec->rf_reg_path_num; ++path) {
|
||||
total_rate = 0;
|
||||
/* PATH A for 0~63 byte, PATH B for 64~127 byte*/
|
||||
@@ -1644,7 +1646,7 @@ u8 rtw_hal_dl_mcc_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 *index,
|
||||
CurtPktPageNum = 1;
|
||||
*total_page_num += CurtPktPageNum;
|
||||
*index += (CurtPktPageNum * page_size);
|
||||
RSVD_PAGE_CFG("mcc_pwr_idx_rsvd_page", CurtPktPageNum, *total_page_num, *index);
|
||||
RSVD_PAGE_CFG("mcc_pwr_idx_rsvd_page", CurtPktPageNum, *total_page_num);
|
||||
#else /* 8822C */
|
||||
for (path = RF_PATH_A; path < hal_spec->rf_reg_path_num; ++path) {
|
||||
/* CCK */
|
||||
@@ -1699,7 +1701,11 @@ u8 rtw_hal_dl_mcc_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 *index,
|
||||
agc_buff[path][rate] = power_index;
|
||||
}
|
||||
}
|
||||
#if defined(CONFIG_RTL8822C)
|
||||
phydm_get_txagc_ref_and_diff_8822c(phydm, agc_buff, NUM_RATE_AC_2SS, &tab);
|
||||
#elif defined(CONFIG_RTL8822E)
|
||||
phydm_get_txagc_ref_and_diff_8822e(phydm, agc_buff, NUM_RATE_AC_2SS, &tab);
|
||||
#endif
|
||||
*start = tab.ref_pow_cck[0];
|
||||
start++;
|
||||
*start = tab.ref_pow_cck[1];
|
||||
@@ -1712,7 +1718,7 @@ u8 rtw_hal_dl_mcc_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 *index,
|
||||
CurtPktPageNum = 1;
|
||||
*total_page_num += CurtPktPageNum;
|
||||
*index += (CurtPktPageNum * page_size);
|
||||
RSVD_PAGE_CFG("mcc_pwr_idx_rsvd_page", CurtPktPageNum, *total_page_num, *index);
|
||||
RSVD_PAGE_CFG("mcc_pwr_idx_rsvd_page", CurtPktPageNum, *total_page_num);
|
||||
#ifdef DBG_PWR_IDX_RSVD_PAGE
|
||||
if (1) {
|
||||
u8 path_idx;
|
||||
@@ -2311,14 +2317,22 @@ static void rtw_hal_mcc_start_prehdl(PADAPTER padapter)
|
||||
mccadapriv->role = MCC_ROLE_MAX;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RTL8822C
|
||||
if (IS_HARDWARE_TYPE_8822C(padapter)) {
|
||||
#if defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822C(padapter) ||
|
||||
IS_HARDWARE_TYPE_8822E(padapter)) {
|
||||
HAL_DATA_TYPE *hal = GET_HAL_DATA(padapter);
|
||||
struct dm_struct *dm = &hal->odmpriv;
|
||||
|
||||
odm_cmn_info_update(dm, ODM_CMNINFO_IS_DOWNLOAD_FW, hal->bFWReady);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8822E
|
||||
#ifdef CONFIG_TX_DUTY
|
||||
if (IS_HARDWARE_TYPE_8822E(padapter)) {
|
||||
rtw_hal_pause_tx_duty(padapter, _TRUE);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static u8 rtw_hal_set_mcc_start_setting(PADAPTER padapter, u8 status)
|
||||
@@ -2442,6 +2456,11 @@ static void rtw_hal_mcc_stop_posthdl(PADAPTER padapter)
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
|
||||
struct mcc_obj_priv *mccobjpriv = &(adapter_to_dvobj(padapter)->mcc_objpriv);
|
||||
struct mcc_adapter_priv *mccadapriv = NULL;
|
||||
#ifdef CONFIG_RTL8822E
|
||||
#ifdef CONFIG_TX_DUTY
|
||||
struct wifidirect_info *pwdinfo = &(padapter->wdinfo);
|
||||
#endif
|
||||
#endif
|
||||
_adapter *iface = NULL;
|
||||
PHAL_DATA_TYPE hal;
|
||||
u8 i = 0;
|
||||
@@ -2485,14 +2504,23 @@ static void rtw_hal_mcc_stop_posthdl(PADAPTER padapter)
|
||||
rtw_hal_mcc_cfg_phydm(padapter, MCC_CFG_PHYDM_STOP, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822C
|
||||
if (IS_HARDWARE_TYPE_8822C(padapter)) {
|
||||
#if defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8822E)
|
||||
if (IS_HARDWARE_TYPE_8822C(padapter) ||
|
||||
IS_HARDWARE_TYPE_8822E(padapter)) {
|
||||
HAL_DATA_TYPE *hal = GET_HAL_DATA(padapter);
|
||||
struct dm_struct *dm = &hal->odmpriv;
|
||||
|
||||
odm_cmn_info_update(dm, ODM_CMNINFO_IS_DOWNLOAD_FW, _FALSE);
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8822E
|
||||
#ifdef CONFIG_TX_DUTY
|
||||
if (IS_HARDWARE_TYPE_8822E(padapter)) {
|
||||
if (pwdinfo->p2p_ps_state == P2P_PS_DISABLE)
|
||||
rtw_hal_pause_tx_duty(padapter, _FALSE);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void rtw_hal_mcc_start_posthdl(PADAPTER padapter)
|
||||
@@ -2764,7 +2792,7 @@ static u8 mcc_get_reg_hdl(PADAPTER adapter, const u8 *val)
|
||||
_adapter *cur_iface = NULL;
|
||||
u8 ret = _SUCCESS;
|
||||
u8 cur_order = 0;
|
||||
#ifdef CONFIG_RTL8822C
|
||||
#if defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8822E)
|
||||
u16 dbg_reg[DBG_MCC_REG_NUM] = {0x4d4,0x522,0x1d70};
|
||||
#else
|
||||
u16 dbg_reg[DBG_MCC_REG_NUM] = {0x4d4,0x522,0xc50,0xe50};
|
||||
@@ -2966,8 +2994,14 @@ void rtw_hal_mcc_c2h_handler(PADAPTER padapter, u8 buflen, u8 *tmpBuf)
|
||||
case MCC_RPT_SWICH_CHANNEL_NOTIFY:
|
||||
rtw_hal_mcc_sw_ch_fw_notify_hdl(padapter);
|
||||
break;
|
||||
case MCC_RPT_TBTT:
|
||||
if (pmccobjpriv->tsf_sync_done == _TRUE) {
|
||||
rtw_hal_mcc_update_noa_start_time_hdl(padapter, buflen, tmpBuf);
|
||||
pmccobjpriv->tsf_sync_done = _FALSE;
|
||||
}
|
||||
break;
|
||||
case MCC_RPT_UPDATE_NOA_START_TIME:
|
||||
rtw_hal_mcc_update_noa_start_time_hdl(padapter, buflen, tmpBuf);
|
||||
pmccobjpriv->tsf_sync_done = _TRUE;
|
||||
break;
|
||||
case MCC_RPT_TSF:
|
||||
_enter_critical_bh(&pmccobjpriv->mcc_lock, &irqL);
|
||||
@@ -3396,7 +3430,7 @@ u8 rtw_hal_set_mcc_setting_scan_complete(PADAPTER padapter)
|
||||
*/
|
||||
u8 rtw_hal_set_mcc_setting_start_bss_network(PADAPTER padapter, u8 chbw_allow)
|
||||
{
|
||||
u8 ret = _FAIL;
|
||||
u8 ret = NO_NEED_MCC;
|
||||
|
||||
if (MCC_EN(padapter)) {
|
||||
/* channel bw offset can not be allowed, start MCC */
|
||||
|
||||
@@ -153,8 +153,9 @@ void hal_mpt_CCKTxPowerAdjust(PADAPTER Adapter, BOOLEAN bInCH14)
|
||||
u8 DataRate = 0xFF;
|
||||
|
||||
/* Do not modify CCK TX filter parameters for 8822B*/
|
||||
if(IS_HARDWARE_TYPE_8822B(Adapter) || IS_HARDWARE_TYPE_8821C(Adapter) ||
|
||||
IS_HARDWARE_TYPE_8723D(Adapter) || IS_HARDWARE_TYPE_8192F(Adapter) || IS_HARDWARE_TYPE_8822C(Adapter))
|
||||
if(IS_HARDWARE_TYPE_8822B(Adapter) || IS_HARDWARE_TYPE_8821C(Adapter)
|
||||
|| IS_HARDWARE_TYPE_8723D(Adapter) || IS_HARDWARE_TYPE_8192F(Adapter)
|
||||
|| IS_HARDWARE_TYPE_8822C(Adapter) || IS_HARDWARE_TYPE_8822E(Adapter))
|
||||
return;
|
||||
|
||||
DataRate = mpt_to_mgnt_rate(ulRateIdx);
|
||||
@@ -616,6 +617,19 @@ u32 hal_mpt_tssi_turn_target_power(PADAPTER padapter, s16 power_offset, u8 path)
|
||||
return pout;
|
||||
}
|
||||
|
||||
void hal_mpt_tssi_set_power_offset(PADAPTER padapter, s16 power_offset, u8 path)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct dm_struct *pdm = &pHalData->odmpriv;
|
||||
|
||||
#ifdef CONFIG_RTL8723F
|
||||
halrf_tssi_set_power_offset(pdm, power_offset, path);
|
||||
#endif
|
||||
RTW_INFO("%s()===> path%d = %d\n", __func__, path, power_offset);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#define RF_PATH_AB 22
|
||||
|
||||
#ifdef CONFIG_RTL8814A
|
||||
@@ -880,7 +894,8 @@ void mpt_SetRFPath_8814A(PADAPTER pAdapter)
|
||||
|
||||
#endif /* CONFIG_RTL8814A */
|
||||
#if defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C) \
|
||||
|| defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8814B) || defined(CONFIG_RTL8723F)
|
||||
|| defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8814B) || defined(CONFIG_RTL8723F) \
|
||||
|| defined(CONFIG_RTL8822E)
|
||||
void
|
||||
mpt_SetSingleTone_8814A(
|
||||
PADAPTER pAdapter,
|
||||
@@ -927,7 +942,7 @@ mpt_SetSingleTone_8814A(
|
||||
|
||||
if (bEnPMacTx == FALSE) {
|
||||
hal_mpt_SetContinuousTx(pAdapter, _TRUE);
|
||||
issue_nulldata(pAdapter, NULL, 1, 3, 500);
|
||||
issue_nulldata(pAdapter, NULL, 1, 3, PS_ANNC_DRV_RETRY_INT_MS);
|
||||
}
|
||||
|
||||
phy_set_bb_reg(pAdapter, rCCAonSec_Jaguar, BIT1, 0x1); /*/ Disable CCA*/
|
||||
@@ -1592,6 +1607,12 @@ void hal_mpt_SetAntenna(PADAPTER pAdapter)
|
||||
tx_path_nss_set_full_tx(hal->txpath_nss, hal->txpath_num_nss, bb_tx);
|
||||
RTW_INFO("%s ,ant idx %d, tx path_num_nss = %d\n", __func__, anttx, hal->txpath_num_nss[0]);
|
||||
|
||||
#ifdef CONFIG_RTL8723F
|
||||
if (IS_HARDWARE_TYPE_8723F(pAdapter)) {
|
||||
rtl8723f_mp_config_rfpath(pAdapter);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8822C
|
||||
if (IS_HARDWARE_TYPE_8822C(pAdapter)) {
|
||||
rtl8822c_mp_config_rfpath(pAdapter);
|
||||
@@ -1657,6 +1678,13 @@ void hal_mpt_SetAntenna(PADAPTER pAdapter)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822E
|
||||
if (IS_HARDWARE_TYPE_8822E(pAdapter)) {
|
||||
rtl8822e_mp_config_rfpath(pAdapter);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* else if (IS_HARDWARE_TYPE_8821B(pAdapter))
|
||||
mpt_SetRFPath_8821B(pAdapter);
|
||||
Prepare for 8822B
|
||||
@@ -1710,7 +1738,9 @@ u8 hal_mpt_ReadRFThermalMeter(PADAPTER pAdapter, u8 rf_path)
|
||||
s8 thermal_offset = 0;
|
||||
u32 thermal_reg_mask = 0;
|
||||
|
||||
if (IS_8822C_SERIES(GET_HAL_DATA(pAdapter)->version_id) || IS_8723F_SERIES(GET_HAL_DATA(pAdapter)->version_id))
|
||||
if (IS_8822C_SERIES(GET_HAL_DATA(pAdapter)->version_id)
|
||||
|| IS_8723F_SERIES(GET_HAL_DATA(pAdapter)->version_id)
|
||||
|| IS_8822E_SERIES(GET_HAL_DATA(pAdapter)->version_id))
|
||||
thermal_reg_mask = 0x007e; /*0x42: RF Reg[6:1], 35332(themal K & bias k & power trim) & 35325(tssi )*/
|
||||
else
|
||||
thermal_reg_mask = 0xfc00; /*0x42: RF Reg[15:10]*/
|
||||
@@ -2334,8 +2364,8 @@ static void mpt_StartOfdmContTx(
|
||||
} /* mpt_StartOfdmContTx */
|
||||
|
||||
#if defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8821B) || defined(CONFIG_RTL8822B) \
|
||||
|| defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8814B) \
|
||||
|| defined(CONFIG_RTL8723F)
|
||||
|| defined(CONFIG_RTL8821C) || defined(CONFIG_RTL8822C) || defined(CONFIG_RTL8814B) \
|
||||
|| defined(CONFIG_RTL8723F) || defined(CONFIG_RTL8822E)
|
||||
#ifdef PHYDM_PMAC_TX_SETTING_SUPPORT
|
||||
static void mpt_convert_phydm_txinfo_for_jaguar3(
|
||||
RT_PMAC_TX_INFO *pMacTxInfo, struct phydm_pmac_info *phydmtxinfo)
|
||||
@@ -2405,16 +2435,18 @@ u8 mpt_ProSetPMacTx(PADAPTER Adapter)
|
||||
RTW_INFO("TXSC %d BandWidth %d PacketPeriod %d PacketCount %d PacketLength %d PacketPattern %d\n", PMacTxInfo.TX_SC, PMacTxInfo.BandWidth, PMacTxInfo.PacketPeriod, PMacTxInfo.PacketCount,
|
||||
PMacTxInfo.PacketLength, PMacTxInfo.PacketPattern);
|
||||
|
||||
if (hal_spec->tx_nss_num < 2 && MPT_IS_2SS_RATE(PMacTxInfo.TX_RATE))
|
||||
return _FALSE;
|
||||
if (hal_spec->tx_nss_num < 3 && MPT_IS_3SS_RATE(PMacTxInfo.TX_RATE))
|
||||
return _FALSE;
|
||||
if (hal_spec->tx_nss_num < 4 && MPT_IS_4SS_RATE(PMacTxInfo.TX_RATE))
|
||||
return _FALSE;
|
||||
if (!is_supported_vht(Adapter->registrypriv.wireless_mode) && MPT_IS_VHT_RATE(PMacTxInfo.TX_RATE))
|
||||
return _FALSE;
|
||||
if (!is_supported_ht(Adapter->registrypriv.wireless_mode) && MPT_IS_HT_RATE(PMacTxInfo.TX_RATE))
|
||||
return _FALSE;
|
||||
if (PMacTxInfo.bEnPMacTx == TRUE) {
|
||||
if (hal_spec->tx_nss_num < 2 && MPT_IS_2SS_RATE(PMacTxInfo.TX_RATE))
|
||||
return _FALSE;
|
||||
if (hal_spec->tx_nss_num < 3 && MPT_IS_3SS_RATE(PMacTxInfo.TX_RATE))
|
||||
return _FALSE;
|
||||
if (hal_spec->tx_nss_num < 4 && MPT_IS_4SS_RATE(PMacTxInfo.TX_RATE))
|
||||
return _FALSE;
|
||||
if (!is_supported_vht(Adapter->registrypriv.wireless_mode) && MPT_IS_VHT_RATE(PMacTxInfo.TX_RATE))
|
||||
return _FALSE;
|
||||
if (!is_supported_ht(Adapter->registrypriv.wireless_mode) && MPT_IS_HT_RATE(PMacTxInfo.TX_RATE))
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
if (PMacTxInfo.BandWidth == 1 && hal_chk_bw_cap(Adapter, BW_CAP_40M))
|
||||
PMacTxInfo.BandWidth = CHANNEL_WIDTH_40;
|
||||
@@ -2681,4 +2713,11 @@ void mpt_trigger_tssi_tracking(PADAPTER pAdapter, u8 rf_path)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef RTW_HALMAC
|
||||
int hal_mpt_SetGpio(PADAPTER pAdapter, u8 gpio_id, u8 gpio_enable, u8 gpio_func_offset, u8 gpio_mode)
|
||||
{
|
||||
return rtw_halmac_set_gpio(adapter_to_dvobj(pAdapter), gpio_id, gpio_enable, gpio_func_offset, gpio_mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_MP_INCLUDE*/
|
||||
|
||||
773
drivers/net/wireless/rtl8822cs/hal/hal_pwr_table.c
Normal file
773
drivers/net/wireless/rtl8822cs/hal/hal_pwr_table.c
Normal file
@@ -0,0 +1,773 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define _HAL_PWR_TABLE_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
#if CONFIG_TXPWR_LIMIT
|
||||
const char *const _txpwr_lmt_rs_str[] = {
|
||||
[TXPWR_LMT_RS_CCK] = "CCK",
|
||||
[TXPWR_LMT_RS_OFDM] = "OFDM",
|
||||
[TXPWR_LMT_RS_HT] = "HT",
|
||||
[TXPWR_LMT_RS_VHT] = "VHT",
|
||||
[TXPWR_LMT_RS_NUM] = "UNKNOWN",
|
||||
};
|
||||
|
||||
void hal_txpwr_lmt_reg_exc_add_with_nlen(struct hal_com_data *hal_data, const char *country, u8 domain, const char *reg_name, u32 nlen)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
struct lmt_reg_exc *ent;
|
||||
|
||||
if (!reg_name || !nlen) {
|
||||
rtw_warn_on(1);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ent = rtw_zmalloc(sizeof(struct lmt_reg_exc) + nlen + 1);
|
||||
if (!ent)
|
||||
goto exit;
|
||||
|
||||
_rtw_init_listhead(&ent->list);
|
||||
if (country)
|
||||
_rtw_memcpy(ent->country, country, 2);
|
||||
ent->domain = domain;
|
||||
_rtw_memcpy(ent->reg_name, reg_name, nlen);
|
||||
|
||||
_rtw_mutex_lock_interruptible(&tb->lock);
|
||||
|
||||
rtw_list_insert_tail(&ent->list, &tb->reg_exc_list);
|
||||
tb->reg_exc_num++;
|
||||
|
||||
_rtw_mutex_unlock(&tb->lock);
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
void hal_txpwr_lmt_reg_exc_add(struct hal_com_data *hal_data, const char *country, u8 domain, const char *reg_name)
|
||||
{
|
||||
hal_txpwr_lmt_reg_exc_add_with_nlen(hal_data, country, domain, reg_name, strlen(reg_name));
|
||||
}
|
||||
|
||||
static struct lmt_reg_exc *_hal_txpwr_lmt_reg_exc_search(struct hal_com_data *hal_data, const char *country, u8 domain)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
struct lmt_reg_exc *ent;
|
||||
_list *cur, *head;
|
||||
u8 match = 0;
|
||||
|
||||
head = &tb->reg_exc_list;
|
||||
cur = get_next(head);
|
||||
|
||||
while ((rtw_end_of_queue_search(head, cur)) == _FALSE) {
|
||||
u8 has_country;
|
||||
|
||||
ent = LIST_CONTAINOR(cur, struct lmt_reg_exc, list);
|
||||
cur = get_next(cur);
|
||||
has_country = (ent->country[0] == '\0' && ent->country[1] == '\0') ? 0 : 1;
|
||||
|
||||
/* entry has country condition to match */
|
||||
if (has_country) {
|
||||
if (!country)
|
||||
continue;
|
||||
if (ent->country[0] != country[0]
|
||||
|| ent->country[1] != country[1])
|
||||
continue;
|
||||
}
|
||||
|
||||
/* entry has domain condition to match */
|
||||
if (ent->domain != 0xFF) {
|
||||
if (domain == 0xFF)
|
||||
continue;
|
||||
if (ent->domain != domain)
|
||||
continue;
|
||||
}
|
||||
|
||||
match = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (match)
|
||||
return ent;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct lmt_reg_exc *hal_txpwr_lmt_reg_exc_search(struct hal_com_data *hal_data, const char *country, u8 domain)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
struct lmt_reg_exc *ent;
|
||||
|
||||
_rtw_mutex_lock_interruptible(&tb->lock);
|
||||
ent = _hal_txpwr_lmt_reg_exc_search(hal_data, country, domain);
|
||||
_rtw_mutex_unlock(&tb->lock);
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
void hal_txpwr_lmt_reg_exc_list_free(struct hal_com_data *hal_data)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
struct lmt_reg_exc *ent;
|
||||
_list *cur, *head;
|
||||
|
||||
_rtw_mutex_lock_interruptible(&tb->lock);
|
||||
|
||||
head = &tb->reg_exc_list;
|
||||
cur = get_next(head);
|
||||
|
||||
while ((rtw_end_of_queue_search(head, cur)) == _FALSE) {
|
||||
ent = LIST_CONTAINOR(cur, struct lmt_reg_exc, list);
|
||||
cur = get_next(cur);
|
||||
rtw_list_delete(&ent->list);
|
||||
rtw_mfree((u8 *)ent, sizeof(struct lmt_reg_exc) + strlen(ent->reg_name) + 1);
|
||||
}
|
||||
tb->reg_exc_num = 0;
|
||||
|
||||
_rtw_mutex_unlock(&tb->lock);
|
||||
}
|
||||
|
||||
static void _dump_txpwr_lmt_reg_exc_list(void *sel, struct hal_com_data *hal_data)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
struct lmt_reg_exc *ent;
|
||||
_list *cur, *head;
|
||||
|
||||
RTW_PRINT_SEL(sel, "reg_exc_num:%u\n", tb->reg_exc_num);
|
||||
|
||||
if (!tb->reg_exc_num)
|
||||
goto exit;
|
||||
|
||||
RTW_PRINT_SEL(sel, "%-7s %-6s %-8s\n", "country", "domain", "reg_name");
|
||||
|
||||
head = &tb->reg_exc_list;
|
||||
cur = get_next(head);
|
||||
|
||||
while ((rtw_end_of_queue_search(head, cur)) == _FALSE) {
|
||||
u8 has_country;
|
||||
|
||||
ent = LIST_CONTAINOR(cur, struct lmt_reg_exc, list);
|
||||
cur = get_next(cur);
|
||||
has_country = (ent->country[0] == '\0' && ent->country[1] == '\0') ? 0 : 1;
|
||||
|
||||
RTW_PRINT_SEL(sel, " %c%c 0x%02x %s\n"
|
||||
, has_country ? ent->country[0] : '-'
|
||||
, has_country ? ent->country[1] : '-'
|
||||
, ent->domain
|
||||
, ent->reg_name
|
||||
);
|
||||
}
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
void dump_txpwr_lmt_reg_exc_list(void *sel, struct hal_com_data *hal_data)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
|
||||
_rtw_mutex_lock_interruptible(&tb->lock);
|
||||
_dump_txpwr_lmt_reg_exc_list(sel, hal_data);
|
||||
_rtw_mutex_unlock(&tb->lock);
|
||||
}
|
||||
|
||||
/* search matcing first, if not found, alloc one */
|
||||
void hal_txpwr_lmt_reg_add_with_nlen(struct hal_com_data *hal_data, const char *name, u32 nlen
|
||||
, u8 band, u8 bw, u8 tlrs, u8 ntx_idx, u8 ch_idx, s8 lmt)
|
||||
{
|
||||
struct hal_spec_t *hal_spec = &hal_data->hal_spec;
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
struct lmt_reg *ent;
|
||||
_list *cur, *head;
|
||||
s8 pre_lmt;
|
||||
u8 ch;
|
||||
|
||||
if (!name || !nlen) {
|
||||
rtw_warn_on(1);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
_rtw_mutex_lock_interruptible(&tb->lock);
|
||||
|
||||
/* search for existed entry */
|
||||
head = &tb->reg_list;
|
||||
cur = get_next(head);
|
||||
while ((rtw_end_of_queue_search(head, cur)) == _FALSE) {
|
||||
ent = LIST_CONTAINOR(cur, struct lmt_reg, list);
|
||||
cur = get_next(cur);
|
||||
|
||||
if (strlen(ent->name) == nlen
|
||||
&& _rtw_memcmp(ent->name, name, nlen) == _TRUE)
|
||||
goto chk_lmt_band;
|
||||
}
|
||||
|
||||
/* alloc new one */
|
||||
ent = rtw_zvmalloc(sizeof(struct lmt_reg) + nlen + 1);
|
||||
if (!ent)
|
||||
goto release_lock;
|
||||
|
||||
_rtw_init_listhead(&ent->list);
|
||||
_rtw_memcpy(ent->name, name, nlen);
|
||||
rtw_list_insert_tail(&ent->list, &tb->reg_list);
|
||||
tb->reg_num++;
|
||||
|
||||
chk_lmt_band:
|
||||
if (band == BAND_ON_24G && !ent->lmt_2g) {
|
||||
ent->lmt_2g = rtw_vmalloc(sizeof(*ent->lmt_2g));
|
||||
if (ent->lmt_2g) {
|
||||
u8 j, k, l, m;
|
||||
|
||||
for (j = 0; j < MAX_2_4G_BANDWIDTH_NUM; ++j)
|
||||
for (k = 0; k < TXPWR_LMT_RS_NUM_2G; ++k)
|
||||
for (m = 0; m < CENTER_CH_2G_NUM; ++m)
|
||||
for (l = 0; l < MAX_TX_COUNT; ++l)
|
||||
ent->lmt_2g->v[j][k][m][l] = hal_spec->txgi_max;
|
||||
} else
|
||||
goto release_lock;
|
||||
}
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
else if (band == BAND_ON_5G && !ent->lmt_5g) {
|
||||
ent->lmt_5g = rtw_vmalloc(sizeof(*ent->lmt_5g));
|
||||
if (ent->lmt_5g) {
|
||||
u8 j, k, l, m;
|
||||
|
||||
for (j = 0; j < MAX_5G_BANDWIDTH_NUM; ++j)
|
||||
for (k = 0; k < TXPWR_LMT_RS_NUM_5G; ++k)
|
||||
for (m = 0; m < CENTER_CH_5G_ALL_NUM; ++m)
|
||||
for (l = 0; l < MAX_TX_COUNT; ++l)
|
||||
ent->lmt_5g->v[j][k][m][l] = hal_spec->txgi_max;
|
||||
} else
|
||||
goto release_lock;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (band == BAND_ON_2_4G) {
|
||||
pre_lmt = ent->lmt_2g->v[bw][tlrs][ch_idx][ntx_idx];
|
||||
ch = ch_idx + 1;
|
||||
}
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
else if (band == BAND_ON_5G) {
|
||||
pre_lmt = ent->lmt_5g->v[bw][tlrs - 1][ch_idx][ntx_idx];
|
||||
ch = center_ch_5g_all[ch_idx];
|
||||
}
|
||||
#endif
|
||||
else
|
||||
goto release_lock;
|
||||
|
||||
if (pre_lmt != hal_spec->txgi_max)
|
||||
RTW_PRINT("duplicate txpwr_lmt for [%s][%s][%s][%s][%uT][%d]\n"
|
||||
, name, band_str(band), ch_width_str(bw), txpwr_lmt_rs_str(tlrs), ntx_idx + 1, ch);
|
||||
|
||||
lmt = rtw_min(pre_lmt, lmt);
|
||||
if (band == BAND_ON_2_4G)
|
||||
ent->lmt_2g->v[bw][tlrs][ch_idx][ntx_idx] = lmt;
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
else if (band == BAND_ON_5G)
|
||||
ent->lmt_5g->v[bw][tlrs - 1][ch_idx][ntx_idx] = lmt;
|
||||
#endif
|
||||
|
||||
if (0)
|
||||
RTW_PRINT("%s, %4s, %6s, %7s, %uT, ch%3d = %d\n"
|
||||
, name, band_str(band), ch_width_str(bw), txpwr_lmt_rs_str(tlrs), ntx_idx + 1
|
||||
, ch, lmt);
|
||||
|
||||
release_lock:
|
||||
_rtw_mutex_unlock(&tb->lock);
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
void hal_txpwr_lmt_reg_add(struct hal_com_data *hal_data, const char *name
|
||||
, u8 band, u8 bw, u8 tlrs, u8 ntx_idx, u8 ch_idx, s8 lmt)
|
||||
{
|
||||
hal_txpwr_lmt_reg_add_with_nlen(hal_data, name, strlen(name)
|
||||
, band, bw, tlrs, ntx_idx, ch_idx, lmt);
|
||||
}
|
||||
|
||||
struct lmt_reg *_hal_txpwr_lmt_reg_get_by_name(struct hal_com_data *hal_data, const char *name)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
struct lmt_reg *ent;
|
||||
_list *cur, *head;
|
||||
u8 found = 0;
|
||||
|
||||
head = &tb->reg_list;
|
||||
cur = get_next(head);
|
||||
|
||||
while ((rtw_end_of_queue_search(head, cur)) == _FALSE) {
|
||||
ent = LIST_CONTAINOR(cur, struct lmt_reg, list);
|
||||
cur = get_next(cur);
|
||||
|
||||
if (strcmp(ent->name, name) == 0) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
return ent;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct lmt_reg *hal_txpwr_lmt_reg_get_by_name(struct hal_com_data *hal_data, const char *name)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
struct lmt_reg *ent;
|
||||
|
||||
_rtw_mutex_lock_interruptible(&tb->lock);
|
||||
ent = _hal_txpwr_lmt_reg_get_by_name(hal_data, name);
|
||||
_rtw_mutex_unlock(&tb->lock);
|
||||
|
||||
return ent;
|
||||
}
|
||||
|
||||
static void hal_txpwr_clear_current_lmt_reg_names(struct hal_com_data *hal_data, enum band_type band)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
|
||||
if (band >= BAND_MAX)
|
||||
return;
|
||||
|
||||
if (tb->cur_reg_names[band]) {
|
||||
rtw_mfree(tb->cur_reg_names[band], tb->cur_reg_names_len[band]);
|
||||
tb->cur_reg_names[band] = NULL;
|
||||
}
|
||||
tb->cur_reg_names_len[band] = 0;
|
||||
}
|
||||
|
||||
static void hal_txpwr_clear_all_current_lmt_reg_names(struct hal_com_data *hal_data)
|
||||
{
|
||||
u8 band;
|
||||
|
||||
for (band = 0; band < BAND_MAX; band++)
|
||||
hal_txpwr_clear_current_lmt_reg_names(hal_data, band);
|
||||
}
|
||||
|
||||
void hal_txpwr_set_current_lmt_regs(struct hal_com_data *hal_data, enum band_type band, char *names, int names_len)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
|
||||
if (band >= BAND_MAX)
|
||||
return;
|
||||
|
||||
_rtw_mutex_lock_interruptible(&tb->lock);
|
||||
|
||||
hal_txpwr_clear_current_lmt_reg_names(hal_data, band);
|
||||
|
||||
if (names && names_len) {
|
||||
tb->cur_reg_names[band] = rtw_malloc(names_len);
|
||||
if (tb->cur_reg_names[band]) {
|
||||
_rtw_memcpy(tb->cur_reg_names[band], names, names_len);
|
||||
tb->cur_reg_names_len[band] = names_len;
|
||||
}
|
||||
}
|
||||
|
||||
_rtw_mutex_unlock(&tb->lock);
|
||||
}
|
||||
|
||||
void hal_txpwr_get_current_lmt_regs(struct hal_com_data *hal_data, enum band_type band, char **names, int *names_len)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
|
||||
if (!names || !names_len)
|
||||
return;
|
||||
|
||||
*names = NULL;
|
||||
*names_len = 0;
|
||||
|
||||
if (band >= BAND_MAX)
|
||||
return;
|
||||
|
||||
_rtw_mutex_lock_interruptible(&tb->lock);
|
||||
|
||||
if (tb->cur_reg_names[band] && tb->cur_reg_names_len[band]) {
|
||||
*names = rtw_malloc(tb->cur_reg_names_len[band]);
|
||||
if (*names) {
|
||||
_rtw_memcpy(*names, tb->cur_reg_names[band], tb->cur_reg_names_len[band]);
|
||||
*names_len = tb->cur_reg_names_len[band];
|
||||
}
|
||||
}
|
||||
|
||||
_rtw_mutex_unlock(&tb->lock);
|
||||
}
|
||||
|
||||
bool hal_txpwr_is_current_lmt_reg(struct hal_com_data *hal_data, enum band_type band, const char *name)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
const char *reg_names, *pos;
|
||||
int reg_names_len;
|
||||
|
||||
if (band < BAND_MAX) {
|
||||
reg_names = tb->cur_reg_names[band];
|
||||
reg_names_len = tb->cur_reg_names_len[band];
|
||||
if (reg_names) {
|
||||
ustrs_for_each_str(reg_names, reg_names_len, pos) {
|
||||
if (strcmp(name, pos) == 0)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void hal_txpwr_lmt_reg_list_free(struct hal_com_data *hal_data)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
struct lmt_reg *ent;
|
||||
_list *cur, *head;
|
||||
|
||||
_rtw_mutex_lock_interruptible(&tb->lock);
|
||||
|
||||
head = &tb->reg_list;
|
||||
cur = get_next(head);
|
||||
|
||||
while ((rtw_end_of_queue_search(head, cur)) == _FALSE) {
|
||||
ent = LIST_CONTAINOR(cur, struct lmt_reg, list);
|
||||
cur = get_next(cur);
|
||||
rtw_list_delete(&ent->list);
|
||||
if (ent->lmt_2g)
|
||||
rtw_vmfree(ent->lmt_2g, sizeof(*ent->lmt_2g));
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
if (ent->lmt_5g)
|
||||
rtw_vmfree(ent->lmt_5g, sizeof(*ent->lmt_5g));
|
||||
#endif
|
||||
rtw_vmfree(ent, sizeof(struct lmt_reg) + strlen(ent->name) + 1);
|
||||
}
|
||||
tb->reg_num = 0;
|
||||
|
||||
hal_txpwr_clear_all_current_lmt_reg_names(hal_data);
|
||||
|
||||
_rtw_mutex_unlock(&tb->lock);
|
||||
}
|
||||
|
||||
void hal_txpwr_lmt_tb_init(struct hal_com_data *hal_data)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
|
||||
_rtw_mutex_init(&tb->lock);
|
||||
_rtw_init_listhead(&tb->reg_exc_list);
|
||||
_rtw_init_listhead(&tb->reg_list);
|
||||
}
|
||||
|
||||
void hal_txpwr_lmt_tb_deinit(struct hal_com_data *hal_data)
|
||||
{
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
|
||||
hal_txpwr_lmt_reg_exc_list_free(hal_data);
|
||||
hal_txpwr_lmt_reg_list_free(hal_data);
|
||||
_rtw_mutex_free(&tb->lock);
|
||||
}
|
||||
|
||||
void dump_txpwr_lmt(void *sel, _adapter *adapter)
|
||||
{
|
||||
#define TMP_STR_LEN 16
|
||||
struct hal_com_data *hal_data = GET_HAL_DATA(adapter);
|
||||
struct hal_spec_t *hal_spec = GET_HAL_SPEC(adapter);
|
||||
struct txpwr_lmt_tb_t *tb = &hal_data->txpwr_lmt_tb;
|
||||
char fmt[16];
|
||||
char tmp_str[TMP_STR_LEN];
|
||||
s8 *lmt_idx = NULL;
|
||||
int bw, band, ch_num, tlrs, ntx_idx, rs, i, path;
|
||||
u8 ch, n, rfpath_num;
|
||||
|
||||
_rtw_mutex_lock_interruptible(&tb->lock);
|
||||
|
||||
_dump_txpwr_lmt_reg_exc_list(sel, hal_data);
|
||||
RTW_PRINT_SEL(sel, "\n");
|
||||
|
||||
if (!tb->reg_num)
|
||||
goto release_lock;
|
||||
|
||||
lmt_idx = rtw_malloc(sizeof(s8) * RF_PATH_MAX * tb->reg_num);
|
||||
if (!lmt_idx) {
|
||||
RTW_ERR("%s alloc fail\n", __func__);
|
||||
goto release_lock;
|
||||
}
|
||||
|
||||
RTW_PRINT_SEL(sel, "lmt_2g_cck_ofdm_state:0x%02x\n", tb->lmt_2g_cck_ofdm_state);
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
if (IS_HARDWARE_TYPE_JAGUAR_ALL(adapter)) {
|
||||
RTW_PRINT_SEL(sel, "lmt_5g_cck_ofdm_state:0x%02x\n", tb->lmt_5g_cck_ofdm_state);
|
||||
RTW_PRINT_SEL(sel, "lmt_5g_20_40_ref:0x%02x\n", tb->lmt_5g_20_40_ref);
|
||||
}
|
||||
#endif
|
||||
RTW_PRINT_SEL(sel, "\n");
|
||||
|
||||
for (band = BAND_ON_2_4G; band <= BAND_ON_5G; band++) {
|
||||
if (!hal_is_band_support(adapter, band))
|
||||
continue;
|
||||
|
||||
rfpath_num = (band == BAND_ON_2_4G ? hal_spec->rfpath_num_2g : hal_spec->rfpath_num_5g);
|
||||
|
||||
for (bw = 0; bw < MAX_5G_BANDWIDTH_NUM; bw++) {
|
||||
|
||||
if (bw >= CHANNEL_WIDTH_160)
|
||||
break;
|
||||
if (band == BAND_ON_2_4G && bw >= CHANNEL_WIDTH_80)
|
||||
break;
|
||||
|
||||
if (band == BAND_ON_2_4G)
|
||||
ch_num = CENTER_CH_2G_NUM;
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
else if (band == BAND_ON_5G)
|
||||
ch_num = center_chs_5g_num(bw);
|
||||
#endif
|
||||
else
|
||||
ch_num = 0;
|
||||
|
||||
if (ch_num == 0) {
|
||||
rtw_warn_on(1);
|
||||
break;
|
||||
}
|
||||
|
||||
for (tlrs = TXPWR_LMT_RS_CCK; tlrs < TXPWR_LMT_RS_NUM; tlrs++) {
|
||||
|
||||
if (band == BAND_ON_2_4G && tlrs == TXPWR_LMT_RS_VHT)
|
||||
continue;
|
||||
if (band == BAND_ON_5G && tlrs == TXPWR_LMT_RS_CCK)
|
||||
continue;
|
||||
if (bw > CHANNEL_WIDTH_20 && (tlrs == TXPWR_LMT_RS_CCK || tlrs == TXPWR_LMT_RS_OFDM))
|
||||
continue;
|
||||
if (bw > CHANNEL_WIDTH_40 && tlrs == TXPWR_LMT_RS_HT)
|
||||
continue;
|
||||
if (tlrs == TXPWR_LMT_RS_VHT && !IS_HARDWARE_TYPE_JAGUAR_ALL(adapter))
|
||||
continue;
|
||||
|
||||
for (ntx_idx = RF_1TX; ntx_idx < MAX_TX_COUNT; ntx_idx++) {
|
||||
struct lmt_reg *ent;
|
||||
_list *cur, *head;
|
||||
|
||||
if (ntx_idx + 1 > hal_data->max_tx_cnt)
|
||||
continue;
|
||||
|
||||
/* bypass CCK multi-TX is not defined */
|
||||
if (tlrs == TXPWR_LMT_RS_CCK && ntx_idx > RF_1TX) {
|
||||
if (band == BAND_ON_2_4G
|
||||
&& !(tb->lmt_2g_cck_ofdm_state & (TXPWR_LMT_HAS_CCK_1T << ntx_idx)))
|
||||
continue;
|
||||
}
|
||||
|
||||
/* bypass OFDM multi-TX is not defined */
|
||||
if (tlrs == TXPWR_LMT_RS_OFDM && ntx_idx > RF_1TX) {
|
||||
if (band == BAND_ON_2_4G
|
||||
&& !(tb->lmt_2g_cck_ofdm_state & (TXPWR_LMT_HAS_OFDM_1T << ntx_idx)))
|
||||
continue;
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
if (band == BAND_ON_5G
|
||||
&& !(tb->lmt_5g_cck_ofdm_state & (TXPWR_LMT_HAS_OFDM_1T << ntx_idx)))
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* bypass 5G 20M, 40M pure reference */
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
if (band == BAND_ON_5G && (bw == CHANNEL_WIDTH_20 || bw == CHANNEL_WIDTH_40)) {
|
||||
if (tb->lmt_5g_20_40_ref == TXPWR_LMT_REF_HT_FROM_VHT) {
|
||||
if (tlrs == TXPWR_LMT_RS_HT)
|
||||
continue;
|
||||
} else if (tb->lmt_5g_20_40_ref == TXPWR_LMT_REF_VHT_FROM_HT) {
|
||||
if (tlrs == TXPWR_LMT_RS_VHT && bw <= CHANNEL_WIDTH_40)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* choose n-SS mapping rate section to get lmt diff value */
|
||||
if (tlrs == TXPWR_LMT_RS_CCK)
|
||||
rs = CCK;
|
||||
else if (tlrs == TXPWR_LMT_RS_OFDM)
|
||||
rs = OFDM;
|
||||
else if (tlrs == TXPWR_LMT_RS_HT)
|
||||
rs = HT_1SS + ntx_idx;
|
||||
else if (tlrs == TXPWR_LMT_RS_VHT)
|
||||
rs = VHT_1SS + ntx_idx;
|
||||
else {
|
||||
RTW_ERR("%s invalid tlrs %u\n", __func__, tlrs);
|
||||
continue;
|
||||
}
|
||||
|
||||
RTW_PRINT_SEL(sel, "[%s][%s][%s][%uT]\n"
|
||||
, band_str(band)
|
||||
, ch_width_str(bw)
|
||||
, txpwr_lmt_rs_str(tlrs)
|
||||
, ntx_idx + 1
|
||||
);
|
||||
|
||||
/* header for limit in db */
|
||||
RTW_PRINT_SEL(sel, "%3s ", "ch");
|
||||
|
||||
head = &tb->reg_list;
|
||||
cur = get_next(head);
|
||||
while ((rtw_end_of_queue_search(head, cur)) == _FALSE) {
|
||||
ent = LIST_CONTAINOR(cur, struct lmt_reg, list);
|
||||
cur = get_next(cur);
|
||||
if ((band == BAND_ON_24G && !ent->lmt_2g)
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
|| (band == BAND_ON_5G && !ent->lmt_5g)
|
||||
#endif
|
||||
)
|
||||
continue;
|
||||
|
||||
sprintf(fmt, "%%%zus%%s ", strlen(ent->name) >= 6 ? 1 : 6 - strlen(ent->name));
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt
|
||||
, hal_txpwr_is_current_lmt_reg(hal_data, band, ent->name) ? "*" : ""
|
||||
, ent->name);
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
}
|
||||
sprintf(fmt, "%%%zus%%s ", strlen(txpwr_lmt_str(TXPWR_LMT_WW)) >= 6 ? 1 : 6 - strlen(txpwr_lmt_str(TXPWR_LMT_WW)));
|
||||
snprintf(tmp_str, TMP_STR_LEN, fmt
|
||||
, hal_txpwr_is_current_lmt_reg(hal_data, band, txpwr_lmt_str(TXPWR_LMT_WW)) ? "*" : ""
|
||||
, txpwr_lmt_str(TXPWR_LMT_WW));
|
||||
_RTW_PRINT_SEL(sel, "%s", tmp_str);
|
||||
|
||||
/* header for limit offset */
|
||||
for (path = 0; path < RF_PATH_MAX; path++) {
|
||||
if (path >= rfpath_num)
|
||||
break;
|
||||
_RTW_PRINT_SEL(sel, "|");
|
||||
head = &tb->reg_list;
|
||||
cur = get_next(head);
|
||||
while ((rtw_end_of_queue_search(head, cur)) == _FALSE) {
|
||||
ent = LIST_CONTAINOR(cur, struct lmt_reg, list);
|
||||
cur = get_next(cur);
|
||||
if ((band == BAND_ON_24G && !ent->lmt_2g)
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
|| (band == BAND_ON_5G && !ent->lmt_5g)
|
||||
#endif
|
||||
)
|
||||
continue;
|
||||
|
||||
_RTW_PRINT_SEL(sel, "%3c "
|
||||
, hal_txpwr_is_current_lmt_reg(hal_data, band, ent->name) ? rf_path_char(path) : ' ');
|
||||
}
|
||||
_RTW_PRINT_SEL(sel, "%3c "
|
||||
, hal_txpwr_is_current_lmt_reg(hal_data, band, txpwr_lmt_str(TXPWR_LMT_WW)) ? rf_path_char(path) : ' ');
|
||||
}
|
||||
_RTW_PRINT_SEL(sel, "\n");
|
||||
|
||||
for (n = 0; n < ch_num; n++) {
|
||||
s8 lmt;
|
||||
s8 lmt_offset;
|
||||
u8 base;
|
||||
|
||||
if (band == BAND_ON_2_4G)
|
||||
ch = n + 1;
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
else if (band == BAND_ON_5G)
|
||||
ch = center_chs_5g(bw, n);
|
||||
#endif
|
||||
else
|
||||
ch = 0;
|
||||
|
||||
if (ch == 0) {
|
||||
rtw_warn_on(1);
|
||||
break;
|
||||
}
|
||||
|
||||
/* dump limit in dBm */
|
||||
RTW_PRINT_SEL(sel, "%3u ", ch);
|
||||
head = &tb->reg_list;
|
||||
cur = get_next(head);
|
||||
while ((rtw_end_of_queue_search(head, cur)) == _FALSE) {
|
||||
ent = LIST_CONTAINOR(cur, struct lmt_reg, list);
|
||||
cur = get_next(cur);
|
||||
if ((band == BAND_ON_24G && !ent->lmt_2g)
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
|| (band == BAND_ON_5G && !ent->lmt_5g)
|
||||
#endif
|
||||
)
|
||||
continue;
|
||||
|
||||
lmt = phy_get_txpwr_lmt(adapter, ent->name, band, bw, tlrs, ntx_idx, ch, 0);
|
||||
txpwr_idx_get_dbm_str(lmt, hal_spec->txgi_max, hal_spec->txgi_pdbm, strlen(ent->name), tmp_str, TMP_STR_LEN);
|
||||
_RTW_PRINT_SEL(sel, "%s ", tmp_str);
|
||||
}
|
||||
lmt = phy_get_txpwr_lmt(adapter, txpwr_lmt_str(TXPWR_LMT_WW), band, bw, tlrs, ntx_idx, ch, 0);
|
||||
txpwr_idx_get_dbm_str(lmt, hal_spec->txgi_max, hal_spec->txgi_pdbm, strlen(txpwr_lmt_str(TXPWR_LMT_WW)), tmp_str, TMP_STR_LEN);
|
||||
_RTW_PRINT_SEL(sel, "%s ", tmp_str);
|
||||
|
||||
/* dump limit offset of each path */
|
||||
for (path = RF_PATH_A; path < RF_PATH_MAX; path++) {
|
||||
if (path >= rfpath_num)
|
||||
break;
|
||||
|
||||
base = phy_get_target_txpwr(adapter, band, path, rs);
|
||||
|
||||
_RTW_PRINT_SEL(sel, "|");
|
||||
head = &tb->reg_list;
|
||||
cur = get_next(head);
|
||||
i = 0;
|
||||
while ((rtw_end_of_queue_search(head, cur)) == _FALSE) {
|
||||
ent = LIST_CONTAINOR(cur, struct lmt_reg, list);
|
||||
cur = get_next(cur);
|
||||
if ((band == BAND_ON_24G && !ent->lmt_2g)
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
|| (band == BAND_ON_5G && !ent->lmt_5g)
|
||||
#endif
|
||||
)
|
||||
continue;
|
||||
|
||||
lmt_offset = phy_get_txpwr_lmt_diff(adapter, ent->name, band, bw, path, rs, tlrs, ntx_idx, ch, 0);
|
||||
if (lmt_offset == hal_spec->txgi_max) {
|
||||
*(lmt_idx + i * RF_PATH_MAX + path) = hal_spec->txgi_max;
|
||||
_RTW_PRINT_SEL(sel, "%3s ", "NA");
|
||||
} else {
|
||||
*(lmt_idx + i * RF_PATH_MAX + path) = lmt_offset + base;
|
||||
_RTW_PRINT_SEL(sel, "%3d ", lmt_offset);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
lmt_offset = phy_get_txpwr_lmt_diff(adapter, txpwr_lmt_str(TXPWR_LMT_WW), band, bw, path, rs, tlrs, ntx_idx, ch, 0);
|
||||
if (lmt_offset == hal_spec->txgi_max)
|
||||
_RTW_PRINT_SEL(sel, "%3s ", "NA");
|
||||
else
|
||||
_RTW_PRINT_SEL(sel, "%3d ", lmt_offset);
|
||||
|
||||
}
|
||||
|
||||
/* compare limit_idx of each path, print 'x' when mismatch */
|
||||
if (rfpath_num > 1) {
|
||||
for (i = 0; i < tb->reg_num; i++) {
|
||||
for (path = 0; path < RF_PATH_MAX; path++) {
|
||||
if (path >= rfpath_num)
|
||||
break;
|
||||
if (*(lmt_idx + i * RF_PATH_MAX + path) != *(lmt_idx + i * RF_PATH_MAX + ((path + 1) % rfpath_num)))
|
||||
break;
|
||||
}
|
||||
if (path >= rfpath_num)
|
||||
_RTW_PRINT_SEL(sel, " ");
|
||||
else
|
||||
_RTW_PRINT_SEL(sel, "x");
|
||||
}
|
||||
}
|
||||
_RTW_PRINT_SEL(sel, "\n");
|
||||
|
||||
}
|
||||
RTW_PRINT_SEL(sel, "\n");
|
||||
}
|
||||
} /* loop for rate sections */
|
||||
} /* loop for bandwidths */
|
||||
} /* loop for bands */
|
||||
|
||||
if (lmt_idx)
|
||||
rtw_mfree(lmt_idx, sizeof(s8) * RF_PATH_MAX * tb->reg_num);
|
||||
|
||||
release_lock:
|
||||
_rtw_mutex_unlock(&tb->lock);
|
||||
}
|
||||
#endif /* CONFIG_TXPWR_LIMIT */
|
||||
113
drivers/net/wireless/rtl8822cs/hal/hal_pwr_table.h
Normal file
113
drivers/net/wireless/rtl8822cs/hal/hal_pwr_table.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2022 Realtek Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef _HAL_PWR_TABLE_H_
|
||||
#define _HAL_PWR_TABLE_H_
|
||||
|
||||
#if CONFIG_TXPWR_LIMIT
|
||||
#define TXPWR_LMT_RS_CCK 0
|
||||
#define TXPWR_LMT_RS_OFDM 1
|
||||
#define TXPWR_LMT_RS_HT 2
|
||||
#define TXPWR_LMT_RS_VHT 3
|
||||
#define TXPWR_LMT_RS_NUM 4
|
||||
|
||||
#define TXPWR_LMT_RS_NUM_2G 4 /* CCK, OFDM, HT, VHT */
|
||||
#define TXPWR_LMT_RS_NUM_5G 3 /* OFDM, HT, VHT */
|
||||
|
||||
#define MAX_2_4G_BANDWIDTH_NUM 2
|
||||
#define MAX_5G_BANDWIDTH_NUM 4
|
||||
|
||||
extern const char *const _txpwr_lmt_rs_str[];
|
||||
#define txpwr_lmt_rs_str(rs) (((rs) >= TXPWR_LMT_RS_NUM) ? _txpwr_lmt_rs_str[TXPWR_LMT_RS_NUM] : _txpwr_lmt_rs_str[(rs)])
|
||||
|
||||
struct lmt_reg_exc {
|
||||
_list list;
|
||||
char country[2];
|
||||
u8 domain;
|
||||
char reg_name[0];
|
||||
};
|
||||
|
||||
struct lmt_2g_t {
|
||||
s8 v[MAX_2_4G_BANDWIDTH_NUM]
|
||||
[TXPWR_LMT_RS_NUM_2G]
|
||||
[CENTER_CH_2G_NUM]
|
||||
[MAX_TX_COUNT];
|
||||
};
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
struct lmt_5g_t {
|
||||
s8 v[MAX_5G_BANDWIDTH_NUM]
|
||||
[TXPWR_LMT_RS_NUM_5G]
|
||||
[CENTER_CH_5G_ALL_NUM]
|
||||
[MAX_TX_COUNT];
|
||||
};
|
||||
#endif
|
||||
|
||||
struct lmt_reg {
|
||||
_list list;
|
||||
|
||||
struct lmt_2g_t *lmt_2g;
|
||||
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
struct lmt_5g_t *lmt_5g;
|
||||
#endif
|
||||
|
||||
char name[];
|
||||
};
|
||||
|
||||
struct txpwr_lmt_tb_t {
|
||||
_mutex lock;
|
||||
|
||||
_list reg_exc_list;
|
||||
u8 reg_exc_num;
|
||||
|
||||
_list reg_list;
|
||||
u8 reg_num;
|
||||
|
||||
u8 lmt_2g_cck_ofdm_state;
|
||||
#if CONFIG_IEEE80211_BAND_5GHZ
|
||||
u8 lmt_5g_cck_ofdm_state;
|
||||
u8 lmt_5g_20_40_ref;
|
||||
#endif
|
||||
|
||||
char *cur_reg_names[BAND_MAX];
|
||||
int cur_reg_names_len[BAND_MAX];
|
||||
};
|
||||
|
||||
struct hal_com_data;
|
||||
|
||||
void hal_txpwr_lmt_reg_exc_add_with_nlen(struct hal_com_data *hal_data, const char *country, u8 domain, const char *reg_name, u32 nlen);
|
||||
void hal_txpwr_lmt_reg_exc_add(struct hal_com_data *hal_data, const char *country, u8 domain, const char *reg_name);
|
||||
struct lmt_reg_exc *hal_txpwr_lmt_reg_exc_search(struct hal_com_data *hal_data, const char *country, u8 domain);
|
||||
void hal_txpwr_lmt_reg_exc_list_free(struct hal_com_data *hal_data);
|
||||
void dump_txpwr_lmt_reg_exc_list(void *sel, struct hal_com_data *hal_data);
|
||||
|
||||
void hal_txpwr_lmt_reg_add_with_nlen(struct hal_com_data *hal_data, const char *name, u32 nlen
|
||||
, u8 band, u8 bw, u8 tlrs, u8 ntx_idx, u8 ch_idx, s8 lmt);
|
||||
void hal_txpwr_lmt_reg_add(struct hal_com_data *hal_data, const char *name
|
||||
, u8 band, u8 bw, u8 tlrs, u8 ntx_idx, u8 ch_idx, s8 lmt);
|
||||
struct lmt_reg *_hal_txpwr_lmt_reg_get_by_name(struct hal_com_data *hal_data, const char *name);
|
||||
struct lmt_reg *hal_txpwr_lmt_reg_get_by_name(struct hal_com_data *hal_data, const char *name);
|
||||
void hal_txpwr_set_current_lmt_regs(struct hal_com_data *hal_data, enum band_type band, char *names, int names_len);
|
||||
void hal_txpwr_get_current_lmt_regs(struct hal_com_data *hal_data, enum band_type band, char **names, int *names_len);
|
||||
bool hal_txpwr_is_current_lmt_reg(struct hal_com_data *hal_data, enum band_type band, const char *name);
|
||||
void hal_txpwr_lmt_reg_list_free(struct hal_com_data *hal_data);
|
||||
|
||||
void hal_txpwr_lmt_tb_init(struct hal_com_data *hal_data);
|
||||
void hal_txpwr_lmt_tb_deinit(struct hal_com_data *hal_data);
|
||||
|
||||
void dump_txpwr_lmt(void *sel, _adapter *adapter);
|
||||
#endif /* CONFIG_TXPWR_LIMIT */
|
||||
|
||||
#endif /* _HAL_PWR_TABLE_H_ */
|
||||
@@ -102,14 +102,14 @@
|
||||
#define WLAN_EIFS_DUR_TUNE_5M 0xE2
|
||||
#define WLAN_EIFS_DUR_TUNE_10M 0x76
|
||||
#define WLAN_EDCA_VO_PARAM 0x002FA226
|
||||
#define WLAN_EDCA_VO_PARAM_5M 0x002FA27A
|
||||
#define WLAN_EDCA_VO_PARAM_10M 0x002FA242
|
||||
#define WLAN_EDCA_VO_PARAM_5M 0x0000A27A
|
||||
#define WLAN_EDCA_VO_PARAM_10M 0x0000A242
|
||||
#define WLAN_EDCA_VI_PARAM 0x005EA328
|
||||
#define WLAN_EDCA_VI_PARAM_5M 0x005EA382
|
||||
#define WLAN_EDCA_VI_PARAM_10M 0x005EA346
|
||||
#define WLAN_EDCA_VI_PARAM_5M 0x0000A382
|
||||
#define WLAN_EDCA_VI_PARAM_10M 0x0000A346
|
||||
#define WLAN_EDCA_BE_PARAM 0x005EA42B
|
||||
#define WLAN_EDCA_BE_PARAM_5M 0x005EA48E
|
||||
#define WLAN_EDCA_BE_PARAM_10M 0x005EA44C
|
||||
#define WLAN_EDCA_BE_PARAM_5M 0x0000A48E
|
||||
#define WLAN_EDCA_BE_PARAM_10M 0x0000A44C
|
||||
#define WLAN_EDCA_BK_PARAM 0x0000A44F
|
||||
#define WLAN_EDCA_BK_PARAM_5M 0x0000A4D3
|
||||
#define WLAN_EDCA_BK_PARAM_10M 0x0000A47B
|
||||
|
||||
@@ -181,13 +181,6 @@ tx_allowed_sdio_8822c(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
if (!fs_info->macid_map) {
|
||||
PLTFM_MSG_ERR("[ERR]halmac allocate Macid_map Fail!!\n");
|
||||
return HALMAC_RET_MALLOC_FAIL;
|
||||
}
|
||||
|
||||
PLTFM_MEMSET(fs_info->macid_map, 0x00, fs_info->macid_map_size);
|
||||
|
||||
tx_agg_num = GET_TX_DESC_DMA_TXAGG_NUM(buf);
|
||||
tx_agg_num = (tx_agg_num == 0) ? 1 : tx_agg_num;
|
||||
|
||||
@@ -206,7 +199,7 @@ tx_allowed_sdio_8822c(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
status = chk_oqt_8822c(adapter, tx_agg_num, buf,
|
||||
macid_cnt);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_WARN("[WARN]oqt buffer full!!\n");
|
||||
PLTFM_MSG_WARN("[WARN]oqt buffer full, cnt = %d\n", cnt);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -372,11 +365,7 @@ reg_r16_sdio_8822c(struct halmac_adapter *adapter, u32 offset)
|
||||
|
||||
if ((offset & 0xFFFF0000) == 0 &&
|
||||
adapter->halmac_state.mac_pwr == HALMAC_MAC_POWER_OFF) {
|
||||
value16.byte[0] = (u8)r_indir_sdio_88xx(adapter, offset,
|
||||
HALMAC_IO_BYTE);
|
||||
value16.byte[1] = (u8)r_indir_sdio_88xx(adapter, offset + 1,
|
||||
HALMAC_IO_BYTE);
|
||||
return rtk_le16_to_cpu(value16.word);
|
||||
return (u16)r_indir_sdio_88xx(adapter, offset, HALMAC_IO_WORD);
|
||||
} else if ((offset & 0xFFFF0000) != 0 &&
|
||||
adapter->halmac_state.mac_pwr == HALMAC_MAC_POWER_OFF) {
|
||||
value16.byte[0] = PLTFM_SDIO_CMD52_R(offset);
|
||||
@@ -472,15 +461,7 @@ reg_r32_sdio_8822c(struct halmac_adapter *adapter, u32 offset)
|
||||
|
||||
if (((offset & 0xFFFF0000) == 0) &&
|
||||
adapter->halmac_state.mac_pwr == HALMAC_MAC_POWER_OFF) {
|
||||
value32.byte[0] = (u8)r_indir_sdio_88xx(adapter, offset,
|
||||
HALMAC_IO_BYTE);
|
||||
value32.byte[1] = (u8)r_indir_sdio_88xx(adapter, offset + 1,
|
||||
HALMAC_IO_BYTE);
|
||||
value32.byte[2] = (u8)r_indir_sdio_88xx(adapter, offset + 2,
|
||||
HALMAC_IO_BYTE);
|
||||
value32.byte[3] = (u8)r_indir_sdio_88xx(adapter, offset + 3,
|
||||
HALMAC_IO_BYTE);
|
||||
return rtk_le32_to_cpu(value32.dword);
|
||||
return r_indir_sdio_88xx(adapter, offset, HALMAC_IO_DWORD);
|
||||
} else if (((offset & 0xFFFF0000) != 0) &&
|
||||
adapter->halmac_state.mac_pwr == HALMAC_MAC_POWER_OFF) {
|
||||
value32.byte[0] = PLTFM_SDIO_CMD52_R(offset);
|
||||
@@ -581,7 +562,7 @@ chk_oqt_8822c(struct halmac_adapter *adapter, u32 tx_agg_num, u8 *buf,
|
||||
case HALMAC_QSEL_BK:
|
||||
case HALMAC_QSEL_BK_V2:
|
||||
if (macid_cnt > WLAN_ACQ_NUM_MAX &&
|
||||
tx_agg_num > OQT_ENTRY_AC_8822C) {
|
||||
tx_agg_num > (OQT_ENTRY_AC_8822C - 1)) {
|
||||
PLTFM_MSG_WARN("[WARN]txagg num %d > oqt entry\n",
|
||||
tx_agg_num);
|
||||
PLTFM_MSG_WARN("[WARN]macid cnt %d > acq max\n",
|
||||
@@ -590,32 +571,35 @@ chk_oqt_8822c(struct halmac_adapter *adapter, u32 tx_agg_num, u8 *buf,
|
||||
|
||||
cnt = 10;
|
||||
do {
|
||||
if (fs_info->ac_empty >= macid_cnt) {
|
||||
if (fs_info->ac_oqt_num == OQT_ENTRY_AC_8822C &&
|
||||
fs_info->ac_empty >= macid_cnt) {
|
||||
fs_info->ac_empty -= macid_cnt;
|
||||
break;
|
||||
}
|
||||
|
||||
if (fs_info->ac_oqt_num >= tx_agg_num) {
|
||||
} else if (fs_info->ac_oqt_num > tx_agg_num) {
|
||||
fs_info->ac_empty = 0;
|
||||
fs_info->ac_oqt_num -= (u8)tx_agg_num;
|
||||
fs_info->ac_oqt_num = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
update_oqt_free_space_8822c(adapter);
|
||||
|
||||
cnt--;
|
||||
if (cnt == 0)
|
||||
if (cnt == 0) {
|
||||
PLTFM_MSG_WARN("ac_oqt_num %d, ac_empty %d, tx_agg_num %d, macid_cnt %d\n",
|
||||
fs_info->ac_oqt_num, fs_info->ac_empty, tx_agg_num, macid_cnt);
|
||||
return HALMAC_RET_OQT_NOT_ENOUGH;
|
||||
}
|
||||
} while (1);
|
||||
break;
|
||||
case HALMAC_QSEL_MGNT:
|
||||
case HALMAC_QSEL_HIGH:
|
||||
if (tx_agg_num > OQT_ENTRY_NOAC_8822C)
|
||||
if (tx_agg_num > (OQT_ENTRY_NOAC_8822C - 1))
|
||||
PLTFM_MSG_WARN("[WARN]tx_agg_num %d > oqt entry\n",
|
||||
tx_agg_num);
|
||||
cnt = 10;
|
||||
do {
|
||||
if (fs_info->non_ac_oqt_num >= tx_agg_num) {
|
||||
if ((fs_info->non_ac_oqt_num > tx_agg_num) &&
|
||||
(fs_info->non_ac_oqt_num == OQT_ENTRY_NOAC_8822C)) {
|
||||
fs_info->non_ac_oqt_num -= (u8)tx_agg_num;
|
||||
break;
|
||||
}
|
||||
@@ -623,8 +607,11 @@ chk_oqt_8822c(struct halmac_adapter *adapter, u32 tx_agg_num, u8 *buf,
|
||||
update_oqt_free_space_8822c(adapter);
|
||||
|
||||
cnt--;
|
||||
if (cnt == 0)
|
||||
if (cnt == 0) {
|
||||
PLTFM_MSG_WARN("non_ac_oqt_num %d, tx_agg_num %d\n",
|
||||
fs_info->non_ac_oqt_num, tx_agg_num);
|
||||
return HALMAC_RET_OQT_NOT_ENOUGH;
|
||||
}
|
||||
} while (1);
|
||||
break;
|
||||
default:
|
||||
@@ -710,12 +697,13 @@ update_ac_empty_8822c(struct halmac_adapter *adapter, u8 value)
|
||||
struct halmac_sdio_free_space *free_space;
|
||||
|
||||
free_space = &adapter->sdio_fs;
|
||||
free_space->ac_empty = 0;
|
||||
|
||||
if (free_space->ac_oqt_num == OQT_ENTRY_AC_8822C) {
|
||||
while (value > 0) {
|
||||
value = value & (value - 1);
|
||||
free_space->ac_empty++;
|
||||
};
|
||||
}
|
||||
} else {
|
||||
PLTFM_MSG_TRACE("[TRACE]free_space->ac_oqt_num %d != %d\n",
|
||||
free_space->ac_oqt_num, OQT_ENTRY_AC_8822C);
|
||||
@@ -782,6 +770,7 @@ get_sdio_tx_addr_8822c(struct halmac_adapter *adapter, u8 *buf, u32 size,
|
||||
{
|
||||
u32 len_unit4, len_unit1, value32;
|
||||
u16 block_size = adapter->sdio_hw_info.block_size;
|
||||
u8 is_agg_len = 0;
|
||||
struct halmac_sdio_hw_info *hw_info = &adapter->sdio_hw_info;
|
||||
enum halmac_qsel queue_sel;
|
||||
enum halmac_dma_mapping dma_mapping;
|
||||
@@ -854,11 +843,23 @@ get_sdio_tx_addr_8822c(struct halmac_adapter *adapter, u8 *buf, u32 size,
|
||||
if (hw_info->tx_addr_format == HALMAC_SDIO_AGG_MODE ||
|
||||
(hw_info->tx_addr_format == HALMAC_SDIO_DUMMY_AUTO_MODE &&
|
||||
len_unit1 < block_size)) {
|
||||
*cmd53_addr = (*cmd53_addr << 13) |
|
||||
(len_unit4 & HALMAC_SDIO_4BYTE_LEN_MASK);
|
||||
is_agg_len = 1;
|
||||
} else if (hw_info->tx_addr_format == HALMAC_SDIO_DUMMY_AUTO_MODE &&
|
||||
len_unit1 == block_size) {
|
||||
if (hw_info->tx_512_by_byte_mode == 0)
|
||||
is_agg_len = 0;
|
||||
else
|
||||
is_agg_len = 1;
|
||||
} else if (hw_info->tx_addr_format == HALMAC_SDIO_DUMMY_BLOCK_MODE ||
|
||||
(hw_info->tx_addr_format == HALMAC_SDIO_DUMMY_AUTO_MODE &&
|
||||
len_unit1 >= block_size)) {
|
||||
len_unit1 > block_size)) {
|
||||
is_agg_len = 0;
|
||||
} else {
|
||||
PLTFM_MSG_ERR("[ERR]tx_addr_format is undefined\n");
|
||||
return HALMAC_RET_NOT_SUPPORT;
|
||||
}
|
||||
|
||||
if (is_agg_len == 0) {
|
||||
value32 = len_unit1 % block_size;
|
||||
if (value32)
|
||||
value32 = (block_size - value32) >> 2;
|
||||
@@ -866,7 +867,8 @@ get_sdio_tx_addr_8822c(struct halmac_adapter *adapter, u8 *buf, u32 size,
|
||||
((value32 & HALMAC_SDIO_4BYTE_LEN_MASK) << 1);
|
||||
hw_info->tx_seq = ~hw_info->tx_seq & 0x01;
|
||||
} else {
|
||||
PLTFM_MSG_ERR("[ERR]tx_addr_format is undefined\n");
|
||||
*cmd53_addr = (*cmd53_addr << 13) |
|
||||
(len_unit4 & HALMAC_SDIO_4BYTE_LEN_MASK);
|
||||
}
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
@@ -1016,6 +1018,7 @@ chk_rqd_page_num_8822c(struct halmac_adapter *adapter, u8 *buf, u32 *rqd_pg_num,
|
||||
u8 qsel_first;
|
||||
u32 i, pkt_size;
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
struct halmac_sdio_free_space *fs_info = &adapter->sdio_fs;
|
||||
|
||||
pkt = buf;
|
||||
|
||||
@@ -1025,6 +1028,13 @@ chk_rqd_page_num_8822c(struct halmac_adapter *adapter, u8 *buf, u32 *rqd_pg_num,
|
||||
if (status != HALMAC_RET_SUCCESS)
|
||||
return status;
|
||||
|
||||
if (!fs_info->macid_map) {
|
||||
PLTFM_MSG_ERR("[ERR]halmac allocate Macid_map Fail!!\n");
|
||||
return HALMAC_RET_MALLOC_FAIL;
|
||||
}
|
||||
|
||||
PLTFM_MEMSET(fs_info->macid_map, 0x00, fs_info->macid_map_size);
|
||||
|
||||
for (i = 0; i < tx_agg_num; i++) {
|
||||
/*QSEL parser*/
|
||||
status = chk_qsel_8822c(adapter, qsel_first, pkt, macid_cnt);
|
||||
|
||||
@@ -28,6 +28,7 @@ enum mac_clock_hw_def {
|
||||
MAC_CLK_HW_DEF_80M = 0,
|
||||
MAC_CLK_HW_DEF_40M = 1,
|
||||
MAC_CLK_HW_DEF_20M = 2,
|
||||
MAC_CLK_HW_DEF_20M_BW_5 = 3,
|
||||
};
|
||||
|
||||
static enum halmac_ret_status
|
||||
@@ -687,6 +688,7 @@ board_rf_fine_tune_88xx(struct halmac_adapter *adapter)
|
||||
u32 size = adapter->hw_cfg_info.eeprom_size;
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
|
||||
#if HALMAC_8822B_SUPPORT
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822B) {
|
||||
if (!adapter->efuse_map_valid || !adapter->efuse_map) {
|
||||
PLTFM_MSG_ERR("[ERR]efuse map invalid!!\n");
|
||||
@@ -713,7 +715,7 @@ board_rf_fine_tune_88xx(struct halmac_adapter *adapter)
|
||||
|
||||
PLTFM_FREE(map, size);
|
||||
}
|
||||
|
||||
#endif
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -724,8 +726,12 @@ cfg_mac_clk_88xx(struct halmac_adapter *adapter)
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
|
||||
value32 = HALMAC_REG_R32(REG_AFE_CTRL1) & ~(BIT(20) | BIT(21));
|
||||
if (adapter->curr_bw == HALMAC_BW_5 ||
|
||||
adapter->curr_bw == HALMAC_BW_10) {
|
||||
if (adapter->curr_bw == HALMAC_BW_5) {
|
||||
value32 |= (MAC_CLK_HW_DEF_20M_BW_5 << BIT_SHIFT_MAC_CLK_SEL);
|
||||
HALMAC_REG_W32(REG_AFE_CTRL1, value32);
|
||||
HALMAC_REG_W8(REG_USTIME_TSF, MAC_CLK_SPEED_BW_5M_10M);
|
||||
HALMAC_REG_W8(REG_USTIME_EDCA, MAC_CLK_SPEED_BW_5M_10M);
|
||||
} else if (adapter->curr_bw == HALMAC_BW_10) {
|
||||
value32 |= (MAC_CLK_HW_DEF_20M << BIT_SHIFT_MAC_CLK_SEL);
|
||||
HALMAC_REG_W32(REG_AFE_CTRL1, value32);
|
||||
HALMAC_REG_W8(REG_USTIME_TSF, MAC_CLK_SPEED_BW_5M_10M);
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#include "halmac_init_88xx.h"
|
||||
#include "halmac_cfg_wmac_88xx.h"
|
||||
#include "halmac_efuse_88xx.h"
|
||||
#if HALMAC_8822E_SUPPORT
|
||||
#include "halmac_8822e/halmac_efuse_8822e.h"
|
||||
#endif
|
||||
#include "halmac_bb_rf_88xx.h"
|
||||
#if HALMAC_USB_SUPPORT
|
||||
#include "halmac_usb_88xx.h"
|
||||
@@ -376,6 +379,8 @@ enum halmac_ret_status
|
||||
get_hw_value_88xx(struct halmac_adapter *adapter, enum halmac_hw_id hw_id,
|
||||
void *value)
|
||||
{
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
switch (hw_id) {
|
||||
@@ -408,7 +413,7 @@ get_hw_value_88xx(struct halmac_adapter *adapter, enum halmac_hw_id hw_id,
|
||||
*(u8 *)value = adapter->hw_cfg_info.cam_entry_num;
|
||||
break;
|
||||
case HALMAC_HW_WLAN_EFUSE_AVAILABLE_SIZE:
|
||||
get_efuse_available_size_88xx(adapter, (u32 *)value);
|
||||
api->halmac_get_efuse_available_size(adapter, (u32 *)value);
|
||||
break;
|
||||
case HALMAC_HW_IC_VERSION:
|
||||
*(u8 *)value = adapter->chip_ver;
|
||||
@@ -731,6 +736,7 @@ parse_c2h_pkt_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
u8 *c2h_pkt = buf + adapter->hw_cfg_info.rxdesc_size;
|
||||
u32 c2h_size = size - adapter->hw_cfg_info.rxdesc_size;
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
|
||||
cmd_id = (u8)C2H_HDR_GET_CMD_ID(c2h_pkt);
|
||||
|
||||
@@ -758,7 +764,15 @@ parse_c2h_pkt_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
status = get_psd_data_88xx(adapter, c2h_pkt, c2h_size);
|
||||
break;
|
||||
case C2H_SUB_CMD_ID_EFUSE_DATA:
|
||||
status = get_efuse_data_88xx(adapter, c2h_pkt, c2h_size);
|
||||
#if (HALMAC_8821C_SUPPORT || HALMAC_8822B_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
if (adapter->chip_id != HALMAC_CHIP_ID_8822E)
|
||||
status = get_efuse_data_88xx(adapter, c2h_pkt, c2h_size);
|
||||
#endif
|
||||
#if HALMAC_8822E_SUPPORT
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822E)
|
||||
status = get_efuse_data_8822e(adapter, c2h_pkt, c2h_size);
|
||||
#endif
|
||||
break;
|
||||
case C2H_SUB_CMD_ID_SCAN_CH_NOTIFY:
|
||||
status = get_scan_ch_notify_88xx(adapter, c2h_pkt, c2h_size);
|
||||
@@ -846,6 +860,7 @@ get_h2c_ack_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
u8 sub_cmd_id;
|
||||
u8 fw_rc;
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]Ack for C2H!!\n");
|
||||
|
||||
@@ -864,7 +879,15 @@ get_h2c_ack_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
|
||||
switch (sub_cmd_id) {
|
||||
case H2C_SUB_CMD_ID_DUMP_PHYSICAL_EFUSE_ACK:
|
||||
status = get_h2c_ack_phy_efuse_88xx(adapter, buf, size);
|
||||
#if (HALMAC_8821C_SUPPORT || HALMAC_8822B_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
if (adapter->chip_id != HALMAC_CHIP_ID_8822E)
|
||||
status = get_h2c_ack_phy_efuse_88xx(adapter, buf, size);
|
||||
#endif
|
||||
#if HALMAC_8822E_SUPPORT
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822E)
|
||||
status = get_h2c_ack_phy_efuse_8822e(adapter, buf, size);
|
||||
#endif
|
||||
break;
|
||||
case H2C_SUB_CMD_ID_CFG_PARAM_ACK:
|
||||
status = get_h2c_ack_cfg_param_88xx(adapter, buf, size);
|
||||
@@ -2817,6 +2840,7 @@ query_status_88xx(struct halmac_adapter *adapter,
|
||||
u32 *size)
|
||||
{
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
struct halmac_api *api = (struct halmac_api *)adapter->halmac_api;
|
||||
|
||||
if (!proc_status)
|
||||
return HALMAC_RET_NULL_POINTER;
|
||||
@@ -2826,17 +2850,49 @@ query_status_88xx(struct halmac_adapter *adapter,
|
||||
status = get_cfg_param_status_88xx(adapter, proc_status);
|
||||
break;
|
||||
case HALMAC_FEATURE_DUMP_PHYSICAL_EFUSE:
|
||||
status = get_dump_phy_efuse_status_88xx(adapter, proc_status,
|
||||
data, size);
|
||||
#if (HALMAC_8821C_SUPPORT || HALMAC_8822B_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
if (adapter->chip_id != HALMAC_CHIP_ID_8822E)
|
||||
status = get_dump_phy_efuse_status_88xx(adapter,
|
||||
proc_status,
|
||||
data, size);
|
||||
#endif
|
||||
#if HALMAC_8822E_SUPPORT
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822E)
|
||||
status = get_dump_phy_efuse_status_8822e(adapter,
|
||||
proc_status,
|
||||
data, size);
|
||||
#endif
|
||||
break;
|
||||
case HALMAC_FEATURE_DUMP_LOGICAL_EFUSE:
|
||||
status = get_dump_log_efuse_status_88xx(adapter, proc_status,
|
||||
data, size);
|
||||
#if (HALMAC_8821C_SUPPORT || HALMAC_8822B_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
if (adapter->chip_id != HALMAC_CHIP_ID_8822E)
|
||||
status = get_dump_log_efuse_status_88xx(adapter,
|
||||
proc_status,
|
||||
data, size);
|
||||
#endif
|
||||
#if HALMAC_8822E_SUPPORT
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822E)
|
||||
status = get_dump_log_efuse_status_8822e(adapter,
|
||||
proc_status,
|
||||
data, size);
|
||||
#endif
|
||||
break;
|
||||
case HALMAC_FEATURE_DUMP_LOGICAL_EFUSE_MASK:
|
||||
status = get_dump_log_efuse_mask_status_88xx(adapter,
|
||||
proc_status,
|
||||
data, size);
|
||||
#if (HALMAC_8821C_SUPPORT || HALMAC_8822B_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
if (adapter->chip_id != HALMAC_CHIP_ID_8822E)
|
||||
status = get_dump_log_efuse_mask_status_88xx(adapter,
|
||||
proc_status,
|
||||
data, size);
|
||||
#endif
|
||||
#if HALMAC_8822E_SUPPORT
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822E)
|
||||
status = get_dump_log_efuse_mask_status_8822e(adapter,
|
||||
proc_status,
|
||||
data, size);
|
||||
#endif
|
||||
break;
|
||||
case HALMAC_FEATURE_CHANNEL_SWITCH:
|
||||
status = get_ch_switch_status_88xx(adapter, proc_status);
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
#include "halmac_common_88xx.h"
|
||||
#include "halmac_init_88xx.h"
|
||||
|
||||
#if HALMAC_88XX_SUPPORT
|
||||
#if (HALMAC_8821C_SUPPORT || HALMAC_8822B_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
|
||||
#define RSVD_EFUSE_SIZE 16
|
||||
#define RSVD_CS_EFUSE_SIZE 24
|
||||
@@ -430,26 +431,6 @@ read_efuse_bt_88xx(struct halmac_adapter *adapter, u32 offset, u8 *value,
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* cfg_efuse_auto_check_88xx() - check efuse after writing it
|
||||
* @adapter : the adapter of halmac
|
||||
* @enable : 1, enable efuse auto check. others, disable
|
||||
* Author : Soar
|
||||
* Return : enum halmac_ret_status
|
||||
* More details of status code can be found in prototype document
|
||||
*/
|
||||
enum halmac_ret_status
|
||||
cfg_efuse_auto_check_88xx(struct halmac_adapter *adapter, u8 enable)
|
||||
{
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
adapter->efuse_auto_check_en = enable;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_efuse_available_size_88xx() - get efuse available size
|
||||
* @adapter : the adapter of halmac
|
||||
@@ -478,46 +459,6 @@ get_efuse_available_size_88xx(struct halmac_adapter *adapter, u32 *size)
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_efuse_size_88xx() - get "physical" efuse size
|
||||
* @adapter : the adapter of halmac
|
||||
* @size : physical efuse size
|
||||
* Author : Ivan Lin/KaiYuan Chang
|
||||
* Return : enum halmac_ret_status
|
||||
* More details of status code can be found in prototype document
|
||||
*/
|
||||
enum halmac_ret_status
|
||||
get_efuse_size_88xx(struct halmac_adapter *adapter, u32 *size)
|
||||
{
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
*size = adapter->hw_cfg_info.efuse_size;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_log_efuse_size_88xx() - get "logical" efuse size
|
||||
* @adapter : the adapter of halmac
|
||||
* @size : logical efuse size
|
||||
* Author : Ivan Lin/KaiYuan Chang
|
||||
* Return : enum halmac_ret_status
|
||||
* More details of status code can be found in prototype document
|
||||
*/
|
||||
enum halmac_ret_status
|
||||
get_log_efuse_size_88xx(struct halmac_adapter *adapter, u32 *size)
|
||||
{
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
*size = adapter->hw_cfg_info.eeprom_size;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* dump_log_efuse_map_88xx() - dump "logical" efuse map
|
||||
* @adapter : the adapter of halmac
|
||||
@@ -1917,6 +1858,8 @@ check_efuse_enough_88xx(struct halmac_adapter *adapter,
|
||||
u8 super_usb;
|
||||
enum halmac_ret_status status = HALMAC_RET_SUCCESS;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
status = super_usb_chk_88xx(adapter, &super_usb);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]super_usb_chk\n");
|
||||
@@ -1926,10 +1869,13 @@ check_efuse_enough_88xx(struct halmac_adapter *adapter,
|
||||
for (i = 0; i < info->efuse_map_size; i = i + 8) {
|
||||
eeprom_offset = i;
|
||||
|
||||
if ((eeprom_offset & 7) > 0)
|
||||
if (((eeprom_offset >> 3) & 1) > 0)
|
||||
pre_word_en = (*(updated_mask + (i >> 4)) & 0x0F);
|
||||
else
|
||||
pre_word_en = (*(updated_mask + (i >> 4)) >> 4);
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]eeprom_offset = 0x%x, pre_word_en = 0x%x, updated_mask = 0x%x\n",
|
||||
eeprom_offset, pre_word_en, *(updated_mask + (i >> 4)));
|
||||
|
||||
if (pre_word_en > 0) {
|
||||
if (super_usb &&
|
||||
@@ -1955,11 +1901,16 @@ check_efuse_enough_88xx(struct halmac_adapter *adapter,
|
||||
}
|
||||
}
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]pg_num = 0x%x, efuse_end = 0x%x\n", pg_num, adapter->efuse_end);
|
||||
PLTFM_MSG_TRACE("[TRACE]prtct_efuse_size = 0x%x, efuse_size = 0x%x\n", adapter->hw_cfg_info.prtct_efuse_size, adapter->hw_cfg_info.efuse_size);
|
||||
|
||||
if (adapter->hw_cfg_info.efuse_size <=
|
||||
(pg_num + adapter->hw_cfg_info.prtct_efuse_size +
|
||||
adapter->efuse_end))
|
||||
return HALMAC_RET_EFUSE_NOT_ENOUGH;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -2167,6 +2118,7 @@ program_efuse_88xx(struct halmac_adapter *adapter,
|
||||
word_en,
|
||||
pre_word_en,
|
||||
eeprom_offset);
|
||||
PLTFM_MSG_TRACE("[TRACE]pg_super_usb => efuse_end = 0x%x\n", adapter->efuse_end);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]super usb efuse\n");
|
||||
return status;
|
||||
@@ -2176,6 +2128,7 @@ program_efuse_88xx(struct halmac_adapter *adapter,
|
||||
word_en,
|
||||
pre_word_en,
|
||||
eeprom_offset);
|
||||
PLTFM_MSG_TRACE("[TRACE]pg_extend => efuse_end = 0x%x\n", adapter->efuse_end);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]extend efuse\n");
|
||||
return status;
|
||||
@@ -2185,6 +2138,7 @@ program_efuse_88xx(struct halmac_adapter *adapter,
|
||||
word_en,
|
||||
pre_word_en,
|
||||
eeprom_offset);
|
||||
PLTFM_MSG_TRACE("[TRACE]proc_pg => efuse_end = 0x%x\n", adapter->efuse_end);
|
||||
if (status != HALMAC_RET_SUCCESS) {
|
||||
PLTFM_MSG_ERR("[ERR]extend efuse");
|
||||
return status;
|
||||
@@ -2517,12 +2471,6 @@ get_h2c_ack_phy_efuse_88xx(struct halmac_adapter *adapter, u8 *buf, u32 size)
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
u32
|
||||
get_rsvd_efuse_size_88xx(struct halmac_adapter *adapter)
|
||||
{
|
||||
return adapter->hw_cfg_info.prtct_efuse_size;
|
||||
}
|
||||
|
||||
/**
|
||||
* write_wifi_phy_efuse_88xx() - write wifi physical efuse
|
||||
* @adapter : the adapter of halmac
|
||||
@@ -3070,4 +3018,74 @@ super_usb_re_pg_chk_88xx(struct halmac_adapter *adapter, u8 *phy_map, u8 *re_pg)
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HALMAC_88XX_SUPPORT
|
||||
|
||||
/**
|
||||
* cfg_efuse_auto_check_88xx() - check efuse after writing it
|
||||
* @adapter : the adapter of halmac
|
||||
* @enable : 1, enable efuse auto check. others, disable
|
||||
* Author : Soar
|
||||
* Return : enum halmac_ret_status
|
||||
* More details of status code can be found in prototype document
|
||||
*/
|
||||
enum halmac_ret_status
|
||||
cfg_efuse_auto_check_88xx(struct halmac_adapter *adapter, u8 enable)
|
||||
{
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
adapter->efuse_auto_check_en = enable;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_efuse_size_88xx() - get "physical" efuse size
|
||||
* @adapter : the adapter of halmac
|
||||
* @size : physical efuse size
|
||||
* Author : Ivan Lin/KaiYuan Chang
|
||||
* Return : enum halmac_ret_status
|
||||
* More details of status code can be found in prototype document
|
||||
*/
|
||||
enum halmac_ret_status
|
||||
get_efuse_size_88xx(struct halmac_adapter *adapter, u32 *size)
|
||||
{
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
*size = adapter->hw_cfg_info.efuse_size;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_log_efuse_size_88xx() - get "logical" efuse size
|
||||
* @adapter : the adapter of halmac
|
||||
* @size : logical efuse size
|
||||
* Author : Ivan Lin/KaiYuan Chang
|
||||
* Return : enum halmac_ret_status
|
||||
* More details of status code can be found in prototype document
|
||||
*/
|
||||
enum halmac_ret_status
|
||||
get_log_efuse_size_88xx(struct halmac_adapter *adapter, u32 *size)
|
||||
{
|
||||
PLTFM_MSG_TRACE("[TRACE]%s ===>\n", __func__);
|
||||
|
||||
*size = adapter->hw_cfg_info.eeprom_size;
|
||||
|
||||
PLTFM_MSG_TRACE("[TRACE]%s <===\n", __func__);
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
u32
|
||||
get_rsvd_efuse_size_88xx(struct halmac_adapter *adapter)
|
||||
{
|
||||
return adapter->hw_cfg_info.prtct_efuse_size;
|
||||
}
|
||||
|
||||
#endif /* HALMAC_88XX_SUPPORT */
|
||||
|
||||
@@ -49,6 +49,10 @@
|
||||
#include "halmac_8812f/halmac_init_8812f.h"
|
||||
#endif
|
||||
|
||||
#if HALMAC_8822E_SUPPORT
|
||||
#include "halmac_8822e/halmac_init_8822e.h"
|
||||
#endif
|
||||
|
||||
#if HALMAC_PLATFORM_TESTPROGRAM
|
||||
#include "halmisc_api_88xx.h"
|
||||
#endif
|
||||
@@ -137,6 +141,7 @@ init_adapter_param_88xx(struct halmac_adapter *adapter)
|
||||
adapter->sdio_hw_info.spec_ver = HALMAC_SDIO_SPEC_VER_2_00;
|
||||
adapter->sdio_hw_info.clock_speed = 50;
|
||||
adapter->sdio_hw_info.block_size = 512;
|
||||
adapter->sdio_hw_info.tx_512_by_byte_mode = 0;
|
||||
adapter->sdio_hw_info.tx_seq = 1;
|
||||
adapter->sdio_fs.macid_map = (u8 *)NULL;
|
||||
|
||||
@@ -216,20 +221,17 @@ mount_api_88xx(struct halmac_adapter *adapter)
|
||||
api->halmac_cfg_ch_bw = cfg_ch_bw_88xx;
|
||||
api->halmac_cfg_bw = cfg_bw_88xx;
|
||||
api->halmac_init_mac_cfg = init_mac_cfg_88xx;
|
||||
#if (HALMAC_8821C_SUPPORT || HALMAC_8822B_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
api->halmac_dump_efuse_map = dump_efuse_map_88xx;
|
||||
api->halmac_dump_efuse_map_bt = dump_efuse_map_bt_88xx;
|
||||
api->halmac_write_efuse_bt = write_efuse_bt_88xx;
|
||||
api->halmac_read_efuse_bt = read_efuse_bt_88xx;
|
||||
api->halmac_cfg_efuse_auto_check = cfg_efuse_auto_check_88xx;
|
||||
api->halmac_dump_logical_efuse_map = dump_log_efuse_map_88xx;
|
||||
api->halmac_dump_logical_efuse_mask = dump_log_efuse_mask_88xx;
|
||||
api->halmac_pg_efuse_by_map = pg_efuse_by_map_88xx;
|
||||
api->halmac_mask_logical_efuse = mask_log_efuse_88xx;
|
||||
api->halmac_get_efuse_size = get_efuse_size_88xx;
|
||||
api->halmac_get_efuse_available_size = get_efuse_available_size_88xx;
|
||||
api->halmac_get_c2h_info = get_c2h_info_88xx;
|
||||
|
||||
api->halmac_get_logical_efuse_size = get_log_efuse_size_88xx;
|
||||
|
||||
api->halmac_write_logical_efuse = write_log_efuse_88xx;
|
||||
api->halmac_write_logical_efuse_word = write_log_efuse_word_88xx;
|
||||
@@ -237,6 +239,14 @@ mount_api_88xx(struct halmac_adapter *adapter)
|
||||
|
||||
api->halmac_write_wifi_phy_efuse = write_wifi_phy_efuse_88xx;
|
||||
api->halmac_read_wifi_phy_efuse = read_wifi_phy_efuse_88xx;
|
||||
#endif
|
||||
#if HALMAC_88XX_SUPPORT
|
||||
api->halmac_cfg_efuse_auto_check = cfg_efuse_auto_check_88xx;
|
||||
api->halmac_get_efuse_size = get_efuse_size_88xx;
|
||||
api->halmac_get_logical_efuse_size = get_log_efuse_size_88xx;
|
||||
#endif
|
||||
|
||||
api->halmac_get_c2h_info = get_c2h_info_88xx;
|
||||
|
||||
api->halmac_ofld_func_cfg = ofld_func_cfg_88xx;
|
||||
api->halmac_h2c_lb = h2c_lb_88xx;
|
||||
@@ -399,6 +409,10 @@ mount_api_88xx(struct halmac_adapter *adapter)
|
||||
} else if (adapter->chip_id == HALMAC_CHIP_ID_8812F) {
|
||||
#if HALMAC_8812F_SUPPORT
|
||||
mount_api_8812f(adapter);
|
||||
#endif
|
||||
} else if (adapter->chip_id == HALMAC_CHIP_ID_8822E) {
|
||||
#if HALMAC_8822E_SUPPORT
|
||||
mount_api_8822e(adapter);
|
||||
#endif
|
||||
} else {
|
||||
PLTFM_MSG_ERR("[ERR]Chip ID undefine!!\n");
|
||||
|
||||
@@ -254,8 +254,10 @@ cfg_sounding_88xx(struct halmac_adapter *adapter, enum halmac_snd_role role,
|
||||
HALMAC_REG_W8(REG_SND_PTCL_CTRL + 3, 0x3A);
|
||||
HALMAC_REG_W8_CLR(REG_RXFLTMAP1, BIT(4));
|
||||
HALMAC_REG_W8_CLR(REG_RXFLTMAP4, BIT(4));
|
||||
#if (HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822C)
|
||||
#if (HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822C ||
|
||||
adapter->chip_id == HALMAC_CHIP_ID_8822E)
|
||||
HALMAC_REG_W32(REG_CSI_RRSR,
|
||||
BIT_CSI_RRSC_BITMAP(CSI_RATE_MAP) |
|
||||
BIT_OFDM_LEN_TH(0));
|
||||
@@ -333,8 +335,9 @@ su_bfee_entry_init_88xx(struct halmac_adapter *adapter, u8 userid, u16 paid)
|
||||
BIT_R_TXBF0_40M | BIT_R_TXBF0_80M);
|
||||
HALMAC_REG_W16(REG_TXBF_CTRL, tmp42c | paid);
|
||||
HALMAC_REG_W16(REG_ASSOCIATED_BFMEE_SEL, paid);
|
||||
#if HALMAC_8822C_SUPPORT
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822C)
|
||||
#if HALMAC_8822C_SUPPORT || HALMAC_8822E_SUPPORT
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822C ||
|
||||
adapter->chip_id == HALMAC_CHIP_ID_8822E)
|
||||
HALMAC_REG_W16(REG_ASSOCIATED_BFMEE_SEL, paid | BIT(9));
|
||||
#endif
|
||||
break;
|
||||
@@ -645,9 +648,10 @@ cfg_csi_rate_88xx(struct halmac_adapter *adapter, u8 rssi, u8 cur_rate,
|
||||
csi_cfg = HALMAC_REG_R32(REG_BBPSF_CTRL) & ~BITS_WMAC_CSI_RATE;
|
||||
#endif
|
||||
|
||||
#if (HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
#if (HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822C ||
|
||||
adapter->chip_id == HALMAC_CHIP_ID_8812F)
|
||||
adapter->chip_id == HALMAC_CHIP_ID_8812F ||
|
||||
adapter->chip_id == HALMAC_CHIP_ID_8822E)
|
||||
HALMAC_REG_W32_SET(REG_BBPSF_CTRL, BIT(15));
|
||||
#endif
|
||||
|
||||
|
||||
@@ -378,6 +378,7 @@ sdio_hw_info_88xx(struct halmac_adapter *adapter,
|
||||
adapter->sdio_hw_info.clock_speed = info->clock_speed;
|
||||
adapter->sdio_hw_info.spec_ver = info->spec_ver;
|
||||
adapter->sdio_hw_info.block_size = info->block_size;
|
||||
adapter->sdio_hw_info.tx_512_by_byte_mode = info->tx_512_by_byte_mode;
|
||||
|
||||
/*SW*/
|
||||
adapter->sdio_hw_info.io_warn_flag = info->io_warn_flag;
|
||||
@@ -461,11 +462,13 @@ leave_sdio_suspend_88xx(struct halmac_adapter *adapter)
|
||||
return HALMAC_RET_SDIO_LEAVE_SUSPEND_FAIL;
|
||||
}
|
||||
|
||||
value8 = HALMAC_REG_R8(REG_HCI_OPT_CTRL + 2);
|
||||
if (adapter->sdio_hw_info.spec_ver == HALMAC_SDIO_SPEC_VER_3_00)
|
||||
HALMAC_REG_W8(REG_HCI_OPT_CTRL + 2, value8 | BIT(2));
|
||||
else
|
||||
HALMAC_REG_W8(REG_HCI_OPT_CTRL + 2, value8 & ~(BIT(2)));
|
||||
if (adapter->chip_id != HALMAC_CHIP_ID_8822E) {
|
||||
value8 = HALMAC_REG_R8(REG_HCI_OPT_CTRL + 2);
|
||||
if (adapter->sdio_hw_info.spec_ver == HALMAC_SDIO_SPEC_VER_3_00)
|
||||
HALMAC_REG_W8(REG_HCI_OPT_CTRL + 2, value8 | BIT(2));
|
||||
else
|
||||
HALMAC_REG_W8(REG_HCI_OPT_CTRL + 2, value8 & ~(BIT(2)));
|
||||
}
|
||||
|
||||
return HALMAC_RET_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,10 @@
|
||||
#include "halmac_88xx/halmac_init_win8812f.h"
|
||||
#endif
|
||||
|
||||
#if HALMAC_8822E_SUPPORT
|
||||
#include "halmac_88xx/halmac_init_win8822e.h"
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#if HALMAC_88XX_SUPPORT
|
||||
@@ -71,6 +75,7 @@ enum chip_id_hw_def {
|
||||
CHIP_ID_HW_DEF_8814B = 0x11,
|
||||
CHIP_ID_HW_DEF_8822C = 0x13,
|
||||
CHIP_ID_HW_DEF_8812F = 0x14,
|
||||
CHIP_ID_HW_DEF_8822E = 0x17,
|
||||
CHIP_ID_HW_DEF_UNDEFINE = 0x7F,
|
||||
CHIP_ID_HW_DEF_PS = 0xEA,
|
||||
};
|
||||
@@ -179,7 +184,8 @@ halmac_init_adapter(void *drv_adapter, struct halmac_platform_api *pltfm_api,
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822B ||
|
||||
adapter->chip_id == HALMAC_CHIP_ID_8821C ||
|
||||
adapter->chip_id == HALMAC_CHIP_ID_8822C ||
|
||||
adapter->chip_id == HALMAC_CHIP_ID_8812F) {
|
||||
adapter->chip_id == HALMAC_CHIP_ID_8812F ||
|
||||
adapter->chip_id == HALMAC_CHIP_ID_8822E) {
|
||||
init_adapter_param_88xx(adapter);
|
||||
status = mount_api_88xx(adapter);
|
||||
}
|
||||
@@ -235,6 +241,13 @@ halmac_init_adapter(void *drv_adapter, struct halmac_platform_api *pltfm_api,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if HALMAC_8822E_SUPPORT
|
||||
if (adapter->chip_id == HALMAC_CHIP_ID_8822E) {
|
||||
init_adapter_param_win8822e(adapter);
|
||||
status = mount_api_win8822e(adapter);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
*halmac_api = (struct halmac_api *)adapter->halmac_api;
|
||||
|
||||
@@ -535,6 +548,8 @@ get_chip_info(void *drv_adapter, struct halmac_platform_api *pltfm_api,
|
||||
adapter->chip_id = HALMAC_CHIP_ID_8822C;
|
||||
} else if (chip_id == CHIP_ID_HW_DEF_8812F) {
|
||||
adapter->chip_id = HALMAC_CHIP_ID_8812F;
|
||||
} else if (chip_id == CHIP_ID_HW_DEF_8822E) {
|
||||
adapter->chip_id = HALMAC_CHIP_ID_8822E;
|
||||
} else {
|
||||
adapter->chip_id = HALMAC_CHIP_ID_UNDEFINE;
|
||||
PLTFM_MSG_ERR("[ERR]Chip id is undefined\n");
|
||||
|
||||
@@ -20,13 +20,14 @@
|
||||
|
||||
#define HALMAC_MAJOR_VER 1
|
||||
#define HALMAC_PROTOTYPE_VER 6
|
||||
#define HALMAC_MINOR_VER 6
|
||||
#define HALMAC_PATCH_VER 26
|
||||
#define HALMAC_MINOR_VER 7
|
||||
#define HALMAC_PATCH_VER 12
|
||||
|
||||
#define HALMAC_88XX_SUPPORT (HALMAC_8821C_SUPPORT || \
|
||||
HALMAC_8822B_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define HALMAC_88XX_V1_SUPPORT HALMAC_8814B_SUPPORT
|
||||
|
||||
@@ -76,6 +77,11 @@
|
||||
#include "halmac_bit_8812f.h"
|
||||
#endif
|
||||
|
||||
#if HALMAC_8822E_SUPPORT
|
||||
#include "halmac_reg_8822e.h"
|
||||
#include "halmac_bit_8822e.h"
|
||||
#endif
|
||||
|
||||
#if (HALMAC_PLATFORM_WINDOWS || HALMAC_PLATFORM_LINUX)
|
||||
#include "halmac_tx_desc_nic.h"
|
||||
#include "halmac_tx_desc_buffer_nic.h"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
22077
drivers/net/wireless/rtl8822cs/hal/halmac/halmac_bit_8822e.h
Normal file
22077
drivers/net/wireless/rtl8822cs/hal/halmac/halmac_bit_8822e.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -36,6 +36,7 @@
|
||||
#define HALMAC_GPIO14 14
|
||||
#define HALMAC_GPIO15 15
|
||||
#define HALMAC_GPIO_NUM 16
|
||||
#define HALMAC_EECS 17
|
||||
|
||||
/* GPIO type */
|
||||
#define HALMAC_GPIO_IN 0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2016 - 2018 Realtek Corporation. All rights reserved.
|
||||
* Copyright(c) 2016 - 2022 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License as
|
||||
@@ -184,6 +184,12 @@
|
||||
#define HALMAC_8812F_SUPPORT 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RTL8822E
|
||||
#define HALMAC_8822E_SUPPORT 1
|
||||
#else
|
||||
#define HALMAC_8822E_SUPPORT 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Interface support */
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
883
drivers/net/wireless/rtl8822cs/hal/halmac/halmac_reg_8822e.h
Normal file
883
drivers/net/wireless/rtl8822cs/hal/halmac/halmac_reg_8822e.h
Normal file
@@ -0,0 +1,883 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2017 - 2019 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of version 2 of the GNU General Public License 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 the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __INC_HALMAC_REG_8822E_H
|
||||
#define __INC_HALMAC_REG_8822E_H
|
||||
|
||||
#define REG_SYS_ISO_CTRL_8822E 0x0000
|
||||
#define REG_SYS_FUNC_EN_8822E 0x0002
|
||||
#define REG_SYS_PW_CTRL_8822E 0x0004
|
||||
#define REG_SYS_CLK_CTRL_8822E 0x0008
|
||||
#define REG_SYS_EEPROM_CTRL_8822E 0x000A
|
||||
#define REG_EE_VPD_8822E 0x000C
|
||||
#define REG_SYS_SWR_CTRL1_8822E 0x0010
|
||||
#define REG_SYS_SWR_CTRL2_8822E 0x0014
|
||||
#define REG_SYS_SWR_CTRL3_8822E 0x0018
|
||||
#define REG_RSV_CTRL_8822E 0x001C
|
||||
#define REG_RF_CTRL_8822E 0x001F
|
||||
#define REG_AFE_LDO_CTRL_8822E 0x0020
|
||||
#define REG_AFE_CTRL1_8822E 0x0024
|
||||
#define REG_ANAPARSW_POW_MAC_8822E 0x0028
|
||||
#define REG_ANAPARLDO_POW_MAC_8822E 0x0029
|
||||
#define REG_ANAPAR_POW_MAC_8822E 0x002A
|
||||
#define REG_ANAPAR_POW_XTAL_8822E 0x002B
|
||||
#define REG_ANAPARLDO_MAC_8822E 0x002C
|
||||
#define REG_EFUSE_CTRL_8822E 0x0030
|
||||
#define REG_LDO_EFUSE_CTRL_8822E 0x0034
|
||||
#define REG_PWR_OPTION_CTRL_8822E 0x0038
|
||||
#define REG_CAL_TIMER_8822E 0x003C
|
||||
#define REG_ACLK_MON_8822E 0x003E
|
||||
#define REG_GPIO_MUXCFG_2_8822E 0x003F
|
||||
#define REG_GPIO_MUXCFG_8822E 0x0040
|
||||
#define REG_GPIO_PIN_CTRL_8822E 0x0044
|
||||
#define REG_GPIO_INTM_8822E 0x0048
|
||||
#define REG_LED_CFG_8822E 0x004C
|
||||
#define REG_FSIMR_8822E 0x0050
|
||||
#define REG_FSISR_8822E 0x0054
|
||||
#define REG_HSIMR_8822E 0x0058
|
||||
#define REG_HSISR_8822E 0x005C
|
||||
#define REG_GPIO_EXT_CTRL_8822E 0x0060
|
||||
#define REG_PAD_CTRL1_8822E 0x0064
|
||||
#define REG_WL_BT_PWR_CTRL_8822E 0x0068
|
||||
#define REG_SDM_DEBUG_8822E 0x006C
|
||||
#define REG_SYS_SDIO_CTRL_8822E 0x0070
|
||||
#define REG_HCI_OPT_CTRL_8822E 0x0074
|
||||
#define REG_HCI_BG_CTRL_8822E 0x0078
|
||||
#define REG_HCI_LDO_CTRL_8822E 0x007A
|
||||
#define REG_LDO_SWR_CTRL_8822E 0x007C
|
||||
#define REG_MCUFW_CTRL_8822E 0x0080
|
||||
#define REG_MCU_TST_CFG_8822E 0x0084
|
||||
#define REG_HMEBOX_E0_E1_8822E 0x0088
|
||||
#define REG_HMEBOX_E2_E3_8822E 0x008C
|
||||
#define REG_WLLPS_CTRL_8822E 0x0090
|
||||
#define REG_GPIO_DEBOUNCE_CTRL_8822E 0x0098
|
||||
#define REG_RPWM2_8822E 0x009C
|
||||
#define REG_SYSON_FSM_MON_8822E 0x00A0
|
||||
#define REG_EFUSE_CTRL_1_8822E 0x00A4
|
||||
#define REG_PMC_DBG_CTRL1_8822E 0x00A8
|
||||
#define REG_HIMR0_8822E 0x00B0
|
||||
#define REG_HISR0_8822E 0x00B4
|
||||
#define REG_HIMR1_8822E 0x00B8
|
||||
#define REG_HISR1_8822E 0x00BC
|
||||
#define REG_DBG_PORT_SEL_8822E 0x00C0
|
||||
#define REG_PAD_CTRL2_8822E 0x00C4
|
||||
#define REG_PMC_DBG_CTRL2_8822E 0x00CC
|
||||
#define REG_BIST_CTRL_8822E 0x00D0
|
||||
#define REG_BIST_RPT_8822E 0x00D4
|
||||
#define REG_MEM_CTRL_8822E 0x00D8
|
||||
#define REG_USB_SIE_INTF_8822E 0x00E0
|
||||
#define REG_PCIE_MIO_INTF_8822E 0x00E4
|
||||
#define REG_PCIE_MIO_INTD_8822E 0x00E8
|
||||
#define REG_WLRF1_8822E 0x00EC
|
||||
#define REG_SYS_CFG1_8822E 0x00F0
|
||||
#define REG_SYS_STATUS1_8822E 0x00F4
|
||||
#define REG_SYS_STATUS2_8822E 0x00F8
|
||||
#define REG_SYS_CFG2_8822E 0x00FC
|
||||
#define REG_SYS_CFG3_8822E 0x1000
|
||||
#define REG_ANAPARSW_MAC_0_8822E 0x1010
|
||||
#define REG_ANAPARSW_MAC_1_8822E 0x1014
|
||||
#define REG_ANAPAR_MAC_0_8822E 0x1018
|
||||
#define REG_ANAPAR_MAC_1_8822E 0x101C
|
||||
#define REG_ANAPAR_MAC_2_8822E 0x1020
|
||||
#define REG_ANAPAR_MAC_3_8822E 0x1024
|
||||
#define REG_ANAPARSW_MAC_2_8822E 0x1028
|
||||
#define REG_ANAPAR_XTAL_0_8822E 0x1040
|
||||
#define REG_ANAPAR_XTAL_1_8822E 0x1044
|
||||
#define REG_ANAPAR_XTAL_2_8822E 0x1048
|
||||
#define REG_ANAPAR_XTAL_3_8822E 0x104C
|
||||
#define REG_ANAPAR_XTAL_AACK_0_8822E 0x1054
|
||||
#define REG_ANAPAR_XTAL_AACK_1_8822E 0x1058
|
||||
#define REG_XTAL_AAC_OUTPUT_8822E 0x1060
|
||||
#define REG_ANAPAR_XTAL_MODE_DECODER_8822E 0x1064
|
||||
#define REG_ANAPAR_XTAL_CAP_CTRL_8822E 0x106C
|
||||
#define REG_SYS_CFG5_8822E 0x1070
|
||||
#define REG_CPU_DMEM_CON_8822E 0x1080
|
||||
#define REG_BOOT_REASON_8822E 0x1088
|
||||
#define REG_HIMR2_8822E 0x10B0
|
||||
#define REG_HISR2_8822E 0x10B4
|
||||
#define REG_HIMR3_8822E 0x10B8
|
||||
#define REG_HISR3_8822E 0x10BC
|
||||
#define REG_SW_MDIO_8822E 0x10C0
|
||||
#define REG_H2C_PKT_READADDR_8822E 0x10D0
|
||||
#define REG_H2C_PKT_WRITEADDR_8822E 0x10D4
|
||||
#define REG_MEM_PWR_CRTL_8822E 0x10D8
|
||||
#define REG_FW_DBG6_8822E 0x10F8
|
||||
#define REG_FW_DBG7_8822E 0x10FC
|
||||
#define REG_CR_8822E 0x0100
|
||||
#define REG_PG_SIZE_8822E 0x0104
|
||||
#define REG_PKT_BUFF_ACCESS_CTRL_8822E 0x0106
|
||||
#define REG_TSF_CLK_STATE_8822E 0x0108
|
||||
#define REG_TXDMA_PQ_MAP_8822E 0x010C
|
||||
#define REG_TRXFF_BNDY_8822E 0x0114
|
||||
#define REG_PTA_I2C_MBOX_8822E 0x0118
|
||||
#define REG_RXFF_BNDY_8822E 0x011C
|
||||
#define REG_FE1IMR_8822E 0x0120
|
||||
#define REG_FE1ISR_8822E 0x0124
|
||||
#define REG_CPWM_8822E 0x012C
|
||||
#define REG_FWIMR_8822E 0x0130
|
||||
#define REG_FWISR_8822E 0x0134
|
||||
#define REG_FTIMR_8822E 0x0138
|
||||
#define REG_FTISR_8822E 0x013C
|
||||
#define REG_PKTBUF_DBG_CTRL_8822E 0x0140
|
||||
#define REG_PKTBUF_DBG_DATA_L_8822E 0x0144
|
||||
#define REG_PKTBUF_DBG_DATA_H_8822E 0x0148
|
||||
#define REG_CPWM2_8822E 0x014C
|
||||
#define REG_TC0_CTRL_8822E 0x0150
|
||||
#define REG_TC1_CTRL_8822E 0x0154
|
||||
#define REG_TC2_CTRL_8822E 0x0158
|
||||
#define REG_TC3_CTRL_8822E 0x015C
|
||||
#define REG_TC4_CTRL_8822E 0x0160
|
||||
#define REG_TCUNIT_BASE_8822E 0x0164
|
||||
#define REG_TC5_CTRL_8822E 0x0168
|
||||
#define REG_TC6_CTRL_8822E 0x016C
|
||||
#define REG_MBIST_DRF_FAIL_8822E 0x0170
|
||||
#define REG_MBIST_START_PAUSE_8822E 0x0174
|
||||
#define REG_MBIST_DONE_8822E 0x0178
|
||||
#define REG_OTP_PARA_8822E 0x017C
|
||||
#define REG_AES_DECRPT_DATA_8822E 0x0180
|
||||
#define REG_AES_DECRPT_CFG_8822E 0x0184
|
||||
#define REG_HIOE_CTRL_8822E 0x0188
|
||||
#define REG_HIOE_CFG_FILE_8822E 0x018C
|
||||
#define REG_TMETER_8822E 0x0190
|
||||
#define REG_OSC_32K_CTRL_8822E 0x0194
|
||||
#define REG_32K_CAL_REG1_8822E 0x0198
|
||||
#define REG_C2HEVT_8822E 0x01A0
|
||||
#define REG_C2HEVT_1_8822E 0x01A4
|
||||
#define REG_C2HEVT_2_8822E 0x01A8
|
||||
#define REG_C2HEVT_3_8822E 0x01AC
|
||||
#define REG_SW_DEFINED_PAGE1_8822E 0x01B8
|
||||
#define REG_SW_DEFINED_PAGE2_8822E 0x01BC
|
||||
#define REG_MCUTST_I_8822E 0x01C0
|
||||
#define REG_MCUTST_II_8822E 0x01C4
|
||||
#define REG_FMETHR_8822E 0x01C8
|
||||
#define REG_HMETFR_8822E 0x01CC
|
||||
#define REG_HMEBOX0_8822E 0x01D0
|
||||
#define REG_HMEBOX1_8822E 0x01D4
|
||||
#define REG_HMEBOX2_8822E 0x01D8
|
||||
#define REG_HMEBOX3_8822E 0x01DC
|
||||
#define REG_BB_ACCESS_CTRL_8822E 0x01E8
|
||||
#define REG_BB_ACCESS_DATA_8822E 0x01EC
|
||||
#define REG_HMEBOX_E0_8822E 0x01F0
|
||||
#define REG_HMEBOX_E1_8822E 0x01F4
|
||||
#define REG_HMEBOX_E2_8822E 0x01F8
|
||||
#define REG_HMEBOX_E3_8822E 0x01FC
|
||||
#define REG_CR_EXT_8822E 0x1100
|
||||
#define REG_FWFF_8822E 0x1114
|
||||
#define REG_RXFF_PTR_V1_8822E 0x1118
|
||||
#define REG_RXFF_WTR_V1_8822E 0x111C
|
||||
#define REG_FE2IMR_8822E 0x1120
|
||||
#define REG_FE2ISR_8822E 0x1124
|
||||
#define REG_FE3IMR_8822E 0x1128
|
||||
#define REG_FE3ISR_8822E 0x112C
|
||||
#define REG_FE4IMR_8822E 0x1130
|
||||
#define REG_FE4ISR_8822E 0x1134
|
||||
#define REG_FT1IMR_8822E 0x1138
|
||||
#define REG_FT1ISR_8822E 0x113C
|
||||
#define REG_SPWR0_8822E 0x1140
|
||||
#define REG_SPWR1_8822E 0x1144
|
||||
#define REG_SPWR2_8822E 0x1148
|
||||
#define REG_SPWR3_8822E 0x114C
|
||||
#define REG_POWSEQ_8822E 0x1150
|
||||
#define REG_TC7_CTRL_V1_8822E 0x1158
|
||||
#define REG_TC8_CTRL_V1_8822E 0x115C
|
||||
#define REG_RX_BCN_TBTT_ITVL0_8822E 0x1160
|
||||
#define REG_RX_BCN_TBTT_ITVL1_8822E 0x1164
|
||||
#define REG_IO_WRAP_ERR_FLAG_8822E 0x1170
|
||||
#define REG_SPEED_SENSOR_8822E 0x1180
|
||||
#define REG_SPEED_SENSOR1_8822E 0x1184
|
||||
#define REG_SPEED_SENSOR2_8822E 0x1188
|
||||
#define REG_SPEED_SENSOR3_8822E 0x118C
|
||||
#define REG_SPEED_SENSOR4_8822E 0x1190
|
||||
#define REG_SPEED_SENSOR5_8822E 0x1194
|
||||
#define REG_EXT_QUEUE_REG_8822E 0x11C0
|
||||
#define REG_COUNTER_CTRL_8822E 0x11C4
|
||||
#define REG_COUNTER_THRESHOLD_8822E 0x11C8
|
||||
#define REG_COUNTER_SET_8822E 0x11CC
|
||||
#define REG_COUNTER_OVERFLOW_8822E 0x11D0
|
||||
#define REG_TXDMA_LEN_THRESHOLD_8822E 0x11D4
|
||||
#define REG_RXDMA_LEN_THRESHOLD_8822E 0x11D8
|
||||
#define REG_PCIE_EXEC_TIME_THRESHOLD_8822E 0x11DC
|
||||
#define REG_FT2IMR_8822E 0x11E0
|
||||
#define REG_FT2ISR_8822E 0x11E4
|
||||
#define REG_MSG2_8822E 0x11F0
|
||||
#define REG_MSG3_8822E 0x11F4
|
||||
#define REG_MSG4_8822E 0x11F8
|
||||
#define REG_MSG5_8822E 0x11FC
|
||||
#define REG_FIFOPAGE_CTRL_1_8822E 0x0200
|
||||
#define REG_FIFOPAGE_CTRL_2_8822E 0x0204
|
||||
#define REG_AUTO_LLT_V1_8822E 0x0208
|
||||
#define REG_TXDMA_OFFSET_CHK_8822E 0x020C
|
||||
#define REG_TXDMA_STATUS_8822E 0x0210
|
||||
#define REG_TX_DMA_DBG_8822E 0x0214
|
||||
#define REG_TQPNT1_8822E 0x0218
|
||||
#define REG_TQPNT2_8822E 0x021C
|
||||
#define REG_TQPNT3_8822E 0x0220
|
||||
#define REG_TQPNT4_8822E 0x0224
|
||||
#define REG_RQPN_CTRL_1_8822E 0x0228
|
||||
#define REG_RQPN_CTRL_2_8822E 0x022C
|
||||
#define REG_FIFOPAGE_INFO_1_8822E 0x0230
|
||||
#define REG_FIFOPAGE_INFO_2_8822E 0x0234
|
||||
#define REG_FIFOPAGE_INFO_3_8822E 0x0238
|
||||
#define REG_FIFOPAGE_INFO_4_8822E 0x023C
|
||||
#define REG_FIFOPAGE_INFO_5_8822E 0x0240
|
||||
#define REG_H2C_HEAD_8822E 0x0244
|
||||
#define REG_H2C_TAIL_8822E 0x0248
|
||||
#define REG_H2C_READ_ADDR_8822E 0x024C
|
||||
#define REG_H2C_WR_ADDR_8822E 0x0250
|
||||
#define REG_H2C_INFO_8822E 0x0254
|
||||
#define REG_PGSUB_CNT_8822E 0x026C
|
||||
#define REG_PGSUB_H_8822E 0x0270
|
||||
#define REG_PGSUB_N_8822E 0x0274
|
||||
#define REG_PGSUB_L_8822E 0x0278
|
||||
#define REG_PGSUB_E_8822E 0x027C
|
||||
#define REG_RXDMA_AGG_PG_TH_8822E 0x0280
|
||||
#define REG_RXPKT_NUM_8822E 0x0284
|
||||
#define REG_RXDMA_STATUS_8822E 0x0288
|
||||
#define REG_RXDMA_DPR_8822E 0x028C
|
||||
#define REG_RXDMA_MODE_8822E 0x0290
|
||||
#define REG_C2H_PKT_8822E 0x0294
|
||||
#define REG_FWFF_C2H_8822E 0x0298
|
||||
#define REG_FWFF_CTRL_8822E 0x029C
|
||||
#define REG_FWFF_PKT_INFO_8822E 0x02A0
|
||||
#define REG_RXPKTNUM_8822E 0x02B0
|
||||
#define REG_RXPKTNUM_TH_8822E 0x02B4
|
||||
#define REG_FW_MSG1_8822E 0x02E0
|
||||
#define REG_FW_MSG2_8822E 0x02E4
|
||||
#define REG_FW_MSG3_8822E 0x02E8
|
||||
#define REG_FW_MSG4_8822E 0x02EC
|
||||
#define REG_DDMA_CH0SA_8822E 0x1200
|
||||
#define REG_DDMA_CH0DA_8822E 0x1204
|
||||
#define REG_DDMA_CH0CTRL_8822E 0x1208
|
||||
#define REG_DDMA_CH1SA_8822E 0x1210
|
||||
#define REG_DDMA_CH1DA_8822E 0x1214
|
||||
#define REG_DDMA_CH1CTRL_8822E 0x1218
|
||||
#define REG_DDMA_CH2SA_8822E 0x1220
|
||||
#define REG_DDMA_CH2DA_8822E 0x1224
|
||||
#define REG_DDMA_CH2CTRL_8822E 0x1228
|
||||
#define REG_DDMA_CH3SA_8822E 0x1230
|
||||
#define REG_DDMA_CH3DA_8822E 0x1234
|
||||
#define REG_DDMA_CH3CTRL_8822E 0x1238
|
||||
#define REG_DDMA_CH4SA_8822E 0x1240
|
||||
#define REG_DDMA_CH4DA_8822E 0x1244
|
||||
#define REG_DDMA_CH4CTRL_8822E 0x1248
|
||||
#define REG_DDMA_CH5SA_8822E 0x1250
|
||||
#define REG_DDMA_CH5DA_8822E 0x1254
|
||||
#define REG_DDMA_CH5CTRL_8822E 0x1258
|
||||
#define REG_DDMA_INT_MSK_8822E 0x12E0
|
||||
#define REG_DDMA_CHSTATUS_8822E 0x12E8
|
||||
#define REG_DDMA_CHKSUM_8822E 0x12F0
|
||||
#define REG_DDMA_MONITOR_8822E 0x12FC
|
||||
#define REG_PCIE_CTRL_8822E 0x0300
|
||||
#define REG_INT_MIG_8822E 0x0304
|
||||
#define REG_BCNQ_TXBD_DESA_8822E 0x0308
|
||||
#define REG_MGQ_TXBD_DESA_8822E 0x0310
|
||||
#define REG_VOQ_TXBD_DESA_8822E 0x0318
|
||||
#define REG_VIQ_TXBD_DESA_8822E 0x0320
|
||||
#define REG_BEQ_TXBD_DESA_8822E 0x0328
|
||||
#define REG_BKQ_TXBD_DESA_8822E 0x0330
|
||||
#define REG_RXQ_RXBD_DESA_8822E 0x0338
|
||||
#define REG_HI0Q_TXBD_DESA_8822E 0x0340
|
||||
#define REG_HI1Q_TXBD_DESA_8822E 0x0348
|
||||
#define REG_HI2Q_TXBD_DESA_8822E 0x0350
|
||||
#define REG_HI3Q_TXBD_DESA_8822E 0x0358
|
||||
#define REG_HI4Q_TXBD_DESA_8822E 0x0360
|
||||
#define REG_HI5Q_TXBD_DESA_8822E 0x0368
|
||||
#define REG_HI6Q_TXBD_DESA_8822E 0x0370
|
||||
#define REG_HI7Q_TXBD_DESA_8822E 0x0378
|
||||
#define REG_MGQ_TXBD_NUM_8822E 0x0380
|
||||
#define REG_RX_RXBD_NUM_8822E 0x0382
|
||||
#define REG_VOQ_TXBD_NUM_8822E 0x0384
|
||||
#define REG_VIQ_TXBD_NUM_8822E 0x0386
|
||||
#define REG_BEQ_TXBD_NUM_8822E 0x0388
|
||||
#define REG_BKQ_TXBD_NUM_8822E 0x038A
|
||||
#define REG_HI0Q_TXBD_NUM_8822E 0x038C
|
||||
#define REG_HI1Q_TXBD_NUM_8822E 0x038E
|
||||
#define REG_HI2Q_TXBD_NUM_8822E 0x0390
|
||||
#define REG_HI3Q_TXBD_NUM_8822E 0x0392
|
||||
#define REG_HI4Q_TXBD_NUM_8822E 0x0394
|
||||
#define REG_HI5Q_TXBD_NUM_8822E 0x0396
|
||||
#define REG_HI6Q_TXBD_NUM_8822E 0x0398
|
||||
#define REG_HI7Q_TXBD_NUM_8822E 0x039A
|
||||
#define REG_TSFTIMER_HCI_8822E 0x039C
|
||||
#define REG_BD_RWPTR_CLR_8822E 0x039C
|
||||
#define REG_VOQ_TXBD_IDX_8822E 0x03A0
|
||||
#define REG_VIQ_TXBD_IDX_8822E 0x03A4
|
||||
#define REG_BEQ_TXBD_IDX_8822E 0x03A8
|
||||
#define REG_BKQ_TXBD_IDX_8822E 0x03AC
|
||||
#define REG_MGQ_TXBD_IDX_8822E 0x03B0
|
||||
#define REG_RXQ_RXBD_IDX_8822E 0x03B4
|
||||
#define REG_HI0Q_TXBD_IDX_8822E 0x03B8
|
||||
#define REG_HI1Q_TXBD_IDX_8822E 0x03BC
|
||||
#define REG_HI2Q_TXBD_IDX_8822E 0x03C0
|
||||
#define REG_HI3Q_TXBD_IDX_8822E 0x03C4
|
||||
#define REG_HI4Q_TXBD_IDX_8822E 0x03C8
|
||||
#define REG_HI5Q_TXBD_IDX_8822E 0x03CC
|
||||
#define REG_HI6Q_TXBD_IDX_8822E 0x03D0
|
||||
#define REG_HI7Q_TXBD_IDX_8822E 0x03D4
|
||||
#define REG_DBG_SEL_V1_8822E 0x03D8
|
||||
#define REG_PCIE_HRPWM1_V1_8822E 0x03D9
|
||||
#define REG_PCIE_HCPWM1_V1_8822E 0x03DA
|
||||
#define REG_PCIE_CTRL2_8822E 0x03DB
|
||||
#define REG_PCIE_HRPWM2_V1_8822E 0x03DC
|
||||
#define REG_PCIE_HCPWM2_V1_8822E 0x03DE
|
||||
#define REG_PCIE_H2C_MSG_V1_8822E 0x03E0
|
||||
#define REG_PCIE_C2H_MSG_V1_8822E 0x03E4
|
||||
#define REG_DBI_WDATA_V1_8822E 0x03E8
|
||||
#define REG_DBI_RDATA_V1_8822E 0x03EC
|
||||
#define REG_DBI_FLAG_V1_8822E 0x03F0
|
||||
#define REG_MDIO_V1_8822E 0x03F4
|
||||
#define REG_PCIE_MIX_CFG_8822E 0x03F8
|
||||
#define REG_HCI_MIX_CFG_8822E 0x03FC
|
||||
#define REG_STC_INT_CS_8822E 0x1300
|
||||
#define REG_ST_INT_CFG_8822E 0x1304
|
||||
#define REG_H2CQ_TXBD_DESA_8822E 0x1320
|
||||
#define REG_H2CQ_TXBD_NUM_8822E 0x1328
|
||||
#define REG_H2CQ_TXBD_IDX_8822E 0x132C
|
||||
#define REG_H2CQ_CSR_8822E 0x1330
|
||||
#define REG_CHANGE_PCIE_SPEED_8822E 0x1350
|
||||
#define REG_DEBUG_STATE1_8822E 0x1354
|
||||
#define REG_DEBUG_STATE2_8822E 0x1358
|
||||
#define REG_DEBUG_STATE3_8822E 0x135C
|
||||
#define REG_CHNL_DMA_CFG_V1_8822E 0x137C
|
||||
#define REG_PCIE_HISR0_V1_8822E 0x13B4
|
||||
#define REG_PCIE_HISR1_V1_8822E 0x13BC
|
||||
#define REG_PCIE_HISR2_V1_8822E 0x23B4
|
||||
#define REG_PCIE_HISR3_V1_8822E 0x23BC
|
||||
#define REG_Q0_INFO_8822E 0x0400
|
||||
#define REG_Q1_INFO_8822E 0x0404
|
||||
#define REG_Q2_INFO_8822E 0x0408
|
||||
#define REG_Q3_INFO_8822E 0x040C
|
||||
#define REG_MGQ_INFO_8822E 0x0410
|
||||
#define REG_HIQ_INFO_8822E 0x0414
|
||||
#define REG_BCNQ_INFO_8822E 0x0418
|
||||
#define REG_TXPKT_EMPTY_8822E 0x041A
|
||||
#define REG_CPU_MGQ_INFO_8822E 0x041C
|
||||
#define REG_FWHW_TXQ_CTRL_8822E 0x0420
|
||||
#define REG_DATAFB_SEL_8822E 0x0423
|
||||
#define REG_BCNQ_BDNY_V1_8822E 0x0424
|
||||
#define REG_LIFETIME_EN_8822E 0x0426
|
||||
#define REG_SPEC_SIFS_8822E 0x0428
|
||||
#define REG_RETRY_LIMIT_8822E 0x042A
|
||||
#define REG_TXBF_CTRL_8822E 0x042C
|
||||
#define REG_DARFRC_8822E 0x0430
|
||||
#define REG_DARFRCH_8822E 0x0434
|
||||
#define REG_RARFRC_8822E 0x0438
|
||||
#define REG_RARFRCH_8822E 0x043C
|
||||
#define REG_RRSR_8822E 0x0440
|
||||
#define REG_ARFR0_8822E 0x0444
|
||||
#define REG_ARFRH0_8822E 0x0448
|
||||
#define REG_ARFR1_V1_8822E 0x044C
|
||||
#define REG_ARFRH1_V1_8822E 0x0450
|
||||
#define REG_CCK_CHECK_8822E 0x0454
|
||||
#define REG_AMPDU_MAX_TIME_V1_8822E 0x0455
|
||||
#define REG_BCNQ1_BDNY_V1_8822E 0x0456
|
||||
#define REG_AMPDU_MAX_LENGTH_HT_8822E 0x0458
|
||||
#define REG_ACQ_STOP_8822E 0x045C
|
||||
#define REG_NDPA_RATE_8822E 0x045D
|
||||
#define REG_TX_HANG_CTRL_8822E 0x045E
|
||||
#define REG_NDPA_OPT_CTRL_8822E 0x045F
|
||||
#define REG_AMPDU_MAX_LENGTH_VHT_8822E 0x0460
|
||||
#define REG_RD_RESP_PKT_TH_8822E 0x0463
|
||||
#define REG_CMDQ_INFO_8822E 0x0464
|
||||
#define REG_Q4_INFO_8822E 0x0468
|
||||
#define REG_Q5_INFO_8822E 0x046C
|
||||
#define REG_Q6_INFO_8822E 0x0470
|
||||
#define REG_Q7_INFO_8822E 0x0474
|
||||
#define REG_WMAC_LBK_BUF_HD_V1_8822E 0x0478
|
||||
#define REG_MGQ_BDNY_V1_8822E 0x047A
|
||||
#define REG_TXRPT_CTRL_8822E 0x047C
|
||||
#define REG_INIRTS_RATE_SEL_8822E 0x0480
|
||||
#define REG_BASIC_CFEND_RATE_8822E 0x0481
|
||||
#define REG_STBC_CFEND_RATE_8822E 0x0482
|
||||
#define REG_DATA_SC_8822E 0x0483
|
||||
#define REG_MACID_SLEEP3_8822E 0x0484
|
||||
#define REG_MACID_SLEEP1_8822E 0x0488
|
||||
#define REG_ARFR2_V1_8822E 0x048C
|
||||
#define REG_ARFRH2_V1_8822E 0x0490
|
||||
#define REG_ARFR3_V1_8822E 0x0494
|
||||
#define REG_ARFRH3_V1_8822E 0x0498
|
||||
#define REG_ARFR4_8822E 0x049C
|
||||
#define REG_ARFRH4_8822E 0x04A0
|
||||
#define REG_ARFR5_8822E 0x04A4
|
||||
#define REG_ARFRH5_8822E 0x04A8
|
||||
#define REG_TXRPT_START_OFFSET_8822E 0x04AC
|
||||
#define REG_POWER_STAGE1_8822E 0x04B4
|
||||
#define REG_POWER_STAGE2_8822E 0x04B8
|
||||
#define REG_SW_AMPDU_BURST_MODE_CTRL_8822E 0x04BC
|
||||
#define REG_PKT_LIFE_TIME_8822E 0x04C0
|
||||
#define REG_STBC_SETTING_8822E 0x04C4
|
||||
#define REG_STBC_SETTING2_8822E 0x04C5
|
||||
#define REG_QUEUE_CTRL_8822E 0x04C6
|
||||
#define REG_SINGLE_AMPDU_CTRL_8822E 0x04C7
|
||||
#define REG_PROT_MODE_CTRL_8822E 0x04C8
|
||||
#define REG_BAR_MODE_CTRL_8822E 0x04CC
|
||||
#define REG_RA_TRY_RATE_AGG_LMT_8822E 0x04CF
|
||||
#define REG_MACID_SLEEP2_8822E 0x04D0
|
||||
#define REG_MACID_SLEEP_8822E 0x04D4
|
||||
#define REG_HW_SEQ0_8822E 0x04D8
|
||||
#define REG_HW_SEQ1_8822E 0x04DA
|
||||
#define REG_HW_SEQ2_8822E 0x04DC
|
||||
#define REG_HW_SEQ3_8822E 0x04DE
|
||||
#define REG_NULL_PKT_STATUS_V1_8822E 0x04E0
|
||||
#define REG_PTCL_ERR_STATUS_8822E 0x04E2
|
||||
#define REG_NULL_PKT_STATUS_EXTEND_8822E 0x04E3
|
||||
#define REG_HQMGQ_DROP_8822E 0x04E4
|
||||
#define REG_PRECNT_CTRL_8822E 0x04E5
|
||||
#define REG_BT_POLLUTE_PKT_CNT_8822E 0x04E8
|
||||
#define REG_PTCL_DBG_8822E 0x04EC
|
||||
#define REG_CPUMGQ_TIMER_CTRL2_8822E 0x04F4
|
||||
#define REG_DUMMY_PAGE4_V1_8822E 0x04FC
|
||||
#define REG_MOREDATA_8822E 0x04FE
|
||||
#define REG_Q0_Q1_INFO_8822E 0x1400
|
||||
#define REG_Q2_Q3_INFO_8822E 0x1404
|
||||
#define REG_Q4_Q5_INFO_8822E 0x1408
|
||||
#define REG_Q6_Q7_INFO_8822E 0x140C
|
||||
#define REG_MGQ_HIQ_INFO_8822E 0x1410
|
||||
#define REG_CMDQ_BCNQ_INFO_8822E 0x1414
|
||||
#define REG_LOOPBACK_OPTION_8822E 0x1420
|
||||
#define REG_AESIV_SETTING_8822E 0x1424
|
||||
#define REG_BF0_TIME_SETTING_8822E 0x1428
|
||||
#define REG_BF1_TIME_SETTING_8822E 0x142C
|
||||
#define REG_BF_TIMEOUT_EN_8822E 0x1430
|
||||
#define REG_MACID_RELEASE0_8822E 0x1434
|
||||
#define REG_MACID_RELEASE1_8822E 0x1438
|
||||
#define REG_MACID_RELEASE2_8822E 0x143C
|
||||
#define REG_MACID_RELEASE3_8822E 0x1440
|
||||
#define REG_MACID_RELEASE_SETTING_8822E 0x1444
|
||||
#define REG_FAST_EDCA_VOVI_SETTING_8822E 0x1448
|
||||
#define REG_FAST_EDCA_BEBK_SETTING_8822E 0x144C
|
||||
#define REG_MACID_DROP0_8822E 0x1450
|
||||
#define REG_MACID_DROP1_8822E 0x1454
|
||||
#define REG_MACID_DROP2_8822E 0x1458
|
||||
#define REG_MACID_DROP3_8822E 0x145C
|
||||
#define REG_R_MACID_RELEASE_SUCCESS_0_8822E 0x1460
|
||||
#define REG_R_MACID_RELEASE_SUCCESS_1_8822E 0x1464
|
||||
#define REG_R_MACID_RELEASE_SUCCESS_2_8822E 0x1468
|
||||
#define REG_R_MACID_RELEASE_SUCCESS_3_8822E 0x146C
|
||||
#define REG_MGQ_FIFO_WRITE_POINTER_8822E 0x1470
|
||||
#define REG_MGQ_FIFO_READ_POINTER_8822E 0x1472
|
||||
#define REG_MGQ_FIFO_ENABLE_8822E 0x1472
|
||||
#define REG_MGQ_FIFO_RELEASE_INT_MASK_8822E 0x1474
|
||||
#define REG_MGQ_FIFO_RELEASE_INT_FLAG_8822E 0x1476
|
||||
#define REG_MGQ_FIFO_VALID_MAP_8822E 0x1478
|
||||
#define REG_MGQ_FIFO_LIFETIME_8822E 0x147A
|
||||
#define REG_R_MACID_RELEASE_SUCCESS_CLEAR_OFFSET_8822E 0x147C
|
||||
#define REG_SHCUT_SETTING_8822E 0x1480
|
||||
#define REG_SHCUT_LLC_ETH_TYPE0_8822E 0x1484
|
||||
#define REG_SHCUT_LLC_ETH_TYPE1_8822E 0x1488
|
||||
#define REG_SHCUT_LLC_OUI0_8822E 0x148C
|
||||
#define REG_SHCUT_LLC_OUI1_8822E 0x1490
|
||||
#define REG_SHCUT_LLC_OUI2_8822E 0x1494
|
||||
#define REG_MU_TX_CTL_8822E 0x14C0
|
||||
#define REG_MU_STA_GID_VLD_8822E 0x14C4
|
||||
#define REG_MU_STA_USER_POS_INFO_8822E 0x14C8
|
||||
#define REG_MU_STA_USER_POS_INFO_H_8822E 0x14CC
|
||||
#define REG_CHNL_INFO_CTRL_8822E 0x14D0
|
||||
#define REG_CHNL_IDLE_TIME_8822E 0x14D4
|
||||
#define REG_CHNL_BUSY_TIME_8822E 0x14D8
|
||||
#define REG_MU_TRX_DBG_CNT_V1_8822E 0x14DC
|
||||
#define REG_EDCA_VO_PARAM_8822E 0x0500
|
||||
#define REG_EDCA_VI_PARAM_8822E 0x0504
|
||||
#define REG_EDCA_BE_PARAM_8822E 0x0508
|
||||
#define REG_EDCA_BK_PARAM_8822E 0x050C
|
||||
#define REG_BCNTCFG_8822E 0x0510
|
||||
#define REG_PIFS_8822E 0x0512
|
||||
#define REG_RDG_PIFS_8822E 0x0513
|
||||
#define REG_SIFS_8822E 0x0514
|
||||
#define REG_TSFTR_SYN_OFFSET_8822E 0x0518
|
||||
#define REG_AGGR_BREAK_TIME_8822E 0x051A
|
||||
#define REG_SLOT_8822E 0x051B
|
||||
#define REG_NOA_ON_ERLY_TIME_8822E 0x051C
|
||||
#define REG_NOA_OFF_ERLY_TIME_8822E 0x051D
|
||||
#define REG_TX_PTCL_CTRL_8822E 0x0520
|
||||
#define REG_TXPAUSE_8822E 0x0522
|
||||
#define REG_DIS_TXREQ_CLR_8822E 0x0523
|
||||
#define REG_RD_CTRL_8822E 0x0524
|
||||
#define REG_MBSSID_CTRL_8822E 0x0526
|
||||
#define REG_P2PPS_CTRL_8822E 0x0527
|
||||
#define REG_PKT_LIFETIME_CTRL_8822E 0x0528
|
||||
#define REG_P2PPS_SPEC_STATE_8822E 0x052B
|
||||
#define REG_TXOP_LIMIT_CTRL_8822E 0x052C
|
||||
#define REG_BAR_TX_CTRL_8822E 0x0530
|
||||
#define REG_P2PON_DIS_TXTIME_8822E 0x0531
|
||||
#define REG_CCA_TXEN_CNT_8822E 0x0534
|
||||
#define REG_MAX_INTER_COLLISION_8822E 0x0538
|
||||
#define REG_MAX_INTER_COLLISION_CNT_8822E 0x053C
|
||||
#define REG_TBTT_PROHIBIT_8822E 0x0540
|
||||
#define REG_P2PPS_STATE_8822E 0x0543
|
||||
#define REG_RD_NAV_NXT_8822E 0x0544
|
||||
#define REG_NAV_PROT_LEN_8822E 0x0546
|
||||
#define REG_FTM_PTT_8822E 0x0548
|
||||
#define REG_FTM_TSF_8822E 0x054C
|
||||
#define REG_BCN_CTRL_8822E 0x0550
|
||||
#define REG_BCN_CTRL_CLINT0_8822E 0x0551
|
||||
#define REG_MBID_NUM_8822E 0x0552
|
||||
#define REG_DUAL_TSF_RST_8822E 0x0553
|
||||
#define REG_MBSSID_BCN_SPACE_8822E 0x0554
|
||||
#define REG_DRVERLYINT_8822E 0x0558
|
||||
#define REG_BCNDMATIM_8822E 0x0559
|
||||
#define REG_ATIMWND_8822E 0x055A
|
||||
#define REG_USTIME_TSF_8822E 0x055C
|
||||
#define REG_BCN_MAX_ERR_8822E 0x055D
|
||||
#define REG_RXTSF_OFFSET_CCK_8822E 0x055E
|
||||
#define REG_RXTSF_OFFSET_OFDM_8822E 0x055F
|
||||
#define REG_TSFTR_8822E 0x0560
|
||||
#define REG_TSFTR_1_8822E 0x0564
|
||||
#define REG_FREERUN_CNT_8822E 0x0568
|
||||
#define REG_FREERUN_CNT_1_8822E 0x056C
|
||||
#define REG_ATIMWND1_V1_8822E 0x0570
|
||||
#define REG_TBTT_PROHIBIT_INFRA_8822E 0x0571
|
||||
#define REG_CTWND_8822E 0x0572
|
||||
#define REG_BCNIVLCUNT_8822E 0x0573
|
||||
#define REG_BCNDROPCTRL_8822E 0x0574
|
||||
#define REG_HGQ_TIMEOUT_PERIOD_8822E 0x0575
|
||||
#define REG_TXCMD_TIMEOUT_PERIOD_8822E 0x0576
|
||||
#define REG_MISC_CTRL_8822E 0x0577
|
||||
#define REG_BCN_CTRL_CLINT1_8822E 0x0578
|
||||
#define REG_BCN_CTRL_CLINT2_8822E 0x0579
|
||||
#define REG_BCN_CTRL_CLINT3_8822E 0x057A
|
||||
#define REG_EXTEND_CTRL_8822E 0x057B
|
||||
#define REG_P2PPS1_SPEC_STATE_8822E 0x057C
|
||||
#define REG_P2PPS1_STATE_8822E 0x057D
|
||||
#define REG_P2PPS2_SPEC_STATE_8822E 0x057E
|
||||
#define REG_P2PPS2_STATE_8822E 0x057F
|
||||
#define REG_PS_TIMER0_8822E 0x0580
|
||||
#define REG_PS_TIMER1_8822E 0x0584
|
||||
#define REG_PS_TIMER2_8822E 0x0588
|
||||
#define REG_TBTT_CTN_AREA_8822E 0x058C
|
||||
#define REG_FORCE_BCN_IFS_8822E 0x058E
|
||||
#define REG_TXOP_MIN_8822E 0x0590
|
||||
#define REG_PRE_BKF_TIME_8822E 0x0592
|
||||
#define REG_CROSS_TXOP_CTRL_8822E 0x0593
|
||||
#define REG_RX_TBTT_SHIFT_V1_8822E 0x0598
|
||||
#define REG_ATIMWND2_8822E 0x05A0
|
||||
#define REG_ATIMWND3_8822E 0x05A1
|
||||
#define REG_ATIMWND4_8822E 0x05A2
|
||||
#define REG_ATIMWND5_8822E 0x05A3
|
||||
#define REG_ATIMWND6_8822E 0x05A4
|
||||
#define REG_ATIMWND7_8822E 0x05A5
|
||||
#define REG_ATIMUGT_8822E 0x05A6
|
||||
#define REG_HIQ_NO_LMT_EN_8822E 0x05A7
|
||||
#define REG_DTIM_COUNTER_ROOT_8822E 0x05A8
|
||||
#define REG_DTIM_COUNTER_VAP1_8822E 0x05A9
|
||||
#define REG_DTIM_COUNTER_VAP2_8822E 0x05AA
|
||||
#define REG_DTIM_COUNTER_VAP3_8822E 0x05AB
|
||||
#define REG_DTIM_COUNTER_VAP4_8822E 0x05AC
|
||||
#define REG_DTIM_COUNTER_VAP5_8822E 0x05AD
|
||||
#define REG_DTIM_COUNTER_VAP6_8822E 0x05AE
|
||||
#define REG_DTIM_COUNTER_VAP7_8822E 0x05AF
|
||||
#define REG_DIS_ATIM_8822E 0x05B0
|
||||
#define REG_EARLY_128US_8822E 0x05B1
|
||||
#define REG_P2PPS1_CTRL_8822E 0x05B2
|
||||
#define REG_P2PPS2_CTRL_8822E 0x05B3
|
||||
#define REG_TIMER0_SRC_SEL_8822E 0x05B4
|
||||
#define REG_NOA_UNIT_SEL_8822E 0x05B5
|
||||
#define REG_P2POFF_DIS_TXTIME_8822E 0x05B7
|
||||
#define REG_MBSSID_BCN_SPACE2_8822E 0x05B8
|
||||
#define REG_MBSSID_BCN_SPACE3_8822E 0x05BC
|
||||
#define REG_ACMHWCTRL_8822E 0x05C0
|
||||
#define REG_ACMRSTCTRL_8822E 0x05C1
|
||||
#define REG_ACMAVG_8822E 0x05C2
|
||||
#define REG_VO_ADMTIME_8822E 0x05C4
|
||||
#define REG_VI_ADMTIME_8822E 0x05C6
|
||||
#define REG_BE_ADMTIME_8822E 0x05C8
|
||||
#define REG_MAC_HEADER_NAV_OFFSET_8822E 0x05CA
|
||||
#define REG_DIS_NDPA_NAV_CHECK_8822E 0x05CB
|
||||
#define REG_EDCA_RANDOM_GEN_8822E 0x05CC
|
||||
#define REG_TXCMD_NOA_SEL_8822E 0x05CF
|
||||
#define REG_32K_CLK_SEL_8822E 0x05D0
|
||||
#define REG_EARLYINT_ADJUST_8822E 0x05D4
|
||||
#define REG_BCNERR_CNT_8822E 0x05D8
|
||||
#define REG_BCNERR_CNT_2_8822E 0x05DC
|
||||
#define REG_NOA_PARAM_8822E 0x05E0
|
||||
#define REG_NOA_PARAM_1_8822E 0x05E4
|
||||
#define REG_NOA_PARAM_2_8822E 0x05E8
|
||||
#define REG_NOA_PARAM_3_8822E 0x05EC
|
||||
#define REG_P2P_RST_8822E 0x05F0
|
||||
#define REG_SCHEDULER_RST_8822E 0x05F1
|
||||
#define REG_SCH_DBG_VALUE_8822E 0x05F4
|
||||
#define REG_SCH_TXCMD_8822E 0x05F8
|
||||
#define REG_PAGE5_DUMMY_8822E 0x05FC
|
||||
#define REG_CPUMGQ_TX_TIMER_8822E 0x1500
|
||||
#define REG_PS_TIMER_A_8822E 0x1504
|
||||
#define REG_PS_TIMER_B_8822E 0x1508
|
||||
#define REG_PS_TIMER_C_8822E 0x150C
|
||||
#define REG_PS_TIMER_ABC_CPUMGQ_TIMER_CRTL_8822E 0x1510
|
||||
#define REG_CPUMGQ_TX_TIMER_EARLY_8822E 0x1514
|
||||
#define REG_PS_TIMER_A_EARLY_8822E 0x1515
|
||||
#define REG_PS_TIMER_B_EARLY_8822E 0x1516
|
||||
#define REG_PS_TIMER_C_EARLY_8822E 0x1517
|
||||
#define REG_CPUMGQ_PARAMETER_8822E 0x1518
|
||||
#define REG_TSF_SYNC_ADJ_8822E 0x1520
|
||||
#define REG_TSF_ADJ_VLAUE_8822E 0x1524
|
||||
#define REG_TSF_ADJ_VLAUE_2_8822E 0x1528
|
||||
#define REG_P2PPS_HW_AUTO_PAUSE_CTRL_8822E 0x156C
|
||||
#define REG_P2PPS1_HW_AUTO_PAUSE_CTRL_8822E 0x1570
|
||||
#define REG_P2PPS2_HW_AUTO_PAUSE_CTRL_8822E 0x1574
|
||||
#define REG_SCHEDULER_COUNTER_8822E 0x15D0
|
||||
#define REG_WMAC_CR_8822E 0x0600
|
||||
#define REG_WMAC_FWPKT_CR_8822E 0x0601
|
||||
#define REG_FW_STS_FILTER_8822E 0x0602
|
||||
#define REG_TCR_8822E 0x0604
|
||||
#define REG_RCR_8822E 0x0608
|
||||
#define REG_RX_PKT_LIMIT_8822E 0x060C
|
||||
#define REG_RX_DLK_TIME_8822E 0x060D
|
||||
#define REG_RX_DRVINFO_SZ_8822E 0x060F
|
||||
#define REG_MACID_8822E 0x0610
|
||||
#define REG_MACID_H_8822E 0x0614
|
||||
#define REG_BSSID_8822E 0x0618
|
||||
#define REG_BSSID_H_8822E 0x061C
|
||||
#define REG_MAR_8822E 0x0620
|
||||
#define REG_MAR_H_8822E 0x0624
|
||||
#define REG_MBIDCAMCFG_1_8822E 0x0628
|
||||
#define REG_MBIDCAMCFG_2_8822E 0x062C
|
||||
#define REG_WMAC_TCR_TSFT_OFS_8822E 0x0630
|
||||
#define REG_UDF_THSD_8822E 0x0632
|
||||
#define REG_ZLD_NUM_8822E 0x0633
|
||||
#define REG_STMP_THSD_8822E 0x0634
|
||||
#define REG_WMAC_TXTIMEOUT_8822E 0x0635
|
||||
#define REG_USTIME_EDCA_8822E 0x0638
|
||||
#define REG_ACKTO_CCK_8822E 0x0639
|
||||
#define REG_MAC_SPEC_SIFS_8822E 0x063A
|
||||
#define REG_RESP_SIFS_CCK_8822E 0x063C
|
||||
#define REG_RESP_SIFS_OFDM_8822E 0x063E
|
||||
#define REG_ACKTO_8822E 0x0640
|
||||
#define REG_CTS2TO_8822E 0x0641
|
||||
#define REG_EIFS_8822E 0x0642
|
||||
#define REG_RPFM_MAP0_8822E 0x0644
|
||||
#define REG_RPFM_MAP1_V1_8822E 0x0646
|
||||
#define REG_RPFM_CAM_CMD_8822E 0x0648
|
||||
#define REG_RPFM_CAM_RWD_8822E 0x064C
|
||||
#define REG_NAV_CTRL_8822E 0x0650
|
||||
#define REG_BACAMCMD_8822E 0x0654
|
||||
#define REG_BACAMCONTENT_8822E 0x0658
|
||||
#define REG_BACAMCONTENT_H_8822E 0x065C
|
||||
#define REG_LBDLY_8822E 0x0660
|
||||
#define REG_WMAC_BACAM_RPMEN_8822E 0x0661
|
||||
#define REG_TX_RX_8822E 0x0662
|
||||
#define REG_WMAC_BITMAP_CTL_8822E 0x0663
|
||||
#define REG_RXERR_RPT_8822E 0x0664
|
||||
#define REG_WMAC_TRXPTCL_CTL_8822E 0x0668
|
||||
#define REG_WMAC_TRXPTCL_CTL_H_8822E 0x066C
|
||||
#define REG_CAMCMD_8822E 0x0670
|
||||
#define REG_CAMWRITE_8822E 0x0674
|
||||
#define REG_CAMREAD_8822E 0x0678
|
||||
#define REG_CAMDBG_8822E 0x067C
|
||||
#define REG_SECCFG_8822E 0x0680
|
||||
#define REG_RXFILTER_CATEGORY_1_8822E 0x0682
|
||||
#define REG_RXFILTER_ACTION_1_8822E 0x0683
|
||||
#define REG_RXFILTER_CATEGORY_2_8822E 0x0684
|
||||
#define REG_RXFILTER_ACTION_2_8822E 0x0685
|
||||
#define REG_RXFILTER_CATEGORY_3_8822E 0x0686
|
||||
#define REG_RXFILTER_ACTION_3_8822E 0x0687
|
||||
#define REG_RXFLTMAP3_8822E 0x0688
|
||||
#define REG_RXFLTMAP4_8822E 0x068A
|
||||
#define REG_RXFLTMAP5_8822E 0x068C
|
||||
#define REG_RXFLTMAP6_8822E 0x068E
|
||||
#define REG_WOW_CTRL_8822E 0x0690
|
||||
#define REG_NAN_RX_TSF_FILTER_8822E 0x0691
|
||||
#define REG_PS_RX_INFO_8822E 0x0692
|
||||
#define REG_WMMPS_UAPSD_TID_8822E 0x0693
|
||||
#define REG_RRSR_CTS_8822E 0x0694
|
||||
#define REG_WKFMCAM_CMD_8822E 0x0698
|
||||
#define REG_WKFMCAM_RWD_8822E 0x069C
|
||||
#define REG_RXFLTMAP0_8822E 0x06A0
|
||||
#define REG_RXFLTMAP1_8822E 0x06A2
|
||||
#define REG_RXFLTMAP2_8822E 0x06A4
|
||||
#define REG_BCN_PSR_RPT_8822E 0x06A8
|
||||
#define REG_FLC_RPC_8822E 0x06AC
|
||||
#define REG_FLC_RPCT_8822E 0x06AD
|
||||
#define REG_FLC_PTS_8822E 0x06AE
|
||||
#define REG_FLC_TRPC_8822E 0x06AF
|
||||
#define REG_RXPKTMON_CTRL_8822E 0x06B0
|
||||
#define REG_STATE_MON_8822E 0x06B4
|
||||
#define REG_ERROR_MON_8822E 0x06B8
|
||||
#define REG_SEARCH_MACID_8822E 0x06BC
|
||||
#define REG_BT_COEX_TABLE_8822E 0x06C0
|
||||
#define REG_BT_COEX_TABLE2_8822E 0x06C4
|
||||
#define REG_BT_COEX_BREAK_TABLE_8822E 0x06C8
|
||||
#define REG_BT_COEX_TABLE_H_8822E 0x06CC
|
||||
#define REG_RXCMD_0_8822E 0x06D0
|
||||
#define REG_RXCMD_1_8822E 0x06D4
|
||||
#define REG_WMAC_RESP_TXINFO_8822E 0x06D8
|
||||
#define REG_BBPSF_CTRL_8822E 0x06DC
|
||||
#define REG_P2P_RX_BCN_NOA_8822E 0x06E0
|
||||
#define REG_ASSOCIATED_BFMER0_INFO_8822E 0x06E4
|
||||
#define REG_ASSOCIATED_BFMER0_INFO_H_8822E 0x06E8
|
||||
#define REG_ASSOCIATED_BFMER1_INFO_8822E 0x06EC
|
||||
#define REG_ASSOCIATED_BFMER1_INFO_H_8822E 0x06F0
|
||||
#define REG_TX_CSI_RPT_PARAM_BW20_8822E 0x06F4
|
||||
#define REG_TX_CSI_RPT_PARAM_BW40_8822E 0x06F8
|
||||
#define REG_CSI_PTR_8822E 0x06FC
|
||||
#define REG_BCN_PSR_RPT2_8822E 0x1600
|
||||
#define REG_BCN_PSR_RPT3_8822E 0x1604
|
||||
#define REG_BCN_PSR_RPT4_8822E 0x1608
|
||||
#define REG_A1_ADDR_MASK_8822E 0x160C
|
||||
#define REG_RXPSF_CTRL_8822E 0x1610
|
||||
#define REG_RXPSF_TYPE_CTRL_8822E 0x1614
|
||||
#define REG_CAM_ACCESS_CTRL_8822E 0x1618
|
||||
#define REG_HT_SND_REF_RATE_8822E 0x161C
|
||||
#define REG_MACID2_8822E 0x1620
|
||||
#define REG_MACID2_H_8822E 0x1624
|
||||
#define REG_BSSID2_8822E 0x1628
|
||||
#define REG_BSSID2_H_8822E 0x162C
|
||||
#define REG_MACID3_8822E 0x1630
|
||||
#define REG_MACID3_H_8822E 0x1634
|
||||
#define REG_BSSID3_8822E 0x1638
|
||||
#define REG_BSSID3_H_8822E 0x163C
|
||||
#define REG_MACID4_8822E 0x1640
|
||||
#define REG_MACID4_H_8822E 0x1644
|
||||
#define REG_BSSID4_8822E 0x1648
|
||||
#define REG_BSSID4_H_8822E 0x164C
|
||||
#define REG_NOA_REPORT_8822E 0x1650
|
||||
#define REG_NOA_REPORT_1_8822E 0x1654
|
||||
#define REG_NOA_REPORT_2_8822E 0x1658
|
||||
#define REG_NOA_REPORT_3_8822E 0x165C
|
||||
#define REG_PWRBIT_SETTING_8822E 0x1660
|
||||
#define REG_GENERAL_OPTION_8822E 0x1664
|
||||
#define REG_CSI_RRSR_8822E 0x1678
|
||||
#define REG_MU_BF_OPTION_8822E 0x167C
|
||||
#define REG_WMAC_PAUSE_BB_CLR_TH_8822E 0x167D
|
||||
#define REG__WMAC_MULBK_BUF_8822E 0x167E
|
||||
#define REG_WMAC_MU_OPTION_8822E 0x167F
|
||||
#define REG_WMAC_MU_BF_CTL_8822E 0x1680
|
||||
#define REG_WMAC_MU_BFRPT_PARA_8822E 0x1682
|
||||
#define REG_WMAC_ASSOCIATED_MU_BFMEE2_8822E 0x1684
|
||||
#define REG_WMAC_ASSOCIATED_MU_BFMEE3_8822E 0x1686
|
||||
#define REG_WMAC_ASSOCIATED_MU_BFMEE4_8822E 0x1688
|
||||
#define REG_WMAC_ASSOCIATED_MU_BFMEE5_8822E 0x168A
|
||||
#define REG_WMAC_ASSOCIATED_MU_BFMEE6_8822E 0x168C
|
||||
#define REG_WMAC_ASSOCIATED_MU_BFMEE7_8822E 0x168E
|
||||
#define REG_WMAC_BB_STOP_RX_COUNTER_8822E 0x1690
|
||||
#define REG_WMAC_PLCP_MONITOR_8822E 0x1694
|
||||
#define REG_WMAC_PLCP_MONITOR_MUTX_8822E 0x1698
|
||||
#define REG_WMAC_CSIDMA_CFG_8822E 0x169C
|
||||
#define REG_TRANSMIT_ADDRSS_0_8822E 0x16A0
|
||||
#define REG_TRANSMIT_ADDRSS_0_H_8822E 0x16A4
|
||||
#define REG_TRANSMIT_ADDRSS_1_8822E 0x16A8
|
||||
#define REG_TRANSMIT_ADDRSS_1_H_8822E 0x16AC
|
||||
#define REG_TRANSMIT_ADDRSS_2_8822E 0x16B0
|
||||
#define REG_TRANSMIT_ADDRSS_2_H_8822E 0x16B4
|
||||
#define REG_TRANSMIT_ADDRSS_3_8822E 0x16B8
|
||||
#define REG_TRANSMIT_ADDRSS_3_H_8822E 0x16BC
|
||||
#define REG_TRANSMIT_ADDRSS_4_8822E 0x16C0
|
||||
#define REG_TRANSMIT_ADDRSS_4_H_8822E 0x16C4
|
||||
#define REG_MACID1_8822E 0x0700
|
||||
#define REG_MACID1_1_8822E 0x0704
|
||||
#define REG_BSSID1_8822E 0x0708
|
||||
#define REG_BSSID1_1_8822E 0x070C
|
||||
#define REG_BCN_PSR_RPT1_8822E 0x0710
|
||||
#define REG_ASSOCIATED_BFMEE_SEL_8822E 0x0714
|
||||
#define REG_SND_PTCL_CTRL_8822E 0x0718
|
||||
#define REG_RX_CSI_RPT_INFO_8822E 0x071C
|
||||
#define REG_NS_ARP_CTRL_8822E 0x0720
|
||||
#define REG_NS_ARP_INFO_8822E 0x0724
|
||||
#define REG_BEAMFORMING_INFO_NSARP_V1_8822E 0x0728
|
||||
#define REG_BEAMFORMING_INFO_NSARP_8822E 0x072C
|
||||
#define REG_IPV6_8822E 0x0730
|
||||
#define REG_IPV6_1_8822E 0x0734
|
||||
#define REG_IPV6_2_8822E 0x0738
|
||||
#define REG_IPV6_3_8822E 0x073C
|
||||
#define REG_WMAC_RTX_CTX_SUBTYPE_CFG_8822E 0x0750
|
||||
#define REG_WMAC_SWAES_DIO_B63_B32_8822E 0x0754
|
||||
#define REG_WMAC_SWAES_DIO_B95_B64_8822E 0x0758
|
||||
#define REG_WMAC_SWAES_DIO_B127_B96_8822E 0x075C
|
||||
#define REG_WMAC_SWAES_CFG_8822E 0x0760
|
||||
#define REG_BT_COEX_V2_8822E 0x0762
|
||||
#define REG_BT_COEX_8822E 0x0764
|
||||
#define REG_WLAN_ACT_MASK_CTRL_8822E 0x0768
|
||||
#define REG_WLAN_ACT_MASK_CTRL_1_8822E 0x076C
|
||||
#define REG_BT_COEX_ENHANCED_INTR_CTRL_8822E 0x076E
|
||||
#define REG_BT_ACT_STATISTICS_8822E 0x0770
|
||||
#define REG_BT_ACT_STATISTICS_1_8822E 0x0774
|
||||
#define REG_BT_STATISTICS_CONTROL_REGISTER_8822E 0x0778
|
||||
#define REG_BT_STATUS_REPORT_REGISTER_8822E 0x077C
|
||||
#define REG_BT_INTERRUPT_CONTROL_REGISTER_8822E 0x0780
|
||||
#define REG_WLAN_REPORT_TIME_OUT_CONTROL_REGISTER_8822E 0x0784
|
||||
#define REG_BT_ISOLATION_TABLE_REGISTER_REGISTER_8822E 0x0785
|
||||
#define REG_BT_ISOLATION_TABLE_REGISTER_REGISTER_1_8822E 0x0788
|
||||
#define REG_BT_ISOLATION_TABLE_REGISTER_REGISTER_2_8822E 0x078C
|
||||
#define REG_BT_INTERRUPT_STATUS_REGISTER_8822E 0x078F
|
||||
#define REG_BT_TDMA_TIME_REGISTER_8822E 0x0790
|
||||
#define REG_BT_ACT_REGISTER_8822E 0x0794
|
||||
#define REG_OBFF_CTRL_BASIC_8822E 0x0798
|
||||
#define REG_OBFF_CTRL2_TIMER_8822E 0x079C
|
||||
#define REG_LTR_CTRL_BASIC_8822E 0x07A0
|
||||
#define REG_LTR_CTRL2_TIMER_THRESHOLD_8822E 0x07A4
|
||||
#define REG_LTR_IDLE_LATENCY_V1_8822E 0x07A8
|
||||
#define REG_LTR_ACTIVE_LATENCY_V1_8822E 0x07AC
|
||||
#define REG_ANTENNA_TRAINING_CONTROL_REGISTER_8822E 0x07B0
|
||||
#define REG_ANTENNA_TRAINING_CONTROL_REGISTER_1_8822E 0x07B4
|
||||
#define REG_WMAC_PKTCNT_RWD_8822E 0x07B8
|
||||
#define REG_WMAC_PKTCNT_CTRL_8822E 0x07BC
|
||||
#define REG_IQ_DUMP_8822E 0x07C0
|
||||
#define REG_IQ_DUMP_1_8822E 0x07C4
|
||||
#define REG_IQ_DUMP_2_8822E 0x07C8
|
||||
#define REG_WMAC_FTM_CTL_8822E 0x07CC
|
||||
#define REG_WMAC_IQ_MDPK_FUNC_8822E 0x07CE
|
||||
#define REG_WMAC_OPTION_FUNCTION_8822E 0x07D0
|
||||
#define REG_WMAC_OPTION_FUNCTION_1_8822E 0x07D4
|
||||
#define REG_WMAC_OPTION_FUNCTION_2_8822E 0x07D8
|
||||
#define REG_RX_FILTER_FUNCTION_8822E 0x07DA
|
||||
#define REG_NDP_SIG_8822E 0x07E0
|
||||
#define REG_TXCMD_INFO_FOR_RSP_PKT_8822E 0x07E4
|
||||
#define REG_TXCMD_INFO_FOR_RSP_PKT_1_8822E 0x07E8
|
||||
#define REG_WSEC_OPTION_8822E 0x07EC
|
||||
#define REG_RTS_ADDRESS_0_8822E 0x07F0
|
||||
#define REG_RTS_ADDRESS_0_1_8822E 0x07F4
|
||||
#define REG_RTS_ADDRESS_1_8822E 0x07F8
|
||||
#define REG_RTS_ADDRESS_1_1_8822E 0x07FC
|
||||
#define REG_WL2LTECOEX_INDIRECT_ACCESS_CTRL_V1_8822E 0x1700
|
||||
#define REG_WL2LTECOEX_INDIRECT_ACCESS_WRITE_DATA_V1_8822E 0x1704
|
||||
#define REG_WL2LTECOEX_INDIRECT_ACCESS_READ_DATA_V1_8822E 0x1708
|
||||
#define REG_SDIO_TX_CTRL_8822E 0x10250000
|
||||
#define REG_SDIO_CMD11_VOL_SWITCH_8822E 0x10250004
|
||||
#define REG_SDIO_CTRL_8822E 0x10250005
|
||||
#define REG_SDIO_DRIVING_8822E 0x10250006
|
||||
#define REG_SDIO_MONITOR_8822E 0x10250008
|
||||
#define REG_SDIO_MONITOR_2_8822E 0x1025000C
|
||||
#define REG_SDIO_HIMR_8822E 0x10250014
|
||||
#define REG_SDIO_HISR_8822E 0x10250018
|
||||
#define REG_SDIO_RX_REQ_LEN_8822E 0x1025001C
|
||||
#define REG_SDIO_FREE_TXPG_SEQ_V1_8822E 0x1025001F
|
||||
#define REG_SDIO_FREE_TXPG_8822E 0x10250020
|
||||
#define REG_SDIO_FREE_TXPG2_8822E 0x10250024
|
||||
#define REG_SDIO_OQT_FREE_TXPG_V1_8822E 0x10250028
|
||||
#define REG_SDIO_TXPKT_EMPTY_8822E 0x1025002C
|
||||
#define REG_SDIO_HTSFR_INFO_8822E 0x10250030
|
||||
#define REG_SDIO_HCPWM1_V2_8822E 0x10250038
|
||||
#define REG_SDIO_HCPWM2_V2_8822E 0x1025003A
|
||||
#define REG_SDIO_INDIRECT_REG_CFG_8822E 0x10250040
|
||||
#define REG_SDIO_INDIRECT_REG_DATA_8822E 0x10250044
|
||||
#define REG_SDIO_H2C_8822E 0x10250060
|
||||
#define REG_SDIO_C2H_8822E 0x10250064
|
||||
#define REG_SDIO_HRPWM1_8822E 0x10250080
|
||||
#define REG_SDIO_HRPWM2_8822E 0x10250082
|
||||
#define REG_SDIO_HPS_CLKR_8822E 0x10250084
|
||||
#define REG_SDIO_BUS_CTRL_8822E 0x10250085
|
||||
#define REG_SDIO_HSUS_CTRL_8822E 0x10250086
|
||||
#define REG_SDIO_RESPONSE_TIMER_8822E 0x10250088
|
||||
#define REG_SDIO_CMD_CRC_8822E 0x1025008A
|
||||
#define REG_SDIO_HSISR_8822E 0x10250090
|
||||
#define REG_SDIO_HSIMR_8822E 0x10250091
|
||||
#define REG_SDIO_DIOERR_RPT_8822E 0x102500C0
|
||||
#define REG_SDIO_CMD_ERRCNT_8822E 0x102500C2
|
||||
#define REG_SDIO_DATA_ERRCNT_8822E 0x102500C3
|
||||
#define REG_SDIO_CMD_ERR_CONTENT_8822E 0x102500C4
|
||||
#define REG_SDIO_CRC_ERR_IDX_8822E 0x102500C9
|
||||
#define REG_SDIO_DATA_CRC_8822E 0x102500CA
|
||||
#define REG_SDIO_TRANS_FIFO_STATUS_8822E 0x102500CC
|
||||
|
||||
#endif
|
||||
@@ -16,8 +16,9 @@
|
||||
#ifndef _HALMAC_RX_BD_NIC_H_
|
||||
#define _HALMAC_RX_BD_NIC_H_
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT ||\
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8814B_SUPPORT)
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8814B_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
/*TXBD_DW0*/
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
#define _HALMAC_RX_DESC_AP_H_
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
/*RXDESC_WORD0*/
|
||||
|
||||
@@ -29,7 +30,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PHYPKTIDC(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword0, 0x1, \
|
||||
@@ -48,7 +49,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_SWDEC(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword0, 0x1, \
|
||||
@@ -91,7 +92,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_TY_PE(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0x3, \
|
||||
@@ -110,7 +112,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_MF(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0x1, \
|
||||
@@ -126,7 +128,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PAM(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0x1, \
|
||||
@@ -144,7 +147,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_CHK_VLD(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0x1, \
|
||||
@@ -163,7 +167,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_IS_TCP_UDP(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0x1, \
|
||||
@@ -176,7 +180,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_CHKERR(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0x1, \
|
||||
@@ -200,7 +205,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PAGGR(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0x1, \
|
||||
@@ -218,7 +224,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RXID_MATCH(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0x1, \
|
||||
@@ -237,7 +244,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_AMSDU(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0x1, \
|
||||
@@ -247,7 +254,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_MACID_VLD(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0x1, \
|
||||
@@ -258,7 +266,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_TID(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0xf, 8)
|
||||
@@ -267,7 +275,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_MACID(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword1, 0x7f, \
|
||||
@@ -291,7 +300,7 @@
|
||||
|
||||
#if (HALMAC_8822B_SUPPORT || HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || \
|
||||
HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || \
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PPDU_CNT(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword2, 0x3, \
|
||||
@@ -302,7 +311,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_C2H(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword2, 0x1, \
|
||||
@@ -319,7 +328,8 @@
|
||||
#endif
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_HWRSVD(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword2, 0xf, \
|
||||
@@ -338,7 +348,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_WLANHD_IV_LEN(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword2, 0x3f, \
|
||||
@@ -354,7 +364,8 @@
|
||||
|
||||
#endif
|
||||
|
||||
#if (HALMAC_8822C_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
#if (HALMAC_8822C_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_STATISTICS(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword2, 0x1, \
|
||||
@@ -364,7 +375,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_IS_QOS(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword2, 0x1, \
|
||||
@@ -383,7 +395,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_FRAG(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword2, 0xf, \
|
||||
@@ -396,7 +408,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
/*RXDESC_WORD3*/
|
||||
|
||||
@@ -411,7 +424,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PATTERN_MATCH(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword3, 0x1, \
|
||||
@@ -428,7 +441,8 @@
|
||||
#endif
|
||||
|
||||
#if (HALMAC_8822B_SUPPORT || HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || \
|
||||
HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RXPAYLOAD_MATCH(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword3, 0x1, \
|
||||
@@ -442,7 +456,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_DMA_AGG_NUM(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword3, 0xff, \
|
||||
@@ -452,7 +466,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_BSSID_FIT_1_0(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword3, 0x3, \
|
||||
@@ -474,7 +489,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_HTC(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword3, 0x1, \
|
||||
@@ -493,7 +508,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_BSSID_FIT_4_2(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword3, 0x7, 7)
|
||||
@@ -510,7 +525,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_RATE(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword3, 0x7f, \
|
||||
@@ -520,7 +535,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
/*RXDESC_WORD4*/
|
||||
|
||||
@@ -556,7 +571,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_MACID_RPT_BUFF(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword4, 0x7f, \
|
||||
@@ -566,7 +582,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_PRE_NDP_VLD(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword4, 0x1, \
|
||||
@@ -603,7 +619,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_SCRAMBLER(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword4, 0x7f, \
|
||||
@@ -643,7 +659,8 @@
|
||||
#endif
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8821C_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PATTERN_IDX(rxdesc) \
|
||||
HALMAC_GET_DESC_FIELD(((struct halmac_rx_desc *)rxdesc)->dword4, 0xff, \
|
||||
@@ -669,7 +686,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
/*RXDESC_WORD5*/
|
||||
|
||||
|
||||
@@ -859,4 +859,91 @@
|
||||
|
||||
#endif
|
||||
|
||||
#if (HALMAC_8822E_SUPPORT)
|
||||
|
||||
/*RXDESC_WORD0*/
|
||||
|
||||
#define GET_RX_DESC_EOR_8822E(rxdesc) GET_RX_DESC_EOR(rxdesc)
|
||||
#define GET_RX_DESC_PHYPKTIDC_8822E(rxdesc) GET_RX_DESC_PHYPKTIDC(rxdesc)
|
||||
#define GET_RX_DESC_SWDEC_8822E(rxdesc) GET_RX_DESC_SWDEC(rxdesc)
|
||||
#define GET_RX_DESC_PHYST_8822E(rxdesc) GET_RX_DESC_PHYST(rxdesc)
|
||||
#define GET_RX_DESC_SHIFT_8822E(rxdesc) GET_RX_DESC_SHIFT(rxdesc)
|
||||
#define GET_RX_DESC_QOS_8822E(rxdesc) GET_RX_DESC_QOS(rxdesc)
|
||||
#define GET_RX_DESC_SECURITY_8822E(rxdesc) GET_RX_DESC_SECURITY(rxdesc)
|
||||
#define GET_RX_DESC_DRV_INFO_SIZE_8822E(rxdesc) \
|
||||
GET_RX_DESC_DRV_INFO_SIZE(rxdesc)
|
||||
#define GET_RX_DESC_ICV_ERR_8822E(rxdesc) GET_RX_DESC_ICV_ERR(rxdesc)
|
||||
#define GET_RX_DESC_CRC32_8822E(rxdesc) GET_RX_DESC_CRC32(rxdesc)
|
||||
#define GET_RX_DESC_PKT_LEN_8822E(rxdesc) GET_RX_DESC_PKT_LEN(rxdesc)
|
||||
|
||||
/*RXDESC_WORD1*/
|
||||
|
||||
#define GET_RX_DESC_BC_8822E(rxdesc) GET_RX_DESC_BC(rxdesc)
|
||||
#define GET_RX_DESC_MC_8822E(rxdesc) GET_RX_DESC_MC(rxdesc)
|
||||
#define GET_RX_DESC_TY_PE_8822E(rxdesc) GET_RX_DESC_TY_PE(rxdesc)
|
||||
#define GET_RX_DESC_MF_8822E(rxdesc) GET_RX_DESC_MF(rxdesc)
|
||||
#define GET_RX_DESC_MD_8822E(rxdesc) GET_RX_DESC_MD(rxdesc)
|
||||
#define GET_RX_DESC_PWR_8822E(rxdesc) GET_RX_DESC_PWR(rxdesc)
|
||||
#define GET_RX_DESC_PAM_8822E(rxdesc) GET_RX_DESC_PAM(rxdesc)
|
||||
#define GET_RX_DESC_CHK_VLD_8822E(rxdesc) GET_RX_DESC_CHK_VLD(rxdesc)
|
||||
#define GET_RX_DESC_RX_IS_TCP_UDP_8822E(rxdesc) \
|
||||
GET_RX_DESC_RX_IS_TCP_UDP(rxdesc)
|
||||
#define GET_RX_DESC_RX_IPV_8822E(rxdesc) GET_RX_DESC_RX_IPV(rxdesc)
|
||||
#define GET_RX_DESC_CHKERR_8822E(rxdesc) GET_RX_DESC_CHKERR(rxdesc)
|
||||
#define GET_RX_DESC_PAGGR_8822E(rxdesc) GET_RX_DESC_PAGGR(rxdesc)
|
||||
#define GET_RX_DESC_RXID_MATCH_8822E(rxdesc) GET_RX_DESC_RXID_MATCH(rxdesc)
|
||||
#define GET_RX_DESC_AMSDU_8822E(rxdesc) GET_RX_DESC_AMSDU(rxdesc)
|
||||
#define GET_RX_DESC_MACID_VLD_8822E(rxdesc) GET_RX_DESC_MACID_VLD(rxdesc)
|
||||
#define GET_RX_DESC_TID_8822E(rxdesc) GET_RX_DESC_TID(rxdesc)
|
||||
#define GET_RX_DESC_MACID_8822E(rxdesc) GET_RX_DESC_MACID(rxdesc)
|
||||
|
||||
/*RXDESC_WORD2*/
|
||||
|
||||
#define GET_RX_DESC_FCS_OK_8822E(rxdesc) GET_RX_DESC_FCS_OK(rxdesc)
|
||||
#define GET_RX_DESC_PPDU_CNT_8822E(rxdesc) GET_RX_DESC_PPDU_CNT(rxdesc)
|
||||
#define GET_RX_DESC_C2H_8822E(rxdesc) GET_RX_DESC_C2H(rxdesc)
|
||||
#define GET_RX_DESC_HWRSVD_8822E(rxdesc) GET_RX_DESC_HWRSVD(rxdesc)
|
||||
#define GET_RX_DESC_WLANHD_IV_LEN_8822E(rxdesc) \
|
||||
GET_RX_DESC_WLANHD_IV_LEN(rxdesc)
|
||||
#define GET_RX_DESC_RX_STATISTICS_8822E(rxdesc) \
|
||||
GET_RX_DESC_RX_STATISTICS(rxdesc)
|
||||
#define GET_RX_DESC_RX_IS_QOS_8822E(rxdesc) GET_RX_DESC_RX_IS_QOS(rxdesc)
|
||||
#define GET_RX_DESC_FRAG_8822E(rxdesc) GET_RX_DESC_FRAG(rxdesc)
|
||||
#define GET_RX_DESC_SEQ_8822E(rxdesc) GET_RX_DESC_SEQ(rxdesc)
|
||||
|
||||
/*RXDESC_WORD3*/
|
||||
|
||||
#define GET_RX_DESC_MAGIC_WAKE_8822E(rxdesc) GET_RX_DESC_MAGIC_WAKE(rxdesc)
|
||||
#define GET_RX_DESC_UNICAST_WAKE_8822E(rxdesc) GET_RX_DESC_UNICAST_WAKE(rxdesc)
|
||||
#define GET_RX_DESC_PATTERN_MATCH_8822E(rxdesc) \
|
||||
GET_RX_DESC_PATTERN_MATCH(rxdesc)
|
||||
#define GET_RX_DESC_RXPAYLOAD_MATCH_8822E(rxdesc) \
|
||||
GET_RX_DESC_RXPAYLOAD_MATCH(rxdesc)
|
||||
#define GET_RX_DESC_RXPAYLOAD_ID_8822E(rxdesc) GET_RX_DESC_RXPAYLOAD_ID(rxdesc)
|
||||
#define GET_RX_DESC_DMA_AGG_NUM_8822E(rxdesc) GET_RX_DESC_DMA_AGG_NUM(rxdesc)
|
||||
#define GET_RX_DESC_BSSID_FIT_1_0_8822E(rxdesc) \
|
||||
GET_RX_DESC_BSSID_FIT_1_0(rxdesc)
|
||||
#define GET_RX_DESC_EOSP_8822E(rxdesc) GET_RX_DESC_EOSP(rxdesc)
|
||||
#define GET_RX_DESC_HTC_8822E(rxdesc) GET_RX_DESC_HTC(rxdesc)
|
||||
#define GET_RX_DESC_BSSID_FIT_4_2_8822E(rxdesc) \
|
||||
GET_RX_DESC_BSSID_FIT_4_2(rxdesc)
|
||||
#define GET_RX_DESC_RX_RATE_8822E(rxdesc) GET_RX_DESC_RX_RATE(rxdesc)
|
||||
|
||||
/*RXDESC_WORD4*/
|
||||
|
||||
#define GET_RX_DESC_A1_FIT_8822E(rxdesc) GET_RX_DESC_A1_FIT(rxdesc)
|
||||
#define GET_RX_DESC_MACID_RPT_BUFF_8822E(rxdesc) \
|
||||
GET_RX_DESC_MACID_RPT_BUFF(rxdesc)
|
||||
#define GET_RX_DESC_RX_PRE_NDP_VLD_8822E(rxdesc) \
|
||||
GET_RX_DESC_RX_PRE_NDP_VLD(rxdesc)
|
||||
#define GET_RX_DESC_RX_SCRAMBLER_8822E(rxdesc) GET_RX_DESC_RX_SCRAMBLER(rxdesc)
|
||||
#define GET_RX_DESC_RX_EOF_8822E(rxdesc) GET_RX_DESC_RX_EOF(rxdesc)
|
||||
#define GET_RX_DESC_PATTERN_IDX_8822E(rxdesc) GET_RX_DESC_PATTERN_IDX(rxdesc)
|
||||
|
||||
/*RXDESC_WORD5*/
|
||||
|
||||
#define GET_RX_DESC_TSFL_8822E(rxdesc) GET_RX_DESC_TSFL(rxdesc)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
#define _HALMAC_RX_DESC_NIC_H_
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
/*RXDESC_WORD0*/
|
||||
|
||||
@@ -27,7 +28,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PHYPKTIDC(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x00, 28, 1)
|
||||
|
||||
@@ -42,7 +43,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_SWDEC(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x00, 27, 1)
|
||||
#define GET_RX_DESC_PHYST(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x00, 26, 1)
|
||||
@@ -63,7 +64,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_TY_PE(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 28, 2)
|
||||
|
||||
@@ -78,7 +80,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_MF(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 27, 1)
|
||||
#define GET_RX_DESC_MD(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 26, 1)
|
||||
@@ -88,7 +90,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PAM(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 24, 1)
|
||||
|
||||
@@ -102,7 +105,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_CHK_VLD(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 23, 1)
|
||||
|
||||
@@ -118,7 +122,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_IS_TCP_UDP(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 22, 1)
|
||||
#define GET_RX_DESC_RX_IPV(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 21, 1)
|
||||
@@ -127,7 +131,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_CHKERR(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 20, 1)
|
||||
|
||||
@@ -144,7 +149,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PAGGR(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 15, 1)
|
||||
|
||||
@@ -158,7 +164,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RXID_MATCH(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 14, 1)
|
||||
|
||||
@@ -173,7 +180,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_AMSDU(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 13, 1)
|
||||
|
||||
@@ -181,7 +188,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_MACID_VLD(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 12, 1)
|
||||
|
||||
@@ -190,7 +198,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_TID(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 8, 4)
|
||||
|
||||
@@ -198,7 +206,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_MACID(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x04, 0, 7)
|
||||
|
||||
@@ -216,7 +225,7 @@
|
||||
|
||||
#if (HALMAC_8822B_SUPPORT || HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || \
|
||||
HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || \
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PPDU_CNT(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x08, 29, 2)
|
||||
|
||||
@@ -225,7 +234,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_C2H(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x08, 28, 1)
|
||||
|
||||
@@ -238,7 +247,8 @@
|
||||
#endif
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_HWRSVD(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x08, 24, 4)
|
||||
|
||||
@@ -253,7 +263,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_WLANHD_IV_LEN(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x08, 18, 6)
|
||||
|
||||
@@ -265,7 +275,8 @@
|
||||
|
||||
#endif
|
||||
|
||||
#if (HALMAC_8822C_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
#if (HALMAC_8822C_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_STATISTICS(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x08, 17, 1)
|
||||
|
||||
@@ -273,7 +284,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_IS_QOS(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x08, 16, 1)
|
||||
|
||||
@@ -288,7 +300,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_FRAG(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x08, 12, 4)
|
||||
#define GET_RX_DESC_SEQ(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x08, 0, 12)
|
||||
@@ -297,7 +309,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
/*RXDESC_WORD3*/
|
||||
|
||||
@@ -308,7 +321,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PATTERN_MATCH(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x0C, 29, 1)
|
||||
|
||||
@@ -321,7 +334,8 @@
|
||||
#endif
|
||||
|
||||
#if (HALMAC_8822B_SUPPORT || HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || \
|
||||
HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RXPAYLOAD_MATCH(rxdesc) \
|
||||
LE_BITS_TO_4BYTE(rxdesc + 0x0C, 28, 1)
|
||||
@@ -332,7 +346,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_DMA_AGG_NUM(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x0C, 16, 8)
|
||||
|
||||
@@ -340,7 +354,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_BSSID_FIT_1_0(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x0C, 12, 2)
|
||||
#define GET_RX_DESC_EOSP(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x0C, 11, 1)
|
||||
@@ -356,7 +371,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_HTC(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x0C, 10, 1)
|
||||
|
||||
@@ -372,7 +387,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_BSSID_FIT_4_2(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x0C, 7, 3)
|
||||
|
||||
@@ -387,7 +402,7 @@
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8814B_SUPPORT || HALMAC_8198F_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_RATE(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x0C, 0, 7)
|
||||
|
||||
@@ -395,7 +410,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || \
|
||||
HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
/*RXDESC_WORD4*/
|
||||
|
||||
@@ -423,7 +438,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_MACID_RPT_BUFF(rxdesc) \
|
||||
LE_BITS_TO_4BYTE(rxdesc + 0x10, 17, 7)
|
||||
@@ -432,7 +448,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_PRE_NDP_VLD(rxdesc) \
|
||||
LE_BITS_TO_4BYTE(rxdesc + 0x10, 16, 1)
|
||||
@@ -461,7 +477,7 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_RX_SCRAMBLER(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x10, 9, 7)
|
||||
#define GET_RX_DESC_RX_EOF(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x10, 8, 1)
|
||||
@@ -494,7 +510,8 @@
|
||||
#endif
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8821C_SUPPORT || \
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8822C_SUPPORT || HALMAC_8192F_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
#define GET_RX_DESC_PATTERN_IDX(rxdesc) LE_BITS_TO_4BYTE(rxdesc + 0x10, 0, 8)
|
||||
|
||||
@@ -514,7 +531,8 @@
|
||||
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT)
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8812F_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
/*RXDESC_WORD5*/
|
||||
|
||||
|
||||
@@ -16,8 +16,9 @@
|
||||
#ifndef _HALMAC_TX_BD_NIC_H_
|
||||
#define _HALMAC_TX_BD_NIC_H_
|
||||
#if (HALMAC_8814A_SUPPORT || HALMAC_8822B_SUPPORT || HALMAC_8197F_SUPPORT || \
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT ||\
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8814B_SUPPORT)
|
||||
HALMAC_8821C_SUPPORT || HALMAC_8198F_SUPPORT || HALMAC_8822C_SUPPORT || \
|
||||
HALMAC_8192F_SUPPORT || HALMAC_8197G_SUPPORT || HALMAC_8814B_SUPPORT || \
|
||||
HALMAC_8822E_SUPPORT)
|
||||
|
||||
/*TXBD_DW0*/
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user