net: wireless: rockchip_wlan: add rtl8723bu support

update rtl8723bu wifi driver to version v4.4.2_18635.20161006_BTCOEX20151228-664a

Change-Id: I7053c211228a48fd45f9084da86d97a74e82ac79
Signed-off-by: Alex Zhao <zzc@rock-chips.com>
This commit is contained in:
Alex Zhao 2017-09-08 15:23:50 +08:00 committed by Huang, Tao
parent 7ba25eea80
commit d35fac33e5
383 changed files with 143008 additions and 82723 deletions

View File

@ -22,6 +22,7 @@ source "drivers/net/wireless/rockchip_wlan/rtl8188fu/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8189es/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8189fs/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723bs/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723bu/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723cs/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8723ds/Kconfig"
source "drivers/net/wireless/rockchip_wlan/rtl8822be/Kconfig"

View File

@ -4,6 +4,7 @@ obj-$(CONFIG_RTL8188FU) += rtl8188fu/
obj-$(CONFIG_RTL8189ES) += rtl8189es/
obj-$(CONFIG_RTL8189FS) += rtl8189fs/
obj-$(CONFIG_RTL8723BS) += rtl8723bs/
obj-$(CONFIG_RTL8723BU) += rtl8723bu/
obj-$(CONFIG_RTL8723CS) += rtl8723cs/
obj-$(CONFIG_RTL8723DS) += rtl8723ds/
obj-$(CONFIG_RTL8822BE) += rtl8822be/

View File

@ -1,10 +1,5 @@
config RTL8723BU
tristate "Realtek 8723BU USB WiFi"
tristate "Realtek 8723B USB WiFi"
depends on USB
select WIRELESS_EXT
select WEXT_PRIV
select IEEE80211
select BT_RTKBTUSB
select UHID
---help---
Help message of RTL8723BU
Help message of RTL8723BU

View File

@ -13,10 +13,11 @@ EXTRA_CFLAGS += -Wno-unused-label
EXTRA_CFLAGS += -Wno-unused-parameter
EXTRA_CFLAGS += -Wno-unused-function
EXTRA_CFLAGS += -Wno-unused
#EXTRA_CFLAGS += -Wno-uninitialized
#EXTRA_CFLAGS += -Wno-error=date-time # Fix compile error on gcc 4.9 and later
EXTRA_CFLAGS += -I$(src)/include
EXTRA_CFLAGS += -I$(src)/hal/phydm
EXTRA_LDFLAGS += --strip-debug
@ -30,6 +31,8 @@ CONFIG_RTL8821A = n
CONFIG_RTL8192E = n
CONFIG_RTL8723B = y
CONFIG_RTL8814A = n
CONFIG_RTL8723C = n
CONFIG_RTL8188F = n
######################### Interface ###########################
CONFIG_USB_HCI = y
CONFIG_PCI_HCI = n
@ -49,24 +52,28 @@ CONFIG_EXT_CLK = n
CONFIG_TRAFFIC_PROTECT = y
CONFIG_LOAD_PHY_PARA_FROM_FILE = y
CONFIG_CALIBRATE_TX_POWER_BY_REGULATORY = n
CONFIG_CALIBRATE_TX_POWER_TO_MAX = n
CONFIG_CALIBRATE_TX_POWER_TO_MAX = y
CONFIG_RTW_ADAPTIVITY_EN = disable
CONFIG_RTW_ADAPTIVITY_MODE = normal
CONFIG_SKIP_SIGNAL_SCALE_MAPPING = n
CONFIG_SIGNAL_SCALE_MAPPING = n
CONFIG_80211W = n
CONFIG_REDUCE_TX_CPU_LOADING = n
CONFIG_BR_EXT = y
CONFIG_ANTENNA_DIVERSITY = n
CONFIG_TDLS = n
CONFIG_WIFI_MONITOR = n
######################## Wake On Lan ##########################
CONFIG_WOWLAN = n
CONFIG_GPIO_WAKEUP = n
CONFIG_WAKEUP_GPIO_IDX = default
CONFIG_HIGH_ACTIVE = n
CONFIG_PNO_SUPPORT = n
CONFIG_PNO_SET_DEBUG = n
CONFIG_AP_WOWLAN = n
######### Notify SDIO Host Keep Power During Syspend ##########
CONFIG_RTW_SDIO_PM_KEEP_POWER = y
###################### MP HW TX MODE FOR VHT #######################
CONFIG_MP_VHT_HW_TX_MODE = n
###################### Platform Related #######################
CONFIG_PLATFORM_I386_PC = y
CONFIG_PLATFORM_ANDROID_X86 = n
@ -90,9 +97,10 @@ CONFIG_PLATFORM_TEGRA4_DALMORE = n
CONFIG_PLATFORM_ARM_TCC8900 = n
CONFIG_PLATFORM_ARM_TCC8920 = n
CONFIG_PLATFORM_ARM_TCC8920_JB42 = n
CONFIG_PLATFORM_ARM_TCC8930_JB42 = n
CONFIG_PLATFORM_ARM_RK2818 = n
CONFIG_PLATFORM_ARM_RK3066 = n
CONFIG_PLATFORM_ARM_RK3188 = y
CONFIG_PLATFORM_ARM_RK3188 = n
CONFIG_PLATFORM_ARM_URBETTER = n
CONFIG_PLATFORM_ARM_TI_PANDA = n
CONFIG_PLATFORM_MIPS_JZ4760 = n
@ -108,6 +116,7 @@ CONFIG_PLATFORM_ARM_SUN8I_W5P1 = n
CONFIG_PLATFORM_ACTIONS_ATM702X = n
CONFIG_PLATFORM_ACTIONS_ATV5201 = n
CONFIG_PLATFORM_ACTIONS_ATM705X = n
CONFIG_PLATFORM_ARM_SUN50IW1P1 = n
CONFIG_PLATFORM_ARM_RTD299X = n
CONFIG_PLATFORM_ARM_SPREADTRUM_6820 = n
CONFIG_PLATFORM_ARM_SPREADTRUM_8810 = n
@ -155,6 +164,10 @@ _OS_INTFS_FILES := os_dep/osdep_service.o \
os_dep/linux/rtw_android.o \
os_dep/linux/rtw_proc.o
ifeq ($(CONFIG_MP_INCLUDED), y)
_OS_INTFS_FILES += os_dep/linux/ioctl_mp.o
endif
ifeq ($(CONFIG_SDIO_HCI), y)
_OS_INTFS_FILES += os_dep/linux/custom_gpio_linux.o
_OS_INTFS_FILES += os_dep/linux/$(HCI_NAME)_ops_linux.o
@ -172,42 +185,49 @@ _HAL_INTFS_FILES := hal/hal_intf.o \
hal/hal_phy.o \
hal/hal_dm.o \
hal/hal_btcoex.o \
hal/hal_mp.o \
hal/hal_hci/hal_$(HCI_NAME).o \
hal/led/hal_$(HCI_NAME)_led.o
_OUTSRC_FILES := hal/OUTSRC/phydm_debug.o \
hal/OUTSRC/phydm_AntDiv.o\
hal/OUTSRC/phydm_AntDect.o\
hal/OUTSRC/phydm_interface.o\
hal/OUTSRC/phydm_HWConfig.o\
hal/OUTSRC/phydm.o\
hal/OUTSRC/HalPhyRf.o\
hal/OUTSRC/phydm_EdcaTurboCheck.o\
hal/OUTSRC/phydm_DIG.o\
hal/OUTSRC/phydm_PathDiv.o\
hal/OUTSRC/phydm_RaInfo.o\
hal/OUTSRC/phydm_DynamicBBPowerSaving.o\
hal/OUTSRC/phydm_PowerTracking.o\
hal/OUTSRC/phydm_DynamicTxPower.o\
hal/OUTSRC/PhyDM_Adaptivity.o\
hal/OUTSRC/phydm_CfoTracking.o\
hal/OUTSRC/phydm_NoiseMonitor.o\
hal/OUTSRC/phydm_ACS.o
_OUTSRC_FILES := hal/phydm/phydm_debug.o \
hal/phydm/phydm_antdiv.o\
hal/phydm/phydm_antdect.o\
hal/phydm/phydm_interface.o\
hal/phydm/phydm_hwconfig.o\
hal/phydm/phydm.o\
hal/phydm/halphyrf_ce.o\
hal/phydm/phydm_edcaturbocheck.o\
hal/phydm/phydm_dig.o\
hal/phydm/phydm_pathdiv.o\
hal/phydm/phydm_rainfo.o\
hal/phydm/phydm_dynamicbbpowersaving.o\
hal/phydm/phydm_powertracking_ce.o\
hal/phydm/phydm_dynamictxpower.o\
hal/phydm/phydm_adaptivity.o\
hal/phydm/phydm_cfotracking.o\
hal/phydm/phydm_noisemonitor.o\
hal/phydm/phydm_acs.o\
hal/phydm/phydm_beamforming.o\
hal/phydm/txbf/halcomtxbf.o\
hal/phydm/txbf/haltxbfinterface.o
EXTRA_CFLAGS += -I$(src)/platform
_PLATFORM_FILES := platform/platform_ops.o
ifeq ($(CONFIG_BT_COEXIST), y)
EXTRA_CFLAGS += -I$(src)/hal/OUTSRC-BTCoexist
_OUTSRC_FILES += hal/OUTSRC-BTCoexist/HalBtc8192e1Ant.o \
hal/OUTSRC-BTCoexist/HalBtc8192e2Ant.o \
hal/OUTSRC-BTCoexist/HalBtc8723b1Ant.o \
hal/OUTSRC-BTCoexist/HalBtc8723b2Ant.o \
hal/OUTSRC-BTCoexist/HalBtc8812a1Ant.o \
hal/OUTSRC-BTCoexist/HalBtc8812a2Ant.o \
hal/OUTSRC-BTCoexist/HalBtc8821a1Ant.o \
hal/OUTSRC-BTCoexist/HalBtc8821a2Ant.o \
hal/OUTSRC-BTCoexist/HalBtc8821aCsr2Ant.o
EXTRA_CFLAGS += -I$(src)/hal/btc
_OUTSRC_FILES += hal/btc/HalBtc8192e1Ant.o \
hal/btc/HalBtc8192e2Ant.o \
hal/btc/HalBtc8723b1Ant.o \
hal/btc/HalBtc8723b2Ant.o \
hal/btc/HalBtc8812a1Ant.o \
hal/btc/HalBtc8812a2Ant.o \
hal/btc/HalBtc8821a1Ant.o \
hal/btc/HalBtc8821a2Ant.o \
hal/btc/HalBtc8821aCsr2Ant.o \
hal/btc/HalBtc8703b1Ant.o
endif
@ -258,10 +278,6 @@ _HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o
endif
endif
ifeq ($(CONFIG_MP_INCLUDED), y)
_HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o
endif
ifeq ($(CONFIG_USB_HCI), y)
_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8188E_USB.o
endif
@ -273,14 +289,15 @@ _HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8188E_SDIO.o
endif
#hal/OUTSRC/$(RTL871X)/Hal8188EFWImg_CE.o
_OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8188E_MAC.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8188E_BB.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8188E_RF.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8188E_FW.o\
hal/OUTSRC/$(RTL871X)/HalPhyRf_8188e.o\
hal/OUTSRC/$(RTL871X)/phydm_RegConfig8188E.o\
hal/OUTSRC/$(RTL871X)/Hal8188ERateAdaptive.o\
hal/OUTSRC/$(RTL871X)/phydm_RTL8188E.o
_OUTSRC_FILES += hal/phydm/$(RTL871X)/halhwimg8188e_mac.o\
hal/phydm/$(RTL871X)/halhwimg8188e_bb.o\
hal/phydm/$(RTL871X)/halhwimg8188e_rf.o\
hal/phydm/$(RTL871X)/halhwimg8188e_t_fw.o\
hal/phydm/$(RTL871X)/halhwimg8188e_s_fw.o\
hal/phydm/$(RTL871X)/halphyrf_8188e_ce.o\
hal/phydm/$(RTL871X)/phydm_regconfig8188e.o\
hal/phydm/$(RTL871X)/hal8188erateadaptive.o\
hal/phydm/$(RTL871X)/phydm_rtl8188e.o
endif
@ -326,10 +343,6 @@ _HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o
endif
endif
ifeq ($(CONFIG_MP_INCLUDED), y)
_HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o
endif
ifeq ($(CONFIG_USB_HCI), y)
_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8192E_USB.o
endif
@ -338,13 +351,13 @@ _HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8192E_PCIE.o
endif
#hal/OUTSRC/$(RTL871X)/HalHWImg8188E_FW.o
_OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8192E_MAC.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8192E_BB.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8192E_RF.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8192E_FW.o\
hal/OUTSRC/$(RTL871X)/HalPhyRf_8192e.o\
hal/OUTSRC/$(RTL871X)/phydm_RegConfig8192E.o\
hal/OUTSRC/$(RTL871X)/phydm_RTL8192E.o
_OUTSRC_FILES += hal/phydm/$(RTL871X)/halhwimg8192e_mac.o\
hal/phydm/$(RTL871X)/halhwimg8192e_bb.o\
hal/phydm/$(RTL871X)/halhwimg8192e_rf.o\
hal/phydm/$(RTL871X)/halhwimg8192e_fw.o\
hal/phydm/$(RTL871X)/halphyrf_8192e_ce.o\
hal/phydm/$(RTL871X)/phydm_regconfig8192e.o\
hal/phydm/$(RTL871X)/phydm_rtl8192e.o
endif
@ -390,10 +403,6 @@ _HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o
endif
endif
ifeq ($(CONFIG_MP_INCLUDED), y)
_HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o
endif
ifeq ($(CONFIG_RTL8812A), y)
ifeq ($(CONFIG_USB_HCI), y)
_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8812A_USB.o
@ -413,13 +422,14 @@ endif
ifeq ($(CONFIG_RTL8812A), y)
EXTRA_CFLAGS += -DCONFIG_RTL8812A
_OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8812A_FW.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8812A_MAC.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8812A_BB.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8812A_RF.o\
hal/OUTSRC/$(RTL871X)/HalPhyRf_8812A.o\
hal/OUTSRC/$(RTL871X)/phydm_RegConfig8812A.o\
hal/OUTSRC/$(RTL871X)/phydm_RTL8812A.o
_OUTSRC_FILES += hal/phydm/$(RTL871X)/halhwimg8812a_fw.o\
hal/phydm/$(RTL871X)/halhwimg8812a_mac.o\
hal/phydm/$(RTL871X)/halhwimg8812a_bb.o\
hal/phydm/$(RTL871X)/halhwimg8812a_rf.o\
hal/phydm/$(RTL871X)/halphyrf_8812a_ce.o\
hal/phydm/$(RTL871X)/phydm_regconfig8812a.o\
hal/phydm/$(RTL871X)/phydm_rtl8812a.o\
hal/phydm/txbf/haltxbfjaguar.o
endif
ifeq ($(CONFIG_RTL8821A), y)
@ -428,7 +438,11 @@ ifeq ($(CONFIG_RTL8812A), n)
RTL871X = rtl8821a
ifeq ($(CONFIG_USB_HCI), y)
ifeq ($(CONFIG_BT_COEXIST), y)
MODULE_NAME := 8821au
else
MODULE_NAME := 8811au
endif
endif
ifeq ($(CONFIG_PCI_HCI), y)
MODULE_NAME := 8821ae
@ -440,18 +454,19 @@ endif
endif
EXTRA_CFLAGS += -DCONFIG_RTL8821A
_OUTSRC_FILES += hal/OUTSRC/rtl8821a/HalHWImg8821A_FW.o\
hal/OUTSRC/rtl8821a/HalHWImg8821A_MAC.o\
hal/OUTSRC/rtl8821a/HalHWImg8821A_BB.o\
hal/OUTSRC/rtl8821a/HalHWImg8821A_RF.o\
hal/OUTSRC/rtl8812a/HalPhyRf_8812A.o\
hal/OUTSRC/rtl8821a/HalPhyRf_8821A_CE.o\
hal/OUTSRC/rtl8821a/phydm_RegConfig8821A.o\
hal/OUTSRC/rtl8821a/phydm_RTL8821A.o\
hal/OUTSRC/rtl8821a/PhyDM_IQK_8821A_CE.o
_OUTSRC_FILES += hal/phydm/rtl8821a/halhwimg8821a_fw.o\
hal/phydm/rtl8821a/halhwimg8821a_mac.o\
hal/phydm/rtl8821a/halhwimg8821a_bb.o\
hal/phydm/rtl8821a/halhwimg8821a_rf.o\
hal/phydm/rtl8812a/halphyrf_8812a_ce.o\
hal/phydm/rtl8821a/halphyrf_8821a_ce.o\
hal/phydm/rtl8821a/phydm_regconfig8821a.o\
hal/phydm/rtl8821a/phydm_rtl8821a.o\
hal/phydm/rtl8821a/phydm_iqk_8821a_ce.o\
hal/phydm/txbf/haltxbfjaguar.o
endif
endif
########### HAL_RTL8723B #################################
@ -494,10 +509,6 @@ else
_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops.o
endif
ifeq ($(CONFIG_MP_INCLUDED), y)
_HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o
endif
ifeq ($(CONFIG_USB_HCI), y)
_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8723B_USB.o
endif
@ -505,20 +516,23 @@ ifeq ($(CONFIG_PCI_HCI), y)
_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8723B_PCIE.o
endif
_OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8723B_BB.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8723B_MAC.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8723B_RF.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8723B_FW.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8723B_MP.o\
hal/OUTSRC/$(RTL871X)/phydm_RegConfig8723B.o\
hal/OUTSRC/$(RTL871X)/HalPhyRf_8723B.o\
hal/OUTSRC/$(RTL871X)/phydm_RTL8723B.o
_OUTSRC_FILES += hal/phydm/$(RTL871X)/halhwimg8723b_bb.o\
hal/phydm/$(RTL871X)/halhwimg8723b_mac.o\
hal/phydm/$(RTL871X)/halhwimg8723b_rf.o\
hal/phydm/$(RTL871X)/halhwimg8723b_fw.o\
hal/phydm/$(RTL871X)/halhwimg8723b_mp.o\
hal/phydm/$(RTL871X)/phydm_regconfig8723b.o\
hal/phydm/$(RTL871X)/halphyrf_8723b_ce.o\
hal/phydm/$(RTL871X)/phydm_rtl8723b.o
endif
########### HAL_RTL8814A #################################
ifeq ($(CONFIG_RTL8814A), y)
## ADD NEW VHT MP HW TX MODE ##
EXTRA_CFLAGS += -DCONFIG_MP_VHT_HW_TX_MODE
CONFIG_MP_VHT_HW_TX_MODE = y
##########################################
RTL871X = rtl8814a
ifeq ($(CONFIG_USB_HCI), y)
MODULE_NAME = 8814au
@ -561,10 +575,6 @@ _HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o
endif
endif
ifeq ($(CONFIG_MP_INCLUDED), y)
_HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o
endif
ifeq ($(CONFIG_USB_HCI), y)
_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8814A_USB.o
endif
@ -572,14 +582,131 @@ ifeq ($(CONFIG_PCI_HCI), y)
_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8814A_PCIE.o
endif
_OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8814A_BB.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8814A_MAC.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8814A_RF.o\
hal/OUTSRC/$(RTL871X)/HalHWImg8814A_FW.o\
hal/OUTSRC/$(RTL871X)/PhyDM_IQK_8814A.o\
hal/OUTSRC/$(RTL871X)/phydm_RegConfig8814A.o\
hal/OUTSRC/$(RTL871X)/HalPhyRf_8814A.o\
hal/OUTSRC/$(RTL871X)/phydm_RTL8814A.o
_OUTSRC_FILES += hal/phydm/$(RTL871X)/halhwimg8814a_bb.o\
hal/phydm/$(RTL871X)/halhwimg8814a_mac.o\
hal/phydm/$(RTL871X)/halhwimg8814a_rf.o\
hal/phydm/$(RTL871X)/halhwimg8814a_fw.o\
hal/phydm/$(RTL871X)/phydm_iqk_8814a.o\
hal/phydm/$(RTL871X)/phydm_regconfig8814a.o\
hal/phydm/$(RTL871X)/halphyrf_8814a_ce.o\
hal/phydm/$(RTL871X)/phydm_rtl8814a.o\
hal/phydm/txbf/haltxbf8814a.o
endif
########### HAL_RTL8723C #################################
ifeq ($(CONFIG_RTL8723C), y)
RTL871X = rtl8703b
ifeq ($(CONFIG_USB_HCI), y)
MODULE_NAME = 8723cu
MODULE_SUB_NAME = 8703bu
endif
ifeq ($(CONFIG_PCI_HCI), y)
MODULE_NAME = 8723ce
MODULE_SUB_NAME = 8703be
endif
ifeq ($(CONFIG_SDIO_HCI), y)
MODULE_NAME = 8723cs
MODULE_SUB_NAME = 8703bs
endif
EXTRA_CFLAGS += -DCONFIG_RTL8703B
_HAL_INTFS_FILES += hal/HalPwrSeqCmd.o \
hal/$(RTL871X)/Hal8703BPwrSeq.o\
hal/$(RTL871X)/$(RTL871X)_sreset.o
_HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_hal_init.o \
hal/$(RTL871X)/$(RTL871X)_phycfg.o \
hal/$(RTL871X)/$(RTL871X)_rf6052.o \
hal/$(RTL871X)/$(RTL871X)_dm.o \
hal/$(RTL871X)/$(RTL871X)_rxdesc.o \
hal/$(RTL871X)/$(RTL871X)_cmd.o \
_HAL_INTFS_FILES += \
hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_halinit.o \
hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_SUB_NAME)_led.o \
hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_SUB_NAME)_xmit.o \
hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_SUB_NAME)_recv.o
ifeq ($(CONFIG_PCI_HCI), y)
_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o
else
_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops.o
endif
ifeq ($(CONFIG_USB_HCI), y)
_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8703B_USB.o
endif
ifeq ($(CONFIG_PCI_HCI), y)
_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8703B_PCIE.o
endif
_OUTSRC_FILES += hal/phydm/$(RTL871X)/halhwimg8703b_bb.o\
hal/phydm/$(RTL871X)/halhwimg8703b_mac.o\
hal/phydm/$(RTL871X)/halhwimg8703b_rf.o\
hal/phydm/$(RTL871X)/halhwimg8703b_fw.o\
hal/phydm/$(RTL871X)/phydm_regconfig8703b.o\
hal/phydm/$(RTL871X)/halphyrf_8703b.o
endif
########### HAL_RTL8188F #################################
ifeq ($(CONFIG_RTL8188F), y)
RTL871X = rtl8188f
ifeq ($(CONFIG_USB_HCI), y)
MODULE_NAME = 8188fu
endif
ifeq ($(CONFIG_PCI_HCI), y)
MODULE_NAME = 8188fe
endif
ifeq ($(CONFIG_SDIO_HCI), y)
MODULE_NAME = 8189fs
endif
EXTRA_CFLAGS += -DCONFIG_RTL8188F
_HAL_INTFS_FILES += hal/HalPwrSeqCmd.o \
hal/$(RTL871X)/Hal8188FPwrSeq.o\
hal/$(RTL871X)/$(RTL871X)_sreset.o
_HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_hal_init.o \
hal/$(RTL871X)/$(RTL871X)_phycfg.o \
hal/$(RTL871X)/$(RTL871X)_rf6052.o \
hal/$(RTL871X)/$(RTL871X)_dm.o \
hal/$(RTL871X)/$(RTL871X)_rxdesc.o \
hal/$(RTL871X)/$(RTL871X)_cmd.o \
_HAL_INTFS_FILES += \
hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_halinit.o \
hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_led.o \
hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_xmit.o \
hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_recv.o
ifeq ($(CONFIG_PCI_HCI), y)
_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o
else
_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops.o
endif
ifeq ($(CONFIG_USB_HCI), y)
_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8188F_USB.o
endif
ifeq ($(CONFIG_SDIO_HCI), y)
_HAL_INTFS_FILES +=hal/efuse/$(RTL871X)/HalEfuseMask8188F_SDIO.o
endif
_OUTSRC_FILES += hal/phydm/$(RTL871X)/halhwimg8188f_bb.o\
hal/phydm/$(RTL871X)/halhwimg8188f_mac.o\
hal/phydm/$(RTL871X)/halhwimg8188f_rf.o\
hal/phydm/$(RTL871X)/halhwimg8188f_fw.o\
hal/phydm/$(RTL871X)/phydm_regconfig8188f.o\
hal/phydm/$(RTL871X)/halphyrf_8188f.o \
hal/phydm/$(RTL871X)/phydm_rtl8188f.o
endif
@ -592,6 +719,10 @@ $(shell cp $(TopDIR)/autoconf_multidrv_$(HCI_NAME)_linux.h $(TopDIR)/include/aut
else
ifeq ($(CONFIG_RTL8188E)$(CONFIG_SDIO_HCI),yy)
$(shell cp $(TopDIR)/autoconf_rtl8189e_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
else ifeq ($(CONFIG_RTL8188F)$(CONFIG_SDIO_HCI),yy)
$(shell cp $(TopDIR)/autoconf_rtl8189f_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
else ifeq ($(CONFIG_RTL8723C),y)
$(shell cp $(TopDIR)/autoconf_rtl8723c_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
else
$(shell cp $(TopDIR)/autoconf_$(RTL871X)_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
endif
@ -697,8 +828,8 @@ else ifeq ($(CONFIG_RTW_ADAPTIVITY_MODE), carrier_sense)
EXTRA_CFLAGS += -DCONFIG_RTW_ADAPTIVITY_MODE=1
endif
ifeq ($(CONFIG_SKIP_SIGNAL_SCALE_MAPPING), y)
EXTRA_CFLAGS += -DCONFIG_SKIP_SIGNAL_SCALE_MAPPING
ifeq ($(CONFIG_SIGNAL_SCALE_MAPPING), y)
EXTRA_CFLAGS += -DCONFIG_SIGNAL_SCALE_MAPPING
endif
ifeq ($(CONFIG_80211W), y)
@ -728,6 +859,11 @@ endif
ifeq ($(CONFIG_GPIO_WAKEUP), y)
EXTRA_CFLAGS += -DCONFIG_GPIO_WAKEUP
ifeq ($(CONFIG_HIGH_ACTIVE), y)
EXTRA_CFLAGS += -DHIGH_ACTIVE=1
else
EXTRA_CFLAGS += -DHIGH_ACTIVE=0
endif
endif
ifneq ($(CONFIG_WAKEUP_GPIO_IDX), default)
@ -758,6 +894,23 @@ ifeq ($(CONFIG_TDLS), y)
EXTRA_CFLAGS += -DCONFIG_TDLS
endif
ifeq ($(CONFIG_WIFI_MONITOR), y)
EXTRA_CFLAGS += -DCONFIG_WIFI_MONITOR
endif
ifeq ($(CONFIG_MP_VHT_HW_TX_MODE), y)
EXTRA_CFLAGS += -DCONFIG_MP_VHT_HW_TX_MODE
ifeq ($(CONFIG_PLATFORM_I386_PC), y)
## For I386 X86 ToolChain use Hardware FLOATING
EXTRA_CFLAGS += -mhard-float
else
## For ARM ToolChain use Hardware FLOATING
EXTRA_CFLAGS += -mfloat-abi=hard
endif
endif
EXTRA_CFLAGS += -DDM_ODM_SUPPORT_TYPE=0x04
ifeq ($(CONFIG_PLATFORM_I386_PC), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
@ -782,6 +935,7 @@ KSRC := $(KERNEL_BUILD_PATH)
MODULE_NAME :=wlan
endif
ifeq ($(CONFIG_PLATFORM_ACTIONS_ATM705X), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
#EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
@ -789,7 +943,6 @@ EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DCONFIG_PLATFORM_ACTIONS_ATM705X
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
# Enable this for Android 5.0
EXTRA_CFLAGS += -DCONFIG_RADIO_WORK
@ -804,6 +957,33 @@ CROSS_COMPILE := /opt/arm-2011.09/bin/arm-none-linux-gnueabi-
KSRC := /home/android_sdk/Action-semi/705a_android_L/android/kernel
endif
ifeq ($(CONFIG_PLATFORM_ARM_SUN50IW1P1), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN50IW1P1
EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT
# default setting for Android 4.1, 4.2
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_RESUME_IN_WORKQUEUE
EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS
# Enable this for Android 5.0
EXTRA_CFLAGS += -DCONFIG_RADIO_WORK
ifeq ($(CONFIG_USB_HCI), y)
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX
_PLATFORM_FILES += platform/platform_ARM_SUNxI_usb.o
endif
ifeq ($(CONFIG_SDIO_HCI), y)
_PLATFORM_FILES += platform/platform_ARM_SUN50IW1P1_sdio.o
endif
ARCH := arm64
# ===Cross compile setting for Android 5.1(64) SDK ===
CROSS_COMPILE := /home/android_sdk/Allwinner/a64/android-51/lichee/out/sun50iw1p1/android/common/buildroot/external-toolchain/bin/aarch64-linux-gnu-
KSRC :=/home/android_sdk/Allwinner/a64/android-51/lichee/linux-3.10/
endif
ifeq ($(CONFIG_PLATFORM_TI_AM3517), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_SHUTTLE
CROSS_COMPILE := arm-eabi-
@ -820,7 +1000,10 @@ KSRC:= /usr/src/Mstar_kernel/2.6.28.9/
endif
ifeq ($(CONFIG_PLATFORM_MSTAR), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR #-DCONFIG_PLATFORM_MSTAR_SCAN_BEFORE_CONNECT
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR -DCONFIG_USE_USB_BUFFER_ALLOC_TX -DCONFIG_FIX_NR_BULKIN_BUFFER -DCONFIG_PREALLOC_RX_SKB_BUFFER
EXTRA_CFLAGS += -DCONFIG_PLATFORM_MSTAR_HIGH
ARCH:=arm
CROSS_COMPILE:= /usr/src/bin/arm-none-linux-gnueabi-
KVER:= 3.1.10
@ -842,7 +1025,6 @@ EXTRA_CFLAGS += -DCONFIG_PLATFORM_INTEL_BYT
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
EXTRA_CFLAGS += -DCONFIG_SKIP_SIGNAL_SCALE_MAPPING
ifeq ($(CONFIG_SDIO_HCI), y)
EXTRA_CFLAGS += -DCONFIG_RESUME_IN_WORKQUEUE
@ -853,7 +1035,6 @@ ifeq ($(CONFIG_PLATFORM_JB_X86), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
ARCH := $(SUBARCH)
CROSS_COMPILE := /home/android_sdk/android-x86_JB/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7/bin/i686-linux-android-
@ -1005,7 +1186,6 @@ EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
ARCH := arm
CROSS_COMPILE := /home/android_sdk/nvidia/tegra-16r3-partner-android-4.1_20120723/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
KSRC := /home/android_sdk/nvidia/tegra-16r3-partner-android-4.1_20120723/out/target/product/cardhu/obj/KERNEL
@ -1018,7 +1198,6 @@ EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
ARCH := arm
CROSS_COMPILE := /home/android_sdk/nvidia/tegra-17r9-partner-android-4.2-dalmore_20130131/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
KSRC := /home/android_sdk/nvidia/tegra-17r9-partner-android-4.2-dalmore_20130131/out/target/product/dalmore/obj/KERNEL
@ -1046,7 +1225,6 @@ EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
# default setting for Android 4.1, 4.2
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
ARCH := arm
CROSS_COMPILE := /home/android_sdk/Telechips/v13.03_r1-tcc-android-4.2.2_ds_patched/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
KSRC := /home/android_sdk/Telechips/v13.03_r1-tcc-android-4.2.2_ds_patched/kernel
@ -1066,10 +1244,10 @@ EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFO
# default setting for Android 4.1, 4.2, 4.3, 4.4
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
# default setting for Power control
EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
EXTRA_CFLAGS += -DRTW_SUPPORT_PLATFORM_SHUTDOWN
# default setting for Special function
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
EXTRA_CFLAGS += -DCONFIG_RADIO_WORK
EXTRA_CFLAGS += -DCONFIG_RESUME_IN_WORKQUEUE
ARCH := arm
CROSS_COMPILE := /home/android_sdk/Rockchip/Rk3188/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
KSRC := /home/android_sdk/Rockchip/Rk3188/kernel
@ -1082,7 +1260,6 @@ EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
ifeq ($(CONFIG_SDIO_HCI), y)
EXTRA_CFLAGS += -DRTW_SUPPORT_PLATFORM_SHUTDOWN
endif
@ -1144,7 +1321,6 @@ EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUNxI
# default setting for Android 4.1, 4.2
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DDCONFIG_P2P_IPS
EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS
ifeq ($(CONFIG_USB_HCI), y)
@ -1172,7 +1348,7 @@ EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT
# default setting for Android 4.1, 4.2, 4.3, 4.4
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_P2P_IPS -DCONFIG_QOS_OPTIMIZATION
EXTRA_CFLAGS += -DCONFIG_QOS_OPTIMIZATION
EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS
ifeq ($(CONFIG_USB_HCI), y)
@ -1204,7 +1380,7 @@ EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT
# default setting for Android 4.1, 4.2, 4.3, 4.4
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_P2P_IPS -DCONFIG_QOS_OPTIMIZATION
EXTRA_CFLAGS += -DCONFIG_QOS_OPTIMIZATION
EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS
ifeq ($(CONFIG_USB_HCI), y)
@ -1235,7 +1411,6 @@ EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT
# default setting for Android 4.1, 4.2
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS
ifeq ($(CONFIG_USB_HCI), y)
@ -1263,7 +1438,6 @@ EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT
# default setting for Android 4.1, 4.2
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
# Enable this for Android 5.0
EXTRA_CFLAGS += -DCONFIG_RADIO_WORK
@ -1293,7 +1467,14 @@ KSRC:= $(CFGDIR)/../../kernel/linux-$(KERNEL_VER)
endif
ifeq ($(CONFIG_PLATFORM_ARM_RTD299X), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DUSB_XMITBUF_ALIGN_SZ=1024 -DUSB_PACKET_OFFSET_SZ=0
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DUSB_XMITBUF_ALIGN_SZ=1024 -DUSB_PACKET_OFFSET_SZ=0
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
ifeq ($(CONFIG_ANDROID), y)
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
# Enable this for Android 5.0
EXTRA_CFLAGS += -DCONFIG_RADIO_WORK
endif
#ARCH, CROSS_COMPILE, KSRC,and MODDESTDIR are provided by external makefile
INSTALL_PREFIX :=
endif
@ -1304,7 +1485,6 @@ ifeq ($(SUPPORT_CONCURRENT),y)
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
endif
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DCONFIG_P2P_IPS
ARCH := arm
ifeq ($(CROSS_COMPILE),)
CROSS_COMPILE = arm-hisiv200-linux-
@ -1315,7 +1495,7 @@ ifeq ($(KSRC),)
endif
endif
# Platfrom setting
# Platform setting
ifeq ($(CONFIG_PLATFORM_ARM_SPREADTRUM_6820), y)
ifeq ($(CONFIG_ANDROID_2X), y)
EXTRA_CFLAGS += -DANDROID_2X
@ -1369,7 +1549,7 @@ EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT
# default setting for Android 4.1, 4.2
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
#EXTRA_CFLAGS += -DCONFIG_P2P_IPS -DCONFIG_QOS_OPTIMIZATION
#EXTRA_CFLAGS += -DCONFIG_QOS_OPTIMIZATION
EXTRA_CFLAGS += -DCONFIG_QOS_OPTIMIZATION
#EXTRA_CFLAGS += -DCONFIG_#PLATFORM_OPS
@ -1398,7 +1578,6 @@ EXTRA_CFLAGS += -DCONFIG_PLATFORM_NOVATEK_NT72668
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
EXTRA_CFLAGS += -DDCONFIG_P2P_IPS
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_RX
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX
ARCH ?= arm
@ -1408,6 +1587,17 @@ KSRC := /Custom/Novatek/TCL/linux-3.8_header
#KSRC := $(KERNELDIR)
endif
ifeq ($(CONFIG_PLATFORM_ARM_TCC8930_JB42), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
# default setting for Android 4.1, 4.2
EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
ARCH := arm
CROSS_COMPILE := /home/android_sdk/Telechips/v13.05_r1-tcc-android-4.2.2_tcc893x-evm_build/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
KSRC := /home/android_sdk/Telechips/v13.05_r1-tcc-android-4.2.2_tcc893x-evm_build/kernel
MODULE_NAME := wlan
endif
ifeq ($(CONFIG_MULTIDRV), y)
ifeq ($(CONFIG_SDIO_HCI), y)
@ -1457,7 +1647,7 @@ rtk_core := core/rtw_cmd.o \
core/rtw_btcoex.o \
core/rtw_beamforming.o \
core/rtw_odm.o \
core/efuse/rtw_efuse.o
core/efuse/rtw_efuse.o
$(MODULE_NAME)-y += $(rtk_core)
@ -1477,9 +1667,6 @@ $(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o \
ifeq ($(CONFIG_RTL8723B), y)
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED)+= core/rtw_bt_mp.o
endif
ifeq ($(CONFIG_RTL8821A), y)
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED)+= core/rtw_bt_mp.o
endif
obj-$(CONFIG_RTL8723BU) := $(MODULE_NAME).o
@ -1511,8 +1698,8 @@ config_r:
.PHONY: modules clean
clean:
cd hal/OUTSRC/ ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko
cd hal/OUTSRC/ ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd hal/phydm/ ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko
cd hal/phydm/ ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd hal/led ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
cd hal ; rm -fr */*/*.mod.c */*/*.mod */*/*.o */*/.*.cmd */*/*.ko
cd hal ; rm -fr */*.mod.c */*.mod */*.o */.*.cmd */*.ko

View File

@ -0,0 +1,5 @@
#!/bin/bash
rmmod 8192cu
rmmod 8192ce
rmmod 8192du
rmmod 8192de

View File

@ -449,8 +449,7 @@ efuse_OneByteRead(
if( IS_HARDWARE_TYPE_8723B(pAdapter) ||
(IS_HARDWARE_TYPE_8192E(pAdapter) && (!IS_A_CUT(pHalData->VersionID))) ||
//(IS_HARDWARE_TYPE_8188E(pAdapter) && ((IS_I_CUT(pHalData->VersionID)) || (IS_J_CUT(pHalData->VersionID))))
(IS_VENDOR_8188E_I_CUT_SERIES(pAdapter))
(IS_VENDOR_8188E_I_CUT_SERIES(pAdapter)) || (IS_CHIP_VENDOR_SMIC(pHalData->VersionID))
)
{
// <20130121, Kordan> For SMIC EFUSE specificatoin.
@ -513,6 +512,7 @@ efuse_OneByteWrite(
return bResult;
}
Efuse_PowerSwitch(pAdapter, _TRUE, _TRUE);
// -----------------e-fuse reg ctrl ---------------------------------
//address
@ -523,14 +523,11 @@ efuse_OneByteWrite(
efuseValue &= ~(0x3FFFF);
efuseValue |= ((addr<<8 | data) & 0x3FFFF);
// <20130227, Kordan> 8192E MP chip A-cut had better not set 0x34[11] until B-Cut.
if ( IS_HARDWARE_TYPE_8723B(pAdapter) ||
(IS_HARDWARE_TYPE_8192E(pAdapter) && (!IS_A_CUT(pHalData->VersionID))) ||
//(IS_HARDWARE_TYPE_8188E(pAdapter) && ((IS_I_CUT(pHalData->VersionID)) || (IS_J_CUT(pHalData->VersionID))))
(IS_VENDOR_8188E_I_CUT_SERIES(pAdapter))
)
{
(IS_VENDOR_8188E_I_CUT_SERIES(pAdapter)) || (IS_CHIP_VENDOR_SMIC(pHalData->VersionID))
) {
// <20130121, Kordan> For SMIC EFUSE specificatoin.
//0x34[11]: SW force PGMEN input of efuse to high. (for the bank selected by 0x34[9:8])
//PHY_SetMacReg(pAdapter, 0x34, BIT11, 1);
@ -562,13 +559,13 @@ efuse_OneByteWrite(
// disable Efuse program enable
if ( IS_HARDWARE_TYPE_8723B(pAdapter) ||
(IS_HARDWARE_TYPE_8192E(pAdapter) && (!IS_A_CUT(pHalData->VersionID))) ||
//(IS_HARDWARE_TYPE_8188E(pAdapter) && ((IS_I_CUT(pHalData->VersionID)) || (IS_J_CUT(pHalData->VersionID))))
(IS_VENDOR_8188E_I_CUT_SERIES(pAdapter))
)
{
(IS_VENDOR_8188E_I_CUT_SERIES(pAdapter)) || (IS_CHIP_VENDOR_SMIC(pHalData->VersionID))
) {
PHY_SetMacReg(pAdapter, EFUSE_TEST, BIT(11), 0);
}
Efuse_PowerSwitch(pAdapter, _TRUE, _FALSE);
return bResult;
}
@ -742,6 +739,24 @@ u8 efuse_GetCurrentSize(PADAPTER padapter, u16 *size)
return _SUCCESS;
}
//------------------------------------------------------------------------------
u16 efuse_bt_GetMaxSize(PADAPTER padapter)
{
u16 max_size;
max_size = 0;
EFUSE_GetEfuseDefinition(padapter, EFUSE_BT , TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_size, _FALSE);
return max_size;
}
u8 efuse_bt_GetCurrentSize(PADAPTER padapter, u16 *size)
{
Efuse_PowerSwitch(padapter, _FALSE, _TRUE);
*size = Efuse_GetCurrentSize(padapter, EFUSE_BT, _FALSE);
Efuse_PowerSwitch(padapter, _FALSE, _FALSE);
return _SUCCESS;
}
u8 rtw_efuse_map_read(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
{
u16 mapLen=0;
@ -815,7 +830,7 @@ u8 rtw_efuse_file_read(PADAPTER padapter,u8 *filepatch,u8 *buf,u32 len)
_rtw_memset(ptmpbuf,'\0',2048);
rtStatus = rtw_retrive_from_file(filepatch, ptmpbuf, 2048);
rtStatus = rtw_retrieve_from_file(filepatch, ptmpbuf, 2048);
if( rtStatus > 100 )
{
@ -882,10 +897,18 @@ efuse_IsMasked(
if (IS_HARDWARE_TYPE_8723B(pAdapter))
return (IS_MASKED(8723B,_MUSB,Offset)) ? TRUE : FALSE;
#endif
#if defined(CONFIG_RTL8703B)
if (IS_HARDWARE_TYPE_8703B(pAdapter))
return (IS_MASKED(8703B, _MUSB, Offset)) ? TRUE : FALSE;
#endif
#if defined(CONFIG_RTL8814A)
if (IS_HARDWARE_TYPE_8814A(pAdapter))
return (IS_MASKED(8814A, _MUSB, Offset)) ? TRUE : FALSE;
#endif
#endif
#if defined(CONFIG_RTL8188F)
if (IS_HARDWARE_TYPE_8188F(pAdapter))
return (IS_MASKED(8188F, _MUSB, Offset)) ? TRUE : FALSE;
#endif
#elif DEV_BUS_TYPE == RT_PCI_INTERFACE
#if defined(CONFIG_RTL8188E)
if (IS_HARDWARE_TYPE_8188E(pAdapter))
@ -918,7 +941,11 @@ efuse_IsMasked(
#ifdef CONFIG_RTL8188E_SDIO
if (IS_HARDWARE_TYPE_8188E(pAdapter))
return (IS_MASKED(8188E,_MSDIO,Offset)) ? TRUE : FALSE;
#endif
#endif
#ifdef CONFIG_RTL8188F_SDIO
if (IS_HARDWARE_TYPE_8188F(pAdapter))
return (IS_MASKED(8188F, _MSDIO, Offset)) ? TRUE : FALSE;
#endif
#endif
return FALSE;
@ -977,7 +1004,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
DBG_8192C("%s , data[%d] = %x, map[addr+i]= %x\n", __func__, i, data[i], map[addr+i]);
}
}
Efuse_PowerSwitch(padapter, _TRUE, _TRUE);
/*Efuse_PowerSwitch(padapter, _TRUE, _TRUE);*/
idx = 0;
offset = (addr >> 3);
@ -1023,7 +1050,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
offset++;
}
Efuse_PowerSwitch(padapter, _TRUE, _FALSE);
/*Efuse_PowerSwitch(padapter, _TRUE, _FALSE);*/
exit:
@ -1039,7 +1066,7 @@ u8 rtw_efuse_mask_map_read(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, _FALSE);
ret = rtw_efuse_map_read(padapter, 0, mapLen, data);
ret = rtw_efuse_map_read(padapter, addr, cnts , data);
if (padapter->registrypriv.boffefusemask == 0) {
@ -1475,6 +1502,40 @@ Efuse_InitSomeVar(
_rtw_memset((PVOID)&fakeBTEfuseModifiedMap[0], 0xff, EFUSE_BT_MAX_MAP_LEN);
}
const u8 _mac_hidden_max_bw_to_hal_bw_cap[MAC_HIDDEN_MAX_BW_NUM] = {
0,
0,
(BW_CAP_160M|BW_CAP_80M|BW_CAP_40M|BW_CAP_20M|BW_CAP_10M|BW_CAP_5M),
(BW_CAP_5M),
(BW_CAP_10M|BW_CAP_5M),
(BW_CAP_20M|BW_CAP_10M|BW_CAP_5M),
(BW_CAP_40M|BW_CAP_20M|BW_CAP_10M|BW_CAP_5M),
(BW_CAP_80M|BW_CAP_40M|BW_CAP_20M|BW_CAP_10M|BW_CAP_5M),
};
const u8 _mac_hidden_proto_to_hal_proto_cap[MAC_HIDDEN_PROTOCOL_NUM] = {
0,
0,
(PROTO_CAP_11N|PROTO_CAP_11G|PROTO_CAP_11B),
(PROTO_CAP_11AC|PROTO_CAP_11N|PROTO_CAP_11G|PROTO_CAP_11B),
};
u8 mac_hidden_wl_func_to_hal_wl_func(u8 func)
{
u8 wl_func = 0;
if (func & BIT0)
wl_func |= WL_FUNC_MIRACAST;
if (func & BIT1)
wl_func |= WL_FUNC_P2P;
if (func & BIT2)
wl_func |= WL_FUNC_TDLS;
if (func & BIT3)
wl_func |= WL_FUNC_FTM;
return wl_func;
}
#ifdef PLATFORM_LINUX
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
//#include <rtw_eeprom.h>
@ -1509,7 +1570,7 @@ int retriveAdaptorInfoFile(char *path, u8* efuse_data)
if(path && efuse_data) {
ret = rtw_retrive_from_file(path, efuse_data, EEPROM_MAX_SIZE);
ret = rtw_retrieve_from_file(path, efuse_data, EEPROM_MAX_SIZE);
if(ret == EEPROM_MAX_SIZE)
ret = _SUCCESS;
@ -1530,117 +1591,141 @@ int retriveAdaptorInfoFile(char *path, u8* efuse_data)
}
return ret;
}
#endif //CONFIG_ADAPTOR_INFO_CACHING_FILE
#endif //PLATFORM_LINUX
#endif /* CONFIG_ADAPTOR_INFO_CACHING_FILE */
#ifdef CONFIG_EFUSE_CONFIG_FILE
void Rtw_Hal_ReadMACAddrFromFile(PADAPTER padapter)
u32 rtw_read_efuse_from_file(const char *path, u8 *buf)
{
u32 i;
u8 temp[3];
u32 ret = _FAIL;
struct file *fp;
mm_segment_t fs;
u8 source_addr[18];
loff_t pos = 0;
u32 curtime = rtw_get_current_time();
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
u8 *head, *end;
u8 null_mac_addr[ETH_ALEN] = {0, 0, 0,0, 0, 0};
u8 multi_mac_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
_rtw_memset(source_addr, 0, 18);
_rtw_memset(pHalData->EEPROMMACAddr, 0, ETH_ALEN);
fp = filp_open(path, O_RDONLY, 0);
if (fp == NULL || IS_ERR(fp)) {
if (fp != NULL)
DBG_871X_LEVEL(_drv_always_, "%s open %s fail, err:%ld\n"
, __func__, path, PTR_ERR(fp));
else
DBG_871X_LEVEL(_drv_always_, "%s open %s fail, fp is NULL\n"
, __func__, path);
fp = filp_open("/data/wifimac.txt", O_RDWR, 0644);
if (IS_ERR(fp)) {
pHalData->bloadmac_fail_flag = _TRUE;
DBG_871X("Error, wifi mac address file doesn't exist.\n");
} else {
fs = get_fs();
set_fs(KERNEL_DS);
goto exit;
}
DBG_871X("wifi mac address:\n");
vfs_read(fp, source_addr, 18, &pos);
source_addr[17] = ':';
temp[2] = 0; /* add end of string '\0' */
head = end = source_addr;
for (i=0; i<ETH_ALEN; i++) {
while (end && (*end != ':') )
end++;
fs = get_fs();
set_fs(KERNEL_DS);
if (end && (*end == ':') )
*end = '\0';
pHalData->EEPROMMACAddr[i] = simple_strtoul(head, NULL, 16 );
if (end) {
end++;
head = end;
}
DBG_871X("%02x \n", pHalData->EEPROMMACAddr[i]);
for (i = 0 ; i < HWSET_MAX_SIZE ; i++) {
vfs_read(fp, temp, 2, &pos);
if (sscanf(temp, "%hhx", &buf[i]) != 1) {
if (0)
DBG_871X_LEVEL(_drv_err_, "%s sscanf fail\n", __func__);
buf[i] = 0xFF;
}
if ((i % EFUSE_FILE_COLUMN_NUM) == (EFUSE_FILE_COLUMN_NUM - 1)) {
/* Filter the lates space char. */
vfs_read(fp, temp, 1, &pos);
if (strchr(temp, ' ') == NULL) {
pos--;
vfs_read(fp, temp, 2, &pos);
}
} else {
pos += 1; /* Filter the space character */
}
DBG_871X("\n");
set_fs(fs);
pHalData->bloadmac_fail_flag = _FALSE;
filp_close(fp, NULL);
}
if ( (_rtw_memcmp(pHalData->EEPROMMACAddr, null_mac_addr, ETH_ALEN)) ||
(_rtw_memcmp(pHalData->EEPROMMACAddr, multi_mac_addr, ETH_ALEN)) ) {
pHalData->EEPROMMACAddr[0] = 0x00;
pHalData->EEPROMMACAddr[1] = 0xe0;
pHalData->EEPROMMACAddr[2] = 0x4c;
pHalData->EEPROMMACAddr[3] = (u8)(curtime & 0xff) ;
pHalData->EEPROMMACAddr[4] = (u8)((curtime>>8) & 0xff) ;
pHalData->EEPROMMACAddr[5] = (u8)((curtime>>16) & 0xff) ;
}
set_fs(fs);
DBG_871X("Hal_ReadMACAddrFromFile: Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x !!!\n",
pHalData->EEPROMMACAddr[0], pHalData->EEPROMMACAddr[1],
pHalData->EEPROMMACAddr[2], pHalData->EEPROMMACAddr[3],
pHalData->EEPROMMACAddr[4], pHalData->EEPROMMACAddr[5]);
DBG_871X_LEVEL(_drv_always_, "efuse file: %s\n", path);
#ifdef CONFIG_DEBUG
for (i = 0; i < HWSET_MAX_SIZE; i++) {
if (i % 16 == 0)
DBG_871X_SEL_NL(RTW_DBGDUMP, "0x%03x: ", i);
DBG_871X_SEL(RTW_DBGDUMP, "%02X%s"
, buf[i]
, ((i + 1) % 16 == 0) ? "\n" : (((i + 1) % 8 == 0) ? " " : " ")
);
}
DBG_871X_SEL(RTW_DBGDUMP, "\n");
#endif
ret = _SUCCESS;
exit:
return ret;
}
u32 Rtw_Hal_readPGDataFromConfigFile(PADAPTER padapter)
u32 rtw_read_macaddr_from_file(const char *path, u8 *buf)
{
u32 i;
struct file *fp;
mm_segment_t fs;
u8 temp[3];
loff_t pos = 0;
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
u8 *PROMContent = pHalData->efuse_eeprom_data;
u8 source_addr[18];
u8 *head, *end;
int i;
u32 ret = _FAIL;
temp[2] = 0; // add end of string '\0'
_rtw_memset(source_addr, 0, 18);
fp = filp_open("/system/etc/wifi/wifi_efuse.map", O_RDWR, 0644);
if (IS_ERR(fp)) {
pHalData->bloadfile_fail_flag = _TRUE;
DBG_871X("Error, Efuse configure file doesn't exist.\n");
return _FAIL;
fp = filp_open(path, O_RDONLY, 0);
if (fp == NULL || IS_ERR(fp)) {
if (fp != NULL)
DBG_871X_LEVEL(_drv_always_, "%s open %s fail, err:%ld\n"
, __func__, path, PTR_ERR(fp));
else
DBG_871X_LEVEL(_drv_always_, "%s open %s fail, fp is NULL\n"
, __func__, path);
goto exit;
}
fs = get_fs();
set_fs(KERNEL_DS);
DBG_871X("Efuse configure file:\n");
for (i=0; i< EFUSE_MAP_SIZE ; i++) {
vfs_read(fp, temp, 2, &pos);
PROMContent[i] = simple_strtoul(temp, NULL, 16 );
pos += 1; // Filter the space character
DBG_871X("%02X \n", PROMContent[i]);
vfs_read(fp, source_addr, 18, &pos);
source_addr[17] = ':';
head = end = source_addr;
for (i = 0; i < ETH_ALEN; i++) {
while (end && (*end != ':'))
end++;
if (end && (*end == ':'))
*end = '\0';
if (sscanf(head, "%hhx", &buf[i]) != 1) {
if (0)
DBG_871X_LEVEL(_drv_err_, "%s sscanf fail\n", __func__);
buf[i] = 0xFF;
}
if (end) {
end++;
head = end;
}
}
DBG_871X("\n");
set_fs(fs);
filp_close(fp, NULL);
pHalData->bloadfile_fail_flag = _FALSE;
return _SUCCESS;
}
DBG_871X_LEVEL(_drv_always_, "wifi_mac file: %s\n", path);
#ifdef CONFIG_DEBUG
DBG_871X(MAC_FMT"\n", MAC_ARG(buf));
#endif
ret = _SUCCESS;
exit:
return ret;
}
#endif /* CONFIG_EFUSE_CONFIG_FILE */
#endif /* PLATFORM_LINUX */
#endif //#CONFIG_EFUSE_CONFIG_FILE

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,7 @@
#ifdef CONFIG_BEAMFORMING
#if (BEAMFORMING_SUPPORT == 0) /*for diver defined beamforming*/
struct beamforming_entry *beamforming_get_entry_by_addr(struct mlme_priv *pmlmepriv, u8* ra,u8* idx)
{
u8 i = 0;
@ -95,15 +96,18 @@ struct beamforming_entry *beamforming_add_entry(PADAPTER adapter, u8* ra, u16 ai
u16 BSSID = ((*(adapter_mac_addr(adapter) + 5) & 0xf0) >> 4) ^
(*(adapter_mac_addr(adapter) + 5) & 0xf); /* BSSID[44:47] xor BSSID[40:43] */
pEntry->p_aid = (aid + BSSID * 32) & 0x1ff; // (dec(A) + dec(B)*32) mod 512
pEntry->g_id = 63;
}
else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
{
pEntry->p_aid = 0;
pEntry->g_id = 63;
}
else
{
pEntry->p_aid = ra[5]; // BSSID[39:47]
pEntry->p_aid = (pEntry->p_aid << 1) | (ra[4] >> 7 );
pEntry->g_id = 0;
}
_rtw_memcpy(pEntry->mac_addr, ra, ETH_ALEN);
pEntry->bSound = _FALSE;
@ -113,9 +117,12 @@ struct beamforming_entry *beamforming_add_entry(PADAPTER adapter, u8* ra, u16 ai
pEntry->beamforming_entry_cap = beamfrom_cap;
pEntry->beamforming_entry_state = BEAMFORMING_ENTRY_STATE_UNINITIALIZE;
pEntry->LogSeq = 0xff;
pEntry->LogRetryCnt = 0;
pEntry->LogSuccessCnt = 0;
pEntry->PreLogSeq = 0; /*Modified by Jeffery @2015-04-13*/
pEntry->LogSeq = 0; /*Modified by Jeffery @2014-10-29*/
pEntry->LogRetryCnt = 0; /*Modified by Jeffery @2014-10-29*/
pEntry->LogSuccess = 0; /*LogSuccess is NOT needed to be accumulated, so LogSuccessCnt->LogSuccess, 2015-04-13, Jeffery*/
pEntry->ClockResetTimes = 0; /*Modified by Jeffery @2015-04-13*/
pEntry->LogStatusFailCnt = 0;
return pEntry;
@ -209,103 +216,85 @@ void beamforming_dym_period(PADAPTER Adapter)
rtw_hal_set_hwreg(Adapter, HW_VAR_SOUNDING_FW_NDPA, (u8 *)&Idx);
}
u32 beamforming_get_report_frame(PADAPTER Adapter, union recv_frame *precv_frame)
BOOLEAN issue_ht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, CHANNEL_WIDTH bw, u8 qidx)
{
u32 ret = _SUCCESS;
struct beamforming_entry *pBeamformEntry = NULL;
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
u8 *pframe = precv_frame->u.hdr.rx_data;
u32 frame_len = precv_frame->u.hdr.len;
u8 *ta;
u8 idx, offset;
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 ActionHdr[4] = {ACT_CAT_VENDOR, 0x00, 0xe0, 0x4c};
u8 *pframe;
u16 *fctrl;
u16 duration = 0;
u8 aSifsTime = 0;
u8 NDPTxRate = 0;
DBG_871X("%s: issue_ht_sw_ndpa_packet!\n", __func__);
NDPTxRate = MGN_MCS8;
DBG_871X("%s: NDPTxRate =%d\n", __func__, NDPTxRate);
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
//DBG_871X("beamforming_get_report_frame\n");
if (pmgntframe == NULL)
return _FALSE;
//Memory comparison to see if CSI report is the same with previous one
ta = GetAddr2Ptr(pframe);
pBeamformEntry = beamforming_get_entry_by_addr(pmlmepriv, ta, &idx);
if(pBeamformEntry->beamforming_entry_cap & BEAMFORMER_CAP_VHT_SU)
offset = 31; //24+(1+1+3)+2 MAC header+(Category+ActionCode+MIMOControlField)+SNR(Nc=2)
else if(pBeamformEntry->beamforming_entry_cap & BEAMFORMER_CAP_HT_EXPLICIT)
offset = 34; //24+(1+1+6)+2 MAC header+(Category+ActionCode+MIMOControlField)+SNR(Nc=2)
/*update attribute*/
pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(Adapter, pattrib);
pattrib->qsel = QSLT_MGNT;
pattrib->rate = NDPTxRate;
pattrib->bwmode = bw;
pattrib->order = 1;
pattrib->subtype = WIFI_ACTION_NOACK;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
*(fctrl) = 0;
SetOrderBit(pframe);
SetFrameSubType(pframe, WIFI_ACTION_NOACK);
_rtw_memcpy(pwlanhdr->addr1, ra, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, adapter_mac_addr(Adapter), ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
if (pmlmeext->cur_wireless_mode == WIRELESS_11B)
aSifsTime = 10;
else
return ret;
aSifsTime = 16;
//DBG_871X("%s MacId %d offset=%d\n", __FUNCTION__, pBeamformEntry->mac_id, offset);
if(_rtw_memcmp(pBeamformEntry->PreCsiReport + offset, pframe+offset, frame_len-offset) == _FALSE)
{
pBeamformEntry->DefaultCsiCnt = 0;
//DBG_871X("%s CSI report is NOT the same with previos one\n", __FUNCTION__);
}
else
{
pBeamformEntry->DefaultCsiCnt ++;
//DBG_871X("%s CSI report is the SAME with previos one\n", __FUNCTION__);
}
_rtw_memcpy(&pBeamformEntry->PreCsiReport, pframe, frame_len);
pBeamformEntry->bDefaultCSI = _FALSE;
if(pBeamformEntry->DefaultCsiCnt > 20)
pBeamformEntry->bDefaultCSI = _TRUE;
else
pBeamformEntry->bDefaultCSI = _FALSE;
duration = 2*aSifsTime + 40;
return ret;
if (bw == CHANNEL_WIDTH_40)
duration += 87;
else
duration += 180;
SetDuration(pframe, duration);
/*HT control field*/
SET_HT_CTRL_CSI_STEERING(pframe+24, 3);
SET_HT_CTRL_NDP_ANNOUNCEMENT(pframe+24, 1);
_rtw_memcpy(pframe+28, ActionHdr, 4);
pattrib->pktlen = 32;
pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(Adapter, pmgntframe);
return _TRUE;
}
void beamforming_get_ndpa_frame(PADAPTER Adapter, union recv_frame *precv_frame)
{
u8 *ta;
u8 idx, Sequence;
u8 *pframe = precv_frame->u.hdr.rx_data;
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
struct beamforming_entry *pBeamformEntry = NULL;
//DBG_871X("beamforming_get_ndpa_frame\n");
if(IS_HARDWARE_TYPE_8812(Adapter) == _FALSE)
return;
else if(GetFrameSubType(pframe) != WIFI_NDPA)
return;
ta = GetAddr2Ptr(pframe);
// Remove signaling TA.
ta[0] = ta[0] & 0xFE;
pBeamformEntry = beamforming_get_entry_by_addr(pmlmepriv, ta, &idx);
if(pBeamformEntry == NULL)
return;
else if(!(pBeamformEntry->beamforming_entry_cap & BEAMFORMEE_CAP_VHT_SU))
return;
else if(pBeamformEntry->LogSuccessCnt > 1)
return;
Sequence = (pframe[16]) >> 2;
if(pBeamformEntry->LogSeq != Sequence)
{
/* Previous frame doesn't retry when meet new sequence number */
if(pBeamformEntry->LogSeq != 0xff && pBeamformEntry->LogRetryCnt == 0)
pBeamformEntry->LogSuccessCnt++;
pBeamformEntry->LogSeq = Sequence;
pBeamformEntry->LogRetryCnt = 0;
}
else
{
if(pBeamformEntry->LogRetryCnt == 3)
beamforming_wk_cmd(Adapter, BEAMFORMING_CTRL_SOUNDING_CLK, NULL, 0, 1);
pBeamformEntry->LogRetryCnt++;
}
DBG_871X("%s LogSeq %d LogRetryCnt %d LogSuccessCnt %d\n",
__FUNCTION__, pBeamformEntry->LogSeq, pBeamformEntry->LogRetryCnt, pBeamformEntry->LogSuccessCnt);
}
BOOLEAN issue_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, CHANNEL_WIDTH bw, u8 qidx)
{
struct xmit_frame *pmgntframe;
@ -320,12 +309,12 @@ BOOLEAN issue_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, CHANNEL_WIDTH bw, u8 qidx
u16 duration = 0;
u8 aSifsTime = 0;
if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL)
{
return _FALSE;
}
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
//update attribute
if (pmgntframe == NULL)
return _FALSE;
/*update attribute*/
pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(Adapter, pattrib);
@ -385,7 +374,100 @@ BOOLEAN beamforming_send_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, CHANNEL_WIDTH
{
return issue_ht_ndpa_packet(Adapter, ra, bw, qidx);
}
BOOLEAN issue_vht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, CHANNEL_WIDTH bw, u8 qidx)
{
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
struct rtw_ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(Adapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
struct beamforming_info *pBeamInfo = GET_BEAMFORM_INFO(pmlmepriv);
struct rtw_ndpa_sta_info sta_info;
u8 NDPTxRate = 0;
u8 *pframe;
u16 *fctrl;
u16 duration = 0;
u8 sequence = 0, aSifsTime = 0;
DBG_871X("%s: issue_vht_sw_ndpa_packet!\n", __func__);
NDPTxRate = MGN_VHT2SS_MCS0;
DBG_871X("%s: NDPTxRate =%d\n", __func__, NDPTxRate);
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (pmgntframe == NULL) {
DBG_871X("%s, alloc mgnt frame fail\n", __func__);
return _FALSE;
}
/*update attribute*/
pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(Adapter, pattrib);
pattrib->qsel = QSLT_MGNT;
pattrib->rate = NDPTxRate;
pattrib->bwmode = bw;
pattrib->subtype = WIFI_NDPA;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
fctrl = &pwlanhdr->frame_ctl;
*(fctrl) = 0;
SetFrameSubType(pframe, WIFI_NDPA);
_rtw_memcpy(pwlanhdr->addr1, ra, ETH_ALEN);
_rtw_memcpy(pwlanhdr->addr2, adapter_mac_addr(Adapter), ETH_ALEN);
if (IsSupported5G(pmlmeext->cur_wireless_mode) || IsSupportedHT(pmlmeext->cur_wireless_mode))
aSifsTime = 16;
else
aSifsTime = 10;
duration = 2*aSifsTime + 44;
if (bw == CHANNEL_WIDTH_80)
duration += 40;
else if (bw == CHANNEL_WIDTH_40)
duration += 87;
else
duration += 180;
SetDuration(pframe, duration);
sequence = pBeamInfo->sounding_sequence << 2;
if (pBeamInfo->sounding_sequence >= 0x3f)
pBeamInfo->sounding_sequence = 0;
else
pBeamInfo->sounding_sequence++;
_rtw_memcpy(pframe+16, &sequence, 1);
if (((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE))
aid = 0;
sta_info.aid = aid;
sta_info.feedback_type = 0;
sta_info.nc_index = 0;
_rtw_memcpy(pframe+17, (u8 *)&sta_info, 2);
pattrib->pktlen = 19;
pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(Adapter, pmgntframe);
return _TRUE;
}
BOOLEAN issue_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, CHANNEL_WIDTH bw, u8 qidx)
{
struct xmit_frame *pmgntframe;
@ -403,11 +485,9 @@ BOOLEAN issue_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, CHANNEL_WIDTH b
u8 sequence = 0, aSifsTime = 0;
if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL)
{
return _FALSE;
}
//update attribute
/*update attribute*/
pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(Adapter, pattrib);
@ -771,6 +851,8 @@ BOOLEAN beamforming_init_entry(PADAPTER adapter, struct sta_info *psta, u8* idx)
}
pBeamformEntry->beamforming_entry_state = BEAMFORMING_ENTRY_STATE_INITIALIZED;
psta->txbf_paid = pBeamformEntry->p_aid;
psta->txbf_gid = pBeamformEntry->g_id;
DBG_871X("%s Idx %d\n", __FUNCTION__, *idx);
} else {
@ -913,14 +995,158 @@ void beamforming_watchdog(PADAPTER Adapter)
beamforming_dym_period(Adapter);
beamforming_dym_ndpa_rate(Adapter);
}
#endif/* #if (BEAMFORMING_SUPPORT ==0) - for diver defined beamforming*/
u32 beamforming_get_report_frame(PADAPTER Adapter, union recv_frame *precv_frame)
{
u32 ret = _SUCCESS;
#if (BEAMFORMING_SUPPORT == 1)
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
ret = Beamforming_GetReportFrame(pDM_Odm, precv_frame);
#else /*(BEAMFORMING_SUPPORT == 0)- for drv beamfoming*/
struct beamforming_entry *pBeamformEntry = NULL;
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
u8 *pframe = precv_frame->u.hdr.rx_data;
u32 frame_len = precv_frame->u.hdr.len;
u8 *ta;
u8 idx, offset;
/*DBG_871X("beamforming_get_report_frame\n");*/
/*Memory comparison to see if CSI report is the same with previous one*/
ta = GetAddr2Ptr(pframe);
pBeamformEntry = beamforming_get_entry_by_addr(pmlmepriv, ta, &idx);
if (pBeamformEntry->beamforming_entry_cap & BEAMFORMER_CAP_VHT_SU)
offset = 31; /*24+(1+1+3)+2 MAC header+(Category+ActionCode+MIMOControlField)+SNR(Nc=2)*/
else if (pBeamformEntry->beamforming_entry_cap & BEAMFORMER_CAP_HT_EXPLICIT)
offset = 34; /*24+(1+1+6)+2 MAC header+(Category+ActionCode+MIMOControlField)+SNR(Nc=2)*/
else
return ret;
/*DBG_871X("%s MacId %d offset=%d\n", __FUNCTION__, pBeamformEntry->mac_id, offset);*/
if (_rtw_memcmp(pBeamformEntry->PreCsiReport + offset, pframe+offset, frame_len-offset) == _FALSE)
pBeamformEntry->DefaultCsiCnt = 0;
else
pBeamformEntry->DefaultCsiCnt++;
_rtw_memcpy(&pBeamformEntry->PreCsiReport, pframe, frame_len);
pBeamformEntry->bDefaultCSI = _FALSE;
if (pBeamformEntry->DefaultCsiCnt > 20)
pBeamformEntry->bDefaultCSI = _TRUE;
else
pBeamformEntry->bDefaultCSI = _FALSE;
#endif
return ret;
}
void beamforming_get_ndpa_frame(PADAPTER Adapter, union recv_frame *precv_frame)
{
#if (BEAMFORMING_SUPPORT == 1)
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
Beamforming_GetNDPAFrame(pDM_Odm, precv_frame);
#else /*(BEAMFORMING_SUPPORT == 0)- for drv beamfoming*/
u8 *ta;
u8 idx, Sequence;
u8 *pframe = precv_frame->u.hdr.rx_data;
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
struct beamforming_entry *pBeamformEntry = NULL;
/*DBG_871X("beamforming_get_ndpa_frame\n");*/
if (IS_HARDWARE_TYPE_8812(Adapter) == _FALSE)
return;
else if (GetFrameSubType(pframe) != WIFI_NDPA)
return;
ta = GetAddr2Ptr(pframe);
/*Remove signaling TA. */
ta[0] = ta[0] & 0xFE;
pBeamformEntry = beamforming_get_entry_by_addr(pmlmepriv, ta, &idx);
if (pBeamformEntry == NULL)
return;
else if (!(pBeamformEntry->beamforming_entry_cap & BEAMFORMEE_CAP_VHT_SU))
return;
/*LogSuccess: As long as 8812A receive NDPA and feedback CSI succeed once, clock reset is NO LONGER needed !2015-04-10, Jeffery*/
/*ClockResetTimes: While BFer entry always doesn't receive our CSI, clock will reset again and again.So ClockResetTimes is limited to 5 times.2015-04-13, Jeffery*/
else if ((pBeamformEntry->LogSuccess == 1) || (pBeamformEntry->ClockResetTimes == 5)) {
DBG_871X("[%s] LogSeq=%d, PreLogSeq=%d\n", __func__, pBeamformEntry->LogSeq, pBeamformEntry->PreLogSeq);
return;
}
Sequence = (pframe[16]) >> 2;
DBG_871X("[%s] Start, Sequence=%d, LogSeq=%d, PreLogSeq=%d, LogRetryCnt=%d, ClockResetTimes=%d, LogSuccess=%d\n",
__func__, Sequence, pBeamformEntry->LogSeq, pBeamformEntry->PreLogSeq, pBeamformEntry->LogRetryCnt, pBeamformEntry->ClockResetTimes, pBeamformEntry->LogSuccess);
if ((pBeamformEntry->LogSeq != 0) && (pBeamformEntry->PreLogSeq != 0)) {
/*Success condition*/
if ((pBeamformEntry->LogSeq != Sequence) && (pBeamformEntry->PreLogSeq != pBeamformEntry->LogSeq)) {
/* break option for clcok reset, 2015-03-30, Jeffery */
pBeamformEntry->LogRetryCnt = 0;
/*As long as 8812A receive NDPA and feedback CSI succeed once, clock reset is no longer needed.*/
/*That is, LogSuccess is NOT needed to be reset to zero, 2015-04-13, Jeffery*/
pBeamformEntry->LogSuccess = 1;
} else {/*Fail condition*/
if (pBeamformEntry->LogRetryCnt == 5) {
pBeamformEntry->ClockResetTimes++;
pBeamformEntry->LogRetryCnt = 0;
DBG_871X("[%s] Clock Reset!!! ClockResetTimes=%d\n", __func__, pBeamformEntry->ClockResetTimes);
beamforming_wk_cmd(Adapter, BEAMFORMING_CTRL_SOUNDING_CLK, NULL, 0, 1);
} else
pBeamformEntry->LogRetryCnt++;
}
}
/*Update LogSeq & PreLogSeq*/
pBeamformEntry->PreLogSeq = pBeamformEntry->LogSeq;
pBeamformEntry->LogSeq = Sequence;
#endif
}
void beamforming_wk_hdl(_adapter *padapter, u8 type, u8 *pbuf)
{
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
_func_enter_;
switch(type)
#if (BEAMFORMING_SUPPORT == 1) /*(BEAMFORMING_SUPPORT == 1)- for PHYDM beamfoming*/
switch (type) {
case BEAMFORMING_CTRL_ENTER:
{
struct sta_info *psta = (PVOID)pbuf;
u16 staIdx = psta->mac_id;
Beamforming_Enter(pDM_Odm, staIdx);
break;
}
case BEAMFORMING_CTRL_LEAVE:
Beamforming_Leave(pDM_Odm, pbuf);
break;
default:
break;
}
#else /*(BEAMFORMING_SUPPORT == 0)- for drv beamfoming*/
switch (type) {
case BEAMFORMING_CTRL_ENTER:
beamforming_enter(padapter, (PVOID)pbuf);
break;
@ -940,7 +1166,7 @@ _func_enter_;
default:
break;
}
#endif
_func_exit_;
}
@ -1006,5 +1232,13 @@ _func_exit_;
return res;
}
#endif //CONFIG_BEAMFORMING
void update_attrib_txbf_info(_adapter *padapter, struct pkt_attrib *pattrib, struct sta_info *psta)
{
if (psta) {
pattrib->txbf_g_id = psta->txbf_gid;
pattrib->txbf_p_aid = psta->txbf_paid;
}
}
#endif

View File

@ -48,8 +48,11 @@
#include <linux/ipv6.h>
#include <linux/icmpv6.h>
#include <net/ndisc.h>
#include <net/checksum.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
#include <net/ip6_checksum.h>
#else
#include <net/checksum.h>
#endif
#endif
#endif

View File

@ -393,14 +393,14 @@ void mptbt_close_WiFiRF(PADAPTER Adapter)
{
PHY_SetBBReg(Adapter, 0x824, 0xF, 0x0);
PHY_SetBBReg(Adapter, 0x824, 0x700000, 0x0);
PHY_SetRFReg(Adapter, RF90_PATH_A, 0x0, 0xF0000, 0x0);
PHY_SetRFReg(Adapter, RF_PATH_A, 0x0, 0xF0000, 0x0);
}
void mptbt_open_WiFiRF(PADAPTER Adapter)
{
PHY_SetBBReg(Adapter, 0x824, 0x700000, 0x3);
PHY_SetBBReg(Adapter, 0x824, 0xF, 0x2);
PHY_SetRFReg(Adapter, RF90_PATH_A, 0x0, 0xF0000, 0x3);
PHY_SetRFReg(Adapter, RF_PATH_A, 0x0, 0xF0000, 0x3);
}
u4Byte mptbt_switch_RF(PADAPTER Adapter, u1Byte Enter)

View File

@ -192,6 +192,20 @@ void rtw_btcoex_BtInfoNotify(PADAPTER padapter, u8 length, u8 *tmpBuf)
hal_btcoex_BtInfoNotify(padapter, length, tmpBuf);
}
void rtw_btcoex_BtMpRptNotify(PADAPTER padapter, u8 length, u8 *tmpBuf)
{
PHAL_DATA_TYPE pHalData;
pHalData = GET_HAL_DATA(padapter);
if (_FALSE == pHalData->EEPROMBluetoothCoexist)
return;
if (padapter->registrypriv.mp_mode == 1)
return;
hal_btcoex_BtMpRptNotify(padapter, length, tmpBuf);
}
void rtw_btcoex_SuspendNotify(PADAPTER padapter, u8 state)
{
PHAL_DATA_TYPE pHalData;
@ -219,10 +233,9 @@ void rtw_btcoex_HaltNotify(PADAPTER padapter)
return;
}
if (_TRUE == padapter->bSurpriseRemoved)
{
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved=%d Skip!\n",
FUNC_ADPT_ARG(padapter), padapter->bSurpriseRemoved);
if (rtw_is_surprise_removed(padapter)) {
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved=%s Skip!\n",
FUNC_ADPT_ARG(padapter), rtw_is_surprise_removed(padapter)?"True":"False");
return;
}
@ -230,6 +243,17 @@ void rtw_btcoex_HaltNotify(PADAPTER padapter)
hal_btcoex_HaltNotify(padapter);
}
void rtw_btcoex_ScoreBoardStatusNotify(PADAPTER padapter, u8 length, u8 *tmpBuf)
{
PHAL_DATA_TYPE pHalData;
pHalData = GET_HAL_DATA(padapter);
if (_FALSE == pHalData->EEPROMBluetoothCoexist)
return;
hal_btcoex_ScoreBoardStatusNotify(padapter, length, tmpBuf);
}
void rtw_btcoex_SwitchBtTRxMask(PADAPTER padapter)
{
hal_btcoex_SwitchBtTRxMask(padapter);
@ -403,6 +427,11 @@ void rtw_btcoex_StackUpdateProfileInfo(void)
hal_btcoex_StackUpdateProfileInfo();
}
void rtw_btcoex_BTOffOnNotify(PADAPTER padapter, u8 bBTON)
{
hal_btcoex_BTOffOnNotify(padapter, bBTON);
}
// ==================================================
// Below Functions are called by BT-Coex
// ==================================================
@ -439,6 +468,16 @@ void rtw_btcoex_LPS_Leave(PADAPTER padapter)
}
}
u16 rtw_btcoex_btreg_read(PADAPTER padapter, u8 type, u16 addr, u32 *data)
{
return hal_btcoex_btreg_read(padapter, type, addr, data);
}
u16 rtw_btcoex_btreg_write(PADAPTER padapter, u8 type, u16 addr, u16 val)
{
return hal_btcoex_btreg_write(padapter, type, addr, val);
}
// ==================================================
// Below Functions are BT-Coex socket related function
@ -548,10 +587,10 @@ u8 rtw_btcoex_parse_BT_info_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen)
RTW_HCI_STATUS status = HCI_STATUS_SUCCESS;
rtw_HCI_event *pEvent;
DBG_871X("%s\n",__func__);
/* DBG_871X("%s\n",__func__);
DBG_871X("current Poll Enable: %d, currrent Poll Time: %d\n",curPollEnable,curPollTime);
DBG_871X("BT Info reason: %d, BT Info length: %d\n",btInfoReason,btInfoLen);
/*DBG_871X("%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n"
DBG_871X("%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n"
,pcmd[4],pcmd[5],pcmd[6],pcmd[7],pcmd[8],pcmd[9],pcmd[10],pcmd[11]);*/
_rtw_memset(btinfo, 0, BT_INFO_LENGTH);
@ -1189,8 +1228,7 @@ void rtw_btcoex_parse_hci_cmd(_adapter *padapter, u8 *pcmd, u16 len)
u8 cmdlen = len -3;
u8 pare_len = pcmd[2];
DBG_871X("%s\n",__func__);
DBG_871X("OGF: %x,OCF: %x\n",hci_OGF,hci_OCF);
DBG_871X("%s OGF: %x,OCF: %x\n", __func__, hci_OGF, hci_OCF);
switch(hci_OGF)
{
case OGF_EXTENSION:
@ -1230,11 +1268,11 @@ u16 rtw_btcoex_parse_recv_data(u8 *msg, u8 msg_size)
} else if (_rtw_memcmp(cmp_msg6, msg, msg_size) == _TRUE) {
res = RX_INVITE_RSP;
} else {
DBG_871X("%s, %s\n", __func__, msg);
/*DBG_871X("%s, %s\n", __func__, msg);*/
res = OTHER;
}
DBG_871X("%s, res:%d\n", __func__, res);
/*DBG_871X("%s, res:%d\n", __func__, res);*/
return res;
}
@ -1244,7 +1282,6 @@ void rtw_btcoex_recvmsgbysocket(void *data)
u8 recv_data[255];
u8 tx_msg[255] = leave_ack;
u32 len = 0;
u16 recv_length = 0;
u16 parse_res = 0;
#if 0
@ -1256,7 +1293,7 @@ void rtw_btcoex_recvmsgbysocket(void *data)
struct sock *sk = NULL;
struct sk_buff *skb = NULL;
DBG_871X("%s\n",__func__);
/*DBG_871X("%s\n",__func__);*/
if (pbtcoexadapter == NULL) {
DBG_871X("%s: btcoexadapter NULL!\n", __func__);
@ -1320,12 +1357,14 @@ void rtw_btcoex_recvmsgbysocket(void *data)
/* attend ack */
pcoex_info->BT_attend = _TRUE;
DBG_871X("RX_ATTEND_ACK!,sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
rtw_btcoex_BTOffOnNotify(pbtcoexadapter, pcoex_info->BT_attend);
break;
case RX_ATTEND_REQ:
pcoex_info->BT_attend = _TRUE;
DBG_871X("RX_BT_ATTEND_REQ!,sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
rtw_btcoex_sendmsgbysocket(pbtcoexadapter, attend_ack, sizeof(attend_ack), _FALSE);
rtw_btcoex_BTOffOnNotify(pbtcoexadapter, pcoex_info->BT_attend);
break;
case RX_INVITE_REQ:
@ -1333,25 +1372,29 @@ void rtw_btcoex_recvmsgbysocket(void *data)
pcoex_info->BT_attend = _TRUE;
DBG_871X("RX_INVITE_REQ!,sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
rtw_btcoex_sendmsgbysocket(pbtcoexadapter, invite_rsp, sizeof(invite_rsp), _FALSE);
rtw_btcoex_BTOffOnNotify(pbtcoexadapter, pcoex_info->BT_attend);
break;
case RX_INVITE_RSP:
/*invite rsp*/
pcoex_info->BT_attend = _TRUE;
DBG_871X("RX_INVITE_RSP!,sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
rtw_btcoex_BTOffOnNotify(pbtcoexadapter, pcoex_info->BT_attend);
break;
case RX_LEAVE_ACK:
/* mean BT know wifi will leave */
pcoex_info->BT_attend = _FALSE;
DBG_871X("RX_LEAVE_ACK!,sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
DBG_871X("RX_LEAVE_ACK!,sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
rtw_btcoex_BTOffOnNotify(pbtcoexadapter, pcoex_info->BT_attend);
break;
case RX_BT_LEAVE:
/* BT leave */
rtw_btcoex_sendmsgbysocket(pbtcoexadapter, leave_ack, sizeof(leave_ack), _FALSE); /* no ack */
pcoex_info->BT_attend = _FALSE;
DBG_871X("RX_BT_LEAVE!sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
DBG_871X("RX_BT_LEAVE!sock_open:%d, BT_attend:%d\n", pcoex_info->sock_open, pcoex_info->BT_attend);
rtw_btcoex_BTOffOnNotify(pbtcoexadapter, pcoex_info->BT_attend);
break;
default:
@ -1396,7 +1439,7 @@ u8 rtw_btcoex_sendmsgbysocket(_adapter *padapter, u8 *msg, u8 msg_size, bool for
struct iovec iov;
struct bt_coex_info *pcoex_info = &padapter->coex_info;
DBG_871X("%s: msg:%s, force:%s\n", __func__, msg, force == _TRUE?"TRUE":"FALSE");
/* DBG_871X("%s: msg:%s, force:%s\n", __func__, msg, force == _TRUE?"TRUE":"FALSE"); */
if (_FALSE == force) {
if (_FALSE == pcoex_info->BT_attend) {
DBG_871X("TX Blocked: WiFi-BT disconnected\n");
@ -1408,14 +1451,28 @@ u8 rtw_btcoex_sendmsgbysocket(_adapter *padapter, u8 *msg, u8 msg_size, bool for
iov.iov_len = msg_size;
udpmsg.msg_name = &pcoex_info->bt_sockaddr;
udpmsg.msg_namelen = sizeof(struct sockaddr_in);
udpmsg.msg_iov = &iov;
udpmsg.msg_iovlen = 1;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
/* referece:sock_xmit in kernel code
* WRITE for sock_sendmsg, READ for sock_recvmsg
* third parameter for msg_iovlen
* last parameter for iov_len
*/
iov_iter_init(&udpmsg.msg_iter, WRITE, &iov, 1, msg_size);
#else
udpmsg.msg_iov = &iov;
udpmsg.msg_iovlen = 1;
#endif
udpmsg.msg_control = NULL;
udpmsg.msg_controllen = 0;
udpmsg.msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL;
oldfs = get_fs();
set_fs(KERNEL_DS);
error = sock_sendmsg(pcoex_info->udpsock, &udpmsg, msg_size);
set_fs(KERNEL_DS);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
error = sock_sendmsg(pcoex_info->udpsock, &udpmsg);
#else
error = sock_sendmsg(pcoex_info->udpsock, &udpmsg, msg_size);
#endif
set_fs(oldfs);
if (error < 0) {
DBG_871X("Error when sendimg msg, error:%d\n", error);
@ -1504,6 +1561,9 @@ void rtw_btcoex_init_socket(_adapter *padapter)
INIT_DELAYED_WORK(&pcoex_info->recvmsg_work,
(void *)rtw_btcoex_recvmsgbysocket);
pbtcoexadapter = padapter;
/* We expect BT is off if BT don't send ack to wifi */
DBG_871X("We expect BT is off if BT send ack to wifi\n");
rtw_btcoex_BTOffOnNotify(pbtcoexadapter, _FALSE);
if (rtw_btcoex_create_kernel_socket(padapter) == _SUCCESS) {
pcoex_info->is_exist = _TRUE;
} else {
@ -1529,14 +1589,16 @@ void rtw_btcoex_close_socket(_adapter *padapter)
rtw_btcoex_sendmsgbysocket(padapter, wifi_leave, sizeof(wifi_leave), _FALSE);
msleep(50);
}
if (pcoex_info->btcoex_wq != NULL) {
flush_workqueue(pcoex_info->btcoex_wq);
destroy_workqueue(pcoex_info->btcoex_wq);
}
rtw_btcoex_close_kernel_socket(padapter);
pbtcoexadapter = NULL;
pcoex_info->is_exist = _FALSE;
}
if (pcoex_info->btcoex_wq != NULL) {
flush_workqueue(pcoex_info->btcoex_wq);
destroy_workqueue(pcoex_info->btcoex_wq);
}
}
void rtw_btcoex_dump_tx_msg(u8 *tx_msg, u8 len, u8 *msg_name)
@ -1602,7 +1664,7 @@ void rtw_btcoex_SendEventExtBtInfoControl(PADAPTER padapter, u8 dataLen, void *p
struct bt_coex_info *pcoex_info = &padapter->coex_info;
PBT_MGNT pBtMgnt = &pcoex_info->BtMgnt;
DBG_871X("%s\n",__func__);
/* DBG_871X("%s\n",__func__);*/
if(pBtMgnt->ExtConfig.HCIExtensionVer < 4) //not support
{
DBG_871X("ERROR: HCIExtensionVer = %d, HCIExtensionVer<4 !!!!\n",pBtMgnt->ExtConfig.HCIExtensionVer);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -48,8 +48,8 @@ void shift_out_bits(_adapter * padapter, u16 data, u16 count)
u16 x,mask;
_func_enter_;
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
mask = 0x01 << (count - 1);
@ -62,9 +62,9 @@ _func_enter_;
x &= ~_EEDI;
if(data & mask)
x |= _EEDI;
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
goto out;
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
rtw_write8(padapter, EE_9346CR, (u8)x);
rtw_udelay_os(CLOCK_RATE);
@ -72,8 +72,8 @@ _func_enter_;
down_clk(padapter, &x);
mask = mask >> 1;
} while(mask);
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
x &= ~_EEDI;
@ -86,8 +86,8 @@ u16 shift_in_bits (_adapter * padapter)
{
u16 x,d=0,i;
_func_enter_;
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
x = rtw_read8(padapter, EE_9346CR);
@ -99,8 +99,8 @@ _func_enter_;
{
d = d << 1;
up_clk(padapter, &x);
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
x = rtw_read8(padapter, EE_9346CR);
@ -157,24 +157,24 @@ void eeprom_clean(_adapter * padapter)
{
u16 x;
_func_enter_;
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
x = rtw_read8(padapter, EE_9346CR);
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
x &= ~(_EECS | _EEDI);
rtw_write8(padapter, EE_9346CR, (u8)x);
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
up_clk(padapter, &x);
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
down_clk(padapter, &x);
@ -288,15 +288,15 @@ u16 eeprom_read16(_adapter * padapter, u16 reg) //ReadEEprom
#endif
_func_enter_;
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
// select EEPROM, reset bits, set _EECS
x = rtw_read8(padapter, EE_9346CR);
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
@ -337,15 +337,15 @@ void eeprom_read_sz(_adapter * padapter, u16 reg, u8* data, u32 sz)
u16 x, data16;
u32 i;
_func_enter_;
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}
// select EEPROM, reset bits, set _EECS
x = rtw_read8(padapter, EE_9346CR);
if(padapter->bSurpriseRemoved==_TRUE){
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
if (rtw_is_surprise_removed(padapter)) {
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
goto out;
}

View File

@ -50,6 +50,7 @@ jackson@realtek.com.tw
#define _RTW_IO_C_
#include <drv_types.h>
#include <hal_data.h>
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
#error "Shall be Linux or Windows, but not both!\n"
@ -197,6 +198,111 @@ u8 _rtw_sd_f0_read8(_adapter *adapter, u32 addr)
_func_exit_;
return r_val;
}
#ifdef CONFIG_SDIO_INDIRECT_ACCESS
u8 _rtw_sd_iread8(_adapter *adapter, u32 addr)
{
u8 r_val = 0x00;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u8 (*_sd_iread8)(struct intf_hdl *pintfhdl, u32 addr);
_sd_iread8 = pintfhdl->io_ops._sd_iread8;
if (_sd_iread8)
r_val = _sd_iread8(pintfhdl, addr);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iread8 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return r_val;
}
u16 _rtw_sd_iread16(_adapter *adapter, u32 addr)
{
u16 r_val = 0x00;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u16 (*_sd_iread16)(struct intf_hdl *pintfhdl, u32 addr);
_sd_iread16 = pintfhdl->io_ops._sd_iread16;
if (_sd_iread16)
r_val = _sd_iread16(pintfhdl, addr);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iread16 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return r_val;
}
u32 _rtw_sd_iread32(_adapter *adapter, u32 addr)
{
u32 r_val = 0x00;
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
u32 (*_sd_iread32)(struct intf_hdl *pintfhdl, u32 addr);
_sd_iread32 = pintfhdl->io_ops._sd_iread32;
if (_sd_iread32)
r_val = _sd_iread32(pintfhdl, addr);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iread32 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return r_val;
}
int _rtw_sd_iwrite8(_adapter *adapter, u32 addr, u8 val)
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_sd_iwrite8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
int ret = -1;
_sd_iwrite8 = pintfhdl->io_ops._sd_iwrite8;
if (_sd_iwrite8)
ret = _sd_iwrite8(pintfhdl, addr, val);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iwrite8 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return RTW_STATUS_CODE(ret);
}
int _rtw_sd_iwrite16(_adapter *adapter, u32 addr, u16 val)
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_sd_iwrite16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
int ret = -1;
_sd_iwrite16 = pintfhdl->io_ops._sd_iwrite16;
if (_sd_iwrite16)
ret = _sd_iwrite16(pintfhdl, addr, val);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iwrite16 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return RTW_STATUS_CODE(ret);
}
int _rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val)
{
struct io_priv *pio_priv = &adapter->iopriv;
struct intf_hdl *pintfhdl = &(pio_priv->intf);
int (*_sd_iwrite32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
int ret = -1;
_sd_iwrite32 = pintfhdl->io_ops._sd_iwrite32;
if (_sd_iwrite32)
ret = _sd_iwrite32(pintfhdl, addr, val);
else
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iwrite32 callback is NULL\n", FUNC_ADPT_ARG(adapter));
return RTW_STATUS_CODE(ret);
}
#endif /* CONFIG_SDIO_INDIRECT_ACCESS */
#endif /* CONFIG_SDIO_HCI */
int _rtw_write8_async(_adapter *adapter, u32 addr, u8 val)
@ -254,10 +360,11 @@ void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
_func_enter_;
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
{
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
return;
if (RTW_CANNOT_RUN(adapter)) {
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%s) OR bSurpriseRemoved(%s)"
, rtw_is_drv_stopped(adapter)?"True":"False"
, rtw_is_surprise_removed(adapter)?"True":"False"));
return;
}
_read_mem = pintfhdl->io_ops._read_mem;
@ -294,9 +401,10 @@ void _rtw_read_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
_func_enter_;
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
{
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
if (RTW_CANNOT_RUN(adapter)) {
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%s) OR bSurpriseRemoved(%s)"
, rtw_is_drv_stopped(adapter)?"True":"False"
, rtw_is_surprise_removed(adapter)?"True":"False"));
return;
}
@ -416,19 +524,19 @@ void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
#ifdef DBG_IO
u16 read_sniff_ranges[][2] = {
u32 read_sniff_ranges[][2] = {
//{0x520, 0x523},
};
u16 write_sniff_ranges[][2] = {
u32 write_sniff_ranges[][2] = {
//{0x520, 0x523},
//{0x4c, 0x4c},
};
int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u16)/2;
int write_sniff_num = sizeof(write_sniff_ranges)/sizeof(u16)/2;
int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u32)/2;
int write_sniff_num = sizeof(write_sniff_ranges)/sizeof(u32)/2;
bool match_read_sniff_ranges(u16 addr, u16 len)
bool match_read_sniff_ranges(u32 addr, u16 len)
{
int i;
for (i = 0; i<read_sniff_num; i++) {
@ -439,7 +547,7 @@ bool match_read_sniff_ranges(u16 addr, u16 len)
return _FALSE;
}
bool match_write_sniff_ranges(u16 addr, u16 len)
bool match_write_sniff_ranges(u32 addr, u16 len)
{
int i;
for (i = 0; i<write_sniff_num; i++) {
@ -450,6 +558,51 @@ bool match_write_sniff_ranges(u16 addr, u16 len)
return _FALSE;
}
struct rf_sniff_ent {
u8 path;
u16 reg;
u32 mask;
};
struct rf_sniff_ent rf_read_sniff_ranges[] = {
/* example for all path addr 0x55 with all RF Reg mask */
/* {MAX_RF_PATH, 0x55, bRFRegOffsetMask}, */
};
struct rf_sniff_ent rf_write_sniff_ranges[] = {
/* example for all path addr 0x55 with all RF Reg mask */
/* {MAX_RF_PATH, 0x55, bRFRegOffsetMask}, */
};
int rf_read_sniff_num = sizeof(rf_read_sniff_ranges)/sizeof(struct rf_sniff_ent);
int rf_write_sniff_num = sizeof(rf_write_sniff_ranges)/sizeof(struct rf_sniff_ent);
bool match_rf_read_sniff_ranges(u8 path, u32 addr, u32 mask)
{
int i;
for (i = 0; i < rf_read_sniff_num; i++) {
if (rf_read_sniff_ranges[i].path == MAX_RF_PATH || rf_read_sniff_ranges[i].path == path)
if (addr == rf_read_sniff_ranges[i].reg && (mask & rf_read_sniff_ranges[i].mask))
return _TRUE;
}
return _FALSE;
}
bool match_rf_write_sniff_ranges(u8 path, u32 addr, u32 mask)
{
int i;
for (i = 0; i < rf_write_sniff_num; i++) {
if (rf_write_sniff_ranges[i].path == MAX_RF_PATH || rf_write_sniff_ranges[i].path == path)
if (addr == rf_write_sniff_ranges[i].reg && (mask & rf_write_sniff_ranges[i].mask))
return _TRUE;
}
return _FALSE;
}
u8 dbg_rtw_read8(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u8 val = _rtw_read8(adapter, addr);
@ -508,6 +661,77 @@ int dbg_rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *data, const cha
return _rtw_writeN(adapter, addr, length, data);
}
#ifdef CONFIG_SDIO_HCI
u8 dbg_rtw_sd_f0_read8(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u8 val = _rtw_sd_f0_read8(adapter, addr);
#if 0
if (match_read_sniff_ranges(addr, 1))
DBG_871X("DBG_IO %s:%d rtw_sd_f0_read8(0x%04x) return 0x%02x\n", caller, line, addr, val);
#endif
return val;
}
#ifdef CONFIG_SDIO_INDIRECT_ACCESS
u8 dbg_rtw_sd_iread8(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u8 val = rtw_sd_iread8(adapter, addr);
if (match_read_sniff_ranges(addr, 1))
DBG_871X("DBG_IO %s:%d rtw_sd_iread8(0x%04x) return 0x%02x\n", caller, line, addr, val);
return val;
}
u16 dbg_rtw_sd_iread16(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u16 val = _rtw_sd_iread16(adapter, addr);
if (match_read_sniff_ranges(addr, 2))
DBG_871X("DBG_IO %s:%d rtw_sd_iread16(0x%04x) return 0x%04x\n", caller, line, addr, val);
return val;
}
u32 dbg_rtw_sd_iread32(_adapter *adapter, u32 addr, const char *caller, const int line)
{
u32 val = _rtw_sd_iread32(adapter, addr);
if (match_read_sniff_ranges(addr, 4))
DBG_871X("DBG_IO %s:%d rtw_sd_iread32(0x%04x) return 0x%08x\n", caller, line, addr, val);
return val;
}
int dbg_rtw_sd_iwrite8(_adapter *adapter, u32 addr, u8 val, const char *caller, const int line)
{
if (match_write_sniff_ranges(addr, 1))
DBG_871X("DBG_IO %s:%d rtw_sd_iwrite8(0x%04x, 0x%02x)\n", caller, line, addr, val);
return _rtw_sd_iwrite8(adapter, addr, val);
}
int dbg_rtw_sd_iwrite16(_adapter *adapter, u32 addr, u16 val, const char *caller, const int line)
{
if (match_write_sniff_ranges(addr, 2))
DBG_871X("DBG_IO %s:%d rtw_sd_iwrite16(0x%04x, 0x%04x)\n", caller, line, addr, val);
return _rtw_sd_iwrite16(adapter, addr, val);
}
int dbg_rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val, const char *caller, const int line)
{
if (match_write_sniff_ranges(addr, 4))
DBG_871X("DBG_IO %s:%d rtw_sd_iwrite32(0x%04x, 0x%08x)\n", caller, line, addr, val);
return _rtw_sd_iwrite32(adapter, addr, val);
}
#endif /* CONFIG_SDIO_INDIRECT_ACCESS */
#endif /* CONFIG_SDIO_HCI */
#endif

View File

@ -82,7 +82,7 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
struct wlan_network *tgt_network;
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
struct security_priv *psecuritypriv=&(padapter->securitypriv);
WLAN_BSSID_EX *psecnetwork=(WLAN_BSSID_EX*)&(psecuritypriv->sec_bss);
WLAN_BSSID_EX *psecnetwork = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
u8 * pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
unsigned char i,*auth_ie,*supp_ie;

View File

@ -20,6 +20,7 @@
#define _RTW_IOCTL_SET_C_
#include <drv_types.h>
#include <hal_data.h>
extern void indicate_wx_scan_complete_event(_adapter *padapter);
@ -159,9 +160,8 @@ _func_enter_;
rtw_generate_random_ibss(pibss);
if(rtw_createbss_cmd(padapter)!=_SUCCESS)
{
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("***Error=>do_goin: rtw_createbss_cmd status FAIL*** \n "));
if (rtw_create_ibss_cmd(padapter, 0) != _SUCCESS) {
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("***Error=>do_goin: rtw_create_ibss_cmd status FAIL***\n"));
ret = _FALSE;
goto exit;
}
@ -361,7 +361,7 @@ _func_enter_;
rtw_disassoc_cmd(padapter, 0, _TRUE);
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
rtw_indicate_disconnect(padapter);
rtw_indicate_disconnect(padapter, 0, _FALSE);
rtw_free_assoc_resources(padapter, 1);
@ -415,7 +415,7 @@ _func_enter_;
DBG_871X_LEVEL(_drv_always_, "set ssid [%s] fw_state=0x%08x\n",
ssid->Ssid, get_fwstate(pmlmepriv));
if(padapter->hw_init_completed==_FALSE){
if (!rtw_is_hw_init_completed(padapter)) {
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
("set_ssid: hw_init_completed==_FALSE=>exit!!!\n"));
status = _FAIL;
@ -451,7 +451,7 @@ _func_enter_;
rtw_disassoc_cmd(padapter, 0, _TRUE);
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
rtw_indicate_disconnect(padapter);
rtw_indicate_disconnect(padapter, 0, _FALSE);
rtw_free_assoc_resources(padapter, 1);
@ -480,7 +480,7 @@ _func_enter_;
rtw_disassoc_cmd(padapter, 0, _TRUE);
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
rtw_indicate_disconnect(padapter);
rtw_indicate_disconnect(padapter, 0, _FALSE);
rtw_free_assoc_resources(padapter, 1);
@ -549,7 +549,7 @@ _func_enter_;
goto exit;
}
if(padapter->hw_init_completed==_FALSE){
if (!rtw_is_hw_init_completed(padapter)) {
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
("set_ssid: hw_init_completed==_FALSE=>exit!!!\n"));
status = _FAIL;
@ -644,7 +644,7 @@ _func_enter_;
{
if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
{
rtw_indicate_disconnect(padapter); //will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not
rtw_indicate_disconnect(padapter, 0, _FALSE); /*will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not*/
}
}
@ -707,7 +707,7 @@ _func_enter_;
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_info_,("MgntActrtw_set_802_11_disassociate: rtw_indicate_disconnect\n"));
rtw_disassoc_cmd(padapter, 0, _TRUE);
rtw_indicate_disconnect(padapter);
rtw_indicate_disconnect(padapter, 0, _FALSE);
//modify for CONFIG_IEEE80211W, none 11w can use it
rtw_free_assoc_resources_cmd(padapter);
if (_FAIL == rtw_pwr_wakeup(padapter))
@ -735,7 +735,7 @@ _func_enter_;
res=_FALSE;
goto exit;
}
if (padapter->hw_init_completed==_FALSE){
if (!rtw_is_hw_init_completed(padapter)) {
res = _FALSE;
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n===rtw_set_802_11_bssid_list_scan:hw_init_completed==_FALSE===\n"));
goto exit;
@ -1437,7 +1437,7 @@ int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan)
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
//handle by cmd_thread to sync with scan operation
return rtw_set_chplan_cmd(adapter, channel_plan, 1, 1);
return rtw_set_chplan_cmd(adapter, RTW_CMDF_WAIT_ACK, channel_plan, 1);
}
/*
@ -1449,26 +1449,11 @@ int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan)
*/
int rtw_set_country(_adapter *adapter, const char *country_code)
{
int channel_plan = RT_CHANNEL_DOMAIN_WORLD_WIDE_5G;
DBG_871X("%s country_code:%s\n", __func__, country_code);
//TODO: should have a table to match country code and RT_CHANNEL_DOMAIN
//TODO: should consider 2-character and 3-character country code
if(0 == strcmp(country_code, "US"))
channel_plan = RT_CHANNEL_DOMAIN_FCC;
else if(0 == strcmp(country_code, "EU"))
channel_plan = RT_CHANNEL_DOMAIN_ETSI;
else if(0 == strcmp(country_code, "JP"))
channel_plan = RT_CHANNEL_DOMAIN_MKK;
else if(0 == strcmp(country_code, "CN"))
channel_plan = RT_CHANNEL_DOMAIN_CHINA;
else if(0 == strcmp(country_code, "IN"))
channel_plan = RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN;
else
DBG_871X("%s unknown country_code:%s\n", __FUNCTION__, country_code);
return rtw_set_channel_plan(adapter, channel_plan);
#ifdef CONFIG_RTW_IOCTL_SET_COUNTRY
return rtw_set_country_cmd(adapter, RTW_CMDF_WAIT_ACK, country_code, 1);
#else
return _FAIL;
#endif
}
/*

View File

@ -16,10 +16,28 @@ struct u8 * rtw_get_buf_premem(int index)
return rtk_buf_mem[index];
}
struct sk_buff *rtw_alloc_skb_premem(void)
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));
@ -33,7 +51,7 @@ int rtw_free_skb_premem(struct sk_buff *pskb)
if(!pskb)
return -1;
if(skb_queue_len(&rtk_skb_mem_q) >= NR_PREALLOC_RECV_SKB)
if (skb_queue_len(&rtk_skb_mem_q) >= MAX_RTKM_NR_PREALLOC_RECV_SKB)
return -1;
skb_queue_tail(&rtk_skb_mem_q, pskb);
@ -52,8 +70,8 @@ static int __init rtw_mem_init(void)
struct sk_buff *pskb=NULL;
printk("%s\n", __func__);
pr_info("NR_PREALLOC_RECV_SKB: %d\n", NR_PREALLOC_RECV_SKB);
pr_info("MAX_RECVBUF_SZ: %d\n", MAX_RECVBUF_SZ);
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++)
@ -64,9 +82,9 @@ static int __init rtw_mem_init(void)
skb_queue_head_init(&rtk_skb_mem_q);
for(i=0; i<NR_PREALLOC_RECV_SKB; i++)
for(i=0; i<MAX_RTKM_NR_PREALLOC_RECV_SKB; i++)
{
pskb = __dev_alloc_skb(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
pskb = __dev_alloc_skb(MAX_RTKM_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
if(pskb)
{
tmpaddr = (SIZE_PTR)pskb->data;
@ -102,4 +120,3 @@ static void __exit rtw_mem_exit(void)
module_init(rtw_mem_init);
module_exit(rtw_mem_exit);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@
#include <drv_types.h>
#include <rtw_mp_ioctl.h>
#include "../hal/OUTSRC/phydm_precomp.h"
#include "../hal/phydm/phydm_precomp.h"
//**************** oid_rtl_seg_81_85 section start ****************
NDIS_STATUS oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv)

View File

@ -50,13 +50,14 @@ const char *odm_comp_str[] = {
/* BIT25 */"ODM_COMP_RX_GAIN_TRACK",
/* BIT26 */"ODM_COMP_CALIBRATION",
/* BIT27 */NULL,
/* BIT28 */NULL,
/* BIT28 */"ODM_PHY_CONFIG",
/* BIT29 */"BEAMFORMING_DEBUG",
/* BIT30 */"ODM_COMP_COMMON",
/* BIT31 */"ODM_COMP_INIT",
/* BIT32 */"ODM_COMP_NOISY_DETECT",
};
#define RTW_ODM_COMP_MAX 32
#define RTW_ODM_COMP_MAX 33
const char *odm_ability_str[] = {
/* BIT0 */"ODM_BB_DIG",
@ -109,8 +110,9 @@ void rtw_odm_dbg_comp_msg(void *sel, _adapter *adapter)
u64 dbg_comp = 0;
int i;
rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_FLAG, &dbg_comp);
DBG_871X_SEL_NL(sel, "odm.DebugComponents = 0x%016llx \n", dbg_comp);
rtw_hal_get_odm_var(adapter, HAL_ODM_DBG_FLAG, &dbg_comp, NULL);
DBG_871X_SEL_NL(sel, "odm.DebugComponents = 0x%016llx\n", dbg_comp);
for (i=0;i<RTW_ODM_COMP_MAX;i++) {
if (odm_comp_str[i])
DBG_871X_SEL_NL(sel, "%cBIT%-2d %s\n",
@ -120,7 +122,7 @@ void rtw_odm_dbg_comp_msg(void *sel, _adapter *adapter)
inline void rtw_odm_dbg_comp_set(_adapter *adapter, u64 comps)
{
rtw_hal_set_def_var(adapter, HW_DEF_ODM_DBG_FLAG, &comps);
rtw_hal_set_odm_var(adapter, HAL_ODM_DBG_FLAG, &comps, _FALSE);
}
void rtw_odm_dbg_level_msg(void *sel, _adapter *adapter)
@ -131,7 +133,7 @@ void rtw_odm_dbg_level_msg(void *sel, _adapter *adapter)
u32 dbg_level = 0;
int i;
rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &dbg_level);
rtw_hal_get_odm_var(adapter, HAL_ODM_DBG_LEVEL, &dbg_level, NULL);
DBG_871X_SEL_NL(sel, "odm.DebugLevel = %u\n", dbg_level);
for (i=0;i<RTW_ODM_DBG_LEVEL_NUM;i++) {
if (odm_dbg_level_str[i])
@ -141,7 +143,7 @@ void rtw_odm_dbg_level_msg(void *sel, _adapter *adapter)
inline void rtw_odm_dbg_level_set(_adapter *adapter, u32 level)
{
rtw_hal_set_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &level);
rtw_hal_set_odm_var(adapter, HAL_ODM_DBG_LEVEL, &level, _FALSE);
}
void rtw_odm_ability_msg(void *sel, _adapter *adapter)
@ -152,7 +154,7 @@ void rtw_odm_ability_msg(void *sel, _adapter *adapter)
u32 ability = 0;
int i;
rtw_hal_get_hwreg(adapter, HW_VAR_DM_FLAG, (u8*)&ability);
ability = rtw_phydm_ability_get(adapter);
DBG_871X_SEL_NL(sel, "odm.SupportAbility = 0x%08x\n", ability);
for (i=0;i<RTW_ODM_ABILITY_MAX;i++) {
if (odm_ability_str[i])
@ -163,7 +165,19 @@ void rtw_odm_ability_msg(void *sel, _adapter *adapter)
inline void rtw_odm_ability_set(_adapter *adapter, u32 ability)
{
rtw_hal_set_hwreg(adapter, HW_VAR_DM_FLAG, (u8*)&ability);
rtw_phydm_ability_set(adapter, ability);
}
/* set ODM_CMNINFO_IC_TYPE based on chip_type */
void rtw_odm_init_ic_type(_adapter *adapter)
{
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
DM_ODM_T *odm = &hal_data->odmpriv;
u4Byte ic_type = chip_type_to_odm_ic_type(rtw_get_chip_type(adapter));
rtw_warn_on(!ic_type);
ODM_CmnInfoInit(odm, ODM_CMNINFO_IC_TYPE, ic_type);
}
void rtw_odm_adaptivity_ver_msg(void *sel, _adapter *adapter)
@ -235,6 +249,15 @@ void rtw_odm_adaptivity_dc_backoff_msg(void *sel, _adapter *adapter)
DBG_871X_SEL_NL(sel, "RTW_ADAPTIVITY_DC_BACKOFF:%u\n", regsty->adaptivity_dc_backoff);
}
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);
rtw_odm_adaptivity_dml_msg(sel, adapter);
rtw_odm_adaptivity_dc_backoff_msg(sel, adapter);
}
bool rtw_odm_adaptivity_needed(_adapter *adapter)
{
struct registry_priv *regsty = &adapter->registrypriv;
@ -244,14 +267,6 @@ bool rtw_odm_adaptivity_needed(_adapter *adapter)
if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_ENABLE)
ret = _TRUE;
if (ret == _TRUE) {
rtw_odm_adaptivity_ver_msg(RTW_DBGDUMP, adapter);
rtw_odm_adaptivity_en_msg(RTW_DBGDUMP, adapter);
rtw_odm_adaptivity_mode_msg(RTW_DBGDUMP, adapter);
rtw_odm_adaptivity_dml_msg(RTW_DBGDUMP, adapter);
rtw_odm_adaptivity_dc_backoff_msg(RTW_DBGDUMP, adapter);
}
return ret;
}
@ -260,35 +275,35 @@ void rtw_odm_adaptivity_parm_msg(void *sel, _adapter *adapter)
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
DM_ODM_T *odm = &pHalData->odmpriv;
rtw_odm_adaptivity_ver_msg(sel, adapter);
rtw_odm_adaptivity_en_msg(sel, adapter);
rtw_odm_adaptivity_mode_msg(sel, adapter);
rtw_odm_adaptivity_dml_msg(sel, adapter);
rtw_odm_adaptivity_dc_backoff_msg(sel, adapter);
rtw_odm_adaptivity_config_msg(sel, adapter);
DBG_871X_SEL_NL(sel, "%10s %16s\n"
, "TH_L2H_ini", "TH_EDCCA_HL_diff");
DBG_871X_SEL_NL(sel, "0x%-8x %-16d\n"
DBG_871X_SEL_NL(sel, "%10s %16s %16s %22s %12s\n"
, "TH_L2H_ini", "TH_EDCCA_HL_diff", "TH_L2H_ini_mode2", "TH_EDCCA_HL_diff_mode2", "EDCCA_enable");
DBG_871X_SEL_NL(sel, "0x%-8x %-16d 0x%-14x %-22d %-12d\n"
, (u8)odm->TH_L2H_ini
, odm->TH_EDCCA_HL_diff
, (u8)odm->TH_L2H_ini_mode2
, odm->TH_EDCCA_HL_diff_mode2
, odm->EDCCA_enable
);
DBG_871X_SEL_NL(sel, "%15s %9s\n", "AdapEnableState","Adap_Flag");
DBG_871X_SEL_NL(sel, "%-15x %-9x \n"
DBG_871X_SEL_NL(sel, "%15s %9s\n", "AdapEnableState", "Adap_Flag");
DBG_871X_SEL_NL(sel, "%-15x %-9x\n"
, odm->Adaptivity_enable
, odm->adaptivity_flag
);
}
void rtw_odm_adaptivity_parm_set(_adapter *adapter, s8 TH_L2H_ini, s8 TH_EDCCA_HL_diff)
void rtw_odm_adaptivity_parm_set(_adapter *adapter, s8 TH_L2H_ini, s8 TH_EDCCA_HL_diff, s8 TH_L2H_ini_mode2, s8 TH_EDCCA_HL_diff_mode2, u8 EDCCA_enable)
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
DM_ODM_T *odm = &pHalData->odmpriv;
odm->TH_L2H_ini = TH_L2H_ini;
odm->TH_EDCCA_HL_diff = TH_EDCCA_HL_diff;
odm->TH_L2H_ini_mode2 = TH_L2H_ini_mode2;
odm->TH_EDCCA_HL_diff_mode2 = TH_EDCCA_HL_diff_mode2;
odm->EDCCA_enable = EDCCA_enable;
}
void rtw_odm_get_perpkt_rssi(void *sel, _adapter *adapter)
@ -329,3 +344,118 @@ void rtw_odm_releasespinlock(_adapter *adapter, RT_SPINLOCK_TYPE type)
}
}
#ifdef CONFIG_DFS_MASTER
VOID rtw_odm_radar_detect_reset(_adapter *adapter)
{
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
PDM_ODM_T pDM_Odm = &(hal_data->odmpriv);
if (pDM_Odm->SupportICType & ODM_RTL8192D) {
ODM_SetBBReg(pDM_Odm, 0xc84 , BIT25, 0);
ODM_SetBBReg(pDM_Odm, 0xc84 , BIT25, 1);
} else if (pDM_Odm->SupportICType & ODM_RTL8821) {
ODM_SetBBReg(pDM_Odm, 0x924 , BIT15, 0);
ODM_SetBBReg(pDM_Odm, 0x924 , BIT15, 1);
} else {
/* not supported yet */
rtw_warn_on(1);
}
}
VOID rtw_odm_radar_detect_disable(_adapter *adapter)
{
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
PDM_ODM_T pDM_Odm = &(hal_data->odmpriv);
if (pDM_Odm->SupportICType & ODM_RTL8192D)
ODM_SetBBReg(pDM_Odm, 0xc84 , BIT25, 0);
else if (pDM_Odm->SupportICType & ODM_RTL8821)
ODM_SetBBReg(pDM_Odm, 0x924 , BIT15, 0);
else
rtw_warn_on(1);
}
/* called after ch, bw is set, chance to adjust parameter for different ch conditions */
VOID rtw_odm_radar_detect_enable(_adapter *adapter)
{
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
PDM_ODM_T pDM_Odm = &(hal_data->odmpriv);
if (pDM_Odm->SupportICType & ODM_RTL8192D) {
ODM_SetBBReg(pDM_Odm, 0xc38, BIT23 | BIT22, 2);
ODM_SetBBReg(pDM_Odm, 0x814, bMaskDWord, 0x04cc4d10);
ODM_SetBBReg(pDM_Odm, 0xc8c, BIT23 | BIT22, 3);
ODM_SetBBReg(pDM_Odm, 0xc30, 0xf, 0xa);
ODM_SetBBReg(pDM_Odm, 0xcdc, 0xf0000, 4);
} else if (pDM_Odm->SupportICType & ODM_RTL8821) {
ODM_SetBBReg(pDM_Odm, 0x814, 0x3fffffff, 0x04cc4d10);
ODM_SetBBReg(pDM_Odm, 0x834, bMaskByte0, 0x06);
ODM_SetBBReg(pDM_Odm, 0x918, bMaskDWord, 0x1c16ecdf);
ODM_SetBBReg(pDM_Odm, 0x924, bMaskDWord, 0x0152a400);
ODM_SetBBReg(pDM_Odm, 0x91c, bMaskDWord, 0x0fa21a20);
ODM_SetBBReg(pDM_Odm, 0x920, bMaskDWord, 0xe0f57204);
} else {
/* not supported yet */
rtw_warn_on(1);
}
rtw_odm_radar_detect_reset(adapter);
}
BOOLEAN rtw_odm_radar_detect(_adapter *adapter)
{
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
PDM_ODM_T pDM_Odm = &(hal_data->odmpriv);
BOOLEAN enable_DFS = FALSE;
BOOLEAN bypass = FALSE;
BOOLEAN radar_detected = FALSE;
static u8Byte last_tx_unicast = 0;
static u8Byte last_rx_unicast = 0;
static u8Byte throughput = 0;
int tp_th = ((*pDM_Odm->pBandWidth == ODM_BW40M) ? 45 : 20); /*refer AP team's testing number*/
throughput = (*(pDM_Odm->pNumTxBytesUnicast) - last_tx_unicast) + (*(pDM_Odm->pNumRxBytesUnicast) - last_rx_unicast);
last_tx_unicast = *(pDM_Odm->pNumTxBytesUnicast);
last_rx_unicast = *(pDM_Odm->pNumRxBytesUnicast);
if (throughput>>18 > tp_th) {
if (pDM_Odm->SupportICType & ODM_RTL8192D)
ODM_SetBBReg(pDM_Odm, 0xcdc, BIT8|BIT9, 0);
bypass = TRUE;
} else {
if (pDM_Odm->SupportICType & ODM_RTL8192D)
ODM_SetBBReg(pDM_Odm, 0xcdc, BIT8|BIT9, 1);
}
if (pDM_Odm->SupportICType & ODM_RTL8192D) {
if (ODM_GetBBReg(pDM_Odm , 0xc84, BIT25))
enable_DFS = TRUE;
} else if (pDM_Odm->SupportICType & ODM_RTL8821) {
if (ODM_GetBBReg(pDM_Odm , 0x924, BIT15))
enable_DFS = TRUE;
}
if (pDM_Odm->SupportICType & ODM_RTL8192D) {
if (ODM_GetBBReg(pDM_Odm , 0xcf8, BIT23))
radar_detected = TRUE;
} else if (pDM_Odm->SupportICType & ODM_RTL8821) {
if (ODM_GetBBReg(pDM_Odm , 0xf98, BIT17))
radar_detected = TRUE;
}
ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD
, ("Radar detect: enable_DFS:%d, radar_detected:%d, bypass:%d\n"
, enable_DFS, radar_detected, bypass));
if (0)
DBG_871X("Radar detect: enable_DFS:%d, radar_detected:%d, bypass:%d(throughput:%llu, tp_th:%d)\n"
, enable_DFS, radar_detected, bypass, throughput, tp_th);
if (enable_DFS && radar_detected)
rtw_odm_radar_detect_reset(adapter);
exit:
return (enable_DFS && radar_detected && !bypass);
}
#endif /* CONFIG_DFS_MASTER */

View File

@ -295,7 +295,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8* raddr,
u8 wpsielen = 0;
#ifdef CONFIG_WFD
u32 wfdielen = 0;
#endif //CONFIG_WFD
#endif
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
@ -383,7 +383,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8* raddr,
wfdielen = build_provdisc_resp_wfd_ie(pwdinfo, pframe);
pframe += wfdielen;
pattrib->pktlen += wfdielen;
#endif //CONFIG_WFD
#endif
pattrib->last_txcmdsz = pattrib->pktlen;
@ -544,6 +544,9 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
// WFD OUI
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
@ -652,8 +655,8 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
@ -665,6 +668,9 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
// WFD OUI
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
@ -768,8 +774,8 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunneled)
@ -780,6 +786,9 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
// WFD OUI
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
@ -963,8 +972,8 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel
pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
@ -976,16 +985,17 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct mlme_priv *pmlmepriv = NULL;
struct wifi_display_info *pwfd_info = NULL;
// WFD OUI
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
{
return 0;
}
padapter = pwdinfo->padapter;
pmlmepriv = &padapter->mlmepriv;
pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_IDLE))
goto exit;
/* WFD OUI */
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
wfdie[ wfdielen++ ] = 0x6F;
@ -1072,8 +1082,8 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
@ -1085,6 +1095,9 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
// WFD OUI
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
@ -1172,8 +1185,8 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
@ -1185,6 +1198,9 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
// WFD OUI
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
@ -1272,8 +1288,8 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
@ -1285,6 +1301,9 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
// WFD OUI
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
@ -1373,8 +1392,8 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
@ -1386,6 +1405,9 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
// WFD OUI
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
@ -1474,8 +1496,8 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
pbuf = rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
@ -1487,6 +1509,9 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
// WFD OUI
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
@ -1589,8 +1614,8 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
@ -1602,6 +1627,9 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
// WFD OUI
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
@ -1704,8 +1732,8 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
@ -1717,6 +1745,9 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
// WFD OUI
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
@ -1805,8 +1836,8 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
@ -1818,6 +1849,9 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wifi_display_info* pwfd_info = padapter->wdinfo.wfd_info;
if (!hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
goto exit;
// WFD OUI
wfdielen = 0;
wfdie[ wfdielen++ ] = 0x50;
@ -1905,12 +1939,10 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
rtw_set_ie(pbuf, _VENDOR_SPECIFIC_IE_, wfdielen, (unsigned char *) wfdie, &len);
exit:
return len;
}
#endif //CONFIG_WFD
#endif /* CONFIG_WFD */
u32 build_probe_resp_p2p_ie(struct wifidirect_info *pwdinfo, u8 *pbuf)
{
@ -2746,8 +2778,6 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
u16 wps_devicepassword_id = 0x0000;
uint wps_devicepassword_id_len = 0;
#ifdef CONFIG_WFD
u8 wfd_ie[ 128 ] = { 0x00 };
u32 wfd_ielen = 0;
#ifdef CONFIG_TDLS
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
#endif // CONFIG_TDLS
@ -2791,13 +2821,6 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
return( result );
}
if ( pwdinfo->ui_got_wps_info == P2P_NO_WPSINFO )
{
result = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
rtw_p2p_set_state(pwdinfo, P2P_STATE_TX_INFOR_NOREADY);
return( result );
}
ies = pframe + _PUBLIC_ACTION_IE_OFFSET_;
ies_len = len - _PUBLIC_ACTION_IE_OFFSET_;
@ -2821,6 +2844,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
u8 ch_list_inclusioned[100] = { 0x00 };
u8 ch_num_inclusioned = 0;
u16 cap_attr;
u8 listen_ch_attr[5] = { 0x00 };
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING);
@ -2877,7 +2901,11 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
}
}
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_LISTEN_CH, (u8 *)listen_ch_attr, (uint *) &attr_contentlen) && attr_contentlen == 5)
pwdinfo->nego_req_info.peer_ch = listen_ch_attr[4];
DBG_871X(FUNC_ADPT_FMT" listen channel :%u\n", FUNC_ADPT_ARG(padapter), pwdinfo->nego_req_info.peer_ch);
attr_contentlen = 0;
if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_INTENTED_IF_ADDR, pwdinfo->p2p_peer_interface_addr, &attr_contentlen ) )
{
@ -2906,7 +2934,8 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
ch_list_inclusioned, ch_num_inclusioned) )
{
#ifdef CONFIG_CONCURRENT_MODE
if ( check_buddy_fwstate(padapter, _FW_LINKED ) )
if (check_buddy_fwstate(padapter, _FW_LINKED)
&& padapter->registrypriv.full_ch_in_p2p_handshake == 0)
{
DBG_871X( "[%s] desired channel NOT Found!\n", __FUNCTION__ );
result = P2P_STATUS_FAIL_NO_COMMON_CH;
@ -2948,24 +2977,16 @@ 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);
}
#ifdef CONFIG_WFD
// Added by Albert 20110823
// Try to get the TCP port information when receiving the negotiation request.
if ( rtw_get_wfd_ie( pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, wfd_ie, &wfd_ielen ) )
{
u8 attr_content[ 10 ] = { 0x00 };
u32 attr_contentlen = 0;
DBG_871X( "[%s] WFD IE Found!!\n", __FUNCTION__ );
rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, attr_content, &attr_contentlen);
if ( attr_contentlen )
{
pwdinfo->wfd_info->peer_rtsp_ctrlport = RTW_GET_BE16( attr_content + 2 );
DBG_871X( "[%s] Peer PORT NUM = %d\n", __FUNCTION__, pwdinfo->wfd_info->peer_rtsp_ctrlport );
}
if (pwdinfo->ui_got_wps_info == P2P_NO_WPSINFO) {
result = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
rtw_p2p_set_state(pwdinfo, P2P_STATE_TX_INFOR_NOREADY);
return result;
}
#endif // CONFIG_WFD
#ifdef CONFIG_WFD
rtw_process_wfd_ies(padapter, pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, __func__);
#endif
return( result );
}
@ -2979,8 +3000,6 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
u32 ies_len;
u8 * p2p_ie;
#ifdef CONFIG_WFD
u8 wfd_ie[ 128 ] = { 0x00 };
u32 wfd_ielen = 0;
#ifdef CONFIG_TDLS
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
#endif // CONFIG_TDLS
@ -3152,7 +3171,8 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
ch_list_inclusioned, ch_num_inclusioned) )
{
#ifdef CONFIG_CONCURRENT_MODE
if ( check_buddy_fwstate(padapter, _FW_LINKED ) )
if (check_buddy_fwstate(padapter, _FW_LINKED)
&& padapter->registrypriv.full_ch_in_p2p_handshake == 0)
{
DBG_871X( "[%s] desired channel NOT Found!\n", __FUNCTION__ );
result = P2P_STATUS_FAIL_NO_COMMON_CH;
@ -3211,23 +3231,9 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
}
#ifdef CONFIG_WFD
// Added by Albert 20111122
// Try to get the TCP port information when receiving the negotiation response.
if ( rtw_get_wfd_ie( pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, wfd_ie, &wfd_ielen ) )
{
u8 attr_content[ 10 ] = { 0x00 };
u32 attr_contentlen = 0;
DBG_8192C( "[%s] WFD IE Found!!\n", __FUNCTION__ );
rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, attr_content, &attr_contentlen);
if ( attr_contentlen )
{
pwdinfo->wfd_info->peer_rtsp_ctrlport = RTW_GET_BE16( attr_content + 2 );
DBG_8192C( "[%s] Peer PORT NUM = %d\n", __FUNCTION__, pwdinfo->wfd_info->peer_rtsp_ctrlport );
}
}
#endif // CONFIG_WFD
#ifdef CONFIG_WFD
rtw_process_wfd_ies(padapter, pframe + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, __func__);
#endif
return( result );
@ -3235,6 +3241,7 @@ u8 process_p2p_group_negotation_resp( struct wifidirect_info *pwdinfo, u8 *pfram
u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pframe, uint len )
{
_adapter *padapter = pwdinfo->padapter;
u8 * ies;
u32 ies_len;
u8 * p2p_ie;
@ -3289,7 +3296,8 @@ u8 process_p2p_group_negotation_confirm( struct wifidirect_info *pwdinfo, u8 *pf
}
#ifdef CONFIG_CONCURRENT_MODE
if ( check_buddy_fwstate(pwdinfo->padapter , _FW_LINKED ) )
if (check_buddy_fwstate(padapter , _FW_LINKED)
&& padapter->registrypriv.full_ch_in_p2p_handshake == 0)
{
// Switch back to the AP channel soon.
_set_timer( &pwdinfo->ap_p2p_switch_timer, 100 );
@ -3451,7 +3459,9 @@ _func_enter_;
set_channel_bwmode(padapter, pwdinfo->nego_req_info.peer_channel_num[0], HAL_PRIME_CHNL_OFFSET_DONT_CARE, CHANNEL_WIDTH_20);
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
issue_probereq_p2p(padapter, NULL);
issue_probereq_p2p(padapter , NULL);
/* WIN Phone only accept unicast probe request when nego back */
issue_probereq_p2p(padapter , pwdinfo->nego_req_info.peerDevAddr);
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
_func_exit_;
@ -3505,7 +3515,7 @@ _func_enter_;
rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN);
if(!check_buddy_mlmeinfo_state(padapter, WIFI_FW_AP_STATE) &&
!(pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE))
{
val8 = 1;
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
@ -3529,7 +3539,7 @@ _func_enter_;
if ( pbuddy_mlmeext->cur_channel != pwdinfo->listen_channel )
{
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
if(!check_buddy_mlmeinfo_state(padapter, WIFI_FW_AP_STATE) &&!(pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
if (!check_buddy_mlmeinfo_state(padapter, WIFI_FW_AP_STATE) && ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE))
{
val8 = 0;
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
@ -3579,7 +3589,11 @@ _func_enter_;
}
else
{
set_channel_bwmode( padapter, pwdinfo->listen_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, CHANNEL_WIDTH_20);
/* In p2p+softap. When in P2P_STATE_GONEGO_OK, not back to listen channel.*/
if (!rtw_p2p_chk_state(pwdinfo , P2P_STATE_GONEGO_OK) || padapter->registrypriv.full_ch_in_p2p_handshake == 0)
set_channel_bwmode(padapter , pwdinfo->listen_channel , HAL_PRIME_CHNL_OFFSET_DONT_CARE , CHANNEL_WIDTH_20);
else
DBG_871X("%s, buddy not linked, go nego ok, not back to listen channel\n", __func__);
}
_func_exit_;
@ -3865,121 +3879,161 @@ static void rtw_cfg80211_adjust_p2pie_channel(_adapter *padapter, const u8 *fram
}
#ifdef CONFIG_WFD
void rtw_append_wfd_ie(_adapter *padapter, u8 *buf, u32* len)
u32 rtw_xframe_build_wfd_ie(struct xmit_frame *xframe)
{
unsigned char *frame_body;
u8 category, action, OUI_Subtype, dialogToken=0;
_adapter *adapter = xframe->padapter;
struct wifidirect_info *wdinfo = &adapter->wdinfo;
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;
u32 wfdielen = 0;
struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(padapter);
frame_body = (unsigned char *)(buf + sizeof(struct rtw_ieee80211_hdr_3addr));
category = frame_body[0];
if(category == RTW_WLAN_CATEGORY_PUBLIC)
{
category = frame_body[0];
if (category == RTW_WLAN_CATEGORY_PUBLIC) {
action = frame_body[1];
if (action == ACT_PUBLIC_VENDOR
&& _rtw_memcmp(frame_body+2, P2P_OUI, 4) == _TRUE
)
{
&& _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE
) {
OUI_Subtype = frame_body[6];
dialogToken = frame_body[7];
switch( OUI_Subtype )//OUI Subtype
{
case P2P_GO_NEGO_REQ:
{
wfdielen = build_nego_req_wfd_ie( &padapter->wdinfo, buf + ( *len ) );
(*len) += wfdielen;
break;
}
case P2P_GO_NEGO_RESP:
{
wfdielen = build_nego_resp_wfd_ie( &padapter->wdinfo, buf + ( *len ) );
(*len) += wfdielen;
break;
}
case P2P_GO_NEGO_CONF:
{
wfdielen = build_nego_confirm_wfd_ie( &padapter->wdinfo, buf + ( *len ) );
(*len) += wfdielen;
break;
}
case P2P_INVIT_REQ:
{
wfdielen = build_invitation_req_wfd_ie( &padapter->wdinfo, buf + ( *len ) );
(*len) += wfdielen;
break;
}
case P2P_INVIT_RESP:
{
wfdielen = build_invitation_resp_wfd_ie( &padapter->wdinfo, buf + ( *len ) );
(*len) += wfdielen;
break;
}
case P2P_DEVDISC_REQ:
break;
case P2P_DEVDISC_RESP:
break;
case P2P_PROVISION_DISC_REQ:
{
wfdielen = build_provdisc_req_wfd_ie( &padapter->wdinfo, buf + ( *len ) );
(*len) += wfdielen;
break;
}
case P2P_PROVISION_DISC_RESP:
{
wfdielen = build_provdisc_resp_wfd_ie( &padapter->wdinfo, buf + ( *len ) );
(*len) += wfdielen;
break;
}
default:
break;
switch (OUI_Subtype) {
case P2P_GO_NEGO_REQ:
wfdielen = build_nego_req_wfd_ie(wdinfo, frame_tail);
break;
case P2P_GO_NEGO_RESP:
wfdielen = build_nego_resp_wfd_ie(wdinfo, frame_tail);
break;
case P2P_GO_NEGO_CONF:
wfdielen = build_nego_confirm_wfd_ie(wdinfo, frame_tail);
break;
case P2P_INVIT_REQ:
wfdielen = build_invitation_req_wfd_ie(wdinfo, frame_tail);
break;
case P2P_INVIT_RESP:
wfdielen = build_invitation_resp_wfd_ie(wdinfo, frame_tail);
break;
case P2P_PROVISION_DISC_REQ:
wfdielen = build_provdisc_req_wfd_ie(wdinfo, frame_tail);
break;
case P2P_PROVISION_DISC_RESP:
wfdielen = build_provdisc_resp_wfd_ie(wdinfo, frame_tail);
break;
case P2P_DEVDISC_REQ:
case P2P_DEVDISC_RESP:
default:
break;
}
}
}
else if(category == RTW_WLAN_CATEGORY_P2P)
{
} else if (category == RTW_WLAN_CATEGORY_P2P) {
OUI_Subtype = frame_body[5];
dialogToken = frame_body[6];
#ifdef CONFIG_DEBUG_CFG80211
DBG_871X("ACTION_CATEGORY_P2P: OUI=0x%x, OUI_Subtype=%d, dialogToken=%d\n",
cpu_to_be32( *( ( u32* ) ( frame_body + 1 ) ) ), OUI_Subtype, dialogToken);
#endif
#ifdef CONFIG_DEBUG_CFG80211
DBG_871X("ACTION_CATEGORY_P2P: OUI=0x%x, OUI_Subtype=%d, dialogToken=%d\n"
, cpu_to_be32(*((u32 *)(frame_body + 1))), OUI_Subtype, dialogToken);
#endif
switch(OUI_Subtype)
{
case P2P_NOTICE_OF_ABSENCE:
break;
case P2P_PRESENCE_REQUEST:
break;
case P2P_PRESENCE_RESPONSE:
break;
case P2P_GO_DISC_REQUEST:
break;
default:
break;
}
}
else
{
switch (OUI_Subtype) {
case P2P_NOTICE_OF_ABSENCE:
break;
case P2P_PRESENCE_REQUEST:
break;
case P2P_PRESENCE_RESPONSE:
break;
case P2P_GO_DISC_REQUEST:
break;
default:
break;
}
} else {
DBG_871X("%s, action frame category=%d\n", __func__, category);
//is_p2p_frame = (-1);
}
return;
xframe->attrib.pktlen += wfdielen;
return wfdielen;
}
#endif /* CONFIG_WFD */
bool rtw_xframe_del_wfd_ie(struct xmit_frame *xframe)
{
#define DBG_XFRAME_DEL_WFD_IE 0
_adapter *adapter = xframe->padapter;
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;
u8 *ies = NULL;
uint ies_len_ori = 0;
uint ies_len = 0;
category = frame_body[0];
if (category == RTW_WLAN_CATEGORY_PUBLIC) {
action = frame_body[1];
if (action == ACT_PUBLIC_VENDOR
&& _rtw_memcmp(frame_body + 2, P2P_OUI, 4) == _TRUE
) {
OUI_Subtype = frame_body[6];
switch (OUI_Subtype) {
case P2P_GO_NEGO_REQ:
case P2P_GO_NEGO_RESP:
case P2P_GO_NEGO_CONF:
case P2P_INVIT_REQ:
case P2P_INVIT_RESP:
case P2P_PROVISION_DISC_REQ:
case P2P_PROVISION_DISC_RESP:
ies = frame_body + 8;
ies_len_ori = frame_tail - (frame_body + 8);
break;
}
}
}
if (ies && ies_len_ori) {
ies_len = rtw_del_wfd_ie(ies, ies_len_ori, DBG_XFRAME_DEL_WFD_IE ? __func__ : NULL);
xframe->attrib.pktlen -= (ies_len_ori - ies_len);
}
return ies_len_ori != ies_len;
}
/*
* rtw_xframe_chk_wfd_ie -
*
*/
void rtw_xframe_chk_wfd_ie(struct xmit_frame *xframe)
{
_adapter *adapter = xframe->padapter;
u8 *frame = xframe->buf_addr + TXDESC_OFFSET;
u8 *frame_body = frame + sizeof(struct rtw_ieee80211_hdr_3addr);
u8 *frame_tail = frame + xframe->attrib.pktlen;
struct wifidirect_info *wdinfo = &adapter->wdinfo;
struct mlme_priv *mlme = &adapter->mlmepriv;
u8 build = 0;
u8 del = 0;
if (!hal_chk_wl_func(adapter, WL_FUNC_MIRACAST))
del = 1;
#ifdef CONFIG_IOCTL_CFG80211
if (_TRUE == wdinfo->wfd_info->wfd_enable)
#endif
del = build = 1;
if (del)
rtw_xframe_del_wfd_ie(xframe);
#ifdef CONFIG_WFD
if (build)
rtw_xframe_build_wfd_ie(xframe);
#endif
}
u8 *dump_p2p_attr_ch_list(u8 *p2p_ie, uint p2p_ielen, u8 *buf, u32 buf_len)
{
@ -4098,8 +4152,8 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
//pwdev_priv->provdisc_req_issued = _FALSE;
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if(check_buddy_fwstate(padapter, _FW_LINKED))
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
if (check_buddy_fwstate(padapter , _FW_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0)
rtw_cfg80211_adjust_p2pie_channel(padapter , frame_body , len-sizeof(struct rtw_ieee80211_hdr_3addr));
#endif
}
@ -4122,13 +4176,14 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
nego_info->state = 0;
dump_p2p_attr_ch_list(p2p_ie, p2p_ielen, ch_list_buf, 128);
DBG_871X("RTW_%s:P2P_GO_NEGO_REQ, dialogToken=%d, intent:%u%s, listen_ch:%d, op_ch:%d, ch_list:%s\n",
(tx==_TRUE)?"Tx":"Rx", dialogToken, (intent>>1), intent&0x1 ? "+" : "-", listen_ch, op_ch, ch_list_buf);
DBG_871X("RTW_%s:P2P_GO_NEGO_REQ, dialogToken=%d, intent:%u%s, listen_ch:%d, op_ch:%d, ch_list:%s, full_ch_in_p2p_handshake:%d\n" ,
(tx == _TRUE)?"Tx":"Rx" , dialogToken , (intent>>1) , intent&0x1 ? "+" : "-" , listen_ch , op_ch , ch_list_buf , padapter->registrypriv.full_ch_in_p2p_handshake);
if (!tx) {
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if(check_buddy_fwstate(padapter, _FW_LINKED)
&& rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE)
if (check_buddy_fwstate(padapter, _FW_LINKED)
&& rtw_chk_p2pie_ch_list_with_buddy(padapter , frame_body , len-sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE
&& padapter->registrypriv.full_ch_in_p2p_handshake == 0)
{
DBG_871X(FUNC_ADPT_FMT" ch_list has no intersect with buddy\n", FUNC_ADPT_ARG(padapter));
rtw_change_p2pie_ch_list(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr), 0);
@ -4144,8 +4199,8 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
if (tx) {
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if(check_buddy_fwstate(padapter, _FW_LINKED))
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
if (check_buddy_fwstate(padapter , _FW_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0)
rtw_cfg80211_adjust_p2pie_channel(padapter , frame_body , len-sizeof(struct rtw_ieee80211_hdr_3addr));
#endif
}
@ -4174,8 +4229,9 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
if (!tx) {
pwdev_priv->provdisc_req_issued = _FALSE;
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if(check_buddy_fwstate(padapter, _FW_LINKED)
&& rtw_chk_p2pie_ch_list_with_buddy(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE)
if (check_buddy_fwstate(padapter, _FW_LINKED)
&& rtw_chk_p2pie_ch_list_with_buddy(padapter , frame_body , len-sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE
&& padapter->registrypriv.full_ch_in_p2p_handshake == 0)
{
DBG_871X(FUNC_ADPT_FMT" ch_list has no intersect with buddy\n", FUNC_ADPT_ARG(padapter));
rtw_change_p2pie_ch_list(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr), 0);
@ -4192,7 +4248,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
if (tx) {
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if(check_buddy_fwstate(padapter, _FW_LINKED))
if (check_buddy_fwstate(padapter, _FW_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0)
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
#endif
}
@ -4233,7 +4289,8 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
if (tx) {
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if(check_buddy_fwstate(padapter, _FW_LINKED))
if (check_buddy_fwstate(padapter, _FW_LINKED)
&& padapter->registrypriv.full_ch_in_p2p_handshake == 0)
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
#endif
}
@ -4259,7 +4316,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
if (!tx) {
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if(check_buddy_fwstate(padapter, _FW_LINKED)) {
if (check_buddy_fwstate(padapter , _FW_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0) {
if (op_ch != -1 && rtw_chk_p2pie_op_ch_with_buddy(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr)) == _FALSE) {
DBG_871X(FUNC_ADPT_FMT" op_ch:%u has no intersect with buddy\n", FUNC_ADPT_ARG(padapter), op_ch);
rtw_change_p2pie_ch_list(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr), 0);
@ -4279,7 +4336,7 @@ int rtw_p2p_check_frames(_adapter *padapter, const u8 *buf, u32 len, u8 tx)
if (tx) {
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_CFG80211_ONECHANNEL_UNDER_CONCURRENT)
if(check_buddy_fwstate(padapter, _FW_LINKED))
if (check_buddy_fwstate(padapter , _FW_LINKED) && padapter->registrypriv.full_ch_in_p2p_handshake == 0)
rtw_cfg80211_adjust_p2pie_channel(padapter, frame_body, len-sizeof(struct rtw_ieee80211_hdr_3addr));
#endif
}
@ -4907,7 +4964,7 @@ void reset_global_wifidirect_info( _adapter* padapter )
pwdinfo = &padapter->wdinfo;
pwdinfo->persistent_supported = 0;
pwdinfo->session_available = _TRUE;
pwdinfo->wfd_tdls_enable = 0;
rtw_tdls_wfd_enable(padapter, 0);
pwdinfo->wfd_tdls_weaksec = _TRUE;
}
@ -4918,7 +4975,13 @@ int rtw_init_wifi_display_info(_adapter* padapter)
struct wifi_display_info *pwfd_info = &padapter->wfd_info;
// Used in P2P and TDLS
pwfd_info->rtsp_ctrlport = 554;
pwfd_info->init_rtsp_ctrlport = 554;
#ifdef CONFIG_IOCTL_CFG80211
pwfd_info->rtsp_ctrlport = 0;
#else
pwfd_info->rtsp_ctrlport = pwfd_info->init_rtsp_ctrlport; /* set non-zero value for legacy wfd */
#endif
pwfd_info->tdls_rtsp_ctrlport = 0;
pwfd_info->peer_rtsp_ctrlport = 0; // Reset to 0
pwfd_info->wfd_enable = _FALSE;
pwfd_info->wfd_device_type = WFD_DEVINFO_PSINK;
@ -4934,7 +4997,187 @@ int rtw_init_wifi_display_info(_adapter* padapter)
return res;
}
#endif //CONFIG_WFD
inline void rtw_wfd_enable(_adapter *adapter, bool on)
{
struct wifi_display_info *wfdinfo = &adapter->wfd_info;
if (on) {
wfdinfo->rtsp_ctrlport = wfdinfo->init_rtsp_ctrlport;
wfdinfo->wfd_enable = _TRUE;
} else {
wfdinfo->wfd_enable = _FALSE;
wfdinfo->rtsp_ctrlport = 0;
}
}
inline void rtw_wfd_set_ctrl_port(_adapter *adapter, u16 port)
{
struct wifi_display_info *wfdinfo = &adapter->wfd_info;
wfdinfo->init_rtsp_ctrlport = port;
if (wfdinfo->wfd_enable == _TRUE)
wfdinfo->rtsp_ctrlport = port;
if (adapter->wdinfo.wfd_tdls_enable == 1)
wfdinfo->tdls_rtsp_ctrlport = port;
}
inline void rtw_tdls_wfd_enable(_adapter *adapter, bool on)
{
struct wifi_display_info *wfdinfo = &adapter->wfd_info;
if (on) {
wfdinfo->tdls_rtsp_ctrlport = wfdinfo->init_rtsp_ctrlport;
adapter->wdinfo.wfd_tdls_enable = 1;
} else {
adapter->wdinfo.wfd_tdls_enable = 0;
wfdinfo->tdls_rtsp_ctrlport = 0;
}
}
u32 rtw_append_beacon_wfd_ie(_adapter *adapter, u8 *pbuf)
{
struct wifidirect_info *wdinfo = &adapter->wdinfo;
struct mlme_priv *mlme = &adapter->mlmepriv;
u8 build_ie_by_self = 0;
u32 len = 0;
if (!hal_chk_wl_func(adapter, WL_FUNC_MIRACAST))
goto exit;
#ifdef CONFIG_IOCTL_CFG80211
if (_TRUE == wdinfo->wfd_info->wfd_enable)
#endif
build_ie_by_self = 1;
if (build_ie_by_self)
len = build_beacon_wfd_ie(wdinfo, pbuf);
#ifdef CONFIG_IOCTL_CFG80211
else if (mlme->wfd_beacon_ie && mlme->wfd_beacon_ie_len > 0) {
len = mlme->wfd_beacon_ie_len;
_rtw_memcpy(pbuf, mlme->wfd_beacon_ie, len);
}
#endif
exit:
return len;
}
u32 rtw_append_probe_req_wfd_ie(_adapter *adapter, u8 *pbuf)
{
struct wifidirect_info *wdinfo = &adapter->wdinfo;
struct mlme_priv *mlme = &adapter->mlmepriv;
u8 build_ie_by_self = 0;
u32 len = 0;
if (!hal_chk_wl_func(adapter, WL_FUNC_MIRACAST))
goto exit;
#ifdef CONFIG_IOCTL_CFG80211
if (_TRUE == wdinfo->wfd_info->wfd_enable)
#endif
build_ie_by_self = 1;
if (build_ie_by_self)
len = build_probe_req_wfd_ie(wdinfo, pbuf);
#ifdef CONFIG_IOCTL_CFG80211
else if (mlme->wfd_probe_req_ie && mlme->wfd_probe_req_ie_len > 0) {
len = mlme->wfd_probe_req_ie_len;
_rtw_memcpy(pbuf, mlme->wfd_probe_req_ie, len);
}
#endif
exit:
return len;
}
u32 rtw_append_probe_resp_wfd_ie(_adapter *adapter, u8 *pbuf)
{
struct wifidirect_info *wdinfo = &adapter->wdinfo;
struct mlme_priv *mlme = &adapter->mlmepriv;
u8 build_ie_by_self = 0;
u32 len = 0;
if (!hal_chk_wl_func(adapter, WL_FUNC_MIRACAST))
goto exit;
#ifdef CONFIG_IOCTL_CFG80211
if (_TRUE == wdinfo->wfd_info->wfd_enable)
#endif
build_ie_by_self = 1;
if (build_ie_by_self)
len = build_probe_resp_wfd_ie(wdinfo, pbuf, 0);
#ifdef CONFIG_IOCTL_CFG80211
else if (mlme->wfd_probe_resp_ie && mlme->wfd_probe_resp_ie_len > 0) {
len = mlme->wfd_probe_resp_ie_len;
_rtw_memcpy(pbuf, mlme->wfd_probe_resp_ie, len);
}
#endif
exit:
return len;
}
u32 rtw_append_assoc_req_wfd_ie(_adapter *adapter, u8 *pbuf)
{
struct wifidirect_info *wdinfo = &adapter->wdinfo;
struct mlme_priv *mlme = &adapter->mlmepriv;
u8 build_ie_by_self = 0;
u32 len = 0;
if (!hal_chk_wl_func(adapter, WL_FUNC_MIRACAST))
goto exit;
#ifdef CONFIG_IOCTL_CFG80211
if (_TRUE == wdinfo->wfd_info->wfd_enable)
#endif
build_ie_by_self = 1;
if (build_ie_by_self)
len = build_assoc_req_wfd_ie(wdinfo, pbuf);
#ifdef CONFIG_IOCTL_CFG80211
else if (mlme->wfd_assoc_req_ie && mlme->wfd_assoc_req_ie_len > 0) {
len = mlme->wfd_assoc_req_ie_len;
_rtw_memcpy(pbuf, mlme->wfd_assoc_req_ie, len);
}
#endif
exit:
return len;
}
u32 rtw_append_assoc_resp_wfd_ie(_adapter *adapter, u8 *pbuf)
{
struct wifidirect_info *wdinfo = &adapter->wdinfo;
struct mlme_priv *mlme = &adapter->mlmepriv;
u8 build_ie_by_self = 0;
u32 len = 0;
if (!hal_chk_wl_func(adapter, WL_FUNC_MIRACAST))
goto exit;
#ifdef CONFIG_IOCTL_CFG80211
if (_TRUE == wdinfo->wfd_info->wfd_enable)
#endif
build_ie_by_self = 1;
if (build_ie_by_self)
len = build_assoc_resp_wfd_ie(wdinfo, pbuf);
#ifdef CONFIG_IOCTL_CFG80211
else if (mlme->wfd_assoc_resp_ie && mlme->wfd_assoc_resp_ie_len > 0) {
len = mlme->wfd_assoc_resp_ie_len;
_rtw_memcpy(pbuf, mlme->wfd_assoc_resp_ie, len);
}
#endif
exit:
return len;
}
#endif /* CONFIG_WFD */
void rtw_init_wifidirect_timers(_adapter* padapter)
{
@ -5317,7 +5560,8 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role)
rtw_hal_set_odm_var(padapter,HAL_ODM_P2P_STATE,NULL,_TRUE);
#ifdef CONFIG_WFD
rtw_hal_set_odm_var(padapter,HAL_ODM_WIFI_DISPLAY_STATE,NULL,_TRUE);
if (hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
rtw_hal_set_odm_var(padapter, HAL_ODM_WIFI_DISPLAY_STATE, NULL, _TRUE);
#endif
}
@ -5359,7 +5603,8 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role)
rtw_hal_set_odm_var(padapter,HAL_ODM_P2P_STATE,NULL,_FALSE);
#ifdef CONFIG_WFD
rtw_hal_set_odm_var(padapter,HAL_ODM_WIFI_DISPLAY_STATE,NULL,_FALSE);
if (hal_chk_wl_func(padapter, WL_FUNC_MIRACAST))
rtw_hal_set_odm_var(padapter, HAL_ODM_WIFI_DISPLAY_STATE, NULL, _FALSE);
#endif
if (_FAIL == rtw_pwr_wakeup(padapter)) {

View File

@ -38,10 +38,11 @@ int rtw_fw_ps_state(PADAPTER padapter)
_enter_pwrlock(&pwrpriv->check_32k_lock);
if ((padapter->bSurpriseRemoved == _TRUE))
{
DBG_871X("%s: bSurpriseRemoved=%d , hw_init_completed=%d, bDriverStopped=%d \n", __FUNCTION__, padapter->bSurpriseRemoved,
padapter->hw_init_completed,padapter->bDriverStopped);
if (RTW_CANNOT_RUN(padapter)) {
DBG_871X("%s: bSurpriseRemoved=%s , hw_init_completed=%d, bDriverStopped=%s\n", __func__
, rtw_is_surprise_removed(padapter)?"True":"False"
, rtw_get_hw_init_completed(padapter)
, rtw_is_drv_stopped(padapter)?"True":"False");
goto exit_fw_ps_state;
}
rtw_hal_set_hwreg(padapter, HW_VAR_SET_REQ_FW_PS, (u8 *)&dont_care);
@ -210,7 +211,7 @@ bool rtw_pwr_unassociated_idle(_adapter *adapter)
|| check_fwstate(pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS)
|| check_fwstate(pmlmepriv, WIFI_AP_STATE)
|| check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_ADHOC_STATE)
#if defined(CONFIG_P2P) && defined(CONFIG_IOCTL_CFG80211) && defined(CONFIG_P2P_IPS)
#if defined(CONFIG_P2P) && defined(CONFIG_IOCTL_CFG80211)
|| pcfg80211_wdinfo->is_ro_ch
#elif defined(CONFIG_P2P)
|| !rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)
@ -236,7 +237,7 @@ bool rtw_pwr_unassociated_idle(_adapter *adapter)
|| check_fwstate(b_pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS)
|| check_fwstate(b_pmlmepriv, WIFI_AP_STATE)
|| check_fwstate(b_pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_ADHOC_STATE)
#if defined(CONFIG_P2P) && defined(CONFIG_IOCTL_CFG80211) && defined(CONFIG_P2P_IPS)
#if defined(CONFIG_P2P) && defined(CONFIG_IOCTL_CFG80211)
|| b_pcfg80211_wdinfo->is_ro_ch
#elif defined(CONFIG_P2P)
|| !rtw_p2p_chk_state(b_pwdinfo, P2P_STATE_NONE)
@ -354,7 +355,6 @@ void rtw_ps_processor(_adapter*padapter)
{
pwrpriv->change_rfpwrstate = rf_off;
pwrpriv->brfoffbyhw = _TRUE;
padapter->bCardDisableWOHSM = _TRUE;
rtw_hw_suspend(padapter );
}
else
@ -396,12 +396,10 @@ void rtw_ps_processor(_adapter*padapter)
DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x)\n",__FUNCTION__,pwrpriv->bInternalAutoSuspend);
} else {
pwrpriv->change_rfpwrstate = rf_off;
padapter->bCardDisableWOHSM = _TRUE;
DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x) call autosuspend_enter\n",__FUNCTION__,pwrpriv->bInternalAutoSuspend);
autosuspend_enter(padapter);
}
#else
padapter->bCardDisableWOHSM = _TRUE;
autosuspend_enter(padapter);
#endif //if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
}
@ -542,20 +540,21 @@ _func_enter_;
}
}
if ((padapter->bSurpriseRemoved == _TRUE) ||
(padapter->hw_init_completed == _FALSE))
if (rtw_is_surprise_removed(padapter) ||
(!rtw_is_hw_init_completed(padapter)))
{
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_err_,
("%s: SurpriseRemoved(%d) hw_init_completed(%d)\n",
__FUNCTION__, padapter->bSurpriseRemoved, padapter->hw_init_completed));
("%s: SurpriseRemoved(%s) hw_init_completed(%s)\n"
, __func__
, rtw_is_surprise_removed(padapter)?"True":"False"
, rtw_is_hw_init_completed(padapter)?"True":"False"));
pwrpriv->cpwm = PS_STATE_S4;
return;
}
if (padapter->bDriverStopped == _TRUE)
{
if (rtw_is_drv_stopped(padapter)) {
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_err_,
("%s: change power state(0x%02X) when DriverStopped\n", __FUNCTION__, pslv));
@ -690,7 +689,7 @@ u8 PS_RDY_CHECK(_adapter * padapter)
|| check_fwstate(pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS)
|| check_fwstate(pmlmepriv, WIFI_AP_STATE)
|| check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_ADHOC_STATE)
#if defined(CONFIG_P2P) && defined(CONFIG_IOCTL_CFG80211) && defined(CONFIG_P2P_IPS)
#if defined(CONFIG_P2P) && defined(CONFIG_IOCTL_CFG80211)
|| pcfg80211_wdinfo->is_ro_ch
#elif defined(CONFIG_P2P)
|| !rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)
@ -906,8 +905,6 @@ _func_enter_;
else
pwrpriv->lps_leave_cnts = 0;
#ifdef CONFIG_TDLS
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for(i=0; i< NUM_STA; i++)
{
phead = &(pstapriv->sta_hash[i]);
@ -922,8 +919,6 @@ _func_enter_;
plist = get_next(plist);
}
}
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
#endif //CONFIG_TDLS
pwrpriv->pwr_mode = ps_mode;
@ -985,8 +980,6 @@ _func_enter_;
else
pwrpriv->lps_enter_cnts = 0;
#ifdef CONFIG_TDLS
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
for(i=0; i< NUM_STA; i++)
{
phead = &(pstapriv->sta_hash[i]);
@ -1001,8 +994,6 @@ _func_enter_;
plist = get_next(plist);
}
}
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
#endif //CONFIG_TDLS
#ifdef CONFIG_BT_COEXIST
@ -1071,8 +1062,7 @@ s32 LPS_RF_ON_check(PADAPTER padapter, u32 delay_ms)
if (_TRUE == bAwake)
break;
if (_TRUE == padapter->bSurpriseRemoved)
{
if (rtw_is_surprise_removed(padapter)) {
err = -2;
DBG_871X("%s: device surprise removed!!\n", __FUNCTION__);
break;
@ -1224,10 +1214,8 @@ _func_enter_;
DBG_871X("%s.....\n",__FUNCTION__);
if (_TRUE == Adapter->bSurpriseRemoved)
{
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved=%d Skip!\n",
FUNC_ADPT_ARG(Adapter), Adapter->bSurpriseRemoved);
if (rtw_is_surprise_removed(Adapter)) {
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved=_TRUE Skip!\n", FUNC_ADPT_ARG(Adapter));
return;
}
@ -1357,10 +1345,8 @@ _func_enter_;
return;
}
if (_TRUE == Adapter->bSurpriseRemoved)
{
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved=%d Skip!\n",
FUNC_ADPT_ARG(Adapter), Adapter->bSurpriseRemoved);
if (rtw_is_surprise_removed(Adapter)) {
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved=_TRUE Skip!\n", FUNC_ADPT_ARG(Adapter));
return;
}
@ -1439,10 +1425,10 @@ _func_enter_;
{
_enter_pwrlock(&pwrpriv->lock);
if ((padapter->bSurpriseRemoved == _TRUE)
|| (padapter->hw_init_completed == _FALSE)
if (rtw_is_surprise_removed(padapter)
|| (!rtw_is_hw_init_completed(padapter))
#ifdef CONFIG_USB_HCI
|| (padapter->bDriverStopped== _TRUE)
|| rtw_is_drv_stopped(padapter)
#endif
|| (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
)
@ -1527,7 +1513,7 @@ static void cpwm_event_callback(struct work_struct *work)
{
struct pwrctrl_priv *pwrpriv = container_of(work, struct pwrctrl_priv, cpwm_event);
struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
_adapter *adapter = dvobj->if1;
_adapter *adapter = dvobj->padapters[IFACE_ID0];
struct reportpwrstate_parm report;
//DBG_871X("%s\n",__FUNCTION__);
@ -1546,7 +1532,7 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work)
pwrpriv = container_of(work, struct pwrctrl_priv, rpwmtimeoutwi);
dvobj = pwrctl_to_dvobj(pwrpriv);
padapter = dvobj->if1;
padapter = dvobj->padapters[IFACE_ID0];
// DBG_871X("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
_enter_pwrlock(&pwrpriv->lock);
@ -2103,6 +2089,8 @@ static void resume_workitem_callback(struct work_struct *work);
void rtw_init_pwrctrl_priv(PADAPTER padapter)
{
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
int i = 0;
u8 val8 = 0;
#if defined(CONFIG_CONCURRENT_MODE)
if (padapter->adapter_type != PRIMARY_ADAPTER)
@ -2187,16 +2175,34 @@ _func_enter_;
rtw_register_early_suspend(pwrctrlpriv);
#endif //CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER
#ifdef CONFIG_GPIO_WAKEUP
/*default low active*/
pwrctrlpriv->is_high_active = HIGH_ACTIVE;
val8 = (pwrctrlpriv->is_high_active == 0) ? 1 : 0;
rtw_hal_switch_gpio_wl_ctrl(padapter, WAKEUP_GPIO_IDX, _TRUE);
rtw_hal_set_output_gpio(padapter, WAKEUP_GPIO_IDX, val8);
DBG_871X("%s: set GPIO_%d %d as default.\n",
__func__, WAKEUP_GPIO_IDX, val8);
#endif /* CONFIG_GPIO_WAKEUP */
#ifdef CONFIG_WOWLAN
pwrctrlpriv->wowlan_from_cmd = _FALSE;
#endif
pwrctrlpriv->wowlan_pattern_idx = 0;
for (i = 0 ; i < MAX_WKFM_NUM; i++) {
_rtw_memset(pwrctrlpriv->patterns[i].content, '\0',
sizeof(pwrctrlpriv->patterns[i].content));
_rtw_memset(pwrctrlpriv->patterns[i].mask, '\0',
sizeof(pwrctrlpriv->patterns[i].mask));
pwrctrlpriv->patterns[i].len = 0;
}
#ifdef CONFIG_PNO_SUPPORT
pwrctrlpriv->pno_inited = _FALSE;
pwrctrlpriv->pnlo_info = NULL;
pwrctrlpriv->pscan_info = NULL;
pwrctrlpriv->pno_ssid_list = NULL;
pwrctrlpriv->pno_in_resume = _TRUE;
#endif
#endif /* CONFIG_PNO_SUPPORT */
#endif /* CONFIG_WOWLAN */
_func_exit_;
@ -2224,6 +2230,7 @@ _func_enter_;
}
#endif
#ifdef CONFIG_WOWLAN
#ifdef CONFIG_PNO_SUPPORT
if (pwrctrlpriv->pnlo_info != NULL)
printk("****** pnlo_info memory leak********\n");
@ -2234,6 +2241,7 @@ _func_enter_;
if (pwrctrlpriv->pno_ssid_list != NULL)
printk("****** pno_ssid_list memory leak********\n");
#endif
#endif /* CONFIG_WOWLAN */
#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
rtw_unregister_early_suspend(pwrctrlpriv);
@ -2252,7 +2260,7 @@ static void resume_workitem_callback(struct work_struct *work)
{
struct pwrctrl_priv *pwrpriv = container_of(work, struct pwrctrl_priv, resume_work);
struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
_adapter *adapter = dvobj->if1;
_adapter *adapter = dvobj->padapters[IFACE_ID0];
DBG_871X("%s\n",__FUNCTION__);
@ -2307,7 +2315,7 @@ static void rtw_late_resume(struct early_suspend *h)
{
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
_adapter *adapter = dvobj->if1;
_adapter *adapter = dvobj->padapters[IFACE_ID0];
DBG_871X("%s\n",__FUNCTION__);
@ -2360,7 +2368,7 @@ static void rtw_late_resume(android_early_suspend_t *h)
{
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
_adapter *adapter = dvobj->if1;
_adapter *adapter = dvobj->padapters[IFACE_ID0];
DBG_871X("%s\n",__FUNCTION__);
if(pwrpriv->do_late_resume) {
@ -2549,15 +2557,15 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
}
//TODO: the following checking need to be merged...
if(padapter->bDriverStopped
if (rtw_is_drv_stopped(padapter)
|| !padapter->bup
|| !padapter->hw_init_completed
){
DBG_8192C("%s: bDriverStopped=%d, bup=%d, hw_init_completed=%u\n"
|| !rtw_is_hw_init_completed(padapter)
) {
DBG_8192C("%s: bDriverStopped=%s, bup=%d, hw_init_completed=%u\n"
, caller
, padapter->bDriverStopped
, padapter->bup
, padapter->hw_init_completed);
, rtw_is_drv_stopped(padapter)?"True":"False"
, padapter->bup
, rtw_get_hw_init_completed(padapter));
ret= _FALSE;
goto exit;
}
@ -2610,7 +2618,7 @@ int rtw_pm_set_ips(_adapter *padapter, u8 mode)
else if(mode ==IPS_NONE){
rtw_ips_mode_req(pwrctrlpriv, mode);
DBG_871X("%s %s\n", __FUNCTION__, "IPS_NONE");
if((padapter->bSurpriseRemoved ==0)&&(_FAIL == rtw_pwr_wakeup(padapter)) )
if (!rtw_is_surprise_removed(padapter) && (_FAIL == rtw_pwr_wakeup(padapter)))
return -EFAULT;
}
else {

View File

@ -44,7 +44,7 @@ u8 signal_stat_calc_profile[SIGNAL_STAT_CALC_PROFILE_MAX][2] = {
};
#ifndef RTW_SIGNAL_STATE_CALC_PROFILE
#define RTW_SIGNAL_STATE_CALC_PROFILE SIGNAL_STAT_CALC_PROFILE_0
#define RTW_SIGNAL_STATE_CALC_PROFILE SIGNAL_STAT_CALC_PROFILE_1
#endif
#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
@ -195,6 +195,19 @@ _func_exit_;
}
bool rtw_rframe_del_wfd_ie(union recv_frame *rframe, u8 ies_offset)
{
#define DBG_RFRAME_DEL_WFD_IE 0
u8 *ies = rframe->u.hdr.rx_data + sizeof(struct rtw_ieee80211_hdr_3addr) + ies_offset;
uint ies_len_ori = rframe->u.hdr.len - (ies - rframe->u.hdr.rx_data);
uint ies_len;
ies_len = rtw_del_wfd_ie(ies, ies_len_ori, DBG_RFRAME_DEL_WFD_IE ? __func__ : NULL);
rframe->u.hdr.len -= ies_len_ori - ies_len;
return ies_len_ori != ies_len;
}
union recv_frame *_rtw_alloc_recvframe (_queue *pfree_recv_queue)
{
@ -578,7 +591,7 @@ _func_enter_;
if((prxattrib->bdecrypted ==_TRUE)&& (brpt_micerror == _TRUE))
{
rtw_handle_tkip_mic_err(adapter,(u8)IS_MCAST(prxattrib->ra));
rtw_handle_tkip_mic_err(adapter, stainfo, (u8)IS_MCAST(prxattrib->ra));
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" mic error :prxattrib->bdecrypted=%d ",prxattrib->bdecrypted));
DBG_871X(" mic error :prxattrib->bdecrypted=%d\n",prxattrib->bdecrypted);
}
@ -1025,14 +1038,20 @@ sint OnTDLS(_adapter *adapter, union recv_frame *precv_frame)
+ PAYLOAD_TYPE_LEN
+ category_field;
DBG_871X("[TDLS] Recv %s from "MAC_FMT" with SeqNum = %d\n", rtw_tdls_action_txt(*paction), MAC_ARG(pattrib->src), GetSequence(get_recvframe_data(precv_frame)));
if (hal_chk_wl_func(adapter, WL_FUNC_TDLS) == _FALSE) {
DBG_871X("Ignore tdls frame since hal doesn't support tdls\n");
ret = _FAIL;
return ret;
}
if (ptdlsinfo->tdls_enable == _FALSE) {
DBG_871X("recv tdls frame, "
"but tdls haven't enabled\n");
ret = _FAIL;
return ret;
}
DBG_871X("[TDLS] Recv %s from "MAC_FMT"\n", rtw_tdls_action_txt(*paction), MAC_ARG(pattrib->src));
switch(*paction){
case TDLS_SETUP_REQUEST:
@ -1104,6 +1123,8 @@ void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_in
struct stainfo_stats *pstats = NULL;
struct rx_pkt_attrib *pattrib = & prframe->u.hdr.attrib;
struct recv_priv *precvpriv = &padapter->recvpriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
sz = get_recvframe_len(prframe);
precvpriv->rx_bytes += sz;
@ -1125,6 +1146,9 @@ void count_rx_stats(_adapter *padapter, union recv_frame *prframe, struct sta_in
pstats->rx_data_pkts++;
pstats->rx_bytes += sz;
/*record rx packets for every tid*/
pstats->rx_data_qos_pkts[pattrib->priority]++;
#ifdef CONFIG_TDLS
if(psta->tdls_sta_state & TDLS_LINKED_STATE)
@ -1239,13 +1263,11 @@ _func_enter_;
}
#ifdef CONFIG_TDLS_CH_SW
pchsw_info->ch_sw_state |= TDLS_PEER_AT_OFF_STATE;
if(ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) {
if (!(pchsw_info->ch_sw_state & TDLS_PEER_AT_OFF_STATE)) {
DBG_871X("%s %d\n", __FUNCTION__, __LINE__);
issue_nulldata_to_TDLS_peer_STA(adapter, ptdls_sta->hwaddr, 0, 0, 0);
if (adapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(adapter)) {
pchsw_info->ch_sw_state |= TDLS_PEER_AT_OFF_STATE;
if (!(pchsw_info->ch_sw_state & TDLS_CH_SW_INITIATOR_STATE))
_cancel_timer_ex(&ptdls_sta->ch_sw_timer);
/* On_TDLS_Peer_Traffic_Rsp(adapter, precv_frame); */
}
}
@ -1802,7 +1824,7 @@ sint validate_recv_ctrl_frame(_adapter *padapter, union recv_frame *precv_frame)
else if(GetFrameSubType(pframe) == WIFI_NDPA) {
#ifdef CONFIG_BEAMFORMING
beamforming_get_ndpa_frame(padapter, precv_frame);
#endif
#endif/*CONFIG_BEAMFORMING*/
}
return _FAIL;
@ -2081,15 +2103,15 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
struct rx_pkt_attrib *pattrib = & precv_frame->u.hdr.attrib;
u8 *ptr = precv_frame->u.hdr.rx_data;
struct sta_info *psta;
struct sta_priv *pstapriv = &adapter->stapriv;
u8 type;
u8 subtype;
type = GetFrameType(ptr);
subtype = GetFrameSubType(ptr); //bit(7)~bit(2)
//only support station mode
if(check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED)
&& adapter->securitypriv.binstallBIPkey == _TRUE)
if (adapter->securitypriv.binstallBIPkey == _TRUE)
{
//unicast management frame decrypt
if(pattrib->privacy && !(IS_MCAST(GetAddr1Ptr(ptr))) &&
@ -2160,14 +2182,15 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram
{
DBG_871X("802.11w recv none protected packet\n");
//drop pkt, don't issue sa query request
//issue_action_SA_Query(adapter, NULL, 0, 0);
/* issue_action_SA_Query(adapter, NULL, 0, 0, 0); */
goto validate_80211w_fail;
}
}//802.11w protect
else
{
if(subtype == WIFI_ACTION)
{
psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(ptr));
if (subtype == WIFI_ACTION && psta && psta->bpairwise_key_installed == _TRUE) {
//according 802.11-2012 standard, these five types are not robust types
if( ptr[WLAN_HDR_A3_LEN] != RTW_WLAN_CATEGORY_PUBLIC &&
ptr[WLAN_HDR_A3_LEN] != RTW_WLAN_CATEGORY_HT &&
@ -2187,7 +2210,7 @@ static sint validate_80211w_mgmt(_adapter *adapter, union recv_frame *precv_fram
if(reason == 6 || reason == 7)
{
//issue sa query request
issue_action_SA_Query(adapter, NULL, 0, 0);
issue_action_SA_Query(adapter, NULL, 0, 0, IEEE80211W_RIGHT_KEY);
}
goto validate_80211w_fail;
}
@ -2300,7 +2323,8 @@ _func_enter_;
#if 1 //Dump rx packets
{
u8 bDumpRxPkt;
u8 bDumpRxPkt = 0;
rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt));
if (bDumpRxPkt == 1) //dump all rx packets
dump_rx_packet(ptr);
@ -2318,7 +2342,7 @@ _func_enter_;
if(validate_80211w_mgmt(adapter, precv_frame) == _FAIL)
{
retval = _FAIL;
DBG_COUNTER(padapter->rx_logs.core_rx_pre_mgmt_err_80211w);
DBG_COUNTER(adapter->rx_logs.core_rx_pre_mgmt_err_80211w);
break;
}
#endif //CONFIG_IEEE80211W
@ -3313,13 +3337,9 @@ int recv_indicatepkts_in_order(_adapter *padapter, struct recv_reorder_ctrl *pre
{
//DBG_871X("recv_indicatepkts_in_order, amsdu!=1, indicate_seq=%d, seq_num=%d\n", preorder_ctrl->indicate_seq, pattrib->seq_num);
if ((padapter->bDriverStopped == _FALSE) &&
(padapter->bSurpriseRemoved == _FALSE))
{
rtw_recv_indicatepkt(padapter, prframe);//indicate this recv_frame
}
if (!RTW_CANNOT_RUN(padapter))
rtw_recv_indicatepkt(padapter, prframe);/*indicate this recv_frame*/
}
else if(pattrib->amsdu==1)
{
@ -3403,9 +3423,7 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe)
// || (pattrib->eth_type==0x0806) || (pattrib->ack_policy!=0))
if (pattrib->qos!=1)
{
if ((padapter->bDriverStopped == _FALSE) &&
(padapter->bSurpriseRemoved == _FALSE))
{
if (!RTW_CANNOT_RUN(padapter)) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("@@@@ recv_indicatepkt_reorder -recv_func recv_indicatepkt\n" ));
rtw_recv_indicatepkt(padapter, prframe);
@ -3537,11 +3555,15 @@ int recv_indicatepkt_reorder(_adapter *padapter, union recv_frame *prframe)
//recv_indicatepkts_in_order(padapter, preorder_ctrl, _TRUE);
if(recv_indicatepkts_in_order(padapter, preorder_ctrl, _FALSE)==_TRUE)
{
if (!preorder_ctrl->bReorderWaiting) {
preorder_ctrl->bReorderWaiting = _TRUE;
_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME);
}
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
}
else
{
preorder_ctrl->bReorderWaiting = _FALSE;
_exit_critical_bh(&ppending_recvframe_queue->lock, &irql);
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
}
@ -3567,15 +3589,17 @@ void rtw_reordering_ctrl_timeout_handler(void *pcontext)
_queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
if(padapter->bDriverStopped ||padapter->bSurpriseRemoved)
{
if (RTW_CANNOT_RUN(padapter))
return;
}
//DBG_871X("+rtw_reordering_ctrl_timeout_handler()=>\n");
_enter_critical_bh(&ppending_recvframe_queue->lock, &irql);
if (preorder_ctrl) {
preorder_ctrl->bReorderWaiting = _FALSE;
}
if(recv_indicatepkts_in_order(padapter, preorder_ctrl, _TRUE)==_TRUE)
{
_set_timer(&preorder_ctrl->reordering_ctrl_timer, REORDER_WAIT_TIME);
@ -3619,9 +3643,7 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe)
DBG_871X("DBG_RX_DROP_FRAME %s recv_indicatepkt_reorder error!\n", __FUNCTION__);
#endif
if ((padapter->bDriverStopped == _FALSE) &&
(padapter->bSurpriseRemoved == _FALSE))
{
if (!RTW_CANNOT_RUN(padapter)) {
retval = _FAIL;
return retval;
}
@ -3640,19 +3662,18 @@ int process_recv_indicatepkts(_adapter *padapter, union recv_frame *prframe)
return retval;
}
if ((padapter->bDriverStopped ==_FALSE)&&( padapter->bSurpriseRemoved==_FALSE))
{
if (!RTW_CANNOT_RUN(padapter)) {
//indicate this recv_frame
RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("@@@@ process_recv_indicatepkts- recv_func recv_indicatepkt\n" ));
rtw_recv_indicatepkt(padapter, prframe);
}
else
{
RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("@@@@ process_recv_indicatepkts- recv_func free_indicatepkt\n" ));
RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("recv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved));
RT_TRACE(_module_rtl871x_recv_c_, _drv_notice_, ("recv_func:bDriverStopped(%s) OR bSurpriseRemoved(%s)"
, rtw_is_drv_stopped(padapter)?"True":"False"
, rtw_is_surprise_removed(padapter)?"True":"False"));
retval = _FAIL;
return retval;
}
@ -3883,8 +3904,7 @@ int mp_recv_frame(_adapter *padapter, union recv_frame *rframe)
ret = _FAIL;
goto exit;
}
if ((padapter->bDriverStopped == _FALSE) && (padapter->bSurpriseRemoved == _FALSE))
{
if (!RTW_CANNOT_RUN(padapter)) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("@@@@ recv_func: recv_func rtw_recv_indicatepkt\n" ));
//indicate this recv_frame
ret = rtw_recv_indicatepkt(padapter, rframe);
@ -3902,10 +3922,13 @@ int mp_recv_frame(_adapter *padapter, union recv_frame *rframe)
else
{
RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("@@@@ recv_func: rtw_free_recvframe\n" ));
RT_TRACE(_module_rtl871x_recv_c_, _drv_debug_, ("recv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved));
RT_TRACE(_module_rtl871x_recv_c_, _drv_debug_, ("recv_func:bDriverStopped(%s) OR bSurpriseRemoved(%s)"
, rtw_is_drv_stopped(padapter)?"True":"False"
, rtw_is_surprise_removed(padapter)?"True":"False"));
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s ecv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", __FUNCTION__,
padapter->bDriverStopped, padapter->bSurpriseRemoved);
DBG_871X("DBG_RX_DROP_FRAME %s ecv_func:bDriverStopped(%s) OR bSurpriseRemoved(%s)\n", __func__,
rtw_is_drv_stopped(padapter)?"True":"False",
rtw_is_surprise_removed(padapter)?"True":"False");
#endif
ret = _FAIL;
rtw_free_recvframe(rframe, pfree_recv_queue);//free this recv_frame
@ -4026,9 +4049,8 @@ static sint fill_radiotap_hdr(_adapter *padapter, union recv_frame *precvframe,
if (pattrib->mfrag)
hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_FRAG;
#ifndef CONFIG_RX_PACKET_APPEND_FCS
hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_FCS;
#endif
/* always append FCS */
hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_FCS;
if (0)
hdr_buf[rt_len] |= IEEE80211_RADIOTAP_F_DATAPAD;
@ -4260,7 +4282,7 @@ int recv_frame_monitor(_adapter *padapter, union recv_frame *rframe)
rframe->u.hdr.rx_tail = skb_tail_pointer(pskb);
rframe->u.hdr.rx_end = skb_end_pointer(pskb);
if ((padapter->bDriverStopped == _FALSE) && (padapter->bSurpriseRemoved == _FALSE)) {
if (!RTW_CANNOT_RUN(padapter)) {
/* indicate this recv_frame */
ret = rtw_recv_monitor(padapter, rframe);
if (ret != _SUCCESS) {
@ -4427,8 +4449,7 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
goto _recv_data_drop;
}
if ((padapter->bDriverStopped == _FALSE) && (padapter->bSurpriseRemoved == _FALSE))
{
if (!RTW_CANNOT_RUN(padapter)) {
RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("@@@@ recv_func: recv_func rtw_recv_indicatepkt\n" ));
//indicate this recv_frame
ret = rtw_recv_indicatepkt(padapter, prframe);
@ -4445,8 +4466,9 @@ int recv_func_posthandle(_adapter *padapter, union recv_frame *prframe)
RT_TRACE(_module_rtl871x_recv_c_, _drv_alert_, ("@@@@ recv_func: rtw_free_recvframe\n" ));
RT_TRACE(_module_rtl871x_recv_c_, _drv_debug_, ("recv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved));
#ifdef DBG_RX_DROP_FRAME
DBG_871X("DBG_RX_DROP_FRAME %s ecv_func:bDriverStopped(%d) OR bSurpriseRemoved(%d)\n", __FUNCTION__,
padapter->bDriverStopped, padapter->bSurpriseRemoved);
DBG_871X("DBG_RX_DROP_FRAME %s ecv_func:bDriverStopped(%s) OR bSurpriseRemoved(%s)\n", __func__
, rtw_is_drv_stopped(padapter)?"True":"False"
, rtw_is_surprise_removed(padapter)?"True":"False");
#endif
ret = _FAIL;
rtw_free_recvframe(orig_prframe, pfree_recv_queue); //free this recv_frame
@ -4867,6 +4889,22 @@ void rx_query_phy_status(
if (_rtw_memcmp(adapter_mac_addr(padapter), sa, ETH_ALEN) == _TRUE) {
static u32 start_time = 0;
#if 0 /*For debug */
if (IsFrameTypeCtrl(wlanhdr)) {
DBG_871X("-->Control frame: Y\n");
DBG_871X("-->pkt_len: %d\n", pattrib->pkt_len);
DBG_871X("-->Sub Type = 0x%X\n", GetFrameSubType(wlanhdr));
}
/* Dump first 40 bytes of header */
int i = 0;
for (i = 0; i < 40; i++)
DBG_871X("%d: %X\n", i, *((u8 *)wlanhdr + i));
DBG_871X("\n");
#endif
if ((start_time == 0) || (rtw_get_passing_time_ms(start_time) > 5000)) {
DBG_871X_LEVEL(_drv_always_, "Warning!!! %s: Confilc mac addr!!\n", __func__);
start_time = rtw_get_current_time();
@ -4887,9 +4925,6 @@ void rx_query_phy_status(
psta->rssi = pattrib->phy_info.RecvSignalPower;
//_exit_critical_bh(&pHalData->odm_stainfo_lock, &irqL);
#ifdef CONFIG_SW_ANTENNA_DIVERSITY
if (GET_HAL_DATA(padapter)->odmpriv.RSSI_test == _FALSE)
#endif
{
precvframe->u.hdr.psta = NULL;
if (pkt_info.bPacketMatchBSSID
@ -4908,4 +4943,27 @@ void rx_query_phy_status(
}
}
}
/*
* Increase and check if the continual_no_rx_packet of this @param pmlmepriv is larger than MAX_CONTINUAL_NORXPACKET_COUNT
* @return _TRUE:
* @return _FALSE:
*/
int rtw_inc_and_chk_continual_no_rx_packet(struct sta_info *sta, int tid_index)
{
int ret = _FALSE;
int value = ATOMIC_INC_RETURN(&sta->continual_no_rx_packet[tid_index]);
if (value >= MAX_CONTINUAL_NORXPACKET_COUNT)
ret = _TRUE;
return ret;
}
/*
* Set the continual_no_rx_packet of this @param pmlmepriv to 0
*/
void rtw_reset_continual_no_rx_packet(struct sta_info *sta, int tid_index)
{
ATOMIC_SET(&sta->continual_no_rx_packet[tid_index], 0);
}

View File

@ -20,72 +20,722 @@
#define _RTW_RF_C_
#include <drv_types.h>
#include <hal_data.h>
u8 center_ch_5g_all[CENTER_CH_5G_ALL_NUM] = {
36, 38, 40, 42, 44, 46, 48, /* Band 1 */
52, 54, 56, 58, 60, 62, 64, /* Band 2 */
100, 102, 104, 106, 108, 110, 112, /* Band 3 */
116, 118, 120, 122, 124, 126, 128, /* Band 3 */
132, 134, 136, 138, 140, 142, 144, /* Band 3 */
149, 151, 153, 155, 157, 159, 161, /* Band 4 */
165, 167, 169, 171, 173, 175, 177}; /* Band 4 */
struct ch_freq {
u32 channel;
u32 frequency;
u8 center_ch_5g_20m[CENTER_CH_5G_20M_NUM] = {
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
};
struct ch_freq ch_freq_map[] = {
{1, 2412},{2, 2417},{3, 2422},{4, 2427},{5, 2432},
{6, 2437},{7, 2442},{8, 2447},{9, 2452},{10, 2457},
{11, 2462},{12, 2467},{13, 2472},{14, 2484},
/* UNII */
{36, 5180},{40, 5200},{44, 5220},{48, 5240},{52, 5260},
{56, 5280},{60, 5300},{64, 5320},{149, 5745},{153, 5765},
{157, 5785},{161, 5805},{165, 5825},{167, 5835},{169, 5845},
{171, 5855},{173, 5865},
/* HiperLAN2 */
{100, 5500},{104, 5520},{108, 5540},{112, 5560},{116, 5580},
{120, 5600},{124, 5620},{128, 5640},{132, 5660},{136, 5680},
{140, 5700},
/* Japan MMAC */
{34, 5170},{38, 5190},{42, 5210},{46, 5230},
/* Japan */
{184, 4920},{188, 4940},{192, 4960},{196, 4980},
{208, 5040},/* Japan, means J08 */
{212, 5060},/* Japan, means J12 */
{216, 5080},/* Japan, means J16 */
u8 center_ch_5g_40m[CENTER_CH_5G_40M_NUM] = {38, 46, 54, 62, 102, 110, 118, 126, 134, 142, 151, 159, 167, 175};
u8 center_ch_5g_80m[CENTER_CH_5G_80M_NUM] = {42, 58, 106, 122, 138, 155, 171};
struct center_chs_ent {
u8 ch_num;
u8 *chs;
};
int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
struct center_chs_ent center_chs_5g_by_bw[] = {
{CENTER_CH_5G_20M_NUM, center_ch_5g_20m},
{CENTER_CH_5G_40M_NUM, center_ch_5g_40m},
{CENTER_CH_5G_80M_NUM, center_ch_5g_80m},
};
u32 rtw_ch2freq(u32 channel)
inline u8 center_chs_5g_num(u8 bw)
{
u8 i;
u32 freq = 0;
for (i = 0; i < ch_freq_map_num; i++)
{
if (channel == ch_freq_map[i].channel)
{
freq = ch_freq_map[i].frequency;
break;
}
}
if (i == ch_freq_map_num)
freq = 2412;
return freq;
if (bw >= CHANNEL_WIDTH_160)
return 0;
return center_chs_5g_by_bw[bw].ch_num;
}
u32 rtw_freq2ch(u32 freq)
inline u8 center_chs_5g(u8 bw, u8 id)
{
u8 i;
u32 ch = 0;
if (bw >= CHANNEL_WIDTH_160)
return 0;
for (i = 0; i < ch_freq_map_num; i++)
{
if (freq == ch_freq_map[i].frequency)
{
ch = ch_freq_map[i].channel;
break;
}
}
if (i == ch_freq_map_num)
ch = 1;
return ch;
if (id >= center_chs_5g_num(bw))
return 0;
return center_chs_5g_by_bw[bw].chs[id];
}
int rtw_ch2freq(int chan)
{
/* see 802.11 17.3.8.3.2 and Annex J
* there are overlapping channel numbers in 5GHz and 2GHz bands */
/*
* RTK: don't consider the overlapping channel numbers: 5G channel <= 14,
* because we don't support it. simply judge from channel number
*/
if (chan >= 1 && chan <= 14) {
if (chan == 14)
return 2484;
else if (chan < 14)
return 2407 + chan * 5;
} else if (chan >= 36 && chan <= 177) {
return 5000 + chan * 5;
}
return 0; /* not supported */
}
int rtw_freq2ch(int freq)
{
/* see 802.11 17.3.8.3.2 and Annex J */
if (freq == 2484)
return 14;
else if (freq < 2484)
return (freq - 2407) / 5;
else if (freq >= 4910 && freq <= 4980)
return (freq - 4000) / 5;
else if (freq <= 45000) /* DMG band lower limit */
return (freq - 5000) / 5;
else if (freq >= 58320 && freq <= 64800)
return (freq - 56160) / 2160;
else
return 0;
}
bool rtw_chbw_to_freq_range(u8 ch, u8 bw, u8 offset, u32 *hi, u32 *lo)
{
u8 c_ch;
u32 freq;
u32 hi_ret = 0, lo_ret = 0;
int i;
bool valid = _FALSE;
if (hi)
*hi = 0;
if (lo)
*lo = 0;
c_ch = rtw_get_center_ch(ch, bw, offset);
freq = rtw_ch2freq(c_ch);
if (!freq) {
rtw_warn_on(1);
goto exit;
}
if (bw == CHANNEL_WIDTH_80) {
hi_ret = freq + 40;
lo_ret = freq - 40;
} else if (bw == CHANNEL_WIDTH_40) {
hi_ret = freq + 20;
lo_ret = freq - 20;
} else if (bw == CHANNEL_WIDTH_20) {
hi_ret = freq + 10;
lo_ret = freq - 10;
} else {
rtw_warn_on(1);
}
if (hi)
*hi = hi_ret;
if (lo)
*lo = lo_ret;
valid = _TRUE;
exit:
return valid;
}
const char * const _ch_width_str[] = {
"20MHz",
"40MHz",
"80MHz",
"160MHz",
"80_80MHz",
"CHANNEL_WIDTH_MAX",
};
const u8 _ch_width_to_bw_cap[] = {
BW_CAP_20M,
BW_CAP_40M,
BW_CAP_80M,
BW_CAP_160M,
BW_CAP_80_80M,
0,
};
const char * const _band_str[] = {
"2.4G",
"5G",
"BOTH",
"BAND_MAX",
};
const u8 _band_to_band_cap[] = {
BAND_CAP_2G,
BAND_CAP_5G,
0,
0,
};
#ifdef CONFIG_80211AC_VHT
#define COUNTRY_CHPLAN_ASSIGN_EN_11AC(_val) , .en_11ac = (_val)
#else
#define COUNTRY_CHPLAN_ASSIGN_EN_11AC(_val)
#endif
#if RTW_DEF_MODULE_REGULATORY_CERT
#define COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_val) , .def_module_flags = (_val)
#else
#define COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_val)
#endif
/* has def_module_flags specified, used by common map and HAL dfference map */
#define COUNTRY_CHPLAN_ENT(_alpha2, _chplan, _en_11ac, _def_module_flags) \
{.alpha2 = (_alpha2), .chplan = (_chplan) \
COUNTRY_CHPLAN_ASSIGN_EN_11AC(_en_11ac) \
COUNTRY_CHPLAN_ASSIGN_DEF_MODULE_FLAGS(_def_module_flags) \
}
#ifdef CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP
#include "../platform/custom_country_chplan.h"
#elif RTW_DEF_MODULE_REGULATORY_CERT
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8821AE_HMC_M2)
static const struct country_chplan RTL8821AE_HMC_M2_country_chplan_map[] = {
COUNTRY_CHPLAN_ENT("CN", 0x51, 1, 0xFB), /* China */
COUNTRY_CHPLAN_ENT("RU", 0x59, 0, 0xFB), /* Russia(fac/gost), Kaliningrad */
COUNTRY_CHPLAN_ENT("UA", 0x26, 0, 0xFB), /* Ukraine */
};
static const u16 RTL8821AE_HMC_M2_country_chplan_map_sz = sizeof(RTL8821AE_HMC_M2_country_chplan_map)/sizeof(struct country_chplan);
#endif
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8821AU)
static const struct country_chplan RTL8821AU_country_chplan_map[] = {
COUNTRY_CHPLAN_ENT("RU", 0x59, 0, 0xFB), /* Russia(fac/gost), Kaliningrad */
COUNTRY_CHPLAN_ENT("UA", 0x26, 0, 0xFB), /* Ukraine */
};
static const u16 RTL8821AU_country_chplan_map_sz = sizeof(RTL8821AU_country_chplan_map)/sizeof(struct country_chplan);
#endif
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8812AENF_NGFF)
static const struct country_chplan RTL8812AENF_NGFF_country_chplan_map[] = {
};
static const u16 RTL8812AENF_NGFF_country_chplan_map_sz = sizeof(RTL8812AENF_NGFF_country_chplan_map)/sizeof(struct country_chplan);
#endif
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8812AEBT_HMC)
static const struct country_chplan RTL8812AEBT_HMC_country_chplan_map[] = {
};
static const u16 RTL8812AEBT_HMC_country_chplan_map_sz = sizeof(RTL8812AEBT_HMC_country_chplan_map)/sizeof(struct country_chplan);
#endif
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8188EE_HMC_M2)
static const struct country_chplan RTL8188EE_HMC_M2_country_chplan_map[] = {
};
static const u16 RTL8188EE_HMC_M2_country_chplan_map_sz = sizeof(RTL8188EE_HMC_M2_country_chplan_map)/sizeof(struct country_chplan);
#endif
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8723BE_HMC_M2)
static const struct country_chplan RTL8723BE_HMC_M2_country_chplan_map[] = {
};
static const u16 RTL8723BE_HMC_M2_country_chplan_map_sz = sizeof(RTL8723BE_HMC_M2_country_chplan_map)/sizeof(struct country_chplan);
#endif
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8723BS_NGFF1216)
static const struct country_chplan RTL8723BS_NGFF1216_country_chplan_map[] = {
};
static const u16 RTL8723BS_NGFF1216_country_chplan_map_sz = sizeof(RTL8723BS_NGFF1216_country_chplan_map)/sizeof(struct country_chplan);
#endif
#if (RTW_DEF_MODULE_REGULATORY_CERT & RTW_MODULE_RTL8192EEBT_HMC_M2)
static const struct country_chplan RTL8192EEBT_HMC_M2_country_chplan_map[] = {
};
static const u16 RTL8192EEBT_HMC_M2_country_chplan_map_sz = sizeof(RTL8192EEBT_HMC_M2_country_chplan_map)/sizeof(struct country_chplan);
#endif
/**
* rtw_def_module_get_chplan_from_country -
* @country_code: string of country code
* @return:
* Return NULL for case referring to common map
*/
static const struct country_chplan *rtw_def_module_get_chplan_from_country(const char *country_code)
{
const struct country_chplan *ent = NULL;
const struct country_chplan *hal_map = NULL;
u16 hal_map_sz = 0;
int i;
/* TODO: runtime selection for multi driver */
#if (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8821AE_HMC_M2)
hal_map = RTL8821AE_HMC_M2_country_chplan_map;
hal_map_sz = RTL8821AE_HMC_M2_country_chplan_map_sz;
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8821AU)
hal_map = RTL8821AU_country_chplan_map;
hal_map_sz = RTL8821AU_country_chplan_map_sz;
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8812AENF_NGFF)
hal_map = RTL8812AENF_NGFF_country_chplan_map;
hal_map_sz = RTL8812AENF_NGFF_country_chplan_map_sz;
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8812AEBT_HMC)
hal_map = RTL8812AEBT_HMC_country_chplan_map;
hal_map_sz = RTL8812AEBT_HMC_country_chplan_map_sz;
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8188EE_HMC_M2)
hal_map = RTL8188EE_HMC_M2_country_chplan_map;
hal_map_sz = RTL8188EE_HMC_M2_country_chplan_map_sz;
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8723BE_HMC_M2)
hal_map = RTL8723BE_HMC_M2_country_chplan_map;
hal_map_sz = RTL8723BE_HMC_M2_country_chplan_map_sz;
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8723BS_NGFF1216)
hal_map = RTL8723BS_NGFF1216_country_chplan_map;
hal_map_sz = RTL8723BS_NGFF1216_country_chplan_map_sz;
#elif (RTW_DEF_MODULE_REGULATORY_CERT == RTW_MODULE_RTL8192EEBT_HMC_M2)
hal_map = RTL8192EEBT_HMC_M2_country_chplan_map;
hal_map_sz = RTL8192EEBT_HMC_M2_country_chplan_map_sz;
#endif
if (hal_map == NULL || hal_map_sz == 0)
goto exit;
for (i = 0; i < hal_map_sz; i++) {
if (strncmp(country_code, hal_map[i].alpha2, 2) == 0) {
ent = &hal_map[i];
break;
}
}
exit:
return ent;
}
#endif /* CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP or RTW_DEF_MODULE_REGULATORY_CERT */
static const struct country_chplan country_chplan_map[] = {
COUNTRY_CHPLAN_ENT("AD", 0x26, 1, 0x00), /* Andorra */
COUNTRY_CHPLAN_ENT("AE", 0x26, 1, 0xFB), /* United Arab Emirates */
COUNTRY_CHPLAN_ENT("AF", 0x42, 1, 0x00), /* Afghanistan */
COUNTRY_CHPLAN_ENT("AG", 0x30, 1, 0x00), /* Antigua & Barbuda */
COUNTRY_CHPLAN_ENT("AI", 0x26, 1, 0x00), /* Anguilla(UK) */
COUNTRY_CHPLAN_ENT("AL", 0x26, 1, 0xF1), /* Albania */
COUNTRY_CHPLAN_ENT("AM", 0x26, 1, 0xB0), /* Armenia */
COUNTRY_CHPLAN_ENT("AO", 0x26, 1, 0xE0), /* Angola */
COUNTRY_CHPLAN_ENT("AQ", 0x26, 1, 0x00), /* Antarctica */
COUNTRY_CHPLAN_ENT("AR", 0x57, 1, 0xF3), /* Argentina */
COUNTRY_CHPLAN_ENT("AS", 0x34, 1, 0x00), /* American Samoa */
COUNTRY_CHPLAN_ENT("AT", 0x26, 1, 0xFB), /* Austria */
COUNTRY_CHPLAN_ENT("AU", 0x45, 1, 0xFB), /* Australia */
COUNTRY_CHPLAN_ENT("AW", 0x34, 1, 0xB0), /* Aruba */
COUNTRY_CHPLAN_ENT("AZ", 0x26, 1, 0xF1), /* Azerbaijan */
COUNTRY_CHPLAN_ENT("BA", 0x26, 1, 0xF1), /* Bosnia & Herzegovina */
COUNTRY_CHPLAN_ENT("BB", 0x34, 1, 0x50), /* Barbados */
COUNTRY_CHPLAN_ENT("BD", 0x26, 1, 0xF1), /* Bangladesh */
COUNTRY_CHPLAN_ENT("BE", 0x26, 1, 0xFB), /* Belgium */
COUNTRY_CHPLAN_ENT("BF", 0x26, 1, 0xB0), /* Burkina Faso */
COUNTRY_CHPLAN_ENT("BG", 0x26, 1, 0xF1), /* Bulgaria */
COUNTRY_CHPLAN_ENT("BH", 0x47, 1, 0xF1), /* Bahrain */
COUNTRY_CHPLAN_ENT("BI", 0x26, 1, 0xB0), /* Burundi */
COUNTRY_CHPLAN_ENT("BJ", 0x26, 1, 0xB0), /* Benin */
COUNTRY_CHPLAN_ENT("BN", 0x47, 1, 0x10), /* Brunei */
COUNTRY_CHPLAN_ENT("BO", 0x30, 1, 0xF1), /* Bolivia */
COUNTRY_CHPLAN_ENT("BR", 0x34, 1, 0xF1), /* Brazil */
COUNTRY_CHPLAN_ENT("BS", 0x34, 1, 0x20), /* Bahamas */
COUNTRY_CHPLAN_ENT("BW", 0x26, 1, 0xF1), /* Botswana */
COUNTRY_CHPLAN_ENT("BY", 0x26, 1, 0xF1), /* Belarus */
COUNTRY_CHPLAN_ENT("BZ", 0x34, 1, 0x00), /* Belize */
COUNTRY_CHPLAN_ENT("CA", 0x34, 1, 0xFB), /* Canada */
COUNTRY_CHPLAN_ENT("CC", 0x26, 1, 0x00), /* Cocos (Keeling) Islands (Australia) */
COUNTRY_CHPLAN_ENT("CD", 0x26, 1, 0xB0), /* Congo, Republic of the */
COUNTRY_CHPLAN_ENT("CF", 0x26, 1, 0xB0), /* Central African Republic */
COUNTRY_CHPLAN_ENT("CG", 0x26, 1, 0xB0), /* Congo, Democratic Republic of the. Zaire */
COUNTRY_CHPLAN_ENT("CH", 0x26, 1, 0xFB), /* Switzerland */
COUNTRY_CHPLAN_ENT("CI", 0x26, 1, 0xF1), /* Cote d'Ivoire */
COUNTRY_CHPLAN_ENT("CK", 0x26, 1, 0x00), /* Cook Islands */
COUNTRY_CHPLAN_ENT("CL", 0x30, 1, 0xF1), /* Chile */
COUNTRY_CHPLAN_ENT("CM", 0x26, 1, 0xB0), /* Cameroon */
COUNTRY_CHPLAN_ENT("CN", 0x48, 1, 0xFB), /* China */
COUNTRY_CHPLAN_ENT("CO", 0x34, 1, 0xF1), /* Colombia */
COUNTRY_CHPLAN_ENT("CR", 0x34, 1, 0xF1), /* Costa Rica */
COUNTRY_CHPLAN_ENT("CV", 0x26, 1, 0xB0), /* Cape Verde */
COUNTRY_CHPLAN_ENT("CX", 0x45, 1, 0x00), /* Christmas Island (Australia) */
COUNTRY_CHPLAN_ENT("CY", 0x26, 1, 0xFB), /* Cyprus */
COUNTRY_CHPLAN_ENT("CZ", 0x26, 1, 0xFB), /* Czech Republic */
COUNTRY_CHPLAN_ENT("DE", 0x26, 1, 0xFB), /* Germany */
COUNTRY_CHPLAN_ENT("DJ", 0x26, 1, 0x80), /* Djibouti */
COUNTRY_CHPLAN_ENT("DK", 0x26, 1, 0xFB), /* Denmark */
COUNTRY_CHPLAN_ENT("DM", 0x34, 1, 0x00), /* Dominica */
COUNTRY_CHPLAN_ENT("DO", 0x34, 1, 0xF1), /* Dominican Republic */
COUNTRY_CHPLAN_ENT("DZ", 0x26, 1, 0xF1), /* Algeria */
COUNTRY_CHPLAN_ENT("EC", 0x34, 1, 0xF1), /* Ecuador */
COUNTRY_CHPLAN_ENT("EE", 0x26, 1, 0xFB), /* Estonia */
COUNTRY_CHPLAN_ENT("EG", 0x47, 0, 0xF1), /* Egypt */
COUNTRY_CHPLAN_ENT("EH", 0x47, 1, 0x80), /* Western Sahara */
COUNTRY_CHPLAN_ENT("ER", 0x26, 1, 0x00), /* Eritrea */
COUNTRY_CHPLAN_ENT("ES", 0x26, 1, 0xFB), /* Spain, Canary Islands, Ceuta, Melilla */
COUNTRY_CHPLAN_ENT("ET", 0x26, 1, 0xB0), /* Ethiopia */
COUNTRY_CHPLAN_ENT("FI", 0x26, 1, 0xFB), /* Finland */
COUNTRY_CHPLAN_ENT("FJ", 0x34, 1, 0x00), /* Fiji */
COUNTRY_CHPLAN_ENT("FK", 0x26, 1, 0x00), /* Falkland Islands (Islas Malvinas) (UK) */
COUNTRY_CHPLAN_ENT("FM", 0x34, 1, 0x00), /* Micronesia, Federated States of (USA) */
COUNTRY_CHPLAN_ENT("FO", 0x26, 1, 0x00), /* Faroe Islands (Denmark) */
COUNTRY_CHPLAN_ENT("FR", 0x26, 1, 0xFB), /* France */
COUNTRY_CHPLAN_ENT("GA", 0x26, 1, 0xB0), /* Gabon */
COUNTRY_CHPLAN_ENT("GB", 0x26, 1, 0xFB), /* Great Britain (United Kingdom; England) */
COUNTRY_CHPLAN_ENT("GD", 0x34, 1, 0xB0), /* Grenada */
COUNTRY_CHPLAN_ENT("GE", 0x26, 1, 0x00), /* Georgia */
COUNTRY_CHPLAN_ENT("GF", 0x26, 1, 0x80), /* French Guiana */
COUNTRY_CHPLAN_ENT("GG", 0x26, 1, 0x00), /* Guernsey (UK) */
COUNTRY_CHPLAN_ENT("GH", 0x26, 1, 0xF1), /* Ghana */
COUNTRY_CHPLAN_ENT("GI", 0x26, 1, 0x00), /* Gibraltar (UK) */
COUNTRY_CHPLAN_ENT("GL", 0x26, 1, 0x00), /* Greenland (Denmark) */
COUNTRY_CHPLAN_ENT("GM", 0x26, 1, 0xB0), /* Gambia */
COUNTRY_CHPLAN_ENT("GN", 0x26, 1, 0x10), /* Guinea */
COUNTRY_CHPLAN_ENT("GP", 0x26, 1, 0x00), /* Guadeloupe (France) */
COUNTRY_CHPLAN_ENT("GQ", 0x26, 1, 0xB0), /* Equatorial Guinea */
COUNTRY_CHPLAN_ENT("GR", 0x26, 1, 0xFB), /* Greece */
COUNTRY_CHPLAN_ENT("GS", 0x26, 1, 0x00), /* South Georgia and the Sandwich Islands (UK) */
COUNTRY_CHPLAN_ENT("GT", 0x34, 1, 0xF1), /* Guatemala */
COUNTRY_CHPLAN_ENT("GU", 0x34, 1, 0x00), /* Guam (USA) */
COUNTRY_CHPLAN_ENT("GW", 0x26, 1, 0xB0), /* Guinea-Bissau */
COUNTRY_CHPLAN_ENT("GY", 0x44, 1, 0x00), /* Guyana */
COUNTRY_CHPLAN_ENT("HK", 0x26, 1, 0xFB), /* Hong Kong */
COUNTRY_CHPLAN_ENT("HM", 0x45, 1, 0x00), /* Heard and McDonald Islands (Australia) */
COUNTRY_CHPLAN_ENT("HN", 0x32, 1, 0xF1), /* Honduras */
COUNTRY_CHPLAN_ENT("HR", 0x26, 1, 0xF9), /* Croatia */
COUNTRY_CHPLAN_ENT("HT", 0x34, 1, 0x50), /* Haiti */
COUNTRY_CHPLAN_ENT("HU", 0x26, 1, 0xFB), /* Hungary */
COUNTRY_CHPLAN_ENT("ID", 0x54, 0, 0xF3), /* Indonesia */
COUNTRY_CHPLAN_ENT("IE", 0x26, 1, 0xFB), /* Ireland */
COUNTRY_CHPLAN_ENT("IL", 0x47, 1, 0xF1), /* Israel */
COUNTRY_CHPLAN_ENT("IM", 0x26, 1, 0x00), /* Isle of Man (UK) */
COUNTRY_CHPLAN_ENT("IN", 0x47, 1, 0xF1), /* India */
COUNTRY_CHPLAN_ENT("IQ", 0x26, 1, 0x00), /* Iraq */
COUNTRY_CHPLAN_ENT("IR", 0x26, 0, 0x00), /* Iran */
COUNTRY_CHPLAN_ENT("IS", 0x26, 1, 0xFB), /* Iceland */
COUNTRY_CHPLAN_ENT("IT", 0x26, 1, 0xFB), /* Italy */
COUNTRY_CHPLAN_ENT("JE", 0x26, 1, 0x00), /* Jersey (UK) */
COUNTRY_CHPLAN_ENT("JM", 0x51, 1, 0xF1), /* Jamaica */
COUNTRY_CHPLAN_ENT("JO", 0x49, 1, 0xFB), /* Jordan */
COUNTRY_CHPLAN_ENT("JP", 0x27, 1, 0xFF), /* Japan- Telec */
COUNTRY_CHPLAN_ENT("KE", 0x47, 1, 0xF9), /* Kenya */
COUNTRY_CHPLAN_ENT("KG", 0x26, 1, 0xF1), /* Kyrgyzstan */
COUNTRY_CHPLAN_ENT("KH", 0x26, 1, 0xF1), /* Cambodia */
COUNTRY_CHPLAN_ENT("KI", 0x26, 1, 0x00), /* Kiribati */
COUNTRY_CHPLAN_ENT("KN", 0x34, 1, 0x00), /* Saint Kitts and Nevis */
COUNTRY_CHPLAN_ENT("KR", 0x28, 1, 0xFB), /* South Korea */
COUNTRY_CHPLAN_ENT("KW", 0x47, 1, 0xFB), /* Kuwait */
COUNTRY_CHPLAN_ENT("KY", 0x34, 1, 0x00), /* Cayman Islands (UK) */
COUNTRY_CHPLAN_ENT("KZ", 0x26, 1, 0x00), /* Kazakhstan */
COUNTRY_CHPLAN_ENT("LA", 0x26, 1, 0x00), /* Laos */
COUNTRY_CHPLAN_ENT("LB", 0x26, 1, 0xF1), /* Lebanon */
COUNTRY_CHPLAN_ENT("LC", 0x34, 1, 0x00), /* Saint Lucia */
COUNTRY_CHPLAN_ENT("LI", 0x26, 1, 0xFB), /* Liechtenstein */
COUNTRY_CHPLAN_ENT("LK", 0x26, 1, 0xF1), /* Sri Lanka */
COUNTRY_CHPLAN_ENT("LR", 0x26, 1, 0xB0), /* Liberia */
COUNTRY_CHPLAN_ENT("LS", 0x26, 1, 0xF1), /* Lesotho */
COUNTRY_CHPLAN_ENT("LT", 0x26, 1, 0xFB), /* Lithuania */
COUNTRY_CHPLAN_ENT("LU", 0x26, 1, 0xFB), /* Luxembourg */
COUNTRY_CHPLAN_ENT("LV", 0x26, 1, 0xFB), /* Latvia */
COUNTRY_CHPLAN_ENT("LY", 0x26, 1, 0x00), /* Libya */
COUNTRY_CHPLAN_ENT("MA", 0x47, 1, 0xF1), /* Morocco */
COUNTRY_CHPLAN_ENT("MC", 0x26, 1, 0xFB), /* Monaco */
COUNTRY_CHPLAN_ENT("MD", 0x26, 1, 0xF1), /* Moldova */
COUNTRY_CHPLAN_ENT("ME", 0x26, 1, 0xF1), /* Montenegro */
COUNTRY_CHPLAN_ENT("MF", 0x34, 1, 0x00), /* Saint Martin */
COUNTRY_CHPLAN_ENT("MG", 0x26, 1, 0x20), /* Madagascar */
COUNTRY_CHPLAN_ENT("MH", 0x34, 1, 0x00), /* Marshall Islands (USA) */
COUNTRY_CHPLAN_ENT("MK", 0x26, 1, 0xF1), /* Republic of Macedonia (FYROM) */
COUNTRY_CHPLAN_ENT("ML", 0x26, 1, 0xB0), /* Mali */
COUNTRY_CHPLAN_ENT("MM", 0x26, 1, 0x00), /* Burma (Myanmar) */
COUNTRY_CHPLAN_ENT("MN", 0x26, 1, 0x00), /* Mongolia */
COUNTRY_CHPLAN_ENT("MO", 0x26, 1, 0x00), /* Macau */
COUNTRY_CHPLAN_ENT("MP", 0x34, 1, 0x00), /* Northern Mariana Islands (USA) */
COUNTRY_CHPLAN_ENT("MQ", 0x26, 1, 0x40), /* Martinique (France) */
COUNTRY_CHPLAN_ENT("MR", 0x26, 1, 0xA0), /* Mauritania */
COUNTRY_CHPLAN_ENT("MS", 0x26, 1, 0x00), /* Montserrat (UK) */
COUNTRY_CHPLAN_ENT("MT", 0x26, 1, 0xFB), /* Malta */
COUNTRY_CHPLAN_ENT("MU", 0x26, 1, 0xB0), /* Mauritius */
COUNTRY_CHPLAN_ENT("MV", 0x26, 1, 0x00), /* Maldives */
COUNTRY_CHPLAN_ENT("MW", 0x26, 1, 0xB0), /* Malawi */
COUNTRY_CHPLAN_ENT("MX", 0x34, 1, 0xF1), /* Mexico */
COUNTRY_CHPLAN_ENT("MY", 0x47, 1, 0xF1), /* Malaysia */
COUNTRY_CHPLAN_ENT("MZ", 0x26, 1, 0xF1), /* Mozambique */
COUNTRY_CHPLAN_ENT("NA", 0x26, 0, 0x00), /* Namibia */
COUNTRY_CHPLAN_ENT("NC", 0x26, 1, 0x00), /* New Caledonia */
COUNTRY_CHPLAN_ENT("NE", 0x26, 1, 0xB0), /* Niger */
COUNTRY_CHPLAN_ENT("NF", 0x45, 1, 0x00), /* Norfolk Island (Australia) */
COUNTRY_CHPLAN_ENT("NG", 0x50, 1, 0xF9), /* Nigeria */
COUNTRY_CHPLAN_ENT("NI", 0x34, 1, 0xF1), /* Nicaragua */
COUNTRY_CHPLAN_ENT("NL", 0x26, 1, 0xFB), /* Netherlands */
COUNTRY_CHPLAN_ENT("NO", 0x26, 1, 0xFB), /* Norway */
COUNTRY_CHPLAN_ENT("NP", 0x47, 1, 0xF0), /* Nepal */
COUNTRY_CHPLAN_ENT("NR", 0x26, 1, 0x00), /* Nauru */
COUNTRY_CHPLAN_ENT("NU", 0x45, 1, 0x00), /* Niue */
COUNTRY_CHPLAN_ENT("NZ", 0x45, 1, 0xFB), /* New Zealand */
COUNTRY_CHPLAN_ENT("OM", 0x26, 1, 0xF9), /* Oman */
COUNTRY_CHPLAN_ENT("PA", 0x34, 1, 0xF1), /* Panama */
COUNTRY_CHPLAN_ENT("PE", 0x34, 1, 0xF1), /* Peru */
COUNTRY_CHPLAN_ENT("PF", 0x26, 1, 0x00), /* French Polynesia (France) */
COUNTRY_CHPLAN_ENT("PG", 0x26, 1, 0xF1), /* Papua New Guinea */
COUNTRY_CHPLAN_ENT("PH", 0x26, 1, 0xF1), /* Philippines */
COUNTRY_CHPLAN_ENT("PK", 0x51, 1, 0xF1), /* Pakistan */
COUNTRY_CHPLAN_ENT("PL", 0x26, 1, 0xFB), /* Poland */
COUNTRY_CHPLAN_ENT("PM", 0x26, 1, 0x00), /* Saint Pierre and Miquelon (France) */
COUNTRY_CHPLAN_ENT("PR", 0x34, 1, 0xF1), /* Puerto Rico */
COUNTRY_CHPLAN_ENT("PT", 0x26, 1, 0xFB), /* Portugal */
COUNTRY_CHPLAN_ENT("PW", 0x34, 1, 0x00), /* Palau */
COUNTRY_CHPLAN_ENT("PY", 0x34, 1, 0xF1), /* Paraguay */
COUNTRY_CHPLAN_ENT("QA", 0x51, 1, 0xF9), /* Qatar */
COUNTRY_CHPLAN_ENT("RE", 0x26, 1, 0x00), /* Reunion (France) */
COUNTRY_CHPLAN_ENT("RO", 0x26, 1, 0xF1), /* Romania */
COUNTRY_CHPLAN_ENT("RS", 0x26, 1, 0xF1), /* Serbia, Kosovo */
COUNTRY_CHPLAN_ENT("RU", 0x59, 1, 0xFB), /* Russia(fac/gost), Kaliningrad */
COUNTRY_CHPLAN_ENT("RW", 0x26, 1, 0xB0), /* Rwanda */
COUNTRY_CHPLAN_ENT("SA", 0x26, 1, 0xFB), /* Saudi Arabia */
COUNTRY_CHPLAN_ENT("SB", 0x26, 1, 0x00), /* Solomon Islands */
COUNTRY_CHPLAN_ENT("SC", 0x34, 1, 0x90), /* Seychelles */
COUNTRY_CHPLAN_ENT("SE", 0x26, 1, 0xFB), /* Sweden */
COUNTRY_CHPLAN_ENT("SG", 0x47, 1, 0xFB), /* Singapore */
COUNTRY_CHPLAN_ENT("SH", 0x26, 1, 0x00), /* Saint Helena (UK) */
COUNTRY_CHPLAN_ENT("SI", 0x26, 1, 0xFB), /* Slovenia */
COUNTRY_CHPLAN_ENT("SJ", 0x26, 1, 0x00), /* Svalbard (Norway) */
COUNTRY_CHPLAN_ENT("SK", 0x26, 1, 0xFB), /* Slovakia */
COUNTRY_CHPLAN_ENT("SL", 0x26, 1, 0xB0), /* Sierra Leone */
COUNTRY_CHPLAN_ENT("SM", 0x26, 1, 0x00), /* San Marino */
COUNTRY_CHPLAN_ENT("SN", 0x26, 1, 0xF1), /* Senegal */
COUNTRY_CHPLAN_ENT("SO", 0x26, 1, 0x00), /* Somalia */
COUNTRY_CHPLAN_ENT("SR", 0x34, 1, 0x00), /* Suriname */
COUNTRY_CHPLAN_ENT("ST", 0x34, 1, 0x80), /* Sao Tome and Principe */
COUNTRY_CHPLAN_ENT("SV", 0x30, 1, 0xF1), /* El Salvador */
COUNTRY_CHPLAN_ENT("SX", 0x34, 1, 0x00), /* Sint Marteen */
COUNTRY_CHPLAN_ENT("SZ", 0x26, 1, 0x20), /* Swaziland */
COUNTRY_CHPLAN_ENT("TC", 0x26, 1, 0x00), /* Turks and Caicos Islands (UK) */
COUNTRY_CHPLAN_ENT("TD", 0x26, 1, 0xB0), /* Chad */
COUNTRY_CHPLAN_ENT("TF", 0x26, 1, 0x80), /* French Southern and Antarctic Lands (FR Southern Territories) */
COUNTRY_CHPLAN_ENT("TG", 0x26, 1, 0xB0), /* Togo */
COUNTRY_CHPLAN_ENT("TH", 0x26, 1, 0xF1), /* Thailand */
COUNTRY_CHPLAN_ENT("TJ", 0x26, 1, 0x40), /* Tajikistan */
COUNTRY_CHPLAN_ENT("TK", 0x45, 1, 0x00), /* Tokelau */
COUNTRY_CHPLAN_ENT("TM", 0x26, 1, 0x00), /* Turkmenistan */
COUNTRY_CHPLAN_ENT("TN", 0x47, 1, 0xF1), /* Tunisia */
COUNTRY_CHPLAN_ENT("TO", 0x26, 1, 0x00), /* Tonga */
COUNTRY_CHPLAN_ENT("TR", 0x26, 1, 0xF1), /* Turkey, Northern Cyprus */
COUNTRY_CHPLAN_ENT("TT", 0x42, 1, 0xF1), /* Trinidad & Tobago */
COUNTRY_CHPLAN_ENT("TW", 0x39, 1, 0xFF), /* Taiwan */
COUNTRY_CHPLAN_ENT("TZ", 0x26, 1, 0xF0), /* Tanzania */
COUNTRY_CHPLAN_ENT("UA", 0x26, 1, 0xFB), /* Ukraine */
COUNTRY_CHPLAN_ENT("UG", 0x26, 1, 0xF1), /* Uganda */
COUNTRY_CHPLAN_ENT("US", 0x34, 1, 0xFF), /* United States of America (USA) */
COUNTRY_CHPLAN_ENT("UY", 0x34, 1, 0xF1), /* Uruguay */
COUNTRY_CHPLAN_ENT("UZ", 0x47, 1, 0xF0), /* Uzbekistan */
COUNTRY_CHPLAN_ENT("VA", 0x26, 1, 0x00), /* Holy See (Vatican City) */
COUNTRY_CHPLAN_ENT("VC", 0x34, 1, 0x10), /* Saint Vincent and the Grenadines */
COUNTRY_CHPLAN_ENT("VE", 0x30, 1, 0xF1), /* Venezuela */
COUNTRY_CHPLAN_ENT("VI", 0x34, 1, 0x00), /* United States Virgin Islands (USA) */
COUNTRY_CHPLAN_ENT("VN", 0x26, 1, 0xF1), /* Vietnam */
COUNTRY_CHPLAN_ENT("VU", 0x26, 1, 0x00), /* Vanuatu */
COUNTRY_CHPLAN_ENT("WF", 0x26, 1, 0x00), /* Wallis and Futuna (France) */
COUNTRY_CHPLAN_ENT("WS", 0x34, 1, 0x00), /* Samoa */
COUNTRY_CHPLAN_ENT("YE", 0x26, 1, 0x40), /* Yemen */
COUNTRY_CHPLAN_ENT("YT", 0x26, 1, 0x80), /* Mayotte (France) */
COUNTRY_CHPLAN_ENT("ZA", 0x26, 1, 0xF1), /* South Africa */
COUNTRY_CHPLAN_ENT("ZM", 0x26, 1, 0xB0), /* Zambia */
COUNTRY_CHPLAN_ENT("ZW", 0x26, 1, 0xF1), /* Zimbabwe */
};
u16 const country_chplan_map_sz = sizeof(country_chplan_map)/sizeof(struct country_chplan);
/*
* rtw_get_chplan_from_country -
* @country_code: string of country code
*
* Return pointer of struct country_chplan entry or NULL when unsupported country_code is given
*/
const struct country_chplan *rtw_get_chplan_from_country(const char *country_code)
{
const struct country_chplan *ent = NULL;
const struct country_chplan *map = NULL;
u16 map_sz = 0;
char code[2];
int i;
code[0] = alpha_to_upper(country_code[0]);
code[1] = alpha_to_upper(country_code[1]);
#if !defined(CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP) && RTW_DEF_MODULE_REGULATORY_CERT
ent = rtw_def_module_get_chplan_from_country(code);
if (ent != NULL)
goto exit;
#endif
#ifdef CONFIG_CUSTOMIZED_COUNTRY_CHPLAN_MAP
map = CUSTOMIZED_country_chplan_map;
map_sz = CUSTOMIZED_country_chplan_map_sz;
#else
map = country_chplan_map;
map_sz = country_chplan_map_sz;
#endif
for (i = 0; i < map_sz; i++) {
if (strncmp(code, map[i].alpha2, 2) == 0) {
ent = &map[i];
break;
}
}
exit:
#if RTW_DEF_MODULE_REGULATORY_CERT
if (ent && !(COUNTRY_CHPLAN_DEF_MODULE_FALGS(ent) & RTW_DEF_MODULE_REGULATORY_CERT))
ent = NULL;
#endif
return ent;
}
int rtw_ch_to_bb_gain_sel(int ch)
{
int sel = -1;
if (ch >= 1 && ch <= 14)
sel = BB_GAIN_2G;
#ifdef CONFIG_IEEE80211_BAND_5GHZ
else if (ch >= 36 && ch < 48)
sel = BB_GAIN_5GLB1;
else if (ch >= 52 && ch <= 64)
sel = BB_GAIN_5GLB2;
else if (ch >= 100 && ch <= 120)
sel = BB_GAIN_5GMB1;
else if (ch >= 124 && ch <= 144)
sel = BB_GAIN_5GMB2;
else if (ch >= 149 && ch <= 177)
sel = BB_GAIN_5GHB;
#endif
return sel;
}
s8 rtw_rf_get_kfree_tx_gain_offset(_adapter *padapter, u8 path, u8 ch)
{
s8 kfree_offset = 0;
#ifdef CONFIG_RF_GAIN_OFFSET
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(padapter);
struct kfree_data_t *kfree_data = GET_KFREE_DATA(padapter);
s8 bb_gain_sel = rtw_ch_to_bb_gain_sel(ch);
if (bb_gain_sel < BB_GAIN_2G || bb_gain_sel >= BB_GAIN_NUM) {
rtw_warn_on(1);
goto exit;
}
if (kfree_data->flag & KFREE_FLAG_ON) {
kfree_offset = kfree_data->bb_gain[bb_gain_sel][path];
if (1)
DBG_871X("%s path:%u, ch:%u, bb_gain_sel:%d, kfree_offset:%d\n"
, __func__, path, ch, bb_gain_sel, kfree_offset);
}
exit:
#endif /* CONFIG_RF_GAIN_OFFSET */
return kfree_offset;
}
void rtw_rf_set_tx_gain_offset(_adapter *adapter, u8 path, s8 offset)
{
u8 write_value;
DBG_871X("kfree gain_offset 0x55:0x%x ", rtw_hal_read_rfreg(adapter, path, 0x55, 0xffffffff));
switch (rtw_get_chip_type(adapter)) {
#ifdef CONFIG_RTL8703B
case RTL8703B:
write_value = RF_TX_GAIN_OFFSET_8703B(offset);
rtw_hal_write_rfreg(adapter, path, 0x55, 0x0fc000, write_value);
break;
#endif /* CONFIG_RTL8703B */
#ifdef CONFIG_RTL8188F
case RTL8188F:
write_value = RF_TX_GAIN_OFFSET_8188F(offset);
rtw_hal_write_rfreg(adapter, path, 0x55, 0x0fc000, write_value);
break;
#endif /* CONFIG_RTL8188F */
#ifdef CONFIG_RTL8192E
case RTL8192E:
write_value = RF_TX_GAIN_OFFSET_8192E(offset);
rtw_hal_write_rfreg(adapter, path, 0x55, 0x0f8000, write_value);
break;
#endif /* CONFIG_RTL8188F */
#ifdef CONFIG_RTL8821A
case RTL8821:
write_value = RF_TX_GAIN_OFFSET_8821A(offset);
rtw_hal_write_rfreg(adapter, path, 0x55, 0x0f8000, write_value);
break;
#endif /* CONFIG_RTL8821A */
#ifdef CONFIG_RTL8814A
case RTL8814A:
DBG_871X("\nkfree by PhyDM on the sw CH. path %d\n", path);
break;
#endif /* CONFIG_RTL8821A */
default:
rtw_warn_on(1);
break;
}
DBG_871X(" after :0x%x\n", rtw_hal_read_rfreg(adapter, path, 0x55, 0xffffffff));
}
void rtw_rf_apply_tx_gain_offset(_adapter *adapter, u8 ch)
{
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
s8 kfree_offset = 0;
s8 tx_pwr_track_offset = 0; /* TODO: 8814A should consider tx pwr track when setting tx gain offset */
s8 total_offset;
int i;
for (i = 0; i < hal_data->NumTotalRFPath; i++) {
kfree_offset = rtw_rf_get_kfree_tx_gain_offset(adapter, i, ch);
total_offset = kfree_offset + tx_pwr_track_offset;
rtw_rf_set_tx_gain_offset(adapter, i, total_offset);
}
}
bool rtw_is_dfs_range(u32 hi, u32 lo)
{
return rtw_is_range_overlap(hi, lo, 5720 + 10, 5260 - 10)?_TRUE:_FALSE;
}
bool rtw_is_dfs_ch(u8 ch, u8 bw, u8 offset)
{
u32 hi, lo;
if (rtw_chbw_to_freq_range(ch, bw, offset, &hi, &lo) == _FALSE)
return _FALSE;
return rtw_is_dfs_range(hi, lo)?_TRUE:_FALSE;
}
bool rtw_is_long_cac_range(u32 hi, u32 lo)
{
return rtw_is_range_overlap(hi, lo, 5660 + 10, 5600 - 10)?_TRUE:_FALSE;
}
bool rtw_is_long_cac_ch(u8 ch, u8 bw, u8 offset)
{
u32 hi, lo;
if (rtw_chbw_to_freq_range(ch, bw, offset, &hi, &lo) == _FALSE)
return _FALSE;
return rtw_is_long_cac_range(hi, lo)?_TRUE:_FALSE;
}

View File

@ -2214,8 +2214,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *precvframe)
_rtw_memcpy(&temp_ipn, p+4, 6);
temp_ipn = le64_to_cpu(temp_ipn);
//BIP packet number should bigger than previous BIP packet
if(temp_ipn <= pmlmeext->mgnt_80211w_IPN_rx)
{
if (temp_ipn < pmlmeext->mgnt_80211w_IPN_rx) {
DBG_871X("replay BIP packet\n");
goto BIP_exit;
}
@ -3223,8 +3222,10 @@ _func_enter_;
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler ^^^\n"));
/*
if(padapter->bDriverStopped ||padapter->bSurpriseRemoved){
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler (padapter->bDriverStopped %d)(padapter->bSurpriseRemoved %d)^^^\n",padapter->bDriverStopped,padapter->bSurpriseRemoved));
if (RTW_CANNOT_RUN(padapter)) {
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler (padapter->bDriverStopped %s)(padapter->bSurpriseRemoved %s)^^^\n"
, rtw_is_drv_stopped(padapter)?"True":"False"
, rtw_is_surprise_removed(padapter)?"True":"False"));
return;
}
@ -3278,3 +3279,68 @@ u8 rtw_handle_tkip_countermeasure(_adapter* adapter, const char *caller)
return status;
}
#ifdef CONFIG_WOWLAN
u16 rtw_cal_crc16(u8 data, u16 crc)
{
u8 shift_in, data_bit;
u8 crc_bit4, crc_bit11, crc_bit15;
u16 crc_result;
int index;
for (index = 0; index < 8; index++) {
crc_bit15 = ((crc & BIT15) ? 1 : 0);
data_bit = (data & (BIT0 << index) ? 1 : 0);
shift_in = crc_bit15 ^ data_bit;
/*printf("crc_bit15=%d, DataBit=%d, shift_in=%d\n",
* crc_bit15, data_bit, shift_in);*/
crc_result = crc << 1;
if (shift_in == 0)
crc_result &= (~BIT0);
else
crc_result |= BIT0;
/*printf("CRC =%x\n",CRC_Result);*/
crc_bit11 = ((crc & BIT11) ? 1 : 0) ^ shift_in;
if (crc_bit11 == 0)
crc_result &= (~BIT12);
else
crc_result |= BIT12;
/*printf("bit12 CRC =%x\n",CRC_Result);*/
crc_bit4 = ((crc & BIT4) ? 1 : 0) ^ shift_in;
if (crc_bit4 == 0)
crc_result &= (~BIT5);
else
crc_result |= BIT5;
/* printf("bit5 CRC =%x\n",CRC_Result); */
/* repeat using the last result*/
crc = crc_result;
}
return crc;
}
/*
* function name :rtw_calc_crc
*
* input: char* pattern , pattern size
*
*/
u16 rtw_calc_crc(u8 *pdata, int length)
{
u16 crc = 0xffff;
int i;
for (i = 0; i < length; i++)
crc = rtw_cal_crc16(pdata[i], crc);
/* get 1' complement */
crc = ~crc;
return crc;
}
#endif /*CONFIG_WOWLAN*/

View File

@ -174,6 +174,7 @@ void sreset_restore_network_station(_adapter *padapter)
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 doiqk = _FALSE;
#if 0
{
@ -214,12 +215,15 @@ void sreset_restore_network_station(_adapter *padapter)
#endif
}
rtw_hal_set_hwreg(padapter, HW_VAR_DO_IQK, NULL);
doiqk = _TRUE;
rtw_hal_set_hwreg(padapter, HW_VAR_DO_IQK , &doiqk);
set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
doiqk = _FALSE;
rtw_hal_set_hwreg(padapter , HW_VAR_DO_IQK , &doiqk);
//disable dynamic functions, such as high power, DIG
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
/*rtw_phydm_func_disable_all(padapter);*/
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress);
@ -232,7 +236,7 @@ void sreset_restore_network_station(_adapter *padapter)
mlmeext_joinbss_event_callback(padapter, 1);
//restore Sequence No.
rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn);
rtw_hal_set_hwreg(padapter, HW_VAR_RESTORE_HW_SEQ, 0);
sreset_restore_security_station(padapter);
}

View File

@ -28,6 +28,140 @@
#endif
bool test_st_match_rule(_adapter *adapter, u8 *local_naddr, u8 *local_port, u8 *remote_naddr, u8 *remote_port)
{
if (ntohs(*((u16 *)local_port)) == 5001 || ntohs(*((u16 *)remote_port)) == 5001)
return _TRUE;
return _FALSE;
}
struct st_register test_st_reg = {
.s_proto = 0x06,
.rule = test_st_match_rule,
};
inline void rtw_st_ctl_init(struct st_ctl_t *st_ctl)
{
_rtw_memset(st_ctl->reg, 0 , sizeof(struct st_register) * SESSION_TRACKER_REG_ID_NUM);
_rtw_init_queue(&st_ctl->tracker_q);
}
inline void rtw_st_ctl_clear_tracker_q(struct st_ctl_t *st_ctl)
{
_irqL irqL;
_list *plist, *phead;
struct session_tracker *st;
_enter_critical_bh(&st_ctl->tracker_q.lock, &irqL);
phead = &st_ctl->tracker_q.queue;
plist = get_next(phead);
while (rtw_end_of_queue_search(phead, plist) == _FALSE) {
st = LIST_CONTAINOR(plist, struct session_tracker, list);
plist = get_next(plist);
rtw_list_delete(&st->list);
rtw_mfree((u8 *)st, sizeof(struct session_tracker));
}
_exit_critical_bh(&st_ctl->tracker_q.lock, &irqL);
}
inline void rtw_st_ctl_deinit(struct st_ctl_t *st_ctl)
{
rtw_st_ctl_clear_tracker_q(st_ctl);
_rtw_deinit_queue(&st_ctl->tracker_q);
}
inline void rtw_st_ctl_register(struct st_ctl_t *st_ctl, u8 st_reg_id, struct st_register *reg)
{
if (st_reg_id >= SESSION_TRACKER_REG_ID_NUM) {
rtw_warn_on(1);
return;
}
st_ctl->reg[st_reg_id].s_proto = reg->s_proto;
st_ctl->reg[st_reg_id].rule = reg->rule;
}
inline void rtw_st_ctl_unregister(struct st_ctl_t *st_ctl, u8 st_reg_id)
{
int i;
if (st_reg_id >= SESSION_TRACKER_REG_ID_NUM) {
rtw_warn_on(1);
return;
}
st_ctl->reg[st_reg_id].s_proto = 0;
st_ctl->reg[st_reg_id].rule = NULL;
/* clear tracker queue if no session trecker registered */
for (i = 0; i < SESSION_TRACKER_REG_ID_NUM; i++)
if (st_ctl->reg[i].s_proto != 0)
break;
if (i >= SESSION_TRACKER_REG_ID_NUM)
rtw_st_ctl_clear_tracker_q(st_ctl);
}
inline bool rtw_st_ctl_chk_reg_s_proto(struct st_ctl_t *st_ctl, u8 s_proto)
{
bool ret = _FALSE;
int i;
for (i = 0; i < SESSION_TRACKER_REG_ID_NUM; i++) {
if (st_ctl->reg[i].s_proto == s_proto) {
ret = _TRUE;
break;
}
}
return ret;
}
inline bool rtw_st_ctl_chk_reg_rule(struct st_ctl_t *st_ctl, _adapter *adapter, u8 *local_naddr, u8 *local_port, u8 *remote_naddr, u8 *remote_port)
{
bool ret = _FALSE;
int i;
st_match_rule rule;
for (i = 0; i < SESSION_TRACKER_REG_ID_NUM; i++) {
rule = st_ctl->reg[i].rule;
if (rule && rule(adapter, local_naddr, local_port, remote_naddr, remote_port) == _TRUE) {
ret = _TRUE;
break;
}
}
return ret;
}
#define SESSION_TRACKER_FMT IP_FMT":"PORT_FMT" "IP_FMT":"PORT_FMT" %u %d"
#define SESSION_TRACKER_ARG(st) IP_ARG(&(st)->local_naddr), PORT_ARG(&(st)->local_port), IP_ARG(&(st)->remote_naddr), PORT_ARG(&(st)->remote_port), (st)->status, rtw_get_passing_time_ms((st)->set_time)
void dump_st_ctl(void *sel, struct st_ctl_t *st_ctl)
{
int i;
_irqL irqL;
_list *plist, *phead;
struct session_tracker *st;
if (!DBG_SESSION_TRACKER)
return;
for (i = 0; i < SESSION_TRACKER_REG_ID_NUM; i++)
DBG_871X_SEL_NL(sel, "reg%d: %u %p\n", i, st_ctl->reg[i].s_proto, st_ctl->reg[i].rule);
_enter_critical_bh(&st_ctl->tracker_q.lock, &irqL);
phead = &st_ctl->tracker_q.queue;
plist = get_next(phead);
while (rtw_end_of_queue_search(phead, plist) == _FALSE) {
st = LIST_CONTAINOR(plist, struct session_tracker, list);
plist = get_next(plist);
DBG_871X_SEL_NL(sel, SESSION_TRACKER_FMT"\n", SESSION_TRACKER_ARG(st));
}
_exit_critical_bh(&st_ctl->tracker_q.lock, &irqL);
}
void _rtw_init_stainfo(struct sta_info *psta);
void _rtw_init_stainfo(struct sta_info *psta)
{
@ -71,6 +205,7 @@ _func_enter_;
psta->no_ht_gf_set = 0;
psta->no_ht_set = 0;
psta->ht_20mhz_set = 0;
psta->ht_40mhz_intolerant = 0;
#endif
#ifdef CONFIG_TX_MCAST2UNI
@ -80,7 +215,9 @@ _func_enter_;
psta->keep_alive_trycnt = 0;
#endif // CONFIG_AP_MODE
rtw_st_ctl_init(&psta->st_ctl);
_func_exit_;
}
@ -123,7 +260,7 @@ _func_enter_;
psta++;
}
pstapriv->adhoc_expire_to = 4; /* 4 * 2 = 8 sec */
#ifdef CONFIG_AP_MODE
@ -317,7 +454,7 @@ _func_exit_;
//struct sta_info *rtw_alloc_stainfo(_queue *pfree_sta_queue, unsigned char *hwaddr)
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr)
{
_irqL irqL, irqL2;
uint tmp_aid;
@ -390,7 +527,9 @@ _func_enter_;
pstapriv->asoc_sta_count , hwaddr[0], hwaddr[1], hwaddr[2],hwaddr[3],hwaddr[4],hwaddr[5]));
init_addba_retry_timer(pstapriv->padapter, psta);
#ifdef CONFIG_IEEE80211W
init_dot11w_expire_timer(pstapriv->padapter, psta);
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_TDLS
rtw_init_tdls_timer(pstapriv->padapter, psta);
#endif //CONFIG_TDLS
@ -428,6 +567,7 @@ _func_enter_;
#endif
/* init for the sequence number of received management frame */
psta->RxMgmtFrameSeqNum = 0xffff;
psta->ra_rpt_linked = _FALSE;
//alloc mac id for non-bc/mc station,
rtw_alloc_macid(pstapriv->padapter, psta);
@ -537,7 +677,9 @@ _func_enter_;
// re-init sta_info; 20061114 // will be init in alloc_stainfo
//_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
//_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
#ifdef CONFIG_IEEE80211W
_cancel_timer_ex(&psta->dot11w_expire_timer);
#endif /* CONFIG_IEEE80211W */
_cancel_timer_ex(&psta->addba_retry_timer);
#ifdef CONFIG_TDLS
@ -638,6 +780,8 @@ _func_enter_;
#endif // CONFIG_AP_MODE
rtw_st_ctl_deinit(&psta->st_ctl);
_rtw_spinlock_free(&psta->lock);
//_enter_critical_bh(&(pfree_sta_queue->lock), &irqL0);
@ -714,7 +858,7 @@ _func_exit_;
}
/* any station allocated can be searched by hash list */
struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr)
{
_irqL irqL;
@ -725,16 +869,16 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
u32 index;
u8 *addr;
const u8 *addr;
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
const u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
_func_enter_;
if(hwaddr==NULL)
return NULL;
if(IS_MCAST(hwaddr))
if(IS_MCAST((unsigned char *)hwaddr))
{
addr = bc_addr;
}
@ -790,7 +934,10 @@ _func_enter_;
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("rtw_alloc_stainfo fail"));
goto exit;
}
#ifdef CONFIG_BEAMFORMING
psta->txbf_gid = 63;
psta->txbf_paid = 0;
#endif
ptxservq= &(psta->sta_xmitpriv.be_q);
/*

File diff suppressed because it is too large Load Diff

View File

@ -38,10 +38,10 @@ const u16 VHT_MCS_DATA_RATE[3][2][30] =
90, 180, 270, 360, 540, 720, 810, 900, 1080, 1200}}, // Short GI, 40MHz
{ {59, 117, 176, 234, 351, 468, 527, 585, 702, 780,
117, 234, 351, 468, 702, 936, 1053, 1170, 1404, 1560,
176, 351, 527, 702, 1053, 1404, 1580, 1755, 2106, 2106}, // Long GI, 80MHz
176, 351, 527, 702, 1053, 1404, 1580, 1755, 2106, 2340}, /* Long GI, 80MHz */
{65, 130, 195, 260, 390, 520, 585, 650, 780, 867,
130, 260, 390, 520, 780, 1040, 1170, 1300, 1560,1734,
195, 390, 585, 780, 1170, 1560, 1755, 1950, 2340, 2340} } // Short GI, 80MHz
195, 390, 585, 780, 1170, 1560, 1755, 1950, 2340, 2600} } /* Short GI, 80MHz */
};
u8 rtw_get_vht_highest_rate(u8 *pvht_mcs_map)
@ -88,7 +88,7 @@ u8 rtw_vht_mcsmap_to_nss(u8 *pvht_mcs_map)
}
}
DBG_871X("%s : %dSS\n", __FUNCTION__, nss);
/* DBG_871X("%s : %dSS\n", __FUNCTION__, nss); */
return nss;
}
@ -133,7 +133,8 @@ void rtw_vht_use_default_setting(_adapter *padapter)
BOOLEAN bHwLDPCSupport = _FALSE, bHwSTBCSupport = _FALSE;
BOOLEAN bHwSupportBeamformer = _FALSE, bHwSupportBeamformee = _FALSE;
u8 rf_type = 0;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
pvhtpriv->sgi_80m = TEST_FLAG(pregistrypriv->short_gi, BIT2) ? _TRUE : _FALSE;
// LDPC support
@ -174,10 +175,17 @@ void rtw_vht_use_default_setting(_adapter *padapter)
rtw_hal_get_def_var(padapter, HAL_DEF_EXPLICIT_BEAMFORMER, (u8 *)&bHwSupportBeamformer);
rtw_hal_get_def_var(padapter, HAL_DEF_EXPLICIT_BEAMFORMEE, (u8 *)&bHwSupportBeamformee);
CLEAR_FLAGS(pvhtpriv->beamform_cap);
if(TEST_FLAG(pregistrypriv->beamform_cap, BIT0) && bHwSupportBeamformer)
{
SET_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE);
DBG_871X("[VHT] Support Beamformer\n");
if (TEST_FLAG(pregistrypriv->beamform_cap, BIT0) && bHwSupportBeamformer) {
#ifdef CONFIG_CONCURRENT_MODE
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
SET_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE);
DBG_871X("[VHT] CONCURRENT AP Support Beamformer\n");
} else
DBG_871X("[VHT] CONCURRENT not AP ;not allow Support Beamformer\n");
#else
SET_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE);
DBG_871X("[VHT] Support Beamformer\n");
#endif
}
if(TEST_FLAG(pregistrypriv->beamform_cap, BIT1) && bHwSupportBeamformee)
{
@ -265,7 +273,7 @@ u64 rtw_vht_rate_to_bitmap(u8 *pVHTRate)
break;
}
}
DBG_871X("RateBitmap=%016llx , pVHTRate[0]=%02x\n", RateBitmap, pVHTRate[0]);
DBG_871X("RateBitmap=%016llx , pVHTRate[0]=%02x, pVHTRate[1]=%02x\n", RateBitmap, pVHTRate[0], pVHTRate[1]);
return RateBitmap;
}
@ -277,7 +285,8 @@ void update_sta_vht_info_apmode(_adapter *padapter, PVOID sta)
struct vht_priv *pvhtpriv_ap = &pmlmepriv->vhtpriv;
struct vht_priv *pvhtpriv_sta = &psta->vhtpriv;
struct ht_priv *phtpriv_sta = &psta->htpriv;
u8 cur_ldpc_cap=0, cur_stbc_cap=0, cur_beamform_cap=0, bw_mode = 0;
u8 cur_ldpc_cap = 0, cur_stbc_cap = 0, bw_mode = 0;
u16 cur_beamform_cap = 0;
u8 *pcap_mcs;
if (pvhtpriv_sta->vht_option == _FALSE) {
@ -320,11 +329,14 @@ void update_sta_vht_info_apmode(_adapter *padapter, PVOID sta)
}
pvhtpriv_sta->stbc_cap = cur_stbc_cap;
#ifdef CONFIG_BEAMFORMING
// B11 SU Beamformer Capable, the target supports Beamformer and we are Beamformee
if (TEST_FLAG(pvhtpriv_ap->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE) &&
GET_VHT_CAPABILITY_ELE_SU_BFEE(pvhtpriv_sta->vht_cap))
{
SET_FLAG(cur_beamform_cap, BEAMFORMING_VHT_BEAMFORMEE_ENABLE);
/*Shift to BEAMFORMING_VHT_BEAMFORMER_STS_CAP*/
SET_FLAG(cur_beamform_cap, GET_VHT_CAPABILITY_ELE_SU_BFEE_STS_CAP(pvhtpriv_sta->vht_cap)<<8);
}
// B12 SU Beamformee Capable, the target supports Beamformee and we are Beamformer
@ -332,11 +344,14 @@ void update_sta_vht_info_apmode(_adapter *padapter, PVOID sta)
GET_VHT_CAPABILITY_ELE_SU_BFER(pvhtpriv_sta->vht_cap))
{
SET_FLAG(cur_beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE);
/*Shit to BEAMFORMING_VHT_BEAMFORMEE_SOUND_DIM*/
SET_FLAG(cur_beamform_cap, GET_VHT_CAPABILITY_ELE_SU_BFER_SOUND_DIM_NUM(pvhtpriv_sta->vht_cap)<<12);
}
pvhtpriv_sta->beamform_cap = cur_beamform_cap;
if (cur_beamform_cap) {
DBG_871X("Current STA(%d) VHT Beamforming Setting = %02X\n", psta->aid, cur_beamform_cap);
}
#endif
// B23 B24 B25 Maximum A-MPDU Length Exponent
pvhtpriv_sta->ampdu_len = GET_VHT_CAPABILITY_ELE_MAX_RXAMPDU_FACTOR(pvhtpriv_sta->vht_cap);
@ -368,7 +383,8 @@ void VHT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
u8 cur_ldpc_cap=0, cur_stbc_cap=0, cur_beamform_cap=0, rf_type = RF_1T1R;
u8 cur_ldpc_cap = 0, cur_stbc_cap = 0, rf_type = RF_1T1R;
u16 cur_beamform_cap = 0;
u8 *pcap_mcs;
u8 vht_mcs[2];
@ -399,12 +415,14 @@ void VHT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
DBG_871X("Current VHT STBC Setting = %02X\n", cur_stbc_cap);
}
pvhtpriv->stbc_cap = cur_stbc_cap;
#ifdef CONFIG_BEAMFORMING
// B11 SU Beamformer Capable, the target supports Beamformer and we are Beamformee
if (TEST_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE) &&
GET_VHT_CAPABILITY_ELE_SU_BFEE(pIE->data))
{
SET_FLAG(cur_beamform_cap, BEAMFORMING_VHT_BEAMFORMEE_ENABLE);
/*Shift to BEAMFORMING_VHT_BEAMFORMER_STS_CAP*/
SET_FLAG(cur_beamform_cap, GET_VHT_CAPABILITY_ELE_SU_BFEE_STS_CAP(pIE->data)<<8);
}
// B12 SU Beamformee Capable, the target supports Beamformee and we are Beamformer
@ -412,12 +430,15 @@ void VHT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
GET_VHT_CAPABILITY_ELE_SU_BFER(pIE->data))
{
SET_FLAG(cur_beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE);
/*Shit to BEAMFORMING_VHT_BEAMFORMEE_SOUND_DIM*/
SET_FLAG(cur_beamform_cap, GET_VHT_CAPABILITY_ELE_SU_BFER_SOUND_DIM_NUM(pIE->data)<<12);
}
pvhtpriv->beamform_cap = cur_beamform_cap;
if (cur_beamform_cap) {
DBG_871X("Current VHT Beamforming Setting = %02X\n", cur_beamform_cap);
}
#endif
// B23 B24 B25 Maximum A-MPDU Length Exponent
pvhtpriv->ampdu_len = GET_VHT_CAPABILITY_ELE_MAX_RXAMPDU_FACTOR(pIE->data);
@ -453,6 +474,7 @@ void rtw_process_vht_op_mode_notify(_adapter *padapter, u8 *pframe, PVOID sta)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct registry_priv *regsty = adapter_to_regsty(padapter);
u8 target_bw;
u8 target_rxss, current_rxss;
u8 update_ra = _FALSE;
@ -465,7 +487,9 @@ void rtw_process_vht_op_mode_notify(_adapter *padapter, u8 *pframe, PVOID sta)
target_rxss = (GET_VHT_OPERATING_MODE_FIELD_RX_NSS(pframe)+1);
if (target_bw != psta->bw_mode) {
if (target_bw <= (padapter->registrypriv.bw_mode >> 4)) {
if (hal_is_bw_support(padapter, target_bw)
&& REGSTY_IS_BW_5G_SUPPORT(regsty, target_bw)
) {
update_ra = _TRUE;
psta->bw_mode = target_bw;
}
@ -492,21 +516,22 @@ u32 rtw_build_vht_operation_ie(_adapter *padapter, u8 *pbuf, u8 channel)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
//struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
u8 ChnlWidth, center_freq, bw_mode;
u8 ChnlWidth, center_freq, bw_mode, rf_type = 0;
u32 len = 0;
u8 operation[5];
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
_rtw_memset(operation, 0, 5);
bw_mode = pregistrypriv->bw_mode >> 4;
bw_mode = REGSTY_BW_5G(pregistrypriv); /* TODO: control op bw with other info */
if (bw_mode >= CHANNEL_WIDTH_80)
{
if (hal_chk_bw_cap(padapter, BW_CAP_80M | BW_CAP_160M)
&& REGSTY_BW_5G(pregistrypriv) >= CHANNEL_WIDTH_80
) {
center_freq = rtw_get_center_ch(channel, bw_mode, HAL_PRIME_CHNL_OFFSET_LOWER);
ChnlWidth = 1;
}
else
{
} else {
center_freq = 0;
ChnlWidth = 0;
}
@ -516,8 +541,35 @@ u32 rtw_build_vht_operation_ie(_adapter *padapter, u8 *pbuf, u8 channel)
//center frequency
SET_VHT_OPERATION_ELE_CHL_CENTER_FREQ1(operation, center_freq);//Todo: need to set correct center channel
SET_VHT_OPERATION_ELE_CHL_CENTER_FREQ2(operation,0);
operation[3] = 0xff;
if (padapter->registrypriv.rf_config != RF_MAX_TYPE)
rf_type = padapter->registrypriv.rf_config;
switch (rf_type) {
case RF_1T1R:
operation[3] = 0xfe;
operation[4] = 0xff;
break;
case RF_1T2R:
case RF_2T2R:
case RF_2T2R_GREEN:
operation[3] = 0xfa;
operation[4] = 0xff;
break;
case RF_2T3R:
case RF_2T4R:
case RF_3T3R:
case RF_3T4R:
operation[3] = 0xea;
operation[4] = 0xff;
break;
case RF_4T4R:
operation[3] = 0xaa;
operation[4] = 0xff;
break;
default:
DBG_871X("%s, %d, unknown rf type\n", __func__, __LINE__);
}
rtw_set_ie(pbuf, EID_VHTOperation, 5, operation, &len);
@ -556,7 +608,7 @@ u32 rtw_build_vht_op_mode_notify_ie(_adapter *padapter, u8 *pbuf, u8 bw)
u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
{
u8 bw, rf_type;
u8 bw, rf_type, rf_num, rx_stbc_nss = 0;
u16 HighestRate;
u8 *pcap, *pcap_mcs;
u32 len = 0;
@ -570,8 +622,15 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
/* B0 B1 Maximum MPDU Length */
SET_VHT_CAPABILITY_ELE_MAX_MPDU_LENGTH(pcap, 2);
// B2 B3 Supported Channel Width Set
SET_VHT_CAPABILITY_ELE_CHL_WIDTH(pcap, 0); //indicate we don't support neither 160M nor 80+80M bandwidth.
/* B2 B3 Supported Channel Width Set */
if (hal_chk_bw_cap(padapter, BW_CAP_160M) && REGSTY_IS_BW_5G_SUPPORT(pregistrypriv, CHANNEL_WIDTH_160)) {
if (hal_chk_bw_cap(padapter, BW_CAP_80_80M) && REGSTY_IS_BW_5G_SUPPORT(pregistrypriv, CHANNEL_WIDTH_80_80))
SET_VHT_CAPABILITY_ELE_CHL_WIDTH(pcap, 2);
else
SET_VHT_CAPABILITY_ELE_CHL_WIDTH(pcap, 1);
} else {
SET_VHT_CAPABILITY_ELE_CHL_WIDTH(pcap, 0);
}
// B4 Rx LDPC
if(TEST_FLAG(pvhtpriv->ldpc_cap, LDPC_VHT_ENABLE_RX))
@ -594,29 +653,25 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
// B8 B9 B10 Rx STBC
if(TEST_FLAG(pvhtpriv->stbc_cap, STBC_VHT_ENABLE_RX))
{
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
if ((rf_type == RF_2T2R) || (rf_type == RF_1T2R)) {
SET_VHT_CAPABILITY_ELE_RX_STBC(pcap, 2);
}
else if (rf_type == RF_1T1R) {
SET_VHT_CAPABILITY_ELE_RX_STBC(pcap, 1);
}
rtw_hal_get_def_var(padapter, HAL_DEF_RX_STBC, (u8 *)(&rx_stbc_nss));
SET_VHT_CAPABILITY_ELE_RX_STBC(pcap, rx_stbc_nss);
}
// B11 SU Beamformer Capable
if(TEST_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE))
{
if (TEST_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE)) {
SET_VHT_CAPABILITY_ELE_SU_BFER(pcap, 1);
// B16 17 18 Number of Sounding Dimensions
SET_VHT_CAPABILITY_ELE_SOUNDING_DIMENSIONS(pcap, 1);
rtw_hal_get_def_var(padapter, HAL_DEF_BEAMFORMER_CAP, (u8 *)&rf_num);
SET_VHT_CAPABILITY_ELE_SOUNDING_DIMENSIONS(pcap, rf_num);
}
// B12 SU Beamformee Capable
if(TEST_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMEE_ENABLE))
{
if (TEST_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMEE_ENABLE)) {
SET_VHT_CAPABILITY_ELE_SU_BFEE(pcap, 1);
// B13 14 15 Compressed Steering Number of Beamformer Antennas Supported
SET_VHT_CAPABILITY_ELE_BFER_ANT_SUPP(pcap, 1);
rtw_hal_get_def_var(padapter, HAL_DEF_BEAMFORMEE_CAP, (u8 *)&rf_num);
SET_VHT_CAPABILITY_ELE_BFER_ANT_SUPP(pcap, rf_num);
}
// B19 MU Beamformer Capable
@ -645,9 +700,11 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
pcap_mcs = GET_VHT_CAPABILITY_ELE_TX_MCS(pcap);
_rtw_memcpy(pcap_mcs, pvhtpriv->vht_mcs_map, 2);
bw = (pregistrypriv->bw_mode >> 4);
/* 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)];
HighestRate = (HighestRate+1) >> 1;
HighestRate = (HighestRate+1) >> 1;
SET_VHT_CAPABILITY_ELE_MCS_RX_HIGHEST_RATE(pcap, HighestRate); //indicate we support highest rx rate is 600Mbps.
SET_VHT_CAPABILITY_ELE_MCS_TX_HIGHEST_RATE(pcap, HighestRate); //indicate we support highest tx rate is 600Mbps.
@ -701,7 +758,8 @@ u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_le
pframe = rtw_set_ie(out_ie+out_len, EID_VHTOperation, ielen, p+2 , pout_len);
}
notify_bw = pregistrypriv->bw_mode >> 4;
/* find the largest bw supported by both registry and hal */
notify_bw = hal_largest_bw(padapter, REGSTY_BW_5G(pregistrypriv));
if (notify_bw > operation_bw)
notify_bw = operation_bw;

View File

@ -740,7 +740,7 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib
pattrib->encrypt=_NO_PRIVACY_;
}
#ifdef CONFIG_TDLS
if (pattrib->direct_link == _TRUE) {
if (pattrib->encrypt > 0)
@ -830,6 +830,10 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib
pattrib->bswenc = _TRUE;//force using sw enc.
}
#endif
#ifdef DYNAMIC_CAMID_ALLOC
if (pattrib->encrypt && bmcast && _rtw_camctl_chk_flags(padapter, SEC_STATUS_STA_PK_GK_CONFLICT_DIS_BMC_SEARCH))
pattrib->bswenc = _TRUE;
#endif
#ifdef CONFIG_WAPI_SUPPORT
if(pattrib->encrypt == _SMS4_)
@ -1052,61 +1056,116 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr
else
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_unknown);
bmcast = IS_MCAST(pattrib->ra);
if (bmcast) {
psta = rtw_get_bcmc_stainfo(padapter);
if (psta == NULL) { /* if we cannot get psta => drop the pkt */
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_sta);
RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra:" MAC_FMT "\n", MAC_ARG(pattrib->ra)));
#ifdef DBG_TX_DROP_FRAME
DBG_871X("DBG_TX_DROP_FRAME %s get sta_info fail, ra:" MAC_FMT"\n", __func__, MAC_ARG(pattrib->ra));
#endif
res = _FAIL;
goto exit;
}
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->ra);
if (psta == NULL) { /* if we cannot get psta => drop the pkt */
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_ucast_sta);
RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra:" MAC_FMT"\n", MAC_ARG(pattrib->ra)));
#ifdef DBG_TX_DROP_FRAME
DBG_871X("DBG_TX_DROP_FRAME %s get sta_info fail, ra:" MAC_FMT"\n", __func__, MAC_ARG(pattrib->ra));
#endif
res = _FAIL;
goto exit;
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE && !(psta->state & _FW_LINKED)) {
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_ucast_ap_link);
res = _FAIL;
goto exit;
}
}
if (!(psta->state & _FW_LINKED)) {
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_link);
DBG_871X("%s, psta("MAC_FMT")->state(0x%x) != _FW_LINKED\n", __func__, MAC_ARG(psta->hwaddr), psta->state);
res = _FAIL;
goto exit;
}
pattrib->pktlen = pktfile.pkt_len;
if (ETH_P_IP == pattrib->ether_type)
{
// The following is for DHCP and ARP packet, we use cck1M to tx these packets and let LPS awake some time
// to prevent DHCP protocol fail
/* TODO: 802.1Q VLAN header */
/* TODO: IPV6 */
u8 tmp[24];
_rtw_pktfile_read(&pktfile, &tmp[0], 24);
if (ETH_P_IP == pattrib->ether_type) {
u8 ip[20];
_rtw_pktfile_read(&pktfile, ip, 20);
if (GET_IPV4_IHL(ip) * 4 > 20)
_rtw_pktfile_read(&pktfile, NULL, GET_IPV4_IHL(ip) - 20);
pattrib->icmp_pkt = 0;
pattrib->dhcp_pkt = 0;
if (pktfile.pkt_len > 282) {//MINIMUM_DHCP_PACKET_SIZE) {
if (ETH_P_IP == pattrib->ether_type) {// IP header
if (((tmp[21] == 68) && (tmp[23] == 67)) ||
((tmp[21] == 67) && (tmp[23] == 68))) {
// 68 : UDP BOOTP client
// 67 : UDP BOOTP server
RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("======================update_attrib: get DHCP Packet \n"));
// Use low rate to send DHCP packet.
//if(pMgntInfo->IOTAction & HT_IOT_ACT_WA_IOT_Broadcom)
//{
// tcb_desc->DataRate = MgntQuery_TxRateExcludeCCKRates(ieee);//0xc;//ofdm 6m
// tcb_desc->bTxDisableRateFallBack = false;
//}
//else
// pTcb->DataRate = Adapter->MgntInfo.LowestBasicRate;
//RTPRINT(FDM, WA_IOT, ("DHCP TranslateHeader(), pTcb->DataRate = 0x%x\n", pTcb->DataRate));
if (GET_IPV4_PROTOCOL(ip) == 0x01) { /* ICMP */
pattrib->icmp_pkt = 1;
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_icmp);
} else if (GET_IPV4_PROTOCOL(ip) == 0x11) { /* UDP */
u8 udp[8];
_rtw_pktfile_read(&pktfile, udp, 8);
if ((GET_UDP_SRC(udp) == 68 && GET_UDP_DST(udp) == 67)
|| (GET_UDP_SRC(udp) == 67 && GET_UDP_DST(udp) == 68)
) {
/* 67 : UDP BOOTP server, 68 : UDP BOOTP client */
if (pattrib->pktlen > 282) { /* MINIMUM_DHCP_PACKET_SIZE */
pattrib->dhcp_pkt = 1;
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_dhcp);
if (0)
DBG_871X("send DHCP packet\n");
}
}
} else if (GET_IPV4_PROTOCOL(ip) == 0x06 /* TCP */
&& rtw_st_ctl_chk_reg_s_proto(&psta->st_ctl, 0x06) == _TRUE
) {
u8 tcp[20];
_rtw_pktfile_read(&pktfile, tcp, 20);
if (rtw_st_ctl_chk_reg_rule(&psta->st_ctl, padapter, IPV4_SRC(ip), TCP_SRC(tcp), IPV4_DST(ip), TCP_DST(tcp)) == _TRUE) {
if (GET_TCP_SYN(tcp) && GET_TCP_ACK(tcp)) {
session_tracker_add_cmd(padapter, psta
, IPV4_SRC(ip), TCP_SRC(tcp)
, IPV4_SRC(ip), TCP_DST(tcp));
if (DBG_SESSION_TRACKER)
DBG_871X(FUNC_ADPT_FMT" local:"IP_FMT":"PORT_FMT", remote:"IP_FMT":"PORT_FMT" SYN-ACK\n"
, FUNC_ADPT_ARG(padapter)
, IP_ARG(IPV4_SRC(ip)), PORT_ARG(TCP_SRC(tcp))
, IP_ARG(IPV4_DST(ip)), PORT_ARG(TCP_DST(tcp)));
}
if (GET_TCP_FIN(tcp)) {
session_tracker_del_cmd(padapter, psta
, IPV4_SRC(ip), TCP_SRC(tcp)
, IPV4_SRC(ip), TCP_DST(tcp));
if (DBG_SESSION_TRACKER)
DBG_871X(FUNC_ADPT_FMT" local:"IP_FMT":"PORT_FMT", remote:"IP_FMT":"PORT_FMT" FIN\n"
, FUNC_ADPT_ARG(padapter)
, IP_ARG(IPV4_SRC(ip)), PORT_ARG(TCP_SRC(tcp))
, IP_ARG(IPV4_DST(ip)), PORT_ARG(TCP_DST(tcp)));
}
}
}
//for parsing ICMP pakcets
{
struct iphdr *piphdr = (struct iphdr *)tmp;
pattrib->icmp_pkt = 0;
if(piphdr->protocol == 0x1) // protocol type in ip header 0x1 is ICMP
{
pattrib->icmp_pkt = 1;
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_icmp);
}
}
} else if (0x888e == pattrib->ether_type) {
DBG_871X_LEVEL(_drv_always_, "send eapol packet\n");
}
if ( (pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1) )
{
if ((pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1))
rtw_set_scan_deny(padapter, 3000);
}
#ifdef CONFIG_LPS
// If EAPOL , ARP , OR DHCP packet, driver must be in active mode.
@ -1130,49 +1189,9 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr
}
#endif //CONFIG_LPS
bmcast = IS_MCAST(pattrib->ra);
// get sta_info
if (bmcast) {
psta = rtw_get_bcmc_stainfo(padapter);
} else {
psta = rtw_get_stainfo(pstapriv, pattrib->ra);
if (psta == NULL) { // if we cannot get psta => drop the pkt
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_ucast_sta);
RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra:" MAC_FMT"\n", MAC_ARG(pattrib->ra)));
#ifdef DBG_TX_DROP_FRAME
DBG_871X("DBG_TX_DROP_FRAME %s get sta_info fail, ra:" MAC_FMT"\n", __FUNCTION__, MAC_ARG(pattrib->ra));
#endif
res =_FAIL;
goto exit;
}
else if((check_fwstate(pmlmepriv, WIFI_AP_STATE)==_TRUE)&&(!(psta->state & _FW_LINKED)))
{
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_ucast_ap_link);
res =_FAIL;
goto exit;
}
}
if(psta == NULL)
{ // if we cannot get psta => drop the pkt
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_sta);
RT_TRACE(_module_rtl871x_xmit_c_, _drv_alert_, ("\nupdate_attrib => get sta_info fail, ra:" MAC_FMT "\n", MAC_ARG(pattrib->ra)));
#ifdef DBG_TX_DROP_FRAME
DBG_871X("DBG_TX_DROP_FRAME %s get sta_info fail, ra:" MAC_FMT"\n", __FUNCTION__, MAC_ARG(pattrib->ra));
#endif
res = _FAIL;
goto exit;
}
if(!(psta->state &_FW_LINKED))
{
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_err_link);
DBG_871X("%s, psta("MAC_FMT")->state(0x%x) != _FW_LINKED\n", __func__, MAC_ARG(psta->hwaddr), psta->state);
return _FAIL;
}
#ifdef CONFIG_BEAMFORMING
update_attrib_txbf_info(padapter, pattrib, psta);
#endif
//TODO:_lock
if(update_attrib_sec_info(padapter, pattrib, psta) == _FAIL)
@ -2253,9 +2272,6 @@ _func_enter_;
_enter_critical_bh(&padapter->security_key_mutex, &irqL);
//only support station mode
if(!check_fwstate(pmlmepriv, WIFI_STATION_STATE) || !check_fwstate(pmlmepriv, _FW_LINKED))
goto xmitframe_coalesce_success;
//IGTK key is not install, it may not support 802.11w
if(padapter->securitypriv.binstallBIPkey != _TRUE)
@ -2352,9 +2368,8 @@ _func_enter_;
goto xmitframe_coalesce_fail;
}
if(!(psta->state & _FW_LINKED) || pxmitframe->buf_addr==NULL)
{
DBG_871X("%s, not _FW_LINKED or addr null\n", __func__);
if (pxmitframe->buf_addr == NULL) {
DBG_871X("%s, pxmitframe->buf_addr\n", __func__);
goto xmitframe_coalesce_fail;
}
@ -2377,6 +2392,13 @@ _func_enter_;
}*/
if(pattrib->encrypt>0)
_rtw_memcpy(pattrib->dot118021x_UncstKey.skey, psta->dot118021x_UncstKey.skey, 16);
/* To use wrong key */
if (pattrib->key_type == IEEE80211W_WRONG_KEY) {
DBG_871X("use wrong key\n");
pattrib->dot118021x_UncstKey.skey[0] = 0xff;
}
//bakeup original management packet
_rtw_memcpy(tmp_buf, pframe, pattrib->pktlen);
//move to data portion
@ -3745,6 +3767,147 @@ static void do_queue_select(_adapter *padapter, struct pkt_attrib *pattrib)
pattrib->qsel = qsel;
}
/*
* The main transmit(tx) entry
*
* Return
* 1 enqueue
* 0 success, hardware will handle this xmit frame(packet)
* <0 fail
*/
s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
{
int ret = 0;
int rtap_len;
int qos_len = 0;
int dot11_hdr_len = 24;
int snap_len = 6;
unsigned char *pdata;
u16 frame_ctl;
unsigned char src_mac_addr[6];
unsigned char dst_mac_addr[6];
struct rtw_ieee80211_hdr *dot11_hdr;
struct ieee80211_radiotap_header *rtap_hdr;
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
if (skb)
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
if (unlikely(skb->len < sizeof(struct ieee80211_radiotap_header)))
goto fail;
rtap_hdr = (struct ieee80211_radiotap_header *)skb->data;
if (unlikely(rtap_hdr->it_version))
goto fail;
rtap_len = ieee80211_get_radiotap_len(skb->data);
if (unlikely(skb->len < rtap_len))
goto fail;
if (rtap_len != 12) {
DBG_8192C("radiotap len (should be 14): %d\n", rtap_len);
goto fail;
}
/* Skip the ratio tap header */
skb_pull(skb, rtap_len);
dot11_hdr = (struct rtw_ieee80211_hdr *)skb->data;
frame_ctl = le16_to_cpu(dot11_hdr->frame_ctl);
/* Check if the QoS bit is set */
if ((frame_ctl & RTW_IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) {
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
u8 *buf = skb->data;
u32 len = skb->len;
u8 category, action;
int type = -1;
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (pmgntframe == NULL) {
rtw_udelay_os(500);
goto fail;
}
pattrib = &pmgntframe->attrib;
update_monitor_frame_attrib(padapter, pattrib);
pattrib->retry_ctrl = _FALSE;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
_rtw_memcpy(pframe, (void *)buf, len);
pattrib->pktlen = len;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
if (is_broadcast_mac_addr(pwlanhdr->addr3) || is_broadcast_mac_addr(pwlanhdr->addr1))
pattrib->rate = MGN_24M;
pmlmeext->mgnt_seq = GetSequence(pwlanhdr);
pattrib->seqnum = pmlmeext->mgnt_seq;
pmlmeext->mgnt_seq++;
pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe);
} else {
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
u8 *buf = skb->data;
u32 len = skb->len;
u8 category, action;
int type = -1;
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (pmgntframe == NULL)
goto fail;
pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib);
pattrib->retry_ctrl = _FALSE;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
_rtw_memcpy(pframe, (void *)buf, len);
pattrib->pktlen = len;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
pmlmeext->mgnt_seq = GetSequence(pwlanhdr);
pattrib->seqnum = pmlmeext->mgnt_seq;
pmlmeext->mgnt_seq++;
pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe);
}
fail:
rtw_skb_free(skb);
return 0;
}
/*
* The main transmit(tx) entry
*
@ -3940,9 +4103,11 @@ inline bool xmitframe_hiq_filter(struct xmit_frame *xmitframe)
_adapter *adapter = xmitframe->padapter;
struct registry_priv *registry = &adapter->registrypriv;
if (adapter->interface_type != RTW_PCIE) {
if (rtw_get_intf_type(adapter) != RTW_PCIE) {
if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_SPECIAL) {
if (adapter->registrypriv.wifi_spec == 1) {
allow = _TRUE;
} else if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_SPECIAL) {
struct pkt_attrib *attrib = &xmitframe->attrib;
@ -4065,14 +4230,21 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p
pstapriv->sta_dz_bitmap |= BIT(0);
//DBG_871X("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap);
if (update_tim == _TRUE) {
if (is_broadcast_mac_addr(pattrib->ra))
_update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer BC");
else
_update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer MC");
if (padapter->registrypriv.wifi_spec == 1) {
/*
*if (update_tim == _TRUE)
* rtw_chk_hi_queue_cmd(padapter);
*/
} else {
chk_bmc_sleepq_cmd(padapter);
if (update_tim == _TRUE) {
if (is_broadcast_mac_addr(pattrib->ra))
_update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer BC");
else
_update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer MC");
} else {
chk_bmc_sleepq_cmd(padapter);
}
}
//_exit_critical_bh(&psta->sleep_q.lock, &irqL);
@ -4720,6 +4892,39 @@ thread_return rtw_xmit_thread(thread_context context)
}
#endif
bool rtw_xmit_ac_blocked(_adapter *adapter)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
_adapter *iface;
struct mlme_ext_priv *mlmeext;
struct mlme_ext_info *mlmeextinfo;
bool blocked = _FALSE;
int i;
for (i = 0; i < dvobj->iface_nums; i++) {
iface = dvobj->padapters[i];
mlmeext = &iface->mlmeextpriv;
/* check scan state */
if (mlmeext_scan_state(mlmeext) != SCAN_DISABLE
&& mlmeext_scan_state(mlmeext) != SCAN_BACK_OP
) {
blocked = _TRUE;
goto exit;
}
if (mlmeext_scan_state(mlmeext) == SCAN_BACK_OP
&& !mlmeext_chk_scan_backop_flags(mlmeext, SS_BACKOP_TX_RESUME)
) {
blocked = _TRUE;
goto exit;
}
}
exit:
return blocked;
}
void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms)
{
sctx->timeout_ms = timeout_ms;
@ -4816,11 +5021,11 @@ int rtw_ack_tx_polling(struct xmit_priv *pxmitpriv, u32 timeout_ms)
if (pack_tx_ops->status != RTW_SCTX_SUBMITTED)
break;
if (adapter->bDriverStopped) {
if (rtw_is_drv_stopped(adapter)) {
pack_tx_ops->status = RTW_SCTX_DONE_DRV_STOP;
break;
}
if (adapter->bSurpriseRemoved) {
if (rtw_is_surprise_removed(adapter)) {
pack_tx_ops->status = RTW_SCTX_DONE_DEV_REMOVE;
break;
}

View File

@ -147,7 +147,7 @@ u8 HalPwrSeqCmdParsing(
rtw_udelay_os(10);
if (pollingCount++ > maxPollingCnt) {
DBG_871X_LEVEL(_drv_always_, "HalPwrSeqCmdParsing: Fail to polling Offset[%#x]=%02x\n", offset, value);
DBG_871X_LEVEL(_drv_err_, "HalPwrSeqCmdParsing: Fail to polling Offset[%#x]=%02x\n", offset, value);
return _FALSE;
}
} while (!bPollingBit);

View File

@ -1,254 +0,0 @@
//===========================================
// The following is for 8192E 1ANT BT Co-exist definition
//===========================================
#define BT_AUTO_REPORT_ONLY_8192E_1ANT 1
#define BT_INFO_8192E_1ANT_B_FTP BIT7
#define BT_INFO_8192E_1ANT_B_A2DP BIT6
#define BT_INFO_8192E_1ANT_B_HID BIT5
#define BT_INFO_8192E_1ANT_B_SCO_BUSY BIT4
#define BT_INFO_8192E_1ANT_B_ACL_BUSY BIT3
#define BT_INFO_8192E_1ANT_B_INQ_PAGE BIT2
#define BT_INFO_8192E_1ANT_B_SCO_ESCO BIT1
#define BT_INFO_8192E_1ANT_B_CONNECTION BIT0
#define BT_INFO_8192E_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
#define BTC_RSSI_COEX_THRESH_TOL_8192E_1ANT 2
#define BT_8192E_1ANT_WIFI_NOISY_THRESH 30 //max: 255
typedef enum _BT_INFO_SRC_8192E_1ANT{
BT_INFO_SRC_8192E_1ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8192E_1ANT_BT_RSP = 0x1,
BT_INFO_SRC_8192E_1ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8192E_1ANT_MAX
}BT_INFO_SRC_8192E_1ANT,*PBT_INFO_SRC_8192E_1ANT;
typedef enum _BT_8192E_1ANT_BT_STATUS{
BT_8192E_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8192E_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8192E_1ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8192E_1ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8192E_1ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8192E_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8192E_1ANT_BT_STATUS_MAX
}BT_8192E_1ANT_BT_STATUS,*PBT_8192E_1ANT_BT_STATUS;
typedef enum _BT_8192E_1ANT_WIFI_STATUS{
BT_8192E_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8192E_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3,
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
BT_8192E_1ANT_WIFI_STATUS_MAX
}BT_8192E_1ANT_WIFI_STATUS,*PBT_8192E_1ANT_WIFI_STATUS;
typedef enum _BT_8192E_1ANT_COEX_ALGO{
BT_8192E_1ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8192E_1ANT_COEX_ALGO_SCO = 0x1,
BT_8192E_1ANT_COEX_ALGO_HID = 0x2,
BT_8192E_1ANT_COEX_ALGO_A2DP = 0x3,
BT_8192E_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8192E_1ANT_COEX_ALGO_PANEDR = 0x5,
BT_8192E_1ANT_COEX_ALGO_PANHS = 0x6,
BT_8192E_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8192E_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8192E_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8192E_1ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8192E_1ANT_COEX_ALGO_MAX = 0xb,
}BT_8192E_1ANT_COEX_ALGO,*PBT_8192E_1ANT_COEX_ALGO;
typedef struct _COEX_DM_8192E_1ANT{
// fw mechanism
BOOLEAN bCurIgnoreWlanAct;
BOOLEAN bPreIgnoreWlanAct;
u1Byte prePsTdma;
u1Byte curPsTdma;
u1Byte psTdmaPara[5];
u1Byte psTdmaDuAdjType;
BOOLEAN bAutoTdmaAdjust;
BOOLEAN bPrePsTdmaOn;
BOOLEAN bCurPsTdmaOn;
BOOLEAN bPreBtAutoReport;
BOOLEAN bCurBtAutoReport;
u1Byte preLps;
u1Byte curLps;
u1Byte preRpwm;
u1Byte curRpwm;
// sw mechanism
BOOLEAN bPreLowPenaltyRa;
BOOLEAN bCurLowPenaltyRa;
u4Byte preVal0x6c0;
u4Byte curVal0x6c0;
u4Byte preVal0x6c4;
u4Byte curVal0x6c4;
u4Byte preVal0x6c8;
u4Byte curVal0x6c8;
u1Byte preVal0x6cc;
u1Byte curVal0x6cc;
BOOLEAN bLimitedDig;
u4Byte backupArfrCnt1; // Auto Rate Fallback Retry cnt
u4Byte backupArfrCnt2; // Auto Rate Fallback Retry cnt
u2Byte backupRetryLimit;
u1Byte backupAmpduMaxTime;
// algorithm related
u1Byte preAlgorithm;
u1Byte curAlgorithm;
u1Byte btStatus;
u1Byte wifiChnlInfo[3];
u4Byte preRaMask;
u4Byte curRaMask;
u1Byte preArfrType;
u1Byte curArfrType;
u1Byte preRetryLimitType;
u1Byte curRetryLimitType;
u1Byte preAmpduTimeType;
u1Byte curAmpduTimeType;
u4Byte nArpCnt;
u1Byte errorCondition;
} COEX_DM_8192E_1ANT, *PCOEX_DM_8192E_1ANT;
typedef struct _COEX_STA_8192E_1ANT{
BOOLEAN bBtLinkExist;
BOOLEAN bScoExist;
BOOLEAN bA2dpExist;
BOOLEAN bHidExist;
BOOLEAN bPanExist;
BOOLEAN bUnderLps;
BOOLEAN bUnderIps;
u4Byte specialPktPeriodCnt;
u4Byte highPriorityTx;
u4Byte highPriorityRx;
u4Byte lowPriorityTx;
u4Byte lowPriorityRx;
s1Byte btRssi;
BOOLEAN bBtTxRxMask;
u1Byte preBtRssiState;
u1Byte preWifiRssiState[4];
BOOLEAN bC2hBtInfoReqSent;
u1Byte btInfoC2h[BT_INFO_SRC_8192E_1ANT_MAX][10];
u4Byte btInfoC2hCnt[BT_INFO_SRC_8192E_1ANT_MAX];
BOOLEAN bC2hBtInquiryPage;
BOOLEAN bC2hBtPage; //Add for win8.1 page out issue
BOOLEAN bWiFiIsHighPriTask; //Add for win8.1 page out issue
u1Byte btRetryCnt;
u1Byte btInfoExt;
u4Byte popEventCnt;
u1Byte nScanAPNum;
u4Byte nCRCOK_CCK;
u4Byte nCRCOK_11g;
u4Byte nCRCOK_11n;
u4Byte nCRCOK_11nAgg;
u4Byte nCRCErr_CCK;
u4Byte nCRCErr_11g;
u4Byte nCRCErr_11n;
u4Byte nCRCErr_11nAgg;
BOOLEAN bCCKLock;
BOOLEAN bPreCCKLock;
u1Byte nCoexTableType;
BOOLEAN bForceLpsOn;
}COEX_STA_8192E_1ANT, *PCOEX_STA_8192E_1ANT;
//===========================================
// The following is interface which will notify coex module.
//===========================================
VOID
EXhalbtc8192e1ant_PowerOnSetting(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8192e1ant_PreLoadFirmware(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8192e1ant_InitHwConfig(
IN PBTC_COEXIST pBtCoexist,
IN BOOLEAN bWifiOnly
);
VOID
EXhalbtc8192e1ant_InitCoexDm(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8192e1ant_IpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e1ant_LpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e1ant_ScanNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e1ant_ConnectNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e1ant_MediaStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e1ant_SpecialPacketNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e1ant_BtInfoNotify(
IN PBTC_COEXIST pBtCoexist,
IN pu1Byte tmpBuf,
IN u1Byte length
);
VOID
EXhalbtc8192e1ant_RfStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e1ant_HaltNotify(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8192e1ant_PnpNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte pnpState
);
VOID
EXhalbtc8192e1ant_CoexDmReset(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8192e1ant_Periodical(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8192e1ant_DisplayCoexInfo(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8192e1ant_DbgControl(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte opCode,
IN u1Byte opLen,
IN pu1Byte pData
);

View File

@ -1,231 +0,0 @@
//===========================================
// The following is for 8192E 2Ant BT Co-exist definition
//===========================================
#define BT_AUTO_REPORT_ONLY_8192E_2ANT 0
#define BT_INFO_8192E_2ANT_B_FTP BIT7
#define BT_INFO_8192E_2ANT_B_A2DP BIT6
#define BT_INFO_8192E_2ANT_B_HID BIT5
#define BT_INFO_8192E_2ANT_B_SCO_BUSY BIT4
#define BT_INFO_8192E_2ANT_B_ACL_BUSY BIT3
#define BT_INFO_8192E_2ANT_B_INQ_PAGE BIT2
#define BT_INFO_8192E_2ANT_B_SCO_ESCO BIT1
#define BT_INFO_8192E_2ANT_B_CONNECTION BIT0
#define BT_INFO_8192E_2ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
#define BTC_RSSI_COEX_THRESH_TOL_8192E_2ANT 2
#define NOISY_AP_NUM_THRESH 5
typedef enum _BT_INFO_SRC_8192E_2ANT{
BT_INFO_SRC_8192E_2ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8192E_2ANT_BT_RSP = 0x1,
BT_INFO_SRC_8192E_2ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8192E_2ANT_MAX
}BT_INFO_SRC_8192E_2ANT,*PBT_INFO_SRC_8192E_2ANT;
typedef enum _BT_8192E_2ANT_BT_STATUS{
BT_8192E_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8192E_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8192E_2ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8192E_2ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8192E_2ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8192E_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8192E_2ANT_BT_STATUS_MAX
}BT_8192E_2ANT_BT_STATUS,*PBT_8192E_2ANT_BT_STATUS;
typedef enum _BT_8192E_2ANT_COEX_ALGO{
BT_8192E_2ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8192E_2ANT_COEX_ALGO_SCO = 0x1,
BT_8192E_2ANT_COEX_ALGO_SCO_PAN = 0x2,
BT_8192E_2ANT_COEX_ALGO_HID = 0x3,
BT_8192E_2ANT_COEX_ALGO_A2DP = 0x4,
BT_8192E_2ANT_COEX_ALGO_A2DP_PANHS = 0x5,
BT_8192E_2ANT_COEX_ALGO_PANEDR = 0x6,
BT_8192E_2ANT_COEX_ALGO_PANHS = 0x7,
BT_8192E_2ANT_COEX_ALGO_PANEDR_A2DP = 0x8,
BT_8192E_2ANT_COEX_ALGO_PANEDR_HID = 0x9,
BT_8192E_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0xa,
BT_8192E_2ANT_COEX_ALGO_HID_A2DP = 0xb,
BT_8192E_2ANT_COEX_ALGO_MAX = 0xc
}BT_8192E_2ANT_COEX_ALGO,*PBT_8192E_2ANT_COEX_ALGO;
typedef struct _COEX_DM_8192E_2ANT{
// fw mechanism
u1Byte preBtDecPwrLvl;
u1Byte curBtDecPwrLvl;
u1Byte preFwDacSwingLvl;
u1Byte curFwDacSwingLvl;
BOOLEAN bCurIgnoreWlanAct;
BOOLEAN bPreIgnoreWlanAct;
u1Byte prePsTdma;
u1Byte curPsTdma;
u1Byte psTdmaPara[5];
u1Byte psTdmaDuAdjType;
BOOLEAN bResetTdmaAdjust;
BOOLEAN bAutoTdmaAdjust;
BOOLEAN bAutoTdmaAdjustLowRssi;
BOOLEAN bPrePsTdmaOn;
BOOLEAN bCurPsTdmaOn;
BOOLEAN bPreBtAutoReport;
BOOLEAN bCurBtAutoReport;
u1Byte preLps;
u1Byte curLps;
u1Byte preRpwm;
u1Byte curRpwm;
// sw mechanism
BOOLEAN bPreRfRxLpfShrink;
BOOLEAN bCurRfRxLpfShrink;
u4Byte btRf0x1eBackup;
BOOLEAN bPreLowPenaltyRa;
BOOLEAN bCurLowPenaltyRa;
BOOLEAN bPreDacSwingOn;
u4Byte preDacSwingLvl;
BOOLEAN bCurDacSwingOn;
u4Byte curDacSwingLvl;
BOOLEAN bPreAdcBackOff;
BOOLEAN bCurAdcBackOff;
BOOLEAN bPreAgcTableEn;
BOOLEAN bCurAgcTableEn;
u4Byte preVal0x6c0;
u4Byte curVal0x6c0;
u4Byte preVal0x6c4;
u4Byte curVal0x6c4;
u4Byte preVal0x6c8;
u4Byte curVal0x6c8;
u1Byte preVal0x6cc;
u1Byte curVal0x6cc;
BOOLEAN bLimitedDig;
u4Byte backupArfrCnt1; // Auto Rate Fallback Retry cnt
u4Byte backupArfrCnt2; // Auto Rate Fallback Retry cnt
u2Byte backupRetryLimit;
u1Byte backupAmpduMaxTime;
// algorithm related
u1Byte preAlgorithm;
u1Byte curAlgorithm;
u1Byte btStatus;
u1Byte wifiChnlInfo[3];
u1Byte preSsType;
u1Byte curSsType;
u4Byte preRaMask;
u4Byte curRaMask;
u1Byte curRaMaskType;
u1Byte preArfrType;
u1Byte curArfrType;
u1Byte preRetryLimitType;
u1Byte curRetryLimitType;
u1Byte preAmpduTimeType;
u1Byte curAmpduTimeType;
} COEX_DM_8192E_2ANT, *PCOEX_DM_8192E_2ANT;
typedef struct _COEX_STA_8192E_2ANT{
BOOLEAN bBtLinkExist;
BOOLEAN bScoExist;
BOOLEAN bA2dpExist;
BOOLEAN bHidExist;
BOOLEAN bPanExist;
BOOLEAN bUnderLps;
BOOLEAN bUnderIps;
u4Byte highPriorityTx;
u4Byte highPriorityRx;
u4Byte lowPriorityTx;
u4Byte lowPriorityRx;
u1Byte btRssi;
u1Byte preBtRssiState;
u1Byte preWifiRssiState[4];
BOOLEAN bC2hBtInfoReqSent;
u1Byte btInfoC2h[BT_INFO_SRC_8192E_2ANT_MAX][10];
u4Byte btInfoC2hCnt[BT_INFO_SRC_8192E_2ANT_MAX];
BOOLEAN bC2hBtInquiryPage;
u1Byte btRetryCnt;
u1Byte btInfoExt;
u1Byte nScanAPNum;
u4Byte nCRCOK_CCK;
u4Byte nCRCOK_11g;
u4Byte nCRCOK_11n;
u4Byte nCRCOK_11nAgg;
u4Byte nCRCErr_CCK;
u4Byte nCRCErr_11g;
u4Byte nCRCErr_11n;
u4Byte nCRCErr_11nAgg;
u1Byte nCoexTableType;
BOOLEAN bForceLpsOn;
u1Byte disVerInfoCnt;
}COEX_STA_8192E_2ANT, *PCOEX_STA_8192E_2ANT;
//===========================================
// The following is interface which will notify coex module.
//===========================================
VOID
EXhalbtc8192e2ant_PowerOnSetting(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8192e2ant_InitHwConfig(
IN PBTC_COEXIST pBtCoexist,
IN BOOLEAN bWifiOnly
);
VOID
EXhalbtc8192e2ant_InitCoexDm(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8192e2ant_IpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e2ant_LpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e2ant_ScanNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e2ant_ConnectNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e2ant_MediaStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e2ant_SpecialPacketNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8192e2ant_BtInfoNotify(
IN PBTC_COEXIST pBtCoexist,
IN pu1Byte tmpBuf,
IN u1Byte length
);
VOID
EXhalbtc8192e2ant_HaltNotify(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8192e2ant_Periodical(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8192e2ant_DisplayCoexInfo(
IN PBTC_COEXIST pBtCoexist
);

View File

@ -1,337 +0,0 @@
//===========================================
// The following is for 8723B 1ANT BT Co-exist definition
//===========================================
#define BT_AUTO_REPORT_ONLY_8723B_1ANT 1
#define BT_INFO_8723B_1ANT_B_FTP BIT7
#define BT_INFO_8723B_1ANT_B_A2DP BIT6
#define BT_INFO_8723B_1ANT_B_HID BIT5
#define BT_INFO_8723B_1ANT_B_SCO_BUSY BIT4
#define BT_INFO_8723B_1ANT_B_ACL_BUSY BIT3
#define BT_INFO_8723B_1ANT_B_INQ_PAGE BIT2
#define BT_INFO_8723B_1ANT_B_SCO_ESCO BIT1
#define BT_INFO_8723B_1ANT_B_CONNECTION BIT0
#define BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
#define BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT 2
#define BT_8723B_1ANT_WIFI_NOISY_THRESH 50 //30 //max: 255
//for Antenna detection
#define BT_8723B_1ANT_ANTDET_PSDTHRES_BACKGROUND 50
#define BT_8723B_1ANT_ANTDET_PSDTHRES_2ANT_BADISOLATION 70
#define BT_8723B_1ANT_ANTDET_PSDTHRES_2ANT_GOODISOLATION 55
#define BT_8723B_1ANT_ANTDET_PSDTHRES_1ANT 35
#define BT_8723B_1ANT_ANTDET_RETRY_INTERVAL 10 //retry timer if ant det is fail, unit: second
#define BT_8723B_1ANT_ANTDET_ENABLE 0
#define BT_8723B_1ANT_ANTDET_COEXMECHANISMSWITCH_ENABLE 0
typedef enum _BT_INFO_SRC_8723B_1ANT{
BT_INFO_SRC_8723B_1ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8723B_1ANT_BT_RSP = 0x1,
BT_INFO_SRC_8723B_1ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8723B_1ANT_MAX
}BT_INFO_SRC_8723B_1ANT,*PBT_INFO_SRC_8723B_1ANT;
typedef enum _BT_8723B_1ANT_BT_STATUS{
BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8723B_1ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8723B_1ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8723B_1ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8723B_1ANT_BT_STATUS_MAX
}BT_8723B_1ANT_BT_STATUS,*PBT_8723B_1ANT_BT_STATUS;
typedef enum _BT_8723B_1ANT_WIFI_STATUS{
BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3,
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
BT_8723B_1ANT_WIFI_STATUS_MAX
}BT_8723B_1ANT_WIFI_STATUS,*PBT_8723B_1ANT_WIFI_STATUS;
typedef enum _BT_8723B_1ANT_COEX_ALGO{
BT_8723B_1ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8723B_1ANT_COEX_ALGO_SCO = 0x1,
BT_8723B_1ANT_COEX_ALGO_HID = 0x2,
BT_8723B_1ANT_COEX_ALGO_A2DP = 0x3,
BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8723B_1ANT_COEX_ALGO_PANEDR = 0x5,
BT_8723B_1ANT_COEX_ALGO_PANHS = 0x6,
BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8723B_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8723B_1ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8723B_1ANT_COEX_ALGO_MAX = 0xb,
}BT_8723B_1ANT_COEX_ALGO,*PBT_8723B_1ANT_COEX_ALGO;
typedef struct _COEX_DM_8723B_1ANT{
// hw setting
u1Byte preAntPosType;
u1Byte curAntPosType;
// fw mechanism
BOOLEAN bCurIgnoreWlanAct;
BOOLEAN bPreIgnoreWlanAct;
u1Byte prePsTdma;
u1Byte curPsTdma;
u1Byte psTdmaPara[5];
u1Byte psTdmaDuAdjType;
BOOLEAN bAutoTdmaAdjust;
BOOLEAN bPrePsTdmaOn;
BOOLEAN bCurPsTdmaOn;
BOOLEAN bPreBtAutoReport;
BOOLEAN bCurBtAutoReport;
u1Byte preLps;
u1Byte curLps;
u1Byte preRpwm;
u1Byte curRpwm;
// sw mechanism
BOOLEAN bPreLowPenaltyRa;
BOOLEAN bCurLowPenaltyRa;
u4Byte preVal0x6c0;
u4Byte curVal0x6c0;
u4Byte preVal0x6c4;
u4Byte curVal0x6c4;
u4Byte preVal0x6c8;
u4Byte curVal0x6c8;
u1Byte preVal0x6cc;
u1Byte curVal0x6cc;
BOOLEAN bLimitedDig;
u4Byte backupArfrCnt1; // Auto Rate Fallback Retry cnt
u4Byte backupArfrCnt2; // Auto Rate Fallback Retry cnt
u2Byte backupRetryLimit;
u1Byte backupAmpduMaxTime;
// algorithm related
u1Byte preAlgorithm;
u1Byte curAlgorithm;
u1Byte btStatus;
u1Byte wifiChnlInfo[3];
u4Byte preRaMask;
u4Byte curRaMask;
u1Byte preArfrType;
u1Byte curArfrType;
u1Byte preRetryLimitType;
u1Byte curRetryLimitType;
u1Byte preAmpduTimeType;
u1Byte curAmpduTimeType;
u4Byte nArpCnt;
u1Byte errorCondition;
} COEX_DM_8723B_1ANT, *PCOEX_DM_8723B_1ANT;
typedef struct _COEX_STA_8723B_1ANT{
BOOLEAN bBtLinkExist;
BOOLEAN bScoExist;
BOOLEAN bA2dpExist;
BOOLEAN bHidExist;
BOOLEAN bPanExist;
BOOLEAN bBtHiPriLinkExist;
u1Byte nNumOfProfile;
BOOLEAN bUnderLps;
BOOLEAN bUnderIps;
u4Byte specialPktPeriodCnt;
u4Byte highPriorityTx;
u4Byte highPriorityRx;
u4Byte lowPriorityTx;
u4Byte lowPriorityRx;
s1Byte btRssi;
BOOLEAN bBtTxRxMask;
u1Byte preBtRssiState;
u1Byte preWifiRssiState[4];
BOOLEAN bC2hBtInfoReqSent;
u1Byte btInfoC2h[BT_INFO_SRC_8723B_1ANT_MAX][10];
u4Byte btInfoC2hCnt[BT_INFO_SRC_8723B_1ANT_MAX];
BOOLEAN bBtWhckTest;
BOOLEAN bC2hBtInquiryPage;
BOOLEAN bC2hBtRemoteNameReq;
BOOLEAN bWiFiIsHighPriTask; //Add for win8.1 page out issue
u1Byte btRetryCnt;
u1Byte btInfoExt;
u4Byte popEventCnt;
u1Byte nScanAPNum;
u4Byte nCRCOK_CCK;
u4Byte nCRCOK_11g;
u4Byte nCRCOK_11n;
u4Byte nCRCOK_11nAgg;
u4Byte nCRCErr_CCK;
u4Byte nCRCErr_11g;
u4Byte nCRCErr_11n;
u4Byte nCRCErr_11nAgg;
BOOLEAN bCCKLock;
BOOLEAN bPreCCKLock;
BOOLEAN bCCKEverLock;
u1Byte nCoexTableType;
BOOLEAN bForceLpsOn;
u4Byte wrongProfileNotification;
u1Byte nA2DPBitPool;
u1Byte nCutVersion;
}COEX_STA_8723B_1ANT, *PCOEX_STA_8723B_1ANT;
#define BT_8723B_1ANT_ANTDET_PSD_POINTS 256 //MAX:1024
#define BT_8723B_1ANT_ANTDET_PSD_AVGNUM 1 //MAX:3
#define BT_8723B_1ANT_ANTDET_BUF_LEN 16
typedef struct _PSDSCAN_STA_8723B_1ANT{
u4Byte nAntDet_BTLEChannel; //BT LE Channel ex:2412
u4Byte nAntDet_BTTxTime;
u4Byte nAntDet_PrePSDScanPeakVal;
BOOLEAN nAntDet_IsAntDetAvailable;
u4Byte nAntDet_PSDScanPeakVal;
BOOLEAN nAntDet_IsBTReplyAvailable;
u4Byte nAntDet_PSDScanPeakFreq;
u1Byte nAntDet_Result;
u1Byte nAntDet_PeakVal[BT_8723B_1ANT_ANTDET_BUF_LEN];
u1Byte nAntDet_PeakFreq[BT_8723B_1ANT_ANTDET_BUF_LEN];
u4Byte bAntDet_TryCount;
u4Byte bAntDet_FailCount;
u4Byte nAntDet_IntevalCount;
u4Byte nAntDet_ThresOffset;
u4Byte nRealCentFreq;
s4Byte nRealOffset;
u4Byte nRealSpan;
u4Byte nPSDBandWidth; //unit: Hz
u4Byte nPSDPoint; //128/256/512/1024
u4Byte nPSDReport[1024]; //unit:dB (20logx), 0~255
u4Byte nPSDReport_MaxHold[1024]; //unit:dB (20logx), 0~255
u4Byte nPSDStartPoint;
u4Byte nPSDStopPoint;
u4Byte nPSDMaxValuePoint;
u4Byte nPSDMaxValue;
u4Byte nPSDStartBase;
u4Byte nPSDAvgNum; // 1/8/16/32
u4Byte nPSDGenCount;
BOOLEAN bIsPSDRunning;
BOOLEAN bIsPSDShowMaxOnly;
} PSDSCAN_STA_8723B_1ANT, *PPSDSCAN_STA_8723B_1ANT;
//===========================================
// The following is interface which will notify coex module.
//===========================================
VOID
EXhalbtc8723b1ant_PowerOnSetting(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b1ant_PreLoadFirmware(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b1ant_InitHwConfig(
IN PBTC_COEXIST pBtCoexist,
IN BOOLEAN bWifiOnly
);
VOID
EXhalbtc8723b1ant_InitCoexDm(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b1ant_IpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b1ant_LpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b1ant_ScanNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b1ant_ConnectNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b1ant_MediaStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b1ant_SpecialPacketNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b1ant_BtInfoNotify(
IN PBTC_COEXIST pBtCoexist,
IN pu1Byte tmpBuf,
IN u1Byte length
);
VOID
EXhalbtc8723b1ant_RfStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b1ant_HaltNotify(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b1ant_PnpNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte pnpState
);
VOID
EXhalbtc8723b1ant_CoexDmReset(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b1ant_Periodical(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b1ant_DisplayCoexInfo(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b1ant_AntennaDetection(
IN PBTC_COEXIST pBtCoexist,
IN u4Byte centFreq,
IN u4Byte offset,
IN u4Byte span,
IN u4Byte seconds
);
VOID
EXhalbtc8723b1ant_AntennaIsolation(
IN PBTC_COEXIST pBtCoexist,
IN u4Byte centFreq,
IN u4Byte offset,
IN u4Byte span,
IN u4Byte seconds
);
VOID
EXhalbtc8723b1ant_PSDScan(
IN PBTC_COEXIST pBtCoexist,
IN u4Byte centFreq,
IN u4Byte offset,
IN u4Byte span,
IN u4Byte seconds
);
VOID
EXhalbtc8723b1ant_DisplayAntDetection(
IN PBTC_COEXIST pBtCoexist
);

View File

@ -1,258 +0,0 @@
//===========================================
// The following is for 8812A 1ANT BT Co-exist definition
//===========================================
#define BT_AUTO_REPORT_ONLY_8812A_1ANT 1
#define BT_INFO_8812A_1ANT_B_FTP BIT7
#define BT_INFO_8812A_1ANT_B_A2DP BIT6
#define BT_INFO_8812A_1ANT_B_HID BIT5
#define BT_INFO_8812A_1ANT_B_SCO_BUSY BIT4
#define BT_INFO_8812A_1ANT_B_ACL_BUSY BIT3
#define BT_INFO_8812A_1ANT_B_INQ_PAGE BIT2
#define BT_INFO_8812A_1ANT_B_SCO_ESCO BIT1
#define BT_INFO_8812A_1ANT_B_CONNECTION BIT0
#define BT_INFO_8812A_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
#define BTC_RSSI_COEX_THRESH_TOL_8812A_1ANT 2
#define BT_8812A_1ANT_WIFI_NOISY_THRESH 30 //max: 255
typedef enum _BT_INFO_SRC_8812A_1ANT{
BT_INFO_SRC_8812A_1ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8812A_1ANT_BT_RSP = 0x1,
BT_INFO_SRC_8812A_1ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8812A_1ANT_MAX
}BT_INFO_SRC_8812A_1ANT,*PBT_INFO_SRC_8812A_1ANT;
typedef enum _BT_8812A_1ANT_BT_STATUS{
BT_8812A_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8812A_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8812A_1ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8812A_1ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8812A_1ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8812A_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8812A_1ANT_BT_STATUS_MAX
}BT_8812A_1ANT_BT_STATUS,*PBT_8812A_1ANT_BT_STATUS;
typedef enum _BT_8812A_1ANT_WIFI_STATUS{
BT_8812A_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8812A_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3,
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
BT_8812A_1ANT_WIFI_STATUS_MAX
}BT_8812A_1ANT_WIFI_STATUS,*PBT_8812A_1ANT_WIFI_STATUS;
typedef enum _BT_8812A_1ANT_COEX_ALGO{
BT_8812A_1ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8812A_1ANT_COEX_ALGO_SCO = 0x1,
BT_8812A_1ANT_COEX_ALGO_HID = 0x2,
BT_8812A_1ANT_COEX_ALGO_A2DP = 0x3,
BT_8812A_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8812A_1ANT_COEX_ALGO_PANEDR = 0x5,
BT_8812A_1ANT_COEX_ALGO_PANHS = 0x6,
BT_8812A_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8812A_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8812A_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8812A_1ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8812A_1ANT_COEX_ALGO_MAX = 0xb,
}BT_8812A_1ANT_COEX_ALGO,*PBT_8812A_1ANT_COEX_ALGO;
typedef struct _COEX_DM_8812A_1ANT{
// hw setting
u1Byte preAntPosType;
u1Byte curAntPosType;
// fw mechanism
BOOLEAN bCurIgnoreWlanAct;
BOOLEAN bPreIgnoreWlanAct;
u1Byte prePsTdma;
u1Byte curPsTdma;
u1Byte psTdmaPara[5];
u1Byte psTdmaDuAdjType;
BOOLEAN bAutoTdmaAdjust;
BOOLEAN bPrePsTdmaOn;
BOOLEAN bCurPsTdmaOn;
BOOLEAN bPreBtAutoReport;
BOOLEAN bCurBtAutoReport;
u1Byte preLps;
u1Byte curLps;
u1Byte preRpwm;
u1Byte curRpwm;
// sw mechanism
BOOLEAN bPreLowPenaltyRa;
BOOLEAN bCurLowPenaltyRa;
u4Byte preVal0x6c0;
u4Byte curVal0x6c0;
u4Byte preVal0x6c4;
u4Byte curVal0x6c4;
u4Byte preVal0x6c8;
u4Byte curVal0x6c8;
u1Byte preVal0x6cc;
u1Byte curVal0x6cc;
BOOLEAN bLimitedDig;
u4Byte backupArfrCnt1; // Auto Rate Fallback Retry cnt
u4Byte backupArfrCnt2; // Auto Rate Fallback Retry cnt
u2Byte backupRetryLimit;
u1Byte backupAmpduMaxTime;
// algorithm related
u1Byte preAlgorithm;
u1Byte curAlgorithm;
u1Byte btStatus;
u1Byte wifiChnlInfo[3];
u4Byte preRaMask;
u4Byte curRaMask;
u1Byte preArfrType;
u1Byte curArfrType;
u1Byte preRetryLimitType;
u1Byte curRetryLimitType;
u1Byte preAmpduTimeType;
u1Byte curAmpduTimeType;
u4Byte nArpCnt;
u1Byte errorCondition;
} COEX_DM_8812A_1ANT, *PCOEX_DM_8812A_1ANT;
typedef struct _COEX_STA_8812A_1ANT{
BOOLEAN bBtLinkExist;
BOOLEAN bScoExist;
BOOLEAN bA2dpExist;
BOOLEAN bHidExist;
BOOLEAN bPanExist;
BOOLEAN bUnderLps;
BOOLEAN bUnderIps;
u4Byte specialPktPeriodCnt;
u4Byte highPriorityTx;
u4Byte highPriorityRx;
u4Byte lowPriorityTx;
u4Byte lowPriorityRx;
s1Byte btRssi;
BOOLEAN bBtTxRxMask;
u1Byte preBtRssiState;
u1Byte preWifiRssiState[4];
BOOLEAN bC2hBtInfoReqSent;
u1Byte btInfoC2h[BT_INFO_SRC_8812A_1ANT_MAX][10];
u4Byte btInfoC2hCnt[BT_INFO_SRC_8812A_1ANT_MAX];
u4Byte btInfoQueryCnt;
BOOLEAN bC2hBtInquiryPage;
BOOLEAN bC2hBtPage; //Add for win8.1 page out issue
BOOLEAN bWiFiIsHighPriTask; //Add for win8.1 page out issue
u1Byte btRetryCnt;
u1Byte btInfoExt;
u4Byte popEventCnt;
u1Byte nScanAPNum;
u4Byte nCRCOK_CCK;
u4Byte nCRCOK_11g;
u4Byte nCRCOK_11n;
u4Byte nCRCOK_11nAgg;
u4Byte nCRCErr_CCK;
u4Byte nCRCErr_11g;
u4Byte nCRCErr_11n;
u4Byte nCRCErr_11nAgg;
BOOLEAN bCCKLock;
BOOLEAN bPreCCKLock;
u1Byte nCoexTableType;
BOOLEAN bForceLpsOn;
}COEX_STA_8812A_1ANT, *PCOEX_STA_8812A_1ANT;
//===========================================
// The following is interface which will notify coex module.
//===========================================
VOID
EXhalbtc8812a1ant_PowerOnSetting(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8812a1ant_PreLoadFirmware(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8812a1ant_InitHwConfig(
IN PBTC_COEXIST pBtCoexist,
IN BOOLEAN bWifiOnly
);
VOID
EXhalbtc8812a1ant_InitCoexDm(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8812a1ant_IpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a1ant_LpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a1ant_ScanNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a1ant_ConnectNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a1ant_MediaStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a1ant_SpecialPacketNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a1ant_BtInfoNotify(
IN PBTC_COEXIST pBtCoexist,
IN pu1Byte tmpBuf,
IN u1Byte length
);
VOID
EXhalbtc8812a1ant_RfStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a1ant_HaltNotify(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8812a1ant_PnpNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte pnpState
);
VOID
EXhalbtc8812a1ant_CoexDmReset(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8812a1ant_Periodical(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8812a1ant_DbgControl(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte opCode,
IN u1Byte opLen,
IN pu1Byte pData
);
VOID
EXhalbtc8812a1ant_DisplayCoexInfo(
IN PBTC_COEXIST pBtCoexist
);

View File

@ -1,221 +0,0 @@
//===========================================
// The following is for 8812A 2Ant BT Co-exist definition
//===========================================
#define BT_AUTO_REPORT_ONLY_8812A_2ANT 0
#define BT_INFO_8812A_2ANT_B_FTP BIT7
#define BT_INFO_8812A_2ANT_B_A2DP BIT6
#define BT_INFO_8812A_2ANT_B_HID BIT5
#define BT_INFO_8812A_2ANT_B_SCO_BUSY BIT4
#define BT_INFO_8812A_2ANT_B_ACL_BUSY BIT3
#define BT_INFO_8812A_2ANT_B_INQ_PAGE BIT2
#define BT_INFO_8812A_2ANT_B_SCO_ESCO BIT1
#define BT_INFO_8812A_2ANT_B_CONNECTION BIT0
#define BT_INFO_8812A_2ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
#define BTC_RSSI_COEX_THRESH_TOL_8812A_2ANT 2
typedef enum _BT_INFO_SRC_8812A_2ANT{
BT_INFO_SRC_8812A_2ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8812A_2ANT_BT_RSP = 0x1,
BT_INFO_SRC_8812A_2ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8812A_2ANT_MAX
}BT_INFO_SRC_8812A_2ANT,*PBT_INFO_SRC_8812A_2ANT;
typedef enum _BT_8812A_2ANT_BT_STATUS{
BT_8812A_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8812A_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8812A_2ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8812A_2ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8812A_2ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8812A_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8812A_2ANT_BT_STATUS_MAX
}BT_8812A_2ANT_BT_STATUS,*PBT_8812A_2ANT_BT_STATUS;
typedef enum _BT_8812A_2ANT_COEX_ALGO{
BT_8812A_2ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8812A_2ANT_COEX_ALGO_SCO = 0x1,
BT_8812A_2ANT_COEX_ALGO_SCO_HID = 0x2,
BT_8812A_2ANT_COEX_ALGO_HID = 0x3,
BT_8812A_2ANT_COEX_ALGO_A2DP = 0x4,
BT_8812A_2ANT_COEX_ALGO_A2DP_PANHS = 0x5,
BT_8812A_2ANT_COEX_ALGO_PANEDR = 0x6,
BT_8812A_2ANT_COEX_ALGO_PANHS = 0x7,
BT_8812A_2ANT_COEX_ALGO_PANEDR_A2DP = 0x8,
BT_8812A_2ANT_COEX_ALGO_PANEDR_HID = 0x9,
BT_8812A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0xa,
BT_8812A_2ANT_COEX_ALGO_HID_A2DP_PANHS = 0xb,
BT_8812A_2ANT_COEX_ALGO_HID_A2DP = 0xc,
BT_8812A_2ANT_COEX_ALGO_MAX = 0xd
}BT_8812A_2ANT_COEX_ALGO,*PBT_8812A_2ANT_COEX_ALGO;
typedef struct _COEX_DM_8812A_2ANT{
// fw mechanism
u1Byte preBtDecPwrLvl;
u1Byte curBtDecPwrLvl;
u1Byte preFwDacSwingLvl;
u1Byte curFwDacSwingLvl;
BOOLEAN bCurIgnoreWlanAct;
BOOLEAN bPreIgnoreWlanAct;
u1Byte prePsTdma;
u1Byte curPsTdma;
u1Byte psTdmaPara[5];
u1Byte psTdmaDuAdjType;
BOOLEAN bAutoTdmaAdjust;
BOOLEAN bAutoTdmaAdjustLowRssi;
BOOLEAN bPrePsTdmaOn;
BOOLEAN bCurPsTdmaOn;
BOOLEAN bPreBtAutoReport;
BOOLEAN bCurBtAutoReport;
u1Byte preLps;
u1Byte curLps;
u1Byte preRpwm;
u1Byte curRpwm;
// sw mechanism
BOOLEAN bPreRfRxLpfShrink;
BOOLEAN bCurRfRxLpfShrink;
u4Byte btRf0x1eBackup;
BOOLEAN bPreLowPenaltyRa;
BOOLEAN bCurLowPenaltyRa;
BOOLEAN bPreDacSwingOn;
u4Byte preDacSwingLvl;
BOOLEAN bCurDacSwingOn;
u4Byte curDacSwingLvl;
BOOLEAN bPreAdcBackOff;
BOOLEAN bCurAdcBackOff;
BOOLEAN bPreAgcTableEn;
BOOLEAN bCurAgcTableEn;
u4Byte preVal0x6c0;
u4Byte curVal0x6c0;
u4Byte preVal0x6c4;
u4Byte curVal0x6c4;
u4Byte preVal0x6c8;
u4Byte curVal0x6c8;
u1Byte preVal0x6cc;
u1Byte curVal0x6cc;
BOOLEAN bLimitedDig;
u4Byte backupArfrCnt1; // Auto Rate Fallback Retry cnt
u4Byte backupArfrCnt2; // Auto Rate Fallback Retry cnt
u2Byte backupRetryLimit;
u1Byte backupAmpduMaxTime;
// algorithm related
u1Byte preAlgorithm;
u1Byte curAlgorithm;
u1Byte btStatus;
u1Byte wifiChnlInfo[3];
u4Byte preRaMask;
u4Byte curRaMask;
u1Byte curRaMaskType;
u1Byte preArfrType;
u1Byte curArfrType;
u1Byte preRetryLimitType;
u1Byte curRetryLimitType;
u1Byte preAmpduTimeType;
u1Byte curAmpduTimeType;
} COEX_DM_8812A_2ANT, *PCOEX_DM_8812A_2ANT;
typedef struct _COEX_STA_8812A_2ANT{
BOOLEAN bBtLinkExist;
BOOLEAN bScoExist;
BOOLEAN bA2dpExist;
BOOLEAN bHidExist;
BOOLEAN bPanExist;
BOOLEAN bAclBusy;
BOOLEAN bUnderLps;
BOOLEAN bUnderIps;
u4Byte highPriorityTx;
u4Byte highPriorityRx;
u4Byte lowPriorityTx;
u4Byte lowPriorityRx;
u1Byte btRssi;
u1Byte preBtRssiState;
u1Byte preWifiRssiState[4];
BOOLEAN bC2hBtInfoReqSent;
u1Byte btInfoC2h[BT_INFO_SRC_8812A_2ANT_MAX][10];
u4Byte btInfoC2hCnt[BT_INFO_SRC_8812A_2ANT_MAX];
u4Byte prebtInfoC2hCnt_BT_RSP;
u4Byte prebtInfoC2hCnt_BT_SEND;
u4Byte btInfoQueryCnt;
BOOLEAN bC2hBtInquiryPage;
u1Byte btRetryCnt;
u1Byte btInfoExt;
}COEX_STA_8812A_2ANT, *PCOEX_STA_8812A_2ANT;
//===========================================
// The following is interface which will notify coex module.
//===========================================
VOID
EXhalbtc8812a2ant_PowerOnSetting(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8812a2ant_InitHwConfig(
IN PBTC_COEXIST pBtCoexist,
IN BOOLEAN bWifiOnly
);
VOID
EXhalbtc8812a2ant_InitCoexDm(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8812a2ant_IpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a2ant_LpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a2ant_ScanNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a2ant_ConnectNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a2ant_MediaStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a2ant_SpecialPacketNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8812a2ant_BtInfoNotify(
IN PBTC_COEXIST pBtCoexist,
IN pu1Byte tmpBuf,
IN u1Byte length
);
VOID
EXhalbtc8812a2ant_HaltNotify(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8812a2ant_Periodical(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8812a2ant_DisplayCoexInfo(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8812a2ant_DbgControl(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte opCode,
IN u1Byte opLen,
IN pu1Byte pData
);

View File

@ -1,213 +0,0 @@
//===========================================
// The following is for 8821A 1ANT BT Co-exist definition
//===========================================
#define BT_AUTO_REPORT_ONLY_8821A_1ANT 1
#define BT_INFO_8821A_1ANT_B_FTP BIT7
#define BT_INFO_8821A_1ANT_B_A2DP BIT6
#define BT_INFO_8821A_1ANT_B_HID BIT5
#define BT_INFO_8821A_1ANT_B_SCO_BUSY BIT4
#define BT_INFO_8821A_1ANT_B_ACL_BUSY BIT3
#define BT_INFO_8821A_1ANT_B_INQ_PAGE BIT2
#define BT_INFO_8821A_1ANT_B_SCO_ESCO BIT1
#define BT_INFO_8821A_1ANT_B_CONNECTION BIT0
#define BT_INFO_8821A_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
#define BTC_RSSI_COEX_THRESH_TOL_8821A_1ANT 2
typedef enum _BT_INFO_SRC_8821A_1ANT{
BT_INFO_SRC_8821A_1ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8821A_1ANT_BT_RSP = 0x1,
BT_INFO_SRC_8821A_1ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8821A_1ANT_MAX
}BT_INFO_SRC_8821A_1ANT,*PBT_INFO_SRC_8821A_1ANT;
typedef enum _BT_8821A_1ANT_BT_STATUS{
BT_8821A_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8821A_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8821A_1ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8821A_1ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8821A_1ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8821A_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8821A_1ANT_BT_STATUS_MAX
}BT_8821A_1ANT_BT_STATUS,*PBT_8821A_1ANT_BT_STATUS;
typedef enum _BT_8821A_1ANT_WIFI_STATUS{
BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3,
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
BT_8821A_1ANT_WIFI_STATUS_MAX
}BT_8821A_1ANT_WIFI_STATUS,*PBT_8821A_1ANT_WIFI_STATUS;
typedef enum _BT_8821A_1ANT_COEX_ALGO{
BT_8821A_1ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8821A_1ANT_COEX_ALGO_SCO = 0x1,
BT_8821A_1ANT_COEX_ALGO_HID = 0x2,
BT_8821A_1ANT_COEX_ALGO_A2DP = 0x3,
BT_8821A_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8821A_1ANT_COEX_ALGO_PANEDR = 0x5,
BT_8821A_1ANT_COEX_ALGO_PANHS = 0x6,
BT_8821A_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8821A_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8821A_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8821A_1ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8821A_1ANT_COEX_ALGO_MAX = 0xb,
}BT_8821A_1ANT_COEX_ALGO,*PBT_8821A_1ANT_COEX_ALGO;
typedef struct _COEX_DM_8821A_1ANT{
// fw mechanism
BOOLEAN bCurIgnoreWlanAct;
BOOLEAN bPreIgnoreWlanAct;
u1Byte prePsTdma;
u1Byte curPsTdma;
u1Byte psTdmaPara[5];
u1Byte psTdmaDuAdjType;
BOOLEAN bAutoTdmaAdjust;
BOOLEAN bPrePsTdmaOn;
BOOLEAN bCurPsTdmaOn;
BOOLEAN bPreBtAutoReport;
BOOLEAN bCurBtAutoReport;
u1Byte preLps;
u1Byte curLps;
u1Byte preRpwm;
u1Byte curRpwm;
// sw mechanism
BOOLEAN bPreLowPenaltyRa;
BOOLEAN bCurLowPenaltyRa;
u4Byte preVal0x6c0;
u4Byte curVal0x6c0;
u4Byte preVal0x6c4;
u4Byte curVal0x6c4;
u4Byte preVal0x6c8;
u4Byte curVal0x6c8;
u1Byte preVal0x6cc;
u1Byte curVal0x6cc;
u4Byte backupArfrCnt1; // Auto Rate Fallback Retry cnt
u4Byte backupArfrCnt2; // Auto Rate Fallback Retry cnt
u2Byte backupRetryLimit;
u1Byte backupAmpduMaxTime;
// algorithm related
u1Byte preAlgorithm;
u1Byte curAlgorithm;
u1Byte btStatus;
u1Byte wifiChnlInfo[3];
u4Byte preRaMask;
u4Byte curRaMask;
u1Byte preArfrType;
u1Byte curArfrType;
u1Byte preRetryLimitType;
u1Byte curRetryLimitType;
u1Byte preAmpduTimeType;
u1Byte curAmpduTimeType;
u4Byte nArpCnt;
u1Byte errorCondition;
} COEX_DM_8821A_1ANT, *PCOEX_DM_8821A_1ANT;
typedef struct _COEX_STA_8821A_1ANT{
BOOLEAN bBtLinkExist;
BOOLEAN bScoExist;
BOOLEAN bA2dpExist;
BOOLEAN bHidExist;
BOOLEAN bPanExist;
BOOLEAN bUnderLps;
BOOLEAN bUnderIps;
u4Byte specialPktPeriodCnt;
u4Byte highPriorityTx;
u4Byte highPriorityRx;
u4Byte lowPriorityTx;
u4Byte lowPriorityRx;
u1Byte btRssi;
BOOLEAN bBtTxRxMask;
u1Byte preBtRssiState;
u1Byte preWifiRssiState[4];
BOOLEAN bC2hBtInfoReqSent;
u1Byte btInfoC2h[BT_INFO_SRC_8821A_1ANT_MAX][10];
u4Byte btInfoC2hCnt[BT_INFO_SRC_8821A_1ANT_MAX];
BOOLEAN bC2hBtInquiryPage;
BOOLEAN bC2hBtPage; //Add for win8.1 page out issue
BOOLEAN bWiFiIsHighPriTask; //Add for win8.1 page out issue
u1Byte btRetryCnt;
u1Byte btInfoExt;
}COEX_STA_8821A_1ANT, *PCOEX_STA_8821A_1ANT;
//===========================================
// The following is interface which will notify coex module.
//===========================================
VOID
EXhalbtc8821a1ant_PowerOnSetting(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821a1ant_InitHwConfig(
IN PBTC_COEXIST pBtCoexist,
IN BOOLEAN bWifiOnly
);
VOID
EXhalbtc8821a1ant_InitCoexDm(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821a1ant_IpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a1ant_LpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a1ant_ScanNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a1ant_ConnectNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a1ant_MediaStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a1ant_SpecialPacketNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a1ant_BtInfoNotify(
IN PBTC_COEXIST pBtCoexist,
IN pu1Byte tmpBuf,
IN u1Byte length
);
VOID
EXhalbtc8821a1ant_HaltNotify(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821a1ant_PnpNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte pnpState
);
VOID
EXhalbtc8821a1ant_Periodical(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821a1ant_DisplayCoexInfo(
IN PBTC_COEXIST pBtCoexist
);

View File

@ -1,226 +0,0 @@
//===========================================
// The following is for 8821A 2Ant BT Co-exist definition
//===========================================
#define BT_AUTO_REPORT_ONLY_8821A_2ANT 1
#define BT_INFO_8821A_2ANT_B_FTP BIT7
#define BT_INFO_8821A_2ANT_B_A2DP BIT6
#define BT_INFO_8821A_2ANT_B_HID BIT5
#define BT_INFO_8821A_2ANT_B_SCO_BUSY BIT4
#define BT_INFO_8821A_2ANT_B_ACL_BUSY BIT3
#define BT_INFO_8821A_2ANT_B_INQ_PAGE BIT2
#define BT_INFO_8821A_2ANT_B_SCO_ESCO BIT1
#define BT_INFO_8821A_2ANT_B_CONNECTION BIT0
#define BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT 2
#define BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES 42 //WiFi RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation
#define BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES 46 //BT RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation
typedef enum _BT_INFO_SRC_8821A_2ANT{
BT_INFO_SRC_8821A_2ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8821A_2ANT_BT_RSP = 0x1,
BT_INFO_SRC_8821A_2ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8821A_2ANT_MAX
}BT_INFO_SRC_8821A_2ANT,*PBT_INFO_SRC_8821A_2ANT;
typedef enum _BT_8821A_2ANT_BT_STATUS{
BT_8821A_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8821A_2ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8821A_2ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8821A_2ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8821A_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8821A_2ANT_BT_STATUS_MAX
}BT_8821A_2ANT_BT_STATUS,*PBT_8821A_2ANT_BT_STATUS;
typedef enum _BT_8821A_2ANT_COEX_ALGO{
BT_8821A_2ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8821A_2ANT_COEX_ALGO_SCO = 0x1,
BT_8821A_2ANT_COEX_ALGO_HID = 0x2,
BT_8821A_2ANT_COEX_ALGO_A2DP = 0x3,
BT_8821A_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8821A_2ANT_COEX_ALGO_PANEDR = 0x5,
BT_8821A_2ANT_COEX_ALGO_PANHS = 0x6,
BT_8821A_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8821A_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8821A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8821A_2ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8821A_2ANT_COEX_ALGO_MAX = 0xb,
}BT_8821A_2ANT_COEX_ALGO,*PBT_8821A_2ANT_COEX_ALGO;
typedef struct _COEX_DM_8821A_2ANT{
// fw mechanism
u1Byte preBtDecPwrLvl;
u1Byte curBtDecPwrLvl;
u1Byte preFwDacSwingLvl;
u1Byte curFwDacSwingLvl;
BOOLEAN bCurIgnoreWlanAct;
BOOLEAN bPreIgnoreWlanAct;
u1Byte prePsTdma;
u1Byte curPsTdma;
u1Byte psTdmaPara[5];
u1Byte psTdmaDuAdjType;
BOOLEAN bResetTdmaAdjust;
BOOLEAN bAutoTdmaAdjust;
BOOLEAN bPrePsTdmaOn;
BOOLEAN bCurPsTdmaOn;
BOOLEAN bPreBtAutoReport;
BOOLEAN bCurBtAutoReport;
// sw mechanism
BOOLEAN bPreRfRxLpfShrink;
BOOLEAN bCurRfRxLpfShrink;
u4Byte btRf0x1eBackup;
BOOLEAN bPreLowPenaltyRa;
BOOLEAN bCurLowPenaltyRa;
BOOLEAN bPreDacSwingOn;
u4Byte preDacSwingLvl;
BOOLEAN bCurDacSwingOn;
u4Byte curDacSwingLvl;
BOOLEAN bPreAdcBackOff;
BOOLEAN bCurAdcBackOff;
BOOLEAN bPreAgcTableEn;
BOOLEAN bCurAgcTableEn;
u4Byte preVal0x6c0;
u4Byte curVal0x6c0;
u4Byte preVal0x6c4;
u4Byte curVal0x6c4;
u4Byte preVal0x6c8;
u4Byte curVal0x6c8;
u1Byte preVal0x6cc;
u1Byte curVal0x6cc;
BOOLEAN bLimitedDig;
// algorithm related
u1Byte preAlgorithm;
u1Byte curAlgorithm;
u1Byte btStatus;
u1Byte wifiChnlInfo[3];
BOOLEAN bNeedRecover0x948;
u4Byte backup0x948;
u1Byte preLps;
u1Byte curLps;
u1Byte preRpwm;
u1Byte curRpwm;
} COEX_DM_8821A_2ANT, *PCOEX_DM_8821A_2ANT;
typedef struct _COEX_STA_8821A_2ANT{
BOOLEAN bBtLinkExist;
BOOLEAN bScoExist;
BOOLEAN bA2dpExist;
BOOLEAN bHidExist;
BOOLEAN bPanExist;
BOOLEAN bUnderLps;
BOOLEAN bUnderIps;
u4Byte highPriorityTx;
u4Byte highPriorityRx;
u4Byte lowPriorityTx;
u4Byte lowPriorityRx;
u1Byte btRssi;
BOOLEAN bBtTxRxMask;
u1Byte preBtRssiState;
u1Byte preWifiRssiState[4];
BOOLEAN bC2hBtInfoReqSent;
u1Byte btInfoC2h[BT_INFO_SRC_8821A_2ANT_MAX][10];
u4Byte btInfoC2hCnt[BT_INFO_SRC_8821A_2ANT_MAX];
BOOLEAN bBtWhckTest;
BOOLEAN bC2hBtInquiryPage;
u1Byte btRetryCnt;
u1Byte btInfoExt;
u4Byte nCRCOK_CCK;
u4Byte nCRCOK_11g;
u4Byte nCRCOK_11n;
u4Byte nCRCOK_11nAgg;
u4Byte nCRCErr_CCK;
u4Byte nCRCErr_11g;
u4Byte nCRCErr_11n;
u4Byte nCRCErr_11nAgg;
u1Byte nCoexTableType;
BOOLEAN bForceLpsOn;
u1Byte disVerInfoCnt;
}COEX_STA_8821A_2ANT, *PCOEX_STA_8821A_2ANT;
//===========================================
// The following is interface which will notify coex module.
//===========================================
VOID
EXhalbtc8821a2ant_PowerOnSetting(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821a2ant_PreLoadFirmware(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821a2ant_InitHwConfig(
IN PBTC_COEXIST pBtCoexist,
IN BOOLEAN bWifiOnly
);
VOID
EXhalbtc8821a2ant_InitCoexDm(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821a2ant_IpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a2ant_LpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a2ant_ScanNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a2ant_ConnectNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a2ant_MediaStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a2ant_SpecialPacketNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821a2ant_BtInfoNotify(
IN PBTC_COEXIST pBtCoexist,
IN pu1Byte tmpBuf,
IN u1Byte length
);
VOID
EXhalbtc8821a2ant_HaltNotify(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821a2ant_PnpNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte pnpState
);
VOID
EXhalbtc8821a2ant_Periodical(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821a2ant_DisplayCoexInfo(
IN PBTC_COEXIST pBtCoexist
);

View File

@ -1,207 +0,0 @@
//===========================================
// The following is for 8821A_CSR 2Ant BT Co-exist definition
//===========================================
#define BT_INFO_8821A_CSR_2ANT_B_FTP BIT7
#define BT_INFO_8821A_CSR_2ANT_B_A2DP BIT6
#define BT_INFO_8821A_CSR_2ANT_B_HID BIT5
#define BT_INFO_8821A_CSR_2ANT_B_SCO_BUSY BIT4
#define BT_INFO_8821A_CSR_2ANT_B_ACL_BUSY BIT3
#define BT_INFO_8821A_CSR_2ANT_B_INQ_PAGE BIT2
#define BT_INFO_8821A_CSR_2ANT_B_SCO_ESCO BIT1
#define BT_INFO_8821A_CSR_2ANT_B_CONNECTION BIT0
#define BTC_RSSI_COEX_THRESH_TOL_8821A_CSR_2ANT 2
typedef enum _BT_INFO_SRC_8821A_CSR_2ANT{
BT_INFO_SRC_8821A_CSR_2ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8821A_CSR_2ANT_BT_RSP = 0x1,
BT_INFO_SRC_8821A_CSR_2ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8821A_CSR_2ANT_MAX
}BT_INFO_SRC_8821A_CSR_2ANT,*PBT_INFO_SRC_8821A_CSR_2ANT;
typedef enum _BT_8821A_CSR_2ANT_BT_STATUS{
BT_8821A_CSR_2ANT_BT_STATUS_IDLE = 0x0,
BT_8821A_CSR_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8821A_CSR_2ANT_BT_STATUS_NON_IDLE = 0x2,
BT_8821A_CSR_2ANT_BT_STATUS_MAX
}BT_8821A_CSR_2ANT_BT_STATUS,*PBT_8821A_CSR_2ANT_BT_STATUS;
typedef enum _BT_8821A_CSR_2ANT_COEX_ALGO{
BT_8821A_CSR_2ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8821A_CSR_2ANT_COEX_ALGO_SCO = 0x1,
BT_8821A_CSR_2ANT_COEX_ALGO_HID = 0x2,
BT_8821A_CSR_2ANT_COEX_ALGO_A2DP = 0x3,
BT_8821A_CSR_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR = 0x5,
BT_8821A_CSR_2ANT_COEX_ALGO_PANHS = 0x6,
BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8821A_CSR_2ANT_COEX_ALGO_MAX = 0xb,
}BT_8821A_CSR_2ANT_COEX_ALGO,*PBT_8821A_CSR_2ANT_COEX_ALGO;
typedef struct _COEX_DM_8821A_CSR_2ANT{
// fw mechanism
BOOLEAN bPreDecBtPwr;
BOOLEAN bCurDecBtPwr;
u1Byte preFwDacSwingLvl;
u1Byte curFwDacSwingLvl;
BOOLEAN bCurIgnoreWlanAct;
BOOLEAN bPreIgnoreWlanAct;
u1Byte prePsTdma;
u1Byte curPsTdma;
u1Byte psTdmaPara[6];
u1Byte psTdmaDuAdjType;
BOOLEAN bResetTdmaAdjust;
BOOLEAN bPrePsTdmaOn;
BOOLEAN bCurPsTdmaOn;
BOOLEAN bPreBtAutoReport;
BOOLEAN bCurBtAutoReport;
// sw mechanism
BOOLEAN bPreRfRxLpfShrink;
BOOLEAN bCurRfRxLpfShrink;
u4Byte btRf0x1eBackup;
BOOLEAN bPreLowPenaltyRa;
BOOLEAN bCurLowPenaltyRa;
BOOLEAN bPreDacSwingOn;
u4Byte preDacSwingLvl;
BOOLEAN bCurDacSwingOn;
u4Byte curDacSwingLvl;
BOOLEAN bPreAdcBackOff;
BOOLEAN bCurAdcBackOff;
BOOLEAN bPreAgcTableEn;
BOOLEAN bCurAgcTableEn;
u4Byte preVal0x6c0;
u4Byte curVal0x6c0;
u4Byte preVal0x6c4;
u4Byte curVal0x6c4;
u4Byte preVal0x6c8;
u4Byte curVal0x6c8;
u1Byte preVal0x6cc;
u1Byte curVal0x6cc;
BOOLEAN bLimitedDig;
u4Byte preRaMask;
u4Byte curRaMask;
u1Byte curAmpduNumType;
u1Byte preAmpduNumType;
u2Byte backupAmpduMaxNum;
u1Byte curAmpduTimeType;
u1Byte preAmpduTimeType;
u1Byte backupAmpduMaxTime;
u1Byte curArfrType;
u1Byte preArfrType;
u4Byte backupArfrCnt1;
u4Byte backupArfrCnt2;
u1Byte curRetryLimitType;
u1Byte preRetryLimitType;
u2Byte backupRetryLimit;
// algorithm related
u1Byte preAlgorithm;
u1Byte curAlgorithm;
u1Byte btStatus;
u1Byte wifiChnlInfo[3];
} COEX_DM_8821A_CSR_2ANT, *PCOEX_DM_8821A_CSR_2ANT;
typedef struct _COEX_STA_8821A_CSR_2ANT{
BOOLEAN bBtLinkExist;
BOOLEAN bScoExist;
BOOLEAN bA2dpExist;
BOOLEAN bSlave;
BOOLEAN bHidExist;
BOOLEAN bPanExist;
BOOLEAN bUnderLps;
BOOLEAN bUnderIps;
u4Byte highPriorityTx;
u4Byte highPriorityRx;
u4Byte lowPriorityTx;
u4Byte lowPriorityRx;
u1Byte btRssi;
u1Byte preBtRssiState;
u1Byte preWifiRssiState[4];
BOOLEAN bC2hBtInfoReqSent;
u1Byte btInfoC2h[BT_INFO_SRC_8821A_CSR_2ANT_MAX][10];
u4Byte btInfoC2hCnt[BT_INFO_SRC_8821A_CSR_2ANT_MAX];
BOOLEAN bC2hBtInquiryPage;
u1Byte btRetryCnt;
u1Byte btInfoExt;
}COEX_STA_8821A_CSR_2ANT, *PCOEX_STA_8821A_CSR_2ANT;
//===========================================
// The following is interface which will notify coex module.
//===========================================
VOID
EXhalbtc8821aCsr2ant_PowerOnSetting(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821aCsr2ant_InitHwConfig(
IN PBTC_COEXIST pBtCoexist,
IN BOOLEAN bWifiOnly
);
VOID
EXhalbtc8821aCsr2ant_InitCoexDm(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821aCsr2ant_IpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821aCsr2ant_LpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821aCsr2ant_ScanNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821aCsr2ant_ConnectNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821aCsr2ant_MediaStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821aCsr2ant_SpecialPacketNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8821aCsr2ant_BtInfoNotify(
IN PBTC_COEXIST pBtCoexist,
IN pu1Byte tmpBuf,
IN u1Byte length
);
VOID
EXhalbtc8821aCsr2ant_HaltNotify(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821aCsr2ant_PnpNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte pnpState
);
VOID
EXhalbtc8821aCsr2ant_Periodical(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8821aCsr2ant_DisplayCoexInfo(
IN PBTC_COEXIST pBtCoexist
);

View File

@ -1,213 +0,0 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2011 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.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*
******************************************************************************/
//============================================================
// include files
//============================================================
#include "Mp_Precomp.h"
#include "phydm_precomp.h"
u1Byte
ODM_GetAutoChannelSelectResult(
IN PVOID pDM_VOID,
IN u1Byte Band
)
{
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
PACS pACS = &pDM_Odm->DM_ACS;
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
if(Band == ODM_BAND_2_4G)
{
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("[ACS] ODM_GetAutoChannelSelectResult(): CleanChannel_2G(%d)\n", pACS->CleanChannel_2G));
return (u1Byte)pACS->CleanChannel_2G;
}
else
{
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("[ACS] ODM_GetAutoChannelSelectResult(): CleanChannel_5G(%d)\n", pACS->CleanChannel_5G));
return (u1Byte)pACS->CleanChannel_5G;
}
#else
return (u1Byte)pACS->CleanChannel_2G;
#endif
}
VOID
odm_AutoChannelSelectSetting(
IN PVOID pDM_VOID,
IN BOOLEAN IsEnable
)
{
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
u2Byte period = 0x2710;// 40ms in default
u2Byte NHMType = 0x7;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelectSetting()=========> \n"));
if(IsEnable)
{//20 ms
period = 0x1388;
NHMType = 0x1;
}
if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES)
{
//PHY parameters initialize for ac series
ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11AC+2, period); //0x990[31:16]=0x2710 Time duration for NHM unit: 4us, 0x2710=40ms
//ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC, BIT8|BIT9|BIT10, NHMType); //0x994[9:8]=3 enable CCX
}
else if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
{
//PHY parameters initialize for n series
ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11N+2, period); //0x894[31:16]=0x2710 Time duration for NHM unit: 4us, 0x2710=40ms
//ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N, BIT10|BIT9|BIT8, NHMType); //0x890[9:8]=3 enable CCX
}
#endif
}
VOID
odm_AutoChannelSelectInit(
IN PVOID pDM_VOID
)
{
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
PACS pACS = &pDM_Odm->DM_ACS;
u1Byte i;
if(!(pDM_Odm->SupportAbility & ODM_BB_NHM_CNT))
return;
if(pACS->bForceACSResult)
return;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelectInit()=========> \n"));
pACS->CleanChannel_2G = 1;
pACS->CleanChannel_5G = 36;
for (i = 0; i < ODM_MAX_CHANNEL_2G; ++i)
{
pACS->Channel_Info_2G[0][i] = 0;
pACS->Channel_Info_2G[1][i] = 0;
}
if(pDM_Odm->SupportICType & (ODM_IC_11AC_SERIES|ODM_RTL8192D))
{
for (i = 0; i < ODM_MAX_CHANNEL_5G; ++i)
{
pACS->Channel_Info_5G[0][i] = 0;
pACS->Channel_Info_5G[1][i] = 0;
}
}
#endif
}
VOID
odm_AutoChannelSelectReset(
IN PVOID pDM_VOID
)
{
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
PACS pACS = &pDM_Odm->DM_ACS;
if(!(pDM_Odm->SupportAbility & ODM_BB_NHM_CNT))
return;
if(pACS->bForceACSResult)
return;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelectReset()=========> \n"));
odm_AutoChannelSelectSetting(pDM_Odm,TRUE);// for 20ms measurement
Phydm_NHMCounterStatisticsReset(pDM_Odm);
#endif
}
VOID
odm_AutoChannelSelect(
IN PVOID pDM_VOID,
IN u1Byte Channel
)
{
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
PACS pACS = &pDM_Odm->DM_ACS;
u1Byte ChannelIDX = 0, SearchIDX = 0;
u2Byte MaxScore=0;
if(!(pDM_Odm->SupportAbility & ODM_BB_NHM_CNT))
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Return: SupportAbility ODM_BB_NHM_CNT is disabled\n"));
return;
}
if(pACS->bForceACSResult)
{
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Force 2G clean channel = %d, 5G clean channel = %d\n",
pACS->CleanChannel_2G, pACS->CleanChannel_5G));
return;
}
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Channel = %d=========> \n", Channel));
Phydm_GetNHMCounterStatistics(pDM_Odm);
odm_AutoChannelSelectSetting(pDM_Odm,FALSE);
if(Channel >=1 && Channel <=14)
{
ChannelIDX = Channel - 1;
pACS->Channel_Info_2G[1][ChannelIDX]++;
if(pACS->Channel_Info_2G[1][ChannelIDX] >= 2)
pACS->Channel_Info_2G[0][ChannelIDX] = (pACS->Channel_Info_2G[0][ChannelIDX] >> 1) +
(pACS->Channel_Info_2G[0][ChannelIDX] >> 2) + (pDM_Odm->NHM_cnt_0>>2);
else
pACS->Channel_Info_2G[0][ChannelIDX] = pDM_Odm->NHM_cnt_0;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): NHM_cnt_0 = %d \n", pDM_Odm->NHM_cnt_0));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Channel_Info[0][%d] = %d, Channel_Info[1][%d] = %d\n", ChannelIDX, pACS->Channel_Info_2G[0][ChannelIDX], ChannelIDX, pACS->Channel_Info_2G[1][ChannelIDX]));
for(SearchIDX = 0; SearchIDX < ODM_MAX_CHANNEL_2G; SearchIDX++)
{
if(pACS->Channel_Info_2G[1][SearchIDX] != 0)
{
if(pACS->Channel_Info_2G[0][SearchIDX] >= MaxScore)
{
MaxScore = pACS->Channel_Info_2G[0][SearchIDX];
pACS->CleanChannel_2G = SearchIDX+1;
}
}
}
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("(1)odm_AutoChannelSelect(): 2G: CleanChannel_2G = %d, MaxScore = %d \n",
pACS->CleanChannel_2G, MaxScore));
}
else if(Channel >= 36)
{
// Need to do
pACS->CleanChannel_5G = Channel;
}
#endif
}

View File

@ -1,305 +0,0 @@
#ifndef __INC_BEAMFORMING_H
#define __INC_BEAMFORMING_H
#ifndef BEAMFORMING_SUPPORT
#define BEAMFORMING_SUPPORT 0
#endif
#if (BEAMFORMING_SUPPORT == 1)
/*Beamforming Related*/
#include "TXBF/HalComTxbf.h"
#include "TXBF/HalTxbfJaguar.h"
#include "TXBF/HalTxbf8192E.h"
#include "TXBF/HalTxbf8814A.h"
#include "TXBF/HalTxbf8821B.h"
#define BEAMFORMEE_ENTRY_NUM 2
#define BEAMFORMER_ENTRY_NUM 2
#define GET_BEAMFORM_INFO(_pAdapter) ((PRT_BEAMFORMING_INFO)(&(((HAL_DATA_TYPE *)((_pAdapter)->HalData))->DM_OutSrc.BeamformingInfo)))
typedef enum _BEAMFORMING_ENTRY_STATE
{
BEAMFORMING_ENTRY_STATE_UNINITIALIZE,
BEAMFORMING_ENTRY_STATE_INITIALIZEING,
BEAMFORMING_ENTRY_STATE_INITIALIZED,
BEAMFORMING_ENTRY_STATE_PROGRESSING,
BEAMFORMING_ENTRY_STATE_PROGRESSED,
}BEAMFORMING_ENTRY_STATE, *PBEAMFORMING_ENTRY_STATE;
typedef enum _BEAMFORMING_STATE
{
BEAMFORMING_STATE_END,
BEAMFORMING_STATE_START_1BFee,
BEAMFORMING_STATE_START_2BFee
}BEAMFORMING_STATE, *PBEAMFORMING_STATE;
typedef enum _BEAMFORMING_NOTIFY_STATE
{
BEAMFORMING_NOTIFY_NONE,
BEAMFORMING_NOTIFY_ADD,
BEAMFORMING_NOTIFY_DELETE,
BEAMFORMING_NOTIFY_RESET
} BEAMFORMING_NOTIFY_STATE, *PBEAMFORMING_NOTIFY_STATE;
typedef enum _BEAMFORMING_CAP
{
BEAMFORMING_CAP_NONE = 0x0,
BEAMFORMER_CAP_HT_EXPLICIT = 0x1,
BEAMFORMEE_CAP_HT_EXPLICIT = 0x2,
BEAMFORMER_CAP_VHT_SU = 0x4, // Self has er Cap, because Reg er & peer ee
BEAMFORMEE_CAP_VHT_SU = 0x8, // Self has ee Cap, because Reg ee & peer er
BEAMFORMER_CAP = 0x10,
BEAMFORMEE_CAP = 0x20,
}BEAMFORMING_CAP, *PBEAMFORMING_CAP;
typedef enum _SOUNDING_MODE
{
SOUNDING_SW_VHT_TIMER = 0x0,
SOUNDING_SW_HT_TIMER = 0x1,
SOUNDING_STOP_All_TIMER = 0x2,
SOUNDING_HW_VHT_TIMER = 0x3,
SOUNDING_HW_HT_TIMER = 0x4,
SOUNDING_STOP_OID_TIMER = 0x5,
SOUNDING_AUTO_VHT_TIMER = 0x6,
SOUNDING_AUTO_HT_TIMER = 0x7,
SOUNDING_FW_VHT_TIMER = 0x8,
SOUNDING_FW_HT_TIMER = 0x9,
}SOUNDING_MODE, *PSOUNDING_MODE;
typedef struct _RT_BEAMFORMING_ENTRY {
BOOLEAN bUsed;
BOOLEAN bTxBF;
BOOLEAN bSound;
u2Byte AID; // Used to construct AID field of NDPA packet.
u2Byte MacId; // Used to Set Reg42C in IBSS mode.
u2Byte P_AID; // Used to fill Reg42C & Reg714 to compare with P_AID of Tx DESC.
u1Byte MacAddr[6]; // Used to fill Reg6E4 to fill Mac address of CSI report frame.
CHANNEL_WIDTH SoundBW; // Sounding BandWidth
u2Byte SoundPeriod;
BEAMFORMING_CAP BeamformEntryCap;
BEAMFORMING_ENTRY_STATE BeamformEntryState;
BOOLEAN bBeamformingInProgress;
// u1Byte LogSeq; // Move to _RT_BEAMFORMER_ENTRY
// u2Byte LogRetryCnt:3; // 0~4 // Move to _RT_BEAMFORMER_ENTRY
// u2Byte LogSuccessCnt:2; // 0~2 // Move to _RT_BEAMFORMER_ENTRY
u2Byte LogStatusFailCnt:5; // 0~21
u2Byte DefaultCSICnt:5; // 0~21
u1Byte CSIMatrix[327];
u2Byte CSIMatrixLen;
u1Byte NumofSoundingDim;
u1Byte CompSteeringNumofBFer;
} RT_BEAMFORMING_ENTRY, *PRT_BEAMFORMING_ENTRY;
typedef struct _RT_BEAMFORMER_ENTRY {
BOOLEAN bUsed;
// P_AID of BFer entry is probably not used
u2Byte P_AID; // Used to fill Reg42C & Reg714 to compare with P_AID of Tx DESC.
u1Byte MacAddr[6];
BEAMFORMING_CAP BeamformEntryCap;
u1Byte NumofSoundingDim;
u1Byte LogSeq; // Modified by Jeffery @2014-10-29
u2Byte LogRetryCnt:3; // 0~4 // Modified by Jeffery @2014-10-29
u2Byte LogSuccessCnt:2; // 0~2 // Modified by Jeffery @2014-10-29
} RT_BEAMFORMER_ENTRY, *PRT_BEAMFORMER_ENTRY;
typedef struct _RT_SOUNDING_INFO {
u1Byte SoundIdx;
CHANNEL_WIDTH SoundBW;
SOUNDING_MODE SoundMode;
u2Byte SoundPeriod;
} RT_SOUNDING_INFO, *PRT_SOUNDING_INFO;
typedef struct _RT_BEAMFORMING_OID_INFO {
u1Byte SoundOidIdx;
CHANNEL_WIDTH SoundOidBW;
SOUNDING_MODE SoundOidMode;
u2Byte SoundOidPeriod;
} RT_BEAMFORMING_OID_INFO, *PRT_BEAMFORMING_OID_INFO;
typedef struct _RT_BEAMFORMING_INFO {
BEAMFORMING_CAP BeamformCap;
BEAMFORMING_STATE BeamformState;
RT_BEAMFORMING_ENTRY BeamformeeEntry[BEAMFORMEE_ENTRY_NUM];
RT_BEAMFORMER_ENTRY BeamformerEntry[BEAMFORMER_ENTRY_NUM];
u1Byte BeamformeeCurIdx;
RT_TIMER BeamformingTimer;
RT_SOUNDING_INFO SoundingInfo;
RT_BEAMFORMING_OID_INFO BeamformingOidInfo;
HAL_TXBF_INFO TxbfInfo;
} RT_BEAMFORMING_INFO, *PRT_BEAMFORMING_INFO;
typedef struct _RT_NDPA_STA_INFO {
u2Byte AID:12;
u2Byte FeedbackType:1;
u2Byte NcIndex:3;
} RT_NDPA_STA_INFO, *PRT_NDPA_STA_INFO;
BEAMFORMING_CAP
phydm_Beamforming_GetEntryBeamCapByMacId(
IN PVOID pDM_VOID,
IN u1Byte MacId
);
VOID
Beamforming_GidPAid(
PADAPTER Adapter,
PRT_TCB pTcb
);
BOOLEAN
Beamforming_SendHTNDPAPacket(
IN PADAPTER Adapter,
IN pu1Byte RA,
IN CHANNEL_WIDTH BW,
IN u1Byte QIdx
);
BOOLEAN
Beamforming_SendVHTNDPAPacket(
IN PADAPTER Adapter,
IN pu1Byte RA,
IN u2Byte AID,
IN CHANNEL_WIDTH BW,
IN u1Byte QIdx
);
VOID
phydm_Beamforming_Notify(
IN PVOID pDM_VOID
);
VOID
Beamforming_Enter(
PADAPTER Adapter,
PRT_WLAN_STA pSTA
);
VOID
Beamforming_Leave(
PADAPTER Adapter,
pu1Byte RA
);
BOOLEAN
BeamformingStart_FW(
PADAPTER Adapter,
u1Byte Idx
);
VOID
Beamforming_CheckSoundingSuccess(
PADAPTER Adapter,
BOOLEAN Status
);
VOID
phydm_Beamforming_End_SW(
IN PVOID pDM_VOID,
BOOLEAN Status
);
VOID
phydm_Beamforming_End_FW(
IN PVOID pDM_VOID
);
VOID
Beamforming_TimerCallback(
PADAPTER Adapter
);
VOID
phydm_Beamforming_Init(
IN PVOID pDM_VOID
);
BEAMFORMING_CAP
phydm_Beamforming_GetBeamCap(
IN PVOID pDM_VOID,
IN PRT_BEAMFORMING_INFO pBeamInfo
);
BOOLEAN
BeamformingControl_V1(
PADAPTER Adapter,
pu1Byte RA,
u1Byte AID,
u1Byte Mode,
CHANNEL_WIDTH BW,
u1Byte Rate
);
BOOLEAN
phydm_BeamformingControl_V2(
IN PVOID pDM_VOID,
u1Byte Idx,
u1Byte Mode,
CHANNEL_WIDTH BW,
u2Byte Period
);
BOOLEAN
BeamformingControl_V3(
PADAPTER Adapter,
u1Byte Threshold,
u2Byte Period
);
VOID
phydm_Beamforming_Watchdog(
IN PVOID pDM_VOID
);
VOID
Beamforming_SWTimerCallback(
PRT_TIMER pTimer
);
#else
#define Beamforming_GidPAid(Adapter, pTcb)
#define Beamforming_Enter(Adapter, pSTA)
#define Beamforming_Leave(Adapter, RA)
#define Beamforming_End_SW(Adapter, Status)
#define Beamforming_End_FW(Adapter)
#define Beamforming_Init(Adapter)
#define Beamforming_Release(Adapter)
#define BeamformingControl_V1(Adapter, RA, AID, Mode, BW, Rate) (TRUE)
#define BeamformingControl_V2(Adapter, Idx, Mode, BW, Period) (TRUE)
#define Beamforming_TimerCallback(Adapter)
#define Beamforming_Watchdog(Adapter)
#endif
RT_STATUS
Beamforming_GetReportFrame(
IN PADAPTER Adapter,
IN PRT_RFD pRfd,
IN POCTET_STRING pPduOS
);
VOID
Beamforming_GetNDPAFrame(
IN PADAPTER Adapter,
IN OCTET_STRING pduOS
);
#endif

View File

@ -1,248 +0,0 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2011 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.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*
******************************************************************************/
#ifndef __ODM_PRECOMP_H__
#define __ODM_PRECOMP_H__
#include "phydm_types.h"
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
#include "Precomp.h" // We need to include mp_precomp.h due to batch file setting.
#else
#define TEST_FALG___ 1
#endif
#if (DM_ODM_SUPPORT_TYPE ==ODM_CE)
#define RTL8192CE_SUPPORT 0
#define RTL8192CU_SUPPORT 0
#define RTL8192C_SUPPORT 0
#define RTL8192DE_SUPPORT 0
#define RTL8192DU_SUPPORT 0
#define RTL8192D_SUPPORT 0
#define RTL8723AU_SUPPORT 0
#define RTL8723AS_SUPPORT 0
#define RTL8723AE_SUPPORT 0
#define RTL8723A_SUPPORT 0
#define RTL8723_FPGA_VERIFICATION 0
#endif
//2 Config Flags and Structs - defined by each ODM Type
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
#include "../8192cd_cfg.h"
#include "../odm_inc.h"
#include "../8192cd.h"
#include "../8192cd_util.h"
#ifdef _BIG_ENDIAN_
#define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
#else
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
#endif
#ifdef AP_BUILD_WORKAROUND
#include "../8192cd_headers.h"
#include "../8192cd_debug.h"
#endif
#elif (DM_ODM_SUPPORT_TYPE ==ODM_CE)
#define BEAMFORMING_SUPPORT 0
#define __PACK
#define __WLAN_ATTRIB_PACK__
#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)
#include "Mp_Precomp.h"
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
#define __PACK
#define __WLAN_ATTRIB_PACK__
#endif
//2 OutSrc Header Files
#include "phydm.h"
#include "phydm_HWConfig.h"
#include "phydm_debug.h"
#include "phydm_RegDefine11AC.h"
#include "phydm_RegDefine11N.h"
#include "phydm_interface.h"
#include "phydm_reg.h"
#include "HalPhyRf.h"
#if (DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_AP))
#define RTL8821B_SUPPORT 0
#define RTL8822B_SUPPORT 0
#define RTL8703B_SUPPORT 0
#define RTL8188F_SUPPORT 0
#endif
#if (RTL8188E_SUPPORT==1)
#include "rtl8188e/Hal8188ERateAdaptive.h"//for RA,Power training
#include "rtl8188e/HalHWImg8188E_MAC.h"
#include "rtl8188e/HalHWImg8188E_RF.h"
#include "rtl8188e/HalHWImg8188E_BB.h"
#include "rtl8188e/HalHWImg8188E_FW.h"
#include "rtl8188e/phydm_RegConfig8188E.h"
#include "rtl8188e/phydm_RTL8188E.h"
#include "rtl8188e/HalPhyRf_8188e.h"
#include "rtl8188e/Hal8188EReg.h"
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
#include "rtl8188e_hal.h"
#endif
#endif //88E END
#if (RTL8192E_SUPPORT==1)
#include "rtl8192e/HalPhyRf_8192e.h" //FOR_8192E_IQK
#include "rtl8192e/phydm_RTL8192E.h" //FOR_8192E_IQK
#if (DM_ODM_SUPPORT_TYPE != ODM_AP)
#include "rtl8192e/HalHWImg8192E_BB.h"
#include "rtl8192e/HalHWImg8192E_MAC.h"
#include "rtl8192e/HalHWImg8192E_RF.h"
#include "rtl8192e/phydm_RegConfig8192E.h"
#include "rtl8192e/HalHWImg8192E_FW.h"
#include "rtl8192e/Hal8192EReg.h"
#endif
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
#include "rtl8192e_hal.h"
#endif
#endif //92E END
#if (RTL8812A_SUPPORT==1)
#include "rtl8812a/HalPhyRf_8812A.h" //FOR_8812_IQK
#if (DM_ODM_SUPPORT_TYPE != ODM_AP)
#include "rtl8812a/HalHWImg8812A_BB.h"
#include "rtl8812a/HalHWImg8812A_MAC.h"
#include "rtl8812a/HalHWImg8812A_RF.h"
#include "rtl8812a/phydm_RegConfig8812A.h"
#include "rtl8812a/HalHWImg8812A_FW.h"
#include "rtl8812a/phydm_RTL8812A.h"
#endif
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
#include "rtl8812a_hal.h"
#endif
#endif //8812 END
#if (RTL8814A_SUPPORT==1)
#include "rtl8814a/HalPhyRf_8814A.h"
#include "rtl8814a/HalHWImg8814A_MAC.h"
#include "rtl8814a/HalHWImg8814A_RF.h"
#include "rtl8814a/HalHWImg8814A_BB.h"
#if (DM_ODM_SUPPORT_TYPE != ODM_AP)
#include "rtl8814a/HalHWImg8814A_FW.h"
#include "rtl8814a/phydm_RTL8814A.h"
#endif
#include "rtl8814a/phydm_RegConfig8814A.h"
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
#include "rtl8814a_hal.h"
#include "rtl8814a/PhyDM_IQK_8814A.h"
#endif
#endif //8814 END
#if (RTL8881A_SUPPORT==1)//FOR_8881_IQK
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
#include "rtl8821a/PhyDM_IQK_8821A_WIN.h"
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
#include "rtl8821a/PhyDM_IQK_8821A_CE.h"
#else
#include "rtl8821a/PhyDM_IQK_8821A_AP.h"
#endif
//#include "rtl8881a/HalHWImg8881A_BB.h"
//#include "rtl8881a/HalHWImg8881A_MAC.h"
//#include "rtl8881a/HalHWImg8881A_RF.h"
//#include "rtl8881a/odm_RegConfig8881A.h"
#endif
#if (RTL8723B_SUPPORT==1)
#include "rtl8723b/HalHWImg8723B_MAC.h"
#include "rtl8723b/HalHWImg8723B_RF.h"
#include "rtl8723b/HalHWImg8723B_BB.h"
#include "rtl8723b/HalHWImg8723B_FW.h"
#include "rtl8723b/phydm_RegConfig8723B.h"
#include "rtl8723b/phydm_RTL8723B.h"
#include "rtl8723b/HalPhyRf_8723B.h"
#include "rtl8723b/Hal8723BReg.h"
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
#include "rtl8723b/HalHWImg8723B_MP.h"
#include "rtl8723b_hal.h"
#endif
#endif
#if (RTL8821A_SUPPORT==1)
#include "rtl8821a/HalHWImg8821A_MAC.h"
#include "rtl8821a/HalHWImg8821A_RF.h"
#include "rtl8821a/HalHWImg8821A_BB.h"
#include "rtl8821a/HalHWImg8821A_FW.h"
#include "rtl8821a/phydm_RegConfig8821A.h"
#include "rtl8821a/phydm_RTL8821A.h"
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
#include "rtl8821a/HalPhyRf_8821A_WIN.h"
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
#include "rtl8821a/HalPhyRf_8821A_CE.h"
#include "rtl8821a/PhyDM_IQK_8821A_CE.h"/*for IQK*/
#include "rtl8812a/HalPhyRf_8812A.h"/*for IQK,LCK,Power-tracking*/
#include "rtl8812a_hal.h"
#else
#endif
#endif
#if (RTL8821B_SUPPORT==1)
#include "rtl8821b/HalHWImg8821B_MAC.h"
#include "rtl8821b/HalHWImg8821B_RF.h"
#include "rtl8821b/HalHWImg8821B_BB.h"
#include "rtl8821b/HalHWImg8821B_FW.h"
#include "rtl8821b/phydm_RegConfig8821B.h"
#include "rtl8821b/HalHWImg8821B_TestChip_MAC.h"
#include "rtl8821b/HalHWImg8821B_TestChip_RF.h"
#include "rtl8821b/HalHWImg8821B_TestChip_BB.h"
#include "rtl8821b/HalHWImg8821B_TestChip_FW.h"
#include "rtl8821b/HalPhyRf_8821B.h"
#endif
#if (RTL8822B_SUPPORT==1)
#include "rtl8822B/HalHWImg8822B_MAC.h"
#include "rtl8822B/HalHWImg8822B_RF.h"
#include "rtl8822B/HalHWImg8822B_BB.h"
#include "rtl8822B/HalHWImg8822B_FW.h"
#include "rtl8822B/phydm_RegConfig8822B.h"
#include "rtl8822B/HalHWImg8822B_TestChip_MAC.h"
#include "rtl8822B/HalHWImg8822B_TestChip_RF.h"
#include "rtl8822B/HalHWImg8822B_TestChip_BB.h"
#include "rtl8822B/HalHWImg8822B_TestChip_FW.h"
#include "rtl8822b/HalPhyRf_8822B.h"
#endif
#if (RTL8703B_SUPPORT==1)
#include "rtl8703b/phydm_RegConfig8703B.h"
#include "rtl8703b/HalHWImg8703B_TestChip_MAC.h"
#include "rtl8703b/HalHWImg8703B_TestChip_RF.h"
#include "rtl8703b/HalHWImg8703B_TestChip_BB.h"
#include "rtl8703b/HalHWImg8703B_FW.h"
#endif
#if (RTL8188F_SUPPORT==1)
#include "rtl8188f/phydm_RegConfig8188F.h"
#include "rtl8188f/HalHWImg8188F_TestChip_MAC.h"
#include "rtl8188f/HalHWImg8188F_TestChip_RF.h"
#include "rtl8188f/HalHWImg8188F_TestChip_BB.h"
#include "rtl8188f/HalHWImg8188F_FW.h"
#endif
#endif // __ODM_PRECOMP_H__

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,226 @@
#if (BT_SUPPORT == 1 && COEX_SUPPORT == 1)
#if (RTL8192E_SUPPORT == 1)
/* *******************************************
* The following is for 8192E 1ANT BT Co-exist definition
* ******************************************* */
#define BT_AUTO_REPORT_ONLY_8192E_1ANT 1
#define BT_INFO_8192E_1ANT_B_FTP BIT(7)
#define BT_INFO_8192E_1ANT_B_A2DP BIT(6)
#define BT_INFO_8192E_1ANT_B_HID BIT(5)
#define BT_INFO_8192E_1ANT_B_SCO_BUSY BIT(4)
#define BT_INFO_8192E_1ANT_B_ACL_BUSY BIT(3)
#define BT_INFO_8192E_1ANT_B_INQ_PAGE BIT(2)
#define BT_INFO_8192E_1ANT_B_SCO_ESCO BIT(1)
#define BT_INFO_8192E_1ANT_B_CONNECTION BIT(0)
#define BT_INFO_8192E_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT(0))) ? true : false)
#define BTC_RSSI_COEX_THRESH_TOL_8192E_1ANT 2
#define BT_8192E_1ANT_WIFI_NOISY_THRESH 30 /* max: 255 */
enum bt_info_src_8192e_1ant {
BT_INFO_SRC_8192E_1ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8192E_1ANT_BT_RSP = 0x1,
BT_INFO_SRC_8192E_1ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8192E_1ANT_MAX
};
enum bt_8192e_1ant_bt_status {
BT_8192E_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8192E_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8192E_1ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8192E_1ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8192E_1ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8192E_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8192E_1ANT_BT_STATUS_MAX
};
enum bt_8192e_1ant_wifi_status {
BT_8192E_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8192E_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_SPECIFIC_PKT = 0x3,
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
BT_8192E_1ANT_WIFI_STATUS_MAX
};
enum bt_8192e_1ant_coex_algo {
BT_8192E_1ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8192E_1ANT_COEX_ALGO_SCO = 0x1,
BT_8192E_1ANT_COEX_ALGO_HID = 0x2,
BT_8192E_1ANT_COEX_ALGO_A2DP = 0x3,
BT_8192E_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8192E_1ANT_COEX_ALGO_PANEDR = 0x5,
BT_8192E_1ANT_COEX_ALGO_PANHS = 0x6,
BT_8192E_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8192E_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8192E_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8192E_1ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8192E_1ANT_COEX_ALGO_MAX = 0xb,
};
struct coex_dm_8192e_1ant {
/* fw mechanism */
boolean cur_ignore_wlan_act;
boolean pre_ignore_wlan_act;
u8 pre_ps_tdma;
u8 cur_ps_tdma;
u8 ps_tdma_para[5];
u8 ps_tdma_du_adj_type;
boolean auto_tdma_adjust;
boolean pre_ps_tdma_on;
boolean cur_ps_tdma_on;
boolean pre_bt_auto_report;
boolean cur_bt_auto_report;
u8 pre_lps;
u8 cur_lps;
u8 pre_rpwm;
u8 cur_rpwm;
/* sw mechanism */
boolean pre_low_penalty_ra;
boolean cur_low_penalty_ra;
u32 pre_val0x6c0;
u32 cur_val0x6c0;
u32 pre_val0x6c4;
u32 cur_val0x6c4;
u32 pre_val0x6c8;
u32 cur_val0x6c8;
u8 pre_val0x6cc;
u8 cur_val0x6cc;
boolean limited_dig;
u32 backup_arfr_cnt1; /* Auto Rate Fallback Retry cnt */
u32 backup_arfr_cnt2; /* Auto Rate Fallback Retry cnt */
u16 backup_retry_limit;
u8 backup_ampdu_max_time;
/* algorithm related */
u8 pre_algorithm;
u8 cur_algorithm;
u8 bt_status;
u8 wifi_chnl_info[3];
u32 pre_ra_mask;
u32 cur_ra_mask;
u8 pre_arfr_type;
u8 cur_arfr_type;
u8 pre_retry_limit_type;
u8 cur_retry_limit_type;
u8 pre_ampdu_time_type;
u8 cur_ampdu_time_type;
u32 arp_cnt;
u8 error_condition;
};
struct coex_sta_8192e_1ant {
boolean bt_disabled;
boolean bt_link_exist;
boolean sco_exist;
boolean a2dp_exist;
boolean hid_exist;
boolean pan_exist;
boolean under_lps;
boolean under_ips;
u32 specific_pkt_period_cnt;
u32 high_priority_tx;
u32 high_priority_rx;
u32 low_priority_tx;
u32 low_priority_rx;
s8 bt_rssi;
boolean bt_tx_rx_mask;
u8 pre_bt_rssi_state;
u8 pre_wifi_rssi_state[4];
boolean c2h_bt_info_req_sent;
u8 bt_info_c2h[BT_INFO_SRC_8192E_1ANT_MAX][10];
u32 bt_info_c2h_cnt[BT_INFO_SRC_8192E_1ANT_MAX];
boolean c2h_bt_inquiry_page;
boolean c2h_bt_page; /* Add for win8.1 page out issue */
boolean wifi_is_high_pri_task; /* Add for win8.1 page out issue */
u8 bt_retry_cnt;
u8 bt_info_ext;
u32 pop_event_cnt;
u8 scan_ap_num;
u32 crc_ok_cck;
u32 crc_ok_11g;
u32 crc_ok_11n;
u32 crc_ok_11n_agg;
u32 crc_err_cck;
u32 crc_err_11g;
u32 crc_err_11n;
u32 crc_err_11n_agg;
boolean cck_lock;
boolean pre_ccklock;
u8 coex_table_type;
boolean force_lps_on;
};
/* *******************************************
* The following is interface which will notify coex module.
* ******************************************* */
void ex_halbtc8192e1ant_power_on_setting(IN struct btc_coexist *btcoexist);
void ex_halbtc8192e1ant_pre_load_firmware(IN struct btc_coexist *btcoexist);
void ex_halbtc8192e1ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only);
void ex_halbtc8192e1ant_init_coex_dm(IN struct btc_coexist *btcoexist);
void ex_halbtc8192e1ant_ips_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e1ant_lps_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e1ant_scan_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e1ant_connect_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e1ant_media_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e1ant_specific_packet_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e1ant_bt_info_notify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length);
void ex_halbtc8192e1ant_rf_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e1ant_halt_notify(IN struct btc_coexist *btcoexist);
void ex_halbtc8192e1ant_pnp_notify(IN struct btc_coexist *btcoexist,
IN u8 pnp_state);
void ex_halbtc8192e1ant_coex_dm_reset(IN struct btc_coexist *btcoexist);
void ex_halbtc8192e1ant_periodical(IN struct btc_coexist *btcoexist);
void ex_halbtc8192e1ant_display_coex_info(IN struct btc_coexist *btcoexist);
void ex_halbtc8192e1ant_dbg_control(IN struct btc_coexist *btcoexist,
IN u8 op_code, IN u8 op_len, IN u8 *pdata);
#else /* #if (RTL8192E_SUPPORT == 1) */
#define ex_halbtc8192e1ant_power_on_setting(btcoexist)
#define ex_halbtc8192e1ant_pre_load_firmware(btcoexist)
#define ex_halbtc8192e1ant_init_hw_config(btcoexist, wifi_only)
#define ex_halbtc8192e1ant_init_coex_dm(btcoexist)
#define ex_halbtc8192e1ant_ips_notify(btcoexist, type)
#define ex_halbtc8192e1ant_lps_notify(btcoexist, type)
#define ex_halbtc8192e1ant_scan_notify(btcoexist, type)
#define ex_halbtc8192e1ant_connect_notify(btcoexist, type)
#define ex_halbtc8192e1ant_media_status_notify(btcoexist, type)
#define ex_halbtc8192e1ant_specific_packet_notify(btcoexist, type)
#define ex_halbtc8192e1ant_bt_info_notify(btcoexist, tmp_buf, length)
#define ex_halbtc8192e1ant_rf_status_notify(btcoexist, type)
#define ex_halbtc8192e1ant_halt_notify(btcoexist)
#define ex_halbtc8192e1ant_pnp_notify(btcoexist, pnp_state)
#define ex_halbtc8192e1ant_coex_dm_reset(btcoexist)
#define ex_halbtc8192e1ant_periodical(btcoexist)
#define ex_halbtc8192e1ant_display_coex_info(btcoexist)
#define ex_halbtc8192e1ant_dbg_control(btcoexist, op_code, op_len, pdata)
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,190 @@
#if (BT_SUPPORT == 1 && COEX_SUPPORT == 1)
#if (RTL8192E_SUPPORT == 1)
/* *******************************************
* The following is for 8192E 2Ant BT Co-exist definition
* ******************************************* */
#define BT_AUTO_REPORT_ONLY_8192E_2ANT 0
#define BT_INFO_8192E_2ANT_B_FTP BIT(7)
#define BT_INFO_8192E_2ANT_B_A2DP BIT(6)
#define BT_INFO_8192E_2ANT_B_HID BIT(5)
#define BT_INFO_8192E_2ANT_B_SCO_BUSY BIT(4)
#define BT_INFO_8192E_2ANT_B_ACL_BUSY BIT(3)
#define BT_INFO_8192E_2ANT_B_INQ_PAGE BIT(2)
#define BT_INFO_8192E_2ANT_B_SCO_ESCO BIT(1)
#define BT_INFO_8192E_2ANT_B_CONNECTION BIT(0)
#define BTC_RSSI_COEX_THRESH_TOL_8192E_2ANT 2
enum bt_info_src_8192e_2ant {
BT_INFO_SRC_8192E_2ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8192E_2ANT_BT_RSP = 0x1,
BT_INFO_SRC_8192E_2ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8192E_2ANT_MAX
};
enum bt_8192e_2ant_bt_status {
BT_8192E_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8192E_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8192E_2ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8192E_2ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8192E_2ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8192E_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8192E_2ANT_BT_STATUS_MAX
};
enum bt_8192e_2ant_coex_algo {
BT_8192E_2ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8192E_2ANT_COEX_ALGO_SCO = 0x1,
BT_8192E_2ANT_COEX_ALGO_SCO_PAN = 0x2,
BT_8192E_2ANT_COEX_ALGO_HID = 0x3,
BT_8192E_2ANT_COEX_ALGO_A2DP = 0x4,
BT_8192E_2ANT_COEX_ALGO_A2DP_PANHS = 0x5,
BT_8192E_2ANT_COEX_ALGO_PANEDR = 0x6,
BT_8192E_2ANT_COEX_ALGO_PANHS = 0x7,
BT_8192E_2ANT_COEX_ALGO_PANEDR_A2DP = 0x8,
BT_8192E_2ANT_COEX_ALGO_PANEDR_HID = 0x9,
BT_8192E_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0xa,
BT_8192E_2ANT_COEX_ALGO_HID_A2DP = 0xb,
BT_8192E_2ANT_COEX_ALGO_MAX = 0xc
};
struct coex_dm_8192e_2ant {
/* fw mechanism */
u8 pre_bt_dec_pwr_lvl;
u8 cur_bt_dec_pwr_lvl;
u8 pre_fw_dac_swing_lvl;
u8 cur_fw_dac_swing_lvl;
boolean cur_ignore_wlan_act;
boolean pre_ignore_wlan_act;
u8 pre_ps_tdma;
u8 cur_ps_tdma;
u8 ps_tdma_para[5];
u8 ps_tdma_du_adj_type;
boolean reset_tdma_adjust;
boolean auto_tdma_adjust;
boolean pre_ps_tdma_on;
boolean cur_ps_tdma_on;
boolean pre_bt_auto_report;
boolean cur_bt_auto_report;
/* sw mechanism */
boolean pre_rf_rx_lpf_shrink;
boolean cur_rf_rx_lpf_shrink;
u32 bt_rf_0x1e_backup;
boolean pre_low_penalty_ra;
boolean cur_low_penalty_ra;
boolean pre_dac_swing_on;
u32 pre_dac_swing_lvl;
boolean cur_dac_swing_on;
u32 cur_dac_swing_lvl;
boolean pre_adc_back_off;
boolean cur_adc_back_off;
boolean pre_agc_table_en;
boolean cur_agc_table_en;
u32 pre_val0x6c0;
u32 cur_val0x6c0;
u32 pre_val0x6c4;
u32 cur_val0x6c4;
u32 pre_val0x6c8;
u32 cur_val0x6c8;
u8 pre_val0x6cc;
u8 cur_val0x6cc;
boolean limited_dig;
u32 backup_arfr_cnt1; /* Auto Rate Fallback Retry cnt */
u32 backup_arfr_cnt2; /* Auto Rate Fallback Retry cnt */
u16 backup_retry_limit;
u8 backup_ampdu_max_time;
/* algorithm related */
u8 pre_algorithm;
u8 cur_algorithm;
u8 bt_status;
u8 wifi_chnl_info[3];
u8 pre_ss_type;
u8 cur_ss_type;
u32 pre_ra_mask;
u32 cur_ra_mask;
u8 cur_ra_mask_type;
u8 pre_arfr_type;
u8 cur_arfr_type;
u8 pre_retry_limit_type;
u8 cur_retry_limit_type;
u8 pre_ampdu_time_type;
u8 cur_ampdu_time_type;
};
struct coex_sta_8192e_2ant {
boolean bt_disabled;
boolean bt_link_exist;
boolean sco_exist;
boolean a2dp_exist;
boolean hid_exist;
boolean pan_exist;
boolean under_lps;
boolean under_ips;
u32 high_priority_tx;
u32 high_priority_rx;
u32 low_priority_tx;
u32 low_priority_rx;
u8 bt_rssi;
u8 pre_bt_rssi_state;
u8 pre_wifi_rssi_state[4];
boolean c2h_bt_info_req_sent;
u8 bt_info_c2h[BT_INFO_SRC_8192E_2ANT_MAX][10];
u32 bt_info_c2h_cnt[BT_INFO_SRC_8192E_2ANT_MAX];
boolean c2h_bt_inquiry_page;
u8 bt_retry_cnt;
u8 bt_info_ext;
};
/* *******************************************
* The following is interface which will notify coex module.
* ******************************************* */
void ex_halbtc8192e2ant_power_on_setting(IN struct btc_coexist *btcoexist);
void ex_halbtc8192e2ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only);
void ex_halbtc8192e2ant_init_coex_dm(IN struct btc_coexist *btcoexist);
void ex_halbtc8192e2ant_ips_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e2ant_lps_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e2ant_scan_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e2ant_connect_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e2ant_media_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e2ant_specific_packet_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8192e2ant_bt_info_notify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length);
void ex_halbtc8192e2ant_halt_notify(IN struct btc_coexist *btcoexist);
void ex_halbtc8192e2ant_periodical(IN struct btc_coexist *btcoexist);
void ex_halbtc8192e2ant_display_coex_info(IN struct btc_coexist *btcoexist);
#else /* #if (RTL8192E_SUPPORT == 1) */
#define ex_halbtc8192e2ant_power_on_setting(btcoexist)
#define ex_halbtc8192e2ant_init_hw_config(btcoexist, wifi_only)
#define ex_halbtc8192e2ant_init_coex_dm(btcoexist)
#define ex_halbtc8192e2ant_ips_notify(btcoexist, type)
#define ex_halbtc8192e2ant_lps_notify(btcoexist, type)
#define ex_halbtc8192e2ant_scan_notify(btcoexist, type)
#define ex_halbtc8192e2ant_connect_notify(btcoexist, type)
#define ex_halbtc8192e2ant_media_status_notify(btcoexist, type)
#define ex_halbtc8192e2ant_specific_packet_notify(btcoexist, type)
#define ex_halbtc8192e2ant_bt_info_notify(btcoexist, tmp_buf, length)
#define ex_halbtc8192e2ant_halt_notify(btcoexist)
#define ex_halbtc8192e2ant_periodical(btcoexist)
#define ex_halbtc8192e2ant_display_coex_info(btcoexist)
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,343 @@
#if (BT_SUPPORT == 1 && COEX_SUPPORT == 1)
#if (RTL8703B_SUPPORT == 1)
/* *******************************************
* The following is for 8703B 1ANT BT Co-exist definition
* ******************************************* */
#define BT_AUTO_REPORT_ONLY_8703B_1ANT 1
#define BT_8703B_1ANT_ENABLE_GNTBT_TO_GPIO14 0
#define BT_INFO_8703B_1ANT_B_FTP BIT(7)
#define BT_INFO_8703B_1ANT_B_A2DP BIT(6)
#define BT_INFO_8703B_1ANT_B_HID BIT(5)
#define BT_INFO_8703B_1ANT_B_SCO_BUSY BIT(4)
#define BT_INFO_8703B_1ANT_B_ACL_BUSY BIT(3)
#define BT_INFO_8703B_1ANT_B_INQ_PAGE BIT(2)
#define BT_INFO_8703B_1ANT_B_SCO_ESCO BIT(1)
#define BT_INFO_8703B_1ANT_B_CONNECTION BIT(0)
#define BT_INFO_8703B_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT(0))) ? true : false)
#define BTC_RSSI_COEX_THRESH_TOL_8703B_1ANT 2
#define BT_8703B_1ANT_WIFI_NOISY_THRESH 30 /* max: 255 */
/* for Antenna detection */
#define BT_8703B_1ANT_ANTDET_PSDTHRES_BACKGROUND 50
#define BT_8703B_1ANT_ANTDET_PSDTHRES_2ANT_BADISOLATION 70
#define BT_8703B_1ANT_ANTDET_PSDTHRES_2ANT_GOODISOLATION 55
#define BT_8703B_1ANT_ANTDET_PSDTHRES_1ANT 35
#define BT_8703B_1ANT_ANTDET_RETRY_INTERVAL 10 /* retry timer if ant det is fail, unit: second */
#define BT_8703B_1ANT_ANTDET_ENABLE 0
#define BT_8703B_1ANT_ANTDET_COEXMECHANISMSWITCH_ENABLE 0
#define BT_8703B_1ANT_LTECOEX_INDIRECTREG_ACCESS_TIMEOUT 30000
enum bt_8703b_1ant_signal_state {
BT_8703B_1ANT_SIG_STA_SET_TO_LOW = 0x0,
BT_8703B_1ANT_SIG_STA_SET_BY_HW = 0x0,
BT_8703B_1ANT_SIG_STA_SET_TO_HIGH = 0x1,
BT_8703B_1ANT_SIG_STA_MAX
};
enum bt_8703b_1ant_path_ctrl_owner {
BT_8703B_1ANT_PCO_BTSIDE = 0x0,
BT_8703B_1ANT_PCO_WLSIDE = 0x1,
BT_8703B_1ANT_PCO_MAX
};
enum bt_8703b_1ant_gnt_ctrl_type {
BT_8703B_1ANT_GNT_TYPE_CTRL_BY_PTA = 0x0,
BT_8703B_1ANT_GNT_TYPE_CTRL_BY_SW = 0x1,
BT_8703B_1ANT_GNT_TYPE_MAX
};
enum bt_8703b_1ant_gnt_ctrl_block {
BT_8703B_1ANT_GNT_BLOCK_RFC_BB = 0x0,
BT_8703B_1ANT_GNT_BLOCK_RFC = 0x1,
BT_8703B_1ANT_GNT_BLOCK_BB = 0x2,
BT_8703B_1ANT_GNT_BLOCK_MAX
};
enum bt_8703b_1ant_lte_coex_table_type {
BT_8703B_1ANT_CTT_WL_VS_LTE = 0x0,
BT_8703B_1ANT_CTT_BT_VS_LTE = 0x1,
BT_8703B_1ANT_CTT_MAX
};
enum bt_8703b_1ant_lte_break_table_type {
BT_8703B_1ANT_LBTT_WL_BREAK_LTE = 0x0,
BT_8703B_1ANT_LBTT_BT_BREAK_LTE = 0x1,
BT_8703B_1ANT_LBTT_LTE_BREAK_WL = 0x2,
BT_8703B_1ANT_LBTT_LTE_BREAK_BT = 0x3,
BT_8703B_1ANT_LBTT_MAX
};
enum bt_info_src_8703b_1ant {
BT_INFO_SRC_8703B_1ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8703B_1ANT_BT_RSP = 0x1,
BT_INFO_SRC_8703B_1ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8703B_1ANT_MAX
};
enum bt_8703b_1ant_bt_status {
BT_8703B_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8703B_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8703B_1ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8703B_1ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8703B_1ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8703B_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8703B_1ANT_BT_STATUS_MAX
};
enum bt_8703b_1ant_wifi_status {
BT_8703B_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8703B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
BT_8703B_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
BT_8703B_1ANT_WIFI_STATUS_CONNECTED_SPECIFIC_PKT = 0x3,
BT_8703B_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
BT_8703B_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
BT_8703B_1ANT_WIFI_STATUS_MAX
};
enum bt_8703b_1ant_coex_algo {
BT_8703B_1ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8703B_1ANT_COEX_ALGO_SCO = 0x1,
BT_8703B_1ANT_COEX_ALGO_HID = 0x2,
BT_8703B_1ANT_COEX_ALGO_A2DP = 0x3,
BT_8703B_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8703B_1ANT_COEX_ALGO_PANEDR = 0x5,
BT_8703B_1ANT_COEX_ALGO_PANHS = 0x6,
BT_8703B_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8703B_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8703B_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8703B_1ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8703B_1ANT_COEX_ALGO_MAX = 0xb,
};
struct coex_dm_8703b_1ant {
/* hw setting */
u8 pre_ant_pos_type;
u8 cur_ant_pos_type;
/* fw mechanism */
boolean cur_ignore_wlan_act;
boolean pre_ignore_wlan_act;
u8 pre_ps_tdma;
u8 cur_ps_tdma;
u8 ps_tdma_para[5];
u8 ps_tdma_du_adj_type;
boolean auto_tdma_adjust;
boolean pre_ps_tdma_on;
boolean cur_ps_tdma_on;
boolean pre_bt_auto_report;
boolean cur_bt_auto_report;
u8 pre_lps;
u8 cur_lps;
u8 pre_rpwm;
u8 cur_rpwm;
/* sw mechanism */
boolean pre_low_penalty_ra;
boolean cur_low_penalty_ra;
u32 pre_val0x6c0;
u32 cur_val0x6c0;
u32 pre_val0x6c4;
u32 cur_val0x6c4;
u32 pre_val0x6c8;
u32 cur_val0x6c8;
u8 pre_val0x6cc;
u8 cur_val0x6cc;
boolean limited_dig;
u32 backup_arfr_cnt1; /* Auto Rate Fallback Retry cnt */
u32 backup_arfr_cnt2; /* Auto Rate Fallback Retry cnt */
u16 backup_retry_limit;
u8 backup_ampdu_max_time;
/* algorithm related */
u8 pre_algorithm;
u8 cur_algorithm;
u8 bt_status;
u8 wifi_chnl_info[3];
u32 pre_ra_mask;
u32 cur_ra_mask;
u8 pre_arfr_type;
u8 cur_arfr_type;
u8 pre_retry_limit_type;
u8 cur_retry_limit_type;
u8 pre_ampdu_time_type;
u8 cur_ampdu_time_type;
u32 arp_cnt;
u8 error_condition;
};
struct coex_sta_8703b_1ant {
boolean bt_disabled;
boolean bt_link_exist;
boolean sco_exist;
boolean a2dp_exist;
boolean hid_exist;
boolean pan_exist;
boolean bt_hi_pri_link_exist;
u8 num_of_profile;
boolean under_lps;
boolean under_ips;
u32 specific_pkt_period_cnt;
u32 high_priority_tx;
u32 high_priority_rx;
u32 low_priority_tx;
u32 low_priority_rx;
s8 bt_rssi;
boolean bt_tx_rx_mask;
u8 pre_bt_rssi_state;
u8 pre_wifi_rssi_state[4];
boolean c2h_bt_info_req_sent;
u8 bt_info_c2h[BT_INFO_SRC_8703B_1ANT_MAX][10];
u32 bt_info_c2h_cnt[BT_INFO_SRC_8703B_1ANT_MAX];
boolean bt_whck_test;
boolean c2h_bt_inquiry_page;
boolean c2h_bt_page; /* Add for win8.1 page out issue */
boolean wifi_is_high_pri_task; /* Add for win8.1 page out issue */
u8 bt_retry_cnt;
u8 bt_info_ext;
u32 pop_event_cnt;
u8 scan_ap_num;
u32 crc_ok_cck;
u32 crc_ok_11g;
u32 crc_ok_11n;
u32 crc_ok_11n_agg;
u32 crc_err_cck;
u32 crc_err_11g;
u32 crc_err_11n;
u32 crc_err_11n_agg;
boolean cck_lock;
boolean pre_ccklock;
boolean cck_ever_lock;
u8 coex_table_type;
boolean force_lps_on;
u32 wrong_profile_notification;
boolean concurrent_rx_mode_on;
u16 score_board;
};
#define BT_8703B_1ANT_ANTDET_PSD_POINTS 256 /* MAX:1024 */
#define BT_8703B_1ANT_ANTDET_PSD_AVGNUM 1 /* MAX:3 */
#define BT_8703B_1ANT_ANTDET_BUF_LEN 16
struct psdscan_sta_8703b_1ant {
u32 ant_det_bt_le_channel; /* BT LE Channel ex:2412 */
u32 ant_det_bt_tx_time;
u32 ant_det_pre_psdscan_peak_val;
boolean ant_det_is_ant_det_available;
u32 ant_det_psd_scan_peak_val;
boolean ant_det_is_btreply_available;
u32 ant_det_psd_scan_peak_freq;
u8 ant_det_result;
u8 ant_det_peak_val[BT_8703B_1ANT_ANTDET_BUF_LEN];
u8 ant_det_peak_freq[BT_8703B_1ANT_ANTDET_BUF_LEN];
u32 ant_det_try_count;
u32 ant_det_fail_count;
u32 ant_det_inteval_count;
u32 ant_det_thres_offset;
u32 real_cent_freq;
s32 real_offset;
u32 real_span;
u32 psd_band_width; /* unit: Hz */
u32 psd_point; /* 128/256/512/1024 */
u32 psd_report[1024]; /* unit:dB (20logx), 0~255 */
u32 psd_report_max_hold[1024]; /* unit:dB (20logx), 0~255 */
u32 psd_start_point;
u32 psd_stop_point;
u32 psd_max_value_point;
u32 psd_max_value;
u32 psd_start_base;
u32 psd_avg_num; /* 1/8/16/32 */
u32 psd_gen_count;
boolean is_psd_running;
boolean is_psd_show_max_only;
};
/* *******************************************
* The following is interface which will notify coex module.
* ******************************************* */
void ex_halbtc8703b1ant_power_on_setting(IN struct btc_coexist *btcoexist);
void ex_halbtc8703b1ant_pre_load_firmware(IN struct btc_coexist *btcoexist);
void ex_halbtc8703b1ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only);
void ex_halbtc8703b1ant_init_coex_dm(IN struct btc_coexist *btcoexist);
void ex_halbtc8703b1ant_ips_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8703b1ant_lps_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8703b1ant_scan_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8703b1ant_connect_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8703b1ant_media_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8703b1ant_specific_packet_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8703b1ant_bt_info_notify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length);
void ex_halbtc8703b1ant_rf_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8703b1ant_halt_notify(IN struct btc_coexist *btcoexist);
void ex_halbtc8703b1ant_pnp_notify(IN struct btc_coexist *btcoexist,
IN u8 pnp_state);
void ex_halbtc8703b1ant_ScoreBoardStatusNotify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length);
void ex_halbtc8703b1ant_coex_dm_reset(IN struct btc_coexist *btcoexist);
void ex_halbtc8703b1ant_periodical(IN struct btc_coexist *btcoexist);
void ex_halbtc8703b1ant_display_coex_info(IN struct btc_coexist *btcoexist);
void ex_halbtc8703b1ant_antenna_detection(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN u32 offset, IN u32 span, IN u32 seconds);
void ex_halbtc8703b1ant_antenna_isolation(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN u32 offset, IN u32 span, IN u32 seconds);
void ex_halbtc8703b1ant_psd_scan(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN u32 offset, IN u32 span, IN u32 seconds);
void ex_halbtc8703b1ant_display_ant_detection(IN struct btc_coexist *btcoexist);
#else
#define ex_halbtc8703b1ant_power_on_setting(btcoexist)
#define ex_halbtc8703b1ant_pre_load_firmware(btcoexist)
#define ex_halbtc8703b1ant_init_hw_config(btcoexist, wifi_only)
#define ex_halbtc8703b1ant_init_coex_dm(btcoexist)
#define ex_halbtc8703b1ant_ips_notify(btcoexist, type)
#define ex_halbtc8703b1ant_lps_notify(btcoexist, type)
#define ex_halbtc8703b1ant_scan_notify(btcoexist, type)
#define ex_halbtc8703b1ant_connect_notify(btcoexist, type)
#define ex_halbtc8703b1ant_media_status_notify(btcoexist, type)
#define ex_halbtc8703b1ant_specific_packet_notify(btcoexist, type)
#define ex_halbtc8703b1ant_bt_info_notify(btcoexist, tmp_buf, length)
#define ex_halbtc8703b1ant_rf_status_notify(btcoexist, type)
#define ex_halbtc8703b1ant_halt_notify(btcoexist)
#define ex_halbtc8703b1ant_pnp_notify(btcoexist, pnp_state)
#define ex_halbtc8703b1ant_ScoreBoardStatusNotify(btcoexist, tmp_buf, length)
#define ex_halbtc8703b1ant_coex_dm_reset(btcoexist)
#define ex_halbtc8703b1ant_periodical(btcoexist)
#define ex_halbtc8703b1ant_display_coex_info(btcoexist)
#define ex_halbtc8703b1ant_antenna_detection(btcoexist, cent_freq, offset, span, seconds)
#define ex_halbtc8703b1ant_antenna_isolation(btcoexist, cent_freq, offset, span, seconds)
#define ex_halbtc8703b1ant_psd_scan(btcoexist, cent_freq, offset, span, seconds)
#define ex_halbtc8703b1ant_display_ant_detection(btcoexist)
#endif
#endif

View File

@ -1,57 +1,57 @@
//===========================================
// The following is for 8723B 2Ant BT Co-exist definition
// The following is for 8703B 2Ant BT Co-exist definition
//===========================================
#define BT_AUTO_REPORT_ONLY_8723B_2ANT 1
#define BT_AUTO_REPORT_ONLY_8703B_2ANT 1
#define BT_INFO_8723B_2ANT_B_FTP BIT7
#define BT_INFO_8723B_2ANT_B_A2DP BIT6
#define BT_INFO_8723B_2ANT_B_HID BIT5
#define BT_INFO_8723B_2ANT_B_SCO_BUSY BIT4
#define BT_INFO_8723B_2ANT_B_ACL_BUSY BIT3
#define BT_INFO_8723B_2ANT_B_INQ_PAGE BIT2
#define BT_INFO_8723B_2ANT_B_SCO_ESCO BIT1
#define BT_INFO_8723B_2ANT_B_CONNECTION BIT0
#define BT_INFO_8703B_2ANT_B_FTP BIT7
#define BT_INFO_8703B_2ANT_B_A2DP BIT6
#define BT_INFO_8703B_2ANT_B_HID BIT5
#define BT_INFO_8703B_2ANT_B_SCO_BUSY BIT4
#define BT_INFO_8703B_2ANT_B_ACL_BUSY BIT3
#define BT_INFO_8703B_2ANT_B_INQ_PAGE BIT2
#define BT_INFO_8703B_2ANT_B_SCO_ESCO BIT1
#define BT_INFO_8703B_2ANT_B_CONNECTION BIT0
#define BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT 2
#define BTC_RSSI_COEX_THRESH_TOL_8703B_2ANT 2
#define BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES 42 //WiFi RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation
#define BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES 46 //BT RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation
#define BT_8703B_2ANT_WIFI_RSSI_COEXSWITCH_THRES 42 //WiFi RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation
#define BT_8703B_2ANT_BT_RSSI_COEXSWITCH_THRES 46 //BT RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation
typedef enum _BT_INFO_SRC_8723B_2ANT{
BT_INFO_SRC_8723B_2ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8723B_2ANT_BT_RSP = 0x1,
BT_INFO_SRC_8723B_2ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8723B_2ANT_MAX
}BT_INFO_SRC_8723B_2ANT,*PBT_INFO_SRC_8723B_2ANT;
typedef enum _BT_INFO_SRC_8703B_2ANT{
BT_INFO_SRC_8703B_2ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8703B_2ANT_BT_RSP = 0x1,
BT_INFO_SRC_8703B_2ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8703B_2ANT_MAX
}BT_INFO_SRC_8703B_2ANT,*PBT_INFO_SRC_8703B_2ANT;
typedef enum _BT_8723B_2ANT_BT_STATUS{
BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8723B_2ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8723B_2ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8723B_2ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8723B_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8723B_2ANT_BT_STATUS_MAX
}BT_8723B_2ANT_BT_STATUS,*PBT_8723B_2ANT_BT_STATUS;
typedef enum _BT_8703B_2ANT_BT_STATUS{
BT_8703B_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8703B_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8703B_2ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8703B_2ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8703B_2ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8703B_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8703B_2ANT_BT_STATUS_MAX
}BT_8703B_2ANT_BT_STATUS,*PBT_8703B_2ANT_BT_STATUS;
typedef enum _BT_8723B_2ANT_COEX_ALGO{
BT_8723B_2ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8723B_2ANT_COEX_ALGO_SCO = 0x1,
BT_8723B_2ANT_COEX_ALGO_HID = 0x2,
BT_8723B_2ANT_COEX_ALGO_A2DP = 0x3,
BT_8723B_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8723B_2ANT_COEX_ALGO_PANEDR = 0x5,
BT_8723B_2ANT_COEX_ALGO_PANHS = 0x6,
BT_8723B_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8723B_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8723B_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8723B_2ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8723B_2ANT_COEX_ALGO_MAX = 0xb,
}BT_8723B_2ANT_COEX_ALGO,*PBT_8723B_2ANT_COEX_ALGO;
typedef enum _BT_8703B_2ANT_COEX_ALGO{
BT_8703B_2ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8703B_2ANT_COEX_ALGO_SCO = 0x1,
BT_8703B_2ANT_COEX_ALGO_HID = 0x2,
BT_8703B_2ANT_COEX_ALGO_A2DP = 0x3,
BT_8703B_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8703B_2ANT_COEX_ALGO_PANEDR = 0x5,
BT_8703B_2ANT_COEX_ALGO_PANHS = 0x6,
BT_8703B_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8703B_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8703B_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8703B_2ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8703B_2ANT_COEX_ALGO_MAX = 0xb,
}BT_8703B_2ANT_COEX_ALGO,*PBT_8703B_2ANT_COEX_ALGO;
typedef struct _COEX_DM_8723B_2ANT{
typedef struct _COEX_DM_8703B_2ANT{
// fw mechanism
u1Byte preBtDecPwrLvl;
u1Byte curBtDecPwrLvl;
@ -109,9 +109,9 @@ typedef struct _COEX_DM_8723B_2ANT{
u1Byte curRpwm;
BOOLEAN bIsSwitchTo1dot5Ant;
} COEX_DM_8723B_2ANT, *PCOEX_DM_8723B_2ANT;
} COEX_DM_8703B_2ANT, *PCOEX_DM_8703B_2ANT;
typedef struct _COEX_STA_8723B_2ANT{
typedef struct _COEX_STA_8703B_2ANT{
BOOLEAN bBtLinkExist;
BOOLEAN bScoExist;
BOOLEAN bA2dpExist;
@ -129,15 +129,12 @@ typedef struct _COEX_STA_8723B_2ANT{
u1Byte preBtRssiState;
u1Byte preWifiRssiState[4];
BOOLEAN bC2hBtInfoReqSent;
u1Byte btInfoC2h[BT_INFO_SRC_8723B_2ANT_MAX][10];
u4Byte btInfoC2hCnt[BT_INFO_SRC_8723B_2ANT_MAX];
u1Byte btInfoC2h[BT_INFO_SRC_8703B_2ANT_MAX][10];
u4Byte btInfoC2hCnt[BT_INFO_SRC_8703B_2ANT_MAX];
BOOLEAN bBtWhckTest;
BOOLEAN bC2hBtInquiryPage;
BOOLEAN bC2hBtRemoteNameReq;
u1Byte btRetryCnt;
u1Byte btInfoExt;
u4Byte popEventCnt;
u1Byte nScanAPNum;
u4Byte nCRCOK_CCK;
u4Byte nCRCOK_11g;
@ -153,82 +150,79 @@ typedef struct _COEX_STA_8723B_2ANT{
BOOLEAN bForceLpsOn;
u1Byte disVerInfoCnt;
u1Byte nA2DPBitPool;
u1Byte nCutVersion;
}COEX_STA_8723B_2ANT, *PCOEX_STA_8723B_2ANT;
}COEX_STA_8703B_2ANT, *PCOEX_STA_8703B_2ANT;
//===========================================
// The following is interface which will notify coex module.
//===========================================
VOID
EXhalbtc8723b2ant_PowerOnSetting(
EXhalbtc8703b2ant_PowerOnSetting(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b2ant_PreLoadFirmware(
EXhalbtc8703b2ant_PreLoadFirmware(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b2ant_InitHwConfig(
EXhalbtc8703b2ant_InitHwConfig(
IN PBTC_COEXIST pBtCoexist,
IN BOOLEAN bWifiOnly
);
VOID
EXhalbtc8723b2ant_InitCoexDm(
EXhalbtc8703b2ant_InitCoexDm(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b2ant_IpsNotify(
EXhalbtc8703b2ant_IpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b2ant_LpsNotify(
EXhalbtc8703b2ant_LpsNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b2ant_ScanNotify(
EXhalbtc8703b2ant_ScanNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b2ant_ConnectNotify(
EXhalbtc8703b2ant_ConnectNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b2ant_MediaStatusNotify(
EXhalbtc8703b2ant_MediaStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b2ant_SpecialPacketNotify(
EXhalbtc8703b2ant_SpecialPacketNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
VOID
EXhalbtc8723b2ant_BtInfoNotify(
EXhalbtc8703b2ant_BtInfoNotify(
IN PBTC_COEXIST pBtCoexist,
IN pu1Byte tmpBuf,
IN u1Byte length
);
VOID
EXhalbtc8723b2ant_HaltNotify(
EXhalbtc8703b2ant_HaltNotify(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b2ant_PnpNotify(
EXhalbtc8703b2ant_PnpNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte pnpState
);
VOID
EXhalbtc8723b2ant_Periodical(
EXhalbtc8703b2ant_Periodical(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtc8723b2ant_DisplayCoexInfo(
EXhalbtc8703b2ant_DisplayCoexInfo(
IN PBTC_COEXIST pBtCoexist
);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,289 @@
#if (BT_SUPPORT == 1 && COEX_SUPPORT == 1)
#if (RTL8723B_SUPPORT == 1)
/* *******************************************
* The following is for 8723B 1ANT BT Co-exist definition
* ******************************************* */
#define BT_AUTO_REPORT_ONLY_8723B_1ANT 1
#define BT_INFO_8723B_1ANT_B_FTP BIT(7)
#define BT_INFO_8723B_1ANT_B_A2DP BIT(6)
#define BT_INFO_8723B_1ANT_B_HID BIT(5)
#define BT_INFO_8723B_1ANT_B_SCO_BUSY BIT(4)
#define BT_INFO_8723B_1ANT_B_ACL_BUSY BIT(3)
#define BT_INFO_8723B_1ANT_B_INQ_PAGE BIT(2)
#define BT_INFO_8723B_1ANT_B_SCO_ESCO BIT(1)
#define BT_INFO_8723B_1ANT_B_CONNECTION BIT(0)
#define BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT(0))) ? true : false)
#define BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT 2
#define BT_8723B_1ANT_WIFI_NOISY_THRESH 50 /* 30 //max: 255 */
/* for Antenna detection */
#define BT_8723B_1ANT_ANTDET_PSDTHRES_BACKGROUND 50
#define BT_8723B_1ANT_ANTDET_PSDTHRES_2ANT_BADISOLATION 70
#define BT_8723B_1ANT_ANTDET_PSDTHRES_2ANT_GOODISOLATION 48
#define BT_8723B_1ANT_ANTDET_PSDTHRES_1ANT 32
#define BT_8723B_1ANT_ANTDET_RETRY_INTERVAL 10 /* retry timer if ant det is fail, unit: second */
#define BT_8723B_1ANT_ANTDET_SWEEPPOINT_DELAY 40000
#define BT_8723B_1ANT_ANTDET_ENABLE 1
#define BT_8723B_1ANT_ANTDET_COEXMECHANISMSWITCH_ENABLE 1
#define BT_8723B_1ANT_ANTDET_BTTXTIME 100
#define BT_8723B_1ANT_ANTDET_BTTXCHANNEL 39
enum bt_info_src_8723b_1ant {
BT_INFO_SRC_8723B_1ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8723B_1ANT_BT_RSP = 0x1,
BT_INFO_SRC_8723B_1ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8723B_1ANT_MAX
};
enum bt_8723b_1ant_bt_status {
BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8723B_1ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8723B_1ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8723B_1ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8723B_1ANT_BT_STATUS_MAX
};
enum bt_8723b_1ant_wifi_status {
BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIFIC_PKT = 0x3,
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
BT_8723B_1ANT_WIFI_STATUS_MAX
};
enum bt_8723b_1ant_coex_algo {
BT_8723B_1ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8723B_1ANT_COEX_ALGO_SCO = 0x1,
BT_8723B_1ANT_COEX_ALGO_HID = 0x2,
BT_8723B_1ANT_COEX_ALGO_A2DP = 0x3,
BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8723B_1ANT_COEX_ALGO_PANEDR = 0x5,
BT_8723B_1ANT_COEX_ALGO_PANHS = 0x6,
BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8723B_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8723B_1ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8723B_1ANT_COEX_ALGO_MAX = 0xb,
};
struct coex_dm_8723b_1ant {
/* hw setting */
u8 pre_ant_pos_type;
u8 cur_ant_pos_type;
/* fw mechanism */
boolean cur_ignore_wlan_act;
boolean pre_ignore_wlan_act;
u8 pre_ps_tdma;
u8 cur_ps_tdma;
u8 ps_tdma_para[5];
u8 ps_tdma_du_adj_type;
boolean auto_tdma_adjust;
boolean pre_ps_tdma_on;
boolean cur_ps_tdma_on;
boolean pre_bt_auto_report;
boolean cur_bt_auto_report;
u8 pre_lps;
u8 cur_lps;
u8 pre_rpwm;
u8 cur_rpwm;
/* sw mechanism */
boolean pre_low_penalty_ra;
boolean cur_low_penalty_ra;
u32 pre_val0x6c0;
u32 cur_val0x6c0;
u32 pre_val0x6c4;
u32 cur_val0x6c4;
u32 pre_val0x6c8;
u32 cur_val0x6c8;
u8 pre_val0x6cc;
u8 cur_val0x6cc;
u32 backup_arfr_cnt1; /* Auto Rate Fallback Retry cnt */
u32 backup_arfr_cnt2; /* Auto Rate Fallback Retry cnt */
u16 backup_retry_limit;
u8 backup_ampdu_max_time;
/* algorithm related */
u8 bt_status;
u8 wifi_chnl_info[3];
u32 pre_ra_mask;
u32 cur_ra_mask;
u8 pre_arfr_type;
u8 cur_arfr_type;
u8 pre_retry_limit_type;
u8 cur_retry_limit_type;
u8 pre_ampdu_time_type;
u8 cur_ampdu_time_type;
u32 arp_cnt;
u8 error_condition;
};
struct coex_sta_8723b_1ant {
boolean bt_disabled;
boolean bt_enable_disable_change;
boolean bt_link_exist;
boolean sco_exist;
boolean a2dp_exist;
boolean hid_exist;
boolean pan_exist;
boolean bt_hi_pri_link_exist;
u8 num_of_profile;
boolean bt_abnormal_scan;
boolean under_lps;
boolean under_ips;
u32 specific_pkt_period_cnt;
u32 high_priority_tx;
u32 high_priority_rx;
u32 low_priority_tx;
u32 low_priority_rx;
s8 bt_rssi;
boolean bt_tx_rx_mask;
boolean c2h_bt_info_req_sent;
u8 bt_info_c2h[BT_INFO_SRC_8723B_1ANT_MAX][10];
u32 bt_info_c2h_cnt[BT_INFO_SRC_8723B_1ANT_MAX];
boolean bt_whck_test;
boolean c2h_bt_inquiry_page;
boolean c2h_bt_remote_name_req;
boolean wifi_is_high_pri_task; /* Add for win8.1 page out issue */
u8 bt_retry_cnt;
u8 bt_info_ext;
u32 pop_event_cnt;
u8 scan_ap_num;
u32 crc_ok_cck;
u32 crc_ok_11g;
u32 crc_ok_11n;
u32 crc_ok_11n_agg;
u32 crc_err_cck;
u32 crc_err_11g;
u32 crc_err_11n;
u32 crc_err_11n_agg;
boolean cck_lock;
boolean pre_ccklock;
boolean cck_ever_lock;
u8 coex_table_type;
boolean force_lps_on;
u32 wrong_profile_notification;
u8 a2dp_bit_pool;
u8 cut_version;
};
#define BT_8723B_1ANT_ANTDET_PSD_POINTS 256 /* MAX:1024 */
#define BT_8723B_1ANT_ANTDET_PSD_AVGNUM 1 /* MAX:3 */
#define BT_8723B_1ANT_ANTDET_BUF_LEN 16
struct psdscan_sta_8723b_1ant {
u32 ant_det_bt_le_channel; /* BT LE Channel ex:2412 */
u32 ant_det_bt_tx_time;
u32 ant_det_pre_psdscan_peak_val;
boolean ant_det_is_ant_det_available;
u32 ant_det_psd_scan_peak_val;
boolean ant_det_is_btreply_available;
u32 ant_det_psd_scan_peak_freq;
u8 ant_det_result;
u8 ant_det_peak_val[BT_8723B_1ANT_ANTDET_BUF_LEN];
u8 ant_det_peak_freq[BT_8723B_1ANT_ANTDET_BUF_LEN];
u32 ant_det_try_count;
u32 ant_det_fail_count;
u32 ant_det_inteval_count;
u32 ant_det_thres_offset;
u32 real_cent_freq;
s32 real_offset;
u32 real_span;
u32 psd_band_width; /* unit: Hz */
u32 psd_point; /* 128/256/512/1024 */
u32 psd_report[1024]; /* unit:dB (20logx), 0~255 */
u32 psd_report_max_hold[1024]; /* unit:dB (20logx), 0~255 */
u32 psd_start_point;
u32 psd_stop_point;
u32 psd_max_value_point;
u32 psd_max_value;
u32 psd_start_base;
u32 psd_avg_num; /* 1/8/16/32 */
u32 psd_gen_count;
boolean is_psd_running;
boolean is_psd_show_max_only;
};
/* *******************************************
* The following is interface which will notify coex module.
* ******************************************* */
void ex_halbtc8723b1ant_power_on_setting(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b1ant_pre_load_firmware(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b1ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only);
void ex_halbtc8723b1ant_init_coex_dm(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b1ant_ips_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b1ant_lps_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b1ant_scan_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b1ant_connect_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b1ant_media_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b1ant_specific_packet_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b1ant_bt_info_notify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length);
void ex_halbtc8723b1ant_rf_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b1ant_halt_notify(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b1ant_pnp_notify(IN struct btc_coexist *btcoexist,
IN u8 pnp_state);
void ex_halbtc8723b1ant_coex_dm_reset(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b1ant_periodical(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b1ant_display_coex_info(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b1ant_antenna_detection(IN struct btc_coexist *btcoexist,
IN u32 cent_freq, IN u32 offset, IN u32 span, IN u32 seconds);
void ex_halbtc8723b1ant_display_ant_detection(IN struct btc_coexist *btcoexist);
#else
#define ex_halbtc8723b1ant_power_on_setting(btcoexist)
#define ex_halbtc8723b1ant_pre_load_firmware(btcoexist)
#define ex_halbtc8723b1ant_init_hw_config(btcoexist, wifi_only)
#define ex_halbtc8723b1ant_init_coex_dm(btcoexist)
#define ex_halbtc8723b1ant_ips_notify(btcoexist, type)
#define ex_halbtc8723b1ant_lps_notify(btcoexist, type)
#define ex_halbtc8723b1ant_scan_notify(btcoexist, type)
#define ex_halbtc8723b1ant_connect_notify(btcoexist, type)
#define ex_halbtc8723b1ant_media_status_notify(btcoexist, type)
#define ex_halbtc8723b1ant_specific_packet_notify(btcoexist, type)
#define ex_halbtc8723b1ant_bt_info_notify(btcoexist, tmp_buf, length)
#define ex_halbtc8723b1ant_rf_status_notify(btcoexist, type)
#define ex_halbtc8723b1ant_halt_notify(btcoexist)
#define ex_halbtc8723b1ant_pnp_notify(btcoexist, pnp_state)
#define ex_halbtc8723b1ant_coex_dm_reset(btcoexist)
#define ex_halbtc8723b1ant_periodical(btcoexist)
#define ex_halbtc8723b1ant_display_coex_info(btcoexist)
#define ex_halbtc8723b1ant_antenna_detection(btcoexist, cent_freq, offset, span, seconds)
#define ex_halbtc8723b1ant_display_ant_detection(btcoexist)
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,214 @@
#if (BT_SUPPORT == 1 && COEX_SUPPORT == 1)
#if (RTL8723B_SUPPORT == 1)
/* *******************************************
* The following is for 8723B 2Ant BT Co-exist definition
* ******************************************* */
#define BT_AUTO_REPORT_ONLY_8723B_2ANT 1
#define BT_INFO_8723B_2ANT_B_FTP BIT(7)
#define BT_INFO_8723B_2ANT_B_A2DP BIT(6)
#define BT_INFO_8723B_2ANT_B_HID BIT(5)
#define BT_INFO_8723B_2ANT_B_SCO_BUSY BIT(4)
#define BT_INFO_8723B_2ANT_B_ACL_BUSY BIT(3)
#define BT_INFO_8723B_2ANT_B_INQ_PAGE BIT(2)
#define BT_INFO_8723B_2ANT_B_SCO_ESCO BIT(1)
#define BT_INFO_8723B_2ANT_B_CONNECTION BIT(0)
#define BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT 2
#define BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES 42 /* WiFi RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation */
#define BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES 46 /* BT RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation */
enum bt_info_src_8723b_2ant {
BT_INFO_SRC_8723B_2ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8723B_2ANT_BT_RSP = 0x1,
BT_INFO_SRC_8723B_2ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8723B_2ANT_MAX
};
enum bt_8723b_2ant_bt_status {
BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8723B_2ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8723B_2ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8723B_2ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8723B_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8723B_2ANT_BT_STATUS_MAX
};
enum bt_8723b_2ant_coex_algo {
BT_8723B_2ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8723B_2ANT_COEX_ALGO_SCO = 0x1,
BT_8723B_2ANT_COEX_ALGO_HID = 0x2,
BT_8723B_2ANT_COEX_ALGO_A2DP = 0x3,
BT_8723B_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8723B_2ANT_COEX_ALGO_PANEDR = 0x5,
BT_8723B_2ANT_COEX_ALGO_PANHS = 0x6,
BT_8723B_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8723B_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8723B_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8723B_2ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8723B_2ANT_COEX_ALGO_MAX = 0xb,
};
struct coex_dm_8723b_2ant {
/* fw mechanism */
u8 pre_bt_dec_pwr_lvl;
u8 cur_bt_dec_pwr_lvl;
u8 pre_fw_dac_swing_lvl;
u8 cur_fw_dac_swing_lvl;
boolean cur_ignore_wlan_act;
boolean pre_ignore_wlan_act;
u8 pre_ps_tdma;
u8 cur_ps_tdma;
u8 ps_tdma_para[5];
u8 ps_tdma_du_adj_type;
boolean reset_tdma_adjust;
boolean auto_tdma_adjust;
boolean pre_ps_tdma_on;
boolean cur_ps_tdma_on;
boolean pre_bt_auto_report;
boolean cur_bt_auto_report;
/* sw mechanism */
boolean pre_rf_rx_lpf_shrink;
boolean cur_rf_rx_lpf_shrink;
u32 bt_rf_0x1e_backup;
boolean pre_low_penalty_ra;
boolean cur_low_penalty_ra;
boolean pre_dac_swing_on;
u32 pre_dac_swing_lvl;
boolean cur_dac_swing_on;
u32 cur_dac_swing_lvl;
boolean pre_adc_back_off;
boolean cur_adc_back_off;
boolean pre_agc_table_en;
boolean cur_agc_table_en;
u32 pre_val0x6c0;
u32 cur_val0x6c0;
u32 pre_val0x6c4;
u32 cur_val0x6c4;
u32 pre_val0x6c8;
u32 cur_val0x6c8;
u8 pre_val0x6cc;
u8 cur_val0x6cc;
boolean limited_dig;
/* algorithm related */
u8 pre_algorithm;
u8 cur_algorithm;
u8 bt_status;
u8 wifi_chnl_info[3];
boolean need_recover0x948;
u32 backup0x948;
u8 pre_lps;
u8 cur_lps;
u8 pre_rpwm;
u8 cur_rpwm;
boolean is_switch_to_1dot5_ant;
u8 switch_thres_offset;
};
struct coex_sta_8723b_2ant {
boolean bt_disabled;
boolean bt_link_exist;
boolean sco_exist;
boolean a2dp_exist;
boolean hid_exist;
boolean pan_exist;
boolean bt_abnormal_scan;
boolean under_lps;
boolean under_ips;
u32 high_priority_tx;
u32 high_priority_rx;
u32 low_priority_tx;
u32 low_priority_rx;
u8 bt_rssi;
boolean bt_tx_rx_mask;
u8 pre_bt_rssi_state;
u8 pre_wifi_rssi_state[4];
boolean c2h_bt_info_req_sent;
u8 bt_info_c2h[BT_INFO_SRC_8723B_2ANT_MAX][10];
u32 bt_info_c2h_cnt[BT_INFO_SRC_8723B_2ANT_MAX];
boolean bt_whck_test;
boolean c2h_bt_inquiry_page;
boolean c2h_bt_remote_name_req;
u8 bt_retry_cnt;
u8 bt_info_ext;
u32 pop_event_cnt;
u8 scan_ap_num;
u32 crc_ok_cck;
u32 crc_ok_11g;
u32 crc_ok_11n;
u32 crc_ok_11n_agg;
u32 crc_err_cck;
u32 crc_err_11g;
u32 crc_err_11n;
u32 crc_err_11n_agg;
u8 coex_table_type;
boolean force_lps_on;
u8 dis_ver_info_cnt;
u8 a2dp_bit_pool;
u8 cut_version;
};
/* *******************************************
* The following is interface which will notify coex module.
* ******************************************* */
void ex_halbtc8723b2ant_power_on_setting(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b2ant_pre_load_firmware(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b2ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only);
void ex_halbtc8723b2ant_init_coex_dm(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b2ant_ips_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b2ant_lps_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b2ant_scan_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b2ant_connect_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b2ant_media_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b2ant_specific_packet_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8723b2ant_bt_info_notify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length);
void ex_halbtc8723b2ant_halt_notify(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b2ant_pnp_notify(IN struct btc_coexist *btcoexist,
IN u8 pnp_state);
void ex_halbtc8723b2ant_periodical(IN struct btc_coexist *btcoexist);
void ex_halbtc8723b2ant_display_coex_info(IN struct btc_coexist *btcoexist);
#else
#define ex_halbtc8723b2ant_power_on_setting(btcoexist)
#define ex_halbtc8723b2ant_pre_load_firmware(btcoexist)
#define ex_halbtc8723b2ant_init_hw_config(btcoexist, wifi_only)
#define ex_halbtc8723b2ant_init_coex_dm(btcoexist)
#define ex_halbtc8723b2ant_ips_notify(btcoexist, type)
#define ex_halbtc8723b2ant_lps_notify(btcoexist, type)
#define ex_halbtc8723b2ant_scan_notify(btcoexist, type)
#define ex_halbtc8723b2ant_connect_notify(btcoexist, type)
#define ex_halbtc8723b2ant_media_status_notify(btcoexist, type)
#define ex_halbtc8723b2ant_specific_packet_notify(btcoexist, type)
#define ex_halbtc8723b2ant_bt_info_notify(btcoexist, tmp_buf, length)
#define ex_halbtc8723b2ant_halt_notify(btcoexist)
#define ex_halbtc8723b2ant_pnp_notify(btcoexist, pnp_state)
#define ex_halbtc8723b2ant_periodical(btcoexist)
#define ex_halbtc8723b2ant_display_coex_info(btcoexist)
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,230 @@
#if (BT_SUPPORT == 1 && COEX_SUPPORT == 1)
#if (RTL8812A_SUPPORT == 1)
/* *******************************************
* The following is for 8812A 1ANT BT Co-exist definition
* ******************************************* */
#define BT_AUTO_REPORT_ONLY_8812A_1ANT 1
#define BT_INFO_8812A_1ANT_B_FTP BIT(7)
#define BT_INFO_8812A_1ANT_B_A2DP BIT(6)
#define BT_INFO_8812A_1ANT_B_HID BIT(5)
#define BT_INFO_8812A_1ANT_B_SCO_BUSY BIT(4)
#define BT_INFO_8812A_1ANT_B_ACL_BUSY BIT(3)
#define BT_INFO_8812A_1ANT_B_INQ_PAGE BIT(2)
#define BT_INFO_8812A_1ANT_B_SCO_ESCO BIT(1)
#define BT_INFO_8812A_1ANT_B_CONNECTION BIT(0)
#define BT_INFO_8812A_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT(0))) ? true : false)
#define BTC_RSSI_COEX_THRESH_TOL_8812A_1ANT 2
#define BT_8812A_1ANT_WIFI_NOISY_THRESH 30 /* max: 255 */
enum bt_info_src_8812a_1ant {
BT_INFO_SRC_8812A_1ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8812A_1ANT_BT_RSP = 0x1,
BT_INFO_SRC_8812A_1ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8812A_1ANT_MAX
};
enum bt_8812a_1ant_bt_status {
BT_8812A_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8812A_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8812A_1ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8812A_1ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8812A_1ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8812A_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8812A_1ANT_BT_STATUS_MAX
};
enum bt_8812a_1ant_wifi_status {
BT_8812A_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8812A_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_SPECIFIC_PKT = 0x3,
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
BT_8812A_1ANT_WIFI_STATUS_MAX
};
enum bt_8812a_1ant_coex_algo {
BT_8812A_1ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8812A_1ANT_COEX_ALGO_SCO = 0x1,
BT_8812A_1ANT_COEX_ALGO_HID = 0x2,
BT_8812A_1ANT_COEX_ALGO_A2DP = 0x3,
BT_8812A_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8812A_1ANT_COEX_ALGO_PANEDR = 0x5,
BT_8812A_1ANT_COEX_ALGO_PANHS = 0x6,
BT_8812A_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8812A_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8812A_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8812A_1ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8812A_1ANT_COEX_ALGO_MAX = 0xb,
};
struct coex_dm_8812a_1ant {
/* hw setting */
u8 pre_ant_pos_type;
u8 cur_ant_pos_type;
/* fw mechanism */
boolean cur_ignore_wlan_act;
boolean pre_ignore_wlan_act;
u8 pre_ps_tdma;
u8 cur_ps_tdma;
u8 ps_tdma_para[5];
u8 ps_tdma_du_adj_type;
boolean auto_tdma_adjust;
boolean pre_ps_tdma_on;
boolean cur_ps_tdma_on;
boolean pre_bt_auto_report;
boolean cur_bt_auto_report;
u8 pre_lps;
u8 cur_lps;
u8 pre_rpwm;
u8 cur_rpwm;
/* sw mechanism */
boolean pre_low_penalty_ra;
boolean cur_low_penalty_ra;
u32 pre_val0x6c0;
u32 cur_val0x6c0;
u32 pre_val0x6c4;
u32 cur_val0x6c4;
u32 pre_val0x6c8;
u32 cur_val0x6c8;
u8 pre_val0x6cc;
u8 cur_val0x6cc;
boolean limited_dig;
u32 backup_arfr_cnt1; /* Auto Rate Fallback Retry cnt */
u32 backup_arfr_cnt2; /* Auto Rate Fallback Retry cnt */
u16 backup_retry_limit;
u8 backup_ampdu_max_time;
/* algorithm related */
u8 pre_algorithm;
u8 cur_algorithm;
u8 bt_status;
u8 wifi_chnl_info[3];
u32 pre_ra_mask;
u32 cur_ra_mask;
u8 pre_arfr_type;
u8 cur_arfr_type;
u8 pre_retry_limit_type;
u8 cur_retry_limit_type;
u8 pre_ampdu_time_type;
u8 cur_ampdu_time_type;
u32 arp_cnt;
u8 error_condition;
};
struct coex_sta_8812a_1ant {
boolean bt_disabled;
boolean bt_link_exist;
boolean sco_exist;
boolean a2dp_exist;
boolean hid_exist;
boolean pan_exist;
boolean under_lps;
boolean under_ips;
u32 specific_pkt_period_cnt;
u32 high_priority_tx;
u32 high_priority_rx;
u32 low_priority_tx;
u32 low_priority_rx;
s8 bt_rssi;
boolean bt_tx_rx_mask;
u8 pre_bt_rssi_state;
u8 pre_wifi_rssi_state[4];
boolean c2h_bt_info_req_sent;
u8 bt_info_c2h[BT_INFO_SRC_8812A_1ANT_MAX][10];
u32 bt_info_c2h_cnt[BT_INFO_SRC_8812A_1ANT_MAX];
u32 bt_info_query_cnt;
boolean c2h_bt_inquiry_page;
boolean c2h_bt_page; /* Add for win8.1 page out issue */
boolean wifi_is_high_pri_task; /* Add for win8.1 page out issue */
u8 bt_retry_cnt;
u8 bt_info_ext;
u32 pop_event_cnt;
u8 scan_ap_num;
u32 crc_ok_cck;
u32 crc_ok_11g;
u32 crc_ok_11n;
u32 crc_ok_11n_agg;
u32 crc_err_cck;
u32 crc_err_11g;
u32 crc_err_11n;
u32 crc_err_11n_agg;
boolean cck_lock;
boolean pre_ccklock;
u8 coex_table_type;
boolean force_lps_on;
};
/* *******************************************
* The following is interface which will notify coex module.
* ******************************************* */
void ex_halbtc8812a1ant_power_on_setting(IN struct btc_coexist *btcoexist);
void ex_halbtc8812a1ant_pre_load_firmware(IN struct btc_coexist *btcoexist);
void ex_halbtc8812a1ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only);
void ex_halbtc8812a1ant_init_coex_dm(IN struct btc_coexist *btcoexist);
void ex_halbtc8812a1ant_ips_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a1ant_lps_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a1ant_scan_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a1ant_connect_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a1ant_media_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a1ant_specific_packet_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a1ant_bt_info_notify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length);
void ex_halbtc8812a1ant_rf_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a1ant_halt_notify(IN struct btc_coexist *btcoexist);
void ex_halbtc8812a1ant_pnp_notify(IN struct btc_coexist *btcoexist,
IN u8 pnp_state);
void ex_halbtc8812a1ant_coex_dm_reset(IN struct btc_coexist *btcoexist);
void ex_halbtc8812a1ant_periodical(IN struct btc_coexist *btcoexist);
void ex_halbtc8812a1ant_dbg_control(IN struct btc_coexist *btcoexist,
IN u8 op_code, IN u8 op_len, IN u8 *pdata);
void ex_halbtc8812a1ant_display_coex_info(IN struct btc_coexist *btcoexist);
#else
#define ex_halbtc8812a1ant_power_on_setting(btcoexist)
#define ex_halbtc8812a1ant_pre_load_firmware(btcoexist)
#define ex_halbtc8812a1ant_init_hw_config(btcoexist, wifi_only)
#define ex_halbtc8812a1ant_init_coex_dm(btcoexist)
#define ex_halbtc8812a1ant_ips_notify(btcoexist, type)
#define ex_halbtc8812a1ant_lps_notify(btcoexist, type)
#define ex_halbtc8812a1ant_scan_notify(btcoexist, type)
#define ex_halbtc8812a1ant_connect_notify(btcoexist, type)
#define ex_halbtc8812a1ant_media_status_notify(btcoexist, type)
#define ex_halbtc8812a1ant_specific_packet_notify(btcoexist, type)
#define ex_halbtc8812a1ant_bt_info_notify(btcoexist, tmp_buf, length)
#define ex_halbtc8812a1ant_rf_status_notify(btcoexist, type)
#define ex_halbtc8812a1ant_halt_notify(btcoexist)
#define ex_halbtc8812a1ant_pnp_notify(btcoexist, pnp_state)
#define ex_halbtc8812a1ant_coex_dm_reset(btcoexist)
#define ex_halbtc8812a1ant_periodical(btcoexist)
#define ex_halbtc8812a1ant_dbg_control(btcoexist, op_code, op_len, pdata)
#define ex_halbtc8812a1ant_display_coex_info(btcoexist)
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,202 @@
#if (BT_SUPPORT == 1 && COEX_SUPPORT == 1)
#if (RTL8812A_SUPPORT == 1)
/* *******************************************
* The following is for 8812A 2Ant BT Co-exist definition
* ******************************************* */
#define BT_AUTO_REPORT_ONLY_8812A_2ANT 0
#define BT_INFO_8812A_2ANT_B_FTP BIT(7)
#define BT_INFO_8812A_2ANT_B_A2DP BIT(6)
#define BT_INFO_8812A_2ANT_B_HID BIT(5)
#define BT_INFO_8812A_2ANT_B_SCO_BUSY BIT(4)
#define BT_INFO_8812A_2ANT_B_ACL_BUSY BIT(3)
#define BT_INFO_8812A_2ANT_B_INQ_PAGE BIT(2)
#define BT_INFO_8812A_2ANT_B_SCO_ESCO BIT(1)
#define BT_INFO_8812A_2ANT_B_CONNECTION BIT(0)
#define BT_INFO_8812A_2ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT(0))) ? true : false)
#define BTC_RSSI_COEX_THRESH_TOL_8812A_2ANT 2
enum bt_info_src_8812a_2ant {
BT_INFO_SRC_8812A_2ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8812A_2ANT_BT_RSP = 0x1,
BT_INFO_SRC_8812A_2ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8812A_2ANT_MAX
};
enum bt_8812a_2ant_bt_status {
BT_8812A_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8812A_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8812A_2ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8812A_2ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8812A_2ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8812A_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8812A_2ANT_BT_STATUS_MAX
};
enum bt_8812a_2ant_coex_algo {
BT_8812A_2ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8812A_2ANT_COEX_ALGO_SCO = 0x1,
BT_8812A_2ANT_COEX_ALGO_SCO_HID = 0x2,
BT_8812A_2ANT_COEX_ALGO_HID = 0x3,
BT_8812A_2ANT_COEX_ALGO_A2DP = 0x4,
BT_8812A_2ANT_COEX_ALGO_A2DP_PANHS = 0x5,
BT_8812A_2ANT_COEX_ALGO_PANEDR = 0x6,
BT_8812A_2ANT_COEX_ALGO_PANHS = 0x7,
BT_8812A_2ANT_COEX_ALGO_PANEDR_A2DP = 0x8,
BT_8812A_2ANT_COEX_ALGO_PANEDR_HID = 0x9,
BT_8812A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0xa,
BT_8812A_2ANT_COEX_ALGO_HID_A2DP_PANHS = 0xb,
BT_8812A_2ANT_COEX_ALGO_HID_A2DP = 0xc,
BT_8812A_2ANT_COEX_ALGO_MAX = 0xd
};
struct coex_dm_8812a_2ant {
/* fw mechanism */
u8 pre_bt_dec_pwr_lvl;
u8 cur_bt_dec_pwr_lvl;
u8 pre_fw_dac_swing_lvl;
u8 cur_fw_dac_swing_lvl;
boolean cur_ignore_wlan_act;
boolean pre_ignore_wlan_act;
u8 pre_ps_tdma;
u8 cur_ps_tdma;
u8 ps_tdma_para[5];
u8 ps_tdma_du_adj_type;
boolean auto_tdma_adjust;
boolean auto_tdma_adjust_low_rssi;
boolean pre_ps_tdma_on;
boolean cur_ps_tdma_on;
boolean pre_bt_auto_report;
boolean cur_bt_auto_report;
u8 pre_lps;
u8 cur_lps;
u8 pre_rpwm;
u8 cur_rpwm;
/* sw mechanism */
boolean pre_rf_rx_lpf_shrink;
boolean cur_rf_rx_lpf_shrink;
u32 bt_rf_0x1e_backup;
boolean pre_low_penalty_ra;
boolean cur_low_penalty_ra;
boolean pre_dac_swing_on;
u32 pre_dac_swing_lvl;
boolean cur_dac_swing_on;
u32 cur_dac_swing_lvl;
boolean pre_adc_back_off;
boolean cur_adc_back_off;
boolean pre_agc_table_en;
boolean cur_agc_table_en;
u32 pre_val0x6c0;
u32 cur_val0x6c0;
u32 pre_val0x6c4;
u32 cur_val0x6c4;
u32 pre_val0x6c8;
u32 cur_val0x6c8;
u8 pre_val0x6cc;
u8 cur_val0x6cc;
boolean limited_dig;
u32 backup_arfr_cnt1; /* Auto Rate Fallback Retry cnt */
u32 backup_arfr_cnt2; /* Auto Rate Fallback Retry cnt */
u16 backup_retry_limit;
u8 backup_ampdu_max_time;
/* algorithm related */
u8 pre_algorithm;
u8 cur_algorithm;
u8 bt_status;
u8 wifi_chnl_info[3];
u32 pre_ra_mask;
u32 cur_ra_mask;
u8 cur_ra_mask_type;
u8 pre_arfr_type;
u8 cur_arfr_type;
u8 pre_retry_limit_type;
u8 cur_retry_limit_type;
u8 pre_ampdu_time_type;
u8 cur_ampdu_time_type;
};
struct coex_sta_8812a_2ant {
boolean bt_disabled;
boolean bt_link_exist;
boolean sco_exist;
boolean a2dp_exist;
boolean hid_exist;
boolean pan_exist;
boolean acl_busy;
boolean under_lps;
boolean under_ips;
u32 high_priority_tx;
u32 high_priority_rx;
u32 low_priority_tx;
u32 low_priority_rx;
u8 bt_rssi;
u8 pre_bt_rssi_state;
u8 pre_wifi_rssi_state[4];
boolean c2h_bt_info_req_sent;
u8 bt_info_c2h[BT_INFO_SRC_8812A_2ANT_MAX][10];
u32 bt_info_c2h_cnt[BT_INFO_SRC_8812A_2ANT_MAX];
u32 bt_info_query_cnt;
boolean c2h_bt_inquiry_page;
u8 bt_retry_cnt;
u8 bt_info_ext;
};
/* *******************************************
* The following is interface which will notify coex module.
* ******************************************* */
void ex_halbtc8812a2ant_power_on_setting(IN struct btc_coexist *btcoexist);
void ex_halbtc8812a2ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only);
void ex_halbtc8812a2ant_init_coex_dm(IN struct btc_coexist *btcoexist);
void ex_halbtc8812a2ant_ips_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a2ant_lps_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a2ant_scan_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a2ant_connect_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a2ant_media_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a2ant_specific_packet_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a2ant_bt_info_notify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length);
void ex_halbtc8812a2ant_rf_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8812a2ant_halt_notify(IN struct btc_coexist *btcoexist);
void ex_halbtc8812a2ant_periodical(IN struct btc_coexist *btcoexist);
void ex_halbtc8812a2ant_display_coex_info(IN struct btc_coexist *btcoexist);
void ex_halbtc8812a2ant_dbg_control(IN struct btc_coexist *btcoexist,
IN u8 op_code, IN u8 op_len, IN u8 *pdata);
#else
#define ex_halbtc8812a2ant_power_on_setting(btcoexist)
#define ex_halbtc8812a2ant_init_hw_config(btcoexist, wifi_only)
#define ex_halbtc8812a2ant_init_coex_dm(btcoexist)
#define ex_halbtc8812a2ant_ips_notify(btcoexist, type)
#define ex_halbtc8812a2ant_lps_notify(btcoexist, type)
#define ex_halbtc8812a2ant_scan_notify(btcoexist, type)
#define ex_halbtc8812a2ant_connect_notify(btcoexist, type)
#define ex_halbtc8812a2ant_media_status_notify(btcoexist, type)
#define ex_halbtc8812a2ant_specific_packet_notify(btcoexist, type)
#define ex_halbtc8812a2ant_bt_info_notify(btcoexist, tmp_buf, length)
#define ex_halbtc8812a2ant_rf_status_notify(btcoexist, type)
#define ex_halbtc8812a2ant_halt_notify(btcoexist)
#define ex_halbtc8812a2ant_periodical(btcoexist)
#define ex_halbtc8812a2ant_display_coex_info(btcoexist)
#define ex_halbtc8812a2ant_dbg_control(btcoexist, op_code, op_len, pdata)
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,197 @@
#if (BT_SUPPORT == 1 && COEX_SUPPORT == 1)
#if (RTL8821A_SUPPORT == 1)
/* *******************************************
* The following is for 8821A 1ANT BT Co-exist definition
* ******************************************* */
#define BT_AUTO_REPORT_ONLY_8821A_1ANT 1
#define BT_INFO_8821A_1ANT_B_FTP BIT(7)
#define BT_INFO_8821A_1ANT_B_A2DP BIT(6)
#define BT_INFO_8821A_1ANT_B_HID BIT(5)
#define BT_INFO_8821A_1ANT_B_SCO_BUSY BIT(4)
#define BT_INFO_8821A_1ANT_B_ACL_BUSY BIT(3)
#define BT_INFO_8821A_1ANT_B_INQ_PAGE BIT(2)
#define BT_INFO_8821A_1ANT_B_SCO_ESCO BIT(1)
#define BT_INFO_8821A_1ANT_B_CONNECTION BIT(0)
#define BT_INFO_8821A_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
(((_BT_INFO_EXT_&BIT(0))) ? true : false)
#define BTC_RSSI_COEX_THRESH_TOL_8821A_1ANT 2
enum bt_info_src_8821a_1ant {
BT_INFO_SRC_8821A_1ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8821A_1ANT_BT_RSP = 0x1,
BT_INFO_SRC_8821A_1ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8821A_1ANT_MAX
};
enum bt_8821a_1ant_bt_status {
BT_8821A_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8821A_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8821A_1ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8821A_1ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8821A_1ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8821A_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8821A_1ANT_BT_STATUS_MAX
};
enum bt_8821a_1ant_wifi_status {
BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SPECIFIC_PKT = 0x3,
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
BT_8821A_1ANT_WIFI_STATUS_MAX
};
enum bt_8821a_1ant_coex_algo {
BT_8821A_1ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8821A_1ANT_COEX_ALGO_SCO = 0x1,
BT_8821A_1ANT_COEX_ALGO_HID = 0x2,
BT_8821A_1ANT_COEX_ALGO_A2DP = 0x3,
BT_8821A_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8821A_1ANT_COEX_ALGO_PANEDR = 0x5,
BT_8821A_1ANT_COEX_ALGO_PANHS = 0x6,
BT_8821A_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8821A_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8821A_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8821A_1ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8821A_1ANT_COEX_ALGO_MAX = 0xb,
};
struct coex_dm_8821a_1ant {
/* fw mechanism */
boolean cur_ignore_wlan_act;
boolean pre_ignore_wlan_act;
u8 pre_ps_tdma;
u8 cur_ps_tdma;
u8 ps_tdma_para[5];
u8 ps_tdma_du_adj_type;
boolean auto_tdma_adjust;
boolean pre_ps_tdma_on;
boolean cur_ps_tdma_on;
boolean pre_bt_auto_report;
boolean cur_bt_auto_report;
u8 pre_lps;
u8 cur_lps;
u8 pre_rpwm;
u8 cur_rpwm;
/* sw mechanism */
boolean pre_low_penalty_ra;
boolean cur_low_penalty_ra;
u32 pre_val0x6c0;
u32 cur_val0x6c0;
u32 pre_val0x6c4;
u32 cur_val0x6c4;
u32 pre_val0x6c8;
u32 cur_val0x6c8;
u8 pre_val0x6cc;
u8 cur_val0x6cc;
u32 backup_arfr_cnt1; /* Auto Rate Fallback Retry cnt */
u32 backup_arfr_cnt2; /* Auto Rate Fallback Retry cnt */
u16 backup_retry_limit;
u8 backup_ampdu_max_time;
/* algorithm related */
u8 pre_algorithm;
u8 cur_algorithm;
u8 bt_status;
u8 wifi_chnl_info[3];
u32 pre_ra_mask;
u32 cur_ra_mask;
u8 pre_arfr_type;
u8 cur_arfr_type;
u8 pre_retry_limit_type;
u8 cur_retry_limit_type;
u8 pre_ampdu_time_type;
u8 cur_ampdu_time_type;
u32 arp_cnt;
u8 error_condition;
};
struct coex_sta_8821a_1ant {
boolean bt_disabled;
boolean bt_link_exist;
boolean sco_exist;
boolean a2dp_exist;
boolean hid_exist;
boolean pan_exist;
boolean under_lps;
boolean under_ips;
u32 specific_pkt_period_cnt;
u32 high_priority_tx;
u32 high_priority_rx;
u32 low_priority_tx;
u32 low_priority_rx;
u8 bt_rssi;
boolean bt_tx_rx_mask;
u8 pre_bt_rssi_state;
u8 pre_wifi_rssi_state[4];
boolean c2h_bt_info_req_sent;
u8 bt_info_c2h[BT_INFO_SRC_8821A_1ANT_MAX][10];
u32 bt_info_c2h_cnt[BT_INFO_SRC_8821A_1ANT_MAX];
boolean c2h_bt_inquiry_page;
boolean c2h_bt_page; /* Add for win8.1 page out issue */
boolean wifi_is_high_pri_task; /* Add for win8.1 page out issue */
u8 bt_retry_cnt;
u8 bt_info_ext;
boolean
bt_whck_test; /* Add for ASUS WHQL TEST that enable wifi test bt */
};
/* *******************************************
* The following is interface which will notify coex module.
* ******************************************* */
void ex_halbtc8821a1ant_power_on_setting(IN struct btc_coexist *btcoexist);
void ex_halbtc8821a1ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only);
void ex_halbtc8821a1ant_init_coex_dm(IN struct btc_coexist *btcoexist);
void ex_halbtc8821a1ant_ips_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a1ant_lps_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a1ant_scan_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a1ant_connect_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a1ant_media_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a1ant_specific_packet_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a1ant_bt_info_notify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length);
void ex_halbtc8821a1ant_halt_notify(IN struct btc_coexist *btcoexist);
void ex_halbtc8821a1ant_pnp_notify(IN struct btc_coexist *btcoexist,
IN u8 pnp_state);
void ex_halbtc8821a1ant_periodical(IN struct btc_coexist *btcoexist);
void ex_halbtc8821a1ant_display_coex_info(IN struct btc_coexist *btcoexist);
#else
#define ex_halbtc8821a1ant_power_on_setting(btcoexist)
#define ex_halbtc8821a1ant_init_hw_config(btcoexist, wifi_only)
#define ex_halbtc8821a1ant_init_coex_dm(btcoexist)
#define ex_halbtc8821a1ant_ips_notify(btcoexist, type)
#define ex_halbtc8821a1ant_lps_notify(btcoexist, type)
#define ex_halbtc8821a1ant_scan_notify(btcoexist, type)
#define ex_halbtc8821a1ant_connect_notify(btcoexist, type)
#define ex_halbtc8821a1ant_media_status_notify(btcoexist, type)
#define ex_halbtc8821a1ant_specific_packet_notify(btcoexist, type)
#define ex_halbtc8821a1ant_bt_info_notify(btcoexist, tmp_buf, length)
#define ex_halbtc8821a1ant_halt_notify(btcoexist)
#define ex_halbtc8821a1ant_pnp_notify(btcoexist, pnp_state)
#define ex_halbtc8821a1ant_periodical(btcoexist)
#define ex_halbtc8821a1ant_display_coex_info(btcoexist)
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,205 @@
#if (BT_SUPPORT == 1 && COEX_SUPPORT == 1)
#if (RTL8821A_SUPPORT == 1)
/* *******************************************
* The following is for 8821A 2Ant BT Co-exist definition
* ******************************************* */
#define BT_AUTO_REPORT_ONLY_8821A_2ANT 1
#define BT_INFO_8821A_2ANT_B_FTP BIT(7)
#define BT_INFO_8821A_2ANT_B_A2DP BIT(6)
#define BT_INFO_8821A_2ANT_B_HID BIT(5)
#define BT_INFO_8821A_2ANT_B_SCO_BUSY BIT(4)
#define BT_INFO_8821A_2ANT_B_ACL_BUSY BIT(3)
#define BT_INFO_8821A_2ANT_B_INQ_PAGE BIT(2)
#define BT_INFO_8821A_2ANT_B_SCO_ESCO BIT(1)
#define BT_INFO_8821A_2ANT_B_CONNECTION BIT(0)
#define BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT 2
#define BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES 42 /* WiFi RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation */
#define BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES 46 /* BT RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation */
enum bt_info_src_8821a_2ant {
BT_INFO_SRC_8821A_2ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8821A_2ANT_BT_RSP = 0x1,
BT_INFO_SRC_8821A_2ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8821A_2ANT_MAX
};
enum bt_8821a_2ant_bt_status {
BT_8821A_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8821A_2ANT_BT_STATUS_INQ_PAGE = 0x2,
BT_8821A_2ANT_BT_STATUS_ACL_BUSY = 0x3,
BT_8821A_2ANT_BT_STATUS_SCO_BUSY = 0x4,
BT_8821A_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
BT_8821A_2ANT_BT_STATUS_MAX
};
enum bt_8821a_2ant_coex_algo {
BT_8821A_2ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8821A_2ANT_COEX_ALGO_SCO = 0x1,
BT_8821A_2ANT_COEX_ALGO_HID = 0x2,
BT_8821A_2ANT_COEX_ALGO_A2DP = 0x3,
BT_8821A_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8821A_2ANT_COEX_ALGO_PANEDR = 0x5,
BT_8821A_2ANT_COEX_ALGO_PANHS = 0x6,
BT_8821A_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8821A_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8821A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8821A_2ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8821A_2ANT_COEX_ALGO_MAX = 0xb,
};
struct coex_dm_8821a_2ant {
/* fw mechanism */
u8 pre_bt_dec_pwr_lvl;
u8 cur_bt_dec_pwr_lvl;
u8 pre_fw_dac_swing_lvl;
u8 cur_fw_dac_swing_lvl;
boolean cur_ignore_wlan_act;
boolean pre_ignore_wlan_act;
u8 pre_ps_tdma;
u8 cur_ps_tdma;
u8 ps_tdma_para[5];
u8 ps_tdma_du_adj_type;
boolean reset_tdma_adjust;
boolean auto_tdma_adjust;
boolean pre_ps_tdma_on;
boolean cur_ps_tdma_on;
boolean pre_bt_auto_report;
boolean cur_bt_auto_report;
/* sw mechanism */
boolean pre_rf_rx_lpf_shrink;
boolean cur_rf_rx_lpf_shrink;
u32 bt_rf_0x1e_backup;
boolean pre_low_penalty_ra;
boolean cur_low_penalty_ra;
boolean pre_dac_swing_on;
u32 pre_dac_swing_lvl;
boolean cur_dac_swing_on;
u32 cur_dac_swing_lvl;
boolean pre_adc_back_off;
boolean cur_adc_back_off;
boolean pre_agc_table_en;
boolean cur_agc_table_en;
u32 pre_val0x6c0;
u32 cur_val0x6c0;
u32 pre_val0x6c4;
u32 cur_val0x6c4;
u32 pre_val0x6c8;
u32 cur_val0x6c8;
u8 pre_val0x6cc;
u8 cur_val0x6cc;
boolean limited_dig;
/* algorithm related */
u8 pre_algorithm;
u8 cur_algorithm;
u8 bt_status;
u8 wifi_chnl_info[3];
boolean need_recover0x948;
u32 backup0x948;
u8 pre_lps;
u8 cur_lps;
u8 pre_rpwm;
u8 cur_rpwm;
};
struct coex_sta_8821a_2ant {
boolean bt_disabled;
boolean bt_link_exist;
boolean sco_exist;
boolean a2dp_exist;
boolean hid_exist;
boolean pan_exist;
boolean under_lps;
boolean under_ips;
u32 high_priority_tx;
u32 high_priority_rx;
u32 low_priority_tx;
u32 low_priority_rx;
u8 bt_rssi;
boolean bt_tx_rx_mask;
u8 pre_bt_rssi_state;
u8 pre_wifi_rssi_state[4];
boolean c2h_bt_info_req_sent;
u8 bt_info_c2h[BT_INFO_SRC_8821A_2ANT_MAX][10];
u32 bt_info_c2h_cnt[BT_INFO_SRC_8821A_2ANT_MAX];
boolean bt_whck_test;
boolean c2h_bt_inquiry_page;
u8 bt_retry_cnt;
u8 bt_info_ext;
u32 crc_ok_cck;
u32 crc_ok_11g;
u32 crc_ok_11n;
u32 crc_ok_11n_agg;
u32 crc_err_cck;
u32 crc_err_11g;
u32 crc_err_11n;
u32 crc_err_11n_agg;
u8 coex_table_type;
boolean force_lps_on;
u8 dis_ver_info_cnt;
};
/* *******************************************
* The following is interface which will notify coex module.
* ******************************************* */
void ex_halbtc8821a2ant_power_on_setting(IN struct btc_coexist *btcoexist);
void ex_halbtc8821a2ant_pre_load_firmware(IN struct btc_coexist *btcoexist);
void ex_halbtc8821a2ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only);
void ex_halbtc8821a2ant_init_coex_dm(IN struct btc_coexist *btcoexist);
void ex_halbtc8821a2ant_ips_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a2ant_lps_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a2ant_scan_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a2ant_connect_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a2ant_media_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a2ant_specific_packet_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821a2ant_bt_info_notify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length);
void ex_halbtc8821a2ant_halt_notify(IN struct btc_coexist *btcoexist);
void ex_halbtc8821a2ant_pnp_notify(IN struct btc_coexist *btcoexist,
IN u8 pnp_state);
void ex_halbtc8821a2ant_periodical(IN struct btc_coexist *btcoexist);
void ex_halbtc8821a2ant_display_coex_info(IN struct btc_coexist *btcoexist);
#else
#define ex_halbtc8821a2ant_power_on_setting(btcoexist)
#define ex_halbtc8821a2ant_pre_load_firmware(btcoexist)
#define ex_halbtc8821a2ant_init_hw_config(btcoexist, wifi_only)
#define ex_halbtc8821a2ant_init_coex_dm(btcoexist)
#define ex_halbtc8821a2ant_ips_notify(btcoexist, type)
#define ex_halbtc8821a2ant_lps_notify(btcoexist, type)
#define ex_halbtc8821a2ant_scan_notify(btcoexist, type)
#define ex_halbtc8821a2ant_connect_notify(btcoexist, type)
#define ex_halbtc8821a2ant_media_status_notify(btcoexist, type)
#define ex_halbtc8821a2ant_specific_packet_notify(btcoexist, type)
#define ex_halbtc8821a2ant_bt_info_notify(btcoexist, tmp_buf, length)
#define ex_halbtc8821a2ant_halt_notify(btcoexist)
#define ex_halbtc8821a2ant_pnp_notify(btcoexist, pnp_state)
#define ex_halbtc8821a2ant_periodical(btcoexist)
#define ex_halbtc8821a2ant_display_coex_info(btcoexist)
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,188 @@
#if (BT_SUPPORT == 1 && COEX_SUPPORT == 1)
#if (RTL8821A_SUPPORT == 1)
/* *******************************************
* The following is for 8821A_CSR 2Ant BT Co-exist definition
* ******************************************* */
#define BT_INFO_8821A_CSR_2ANT_B_FTP BIT(7)
#define BT_INFO_8821A_CSR_2ANT_B_A2DP BIT(6)
#define BT_INFO_8821A_CSR_2ANT_B_HID BIT(5)
#define BT_INFO_8821A_CSR_2ANT_B_SCO_BUSY BIT(4)
#define BT_INFO_8821A_CSR_2ANT_B_ACL_BUSY BIT(3)
#define BT_INFO_8821A_CSR_2ANT_B_INQ_PAGE BIT(2)
#define BT_INFO_8821A_CSR_2ANT_B_SCO_ESCO BIT(1)
#define BT_INFO_8821A_CSR_2ANT_B_CONNECTION BIT(0)
#define BTC_RSSI_COEX_THRESH_TOL_8821A_CSR_2ANT 2
enum bt_info_src_8821a_csr_2ant {
BT_INFO_SRC_8821A_CSR_2ANT_WIFI_FW = 0x0,
BT_INFO_SRC_8821A_CSR_2ANT_BT_RSP = 0x1,
BT_INFO_SRC_8821A_CSR_2ANT_BT_ACTIVE_SEND = 0x2,
BT_INFO_SRC_8821A_CSR_2ANT_MAX
};
enum bt_8821a_csr_2ant_bt_status {
BT_8821A_CSR_2ANT_BT_STATUS_IDLE = 0x0,
BT_8821A_CSR_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
BT_8821A_CSR_2ANT_BT_STATUS_NON_IDLE = 0x2,
BT_8821A_CSR_2ANT_BT_STATUS_MAX
};
enum bt_8821a_csr_2ant_coex_algo {
BT_8821A_CSR_2ANT_COEX_ALGO_UNDEFINED = 0x0,
BT_8821A_CSR_2ANT_COEX_ALGO_SCO = 0x1,
BT_8821A_CSR_2ANT_COEX_ALGO_HID = 0x2,
BT_8821A_CSR_2ANT_COEX_ALGO_A2DP = 0x3,
BT_8821A_CSR_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR = 0x5,
BT_8821A_CSR_2ANT_COEX_ALGO_PANHS = 0x6,
BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP = 0xa,
BT_8821A_CSR_2ANT_COEX_ALGO_MAX = 0xb,
};
struct coex_dm_8821a_csr_2ant {
/* fw mechanism */
boolean pre_dec_bt_pwr;
boolean cur_dec_bt_pwr;
u8 pre_fw_dac_swing_lvl;
u8 cur_fw_dac_swing_lvl;
boolean cur_ignore_wlan_act;
boolean pre_ignore_wlan_act;
u8 pre_ps_tdma;
u8 cur_ps_tdma;
u8 ps_tdma_para[6];
u8 ps_tdma_du_adj_type;
boolean reset_tdma_adjust;
boolean pre_ps_tdma_on;
boolean cur_ps_tdma_on;
boolean pre_bt_auto_report;
boolean cur_bt_auto_report;
/* sw mechanism */
boolean pre_rf_rx_lpf_shrink;
boolean cur_rf_rx_lpf_shrink;
u32 bt_rf_0x1e_backup;
boolean pre_low_penalty_ra;
boolean cur_low_penalty_ra;
boolean pre_dac_swing_on;
u32 pre_dac_swing_lvl;
boolean cur_dac_swing_on;
u32 cur_dac_swing_lvl;
boolean pre_adc_back_off;
boolean cur_adc_back_off;
boolean pre_agc_table_en;
boolean cur_agc_table_en;
u32 pre_val0x6c0;
u32 cur_val0x6c0;
u32 pre_val0x6c4;
u32 cur_val0x6c4;
u32 pre_val0x6c8;
u32 cur_val0x6c8;
u8 pre_val0x6cc;
u8 cur_val0x6cc;
boolean limited_dig;
u32 pre_ra_mask;
u32 cur_ra_mask;
u8 cur_ampdu_num_type;
u8 pre_ampdu_num_type;
u16 backup_ampdu_max_num;
u8 cur_ampdu_time_type;
u8 pre_ampdu_time_type;
u8 backup_ampdu_max_time;
u8 cur_arfr_type;
u8 pre_arfr_type;
u32 backup_arfr_cnt1;
u32 backup_arfr_cnt2;
u8 cur_retry_limit_type;
u8 pre_retry_limit_type;
u16 backup_retry_limit;
/* algorithm related */
u8 pre_algorithm;
u8 cur_algorithm;
u8 bt_status;
u8 wifi_chnl_info[3];
};
struct coex_sta_8821a_csr_2ant {
boolean bt_disabled;
boolean bt_link_exist;
boolean sco_exist;
boolean a2dp_exist;
boolean slave;
boolean hid_exist;
boolean pan_exist;
boolean under_lps;
boolean under_ips;
u32 high_priority_tx;
u32 high_priority_rx;
u32 low_priority_tx;
u32 low_priority_rx;
u8 bt_rssi;
u8 pre_bt_rssi_state;
u8 pre_wifi_rssi_state[4];
boolean c2h_bt_info_req_sent;
u8 bt_info_c2h[BT_INFO_SRC_8821A_CSR_2ANT_MAX][10];
u32 bt_info_c2h_cnt[BT_INFO_SRC_8821A_CSR_2ANT_MAX];
boolean c2h_bt_inquiry_page;
u8 bt_retry_cnt;
u8 bt_info_ext;
};
/* *******************************************
* The following is interface which will notify coex module.
* ******************************************* */
void ex_halbtc8821aCsr2ant_power_on_setting(IN struct btc_coexist *btcoexist);
void ex_halbtc8821aCsr2ant_init_hw_config(IN struct btc_coexist *btcoexist,
IN boolean wifi_only);
void ex_halbtc8821aCsr2ant_init_coex_dm(IN struct btc_coexist *btcoexist);
void ex_halbtc8821aCsr2ant_ips_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821aCsr2ant_lps_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821aCsr2ant_scan_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821aCsr2ant_connect_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821aCsr2ant_media_status_notify(IN struct btc_coexist *btcoexist,
IN u8 type);
void ex_halbtc8821aCsr2ant_specific_packet_notify(IN struct btc_coexist
*btcoexist, IN u8 type);
void ex_halbtc8821aCsr2ant_bt_info_notify(IN struct btc_coexist *btcoexist,
IN u8 *tmp_buf, IN u8 length);
void ex_halbtc8821aCsr2ant_halt_notify(IN struct btc_coexist *btcoexist);
void ex_halbtc8821aCsr2ant_pnp_notify(IN struct btc_coexist *btcoexist,
IN u8 pnp_state);
void ex_halbtc8821aCsr2ant_periodical(IN struct btc_coexist *btcoexist);
void ex_halbtc8821aCsr2ant_display_coex_info(IN struct btc_coexist *btcoexist);
#else
#define ex_halbtc8821aCsr2ant_power_on_setting(btcoexist)
#define ex_halbtc8821aCsr2ant_init_hw_config(btcoexist, wifi_only)
#define ex_halbtc8821aCsr2ant_init_coex_dm(btcoexist)
#define ex_halbtc8821aCsr2ant_ips_notify(btcoexist, type)
#define ex_halbtc8821aCsr2ant_lps_notify(btcoexist, type)
#define ex_halbtc8821aCsr2ant_scan_notify(btcoexist, type)
#define ex_halbtc8821aCsr2ant_connect_notify(btcoexist, type)
#define ex_halbtc8821aCsr2ant_media_status_notify(btcoexist, type)
#define ex_halbtc8821aCsr2ant_specific_packet_notify(btcoexist, type)
#define ex_halbtc8821aCsr2ant_bt_info_notify(btcoexist, tmp_buf, length)
#define ex_halbtc8821aCsr2ant_halt_notify(btcoexist)
#define ex_halbtc8821aCsr2ant_pnp_notify(btcoexist, pnp_state)
#define ex_halbtc8821aCsr2ant_periodical(btcoexist)
#define ex_halbtc8821aCsr2ant_display_coex_info(btcoexist)
#endif
#endif

View File

@ -1,6 +1,16 @@
#ifndef __HALBTC_OUT_SRC_H__
#define __HALBTC_OUT_SRC_H__
#define BTC_COEX_OFFLOAD 0
#define BTC_TMP_BUF_SHORT 20
extern u1Byte gl_btc_trace_buf[];
#define BTC_SPRINTF rsprintf
#define BTC_TRACE(_MSG_) RT_TRACE(COMP_COEX, DBG_LOUD, (_MSG_))
#define BT_PrintData(adapter, _MSG_, len, data) RT_PRINT_DATA(COMP_COEX, DBG_LOUD, (_MSG_), data, len)
#define NORMAL_EXEC FALSE
#define FORCE_EXEC TRUE
@ -11,11 +21,10 @@
#define BTC_RF_B 0x1
#define BTC_RF_C 0x2
#define BTC_RF_D 0x3
#if 0
#define BTC_SMSP SINGLEMAC_SINGLEPHY
#define BTC_DMDP DUALMAC_DUALPHY
#define BTC_DMSP DUALMAC_SINGLEPHY
#endif
#define BTC_MP_UNKNOWN 0xff
#define BT_COEX_ANT_TYPE_PG 0
@ -84,19 +93,18 @@ typedef enum _BTC_CHIP_TYPE{
#define CL_SPRINTF rsprintf
#define CL_PRINTF DCMD_Printf
typedef struct _BTC_BOARD_INFO{
// The following is some board information
u1Byte btChipType;
u1Byte pgAntNum; // pg ant number
u1Byte btdmAntNum; // ant number for btdm
u1Byte btdmAntNumByAntDet; // ant number for btdm after antenna detection
u1Byte btdmAntPos; //Bryant Add to indicate Antenna Position for (pgAntNum = 2) && (btdmAntNum =1) (DPDT+1Ant case)
u1Byte singleAntPath; // current used for 8723b only, 1=>s0, 0=>s1
u1Byte bTfbgaPackage; //for Antenna detect threshold
u1Byte btdmAntDetFinish;
u1Byte antType;
} BTC_BOARD_INFO, *PBTC_BOARD_INFO;
struct btc_board_info{
/* The following is some board information */
u8 bt_chip_type;
u8 pg_ant_num; /* pg ant number */
u8 btdm_ant_num; /* ant number for btdm */
u8 btdm_ant_num_by_ant_det; /* ant number for btdm after antenna detection */
u8 btdm_ant_pos; /* Bryant Add to indicate Antenna Position for (pg_ant_num = 2) && (btdm_ant_num =1) (DPDT+1Ant case) */
u8 single_ant_path; /* current used for 8723b only, 1=>s0, 0=>s1 */
boolean tfbga_package; /* for Antenna detect threshold */
boolean btdm_ant_det_finish;
boolean btdm_ant_det_already_init_phydm;
};
typedef enum _BTC_DBG_OPCODE{
BTC_DBG_SET_COEX_NORMAL = 0x0,
@ -105,6 +113,7 @@ typedef enum _BTC_DBG_OPCODE{
BTC_DBG_SET_COEX_DEC_BT_PWR = 0x3,
BTC_DBG_SET_COEX_BT_AFH_MAP = 0x4,
BTC_DBG_SET_COEX_BT_IGNORE_WLAN_ACT = 0x5,
BTC_DBG_SET_COEX_MANUAL_CTRL = 0x6,
BTC_DBG_MAX
}BTC_DBG_OPCODE,*PBTC_DBG_OPCODE;
@ -180,7 +189,7 @@ typedef enum _BTC_IOT_PEER
}BTC_IOT_PEER, *PBTC_IOT_PEER;
//for 8723b-d cut large current issue
typedef enum _BT_WIFI_COEX_STATE{
typedef enum _BTC_WIFI_COEX_STATE{
BTC_WIFI_STAT_INIT,
BTC_WIFI_STAT_IQK,
BTC_WIFI_STAT_NORMAL_OFF,
@ -188,16 +197,23 @@ typedef enum _BT_WIFI_COEX_STATE{
BTC_WIFI_STAT_NORMAL,
BTC_WIFI_STAT_ANT_DIV,
BTC_WIFI_STAT_MAX
}BT_WIFI_COEX_STATE,*PBT_WIFI_COEX_STATE;
}BTC_WIFI_COEX_STATE,*PBTC_WIFI_COEX_STATE;
typedef enum _BT_ANT_TYPE{
typedef enum _BTC_ANT_TYPE{
BTC_ANT_TYPE_0,
BTC_ANT_TYPE_1,
BTC_ANT_TYPE_2,
BTC_ANT_TYPE_3,
BTC_ANT_TYPE_4,
BTC_ANT_TYPE_MAX
}BT_ANT_TYPE,*PBT_ANT_TYPE;
}BTC_ANT_TYPE,*PBTC_ANT_TYPE;
typedef enum _BTC_VENDOR{
BTC_VENDOR_LENOVO,
BTC_VENDOR_ASUS,
BTC_VENDOR_OTHER
}BTC_VENDOR,*PBTC_VENDOR;
// defined for BFP_BTC_GET
typedef enum _BTC_GET_TYPE{
@ -217,6 +233,7 @@ typedef enum _BTC_GET_TYPE{
BTC_GET_BL_EXT_SWITCH,
BTC_GET_BL_WIFI_IS_IN_MP_MODE,
BTC_GET_BL_IS_ASUS_8723B,
BTC_GET_BL_FW_READY,
// type s4Byte
BTC_GET_S4_WIFI_RSSI,
@ -228,6 +245,7 @@ typedef enum _BTC_GET_TYPE{
BTC_GET_U4_WIFI_FW_VER,
BTC_GET_U4_WIFI_LINK_STATUS,
BTC_GET_U4_BT_PATCH_VER,
BTC_GET_U4_VENDOR,
// type u1Byte
BTC_GET_U1_WIFI_DOT11_CHNL,
@ -248,6 +266,7 @@ typedef enum _BTC_GET_TYPE{
typedef enum _BTC_SET_TYPE{
// type BOOLEAN
BTC_SET_BL_BT_DISABLE,
BTC_SET_BL_BT_ENABLE_DISABLE_CHANGE,
BTC_SET_BL_BT_TRAFFIC_BUSY,
BTC_SET_BL_BT_LIMITED_DIG,
BTC_SET_BL_FORCE_TO_ROAM,
@ -264,6 +283,7 @@ typedef enum _BTC_SET_TYPE{
// type trigger some action
BTC_SET_ACT_GET_BT_RSSI,
BTC_SET_ACT_AGGREGATE_CTRL,
BTC_SET_ACT_ANTPOSREGRISTRY_CTRL,
//===== for 1Ant ======
// type BOOLEAN
@ -318,13 +338,13 @@ typedef enum _BTC_NOTIFY_TYPE_MEDIA_STATUS{
BTC_MEDIA_CONNECT = 0x1,
BTC_MEDIA_MAX
}BTC_NOTIFY_TYPE_MEDIA_STATUS,*PBTC_NOTIFY_TYPE_MEDIA_STATUS;
typedef enum _BTC_NOTIFY_TYPE_SPECIAL_PACKET{
typedef enum _BTC_NOTIFY_TYPE_SPECIFIC_PACKET{
BTC_PACKET_UNKNOWN = 0x0,
BTC_PACKET_DHCP = 0x1,
BTC_PACKET_ARP = 0x2,
BTC_PACKET_EAPOL = 0x3,
BTC_PACKET_MAX
}BTC_NOTIFY_TYPE_SPECIAL_PACKET,*PBTC_NOTIFY_TYPE_SPECIAL_PACKET;
}BTC_NOTIFY_TYPE_SPECIFIC_PACKET,*PBTC_NOTIFY_TYPE_SPECIFIC_PACKET;
typedef enum _BTC_NOTIFY_TYPE_STACK_OPERATION{
BTC_STACK_OP_NONE = 0x0,
BTC_STACK_OP_INQ_PAGE_PAIR_START = 0x1,
@ -338,6 +358,121 @@ typedef enum _BTC_ANTENNA_POS{
BTC_ANTENNA_AT_AUX_PORT = 0x2,
}BTC_ANTENNA_POS,*PBTC_ANTENNA_POS;
//Bryant Add
typedef enum _BTC_BT_OFFON{
BTC_BT_OFF = 0x0,
BTC_BT_ON = 0x1,
}BTC_BTOFFON,*PBTC_BT_OFFON;
//==================================================
// For following block is for coex offload
//==================================================
typedef struct _COL_H2C{
u1Byte opcode;
u1Byte opcode_ver:4;
u1Byte req_num:4;
u1Byte buf[1];
}COL_H2C, *PCOL_H2C;
#define COL_C2H_ACK_HDR_LEN 3
typedef struct _COL_C2H_ACK{
u1Byte status;
u1Byte opcode_ver:4;
u1Byte req_num:4;
u1Byte ret_len;
u1Byte buf[1];
}COL_C2H_ACK, *PCOL_C2H_ACK;
#define COL_C2H_IND_HDR_LEN 3
typedef struct _COL_C2H_IND{
u1Byte type;
u1Byte version;
u1Byte length;
u1Byte data[1];
}COL_C2H_IND, *PCOL_C2H_IND;
//============================================
// NOTE: for debug message, the following define should match
// the strings in coexH2cResultString.
//============================================
typedef enum _COL_H2C_STATUS{
// c2h status
COL_STATUS_C2H_OK = 0x00, // Wifi received H2C request and check content ok.
COL_STATUS_C2H_UNKNOWN = 0x01, // Not handled routine
COL_STATUS_C2H_UNKNOWN_OPCODE = 0x02, // Invalid OP code, It means that wifi firmware received an undefiend OP code.
COL_STATUS_C2H_OPCODE_VER_MISMATCH = 0x03, // Wifi firmware and wifi driver mismatch, need to update wifi driver or wifi or.
COL_STATUS_C2H_PARAMETER_ERROR = 0x04, // Error paraneter.(ex: parameters = NULL but it should have values)
COL_STATUS_C2H_PARAMETER_OUT_OF_RANGE = 0x05, // Wifi firmware needs to check the parameters from H2C request and return the status.(ex: ch = 500, it's wrong)
// other COL status start from here
COL_STATUS_C2H_REQ_NUM_MISMATCH , // c2h req_num mismatch, means this c2h is not we expected.
COL_STATUS_H2C_HALMAC_FAIL , // HALMAC return fail.
COL_STATUS_H2C_TIMTOUT , // not received the c2h response from fw
COL_STATUS_INVALID_C2H_LEN , // invalid coex offload c2h ack length, must >= 3
COL_STATUS_COEX_DATA_OVERFLOW , // coex returned length over the c2h ack length.
COL_STATUS_MAX
}COL_H2C_STATUS,*PCOL_H2C_STATUS;
#define COL_MAX_H2C_REQ_NUM 16
#define COL_H2C_BUF_LEN 20
typedef enum _COL_OPCODE{
COL_OP_WIFI_STATUS_NOTIFY = 0x0,
COL_OP_WIFI_PROGRESS_NOTIFY = 0x1,
COL_OP_WIFI_INFO_NOTIFY = 0x2,
COL_OP_WIFI_POWER_STATE_NOTIFY = 0x3,
COL_OP_SET_CONTROL = 0x4,
COL_OP_GET_CONTROL = 0x5,
COL_OP_WIFI_OPCODE_MAX
}COL_OPCODE,*PCOL_OPCODE;
typedef enum _COL_IND_TYPE{
COL_IND_BT_INFO = 0x0,
COL_IND_PSTDMA = 0x1,
COL_IND_LIMITED_TX_RX = 0x2,
COL_IND_COEX_TABLE = 0x3,
COL_IND_REQ = 0x4,
COL_IND_MAX
}COL_IND_TYPE,*PCOL_IND_TYPE;
typedef struct _COL_SINGLE_H2C_RECORD{
u1Byte h2c_buf[COL_H2C_BUF_LEN]; // the latest sent h2c buffer
u4Byte h2c_len;
u1Byte c2h_ack_buf[COL_H2C_BUF_LEN]; // the latest received c2h buffer
u4Byte c2h_ack_len;
u4Byte count; // the total number of the sent h2c command
u4Byte status[COL_STATUS_MAX]; // the c2h status for the sent h2c command
} COL_SINGLE_H2C_RECORD, *PCOL_SINGLE_H2C_RECORD;
typedef struct _COL_SINGLE_C2H_IND_RECORD{
u1Byte ind_buf[COL_H2C_BUF_LEN]; // the latest received c2h indication buffer
u4Byte ind_len;
u4Byte count; // the total number of the rcvd c2h indication
u4Byte status[COL_STATUS_MAX]; // the c2h indication verified status
} COL_SINGLE_C2H_IND_RECORD, *PCOL_SINGLE_C2H_IND_RECORD;
typedef struct _BTC_OFFLOAD{
// H2C command related
u1Byte h2c_req_num;
u4Byte cnt_h2c_sent;
COL_SINGLE_H2C_RECORD h2c_record[COL_OP_WIFI_OPCODE_MAX];
// C2H Ack related
u4Byte cnt_c2h_ack;
u4Byte status[COL_STATUS_MAX];
struct completion c2h_event[COL_MAX_H2C_REQ_NUM]; // for req_num = 1~COL_MAX_H2C_REQ_NUM
u1Byte c2h_ack_buf[COL_MAX_H2C_REQ_NUM][COL_H2C_BUF_LEN];
u1Byte c2h_ack_len[COL_MAX_H2C_REQ_NUM];
// C2H Indication related
u4Byte cnt_c2h_ind;
COL_SINGLE_C2H_IND_RECORD c2h_ind_record[COL_IND_MAX];
u4Byte c2h_ind_status[COL_STATUS_MAX];
u1Byte c2h_ind_buf[COL_H2C_BUF_LEN];
u1Byte c2h_ind_len;
} BTC_OFFLOAD, *PBTC_OFFLOAD;
extern BTC_OFFLOAD gl_coex_offload;
//==================================================
typedef u1Byte
(*BFP_BTC_R1)(
IN PVOID pBtcContext,
@ -433,7 +568,7 @@ typedef BOOLEAN
IN u1Byte setType,
OUT PVOID pInBuf
);
typedef VOID
typedef u2Byte
(*BFP_BTC_SET_BT_REG)(
IN PVOID pBtcContext,
IN u1Byte regType,
@ -446,11 +581,12 @@ typedef BOOLEAN
IN u1Byte txTime,
IN u1Byte btChnl
);
typedef u4Byte
typedef u2Byte
(*BFP_BTC_GET_BT_REG)(
IN PVOID pBtcContext,
IN u1Byte regType,
IN u4Byte offset
IN u4Byte offset,
IN pu4Byte data
);
typedef VOID
(*BFP_BTC_DISP_DBG_MSG)(
@ -458,8 +594,18 @@ typedef VOID
IN u1Byte dispType
);
typedef COL_H2C_STATUS
(*BFP_BTC_COEX_H2C_PROCESS)(
IN PVOID pBtCoexist,
IN u1Byte opcode,
IN u1Byte opcode_ver,
IN pu1Byte ph2c_par,
IN u1Byte h2c_par_len
);
typedef struct _BTC_BT_INFO{
BOOLEAN bBtDisabled;
boolean bt_enable_disable_change;
u1Byte rssiAdjustForAgcTableOn;
u1Byte rssiAdjustFor1AntCoexType;
BOOLEAN bPreBtCtrlAggBufSize;
@ -488,35 +634,35 @@ typedef struct _BTC_BT_INFO{
u4Byte raMask;
} BTC_BT_INFO, *PBTC_BT_INFO;
typedef struct _BTC_STACK_INFO{
BOOLEAN bProfileNotified;
u2Byte hciVersion; // stack hci version
u1Byte numOfLink;
BOOLEAN bBtLinkExist;
BOOLEAN bScoExist;
BOOLEAN bAclExist;
BOOLEAN bA2dpExist;
BOOLEAN bHidExist;
u1Byte numOfHid;
BOOLEAN bPanExist;
BOOLEAN bUnknownAclExist;
s1Byte minBtRssi;
} BTC_STACK_INFO, *PBTC_STACK_INFO;
struct btc_stack_info {
boolean profile_notified;
u16 hci_version; /* stack hci version */
u8 num_of_link;
boolean bt_link_exist;
boolean sco_exist;
boolean acl_exist;
boolean a2dp_exist;
boolean hid_exist;
u8 num_of_hid;
boolean pan_exist;
boolean unknown_acl_exist;
s8 min_bt_rssi;
};
typedef struct _BTC_BT_LINK_INFO{
BOOLEAN bBtLinkExist;
BOOLEAN bBtHiPriLinkExist;
BOOLEAN bScoExist;
BOOLEAN bScoOnly;
BOOLEAN bA2dpExist;
BOOLEAN bA2dpOnly;
BOOLEAN bHidExist;
BOOLEAN bHidOnly;
BOOLEAN bPanExist;
BOOLEAN bPanOnly;
BOOLEAN bSlaveRole;
BOOLEAN bAclBusy;
} BTC_BT_LINK_INFO, *PBTC_BT_LINK_INFO;
struct btc_bt_link_info {
boolean bt_link_exist;
boolean bt_hi_pri_link_exist;
boolean sco_exist;
boolean sco_only;
boolean a2dp_exist;
boolean a2dp_only;
boolean hid_exist;
boolean hid_only;
boolean pan_exist;
boolean pan_only;
boolean slave_role;
boolean acl_busy;
};
typedef struct _BTC_STATISTICS{
u4Byte cntBind;
@ -529,7 +675,7 @@ typedef struct _BTC_STATISTICS{
u4Byte cntScanNotify;
u4Byte cntConnectNotify;
u4Byte cntMediaStatusNotify;
u4Byte cntSpecialPacketNotify;
u4Byte cntSpecificPacketNotify;
u4Byte cntBtInfoNotify;
u4Byte cntRfStatusNotify;
u4Byte cntPeriodical;
@ -538,55 +684,58 @@ typedef struct _BTC_STATISTICS{
u4Byte cntDbgCtrl;
} BTC_STATISTICS, *PBTC_STATISTICS;
typedef struct _BTC_COEXIST{
struct btc_coexist{
BOOLEAN bBinded; // make sure only one adapter can bind the data context
PVOID Adapter; // default adapter
BTC_BOARD_INFO boardInfo;
struct btc_board_info board_info;
BTC_BT_INFO btInfo; // some bt info referenced by non-bt module
BTC_STACK_INFO stackInfo;
BTC_BT_LINK_INFO btLinkInfo;
BTC_CHIP_INTERFACE chipInterface;
struct btc_stack_info stack_info;
struct btc_bt_link_info bt_link_info;
BTC_CHIP_INTERFACE chip_interface;
BOOLEAN bInitilized;
BOOLEAN bStopCoexDm;
BOOLEAN bManualControl;
pu1Byte cliBuf;
BOOLEAN initilized;
BOOLEAN stop_coex_dm;
BOOLEAN manual_control;
pu1Byte cli_buf;
BTC_STATISTICS statistics;
u1Byte pwrModeVal[10];
// function pointers
// io related
BFP_BTC_R1 fBtcRead1Byte;
BFP_BTC_W1 fBtcWrite1Byte;
BFP_BTC_W1_BIT_MASK fBtcWrite1ByteBitMask;
BFP_BTC_R2 fBtcRead2Byte;
BFP_BTC_W2 fBtcWrite2Byte;
BFP_BTC_R4 fBtcRead4Byte;
BFP_BTC_W4 fBtcWrite4Byte;
BFP_BTC_LOCAL_REG_W1 fBtcWriteLocalReg1Byte;
BFP_BTC_R1 btc_read_1byte;
BFP_BTC_W1 btc_write_1byte;
BFP_BTC_W1_BIT_MASK btc_write_1byte_bitmask;
BFP_BTC_R2 btc_read_2byte;
BFP_BTC_W2 btc_write_2byte;
BFP_BTC_R4 btc_read_4byte;
BFP_BTC_W4 btc_write_4byte;
BFP_BTC_LOCAL_REG_W1 btc_write_local_reg_1byte;
// read/write bb related
BFP_BTC_SET_BB_REG fBtcSetBbReg;
BFP_BTC_GET_BB_REG fBtcGetBbReg;
BFP_BTC_SET_BB_REG btc_set_bb_reg;
BFP_BTC_GET_BB_REG btc_get_bb_reg;
// read/write rf related
BFP_BTC_SET_RF_REG fBtcSetRfReg;
BFP_BTC_GET_RF_REG fBtcGetRfReg;
BFP_BTC_SET_RF_REG btc_set_rf_reg;
BFP_BTC_GET_RF_REG btc_get_rf_reg;
// fill h2c related
BFP_BTC_FILL_H2C fBtcFillH2c;
BFP_BTC_FILL_H2C btc_fill_h2c;
// other
BFP_BTC_DISP_DBG_MSG fBtcDispDbgMsg;
BFP_BTC_DISP_DBG_MSG btc_disp_dbg_msg;
// normal get/set related
BFP_BTC_GET fBtcGet;
BFP_BTC_SET fBtcSet;
BFP_BTC_GET btc_get;
BFP_BTC_SET btc_set;
BFP_BTC_GET_BT_REG fBtcGetBtReg;
BFP_BTC_SET_BT_REG fBtcSetBtReg;
BFP_BTC_GET_BT_REG btc_get_bt_reg;
BFP_BTC_SET_BT_REG btc_set_bt_reg;
BFP_BTC_SET_BT_ANT_DETECTION fBtcSetBtAntDetection;
} BTC_COEXIST, *PBTC_COEXIST;
BFP_BTC_SET_BT_ANT_DETECTION btc_set_bt_ant_detection;
extern BTC_COEXIST GLBtCoexist;
BFP_BTC_COEX_H2C_PROCESS btc_coex_h2c_process;
};
typedef struct btc_coexist *PBTC_COEXIST;
extern struct btc_coexist GLBtCoexist;
BOOLEAN
EXhalbtcoutsrc_InitlizeVariables(
@ -635,7 +784,7 @@ EXhalbtcoutsrc_MediaStatusNotify(
IN RT_MEDIA_STATUS mediaStatus
);
VOID
EXhalbtcoutsrc_SpecialPacketNotify(
EXhalbtcoutsrc_SpecificPacketNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte pktType
);
@ -665,6 +814,12 @@ EXhalbtcoutsrc_PnpNotify(
IN u1Byte pnpState
);
VOID
EXhalbtcoutsrc_ScoreBoardStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN pu1Byte tmpBuf,
IN u1Byte length
);
VOID
EXhalbtcoutsrc_CoexDmSwitch(
IN PBTC_COEXIST pBtCoexist
);
@ -732,4 +887,17 @@ EXhalbtcoutsrc_DisplayAntDetection(
IN PBTC_COEXIST pBtCoexist
);
#define MASKBYTE0 0xff
#define MASKBYTE1 0xff00
#define MASKBYTE2 0xff0000
#define MASKBYTE3 0xff000000
#define MASKHWORD 0xffff0000
#define MASKLWORD 0x0000ffff
#define MASKDWORD 0xffffffff
#define MASK12BITS 0xfff
#define MASKH4BITS 0xf0000000
#define MASKOFDM_D 0xffc00000
#define MASKCCK 0x3f3f3f3f
#endif

View File

@ -66,7 +66,17 @@ do {\
} while (0)
#endif
#else
//#define RT_TRACE(dbgtype, dbgflag, printstr)
#define RT_TRACE(dbgtype, dbgflag, printstr)
#endif
#ifdef CONFIG_BT_COEXIST
#define BT_SUPPORT 1
#define COEX_SUPPORT 1
#define HS_SUPPORT 1
#else
#define BT_SUPPORT 0
#define COEX_SUPPORT 0
#define HS_SUPPORT 0
#endif
#include "HalBtcOutSrc.h"
@ -83,5 +93,7 @@ do {\
#include "HalBtc8821a1Ant.h"
#include "HalBtc8821a2Ant.h"
#include "HalBtc8821aCsr2Ant.h"
#include "HalBtc8703b1Ant.h"
#include "HalBtc8703b2Ant.h"
#endif // __MP_PRECOMP_H__

View File

@ -25,6 +25,14 @@
#include "rtl8814a/HalEfuseMask8814A_USB.h"
#endif
#if defined(CONFIG_RTL8703B)
#include "rtl8703b/HalEfuseMask8703B_USB.h"
#endif
#if defined(CONFIG_RTL8188F)
#include "rtl8188f/HalEfuseMask8188F_USB.h"
#endif
#elif DEV_BUS_TYPE == RT_PCI_INTERFACE
#if defined(CONFIG_RTL8188E)
@ -51,10 +59,22 @@
#include "rtl8814a/HalEfuseMask8814A_PCIE.h"
#endif
#if defined(CONFIG_RTL8703B)
#include "rtl8703b/HalEfuseMask8703B_PCIE.h"
#endif
#elif DEV_BUS_TYPE == RT_SDIO_INTERFACE
#if defined(CONFIG_RTL8188E)
#include "rtl8188e/HalEfuseMask8188E_SDIO.h"
#endif
#if defined(CONFIG_RTL8703B)
#include "rtl8703b/HalEfuseMask8703B_SDIO.h"
#endif
#if defined(CONFIG_RTL8188F)
#include "rtl8188f/HalEfuseMask8188F_SDIO.h"
#endif
#endif

View File

@ -21,7 +21,7 @@
//#include "Mp_Precomp.h"
//#include "../odm_precomp.h"
#include <drv_types.h>
#include "../../../hal/OUTSRC/phydm_precomp.h"
#include "HalEfuseMask8723B_PCIE.h"

View File

@ -22,7 +22,7 @@
//#include "../odm_precomp.h"
#include <drv_types.h>
#include "../../../hal/OUTSRC/phydm_precomp.h"
#include "HalEfuseMask8723B_USB.h"
/******************************************************************************
* MUSB.TXT

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,51 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2012 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.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
*
******************************************************************************/
#ifndef __COMMON_C2H_H__
#define __COMMON_C2H_H__
typedef enum _C2H_EVT {
C2H_DBG = 0x00,
C2H_LB = 0x01,
C2H_TXBF = 0x02,
C2H_CCX_TX_RPT = 0x03,
C2H_BT_INFO = 0x09,
C2H_BT_MP_INFO = 0x0B,
C2H_RA_RPT = 0x0C,
C2H_RA_PARA_RPT = 0x0E,
C2H_FW_CHNL_SWITCH_COMPLETE = 0x10,
C2H_IQK_FINISH = 0x11,
C2H_MAILBOX_STATUS = 0x15,
C2H_P2P_RPORT = 0x16,
C2H_MAC_HIDDEN_RPT = 0x19,
C2H_BCN_EARLY_RPT = 0x1E,
C2H_BT_SCOREBOARD_STATUS = 0x20,
C2H_EXTEND = 0xff,
} C2H_EVT;
typedef enum _EXTEND_C2H_EVT {
EXTEND_C2H_DBG_PRINT = 0
} EXTEND_C2H_EVT;
#define MAC_HIDDEN_RPT_LEN 8
int c2h_mac_hidden_rpt_hdl(_adapter *adapter, u8 *data, u8 len);
int hal_read_mac_hidden_rpt(_adapter *adapter);
#endif /* __COMMON_C2H_H__ */

View File

@ -88,10 +88,12 @@ void Init_ODM_ComInfo(_adapter *adapter)
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_PLATFORM, ODM_CE);
if (adapter->interface_type == RTW_GSPI)
rtw_odm_init_ic_type(adapter);
if (rtw_get_intf_type(adapter) == RTW_GSPI)
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_INTERFACE, ODM_ITRF_SDIO);
else
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_INTERFACE, adapter->interface_type);
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_INTERFACE, rtw_get_intf_type(adapter));
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_MP_TEST_CHIP, IS_NORMAL_CHIP(pHalData->VersionID));
@ -161,6 +163,8 @@ void Init_ODM_ComInfo(_adapter *adapter)
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_EXT_TRSW, 0);
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_RF_ANTENNA_TYPE, pHalData->TRxAntDivType);
/* Pointer reference */
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_TX_UNI, &(dvobj->traffic_stat.tx_bytes));
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_RX_UNI, &(dvobj->traffic_stat.rx_bytes));
@ -177,7 +181,12 @@ void Init_ODM_ComInfo(_adapter *adapter)
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SCAN, &(pmlmepriv->bScanInProcess));
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_POWER_SAVING, &(pwrctl->bpower_saving));
/*Add by Yuchen for phydm beamforming*/
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_TX_TP, &(dvobj->traffic_stat.cur_tx_tp));
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_RX_TP, &(dvobj->traffic_stat.cur_rx_tp));
#ifdef CONFIG_USB_HCI
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_HUBUSBMODE, &(dvobj->usb_speed));
#endif
for(i=0; i<ODM_ASSOCIATE_ENTRY_NUM; i++)
ODM_CmnInfoPtrArrayHook(pDM_Odm, ODM_CMNINFO_STA_STATUS, i, NULL);

View File

@ -122,10 +122,14 @@ int usb_init_recv_priv(_adapter *padapter, u16 ini_in_buf_sz)
struct sk_buff *pskb=NULL;
DBG_871X("NR_PREALLOC_RECV_SKB: %d\n", NR_PREALLOC_RECV_SKB);
#ifdef CONFIG_FIX_NR_BULKIN_BUFFER
DBG_871X("Enable CONFIG_FIX_NR_BULKIN_BUFFER\n");
#endif
for(i=0; i<NR_PREALLOC_RECV_SKB; i++)
{
#ifdef CONFIG_PREALLOC_RX_SKB_BUFFER
pskb = rtw_alloc_skb_premem();
pskb = rtw_alloc_skb_premem(MAX_RECVBUF_SZ);
#else
pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
#endif //CONFIG_PREALLOC_RX_SKB_BUFFER

View File

@ -23,6 +23,19 @@
#include <drv_types.h>
#include <hal_data.h>
const u32 _chip_type_to_odm_ic_type[] = {
0,
ODM_RTL8188E,
ODM_RTL8192E,
ODM_RTL8812,
ODM_RTL8821,
ODM_RTL8723B,
ODM_RTL8814A,
ODM_RTL8703B,
ODM_RTL8188F,
0,
};
void rtw_hal_chip_configure(_adapter *padapter)
{
padapter->HalFunc.intf_chip_configure(padapter);
@ -30,12 +43,27 @@ void rtw_hal_chip_configure(_adapter *padapter)
void rtw_hal_read_chip_info(_adapter *padapter)
{
u8 hci_type = rtw_get_intf_type(padapter);
u32 start = rtw_get_current_time();
/* before access eFuse, make sure card enable has been called */
if ((hci_type == RTW_SDIO || hci_type == RTW_GSPI)
&& !rtw_is_hw_init_completed(padapter))
rtw_hal_power_on(padapter);
padapter->HalFunc.read_adapter_info(padapter);
if ((hci_type == RTW_SDIO || hci_type == RTW_GSPI)
&& !rtw_is_hw_init_completed(padapter))
rtw_hal_power_off(padapter);
DBG_871X("%s in %d ms\n", __func__, rtw_get_passing_time_ms(start));
}
void rtw_hal_read_chip_version(_adapter *padapter)
{
padapter->HalFunc.read_chip_version(padapter);
rtw_odm_init_ic_type(padapter);
}
void rtw_hal_def_value_init(_adapter *padapter)
@ -47,10 +75,13 @@ void rtw_hal_def_value_init(_adapter *padapter)
{
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(padapter);
struct hal_spec_t *hal_spec = GET_HAL_SPEC(padapter);
/* hal_data..macid_num is ready here */
dvobj->macid_ctl.num = rtw_min(hal_data->macid_num, MACID_NUM_SW_LIMIT);
/* hal_spec is ready here */
dvobj->macid_ctl.num = rtw_min(hal_spec->macid_num, MACID_NUM_SW_LIMIT);
dvobj->cam_ctl.sec_cap = hal_spec->sec_cap;
dvobj->cam_ctl.num = rtw_min(hal_spec->sec_cam_ent_num, SEC_CAM_ENT_NUM_SW_LIMIT);
}
}
}
@ -96,6 +127,8 @@ void rtw_hal_dm_init(_adapter *padapter)
padapter->HalFunc.dm_init(padapter);
_rtw_spinlock_init(&pHalData->IQKSpinLock);
phy_load_tx_power_ext_info(padapter, 1, 1);
}
}
void rtw_hal_dm_deinit(_adapter *padapter)
@ -125,8 +158,12 @@ u32 rtw_hal_power_on(_adapter *padapter)
return padapter->HalFunc.hal_power_on(padapter);
}
void rtw_hal_power_off(_adapter *padapter)
{
padapter->HalFunc.hal_power_off(padapter);
{
struct macid_ctl_t *macid_ctl = &padapter->dvobj->macid_ctl;
_rtw_memset(macid_ctl->h2c_msr, 0, MACID_NUM_SW_LIMIT);
padapter->HalFunc.hal_power_off(padapter);
}
@ -154,20 +191,17 @@ uint rtw_hal_init(_adapter *padapter)
{
uint status = _SUCCESS;
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
int i;
status = padapter->HalFunc.hal_init(padapter);
if(status == _SUCCESS){
for (i = 0; i<dvobj->iface_nums; i++)
dvobj->padapters[i]->hw_init_completed = _TRUE;
if (status == _SUCCESS) {
pHalData->hw_init_completed = _TRUE;
if (padapter->registrypriv.notch_filter == 1)
rtw_hal_notch_filter(padapter, 1);
rtw_hal_reset_security_engine(padapter);
for (i = 0; i<dvobj->iface_nums; i++)
rtw_sec_restore_wep_key(dvobj->padapters[i]);
@ -181,10 +215,8 @@ uint rtw_hal_init(_adapter *padapter)
rtw_bb_rf_gain_offset(padapter);
#endif //CONFIG_RF_GAIN_OFFSET
}
else{
for (i = 0; i<dvobj->iface_nums; i++)
dvobj->padapters[i]->hw_init_completed = _FALSE;
} else {
pHalData->hw_init_completed = _FALSE;
DBG_871X("rtw_hal_init: hal__init fail\n");
}
@ -198,6 +230,7 @@ uint rtw_hal_deinit(_adapter *padapter)
{
uint status = _SUCCESS;
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
int i;
_func_enter_;
@ -205,10 +238,7 @@ _func_enter_;
if(status == _SUCCESS){
rtw_led_control(padapter, LED_CTL_POWER_OFF);
for (i = 0; i<dvobj->iface_nums; i++) {
padapter = dvobj->padapters[i];
padapter->hw_init_completed = _FALSE;
}
pHalData->hw_init_completed = _FALSE;
}
else
{
@ -284,6 +314,11 @@ u8 rtw_hal_check_ips_status(_adapter *padapter)
return val;
}
s32 rtw_hal_fw_dl(_adapter *padapter, u8 wowlan)
{
return padapter->HalFunc.fw_dl(padapter, wowlan);
}
#if defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
void rtw_hal_clear_interrupt(_adapter *padapter)
{
@ -291,11 +326,6 @@ void rtw_hal_clear_interrupt(_adapter *padapter)
padapter->HalFunc.clear_interrupt(padapter);
#endif
}
void rtw_hal_set_wowlan_fw(_adapter *padapter, u8 sleep)
{
padapter->HalFunc.hal_set_wowlan_fw(padapter, sleep);
}
#endif
#if defined(CONFIG_USB_HCI) || defined (CONFIG_PCI_HCI)
@ -318,7 +348,7 @@ u32 rtw_hal_inirp_deinit(_adapter *padapter)
#if defined(CONFIG_PCI_HCI)
void rtw_hal_irp_reset(_adapter *padapter)
{
padapter->HalFunc.irp_reset(padapter);
padapter->HalFunc.irp_reset(GET_PRIMARY_ADAPTER(padapter));
}
#endif //#if defined(CONFIG_PCI_HCI)
@ -346,30 +376,40 @@ s32 rtw_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe)
s32 rtw_hal_mgnt_xmit(_adapter *padapter, struct xmit_frame *pmgntframe)
{
s32 ret = _FAIL;
unsigned char *pframe;
u8 *pframe, subtype;
struct rtw_ieee80211_hdr *pwlanhdr;
struct sta_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv;
update_mgntframe_attrib_addr(padapter, pmgntframe);
//pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
subtype = GetFrameSubType(pframe); /* bit(7)~bit(2) */
//pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
//_rtw_memcpy(pmgntframe->attrib.ra, pwlanhdr->addr1, ETH_ALEN);
#ifdef CONFIG_IEEE80211W
if(padapter->securitypriv.binstallBIPkey == _TRUE)
if (padapter->securitypriv.binstallBIPkey == _TRUE && (subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC ||
subtype == WIFI_ACTION))
{
if(IS_MCAST(pmgntframe->attrib.ra))
{
if (IS_MCAST(pmgntframe->attrib.ra) && pmgntframe->attrib.key_type != IEEE80211W_NO_KEY) {
pmgntframe->attrib.encrypt = _BIP_;
//pmgntframe->attrib.bswenc = _TRUE;
}
else
{
pmgntframe->attrib.encrypt = _AES_;
pmgntframe->attrib.bswenc = _TRUE;
/* pmgntframe->attrib.bswenc = _TRUE; */
} else if (pmgntframe->attrib.key_type != IEEE80211W_NO_KEY) {
psta = rtw_get_stainfo(pstapriv, pmgntframe->attrib.ra);
if (psta && psta->bpairwise_key_installed == _TRUE) {
pmgntframe->attrib.encrypt = _AES_;
pmgntframe->attrib.bswenc = _TRUE;
} else {
DBG_871X("%s, %d, bpairwise_key_installed is FALSE\n", __func__, __LINE__);
goto no_mgmt_coalesce;
}
}
DBG_871X("encrypt=%d, bswenc=%d\n", pmgntframe->attrib.encrypt, pmgntframe->attrib.bswenc);
rtw_mgmt_xmitframe_coalesce(padapter, pmgntframe->pkt, pmgntframe);
}
#endif //CONFIG_IEEE80211W
no_mgmt_coalesce:
ret = padapter->HalFunc.mgnt_xmit(padapter, pmgntframe);
return ret;
}
@ -414,7 +454,7 @@ void rtw_hal_update_ra_mask(struct sta_info *psta, u8 rssi_level)
}
}
void rtw_hal_add_ra_tid(_adapter *padapter, u32 bitmap, u8* arg, u8 rssi_level)
void rtw_hal_add_ra_tid(_adapter *padapter, u64 bitmap, u8 *arg, u8 rssi_level)
{
padapter->HalFunc.Add_RateATid(padapter, bitmap, arg, rssi_level);
}
@ -453,18 +493,40 @@ void rtw_hal_write_bbreg(_adapter *padapter, u32 RegAddr, u32 BitMask, u32 Data)
padapter->HalFunc.write_bbreg(padapter, RegAddr, BitMask, Data);
}
u32 rtw_hal_read_rfreg(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask)
u32 rtw_hal_read_rfreg(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask)
{
u32 data = 0;
if( padapter->HalFunc.read_rfreg)
if (padapter->HalFunc.read_rfreg) {
data = padapter->HalFunc.read_rfreg(padapter, eRFPath, RegAddr, BitMask);
if (match_rf_read_sniff_ranges(eRFPath, RegAddr, BitMask)) {
DBG_871X("DBG_IO rtw_hal_read_rfreg(%u, 0x%04x, 0x%08x) read:0x%08x(0x%08x)\n"
, eRFPath, RegAddr, BitMask, (data << PHY_CalculateBitShift(BitMask)), data);
}
}
return data;
}
void rtw_hal_write_rfreg(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask, u32 Data)
void rtw_hal_write_rfreg(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask, u32 Data)
{
if(padapter->HalFunc.write_rfreg)
padapter->HalFunc.write_rfreg(padapter, eRFPath, RegAddr, BitMask, Data);
if (padapter->HalFunc.write_rfreg) {
if (match_rf_write_sniff_ranges(eRFPath, RegAddr, BitMask)) {
DBG_871X("DBG_IO rtw_hal_write_rfreg(%u, 0x%04x, 0x%08x) write:0x%08x(0x%08x)\n"
, eRFPath, RegAddr, BitMask, (Data << PHY_CalculateBitShift(BitMask)), Data);
}
padapter->HalFunc.write_rfreg(padapter, eRFPath, RegAddr, BitMask, Data);
#ifdef CONFIG_PCI_HCI
if (!IS_HARDWARE_TYPE_JAGUAR_AND_JAGUAR2(padapter)) /*For N-Series IC, suggest by Jenyu*/
rtw_udelay_os(2);
#endif
}
}
#if defined(CONFIG_PCI_HCI)
s32 rtw_hal_interrupt_handler(_adapter *padapter)
{
@ -473,6 +535,13 @@ s32 rtw_hal_interrupt_handler(_adapter *padapter)
return ret;
}
#endif
#if defined(CONFIG_USB_HCI) && defined(CONFIG_SUPPORT_USB_INT)
void rtw_hal_interrupt_handler(_adapter *padapter, u16 pkt_len, u8 *pbuf)
{
padapter->HalFunc.interrupt_handler(padapter, pkt_len, pbuf);
}
#endif
void rtw_hal_set_bwmode(_adapter *padapter, CHANNEL_WIDTH Bandwidth, u8 Offset)
{
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(padapter);
@ -550,21 +619,6 @@ void rtw_hal_bcn_related_reg_setting(_adapter *padapter)
padapter->HalFunc.SetBeaconRelatedRegistersHandler(padapter);
}
#ifdef CONFIG_ANTENNA_DIVERSITY
u8 rtw_hal_antdiv_before_linked(_adapter *padapter)
{
if(padapter->HalFunc.AntDivBeforeLinkHandler)
return padapter->HalFunc.AntDivBeforeLinkHandler(padapter);
return _FALSE;
}
void rtw_hal_antdiv_rssi_compared(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src)
{
if(padapter->HalFunc.AntDivCompareHandler)
padapter->HalFunc.AntDivCompareHandler(padapter, dst, src);
}
#endif
#ifdef CONFIG_HOSTAPD_MLME
s32 rtw_hal_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
{
@ -637,12 +691,6 @@ void rtw_hal_notch_filter(_adapter *adapter, bool enable)
adapter->HalFunc.hal_notch_filter(adapter,enable);
}
void rtw_hal_reset_security_engine(_adapter * adapter)
{
if(adapter->HalFunc.hal_reset_security_engine)
adapter->HalFunc.hal_reset_security_engine(adapter);
}
bool rtw_hal_c2h_valid(_adapter *adapter, u8 *buf)
{
HAL_DATA_TYPE *HalData = GET_HAL_DATA(adapter);
@ -741,7 +789,14 @@ s32 rtw_hal_macid_wakeup(PADAPTER padapter, u8 macid)
s32 rtw_hal_fill_h2c_cmd(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer)
{
return padapter->HalFunc.fill_h2c_cmd(padapter, ElementID, CmdLen, pCmdBuffer);
_adapter *pri_adapter = GET_PRIMARY_ADAPTER(padapter);
if (pri_adapter->bFWReady == _TRUE)
return padapter->HalFunc.fill_h2c_cmd(padapter, ElementID, CmdLen, pCmdBuffer);
else if (padapter->registrypriv.mp_mode == 0)
DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" FW doesn't exit when no MP mode, by pass H2C id:0x%02x\n"
, FUNC_ADPT_ARG(padapter), ElementID);
return _FAIL;
}
void rtw_hal_fill_fake_txdesc(_adapter* padapter, u8* pDesc, u32 BufferLen,
@ -761,8 +816,30 @@ void rtw_hal_update_hisr_hsisr_ind(_adapter *padapter, u32 flag)
if (padapter->HalFunc.update_hisr_hsisr_ind)
padapter->HalFunc.update_hisr_hsisr_ind(padapter, flag);
}
int rtw_hal_gpio_func_check(_adapter *padapter, u8 gpio_num)
{
int ret = _SUCCESS;
if (padapter->HalFunc.hal_gpio_func_check)
ret= padapter->HalFunc.hal_gpio_func_check(padapter, gpio_num);
return ret;
}
void rtw_hal_gpio_multi_func_reset(_adapter *padapter, u8 gpio_num)
{
if (padapter->HalFunc.hal_gpio_multi_func_reset)
padapter->HalFunc.hal_gpio_multi_func_reset(padapter, gpio_num);
}
#endif
void rtw_hal_fw_correct_bcn(_adapter *padapter)
{
if (padapter->HalFunc.fw_correct_bcn)
padapter->HalFunc.fw_correct_bcn(padapter);
}
#define rtw_hal_error_msg(ops_fun) \
DBG_871X_LEVEL(_drv_always_, "### %s - Error : Please hook HalFunc.%s ###\n",__FUNCTION__,ops_fun)
@ -872,12 +949,14 @@ u8 rtw_hal_ops_check(_adapter *padapter)
if (NULL == padapter->HalFunc.irp_reset) {
rtw_hal_error_msg("irp_reset");
ret = _FAIL;
}
}
#endif/*#if defined(CONFIG_PCI_HCI)*/
#if (defined(CONFIG_PCI_HCI)) || (defined(CONFIG_USB_HCI) && defined(CONFIG_SUPPORT_USB_INT))
if (NULL == padapter->HalFunc.interrupt_handler) {
rtw_hal_error_msg("interrupt_handler");
ret = _FAIL;
}
#endif //#if defined(CONFIG_PCI_HCI)
#endif /*#if (defined(CONFIG_PCI_HCI)) || (defined(CONFIG_USB_HCI) && defined(CONFIG_SUPPORT_USB_INT))*/
#if defined(CONFIG_PCI_HCI) || defined (CONFIG_SDIO_HCI) || defined (CONFIG_GSPI_HCI)
if (NULL == padapter->HalFunc.enable_interrupt) {
@ -954,7 +1033,7 @@ u8 rtw_hal_ops_check(_adapter *padapter)
if (NULL == padapter->HalFunc.UpdateRAMaskHandler) {
rtw_hal_error_msg("UpdateRAMaskHandler");
ret = _FAIL;
}
}
if (NULL == padapter->HalFunc.SetBeaconRelatedRegistersHandler) {
rtw_hal_error_msg("SetBeaconRelatedRegistersHandler");
@ -970,10 +1049,12 @@ u8 rtw_hal_ops_check(_adapter *padapter)
rtw_hal_error_msg("fill_h2c_cmd");
ret = _FAIL;
}
#if defined(CONFIG_LPS) || defined(CONFIG_WOWLAN) || defined(CONFIG_AP_WOWLAN)
if (NULL == padapter->HalFunc.fill_fake_txdesc) {
rtw_hal_error_msg("fill_fake_txdesc");
ret = _FAIL;
}
#endif
if (NULL == padapter->HalFunc.hal_get_tx_buff_rsvd_page_num) {
rtw_hal_error_msg("hal_get_tx_buff_rsvd_page_num");
ret = _FAIL;
@ -986,11 +1067,19 @@ u8 rtw_hal_ops_check(_adapter *padapter)
ret = _FAIL;
}
#endif
if (NULL == padapter->HalFunc.hal_set_wowlan_fw) {
rtw_hal_error_msg("hal_set_wowlan_fw");
#endif /* CONFIG_WOWLAN */
if (NULL == padapter->HalFunc.fw_dl) {
rtw_hal_error_msg("fw_dl");
ret = _FAIL;
}
if ((IS_HARDWARE_TYPE_8814A(padapter)
|| IS_HARDWARE_TYPE_8822BU(padapter) || IS_HARDWARE_TYPE_8822BS(padapter))
&& NULL == padapter->HalFunc.fw_correct_bcn) {
rtw_hal_error_msg("fw_correct_bcn");
ret = _FAIL;
}
#endif //CONFIG_WOWLAN
/*** SReset section ***/

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