mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 07:03:37 +02:00
drivers/net/wireless/rockchip_wlan: remove unused rtl8723au driver
Change-Id: I3e99dd7350cd386e48ab08803504951ebf22e863 Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
parent
b5dc793827
commit
95ae164f15
|
|
@ -1,12 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
config RTL8723AU
|
||||
tristate "Realtek 8723AU USB WiFi Support"
|
||||
depends on USB
|
||||
select WIRELESS_EXT
|
||||
select WEXT_PRIV
|
||||
select IEEE80211
|
||||
select BT_RTKBTUSB
|
||||
select UHID
|
||||
---help---
|
||||
Help message of RTL8723AU
|
||||
|
||||
|
|
@ -1,902 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
|
||||
EXTRA_CFLAGS += -O1 -Wframe-larger-than=1200
|
||||
#EXTRA_CFLAGS += -O3
|
||||
#EXTRA_CFLAGS += -Wall
|
||||
#EXTRA_CFLAGS += -Wextra
|
||||
#EXTRA_CFLAGS += -Werror
|
||||
#EXTRA_CFLAGS += -pedantic
|
||||
#EXTRA_CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
|
||||
|
||||
EXTRA_CFLAGS += -Wno-unused-variable
|
||||
EXTRA_CFLAGS += -Wno-unused-value
|
||||
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 += -I$(src)/include
|
||||
|
||||
CONFIG_AUTOCFG_CP = n
|
||||
|
||||
CONFIG_RTL8192C = n
|
||||
CONFIG_RTL8192D = n
|
||||
CONFIG_RTL8723A = y
|
||||
CONFIG_RTL8188E = n
|
||||
|
||||
CONFIG_USB_HCI = y
|
||||
CONFIG_PCI_HCI = n
|
||||
CONFIG_SDIO_HCI = n
|
||||
CONFIG_GSPI_HCI = n
|
||||
|
||||
CONFIG_MP_INCLUDED = y
|
||||
CONFIG_POWER_SAVING = y
|
||||
CONFIG_USB_AUTOSUSPEND = n
|
||||
CONFIG_HW_PWRP_DETECTION = n
|
||||
CONFIG_WIFI_TEST = n
|
||||
CONFIG_BT_COEXIST = y
|
||||
CONFIG_RTL8192CU_REDEFINE_1X1 = n
|
||||
CONFIG_INTEL_WIDI = n
|
||||
CONFIG_WAPI_SUPPORT = n
|
||||
CONFIG_EFUSE_CONFIG_FILE = n
|
||||
CONFIG_EXT_CLK = n
|
||||
CONFIG_FTP_PROTECT = n
|
||||
CONFIG_WOWLAN = n
|
||||
CONFIG_GPIO_WAKEUP = n
|
||||
CONFIG_ODM_ADAPTIVITY = n
|
||||
CONFIG_MMC_PM_KEEP_POWER = n
|
||||
|
||||
CONFIG_PLATFORM_I386_PC = n
|
||||
CONFIG_PLATFORM_ANDROID_X86 = n
|
||||
CONFIG_PLATFORM_JB_X86 = n
|
||||
CONFIG_PLATFORM_ARM_S3C2K4 = n
|
||||
CONFIG_PLATFORM_ARM_PXA2XX = n
|
||||
CONFIG_PLATFORM_ARM_S3C6K4 = n
|
||||
CONFIG_PLATFORM_MIPS_RMI = n
|
||||
CONFIG_PLATFORM_RTD2880B = n
|
||||
CONFIG_PLATFORM_MIPS_AR9132 = n
|
||||
CONFIG_PLATFORM_RTK_DMP = n
|
||||
CONFIG_PLATFORM_MIPS_PLM = n
|
||||
CONFIG_PLATFORM_MSTAR389 = n
|
||||
CONFIG_PLATFORM_MT53XX = n
|
||||
CONFIG_PLATFORM_ARM_MX51_241H = n
|
||||
CONFIG_PLATFORM_ACTIONS_ATJ227X = n
|
||||
CONFIG_PLATFORM_TEGRA3_CARDHU = n
|
||||
CONFIG_PLATFORM_TEGRA4_DALMORE = n
|
||||
CONFIG_PLATFORM_ARM_TCC8900 = n
|
||||
CONFIG_PLATFORM_ARM_TCC8920 = n
|
||||
CONFIG_PLATFORM_ARM_TCC8920_JB42 = n
|
||||
CONFIG_PLATFORM_ARM_RK2818 = y
|
||||
CONFIG_PLATFORM_ARM_RK3066 = n
|
||||
CONFIG_PLATFORM_ARM_URBETTER = n
|
||||
CONFIG_PLATFORM_ARM_TI_PANDA = n
|
||||
CONFIG_PLATFORM_MIPS_JZ4760 = n
|
||||
CONFIG_PLATFORM_DMP_PHILIPS = n
|
||||
CONFIG_PLATFORM_TI_DM365 = n
|
||||
CONFIG_PLATFORM_MSTAR_TITANIA12 = n
|
||||
CONFIG_PLATFORM_MSTAR = n
|
||||
CONFIG_PLATFORM_SZEBOOK = n
|
||||
CONFIG_PLATFORM_ARM_SUNxI = n
|
||||
CONFIG_PLATFORM_ARM_SUN6I = n
|
||||
CONFIG_PLATFORM_ARM_SUN7I = n
|
||||
CONFIG_PLATFORM_ACTIONS_ATM702X = n
|
||||
CONFIG_PLATFORM_MN10300 = n
|
||||
CONFIG_PLATFORM_ACTIONS_ATV5201 = n
|
||||
CONFIG_PLATFORM_ARM_RTD299X = n
|
||||
|
||||
CONFIG_DRVEXT_MODULE = n
|
||||
|
||||
export TopDIR ?= $(shell pwd)
|
||||
|
||||
|
||||
OUTSRC_FILES := hal/OUTSRC/odm_debug.o \
|
||||
hal/OUTSRC/odm_interface.o\
|
||||
hal/OUTSRC/odm_HWConfig.o\
|
||||
hal/OUTSRC/odm.o\
|
||||
hal/OUTSRC/HalPhyRf.o
|
||||
|
||||
ifeq ($(CONFIG_RTL8192C), y)
|
||||
RTL871X = rtl8192c
|
||||
|
||||
ifeq ($(CONFIG_USB_HCI), y)
|
||||
MODULE_NAME = 8192cu
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8192CUFWImg_CE.o \
|
||||
hal/OUTSRC/$(RTL871X)/Hal8192CUPHYImg_CE.o \
|
||||
hal/OUTSRC/$(RTL871X)/Hal8192CUMACImg_CE.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PCI_HCI), y)
|
||||
MODULE_NAME = 8192ce
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8192CEFWImg_CE.o \
|
||||
hal/OUTSRC/$(RTL871X)/Hal8192CEPHYImg_CE.o \
|
||||
hal/OUTSRC/$(RTL871X)/Hal8192CEMACImg_CE.o
|
||||
endif
|
||||
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/odm_RTL8192C.o\
|
||||
hal/OUTSRC/$(RTL871X)/HalDMOutSrc8192C_CE.o
|
||||
|
||||
CHIP_FILES := \
|
||||
hal/$(RTL871X)/$(RTL871X)_sreset.o \
|
||||
hal/$(RTL871X)/$(RTL871X)_xmit.o
|
||||
CHIP_FILES += $(OUTSRC_FILES)
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RTL8192D), y)
|
||||
RTL871X = rtl8192d
|
||||
|
||||
ifeq ($(CONFIG_USB_HCI), y)
|
||||
MODULE_NAME = 8192du
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8192DUFWImg_CE.o \
|
||||
hal/OUTSRC/$(RTL871X)/Hal8192DUPHYImg_CE.o \
|
||||
hal/OUTSRC/$(RTL871X)/Hal8192DUMACImg_CE.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PCI_HCI), y)
|
||||
MODULE_NAME = 8192de
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8192DEFWImg_CE.o \
|
||||
hal/OUTSRC/$(RTL871X)/Hal8192DEPHYImg_CE.o \
|
||||
hal/OUTSRC/$(RTL871X)/Hal8192DEMACImg_CE.o
|
||||
endif
|
||||
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/odm_RTL8192D.o\
|
||||
hal/OUTSRC/$(RTL871X)/HalDMOutSrc8192D_CE.o
|
||||
CHIP_FILES := \
|
||||
hal/$(RTL871X)/$(RTL871X)_xmit.o
|
||||
CHIP_FILES += $(OUTSRC_FILES)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RTL8723A), y)
|
||||
|
||||
RTL871X = rtl8723a
|
||||
|
||||
HAL_COMM_FILES := hal/$(RTL871X)/$(RTL871X)_xmit.o \
|
||||
hal/$(RTL871X)/$(RTL871X)_sreset.o
|
||||
|
||||
ifeq ($(CONFIG_GSPI_HCI), y)
|
||||
MODULE_NAME = 8723as
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8723SHWImg_CE.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SDIO_HCI), y)
|
||||
MODULE_NAME = 8723as
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8723SHWImg_CE.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_USB_HCI), y)
|
||||
MODULE_NAME = 8723au
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8723UHWImg_CE.o
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PCI_HCI), y)
|
||||
MODULE_NAME = 8723ae
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/Hal8723EHWImg_CE.o
|
||||
endif
|
||||
|
||||
#hal/OUTSRC/$(RTL871X)/HalHWImg8723A_FW.o
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8723A_BB.o\
|
||||
hal/OUTSRC/$(RTL871X)/HalHWImg8723A_MAC.o\
|
||||
hal/OUTSRC/$(RTL871X)/HalHWImg8723A_RF.o\
|
||||
hal/OUTSRC/$(RTL871X)/odm_RegConfig8723A.o
|
||||
|
||||
OUTSRC_FILES += hal/OUTSRC/rtl8192c/HalDMOutSrc8192C_CE.o
|
||||
clean_more ?=
|
||||
clean_more += clean_odm-8192c
|
||||
|
||||
PWRSEQ_FILES := hal/HalPwrSeqCmd.o \
|
||||
hal/$(RTL871X)/Hal8723PwrSeq.o
|
||||
|
||||
CHIP_FILES += $(HAL_COMM_FILES) $(OUTSRC_FILES) $(PWRSEQ_FILES)
|
||||
|
||||
ifeq ($(CONFIG_BT_COEXIST), y)
|
||||
CHIP_FILES += hal/$(RTL871X)/rtl8723a_bt-coexist.o
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RTL8188E), y)
|
||||
|
||||
RTL871X = rtl8188e
|
||||
HAL_COMM_FILES := hal/$(RTL871X)/$(RTL871X)_xmit.o\
|
||||
hal/$(RTL871X)/$(RTL871X)_sreset.o
|
||||
|
||||
ifeq ($(CONFIG_SDIO_HCI), y)
|
||||
MODULE_NAME = 8189es
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_USB_HCI), y)
|
||||
MODULE_NAME = 8188eu
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PCI_HCI), y)
|
||||
MODULE_NAME = 8188ee
|
||||
endif
|
||||
|
||||
#hal/OUTSRC/$(RTL871X)/HalHWImg8188E_FW.o
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8188E_MAC.o\
|
||||
hal/OUTSRC/$(RTL871X)/HalHWImg8188E_BB.o\
|
||||
hal/OUTSRC/$(RTL871X)/HalHWImg8188E_RF.o\
|
||||
hal/OUTSRC/$(RTL871X)/Hal8188EFWImg_CE.o\
|
||||
hal/OUTSRC/$(RTL871X)/HalPhyRf_8188e.o\
|
||||
hal/OUTSRC/$(RTL871X)/odm_RegConfig8188E.o\
|
||||
hal/OUTSRC/$(RTL871X)/Hal8188ERateAdaptive.o\
|
||||
hal/OUTSRC/$(RTL871X)/odm_RTL8188E.o
|
||||
|
||||
ifeq ($(CONFIG_RTL8188E), y)
|
||||
ifeq ($(CONFIG_WOWLAN), y)
|
||||
OUTSRC_FILES += hal/OUTSRC/$(RTL871X)/HalHWImg8188E_FW.o
|
||||
endif
|
||||
endif
|
||||
|
||||
PWRSEQ_FILES := hal/HalPwrSeqCmd.o \
|
||||
hal/$(RTL871X)/Hal8188EPwrSeq.o
|
||||
|
||||
CHIP_FILES += $(HAL_COMM_FILES) $(OUTSRC_FILES) $(PWRSEQ_FILES)
|
||||
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_GSPI_HCI), y)
|
||||
HCI_NAME = gspi
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SDIO_HCI), y)
|
||||
HCI_NAME = sdio
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_USB_HCI), y)
|
||||
HCI_NAME = usb
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PCI_HCI), y)
|
||||
HCI_NAME = pci
|
||||
endif
|
||||
|
||||
|
||||
_OS_INTFS_FILES := os_dep/osdep_service.o \
|
||||
os_dep/linux/os_intfs.o \
|
||||
os_dep/linux/$(HCI_NAME)_intf.o \
|
||||
os_dep/linux/$(HCI_NAME)_ops_linux.o \
|
||||
os_dep/linux/ioctl_linux.o \
|
||||
os_dep/linux/xmit_linux.o \
|
||||
os_dep/linux/mlme_linux.o \
|
||||
os_dep/linux/recv_linux.o \
|
||||
os_dep/linux/ioctl_cfg80211.o \
|
||||
os_dep/linux/rtw_android.o \
|
||||
os_dep/linux/rtw_proc.o
|
||||
|
||||
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
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_GSPI_HCI), y)
|
||||
_OS_INTFS_FILES += os_dep/linux/custom_gpio_linux.o
|
||||
_OS_INTFS_FILES += os_dep/linux/$(HCI_NAME)_ops_linux.o
|
||||
endif
|
||||
|
||||
_HAL_INTFS_FILES := hal/hal_intf.o \
|
||||
hal/hal_com.o \
|
||||
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/$(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_SDIO_HCI), y)
|
||||
_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops.o
|
||||
else
|
||||
ifeq ($(CONFIG_GSPI_HCI), y)
|
||||
_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops.o
|
||||
else
|
||||
_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
|
||||
|
||||
_HAL_INTFS_FILES += $(CHIP_FILES)
|
||||
|
||||
|
||||
ifeq ($(CONFIG_AUTOCFG_CP), y)
|
||||
|
||||
ifeq ($(CONFIG_RTL8188E)$(CONFIG_SDIO_HCI),yy)
|
||||
$(shell cp $(TopDIR)/autoconf_rtl8189e_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
|
||||
else
|
||||
$(shell cp $(TopDIR)/autoconf_$(RTL871X)_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_USB_HCI), y)
|
||||
ifeq ($(CONFIG_USB_AUTOSUSPEND), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_USB_AUTOSUSPEND
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MP_INCLUDED), y)
|
||||
#MODULE_NAME := $(MODULE_NAME)_mp
|
||||
EXTRA_CFLAGS += -DCONFIG_MP_INCLUDED
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_POWER_SAVING), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_POWER_SAVING
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_HW_PWRP_DETECTION), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_HW_PWRP_DETECTION
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_WIFI_TEST), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_WIFI_TEST
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BT_COEXIST), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_BT_COEXIST
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RTL8192CU_REDEFINE_1X1), y)
|
||||
EXTRA_CFLAGS += -DRTL8192C_RECONFIG_TO_1T1R
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INTEL_WIDI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_INTEL_WIDI
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_WAPI_SUPPORT), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_WAPI_SUPPORT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_EFUSE_CONFIG_FILE), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_EFUSE_CONFIG_FILE
|
||||
EXTRA_CFLAGS += -DEFUSE_MAP_PATH=\"/system/etc/wifi/wifi_efuse_$(MODULE_NAME).map\"
|
||||
EXTRA_CFLAGS += -DWIFIMAC_PATH=\"/data/wifimac.txt\"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_EXT_CLK), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_EXT_CLK
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FTP_PROTECT), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_FTP_PROTECT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ODM_ADAPTIVITY), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_ODM_ADAPTIVITY
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SKIP_SIGNAL_SCALE_MAPPING), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_SKIP_SIGNAL_SCALE_MAPPING
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MMC_PM_KEEP_POWER), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_MMC_PM_KEEP_POWER
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RTL8188E), y)
|
||||
ifeq ($(CONFIG_WOWLAN), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_WOWLAN
|
||||
EXTRA_CFLAGS += -DCONFIG_MMC_PM_KEEP_POWER
|
||||
endif
|
||||
ifeq ($(CONFIG_GPIO_WAKEUP), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_GPIO_WAKEUP
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_RTL8188E), y)
|
||||
ifeq ($(CONFIG_EFUSE_CONFIG_FILE), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_RF_GAIN_OFFSET
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_I386_PC), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
|
||||
ARCH ?= $(SUBARCH)
|
||||
CROSS_COMPILE ?=
|
||||
KVER := $(shell uname -r)
|
||||
KSRC := /lib/modules/$(KVER)/build
|
||||
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
|
||||
INSTALL_PREFIX :=
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ACTIONS_ATM702X), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ACTIONS_ATM702X
|
||||
#ARCH := arm
|
||||
ARCH := $(R_ARCH)
|
||||
#CROSS_COMPILE := arm-none-linux-gnueabi-
|
||||
CROSS_COMPILE := $(R_CROSS_COMPILE)
|
||||
KVER:= 3.4.0
|
||||
#KSRC := ../../../../build/out/kernel
|
||||
KSRC := $(KERNEL_BUILD_PATH)
|
||||
MODULE_NAME :=wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_TI_AM3517), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_SHUTTLE
|
||||
CROSS_COMPILE := arm-eabi-
|
||||
KSRC := $(shell pwd)/../../../Android/kernel
|
||||
ARCH := arm
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_MSTAR_TITANIA12), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR -DCONFIG_PLATFORM_MSTAR_TITANIA12
|
||||
ARCH:=mips
|
||||
CROSS_COMPILE:= /usr/src/Mstar_kernel/mips-4.3/bin/mips-linux-gnu-
|
||||
KVER:= 2.6.28.9
|
||||
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
|
||||
ARCH:=arm
|
||||
CROSS_COMPILE:= /usr/src/bin/arm-none-linux-gnueabi-
|
||||
KVER:= 3.1.10
|
||||
KSRC:= /usr/src/Mstar_kernel/3.1.10/
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ANDROID_X86), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
|
||||
ARCH := $(SUBARCH)
|
||||
CROSS_COMPILE := /media/DATA-2/android-x86/ics-x86_20120130/prebuilt/linux-x86/toolchain/i686-unknown-linux-gnu-4.2.1/bin/i686-unknown-linux-gnu-
|
||||
KSRC := /media/DATA-2/android-x86/ics-x86_20120130/out/target/product/generic_x86/obj/kernel
|
||||
MODULE_NAME :=wlan
|
||||
endif
|
||||
|
||||
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-
|
||||
KSRC := /home/android_sdk/android-x86_JB/out/target/product/x86/obj/kernel/
|
||||
MODULE_NAME :=wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_PXA2XX), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := arm-none-linux-gnueabi-
|
||||
KVER := 2.6.34.1
|
||||
KSRC ?= /usr/src/linux-2.6.34.1
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_S3C2K4), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := arm-linux-
|
||||
KVER := 2.6.24.7_$(ARCH)
|
||||
KSRC := /usr/src/kernels/linux-$(KVER)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_S3C6K4), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := arm-none-linux-gnueabi-
|
||||
KVER := 2.6.34.1
|
||||
KSRC ?= /usr/src/linux-2.6.34.1
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_RTD2880B), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN -DCONFIG_PLATFORM_RTD2880B
|
||||
ARCH:=
|
||||
CROSS_COMPILE:=
|
||||
KVER:=
|
||||
KSRC:=
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_MIPS_RMI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
ARCH:=mips
|
||||
CROSS_COMPILE:=mipsisa32r2-uclibc-
|
||||
KVER:=
|
||||
KSRC:= /root/work/kernel_realtek
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_MIPS_PLM), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN
|
||||
ARCH:=mips
|
||||
CROSS_COMPILE:=mipsisa32r2-uclibc-
|
||||
KVER:=
|
||||
KSRC:= /root/work/kernel_realtek
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_MSTAR389), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR389
|
||||
ARCH:=mips
|
||||
CROSS_COMPILE:= mips-linux-gnu-
|
||||
KVER:= 2.6.28.10
|
||||
KSRC:= /home/mstar/mstar_linux/2.6.28.9/
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_MIPS_AR9132), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN
|
||||
ARCH := mips
|
||||
CROSS_COMPILE := mips-openwrt-linux-
|
||||
KSRC := /home/alex/test_openwrt/tmp/linux-2.6.30.9
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_DMP_PHILIPS), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DRTK_DMP_PLATFORM
|
||||
ARCH := mips
|
||||
#CROSS_COMPILE:=/usr/local/msdk-4.3.6-mips-EL-2.6.12.6-0.9.30.3/bin/mipsel-linux-
|
||||
CROSS_COMPILE:=/usr/local/toolchain_mipsel/bin/mipsel-linux-
|
||||
KSRC ?=/usr/local/Jupiter/linux-2.6.12
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_RTK_DMP), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DRTK_DMP_PLATFORM
|
||||
ARCH:=mips
|
||||
CROSS_COMPILE:=mipsel-linux-
|
||||
KVER:=
|
||||
KSRC ?= /usr/src/DMP_Kernel/jupiter/linux-2.6.12
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_MT53XX), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MT53XX
|
||||
ARCH:= arm
|
||||
CROSS_COMPILE:= arm11_mtk_le-
|
||||
KVER:= 2.6.27
|
||||
KSRC?= /proj/mtk00802/BD_Compare/BDP/Dev/BDP_V301/BDP_Linux/linux-2.6.27
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_MX51_241H), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_WISTRON_PLATFORM
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-
|
||||
KVER := 2.6.31
|
||||
KSRC ?= /lib/modules/2.6.31-770-g0e46b52/source
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ACTIONS_ATJ227X), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ACTIONS_ATJ227X
|
||||
ARCH := mips
|
||||
CROSS_COMPILE := /home/cnsd4/project/actions/tools-2.6.27/bin/mipsel-linux-gnu-
|
||||
KVER := 2.6.27
|
||||
KSRC := /home/cnsd4/project/actions/linux-2.6.27.28
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_TI_DM365), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_TI_DM365
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-
|
||||
KVER := 2.6.18
|
||||
KSRC := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/lsp/ti-davinci/linux-dm365
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_TEGRA3_CARDHU), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
# default setting for Android 4.1, 4.2
|
||||
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
|
||||
MODULE_NAME := wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_TEGRA4_DALMORE), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
# default setting for Android 4.1, 4.2
|
||||
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
|
||||
MODULE_NAME := wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_TCC8900), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := /home/android_sdk/Telechips/SDK_2304_20110613/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
|
||||
KSRC := /home/android_sdk/Telechips/SDK_2304_20110613/kernel
|
||||
MODULE_NAME := wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_TCC8920), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
|
||||
KSRC := /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/kernel
|
||||
MODULE_NAME := wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_TCC8920_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
|
||||
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
|
||||
MODULE_NAME := wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_RK2818), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS -DCONFIG_MINIMAL_MEMORY_USAGE
|
||||
ifeq ($(CONFIG_SDIO_HCI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_DETECT_CPWM_BY_POLLING -DCONFIG_DETECT_C2H_BY_POLLING
|
||||
endif
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := /usr/src/release_fae_version/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
|
||||
KSRC := /usr/src/release_fae_version/kernel25_A7_281x
|
||||
MODULE_NAME := 8723au
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_RK3066), y)
|
||||
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
|
||||
EXTRA_CFLAGS += -fno-pic
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := /home/android_sdk/Rockchip/rk3066_20130607/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-
|
||||
#CROSS_COMPILE := /home/android_sdk/Rockchip/Rk3066sdk/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-
|
||||
KSRC := /home/android_sdk/Rockchip/Rk3066sdk/kernel
|
||||
MODULE_NAME :=wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_URBETTER), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN #-DCONFIG_MINIMAL_MEMORY_USAGE
|
||||
ARCH := arm
|
||||
CROSS_COMPILE := /media/DATA-1/urbetter/arm-2009q3/bin/arm-none-linux-gnueabi-
|
||||
KSRC := /media/DATA-1/urbetter/ics-urbetter/kernel
|
||||
MODULE_NAME := wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_TI_PANDA), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN #-DCONFIG_MINIMAL_MEMORY_USAGE
|
||||
ARCH := arm
|
||||
#CROSS_COMPILE := /media/DATA-1/aosp/ics-aosp_20111227/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
|
||||
#KSRC := /media/DATA-1/aosp/android-omap-panda-3.0_20120104
|
||||
CROSS_COMPILE := /media/DATA-1/android-4.0/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
|
||||
KSRC := /media/DATA-1/android-4.0/panda_kernel/omap
|
||||
MODULE_NAME := wlan
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_MIPS_JZ4760), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_MINIMAL_MEMORY_USAGE
|
||||
ARCH ?= mips
|
||||
CROSS_COMPILE ?= /mnt/sdb5/Ingenic/Umido/mips-4.3/bin/mips-linux-gnu-
|
||||
KSRC ?= /mnt/sdb5/Ingenic/Umido/kernel
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_SZEBOOK), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN
|
||||
ARCH:=arm
|
||||
CROSS_COMPILE:=/opt/crosstool2/bin/armeb-unknown-linux-gnueabi-
|
||||
KVER:= 2.6.31.6
|
||||
KSRC:= ../code/linux-2.6.31.6-2020/
|
||||
endif
|
||||
|
||||
#Add setting for MN10300
|
||||
ifeq ($(CONFIG_PLATFORM_MN10300), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MN10300
|
||||
ARCH := mn10300
|
||||
CROSS_COMPILE := mn10300-linux-
|
||||
KVER := 2.6.32.2
|
||||
KSRC := /home/winuser/work/Plat_sLD2T_V3010/usr/src/linux-2.6.32.2
|
||||
INSTALL_PREFIX :=
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_SUNxI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ARM_SUNxI
|
||||
ifeq ($(CONFIG_USB_HCI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
endif
|
||||
# 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
|
||||
# default setting for A10-EVB mmc0
|
||||
ifeq ($(CONFIG_SDIO_HCI), y)
|
||||
#EXTRA_CFLAGS += -DCONFIG_WITS_EVB_V13
|
||||
endif
|
||||
ARCH := arm
|
||||
#CROSS_COMPILE := arm-none-linux-gnueabi-
|
||||
CROSS_COMPILE=/home/android_sdk/Allwinner/a10/android-jb42/lichee-jb42/buildroot/output/external-toolchain/bin/arm-none-linux-gnueabi-
|
||||
KVER := 3.0.8
|
||||
#KSRC:= ../lichee/linux-3.0/
|
||||
KSRC=/home/android_sdk/Allwinner/a10/android-jb42/lichee-jb42/linux-3.0
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_SUN6I), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN6I
|
||||
ifeq ($(CONFIG_USB_HCI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
endif
|
||||
# default setting for A31-EVB mmc0
|
||||
ifeq ($(CONFIG_SDIO_HCI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_A31_EVB
|
||||
endif
|
||||
|
||||
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
|
||||
ARCH := arm
|
||||
KVER := 3.3.0
|
||||
#Android-JB42
|
||||
#CROSS_COMPILE := /home/android_sdk/Allwinner/a31/android-jb42/lichee/buildroot/output/external-toolchain/bin/arm-linux-gnueabi-
|
||||
#KSRC :=/home/android_sdk/Allwinner/a31/android-jb42/lichee/linux-3.3
|
||||
# ==== Cross compile setting for kitkat-a3x_v4.5 =====
|
||||
CROSS_COMPILE := /home/android_sdk/Allwinner/a31/kitkat-a3x_v4.5/lichee/buildroot/output/external-toolchain/bin/arm-linux-gnueabi-
|
||||
KSRC :=/home/android_sdk/Allwinner/a31/kitkat-a3x_v4.5/lichee/linux-3.3
|
||||
MODULE_NAME := 8192eu
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_SUN7I), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN7I
|
||||
ifeq ($(CONFIG_USB_HCI), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX
|
||||
endif
|
||||
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
|
||||
ARCH := arm
|
||||
# Cross compile setting for Android 4.2 SDK-Miracast-sink
|
||||
#CROSS_COMPILE := /home/android_sdk/Allwinner/a20/sugar/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi-
|
||||
#KVER := 3.3.0
|
||||
#KSRC :=/home/android_sdk/Allwinner/a20/sugar/lichee/linux-3.3
|
||||
|
||||
# ===Cross compile setting for Android 4.2 SDK ===
|
||||
#CROSS_COMPILE :=/home/android_sdk/Allwinner/a20_evb/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi-
|
||||
#KVER := 3.3.0
|
||||
#KSRC := /home/android_sdk/Allwinner/a20_evb/lichee/linux-3.3
|
||||
|
||||
# ==== Cross compile setting for Android 4.3 SDK =====
|
||||
#CROSS_COMPILE := /home/android_sdk/Allwinner/a20/android-jb43/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi-
|
||||
#KVER := 3.4.39
|
||||
#KSRC :=/home/android_sdk/Allwinner/a20/android-jb43/lichee/linux-3.4
|
||||
|
||||
# ==== Cross compile setting for Android 4.4 SDK =====
|
||||
CROSS_COMPILE := /home/android_sdk/Allwinner/a20/android-kitkat44/lichee/out/android/common/buildroot/external-toolchain/bin/arm-linux-gnueabi-
|
||||
KVER := 3.4.39
|
||||
KSRC :=/home/android_sdk/Allwinner/a20/android-kitkat44/lichee/linux-3.4
|
||||
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ACTIONS_ATV5201), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ACTIONS_ATV5201
|
||||
ARCH := mips
|
||||
CROSS_COMPILE := mipsel-linux-gnu-
|
||||
KVER := $(KERNEL_VER)
|
||||
KSRC:= $(CFGDIR)/../../kernel/linux-$(KERNEL_VER)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_ARM_RTD299X), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
EXTRA_CFLAGS += -DUSB_XMITBUF_ALIGN_SZ=1024
|
||||
EXTRA_CFLAGS += -DUSB_PACKET_OFFSET_SZ=0
|
||||
#ARCH, CROSS_COMPILE, KSRC,and MODDESTDIR are provided by external makefile
|
||||
ARCH := arm
|
||||
CROSS_COMPILE :=
|
||||
KSRC:=
|
||||
KVER := 3.7.2
|
||||
INSTALL_PREFIX :=
|
||||
endif
|
||||
|
||||
ifneq ($(USER_MODULE_NAME),)
|
||||
MODULE_NAME := $(USER_MODULE_NAME)
|
||||
endif
|
||||
|
||||
ifneq ($(KERNELRELEASE),)
|
||||
|
||||
rtk_core := core/rtw_cmd.o \
|
||||
core/rtw_security.o \
|
||||
core/rtw_debug.o \
|
||||
core/rtw_io.o \
|
||||
core/rtw_ioctl_query.o \
|
||||
core/rtw_ioctl_set.o \
|
||||
core/rtw_ieee80211.o \
|
||||
core/rtw_mlme.o \
|
||||
core/rtw_mlme_ext.o \
|
||||
core/rtw_wlan_util.o \
|
||||
core/rtw_pwrctrl.o \
|
||||
core/rtw_rf.o \
|
||||
core/rtw_recv.o \
|
||||
core/rtw_sta_mgt.o \
|
||||
core/rtw_ap.o \
|
||||
core/rtw_xmit.o \
|
||||
core/rtw_p2p.o \
|
||||
core/rtw_tdls.o \
|
||||
core/rtw_br_ext.o \
|
||||
core/rtw_iol.o \
|
||||
core/rtw_led.o \
|
||||
core/rtw_sreset.o \
|
||||
core/rtw_odm.o
|
||||
|
||||
$(MODULE_NAME)-y += $(rtk_core)
|
||||
|
||||
$(MODULE_NAME)-$(CONFIG_INTEL_WIDI) += core/rtw_intel_widi.o
|
||||
|
||||
$(MODULE_NAME)-$(CONFIG_WAPI_SUPPORT) += core/rtw_wapi.o \
|
||||
core/rtw_wapi_sms4.o
|
||||
|
||||
$(MODULE_NAME)-y += core/efuse/rtw_efuse.o
|
||||
|
||||
$(MODULE_NAME)-y += $(_HAL_INTFS_FILES)
|
||||
|
||||
$(MODULE_NAME)-y += $(_OS_INTFS_FILES)
|
||||
|
||||
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o \
|
||||
core/rtw_mp_ioctl.o
|
||||
ifeq ($(CONFIG_RTL8723A), y)
|
||||
|
||||
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED)+= core/rtw_bt_mp.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_RTL8723AU) := $(MODULE_NAME).o
|
||||
|
||||
else
|
||||
|
||||
export CONFIG_RTL8723AU = m
|
||||
|
||||
all: modules
|
||||
|
||||
modules:
|
||||
$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules
|
||||
|
||||
strip:
|
||||
$(CROSS_COMPILE)strip $(MODULE_NAME).ko --strip-unneeded
|
||||
|
||||
install:
|
||||
install -p -m 644 $(MODULE_NAME).ko $(MODDESTDIR)
|
||||
/sbin/depmod -a ${KVER}
|
||||
|
||||
uninstall:
|
||||
rm -f $(MODDESTDIR)/$(MODULE_NAME).ko
|
||||
/sbin/depmod -a ${KVER}
|
||||
|
||||
config_r:
|
||||
@echo "make config"
|
||||
/bin/bash script/Configure script/config.in
|
||||
|
||||
.PHONY: modules clean clean_odm-8192c
|
||||
|
||||
clean_odm-8192c:
|
||||
cd hal/OUTSRC/rtl8192c ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
|
||||
clean: $(clean_more)
|
||||
rm -fr *.mod.c *.mod *.o .*.cmd *.ko *~
|
||||
rm -fr .tmp_versions
|
||||
rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order
|
||||
cd core/efuse ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
cd core ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
cd hal/$(RTL871X)/$(HCI_NAME) ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
cd hal/$(RTL871X) ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
cd hal/OUTSRC/$(RTL871X) ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
cd hal/OUTSRC/ ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
cd hal ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
cd os_dep/linux ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
|
||||
endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,423 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTW_EEPROM_C_
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
|
||||
void up_clk(_adapter* padapter, u16 *x)
|
||||
{
|
||||
_func_enter_;
|
||||
*x = *x | _EESK;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)*x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void down_clk(_adapter * padapter, u16 *x )
|
||||
{
|
||||
_func_enter_;
|
||||
*x = *x & ~_EESK;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)*x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
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"));
|
||||
goto out;
|
||||
}
|
||||
mask = 0x01 << (count - 1);
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDO | _EEDI);
|
||||
|
||||
do
|
||||
{
|
||||
x &= ~_EEDI;
|
||||
if(data & mask)
|
||||
x |= _EEDI;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
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);
|
||||
up_clk(padapter, &x);
|
||||
down_clk(padapter, &x);
|
||||
mask = mask >> 1;
|
||||
} while(mask);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x &= ~_EEDI;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)x);
|
||||
out:
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
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"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~( _EEDO | _EEDI);
|
||||
d = 0;
|
||||
|
||||
for(i=0; i<16; i++)
|
||||
{
|
||||
d = d << 1;
|
||||
up_clk(padapter, &x);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDI);
|
||||
if(x & _EEDO)
|
||||
d |= 1;
|
||||
|
||||
down_clk(padapter, &x);
|
||||
}
|
||||
out:
|
||||
_func_exit_;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
void standby(_adapter * padapter )
|
||||
{
|
||||
u8 x;
|
||||
_func_enter_;
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EECS | _EESK);
|
||||
rtw_write8(padapter, EE_9346CR,x);
|
||||
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
x |= _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
u16 wait_eeprom_cmd_done(_adapter* padapter)
|
||||
{
|
||||
u8 x;
|
||||
u16 i,res=_FALSE;
|
||||
_func_enter_;
|
||||
standby(padapter );
|
||||
for (i=0; i<200; i++)
|
||||
{
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
if (x & _EEDO){
|
||||
res=_TRUE;
|
||||
goto exit;
|
||||
}
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
}
|
||||
exit:
|
||||
_func_exit_;
|
||||
return res;
|
||||
}
|
||||
|
||||
void eeprom_clean(_adapter * padapter)
|
||||
{
|
||||
u16 x;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
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"));
|
||||
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"));
|
||||
goto out;
|
||||
}
|
||||
up_clk(padapter, &x);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
down_clk(padapter, &x);
|
||||
out:
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
void eeprom_write16(_adapter * padapter, u16 reg, u16 data)
|
||||
{
|
||||
u8 x;
|
||||
#ifdef CONFIG_RTL8712
|
||||
u8 tmp8_ori,tmp8_new,tmp8_clk_ori,tmp8_clk_new;
|
||||
tmp8_ori=rtw_read8(padapter, 0x102502f1);
|
||||
tmp8_new=tmp8_ori & 0xf7;
|
||||
if(tmp8_ori != tmp8_new){
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_new);
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x102502f1=====\n"));
|
||||
}
|
||||
tmp8_clk_ori=rtw_read8(padapter,0x10250003);
|
||||
tmp8_clk_new=tmp8_clk_ori|0x20;
|
||||
if(tmp8_clk_new!=tmp8_clk_ori){
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x10250003=====\n"));
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_new);
|
||||
}
|
||||
#endif
|
||||
_func_enter_;
|
||||
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
|
||||
x |= _EEM1 | _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, x);
|
||||
|
||||
shift_out_bits(padapter, EEPROM_EWEN_OPCODE, 5);
|
||||
|
||||
if(padapter->EepromAddressSize==8) //CF+ and SDIO
|
||||
shift_out_bits(padapter, 0, 6);
|
||||
else //USB
|
||||
shift_out_bits(padapter, 0, 4);
|
||||
|
||||
standby( padapter);
|
||||
|
||||
// Commented out by rcnjko, 2004.0
|
||||
// // Erase this particular word. Write the erase opcode and register
|
||||
// // number in that order. The opcode is 3bits in length; reg is 6 bits long.
|
||||
// shift_out_bits(Adapter, EEPROM_ERASE_OPCODE, 3);
|
||||
// shift_out_bits(Adapter, reg, Adapter->EepromAddressSize);
|
||||
//
|
||||
// if (wait_eeprom_cmd_done(Adapter ) == FALSE)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
||||
standby(padapter );
|
||||
|
||||
// write the new word to the EEPROM
|
||||
|
||||
// send the write opcode the EEPORM
|
||||
shift_out_bits(padapter, EEPROM_WRITE_OPCODE, 3);
|
||||
|
||||
// select which word in the EEPROM that we are writing to.
|
||||
shift_out_bits(padapter, reg, padapter->EepromAddressSize);
|
||||
|
||||
// write the data to the selected EEPROM word.
|
||||
shift_out_bits(padapter, data, 16);
|
||||
|
||||
if (wait_eeprom_cmd_done(padapter ) == _FALSE)
|
||||
{
|
||||
|
||||
goto exit;
|
||||
}
|
||||
|
||||
standby(padapter );
|
||||
|
||||
shift_out_bits(padapter, EEPROM_EWDS_OPCODE, 5);
|
||||
shift_out_bits(padapter, reg, 4);
|
||||
|
||||
eeprom_clean(padapter );
|
||||
exit:
|
||||
#ifdef CONFIG_RTL8712
|
||||
if(tmp8_clk_new!=tmp8_clk_ori)
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_ori);
|
||||
if(tmp8_new!=tmp8_ori)
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_ori);
|
||||
|
||||
#endif
|
||||
_func_exit_;
|
||||
return;
|
||||
}
|
||||
|
||||
u16 eeprom_read16(_adapter * padapter, u16 reg) //ReadEEprom
|
||||
{
|
||||
|
||||
u16 x;
|
||||
u16 data=0;
|
||||
#ifdef CONFIG_RTL8712
|
||||
u8 tmp8_ori,tmp8_new,tmp8_clk_ori,tmp8_clk_new;
|
||||
tmp8_ori= rtw_read8(padapter, 0x102502f1);
|
||||
tmp8_new = tmp8_ori & 0xf7;
|
||||
if(tmp8_ori != tmp8_new){
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_new);
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x102502f1=====\n"));
|
||||
}
|
||||
tmp8_clk_ori=rtw_read8(padapter,0x10250003);
|
||||
tmp8_clk_new=tmp8_clk_ori|0x20;
|
||||
if(tmp8_clk_new!=tmp8_clk_ori){
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x10250003=====\n"));
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_new);
|
||||
}
|
||||
#endif
|
||||
_func_enter_;
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
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"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
|
||||
x |= _EEM1 | _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, (unsigned char)x);
|
||||
|
||||
// write the read opcode and register number in that order
|
||||
// The opcode is 3bits in length, reg is 6 bits long
|
||||
shift_out_bits(padapter, EEPROM_READ_OPCODE, 3);
|
||||
shift_out_bits(padapter, reg, padapter->EepromAddressSize);
|
||||
|
||||
// Now read the data (16 bits) in from the selected EEPROM word
|
||||
data = shift_in_bits(padapter);
|
||||
|
||||
eeprom_clean(padapter);
|
||||
out:
|
||||
#ifdef CONFIG_RTL8712
|
||||
if(tmp8_clk_new!=tmp8_clk_ori)
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_ori);
|
||||
if(tmp8_new!=tmp8_ori)
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_ori);
|
||||
|
||||
#endif
|
||||
_func_exit_;
|
||||
return data;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//From even offset
|
||||
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"));
|
||||
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"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
|
||||
x |= _EEM1 | _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, (unsigned char)x);
|
||||
|
||||
// write the read opcode and register number in that order
|
||||
// The opcode is 3bits in length, reg is 6 bits long
|
||||
shift_out_bits(padapter, EEPROM_READ_OPCODE, 3);
|
||||
shift_out_bits(padapter, reg, padapter->EepromAddressSize);
|
||||
|
||||
|
||||
for(i=0; i<sz; i+=2)
|
||||
{
|
||||
data16 = shift_in_bits(padapter);
|
||||
data[i] = data16 & 0xff;
|
||||
data[i+1] = data16 >>8;
|
||||
}
|
||||
|
||||
eeprom_clean(padapter);
|
||||
out:
|
||||
_func_exit_;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//addr_off : address offset of the entry in eeprom (not the tuple number of eeprom (reg); that is addr_off !=reg)
|
||||
u8 eeprom_read(_adapter * padapter, u32 addr_off, u8 sz, u8* rbuf)
|
||||
{
|
||||
u8 quotient, remainder, addr_2align_odd;
|
||||
u16 reg, stmp , i=0, idx = 0;
|
||||
_func_enter_;
|
||||
reg = (u16)(addr_off >> 1);
|
||||
addr_2align_odd = (u8)(addr_off & 0x1);
|
||||
|
||||
if(addr_2align_odd) //read that start at high part: e.g 1,3,5,7,9,...
|
||||
{
|
||||
stmp = eeprom_read16(padapter, reg);
|
||||
rbuf[idx++] = (u8) ((stmp>>8)&0xff); //return hogh-part of the short
|
||||
reg++; sz--;
|
||||
}
|
||||
|
||||
quotient = sz >> 1;
|
||||
remainder = sz & 0x1;
|
||||
|
||||
for( i=0 ; i < quotient; i++)
|
||||
{
|
||||
stmp = eeprom_read16(padapter, reg+i);
|
||||
rbuf[idx++] = (u8) (stmp&0xff);
|
||||
rbuf[idx++] = (u8) ((stmp>>8)&0xff);
|
||||
}
|
||||
|
||||
reg = reg+i;
|
||||
if(remainder){ //end of read at lower part of short : 0,2,4,6,...
|
||||
stmp = eeprom_read16(padapter, reg);
|
||||
rbuf[idx] = (u8)(stmp & 0xff);
|
||||
}
|
||||
_func_exit_;
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
VOID read_eeprom_content(_adapter * padapter)
|
||||
{
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,509 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
|
||||
The purpose of rtw_io.c
|
||||
|
||||
a. provides the API
|
||||
|
||||
b. provides the protocol engine
|
||||
|
||||
c. provides the software interface between caller and the hardware interface
|
||||
|
||||
|
||||
Compiler Flag Option:
|
||||
|
||||
1. CONFIG_SDIO_HCI:
|
||||
a. USE_SYNC_IRP: Only sync operations are provided.
|
||||
b. USE_ASYNC_IRP:Both sync/async operations are provided.
|
||||
|
||||
2. CONFIG_USB_HCI:
|
||||
a. USE_ASYNC_IRP: Both sync/async operations are provided.
|
||||
|
||||
3. CONFIG_CFIO_HCI:
|
||||
b. USE_SYNC_IRP: Only sync operations are provided.
|
||||
|
||||
|
||||
Only sync read/rtw_write_mem operations are provided.
|
||||
|
||||
jackson@realtek.com.tw
|
||||
|
||||
*/
|
||||
|
||||
#define _RTW_IO_C_
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtw_io.h>
|
||||
#include <osdep_intf.h>
|
||||
|
||||
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
|
||||
#error "Shall be Linux or Windows, but not both!\n"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#include <sdio_ops.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_GSPI_HCI
|
||||
#include <gspi_ops.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#include <usb_ops.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
#include <pci_ops.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#define rtw_le16_to_cpu(val) val
|
||||
#define rtw_le32_to_cpu(val) val
|
||||
#define rtw_cpu_to_le16(val) val
|
||||
#define rtw_cpu_to_le32(val) val
|
||||
#else
|
||||
#define rtw_le16_to_cpu(val) le16_to_cpu(val)
|
||||
#define rtw_le32_to_cpu(val) le32_to_cpu(val)
|
||||
#define rtw_cpu_to_le16(val) cpu_to_le16(val)
|
||||
#define rtw_cpu_to_le32(val) cpu_to_le32(val)
|
||||
#endif
|
||||
|
||||
|
||||
u8 _rtw_read8(_adapter *adapter, u32 addr)
|
||||
{
|
||||
u8 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read8 = pintfhdl->io_ops._read8;
|
||||
|
||||
r_val = _read8(pintfhdl, addr);
|
||||
_func_exit_;
|
||||
return r_val;
|
||||
}
|
||||
|
||||
u16 _rtw_read16(_adapter *adapter, u32 addr)
|
||||
{
|
||||
u16 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read16 = pintfhdl->io_ops._read16;
|
||||
|
||||
r_val = _read16(pintfhdl, addr);
|
||||
_func_exit_;
|
||||
return rtw_le16_to_cpu(r_val);
|
||||
}
|
||||
|
||||
u32 _rtw_read32(_adapter *adapter, u32 addr)
|
||||
{
|
||||
u32 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read32 = pintfhdl->io_ops._read32;
|
||||
|
||||
r_val = _read32(pintfhdl, addr);
|
||||
_func_exit_;
|
||||
return rtw_le32_to_cpu(r_val);
|
||||
|
||||
}
|
||||
|
||||
int _rtw_write8(_adapter *adapter, u32 addr, u8 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write8 = pintfhdl->io_ops._write8;
|
||||
|
||||
ret = _write8(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write16(_adapter *adapter, u32 addr, u16 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write16 = pintfhdl->io_ops._write16;
|
||||
|
||||
val = rtw_cpu_to_le16(val);
|
||||
ret = _write16(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write32(_adapter *adapter, u32 addr, u32 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write32 = pintfhdl->io_ops._write32;
|
||||
|
||||
val = rtw_cpu_to_le32(val);
|
||||
ret = _write32(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
|
||||
int _rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *pdata)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = (struct intf_hdl*)(&(pio_priv->intf));
|
||||
int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr,u32 length, u8 *pdata);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_writeN = pintfhdl->io_ops._writeN;
|
||||
|
||||
ret = _writeN(pintfhdl, addr,length,pdata);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write8_async(_adapter *adapter, u32 addr, u8 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write8_async)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write8_async = pintfhdl->io_ops._write8_async;
|
||||
|
||||
ret = _write8_async(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write16_async(_adapter *adapter, u32 addr, u16 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write16_async = pintfhdl->io_ops._write16_async;
|
||||
val = rtw_cpu_to_le16(val);
|
||||
ret = _write16_async(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write32_async(_adapter *adapter, u32 addr, u32 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write32_async = pintfhdl->io_ops._write32_async;
|
||||
val = rtw_cpu_to_le32(val);
|
||||
ret = _write32_async(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
|
||||
void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
_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;
|
||||
}
|
||||
|
||||
_read_mem = pintfhdl->io_ops._read_mem;
|
||||
|
||||
_read_mem(pintfhdl, addr, cnt, pmem);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void _rtw_write_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_write_mem = pintfhdl->io_ops._write_mem;
|
||||
|
||||
_write_mem(pintfhdl, addr, cnt, pmem);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void _rtw_read_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
_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));
|
||||
return;
|
||||
}
|
||||
|
||||
_read_port = pintfhdl->io_ops._read_port;
|
||||
|
||||
_read_port(pintfhdl, addr, cnt, pmem);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void _rtw_read_port_cancel(_adapter *adapter)
|
||||
{
|
||||
void (*_read_port_cancel)(struct intf_hdl *pintfhdl);
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
_read_port_cancel = pintfhdl->io_ops._read_port_cancel;
|
||||
|
||||
if(_read_port_cancel)
|
||||
_read_port_cancel(pintfhdl);
|
||||
|
||||
}
|
||||
|
||||
u32 _rtw_write_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 ret = _SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_write_port = pintfhdl->io_ops._write_port;
|
||||
|
||||
ret = _write_port(pintfhdl, addr, cnt, pmem);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
u32 _rtw_write_port_and_wait(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem, int timeout_ms)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
struct xmit_buf *pxmitbuf = (struct xmit_buf *)pmem;
|
||||
struct submit_ctx sctx;
|
||||
|
||||
rtw_sctx_init(&sctx, timeout_ms);
|
||||
pxmitbuf->sctx = &sctx;
|
||||
|
||||
ret = _rtw_write_port(adapter, addr, cnt, pmem);
|
||||
|
||||
if (ret == _SUCCESS)
|
||||
ret = rtw_sctx_wait(&sctx);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void _rtw_write_port_cancel(_adapter *adapter)
|
||||
{
|
||||
void (*_write_port_cancel)(struct intf_hdl *pintfhdl);
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
_write_port_cancel = pintfhdl->io_ops._write_port_cancel;
|
||||
|
||||
if(_write_port_cancel)
|
||||
_write_port_cancel(pintfhdl);
|
||||
|
||||
}
|
||||
|
||||
int rtw_init_io_priv(_adapter *padapter, void (*set_intf_ops)(struct _io_ops *pops))
|
||||
{
|
||||
struct io_priv *piopriv = &padapter->iopriv;
|
||||
struct intf_hdl *pintf = &piopriv->intf;
|
||||
|
||||
if (set_intf_ops == NULL)
|
||||
return _FAIL;
|
||||
|
||||
piopriv->padapter = padapter;
|
||||
pintf->padapter = padapter;
|
||||
pintf->pintf_dev = adapter_to_dvobj(padapter);
|
||||
|
||||
set_intf_ops(&pintf->io_ops);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Increase and check if the continual_io_error of this @param dvobjprive is larger than MAX_CONTINUAL_IO_ERR
|
||||
* @return _TRUE:
|
||||
* @return _FALSE:
|
||||
*/
|
||||
int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
|
||||
{
|
||||
int ret = _FALSE;
|
||||
int value;
|
||||
if( (value=ATOMIC_INC_RETURN(&dvobj->continual_io_error)) > MAX_CONTINUAL_IO_ERR) {
|
||||
DBG_871X("[dvobj:%p][ERROR] continual_io_error:%d > %d\n", dvobj, value, MAX_CONTINUAL_IO_ERR);
|
||||
ret = _TRUE;
|
||||
} else {
|
||||
//DBG_871X("[dvobj:%p] continual_io_error:%d\n", dvobj, value);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the continual_io_error of this @param dvobjprive to 0
|
||||
*/
|
||||
void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
|
||||
{
|
||||
ATOMIC_SET(&dvobj->continual_io_error, 0);
|
||||
}
|
||||
|
||||
#ifdef DBG_IO
|
||||
|
||||
u16 read_sniff_ranges[][2] = {
|
||||
//{0x550, 0x551},
|
||||
};
|
||||
|
||||
u16 write_sniff_ranges[][2] = {
|
||||
//{0x550, 0x551},
|
||||
//{0x4c, 0x4c},
|
||||
};
|
||||
|
||||
int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u16)/2;
|
||||
int write_sniff_num = sizeof(write_sniff_ranges)/sizeof(u16)/2;
|
||||
|
||||
bool match_read_sniff_ranges(u16 addr, u16 len)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i<read_sniff_num; i++) {
|
||||
if (addr + len > read_sniff_ranges[i][0] && addr <= read_sniff_ranges[i][1])
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
bool match_write_sniff_ranges(u16 addr, u16 len)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i<write_sniff_num; i++) {
|
||||
if (addr + len > write_sniff_ranges[i][0] && addr <= write_sniff_ranges[i][1])
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
u8 dbg_rtw_read8(_adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u8 val = _rtw_read8(adapter, addr);
|
||||
|
||||
if (match_read_sniff_ranges(addr, 1))
|
||||
DBG_871X("DBG_IO %s:%d rtw_read8(0x%04x) return 0x%02x\n", caller, line, addr, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
u16 dbg_rtw_read16(_adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u16 val = _rtw_read16(adapter, addr);
|
||||
|
||||
if (match_read_sniff_ranges(addr, 2))
|
||||
DBG_871X("DBG_IO %s:%d rtw_read16(0x%04x) return 0x%04x\n", caller, line, addr, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
u32 dbg_rtw_read32(_adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u32 val = _rtw_read32(adapter, addr);
|
||||
|
||||
if (match_read_sniff_ranges(addr, 4))
|
||||
DBG_871X("DBG_IO %s:%d rtw_read32(0x%04x) return 0x%08x\n", caller, line, addr, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
int dbg_rtw_write8(_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_write8(0x%04x, 0x%02x)\n", caller, line, addr, val);
|
||||
|
||||
return _rtw_write8(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_write16(_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_write16(0x%04x, 0x%04x)\n", caller, line, addr, val);
|
||||
|
||||
return _rtw_write16(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_write32(_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_write32(0x%04x, 0x%08x)\n", caller, line, addr, val);
|
||||
|
||||
return _rtw_write32(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *data, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, length))
|
||||
DBG_871X("DBG_IO %s:%d rtw_writeN(0x%04x, %u)\n", caller, line, addr, length);
|
||||
|
||||
return _rtw_writeN(adapter, addr, length, data);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -1,196 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTW_IOCTL_QUERY_C_
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtw_ioctl_query.h>
|
||||
#include <wifi.h>
|
||||
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
//
|
||||
// Added for WPA2-PSK, by Annie, 2005-09-20.
|
||||
//
|
||||
u8
|
||||
query_802_11_capability(
|
||||
_adapter* Adapter,
|
||||
u8* pucBuf,
|
||||
u32 * pulOutLen
|
||||
)
|
||||
{
|
||||
static NDIS_802_11_AUTHENTICATION_ENCRYPTION szAuthEnc[] =
|
||||
{
|
||||
{Ndis802_11AuthModeOpen, Ndis802_11EncryptionDisabled},
|
||||
{Ndis802_11AuthModeOpen, Ndis802_11Encryption1Enabled},
|
||||
{Ndis802_11AuthModeShared, Ndis802_11EncryptionDisabled},
|
||||
{Ndis802_11AuthModeShared, Ndis802_11Encryption1Enabled},
|
||||
{Ndis802_11AuthModeWPA, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPANone, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPANone, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPA2, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA2, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption3Enabled}
|
||||
};
|
||||
static ULONG ulNumOfPairSupported = sizeof(szAuthEnc)/sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION);
|
||||
NDIS_802_11_CAPABILITY * pCap = (NDIS_802_11_CAPABILITY *)pucBuf;
|
||||
u8* pucAuthEncryptionSupported = (u8*) pCap->AuthenticationEncryptionSupported;
|
||||
|
||||
|
||||
pCap->Length = sizeof(NDIS_802_11_CAPABILITY);
|
||||
if(ulNumOfPairSupported > 1 )
|
||||
pCap->Length += (ulNumOfPairSupported-1) * sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION);
|
||||
|
||||
pCap->Version = 2;
|
||||
pCap->NoOfPMKIDs = NUM_PMKID_CACHE;
|
||||
pCap->NoOfAuthEncryptPairsSupported = ulNumOfPairSupported;
|
||||
|
||||
if( sizeof (szAuthEnc) <= 240 ) // 240 = 256 - 4*4 // SecurityInfo.szCapability: only 256 bytes in size.
|
||||
{
|
||||
_rtw_memcpy( pucAuthEncryptionSupported, (u8*)szAuthEnc, sizeof (szAuthEnc) );
|
||||
*pulOutLen = pCap->Length;
|
||||
return _TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pulOutLen = 0;
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("_query_802_11_capability(): szAuthEnc size is too large.\n"));
|
||||
return _FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIATION_INFORMATION pAssocInfo)
|
||||
{
|
||||
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);
|
||||
u8 * pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
unsigned char i,*auth_ie,*supp_ie;
|
||||
|
||||
//NdisZeroMemory(pAssocInfo, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION));
|
||||
_rtw_memset(pAssocInfo, 0, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION));
|
||||
//pAssocInfo->Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
|
||||
//------------------------------------------------------
|
||||
// Association Request related information
|
||||
//------------------------------------------------------
|
||||
// Req_1. AvailableRequestFixedIEs
|
||||
if(psecnetwork!=NULL){
|
||||
|
||||
pAssocInfo->AvailableRequestFixedIEs |= NDIS_802_11_AI_REQFI_CAPABILITIES|NDIS_802_11_AI_REQFI_CURRENTAPADDRESS;
|
||||
pAssocInfo->RequestFixedIEs.Capabilities = (unsigned short)* & psecnetwork->IEs[10];
|
||||
_rtw_memcpy(pAssocInfo->RequestFixedIEs.CurrentAPAddress,
|
||||
& psecnetwork->MacAddress, 6);
|
||||
|
||||
pAssocInfo->OffsetRequestIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
|
||||
if(check_fwstate( pmlmepriv, _FW_UNDER_LINKING|_FW_LINKED)==_TRUE)
|
||||
{
|
||||
|
||||
if(psecuritypriv->ndisauthtype>=Ndis802_11AuthModeWPA2)
|
||||
pDest[0] =48; //RSN Information Element
|
||||
else
|
||||
pDest[0] =221; //WPA(SSN) Information Element
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n Adapter->ndisauthtype==Ndis802_11AuthModeWPA)?0xdd:0x30 [%d]",pDest[0]));
|
||||
supp_ie=&psecuritypriv->supplicant_ie[0];
|
||||
for(i=0;i<supp_ie[0];i++)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x \n\n", i,supp_ie[i]));
|
||||
}
|
||||
|
||||
i=13; //0~11 is fixed information element
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("i= %d tgt_network->network.IELength=%d\n\n", i,(int)psecnetwork->IELength));
|
||||
while((i<supp_ie[0]) && (i<256)){
|
||||
if((unsigned char)supp_ie[i]==pDest[0]){
|
||||
_rtw_memcpy((u8 *)(pDest),
|
||||
&supp_ie[i],
|
||||
supp_ie[1+i]+2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
i=i+supp_ie[i+1]+2;
|
||||
if(supp_ie[1+i]==0)
|
||||
i=i+1;
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("iteration i=%d IEs [%d] = 0x%x \n\n", i,i,supp_ie[i+1]));
|
||||
|
||||
}
|
||||
|
||||
|
||||
pAssocInfo->RequestIELength += (2 + supp_ie[1+i]);// (2 + psecnetwork->IEs[1+i]+4);
|
||||
|
||||
}
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n psecnetwork != NULL,fwstate==_FW_UNDER_LINKING \n"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------
|
||||
// Association Response related information
|
||||
//------------------------------------------------------
|
||||
|
||||
if(check_fwstate( pmlmepriv, _FW_LINKED)==_TRUE)
|
||||
{
|
||||
tgt_network =&(pmlmepriv->cur_network);
|
||||
if(tgt_network!=NULL){
|
||||
pAssocInfo->AvailableResponseFixedIEs =
|
||||
NDIS_802_11_AI_RESFI_CAPABILITIES
|
||||
|NDIS_802_11_AI_RESFI_ASSOCIATIONID
|
||||
;
|
||||
|
||||
pAssocInfo->ResponseFixedIEs.Capabilities =(unsigned short)* & tgt_network->network.IEs[10];
|
||||
pAssocInfo->ResponseFixedIEs.StatusCode = 0;
|
||||
pAssocInfo->ResponseFixedIEs.AssociationId =(unsigned short) tgt_network->aid;
|
||||
|
||||
pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)+pAssocInfo->RequestIELength;
|
||||
auth_ie=&psecuritypriv->authenticator_ie[0];
|
||||
|
||||
for(i=0;i<auth_ie[0];i++)
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x \n\n", i,auth_ie[i]));
|
||||
|
||||
i=auth_ie[0]-12;
|
||||
if(i>0){
|
||||
_rtw_memcpy((u8 *)&pDest[0],&auth_ie[1],i);
|
||||
pAssocInfo->ResponseIELength =i;
|
||||
}
|
||||
|
||||
|
||||
pAssocInfo->OffsetResponseIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION) + pAssocInfo->RequestIELength;
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n tgt_network != NULL,fwstate==_FW_LINKED \n"));
|
||||
}
|
||||
}
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n exit query_802_11_association_information \n"));
|
||||
_func_exit_;
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,403 +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<rtw_iol.h>
|
||||
|
||||
#ifdef CONFIG_IOL
|
||||
struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter)
|
||||
{
|
||||
struct xmit_frame *xmit_frame;
|
||||
struct xmit_buf *xmitbuf;
|
||||
struct pkt_attrib *pattrib;
|
||||
struct xmit_priv *pxmitpriv = &(adapter->xmitpriv);
|
||||
|
||||
#if 1
|
||||
if ((xmit_frame = rtw_alloc_xmitframe(pxmitpriv)) == NULL)
|
||||
{
|
||||
DBG_871X("%s rtw_alloc_xmitframe return null\n", __FUNCTION__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if ((xmitbuf = rtw_alloc_xmitbuf(pxmitpriv)) == NULL)
|
||||
{
|
||||
DBG_871X("%s rtw_alloc_xmitbuf return null\n", __FUNCTION__);
|
||||
rtw_free_xmitframe(pxmitpriv, xmit_frame);
|
||||
xmit_frame=NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
xmit_frame->frame_tag = MGNT_FRAMETAG;
|
||||
xmit_frame->pxmitbuf = xmitbuf;
|
||||
xmit_frame->buf_addr = xmitbuf->pbuf;
|
||||
xmitbuf->priv_data = xmit_frame;
|
||||
|
||||
pattrib = &xmit_frame->attrib;
|
||||
update_mgntframe_attrib(adapter, pattrib);
|
||||
pattrib->qsel = 0x10;//Beacon
|
||||
pattrib->subtype = WIFI_BEACON;
|
||||
pattrib->pktlen = pattrib->last_txcmdsz = 0;
|
||||
|
||||
#else
|
||||
if ((xmit_frame = alloc_mgtxmitframe(pxmitpriv)) == NULL)
|
||||
{
|
||||
DBG_871X("%s alloc_mgtxmitframe return null\n", __FUNCTION__);
|
||||
}
|
||||
else {
|
||||
pattrib = &xmit_frame->attrib;
|
||||
update_mgntframe_attrib(adapter, pattrib);
|
||||
pattrib->qsel = 0x10;
|
||||
pattrib->pktlen = pattrib->last_txcmdsz = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
exit:
|
||||
return xmit_frame;
|
||||
}
|
||||
|
||||
|
||||
int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len)
|
||||
{
|
||||
struct pkt_attrib *pattrib = &xmit_frame->attrib;
|
||||
u16 buf_offset;
|
||||
u32 ori_len;
|
||||
|
||||
buf_offset = TXDESC_OFFSET;
|
||||
ori_len = buf_offset+pattrib->pktlen;
|
||||
|
||||
//check if the io_buf can accommodate new cmds
|
||||
if(ori_len + cmd_len + 8 > MAX_XMITBUF_SZ) {
|
||||
DBG_871X("%s %u is large than MAX_XMITBUF_SZ:%u, can't accommodate new cmds\n", __FUNCTION__
|
||||
, ori_len + cmd_len + 8, MAX_XMITBUF_SZ);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
_rtw_memcpy(xmit_frame->buf_addr + buf_offset + pattrib->pktlen, IOL_cmds, cmd_len);
|
||||
pattrib->pktlen += cmd_len;
|
||||
pattrib->last_txcmdsz += cmd_len;
|
||||
|
||||
//DBG_871X("%s ori:%u + cmd_len:%u = %u\n", __FUNCTION__, ori_len, cmd_len, buf_offset+pattrib->pktlen);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
bool rtw_IOL_applied(ADAPTER *adapter)
|
||||
{
|
||||
if(1 == adapter->registrypriv.fw_iol)
|
||||
return _TRUE;
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
if((2 == adapter->registrypriv.fw_iol) && (!adapter_to_dvobj(adapter)->ishighspeed))
|
||||
return _TRUE;
|
||||
#endif
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
/*
|
||||
bool rtw_IOL_applied(ADAPTER *adapter)
|
||||
{
|
||||
if(adapter->registrypriv.fw_iol)
|
||||
return _TRUE;
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
if(!adapter_to_dvobj(adapter)->ishighspeed)
|
||||
return _TRUE;
|
||||
#endif
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
*/
|
||||
|
||||
int rtw_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt)
|
||||
{
|
||||
return rtw_hal_iol_cmd(adapter, xmit_frame, max_wating_ms,bndy_cnt);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IOL_NEW_GENERATION
|
||||
int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary)
|
||||
{
|
||||
return _SUCCESS;
|
||||
}
|
||||
int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WB_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0xFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
}
|
||||
int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u16 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WW_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0xFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
}
|
||||
int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u32 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WD_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0xFFFFFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
}
|
||||
|
||||
int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, u32 value, u32 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_W_RF,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = (rf_path<<8) |((addr) &0xFF);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0x000FFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_871X("%s rf_path:0x%02x addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__,rf_path, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
|
||||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0};
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, us);
|
||||
cmd.address = cpu_to_le16(us);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, us);
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
}
|
||||
|
||||
int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
||||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, ms);
|
||||
cmd.address = cpu_to_le16(ms);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, ms);
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
}
|
||||
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
|
||||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_END,0xFFFF, 0xFF,0x0};
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame)
|
||||
{
|
||||
u8 is_cmd_bndy = _FALSE;
|
||||
if(((pxmit_frame->attrib.pktlen+32)%256) + 8 >= 256){
|
||||
rtw_IOL_append_END_cmd(pxmit_frame);
|
||||
pxmit_frame->attrib.pktlen = ((((pxmit_frame->attrib.pktlen+32)/256)+1)*256 );
|
||||
|
||||
//printk("==> %s, pktlen(%d)\n",__FUNCTION__,pxmit_frame->attrib.pktlen);
|
||||
pxmit_frame->attrib.last_txcmdsz = pxmit_frame->attrib.pktlen;
|
||||
is_cmd_bndy = _TRUE;
|
||||
}
|
||||
return is_cmd_bndy;
|
||||
}
|
||||
|
||||
void rtw_IOL_cmd_buf_dump(ADAPTER *Adapter,int buf_len,u8 *pbuf)
|
||||
{
|
||||
int i;
|
||||
int j=1;
|
||||
|
||||
printk("###### %s ######\n",__FUNCTION__);
|
||||
for(i=0;i< buf_len;i++){
|
||||
printk("%02x-",*(pbuf+i));
|
||||
|
||||
if(j%32 ==0) printk("\n");j++;
|
||||
}
|
||||
printk("\n");
|
||||
printk("============= ioreg_cmd len = %d =============== \n",buf_len);
|
||||
}
|
||||
|
||||
|
||||
#else //CONFIG_IOL_NEW_GENERATION
|
||||
int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_LLT, 0x0, 0x0};
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)page_boundary);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WB_REG, 0x0, 0x0};
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WW_REG, 0x0, 0x0};
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WD_REG, 0x0, 0x0};
|
||||
u8* pos = (u8 *)&cmd;
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
#ifdef DBG_IO
|
||||
int dbg_rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 1))
|
||||
DBG_871X("DBG_IO %s:%d IOL_WB(0x%04x, 0x%02x)\n", caller, line, addr, value);
|
||||
|
||||
return _rtw_IOL_append_WB_cmd(xmit_frame, addr, value);
|
||||
}
|
||||
|
||||
int dbg_rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 2))
|
||||
DBG_871X("DBG_IO %s:%d IOL_WW(0x%04x, 0x%04x)\n", caller, line, addr, value);
|
||||
|
||||
return _rtw_IOL_append_WW_cmd(xmit_frame, addr, value);
|
||||
}
|
||||
|
||||
int dbg_rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 4))
|
||||
DBG_871X("DBG_IO %s:%d IOL_WD(0x%04x, 0x%08x)\n", caller, line, addr, value);
|
||||
|
||||
return _rtw_IOL_append_WD_cmd(xmit_frame, addr, value);
|
||||
}
|
||||
#endif
|
||||
|
||||
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_DELAY_US, 0x0, 0x0};
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)us);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, us);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_DELAY_MS, 0x0, 0x0};
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)ms);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, ms);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
|
||||
{
|
||||
IOL_CMD end_cmd = {0x0, IOL_CMD_END, 0x0, 0x0};
|
||||
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&end_cmd, 8);
|
||||
|
||||
}
|
||||
|
||||
int rtw_IOL_exec_cmd_array_sync(PADAPTER adapter, u8 *IOL_cmds, u32 cmd_num, u32 max_wating_ms)
|
||||
{
|
||||
struct xmit_frame *xmit_frame;
|
||||
|
||||
if((xmit_frame=rtw_IOL_accquire_xmit_frame(adapter)) == NULL)
|
||||
return _FAIL;
|
||||
|
||||
if(rtw_IOL_append_cmds(xmit_frame, IOL_cmds, cmd_num<<3) == _FAIL)
|
||||
return _FAIL;
|
||||
|
||||
return rtw_IOL_exec_cmds_sync(adapter, xmit_frame, max_wating_ms,0);
|
||||
}
|
||||
|
||||
int rtw_IOL_exec_empty_cmds_sync(ADAPTER *adapter, u32 max_wating_ms)
|
||||
{
|
||||
IOL_CMD end_cmd = {0x0, IOL_CMD_END, 0x0, 0x0};
|
||||
return rtw_IOL_exec_cmd_array_sync(adapter, (u8*)&end_cmd, 1, max_wating_ms);
|
||||
}
|
||||
#endif //CONFIG_IOL_NEW_GENERATION
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //CONFIG_IOL
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,188 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2013 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 <rtw_odm.h>
|
||||
#ifdef CONFIG_RTL8192C
|
||||
#include <rtl8192c_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8192D
|
||||
#include <rtl8192d_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8723A
|
||||
#include <rtl8723a_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188E
|
||||
#include <rtl8188e_hal.h>
|
||||
#endif
|
||||
|
||||
const char *odm_comp_str[] = {
|
||||
/* BIT0 */"ODM_COMP_DIG",
|
||||
/* BIT1 */"ODM_COMP_RA_MASK",
|
||||
/* BIT2 */"ODM_COMP_DYNAMIC_TXPWR",
|
||||
/* BIT3 */"ODM_COMP_FA_CNT",
|
||||
/* BIT4 */"ODM_COMP_RSSI_MONITOR",
|
||||
/* BIT5 */"ODM_COMP_CCK_PD",
|
||||
/* BIT6 */"ODM_COMP_ANT_DIV",
|
||||
/* BIT7 */"ODM_COMP_PWR_SAVE",
|
||||
/* BIT8 */"ODM_COMP_PWR_TRAIN",
|
||||
/* BIT9 */"ODM_COMP_RATE_ADAPTIVE",
|
||||
/* BIT10 */"ODM_COMP_PATH_DIV",
|
||||
/* BIT11 */"ODM_COMP_PSD",
|
||||
/* BIT12 */"ODM_COMP_DYNAMIC_PRICCA",
|
||||
/* BIT13 */"ODM_COMP_RXHP",
|
||||
/* BIT14 */NULL,
|
||||
/* BIT15 */NULL,
|
||||
/* BIT16 */"ODM_COMP_EDCA_TURBO",
|
||||
/* BIT17 */"ODM_COMP_EARLY_MODE",
|
||||
/* BIT18 */NULL,
|
||||
/* BIT19 */NULL,
|
||||
/* BIT20 */NULL,
|
||||
/* BIT21 */NULL,
|
||||
/* BIT22 */NULL,
|
||||
/* BIT23 */NULL,
|
||||
/* BIT24 */"ODM_COMP_TX_PWR_TRACK",
|
||||
/* BIT25 */"ODM_COMP_RX_GAIN_TRACK",
|
||||
/* BIT26 */"ODM_COMP_CALIBRATION",
|
||||
/* BIT27 */NULL,
|
||||
/* BIT28 */NULL,
|
||||
/* BIT29 */NULL,
|
||||
/* BIT30 */"ODM_COMP_COMMON",
|
||||
/* BIT31 */"ODM_COMP_INIT",
|
||||
};
|
||||
|
||||
#define RTW_ODM_COMP_MAX 32
|
||||
|
||||
const char *odm_ability_str[] = {
|
||||
/* BIT0 */"ODM_BB_DIG",
|
||||
/* BIT1 */"ODM_BB_RA_MASK",
|
||||
/* BIT2 */"ODM_BB_DYNAMIC_TXPWR",
|
||||
/* BIT3 */"ODM_BB_FA_CNT",
|
||||
/* BIT4 */"ODM_BB_RSSI_MONITOR",
|
||||
/* BIT5 */"ODM_BB_CCK_PD",
|
||||
/* BIT6 */"ODM_BB_ANT_DIV",
|
||||
/* BIT7 */"ODM_BB_PWR_SAVE",
|
||||
/* BIT8 */"ODM_BB_PWR_TRAIN",
|
||||
/* BIT9 */"ODM_BB_RATE_ADAPTIVE",
|
||||
/* BIT10 */"ODM_BB_PATH_DIV",
|
||||
/* BIT11 */"ODM_BB_PSD",
|
||||
/* BIT12 */"ODM_BB_RXHP",
|
||||
/* BIT13 */"ODM_BB_ADAPTIVITY",
|
||||
/* BIT14 */"ODM_BB_DYNAMIC_ATC",
|
||||
/* BIT15 */NULL,
|
||||
/* BIT16 */"ODM_MAC_EDCA_TURBO",
|
||||
/* BIT17 */"ODM_MAC_EARLY_MODE",
|
||||
/* BIT18 */NULL,
|
||||
/* BIT19 */NULL,
|
||||
/* BIT20 */NULL,
|
||||
/* BIT21 */NULL,
|
||||
/* BIT22 */NULL,
|
||||
/* BIT23 */NULL,
|
||||
/* BIT24 */"ODM_RF_TX_PWR_TRACK",
|
||||
/* BIT25 */"ODM_RF_RX_GAIN_TRACK",
|
||||
/* BIT26 */"ODM_RF_CALIBRATION",
|
||||
};
|
||||
|
||||
#define RTW_ODM_ABILITY_MAX 27
|
||||
|
||||
const char *odm_dbg_level_str[] = {
|
||||
NULL,
|
||||
"ODM_DBG_OFF",
|
||||
"ODM_DBG_SERIOUS",
|
||||
"ODM_DBG_WARNING",
|
||||
"ODM_DBG_LOUD",
|
||||
"ODM_DBG_TRACE",
|
||||
};
|
||||
|
||||
#define RTW_ODM_DBG_LEVEL_NUM 6
|
||||
|
||||
void rtw_odm_dbg_comp_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &pHalData->odmpriv;
|
||||
int cnt = 0;
|
||||
u64 dbg_comp;
|
||||
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);
|
||||
for (i=0;i<RTW_ODM_COMP_MAX;i++) {
|
||||
if (odm_comp_str[i])
|
||||
DBG_871X_SEL_NL(sel, "%cBIT%-2d %s\n",
|
||||
(BIT0 << i) & dbg_comp ? '+' : ' ', i, odm_comp_str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
inline void rtw_odm_dbg_comp_set(_adapter *adapter, u64 comps)
|
||||
{
|
||||
rtw_hal_set_def_var(adapter, HW_DEF_ODM_DBG_FLAG, &comps);
|
||||
}
|
||||
|
||||
void rtw_odm_dbg_level_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &pHalData->odmpriv;
|
||||
int cnt = 0;
|
||||
u32 dbg_level;
|
||||
int i;
|
||||
|
||||
rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &dbg_level);
|
||||
DBG_871X_SEL_NL(sel, "odm.DebugDebugLevel = %u\n", dbg_level);
|
||||
for (i=0;i<RTW_ODM_DBG_LEVEL_NUM;i++) {
|
||||
if (odm_dbg_level_str[i])
|
||||
DBG_871X_SEL_NL(sel, "%u %s\n", i, odm_dbg_level_str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
inline void rtw_odm_dbg_level_set(_adapter *adapter, u32 level)
|
||||
{
|
||||
rtw_hal_set_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &level);
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_parm_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &pHalData->odmpriv;
|
||||
|
||||
DBG_871X_SEL_NL(sel, "%10s %16s %8s %10s %11s %14s\n"
|
||||
, "TH_L2H_ini", "TH_EDCCA_HL_diff", "IGI_Base", "ForceEDCCA", "AdapEn_RSSI", "IGI_LowerBound");
|
||||
DBG_871X_SEL_NL(sel, "0x%-8x %-16d 0x%-6x %-10d %-11u %-14u\n"
|
||||
, (u8)odm->TH_L2H_ini
|
||||
, odm->TH_EDCCA_HL_diff
|
||||
, odm->IGI_Base
|
||||
, odm->ForceEDCCA
|
||||
, odm->AdapEn_RSSI
|
||||
, odm->IGI_LowerBound
|
||||
);
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_parm_set(_adapter *adapter, s8 TH_L2H_ini, s8 TH_EDCCA_HL_diff,
|
||||
s8 IGI_Base, bool ForceEDCCA, u8 AdapEn_RSSI, u8 IGI_LowerBound)
|
||||
{
|
||||
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->IGI_Base = IGI_Base;
|
||||
odm->ForceEDCCA = ForceEDCCA;
|
||||
odm->AdapEn_RSSI = AdapEn_RSSI;
|
||||
odm->IGI_LowerBound = IGI_LowerBound;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,95 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTW_RF_C_
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
#include <recv_osdep.h>
|
||||
#include <xmit_osdep.h>
|
||||
|
||||
|
||||
struct ch_freq {
|
||||
u32 channel;
|
||||
u32 frequency;
|
||||
};
|
||||
|
||||
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 */
|
||||
};
|
||||
|
||||
int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
|
||||
|
||||
u32 rtw_ch2freq(u32 channel)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
u32 rtw_freq2ch(u32 freq)
|
||||
{
|
||||
u8 i;
|
||||
u32 ch = 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;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,356 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include<rtw_sreset.h>
|
||||
|
||||
void sreset_init_value(_adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
_rtw_mutex_init(&psrtpriv->silentreset_mutex);
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
void sreset_reset_value(_adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
//psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
|
||||
u8 sreset_get_wifi_status(_adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
u8 status = WIFI_STATUS_SUCCESS;
|
||||
u32 val32 = 0;
|
||||
_irqL irqL;
|
||||
if(psrtpriv->silent_reset_inprogress == _TRUE)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
val32 =rtw_read32(padapter,REG_TXDMA_STATUS);
|
||||
if(val32==0xeaeaeaea){
|
||||
psrtpriv->Wifi_Error_Status = WIFI_IF_NOT_EXIST;
|
||||
}
|
||||
else if(val32!=0){
|
||||
DBG_8192C("txdmastatu(%x)\n",val32);
|
||||
psrtpriv->Wifi_Error_Status = WIFI_MAC_TXDMA_ERROR;
|
||||
}
|
||||
|
||||
if(WIFI_STATUS_SUCCESS !=psrtpriv->Wifi_Error_Status)
|
||||
{
|
||||
DBG_8192C("==>%s error_status(0x%x) \n",__FUNCTION__,psrtpriv->Wifi_Error_Status);
|
||||
status = (psrtpriv->Wifi_Error_Status &( ~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL)));
|
||||
}
|
||||
DBG_8192C("==> %s wifi_status(0x%x)\n",__FUNCTION__,status);
|
||||
|
||||
//status restore
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
return status;
|
||||
#else
|
||||
return WIFI_STATUS_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_wifi_error_status(_adapter *padapter, u32 status)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.Wifi_Error_Status = status;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_trigger_point(_adapter *padapter, s32 tgp)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.dbg_trigger_point = tgp;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool sreset_inprogress(_adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_RESET)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
return pHalData->srestpriv.silent_reset_inprogress;
|
||||
#else
|
||||
return _FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_restore_security_station(_adapter *padapter)
|
||||
{
|
||||
u8 EntryId = 0;
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct sta_priv * pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct security_priv* psecuritypriv=&(padapter->securitypriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &padapter->mlmeextpriv.mlmext_info;
|
||||
|
||||
{
|
||||
u8 val8;
|
||||
|
||||
if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) {
|
||||
val8 = 0xcc;
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
} else if (padapter->wapiInfo.bWapiEnable && pmlmeinfo->auth_algo == dot11AuthAlgrthm_WAPI) {
|
||||
//Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey.
|
||||
val8 = 0x4c;
|
||||
#endif
|
||||
} else {
|
||||
val8 = 0xcf;
|
||||
}
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
|
||||
}
|
||||
|
||||
#if 0
|
||||
if ( ( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP40_ ) ||
|
||||
( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP104_ ))
|
||||
{
|
||||
|
||||
for(EntryId=0; EntryId<4; EntryId++)
|
||||
{
|
||||
if(EntryId == psecuritypriv->dot11PrivacyKeyIndex)
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 1,_FALSE);
|
||||
else
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 0,_FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))
|
||||
{
|
||||
psta = rtw_get_stainfo(pstapriv, get_bssid(mlmepriv));
|
||||
if (psta == NULL) {
|
||||
//DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail \n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
//pairwise key
|
||||
rtw_setstakey_cmd(padapter, psta, _TRUE,_FALSE);
|
||||
//group key
|
||||
rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0,_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
#if 0
|
||||
{
|
||||
//=======================================================
|
||||
// reset related register of Beacon control
|
||||
|
||||
//set MSR to nolink
|
||||
Set_MSR(padapter, _HW_STATE_NOLINK_);
|
||||
// reject all data frame
|
||||
rtw_write16(padapter, REG_RXFLTMAP2,0x00);
|
||||
//reset TSF
|
||||
rtw_write8(padapter, REG_DUAL_TSF_RST, (BIT(0)|BIT(1)));
|
||||
|
||||
// disable update TSF
|
||||
SetBcnCtrlReg(padapter, BIT(4), 0);
|
||||
|
||||
//=======================================================
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_setopmode_cmd(padapter, Ndis802_11Infrastructure,_FALSE);
|
||||
|
||||
{
|
||||
u8 threshold;
|
||||
#ifdef CONFIG_USB_HCI
|
||||
// TH=1 => means that invalidate usb rx aggregation
|
||||
// TH=0 => means that validate usb rx aggregation, use init value.
|
||||
if(mlmepriv->htpriv.ht_option) {
|
||||
if(padapter->registrypriv.wifi_spec==1)
|
||||
threshold = 1;
|
||||
else
|
||||
threshold = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
} else {
|
||||
threshold = 1;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
|
||||
|
||||
//disable dynamic functions, such as high power, DIG
|
||||
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress);
|
||||
|
||||
{
|
||||
u8 join_type = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));
|
||||
}
|
||||
|
||||
Set_MSR(padapter, (pmlmeinfo->state & 0x3));
|
||||
|
||||
mlmeext_joinbss_event_callback(padapter, 1);
|
||||
//restore Sequence No.
|
||||
rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn);
|
||||
|
||||
sreset_restore_security_station(padapter);
|
||||
}
|
||||
|
||||
|
||||
void sreset_restore_network_status(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_STATION_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
sreset_restore_network_station(padapter);
|
||||
} else if (check_fwstate(mlmepriv, WIFI_AP_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
rtw_ap_restore_network(padapter);
|
||||
} else if (check_fwstate(mlmepriv, WIFI_ADHOC_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_ADHOC_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
} else {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - ???\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
}
|
||||
}
|
||||
|
||||
void sreset_stop_adapter(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (!rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_stop_queue(padapter->pnetdev);
|
||||
|
||||
rtw_cancel_all_timer(padapter);
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(PLATFORM_LINUX) && defined(CONFIG_USB_HCI)
|
||||
tasklet_kill(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
rtw_scan_abort(padapter);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
{
|
||||
rtw_set_roaming(padapter, 0);
|
||||
_rtw_join_timeout_handler(padapter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void sreset_start_adapter(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
sreset_restore_network_status(padapter);
|
||||
}
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(PLATFORM_LINUX) && defined(CONFIG_USB_HCI)
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000);
|
||||
|
||||
if (rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_wake_queue(padapter->pnetdev);
|
||||
|
||||
}
|
||||
|
||||
void sreset_reset(_adapter *padapter)
|
||||
{
|
||||
#ifdef DBG_CONFIG_ERROR_RESET
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
_irqL irqL;
|
||||
u32 start = rtw_get_current_time();
|
||||
|
||||
DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _TRUE;
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
|
||||
sreset_stop_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_stop_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
_ips_enter(padapter);
|
||||
_ips_leave(padapter);
|
||||
#endif
|
||||
|
||||
sreset_start_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_start_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
DBG_871X("%s done in %d ms\n", __FUNCTION__, rtw_get_passing_time_ms(start));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -1,878 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTW_STA_MGT_C_
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
#include <recv_osdep.h>
|
||||
#include <xmit_osdep.h>
|
||||
#include <mlme_osdep.h>
|
||||
|
||||
|
||||
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
|
||||
|
||||
#error "Shall be Linux or Windows, but not both!\n"
|
||||
|
||||
#endif
|
||||
|
||||
#include <sta_info.h>
|
||||
|
||||
void _rtw_init_stainfo(struct sta_info *psta);
|
||||
void _rtw_init_stainfo(struct sta_info *psta)
|
||||
{
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_rtw_memset((u8 *)psta, 0, sizeof (struct sta_info));
|
||||
|
||||
_rtw_spinlock_init(&psta->lock);
|
||||
_rtw_init_listhead(&psta->list);
|
||||
_rtw_init_listhead(&psta->hash_list);
|
||||
//_rtw_init_listhead(&psta->asoc_list);
|
||||
//_rtw_init_listhead(&psta->sleep_list);
|
||||
//_rtw_init_listhead(&psta->wakeup_list);
|
||||
|
||||
_rtw_init_queue(&psta->sleep_q);
|
||||
psta->sleepq_len = 0;
|
||||
|
||||
_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
|
||||
_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
_rtw_init_listhead(&psta->asoc_list);
|
||||
|
||||
_rtw_init_listhead(&psta->auth_list);
|
||||
|
||||
psta->expire_to = 0;
|
||||
|
||||
psta->flags = 0;
|
||||
|
||||
psta->capability = 0;
|
||||
|
||||
psta->bpairwise_key_installed = _FALSE;
|
||||
|
||||
|
||||
#ifdef CONFIG_NATIVEAP_MLME
|
||||
psta->nonerp_set = 0;
|
||||
psta->no_short_slot_time_set = 0;
|
||||
psta->no_short_preamble_set = 0;
|
||||
psta->no_ht_gf_set = 0;
|
||||
psta->no_ht_set = 0;
|
||||
psta->ht_20mhz_set = 0;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
psta->under_exist_checking = 0;
|
||||
#endif // CONFIG_TX_MCAST2UNI
|
||||
|
||||
psta->keep_alive_trycnt = 0;
|
||||
|
||||
#endif // CONFIG_AP_MODE
|
||||
|
||||
#ifdef DBG_TRX_STA_PKTS
|
||||
psta->tx_be_cnt = 0;
|
||||
psta->tx_bk_cnt = 0;
|
||||
psta->tx_vi_cnt = 0;
|
||||
psta->tx_vo_cnt = 0;
|
||||
|
||||
psta->rx_be_cnt = 0;
|
||||
psta->rx_bk_cnt = 0;
|
||||
psta->rx_vi_cnt = 0;
|
||||
psta->rx_vo_cnt = 0;
|
||||
#endif
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
|
||||
{
|
||||
struct sta_info *psta;
|
||||
s32 i;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pstapriv->pallocated_stainfo_buf = rtw_zvmalloc (sizeof(struct sta_info) * NUM_STA+ 4);
|
||||
|
||||
if(!pstapriv->pallocated_stainfo_buf)
|
||||
return _FAIL;
|
||||
|
||||
pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
|
||||
((SIZE_PTR)(pstapriv->pallocated_stainfo_buf ) & 3);
|
||||
|
||||
_rtw_init_queue(&pstapriv->free_sta_queue);
|
||||
|
||||
_rtw_spinlock_init(&pstapriv->sta_hash_lock);
|
||||
|
||||
//_rtw_init_queue(&pstapriv->asoc_q);
|
||||
pstapriv->asoc_sta_count = 0;
|
||||
_rtw_init_queue(&pstapriv->sleep_q);
|
||||
_rtw_init_queue(&pstapriv->wakeup_q);
|
||||
|
||||
psta = (struct sta_info *)(pstapriv->pstainfo_buf);
|
||||
|
||||
|
||||
for(i = 0; i < NUM_STA; i++)
|
||||
{
|
||||
_rtw_init_stainfo(psta);
|
||||
|
||||
_rtw_init_listhead(&(pstapriv->sta_hash[i]));
|
||||
|
||||
rtw_list_insert_tail(&psta->list, get_list_head(&pstapriv->free_sta_queue));
|
||||
|
||||
psta++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
pstapriv->sta_dz_bitmap = 0;
|
||||
pstapriv->tim_bitmap = 0;
|
||||
|
||||
_rtw_init_listhead(&pstapriv->asoc_list);
|
||||
_rtw_init_listhead(&pstapriv->auth_list);
|
||||
_rtw_spinlock_init(&pstapriv->asoc_list_lock);
|
||||
_rtw_spinlock_init(&pstapriv->auth_list_lock);
|
||||
pstapriv->asoc_list_cnt = 0;
|
||||
pstapriv->auth_list_cnt = 0;
|
||||
|
||||
pstapriv->auth_to = 3; // 3*2 = 6 sec
|
||||
pstapriv->assoc_to = 3;
|
||||
//pstapriv->expire_to = 900;// 900*2 = 1800 sec = 30 min, expire after no any traffic.
|
||||
//pstapriv->expire_to = 30;// 30*2 = 60 sec = 1 min, expire after no any traffic.
|
||||
#ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
|
||||
pstapriv->expire_to = 3; // 3*2 = 6 sec
|
||||
#else
|
||||
pstapriv->expire_to = 60;// 60*2 = 120 sec = 2 min, expire after no any traffic.
|
||||
#endif
|
||||
#ifdef CONFIG_ATMEL_RC_PATCH
|
||||
_rtw_memset( pstapriv->atmel_rc_pattern, 0, ETH_ALEN);
|
||||
#endif
|
||||
pstapriv->max_num_sta = NUM_STA;
|
||||
|
||||
#endif
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
|
||||
{
|
||||
int offset = (((u8 *)sta) - stapriv->pstainfo_buf)/sizeof(struct sta_info);
|
||||
|
||||
if (!stainfo_offset_valid(offset))
|
||||
DBG_871X("%s invalid offset(%d), out of range!!!", __func__, offset);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int offset)
|
||||
{
|
||||
if (!stainfo_offset_valid(offset))
|
||||
DBG_871X("%s invalid offset(%d), out of range!!!", __func__, offset);
|
||||
|
||||
return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info));
|
||||
}
|
||||
|
||||
void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv);
|
||||
void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv)
|
||||
{
|
||||
_func_enter_;
|
||||
|
||||
_rtw_spinlock_free(&psta_xmitpriv->lock);
|
||||
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->be_q.sta_pending.lock));
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->bk_q.sta_pending.lock));
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->vi_q.sta_pending.lock));
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->vo_q.sta_pending.lock));
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
static void _rtw_free_sta_recv_priv_lock(struct sta_recv_priv *psta_recvpriv)
|
||||
{
|
||||
_func_enter_;
|
||||
|
||||
_rtw_spinlock_free(&psta_recvpriv->lock);
|
||||
|
||||
_rtw_spinlock_free(&(psta_recvpriv->defrag_q.lock));
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void rtw_mfree_stainfo(struct sta_info *psta);
|
||||
void rtw_mfree_stainfo(struct sta_info *psta)
|
||||
{
|
||||
_func_enter_;
|
||||
|
||||
if(&psta->lock != NULL)
|
||||
_rtw_spinlock_free(&psta->lock);
|
||||
|
||||
_rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
|
||||
_rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv);
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
||||
// this function is used to free the memory of lock || sema for all stainfos
|
||||
void rtw_mfree_all_stainfo(struct sta_priv *pstapriv );
|
||||
void rtw_mfree_all_stainfo(struct sta_priv *pstapriv )
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *plist, *phead;
|
||||
struct sta_info *psta = NULL;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
phead = get_list_head(&pstapriv->free_sta_queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,list);
|
||||
plist = get_next(plist);
|
||||
|
||||
rtw_mfree_stainfo(psta);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv);
|
||||
void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
|
||||
{
|
||||
#ifdef CONFIG_AP_MODE
|
||||
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
|
||||
#endif
|
||||
|
||||
rtw_mfree_all_stainfo(pstapriv); //be done before free sta_hash_lock
|
||||
|
||||
_rtw_spinlock_free(&pstapriv->free_sta_queue.lock);
|
||||
|
||||
_rtw_spinlock_free(&pstapriv->sta_hash_lock);
|
||||
_rtw_spinlock_free(&pstapriv->wakeup_q.lock);
|
||||
_rtw_spinlock_free(&pstapriv->sleep_q.lock);
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
_rtw_spinlock_free(&pstapriv->asoc_list_lock);
|
||||
_rtw_spinlock_free(&pstapriv->auth_list_lock);
|
||||
_rtw_spinlock_free(&pacl_list->acl_node_q.lock);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
struct sta_info *psta = NULL;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
int index;
|
||||
|
||||
_func_enter_;
|
||||
if(pstapriv){
|
||||
|
||||
/* delete all reordering_ctrl_timer */
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
for(index = 0; index < NUM_STA; index++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
int i;
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
|
||||
plist = get_next(plist);
|
||||
|
||||
for(i=0; i < 16 ; i++)
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
/*===============================*/
|
||||
|
||||
rtw_mfree_sta_priv_lock(pstapriv);
|
||||
|
||||
if(pstapriv->pallocated_stainfo_buf) {
|
||||
rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info)*NUM_STA+4);
|
||||
}
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
//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)
|
||||
{
|
||||
_irqL irqL, irqL2;
|
||||
uint tmp_aid;
|
||||
s32 index;
|
||||
_list *phash_list;
|
||||
struct sta_info *psta;
|
||||
_queue *pfree_sta_queue;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
int i = 0;
|
||||
u16 wRxSeqInitialValue = 0xffff;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pfree_sta_queue = &pstapriv->free_sta_queue;
|
||||
|
||||
//_enter_critical_bh(&(pfree_sta_queue->lock), &irqL);
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
||||
if (_rtw_queue_empty(pfree_sta_queue) == _TRUE)
|
||||
{
|
||||
//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
psta = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list);
|
||||
|
||||
rtw_list_delete(&(psta->list));
|
||||
|
||||
//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
|
||||
|
||||
tmp_aid = psta->aid;
|
||||
|
||||
_rtw_init_stainfo(psta);
|
||||
|
||||
psta->padapter = pstapriv->padapter;
|
||||
|
||||
_rtw_memcpy(psta->hwaddr, hwaddr, ETH_ALEN);
|
||||
|
||||
index = wifi_mac_hash(hwaddr);
|
||||
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("rtw_alloc_stainfo: index = %x", index));
|
||||
|
||||
if(index >= NUM_STA){
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("ERROR=> rtw_alloc_stainfo: index >= NUM_STA"));
|
||||
psta= NULL;
|
||||
goto exit;
|
||||
}
|
||||
phash_list = &(pstapriv->sta_hash[index]);
|
||||
|
||||
//_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
||||
rtw_list_insert_tail(&psta->hash_list, phash_list);
|
||||
|
||||
pstapriv->asoc_sta_count ++ ;
|
||||
|
||||
//_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
||||
// Commented by Albert 2009/08/13
|
||||
// For the SMC router, the sequence number of first packet of WPS handshake will be 0.
|
||||
// In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable.
|
||||
// So, we initialize the tid_rxseq variable as the 0xffff.
|
||||
|
||||
for( i = 0; i < 16; i++ )
|
||||
{
|
||||
_rtw_memcpy( &psta->sta_recvpriv.rxcache.tid_rxseq[ i ], &wRxSeqInitialValue, 2 );
|
||||
}
|
||||
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("alloc number_%d stainfo with hwaddr = %x %x %x %x %x %x \n",
|
||||
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_TDLS
|
||||
psta->padapter = pstapriv->padapter;
|
||||
init_TPK_timer(pstapriv->padapter, psta);
|
||||
init_ch_switch_timer(pstapriv->padapter, psta);
|
||||
init_base_ch_timer(pstapriv->padapter, psta);
|
||||
init_off_ch_timer(pstapriv->padapter, psta);
|
||||
init_handshake_timer(pstapriv->padapter, psta);
|
||||
init_tdls_alive_timer(pstapriv->padapter, psta);
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
//for A-MPDU Rx reordering buffer control
|
||||
for(i=0; i < 16 ; i++)
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
||||
preorder_ctrl->padapter = pstapriv->padapter;
|
||||
|
||||
preorder_ctrl->enable = _FALSE;
|
||||
|
||||
preorder_ctrl->indicate_seq = 0xffff;
|
||||
#ifdef DBG_RX_SEQ
|
||||
DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq);
|
||||
#endif
|
||||
preorder_ctrl->wend_b= 0xffff;
|
||||
//preorder_ctrl->wsize_b = (NR_RECVBUFF-2);
|
||||
preorder_ctrl->wsize_b = 64;//64;
|
||||
|
||||
_rtw_init_queue(&preorder_ctrl->pending_recvframe_queue);
|
||||
|
||||
rtw_init_recv_timer(preorder_ctrl);
|
||||
}
|
||||
|
||||
|
||||
//init for DM
|
||||
psta->rssi_stat.UndecoratedSmoothedPWDB = (-1);
|
||||
psta->rssi_stat.UndecoratedSmoothedCCK = (-1);
|
||||
#ifdef CONFIG_ATMEL_RC_PATCH
|
||||
psta->flag_atmel_rc = 0;
|
||||
#endif
|
||||
/* init for the sequence number of received management frame */
|
||||
psta->RxMgmtFrameSeqNum = 0xffff;
|
||||
|
||||
//alloc mac id for non-bc/mc station,
|
||||
rtw_alloc_macid(pstapriv->padapter, psta);
|
||||
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return psta;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// using pstapriv->sta_hash_lock to protect
|
||||
u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
|
||||
{
|
||||
int i;
|
||||
_irqL irqL0;
|
||||
_queue *pfree_sta_queue;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
struct sta_xmit_priv *pstaxmitpriv;
|
||||
struct xmit_priv *pxmitpriv= &padapter->xmitpriv;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct hw_xmit *phwxmit;
|
||||
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if (psta == NULL)
|
||||
goto exit;
|
||||
|
||||
|
||||
_enter_critical_bh(&psta->lock, &irqL0);
|
||||
psta->state &= ~_FW_LINKED;
|
||||
_exit_critical_bh(&psta->lock, &irqL0);
|
||||
|
||||
pfree_sta_queue = &pstapriv->free_sta_queue;
|
||||
|
||||
|
||||
pstaxmitpriv = &psta->sta_xmitpriv;
|
||||
|
||||
//rtw_list_delete(&psta->sleep_list);
|
||||
|
||||
//rtw_list_delete(&psta->wakeup_list);
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
|
||||
psta->sleepq_len = 0;
|
||||
|
||||
//vo
|
||||
//_enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending));
|
||||
phwxmit = pxmitpriv->hwxmits;
|
||||
phwxmit->accnt -= pstaxmitpriv->vo_q.qcnt;
|
||||
pstaxmitpriv->vo_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
|
||||
|
||||
//vi
|
||||
//_enter_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->vi_q.tx_pending));
|
||||
phwxmit = pxmitpriv->hwxmits+1;
|
||||
phwxmit->accnt -= pstaxmitpriv->vi_q.qcnt;
|
||||
pstaxmitpriv->vi_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);
|
||||
|
||||
//be
|
||||
//_enter_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->be_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));
|
||||
phwxmit = pxmitpriv->hwxmits+2;
|
||||
phwxmit->accnt -= pstaxmitpriv->be_q.qcnt;
|
||||
pstaxmitpriv->be_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);
|
||||
|
||||
//bk
|
||||
//_enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending));
|
||||
phwxmit = pxmitpriv->hwxmits+3;
|
||||
phwxmit->accnt -= pstaxmitpriv->bk_q.qcnt;
|
||||
pstaxmitpriv->bk_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
|
||||
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
rtw_list_delete(&psta->hash_list);
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("\n free number_%d stainfo with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n",pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5]));
|
||||
pstapriv->asoc_sta_count --;
|
||||
|
||||
|
||||
// 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);
|
||||
|
||||
_cancel_timer_ex(&psta->addba_retry_timer);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
_cancel_timer_ex(&psta->TPK_timer);
|
||||
_cancel_timer_ex(&psta->option_timer);
|
||||
_cancel_timer_ex(&psta->base_ch_timer);
|
||||
_cancel_timer_ex(&psta->off_ch_timer);
|
||||
_cancel_timer_ex(&psta->alive_timer1);
|
||||
_cancel_timer_ex(&psta->alive_timer2);
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
//for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer
|
||||
for(i=0; i < 16 ; i++)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
union recv_frame *prframe;
|
||||
_queue *ppending_recvframe_queue;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
|
||||
|
||||
ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
|
||||
|
||||
_enter_critical_bh(&ppending_recvframe_queue->lock, &irqL);
|
||||
|
||||
phead = get_list_head(ppending_recvframe_queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
while(!rtw_is_list_empty(phead))
|
||||
{
|
||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
|
||||
plist = get_next(plist);
|
||||
|
||||
rtw_list_delete(&(prframe->u.hdr.list));
|
||||
|
||||
rtw_free_recvframe(prframe, pfree_recv_queue);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irqL);
|
||||
|
||||
}
|
||||
|
||||
if (!(psta->state & WIFI_AP_STATE))
|
||||
rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, _FALSE);
|
||||
|
||||
|
||||
//release mac id for non-bc/mc station,
|
||||
rtw_release_macid(pstapriv->padapter, psta);
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
/*
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
|
||||
*/
|
||||
_enter_critical_bh(&pstapriv->auth_list_lock, &irqL0);
|
||||
if (!rtw_is_list_empty(&psta->auth_list)) {
|
||||
rtw_list_delete(&psta->auth_list);
|
||||
pstapriv->auth_list_cnt--;
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->auth_list_lock, &irqL0);
|
||||
|
||||
psta->expire_to = 0;
|
||||
#ifdef CONFIG_ATMEL_RC_PATCH
|
||||
psta->flag_atmel_rc = 0;
|
||||
#endif
|
||||
psta->sleepq_ac_len = 0;
|
||||
psta->qos_info = 0;
|
||||
|
||||
psta->max_sp_len = 0;
|
||||
psta->uapsd_bk = 0;
|
||||
psta->uapsd_be = 0;
|
||||
psta->uapsd_vi = 0;
|
||||
psta->uapsd_vo = 0;
|
||||
|
||||
psta->has_legacy_ac = 0;
|
||||
|
||||
#ifdef CONFIG_NATIVEAP_MLME
|
||||
|
||||
pstapriv->sta_dz_bitmap &=~BIT(psta->aid);
|
||||
pstapriv->tim_bitmap &=~BIT(psta->aid);
|
||||
|
||||
//rtw_indicate_sta_disassoc_event(padapter, psta);
|
||||
|
||||
if ((psta->aid >0)&&(pstapriv->sta_aid[psta->aid - 1] == psta))
|
||||
{
|
||||
pstapriv->sta_aid[psta->aid - 1] = NULL;
|
||||
psta->aid = 0;
|
||||
}
|
||||
|
||||
#endif // CONFIG_NATIVEAP_MLME
|
||||
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
psta->under_exist_checking = 0;
|
||||
#endif // CONFIG_TX_MCAST2UNI
|
||||
|
||||
#endif // CONFIG_AP_MODE
|
||||
|
||||
_rtw_spinlock_free(&psta->lock);
|
||||
|
||||
//_enter_critical_bh(&(pfree_sta_queue->lock), &irqL0);
|
||||
rtw_list_insert_tail(&psta->list, get_list_head(pfree_sta_queue));
|
||||
//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL0);
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
// free all stainfo which in sta_hash[all]
|
||||
void rtw_free_all_stainfo(_adapter *padapter)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *plist, *phead;
|
||||
s32 index;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info* pbcmc_stainfo =rtw_get_bcmc_stainfo( padapter);
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if(pstapriv->asoc_sta_count==1)
|
||||
goto exit;
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
for(index=0; index< NUM_STA; index++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
|
||||
|
||||
plist = get_next(plist);
|
||||
|
||||
if(pbcmc_stainfo!=psta)
|
||||
rtw_free_stainfo(padapter , psta);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
/* any station allocated can be searched by hash list */
|
||||
struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
||||
{
|
||||
|
||||
_irqL irqL;
|
||||
|
||||
_list *plist, *phead;
|
||||
|
||||
struct sta_info *psta = NULL;
|
||||
|
||||
u32 index;
|
||||
|
||||
u8 *addr;
|
||||
|
||||
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if(hwaddr==NULL)
|
||||
return NULL;
|
||||
|
||||
if(IS_MCAST(hwaddr))
|
||||
{
|
||||
addr = bc_addr;
|
||||
}
|
||||
else
|
||||
{
|
||||
addr = hwaddr;
|
||||
}
|
||||
|
||||
index = wifi_mac_hash(addr);
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
||||
if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN))== _TRUE)
|
||||
{ // if found the matched address
|
||||
break;
|
||||
}
|
||||
psta=NULL;
|
||||
plist = get_next(plist);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
_func_exit_;
|
||||
return psta;
|
||||
|
||||
}
|
||||
|
||||
u32 rtw_init_bcmc_stainfo(_adapter* padapter)
|
||||
{
|
||||
|
||||
struct sta_info *psta;
|
||||
struct tx_servq *ptxservq;
|
||||
u32 res=_SUCCESS;
|
||||
NDIS_802_11_MAC_ADDRESS bcast_addr= {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
//_queue *pstapending = &padapter->xmitpriv.bm_pending;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
|
||||
|
||||
if(psta==NULL){
|
||||
res=_FAIL;
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("rtw_alloc_stainfo fail"));
|
||||
goto exit;
|
||||
}
|
||||
|
||||
// default broadcast & multicast use macid 1
|
||||
psta->mac_id = 1;
|
||||
|
||||
ptxservq= &(psta->sta_xmitpriv.be_q);
|
||||
|
||||
/*
|
||||
_enter_critical(&pstapending->lock, &irqL0);
|
||||
|
||||
if (rtw_is_list_empty(&ptxservq->tx_pending))
|
||||
rtw_list_insert_tail(&ptxservq->tx_pending, get_list_head(pstapending));
|
||||
|
||||
_exit_critical(&pstapending->lock, &irqL0);
|
||||
*/
|
||||
|
||||
exit:
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
struct sta_info* rtw_get_bcmc_stainfo(_adapter* padapter)
|
||||
{
|
||||
struct sta_info *psta;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
_func_enter_;
|
||||
psta = rtw_get_stainfo(pstapriv, bc_addr);
|
||||
_func_exit_;
|
||||
return psta;
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr)
|
||||
{
|
||||
u8 res = _TRUE;
|
||||
#ifdef CONFIG_AP_MODE
|
||||
_irqL irqL;
|
||||
_list *plist, *phead;
|
||||
struct rtw_wlan_acl_node *paclnode;
|
||||
u8 match = _FALSE;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
|
||||
_queue *pacl_node_q =&pacl_list->acl_node_q;
|
||||
|
||||
_enter_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
phead = get_list_head(pacl_node_q);
|
||||
plist = get_next(phead);
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
|
||||
plist = get_next(plist);
|
||||
|
||||
if(_rtw_memcmp(paclnode->addr, mac_addr, ETH_ALEN))
|
||||
{
|
||||
if(paclnode->valid == _TRUE)
|
||||
{
|
||||
match = _TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
|
||||
|
||||
if(pacl_list->mode == 1)//accept unless in deny list
|
||||
{
|
||||
res = (match == _TRUE) ? _FALSE:_TRUE;
|
||||
}
|
||||
else if(pacl_list->mode == 2)//deny unless in accept list
|
||||
{
|
||||
res = (match == _TRUE) ? _TRUE:_FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
res = _TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,924 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtw_wapi.h>
|
||||
|
||||
|
||||
#ifdef CONFIG_WAPI_SW_SMS4
|
||||
|
||||
#define WAPI_LITTLE_ENDIAN
|
||||
//#define BIG_ENDIAN
|
||||
#define ENCRYPT 0
|
||||
#define DECRYPT 1
|
||||
|
||||
|
||||
/**********************************************************
|
||||
**********************************************************/
|
||||
const u8 Sbox[256] = {
|
||||
0xd6,0x90,0xe9,0xfe,0xcc,0xe1,0x3d,0xb7,0x16,0xb6,0x14,0xc2,0x28,0xfb,0x2c,0x05,
|
||||
0x2b,0x67,0x9a,0x76,0x2a,0xbe,0x04,0xc3,0xaa,0x44,0x13,0x26,0x49,0x86,0x06,0x99,
|
||||
0x9c,0x42,0x50,0xf4,0x91,0xef,0x98,0x7a,0x33,0x54,0x0b,0x43,0xed,0xcf,0xac,0x62,
|
||||
0xe4,0xb3,0x1c,0xa9,0xc9,0x08,0xe8,0x95,0x80,0xdf,0x94,0xfa,0x75,0x8f,0x3f,0xa6,
|
||||
0x47,0x07,0xa7,0xfc,0xf3,0x73,0x17,0xba,0x83,0x59,0x3c,0x19,0xe6,0x85,0x4f,0xa8,
|
||||
0x68,0x6b,0x81,0xb2,0x71,0x64,0xda,0x8b,0xf8,0xeb,0x0f,0x4b,0x70,0x56,0x9d,0x35,
|
||||
0x1e,0x24,0x0e,0x5e,0x63,0x58,0xd1,0xa2,0x25,0x22,0x7c,0x3b,0x01,0x21,0x78,0x87,
|
||||
0xd4,0x00,0x46,0x57,0x9f,0xd3,0x27,0x52,0x4c,0x36,0x02,0xe7,0xa0,0xc4,0xc8,0x9e,
|
||||
0xea,0xbf,0x8a,0xd2,0x40,0xc7,0x38,0xb5,0xa3,0xf7,0xf2,0xce,0xf9,0x61,0x15,0xa1,
|
||||
0xe0,0xae,0x5d,0xa4,0x9b,0x34,0x1a,0x55,0xad,0x93,0x32,0x30,0xf5,0x8c,0xb1,0xe3,
|
||||
0x1d,0xf6,0xe2,0x2e,0x82,0x66,0xca,0x60,0xc0,0x29,0x23,0xab,0x0d,0x53,0x4e,0x6f,
|
||||
0xd5,0xdb,0x37,0x45,0xde,0xfd,0x8e,0x2f,0x03,0xff,0x6a,0x72,0x6d,0x6c,0x5b,0x51,
|
||||
0x8d,0x1b,0xaf,0x92,0xbb,0xdd,0xbc,0x7f,0x11,0xd9,0x5c,0x41,0x1f,0x10,0x5a,0xd8,
|
||||
0x0a,0xc1,0x31,0x88,0xa5,0xcd,0x7b,0xbd,0x2d,0x74,0xd0,0x12,0xb8,0xe5,0xb4,0xb0,
|
||||
0x89,0x69,0x97,0x4a,0x0c,0x96,0x77,0x7e,0x65,0xb9,0xf1,0x09,0xc5,0x6e,0xc6,0x84,
|
||||
0x18,0xf0,0x7d,0xec,0x3a,0xdc,0x4d,0x20,0x79,0xee,0x5f,0x3e,0xd7,0xcb,0x39,0x48
|
||||
};
|
||||
|
||||
const u32 CK[32] = {
|
||||
0x00070e15, 0x1c232a31, 0x383f464d, 0x545b6269,
|
||||
0x70777e85, 0x8c939aa1, 0xa8afb6bd, 0xc4cbd2d9,
|
||||
0xe0e7eef5, 0xfc030a11, 0x181f262d, 0x343b4249,
|
||||
0x50575e65, 0x6c737a81, 0x888f969d, 0xa4abb2b9,
|
||||
0xc0c7ced5, 0xdce3eaf1, 0xf8ff060d, 0x141b2229,
|
||||
0x30373e45, 0x4c535a61, 0x686f767d, 0x848b9299,
|
||||
0xa0a7aeb5, 0xbcc3cad1, 0xd8dfe6ed, 0xf4fb0209,
|
||||
0x10171e25, 0x2c333a41, 0x484f565d, 0x646b7279 };
|
||||
|
||||
#define Rotl(_x, _y) (((_x) << (_y)) | ((_x) >> (32 - (_y))))
|
||||
|
||||
#define ByteSub(_A) (Sbox[(_A) >> 24 & 0xFF] << 24 | \
|
||||
Sbox[(_A) >> 16 & 0xFF] << 16 | \
|
||||
Sbox[(_A) >> 8 & 0xFF] << 8 | \
|
||||
Sbox[(_A) & 0xFF])
|
||||
|
||||
#define L1(_B) ((_B) ^ Rotl(_B, 2) ^ Rotl(_B, 10) ^ Rotl(_B, 18) ^ Rotl(_B, 24))
|
||||
#define L2(_B) ((_B) ^ Rotl(_B, 13) ^ Rotl(_B, 23))
|
||||
|
||||
static void
|
||||
xor_block(void *dst, void *src1, void *src2)
|
||||
/* 128-bit xor: *dst = *src1 xor *src2. Pointers must be 32-bit aligned */
|
||||
{
|
||||
((u32 *)dst)[0] = ((u32 *)src1)[0] ^ ((u32 *)src2)[0];
|
||||
((u32 *)dst)[1] = ((u32 *)src1)[1] ^ ((u32 *)src2)[1];
|
||||
((u32 *)dst)[2] = ((u32 *)src1)[2] ^ ((u32 *)src2)[2];
|
||||
((u32 *)dst)[3] = ((u32 *)src1)[3] ^ ((u32 *)src2)[3];
|
||||
}
|
||||
|
||||
|
||||
void SMS4Crypt(u8 *Input, u8 *Output, u32 *rk)
|
||||
{
|
||||
u32 r, mid, x0, x1, x2, x3, *p;
|
||||
p = (u32 *)Input;
|
||||
x0 = p[0];
|
||||
x1 = p[1];
|
||||
x2 = p[2];
|
||||
x3 = p[3];
|
||||
#ifdef WAPI_LITTLE_ENDIAN
|
||||
x0 = Rotl(x0, 16); x0 = ((x0 & 0x00FF00FF) << 8) | ((x0 & 0xFF00FF00) >> 8);
|
||||
x1 = Rotl(x1, 16); x1 = ((x1 & 0x00FF00FF) << 8) | ((x1 & 0xFF00FF00) >> 8);
|
||||
x2 = Rotl(x2, 16); x2 = ((x2 & 0x00FF00FF) << 8) | ((x2 & 0xFF00FF00) >> 8);
|
||||
x3 = Rotl(x3, 16); x3 = ((x3 & 0x00FF00FF) << 8) | ((x3 & 0xFF00FF00) >> 8);
|
||||
#endif
|
||||
for (r = 0; r < 32; r += 4)
|
||||
{
|
||||
mid = x1 ^ x2 ^ x3 ^ rk[r + 0];
|
||||
mid = ByteSub(mid);
|
||||
x0 ^= L1(mid);
|
||||
mid = x2 ^ x3 ^ x0 ^ rk[r + 1];
|
||||
mid = ByteSub(mid);
|
||||
x1 ^= L1(mid);
|
||||
mid = x3 ^ x0 ^ x1 ^ rk[r + 2];
|
||||
mid = ByteSub(mid);
|
||||
x2 ^= L1(mid);
|
||||
mid = x0 ^ x1 ^ x2 ^ rk[r + 3];
|
||||
mid = ByteSub(mid);
|
||||
x3 ^= L1(mid);
|
||||
}
|
||||
#ifdef WAPI_LITTLE_ENDIAN
|
||||
x0 = Rotl(x0, 16); x0 = ((x0 & 0x00FF00FF) << 8) | ((x0 & 0xFF00FF00) >> 8);
|
||||
x1 = Rotl(x1, 16); x1 = ((x1 & 0x00FF00FF) << 8) | ((x1 & 0xFF00FF00) >> 8);
|
||||
x2 = Rotl(x2, 16); x2 = ((x2 & 0x00FF00FF) << 8) | ((x2 & 0xFF00FF00) >> 8);
|
||||
x3 = Rotl(x3, 16); x3 = ((x3 & 0x00FF00FF) << 8) | ((x3 & 0xFF00FF00) >> 8);
|
||||
#endif
|
||||
p = (u32 *)Output;
|
||||
p[0] = x3;
|
||||
p[1] = x2;
|
||||
p[2] = x1;
|
||||
p[3] = x0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SMS4KeyExt(u8 *Key, u32 *rk, u32 CryptFlag)
|
||||
{
|
||||
u32 r, mid, x0, x1, x2, x3, *p;
|
||||
|
||||
p = (u32 *)Key;
|
||||
x0 = p[0];
|
||||
x1 = p[1];
|
||||
x2 = p[2];
|
||||
x3 = p[3];
|
||||
#ifdef WAPI_LITTLE_ENDIAN
|
||||
x0 = Rotl(x0, 16); x0 = ((x0 & 0xFF00FF) << 8) | ((x0 & 0xFF00FF00) >> 8);
|
||||
x1 = Rotl(x1, 16); x1 = ((x1 & 0xFF00FF) << 8) | ((x1 & 0xFF00FF00) >> 8);
|
||||
x2 = Rotl(x2, 16); x2 = ((x2 & 0xFF00FF) << 8) | ((x2 & 0xFF00FF00) >> 8);
|
||||
x3 = Rotl(x3, 16); x3 = ((x3 & 0xFF00FF) << 8) | ((x3 & 0xFF00FF00) >> 8);
|
||||
#endif
|
||||
|
||||
x0 ^= 0xa3b1bac6;
|
||||
x1 ^= 0x56aa3350;
|
||||
x2 ^= 0x677d9197;
|
||||
x3 ^= 0xb27022dc;
|
||||
for (r = 0; r < 32; r += 4)
|
||||
{
|
||||
mid = x1 ^ x2 ^ x3 ^ CK[r + 0];
|
||||
mid = ByteSub(mid);
|
||||
rk[r + 0] = x0 ^= L2(mid);
|
||||
mid = x2 ^ x3 ^ x0 ^ CK[r + 1];
|
||||
mid = ByteSub(mid);
|
||||
rk[r + 1] = x1 ^= L2(mid);
|
||||
mid = x3 ^ x0 ^ x1 ^ CK[r + 2];
|
||||
mid = ByteSub(mid);
|
||||
rk[r + 2] = x2 ^= L2(mid);
|
||||
mid = x0 ^ x1 ^ x2 ^ CK[r + 3];
|
||||
mid = ByteSub(mid);
|
||||
rk[r + 3] = x3 ^= L2(mid);
|
||||
}
|
||||
if (CryptFlag == DECRYPT)
|
||||
{
|
||||
for (r = 0; r < 16; r++)
|
||||
mid = rk[r], rk[r] = rk[31 - r], rk[31 - r] = mid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WapiSMS4Cryption(u8 *Key, u8 *IV, u8 *Input, u16 InputLength,
|
||||
u8 *Output, u16 *OutputLength, u32 CryptFlag)
|
||||
{
|
||||
u32 blockNum,i,j, rk[32];
|
||||
u16 remainder;
|
||||
u8 blockIn[16],blockOut[16], tempIV[16], k;
|
||||
|
||||
*OutputLength = 0;
|
||||
remainder = InputLength & 0x0F;
|
||||
blockNum = InputLength >> 4;
|
||||
if(remainder !=0)
|
||||
blockNum++;
|
||||
else
|
||||
remainder = 16;
|
||||
|
||||
for(k=0;k<16;k++)
|
||||
tempIV[k] = IV[15-k];
|
||||
|
||||
memcpy(blockIn, tempIV, 16);
|
||||
|
||||
SMS4KeyExt((u8 *)Key, rk,CryptFlag);
|
||||
|
||||
for(i=0; i<blockNum-1; i++)
|
||||
{
|
||||
SMS4Crypt((u8 *)blockIn, blockOut, rk);
|
||||
xor_block(&Output[i*16], &Input[i*16], blockOut);
|
||||
memcpy(blockIn,blockOut,16);
|
||||
}
|
||||
|
||||
*OutputLength = i*16;
|
||||
|
||||
SMS4Crypt((u8 *)blockIn, blockOut, rk);
|
||||
|
||||
for(j=0; j<remainder; j++)
|
||||
{
|
||||
Output[i*16+j] = Input[i*16+j] ^ blockOut[j];
|
||||
}
|
||||
*OutputLength += remainder;
|
||||
|
||||
}
|
||||
|
||||
void WapiSMS4Encryption(u8 *Key, u8 *IV, u8 *Input, u16 InputLength,
|
||||
u8 *Output, u16 *OutputLength)
|
||||
{
|
||||
|
||||
WapiSMS4Cryption(Key, IV, Input, InputLength, Output, OutputLength, ENCRYPT);
|
||||
}
|
||||
|
||||
void WapiSMS4Decryption(u8 *Key, u8 *IV, u8 *Input, u16 InputLength,
|
||||
u8 *Output, u16 *OutputLength)
|
||||
{
|
||||
// OFB mode: is also ENCRYPT flag
|
||||
WapiSMS4Cryption(Key, IV, Input, InputLength, Output, OutputLength, ENCRYPT);
|
||||
}
|
||||
|
||||
void WapiSMS4CalculateMic(u8 *Key, u8 *IV, u8 *Input1, u8 Input1Length,
|
||||
u8 *Input2, u16 Input2Length, u8 *Output, u8 *OutputLength)
|
||||
{
|
||||
u32 blockNum, i, remainder, rk[32];
|
||||
u8 BlockIn[16], BlockOut[16], TempBlock[16], tempIV[16], k;
|
||||
|
||||
*OutputLength = 0;
|
||||
remainder = Input1Length & 0x0F;
|
||||
blockNum = Input1Length >> 4;
|
||||
|
||||
for(k=0;k<16;k++)
|
||||
tempIV[k] = IV[15-k];
|
||||
|
||||
memcpy(BlockIn, tempIV, 16);
|
||||
|
||||
SMS4KeyExt((u8 *)Key, rk, ENCRYPT);
|
||||
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
|
||||
for(i=0; i<blockNum; i++){
|
||||
xor_block(BlockIn, (Input1+i*16), BlockOut);
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
}
|
||||
|
||||
if(remainder !=0){
|
||||
memset(TempBlock, 0, 16);
|
||||
memcpy(TempBlock, (Input1+blockNum*16), remainder);
|
||||
|
||||
xor_block(BlockIn, TempBlock, BlockOut);
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
}
|
||||
|
||||
remainder = Input2Length & 0x0F;
|
||||
blockNum = Input2Length >> 4;
|
||||
|
||||
for(i=0; i<blockNum; i++){
|
||||
xor_block(BlockIn, (Input2+i*16), BlockOut);
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
}
|
||||
|
||||
if(remainder !=0){
|
||||
memset(TempBlock, 0, 16);
|
||||
memcpy(TempBlock, (Input2+blockNum*16), remainder);
|
||||
|
||||
xor_block(BlockIn, TempBlock, BlockOut);
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
}
|
||||
|
||||
memcpy(Output, BlockOut, 16);
|
||||
*OutputLength = 16;
|
||||
}
|
||||
|
||||
void SecCalculateMicSMS4(
|
||||
u8 KeyIdx,
|
||||
u8 *MicKey,
|
||||
u8 *pHeader,
|
||||
u8 *pData,
|
||||
u16 DataLen,
|
||||
u8 *MicBuffer
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
struct ieee80211_hdr_3addr_qos *header;
|
||||
u8 TempBuf[34], TempLen = 32, MicLen, QosOffset, *IV;
|
||||
u16 *pTemp, fc;
|
||||
|
||||
WAPI_TRACE(WAPI_TX|WAPI_RX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
header = (struct ieee80211_hdr_3addr_qos *)pHeader;
|
||||
memset(TempBuf, 0, 34);
|
||||
memcpy(TempBuf, pHeader, 2); //FrameCtrl
|
||||
pTemp = (u16*)TempBuf;
|
||||
*pTemp &= 0xc78f; //bit4,5,6,11,12,13
|
||||
|
||||
memcpy((TempBuf+2), (pHeader+4), 12); //Addr1, Addr2
|
||||
memcpy((TempBuf+14), (pHeader+22), 2); // SeqCtrl
|
||||
pTemp = (u16*)(TempBuf + 14);
|
||||
*pTemp &= 0x000f;
|
||||
|
||||
memcpy((TempBuf+16), (pHeader+16), 6); //Addr3
|
||||
|
||||
fc = le16_to_cpu(header->frame_ctl);
|
||||
|
||||
|
||||
|
||||
if (GetFrDs((u16*)&fc) && GetToDs((u16 *)&fc))
|
||||
{
|
||||
memcpy((TempBuf+22), (pHeader+24), 6);
|
||||
QosOffset = 30;
|
||||
}else{
|
||||
memset((TempBuf+22), 0, 6);
|
||||
QosOffset = 24;
|
||||
}
|
||||
|
||||
if((fc & 0x0088) == 0x0088){
|
||||
memcpy((TempBuf+28), (pHeader+QosOffset), 2);
|
||||
TempLen += 2;
|
||||
//IV = pHeader + QosOffset + 2 + SNAP_SIZE + sizeof(u16) + 2;
|
||||
IV = pHeader + QosOffset + 2 + 2;
|
||||
}else{
|
||||
IV = pHeader + QosOffset + 2;
|
||||
//IV = pHeader + QosOffset + SNAP_SIZE + sizeof(u16) + 2;
|
||||
}
|
||||
|
||||
TempBuf[TempLen-1] = (u8)(DataLen & 0xff);
|
||||
TempBuf[TempLen-2] = (u8)((DataLen & 0xff00)>>8);
|
||||
TempBuf[TempLen-4] = KeyIdx;
|
||||
|
||||
WAPI_DATA(WAPI_TX, "CalculateMic - KEY", MicKey, 16);
|
||||
WAPI_DATA(WAPI_TX, "CalculateMic - IV", IV, 16);
|
||||
WAPI_DATA(WAPI_TX, "CalculateMic - TempBuf", TempBuf, TempLen);
|
||||
WAPI_DATA(WAPI_TX, "CalculateMic - pData", pData, DataLen);
|
||||
|
||||
WapiSMS4CalculateMic(MicKey, IV, TempBuf, TempLen,
|
||||
pData, DataLen, MicBuffer, &MicLen);
|
||||
|
||||
if (MicLen != 16)
|
||||
WAPI_TRACE(WAPI_ERR,"%s: MIC Length Error!!\n",__FUNCTION__);
|
||||
|
||||
WAPI_TRACE(WAPI_TX|WAPI_RX, "<=========%s\n", __FUNCTION__);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* AddCount: 1 or 2.
|
||||
* If overflow, return 1,
|
||||
* else return 0.
|
||||
*/
|
||||
u8 WapiIncreasePN(u8 *PN, u8 AddCount)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
if (NULL == PN)
|
||||
return 1;
|
||||
//YJ,test,091102
|
||||
/*
|
||||
if(AddCount == 2){
|
||||
DBG_8192C("############################%s(): PN[0]=0x%x\n", __FUNCTION__, PN[0]);
|
||||
if(PN[0] == 0x48){
|
||||
PN[0] += AddCount;
|
||||
return 1;
|
||||
}else{
|
||||
PN[0] += AddCount;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
*/
|
||||
//YJ,test,091102,end
|
||||
|
||||
for (i=0; i<16; i++)
|
||||
{
|
||||
if (PN[i] + AddCount <= 0xff)
|
||||
{
|
||||
PN[i] += AddCount;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
PN[i] += AddCount;
|
||||
AddCount = 1;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void WapiGetLastRxUnicastPNForQoSData(
|
||||
u8 UserPriority,
|
||||
PRT_WAPI_STA_INFO pWapiStaInfo,
|
||||
u8 *PNOut
|
||||
)
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX, "===========> %s\n", __FUNCTION__);
|
||||
switch(UserPriority)
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
memcpy(PNOut,pWapiStaInfo->lastRxUnicastPNBEQueue,16);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
memcpy(PNOut,pWapiStaInfo->lastRxUnicastPNBKQueue,16);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
memcpy(PNOut,pWapiStaInfo->lastRxUnicastPNVIQueue,16);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
memcpy(PNOut,pWapiStaInfo->lastRxUnicastPNVOQueue,16);
|
||||
break;
|
||||
default:
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Unknown TID \n", __FUNCTION__);
|
||||
break;
|
||||
}
|
||||
WAPI_TRACE(WAPI_RX, "<=========== %s\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
|
||||
void WapiSetLastRxUnicastPNForQoSData(
|
||||
u8 UserPriority,
|
||||
u8 *PNIn,
|
||||
PRT_WAPI_STA_INFO pWapiStaInfo
|
||||
)
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX, "===========> %s\n", __FUNCTION__);
|
||||
switch(UserPriority)
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
memcpy(pWapiStaInfo->lastRxUnicastPNBEQueue,PNIn,16);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
memcpy(pWapiStaInfo->lastRxUnicastPNBKQueue,PNIn,16);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
memcpy(pWapiStaInfo->lastRxUnicastPNVIQueue,PNIn,16);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
memcpy(pWapiStaInfo->lastRxUnicastPNVOQueue,PNIn,16);
|
||||
break;
|
||||
default:
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Unknown TID \n", __FUNCTION__);
|
||||
break;
|
||||
}
|
||||
WAPI_TRACE(WAPI_RX, "<=========== %s\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
FALSE not RX-Reorder
|
||||
TRUE do RX Reorder
|
||||
add to support WAPI to N-mode
|
||||
*****************************************************************************/
|
||||
u8 WapiCheckPnInSwDecrypt(
|
||||
_adapter *padapter,
|
||||
struct sk_buff *pskb
|
||||
)
|
||||
{
|
||||
u8 ret = false;
|
||||
|
||||
#if 0
|
||||
struct ieee80211_hdr_3addr_qos *header;
|
||||
u16 fc;
|
||||
u8 *pDaddr, *pTaddr, *pRaddr;
|
||||
|
||||
header = (struct ieee80211_hdr_3addr_qos *)pskb->data;
|
||||
pTaddr = header->addr2;
|
||||
pRaddr = header->addr1;
|
||||
fc = le16_to_cpu(header->frame_ctl);
|
||||
|
||||
if(GetToDs(&fc))
|
||||
pDaddr = header->addr3;
|
||||
else
|
||||
pDaddr = header->addr1;
|
||||
|
||||
if ((_rtw_memcmp(pRaddr, padapter->pnetdev->dev_addr, ETH_ALEN) == 0)
|
||||
&& ! (pDaddr)
|
||||
&& (GetFrameType(&fc) == WIFI_QOS_DATA_TYPE))
|
||||
//&& ieee->pHTInfo->bCurrentHTSupport &&
|
||||
//ieee->pHTInfo->bCurRxReorderEnable)
|
||||
ret = false;
|
||||
else
|
||||
ret = true;
|
||||
#endif
|
||||
WAPI_TRACE(WAPI_RX, "%s: return %d\n", __FUNCTION__, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SecSMS4HeaderFillIV(_adapter *padapter, u8 *pxmitframe)
|
||||
{
|
||||
struct pkt_attrib *pattrib = &((struct xmit_frame*)pxmitframe)->attrib;
|
||||
u8 * frame = ((struct xmit_frame *)pxmitframe)->buf_addr + TXDESC_OFFSET;
|
||||
u8 *pSecHeader = NULL, *pos = NULL, *pRA = NULL;
|
||||
u8 bPNOverflow = false, bFindMatchPeer = false, hdr_len = 0;
|
||||
PWLAN_HEADER_WAPI_EXTENSION pWapiExt = NULL;
|
||||
PRT_WAPI_T pWapiInfo = &padapter->wapiInfo;
|
||||
PRT_WAPI_STA_INFO pWapiSta = NULL;
|
||||
int ret = 0;
|
||||
|
||||
WAPI_TRACE(WAPI_TX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
return ret;
|
||||
#if 0
|
||||
hdr_len = sMacHdrLng;
|
||||
if (GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE)
|
||||
{
|
||||
hdr_len += 2;
|
||||
}
|
||||
//hdr_len += SNAP_SIZE + sizeof(u16);
|
||||
|
||||
pos = skb_push(pskb, padapter->wapiInfo.extra_prefix_len);
|
||||
memmove(pos, pos+padapter->wapiInfo.extra_prefix_len, hdr_len);
|
||||
|
||||
pSecHeader = pskb->data + hdr_len;
|
||||
pWapiExt = (PWLAN_HEADER_WAPI_EXTENSION)pSecHeader;
|
||||
pRA = pskb->data + 4;
|
||||
|
||||
WAPI_DATA(WAPI_TX, "FillIV - Before Fill IV", pskb->data, pskb->len);
|
||||
|
||||
//Address 1 is always receiver's address
|
||||
if( IS_MCAST(pRA) ){
|
||||
if(!pWapiInfo->wapiTxMsk.bTxEnable){
|
||||
WAPI_TRACE(WAPI_ERR,"%s: bTxEnable = 0!!\n",__FUNCTION__);
|
||||
return -2;
|
||||
}
|
||||
if(pWapiInfo->wapiTxMsk.keyId <= 1){
|
||||
pWapiExt->KeyIdx = pWapiInfo->wapiTxMsk.keyId;
|
||||
pWapiExt->Reserved = 0;
|
||||
bPNOverflow = WapiIncreasePN(pWapiInfo->lastTxMulticastPN, 1);
|
||||
memcpy(pWapiExt->PN, pWapiInfo->lastTxMulticastPN, 16);
|
||||
if (bPNOverflow){
|
||||
// Update MSK Notification.
|
||||
WAPI_TRACE(WAPI_ERR,"===============>%s():multicast PN overflow\n",__FUNCTION__);
|
||||
rtw_wapi_app_event_handler(padapter,NULL,0,pRA, false, false, true, 0, false);
|
||||
}
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR,"%s: Invalid Wapi Multicast KeyIdx!!\n",__FUNCTION__);
|
||||
ret = -3;
|
||||
}
|
||||
}
|
||||
else{
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if(!memcmp(pWapiSta->PeerMacAddr,pRA,6)){
|
||||
bFindMatchPeer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bFindMatchPeer){
|
||||
if((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable)){
|
||||
WAPI_TRACE(WAPI_ERR,"%s: bTxEnable = 0!!\n",__FUNCTION__);
|
||||
return -4;
|
||||
}
|
||||
if (pWapiSta->wapiUsk.keyId <= 1){
|
||||
if(pWapiSta->wapiUskUpdate.bTxEnable)
|
||||
pWapiExt->KeyIdx = pWapiSta->wapiUskUpdate.keyId;
|
||||
else
|
||||
pWapiExt->KeyIdx = pWapiSta->wapiUsk.keyId;
|
||||
|
||||
pWapiExt->Reserved = 0;
|
||||
bPNOverflow = WapiIncreasePN(pWapiSta->lastTxUnicastPN, 2);
|
||||
memcpy(pWapiExt->PN, pWapiSta->lastTxUnicastPN, 16);
|
||||
if (bPNOverflow){
|
||||
// Update USK Notification.
|
||||
WAPI_TRACE(WAPI_ERR,"===============>%s():unicast PN overflow\n",__FUNCTION__);
|
||||
rtw_wapi_app_event_handler(padapter,NULL,0,pWapiSta->PeerMacAddr, false, true, false, 0, false);
|
||||
}
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR,"%s: Invalid Wapi Unicast KeyIdx!!\n",__FUNCTION__);
|
||||
ret = -5;
|
||||
}
|
||||
}
|
||||
else{
|
||||
WAPI_TRACE(WAPI_ERR,"%s: Can not find Peer Sta "MAC_FMT"!!\n",__FUNCTION__, MAC_ARG(pRA));
|
||||
ret = -6;
|
||||
}
|
||||
}
|
||||
|
||||
WAPI_DATA(WAPI_TX, "FillIV - After Fill IV", pskb->data, pskb->len);
|
||||
WAPI_TRACE(WAPI_TX, "<=========%s\n", __FUNCTION__);
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
// WAPI SW Enc: must have done Coalesce!
|
||||
void SecSWSMS4Encryption(
|
||||
_adapter *padapter,
|
||||
u8 * pxmitframe
|
||||
)
|
||||
{
|
||||
PRT_WAPI_T pWapiInfo = &padapter->wapiInfo;
|
||||
PRT_WAPI_STA_INFO pWapiSta = NULL;
|
||||
u8 *pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + TXDESC_SIZE;
|
||||
struct pkt_attrib *pattrib = &((struct xmit_frame*)pxmitframe)->attrib;
|
||||
|
||||
u8 *SecPtr = NULL, *pRA, *pMicKey = NULL, *pDataKey = NULL, *pIV = NULL;
|
||||
u8 IVOffset, DataOffset, bFindMatchPeer = false, KeyIdx = 0, MicBuffer[16];
|
||||
u16 OutputLength;
|
||||
|
||||
WAPI_TRACE(WAPI_TX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
WAPI_TRACE(WAPI_TX,"hdrlen: %d \n",pattrib->hdrlen);
|
||||
|
||||
return;
|
||||
|
||||
DataOffset = pattrib->hdrlen + pattrib->iv_len;
|
||||
|
||||
pRA = pframe + 4;
|
||||
|
||||
|
||||
if( IS_MCAST(pRA) ){
|
||||
KeyIdx = pWapiInfo->wapiTxMsk.keyId;
|
||||
pIV = pWapiInfo->lastTxMulticastPN;
|
||||
pMicKey = pWapiInfo->wapiTxMsk.micKey;
|
||||
pDataKey = pWapiInfo->wapiTxMsk.dataKey;
|
||||
}else{
|
||||
if (!list_empty(&(pWapiInfo->wapiSTAUsedList))){
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if (0 == memcmp(pWapiSta->PeerMacAddr, pRA, 6)){
|
||||
bFindMatchPeer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bFindMatchPeer){
|
||||
if (pWapiSta->wapiUskUpdate.bTxEnable){
|
||||
KeyIdx = pWapiSta->wapiUskUpdate.keyId;
|
||||
WAPI_TRACE(WAPI_TX, "%s(): Use update USK!! KeyIdx=%d\n", __FUNCTION__, KeyIdx);
|
||||
pIV = pWapiSta->lastTxUnicastPN;
|
||||
pMicKey = pWapiSta->wapiUskUpdate.micKey;
|
||||
pDataKey = pWapiSta->wapiUskUpdate.dataKey;
|
||||
}else{
|
||||
KeyIdx = pWapiSta->wapiUsk.keyId;
|
||||
WAPI_TRACE(WAPI_TX, "%s(): Use USK!! KeyIdx=%d\n", __FUNCTION__, KeyIdx);
|
||||
pIV = pWapiSta->lastTxUnicastPN;
|
||||
pMicKey = pWapiSta->wapiUsk.micKey;
|
||||
pDataKey = pWapiSta->wapiUsk.dataKey;
|
||||
}
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR,"%s: Can not find Peer Sta!!\n",__FUNCTION__);
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR,"%s: wapiSTAUsedList is empty!!\n",__FUNCTION__);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
SecPtr = pframe;
|
||||
SecCalculateMicSMS4(KeyIdx, pMicKey, SecPtr, (SecPtr+DataOffset), pattrib->pktlen, MicBuffer);
|
||||
|
||||
WAPI_DATA(WAPI_TX, "Encryption - MIC", MicBuffer, padapter->wapiInfo.extra_postfix_len);
|
||||
|
||||
memcpy(pframe+pattrib->hdrlen+pattrib->iv_len+pattrib->pktlen-pattrib->icv_len,
|
||||
(u8 *)MicBuffer,
|
||||
padapter->wapiInfo.extra_postfix_len
|
||||
);
|
||||
|
||||
|
||||
WapiSMS4Encryption(pDataKey, pIV, (SecPtr+DataOffset),pattrib->pktlen+pattrib->icv_len, (SecPtr+DataOffset), &OutputLength);
|
||||
|
||||
WAPI_DATA(WAPI_TX, "Encryption - After SMS4 encryption",pframe,pattrib->hdrlen+pattrib->iv_len+pattrib->pktlen);
|
||||
|
||||
WAPI_TRACE(WAPI_TX, "<=========%s\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
u8 SecSWSMS4Decryption(
|
||||
_adapter *padapter,
|
||||
u8 *precv_frame,
|
||||
struct recv_priv *precv_priv
|
||||
)
|
||||
{
|
||||
PRT_WAPI_T pWapiInfo = &padapter->wapiInfo;
|
||||
struct recv_frame_hdr *precv_hdr;
|
||||
PRT_WAPI_STA_INFO pWapiSta = NULL;
|
||||
u8 IVOffset, DataOffset, bFindMatchPeer = false, bUseUpdatedKey = false;
|
||||
u8 KeyIdx, MicBuffer[16], lastRxPNforQoS[16];
|
||||
u8 *pRA, *pTA, *pMicKey, *pDataKey, *pLastRxPN, *pRecvPN, *pSecData, *pRecvMic, *pos;
|
||||
u8 TID = 0;
|
||||
u16 OutputLength, DataLen;
|
||||
u8 bQosData;
|
||||
struct sk_buff * pskb;
|
||||
|
||||
WAPI_TRACE(WAPI_RX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
return 0;
|
||||
|
||||
precv_hdr = &((union recv_frame*)precv_frame)->u.hdr;
|
||||
pskb = (struct sk_buff *)(precv_hdr->rx_data);
|
||||
precv_hdr->bWapiCheckPNInDecrypt = WapiCheckPnInSwDecrypt(padapter, pskb);
|
||||
WAPI_TRACE(WAPI_RX, "=========>%s: check PN %d\n", __FUNCTION__,precv_hdr->bWapiCheckPNInDecrypt);
|
||||
WAPI_DATA(WAPI_RX, "Decryption - Before decryption", pskb->data, pskb->len);
|
||||
|
||||
IVOffset = sMacHdrLng;
|
||||
bQosData = GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE;
|
||||
if (bQosData){
|
||||
IVOffset += 2;
|
||||
}
|
||||
|
||||
//if(GetHTC())
|
||||
// IVOffset += 4;
|
||||
|
||||
//IVOffset += SNAP_SIZE + sizeof(u16);
|
||||
|
||||
DataOffset = IVOffset + padapter->wapiInfo.extra_prefix_len;
|
||||
|
||||
pRA = pskb->data + 4;
|
||||
pTA = pskb->data + 10;
|
||||
KeyIdx = *(pskb->data + IVOffset);
|
||||
pRecvPN = pskb->data + IVOffset + 2;
|
||||
pSecData = pskb->data + DataOffset;
|
||||
DataLen = pskb->len - DataOffset;
|
||||
pRecvMic = pskb->data + pskb->len - padapter->wapiInfo.extra_postfix_len;
|
||||
TID = GetTid(pskb->data);
|
||||
|
||||
if (!list_empty(&(pWapiInfo->wapiSTAUsedList))){
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if (0 == memcmp(pWapiSta->PeerMacAddr, pTA, 6)){
|
||||
bFindMatchPeer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bFindMatchPeer){
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Can not find Peer Sta "MAC_FMT" for Key Info!!!\n", __FUNCTION__, MAC_ARG(pTA));
|
||||
return false;
|
||||
}
|
||||
|
||||
if( IS_MCAST(pRA) ){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Multicast decryption !!!\n", __FUNCTION__);
|
||||
if (pWapiSta->wapiMsk.keyId == KeyIdx && pWapiSta->wapiMsk.bSet){
|
||||
pLastRxPN = pWapiSta->lastRxMulticastPN;
|
||||
if (!WapiComparePN(pRecvPN, pLastRxPN)){
|
||||
WAPI_TRACE(WAPI_ERR, "%s: MSK PN is not larger than last, Dropped!!!\n", __FUNCTION__);
|
||||
WAPI_DATA(WAPI_ERR, "pRecvPN:", pRecvPN, 16);
|
||||
WAPI_DATA(WAPI_ERR, "pLastRxPN:", pLastRxPN, 16);
|
||||
return false;
|
||||
}
|
||||
|
||||
memcpy(pLastRxPN, pRecvPN, 16);
|
||||
pMicKey = pWapiSta->wapiMsk.micKey;
|
||||
pDataKey = pWapiSta->wapiMsk.dataKey;
|
||||
}else if (pWapiSta->wapiMskUpdate.keyId == KeyIdx && pWapiSta->wapiMskUpdate.bSet){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Use Updated MSK for Decryption !!!\n", __FUNCTION__);
|
||||
bUseUpdatedKey = true;
|
||||
memcpy(pWapiSta->lastRxMulticastPN, pRecvPN, 16);
|
||||
pMicKey = pWapiSta->wapiMskUpdate.micKey;
|
||||
pDataKey = pWapiSta->wapiMskUpdate.dataKey;
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Can not find MSK with matched KeyIdx(%d), Dropped !!!\n", __FUNCTION__,KeyIdx);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
WAPI_TRACE(WAPI_RX, "%s: Unicast decryption !!!\n", __FUNCTION__);
|
||||
if (pWapiSta->wapiUsk.keyId == KeyIdx && pWapiSta->wapiUsk.bSet){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Use USK for Decryption!!!\n", __FUNCTION__);
|
||||
if(precv_hdr->bWapiCheckPNInDecrypt){
|
||||
if(GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE){
|
||||
WapiGetLastRxUnicastPNForQoSData(TID, pWapiSta, lastRxPNforQoS);
|
||||
pLastRxPN = lastRxPNforQoS;
|
||||
}else{
|
||||
pLastRxPN = pWapiSta->lastRxUnicastPN;
|
||||
}
|
||||
if (!WapiComparePN(pRecvPN, pLastRxPN)){
|
||||
return false;
|
||||
}
|
||||
if(bQosData){
|
||||
WapiSetLastRxUnicastPNForQoSData(TID, pRecvPN, pWapiSta);
|
||||
}else{
|
||||
memcpy(pWapiSta->lastRxUnicastPN, pRecvPN, 16);
|
||||
}
|
||||
}else{
|
||||
memcpy(precv_hdr->WapiTempPN,pRecvPN,16);
|
||||
}
|
||||
|
||||
if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE))
|
||||
{
|
||||
if ((pRecvPN[0] & 0x1) == 0){
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Rx USK PN is not odd when Infra STA mode, Dropped !!!\n", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
pMicKey = pWapiSta->wapiUsk.micKey;
|
||||
pDataKey = pWapiSta->wapiUsk.dataKey;
|
||||
}
|
||||
else if (pWapiSta->wapiUskUpdate.keyId == KeyIdx && pWapiSta->wapiUskUpdate.bSet ){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Use Updated USK for Decryption!!!\n", __FUNCTION__);
|
||||
if(pWapiSta->bAuthenticatorInUpdata)
|
||||
bUseUpdatedKey = true;
|
||||
else
|
||||
bUseUpdatedKey = false;
|
||||
|
||||
if(bQosData){
|
||||
WapiSetLastRxUnicastPNForQoSData(TID, pRecvPN, pWapiSta);
|
||||
}else{
|
||||
memcpy(pWapiSta->lastRxUnicastPN, pRecvPN, 16);
|
||||
}
|
||||
pMicKey = pWapiSta->wapiUskUpdate.micKey;
|
||||
pDataKey = pWapiSta->wapiUskUpdate.dataKey;
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR, "%s: No valid USK!!!KeyIdx=%d pWapiSta->wapiUsk.keyId=%d pWapiSta->wapiUskUpdate.keyId=%d\n", __FUNCTION__, KeyIdx, pWapiSta->wapiUsk.keyId, pWapiSta->wapiUskUpdate.keyId);
|
||||
//dump_buf(pskb->data,pskb->len);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
WAPI_DATA(WAPI_RX, "Decryption - DataKey", pDataKey, 16);
|
||||
WAPI_DATA(WAPI_RX, "Decryption - IV", pRecvPN, 16);
|
||||
WapiSMS4Decryption(pDataKey, pRecvPN, pSecData, DataLen, pSecData, &OutputLength);
|
||||
|
||||
if (OutputLength != DataLen)
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Output Length Error!!!!\n", __FUNCTION__);
|
||||
|
||||
WAPI_DATA(WAPI_RX, "Decryption - After decryption", pskb->data, pskb->len);
|
||||
|
||||
DataLen -= padapter->wapiInfo.extra_postfix_len;
|
||||
|
||||
SecCalculateMicSMS4(KeyIdx, pMicKey, pskb->data, pSecData, DataLen, MicBuffer);
|
||||
|
||||
WAPI_DATA(WAPI_RX, "Decryption - MIC received", pRecvMic, SMS4_MIC_LEN);
|
||||
WAPI_DATA(WAPI_RX, "Decryption - MIC calculated", MicBuffer, SMS4_MIC_LEN);
|
||||
|
||||
if (0 == memcmp(MicBuffer, pRecvMic, padapter->wapiInfo.extra_postfix_len)){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Check MIC OK!!\n", __FUNCTION__);
|
||||
if (bUseUpdatedKey){
|
||||
// delete the old key
|
||||
if ( IS_MCAST(pRA) ){
|
||||
WAPI_TRACE(WAPI_API, "%s(): AE use new update MSK!!\n", __FUNCTION__);
|
||||
pWapiSta->wapiMsk.keyId = pWapiSta->wapiMskUpdate.keyId;
|
||||
memcpy(pWapiSta->wapiMsk.dataKey, pWapiSta->wapiMskUpdate.dataKey, 16);
|
||||
memcpy(pWapiSta->wapiMsk.micKey, pWapiSta->wapiMskUpdate.micKey, 16);
|
||||
pWapiSta->wapiMskUpdate.bTxEnable = pWapiSta->wapiMskUpdate.bSet = false;
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_API, "%s(): AE use new update USK!!\n", __FUNCTION__);
|
||||
pWapiSta->wapiUsk.keyId = pWapiSta->wapiUskUpdate.keyId;
|
||||
memcpy(pWapiSta->wapiUsk.dataKey, pWapiSta->wapiUskUpdate.dataKey, 16);
|
||||
memcpy(pWapiSta->wapiUsk.micKey, pWapiSta->wapiUskUpdate.micKey, 16);
|
||||
pWapiSta->wapiUskUpdate.bTxEnable = pWapiSta->wapiUskUpdate.bSet = false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Check MIC Error, Dropped !!!!\n", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
pos = pskb->data;
|
||||
memmove(pos+padapter->wapiInfo.extra_prefix_len, pos, IVOffset);
|
||||
skb_pull(pskb, padapter->wapiInfo.extra_prefix_len);
|
||||
|
||||
WAPI_TRACE(WAPI_RX, "<=========%s\n", __FUNCTION__);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
u32 rtw_sms4_encrypt(_adapter *padapter, u8 *pxmitframe)
|
||||
{
|
||||
|
||||
u8 *pframe;
|
||||
u32 res = _SUCCESS;
|
||||
|
||||
WAPI_TRACE(WAPI_TX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
if ((!padapter->WapiSupport) || (!padapter->wapiInfo.bWapiEnable))
|
||||
{
|
||||
WAPI_TRACE(WAPI_TX, "<========== %s, WAPI not supported or enabled!\n", __FUNCTION__);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
|
||||
return _FAIL;
|
||||
|
||||
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + TXDESC_OFFSET;
|
||||
|
||||
SecSWSMS4Encryption(padapter, pxmitframe);
|
||||
|
||||
WAPI_TRACE(WAPI_TX, "<=========%s\n", __FUNCTION__);
|
||||
return res;
|
||||
}
|
||||
|
||||
u32 rtw_sms4_decrypt(_adapter *padapter, u8 *precvframe)
|
||||
{
|
||||
u8 *pframe;
|
||||
u32 res = _SUCCESS;
|
||||
|
||||
WAPI_TRACE(WAPI_RX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
if ((!padapter->WapiSupport) || (!padapter->wapiInfo.bWapiEnable))
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX, "<========== %s, WAPI not supported or enabled!\n", __FUNCTION__);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
//drop packet when hw decrypt fail
|
||||
//return tempraily
|
||||
return _FAIL;
|
||||
|
||||
//pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
|
||||
|
||||
if (false == SecSWSMS4Decryption(padapter, precvframe, &padapter->recvpriv))
|
||||
{
|
||||
WAPI_TRACE(WAPI_ERR, "%s():SMS4 decrypt frame error\n",__FUNCTION__);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
WAPI_TRACE(WAPI_RX, "<=========%s\n", __FUNCTION__);
|
||||
return res;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
u32 rtw_sms4_encrypt(_adapter *padapter, u8 *pxmitframe)
|
||||
{
|
||||
WAPI_TRACE(WAPI_TX, "=========>Dummy %s\n", __FUNCTION__);
|
||||
WAPI_TRACE(WAPI_TX, "<=========Dummy %s\n", __FUNCTION__);
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
u32 rtw_sms4_decrypt(_adapter *padapter, u8 *precvframe)
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX, "=========>Dummy %s\n", __FUNCTION__);
|
||||
WAPI_TRACE(WAPI_RX, "<=========Dummy %s\n", __FUNCTION__);
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,187 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
/*++
|
||||
Copyright (c) Realtek Semiconductor Corp. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
HalPwrSeqCmd.c
|
||||
|
||||
Abstract:
|
||||
Implement HW Power sequence configuration CMD handling routine for Realtek devices.
|
||||
|
||||
Major Change History:
|
||||
When Who What
|
||||
---------- --------------- -------------------------------
|
||||
2011-10-26 Lucas Modify to be compatible with SD4-CE driver.
|
||||
2011-07-07 Roger Create.
|
||||
|
||||
--*/
|
||||
#include <HalPwrSeqCmd.h>
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#include <sdio_ops.h>
|
||||
#elif defined(CONFIG_GSPI_HCI)
|
||||
#include <gspi_ops.h>
|
||||
#endif
|
||||
|
||||
//
|
||||
// Description:
|
||||
// This routine deal with the Power Configuration CMDs parsing for RTL8723/RTL8188E Series IC.
|
||||
//
|
||||
// Assumption:
|
||||
// We should follow specific format which was released from HW SD.
|
||||
//
|
||||
// 2011.07.07, added by Roger.
|
||||
//
|
||||
u8 HalPwrSeqCmdParsing(
|
||||
PADAPTER padapter,
|
||||
u8 CutVersion,
|
||||
u8 FabVersion,
|
||||
u8 InterfaceType,
|
||||
WLAN_PWR_CFG PwrSeqCmd[])
|
||||
{
|
||||
WLAN_PWR_CFG PwrCfgCmd = {0};
|
||||
u8 bPollingBit = _FALSE;
|
||||
u32 AryIdx = 0;
|
||||
u8 value = 0;
|
||||
u32 offset = 0;
|
||||
u32 pollingCount = 0; // polling autoload done.
|
||||
u32 maxPollingCnt = 5000;
|
||||
|
||||
do {
|
||||
PwrCfgCmd = PwrSeqCmd[AryIdx];
|
||||
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_,
|
||||
("HalPwrSeqCmdParsing: offset(%#x) cut_msk(%#x) fab_msk(%#x) interface_msk(%#x) base(%#x) cmd(%#x) msk(%#x) value(%#x)\n",
|
||||
GET_PWR_CFG_OFFSET(PwrCfgCmd),
|
||||
GET_PWR_CFG_CUT_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_FAB_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_INTF_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_BASE(PwrCfgCmd),
|
||||
GET_PWR_CFG_CMD(PwrCfgCmd),
|
||||
GET_PWR_CFG_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_VALUE(PwrCfgCmd)));
|
||||
|
||||
//2 Only Handle the command whose FAB, CUT, and Interface are matched
|
||||
if ((GET_PWR_CFG_FAB_MASK(PwrCfgCmd) & FabVersion) &&
|
||||
(GET_PWR_CFG_CUT_MASK(PwrCfgCmd) & CutVersion) &&
|
||||
(GET_PWR_CFG_INTF_MASK(PwrCfgCmd) & InterfaceType))
|
||||
{
|
||||
switch (GET_PWR_CFG_CMD(PwrCfgCmd))
|
||||
{
|
||||
case PWR_CMD_READ:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_READ\n"));
|
||||
break;
|
||||
|
||||
case PWR_CMD_WRITE:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_WRITE\n"));
|
||||
offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
//
|
||||
// <Roger_Notes> We should deal with interface specific address mapping for some interfaces, e.g., SDIO interface
|
||||
// 2011.07.07.
|
||||
//
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
{
|
||||
// Read Back SDIO Local value
|
||||
value = SdioLocalCmd52Read1Byte(padapter, offset);
|
||||
|
||||
value &= ~(GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
value |= (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
|
||||
// Write Back SDIO Local value
|
||||
SdioLocalCmd52Write1Byte(padapter, offset, value);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef CONFIG_GSPI_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
offset = SPI_LOCAL_OFFSET | offset;
|
||||
#endif
|
||||
// Read the value from system register
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value &= ~(GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
value |= (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
|
||||
// Write the value back to sytem register
|
||||
rtw_write8(padapter, offset, value);
|
||||
}
|
||||
break;
|
||||
|
||||
case PWR_CMD_POLLING:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_POLLING\n"));
|
||||
|
||||
bPollingBit = _FALSE;
|
||||
offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
|
||||
#ifdef CONFIG_GSPI_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
offset = SPI_LOCAL_OFFSET | offset;
|
||||
#endif
|
||||
do {
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
value = SdioLocalCmd52Read1Byte(padapter, offset);
|
||||
else
|
||||
#endif
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value &= GET_PWR_CFG_MASK(PwrCfgCmd);
|
||||
if (value == (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd)))
|
||||
bPollingBit = _TRUE;
|
||||
else
|
||||
rtw_udelay_os(10);
|
||||
|
||||
if (pollingCount++ > maxPollingCnt) {
|
||||
DBG_871X("Fail to polling Offset[%#x]\n", offset);
|
||||
return _FALSE;
|
||||
}
|
||||
} while (!bPollingBit);
|
||||
|
||||
break;
|
||||
|
||||
case PWR_CMD_DELAY:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_DELAY\n"));
|
||||
if (GET_PWR_CFG_VALUE(PwrCfgCmd) == PWRSEQ_DELAY_US)
|
||||
rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd));
|
||||
else
|
||||
rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd)*1000);
|
||||
break;
|
||||
|
||||
case PWR_CMD_END:
|
||||
// When this command is parsed, end the process
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_END\n"));
|
||||
return _TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_err_, ("HalPwrSeqCmdParsing: Unknown CMD!!\n"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
AryIdx++;//Add Array Index
|
||||
}while(1);
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,70 +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 __HAL_PHY_RF_H__
|
||||
#define __HAL_PHY_RF_H__
|
||||
|
||||
#if(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
#define MAX_TOLERANCE 5
|
||||
#define IQK_DELAY_TIME 1 //ms
|
||||
|
||||
//
|
||||
// BB/MAC/RF other monitor API
|
||||
//
|
||||
|
||||
void PHY_SetMonitorMode8192C(IN PADAPTER pAdapter,
|
||||
IN BOOLEAN bEnableMonitorMode );
|
||||
|
||||
//
|
||||
// IQ calibrate
|
||||
//
|
||||
void
|
||||
PHY_IQCalibrate_8192C( IN PADAPTER pAdapter,
|
||||
IN BOOLEAN bReCovery);
|
||||
|
||||
//
|
||||
// LC calibrate
|
||||
//
|
||||
void
|
||||
PHY_LCCalibrate_8192C( IN PADAPTER pAdapter);
|
||||
|
||||
//
|
||||
// AP calibrate
|
||||
//
|
||||
void
|
||||
PHY_APCalibrate_8192C( IN PADAPTER pAdapter,
|
||||
IN s1Byte delta);
|
||||
#endif
|
||||
|
||||
#define ODM_TARGET_CHNL_NUM_2G_5G 59
|
||||
|
||||
|
||||
VOID
|
||||
ODM_ResetIQKResult(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
u1Byte
|
||||
ODM_GetRightChnlPlaceforIQK(
|
||||
IN u1Byte chnl
|
||||
);
|
||||
|
||||
|
||||
#endif // #ifndef __HAL_PHY_RF_H__
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,202 +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 __HALHWOUTSRC_H__
|
||||
#define __HALHWOUTSRC_H__
|
||||
|
||||
//============================================================
|
||||
// Definition
|
||||
//============================================================
|
||||
//
|
||||
//-----------------------------------------------------------
|
||||
// CCK Rates, TxHT = 0
|
||||
#define DESC92C_RATE1M 0x00
|
||||
#define DESC92C_RATE2M 0x01
|
||||
#define DESC92C_RATE5_5M 0x02
|
||||
#define DESC92C_RATE11M 0x03
|
||||
|
||||
// OFDM Rates, TxHT = 0
|
||||
#define DESC92C_RATE6M 0x04
|
||||
#define DESC92C_RATE9M 0x05
|
||||
#define DESC92C_RATE12M 0x06
|
||||
#define DESC92C_RATE18M 0x07
|
||||
#define DESC92C_RATE24M 0x08
|
||||
#define DESC92C_RATE36M 0x09
|
||||
#define DESC92C_RATE48M 0x0a
|
||||
#define DESC92C_RATE54M 0x0b
|
||||
|
||||
// MCS Rates, TxHT = 1
|
||||
#define DESC92C_RATEMCS0 0x0c
|
||||
#define DESC92C_RATEMCS1 0x0d
|
||||
#define DESC92C_RATEMCS2 0x0e
|
||||
#define DESC92C_RATEMCS3 0x0f
|
||||
#define DESC92C_RATEMCS4 0x10
|
||||
#define DESC92C_RATEMCS5 0x11
|
||||
#define DESC92C_RATEMCS6 0x12
|
||||
#define DESC92C_RATEMCS7 0x13
|
||||
#define DESC92C_RATEMCS8 0x14
|
||||
#define DESC92C_RATEMCS9 0x15
|
||||
#define DESC92C_RATEMCS10 0x16
|
||||
#define DESC92C_RATEMCS11 0x17
|
||||
#define DESC92C_RATEMCS12 0x18
|
||||
#define DESC92C_RATEMCS13 0x19
|
||||
#define DESC92C_RATEMCS14 0x1a
|
||||
#define DESC92C_RATEMCS15 0x1b
|
||||
#define DESC92C_RATEMCS15_SG 0x1c
|
||||
#define DESC92C_RATEMCS32 0x20
|
||||
|
||||
|
||||
//============================================================
|
||||
// structure and define
|
||||
//============================================================
|
||||
|
||||
typedef struct _Phy_Rx_AGC_Info
|
||||
{
|
||||
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
|
||||
u1Byte gain:7,trsw:1;
|
||||
#else
|
||||
u1Byte trsw:1,gain:7;
|
||||
#endif
|
||||
} PHY_RX_AGC_INFO_T,*pPHY_RX_AGC_INFO_T;
|
||||
|
||||
typedef struct _Phy_Status_Rpt_8192cd
|
||||
{
|
||||
PHY_RX_AGC_INFO_T path_agc[2];
|
||||
u1Byte ch_corr[2];
|
||||
u1Byte cck_sig_qual_ofdm_pwdb_all;
|
||||
u1Byte cck_agc_rpt_ofdm_cfosho_a;
|
||||
u1Byte cck_rpt_b_ofdm_cfosho_b;
|
||||
u1Byte rsvd_1;//ch_corr_msb;
|
||||
u1Byte noise_power_db_msb;
|
||||
u1Byte path_cfotail[2];
|
||||
u1Byte pcts_mask[2];
|
||||
s1Byte stream_rxevm[2];
|
||||
u1Byte path_rxsnr[2];
|
||||
u1Byte noise_power_db_lsb;
|
||||
u1Byte rsvd_2[3];
|
||||
u1Byte stream_csi[2];
|
||||
u1Byte stream_target_csi[2];
|
||||
s1Byte sig_evm;
|
||||
u1Byte rsvd_3;
|
||||
|
||||
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
|
||||
u1Byte antsel_rx_keep_2:1; //ex_intf_flg:1;
|
||||
u1Byte sgi_en:1;
|
||||
u1Byte rxsc:2;
|
||||
u1Byte idle_long:1;
|
||||
u1Byte r_ant_train_en:1;
|
||||
u1Byte ant_sel_b:1;
|
||||
u1Byte ant_sel:1;
|
||||
#else // _BIG_ENDIAN_
|
||||
u1Byte ant_sel:1;
|
||||
u1Byte ant_sel_b:1;
|
||||
u1Byte r_ant_train_en:1;
|
||||
u1Byte idle_long:1;
|
||||
u1Byte rxsc:2;
|
||||
u1Byte sgi_en:1;
|
||||
u1Byte antsel_rx_keep_2:1; //ex_intf_flg:1;
|
||||
#endif
|
||||
} PHY_STATUS_RPT_8192CD_T,*PPHY_STATUS_RPT_8192CD_T;
|
||||
|
||||
|
||||
typedef struct _Phy_Status_Rpt_8195
|
||||
{
|
||||
PHY_RX_AGC_INFO_T path_agc[2];
|
||||
u1Byte ch_num[2];
|
||||
u1Byte cck_sig_qual_ofdm_pwdb_all;
|
||||
u1Byte cck_agc_rpt_ofdm_cfosho_a;
|
||||
u1Byte cck_bb_pwr_ofdm_cfosho_b;
|
||||
u1Byte cck_rx_path; //CCK_RX_PATH [3:0] (with regA07[3:0] definition)
|
||||
u1Byte rsvd_1;
|
||||
u1Byte path_cfotail[2];
|
||||
u1Byte pcts_mask[2];
|
||||
s1Byte stream_rxevm[2];
|
||||
u1Byte path_rxsnr[2];
|
||||
u1Byte rsvd_2[2];
|
||||
u1Byte stream_snr[2];
|
||||
u1Byte stream_csi[2];
|
||||
u1Byte rsvd_3[2];
|
||||
s1Byte sig_evm;
|
||||
u1Byte rsvd_4;
|
||||
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
|
||||
u1Byte antidx_anta:3;
|
||||
u1Byte antidx_antb:3;
|
||||
u1Byte rsvd_5:2;
|
||||
#else // _BIG_ENDIAN_
|
||||
u1Byte rsvd_5:2;
|
||||
u1Byte antidx_antb:3;
|
||||
u1Byte antidx_anta:3;
|
||||
#endif
|
||||
} PHY_STATUS_RPT_8195_T,*pPHY_STATUS_RPT_8195_T;
|
||||
|
||||
|
||||
VOID
|
||||
odm_Init_RSSIForDM(
|
||||
IN OUT PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_PhyStatusQuery(
|
||||
IN OUT PDM_ODM_T pDM_Odm,
|
||||
OUT PODM_PHY_INFO_T pPhyInfo,
|
||||
IN pu1Byte pPhyStatus,
|
||||
IN PODM_PACKET_INFO_T pPktinfo
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_MacStatusQuery(
|
||||
IN OUT PDM_ODM_T pDM_Odm,
|
||||
IN pu1Byte pMacStatus,
|
||||
IN u1Byte MacID,
|
||||
IN BOOLEAN bPacketMatchBSSID,
|
||||
IN BOOLEAN bPacketToSelf,
|
||||
IN BOOLEAN bPacketBeacon
|
||||
);
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_CE|ODM_AP))
|
||||
HAL_STATUS
|
||||
ODM_ConfigRFWithHeaderFile(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_RF_RADIO_PATH_E Content,
|
||||
IN ODM_RF_RADIO_PATH_E eRFPath
|
||||
);
|
||||
|
||||
HAL_STATUS
|
||||
ODM_ConfigBBWithHeaderFile(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_BB_Config_Type ConfigType
|
||||
);
|
||||
|
||||
HAL_STATUS
|
||||
ODM_ConfigMACWithHeaderFile(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
s4Byte
|
||||
odm_SignalScaleMapping(
|
||||
IN OUT PDM_ODM_T pDM_Odm,
|
||||
IN s4Byte CurrSig
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,55 +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_REGDEFINE11AC_H__
|
||||
#define __ODM_REGDEFINE11AC_H__
|
||||
|
||||
//2 RF REG LIST
|
||||
|
||||
|
||||
|
||||
//2 BB REG LIST
|
||||
//PAGE 8
|
||||
//PAGE 9
|
||||
#define ODM_REG_OFDM_FA_RST_11AC 0x9A4
|
||||
//PAGE A
|
||||
#define ODM_REG_CCK_CCA_11AC 0xA0A
|
||||
#define ODM_REG_CCK_FA_RST_11AC 0xA2C
|
||||
#define ODM_REG_CCK_FA_11AC 0xA5C
|
||||
//PAGE C
|
||||
#define ODM_REG_IGI_A_11AC 0xC50
|
||||
//PAGE E
|
||||
#define ODM_REG_IGI_B_11AC 0xE50
|
||||
//PAGE F
|
||||
#define ODM_REG_OFDM_FA_11AC 0xF48
|
||||
|
||||
|
||||
//2 MAC REG LIST
|
||||
|
||||
|
||||
|
||||
|
||||
//DIG Related
|
||||
#define ODM_BIT_IGI_11AC 0xFFFFFFFF
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,172 +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_REGDEFINE11N_H__
|
||||
#define __ODM_REGDEFINE11N_H__
|
||||
|
||||
|
||||
//2 RF REG LIST
|
||||
#define ODM_REG_RF_MODE_11N 0x00
|
||||
#define ODM_REG_RF_0B_11N 0x0B
|
||||
#define ODM_REG_CHNBW_11N 0x18
|
||||
#define ODM_REG_T_METER_11N 0x24
|
||||
#define ODM_REG_RF_25_11N 0x25
|
||||
#define ODM_REG_RF_26_11N 0x26
|
||||
#define ODM_REG_RF_27_11N 0x27
|
||||
#define ODM_REG_RF_2B_11N 0x2B
|
||||
#define ODM_REG_RF_2C_11N 0x2C
|
||||
#define ODM_REG_RXRF_A3_11N 0x3C
|
||||
#define ODM_REG_T_METER_92D_11N 0x42
|
||||
#define ODM_REG_T_METER_88E_11N 0x42
|
||||
|
||||
|
||||
|
||||
//2 BB REG LIST
|
||||
//PAGE 8
|
||||
#define ODM_REG_BB_CTRL_11N 0x800
|
||||
#define ODM_REG_RF_PIN_11N 0x804
|
||||
#define ODM_REG_PSD_CTRL_11N 0x808
|
||||
#define ODM_REG_TX_ANT_CTRL_11N 0x80C
|
||||
#define ODM_REG_BB_PWR_SAV5_11N 0x818
|
||||
#define ODM_REG_CCK_RPT_FORMAT_11N 0x824
|
||||
#define ODM_REG_RX_DEFUALT_A_11N 0x858
|
||||
#define ODM_REG_RX_DEFUALT_B_11N 0x85A
|
||||
#define ODM_REG_BB_PWR_SAV3_11N 0x85C
|
||||
#define ODM_REG_ANTSEL_CTRL_11N 0x860
|
||||
#define ODM_REG_RX_ANT_CTRL_11N 0x864
|
||||
#define ODM_REG_PIN_CTRL_11N 0x870
|
||||
#define ODM_REG_BB_PWR_SAV1_11N 0x874
|
||||
#define ODM_REG_ANTSEL_PATH_11N 0x878
|
||||
#define ODM_REG_BB_3WIRE_11N 0x88C
|
||||
#define ODM_REG_SC_CNT_11N 0x8C4
|
||||
#define ODM_REG_PSD_DATA_11N 0x8B4
|
||||
//PAGE 9
|
||||
#define ODM_REG_ANT_MAPPING1_11N 0x914
|
||||
#define ODM_REG_ANT_MAPPING2_11N 0x918
|
||||
//PAGE A
|
||||
#define ODM_REG_CCK_ANTDIV_PARA1_11N 0xA00
|
||||
#define ODM_REG_CCK_CCA_11N 0xA0A
|
||||
#define ODM_REG_CCK_ANTDIV_PARA2_11N 0xA0C
|
||||
#define ODM_REG_CCK_ANTDIV_PARA3_11N 0xA10
|
||||
#define ODM_REG_CCK_ANTDIV_PARA4_11N 0xA14
|
||||
#define ODM_REG_CCK_FILTER_PARA1_11N 0xA22
|
||||
#define ODM_REG_CCK_FILTER_PARA2_11N 0xA23
|
||||
#define ODM_REG_CCK_FILTER_PARA3_11N 0xA24
|
||||
#define ODM_REG_CCK_FILTER_PARA4_11N 0xA25
|
||||
#define ODM_REG_CCK_FILTER_PARA5_11N 0xA26
|
||||
#define ODM_REG_CCK_FILTER_PARA6_11N 0xA27
|
||||
#define ODM_REG_CCK_FILTER_PARA7_11N 0xA28
|
||||
#define ODM_REG_CCK_FILTER_PARA8_11N 0xA29
|
||||
#define ODM_REG_CCK_FA_RST_11N 0xA2C
|
||||
#define ODM_REG_CCK_FA_MSB_11N 0xA58
|
||||
#define ODM_REG_CCK_FA_LSB_11N 0xA5C
|
||||
#define ODM_REG_CCK_CCA_CNT_11N 0xA60
|
||||
#define ODM_REG_BB_PWR_SAV4_11N 0xA74
|
||||
//PAGE B
|
||||
#define ODM_REG_LNA_SWITCH_11N 0xB2C
|
||||
#define ODM_REG_PATH_SWITCH_11N 0xB30
|
||||
#define ODM_REG_RSSI_CTRL_11N 0xB38
|
||||
#define ODM_REG_CONFIG_ANTA_11N 0xB68
|
||||
#define ODM_REG_RSSI_BT_11N 0xB9C
|
||||
//PAGE C
|
||||
#define ODM_REG_OFDM_FA_HOLDC_11N 0xC00
|
||||
#define ODM_REG_RX_PATH_11N 0xC04
|
||||
#define ODM_REG_TRMUX_11N 0xC08
|
||||
#define ODM_REG_OFDM_FA_RSTC_11N 0xC0C
|
||||
#define ODM_REG_RXIQI_MATRIX_11N 0xC14
|
||||
#define ODM_REG_TXIQK_MATRIX_LSB1_11N 0xC4C
|
||||
#define ODM_REG_IGI_A_11N 0xC50
|
||||
#define ODM_REG_ANTDIV_PARA2_11N 0xC54
|
||||
#define ODM_REG_IGI_B_11N 0xC58
|
||||
#define ODM_REG_ANTDIV_PARA3_11N 0xC5C
|
||||
#define ODM_REG_BB_PWR_SAV2_11N 0xC70
|
||||
#define ODM_REG_RX_OFF_11N 0xC7C
|
||||
#define ODM_REG_TXIQK_MATRIXA_11N 0xC80
|
||||
#define ODM_REG_TXIQK_MATRIXB_11N 0xC88
|
||||
#define ODM_REG_TXIQK_MATRIXA_LSB2_11N 0xC94
|
||||
#define ODM_REG_TXIQK_MATRIXB_LSB2_11N 0xC9C
|
||||
#define ODM_REG_RXIQK_MATRIX_LSB_11N 0xCA0
|
||||
#define ODM_REG_ANTDIV_PARA1_11N 0xCA4
|
||||
#define ODM_REG_OFDM_FA_TYPE1_11N 0xCF0
|
||||
//PAGE D
|
||||
#define ODM_REG_OFDM_FA_RSTD_11N 0xD00
|
||||
#define ODM_REG_OFDM_FA_TYPE2_11N 0xDA0
|
||||
#define ODM_REG_OFDM_FA_TYPE3_11N 0xDA4
|
||||
#define ODM_REG_OFDM_FA_TYPE4_11N 0xDA8
|
||||
//PAGE E
|
||||
#define ODM_REG_TXAGC_A_6_18_11N 0xE00
|
||||
#define ODM_REG_TXAGC_A_24_54_11N 0xE04
|
||||
#define ODM_REG_TXAGC_A_1_MCS32_11N 0xE08
|
||||
#define ODM_REG_TXAGC_A_MCS0_3_11N 0xE10
|
||||
#define ODM_REG_TXAGC_A_MCS4_7_11N 0xE14
|
||||
#define ODM_REG_TXAGC_A_MCS8_11_11N 0xE18
|
||||
#define ODM_REG_TXAGC_A_MCS12_15_11N 0xE1C
|
||||
#define ODM_REG_FPGA0_IQK_11N 0xE28
|
||||
#define ODM_REG_TXIQK_TONE_A_11N 0xE30
|
||||
#define ODM_REG_RXIQK_TONE_A_11N 0xE34
|
||||
#define ODM_REG_TXIQK_PI_A_11N 0xE38
|
||||
#define ODM_REG_RXIQK_PI_A_11N 0xE3C
|
||||
#define ODM_REG_TXIQK_11N 0xE40
|
||||
#define ODM_REG_RXIQK_11N 0xE44
|
||||
#define ODM_REG_IQK_AGC_PTS_11N 0xE48
|
||||
#define ODM_REG_IQK_AGC_RSP_11N 0xE4C
|
||||
#define ODM_REG_BLUETOOTH_11N 0xE6C
|
||||
#define ODM_REG_RX_WAIT_CCA_11N 0xE70
|
||||
#define ODM_REG_TX_CCK_RFON_11N 0xE74
|
||||
#define ODM_REG_TX_CCK_BBON_11N 0xE78
|
||||
#define ODM_REG_OFDM_RFON_11N 0xE7C
|
||||
#define ODM_REG_OFDM_BBON_11N 0xE80
|
||||
#define ODM_REG_TX2RX_11N 0xE84
|
||||
#define ODM_REG_TX2TX_11N 0xE88
|
||||
#define ODM_REG_RX_CCK_11N 0xE8C
|
||||
#define ODM_REG_RX_OFDM_11N 0xED0
|
||||
#define ODM_REG_RX_WAIT_RIFS_11N 0xED4
|
||||
#define ODM_REG_RX2RX_11N 0xED8
|
||||
#define ODM_REG_STANDBY_11N 0xEDC
|
||||
#define ODM_REG_SLEEP_11N 0xEE0
|
||||
#define ODM_REG_PMPD_ANAEN_11N 0xEEC
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//2 MAC REG LIST
|
||||
#define ODM_REG_BB_RST_11N 0x02
|
||||
#define ODM_REG_ANTSEL_PIN_11N 0x4C
|
||||
#define ODM_REG_EARLY_MODE_11N 0x4D0
|
||||
#define ODM_REG_RSSI_MONITOR_11N 0x4FE
|
||||
#define ODM_REG_EDCA_VO_11N 0x500
|
||||
#define ODM_REG_EDCA_VI_11N 0x504
|
||||
#define ODM_REG_EDCA_BE_11N 0x508
|
||||
#define ODM_REG_EDCA_BK_11N 0x50C
|
||||
#define ODM_REG_TXPAUSE_11N 0x522
|
||||
#define ODM_REG_RESP_TX_11N 0x6D8
|
||||
#define ODM_REG_ANT_TRAIN_PARA1_11N 0x7b0
|
||||
#define ODM_REG_ANT_TRAIN_PARA2_11N 0x7b4
|
||||
|
||||
|
||||
//DIG Related
|
||||
#define ODM_BIT_IGI_11N 0x0000007F
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,627 +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 "odm_precomp.h"
|
||||
|
||||
VOID
|
||||
ODM_InitDebugSetting(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
pDM_Odm->DebugLevel = ODM_DBG_TRACE;
|
||||
|
||||
pDM_Odm->DebugComponents =
|
||||
\
|
||||
#if DBG
|
||||
//BB Functions
|
||||
// ODM_COMP_DIG |
|
||||
// ODM_COMP_RA_MASK |
|
||||
// ODM_COMP_DYNAMIC_TXPWR |
|
||||
// ODM_COMP_FA_CNT |
|
||||
// ODM_COMP_RSSI_MONITOR |
|
||||
// ODM_COMP_CCK_PD |
|
||||
// ODM_COMP_ANT_DIV |
|
||||
// ODM_COMP_PWR_SAVE |
|
||||
// ODM_COMP_PWR_TRAIN |
|
||||
// ODM_COMP_RATE_ADAPTIVE |
|
||||
// ODM_COMP_PATH_DIV |
|
||||
// ODM_COMP_DYNAMIC_PRICCA |
|
||||
// ODM_COMP_RXHP |
|
||||
|
||||
//MAC Functions
|
||||
// ODM_COMP_EDCA_TURBO |
|
||||
// ODM_COMP_EARLY_MODE |
|
||||
//RF Functions
|
||||
// ODM_COMP_TX_PWR_TRACK |
|
||||
// ODM_COMP_RX_GAIN_TRACK |
|
||||
// ODM_COMP_CALIBRATION |
|
||||
//Common
|
||||
// ODM_COMP_COMMON |
|
||||
// ODM_COMP_INIT |
|
||||
#endif
|
||||
0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*------------------Declare variable-----------------------
|
||||
// Define debug flag array for common debug print macro. */
|
||||
u4Byte ODM_DBGP_Type[ODM_DBGP_TYPE_MAX];
|
||||
|
||||
/* Define debug print header for every service module. */
|
||||
ODM_DBGP_HEAD_T ODM_DBGP_Head;
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: DBGP_Flag_Init
|
||||
*
|
||||
* Overview: Refresh all debug print control flag content to zero.
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 10/20/2006 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
extern void ODM_DBGP_Flag_Init(void)
|
||||
{
|
||||
u1Byte i;
|
||||
|
||||
for (i = 0; i < ODM_DBGP_TYPE_MAX; i++)
|
||||
{
|
||||
ODM_DBGP_Type[i] = 0;
|
||||
}
|
||||
|
||||
#ifndef ADSL_AP_BUILD_WORKAROUND
|
||||
#if DBG
|
||||
// 2010/06/02 MH Free build driver can not out any debug message!!!
|
||||
// Init Debug flag enable condition
|
||||
|
||||
ODM_DBGP_Type[FINIT] = \
|
||||
// INIT_EEPROM |
|
||||
// INIT_TxPower |
|
||||
// INIT_IQK |
|
||||
// INIT_RF |
|
||||
0;
|
||||
|
||||
ODM_DBGP_Type[FDM] = \
|
||||
// WA_IOT |
|
||||
// DM_PWDB |
|
||||
// DM_Monitor |
|
||||
// DM_DIG |
|
||||
// DM_EDCA_Turbo |
|
||||
// DM_BT30 |
|
||||
0;
|
||||
|
||||
ODM_DBGP_Type[FIOCTL] = \
|
||||
// IOCTL_IRP |
|
||||
// IOCTL_IRP_DETAIL |
|
||||
// IOCTL_IRP_STATISTICS |
|
||||
// IOCTL_IRP_HANDLE |
|
||||
// IOCTL_BT_HCICMD |
|
||||
// IOCTL_BT_HCICMD_DETAIL |
|
||||
// IOCTL_BT_HCICMD_EXT |
|
||||
// IOCTL_BT_EVENT |
|
||||
// IOCTL_BT_EVENT_DETAIL |
|
||||
// IOCTL_BT_EVENT_PERIODICAL |
|
||||
// IOCTL_BT_TX_ACLDATA |
|
||||
// IOCTL_BT_TX_ACLDATA_DETAIL |
|
||||
// IOCTL_BT_RX_ACLDATA |
|
||||
// IOCTL_BT_RX_ACLDATA_DETAIL |
|
||||
// IOCTL_BT_TP |
|
||||
// IOCTL_STATE |
|
||||
// IOCTL_BT_LOGO |
|
||||
// IOCTL_CALLBACK_FUN |
|
||||
// IOCTL_PARSE_BT_PKT |
|
||||
0;
|
||||
|
||||
ODM_DBGP_Type[FBT] = \
|
||||
// BT_TRACE |
|
||||
0;
|
||||
|
||||
ODM_DBGP_Type[FEEPROM] = \
|
||||
// EEPROM_W |
|
||||
// EFUSE_PG |
|
||||
// EFUSE_READ_ALL |
|
||||
// EFUSE_ANALYSIS |
|
||||
// EFUSE_PG_DETAIL |
|
||||
0;
|
||||
|
||||
ODM_DBGP_Type[FDBG_CTRL] = \
|
||||
// DBG_CTRL_TRACE |
|
||||
// DBG_CTRL_INBAND_NOISE |
|
||||
0;
|
||||
|
||||
// 2011/07/20 MH Add for short cut
|
||||
ODM_DBGP_Type[FSHORT_CUT] = \
|
||||
// SHCUT_TX |
|
||||
// SHCUT_RX |
|
||||
0;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
/* Define debug header of every service module. */
|
||||
//ODM_DBGP_Head.pMANS = "\n\r[MANS] ";
|
||||
//ODM_DBGP_Head.pRTOS = "\n\r[RTOS] ";
|
||||
//ODM_DBGP_Head.pALM = "\n\r[ALM] ";
|
||||
//ODM_DBGP_Head.pPEM = "\n\r[PEM] ";
|
||||
//ODM_DBGP_Head.pCMPK = "\n\r[CMPK] ";
|
||||
//ODM_DBGP_Head.pRAPD = "\n\r[RAPD] ";
|
||||
//ODM_DBGP_Head.pTXPB = "\n\r[TXPB] ";
|
||||
//ODM_DBGP_Head.pQUMG = "\n\r[QUMG] ";
|
||||
|
||||
} /* DBGP_Flag_Init */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
u4Byte GlobalDebugLevel = DBG_LOUD;
|
||||
//
|
||||
// 2009/06/22 MH Allow Fre build to print none debug info at init time.
|
||||
//
|
||||
#if DBG
|
||||
u8Byte GlobalDebugComponents = \
|
||||
// COMP_TRACE |
|
||||
// COMP_DBG |
|
||||
// COMP_INIT |
|
||||
// COMP_OID_QUERY |
|
||||
// COMP_OID_SET |
|
||||
// COMP_RECV |
|
||||
// COMP_SEND |
|
||||
// COMP_IO |
|
||||
// COMP_POWER |
|
||||
// COMP_MLME |
|
||||
// COMP_SCAN |
|
||||
// COMP_SYSTEM |
|
||||
// COMP_SEC |
|
||||
// COMP_AP |
|
||||
// COMP_TURBO |
|
||||
// COMP_QOS |
|
||||
// COMP_AUTHENTICATOR |
|
||||
// COMP_BEACON |
|
||||
// COMP_ANTENNA |
|
||||
// COMP_RATE |
|
||||
// COMP_EVENTS |
|
||||
// COMP_FPGA |
|
||||
// COMP_RM |
|
||||
// COMP_MP |
|
||||
// COMP_RXDESC |
|
||||
// COMP_CKIP |
|
||||
// COMP_DIG |
|
||||
// COMP_TXAGC |
|
||||
// COMP_HIPWR |
|
||||
// COMP_HALDM |
|
||||
// COMP_RSNA |
|
||||
// COMP_INDIC |
|
||||
// COMP_LED |
|
||||
// COMP_RF |
|
||||
// COMP_DUALMACSWITCH |
|
||||
// COMP_EASY_CONCURRENT |
|
||||
|
||||
//1!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//1//1Attention Please!!!<11n or 8190 specific code should be put below this line>
|
||||
//1!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
// COMP_HT |
|
||||
// COMP_POWER_TRACKING |
|
||||
// COMP_RX_REORDER |
|
||||
// COMP_AMSDU |
|
||||
// COMP_WPS |
|
||||
// COMP_RATR |
|
||||
// COMP_RESET |
|
||||
// COMP_CMD |
|
||||
// COMP_EFUSE |
|
||||
// COMP_MESH_INTERWORKING |
|
||||
// COMP_CCX |
|
||||
// COMP_IOCTL |
|
||||
// COMP_GP |
|
||||
// COMP_TXAGG |
|
||||
// COMP_BB_POWERSAVING |
|
||||
// COMP_SWAS |
|
||||
// COMP_P2P |
|
||||
// COMP_MUX |
|
||||
// COMP_FUNC |
|
||||
// COMP_TDLS |
|
||||
// COMP_OMNIPEEK |
|
||||
// COMP_PSD |
|
||||
0;
|
||||
|
||||
|
||||
#else
|
||||
#define FuncEntry
|
||||
#define FuncExit
|
||||
u8Byte GlobalDebugComponents = 0;
|
||||
#endif
|
||||
|
||||
#if (RT_PLATFORM==PLATFORM_LINUX)
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
|
||||
EXPORT_SYMBOL(GlobalDebugComponents);
|
||||
EXPORT_SYMBOL(GlobalDebugLevel);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*------------------Declare variable-----------------------
|
||||
// Define debug flag array for common debug print macro. */
|
||||
u4Byte DBGP_Type[DBGP_TYPE_MAX];
|
||||
|
||||
/* Define debug print header for every service module. */
|
||||
DBGP_HEAD_T DBGP_Head;
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: DBGP_Flag_Init
|
||||
*
|
||||
* Overview: Refresh all debug print control flag content to zero.
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 10/20/2006 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
extern void DBGP_Flag_Init(void)
|
||||
{
|
||||
u1Byte i;
|
||||
|
||||
for (i = 0; i < DBGP_TYPE_MAX; i++)
|
||||
{
|
||||
DBGP_Type[i] = 0;
|
||||
}
|
||||
|
||||
#if DBG
|
||||
// 2010/06/02 MH Free build driver can not out any debug message!!!
|
||||
// Init Debug flag enable condition
|
||||
|
||||
DBGP_Type[FINIT] = \
|
||||
// INIT_EEPROM |
|
||||
// INIT_TxPower |
|
||||
// INIT_IQK |
|
||||
// INIT_RF |
|
||||
0;
|
||||
|
||||
DBGP_Type[FDM] = \
|
||||
// WA_IOT |
|
||||
// DM_PWDB |
|
||||
// DM_Monitor |
|
||||
// DM_DIG |
|
||||
// DM_EDCA_Turbo |
|
||||
// DM_BT30 |
|
||||
0;
|
||||
|
||||
DBGP_Type[FIOCTL] = \
|
||||
// IOCTL_IRP |
|
||||
// IOCTL_IRP_DETAIL |
|
||||
// IOCTL_IRP_STATISTICS |
|
||||
// IOCTL_IRP_HANDLE |
|
||||
// IOCTL_BT_HCICMD |
|
||||
// IOCTL_BT_HCICMD_DETAIL |
|
||||
// IOCTL_BT_HCICMD_EXT |
|
||||
// IOCTL_BT_EVENT |
|
||||
// IOCTL_BT_EVENT_DETAIL |
|
||||
// IOCTL_BT_EVENT_PERIODICAL |
|
||||
// IOCTL_BT_TX_ACLDATA |
|
||||
// IOCTL_BT_TX_ACLDATA_DETAIL |
|
||||
// IOCTL_BT_RX_ACLDATA |
|
||||
// IOCTL_BT_RX_ACLDATA_DETAIL |
|
||||
// IOCTL_BT_TP |
|
||||
// IOCTL_STATE |
|
||||
// IOCTL_BT_LOGO |
|
||||
// IOCTL_CALLBACK_FUN |
|
||||
// IOCTL_PARSE_BT_PKT |
|
||||
0;
|
||||
|
||||
DBGP_Type[FBT] = \
|
||||
// BT_TRACE |
|
||||
0;
|
||||
|
||||
DBGP_Type[FEEPROM] = \
|
||||
// EEPROM_W |
|
||||
// EFUSE_PG |
|
||||
// EFUSE_READ_ALL |
|
||||
// EFUSE_ANALYSIS |
|
||||
// EFUSE_PG_DETAIL |
|
||||
0;
|
||||
|
||||
DBGP_Type[FDBG_CTRL] = \
|
||||
// DBG_CTRL_TRACE |
|
||||
// DBG_CTRL_INBAND_NOISE |
|
||||
0;
|
||||
|
||||
// 2011/07/20 MH Add for short cut
|
||||
DBGP_Type[FSHORT_CUT] = \
|
||||
// SHCUT_TX |
|
||||
// SHCUT_RX |
|
||||
0;
|
||||
|
||||
#endif
|
||||
/* Define debug header of every service module. */
|
||||
DBGP_Head.pMANS = "\n\r[MANS] ";
|
||||
DBGP_Head.pRTOS = "\n\r[RTOS] ";
|
||||
DBGP_Head.pALM = "\n\r[ALM] ";
|
||||
DBGP_Head.pPEM = "\n\r[PEM] ";
|
||||
DBGP_Head.pCMPK = "\n\r[CMPK] ";
|
||||
DBGP_Head.pRAPD = "\n\r[RAPD] ";
|
||||
DBGP_Head.pTXPB = "\n\r[TXPB] ";
|
||||
DBGP_Head.pQUMG = "\n\r[QUMG] ";
|
||||
|
||||
} /* DBGP_Flag_Init */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: DBG_PrintAllFlag
|
||||
*
|
||||
* Overview: Print All debug flag
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 12/10/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
extern void DBG_PrintAllFlag(void)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 0 FQoS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 1 FTX\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 2 FRX\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 3 FSEC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 4 FMGNT\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 5 FMLME\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 6 FRESOURCE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 7 FBEACON\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 8 FISR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 9 FPHY\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 11 FMP\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 12 FPWR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 13 FDM\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 14 FDBG_CTRL\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 15 FC2H\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 16 FBT\n"));
|
||||
} // DBG_PrintAllFlag
|
||||
|
||||
|
||||
extern void DBG_PrintAllComp(void)
|
||||
{
|
||||
u1Byte i;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("GlobalDebugComponents Definition\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT0 COMP_TRACE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT1 COMP_DBG\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT2 COMP_INIT\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT3 COMP_OID_QUERY\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT4 COMP_OID_SET\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT5 COMP_RECV\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT6 COMP_SEND\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT7 COMP_IO\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT8 COMP_POWER\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT9 COMP_MLME\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT10 COMP_SCAN\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT11 COMP_SYSTEM\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT12 COMP_SEC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT13 COMP_AP\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT14 COMP_TURBO\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT15 COMP_QOS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT16 COMP_AUTHENTICATOR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT17 COMP_BEACON\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT18 COMP_BEACON\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT19 COMP_RATE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT20 COMP_EVENTS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT21 COMP_FPGA\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT22 COMP_RM\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT23 COMP_MP\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT24 COMP_RXDESC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT25 COMP_CKIP\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT26 COMP_DIG\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT27 COMP_TXAGC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT28 COMP_HIPWR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT29 COMP_HALDM\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT30 COMP_RSNA\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT31 COMP_INDIC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT32 COMP_LED\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT33 COMP_RF\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT34 COMP_HT\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT35 COMP_POWER_TRACKING\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT36 COMP_POWER_TRACKING\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT37 COMP_AMSDU\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT38 COMP_WPS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT39 COMP_RATR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT40 COMP_RESET\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT41 COMP_CMD\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT42 COMP_EFUSE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT43 COMP_MESH_INTERWORKING\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT43 COMP_CCX\n"));
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("GlobalDebugComponents = %"i64fmt"x\n", GlobalDebugComponents));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("Enable DBG COMP ="));
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
if (GlobalDebugComponents & ((u8Byte)0x1 << i) )
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT%02d |\n", i));
|
||||
}
|
||||
}
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("\n"));
|
||||
|
||||
} // DBG_PrintAllComp
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: DBG_PrintFlagEvent
|
||||
*
|
||||
* Overview: Print dedicated debug flag event
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 12/10/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
extern void DBG_PrintFlagEvent(u1Byte DbgFlag)
|
||||
{
|
||||
switch(DbgFlag)
|
||||
{
|
||||
case FQoS:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 QoS_INIT\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 QoS_VISTA\n"));
|
||||
break;
|
||||
|
||||
case FTX:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 TX_DESC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 TX_DESC_TID\n"));
|
||||
break;
|
||||
|
||||
case FRX:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 RX_DATA\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 RX_PHY_STS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 RX_PHY_SS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 RX_PHY_SQ\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 4 RX_PHY_ASTS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 5 RX_ERR_LEN\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 6 RX_DEFRAG\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 7 RX_ERR_RATE\n"));
|
||||
break;
|
||||
|
||||
case FSEC:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("NA\n"));
|
||||
break;
|
||||
|
||||
case FMGNT:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("NA\n"));
|
||||
break;
|
||||
|
||||
case FMLME:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 MEDIA_STS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 LINK_STS\n"));
|
||||
break;
|
||||
|
||||
case FRESOURCE:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 OS_CHK\n"));
|
||||
break;
|
||||
|
||||
case FBEACON:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 BCN_SHOW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 BCN_PEER\n"));
|
||||
break;
|
||||
|
||||
case FISR:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 ISR_CHK\n"));
|
||||
break;
|
||||
|
||||
case FPHY:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 PHY_BBR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 PHY_BBW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 PHY_RFR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 PHY_RFW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 4 PHY_MACR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 5 PHY_MACW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 6 PHY_ALLR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 7 PHY_ALLW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 8 PHY_TXPWR\n"));
|
||||
break;
|
||||
|
||||
case FMP:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 MP_RX\n"));
|
||||
break;
|
||||
|
||||
case FEEPROM:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 EEPROM_W\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 EFUSE_PG\n"));
|
||||
break;
|
||||
|
||||
case FPWR:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 LPS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 IPS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 PWRSW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 PWRHW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 4 PWRHAL\n"));
|
||||
break;
|
||||
|
||||
case FDM:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 WA_IOT\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 DM_PWDB\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 DM_Monitor\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 DM_DIG\n"));
|
||||
break;
|
||||
|
||||
case FDBG_CTRL:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 DBG_CTRL_TRACE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 DBG_CTRL_INBAND_NOISE\n"));
|
||||
break;
|
||||
|
||||
case FC2H:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 C2H_Summary\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 C2H_PacketData\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 C2H_ContentData\n"));
|
||||
break;
|
||||
|
||||
case FBT:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 BT_TRACE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 BT_RFPoll\n"));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
} // DBG_PrintFlagEvent
|
||||
|
||||
|
||||
extern void DBG_DumpMem(const u1Byte DbgComp,
|
||||
const u1Byte DbgLevel,
|
||||
pu1Byte pMem,
|
||||
u2Byte Len)
|
||||
{
|
||||
u2Byte i;
|
||||
|
||||
for (i=0;i<((Len>>3) + 1);i++)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,DbgComp, DbgLevel, ("%02X %02X %02X %02X %02X %02X %02X %02X\n",
|
||||
*(pMem+(i*8)), *(pMem+(i*8+1)), *(pMem+(i*8+2)), *(pMem+(i*8+3)),
|
||||
*(pMem+(i*8+4)), *(pMem+(i*8+5)), *(pMem+(i*8+6)), *(pMem+(i*8+7))));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,905 +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_DBG_H__
|
||||
#define __ODM_DBG_H__
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Define the debug levels
|
||||
//
|
||||
// 1. DBG_TRACE and DBG_LOUD are used for normal cases.
|
||||
// So that, they can help SW engineer to develope or trace states changed
|
||||
// and also help HW enginner to trace every operation to and from HW,
|
||||
// e.g IO, Tx, Rx.
|
||||
//
|
||||
// 2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases,
|
||||
// which help us to debug SW or HW.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Never used in a call to ODM_RT_TRACE()!
|
||||
//
|
||||
#define ODM_DBG_OFF 1
|
||||
|
||||
//
|
||||
// Fatal bug.
|
||||
// For example, Tx/Rx/IO locked up, OS hangs, memory access violation,
|
||||
// resource allocation failed, unexpected HW behavior, HW BUG and so on.
|
||||
//
|
||||
#define ODM_DBG_SERIOUS 2
|
||||
|
||||
//
|
||||
// Abnormal, rare, or unexpeted cases.
|
||||
// For example, IRP/Packet/OID canceled, device suprisely unremoved and so on.
|
||||
//
|
||||
#define ODM_DBG_WARNING 3
|
||||
|
||||
//
|
||||
// Normal case with useful information about current SW or HW state.
|
||||
// For example, Tx/Rx descriptor to fill, Tx/Rx descriptor completed status,
|
||||
// SW protocol state change, dynamic mechanism state change and so on.
|
||||
//
|
||||
#define ODM_DBG_LOUD 4
|
||||
|
||||
//
|
||||
// Normal case with detail execution flow or information.
|
||||
//
|
||||
#define ODM_DBG_TRACE 5
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Define the tracing components
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
//BB Functions
|
||||
#define ODM_COMP_DIG BIT0
|
||||
#define ODM_COMP_RA_MASK BIT1
|
||||
#define ODM_COMP_DYNAMIC_TXPWR BIT2
|
||||
#define ODM_COMP_FA_CNT BIT3
|
||||
#define ODM_COMP_RSSI_MONITOR BIT4
|
||||
#define ODM_COMP_CCK_PD BIT5
|
||||
#define ODM_COMP_ANT_DIV BIT6
|
||||
#define ODM_COMP_PWR_SAVE BIT7
|
||||
#define ODM_COMP_PWR_TRAIN BIT8
|
||||
#define ODM_COMP_RATE_ADAPTIVE BIT9
|
||||
#define ODM_COMP_PATH_DIV BIT10
|
||||
#define ODM_COMP_PSD BIT11
|
||||
#define ODM_COMP_DYNAMIC_PRICCA BIT12
|
||||
#define ODM_COMP_RXHP BIT13
|
||||
//MAC Functions
|
||||
#define ODM_COMP_EDCA_TURBO BIT16
|
||||
#define ODM_COMP_EARLY_MODE BIT17
|
||||
//RF Functions
|
||||
#define ODM_COMP_TX_PWR_TRACK BIT24
|
||||
#define ODM_COMP_RX_GAIN_TRACK BIT25
|
||||
#define ODM_COMP_CALIBRATION BIT26
|
||||
//Common Functions
|
||||
#define ODM_COMP_COMMON BIT30
|
||||
#define ODM_COMP_INIT BIT31
|
||||
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
|
||||
#define RT_PRINTK DbgPrint
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
#define DbgPrint printk
|
||||
#define RT_PRINTK(fmt, args...) DbgPrint( "%s(): " fmt, __FUNCTION__, ## args);
|
||||
#else
|
||||
#define DbgPrint panic_printk
|
||||
#define RT_PRINTK(fmt, args...) DbgPrint( "%s(): " fmt, __FUNCTION__, ## args);
|
||||
#endif
|
||||
|
||||
#ifndef ASSERT
|
||||
#define ASSERT(expr)
|
||||
#endif
|
||||
|
||||
#if DBG
|
||||
#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) \
|
||||
if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
|
||||
{ \
|
||||
if(pDM_Odm->SupportICType == ODM_RTL8192C) \
|
||||
DbgPrint("[ODM-92C] "); \
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8192D) \
|
||||
DbgPrint("[ODM-92D] "); \
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8723A) \
|
||||
DbgPrint("[ODM-8723A] "); \
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8188E) \
|
||||
DbgPrint("[ODM-8188E] "); \
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8812) \
|
||||
DbgPrint("[ODM-8812] "); \
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8821) \
|
||||
DbgPrint("[ODM-8821] "); \
|
||||
RT_PRINTK fmt; \
|
||||
}
|
||||
|
||||
#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) \
|
||||
if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
|
||||
{ \
|
||||
RT_PRINTK fmt; \
|
||||
}
|
||||
|
||||
#define ODM_RT_ASSERT(pDM_Odm, expr, fmt) \
|
||||
if(!(expr)) { \
|
||||
DbgPrint( "Assertion failed! %s at ......\n", #expr); \
|
||||
DbgPrint( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \
|
||||
RT_PRINTK fmt; \
|
||||
ASSERT(FALSE); \
|
||||
}
|
||||
#define ODM_dbg_enter() { DbgPrint("==> %s\n", __FUNCTION__); }
|
||||
#define ODM_dbg_exit() { DbgPrint("<== %s\n", __FUNCTION__); }
|
||||
#define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __FUNCTION__, str); }
|
||||
|
||||
#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) \
|
||||
if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
pu1Byte __ptr = (pu1Byte)ptr; \
|
||||
DbgPrint("[ODM] "); \
|
||||
DbgPrint(title_str); \
|
||||
DbgPrint(" "); \
|
||||
for( __i=0; __i<6; __i++ ) \
|
||||
DbgPrint("%02X%s", __ptr[__i], (__i==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
#else
|
||||
#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)
|
||||
#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)
|
||||
#define ODM_RT_ASSERT(pDM_Odm, expr, fmt)
|
||||
#define ODM_dbg_enter()
|
||||
#define ODM_dbg_exit()
|
||||
#define ODM_dbg_trace(str)
|
||||
#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)
|
||||
#endif
|
||||
|
||||
|
||||
VOID
|
||||
ODM_InitDebugSetting(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
#if DBG
|
||||
#define DbgPrint printk
|
||||
|
||||
#define PRINT_DATA(_TitleString, _HexData, _HexDataLen) \
|
||||
{ \
|
||||
char *szTitle = _TitleString; \
|
||||
pu1Byte pbtHexData = _HexData; \
|
||||
u4Byte u4bHexDataLen = _HexDataLen; \
|
||||
u4Byte __i; \
|
||||
DbgPrint("%s", szTitle); \
|
||||
for (__i=0;__i<u4bHexDataLen;__i++) \
|
||||
{ \
|
||||
if ((__i & 15) == 0) \
|
||||
{ \
|
||||
DbgPrint("\n"); \
|
||||
} \
|
||||
DbgPrint("%02X%s", pbtHexData[__i], ( ((__i&3)==3) ? " " : " ") ); \
|
||||
} \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
|
||||
// RT_PRINT_XXX macros: implemented for debugging purpose.
|
||||
// Added by Annie, 2005-11-21.
|
||||
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \
|
||||
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_HexData; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
for( __i=0; __i<(int)_HexDataLen; __i++ ) \
|
||||
{ \
|
||||
DbgPrint("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" "); \
|
||||
if (((__i + 1) % 16) == 0) DbgPrint("\n"); \
|
||||
} \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
|
||||
#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr) \
|
||||
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_Ptr; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint(" "); \
|
||||
for( __i=0; __i<6; __i++ ) \
|
||||
DbgPrint("%02X%s", ptr[__i], (__i==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
|
||||
#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum) \
|
||||
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i, __j; \
|
||||
pu1Byte ptr = (pu1Byte)_Ptr; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint("\n"); \
|
||||
for( __i=0; __i<(int)_AddNum; __i++ ) \
|
||||
{ \
|
||||
for( __j=0; __j<6; __j++ ) \
|
||||
DbgPrint("%02X%s", ptr[__i*6+__j], (__j==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
} \
|
||||
}
|
||||
|
||||
// Added by Annie, 2005-11-22.
|
||||
#define MAX_STR_LEN 64
|
||||
#define PRINTABLE(_ch) (_ch>=' ' &&_ch<='~' ) // I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.
|
||||
|
||||
#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len) \
|
||||
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
u1Byte buffer[MAX_STR_LEN]; \
|
||||
int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \
|
||||
PlatformZeroMemory( buffer, MAX_STR_LEN ); \
|
||||
PlatformMoveMemory( buffer, (pu1Byte)_Ptr, length ); \
|
||||
for( __i=0; __i<MAX_STR_LEN; __i++ ) \
|
||||
{ \
|
||||
if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \
|
||||
} \
|
||||
buffer[length] = '\0'; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint(": %d, <%s>\n", _Len, buffer); \
|
||||
}
|
||||
|
||||
#else // of #if DBG
|
||||
#define DbgPrint(...)
|
||||
#define PRINT_DATA(_TitleString, _HexData, _HexDataLen)
|
||||
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen)
|
||||
#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr)
|
||||
#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum)
|
||||
#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len)
|
||||
#endif // of #if DBG
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
/* Define debug print header for every service module.*/
|
||||
typedef struct tag_ODM_DBGP_Service_Module_Header_Name_Structure
|
||||
{
|
||||
const char *pMANS;
|
||||
const char *pRTOS;
|
||||
const char *pALM;
|
||||
const char *pPEM;
|
||||
const char *pCMPK;
|
||||
const char *pRAPD;
|
||||
const char *pTXPB;
|
||||
const char *pQUMG;
|
||||
}ODM_DBGP_HEAD_T;
|
||||
|
||||
|
||||
/* Define different debug flag for dedicated service modules in debug flag array. */
|
||||
// Each module has independt 32 bit debug flag you cnn define the flag as yout require.
|
||||
typedef enum tag_ODM_DBGP_Flag_Type_Definition
|
||||
{
|
||||
ODM_FTX = 0,
|
||||
ODM_FRX ,
|
||||
ODM_FPHY ,
|
||||
ODM_FPWR ,
|
||||
ODM_FDM ,
|
||||
ODM_FC2H ,
|
||||
ODM_FBT ,
|
||||
ODM_DBGP_TYPE_MAX
|
||||
}ODM_DBGP_FLAG_E;
|
||||
|
||||
|
||||
// Define TX relative debug bit --> FTX
|
||||
#define ODM_TX_DESC BIT0
|
||||
#define ODM_TX_DESC_TID BIT1
|
||||
#define ODM_TX_PATH BIT2
|
||||
|
||||
// Define RX relative debug bit --> FRX
|
||||
#define ODM_RX_DATA BIT0
|
||||
#define ODM_RX_PHY_STS BIT1
|
||||
#define ODM_RX_PHY_SS BIT2
|
||||
#define ODM_RX_PHY_SQ BIT3
|
||||
#define ODM_RX_PHY_ASTS BIT4
|
||||
#define ODM_RX_ERR_LEN BIT5
|
||||
#define ODM_RX_DEFRAG BIT6
|
||||
#define ODM_RX_ERR_RATE BIT7
|
||||
#define ODM_RX_PATH BIT8
|
||||
#define ODM_RX_BEACON BIT9
|
||||
|
||||
// Define PHY-BB/RF/MAC check module bit --> FPHY
|
||||
#define ODM_PHY_BBR BIT0
|
||||
#define ODM_PHY_BBW BIT1
|
||||
#define ODM_PHY_RFR BIT2
|
||||
#define ODM_PHY_RFW BIT3
|
||||
#define ODM_PHY_MACR BIT4
|
||||
#define ODM_PHY_MACW BIT5
|
||||
#define ODM_PHY_ALLR BIT6
|
||||
#define ODM_PHY_ALLW BIT7
|
||||
#define ODM_PHY_TXPWR BIT8
|
||||
#define ODM_PHY_PWRDIFF BIT9
|
||||
#define ODM_PHY_SICR BIT10
|
||||
#define ODM_PHY_SICW BIT11
|
||||
|
||||
|
||||
|
||||
|
||||
extern u4Byte ODM_GlobalDebugLevel;
|
||||
|
||||
|
||||
#if DBG
|
||||
extern u8Byte ODM_GlobalDebugComponents;
|
||||
#endif
|
||||
#endif
|
||||
#if 0
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Define the debug levels
|
||||
//
|
||||
// 1. DBG_TRACE and DBG_LOUD are used for normal cases.
|
||||
// So that, they can help SW engineer to develope or trace states changed
|
||||
// and also help HW enginner to trace every operation to and from HW,
|
||||
// e.g IO, Tx, Rx.
|
||||
//
|
||||
// 2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases,
|
||||
// which help us to debug SW or HW.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Never used in a call to ODM_RT_TRACE(pDM_Odm,)!
|
||||
//
|
||||
#define DBG_OFF 0
|
||||
|
||||
//
|
||||
// Deprecated! Don't use it!
|
||||
// TODO: fix related debug message!
|
||||
//
|
||||
//#define DBG_SEC 1
|
||||
|
||||
//
|
||||
// Fatal bug.
|
||||
// For example, Tx/Rx/IO locked up, OS hangs, memory access violation,
|
||||
// resource allocation failed, unexpected HW behavior, HW BUG and so on.
|
||||
//
|
||||
#define DBG_SERIOUS 2
|
||||
|
||||
//
|
||||
// Abnormal, rare, or unexpeted cases.
|
||||
// For example, IRP/Packet/OID canceled, device suprisely unremoved and so on.
|
||||
//
|
||||
#define DBG_WARNING 3
|
||||
|
||||
//
|
||||
// Normal case with useful information about current SW or HW state.
|
||||
// For example, Tx/Rx descriptor to fill, Tx/Rx descriptor completed status,
|
||||
// SW protocol state change, dynamic mechanism state change and so on.
|
||||
//
|
||||
#define DBG_LOUD 4
|
||||
|
||||
//
|
||||
// Normal case with detail execution flow or information.
|
||||
//
|
||||
#define DBG_TRACE 5
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Define the tracing components
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
#define COMP_TRACE BIT0 // For function call tracing.
|
||||
#define COMP_DBG BIT1 // Only for temporary debug message.
|
||||
#define COMP_INIT BIT2 // during driver initialization / halt / reset.
|
||||
#define COMP_OID_QUERY BIT3 // Query OID.
|
||||
#define COMP_OID_SET BIT4 // Set OID.
|
||||
#define COMP_RECV BIT5 // Reveive part data path.
|
||||
#define COMP_SEND BIT6 // Send part path.
|
||||
#define COMP_IO BIT7 // I/O Related. Added by Annie, 2006-03-02.
|
||||
#define COMP_POWER BIT8 // 802.11 Power Save mode or System/Device Power state related.
|
||||
#define COMP_MLME BIT9 // 802.11 link related: join/start BSS, leave BSS.
|
||||
#define COMP_SCAN BIT10 // For site survey.
|
||||
#define COMP_SYSTEM BIT11 // For general platform function.
|
||||
#define COMP_SEC BIT12 // For Security.
|
||||
#define COMP_AP BIT13 // For AP mode related.
|
||||
#define COMP_TURBO BIT14 // For Turbo Mode related. By Annie, 2005-10-21.
|
||||
#define COMP_QOS BIT15 // For QoS.
|
||||
#define COMP_AUTHENTICATOR BIT16 // For AP mode Authenticator. Added by Annie, 2006-01-30.
|
||||
#define COMP_BEACON BIT17 // For Beacon related, by rcnjko.
|
||||
#define COMP_ANTENNA BIT18 // For Antenna diversity related, by rcnjko.
|
||||
#define COMP_RATE BIT19 // For Rate Adaptive mechanism, 2006.07.02, by rcnjko. #define COMP_EVENTS 0x00000080 // Event handling
|
||||
#define COMP_EVENTS BIT20 // Event handling
|
||||
#define COMP_FPGA BIT21 // For FPGA verfication
|
||||
#define COMP_RM BIT22 // For Radio Measurement.
|
||||
#define COMP_MP BIT23 // For mass production test, by shien chang, 2006.07.13
|
||||
#define COMP_RXDESC BIT24 // Show Rx desc information for SD3 debug. Added by Annie, 2006-07-15.
|
||||
#define COMP_CKIP BIT25 // For CCX 1 S13: CKIP. Added by Annie, 2006-08-14.
|
||||
#define COMP_DIG BIT26 // For DIG, 2006.09.25, by rcnjko.
|
||||
#define COMP_TXAGC BIT27 // For Tx power, 060928, by rcnjko.
|
||||
#define COMP_HIPWR BIT28 // For High Power Mechanism, 060928, by rcnjko.
|
||||
#define COMP_HALDM BIT29 // For HW Dynamic Mechanism, 061010, by rcnjko.
|
||||
#define COMP_RSNA BIT30 // For RSNA IBSS , 061201, by CCW.
|
||||
#define COMP_INDIC BIT31 // For link indication
|
||||
#define COMP_LED BIT32 // For LED.
|
||||
#define COMP_RF BIT33 // For RF.
|
||||
//1!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//1//1Attention Please!!!<11n or 8190 specific code should be put below this line>
|
||||
//1!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
#define COMP_HT BIT34 // For 802.11n HT related information. by Emily 2006-8-11
|
||||
#define COMP_POWER_TRACKING BIT35 //FOR 8190 TX POWER TRACKING
|
||||
#define COMP_RX_REORDER BIT36 // 8190 Rx Reorder
|
||||
#define COMP_AMSDU BIT37 // For A-MSDU Debugging
|
||||
#define COMP_WPS BIT38 //WPS Debug Message
|
||||
#define COMP_RATR BIT39
|
||||
#define COMP_RESET BIT40
|
||||
// For debug command to print on dbgview!!
|
||||
#define COMP_CMD BIT41
|
||||
#define COMP_EFUSE BIT42
|
||||
#define COMP_MESH_INTERWORKING BIT43
|
||||
#define COMP_CCX BIT44 //CCX Debug Flag
|
||||
#define COMP_IOCTL BIT45 // IO Control
|
||||
#define COMP_GP BIT46 // For generic parser.
|
||||
#define COMP_TXAGG BIT47
|
||||
#define COMP_HVL BIT48 // For Ndis 6.2 Context Swirch and Hardware Virtualiztion Layer
|
||||
#define COMP_TEST BIT49
|
||||
#define COMP_BB_POWERSAVING BIT50
|
||||
#define COMP_SWAS BIT51 // For SW Antenna Switch
|
||||
#define COMP_P2P BIT52
|
||||
#define COMP_MUX BIT53
|
||||
#define COMP_FUNC BIT54
|
||||
#define COMP_TDLS BIT55
|
||||
#define COMP_OMNIPEEK BIT56
|
||||
#define COMP_DUALMACSWITCH BIT60 // 2010/12/27 Add for Dual mac mode debug
|
||||
#define COMP_EASY_CONCURRENT BIT61 // 2010/12/27 Add for easy cncurrent mode debug
|
||||
#define COMP_PSD BIT63 //2011/3/9 Add for WLAN PSD for BT AFH
|
||||
|
||||
#define COMP_DFS BIT62
|
||||
|
||||
#define COMP_ALL UINT64_C(0xFFFFFFFFFFFFFFFF) // All components
|
||||
// For debug print flag to use
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
/* 2007/07/13 MH *//*------For DeBuG Print modeue------*/
|
||||
|
||||
/* Defnie structure to store different debug flag variable. Every debug flag
|
||||
is a UINT32 integer and you can assign 32 different events. */
|
||||
typedef struct tag_DBGP_Debug_Flag_Structure
|
||||
{
|
||||
u4Byte Mans; /* Main Scheduler module. */
|
||||
u4Byte Rtos; /* RTOS module. */
|
||||
u4Byte Alarm; /* Alarm module. */
|
||||
u4Byte Pm; /* Performance monitor module. */
|
||||
}DBGP_FLAG_T;
|
||||
|
||||
/* Define debug print header for every service module.*/
|
||||
typedef struct tag_DBGP_Service_Module_Header_Name_Structure
|
||||
{
|
||||
const char *pMANS;
|
||||
const char *pRTOS;
|
||||
const char *pALM;
|
||||
const char *pPEM;
|
||||
const char *pCMPK;
|
||||
const char *pRAPD;
|
||||
const char *pTXPB;
|
||||
const char *pQUMG;
|
||||
}DBGP_HEAD_T;
|
||||
|
||||
|
||||
/* Define different debug flag for dedicated service modules in debug flag array. */
|
||||
// Each module has independt 32 bit debug flag you cnn define the flag as yout require.
|
||||
typedef enum tag_DBGP_Flag_Type_Definition
|
||||
{
|
||||
FQoS = 0,
|
||||
FTX = 1,
|
||||
FRX = 2,
|
||||
FSEC = 3,
|
||||
FMGNT = 4,
|
||||
FMLME = 5,
|
||||
FRESOURCE = 6,
|
||||
FBEACON = 7,
|
||||
FISR = 8,
|
||||
FPHY = 9,
|
||||
FMP = 10,
|
||||
FEEPROM = 11,
|
||||
FPWR = 12,
|
||||
FDM = 13,
|
||||
FDBG_CTRL = 14,
|
||||
FC2H = 15,
|
||||
FBT = 16,
|
||||
FINIT = 17,
|
||||
FIOCTL = 18,
|
||||
FSHORT_CUT = 19,
|
||||
DBGP_TYPE_MAX
|
||||
}DBGP_FLAG_E;
|
||||
|
||||
|
||||
// Define Qos Relative debug flag bit --> FQoS
|
||||
#define QoS_INIT BIT0
|
||||
#define QoS_VISTA BIT1
|
||||
|
||||
// Define TX relative debug bit --> FTX
|
||||
#define TX_DESC BIT0
|
||||
#define TX_DESC_TID BIT1
|
||||
#define TX_PATH BIT2
|
||||
|
||||
// Define RX relative debug bit --> FRX
|
||||
#define RX_DATA BIT0
|
||||
#define RX_PHY_STS BIT1
|
||||
#define RX_PHY_SS BIT2
|
||||
#define RX_PHY_SQ BIT3
|
||||
#define RX_PHY_ASTS BIT4
|
||||
#define RX_ERR_LEN BIT5
|
||||
#define RX_DEFRAG BIT6
|
||||
#define RX_ERR_RATE BIT7
|
||||
#define RX_PATH BIT8
|
||||
#define RX_BEACON BIT9
|
||||
|
||||
// Define Security relative debug bit --> FSEC
|
||||
|
||||
// Define MGNT relative debug bit --> FMGNT
|
||||
|
||||
// Define MLME relative debug bit --> FMLME
|
||||
#define MEDIA_STS BIT0
|
||||
#define LINK_STS BIT1
|
||||
|
||||
// Define OS resource check module bit --> FRESOURCE
|
||||
#define OS_CHK BIT0
|
||||
|
||||
// Define beacon content check module bit --> FBEACON
|
||||
#define BCN_SHOW BIT0
|
||||
#define BCN_PEER BIT1
|
||||
|
||||
// Define ISR/IMR check module bit --> FISR
|
||||
#define ISR_CHK BIT0
|
||||
|
||||
// Define PHY-BB/RF/MAC check module bit --> FPHY
|
||||
#define PHY_BBR BIT0
|
||||
#define PHY_BBW BIT1
|
||||
#define PHY_RFR BIT2
|
||||
#define PHY_RFW BIT3
|
||||
#define PHY_MACR BIT4
|
||||
#define PHY_MACW BIT5
|
||||
#define PHY_ALLR BIT6
|
||||
#define PHY_ALLW BIT7
|
||||
#define PHY_TXPWR BIT8
|
||||
#define PHY_PWRDIFF BIT9
|
||||
#define PHY_SICR BIT10
|
||||
#define PHY_SICW BIT11
|
||||
|
||||
// Define MPT driver check module bit --> FMP
|
||||
#define MP_RX BIT0
|
||||
#define MP_SWICH_CH BIT1
|
||||
|
||||
// Define EEPROM and EFUSE check module bit --> FEEPROM
|
||||
#define EEPROM_W BIT0
|
||||
#define EFUSE_PG BIT1
|
||||
#define EFUSE_READ_ALL BIT2
|
||||
#define EFUSE_ANALYSIS BIT3
|
||||
#define EFUSE_PG_DETAIL BIT4
|
||||
|
||||
// Define power save check module bit --> FPWR
|
||||
#define LPS BIT0
|
||||
#define IPS BIT1
|
||||
#define PWRSW BIT2
|
||||
#define PWRHW BIT3
|
||||
#define PWRHAL BIT4
|
||||
|
||||
// Define Dynamic Mechanism check module bit --> FDM
|
||||
#define WA_IOT BIT0
|
||||
#define DM_PWDB BIT1
|
||||
#define DM_Monitor BIT2
|
||||
#define DM_DIG BIT3
|
||||
#define DM_EDCA_Turbo BIT4
|
||||
#define DM_BT30 BIT5
|
||||
|
||||
// Define Dbg Control module bit --> FDBG_CTRL
|
||||
#define DBG_CTRL_TRACE BIT0
|
||||
#define DBG_CTRL_INBAND_NOISE BIT1
|
||||
|
||||
// Define FW C2H Cmd check module bit --> FC2H
|
||||
#define C2H_Summary BIT0
|
||||
#define C2H_PacketData BIT1
|
||||
#define C2H_ContentData BIT2
|
||||
// Define BT Cmd check module bit --> FBT
|
||||
#define BT_TRACE BIT0
|
||||
#define BT_RFPoll BIT1
|
||||
|
||||
// Define init check for module bit --> FINIT
|
||||
#define INIT_EEPROM BIT0
|
||||
#define INIT_TxPower BIT1
|
||||
#define INIT_IQK BIT2
|
||||
#define INIT_RF BIT3
|
||||
|
||||
// Define IOCTL Cmd check module bit --> FIOCTL
|
||||
// section 1 : IRP related
|
||||
#define IOCTL_IRP BIT0
|
||||
#define IOCTL_IRP_DETAIL BIT1
|
||||
#define IOCTL_IRP_STATISTICS BIT2
|
||||
#define IOCTL_IRP_HANDLE BIT3
|
||||
// section 2 : HCI command/event
|
||||
#define IOCTL_BT_HCICMD BIT8
|
||||
#define IOCTL_BT_HCICMD_DETAIL BIT9
|
||||
#define IOCTL_BT_HCICMD_EXT BIT10
|
||||
#define IOCTL_BT_EVENT BIT11
|
||||
#define IOCTL_BT_EVENT_DETAIL BIT12
|
||||
#define IOCTL_BT_EVENT_PERIODICAL BIT13
|
||||
// section 3 : BT tx/rx data and throughput
|
||||
#define IOCTL_BT_TX_ACLDATA BIT16
|
||||
#define IOCTL_BT_TX_ACLDATA_DETAIL BIT17
|
||||
#define IOCTL_BT_RX_ACLDATA BIT18
|
||||
#define IOCTL_BT_RX_ACLDATA_DETAIL BIT19
|
||||
#define IOCTL_BT_TP BIT20
|
||||
// section 4 : BT connection state machine.
|
||||
#define IOCTL_STATE BIT21
|
||||
#define IOCTL_BT_LOGO BIT22
|
||||
// section 5 : BT function trace
|
||||
#define IOCTL_CALLBACK_FUN BIT24
|
||||
#define IOCTL_PARSE_BT_PKT BIT25
|
||||
#define IOCTL_BT_TX_PKT BIT26
|
||||
#define IOCTL_BT_FLAG_MON BIT27
|
||||
|
||||
//
|
||||
// Define init check for module bit --> FSHORT_CUT
|
||||
// 2011/07/20 MH Add for short but definition.
|
||||
//
|
||||
#define SHCUT_TX BIT0
|
||||
#define SHCUT_RX BIT1
|
||||
|
||||
|
||||
/* 2007/07/13 MH *//*------For DeBuG Print modeue------*/
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
|
||||
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
#if (DM_ODM_SUPPORT_TYPE != ODM_MP)
|
||||
#define RT_PRINTK(fmt, args...) printk( "%s(): " fmt, __FUNCTION__, ## args);
|
||||
|
||||
#if DBG
|
||||
#define ODM_RT_TRACE(pDM_Odm,comp, level, fmt) \
|
||||
if(((comp) & GlobalDebugComponents) && (level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
RT_PRINTK fmt; \
|
||||
}
|
||||
|
||||
#define RT_TRACE_F(comp, level, fmt) \
|
||||
if(((comp) & GlobalDebugComponents) && (level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
RT_PRINTK fmt; \
|
||||
}
|
||||
|
||||
#define RT_ASSERT(expr,fmt) \
|
||||
if(!(expr)) { \
|
||||
printk( "Assertion failed! %s at ......\n", #expr); \
|
||||
printk( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \
|
||||
}
|
||||
#define dbg_enter() { printk("==> %s\n", __FUNCTION__); }
|
||||
#define dbg_exit() { printk("<== %s\n", __FUNCTION__); }
|
||||
#define dbg_trace(str) { printk("%s:%s\n", __FUNCTION__, str); }
|
||||
#else
|
||||
#define ODM_RT_TRACE(pDM_Odm,comp, level, fmt)
|
||||
#define RT_TRACE_F(comp, level, fmt)
|
||||
#define RT_ASSERT(expr, fmt)
|
||||
#define dbg_enter()
|
||||
#define dbg_exit()
|
||||
#define dbg_trace(str)
|
||||
#endif
|
||||
|
||||
#if DBG
|
||||
#define DbgPrint printk
|
||||
|
||||
#define PRINT_DATA(_TitleString, _HexData, _HexDataLen) \
|
||||
{ \
|
||||
char *szTitle = _TitleString; \
|
||||
pu1Byte pbtHexData = _HexData; \
|
||||
u4Byte u4bHexDataLen = _HexDataLen; \
|
||||
u4Byte __i; \
|
||||
DbgPrint("%s", szTitle); \
|
||||
for (__i=0;__i<u4bHexDataLen;__i++) \
|
||||
{ \
|
||||
if ((__i & 15) == 0) \
|
||||
{ \
|
||||
DbgPrint("\n"); \
|
||||
} \
|
||||
DbgPrint("%02X%s", pbtHexData[__i], ( ((__i&3)==3) ? " " : " ") ); \
|
||||
} \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
|
||||
// RT_PRINT_XXX macros: implemented for debugging purpose.
|
||||
// Added by Annie, 2005-11-21.
|
||||
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \
|
||||
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_HexData; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
for( __i=0; __i<(int)_HexDataLen; __i++ ) \
|
||||
{ \
|
||||
DbgPrint("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" "); \
|
||||
if (((__i + 1) % 16) == 0) DbgPrint("\n"); \
|
||||
} \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
|
||||
#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr) \
|
||||
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_Ptr; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint(" "); \
|
||||
for( __i=0; __i<6; __i++ ) \
|
||||
DbgPrint("%02X%s", ptr[__i], (__i==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
|
||||
#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum) \
|
||||
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i, __j; \
|
||||
pu1Byte ptr = (pu1Byte)_Ptr; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint("\n"); \
|
||||
for( __i=0; __i<(int)_AddNum; __i++ ) \
|
||||
{ \
|
||||
for( __j=0; __j<6; __j++ ) \
|
||||
DbgPrint("%02X%s", ptr[__i*6+__j], (__j==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
} \
|
||||
}
|
||||
|
||||
// Added by Annie, 2005-11-22.
|
||||
#define MAX_STR_LEN 64
|
||||
#define PRINTABLE(_ch) (_ch>=' ' &&_ch<='~' ) // I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.
|
||||
|
||||
#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len) \
|
||||
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
u1Byte buffer[MAX_STR_LEN]; \
|
||||
int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \
|
||||
PlatformZeroMemory( buffer, MAX_STR_LEN ); \
|
||||
PlatformMoveMemory( buffer, (pu1Byte)_Ptr, length ); \
|
||||
for( __i=0; __i<MAX_STR_LEN; __i++ ) \
|
||||
{ \
|
||||
if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \
|
||||
} \
|
||||
buffer[length] = '\0'; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint(": %d, <%s>\n", _Len, buffer); \
|
||||
}
|
||||
|
||||
#else // of #if DBG
|
||||
#define DbgPrint(...)
|
||||
#define PRINT_DATA(_TitleString, _HexData, _HexDataLen)
|
||||
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen)
|
||||
#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr)
|
||||
#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum)
|
||||
#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len)
|
||||
#endif // of #if DBG
|
||||
|
||||
|
||||
|
||||
#endif // #if (DM_ODM_SUPPORT_TYPE != ODM_MP)
|
||||
|
||||
#define DEBUG_PRINT 1
|
||||
|
||||
// Please add new OS's print API by yourself
|
||||
|
||||
//#if (RT_PLATFORM==PLATFORM_WINDOWS)
|
||||
#if (DEBUG_PRINT == 1) && DBG
|
||||
#define RTPRINT(dbgtype, dbgflag, printstr)\
|
||||
{\
|
||||
if (DBGP_Type[dbgtype] & dbgflag)\
|
||||
{\
|
||||
DbgPrint printstr;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define RTPRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr)\
|
||||
{\
|
||||
if (DBGP_Type[dbgtype] & dbgflag)\
|
||||
{\
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_Ptr; \
|
||||
DbgPrint printstr; \
|
||||
DbgPrint(" "); \
|
||||
for( __i=0; __i<6; __i++ ) \
|
||||
DbgPrint("%02X%s", ptr[__i], (__i==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
}\
|
||||
}
|
||||
|
||||
#define RTPRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)\
|
||||
{\
|
||||
if (DBGP_Type[dbgtype] & dbgflag)\
|
||||
{\
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_HexData; \
|
||||
DbgPrint(_TitleString); \
|
||||
for( __i=0; __i<(int)_HexDataLen; __i++ ) \
|
||||
{ \
|
||||
DbgPrint("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" ");\
|
||||
if (((__i + 1) % 16) == 0) DbgPrint("\n");\
|
||||
} \
|
||||
DbgPrint("\n"); \
|
||||
}\
|
||||
}
|
||||
#define FuncEntry FunctionIn(COMP_FUNC)
|
||||
#define FuncExit FunctionOut(COMP_FUNC)
|
||||
|
||||
#define FunctionIn(_comp) ODM_RT_TRACE(pDM_Odm,(_comp), DBG_LOUD, ("==========> %s\n", __FUNCTION__))
|
||||
#define FunctionOut(_comp) ODM_RT_TRACE(pDM_Odm,(_comp), DBG_LOUD, ("<========== %s\n", __FUNCTION__))
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#define DBGP(dbgtype, dbgflag, printstr)
|
||||
#define RTPRINT(dbgtype, dbgflag, printstr)
|
||||
#define RTPRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr)
|
||||
#define RTPRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)
|
||||
#define FuncEntry
|
||||
#define FuncExit
|
||||
#define FunctionIn(_comp)
|
||||
#define FunctionOut(_comp)
|
||||
#endif
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
|
||||
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
extern u4Byte DBGP_Type[DBGP_TYPE_MAX];
|
||||
extern DBGP_HEAD_T DBGP_Head;
|
||||
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
|
||||
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
extern void DBGP_Flag_Init(void);
|
||||
extern void DBG_PrintAllFlag(void);
|
||||
extern void DBG_PrintAllComp(void);
|
||||
extern void DBG_PrintFlagEvent(u1Byte DbgFlag);
|
||||
extern void DBG_DumpMem(const u1Byte DbgComp,
|
||||
const u1Byte DbgLevel,
|
||||
pu1Byte pMem,
|
||||
u2Byte Len);
|
||||
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern u4Byte GlobalDebugLevel;
|
||||
extern u8Byte GlobalDebugComponents;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __ODM_DBG_H__
|
||||
|
||||
|
|
@ -1,666 +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 "odm_precomp.h"
|
||||
//
|
||||
// ODM IO Relative API.
|
||||
//
|
||||
|
||||
u1Byte
|
||||
ODM_Read1Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
return RTL_R8(RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return rtw_read8(Adapter,RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PlatformEFIORead1Byte(Adapter, RegAddr);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
u2Byte
|
||||
ODM_Read2Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
return RTL_R16(RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return rtw_read16(Adapter,RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PlatformEFIORead2Byte(Adapter, RegAddr);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
u4Byte
|
||||
ODM_Read4Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
return RTL_R32(RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return rtw_read32(Adapter,RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PlatformEFIORead4Byte(Adapter, RegAddr);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_Write1Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u1Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
RTL_W8(RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
rtw_write8(Adapter,RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformEFIOWrite1Byte(Adapter, RegAddr, Data);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_Write2Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u2Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
RTL_W16(RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
rtw_write16(Adapter,RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformEFIOWrite2Byte(Adapter, RegAddr, Data);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_Write4Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
RTL_W32(RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
rtw_write32(Adapter,RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformEFIOWrite4Byte(Adapter, RegAddr, Data);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_SetMACReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
PHY_SetBBReg(pDM_Odm->priv, RegAddr, BitMask, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PHY_SetBBReg(Adapter, RegAddr, BitMask, Data);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
u4Byte
|
||||
ODM_GetMACReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
return PHY_QueryBBReg(pDM_Odm->priv, RegAddr, BitMask);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PHY_QueryBBReg(Adapter, RegAddr, BitMask);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_SetBBReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
PHY_SetBBReg(pDM_Odm->priv, RegAddr, BitMask, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PHY_SetBBReg(Adapter, RegAddr, BitMask, Data);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
u4Byte
|
||||
ODM_GetBBReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
return PHY_QueryBBReg(pDM_Odm->priv, RegAddr, BitMask);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PHY_QueryBBReg(Adapter, RegAddr, BitMask);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_SetRFReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_RF_RADIO_PATH_E eRFPath,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
PHY_SetRFReg(pDM_Odm->priv, eRFPath, RegAddr, BitMask, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PHY_SetRFReg(Adapter, eRFPath, RegAddr, BitMask, Data);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
u4Byte
|
||||
ODM_GetRFReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_RF_RADIO_PATH_E eRFPath,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
return PHY_QueryRFReg(pDM_Odm->priv, eRFPath, RegAddr, BitMask, 1);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_MP))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PHY_QueryRFReg(Adapter, eRFPath, RegAddr, BitMask);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// ODM Memory relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_AllocateMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PVOID *pPtr,
|
||||
IN u4Byte length
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
*pPtr = kmalloc(length, GFP_ATOMIC);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
|
||||
*pPtr = rtw_zvmalloc(length);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformAllocateMemory(Adapter, pPtr, length);
|
||||
#endif
|
||||
}
|
||||
|
||||
// length could be ignored, used to detect memory leakage.
|
||||
VOID
|
||||
ODM_FreeMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PVOID pPtr,
|
||||
IN u4Byte length
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
kfree(pPtr);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
|
||||
rtw_vmfree(pPtr, length);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
//PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformFreeMemory(pPtr, length);
|
||||
#endif
|
||||
}
|
||||
s4Byte ODM_CompareMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PVOID pBuf1,
|
||||
IN PVOID pBuf2,
|
||||
IN u4Byte length
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
return memcmp(pBuf1,pBuf2,length);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
|
||||
return _rtw_memcmp(pBuf1,pBuf2,length);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
return PlatformCompareMemory(pBuf1,pBuf2,length);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// ODM MISC relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_AcquireSpinLock(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN RT_SPINLOCK_TYPE type
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformAcquireSpinLock(Adapter, type);
|
||||
#endif
|
||||
}
|
||||
VOID
|
||||
ODM_ReleaseSpinLock(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN RT_SPINLOCK_TYPE type
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformReleaseSpinLock(Adapter, type);
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Work item relative API. FOr MP driver only~!
|
||||
//
|
||||
VOID
|
||||
ODM_InitializeWorkItem(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_WORK_ITEM pRtWorkItem,
|
||||
IN RT_WORKITEM_CALL_BACK RtWorkItemCallback,
|
||||
IN PVOID pContext,
|
||||
IN const char* szID
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformInitializeWorkItem(Adapter, pRtWorkItem, RtWorkItemCallback, pContext, szID);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_StartWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PlatformStartWorkItem(pRtWorkItem);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_StopWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PlatformStopWorkItem(pRtWorkItem);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_FreeWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PlatformFreeWorkItem(pRtWorkItem);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_ScheduleWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PlatformScheduleWorkItem(pRtWorkItem);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_IsWorkItemScheduled(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PlatformIsWorkItemScheduled(pRtWorkItem);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// ODM Timer relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_StallExecution(
|
||||
IN u4Byte usDelay
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_udelay_os(usDelay);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PlatformStallExecution(usDelay);
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_delay_ms(IN u4Byte ms)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
delay_ms(ms);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_mdelay_os(ms);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
delay_ms(ms);
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_delay_us(IN u4Byte us)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
delay_us(us);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_udelay_os(us);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PlatformStallExecution(us);
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_sleep_ms(IN u4Byte ms)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_msleep_os(ms);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_sleep_us(IN u4Byte us)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_usleep_os(us);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_SetTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer,
|
||||
IN u4Byte msDelay
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
mod_timer(pTimer, jiffies + (msDelay+9)/10);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
_set_timer(pTimer,msDelay ); //ms
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformSetTimer(Adapter, pTimer, msDelay);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_InitializeTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer,
|
||||
IN RT_TIMER_CALL_BACK CallBackFunc,
|
||||
IN PVOID pContext,
|
||||
IN const char* szID
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
pTimer->function = CallBackFunc;
|
||||
pTimer->data = (unsigned long)pDM_Odm;
|
||||
init_timer(pTimer);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
_init_timer(pTimer,Adapter->pnetdev,CallBackFunc,pDM_Odm);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformInitializeTimer(Adapter, pTimer, CallBackFunc,pContext,szID);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_CancelTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
del_timer_sync(pTimer);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
_cancel_timer_ex(pTimer);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformCancelTimer(Adapter, pTimer);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_ReleaseTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
|
||||
// <20120301, Kordan> If the initilization fails, InitializeAdapterXxx will return regardless of InitHalDm.
|
||||
// Hence, uninitialized timers cause BSOD when the driver releases resources since the init fail.
|
||||
if (pTimer == 0)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_SERIOUS, ("=====>ODM_ReleaseTimer(), The timer is NULL! Please check it!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
PlatformReleaseTimer(Adapter, pTimer);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// ODM FW relative API.
|
||||
//
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
VOID
|
||||
ODM_FillH2CCmd(
|
||||
IN PADAPTER Adapter,
|
||||
IN u1Byte ElementID,
|
||||
IN u4Byte CmdLen,
|
||||
IN pu1Byte pCmdBuffer
|
||||
)
|
||||
{
|
||||
if(IS_HARDWARE_TYPE_JAGUAR(Adapter))
|
||||
{
|
||||
switch(ElementID)
|
||||
{
|
||||
case ODM_H2C_RSSI_REPORT:
|
||||
FillH2CCmd8812(Adapter, H2C_8812_RSSI_REPORT, CmdLen, pCmdBuffer);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else if(IS_HARDWARE_TYPE_8188E(Adapter))
|
||||
{
|
||||
switch(ElementID)
|
||||
{
|
||||
case ODM_H2C_PSD_RESULT:
|
||||
FillH2CCmd88E(Adapter, H2C_88E_PSD_RESULT, CmdLen, pCmdBuffer);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(ElementID)
|
||||
{
|
||||
case ODM_H2C_RSSI_REPORT:
|
||||
FillH2CCmd92C(Adapter, H2C_RSSI_REPORT, CmdLen, pCmdBuffer);
|
||||
case ODM_H2C_PSD_RESULT:
|
||||
FillH2CCmd92C(Adapter, H2C_92C_PSD_RESULT, CmdLen, pCmdBuffer);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
u4Byte
|
||||
ODM_FillH2CCmd(
|
||||
IN pu1Byte pH2CBuffer,
|
||||
IN u4Byte H2CBufferLen,
|
||||
IN u4Byte CmdNum,
|
||||
IN pu4Byte pElementID,
|
||||
IN pu4Byte pCmdLen,
|
||||
IN pu1Byte* pCmbBuffer,
|
||||
IN pu1Byte CmdStartSeq
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
//FillH2CCmd(pH2CBuffer, H2CBufferLen, CmdNum, pElementID, pCmdLen, pCmbBuffer, CmdStartSeq);
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,374 +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_INTERFACE_H__
|
||||
#define __ODM_INTERFACE_H__
|
||||
|
||||
|
||||
|
||||
//
|
||||
// =========== Constant/Structure/Enum/... Define
|
||||
//
|
||||
|
||||
|
||||
|
||||
//
|
||||
// =========== Macro Define
|
||||
//
|
||||
|
||||
#define _reg_all(_name) ODM_##_name
|
||||
#define _reg_ic(_name, _ic) ODM_##_name##_ic
|
||||
#define _bit_all(_name) BIT_##_name
|
||||
#define _bit_ic(_name, _ic) BIT_##_name##_ic
|
||||
|
||||
// _cat: implemented by Token-Pasting Operator.
|
||||
#if 0
|
||||
#define _cat(_name, _ic_type, _func) \
|
||||
( \
|
||||
_func##_all(_name) \
|
||||
)
|
||||
#endif
|
||||
|
||||
/*===================================
|
||||
|
||||
#define ODM_REG_DIG_11N 0xC50
|
||||
#define ODM_REG_DIG_11AC 0xDDD
|
||||
|
||||
ODM_REG(DIG,_pDM_Odm)
|
||||
=====================================*/
|
||||
|
||||
#define _reg_11N(_name) ODM_REG_##_name##_11N
|
||||
#define _reg_11AC(_name) ODM_REG_##_name##_11AC
|
||||
#define _bit_11N(_name) ODM_BIT_##_name##_11N
|
||||
#define _bit_11AC(_name) ODM_BIT_##_name##_11AC
|
||||
|
||||
#if 1 //TODO: enable it if we need to support run-time to differentiate between 92C_SERIES and JAGUAR_SERIES.
|
||||
#define _cat(_name, _ic_type, _func) \
|
||||
( \
|
||||
((_ic_type) & ODM_IC_11N_SERIES)? _func##_11N(_name): \
|
||||
_func##_11AC(_name) \
|
||||
)
|
||||
#endif
|
||||
#if 0 // only sample code
|
||||
#define _cat(_name, _ic_type, _func) \
|
||||
( \
|
||||
((_ic_type) & ODM_RTL8192C)? _func##_ic(_name, _8192C): \
|
||||
((_ic_type) & ODM_RTL8192D)? _func##_ic(_name, _8192D): \
|
||||
((_ic_type) & ODM_RTL8192S)? _func##_ic(_name, _8192S): \
|
||||
((_ic_type) & ODM_RTL8723A)? _func##_ic(_name, _8723A): \
|
||||
((_ic_type) & ODM_RTL8188E)? _func##_ic(_name, _8188E): \
|
||||
_func##_ic(_name, _8195) \
|
||||
)
|
||||
#endif
|
||||
|
||||
// _name: name of register or bit.
|
||||
// Example: "ODM_REG(R_A_AGC_CORE1, pDM_Odm)"
|
||||
// gets "ODM_R_A_AGC_CORE1" or "ODM_R_A_AGC_CORE1_8192C", depends on SupportICType.
|
||||
#define ODM_REG(_name, _pDM_Odm) _cat(_name, _pDM_Odm->SupportICType, _reg)
|
||||
#define ODM_BIT(_name, _pDM_Odm) _cat(_name, _pDM_Odm->SupportICType, _bit)
|
||||
|
||||
typedef enum _ODM_H2C_CMD
|
||||
{
|
||||
ODM_H2C_RSSI_REPORT = 0,
|
||||
ODM_H2C_PSD_RESULT=1,
|
||||
ODM_H2C_PathDiv = 2,
|
||||
ODM_MAX_H2CCMD
|
||||
}ODM_H2C_CMD;
|
||||
|
||||
|
||||
//
|
||||
// 2012/02/17 MH For non-MP compile pass only. Linux does not support workitem.
|
||||
// Suggest HW team to use thread instead of workitem. Windows also support the feature.
|
||||
//
|
||||
#if (DM_ODM_SUPPORT_TYPE != ODM_MP)
|
||||
typedef void *PRT_WORK_ITEM ;
|
||||
typedef void RT_WORKITEM_HANDLE,*PRT_WORKITEM_HANDLE;
|
||||
typedef VOID (*RT_WORKITEM_CALL_BACK)(PVOID pContext);
|
||||
|
||||
#if 0
|
||||
typedef struct tasklet_struct RT_WORKITEM_HANDLE, *PRT_WORKITEM_HANDLE;
|
||||
|
||||
typedef struct _RT_WORK_ITEM
|
||||
{
|
||||
|
||||
RT_WORKITEM_HANDLE Handle; // Platform-dependent handle for this workitem, e.g. Ndis Workitem object.
|
||||
PVOID Adapter; // Pointer to Adapter object.
|
||||
PVOID pContext; // Parameter to passed to CallBackFunc().
|
||||
RT_WORKITEM_CALL_BACK CallbackFunc; // Callback function of the workitem.
|
||||
u1Byte RefCount; // 0: driver is going to unload, 1: No such workitem scheduled, 2: one workitem is schedueled.
|
||||
PVOID pPlatformExt; // Pointer to platform-dependent extension.
|
||||
BOOLEAN bFree;
|
||||
char szID[36]; // An identity string of this workitem.
|
||||
}RT_WORK_ITEM, *PRT_WORK_ITEM;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// =========== Extern Variable ??? It should be forbidden.
|
||||
//
|
||||
|
||||
|
||||
//
|
||||
// =========== EXtern Function Prototype
|
||||
//
|
||||
|
||||
|
||||
u1Byte
|
||||
ODM_Read1Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
);
|
||||
|
||||
u2Byte
|
||||
ODM_Read2Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
);
|
||||
|
||||
u4Byte
|
||||
ODM_Read4Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_Write1Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u1Byte Data
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_Write2Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u2Byte Data
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_Write4Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_SetMACReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
u4Byte
|
||||
ODM_GetMACReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_SetBBReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
u4Byte
|
||||
ODM_GetBBReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_SetRFReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_RF_RADIO_PATH_E eRFPath,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
u4Byte
|
||||
ODM_GetRFReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_RF_RADIO_PATH_E eRFPath,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// Memory Relative Function.
|
||||
//
|
||||
VOID
|
||||
ODM_AllocateMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PVOID *pPtr,
|
||||
IN u4Byte length
|
||||
);
|
||||
VOID
|
||||
ODM_FreeMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PVOID pPtr,
|
||||
IN u4Byte length
|
||||
);
|
||||
|
||||
s4Byte ODM_CompareMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PVOID pBuf1,
|
||||
IN PVOID pBuf2,
|
||||
IN u4Byte length
|
||||
);
|
||||
|
||||
//
|
||||
// ODM MISC-spin lock relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_AcquireSpinLock(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN RT_SPINLOCK_TYPE type
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_ReleaseSpinLock(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN RT_SPINLOCK_TYPE type
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ODM MISC-workitem relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_InitializeWorkItem(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_WORK_ITEM pRtWorkItem,
|
||||
IN RT_WORKITEM_CALL_BACK RtWorkItemCallback,
|
||||
IN PVOID pContext,
|
||||
IN const char* szID
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_StartWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_StopWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_FreeWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_ScheduleWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_IsWorkItemScheduled(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
);
|
||||
|
||||
//
|
||||
// ODM Timer relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_StallExecution(
|
||||
IN u4Byte usDelay
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_delay_ms(IN u4Byte ms);
|
||||
|
||||
|
||||
VOID
|
||||
ODM_delay_us(IN u4Byte us);
|
||||
|
||||
VOID
|
||||
ODM_sleep_ms(IN u4Byte ms);
|
||||
|
||||
VOID
|
||||
ODM_sleep_us(IN u4Byte us);
|
||||
|
||||
VOID
|
||||
ODM_SetTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer,
|
||||
IN u4Byte msDelay
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_InitializeTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer,
|
||||
IN RT_TIMER_CALL_BACK CallBackFunc,
|
||||
IN PVOID pContext,
|
||||
IN const char* szID
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_CancelTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_ReleaseTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ODM FW relative API.
|
||||
//
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
VOID
|
||||
ODM_FillH2CCmd(
|
||||
IN PADAPTER Adapter,
|
||||
IN u1Byte ElementID,
|
||||
IN u4Byte CmdLen,
|
||||
IN pu1Byte pCmdBuffer
|
||||
);
|
||||
#else
|
||||
u4Byte
|
||||
ODM_FillH2CCmd(
|
||||
IN pu1Byte pH2CBuffer,
|
||||
IN u4Byte H2CBufferLen,
|
||||
IN u4Byte CmdNum,
|
||||
IN pu4Byte pElementID,
|
||||
IN pu4Byte pCmdLen,
|
||||
IN pu1Byte* pCmbBuffer,
|
||||
IN pu1Byte CmdStartSeq
|
||||
);
|
||||
#endif
|
||||
#endif // __ODM_INTERFACE_H__
|
||||
|
||||
|
|
@ -1,222 +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 "odm_types.h"
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
|
||||
#include "Precomp.h" // We need to include mp_precomp.h due to batch file setting.
|
||||
|
||||
#else
|
||||
|
||||
#define TEST_FALG___ 1
|
||||
|
||||
#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_ADSL)
|
||||
// Flags
|
||||
#include "../8192cd_cfg.h" // OUTSRC needs ADSL config flags.
|
||||
#include "../odm_inc.h" // OUTSRC needs some extra flags.
|
||||
// Data Structure
|
||||
#include "../common_types.h" // OUTSRC and rtl8192cd both needs basic type such as UINT8 and BIT0.
|
||||
#include "../8192cd.h" // OUTSRC needs basic ADSL struct definition.
|
||||
#include "../8192cd_util.h" // OUTSRC needs basic I/O function.
|
||||
#ifdef _BIG_ENDIAN_
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
|
||||
#else
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
|
||||
#endif
|
||||
|
||||
#ifdef ADSL_AP_BUILD_WORKAROUND
|
||||
// NESTED_INC: Functions defined outside should not be included!! Marked by Annie, 2011-10-14.
|
||||
#include "../8192cd_headers.h"
|
||||
#include "../8192cd_debug.h"
|
||||
#endif
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE ==ODM_CE)
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtw_byteorder.h>
|
||||
#include <hal_intf.h>
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_MP)
|
||||
#include "Mp_Precomp.h"
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
|
||||
#endif
|
||||
|
||||
|
||||
//2 Hardware Parameter Files
|
||||
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
#if (RTL8192C_SUPPORT==1)
|
||||
#include "rtl8192c/Hal8192CEFWImg_AP.h"
|
||||
#include "rtl8192c/Hal8192CEPHYImg_AP.h"
|
||||
#include "rtl8192c/Hal8192CEMACImg_AP.h"
|
||||
#endif
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL)
|
||||
#include "rtl8192c/Hal8192CEFWImg_ADSL.h"
|
||||
#include "rtl8192c/Hal8192CEPHYImg_ADSL.h"
|
||||
#include "rtl8192c/Hal8192CEMACImg_ADSL.h"
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
#if(RTL8192CE_SUPPORT ==1)
|
||||
#include "rtl8192c/Hal8192CEFWImg_CE.h"
|
||||
#include "rtl8192c/Hal8192CEPHYImg_CE.h"
|
||||
#include "rtl8192c/Hal8192CEMACImg_CE.h"
|
||||
#elif(RTL8192CU_SUPPORT ==1)
|
||||
#include "rtl8192c/Hal8192CUFWImg_CE.h"
|
||||
#include "rtl8192c/Hal8192CUPHYImg_CE.h"
|
||||
#include "rtl8192c/Hal8192CUMACImg_CE.h"
|
||||
#elif(RTL8192DE_SUPPORT ==1)
|
||||
#include "rtl8192d/Hal8192DEFWImg_CE.h"
|
||||
#include "rtl8192d/Hal8192DEPHYImg_CE.h"
|
||||
#include "rtl8192d/Hal8192DEMACImg_CE.h"
|
||||
#elif(RTL8192DU_SUPPORT ==1)
|
||||
#include "rtl8192d/Hal8192DUFWImg_CE.h"
|
||||
#include "rtl8192d/Hal8192DUPHYImg_CE.h"
|
||||
#include "rtl8192d/Hal8192DUMACImg_CE.h"
|
||||
#elif(RTL8723AS_SUPPORT==1)
|
||||
#include "rtl8723a/Hal8723SHWImg_CE.h"
|
||||
#elif(RTL8723AU_SUPPORT==1)
|
||||
#include "rtl8723a/Hal8723UHWImg_CE.h"
|
||||
#elif(RTL8188E_SUPPORT==1)
|
||||
#include "rtl8188e/Hal8188EFWImg_CE.h"
|
||||
#endif
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_MP)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//2 OutSrc Header Files
|
||||
|
||||
#include "odm.h"
|
||||
#include "odm_HWConfig.h"
|
||||
#include "odm_debug.h"
|
||||
#include "odm_RegDefine11AC.h"
|
||||
#include "odm_RegDefine11N.h"
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
#if (RTL8192C_SUPPORT==1)
|
||||
#include "rtl8192c/HalDMOutSrc8192C_AP.h"
|
||||
#endif
|
||||
#if (RTL8188E_SUPPORT==1)
|
||||
#include "rtl8188e/Hal8188ERateAdaptive.h"//for RA,Power training
|
||||
#endif
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL)
|
||||
#include "rtl8192c/HalDMOutSrc8192C_ADSL.h"
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
#include "HalPhyRf.h"
|
||||
#if (RTL8192C_SUPPORT==1)
|
||||
#ifdef CONFIG_INTEL_PROXIM
|
||||
#include "../proxim/intel_proxim.h"
|
||||
#endif
|
||||
#include "rtl8192c/HalDMOutSrc8192C_CE.h"
|
||||
#include <rtl8192c_hal.h>
|
||||
#elif (RTL8192D_SUPPORT==1)
|
||||
#include "rtl8192d/HalDMOutSrc8192D_CE.h"
|
||||
#include "rtl8192d_hal.h"
|
||||
#elif (RTL8723A_SUPPORT==1)
|
||||
#include "rtl8192c/HalDMOutSrc8192C_CE.h" //for IQK,LCK,Power-tracking
|
||||
#include "rtl8723a_hal.h"
|
||||
#elif (RTL8188E_SUPPORT==1)
|
||||
#include "rtl8188e/HalPhyRf_8188e.h"//for IQK,LCK,Power-tracking
|
||||
#include "rtl8188e/Hal8188ERateAdaptive.h"//for RA,Power training
|
||||
#include "rtl8188e_hal.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "odm_interface.h"
|
||||
#include "odm_reg.h"
|
||||
|
||||
#if (RTL8192C_SUPPORT==1)
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
#include "rtl8192c/Hal8192CHWImg_MAC.h"
|
||||
#include "rtl8192c/Hal8192CHWImg_RF.h"
|
||||
#include "rtl8192c/Hal8192CHWImg_BB.h"
|
||||
#include "rtl8192c/Hal8192CHWImg_FW.h"
|
||||
#endif
|
||||
#include "rtl8192c/odm_RTL8192C.h"
|
||||
#endif
|
||||
#if (RTL8192D_SUPPORT==1)
|
||||
#include "rtl8192d/odm_RTL8192D.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8723A_SUPPORT==1)
|
||||
#include "rtl8723a/HalHWImg8723A_MAC.h"
|
||||
#include "rtl8723a/HalHWImg8723A_RF.h"
|
||||
#include "rtl8723a/HalHWImg8723A_BB.h"
|
||||
#include "rtl8723a/HalHWImg8723A_FW.h"
|
||||
#include "rtl8723a/odm_RegConfig8723A.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8188E_SUPPORT==1)
|
||||
#include "rtl8188e/HalHWImg8188E_MAC.h"
|
||||
#include "rtl8188e/HalHWImg8188E_RF.h"
|
||||
#include "rtl8188e/HalHWImg8188E_BB.h"
|
||||
#include "rtl8188e/Hal8188EReg.h"
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
#include "rtl8188e/HalPhyRf_8188e.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8188E_FOR_TEST_CHIP >= 1)
|
||||
#include "rtl8188e/HalHWImg8188E_TestChip_MAC.h"
|
||||
#include "rtl8188e/HalHWImg8188E_TestChip_RF.h"
|
||||
#include "rtl8188e/HalHWImg8188E_TestChip_BB.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
#if (RTL8188E_SUPPORT==1)
|
||||
#include "rtl8188e/HalHWImg8188E_FW.h"
|
||||
#endif
|
||||
#endif //CONFIG_WOWLAN
|
||||
|
||||
#include "rtl8188e/odm_RegConfig8188E.h"
|
||||
#include "rtl8188e/odm_RTL8188E.h"
|
||||
#endif
|
||||
|
||||
#endif // __ODM_PRECOMP_H__
|
||||
|
||||
|
|
@ -1,120 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
//============================================================
|
||||
// File Name: odm_reg.h
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
// This file is for general register definition.
|
||||
//
|
||||
//
|
||||
//============================================================
|
||||
#ifndef __HAL_ODM_REG_H__
|
||||
#define __HAL_ODM_REG_H__
|
||||
|
||||
//
|
||||
// Register Definition
|
||||
//
|
||||
|
||||
//MAC REG
|
||||
#define ODM_BB_RESET 0x002
|
||||
#define ODM_DUMMY 0x4fe
|
||||
#define ODM_EDCA_VO_PARAM 0x500
|
||||
#define ODM_EDCA_VI_PARAM 0x504
|
||||
#define ODM_EDCA_BE_PARAM 0x508
|
||||
#define ODM_EDCA_BK_PARAM 0x50C
|
||||
#define ODM_TXPAUSE 0x522
|
||||
|
||||
//BB REG
|
||||
#define ODM_FPGA_PHY0_PAGE8 0x800
|
||||
#define ODM_PSD_SETTING 0x808
|
||||
#define ODM_AFE_SETTING 0x818
|
||||
#define ODM_TXAGC_B_6_18 0x830
|
||||
#define ODM_TXAGC_B_24_54 0x834
|
||||
#define ODM_TXAGC_B_MCS32_5 0x838
|
||||
#define ODM_TXAGC_B_MCS0_MCS3 0x83c
|
||||
#define ODM_TXAGC_B_MCS4_MCS7 0x848
|
||||
#define ODM_TXAGC_B_MCS8_MCS11 0x84c
|
||||
#define ODM_ANALOG_REGISTER 0x85c
|
||||
#define ODM_RF_INTERFACE_OUTPUT 0x860
|
||||
#define ODM_TXAGC_B_MCS12_MCS15 0x868
|
||||
#define ODM_TXAGC_B_11_A_2_11 0x86c
|
||||
#define ODM_AD_DA_LSB_MASK 0x874
|
||||
#define ODM_ENABLE_3_WIRE 0x88c
|
||||
#define ODM_PSD_REPORT 0x8b4
|
||||
#define ODM_R_ANT_SELECT 0x90c
|
||||
#define ODM_CCK_ANT_SELECT 0xa07
|
||||
#define ODM_CCK_PD_THRESH 0xa0a
|
||||
#define ODM_CCK_RF_REG1 0xa11
|
||||
#define ODM_CCK_MATCH_FILTER 0xa20
|
||||
#define ODM_CCK_RAKE_MAC 0xa2e
|
||||
#define ODM_CCK_CNT_RESET 0xa2d
|
||||
#define ODM_CCK_TX_DIVERSITY 0xa2f
|
||||
#define ODM_CCK_FA_CNT_MSB 0xa5b
|
||||
#define ODM_CCK_FA_CNT_LSB 0xa5c
|
||||
#define ODM_CCK_NEW_FUNCTION 0xa75
|
||||
#define ODM_OFDM_PHY0_PAGE_C 0xc00
|
||||
#define ODM_OFDM_RX_ANT 0xc04
|
||||
#define ODM_R_A_RXIQI 0xc14
|
||||
#define ODM_R_A_AGC_CORE1 0xc50
|
||||
#define ODM_R_A_AGC_CORE2 0xc54
|
||||
#define ODM_R_B_AGC_CORE1 0xc58
|
||||
#define ODM_R_AGC_PAR 0xc70
|
||||
#define ODM_R_HTSTF_AGC_PAR 0xc7c
|
||||
#define ODM_TX_PWR_TRAINING_A 0xc90
|
||||
#define ODM_TX_PWR_TRAINING_B 0xc98
|
||||
#define ODM_OFDM_FA_CNT1 0xcf0
|
||||
#define ODM_OFDM_PHY0_PAGE_D 0xd00
|
||||
#define ODM_OFDM_FA_CNT2 0xda0
|
||||
#define ODM_OFDM_FA_CNT3 0xda4
|
||||
#define ODM_OFDM_FA_CNT4 0xda8
|
||||
#define ODM_TXAGC_A_6_18 0xe00
|
||||
#define ODM_TXAGC_A_24_54 0xe04
|
||||
#define ODM_TXAGC_A_1_MCS32 0xe08
|
||||
#define ODM_TXAGC_A_MCS0_MCS3 0xe10
|
||||
#define ODM_TXAGC_A_MCS4_MCS7 0xe14
|
||||
#define ODM_TXAGC_A_MCS8_MCS11 0xe18
|
||||
#define ODM_TXAGC_A_MCS12_MCS15 0xe1c
|
||||
|
||||
//RF REG
|
||||
#define ODM_GAIN_SETTING 0x00
|
||||
#define ODM_CHANNEL 0x18
|
||||
|
||||
//Ant Detect Reg
|
||||
#define ODM_DPDT 0x300
|
||||
|
||||
//PSD Init
|
||||
#define ODM_PSDREG 0x808
|
||||
|
||||
//92D Path Div
|
||||
#define PATHDIV_REG 0xB30
|
||||
#define PATHDIV_TRI 0xBA0
|
||||
|
||||
|
||||
//
|
||||
// Bitmap Definition
|
||||
//
|
||||
|
||||
#define BIT_FA_RESET BIT0
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,252 +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_TYPES_H__
|
||||
#define __ODM_TYPES_H__
|
||||
|
||||
//
|
||||
// Define Different SW team support
|
||||
//
|
||||
#define ODM_AP 0x01 //BIT0
|
||||
#define ODM_ADSL 0x02 //BIT1
|
||||
#define ODM_CE 0x04 //BIT2
|
||||
#define ODM_MP 0x08 //BIT3
|
||||
|
||||
#define DM_ODM_SUPPORT_TYPE ODM_CE
|
||||
|
||||
// Deifne HW endian support
|
||||
#define ODM_ENDIAN_BIG 0
|
||||
#define ODM_ENDIAN_LITTLE 1
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE != ODM_MP)
|
||||
#define RT_PCI_INTERFACE 1
|
||||
#define RT_USB_INTERFACE 2
|
||||
#define RT_SDIO_INTERFACE 3
|
||||
#endif
|
||||
|
||||
typedef enum _HAL_STATUS{
|
||||
HAL_STATUS_SUCCESS,
|
||||
HAL_STATUS_FAILURE,
|
||||
/*RT_STATUS_PENDING,
|
||||
RT_STATUS_RESOURCE,
|
||||
RT_STATUS_INVALID_CONTEXT,
|
||||
RT_STATUS_INVALID_PARAMETER,
|
||||
RT_STATUS_NOT_SUPPORT,
|
||||
RT_STATUS_OS_API_FAILED,*/
|
||||
}HAL_STATUS,*PHAL_STATUS;
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
typedef enum _RT_SPINLOCK_TYPE{
|
||||
RT_TEMP =1,
|
||||
}RT_SPINLOCK_TYPE;
|
||||
#elif( (DM_ODM_SUPPORT_TYPE == ODM_AP) ||(DM_ODM_SUPPORT_TYPE == ODM_ADSL))
|
||||
|
||||
#define VISTA_USB_RX_REVISE 0
|
||||
|
||||
//
|
||||
// Declare for ODM spin lock defintion temporarily fro compile pass.
|
||||
//
|
||||
typedef enum _RT_SPINLOCK_TYPE{
|
||||
RT_TX_SPINLOCK = 1,
|
||||
RT_RX_SPINLOCK = 2,
|
||||
RT_RM_SPINLOCK = 3,
|
||||
RT_CAM_SPINLOCK = 4,
|
||||
RT_SCAN_SPINLOCK = 5,
|
||||
RT_LOG_SPINLOCK = 7,
|
||||
RT_BW_SPINLOCK = 8,
|
||||
RT_CHNLOP_SPINLOCK = 9,
|
||||
RT_RF_OPERATE_SPINLOCK = 10,
|
||||
RT_INITIAL_SPINLOCK = 11,
|
||||
RT_RF_STATE_SPINLOCK = 12, // For RF state. Added by Bruce, 2007-10-30.
|
||||
#if VISTA_USB_RX_REVISE
|
||||
RT_USBRX_CONTEXT_SPINLOCK = 13,
|
||||
RT_USBRX_POSTPROC_SPINLOCK = 14, // protect data of Adapter->IndicateW/ IndicateR
|
||||
#endif
|
||||
//Shall we define Ndis 6.2 SpinLock Here ?
|
||||
RT_PORT_SPINLOCK=16,
|
||||
RT_VNIC_SPINLOCK=17,
|
||||
RT_HVL_SPINLOCK=18,
|
||||
RT_H2C_SPINLOCK = 20, // For H2C cmd. Added by tynli. 2009.11.09.
|
||||
|
||||
RT_BTData_SPINLOCK=25,
|
||||
|
||||
RT_WAPI_OPTION_SPINLOCK=26,
|
||||
RT_WAPI_RX_SPINLOCK=27,
|
||||
|
||||
// add for 92D CCK control issue
|
||||
RT_CCK_PAGEA_SPINLOCK = 28,
|
||||
RT_BUFFER_SPINLOCK = 29,
|
||||
RT_CHANNEL_AND_BANDWIDTH_SPINLOCK = 30,
|
||||
RT_GEN_TEMP_BUF_SPINLOCK = 31,
|
||||
RT_AWB_SPINLOCK = 32,
|
||||
RT_FW_PS_SPINLOCK = 33,
|
||||
RT_HW_TIMER_SPIN_LOCK = 34,
|
||||
RT_MPT_WI_SPINLOCK = 35
|
||||
}RT_SPINLOCK_TYPE;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
|
||||
#define STA_INFO_T RT_WLAN_STA
|
||||
#define PSTA_INFO_T PRT_WLAN_STA
|
||||
|
||||
// typedef unsigned long u4Byte,*pu4Byte;
|
||||
#define CONFIG_HW_ANTENNA_DIVERSITY
|
||||
#define CONFIG_SW_ANTENNA_DIVERSITY
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
|
||||
// To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07.
|
||||
#define ADSL_AP_BUILD_WORKAROUND
|
||||
#define AP_BUILD_WORKAROUND
|
||||
//
|
||||
|
||||
#ifdef AP_BUILD_WORKAROUND
|
||||
#include "../typedef.h"
|
||||
#else
|
||||
typedef void VOID,*PVOID;
|
||||
typedef unsigned char BOOLEAN,*PBOOLEAN;
|
||||
typedef unsigned char u1Byte,*pu1Byte;
|
||||
typedef unsigned short u2Byte,*pu2Byte;
|
||||
typedef unsigned int u4Byte,*pu4Byte;
|
||||
typedef unsigned long long u8Byte,*pu8Byte;
|
||||
typedef char s1Byte,*ps1Byte;
|
||||
typedef short s2Byte,*ps2Byte;
|
||||
typedef long s4Byte,*ps4Byte;
|
||||
typedef long long s8Byte,*ps8Byte;
|
||||
#endif
|
||||
|
||||
typedef struct rtl8192cd_priv *prtl8192cd_priv;
|
||||
typedef struct stat_info STA_INFO_T,*PSTA_INFO_T;
|
||||
typedef struct timer_list RT_TIMER, *PRT_TIMER;
|
||||
typedef void * RT_TIMER_CALL_BACK;
|
||||
|
||||
#define DEV_BUS_TYPE RT_PCI_INTERFACE
|
||||
|
||||
#define _TRUE 1
|
||||
#define _FALSE 0
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL)
|
||||
|
||||
// To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07.
|
||||
#define ADSL_AP_BUILD_WORKAROUND
|
||||
#define ADSL_BUILD_WORKAROUND
|
||||
//
|
||||
|
||||
typedef unsigned char BOOLEAN,*PBOOLEAN;
|
||||
typedef unsigned char u1Byte,*pu1Byte;
|
||||
typedef unsigned short u2Byte,*pu2Byte;
|
||||
typedef unsigned int u4Byte,*pu4Byte;
|
||||
typedef unsigned long long u8Byte,*pu8Byte;
|
||||
typedef char s1Byte,*ps1Byte;
|
||||
typedef short s2Byte,*ps2Byte;
|
||||
typedef long s4Byte,*ps4Byte;
|
||||
typedef long long s8Byte,*ps8Byte;
|
||||
|
||||
typedef struct rtl8192cd_priv *prtl8192cd_priv;
|
||||
typedef struct stat_info STA_INFO_T,*PSTA_INFO_T;
|
||||
typedef struct timer_list RT_TIMER, *PRT_TIMER;
|
||||
typedef void * RT_TIMER_CALL_BACK;
|
||||
|
||||
#define DEV_BUS_TYPE RT_PCI_INTERFACE
|
||||
|
||||
#define _TRUE 1
|
||||
#define _FALSE 0
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
#include <basic_types.h>
|
||||
|
||||
#if 0
|
||||
typedef u8 u1Byte, *pu1Byte;
|
||||
typedef u16 u2Byte,*pu2Byte;
|
||||
typedef u32 u4Byte,*pu4Byte;
|
||||
typedef u64 u8Byte,*pu8Byte;
|
||||
typedef s8 s1Byte,*ps1Byte;
|
||||
typedef s16 s2Byte,*ps2Byte;
|
||||
typedef s32 s4Byte,*ps4Byte;
|
||||
typedef s64 s8Byte,*ps8Byte;
|
||||
#else
|
||||
#define u1Byte u8
|
||||
#define pu1Byte u8*
|
||||
|
||||
#define u2Byte u16
|
||||
#define pu2Byte u16*
|
||||
|
||||
#define u4Byte u32
|
||||
#define pu4Byte u32*
|
||||
|
||||
#define u8Byte u64
|
||||
#define pu8Byte u64*
|
||||
|
||||
#define s1Byte s8
|
||||
#define ps1Byte s8*
|
||||
|
||||
#define s2Byte s16
|
||||
#define ps2Byte s16*
|
||||
|
||||
#define s4Byte s32
|
||||
#define ps4Byte s32*
|
||||
|
||||
#define s8Byte s64
|
||||
#define ps8Byte s64*
|
||||
|
||||
#endif
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#define DEV_BUS_TYPE RT_USB_INTERFACE
|
||||
#elif defined(CONFIG_PCI_HCI)
|
||||
#define DEV_BUS_TYPE RT_PCI_INTERFACE
|
||||
#elif defined(CONFIG_SDIO_HCI)
|
||||
#define DEV_BUS_TYPE RT_SDIO_INTERFACE
|
||||
#elif defined(CONFIG_GSPI_HCI)
|
||||
#define DEV_BUS_TYPE RT_SDIO_INTERFACE
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(CONFIG_LITTLE_ENDIAN)
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
|
||||
#elif defined (CONFIG_BIG_ENDIAN)
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
|
||||
#endif
|
||||
|
||||
typedef struct timer_list RT_TIMER, *PRT_TIMER;
|
||||
typedef void * RT_TIMER_CALL_BACK;
|
||||
#define STA_INFO_T struct sta_info
|
||||
#define PSTA_INFO_T struct sta_info *
|
||||
|
||||
|
||||
|
||||
#define TRUE _TRUE
|
||||
#define FALSE _FALSE
|
||||
|
||||
|
||||
#define SET_TX_DESC_ANTSEL_A_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 24, 1, __Value)
|
||||
#define SET_TX_DESC_ANTSEL_B_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 25, 1, __Value)
|
||||
#define SET_TX_DESC_ANTSEL_C_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+28, 29, 1, __Value)
|
||||
|
||||
//define useless flag to avoid compile warning
|
||||
#define USE_WORKITEM 0
|
||||
#define FOR_BRAZIL_PRETEST 0
|
||||
#define BT_30_SUPPORT 0
|
||||
#define FPGA_TWO_MAC_VERIFICATION 0
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __ODM_TYPES_H__
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,49 +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 __INC_HAL8192CE_FW_IMG_H
|
||||
#define __INC_HAL8192CE_FW_IMG_H
|
||||
|
||||
/*Created on 2011/ 6/15, 5:45*/
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
#define TSMCImgArrayLength 15706 //v84 TSMC COMMON 2012-04-13
|
||||
#else //#ifdef CONFIG_P2P
|
||||
#define TSMCImgArrayLength 16126 //v88 TSMC P2PPS with CCX report C2H 2012-12-05
|
||||
#endif
|
||||
extern u8 Rtl8192CEFwTSMCImgArray[TSMCImgArrayLength];
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
#define UMCACutImgArrayLength 16248 //v79 UMC A Cut COMMON 2011-10-06
|
||||
#else //#ifdef CONFIG_P2P
|
||||
#define UMCACutImgArrayLength 16126 //v88 UMC A Cut P2PPS with CCX report C2H 2012-12-05
|
||||
#endif
|
||||
extern u8 Rtl8192CEFwUMCACutImgArray[UMCACutImgArrayLength];
|
||||
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
#define UMCBCutImgArrayLength 15686 //v84 UMC B Cut COMMON 2012-04-13
|
||||
#else //#ifdef CONFIG_P2P
|
||||
#define UMCBCutImgArrayLength 16096 //v88 UMC B Cut P2PPS with CCX report C2H 2012-12-05
|
||||
#endif
|
||||
extern u8 Rtl8192CEFwUMCBCutImgArray[UMCBCutImgArrayLength];
|
||||
|
||||
|
||||
#endif //__INC_HAL8192CE_FW_IMG_H
|
||||
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*Created on 2011/ 6/16, 6: 8*/
|
||||
|
||||
#include "../odm_precomp.h"
|
||||
// MAC reg V14 - 2011-11-23
|
||||
u4Byte Rtl8192CEMAC_2T_Array[Rtl8192CEMAC_2T_ArrayLength] = {
|
||||
0x420,0x00000080,
|
||||
0x423,0x00000000,
|
||||
0x430,0x00000000,
|
||||
0x431,0x00000000,
|
||||
0x432,0x00000000,
|
||||
0x433,0x00000001,
|
||||
0x434,0x00000004,
|
||||
0x435,0x00000005,
|
||||
0x436,0x00000006,
|
||||
0x437,0x00000007,
|
||||
0x438,0x00000000,
|
||||
0x439,0x00000000,
|
||||
0x43a,0x00000000,
|
||||
0x43b,0x00000001,
|
||||
0x43c,0x00000004,
|
||||
0x43d,0x00000005,
|
||||
0x43e,0x00000006,
|
||||
0x43f,0x00000007,
|
||||
0x440,0x0000005d,
|
||||
0x441,0x00000001,
|
||||
0x442,0x00000000,
|
||||
0x444,0x00000015,
|
||||
0x445,0x000000f0,
|
||||
0x446,0x0000000f,
|
||||
0x447,0x00000000,
|
||||
0x458,0x00000041,
|
||||
0x459,0x000000a8,
|
||||
0x45a,0x00000072,
|
||||
0x45b,0x000000b9,
|
||||
0x460,0x00000066,
|
||||
0x461,0x00000066,
|
||||
0x462,0x00000008,
|
||||
0x463,0x00000003,
|
||||
0x4c8,0x000000ff,
|
||||
0x4c9,0x00000008,
|
||||
0x4cc,0x000000ff,
|
||||
0x4cd,0x000000ff,
|
||||
0x4ce,0x00000001,
|
||||
0x500,0x00000026,
|
||||
0x501,0x000000a2,
|
||||
0x502,0x0000002f,
|
||||
0x503,0x00000000,
|
||||
0x504,0x00000028,
|
||||
0x505,0x000000a3,
|
||||
0x506,0x0000005e,
|
||||
0x507,0x00000000,
|
||||
0x508,0x0000002b,
|
||||
0x509,0x000000a4,
|
||||
0x50a,0x0000005e,
|
||||
0x50b,0x00000000,
|
||||
0x50c,0x0000004f,
|
||||
0x50d,0x000000a4,
|
||||
0x50e,0x00000000,
|
||||
0x50f,0x00000000,
|
||||
0x512,0x0000001c,
|
||||
0x514,0x0000000a,
|
||||
0x515,0x00000010,
|
||||
0x516,0x0000000a,
|
||||
0x517,0x00000010,
|
||||
0x51a,0x00000016,
|
||||
0x524,0x0000000f,
|
||||
0x525,0x0000004f,
|
||||
0x546,0x00000040,
|
||||
0x547,0x00000000,
|
||||
0x550,0x00000010,
|
||||
0x551,0x00000010,
|
||||
0x559,0x00000002,
|
||||
0x55a,0x00000002,
|
||||
0x55d,0x000000ff,
|
||||
0x605,0x00000030,
|
||||
0x608,0x0000000e,
|
||||
0x609,0x0000002a,
|
||||
0x652,0x00000020,
|
||||
0x652,0x00000020,
|
||||
0x63c,0x00000008,
|
||||
0x63d,0x00000008,
|
||||
0x63e,0x0000000c,
|
||||
0x63f,0x0000000c,
|
||||
0x66e,0x00000005,
|
||||
0x700,0x00000021,
|
||||
0x701,0x00000043,
|
||||
0x702,0x00000065,
|
||||
0x703,0x00000087,
|
||||
0x708,0x00000021,
|
||||
0x709,0x00000043,
|
||||
0x70a,0x00000065,
|
||||
0x70b,0x00000087,
|
||||
};
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __INC_HAL8192CE_MAC_IMG_H
|
||||
#define __INC_HAL8192CE_MAC_IMG_H
|
||||
|
||||
/*Created on 2011/ 6/16, 6: 8*/
|
||||
|
||||
#define Rtl8192CEMAC_2T_ArrayLength 174
|
||||
extern u4Byte Rtl8192CEMAC_2T_Array[Rtl8192CEMAC_2T_ArrayLength];
|
||||
|
||||
#endif //__INC_HAL8192CE_FW_IMG_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,60 +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 __INC_HAL8192CE_PHY_IMG_H
|
||||
#define __INC_HAL8192CE_PHY_IMG_H
|
||||
|
||||
|
||||
/*Created on 2011/ 6/16, 6: 8*/
|
||||
|
||||
#define Rtl8192CEPHY_REG_2TArrayLength 374
|
||||
extern u4Byte Rtl8192CEPHY_REG_2TArray[Rtl8192CEPHY_REG_2TArrayLength];
|
||||
#define Rtl8192CEPHY_REG_1TArrayLength 374
|
||||
extern u4Byte Rtl8192CEPHY_REG_1TArray[Rtl8192CEPHY_REG_1TArrayLength];
|
||||
#define Rtl8192CEPHY_ChangeTo_1T1RArrayLength 1
|
||||
extern u4Byte Rtl8192CEPHY_ChangeTo_1T1RArray[Rtl8192CEPHY_ChangeTo_1T1RArrayLength];
|
||||
#define Rtl8192CEPHY_ChangeTo_1T2RArrayLength 1
|
||||
extern u4Byte Rtl8192CEPHY_ChangeTo_1T2RArray[Rtl8192CEPHY_ChangeTo_1T2RArrayLength];
|
||||
#define Rtl8192CEPHY_ChangeTo_2T2RArrayLength 1
|
||||
extern u4Byte Rtl8192CEPHY_ChangeTo_2T2RArray[Rtl8192CEPHY_ChangeTo_2T2RArrayLength];
|
||||
#define Rtl8192CEPHY_REG_Array_PGLength 336
|
||||
extern u4Byte Rtl8192CEPHY_REG_Array_PG[Rtl8192CEPHY_REG_Array_PGLength];
|
||||
#define Rtl8192CEPHY_REG_Array_MPLength 4
|
||||
extern u4Byte Rtl8192CEPHY_REG_Array_MP[Rtl8192CEPHY_REG_Array_MPLength];
|
||||
#define Rtl8192CERadioA_2TArrayLength 282
|
||||
extern u4Byte Rtl8192CERadioA_2TArray[Rtl8192CERadioA_2TArrayLength];
|
||||
#define Rtl8192CERadioB_2TArrayLength 78
|
||||
extern u4Byte Rtl8192CERadioB_2TArray[Rtl8192CERadioB_2TArrayLength];
|
||||
#define Rtl8192CERadioA_1TArrayLength 282
|
||||
extern u4Byte Rtl8192CERadioA_1TArray[Rtl8192CERadioA_1TArrayLength];
|
||||
#define Rtl8192CERadioB_1TArrayLength 1
|
||||
extern u4Byte Rtl8192CERadioB_1TArray[Rtl8192CERadioB_1TArrayLength];
|
||||
#define Rtl8192CERadioB_GM_ArrayLength 1
|
||||
extern u4Byte Rtl8192CERadioB_GM_Array[Rtl8192CERadioB_GM_ArrayLength];
|
||||
#define Rtl8192CEMACPHY_Array_PGLength 1
|
||||
extern u4Byte Rtl8192CEMACPHY_Array_PG[Rtl8192CEMACPHY_Array_PGLength];
|
||||
#define Rtl8192CEAGCTAB_2TArrayLength 320
|
||||
extern u4Byte Rtl8192CEAGCTAB_2TArray[Rtl8192CEAGCTAB_2TArrayLength];
|
||||
#define Rtl8192CEAGCTAB_1TArrayLength 320
|
||||
extern u4Byte Rtl8192CEAGCTAB_1TArray[Rtl8192CEAGCTAB_1TArrayLength];
|
||||
|
||||
|
||||
#endif //__INC_HAL8192CE_FW_IMG_H
|
||||
|
||||
|
|
@ -1,45 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
//============================================================
|
||||
// File Name: Hal8192CReg.h
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
// This file is for 92CE/92CU register definition.
|
||||
//
|
||||
//
|
||||
//============================================================
|
||||
#ifndef __HAL_8192C_REG_H__
|
||||
#define __HAL_8192C_REG_H__
|
||||
|
||||
//
|
||||
// Register Definition
|
||||
//
|
||||
#define ODM_R_A_AGC_CORE1_8192C 0xc50
|
||||
|
||||
|
||||
//
|
||||
// Bitmap Definition
|
||||
//
|
||||
#define BIT_FA_RESET_8192C BIT0
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,47 +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 __INC_HAL8192CU_FW_IMG_H
|
||||
#define __INC_HAL8192CU_FW_IMG_H
|
||||
|
||||
/*Created on 2011/ 6/15, 5:45*/
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
#define TSMCImgArrayLength 15706 //v84 TSMC COMMON 2012-04-13
|
||||
#else //#ifdef CONFIG_P2P
|
||||
#define TSMCImgArrayLength 16126 //v88 TSMC P2PPS with CCX report C2H 2012-12-05
|
||||
#endif
|
||||
extern u8 Rtl8192CUFwTSMCImgArray[TSMCImgArrayLength];
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
#define UMCACutImgArrayLength 16248 //v79 UMC A Cut COMMON 2011-10-06
|
||||
#else //#ifdef CONFIG_P2P
|
||||
#define UMCACutImgArrayLength 16126 //v88 UMC A Cut P2PPS with CCX report C2H 2012-12-05
|
||||
#endif
|
||||
extern u8 Rtl8192CUFwUMCACutImgArray[UMCACutImgArrayLength];
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
#define UMCBCutImgArrayLength 15686 //v84 UMC B Cut COMMON 2012-04-13
|
||||
#else //#ifdef CONFIG_P2P
|
||||
#define UMCBCutImgArrayLength 16096 //v88 UMC B Cut P2PPS with CCX report C2H 2012-12-05
|
||||
#endif
|
||||
extern u8 Rtl8192CUFwUMCBCutImgArray[UMCBCutImgArrayLength];
|
||||
|
||||
#endif //__INC_HAL8192CU_FW_IMG_H
|
||||
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*Created on 2011/ 6/16, 6: 8*/
|
||||
|
||||
#include "../odm_precomp.h"
|
||||
|
||||
|
||||
// MAC reg V14 - 2011-11-23
|
||||
u4Byte Rtl8192CUMAC_2T_Array[Rtl8192CUMAC_2T_ArrayLength] = {
|
||||
0x420,0x00000080,
|
||||
0x423,0x00000000,
|
||||
0x430,0x00000000,
|
||||
0x431,0x00000000,
|
||||
0x432,0x00000000,
|
||||
0x433,0x00000001,
|
||||
0x434,0x00000004,
|
||||
0x435,0x00000005,
|
||||
0x436,0x00000006,
|
||||
0x437,0x00000007,
|
||||
0x438,0x00000000,
|
||||
0x439,0x00000000,
|
||||
0x43a,0x00000000,
|
||||
0x43b,0x00000001,
|
||||
0x43c,0x00000004,
|
||||
0x43d,0x00000005,
|
||||
0x43e,0x00000006,
|
||||
0x43f,0x00000007,
|
||||
0x440,0x0000005d,
|
||||
0x441,0x00000001,
|
||||
0x442,0x00000000,
|
||||
0x444,0x00000015,
|
||||
0x445,0x000000f0,
|
||||
0x446,0x0000000f,
|
||||
0x447,0x00000000,
|
||||
0x458,0x00000041,
|
||||
0x459,0x000000a8,
|
||||
0x45a,0x00000072,
|
||||
0x45b,0x000000b9,
|
||||
0x460,0x00000066,
|
||||
0x461,0x00000066,
|
||||
0x462,0x00000008,
|
||||
0x463,0x00000003,
|
||||
0x4c8,0x000000ff,
|
||||
0x4c9,0x00000008,
|
||||
0x4cc,0x000000ff,
|
||||
0x4cd,0x000000ff,
|
||||
0x4ce,0x00000001,
|
||||
0x500,0x00000026,
|
||||
0x501,0x000000a2,
|
||||
0x502,0x0000002f,
|
||||
0x503,0x00000000,
|
||||
0x504,0x00000028,
|
||||
0x505,0x000000a3,
|
||||
0x506,0x0000005e,
|
||||
0x507,0x00000000,
|
||||
0x508,0x0000002b,
|
||||
0x509,0x000000a4,
|
||||
0x50a,0x0000005e,
|
||||
0x50b,0x00000000,
|
||||
0x50c,0x0000004f,
|
||||
0x50d,0x000000a4,
|
||||
0x50e,0x00000000,
|
||||
0x50f,0x00000000,
|
||||
0x512,0x0000001c,
|
||||
0x514,0x0000000a,
|
||||
0x515,0x00000010,
|
||||
0x516,0x0000000a,
|
||||
0x517,0x00000010,
|
||||
0x51a,0x00000016,
|
||||
0x524,0x0000000f,
|
||||
0x525,0x0000004f,
|
||||
0x546,0x00000040,
|
||||
0x547,0x00000000,
|
||||
0x550,0x00000010,
|
||||
0x551,0x00000010,
|
||||
0x559,0x00000002,
|
||||
0x55a,0x00000002,
|
||||
0x55d,0x000000ff,
|
||||
0x605,0x00000030,
|
||||
0x608,0x0000000e,
|
||||
0x609,0x0000002a,
|
||||
0x652,0x00000020,
|
||||
0x652,0x00000020,
|
||||
0x63c,0x00000008,
|
||||
0x63d,0x00000008,
|
||||
0x63e,0x0000000c,
|
||||
0x63f,0x0000000c,
|
||||
0x66e,0x00000005,
|
||||
0x700,0x00000021,
|
||||
0x701,0x00000043,
|
||||
0x702,0x00000065,
|
||||
0x703,0x00000087,
|
||||
0x708,0x00000021,
|
||||
0x709,0x00000043,
|
||||
0x70a,0x00000065,
|
||||
0x70b,0x00000087,
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __INC_HAL8192CU_MAC_IMG_H
|
||||
#define __INC_HAL8192CU_MAC_IMG_H
|
||||
|
||||
/*Created on 2011/ 6/16, 6: 8*/
|
||||
|
||||
|
||||
// MAC reg V14 - 2011-11-23
|
||||
#define Rtl8192CUMAC_2T_ArrayLength 174
|
||||
extern u4Byte Rtl8192CUMAC_2T_Array[Rtl8192CUMAC_2T_ArrayLength];
|
||||
|
||||
#endif //__INC_HAL8192CE_FW_IMG_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,81 +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 __INC_HAL8192CU_PHY_IMG_H
|
||||
#define __INC_HAL8192CU_PHY_IMG_H
|
||||
|
||||
/*Created on 2011/ 6/29, 10:30*/
|
||||
|
||||
#define Rtl8192CUPHY_REG_2TArrayLength 374
|
||||
extern u4Byte Rtl8192CUPHY_REG_2TArray[Rtl8192CUPHY_REG_2TArrayLength];
|
||||
#define Rtl8192CUPHY_REG_1TArrayLength 374
|
||||
extern u4Byte Rtl8192CUPHY_REG_1TArray[Rtl8192CUPHY_REG_1TArrayLength];
|
||||
#define Rtl8192CUPHY_ChangeTo_1T1RArrayLength 1
|
||||
extern u4Byte Rtl8192CUPHY_ChangeTo_1T1RArray[Rtl8192CUPHY_ChangeTo_1T1RArrayLength];
|
||||
#define Rtl8192CUPHY_ChangeTo_1T2RArrayLength 1
|
||||
extern u4Byte Rtl8192CUPHY_ChangeTo_1T2RArray[Rtl8192CUPHY_ChangeTo_1T2RArrayLength];
|
||||
#define Rtl8192CUPHY_ChangeTo_2T2RArrayLength 1
|
||||
extern u4Byte Rtl8192CUPHY_ChangeTo_2T2RArray[Rtl8192CUPHY_ChangeTo_2T2RArrayLength];
|
||||
#define Rtl8192CUPHY_REG_Array_PGLength 336
|
||||
extern u4Byte Rtl8192CUPHY_REG_Array_PG[Rtl8192CUPHY_REG_Array_PGLength];
|
||||
#define Rtl8192CUPHY_REG_Array_PG_mCardLength 336
|
||||
extern u4Byte Rtl8192CUPHY_REG_Array_PG_mCard[Rtl8192CUPHY_REG_Array_PG_mCardLength];
|
||||
#define Rtl8192CUPHY_REG_Array_MPLength 4
|
||||
extern u4Byte Rtl8192CUPHY_REG_Array_MP[Rtl8192CUPHY_REG_Array_MPLength];
|
||||
#define Rtl8192CUPHY_REG_1T_HPArrayLength 378
|
||||
extern u4Byte Rtl8192CUPHY_REG_1T_HPArray[Rtl8192CUPHY_REG_1T_HPArrayLength];
|
||||
#define Rtl8192CUPHY_REG_1T_mCardArrayLength 374
|
||||
extern u4Byte Rtl8192CUPHY_REG_1T_mCardArray[Rtl8192CUPHY_REG_1T_mCardArrayLength];
|
||||
#define Rtl8192CUPHY_REG_2T_mCardArrayLength 374
|
||||
extern u4Byte Rtl8192CUPHY_REG_2T_mCardArray[Rtl8192CUPHY_REG_2T_mCardArrayLength];
|
||||
#define Rtl8192CUPHY_REG_Array_PG_HPLength 336
|
||||
extern u4Byte Rtl8192CUPHY_REG_Array_PG_HP[Rtl8192CUPHY_REG_Array_PG_HPLength];
|
||||
#define Rtl8192CURadioA_2TArrayLength 282
|
||||
extern u4Byte Rtl8192CURadioA_2TArray[Rtl8192CURadioA_2TArrayLength];
|
||||
#define Rtl8192CURadioB_2TArrayLength 78
|
||||
extern u4Byte Rtl8192CURadioB_2TArray[Rtl8192CURadioB_2TArrayLength];
|
||||
#define Rtl8192CURadioA_1TArrayLength 282
|
||||
extern u4Byte Rtl8192CURadioA_1TArray[Rtl8192CURadioA_1TArrayLength];
|
||||
#define Rtl8192CURadioB_1TArrayLength 1
|
||||
extern u4Byte Rtl8192CURadioB_1TArray[Rtl8192CURadioB_1TArrayLength];
|
||||
#define Rtl8192CURadioA_2T_mCardArrayLength 282
|
||||
extern u4Byte Rtl8192CURadioA_2T_mCardArray[Rtl8192CURadioA_2T_mCardArrayLength];
|
||||
#define Rtl8192CURadioB_2T_mCardArrayLength 78
|
||||
extern u4Byte Rtl8192CURadioB_2T_mCardArray[Rtl8192CURadioB_2T_mCardArrayLength];
|
||||
#define Rtl8192CURadioA_1T_mCardArrayLength 282
|
||||
extern u32 Rtl8192CURadioA_1T_mCardArray[Rtl8192CURadioA_1T_mCardArrayLength];
|
||||
#define Rtl8192CURadioB_1T_mCardArrayLength 1
|
||||
extern u32 Rtl8192CURadioB_1T_mCardArray[Rtl8192CURadioB_1T_mCardArrayLength];
|
||||
#define Rtl8192CURadioA_1T_HPArrayLength 282
|
||||
extern u4Byte Rtl8192CURadioA_1T_HPArray[Rtl8192CURadioA_1T_HPArrayLength];
|
||||
#define Rtl8192CURadioB_GM_ArrayLength 1
|
||||
extern u4Byte Rtl8192CURadioB_GM_Array[Rtl8192CURadioB_GM_ArrayLength];
|
||||
#define Rtl8192CUMACPHY_Array_PGLength 1
|
||||
extern u4Byte Rtl8192CUMACPHY_Array_PG[Rtl8192CUMACPHY_Array_PGLength];
|
||||
#define Rtl8192CUAGCTAB_2TArrayLength 320
|
||||
extern u4Byte Rtl8192CUAGCTAB_2TArray[Rtl8192CUAGCTAB_2TArrayLength];
|
||||
#define Rtl8192CUAGCTAB_1TArrayLength 320
|
||||
extern u4Byte Rtl8192CUAGCTAB_1TArray[Rtl8192CUAGCTAB_1TArrayLength];
|
||||
#define Rtl8192CUAGCTAB_1T_HPArrayLength 320
|
||||
extern u4Byte Rtl8192CUAGCTAB_1T_HPArray[Rtl8192CUAGCTAB_1T_HPArrayLength];
|
||||
|
||||
|
||||
#endif //__INC_HAL8192CU_FW_IMG_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,80 +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 __RTL8192C_ODM_H__
|
||||
#define __RTL8192C_ODM_H__
|
||||
//============================================================
|
||||
// Description:
|
||||
//
|
||||
// This file is for 92CE/92CU dynamic mechanism only
|
||||
//
|
||||
//
|
||||
//============================================================
|
||||
|
||||
#define RSSI_CCK 0
|
||||
#define RSSI_OFDM 1
|
||||
#define RSSI_DEFAULT 2
|
||||
|
||||
#define IQK_MAC_REG_NUM 4
|
||||
#define IQK_ADDA_REG_NUM 16
|
||||
#define IQK_BB_REG_NUM 9
|
||||
#define HP_THERMAL_NUM 8
|
||||
|
||||
|
||||
//============================================================
|
||||
// structure and define
|
||||
//============================================================
|
||||
|
||||
|
||||
|
||||
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
//#define DM_MultiSTA_InitGainChangeNotify(Event) {DM_DigTable.CurMultiSTAConnectState = Event;}
|
||||
|
||||
|
||||
//============================================================
|
||||
// function prototype
|
||||
//============================================================
|
||||
|
||||
//
|
||||
// IQ calibrate
|
||||
//
|
||||
VOID rtl8192c_PHY_IQCalibrate( IN PADAPTER pAdapter , IN BOOLEAN bReCovery);
|
||||
|
||||
//
|
||||
// LC calibrate
|
||||
//
|
||||
VOID rtl8192c_PHY_LCCalibrate(IN PADAPTER pAdapter);
|
||||
|
||||
//
|
||||
// AP calibrate
|
||||
//
|
||||
VOID rtl8192c_PHY_APCalibrate(IN PADAPTER pAdapter, IN char delta);
|
||||
|
||||
VOID rtl8192c_odm_CheckTXPowerTracking(IN PADAPTER Adapter);
|
||||
|
||||
#ifdef CONFIG_ANTENNA_DIVERSITY
|
||||
void odm_AntDivCompare8192C(PADAPTER Adapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src);
|
||||
u8 odm_AntDivBeforeLink8192C(PADAPTER Adapter);
|
||||
#endif
|
||||
|
||||
#endif //__HAL8190PCIDM_H__
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,86 +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_RTL8192C_H__
|
||||
#define __ODM_RTL8192C_H__
|
||||
|
||||
|
||||
VOID
|
||||
odm_ResetFACounter_92C(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_MP)
|
||||
|
||||
|
||||
//
|
||||
// ==================================================
|
||||
// Tx power tracking relative code.
|
||||
// ==================================================
|
||||
//
|
||||
|
||||
VOID
|
||||
odm_TXPowerTrackingCallbackThermalMeter92C(
|
||||
IN PADAPTER Adapter
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
odm_TXPowerTrackingCallbackRXGainThermalMeter92D(
|
||||
IN PADAPTER Adapter
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_TXPowerTrackingDirectCall92C(
|
||||
IN PADAPTER Adapter
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_TXPowerTrackingDirectCall92C(
|
||||
IN PADAPTER Adapter
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_TXPowerTrackingCallback_ThermalMeter_92C(
|
||||
IN PADAPTER Adapter
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_TXPowerTrackingCallback_ThermalMeter_8723A(
|
||||
IN PADAPTER Adapter
|
||||
);
|
||||
|
||||
//
|
||||
// ==================================================
|
||||
// Tx power tracking relative code.
|
||||
// ==================================================
|
||||
//
|
||||
|
||||
void
|
||||
ODM_RF_Saving_8188E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte bForceInNormal
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,45 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
//============================================================
|
||||
// File Name: Hal8723Reg.h
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
// This file is for RTL8723 register definition.
|
||||
//
|
||||
//
|
||||
//============================================================
|
||||
#ifndef __HAL_8723_REG_H__
|
||||
#define __HAL_8723_REG_H__
|
||||
|
||||
//
|
||||
// Register Definition
|
||||
//
|
||||
#define ODM_R_A_AGC_CORE1_8723A 0xc50
|
||||
|
||||
|
||||
//
|
||||
// Bitmap Definition
|
||||
//
|
||||
#define BIT_FA_RESET_8723A BIT0
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,68 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __INC_HAL8723S_FW_IMG_H
|
||||
#define __INC_HAL8723S_FW_IMG_H
|
||||
|
||||
/*Created on 2013/02/26, 18:59*/
|
||||
|
||||
#define Rtl8723SUMCBCutMPImgArrayLength 24174
|
||||
|
||||
#define Rtl8723SUMCBCutImgArrayWithBTLength 24124
|
||||
#define Rtl8723SUMCBCutImgArrayWithoutBTLength 19200
|
||||
|
||||
#define Rtl8723SImgArrayLength 20606
|
||||
extern const u8 Rtl8723SFwImgArray[Rtl8723SImgArrayLength];
|
||||
#define Rtl8723SBTImgArrayLength 1
|
||||
extern const u8 Rtl8723SFwBTImgArray[Rtl8723SBTImgArrayLength];
|
||||
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
#define Rtl8723EBTImgArrayLength 16404
|
||||
extern u8 Rtl8723EFwBTImgArray[Rtl8723EBTImgArrayLength] ;
|
||||
extern const u8 Rtl8723SFwUMCBCutMPImgArray[Rtl8723SUMCBCutMPImgArrayLength];
|
||||
#endif //CONFIG_MP_INCLUDED
|
||||
|
||||
extern const u8 Rtl8723SFwUMCBCutImgArrayWithBT[Rtl8723SUMCBCutImgArrayWithBTLength];
|
||||
extern const u8 Rtl8723SFwUMCBCutImgArrayWithoutBT[Rtl8723SUMCBCutImgArrayWithoutBTLength];
|
||||
|
||||
#ifndef CONFIG_PHY_SETTING_WITH_ODM
|
||||
#define Rtl8723SPHY_REG_2TArrayLength 1
|
||||
extern const u32 Rtl8723SPHY_REG_2TArray[Rtl8723SPHY_REG_2TArrayLength];
|
||||
#define Rtl8723SPHY_REG_1TArrayLength 372
|
||||
extern const u32 Rtl8723SPHY_REG_1TArray[Rtl8723SPHY_REG_1TArrayLength];
|
||||
#define Rtl8723SPHY_ChangeTo_1T1RArrayLength 1
|
||||
extern const u32 Rtl8723SPHY_ChangeTo_1T1RArray[Rtl8723SPHY_ChangeTo_1T1RArrayLength];
|
||||
#define Rtl8723SPHY_ChangeTo_1T2RArrayLength 1
|
||||
extern const u32 Rtl8723SPHY_ChangeTo_1T2RArray[Rtl8723SPHY_ChangeTo_1T2RArrayLength];
|
||||
#define Rtl8723SPHY_ChangeTo_2T2RArrayLength 1
|
||||
extern const u32 Rtl8723SPHY_ChangeTo_2T2RArray[Rtl8723SPHY_ChangeTo_2T2RArrayLength];
|
||||
|
||||
|
||||
#define Rtl8723SRadioA_2TArrayLength 1
|
||||
extern const u32 Rtl8723SRadioA_2TArray[Rtl8723SRadioA_2TArrayLength];
|
||||
#define Rtl8723SRadioB_2TArrayLength 1
|
||||
extern const u32 Rtl8723SRadioB_2TArray[Rtl8723SRadioB_2TArrayLength];
|
||||
#define Rtl8723SRadioA_1TArrayLength 282
|
||||
extern const u32 Rtl8723SRadioA_1TArray[Rtl8723SRadioA_1TArrayLength];
|
||||
#define Rtl8723SRadioB_1TArrayLength 1
|
||||
extern const u32 Rtl8723SRadioB_1TArray[Rtl8723SRadioB_1TArrayLength];
|
||||
#define Rtl8723SRadioB_GM_ArrayLength 1
|
||||
extern const u32 Rtl8723SRadioB_GM_Array[Rtl8723SRadioB_GM_ArrayLength];
|
||||
#define Rtl8723SMAC_2T_ArrayLength 172
|
||||
extern const u32 Rtl8723SMAC_2T_Array[Rtl8723SMAC_2T_ArrayLength];
|
||||
#define Rtl8723SAGCTAB_2TArrayLength 1
|
||||
extern const u32 Rtl8723SAGCTAB_2TArray[Rtl8723SAGCTAB_2TArrayLength];
|
||||
#define Rtl8723SAGCTAB_1TArrayLength 320
|
||||
extern const u32 Rtl8723SAGCTAB_1TArray[Rtl8723SAGCTAB_1TArrayLength];
|
||||
#endif//#ifndef CONFIG_PHY_SETTING_WITH_ODM
|
||||
|
||||
#define Rtl8723SPHY_REG_Array_PGLength 336
|
||||
extern const u32 Rtl8723SPHY_REG_Array_PG[Rtl8723SPHY_REG_Array_PGLength];
|
||||
#define Rtl8723SMACPHY_Array_PGLength 1
|
||||
extern const u32 Rtl8723SMACPHY_Array_PG[Rtl8723SMACPHY_Array_PGLength];
|
||||
|
||||
#if MP_DRIVER == 1
|
||||
#define Rtl8723SPHY_REG_Array_MPLength 4
|
||||
extern const u32 Rtl8723SPHY_REG_Array_MP[Rtl8723SPHY_REG_Array_MPLength];
|
||||
#endif//#if MP_DRIVER == 1
|
||||
|
||||
#endif //#ifndef __INC_HAL8723S_FW_IMG_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,76 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef __INC_HAL8723U_FW_IMG_H
|
||||
#define __INC_HAL8723U_FW_IMG_H
|
||||
|
||||
/*Created on 2013/01/14, 15:51*/
|
||||
|
||||
//FW v16 enable usb interrupt
|
||||
#define Rtl8723UImgArrayLength 22172
|
||||
extern u8 Rtl8723UFwImgArray[Rtl8723UImgArrayLength];
|
||||
#define Rtl8723UBTImgArrayLength 1
|
||||
extern u8 Rtl8723UFwBTImgArray[Rtl8723UBTImgArrayLength];
|
||||
|
||||
#define Rtl8723UUMCBCutImgArrayWithBTLength 24124
|
||||
#define Rtl8723UUMCBCutImgArrayWithoutBTLength 19200
|
||||
|
||||
extern u8 Rtl8723UFwUMCBCutImgArrayWithBT[Rtl8723UUMCBCutImgArrayWithBTLength];
|
||||
extern u8 Rtl8723UFwUMCBCutImgArrayWithoutBT[Rtl8723UUMCBCutImgArrayWithoutBTLength];
|
||||
|
||||
#define Rtl8723SUMCBCutMPImgArrayLength 24174
|
||||
extern const u8 Rtl8723SFwUMCBCutMPImgArray[Rtl8723SUMCBCutMPImgArrayLength];
|
||||
|
||||
#define Rtl8723EBTImgArrayLength 16404
|
||||
extern u8 Rtl8723EFwBTImgArray[Rtl8723EBTImgArrayLength] ;
|
||||
|
||||
|
||||
#ifndef CONFIG_PHY_SETTING_WITH_ODM
|
||||
#define Rtl8723UPHY_REG_2TArrayLength 1
|
||||
extern u32 Rtl8723UPHY_REG_2TArray[Rtl8723UPHY_REG_2TArrayLength];
|
||||
#define Rtl8723UPHY_REG_1TArrayLength 372
|
||||
extern u32 Rtl8723UPHY_REG_1TArray[Rtl8723UPHY_REG_1TArrayLength];
|
||||
#define Rtl8723UPHY_ChangeTo_1T1RArrayLength 1
|
||||
extern u32 Rtl8723UPHY_ChangeTo_1T1RArray[Rtl8723UPHY_ChangeTo_1T1RArrayLength];
|
||||
#define Rtl8723UPHY_ChangeTo_1T2RArrayLength 1
|
||||
extern u32 Rtl8723UPHY_ChangeTo_1T2RArray[Rtl8723UPHY_ChangeTo_1T2RArrayLength];
|
||||
#define Rtl8723UPHY_ChangeTo_2T2RArrayLength 1
|
||||
extern u32 Rtl8723UPHY_ChangeTo_2T2RArray[Rtl8723UPHY_ChangeTo_2T2RArrayLength];
|
||||
|
||||
#define Rtl8723UPHY_REG_1T_mCardArrayLength 372
|
||||
extern u32 Rtl8723UPHY_REG_1T_mCardArray[Rtl8723UPHY_REG_1T_mCardArrayLength];
|
||||
#define Rtl8723UPHY_REG_1T_SDIOArrayLength 372
|
||||
extern u32 Rtl8723UPHY_REG_1T_SDIOArray[Rtl8723UPHY_REG_1T_SDIOArrayLength];
|
||||
#define Rtl8723URadioA_2TArrayLength 1
|
||||
extern u32 Rtl8723URadioA_2TArray[Rtl8723URadioA_2TArrayLength];
|
||||
#define Rtl8723URadioB_2TArrayLength 1
|
||||
extern u32 Rtl8723URadioB_2TArray[Rtl8723URadioB_2TArrayLength];
|
||||
#define Rtl8723URadioA_1TArrayLength 282
|
||||
extern u32 Rtl8723URadioA_1TArray[Rtl8723URadioA_1TArrayLength];
|
||||
#define Rtl8723URadioB_1TArrayLength 1
|
||||
extern u32 Rtl8723URadioB_1TArray[Rtl8723URadioB_1TArrayLength];
|
||||
#define Rtl8723URadioA_1T_mCardArrayLength 282
|
||||
extern u32 Rtl8723URadioA_1T_mCardArray[Rtl8723URadioA_1T_mCardArrayLength];
|
||||
#define Rtl8723URadioA_1T_SDIOArrayLength 282
|
||||
extern u32 Rtl8723URadioA_1T_SDIOArray[Rtl8723URadioA_1T_SDIOArrayLength];
|
||||
#define Rtl8723URadioB_GM_ArrayLength 1
|
||||
extern u32 Rtl8723URadioB_GM_Array[Rtl8723URadioB_GM_ArrayLength];
|
||||
#define Rtl8723UMAC_2T_ArrayLength 172
|
||||
extern u32 Rtl8723UMAC_2T_Array[Rtl8723UMAC_2T_ArrayLength];
|
||||
|
||||
#define Rtl8723UAGCTAB_2TArrayLength 1
|
||||
extern u32 Rtl8723UAGCTAB_2TArray[Rtl8723UAGCTAB_2TArrayLength];
|
||||
#define Rtl8723UAGCTAB_1TArrayLength 320
|
||||
extern u32 Rtl8723UAGCTAB_1TArray[Rtl8723UAGCTAB_1TArrayLength];
|
||||
#endif//#ifndef CONFIG_PHY_SETTING_WITH_ODM
|
||||
|
||||
#define Rtl8723UPHY_REG_Array_PGLength 336
|
||||
extern u32 Rtl8723UPHY_REG_Array_PG[Rtl8723UPHY_REG_Array_PGLength];
|
||||
#define Rtl8723UMACPHY_Array_PGLength 1
|
||||
extern u32 Rtl8723UMACPHY_Array_PG[Rtl8723UMACPHY_Array_PGLength];
|
||||
|
||||
#if MP_DRIVER == 1
|
||||
#define Rtl8723UPHY_REG_Array_MPLength 4
|
||||
extern u32 Rtl8723UPHY_REG_Array_MP[Rtl8723UPHY_REG_Array_MPLength];
|
||||
#endif //#if MP_DRIVER == 1
|
||||
|
||||
#endif //#ifndef __INC_HAL8723U_FW_IMG_H
|
||||
|
||||
|
|
@ -1,815 +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 "../odm_precomp.h"
|
||||
|
||||
#if (RTL8723A_SUPPORT == 1)
|
||||
static BOOLEAN
|
||||
CheckCondition(
|
||||
const u4Byte Condition,
|
||||
const u4Byte Hex
|
||||
)
|
||||
{
|
||||
u4Byte _board = (Hex & 0x000000FF);
|
||||
u4Byte _interface = (Hex & 0x0000FF00) >> 8;
|
||||
u4Byte _platform = (Hex & 0x00FF0000) >> 16;
|
||||
u4Byte cond = Condition;
|
||||
|
||||
if ( Condition == 0xCDCDCDCD )
|
||||
return TRUE;
|
||||
|
||||
cond = Condition & 0x000000FF;
|
||||
if ( (_board == cond) && cond != 0x00)
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x0000FF00;
|
||||
cond = cond >> 8;
|
||||
if ( (_interface & cond) == 0 && cond != 0x07)
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x00FF0000;
|
||||
cond = cond >> 16;
|
||||
if ( (_platform & cond) == 0 && cond != 0x0F)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* AGC_TAB_1T.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_AGC_TAB_1T_8723A[] = {
|
||||
0xC78, 0x7B000001,
|
||||
0xC78, 0x7B010001,
|
||||
0xC78, 0x7B020001,
|
||||
0xC78, 0x7B030001,
|
||||
0xC78, 0x7B040001,
|
||||
0xC78, 0x7B050001,
|
||||
0xC78, 0x7A060001,
|
||||
0xC78, 0x79070001,
|
||||
0xC78, 0x78080001,
|
||||
0xC78, 0x77090001,
|
||||
0xC78, 0x760A0001,
|
||||
0xC78, 0x750B0001,
|
||||
0xC78, 0x740C0001,
|
||||
0xC78, 0x730D0001,
|
||||
0xC78, 0x720E0001,
|
||||
0xC78, 0x710F0001,
|
||||
0xC78, 0x70100001,
|
||||
0xC78, 0x6F110001,
|
||||
0xC78, 0x6E120001,
|
||||
0xC78, 0x6D130001,
|
||||
0xC78, 0x6C140001,
|
||||
0xC78, 0x6B150001,
|
||||
0xC78, 0x6A160001,
|
||||
0xC78, 0x69170001,
|
||||
0xC78, 0x68180001,
|
||||
0xC78, 0x67190001,
|
||||
0xC78, 0x661A0001,
|
||||
0xC78, 0x651B0001,
|
||||
0xC78, 0x641C0001,
|
||||
0xC78, 0x631D0001,
|
||||
0xC78, 0x621E0001,
|
||||
0xC78, 0x611F0001,
|
||||
0xC78, 0x60200001,
|
||||
0xC78, 0x49210001,
|
||||
0xC78, 0x48220001,
|
||||
0xC78, 0x47230001,
|
||||
0xC78, 0x46240001,
|
||||
0xC78, 0x45250001,
|
||||
0xC78, 0x44260001,
|
||||
0xC78, 0x43270001,
|
||||
0xC78, 0x42280001,
|
||||
0xC78, 0x41290001,
|
||||
0xC78, 0x402A0001,
|
||||
0xC78, 0x262B0001,
|
||||
0xC78, 0x252C0001,
|
||||
0xC78, 0x242D0001,
|
||||
0xC78, 0x232E0001,
|
||||
0xC78, 0x222F0001,
|
||||
0xC78, 0x21300001,
|
||||
0xC78, 0x20310001,
|
||||
0xC78, 0x06320001,
|
||||
0xC78, 0x05330001,
|
||||
0xC78, 0x04340001,
|
||||
0xC78, 0x03350001,
|
||||
0xC78, 0x02360001,
|
||||
0xC78, 0x01370001,
|
||||
0xC78, 0x00380001,
|
||||
0xC78, 0x00390001,
|
||||
0xC78, 0x003A0001,
|
||||
0xC78, 0x003B0001,
|
||||
0xC78, 0x003C0001,
|
||||
0xC78, 0x003D0001,
|
||||
0xC78, 0x003E0001,
|
||||
0xC78, 0x003F0001,
|
||||
0xC78, 0x7B400001,
|
||||
0xC78, 0x7B410001,
|
||||
0xC78, 0x7B420001,
|
||||
0xC78, 0x7B430001,
|
||||
0xC78, 0x7B440001,
|
||||
0xC78, 0x7B450001,
|
||||
0xC78, 0x7A460001,
|
||||
0xC78, 0x79470001,
|
||||
0xC78, 0x78480001,
|
||||
0xC78, 0x77490001,
|
||||
0xC78, 0x764A0001,
|
||||
0xC78, 0x754B0001,
|
||||
0xC78, 0x744C0001,
|
||||
0xC78, 0x734D0001,
|
||||
0xC78, 0x724E0001,
|
||||
0xC78, 0x714F0001,
|
||||
0xC78, 0x70500001,
|
||||
0xC78, 0x6F510001,
|
||||
0xC78, 0x6E520001,
|
||||
0xC78, 0x6D530001,
|
||||
0xC78, 0x6C540001,
|
||||
0xC78, 0x6B550001,
|
||||
0xC78, 0x6A560001,
|
||||
0xC78, 0x69570001,
|
||||
0xC78, 0x68580001,
|
||||
0xC78, 0x67590001,
|
||||
0xC78, 0x665A0001,
|
||||
0xC78, 0x655B0001,
|
||||
0xC78, 0x645C0001,
|
||||
0xC78, 0x635D0001,
|
||||
0xC78, 0x625E0001,
|
||||
0xC78, 0x615F0001,
|
||||
0xC78, 0x60600001,
|
||||
0xC78, 0x49610001,
|
||||
0xC78, 0x48620001,
|
||||
0xC78, 0x47630001,
|
||||
0xC78, 0x46640001,
|
||||
0xC78, 0x45650001,
|
||||
0xC78, 0x44660001,
|
||||
0xC78, 0x43670001,
|
||||
0xC78, 0x42680001,
|
||||
0xC78, 0x41690001,
|
||||
0xC78, 0x406A0001,
|
||||
0xC78, 0x266B0001,
|
||||
0xC78, 0x256C0001,
|
||||
0xC78, 0x246D0001,
|
||||
0xC78, 0x236E0001,
|
||||
0xC78, 0x226F0001,
|
||||
0xC78, 0x21700001,
|
||||
0xC78, 0x20710001,
|
||||
0xC78, 0x06720001,
|
||||
0xC78, 0x05730001,
|
||||
0xC78, 0x04740001,
|
||||
0xC78, 0x03750001,
|
||||
0xC78, 0x02760001,
|
||||
0xC78, 0x01770001,
|
||||
0xC78, 0x00780001,
|
||||
0xC78, 0x00790001,
|
||||
0xC78, 0x007A0001,
|
||||
0xC78, 0x007B0001,
|
||||
0xC78, 0x007C0001,
|
||||
0xC78, 0x007D0001,
|
||||
0xC78, 0x007E0001,
|
||||
0xC78, 0x007F0001,
|
||||
0xC78, 0x3800001E,
|
||||
0xC78, 0x3801001E,
|
||||
0xC78, 0x3802001E,
|
||||
0xC78, 0x3803001E,
|
||||
0xC78, 0x3804001E,
|
||||
0xC78, 0x3805001E,
|
||||
0xC78, 0x3806001E,
|
||||
0xC78, 0x3807001E,
|
||||
0xC78, 0x3808001E,
|
||||
0xC78, 0x3C09001E,
|
||||
0xC78, 0x3E0A001E,
|
||||
0xC78, 0x400B001E,
|
||||
0xC78, 0x440C001E,
|
||||
0xC78, 0x480D001E,
|
||||
0xC78, 0x4C0E001E,
|
||||
0xC78, 0x500F001E,
|
||||
0xC78, 0x5210001E,
|
||||
0xC78, 0x5611001E,
|
||||
0xC78, 0x5A12001E,
|
||||
0xC78, 0x5E13001E,
|
||||
0xC78, 0x6014001E,
|
||||
0xC78, 0x6015001E,
|
||||
0xC78, 0x6016001E,
|
||||
0xC78, 0x6217001E,
|
||||
0xC78, 0x6218001E,
|
||||
0xC78, 0x6219001E,
|
||||
0xC78, 0x621A001E,
|
||||
0xC78, 0x621B001E,
|
||||
0xC78, 0x621C001E,
|
||||
0xC78, 0x621D001E,
|
||||
0xC78, 0x621E001E,
|
||||
0xC78, 0x621F001E,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_AGC_TAB_1T_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
|
||||
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte interfaceValue = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_AGC_TAB_1T_8723A)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_AGC_TAB_1T_8723A;
|
||||
|
||||
|
||||
hex += board;
|
||||
hex += interfaceValue << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
for (i = 0; i < ArrayLen; i += 2 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
|
||||
// This (offset, data) pair meets the condition.
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigBB_AGC_8723A(pDM_Odm, v1, bMaskDWord, v2);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // This line is the start line of branch.
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // Discard the following (offset, data) pairs.
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
i -= 2; // prevent from for-loop += 2
|
||||
}
|
||||
else // Configure matched pairs and skip to end of if-else.
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
odm_ConfigBB_AGC_8723A(pDM_Odm, v1, bMaskDWord, v2);
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG_1T.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_PHY_REG_1T_8723A[] = {
|
||||
0x800, 0x80040000,
|
||||
0x804, 0x00000003,
|
||||
0x808, 0x0000FC00,
|
||||
0x80C, 0x0000000A,
|
||||
0x810, 0x10001331,
|
||||
0x814, 0x020C3D10,
|
||||
0x818, 0x02200385,
|
||||
0x81C, 0x00000000,
|
||||
0x820, 0x01000100,
|
||||
0x824, 0x00390004,
|
||||
0x828, 0x00000000,
|
||||
0x82C, 0x00000000,
|
||||
0x830, 0x00000000,
|
||||
0x834, 0x00000000,
|
||||
0x838, 0x00000000,
|
||||
0x83C, 0x00000000,
|
||||
0x840, 0x00010000,
|
||||
0x844, 0x00000000,
|
||||
0x848, 0x00000000,
|
||||
0x84C, 0x00000000,
|
||||
0x850, 0x00000000,
|
||||
0x854, 0x00000000,
|
||||
0x858, 0x569A569A,
|
||||
0x85C, 0x001B25A4,
|
||||
0x860, 0x66F60110,
|
||||
0x864, 0x061F0130,
|
||||
0x868, 0x00000000,
|
||||
0x86C, 0x32323200,
|
||||
0x870, 0x07000760,
|
||||
0x874, 0x22004000,
|
||||
0x878, 0x00000808,
|
||||
0x87C, 0x00000000,
|
||||
0x880, 0xC0083070,
|
||||
0x884, 0x000004D5,
|
||||
0x888, 0x00000000,
|
||||
0x88C, 0xCCC000C0,
|
||||
0x890, 0x00000800,
|
||||
0x894, 0xFFFFFFFE,
|
||||
0x898, 0x40302010,
|
||||
0x89C, 0x00706050,
|
||||
0x900, 0x00000000,
|
||||
0x904, 0x00000023,
|
||||
0x908, 0x00000000,
|
||||
0x90C, 0x81121111,
|
||||
0xA00, 0x00D047C8,
|
||||
0xA04, 0x80FF000C,
|
||||
0xA08, 0x8C838300,
|
||||
0xA0C, 0x2E68120F,
|
||||
0xA10, 0x9500BB78,
|
||||
0xA14, 0x11144028,
|
||||
0xA18, 0x00881117,
|
||||
0xA1C, 0x89140F00,
|
||||
0xA20, 0x1A1B0000,
|
||||
0xA24, 0x090E1317,
|
||||
0xA28, 0x00000204,
|
||||
0xA2C, 0x00D30000,
|
||||
0xA70, 0x101FBF00,
|
||||
0xA74, 0x00000007,
|
||||
0xA78, 0x00000900,
|
||||
0xC00, 0x48071D40,
|
||||
0xC04, 0x03A05611,
|
||||
0xC08, 0x000000E4,
|
||||
0xC0C, 0x6C6C6C6C,
|
||||
0xC10, 0x08800000,
|
||||
0xC14, 0x40000100,
|
||||
0xC18, 0x08800000,
|
||||
0xC1C, 0x40000100,
|
||||
0xC20, 0x00000000,
|
||||
0xC24, 0x00000000,
|
||||
0xC28, 0x00000000,
|
||||
0xC2C, 0x00000000,
|
||||
0xC30, 0x69E9AC44,
|
||||
0xFF0F011F, 0xABCD,
|
||||
0xC34, 0x469652CF,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0xC34, 0x469652AF,
|
||||
0xFF0F011F, 0xDEAD,
|
||||
0xC38, 0x49795994,
|
||||
0xC3C, 0x0A97971C,
|
||||
0xC40, 0x1F7C403F,
|
||||
0xC44, 0x000100B7,
|
||||
0xC48, 0xEC020107,
|
||||
0xC4C, 0x007F037F,
|
||||
0xC50, 0x69543420,
|
||||
0xC54, 0x43BC0094,
|
||||
0xC58, 0x69543420,
|
||||
0xC5C, 0x433C0094,
|
||||
0xC60, 0x00000000,
|
||||
0xFF0F011F, 0xABCD,
|
||||
0xC64, 0x7116848B,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0xC64, 0x7112848B,
|
||||
0xFF0F011F, 0xDEAD,
|
||||
0xC68, 0x47C00BFF,
|
||||
0xC6C, 0x00000036,
|
||||
0xC70, 0x2C7F000D,
|
||||
0xC74, 0x018610DB,
|
||||
0xC78, 0x0000001F,
|
||||
0xC7C, 0x00B91612,
|
||||
0xC80, 0x40000100,
|
||||
0xC84, 0x20F60000,
|
||||
0xC88, 0x40000100,
|
||||
0xC8C, 0x20200000,
|
||||
0xC90, 0x00121820,
|
||||
0xC94, 0x00000000,
|
||||
0xC98, 0x00121820,
|
||||
0xC9C, 0x00007F7F,
|
||||
0xCA0, 0x00000000,
|
||||
0xCA4, 0x00000080,
|
||||
0xCA8, 0x00000000,
|
||||
0xCAC, 0x00000000,
|
||||
0xCB0, 0x00000000,
|
||||
0xCB4, 0x00000000,
|
||||
0xCB8, 0x00000000,
|
||||
0xCBC, 0x28000000,
|
||||
0xCC0, 0x00000000,
|
||||
0xCC4, 0x00000000,
|
||||
0xCC8, 0x00000000,
|
||||
0xCCC, 0x00000000,
|
||||
0xCD0, 0x00000000,
|
||||
0xCD4, 0x00000000,
|
||||
0xCD8, 0x64B22427,
|
||||
0xCDC, 0x00766932,
|
||||
0xCE0, 0x00222222,
|
||||
0xCE4, 0x00000000,
|
||||
0xCE8, 0x37644302,
|
||||
0xCEC, 0x2F97D40C,
|
||||
0xD00, 0x00080740,
|
||||
0xD04, 0x00020401,
|
||||
0xD08, 0x0000907F,
|
||||
0xD0C, 0x20010201,
|
||||
0xD10, 0xA0633333,
|
||||
0xD14, 0x3333BC43,
|
||||
0xD18, 0x7A8F5B6B,
|
||||
0xD2C, 0xCC979975,
|
||||
0xD30, 0x00000000,
|
||||
0xD34, 0x80608000,
|
||||
0xD38, 0x00000000,
|
||||
0xD3C, 0x00027293,
|
||||
0xD40, 0x00000000,
|
||||
0xD44, 0x00000000,
|
||||
0xD48, 0x00000000,
|
||||
0xD4C, 0x00000000,
|
||||
0xD50, 0x6437140A,
|
||||
0xD54, 0x00000000,
|
||||
0xD58, 0x00000000,
|
||||
0xD5C, 0x30032064,
|
||||
0xD60, 0x4653DE68,
|
||||
0xD64, 0x04518A3C,
|
||||
0xD68, 0x00002101,
|
||||
0xD6C, 0x2A201C16,
|
||||
0xD70, 0x1812362E,
|
||||
0xD74, 0x322C2220,
|
||||
0xD78, 0x000E3C24,
|
||||
0xE00, 0x2A2A2A2A,
|
||||
0xE04, 0x2A2A2A2A,
|
||||
0xE08, 0x03902A2A,
|
||||
0xE10, 0x2A2A2A2A,
|
||||
0xE14, 0x2A2A2A2A,
|
||||
0xE18, 0x2A2A2A2A,
|
||||
0xE1C, 0x2A2A2A2A,
|
||||
0xE28, 0x00000000,
|
||||
0xE30, 0x1000DC1F,
|
||||
0xE34, 0x10008C1F,
|
||||
0xE38, 0x02140102,
|
||||
0xE3C, 0x681604C2,
|
||||
0xE40, 0x01007C00,
|
||||
0xE44, 0x01004800,
|
||||
0xE48, 0xFB000000,
|
||||
0xE4C, 0x000028D1,
|
||||
0xE50, 0x1000DC1F,
|
||||
0xE54, 0x10008C1F,
|
||||
0xE58, 0x02140102,
|
||||
0xE5C, 0x28160D05,
|
||||
0xE60, 0x00000008,
|
||||
0xE68, 0x001B25A4,
|
||||
0xE6C, 0x631B25A0,
|
||||
0xE70, 0x631B25A0,
|
||||
0xE74, 0x081B25A0,
|
||||
0xE78, 0x081B25A0,
|
||||
0xE7C, 0x081B25A0,
|
||||
0xE80, 0x081B25A0,
|
||||
0xE84, 0x631B25A0,
|
||||
0xE88, 0x081B25A0,
|
||||
0xE8C, 0x631B25A0,
|
||||
0xED0, 0x631B25A0,
|
||||
0xED4, 0x631B25A0,
|
||||
0xED8, 0x631B25A0,
|
||||
0xEDC, 0x001B25A0,
|
||||
0xEE0, 0x001B25A0,
|
||||
0xEEC, 0x6B1B25A0,
|
||||
0xF14, 0x00000003,
|
||||
0xF4C, 0x00000000,
|
||||
0xF00, 0x00000300,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_PHY_REG_1T_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
|
||||
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte interfaceValue = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_PHY_REG_1T_8723A)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_PHY_REG_1T_8723A;
|
||||
|
||||
|
||||
hex += board;
|
||||
hex += interfaceValue << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
for (i = 0; i < ArrayLen; i += 2 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
|
||||
// This (offset, data) pair meets the condition.
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigBB_PHY_8723A(pDM_Odm, v1, bMaskDWord, v2);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // This line is the start line of branch.
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // Discard the following (offset, data) pairs.
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
i -= 2; // prevent from for-loop += 2
|
||||
}
|
||||
else // Configure matched pairs and skip to end of if-else.
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
odm_ConfigBB_PHY_8723A(pDM_Odm, v1, bMaskDWord, v2);
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG_MP.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_PHY_REG_MP_8723A[] = {
|
||||
0xC30, 0x69E9AC4A,
|
||||
0xC3C, 0x0A979718,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_PHY_REG_MP_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
|
||||
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte interfaceValue = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_PHY_REG_MP_8723A)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_PHY_REG_MP_8723A;
|
||||
|
||||
|
||||
hex += board;
|
||||
hex += interfaceValue << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
for (i = 0; i < ArrayLen; i += 2 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
|
||||
// This (offset, data) pair meets the condition.
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigBB_PHY_8723A(pDM_Odm, v1, bMaskDWord, v2);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // This line is the start line of branch.
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // Discard the following (offset, data) pairs.
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
i -= 2; // prevent from for-loop += 2
|
||||
}
|
||||
else // Configure matched pairs and skip to end of if-else.
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
odm_ConfigBB_PHY_8723A(pDM_Odm, v1, bMaskDWord, v2);
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG_PG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_PHY_REG_PG_8723A[] = {
|
||||
0xE00, 0xFFFFFFFF, 0x0A0C0C0C,
|
||||
0xE04, 0xFFFFFFFF, 0x02040608,
|
||||
0xE08, 0x0000FF00, 0x00000000,
|
||||
0x86C, 0xFFFFFF00, 0x00000000,
|
||||
0xE10, 0xFFFFFFFF, 0x0A0C0D0E,
|
||||
0xE14, 0xFFFFFFFF, 0x02040608,
|
||||
0xE18, 0xFFFFFFFF, 0x0A0C0D0E,
|
||||
0xE1C, 0xFFFFFFFF, 0x02040608,
|
||||
0x830, 0xFFFFFFFF, 0x0A0C0C0C,
|
||||
0x834, 0xFFFFFFFF, 0x02040608,
|
||||
0x838, 0xFFFFFF00, 0x00000000,
|
||||
0x86C, 0x000000FF, 0x00000000,
|
||||
0x83C, 0xFFFFFFFF, 0x0A0C0D0E,
|
||||
0x848, 0xFFFFFFFF, 0x02040608,
|
||||
0x84C, 0xFFFFFFFF, 0x0A0C0D0E,
|
||||
0x868, 0xFFFFFFFF, 0x02040608,
|
||||
0xE00, 0xFFFFFFFF, 0x00000000,
|
||||
0xE04, 0xFFFFFFFF, 0x00000000,
|
||||
0xE08, 0x0000FF00, 0x00000000,
|
||||
0x86C, 0xFFFFFF00, 0x00000000,
|
||||
0xE10, 0xFFFFFFFF, 0x00000000,
|
||||
0xE14, 0xFFFFFFFF, 0x00000000,
|
||||
0xE18, 0xFFFFFFFF, 0x00000000,
|
||||
0xE1C, 0xFFFFFFFF, 0x00000000,
|
||||
0x830, 0xFFFFFFFF, 0x00000000,
|
||||
0x834, 0xFFFFFFFF, 0x00000000,
|
||||
0x838, 0xFFFFFF00, 0x00000000,
|
||||
0x86C, 0x000000FF, 0x00000000,
|
||||
0x83C, 0xFFFFFFFF, 0x00000000,
|
||||
0x848, 0xFFFFFFFF, 0x00000000,
|
||||
0x84C, 0xFFFFFFFF, 0x00000000,
|
||||
0x868, 0xFFFFFFFF, 0x00000000,
|
||||
0xE00, 0xFFFFFFFF, 0x04040404,
|
||||
0xE04, 0xFFFFFFFF, 0x00020204,
|
||||
0xE08, 0x0000FF00, 0x00000000,
|
||||
0x86C, 0xFFFFFF00, 0x00000000,
|
||||
0xE10, 0xFFFFFFFF, 0x06060606,
|
||||
0xE14, 0xFFFFFFFF, 0x00020406,
|
||||
0xE18, 0xFFFFFFFF, 0x00000000,
|
||||
0xE1C, 0xFFFFFFFF, 0x00000000,
|
||||
0x830, 0xFFFFFFFF, 0x04040404,
|
||||
0x834, 0xFFFFFFFF, 0x00020204,
|
||||
0x838, 0xFFFFFF00, 0x00000000,
|
||||
0x86C, 0x000000FF, 0x00000000,
|
||||
0x83C, 0xFFFFFFFF, 0x06060606,
|
||||
0x848, 0xFFFFFFFF, 0x00020406,
|
||||
0x84C, 0xFFFFFFFF, 0x00000000,
|
||||
0x868, 0xFFFFFFFF, 0x00000000,
|
||||
0xE00, 0xFFFFFFFF, 0x00000000,
|
||||
0xE04, 0xFFFFFFFF, 0x00000000,
|
||||
0xE08, 0x0000FF00, 0x00000000,
|
||||
0x86C, 0xFFFFFF00, 0x00000000,
|
||||
0xE10, 0xFFFFFFFF, 0x00000000,
|
||||
0xE14, 0xFFFFFFFF, 0x00000000,
|
||||
0xE18, 0xFFFFFFFF, 0x00000000,
|
||||
0xE1C, 0xFFFFFFFF, 0x00000000,
|
||||
0x830, 0xFFFFFFFF, 0x00000000,
|
||||
0x834, 0xFFFFFFFF, 0x00000000,
|
||||
0x838, 0xFFFFFF00, 0x00000000,
|
||||
0x86C, 0x000000FF, 0x00000000,
|
||||
0x83C, 0xFFFFFFFF, 0x00000000,
|
||||
0x848, 0xFFFFFFFF, 0x00000000,
|
||||
0x84C, 0xFFFFFFFF, 0x00000000,
|
||||
0x868, 0xFFFFFFFF, 0x00000000,
|
||||
0xE00, 0xFFFFFFFF, 0x00000000,
|
||||
0xE04, 0xFFFFFFFF, 0x00000000,
|
||||
0xE08, 0x0000FF00, 0x00000000,
|
||||
0x86C, 0xFFFFFF00, 0x00000000,
|
||||
0xE10, 0xFFFFFFFF, 0x00000000,
|
||||
0xE14, 0xFFFFFFFF, 0x00000000,
|
||||
0xE18, 0xFFFFFFFF, 0x00000000,
|
||||
0xE1C, 0xFFFFFFFF, 0x00000000,
|
||||
0x830, 0xFFFFFFFF, 0x00000000,
|
||||
0x834, 0xFFFFFFFF, 0x00000000,
|
||||
0x838, 0xFFFFFF00, 0x00000000,
|
||||
0x86C, 0x000000FF, 0x00000000,
|
||||
0x83C, 0xFFFFFFFF, 0x00000000,
|
||||
0x848, 0xFFFFFFFF, 0x00000000,
|
||||
0x84C, 0xFFFFFFFF, 0x00000000,
|
||||
0x868, 0xFFFFFFFF, 0x00000000,
|
||||
0xE00, 0xFFFFFFFF, 0x04040404,
|
||||
0xE04, 0xFFFFFFFF, 0x00020204,
|
||||
0xE08, 0x0000FF00, 0x00000000,
|
||||
0x86C, 0xFFFFFF00, 0x00000000,
|
||||
0xE10, 0xFFFFFFFF, 0x00000000,
|
||||
0xE14, 0xFFFFFFFF, 0x00000000,
|
||||
0xE18, 0xFFFFFFFF, 0x00000000,
|
||||
0xE1C, 0xFFFFFFFF, 0x00000000,
|
||||
0x830, 0xFFFFFFFF, 0x04040404,
|
||||
0x834, 0xFFFFFFFF, 0x00020204,
|
||||
0x838, 0xFFFFFF00, 0x00000000,
|
||||
0x86C, 0x000000FF, 0x00000000,
|
||||
0x83C, 0xFFFFFFFF, 0x00000000,
|
||||
0x848, 0xFFFFFFFF, 0x00000000,
|
||||
0x84C, 0xFFFFFFFF, 0x00000000,
|
||||
0x868, 0xFFFFFFFF, 0x00000000,
|
||||
0xE00, 0xFFFFFFFF, 0x00000000,
|
||||
0xE04, 0xFFFFFFFF, 0x00000000,
|
||||
0xE08, 0x0000FF00, 0x00000000,
|
||||
0x86C, 0xFFFFFF00, 0x00000000,
|
||||
0xE10, 0xFFFFFFFF, 0x00000000,
|
||||
0xE14, 0xFFFFFFFF, 0x00000000,
|
||||
0xE18, 0xFFFFFFFF, 0x00000000,
|
||||
0xE1C, 0xFFFFFFFF, 0x00000000,
|
||||
0x830, 0xFFFFFFFF, 0x00000000,
|
||||
0x834, 0xFFFFFFFF, 0x00000000,
|
||||
0x838, 0xFFFFFF00, 0x00000000,
|
||||
0x86C, 0x000000FF, 0x00000000,
|
||||
0x83C, 0xFFFFFFFF, 0x00000000,
|
||||
0x848, 0xFFFFFFFF, 0x00000000,
|
||||
0x84C, 0xFFFFFFFF, 0x00000000,
|
||||
0x868, 0xFFFFFFFF, 0x00000000,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_PHY_REG_PG_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte interfaceValue = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_PHY_REG_PG_8723A)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_PHY_REG_PG_8723A;
|
||||
|
||||
hex += board;
|
||||
hex += interfaceValue << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
for (i = 0; i < ArrayLen; i += 3 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
u4Byte v3 = Array[i+2];
|
||||
|
||||
// this line is a line of pure_body
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigBB_PHY_REG_PG_8723A(pDM_Odm, v1, v2, v3);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // this line is the start of branch
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // don't need the hw_body
|
||||
i += 2; // skip the pair of expression
|
||||
v1 = Array[i];
|
||||
v2 = Array[i+1];
|
||||
v3 = Array[i+2];
|
||||
while (v2 != 0xDEAD)
|
||||
{
|
||||
i += 3;
|
||||
v1 = Array[i];
|
||||
v2 = Array[i+1];
|
||||
v3 = Array[i+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
||||
|
|
@ -1,63 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#if (RTL8723A_SUPPORT == 1)
|
||||
#ifndef __INC_BB_8723A_HW_IMG_H
|
||||
#define __INC_BB_8723A_HW_IMG_H
|
||||
|
||||
/******************************************************************************
|
||||
* AGC_TAB_1T.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_AGC_TAB_1T_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG_1T.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_PHY_REG_1T_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG_MP.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_PHY_REG_MP_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG_PG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_PHY_REG_PG_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,39 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#if (RTL8723A_SUPPORT == 1)
|
||||
#ifndef __INC_FW_8723A_HW_IMG_H
|
||||
#define __INC_FW_8723A_HW_IMG_H
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* rtl8723fw_B.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadFirmware_8723A_rtl8723fw_B(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT u1Byte *pFirmware,
|
||||
OUT u4Byte *pFirmwareSize
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
||||
|
|
@ -1,219 +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 "../odm_precomp.h"
|
||||
|
||||
#if (RTL8723A_SUPPORT == 1)
|
||||
static BOOLEAN
|
||||
CheckCondition(
|
||||
const u4Byte Condition,
|
||||
const u4Byte Hex
|
||||
)
|
||||
{
|
||||
u4Byte _board = (Hex & 0x000000FF);
|
||||
u4Byte _interface = (Hex & 0x0000FF00) >> 8;
|
||||
u4Byte _platform = (Hex & 0x00FF0000) >> 16;
|
||||
u4Byte cond = Condition;
|
||||
|
||||
if ( Condition == 0xCDCDCDCD )
|
||||
return TRUE;
|
||||
|
||||
cond = Condition & 0x000000FF;
|
||||
if ( (_board == cond) && cond != 0x00)
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x0000FF00;
|
||||
cond = cond >> 8;
|
||||
if ( (_interface & cond) == 0 && cond != 0x07)
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x00FF0000;
|
||||
cond = cond >> 16;
|
||||
if ( (_platform & cond) == 0 && cond != 0x0F)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* MAC_REG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_MAC_REG_8723A[] = {
|
||||
0x420, 0x00000080,
|
||||
0x423, 0x00000000,
|
||||
0x430, 0x00000000,
|
||||
0x431, 0x00000000,
|
||||
0x432, 0x00000000,
|
||||
0x433, 0x00000001,
|
||||
0x434, 0x00000004,
|
||||
0x435, 0x00000005,
|
||||
0x436, 0x00000006,
|
||||
0x437, 0x00000007,
|
||||
0x438, 0x00000000,
|
||||
0x439, 0x00000000,
|
||||
0x43A, 0x00000000,
|
||||
0x43B, 0x00000001,
|
||||
0x43C, 0x00000004,
|
||||
0x43D, 0x00000005,
|
||||
0x43E, 0x00000006,
|
||||
0x43F, 0x00000007,
|
||||
0x440, 0x0000005D,
|
||||
0x441, 0x00000001,
|
||||
0x442, 0x00000000,
|
||||
0x444, 0x00000015,
|
||||
0x445, 0x000000F0,
|
||||
0x446, 0x0000000F,
|
||||
0x447, 0x00000000,
|
||||
0x458, 0x00000041,
|
||||
0x459, 0x000000A8,
|
||||
0x45A, 0x00000072,
|
||||
0x45B, 0x000000B9,
|
||||
0x460, 0x00000066,
|
||||
0x461, 0x00000066,
|
||||
0x462, 0x00000008,
|
||||
0x463, 0x00000003,
|
||||
0x4C8, 0x000000FF,
|
||||
0x4C9, 0x00000008,
|
||||
0x4CC, 0x000000FF,
|
||||
0x4CD, 0x000000FF,
|
||||
0x4CE, 0x00000001,
|
||||
0x500, 0x00000026,
|
||||
0x501, 0x000000A2,
|
||||
0x502, 0x0000002F,
|
||||
0x503, 0x00000000,
|
||||
0x504, 0x00000028,
|
||||
0x505, 0x000000A3,
|
||||
0x506, 0x0000005E,
|
||||
0x507, 0x00000000,
|
||||
0x508, 0x0000002B,
|
||||
0x509, 0x000000A4,
|
||||
0x50A, 0x0000005E,
|
||||
0x50B, 0x00000000,
|
||||
0x50C, 0x0000004F,
|
||||
0x50D, 0x000000A4,
|
||||
0x50E, 0x00000000,
|
||||
0x50F, 0x00000000,
|
||||
0x512, 0x0000001C,
|
||||
0x514, 0x0000000A,
|
||||
0x515, 0x00000010,
|
||||
0x516, 0x0000000A,
|
||||
0x517, 0x00000010,
|
||||
0x51A, 0x00000016,
|
||||
0x524, 0x0000000F,
|
||||
0x525, 0x0000004F,
|
||||
0x546, 0x00000040,
|
||||
0x547, 0x00000000,
|
||||
0x550, 0x00000010,
|
||||
0x551, 0x00000010,
|
||||
0x559, 0x00000002,
|
||||
0x55A, 0x00000002,
|
||||
0x55D, 0x000000FF,
|
||||
0x605, 0x00000030,
|
||||
0x608, 0x0000000E,
|
||||
0x609, 0x0000002A,
|
||||
0x652, 0x00000020,
|
||||
0x63C, 0x0000000A,
|
||||
0x63D, 0x0000000A,
|
||||
0x63E, 0x0000000E,
|
||||
0x63F, 0x0000000E,
|
||||
0x66E, 0x00000005,
|
||||
0x700, 0x00000021,
|
||||
0x701, 0x00000043,
|
||||
0x702, 0x00000065,
|
||||
0x703, 0x00000087,
|
||||
0x708, 0x00000021,
|
||||
0x709, 0x00000043,
|
||||
0x70A, 0x00000065,
|
||||
0x70B, 0x00000087,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MAC_REG_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
|
||||
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte interfaceValue = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_MAC_REG_8723A)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_MAC_REG_8723A;
|
||||
|
||||
|
||||
hex += board;
|
||||
hex += interfaceValue << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
for (i = 0; i < ArrayLen; i += 2 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
|
||||
// This (offset, data) pair meets the condition.
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigMAC_8723A(pDM_Odm, v1, (u1Byte)v2);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // This line is the start line of branch.
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // Discard the following (offset, data) pairs.
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
i -= 2; // prevent from for-loop += 2
|
||||
}
|
||||
else // Configure matched pairs and skip to end of if-else.
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
odm_ConfigMAC_8723A(pDM_Odm, v1, (u1Byte)v2);
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
||||
|
|
@ -1,36 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#if (RTL8723A_SUPPORT == 1)
|
||||
#ifndef __INC_MAC_8723A_HW_IMG_H
|
||||
#define __INC_MAC_8723A_HW_IMG_H
|
||||
|
||||
/******************************************************************************
|
||||
* MAC_REG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MAC_REG_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
||||
|
|
@ -1,290 +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 "../odm_precomp.h"
|
||||
|
||||
#if (RTL8723A_SUPPORT == 1)
|
||||
static BOOLEAN
|
||||
CheckCondition(
|
||||
const u4Byte Condition,
|
||||
const u4Byte Hex
|
||||
)
|
||||
{
|
||||
u4Byte _board = (Hex & 0x000000FF);
|
||||
u4Byte _interface = (Hex & 0x0000FF00) >> 8;
|
||||
u4Byte _platform = (Hex & 0x00FF0000) >> 16;
|
||||
u4Byte cond = Condition;
|
||||
|
||||
if ( Condition == 0xCDCDCDCD )
|
||||
return TRUE;
|
||||
|
||||
cond = Condition & 0x000000FF;
|
||||
if ( (_board == cond) && cond != 0x00)
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x0000FF00;
|
||||
cond = cond >> 8;
|
||||
if ( (_interface & cond) == 0 && cond != 0x07)
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x00FF0000;
|
||||
cond = cond >> 16;
|
||||
if ( (_platform & cond) == 0 && cond != 0x0F)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* RadioA_1T.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_RadioA_1T_8723A[] = {
|
||||
0x000, 0x00030159,
|
||||
0x001, 0x00031284,
|
||||
0x002, 0x00098000,
|
||||
0xFF0F011F, 0xABCD,
|
||||
0x003, 0x00018C63,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0x003, 0x00039C63,
|
||||
0xFF0F011F, 0xDEAD,
|
||||
0x004, 0x000210E7,
|
||||
0x009, 0x0002044F,
|
||||
0x00A, 0x0001A3F1,
|
||||
0x00B, 0x00014787,
|
||||
0x00C, 0x000896FE,
|
||||
0x00D, 0x0000E02C,
|
||||
0x00E, 0x00039CE7,
|
||||
0x00F, 0x00000451,
|
||||
0x019, 0x00000000,
|
||||
0x01A, 0x00030355,
|
||||
0x01B, 0x00060A00,
|
||||
0x01C, 0x000FC378,
|
||||
0x01D, 0x000A1250,
|
||||
0x01E, 0x0000024F,
|
||||
0x01F, 0x00000000,
|
||||
0x020, 0x0000B614,
|
||||
0x021, 0x0006C000,
|
||||
0x022, 0x00000000,
|
||||
0x023, 0x00001558,
|
||||
0x024, 0x00000060,
|
||||
0x025, 0x00000483,
|
||||
0x026, 0x0004F000,
|
||||
0x027, 0x000EC7D9,
|
||||
0x028, 0x00057730,
|
||||
0x029, 0x00004783,
|
||||
0x02A, 0x00000001,
|
||||
0x02B, 0x00021334,
|
||||
0x02A, 0x00000000,
|
||||
0x02B, 0x00000054,
|
||||
0x02A, 0x00000001,
|
||||
0x02B, 0x00000808,
|
||||
0x02B, 0x00053333,
|
||||
0x02C, 0x0000000C,
|
||||
0x02A, 0x00000002,
|
||||
0x02B, 0x00000808,
|
||||
0x02B, 0x0005B333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x00000003,
|
||||
0x02B, 0x00000808,
|
||||
0x02B, 0x00063333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x00000004,
|
||||
0x02B, 0x00000808,
|
||||
0x02B, 0x0006B333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x00000005,
|
||||
0x02B, 0x00000808,
|
||||
0x02B, 0x00073333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x00000006,
|
||||
0x02B, 0x00000709,
|
||||
0x02B, 0x0005B333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x00000007,
|
||||
0x02B, 0x00000709,
|
||||
0x02B, 0x00063333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x00000008,
|
||||
0x02B, 0x0000060A,
|
||||
0x02B, 0x0004B333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x00000009,
|
||||
0x02B, 0x0000060A,
|
||||
0x02B, 0x00053333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x0000000A,
|
||||
0x02B, 0x0000060A,
|
||||
0x02B, 0x0005B333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x0000000B,
|
||||
0x02B, 0x0000060A,
|
||||
0x02B, 0x00063333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x0000000C,
|
||||
0x02B, 0x0000060A,
|
||||
0x02B, 0x0006B333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x0000000D,
|
||||
0x02B, 0x0000060A,
|
||||
0x02B, 0x00073333,
|
||||
0x02C, 0x0000000D,
|
||||
0x02A, 0x0000000E,
|
||||
0x02B, 0x0000050B,
|
||||
0x02B, 0x00066666,
|
||||
0x02C, 0x0000001A,
|
||||
0x02A, 0x000E0000,
|
||||
0x010, 0x0004000F,
|
||||
0x011, 0x000E31FC,
|
||||
0x010, 0x0006000F,
|
||||
0x011, 0x000FF9F8,
|
||||
0x010, 0x0002000F,
|
||||
0x011, 0x000203F9,
|
||||
0x010, 0x0003000F,
|
||||
0x011, 0x000FF500,
|
||||
0x010, 0x00000000,
|
||||
0x011, 0x00000000,
|
||||
0x010, 0x0008000F,
|
||||
0x011, 0x0003F100,
|
||||
0x010, 0x0009000F,
|
||||
0x011, 0x00023100,
|
||||
0x012, 0x00032000,
|
||||
0x012, 0x00071000,
|
||||
0x012, 0x000B0000,
|
||||
0x012, 0x000FC000,
|
||||
0x013, 0x000287B3,
|
||||
0x013, 0x000244B7,
|
||||
0x013, 0x000204AB,
|
||||
0x013, 0x0001C49F,
|
||||
0x013, 0x00018493,
|
||||
0x013, 0x0001429B,
|
||||
0x013, 0x00010299,
|
||||
0x013, 0x0000C29C,
|
||||
0x013, 0x000081A0,
|
||||
0x013, 0x000040AC,
|
||||
0x013, 0x00000020,
|
||||
0x014, 0x0001944C,
|
||||
0x014, 0x00059444,
|
||||
0x014, 0x0009944C,
|
||||
0x014, 0x000D9444,
|
||||
0xFF0F011F, 0xABCD,
|
||||
0x015, 0x0000F424,
|
||||
0x015, 0x0004F424,
|
||||
0x015, 0x0008F424,
|
||||
0x015, 0x000CF424,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0x015, 0x0000F474,
|
||||
0x015, 0x0004F477,
|
||||
0x015, 0x0008F455,
|
||||
0x015, 0x000CF455,
|
||||
0xFF0F011F, 0xDEAD,
|
||||
0x016, 0x00000339,
|
||||
0x016, 0x00040339,
|
||||
0x016, 0x00080339,
|
||||
0xFF0F011F, 0xABCD,
|
||||
0x016, 0x000C0356,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0x016, 0x000C0366,
|
||||
0xFF0F011F, 0xDEAD,
|
||||
0x000, 0x00010159,
|
||||
0x018, 0x0000F401,
|
||||
0x0FE, 0x00000000,
|
||||
0x0FE, 0x00000000,
|
||||
0x01F, 0x00000003,
|
||||
0x0FE, 0x00000000,
|
||||
0x0FE, 0x00000000,
|
||||
0x01E, 0x00000247,
|
||||
0x01F, 0x00000000,
|
||||
0x000, 0x00030159,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_RadioA_1T_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
|
||||
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte interfaceValue = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_RadioA_1T_8723A)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_RadioA_1T_8723A;
|
||||
|
||||
|
||||
hex += board;
|
||||
hex += interfaceValue << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
|
||||
for (i = 0; i < ArrayLen; i += 2 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
|
||||
// This (offset, data) pair meets the condition.
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigRF_RadioA_8723A(pDM_Odm, v1, v2);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // This line is the start line of branch.
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // Discard the following (offset, data) pairs.
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
i -= 2; // prevent from for-loop += 2
|
||||
}
|
||||
else // Configure matched pairs and skip to end of if-else.
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
odm_ConfigRF_RadioA_8723A(pDM_Odm, v1, v2);
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
||||
|
|
@ -1,37 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#if (RTL8723A_SUPPORT == 1)
|
||||
#ifndef __INC_RF_8723A_HW_IMG_H
|
||||
#define __INC_RF_8723A_HW_IMG_H
|
||||
|
||||
/******************************************************************************
|
||||
* RadioA_1T.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_RadioA_1T_8723A(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
||||
|
|
@ -1,192 +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 "../odm_precomp.h"
|
||||
|
||||
#if (RTL8723A_SUPPORT == 1)
|
||||
|
||||
void
|
||||
odm_ConfigRFReg_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data,
|
||||
IN ODM_RF_RADIO_PATH_E RF_PATH,
|
||||
IN u4Byte RegAddr
|
||||
)
|
||||
{
|
||||
if(Addr == 0xfe)
|
||||
{
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
ODM_sleep_ms(50);
|
||||
#else
|
||||
ODM_delay_ms(50);
|
||||
#endif
|
||||
}
|
||||
else if (Addr == 0xfd)
|
||||
{
|
||||
ODM_delay_ms(5);
|
||||
}
|
||||
else if (Addr == 0xfc)
|
||||
{
|
||||
ODM_delay_ms(1);
|
||||
}
|
||||
else if (Addr == 0xfb)
|
||||
{
|
||||
ODM_delay_us(50);
|
||||
}
|
||||
else if (Addr == 0xfa)
|
||||
{
|
||||
ODM_delay_us(5);
|
||||
}
|
||||
else if (Addr == 0xf9)
|
||||
{
|
||||
ODM_delay_us(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ODM_SetRFReg(pDM_Odm, RF_PATH, RegAddr, bRFRegOffsetMask, Data);
|
||||
// Add 1us delay between BB/RF register setting.
|
||||
ODM_delay_us(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
odm_ConfigRF_RadioA_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
u4Byte content = 0x1000; // RF_Content: radioa_txt
|
||||
u4Byte maskforPhySet= (u4Byte)(content&0xE000);
|
||||
|
||||
odm_ConfigRFReg_8723A(pDM_Odm, Addr, Data, ODM_RF_PATH_A, Addr|maskforPhySet);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ConfigRFWithHeaderFile: [RadioA] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
|
||||
void
|
||||
odm_ConfigRF_RadioB_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
u4Byte content = 0x1001; // RF_Content: radiob_txt
|
||||
u4Byte maskforPhySet= (u4Byte)(content&0xE000);
|
||||
|
||||
odm_ConfigRFReg_8723A(pDM_Odm, Addr, Data, ODM_RF_PATH_B, Addr|maskforPhySet);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ConfigRFWithHeaderFile: [RadioB] %08X %08X\n", Addr, Data));
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
odm_ConfigMAC_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u1Byte Data
|
||||
)
|
||||
{
|
||||
ODM_Write1Byte(pDM_Odm, Addr, Data);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ConfigMACWithHeaderFile: [MAC_REG] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
|
||||
void
|
||||
odm_ConfigBB_AGC_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
||||
// Add 1us delay between BB/RF register setting.
|
||||
ODM_delay_us(1);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ConfigBBWithHeaderFile: [AGC_TAB] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
|
||||
void
|
||||
odm_ConfigBB_PHY_REG_PG_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
if (Addr == 0xfe)
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
ODM_sleep_ms(50);
|
||||
#else
|
||||
ODM_delay_ms(50);
|
||||
#endif
|
||||
else if (Addr == 0xfd)
|
||||
ODM_delay_ms(5);
|
||||
else if (Addr == 0xfc)
|
||||
ODM_delay_ms(1);
|
||||
else if (Addr == 0xfb)
|
||||
ODM_delay_us(50);
|
||||
else if (Addr == 0xfa)
|
||||
ODM_delay_us(5);
|
||||
else if (Addr == 0xf9)
|
||||
ODM_delay_us(1);
|
||||
// TODO: ODM_StorePwrIndexDiffRateOffset(...)
|
||||
// storePwrIndexDiffRateOffset(Adapter, Addr, Bitmask, Data);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X %08X\n", Addr, Bitmask, Data));
|
||||
}
|
||||
|
||||
void
|
||||
odm_ConfigBB_PHY_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
if (Addr == 0xfe)
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
ODM_sleep_ms(50);
|
||||
#else
|
||||
ODM_delay_ms(50);
|
||||
#endif
|
||||
else if (Addr == 0xfd)
|
||||
ODM_delay_ms(5);
|
||||
else if (Addr == 0xfc)
|
||||
ODM_delay_ms(1);
|
||||
else if (Addr == 0xfb)
|
||||
ODM_delay_us(50);
|
||||
else if (Addr == 0xfa)
|
||||
ODM_delay_us(5);
|
||||
else if (Addr == 0xf9)
|
||||
ODM_delay_us(1);
|
||||
else if (Addr == 0xa24)
|
||||
pDM_Odm->RFCalibrateInfo.RegA24 = Data;
|
||||
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
||||
|
||||
// Add 1us delay between BB/RF register setting.
|
||||
ODM_delay_us(1);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1,80 +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 __INC_ODM_REGCONFIG_H_8723A
|
||||
#define __INC_ODM_REGCONFIG_H_8723A
|
||||
|
||||
#if (RTL8723A_SUPPORT == 1)
|
||||
|
||||
void
|
||||
odm_ConfigRFReg_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data,
|
||||
IN ODM_RF_RADIO_PATH_E RF_PATH,
|
||||
IN u4Byte RegAddr
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigRF_RadioA_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigRF_RadioB_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigMAC_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u1Byte Data
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigBB_AGC_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigBB_PHY_REG_PG_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigBB_PHY_8723A(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
#endif
|
||||
#endif // end of SUPPORT
|
||||
|
||||
|
|
@ -1,814 +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 <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtw_byteorder.h>
|
||||
|
||||
#include <hal_intf.h>
|
||||
#include <hal_com.h>
|
||||
|
||||
#ifdef CONFIG_RTL8192C
|
||||
#include <rtl8192c_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8192D
|
||||
#include <rtl8192d_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8723A
|
||||
#include <rtl8723a_hal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188E
|
||||
#include <rtl8188e_hal.h>
|
||||
#endif
|
||||
|
||||
#define _HAL_INIT_C_
|
||||
|
||||
#ifdef CONFIG_RF_GAIN_OFFSET
|
||||
#ifdef CONFIG_RTL8723A
|
||||
#define RF_GAIN_OFFSET_ON BIT0
|
||||
#define REG_RF_BB_GAIN_OFFSET 0x7f
|
||||
#define RF_GAIN_OFFSET_MASK 0xfffff
|
||||
#else
|
||||
#define RF_GAIN_OFFSET_ON BIT4
|
||||
#define REG_RF_BB_GAIN_OFFSET 0x55
|
||||
#define RF_GAIN_OFFSET_MASK 0xfffff
|
||||
#endif //CONFIG_RTL8723A
|
||||
#endif //CONFIG_RF_GAIN_OFFSET
|
||||
|
||||
void dump_chip_info(HAL_VERSION ChipVersion)
|
||||
{
|
||||
int cnt = 0;
|
||||
u8 buf[128];
|
||||
|
||||
if(IS_81XXC(ChipVersion)){
|
||||
cnt += sprintf((buf+cnt), "Chip Version Info: %s_", IS_92C_SERIAL(ChipVersion)?"CHIP_8192C":"CHIP_8188C");
|
||||
}
|
||||
else if(IS_92D(ChipVersion)){
|
||||
cnt += sprintf((buf+cnt), "Chip Version Info: CHIP_8192D_");
|
||||
}
|
||||
else if(IS_8723_SERIES(ChipVersion)){
|
||||
cnt += sprintf((buf+cnt), "Chip Version Info: CHIP_8723A_");
|
||||
}
|
||||
else if(IS_8188E(ChipVersion)){
|
||||
cnt += sprintf((buf+cnt), "Chip Version Info: CHIP_8188E_");
|
||||
}
|
||||
|
||||
cnt += sprintf((buf+cnt), "%s_", IS_NORMAL_CHIP(ChipVersion)?"Normal_Chip":"Test_Chip");
|
||||
cnt += sprintf((buf+cnt), "%s_", IS_CHIP_VENDOR_TSMC(ChipVersion)?"TSMC":"UMC");
|
||||
if(IS_A_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "A_CUT_");
|
||||
else if(IS_B_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "B_CUT_");
|
||||
else if(IS_C_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "C_CUT_");
|
||||
else if(IS_D_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "D_CUT_");
|
||||
else if(IS_E_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "E_CUT_");
|
||||
else if(IS_I_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "I_CUT_");
|
||||
else if(IS_J_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "J_CUT_");
|
||||
else if(IS_K_CUT(ChipVersion)) cnt += sprintf((buf+cnt), "K_CUT_");
|
||||
else cnt += sprintf((buf+cnt), "UNKNOWN_CUT(%d)_", ChipVersion.CUTVersion);
|
||||
|
||||
if(IS_1T1R(ChipVersion)) cnt += sprintf((buf+cnt), "1T1R_");
|
||||
else if(IS_1T2R(ChipVersion)) cnt += sprintf((buf+cnt), "1T2R_");
|
||||
else if(IS_2T2R(ChipVersion)) cnt += sprintf((buf+cnt), "2T2R_");
|
||||
else cnt += sprintf((buf+cnt), "UNKNOWN_RFTYPE(%d)_", ChipVersion.RFType);
|
||||
|
||||
cnt += sprintf((buf+cnt), "RomVer(%d)\n", ChipVersion.ROMVer);
|
||||
|
||||
DBG_871X("%s", buf);
|
||||
}
|
||||
|
||||
|
||||
#define EEPROM_CHANNEL_PLAN_BY_HW_MASK 0x80
|
||||
|
||||
u8 //return the final channel plan decision
|
||||
hal_com_get_channel_plan(
|
||||
IN PADAPTER padapter,
|
||||
IN u8 hw_channel_plan, //channel plan from HW (efuse/eeprom)
|
||||
IN u8 sw_channel_plan, //channel plan from SW (registry/module param)
|
||||
IN u8 def_channel_plan, //channel plan used when the former two is invalid
|
||||
IN BOOLEAN AutoLoadFail
|
||||
)
|
||||
{
|
||||
u8 swConfig;
|
||||
u8 chnlPlan;
|
||||
|
||||
swConfig = _TRUE;
|
||||
if (!AutoLoadFail)
|
||||
{
|
||||
if (!rtw_is_channel_plan_valid(sw_channel_plan))
|
||||
swConfig = _FALSE;
|
||||
if (hw_channel_plan & EEPROM_CHANNEL_PLAN_BY_HW_MASK)
|
||||
swConfig = _FALSE;
|
||||
}
|
||||
|
||||
if (swConfig == _TRUE)
|
||||
chnlPlan = sw_channel_plan;
|
||||
else
|
||||
chnlPlan = hw_channel_plan & (~EEPROM_CHANNEL_PLAN_BY_HW_MASK);
|
||||
|
||||
if (!rtw_is_channel_plan_valid(chnlPlan))
|
||||
chnlPlan = def_channel_plan;
|
||||
|
||||
return chnlPlan;
|
||||
}
|
||||
|
||||
u8 MRateToHwRate(u8 rate)
|
||||
{
|
||||
u8 ret = DESC_RATE1M;
|
||||
|
||||
switch(rate)
|
||||
{
|
||||
// CCK and OFDM non-HT rates
|
||||
case IEEE80211_CCK_RATE_1MB: ret = DESC_RATE1M; break;
|
||||
case IEEE80211_CCK_RATE_2MB: ret = DESC_RATE2M; break;
|
||||
case IEEE80211_CCK_RATE_5MB: ret = DESC_RATE5_5M; break;
|
||||
case IEEE80211_CCK_RATE_11MB: ret = DESC_RATE11M; break;
|
||||
case IEEE80211_OFDM_RATE_6MB: ret = DESC_RATE6M; break;
|
||||
case IEEE80211_OFDM_RATE_9MB: ret = DESC_RATE9M; break;
|
||||
case IEEE80211_OFDM_RATE_12MB: ret = DESC_RATE12M; break;
|
||||
case IEEE80211_OFDM_RATE_18MB: ret = DESC_RATE18M; break;
|
||||
case IEEE80211_OFDM_RATE_24MB: ret = DESC_RATE24M; break;
|
||||
case IEEE80211_OFDM_RATE_36MB: ret = DESC_RATE36M; break;
|
||||
case IEEE80211_OFDM_RATE_48MB: ret = DESC_RATE48M; break;
|
||||
case IEEE80211_OFDM_RATE_54MB: ret = DESC_RATE54M; break;
|
||||
|
||||
// HT rates since here
|
||||
//case MGN_MCS0: ret = DESC_RATEMCS0; break;
|
||||
//case MGN_MCS1: ret = DESC_RATEMCS1; break;
|
||||
//case MGN_MCS2: ret = DESC_RATEMCS2; break;
|
||||
//case MGN_MCS3: ret = DESC_RATEMCS3; break;
|
||||
//case MGN_MCS4: ret = DESC_RATEMCS4; break;
|
||||
//case MGN_MCS5: ret = DESC_RATEMCS5; break;
|
||||
//case MGN_MCS6: ret = DESC_RATEMCS6; break;
|
||||
//case MGN_MCS7: ret = DESC_RATEMCS7; break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void HalSetBrateCfg(
|
||||
IN PADAPTER Adapter,
|
||||
IN u8 *mBratesOS,
|
||||
OUT u16 *pBrateCfg)
|
||||
{
|
||||
u8 i, is_brate, brate;
|
||||
|
||||
for(i=0;i<NDIS_802_11_LENGTH_RATES_EX;i++)
|
||||
{
|
||||
is_brate = mBratesOS[i] & IEEE80211_BASIC_RATE_MASK;
|
||||
brate = mBratesOS[i] & 0x7f;
|
||||
|
||||
if( is_brate )
|
||||
{
|
||||
switch(brate)
|
||||
{
|
||||
case IEEE80211_CCK_RATE_1MB: *pBrateCfg |= RATE_1M; break;
|
||||
case IEEE80211_CCK_RATE_2MB: *pBrateCfg |= RATE_2M; break;
|
||||
case IEEE80211_CCK_RATE_5MB: *pBrateCfg |= RATE_5_5M;break;
|
||||
case IEEE80211_CCK_RATE_11MB: *pBrateCfg |= RATE_11M; break;
|
||||
case IEEE80211_OFDM_RATE_6MB: *pBrateCfg |= RATE_6M; break;
|
||||
case IEEE80211_OFDM_RATE_9MB: *pBrateCfg |= RATE_9M; break;
|
||||
case IEEE80211_OFDM_RATE_12MB: *pBrateCfg |= RATE_12M; break;
|
||||
case IEEE80211_OFDM_RATE_18MB: *pBrateCfg |= RATE_18M; break;
|
||||
case IEEE80211_OFDM_RATE_24MB: *pBrateCfg |= RATE_24M; break;
|
||||
case IEEE80211_OFDM_RATE_36MB: *pBrateCfg |= RATE_36M; break;
|
||||
case IEEE80211_OFDM_RATE_48MB: *pBrateCfg |= RATE_48M; break;
|
||||
case IEEE80211_OFDM_RATE_54MB: *pBrateCfg |= RATE_54M; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static VOID
|
||||
_OneOutPipeMapping(
|
||||
IN PADAPTER pAdapter
|
||||
)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(pAdapter);
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];//VO
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];//VI
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[0];//BE
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0];//BK
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];//BCN
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];//MGT
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];//HIGH
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];//TXCMD
|
||||
}
|
||||
|
||||
static VOID
|
||||
_TwoOutPipeMapping(
|
||||
IN PADAPTER pAdapter,
|
||||
IN BOOLEAN bWIFICfg
|
||||
)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(pAdapter);
|
||||
|
||||
if(bWIFICfg){ //WMM
|
||||
|
||||
// BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 0, 1, 0, 1, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:L
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[1];//VO
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];//VI
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1];//BE
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[0];//BK
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];//BCN
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];//MGT
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];//HIGH
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];//TXCMD
|
||||
|
||||
}
|
||||
else{//typical setting
|
||||
|
||||
|
||||
//BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 1, 1, 0, 0, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:L
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];//VO
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[0];//VI
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[1];//BE
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1];//BK
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];//BCN
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];//MGT
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];//HIGH
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];//TXCMD
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static VOID _ThreeOutPipeMapping(
|
||||
IN PADAPTER pAdapter,
|
||||
IN BOOLEAN bWIFICfg
|
||||
)
|
||||
{
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(pAdapter);
|
||||
|
||||
if(bWIFICfg){//for WMM
|
||||
|
||||
// BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 1, 2, 1, 0, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:N, 2:L
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];//VO
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];//VI
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];//BE
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[1];//BK
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];//BCN
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];//MGT
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];//HIGH
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];//TXCMD
|
||||
|
||||
}
|
||||
else{//typical setting
|
||||
|
||||
|
||||
// BK, BE, VI, VO, BCN, CMD,MGT,HIGH,HCCA
|
||||
//{ 2, 2, 1, 0, 0, 0, 0, 0, 0 };
|
||||
//0:H, 1:N, 2:L
|
||||
|
||||
pdvobjpriv->Queue2Pipe[0] = pdvobjpriv->RtOutPipe[0];//VO
|
||||
pdvobjpriv->Queue2Pipe[1] = pdvobjpriv->RtOutPipe[1];//VI
|
||||
pdvobjpriv->Queue2Pipe[2] = pdvobjpriv->RtOutPipe[2];//BE
|
||||
pdvobjpriv->Queue2Pipe[3] = pdvobjpriv->RtOutPipe[2];//BK
|
||||
|
||||
pdvobjpriv->Queue2Pipe[4] = pdvobjpriv->RtOutPipe[0];//BCN
|
||||
pdvobjpriv->Queue2Pipe[5] = pdvobjpriv->RtOutPipe[0];//MGT
|
||||
pdvobjpriv->Queue2Pipe[6] = pdvobjpriv->RtOutPipe[0];//HIGH
|
||||
pdvobjpriv->Queue2Pipe[7] = pdvobjpriv->RtOutPipe[0];//TXCMD
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
Hal_MappingOutPipe(
|
||||
IN PADAPTER pAdapter,
|
||||
IN u8 NumOutPipe
|
||||
)
|
||||
{
|
||||
struct registry_priv *pregistrypriv = &pAdapter->registrypriv;
|
||||
|
||||
BOOLEAN bWIFICfg = (pregistrypriv->wifi_spec) ?_TRUE:_FALSE;
|
||||
|
||||
BOOLEAN result = _TRUE;
|
||||
|
||||
switch(NumOutPipe)
|
||||
{
|
||||
case 2:
|
||||
_TwoOutPipeMapping(pAdapter, bWIFICfg);
|
||||
break;
|
||||
case 3:
|
||||
_ThreeOutPipeMapping(pAdapter, bWIFICfg);
|
||||
break;
|
||||
case 1:
|
||||
_OneOutPipeMapping(pAdapter);
|
||||
break;
|
||||
default:
|
||||
result = _FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
void hal_init_macaddr(_adapter *adapter)
|
||||
{
|
||||
rtw_hal_set_hwreg(adapter, HW_VAR_MAC_ADDR, adapter->eeprompriv.mac_addr);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (adapter->pbuddy_adapter)
|
||||
rtw_hal_set_hwreg(adapter->pbuddy_adapter, HW_VAR_MAC_ADDR, adapter->pbuddy_adapter->eeprompriv.mac_addr);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* C2H event format:
|
||||
* Field TRIGGER CONTENT CMD_SEQ CMD_LEN CMD_ID
|
||||
* BITS [127:120] [119:16] [15:8] [7:4] [3:0]
|
||||
*/
|
||||
|
||||
void c2h_evt_clear(_adapter *adapter)
|
||||
{
|
||||
rtw_write8(adapter, REG_C2HEVT_CLEAR, C2H_EVT_HOST_CLOSE);
|
||||
}
|
||||
|
||||
s32 c2h_evt_read(_adapter *adapter, u8 *buf)
|
||||
{
|
||||
s32 ret = _FAIL;
|
||||
struct c2h_evt_hdr *c2h_evt;
|
||||
int i;
|
||||
u8 trigger;
|
||||
|
||||
if (buf == NULL)
|
||||
goto exit;
|
||||
|
||||
trigger = rtw_read8(adapter, REG_C2HEVT_CLEAR);
|
||||
|
||||
if (trigger == C2H_EVT_HOST_CLOSE) {
|
||||
goto exit; /* Not ready */
|
||||
} else if (trigger != C2H_EVT_FW_CLOSE) {
|
||||
goto clear_evt; /* Not a valid value */
|
||||
}
|
||||
|
||||
c2h_evt = (struct c2h_evt_hdr *)buf;
|
||||
|
||||
_rtw_memset(c2h_evt, 0, 16);
|
||||
|
||||
*buf = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL);
|
||||
*(buf+1) = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 1);
|
||||
|
||||
RT_PRINT_DATA(_module_hal_init_c_, _drv_info_, "c2h_evt_read(): ",
|
||||
&c2h_evt , sizeof(c2h_evt));
|
||||
|
||||
if (0) {
|
||||
DBG_871X("%s id:%u, len:%u, seq:%u, trigger:0x%02x\n", __func__
|
||||
, c2h_evt->id, c2h_evt->plen, c2h_evt->seq, trigger);
|
||||
}
|
||||
|
||||
/* Read the content */
|
||||
for (i = 0; i < c2h_evt->plen; i++)
|
||||
c2h_evt->payload[i] = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + sizeof(*c2h_evt) + i);
|
||||
|
||||
RT_PRINT_DATA(_module_hal_init_c_, _drv_info_, "c2h_evt_read(): Command Content:\n",
|
||||
c2h_evt->payload, c2h_evt->plen);
|
||||
|
||||
ret = _SUCCESS;
|
||||
|
||||
clear_evt:
|
||||
/*
|
||||
* Clear event to notify FW we have read the command.
|
||||
* If this field isn't clear, the FW won't update the next command message.
|
||||
*/
|
||||
c2h_evt_clear(adapter);
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void SetHwReg(_adapter *adapter, u8 variable, u8 *val)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &(hal_data->odmpriv);
|
||||
|
||||
_func_enter_;
|
||||
|
||||
switch (variable) {
|
||||
case HW_VAR_SEC_CFG:
|
||||
{
|
||||
#if defined(CONFIG_CONCURRENT_MODE) && !defined(DYNAMIC_CAMID_ALLOC)
|
||||
// enable tx enc and rx dec engine, and no key search for MC/BC
|
||||
rtw_write8(adapter, REG_SECCFG, SCR_NoSKMC|SCR_RxDecEnable|SCR_TxEncEnable);
|
||||
#elif defined(DYNAMIC_CAMID_ALLOC)
|
||||
u16 reg_scr;
|
||||
|
||||
reg_scr = rtw_read16(adapter, REG_SECCFG);
|
||||
rtw_write16(adapter, REG_SECCFG, reg_scr|SCR_CHK_KEYID|SCR_RxDecEnable|SCR_TxEncEnable);
|
||||
#else
|
||||
rtw_write8(adapter, REG_SECCFG, *((u8*)val));
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case HW_VAR_SEC_DK_CFG:
|
||||
{
|
||||
struct security_priv *sec = &adapter->securitypriv;
|
||||
u8 reg_scr = rtw_read8(adapter, REG_SECCFG);
|
||||
|
||||
if (val) /* Enable default key related setting */
|
||||
{
|
||||
reg_scr |= SCR_TXBCUSEDK;
|
||||
if (sec->dot11AuthAlgrthm != dot11AuthAlgrthm_8021X)
|
||||
reg_scr |= (SCR_RxUseDK|SCR_TxUseDK);
|
||||
}
|
||||
else /* Disable default key related setting */
|
||||
{
|
||||
reg_scr &= ~(SCR_RXBCUSEDK|SCR_TXBCUSEDK|SCR_RxUseDK|SCR_TxUseDK);
|
||||
}
|
||||
|
||||
rtw_write8(adapter, REG_SECCFG, reg_scr);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (0)
|
||||
DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" variable(%d) not defined!\n",
|
||||
FUNC_ADPT_ARG(adapter), variable);
|
||||
break;
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
void GetHwReg(_adapter *adapter, u8 variable, u8 *val)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &(hal_data->odmpriv);
|
||||
|
||||
_func_enter_;
|
||||
|
||||
switch (variable) {
|
||||
default:
|
||||
if (0)
|
||||
DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" variable(%d) not defined!\n",
|
||||
FUNC_ADPT_ARG(adapter), variable);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
u8
|
||||
SetHalDefVar(_adapter *adapter, HAL_DEF_VARIABLE variable, void *value)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
|
||||
u8 bResult = _SUCCESS;
|
||||
|
||||
switch(variable) {
|
||||
case HW_DEF_FA_CNT_DUMP:
|
||||
if(*((u8*)value))
|
||||
pDM_Odm->DebugComponents |= (ODM_COMP_DIG |ODM_COMP_FA_CNT);
|
||||
else
|
||||
pDM_Odm->DebugComponents &= ~(ODM_COMP_DIG |ODM_COMP_FA_CNT);
|
||||
break;
|
||||
case HW_DEF_ODM_DBG_FLAG:
|
||||
ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_DBG_COMP, *((u8Byte*)value));
|
||||
break;
|
||||
case HW_DEF_ODM_DBG_LEVEL:
|
||||
ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_DBG_LEVEL, *((u4Byte*)value));
|
||||
break;
|
||||
default:
|
||||
DBG_871X_LEVEL(_drv_always_, "%s: [WARNING] HAL_DEF_VARIABLE(%d) not defined!\n", __FUNCTION__, variable);
|
||||
bResult = _FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
u8
|
||||
GetHalDefVar(_adapter *adapter, HAL_DEF_VARIABLE variable, void *value)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
|
||||
u8 bResult = _SUCCESS;
|
||||
|
||||
switch(variable) {
|
||||
case HW_DEF_ODM_DBG_FLAG:
|
||||
*((u8Byte*)value) = pDM_Odm->DebugComponents;
|
||||
break;
|
||||
case HW_DEF_ODM_DBG_LEVEL:
|
||||
*((u4Byte*)value) = pDM_Odm->DebugLevel;
|
||||
break;
|
||||
case HAL_DEF_DBG_DM_FUNC:
|
||||
*((u32*)value) = pHalData->odmpriv.SupportAbility;
|
||||
break;
|
||||
case HAL_DEF_MACID_SLEEP:
|
||||
*(u8*)value = _FALSE; // support macid sleep
|
||||
break;
|
||||
default:
|
||||
DBG_871X_LEVEL(_drv_always_, "%s: [WARNING] HAL_DEF_VARIABLE(%d) not defined!\n", __FUNCTION__, variable);
|
||||
bResult = _FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RF_GAIN_OFFSET
|
||||
void rtw_bb_rf_gain_offset(_adapter *padapter)
|
||||
{
|
||||
u8 value = padapter->eeprompriv.EEPROMRFGainOffset;
|
||||
u8 tmp = 0x3e;
|
||||
u32 res;
|
||||
|
||||
DBG_871X("+%s value: 0x%02x+\n", __func__, value);
|
||||
|
||||
if (value & RF_GAIN_OFFSET_ON) {
|
||||
//DBG_871X("Offset RF Gain.\n");
|
||||
//DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x\n",padapter->eeprompriv.EEPROMRFGainVal);
|
||||
if(padapter->eeprompriv.EEPROMRFGainVal != 0xff){
|
||||
#ifdef CONFIG_RTL8723A
|
||||
res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0xd, 0xffffffff);
|
||||
//DBG_871X("Offset RF Gain. reg 0xd=0x%x\n",res);
|
||||
res &= 0xfff87fff;
|
||||
|
||||
res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f)<< 15;
|
||||
//DBG_871X("Offset RF Gain. reg 0xd=0x%x\n",res);
|
||||
|
||||
rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, RF_GAIN_OFFSET_MASK, res);
|
||||
|
||||
res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0xe, 0xffffffff);
|
||||
DBG_871X("Offset RF Gain. reg 0xe=0x%x\n",res);
|
||||
res &= 0xfffffff0;
|
||||
|
||||
res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f);
|
||||
//DBG_871X("Offset RF Gain. reg 0xe=0x%x\n",res);
|
||||
|
||||
rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, RF_GAIN_OFFSET_MASK, res);
|
||||
#else
|
||||
res = rtw_hal_read_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, 0xffffffff);
|
||||
DBG_871X("REG_RF_BB_GAIN_OFFSET=%x \n",res);
|
||||
res &= 0xfff87fff;
|
||||
res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f)<< 15;
|
||||
DBG_871X("write REG_RF_BB_GAIN_OFFSET=%x \n",res);
|
||||
rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, RF_GAIN_OFFSET_MASK, res);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
//DBG_871X("Offset RF Gain. padapter->eeprompriv.EEPROMRFGainVal=0x%x != 0xff, didn't run Kfree\n",padapter->eeprompriv.EEPROMRFGainVal);
|
||||
}
|
||||
} else {
|
||||
//DBG_871X("Using the default RF gain.\n");
|
||||
}
|
||||
|
||||
}
|
||||
#endif //CONFIG_RF_GAIN_OFFSET
|
||||
|
||||
#ifdef CONFIG_EFUSE_CONFIG_FILE
|
||||
int check_phy_efuse_tx_power_info_valid(PADAPTER padapter) {
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
|
||||
u8* pContent = pEEPROM->efuse_eeprom_data;
|
||||
int index = 0;
|
||||
u16 tx_index_offset = 0x0000;
|
||||
|
||||
switch(padapter->chip_type) {
|
||||
case RTL8723A:
|
||||
tx_index_offset = EEPROM_CCK_TX_PWR_INX_8723A;
|
||||
break;
|
||||
default:
|
||||
tx_index_offset = 0x0010;
|
||||
break;
|
||||
}
|
||||
for (index = 0 ; index < 12 ; index++) {
|
||||
if (pContent[tx_index_offset + index] == 0xFF) {
|
||||
return _FALSE;
|
||||
}
|
||||
}
|
||||
DBG_871X("phy efuse with valid tx power info\n");
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
int check_phy_efuse_macaddr_info_valid(PADAPTER padapter) {
|
||||
|
||||
u8 val = 0;
|
||||
u16 addr_offset = 0x0000;
|
||||
|
||||
switch(padapter->chip_type) {
|
||||
case RTL8723A:
|
||||
if (padapter->interface_type == RTW_USB)
|
||||
{
|
||||
addr_offset = EEPROM_MAC_ADDR_8723AU;
|
||||
DBG_871X("%s: interface is USB\n", __func__);
|
||||
}
|
||||
else if (padapter->interface_type == RTW_SDIO)
|
||||
{
|
||||
addr_offset = EEPROM_MAC_ADDR_8723AS;
|
||||
DBG_871X("%s: interface is SDIO\n", __func__);
|
||||
}
|
||||
else if (padapter->interface_type == RTW_PCIE)
|
||||
{
|
||||
addr_offset = EEPROM_MAC_ADDR_8723AE;
|
||||
DBG_871X("%s: interface is PCIE\n", __func__);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (addr_offset == 0x0000) {
|
||||
DBG_871X("phy efuse MAC addr offset is 0!!\n");
|
||||
return _FALSE;
|
||||
} else {
|
||||
rtw_efuse_map_read(padapter, addr_offset, 1, &val);
|
||||
}
|
||||
|
||||
if (val == 0xFF) {
|
||||
return _FALSE;
|
||||
} else {
|
||||
DBG_871X("phy efuse with valid MAC addr\n");
|
||||
return _TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
u32 Hal_readPGDataFromConfigFile(
|
||||
PADAPTER padapter,
|
||||
struct file *fp)
|
||||
{
|
||||
u32 i;
|
||||
mm_segment_t fs;
|
||||
u8 temp[3];
|
||||
loff_t pos = 0;
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
|
||||
u8 *PROMContent = pEEPROM->efuse_eeprom_data;
|
||||
|
||||
temp[2] = 0; // add end of string '\0'
|
||||
|
||||
fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
for (i = 0 ; i < HWSET_MAX_SIZE ; i++) {
|
||||
vfs_read(fp, temp, 2, &pos);
|
||||
PROMContent[i] = simple_strtoul(temp, NULL, 16);
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
set_fs(fs);
|
||||
pEEPROM->bloadfile_fail_flag = _FALSE;
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
DBG_871X("Efuse configure file:\n");
|
||||
for (i=0; i<HWSET_MAX_SIZE; i++)
|
||||
{
|
||||
if (i % 16 == 0)
|
||||
printk("\n");
|
||||
|
||||
printk("%02X ", PROMContent[i]);
|
||||
}
|
||||
printk("\n");
|
||||
#endif
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void Hal_ReadMACAddrFromFile(
|
||||
PADAPTER padapter,
|
||||
struct file *fp)
|
||||
{
|
||||
u32 i;
|
||||
mm_segment_t fs;
|
||||
u8 source_addr[18];
|
||||
loff_t pos = 0;
|
||||
u32 curtime = rtw_get_current_time();
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
|
||||
u8 *head, *end;
|
||||
|
||||
_rtw_memset(source_addr, 0, 18);
|
||||
_rtw_memset(pEEPROM->mac_addr, 0, ETH_ALEN);
|
||||
|
||||
fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
DBG_871X("wifi mac address:\n");
|
||||
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';
|
||||
|
||||
pEEPROM->mac_addr[i] = simple_strtoul(head, NULL, 16 );
|
||||
|
||||
if (end) {
|
||||
end++;
|
||||
head = end;
|
||||
}
|
||||
}
|
||||
|
||||
set_fs(fs);
|
||||
pEEPROM->bloadmac_fail_flag = _FALSE;
|
||||
|
||||
if (rtw_check_invalid_mac_address(pEEPROM->mac_addr) == _TRUE) {
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
|
||||
get_random_bytes(pEEPROM->mac_addr, ETH_ALEN);
|
||||
pEEPROM->mac_addr[0] = 0x00;
|
||||
pEEPROM->mac_addr[1] = 0xe0;
|
||||
pEEPROM->mac_addr[2] = 0x4c;
|
||||
#else
|
||||
pEEPROM->mac_addr[0] = 0x00;
|
||||
pEEPROM->mac_addr[1] = 0xe0;
|
||||
pEEPROM->mac_addr[2] = 0x4c;
|
||||
pEEPROM->mac_addr[3] = (u8)(curtime & 0xff) ;
|
||||
pEEPROM->mac_addr[4] = (u8)((curtime>>8) & 0xff) ;
|
||||
pEEPROM->mac_addr[5] = (u8)((curtime>>16) & 0xff) ;
|
||||
#endif
|
||||
DBG_871X("MAC Address from wifimac error is invalid, assign random MAC !!!\n");
|
||||
}
|
||||
|
||||
DBG_871X("%s: Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n",
|
||||
__func__, pEEPROM->mac_addr[0], pEEPROM->mac_addr[1],
|
||||
pEEPROM->mac_addr[2], pEEPROM->mac_addr[3],
|
||||
pEEPROM->mac_addr[4], pEEPROM->mac_addr[5]);
|
||||
}
|
||||
|
||||
void Hal_GetPhyEfuseMACAddr(PADAPTER padapter, u8* mac_addr) {
|
||||
int i = 0;
|
||||
u16 addr_offset = 0x0000;
|
||||
|
||||
switch(padapter->chip_type) {
|
||||
case RTL8723A:
|
||||
if (padapter->interface_type == RTW_USB)
|
||||
{
|
||||
addr_offset = EEPROM_MAC_ADDR_8723AU;
|
||||
DBG_871X("%s: interface is USB\n", __func__);
|
||||
}
|
||||
else if (padapter->interface_type == RTW_SDIO)
|
||||
{
|
||||
addr_offset = EEPROM_MAC_ADDR_8723AS;
|
||||
DBG_871X("%s: interface is SDIO\n", __func__);
|
||||
}
|
||||
else if (padapter->interface_type == RTW_PCIE)
|
||||
{
|
||||
addr_offset = EEPROM_MAC_ADDR_8723AE;
|
||||
DBG_871X("%s: interface is PCIE\n", __func__);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
rtw_efuse_map_read(padapter, addr_offset, ETH_ALEN, mac_addr);
|
||||
|
||||
if (rtw_check_invalid_mac_address(mac_addr) == _TRUE) {
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
|
||||
get_random_bytes(mac_addr, ETH_ALEN);
|
||||
mac_addr[0] = 0x00;
|
||||
mac_addr[1] = 0xe0;
|
||||
mac_addr[2] = 0x4c;
|
||||
#else
|
||||
mac_addr[0] = 0x00;
|
||||
mac_addr[1] = 0xe0;
|
||||
mac_addr[2] = 0x4c;
|
||||
mac_addr[3] = (u8)(curtime & 0xff) ;
|
||||
mac_addr[4] = (u8)((curtime>>8) & 0xff) ;
|
||||
mac_addr[5] = (u8)((curtime>>16) & 0xff) ;
|
||||
#endif
|
||||
DBG_871X("MAC Address from phy efuse error, assign random MAC !!!\n");
|
||||
}
|
||||
|
||||
DBG_871X("%s: Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x\n",
|
||||
__func__, mac_addr[0], mac_addr[1], mac_addr[2],
|
||||
mac_addr[3], mac_addr[4], mac_addr[5]);
|
||||
}
|
||||
#endif //CONFIG_EFUSE_CONFIG_FILE
|
||||
|
||||
|
||||
|
|
@ -1,641 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#define _HAL_INTF_C_
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtw_byteorder.h>
|
||||
|
||||
#include <hal_intf.h>
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#include <sdio_hal.h>
|
||||
#elif defined(CONFIG_USB_HCI)
|
||||
#include <usb_hal.h>
|
||||
#elif defined(CONFIG_GSPI_HCI)
|
||||
#include <gspi_hal.h>
|
||||
#endif
|
||||
|
||||
void rtw_hal_chip_configure(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.intf_chip_configure)
|
||||
padapter->HalFunc.intf_chip_configure(padapter);
|
||||
}
|
||||
|
||||
void rtw_hal_read_chip_info(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.read_adapter_info)
|
||||
padapter->HalFunc.read_adapter_info(padapter);
|
||||
}
|
||||
|
||||
void rtw_hal_read_chip_version(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.read_chip_version)
|
||||
padapter->HalFunc.read_chip_version(padapter);
|
||||
}
|
||||
|
||||
void rtw_hal_def_value_init(_adapter *padapter)
|
||||
{
|
||||
if (is_primary_adapter(padapter))
|
||||
if(padapter->HalFunc.init_default_value)
|
||||
padapter->HalFunc.init_default_value(padapter);
|
||||
}
|
||||
void rtw_hal_free_data(_adapter *padapter)
|
||||
{
|
||||
if (is_primary_adapter(padapter))
|
||||
if(padapter->HalFunc.free_hal_data)
|
||||
padapter->HalFunc.free_hal_data(padapter);
|
||||
}
|
||||
void rtw_hal_dm_init(_adapter *padapter)
|
||||
{
|
||||
if (is_primary_adapter(padapter))
|
||||
if(padapter->HalFunc.dm_init)
|
||||
padapter->HalFunc.dm_init(padapter);
|
||||
}
|
||||
void rtw_hal_dm_deinit(_adapter *padapter)
|
||||
{
|
||||
// cancel dm timer
|
||||
if (is_primary_adapter(padapter))
|
||||
if(padapter->HalFunc.dm_deinit)
|
||||
padapter->HalFunc.dm_deinit(padapter);
|
||||
}
|
||||
void rtw_hal_sw_led_init(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.InitSwLeds)
|
||||
padapter->HalFunc.InitSwLeds(padapter);
|
||||
}
|
||||
|
||||
void rtw_hal_sw_led_deinit(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.DeInitSwLeds)
|
||||
padapter->HalFunc.DeInitSwLeds(padapter);
|
||||
}
|
||||
|
||||
u32 rtw_hal_power_on(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.hal_power_on)
|
||||
return padapter->HalFunc.hal_power_on(padapter);
|
||||
return _FAIL;
|
||||
}
|
||||
void rtw_hal_power_off(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.hal_power_off)
|
||||
padapter->HalFunc.hal_power_off(padapter);
|
||||
}
|
||||
|
||||
|
||||
uint rtw_hal_init(_adapter *padapter)
|
||||
{
|
||||
uint status = _SUCCESS;
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
|
||||
int i;
|
||||
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
if(padapter->hw_init_completed == _TRUE)
|
||||
{
|
||||
DBG_871X("rtw_hal_init: hw_init_completed == _TRUE\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
// before init mac0, driver must init mac1 first to avoid usb rx error.
|
||||
if((padapter->pbuddy_adapter != NULL) && (padapter->DualMacConcurrent == _TRUE)
|
||||
&& (padapter->adapter_type == PRIMARY_ADAPTER))
|
||||
{
|
||||
if(padapter->pbuddy_adapter->hw_init_completed == _TRUE)
|
||||
{
|
||||
DBG_871X("rtw_hal_init: pbuddy_adapter hw_init_completed == _TRUE\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
status = padapter->HalFunc.hal_init(padapter->pbuddy_adapter);
|
||||
if(status == _SUCCESS){
|
||||
padapter->pbuddy_adapter->hw_init_completed = _TRUE;
|
||||
}
|
||||
else{
|
||||
padapter->pbuddy_adapter->hw_init_completed = _FALSE;
|
||||
RT_TRACE(_module_hal_init_c_,_drv_err_,("rtw_hal_init: hal__init fail(pbuddy_adapter)\n"));
|
||||
DBG_871X("rtw_hal_init: hal__init fail(pbuddy_adapter)\n");
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
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 (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]);
|
||||
|
||||
init_hw_mlme_ext(padapter);
|
||||
|
||||
#ifdef CONFIG_RF_GAIN_OFFSET
|
||||
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;
|
||||
DBG_871X("rtw_hal_init: hal__init fail\n");
|
||||
}
|
||||
|
||||
RT_TRACE(_module_hal_init_c_,_drv_err_,("-rtl871x_hal_init:status=0x%x\n",status));
|
||||
|
||||
return status;
|
||||
|
||||
}
|
||||
|
||||
uint rtw_hal_deinit(_adapter *padapter)
|
||||
{
|
||||
uint status = _SUCCESS;
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
|
||||
int i;
|
||||
|
||||
_func_enter_;
|
||||
if (!is_primary_adapter(padapter)){
|
||||
DBG_871X(" rtw_hal_deinit: Secondary adapter return l\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = padapter->HalFunc.hal_deinit(padapter);
|
||||
|
||||
if(status == _SUCCESS){
|
||||
for (i = 0; i<dvobj->iface_nums; i++) {
|
||||
padapter = dvobj->padapters[i];
|
||||
padapter->hw_init_completed = _FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_871X("\n rtw_hal_deinit: hal_init fail\n");
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void rtw_hal_set_hwreg(_adapter *padapter, u8 variable, u8 *val)
|
||||
{
|
||||
if (padapter->HalFunc.SetHwRegHandler)
|
||||
padapter->HalFunc.SetHwRegHandler(padapter, variable, val);
|
||||
}
|
||||
|
||||
void rtw_hal_get_hwreg(_adapter *padapter, u8 variable, u8 *val)
|
||||
{
|
||||
if (padapter->HalFunc.GetHwRegHandler)
|
||||
padapter->HalFunc.GetHwRegHandler(padapter, variable, val);
|
||||
}
|
||||
|
||||
u8 rtw_hal_set_def_var(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue)
|
||||
{
|
||||
if(padapter->HalFunc.SetHalDefVarHandler)
|
||||
return padapter->HalFunc.SetHalDefVarHandler(padapter,eVariable,pValue);
|
||||
return _FAIL;
|
||||
}
|
||||
u8 rtw_hal_get_def_var(_adapter *padapter, HAL_DEF_VARIABLE eVariable, PVOID pValue)
|
||||
{
|
||||
if(padapter->HalFunc.GetHalDefVarHandler)
|
||||
return padapter->HalFunc.GetHalDefVarHandler(padapter,eVariable,pValue);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
void rtw_hal_set_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet)
|
||||
{
|
||||
if(padapter->HalFunc.SetHalODMVarHandler)
|
||||
padapter->HalFunc.SetHalODMVarHandler(padapter,eVariable,pValue1,bSet);
|
||||
}
|
||||
void rtw_hal_get_odm_var(_adapter *padapter, HAL_ODM_VARIABLE eVariable, PVOID pValue1,BOOLEAN bSet)
|
||||
{
|
||||
if(padapter->HalFunc.GetHalODMVarHandler)
|
||||
padapter->HalFunc.GetHalODMVarHandler(padapter,eVariable,pValue1,bSet);
|
||||
}
|
||||
|
||||
void rtw_hal_enable_interrupt(_adapter *padapter)
|
||||
{
|
||||
if (!is_primary_adapter(padapter)){
|
||||
DBG_871X(" rtw_hal_enable_interrupt: Secondary adapter return l\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (padapter->HalFunc.enable_interrupt)
|
||||
padapter->HalFunc.enable_interrupt(padapter);
|
||||
else
|
||||
DBG_871X("%s: HalFunc.enable_interrupt is NULL!\n", __FUNCTION__);
|
||||
|
||||
}
|
||||
void rtw_hal_disable_interrupt(_adapter *padapter)
|
||||
{
|
||||
if (!is_primary_adapter(padapter)){
|
||||
DBG_871X(" rtw_hal_disable_interrupt: Secondary adapter return l\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (padapter->HalFunc.disable_interrupt)
|
||||
padapter->HalFunc.disable_interrupt(padapter);
|
||||
else
|
||||
DBG_871X("%s: HalFunc.disable_interrupt is NULL!\n", __FUNCTION__);
|
||||
|
||||
}
|
||||
|
||||
|
||||
u32 rtw_hal_inirp_init(_adapter *padapter)
|
||||
{
|
||||
u32 rst = _FAIL;
|
||||
if(padapter->HalFunc.inirp_init)
|
||||
rst = padapter->HalFunc.inirp_init(padapter);
|
||||
else
|
||||
DBG_871X(" %s HalFunc.inirp_init is NULL!!!\n",__FUNCTION__);
|
||||
return rst;
|
||||
}
|
||||
|
||||
u32 rtw_hal_inirp_deinit(_adapter *padapter)
|
||||
{
|
||||
|
||||
if(padapter->HalFunc.inirp_deinit)
|
||||
return padapter->HalFunc.inirp_deinit(padapter);
|
||||
|
||||
return _FAIL;
|
||||
|
||||
}
|
||||
|
||||
void rtw_hal_irp_reset(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.irp_reset)
|
||||
padapter->HalFunc.irp_reset(padapter);
|
||||
else
|
||||
DBG_871X("%s: HalFunc.rtw_hal_irp_reset is NULL!\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
u8 rtw_hal_intf_ps_func(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id, u8* val)
|
||||
{
|
||||
if(padapter->HalFunc.interface_ps_func)
|
||||
return padapter->HalFunc.interface_ps_func(padapter,efunc_id,val);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
s32 rtw_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
if(padapter->HalFunc.hal_xmitframe_enqueue)
|
||||
return padapter->HalFunc.hal_xmitframe_enqueue(padapter, pxmitframe);
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
s32 rtw_hal_xmit(_adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
if(padapter->HalFunc.hal_xmit)
|
||||
return padapter->HalFunc.hal_xmit(padapter, pxmitframe);
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
s32 rtw_hal_mgnt_xmit(_adapter *padapter, struct xmit_frame *pmgntframe)
|
||||
{
|
||||
s32 ret = _FAIL;
|
||||
unsigned char *pframe;
|
||||
struct rtw_ieee80211_hdr *pwlanhdr;
|
||||
|
||||
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
|
||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
|
||||
_rtw_memcpy(pmgntframe->attrib.ra, pwlanhdr->addr1, ETH_ALEN);
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if(padapter->securitypriv.binstallBIPkey == _TRUE)
|
||||
{
|
||||
if(IS_MCAST(pmgntframe->attrib.ra))
|
||||
{
|
||||
pmgntframe->attrib.encrypt = _BIP_;
|
||||
//pmgntframe->attrib.bswenc = _TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
pmgntframe->attrib.encrypt = _AES_;
|
||||
pmgntframe->attrib.bswenc = _TRUE;
|
||||
}
|
||||
rtw_mgmt_xmitframe_coalesce(padapter, pmgntframe->pkt, pmgntframe);
|
||||
}
|
||||
#endif //CONFIG_IEEE80211W
|
||||
|
||||
if(padapter->HalFunc.mgnt_xmit)
|
||||
ret = padapter->HalFunc.mgnt_xmit(padapter, pmgntframe);
|
||||
return ret;
|
||||
}
|
||||
|
||||
s32 rtw_hal_init_xmit_priv(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.init_xmit_priv != NULL)
|
||||
return padapter->HalFunc.init_xmit_priv(padapter);
|
||||
return _FAIL;
|
||||
}
|
||||
void rtw_hal_free_xmit_priv(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.free_xmit_priv != NULL)
|
||||
padapter->HalFunc.free_xmit_priv(padapter);
|
||||
}
|
||||
|
||||
s32 rtw_hal_init_recv_priv(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.init_recv_priv)
|
||||
return padapter->HalFunc.init_recv_priv(padapter);
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
void rtw_hal_free_recv_priv(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.free_recv_priv)
|
||||
padapter->HalFunc.free_recv_priv(padapter);
|
||||
}
|
||||
|
||||
void rtw_hal_update_ra_mask(struct sta_info *psta, u8 rssi_level)
|
||||
{
|
||||
_adapter *padapter;
|
||||
struct mlme_priv *pmlmepriv;
|
||||
|
||||
if(!psta)
|
||||
return;
|
||||
|
||||
padapter = psta->padapter;
|
||||
|
||||
pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
||||
{
|
||||
add_RATid(padapter, psta, rssi_level);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(padapter->HalFunc.UpdateRAMaskHandler)
|
||||
padapter->HalFunc.UpdateRAMaskHandler(padapter, psta->mac_id, rssi_level);
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_hal_add_ra_tid(_adapter *padapter, u32 bitmap, u8 arg, u8 rssi_level)
|
||||
{
|
||||
if(padapter->HalFunc.Add_RateATid)
|
||||
padapter->HalFunc.Add_RateATid(padapter, bitmap, arg, rssi_level);
|
||||
}
|
||||
|
||||
/* Start specifical interface thread */
|
||||
void rtw_hal_start_thread(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.run_thread)
|
||||
padapter->HalFunc.run_thread(padapter);
|
||||
}
|
||||
/* Start specifical interface thread */
|
||||
void rtw_hal_stop_thread(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.cancel_thread)
|
||||
padapter->HalFunc.cancel_thread(padapter);
|
||||
}
|
||||
|
||||
u32 rtw_hal_read_bbreg(_adapter *padapter, u32 RegAddr, u32 BitMask)
|
||||
{
|
||||
u32 data = 0;
|
||||
if(padapter->HalFunc.read_bbreg)
|
||||
data = padapter->HalFunc.read_bbreg(padapter, RegAddr, BitMask);
|
||||
return data;
|
||||
}
|
||||
void rtw_hal_write_bbreg(_adapter *padapter, u32 RegAddr, u32 BitMask, u32 Data)
|
||||
{
|
||||
if(padapter->HalFunc.write_bbreg)
|
||||
padapter->HalFunc.write_bbreg(padapter, RegAddr, BitMask, Data);
|
||||
}
|
||||
|
||||
u32 rtw_hal_read_rfreg(_adapter *padapter, u32 eRFPath, u32 RegAddr, u32 BitMask)
|
||||
{
|
||||
u32 data = 0;
|
||||
if( padapter->HalFunc.read_rfreg)
|
||||
data = padapter->HalFunc.read_rfreg(padapter, eRFPath, RegAddr, BitMask);
|
||||
return 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);
|
||||
}
|
||||
|
||||
s32 rtw_hal_interrupt_handler(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.interrupt_handler)
|
||||
return padapter->HalFunc.interrupt_handler(padapter);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
void rtw_hal_set_bwmode(_adapter *padapter, HT_CHANNEL_WIDTH Bandwidth, u8 Offset)
|
||||
{
|
||||
if(padapter->HalFunc.set_bwmode_handler)
|
||||
padapter->HalFunc.set_bwmode_handler(padapter, Bandwidth, Offset);
|
||||
}
|
||||
|
||||
void rtw_hal_set_chan(_adapter *padapter, u8 channel)
|
||||
{
|
||||
if(padapter->HalFunc.set_channel_handler)
|
||||
padapter->HalFunc.set_channel_handler(padapter, channel);
|
||||
}
|
||||
|
||||
void rtw_hal_dm_watchdog(_adapter *padapter)
|
||||
{
|
||||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
if (padapter->adapter_type != PRIMARY_ADAPTER)
|
||||
return;
|
||||
#endif
|
||||
if(padapter->HalFunc.hal_dm_watchdog)
|
||||
padapter->HalFunc.hal_dm_watchdog(padapter);
|
||||
}
|
||||
|
||||
void rtw_hal_bcn_related_reg_setting(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.SetBeaconRelatedRegistersHandler)
|
||||
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)
|
||||
{
|
||||
if(padapter->HalFunc.hostap_mgnt_xmit_entry)
|
||||
return padapter->HalFunc.hostap_mgnt_xmit_entry(padapter, pkt);
|
||||
return _FAIL;
|
||||
}
|
||||
#endif //CONFIG_HOSTAPD_MLME
|
||||
|
||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||
void rtw_hal_sreset_init(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.sreset_init_value)
|
||||
padapter->HalFunc.sreset_init_value(padapter);
|
||||
}
|
||||
void rtw_hal_sreset_reset(_adapter *padapter)
|
||||
{
|
||||
padapter = GET_PRIMARY_ADAPTER(padapter);
|
||||
|
||||
if(padapter->HalFunc.silentreset)
|
||||
padapter->HalFunc.silentreset(padapter);
|
||||
}
|
||||
|
||||
void rtw_hal_sreset_reset_value(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.sreset_reset_value)
|
||||
padapter->HalFunc.sreset_reset_value(padapter);
|
||||
}
|
||||
|
||||
void rtw_hal_sreset_xmit_status_check(_adapter *padapter)
|
||||
{
|
||||
if (!is_primary_adapter(padapter))
|
||||
return;
|
||||
|
||||
if(padapter->HalFunc.sreset_xmit_status_check)
|
||||
padapter->HalFunc.sreset_xmit_status_check(padapter);
|
||||
}
|
||||
void rtw_hal_sreset_linked_status_check(_adapter *padapter)
|
||||
{
|
||||
if (!is_primary_adapter(padapter))
|
||||
return;
|
||||
|
||||
if(padapter->HalFunc.sreset_linked_status_check)
|
||||
padapter->HalFunc.sreset_linked_status_check(padapter);
|
||||
}
|
||||
u8 rtw_hal_sreset_get_wifi_status(_adapter *padapter)
|
||||
{
|
||||
u8 status = 0;
|
||||
if(padapter->HalFunc.sreset_get_wifi_status)
|
||||
status = padapter->HalFunc.sreset_get_wifi_status(padapter);
|
||||
return status;
|
||||
}
|
||||
|
||||
bool rtw_hal_sreset_inprogress(_adapter *padapter)
|
||||
{
|
||||
bool inprogress = _FALSE;
|
||||
|
||||
padapter = GET_PRIMARY_ADAPTER(padapter);
|
||||
|
||||
if(padapter->HalFunc.sreset_inprogress)
|
||||
inprogress = padapter->HalFunc.sreset_inprogress(padapter);
|
||||
return inprogress;
|
||||
}
|
||||
#endif //DBG_CONFIG_ERROR_DETECT
|
||||
|
||||
#ifdef CONFIG_IOL
|
||||
int rtw_hal_iol_cmd(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt)
|
||||
{
|
||||
if(adapter->HalFunc.IOL_exec_cmds_sync)
|
||||
return adapter->HalFunc.IOL_exec_cmds_sync(adapter, xmit_frame, max_wating_ms,bndy_cnt);
|
||||
return _FAIL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_XMIT_THREAD_MODE
|
||||
s32 rtw_hal_xmit_thread_handler(_adapter *padapter)
|
||||
{
|
||||
if(padapter->HalFunc.xmit_thread_handler)
|
||||
return padapter->HalFunc.xmit_thread_handler(padapter);
|
||||
return _FAIL;
|
||||
}
|
||||
#endif
|
||||
|
||||
void rtw_hal_notch_filter(_adapter *adapter, bool enable)
|
||||
{
|
||||
if(adapter->HalFunc.hal_notch_filter)
|
||||
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);
|
||||
}
|
||||
|
||||
s32 rtw_hal_c2h_handler(_adapter *adapter, struct c2h_evt_hdr *c2h_evt)
|
||||
{
|
||||
s32 ret = _FAIL;
|
||||
if (adapter->HalFunc.c2h_handler)
|
||||
ret = adapter->HalFunc.c2h_handler(adapter, c2h_evt);
|
||||
return ret;
|
||||
}
|
||||
|
||||
c2h_id_filter rtw_hal_c2h_id_filter_ccx(_adapter *adapter)
|
||||
{
|
||||
return adapter->HalFunc.c2h_id_filter_ccx;
|
||||
}
|
||||
|
||||
s32 rtw_hal_macid_sleep(PADAPTER padapter, u8 macid)
|
||||
{
|
||||
u8 support;
|
||||
|
||||
support = _FALSE;
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_MACID_SLEEP, &support);
|
||||
if (_FALSE == support)
|
||||
return _FAIL;
|
||||
|
||||
if (macid >= 32) {
|
||||
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT": Invalid macid(%u)\n",
|
||||
FUNC_ADPT_ARG(padapter), macid);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MACID_SLEEP, &macid);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
s32 rtw_hal_macid_wakeup(PADAPTER padapter, u8 macid)
|
||||
{
|
||||
u8 support;
|
||||
|
||||
support = _FALSE;
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_MACID_SLEEP, &support);
|
||||
if (_FALSE == support)
|
||||
return _FAIL;
|
||||
|
||||
if (macid >= 32) {
|
||||
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT": Invalid macid(%u)\n",
|
||||
FUNC_ADPT_ARG(padapter), macid);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MACID_WAKEUP, &macid);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*++
|
||||
Copyright (c) Realtek Semiconductor Corp. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
Hal8723PwrSeq.c
|
||||
|
||||
Abstract:
|
||||
This file includes all kinds of Power Action event for RTL8188E and corresponding hardware configurtions which are released from HW SD.
|
||||
|
||||
Major Change History:
|
||||
When Who What
|
||||
---------- --------------- -------------------------------
|
||||
2011-08-08 Roger Create.
|
||||
|
||||
--*/
|
||||
#include "Hal8723PwrSeq.h"
|
||||
|
||||
|
||||
/*
|
||||
drivers should parse below arrays and do the corresponding actions
|
||||
*/
|
||||
//3 Power on Array
|
||||
WLAN_PWR_CFG rtl8723A_power_on_flow[RTL8723A_TRANS_CARDEMU_TO_ACT_STEPS+RTL8723A_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8723A_TRANS_CARDEMU_TO_ACT
|
||||
RTL8723A_TRANS_END
|
||||
};
|
||||
|
||||
//3 Radio off GPIO Array
|
||||
WLAN_PWR_CFG rtl8723A_radio_off_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8723A_TRANS_ACT_TO_CARDEMU
|
||||
RTL8723A_TRANS_END
|
||||
};
|
||||
|
||||
//3 Card Disable Array
|
||||
WLAN_PWR_CFG rtl8723A_card_disable_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS+RTL8723A_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8723A_TRANS_ACT_TO_CARDEMU
|
||||
RTL8723A_TRANS_CARDEMU_TO_CARDDIS
|
||||
RTL8723A_TRANS_END
|
||||
};
|
||||
|
||||
//3 Card Enable Array
|
||||
WLAN_PWR_CFG rtl8723A_card_enable_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS+RTL8723A_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8723A_TRANS_CARDDIS_TO_CARDEMU
|
||||
RTL8723A_TRANS_CARDEMU_TO_ACT
|
||||
RTL8723A_TRANS_END
|
||||
};
|
||||
|
||||
//3 Suspend Array
|
||||
WLAN_PWR_CFG rtl8723A_suspend_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS+RTL8723A_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8723A_TRANS_ACT_TO_CARDEMU
|
||||
RTL8723A_TRANS_CARDEMU_TO_SUS
|
||||
RTL8723A_TRANS_END
|
||||
};
|
||||
|
||||
//3 Resume Array
|
||||
WLAN_PWR_CFG rtl8723A_resume_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_SUS_STEPS+RTL8723A_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8723A_TRANS_SUS_TO_CARDEMU
|
||||
RTL8723A_TRANS_CARDEMU_TO_ACT
|
||||
RTL8723A_TRANS_END
|
||||
};
|
||||
|
||||
//3 HWPDN Array
|
||||
WLAN_PWR_CFG rtl8723A_hwpdn_flow[RTL8723A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8723A_TRANS_CARDEMU_TO_PDN_STEPS+RTL8723A_TRANS_END_STEPS]=
|
||||
{
|
||||
RTL8723A_TRANS_ACT_TO_CARDEMU
|
||||
RTL8723A_TRANS_CARDEMU_TO_PDN
|
||||
RTL8723A_TRANS_END
|
||||
};
|
||||
|
||||
//3 Enter LPS
|
||||
WLAN_PWR_CFG rtl8723A_enter_lps_flow[RTL8723A_TRANS_ACT_TO_LPS_STEPS+RTL8723A_TRANS_END_STEPS]=
|
||||
{
|
||||
//FW behavior
|
||||
RTL8723A_TRANS_ACT_TO_LPS
|
||||
RTL8723A_TRANS_END
|
||||
};
|
||||
|
||||
//3 Leave LPS
|
||||
WLAN_PWR_CFG rtl8723A_leave_lps_flow[RTL8723A_TRANS_LPS_TO_ACT_STEPS+RTL8723A_TRANS_END_STEPS]=
|
||||
{
|
||||
//FW behavior
|
||||
RTL8723A_TRANS_LPS_TO_ACT
|
||||
RTL8723A_TRANS_END
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,594 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
//============================================================
|
||||
// Description:
|
||||
//
|
||||
// This file is for 92CE/92CU dynamic mechanism only
|
||||
//
|
||||
//
|
||||
//============================================================
|
||||
#define _RTL8723A_DM_C_
|
||||
|
||||
//============================================================
|
||||
// include files
|
||||
//============================================================
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtw_byteorder.h>
|
||||
|
||||
#include <rtl8723a_hal.h>
|
||||
|
||||
//============================================================
|
||||
// Global var
|
||||
//============================================================
|
||||
|
||||
|
||||
static VOID
|
||||
dm_CheckProtection(
|
||||
IN PADAPTER Adapter
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo);
|
||||
u1Byte CurRate, RateThreshold;
|
||||
|
||||
if(pMgntInfo->pHTInfo->bCurBW40MHz)
|
||||
RateThreshold = MGN_MCS1;
|
||||
else
|
||||
RateThreshold = MGN_MCS3;
|
||||
|
||||
if(Adapter->TxStats.CurrentInitTxRate <= RateThreshold)
|
||||
{
|
||||
pMgntInfo->bDmDisableProtect = TRUE;
|
||||
DbgPrint("Forced disable protect: %x\n", Adapter->TxStats.CurrentInitTxRate);
|
||||
}
|
||||
else
|
||||
{
|
||||
pMgntInfo->bDmDisableProtect = FALSE;
|
||||
DbgPrint("Enable protect: %x\n", Adapter->TxStats.CurrentInitTxRate);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static VOID
|
||||
dm_CheckStatistics(
|
||||
IN PADAPTER Adapter
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
if(!Adapter->MgntInfo.bMediaConnect)
|
||||
return;
|
||||
|
||||
//2008.12.10 tynli Add for getting Current_Tx_Rate_Reg flexibly.
|
||||
rtw_hal_get_hwreg( Adapter, HW_VAR_INIT_TX_RATE, (pu1Byte)(&Adapter->TxStats.CurrentInitTxRate) );
|
||||
|
||||
// Calculate current Tx Rate(Successful transmited!!)
|
||||
|
||||
// Calculate current Rx Rate(Successful received!!)
|
||||
|
||||
//for tx tx retry count
|
||||
rtw_hal_get_hwreg( Adapter, HW_VAR_RETRY_COUNT, (pu1Byte)(&Adapter->TxStats.NumTxRetryCount) );
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SUPPORT_HW_WPS_PBC
|
||||
static void dm_CheckPbcGPIO(_adapter *padapter)
|
||||
{
|
||||
u8 tmp1byte;
|
||||
u8 bPbcPressed = _FALSE;
|
||||
|
||||
if(!padapter->registrypriv.hw_wps_pbc)
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
tmp1byte = rtw_read8(padapter, GPIO_IO_SEL);
|
||||
tmp1byte |= (HAL_8192C_HW_GPIO_WPS_BIT);
|
||||
rtw_write8(padapter, GPIO_IO_SEL, tmp1byte); //enable GPIO[2] as output mode
|
||||
|
||||
tmp1byte &= ~(HAL_8192C_HW_GPIO_WPS_BIT);
|
||||
rtw_write8(padapter, GPIO_IN, tmp1byte); //reset the floating voltage level
|
||||
|
||||
tmp1byte = rtw_read8(padapter, GPIO_IO_SEL);
|
||||
tmp1byte &= ~(HAL_8192C_HW_GPIO_WPS_BIT);
|
||||
rtw_write8(padapter, GPIO_IO_SEL, tmp1byte); //enable GPIO[2] as input mode
|
||||
|
||||
tmp1byte =rtw_read8(padapter, GPIO_IN);
|
||||
|
||||
if (tmp1byte == 0xff)
|
||||
return ;
|
||||
|
||||
if (tmp1byte&HAL_8192C_HW_GPIO_WPS_BIT)
|
||||
{
|
||||
bPbcPressed = _TRUE;
|
||||
}
|
||||
#else
|
||||
tmp1byte = rtw_read8(padapter, GPIO_IN);
|
||||
//RT_TRACE(COMP_IO, DBG_TRACE, ("dm_CheckPbcGPIO - %x\n", tmp1byte));
|
||||
|
||||
if (tmp1byte == 0xff || padapter->init_adpt_in_progress)
|
||||
return ;
|
||||
|
||||
if((tmp1byte&HAL_8192C_HW_GPIO_WPS_BIT)==0)
|
||||
{
|
||||
bPbcPressed = _TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if( _TRUE == bPbcPressed)
|
||||
{
|
||||
// Here we only set bPbcPressed to true
|
||||
// After trigger PBC, the variable will be set to false
|
||||
DBG_8192C("CheckPbcGPIO - PBC is pressed\n");
|
||||
|
||||
#ifdef RTK_DMP_PLATFORM
|
||||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12))
|
||||
kobject_uevent(&padapter->pnetdev->dev.kobj, KOBJ_NET_PBC);
|
||||
#else
|
||||
kobject_hotplug(&padapter->pnetdev->class_dev.kobj, KOBJ_NET_PBC);
|
||||
#endif
|
||||
#else
|
||||
|
||||
if ( padapter->pid[0] == 0 )
|
||||
{ // 0 is the default value and it means the application monitors the HW PBC doesn't privde its pid to driver.
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
rtw_signal_process(padapter->pid[0], SIGUSR1);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif //#ifdef CONFIG_SUPPORT_HW_WPS_PBC
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
//
|
||||
// Description:
|
||||
// Perform interrupt migration dynamically to reduce CPU utilization.
|
||||
//
|
||||
// Assumption:
|
||||
// 1. Do not enable migration under WIFI test.
|
||||
//
|
||||
// Created by Roger, 2010.03.05.
|
||||
//
|
||||
VOID
|
||||
dm_InterruptMigration(
|
||||
IN PADAPTER Adapter
|
||||
)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
|
||||
BOOLEAN bCurrentIntMt, bCurrentACIntDisable;
|
||||
BOOLEAN IntMtToSet = _FALSE;
|
||||
BOOLEAN ACIntToSet = _FALSE;
|
||||
|
||||
|
||||
// Retrieve current interrupt migration and Tx four ACs IMR settings first.
|
||||
bCurrentIntMt = pHalData->bInterruptMigration;
|
||||
bCurrentACIntDisable = pHalData->bDisableTxInt;
|
||||
|
||||
//
|
||||
// <Roger_Notes> Currently we use busy traffic for reference instead of RxIntOK counts to prevent non-linear Rx statistics
|
||||
// when interrupt migration is set before. 2010.03.05.
|
||||
//
|
||||
if(!Adapter->registrypriv.wifi_spec &&
|
||||
(check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) &&
|
||||
pmlmepriv->LinkDetectInfo.bHigherBusyTraffic)
|
||||
{
|
||||
IntMtToSet = _TRUE;
|
||||
|
||||
// To check whether we should disable Tx interrupt or not.
|
||||
if(pmlmepriv->LinkDetectInfo.bHigherBusyRxTraffic )
|
||||
ACIntToSet = _TRUE;
|
||||
}
|
||||
|
||||
//Update current settings.
|
||||
if( bCurrentIntMt != IntMtToSet ){
|
||||
DBG_8192C("%s(): Update interrrupt migration(%d)\n",__FUNCTION__,IntMtToSet);
|
||||
if(IntMtToSet)
|
||||
{
|
||||
//
|
||||
// <Roger_Notes> Set interrrupt migration timer and corresponging Tx/Rx counter.
|
||||
// timer 25ns*0xfa0=100us for 0xf packets.
|
||||
// 2010.03.05.
|
||||
//
|
||||
rtw_write32(Adapter, REG_INT_MIG, 0xff000fa0);// 0x306:Rx, 0x307:Tx
|
||||
pHalData->bInterruptMigration = IntMtToSet;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Reset all interrupt migration settings.
|
||||
rtw_write32(Adapter, REG_INT_MIG, 0);
|
||||
pHalData->bInterruptMigration = IntMtToSet;
|
||||
}
|
||||
}
|
||||
|
||||
/*if( bCurrentACIntDisable != ACIntToSet ){
|
||||
DBG_8192C("%s(): Update AC interrrupt(%d)\n",__FUNCTION__,ACIntToSet);
|
||||
if(ACIntToSet) // Disable four ACs interrupts.
|
||||
{
|
||||
//
|
||||
// <Roger_Notes> Disable VO, VI, BE and BK four AC interrupts to gain more efficient CPU utilization.
|
||||
// When extremely highly Rx OK occurs, we will disable Tx interrupts.
|
||||
// 2010.03.05.
|
||||
//
|
||||
UpdateInterruptMask8192CE( Adapter, 0, RT_AC_INT_MASKS );
|
||||
pHalData->bDisableTxInt = ACIntToSet;
|
||||
}
|
||||
else// Enable four ACs interrupts.
|
||||
{
|
||||
UpdateInterruptMask8192CE( Adapter, RT_AC_INT_MASKS, 0 );
|
||||
pHalData->bDisableTxInt = ACIntToSet;
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Initialize GPIO setting registers
|
||||
//
|
||||
static void
|
||||
dm_InitGPIOSetting(
|
||||
IN PADAPTER Adapter
|
||||
)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
u8 tmp1byte;
|
||||
|
||||
tmp1byte = rtw_read8(Adapter, REG_GPIO_MUXCFG);
|
||||
tmp1byte &= (GPIOSEL_GPIO | ~GPIOSEL_ENBT);
|
||||
|
||||
rtw_write8(Adapter, REG_GPIO_MUXCFG, tmp1byte);
|
||||
}
|
||||
//============================================================
|
||||
// functions
|
||||
//============================================================
|
||||
static void Init_ODM_ComInfo_8723a(PADAPTER Adapter)
|
||||
{
|
||||
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
|
||||
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
|
||||
u8 cut_ver,fab_ver;
|
||||
|
||||
//
|
||||
// Init Value
|
||||
//
|
||||
_rtw_memset(pDM_Odm,0,sizeof(pDM_Odm));
|
||||
|
||||
pDM_Odm->Adapter = Adapter;
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_PLATFORM,ODM_CE);
|
||||
if(Adapter->interface_type == RTW_GSPI )
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_INTERFACE,ODM_ITRF_SDIO);
|
||||
else
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_INTERFACE,Adapter->interface_type);//RTL871X_HCI_TYPE
|
||||
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_IC_TYPE,ODM_RTL8723A);
|
||||
|
||||
|
||||
if(IS_8723A_A_CUT(pHalData->VersionID))
|
||||
{
|
||||
fab_ver = ODM_UMC;
|
||||
cut_ver = ODM_CUT_A;
|
||||
}
|
||||
else if(IS_8723A_B_CUT(pHalData->VersionID))
|
||||
{
|
||||
fab_ver = ODM_UMC;
|
||||
cut_ver = ODM_CUT_B;
|
||||
}
|
||||
else
|
||||
{
|
||||
fab_ver = ODM_TSMC;
|
||||
cut_ver = ODM_CUT_A;
|
||||
}
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_FAB_VER,fab_ver);
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_CUT_VER,cut_ver);
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_MP_TEST_CHIP,IS_NORMAL_CHIP(pHalData->VersionID));
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_BOARD_TYPE,pHalData->BoardType);
|
||||
|
||||
if(pHalData->BoardType == BOARD_USB_High_PA){
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_EXT_LNA,_TRUE);
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_EXT_PA,_TRUE);
|
||||
}
|
||||
#endif
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_PATCH_ID,pHalData->CustomerID);
|
||||
// ODM_CMNINFO_BINHCT_TEST only for MP Team
|
||||
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_BWIFI_TEST,Adapter->registrypriv.wifi_spec);
|
||||
|
||||
|
||||
if(pHalData->rf_type == RF_1T1R){
|
||||
ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_RF_TYPE,ODM_1T1R);
|
||||
}
|
||||
else if(pHalData->rf_type == RF_2T2R){
|
||||
ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_RF_TYPE,ODM_2T2R);
|
||||
}
|
||||
else if(pHalData->rf_type == RF_1T2R){
|
||||
ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_RF_TYPE,ODM_1T2R);
|
||||
}
|
||||
}
|
||||
static void Update_ODM_ComInfo_8723a(PADAPTER Adapter)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
|
||||
struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(Adapter);
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
|
||||
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
|
||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
int i;
|
||||
|
||||
pdmpriv->InitODMFlag = 0
|
||||
| ODM_BB_DIG
|
||||
#ifdef CONFIG_ODM_REFRESH_RAMASK
|
||||
| ODM_BB_RA_MASK
|
||||
#endif
|
||||
| ODM_BB_DYNAMIC_TXPWR
|
||||
| ODM_BB_FA_CNT
|
||||
| ODM_BB_RSSI_MONITOR
|
||||
| ODM_BB_CCK_PD
|
||||
| ODM_BB_PWR_SAVE
|
||||
| ODM_MAC_EDCA_TURBO
|
||||
| ODM_RF_TX_PWR_TRACK
|
||||
| ODM_RF_CALIBRATION
|
||||
#ifdef CONFIG_ODM_ADAPTIVITY
|
||||
| ODM_BB_ADAPTIVITY
|
||||
#endif
|
||||
;
|
||||
|
||||
#ifdef CONFIG_ANTENNA_DIVERSITY
|
||||
if(pHalData->AntDivCfg)
|
||||
pdmpriv->InitODMFlag |= ODM_BB_ANT_DIV;
|
||||
#endif
|
||||
|
||||
#if (MP_DRIVER==1)
|
||||
if (Adapter->registrypriv.mp_mode == 1) {
|
||||
pdmpriv->InitODMFlag = 0
|
||||
| ODM_RF_CALIBRATION
|
||||
| ODM_RF_TX_PWR_TRACK
|
||||
;
|
||||
}
|
||||
#endif//(MP_DRIVER==1)
|
||||
|
||||
#ifdef CONFIG_DISABLE_ODM
|
||||
pdmpriv->InitODMFlag = 0;
|
||||
#endif//CONFIG_DISABLE_ODM
|
||||
|
||||
//
|
||||
// Pointer reference
|
||||
//
|
||||
//ODM_CMNINFO_MAC_PHY_MODE pHalData->MacPhyMode92D
|
||||
// ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_MAC_PHY_MODE,&(pDM_Odm->u1Byte_temp));
|
||||
|
||||
ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_ABILITY,pdmpriv->InitODMFlag);
|
||||
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_TX_UNI,&(Adapter->xmitpriv.tx_bytes));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_RX_UNI,&(Adapter->recvpriv.rx_bytes));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_WM_MODE,&(pmlmeext->cur_wireless_mode));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_SEC_CHNL_OFFSET,&(pHalData->nCur40MhzPrimeSC));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_SEC_MODE,&(Adapter->securitypriv.dot11PrivacyAlgrthm));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_BW,&(pHalData->CurrentChannelBW ));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_CHNL,&( pHalData->CurrentChannel));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_NET_CLOSED,&( Adapter->net_closed));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_MP_MODE,&(Adapter->registrypriv.mp_mode));
|
||||
|
||||
//================= only for 8192D =================
|
||||
/*
|
||||
//pHalData->CurrentBandType92D
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_BAND,&(pDM_Odm->u1Byte_temp));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_DMSP_GET_VALUE,&(pDM_Odm->u1Byte_temp));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_BUDDY_ADAPTOR,&(pDM_Odm->PADAPTER_temp));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_DMSP_IS_MASTER,&(pDM_Odm->u1Byte_temp));
|
||||
//================= only for 8192D =================
|
||||
// driver havn't those variable now
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_BT_OPERATION,&(pDM_Odm->u1Byte_temp));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_BT_DISABLE_EDCA,&(pDM_Odm->u1Byte_temp));
|
||||
*/
|
||||
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_SCAN,&(pmlmepriv->bScanInProcess));
|
||||
ODM_CmnInfoHook(pDM_Odm,ODM_CMNINFO_POWER_SAVING,&(pwrctrlpriv->bpower_saving));
|
||||
|
||||
|
||||
for(i=0; i< NUM_STA; i++)
|
||||
{
|
||||
//pDM_Odm->pODM_StaInfo[i] = NULL;
|
||||
ODM_CmnInfoPtrArrayHook(pDM_Odm, ODM_CMNINFO_STA_STATUS,i,NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rtl8723a_InitHalDm(
|
||||
IN PADAPTER Adapter
|
||||
)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
|
||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
|
||||
|
||||
u8 i;
|
||||
|
||||
pdmpriv->DM_Type = DM_Type_ByDriver;
|
||||
pdmpriv->DMFlag = DYNAMIC_FUNC_DISABLE;
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
pdmpriv->DMFlag |= DYNAMIC_FUNC_BT;
|
||||
// btdm_InitBtCoexistDM(Adapter); // Move to BT_CoexistMechanism()
|
||||
#endif
|
||||
pdmpriv->InitDMFlag = pdmpriv->DMFlag;
|
||||
|
||||
Update_ODM_ComInfo_8723a(Adapter);
|
||||
ODM_DMInit(pDM_Odm);
|
||||
// Save REG_INIDATA_RATE_SEL value for TXDESC.
|
||||
for(i = 0 ; i<32 ; i++)
|
||||
{
|
||||
pdmpriv->INIDATA_RATE[i] = rtw_read8(Adapter, REG_INIDATA_RATE_SEL+i) & 0x3f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
VOID
|
||||
rtl8723a_HalDmWatchDog(
|
||||
IN PADAPTER Adapter
|
||||
)
|
||||
{
|
||||
BOOLEAN bFwCurrentInPSMode = _FALSE;
|
||||
BOOLEAN bFwPSAwake = _TRUE;
|
||||
u8 hw_init_completed = _FALSE;
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
|
||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
PADAPTER pbuddy_adapter = Adapter->pbuddy_adapter;
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
hw_init_completed = Adapter->hw_init_completed;
|
||||
|
||||
#if (MP_DRIVER == 1)
|
||||
if (Adapter->registrypriv.mp_mode == 1 && Adapter->mppriv.mp_dm ==0)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (hw_init_completed == _FALSE)
|
||||
goto skip_dm;
|
||||
|
||||
#ifdef CONFIG_LPS
|
||||
bFwCurrentInPSMode = adapter_to_pwrctl(Adapter)->bFwCurrentInPSMode;
|
||||
rtw_hal_get_hwreg(Adapter, HW_VAR_FWLPS_RF_ON, (u8 *)(&bFwPSAwake));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_P2P_PS
|
||||
// Fw is under p2p powersaving mode, driver should stop dynamic mechanism.
|
||||
// modifed by thomas. 2011.06.11.
|
||||
if(Adapter->wdinfo.p2p_ps_mode)
|
||||
bFwPSAwake = _FALSE;
|
||||
#endif //CONFIG_P2P_PS
|
||||
|
||||
if( (hw_init_completed == _TRUE)
|
||||
&& ((!bFwCurrentInPSMode) && bFwPSAwake))
|
||||
{
|
||||
//
|
||||
// Calculate Tx/Rx statistics.
|
||||
//
|
||||
dm_CheckStatistics(Adapter);
|
||||
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(Adapter->adapter_type > PRIMARY_ADAPTER)
|
||||
goto _record_initrate;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Dynamically switch RTS/CTS protection.
|
||||
//
|
||||
//dm_CheckProtection(Adapter);
|
||||
|
||||
#ifdef CONFIG_PCI_HCI
|
||||
// 20100630 Joseph: Disable Interrupt Migration mechanism temporarily because it degrades Rx throughput.
|
||||
// Tx Migration settings.
|
||||
//dm_InterruptMigration(Adapter);
|
||||
|
||||
//if(Adapter->HalFunc.TxCheckStuckHandler(Adapter))
|
||||
// PlatformScheduleWorkItem(&(GET_HAL_DATA(Adapter)->HalResetWorkItem));
|
||||
#endif
|
||||
_record_initrate:
|
||||
|
||||
// Read REG_INIDATA_RATE_SEL value for TXDESC.
|
||||
if(check_fwstate(&Adapter->mlmepriv, WIFI_STATION_STATE) == _TRUE)
|
||||
{
|
||||
pdmpriv->INIDATA_RATE[0] = rtw_read8(Adapter, REG_INIDATA_RATE_SEL) & 0x3f;
|
||||
}
|
||||
else
|
||||
{
|
||||
u8 i;
|
||||
for(i=1 ; i < (Adapter->stapriv.asoc_sta_count + 1); i++)
|
||||
{
|
||||
pdmpriv->INIDATA_RATE[i] = rtw_read8(Adapter, (REG_INIDATA_RATE_SEL+i)) & 0x3f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//ODM
|
||||
if (hw_init_completed == _TRUE)
|
||||
{
|
||||
u8 bLinked=_FALSE;
|
||||
u8 bsta_state=_FALSE;
|
||||
|
||||
#ifdef CONFIG_DISABLE_ODM
|
||||
pHalData->odmpriv.SupportAbility = 0;
|
||||
#endif
|
||||
|
||||
if(rtw_linked_check(Adapter))
|
||||
bLinked = _TRUE;
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(pbuddy_adapter && rtw_linked_check(pbuddy_adapter))
|
||||
bLinked = _TRUE;
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
|
||||
ODM_CmnInfoUpdate(&pHalData->odmpriv ,ODM_CMNINFO_LINK, bLinked);
|
||||
|
||||
if (check_fwstate(&Adapter->mlmepriv, WIFI_STATION_STATE))
|
||||
bsta_state = _TRUE;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(pbuddy_adapter && check_fwstate(&pbuddy_adapter->mlmepriv, WIFI_STATION_STATE))
|
||||
bsta_state = _TRUE;
|
||||
#endif //CONFIG_CONCURRENT_MODE
|
||||
ODM_CmnInfoUpdate(&pHalData->odmpriv ,ODM_CMNINFO_STATION_STATE, bsta_state);
|
||||
|
||||
|
||||
ODM_DMWatchdog(&pHalData->odmpriv);
|
||||
|
||||
}
|
||||
|
||||
skip_dm:
|
||||
#ifdef CONFIG_SUPPORT_HW_WPS_PBC
|
||||
// Check GPIO to determine current Pbc status.
|
||||
dm_CheckPbcGPIO(Adapter);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
void rtl8723a_init_dm_priv(IN PADAPTER Adapter)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
|
||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
PDM_ODM_T podmpriv = &pHalData->odmpriv;
|
||||
_rtw_memset(pdmpriv, 0, sizeof(struct dm_priv));
|
||||
Init_ODM_ComInfo_8723a(Adapter);
|
||||
#ifdef CONFIG_SW_ANTENNA_DIVERSITY
|
||||
//_init_timer(&(pdmpriv->SwAntennaSwitchTimer), Adapter->pnetdev , odm_SW_AntennaSwitchCallback, Adapter);
|
||||
ODM_InitAllTimers(podmpriv );
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtl8723a_deinit_dm_priv(IN PADAPTER Adapter)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
|
||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
PDM_ODM_T podmpriv = &pHalData->odmpriv;
|
||||
#ifdef CONFIG_SW_ANTENNA_DIVERSITY
|
||||
//_cancel_timer_ex(&pdmpriv->SwAntennaSwitchTimer);
|
||||
ODM_CancelAllTimers(podmpriv);
|
||||
#endif
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,739 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTL8723A_REDESC_C_
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtl8723a_hal.h>
|
||||
|
||||
#if 0
|
||||
static u8 evm_db2percentage(s8 value)
|
||||
{
|
||||
//
|
||||
// -33dB~0dB to 0%~99%
|
||||
//
|
||||
s8 ret_val;
|
||||
|
||||
ret_val = value;
|
||||
//ret_val /= 2;
|
||||
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("EVMdbToPercentage92S Value=%d / %x \n", ret_val, ret_val));
|
||||
|
||||
if(ret_val >= 0)
|
||||
ret_val = 0;
|
||||
if(ret_val <= -33)
|
||||
ret_val = -33;
|
||||
|
||||
ret_val = 0 - ret_val;
|
||||
ret_val*=3;
|
||||
|
||||
if(ret_val == 99)
|
||||
ret_val = 100;
|
||||
|
||||
return(ret_val);
|
||||
}
|
||||
|
||||
|
||||
static s32 signal_scale_mapping(_adapter *padapter, s32 cur_sig )
|
||||
{
|
||||
s32 ret_sig;
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
if(cur_sig >= 51 && cur_sig <= 100)
|
||||
{
|
||||
ret_sig = 100;
|
||||
}
|
||||
else if(cur_sig >= 41 && cur_sig <= 50)
|
||||
{
|
||||
ret_sig = 80 + ((cur_sig - 40)*2);
|
||||
}
|
||||
else if(cur_sig >= 31 && cur_sig <= 40)
|
||||
{
|
||||
ret_sig = 66 + (cur_sig - 30);
|
||||
}
|
||||
else if(cur_sig >= 21 && cur_sig <= 30)
|
||||
{
|
||||
ret_sig = 54 + (cur_sig - 20);
|
||||
}
|
||||
else if(cur_sig >= 10 && cur_sig <= 20)
|
||||
{
|
||||
ret_sig = 42 + (((cur_sig - 10) * 2) / 3);
|
||||
}
|
||||
else if(cur_sig >= 5 && cur_sig <= 9)
|
||||
{
|
||||
ret_sig = 22 + (((cur_sig - 5) * 3) / 2);
|
||||
}
|
||||
else if(cur_sig >= 1 && cur_sig <= 4)
|
||||
{
|
||||
ret_sig = 6 + (((cur_sig - 1) * 3) / 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_sig = cur_sig;
|
||||
}
|
||||
#else
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
if(pHalData->CustomerID == RT_CID_819x_Lenovo)
|
||||
{
|
||||
// Step 1. Scale mapping.
|
||||
// 20100611 Joseph: Re-tunning RSSI presentation for Lenovo.
|
||||
// 20100426 Joseph: Modify Signal strength mapping.
|
||||
// This modification makes the RSSI indication similar to Intel solution.
|
||||
// 20100414 Joseph: Tunning RSSI for Lenovo according to RTL8191SE.
|
||||
if(cur_sig >= 54 && cur_sig <= 100)
|
||||
{
|
||||
ret_sig = 100;
|
||||
}
|
||||
else if(cur_sig>=42 && cur_sig <= 53 )
|
||||
{
|
||||
ret_sig = 95;
|
||||
}
|
||||
else if(cur_sig>=36 && cur_sig <= 41 )
|
||||
{
|
||||
ret_sig = 74 + ((cur_sig - 36) *20)/6;
|
||||
}
|
||||
else if(cur_sig>=33 && cur_sig <= 35 )
|
||||
{
|
||||
ret_sig = 65 + ((cur_sig - 33) *8)/2;
|
||||
}
|
||||
else if(cur_sig>=18 && cur_sig <= 32 )
|
||||
{
|
||||
ret_sig = 62 + ((cur_sig - 18) *2)/15;
|
||||
}
|
||||
else if(cur_sig>=15 && cur_sig <= 17 )
|
||||
{
|
||||
ret_sig = 33 + ((cur_sig - 15) *28)/2;
|
||||
}
|
||||
else if(cur_sig>=10 && cur_sig <= 14 )
|
||||
{
|
||||
ret_sig = 39;
|
||||
}
|
||||
else if(cur_sig>=8 && cur_sig <= 9 )
|
||||
{
|
||||
ret_sig = 33;
|
||||
}
|
||||
else if(cur_sig <= 8 )
|
||||
{
|
||||
ret_sig = 19;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Step 1. Scale mapping.
|
||||
if(cur_sig >= 61 && cur_sig <= 100)
|
||||
{
|
||||
ret_sig = 90 + ((cur_sig - 60) / 4);
|
||||
}
|
||||
else if(cur_sig >= 41 && cur_sig <= 60)
|
||||
{
|
||||
ret_sig = 78 + ((cur_sig - 40) / 2);
|
||||
}
|
||||
else if(cur_sig >= 31 && cur_sig <= 40)
|
||||
{
|
||||
ret_sig = 66 + (cur_sig - 30);
|
||||
}
|
||||
else if(cur_sig >= 21 && cur_sig <= 30)
|
||||
{
|
||||
ret_sig = 54 + (cur_sig - 20);
|
||||
}
|
||||
else if(cur_sig >= 5 && cur_sig <= 20)
|
||||
{
|
||||
ret_sig = 42 + (((cur_sig - 5) * 2) / 3);
|
||||
}
|
||||
else if(cur_sig == 4)
|
||||
{
|
||||
ret_sig = 36;
|
||||
}
|
||||
else if(cur_sig == 3)
|
||||
{
|
||||
ret_sig = 27;
|
||||
}
|
||||
else if(cur_sig == 2)
|
||||
{
|
||||
ret_sig = 18;
|
||||
}
|
||||
else if(cur_sig == 1)
|
||||
{
|
||||
ret_sig = 9;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_sig = cur_sig;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret_sig;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void rtl8192c_query_rx_phy_status(union recv_frame *prframe, struct phy_stat *pphy_stat)
|
||||
{
|
||||
PHY_STS_OFDM_8192CD_T *pOfdm_buf;
|
||||
PHY_STS_CCK_8192CD_T *pCck_buf;
|
||||
u8 i, max_spatial_stream, evm;
|
||||
s8 rx_pwr[4], rx_pwr_all = 0;
|
||||
u8 pwdb_all;
|
||||
u32 rssi,total_rssi=0;
|
||||
u8 bcck_rate=0, rf_rx_num = 0, cck_highpwr = 0;
|
||||
_adapter *padapter = prframe->u.hdr.adapter;
|
||||
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
u8 tmp_rxsnr;
|
||||
s8 rx_snrX;
|
||||
|
||||
#ifdef CONFIG_HW_ANTENNA_DIVERSITY
|
||||
PHY_RX_DRIVER_INFO_8192CD *pDrvInfo = ((PHY_RX_DRIVER_INFO_8192CD *)pphy_stat);
|
||||
u8 bant1_sel = (pDrvInfo->ANTSEL == 1)?_TRUE:_FALSE;
|
||||
#endif
|
||||
if(pphy_stat==NULL){
|
||||
// DBG_8192C("\n%s pphy_stat is NULL, Return\n",__FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
// Record it for next packet processing
|
||||
bcck_rate=(pattrib->mcs_rate<=3? 1:0);
|
||||
|
||||
if(bcck_rate) //CCK
|
||||
{
|
||||
u8 report;
|
||||
#ifdef CONFIG_HW_ANTENNA_DIVERSITY
|
||||
if(bant1_sel == _TRUE)
|
||||
pHalData->CCK_Ant1_Cnt++;
|
||||
else
|
||||
pHalData->CCK_Ant2_Cnt++;
|
||||
#endif
|
||||
|
||||
// CCK Driver info Structure is not the same as OFDM packet.
|
||||
pCck_buf = (PHY_STS_CCK_8192CD_T *)pphy_stat;
|
||||
//Adapter->RxStats.NumQryPhyStatusCCK++;
|
||||
|
||||
//
|
||||
// (1)Hardware does not provide RSSI for CCK
|
||||
// (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive)
|
||||
//
|
||||
|
||||
if(adapter_to_pwrctl(padapter)->rf_pwrstate == rf_on)
|
||||
cck_highpwr = (u8)pHalData->bCckHighPower;
|
||||
else
|
||||
cck_highpwr = _FALSE;
|
||||
|
||||
if(!cck_highpwr)
|
||||
{
|
||||
report = pCck_buf->cck_agc_rpt&0xc0;
|
||||
report = report>>6;
|
||||
switch(report)
|
||||
{
|
||||
// 03312009 modified by cosa
|
||||
// Modify the RF RNA gain value to -40, -20, -2, 14 by Jenyu's suggestion
|
||||
// Note: different RF with the different RNA gain.
|
||||
case 0x3:
|
||||
rx_pwr_all = (-46) - (pCck_buf->cck_agc_rpt & 0x3e);
|
||||
break;
|
||||
case 0x2:
|
||||
rx_pwr_all = (-26) - (pCck_buf->cck_agc_rpt & 0x3e);
|
||||
break;
|
||||
case 0x1:
|
||||
rx_pwr_all = (-12) - (pCck_buf->cck_agc_rpt & 0x3e);
|
||||
break;
|
||||
case 0x0:
|
||||
rx_pwr_all = (16) - (pCck_buf->cck_agc_rpt & 0x3e);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
report = pCck_buf->cck_agc_rpt & 0x60;
|
||||
report = report>>5;
|
||||
switch(report)
|
||||
{
|
||||
case 0x3:
|
||||
rx_pwr_all = (-46) - ((pCck_buf->cck_agc_rpt & 0x1f)<<1) ;
|
||||
break;
|
||||
case 0x2:
|
||||
rx_pwr_all = (-26)- ((pCck_buf->cck_agc_rpt & 0x1f)<<1);
|
||||
break;
|
||||
case 0x1:
|
||||
rx_pwr_all = (-12) - ((pCck_buf->cck_agc_rpt & 0x1f)<<1) ;
|
||||
break;
|
||||
case 0x0:
|
||||
rx_pwr_all = (16) - ((pCck_buf->cck_agc_rpt & 0x1f)<<1) ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pwdb_all= query_rx_pwr_percentage(rx_pwr_all);
|
||||
if(pHalData->CustomerID == RT_CID_819x_Lenovo)
|
||||
{
|
||||
// CCK gain is smaller than OFDM/MCS gain,
|
||||
// so we add gain diff by experiences, the val is 6
|
||||
pwdb_all+=6;
|
||||
if(pwdb_all > 100)
|
||||
pwdb_all = 100;
|
||||
// modify the offset to make the same gain index with OFDM.
|
||||
if(pwdb_all > 34 && pwdb_all <= 42)
|
||||
pwdb_all -= 2;
|
||||
else if(pwdb_all > 26 && pwdb_all <= 34)
|
||||
pwdb_all -= 6;
|
||||
else if(pwdb_all > 14 && pwdb_all <= 26)
|
||||
pwdb_all -= 8;
|
||||
else if(pwdb_all > 4 && pwdb_all <= 14)
|
||||
pwdb_all -= 4;
|
||||
}
|
||||
|
||||
pattrib->RxPWDBAll = pwdb_all; //for DIG/rate adaptive
|
||||
pattrib->RecvSignalPower = rx_pwr_all; //dBM
|
||||
padapter->recvpriv.rxpwdb = rx_pwr_all;
|
||||
//
|
||||
// (3) Get Signal Quality (EVM)
|
||||
//
|
||||
//if(bPacketMatchBSSID)
|
||||
{
|
||||
u8 sq;
|
||||
|
||||
if(pHalData->CustomerID == RT_CID_819x_Lenovo)
|
||||
{
|
||||
// mapping to 5 bars for vista signal strength
|
||||
// signal quality in driver will be displayed to signal strength
|
||||
// in vista.
|
||||
if(pwdb_all >= 50)
|
||||
sq = 100;
|
||||
else if(pwdb_all >= 35 && pwdb_all < 50)
|
||||
sq = 80;
|
||||
else if(pwdb_all >= 22 && pwdb_all < 35)
|
||||
sq = 60;
|
||||
else if(pwdb_all >= 18 && pwdb_all < 22)
|
||||
sq = 40;
|
||||
else
|
||||
sq = 20;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pwdb_all> 40)
|
||||
{
|
||||
sq = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
sq = pCck_buf->SQ_rpt;
|
||||
|
||||
if(pCck_buf->SQ_rpt > 64)
|
||||
sq = 0;
|
||||
else if (pCck_buf->SQ_rpt < 20)
|
||||
sq= 100;
|
||||
else
|
||||
sq = ((64-sq) * 100) / 44;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
pattrib->signal_qual=sq;
|
||||
pattrib->rx_mimo_signal_qual[0]=sq;
|
||||
pattrib->rx_mimo_signal_qual[1]=(-1);
|
||||
}
|
||||
|
||||
}
|
||||
else //OFDM/HT
|
||||
{
|
||||
#ifdef CONFIG_HW_ANTENNA_DIVERSITY
|
||||
if(bant1_sel == _TRUE)
|
||||
pHalData->OFDM_Ant1_Cnt++;
|
||||
else
|
||||
pHalData->OFDM_Ant2_Cnt++;
|
||||
#endif
|
||||
pdmpriv->OFDM_Pkt_Cnt++;
|
||||
|
||||
pOfdm_buf = (PHY_STS_OFDM_8192CD_T *)pphy_stat;
|
||||
|
||||
//
|
||||
// (1)Get RSSI per-path
|
||||
//
|
||||
for(i=0; i<pHalData->NumTotalRFPath; i++)
|
||||
{
|
||||
// 2008/01/30 MH we will judge RF RX path now.
|
||||
if (pHalData->bRFPathRxEnable[i])
|
||||
rf_rx_num++;
|
||||
//else
|
||||
//continue;
|
||||
|
||||
rx_pwr[i] = ((pOfdm_buf->trsw_gain_X[i]&0x3F)*2) - 110;
|
||||
|
||||
/* Translate DBM to percentage. */
|
||||
rssi=query_rx_pwr_percentage(rx_pwr[i]);
|
||||
total_rssi += rssi;
|
||||
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("RF-%d RXPWR=%x RSSI=%d\n", i, rx_pwr[i], rssi));
|
||||
|
||||
//Get Rx snr value in DB
|
||||
tmp_rxsnr = pOfdm_buf->rxsnr_X[i];
|
||||
rx_snrX = (s8)(tmp_rxsnr);
|
||||
rx_snrX >>= 1;
|
||||
padapter->recvpriv.RxSNRdB[i] = (int)rx_snrX;
|
||||
|
||||
/* Record Signal Strength for next packet */
|
||||
//if(bPacketMatchBSSID)
|
||||
{
|
||||
//pRfd->Status.RxMIMOSignalStrength[i] =(u1Byte) RSSI;
|
||||
|
||||
//The following is for lenovo signal strength in vista
|
||||
if(pHalData->CustomerID == RT_CID_819x_Lenovo)
|
||||
{
|
||||
u8 sq;
|
||||
|
||||
if(i == 0)
|
||||
{
|
||||
// mapping to 5 bars for vista signal strength
|
||||
// signal quality in driver will be displayed to signal strength
|
||||
// in vista.
|
||||
if(rssi >= 50)
|
||||
sq = 100;
|
||||
else if(rssi >= 35 && rssi < 50)
|
||||
sq = 80;
|
||||
else if(rssi >= 22 && rssi < 35)
|
||||
sq = 60;
|
||||
else if(rssi >= 18 && rssi < 22)
|
||||
sq = 40;
|
||||
else
|
||||
sq = 20;
|
||||
//DbgPrint("ofdm/mcs RSSI=%d\n", RSSI);
|
||||
//pRfd->Status.SignalQuality = SQ;
|
||||
//DbgPrint("ofdm/mcs SQ = %d\n", pRfd->Status.SignalQuality);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// (2)PWDB, Average PWDB cacluated by hardware (for rate adaptive),average
|
||||
//
|
||||
rx_pwr_all = (((pOfdm_buf->pwdb_all ) >> 1 )& 0x7f) -110;//for OFDM Average RSSI
|
||||
pwdb_all = query_rx_pwr_percentage(rx_pwr_all);
|
||||
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("PWDB_ALL=%d\n", pwdb_all));
|
||||
|
||||
pattrib->RxPWDBAll = pwdb_all; //for DIG/rate adaptive
|
||||
pattrib->RecvSignalPower = rx_pwr_all;//dBM
|
||||
padapter->recvpriv.rxpwdb = rx_pwr_all;
|
||||
//
|
||||
// (3)EVM of HT rate
|
||||
//
|
||||
if(pHalData->CustomerID != RT_CID_819x_Lenovo)
|
||||
{
|
||||
if(pattrib->rxht && pattrib->mcs_rate >=20 && pattrib->mcs_rate<=27)
|
||||
max_spatial_stream = 2; //both spatial stream make sense
|
||||
else
|
||||
max_spatial_stream = 1; //only spatial stream 1 makes sense
|
||||
|
||||
for(i=0; i<max_spatial_stream; i++)
|
||||
{
|
||||
// Do not use shift operation like "rx_evmX >>= 1" because the compilor of free build environment
|
||||
// fill most significant bit to "zero" when doing shifting operation which may change a negative
|
||||
// value to positive one, then the dbm value (which is supposed to be negative) is not correct anymore.
|
||||
evm = evm_db2percentage( (pOfdm_buf->rxevm_X[i]/*/ 2*/));//dbm
|
||||
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("RXRATE=%x RXEVM=%x EVM=%s%d\n",
|
||||
pattrib->mcs_rate, pOfdm_buf->rxevm_X[i], "%",evm));
|
||||
|
||||
//if(bPacketMatchBSSID)
|
||||
{
|
||||
if(i==0) // Fill value in RFD, Get the first spatial stream only
|
||||
{
|
||||
pattrib->signal_qual = (u8)(evm & 0xff);
|
||||
}
|
||||
pattrib->rx_mimo_signal_qual[i] = (u8)(evm & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// 4. Record rx statistics for debug
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
|
||||
//UI BSS List signal strength(in percentage), make it good looking, from 0~100.
|
||||
//It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp().
|
||||
if(bcck_rate)
|
||||
{
|
||||
pattrib->signal_strength=(u8)signal_scale_mapping(padapter, pwdb_all);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rf_rx_num != 0)
|
||||
{
|
||||
pattrib->signal_strength= (u8)(signal_scale_mapping(padapter, total_rssi/=rf_rx_num));
|
||||
}
|
||||
}
|
||||
//DBG_8192C("%s,rx_pwr_all(%d),RxPWDBAll(%d)\n",__FUNCTION__,rx_pwr_all,pattrib->RxPWDBAll);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void process_rssi(_adapter *padapter,union recv_frame *prframe)
|
||||
{
|
||||
u32 last_rssi, tmp_val;
|
||||
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
|
||||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
struct signal_stat * signal_stat = &padapter->recvpriv.signal_strength_data;
|
||||
#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
|
||||
//DBG_8192C("process_rssi=> pattrib->rssil(%d) signal_strength(%d)\n ",pattrib->RecvSignalPower,pattrib->signal_strength);
|
||||
//if(pRfd->Status.bPacketToSelf || pRfd->Status.bPacketBeacon)
|
||||
{
|
||||
|
||||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
if(signal_stat->update_req) {
|
||||
signal_stat->total_num = 0;
|
||||
signal_stat->total_val = 0;
|
||||
signal_stat->update_req = 0;
|
||||
}
|
||||
|
||||
signal_stat->total_num++;
|
||||
signal_stat->total_val += pattrib->phy_info.SignalStrength;
|
||||
signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num;
|
||||
#else //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
|
||||
//Adapter->RxStats.RssiCalculateCnt++; //For antenna Test
|
||||
if(padapter->recvpriv.signal_strength_data.total_num++ >= PHY_RSSI_SLID_WIN_MAX)
|
||||
{
|
||||
padapter->recvpriv.signal_strength_data.total_num = PHY_RSSI_SLID_WIN_MAX;
|
||||
last_rssi = padapter->recvpriv.signal_strength_data.elements[padapter->recvpriv.signal_strength_data.index];
|
||||
padapter->recvpriv.signal_strength_data.total_val -= last_rssi;
|
||||
}
|
||||
padapter->recvpriv.signal_strength_data.total_val +=pattrib->phy_info.SignalStrength;
|
||||
|
||||
padapter->recvpriv.signal_strength_data.elements[padapter->recvpriv.signal_strength_data.index++] = pattrib->phy_info.SignalStrength;
|
||||
if(padapter->recvpriv.signal_strength_data.index >= PHY_RSSI_SLID_WIN_MAX)
|
||||
padapter->recvpriv.signal_strength_data.index = 0;
|
||||
|
||||
|
||||
tmp_val = padapter->recvpriv.signal_strength_data.total_val/padapter->recvpriv.signal_strength_data.total_num;
|
||||
|
||||
if(padapter->recvpriv.is_signal_dbg) {
|
||||
padapter->recvpriv.signal_strength= padapter->recvpriv.signal_strength_dbg;
|
||||
padapter->recvpriv.rssi=(s8)translate_percentage_to_dbm(padapter->recvpriv.signal_strength_dbg);
|
||||
} else {
|
||||
padapter->recvpriv.signal_strength= tmp_val;
|
||||
padapter->recvpriv.rssi=(s8)translate_percentage_to_dbm(tmp_val);
|
||||
}
|
||||
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("UI RSSI = %d, ui_rssi.TotalVal = %d, ui_rssi.TotalNum = %d\n", tmp_val, padapter->recvpriv.signal_strength_data.total_val,padapter->recvpriv.signal_strength_data.total_num));
|
||||
#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
}
|
||||
|
||||
}// Process_UI_RSSI_8192C
|
||||
|
||||
#if 0
|
||||
static void process_PWDB(_adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
int UndecoratedSmoothedPWDB;
|
||||
int UndecoratedSmoothedCCK;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
struct rx_pkt_attrib *pattrib= &prframe->u.hdr.attrib;
|
||||
struct sta_info *psta = prframe->u.hdr.psta;
|
||||
u8 isCCKrate=(pattrib->mcs_rate<=3? 1:0);
|
||||
|
||||
|
||||
if(psta)
|
||||
{
|
||||
UndecoratedSmoothedPWDB = psta->rssi_stat.UndecoratedSmoothedPWDB;
|
||||
UndecoratedSmoothedCCK = psta->rssi_stat.UndecoratedSmoothedCCK;
|
||||
}
|
||||
else
|
||||
{
|
||||
UndecoratedSmoothedPWDB = pdmpriv->UndecoratedSmoothedPWDB;
|
||||
UndecoratedSmoothedCCK = pdmpriv->UndecoratedSmoothedCCK;
|
||||
}
|
||||
|
||||
//if(pRfd->Status.bPacketToSelf || pRfd->Status.bPacketBeacon)
|
||||
|
||||
if(!isCCKrate)
|
||||
{
|
||||
// Process OFDM RSSI
|
||||
if(UndecoratedSmoothedPWDB < 0) // initialize
|
||||
{
|
||||
UndecoratedSmoothedPWDB = pattrib->RxPWDBAll;
|
||||
}
|
||||
|
||||
if(pattrib->RxPWDBAll > (u32)UndecoratedSmoothedPWDB)
|
||||
{
|
||||
UndecoratedSmoothedPWDB =
|
||||
( ((UndecoratedSmoothedPWDB)*(Rx_Smooth_Factor-1)) +
|
||||
(pattrib->RxPWDBAll)) /(Rx_Smooth_Factor);
|
||||
|
||||
UndecoratedSmoothedPWDB = UndecoratedSmoothedPWDB + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
UndecoratedSmoothedPWDB =
|
||||
( ((UndecoratedSmoothedPWDB)*(Rx_Smooth_Factor-1)) +
|
||||
(pattrib->RxPWDBAll)) /(Rx_Smooth_Factor);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Process CCK RSSI
|
||||
if(UndecoratedSmoothedCCK < 0) // initialize
|
||||
{
|
||||
UndecoratedSmoothedCCK = pattrib->RxPWDBAll;
|
||||
}
|
||||
|
||||
if(pattrib->RxPWDBAll > (u32)UndecoratedSmoothedCCK)
|
||||
{
|
||||
UndecoratedSmoothedCCK =
|
||||
( ((UndecoratedSmoothedCCK)*(Rx_Smooth_Factor-1)) +
|
||||
(pattrib->RxPWDBAll)) /(Rx_Smooth_Factor);
|
||||
|
||||
UndecoratedSmoothedCCK = UndecoratedSmoothedCCK + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
UndecoratedSmoothedCCK =
|
||||
( ((UndecoratedSmoothedCCK)*(Rx_Smooth_Factor-1)) +
|
||||
(pattrib->RxPWDBAll)) /(Rx_Smooth_Factor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(psta)
|
||||
{
|
||||
//psta->UndecoratedSmoothedPWDB = UndecoratedSmoothedPWDB;//todo:
|
||||
pdmpriv->UndecoratedSmoothedPWDB = UndecoratedSmoothedPWDB;
|
||||
|
||||
if(pdmpriv->RSSI_Select == RSSI_OFDM)
|
||||
psta->rssi_stat.UndecoratedSmoothedPWDB = UndecoratedSmoothedPWDB;
|
||||
else if(pdmpriv->RSSI_Select == RSSI_CCK)
|
||||
psta->rssi_stat.UndecoratedSmoothedPWDB = UndecoratedSmoothedCCK;
|
||||
|
||||
psta->rssi_stat.UndecoratedSmoothedCCK = UndecoratedSmoothedCCK;
|
||||
}
|
||||
else
|
||||
{
|
||||
//pdmpriv->UndecoratedSmoothedPWDB = UndecoratedSmoothedPWDB;
|
||||
|
||||
if(pdmpriv->RSSI_Select == RSSI_OFDM)
|
||||
pdmpriv->UndecoratedSmoothedPWDB = UndecoratedSmoothedPWDB;
|
||||
else if(pdmpriv->RSSI_Select == RSSI_CCK)
|
||||
pdmpriv->UndecoratedSmoothedPWDB = UndecoratedSmoothedCCK;
|
||||
|
||||
pdmpriv->UndecoratedSmoothedCCK = UndecoratedSmoothedCCK;
|
||||
}
|
||||
|
||||
//UpdateRxSignalStatistics8192C(padapter, prframe);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void process_link_qual(_adapter *padapter,union recv_frame *prframe)
|
||||
{
|
||||
u32 last_evm=0, tmpVal;
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
struct signal_stat * signal_stat;
|
||||
#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
|
||||
if(prframe == NULL || padapter==NULL){
|
||||
return;
|
||||
}
|
||||
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
signal_stat = &padapter->recvpriv.signal_qual_data;
|
||||
#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
|
||||
//DBG_8192C("process_link_qual=> pattrib->signal_qual(%d)\n ",pattrib->signal_qual);
|
||||
|
||||
#ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
if(signal_stat->update_req) {
|
||||
signal_stat->total_num = 0;
|
||||
signal_stat->total_val = 0;
|
||||
signal_stat->update_req = 0;
|
||||
}
|
||||
|
||||
signal_stat->total_num++;
|
||||
signal_stat->total_val += pattrib->phy_info.SignalQuality;
|
||||
signal_stat->avg_val = signal_stat->total_val / signal_stat->total_num;
|
||||
|
||||
#else //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
if(pattrib->phy_info.SignalQuality != 0)
|
||||
{
|
||||
//
|
||||
// 1. Record the general EVM to the sliding window.
|
||||
//
|
||||
if(padapter->recvpriv.signal_qual_data.total_num++ >= PHY_LINKQUALITY_SLID_WIN_MAX)
|
||||
{
|
||||
padapter->recvpriv.signal_qual_data.total_num = PHY_LINKQUALITY_SLID_WIN_MAX;
|
||||
last_evm = padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index];
|
||||
padapter->recvpriv.signal_qual_data.total_val -= last_evm;
|
||||
}
|
||||
padapter->recvpriv.signal_qual_data.total_val += pattrib->phy_info.SignalQuality;
|
||||
|
||||
padapter->recvpriv.signal_qual_data.elements[padapter->recvpriv.signal_qual_data.index++] = pattrib->phy_info.SignalQuality;
|
||||
if(padapter->recvpriv.signal_qual_data.index >= PHY_LINKQUALITY_SLID_WIN_MAX)
|
||||
padapter->recvpriv.signal_qual_data.index = 0;
|
||||
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_info_,("Total SQ=%d pattrib->signal_qual= %d\n", padapter->recvpriv.signal_qual_data.total_val, pattrib->phy_info.SignalQuality));
|
||||
|
||||
// <1> Showed on UI for user, in percentage.
|
||||
tmpVal = padapter->recvpriv.signal_qual_data.total_val/padapter->recvpriv.signal_qual_data.total_num;
|
||||
padapter->recvpriv.signal_qual=(u8)tmpVal;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,(" pattrib->signal_qual =%d\n", pattrib->phy_info.SignalQuality));
|
||||
}
|
||||
#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
|
||||
|
||||
}// Process_UiLinkQuality8192S
|
||||
|
||||
|
||||
//void rtl8192c_process_phy_info(_adapter *padapter, union recv_frame *prframe)
|
||||
void rtl8192c_process_phy_info(_adapter *padapter, void *prframe)
|
||||
{
|
||||
union recv_frame *precvframe = (union recv_frame *)prframe;
|
||||
//
|
||||
// Check RSSI
|
||||
//
|
||||
process_rssi(padapter, precvframe);
|
||||
//
|
||||
// Check PWDB.
|
||||
//
|
||||
//process_PWDB(padapter, precvframe);
|
||||
|
||||
//UpdateRxSignalStatistics8192C(Adapter, pRfd);
|
||||
//
|
||||
// Check EVM
|
||||
//
|
||||
process_link_qual(padapter, precvframe);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTL8723A_SRESET_C_
|
||||
|
||||
#include <rtl8723a_sreset.h>
|
||||
#include <rtl8723a_hal.h>
|
||||
|
||||
|
||||
#ifdef DBG_CONFIG_ERROR_DETECT
|
||||
void rtl8723a_sreset_xmit_status_check(_adapter *padapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
unsigned long current_time;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
unsigned int diff_time;
|
||||
u32 txdma_status;
|
||||
|
||||
|
||||
if( (txdma_status=rtw_read32(padapter, REG_TXDMA_STATUS)) !=0x00){
|
||||
DBG_871X("%s REG_TXDMA_STATUS:0x%08x\n", __FUNCTION__, txdma_status);
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
//total xmit irp = 4
|
||||
//DBG_8192C("==>%s free_xmitbuf_cnt(%d),txirp_cnt(%d)\n",__FUNCTION__,pxmitpriv->free_xmitbuf_cnt,pxmitpriv->txirp_cnt);
|
||||
//if(pxmitpriv->txirp_cnt == NR_XMITBUFF+1)
|
||||
current_time = rtw_get_current_time();
|
||||
|
||||
if(0 == pxmitpriv->free_xmitbuf_cnt || 0 == pxmitpriv->free_xmit_extbuf_cnt) {
|
||||
|
||||
diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_time);
|
||||
|
||||
if (diff_time > 2000) {
|
||||
if (psrtpriv->last_tx_complete_time == 0) {
|
||||
psrtpriv->last_tx_complete_time = current_time;
|
||||
}
|
||||
else{
|
||||
diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_complete_time);
|
||||
if (diff_time > 4000) {
|
||||
u32 ability;
|
||||
|
||||
//padapter->Wifi_Error_Status = WIFI_TX_HANG;
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_DBG_DM_FUNC, &ability);
|
||||
|
||||
DBG_871X("%s tx hang %s\n", __FUNCTION__,
|
||||
(ability & ODM_BB_ADAPTIVITY)? "ODM_BB_ADAPTIVITY" : "");
|
||||
|
||||
if (!(ability & ODM_BB_ADAPTIVITY))
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // #ifdef CONFIG_USB_HCI
|
||||
|
||||
if (psrtpriv->dbg_trigger_point == SRESET_TGP_XMIT_STATUS) {
|
||||
psrtpriv->dbg_trigger_point = SRESET_TGP_NULL;
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void rtl8723a_sreset_linked_status_check(_adapter *padapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
#if 0
|
||||
u32 regc50,regc58,reg824,reg800;
|
||||
regc50 = rtw_read32(padapter,0xc50);
|
||||
regc58 = rtw_read32(padapter,0xc58);
|
||||
reg824 = rtw_read32(padapter,0x824);
|
||||
reg800 = rtw_read32(padapter,0x800);
|
||||
if( ((regc50&0xFFFFFF00)!= 0x69543400)||
|
||||
((regc58&0xFFFFFF00)!= 0x69543400)||
|
||||
(((reg824&0xFFFFFF00)!= 0x00390000)&&(((reg824&0xFFFFFF00)!= 0x80390000)))||
|
||||
( ((reg800&0xFFFFFF00)!= 0x03040000)&&((reg800&0xFFFFFF00)!= 0x83040000)))
|
||||
{
|
||||
DBG_8192C("%s regc50:0x%08x, regc58:0x%08x, reg824:0x%08x, reg800:0x%08x,\n", __FUNCTION__,
|
||||
regc50, regc58, reg824, reg800);
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (psrtpriv->dbg_trigger_point == SRESET_TGP_LINK_STATUS) {
|
||||
psrtpriv->dbg_trigger_point = SRESET_TGP_NULL;
|
||||
rtw_hal_sreset_reset(padapter);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTL8723A_XMIT_C_
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtl8723a_hal.h>
|
||||
|
||||
#ifdef CONFIG_XMIT_ACK
|
||||
void dump_txrpt_ccx_8723a(void *buf)
|
||||
{
|
||||
struct txrpt_ccx_8723a *txrpt_ccx = buf;
|
||||
|
||||
DBG_871X("%s:\n"
|
||||
"tag1:%u, rsvd:%u, int_bt:%u, int_tri:%u, int_ccx:%u\n"
|
||||
"mac_id:%u, pkt_drop:%u, pkt_ok:%u, bmc:%u\n"
|
||||
"retry_cnt:%u, lifetime_over:%u, retry_over:%u\n"
|
||||
"ccx_qtime:%u\n"
|
||||
"final_data_rate:0x%02x\n"
|
||||
"qsel:%u, sw:0x%03x\n"
|
||||
, __func__
|
||||
, txrpt_ccx->tag1, txrpt_ccx->rsvd, txrpt_ccx->int_bt, txrpt_ccx->int_tri, txrpt_ccx->int_ccx
|
||||
, txrpt_ccx->mac_id, txrpt_ccx->pkt_drop, txrpt_ccx->pkt_ok, txrpt_ccx->bmc
|
||||
, txrpt_ccx->retry_cnt, txrpt_ccx->lifetime_over, txrpt_ccx->retry_over
|
||||
, txrpt_ccx_qtime_8723a(txrpt_ccx)
|
||||
, txrpt_ccx->final_data_rate
|
||||
, txrpt_ccx->qsel, txrpt_ccx_sw_8723a(txrpt_ccx)
|
||||
);
|
||||
}
|
||||
|
||||
void handle_txrpt_ccx_8723a(_adapter *adapter, void *buf)
|
||||
{
|
||||
struct txrpt_ccx_8723a *txrpt_ccx = buf;
|
||||
|
||||
#ifdef DBG_CCX
|
||||
dump_txrpt_ccx_8723a(buf);
|
||||
#endif
|
||||
|
||||
if (txrpt_ccx->int_ccx) {
|
||||
if (txrpt_ccx->pkt_ok)
|
||||
rtw_ack_tx_done(&adapter->xmitpriv, RTW_SCTX_DONE_SUCCESS);
|
||||
else
|
||||
rtw_ack_tx_done(&adapter->xmitpriv, RTW_SCTX_DONE_CCX_PKT_FAIL);
|
||||
}
|
||||
}
|
||||
#endif //CONFIG_XMIT_ACK
|
||||
|
||||
|
|
@ -1,129 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTL8723AS_LED_C_
|
||||
|
||||
#include "drv_types.h"
|
||||
#include "rtl8723a_hal.h"
|
||||
|
||||
//================================================================================
|
||||
// LED object.
|
||||
//================================================================================
|
||||
|
||||
|
||||
//================================================================================
|
||||
// Prototype of protected function.
|
||||
//================================================================================
|
||||
|
||||
//================================================================================
|
||||
// LED_819xUsb routines.
|
||||
//================================================================================
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Turn on LED according to LedPin specified.
|
||||
//
|
||||
void
|
||||
SwLedOn(
|
||||
_adapter *padapter,
|
||||
PLED_871x pLed
|
||||
)
|
||||
{
|
||||
u8 LedCfg;
|
||||
//HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
if( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
pLed->bLedOn = _TRUE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Turn off LED according to LedPin specified.
|
||||
//
|
||||
void
|
||||
SwLedOff(
|
||||
_adapter *padapter,
|
||||
PLED_871x pLed
|
||||
)
|
||||
{
|
||||
u8 LedCfg;
|
||||
//HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
if((padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
|
||||
{
|
||||
goto exit;
|
||||
}
|
||||
|
||||
exit:
|
||||
pLed->bLedOn = _FALSE;
|
||||
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
// Interface to manipulate LED objects.
|
||||
//================================================================================
|
||||
|
||||
//================================================================================
|
||||
// Default LED behavior.
|
||||
//================================================================================
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Initialize all LED_871x objects.
|
||||
//
|
||||
void
|
||||
rtl8723as_InitSwLeds(
|
||||
_adapter *padapter
|
||||
)
|
||||
{
|
||||
struct led_priv *pledpriv = &(padapter->ledpriv);
|
||||
|
||||
pledpriv->LedControlHandler = LedControl871x;
|
||||
#if 0
|
||||
|
||||
InitLed871x(padapter, &(pledpriv->SwLed0), LED_PIN_LED0);
|
||||
|
||||
InitLed871x(padapter,&(pledpriv->SwLed1), LED_PIN_LED1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Description:
|
||||
// DeInitialize all LED_819xUsb objects.
|
||||
//
|
||||
void
|
||||
rtl8723as_DeInitSwLeds(
|
||||
_adapter *padapter
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
struct led_priv *ledpriv = &(padapter->ledpriv);
|
||||
|
||||
DeInitLed871x( &(ledpriv->SwLed0) );
|
||||
DeInitLed871x( &(ledpriv->SwLed1) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -1,997 +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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTL8723AS_RECV_C_
|
||||
|
||||
#include <drv_conf.h>
|
||||
|
||||
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
|
||||
#error "Shall be Linux or Windows, but not both!\n"
|
||||
#endif
|
||||
|
||||
#include <drv_types.h>
|
||||
#include <recv_osdep.h>
|
||||
#include <rtl8723a_hal.h>
|
||||
|
||||
|
||||
|
||||
static s32 initrecvbuf(struct recv_buf *precvbuf, PADAPTER padapter)
|
||||
{
|
||||
_rtw_init_listhead(&precvbuf->list);
|
||||
_rtw_spinlock_init(&precvbuf->recvbuf_lock);
|
||||
|
||||
precvbuf->adapter = padapter;
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
static void freerecvbuf(struct recv_buf *precvbuf)
|
||||
{
|
||||
_rtw_spinlock_free(&precvbuf->recvbuf_lock);
|
||||
}
|
||||
|
||||
static void update_recvframe_attrib(
|
||||
union recv_frame *precvframe,
|
||||
struct recv_stat *prxstat)
|
||||
{
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
struct recv_stat report;
|
||||
PRXREPORT prxreport;
|
||||
|
||||
|
||||
report.rxdw0 = le32_to_cpu(prxstat->rxdw0);
|
||||
report.rxdw1 = le32_to_cpu(prxstat->rxdw1);
|
||||
report.rxdw2 = le32_to_cpu(prxstat->rxdw2);
|
||||
report.rxdw3 = le32_to_cpu(prxstat->rxdw3);
|
||||
report.rxdw4 = le32_to_cpu(prxstat->rxdw4);
|
||||
report.rxdw5 = le32_to_cpu(prxstat->rxdw5);
|
||||
|
||||
prxreport = (PRXREPORT)&report;
|
||||
|
||||
pattrib = &precvframe->u.hdr.attrib;
|
||||
_rtw_memset(pattrib, 0, sizeof(struct rx_pkt_attrib));
|
||||
|
||||
// update rx report to recv_frame attribute
|
||||
pattrib->pkt_len = (u16)prxreport->pktlen;
|
||||
pattrib->drvinfo_sz = (u8)(prxreport->drvinfosize << 3);
|
||||
pattrib->physt = (u8)prxreport->physt;
|
||||
|
||||
pattrib->crc_err = (u8)prxreport->crc32;
|
||||
pattrib->icv_err = (u8)prxreport->icverr;
|
||||
|
||||
pattrib->bdecrypted = (u8)(prxreport->swdec ? 0 : 1);
|
||||
pattrib->encrypt = (u8)prxreport->security;
|
||||
|
||||
pattrib->qos = (u8)prxreport->qos;
|
||||
pattrib->priority = (u8)prxreport->tid;
|
||||
|
||||
pattrib->amsdu = (u8)prxreport->amsdu;
|
||||
|
||||
pattrib->seq_num = (u16)prxreport->seq;
|
||||
pattrib->frag_num = (u8)prxreport->frag;
|
||||
pattrib->mfrag = (u8)prxreport->mf;
|
||||
pattrib->mdata = (u8)prxreport->md;
|
||||
|
||||
pattrib->mcs_rate = (u8)prxreport->rxmcs;
|
||||
pattrib->rxht = (u8)prxreport->rxht;
|
||||
}
|
||||
|
||||
/*
|
||||
* Notice:
|
||||
* Before calling this function,
|
||||
* precvframe->u.hdr.rx_data should be ready!
|
||||
*/
|
||||
void update_recvframe_phyinfo(
|
||||
union recv_frame *precvframe,
|
||||
struct phy_stat *pphy_status)
|
||||
{
|
||||
PADAPTER padapter= precvframe->u.hdr.adapter;
|
||||
struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
PODM_PHY_INFO_T pPHYInfo = (PODM_PHY_INFO_T)(&pattrib->phy_info);
|
||||
|
||||
u8 *wlanhdr;
|
||||
ODM_PACKET_INFO_T pkt_info;
|
||||
u8 *sa;
|
||||
//_irqL irqL;
|
||||
struct sta_priv *pstapriv;
|
||||
struct sta_info *psta;
|
||||
|
||||
pkt_info.bPacketMatchBSSID =_FALSE;
|
||||
pkt_info.bPacketToSelf = _FALSE;
|
||||
pkt_info.bPacketBeacon = _FALSE;
|
||||
|
||||
|
||||
wlanhdr = get_recvframe_data(precvframe);
|
||||
|
||||
pkt_info.bPacketMatchBSSID = ((!IsFrameTypeCtrl(wlanhdr)) &&
|
||||
!pattrib->icv_err && !pattrib->crc_err &&
|
||||
_rtw_memcmp(get_hdr_bssid(wlanhdr), get_bssid(&padapter->mlmepriv), ETH_ALEN));
|
||||
|
||||
pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID && (_rtw_memcmp(get_da(wlanhdr), myid(&padapter->eeprompriv), ETH_ALEN));
|
||||
|
||||
pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && (GetFrameSubType(wlanhdr) == WIFI_BEACON);
|
||||
|
||||
if(pkt_info.bPacketBeacon){
|
||||
if(check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE) == _TRUE){
|
||||
sa = padapter->mlmepriv.cur_network.network.MacAddress;
|
||||
#if 0
|
||||
{
|
||||
DBG_8192C("==> rx beacon from AP[%02x:%02x:%02x:%02x:%02x:%02x]\n",
|
||||
sa[0],sa[1],sa[2],sa[3],sa[4],sa[5]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
//to do Ad-hoc
|
||||
}
|
||||
else{
|
||||
sa = get_sa(wlanhdr);
|
||||
}
|
||||
|
||||
pkt_info.StationID = 0xFF;
|
||||
|
||||
pstapriv = &padapter->stapriv;
|
||||
psta = rtw_get_stainfo(pstapriv, sa);
|
||||
if (psta)
|
||||
{
|
||||
pkt_info.StationID = psta->mac_id;
|
||||
//DBG_8192C("%s ==> StationID(%d)\n",__FUNCTION__,pkt_info.StationID);
|
||||
}
|
||||
pkt_info.Rate = pattrib->mcs_rate;
|
||||
|
||||
|
||||
//rtl8192c_query_rx_phy_status(precvframe, pphy_status);
|
||||
//_enter_critical_bh(&pHalData->odm_stainfo_lock, &irqL);
|
||||
ODM_PhyStatusQuery(&pHalData->odmpriv,pPHYInfo,(u8 *)pphy_status,&(pkt_info));
|
||||
//_exit_critical_bh(&pHalData->odm_stainfo_lock, &irqL);
|
||||
precvframe->u.hdr.psta = NULL;
|
||||
if (pkt_info.bPacketMatchBSSID &&
|
||||
(check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == _TRUE))
|
||||
{
|
||||
if (psta)
|
||||
{
|
||||
precvframe->u.hdr.psta = psta;
|
||||
rtl8192c_process_phy_info(padapter, precvframe);
|
||||
}
|
||||
}
|
||||
else if (pkt_info.bPacketToSelf || pkt_info.bPacketBeacon)
|
||||
{
|
||||
if (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE) == _TRUE)
|
||||
{
|
||||
if (psta)
|
||||
{
|
||||
precvframe->u.hdr.psta = psta;
|
||||
}
|
||||
}
|
||||
rtl8192c_process_phy_info(padapter, precvframe);
|
||||
}
|
||||
}
|
||||
|
||||
static s32 pre_recv_entry(union recv_frame *precvframe, struct recv_buf *precvbuf, struct phy_stat *pphy_status)
|
||||
{
|
||||
s32 ret=_SUCCESS;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
u8 *primary_myid, *secondary_myid, *paddr1;
|
||||
union recv_frame *precvframe_if2 = NULL;
|
||||
_adapter *primary_padapter = precvframe->u.hdr.adapter;
|
||||
_adapter *secondary_padapter = primary_padapter->pbuddy_adapter;
|
||||
struct recv_priv *precvpriv = &primary_padapter->recvpriv;
|
||||
_queue *pfree_recv_queue = &precvpriv->free_recv_queue;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(primary_padapter);
|
||||
|
||||
if(!secondary_padapter)
|
||||
return ret;
|
||||
|
||||
paddr1 = GetAddr1Ptr(precvframe->u.hdr.rx_data);
|
||||
|
||||
if(IS_MCAST(paddr1) == _FALSE)//unicast packets
|
||||
{
|
||||
//primary_myid = myid(&primary_padapter->eeprompriv);
|
||||
secondary_myid = myid(&secondary_padapter->eeprompriv);
|
||||
|
||||
if(_rtw_memcmp(paddr1, secondary_myid, ETH_ALEN))
|
||||
{
|
||||
//change to secondary interface
|
||||
precvframe->u.hdr.adapter = secondary_padapter;
|
||||
}
|
||||
|
||||
//ret = recv_entry(precvframe);
|
||||
|
||||
}
|
||||
else // Handle BC/MC Packets
|
||||
{
|
||||
//clone/copy to if2
|
||||
_pkt *pkt_copy = NULL;
|
||||
struct rx_pkt_attrib *pattrib = NULL;
|
||||
|
||||
precvframe_if2 = rtw_alloc_recvframe(pfree_recv_queue);
|
||||
|
||||
if(!precvframe_if2)
|
||||
return _FAIL;
|
||||
|
||||
precvframe_if2->u.hdr.adapter = secondary_padapter;
|
||||
_rtw_memcpy(&precvframe_if2->u.hdr.attrib, &precvframe->u.hdr.attrib, sizeof(struct rx_pkt_attrib));
|
||||
pattrib = &precvframe_if2->u.hdr.attrib;
|
||||
|
||||
//driver need to set skb len for rtw_skb_copy().
|
||||
//If skb->len is zero, rtw_skb_copy() will not copy data from original skb.
|
||||
skb_put(precvframe->u.hdr.pkt, pattrib->pkt_len);
|
||||
|
||||
pkt_copy = rtw_skb_copy(precvframe->u.hdr.pkt);
|
||||
if (pkt_copy == NULL)
|
||||
{
|
||||
if((pattrib->mfrag == 1)&&(pattrib->frag_num == 0))
|
||||
{
|
||||
DBG_8192C("pre_recv_entry(): rtw_skb_copy fail , drop frag frame \n");
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
return ret;
|
||||
}
|
||||
|
||||
pkt_copy = rtw_skb_clone(precvframe->u.hdr.pkt);
|
||||
if(pkt_copy == NULL)
|
||||
{
|
||||
DBG_8192C("pre_recv_entry(): rtw_skb_clone fail , drop frame\n");
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
pkt_copy->dev = secondary_padapter->pnetdev;
|
||||
|
||||
precvframe_if2->u.hdr.pkt = pkt_copy;
|
||||
precvframe_if2->u.hdr.rx_head = pkt_copy->head;
|
||||
precvframe_if2->u.hdr.rx_data = pkt_copy->data;
|
||||
precvframe_if2->u.hdr.rx_tail = skb_tail_pointer(pkt_copy);
|
||||
precvframe_if2->u.hdr.rx_end = skb_end_pointer(pkt_copy);
|
||||
precvframe_if2->u.hdr.len = pkt_copy->len;
|
||||
|
||||
//recvframe_put(precvframe_if2, pattrib->pkt_len);
|
||||
|
||||
if ( pHalData->ReceiveConfig & RCR_APPFCS)
|
||||
recvframe_pull_tail(precvframe_if2, IEEE80211_FCS_LEN);
|
||||
|
||||
if (pattrib->physt)
|
||||
update_recvframe_phyinfo(precvframe_if2, pphy_status);
|
||||
|
||||
if(rtw_recv_entry(precvframe_if2) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
|
||||
("recvbuf2recvframe: rtw_recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
}
|
||||
|
||||
if (precvframe->u.hdr.attrib.physt)
|
||||
update_recvframe_phyinfo(precvframe, pphy_status);
|
||||
|
||||
ret = rtw_recv_entry(precvframe);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_SDIO_RX_COPY
|
||||
#ifdef CONFIG_DIRECT_RECV
|
||||
void rtl8723as_recv(PADAPTER padapter, struct recv_buf *precvbuf)
|
||||
{
|
||||
//PADAPTER padapter;
|
||||
PHAL_DATA_TYPE pHalData;
|
||||
struct recv_priv *precvpriv;
|
||||
//struct recv_buf *precvbuf;
|
||||
union recv_frame *precvframe;
|
||||
struct recv_frame_hdr *phdr;
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
_irqL irql;
|
||||
u8 *ptr;
|
||||
u32 pkt_len, pkt_offset, skb_len, alloc_sz;
|
||||
_pkt *pkt_copy = NULL;
|
||||
u8 shift_sz = 0, rx_report_sz = 0;
|
||||
|
||||
pHalData = GET_HAL_DATA(padapter);
|
||||
precvpriv = &padapter->recvpriv;
|
||||
|
||||
ptr = precvbuf->pdata;
|
||||
|
||||
while (ptr < precvbuf->ptail)
|
||||
{
|
||||
precvframe = rtw_alloc_recvframe(&precvpriv->free_recv_queue);
|
||||
if (precvframe == NULL) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("%s: no enough recv frame!\n",__FUNCTION__));
|
||||
break;
|
||||
}
|
||||
|
||||
//rx desc parsing
|
||||
update_recvframe_attrib(precvframe, (struct recv_stat*)ptr);
|
||||
|
||||
pattrib = &precvframe->u.hdr.attrib;
|
||||
|
||||
// fix Hardware RX data error, drop whole recv_buffer
|
||||
if ((!(pHalData->ReceiveConfig & RCR_ACRC32)) && pattrib->crc_err)
|
||||
{
|
||||
DBG_8192C("%s()-%d: RX Warning! rx CRC ERROR !!\n", __FUNCTION__, __LINE__);
|
||||
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
break;
|
||||
}
|
||||
|
||||
if (pHalData->ReceiveConfig & RCR_APP_BA_SSN)
|
||||
rx_report_sz = RXDESC_SIZE + 4 + pattrib->drvinfo_sz;
|
||||
else
|
||||
rx_report_sz = RXDESC_SIZE + pattrib->drvinfo_sz;
|
||||
|
||||
pkt_offset = rx_report_sz + pattrib->pkt_len;
|
||||
|
||||
if ((ptr + pkt_offset) > precvbuf->ptail) {
|
||||
DBG_8192C("%s()-%d: : next pkt len(%p,%d) exceed ptail(%p)!\n", __FUNCTION__, __LINE__, ptr, pkt_offset, precvbuf->ptail);
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
break;
|
||||
}
|
||||
|
||||
if ((pattrib->crc_err) || (pattrib->icv_err))
|
||||
{
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
if (padapter->registrypriv.mp_mode == 1)
|
||||
{
|
||||
if ((check_fwstate(&padapter->mlmepriv, WIFI_MP_STATE) == _TRUE))//&&(padapter->mppriv.check_mp_pkt == 0))
|
||||
{
|
||||
if (pattrib->crc_err == 1)
|
||||
padapter->mppriv.rx_crcerrpktcount++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
DBG_8192C("%s: crc_err=%d icv_err=%d, skip!\n", __FUNCTION__, pattrib->crc_err, pattrib->icv_err);
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Modified by Albert 20101213
|
||||
// For 8 bytes IP header alignment.
|
||||
if (pattrib->qos) // Qos data, wireless lan header length is 26
|
||||
{
|
||||
shift_sz = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
shift_sz = 0;
|
||||
}
|
||||
|
||||
skb_len = pattrib->pkt_len;
|
||||
|
||||
// for first fragment packet, driver need allocate 1536+drvinfo_sz+RXDESC_SIZE to defrag packet.
|
||||
// modify alloc_sz for recvive crc error packet by thomas 2011-06-02
|
||||
if((pattrib->mfrag == 1)&&(pattrib->frag_num == 0)){
|
||||
//alloc_sz = 1664; //1664 is 128 alignment.
|
||||
if(skb_len <= 1650)
|
||||
alloc_sz = 1664;
|
||||
else
|
||||
alloc_sz = skb_len + 14;
|
||||
}
|
||||
else {
|
||||
alloc_sz = skb_len;
|
||||
// 6 is for IP header 8 bytes alignment in QoS packet case.
|
||||
// 8 is for skb->data 4 bytes alignment.
|
||||
alloc_sz += 14;
|
||||
}
|
||||
|
||||
pkt_copy = rtw_skb_alloc(alloc_sz);
|
||||
|
||||
if(pkt_copy)
|
||||
{
|
||||
pkt_copy->dev = padapter->pnetdev;
|
||||
precvframe->u.hdr.pkt = pkt_copy;
|
||||
skb_reserve( pkt_copy, 8 - ((SIZE_PTR)( pkt_copy->data ) & 7 ));//force pkt_copy->data at 8-byte alignment address
|
||||
skb_reserve( pkt_copy, shift_sz );//force ip_hdr at 8-byte alignment address according to shift_sz.
|
||||
_rtw_memcpy(pkt_copy->data, (ptr + rx_report_sz), skb_len);
|
||||
precvframe->u.hdr.rx_head = pkt_copy->head;
|
||||
precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail = pkt_copy->data;
|
||||
precvframe->u.hdr.rx_end = skb_end_pointer(pkt_copy);
|
||||
}
|
||||
else
|
||||
{
|
||||
if((pattrib->mfrag == 1)&&(pattrib->frag_num == 0))
|
||||
{
|
||||
DBG_8192C("rtl8723as_recv_tasklet: alloc_skb fail , drop frag frame \n");
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
break;
|
||||
}
|
||||
|
||||
precvframe->u.hdr.pkt = rtw_skb_clone(precvbuf->pskb);
|
||||
if(precvframe->u.hdr.pkt)
|
||||
{
|
||||
_pkt *pkt_clone = precvframe->u.hdr.pkt;
|
||||
|
||||
pkt_clone->data = ptr + rx_report_sz;
|
||||
skb_reset_tail_pointer(pkt_clone);
|
||||
precvframe->u.hdr.rx_head = precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail
|
||||
= pkt_clone->data;
|
||||
precvframe->u.hdr.rx_end = pkt_clone->data + skb_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_8192C("rtl8723as_recv_tasklet: rtw_skb_clone fail\n");
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
recvframe_put(precvframe, skb_len);
|
||||
//recvframe_pull(precvframe, drvinfo_sz + RXDESC_SIZE);
|
||||
|
||||
if (pHalData->ReceiveConfig & RCR_APPFCS)
|
||||
recvframe_pull_tail(precvframe, IEEE80211_FCS_LEN);
|
||||
|
||||
// move to drv info position
|
||||
ptr += RXDESC_SIZE;
|
||||
|
||||
// update drv info
|
||||
if (pHalData->ReceiveConfig & RCR_APP_BA_SSN) {
|
||||
//rtl8723s_update_bassn(padapter, pdrvinfo);
|
||||
ptr += 4;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(rtw_buddy_adapter_up(padapter))
|
||||
{
|
||||
if(pre_recv_entry(precvframe, precvbuf, (struct phy_stat*)ptr) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
|
||||
("recvbuf2recvframe: recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (pattrib->physt)
|
||||
update_recvframe_phyinfo(precvframe, (struct phy_stat*)ptr);
|
||||
|
||||
if (rtw_recv_entry(precvframe) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("%s: rtw_recv_entry(precvframe) != _SUCCESS\n",__FUNCTION__));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Page size of receive package is 128 bytes alignment =>DMA AGG
|
||||
// refer to _InitTransferPageSize()
|
||||
pkt_offset = _RND128(pkt_offset);
|
||||
precvbuf->pdata += pkt_offset;
|
||||
ptr = precvbuf->pdata;
|
||||
precvframe = NULL;
|
||||
pkt_copy = NULL;
|
||||
|
||||
}
|
||||
|
||||
rtw_enqueue_recvbuf(precvbuf, &precvpriv->free_recv_buf_queue);
|
||||
|
||||
}
|
||||
#endif //CONFIG_DIRECT_RECV
|
||||
|
||||
static void rtl8723as_recv_tasklet(void *priv)
|
||||
{
|
||||
PADAPTER padapter;
|
||||
PHAL_DATA_TYPE pHalData;
|
||||
struct recv_priv *precvpriv;
|
||||
struct recv_buf *precvbuf;
|
||||
union recv_frame *precvframe;
|
||||
struct recv_frame_hdr *phdr;
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
_irqL irql;
|
||||
u8 *ptr;
|
||||
u32 pkt_len, pkt_offset, skb_len, alloc_sz;
|
||||
_pkt *pkt_copy = NULL;
|
||||
u8 shift_sz = 0, rx_report_sz = 0;
|
||||
|
||||
|
||||
padapter = (PADAPTER)priv;
|
||||
pHalData = GET_HAL_DATA(padapter);
|
||||
precvpriv = &padapter->recvpriv;
|
||||
|
||||
do {
|
||||
precvbuf = rtw_dequeue_recvbuf(&precvpriv->recv_buf_pending_queue);
|
||||
if (NULL == precvbuf) break;
|
||||
|
||||
ptr = precvbuf->pdata;
|
||||
|
||||
while (ptr < precvbuf->ptail)
|
||||
{
|
||||
precvframe = rtw_alloc_recvframe(&precvpriv->free_recv_queue);
|
||||
if (precvframe == NULL) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("%s: no enough recv frame!\n",__FUNCTION__));
|
||||
rtw_enqueue_recvbuf_to_head(precvbuf, &precvpriv->recv_buf_pending_queue);
|
||||
|
||||
// The case of can't allocte recvframe should be temporary,
|
||||
// schedule again and hope recvframe is available next time.
|
||||
#ifdef PLATFORM_LINUX
|
||||
tasklet_schedule(&precvpriv->recv_tasklet);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
//rx desc parsing
|
||||
update_recvframe_attrib(precvframe, (struct recv_stat*)ptr);
|
||||
|
||||
pattrib = &precvframe->u.hdr.attrib;
|
||||
|
||||
// fix Hardware RX data error, drop whole recv_buffer
|
||||
if ((!(pHalData->ReceiveConfig & RCR_ACRC32)) && pattrib->crc_err)
|
||||
{
|
||||
DBG_8192C("%s()-%d: RX Warning! rx CRC ERROR !!\n", __FUNCTION__, __LINE__);
|
||||
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
break;
|
||||
}
|
||||
|
||||
if (pHalData->ReceiveConfig & RCR_APP_BA_SSN)
|
||||
rx_report_sz = RXDESC_SIZE + 4 + pattrib->drvinfo_sz;
|
||||
else
|
||||
rx_report_sz = RXDESC_SIZE + pattrib->drvinfo_sz;
|
||||
|
||||
pkt_offset = rx_report_sz + pattrib->pkt_len;
|
||||
|
||||
if ((ptr + pkt_offset) > precvbuf->ptail) {
|
||||
DBG_8192C("%s()-%d: : next pkt len(%p,%d) exceed ptail(%p)!\n", __FUNCTION__, __LINE__, ptr, pkt_offset, precvbuf->ptail);
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
break;
|
||||
}
|
||||
|
||||
if ((pattrib->crc_err) || (pattrib->icv_err))
|
||||
{
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
if (padapter->registrypriv.mp_mode == 1)
|
||||
{
|
||||
if ((check_fwstate(&padapter->mlmepriv, WIFI_MP_STATE) == _TRUE))//&&(padapter->mppriv.check_mp_pkt == 0))
|
||||
{
|
||||
if (pattrib->crc_err == 1)
|
||||
padapter->mppriv.rx_crcerrpktcount++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
DBG_8192C("%s: crc_err=%d icv_err=%d, skip!\n", __FUNCTION__, pattrib->crc_err, pattrib->icv_err);
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Modified by Albert 20101213
|
||||
// For 8 bytes IP header alignment.
|
||||
if (pattrib->qos) // Qos data, wireless lan header length is 26
|
||||
{
|
||||
shift_sz = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
shift_sz = 0;
|
||||
}
|
||||
|
||||
skb_len = pattrib->pkt_len;
|
||||
|
||||
// for first fragment packet, driver need allocate 1536+drvinfo_sz+RXDESC_SIZE to defrag packet.
|
||||
// modify alloc_sz for recvive crc error packet by thomas 2011-06-02
|
||||
if((pattrib->mfrag == 1)&&(pattrib->frag_num == 0)){
|
||||
//alloc_sz = 1664; //1664 is 128 alignment.
|
||||
if(skb_len <= 1650)
|
||||
alloc_sz = 1664;
|
||||
else
|
||||
alloc_sz = skb_len + 14;
|
||||
}
|
||||
else {
|
||||
alloc_sz = skb_len;
|
||||
// 6 is for IP header 8 bytes alignment in QoS packet case.
|
||||
// 8 is for skb->data 4 bytes alignment.
|
||||
alloc_sz += 14;
|
||||
}
|
||||
|
||||
pkt_copy = rtw_skb_alloc(alloc_sz);
|
||||
|
||||
if(pkt_copy)
|
||||
{
|
||||
pkt_copy->dev = padapter->pnetdev;
|
||||
precvframe->u.hdr.pkt = pkt_copy;
|
||||
skb_reserve( pkt_copy, 8 - ((SIZE_PTR)( pkt_copy->data ) & 7 ));//force pkt_copy->data at 8-byte alignment address
|
||||
skb_reserve( pkt_copy, shift_sz );//force ip_hdr at 8-byte alignment address according to shift_sz.
|
||||
_rtw_memcpy(pkt_copy->data, (ptr + rx_report_sz), skb_len);
|
||||
precvframe->u.hdr.rx_head = pkt_copy->head;
|
||||
precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail = pkt_copy->data;
|
||||
precvframe->u.hdr.rx_end = skb_end_pointer(pkt_copy);
|
||||
}
|
||||
else
|
||||
{
|
||||
if((pattrib->mfrag == 1)&&(pattrib->frag_num == 0))
|
||||
{
|
||||
DBG_8192C("rtl8723as_recv_tasklet: alloc_skb fail , drop frag frame \n");
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
break;
|
||||
}
|
||||
|
||||
precvframe->u.hdr.pkt = rtw_skb_clone(precvbuf->pskb);
|
||||
if(precvframe->u.hdr.pkt)
|
||||
{
|
||||
_pkt *pkt_clone = precvframe->u.hdr.pkt;
|
||||
|
||||
pkt_clone->data = ptr + rx_report_sz;
|
||||
skb_reset_tail_pointer(pkt_clone);
|
||||
precvframe->u.hdr.rx_head = precvframe->u.hdr.rx_data = precvframe->u.hdr.rx_tail
|
||||
= pkt_clone->data;
|
||||
precvframe->u.hdr.rx_end = pkt_clone->data + skb_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_8192C("rtl8723as_recv_tasklet: rtw_skb_clone fail\n");
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
recvframe_put(precvframe, skb_len);
|
||||
//recvframe_pull(precvframe, drvinfo_sz + RXDESC_SIZE);
|
||||
|
||||
if (pHalData->ReceiveConfig & RCR_APPFCS)
|
||||
recvframe_pull_tail(precvframe, IEEE80211_FCS_LEN);
|
||||
|
||||
// move to drv info position
|
||||
ptr += RXDESC_SIZE;
|
||||
|
||||
// update drv info
|
||||
if (pHalData->ReceiveConfig & RCR_APP_BA_SSN) {
|
||||
//rtl8723s_update_bassn(padapter, pdrvinfo);
|
||||
ptr += 4;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(rtw_buddy_adapter_up(padapter))
|
||||
{
|
||||
if(pre_recv_entry(precvframe, precvbuf, (struct phy_stat*)ptr) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
|
||||
("recvbuf2recvframe: recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (pattrib->physt)
|
||||
update_recvframe_phyinfo(precvframe, (struct phy_stat*)ptr);
|
||||
|
||||
if (rtw_recv_entry(precvframe) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("%s: rtw_recv_entry(precvframe) != _SUCCESS\n",__FUNCTION__));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Page size of receive package is 128 bytes alignment =>DMA AGG
|
||||
// refer to _InitTransferPageSize()
|
||||
pkt_offset = _RND128(pkt_offset);
|
||||
precvbuf->pdata += pkt_offset;
|
||||
ptr = precvbuf->pdata;
|
||||
precvframe = NULL;
|
||||
pkt_copy = NULL;
|
||||
}
|
||||
|
||||
rtw_enqueue_recvbuf(precvbuf, &precvpriv->free_recv_buf_queue);
|
||||
} while (1);
|
||||
|
||||
}
|
||||
#else
|
||||
static void rtl8723as_recv_tasklet(void *priv)
|
||||
{
|
||||
PADAPTER padapter;
|
||||
PHAL_DATA_TYPE pHalData;
|
||||
struct recv_priv *precvpriv;
|
||||
struct recv_buf *precvbuf;
|
||||
union recv_frame *precvframe;
|
||||
struct recv_frame_hdr *phdr;
|
||||
struct rx_pkt_attrib *pattrib;
|
||||
u8 *ptr;
|
||||
_pkt *ppkt;
|
||||
u32 pkt_offset;
|
||||
_irqL irql;
|
||||
|
||||
|
||||
padapter = (PADAPTER)priv;
|
||||
pHalData = GET_HAL_DATA(padapter);
|
||||
precvpriv = &padapter->recvpriv;
|
||||
|
||||
do {
|
||||
precvbuf = rtw_dequeue_recvbuf(&precvpriv->recv_buf_pending_queue);
|
||||
if (NULL == precvbuf) break;
|
||||
|
||||
ptr = precvbuf->pdata;
|
||||
|
||||
while (ptr < precvbuf->ptail)
|
||||
{
|
||||
precvframe = rtw_alloc_recvframe(&precvpriv->free_recv_queue);
|
||||
if (precvframe == NULL) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("rtl8723as_recv_tasklet: no enough recv frame!\n"));
|
||||
rtw_enqueue_recvbuf_to_head(precvbuf, &precvpriv->recv_buf_pending_queue);
|
||||
|
||||
// The case of can't allocte recvframe should be temporary,
|
||||
// schedule again and hope recvframe is available next time.
|
||||
#ifdef PLATFORM_LINUX
|
||||
tasklet_schedule(&precvpriv->recv_tasklet);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
phdr = &precvframe->u.hdr;
|
||||
pattrib = &phdr->attrib;
|
||||
|
||||
update_recvframe_attrib(precvframe, (struct recv_stat*)ptr);
|
||||
|
||||
// fix Hardware RX data error, drop whole recv_buffer
|
||||
if ((!(pHalData->ReceiveConfig & RCR_ACRC32)) && pattrib->crc_err)
|
||||
{
|
||||
DBG_8192C("%s()-%d: RX Warning! rx CRC ERROR !!\n", __FUNCTION__, __LINE__);
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
break;
|
||||
}
|
||||
|
||||
pkt_offset = RXDESC_SIZE + pattrib->drvinfo_sz + pattrib->pkt_len;
|
||||
#if 0 // reduce check to speed up
|
||||
if ((ptr + pkt_offset) > precvbuf->ptail) {
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_,
|
||||
("%s: next pkt len(%p,%d) exceed ptail(%p)!\n",
|
||||
__FUNCTION__, ptr, pkt_offset, precvbuf->ptail));
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((pattrib->crc_err) || (pattrib->icv_err))
|
||||
{
|
||||
#ifdef CONFIG_MP_INCLUDED
|
||||
if (padapter->registrypriv.mp_mode == 1)
|
||||
{
|
||||
if ((check_fwstate(&padapter->mlmepriv, WIFI_MP_STATE) == _TRUE))//&&(padapter->mppriv.check_mp_pkt == 0))
|
||||
{
|
||||
if (pattrib->crc_err == 1)
|
||||
padapter->mppriv.rx_crcerrpktcount++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
DBG_8192C("%s: crc_err=%d icv_err=%d, skip!\n", __FUNCTION__, pattrib->crc_err, pattrib->icv_err);
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
}
|
||||
else
|
||||
{
|
||||
ppkt = rtw_skb_clone(precvbuf->pskb);
|
||||
if (ppkt == NULL)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_crit_, ("rtl8723as_recv_tasklet: no enough memory to allocate SKB!\n"));
|
||||
rtw_free_recvframe(precvframe, &precvpriv->free_recv_queue);
|
||||
rtw_enqueue_recvbuf_to_head(precvbuf, &precvpriv->recv_buf_pending_queue);
|
||||
|
||||
// The case of can't allocte skb is serious and may never be recovered,
|
||||
// once bDriverStopped is enable, this task should be stopped.
|
||||
if (padapter->bDriverStopped == _FALSE) {
|
||||
#ifdef PLATFORM_LINUX
|
||||
tasklet_schedule(&precvpriv->recv_tasklet);
|
||||
#endif
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
phdr->pkt = ppkt;
|
||||
phdr->len = 0;
|
||||
phdr->rx_head = precvbuf->phead;
|
||||
phdr->rx_data = phdr->rx_tail = precvbuf->pdata;
|
||||
phdr->rx_end = precvbuf->pend;
|
||||
recvframe_put(precvframe, pkt_offset);
|
||||
recvframe_pull(precvframe, RXDESC_SIZE + pattrib->drvinfo_sz);
|
||||
if (pHalData->ReceiveConfig & RCR_APPFCS)
|
||||
recvframe_pull_tail(precvframe, IEEE80211_FCS_LEN);
|
||||
|
||||
// move to drv info position
|
||||
ptr += RXDESC_SIZE;
|
||||
|
||||
// update drv info
|
||||
if (pHalData->ReceiveConfig & RCR_APP_BA_SSN) {
|
||||
// rtl8723s_update_bassn(padapter, pdrvinfo);
|
||||
ptr += 4;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(rtw_buddy_adapter_up(padapter))
|
||||
{
|
||||
if(pre_recv_entry(precvframe, precvbuf, (struct phy_stat*)ptr) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_,_drv_err_,
|
||||
("recvbuf2recvframe: recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (pattrib->physt)
|
||||
update_recvframe_phyinfo(precvframe, (struct phy_stat*)ptr);
|
||||
|
||||
if (rtw_recv_entry(precvframe) != _SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("rtl8723as_recv_tasklet: rtw_recv_entry(precvframe) != _SUCCESS\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Page size of receive package is 128 bytes alignment => DMA agg
|
||||
// refer to _InitTransferPageSize()
|
||||
pkt_offset = _RND128(pkt_offset);
|
||||
precvbuf->pdata += pkt_offset;
|
||||
ptr = precvbuf->pdata;
|
||||
}
|
||||
|
||||
rtw_skb_free(precvbuf->pskb);
|
||||
precvbuf->pskb = NULL;
|
||||
rtw_enqueue_recvbuf(precvbuf, &precvpriv->free_recv_buf_queue);
|
||||
} while (1);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Initialize recv private variable for hardware dependent
|
||||
* 1. recv buf
|
||||
* 2. recv tasklet
|
||||
*
|
||||
*/
|
||||
s32 rtl8723as_init_recv_priv(PADAPTER padapter)
|
||||
{
|
||||
s32 res;
|
||||
u32 i, n;
|
||||
struct recv_priv *precvpriv;
|
||||
struct recv_buf *precvbuf;
|
||||
|
||||
|
||||
res = _SUCCESS;
|
||||
precvpriv = &padapter->recvpriv;
|
||||
|
||||
//3 1. init recv buffer
|
||||
_rtw_init_queue(&precvpriv->free_recv_buf_queue);
|
||||
_rtw_init_queue(&precvpriv->recv_buf_pending_queue);
|
||||
|
||||
n = NR_RECVBUFF * sizeof(struct recv_buf) + 4;
|
||||
precvpriv->pallocated_recv_buf = rtw_zmalloc(n);
|
||||
if (precvpriv->pallocated_recv_buf == NULL) {
|
||||
res = _FAIL;
|
||||
RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n"));
|
||||
goto exit;
|
||||
}
|
||||
|
||||
precvpriv->precv_buf = (u8*)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_recv_buf), 4);
|
||||
|
||||
// init each recv buffer
|
||||
precvbuf = (struct recv_buf*)precvpriv->precv_buf;
|
||||
for (i = 0; i < NR_RECVBUFF; i++)
|
||||
{
|
||||
res = initrecvbuf(precvbuf, padapter);
|
||||
if (res == _FAIL)
|
||||
break;
|
||||
|
||||
res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf);
|
||||
if (res == _FAIL) {
|
||||
freerecvbuf(precvbuf);
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SDIO_RX_COPY
|
||||
if (precvbuf->pskb == NULL) {
|
||||
SIZE_PTR tmpaddr=0;
|
||||
SIZE_PTR alignment=0;
|
||||
|
||||
precvbuf->pskb = rtw_skb_alloc(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
|
||||
|
||||
if(precvbuf->pskb)
|
||||
{
|
||||
precvbuf->pskb->dev = padapter->pnetdev;
|
||||
|
||||
tmpaddr = (SIZE_PTR)precvbuf->pskb->data;
|
||||
alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
|
||||
skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
|
||||
}
|
||||
|
||||
if (precvbuf->pskb == NULL) {
|
||||
DBG_871X("%s: alloc_skb fail!\n", __FUNCTION__);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_list_insert_tail(&precvbuf->list, &precvpriv->free_recv_buf_queue.queue);
|
||||
|
||||
precvbuf++;
|
||||
}
|
||||
precvpriv->free_recv_buf_queue_cnt = i;
|
||||
|
||||
if (res == _FAIL)
|
||||
goto initbuferror;
|
||||
|
||||
//3 2. init tasklet
|
||||
#ifdef PLATFORM_LINUX
|
||||
tasklet_init(&precvpriv->recv_tasklet,
|
||||
(void(*)(unsigned long))rtl8723as_recv_tasklet,
|
||||
(unsigned long)padapter);
|
||||
#endif
|
||||
|
||||
goto exit;
|
||||
|
||||
initbuferror:
|
||||
precvbuf = (struct recv_buf*)precvpriv->precv_buf;
|
||||
if (precvbuf) {
|
||||
n = precvpriv->free_recv_buf_queue_cnt;
|
||||
precvpriv->free_recv_buf_queue_cnt = 0;
|
||||
for (i = 0; i < n ; i++)
|
||||
{
|
||||
rtw_list_delete(&precvbuf->list);
|
||||
rtw_os_recvbuf_resource_free(padapter, precvbuf);
|
||||
freerecvbuf(precvbuf);
|
||||
precvbuf++;
|
||||
}
|
||||
precvpriv->precv_buf = NULL;
|
||||
}
|
||||
|
||||
if (precvpriv->pallocated_recv_buf) {
|
||||
n = NR_RECVBUFF * sizeof(struct recv_buf) + 4;
|
||||
rtw_mfree(precvpriv->pallocated_recv_buf, n);
|
||||
precvpriv->pallocated_recv_buf = NULL;
|
||||
}
|
||||
|
||||
exit:
|
||||
return res;
|
||||
}
|
||||
|
||||
/*
|
||||
* Free recv private variable of hardware dependent
|
||||
* 1. recv buf
|
||||
* 2. recv tasklet
|
||||
*
|
||||
*/
|
||||
void rtl8723as_free_recv_priv(PADAPTER padapter)
|
||||
{
|
||||
u32 i, n;
|
||||
struct recv_priv *precvpriv;
|
||||
struct recv_buf *precvbuf;
|
||||
|
||||
|
||||
precvpriv = &padapter->recvpriv;
|
||||
|
||||
//3 1. kill tasklet
|
||||
#ifdef PLATFORM_LINUX
|
||||
tasklet_kill(&precvpriv->recv_tasklet);
|
||||
#endif
|
||||
|
||||
//3 2. free all recv buffers
|
||||
precvbuf = (struct recv_buf*)precvpriv->precv_buf;
|
||||
if (precvbuf) {
|
||||
n = NR_RECVBUFF;
|
||||
precvpriv->free_recv_buf_queue_cnt = 0;
|
||||
for (i = 0; i < n ; i++)
|
||||
{
|
||||
rtw_list_delete(&precvbuf->list);
|
||||
rtw_os_recvbuf_resource_free(padapter, precvbuf);
|
||||
freerecvbuf(precvbuf);
|
||||
precvbuf++;
|
||||
}
|
||||
precvpriv->precv_buf = NULL;
|
||||
}
|
||||
|
||||
if (precvpriv->pallocated_recv_buf) {
|
||||
n = NR_RECVBUFF * sizeof(struct recv_buf) + 4;
|
||||
rtw_mfree(precvpriv->pallocated_recv_buf, n);
|
||||
precvpriv->pallocated_recv_buf = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,705 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTL8723AS_XMIT_C_
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
#include <sdio_ops.h>
|
||||
#include <rtl8723a_hal.h>
|
||||
|
||||
#ifdef CONFIG_TX_AGGREGATION
|
||||
#define SDIO_TX_AGG_MAX 5
|
||||
#else
|
||||
#define SDIO_TX_AGG_MAX 1
|
||||
#endif
|
||||
|
||||
s32 rtl8723_dequeue_writeport(PADAPTER padapter, u8 *freePage)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
|
||||
struct xmit_buf *pxmitbuf;
|
||||
//struct xmit_frame *pframe;
|
||||
PADAPTER pri_padapter = padapter;
|
||||
u32 deviceId;
|
||||
u32 requiredPage;
|
||||
u8 PageIdx;
|
||||
_irqL irql;
|
||||
u32 n;
|
||||
s32 ret = 0;
|
||||
//HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
s32 buddy_rm_stop = _FAIL;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(rtw_buddy_adapter_up(padapter))
|
||||
ret = check_buddy_fwstate( padapter, _FW_UNDER_SURVEY);
|
||||
#endif
|
||||
|
||||
ret = ret || check_fwstate(pmlmepriv, _FW_UNDER_SURVEY);
|
||||
|
||||
if (_TRUE == ret)
|
||||
pxmitbuf = dequeue_pending_xmitbuf_under_survey(pxmitpriv);
|
||||
else
|
||||
pxmitbuf = dequeue_pending_xmitbuf(pxmitpriv);
|
||||
|
||||
if (pxmitbuf == NULL)
|
||||
return _TRUE;
|
||||
|
||||
//pframe = (struct xmit_frame*)pxmitbuf->priv_data;
|
||||
//requiredPage = pframe->pg_num;
|
||||
requiredPage = pxmitbuf->pg_num;
|
||||
|
||||
//translate queue index to sdio fifo addr
|
||||
deviceId = pdvobjpriv->Queue2Pipe[pxmitbuf->ff_hwaddr];
|
||||
|
||||
// translate sdio fifo addr to tx fifo page index
|
||||
switch (deviceId)
|
||||
{
|
||||
case WLAN_TX_HIQ_DEVICE_ID:
|
||||
PageIdx = HI_QUEUE_IDX;
|
||||
break;
|
||||
|
||||
case WLAN_TX_MIQ_DEVICE_ID:
|
||||
PageIdx = MID_QUEUE_IDX;
|
||||
break;
|
||||
|
||||
case WLAN_TX_LOQ_DEVICE_ID:
|
||||
PageIdx = LOW_QUEUE_IDX;
|
||||
break;
|
||||
}
|
||||
|
||||
// check if hardware tx fifo page is enough
|
||||
n = 0;
|
||||
// _enter_critical_bh(&phal->SdioTxFIFOFreePageLock, &irql);
|
||||
do {
|
||||
if (requiredPage <= freePage[PageIdx]) {
|
||||
freePage[PageIdx] -= requiredPage;
|
||||
break;
|
||||
}
|
||||
// The number of page which public page included is available.
|
||||
if ((freePage[PageIdx] + freePage[PUBLIC_QUEUE_IDX]) > (requiredPage + 1))
|
||||
{
|
||||
u8 requiredPublicPage;
|
||||
|
||||
requiredPublicPage = requiredPage - freePage[PageIdx];
|
||||
freePage[PageIdx] = 0;
|
||||
freePage[PUBLIC_QUEUE_IDX] -= requiredPublicPage;
|
||||
break;
|
||||
}
|
||||
// _exit_critical_bh(&phal->SdioTxFIFOFreePageLock, &irql);
|
||||
|
||||
ret = (padapter->bDriverStopped == _TRUE) || (padapter->bSurpriseRemoved == _TRUE)
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
||((padapter->pbuddy_adapter)
|
||||
&& ((padapter->pbuddy_adapter->bSurpriseRemoved) ||(padapter->pbuddy_adapter->bDriverStopped)))
|
||||
#endif
|
||||
;
|
||||
|
||||
if (ret) {
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_notice_,
|
||||
("%s: bSurpriseRemoved(update TX FIFO page)\n", __func__));
|
||||
goto free_xmitbuf;
|
||||
}
|
||||
|
||||
n++;
|
||||
//if ((n & 0x3FF) == 0)
|
||||
if ((n % 100) == 0)
|
||||
{
|
||||
if (n >= 5000) {
|
||||
u8 reg_value_1 = 0;
|
||||
u8 reg_value_2 = 0;
|
||||
u8 reg_value_3 = 0;
|
||||
|
||||
DBG_8192C(KERN_NOTICE "%s: FIFO starvation!(%d) len=%d agg=%d page=(R)%d(A)%d\n",
|
||||
__func__, n, pxmitbuf->len, pxmitbuf->agg_num, pxmitbuf->pg_num, freePage[PageIdx] + freePage[PUBLIC_QUEUE_IDX]);
|
||||
|
||||
//try to recover the transmission
|
||||
reg_value_1 = rtw_read8(padapter, REG_SYS_FUNC_EN);
|
||||
reg_value_2 = rtw_read8(padapter, REG_CR);
|
||||
reg_value_3 = rtw_read8(padapter, REG_TXPAUSE);
|
||||
DBG_871X("Before recovery: REG_SYS_FUNC_EN = 0x%X, REG_CR = 0x%X, REG_TXPAUSE = 0x%X\n", reg_value_1, reg_value_2, reg_value_3);
|
||||
|
||||
rtw_write8(padapter, REG_SYS_FUNC_EN, reg_value_1 | 0x01);
|
||||
rtw_write8(padapter, REG_CR, reg_value_2 | 0xC0);
|
||||
rtw_write8(padapter, REG_TXPAUSE, 0);
|
||||
DBG_871X("After recovery: REG_SYS_FUNC_EN = 0x%X, REG_CR = 0x%X, REG_TXPAUSE = 0x%X\n",
|
||||
rtw_read8(padapter, REG_SYS_FUNC_EN), rtw_read8(padapter, REG_CR), rtw_read8(padapter, REG_TXPAUSE));
|
||||
} else {
|
||||
//RT_TRACE(_module_hal_xmit_c_, _drv_notice_,
|
||||
// ("%s: FIFO starvation!(%d) len=%d agg=%d page=(R)%d(A)%d\n",
|
||||
// __FUNCTION__, n, pxmitbuf->len, pxmitbuf->agg_num, pxmitbuf->pg_num, freePage[PageIdx] + freePage[PUBLIC_QUEUE_IDX]));
|
||||
}
|
||||
//rtw_yield_os();
|
||||
rtw_msleep_os(1);
|
||||
}
|
||||
|
||||
// Total number of page is NOT available, so update current FIFO status
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (padapter->adapter_type > 0)
|
||||
pri_padapter = padapter->pbuddy_adapter;
|
||||
#endif
|
||||
HalQueryTxBufferStatus8723ASdio(pri_padapter);
|
||||
|
||||
} while (1);
|
||||
|
||||
if ((padapter->bSurpriseRemoved == _TRUE)
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
||((padapter->pbuddy_adapter)&& (padapter->pbuddy_adapter->bSurpriseRemoved))
|
||||
#endif
|
||||
){
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_notice_,
|
||||
("%s: bSurpriseRemoved(wirte port)\n", __FUNCTION__));
|
||||
goto free_xmitbuf;
|
||||
}
|
||||
rtw_write_port(padapter, deviceId, pxmitbuf->len, (u8 *)pxmitbuf);
|
||||
|
||||
free_xmitbuf:
|
||||
//rtw_free_xmitframe(pxmitpriv, pframe);
|
||||
//pxmitbuf->priv_data = NULL;
|
||||
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Description
|
||||
* Transmit xmitbuf to hardware tx fifo
|
||||
*
|
||||
* Return
|
||||
* _SUCCESS ok
|
||||
* _FAIL something error
|
||||
*/
|
||||
s32 rtl8723as_xmit_buf_handler(PADAPTER padapter)
|
||||
{
|
||||
PHAL_DATA_TYPE phal;
|
||||
struct mlme_priv *pmlmepriv;
|
||||
struct xmit_priv *pxmitpriv;
|
||||
struct dvobj_priv *pdvobjpriv;
|
||||
struct xmit_buf *pxmitbuf;
|
||||
struct xmit_frame *pframe;
|
||||
u8 *freePage;
|
||||
u32 deviceId;
|
||||
u32 requiredPage;
|
||||
u8 PageIdx, queue_empty;
|
||||
_irqL irql;
|
||||
u32 n;
|
||||
s32 ret;
|
||||
|
||||
|
||||
phal = GET_HAL_DATA(padapter);
|
||||
pmlmepriv = &padapter->mlmepriv;
|
||||
pxmitpriv = &padapter->xmitpriv;
|
||||
pdvobjpriv = adapter_to_dvobj(padapter);
|
||||
freePage = phal->SdioTxFIFOFreePage;
|
||||
|
||||
ret = _rtw_down_sema(&pxmitpriv->xmit_sema);
|
||||
if (_FAIL == ret) {
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_emerg_,
|
||||
("%s: down SdioXmitBufSema fail!\n", __FUNCTION__));
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
ret = (padapter->bDriverStopped == _TRUE) || (padapter->bSurpriseRemoved == _TRUE);
|
||||
if (ret) {
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_err_,
|
||||
("%s: bDriverStopped(%d) bSurpriseRemoved(%d)!\n",
|
||||
__FUNCTION__, padapter->bDriverStopped, padapter->bSurpriseRemoved));
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
ret = rtw_register_tx_alive(padapter);
|
||||
if (ret != _SUCCESS) {
|
||||
return _SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
do {
|
||||
queue_empty = rtl8723_dequeue_writeport(padapter, freePage);
|
||||
// dump secondary adapter xmitbuf
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if(rtw_buddy_adapter_up(padapter))
|
||||
queue_empty &= rtl8723_dequeue_writeport(padapter->pbuddy_adapter, freePage);
|
||||
#endif
|
||||
} while ( !queue_empty);
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
rtw_unregister_tx_alive(padapter);
|
||||
#endif
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Description:
|
||||
* Aggregation packets and send to hardware
|
||||
*
|
||||
* Return:
|
||||
* 0 Success
|
||||
* -1 Hardware resource(TX FIFO) not ready
|
||||
* -2 Software resource(xmitbuf) not ready
|
||||
*/
|
||||
static s32 xmit_xmitframes(PADAPTER padapter, struct xmit_priv *pxmitpriv)
|
||||
{
|
||||
s32 err, ret;
|
||||
u32 k;
|
||||
struct hw_xmit *hwxmits;
|
||||
u8 no_res, idx, hwentry;
|
||||
_irqL irql;
|
||||
// _irqL irqL0, irqL1;
|
||||
struct tx_servq *ptxservq;
|
||||
_list *sta_plist, *sta_phead, *frame_plist, *frame_phead;
|
||||
struct xmit_frame *pxmitframe;
|
||||
_queue *pframe_queue;
|
||||
struct xmit_buf *pxmitbuf;
|
||||
u32 txlen;
|
||||
|
||||
|
||||
err = 0;
|
||||
no_res = _FALSE;
|
||||
hwxmits = pxmitpriv->hwxmits;
|
||||
hwentry = pxmitpriv->hwxmit_entry;
|
||||
ptxservq = NULL;
|
||||
pxmitframe = NULL;
|
||||
pframe_queue = NULL;
|
||||
pxmitbuf = NULL;
|
||||
|
||||
// 0(VO), 1(VI), 2(BE), 3(BK)
|
||||
for (idx = 0; idx < hwentry; idx++, hwxmits++)
|
||||
{
|
||||
// _enter_critical(&hwxmits->sta_queue->lock, &irqL0);
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irql);
|
||||
|
||||
sta_phead = get_list_head(hwxmits->sta_queue);
|
||||
sta_plist = get_next(sta_phead);
|
||||
|
||||
while (rtw_end_of_queue_search(sta_phead, sta_plist) == _FALSE)
|
||||
{
|
||||
ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq, tx_pending);
|
||||
sta_plist = get_next(sta_plist);
|
||||
|
||||
pframe_queue = &ptxservq->sta_pending;
|
||||
|
||||
// _enter_critical(&pframe_queue->lock, &irqL1);
|
||||
//_enter_critical_bh(&pxmitpriv->lock, &irql);
|
||||
|
||||
frame_phead = get_list_head(pframe_queue);
|
||||
|
||||
while (rtw_is_list_empty(frame_phead) == _FALSE)
|
||||
{
|
||||
frame_plist = get_next(frame_phead);
|
||||
pxmitframe = LIST_CONTAINOR(frame_plist, struct xmit_frame, list);
|
||||
|
||||
// check xmit_buf size enough or not
|
||||
txlen = TXDESC_SIZE + rtw_wlan_pkt_size(pxmitframe);
|
||||
if ((NULL == pxmitbuf) ||
|
||||
((pxmitbuf->ptail + txlen) > pxmitbuf->pend)
|
||||
#ifdef SDIO_TX_AGG_MAX
|
||||
|| (k >= SDIO_TX_AGG_MAX)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (pxmitbuf) {
|
||||
struct xmit_frame *pframe;
|
||||
pframe = (struct xmit_frame*)pxmitbuf->priv_data;
|
||||
pframe->agg_num = k;
|
||||
pxmitbuf->agg_num = k;
|
||||
rtl8723a_update_txdesc(pframe, pframe->buf_addr);
|
||||
rtw_free_xmitframe(pxmitpriv, pframe);
|
||||
pxmitbuf->priv_data = NULL;
|
||||
enqueue_pending_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
//rtw_yield_os();
|
||||
}
|
||||
|
||||
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
|
||||
if (pxmitbuf == NULL) {
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_err_, ("%s: xmit_buf is not enough!\n", __FUNCTION__));
|
||||
err = -2;
|
||||
break;
|
||||
}
|
||||
k = 0;
|
||||
}
|
||||
|
||||
// ok to send, remove frame from queue
|
||||
//_enter_critical_bh(&pxmitpriv->lock, &irql);
|
||||
#ifdef CONFIG_AP_MODE
|
||||
if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == _TRUE)
|
||||
{
|
||||
if ((pxmitframe->attrib.psta->state & WIFI_SLEEP_STATE) &&
|
||||
(pxmitframe->attrib.triggered == 0))
|
||||
{
|
||||
//_exit_critical_bh(&pxmitpriv->lock, &irql);
|
||||
|
||||
DBG_8192C("%s: one not triggered pkt in queue when STA sleep\n", __func__);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
rtw_list_delete(&pxmitframe->list);
|
||||
ptxservq->qcnt--;
|
||||
hwxmits->accnt--;
|
||||
|
||||
|
||||
if (k == 0) {
|
||||
pxmitbuf->ff_hwaddr = rtw_get_ff_hwaddr(pxmitframe);
|
||||
pxmitbuf->priv_data = (u8*)pxmitframe;
|
||||
}
|
||||
|
||||
// coalesce the xmitframe to xmitbuf
|
||||
pxmitframe->pxmitbuf = pxmitbuf;
|
||||
pxmitframe->buf_addr = pxmitbuf->ptail;
|
||||
|
||||
ret = rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
|
||||
if (ret == _FAIL) {
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_err_, ("%s: coalesce FAIL!", __FUNCTION__));
|
||||
// Todo: error handler
|
||||
DBG_871X("%s: coalesce FAIL!", __FUNCTION__);
|
||||
} else {
|
||||
k++;
|
||||
if (k != 1)
|
||||
rtl8723a_update_txdesc(pxmitframe, pxmitframe->buf_addr);
|
||||
rtw_count_tx_stats(padapter, pxmitframe, pxmitframe->attrib.last_txcmdsz);
|
||||
|
||||
txlen = TXDESC_SIZE + pxmitframe->attrib.last_txcmdsz;
|
||||
pxmitframe->pg_num = (txlen + 127)/128;
|
||||
pxmitbuf->pg_num += (txlen + 127)/128;
|
||||
//if (k != 1)
|
||||
// ((struct xmit_frame*)pxmitbuf->priv_data)->pg_num += pxmitframe->pg_num;
|
||||
pxmitbuf->ptail += _RND(txlen, 8); // round to 8 bytes alignment
|
||||
pxmitbuf->len = _RND(pxmitbuf->len, 8) + txlen;
|
||||
}
|
||||
|
||||
if (k != 1)
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
pxmitframe = NULL;
|
||||
}
|
||||
|
||||
//_enter_critical_bh(&pxmitpriv->lock, &irql);
|
||||
if (_rtw_queue_empty(pframe_queue) == _TRUE)
|
||||
rtw_list_delete(&ptxservq->tx_pending);
|
||||
//_exit_critical_bh(&pxmitpriv->lock, &irql);
|
||||
|
||||
// _exit_critical(&pframe_queue->lock, &irqL1);
|
||||
//_exit_critical_bh(&pxmitpriv->lock, &irql);
|
||||
|
||||
if (err) break;
|
||||
}
|
||||
|
||||
// _exit_critical(&hwxmits->sta_queue->lock, &irqL0);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irql);
|
||||
|
||||
// dump xmit_buf to hw tx fifo
|
||||
if (pxmitbuf)
|
||||
{
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_notice_, ("pxmitbuf->len=%d enqueue\n",pxmitbuf->len));
|
||||
|
||||
if (pxmitbuf->len > 0) {
|
||||
struct xmit_frame *pframe;
|
||||
pframe = (struct xmit_frame*)pxmitbuf->priv_data;
|
||||
pframe->agg_num = k;
|
||||
pxmitbuf->agg_num = k;
|
||||
rtl8723a_update_txdesc(pframe, pframe->buf_addr);
|
||||
rtw_free_xmitframe(pxmitpriv, pframe);
|
||||
pxmitbuf->priv_data = NULL;
|
||||
enqueue_pending_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
rtw_yield_os();
|
||||
}
|
||||
else
|
||||
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
|
||||
pxmitbuf = NULL;
|
||||
}
|
||||
|
||||
if (err) break;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Description
|
||||
* Transmit xmitframe from queue
|
||||
*
|
||||
* Return
|
||||
* _SUCCESS ok
|
||||
* _FAIL something error
|
||||
*/
|
||||
s32 rtl8723as_xmit_handler(PADAPTER padapter)
|
||||
{
|
||||
struct xmit_priv *pxmitpriv;
|
||||
s32 ret;
|
||||
_irqL irql;
|
||||
|
||||
|
||||
pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
wait:
|
||||
ret = _rtw_down_sema(&pxmitpriv->SdioXmitSema);
|
||||
if (_FAIL == ret) {
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_emerg_, ("%s: down sema fail!\n", __FUNCTION__));
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
next:
|
||||
if ((padapter->bDriverStopped == _TRUE) ||
|
||||
(padapter->bSurpriseRemoved == _TRUE)) {
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_notice_,
|
||||
("%s: bDriverStopped(%d) bSurpriseRemoved(%d)\n",
|
||||
__FUNCTION__, padapter->bDriverStopped, padapter->bSurpriseRemoved));
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irql);
|
||||
ret = rtw_txframes_pending(padapter);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irql);
|
||||
if (ret == 0) {
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
// dequeue frame and write to hardware
|
||||
|
||||
ret = xmit_xmitframes(padapter, pxmitpriv);
|
||||
if (ret == -2) {
|
||||
rtw_msleep_os(1);
|
||||
goto next;
|
||||
}
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irql);
|
||||
ret = rtw_txframes_pending(padapter);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irql);
|
||||
if (ret == 1) {
|
||||
rtw_msleep_os(1);
|
||||
goto next;
|
||||
}
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
thread_return rtl8723as_xmit_thread(thread_context context)
|
||||
{
|
||||
PADAPTER padapter;
|
||||
struct xmit_priv *pxmitpriv;
|
||||
s32 ret;
|
||||
|
||||
|
||||
padapter = (PADAPTER)context;
|
||||
pxmitpriv = &padapter->xmitpriv;
|
||||
ret = _SUCCESS;
|
||||
|
||||
thread_enter("RTWHALXT");
|
||||
|
||||
do {
|
||||
ret = rtl8723as_xmit_handler(padapter);
|
||||
if (signal_pending(current)) {
|
||||
flush_signals(current);
|
||||
}
|
||||
} while (_SUCCESS == ret);
|
||||
|
||||
_rtw_up_sema(&pxmitpriv->SdioXmitTerminateSema);
|
||||
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_notice_, ("-%s\n", __FUNCTION__));
|
||||
|
||||
thread_exit();
|
||||
}
|
||||
|
||||
s32 rtl8723as_mgnt_xmit(PADAPTER padapter, struct xmit_frame *pmgntframe)
|
||||
{
|
||||
s32 ret = _SUCCESS;
|
||||
struct pkt_attrib *pattrib;
|
||||
struct xmit_buf *pxmitbuf;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
|
||||
u8 *pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
|
||||
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_info_, ("+%s\n", __FUNCTION__));
|
||||
|
||||
pattrib = &pmgntframe->attrib;
|
||||
pxmitbuf = pmgntframe->pxmitbuf;
|
||||
|
||||
rtl8723a_update_txdesc(pmgntframe, pmgntframe->buf_addr);
|
||||
|
||||
pxmitbuf->len = TXDESC_SIZE + pattrib->last_txcmdsz;
|
||||
//pmgntframe->pg_num = (pxmitbuf->len + 127)/128; // 128 is tx page size
|
||||
pxmitbuf->pg_num = (pxmitbuf->len + 127)/128; // 128 is tx page size
|
||||
pxmitbuf->ptail = pmgntframe->buf_addr + pxmitbuf->len;
|
||||
pxmitbuf->ff_hwaddr = rtw_get_ff_hwaddr(pmgntframe);
|
||||
|
||||
rtw_count_tx_stats(padapter, pmgntframe, pattrib->last_txcmdsz);
|
||||
|
||||
rtw_free_xmitframe(pxmitpriv, pmgntframe);
|
||||
|
||||
pxmitbuf->priv_data = NULL;
|
||||
|
||||
if(GetFrameSubType(pframe)==WIFI_BEACON) //dump beacon directly
|
||||
{
|
||||
rtw_write_port(padapter, pdvobjpriv->Queue2Pipe[pxmitbuf->ff_hwaddr], pxmitbuf->len, (u8 *)pxmitbuf);
|
||||
|
||||
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
enqueue_pending_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
}
|
||||
|
||||
if (ret != _SUCCESS)
|
||||
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_UNKNOWN);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Description:
|
||||
* Handle xmitframe(packet) come from rtw_xmit()
|
||||
*
|
||||
* Return:
|
||||
* _TRUE dump packet directly ok
|
||||
* _FALSE enqueue, temporary can't transmit packets to hardware
|
||||
*/
|
||||
s32 rtl8723as_hal_xmit(PADAPTER padapter, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
struct xmit_priv *pxmitpriv;
|
||||
_irqL irql;
|
||||
s32 err;
|
||||
|
||||
|
||||
pxmitframe->attrib.qsel = pxmitframe->attrib.priority;
|
||||
pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
if ((pxmitframe->frame_tag == DATA_FRAMETAG) &&
|
||||
(pxmitframe->attrib.ether_type != 0x0806) &&
|
||||
(pxmitframe->attrib.ether_type != 0x888e) &&
|
||||
(pxmitframe->attrib.dhcp_pkt != 1))
|
||||
{
|
||||
if (padapter->mlmepriv.LinkDetectInfo.bBusyTraffic == _TRUE)
|
||||
rtw_issue_addbareq_cmd(padapter, pxmitframe);
|
||||
}
|
||||
#endif
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irql);
|
||||
err = rtw_xmitframe_enqueue(padapter, pxmitframe);
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irql);
|
||||
if (err != _SUCCESS) {
|
||||
RT_TRACE(_module_hal_xmit_c_, _drv_err_, ("rtl8723as_hal_xmit: enqueue xmitframe fail\n"));
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
|
||||
// Trick, make the statistics correct
|
||||
pxmitpriv->tx_pkts--;
|
||||
pxmitpriv->tx_drop++;
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
_rtw_up_sema(&pxmitpriv->SdioXmitSema);
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
s32 rtl8723as_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
s32 err;
|
||||
|
||||
if ((err=rtw_xmitframe_enqueue(padapter, pxmitframe)) != _SUCCESS)
|
||||
{
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
|
||||
// Trick, make the statistics correct
|
||||
pxmitpriv->tx_pkts--;
|
||||
pxmitpriv->tx_drop++;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CONFIG_SDIO_TX_TASKLET
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
#else
|
||||
_rtw_up_sema(&pxmitpriv->SdioXmitSema);
|
||||
#endif
|
||||
}
|
||||
|
||||
return err;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Return
|
||||
* _SUCCESS start thread ok
|
||||
* _FAIL start thread fail
|
||||
*
|
||||
*/
|
||||
s32 rtl8723as_init_xmit_priv(PADAPTER padapter)
|
||||
{
|
||||
struct xmit_priv *xmitpriv = &padapter->xmitpriv;
|
||||
PHAL_DATA_TYPE phal;
|
||||
|
||||
|
||||
phal = GET_HAL_DATA(padapter);
|
||||
|
||||
_rtw_spinlock_init(&phal->SdioTxFIFOFreePageLock);
|
||||
_rtw_init_sema(&xmitpriv->SdioXmitSema, 0);
|
||||
_rtw_init_sema(&xmitpriv->SdioXmitTerminateSema, 0);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void rtl8723as_free_xmit_priv(PADAPTER padapter)
|
||||
{
|
||||
PHAL_DATA_TYPE phal;
|
||||
struct xmit_priv *pxmitpriv;
|
||||
struct xmit_buf *pxmitbuf;
|
||||
_queue *pqueue;
|
||||
_list *plist, *phead;
|
||||
_list tmplist;
|
||||
_irqL irql;
|
||||
|
||||
|
||||
phal = GET_HAL_DATA(padapter);
|
||||
pxmitpriv = &padapter->xmitpriv;
|
||||
pqueue = &pxmitpriv->pending_xmitbuf_queue;
|
||||
phead = get_list_head(pqueue);
|
||||
_rtw_init_listhead(&tmplist);
|
||||
|
||||
_enter_critical_bh(&pqueue->lock, &irql);
|
||||
if (_rtw_queue_empty(pqueue) == _FALSE)
|
||||
{
|
||||
// Insert tmplist to end of queue, and delete phead
|
||||
// then tmplist become head of queue.
|
||||
rtw_list_insert_tail(&tmplist, phead);
|
||||
rtw_list_delete(phead);
|
||||
}
|
||||
_exit_critical_bh(&pqueue->lock, &irql);
|
||||
|
||||
phead = &tmplist;
|
||||
while (rtw_is_list_empty(phead) == _FALSE)
|
||||
{
|
||||
plist = get_next(phead);
|
||||
rtw_list_delete(plist);
|
||||
|
||||
pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list);
|
||||
rtw_free_xmitframe(pxmitpriv, (struct xmit_frame*)pxmitbuf->priv_data);
|
||||
pxmitbuf->priv_data = NULL;
|
||||
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
|
||||
}
|
||||
|
||||
_rtw_spinlock_free(&phal->SdioTxFIFOFreePageLock);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,168 +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 "drv_types.h"
|
||||
#include "rtl8723a_hal.h"
|
||||
|
||||
//================================================================================
|
||||
// LED object.
|
||||
//================================================================================
|
||||
|
||||
|
||||
//================================================================================
|
||||
// Prototype of protected function.
|
||||
//================================================================================
|
||||
|
||||
//================================================================================
|
||||
// LED_819xUsb routines.
|
||||
//================================================================================
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Turn on LED according to LedPin specified.
|
||||
//
|
||||
void
|
||||
SwLedOn(
|
||||
_adapter *padapter,
|
||||
PLED_871x pLed
|
||||
)
|
||||
{
|
||||
u8 LedCfg;
|
||||
//HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
if( (padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
|
||||
{
|
||||
return;
|
||||
}
|
||||
switch(pLed->LedPin)
|
||||
{
|
||||
case LED_PIN_GPIO0:
|
||||
break;
|
||||
|
||||
case LED_PIN_LED0:
|
||||
rtw_write8(padapter, REG_LEDCFG0, (LedCfg&0xf0)|BIT5|BIT6); // SW control led0 on.
|
||||
break;
|
||||
|
||||
case LED_PIN_LED1:
|
||||
rtw_write8(padapter, REG_LEDCFG1, (LedCfg&0x00)|BIT6); // SW control led1 on.
|
||||
break;
|
||||
|
||||
case LED_PIN_LED2:
|
||||
LedCfg=rtw_read8(padapter, REG_LEDCFG2);
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0x80)|BIT5); // SW control led1 on.
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
pLed->bLedOn = _TRUE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Turn off LED according to LedPin specified.
|
||||
//
|
||||
void
|
||||
SwLedOff(
|
||||
_adapter *padapter,
|
||||
PLED_871x pLed
|
||||
)
|
||||
{
|
||||
u8 LedCfg;
|
||||
//HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
if((padapter->bSurpriseRemoved == _TRUE) || ( padapter->bDriverStopped == _TRUE))
|
||||
{
|
||||
goto exit;
|
||||
}
|
||||
|
||||
switch(pLed->LedPin)
|
||||
{
|
||||
case LED_PIN_GPIO0:
|
||||
break;
|
||||
|
||||
case LED_PIN_LED0:
|
||||
rtw_write8(padapter, REG_LEDCFG0, (LedCfg&0xf0)|BIT5|BIT6); // SW control led0 on.
|
||||
break;
|
||||
|
||||
case LED_PIN_LED1:
|
||||
rtw_write8(padapter, REG_LEDCFG1, (LedCfg&0x00)|BIT5|BIT6); // SW control led1 on.
|
||||
break;
|
||||
|
||||
case LED_PIN_LED2:
|
||||
LedCfg=rtw_read8(padapter, REG_LEDCFG2);
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg&0x80)|BIT3|BIT5); // SW control led1 on.
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
exit:
|
||||
pLed->bLedOn = _FALSE;
|
||||
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
// Interface to manipulate LED objects.
|
||||
//================================================================================
|
||||
|
||||
//================================================================================
|
||||
// Default LED behavior.
|
||||
//================================================================================
|
||||
|
||||
//
|
||||
// Description:
|
||||
// Initialize all LED_871x objects.
|
||||
//
|
||||
void
|
||||
rtl8723au_InitSwLeds(
|
||||
_adapter *padapter
|
||||
)
|
||||
{
|
||||
struct led_priv *pledpriv = &(padapter->ledpriv);
|
||||
|
||||
pledpriv->LedControlHandler = LedControl871x;
|
||||
//8723as-vau wifi used led2
|
||||
InitLed871x(padapter, &(pledpriv->SwLed0), LED_PIN_LED2);
|
||||
|
||||
// InitLed871x(padapter,&(pledpriv->SwLed1), LED_PIN_LED2);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Description:
|
||||
// DeInitialize all LED_819xUsb objects.
|
||||
//
|
||||
void
|
||||
rtl8723au_DeInitSwLeds(
|
||||
_adapter *padapter
|
||||
)
|
||||
{
|
||||
struct led_priv *ledpriv = &(padapter->ledpriv);
|
||||
|
||||
DeInitLed871x( &(ledpriv->SwLed0) );
|
||||
// DeInitLed871x( &(ledpriv->SwLed1) );
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user