remove unused wifi driver: rda5990, mt5931, mt7601, mt6620
This commit is contained in:
parent
69ec730f70
commit
7f479c2a4a
661 changed files with 0 additions and 648295 deletions
|
|
@ -1,25 +0,0 @@
|
|||
menuconfig MTK_COMBO_MT66XX
|
||||
bool "MediaTek combo_mt66xx WiFi Config"
|
||||
help
|
||||
Config MTK combo chip mt6628&mt6620
|
||||
|
||||
if MTK_COMBO_MT66XX
|
||||
|
||||
config MTK_COMBO_WIFI
|
||||
tristate "MediaTek Combo Chip Wi-Fi support"
|
||||
default y
|
||||
#depends on MTK_COMBO_WMT
|
||||
depends on MMC
|
||||
depends on IPV6
|
||||
select WIRELESS_EXT
|
||||
select WEXT_PRIV
|
||||
help
|
||||
This module adds support for wireless adapters based on
|
||||
MTK MT66XX chipset.
|
||||
|
||||
This driver uses the kernel's wireless extensions subsystem.
|
||||
|
||||
If you choose to build a module, it'll be called dhd. Say M if
|
||||
unsure.
|
||||
|
||||
endif
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
obj-$(CONFIG_MTK_COMBO_WIFI) += mt6620/
|
||||
|
||||
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
obj-$(CONFIG_MTK_COMBO_WIFI) += wlan/
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
# ---------------------------------------------------
|
||||
# Compile Options
|
||||
# ---------------------------------------------------
|
||||
|
||||
#include $(MTK_PATH_BUILD)/Makefile
|
||||
ccflags-y += -DLINUX -DMT6620
|
||||
|
||||
ifeq ($(MTK_WAPI_SUPPORT), yes)
|
||||
ccflags-y += -DCFG_SUPPORT_WAPI=1
|
||||
else
|
||||
ccflags-y += -DCFG_SUPPORT_WAPI=0
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_XLOG_FEATURE), yes)
|
||||
ccflags-y += -DCFG_SUPPORT_XLOG=1
|
||||
else
|
||||
ccflags-y += -DCFG_SUPPORT_XLOG=0
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_AEE_FEATURE), yes)
|
||||
ccflags-y += -DCFG_SUPPORT_AEE=1
|
||||
else
|
||||
ccflags-y += -DCFG_SUPPORT_AEE=0
|
||||
endif
|
||||
|
||||
#ifeq ($(CONFIG_MTK_COMBO_WIFI_HIF_SDIO1), y)
|
||||
# ccflags-y += -D_HIF_SDIO=1
|
||||
#endif
|
||||
|
||||
MODULE_NAME := wlan_mt6620
|
||||
|
||||
ccflags-y += -D_HIF_SDIO=1
|
||||
|
||||
ccflags-y += -DDBG=1
|
||||
ccflags-y += -I$(src)/os -I$(src)/os/linux/include -I$(src)/os/linux/hif/sdio/include
|
||||
ccflags-y += -I$(src)/include -I$(src)/include/nic -I$(src)/include/mgmt
|
||||
|
||||
obj-$(CONFIG_MTK_COMBO_WIFI) += $(MODULE_NAME).o
|
||||
#obj-m += $(MODULE_NAME).o
|
||||
|
||||
# ---------------------------------------------------
|
||||
# Directory List
|
||||
# ---------------------------------------------------
|
||||
COMMON_DIR := common/
|
||||
OS_DIR := os/linux/
|
||||
HIF_DIR := os/linux/hif/sdio/
|
||||
NIC_DIR := nic/
|
||||
MGMT_DIR := mgmt/
|
||||
|
||||
|
||||
# ---------------------------------------------------
|
||||
# Objects List
|
||||
# ---------------------------------------------------
|
||||
|
||||
COMMON_OBJS := $(COMMON_DIR)dump.o \
|
||||
$(COMMON_DIR)wlan_lib.o \
|
||||
$(COMMON_DIR)wlan_oid.o \
|
||||
$(COMMON_DIR)wlan_bow.o
|
||||
|
||||
NIC_OBJS := $(NIC_DIR)nic.o \
|
||||
$(NIC_DIR)nic_tx.o \
|
||||
$(NIC_DIR)nic_rx.o \
|
||||
$(NIC_DIR)nic_pwr_mgt.o \
|
||||
$(NIC_DIR)cmd_buf.o \
|
||||
$(NIC_DIR)que_mgt.o \
|
||||
$(NIC_DIR)nic_cmd_event.o
|
||||
|
||||
OS_OBJS := $(OS_DIR)gl_init.o \
|
||||
$(OS_DIR)gl_kal.o \
|
||||
$(OS_DIR)gl_bow.o \
|
||||
$(OS_DIR)gl_wext.o \
|
||||
$(OS_DIR)gl_wext_priv.o \
|
||||
$(OS_DIR)gl_rst.o \
|
||||
$(OS_DIR)gl_cfg80211.o \
|
||||
$(OS_DIR)platform.o
|
||||
|
||||
MGMT_OBJS := $(MGMT_DIR)ais_fsm.o \
|
||||
$(MGMT_DIR)aaa_fsm.o \
|
||||
$(MGMT_DIR)assoc.o \
|
||||
$(MGMT_DIR)auth.o \
|
||||
$(MGMT_DIR)bss.o \
|
||||
$(MGMT_DIR)cnm.o \
|
||||
$(MGMT_DIR)cnm_timer.o \
|
||||
$(MGMT_DIR)cnm_mem.o \
|
||||
$(MGMT_DIR)hem_mbox.o \
|
||||
$(MGMT_DIR)mib.o \
|
||||
$(MGMT_DIR)privacy.o \
|
||||
$(MGMT_DIR)rate.o \
|
||||
$(MGMT_DIR)rlm.o \
|
||||
$(MGMT_DIR)rlm_domain.o \
|
||||
$(MGMT_DIR)rlm_obss.o \
|
||||
$(MGMT_DIR)rlm_protection.o \
|
||||
$(MGMT_DIR)rsn.o \
|
||||
$(MGMT_DIR)saa_fsm.o \
|
||||
$(MGMT_DIR)scan.o \
|
||||
$(MGMT_DIR)scan_fsm.o \
|
||||
$(MGMT_DIR)sec_fsm.o \
|
||||
$(MGMT_DIR)swcr.o \
|
||||
$(MGMT_DIR)roaming_fsm.o
|
||||
|
||||
# ---------------------------------------------------
|
||||
# P2P Objects List
|
||||
# ---------------------------------------------------
|
||||
|
||||
COMMON_OBJS += $(COMMON_DIR)wlan_p2p.o
|
||||
|
||||
NIC_OBJS += $(NIC_DIR)p2p_nic.o
|
||||
|
||||
OS_OBJS += $(OS_DIR)gl_p2p.o \
|
||||
$(OS_DIR)gl_p2p_cfg80211.o \
|
||||
$(OS_DIR)gl_p2p_init.o \
|
||||
$(OS_DIR)gl_p2p_kal.o
|
||||
|
||||
MGMT_OBJS += $(MGMT_DIR)p2p_assoc.o \
|
||||
$(MGMT_DIR)p2p_bss.o \
|
||||
$(MGMT_DIR)p2p_fsm.o \
|
||||
$(MGMT_DIR)p2p_func.o \
|
||||
$(MGMT_DIR)p2p_rlm.o \
|
||||
$(MGMT_DIR)p2p_rlm_obss.o \
|
||||
$(MGMT_DIR)p2p_scan.o \
|
||||
$(MGMT_DIR)p2p_ie.o \
|
||||
$(MGMT_DIR)p2p_state.o
|
||||
|
||||
|
||||
ifeq ($(MTK_WAPI_SUPPORT), yes)
|
||||
MGMT_OBJS += $(MGMT_DIR)wapi.o
|
||||
endif
|
||||
|
||||
ifeq ($(WLAN_PROC), y)
|
||||
OS_OBJS += gl_proc.o
|
||||
endif
|
||||
|
||||
HIF_OBJS := $(HIF_DIR)arm.o \
|
||||
$(HIF_DIR)sdio.o
|
||||
|
||||
$(MODULE_NAME)-objs += $(COMMON_OBJS)
|
||||
$(MODULE_NAME)-objs += $(NIC_OBJS)
|
||||
$(MODULE_NAME)-objs += $(OS_OBJS)
|
||||
$(MODULE_NAME)-objs += $(HIF_OBJS)
|
||||
$(MODULE_NAME)-objs += $(MGMT_OBJS)
|
||||
|
||||
|
||||
|
|
@ -1,539 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/common/dump.c#1 $
|
||||
*/
|
||||
|
||||
/*! \file "dump.c"
|
||||
\brief Provide memory dump function for debugging.
|
||||
|
||||
Provide memory dump function for debugging.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: dump.c $
|
||||
*
|
||||
* 11 24 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* Adjust code for DBG and CONFIG_XLOG.
|
||||
*
|
||||
* 11 10 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* Using the new XLOG define for dum Memory.
|
||||
*
|
||||
* 11 03 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* Add dumpMemory8 at XLOG support.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 19:58:51 GMT mtk01426
|
||||
** Init develop
|
||||
**
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "precomp.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#if DBG
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This routine is called to dump a segment of memory in bytes.
|
||||
*
|
||||
* \param[in] pucStartAddr Pointer to the starting address of the memory to be dumped.
|
||||
* \param[in] u4Length Length of the memory to be dumped.
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
dumpMemory8 (
|
||||
IN PUINT_8 pucStartAddr,
|
||||
IN UINT_32 u4Length
|
||||
)
|
||||
{
|
||||
ASSERT(pucStartAddr);
|
||||
|
||||
LOG_FUNC("DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length);
|
||||
|
||||
while (u4Length > 0) {
|
||||
if (u4Length >= 16) {
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11],
|
||||
pucStartAddr[12], pucStartAddr[13], pucStartAddr[14], pucStartAddr[15]);
|
||||
u4Length -= 16;
|
||||
pucStartAddr += 16;
|
||||
}
|
||||
else {
|
||||
switch (u4Length) {
|
||||
case 1:
|
||||
LOG_FUNC("(%08lx) %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0]);
|
||||
break;
|
||||
case 2:
|
||||
LOG_FUNC("(%08lx) %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1]);
|
||||
break;
|
||||
case 3:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2]);
|
||||
break;
|
||||
case 4:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3]);
|
||||
break;
|
||||
case 5:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4]);
|
||||
break;
|
||||
case 6:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5]);
|
||||
break;
|
||||
case 7:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6]);
|
||||
break;
|
||||
case 8:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7]);
|
||||
break;
|
||||
case 9:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8]);
|
||||
break;
|
||||
case 10:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9]);
|
||||
break;
|
||||
case 11:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10]);
|
||||
break;
|
||||
case 12:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11]);
|
||||
break;
|
||||
case 13:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11],
|
||||
pucStartAddr[12]);
|
||||
break;
|
||||
case 14:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11],
|
||||
pucStartAddr[12], pucStartAddr[13]);
|
||||
break;
|
||||
case 15:
|
||||
LOG_FUNC("(%08lx) %02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x\n",
|
||||
(UINT_32)pucStartAddr,
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11],
|
||||
pucStartAddr[12], pucStartAddr[13], pucStartAddr[14]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
u4Length = 0;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_FUNC("\n");
|
||||
|
||||
return;
|
||||
} /* end of dumpMemory8() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This routine is called to dump a segment of memory in double words.
|
||||
*
|
||||
* \param[in] pucStartAddr Pointer to the starting address of the memory to be dumped.
|
||||
* \param[in] u4Length Length of the memory to be dumped.
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
dumpMemory32 (
|
||||
IN PUINT_32 pu4StartAddr,
|
||||
IN UINT_32 u4Length)
|
||||
{
|
||||
PUINT_8 pucAddr;
|
||||
|
||||
|
||||
ASSERT(pu4StartAddr);
|
||||
|
||||
LOG_FUNC("DUMP32 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pu4StartAddr, u4Length);
|
||||
|
||||
if (IS_NOT_ALIGN_4((UINT_32)pu4StartAddr)) {
|
||||
UINT_32 u4ProtrudeLen = sizeof(UINT_32) - ((UINT_32)pu4StartAddr % 4);
|
||||
|
||||
|
||||
u4ProtrudeLen = ((u4Length < u4ProtrudeLen) ? u4Length: u4ProtrudeLen);
|
||||
LOG_FUNC("pu4StartAddr is not at DW boundary.\n");
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[0];
|
||||
|
||||
switch (u4ProtrudeLen) {
|
||||
case 1:
|
||||
LOG_FUNC("(%08lx) %02x------\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pucAddr[0]);
|
||||
break;
|
||||
case 2:
|
||||
LOG_FUNC("(%08lx) %02x%02x----\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pucAddr[1], pucAddr[0]);
|
||||
break;
|
||||
case 3:
|
||||
LOG_FUNC("(%08lx) %02x%02x%02x--\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pucAddr[2], pucAddr[1], pucAddr[0]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
u4Length -= u4ProtrudeLen;
|
||||
pu4StartAddr = (PUINT_32)((UINT_32)pu4StartAddr + u4ProtrudeLen);
|
||||
}
|
||||
|
||||
while (u4Length > 0) {
|
||||
if (u4Length >= 16) {
|
||||
LOG_FUNC("(%08lx) %08lx %08lx %08lx %08lx\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2], pu4StartAddr[3]);
|
||||
pu4StartAddr += 4;
|
||||
u4Length -= 16;
|
||||
}
|
||||
else {
|
||||
switch (u4Length) {
|
||||
case 1:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[0];
|
||||
LOG_FUNC("(%08lx) ------%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pucAddr[0]);
|
||||
break;
|
||||
case 2:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[0];
|
||||
LOG_FUNC("(%08lx) ----%02x%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pucAddr[1], pucAddr[0]);
|
||||
break;
|
||||
case 3:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[0];
|
||||
LOG_FUNC("(%08lx) --%02x%02x%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pucAddr[2], pucAddr[1], pucAddr[0]);
|
||||
break;
|
||||
case 4:
|
||||
LOG_FUNC("(%08lx) %08lx\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0]);
|
||||
break;
|
||||
case 5:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[1];
|
||||
LOG_FUNC("(%08lx) %08lx ------%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0],
|
||||
pucAddr[0]);
|
||||
break;
|
||||
case 6:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[1];
|
||||
LOG_FUNC("(%08lx) %08lx ----%02x%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0],
|
||||
pucAddr[1], pucAddr[0]);
|
||||
break;
|
||||
case 7:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[1];
|
||||
LOG_FUNC("(%08lx) %08lx --%02x%02x%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0],
|
||||
pucAddr[2], pucAddr[1], pucAddr[0]);
|
||||
break;
|
||||
case 8:
|
||||
LOG_FUNC("(%08lx) %08lx %08lx\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0], pu4StartAddr[1]);
|
||||
break;
|
||||
case 9:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[2];
|
||||
LOG_FUNC("(%08lx) %08lx %08lx ------%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0], pu4StartAddr[1],
|
||||
pucAddr[0]);
|
||||
break;
|
||||
case 10:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[2];
|
||||
LOG_FUNC("(%08lx) %08lx %08lx ----%02x%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0], pu4StartAddr[1],
|
||||
pucAddr[1], pucAddr[0]);
|
||||
break;
|
||||
case 11:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[2];
|
||||
LOG_FUNC("(%08lx) %08lx %08lx --%02x%02x%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0], pu4StartAddr[1],
|
||||
pucAddr[2], pucAddr[1], pucAddr[0]);
|
||||
break;
|
||||
case 12:
|
||||
LOG_FUNC("(%08lx) %08lx %08lx %08lx\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2]);
|
||||
break;
|
||||
case 13:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[3];
|
||||
LOG_FUNC("(%08lx) %08lx %08lx %08lx ------%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2],
|
||||
pucAddr[0]);
|
||||
break;
|
||||
case 14:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[3];
|
||||
LOG_FUNC("(%08lx) %08lx %08lx %08lx ----%02x%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2],
|
||||
pucAddr[1], pucAddr[0]);
|
||||
break;
|
||||
case 15:
|
||||
pucAddr = (PUINT_8) &pu4StartAddr[3];
|
||||
LOG_FUNC("(%08lx) %08lx %08lx %08lx --%02x%02x%02x\n",
|
||||
(UINT_32)pu4StartAddr,
|
||||
pu4StartAddr[0], pu4StartAddr[1], pu4StartAddr[2],
|
||||
pucAddr[2], pucAddr[1], pucAddr[0]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
u4Length = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
} /* end of dumpMemory32() */
|
||||
#elif CFG_SUPPORT_XLOG
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This routine is called to dump a segment of memory in bytes.
|
||||
*
|
||||
* \param[in] pucStartAddr Pointer to the starting address of the memory to be dumped.
|
||||
* \param[in] u4Length Length of the memory to be dumped.
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
dumpMemory8 (
|
||||
IN UINT_32 log_level,
|
||||
IN PUINT_8 pucStartAddr,
|
||||
IN UINT_32 u4Length
|
||||
)
|
||||
{
|
||||
ASSERT(pucStartAddr);
|
||||
|
||||
if (log_level == ANDROID_LOG_ERROR) {
|
||||
xlog_printk(ANDROID_LOG_ERROR, XLOG_TAG, "DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length);
|
||||
}
|
||||
else if (log_level == ANDROID_LOG_WARN) {
|
||||
xlog_printk(ANDROID_LOG_WARN, XLOG_TAG, "DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length);
|
||||
}
|
||||
else if (log_level == ANDROID_LOG_INFO) {
|
||||
xlog_printk(ANDROID_LOG_INFO, XLOG_TAG, "DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length);
|
||||
}
|
||||
else if (log_level == ANDROID_LOG_DEBUG) {
|
||||
xlog_printk(ANDROID_LOG_DEBUG, XLOG_TAG, "DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length);
|
||||
}
|
||||
else if (log_level == ANDROID_LOG_VERBOSE) {
|
||||
xlog_printk(ANDROID_LOG_VERBOSE, XLOG_TAG, "DUMP8 ADDRESS: %08lx, Length: %ld\n", (UINT_32)pucStartAddr, u4Length);
|
||||
}
|
||||
|
||||
while (u4Length > 0) {
|
||||
if (u4Length >= 16) {
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11],
|
||||
pucStartAddr[12], pucStartAddr[13], pucStartAddr[14], pucStartAddr[15]);
|
||||
u4Length -= 16;
|
||||
pucStartAddr += 16;
|
||||
}
|
||||
else {
|
||||
switch (u4Length) {
|
||||
case 1:
|
||||
XLOG_FUNC(log_level, "%02x\n",
|
||||
pucStartAddr[ 0]);
|
||||
break;
|
||||
case 2:
|
||||
XLOG_FUNC(log_level, "%02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1]);
|
||||
break;
|
||||
case 3:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2]);
|
||||
break;
|
||||
case 4:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3]);
|
||||
break;
|
||||
case 5:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4]);
|
||||
break;
|
||||
case 6:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5]);
|
||||
break;
|
||||
case 7:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6]);
|
||||
break;
|
||||
case 8:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7]);
|
||||
break;
|
||||
case 9:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8]);
|
||||
break;
|
||||
case 10:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9]);
|
||||
break;
|
||||
case 11:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10]);
|
||||
break;
|
||||
case 12:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11]);
|
||||
break;
|
||||
case 13:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11],
|
||||
pucStartAddr[12]);
|
||||
break;
|
||||
case 14:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11],
|
||||
pucStartAddr[12], pucStartAddr[13]);
|
||||
break;
|
||||
case 15:
|
||||
XLOG_FUNC(log_level, "%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x\n",
|
||||
pucStartAddr[ 0], pucStartAddr[ 1], pucStartAddr[ 2], pucStartAddr[ 3],
|
||||
pucStartAddr[ 4], pucStartAddr[ 5], pucStartAddr[ 6], pucStartAddr[ 7],
|
||||
pucStartAddr[ 8], pucStartAddr[ 9], pucStartAddr[10], pucStartAddr[11],
|
||||
pucStartAddr[12], pucStartAddr[13], pucStartAddr[14]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
u4Length = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
} /* end of dumpMemory8() */
|
||||
#endif /* DBG */
|
||||
|
||||
|
||||
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,251 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/CFG_Wifi_File.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file CFG_Wifi_File.h
|
||||
\brief Collection of NVRAM structure used for YuSu project
|
||||
|
||||
In this file we collect all compiler flags and detail the driver behavior if
|
||||
enable/disable such switch or adjust numeric parameters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: CFG_Wifi_File.h $
|
||||
*
|
||||
* 09 08 2011 cm.chang
|
||||
* [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
|
||||
* Use new fields ucChannelListMap and ucChannelListIndex in NVRAM
|
||||
*
|
||||
* 08 31 2011 cm.chang
|
||||
* [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
|
||||
* .
|
||||
*
|
||||
* 08 15 2011 cp.wu
|
||||
* [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree
|
||||
* add MT6628-specific definitions.
|
||||
*
|
||||
* 08 09 2011 cp.wu
|
||||
* [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC[WCXRP00000913] [MT6620 Wi-Fi] create repository of source code dedicated for MT6620 E6 ASIC
|
||||
* add CCK-DSSS TX-PWR control field in NVRAM and CMD definition for MT5931-MP
|
||||
*
|
||||
* 05 27 2011 cp.wu
|
||||
* [WCXRP00000749] [MT6620 Wi-Fi][Driver] Add band edge tx power control to Wi-Fi NVRAM
|
||||
* update NVRAM data structure definition.
|
||||
*
|
||||
* 03 10 2011 cp.wu
|
||||
* [WCXRP00000532] [MT6620 Wi-Fi][Driver] Migrate NVRAM configuration procedures from MT6620 E2 to MT6620 E3
|
||||
* deprecate configuration used by MT6620 E2
|
||||
*
|
||||
* 10 26 2010 cp.wu
|
||||
* [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command
|
||||
* 1) update NVRAM content template to ver 1.02
|
||||
* 2) add compile option for querying NIC capability (default: off)
|
||||
* 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting
|
||||
* 4) correct auto-rate compiler error under linux (treat warning as error)
|
||||
* 5) simplify usage of NVRAM and REG_INFO_T
|
||||
* 6) add version checking between driver and firmware
|
||||
*
|
||||
* 10 25 2010 cp.wu
|
||||
* [WCXRP00000133] [MT6620 Wi-Fi] [FW][Driver] Change TX power offset band definition
|
||||
* follow-up for CMD_5G_PWR_OFFSET_T definition change
|
||||
*
|
||||
* 10 05 2010 cp.wu
|
||||
* [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
|
||||
* 1) add NVRAM access API
|
||||
* 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option)
|
||||
* 3) add OID implementation for NVRAM read/write service
|
||||
*
|
||||
* 09 23 2010 cp.wu
|
||||
* [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
|
||||
* add skeleton for NVRAM integration
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _CFG_WIFI_FILE_H
|
||||
#define _CFG_WIFI_FILE_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "gl_typedef.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
// duplicated from nic_cmd_event.h to avoid header dependency
|
||||
typedef struct _TX_PWR_PARAM_T {
|
||||
INT_8 cTxPwr2G4Cck; /* signed, in unit of 0.5dBm */
|
||||
#if defined(MT6620)
|
||||
INT_8 acReserved[3];
|
||||
#elif defined(MT5931) || defined(MT6628)
|
||||
INT_8 cTxPwr2G4Dsss; /* signed, in unit of 0.5dBm */
|
||||
INT_8 acReserved[2];
|
||||
#else
|
||||
#error "No valid definition!"
|
||||
#endif
|
||||
|
||||
INT_8 cTxPwr2G4OFDM_BPSK;
|
||||
INT_8 cTxPwr2G4OFDM_QPSK;
|
||||
INT_8 cTxPwr2G4OFDM_16QAM;
|
||||
INT_8 cTxPwr2G4OFDM_Reserved;
|
||||
INT_8 cTxPwr2G4OFDM_48Mbps;
|
||||
INT_8 cTxPwr2G4OFDM_54Mbps;
|
||||
|
||||
INT_8 cTxPwr2G4HT20_BPSK;
|
||||
INT_8 cTxPwr2G4HT20_QPSK;
|
||||
INT_8 cTxPwr2G4HT20_16QAM;
|
||||
INT_8 cTxPwr2G4HT20_MCS5;
|
||||
INT_8 cTxPwr2G4HT20_MCS6;
|
||||
INT_8 cTxPwr2G4HT20_MCS7;
|
||||
|
||||
INT_8 cTxPwr2G4HT40_BPSK;
|
||||
INT_8 cTxPwr2G4HT40_QPSK;
|
||||
INT_8 cTxPwr2G4HT40_16QAM;
|
||||
INT_8 cTxPwr2G4HT40_MCS5;
|
||||
INT_8 cTxPwr2G4HT40_MCS6;
|
||||
INT_8 cTxPwr2G4HT40_MCS7;
|
||||
|
||||
INT_8 cTxPwr5GOFDM_BPSK;
|
||||
INT_8 cTxPwr5GOFDM_QPSK;
|
||||
INT_8 cTxPwr5GOFDM_16QAM;
|
||||
INT_8 cTxPwr5GOFDM_Reserved;
|
||||
INT_8 cTxPwr5GOFDM_48Mbps;
|
||||
INT_8 cTxPwr5GOFDM_54Mbps;
|
||||
|
||||
INT_8 cTxPwr5GHT20_BPSK;
|
||||
INT_8 cTxPwr5GHT20_QPSK;
|
||||
INT_8 cTxPwr5GHT20_16QAM;
|
||||
INT_8 cTxPwr5GHT20_MCS5;
|
||||
INT_8 cTxPwr5GHT20_MCS6;
|
||||
INT_8 cTxPwr5GHT20_MCS7;
|
||||
|
||||
INT_8 cTxPwr5GHT40_BPSK;
|
||||
INT_8 cTxPwr5GHT40_QPSK;
|
||||
INT_8 cTxPwr5GHT40_16QAM;
|
||||
INT_8 cTxPwr5GHT40_MCS5;
|
||||
INT_8 cTxPwr5GHT40_MCS6;
|
||||
INT_8 cTxPwr5GHT40_MCS7;
|
||||
} TX_PWR_PARAM_T, *P_TX_PWR_PARAM_T;
|
||||
|
||||
typedef struct _PWR_5G_OFFSET_T {
|
||||
INT_8 cOffsetBand0; /* 4.915-4.980G */
|
||||
INT_8 cOffsetBand1; /* 5.000-5.080G */
|
||||
INT_8 cOffsetBand2; /* 5.160-5.180G */
|
||||
INT_8 cOffsetBand3; /* 5.200-5.280G */
|
||||
INT_8 cOffsetBand4; /* 5.300-5.340G */
|
||||
INT_8 cOffsetBand5; /* 5.500-5.580G */
|
||||
INT_8 cOffsetBand6; /* 5.600-5.680G */
|
||||
INT_8 cOffsetBand7; /* 5.700-5.825G */
|
||||
} PWR_5G_OFFSET_T, *P_PWR_5G_OFFSET_T;
|
||||
|
||||
typedef struct _PWR_PARAM_T {
|
||||
UINT_32 au4Data[28];
|
||||
UINT_32 u4RefValue1;
|
||||
UINT_32 u4RefValue2;
|
||||
} PWR_PARAM_T, *P_PWR_PARAM_T;
|
||||
|
||||
typedef struct _MT6620_CFG_PARAM_STRUCT {
|
||||
/* 256 bytes of MP data */
|
||||
UINT_16 u2Part1OwnVersion;
|
||||
UINT_16 u2Part1PeerVersion;
|
||||
UINT_8 aucMacAddress[6];
|
||||
UINT_8 aucCountryCode[2];
|
||||
TX_PWR_PARAM_T rTxPwr;
|
||||
UINT_8 aucEFUSE[144];
|
||||
UINT_8 ucTxPwrValid;
|
||||
UINT_8 ucSupport5GBand;
|
||||
UINT_8 fg2G4BandEdgePwrUsed;
|
||||
INT_8 cBandEdgeMaxPwrCCK;
|
||||
INT_8 cBandEdgeMaxPwrOFDM20;
|
||||
INT_8 cBandEdgeMaxPwrOFDM40;
|
||||
|
||||
UINT_8 ucRegChannelListMap;
|
||||
UINT_8 ucRegChannelListIndex;
|
||||
UINT_8 aucRegSubbandInfo[36];
|
||||
|
||||
UINT_8 aucReserved2[256-240];
|
||||
|
||||
/* 256 bytes of function data */
|
||||
UINT_16 u2Part2OwnVersion;
|
||||
UINT_16 u2Part2PeerVersion;
|
||||
UINT_8 uc2G4BwFixed20M;
|
||||
UINT_8 uc5GBwFixed20M;
|
||||
UINT_8 ucEnable5GBand;
|
||||
UINT_8 aucPreTailReserved;
|
||||
UINT_8 aucTailReserved[256-8];
|
||||
} MT6620_CFG_PARAM_STRUCT, *P_MT6620_CFG_PARAM_STRUCT,
|
||||
WIFI_CFG_PARAM_STRUCT, *P_WIFI_CFG_PARAM_STRUCT;
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
#ifndef DATA_STRUC_INSPECTING_ASSERT
|
||||
#define DATA_STRUC_INSPECTING_ASSERT(expr) \
|
||||
switch (0) {case 0: case (expr): default:;}
|
||||
#endif
|
||||
|
||||
#define CFG_FILE_WIFI_REC_SIZE sizeof(WIFI_CFG_PARAM_STRUCT)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#ifndef _lint
|
||||
/* We don't have to call following function to inspect the data structure.
|
||||
* It will check automatically while at compile time.
|
||||
* We'll need this to guarantee the same member order in different structures
|
||||
* to simply handling effort in some functions.
|
||||
*/
|
||||
__KAL_INLINE__ VOID
|
||||
nvramOffsetCheck (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
OFFSET_OF(WIFI_CFG_PARAM_STRUCT, u2Part2OwnVersion) == 256);
|
||||
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
sizeof(WIFI_CFG_PARAM_STRUCT) == 512);
|
||||
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
(OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucEFUSE) & 0x0001) == 0);
|
||||
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
(OFFSET_OF(WIFI_CFG_PARAM_STRUCT, aucRegSubbandInfo) & 0x0001) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _CFG_WIFI_FILE_H */
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,517 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/debug.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file debug.h
|
||||
\brief Definition of SW debugging level.
|
||||
|
||||
In this file, it describes the definition of various SW debugging levels and
|
||||
assert functions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: debug.h $
|
||||
*
|
||||
* 12 16 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* fixed the Windows DDK free build compiling error.
|
||||
*
|
||||
* 11 24 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* Adjust code for DBG and CONFIG_XLOG.
|
||||
*
|
||||
* 11 11 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* modify the xlog related code.
|
||||
*
|
||||
* 11 10 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* Using the new XLOG define for dum Memory.
|
||||
*
|
||||
* 11 03 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* Add dumpMemory8 at XLOG support.
|
||||
*
|
||||
* 11 02 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* adding the code for XLOG.
|
||||
*
|
||||
* 08 31 2011 cm.chang
|
||||
* [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
|
||||
* .
|
||||
*
|
||||
* 01 27 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
|
||||
* add roaming fsm
|
||||
* 1. not support 11r, only use strength of signal to determine roaming.
|
||||
* 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
|
||||
* 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
|
||||
* 4. assume that change of link quality in smooth way.
|
||||
*
|
||||
* 01 07 2011 wh.su
|
||||
* [WCXRP00000326] [MT6620][Wi-Fi][Driver] check in the binary format gl_sec.o.new instead of use change type!!!
|
||||
* .
|
||||
*
|
||||
* 09 23 2010 cp.wu
|
||||
* NULL
|
||||
* add BOW index for debugging message and passing compilation
|
||||
*
|
||||
* 07 20 2010 wh.su
|
||||
*
|
||||
* adding the wapi code.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 21 2010 yarco.yang
|
||||
* [WPD00003837][MT6620]Data Path Refine
|
||||
* Support CFG_MQM_MIGRATION flag
|
||||
*
|
||||
* 06 17 2010 yuche.tsai
|
||||
* [WPD00003839][MT6620 5931][P2P] Feature migration
|
||||
* Add one more debug moduel for P2P.
|
||||
*
|
||||
* 06 14 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add management dispatching function table.
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add bss.c.
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) migrate assoc.c.
|
||||
* 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
|
||||
* 3) add configuration options for CNM_MEM and RSN modules
|
||||
* 4) add data path for management frames
|
||||
* 5) eliminate rPacketInfo of MSDU_INFO_T
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add debug module index for cnm and ais.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 05 17 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* add CFG_STARTUP_DEBUG for debugging starting up issue.
|
||||
*
|
||||
* 04 26 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1) surpress compiler warning
|
||||
* 2) when acqruing LP-own, keep writing WHLPCR whenever OWN is not acquired yet
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-10-29 19:47:50 GMT mtk01084
|
||||
** add emu catagory
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-04-17 18:12:04 GMT mtk01426
|
||||
** Don't use dynamic memory allocate for debug message
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:11:29 GMT mtk01426
|
||||
** Init for develop
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _DEBUG_H
|
||||
#define _DEBUG_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
#ifndef BUILD_QA_DBG
|
||||
#define BUILD_QA_DBG 0
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "gl_typedef.h"
|
||||
#if CFG_SUPPORT_XLOG
|
||||
#include "linux/xlog.h"
|
||||
#endif
|
||||
|
||||
extern UINT_8 aucDebugModule[];
|
||||
extern UINT_32 u4DebugModule;
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Define debug category (class):
|
||||
* (1) ERROR (2) WARN (3) STATE (4) EVENT (5) TRACE (6) INFO (7) LOUD (8) TEMP
|
||||
*/
|
||||
#define DBG_CLASS_ERROR BIT(0)
|
||||
#define DBG_CLASS_WARN BIT(1)
|
||||
#define DBG_CLASS_STATE BIT(2)
|
||||
#define DBG_CLASS_EVENT BIT(3)
|
||||
#define DBG_CLASS_TRACE BIT(4)
|
||||
#define DBG_CLASS_INFO BIT(5)
|
||||
#define DBG_CLASS_LOUD BIT(6)
|
||||
#define DBG_CLASS_TEMP BIT(7)
|
||||
#define DBG_CLASS_MASK BITS(0,7)
|
||||
|
||||
|
||||
#if defined(LINUX)
|
||||
#define DBG_PRINTF_64BIT_DEC "lld"
|
||||
|
||||
#else //Windows
|
||||
#define DBG_PRINTF_64BIT_DEC "I64d"
|
||||
|
||||
#endif
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Define debug module index */
|
||||
typedef enum _ENUM_DBG_MODULE_T {
|
||||
DBG_INIT_IDX = 0, /* For driver initial */
|
||||
DBG_HAL_IDX, /* For HAL(HW) Layer */
|
||||
DBG_INTR_IDX, /* For Interrupt */
|
||||
DBG_REQ_IDX,
|
||||
DBG_TX_IDX,
|
||||
DBG_RX_IDX,
|
||||
DBG_RFTEST_IDX, /* For RF test mode*/
|
||||
DBG_EMU_IDX, /* Developer specific */
|
||||
|
||||
DBG_SW1_IDX, /* Developer specific */
|
||||
DBG_SW2_IDX, /* Developer specific */
|
||||
DBG_SW3_IDX, /* Developer specific */
|
||||
DBG_SW4_IDX, /* Developer specific */
|
||||
|
||||
DBG_HEM_IDX, /* HEM */
|
||||
DBG_AIS_IDX, /* AIS */
|
||||
DBG_RLM_IDX, /* RLM */
|
||||
DBG_MEM_IDX, /* RLM */
|
||||
DBG_CNM_IDX, /* CNM */
|
||||
DBG_RSN_IDX, /* RSN */
|
||||
DBG_BSS_IDX, /* BSS */
|
||||
DBG_SCN_IDX, /* SCN */
|
||||
DBG_SAA_IDX, /* SAA */
|
||||
DBG_AAA_IDX, /* AAA */
|
||||
DBG_P2P_IDX, /* P2P */
|
||||
DBG_QM_IDX, /* QUE_MGT */
|
||||
DBG_SEC_IDX, /* SEC */
|
||||
DBG_BOW_IDX, /* BOW */
|
||||
DBG_WAPI_IDX, /* WAPI */
|
||||
DBG_ROAMING_IDX, /* ROAMING */
|
||||
|
||||
DBG_MODULE_NUM /* Notice the XLOG check */
|
||||
} ENUM_DBG_MODULE_T;
|
||||
|
||||
//XLOG
|
||||
//#define XLOG_DBG_MODULE_IDX 28 /* DBG_MODULE_NUM */
|
||||
//#if (XLOG_DBG_MODULE_IDX != XLOG_DBG_MODULE_IDX)
|
||||
//#error "Please modify the DBG_MODULE_NUM and make sure this include at XLOG"
|
||||
//#endif
|
||||
|
||||
/* Define who owns developer specific index */
|
||||
#define DBG_YARCO_IDX DBG_SW1_IDX
|
||||
#define DBG_KEVIN_IDX DBG_SW2_IDX
|
||||
#define DBG_CMC_IDX DBG_SW3_IDX
|
||||
#define DBG_GEORGE_IDX DBG_SW4_IDX
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Debug print format string for the OS system time */
|
||||
#define OS_SYSTIME_DBG_FORMAT "0x%08x"
|
||||
|
||||
/* Debug print argument for the OS system time */
|
||||
#define OS_SYSTIME_DBG_ARGUMENT(systime) (systime)
|
||||
|
||||
/* Debug print format string for the MAC Address */
|
||||
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
|
||||
|
||||
/* Debug print argument for the MAC Address */
|
||||
#define MAC2STR(a) ((PUINT_8)a)[0], ((PUINT_8)a)[1], ((PUINT_8)a)[2], \
|
||||
((PUINT_8)a)[3], ((PUINT_8)a)[4], ((PUINT_8)a)[5]
|
||||
|
||||
/* The pre-defined format to dump the value of a varaible with its name shown. */
|
||||
#define DUMPVAR(variable, format) (#variable " = " format "\n", variable)
|
||||
|
||||
/* The pre-defined format to dump the MAC type value with its name shown. */
|
||||
#define DUMPMACADDR(addr) (#addr " = " MACSTR "\n", MAC2STR(addr))
|
||||
|
||||
|
||||
/* Basiclly, we just do renaming of KAL functions although they should
|
||||
* be defined as "Nothing to do" if DBG=0. But in some compiler, the macro
|
||||
* syntax does not support #define LOG_FUNC(x,...)
|
||||
*
|
||||
* A caller shall not invoke these three macros when DBG=0.
|
||||
*/
|
||||
#define LOG_FUNC_TIME kalPrint
|
||||
#define LOG_FUNC kalPrint
|
||||
|
||||
#if DBG
|
||||
|
||||
#define TMP_BUF_LEN 256
|
||||
#define TMP_WBUF_LEN (TMP_BUF_LEN * 2)
|
||||
|
||||
extern PINT_16 g_wbuf_p;
|
||||
extern PINT_8 g_buf_p;
|
||||
|
||||
/* If __FUNCTION__ is already defined by compiler, we just use it. */
|
||||
#if defined(__FUNCTION__)
|
||||
#define DEBUGFUNC(_Func)
|
||||
#else
|
||||
#define DEBUGFUNC(_Func) static const char __FUNCTION__[] = _Func;
|
||||
#endif
|
||||
|
||||
/* The following macros are used for future debug message. */
|
||||
/* TODO(Kevin): We should remove INITLOG/ERRORLOG/WARNLOG macro sooner or later */
|
||||
#define INITLOG(_Fmt) \
|
||||
{ \
|
||||
if (aucDebugModule[DBG_INIT_IDX] & DBG_CLASS_TRACE) { \
|
||||
LOG_FUNC("%s: ", __FUNCTION__); \
|
||||
LOG_FUNC _Fmt; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define ERRORLOG(_Fmt) \
|
||||
{ \
|
||||
if (aucDebugModule[DBG_INIT_IDX] & DBG_CLASS_ERROR) { \
|
||||
LOG_FUNC("**Error[%s:%d]-", __FILE__, __LINE__); \
|
||||
LOG_FUNC _Fmt; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define WARNLOG(_Fmt) \
|
||||
{ \
|
||||
if (aucDebugModule[DBG_INIT_IDX] & DBG_CLASS_WARN) { \
|
||||
LOG_FUNC("**Warning[%s:%d]-", __FILE__, __LINE__); \
|
||||
LOG_FUNC _Fmt; \
|
||||
} \
|
||||
}
|
||||
|
||||
/*lint -save -e960 Multiple use of '#/##' */
|
||||
#define DBGLOG(_Module, _Class, _Fmt) \
|
||||
{ \
|
||||
if (aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) { \
|
||||
if (DBG_CLASS_##_Class == DBG_CLASS_ERROR) { \
|
||||
LOG_FUNC_TIME("**Error[%s:%d]-", __FILE__, __LINE__); \
|
||||
LOG_FUNC("%s: (" #_Module " " #_Class ") ", __FUNCTION__); \
|
||||
} \
|
||||
else if (DBG_CLASS_##_Class == DBG_CLASS_WARN) { \
|
||||
LOG_FUNC_TIME("**Warning[%s:%d]-", __FILE__, __LINE__); \
|
||||
LOG_FUNC("%s: (" #_Module " " #_Class ") ", __FUNCTION__); \
|
||||
} \
|
||||
else if (DBG_CLASS_##_Class == DBG_CLASS_EVENT) { \
|
||||
} \
|
||||
else { \
|
||||
LOG_FUNC_TIME("%s: (" #_Module " " #_Class ") ", __FUNCTION__); \
|
||||
} \
|
||||
LOG_FUNC _Fmt; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define DBGLOG_MEM8(_Module, _Class, _StartAddr, _Length) \
|
||||
{ \
|
||||
if (aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) { \
|
||||
LOG_FUNC("%s: (" #_Module " " #_Class ")\n", __FUNCTION__); \
|
||||
dumpMemory8((PUINT_8) (_StartAddr), (UINT_32) (_Length)); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define DBGLOG_MEM32(_Module, _Class, _StartAddr, _Length) \
|
||||
{ \
|
||||
if (aucDebugModule[DBG_##_Module##_IDX] & DBG_CLASS_##_Class) { \
|
||||
LOG_FUNC("%s: (" #_Module " " #_Class ")\n", __FUNCTION__); \
|
||||
dumpMemory32((PUINT_32) (_StartAddr), (UINT_32) (_Length)); \
|
||||
} \
|
||||
}
|
||||
/*lint -restore */
|
||||
|
||||
/*lint -save -e961 use of '#undef' is discouraged */
|
||||
#undef ASSERT
|
||||
/*lint -restore */
|
||||
|
||||
#ifdef _lint
|
||||
#define ASSERT(_exp) \
|
||||
{ \
|
||||
if (!(_exp)) {do {} while (1);} \
|
||||
}
|
||||
#else
|
||||
#define ASSERT(_exp) \
|
||||
{ \
|
||||
if (!(_exp) && !fgIsBusAccessFailed) { \
|
||||
LOG_FUNC("Assertion failed: %s:%d %s\n", __FILE__, __LINE__, #_exp); \
|
||||
kalBreakPoint(); \
|
||||
} \
|
||||
}
|
||||
#endif /* _lint */
|
||||
|
||||
#define ASSERT_REPORT(_exp, _fmt) \
|
||||
{ \
|
||||
if (!(_exp) && !fgIsBusAccessFailed) { \
|
||||
LOG_FUNC("Assertion failed: %s:%d %s\n", __FILE__, __LINE__, #_exp); \
|
||||
LOG_FUNC _fmt; \
|
||||
kalBreakPoint(); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define DISP_STRING(_str) _str
|
||||
|
||||
#else /* !DBG */
|
||||
|
||||
#define DEBUGFUNC(_Func)
|
||||
#define INITLOG(_Fmt)
|
||||
#define ERRORLOG(_Fmt)
|
||||
#define WARNLOG(_Fmt)
|
||||
|
||||
#if defined(LINUX)
|
||||
#define DBGLOG(_Module, _Class, _Fmt) \
|
||||
{ \
|
||||
_Module##_##_Class##_LOGFUNC _Fmt; \
|
||||
}
|
||||
#else
|
||||
#define DBGLOG(_Module, _Class, _Fmt)
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_XLOG
|
||||
#define DBGLOG_MEM8(_Module, _Class, _StartAddr, _Length) \
|
||||
{ \
|
||||
_Module##_##_Class##_LOGFUNC (__FUNCTION__);\
|
||||
_Module##_##_Class##_LOGDUMP8(_StartAddr, _Length); \
|
||||
}
|
||||
#else
|
||||
#define DBGLOG_MEM8(_Module, _Class, _StartAddr, _Length)
|
||||
#endif
|
||||
#define DBGLOG_MEM32(_Module, _Class, _StartAddr, _Length)
|
||||
|
||||
#undef ASSERT
|
||||
|
||||
#if BUILD_QA_DBG
|
||||
#if defined(LINUX) /* For debugging in Linux w/o GDB */
|
||||
#define ASSERT(_exp) \
|
||||
{ \
|
||||
if (!(_exp) && !fgIsBusAccessFailed) { \
|
||||
LOG_FUNC("Assertion failed: %s:%d (%s)\n", __FILE__, __LINE__, #_exp); \
|
||||
kalBreakPoint(); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define ASSERT_REPORT(_exp, _fmt) \
|
||||
{ \
|
||||
if (!(_exp) && !fgIsBusAccessFailed) { \
|
||||
LOG_FUNC("Assertion failed: %s:%d (%s)\n", __FILE__, __LINE__, #_exp); \
|
||||
LOG_FUNC _fmt; \
|
||||
kalBreakPoint(); \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#ifdef WINDOWS_CE
|
||||
#define UNICODE_TEXT(_msg) TEXT(_msg)
|
||||
#define ASSERT(_exp) \
|
||||
{ \
|
||||
if (!(_exp) && !fgIsBusAccessFailed) { \
|
||||
TCHAR rUbuf[256]; \
|
||||
kalBreakPoint(); \
|
||||
_stprintf(rUbuf, TEXT("Assertion failed: %s:%d %s\n"), \
|
||||
UNICODE_TEXT(__FILE__), \
|
||||
__LINE__, \
|
||||
UNICODE_TEXT(#_exp)); \
|
||||
MessageBox(NULL, rUbuf, TEXT("ASSERT!"), MB_OK); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define ASSERT_REPORT(_exp, _fmt) \
|
||||
{ \
|
||||
if (!(_exp) && !fgIsBusAccessFailed) { \
|
||||
TCHAR rUbuf[256]; \
|
||||
kalBreakPoint(); \
|
||||
_stprintf(rUbuf, TEXT("Assertion failed: %s:%d %s\n"), \
|
||||
UNICODE_TEXT(__FILE__), \
|
||||
__LINE__, \
|
||||
UNICODE_TEXT(#_exp)); \
|
||||
MessageBox(NULL, rUbuf, TEXT("ASSERT!"), MB_OK); \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
#define ASSERT(_exp) \
|
||||
{ \
|
||||
if (!(_exp) && !fgIsBusAccessFailed) { \
|
||||
kalBreakPoint(); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define ASSERT_REPORT(_exp, _fmt) \
|
||||
{ \
|
||||
if (!(_exp) && !fgIsBusAccessFailed) { \
|
||||
kalBreakPoint(); \
|
||||
} \
|
||||
}
|
||||
#endif /* WINDOWS_CE */
|
||||
#endif /* LINUX */
|
||||
#else
|
||||
#define ASSERT(_exp)
|
||||
#define ASSERT_REPORT(_exp, _fmt)
|
||||
#endif /* BUILD_QA_DBG */
|
||||
|
||||
#define DISP_STRING(_str) ""
|
||||
|
||||
#endif /* DBG */
|
||||
|
||||
#if CFG_STARTUP_DEBUG
|
||||
#if defined(LINUX)
|
||||
#define DBGPRINTF kalPrint
|
||||
#else
|
||||
#define DBGPRINTF DbgPrint
|
||||
#endif
|
||||
#else
|
||||
#define DBGPRINTF(...)
|
||||
#endif
|
||||
|
||||
|
||||
/* The following macro is used for debugging packed structures. */
|
||||
#ifndef DATA_STRUC_INSPECTING_ASSERT
|
||||
#define DATA_STRUC_INSPECTING_ASSERT(expr) \
|
||||
switch (0) {case 0: case (expr): default:;}
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#if DBG
|
||||
VOID
|
||||
dumpMemory8 (
|
||||
IN PUINT_8 pucStartAddr,
|
||||
IN UINT_32 u4Length
|
||||
);
|
||||
|
||||
VOID
|
||||
dumpMemory32 (
|
||||
IN PUINT_32 pu4StartAddr,
|
||||
IN UINT_32 u4Length
|
||||
);
|
||||
#elif CFG_SUPPORT_XLOG
|
||||
VOID
|
||||
dumpMemory8 (
|
||||
IN UINT_32 log_level,
|
||||
IN PUINT_8 pucStartAddr,
|
||||
IN UINT_32 u4Length
|
||||
);
|
||||
#endif /* DBG */
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#endif /* _DEBUG_H */
|
||||
|
||||
|
|
@ -1,414 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/link.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file link.h
|
||||
\brief Definition for simple doubly linked list operations.
|
||||
|
||||
In this file we define the simple doubly linked list data structure and its
|
||||
operation MACROs and INLINE functions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: link.h $
|
||||
*
|
||||
* 08 05 2010 yuche.tsai
|
||||
* NULL
|
||||
* Modify a MACRO of LINK_FOR_EACH_SAFE for compile error.
|
||||
*
|
||||
* 07 19 2010 cm.chang
|
||||
*
|
||||
* Set RLM parameters and enable CNM channel manager
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration
|
||||
* .
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* May 4 2009 mtk01084
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* add WIFI to BORA source control
|
||||
** \main\maintrunk.MT5921\8 2008-10-16 15:57:11 GMT mtk01461
|
||||
** Update driver to fix lint warning
|
||||
** \main\maintrunk.MT5921\7 2008-08-10 18:47:53 GMT mtk01461
|
||||
** Update for Driver Review
|
||||
** \main\maintrunk.MT5921\6 2007-12-11 00:09:00 GMT mtk01461
|
||||
** Add macro for checking valid list
|
||||
** \main\maintrunk.MT5921\5 2007-11-13 14:27:01 GMT mtk01461
|
||||
** Add LINK_IS_INVALID macro
|
||||
** Revision 1.1.1.1 2007/06/22 08:09:05 MTK01461
|
||||
** no message
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _LINK_H
|
||||
#define _LINK_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "gl_typedef.h"
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define INVALID_LINK_POISON1 ((VOID *) 0x00100101) // May cause page fault & unalignment issue (data abort)
|
||||
#define INVALID_LINK_POISON2 ((VOID *) 0x00100201) // Used to verify that nonbody uses non-initialized link entries.
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Simple Doubly Linked List Structures - Entry Part */
|
||||
typedef struct _LINK_ENTRY_T {
|
||||
struct _LINK_ENTRY_T *prNext, *prPrev;
|
||||
} LINK_ENTRY_T, *P_LINK_ENTRY_T;
|
||||
|
||||
/* Simple Doubly Linked List Structures - List Part */
|
||||
typedef struct _LINK_T {
|
||||
P_LINK_ENTRY_T prNext;
|
||||
P_LINK_ENTRY_T prPrev;
|
||||
UINT_32 u4NumElem;
|
||||
} LINK_T, *P_LINK_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
#if 0 // No one use it, temporarily mark it for [Lint - Info 773]
|
||||
#define LINK_ADDR(rLink) { (P_LINK_ENTRY_T)(&(rLink)), (P_LINK_ENTRY_T)(&(rLink)), 0 }
|
||||
|
||||
#define LINK_DECLARATION(rLink) \
|
||||
struct _LINK_T rLink = LINK_ADDR(rLink)
|
||||
#endif
|
||||
|
||||
#define LINK_INITIALIZE(prLink) \
|
||||
do { \
|
||||
((P_LINK_T)(prLink))->prNext = (P_LINK_ENTRY_T)(prLink); \
|
||||
((P_LINK_T)(prLink))->prPrev = (P_LINK_ENTRY_T)(prLink); \
|
||||
((P_LINK_T)(prLink))->u4NumElem = 0; \
|
||||
} while (0)
|
||||
|
||||
#define LINK_ENTRY_INITIALIZE(prEntry) \
|
||||
do { \
|
||||
((P_LINK_ENTRY_T)(prEntry))->prNext = (P_LINK_ENTRY_T)NULL; \
|
||||
((P_LINK_ENTRY_T)(prEntry))->prPrev = (P_LINK_ENTRY_T)NULL; \
|
||||
} while (0)
|
||||
|
||||
#define LINK_ENTRY_INVALID(prEntry) \
|
||||
do { \
|
||||
((P_LINK_ENTRY_T)(prEntry))->prNext = (P_LINK_ENTRY_T)INVALID_LINK_POISON1; \
|
||||
((P_LINK_ENTRY_T)(prEntry))->prPrev = (P_LINK_ENTRY_T)INVALID_LINK_POISON2; \
|
||||
} while (0)
|
||||
|
||||
#define LINK_IS_EMPTY(prLink) (((P_LINK_T)(prLink))->prNext == (P_LINK_ENTRY_T)(prLink))
|
||||
|
||||
/* NOTE: We should do memory zero before any LINK been initiated, so we can check
|
||||
* if it is valid before parsing the LINK.
|
||||
*/
|
||||
#define LINK_IS_INVALID(prLink) (((P_LINK_T)(prLink))->prNext == (P_LINK_ENTRY_T)NULL)
|
||||
|
||||
#define LINK_IS_VALID(prLink) (((P_LINK_T)(prLink))->prNext != (P_LINK_ENTRY_T)NULL)
|
||||
|
||||
|
||||
#define LINK_ENTRY(ptr, type, member) ENTRY_OF(ptr, type, member)
|
||||
|
||||
/* Insert an entry into a link list's head */
|
||||
#define LINK_INSERT_HEAD(prLink, prEntry) \
|
||||
{ \
|
||||
linkAdd(prEntry, prLink); \
|
||||
((prLink)->u4NumElem)++; \
|
||||
}
|
||||
|
||||
|
||||
/* Append an entry into a link list's tail */
|
||||
#define LINK_INSERT_TAIL(prLink, prEntry) \
|
||||
{ \
|
||||
linkAddTail(prEntry, prLink); \
|
||||
((prLink)->u4NumElem)++; \
|
||||
}
|
||||
|
||||
/* Peek head entry, but keep still in link list */
|
||||
#define LINK_PEEK_HEAD(prLink, _type, _member) \
|
||||
( \
|
||||
LINK_IS_EMPTY(prLink) ? \
|
||||
NULL : LINK_ENTRY((prLink)->prNext, _type, _member) \
|
||||
)
|
||||
|
||||
/* Peek tail entry, but keep still in link list */
|
||||
#define LINK_PEEK_TAIL(prLink, _type, _member) \
|
||||
( \
|
||||
LINK_IS_EMPTY(prLink) ? \
|
||||
NULL : LINK_ENTRY((prLink)->prPrev, _type, _member) \
|
||||
)
|
||||
|
||||
/* Get first entry from a link list */
|
||||
/* NOTE: We assume the link entry located at the beginning of "prEntry Type",
|
||||
* so that we can cast the link entry to other data type without doubts.
|
||||
* And this macro also decrease the total entry count at the same time.
|
||||
*/
|
||||
#define LINK_REMOVE_HEAD(prLink, prEntry, _P_TYPE) \
|
||||
{ \
|
||||
ASSERT(prLink); \
|
||||
if (LINK_IS_EMPTY(prLink)) { \
|
||||
prEntry = (_P_TYPE)NULL; \
|
||||
} \
|
||||
else { \
|
||||
prEntry = (_P_TYPE)(((P_LINK_T)(prLink))->prNext); \
|
||||
linkDel((P_LINK_ENTRY_T)prEntry); \
|
||||
((prLink)->u4NumElem)--; \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Assume the link entry located at the beginning of prEntry Type.
|
||||
* And also decrease the total entry count.
|
||||
*/
|
||||
#define LINK_REMOVE_KNOWN_ENTRY(prLink, prEntry) \
|
||||
{ \
|
||||
ASSERT(prLink); \
|
||||
ASSERT(prEntry); \
|
||||
linkDel((P_LINK_ENTRY_T)prEntry); \
|
||||
((prLink)->u4NumElem)--; \
|
||||
}
|
||||
|
||||
/* Iterate over a link list */
|
||||
#define LINK_FOR_EACH(prEntry, prLink) \
|
||||
for (prEntry = (prLink)->prNext; \
|
||||
prEntry != (P_LINK_ENTRY_T)(prLink); \
|
||||
prEntry = (P_LINK_ENTRY_T)prEntry->prNext)
|
||||
|
||||
/* Iterate over a link list backwards */
|
||||
#define LINK_FOR_EACH_PREV(prEntry, prLink) \
|
||||
for (prEntry = (prLink)->prPrev; \
|
||||
prEntry != (P_LINK_ENTRY_T)(prLink); \
|
||||
prEntry = (P_LINK_ENTRY_T)prEntry->prPrev)
|
||||
|
||||
/* Iterate over a link list safe against removal of link entry */
|
||||
#define LINK_FOR_EACH_SAFE(prEntry, prNextEntry, prLink) \
|
||||
for (prEntry = (prLink)->prNext, prNextEntry = prEntry->prNext; \
|
||||
prEntry != (P_LINK_ENTRY_T)(prLink); \
|
||||
prEntry = prNextEntry, prNextEntry = prEntry->prNext)
|
||||
|
||||
/* Iterate over a link list of given type */
|
||||
#define LINK_FOR_EACH_ENTRY(prObj, prLink, rMember, _TYPE) \
|
||||
for (prObj = LINK_ENTRY((prLink)->prNext, _TYPE, rMember); \
|
||||
&prObj->rMember != (P_LINK_ENTRY_T)(prLink); \
|
||||
prObj = LINK_ENTRY(prObj->rMember.prNext, _TYPE, rMember))
|
||||
|
||||
/* Iterate backwards over a link list of given type */
|
||||
#define LINK_FOR_EACH_ENTRY_PREV(prObj, prLink, rMember, _TYPE) \
|
||||
for (prObj = LINK_ENTRY((prLink)->prPrev, _TYPE, rMember); \
|
||||
&prObj->rMember != (P_LINK_ENTRY_T)(prLink); \
|
||||
prObj = LINK_ENTRY(prObj->rMember.prPrev, _TYPE, rMember))
|
||||
|
||||
/* Iterate over a link list of given type safe against removal of link entry */
|
||||
#define LINK_FOR_EACH_ENTRY_SAFE(prObj, prNextObj, prLink, rMember, _TYPE) \
|
||||
for (prObj = LINK_ENTRY((prLink)->prNext, _TYPE, rMember), \
|
||||
prNextObj = LINK_ENTRY(prObj->rMember.prNext, _TYPE, rMember); \
|
||||
&prObj->rMember != (P_LINK_ENTRY_T)(prLink); \
|
||||
prObj = prNextObj, \
|
||||
prNextObj = LINK_ENTRY(prNextObj->rMember.prNext, _TYPE, rMember))
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This function is only for internal link list manipulation.
|
||||
*
|
||||
* \param[in] prNew Pointer of new link head
|
||||
* \param[in] prPrev Pointer of previous link head
|
||||
* \param[in] prNext Pointer of next link head
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
__KAL_INLINE__ VOID
|
||||
__linkAdd (
|
||||
IN P_LINK_ENTRY_T prNew,
|
||||
IN P_LINK_ENTRY_T prPrev,
|
||||
IN P_LINK_ENTRY_T prNext
|
||||
)
|
||||
{
|
||||
prNext->prPrev = prNew;
|
||||
prNew->prNext = prNext;
|
||||
prNew->prPrev = prPrev;
|
||||
prPrev->prNext = prNew;
|
||||
|
||||
return;
|
||||
} /* end of __linkAdd() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This function will add a new entry after the specified link head.
|
||||
*
|
||||
* \param[in] prNew New entry to be added
|
||||
* \param[in] prHead Specified link head to add it after
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
__KAL_INLINE__ VOID
|
||||
linkAdd (
|
||||
IN P_LINK_ENTRY_T prNew,
|
||||
IN P_LINK_T prLink
|
||||
)
|
||||
{
|
||||
__linkAdd(prNew, (P_LINK_ENTRY_T)prLink, prLink->prNext);
|
||||
|
||||
return;
|
||||
} /* end of linkAdd() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This function will add a new entry before the specified link head.
|
||||
*
|
||||
* \param[in] prNew New entry to be added
|
||||
* \param[in] prHead Specified link head to add it before
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
__KAL_INLINE__ VOID
|
||||
linkAddTail (
|
||||
IN P_LINK_ENTRY_T prNew,
|
||||
IN P_LINK_T prLink
|
||||
)
|
||||
{
|
||||
__linkAdd(prNew, prLink->prPrev, (P_LINK_ENTRY_T)prLink);
|
||||
|
||||
return;
|
||||
} /* end of linkAddTail() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This function is only for internal link list manipulation.
|
||||
*
|
||||
* \param[in] prPrev Pointer of previous link head
|
||||
* \param[in] prNext Pointer of next link head
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
__KAL_INLINE__ VOID
|
||||
__linkDel (
|
||||
IN P_LINK_ENTRY_T prPrev,
|
||||
IN P_LINK_ENTRY_T prNext
|
||||
)
|
||||
{
|
||||
prNext->prPrev = prPrev;
|
||||
prPrev->prNext = prNext;
|
||||
|
||||
return;
|
||||
} /* end of __linkDel() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This function will delete a specified entry from link list.
|
||||
* NOTE: the entry is in an initial state.
|
||||
*
|
||||
* \param prEntry Specified link head(entry)
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
__KAL_INLINE__ VOID
|
||||
linkDel (
|
||||
IN P_LINK_ENTRY_T prEntry
|
||||
)
|
||||
{
|
||||
__linkDel(prEntry->prPrev, prEntry->prNext);
|
||||
|
||||
LINK_ENTRY_INITIALIZE(prEntry);
|
||||
|
||||
return;
|
||||
} /* end of linkDel() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This function will delete a specified entry from link list and then add it
|
||||
* after the specified link head.
|
||||
*
|
||||
* \param[in] prEntry Specified link head(entry)
|
||||
* \param[in] prOtherHead Another link head to add it after
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
__KAL_INLINE__ VOID
|
||||
linkMove (
|
||||
IN P_LINK_ENTRY_T prEntry,
|
||||
IN P_LINK_T prLink
|
||||
)
|
||||
{
|
||||
__linkDel(prEntry->prPrev, prEntry->prNext);
|
||||
linkAdd(prEntry, prLink);
|
||||
|
||||
return;
|
||||
} /* end of linkMove() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This function will delete a specified entry from link list and then add it
|
||||
* before the specified link head.
|
||||
*
|
||||
* \param[in] prEntry Specified link head(entry)
|
||||
* \param[in] prOtherHead Another link head to add it before
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
__KAL_INLINE__ VOID
|
||||
linkMoveTail (
|
||||
IN P_LINK_ENTRY_T prEntry,
|
||||
IN P_LINK_T prLink
|
||||
)
|
||||
{
|
||||
__linkDel(prEntry->prPrev, prEntry->prNext);
|
||||
linkAddTail(prEntry, prLink);
|
||||
|
||||
return;
|
||||
} /* end of linkMoveTail() */
|
||||
|
||||
#endif /* _LINK_H */
|
||||
|
||||
|
|
@ -1,251 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/aa_fsm.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file aa_fsm.h
|
||||
\brief Declaration of functions and finite state machine for SAA/AAA Module.
|
||||
|
||||
Declaration of functions and finite state machine for SAA/AAA Module.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: aa_fsm.h $
|
||||
*
|
||||
* 10 13 2011 cp.wu
|
||||
* [MT6620 Wi-Fi][Driver] Reduce join failure count limit to 2 for faster re-join for other BSS
|
||||
* 1. short join failure count limit to 2
|
||||
* 2. treat join timeout as kind of join failure as well
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 21 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* refine TX-DONE callback.
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) migrate assoc.c.
|
||||
* 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
|
||||
* 3) add configuration options for CNM_MEM and RSN modules
|
||||
* 4) add data path for management frames
|
||||
* 5) eliminate rPacketInfo of MSDU_INFO_T
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add buildable & linkable ais_fsm.c
|
||||
*
|
||||
* related reference are still waiting to be resolved
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
|
||||
*
|
||||
* 03 10 2010 kevin.huang
|
||||
* [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
|
||||
*
|
||||
* Add Channel Manager for arbitration of JOIN and SCAN Req
|
||||
*
|
||||
* 02 04 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
|
||||
*
|
||||
* 01 11 2010 kevin.huang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Add Deauth and Disassoc Handler
|
||||
*
|
||||
* Nov 24 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Revise MGMT Handler with Retain Status
|
||||
*
|
||||
* Nov 23 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AA_FSM_H
|
||||
#define _AA_FSM_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Retry interval for retransmiting authentication-request MMPDU. */
|
||||
#define TX_AUTHENTICATION_RETRY_TIMEOUT_TU 100 // TU.
|
||||
|
||||
/* Retry interval for retransmiting association-request MMPDU. */
|
||||
#define TX_ASSOCIATION_RETRY_TIMEOUT_TU 100 // TU.
|
||||
|
||||
/* Wait for a response to a transmitted authentication-request MMPDU. */
|
||||
#define DOT11_AUTHENTICATION_RESPONSE_TIMEOUT_TU 512 // TU.
|
||||
|
||||
/* Wait for a response to a transmitted association-request MMPDU. */
|
||||
#define DOT11_ASSOCIATION_RESPONSE_TIMEOUT_TU 512 // TU.
|
||||
|
||||
/* The maximum time to wait for JOIN process complete. */
|
||||
#define JOIN_FAILURE_TIMEOUT_BEACON_INTERVAL 20 // Beacon Interval, 20 * 100TU = 2 sec.
|
||||
|
||||
/* Retry interval for next JOIN request. */
|
||||
#define JOIN_RETRY_INTERVAL_SEC 10 // Seconds
|
||||
|
||||
/* Maximum Retry Count for accept a JOIN request. */
|
||||
#define JOIN_MAX_RETRY_FAILURE_COUNT 2 // Times
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
typedef enum _ENUM_AA_STATE_T {
|
||||
AA_STATE_IDLE = 0,
|
||||
SAA_STATE_SEND_AUTH1,
|
||||
SAA_STATE_WAIT_AUTH2,
|
||||
SAA_STATE_SEND_AUTH3,
|
||||
SAA_STATE_WAIT_AUTH4,
|
||||
SAA_STATE_SEND_ASSOC1,
|
||||
SAA_STATE_WAIT_ASSOC2,
|
||||
AAA_STATE_SEND_AUTH2,
|
||||
AAA_STATE_SEND_AUTH4, // We may not use, because P2P GO didn't support WEP and 11r
|
||||
AAA_STATE_SEND_ASSOC2,
|
||||
AA_STATE_RESOURCE, // A state for debugging the case of out of msg buffer.
|
||||
AA_STATE_NUM
|
||||
} ENUM_AA_STATE_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines in saa_fsm.c */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
saaFsmSteps (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN ENUM_AA_STATE_T eNextState,
|
||||
IN P_SW_RFB_T prRetainedSwRfb
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
saaFsmSendEventJoinComplete (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
WLAN_STATUS rJoinStatus,
|
||||
P_STA_RECORD_T prStaRec,
|
||||
P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
saaFsmRunEventStart (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
saaFsmRunEventTxDone (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN ENUM_TX_RESULT_CODE_T rTxDoneStatus
|
||||
);
|
||||
|
||||
VOID
|
||||
saaFsmRunEventTxReqTimeOut (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
saaFsmRunEventRxRespTimeOut (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
saaFsmRunEventRxAuth (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
saaFsmRunEventRxAssoc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
saaFsmRunEventRxDeauth (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
saaFsmRunEventRxDisassoc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
saaFsmRunEventAbort (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines in aaa_fsm.c */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
aaaFsmRunEventRxAuth (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
aaaFsmRunEventRxAssoc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
aaaFsmRunEventTxDone (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN ENUM_TX_RESULT_CODE_T rTxDoneStatus
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _AA_FSM_H */
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,692 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/ais_fsm.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file ais_fsm.h
|
||||
\brief Declaration of functions and finite state machine for AIS Module.
|
||||
|
||||
Declaration of functions and finite state machine for AIS Module.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: ais_fsm.h $
|
||||
*
|
||||
* 11 22 2011 cp.wu
|
||||
* [WCXRP00001120] [MT6620 Wi-Fi][Driver] Modify roaming to AIS state transition from synchronous to asynchronous approach to avoid incomplete state termination
|
||||
* 1. change RDD related compile option brace position.
|
||||
* 2. when roaming is triggered, ask AIS to transit immediately only when AIS is in Normal TR state without join timeout timer ticking
|
||||
* 3. otherwise, insert AIS_REQUEST into pending request queue
|
||||
*
|
||||
* 04 25 2011 cp.wu
|
||||
* [WCXRP00000676] [MT6620 Wi-Fi][Driver] AIS to reduce request channel period from 5 seconds to 2 seconds
|
||||
* channel interval for joining is shortened to 2 seconds to avoid interruption of concurrent operating network.
|
||||
*
|
||||
* 02 26 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000391] [MT6620 Wi-Fi][FW] Add Roaming Support
|
||||
* not send disassoc or deauth to leaving AP so as to improve performace of roaming.
|
||||
*
|
||||
* 02 22 2011 cp.wu
|
||||
* [WCXRP00000487] [MT6620 Wi-Fi][Driver][AIS] Serve scan and connect request with a queue-based approach to improve response time for scanning request
|
||||
* handle SCAN and RECONNECT with a FIFO approach.
|
||||
*
|
||||
* 01 27 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
|
||||
* add roaming fsm
|
||||
* 1. not support 11r, only use strength of signal to determine roaming.
|
||||
* 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
|
||||
* 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
|
||||
* 4. assume that change of link quality in smooth way.
|
||||
*
|
||||
* 01 14 2011 cp.wu
|
||||
* [WCXRP00000359] [MT6620 Wi-Fi][Driver] add an extra state to ensure DEAUTH frame is always sent
|
||||
* Add an extra state to guarantee DEAUTH frame is sent then connect to new BSS.
|
||||
* This change is due to WAPI AP needs DEAUTH frame as a necessary step in handshaking protocol.
|
||||
*
|
||||
* 11 25 2010 cp.wu
|
||||
* [WCXRP00000208] [MT6620 Wi-Fi][Driver] Add scanning with specified SSID to AIS FSM
|
||||
* add scanning with specified SSID facility to AIS-FSM
|
||||
*
|
||||
* 11 01 2010 cp.wu
|
||||
* [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module
|
||||
* 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead
|
||||
* 2) Remove CNM CH-RECOVER event handling
|
||||
* 3) cfg read/write API renamed with kal prefix for unified naming rules.
|
||||
*
|
||||
* 09 06 2010 cp.wu
|
||||
* NULL
|
||||
* 1) initialize for correct parameter even for disassociation.
|
||||
* 2) AIS-FSM should have a limit on trials to build connection
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 08 25 2010 cp.wu
|
||||
* NULL
|
||||
* [AIS-FSM] IBSS no longer needs to acquire channel for beaconing, RLM/CNM will handle the channel switching when BSS information is updated
|
||||
*
|
||||
* 08 12 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine bssProcessProbeRequest() and bssSendBeaconProbeResponse()
|
||||
*
|
||||
* 08 12 2010 cp.wu
|
||||
* NULL
|
||||
* [AIS-FSM] honor registry setting for adhoc running mode. (A/B/G)
|
||||
*
|
||||
* 08 03 2010 cp.wu
|
||||
* NULL
|
||||
* surpress compilation warning.
|
||||
*
|
||||
* 07 30 2010 cp.wu
|
||||
* NULL
|
||||
* 1) BoW wrapper: use definitions instead of hard-coded constant for error code
|
||||
* 2) AIS-FSM: eliminate use of desired RF parameters, use prTargetBssDesc instead
|
||||
* 3) add handling for RX_PKT_DESTINATION_HOST_WITH_FORWARD for GO-broadcast frames
|
||||
*
|
||||
* 07 26 2010 cp.wu
|
||||
*
|
||||
* AIS-FSM: when scan request is coming in the 1st 5 seconds of channel privilege period, just pend it til 5-sec. period finishes
|
||||
*
|
||||
* 07 26 2010 cp.wu
|
||||
*
|
||||
* AIS-FSM FIX: return channel privilege even when the privilege is not granted yet
|
||||
* QM: qmGetFrameAction() won't assert when corresponding STA-REC index is not found
|
||||
*
|
||||
* 07 23 2010 cp.wu
|
||||
*
|
||||
* add AIS-FSM handling for beacon timeout event.
|
||||
*
|
||||
* 07 21 2010 cp.wu
|
||||
*
|
||||
* separate AIS-FSM states into different cases of channel request.
|
||||
*
|
||||
* 07 21 2010 cp.wu
|
||||
*
|
||||
* 1) change BG_SCAN to ONLINE_SCAN for consistent term
|
||||
* 2) only clear scanning result when scan is permitted to do
|
||||
*
|
||||
* 07 19 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration.
|
||||
* Add Ad-Hoc support to AIS-FSM
|
||||
*
|
||||
* 07 14 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration.
|
||||
* Refine AIS-FSM by divided into more states
|
||||
*
|
||||
* 07 09 2010 cp.wu
|
||||
*
|
||||
* 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection)
|
||||
* 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass
|
||||
* 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by returning BUSY
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 01 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* AIS-FSM integration with CNM channel request messages
|
||||
*
|
||||
* 07 01 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* implementation of DRV-SCN and related mailbox message handling.
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add buildable & linkable ais_fsm.c
|
||||
*
|
||||
* related reference are still waiting to be resolved
|
||||
*
|
||||
* 06 09 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add definitions for module migration.
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
|
||||
*
|
||||
* 05 12 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Add Power Management - Legacy PS-POLL support.
|
||||
*
|
||||
* 04 23 2010 wh.su
|
||||
* [BORA00000605][WIFISYS] Phase3 Integration
|
||||
* reduce the backgroud ssid idle time min and max value
|
||||
*
|
||||
* 04 19 2010 kevin.huang
|
||||
* [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support
|
||||
* Add Beacon Timeout Support
|
||||
* * and will send Null frame to diagnose connection
|
||||
*
|
||||
* 03 16 2010 kevin.huang
|
||||
* [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
|
||||
* Add AdHoc Mode
|
||||
*
|
||||
* 03 10 2010 kevin.huang
|
||||
* [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
|
||||
*
|
||||
* * Add Channel Manager for arbitration of JOIN and SCAN Req
|
||||
*
|
||||
* 02 26 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Remove CFG_TEST_VIRTUAL_CMD and add support of Driver STA_RECORD_T activation
|
||||
*
|
||||
* 02 23 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Support dynamic channel selection
|
||||
*
|
||||
* 02 04 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
|
||||
*
|
||||
* 01 11 2010 kevin.huang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Add Deauth and Disassoc Handler
|
||||
*
|
||||
* 01 07 2010 kevin.huang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add Media disconnect indication and related postpone functions
|
||||
*
|
||||
* Dec 3 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add aisFsmRunEventJoinComplete()
|
||||
*
|
||||
* Nov 25 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add Virtual CMD & RESP for testing CMD PATH
|
||||
*
|
||||
* Nov 23 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* add aisFsmInitializeConnectionSettings()
|
||||
*
|
||||
* Nov 20 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add CFG_TEST_MGMT_FSM for aisFsmTest()
|
||||
*
|
||||
* Nov 18 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add function prototype of aisFsmInit()
|
||||
*
|
||||
* Nov 16 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _AIS_FSM_H
|
||||
#define _AIS_FSM_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define AIS_BG_SCAN_INTERVAL_MIN_SEC 2 //30 // exponential to 960
|
||||
#define AIS_BG_SCAN_INTERVAL_MAX_SEC 2 //960 // 16min
|
||||
|
||||
#define AIS_DELAY_TIME_OF_DISCONNECT_SEC 10
|
||||
|
||||
#define AIS_IBSS_ALONE_TIMEOUT_SEC 20 // seconds
|
||||
|
||||
#define AIS_BEACON_TIMEOUT_COUNT_ADHOC 30
|
||||
#define AIS_BEACON_TIMEOUT_COUNT_INFRA 10
|
||||
#define AIS_BEACON_TIMEOUT_GUARD_TIME_SEC 1 /* Second */
|
||||
|
||||
#define AIS_BEACON_MAX_TIMEOUT_TU 100
|
||||
#define AIS_BEACON_MIN_TIMEOUT_TU 5
|
||||
#define AIS_BEACON_MAX_TIMEOUT_VALID TRUE
|
||||
#define AIS_BEACON_MIN_TIMEOUT_VALID TRUE
|
||||
|
||||
#define AIS_BMC_MAX_TIMEOUT_TU 100
|
||||
#define AIS_BMC_MIN_TIMEOUT_TU 5
|
||||
#define AIS_BMC_MAX_TIMEOUT_VALID TRUE
|
||||
#define AIS_BMC_MIN_TIMEOUT_VALID TRUE
|
||||
|
||||
#define AIS_JOIN_CH_GRANT_THRESHOLD 10
|
||||
#define AIS_JOIN_CH_REQUEST_INTERVAL 2000
|
||||
|
||||
#define AIS_SCN_DONE_TIMEOUT_SEC 5
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
typedef enum _ENUM_AIS_STATE_T {
|
||||
AIS_STATE_IDLE = 0,
|
||||
AIS_STATE_SEARCH,
|
||||
AIS_STATE_SCAN,
|
||||
AIS_STATE_ONLINE_SCAN,
|
||||
AIS_STATE_LOOKING_FOR,
|
||||
AIS_STATE_WAIT_FOR_NEXT_SCAN,
|
||||
AIS_STATE_REQ_CHANNEL_JOIN,
|
||||
AIS_STATE_JOIN,
|
||||
AIS_STATE_IBSS_ALONE,
|
||||
AIS_STATE_IBSS_MERGE,
|
||||
AIS_STATE_NORMAL_TR,
|
||||
AIS_STATE_DISCONNECTING,
|
||||
AIS_STATE_NUM
|
||||
} ENUM_AIS_STATE_T;
|
||||
|
||||
|
||||
typedef struct _MSG_AIS_ABORT_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucReasonOfDisconnect;
|
||||
BOOLEAN fgDelayIndication;
|
||||
} MSG_AIS_ABORT_T, *P_MSG_AIS_ABORT_T;
|
||||
|
||||
|
||||
typedef struct _MSG_AIS_IBSS_PEER_FOUND_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucNetTypeIndex;
|
||||
BOOLEAN fgIsMergeIn; /* TRUE: Merge In, FALSE: Merge Out */
|
||||
P_STA_RECORD_T prStaRec;
|
||||
} MSG_AIS_IBSS_PEER_FOUND_T, *P_MSG_AIS_IBSS_PEER_FOUND_T;
|
||||
|
||||
typedef enum _ENUM_AIS_REQUEST_TYPE_T {
|
||||
AIS_REQUEST_SCAN,
|
||||
AIS_REQUEST_RECONNECT,
|
||||
AIS_REQUEST_ROAMING_SEARCH,
|
||||
AIS_REQUEST_ROAMING_CONNECT,
|
||||
AIS_REQUEST_NUM
|
||||
} ENUM_AIS_REQUEST_TYPE_T;
|
||||
|
||||
typedef struct _AIS_REQ_HDR_T {
|
||||
LINK_ENTRY_T rLinkEntry;
|
||||
ENUM_AIS_REQUEST_TYPE_T eReqType;
|
||||
} AIS_REQ_HDR_T, *P_AIS_REQ_HDR_T;
|
||||
|
||||
|
||||
typedef struct _AIS_FSM_INFO_T {
|
||||
ENUM_AIS_STATE_T ePreviousState;
|
||||
ENUM_AIS_STATE_T eCurrentState;
|
||||
|
||||
BOOLEAN fgTryScan;
|
||||
|
||||
BOOLEAN fgIsInfraChannelFinished;
|
||||
BOOLEAN fgIsChannelRequested;
|
||||
BOOLEAN fgIsChannelGranted;
|
||||
|
||||
#if CFG_SUPPORT_ROAMING
|
||||
BOOLEAN fgIsRoamingScanPending;
|
||||
#endif /* CFG_SUPPORT_ROAMING */
|
||||
|
||||
UINT_8 ucAvailableAuthTypes; /* Used for AUTH_MODE_AUTO_SWITCH */
|
||||
|
||||
P_BSS_DESC_T prTargetBssDesc; /* For destination */
|
||||
|
||||
P_STA_RECORD_T prTargetStaRec; /* For JOIN Abort */
|
||||
|
||||
UINT_32 u4SleepInterval;
|
||||
|
||||
TIMER_T rBGScanTimer;
|
||||
|
||||
TIMER_T rIbssAloneTimer;
|
||||
|
||||
TIMER_T rIndicationOfDisconnectTimer;
|
||||
|
||||
TIMER_T rJoinTimeoutTimer;
|
||||
|
||||
|
||||
TIMER_T rScanDoneTimer;
|
||||
|
||||
UINT_8 ucSeqNumOfReqMsg;
|
||||
UINT_8 ucSeqNumOfChReq;
|
||||
UINT_8 ucSeqNumOfScanReq;
|
||||
|
||||
UINT_32 u4ChGrantedInterval;
|
||||
|
||||
UINT_8 ucConnTrialCount;
|
||||
|
||||
UINT_8 ucScanSSIDLen;
|
||||
UINT_8 aucScanSSID[ELEM_MAX_LEN_SSID];
|
||||
|
||||
UINT_32 u4ScanIELength;
|
||||
UINT_8 aucScanIEBuf[MAX_IE_LENGTH];
|
||||
|
||||
/* Pending Request List */
|
||||
LINK_T rPendingReqList;
|
||||
|
||||
} AIS_FSM_INFO_T, *P_AIS_FSM_INFO_T;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define aisChangeMediaState(_prAdapter, _eNewMediaState) \
|
||||
(_prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX].eConnectionState = (_eNewMediaState));
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
VOID
|
||||
aisInitializeConnectionSettings (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_REG_INFO_T prRegInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmInit (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmUninit (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmStateInit_JOIN (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
aisFsmStateInit_RetryJOIN (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmStateInit_IBSS_ALONE (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmStateInit_IBSS_MERGE (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmStateAbort (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_8 ucReasonOfDisconnect,
|
||||
BOOLEAN fgDelayIndication
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmStateAbort_JOIN (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmStateAbort_SCAN (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmStateAbort_NORMAL_TR (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmStateAbort_IBSS (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmSteps (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
ENUM_AIS_STATE_T eNextState
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Mailbox Message Handling */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
aisFsmRunEventScanDone (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmRunEventAbort (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmRunEventJoinComplete (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmRunEventFoundIBSSPeer (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Handling for Ad-Hoc Network */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
aisFsmCreateIBSS (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmMergeIBSS (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Handling of Incoming Mailbox Message from CNM */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
aisFsmRunEventChGrant (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Generating Outgoing Mailbox Message to CNM */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
aisFsmReleaseCh (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Event Indication */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
aisIndicationOfMediaStateToHost (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
ENUM_PARAM_MEDIA_STATE_T eConnectionState,
|
||||
BOOLEAN fgDelayIndication
|
||||
);
|
||||
|
||||
VOID
|
||||
aisPostponedEventOfDisconnTimeout (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_32 u4Param
|
||||
);
|
||||
|
||||
VOID
|
||||
aisUpdateBssInfoForJOIN (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
P_STA_RECORD_T prStaRec,
|
||||
P_SW_RFB_T prAssocRspSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
aisUpdateBssInfoForCreateIBSS (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
aisUpdateBssInfoForMergeIBSS (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
aisValidateProbeReq (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
OUT PUINT_32 pu4ControlFlags
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Disconnection Handling */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
aisFsmDisconnect (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgDelayIndication
|
||||
);
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Event Handling */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
aisBssBeaconTimeout (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
aisDeauthXmitComplete (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN ENUM_TX_RESULT_CODE_T rTxDoneStatus
|
||||
);
|
||||
|
||||
#if CFG_SUPPORT_ROAMING
|
||||
VOID
|
||||
aisFsmRunEventRoamingDiscovery (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_32 u4ReqScan
|
||||
);
|
||||
|
||||
ENUM_AIS_STATE_T
|
||||
aisFsmRoamingScanResultsUpdate (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmRoamingDisconnectPrevAP (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prTargetStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
aisUpdateBssInfoForRoamingAP (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN P_SW_RFB_T prAssocRspSwRfb
|
||||
);
|
||||
#endif /*CFG_SUPPORT_ROAMING */
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Timeout Handling */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
aisFsmRunEventBGSleepTimeOut (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_32 u4Param
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmRunEventIbssAloneTimeOut (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_32 u4Param
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmRunEventJoinTimeout (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_32 u4Param
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmRunEventScanDoneTimeOut (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_32 u4Param
|
||||
);
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* OID/IOCTL Handling */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
aisFsmScanRequest (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_PARAM_SSID_T prSsid,
|
||||
IN PUINT_8 pucIe,
|
||||
IN UINT_32 u4IeLength
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Internal State Checking */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
aisFsmIsRequestPending (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_AIS_REQUEST_TYPE_T eReqType,
|
||||
IN BOOLEAN bRemove
|
||||
);
|
||||
|
||||
P_AIS_REQ_HDR_T
|
||||
aisFsmGetNextRequest (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
aisFsmInsertRequest (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_AIS_REQUEST_TYPE_T eReqType
|
||||
);
|
||||
|
||||
VOID
|
||||
aisFsmFlushRequest (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
|
||||
#if defined(CFG_TEST_MGMT_FSM) && (CFG_TEST_MGMT_FSM != 0)
|
||||
VOID
|
||||
aisTest (
|
||||
VOID
|
||||
);
|
||||
#endif /* CFG_TEST_MGMT_FSM */
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _AIS_FSM_H */
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/assoc.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file assoc.h
|
||||
\brief This file contains the ASSOC REQ/RESP of
|
||||
IEEE 802.11 family for MediaTek 802.11 Wireless LAN Adapters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: assoc.h $
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 17 2010 yuche.tsai
|
||||
* [WPD00003839][MT6620 5931][P2P] Feature migration
|
||||
* Add assocCheckTxReAssocRespFrame() proto type for P2P usage.
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) migrate assoc.c.
|
||||
* 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
|
||||
* 3) add configuration options for CNM_MEM and RSN modules
|
||||
* 4) add data path for management frames
|
||||
* 5) eliminate rPacketInfo of MSDU_INFO_T
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add buildable & linkable ais_fsm.c
|
||||
*
|
||||
* related reference are still waiting to be resolved
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ASSOC_H
|
||||
#define _ASSOC_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines in assoc.c */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
assocSendReAssocReqFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
assocCheckTxReAssocReqFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
assocCheckTxReAssocRespFrame(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
assocCheckRxReAssocRspFrameStatus (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
OUT PUINT_16 pu2StatusCode
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
assocSendDisAssocFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN UINT_16 u2ReasonCode
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
assocProcessRxDisassocFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN UINT_8 aucBSSID[],
|
||||
OUT PUINT_16 pu2ReasonCode
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
assocProcessRxAssocReqFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
OUT PUINT_16 pu2StatusCode
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
assocSendReAssocRespFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _ASSOC_H */
|
||||
|
||||
|
|
@ -1,175 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/auth.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file auth.h
|
||||
\brief This file contains the authentication REQ/RESP of
|
||||
IEEE 802.11 family for MediaTek 802.11 Wireless LAN Adapters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: auth.h $
|
||||
*
|
||||
* 04 21 2011 terry.wu
|
||||
* [WCXRP00000674] [MT6620 Wi-Fi][Driver] Refine AAA authSendAuthFrame
|
||||
* Add network type parameter to authSendAuthFrame.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 14 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add management dispatching function table.
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* auth.c is migrated.
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add buildable & linkable ais_fsm.c
|
||||
*
|
||||
* related reference are still waiting to be resolved
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _AUTH_H
|
||||
#define _AUTH_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines in auth.c */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
authAddIEChallengeText (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN OUT P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
#if !CFG_SUPPORT_AAA
|
||||
WLAN_STATUS
|
||||
authSendAuthFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN UINT_16 u2TransactionSeqNum
|
||||
);
|
||||
#else
|
||||
WLAN_STATUS
|
||||
authSendAuthFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_SW_RFB_T prFalseAuthSwRfb,
|
||||
IN UINT_16 u2TransactionSeqNum,
|
||||
IN UINT_16 u2StatusCode
|
||||
);
|
||||
#endif /* CFG_SUPPORT_AAA */
|
||||
|
||||
WLAN_STATUS
|
||||
authCheckTxAuthFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN UINT_16 u2TransactionSeqNum
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
authCheckRxAuthFrameTransSeq (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
authCheckRxAuthFrameStatus (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN UINT_16 u2TransactionSeqNum,
|
||||
OUT PUINT_16 pu2StatusCode
|
||||
);
|
||||
|
||||
VOID
|
||||
authHandleIEChallengeText (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_SW_RFB_T prSwRfb,
|
||||
P_IE_HDR_T prIEHdr
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
authProcessRxAuth2_Auth4Frame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
authSendDeauthFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN P_SW_RFB_T prClassErrSwRfb,
|
||||
IN UINT_16 u2ReasonCode,
|
||||
IN PFN_TX_DONE_HANDLER pfTxDoneHandler
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
authProcessRxDeauthFrame (
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN UINT_8 aucBSSID[],
|
||||
OUT PUINT_16 pu2ReasonCode
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
authProcessRxAuth1Frame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN UINT_8 aucExpectedBSSID[],
|
||||
IN UINT_16 u2ExpectedAuthAlgNum,
|
||||
IN UINT_16 u2ExpectedTransSeqNum,
|
||||
OUT PUINT_16 pu2ReturnStatusCode
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _AUTH_H */
|
||||
|
||||
|
|
@ -1,190 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/bow_fsm.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file bow_fsm.h
|
||||
\brief Declaration of functions and finite state machine for BOW Module.
|
||||
|
||||
Declaration of functions and finite state machine for BOW Module.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: bow_fsm.h $
|
||||
*
|
||||
* 05 22 2011 terry.wu
|
||||
* [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment
|
||||
* Submit missing BoW header files.
|
||||
*
|
||||
* 03 27 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Support multiple physical link.
|
||||
*
|
||||
* 02 16 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Add bowNotifyAllLinkDisconnected interface and change channel grant procedure for bow starting..
|
||||
*
|
||||
* 02 15 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Add channel previledge into _BOW_FSM_INFO_T.
|
||||
*
|
||||
* 09 16 2010 chinghwa.yu
|
||||
* NULL
|
||||
* update bowChangeMediaState.
|
||||
*
|
||||
* 08 24 2010 chinghwa.yu
|
||||
* NULL
|
||||
* Update BOW for the 1st time.
|
||||
*/
|
||||
|
||||
#ifndef _BOW_FSM_H
|
||||
#define _BOW_FSM_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#define BOW_BG_SCAN_INTERVAL_MIN_SEC 2 //30 // exponential to 960
|
||||
#define BOW_BG_SCAN_INTERVAL_MAX_SEC 2 //960 // 16min
|
||||
|
||||
#define BOW_DELAY_TIME_OF_DISCONNECT_SEC 10
|
||||
|
||||
#define BOW_BEACON_TIMEOUT_COUNT_STARTING 10
|
||||
#define BOW_BEACON_TIMEOUT_GUARD_TIME_SEC 1 /* Second */
|
||||
|
||||
#define BOW_BEACON_MAX_TIMEOUT_TU 100
|
||||
#define BOW_BEACON_MIN_TIMEOUT_TU 5
|
||||
#define BOW_BEACON_MAX_TIMEOUT_VALID TRUE
|
||||
#define BOW_BEACON_MIN_TIMEOUT_VALID TRUE
|
||||
|
||||
#define BOW_BMC_MAX_TIMEOUT_TU 100
|
||||
#define BOW_BMC_MIN_TIMEOUT_TU 5
|
||||
#define BOW_BMC_MAX_TIMEOUT_VALID TRUE
|
||||
#define BOW_BMC_MIN_TIMEOUT_VALID TRUE
|
||||
|
||||
#define BOW_JOIN_CH_GRANT_THRESHOLD 10
|
||||
#define BOW_JOIN_CH_REQUEST_INTERVAL 2000
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
typedef enum _ENUM_BOW_STATE_T {
|
||||
BOW_STATE_IDLE = 0,
|
||||
BOW_STATE_SEARCH,
|
||||
BOW_STATE_SCAN,
|
||||
BOW_STATE_ONLINE_SCAN,
|
||||
BOW_STATE_LOOKING_FOR,
|
||||
BOW_STATE_WAIT_FOR_NEXT_SCAN,
|
||||
BOW_STATE_REQ_CHANNEL_JOIN,
|
||||
BOW_STATE_REQ_CHANNEL_ALONE,
|
||||
BOW_STATE_REQ_CHANNEL_MERGE,
|
||||
BOW_STATE_JOIN,
|
||||
BOW_STATE_IBSS_ALONE,
|
||||
BOW_STATE_IBSS_MERGE,
|
||||
BOW_STATE_NORMAL_TR,
|
||||
BOW_STATE_NUM
|
||||
} ENUM_BOW_STATE_T;
|
||||
|
||||
typedef struct _BOW_FSM_INFO_T {
|
||||
ENUM_BOW_STATE_T ePreviousState;
|
||||
ENUM_BOW_STATE_T eCurrentState;
|
||||
|
||||
BOOLEAN fgTryScan;
|
||||
|
||||
/* Channel Privilege */
|
||||
|
||||
BOOLEAN fgIsInfraChannelFinished;
|
||||
BOOLEAN fgIsChannelRequested;
|
||||
BOOLEAN fgIsChannelGranted;
|
||||
BOOLEAN fgIsScanPending;
|
||||
UINT_32 u4ChGrantedInterval;
|
||||
|
||||
|
||||
UINT_8 ucPrimaryChannel;
|
||||
ENUM_BAND_T eBand;
|
||||
UINT_16 u2BeaconInterval;
|
||||
|
||||
ENUM_BOW_STATE_T eReturnState; /* Return state after current activity finished or abort. */
|
||||
ENUM_BOW_STATE_T eForwardState; /* Step to next state if ACTION frame is TX successfully. */
|
||||
|
||||
P_BSS_DESC_T prTargetBss; /* BSS of target P2P Device. For Connection/Service Discovery */
|
||||
|
||||
P_STA_RECORD_T prTargetStaRec;
|
||||
P_BSS_DESC_T prTargetBssDesc; /* For destination */
|
||||
|
||||
UINT_8 aucPeerAddress[6];
|
||||
|
||||
UINT_8 ucRole;
|
||||
|
||||
BOOLEAN fgSupportQoS;
|
||||
|
||||
BOOLEAN fgIsRsponseProbe; /* Indicate if BOW can response probe request frame. */
|
||||
|
||||
/* Sequence number of requested message. */
|
||||
UINT_8 ucSeqNumOfChReq;
|
||||
UINT_8 ucSeqNumOfReqMsg;
|
||||
UINT_8 ucSeqNumOfScnMsg;
|
||||
UINT_8 ucSeqNumOfScanReq;
|
||||
|
||||
UINT_8 ucSeqNumOfCancelMsg;
|
||||
|
||||
UINT_8 ucDialogToken;
|
||||
|
||||
/* Timer */
|
||||
TIMER_T rStartingBeaconTimer; /* For device discovery time of each discovery request from user.*/
|
||||
TIMER_T rStartingDiscoveryTimer;
|
||||
TIMER_T rOperationListenTimer; /* For Find phase under operational state. */
|
||||
TIMER_T rFSMTimer; /* A timer used for Action frame timeout usage. */
|
||||
TIMER_T rIndicationOfDisconnectTimer;
|
||||
TIMER_T rChGrantedTimer;
|
||||
|
||||
UINT_8 ucAvailableAuthTypes; /* Used for AUTH_MODE_AUTO_SWITCH */
|
||||
|
||||
} BOW_FSM_INFO_T, *P_BOW_FSM_INFO_T;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#define bowChangeMediaState(_prAdapter, _eNewMediaState) \
|
||||
(_prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX].eConnectionState = (_eNewMediaState));
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,353 +0,0 @@
|
|||
/*
|
||||
** $Id: @(#) bss.h
|
||||
*/
|
||||
|
||||
/*! \file "bss.h"
|
||||
\brief In this file we define the function prototype used in BSS/IBSS.
|
||||
|
||||
The file contains the function declarations and defines for used in BSS/IBSS.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: bss.h $
|
||||
*
|
||||
* 07 17 2012 yuche.tsai
|
||||
* NULL
|
||||
* Let netdev bring up.
|
||||
*
|
||||
* 07 17 2012 yuche.tsai
|
||||
* NULL
|
||||
* Compile no error before trial run.
|
||||
*
|
||||
* 03 02 2012 terry.wu
|
||||
* NULL
|
||||
* Sync CFG80211 modification from branch 2,2.
|
||||
*
|
||||
* 09 14 2011 yuche.tsai
|
||||
* NULL
|
||||
* Add P2P IE in assoc response.
|
||||
*
|
||||
* 03 19 2011 yuche.tsai
|
||||
* [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue
|
||||
* Make assoc req to append P2P IE if wifi direct is enabled.
|
||||
*
|
||||
* 03 02 2011 wh.su
|
||||
* [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request
|
||||
* Add code to send beacon and probe response WSC IE at Auto GO.
|
||||
*
|
||||
* 02 23 2011 eddie.chen
|
||||
* [WCXRP00000463] [MT6620 Wi-Fi][FW/Driver][Hotspot] Cannot update WMM PS STA's partital bitmap
|
||||
* Fix parsing WMM INFO and bmp delivery bitmap definition.
|
||||
*
|
||||
* 01 31 2011 george.huang
|
||||
* [WCXRP00000333] [MT5931][FW] support SRAM power control drivers
|
||||
* Extend TIM PVB, from 2 to 3 octets.
|
||||
*
|
||||
* 11 29 2010 cp.wu
|
||||
* [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for initial TX rate selection of auto-rate algorithm
|
||||
* update ucRcpi of STA_RECORD_T for AIS when
|
||||
* 1) Beacons for IBSS merge is received
|
||||
* 2) Associate Response for a connecting peer is received
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 08 12 2010 kevin.huang
|
||||
* NULL
|
||||
* Update bssProcessProbeRequest() and bssSendBeaconProbeResponse() declarations
|
||||
*
|
||||
* 07 19 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration.
|
||||
* when IBSS is being merged-in, send command packet to PM for connected indication
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 25 2010 george.huang
|
||||
* [WPD00001556]Basic power managemenet function
|
||||
* Create beacon update path, with expose bssUpdateBeaconContent()
|
||||
*
|
||||
* 06 17 2010 yuche.tsai
|
||||
* [WPD00003839][MT6620 5931][P2P] Feature migration
|
||||
* Add CTRL FLAGS for Probe Response.
|
||||
*
|
||||
* 06 09 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add necessary changes to driver data paths.
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
|
||||
*
|
||||
* 06 04 2010 george.huang
|
||||
* [BORA00000678][MT6620]WiFi LP integration
|
||||
* [PM] Support U-APSD for STA mode
|
||||
*
|
||||
* 05 28 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Add ClientList handling API - bssClearClientList, bssAddStaRecToClientList
|
||||
*
|
||||
* 05 14 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Remove unused typedef.
|
||||
*
|
||||
* 05 12 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Fix file merge error
|
||||
*
|
||||
* 05 12 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Add Power Management - Legacy PS-POLL support.
|
||||
*
|
||||
* 04 19 2010 kevin.huang
|
||||
* [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support
|
||||
* Add Beacon Timeout Support
|
||||
* * * and will send Null frame to diagnose connection
|
||||
*
|
||||
* 03 16 2010 kevin.huang
|
||||
* [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
|
||||
* Add AdHoc Mode
|
||||
*
|
||||
* 02 23 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Add DTIM count update while TX Beacon
|
||||
*
|
||||
* 02 04 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
|
||||
*/
|
||||
|
||||
#ifndef _BSS_H
|
||||
#define _BSS_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
//NOTE(Kevin): change define for george
|
||||
//#define MAX_LEN_TIM_PARTIAL_BMP (((MAX_ASSOC_ID + 1) + 7) / 8) /* Required bits = (MAX_ASSOC_ID + 1) */
|
||||
#define MAX_LEN_TIM_PARTIAL_BMP ((CFG_STA_REC_NUM + 7) / 8) /* reserve length greater than maximum size of STA_REC */ //obsoleted: Assume we only use AID:1~15
|
||||
|
||||
/* CTRL FLAGS for Probe Response */
|
||||
#define BSS_PROBE_RESP_USE_P2P_DEV_ADDR BIT(0)
|
||||
#define BSS_PROBE_RESP_INCLUDE_P2P_IE BIT(1)
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define bssAssignAssocID(_prStaRec) ((_prStaRec)->ucIndex + 1)
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines for all Operation Modes */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
P_STA_RECORD_T
|
||||
bssCreateStaRecFromBssDesc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_STA_TYPE_T eStaType,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
VOID
|
||||
bssComposeNullFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PUINT_8 pucBuffer,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
bssComposeQoSNullFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PUINT_8 pucBuffer,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN UINT_8 ucUP,
|
||||
IN BOOLEAN fgSetEOSP
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bssSendNullFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN PFN_TX_DONE_HANDLER pfTxDoneHandler
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bssSendQoSNullFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN UINT_8 ucUP,
|
||||
IN PFN_TX_DONE_HANDLER pfTxDoneHandler
|
||||
);
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines for both IBSS(AdHoc) and BSS(AP) */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
bssGenerateExtSuppRate_IE (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
bssBuildBeaconProbeRespFrameCommonIEs (
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN P_BSS_INFO_T prBssInfo,
|
||||
IN PUINT_8 pucDestAddr
|
||||
);
|
||||
|
||||
VOID
|
||||
bssComposeBeaconProbeRespFrameHeaderAndFF (
|
||||
IN PUINT_8 pucBuffer,
|
||||
IN PUINT_8 pucDestAddr,
|
||||
IN PUINT_8 pucOwnMACAddress,
|
||||
IN PUINT_8 pucBSSID,
|
||||
IN UINT_16 u2BeaconInterval,
|
||||
IN UINT_16 u2CapInfo
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bssSendBeaconProbeResponse (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN PUINT_8 pucDestAddr,
|
||||
IN UINT_32 u4ControlFlags
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bssProcessProbeRequest (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
bssClearClientList (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
bssAddStaRecToClientList (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prBssInfo,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
bssRemoveStaRecFromClientList (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prBssInfo,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines for IBSS(AdHoc) only */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
ibssProcessMatchedBeacon (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prBssInfo,
|
||||
IN P_BSS_DESC_T prBssDesc,
|
||||
IN UINT_8 ucRCPI
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
ibssCheckCapabilityForAdHocMode (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
VOID
|
||||
ibssInitForAdHoc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bssUpdateBeaconContent (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex
|
||||
);
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines for BSS(AP) only */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
bssInitForAP (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prBssInfo,
|
||||
IN BOOLEAN fgIsRateUpdate
|
||||
);
|
||||
|
||||
VOID
|
||||
bssUpdateDTIMCount (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex
|
||||
);
|
||||
|
||||
VOID
|
||||
bssSetTIMBitmap (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prBssInfo,
|
||||
IN UINT_16 u2AssocId
|
||||
);
|
||||
|
||||
|
||||
/*link function to p2p module for txBcnIETable*/
|
||||
|
||||
/* WMM-2.2.2 WMM ACI to AC coding */
|
||||
typedef enum _ENUM_ACI_T {
|
||||
ACI_BE = 0,
|
||||
ACI_BK = 1,
|
||||
ACI_VI = 2,
|
||||
ACI_VO = 3,
|
||||
ACI_NUM
|
||||
} ENUM_ACI_T, *P_ENUM_ACI_T;
|
||||
|
||||
typedef enum _ENUM_AC_PRIORITY_T {
|
||||
AC_BK_PRIORITY = 0,
|
||||
AC_BE_PRIORITY,
|
||||
AC_VI_PRIORITY,
|
||||
AC_VO_PRIORITY
|
||||
} ENUM_AC_PRIORITY_T, *P_ENUM_AC_PRIORITY_T;
|
||||
|
||||
|
||||
#endif /* _BSS_H */
|
||||
|
||||
|
|
@ -1,323 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/cnm.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "cnm.h"
|
||||
\brief
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: cnm.h $
|
||||
*
|
||||
* 06 23 2011 cp.wu
|
||||
* [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module
|
||||
* change parameter name from PeerAddr to BSSID
|
||||
*
|
||||
* 06 20 2011 cp.wu
|
||||
* [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module
|
||||
* 1. specify target's BSSID when requesting channel privilege.
|
||||
* 2. pass BSSID information to firmware domain
|
||||
*
|
||||
* 04 12 2011 cm.chang
|
||||
* [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency
|
||||
* .
|
||||
*
|
||||
* 03 10 2011 cm.chang
|
||||
* [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module
|
||||
* Add some functions to let AIS/Tethering or AIS/BOW be the same channel
|
||||
*
|
||||
* 01 12 2011 cm.chang
|
||||
* [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module
|
||||
* Provide function to decide if BSS can be activated or not
|
||||
*
|
||||
* 12 07 2010 cm.chang
|
||||
* [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk
|
||||
* 1. BSSINFO include RLM parameter
|
||||
* 2. free all sta records when network is disconnected
|
||||
*
|
||||
* 08 24 2010 cm.chang
|
||||
* NULL
|
||||
* Support RLM initail channel of Ad-hoc, P2P and BOW
|
||||
*
|
||||
* 07 19 2010 cm.chang
|
||||
*
|
||||
* Set RLM parameters and enable CNM channel manager
|
||||
*
|
||||
* 07 13 2010 cm.chang
|
||||
*
|
||||
* Rename MSG_CH_RELEASE_T to MSG_CH_ABORT_T
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 08 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Rename MID_MNY_CNM_CH_RELEASE to MID_MNY_CNM_CH_ABORT
|
||||
*
|
||||
* 07 01 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Need bandwidth info when requesting channel privilege
|
||||
*
|
||||
* 07 01 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Modify CNM message handler for new flow
|
||||
*
|
||||
* 05 12 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Add Power Management - Legacy PS-POLL support.
|
||||
*
|
||||
* 05 05 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Add a new function to send abort message
|
||||
*
|
||||
* 03 16 2010 kevin.huang
|
||||
* [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
|
||||
* Add AdHoc Mode
|
||||
*
|
||||
* 03 10 2010 kevin.huang
|
||||
* [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
|
||||
* Add Channel Manager for arbitration of JOIN and SCAN Req
|
||||
*
|
||||
* 02 08 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support partial part about cmd basic configuration
|
||||
*
|
||||
* Nov 18 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add prototype of cnmFsmEventInit()
|
||||
*
|
||||
* Nov 2 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _CNM_H
|
||||
#define _CNM_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
typedef enum _ENUM_CH_REQ_TYPE_T {
|
||||
CH_REQ_TYPE_JOIN,
|
||||
CH_REQ_TYPE_P2P_LISTEN,
|
||||
|
||||
CH_REQ_TYPE_NUM
|
||||
} ENUM_CH_REQ_TYPE_T, *P_ENUM_CH_REQ_TYPE_T;
|
||||
|
||||
typedef struct _MSG_CH_REQ_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucNetTypeIndex;
|
||||
UINT_8 ucTokenID;
|
||||
UINT_8 ucPrimaryChannel;
|
||||
ENUM_CHNL_EXT_T eRfSco;
|
||||
ENUM_BAND_T eRfBand;
|
||||
ENUM_CH_REQ_TYPE_T eReqType;
|
||||
UINT_32 u4MaxInterval; /* In unit of ms */
|
||||
UINT_8 aucBSSID[6];
|
||||
UINT_8 aucReserved[2];
|
||||
} MSG_CH_REQ_T, *P_MSG_CH_REQ_T;
|
||||
|
||||
typedef struct _MSG_CH_ABORT_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucNetTypeIndex;
|
||||
UINT_8 ucTokenID;
|
||||
} MSG_CH_ABORT_T, *P_MSG_CH_ABORT_T;
|
||||
|
||||
typedef struct _MSG_CH_GRANT_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucNetTypeIndex;
|
||||
UINT_8 ucTokenID;
|
||||
UINT_8 ucPrimaryChannel;
|
||||
ENUM_CHNL_EXT_T eRfSco;
|
||||
ENUM_BAND_T eRfBand;
|
||||
ENUM_CH_REQ_TYPE_T eReqType;
|
||||
UINT_32 u4GrantInterval; /* In unit of ms */
|
||||
} MSG_CH_GRANT_T, *P_MSG_CH_GRANT_T;
|
||||
|
||||
typedef struct _MSG_CH_REOCVER_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucNetTypeIndex;
|
||||
UINT_8 ucTokenID;
|
||||
UINT_8 ucPrimaryChannel;
|
||||
ENUM_CHNL_EXT_T eRfSco;
|
||||
ENUM_BAND_T eRfBand;
|
||||
ENUM_CH_REQ_TYPE_T eReqType;
|
||||
} MSG_CH_RECOVER_T, *P_MSG_CH_RECOVER_T;
|
||||
|
||||
|
||||
typedef struct _CNM_INFO_T {
|
||||
UINT_32 u4Reserved;
|
||||
} CNM_INFO_T, *P_CNM_INFO_T;
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
/* Moved from p2p_fsm.h */
|
||||
typedef struct _DEVICE_TYPE_T {
|
||||
UINT_16 u2CategoryId; /* Category ID */
|
||||
UINT_8 aucOui[4]; /* OUI */
|
||||
UINT_16 u2SubCategoryId; /* Sub Category ID */
|
||||
} __KAL_ATTRIB_PACKED__ DEVICE_TYPE_T, *P_DEVICE_TYPE_T;
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
VOID
|
||||
cnmInit (
|
||||
P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmUninit (
|
||||
P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmChMngrRequestPrivilege (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmChMngrAbortPrivilege (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmChMngrHandleChEvent (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_WIFI_EVENT_T prEvent
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
cnmPreferredChannel (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_ENUM_BAND_T prBand,
|
||||
PUINT_8 pucPrimaryChannel,
|
||||
P_ENUM_CHNL_EXT_T prBssSCO
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
cnmAisInfraChannelFixed (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_ENUM_BAND_T prBand,
|
||||
PUINT_8 pucPrimaryChannel
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmAisInfraConnectNotify (
|
||||
P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
cnmAisIbssIsPermitted (
|
||||
P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
cnmP2PIsPermitted (
|
||||
P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
cnmBowIsPermitted (
|
||||
P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
cnmBss40mBwPermitted (
|
||||
P_ADAPTER_T prAdapter,
|
||||
ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#ifndef _lint
|
||||
/* We don't have to call following function to inspect the data structure.
|
||||
* It will check automatically while at compile time.
|
||||
* We'll need this to guarantee the same member order in different structures
|
||||
* to simply handling effort in some functions.
|
||||
*/
|
||||
__KAL_INLINE__ VOID
|
||||
cnmMsgDataTypeCheck (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
OFFSET_OF(MSG_CH_GRANT_T,rMsgHdr) == 0);
|
||||
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
OFFSET_OF(MSG_CH_GRANT_T,rMsgHdr) ==
|
||||
OFFSET_OF(MSG_CH_RECOVER_T,rMsgHdr));
|
||||
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
OFFSET_OF(MSG_CH_GRANT_T,ucNetTypeIndex) ==
|
||||
OFFSET_OF(MSG_CH_RECOVER_T,ucNetTypeIndex));
|
||||
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
OFFSET_OF(MSG_CH_GRANT_T,ucTokenID) ==
|
||||
OFFSET_OF(MSG_CH_RECOVER_T,ucTokenID));
|
||||
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
OFFSET_OF(MSG_CH_GRANT_T,ucPrimaryChannel) ==
|
||||
OFFSET_OF(MSG_CH_RECOVER_T,ucPrimaryChannel));
|
||||
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
OFFSET_OF(MSG_CH_GRANT_T,eRfSco) ==
|
||||
OFFSET_OF(MSG_CH_RECOVER_T,eRfSco));
|
||||
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
OFFSET_OF(MSG_CH_GRANT_T,eRfBand) ==
|
||||
OFFSET_OF(MSG_CH_RECOVER_T,eRfBand));
|
||||
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
OFFSET_OF(MSG_CH_GRANT_T,eReqType) ==
|
||||
OFFSET_OF(MSG_CH_RECOVER_T,eReqType));
|
||||
|
||||
return;
|
||||
}
|
||||
#endif /* _lint */
|
||||
|
||||
#endif /* _CNM_H */
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,206 +0,0 @@
|
|||
/*
|
||||
** $Id: @(#)
|
||||
*/
|
||||
|
||||
/*! \file "cnm_scan.h"
|
||||
\brief
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: cnm_scan.h $
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 05 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* remove unused definitions.
|
||||
*
|
||||
* 07 01 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* implementation of DRV-SCN and related mailbox message handling.
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* merge cnm_scan.h and hem_mbox.h
|
||||
*
|
||||
* 05 12 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Add Power Management - Legacy PS-POLL support.
|
||||
*
|
||||
* 03 30 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support 2.4G OBSS scan
|
||||
*
|
||||
* 03 16 2010 kevin.huang
|
||||
* [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
|
||||
* Add AdHoc Mode
|
||||
*
|
||||
* 03 10 2010 kevin.huang
|
||||
* [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
|
||||
*
|
||||
* * * * Add Channel Manager for arbitration of JOIN and SCAN Req
|
||||
*
|
||||
* 02 23 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Add support scan channel 1~14 and update scan result's frequency infou1rwduu`wvpghlqg|n`slk+mpdkb
|
||||
*
|
||||
* 02 04 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
|
||||
*
|
||||
* Nov 18 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add function prototype of cnmScanInit()
|
||||
*
|
||||
* Nov 5 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _CNM_SCAN_H
|
||||
#define _CNM_SCAN_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define SCN_CHANNEL_DWELL_TIME_MIN_MSEC 12
|
||||
#define SCN_CHANNEL_DWELL_TIME_EXT_MSEC 98
|
||||
|
||||
#define SCN_TOTAL_PROBEREQ_NUM_FOR_FULL 3
|
||||
#define SCN_SPECIFIC_PROBEREQ_NUM_FOR_FULL 1
|
||||
|
||||
#define SCN_TOTAL_PROBEREQ_NUM_FOR_PARTIAL 2
|
||||
#define SCN_SPECIFIC_PROBEREQ_NUM_FOR_PARTIAL 1
|
||||
|
||||
|
||||
#define SCN_INTERLACED_CHANNEL_GROUPS_NUM 3 /* Used by partial scan */
|
||||
|
||||
#define SCN_PARTIAL_SCAN_NUM 3
|
||||
|
||||
#define SCN_PARTIAL_SCAN_IDLE_MSEC 100
|
||||
|
||||
#define MAXIMUM_OPERATION_CHANNEL_LIST 32
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* The type of Scan Source */
|
||||
typedef enum _ENUM_SCN_REQ_SOURCE_T {
|
||||
SCN_REQ_SOURCE_HEM = 0,
|
||||
SCN_REQ_SOURCE_NET_FSM,
|
||||
SCN_REQ_SOURCE_ROAMING, /* ROAMING Module is independent of AIS FSM */
|
||||
SCN_REQ_SOURCE_OBSS, /* 2.4G OBSS scan */
|
||||
SCN_REQ_SOURCE_NUM
|
||||
} ENUM_SCN_REQ_SOURCE_T, *P_ENUM_SCN_REQ_SOURCE_T;
|
||||
|
||||
typedef enum _ENUM_SCAN_PROFILE_T {
|
||||
SCAN_PROFILE_FULL = 0,
|
||||
SCAN_PROFILE_PARTIAL,
|
||||
SCAN_PROFILE_VOIP,
|
||||
SCAN_PROFILE_FULL_2G4,
|
||||
SCAN_PROFILE_NUM
|
||||
} ENUM_SCAN_PROFILE_T, *P_ENUM_SCAN_PROFILE_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#if 0
|
||||
VOID
|
||||
cnmScanInit (
|
||||
VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmScanRunEventScanRequest (
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
cnmScanRunEventScanAbort (
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmScanProfileSelection (
|
||||
VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmScanProcessStart (
|
||||
VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmScanProcessStop (
|
||||
VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmScanRunEventReqAISAbsDone (
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmScanRunEventCancelAISAbsDone (
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmScanPartialScanTimeout (
|
||||
UINT_32 u4Param
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmScanRunEventScnFsmComplete (
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* _CNM_SCAN_H */
|
||||
|
||||
|
||||
|
|
@ -1,274 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/cnm_timer.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file cnm_timer.h
|
||||
\brief Declaration of timer obj and related timer macro for setup time out
|
||||
event.
|
||||
|
||||
In this file we declare the timer object and provide several macro for
|
||||
Protocol functional blocks to setup their own time out event.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: cnm_timer.h $
|
||||
*
|
||||
* 12 13 2011 cm.chang
|
||||
* [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer
|
||||
* Add wake lock if timer timeout value is smaller than 5 seconds
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 08 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* cnm_timer has been migrated.
|
||||
*
|
||||
* 06 08 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add hem_mbox.c and cnm_mem.h (but disabled some feature) for further migration
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* merge cnm_scan.h and hem_mbox.h
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* merge wifi_var.h, precomp.h, cnm_timer.h (data type only)
|
||||
*
|
||||
* 06 04 2010 george.huang
|
||||
* [BORA00000678][MT6620]WiFi LP integration
|
||||
* [PM] Support U-APSD for STA mode
|
||||
*
|
||||
* 04 24 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Return timer token back to COS when entering wait off state
|
||||
*
|
||||
* 01 08 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support longer timeout interval to 45 days from 65secu1rwduu`wvpghlqg|fh+fmdkb
|
||||
*
|
||||
* 01 06 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Fix system time is 32KHz instead of 1ms
|
||||
*
|
||||
* Nov 23 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* add the copy time function
|
||||
*
|
||||
* Nov 5 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Fix LINT warnning
|
||||
*
|
||||
* Oct 28 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _CNM_TIMER_H
|
||||
#define _CNM_TIMER_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#undef MSEC_PER_SEC
|
||||
#define MSEC_PER_SEC 1000
|
||||
#undef USEC_PER_MSEC
|
||||
#define USEC_PER_MSEC 1000
|
||||
#define USEC_PER_TU 1024 /* microsecond */
|
||||
|
||||
#define MSEC_PER_MIN (60 * MSEC_PER_SEC)
|
||||
|
||||
|
||||
#define MGMT_MAX_TIMEOUT_INTERVAL ((UINT_32)0x7fffffff)
|
||||
|
||||
#define WAKE_LOCK_MAX_TIME 5 /* Unit: sec */
|
||||
|
||||
/* If WAKE_LOCK_MAX_TIME is too large, the whole system may always keep awake
|
||||
* because of periodic timer of OBSS scanning
|
||||
*/
|
||||
#if (WAKE_LOCK_MAX_TIME >= OBSS_SCAN_MIN_INTERVAL)
|
||||
#error WAKE_LOCK_MAX_TIME is too large
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
typedef VOID (*PFN_MGMT_TIMEOUT_FUNC)(P_ADAPTER_T, UINT_32);
|
||||
|
||||
typedef struct _TIMER_T {
|
||||
LINK_ENTRY_T rLinkEntry;
|
||||
OS_SYSTIME rExpiredSysTime;
|
||||
UINT_16 u2Minutes;
|
||||
UINT_16 u2Reserved;
|
||||
UINT_32 u4Data;
|
||||
PFN_MGMT_TIMEOUT_FUNC pfMgmtTimeOutFunc;
|
||||
} TIMER_T, *P_TIMER_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Check if time "a" is before time "b" */
|
||||
/* In 32-bit variable, 0x00000001~0x7fffffff -> positive number,
|
||||
* 0x80000000~0xffffffff -> negative number
|
||||
*/
|
||||
#define TIME_BEFORE_64bit(a,b) (a < b)
|
||||
|
||||
#define TIME_BEFORE(a,b) ((UINT_32)((UINT_32)(a) - (UINT_32)(b)) > 0x7fffffff)
|
||||
|
||||
/* #define TIME_BEFORE(a,b) ((INT_32)((INT_32)(b) - (INT_32)(a)) > 0)
|
||||
* may cause UNexpect result between Free build and Check build for WinCE
|
||||
*/
|
||||
|
||||
#define TIME_AFTER(a,b) TIME_BEFORE(b,a)
|
||||
|
||||
#define SYSTIME_TO_SEC(_systime) ((_systime) / KAL_HZ)
|
||||
#define SEC_TO_SYSTIME(_sec) ((_sec) * KAL_HZ)
|
||||
|
||||
|
||||
/* The macros to convert second & millisecond */
|
||||
#define MSEC_TO_SEC(_msec) ((_msec) / MSEC_PER_SEC)
|
||||
#define SEC_TO_MSEC(_sec) ((UINT_32)(_sec) * MSEC_PER_SEC)
|
||||
|
||||
|
||||
/* The macros to convert millisecond & microsecond */
|
||||
#define USEC_TO_MSEC(_usec) ((_usec) / USEC_PER_MSEC)
|
||||
#define MSEC_TO_USEC(_msec) ((UINT_32)(_msec) * USEC_PER_MSEC)
|
||||
|
||||
|
||||
/* The macros to convert TU & microsecond, TU & millisecond */
|
||||
#define TU_TO_USEC(_tu) ((_tu) * USEC_PER_TU)
|
||||
#define TU_TO_MSEC(_tu) USEC_TO_MSEC( TU_TO_USEC(_tu) )
|
||||
|
||||
|
||||
/* The macros to convert TU & & OS system time, round up by 0.5 */
|
||||
#define TU_TO_SYSTIME(_tu) MSEC_TO_SYSTIME( TU_TO_MSEC(_tu) )
|
||||
#define SYSTIME_TO_TU(_systime) \
|
||||
((SYSTIME_TO_USEC(_systime) + ((USEC_PER_TU / 2) - 1)) / USEC_PER_TU)
|
||||
|
||||
|
||||
/* The macros to convert OS system time & microsecond */
|
||||
#define SYSTIME_TO_USEC(_systime) (SYSTIME_TO_MSEC(_systime) * USEC_PER_MSEC)
|
||||
|
||||
|
||||
/* The macro to get the current OS system time */
|
||||
#define GET_CURRENT_SYSTIME(_systime_p) {*(_systime_p) = kalGetTimeTick();}
|
||||
|
||||
/* The macro to copy the system time */
|
||||
#define COPY_SYSTIME(_destTime, _srcTime) (_destTime) = (_srcTime)
|
||||
|
||||
/* The macro to get the system time difference between t1 and t2 (t1 - t2) */
|
||||
/* #define GET_SYSTIME_DIFFERENCE(_time1, _time2, _diffTime) \
|
||||
(_diffTime) = (_time1) - (_time2) */
|
||||
|
||||
/* The macro to check for the expiration, if TRUE means _currentTime >= _expirationTime */
|
||||
#define CHECK_FOR_EXPIRATION(_currentTime, _expirationTime) \
|
||||
( ((UINT_32)(_currentTime) - (UINT_32)(_expirationTime)) <= 0x7fffffffUL)
|
||||
|
||||
/* The macro to check for the timeout */
|
||||
#define CHECK_FOR_TIMEOUT(_currentTime, _timeoutStartingTime, _timeout) \
|
||||
CHECK_FOR_EXPIRATION((_currentTime), ((_timeoutStartingTime) + (_timeout)))
|
||||
|
||||
/* The macro to set the expiration time with a specified timeout *//* Watch out for round up.*/
|
||||
#define SET_EXPIRATION_TIME(_expirationTime, _timeout) \
|
||||
{ \
|
||||
GET_CURRENT_SYSTIME(&(_expirationTime)); \
|
||||
(_expirationTime) += (OS_SYSTIME)(_timeout); \
|
||||
}
|
||||
|
||||
#define timerRenewTimer(adapter,tmr,interval) \
|
||||
timerStartTimer(adapter,tmr,interval,(tmr)->function,(tmr)->data)
|
||||
|
||||
#define MGMT_INIT_TIMER(_adapter_p, _timer, _callbackFunc) \
|
||||
timerInitTimer(_adapter_p, &(_timer), (UINT_32)(_callbackFunc))
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
VOID
|
||||
cnmTimerInitialize (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmTimerDestroy (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmTimerInitTimer (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_TIMER_T prTimer,
|
||||
IN PFN_MGMT_TIMEOUT_FUNC pfFunc,
|
||||
IN UINT_32 u4Data
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmTimerStopTimer (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_TIMER_T prTimer
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmTimerStartTimer (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_TIMER_T prTimer,
|
||||
IN UINT_32 u4TimeoutMs
|
||||
);
|
||||
|
||||
VOID
|
||||
cnmTimerDoTimeOutCheck (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
__KAL_INLINE__
|
||||
INT_32
|
||||
timerPendingTimer (
|
||||
IN P_TIMER_T prTimer
|
||||
)
|
||||
{
|
||||
ASSERT(prTimer);
|
||||
|
||||
return prTimer->rLinkEntry.prNext != NULL;
|
||||
}
|
||||
|
||||
#endif /* _CNM_TIMER_H */
|
||||
|
||||
|
||||
|
|
@ -1,444 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/hem_mbox.h#2 $
|
||||
*/
|
||||
|
||||
/*! \file hem_mbox.h
|
||||
\brief
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: hem_mbox.h $
|
||||
**
|
||||
** 07 26 2012 yuche.tsai
|
||||
** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot
|
||||
** Update driver code of ALPS.JB for hot-spot.
|
||||
**
|
||||
** 07 19 2012 yuche.tsai
|
||||
** NULL
|
||||
** Code update for JB.
|
||||
*
|
||||
* 03 02 2012 terry.wu
|
||||
* NULL
|
||||
* Sync CFG80211 modification from branch 2,2.
|
||||
*
|
||||
* 07 18 2011 cp.wu
|
||||
* [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for more than one SSID in a single scanning request
|
||||
* add framework in driver domain for supporting new SCAN_REQ_V2 for more than 1 SSID support as well as uProbeDelay in NDIS 6.x driver model
|
||||
*
|
||||
* 06 07 2011 yuche.tsai
|
||||
* [WCXRP00000696] [Volunteer Patch][MT6620][Driver] Infinite loop issue when RX invitation response.[WCXRP00000763] [Volunteer Patch][MT6620][Driver] RX Service Discovery Frame under AP mode Issue
|
||||
* Add invitation support.
|
||||
*
|
||||
* 06 02 2011 cp.wu
|
||||
* [WCXRP00000681] [MT5931][Firmware] HIF code size reduction
|
||||
* eliminate unused parameters for SAA-FSM
|
||||
*
|
||||
* 01 26 2011 cm.chang
|
||||
* [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument
|
||||
* Allocate system RAM if fixed message or mgmt buffer is not available
|
||||
*
|
||||
* 11 08 2010 cm.chang
|
||||
* [WCXRP00000169] [MT6620 Wi-Fi][Driver][FW] Remove unused CNM recover message ID
|
||||
* Remove CNM channel reover message ID
|
||||
*
|
||||
* 09 16 2010 cm.chang
|
||||
* NULL
|
||||
* Remove unused message ID
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 08 30 2010 cp.wu
|
||||
* NULL
|
||||
* eliminate klockwork errors
|
||||
*
|
||||
* 08 25 2010 george.huang
|
||||
* NULL
|
||||
* update OID/ registry control path for PM related settings
|
||||
*
|
||||
* 08 23 2010 chinghwa.yu
|
||||
* NULL
|
||||
* Update for BOW.
|
||||
*
|
||||
* 08 16 2010 cp.wu
|
||||
* NULL
|
||||
* add interface for RLM to trigger OBSS-SCAN.
|
||||
*
|
||||
* 08 11 2010 yuche.tsai
|
||||
* NULL
|
||||
* Add some message ID for P2P FSM under provisioning phase.
|
||||
*
|
||||
* 08 11 2010 yuche.tsai
|
||||
* NULL
|
||||
* Add Message Event ID for P2P Module.
|
||||
*
|
||||
* 08 05 2010 yuche.tsai
|
||||
* NULL
|
||||
* Check-in P2P Device Discovery Feature.
|
||||
*
|
||||
* 08 04 2010 cp.wu
|
||||
* NULL
|
||||
* remove unused mailbox message definitions.
|
||||
*
|
||||
* 08 02 2010 yuche.tsai
|
||||
* NULL
|
||||
* P2P Group Negotiation Code Check in.
|
||||
*
|
||||
* 07 19 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration.
|
||||
* message table should not be commented out by compilation option without modifying header file
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 08 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Rename MID_MNY_CNM_CH_RELEASE to MID_MNY_CNM_CH_ABORT
|
||||
*
|
||||
* 07 01 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* AIS-FSM integration with CNM channel request messages
|
||||
*
|
||||
* 07 01 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* implementation of DRV-SCN and related mailbox message handling.
|
||||
*
|
||||
* 07 01 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Modify CNM message handler for new flow
|
||||
*
|
||||
* 06 18 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Provide cnmMgtPktAlloc() and alloc/free function of msg/buf
|
||||
*
|
||||
* 06 14 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* restore utility function invoking via hem_mbox to direct calls
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* auth.c is migrated.
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add buildable & linkable ais_fsm.c
|
||||
*
|
||||
* related reference are still waiting to be resolved
|
||||
*
|
||||
* 06 09 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add definitions for module migration.
|
||||
*
|
||||
* 06 08 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* hem_mbox is migrated.
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* merge cnm_scan.h and hem_mbox.h
|
||||
*
|
||||
* 05 12 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Add Power Management - Legacy PS-POLL support.
|
||||
*
|
||||
* 04 29 2010 tehuang.liu
|
||||
* [BORA00000605][WIFISYS] Phase3 Integration
|
||||
* Removed MID_RXM_MQM_QOS_ACTION_FRAME
|
||||
*
|
||||
* 04 29 2010 tehuang.liu
|
||||
* [BORA00000605][WIFISYS] Phase3 Integration
|
||||
* Removed MID_RXM_MQM_BA_ACTION_FRAME
|
||||
*
|
||||
* 03 30 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support 2.4G OBSS scan
|
||||
*
|
||||
* 03 16 2010 kevin.huang
|
||||
* [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
|
||||
* Add AdHoc Mode
|
||||
*
|
||||
* 03 10 2010 kevin.huang
|
||||
* [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
|
||||
*
|
||||
* * * * * Add Channel Manager for arbitration of JOIN and SCAN Req
|
||||
*
|
||||
* 03 05 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Develop partial DPD code
|
||||
*
|
||||
* 02 11 2010 tehuang.liu
|
||||
* [BORA00000569][WIFISYS] Phase 2 Integration Test
|
||||
* Added MID_RXM_MQM_QOS_ACTION_FRAME for RXM to indicate QoS Action frames to MQM
|
||||
*
|
||||
* 01 11 2010 kevin.huang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Add Deauth and Disassoc Handler
|
||||
*
|
||||
* Dec 7 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Rename the parameter of mboxDummy()
|
||||
*
|
||||
* Dec 2 2009 MTK02468
|
||||
* [BORA00000337] To check in codes for FPGA emulation
|
||||
* Added MID_RXM_MQM_BA_ACTION_FRAME
|
||||
*
|
||||
* Nov 24 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Remove Dummy MSG ID
|
||||
*
|
||||
* Nov 23 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add JOIN REQ related MSG ID
|
||||
*
|
||||
* Nov 16 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add AIS ABORT MSG ID
|
||||
*
|
||||
* Nov 5 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add SCN MSG IDs
|
||||
*
|
||||
* Oct 28 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _HEM_MBOX_H
|
||||
#define _HEM_MBOX_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Message IDs */
|
||||
typedef enum _ENUM_MSG_ID_T {
|
||||
MID_MNY_CNM_CH_REQ, /* MANY notify CNM to obtain channel privilege */
|
||||
MID_MNY_CNM_CH_ABORT, /* MANY notify CNM to abort/release channel privilege */
|
||||
|
||||
MID_CNM_AIS_CH_GRANT, /* CNM notify AIS for indicating channel granted */
|
||||
MID_CNM_P2P_CH_GRANT, /* CNM notify P2P for indicating channel granted */
|
||||
MID_CNM_BOW_CH_GRANT, /* CNM notify BOW for indicating channel granted */
|
||||
|
||||
/*--------------------------------------------------*/
|
||||
/* SCN Module Mailbox Messages */
|
||||
/*--------------------------------------------------*/
|
||||
MID_AIS_SCN_SCAN_REQ, /* AIS notify SCN for starting scan */
|
||||
MID_AIS_SCN_SCAN_REQ_V2, /* AIS notify SCN for starting scan with multiple SSID support */
|
||||
MID_AIS_SCN_SCAN_CANCEL, /* AIS notify SCN for cancelling scan */
|
||||
MID_P2P_SCN_SCAN_REQ, /* P2P notify SCN for starting scan */
|
||||
MID_P2P_SCN_SCAN_REQ_V2, /* P2P notify SCN for starting scan with multiple SSID support */
|
||||
MID_P2P_SCN_SCAN_CANCEL, /* P2P notify SCN for cancelling scan */
|
||||
MID_BOW_SCN_SCAN_REQ, /* BOW notify SCN for starting scan */
|
||||
MID_BOW_SCN_SCAN_REQ_V2, /* BOW notify SCN for starting scan with multiple SSID support */
|
||||
MID_BOW_SCN_SCAN_CANCEL, /* BOW notify SCN for cancelling scan */
|
||||
MID_RLM_SCN_SCAN_REQ, /* RLM notify SCN for starting scan (OBSS-SCAN) */
|
||||
MID_RLM_SCN_SCAN_REQ_V2, /* RLM notify SCN for starting scan (OBSS-SCAN) with multiple SSID support */
|
||||
MID_RLM_SCN_SCAN_CANCEL, /* RLM notify SCN for cancelling scan (OBSS-SCAN)*/
|
||||
MID_SCN_AIS_SCAN_DONE, /* SCN notify AIS for scan completion */
|
||||
MID_SCN_P2P_SCAN_DONE, /* SCN notify P2P for scan completion */
|
||||
MID_SCN_BOW_SCAN_DONE, /* SCN notify BOW for scan completion */
|
||||
MID_SCN_RLM_SCAN_DONE, /* SCN notify RLM for scan completion (OBSS-SCAN) */
|
||||
|
||||
/*--------------------------------------------------*/
|
||||
/* AIS Module Mailbox Messages */
|
||||
/*--------------------------------------------------*/
|
||||
MID_OID_AIS_FSM_JOIN_REQ, /* OID/IOCTL notify AIS for join */
|
||||
MID_OID_AIS_FSM_ABORT, /* OID/IOCTL notify AIS for abort */
|
||||
MID_AIS_SAA_FSM_START, /* AIS notify SAA for Starting authentication/association fsm */
|
||||
MID_AIS_SAA_FSM_ABORT, /* AIS notify SAA for Aborting authentication/association fsm */
|
||||
MID_SAA_AIS_JOIN_COMPLETE, /* SAA notify AIS for indicating join complete */
|
||||
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
/*--------------------------------------------------*/
|
||||
/* BOW Module Mailbox Messages */
|
||||
/*--------------------------------------------------*/
|
||||
MID_BOW_SAA_FSM_START, /* BOW notify SAA for Starting authentication/association fsm */
|
||||
MID_BOW_SAA_FSM_ABORT, /* BOW notify SAA for Aborting authentication/association fsm */
|
||||
MID_SAA_BOW_JOIN_COMPLETE, /* SAA notify BOW for indicating join complete */
|
||||
#endif
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
/*--------------------------------------------------*/
|
||||
/* P2P Module Mailbox Messages */
|
||||
/*--------------------------------------------------*/
|
||||
MID_P2P_SAA_FSM_START, /* P2P notify SAA for Starting authentication/association fsm */
|
||||
MID_P2P_SAA_FSM_ABORT, /* P2P notify SAA for Aborting authentication/association fsm */
|
||||
MID_SAA_P2P_JOIN_COMPLETE, /* SAA notify P2P for indicating join complete */
|
||||
|
||||
MID_MNY_P2P_FUN_SWITCH, /* Enable P2P FSM. */
|
||||
MID_MNY_P2P_DEVICE_DISCOVERY, /* Start device discovery. */
|
||||
MID_MNY_P2P_CONNECTION_REQ, /* Connection request. */
|
||||
MID_MNY_P2P_CONNECTION_ABORT, /* Abort connection request, P2P FSM return to IDLE. */
|
||||
MID_MNY_P2P_BEACON_UPDATE,
|
||||
MID_MNY_P2P_STOP_AP,
|
||||
MID_MNY_P2P_CHNL_REQ,
|
||||
MID_MNY_P2P_CHNL_ABORT,
|
||||
MID_MNY_P2P_MGMT_TX,
|
||||
MID_MNY_P2P_GROUP_DISSOLVE,
|
||||
MID_MNY_P2P_MGMT_FRAME_REGISTER,
|
||||
MID_MNY_P2P_NET_DEV_REGISTER,
|
||||
MID_MNY_P2P_START_AP,
|
||||
MID_MNY_P2P_MGMT_FRAME_UPDATE,
|
||||
#if CFG_SUPPORT_WFD
|
||||
MID_MNY_P2P_WFD_CFG_UPDATE,
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_ADHOC
|
||||
MID_SCN_AIS_FOUND_IBSS, /* SCN notify AIS that an IBSS Peer has been found and can merge into */
|
||||
#endif /* CFG_SUPPORT_ADHOC */
|
||||
|
||||
MID_SAA_AIS_FSM_ABORT, /* SAA notify AIS for indicating deauthentication/disassociation */
|
||||
|
||||
MID_TOTAL_NUM
|
||||
} ENUM_MSG_ID_T, *P_ENUM_MSG_ID_T;
|
||||
|
||||
/* Message header of inter-components */
|
||||
struct _MSG_HDR_T {
|
||||
LINK_ENTRY_T rLinkEntry;
|
||||
ENUM_MSG_ID_T eMsgId;
|
||||
};
|
||||
|
||||
typedef VOID (*PFN_MSG_HNDL_FUNC)(P_ADAPTER_T, P_MSG_HDR_T);
|
||||
|
||||
typedef struct _MSG_HNDL_ENTRY {
|
||||
ENUM_MSG_ID_T eMsgId;
|
||||
PFN_MSG_HNDL_FUNC pfMsgHndl;
|
||||
} MSG_HNDL_ENTRY_T, *P_MSG_HNDL_ENTRY_T;
|
||||
|
||||
typedef enum _EUNM_MSG_SEND_METHOD_T {
|
||||
MSG_SEND_METHOD_BUF = 0, /* Message is put in the queue and will be
|
||||
executed when mailbox is checked. */
|
||||
MSG_SEND_METHOD_UNBUF /* The handler function is called immediately
|
||||
in the same context of the sender */
|
||||
} EUNM_MSG_SEND_METHOD_T, *P_EUNM_MSG_SEND_METHOD_T;
|
||||
|
||||
|
||||
typedef enum _ENUM_MBOX_ID_T {
|
||||
MBOX_ID_0 = 0,
|
||||
MBOX_ID_TOTAL_NUM
|
||||
} ENUM_MBOX_ID_T, *P_ENUM_MBOX_ID_T;
|
||||
|
||||
/* Define Mailbox structure */
|
||||
typedef struct _MBOX_T {
|
||||
LINK_T rLinkHead;
|
||||
} MBOX_T, *P_MBOX_T;
|
||||
|
||||
typedef struct _MSG_SAA_FSM_START_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucSeqNum;
|
||||
P_STA_RECORD_T prStaRec;
|
||||
} MSG_SAA_FSM_START_T, *P_MSG_SAA_FSM_START_T;
|
||||
|
||||
typedef struct _MSG_SAA_FSM_COMP_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucSeqNum;
|
||||
WLAN_STATUS rJoinStatus;
|
||||
P_STA_RECORD_T prStaRec;
|
||||
P_SW_RFB_T prSwRfb;
|
||||
} MSG_SAA_FSM_COMP_T, *P_MSG_SAA_FSM_COMP_T;
|
||||
|
||||
typedef struct _MSG_SAA_FSM_ABORT_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucSeqNum;
|
||||
P_STA_RECORD_T prStaRec;
|
||||
} MSG_SAA_FSM_ABORT_T, *P_MSG_SAA_FSM_ABORT_T;
|
||||
|
||||
typedef struct _MSG_CONNECTION_ABORT_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucNetTypeIndex;
|
||||
} MSG_CONNECTION_ABORT_T, *P_MSG_CONNECTION_ABORT_T;
|
||||
|
||||
|
||||
|
||||
/* specific message data types */
|
||||
typedef MSG_SAA_FSM_START_T MSG_JOIN_REQ_T, *P_MSG_JOIN_REQ_T;
|
||||
typedef MSG_SAA_FSM_COMP_T MSG_JOIN_COMP_T, *P_MSG_JOIN_COMP_T;
|
||||
typedef MSG_SAA_FSM_ABORT_T MSG_JOIN_ABORT_T, *P_MSG_JOIN_ABORT_T;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
VOID
|
||||
mboxSetup (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_MBOX_ID_T eMboxId
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
mboxSendMsg (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_MBOX_ID_T eMboxId,
|
||||
IN P_MSG_HDR_T prMsg,
|
||||
IN EUNM_MSG_SEND_METHOD_T eMethod
|
||||
);
|
||||
|
||||
VOID
|
||||
mboxRcvAllMsg (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_MBOX_ID_T eMboxId
|
||||
);
|
||||
|
||||
VOID
|
||||
mboxInitialize (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
mboxDestroy (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
mboxDummy (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _HEM_MBOX_H */
|
||||
|
||||
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/mib.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file mib.h
|
||||
\brief This file contains the IEEE 802.11 family related MIB definition
|
||||
for MediaTek 802.11 Wireless LAN Adapters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: mib.h $
|
||||
*
|
||||
* 11 08 2010 wh.su
|
||||
* [WCXRP00000171] [MT6620 Wi-Fi][Driver] Add message check code same behavior as mt5921
|
||||
* add the message check code from mt5921.
|
||||
*
|
||||
* 07 24 2010 wh.su
|
||||
*
|
||||
* .support the Wi-Fi RSN
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
|
||||
*
|
||||
* 02 04 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
|
||||
*
|
||||
* Nov 23 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _MIB_H
|
||||
#define _MIB_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Entry in SMT AuthenticationAlgorithms Table: dot11AuthenticationAlgorithmsEntry */
|
||||
typedef struct _DOT11_AUTHENTICATION_ALGORITHMS_ENTRY {
|
||||
BOOLEAN dot11AuthenticationAlgorithmsEnable; /* dot11AuthenticationAlgorithmsEntry 3 */
|
||||
} DOT11_AUTHENTICATION_ALGORITHMS_ENTRY, *P_DOT11_AUTHENTICATION_ALGORITHMS_ENTRY;
|
||||
|
||||
/* Entry in SMT dot11RSNAConfigPairwiseCiphersTalbe Table: dot11RSNAConfigPairwiseCiphersEntry */
|
||||
typedef struct _DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY
|
||||
{
|
||||
UINT_32 dot11RSNAConfigPairwiseCipher; /* dot11RSNAConfigPairwiseCiphersEntry 2 */
|
||||
BOOLEAN dot11RSNAConfigPairwiseCipherEnabled; /* dot11RSNAConfigPairwiseCiphersEntry 3 */
|
||||
} DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY, *P_DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY;
|
||||
|
||||
/* Entry in SMT dot11RSNAConfigAuthenticationSuitesTalbe Table: dot11RSNAConfigAuthenticationSuitesEntry */
|
||||
typedef struct _DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY
|
||||
{
|
||||
UINT_32 dot11RSNAConfigAuthenticationSuite; /* dot11RSNAConfigAuthenticationSuitesEntry 2 */
|
||||
BOOLEAN dot11RSNAConfigAuthenticationSuiteEnabled; /* dot11RSNAConfigAuthenticationSuitesEntry 3 */
|
||||
} DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY, *P_DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY;
|
||||
|
||||
/* ----- IEEE 802.11 MIB Major sections ----- */
|
||||
typedef struct _IEEE_802_11_MIB_T {
|
||||
/* dot11PrivacyTable (dot11smt 5) */
|
||||
UINT_8 dot11WEPDefaultKeyID; /* dot11PrivacyEntry 2 */
|
||||
BOOLEAN dot11TranmitKeyAvailable;
|
||||
UINT_32 dot11WEPICVErrorCount; /* dot11PrivacyEntry 5 */
|
||||
UINT_32 dot11WEPExcludedCount; /* dot11PrivacyEntry 6 */
|
||||
|
||||
/* dot11RSNAConfigTable (dot11smt 8) */
|
||||
UINT_32 dot11RSNAConfigGroupCipher; /* dot11RSNAConfigEntry 4 */
|
||||
|
||||
/* dot11RSNAConfigPairwiseCiphersTable (dot11smt 9) */
|
||||
DOT11_RSNA_CONFIG_PAIRWISE_CIPHERS_ENTRY dot11RSNAConfigPairwiseCiphersTable[MAX_NUM_SUPPORTED_CIPHER_SUITES];
|
||||
|
||||
/* dot11RSNAConfigAuthenticationSuitesTable (dot11smt 10) */
|
||||
DOT11_RSNA_CONFIG_AUTHENTICATION_SUITES_ENTRY dot11RSNAConfigAuthenticationSuitesTable[MAX_NUM_SUPPORTED_AKM_SUITES];
|
||||
|
||||
#if 0 //SUPPORT_WAPI
|
||||
BOOLEAN fgWapiKeyInstalled;
|
||||
PARAM_WPI_KEY_T rWapiPairwiseKey[2];
|
||||
BOOLEAN fgPairwiseKeyUsed[2];
|
||||
UINT_8 ucWpiActivedPWKey; /* Must be 0 or 1, by wapi spec */
|
||||
PARAM_WPI_KEY_T rWapiGroupKey[2];
|
||||
BOOLEAN fgGroupKeyUsed[2];
|
||||
#endif
|
||||
} IEEE_802_11_MIB_T, *P_IEEE_802_11_MIB_T;
|
||||
|
||||
/* ------------------ IEEE 802.11 non HT PHY characteristics ---------------- */
|
||||
typedef const struct _NON_HT_PHY_ATTRIBUTE_T {
|
||||
UINT_16 u2SupportedRateSet;
|
||||
|
||||
BOOLEAN fgIsShortPreambleOptionImplemented;
|
||||
|
||||
BOOLEAN fgIsShortSlotTimeOptionImplemented;
|
||||
|
||||
} NON_HT_PHY_ATTRIBUTE_T, *P_NON_HT_PHY_ATTRIBUTE_T;
|
||||
|
||||
typedef const struct _NON_HT_ADHOC_MODE_ATTRIBUTE_T {
|
||||
|
||||
ENUM_PHY_TYPE_INDEX_T ePhyTypeIndex;
|
||||
|
||||
UINT_16 u2BSSBasicRateSet;
|
||||
|
||||
} NON_HT_ADHOC_MODE_ATTRIBUTE_T, *P_NON_HT_ADHOC_MODE_ATTRIBUTE_T;
|
||||
|
||||
typedef NON_HT_ADHOC_MODE_ATTRIBUTE_T NON_HT_AP_MODE_ATTRIBUTE_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
extern NON_HT_PHY_ATTRIBUTE_T rNonHTPhyAttributes[];
|
||||
extern NON_HT_ADHOC_MODE_ATTRIBUTE_T rNonHTAdHocModeAttributes[];
|
||||
extern NON_HT_AP_MODE_ATTRIBUTE_T rNonHTApModeAttributes[];
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _MIB_H */
|
||||
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/mgmt/p2p_assoc.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file p2p_assoc.h
|
||||
\brief This file contains the Wi-Fi Direct ASSOC REQ/RESP of
|
||||
IEEE 802.11 family for MediaTek 802.11 Wireless LAN Adapters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef _P2P_ASSOC_H
|
||||
#define _P2P_ASSOC_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
PUINT_8
|
||||
p2pBuildReAssocReqFrameCommonIEs (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN PUINT_8 pucBuffer
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/mgmt/p2p_bss.h#2 $
|
||||
*/
|
||||
|
||||
/*! \file "p2p_bss.h"
|
||||
\brief In this file we define the function prototype used in p2p BSS/IBSS.
|
||||
|
||||
The file contains the function declarations and defines for used in BSS/IBSS.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef _P2P_BSS_H
|
||||
#define _P2P_BSS_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
UINT_32
|
||||
p2pGetTxProbRspIeTableSize(
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,350 +0,0 @@
|
|||
#ifndef _P2P_FUNC_H
|
||||
#define _P2P_FUNC_H
|
||||
|
||||
|
||||
VOID
|
||||
p2pFuncRequestScan(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_SCAN_REQ_INFO_T prScanReqInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncCancelScan(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_SCAN_REQ_INFO_T prScanReqInfo
|
||||
);
|
||||
|
||||
|
||||
|
||||
VOID
|
||||
p2pFuncStartGO(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prBssInfo,
|
||||
IN PUINT_8 pucSsidBuf,
|
||||
IN UINT_8 ucSsidLen,
|
||||
IN UINT_8 ucChannelNum,
|
||||
IN ENUM_BAND_T eBand,
|
||||
IN ENUM_CHNL_EXT_T eSco,
|
||||
IN BOOLEAN fgIsPureAP
|
||||
);
|
||||
|
||||
|
||||
|
||||
VOID
|
||||
p2pFuncAcquireCh(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
p2pFuncReleaseCh(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncSetChannel(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_RF_CHANNEL_INFO_T prRfChannelInfo
|
||||
);
|
||||
|
||||
|
||||
BOOLEAN
|
||||
p2pFuncRetryJOIN(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN P_P2P_JOIN_INFO_T prJoinInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncUpdateBssInfoForJOIN (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN P_SW_RFB_T prAssocRspSwRfb
|
||||
);
|
||||
|
||||
|
||||
WLAN_STATUS
|
||||
p2pFuncTxMgmtFrame(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_MGMT_TX_REQ_INFO_T prMgmtTxReqInfo,
|
||||
IN P_MSDU_INFO_T prMgmtTxMsdu,
|
||||
IN UINT_64 u8Cookie
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
p2pFuncBeaconUpdate(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
IN P_P2P_BEACON_UPDATE_INFO_T prBcnUpdateInfo,
|
||||
IN PUINT_8 pucNewBcnHdr,
|
||||
IN UINT_32 u4NewHdrLen,
|
||||
IN PUINT_8 pucNewBcnBody,
|
||||
IN UINT_32 u4NewBodyLen
|
||||
);
|
||||
|
||||
|
||||
BOOLEAN
|
||||
p2pFuncValidateAuth(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN PP_STA_RECORD_T pprStaRec,
|
||||
OUT PUINT_16 pu2StatusCode
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
p2pFuncValidateAssocReq(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
OUT PUINT_16 pu2StatusCode
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
p2pFuncResetStaRecStatus(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncInitConnectionSettings(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_CONNECTION_SETTINGS_T prP2PConnSettings
|
||||
);
|
||||
|
||||
|
||||
BOOLEAN
|
||||
p2pFuncParseCheckForP2PInfoElem(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PUINT_8 pucBuf,
|
||||
OUT PUINT_8 pucOuiType
|
||||
);
|
||||
|
||||
|
||||
BOOLEAN
|
||||
p2pFuncValidateProbeReq(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
OUT PUINT_32 pu4ControlFlags
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncValidateRxActionFrame(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
p2pFuncIsAPMode(
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
p2pFuncParseBeaconContent(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
IN PUINT_8 pucIEInfo,
|
||||
IN UINT_32 u4IELen
|
||||
);
|
||||
|
||||
|
||||
P_BSS_DESC_T
|
||||
p2pFuncKeepOnConnection(
|
||||
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo,
|
||||
IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo,
|
||||
IN P_P2P_SCAN_REQ_INFO_T prScanReqInfo
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
p2pFuncStoreAssocRspIEBuffer(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
p2pFuncMgmtFrameRegister(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_16 u2FrameType,
|
||||
IN BOOLEAN fgIsRegistered,
|
||||
OUT PUINT_32 pu4P2pPacketFilter
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncUpdateMgmtFrameRegister(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4OsFilter
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
p2pFuncGetStationInfo(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PUINT_8 pucMacAddr,
|
||||
OUT P_P2P_STATION_INFO_T prStaInfo
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
p2pFuncGetAttriList(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucOuiType,
|
||||
IN PUINT_8 pucIE,
|
||||
IN UINT_16 u2IELength,
|
||||
OUT PPUINT_8 ppucAttriList,
|
||||
OUT PUINT_16 pu2AttriListLen
|
||||
);
|
||||
|
||||
P_MSDU_INFO_T
|
||||
p2pFuncProcessP2pProbeRsp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMgmtTxMsdu
|
||||
);
|
||||
|
||||
#if 0 //LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
|
||||
UINT_32
|
||||
p2pFuncCalculateExtra_IELenForBeacon(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncGenerateExtra_IEForBeacon(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
|
||||
#else
|
||||
UINT_32
|
||||
p2pFuncCalculateP2p_IELenForBeacon(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
p2pFuncGenerateP2p_IEForBeacon(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
|
||||
UINT_32
|
||||
p2pFuncCalculateWSC_IELenForBeacon(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncGenerateWSC_IEForBeacon(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
#endif
|
||||
UINT_32
|
||||
p2pFuncCalculateP2p_IELenForAssocRsp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncGenerateP2p_IEForAssocRsp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
|
||||
UINT_32
|
||||
p2pFuncCalculateWSC_IELenForAssocRsp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncGenerateWSC_IEForAssocRsp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
|
||||
|
||||
UINT_32
|
||||
p2pFuncCalculateP2P_IELen(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN APPEND_VAR_ATTRI_ENTRY_T arAppendAttriTable[],
|
||||
IN UINT_32 u4AttriTableSize
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncGenerateP2P_IE(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize,
|
||||
IN APPEND_VAR_ATTRI_ENTRY_T arAppendAttriTable[],
|
||||
IN UINT_32 u4AttriTableSize
|
||||
);
|
||||
|
||||
|
||||
UINT_32
|
||||
p2pFuncAppendAttriStatusForAssocRsp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
);
|
||||
|
||||
|
||||
UINT_32
|
||||
p2pFuncAppendAttriExtListenTiming(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pFuncDissolve(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
IN BOOLEAN fgSendDeauth,
|
||||
IN UINT_16 u2ReasonCode
|
||||
);
|
||||
|
||||
|
||||
P_IE_HDR_T
|
||||
p2pFuncGetSpecIE(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PUINT_8 pucIEBuf,
|
||||
IN UINT_16 u2BufferLen,
|
||||
IN UINT_8 ucElemID,
|
||||
IN PBOOLEAN pfgIsMore
|
||||
);
|
||||
|
||||
|
||||
P_ATTRIBUTE_HDR_T
|
||||
p2pFuncGetSpecAttri(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucOuiType,
|
||||
IN PUINT_8 pucIEBuf,
|
||||
IN UINT_16 u2BufferLen,
|
||||
IN UINT_16 u2AttriID
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,232 +0,0 @@
|
|||
#ifndef _P2P_IE_H
|
||||
#define _P2P_IE_H
|
||||
|
||||
#if CFG_SUPPORT_WFD
|
||||
|
||||
#define ELEM_MAX_LEN_WFD 62 // TODO: Move to appropriate place
|
||||
|
||||
|
||||
/*---------------- WFD Data Element Definitions ----------------*/
|
||||
/* WFD 4.1.1 - WFD IE format */
|
||||
#define WFD_OUI_TYPE_LEN 4
|
||||
#define WFD_IE_OUI_HDR (ELEM_HDR_LEN + WFD_OUI_TYPE_LEN) /* == OFFSET_OF(IE_P2P_T, aucP2PAttributes[0]) */
|
||||
|
||||
/* WFD 4.1.1 - General WFD Attribute */
|
||||
#define WFD_ATTRI_HDR_LEN 3 /* ID(1 octet) + Length(2 octets) */
|
||||
|
||||
/* WFD Attribute Code */
|
||||
#define WFD_ATTRI_ID_DEV_INFO 0
|
||||
#define WFD_ATTRI_ID_ASSOC_BSSID 1
|
||||
#define WFD_ATTRI_ID_COUPLED_SINK_INFO 6
|
||||
#define WFD_ATTRI_ID_EXT_CAPABILITY 7
|
||||
#define WFD_ATTRI_ID_SESSION_INFO 9
|
||||
#define WFD_ATTRI_ID_ALTER_MAC_ADDRESS 10
|
||||
|
||||
/* Maximum Length of WFD Attributes */
|
||||
#define WFD_ATTRI_MAX_LEN_DEV_INFO 6 /* 0 */
|
||||
#define WFD_ATTRI_MAX_LEN_ASSOC_BSSID 6 /* 1 */
|
||||
#define WFD_ATTRI_MAX_LEN_COUPLED_SINK_INFO 7 /* 6 */
|
||||
#define WFD_ATTRI_MAX_LEN_EXT_CAPABILITY 2 /* 7 */
|
||||
#define WFD_ATTRI_MAX_LEN_SESSION_INFO 0 /* 9 */ /* 24 * #Clients */
|
||||
#define WFD_ATTRI_MAX_LEN_ALTER_MAC_ADDRESS 6 /* 10 */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* WFD 1.10 5.1.1 */
|
||||
typedef struct _IE_WFD_T {
|
||||
UINT_8 ucId; /* Element ID */
|
||||
UINT_8 ucLength; /* Length */
|
||||
UINT_8 aucOui[3]; /* OUI */
|
||||
UINT_8 ucOuiType; /* OUI Type */
|
||||
UINT_8 aucWFDAttributes[1]; /* WFD Subelement */
|
||||
} __KAL_ATTRIB_PACKED__ IE_WFD_T, *P_IE_WFD_T;
|
||||
|
||||
typedef struct _WFD_ATTRIBUTE_T {
|
||||
UINT_8 ucElemID; /* Subelement ID */
|
||||
UINT_16 u2Length; /* Length */
|
||||
UINT_8 aucBody[1]; /* Body field */
|
||||
} __KAL_ATTRIB_PACKED__ WFD_ATTRIBUTE_T, *P_WFD_ATTRIBUTE_T;
|
||||
|
||||
typedef struct _WFD_DEVICE_INFORMATION_IE_T {
|
||||
UINT_8 ucElemID;
|
||||
UINT_16 u2Length;
|
||||
UINT_16 u2WfdDevInfo;
|
||||
UINT_16 u2SessionMgmtCtrlPort;
|
||||
UINT_16 u2WfdDevMaxSpeed;
|
||||
} __KAL_ATTRIB_PACKED__ WFD_DEVICE_INFORMATION_IE_T, *P_WFD_DEVICE_INFORMATION_IE_T;
|
||||
|
||||
typedef struct _WFD_ASSOCIATED_BSSID_IE_T {
|
||||
UINT_8 ucElemID;
|
||||
UINT_16 u2Length;
|
||||
UINT_8 aucAssocBssid[MAC_ADDR_LEN];
|
||||
} __KAL_ATTRIB_PACKED__ WFD_ASSOCIATED_BSSID_IE_T, *P_WFD_ASSOCIATED_BSSID_IE_T;
|
||||
|
||||
typedef struct _WFD_COUPLE_SINK_INFORMATION_IE_T {
|
||||
UINT_8 ucElemID;
|
||||
UINT_16 u2Length;
|
||||
UINT_8 ucCoupleSinkStatusBp;
|
||||
UINT_8 aucCoupleSinkMac[MAC_ADDR_LEN];
|
||||
} __KAL_ATTRIB_PACKED__ WFD_COUPLE_SINK_INFORMATION_IE_T, *P_WFD_COUPLE_SINK_INFORMATION_IE_T;
|
||||
|
||||
typedef struct _WFD_EXTENDED_CAPABILITY_IE_T {
|
||||
UINT_8 ucElemID;
|
||||
UINT_16 u2Length;
|
||||
UINT_16 u2WfdExtCapabilityBp;
|
||||
}
|
||||
__KAL_ATTRIB_PACKED__ WFD_EXTENDED_CAPABILITY_IE_T, *P_WFD_EXTENDED_CAPABILITY_IE_T;
|
||||
|
||||
typedef struct _WFD_SESSION_INFORMATION_IE_T {
|
||||
UINT_8 ucElemID;
|
||||
UINT_16 u2Length;
|
||||
PUINT_8 pucWfdDevInfoDesc[1];
|
||||
} __KAL_ATTRIB_PACKED__ WFD_SESSION_INFORMATION_IE_T, *P_WFD_SESSION_INFORMATION_IE_T;
|
||||
|
||||
typedef struct _WFD_DEVICE_INFORMATION_DESCRIPTOR_T {
|
||||
UINT_8 ucLength;
|
||||
UINT_8 aucDevAddr[MAC_ADDR_LEN];
|
||||
UINT_8 aucAssocBssid[MAC_ADDR_LEN];
|
||||
UINT_16 u2WfdDevInfo;
|
||||
UINT_16 u2WfdDevMaxSpeed;
|
||||
UINT_8 ucCoupleSinkStatusBp;
|
||||
UINT_8 aucCoupleSinkMac[MAC_ADDR_LEN];
|
||||
} __KAL_ATTRIB_PACKED__ WFD_DEVICE_INFORMATION_DESCRIPTOR_T, *P_WFD_DEVICE_INFORMATION_DESCRIPTOR_T;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
UINT_32
|
||||
p2pCalculate_IEForAssocReq(
|
||||
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
p2pGenerate_IEForAssocReq(
|
||||
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
|
||||
#if CFG_SUPPORT_WFD
|
||||
|
||||
UINT_32
|
||||
wfdFuncAppendAttriDevInfo(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
);
|
||||
|
||||
UINT_32
|
||||
wfdFuncAppendAttriAssocBssid(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
);
|
||||
|
||||
UINT_32
|
||||
wfdFuncAppendAttriCoupledSinkInfo(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
);
|
||||
|
||||
UINT_32
|
||||
wfdFuncAppendAttriExtCapability(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
);
|
||||
|
||||
UINT_32
|
||||
wfdFuncCalculateAttriLenSessionInfo(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
UINT_32
|
||||
wfdFuncAppendAttriSessionInfo(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
);
|
||||
|
||||
UINT_32
|
||||
wfdFuncCalculateWfdIELenForProbeResp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
wfdFuncGenerateWfdIEForProbeResp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
|
||||
UINT_32
|
||||
wfdFuncCalculateWfdIELenForAssocReq(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
wfdFuncGenerateWfdIEForAssocReq(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
UINT_32
|
||||
wfdFuncCalculateWfdIELenForAssocRsp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
wfdFuncGenerateWfdIEForAssocRsp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
|
||||
UINT_32
|
||||
wfdFuncCalculateWfdIELenForBeacon(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
wfdFuncGenerateWfdIEForBeacon(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,109 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/mgmt/p2p_rlm.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "rlm.h"
|
||||
\brief
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef _P2P_RLM_H
|
||||
#define _P2P_RLM_H
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
VOID
|
||||
rlmBssInitForAP(
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rlmUpdateBwByChListForAP (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmUpdateParamsForAP (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo,
|
||||
BOOLEAN fgUpdateBeacon
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmFuncInitialChannelList(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmFuncCommonChannelList(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CHANNEL_ENTRY_FIELD_T prChannelEntryII,
|
||||
IN UINT_8 ucChannelListSize
|
||||
);
|
||||
|
||||
UINT_8
|
||||
rlmFuncFindOperatingClass(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucChannelNum
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rlmFuncFindAvailableChannel(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucCheckChnl,
|
||||
IN PUINT_8 pucSuggestChannel,
|
||||
IN BOOLEAN fgIsSocialChannel,
|
||||
IN BOOLEAN fgIsDefaultChannel
|
||||
);
|
||||
|
||||
ENUM_CHNL_EXT_T
|
||||
rlmDecideScoForAP (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/mgmt/p2p_rlm_obss.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "rlm_obss.h"
|
||||
\brief
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef _P2P_RLM_OBSS_H
|
||||
#define _P2P_RLM_OBSS_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
VOID
|
||||
rlmRspGenerateObssScanIE (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmProcessPublicAction (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmProcessHtAction (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmHandleObssStatusEventPkt (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_EVENT_AP_OBSS_STATUS_T prObssStatus
|
||||
);
|
||||
|
||||
UINT_8
|
||||
rlmObssChnlLevel (
|
||||
P_BSS_INFO_T prBssInfo,
|
||||
ENUM_BAND_T eBand,
|
||||
UINT_8 ucPriChannel,
|
||||
ENUM_CHNL_EXT_T eExtend
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmObssScanExemptionRsp (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo,
|
||||
P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/mgmt/p2p_scan.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "scan.h"
|
||||
\brief
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef _P2P_SCAN_H
|
||||
#define _P2P_SCAN_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
WLAN_STATUS
|
||||
scanSendDeviceDiscoverEvent (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
P_P2P_DEVICE_DESC_T
|
||||
scanSearchTargetP2pDesc(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucDeviceID[],
|
||||
IN PP_BSS_DESC_T pprBssDesc
|
||||
);
|
||||
|
||||
P_P2P_DEVICE_DESC_T
|
||||
scanFindP2pDeviceDesc(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc,
|
||||
IN UINT_8 aucMacAddr[],
|
||||
IN BOOLEAN fgIsDeviceAddr,
|
||||
IN BOOLEAN fgAddIfNoFound
|
||||
);
|
||||
|
||||
P_P2P_DEVICE_DESC_T
|
||||
scanGetP2pDeviceDesc(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
VOID
|
||||
scnEventReturnChannel(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucScnSeqNum
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
scanUpdateP2pDeviceDesc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
VOID
|
||||
scanP2pProcessBeaconAndProbeResp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN P_WLAN_STATUS prStatus,
|
||||
IN P_BSS_DESC_T prBssDesc,
|
||||
IN P_WLAN_BEACON_FRAME_T prWlanBeaconFrame
|
||||
);
|
||||
|
||||
VOID
|
||||
scanRemoveAllP2pBssDesc(
|
||||
P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
scanRemoveP2pBssDesc(
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
|
||||
P_BSS_DESC_T
|
||||
scanP2pSearchDesc(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
IN P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo
|
||||
);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
#ifndef _P2P_STATE_H
|
||||
#define _P2P_STATE_H
|
||||
|
||||
BOOLEAN
|
||||
p2pStateInit_IDLE(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
OUT P_ENUM_P2P_STATE_T peNextState
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateAbort_IDLE(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pStateInit_SCAN(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pStateAbort_SCAN(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pStateInit_AP_CHANNEL_DETECT(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pStateAbort_AP_CHANNEL_DETECT(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pStateInit_CHNL_ON_HAND(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pStateAbort_CHNL_ON_HAND(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateAbort_REQING_CHANNEL(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateInit_GC_JOIN(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
IN P_P2P_JOIN_INFO_T prJoinInfo,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
VOID
|
||||
p2pStateAbort_GC_JOIN(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN P_P2P_JOIN_INFO_T prJoinInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,288 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/privacy.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file privacy.h
|
||||
\brief This file contains the function declaration for privacy.c.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: privacy.h $
|
||||
*
|
||||
* 07 24 2010 wh.su
|
||||
*
|
||||
* .support the Wi-Fi RSN
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 21 2010 wh.su
|
||||
* [WPD00003840][MT6620 5931] Security migration
|
||||
* modify some code for concurrent network.
|
||||
*
|
||||
* 06 19 2010 wh.su
|
||||
* [WPD00003840][MT6620 5931] Security migration
|
||||
* consdier the concurrent network setting.
|
||||
*
|
||||
* 06 18 2010 wh.su
|
||||
* [WPD00003840][MT6620 5931] Security migration
|
||||
* migration the security related function from firmware.
|
||||
*
|
||||
* 03 01 2010 wh.su
|
||||
* [BORA00000605][WIFISYS] Phase3 Integration
|
||||
* Refine the variable and parameter for security.
|
||||
*
|
||||
* 02 25 2010 wh.su
|
||||
* [BORA00000626][MT6620] Refine the remove key flow for WHQL testing
|
||||
* For support the WHQL test, do the remove key code refine.
|
||||
*
|
||||
* Dec 10 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* change the cmd return type
|
||||
*
|
||||
* Dec 8 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the function declaration for auth mode and encryption status setting from build connection command
|
||||
*
|
||||
* Dec 7 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the function declaration for wapi
|
||||
*
|
||||
* Dec 7 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the tx done callback handle function
|
||||
*
|
||||
* Dec 7 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the function declaration for mac header privacy bit setting
|
||||
*
|
||||
* Dec 4 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the structure for parsing the EAPoL frame
|
||||
*
|
||||
* Dec 3 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adjust the class error function parameter
|
||||
*
|
||||
* Dec 1 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding some security function declaration
|
||||
*
|
||||
* Nov 19 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the ap selection structure
|
||||
*
|
||||
* Nov 18 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
*
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _PRIVACY_H
|
||||
#define _PRIVACY_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define MAX_KEY_NUM 4
|
||||
#define WEP_40_LEN 5
|
||||
#define WEP_104_LEN 13
|
||||
#define LEGACY_KEY_MAX_LEN 16
|
||||
#define CCMP_KEY_LEN 16
|
||||
#define TKIP_KEY_LEN 32
|
||||
#define MAX_KEY_LEN 32
|
||||
#define MIC_RX_KEY_OFFSET 16
|
||||
#define MIC_TX_KEY_OFFSET 24
|
||||
#define MIC_KEY_LEN 8
|
||||
|
||||
#define WEP_KEY_ID_FIELD BITS(0,29)
|
||||
#define KEY_ID_FIELD BITS(0,7)
|
||||
|
||||
#define IS_TRANSMIT_KEY BIT(31)
|
||||
#define IS_UNICAST_KEY BIT(30)
|
||||
#define IS_AUTHENTICATOR BIT(28)
|
||||
|
||||
#define CIPHER_SUITE_NONE 0
|
||||
#define CIPHER_SUITE_WEP40 1
|
||||
#define CIPHER_SUITE_TKIP 2
|
||||
#define CIPHER_SUITE_TKIP_WO_MIC 3
|
||||
#define CIPHER_SUITE_CCMP 4
|
||||
#define CIPHER_SUITE_WEP104 5
|
||||
#define CIPHER_SUITE_BIP 6
|
||||
#define CIPHER_SUITE_WEP128 7
|
||||
#define CIPHER_SUITE_WPI 8
|
||||
|
||||
#define WPA_KEY_INFO_KEY_TYPE BIT(3) /* 1 = Pairwise, 0 = Group key */
|
||||
#define WPA_KEY_INFO_MIC BIT(8)
|
||||
#define WPA_KEY_INFO_SECURE BIT(9)
|
||||
|
||||
#define MASK_2ND_EAPOL (WPA_KEY_INFO_KEY_TYPE | WPA_KEY_INFO_MIC)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
typedef struct _IEEE_802_1X_HDR {
|
||||
UINT_8 ucVersion;
|
||||
UINT_8 ucType;
|
||||
UINT_16 u2Length;
|
||||
/* followed by length octets of data */
|
||||
} IEEE_802_1X_HDR, *P_IEEE_802_1X_HDR;
|
||||
|
||||
typedef struct _EAPOL_KEY {
|
||||
UINT_8 ucType;
|
||||
/* Note: key_info, key_length, and key_data_length are unaligned */
|
||||
UINT_8 aucKeyInfo[2]; /* big endian */
|
||||
UINT_8 aucKeyLength[2]; /* big endian */
|
||||
UINT_8 aucReplayCounter[8];
|
||||
UINT_8 aucKeyNonce[16];
|
||||
UINT_8 aucKeyIv[16];
|
||||
UINT_8 aucKeyRsc[8];
|
||||
UINT_8 aucKeyId[8]; /* Reserved in IEEE 802.11i/RSN */
|
||||
UINT_8 aucKeyMic[16];
|
||||
UINT_8 aucKeyDataLength[2]; /* big endian */
|
||||
/* followed by key_data_length bytes of key_data */
|
||||
} EAPOL_KEY, *P_EAPOL_KEY;
|
||||
|
||||
/* WPA2 PMKID candicate structure */
|
||||
typedef struct _PMKID_CANDICATE_T {
|
||||
UINT_8 aucBssid[MAC_ADDR_LEN];
|
||||
UINT_32 u4PreAuthFlags;
|
||||
} PMKID_CANDICATE_T, *P_PMKID_CANDICATE_T;
|
||||
|
||||
#if 0
|
||||
/* WPA2 PMKID cache structure */
|
||||
typedef struct _PMKID_ENTRY_T {
|
||||
PARAM_BSSID_INFO_T rBssidInfo;
|
||||
BOOLEAN fgPmkidExist;
|
||||
} PMKID_ENTRY_T, *P_PMKID_ENTRY_T;
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
VOID
|
||||
secInit(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucNetTypeIdx
|
||||
);
|
||||
|
||||
VOID
|
||||
secSetPortBlocked(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prSta,
|
||||
IN BOOLEAN fgPort
|
||||
);
|
||||
|
||||
BOOL
|
||||
secCheckClassError(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
BOOL
|
||||
secTxPortControlCheck(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
secRxPortControlCheck(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSWRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
secSetCipherSuite(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4CipherSuitesFlags
|
||||
);
|
||||
|
||||
BOOL
|
||||
secProcessEAPOL(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN PUINT_8 pucPayload,
|
||||
IN UINT_16 u2PayloadLen
|
||||
);
|
||||
|
||||
VOID
|
||||
secHandleTxDoneCallback(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T pMsduInfo,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN WLAN_STATUS rStatus
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
secIsProtectedFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsdu,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
VOID
|
||||
secClearPmkid(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
secRsnKeyHandshakeEnabled(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
secTransmitKeyExist(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prSta
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
secEnabledInAis(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _PRIVACY_H */
|
||||
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rate.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file rate.h
|
||||
\brief This file contains the rate utility function of
|
||||
IEEE 802.11 family for MediaTek 802.11 Wireless LAN Adapters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: rate.h $
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add buildable & linkable ais_fsm.c
|
||||
*
|
||||
* related reference are still waiting to be resolved
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _RATE_H
|
||||
#define _RATE_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines in rate.c */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
rateGetRateSetFromIEs (
|
||||
IN P_IE_SUPPORTED_RATE_T prIeSupportedRate,
|
||||
IN P_IE_EXT_SUPPORTED_RATE_T prIeExtSupportedRate,
|
||||
OUT PUINT_16 pu2OperationalRateSet,
|
||||
OUT PUINT_16 pu2BSSBasicRateSet,
|
||||
OUT PBOOLEAN pfgIsUnknownBSSBasicRate
|
||||
);
|
||||
|
||||
VOID
|
||||
rateGetDataRatesFromRateSet (
|
||||
IN UINT_16 u2OperationalRateSet,
|
||||
IN UINT_16 u2BSSBasicRateSet,
|
||||
OUT PUINT_8 pucDataRates,
|
||||
OUT PUINT_8 pucDataRatesLen
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rateGetHighestRateIndexFromRateSet (
|
||||
IN UINT_16 u2RateSet,
|
||||
OUT PUINT_8 pucHighestRateIndex
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rateGetLowestRateIndexFromRateSet (
|
||||
IN UINT_16 u2RateSet,
|
||||
OUT PUINT_8 pucLowestRateIndex
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _RATE_H */
|
||||
|
||||
|
|
@ -1,464 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rlm.h#2 $
|
||||
*/
|
||||
|
||||
/*! \file "rlm.h"
|
||||
\brief
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: rlm.h $
|
||||
*
|
||||
* 07 17 2012 yuche.tsai
|
||||
* NULL
|
||||
* Compile no error before trial run.
|
||||
*
|
||||
* 09 30 2011 cm.chang
|
||||
* [WCXRP00001020] [MT6620 Wi-Fi][Driver] Handle secondary channel offset of AP in 5GHz band
|
||||
* .
|
||||
*
|
||||
* 04 12 2011 cm.chang
|
||||
* [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency
|
||||
* .
|
||||
*
|
||||
* 01 13 2011 cm.chang
|
||||
* [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module
|
||||
* Refine function when rcv a 20/40M public action frame
|
||||
*
|
||||
* 01 13 2011 cm.chang
|
||||
* [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting
|
||||
* Use SCO of BSS_INFO to replace user-defined setting variables
|
||||
*
|
||||
* 01 12 2011 cm.chang
|
||||
* [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting
|
||||
* User-defined bandwidth is for 2.4G and 5G individually
|
||||
*
|
||||
* 12 07 2010 cm.chang
|
||||
* [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk
|
||||
* 1. BSSINFO include RLM parameter
|
||||
* 2. free all sta records when network is disconnected
|
||||
*
|
||||
* 12 07 2010 cm.chang
|
||||
* [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant
|
||||
* 1. Country code is from NVRAM or supplicant
|
||||
* 2. Change band definition in CMD/EVENT.
|
||||
*
|
||||
* 10 18 2010 cm.chang
|
||||
* [WCXRP00000114] [MT6620 Wi-Fi] [Driver] Fix compiling warning in Linux about RLM network index checking
|
||||
* Enum member cannot be used as compiling option decision in Linux
|
||||
*
|
||||
* 09 10 2010 cm.chang
|
||||
* NULL
|
||||
* Always update Beacon content if FW sync OBSS info
|
||||
*
|
||||
* 08 31 2010 kevin.huang
|
||||
* NULL
|
||||
* Use LINK LIST operation to process SCAN result
|
||||
*
|
||||
* 08 24 2010 cm.chang
|
||||
* NULL
|
||||
* Support RLM initail channel of Ad-hoc, P2P and BOW
|
||||
*
|
||||
* 08 23 2010 chinghwa.yu
|
||||
* NULL
|
||||
* Update for BOW.
|
||||
*
|
||||
* 08 20 2010 cm.chang
|
||||
* NULL
|
||||
* Migrate RLM code to host from FW
|
||||
*
|
||||
* 08 16 2010 cp.wu
|
||||
* NULL
|
||||
* Replace CFG_SUPPORT_BOW by CFG_ENABLE_BT_OVER_WIFI.
|
||||
* There is no CFG_SUPPORT_BOW in driver domain source.
|
||||
*
|
||||
* 08 02 2010 yuche.tsai
|
||||
* NULL
|
||||
* P2P Group Negotiation Code Check in.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 08 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Check draft RLM code for HT cap
|
||||
*
|
||||
* 06 28 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* 1st draft code for RLM module
|
||||
*
|
||||
* 06 02 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Add RX HT GF compiling option
|
||||
*
|
||||
* 06 02 2010 chinghwa.yu
|
||||
* [BORA00000563]Add WiFi CoEx BCM module
|
||||
* Roll back to remove CFG_SUPPORT_BCM_TEST.
|
||||
*
|
||||
* 06 01 2010 chinghwa.yu
|
||||
* [BORA00000563]Add WiFi CoEx BCM module
|
||||
* Update BCM Test and RW configuration.
|
||||
*
|
||||
* 05 31 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Add some compiling options to control 11n functions
|
||||
*
|
||||
* 05 18 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Ad-hoc Beacon should not carry HT OP and OBSS IEs
|
||||
*
|
||||
* 05 17 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* MT6620 does not support L-SIG TXOP
|
||||
*
|
||||
* 05 05 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* First draft support for 20/40M bandwidth for AP mode
|
||||
*
|
||||
* 04 24 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW
|
||||
*
|
||||
* 04 22 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* First draft code to support protection in AP mode
|
||||
*
|
||||
* 04 07 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Different invoking order for WTBL entry of associated AP
|
||||
*
|
||||
* 03 24 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Not carry HT cap when being associated with b/g only AP
|
||||
*
|
||||
* 03 03 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Move default value of HT capability to rlm.h
|
||||
*
|
||||
* 02 12 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Use bss info array for concurrent handle
|
||||
*
|
||||
* 01 22 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support protection and bandwidth switch
|
||||
*
|
||||
* 01 08 2010 kevin.huang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
* Modify the prototype of rlmRecAssocRspHtInfo()
|
||||
*
|
||||
* Dec 9 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add several function prototypes for HT operation
|
||||
*
|
||||
* Nov 18 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
*
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _RLM_H
|
||||
#define _RLM_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define ELEM_EXT_CAP_DEFAULT_VAL \
|
||||
(ELEM_EXT_CAP_20_40_COEXIST_SUPPORT /*| ELEM_EXT_CAP_PSMP_CAP*/)
|
||||
|
||||
|
||||
#if CFG_SUPPORT_RX_STBC
|
||||
#define FIELD_HT_CAP_INFO_RX_STBC HT_CAP_INFO_RX_STBC_1_SS
|
||||
#else
|
||||
#define FIELD_HT_CAP_INFO_RX_STBC HT_CAP_INFO_RX_STBC_NO_SUPPORTED
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_RX_SGI
|
||||
#define FIELD_HT_CAP_INFO_SGI_20M HT_CAP_INFO_SHORT_GI_20M
|
||||
#define FIELD_HT_CAP_INFO_SGI_40M HT_CAP_INFO_SHORT_GI_40M
|
||||
#else
|
||||
#define FIELD_HT_CAP_INFO_SGI_20M 0
|
||||
#define FIELD_HT_CAP_INFO_SGI_40M 0
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_RX_HT_GF
|
||||
#define FIELD_HT_CAP_INFO_HT_GF HT_CAP_INFO_HT_GF
|
||||
#else
|
||||
#define FIELD_HT_CAP_INFO_HT_GF 0
|
||||
#endif
|
||||
|
||||
#define HT_CAP_INFO_DEFAULT_VAL \
|
||||
(HT_CAP_INFO_SUP_CHNL_WIDTH | FIELD_HT_CAP_INFO_HT_GF | \
|
||||
FIELD_HT_CAP_INFO_SGI_20M | FIELD_HT_CAP_INFO_SGI_40M | \
|
||||
FIELD_HT_CAP_INFO_RX_STBC | HT_CAP_INFO_DSSS_CCK_IN_40M)
|
||||
|
||||
|
||||
|
||||
#define AMPDU_PARAM_DEFAULT_VAL \
|
||||
(AMPDU_PARAM_MAX_AMPDU_LEN_64K | AMPDU_PARAM_MSS_NO_RESTRICIT)
|
||||
|
||||
|
||||
#define SUP_MCS_TX_DEFAULT_VAL \
|
||||
SUP_MCS_TX_SET_DEFINED /* TX defined and TX/RX equal (TBD) */
|
||||
|
||||
#if CFG_SUPPORT_MFB
|
||||
#define FIELD_HT_EXT_CAP_MFB HT_EXT_CAP_MCS_FEEDBACK_BOTH
|
||||
#else
|
||||
#define FIELD_HT_EXT_CAP_MFB HT_EXT_CAP_MCS_FEEDBACK_NO_FB
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_RX_RDG
|
||||
#define FIELD_HT_EXT_CAP_RDR HT_EXT_CAP_RD_RESPONDER
|
||||
#else
|
||||
#define FIELD_HT_EXT_CAP_RDR 0
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_MFB || CFG_SUPPORT_RX_RDG
|
||||
#define FIELD_HT_EXT_CAP_HTC HT_EXT_CAP_HTC_SUPPORT
|
||||
#else
|
||||
#define FIELD_HT_EXT_CAP_HTC 0
|
||||
#endif
|
||||
|
||||
#define HT_EXT_CAP_DEFAULT_VAL \
|
||||
(HT_EXT_CAP_PCO | HT_EXT_CAP_PCO_TRANS_TIME_NONE | \
|
||||
FIELD_HT_EXT_CAP_MFB | FIELD_HT_EXT_CAP_HTC | \
|
||||
FIELD_HT_EXT_CAP_RDR)
|
||||
|
||||
#define TX_BEAMFORMING_CAP_DEFAULT_VAL 0
|
||||
#define ASEL_CAP_DEFAULT_VAL 0
|
||||
|
||||
|
||||
/* Define bandwidth from user setting */
|
||||
#define CONFIG_BW_20_40M 0
|
||||
#define CONFIG_BW_20M 1 /* 20MHz only */
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/* It is used for RLM module to judge if specific network is valid
|
||||
* Note: Ad-hoc mode of AIS is not included now. (TBD)
|
||||
*/
|
||||
#define RLM_NET_PARAM_VALID(_prBssInfo) \
|
||||
(IS_BSS_ACTIVE(_prBssInfo) && \
|
||||
((_prBssInfo)->eConnectionState == PARAM_MEDIA_STATE_CONNECTED || \
|
||||
(_prBssInfo)->eCurrentOPMode == OP_MODE_ACCESS_POINT || \
|
||||
(_prBssInfo)->eCurrentOPMode == OP_MODE_IBSS || \
|
||||
RLM_NET_IS_BOW(_prBssInfo)) \
|
||||
)
|
||||
|
||||
#define RLM_NET_IS_11N(_prBssInfo) \
|
||||
((_prBssInfo)->ucPhyTypeSet & PHY_TYPE_SET_802_11N)
|
||||
#define RLM_NET_IS_11GN(_prBssInfo) \
|
||||
((_prBssInfo)->ucPhyTypeSet & PHY_TYPE_SET_802_11GN)
|
||||
|
||||
|
||||
/* This macro is used to sweep all 3 networks */
|
||||
#define RLM_NET_FOR_EACH(_ucNetIdx) \
|
||||
for ((_ucNetIdx) = 0; \
|
||||
(_ucNetIdx) < NETWORK_TYPE_INDEX_NUM; \
|
||||
(_ucNetIdx)++)
|
||||
|
||||
/* This macro is used to sweep all networks excluding BOW */
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
/* Note: value of enum NETWORK_TYPE_BOW_INDEX is validated in
|
||||
* rlmStuctureCheck().
|
||||
*/
|
||||
#define RLM_NET_FOR_EACH_NO_BOW(_ucNetIdx) \
|
||||
for ((_ucNetIdx) = 0; \
|
||||
(_ucNetIdx) < NETWORK_TYPE_BOW_INDEX; \
|
||||
(_ucNetIdx)++)
|
||||
|
||||
#define RLM_NET_IS_BOW(_prBssInfo) \
|
||||
((_prBssInfo)->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX)
|
||||
|
||||
#else
|
||||
#define RLM_NET_FOR_EACH_NO_BOW(_ucNetIdx) RLM_NET_FOR_EACH(_ucNetIdx)
|
||||
#define RLM_NET_IS_BOW(_prBssInfo) (FALSE)
|
||||
|
||||
#endif /* end of CFG_ENABLE_BT_OVER_WIFI */
|
||||
|
||||
|
||||
/* The bandwidth modes are not used anymore. They represent if AP
|
||||
* can use 20/40 bandwidth, not all modes. (20110411)
|
||||
*/
|
||||
#define RLM_AP_IS_BW_40_ALLOWED(_prAdapter, _prBssInfo) \
|
||||
(((_prBssInfo)->eBand == BAND_2G4 && \
|
||||
(_prAdapter)->rWifiVar.rConnSettings.uc2G4BandwidthMode \
|
||||
== CONFIG_BW_20_40M) || \
|
||||
((_prBssInfo)->eBand == BAND_5G && \
|
||||
(_prAdapter)->rWifiVar.rConnSettings.uc5GBandwidthMode \
|
||||
== CONFIG_BW_20_40M))
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
VOID
|
||||
rlmFsmEventInit (
|
||||
P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmFsmEventUninit (
|
||||
P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmReqGenerateHtCapIE (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmReqGenerateExtCapIE (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmRspGenerateHtCapIE (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmRspGenerateExtCapIE (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmRspGenerateHtOpIE (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmRspGenerateErpIE (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmProcessBcn (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_SW_RFB_T prSwRfb,
|
||||
PUINT_8 pucIE,
|
||||
UINT_16 u2IELength
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmProcessAssocRsp (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_SW_RFB_T prSwRfb,
|
||||
PUINT_8 pucIE,
|
||||
UINT_16 u2IELength
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmFillSyncCmdParam (
|
||||
P_CMD_SET_BSS_RLM_PARAM_T prCmdBody,
|
||||
P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmSyncOperationParams (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmBssInitForAPandIbss (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmProcessAssocReq (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_SW_RFB_T prSwRfb,
|
||||
PUINT_8 pucIE,
|
||||
UINT_16 u2IELength
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmBssAborted (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
#if CFG_SUPPORT_DFS //add for DFS support
|
||||
VOID
|
||||
rlmProcessSpecMgtAction(
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmProcessChannelSwitchIE(
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_IE_CHANNEL_SWITCH_T prChannelSwitchIE
|
||||
);
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef _lint
|
||||
__KAL_INLINE__ VOID
|
||||
rlmDataTypeCheck (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
NETWORK_TYPE_AIS_INDEX < NETWORK_TYPE_BOW_INDEX);
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
DATA_STRUC_INSPECTING_ASSERT(
|
||||
NETWORK_TYPE_P2P_INDEX < NETWORK_TYPE_BOW_INDEX);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
#endif /* _lint */
|
||||
|
||||
#endif /* _RLM_H */
|
||||
|
||||
|
||||
|
|
@ -1,358 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rlm_domain.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "rlm_domain.h"
|
||||
\brief
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: rlm_domain.h $
|
||||
*
|
||||
* 09 29 2011 cm.chang
|
||||
* NULL
|
||||
* Change the function prototype of rlmDomainGetChnlList()
|
||||
*
|
||||
* 09 08 2011 cm.chang
|
||||
* [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
|
||||
* Use new fields ucChannelListMap and ucChannelListIndex in NVRAM
|
||||
*
|
||||
* 08 31 2011 cm.chang
|
||||
* [WCXRP00000969] [MT6620 Wi-Fi][Driver][FW] Channel list for 5G band based on country code
|
||||
* .
|
||||
*
|
||||
* 06 01 2011 cm.chang
|
||||
* [WCXRP00000756] [MT6620 Wi-Fi][Driver] 1. AIS follow channel of BOW 2. Provide legal channel function
|
||||
* Provide legal channel function based on domain
|
||||
*
|
||||
* 12 07 2010 cm.chang
|
||||
* [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant
|
||||
* 1. Country code is from NVRAM or supplicant
|
||||
* 2. Change band definition in CMD/EVENT.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 28 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* 1st draft code for RLM module
|
||||
*
|
||||
* 02 23 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Add support scan channel 1~14 and update scan result's frequency infou1rwduu`wvpghlqg|n`slk+mpdkb
|
||||
*
|
||||
* 01 13 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Provide query function about full channle list.
|
||||
*
|
||||
* Dec 1 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Declare public rDomainInfo
|
||||
*
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _RLM_DOMAIN_H
|
||||
#define _RLM_DOMAIN_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define MAX_SUBBAND_NUM 6
|
||||
|
||||
|
||||
#define COUNTRY_CODE_NULL ((UINT_16)0x0)
|
||||
|
||||
/* ISO/IEC 3166-1 two-character country codes */
|
||||
#define COUNTRY_CODE_AG (((UINT_16) 'A' << 8) | (UINT_16) 'G') /* Antigua/Barbuda */
|
||||
#define COUNTRY_CODE_AI (((UINT_16) 'A' << 8) | (UINT_16) 'I') /* Anguilla */
|
||||
#define COUNTRY_CODE_AR (((UINT_16) 'A' << 8) | (UINT_16) 'T') /* Argentina */
|
||||
#define COUNTRY_CODE_AT (((UINT_16) 'A' << 8) | (UINT_16) 'T') /* Austria */
|
||||
#define COUNTRY_CODE_AU (((UINT_16) 'A' << 8) | (UINT_16) 'U') /* Australia */
|
||||
#define COUNTRY_CODE_AW (((UINT_16) 'A' << 8) | (UINT_16) 'W') /* Aruba */
|
||||
#define COUNTRY_CODE_BB (((UINT_16) 'B' << 8) | (UINT_16) 'B') /* Barbados */
|
||||
#define COUNTRY_CODE_BE (((UINT_16) 'B' << 8) | (UINT_16) 'E') /* Belgium */
|
||||
#define COUNTRY_CODE_BM (((UINT_16) 'B' << 8) | (UINT_16) 'M') /* Bermuda */
|
||||
#define COUNTRY_CODE_BO (((UINT_16) 'B' << 8) | (UINT_16) 'O') /* Bolivia */
|
||||
#define COUNTRY_CODE_BR (((UINT_16) 'B' << 8) | (UINT_16) 'R') /* Brazil */
|
||||
#define COUNTRY_CODE_BS (((UINT_16) 'B' << 8) | (UINT_16) 'S') /* Bahamas */
|
||||
#define COUNTRY_CODE_BY (((UINT_16) 'B' << 8) | (UINT_16) 'Y') /* Belarus */
|
||||
#define COUNTRY_CODE_CA (((UINT_16) 'C' << 8) | (UINT_16) 'A') /* Canada */
|
||||
#define COUNTRY_CODE_CH (((UINT_16) 'C' << 8) | (UINT_16) 'H') /* Switzerland */
|
||||
#define COUNTRY_CODE_CL (((UINT_16) 'C' << 8) | (UINT_16) 'L') /* Chile */
|
||||
#define COUNTRY_CODE_CN (((UINT_16) 'C' << 8) | (UINT_16) 'N') /* China */
|
||||
#define COUNTRY_CODE_CO (((UINT_16) 'C' << 8) | (UINT_16) 'O') /* Colombia */
|
||||
#define COUNTRY_CODE_CR (((UINT_16) 'C' << 8) | (UINT_16) 'R') /* Costa Rica */
|
||||
#define COUNTRY_CODE_CU (((UINT_16) 'C' << 8) | (UINT_16) 'U') /* Cuba */
|
||||
#define COUNTRY_CODE_DE (((UINT_16) 'D' << 8) | (UINT_16) 'E') /* Germany */
|
||||
#define COUNTRY_CODE_DK (((UINT_16) 'D' << 8) | (UINT_16) 'K') /* Denmark */
|
||||
#define COUNTRY_CODE_DM (((UINT_16) 'D' << 8) | (UINT_16) 'M') /* Dominica */
|
||||
#define COUNTRY_CODE_DO (((UINT_16) 'D' << 8) | (UINT_16) 'O') /* Dominican Republic */
|
||||
#define COUNTRY_CODE_EC (((UINT_16) 'E' << 8) | (UINT_16) 'C') /* Ecuador */
|
||||
#define COUNTRY_CODE_EG (((UINT_16) 'E' << 8) | (UINT_16) 'G') /* Egypt */
|
||||
#define COUNTRY_CODE_ES (((UINT_16) 'E' << 8) | (UINT_16) 'S') /* Spain */
|
||||
#define COUNTRY_CODE_EU (((UINT_16) 'E' << 8) | (UINT_16) 'U') /* ETSI (Europe) */
|
||||
#define COUNTRY_CODE_FI (((UINT_16) 'F' << 8) | (UINT_16) 'I') /* Finland */
|
||||
#define COUNTRY_CODE_FR (((UINT_16) 'F' << 8) | (UINT_16) 'R') /* France */
|
||||
#define COUNTRY_CODE_GB (((UINT_16) 'G' << 8) | (UINT_16) 'B') /* United Kingdom */
|
||||
#define COUNTRY_CODE_GD (((UINT_16) 'G' << 8) | (UINT_16) 'D') /* Grenada */
|
||||
#define COUNTRY_CODE_GR (((UINT_16) 'G' << 8) | (UINT_16) 'R') /* Greece */
|
||||
#define COUNTRY_CODE_GY (((UINT_16) 'G' << 8) | (UINT_16) 'Y') /* Guyana */
|
||||
#define COUNTRY_CODE_HK (((UINT_16) 'H' << 8) | (UINT_16) 'K') /* Hong Kong */
|
||||
#define COUNTRY_CODE_HT (((UINT_16) 'H' << 8) | (UINT_16) 'T') /* Haiti */
|
||||
#define COUNTRY_CODE_HN (((UINT_16) 'H' << 8) | (UINT_16) 'N') /* Honduras */
|
||||
#define COUNTRY_CODE_ID (((UINT_16) 'I' << 8) | (UINT_16) 'D') /* Indonesia */
|
||||
#define COUNTRY_CODE_IE (((UINT_16) 'I' << 8) | (UINT_16) 'E') /* Ireland */
|
||||
#define COUNTRY_CODE_IL (((UINT_16) 'I' << 8) | (UINT_16) 'L') /* Israel */
|
||||
#define COUNTRY_CODE_IN (((UINT_16) 'I' << 8) | (UINT_16) 'N') /* India */
|
||||
#define COUNTRY_CODE_IR (((UINT_16) 'I' << 8) | (UINT_16) 'R') /* Iran */
|
||||
#define COUNTRY_CODE_IS (((UINT_16) 'I' << 8) | (UINT_16) 'S') /* Iceland */
|
||||
#define COUNTRY_CODE_IT (((UINT_16) 'I' << 8) | (UINT_16) 'T') /* Italy */
|
||||
#define COUNTRY_CODE_JM (((UINT_16) 'J' << 8) | (UINT_16) 'M') /* Jamaica */
|
||||
#define COUNTRY_CODE_JO (((UINT_16) 'J' << 8) | (UINT_16) 'O') /* Jordan */
|
||||
#define COUNTRY_CODE_JP (((UINT_16) 'J' << 8) | (UINT_16) 'P') /* Japan */
|
||||
#define COUNTRY_CODE_KN (((UINT_16) 'K' << 8) | (UINT_16) 'N') /* Saint Kitts and Nevis */
|
||||
#define COUNTRY_CODE_KR (((UINT_16) 'K' << 8) | (UINT_16) 'R') /* South Korea */
|
||||
#define COUNTRY_CODE_KW (((UINT_16) 'K' << 8) | (UINT_16) 'W') /* Kuwait */
|
||||
#define COUNTRY_CODE_LC (((UINT_16) 'L' << 8) | (UINT_16) 'C') /* Saint Lucia */
|
||||
#define COUNTRY_CODE_LI (((UINT_16) 'L' << 8) | (UINT_16) 'I') /* Liechtenstein */
|
||||
#define COUNTRY_CODE_LK (((UINT_16) 'L' << 8) | (UINT_16) 'K') /* Sri Lanka */
|
||||
#define COUNTRY_CODE_LU (((UINT_16) 'L' << 8) | (UINT_16) 'U') /* Luxembourg */
|
||||
#define COUNTRY_CODE_MA (((UINT_16) 'M' << 8) | (UINT_16) 'A') /* Morocco */
|
||||
#define COUNTRY_CODE_MD (((UINT_16) 'M' << 8) | (UINT_16) 'D') /* Moldova */
|
||||
#define COUNTRY_CODE_MX (((UINT_16) 'M' << 8) | (UINT_16) 'X') /* Mexico */
|
||||
#define COUNTRY_CODE_MY (((UINT_16) 'M' << 8) | (UINT_16) 'Y') /* Malaysia */
|
||||
#define COUNTRY_CODE_NI (((UINT_16) 'N' << 8) | (UINT_16) 'I') /* Nicaragua */
|
||||
#define COUNTRY_CODE_NL (((UINT_16) 'N' << 8) | (UINT_16) 'L') /* Netherlands */
|
||||
#define COUNTRY_CODE_NO (((UINT_16) 'N' << 8) | (UINT_16) 'O') /* Norway */
|
||||
#define COUNTRY_CODE_NZ (((UINT_16) 'N' << 8) | (UINT_16) 'Z') /* New Zealand */
|
||||
#define COUNTRY_CODE_OM (((UINT_16) 'O' << 8) | (UINT_16) 'M') /* Oman */
|
||||
#define COUNTRY_CODE_PE (((UINT_16) 'P' << 8) | (UINT_16) 'E') /* Peru */
|
||||
#define COUNTRY_CODE_PG (((UINT_16) 'P' << 8) | (UINT_16) 'G') /* Papua New Guinea */
|
||||
#define COUNTRY_CODE_PH (((UINT_16) 'P' << 8) | (UINT_16) 'H') /* Philippines */
|
||||
#define COUNTRY_CODE_PK (((UINT_16) 'P' << 8) | (UINT_16) 'K') /* Pakistan */
|
||||
#define COUNTRY_CODE_PR (((UINT_16) 'P' << 8) | (UINT_16) 'R') /* Puerto Rico */
|
||||
#define COUNTRY_CODE_PT (((UINT_16) 'P' << 8) | (UINT_16) 'T') /* Portugal */
|
||||
#define COUNTRY_CODE_PY (((UINT_16) 'P' << 8) | (UINT_16) 'Y') /* Paraguay */
|
||||
#define COUNTRY_CODE_PZ (((UINT_16) 'P' << 8) | (UINT_16) 'Z') /* Panama */
|
||||
#define COUNTRY_CODE_RU (((UINT_16) 'R' << 8) | (UINT_16) 'U') /* Russian */
|
||||
#define COUNTRY_CODE_SA (((UINT_16) 'S' << 8) | (UINT_16) 'A') /* Saudi Arabia */
|
||||
#define COUNTRY_CODE_SE (((UINT_16) 'S' << 8) | (UINT_16) 'E') /* Sweden */
|
||||
#define COUNTRY_CODE_SG (((UINT_16) 'S' << 8) | (UINT_16) 'G') /* Singapore */
|
||||
#define COUNTRY_CODE_SR (((UINT_16) 'S' << 8) | (UINT_16) 'R') /* Suriname */
|
||||
#define COUNTRY_CODE_TW (((UINT_16) 'T' << 8) | (UINT_16) 'W') /* Taiwan */
|
||||
#define COUNTRY_CODE_TH (((UINT_16) 'T' << 8) | (UINT_16) 'H') /* Thailand */
|
||||
#define COUNTRY_CODE_TR (((UINT_16) 'T' << 8) | (UINT_16) 'R') /* Turkey */
|
||||
#define COUNTRY_CODE_TT (((UINT_16) 'T' << 8) | (UINT_16) 'T') /* Trinidad */
|
||||
#define COUNTRY_CODE_UA (((UINT_16) 'U' << 8) | (UINT_16) 'A') /* Ukraine */
|
||||
#define COUNTRY_CODE_US (((UINT_16) 'U' << 8) | (UINT_16) 'S') /* United States */
|
||||
#define COUNTRY_CODE_UY (((UINT_16) 'U' << 8) | (UINT_16) 'Y') /* Uruguay */
|
||||
#define COUNTRY_CODE_VC (((UINT_16) 'V' << 8) | (UINT_16) 'C') /* Saint Vincent */
|
||||
#define COUNTRY_CODE_VE (((UINT_16) 'V' << 8) | (UINT_16) 'E') /* Venezuela */
|
||||
#define COUNTRY_CODE_VN (((UINT_16) 'V' << 8) | (UINT_16) 'N') /* Vietnam */
|
||||
|
||||
/* dot11RegDomainsSupportValue */
|
||||
#define MIB_REG_DOMAIN_FCC 0x10 /* FCC (US) */
|
||||
#define MIB_REG_DOMAIN_IC 0x20 /* IC or DOC (Canada) */
|
||||
#define MIB_REG_DOMAIN_ETSI 0x30 /* ETSI (Europe) */
|
||||
#define MIB_REG_DOMAIN_SPAIN 0x31 /* Spain */
|
||||
#define MIB_REG_DOMAIN_FRANCE 0x32 /* France */
|
||||
#define MIB_REG_DOMAIN_JAPAN 0x40 /* MPHPT (Japan) */
|
||||
#define MIB_REG_DOMAIN_OTHER 0x00 /* other */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/* Define channel offset in unit of 5MHz bandwidth */
|
||||
typedef enum _ENUM_CHNL_SPAN_T {
|
||||
CHNL_SPAN_5 = 1,
|
||||
CHNL_SPAN_10 = 2,
|
||||
CHNL_SPAN_20 = 4,
|
||||
CHNL_SPAN_40 = 8
|
||||
} ENUM_CHNL_SPAN_T, *P_ENUM_CHNL_SPAN_T;
|
||||
|
||||
/* Define BSS operating bandwidth */
|
||||
typedef enum _ENUM_CHNL_BW_T {
|
||||
CHNL_BW_20,
|
||||
CHNL_BW_20_40,
|
||||
CHNL_BW_10,
|
||||
CHNL_BW_5
|
||||
} ENUM_CHNL_BW_T, *P_ENUM_CHNL_BW_T;
|
||||
|
||||
#if 0
|
||||
/* If channel width is CHNL_BW_20_40, the first channel will be SCA and
|
||||
* the second channel is SCB, then iteratively.
|
||||
* Note the final channel will not be SCA.
|
||||
*/
|
||||
typedef struct _DOMAIN_SUBBAND_INFO {
|
||||
UINT_8 ucRegClass;
|
||||
ENUM_BAND_T eBand;
|
||||
ENUM_CHNL_SPAN_T eChannelSpan;
|
||||
UINT_8 ucFirstChannelNum;
|
||||
UINT_8 ucNumChannels;
|
||||
ENUM_CHNL_BW_T eChannelBw;
|
||||
BOOLEAN fgDfsNeeded;
|
||||
BOOLEAN fgIbssProhibited;
|
||||
} DOMAIN_SUBBAND_INFO, *P_DOMAIN_SUBBAND_INFO;
|
||||
|
||||
/* Use it as all available channel list for STA */
|
||||
typedef struct _DOMAIN_INFO_ENTRY {
|
||||
UINT_16 u2CountryCode;
|
||||
UINT_16 u2MibRegDomainValue;
|
||||
|
||||
/* If different attributes, put them into different rSubBands.
|
||||
* For example, DFS shall be used or not.
|
||||
*/
|
||||
DOMAIN_SUBBAND_INFO rSubBand[MAX_SUBBAND_NUM];
|
||||
} DOMAIN_INFO_ENTRY, *P_DOMAIN_INFO_ENTRY;
|
||||
|
||||
#else /* New definition 20110830 */
|
||||
|
||||
/* In all bands, the first channel will be SCA and the second channel is SCB,
|
||||
* then iteratively.
|
||||
* Note the final channel will not be SCA.
|
||||
*/
|
||||
typedef struct _DOMAIN_SUBBAND_INFO {
|
||||
/* Note1: regulation class depends on operation bandwidth and RF band.
|
||||
* For example: 2.4GHz, 1~13, 20MHz ==> regulation class = 81
|
||||
* 2.4GHz, 1~13, SCA ==> regulation class = 83
|
||||
* 2.4GHz, 1~13, SCB ==> regulation class = 84
|
||||
* Note2: TX power limit is not specified here because path loss is unknown
|
||||
*/
|
||||
UINT_8 ucRegClass; /* Regulation class for 20MHz */
|
||||
UINT_8 ucBand; /* Type: ENUM_BAND_T */
|
||||
UINT_8 ucChannelSpan; /* Type: ENUM_CHNL_SPAN_T */
|
||||
UINT_8 ucFirstChannelNum;
|
||||
UINT_8 ucNumChannels;
|
||||
UINT_8 ucReserved; /* Type: BOOLEAN (fgDfsNeeded) */
|
||||
} DOMAIN_SUBBAND_INFO, *P_DOMAIN_SUBBAND_INFO;
|
||||
|
||||
/* Use it as all available channel list for STA */
|
||||
typedef struct _DOMAIN_INFO_ENTRY {
|
||||
PUINT_16 pu2CountryGroup;
|
||||
UINT_32 u4CountryNum;
|
||||
|
||||
/* If different attributes, put them into different rSubBands.
|
||||
* For example, DFS shall be used or not.
|
||||
*/
|
||||
DOMAIN_SUBBAND_INFO rSubBand[MAX_SUBBAND_NUM];
|
||||
} DOMAIN_INFO_ENTRY, *P_DOMAIN_INFO_ENTRY;
|
||||
#endif
|
||||
|
||||
/* The following definitions are not used yet */
|
||||
typedef enum _ENUM_CH_SET_2G4_T {
|
||||
CH_SET_2G4_NA,
|
||||
CH_SET_2G4_1_11,
|
||||
CH_SET_2G4_1_13,
|
||||
CH_SET_2G4_1_14,
|
||||
CH_SET_2G4_NUM
|
||||
} ENUM_CH_SET_2G4_T, *P_ENUM_CH_SET_2G4_T;
|
||||
|
||||
typedef enum _ENUM_CH_SET_UNII_LOW_T {
|
||||
CH_SET_UNII_LOW_NA,
|
||||
CH_SET_UNII_LOW_36_48,
|
||||
CH_SET_UNII_LOW_NUM
|
||||
} ENUM_CH_SET_UNII_LOW_T, *P_ENUM_CH_SET_UNII_LOW_T;
|
||||
|
||||
typedef enum _ENUM_CH_SET_UNII_MID_T {
|
||||
CH_SET_UNII_MID_NA,
|
||||
CH_SET_UNII_MID_52_64,
|
||||
CH_SET_UNII_MID_NUM
|
||||
} ENUM_CH_SET_UNII_MID_T, *P_ENUM_CH_SET_UNII_MID_T;
|
||||
|
||||
typedef enum _ENUM_CH_SET_UNII_WW_T {
|
||||
CH_SET_UNII_WW_NA,
|
||||
CH_SET_UNII_WW_100_128,
|
||||
CH_SET_UNII_WW_100_140,
|
||||
CH_SET_UNII_WW_100_116_132_140,
|
||||
CH_SET_UNII_WW_NUM
|
||||
} ENUM_CH_SET_UNII_WW_T, *P_ENUM_CH_SET_UNII_WW_T;
|
||||
|
||||
typedef enum _ENUM_CH_SET_UNII_UPPER_T {
|
||||
CH_SET_UNII_UPPER_NA,
|
||||
CH_SET_UNII_UPPER_149_161,
|
||||
CH_SET_UNII_UPPER_149_165,
|
||||
CH_SET_UNII_UPPER_149_173,
|
||||
CH_SET_UNII_UPPER_NUM
|
||||
} ENUM_CH_SET_UNII_UPPER_T, *P_ENUM_CH_SET_UNII_UPPER_T;
|
||||
|
||||
typedef struct _COUNTRY_CH_SET_T {
|
||||
ENUM_CH_SET_2G4_T e2G4;
|
||||
ENUM_CH_SET_UNII_LOW_T eUniiLow;
|
||||
ENUM_CH_SET_UNII_MID_T eUniiMid;
|
||||
ENUM_CH_SET_UNII_WW_T eUniiWw;
|
||||
ENUM_CH_SET_UNII_UPPER_T eUniiUpper;
|
||||
} COUNTRY_CH_SET_T, *P_COUNTRY_CH_SET_T;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
P_DOMAIN_INFO_ENTRY
|
||||
rlmDomainGetDomainInfo (
|
||||
P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmDomainGetChnlList (
|
||||
P_ADAPTER_T prAdapter,
|
||||
ENUM_BAND_T eSpecificBand,
|
||||
UINT_8 ucMaxChannelNum,
|
||||
PUINT_8 pucNumOfChannel,
|
||||
P_RF_CHANNEL_INFO_T paucChannelList
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmDomainSendCmd (
|
||||
P_ADAPTER_T prAdapter,
|
||||
BOOLEAN fgIsOid
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rlmDomainIsLegalChannel (
|
||||
P_ADAPTER_T prAdapter,
|
||||
ENUM_BAND_T eBand,
|
||||
UINT_8 ucChannel
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _RLM_DOMAIN_H */
|
||||
|
||||
|
||||
|
|
@ -1,164 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rlm_obss.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "rlm_obss.h"
|
||||
\brief
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: rlm_obss.h $
|
||||
*
|
||||
* 01 24 2011 cm.chang
|
||||
* [WCXRP00000384] [MT6620 Wi-Fi][Driver][FW] Handle 20/40 action frame in AP mode and stop ampdu timer when sta_rec is freed
|
||||
* Process received 20/40 coexistence action frame for AP mode
|
||||
*
|
||||
* 01 13 2011 cm.chang
|
||||
* [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module
|
||||
* Refine function when rcv a 20/40M public action frame
|
||||
*
|
||||
* 01 12 2011 cm.chang
|
||||
* [WCXRP00000354] [MT6620 Wi-Fi][Driver][FW] Follow NVRAM bandwidth setting
|
||||
* User-defined bandwidth is for 2.4G and 5G individually
|
||||
*
|
||||
* 08 24 2010 cm.chang
|
||||
* NULL
|
||||
* Support RLM initail channel of Ad-hoc, P2P and BOW
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 28 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* 1st draft code for RLM module
|
||||
*
|
||||
* 05 07 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Process 20/40 coexistence public action frame in AP mode
|
||||
*
|
||||
* 05 05 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* First draft support for 20/40M bandwidth for AP mode
|
||||
*
|
||||
* 04 07 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Add virtual test for OBSS scan
|
||||
*
|
||||
* 03 30 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support 2.4G OBSS scan
|
||||
*
|
||||
* 02 13 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support PCO in STA mode
|
||||
*
|
||||
* 02 12 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Use bss info array for concurrent handle
|
||||
*
|
||||
* 01 25 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support protection and bandwidth switch
|
||||
*/
|
||||
|
||||
#ifndef _RLM_OBSS_H
|
||||
#define _RLM_OBSS_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define CHNL_LIST_SZ_2G 14
|
||||
#define CHNL_LIST_SZ_5G 14
|
||||
|
||||
|
||||
#define CHNL_LEVEL0 0
|
||||
#define CHNL_LEVEL1 1
|
||||
#define CHNL_LEVEL2 2
|
||||
|
||||
#define AFFECTED_CHNL_OFFSET 5
|
||||
|
||||
#define OBSS_SCAN_MIN_INTERVAL 10 /* In unit of sec */
|
||||
|
||||
#define PUBLIC_ACTION_MAX_LEN 200 /* In unit of byte */
|
||||
|
||||
/* P2P GO only */
|
||||
/* Define default OBSS Scan parameters (from MIB in spec.) */
|
||||
#define dot11OBSSScanPassiveDwell 20
|
||||
#define dot11OBSSScanActiveDwell 10
|
||||
#define dot11OBSSScanPassiveTotalPerChannel 200
|
||||
#define dot11OBSSScanActiveTotalPerChannel 20
|
||||
#define dot11BSSWidthTriggerScanInterval 300 /* Unit: sec */
|
||||
#define dot11BSSWidthChannelTransitionDelayFactor 5
|
||||
#define dot11OBSSScanActivityThreshold 25
|
||||
|
||||
#define OBSS_20_40M_TIMEOUT (dot11BSSWidthTriggerScanInterval + 10)
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/* Control MAC PCO function */
|
||||
typedef enum _ENUM_SYS_PCO_PHASE_T {
|
||||
SYS_PCO_PHASE_DISABLED = 0,
|
||||
SYS_PCO_PHASE_20M,
|
||||
SYS_PCO_PHASE_40M
|
||||
} ENUM_SYS_PCO_PHASE_T, *P_ENUM_SYS_PCO_PHASE_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
VOID
|
||||
rlmObssInit (
|
||||
P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmObssScanDone (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
rlmObssTriggerScan (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _RLM_OBSS_H */
|
||||
|
||||
|
|
@ -1,126 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rlm_protection.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "rlm_protection.h"
|
||||
\brief
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: rlm_protection.h $
|
||||
*
|
||||
* 08 20 2010 cm.chang
|
||||
* NULL
|
||||
* Migrate RLM code to host from FW
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 28 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* 1st draft code for RLM module
|
||||
*
|
||||
* 04 22 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* First draft code to support protection in AP mode
|
||||
*
|
||||
* 02 13 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support PCO in STA mode
|
||||
*
|
||||
* 02 12 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Use bss info array for concurrent handle
|
||||
*
|
||||
* 01 25 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support protection and bandwidth switch
|
||||
*/
|
||||
|
||||
#ifndef _RLM_PROTECTION_H
|
||||
#define _RLM_PROTECTION_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
typedef enum _ENUM_SYS_PROTECT_MODE_T {
|
||||
SYS_PROTECT_MODE_NONE = 0, /* Mode 0 */
|
||||
SYS_PROTECT_MODE_ERP, /* Mode 1 */
|
||||
SYS_PROTECT_MODE_NON_HT, /* Mode 2 */
|
||||
SYS_PROTECT_MODE_20M, /* Mode 3 */
|
||||
|
||||
SYS_PROTECT_MODE_NUM
|
||||
} ENUM_SYS_PROTECT_MODE_T, *P_ENUM_SYS_PROTECT_MODE_T;
|
||||
|
||||
/* This definition follows HT Protection field of HT Operation IE */
|
||||
typedef enum _ENUM_HT_PROTECT_MODE_T {
|
||||
HT_PROTECT_MODE_NONE = 0,
|
||||
HT_PROTECT_MODE_NON_MEMBER,
|
||||
HT_PROTECT_MODE_20M,
|
||||
HT_PROTECT_MODE_NON_HT,
|
||||
|
||||
HT_PROTECT_MODE_NUM
|
||||
} ENUM_HT_PROTECT_MODE_T, *P_ENUM_HT_PROTECT_MODE_T;
|
||||
|
||||
|
||||
typedef enum _ENUM_GF_MODE_T {
|
||||
GF_MODE_NORMAL = 0,
|
||||
GF_MODE_PROTECT,
|
||||
GF_MODE_DISALLOWED,
|
||||
|
||||
GF_MODE_NUM
|
||||
} ENUM_GF_MODE_T, *P_ENUM_GF_MODE_T;
|
||||
|
||||
typedef enum _ENUM_RIFS_MODE_T {
|
||||
RIFS_MODE_NORMAL = 0,
|
||||
RIFS_MODE_DISALLOWED,
|
||||
|
||||
RIFS_MODE_NUM
|
||||
} ENUM_RIFS_MODE_T, *P_ENUM_RIFS_MODE_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _RLM_PROTECTION_H */
|
||||
|
||||
|
|
@ -1,209 +0,0 @@
|
|||
/*
|
||||
** $Id:
|
||||
*/
|
||||
|
||||
/*! \file "roaming_fsm.h"
|
||||
\brief This file defines the FSM for Roaming MODULE.
|
||||
|
||||
This file defines the FSM for Roaming MODULE.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: roaming_fsm.h $
|
||||
*
|
||||
* 08 31 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver
|
||||
* remove obsolete code.
|
||||
*
|
||||
* 08 15 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000931] [MT5931 Wi-Fi][DRV/FW] add swcr to disable roaming from driver
|
||||
* add swcr in driver reg, 0x9fxx0000, to disable roaming .
|
||||
*
|
||||
* 03 16 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000517] [MT6620 Wi-Fi][Driver][FW] Fine Tune Performance of Roaming
|
||||
* remove obsolete definition and unused variables.
|
||||
*
|
||||
* 02 26 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000391] [MT6620 Wi-Fi][FW] Add Roaming Support
|
||||
* not send disassoc or deauth to leaving AP so as to improve performace of roaming.
|
||||
*
|
||||
* 01 27 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
|
||||
* add roaming fsm
|
||||
* 1. not support 11r, only use strength of signal to determine roaming.
|
||||
* 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
|
||||
* 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
|
||||
* 4. assume that change of link quality in smooth way.
|
||||
*
|
||||
* 01 27 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
|
||||
* add roaming fsm
|
||||
* 1. not support 11r, only use strength of signal to determine roaming.
|
||||
* 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
|
||||
* 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
|
||||
* 4. assume that change of link quality in smooth way.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ROAMING_FSM_H
|
||||
#define _ROAMING_FSM_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Roaming Discovery interval, SCAN result need to be updated */
|
||||
#define ROAMING_DISCOVERY_TIMEOUT_SEC 5 // Seconds.
|
||||
|
||||
//#define ROAMING_NO_SWING_RCPI_STEP 5 //rcpi
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
typedef enum _ENUM_ROAMING_FAIL_REASON_T {
|
||||
ROAMING_FAIL_REASON_CONNLIMIT = 0,
|
||||
ROAMING_FAIL_REASON_NOCANDIDATE,
|
||||
ROAMING_FAIL_REASON_NUM
|
||||
} ENUM_ROAMING_FAIL_REASON_T;
|
||||
|
||||
/* events of roaming between driver and firmware */
|
||||
typedef enum _ENUM_ROAMING_EVENT_T {
|
||||
ROAMING_EVENT_START = 0,
|
||||
ROAMING_EVENT_DISCOVERY,
|
||||
ROAMING_EVENT_ROAM,
|
||||
ROAMING_EVENT_FAIL,
|
||||
ROAMING_EVENT_ABORT,
|
||||
ROAMING_EVENT_NUM
|
||||
} ENUM_ROAMING_EVENT_T;
|
||||
|
||||
typedef struct _ROAMING_PARAM_T {
|
||||
UINT_16 u2Event;
|
||||
UINT_16 u2Data;
|
||||
} ROAMING_PARAM_T, *P_ROAMING_PARAM_T;
|
||||
|
||||
/**/
|
||||
typedef enum _ENUM_ROAMING_STATE_T {
|
||||
ROAMING_STATE_IDLE = 0,
|
||||
ROAMING_STATE_DECISION,
|
||||
ROAMING_STATE_DISCOVERY,
|
||||
ROAMING_STATE_ROAM,
|
||||
ROAMING_STATE_NUM
|
||||
} ENUM_ROAMING_STATE_T;
|
||||
|
||||
typedef struct _ROAMING_INFO_T {
|
||||
BOOLEAN fgIsEnableRoaming;
|
||||
|
||||
ENUM_ROAMING_STATE_T eCurrentState;
|
||||
|
||||
OS_SYSTIME rRoamingDiscoveryUpdateTime;
|
||||
|
||||
} ROAMING_INFO_T, *P_ROAMING_INFO_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#if CFG_SUPPORT_ROAMING
|
||||
#define IS_ROAMING_ACTIVE(prAdapter) \
|
||||
(prAdapter->rWifiVar.rRoamingInfo.eCurrentState == ROAMING_STATE_ROAM)
|
||||
#else
|
||||
#define IS_ROAMING_ACTIVE(prAdapter) FALSE
|
||||
#endif /* CFG_SUPPORT_ROAMING */
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
VOID
|
||||
roamingFsmInit (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
roamingFsmUninit (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
roamingFsmSendCmd (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_ROAMING_PARAM_T prParam
|
||||
);
|
||||
|
||||
VOID
|
||||
roamingFsmScanResultsUpdate (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
roamingFsmSteps (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_ROAMING_STATE_T eNextState
|
||||
);
|
||||
|
||||
VOID
|
||||
roamingFsmRunEventStart (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
roamingFsmRunEventDiscovery (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4Param
|
||||
);
|
||||
|
||||
VOID
|
||||
roamingFsmRunEventRoam (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
roamingFsmRunEventFail (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4Reason
|
||||
);
|
||||
|
||||
VOID
|
||||
roamingFsmRunEventAbort (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
roamingFsmProcessEvent (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_ROAMING_PARAM_T prParam
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _ROAMING_FSM_H */
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,386 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/rsn.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file rsn.h
|
||||
\brief The wpa/rsn related define, macro and structure are described here.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: rsn.h $
|
||||
*
|
||||
* 10 12 2011 wh.su
|
||||
* [WCXRP00001036] [MT6620 Wi-Fi][Driver][FW] Adding the 802.11w code for MFP
|
||||
* adding the 802.11w related function and define .
|
||||
*
|
||||
* 06 22 2011 wh.su
|
||||
* [WCXRP00000806] [MT6620 Wi-Fi][Driver] Move the WPA/RSN IE and WAPI IE structure to mac.h and let the sw structure not align at byte
|
||||
* Move the WAPI/RSN IE to mac.h and SW structure not align to byte,
|
||||
* Notice needed update P2P.ko.
|
||||
*
|
||||
* 03 17 2011 chinglan.wang
|
||||
* [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature
|
||||
* .
|
||||
*
|
||||
* 02 09 2011 wh.su
|
||||
* [WCXRP00000432] [MT6620 Wi-Fi][Driver] Add STA privacy check at hotspot mode
|
||||
* adding the code for check STA privacy bit at AP mode, .
|
||||
*
|
||||
* 11 05 2010 wh.su
|
||||
* [WCXRP00000165] [MT6620 Wi-Fi] [Pre-authentication] Assoc req rsn ie use wrong pmkid value
|
||||
* fixed the.pmkid value mismatch issue
|
||||
*
|
||||
* 10 04 2010 wh.su
|
||||
* [WCXRP00000081] [MT6620][Driver] Fix the compiling error at WinXP while enable P2P
|
||||
* add a kal function for set cipher.
|
||||
*
|
||||
* 09 01 2010 wh.su
|
||||
* NULL
|
||||
* adding the wapi support for integration test.
|
||||
*
|
||||
* 08 30 2010 wh.su
|
||||
* NULL
|
||||
* remove non-used code.
|
||||
*
|
||||
* 08 19 2010 wh.su
|
||||
* NULL
|
||||
* adding the tx pkt call back handle for countermeasure.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 18 2010 wh.su
|
||||
* [WPD00003840][MT6620 5931] Security migration
|
||||
* migration from MT6620 firmware.
|
||||
*
|
||||
* 03 03 2010 wh.su
|
||||
* [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize
|
||||
* Fixed the pre-authentication timer not correctly init issue, and modify the security related callback function prototype.
|
||||
*
|
||||
* 01 27 2010 wh.su
|
||||
* [BORA00000476][Wi-Fi][firmware] Add the security module initialize code
|
||||
* add and fixed some security function.
|
||||
*
|
||||
* Dec 4 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adjust the function prototype for generate wap/rsn ie
|
||||
*
|
||||
* Dec 3 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adjust the function input parameter
|
||||
*
|
||||
* Dec 1 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding some event function declaration
|
||||
*
|
||||
* Nov 26 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* move the internal data structure for pmkid to rsn.h
|
||||
*
|
||||
* Nov 23 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the port control and class error function
|
||||
*
|
||||
* Nov 19 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the pmkid candidate
|
||||
*
|
||||
* Nov 18 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
*
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _RSN_H
|
||||
#define _RSN_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* ----- Definitions for Cipher Suite Selectors ----- */
|
||||
#define RSN_CIPHER_SUITE_USE_GROUP_KEY 0x00AC0F00
|
||||
#define RSN_CIPHER_SUITE_WEP40 0x01AC0F00
|
||||
#define RSN_CIPHER_SUITE_TKIP 0x02AC0F00
|
||||
#define RSN_CIPHER_SUITE_CCMP 0x04AC0F00
|
||||
#define RSN_CIPHER_SUITE_WEP104 0x05AC0F00
|
||||
#if CFG_SUPPORT_802_11W
|
||||
#define RSN_CIPHER_SUITE_AES_128_CMAC 0x06AC0F00
|
||||
#endif
|
||||
|
||||
#define WPA_CIPHER_SUITE_NONE 0x00F25000
|
||||
#define WPA_CIPHER_SUITE_WEP40 0x01F25000
|
||||
#define WPA_CIPHER_SUITE_TKIP 0x02F25000
|
||||
#define WPA_CIPHER_SUITE_CCMP 0x04F25000
|
||||
#define WPA_CIPHER_SUITE_WEP104 0x05F25000
|
||||
|
||||
/* ----- Definitions for Authentication and Key Management Suite Selectors ----- */
|
||||
#define RSN_AKM_SUITE_NONE 0x00AC0F00
|
||||
#define RSN_AKM_SUITE_802_1X 0x01AC0F00
|
||||
#define RSN_AKM_SUITE_PSK 0x02AC0F00
|
||||
#if CFG_SUPPORT_802_11W
|
||||
#define RSN_AKM_SUITE_802_1X_SHA256 0x05AC0F00
|
||||
#define RSN_AKM_SUITE_PSK_SHA256 0x06AC0F00
|
||||
#endif
|
||||
|
||||
#define WPA_AKM_SUITE_NONE 0x00F25000
|
||||
#define WPA_AKM_SUITE_802_1X 0x01F25000
|
||||
#define WPA_AKM_SUITE_PSK 0x02F25000
|
||||
|
||||
#define ELEM_ID_RSN_LEN_FIXED 20 /* The RSN IE len for associate request */
|
||||
|
||||
#define ELEM_ID_WPA_LEN_FIXED 22 /* The RSN IE len for associate request */
|
||||
|
||||
#define MASK_RSNIE_CAP_PREAUTH BIT(0)
|
||||
|
||||
#define GET_SELECTOR_TYPE(x) ((UINT_8)(((x) >> 24) & 0x000000FF))
|
||||
#define SET_SELECTOR_TYPE(x, y) x = (((x) & 0x00FFFFFF) | (((UINT_32)(y) << 24) & 0xFF000000))
|
||||
|
||||
#define AUTH_CIPHER_CCMP 0x00000008
|
||||
|
||||
/* Cihpher suite flags */
|
||||
#define CIPHER_FLAG_NONE 0x00000000
|
||||
#define CIPHER_FLAG_WEP40 0x00000001 /* BIT 1 */
|
||||
#define CIPHER_FLAG_TKIP 0x00000002 /* BIT 2 */
|
||||
#define CIPHER_FLAG_CCMP 0x00000008 /* BIT 4 */
|
||||
#define CIPHER_FLAG_WEP104 0x00000010 /* BIT 5 */
|
||||
#define CIPHER_FLAG_WEP128 0x00000020 /* BIT 6 */
|
||||
|
||||
#define WAIT_TIME_IND_PMKID_CANDICATE_SEC 6 /* seconds */
|
||||
#define TKIP_COUNTERMEASURE_SEC 60 /* seconds */
|
||||
|
||||
#if CFG_SUPPORT_802_11W
|
||||
#define RSN_AUTH_MFP_DISABLED 0 /* MFP disabled */
|
||||
#define RSN_AUTH_MFP_OPTIONAL 1 /* MFP optional */
|
||||
#define RSN_AUTH_MFP_REQUIRED 2 /* MFP required */
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/* Flags for PMKID Candidate list structure */
|
||||
#define EVENT_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01
|
||||
|
||||
|
||||
#define CONTROL_FLAG_UC_MGMT_NO_ENC BIT(5)
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define RSN_IE(fp) ((P_RSN_INFO_ELEM_T) fp)
|
||||
#define WPA_IE(fp) ((P_WPA_INFO_ELEM_T) fp)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
BOOLEAN
|
||||
rsnParseRsnIE(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_RSN_INFO_ELEM_T prInfoElem,
|
||||
OUT P_RSN_INFO_T prRsnInfo
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rsnParseWpaIE(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_WPA_INFO_ELEM_T prInfoElem,
|
||||
OUT P_RSN_INFO_T prWpaInfo
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rsnSearchSupportedCipher(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4Cipher,
|
||||
OUT PUINT_32 pu4Index
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rsnSearchAKMSuite(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4AkmSuite,
|
||||
OUT PUINT_32 pu4Index
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rsnPerformPolicySelection(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBss
|
||||
);
|
||||
|
||||
VOID
|
||||
rsnGenerateWpaNoneIE(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rsnGenerateWPAIE(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
rsnGenerateRSNIE(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rsnParseCheckForWFAInfoElem(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PUINT_8 pucBuf,
|
||||
OUT PUINT_8 pucOuiType,
|
||||
OUT PUINT_16 pu2SubTypeVersion
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rsnIsSuitableBSS (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_RSN_INFO_T prBssRsnInfo
|
||||
);
|
||||
|
||||
#if CFG_SUPPORT_AAA
|
||||
void
|
||||
rsnParserCheckForRSNCCMPPSK (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_RSN_INFO_ELEM_T prIe,
|
||||
PUINT_16 pu2StatusCode
|
||||
);
|
||||
#endif
|
||||
|
||||
VOID
|
||||
rsnTkipHandleMICFailure(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prSta,
|
||||
IN BOOLEAN fgErrorKeyType
|
||||
);
|
||||
|
||||
VOID
|
||||
rsnSelectPmkidCandidateList(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
VOID
|
||||
rsnUpdatePmkidCandidateList(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rsnSearchPmkidEntry(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PUINT_8 pucBssid,
|
||||
OUT PUINT_32 pu4EntryIndex
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rsnCheckPmkidCandicate(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
rsnCheckPmkidCache(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBss
|
||||
);
|
||||
|
||||
VOID
|
||||
rsnGeneratePmkidIndication(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
rsnIndicatePmkidCand(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4Parm
|
||||
);
|
||||
#if CFG_SUPPORT_WPS2
|
||||
VOID
|
||||
rsnGenerateWSCIE(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_802_11W
|
||||
UINT_32
|
||||
rsnCheckBipKeyInstalled(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
UINT_8
|
||||
rsnCheckSaQueryTimeout(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
void
|
||||
rsnStartSaQueryTimer(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
void
|
||||
rsnStartSaQuery(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
void
|
||||
rsnStopSaQuery(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
void
|
||||
rsnSaQueryRequest(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
void
|
||||
rsnSaQueryAction(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
rsnCheckRxMgmt(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN UINT_8 ucSubtype
|
||||
);
|
||||
#endif
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _RSN_H */
|
||||
|
||||
|
|
@ -1,847 +0,0 @@
|
|||
/*
|
||||
** $Id: @(#)
|
||||
*/
|
||||
|
||||
/*! \file "scan.h"
|
||||
\brief
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: scan.h $
|
||||
*
|
||||
* 01 16 2012 cp.wu
|
||||
* [MT6620 Wi-Fi][Driver] API and behavior modification for preferred band configuration with corresponding network configuration
|
||||
* add wlanSetPreferBandByNetwork() for glue layer to invoke for setting preferred band configuration corresponding to network type.
|
||||
*
|
||||
* 08 11 2011 cp.wu
|
||||
* [WCXRP00000830] [MT6620 Wi-Fi][Firmware] Use MDRDY counter to detect empty channel for shortening scan time
|
||||
* sparse channel detection:
|
||||
* driver: collect sparse channel information with scan-done event
|
||||
|
||||
*
|
||||
* 07 18 2011 cp.wu
|
||||
* [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for more than one SSID in a single scanning request
|
||||
* add framework in driver domain for supporting new SCAN_REQ_V2 for more than 1 SSID support as well as uProbeDelay in NDIS 6.x driver model
|
||||
*
|
||||
* 06 27 2011 cp.wu
|
||||
* [WCXRP00000815] [MT6620 Wi-Fi][Driver] allow single BSSID with multiple SSID settings to work around some tricky AP which use space character as hidden SSID
|
||||
* allow to have a single BSSID with multiple SSID to be presented in scanning result
|
||||
*
|
||||
* 04 18 2011 terry.wu
|
||||
* [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED
|
||||
* Remove flag CFG_WIFI_DIRECT_MOVED.
|
||||
*
|
||||
* 02 09 2011 wh.su
|
||||
* [WCXRP00000433] [MT6620 Wi-Fi][Driver] Remove WAPI structure define for avoid P2P module with structure miss-align pointer issue
|
||||
* always pre-allio WAPI related structure for align p2p module.
|
||||
*
|
||||
* 01 14 2011 yuche.tsai
|
||||
* [WCXRP00000352] [Volunteer Patch][MT6620][Driver] P2P Statsion Record Client List Issue
|
||||
* Fix compile error.
|
||||
*
|
||||
* 09 08 2010 cp.wu
|
||||
* NULL
|
||||
* use static memory pool for storing IEs of scanning result.
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 08 31 2010 kevin.huang
|
||||
* NULL
|
||||
* Use LINK LIST operation to process SCAN result
|
||||
*
|
||||
* 08 30 2010 cp.wu
|
||||
* NULL
|
||||
* eliminate klockwork errors
|
||||
*
|
||||
* 08 16 2010 cp.wu
|
||||
* NULL
|
||||
* add interface for RLM to trigger OBSS-SCAN.
|
||||
*
|
||||
* 08 12 2010 yuche.tsai
|
||||
* NULL
|
||||
* Add a functio prototype to find p2p descriptor of a bss descriptor directly.
|
||||
*
|
||||
* 08 11 2010 yuche.tsai
|
||||
* NULL
|
||||
* Add function prototype for return channel.
|
||||
* modify data structure for scan specific device ID or TYPE. (Move from P2P Connection Settings to Scan Param)
|
||||
*
|
||||
* 08 05 2010 yuche.tsai
|
||||
* NULL
|
||||
* Check-in P2P Device Discovery Feature.
|
||||
*
|
||||
* 08 02 2010 yuche.tsai
|
||||
* NULL
|
||||
* P2P Group Negotiation Code Check in.
|
||||
*
|
||||
* 07 26 2010 yuche.tsai
|
||||
*
|
||||
* Add a option for channel time extention in scan abort command.
|
||||
*
|
||||
* 07 21 2010 yuche.tsai
|
||||
*
|
||||
* Add for P2P Scan Result Parsing & Saving.
|
||||
*
|
||||
* 07 19 2010 yuche.tsai
|
||||
*
|
||||
* Scan status "FIND" is used for P2P FSM find state.
|
||||
*
|
||||
* 07 19 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration.
|
||||
* SCN module is now able to handle multiple concurrent scanning requests
|
||||
*
|
||||
* 07 14 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration.
|
||||
* pass band with channel number information as scan parameter
|
||||
*
|
||||
* 07 14 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration.
|
||||
* remove timer in DRV-SCN.
|
||||
*
|
||||
* 07 09 2010 cp.wu
|
||||
*
|
||||
* 1) separate AIS_FSM state for two kinds of scanning. (OID triggered scan, and scan-for-connection)
|
||||
* 2) eliminate PRE_BSS_DESC_T, Beacon/PrebResp is now parsed in single pass
|
||||
* 3) implment DRV-SCN module, currently only accepts single scan request, other request will be directly dropped by returning BUSY
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 01 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add scan uninitialization procedure
|
||||
*
|
||||
* 07 01 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* implementation of DRV-SCN and related mailbox message handling.
|
||||
*
|
||||
* 06 25 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* modify Beacon/ProbeResp to complete parsing,
|
||||
* because host software has looser memory usage restriction
|
||||
*
|
||||
* 06 17 2010 yuche.tsai
|
||||
* [WPD00003839][MT6620 5931][P2P] Feature migration
|
||||
* Add P2P related field in SCAN_PARAM_T.
|
||||
*
|
||||
* 06 14 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* saa_fsm.c is migrated.
|
||||
*
|
||||
* 06 14 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add management dispatching function table.
|
||||
*
|
||||
* 06 14 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* restore utility function invoking via hem_mbox to direct calls
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* auth.c is migrated.
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add buildable & linkable ais_fsm.c
|
||||
*
|
||||
* related reference are still waiting to be resolved
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
|
||||
*
|
||||
* 05 12 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Add Power Management - Legacy PS-POLL support.
|
||||
*
|
||||
* 04 13 2010 kevin.huang
|
||||
* [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
|
||||
*
|
||||
* Add new HW CH macro support
|
||||
*
|
||||
* 03 16 2010 kevin.huang
|
||||
* [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
|
||||
* Add AdHoc Mode
|
||||
*
|
||||
* 03 10 2010 kevin.huang
|
||||
* [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
|
||||
*
|
||||
* * * * * * Add Channel Manager for arbitration of JOIN and SCAN Req
|
||||
*
|
||||
* 02 26 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Modify scanBuildProbeReqFrameCommonIEs() to support P2P SCAN
|
||||
*
|
||||
* 02 23 2010 wh.su
|
||||
* [BORA00000592][MT6620 Wi-Fi] Adding the security related code for driver
|
||||
* refine the scan procedure, reduce the WPA and WAPI IE parsing, and move the parsing to the time for join.
|
||||
*
|
||||
* 02 23 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Add support scan channel 1~14 and update scan result's frequency infou1rwduu`wvpghlqg|n`slk+mpdkb
|
||||
*
|
||||
* 02 04 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
|
||||
*
|
||||
* 01 27 2010 wh.su
|
||||
* [BORA00000476][Wi-Fi][firmware] Add the security module initialize code
|
||||
* add and fixed some security function.
|
||||
*
|
||||
* 01 07 2010 kevin.huang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
* Simplify the process of Beacon during SCAN and remove redundant variable in PRE_BSS_DESC_T
|
||||
*
|
||||
* Dec 7 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding variable for wapi ap
|
||||
*
|
||||
* Dec 4 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* remove non-used secuirty variavle
|
||||
*
|
||||
* Dec 3 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Refine data structure of BSS_DESC_T and PRE_BSS_DESC_T
|
||||
*
|
||||
* Nov 24 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add eNetType to rScanParam and revise MGMT Handler with Retain Status
|
||||
*
|
||||
* Nov 23 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add ucAvailablePhyTypeSet to BSS_DESC_T
|
||||
*
|
||||
* Nov 20 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add aucSrcAddress to SCAN_PARAM_T for P2P's Device Address
|
||||
*
|
||||
* Nov 19 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the security related variable
|
||||
*
|
||||
* Nov 18 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the security ie filed for scan parsing
|
||||
*
|
||||
* Nov 16 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add scanSearchBssDescByPolicy()
|
||||
*
|
||||
* Nov 5 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add function declarations of scan_fsm.c
|
||||
*
|
||||
* Oct 30 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add scan.h to source control
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _SCAN_H
|
||||
#define _SCAN_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*! Maximum buffer size of SCAN list */
|
||||
#define SCN_MAX_BUFFER_SIZE (CFG_MAX_NUM_BSS_LIST * ALIGN_4(sizeof(BSS_DESC_T)))
|
||||
|
||||
#define SCN_RM_POLICY_EXCLUDE_CONNECTED BIT(0) // Remove SCAN result except the connected one.
|
||||
#define SCN_RM_POLICY_TIMEOUT BIT(1) // Remove the timeout one
|
||||
#define SCN_RM_POLICY_OLDEST_HIDDEN BIT(2) // Remove the oldest one with hidden ssid
|
||||
#define SCN_RM_POLICY_SMART_WEAKEST BIT(3) /* If there are more than half BSS which has the
|
||||
* same ssid as connection setting, remove the weakest one from them
|
||||
* Else remove the weakest one.
|
||||
*/
|
||||
#define SCN_RM_POLICY_ENTIRE BIT(4) // Remove entire SCAN result
|
||||
|
||||
#define SCN_BSS_DESC_SAME_SSID_THRESHOLD 3 /* This is used by POLICY SMART WEAKEST,
|
||||
* If exceed this value, remove weakest BSS_DESC_T
|
||||
* with same SSID first in large network.
|
||||
*/
|
||||
|
||||
#define SCN_BSS_DESC_REMOVE_TIMEOUT_SEC 5 // Second.
|
||||
/* This is used by POLICY TIMEOUT,
|
||||
* If exceed this value, remove timeout BSS_DESC_T.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#define SCN_PROBE_DELAY_MSEC 0
|
||||
|
||||
#define SCN_ADHOC_BSS_DESC_TIMEOUT_SEC 5 // Second.
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* MSG_SCN_SCAN_REQ */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
#define SCAN_REQ_SSID_WILDCARD BIT(0)
|
||||
#define SCAN_REQ_SSID_P2P_WILDCARD BIT(1)
|
||||
#define SCAN_REQ_SSID_SPECIFIED BIT(2)
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Support Multiple SSID SCAN */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
#define SCN_SSID_MAX_NUM 4
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
typedef enum _ENUM_SCAN_TYPE_T {
|
||||
SCAN_TYPE_PASSIVE_SCAN = 0,
|
||||
SCAN_TYPE_ACTIVE_SCAN,
|
||||
SCAN_TYPE_NUM
|
||||
} ENUM_SCAN_TYPE_T, *P_ENUM_SCAN_TYPE_T;
|
||||
|
||||
typedef enum _ENUM_SCAN_STATE_T {
|
||||
SCAN_STATE_IDLE = 0,
|
||||
SCAN_STATE_SCANNING,
|
||||
SCAN_STATE_NUM
|
||||
} ENUM_SCAN_STATE_T;
|
||||
|
||||
typedef enum _ENUM_SCAN_CHANNEL_T {
|
||||
SCAN_CHANNEL_FULL = 0,
|
||||
SCAN_CHANNEL_2G4,
|
||||
SCAN_CHANNEL_5G,
|
||||
SCAN_CHANNEL_P2P_SOCIAL,
|
||||
SCAN_CHANNEL_SPECIFIED,
|
||||
SCAN_CHANNEL_NUM
|
||||
} ENUM_SCAN_CHANNEL, *P_ENUM_SCAN_CHANNEL;
|
||||
|
||||
typedef struct _MSG_SCN_FSM_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_32 u4Dummy;
|
||||
} MSG_SCN_FSM_T, *P_MSG_SCN_FSM_T;
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* BSS Descriptors */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
struct _BSS_DESC_T {
|
||||
LINK_ENTRY_T rLinkEntry;
|
||||
|
||||
UINT_8 aucBSSID[MAC_ADDR_LEN];
|
||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* For IBSS, the SrcAddr is different from BSSID */
|
||||
|
||||
BOOLEAN fgIsConnecting; /* If we are going to connect to this BSS
|
||||
* (JOIN or ROAMING to another BSS), don't
|
||||
* remove this record from BSS List.
|
||||
*/
|
||||
BOOLEAN fgIsConnected; /* If we have connected to this BSS (NORMAL_TR),
|
||||
* don't removed this record from BSS list.
|
||||
*/
|
||||
|
||||
BOOLEAN fgIsHiddenSSID; /* When this flag is TRUE, means the SSID
|
||||
* of this BSS is not known yet.
|
||||
*/
|
||||
UINT_8 ucSSIDLen;
|
||||
UINT_8 aucSSID[ELEM_MAX_LEN_SSID];
|
||||
|
||||
OS_SYSTIME rUpdateTime;
|
||||
|
||||
ENUM_BSS_TYPE_T eBSSType;
|
||||
|
||||
UINT_16 u2CapInfo;
|
||||
|
||||
UINT_16 u2BeaconInterval;
|
||||
UINT_16 u2ATIMWindow;
|
||||
|
||||
UINT_16 u2OperationalRateSet;
|
||||
UINT_16 u2BSSBasicRateSet;
|
||||
BOOLEAN fgIsUnknownBssBasicRate;
|
||||
|
||||
BOOLEAN fgIsERPPresent;
|
||||
BOOLEAN fgIsHTPresent;
|
||||
|
||||
UINT_8 ucPhyTypeSet; /* Available PHY Type Set of this BSS */
|
||||
|
||||
UINT_8 ucChannelNum;
|
||||
|
||||
ENUM_CHNL_EXT_T eSco; /* Record bandwidth for association process
|
||||
Some AP will send association resp by 40MHz BW */
|
||||
ENUM_BAND_T eBand;
|
||||
|
||||
UINT_8 ucDTIMPeriod;
|
||||
|
||||
BOOLEAN fgIsLargerTSF; /* This BSS's TimeStamp is larger than us(TCL == 1 in RX_STATUS_T) */
|
||||
|
||||
UINT_8 ucRCPI;
|
||||
|
||||
UINT_8 ucWmmFlag; /* A flag to indicate this BSS's WMM capability */
|
||||
|
||||
/*! \brief The srbiter Search State will matched the scan result,
|
||||
and saved the selected cipher and akm, and report the score,
|
||||
for arbiter join state, join module will carry this target BSS
|
||||
to rsn generate ie function, for gen wpa/rsn ie */
|
||||
UINT_32 u4RsnSelectedGroupCipher;
|
||||
UINT_32 u4RsnSelectedPairwiseCipher;
|
||||
UINT_32 u4RsnSelectedAKMSuite;
|
||||
|
||||
UINT_16 u2RsnCap;
|
||||
|
||||
RSN_INFO_T rRSNInfo;
|
||||
RSN_INFO_T rWPAInfo;
|
||||
#if 1//CFG_SUPPORT_WAPI
|
||||
WAPI_INFO_T rIEWAPI;
|
||||
BOOL fgIEWAPI;
|
||||
#endif
|
||||
BOOL fgIERSN;
|
||||
BOOL fgIEWPA;
|
||||
|
||||
/*! \brief RSN parameters selected for connection */
|
||||
/*! \brief The Select score for final AP selection,
|
||||
0, no sec, 1,2,3 group cipher is WEP, TKIP, CCMP */
|
||||
UINT_8 ucEncLevel;
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
BOOLEAN fgIsP2PPresent;
|
||||
P_P2P_DEVICE_DESC_T prP2pDesc;
|
||||
|
||||
UINT_8 aucIntendIfAddr[MAC_ADDR_LEN]; /* For IBSS, the SrcAddr is different from BSSID */
|
||||
// UINT_8 ucDevCapabilityBitmap; /* Device Capability Attribute. (P2P_DEV_CAPABILITY_XXXX) */
|
||||
// UINT_8 ucGroupCapabilityBitmap; /* Group Capability Attribute. (P2P_GROUP_CAPABILITY_XXXX) */
|
||||
|
||||
LINK_T rP2pDeviceList;
|
||||
|
||||
// P_LINK_T prP2pDeviceList;
|
||||
|
||||
/* For
|
||||
* 1. P2P Capability.
|
||||
* 2. P2P Device ID. ( in aucSrcAddr[] )
|
||||
* 3. NOA (TODO:)
|
||||
* 4. Extend Listen Timing. (Probe Rsp) (TODO:)
|
||||
* 5. P2P Device Info. (Probe Rsp)
|
||||
* 6. P2P Group Info. (Probe Rsp)
|
||||
*/
|
||||
#endif
|
||||
|
||||
BOOLEAN fgIsIEOverflow; /* The received IE length exceed the maximum IE buffer size */
|
||||
UINT_16 u2IELength; /* The byte count of aucIEBuf[] */
|
||||
|
||||
ULARGE_INTEGER u8TimeStamp; /* Place u8TimeStamp before aucIEBuf[1] to force DW align */
|
||||
|
||||
UINT_8 aucIEBuf[CFG_IE_BUFFER_SIZE];
|
||||
};
|
||||
|
||||
|
||||
typedef struct _SCAN_PARAM_T { /* Used by SCAN FSM */
|
||||
/* Active or Passive */
|
||||
ENUM_SCAN_TYPE_T eScanType;
|
||||
|
||||
/* Network Type */
|
||||
ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex;
|
||||
|
||||
/* Specified SSID Type */
|
||||
UINT_8 ucSSIDType;
|
||||
UINT_8 ucSSIDNum;
|
||||
|
||||
/* Length of Specified SSID */
|
||||
UINT_8 ucSpecifiedSSIDLen[SCN_SSID_MAX_NUM];
|
||||
|
||||
/* Specified SSID */
|
||||
UINT_8 aucSpecifiedSSID[SCN_SSID_MAX_NUM][ELEM_MAX_LEN_SSID];
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
BOOLEAN fgFindSpecificDev; /* P2P: Discovery Protocol */
|
||||
UINT_8 aucDiscoverDevAddr[MAC_ADDR_LEN];
|
||||
BOOLEAN fgIsDevType;
|
||||
P2P_DEVICE_TYPE_T rDiscoverDevType;
|
||||
|
||||
UINT_16 u2PassiveListenInterval;
|
||||
// TODO: Find Specific Device Type.
|
||||
#endif /* CFG_SUPPORT_P2P */
|
||||
|
||||
BOOLEAN fgIsObssScan;
|
||||
BOOLEAN fgIsScanV2;
|
||||
|
||||
/* Run time flags */
|
||||
UINT_16 u2ProbeDelayTime;
|
||||
|
||||
/* channel information */
|
||||
ENUM_SCAN_CHANNEL eScanChannel;
|
||||
UINT_8 ucChannelListNum;
|
||||
RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
|
||||
|
||||
/* Feedback information */
|
||||
UINT_8 ucSeqNum;
|
||||
|
||||
/* Information Element */
|
||||
UINT_16 u2IELen;
|
||||
UINT_8 aucIE[MAX_IE_LENGTH];
|
||||
|
||||
} SCAN_PARAM_T, *P_SCAN_PARAM_T;
|
||||
|
||||
typedef struct _SCAN_INFO_T {
|
||||
ENUM_SCAN_STATE_T eCurrentState; /* Store the STATE variable of SCAN FSM */
|
||||
|
||||
OS_SYSTIME rLastScanCompletedTime;
|
||||
|
||||
SCAN_PARAM_T rScanParam;
|
||||
|
||||
UINT_32 u4NumOfBssDesc;
|
||||
|
||||
UINT_8 aucScanBuffer[SCN_MAX_BUFFER_SIZE];
|
||||
|
||||
LINK_T rBSSDescList;
|
||||
|
||||
LINK_T rFreeBSSDescList;
|
||||
|
||||
LINK_T rPendingMsgList;
|
||||
|
||||
/* Sparse Channel Detection */
|
||||
BOOLEAN fgIsSparseChannelValid;
|
||||
RF_CHANNEL_INFO_T rSparseChannel;
|
||||
|
||||
} SCAN_INFO_T, *P_SCAN_INFO_T;
|
||||
|
||||
|
||||
/* Incoming Mailbox Messages */
|
||||
typedef struct _MSG_SCN_SCAN_REQ_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucSeqNum;
|
||||
UINT_8 ucNetTypeIndex;
|
||||
ENUM_SCAN_TYPE_T eScanType;
|
||||
UINT_8 ucSSIDType; /* BIT(0) wildcard / BIT(1) P2P-wildcard / BIT(2) specific */
|
||||
UINT_8 ucSSIDLength;
|
||||
UINT_8 aucSSID[PARAM_MAX_LEN_SSID];
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
UINT_16 u2ChannelDwellTime; /* In TU. 1024us. */
|
||||
#endif
|
||||
ENUM_SCAN_CHANNEL eScanChannel;
|
||||
UINT_8 ucChannelListNum;
|
||||
RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
|
||||
UINT_16 u2IELen;
|
||||
UINT_8 aucIE[MAX_IE_LENGTH];
|
||||
} MSG_SCN_SCAN_REQ, *P_MSG_SCN_SCAN_REQ;
|
||||
|
||||
typedef struct _MSG_SCN_SCAN_REQ_V2_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucSeqNum;
|
||||
UINT_8 ucNetTypeIndex;
|
||||
ENUM_SCAN_TYPE_T eScanType;
|
||||
UINT_8 ucSSIDType; /* BIT(0) wildcard / BIT(1) P2P-wildcard / BIT(2) specific */
|
||||
UINT_8 ucSSIDNum;
|
||||
P_PARAM_SSID_T prSsid;
|
||||
UINT_16 u2ProbeDelay;
|
||||
UINT_16 u2ChannelDwellTime; /* In TU. 1024us. */
|
||||
ENUM_SCAN_CHANNEL eScanChannel;
|
||||
UINT_8 ucChannelListNum;
|
||||
RF_CHANNEL_INFO_T arChnlInfoList[MAXIMUM_OPERATION_CHANNEL_LIST];
|
||||
UINT_16 u2IELen;
|
||||
UINT_8 aucIE[MAX_IE_LENGTH];
|
||||
} MSG_SCN_SCAN_REQ_V2, *P_MSG_SCN_SCAN_REQ_V2;
|
||||
|
||||
|
||||
typedef struct _MSG_SCN_SCAN_CANCEL_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucSeqNum;
|
||||
UINT_8 ucNetTypeIndex;
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
BOOLEAN fgIsChannelExt;
|
||||
#endif
|
||||
} MSG_SCN_SCAN_CANCEL, *P_MSG_SCN_SCAN_CANCEL;
|
||||
|
||||
/* Outgoing Mailbox Messages */
|
||||
typedef enum _ENUM_SCAN_STATUS_T {
|
||||
SCAN_STATUS_DONE = 0,
|
||||
SCAN_STATUS_CANCELLED,
|
||||
SCAN_STATUS_FAIL,
|
||||
SCAN_STATUS_BUSY,
|
||||
SCAN_STATUS_NUM
|
||||
} ENUM_SCAN_STATUS, *P_ENUM_SCAN_STATUS;
|
||||
|
||||
typedef struct _MSG_SCN_SCAN_DONE_T {
|
||||
MSG_HDR_T rMsgHdr; /* Must be the first member */
|
||||
UINT_8 ucSeqNum;
|
||||
UINT_8 ucNetTypeIndex;
|
||||
ENUM_SCAN_STATUS eScanStatus;
|
||||
} MSG_SCN_SCAN_DONE, *P_MSG_SCN_SCAN_DONE;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines in scan.c */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
scnInit (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
scnUninit (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
/* BSS-DESC Search */
|
||||
P_BSS_DESC_T
|
||||
scanSearchBssDescByBssid (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucBSSID[]
|
||||
);
|
||||
|
||||
P_BSS_DESC_T
|
||||
scanSearchBssDescByBssidAndSsid (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucBSSID[],
|
||||
IN BOOLEAN fgCheckSsid,
|
||||
IN P_PARAM_SSID_T prSsid
|
||||
);
|
||||
|
||||
P_BSS_DESC_T
|
||||
scanSearchBssDescByTA (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucSrcAddr[]
|
||||
);
|
||||
|
||||
P_BSS_DESC_T
|
||||
scanSearchBssDescByTAAndSsid (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucSrcAddr[],
|
||||
IN BOOLEAN fgCheckSsid,
|
||||
IN P_PARAM_SSID_T prSsid
|
||||
);
|
||||
|
||||
|
||||
/* BSS-DESC Search - Alternative */
|
||||
P_BSS_DESC_T
|
||||
scanSearchExistingBssDesc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_BSS_TYPE_T eBSSType,
|
||||
IN UINT_8 aucBSSID[],
|
||||
IN UINT_8 aucSrcAddr[]
|
||||
);
|
||||
|
||||
P_BSS_DESC_T
|
||||
scanSearchExistingBssDescWithSsid (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_BSS_TYPE_T eBSSType,
|
||||
IN UINT_8 aucBSSID[],
|
||||
IN UINT_8 aucSrcAddr[],
|
||||
IN BOOLEAN fgCheckSsid,
|
||||
IN P_PARAM_SSID_T prSsid
|
||||
);
|
||||
|
||||
|
||||
/* BSS-DESC Allocation */
|
||||
P_BSS_DESC_T
|
||||
scanAllocateBssDesc (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
/* BSS-DESC Removal */
|
||||
VOID
|
||||
scanRemoveBssDescsByPolicy (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4RemovePolicy
|
||||
);
|
||||
|
||||
VOID
|
||||
scanRemoveBssDescByBssid (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucBSSID[]
|
||||
);
|
||||
|
||||
VOID
|
||||
scanRemoveBssDescByBandAndNetwork (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_BAND_T eBand,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex
|
||||
);
|
||||
|
||||
/* BSS-DESC State Change */
|
||||
VOID
|
||||
scanRemoveConnFlagOfBssDescByBssid (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucBSSID[]
|
||||
);
|
||||
|
||||
#if 0
|
||||
/* BSS-DESC Insertion */
|
||||
P_BSS_DESC_T
|
||||
scanAddToInternalScanResult (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSWRfb,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
#endif
|
||||
|
||||
/* BSS-DESC Insertion - ALTERNATIVE */
|
||||
P_BSS_DESC_T
|
||||
scanAddToBssDesc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
scanProcessBeaconAndProbeResp (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSWRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
scanBuildProbeReqFrameCommonIEs (
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN PUINT_8 pucDesiredSsid,
|
||||
IN UINT_32 u4DesiredSsidLen,
|
||||
IN UINT_16 u2SupportedRateSet
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
scanSendProbeReqFrames (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SCAN_PARAM_T prScanParam
|
||||
);
|
||||
|
||||
VOID
|
||||
scanUpdateBssDescForSearch (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
P_BSS_DESC_T
|
||||
scanSearchBssDescByPolicy (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
scanAddScanResult (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines in scan_fsm.c */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
scnFsmSteps (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_SCAN_STATE_T eNextState
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Command Routines */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
scnSendScanReq (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
scnSendScanReqV2 (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* RX Event Handling */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
scnEventScanDone(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_EVENT_SCAN_DONE prScanDone
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Mailbox Message Handling */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
scnFsmMsgStart (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
scnFsmMsgAbort (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
scnFsmHandleScanMsg (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_SCN_SCAN_REQ prScanReqMsg
|
||||
);
|
||||
|
||||
VOID
|
||||
scnFsmHandleScanMsgV2 (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_SCN_SCAN_REQ_V2 prScanReqMsg
|
||||
);
|
||||
|
||||
VOID
|
||||
scnFsmRemovePendingMsg (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucSeqNum,
|
||||
IN UINT_8 ucNetTypeIndex
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Mailbox Message Generation */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
scnFsmGenerateScanDoneMsg (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucSeqNum,
|
||||
IN UINT_8 ucNetTypeIndex,
|
||||
IN ENUM_SCAN_STATUS eScanStatus
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Query for sparse channel */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
scnQuerySparseChannel (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
P_ENUM_BAND_T prSparseBand,
|
||||
PUINT_8 pucSparseChannel
|
||||
);
|
||||
|
||||
|
||||
#endif /* _SCAN_H */
|
||||
|
||||
|
||||
|
|
@ -1,284 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/sec_fsm.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file sec_fsm.h
|
||||
\brief Declaration of functions and finite state machine for SECURITY Module.
|
||||
|
||||
Function declaration for privacy.c and SEC_STATE for SECURITY FSM.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: sec_fsm.h $
|
||||
*
|
||||
* 09 29 2010 wh.su
|
||||
* [WCXRP00000072] [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue
|
||||
* [MT6620 Wi-Fi][Driver] Fix TKIP Counter Measure EAPoL callback register issue.
|
||||
*
|
||||
* 09 21 2010 kevin.huang
|
||||
* [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
|
||||
* Eliminate Linux Compile Warning
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 08 20 2010 wh.su
|
||||
* NULL
|
||||
* adding the eapol callback setting.
|
||||
*
|
||||
* 08 19 2010 wh.su
|
||||
* NULL
|
||||
* adding the tx pkt call back handle for countermeasure.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 21 2010 wh.su
|
||||
* [WPD00003840][MT6620 5931] Security migration
|
||||
* modify some code for concurrent network.
|
||||
*
|
||||
* 06 19 2010 wh.su
|
||||
* [WPD00003840][MT6620 5931] Security migration
|
||||
* consdier the concurrent network setting.
|
||||
*
|
||||
* 03 04 2010 wh.su
|
||||
* [BORA00000605][WIFISYS] Phase3 Integration
|
||||
* Code refine, and remove non-used code.
|
||||
*
|
||||
* 03 03 2010 wh.su
|
||||
* [BORA00000637][MT6620 Wi-Fi] [Bug] WPA2 pre-authentication timer not correctly initialize
|
||||
* Fixed the pre-authentication timer not correctly init issue, and modify the security related callback function prototype.
|
||||
*
|
||||
* 03 01 2010 wh.su
|
||||
* [BORA00000605][WIFISYS] Phase3 Integration
|
||||
* Refine the variable and parameter for security.
|
||||
*
|
||||
* 12 18 2009 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* .
|
||||
*
|
||||
* Dec 7 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* fixed the deauth Tx done callback parameter
|
||||
*
|
||||
* Dec 4 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the reference function declaration
|
||||
*
|
||||
* Dec 3 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* delete non-used code
|
||||
*
|
||||
* Dec 1 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adjust the function prototype
|
||||
*
|
||||
* Nov 23 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adjust the function declaration
|
||||
*
|
||||
* Nov 19 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding the security variable
|
||||
*
|
||||
* Nov 18 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
*
|
||||
** \main\maintrunk.MT5921\14 2009-04-06 15:35:47 GMT mtk01088
|
||||
** add the variable to set the disable AP selection for privacy check, for wps open networking.
|
||||
** \main\maintrunk.MT5921\13 2008-11-19 11:46:01 GMT mtk01088
|
||||
** rename some variable with pre-fix to avoid the misunderstanding
|
||||
** \main\maintrunk.MT5921\12 2008-08-28 20:37:11 GMT mtk01088
|
||||
** remove non-used code
|
||||
**
|
||||
** \main\maintrunk.MT5921\11 2008-03-18 09:51:52 GMT mtk01088
|
||||
** Add function declaration for timer to indicate pmkid candidate
|
||||
** \main\maintrunk.MT5921\10 2008-02-29 15:12:08 GMT mtk01088
|
||||
** add variable for sw port control
|
||||
** \main\maintrunk.MT5921\9 2008-02-29 12:37:30 GMT mtk01088
|
||||
** rename the security related function declaration
|
||||
** \main\maintrunk.MT5921\8 2007-12-27 13:59:08 GMT mtk01088
|
||||
** adjust the wlan table and sec fsm init timing
|
||||
** \main\maintrunk.MT5921\7 2007-11-20 10:39:49 GMT mtk01088
|
||||
** add function timer for wait EAPoL Error timeout
|
||||
** \main\maintrunk.MT5921\6 2007-11-06 20:39:08 GMT mtk01088
|
||||
** rename the counter measure timer
|
||||
** \main\maintrunk.MT5921\5 2007-11-06 20:14:31 GMT mtk01088
|
||||
** add a abort function
|
||||
** Revision 1.5 2007/07/16 02:33:42 MTK01088
|
||||
** change the ENUM declaration structure prefix from r to e
|
||||
**
|
||||
** Revision 1.4 2007/07/09 06:23:10 MTK01088
|
||||
** update
|
||||
**
|
||||
** Revision 1.3 2007/07/04 10:09:04 MTK01088
|
||||
** adjust the state for security fsm
|
||||
** change function name
|
||||
**
|
||||
** Revision 1.2 2007/07/03 08:13:22 MTK01088
|
||||
** change the sec fsm state
|
||||
** add the event for sec fsm
|
||||
**
|
||||
** Revision 1.1 2007/06/27 06:20:35 MTK01088
|
||||
** add the sec fsm header file
|
||||
**
|
||||
**
|
||||
*/
|
||||
#ifndef _SEC_FSM_H
|
||||
#define _SEC_FSM_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/* TKIP CounterMeasure interval for Rejoin to Network. */
|
||||
#define COUNTER_MEASURE_TIMEOUT_INTERVAL_SEC 60
|
||||
|
||||
/* Timeout to wait the EAPoL Error Report frame Send out. */
|
||||
#define EAPOL_REPORT_SEND_TIMEOUT_INTERVAL_SEC 1
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
typedef UINT_32 SEC_STATUS, *P_SEC_STATUS;
|
||||
|
||||
#if 0
|
||||
/* WPA2 PMKID candicate structure */
|
||||
typedef struct _PMKID_CANDICATE_T {
|
||||
UINT_8 aucBssid[MAC_ADDR_LEN]; /* MAC address */
|
||||
UINT_32 u4PreAuthFlags;
|
||||
} PMKID_CANDICATE_T, *P_PMKID_CANDICATE_T;
|
||||
#endif
|
||||
|
||||
typedef SEC_STATUS (*PFN_SEC_FSM_STATE_HANDLER)(VOID);
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define SEC_STATE_TRANSITION_FLAG fgIsTransition
|
||||
#define SEC_NEXT_STATE_VAR eNextState
|
||||
|
||||
#define SEC_STATE_TRANSITION(prAdapter, prSta, eFromState, eToState) \
|
||||
{ secFsmTrans_ ## eFromState ## _to_ ## eToState(prAdapter, prSta); \
|
||||
SEC_NEXT_STATE_VAR = SEC_STATE_ ## eToState; \
|
||||
SEC_STATE_TRANSITION_FLAG = (BOOLEAN)TRUE; \
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
/* Routines to handle the sec check */
|
||||
/*--------------------------------------------------------------*/
|
||||
/***** Routines in sec_fsm.c *****/
|
||||
VOID
|
||||
secFsmInit(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prSta
|
||||
);
|
||||
|
||||
VOID
|
||||
secFsmEventInit(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prSta
|
||||
);
|
||||
|
||||
VOID
|
||||
secFsmEventStart(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prSta
|
||||
);
|
||||
|
||||
VOID
|
||||
secFsmEventAbort(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prSta
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
secFsmEventPTKInstalled(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prSta
|
||||
);
|
||||
|
||||
VOID
|
||||
secFsmEvent2ndEapolTx(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prSta
|
||||
);
|
||||
|
||||
VOID
|
||||
secFsmEvent4ndEapolTxDone(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prSta
|
||||
);
|
||||
|
||||
VOID
|
||||
secFsmEventEapolTxDone (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN ENUM_TX_RESULT_CODE_T rTxDoneStatus
|
||||
);
|
||||
|
||||
VOID
|
||||
secFsmEventEapolTxTimeout (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4Parm
|
||||
);
|
||||
|
||||
VOID
|
||||
secFsmEventDeauthTxDone(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN ENUM_TX_RESULT_CODE_T rTxDoneStatus
|
||||
);
|
||||
|
||||
VOID
|
||||
secFsmEventStartCounterMeasure(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prSta
|
||||
);
|
||||
|
||||
VOID
|
||||
secFsmEventEndOfCounterMeasure(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4Parm
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#endif /* _SEC_FSM_H */
|
||||
|
||||
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/swcr.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "swcr.h"
|
||||
\brief
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _SWCR_H
|
||||
#define _SWCR_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#define SWCR_VAR(x) ((VOID *)&x)
|
||||
#define SWCR_FUNC(x) ((VOID *)x)
|
||||
|
||||
#define SWCR_T_FUNC BIT(7)
|
||||
|
||||
#define SWCR_L_32 3
|
||||
#define SWCR_L_16 2
|
||||
#define SWCR_L_8 1
|
||||
|
||||
#define SWCR_READ 0
|
||||
#define SWCR_WRITE 1
|
||||
|
||||
#define SWCR_MAP_NUM(x) (sizeof(x)/sizeof(x[0]))
|
||||
|
||||
#define SWCR_CR_NUM 7
|
||||
|
||||
#define SWCR_GET_RW_INDEX(action,rw,index) \
|
||||
index = action & 0x7F; \
|
||||
rw = action >> 7;
|
||||
|
||||
|
||||
extern UINT_32 g_au4SwCr[]; /*: 0: command other: data */
|
||||
|
||||
typedef VOID (*PFN_SWCR_RW_T)(P_ADAPTER_T prAdapter, UINT_8 ucRead, UINT_16 u2Addr, UINT_32 *pu4Data);
|
||||
typedef VOID (*PFN_CMD_RW_T)(P_ADAPTER_T prAdapter, UINT_8 ucCate, UINT_8 ucAction, UINT_8 ucOpt0,UINT_8 ucOpt1);
|
||||
|
||||
typedef struct _SWCR_MAP_ENTRY_T {
|
||||
UINT_16 u2Type;
|
||||
PVOID u4Addr;
|
||||
} SWCR_MAP_ENTRY_T, *P_SWCR_MAP_ENTRY_T;
|
||||
|
||||
|
||||
typedef struct _SWCR_MOD_MAP_ENTRY_T {
|
||||
UINT_8 ucMapNum;
|
||||
P_SWCR_MAP_ENTRY_T prSwCrMap;
|
||||
} SWCR_MOD_MAP_ENTRY_T, *P_SWCR_MOD_MAP_ENTRY_T;
|
||||
|
||||
typedef enum _ENUM_SWCR_DBG_TYPE_T {
|
||||
SWCR_DBG_TYPE_ALL = 0,
|
||||
SWCR_DBG_TYPE_TXRX,
|
||||
SWCR_DBG_TYPE_RX_RATES,
|
||||
SWCR_DBG_TYPE_PS,
|
||||
SWCR_DBG_TYPE_NUM
|
||||
} ENUM_SWCR_DBG_TYPE_T;
|
||||
|
||||
typedef enum _ENUM_SWCR_DBG_ALL_T {
|
||||
SWCR_DBG_ALL_TX_CNT = 0,
|
||||
SWCR_DBG_ALL_TX_BCN_CNT,
|
||||
SWCR_DBG_ALL_TX_FAILED_CNT,
|
||||
SWCR_DBG_ALL_TX_RETRY_CNT,
|
||||
SWCR_DBG_ALL_TX_AGING_TIMEOUT_CNT,
|
||||
SWCR_DBG_ALL_TX_PS_OVERFLOW_CNT,
|
||||
SWCR_DBG_ALL_TX_MGNT_DROP_CNT,
|
||||
SWCR_DBG_ALL_TX_ERROR_CNT,
|
||||
|
||||
SWCR_DBG_ALL_RX_CNT,
|
||||
SWCR_DBG_ALL_RX_DROP_CNT,
|
||||
SWCR_DBG_ALL_RX_DUP_DROP_CNT,
|
||||
SWCR_DBG_ALL_RX_TYPE_ERROR_DROP_CNT,
|
||||
SWCR_DBG_ALL_RX_CLASS_ERROR_DROP_CNT,
|
||||
SWCR_DBG_ALL_RX_AMPDU_ERROR_DROP_CNT,
|
||||
|
||||
SWCR_DBG_ALL_RX_STATUS_ERROR_DROP_CNT,
|
||||
SWCR_DBG_ALL_RX_FORMAT_ERROR_DROP_CNT,
|
||||
SWCR_DBG_ALL_RX_ICV_ERROR_DROP_CNT,
|
||||
SWCR_DBG_ALL_RX_KEY_ERROR_DROP_CNT,
|
||||
SWCR_DBG_ALL_RX_TKIP_ERROR_DROP_CNT,
|
||||
SWCR_DBG_ALL_RX_MIC_ERROR_DROP_CNT,
|
||||
SWCR_DBG_ALL_RX_BIP_ERROR_DROP_CNT,
|
||||
|
||||
SWCR_DBG_ALL_RX_FCSERR_CNT,
|
||||
SWCR_DBG_ALL_RX_FIFOFULL_CNT,
|
||||
SWCR_DBG_ALL_RX_PFDROP_CNT,
|
||||
|
||||
SWCR_DBG_ALL_PWR_PS_POLL_CNT,
|
||||
SWCR_DBG_ALL_PWR_TRIGGER_NULL_CNT,
|
||||
SWCR_DBG_ALL_PWR_BCN_IND_CNT,
|
||||
SWCR_DBG_ALL_PWR_BCN_TIMEOUT_CNT,
|
||||
SWCR_DBG_ALL_PWR_PM_STATE0,
|
||||
SWCR_DBG_ALL_PWR_PM_STATE1,
|
||||
SWCR_DBG_ALL_PWR_CUR_PS_PROF0,
|
||||
SWCR_DBG_ALL_PWR_CUR_PS_PROF1,
|
||||
|
||||
SWCR_DBG_ALL_AR_STA0_RATE,
|
||||
SWCR_DBG_ALL_AR_STA0_BWGI,
|
||||
SWCR_DBG_ALL_AR_STA0_RX_RATE_RCPI,
|
||||
|
||||
SWCR_DBG_ALL_ROAMING_ENABLE,
|
||||
SWCR_DBG_ALL_ROAMING_ROAM_CNT,
|
||||
SWCR_DBG_ALL_ROAMING_INT_CNT,
|
||||
|
||||
SWCR_DBG_ALL_BB_RX_MDRDY_CNT,
|
||||
SWCR_DBG_ALL_BB_RX_FCSERR_CNT,
|
||||
SWCR_DBG_ALL_BB_CCK_PD_CNT,
|
||||
SWCR_DBG_ALL_BB_OFDM_PD_CNT,
|
||||
SWCR_DBG_ALL_BB_CCK_SFDERR_CNT,
|
||||
SWCR_DBG_ALL_BB_CCK_SIGERR_CNT,
|
||||
SWCR_DBG_ALL_BB_OFDM_TAGERR_CNT,
|
||||
SWCR_DBG_ALL_BB_OFDM_SIGERR_CNT,
|
||||
|
||||
SWCR_DBG_ALL_NUM
|
||||
} ENUM_SWCR_DBG_ALL_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
VOID swCrReadWriteCmd(
|
||||
P_ADAPTER_T prAdapter,
|
||||
UINT_8 ucRead,
|
||||
UINT_16 u2Addr,
|
||||
UINT_32 *pu4Data
|
||||
);
|
||||
|
||||
/* Debug Support */
|
||||
VOID swCrFrameCheckEnable(P_ADAPTER_T prAdapter, UINT_32 u4DumpType);
|
||||
VOID swCrDebugInit(P_ADAPTER_T prAdapter);
|
||||
VOID swCrDebugCheckEnable(P_ADAPTER_T prAdapter, BOOLEAN fgIsEnable, UINT_8 ucType, UINT_32 u4Timeout);
|
||||
VOID swCrDebugUninit(P_ADAPTER_T prAdapter);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/wapi.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file wapi.h
|
||||
\brief The wapi related define, macro and structure are described here.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: wapi.h $
|
||||
*
|
||||
* 07 20 2010 wh.su
|
||||
*
|
||||
* .
|
||||
*
|
||||
* 01 27 2010 wh.su
|
||||
* [BORA00000476][Wi-Fi][firmware] Add the security module initialize code
|
||||
* add and fixed some security function.
|
||||
*
|
||||
* Dec 8 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* change the wapi function name and adding the generate wapi ie function
|
||||
*
|
||||
* Dec 7 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
* adding some wapi structure define
|
||||
*
|
||||
* Nov 23 2009 mtk01088
|
||||
* [BORA00000476] [Wi-Fi][firmware] Add the security module initialize code
|
||||
*
|
||||
** \main\maintrunk.MT5921\1 2009-10-09 17:06:29 GMT mtk01088
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _WAPI_H
|
||||
#define _WAPI_H
|
||||
|
||||
#if CFG_SUPPORT_WAPI
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define WAPI_CIPHER_SUITE_WPI 0x01721400 /* WPI_SMS4 */
|
||||
#define WAPI_AKM_SUITE_802_1X 0x01721400 /* WAI */
|
||||
#define WAPI_AKM_SUITE_PSK 0x02721400 /* WAI_PSK */
|
||||
|
||||
#define ELEM_ID_WAPI 68 /* WAPI IE */
|
||||
|
||||
#define WAPI_IE(fp) ((P_WAPI_INFO_ELEM_T) fp)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
VOID
|
||||
wapiGenerateWAPIIE(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
wapiParseWapiIE (
|
||||
IN P_WAPI_INFO_ELEM_T prInfoElem,
|
||||
OUT P_WAPI_INFO_T prWapiInfo
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
wapiPerformPolicySelection(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBss
|
||||
);
|
||||
|
||||
//BOOLEAN
|
||||
//wapiUpdateTxKeyIdx (
|
||||
// IN P_STA_RECORD_T prStaRec,
|
||||
// IN UINT_8 ucWlanIdx
|
||||
// );
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#endif
|
||||
#endif /* _WAPI_H */
|
||||
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/mgmt/wlan_typedef.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file wlan_typedef.h
|
||||
\brief Declaration of data type and return values of internal protocol stack.
|
||||
|
||||
In this file we declare the data type and return values which will be exported
|
||||
to all MGMT Protocol Stack.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: wlan_typedef.h $
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_TYPEDEF_H
|
||||
#define _WLAN_TYPEDEF_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Type definition for BSS_INFO_T structure, to describe the attributes used in a
|
||||
* common BSS.
|
||||
*/
|
||||
typedef struct _BSS_INFO_T BSS_INFO_T, *P_BSS_INFO_T;
|
||||
|
||||
typedef BSS_INFO_T AIS_BSS_INFO_T, *P_AIS_BSS_INFO_T;
|
||||
typedef BSS_INFO_T P2P_BSS_INFO_T, *P_P2P_BSS_INFO_T;
|
||||
typedef BSS_INFO_T BOW_BSS_INFO_T, *P_BOW_BSS_INFO_T;
|
||||
|
||||
typedef struct _AIS_SPECIFIC_BSS_INFO_T AIS_SPECIFIC_BSS_INFO_T, *P_AIS_SPECIFIC_BSS_INFO_T;
|
||||
typedef struct _P2P_SPECIFIC_BSS_INFO_T P2P_SPECIFIC_BSS_INFO_T, *P_P2P_SPECIFIC_BSS_INFO_T;
|
||||
typedef struct _BOW_SPECIFIC_BSS_INFO_T BOW_SPECIFIC_BSS_INFO_T, *P_BOW_SPECIFIC_BSS_INFO_T;
|
||||
/* CFG_SUPPORT_WFD */
|
||||
typedef struct _WFD_CFG_SETTINGS_T WFD_CFG_SETTINGS_T, *P_WFD_CFG_SETTINGS_T;
|
||||
|
||||
|
||||
/* BSS related structures */
|
||||
/* Type definition for BSS_DESC_T structure, to describe parameter sets of a particular BSS */
|
||||
typedef struct _BSS_DESC_T BSS_DESC_T, *P_BSS_DESC_T, **PP_BSS_DESC_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#endif /* _WLAN_TYPEDEF_H */
|
||||
|
||||
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/MT6620_5931_WiFi_Driver/include/mgmt/wnm.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file wnm.h
|
||||
\brief This file contains the IEEE 802.11 family related 802.11v network management
|
||||
for MediaTek 802.11 Wireless LAN Adapters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: wnm.h $
|
||||
*
|
||||
* 01 05 2012 tsaiyuan.hsu
|
||||
* [WCXRP00001157] [MT6620 Wi-Fi][FW][DRV] add timing measurement support for 802.11v
|
||||
* add timing measurement support for 802.11v.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _WNM_H
|
||||
#define _WNM_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
typedef struct _TIMINGMSMT_PARAM_T {
|
||||
BOOLEAN fgInitiator;
|
||||
UINT_8 ucTrigger;
|
||||
UINT_8 ucDialogToken; /* Dialog Token */
|
||||
UINT_8 ucFollowUpDialogToken; /* Follow Up Dialog Token */
|
||||
UINT_32 u4ToD; /* Timestamp of Departure [10ns] */
|
||||
UINT_32 u4ToA; /* Timestamp of Arrival [10ns] */
|
||||
} TIMINGMSMT_PARAM_T, *P_TIMINGMSMT_PARAM_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
VOID
|
||||
wnmWNMAction (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
wnmReportTimingMeas (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucStaRecIndex,
|
||||
IN UINT_32 u4ToD,
|
||||
IN UINT_32 u4ToA
|
||||
);
|
||||
|
||||
#define WNM_UNIT_TEST 1
|
||||
|
||||
#if WNM_UNIT_TEST
|
||||
VOID wnmTimingMeasUnitTest1(P_ADAPTER_T prAdapter, UINT_8 ucStaRecIndex);
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _WNM_H */
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,323 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/bow.h#1 $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: bow.h $
|
||||
*
|
||||
* 01 16 2012 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Support BOW for 5GHz band.
|
||||
*
|
||||
* 05 25 2011 terry.wu
|
||||
* [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment
|
||||
* Add BoW Cancel Scan Request and Turn On deactive network function.
|
||||
*
|
||||
* 05 22 2011 terry.wu
|
||||
* [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment
|
||||
* Submit missing BoW header files.
|
||||
*
|
||||
* 03 27 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Support multiple physical link.
|
||||
*
|
||||
* 03 06 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Sync BOW Driver to latest person development branch version..
|
||||
*
|
||||
* 02 10 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Fix kernel API change issue.
|
||||
* Before ALPS 2.2 (2.2 included), kfifo_alloc() is
|
||||
* struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, spinlock_t *lock);
|
||||
* After ALPS 2.3, kfifo_alloc() is changed to
|
||||
* int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask);
|
||||
*
|
||||
* 02 10 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Update BOW structure.
|
||||
*
|
||||
* 02 09 2011 cp.wu
|
||||
* [WCXRP00000430] [MT6620 Wi-Fi][Firmware][Driver] Create V1.2 branch for MT6620E1 and MT6620E3
|
||||
* create V1.2 driver branch based on label MT6620_WIFI_DRIVER_V1_2_110209_1031
|
||||
* with BOW and P2P enabled as default
|
||||
*
|
||||
* 02 08 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Replace kfifo_get and kfifo_put with kfifo_out and kfifo_in.
|
||||
* Update BOW get MAC status, remove returning event for AIS network type.
|
||||
*
|
||||
* 01 11 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Add Activity Report definition.
|
||||
*
|
||||
* 10 18 2010 chinghwa.yu
|
||||
* [WCXRP00000110] [MT6620 Wi-Fi] [Driver] Fix BoW Connected event size
|
||||
* Fix wrong BoW event size.
|
||||
*
|
||||
* 07 15 2010 cp.wu
|
||||
*
|
||||
* sync. bluetooth-over-Wi-Fi interface to driver interface document v0.2.6.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 05 13 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* 1) all BT physical handles shares the same RSSI/Link Quality.
|
||||
* 2) simplify BT command composing
|
||||
*
|
||||
* 04 28 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* change prefix for data structure used to communicate with 802.11 PAL
|
||||
* to avoid ambiguous naming with firmware interface
|
||||
*
|
||||
* 04 27 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* basic implementation for EVENT_BT_OVER_WIFI
|
||||
*
|
||||
* 04 13 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* add framework for BT-over-Wi-Fi support.
|
||||
* * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability
|
||||
* * * * * * * 2) command sequence number is now increased atomically
|
||||
* * * * * * * 3) private data could be hold and taken use for other purpose
|
||||
*
|
||||
* 04 09 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* sync. with design document for interface change.
|
||||
*
|
||||
* 04 02 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* Wi-Fi driver no longer needs to implement 802.11 PAL, thus replaced by wrapping command/event definitions
|
||||
*
|
||||
* 03 16 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* correct typo.
|
||||
*
|
||||
* 03 16 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* update for all command/event needed to be supported by 802.11 PAL.
|
||||
*
|
||||
* 03 16 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* build up basic data structure and definitions to support BT-over-WiFi
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _BOW_H_
|
||||
#define _BOW_H_
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#define BOWDEVNAME "bow0"
|
||||
|
||||
#define MAX_BOW_NUMBER_OF_CHANNEL_2G4 14
|
||||
#define MAX_BOW_NUMBER_OF_CHANNEL_5G 4
|
||||
#define MAX_BOW_NUMBER_OF_CHANNEL 18 //(MAX_BOW_NUMBER_OF_CHANNEL_2G4 + MAX_BOW_NUMBER_OF_CHANNEL_5G)
|
||||
|
||||
#define MAX_ACTIVITY_REPORT 2
|
||||
#define MAX_ACTIVITY_REPROT_TIME 660
|
||||
|
||||
#define ACTIVITY_REPORT_STATUS_SUCCESS 0
|
||||
#define ACTIVITY_REPORT_STATUS_FAILURE 1
|
||||
#define ACTIVITY_REPORT_STATUS_TIME_INVALID 2
|
||||
#define ACTIVITY_REPORT_STATUS_OTHERS 3
|
||||
|
||||
#define ACTIVITY_REPORT_SCHEDULE_UNKNOWN 0 //Does not know the schedule of the interference
|
||||
#define ACTIVITY_REPORT_SCHEDULE_KNOWN 1
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
typedef struct _BT_OVER_WIFI_COMMAND_HEADER_T {
|
||||
UINT_8 ucCommandId;
|
||||
UINT_8 ucSeqNumber;
|
||||
UINT_16 u2PayloadLength;
|
||||
} AMPC_COMMAND_HEADER_T, *P_AMPC_COMMAND_HEADER_T;
|
||||
|
||||
typedef struct _BT_OVER_WIFI_COMMAND {
|
||||
AMPC_COMMAND_HEADER_T rHeader;
|
||||
UINT_8 aucPayload[0];
|
||||
} AMPC_COMMAND, *P_AMPC_COMMAND;
|
||||
|
||||
typedef struct _BT_OVER_WIFI_EVENT_HEADER_T {
|
||||
UINT_8 ucEventId;
|
||||
UINT_8 ucSeqNumber;
|
||||
UINT_16 u2PayloadLength;
|
||||
} AMPC_EVENT_HEADER_T, *P_AMPC_EVENT_HEADER_T;
|
||||
|
||||
typedef struct _BT_OVER_WIFI_EVENT {
|
||||
AMPC_EVENT_HEADER_T rHeader;
|
||||
UINT_8 aucPayload[0];
|
||||
} AMPC_EVENT, *P_AMPC_EVENT;
|
||||
|
||||
typedef struct _CHANNEL_DESC_T {
|
||||
UINT_8 ucChannelBand;
|
||||
UINT_8 ucChannelNum;
|
||||
} CHANNEL_DESC, P_CHANNEL_DESC;
|
||||
|
||||
// Command Structures
|
||||
typedef struct _BOW_SETUP_CONNECTION {
|
||||
//Fixed to 2.4G
|
||||
UINT_8 ucChannelNum;
|
||||
UINT_8 ucReserved1;
|
||||
UINT_8 aucPeerAddress[6];
|
||||
UINT_16 u2BeaconInterval;
|
||||
UINT_8 ucTimeoutDiscovery;
|
||||
UINT_8 ucTimeoutInactivity;
|
||||
UINT_8 ucRole;
|
||||
UINT_8 ucPAL_Capabilities;
|
||||
INT_8 cMaxTxPower;
|
||||
UINT_8 ucReserved2;
|
||||
|
||||
//Pending, for future BOW 5G supporting.
|
||||
/* UINT_8 aucPeerAddress[6];
|
||||
UINT_16 u2BeaconInterval;
|
||||
UINT_8 ucTimeoutDiscovery;
|
||||
UINT_8 ucTimeoutInactivity;
|
||||
UINT_8 ucRole;
|
||||
UINT_8 ucPAL_Capabilities;
|
||||
INT_8 cMaxTxPower;
|
||||
UINT_8 ucChannelListNum;
|
||||
CHANNEL_DESC arChannelList[1];
|
||||
*/
|
||||
} BOW_SETUP_CONNECTION, *P_BOW_SETUP_CONNECTION;
|
||||
|
||||
typedef struct _BOW_DESTROY_CONNECTION {
|
||||
UINT_8 aucPeerAddress[6];
|
||||
UINT_8 aucReserved[2];
|
||||
} BOW_DESTROY_CONNECTION, *P_BOW_DESTROY_CONNECTION;
|
||||
|
||||
typedef struct _BOW_SET_PTK {
|
||||
UINT_8 aucPeerAddress[6];
|
||||
UINT_8 aucReserved[2];
|
||||
UINT_8 aucTemporalKey[16];
|
||||
} BOW_SET_PTK, *P_BOW_SET_PTK;
|
||||
|
||||
typedef struct _BOW_READ_RSSI {
|
||||
UINT_8 aucPeerAddress[6];
|
||||
UINT_8 aucReserved[2];
|
||||
} BOW_READ_RSSI, *P_BOW_READ_RSSI;
|
||||
|
||||
typedef struct _BOW_READ_LINK_QUALITY {
|
||||
UINT_8 aucPeerAddress[6];
|
||||
UINT_8 aucReserved[2];
|
||||
} BOW_READ_LINK_QUALITY, *P_BOW_READ_LINK_QUALITY;
|
||||
|
||||
typedef struct _BOW_SHORT_RANGE_MODE {
|
||||
UINT_8 aucPeerAddress[6];
|
||||
INT_8 cTxPower;
|
||||
UINT_8 ucReserved;
|
||||
} BOW_SHORT_RANGE_MODE, *P_BOW_SHORT_RANGE_MODE;
|
||||
|
||||
// Event Structures
|
||||
typedef struct _BOW_COMMAND_STATUS {
|
||||
UINT_8 ucStatus;
|
||||
UINT_8 ucReserved[3];
|
||||
} BOW_COMMAND_STATUS, *P_BOW_COMMAND_STATUS;
|
||||
|
||||
typedef struct _BOW_MAC_STATUS {
|
||||
UINT_8 aucMacAddr[6];
|
||||
UINT_8 ucAvailability;
|
||||
UINT_8 ucNumOfChannel;
|
||||
CHANNEL_DESC arChannelList[MAX_BOW_NUMBER_OF_CHANNEL];
|
||||
} BOW_MAC_STATUS, *P_BOW_MAC_STATUS;
|
||||
|
||||
typedef struct _BOW_LINK_CONNECTED {
|
||||
CHANNEL_DESC rChannel;
|
||||
UINT_8 aucReserved;
|
||||
UINT_8 aucPeerAddress[6];
|
||||
} BOW_LINK_CONNECTED, *P_BOW_LINK_CONNECTED;
|
||||
|
||||
typedef struct _BOW_LINK_DISCONNECTED {
|
||||
UINT_8 ucReason;
|
||||
UINT_8 aucReserved;
|
||||
UINT_8 aucPeerAddress[6];
|
||||
} BOW_LINK_DISCONNECTED, *P_BOW_LINK_DISCONNECTED;
|
||||
|
||||
typedef struct _BOW_RSSI {
|
||||
INT_8 cRssi;
|
||||
UINT_8 aucReserved[3];
|
||||
} BOW_RSSI, *P_BOW_RSSI;
|
||||
|
||||
typedef struct _BOW_LINK_QUALITY {
|
||||
UINT_8 ucLinkQuality;
|
||||
UINT_8 aucReserved[3];
|
||||
} BOW_LINK_QUALITY, *P_BOW_LINK_QUALITY;
|
||||
|
||||
typedef enum _ENUM_BOW_CMD_ID_T {
|
||||
BOW_CMD_ID_GET_MAC_STATUS = 1,
|
||||
BOW_CMD_ID_SETUP_CONNECTION,
|
||||
BOW_CMD_ID_DESTROY_CONNECTION,
|
||||
BOW_CMD_ID_SET_PTK,
|
||||
BOW_CMD_ID_READ_RSSI,
|
||||
BOW_CMD_ID_READ_LINK_QUALITY,
|
||||
BOW_CMD_ID_SHORT_RANGE_MODE,
|
||||
BOW_CMD_ID_GET_CHANNEL_LIST,
|
||||
} ENUM_BOW_CMD_ID_T, *P_ENUM_BOW_CMD_ID_T;
|
||||
|
||||
typedef enum _ENUM_BOW_EVENT_ID_T {
|
||||
BOW_EVENT_ID_COMMAND_STATUS = 1,
|
||||
BOW_EVENT_ID_MAC_STATUS,
|
||||
BOW_EVENT_ID_LINK_CONNECTED,
|
||||
BOW_EVENT_ID_LINK_DISCONNECTED,
|
||||
BOW_EVENT_ID_RSSI,
|
||||
BOW_EVENT_ID_LINK_QUALITY,
|
||||
BOW_EVENT_ID_CHANNEL_LIST,
|
||||
BOW_EVENT_ID_CHANNEL_SELECTED,
|
||||
} ENUM_BOW_EVENT_ID_T, *P_ENUM_BOW_EVENT_ID_T;
|
||||
|
||||
typedef enum _ENUM_BOW_DEVICE_STATE {
|
||||
BOW_DEVICE_STATE_DISCONNECTED = 0,
|
||||
BOW_DEVICE_STATE_DISCONNECTING,
|
||||
BOW_DEVICE_STATE_ACQUIRING_CHANNEL,
|
||||
BOW_DEVICE_STATE_STARTING,
|
||||
BOW_DEVICE_STATE_SCANNING,
|
||||
BOW_DEVICE_STATE_CONNECTING,
|
||||
BOW_DEVICE_STATE_CONNECTED,
|
||||
BOW_DEVICE_STATE_NUM
|
||||
} ENUM_BOW_DEVICE_STATE, *P_ENUM_BOW_DEVICE_STATE;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /*_BOW_H */
|
||||
|
|
@ -1,176 +0,0 @@
|
|||
/*
|
||||
** $Id:
|
||||
*/
|
||||
|
||||
/*! \file "cmd_buf.h"
|
||||
\brief In this file we define the structure for Command Packet.
|
||||
|
||||
In this file we define the structure for Command Packet and the control unit
|
||||
of MGMT Memory Pool.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: cmd_buf.h $
|
||||
*
|
||||
* 10 04 2010 cp.wu
|
||||
* [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only
|
||||
* remove ENUM_NETWORK_TYPE_T definitions
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 07 13 2010 cp.wu
|
||||
*
|
||||
* 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets
|
||||
* 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending
|
||||
* 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid descriptor underflow under concurrent network operation
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 01 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Enable change log
|
||||
*/
|
||||
|
||||
#ifndef _CMD_BUF_H
|
||||
#define _CMD_BUF_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
typedef enum _COMMAND_TYPE {
|
||||
COMMAND_TYPE_GENERAL_IOCTL,
|
||||
COMMAND_TYPE_NETWORK_IOCTL,
|
||||
COMMAND_TYPE_SECURITY_FRAME,
|
||||
COMMAND_TYPE_MANAGEMENT_FRAME,
|
||||
COMMAND_TYPE_NUM
|
||||
} COMMAND_TYPE, *P_COMMAND_TYPE;
|
||||
|
||||
typedef VOID (*PFN_CMD_DONE_HANDLER) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo,
|
||||
IN PUINT_8 pucEventBuf
|
||||
);
|
||||
|
||||
typedef VOID (*PFN_CMD_TIMEOUT_HANDLER) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo
|
||||
);
|
||||
|
||||
struct _CMD_INFO_T {
|
||||
QUE_ENTRY_T rQueEntry;
|
||||
|
||||
COMMAND_TYPE eCmdType;
|
||||
|
||||
UINT_16 u2InfoBufLen; /* This is actual CMD buffer length */
|
||||
PUINT_8 pucInfoBuffer; /* May pointer to structure in prAdapter */
|
||||
P_NATIVE_PACKET prPacket; /* only valid when it's a security frame */
|
||||
|
||||
ENUM_NETWORK_TYPE_INDEX_T eNetworkType;
|
||||
UINT_8 ucStaRecIndex; /* only valid when it's a security frame */
|
||||
|
||||
PFN_CMD_DONE_HANDLER pfCmdDoneHandler;
|
||||
PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler;
|
||||
|
||||
BOOLEAN fgIsOid; /* Used to check if we need indicate */
|
||||
|
||||
UINT_8 ucCID;
|
||||
BOOLEAN fgSetQuery;
|
||||
BOOLEAN fgNeedResp;
|
||||
BOOLEAN fgDriverDomainMCR; /* Access Driver Domain MCR, for CMD_ID_ACCESS_REG only */
|
||||
UINT_8 ucCmdSeqNum;
|
||||
UINT_32 u4SetInfoLen; /* Indicate how many byte we read for Set OID */
|
||||
|
||||
/* information indicating by OID/ioctl */
|
||||
PVOID pvInformationBuffer;
|
||||
UINT_32 u4InformationBufferLength;
|
||||
|
||||
/* private data */
|
||||
UINT_32 u4PrivateData;
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
VOID
|
||||
cmdBufInitialize (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
P_CMD_INFO_T
|
||||
cmdBufAllocateCmdInfo (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4Length
|
||||
);
|
||||
|
||||
VOID
|
||||
cmdBufFreeCmdInfo (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines for CMDs */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
wlanSendSetQueryCmd (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_8 ucCID,
|
||||
BOOLEAN fgSetQuery,
|
||||
BOOLEAN fgNeedResp,
|
||||
BOOLEAN fgIsOid,
|
||||
PFN_CMD_DONE_HANDLER pfCmdDoneHandler,
|
||||
PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler,
|
||||
UINT_32 u4SetQueryInfoLen,
|
||||
PUINT_8 pucInfoBuffer,
|
||||
OUT PVOID pvSetQueryBuffer,
|
||||
IN UINT_32 u4SetQueryBufferLen
|
||||
);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#endif /* _CMD_BUF_H */
|
||||
|
||||
|
||||
|
|
@ -1,609 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/hal.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "hal.h"
|
||||
\brief The declaration of hal functions
|
||||
|
||||
N/A
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: hal.h $
|
||||
*
|
||||
* 04 01 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000615] [MT 6620 Wi-Fi][Driver] Fix klocwork issues
|
||||
* fix the klocwork issues, 57500, 57501, 57502 and 57503.
|
||||
*
|
||||
* 03 21 2011 cp.wu
|
||||
* [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer
|
||||
* portability improvement
|
||||
*
|
||||
* 03 07 2011 terry.wu
|
||||
* [WCXRP00000521] [MT6620 Wi-Fi][Driver] Remove non-standard debug message
|
||||
* Toggle non-standard debug messages to comments.
|
||||
*
|
||||
* 11 08 2010 cp.wu
|
||||
* [WCXRP00000166] [MT6620 Wi-Fi][Driver] use SDIO CMD52 for enabling/disabling interrupt to reduce transaction period
|
||||
* change to use CMD52 for enabling/disabling interrupt to reduce SDIO transaction time
|
||||
*
|
||||
* 09 01 2010 cp.wu
|
||||
* NULL
|
||||
* move HIF CR initialization from where after sdioSetupCardFeature() to wlanAdapterStart()
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 15 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* change zero-padding for TX port access to HAL.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 04 06 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* eliminate direct access for prGlueInfo->fgIsCardRemoved in non-glue layer
|
||||
*
|
||||
* 01 27 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1. eliminate improper variable in rHifInfo
|
||||
* * * * 2. block TX/ordinary OID when RF test mode is engaged
|
||||
* * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode
|
||||
* * * * 4. correct some HAL implementation
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-12-16 18:02:26 GMT mtk02752
|
||||
** include precomp.h
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-12-10 16:43:16 GMT mtk02752
|
||||
** code clean
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-11-13 13:54:15 GMT mtk01084
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-11 10:36:01 GMT mtk01084
|
||||
** modify HAL functions
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-09 22:56:28 GMT mtk01084
|
||||
** modify HW access routines
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-10-29 19:50:09 GMT mtk01084
|
||||
** add new macro HAL_TX_PORT_WR
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-10-23 16:08:10 GMT mtk01084
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-13 21:58:50 GMT mtk01084
|
||||
** update for new HW architecture design
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-05-18 14:28:10 GMT mtk01084
|
||||
** fix issue in HAL_DRIVER_OWN_BY_SDIO_CMD52()
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-05-11 17:26:33 GMT mtk01084
|
||||
** modify the bit definition to check driver own status
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-28 10:30:22 GMT mtk01461
|
||||
** Fix typo
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-01 10:50:34 GMT mtk01461
|
||||
** Redefine HAL_PORT_RD/WR macro for SW pre test
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-24 09:46:49 GMT mtk01084
|
||||
** fix LINT error
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-23 16:53:38 GMT mtk01084
|
||||
** add HAL_DRIVER_OWN_BY_SDIO_CMD52()
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-18 20:53:13 GMT mtk01426
|
||||
** Fixed lint warn
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:20 GMT mtk01426
|
||||
** Init for develop
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _HAL_H
|
||||
#define _HAL_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/* Macros for flag operations for the Adapter structure */
|
||||
#define HAL_SET_FLAG(_M, _F) ((_M)->u4HwFlags |= (_F))
|
||||
#define HAL_CLEAR_FLAG(_M, _F) ((_M)->u4HwFlags &= ~(_F))
|
||||
#define HAL_TEST_FLAG(_M, _F) ((_M)->u4HwFlags & (_F))
|
||||
#define HAL_TEST_FLAGS(_M, _F) (((_M)->u4HwFlags & (_F)) == (_F))
|
||||
|
||||
#if defined(_HIF_SDIO)
|
||||
#define HAL_MCR_RD(_prAdapter, _u4Offset, _pu4Value) \
|
||||
{ \
|
||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
||||
ASSERT(0); \
|
||||
} \
|
||||
if (kalDevRegRead(_prAdapter->prGlueInfo, _u4Offset, _pu4Value) == FALSE) {\
|
||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
||||
fgIsBusAccessFailed = TRUE; \
|
||||
DBGLOG(HAL, ERROR, ("HAL_MCR_RD access fail! 0x%x: 0x%x \n", _u4Offset, *_pu4Value)); \
|
||||
} \
|
||||
} else { \
|
||||
DBGLOG(HAL, WARN, ("ignore HAL_MCR_RD access! 0x%x\n", _u4Offset)); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define HAL_MCR_WR(_prAdapter, _u4Offset, _u4Value) \
|
||||
{ \
|
||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
||||
ASSERT(0); \
|
||||
} \
|
||||
if (kalDevRegWrite(_prAdapter->prGlueInfo, _u4Offset, _u4Value) == FALSE) {\
|
||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
||||
fgIsBusAccessFailed = TRUE; \
|
||||
DBGLOG(HAL, ERROR, ("HAL_MCR_WR access fail! 0x%x: 0x%x \n", _u4Offset, _u4Value)); \
|
||||
} \
|
||||
} else { \
|
||||
DBGLOG(HAL, WARN, ("ignore HAL_MCR_WR access! 0x%x: 0x%x \n", _u4Offset, _u4Value)); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define HAL_PORT_RD(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
||||
{ \
|
||||
/*fgResult = FALSE; */\
|
||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
||||
ASSERT(0); \
|
||||
} \
|
||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
||||
if (kalDevPortRead(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) == FALSE) {\
|
||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
||||
fgIsBusAccessFailed = TRUE; \
|
||||
DBGLOG(HAL, ERROR, ("HAL_PORT_RD access fail! 0x%x\n", _u4Port)); \
|
||||
} \
|
||||
else { \
|
||||
/*fgResult = TRUE;*/ } \
|
||||
} else { \
|
||||
DBGLOG(HAL, WARN, ("ignore HAL_PORT_RD access! 0x%x\n", _u4Port)); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define HAL_PORT_WR(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
||||
{ \
|
||||
/*fgResult = FALSE; */\
|
||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
||||
ASSERT(0); \
|
||||
} \
|
||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
||||
if (kalDevPortWrite(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) == FALSE) {\
|
||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
||||
fgIsBusAccessFailed = TRUE; \
|
||||
DBGLOG(HAL, ERROR, ("HAL_PORT_WR access fail! 0x%x\n", _u4Port)); \
|
||||
} \
|
||||
else { \
|
||||
/*fgResult = TRUE;*/ } \
|
||||
} else { \
|
||||
DBGLOG(HAL, WARN, ("ignore HAL_PORT_WR access! 0x%x\n", _u4Port)); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define HAL_BYTE_WR(_prAdapter, _u4Port, _ucBuf) \
|
||||
{ \
|
||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
||||
ASSERT(0); \
|
||||
} \
|
||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
||||
if (kalDevWriteWithSdioCmd52(_prAdapter->prGlueInfo, _u4Port, _ucBuf) == FALSE) {\
|
||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
||||
fgIsBusAccessFailed = TRUE; \
|
||||
DBGLOG(HAL, ERROR, ("HAL_BYTE_WR access fail! 0x%x\n", _u4Port)); \
|
||||
} \
|
||||
else { \
|
||||
} \
|
||||
} \
|
||||
else { \
|
||||
DBGLOG(HAL, WARN, ("ignore HAL_BYTE_WR access! 0x%x\n", _u4Port)); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define HAL_DRIVER_OWN_BY_SDIO_CMD52(_prAdapter, _pfgDriverIsOwnReady) \
|
||||
{ \
|
||||
UINT_8 ucBuf = BIT(1); \
|
||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
||||
ASSERT(0); \
|
||||
} \
|
||||
if (HAL_TEST_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR) == FALSE) { \
|
||||
if (kalDevReadAfterWriteWithSdioCmd52(_prAdapter->prGlueInfo, MCR_WHLPCR_BYTE1, &ucBuf, 1) == FALSE) {\
|
||||
HAL_SET_FLAG(_prAdapter, ADAPTER_FLAG_HW_ERR); \
|
||||
fgIsBusAccessFailed = TRUE; \
|
||||
DBGLOG(HAL, ERROR, ("kalDevReadAfterWriteWithSdioCmd52 access fail!\n")); \
|
||||
} \
|
||||
else { \
|
||||
*_pfgDriverIsOwnReady = (ucBuf & BIT(0)) ? TRUE : FALSE; \
|
||||
} \
|
||||
} else { \
|
||||
DBGLOG(HAL, WARN, ("ignore HAL_DRIVER_OWN_BY_SDIO_CMD52 access!\n")); \
|
||||
} \
|
||||
}
|
||||
|
||||
#else /* #if defined(_HIF_SDIO) */
|
||||
#define HAL_MCR_RD(_prAdapter, _u4Offset, _pu4Value) \
|
||||
{ \
|
||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
||||
ASSERT(0); \
|
||||
} \
|
||||
kalDevRegRead(_prAdapter->prGlueInfo, _u4Offset, _pu4Value); \
|
||||
}
|
||||
|
||||
#define HAL_MCR_WR(_prAdapter, _u4Offset, _u4Value) \
|
||||
{ \
|
||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
||||
ASSERT(0); \
|
||||
} \
|
||||
kalDevRegWrite(_prAdapter->prGlueInfo, _u4Offset, _u4Value); \
|
||||
}
|
||||
|
||||
#define HAL_PORT_RD(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
||||
{ \
|
||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
||||
ASSERT(0); \
|
||||
} \
|
||||
kalDevPortRead(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize); \
|
||||
}
|
||||
|
||||
#define HAL_PORT_WR(_prAdapter, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize) \
|
||||
{ \
|
||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
||||
ASSERT(0); \
|
||||
} \
|
||||
kalDevPortWrite(_prAdapter->prGlueInfo, _u4Port, _u4Len, _pucBuf, _u4ValidBufSize); \
|
||||
}
|
||||
|
||||
#define HAL_BYTE_WR(_prAdapter, _u4Port, _ucBuf) \
|
||||
{ \
|
||||
if (_prAdapter->rAcpiState == ACPI_STATE_D3) { \
|
||||
ASSERT(0); \
|
||||
} \
|
||||
kalDevWriteWithSdioCmd52(_prAdapter->prGlueInfo, _u4Port, _ucBuf); \
|
||||
}
|
||||
|
||||
#endif /* #if defined(_HIF_SDIO) */
|
||||
|
||||
|
||||
#define HAL_READ_RX_PORT(prAdapter, u4PortId, u4Len, pvBuf, _u4ValidBufSize) \
|
||||
{ \
|
||||
ASSERT(u4PortId < 2); \
|
||||
HAL_PORT_RD(prAdapter, \
|
||||
((u4PortId == 0) ? MCR_WRDR0 : MCR_WRDR1), \
|
||||
u4Len, \
|
||||
pvBuf, \
|
||||
_u4ValidBufSize/*temp!!*//*4Kbyte*/) \
|
||||
}
|
||||
|
||||
#define HAL_WRITE_TX_PORT(_prAdapter, _ucTxPortIdx, _u4Len, _pucBuf, _u4ValidBufSize) \
|
||||
{ \
|
||||
ASSERT(_ucTxPortIdx < 2); \
|
||||
if((_u4ValidBufSize - _u4Len) >= sizeof(UINT_32)) { \
|
||||
/* fill with single dword of zero as TX-aggregation termination */ \
|
||||
*(PUINT_32) (&((_pucBuf)[ALIGN_4(_u4Len)])) = 0; \
|
||||
} \
|
||||
HAL_PORT_WR(_prAdapter, \
|
||||
(_ucTxPortIdx == 0) ? MCR_WTDR0 : MCR_WTDR1, \
|
||||
_u4Len, \
|
||||
_pucBuf, \
|
||||
_u4ValidBufSize/*temp!!*//*4KByte*/) \
|
||||
}
|
||||
|
||||
/* The macro to read the given MCR several times to check if the wait
|
||||
condition come true. */
|
||||
#define HAL_MCR_RD_AND_WAIT(_pAdapter, _offset, _pReadValue, _waitCondition, _waitDelay, _waitCount, _status) \
|
||||
{ \
|
||||
UINT_32 count; \
|
||||
(_status) = FALSE; \
|
||||
for (count = 0; count < (_waitCount); count++) { \
|
||||
HAL_MCR_RD((_pAdapter), (_offset), (_pReadValue)); \
|
||||
if ((_waitCondition)) { \
|
||||
(_status) = TRUE; \
|
||||
break; \
|
||||
} \
|
||||
kalUdelay((_waitDelay)); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/* The macro to write 1 to a R/S bit and read it several times to check if the
|
||||
command is done */
|
||||
#define HAL_MCR_WR_AND_WAIT(_pAdapter, _offset, _writeValue, _busyMask, _waitDelay, _waitCount, _status) \
|
||||
{ \
|
||||
UINT_32 u4Temp; \
|
||||
UINT_32 u4Count = _waitCount; \
|
||||
(_status) = FALSE; \
|
||||
HAL_MCR_WR((_pAdapter), (_offset), (_writeValue)); \
|
||||
do { \
|
||||
kalUdelay((_waitDelay)); \
|
||||
HAL_MCR_RD((_pAdapter), (_offset), &u4Temp); \
|
||||
if (!(u4Temp & (_busyMask))) { \
|
||||
(_status) = TRUE; \
|
||||
break; \
|
||||
} \
|
||||
u4Count--; \
|
||||
} while (u4Count); \
|
||||
}
|
||||
|
||||
#define HAL_GET_CHIP_ID_VER(_prAdapter, pu2ChipId, pu2Version) \
|
||||
{ \
|
||||
UINT_32 u4Value; \
|
||||
HAL_MCR_RD(_prAdapter, \
|
||||
MCR_WCIR, \
|
||||
&u4Value); \
|
||||
*pu2ChipId = (UINT_16)(u4Value & WCIR_CHIP_ID); \
|
||||
*pu2Version = (UINT_16)(u4Value & WCIR_REVISION_ID) >> 16; \
|
||||
}
|
||||
|
||||
#define HAL_WAIT_WIFI_FUNC_READY(_prAdapter) \
|
||||
{ \
|
||||
UINT_32 u4Value; \
|
||||
UINT_32 i; \
|
||||
for (i = 0; i < 100; i++) { \
|
||||
HAL_MCR_RD(_prAdapter, \
|
||||
MCR_WCIR, \
|
||||
&u4Value); \
|
||||
if (u4Value & WCIR_WLAN_READY) { \
|
||||
break; \
|
||||
} \
|
||||
NdisMSleep(10); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define HAL_INTR_DISABLE(_prAdapter) \
|
||||
HAL_MCR_WR(_prAdapter, \
|
||||
MCR_WHLPCR, \
|
||||
WHLPCR_INT_EN_CLR)
|
||||
|
||||
#define HAL_INTR_ENABLE(_prAdapter) \
|
||||
HAL_MCR_WR(_prAdapter, \
|
||||
MCR_WHLPCR, \
|
||||
WHLPCR_INT_EN_SET)
|
||||
|
||||
#define HAL_INTR_ENABLE_AND_LP_OWN_SET(_prAdapter) \
|
||||
HAL_MCR_WR(_prAdapter, \
|
||||
MCR_WHLPCR, \
|
||||
(WHLPCR_INT_EN_SET | WHLPCR_FW_OWN_REQ_SET))
|
||||
|
||||
#define HAL_LP_OWN_SET(_prAdapter) \
|
||||
HAL_MCR_WR(_prAdapter, \
|
||||
MCR_WHLPCR, \
|
||||
WHLPCR_FW_OWN_REQ_SET)
|
||||
|
||||
#define HAL_LP_OWN_CLR_OK(_prAdapter, _pfgResult) \
|
||||
{ \
|
||||
UINT_32 i; \
|
||||
UINT_32 u4RegValue; \
|
||||
UINT_32 u4LoopCnt = 2048 / 8; \
|
||||
*_pfgResult = TRUE; \
|
||||
/* Software get LP ownership */ \
|
||||
HAL_MCR_WR(_prAdapter, \
|
||||
MCR_WHLPCR, \
|
||||
WHLPCR_FW_OWN_REQ_CLR) \
|
||||
for (i = 0; i < u4LoopCnt; i++) { \
|
||||
HAL_MCR_RD(_prAdapter, MCR_WHLPCR, &u4RegValue); \
|
||||
if (u4RegValue & WHLPCR_IS_DRIVER_OWN) { \
|
||||
break; \
|
||||
} \
|
||||
else { \
|
||||
kalUdelay(8); \
|
||||
} \
|
||||
} \
|
||||
if (i == u4LoopCnt) { \
|
||||
*_pfgResult = FALSE; \
|
||||
/*ERRORLOG(("LP cannot be own back (%ld)", u4LoopCnt));*/ \
|
||||
/* check the time of LP instructions need to perform from Sleep to On */ \
|
||||
/*ASSERT(0); */ \
|
||||
} \
|
||||
}
|
||||
|
||||
#define HAL_GET_ABNORMAL_INTERRUPT_REASON_CODE(_prAdapter, pu4AbnormalReason) \
|
||||
{ \
|
||||
HAL_MCR_RD(_prAdapter, \
|
||||
MCR_WASR, \
|
||||
pu4AbnormalReason); \
|
||||
}
|
||||
|
||||
|
||||
#define HAL_DISABLE_RX_ENHANCE_MODE(_prAdapter) \
|
||||
{ \
|
||||
UINT_32 u4Value; \
|
||||
HAL_MCR_RD(_prAdapter, \
|
||||
MCR_WHCR, \
|
||||
&u4Value); \
|
||||
HAL_MCR_WR(_prAdapter, \
|
||||
MCR_WHCR, \
|
||||
u4Value & ~WHCR_RX_ENHANCE_MODE_EN); \
|
||||
}
|
||||
|
||||
#define HAL_ENABLE_RX_ENHANCE_MODE(_prAdapter) \
|
||||
{ \
|
||||
UINT_32 u4Value; \
|
||||
HAL_MCR_RD(_prAdapter, \
|
||||
MCR_WHCR, \
|
||||
&u4Value); \
|
||||
HAL_MCR_WR(_prAdapter, \
|
||||
MCR_WHCR, \
|
||||
u4Value | WHCR_RX_ENHANCE_MODE_EN); \
|
||||
}
|
||||
|
||||
#define HAL_CFG_MAX_HIF_RX_LEN_NUM(_prAdapter, _ucNumOfRxLen) \
|
||||
{ \
|
||||
UINT_32 u4Value, ucNum; \
|
||||
ucNum = ((_ucNumOfRxLen >= 16) ? 0 : _ucNumOfRxLen); \
|
||||
u4Value = 0; \
|
||||
HAL_MCR_RD(_prAdapter, \
|
||||
MCR_WHCR, \
|
||||
&u4Value); \
|
||||
u4Value &= ~WHCR_MAX_HIF_RX_LEN_NUM; \
|
||||
u4Value |= ((((UINT_32)ucNum) << 4) & WHCR_MAX_HIF_RX_LEN_NUM); \
|
||||
HAL_MCR_WR(_prAdapter, \
|
||||
MCR_WHCR, \
|
||||
u4Value); \
|
||||
}
|
||||
|
||||
#define HAL_SET_INTR_STATUS_READ_CLEAR(prAdapter) \
|
||||
{ \
|
||||
UINT_32 u4Value; \
|
||||
HAL_MCR_RD(prAdapter, \
|
||||
MCR_WHCR, \
|
||||
&u4Value); \
|
||||
HAL_MCR_WR(prAdapter, \
|
||||
MCR_WHCR, \
|
||||
u4Value & ~WHCR_W_INT_CLR_CTRL); \
|
||||
prAdapter->prGlueInfo->rHifInfo.fgIntReadClear = TRUE;\
|
||||
}
|
||||
|
||||
#define HAL_SET_INTR_STATUS_WRITE_1_CLEAR(prAdapter) \
|
||||
{ \
|
||||
UINT_32 u4Value; \
|
||||
HAL_MCR_RD(prAdapter, \
|
||||
MCR_WHCR, \
|
||||
&u4Value); \
|
||||
HAL_MCR_WR(prAdapter, \
|
||||
MCR_WHCR, \
|
||||
u4Value | WHCR_W_INT_CLR_CTRL); \
|
||||
prAdapter->prGlueInfo->rHifInfo.fgIntReadClear = FALSE;\
|
||||
}
|
||||
|
||||
/* Note: enhance mode structure may also carried inside the buffer,
|
||||
if the length of the buffer is long enough */
|
||||
#define HAL_READ_INTR_STATUS(prAdapter, length, pvBuf) \
|
||||
HAL_PORT_RD(prAdapter, \
|
||||
MCR_WHISR, \
|
||||
length, \
|
||||
pvBuf, \
|
||||
length)
|
||||
|
||||
#define HAL_READ_TX_RELEASED_COUNT(_prAdapter, aucTxReleaseCount) \
|
||||
{ \
|
||||
PUINT_32 pu4Value = (PUINT_32)aucTxReleaseCount; \
|
||||
HAL_MCR_RD(_prAdapter, \
|
||||
MCR_WTSR0, \
|
||||
&pu4Value[0]); \
|
||||
HAL_MCR_RD(_prAdapter, \
|
||||
MCR_WTSR1, \
|
||||
&pu4Value[1]); \
|
||||
}
|
||||
|
||||
#define HAL_READ_RX_LENGTH(prAdapter, pu2Rx0Len, pu2Rx1Len) \
|
||||
{ \
|
||||
UINT_32 u4Value; \
|
||||
u4Value = 0; \
|
||||
HAL_MCR_RD(prAdapter, \
|
||||
MCR_WRPLR, \
|
||||
&u4Value); \
|
||||
*pu2Rx0Len = (UINT_16)u4Value; \
|
||||
*pu2Rx1Len = (UINT_16)(u4Value >> 16); \
|
||||
}
|
||||
|
||||
#define HAL_GET_INTR_STATUS_FROM_ENHANCE_MODE_STRUCT(pvBuf, u2Len, pu4Status) \
|
||||
{ \
|
||||
PUINT_32 pu4Buf = (PUINT_32)pvBuf; \
|
||||
*pu4Status = pu4Buf[0]; \
|
||||
}
|
||||
|
||||
#define HAL_GET_TX_STATUS_FROM_ENHANCE_MODE_STRUCT(pvInBuf, pu4BufOut, u4LenBufOut) \
|
||||
{ \
|
||||
PUINT_32 pu4Buf = (PUINT_32)pvInBuf; \
|
||||
ASSERT(u4LenBufOut >= 8); \
|
||||
pu4BufOut[0] = pu4Buf[1]; \
|
||||
pu4BufOut[1] = pu4Buf[2]; \
|
||||
}
|
||||
|
||||
#define HAL_GET_RX_LENGTH_FROM_ENHANCE_MODE_STRUCT(pvInBuf, pu2Rx0Num, au2Rx0Len, pu2Rx1Num, au2Rx1Len) \
|
||||
{ \
|
||||
PUINT_32 pu4Buf = (PUINT_32)pvInBuf; \
|
||||
ASSERT((sizeof(au2Rx0Len) / sizeof(UINT_16)) >= 16); \
|
||||
ASSERT((sizeof(au2Rx1Len) / sizeof(UINT_16)) >= 16); \
|
||||
*pu2Rx0Num = (UINT_16)pu4Buf[3]; \
|
||||
*pu2Rx1Num = (UINT_16)(pu4Buf[3] >> 16); \
|
||||
kalMemCopy(au2Rx0Len, &pu4Buf[4], 8); \
|
||||
kalMemCopy(au2Rx1Len, &pu4Buf[12], 8); \
|
||||
}
|
||||
|
||||
#define HAL_GET_MAILBOX_FROM_ENHANCE_MODE_STRUCT(pvInBuf, pu4Mailbox0, pu4Mailbox1) \
|
||||
{ \
|
||||
PUINT_32 pu4Buf = (PUINT_32)pvInBuf; \
|
||||
*pu4Mailbox0 = (UINT_16)pu4Buf[21]; \
|
||||
*pu4Mailbox1 = (UINT_16)pu4Buf[22]; \
|
||||
}
|
||||
|
||||
#define HAL_IS_TX_DONE_INTR(u4IntrStatus) \
|
||||
((u4IntrStatus & WHISR_TX_DONE_INT) ? TRUE : FALSE)
|
||||
|
||||
#define HAL_IS_RX_DONE_INTR(u4IntrStatus) \
|
||||
((u4IntrStatus & (WHISR_RX0_DONE_INT | WHISR_RX1_DONE_INT)) ? TRUE : FALSE)
|
||||
|
||||
#define HAL_IS_ABNORMAL_INTR(u4IntrStatus) \
|
||||
((u4IntrStatus & WHISR_ABNORMAL_INT) ? TRUE : FALSE)
|
||||
|
||||
#define HAL_IS_FW_OWNBACK_INTR(u4IntrStatus) \
|
||||
((u4IntrStatus & WHISR_FW_OWN_BACK_INT) ? TRUE : FALSE)
|
||||
|
||||
#define HAL_PUT_MAILBOX(prAdapter, u4MboxId, u4Data) \
|
||||
{ \
|
||||
ASSERT(u4MboxId < 2); \
|
||||
HAL_MCR_WR(prAdapter, \
|
||||
((u4MboxId == 0) ? MCR_H2DSM0R : MCR_H2DSM1R), \
|
||||
u4Data); \
|
||||
}
|
||||
|
||||
#define HAL_GET_MAILBOX(prAdapter, u4MboxId, pu4Data) \
|
||||
{ \
|
||||
ASSERT(u4MboxId < 2); \
|
||||
HAL_MCR_RD(prAdapter, \
|
||||
((u4MboxId == 0) ? MCR_D2HRM0R : MCR_D2HRM1R), \
|
||||
pu4Data); \
|
||||
}
|
||||
|
||||
#define HAL_SET_MAILBOX_READ_CLEAR(prAdapter, fgEnableReadClear) \
|
||||
{ \
|
||||
UINT_32 u4Value; \
|
||||
HAL_MCR_RD(prAdapter, MCR_WHCR, &u4Value);\
|
||||
HAL_MCR_WR(prAdapter, MCR_WHCR, \
|
||||
(fgEnableReadClear) ? \
|
||||
(u4Value | WHCR_W_MAILBOX_RD_CLR_EN) : \
|
||||
(u4Value & ~WHCR_W_MAILBOX_RD_CLR_EN)); \
|
||||
prAdapter->prGlueInfo->rHifInfo.fgMbxReadClear = fgEnableReadClear;\
|
||||
}
|
||||
|
||||
#define HAL_GET_MAILBOX_READ_CLEAR(prAdapter) (prAdapter->prGlueInfo->rHifInfo.fgMbxReadClear)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _HAL_H */
|
||||
|
||||
|
|
@ -1,227 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/hif_rx.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "hif_rx.h"
|
||||
\brief Provide HIF RX Header Information between F/W and Driver
|
||||
|
||||
N/A
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
** $Log: hif_rx.h $
|
||||
*
|
||||
* 09 01 2010 kevin.huang
|
||||
* NULL
|
||||
* Use LINK LIST operation to process SCAN result
|
||||
*
|
||||
* 07 16 2010 yarco.yang
|
||||
*
|
||||
* 1. Support BSS Absence/Presence Event
|
||||
* 2. Support STA change PS mode Event
|
||||
* 3. Support BMC forwarding for AP mode.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 14 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* follow-ups for HIF_RX_HEADER_T update:
|
||||
* 1) add TCL
|
||||
* 2) add RCPI
|
||||
* 3) add ChannelNumber
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) migrate assoc.c.
|
||||
* 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
|
||||
* 3) add configuration options for CNM_MEM and RSN modules
|
||||
* 4) add data path for management frames
|
||||
* 5) eliminate rPacketInfo of MSDU_INFO_T
|
||||
*
|
||||
* 06 09 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add necessary changes to driver data paths.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-12-10 16:44:00 GMT mtk02752
|
||||
** code clean
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-12-09 13:59:20 GMT MTK02468
|
||||
** Added HIF_RX_HDR parsing macros
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-11-24 19:54:54 GMT mtk02752
|
||||
** adopt HIF_RX_HEADER_T in new data path
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-10-29 19:51:19 GMT mtk01084
|
||||
** modify FW/ driver interface
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-28 10:33:58 GMT mtk01461
|
||||
** Add define of HW_APPENED_LEN
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-01 10:51:02 GMT mtk01461
|
||||
** Rename ENUM_HIF_RX_PKT_TYPE_T
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-19 12:05:03 GMT mtk01426
|
||||
** Remove __KAL_ATTRIB_PACKED__ and add hifDataTypeCheck()
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-17 20:18:52 GMT mtk01426
|
||||
** Add comment to HIF_RX_HEADER_T
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:23 GMT mtk01426
|
||||
** Init for develop
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _HIF_RX_H
|
||||
#define _HIF_RX_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*! HIF_RX_HEADER_T */
|
||||
// DW 0, Byte 1
|
||||
#define HIF_RX_HDR_PACKET_TYPE_MASK BITS(0,1)
|
||||
|
||||
// DW 1, Byte 0
|
||||
#define HIF_RX_HDR_HEADER_LEN BITS(2,7)
|
||||
#define HIF_RX_HDR_HEADER_LEN_OFFSET 2
|
||||
#define HIF_RX_HDR_HEADER_OFFSET_MASK BITS(0,1)
|
||||
|
||||
// DW 1, Byte 1
|
||||
#define HIF_RX_HDR_80211_HEADER_FORMAT BIT(0)
|
||||
#define HIF_RX_HDR_DO_REORDER BIT(1)
|
||||
#define HIF_RX_HDR_PAL BIT(2)
|
||||
#define HIF_RX_HDR_TCL BIT(3)
|
||||
#define HIF_RX_HDR_NETWORK_IDX_MASK BITS(4,7)
|
||||
#define HIF_RX_HDR_NETWORK_IDX_OFFSET 4
|
||||
|
||||
// DW 1, Byte 2, 3
|
||||
#define HIF_RX_HDR_SEQ_NO_MASK BITS(0,11)
|
||||
#define HIF_RX_HDR_TID_MASK BITS(12,14)
|
||||
#define HIF_RX_HDR_TID_OFFSET 12
|
||||
#define HIF_RX_HDR_BAR_FRAME BIT(15)
|
||||
|
||||
|
||||
|
||||
#define HIF_RX_HDR_FLAG_AMP_WDS BIT(0)
|
||||
#define HIF_RX_HDR_FLAG_802_11_FORMAT BIT(1)
|
||||
#define HIF_RX_HDR_FLAG_BAR_FRAME BIT(2)
|
||||
#define HIF_RX_HDR_FLAG_DO_REORDERING BIT(3)
|
||||
#define HIF_RX_HDR_FLAG_CTRL_WARPPER_FRAME BIT(4)
|
||||
|
||||
#define HIF_RX_HW_APPENDED_LEN 4
|
||||
|
||||
// For DW 2, Byte 3 - ucHwChannelNum
|
||||
#define HW_CHNL_NUM_MAX_2G4 14
|
||||
#define HW_CHNL_NUM_MAX_4G_5G (255 - HW_CHNL_NUM_MAX_2G4)
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
typedef struct _HIF_RX_HEADER_T {
|
||||
UINT_16 u2PacketLen;
|
||||
UINT_16 u2PacketType;
|
||||
UINT_8 ucHerderLenOffset;
|
||||
UINT_8 uc80211_Reorder_PAL_TCL;
|
||||
UINT_16 u2SeqNoTid;
|
||||
UINT_8 ucStaRecIdx;
|
||||
UINT_8 ucRcpi;
|
||||
UINT_8 ucHwChannelNum;
|
||||
UINT_8 ucReserved;
|
||||
} HIF_RX_HEADER_T, *P_HIF_RX_HEADER_T;
|
||||
|
||||
typedef enum _ENUM_HIF_RX_PKT_TYPE_T {
|
||||
HIF_RX_PKT_TYPE_DATA = 0,
|
||||
HIF_RX_PKT_TYPE_EVENT,
|
||||
HIF_RX_PKT_TYPE_TX_LOOPBACK,
|
||||
HIF_RX_PKT_TYPE_MANAGEMENT,
|
||||
HIF_RX_PKT_TYPE_NUM
|
||||
} ENUM_HIF_RX_PKT_TYPE_T, *P_ENUM_HIF_RX_PKT_TYPE_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define HIF_RX_HDR_SIZE sizeof(HIF_RX_HEADER_T)
|
||||
|
||||
#define HIF_RX_HDR_GET_80211_FLAG(_prHifRxHdr) \
|
||||
(((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_80211_HEADER_FORMAT) ? TRUE : FALSE))
|
||||
#define HIF_RX_HDR_GET_REORDER_FLAG(_prHifRxHdr) \
|
||||
(((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_DO_REORDER) ? TRUE : FALSE))
|
||||
#define HIF_RX_HDR_GET_PAL_FLAG(_prHifRxHdr) \
|
||||
(((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_PAL) ? TRUE : FALSE))
|
||||
#define HIF_RX_HDR_GET_TCL_FLAG(_prHifRxHdr) \
|
||||
(((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_TCL) ? TRUE : FALSE))
|
||||
#define HIF_RX_HDR_GET_NETWORK_IDX(_prHifRxHdr) \
|
||||
((((_prHifRxHdr)->uc80211_Reorder_PAL_TCL) & HIF_RX_HDR_NETWORK_IDX_MASK)\
|
||||
>> HIF_RX_HDR_NETWORK_IDX_OFFSET)
|
||||
|
||||
|
||||
#define HIF_RX_HDR_GET_TID(_prHifRxHdr) \
|
||||
((((_prHifRxHdr)->u2SeqNoTid) & HIF_RX_HDR_TID_MASK)\
|
||||
>> HIF_RX_HDR_TID_OFFSET)
|
||||
#define HIF_RX_HDR_GET_SN(_prHifRxHdr) \
|
||||
(((_prHifRxHdr)->u2SeqNoTid) & HIF_RX_HDR_SEQ_NO_MASK)
|
||||
#define HIF_RX_HDR_GET_BAR_FLAG(_prHifRxHdr) \
|
||||
(((((_prHifRxHdr)->u2SeqNoTid) & HIF_RX_HDR_BAR_FRAME)? TRUE: FALSE))
|
||||
|
||||
|
||||
#define HIF_RX_HDR_GET_CHNL_NUM(_prHifRxHdr) \
|
||||
( ( ((_prHifRxHdr)->ucHwChannelNum) > HW_CHNL_NUM_MAX_4G_5G ) ? \
|
||||
( ((_prHifRxHdr)->ucHwChannelNum) - HW_CHNL_NUM_MAX_4G_5G ) : \
|
||||
((_prHifRxHdr)->ucHwChannelNum) )
|
||||
|
||||
/* To do: support more bands other than 2.4G and 5G */
|
||||
#define HIF_RX_HDR_GET_RF_BAND(_prHifRxHdr) \
|
||||
( ( ((_prHifRxHdr)->ucHwChannelNum) <= HW_CHNL_NUM_MAX_2G4 ) ? \
|
||||
BAND_2G4 : BAND_5G)
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
__KAL_INLINE__ VOID
|
||||
hifDataTypeCheck (
|
||||
VOID
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/* Kevin: we don't have to call following function to inspect the data structure.
|
||||
* It will check automatically while at compile time.
|
||||
* We'll need this for porting driver to different RTOS.
|
||||
*/
|
||||
__KAL_INLINE__ VOID
|
||||
hifDataTypeCheck (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
DATA_STRUC_INSPECTING_ASSERT(sizeof(HIF_RX_HEADER_T) == 12);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,225 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/hif_tx.h#1 $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: hif_tx.h $
|
||||
*
|
||||
* 10 07 2010 cp.wu
|
||||
* [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection
|
||||
* add firmware download for MT5931.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 14 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* fill extra information for revised HIF_TX_HEADER.
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) add flag on MSDU_INFO_T for indicating BIP frame and forceBasicRate
|
||||
* 2) add packet type for indicating management frames
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 03 10 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* code clean: removing unused variables and structure definitions
|
||||
*
|
||||
* 02 09 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address
|
||||
* * * 2. follow MSDN defined behavior when associates to another AP
|
||||
* * * 3. for firmware download, packet size could be up to 2048 bytes
|
||||
*
|
||||
* 01 13 2010 tehuang.liu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* Enabled the Burst_End Indication mechanism
|
||||
*
|
||||
* 01 13 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* TX: fill ucWlanHeaderLength/ucPktFormtId_Flags according to info provided by prMsduInfo
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-12-10 16:43:40 GMT mtk02752
|
||||
** code clean
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-11-24 19:55:11 GMT mtk02752
|
||||
** adopt HIF_TX_HEADER_T in new data path
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-23 17:54:13 GMT mtk02752
|
||||
** CMD_HDR_SIZE = (sizeof(WIFI_CMD_T)) to follow up CM's CMD/EVENT documentation
|
||||
**
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-17 22:41:10 GMT mtk01084
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-11-17 17:34:07 GMT mtk02752
|
||||
** remove HIF_TX_BUFF_COUNT_TC0 (move to nic_tx.h)
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-11-17 12:14:12 GMT mtk02752
|
||||
** add initial value for HIF_TX_BUFF_COUNT_TC5
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-11-13 13:54:18 GMT mtk01084
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-11-04 14:11:14 GMT mtk01084
|
||||
** modify SW TX data format
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-10-29 19:51:53 GMT mtk01084
|
||||
** modify FW/ driver interface
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-05-20 12:22:46 GMT mtk01461
|
||||
** Add SeqNum field to CMD Header
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-17 19:40:52 GMT mtk01461
|
||||
** Update the Log Sign
|
||||
*/
|
||||
|
||||
#ifndef _HIF_TX_H
|
||||
#define _HIF_TX_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Maximum buffer size for individual HIF TCQ Buffer */
|
||||
#define HIF_TX_BUFF_MAX_SIZE 1552 /* Reserved field was not included */
|
||||
|
||||
/* Maximum buffer count for individual HIF TCQ */
|
||||
#define HIF_TX_BUFF_COUNT_TC0 3
|
||||
#define HIF_TX_BUFF_COUNT_TC1 3
|
||||
#define HIF_TX_BUFF_COUNT_TC2 3
|
||||
#define HIF_TX_BUFF_COUNT_TC3 3
|
||||
#define HIF_TX_BUFF_COUNT_TC4 2
|
||||
|
||||
#define TX_HDR_SIZE sizeof(HIF_TX_HEADER_T)
|
||||
|
||||
#define CMD_HDR_SIZE sizeof(WIFI_CMD_T)
|
||||
|
||||
#define CMD_PKT_SIZE_FOR_IMAGE 2048 /* !< 2048 Bytes CMD payload buffer */
|
||||
|
||||
|
||||
/*! NIC_HIF_TX_HEADER_T */
|
||||
// DW 0, Byte 0,1
|
||||
#define HIF_TX_HDR_TX_BYTE_COUNT_MASK BITS(0,11)
|
||||
#define HIF_TX_HDR_USER_PRIORITY_OFFSET 12
|
||||
|
||||
// DW 0, Byte 2
|
||||
#define HIF_TX_HDR_ETHER_TYPE_OFFSET_MASK BITS(0,7)
|
||||
|
||||
// DW 0, Byte 3
|
||||
#define HIF_TX_HDR_IP_CSUM BIT(0)
|
||||
#define HIF_TX_HDR_TCP_CSUM BIT(1)
|
||||
#define HIF_TX_HDR_RESOURCE_MASK BITS(2,5)
|
||||
#define HIF_TX_HDR_RESOURCE_OFFSET 2
|
||||
#define HIF_TX_HDR_PACKET_TYPE_MASK BITS(6,7)
|
||||
#define HIF_TX_HDR_PACKET_TYPE_OFFSET 6
|
||||
|
||||
// DW 1, Byte 0
|
||||
#define HIF_TX_HDR_WLAN_HEADER_LEN_MASK BITS(0,5)
|
||||
|
||||
// DW 1, Byte 1
|
||||
#define HIF_TX_HDR_FORMAT_ID_MASK BITS(0,2)
|
||||
#define HIF_TX_HDR_NETWORK_TYPE_MASK BITS(4,5)
|
||||
#define HIF_TX_HDR_NETWORK_TYPE_OFFSET 4
|
||||
#define HIF_TX_HDR_FLAG_1X_FRAME_MASK BIT(6)
|
||||
#define HIF_TX_HDR_FLAG_1X_FRAME_OFFSET 6
|
||||
#define HIF_TX_HDR_FLAG_802_11_FORMAT_MASK BIT(7)
|
||||
#define HIF_TX_HDR_FLAG_802_11_FORMAT_OFFSET 7
|
||||
|
||||
|
||||
// DW2, Byte 3
|
||||
#define HIF_TX_HDR_PS_FORWARDING_TYPE_MASK BITS(0,1)
|
||||
#define HIF_TX_HDR_PS_SESSION_ID_MASK BITS(2,4)
|
||||
#define HIF_TX_HDR_PS_SESSION_ID_OFFSET 2
|
||||
#define HIF_TX_HDR_BURST_END_MASK BIT(5)
|
||||
#define HIF_TX_HDR_BURST_END_OFFSET 5
|
||||
|
||||
// DW3, Byte 1
|
||||
#define HIF_TX_HDR_NEED_ACK BIT(0)
|
||||
#define HIF_TX_HDR_BIP BIT(1)
|
||||
#define HIF_TX_HDR_BASIC_RATE BIT(2)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
typedef struct _HIF_HW_TX_HEADER_T {
|
||||
UINT_16 u2TxByteCount;
|
||||
UINT_8 ucEtherTypeOffset;
|
||||
UINT_8 ucCSflags;
|
||||
UINT_8 aucBuffer[0];
|
||||
} HIF_HW_TX_HEADER_T, *P_HIF_HW_TX_HEADER_T;
|
||||
|
||||
typedef struct _HIF_TX_HEADER_T {
|
||||
UINT_16 u2TxByteCount_UserPriority;
|
||||
UINT_8 ucEtherTypeOffset;
|
||||
UINT_8 ucResource_PktType_CSflags;
|
||||
UINT_8 ucWlanHeaderLength;
|
||||
UINT_8 ucPktFormtId_Flags;
|
||||
UINT_16 u2LLH; /* for BOW */
|
||||
UINT_16 u2SeqNo; /* for BOW */
|
||||
UINT_8 ucStaRecIdx;
|
||||
UINT_8 ucForwardingType_SessionID_Reserved;
|
||||
UINT_8 ucPacketSeqNo;
|
||||
UINT_8 ucAck_BIP_BasicRate;
|
||||
UINT_8 aucReserved[2];
|
||||
} HIF_TX_HEADER_T, *P_HIF_TX_HEADER_T;
|
||||
|
||||
typedef enum _ENUM_HIF_TX_PKT_TYPE_T {
|
||||
HIF_TX_PKT_TYPE_DATA = 0,
|
||||
HIF_TX_PKT_TYPE_CMD,
|
||||
HIF_TX_PKT_TYPE_HIF_LOOPBACK,
|
||||
HIF_TX_PKT_TYPE_MANAGEMENT,
|
||||
HIF_TX_PKT_TYPE_NUM
|
||||
} ENUM_HIF_TX_PKT_TYPE_T, *P_ENUM_HIF_TX_PKT_TYPE_T;
|
||||
|
||||
typedef enum _ENUM_HIF_OOB_CTRL_PKT_TYPE_T {
|
||||
HIF_OOB_CTRL_PKT_TYPE_LOOPBACK = 1,
|
||||
HIF_OOB_CTRL_PKT_TYP_NUM
|
||||
} ENUM_HIF_OOB_CTRL_PKT_TYPE_T, *P_ENUM_HIF_OOB_CTRL_PKT_TYPE_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define TFCB_FRAME_PAD_TO_DW(u2Length) ALIGN_4(u2Length)
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Kevin: we don't have to call following function to inspect the data structure.
|
||||
* It will check automatically while at compile time.
|
||||
*/
|
||||
__KAL_INLINE__ VOID
|
||||
hif_txDataTypeCheck (
|
||||
VOID
|
||||
);
|
||||
|
||||
__KAL_INLINE__ VOID
|
||||
hif_txDataTypeCheck (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
DATA_STRUC_INSPECTING_ASSERT(sizeof(HIF_TX_HEADER_T) == 16);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#endif /*_HIF_TX_H */
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,286 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/mt6620_reg.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "mt6620_reg.h"
|
||||
\brief The common register definition of mt6620
|
||||
|
||||
N/A
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: mt6620_reg.h $
|
||||
*
|
||||
* 01 31 2011 terry.wu
|
||||
* [WCXRP00000412] [MT6620 Wi-Fi][FW/Driver] Dump firmware assert info at android kernel log
|
||||
* Print firmware ASSERT info at Android kernel log, driver side
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 03 19 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1) add ACPI D0/D3 state switching support
|
||||
* * * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-12-10 16:44:18 GMT mtk02752
|
||||
** remove 5921 definitions
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-09 22:56:32 GMT mtk01084
|
||||
** modify HW register definitions
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-04 14:11:04 GMT mtk01084
|
||||
** modify default IER bits
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-10-29 19:52:32 GMT mtk01084
|
||||
** modify data struture
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-10-23 16:08:20 GMT mtk01084
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-13 21:58:53 GMT mtk01084
|
||||
** update for new HW architecture design
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-09-09 17:26:11 GMT mtk01084
|
||||
** add CFG_TEST_WITH_MT5921
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-05-18 20:59:57 GMT mtk01426
|
||||
** Update WHIER_DEFAULT value
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-05-07 16:57:36 GMT mtk01426
|
||||
** Update CHIP ID to 0x6620, and WHLPCR bit definition
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-28 10:34:57 GMT mtk01461
|
||||
** Add read WTSR and fix RX STATUS is DW align for SDIO_STATUS_ENHANCE mode
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-24 09:46:52 GMT mtk01084
|
||||
** fix LINT error
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-23 00:32:24 GMT mtk01461
|
||||
** Define constants for TX PATH
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-18 20:54:10 GMT mtk01426
|
||||
** Add WHCR_MAX_HIF_RX_AGG_LEN_OFFSET definition
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:29 GMT mtk01426
|
||||
** Init for develop
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _MT6620_REG_H
|
||||
#define _MT6620_REG_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
//1 MT6620 MCR Definition
|
||||
|
||||
//2 Host Interface
|
||||
|
||||
//4 CHIP ID Register
|
||||
#define MCR_WCIR 0x0000
|
||||
|
||||
//4 HIF Low Power Control Register
|
||||
#define MCR_WHLPCR 0x0004
|
||||
//#define MCR_WHLPCR_BYTE1 0x0005
|
||||
|
||||
|
||||
//4 Control Status Register
|
||||
#define MCR_WSDIOCSR 0x0008
|
||||
#define MCR_WSPICSR 0x0008
|
||||
|
||||
//4 HIF Control Register
|
||||
#define MCR_WHCR 0x000C
|
||||
|
||||
//4 HIF Interrupt Status Register
|
||||
#define MCR_WHISR 0x0010
|
||||
|
||||
//4 HIF Interrupt Enable Register
|
||||
#define MCR_WHIER 0x0014
|
||||
|
||||
//4 Abnormal Status Register
|
||||
#define MCR_WASR 0x0018
|
||||
|
||||
//4 WLAN Software Interrupt Control Register
|
||||
#define MCR_WSICR 0x001C
|
||||
|
||||
//4 WLAN TX Status Register
|
||||
#define MCR_WTSR0 0x0020
|
||||
|
||||
//4 WLAN TX Status Register
|
||||
#define MCR_WTSR1 0x0024
|
||||
|
||||
//4 WLAN TX Data Register 0
|
||||
#define MCR_WTDR0 0x0028
|
||||
|
||||
//4 WLAN TX Data Register 1
|
||||
#define MCR_WTDR1 0x002C
|
||||
|
||||
//4 WLAN RX Data Register 0
|
||||
#define MCR_WRDR0 0x0030
|
||||
|
||||
//4 WLAN RX Data Register 1
|
||||
#define MCR_WRDR1 0x0034
|
||||
|
||||
//4 Host to Device Send Mailbox 0 Register
|
||||
#define MCR_H2DSM0R 0x0038
|
||||
|
||||
//4 Host to Device Send Mailbox 1 Register
|
||||
#define MCR_H2DSM1R 0x003c
|
||||
|
||||
//4 Device to Host Receive Mailbox 0 Register
|
||||
#define MCR_D2HRM0R 0x0040
|
||||
|
||||
//4 Device to Host Receive Mailbox 1 Register
|
||||
#define MCR_D2HRM1R 0x0044
|
||||
|
||||
//4 WLAN RX Packet Length Register
|
||||
#define MCR_WRPLR 0x0048
|
||||
|
||||
|
||||
|
||||
|
||||
//temp //#if CFG_SDIO_INTR_ENHANCE
|
||||
typedef struct _ENHANCE_MODE_DATA_STRUCT_T {
|
||||
UINT_32 u4WHISR;
|
||||
union {
|
||||
struct {
|
||||
UINT_8 ucTQ0Cnt;
|
||||
UINT_8 ucTQ1Cnt;
|
||||
UINT_8 ucTQ2Cnt;
|
||||
UINT_8 ucTQ3Cnt;
|
||||
UINT_8 ucTQ4Cnt;
|
||||
UINT_8 ucTQ5Cnt;
|
||||
UINT_16 u2Rsrv;
|
||||
} u;
|
||||
UINT_32 au4WTSR[2];
|
||||
} rTxInfo;
|
||||
union {
|
||||
struct {
|
||||
UINT_16 u2NumValidRx0Len;
|
||||
UINT_16 u2NumValidRx1Len;
|
||||
UINT_16 au2Rx0Len[16];
|
||||
UINT_16 au2Rx1Len[16];
|
||||
} u;
|
||||
UINT_32 au4RxStatusRaw[17];
|
||||
} rRxInfo;
|
||||
UINT_32 u4RcvMailbox0;
|
||||
UINT_32 u4RcvMailbox1;
|
||||
} ENHANCE_MODE_DATA_STRUCT_T, *P_ENHANCE_MODE_DATA_STRUCT_T;
|
||||
// #endif /* ENHANCE_MODE_DATA_STRUCT_T */
|
||||
|
||||
|
||||
//2 Definition in each register
|
||||
//3 WCIR 0x0000
|
||||
#define WCIR_WLAN_READY BIT(21)
|
||||
#define WCIR_POR_INDICATOR BIT(20)
|
||||
#define WCIR_REVISION_ID BITS(16,19)
|
||||
#define WCIR_CHIP_ID BITS(0,15)
|
||||
|
||||
#define MTK_CHIP_REV 0x00006620
|
||||
#define MTK_CHIP_MP_REVERSION_ID 0x0
|
||||
|
||||
//3 WHLPCR 0x0004
|
||||
#define WHLPCR_FW_OWN_REQ_CLR BIT(9)
|
||||
#define WHLPCR_FW_OWN_REQ_SET BIT(8)
|
||||
#define WHLPCR_IS_DRIVER_OWN BIT(8)
|
||||
#define WHLPCR_INT_EN_CLR BIT(1)
|
||||
#define WHLPCR_INT_EN_SET BIT(0)
|
||||
|
||||
//3 WSDIOCSR 0x0008
|
||||
#define WSDIOCSR_SDIO_RE_INIT_EN BIT(0)
|
||||
|
||||
//3 WSPICSR 0x0008
|
||||
#define WCSR_SPI_MODE_SEL BITS(3,4)
|
||||
#define WCSR_SPI_ENDIAN_BIG BIT(2)
|
||||
#define WCSR_SPI_INT_OUT_MODE BIT(1)
|
||||
#define WCSR_SPI_DATA_OUT_MODE BIT(0)
|
||||
|
||||
//3 WHCR 0x000C
|
||||
#define WHCR_RX_ENHANCE_MODE_EN BIT(16)
|
||||
#define WHCR_MAX_HIF_RX_LEN_NUM BITS(4,7)
|
||||
#define WHCR_W_MAILBOX_RD_CLR_EN BIT(2)
|
||||
#define WHCR_W_INT_CLR_CTRL BIT(1)
|
||||
#define WHCR_MCU_DBG_EN BIT(0)
|
||||
#define WHCR_OFFSET_MAX_HIF_RX_LEN_NUM 4
|
||||
|
||||
//3 WHISR 0x0010
|
||||
#define WHISR_D2H_SW_INT BITS(8,31)
|
||||
#define WHISR_D2H_SW_ASSERT_INFO_INT BIT(31)
|
||||
#define WHISR_FW_INT_INDICATOR BIT(7)
|
||||
#define WHISR_FW_OWN_BACK_INT BIT(4)
|
||||
#define WHISR_ABNORMAL_INT BIT(3)
|
||||
#define WHISR_RX1_DONE_INT BIT(2)
|
||||
#define WHISR_RX0_DONE_INT BIT(1)
|
||||
#define WHISR_TX_DONE_INT BIT(0)
|
||||
|
||||
|
||||
//3 WHIER 0x0014
|
||||
#define WHIER_D2H_SW_INT BITS(8,31)
|
||||
#define WHIER_FW_INT_INDICATOR_EN BIT(7)
|
||||
#define WHIER_FW_OWN_BACK_INT_EN BIT(4)
|
||||
#define WHIER_ABNORMAL_INT_EN BIT(3)
|
||||
#define WHIER_RX1_DONE_INT_EN BIT(2)
|
||||
#define WHIER_RX0_DONE_INT_EN BIT(1)
|
||||
#define WHIER_TX_DONE_INT_EN BIT(0)
|
||||
#define WHIER_DEFAULT (WHIER_RX0_DONE_INT_EN | \
|
||||
WHIER_RX1_DONE_INT_EN | \
|
||||
WHIER_TX_DONE_INT_EN | \
|
||||
WHIER_ABNORMAL_INT_EN | \
|
||||
WHIER_D2H_SW_INT \
|
||||
)
|
||||
|
||||
|
||||
//3 WASR 0x0018
|
||||
#define WASR_FW_OWN_INVALID_ACCESS BIT(4)
|
||||
#define WASR_RX1_UNDER_FLOW BIT(3)
|
||||
#define WASR_RX0_UNDER_FLOW BIT(2)
|
||||
#define WASR_TX1_OVER_FLOW BIT(1)
|
||||
#define WASR_TX0_OVER_FLOW BIT(0)
|
||||
|
||||
|
||||
//3 WSICR 0x001C
|
||||
#define WSICR_H2D_SW_INT_SET BITS(16,31)
|
||||
|
||||
|
||||
//3 WTSR0 0x0044
|
||||
#define WRPLR_RX1_PACKET_LENGTH BITS(16,31)
|
||||
#define WRPLR_RX0_PACKET_LENGTH BITS(0,15)
|
||||
|
||||
#endif /* _MT6620_REG_H */
|
||||
|
||||
|
|
@ -1,724 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/nic.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "nic.h"
|
||||
\brief The declaration of nic functions
|
||||
|
||||
Detail description.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: nic.h $
|
||||
*
|
||||
* 11 01 2011 chinglan.wang
|
||||
* NULL
|
||||
* Modify the Wi-Fi method of the flush TX queue when disconnect the AP.
|
||||
* If disconnect the AP and flush all the data frame in the TX queue, WPS cannot do the 4-way handshake to connect to the AP..
|
||||
*
|
||||
* 07 18 2011 chinghwa.yu
|
||||
* [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm
|
||||
* Add CMD/Event for RDD and BWCS.
|
||||
*
|
||||
* 05 11 2011 cp.wu
|
||||
* [WCXRP00000718] [MT6620 Wi-Fi] modify the behavior of setting tx power
|
||||
* ACPI APIs migrate to wlan_lib.c for glue layer to invoke.
|
||||
*
|
||||
* 04 11 2011 yuche.tsai
|
||||
* [WCXRP00000627] [Volunteer Patch][MT6620][Driver] Pending MMPUD of P2P Network may crash system issue.
|
||||
* Fix kernel panic issue when MMPDU of P2P is pending in driver.
|
||||
*
|
||||
* 03 02 2011 cp.wu
|
||||
* [WCXRP00000503] [MT6620 Wi-Fi][Driver] Take RCPI brought by association response as initial RSSI right after connection is built.
|
||||
* use RCPI brought by ASSOC-RESP after connection is built as initial RCPI to avoid using a uninitialized MAC-RX RCPI.
|
||||
*
|
||||
* 02 01 2011 cm.chang
|
||||
* [WCXRP00000415] [MT6620 Wi-Fi][Driver] Check if any memory leakage happens when uninitializing in DGB mode
|
||||
* .
|
||||
*
|
||||
* 01 27 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
|
||||
* add roaming fsm
|
||||
* 1. not support 11r, only use strength of signal to determine roaming.
|
||||
* 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
|
||||
* 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
|
||||
* 4. assume that change of link quality in smooth way.
|
||||
*
|
||||
* 10 26 2010 cp.wu
|
||||
* [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000137] [MT6620 Wi-Fi] [FW] Support NIC capability query command
|
||||
* 1) update NVRAM content template to ver 1.02
|
||||
* 2) add compile option for querying NIC capability (default: off)
|
||||
* 3) modify AIS 5GHz support to run-time option, which could be turned on by registry or NVRAM setting
|
||||
* 4) correct auto-rate compiler error under linux (treat warning as error)
|
||||
* 5) simplify usage of NVRAM and REG_INFO_T
|
||||
* 6) add version checking between driver and firmware
|
||||
*
|
||||
* 10 26 2010 eddie.chen
|
||||
* [WCXRP00000134] [MT6620 Wi-Fi][Driver] Add a registry to enable auto rate for SQA test by using E1 EVB
|
||||
* Add auto rate parameter in registry.
|
||||
*
|
||||
* 10 12 2010 cp.wu
|
||||
* [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test
|
||||
* add HT (802.11n) fixed rate support.
|
||||
*
|
||||
* 10 08 2010 cp.wu
|
||||
* [WCXRP00000084] [MT6620 Wi-Fi][Driver][FW] Add fixed rate support for distance test
|
||||
* adding fixed rate support for distance test. (from registry setting)
|
||||
*
|
||||
* 10 05 2010 cp.wu
|
||||
* [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
|
||||
* 1) add NVRAM access API
|
||||
* 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option)
|
||||
* 3) add OID implementation for NVRAM read/write service
|
||||
*
|
||||
* 10 04 2010 cp.wu
|
||||
* [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only
|
||||
* remove ENUM_NETWORK_TYPE_T definitions
|
||||
*
|
||||
* 09 21 2010 cp.wu
|
||||
* [WCXRP00000053] [MT6620 Wi-Fi][Driver] Reset incomplete and might leads to BSOD when entering RF test with AIS associated
|
||||
* Do a complete reset with STA-REC null checking for RF test re-entry
|
||||
*
|
||||
* 09 08 2010 cp.wu
|
||||
* NULL
|
||||
* use static memory pool for storing IEs of scanning result.
|
||||
*
|
||||
* 09 01 2010 cp.wu
|
||||
* NULL
|
||||
* HIFSYS Clock Source Workaround
|
||||
*
|
||||
* 08 25 2010 george.huang
|
||||
* NULL
|
||||
* update OID/ registry control path for PM related settings
|
||||
*
|
||||
* 08 12 2010 cp.wu
|
||||
* NULL
|
||||
* [AIS-FSM] honor registry setting for adhoc running mode. (A/B/G)
|
||||
*
|
||||
* 08 03 2010 cp.wu
|
||||
* NULL
|
||||
* Centralize mgmt/system service procedures into independent calls.
|
||||
*
|
||||
* 07 28 2010 cp.wu
|
||||
* NULL
|
||||
* 1) eliminate redundant variable eOPMode in prAdapter->rWlanInfo
|
||||
* 2) change nicMediaStateChange() API prototype
|
||||
*
|
||||
* 07 14 2010 yarco.yang
|
||||
*
|
||||
* 1. Remove CFG_MQM_MIGRATION
|
||||
* 2. Add CMD_UPDATE_WMM_PARMS command
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 06 2010 george.huang
|
||||
* [WPD00001556]Basic power managemenet function
|
||||
* Update arguments for nicUpdateBeaconIETemplate()
|
||||
*
|
||||
* 07 06 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* STA-REC is maintained by CNM only.
|
||||
*
|
||||
* 07 05 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) ignore RSN checking when RSN is not turned on.
|
||||
* 2) set STA-REC deactivation callback as NULL
|
||||
* 3) add variable initialization API based on PHY configuration
|
||||
*
|
||||
* 06 30 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* sync. with CMD/EVENT document ver0.07.
|
||||
*
|
||||
* 06 29 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) sync to. CMD/EVENT document v0.03
|
||||
* 2) simplify DTIM period parsing in scan.c only, bss.c no longer parses it again.
|
||||
* 3) send command packet to indicate FW-PM after
|
||||
* a) 1st beacon is received after AIS has connected to an AP
|
||||
* b) IBSS-ALONE has been created
|
||||
* c) IBSS-MERGE has occured
|
||||
*
|
||||
* 06 25 2010 george.huang
|
||||
* [WPD00001556]Basic power managemenet function
|
||||
* Create beacon update path, with expose bssUpdateBeaconContent()
|
||||
*
|
||||
* 06 22 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) add command warpper for STA-REC/BSS-INFO sync.
|
||||
* 2) enhance command packet sending procedure for non-oid part
|
||||
* 3) add command packet definitions for STA-REC/BSS-INFO sync.
|
||||
*
|
||||
* 06 21 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* implement TX_DONE callback path.
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) migrate assoc.c.
|
||||
* 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
|
||||
* 3) add configuration options for CNM_MEM and RSN modules
|
||||
* 4) add data path for management frames
|
||||
* 5) eliminate rPacketInfo of MSDU_INFO_T
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) eliminate CFG_CMD_EVENT_VERSION_0_9
|
||||
* 2) when disconnected, indicate nic directly (no event is needed)
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 04 26 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1) surpress compiler warning
|
||||
* 2) when acqruing LP-own, keep writing WHLPCR whenever OWN is not acquired yet
|
||||
*
|
||||
* 04 13 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* add framework for BT-over-Wi-Fi support.
|
||||
* * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability
|
||||
* * * * * * * * * 2) command sequence number is now increased atomically
|
||||
* * * * * * * * * 3) private data could be hold and taken use for other purpose
|
||||
*
|
||||
* 04 12 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* add channel frequency <-> number conversion
|
||||
*
|
||||
* 03 19 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1) add ACPI D0/D3 state switching support
|
||||
* * * * * 2) use more formal way to handle interrupt when the status is retrieved from enhanced RX response
|
||||
*
|
||||
* 03 17 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* always process TX interrupt first then RX interrupt.
|
||||
*
|
||||
* 02 25 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* correct behavior to prevent duplicated RX handling for RX0_DONE and RX1_DONE
|
||||
*
|
||||
* 02 23 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* add checksum offloading support.
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-10-13 21:58:58 GMT mtk01084
|
||||
** update for new HW architecture design
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-04-24 21:12:55 GMT mtk01104
|
||||
** Add function prototype nicRestoreSpiDefMode()
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-19 18:32:54 GMT mtk01084
|
||||
** update for basic power management functions
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:32 GMT mtk01426
|
||||
** Init for develop
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _NIC_H
|
||||
#define _NIC_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
struct _REG_ENTRY_T {
|
||||
UINT_32 u4Offset;
|
||||
UINT_32 u4Value;
|
||||
};
|
||||
|
||||
struct _TABLE_ENTRY_T {
|
||||
P_REG_ENTRY_T pu4TablePtr;
|
||||
UINT_16 u2Size;
|
||||
};
|
||||
|
||||
/*! INT status to event map */
|
||||
typedef struct _INT_EVENT_MAP_T {
|
||||
UINT_32 u4Int;
|
||||
UINT_32 u4Event;
|
||||
} INT_EVENT_MAP_T, *P_INT_EVENT_MAP_T;
|
||||
|
||||
|
||||
enum ENUM_INT_EVENT_T {
|
||||
INT_EVENT_ABNORMAL,
|
||||
INT_EVENT_SW_INT,
|
||||
INT_EVENT_TX,
|
||||
INT_EVENT_RX,
|
||||
INT_EVENT_NUM
|
||||
};
|
||||
|
||||
typedef enum _ENUM_IE_UPD_METHOD_T {
|
||||
IE_UPD_METHOD_UPDATE_RANDOM,
|
||||
IE_UPD_METHOD_UPDATE_ALL,
|
||||
IE_UPD_METHOD_DELETE_ALL,
|
||||
} ENUM_IE_UPD_METHOD_T, *P_ENUM_IE_UPD_METHOD_T;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Routines in nic.c */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
nicAllocateAdapterMemory (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicReleaseAdapterMemory (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicDisableInterrupt (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicEnableInterrupt (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicProcessIST (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicProcessIST_impl (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4IntStatus
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicInitializeAdapter (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicMCRInit (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
BOOL
|
||||
nicVerifyChipID (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
|
||||
#if CFG_SDIO_INTR_ENHANCE
|
||||
VOID
|
||||
nicSDIOInit (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicSDIOReadIntStatus (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
OUT PUINT_32 pu4IntStatus
|
||||
);
|
||||
#endif
|
||||
|
||||
BOOLEAN
|
||||
nicpmSetDriverOwn (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicpmSetFWOwn (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgEnableGlobalInt
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
nicpmSetAcpiPowerD0 (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
nicpmSetAcpiPowerD3 (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
#if defined(_HIF_SPI)
|
||||
void
|
||||
nicRestoreSpiDefMode(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
#endif
|
||||
|
||||
VOID
|
||||
nicProcessSoftwareInterrupt(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicProcessAbnormalInterrupt (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicPutMailbox (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4MailboxNum,
|
||||
IN UINT_32 u4Data);
|
||||
|
||||
VOID
|
||||
nicGetMailbox (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4MailboxNum,
|
||||
OUT PUINT_32 pu4Data);
|
||||
|
||||
VOID
|
||||
nicSetSwIntr (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4SwIntrBitmap
|
||||
);
|
||||
|
||||
P_CMD_INFO_T
|
||||
nicGetPendingCmdInfo (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucSeqNum
|
||||
);
|
||||
|
||||
P_MSDU_INFO_T
|
||||
nicGetPendingTxMsduInfo (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucSeqNum
|
||||
);
|
||||
|
||||
P_MSDU_INFO_T
|
||||
nicGetPendingStaMMPDU(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucStaRecIdx
|
||||
);
|
||||
|
||||
VOID
|
||||
nicFreePendingTxMsduInfoByNetwork (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType
|
||||
);
|
||||
|
||||
UINT_8
|
||||
nicIncreaseCmdSeqNum (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
UINT_8
|
||||
nicIncreaseTxSeqNum (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
/* Media State Change */
|
||||
WLAN_STATUS
|
||||
nicMediaStateChange (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType,
|
||||
IN P_EVENT_CONNECTION_STATUS prConnectionStatus
|
||||
);
|
||||
|
||||
/* Utility function for channel number conversion */
|
||||
UINT_32
|
||||
nicChannelNum2Freq (
|
||||
IN UINT_32 u4ChannelNum
|
||||
);
|
||||
|
||||
UINT_32
|
||||
nicFreq2ChannelNum (
|
||||
IN UINT_32 u4FreqInKHz
|
||||
);
|
||||
|
||||
/* firmware command wrapper */
|
||||
/* NETWORK (WIFISYS) */
|
||||
WLAN_STATUS
|
||||
nicActivateNetwork(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicDeactivateNetwork(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx
|
||||
);
|
||||
|
||||
|
||||
/* BSS-INFO */
|
||||
WLAN_STATUS
|
||||
nicUpdateBss(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx
|
||||
);
|
||||
|
||||
/* BSS-INFO Indication (PM) */
|
||||
WLAN_STATUS
|
||||
nicPmIndicateBssCreated(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicPmIndicateBssConnected(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicPmIndicateBssAbort(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx
|
||||
);
|
||||
|
||||
/* Beacon Template Update */
|
||||
WLAN_STATUS
|
||||
nicUpdateBeaconIETemplate (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_IE_UPD_METHOD_T eIeUpdMethod,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN UINT_16 u2Capability,
|
||||
IN PUINT_8 aucIe,
|
||||
IN UINT_16 u2IELen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicQmUpdateWmmParms(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkTypeIdx
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicSetAutoTxPower(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_AUTO_POWER_PARAM_T prAutoPwrParam
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Calibration Control */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
nicUpdateTxPower(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_TX_PWR_T prTxPwrParam
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicUpdate5GOffset(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_5G_PWR_OFFSET_T pr5GPwrOffset
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicUpdateDPD(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_PWR_PARAM_T prDpdCalResult
|
||||
);
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* PHY configuration */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
nicSetAvailablePhyTypeSet (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* MGMT and System Service Control */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
nicInitSystemService (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicResetSystemService (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicUninitSystemService (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicInitMGMT (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_REG_INFO_T prRegInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
nicUninitMGMT (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicConfigPowerSaveProfile (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
PARAM_POWER_MODE ePwrMode,
|
||||
BOOLEAN fgEnCmdEvent
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Scan Result Processing */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
nicAddScanResult (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PARAM_MAC_ADDRESS rMacAddr,
|
||||
IN P_PARAM_SSID_T prSsid,
|
||||
IN UINT_32 u4Privacy,
|
||||
IN PARAM_RSSI rRssi,
|
||||
IN ENUM_PARAM_NETWORK_TYPE_T eNetworkType,
|
||||
IN P_PARAM_802_11_CONFIG_T prConfiguration,
|
||||
IN ENUM_PARAM_OP_MODE_T eOpMode,
|
||||
IN PARAM_RATES_EX rSupportedRates,
|
||||
IN UINT_16 u2IELength,
|
||||
IN PUINT_8 pucIEBuf
|
||||
);
|
||||
|
||||
VOID
|
||||
nicFreeScanResultIE (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4Idx
|
||||
);
|
||||
|
||||
#if (MT6620_E1_ASIC_HIFSYS_WORKAROUND == 1)
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Workaround Control */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
nicEnableClockGating (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicDisableClockGating (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Fixed Rate Hacking */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
nicUpdateRateParams (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_REGISTRY_FIXED_RATE_T eRateSetting,
|
||||
IN PUINT_8 pucDesiredPhyTypeSet,
|
||||
IN PUINT_16 pu2DesiredNonHTRateSet,
|
||||
IN PUINT_16 pu2BSSBasicRateSet,
|
||||
IN PUINT_8 pucMcsSet,
|
||||
IN PUINT_8 pucSupMcs32,
|
||||
IN PUINT_16 u2HtCapInfo
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Write registers */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
nicWriteMcr (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4Address,
|
||||
IN UINT_32 u4Value
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Update auto rate */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
nicRlmArUpdateParms(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4ArSysParam0,
|
||||
IN UINT_32 u4ArSysParam1,
|
||||
IN UINT_32 u4ArSysParam2,
|
||||
IN UINT_32 u4ArSysParam3
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Enable/Disable Roaming */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
nicRoamingUpdateParams(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4EnableRoaming
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
nicPrintFirmwareAssertInfo(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Link Quality Updating */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
nicUpdateLinkQuality(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx,
|
||||
IN P_EVENT_LINK_QUALITY prEventLinkQuality
|
||||
);
|
||||
|
||||
VOID
|
||||
nicUpdateRSSI(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx,
|
||||
IN INT_8 cRssi,
|
||||
IN INT_8 cLinkQuality
|
||||
);
|
||||
|
||||
VOID
|
||||
nicUpdateLinkSpeed(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx,
|
||||
IN UINT_16 u2LinkSpeed
|
||||
);
|
||||
|
||||
#if CFG_SUPPORT_RDD_TEST_MODE
|
||||
WLAN_STATUS
|
||||
nicUpdateRddTestMode(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_RDD_CH_T prRddChParam
|
||||
);
|
||||
#endif
|
||||
|
||||
#endif /* _NIC_H */
|
||||
|
||||
|
|
@ -1,529 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/nic_rx.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "nic_rx.h"
|
||||
\brief The declaration of the nic rx functions
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: nic_rx.h $
|
||||
*
|
||||
* 11 07 2011 tsaiyuan.hsu
|
||||
* [WCXRP00001083] [MT6620 Wi-Fi][DRV]] dump debug counter or frames when debugging is triggered
|
||||
* add debug counters and periodically dump counters for debugging.
|
||||
*
|
||||
* 05 05 2011 cp.wu
|
||||
* [WCXRP00000702] [MT5931][Driver] Modify initialization sequence for E1 ASIC
|
||||
* add delay after whole-chip resetting for MT5931 E1 ASIC.
|
||||
*
|
||||
* 04 18 2011 terry.wu
|
||||
* [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED
|
||||
* Remove flag CFG_WIFI_DIRECT_MOVED.
|
||||
*
|
||||
* 01 24 2011 cm.chang
|
||||
* [WCXRP00000384] [MT6620 Wi-Fi][Driver][FW] Handle 20/40 action frame in AP mode and stop ampdu timer when sta_rec is freed
|
||||
* Process received 20/40 coexistence action frame for AP mode
|
||||
*
|
||||
* 09 08 2010 cp.wu
|
||||
* NULL
|
||||
* use static memory pool for storing IEs of scanning result.
|
||||
*
|
||||
* 09 07 2010 yuche.tsai
|
||||
* NULL
|
||||
* Change prototype of API of adding P2P device to scan result.
|
||||
* Additional IE buffer is saved.
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 08 05 2010 yuche.tsai
|
||||
* NULL
|
||||
* Modify data structure for P2P Scan result.
|
||||
*
|
||||
* 08 03 2010 cp.wu
|
||||
* NULL
|
||||
* newly added P2P API should be declared in header file.
|
||||
*
|
||||
* 07 30 2010 cp.wu
|
||||
* NULL
|
||||
* 1) BoW wrapper: use definitions instead of hard-coded constant for error code
|
||||
* 2) AIS-FSM: eliminate use of desired RF parameters, use prTargetBssDesc instead
|
||||
* 3) add handling for RX_PKT_DESTINATION_HOST_WITH_FORWARD for GO-broadcast frames
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 14 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* saa_fsm.c is migrated.
|
||||
*
|
||||
* 06 14 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add management dispatching function table.
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) migrate assoc.c.
|
||||
* 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
|
||||
* 3) add configuration options for CNM_MEM and RSN modules
|
||||
* 4) add data path for management frames
|
||||
* 5) eliminate rPacketInfo of MSDU_INFO_T
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 03 30 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* remove driver-land statistics.
|
||||
*
|
||||
* 03 24 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* generate information for OID_GEN_RCV_OK & OID_GEN_XMIT_OK
|
||||
* *
|
||||
*
|
||||
* 03 11 2010 cp.wu
|
||||
* [WPD00003821][BUG] Host driver stops processing RX packets from HIF RX0
|
||||
* add RX starvation warning debug message controlled by CFG_HIF_RX_STARVATION_WARNING
|
||||
*
|
||||
* 03 10 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* code clean: removing unused variables and structure definitions
|
||||
*
|
||||
* 02 25 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* correct behavior to prevent duplicated RX handling for RX0_DONE and RX1_DONE
|
||||
*
|
||||
* 02 10 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* implement host-side firmware download logic
|
||||
*
|
||||
* 02 10 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1) remove unused function in nic_rx.c [which has been handled in que_mgt.c]
|
||||
* * 2) firmware image length is now retrieved via NdisFileOpen
|
||||
* * 3) firmware image is not structured by (P_IMG_SEC_HDR_T) anymore
|
||||
* * 4) nicRxWaitResponse() revised
|
||||
* * 5) another set of TQ counter default value is added for fw-download state
|
||||
* * 6) Wi-Fi load address is now retrieved from registry too
|
||||
*
|
||||
* 12 30 2009 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1) According to CMD/EVENT documentation v0.8,
|
||||
* * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used,
|
||||
* * * * and result is retrieved by get ATInfo instead
|
||||
* * * * 2) add 4 counter for recording aggregation statistics
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\24 2009-12-10 16:49:09 GMT mtk02752
|
||||
** code clean
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\23 2009-12-09 14:02:37 GMT MTK02468
|
||||
** Added ucStaRecIdx in SW_RFB_T and HALF_SEQ_NO_COUNT definition (to replace HALF_SEQ_NO_CNOUT)
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\22 2009-11-27 11:07:54 GMT mtk02752
|
||||
** add flush for reset
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\21 2009-11-25 18:18:09 GMT mtk02752
|
||||
** modify nicRxAddScanResult()
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-11-24 22:42:22 GMT mtk02752
|
||||
** add nicRxAddScanResult() to prepare to handle SCAN_RESULT event
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-11-24 19:57:06 GMT mtk02752
|
||||
** adopt P_HIF_RX_HEADER_T
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-11-16 21:43:04 GMT mtk02752
|
||||
** correct ENUM_RX_PKT_DESTINATION_T definitions
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-11-16 15:28:25 GMT mtk02752
|
||||
** add ucQueuedPacketNum for indicating how many packet are queued by RX reordering buffer/forwarding path
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-11-16 15:05:01 GMT mtk02752
|
||||
** add eTC for SW_RFB_T and structure RX_MAILBOX
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-11-13 21:16:57 GMT mtk02752
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-13 16:59:30 GMT mtk02752
|
||||
** add handler for event packet
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-13 13:45:50 GMT mtk02752
|
||||
** add port param for nicRxEnhanceReadBuffer()
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-11-11 10:12:31 GMT mtk02752
|
||||
** nicSDIOReadIntStatus() always read sizeof(ENHANCE_MODE_DATA_STRUCT_T) for int response, thus the number should be set to 0(:=16) instead of 10
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-10-29 19:53:32 GMT mtk01084
|
||||
** modify structure naming
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-23 16:08:23 GMT mtk01084
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-10-13 21:59:01 GMT mtk01084
|
||||
** update for new HW architecture design
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-05-20 12:23:33 GMT mtk01461
|
||||
** Add u4MaxEventBufferLen parameter to nicRxWaitResponse()
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-05-18 21:00:48 GMT mtk01426
|
||||
** Update SDIO_MAXIMUM_RX_STATUS value
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-28 10:36:15 GMT mtk01461
|
||||
** Remove unused define - SDIO_MAXIMUM_TX_STATUS
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-01 10:53:17 GMT mtk01461
|
||||
** Add function for HIF_LOOPBACK_PRE_TEST
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-18 20:56:19 GMT mtk01426
|
||||
** Add to support CFG_HIF_LOOPBACK and CFG_SDIO_RX_ENHANCE
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-17 20:19:56 GMT mtk01426
|
||||
** Add nicRxWaitResponse function proto type
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:35 GMT mtk01426
|
||||
** Init for develop
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _NIC_RX_H
|
||||
#define _NIC_RX_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define MAX_SEQ_NO 4095
|
||||
#define MAX_SEQ_NO_COUNT 4096
|
||||
#define HALF_SEQ_NO_CNOUT 2048
|
||||
|
||||
#define HALF_SEQ_NO_COUNT 2048
|
||||
|
||||
#define MT6620_FIXED_WIN_SIZE 64
|
||||
#define CFG_RX_MAX_BA_ENTRY 4
|
||||
#define CFG_RX_MAX_BA_TID_NUM 8
|
||||
|
||||
#define RX_STATUS_FLAG_MORE_PACKET BIT(30)
|
||||
#define RX_STATUS_CHKSUM_MASK BITS(0,10)
|
||||
|
||||
#define RX_RFB_LEN_FIELD_LEN 4
|
||||
#define RX_HEADER_OFFSET 2
|
||||
|
||||
|
||||
#if defined(_HIF_SDIO) && defined (WINDOWS_DDK)
|
||||
/*! On XP, maximum Tx+Rx Statue <= 64-4(HISR)*/
|
||||
#define SDIO_MAXIMUM_RX_LEN_NUM 0 /*!< 0~15 (0: un-limited) */
|
||||
#else
|
||||
#define SDIO_MAXIMUM_RX_LEN_NUM 0 /*!< 0~15 (0: un-limited) */
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
typedef enum _ENUM_RX_STATISTIC_COUNTER_T {
|
||||
RX_MPDU_TOTAL_COUNT = 0,
|
||||
RX_SIZE_ERR_DROP_COUNT,
|
||||
|
||||
RX_DATA_INDICATION_COUNT,
|
||||
RX_DATA_RETURNED_COUNT,
|
||||
RX_DATA_RETAINED_COUNT,
|
||||
|
||||
RX_DROP_TOTAL_COUNT,
|
||||
RX_TYPE_ERR_DROP_COUNT,
|
||||
RX_CLASS_ERR_DROP_COUNT,
|
||||
RX_DST_NULL_DROP_COUNT,
|
||||
|
||||
#if CFG_TCP_IP_CHKSUM_OFFLOAD || CFG_TCP_IP_CHKSUM_OFFLOAD_NDIS_60
|
||||
RX_CSUM_TCP_FAILED_COUNT,
|
||||
RX_CSUM_UDP_FAILED_COUNT,
|
||||
RX_CSUM_IP_FAILED_COUNT,
|
||||
RX_CSUM_TCP_SUCCESS_COUNT,
|
||||
RX_CSUM_UDP_SUCCESS_COUNT,
|
||||
RX_CSUM_IP_SUCCESS_COUNT,
|
||||
RX_CSUM_UNKNOWN_L4_PKT_COUNT,
|
||||
RX_CSUM_UNKNOWN_L3_PKT_COUNT,
|
||||
RX_IP_V6_PKT_CCOUNT,
|
||||
#endif
|
||||
RX_STATISTIC_COUNTER_NUM
|
||||
} ENUM_RX_STATISTIC_COUNTER_T;
|
||||
|
||||
typedef enum _ENUM_RX_PKT_DESTINATION_T {
|
||||
RX_PKT_DESTINATION_HOST, /* to OS */
|
||||
RX_PKT_DESTINATION_FORWARD, /* to TX queue for forward, AP mode */
|
||||
RX_PKT_DESTINATION_HOST_WITH_FORWARD, /* to both TX and OS, AP mode broadcast packet */
|
||||
RX_PKT_DESTINATION_NULL, /* packet to be freed */
|
||||
RX_PKT_DESTINATION_NUM
|
||||
} ENUM_RX_PKT_DESTINATION_T;
|
||||
|
||||
struct _SW_RFB_T {
|
||||
QUE_ENTRY_T rQueEntry;
|
||||
PVOID pvPacket; /*!< ptr to rx Packet Descriptor */
|
||||
PUINT_8 pucRecvBuff; /*!< ptr to receive data buffer */
|
||||
P_HIF_RX_HEADER_T prHifRxHdr;
|
||||
UINT_32 u4HifRxHdrFlag;
|
||||
PVOID pvHeader;
|
||||
UINT_16 u2PacketLen;
|
||||
UINT_16 u2HeaderLen;
|
||||
UINT_16 u2SSN;
|
||||
UINT_8 ucTid;
|
||||
UINT_8 ucWlanIdx;
|
||||
UINT_8 ucPacketType;
|
||||
UINT_8 ucStaRecIdx;
|
||||
|
||||
ENUM_CSUM_RESULT_T aeCSUM[CSUM_TYPE_NUM];
|
||||
ENUM_RX_PKT_DESTINATION_T eDst;
|
||||
ENUM_TRAFFIC_CLASS_INDEX_T eTC; /* only valid when eDst == FORWARD */
|
||||
};
|
||||
|
||||
/*! RX configuration type structure */
|
||||
typedef struct _RX_CTRL_T {
|
||||
UINT_32 u4RxCachedSize;
|
||||
PUINT_8 pucRxCached;
|
||||
QUE_T rFreeSwRfbList;
|
||||
QUE_T rReceivedRfbList;
|
||||
QUE_T rIndicatedRfbList;
|
||||
|
||||
#if CFG_SDIO_RX_AGG
|
||||
PUINT_8 pucRxCoalescingBufPtr;
|
||||
#endif
|
||||
|
||||
PVOID apvIndPacket[CFG_RX_MAX_PKT_NUM];
|
||||
PVOID apvRetainedPacket[CFG_RX_MAX_PKT_NUM];
|
||||
|
||||
UINT_8 ucNumIndPacket;
|
||||
UINT_8 ucNumRetainedPacket;
|
||||
UINT_64 au8Statistics[RX_STATISTIC_COUNTER_NUM]; /*!< RX Counters */
|
||||
|
||||
#if CFG_HIF_STATISTICS
|
||||
UINT_32 u4TotalRxAccessNum;
|
||||
UINT_32 u4TotalRxPacketNum;
|
||||
#endif
|
||||
|
||||
#if CFG_HIF_RX_STARVATION_WARNING
|
||||
UINT_32 u4QueuedCnt;
|
||||
UINT_32 u4DequeuedCnt;
|
||||
#endif
|
||||
|
||||
#if CFG_RX_PKTS_DUMP
|
||||
UINT_32 u4RxPktsDumpTypeMask;
|
||||
#endif
|
||||
|
||||
} RX_CTRL_T, *P_RX_CTRL_T;
|
||||
|
||||
typedef struct _RX_MAILBOX_T {
|
||||
UINT_32 u4RxMailbox[2]; /* for Device-to-Host Mailbox */
|
||||
} RX_MAILBOX_T, *P_RX_MAILBOX_T;
|
||||
|
||||
typedef WLAN_STATUS (*PROCESS_RX_MGT_FUNCTION)(P_ADAPTER_T, P_SW_RFB_T);
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define RX_INC_CNT(prRxCtrl, eCounter) \
|
||||
{((P_RX_CTRL_T)prRxCtrl)->au8Statistics[eCounter]++;}
|
||||
|
||||
#define RX_ADD_CNT(prRxCtrl, eCounter, u8Amount) \
|
||||
{((P_RX_CTRL_T)prRxCtrl)->au8Statistics[eCounter] += (UINT_64)u8Amount;}
|
||||
|
||||
#define RX_GET_CNT(prRxCtrl, eCounter) \
|
||||
(((P_RX_CTRL_T)prRxCtrl)->au8Statistics[eCounter])
|
||||
|
||||
#define RX_RESET_ALL_CNTS(prRxCtrl) \
|
||||
{kalMemZero(&prRxCtrl->au8Statistics[0], sizeof(prRxCtrl->au8Statistics));}
|
||||
|
||||
#define RX_STATUS_TEST_MORE_FLAG(flag) \
|
||||
((BOOL)((flag & RX_STATUS_FLAG_MORE_PACKET) ? TRUE : FALSE))
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
VOID
|
||||
nicRxInitialize (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
#if defined(MT5931)
|
||||
VOID
|
||||
nicRxPostInitialize (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
#endif
|
||||
|
||||
VOID
|
||||
nicRxUninitialize (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxProcessRFBs (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
#if !CFG_SDIO_INTR_ENHANCE
|
||||
VOID
|
||||
nicRxReceiveRFBs (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicRxReadBuffer (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN OUT P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
#else
|
||||
VOID
|
||||
nicRxSDIOReceiveRFBs (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicRxEnhanceReadBuffer (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4DataPort,
|
||||
IN UINT_16 u2RxLength,
|
||||
IN OUT P_SW_RFB_T prSwRfb
|
||||
);
|
||||
#endif /* CFG_SDIO_INTR_ENHANCE */
|
||||
|
||||
|
||||
#if CFG_SDIO_RX_AGG
|
||||
VOID
|
||||
nicRxSDIOAggReceiveRFBs (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
#endif
|
||||
|
||||
WLAN_STATUS
|
||||
nicRxSetupRFB (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxReturnRFB (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
nicProcessRxInterrupt (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxProcessPktWithoutReorder (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxProcessForwardPkt (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxProcessGOBroadcastPkt (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
nicRxFillRFB (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN OUT P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxProcessDataPacket (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN OUT P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxProcessEventPacket (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN OUT P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxProcessMgmtPacket (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN OUT P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
#if CFG_TCP_IP_CHKSUM_OFFLOAD
|
||||
VOID
|
||||
nicRxFillChksumStatus(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN OUT P_SW_RFB_T prSwRfb,
|
||||
IN UINT_32 u4TcpUdpIpCksStatus
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxUpdateCSUMStatistics (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN const ENUM_CSUM_RESULT_T aeCSUM[]
|
||||
);
|
||||
#endif /* CFG_TCP_IP_CHKSUM_OFFLOAD */
|
||||
|
||||
|
||||
VOID
|
||||
nicRxQueryStatus (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PUINT_8 pucBuffer,
|
||||
OUT PUINT_32 pu4Count
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxClearStatistics (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxQueryStatistics (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PUINT_8 pucBuffer,
|
||||
OUT PUINT_32 pu4Count
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicRxWaitResponse (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucPortIdx,
|
||||
OUT PUINT_8 pucRspBuffer,
|
||||
IN UINT_32 u4MaxRespBufferLen,
|
||||
OUT PUINT_32 pu4Length
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxEnablePromiscuousMode (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
nicRxDisablePromiscuousMode (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
|
||||
WLAN_STATUS
|
||||
nicRxFlush (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicRxProcessActionFrame (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
#endif /* _NIC_RX_H */
|
||||
|
||||
|
|
@ -1,646 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/nic_tx.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file nic_tx.h
|
||||
\brief Functions that provide TX operation in NIC's point of view.
|
||||
|
||||
This file provides TX functions which are responsible for both Hardware and
|
||||
Software Resource Management and keep their Synchronization.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: nic_tx.h $
|
||||
*
|
||||
* 11 18 2011 eddie.chen
|
||||
* [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog)
|
||||
* Add log counter for tx
|
||||
*
|
||||
* 11 10 2011 eddie.chen
|
||||
* [WCXRP00001096] [MT6620 Wi-Fi][Driver/FW] Enhance the log function (xlog)
|
||||
* Add TX_DONE status detail information.
|
||||
*
|
||||
* 08 15 2011 cp.wu
|
||||
* [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree
|
||||
* add MT6628-specific definitions.
|
||||
*
|
||||
* 04 12 2011 cp.wu
|
||||
* [WCXRP00000631] [MT6620 Wi-Fi][Driver] Add an API for QM to retrieve current TC counter value and processing frame dropping cases for TC4 path
|
||||
* 1. add nicTxGetResource() API for QM to make decisions.
|
||||
* 2. if management frames is decided by QM for dropping, the call back is invoked to indicate such a case.
|
||||
*
|
||||
* 03 21 2011 cp.wu
|
||||
* [WCXRP00000540] [MT5931][Driver] Add eHPI8/eHPI16 support to Linux Glue Layer
|
||||
* portability improvement
|
||||
*
|
||||
* 02 16 2011 cp.wu
|
||||
* [WCXRP00000449] [MT6620 Wi-Fi][Driver] Refine CMD queue handling by adding an extra API for checking availble count and modify behavior
|
||||
* 1. add new API: nicTxGetFreeCmdCount()
|
||||
* 2. when there is insufficient command descriptor, nicTxEnqueueMsdu() will drop command packets directly
|
||||
*
|
||||
* 01 24 2011 cp.wu
|
||||
* [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving
|
||||
* 1. add an extra counter for tracking pending forward frames.
|
||||
* 2. notify TX service thread as well when there is pending forward frame
|
||||
* 3. correct build errors leaded by introduction of Wi-Fi direct separation module
|
||||
*
|
||||
* 12 15 2010 yuche.tsai
|
||||
* NULL
|
||||
* Update SLT Descriptor number configure in driver.
|
||||
*
|
||||
* 11 16 2010 yarco.yang
|
||||
* [WCXRP00000177] [MT5931 F/W] Performance tuning for 1st connection
|
||||
* Update TX buffer count
|
||||
*
|
||||
* 11 03 2010 cp.wu
|
||||
* [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection
|
||||
* 1) use 8 buffers for MT5931 which is equipped with less memory
|
||||
* 2) modify MT5931 debug level to TRACE when download is successful
|
||||
*
|
||||
* 10 18 2010 cp.wu
|
||||
* [WCXRP00000117] [MT6620 Wi-Fi][Driver] Add logic for suspending driver when MT6620 is not responding anymore
|
||||
* 1. when wlanAdapterStop() failed to send POWER CTRL command to firmware, do not poll for ready bit dis-assertion
|
||||
* 2. shorten polling count for shorter response time
|
||||
* 3. if bad I/O operation is detected during TX resource polling, then further operation is aborted as well
|
||||
*
|
||||
* 10 06 2010 cp.wu
|
||||
* [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
|
||||
* code reorganization to improve isolation between GLUE and CORE layers.
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 08 30 2010 cp.wu
|
||||
* NULL
|
||||
* API added: nicTxPendingPackets(), for simplifying porting layer
|
||||
*
|
||||
* 07 26 2010 cp.wu
|
||||
*
|
||||
* change TC4 initial value from 2 to 4.
|
||||
*
|
||||
* 07 13 2010 cp.wu
|
||||
*
|
||||
* 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets
|
||||
* 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending
|
||||
* 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid descriptor underflow under concurrent network operation
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 06 2010 yarco.yang
|
||||
* [WPD00003837][MT6620]Data Path Refine
|
||||
* Add MGMT Packet type for HIF_TX_HEADER
|
||||
*
|
||||
* 06 23 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* integrate .
|
||||
*
|
||||
* 06 21 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* refine TX-DONE callback.
|
||||
*
|
||||
* 06 21 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* TX descriptors are now allocated once for reducing allocation overhead
|
||||
*
|
||||
* 06 21 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* specify correct value for management frames.
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) migrate assoc.c.
|
||||
* 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
|
||||
* 3) add configuration options for CNM_MEM and RSN modules
|
||||
* 4) add data path for management frames
|
||||
* 5) eliminate rPacketInfo of MSDU_INFO_T
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) add flag on MSDU_INFO_T for indicating BIP frame and forceBasicRate
|
||||
* 2) add packet type for indicating management frames
|
||||
*
|
||||
* 06 09 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add necessary changes to driver data paths.
|
||||
*
|
||||
* 06 09 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add TX_PACKET_MGMT to indicate the frame is coming from management modules
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* merge wlan_def.h.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 03 30 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* remove driver-land statistics.
|
||||
*
|
||||
* 03 24 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* generate information for OID_GEN_RCV_OK & OID_GEN_XMIT_OK
|
||||
* * *
|
||||
*
|
||||
* 03 10 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* code clean: removing unused variables and structure definitions
|
||||
*
|
||||
* 03 02 2010 tehuang.liu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* Redistributed the initial TC resources for normal operation
|
||||
*
|
||||
* 03 02 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* add mutex to avoid multiple access to qmTxQueue simultaneously.
|
||||
*
|
||||
* 02 23 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* add new API: wlanProcessQueuedPackets()
|
||||
*
|
||||
* 02 10 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1) remove unused function in nic_rx.c [which has been handled in que_mgt.c]
|
||||
* * * 2) firmware image length is now retrieved via NdisFileOpen
|
||||
* * * 3) firmware image is not structured by (P_IMG_SEC_HDR_T) anymore
|
||||
* * * 4) nicRxWaitResponse() revised
|
||||
* * * 5) another set of TQ counter default value is added for fw-download state
|
||||
* * * 6) Wi-Fi load address is now retrieved from registry too
|
||||
*
|
||||
* 02 09 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1. Permanent and current MAC address are now retrieved by CMD/EVENT packets instead of hard-coded address
|
||||
* * * * 2. follow MSDN defined behavior when associates to another AP
|
||||
* * * * 3. for firmware download, packet size could be up to 2048 bytes
|
||||
*
|
||||
* 01 27 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1. eliminate improper variable in rHifInfo
|
||||
* * * * * 2. block TX/ordinary OID when RF test mode is engaged
|
||||
* * * * * 3. wait until firmware finish operation when entering into and leaving from RF test mode
|
||||
* * * * * 4. correct some HAL implementation
|
||||
*
|
||||
* 01 13 2010 tehuang.liu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* Enabled the Burst_End Indication mechanism
|
||||
*
|
||||
* 12 30 2009 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1) According to CMD/EVENT documentation v0.8,
|
||||
* * * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used,
|
||||
* * * * * and result is retrieved by get ATInfo instead
|
||||
* * * * * 2) add 4 counter for recording aggregation statistics
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\24 2009-12-10 16:53:28 GMT mtk02752
|
||||
** remove unused API
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\23 2009-11-27 11:08:00 GMT mtk02752
|
||||
** add flush for reset
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\22 2009-11-24 19:56:49 GMT mtk02752
|
||||
** remove redundant eTC
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\21 2009-11-23 22:01:08 GMT mtk02468
|
||||
** Added MSDU_INFO fields for composing HIF TX header
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\20 2009-11-17 22:40:51 GMT mtk01084
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\19 2009-11-17 17:35:05 GMT mtk02752
|
||||
** + nicTxMsduInfoList() for sending MsduInfoList
|
||||
** + NIC_TX_BUFF_COUNT_TC[0~5]
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\18 2009-11-17 11:07:00 GMT mtk02752
|
||||
** add nicTxAdjustTcq() API
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\17 2009-11-16 22:28:30 GMT mtk02752
|
||||
** move aucFreeBufferCount/aucMaxNumOfBuffer into another structure
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\16 2009-11-16 21:44:50 GMT mtk02752
|
||||
** + nicTxReturnMsduInfo()
|
||||
** + nicTxFillMsduInfo()
|
||||
** + rFreeMsduInfoList field in TX_CTRL
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\15 2009-11-16 18:00:43 GMT mtk02752
|
||||
** use P_PACKET_INFO_T for prPacket to avoid inventing another new structure for packet
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\14 2009-11-16 15:28:49 GMT mtk02752
|
||||
** add ucQueuedPacketNum for indicating how many packets are queued by per STA/AC queue
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\13 2009-11-16 10:52:01 GMT mtk02752
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\12 2009-11-14 23:39:24 GMT mtk02752
|
||||
** interface structure redefine
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\11 2009-11-13 21:17:03 GMT mtk02752
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\10 2009-10-29 19:53:10 GMT mtk01084
|
||||
** remove strange code by Frog
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-10-13 21:59:04 GMT mtk01084
|
||||
** update for new HW architecture design
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-10-02 13:53:03 GMT mtk01725
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-04-28 10:36:50 GMT mtk01461
|
||||
** Add declaration of nicTxReleaseResource()
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-17 19:58:39 GMT mtk01461
|
||||
** Move CMD_INFO_T related define and function to cmd_buf.h
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-01 10:53:53 GMT mtk01461
|
||||
** Add function for SDIO_TX_ENHANCE
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-23 00:33:27 GMT mtk01461
|
||||
** Define constants for TX PATH and add nicTxPollingResource
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:09:32 GMT mtk01461
|
||||
** Update TX PATH API
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:16:38 GMT mtk01426
|
||||
** Init for develop
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _NIC_TX_H
|
||||
#define _NIC_TX_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define NIC_TX_RESOURCE_POLLING_TIMEOUT 256
|
||||
#define NIC_TX_RESOURCE_POLLING_DELAY_MSEC 50
|
||||
|
||||
/* Maximum buffer count for individual HIF TCQ */
|
||||
|
||||
#if defined(MT6620)
|
||||
#if CFG_SLT_SUPPORT
|
||||
/* 20101215 mtk01725 Redistributed the initial TC resources for SLT operation */
|
||||
#define NIC_TX_BUFF_COUNT_TC0 0 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC1 16 // First connection: 32
|
||||
#define NIC_TX_BUFF_COUNT_TC2 0 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC3 0 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC4 4 // First connection: 2
|
||||
#define NIC_TX_BUFF_COUNT_TC5 0 // First connection: 0
|
||||
#else
|
||||
/* 20100302 mtk02468 Redistributed the initial TC resources for normal operation */
|
||||
#define NIC_TX_BUFF_COUNT_TC0 6 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC1 8 // First connection: 32
|
||||
#define NIC_TX_BUFF_COUNT_TC2 8 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC3 8 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC4 4 // First connection: 2
|
||||
#define NIC_TX_BUFF_COUNT_TC5 2 // First connection: 0
|
||||
#endif
|
||||
#elif defined(MT5931)
|
||||
#define NIC_TX_BUFF_COUNT_TC0 1 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC1 14 // First connection: 32
|
||||
#define NIC_TX_BUFF_COUNT_TC2 1 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC3 1 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC4 4 // First connection: 2
|
||||
#define NIC_TX_BUFF_COUNT_TC5 1 // First connection: 0
|
||||
#elif defined(MT6628)
|
||||
#define NIC_TX_BUFF_COUNT_TC0 1 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC1 20 // First connection: 32
|
||||
#define NIC_TX_BUFF_COUNT_TC2 1 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC3 1 // First connection: 0
|
||||
#define NIC_TX_BUFF_COUNT_TC4 4 // First connection: 2
|
||||
#define NIC_TX_BUFF_COUNT_TC5 1 // First connection: 0
|
||||
|
||||
#endif
|
||||
|
||||
#define NIC_TX_BUFF_SUM (NIC_TX_BUFF_COUNT_TC0 + \
|
||||
NIC_TX_BUFF_COUNT_TC1 + \
|
||||
NIC_TX_BUFF_COUNT_TC2 + \
|
||||
NIC_TX_BUFF_COUNT_TC3 + \
|
||||
NIC_TX_BUFF_COUNT_TC4 + \
|
||||
NIC_TX_BUFF_COUNT_TC5)
|
||||
#if CFG_ENABLE_FW_DOWNLOAD
|
||||
|
||||
#define NIC_TX_INIT_BUFF_COUNT_TC0 8
|
||||
#define NIC_TX_INIT_BUFF_COUNT_TC1 0
|
||||
#define NIC_TX_INIT_BUFF_COUNT_TC2 0
|
||||
#define NIC_TX_INIT_BUFF_COUNT_TC3 0
|
||||
#define NIC_TX_INIT_BUFF_COUNT_TC4 0
|
||||
#define NIC_TX_INIT_BUFF_COUNT_TC5 0
|
||||
|
||||
#define NIC_TX_INIT_BUFF_SUM (NIC_TX_INIT_BUFF_COUNT_TC0 + \
|
||||
NIC_TX_INIT_BUFF_COUNT_TC1 + \
|
||||
NIC_TX_INIT_BUFF_COUNT_TC2 + \
|
||||
NIC_TX_INIT_BUFF_COUNT_TC3 + \
|
||||
NIC_TX_INIT_BUFF_COUNT_TC4 + \
|
||||
NIC_TX_INIT_BUFF_COUNT_TC5)
|
||||
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
//3 /* Session for TX QUEUES */
|
||||
/* The definition in this ENUM is used to categorize packet's Traffic Class according
|
||||
* to the their TID(User Priority).
|
||||
* In order to achieve QoS goal, a particular TC should not block the process of
|
||||
* another packet with different TC.
|
||||
* In current design we will have 5 categories(TCs) of SW resource.
|
||||
*/
|
||||
typedef enum _ENUM_TRAFFIC_CLASS_INDEX_T {
|
||||
TC0_INDEX = 0, /* HIF TX0: AC0 packets */
|
||||
TC1_INDEX, /* HIF TX0: AC1 packets & non-QoS packets */
|
||||
TC2_INDEX, /* HIF TX0: AC2 packets */
|
||||
TC3_INDEX, /* HIF TX0: AC3 packets */
|
||||
TC4_INDEX, /* HIF TX1: Command packets or 802.1x packets */
|
||||
TC5_INDEX, /* HIF TX0: BMCAST packets */
|
||||
TC_NUM /* Maximum number of Traffic Classes. */
|
||||
} ENUM_TRAFFIC_CLASS_INDEX_T;
|
||||
|
||||
typedef enum _ENUM_TX_STATISTIC_COUNTER_T {
|
||||
TX_MPDU_TOTAL_COUNT = 0,
|
||||
TX_INACTIVE_BSS_DROP,
|
||||
TX_INACTIVE_STA_DROP,
|
||||
TX_FORWARD_OVERFLOW_DROP,
|
||||
TX_AP_BORADCAST_DROP,
|
||||
TX_STATISTIC_COUNTER_NUM
|
||||
} ENUM_TX_STATISTIC_COUNTER_T;
|
||||
|
||||
|
||||
typedef struct _TX_TCQ_STATUS_T {
|
||||
UINT_8 aucFreeBufferCount[TC_NUM];
|
||||
UINT_8 aucMaxNumOfBuffer[TC_NUM];
|
||||
} TX_TCQ_STATUS_T, *P_TX_TCQ_STATUS_T;
|
||||
|
||||
typedef struct _TX_TCQ_ADJUST_T {
|
||||
INT_8 acVariation[TC_NUM];
|
||||
} TX_TCQ_ADJUST_T, *P_TX_TCQ_ADJUST_T;
|
||||
|
||||
typedef struct _TX_CTRL_T {
|
||||
UINT_32 u4TxCachedSize;
|
||||
PUINT_8 pucTxCached;
|
||||
|
||||
/* Elements below is classified according to TC (Traffic Class) value. */
|
||||
|
||||
TX_TCQ_STATUS_T rTc;
|
||||
|
||||
PUINT_8 pucTxCoalescingBufPtr;
|
||||
|
||||
QUE_T rFreeMsduInfoList;
|
||||
|
||||
/* Management Frame Tracking */
|
||||
/* number of management frames to be sent */
|
||||
INT_32 i4TxMgmtPendingNum;
|
||||
|
||||
/* to tracking management frames need TX done callback */
|
||||
QUE_T rTxMgmtTxingQueue;
|
||||
|
||||
#if CFG_HIF_STATISTICS
|
||||
UINT_32 u4TotalTxAccessNum;
|
||||
UINT_32 u4TotalTxPacketNum;
|
||||
#endif
|
||||
UINT_32 au4Statistics[TX_STATISTIC_COUNTER_NUM];
|
||||
|
||||
/* Number to track forwarding frames */
|
||||
INT_32 i4PendingFwdFrameCount;
|
||||
|
||||
} TX_CTRL_T, *P_TX_CTRL_T;
|
||||
|
||||
typedef enum _ENUM_TX_PACKET_SRC_T {
|
||||
TX_PACKET_OS,
|
||||
TX_PACKET_OS_OID,
|
||||
TX_PACKET_FORWARDING,
|
||||
TX_PACKET_MGMT,
|
||||
TX_PACKET_NUM
|
||||
} ENUM_TX_PACKET_SRC_T;
|
||||
|
||||
typedef enum _ENUM_HIF_TX_PACKET_TYPE_T {
|
||||
HIF_TX_PACKET_TYPE_DATA = 0,
|
||||
HIF_TX_PACKET_TYPE_COMMAND,
|
||||
HIF_TX_PACKET_TYPE_HIF_LB,
|
||||
HIF_TX_PACKET_TYPE_MGMT
|
||||
} ENUM_HIF_TX_PACKET_TYPE_T, *P_ENUM_HIF_TX_PACKET_TYPE_T;
|
||||
|
||||
typedef enum _ENUM_TX_RESULT_CODE_T {
|
||||
TX_RESULT_SUCCESS = 0,
|
||||
TX_RESULT_LIFE_TIMEOUT,
|
||||
TX_RESULT_RTS_ERROR,
|
||||
TX_RESULT_MPDU_ERROR,
|
||||
TX_RESULT_AGING_TIMEOUT,
|
||||
TX_RESULT_FLUSHED,
|
||||
TX_RESULT_DROPPED_IN_DRIVER = 32,
|
||||
TX_RESULT_NUM
|
||||
} ENUM_TX_RESULT_CODE_T, *P_ENUM_TX_RESULT_CODE_T;
|
||||
|
||||
/* TX Call Back Function */
|
||||
typedef WLAN_STATUS (*PFN_TX_DONE_HANDLER) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN ENUM_TX_RESULT_CODE_T rTxDoneStatus
|
||||
);
|
||||
|
||||
/* TX transactions could be divided into 4 kinds:
|
||||
*
|
||||
* 1) 802.1X / Bluetooth-over-Wi-Fi Security Frames
|
||||
* [CMD_INFO_T] - [prPacket] - in skb or NDIS_PACKET form
|
||||
*
|
||||
* 2) MMPDU
|
||||
* [CMD_INFO_T] - [prPacket] - [MSDU_INFO_T] - [prPacket] - direct buffer for frame body
|
||||
*
|
||||
* 3) Command Packets
|
||||
* [CMD_INFO_T] - [pucInfoBuffer] - direct buffer for content of command packet
|
||||
*
|
||||
* 4) Normal data frame
|
||||
* [MSDU_INFO_T] - [prPacket] - in skb or NDIS_PACKET form
|
||||
*/
|
||||
|
||||
|
||||
/* PS_FORWARDING_TYPE_NON_PS means that the receiving STA is in Active Mode
|
||||
* from the perspective of host driver (maybe not synchronized with FW --> SN is needed)
|
||||
*/
|
||||
|
||||
struct _MSDU_INFO_T {
|
||||
QUE_ENTRY_T rQueEntry;
|
||||
P_NATIVE_PACKET prPacket;
|
||||
|
||||
ENUM_TX_PACKET_SRC_T eSrc; /* specify OS/FORWARD packet */
|
||||
UINT_8 ucUserPriority;
|
||||
|
||||
/* For composing HIF TX header */
|
||||
UINT_8 ucTC; /* Traffic Class: 0~4 (HIF TX0), 5 (HIF TX1) */
|
||||
UINT_8 ucPacketType; /* 0: Data, 1: Command, 2: HIF Loopback 3: Management Frame */
|
||||
UINT_8 ucStaRecIndex;
|
||||
UINT_8 ucNetworkType; /* See ENUM_NETWORK_TYPE_T */
|
||||
UINT_8 ucFormatID; /* 0: MAUI, Linux, Windows NDIS 5.1 */
|
||||
BOOLEAN fgIs802_1x; /* TRUE: 802.1x frame */
|
||||
BOOLEAN fgIs802_11; /* TRUE: 802.11 header is present */
|
||||
UINT_16 u2PalLLH; /* PAL Logical Link Header (for BOW network) */
|
||||
UINT_16 u2AclSN; /* ACL Sequence Number (for BOW network) */
|
||||
UINT_8 ucPsForwardingType; /* See ENUM_PS_FORWARDING_TYPE_T */
|
||||
UINT_8 ucPsSessionID; /* PS Session ID specified by the FW for the STA */
|
||||
BOOLEAN fgIsBurstEnd; /* TRUE means this is the last packet of the burst for (STA, TID) */
|
||||
BOOLEAN fgIsBIP; /* Management Frame Protection */
|
||||
BOOLEAN fgIsBasicRate; /* Force Basic Rate Transmission */
|
||||
|
||||
/* flattened from PACKET_INFO_T */
|
||||
UINT_8 ucMacHeaderLength;
|
||||
UINT_8 ucLlcLength; /* w/o EtherType */
|
||||
UINT_16 u2FrameLength;
|
||||
UINT_8 aucEthDestAddr[MAC_ADDR_LEN]; /* Ethernet Destination Address */
|
||||
|
||||
/* for TX done tracking */
|
||||
UINT_8 ucTxSeqNum;
|
||||
PFN_TX_DONE_HANDLER pfTxDoneHandler;
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#define TX_INC_CNT(prTxCtrl, eCounter) \
|
||||
{((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter]++;}
|
||||
|
||||
#define TX_ADD_CNT(prTxCtrl, eCounter, u8Amount) \
|
||||
{((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter] += (UINT_32)u8Amount;}
|
||||
|
||||
#define TX_GET_CNT(prTxCtrl, eCounter) \
|
||||
(((P_TX_CTRL_T)prTxCtrl)->au4Statistics[eCounter])
|
||||
|
||||
#define TX_RESET_ALL_CNTS(prTxCtrl) \
|
||||
{kalMemZero(&prTxCtrl->au4Statistics[0], sizeof(prTxCtrl->au4Statistics));}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
VOID
|
||||
nicTxInitialize (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicTxAcquireResource (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucTC
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicTxPollingResource (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucTC
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
nicTxReleaseResource (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8* aucTxRlsCnt
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicTxResetResource (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
UINT_8
|
||||
nicTxGetResource (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucTC
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicTxMsduInfoList (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfoListHead
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicTxMsduQueue (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_8 ucPortIdx,
|
||||
P_QUE_T prQue
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicTxCmd (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo,
|
||||
IN UINT_8 ucTC
|
||||
);
|
||||
|
||||
VOID
|
||||
nicTxRelease (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicProcessTxInterrupt (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
nicTxFreeMsduInfoPacket (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfoListHead
|
||||
);
|
||||
|
||||
VOID
|
||||
nicTxReturnMsduInfo (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfoListHead
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
nicTxFillMsduInfo (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN P_NATIVE_PACKET prNdisPacket
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicTxAdjustTcq (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicTxFlush (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
#if CFG_ENABLE_FW_DOWNLOAD
|
||||
WLAN_STATUS
|
||||
nicTxInitCmd (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo,
|
||||
IN UINT_8 ucTC
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
nicTxInitResetResource (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
#endif
|
||||
|
||||
WLAN_STATUS
|
||||
nicTxEnqueueMsdu (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
UINT_32
|
||||
nicTxGetFreeCmdCount (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _NIC_TX_H */
|
||||
|
||||
|
||||
|
|
@ -1,195 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/nic/p2p.h#3 $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: p2p.h $
|
||||
*
|
||||
* 07 17 2012 yuche.tsai
|
||||
* NULL
|
||||
* Compile no error before trial run.
|
||||
*
|
||||
* 10 20 2010 wh.su
|
||||
* [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group
|
||||
* Add the code to support disconnect p2p group
|
||||
*
|
||||
* 09 21 2010 kevin.huang
|
||||
* [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface
|
||||
* Isolate P2P related function for Hardware Software Bundle
|
||||
*
|
||||
* 08 03 2010 cp.wu
|
||||
* NULL
|
||||
* [Wi-Fi Direct] add framework for driver hooks
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 23 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* p2p interface revised to be sync. with HAL
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 05 18 2010 cp.wu
|
||||
* [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
|
||||
* add parameter to control:
|
||||
* 1) auto group owner
|
||||
* 2) P2P-PS parameter (CTWindow, NoA descriptors)
|
||||
*
|
||||
* 05 18 2010 cp.wu
|
||||
* [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
|
||||
* correct WPS Device Password ID definition.
|
||||
*
|
||||
* 05 17 2010 cp.wu
|
||||
* [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
|
||||
* implement get scan result.
|
||||
*
|
||||
* 05 17 2010 cp.wu
|
||||
* [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
|
||||
* add basic handling framework for wireless extension ioctls.
|
||||
*
|
||||
* 05 14 2010 cp.wu
|
||||
* [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
|
||||
* add ioctl framework for Wi-Fi Direct by reusing wireless extension ioctls as well
|
||||
*
|
||||
* 05 11 2010 cp.wu
|
||||
* [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
|
||||
* p2p ioctls revised.
|
||||
*
|
||||
* 05 10 2010 cp.wu
|
||||
* [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
|
||||
* implement basic wi-fi direct framework
|
||||
*
|
||||
* 05 07 2010 cp.wu
|
||||
* [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
|
||||
* add basic framework for implementating P2P driver hook.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _P2P_H
|
||||
#define _P2P_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
// refer to 'Config Methods' in WPS
|
||||
#define WPS_CONFIG_USBA 0x0001
|
||||
#define WPS_CONFIG_ETHERNET 0x0002
|
||||
#define WPS_CONFIG_LABEL 0x0004
|
||||
#define WPS_CONFIG_DISPLAY 0x0008
|
||||
#define WPS_CONFIG_EXT_NFC 0x0010
|
||||
#define WPS_CONFIG_INT_NFC 0x0020
|
||||
#define WPS_CONFIG_NFC 0x0040
|
||||
#define WPS_CONFIG_PBC 0x0080
|
||||
#define WPS_CONFIG_KEYPAD 0x0100
|
||||
|
||||
// refer to 'Device Password ID' in WPS
|
||||
#define WPS_DEV_PASSWORD_ID_PIN 0x0000
|
||||
#define WPS_DEV_PASSWORD_ID_USER 0x0001
|
||||
#define WPS_DEV_PASSWORD_ID_MACHINE 0x0002
|
||||
#define WPS_DEV_PASSWORD_ID_REKEY 0x0003
|
||||
#define WPS_DEV_PASSWORD_ID_PUSHBUTTON 0x0004
|
||||
#define WPS_DEV_PASSWORD_ID_REGISTRAR 0x0005
|
||||
|
||||
|
||||
#define P2P_DEVICE_TYPE_NUM 2
|
||||
#define P2P_DEVICE_NAME_LENGTH 32
|
||||
#define P2P_NETWORK_NUM 8
|
||||
#define P2P_MEMBER_NUM 8
|
||||
|
||||
#define P2P_WILDCARD_SSID "DIRECT-"
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
struct _P2P_INFO_T {
|
||||
UINT_32 u4DeviceNum;
|
||||
EVENT_P2P_DEV_DISCOVER_RESULT_T arP2pDiscoverResult[CFG_MAX_NUM_BSS_LIST];
|
||||
PUINT_8 pucCurrIePtr;
|
||||
UINT_8 aucCommIePool[CFG_MAX_COMMON_IE_BUF_LEN]; /* A common pool for IE of all scan results. */
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
ENUM_P2P_PEER_GROUP,
|
||||
ENUM_P2P_PEER_DEVICE,
|
||||
ENUM_P2P_PEER_NUM
|
||||
} ENUM_P2P_PEER_TYPE, *P_ENUM_P2P_PEER_TYPE;
|
||||
|
||||
typedef struct _P2P_DEVICE_INFO {
|
||||
UINT_8 aucDevAddr[PARAM_MAC_ADDR_LEN];
|
||||
UINT_8 aucIfAddr[PARAM_MAC_ADDR_LEN];
|
||||
UINT_8 ucDevCapabilityBitmap;
|
||||
INT_32 i4ConfigMethod;
|
||||
UINT_8 aucPrimaryDeviceType[8];
|
||||
UINT_8 aucSecondaryDeviceType[8];
|
||||
UINT_8 aucDeviceName[P2P_DEVICE_NAME_LENGTH];
|
||||
} P2P_DEVICE_INFO, *P_P2P_DEVICE_INFO;
|
||||
|
||||
typedef struct _P2P_GROUP_INFO {
|
||||
PARAM_SSID_T rGroupID;
|
||||
P2P_DEVICE_INFO rGroupOwnerInfo;
|
||||
UINT_8 ucMemberNum;
|
||||
P2P_DEVICE_INFO arMemberInfo[P2P_MEMBER_NUM];
|
||||
} P2P_GROUP_INFO, *P_P2P_GROUP_INFO;
|
||||
|
||||
typedef struct _P2P_NETWORK_INFO {
|
||||
ENUM_P2P_PEER_TYPE eNodeType;
|
||||
|
||||
union {
|
||||
P2P_GROUP_INFO rGroupInfo;
|
||||
P2P_DEVICE_INFO rDeviceInfo;
|
||||
} node;
|
||||
|
||||
} P2P_NETWORK_INFO, *P_P2P_NETWORK_INFO;
|
||||
|
||||
typedef struct _P2P_NETWORK_LIST {
|
||||
UINT_8 ucNetworkNum;
|
||||
P2P_NETWORK_INFO rP2PNetworkInfo[P2P_NETWORK_NUM];
|
||||
} P2P_NETWORK_LIST, *P_P2P_NETWORK_LIST;
|
||||
|
||||
typedef struct _P2P_DISCONNECT_INFO {
|
||||
UINT_8 ucRole;
|
||||
UINT_8 ucRsv[3];
|
||||
} P2P_DISCONNECT_INFO, *P_P2P_DISCONNECT_INFO;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /*_P2P_H */
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
/*
|
||||
** $Id:
|
||||
*/
|
||||
|
||||
/*! \file "p2p_cmd_buf.h"
|
||||
\brief In this file we define the structure for Command Packet.
|
||||
|
||||
In this file we define the structure for Command Packet and the control unit
|
||||
of MGMT Memory Pool.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: p2p_cmd_buf.h $
|
||||
*
|
||||
* 07 17 2012 yuche.tsai
|
||||
* NULL
|
||||
* Compile no error before trial run.
|
||||
*
|
||||
* 12 22 2010 cp.wu
|
||||
* [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery
|
||||
* 1. header file restructure for more clear module isolation
|
||||
* 2. add function interface definition for implementing Service Discovery callbacks
|
||||
*/
|
||||
|
||||
#ifndef _P2P_CMD_BUF_H
|
||||
#define _P2P_CMD_BUF_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
/* Firmware Command Packer */
|
||||
/*--------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
wlanoidSendSetQueryP2PCmd (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_8 ucCID,
|
||||
BOOLEAN fgSetQuery,
|
||||
BOOLEAN fgNeedResp,
|
||||
BOOLEAN fgIsOid,
|
||||
PFN_CMD_DONE_HANDLER pfCmdDoneHandler,
|
||||
PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler,
|
||||
UINT_32 u4SetQueryInfoLen,
|
||||
PUINT_8 pucInfoBuffer,
|
||||
OUT PVOID pvSetQueryBuffer,
|
||||
IN UINT_32 u4SetQueryBufferLen
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* _P2P_CMD_BUF_H */
|
||||
|
||||
|
||||
|
|
@ -1,223 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/nic/p2p_mac.h#2 $
|
||||
*/
|
||||
|
||||
/*! \file "p2p_mac.h"
|
||||
\brief Brief description.
|
||||
|
||||
Detail description.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef _P2P_MAC_H
|
||||
#define _P2P_MAC_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#define ACTION_PUBLIC_WIFI_DIRECT 9
|
||||
#define ACTION_GAS_INITIAL_REQUEST 10
|
||||
#define ACTION_GAS_INITIAL_RESPONSE 11
|
||||
#define ACTION_GAS_COMEBACK_REQUEST 12
|
||||
#define ACTION_GAS_COMEBACK_RESPONSE 13
|
||||
|
||||
|
||||
/* P2P 4.2.8.1 - P2P Public Action Frame Type. */
|
||||
#define P2P_PUBLIC_ACTION_GO_NEGO_REQ 0
|
||||
#define P2P_PUBLIC_ACTION_GO_NEGO_RSP 1
|
||||
#define P2P_PUBLIC_ACTION_GO_NEGO_CFM 2
|
||||
#define P2P_PUBLIC_ACTION_INVITATION_REQ 3
|
||||
#define P2P_PUBLIC_ACTION_INVITATION_RSP 4
|
||||
#define P2P_PUBLIC_ACTION_DEV_DISCOVER_REQ 5
|
||||
#define P2P_PUBLIC_ACTION_DEV_DISCOVER_RSP 6
|
||||
#define P2P_PUBLIC_ACTION_PROV_DISCOVERY_REQ 7
|
||||
#define P2P_PUBLIC_ACTION_PROV_DISCOVERY_RSP 8
|
||||
|
||||
/* P2P 4.2.9.1 - P2P Action Frame Type */
|
||||
#define P2P_ACTION_NOTICE_OF_ABSENCE 0
|
||||
#define P2P_ACTION_P2P_PRESENCE_REQ 1
|
||||
#define P2P_ACTION_P2P_PRESENCE_RSP 2
|
||||
#define P2P_ACTION_GO_DISCOVER_REQ 3
|
||||
|
||||
#define P2P_PUBLIC_ACTION_FRAME_LEN (WLAN_MAC_MGMT_HEADER_LEN+8)
|
||||
#define P2P_ACTION_FRAME_LEN (WLAN_MAC_MGMT_HEADER_LEN+7)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/* P2P 4.2.8.2 P2P Public Action Frame Format */
|
||||
typedef struct _P2P_PUBLIC_ACTION_FRAME_T {
|
||||
/* MAC header */
|
||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
||||
UINT_16 u2Duration; /* Duration */
|
||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
||||
/* P2P Public Action Frame Body */
|
||||
UINT_8 ucCategory; /* Category, 0x04 */
|
||||
UINT_8 ucAction; /* Action Value, 0x09 */
|
||||
UINT_8 aucOui[3]; /* 0x50, 0x6F, 0x9A */
|
||||
UINT_8 ucOuiType; /* 0x09 */
|
||||
UINT_8 ucOuiSubtype; /* GO Nego Req/Rsp/Cfm, P2P Invittion Req/Rsp, Device Discoverability Req/Rsp */
|
||||
UINT_8 ucDialogToken; /* Dialog Token. */
|
||||
UINT_8 aucInfoElem[1]; /* P2P IE, WSC IE. */
|
||||
} __KAL_ATTRIB_PACKED__ P2P_PUBLIC_ACTION_FRAME_T, *P_P2P_PUBLIC_ACTION_FRAME_T;
|
||||
|
||||
|
||||
/* P2P 4.2.9.1 - General Action Frame Format. */
|
||||
typedef struct _P2P_ACTION_FRAME_T {
|
||||
/* MAC header */
|
||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
||||
UINT_16 u2Duration; /* Duration */
|
||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
||||
/* P2P Action Frame Body */
|
||||
UINT_8 ucCategory; // 0x7F
|
||||
UINT_8 aucOui[3]; // 0x50, 0x6F, 0x9A
|
||||
UINT_8 ucOuiType; // 0x09
|
||||
UINT_8 ucOuiSubtype; //
|
||||
UINT_8 ucDialogToken;
|
||||
UINT_8 aucInfoElem[1];
|
||||
} __KAL_ATTRIB_PACKED__ P2P_ACTION_FRAME_T, *P_P2P_ACTION_FRAME_T;
|
||||
|
||||
/* P2P C.1 GAS Public Action Initial Request Frame Format */
|
||||
typedef struct _GAS_PUBLIC_ACTION_INITIAL_REQUEST_FRAME_T {
|
||||
/* MAC header */
|
||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
||||
UINT_16 u2Duration; /* Duration */
|
||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
||||
/* P2P Public Action Frame Body */
|
||||
UINT_8 ucCategory; /* Category, 0x04 */
|
||||
UINT_8 ucAction; /* Action Value, 0x09 */
|
||||
UINT_8 ucDialogToken; /* Dialog Token. */
|
||||
UINT_8 aucInfoElem[1]; /* Advertisement IE. */
|
||||
} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_INITIAL_REQUEST_FRAME_T, *P_GAS_PUBLIC_ACTION_INITIAL_REQUEST_FRAME_T;
|
||||
|
||||
/* P2P C.2 GAS Public Action Initial Response Frame Format */
|
||||
typedef struct _GAS_PUBLIC_ACTION_INITIAL_RESPONSE_FRAME_T {
|
||||
/* MAC header */
|
||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
||||
UINT_16 u2Duration; /* Duration */
|
||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
||||
/* P2P Public Action Frame Body */
|
||||
UINT_8 ucCategory; /* Category, 0x04 */
|
||||
UINT_8 ucAction; /* Action Value, 0x09 */
|
||||
UINT_8 ucDialogToken; /* Dialog Token. */
|
||||
UINT_16 u2StatusCode; /* Initial Response. */
|
||||
UINT_16 u2ComebackDelay; /* Initial Response. */ /* In unit of TU. */
|
||||
UINT_8 aucInfoElem[1]; /* Advertisement IE. */
|
||||
} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_INITIAL_RESPONSE_FRAME_T, *P_GAS_PUBLIC_ACTION_INITIAL_RESPONSE_FRAME_T;
|
||||
|
||||
|
||||
/* P2P C.3-1 GAS Public Action Comeback Request Frame Format */
|
||||
typedef struct _GAS_PUBLIC_ACTION_COMEBACK_REQUEST_FRAME_T {
|
||||
/* MAC header */
|
||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
||||
UINT_16 u2Duration; /* Duration */
|
||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
||||
/* P2P Public Action Frame Body */
|
||||
UINT_8 ucCategory; /* Category, 0x04 */
|
||||
UINT_8 ucAction; /* Action Value, 0x09 */
|
||||
UINT_8 ucDialogToken; /* Dialog Token. */
|
||||
} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_COMEBACK_REQUEST_FRAME_T, *P_GAS_PUBLIC_ACTION_COMEBACK_REQUEST_FRAME_T;
|
||||
|
||||
/* P2P C.3-2 GAS Public Action Comeback Response Frame Format */
|
||||
typedef struct _GAS_PUBLIC_ACTION_COMEBACK_RESPONSE_FRAME_T {
|
||||
/* MAC header */
|
||||
UINT_16 u2FrameCtrl; /* Frame Control */
|
||||
UINT_16 u2Duration; /* Duration */
|
||||
UINT_8 aucDestAddr[MAC_ADDR_LEN]; /* DA */
|
||||
UINT_8 aucSrcAddr[MAC_ADDR_LEN]; /* SA */
|
||||
UINT_8 aucBSSID[MAC_ADDR_LEN]; /* BSSID */
|
||||
UINT_16 u2SeqCtrl; /* Sequence Control */
|
||||
/* P2P Public Action Frame Body */
|
||||
UINT_8 ucCategory; /* Category, 0x04 */
|
||||
UINT_8 ucAction; /* Action Value, 0x09 */
|
||||
UINT_8 ucDialogToken; /* Dialog Token. */
|
||||
UINT_16 u2StatusCode; /* Comeback Response. */
|
||||
UINT_8 ucFragmentID; /*Comeback Response. */
|
||||
UINT_16 u2ComebackDelay; /* Comeback Response. */
|
||||
UINT_8 aucInfoElem[1]; /* Advertisement IE. */
|
||||
} __KAL_ATTRIB_PACKED__ GAS_PUBLIC_ACTION_COMEBACK_RESPONSE_FRAME_T, *P_GAS_PUBLIC_ACTION_COMEBACK_RESPONSE_FRAME_T;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct _P2P_SD_VENDER_SPECIFIC_CONTENT_T {
|
||||
/* Service Discovery Vendor-specific Content. */
|
||||
UINT_8 ucOuiSubtype; // 0x09
|
||||
UINT_16 u2ServiceUpdateIndicator;
|
||||
UINT_8 aucServiceTLV[1];
|
||||
} __KAL_ATTRIB_PACKED__ P2P_SD_VENDER_SPECIFIC_CONTENT_T, *P_P2P_SD_VENDER_SPECIFIC_CONTENT_T;
|
||||
|
||||
|
||||
typedef struct _P2P_SERVICE_REQUEST_TLV_T {
|
||||
UINT_16 u2Length;
|
||||
UINT_8 ucServiceProtocolType;
|
||||
UINT_8 ucServiceTransID;
|
||||
UINT_8 aucQueryData[1];
|
||||
} __KAL_ATTRIB_PACKED__ P2P_SERVICE_REQUEST_TLV_T, *P_P2P_SERVICE_REQUEST_TLV_T;
|
||||
|
||||
|
||||
|
||||
typedef struct _P2P_SERVICE_RESPONSE_TLV_T {
|
||||
UINT_16 u2Length;
|
||||
UINT_8 ucServiceProtocolType;
|
||||
UINT_8 ucServiceTransID;
|
||||
UINT_8 ucStatusCode;
|
||||
UINT_8 aucResponseData[1];
|
||||
} __KAL_ATTRIB_PACKED__ P2P_SERVICE_RESPONSE_TLV_T, *P_P2P_SERVICE_RESPONSE_TLV_T;
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/nic/p2p_nic.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "p2p_nic.h"
|
||||
\brief The declaration of nic functions
|
||||
|
||||
Detail description.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef _P2P_NIC_H
|
||||
#define _P2P_NIC_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
VOID
|
||||
nicP2pMediaStateChange(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetworkType,
|
||||
IN P_EVENT_CONNECTION_STATUS prConnectionStatus
|
||||
);
|
||||
|
||||
VOID
|
||||
nicRxAddP2pDevice(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_EVENT_P2P_DEV_DISCOVER_RESULT_T prP2pResult,
|
||||
IN PUINT_8 pucRxIEBuf,
|
||||
IN UINT_16 u2RxIELength
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/nic/p2p_nic_cmd_event.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file p2p_nic_cmd_event.h
|
||||
\brief
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef _P2P_NIC_CMD_EVENT_H
|
||||
#define _P2P_NIC_CMD_EVENT_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
typedef struct _EVENT_P2P_DEV_DISCOVER_RESULT_T {
|
||||
// UINT_8 aucCommunicateAddr[MAC_ADDR_LEN]; // Deprecated.
|
||||
UINT_8 aucDeviceAddr[MAC_ADDR_LEN]; /* Device Address. */
|
||||
UINT_8 aucInterfaceAddr[MAC_ADDR_LEN]; /* Device Address. */
|
||||
UINT_8 ucDeviceCapabilityBitmap;
|
||||
UINT_8 ucGroupCapabilityBitmap;
|
||||
UINT_16 u2ConfigMethod; /* Configure Method. */
|
||||
P2P_DEVICE_TYPE_T rPriDevType;
|
||||
UINT_8 ucSecDevTypeNum;
|
||||
P2P_DEVICE_TYPE_T arSecDevType[2];
|
||||
UINT_16 u2NameLength;
|
||||
UINT_8 aucName[32];
|
||||
PUINT_8 pucIeBuf;
|
||||
UINT_16 u2IELength;
|
||||
UINT_8 aucBSSID[MAC_ADDR_LEN];
|
||||
// TODO: Service Information or PasswordID valid?
|
||||
} EVENT_P2P_DEV_DISCOVER_RESULT_T, *P_EVENT_P2P_DEV_DISCOVER_RESULT_T;
|
||||
|
||||
#endif
|
||||
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,180 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic_init_cmd_event.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "nic_init_cmd_event.h"
|
||||
\brief This file contains the declairation file of the WLAN initialization routines
|
||||
for MediaTek Inc. 802.11 Wireless LAN Adapters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: nic_init_cmd_event.h $
|
||||
*
|
||||
* 09 26 2011 cp.wu
|
||||
* [WCXRP00001011] [MT6628 Wi-Fi] Firmware Download Agent: make CRC validation as an optional feature
|
||||
* add definition for disabling CRC32 validation (for MT6628 only)
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 03 12 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* add two option for ACK and ENCRYPTION for firmware download
|
||||
*
|
||||
* 03 01 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* add command/event definitions for initial states
|
||||
*
|
||||
* 02 10 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* implement host-side firmware download logic
|
||||
*
|
||||
* 02 08 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* prepare for implementing fw download logic
|
||||
*
|
||||
*/
|
||||
#ifndef _NIC_INIT_CMD_EVENT_H
|
||||
#define _NIC_INIT_CMD_EVENT_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#include "gl_typedef.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define INIT_CMD_STATUS_SUCCESS 0
|
||||
#define INIT_CMD_STATUS_REJECTED_INVALID_PARAMS 1
|
||||
#define INIT_CMD_STATUS_REJECTED_CRC_ERROR 2
|
||||
#define INIT_CMD_STATUS_REJECTED_DECRYPT_FAIL 3
|
||||
#define INIT_CMD_STATUS_UNKNOWN 4
|
||||
|
||||
#define EVENT_HDR_SIZE OFFSET_OF(WIFI_EVENT_T, aucBuffer[0])
|
||||
|
||||
typedef enum _ENUM_INIT_CMD_ID {
|
||||
INIT_CMD_ID_DOWNLOAD_BUF = 1,
|
||||
INIT_CMD_ID_WIFI_START,
|
||||
INIT_CMD_ID_ACCESS_REG,
|
||||
INIT_CMD_ID_QUERY_PENDING_ERROR
|
||||
} ENUM_INIT_CMD_ID, *P_ENUM_INIT_CMD_ID;
|
||||
|
||||
typedef enum _ENUM_INIT_EVENT_ID {
|
||||
INIT_EVENT_ID_CMD_RESULT = 1,
|
||||
INIT_EVENT_ID_ACCESS_REG,
|
||||
INIT_EVENT_ID_PENDING_ERROR
|
||||
} ENUM_INIT_EVENT_ID, *P_ENUM_INIT_EVENT_ID;
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
typedef UINT_8 CMD_STATUS;
|
||||
|
||||
// commands
|
||||
typedef struct _INIT_WIFI_CMD_T {
|
||||
UINT_8 ucCID;
|
||||
UINT_8 ucSeqNum;
|
||||
UINT_16 u2Reserved;
|
||||
UINT_8 aucBuffer[0];
|
||||
} INIT_WIFI_CMD_T, *P_INIT_WIFI_CMD_T;
|
||||
|
||||
typedef struct _INIT_HIF_TX_HEADER_T {
|
||||
UINT_16 u2TxByteCount;
|
||||
UINT_8 ucEtherTypeOffset;
|
||||
UINT_8 ucCSflags;
|
||||
INIT_WIFI_CMD_T rInitWifiCmd;
|
||||
} INIT_HIF_TX_HEADER_T, *P_INIT_HIF_TX_HEADER_T;
|
||||
|
||||
#define DOWNLOAD_BUF_ENCRYPTION_MODE BIT(0)
|
||||
#define DOWNLOAD_BUF_NO_CRC_CHECKING BIT(30)
|
||||
#define DOWNLOAD_BUF_ACK_OPTION BIT(31)
|
||||
typedef struct _INIT_CMD_DOWNLOAD_BUF {
|
||||
UINT_32 u4Address;
|
||||
UINT_32 u4Length;
|
||||
UINT_32 u4CRC32;
|
||||
UINT_32 u4DataMode;
|
||||
UINT_8 aucBuffer[0];
|
||||
} INIT_CMD_DOWNLOAD_BUF, *P_INIT_CMD_DOWNLOAD_BUF;
|
||||
|
||||
typedef struct _INIT_CMD_WIFI_START {
|
||||
UINT_32 u4Override;
|
||||
UINT_32 u4Address;
|
||||
} INIT_CMD_WIFI_START, *P_INIT_CMD_WIFI_START;
|
||||
|
||||
typedef struct _INIT_CMD_ACCESS_REG {
|
||||
UINT_8 ucSetQuery;
|
||||
UINT_8 aucReserved[3];
|
||||
UINT_32 u4Address;
|
||||
UINT_32 u4Data;
|
||||
} INIT_CMD_ACCESS_REG, *P_INIT_CMD_ACCESS_REG;
|
||||
|
||||
// Events
|
||||
typedef struct _INIT_WIFI_EVENT_T {
|
||||
UINT_16 u2RxByteCount;
|
||||
UINT_8 ucEID;
|
||||
UINT_8 ucSeqNum;
|
||||
UINT_8 aucBuffer[0];
|
||||
} INIT_WIFI_EVENT_T, *P_INIT_WIFI_EVENT_T;
|
||||
|
||||
typedef struct _INIT_HIF_RX_HEADER_T {
|
||||
INIT_WIFI_EVENT_T rInitWifiEvent;
|
||||
} INIT_HIF_RX_HEADER_T, *P_INIT_HIF_RX_HEADER_T;
|
||||
|
||||
typedef struct _INIT_EVENT_CMD_RESULT {
|
||||
UINT_8 ucStatus; // 0: success
|
||||
// 1: rejected by invalid param
|
||||
// 2: rejected by incorrect CRC
|
||||
// 3: rejected by decryption failure
|
||||
// 4: unknown CMD
|
||||
UINT_8 aucReserved[3];
|
||||
} INIT_EVENT_CMD_RESULT, *P_INIT_EVENT_CMD_RESULT, INIT_EVENT_PENDING_ERROR, *P_INIT_EVENT_PENDING_ERROR;
|
||||
|
||||
typedef struct _INIT_EVENT_ACCESS_REG {
|
||||
UINT_32 u4Address;
|
||||
UINT_32 u4Data;
|
||||
} INIT_EVENT_ACCESS_REG, *P_INIT_EVENT_ACCESS_REG;
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _NIC_INIT_CMD_EVENT_H */
|
||||
|
||||
|
|
@ -1,225 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/p2p_precomp.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file p2p_precomp.h
|
||||
\brief Collection of most compiler flags for p2p driver are described here.
|
||||
|
||||
In this file we collect all compiler flags and detail the p2p driver behavior if
|
||||
enable/disable such switch or adjust numeric parameters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef _P2P_PRECOMP_H
|
||||
#define _P2P_PRECOMP_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "gl_os.h" // Include "config.h"
|
||||
|
||||
#include "gl_p2p_os.h"
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
#include "link.h"
|
||||
#include "queue.h"
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* .\include\mgmt
|
||||
*------------------------------------------------------------------------------
|
||||
*/
|
||||
#include "wlan_typedef.h"
|
||||
|
||||
|
||||
#include "mac.h"
|
||||
|
||||
/* Dependency: mac.h (MAC_ADDR_LEN) */
|
||||
#include "wlan_def.h"
|
||||
|
||||
#include "roaming_fsm.h"
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* .\include\nic
|
||||
*------------------------------------------------------------------------------
|
||||
*/
|
||||
/* Dependency: wlan_def.h (ENUM_NETWORK_TYPE_T) */
|
||||
#include "cmd_buf.h"
|
||||
|
||||
|
||||
/* Dependency: mac.h (MAC_ADDR_LEN) */
|
||||
#include "nic_cmd_event.h"
|
||||
|
||||
|
||||
/* Dependency: nic_cmd_event.h (P_EVENT_CONNECTION_STATUS) */
|
||||
#include "nic.h"
|
||||
|
||||
#include "nic_init_cmd_event.h"
|
||||
|
||||
#include "hif_rx.h"
|
||||
#include "hif_tx.h"
|
||||
|
||||
#include "nic_tx.h"
|
||||
|
||||
/* Dependency: hif_rx.h (P_HIF_RX_HEADER_T) */
|
||||
#include "nic_rx.h"
|
||||
|
||||
#include "que_mgt.h"
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
#include "p2p_typedef.h"
|
||||
#include "p2p_cmd_buf.h"
|
||||
#include "p2p_nic_cmd_event.h"
|
||||
#include "p2p_mac.h"
|
||||
#include "p2p_nic.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* .\include\mgmt
|
||||
*------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "hem_mbox.h"
|
||||
|
||||
#include "scan.h"
|
||||
#include "bss.h"
|
||||
|
||||
#include "wlan_lib.h"
|
||||
#include "wlan_oid.h"
|
||||
#include "wlan_bow.h"
|
||||
|
||||
#include "wlan_p2p.h"
|
||||
|
||||
|
||||
|
||||
|
||||
#include "hal.h"
|
||||
|
||||
#if defined(MT6620)
|
||||
#include "mt6620_reg.h"
|
||||
#elif defined(MT5931)
|
||||
#include "mt5931_reg.h"
|
||||
#endif
|
||||
|
||||
#include "rlm.h"
|
||||
#include "rlm_domain.h"
|
||||
#include "rlm_protection.h"
|
||||
#include "rlm_obss.h"
|
||||
#include "rate.h"
|
||||
|
||||
|
||||
#include "aa_fsm.h"
|
||||
|
||||
#include "cnm_timer.h"
|
||||
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
#include "bow.h"
|
||||
#include "bow_fsm.h"
|
||||
#endif
|
||||
|
||||
#include "pwr_mgt.h"
|
||||
|
||||
|
||||
#include "cnm.h"
|
||||
/* Dependency: aa_fsm.h (ENUM_AA_STATE_T), p2p_fsm.h (WPS_ATTRI_MAX_LEN_DEVICE_NAME) */
|
||||
#include "cnm_mem.h"
|
||||
#include "cnm_scan.h"
|
||||
|
||||
#include "p2p_rlm_obss.h"
|
||||
#include "p2p_bss.h"
|
||||
#include "p2p.h"
|
||||
/* Dependency: cnm_timer.h (TIMER_T) */
|
||||
#include "p2p_fsm.h"
|
||||
#include "p2p_scan.h"
|
||||
#include "p2p_state.h"
|
||||
#include "p2p_func.h"
|
||||
#include "p2p_rlm.h"
|
||||
#include "p2p_assoc.h"
|
||||
#include "p2p_ie.h"
|
||||
|
||||
|
||||
#include "privacy.h"
|
||||
|
||||
#include "mib.h"
|
||||
|
||||
#include "auth.h"
|
||||
#include "assoc.h"
|
||||
|
||||
|
||||
#include "ais_fsm.h"
|
||||
|
||||
|
||||
#include "adapter.h"
|
||||
|
||||
|
||||
#include "que_mgt.h"
|
||||
#include "rftest.h"
|
||||
|
||||
|
||||
#if CFG_RSN_MIGRATION
|
||||
#include "rsn.h"
|
||||
#include "sec_fsm.h"
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_WAPI
|
||||
#include "wapi.h"
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* NVRAM structure
|
||||
*------------------------------------------------------------------------------
|
||||
*/
|
||||
#include "CFG_Wifi_File.h"
|
||||
|
||||
#include "gl_p2p_kal.h"
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /*_P2P_PRECOMP_H */
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,278 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/p2p_typedef.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file p2p_typedef.h
|
||||
\brief Declaration of data type and return values of internal protocol stack.
|
||||
|
||||
In this file we declare the data type and return values which will be exported
|
||||
to all MGMT Protocol Stack.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef _P2P_TYPEDEF_H
|
||||
#define _P2P_TYPEDEF_H
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*
|
||||
* type definition of pointer to p2p structure
|
||||
*/
|
||||
//typedef struct _GL_P2P_INFO_T GL_P2P_INFO_T, *P_GL_P2P_INFO_T;
|
||||
typedef struct _P2P_INFO_T P2P_INFO_T, *P_P2P_INFO_T;
|
||||
|
||||
typedef struct _P2P_FSM_INFO_T P2P_FSM_INFO_T, *P_P2P_FSM_INFO_T;
|
||||
|
||||
typedef struct _P2P_CONNECTION_SETTINGS_T P2P_CONNECTION_SETTINGS_T, *P_P2P_CONNECTION_SETTINGS_T;
|
||||
|
||||
|
||||
/* Type definition for function pointer to p2p function*/
|
||||
typedef BOOLEAN (*P2P_LAUNCH)(
|
||||
P_GLUE_INFO_T prGlueInfo
|
||||
);
|
||||
|
||||
typedef BOOLEAN (*P2P_REMOVE)(
|
||||
P_GLUE_INFO_T prGlueInfo,
|
||||
BOOLEAN fgIsWlanLaunched
|
||||
);
|
||||
|
||||
typedef BOOLEAN (*KAL_P2P_GET_CIPHER)(
|
||||
IN P_GLUE_INFO_T prGlueInfo
|
||||
);
|
||||
|
||||
typedef BOOLEAN (*KAL_P2P_GET_TKIP_CIPHER)(
|
||||
IN P_GLUE_INFO_T prGlueInfo
|
||||
);
|
||||
|
||||
typedef BOOLEAN (*KAL_P2P_GET_CCMP_CIPHER)(
|
||||
IN P_GLUE_INFO_T prGlueInfo
|
||||
);
|
||||
|
||||
typedef BOOLEAN (*KAL_P2P_GET_WSC_MODE)(
|
||||
IN P_GLUE_INFO_T prGlueInfo
|
||||
);
|
||||
|
||||
typedef struct net_device* (*KAL_P2P_GET_DEV_HDLR)(
|
||||
P_GLUE_INFO_T prGlueInfo
|
||||
);
|
||||
|
||||
typedef VOID (*KAL_P2P_SET_MULTICAST_WORK_ITEM) (
|
||||
P_GLUE_INFO_T prGlueInfo
|
||||
);
|
||||
|
||||
typedef VOID (*P2P_NET_REGISTER) (
|
||||
P_GLUE_INFO_T prGlueInfo
|
||||
);
|
||||
|
||||
typedef VOID (*P2P_NET_UNREGISTER) (
|
||||
P_GLUE_INFO_T prGlueInfo
|
||||
);
|
||||
|
||||
typedef VOID (*KAL_P2P_UPDATE_ASSOC_INFO)(
|
||||
IN P_GLUE_INFO_T prGlueInfo,
|
||||
IN PUINT_8 pucFrameBody,
|
||||
IN UINT_32 u4FrameBodyLen,
|
||||
IN BOOLEAN fgReassocRequest
|
||||
);
|
||||
|
||||
typedef BOOLEAN (*P2P_VALIDATE_AUTH) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN PP_STA_RECORD_T pprStaRec,
|
||||
OUT PUINT_16 pu2StatusCode
|
||||
);
|
||||
|
||||
typedef BOOLEAN (*P2P_VALIDATE_ASSOC_REQ) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
OUT PUINT_16 pu4ControlFlags
|
||||
);
|
||||
|
||||
typedef VOID (*P2P_RUN_EVENT_AAA_TX_FAIL) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
typedef BOOLEAN (*P2P_PARSE_CHECK_FOR_P2P_INFO_ELEM)(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PUINT_8 pucBuf,
|
||||
OUT PUINT_8 pucOuiType
|
||||
);
|
||||
|
||||
|
||||
typedef WLAN_STATUS (*P2P_RUN_EVENT_AAA_COMPLETE) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
typedef VOID (*P2P_PROCESS_EVENT_UPDATE_NOA_PARAM) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_8 ucNetTypeIndex,
|
||||
P_EVENT_UPDATE_NOA_PARAMS_T prEventUpdateNoaParam
|
||||
);
|
||||
|
||||
typedef VOID (*SCAN_P2P_PROCESS_BEACON_AND_PROBE_RESP) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN P_WLAN_STATUS prStatus,
|
||||
IN P_BSS_DESC_T prBssDesc,
|
||||
IN P_WLAN_BEACON_FRAME_T prWlanBeaconFrame
|
||||
);
|
||||
|
||||
typedef VOID (*P2P_RX_PUBLIC_ACTION_FRAME) (
|
||||
P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
typedef VOID (*RLM_RSP_GENERATE_OBSS_SCAN_IE) (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
typedef VOID (*RLM_UPDATE_BW_BY_CH_LIST_FOR_AP)(
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
typedef VOID (*RLM_PROCESS_PUBLIC_ACTION)(
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
typedef VOID (*RLM_PROCESS_HT_ACTION)(
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
typedef VOID (*RLM_UPDATE_PARAMS_FOR_AP)(
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo,
|
||||
BOOLEAN fgUpdateBeacon
|
||||
);
|
||||
|
||||
typedef VOID (*RLM_HANDLE_OBSS_STATUS_EVENT_PKT) (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_EVENT_AP_OBSS_STATUS_T prObssStatus
|
||||
);
|
||||
|
||||
|
||||
typedef BOOLEAN (*P2P_FUNC_VALIDATE_PROBE_REQ) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
OUT PUINT_32 pu4ControlFlags
|
||||
);
|
||||
|
||||
typedef VOID (*RLM_BSS_INIT_FOR_AP)(
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo
|
||||
);
|
||||
|
||||
typedef UINT_32 (*P2P_GET_PROB_RSP_IE_TABLE_SIZE)(
|
||||
VOID
|
||||
);
|
||||
|
||||
typedef PUINT_8 (*P2P_BUILD_REASSOC_REQ_FRAME_COMMON_IES) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN PUINT_8 pucBuffer
|
||||
);
|
||||
|
||||
|
||||
typedef VOID (*P2P_FUNC_DISCONNECT) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN BOOLEAN fgSendDeauth,
|
||||
IN UINT_16 u2ReasonCode
|
||||
);
|
||||
|
||||
typedef VOID (*P2P_FSM_RUN_EVENT_RX_DEAUTH) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
typedef VOID (*P2P_FSM_RUN_EVENT_RX_DISASSOC) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
typedef BOOLEAN (*P2P_FUN_IS_AP_MODE) (
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo
|
||||
);
|
||||
|
||||
typedef VOID (*P2P_FSM_RUN_EVENT_BEACON_TIMEOUT) (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
|
||||
typedef VOID (*P2P_FUNC_STORE_ASSOC_RSP_IE_BUFFER) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
|
||||
typedef VOID (*P2P_GENERATE_P2P_IE) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
);
|
||||
|
||||
typedef UINT_32 (*P2P_CALCULATE_P2P_IE_LEN) (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#endif /*CFG_ENABLE_WIFI_DIRECT*/
|
||||
|
||||
#endif /* _P2P_TYPEDEF_H */
|
||||
|
||||
|
||||
|
|
@ -1,380 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/precomp.h#2 $
|
||||
*/
|
||||
|
||||
/*! \file precomp.h
|
||||
\brief Collection of most compiler flags are described here.
|
||||
|
||||
In this file we collect all compiler flags and detail the driver behavior if
|
||||
enable/disable such switch or adjust numeric parameters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: precomp.h $
|
||||
*
|
||||
* 07 17 2012 yuche.tsai
|
||||
* NULL
|
||||
* Compile no error before trial run.
|
||||
*
|
||||
* 01 05 2012 tsaiyuan.hsu
|
||||
* [WCXRP00001157] [MT6620 Wi-Fi][FW][DRV] add timing measurement support for 802.11v
|
||||
* add timing measurement support for 802.11v.
|
||||
*
|
||||
* 08 15 2011 cp.wu
|
||||
* [WCXRP00000851] [MT6628 Wi-Fi][Driver] Add HIFSYS related definition to driver source tree
|
||||
* add MT6628-specific definitions.
|
||||
*
|
||||
* 04 18 2011 terry.wu
|
||||
* [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED
|
||||
* Remove flag CFG_WIFI_DIRECT_MOVED.
|
||||
*
|
||||
* 03 15 2011 eddie.chen
|
||||
* [WCXRP00000554] [MT6620 Wi-Fi][DRV] Add sw control debug counter
|
||||
* Add sw debug counter for QM.
|
||||
*
|
||||
* 01 27 2011 tsaiyuan.hsu
|
||||
* [WCXRP00000392] [MT6620 Wi-Fi][Driver] Add Roaming Support
|
||||
* add roaming fsm
|
||||
* 1. not support 11r, only use strength of signal to determine roaming.
|
||||
* 2. not enable CFG_SUPPORT_ROAMING until completion of full test.
|
||||
* 3. in 6620, adopt work-around to avoid sign extension problem of cck of hw
|
||||
* 4. assume that change of link quality in smooth way.
|
||||
*
|
||||
* 12 13 2010 cp.wu
|
||||
* [WCXRP00000260] [MT6620 Wi-Fi][Driver][Firmware] Create V1.1 branch for both firmware and driver
|
||||
* create branch for Wi-Fi driver v1.1
|
||||
*
|
||||
* 10 07 2010 cp.wu
|
||||
* [WCXRP00000083] [MT5931][Driver][FW] Add necessary logic for MT5931 first connection
|
||||
* add firmware download for MT5931.
|
||||
*
|
||||
* 10 05 2010 cp.wu
|
||||
* [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
|
||||
* 1) add NVRAM access API
|
||||
* 2) fake scanning result when NVRAM doesn't exist and/or version mismatch. (off by compiler option)
|
||||
* 3) add OID implementation for NVRAM read/write service
|
||||
*
|
||||
* 09 21 2010 kevin.huang
|
||||
* [WCXRP00000052] [MT6620 Wi-Fi][Driver] Eliminate Linux Compile Warning
|
||||
* Isolate P2P related function for Hardware Software Bundle
|
||||
*
|
||||
* 09 14 2010 chinghwa.yu
|
||||
* NULL
|
||||
* Fix BOW_FSM_INFO_T dependence.
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 07 20 2010 wh.su
|
||||
*
|
||||
* adding the wapi code.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 08 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Check draft RLM code for HT cap
|
||||
*
|
||||
* 07 01 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Modify CNM message handler for new flow
|
||||
*
|
||||
* 06 28 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* 1st draft code for RLM module
|
||||
*
|
||||
* 06 19 2010 wh.su
|
||||
* [WPD00003840][MT6620 5931] Security migration
|
||||
* consdier the concurrent network setting.
|
||||
*
|
||||
* 06 18 2010 wh.su
|
||||
* [WPD00003840][MT6620 5931] Security migration
|
||||
* migration the security related function from firmware.
|
||||
*
|
||||
* 06 18 2010 wh.su
|
||||
* [WPD00003840][MT6620 5931] Security migration
|
||||
* migration from MT6620 firmware.
|
||||
*
|
||||
* 06 08 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add hem_mbox.c and cnm_mem.h (but disabled some feature) for further migration
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* merge cnm_scan.h and hem_mbox.h
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* merge wifi_var.h, precomp.h, cnm_timer.h (data type only)
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 05 17 2010 cp.wu
|
||||
* [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
|
||||
* 1) add timeout handler mechanism for pending command packets
|
||||
* 2) add p2p add/removal key
|
||||
*
|
||||
* 04 13 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* add framework for BT-over-Wi-Fi support.
|
||||
* * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability
|
||||
* * * * * * * * * * * 2) command sequence number is now increased atomically
|
||||
* * * * * * * * * * * 3) private data could be hold and taken use for other purpose
|
||||
*
|
||||
* 03 16 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* build up basic data structure and definitions to support BT-over-WiFi
|
||||
*
|
||||
* 02 08 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* prepare for implementing fw download logic
|
||||
*
|
||||
* 01 27 2010 wh.su
|
||||
* [WPD00003816][MT6620 Wi-Fi] Adding the security support
|
||||
* .
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\9 2009-12-08 11:30:58 GMT mtk02752
|
||||
** add rftest.h for implementing RF test mode in driver land
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\8 2009-11-23 22:02:00 GMT mtk02468
|
||||
** Added que_mgt.h
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-10-13 21:58:36 GMT mtk01084
|
||||
** update for new macro define
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-04-21 09:40:11 GMT mtk01461
|
||||
** Add nic_cmd_event.h
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-17 20:00:26 GMT mtk01461
|
||||
** Add cmd_buf.h
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-19 18:32:44 GMT mtk01084
|
||||
** update for basic power management functions
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:08:25 GMT mtk01461
|
||||
** Update TX PATH API
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:11:38 GMT mtk01426
|
||||
** Init for develop
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _PRECOMP_H
|
||||
#define _PRECOMP_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "gl_os.h" // Include "config.h"
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
#include "gl_p2p_os.h"
|
||||
#endif
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
#include "link.h"
|
||||
#include "queue.h"
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* .\include\mgmt
|
||||
*------------------------------------------------------------------------------
|
||||
*/
|
||||
#include "wlan_typedef.h"
|
||||
|
||||
#include "mac.h"
|
||||
|
||||
/* Dependency: mac.h (MAC_ADDR_LEN) */
|
||||
#include "wlan_def.h"
|
||||
|
||||
#if CFG_SUPPORT_SWCR
|
||||
#include "swcr.h"
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* .\include\nic
|
||||
*------------------------------------------------------------------------------
|
||||
*/
|
||||
/* Dependency: wlan_def.h (ENUM_NETWORK_TYPE_T) */
|
||||
#include "cmd_buf.h"
|
||||
|
||||
/* Dependency: mac.h (MAC_ADDR_LEN) */
|
||||
#include "nic_cmd_event.h"
|
||||
|
||||
/* Dependency: nic_cmd_event.h (P_EVENT_CONNECTION_STATUS) */
|
||||
#include "nic.h"
|
||||
|
||||
#include "nic_init_cmd_event.h"
|
||||
|
||||
#include "hif_rx.h"
|
||||
#include "hif_tx.h"
|
||||
|
||||
#include "nic_tx.h"
|
||||
|
||||
/* Dependency: hif_rx.h (P_HIF_RX_HEADER_T) */
|
||||
#include "nic_rx.h"
|
||||
|
||||
#include "que_mgt.h"
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
#include "p2p_typedef.h"
|
||||
#include "p2p_cmd_buf.h"
|
||||
#include "p2p_nic_cmd_event.h"
|
||||
#include "p2p_mac.h"
|
||||
#include "p2p_nic.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* .\include\mgmt
|
||||
*------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "hem_mbox.h"
|
||||
|
||||
#include "scan.h"
|
||||
#include "bss.h"
|
||||
|
||||
#include "wlan_lib.h"
|
||||
#include "wlan_oid.h"
|
||||
#include "wlan_bow.h"
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
#include "wlan_p2p.h"
|
||||
#endif
|
||||
|
||||
#include "hal.h"
|
||||
|
||||
#if defined(MT6620)
|
||||
#include "mt6620_reg.h"
|
||||
#elif defined(MT5931)
|
||||
#include "mt5931_reg.h"
|
||||
#elif defined(MT6628)
|
||||
#include "mt6628_reg.h"
|
||||
#endif
|
||||
|
||||
#include "rlm.h"
|
||||
#include "rlm_domain.h"
|
||||
#include "rlm_protection.h"
|
||||
#include "rlm_obss.h"
|
||||
#include "rate.h"
|
||||
#if CFG_SUPPORT_802_11V
|
||||
#include "wnm.h"
|
||||
#endif
|
||||
|
||||
#include "aa_fsm.h"
|
||||
|
||||
#include "cnm_timer.h"
|
||||
|
||||
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
#include "bow.h"
|
||||
#include "bow_fsm.h"
|
||||
#endif
|
||||
|
||||
#include "pwr_mgt.h"
|
||||
|
||||
|
||||
#include "cnm.h"
|
||||
/* Dependency: aa_fsm.h (ENUM_AA_STATE_T), p2p_fsm.h (WPS_ATTRI_MAX_LEN_DEVICE_NAME) */
|
||||
#include "cnm_mem.h"
|
||||
#include "cnm_scan.h"
|
||||
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
#include "p2p_rlm_obss.h"
|
||||
#include "p2p_bss.h"
|
||||
#include "p2p.h"
|
||||
#include "p2p_fsm.h"
|
||||
#include "p2p_scan.h"
|
||||
#include "p2p_state.h"
|
||||
#include "p2p_func.h"
|
||||
#include "p2p_rlm.h"
|
||||
#include "p2p_assoc.h"
|
||||
#include "p2p_ie.h"
|
||||
#endif
|
||||
|
||||
#include "privacy.h"
|
||||
|
||||
#include "mib.h"
|
||||
|
||||
#include "auth.h"
|
||||
#include "assoc.h"
|
||||
|
||||
#if CFG_SUPPORT_ROAMING
|
||||
#include "roaming_fsm.h"
|
||||
#endif /* CFG_SUPPORT_ROAMING */
|
||||
|
||||
#include "ais_fsm.h"
|
||||
|
||||
|
||||
#include "adapter.h"
|
||||
|
||||
|
||||
#include "que_mgt.h"
|
||||
#include "rftest.h"
|
||||
|
||||
|
||||
#if CFG_RSN_MIGRATION
|
||||
#include "rsn.h"
|
||||
#include "sec_fsm.h"
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_WAPI
|
||||
#include "wapi.h"
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
* NVRAM structure
|
||||
*------------------------------------------------------------------------------
|
||||
*/
|
||||
#include "CFG_Wifi_File.h"
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
#include "gl_p2p_kal.h"
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _PRECOMP_H */
|
||||
|
||||
|
||||
|
|
@ -1,147 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/pwr_mgt.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "pwr_mgt.h"
|
||||
\brief In this file we define the STATE and EVENT for Power Management FSM.
|
||||
|
||||
The SCAN FSM is responsible for performing SCAN behavior when the Arbiter enter
|
||||
ARB_STATE_SCAN. The STATE and EVENT for SCAN FSM are defined here with detail
|
||||
description.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: pwr_mgt.h $
|
||||
*
|
||||
* 07 09 2010 george.huang
|
||||
*
|
||||
* [WPD00001556] Migrate PM variables from FW to driver: for composing QoS Info
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 04 20 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* don't need SPIN_LOCK_PWR_CTRL anymore, it will raise IRQL
|
||||
* and cause SdBusSubmitRequest running at DISPATCH_LEVEL as well.
|
||||
|
||||
*
|
||||
* 03 25 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* firmware download load adress & start address are now configured from config.h
|
||||
* * * due to the different configurations on FPGA and ASIC
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\7 2009-12-10 16:39:10 GMT mtk02752
|
||||
** disable PM macros temporally
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-10-29 19:48:37 GMT mtk01084
|
||||
** temp remove power management macro
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-04-08 16:51:11 GMT mtk01084
|
||||
** update for power management control macro
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-04-03 14:59:58 GMT mtk01426
|
||||
** Add #if CFG_HIF_LOOPBACK_PRETEST
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-23 16:53:10 GMT mtk01084
|
||||
** modify ACQUIRE_POWER_CONTROL_FROM_PM() and RECLAIM_POWER_CONTROL_TO_PM() macro
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-19 18:32:47 GMT mtk01084
|
||||
** update for basic power management functions
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-03-19 15:05:20 GMT mtk01084
|
||||
** Initial version
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _PWR_MGT_H
|
||||
#define _PWR_MGT_H
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define PM_UAPSD_AC0 (BIT(0))
|
||||
#define PM_UAPSD_AC1 (BIT(1))
|
||||
#define PM_UAPSD_AC2 (BIT(2))
|
||||
#define PM_UAPSD_AC3 (BIT(3))
|
||||
|
||||
#define PM_UAPSD_ALL (PM_UAPSD_AC0 | PM_UAPSD_AC1 | PM_UAPSD_AC2 | PM_UAPSD_AC3)
|
||||
#define PM_UAPSD_NONE 0
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
typedef struct _PM_PROFILE_SETUP_INFO_T {
|
||||
/* Profile setup */
|
||||
UINT_8 ucBmpDeliveryAC; /* 0: AC_BE, 1: AC_BK, 2: AC_VI, 3: AC_VO */
|
||||
UINT_8 ucBmpTriggerAC; /* 0: AC_BE, 1: AC_BK, 2: AC_VI, 3: AC_VO */
|
||||
|
||||
UINT_8 ucUapsdSp; /* Number of triggered packets in UAPSD */
|
||||
|
||||
} PM_PROFILE_SETUP_INFO_T, *P_PM_PROFILE_SETUP_INFO_T;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#if !CFG_ENABLE_FULL_PM
|
||||
#define ACQUIRE_POWER_CONTROL_FROM_PM(_prAdapter)
|
||||
#define RECLAIM_POWER_CONTROL_TO_PM(_prAdapter, _fgEnableGINT_in_IST)
|
||||
#else
|
||||
#define ACQUIRE_POWER_CONTROL_FROM_PM(_prAdapter) \
|
||||
{ \
|
||||
if (_prAdapter->fgIsFwOwn) { \
|
||||
nicpmSetDriverOwn(_prAdapter); \
|
||||
} \
|
||||
/* Increase Block to Enter Low Power Semaphore count */ \
|
||||
GLUE_INC_REF_CNT(_prAdapter->u4PwrCtrlBlockCnt); \
|
||||
}
|
||||
|
||||
#define RECLAIM_POWER_CONTROL_TO_PM(_prAdapter, _fgEnableGINT_in_IST) \
|
||||
{ \
|
||||
ASSERT(_prAdapter->u4PwrCtrlBlockCnt != 0); \
|
||||
/* Decrease Block to Enter Low Power Semaphore count */ \
|
||||
GLUE_DEC_REF_CNT(_prAdapter->u4PwrCtrlBlockCnt); \
|
||||
if (_prAdapter->fgWiFiInSleepyState && (_prAdapter->u4PwrCtrlBlockCnt == 0)) { \
|
||||
nicpmSetFWOwn(_prAdapter, _fgEnableGINT_in_IST); \
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _PWR_MGT_H */
|
||||
|
||||
|
|
@ -1,189 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/queue.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file queue.h
|
||||
\brief Definition for singly queue operations.
|
||||
|
||||
In this file we define the singly queue data structure and its
|
||||
queue operation MACROs.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: queue.h $
|
||||
*
|
||||
* 07 16 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration.
|
||||
* bugfix for SCN migration
|
||||
* 1) modify QUEUE_CONCATENATE_QUEUES() so it could be used to concatence with an empty queue
|
||||
* 2) before AIS issues scan request, network(BSS) needs to be activated first
|
||||
* 3) only invoke COPY_SSID when using specified SSID for scan
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 04 20 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* .
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:11:46 GMT mtk01426
|
||||
** Init for develop
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _QUEUE_H
|
||||
#define _QUEUE_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "gl_typedef.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Singly Queue Structures - Entry Part */
|
||||
typedef struct _QUE_ENTRY_T {
|
||||
struct _QUE_ENTRY_T *prNext;
|
||||
struct _QUE_ENTRY_T *prPrev; /* For Rx buffer reordering used only */
|
||||
} QUE_ENTRY_T, *P_QUE_ENTRY_T;
|
||||
|
||||
/* Singly Queue Structures - Queue Part */
|
||||
typedef struct _QUE_T {
|
||||
P_QUE_ENTRY_T prHead;
|
||||
P_QUE_ENTRY_T prTail;
|
||||
UINT_32 u4NumElem;
|
||||
} QUE_T, *P_QUE_T;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define QUEUE_INITIALIZE(prQueue) \
|
||||
{ \
|
||||
(prQueue)->prHead = (P_QUE_ENTRY_T)NULL; \
|
||||
(prQueue)->prTail = (P_QUE_ENTRY_T)NULL; \
|
||||
(prQueue)->u4NumElem = 0; \
|
||||
}
|
||||
|
||||
#define QUEUE_IS_EMPTY(prQueue) (((P_QUE_T)(prQueue))->prHead == (P_QUE_ENTRY_T)NULL)
|
||||
|
||||
#define QUEUE_IS_NOT_EMPTY(prQueue) ((prQueue)->u4NumElem > 0)
|
||||
|
||||
#define QUEUE_GET_HEAD(prQueue) ((prQueue)->prHead)
|
||||
|
||||
#define QUEUE_GET_TAIL(prQueue) ((prQueue)->prTail)
|
||||
|
||||
#define QUEUE_GET_NEXT_ENTRY(prQueueEntry) ((prQueueEntry)->prNext)
|
||||
|
||||
#define QUEUE_INSERT_HEAD(prQueue, prQueueEntry) \
|
||||
{ \
|
||||
ASSERT(prQueue); \
|
||||
ASSERT(prQueueEntry); \
|
||||
(prQueueEntry)->prNext = (prQueue)->prHead; \
|
||||
(prQueue)->prHead = (prQueueEntry); \
|
||||
if ((prQueue)->prTail == (P_QUE_ENTRY_T)NULL) { \
|
||||
(prQueue)->prTail = (prQueueEntry); \
|
||||
} \
|
||||
((prQueue)->u4NumElem)++; \
|
||||
}
|
||||
|
||||
#define QUEUE_INSERT_TAIL(prQueue, prQueueEntry) \
|
||||
{ \
|
||||
ASSERT(prQueue); \
|
||||
ASSERT(prQueueEntry); \
|
||||
(prQueueEntry)->prNext = (P_QUE_ENTRY_T)NULL; \
|
||||
if ((prQueue)->prTail) { \
|
||||
((prQueue)->prTail)->prNext = (prQueueEntry); \
|
||||
} else { \
|
||||
(prQueue)->prHead = (prQueueEntry); \
|
||||
} \
|
||||
(prQueue)->prTail = (prQueueEntry); \
|
||||
((prQueue)->u4NumElem)++; \
|
||||
}
|
||||
|
||||
/* NOTE: We assume the queue entry located at the beginning of "prQueueEntry Type",
|
||||
* so that we can cast the queue entry to other data type without doubts.
|
||||
* And this macro also decrease the total entry count at the same time.
|
||||
*/
|
||||
#define QUEUE_REMOVE_HEAD(prQueue, prQueueEntry, _P_TYPE) \
|
||||
{ \
|
||||
ASSERT(prQueue); \
|
||||
prQueueEntry = (_P_TYPE)((prQueue)->prHead); \
|
||||
if (prQueueEntry) { \
|
||||
(prQueue)->prHead = ((P_QUE_ENTRY_T)(prQueueEntry))->prNext; \
|
||||
if ((prQueue)->prHead == (P_QUE_ENTRY_T)NULL){ \
|
||||
(prQueue)->prTail = (P_QUE_ENTRY_T)NULL; \
|
||||
} \
|
||||
((P_QUE_ENTRY_T)(prQueueEntry))->prNext = (P_QUE_ENTRY_T)NULL; \
|
||||
((prQueue)->u4NumElem)--; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define QUEUE_MOVE_ALL(prDestQueue, prSrcQueue) \
|
||||
{ \
|
||||
ASSERT(prDestQueue); \
|
||||
ASSERT(prSrcQueue); \
|
||||
*(P_QUE_T)prDestQueue = *(P_QUE_T)prSrcQueue; \
|
||||
QUEUE_INITIALIZE(prSrcQueue); \
|
||||
}
|
||||
|
||||
#define QUEUE_CONCATENATE_QUEUES(prDestQueue, prSrcQueue) \
|
||||
{ \
|
||||
ASSERT(prDestQueue); \
|
||||
ASSERT(prSrcQueue); \
|
||||
if (prSrcQueue->u4NumElem > 0) { \
|
||||
if ((prDestQueue)->prTail) { \
|
||||
((prDestQueue)->prTail)->prNext = (prSrcQueue)->prHead; \
|
||||
} else { \
|
||||
(prDestQueue)->prHead = (prSrcQueue)->prHead; \
|
||||
} \
|
||||
(prDestQueue)->prTail = (prSrcQueue)->prTail; \
|
||||
((prDestQueue)->u4NumElem) += ((prSrcQueue)->u4NumElem); \
|
||||
QUEUE_INITIALIZE(prSrcQueue); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif /* _QUEUE_H */
|
||||
|
||||
|
|
@ -1,317 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/rftest.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "rftest.h"
|
||||
\brief definitions for RF Productino test
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: rftest.h $
|
||||
*
|
||||
* 12 20 2011 cp.wu
|
||||
* [WCXRP00001144] [MT6620 Wi-Fi][Driver][Firmware] Add RF_FUNC_ID for exposing device and related version information
|
||||
* add driver implementations for RF_AT_FUNCID_FW_INFO & RF_AT_FUNCID_DRV_INFO
|
||||
* to expose version information
|
||||
*
|
||||
* 08 04 2010 cp.wu
|
||||
* NULL
|
||||
* add an extra parameter to rftestQueryATInfo 'cause it's necessary to pass u4FuncData for query request.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 04 14 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* information buffer for query oid/ioctl is now buffered in prCmdInfo
|
||||
* * * * instead of glue-layer variable to improve multiple oid/ioctl capability
|
||||
*
|
||||
* 12 30 2009 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* 1) According to CMD/EVENT documentation v0.8,
|
||||
* * * * * * * OID_CUSTOM_TEST_RX_STATUS & OID_CUSTOM_TEST_TX_STATUS is no longer used,
|
||||
* * * * * * * and result is retrieved by get ATInfo instead
|
||||
* * * * * * * 2) add 4 counter for recording aggregation statistics
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-12-08 17:35:11 GMT mtk02752
|
||||
** * comment out RF test which is not supported on MT6620
|
||||
** + API decalre for rftest
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\1 2009-12-08 11:29:07 GMT mtk02752
|
||||
** definitions for RF test mode
|
||||
**
|
||||
*/
|
||||
#ifndef _RFTEST_H
|
||||
#define _RFTEST_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
// Table Version
|
||||
#define RF_AUTO_TEST_FUNCTION_TABLE_VERSION 0x01000001
|
||||
|
||||
// Power
|
||||
#define RF_AT_PARAM_POWER_MASK BITS(0,7)
|
||||
#define RF_AT_PARAM_POWER_MAX RF_AT_PARAM_POWER_MASK
|
||||
|
||||
// Rate
|
||||
#define RF_AT_PARAM_RATE_MCS_MASK BIT(31)
|
||||
#define RF_AT_PARAM_RATE_MASK BITS(0,7)
|
||||
#define RF_AT_PARAM_RATE_CCK_MAX 3
|
||||
#define RF_AT_PARAM_RATE_1M 0
|
||||
#define RF_AT_PARAM_RATE_2M 1
|
||||
#define RF_AT_PARAM_RATE_5_5M 2
|
||||
#define RF_AT_PARAM_RATE_11M 3
|
||||
#define RF_AT_PARAM_RATE_6M 4
|
||||
#define RF_AT_PARAM_RATE_9M 5
|
||||
#define RF_AT_PARAM_RATE_12M 6
|
||||
#define RF_AT_PARAM_RATE_18M 7
|
||||
#define RF_AT_PARAM_RATE_24M 8
|
||||
#define RF_AT_PARAM_RATE_36M 9
|
||||
#define RF_AT_PARAM_RATE_48M 10
|
||||
#define RF_AT_PARAM_RATE_54M 11
|
||||
|
||||
// Antenna
|
||||
#define RF_AT_PARAM_ANTENNA_ID_MASK BITS(0,7)
|
||||
#define RF_AT_PARAM_ANTENNA_ID_MAX 1
|
||||
|
||||
// Packet Length
|
||||
#define RF_AT_PARAM_TX_80211HDR_BYTE_MAX (32)
|
||||
#define RF_AT_PARAM_TX_80211PAYLOAD_BYTE_MAX (2048)
|
||||
|
||||
#define RF_AT_PARAM_TX_PKTLEN_BYTE_DEFAULT 1024
|
||||
#define RF_AT_PARAM_TX_PKTLEN_BYTE_MAX \
|
||||
((UINT_16)(RF_AT_PARAM_TX_80211HDR_BYTE_MAX + RF_AT_PARAM_TX_80211PAYLOAD_BYTE_MAX ))
|
||||
|
||||
// Packet Count
|
||||
#define RF_AT_PARAM_TX_PKTCNT_DEFAULT 1000
|
||||
#define RF_AT_PARAM_TX_PKTCNT_UNLIMITED 0
|
||||
|
||||
// Packet Interval
|
||||
#define RF_AT_PARAM_TX_PKT_INTERVAL_US_DEFAULT 50
|
||||
|
||||
// ALC
|
||||
#define RF_AT_PARAM_ALC_DISABLE 0
|
||||
#define RF_AT_PARAM_ALC_ENABLE 1
|
||||
|
||||
// TXOP
|
||||
#define RF_AT_PARAM_TXOP_DEFAULT 0
|
||||
#define RF_AT_PARAM_TXOPQUE_QMASK BITS(16,31)
|
||||
#define RF_AT_PARAM_TXOPQUE_TMASK BITS(0,15)
|
||||
#define RF_AT_PARAM_TXOPQUE_AC0 (0<<16)
|
||||
#define RF_AT_PARAM_TXOPQUE_AC1 (1<<16)
|
||||
#define RF_AT_PARAM_TXOPQUE_AC2 (2<<16)
|
||||
#define RF_AT_PARAM_TXOPQUE_AC3 (3<<16)
|
||||
#define RF_AT_PARAM_TXOPQUE_AC4 (4<<16)
|
||||
#define RF_AT_PARAM_TXOPQUE_QOFFSET 16
|
||||
|
||||
// Retry Limit
|
||||
#define RF_AT_PARAM_TX_RETRY_DEFAULT 0
|
||||
#define RF_AT_PARAM_TX_RETRY_MAX 6
|
||||
|
||||
// QoS Queue
|
||||
#define RF_AT_PARAM_QOSQUE_AC0 0
|
||||
#define RF_AT_PARAM_QOSQUE_AC1 1
|
||||
#define RF_AT_PARAM_QOSQUE_AC2 2
|
||||
#define RF_AT_PARAM_QOSQUE_AC3 3
|
||||
#define RF_AT_PARAM_QOSQUE_AC4 4
|
||||
#define RF_AT_PARAM_QOSQUE_DEFAULT RF_AT_PARAM_QOSQUE_AC0
|
||||
|
||||
// Bandwidth
|
||||
#define RF_AT_PARAM_BANDWIDTH_20MHZ 0
|
||||
#define RF_AT_PARAM_BANDWIDTH_40MHZ 1
|
||||
#define RF_AT_PARAM_BANDWIDTH_U20_IN_40MHZ 2
|
||||
#define RF_AT_PARAM_BANDWIDTH_D20_IN_40MHZ 3
|
||||
#define RF_AT_PARAM_BANDWIDTH_DEFAULT RF_AT_PARAM_BANDWIDTH_20MHZ
|
||||
|
||||
// GI (Guard Interval)
|
||||
#define RF_AT_PARAM_GI_800NS 0
|
||||
#define RF_AT_PARAM_GI_400NS 1
|
||||
#define RF_AT_PARAM_GI_DEFAULT RF_AT_PARAM_GI_800NS
|
||||
|
||||
// STBC
|
||||
#define RF_AT_PARAM_STBC_DISABLE 0
|
||||
#define RF_AT_PARAM_STBC_ENABLE 1
|
||||
|
||||
// RIFS
|
||||
#define RF_AT_PARAM_RIFS_DISABLE 0
|
||||
#define RF_AT_PARAM_RIFS_ENABLE 1
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
// Function ID List
|
||||
typedef enum _ENUM_RF_AT_FUNCID_T {
|
||||
RF_AT_FUNCID_VERSION = 0,
|
||||
RF_AT_FUNCID_COMMAND,
|
||||
RF_AT_FUNCID_POWER,
|
||||
RF_AT_FUNCID_RATE,
|
||||
RF_AT_FUNCID_PREAMBLE,
|
||||
RF_AT_FUNCID_ANTENNA,
|
||||
RF_AT_FUNCID_PKTLEN,
|
||||
RF_AT_FUNCID_PKTCNT,
|
||||
RF_AT_FUNCID_PKTINTERVAL,
|
||||
RF_AT_FUNCID_TEMP_COMPEN,
|
||||
RF_AT_FUNCID_TXOPLIMIT,
|
||||
RF_AT_FUNCID_ACKPOLICY,
|
||||
RF_AT_FUNCID_PKTCONTENT,
|
||||
RF_AT_FUNCID_RETRYLIMIT,
|
||||
RF_AT_FUNCID_QUEUE,
|
||||
RF_AT_FUNCID_BANDWIDTH,
|
||||
RF_AT_FUNCID_GI,
|
||||
RF_AT_FUNCID_STBC,
|
||||
RF_AT_FUNCID_CHNL_FREQ,
|
||||
RF_AT_FUNCID_RIFS,
|
||||
RF_AT_FUNCID_TRSW_TYPE,
|
||||
RF_AT_FUNCID_RF_SX_SHUTDOWN,
|
||||
RF_AT_FUNCID_PLL_SHUTDOWN,
|
||||
RF_AT_FUNCID_SLOW_CLK_MODE,
|
||||
RF_AT_FUNCID_ADC_CLK_MODE,
|
||||
RF_AT_FUNCID_MEASURE_MODE,
|
||||
RF_AT_FUNCID_VOLT_COMPEN,
|
||||
RF_AT_FUNCID_DPD_TX_GAIN,
|
||||
RF_AT_FUNCID_DPD_MODE,
|
||||
RF_AT_FUNCID_TSSI_MODE,
|
||||
RF_AT_FUNCID_TX_GAIN_CODE,
|
||||
RF_AT_FUNCID_TX_PWR_MODE,
|
||||
|
||||
/* Query command */
|
||||
RF_AT_FUNCID_TXED_COUNT = 32,
|
||||
RF_AT_FUNCID_TXOK_COUNT,
|
||||
RF_AT_FUNCID_RXOK_COUNT,
|
||||
RF_AT_FUNCID_RXERROR_COUNT,
|
||||
RF_AT_FUNCID_RESULT_INFO,
|
||||
RF_AT_FUNCID_TRX_IQ_RESULT,
|
||||
RF_AT_FUNCID_TSSI_RESULT,
|
||||
RF_AT_FUNCID_DPD_RESULT,
|
||||
RF_AT_FUNCID_RXV_DUMP,
|
||||
RF_AT_FUNCID_RX_PHY_STATIS,
|
||||
RF_AT_FUNCID_MEASURE_RESULT,
|
||||
RF_AT_FUNCID_TEMP_SENSOR,
|
||||
RF_AT_FUNCID_VOLT_SENSOR,
|
||||
RF_AT_FUNCID_READ_EFUSE,
|
||||
RF_AT_FUNCID_RX_RSSI,
|
||||
RF_AT_FUNCID_FW_INFO,
|
||||
RF_AT_FUNCID_DRV_INFO,
|
||||
|
||||
/* Set command */
|
||||
RF_AT_FUNCID_SET_DPD_RESULT = 64,
|
||||
RF_AT_FUNCID_SET_CW_MODE,
|
||||
RF_AT_FUNCID_SET_JAPAN_CH14_FILTER,
|
||||
RF_AT_FUNCID_WRITE_EFUSE,
|
||||
RF_AT_FUNCID_SET_MAC_ADDRESS
|
||||
|
||||
} ENUM_RF_AT_FUNCID_T;
|
||||
|
||||
// Command
|
||||
typedef enum _ENUM_RF_AT_COMMAND_T {
|
||||
RF_AT_COMMAND_STOPTEST = 0,
|
||||
RF_AT_COMMAND_STARTTX,
|
||||
RF_AT_COMMAND_STARTRX,
|
||||
RF_AT_COMMAND_RESET,
|
||||
RF_AT_COMMAND_OUTPUT_POWER, /* Payload */
|
||||
RF_AT_COMMAND_LO_LEAKAGE, /* Local freq is renamed to Local leakage */
|
||||
RF_AT_COMMAND_CARRIER_SUPPR, /* OFDM (LTF/STF), CCK (PI,PI/2) */
|
||||
RF_AT_COMMAND_TRX_IQ_CAL,
|
||||
RF_AT_COMMAND_TSSI_CAL,
|
||||
RF_AT_COMMAND_DPD_CAL,
|
||||
RF_AT_COMMAND_CW,
|
||||
RF_AT_COMMAND_NUM
|
||||
} ENUM_RF_AT_COMMAND_T;
|
||||
|
||||
// Preamble
|
||||
typedef enum _ENUM_RF_AT_PREAMBLE_T {
|
||||
RF_AT_PREAMBLE_NORMAL = 0,
|
||||
RF_AT_PREAMBLE_CCK_SHORT,
|
||||
RF_AT_PREAMBLE_11N_MM,
|
||||
RF_AT_PREAMBLE_11N_GF,
|
||||
RF_AT_PREAMBLE_NUM
|
||||
} ENUM_RF_AT_PREAMBLE_T;
|
||||
|
||||
// Ack Policy
|
||||
typedef enum _ENUM_RF_AT_ACK_POLICY_T {
|
||||
RF_AT_ACK_POLICY_NORMAL = 0,
|
||||
RF_AT_ACK_POLICY_NOACK,
|
||||
RF_AT_ACK_POLICY_NOEXPLICTACK,
|
||||
RF_AT_ACK_POLICY_BLOCKACK,
|
||||
RF_AT_ACK_POLICY_NUM
|
||||
} ENUM_RF_AT_ACK_POLICY_T;
|
||||
|
||||
typedef enum _ENUM_RF_AUTOTEST_STATE_T {
|
||||
RF_AUTOTEST_STATE_STANDBY = 0,
|
||||
RF_AUTOTEST_STATE_TX,
|
||||
RF_AUTOTEST_STATE_RX,
|
||||
RF_AUTOTEST_STATE_RESET,
|
||||
RF_AUTOTEST_STATE_OUTPUT_POWER,
|
||||
RF_AUTOTEST_STATE_LOCA_FREQUENCY,
|
||||
RF_AUTOTEST_STATE_CARRIER_SUPRRESION,
|
||||
RF_AUTOTEST_STATE_NUM
|
||||
} ENUM_RF_AUTOTEST_STATE_T;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
WLAN_STATUS
|
||||
rftestSetATInfo(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_32 u4FuncIndex,
|
||||
UINT_32 u4FuncData
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
rftestQueryATInfo(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_32 u4FuncIndex,
|
||||
UINT_32 u4FuncData,
|
||||
OUT PVOID pvQueryBuffer,
|
||||
IN UINT_32 u4QueryBufferLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
rftestSetFrequency(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4FreqInKHz,
|
||||
IN PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
#endif /* _RFTEST_H */
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,239 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/typedef.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file typedef.h
|
||||
\brief Declaration of data type and return values of internal protocol stack.
|
||||
|
||||
In this file we declare the data type and return values which will be exported
|
||||
to the GLUE Layer.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: typedef.h $
|
||||
*
|
||||
* 07 18 2011 chinghwa.yu
|
||||
* [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000612] [MT6620 Wi-Fi] [FW] CSD update SWRDD algorithm
|
||||
* Add CMD/Event for RDD and BWCS.
|
||||
*
|
||||
* 12 30 2010 cp.wu
|
||||
* [WCXRP00000327] [MT6620 Wi-Fi][Driver] Improve HEC WHQA 6972 workaround coverage in driver side
|
||||
* host driver not to set FW-own when there is still pending interrupts
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 08 16 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine AAA functions
|
||||
*
|
||||
* 07 19 2010 jeffrey.chang
|
||||
*
|
||||
* Linux port modification
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 23 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* integrate .
|
||||
*
|
||||
* 06 18 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Provide cnmMgtPktAlloc() and alloc/free function of msg/buf
|
||||
*
|
||||
* 06 11 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* 1) migrate assoc.c.
|
||||
* 2) add ucTxSeqNum for tracking frames which needs TX-DONE awareness
|
||||
* 3) add configuration options for CNM_MEM and RSN modules
|
||||
* 4) add data path for management frames
|
||||
* 5) eliminate rPacketInfo of MSDU_INFO_T
|
||||
*
|
||||
* 06 09 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add necessary changes to driver data paths.
|
||||
*
|
||||
* 06 09 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add definitions for module migration.
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 06 03 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* move timer callback to glue layer.
|
||||
*
|
||||
* 05 31 2010 cp.wu
|
||||
* [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
|
||||
* add cfg80211 interface, which is to replace WE, for further extension
|
||||
*
|
||||
* 03 24 2010 jeffrey.chang
|
||||
* [WPD00003826]Initial import for Linux port
|
||||
* initial import for Linux port
|
||||
*
|
||||
* 02 24 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* add Ethernet destination address information in packet info for TX
|
||||
*
|
||||
* 02 23 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* add new API: wlanProcessQueuedPackets()
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\6 2009-03-23 21:41:37 GMT mtk01461
|
||||
** Update PACKET_INFO_INIT for TX Path
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\5 2009-03-23 00:30:17 GMT mtk01461
|
||||
** Add parameter in PACKET_INFO_T for HIF Loopback
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\4 2009-03-18 20:25:22 GMT mtk01461
|
||||
** Fix LINT warning
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\3 2009-03-16 09:08:28 GMT mtk01461
|
||||
** Update TX PATH API
|
||||
** \main\maintrunk.MT6620WiFiDriver_Prj\2 2009-03-10 20:11:54 GMT mtk01426
|
||||
** Init for develop
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _TYPEDEF_H
|
||||
#define _TYPEDEF_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/* ieee80211.h of linux has duplicated definitions */
|
||||
#if defined(WLAN_STATUS_SUCCESS)
|
||||
#undef WLAN_STATUS_SUCCESS
|
||||
#endif
|
||||
|
||||
#define WLAN_STATUS_SUCCESS ((WLAN_STATUS) 0x00000000L)
|
||||
#define WLAN_STATUS_PENDING ((WLAN_STATUS) 0x00000103L)
|
||||
#define WLAN_STATUS_NOT_ACCEPTED ((WLAN_STATUS) 0x00010003L)
|
||||
|
||||
#define WLAN_STATUS_MEDIA_CONNECT ((WLAN_STATUS) 0x4001000BL)
|
||||
#define WLAN_STATUS_MEDIA_DISCONNECT ((WLAN_STATUS) 0x4001000CL)
|
||||
#define WLAN_STATUS_MEDIA_SPECIFIC_INDICATION ((WLAN_STATUS) 0x40010012L)
|
||||
|
||||
#define WLAN_STATUS_SCAN_COMPLETE ((WLAN_STATUS) 0x60010001L)
|
||||
#define WLAN_STATUS_MSDU_OK ((WLAN_STATUS) 0x60010002L)
|
||||
|
||||
/* TODO(Kevin): double check if 0x60010001 & 0x60010002 is proprietary */
|
||||
#define WLAN_STATUS_ROAM_OUT_FIND_BEST ((WLAN_STATUS) 0x60010101L)
|
||||
#define WLAN_STATUS_ROAM_DISCOVERY ((WLAN_STATUS) 0x60010102L)
|
||||
|
||||
#define WLAN_STATUS_FAILURE ((WLAN_STATUS) 0xC0000001L)
|
||||
#define WLAN_STATUS_RESOURCES ((WLAN_STATUS) 0xC000009AL)
|
||||
#define WLAN_STATUS_NOT_SUPPORTED ((WLAN_STATUS) 0xC00000BBL)
|
||||
|
||||
#define WLAN_STATUS_MULTICAST_FULL ((WLAN_STATUS) 0xC0010009L)
|
||||
#define WLAN_STATUS_INVALID_PACKET ((WLAN_STATUS) 0xC001000FL)
|
||||
#define WLAN_STATUS_ADAPTER_NOT_READY ((WLAN_STATUS) 0xC0010011L)
|
||||
#define WLAN_STATUS_NOT_INDICATING ((WLAN_STATUS) 0xC0010013L)
|
||||
#define WLAN_STATUS_INVALID_LENGTH ((WLAN_STATUS) 0xC0010014L)
|
||||
#define WLAN_STATUS_INVALID_DATA ((WLAN_STATUS) 0xC0010015L)
|
||||
#define WLAN_STATUS_BUFFER_TOO_SHORT ((WLAN_STATUS) 0xC0010016L)
|
||||
|
||||
#define WLAN_STATUS_BWCS_UPDATE ((WLAN_STATUS) 0xC0010017L)
|
||||
|
||||
#define WLAN_STATUS_CONNECT_INDICATION ((WLAN_STATUS) 0xC0010018L)
|
||||
|
||||
|
||||
/* NIC status flags */
|
||||
#define ADAPTER_FLAG_HW_ERR 0x00400000
|
||||
|
||||
/* Type Length */
|
||||
#define TL_IPV4 0x0008
|
||||
#define TL_IPV6 0xDD86
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* Type definition for GLUE_INFO structure */
|
||||
typedef struct _GLUE_INFO_T GLUE_INFO_T, *P_GLUE_INFO_T;
|
||||
|
||||
/* Type definition for WLAN STATUS */
|
||||
typedef UINT_32 WLAN_STATUS, *P_WLAN_STATUS;
|
||||
|
||||
/* Type definition for ADAPTER structure */
|
||||
typedef struct _ADAPTER_T ADAPTER_T, *P_ADAPTER_T;
|
||||
|
||||
/* Type definition for MESSAGE HEADER structure */
|
||||
typedef struct _MSG_HDR_T MSG_HDR_T, *P_MSG_HDR_T;
|
||||
|
||||
/* Type definition for Pointer to OS Native Packet */
|
||||
typedef void *P_NATIVE_PACKET;
|
||||
|
||||
/* Type definition for STA_RECORD_T structure to handle the connectivity and packet reception
|
||||
* for a particular STA.
|
||||
*/
|
||||
typedef struct _STA_RECORD_T STA_RECORD_T, *P_STA_RECORD_T, **PP_STA_RECORD_T;
|
||||
|
||||
/* CMD_INFO_T is used by Glue Layer to send a cluster of Command(OID) information to
|
||||
* the TX Path to reduce the parameters of a function call.
|
||||
*/
|
||||
typedef struct _CMD_INFO_T CMD_INFO_T, *P_CMD_INFO_T;
|
||||
|
||||
/* Following typedef should be removed later, because Glue Layer should not
|
||||
* be aware of following data type.
|
||||
*/
|
||||
typedef struct _SW_RFB_T SW_RFB_T, *P_SW_RFB_T, **PP_SW_RFB_T;
|
||||
|
||||
typedef struct _MSDU_INFO_T MSDU_INFO_T, *P_MSDU_INFO_T;
|
||||
|
||||
typedef struct _REG_ENTRY_T REG_ENTRY_T, *P_REG_ENTRY_T;
|
||||
|
||||
/* IST handler definition */
|
||||
typedef VOID (*IST_EVENT_FUNCTION)(P_ADAPTER_T);
|
||||
|
||||
/* Type definition for function pointer of timer handler */
|
||||
typedef VOID (*PFN_TIMER_CALLBACK)(IN P_GLUE_INFO_T);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
#endif /* _TYPEDEF_H */
|
||||
|
||||
|
||||
|
|
@ -1,547 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/wlan_bow.h#1 $
|
||||
*/
|
||||
|
||||
/*! \file "wlan_bow.h"
|
||||
\brief This file contains the declairations of 802.11 PAL
|
||||
command processing routines for
|
||||
MediaTek Inc. 802.11 Wireless LAN Adapters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: wlan_bow.h $
|
||||
*
|
||||
* 05 25 2011 terry.wu
|
||||
* [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment
|
||||
* Add BoW Cancel Scan Request and Turn On deactive network function.
|
||||
*
|
||||
* 05 23 2011 terry.wu
|
||||
* [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment
|
||||
* Add some BoW error handling.
|
||||
*
|
||||
* 05 21 2011 terry.wu
|
||||
* [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment
|
||||
* Protect BoW connection establishment.
|
||||
*
|
||||
* 05 17 2011 terry.wu
|
||||
* [WCXRP00000730] [MT6620 Wi-Fi][BoW] Send deauth while disconnecting
|
||||
* Send deauth while disconnecting BoW link.
|
||||
*
|
||||
* 05 06 2011 terry.wu
|
||||
* [WCXRP00000707] [MT6620 Wi-Fi][Driver] Fix BoW Multiple Physical Link connect/disconnect issue
|
||||
* Fix BoW Multiple Physical Link connect/disconnect issue.
|
||||
*
|
||||
* 04 15 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Add BOW short range mode.
|
||||
*
|
||||
* 03 27 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Support multiple physical link.
|
||||
*
|
||||
* 03 10 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Add BOW table.
|
||||
*
|
||||
* 02 16 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Add bowNotifyAllLinkDisconnected interface and change channel grant procedure for bow starting..
|
||||
*
|
||||
* 02 15 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Update bowString and channel grant.
|
||||
*
|
||||
* 01 11 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Update BOW Activity Report structure and bug fix.
|
||||
*
|
||||
* 09 27 2010 chinghwa.yu
|
||||
* [WCXRP00000063] Update BCM CoEx design and settings[WCXRP00000065] Update BoW design and settings
|
||||
* Update BCM/BoW design and settings.
|
||||
*
|
||||
* 09 14 2010 chinghwa.yu
|
||||
* NULL
|
||||
* Add bowRunEventAAAComplete.
|
||||
*
|
||||
* 08 24 2010 chinghwa.yu
|
||||
* NULL
|
||||
* Update BOW for the 1st time.
|
||||
*
|
||||
* 07 30 2010 cp.wu
|
||||
* NULL
|
||||
* 1) BoW wrapper: use definitions instead of hard-coded constant for error code
|
||||
* 2) AIS-FSM: eliminate use of desired RF parameters, use prTargetBssDesc instead
|
||||
* 3) add handling for RX_PKT_DESTINATION_HOST_WITH_FORWARD for GO-broadcast frames
|
||||
*
|
||||
* 07 15 2010 cp.wu
|
||||
*
|
||||
* sync. bluetooth-over-Wi-Fi interface to driver interface document v0.2.6.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 05 17 2010 cp.wu
|
||||
* [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
|
||||
* 1) add timeout handler mechanism for pending command packets
|
||||
* 2) add p2p add/removal key
|
||||
*
|
||||
* 05 13 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* 1) all BT physical handles shares the same RSSI/Link Quality.
|
||||
* 2) simplify BT command composing
|
||||
*
|
||||
* 04 28 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* change prefix for data structure used to communicate with 802.11 PAL
|
||||
* to avoid ambiguous naming with firmware interface
|
||||
*
|
||||
* 04 27 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* add multiple physical link support
|
||||
*
|
||||
* 04 13 2010 cp.wu
|
||||
* [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
|
||||
* add framework for BT-over-Wi-Fi support.
|
||||
* * * * * * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability
|
||||
* * * * * * * * * * * * 2) command sequence number is now increased atomically
|
||||
* * * * * * * * * * * * 3) private data could be hold and taken use for other purpose
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_BOW_H
|
||||
#define _WLAN_BOW_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "nic/bow.h"
|
||||
#include "nic/cmd_buf.h"
|
||||
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
#define BOWCMD_STATUS_SUCCESS 0
|
||||
#define BOWCMD_STATUS_FAILURE 1
|
||||
#define BOWCMD_STATUS_UNACCEPTED 2
|
||||
#define BOWCMD_STATUS_INVALID 3
|
||||
#define BOWCMD_STATUS_TIMEOUT 4
|
||||
|
||||
#define BOW_WILDCARD_SSID "AMP"
|
||||
#define BOW_WILDCARD_SSID_LEN 3
|
||||
#define BOW_SSID_LEN 21
|
||||
|
||||
/* 0: query, 1: setup, 2: destroy */
|
||||
#define BOW_QUERY_CMD 0
|
||||
#define BOW_SETUP_CMD 1
|
||||
#define BOW_DESTROY_CMD 2
|
||||
|
||||
#define BOW_INITIATOR 0
|
||||
#define BOW_RESPONDER 1
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
typedef struct _BOW_TABLE_T {
|
||||
UINT_8 ucAcquireID;
|
||||
BOOLEAN fgIsValid;
|
||||
ENUM_BOW_DEVICE_STATE eState;
|
||||
UINT_8 aucPeerAddress[6];
|
||||
//UINT_8 ucRole;
|
||||
//UINT_8 ucChannelNum;
|
||||
UINT_16 u2Reserved;
|
||||
} BOW_TABLE_T, *P_BOW_TABLE_T;
|
||||
|
||||
typedef WLAN_STATUS (*PFN_BOW_CMD_HANDLE)(P_ADAPTER_T, P_AMPC_COMMAND);
|
||||
|
||||
typedef struct _BOW_CMD_T {
|
||||
UINT_8 uCmdID;
|
||||
PFN_BOW_CMD_HANDLE pfCmdHandle;
|
||||
} BOW_CMD_T, *P_BOW_CMD_T;
|
||||
|
||||
typedef struct _BOW_EVENT_ACTIVITY_REPORT_T {
|
||||
UINT_8 ucReason;
|
||||
UINT_8 aucReserved;
|
||||
UINT_8 aucPeerAddress[6];
|
||||
} BOW_EVENT_ACTIVITY_REPORT_T, *P_BOW_EVENT_ACTIVITY_REPORT_T;
|
||||
|
||||
/*
|
||||
ucReason: 0: success
|
||||
1: general failure
|
||||
2: too much time (> 2/3 second totally) requested for scheduling.
|
||||
Others: reserved.
|
||||
*/
|
||||
|
||||
typedef struct _BOW_EVENT_SYNC_TSF_T {
|
||||
UINT_64 u4TsfTime;
|
||||
UINT_32 u4TsfSysTime;
|
||||
UINT_32 u4ScoTime;
|
||||
UINT_32 u4ScoSysTime;
|
||||
} BOW_EVENT_SYNC_TSF_T, *P_BOW_EVENT_SYNC_TSF_T;
|
||||
|
||||
typedef struct _BOW_ACTIVITY_REPORT_BODY_T {
|
||||
UINT_32 u4StartTime;
|
||||
UINT_32 u4Duration;
|
||||
UINT_32 u4Periodicity;
|
||||
} BOW_ACTIVITY_REPORT_BODY_T, *P_BOW_ACTIVITY_REPORT_BODY_T;
|
||||
|
||||
typedef struct _BOW_ACTIVITY_REPORT_T {
|
||||
UINT_8 aucPeerAddress[6];
|
||||
UINT_8 ucScheduleKnown;
|
||||
UINT_8 ucNumReports;
|
||||
BOW_ACTIVITY_REPORT_BODY_T arBowActivityReportBody[MAX_ACTIVITY_REPORT];
|
||||
} BOW_ACTIVITY_REPORT_T, *P_BOW_ACTIVITY_REPORT_T;
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*--------------------------------------------------------------*/
|
||||
/* Firmware Command Packer */
|
||||
/*--------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
wlanoidSendSetQueryBowCmd (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_8 ucCID,
|
||||
BOOLEAN fgSetQuery,
|
||||
BOOLEAN fgNeedResp,
|
||||
PFN_CMD_DONE_HANDLER pfCmdDoneHandler,
|
||||
PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler,
|
||||
UINT_32 u4SetQueryInfoLen,
|
||||
PUINT_8 pucInfoBuffer,
|
||||
IN UINT_8 ucSeqNumber
|
||||
);
|
||||
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
/* Command Dispatcher */
|
||||
/*--------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
wlanbowHandleCommand(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_AMPC_COMMAND prCmd
|
||||
);
|
||||
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
/* Routines to handle command */
|
||||
/*--------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
bowCmdGetMacStatus(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_AMPC_COMMAND prCmd
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bowCmdSetupConnection(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_AMPC_COMMAND prCmd
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bowCmdDestroyConnection(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_AMPC_COMMAND prCmd
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bowCmdSetPTK(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_AMPC_COMMAND prCmd
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bowCmdReadRSSI(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_AMPC_COMMAND prCmd
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bowCmdReadLinkQuality(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_AMPC_COMMAND prCmd
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bowCmdShortRangeMode(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_AMPC_COMMAND prCmd
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bowCmdGetChannelList(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_AMPC_COMMAND prCmd
|
||||
);
|
||||
|
||||
VOID
|
||||
wlanbowCmdEventSetStatus(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_AMPC_COMMAND prCmd,
|
||||
IN UINT_8 ucEventBuf
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
/* Callbacks for event indication */
|
||||
/*--------------------------------------------------------------*/
|
||||
VOID
|
||||
wlanbowCmdEventSetCommon (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo,
|
||||
IN PUINT_8 pucEventBuf
|
||||
);
|
||||
|
||||
VOID
|
||||
wlanbowCmdEventLinkConnected (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo,
|
||||
IN PUINT_8 pucEventBuf
|
||||
);
|
||||
|
||||
VOID
|
||||
wlanbowCmdEventLinkDisconnected (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo,
|
||||
IN PUINT_8 pucEventBuf
|
||||
);
|
||||
|
||||
VOID
|
||||
wlanbowCmdEventSetSetupConnection (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo,
|
||||
IN PUINT_8 pucEventBuf
|
||||
);
|
||||
|
||||
VOID
|
||||
wlanbowCmdEventReadLinkQuality (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo,
|
||||
IN PUINT_8 pucEventBuf
|
||||
);
|
||||
|
||||
VOID
|
||||
wlanbowCmdEventReadRssi (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo,
|
||||
IN PUINT_8 pucEventBuf
|
||||
);
|
||||
|
||||
VOID
|
||||
wlanbowCmdTimeoutHandler (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_CMD_INFO_T prCmdInfo
|
||||
);
|
||||
|
||||
VOID
|
||||
bowStopping(
|
||||
IN P_ADAPTER_T prAdapter);
|
||||
|
||||
VOID
|
||||
bowStarting (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
bowAssignSsid (
|
||||
IN PUINT_8 pucSsid,
|
||||
IN PUINT_8 pucSsidLen
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
bowValidateProbeReq (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
OUT PUINT_32 pu4ControlFlags
|
||||
);
|
||||
|
||||
VOID
|
||||
bowSendBeacon(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
UINT_32 u4Param
|
||||
);
|
||||
|
||||
VOID
|
||||
bowResponderScan(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
bowResponderScanDone(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
bowResponderCancelScan (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsChannelExtention
|
||||
);
|
||||
|
||||
VOID
|
||||
bowResponderJoin(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
P_BSS_DESC_T prBssDesc
|
||||
);
|
||||
|
||||
VOID
|
||||
bowFsmRunEventJoinComplete(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
bowIndicationOfMediaStateToHost(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
ENUM_PARAM_MEDIA_STATE_T eConnectionState,
|
||||
BOOLEAN fgDelayIndication
|
||||
);
|
||||
|
||||
VOID
|
||||
bowRunEventAAATxFail(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bowRunEventAAAComplete(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
bowRunEventRxDeAuth (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
);
|
||||
|
||||
VOID
|
||||
bowDisconnectLink (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN ENUM_TX_RESULT_CODE_T rTxDoneStatus
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
bowValidateAssocReq(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
OUT PUINT_16 pu2StatusCode
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
bowValidateAuth(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN PP_STA_RECORD_T pprStaRec,
|
||||
OUT PUINT_16 pu2StatusCode
|
||||
);
|
||||
|
||||
VOID
|
||||
bowRunEventChGrant (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
);
|
||||
|
||||
VOID
|
||||
bowRequestCh (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
bowReleaseCh (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
VOID
|
||||
bowChGrantedTimeout(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_32 u4Param
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
bowNotifyAllLinkDisconnected (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
bowCheckBowTableIfVaild(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucPeerAddress[6]
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
bowGetBowTableContent(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucBowTableIdx,
|
||||
OUT P_BOW_TABLE_T prBowTable
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
bowGetBowTableEntryByPeerAddress(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucPeerAddress[6],
|
||||
OUT PUINT_8 pucBowTableIdx
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
bowGetBowTableFreeEntry(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
OUT PUINT_8 pucBowTableIdx
|
||||
);
|
||||
|
||||
ENUM_BOW_DEVICE_STATE
|
||||
bowGetBowTableState(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucPeerAddress[6]
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
bowSetBowTableState(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucPeerAddress[6],
|
||||
IN ENUM_BOW_DEVICE_STATE eState
|
||||
);
|
||||
|
||||
|
||||
BOOLEAN
|
||||
bowSetBowTableContent(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucBowTableIdx,
|
||||
IN P_BOW_TABLE_T prBowTable
|
||||
);
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif
|
||||
#endif /* _WLAN_BOW_H */
|
||||
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,469 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/include/wlan_p2p.h#3 $
|
||||
*/
|
||||
|
||||
/*! \file "wlan_p2p.h"
|
||||
\brief This file contains the declairations of Wi-Fi Direct command
|
||||
processing routines for MediaTek Inc. 802.11 Wireless LAN Adapters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: wlan_p2p.h $
|
||||
*
|
||||
* 07 17 2012 yuche.tsai
|
||||
* NULL
|
||||
* Compile no error before trial run.
|
||||
*
|
||||
* 11 19 2011 yuche.tsai
|
||||
* NULL
|
||||
* Add RSSI support for P2P network.
|
||||
*
|
||||
* 11 08 2011 yuche.tsai
|
||||
* [WCXRP00001094] [Volunteer Patch][Driver] Driver version & supplicant version query & set support for service discovery version check.
|
||||
* Add support for driver version query & p2p supplicant verseion set.
|
||||
* For new service discovery mechanism sync.
|
||||
*
|
||||
* 10 18 2011 yuche.tsai
|
||||
* [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch.
|
||||
* Support Channle Query.
|
||||
*
|
||||
* 10 18 2011 yuche.tsai
|
||||
* [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch.
|
||||
* New 2.1 branch
|
||||
|
||||
*
|
||||
* 04 27 2011 george.huang
|
||||
* [WCXRP00000684] [MT6620 Wi-Fi][Driver] Support P2P setting ARP filter
|
||||
* Support P2P ARP filter setting on early suspend/ late resume
|
||||
*
|
||||
* 04 08 2011 george.huang
|
||||
* [WCXRP00000621] [MT6620 Wi-Fi][Driver] Support P2P supplicant to set power mode
|
||||
* separate settings of P2P and AIS
|
||||
*
|
||||
* 03 22 2011 george.huang
|
||||
* [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command
|
||||
* link with supplicant commands
|
||||
*
|
||||
* 03 07 2011 wh.su
|
||||
* [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code
|
||||
* rename the define to anti_pviracy.
|
||||
*
|
||||
* 03 02 2011 wh.su
|
||||
* [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code
|
||||
* Add Security check related code.
|
||||
*
|
||||
* 01 05 2011 cp.wu
|
||||
* [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery
|
||||
* ioctl implementations for P2P Service Discovery
|
||||
*
|
||||
* 12 22 2010 cp.wu
|
||||
* [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery
|
||||
* 1. header file restructure for more clear module isolation
|
||||
* 2. add function interface definition for implementing Service Discovery callbacks
|
||||
*
|
||||
* 09 21 2010 kevin.huang
|
||||
* [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface
|
||||
* Isolate P2P related function for Hardware Software Bundle
|
||||
*
|
||||
* 08 16 2010 cp.wu
|
||||
* NULL
|
||||
* add subroutines for P2P to set multicast list.
|
||||
*
|
||||
* 08 16 2010 george.huang
|
||||
* NULL
|
||||
* support wlanoidSetP2pPowerSaveProfile() in P2P
|
||||
*
|
||||
* 08 16 2010 george.huang
|
||||
* NULL
|
||||
* Support wlanoidSetNetworkAddress() for P2P
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 06 2010 kevin.huang
|
||||
* [WPD00003832][MT6620 5931] Create driver base
|
||||
* [MT6620 5931] Create driver base
|
||||
*
|
||||
* 05 17 2010 cp.wu
|
||||
* [WPD00001943]Create WiFi test driver framework on WinXP
|
||||
* MT6620 is not supporting NDIS_PACKET_TYPE_PROMISCUOUS.
|
||||
*
|
||||
|
||||
*
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_P2P_H
|
||||
#define _WLAN_P2P_H
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/* Service Discovery */
|
||||
typedef struct _PARAM_P2P_SEND_SD_RESPONSE {
|
||||
PARAM_MAC_ADDRESS rReceiverAddr;
|
||||
UINT_8 fgNeedTxDoneIndication;
|
||||
UINT_8 ucChannelNum;
|
||||
UINT_16 u2PacketLength;
|
||||
UINT_8 aucPacketContent[0]; /*native 802.11*/
|
||||
} PARAM_P2P_SEND_SD_RESPONSE, *P_PARAM_P2P_SEND_SD_RESPONSE;
|
||||
|
||||
typedef struct _PARAM_P2P_GET_SD_REQUEST {
|
||||
PARAM_MAC_ADDRESS rTransmitterAddr;
|
||||
UINT_16 u2PacketLength;
|
||||
UINT_8 aucPacketContent[0]; /*native 802.11*/
|
||||
} PARAM_P2P_GET_SD_REQUEST, *P_PARAM_P2P_GET_SD_REQUEST;
|
||||
|
||||
typedef struct _PARAM_P2P_GET_SD_REQUEST_EX {
|
||||
PARAM_MAC_ADDRESS rTransmitterAddr;
|
||||
UINT_16 u2PacketLength;
|
||||
UINT_8 ucChannelNum; /* Channel Number Where SD Request is received. */
|
||||
UINT_8 ucSeqNum; /* Get SD Request by sequence number. */
|
||||
UINT_8 aucPacketContent[0]; /*native 802.11*/
|
||||
} PARAM_P2P_GET_SD_REQUEST_EX, *P_PARAM_P2P_GET_SD_REQUEST_EX;
|
||||
|
||||
typedef struct _PARAM_P2P_SEND_SD_REQUEST {
|
||||
PARAM_MAC_ADDRESS rReceiverAddr;
|
||||
UINT_8 fgNeedTxDoneIndication;
|
||||
UINT_8 ucVersionNum; /* Indicate the Service Discovery Supplicant Version. */
|
||||
UINT_16 u2PacketLength;
|
||||
UINT_8 aucPacketContent[0]; /*native 802.11*/
|
||||
} PARAM_P2P_SEND_SD_REQUEST, *P_PARAM_P2P_SEND_SD_REQUEST;
|
||||
|
||||
/* Service Discovery 1.0. */
|
||||
typedef struct _PARAM_P2P_GET_SD_RESPONSE {
|
||||
PARAM_MAC_ADDRESS rTransmitterAddr;
|
||||
UINT_16 u2PacketLength;
|
||||
UINT_8 aucPacketContent[0]; /*native 802.11*/
|
||||
} PARAM_P2P_GET_SD_RESPONSE, *P_PARAM_P2P_GET_SD_RESPONSE;
|
||||
|
||||
/* Service Discovery 2.0. */
|
||||
typedef struct _PARAM_P2P_GET_SD_RESPONSE_EX {
|
||||
PARAM_MAC_ADDRESS rTransmitterAddr;
|
||||
UINT_16 u2PacketLength;
|
||||
UINT_8 ucSeqNum; /* Get SD Response by sequence number. */
|
||||
UINT_8 aucPacketContent[0]; /*native 802.11*/
|
||||
} PARAM_P2P_GET_SD_RESPONSE_EX, *P_PARAM_P2P_GET_SD_RESPONSE_EX;
|
||||
|
||||
|
||||
typedef struct _PARAM_P2P_TERMINATE_SD_PHASE {
|
||||
PARAM_MAC_ADDRESS rPeerAddr;
|
||||
} PARAM_P2P_TERMINATE_SD_PHASE, *P_PARAM_P2P_TERMINATE_SD_PHASE;
|
||||
|
||||
|
||||
/*! \brief Key mapping of BSSID */
|
||||
typedef struct _P2P_PARAM_KEY_T
|
||||
{
|
||||
UINT_32 u4Length; /*!< Length of structure */
|
||||
UINT_32 u4KeyIndex; /*!< KeyID */
|
||||
UINT_32 u4KeyLength; /*!< Key length in bytes */
|
||||
PARAM_MAC_ADDRESS arBSSID; /*!< MAC address */
|
||||
PARAM_KEY_RSC rKeyRSC;
|
||||
UINT_8 aucKeyMaterial[32]; /*!< Key content by above setting */
|
||||
} P2P_PARAM_KEY_T, *P_P2P_PARAM_KEY_T;
|
||||
|
||||
#if CONFIG_NL80211_TESTMODE
|
||||
|
||||
typedef struct _NL80211_DRIVER_TEST_PRE_PARAMS {
|
||||
UINT_16 idx_mode;
|
||||
UINT_16 idx;
|
||||
UINT_32 value;
|
||||
} NL80211_DRIVER_TEST_PRE_PARAMS, *P_NL80211_DRIVER_TEST_PRE_PARAMS;
|
||||
|
||||
|
||||
typedef struct _NL80211_DRIVER_TEST_PARAMS {
|
||||
UINT_32 index;
|
||||
UINT_32 buflen;
|
||||
} NL80211_DRIVER_TEST_PARAMS, *P_NL80211_DRIVER_TEST_PARAMS;
|
||||
|
||||
|
||||
/* P2P Sigma*/
|
||||
typedef struct _NL80211_DRIVER_P2P_SIGMA_PARAMS {
|
||||
NL80211_DRIVER_TEST_PARAMS hdr;
|
||||
UINT_32 idx;
|
||||
UINT_32 value;
|
||||
}NL80211_DRIVER_P2P_SIGMA_PARAMS, *P_NL80211_DRIVER_P2P_SIGMA_PARAMS;
|
||||
|
||||
|
||||
/* Hotspot Client Management */
|
||||
typedef struct _NL80211_DRIVER_hotspot_block_PARAMS {
|
||||
NL80211_DRIVER_TEST_PARAMS hdr;
|
||||
UINT_8 ucblocked;
|
||||
UINT_8 aucBssid[MAC_ADDR_LEN];
|
||||
}NL80211_DRIVER_hotspot_block_PARAMS, *P_NL80211_DRIVER_hotspot_block_PARAMS;
|
||||
|
||||
|
||||
#if CFG_SUPPORT_WFD
|
||||
typedef struct _NL80211_DRIVER_WFD_PARAMS {
|
||||
NL80211_DRIVER_TEST_PARAMS hdr;
|
||||
UINT_32 WfdCmdType;
|
||||
UINT_8 WfdEnable;
|
||||
UINT_8 WfdCoupleSinkStatus;
|
||||
UINT_8 WfdSessionAvailable;
|
||||
UINT_8 WfdSigmaMode;
|
||||
UINT_16 WfdDevInfo;
|
||||
UINT_16 WfdControlPort;
|
||||
UINT_16 WfdMaximumTp;
|
||||
UINT_16 WfdExtendCap;
|
||||
UINT_8 WfdCoupleSinkAddress[MAC_ADDR_LEN];
|
||||
UINT_8 WfdAssociatedBssid[MAC_ADDR_LEN];
|
||||
UINT_8 WfdVideoIp[4];
|
||||
UINT_8 WfdAudioIp[4];
|
||||
UINT_16 WfdVideoPort;
|
||||
UINT_16 WfdAudioPort;
|
||||
UINT_32 WfdFlag;
|
||||
UINT_32 WfdPolicy;
|
||||
UINT_32 WfdState;
|
||||
UINT_8 WfdSessionInformationIE[24*8]; // Include Subelement ID, length
|
||||
UINT_16 WfdSessionInformationIELen;
|
||||
UINT_8 aucReserved1[2];
|
||||
UINT_8 aucWfdPrimarySinkMac[MAC_ADDR_LEN];
|
||||
UINT_8 aucWfdSecondarySinkMac[MAC_ADDR_LEN];
|
||||
UINT_32 WfdAdvanceFlag;
|
||||
UINT_8 aucWfdLocalIp[4];
|
||||
UINT_8 aucReserved2[64];
|
||||
UINT_8 aucReserved3[64];
|
||||
UINT_8 aucReserved4[64];
|
||||
}NL80211_DRIVER_WFD_PARAMS, *P_NL80211_DRIVER_WFD_PARAMS;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
/* Routines to handle command */
|
||||
/*--------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
wlanoidSetAddP2PKey(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSetRemoveP2PKey(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSetNetworkAddress(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSetP2PMulticastList(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
/* Service Discovery Subroutines */
|
||||
/*--------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
wlanoidSendP2PSDRequest(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSendP2PSDResponse(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidGetP2PSDRequest(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidGetP2PSDResponse(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvQueryBuffer,
|
||||
IN UINT_32 u4QueryBufferLen,
|
||||
OUT PUINT_32 puQueryInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSetP2PTerminateSDPhase(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvQueryBuffer,
|
||||
IN UINT_32 u4QueryBufferLen,
|
||||
OUT PUINT_32 pu4QueryInfoLen
|
||||
);
|
||||
|
||||
#if CFG_SUPPORT_ANTI_PIRACY
|
||||
WLAN_STATUS
|
||||
wlanoidSetSecCheckRequest(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidGetSecCheckResponse(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvQueryBuffer,
|
||||
IN UINT_32 u4QueryBufferLen,
|
||||
OUT PUINT_32 pu4QueryInfoLen
|
||||
);
|
||||
#endif
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSetNoaParam (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSetOppPsParam (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSetUApsdParam (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidQueryP2pPowerSaveProfile (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvQueryBuffer,
|
||||
IN UINT_32 u4QueryBufferLen,
|
||||
OUT PUINT_32 pu4QueryInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSetP2pPowerSaveProfile (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSetP2pSetNetworkAddress (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidQueryP2pOpChannel(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvQueryBuffer,
|
||||
IN UINT_32 u4QueryBufferLen,
|
||||
OUT PUINT_32 pu4QueryInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidQueryP2pVersion(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvQueryBuffer,
|
||||
IN UINT_32 u4QueryBufferLen,
|
||||
OUT PUINT_32 pu4QueryInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSetP2pSupplicantVersion(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvSetBuffer,
|
||||
IN UINT_32 u4SetBufferLen,
|
||||
OUT PUINT_32 pu4SetInfoLen
|
||||
);
|
||||
|
||||
WLAN_STATUS
|
||||
wlanoidSetP2pWPSmode (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvQueryBuffer,
|
||||
IN UINT_32 u4QueryBufferLen,
|
||||
OUT PUINT_32 pu4QueryInfoLen
|
||||
);
|
||||
|
||||
#if CFG_SUPPORT_P2P_RSSI_QUERY
|
||||
WLAN_STATUS
|
||||
wlanoidQueryP2pRssi(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN PVOID pvQueryBuffer,
|
||||
IN UINT_32 u4QueryBufferLen,
|
||||
OUT PUINT_32 pu4QueryInfoLen
|
||||
);
|
||||
#endif
|
||||
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
/* Callbacks for event indication */
|
||||
/*--------------------------------------------------------------*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#endif
|
||||
#endif /* _WLAN_P2P_H */
|
||||
|
||||
File diff suppressed because it is too large
Load diff
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,775 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/cnm.c#2 $
|
||||
*/
|
||||
|
||||
/*! \file "cnm.c"
|
||||
\brief Module of Concurrent Network Management
|
||||
|
||||
Module of Concurrent Network Management
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: cnm.c $
|
||||
*
|
||||
* 07 17 2012 yuche.tsai
|
||||
* NULL
|
||||
* Compile no error before trial run.
|
||||
*
|
||||
* 11 15 2011 cm.chang
|
||||
* NULL
|
||||
* Fix possible wrong message when P2P is unregistered
|
||||
*
|
||||
* 11 14 2011 yuche.tsai
|
||||
* [WCXRP00001107] [Volunteer Patch][Driver] Large Network Type index assert in FW issue.
|
||||
* Fix large network type index assert in FW issue.
|
||||
*
|
||||
* 11 10 2011 cm.chang
|
||||
* NULL
|
||||
* Modify debug message for XLOG
|
||||
*
|
||||
* 11 08 2011 cm.chang
|
||||
* NULL
|
||||
* Add RLM and CNM debug message for XLOG
|
||||
*
|
||||
* 11 01 2011 cm.chang
|
||||
* [WCXRP00001077] [All Wi-Fi][Driver] Fix wrong preferred channel for AP and BOW
|
||||
* Only check AIS channel for P2P and BOW
|
||||
*
|
||||
* 10 25 2011 cm.chang
|
||||
* [WCXRP00001058] [All Wi-Fi][Driver] Fix sta_rec's phyTypeSet and OBSS scan in AP mode
|
||||
* Extension channel of some 5G AP will not follow regulation requirement
|
||||
*
|
||||
* 09 30 2011 cm.chang
|
||||
* [WCXRP00001020] [MT6620 Wi-Fi][Driver] Handle secondary channel offset of AP in 5GHz band
|
||||
* .
|
||||
*
|
||||
* 09 01 2011 cm.chang
|
||||
* [WCXRP00000937] [MT6620 Wi-Fi][Driver][FW] cnm.c line #848 assert when doing monkey test
|
||||
* Print message only in Linux platform for monkey testing
|
||||
*
|
||||
* 06 23 2011 cp.wu
|
||||
* [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module
|
||||
* change parameter name from PeerAddr to BSSID
|
||||
*
|
||||
* 06 20 2011 cp.wu
|
||||
* [WCXRP00000798] [MT6620 Wi-Fi][Firmware] Follow-ups for WAPI frequency offset workaround in firmware SCN module
|
||||
* 1. specify target's BSSID when requesting channel privilege.
|
||||
* 2. pass BSSID information to firmware domain
|
||||
*
|
||||
* 06 01 2011 cm.chang
|
||||
* [WCXRP00000756] [MT6620 Wi-Fi][Driver] 1. AIS follow channel of BOW 2. Provide legal channel function
|
||||
* Limit AIS to fixed channel same with BOW
|
||||
*
|
||||
* 04 12 2011 cm.chang
|
||||
* [WCXRP00000634] [MT6620 Wi-Fi][Driver][FW] 2nd BSS will not support 40MHz bandwidth for concurrency
|
||||
* .
|
||||
*
|
||||
* 03 10 2011 cm.chang
|
||||
* [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module
|
||||
* Check if P2P network index is Tethering AP
|
||||
*
|
||||
* 03 10 2011 cm.chang
|
||||
* [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module
|
||||
* Add some functions to let AIS/Tethering or AIS/BOW be the same channel
|
||||
*
|
||||
* 02 17 2011 cm.chang
|
||||
* [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module
|
||||
* When P2P registried, invoke BOW deactivate function
|
||||
*
|
||||
* 01 12 2011 cm.chang
|
||||
* [WCXRP00000358] [MT6620 Wi-Fi][Driver] Provide concurrent information for each module
|
||||
* Provide function to decide if BSS can be activated or not
|
||||
*
|
||||
* 12 07 2010 cm.chang
|
||||
* [WCXRP00000239] MT6620 Wi-Fi][Driver][FW] Merge concurrent branch back to maintrunk
|
||||
* 1. BSSINFO include RLM parameter
|
||||
* 2. free all sta records when network is disconnected
|
||||
*
|
||||
* 12 07 2010 cm.chang
|
||||
* [WCXRP00000238] MT6620 Wi-Fi][Driver][FW] Support regulation domain setting from NVRAM and supplicant
|
||||
* 1. Country code is from NVRAM or supplicant
|
||||
* 2. Change band definition in CMD/EVENT.
|
||||
*
|
||||
* 11 08 2010 cm.chang
|
||||
* [WCXRP00000169] [MT6620 Wi-Fi][Driver][FW] Remove unused CNM recover message ID
|
||||
* Remove CNM channel reover message ID
|
||||
*
|
||||
* 10 13 2010 cm.chang
|
||||
* [WCXRP00000094] [MT6620 Wi-Fi][Driver] Connect to 2.4GHz AP, Driver crash.
|
||||
* Add exception handle when cmd buffer is not available
|
||||
*
|
||||
* 08 24 2010 cm.chang
|
||||
* NULL
|
||||
* Support RLM initail channel of Ad-hoc, P2P and BOW
|
||||
*
|
||||
* 07 19 2010 wh.su
|
||||
*
|
||||
* update for security supporting.
|
||||
*
|
||||
* 07 19 2010 cm.chang
|
||||
*
|
||||
* Set RLM parameters and enable CNM channel manager
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 08 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Rename MID_MNY_CNM_CH_RELEASE to MID_MNY_CNM_CH_ABORT
|
||||
*
|
||||
* 07 01 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Fix wrong message ID for channel grant to requester
|
||||
*
|
||||
* 07 01 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Modify CNM message handler for new flow
|
||||
*
|
||||
* 06 07 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Set 20/40M bandwidth of AP HT OP before association process
|
||||
*
|
||||
* 05 31 2010 yarco.yang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Add RX TSF Log Feature and ADDBA Rsp with DECLINE handling
|
||||
*
|
||||
* 05 21 2010 yarco.yang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support TCP/UDP/IP Checksum offload feature
|
||||
*
|
||||
* 05 12 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Add Power Management - Legacy PS-POLL support.
|
||||
*
|
||||
* 05 05 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Add a new function to send abort message
|
||||
*
|
||||
* 04 27 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* BMC mac address shall be ignored in basic config command
|
||||
*
|
||||
* 04 24 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* g_aprBssInfo[] depends on CFG_SUPPORT_P2P and CFG_SUPPORT_BOW
|
||||
*
|
||||
* 04 22 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support change of MAC address by host command
|
||||
*
|
||||
* 04 16 2010 wh.su
|
||||
* [BORA00000680][MT6620] Support the statistic for Microsoft os query
|
||||
* adding the wpa-none for ibss beacon.
|
||||
*
|
||||
* 04 07 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Fix bug for OBSS scan
|
||||
*
|
||||
* 03 30 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support 2.4G OBSS scan
|
||||
*
|
||||
* 03 16 2010 kevin.huang
|
||||
* [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
|
||||
* Add AdHoc Mode
|
||||
*
|
||||
* 03 10 2010 kevin.huang
|
||||
* [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
|
||||
*
|
||||
* * * * * * * * * * Add Channel Manager for arbitration of JOIN and SCAN Req
|
||||
*
|
||||
* 02 25 2010 wh.su
|
||||
* [BORA00000605][WIFISYS] Phase3 Integration
|
||||
* use the Rx0 dor event indicate.
|
||||
*
|
||||
* 02 08 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support partial part about cmd basic configuration
|
||||
*
|
||||
* Dec 10 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Remove conditional compiling FPGA_V5
|
||||
*
|
||||
* Nov 18 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add function cnmFsmEventInit()
|
||||
*
|
||||
* Nov 2 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
**
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "precomp.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief This function is used to initialize variables in CNM_INFO_T.
|
||||
*
|
||||
* @param (none)
|
||||
*
|
||||
* @return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmInit (
|
||||
P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
return;
|
||||
} /* end of cnmInit() */
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief This function is used to initialize variables in CNM_INFO_T.
|
||||
*
|
||||
* @param (none)
|
||||
*
|
||||
* @return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmUninit (
|
||||
P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
return;
|
||||
} /* end of cnmUninit() */
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief Before handle the message from other module, it need to obtain
|
||||
* the Channel privilege from Channel Manager
|
||||
*
|
||||
* @param[in] prMsgHdr The message need to be handled.
|
||||
*
|
||||
* @return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmChMngrRequestPrivilege (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSG_HDR_T prMsgHdr
|
||||
)
|
||||
{
|
||||
P_MSG_CH_REQ_T prMsgChReq;
|
||||
P_CMD_CH_PRIVILEGE_T prCmdBody;
|
||||
WLAN_STATUS rStatus;
|
||||
|
||||
ASSERT(prAdapter);
|
||||
ASSERT(prMsgHdr);
|
||||
|
||||
prMsgChReq = (P_MSG_CH_REQ_T) prMsgHdr;
|
||||
|
||||
prCmdBody = (P_CMD_CH_PRIVILEGE_T)
|
||||
cnmMemAlloc(prAdapter, RAM_TYPE_BUF, sizeof(CMD_CH_PRIVILEGE_T));
|
||||
ASSERT(prCmdBody);
|
||||
|
||||
/* To do: exception handle */
|
||||
if (!prCmdBody) {
|
||||
DBGLOG(CNM, ERROR, ("ChReq: fail to get buf (net=%d, token=%d)\n",
|
||||
prMsgChReq->ucNetTypeIndex, prMsgChReq->ucTokenID));
|
||||
|
||||
cnmMemFree(prAdapter, prMsgHdr);
|
||||
return;
|
||||
}
|
||||
|
||||
DBGLOG(CNM, INFO, ("ChReq net=%d token=%d b=%d c=%d s=%d\n",
|
||||
prMsgChReq->ucNetTypeIndex, prMsgChReq->ucTokenID,
|
||||
prMsgChReq->eRfBand, prMsgChReq->ucPrimaryChannel,
|
||||
prMsgChReq->eRfSco));
|
||||
|
||||
prCmdBody->ucNetTypeIndex = prMsgChReq->ucNetTypeIndex;
|
||||
prCmdBody->ucTokenID = prMsgChReq->ucTokenID;
|
||||
prCmdBody->ucAction = CMD_CH_ACTION_REQ; /* Request */
|
||||
prCmdBody->ucPrimaryChannel = prMsgChReq->ucPrimaryChannel;
|
||||
prCmdBody->ucRfSco = (UINT_8) prMsgChReq->eRfSco;
|
||||
prCmdBody->ucRfBand = (UINT_8) prMsgChReq->eRfBand;
|
||||
prCmdBody->ucReqType = (UINT_8) prMsgChReq->eReqType;
|
||||
prCmdBody->ucReserved = 0;
|
||||
prCmdBody->u4MaxInterval= prMsgChReq->u4MaxInterval;
|
||||
COPY_MAC_ADDR(prCmdBody->aucBSSID, prMsgChReq->aucBSSID);
|
||||
|
||||
ASSERT(prCmdBody->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM);
|
||||
|
||||
/* For monkey testing 20110901 */
|
||||
if (prCmdBody->ucNetTypeIndex >= NETWORK_TYPE_INDEX_NUM) {
|
||||
DBGLOG(CNM, ERROR, ("CNM: ChReq with wrong netIdx=%d\n\n",
|
||||
prCmdBody->ucNetTypeIndex));
|
||||
}
|
||||
|
||||
rStatus = wlanSendSetQueryCmd (
|
||||
prAdapter, /* prAdapter */
|
||||
CMD_ID_CH_PRIVILEGE, /* ucCID */
|
||||
TRUE, /* fgSetQuery */
|
||||
FALSE, /* fgNeedResp */
|
||||
FALSE, /* fgIsOid */
|
||||
NULL, /* pfCmdDoneHandler */
|
||||
NULL, /* pfCmdTimeoutHandler */
|
||||
sizeof(CMD_CH_PRIVILEGE_T), /* u4SetQueryInfoLen */
|
||||
(PUINT_8) prCmdBody, /* pucInfoBuffer */
|
||||
NULL, /* pvSetQueryBuffer */
|
||||
0 /* u4SetQueryBufferLen */
|
||||
);
|
||||
|
||||
ASSERT(rStatus == WLAN_STATUS_PENDING);
|
||||
|
||||
cnmMemFree(prAdapter, prCmdBody);
|
||||
cnmMemFree(prAdapter, prMsgHdr);
|
||||
|
||||
return;
|
||||
} /* end of cnmChMngrRequestPrivilege() */
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief Before deliver the message to other module, it need to release
|
||||
* the Channel privilege to Channel Manager.
|
||||
*
|
||||
* @param[in] prMsgHdr The message need to be delivered
|
||||
*
|
||||
* @return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmChMngrAbortPrivilege (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_MSG_HDR_T prMsgHdr
|
||||
)
|
||||
{
|
||||
P_MSG_CH_ABORT_T prMsgChAbort;
|
||||
P_CMD_CH_PRIVILEGE_T prCmdBody;
|
||||
WLAN_STATUS rStatus;
|
||||
|
||||
ASSERT(prAdapter);
|
||||
ASSERT(prMsgHdr);
|
||||
|
||||
prMsgChAbort = (P_MSG_CH_ABORT_T) prMsgHdr;
|
||||
|
||||
prCmdBody = (P_CMD_CH_PRIVILEGE_T)
|
||||
cnmMemAlloc(prAdapter, RAM_TYPE_BUF, sizeof(CMD_CH_PRIVILEGE_T));
|
||||
ASSERT(prCmdBody);
|
||||
|
||||
/* To do: exception handle */
|
||||
if (!prCmdBody) {
|
||||
DBGLOG(CNM, ERROR, ("ChAbort: fail to get buf (net=%d, token=%d)\n",
|
||||
prMsgChAbort->ucNetTypeIndex, prMsgChAbort->ucTokenID));
|
||||
|
||||
cnmMemFree(prAdapter, prMsgHdr);
|
||||
return;
|
||||
}
|
||||
|
||||
DBGLOG(CNM, INFO, ("ChAbort net=%d token=%d\n",
|
||||
prMsgChAbort->ucNetTypeIndex, prMsgChAbort->ucTokenID));
|
||||
|
||||
prCmdBody->ucNetTypeIndex = prMsgChAbort->ucNetTypeIndex;
|
||||
prCmdBody->ucTokenID = prMsgChAbort->ucTokenID;
|
||||
prCmdBody->ucAction = CMD_CH_ACTION_ABORT; /* Abort */
|
||||
|
||||
ASSERT(prCmdBody->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM);
|
||||
|
||||
/* For monkey testing 20110901 */
|
||||
if (prCmdBody->ucNetTypeIndex >= NETWORK_TYPE_INDEX_NUM) {
|
||||
DBGLOG(CNM, ERROR, ("CNM: ChAbort with wrong netIdx=%d\n\n",
|
||||
prCmdBody->ucNetTypeIndex));
|
||||
}
|
||||
|
||||
rStatus = wlanSendSetQueryCmd (
|
||||
prAdapter, /* prAdapter */
|
||||
CMD_ID_CH_PRIVILEGE, /* ucCID */
|
||||
TRUE, /* fgSetQuery */
|
||||
FALSE, /* fgNeedResp */
|
||||
FALSE, /* fgIsOid */
|
||||
NULL, /* pfCmdDoneHandler */
|
||||
NULL, /* pfCmdTimeoutHandler */
|
||||
sizeof(CMD_CH_PRIVILEGE_T), /* u4SetQueryInfoLen */
|
||||
(PUINT_8) prCmdBody, /* pucInfoBuffer */
|
||||
NULL, /* pvSetQueryBuffer */
|
||||
0 /* u4SetQueryBufferLen */
|
||||
);
|
||||
|
||||
ASSERT(rStatus == WLAN_STATUS_PENDING);
|
||||
|
||||
cnmMemFree(prAdapter, prCmdBody);
|
||||
cnmMemFree(prAdapter, prMsgHdr);
|
||||
|
||||
return;
|
||||
} /* end of cnmChMngrAbortPrivilege() */
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief
|
||||
*
|
||||
* @param (none)
|
||||
*
|
||||
* @return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmChMngrHandleChEvent (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_WIFI_EVENT_T prEvent
|
||||
)
|
||||
{
|
||||
P_EVENT_CH_PRIVILEGE_T prEventBody;
|
||||
P_MSG_CH_GRANT_T prChResp;
|
||||
|
||||
ASSERT(prAdapter);
|
||||
ASSERT(prEvent);
|
||||
|
||||
prEventBody = (P_EVENT_CH_PRIVILEGE_T) (prEvent->aucBuffer);
|
||||
prChResp = (P_MSG_CH_GRANT_T)
|
||||
cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_CH_GRANT_T));
|
||||
ASSERT(prChResp);
|
||||
|
||||
/* To do: exception handle */
|
||||
if (!prChResp) {
|
||||
DBGLOG(CNM, ERROR, ("ChGrant: fail to get buf (net=%d, token=%d)\n",
|
||||
prEventBody->ucNetTypeIndex, prEventBody->ucTokenID));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
DBGLOG(CNM, INFO, ("ChGrant net=%d token=%d ch=%d sco=%d\n",
|
||||
prEventBody->ucNetTypeIndex, prEventBody->ucTokenID,
|
||||
prEventBody->ucPrimaryChannel, prEventBody->ucRfSco));
|
||||
|
||||
ASSERT(prEventBody->ucNetTypeIndex < NETWORK_TYPE_INDEX_NUM);
|
||||
ASSERT(prEventBody->ucStatus == EVENT_CH_STATUS_GRANT);
|
||||
|
||||
/* Decide message ID based on network and response status */
|
||||
if (prEventBody->ucNetTypeIndex == NETWORK_TYPE_AIS_INDEX) {
|
||||
prChResp->rMsgHdr.eMsgId = MID_CNM_AIS_CH_GRANT;
|
||||
}
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
else if ((prAdapter->fgIsP2PRegistered) &&
|
||||
(prEventBody->ucNetTypeIndex == NETWORK_TYPE_P2P_INDEX)) {
|
||||
prChResp->rMsgHdr.eMsgId = MID_CNM_P2P_CH_GRANT;
|
||||
}
|
||||
#endif
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
else if (prEventBody->ucNetTypeIndex == NETWORK_TYPE_BOW_INDEX) {
|
||||
prChResp->rMsgHdr.eMsgId = MID_CNM_BOW_CH_GRANT;
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
cnmMemFree(prAdapter, prChResp);
|
||||
return;
|
||||
}
|
||||
|
||||
prChResp->ucNetTypeIndex = prEventBody->ucNetTypeIndex;
|
||||
prChResp->ucTokenID = prEventBody->ucTokenID;
|
||||
prChResp->ucPrimaryChannel = prEventBody->ucPrimaryChannel;
|
||||
prChResp->eRfSco = (ENUM_CHNL_EXT_T) prEventBody->ucRfSco;
|
||||
prChResp->eRfBand = (ENUM_BAND_T) prEventBody->ucRfBand;
|
||||
prChResp->eReqType = (ENUM_CH_REQ_TYPE_T) prEventBody->ucReqType;
|
||||
prChResp->u4GrantInterval = prEventBody->u4GrantInterval;
|
||||
|
||||
mboxSendMsg(prAdapter,
|
||||
MBOX_ID_0,
|
||||
(P_MSG_HDR_T) prChResp,
|
||||
MSG_SEND_METHOD_BUF);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief This function is invoked for P2P or BOW networks
|
||||
*
|
||||
* @param (none)
|
||||
*
|
||||
* @return TRUE: suggest to adopt the returned preferred channel
|
||||
* FALSE: No suggestion. Caller should adopt its preference
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
cnmPreferredChannel (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_ENUM_BAND_T prBand,
|
||||
PUINT_8 pucPrimaryChannel,
|
||||
P_ENUM_CHNL_EXT_T prBssSCO
|
||||
)
|
||||
{
|
||||
P_BSS_INFO_T prBssInfo;
|
||||
|
||||
ASSERT(prAdapter);
|
||||
ASSERT(prBand);
|
||||
ASSERT(pucPrimaryChannel);
|
||||
ASSERT(prBssSCO);
|
||||
|
||||
prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX];
|
||||
|
||||
if (RLM_NET_PARAM_VALID(prBssInfo)) {
|
||||
*prBand = prBssInfo->eBand;
|
||||
*pucPrimaryChannel = prBssInfo->ucPrimaryChannel;
|
||||
*prBssSCO = prBssInfo->eBssSCO;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief
|
||||
*
|
||||
* @param (none)
|
||||
*
|
||||
* @return TRUE: available channel is limited to return value
|
||||
* FALSE: no limited
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
cnmAisInfraChannelFixed (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_ENUM_BAND_T prBand,
|
||||
PUINT_8 pucPrimaryChannel
|
||||
)
|
||||
{
|
||||
#if CFG_ENABLE_WIFI_DIRECT ||(CFG_ENABLE_BT_OVER_WIFI && CFG_BOW_LIMIT_AIS_CHNL)
|
||||
P_BSS_INFO_T prBssInfo;
|
||||
#endif
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX) &&
|
||||
p2pFuncIsAPMode(prAdapter->rWifiVar.prP2pFsmInfo)) {
|
||||
|
||||
ASSERT(prAdapter->fgIsP2PRegistered);
|
||||
|
||||
prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX];
|
||||
|
||||
*prBand = prBssInfo->eBand;
|
||||
*pucPrimaryChannel = prBssInfo->ucPrimaryChannel;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CFG_ENABLE_BT_OVER_WIFI && CFG_BOW_LIMIT_AIS_CHNL
|
||||
if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_BOW_INDEX)) {
|
||||
|
||||
prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX];
|
||||
|
||||
*prBand = prBssInfo->eBand;
|
||||
*pucPrimaryChannel = prBssInfo->ucPrimaryChannel;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief
|
||||
*
|
||||
* @param (none)
|
||||
*
|
||||
* @return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmAisInfraConnectNotify (
|
||||
P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
P_BSS_INFO_T prAisBssInfo, prBowBssInfo;
|
||||
|
||||
prAisBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX];
|
||||
prBowBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_BOW_INDEX];
|
||||
|
||||
if (RLM_NET_PARAM_VALID(prAisBssInfo) && RLM_NET_PARAM_VALID(prBowBssInfo)){
|
||||
if (prAisBssInfo->eBand != prBowBssInfo->eBand ||
|
||||
prAisBssInfo->ucPrimaryChannel != prBowBssInfo->ucPrimaryChannel) {
|
||||
|
||||
/* Notify BOW to do deactivation */
|
||||
bowNotifyAllLinkDisconnected(prAdapter);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief
|
||||
*
|
||||
* @param (none)
|
||||
*
|
||||
* @return TRUE: permitted
|
||||
* FALSE: Not permitted
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
cnmAisIbssIsPermitted (
|
||||
P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX)) {
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_BOW_INDEX)) {
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief
|
||||
*
|
||||
* @param (none)
|
||||
*
|
||||
* @return TRUE: permitted
|
||||
* FALSE: Not permitted
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
cnmP2PIsPermitted (
|
||||
P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
P_BSS_INFO_T prBssInfo;
|
||||
|
||||
prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX];
|
||||
|
||||
if (IS_BSS_ACTIVE(prBssInfo) &&
|
||||
prBssInfo->eCurrentOPMode == OP_MODE_IBSS) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_BOW_INDEX)) {
|
||||
/* Notify BOW to do deactivation */
|
||||
bowNotifyAllLinkDisconnected(prAdapter);
|
||||
}
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief
|
||||
*
|
||||
* @param (none)
|
||||
*
|
||||
* @return TRUE: permitted
|
||||
* FALSE: Not permitted
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
cnmBowIsPermitted (
|
||||
P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
P_BSS_INFO_T prBssInfo;
|
||||
|
||||
prBssInfo = &prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX];
|
||||
|
||||
if (IS_BSS_ACTIVE(prBssInfo) &&
|
||||
prBssInfo->eCurrentOPMode == OP_MODE_IBSS) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
if (IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX)) {
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief
|
||||
*
|
||||
* @param (none)
|
||||
*
|
||||
* @return TRUE: permitted
|
||||
* FALSE: Not permitted
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
cnmBss40mBwPermitted (
|
||||
P_ADAPTER_T prAdapter,
|
||||
ENUM_NETWORK_TYPE_INDEX_T eNetTypeIdx
|
||||
)
|
||||
{
|
||||
P_BSS_INFO_T prBssInfo;
|
||||
UINT_8 i;
|
||||
|
||||
/* Note: To support real-time decision instead of current activated-time,
|
||||
* the STA roaming case shall be considered about synchronization
|
||||
* problem. Another variable fgAssoc40mBwAllowed is added to
|
||||
* represent HT capability when association
|
||||
*/
|
||||
for (i = 0; i < NETWORK_TYPE_INDEX_NUM; i++) {
|
||||
if (i != (UINT_8) eNetTypeIdx) {
|
||||
prBssInfo = &prAdapter->rWifiVar.arBssInfo[i];
|
||||
|
||||
if (IS_BSS_ACTIVE(prBssInfo) && (prBssInfo->fg40mBwAllowed ||
|
||||
prBssInfo->fgAssoc40mBwAllowed)) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,531 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/cnm_timer.c#1 $
|
||||
*/
|
||||
|
||||
/*! \file "cnm_timer.c"
|
||||
\brief
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: cnm_timer.c $
|
||||
*
|
||||
* 12 13 2011 cm.chang
|
||||
* [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer
|
||||
* Add wake lock if timer timeout value is smaller than 5 seconds
|
||||
*
|
||||
* 02 24 2011 cp.wu
|
||||
* [WCXRP00000490] [MT6620 Wi-Fi][Driver][Win32] modify kalMsleep() implementation because NdisMSleep() won't sleep long enough for specified interval such as 500ms
|
||||
* modify cnm_timer and hem_mbox APIs to be thread safe to ease invoking restrictions
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 08 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* cnm_timer has been migrated.
|
||||
*
|
||||
* 05 28 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support sleep notification to host
|
||||
*
|
||||
* 05 19 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Add some checking assertions
|
||||
*
|
||||
* 04 24 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Return timer token back to COS when entering wait off state
|
||||
*
|
||||
* 01 11 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Remove compiling warning
|
||||
*
|
||||
* 01 08 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support longer timeout interval to 45 days from 65secu1rwduu`wvpghlqg|fh+fmdkb
|
||||
*
|
||||
* 01 06 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Fix system time is 32KHz instead of 1ms
|
||||
*
|
||||
* 01 04 2010 tehuang.liu
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* For working out the first connection Chariot-verified version
|
||||
*
|
||||
* Dec 3 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Place rRootTimer.rNextExpiredSysTime = rExpiredSysTime; before set timer
|
||||
*
|
||||
* Oct 30 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* In cnmTimerInitialize(), just stop timer if it was already created.
|
||||
*
|
||||
* Oct 30 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Move the external reference for Lint to precomp.h
|
||||
*
|
||||
* Oct 30 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Fix lint warning
|
||||
*
|
||||
* Oct 28 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
**
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "precomp.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This routine is called to set the time to do the time out check.
|
||||
*
|
||||
* \param[in] rTimeout Time out interval from current time.
|
||||
*
|
||||
* \retval TRUE Success.
|
||||
*
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
static BOOLEAN
|
||||
cnmTimerSetTimer (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN OS_SYSTIME rTimeout
|
||||
)
|
||||
{
|
||||
P_ROOT_TIMER prRootTimer;
|
||||
BOOLEAN fgNeedWakeLock;
|
||||
|
||||
ASSERT(prAdapter);
|
||||
|
||||
prRootTimer = &prAdapter->rRootTimer;
|
||||
|
||||
kalSetTimer(prAdapter->prGlueInfo, rTimeout);
|
||||
|
||||
if (rTimeout <= SEC_TO_SYSTIME(WAKE_LOCK_MAX_TIME)) {
|
||||
fgNeedWakeLock = TRUE;
|
||||
|
||||
if (!prRootTimer->fgWakeLocked) {
|
||||
KAL_WAKE_LOCK(prAdapter, &prRootTimer->rWakeLock);
|
||||
prRootTimer->fgWakeLocked = TRUE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
fgNeedWakeLock = FALSE;
|
||||
}
|
||||
|
||||
return fgNeedWakeLock;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This routines is called to initialize a root timer.
|
||||
*
|
||||
* \param[in] prAdapter
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmTimerInitialize (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
P_ROOT_TIMER prRootTimer;
|
||||
KAL_SPIN_LOCK_DECLARATION();
|
||||
|
||||
ASSERT(prAdapter);
|
||||
|
||||
prRootTimer = &prAdapter->rRootTimer;
|
||||
|
||||
/* Note: glue layer have configured timer */
|
||||
|
||||
KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
LINK_INITIALIZE(&prRootTimer->rLinkHead);
|
||||
KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
|
||||
KAL_WAKE_LOCK_INIT(prAdapter, &prRootTimer->rWakeLock, "WLAN Timer");
|
||||
prRootTimer->fgWakeLocked = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This routines is called to destroy a root timer.
|
||||
* When WIFI is off, the token shall be returned back to system.
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmTimerDestroy (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
P_ROOT_TIMER prRootTimer;
|
||||
KAL_SPIN_LOCK_DECLARATION();
|
||||
|
||||
ASSERT(prAdapter);
|
||||
|
||||
prRootTimer = &prAdapter->rRootTimer;
|
||||
|
||||
if (prRootTimer->fgWakeLocked) {
|
||||
KAL_WAKE_UNLOCK(prAdapter, &prRootTimer->rWakeLock);
|
||||
prRootTimer->fgWakeLocked = FALSE;
|
||||
}
|
||||
KAL_WAKE_LOCK_DESTROY(prAdapter, &prRootTimer->rWakeLock);
|
||||
|
||||
KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
LINK_INITIALIZE(&prRootTimer->rLinkHead);
|
||||
KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
|
||||
/* Note: glue layer will be responsible for timer destruction */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This routines is called to initialize a timer.
|
||||
*
|
||||
* \param[in] prTimer Pointer to a timer structure.
|
||||
* \param[in] pfnFunc Pointer to the call back function.
|
||||
* \param[in] u4Data Parameter for call back function.
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmTimerInitTimer (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_TIMER_T prTimer,
|
||||
IN PFN_MGMT_TIMEOUT_FUNC pfFunc,
|
||||
IN UINT_32 u4Data
|
||||
)
|
||||
{
|
||||
ASSERT(prAdapter);
|
||||
|
||||
ASSERT(prTimer);
|
||||
|
||||
#if DBG
|
||||
/* Note: NULL function pointer is permitted for HEM POWER */
|
||||
if (pfFunc == NULL) {
|
||||
DBGLOG(CNM, WARN, ("Init timer with NULL callback function!\n"));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if DBG
|
||||
ASSERT(prAdapter->rRootTimer.rLinkHead.prNext);
|
||||
{
|
||||
P_LINK_T prTimerList;
|
||||
P_LINK_ENTRY_T prLinkEntry;
|
||||
P_TIMER_T prPendingTimer;
|
||||
|
||||
prTimerList = &(prAdapter->rRootTimer.rLinkHead);
|
||||
|
||||
LINK_FOR_EACH(prLinkEntry, prTimerList) {
|
||||
prPendingTimer = LINK_ENTRY(prLinkEntry, TIMER_T, rLinkEntry);
|
||||
ASSERT(prPendingTimer);
|
||||
ASSERT(prPendingTimer != prTimer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
LINK_ENTRY_INITIALIZE(&prTimer->rLinkEntry);
|
||||
|
||||
prTimer->pfMgmtTimeOutFunc = pfFunc;
|
||||
prTimer->u4Data = u4Data;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This routines is called to stop a timer.
|
||||
*
|
||||
* \param[in] prTimer Pointer to a timer structure.
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
static VOID
|
||||
cnmTimerStopTimer_impl (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_TIMER_T prTimer,
|
||||
IN BOOLEAN fgAcquireSpinlock
|
||||
)
|
||||
{
|
||||
P_ROOT_TIMER prRootTimer;
|
||||
KAL_SPIN_LOCK_DECLARATION();
|
||||
|
||||
ASSERT(prAdapter);
|
||||
ASSERT(prTimer);
|
||||
|
||||
prRootTimer = &prAdapter->rRootTimer;
|
||||
|
||||
if (fgAcquireSpinlock) {
|
||||
KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
}
|
||||
|
||||
if (timerPendingTimer(prTimer)) {
|
||||
LINK_REMOVE_KNOWN_ENTRY(&prRootTimer->rLinkHead,
|
||||
&prTimer->rLinkEntry);
|
||||
|
||||
/* Reduce dummy timeout for power saving, especially HIF activity.
|
||||
* If two or more timers exist and being removed timer is smallest,
|
||||
* this dummy timeout will still happen, but it is OK.
|
||||
*/
|
||||
if (LINK_IS_EMPTY(&prRootTimer->rLinkHead)) {
|
||||
kalCancelTimer(prAdapter->prGlueInfo);
|
||||
|
||||
if (fgAcquireSpinlock && prRootTimer->fgWakeLocked) {
|
||||
KAL_WAKE_UNLOCK(prAdapter, &prRootTimer->rWakeLock);
|
||||
prRootTimer->fgWakeLocked = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fgAcquireSpinlock) {
|
||||
KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This routines is called to stop a timer.
|
||||
*
|
||||
* \param[in] prTimer Pointer to a timer structure.
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmTimerStopTimer (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_TIMER_T prTimer
|
||||
)
|
||||
{
|
||||
ASSERT(prAdapter);
|
||||
ASSERT(prTimer);
|
||||
|
||||
cnmTimerStopTimer_impl(prAdapter, prTimer, TRUE);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This routines is called to start a timer with wake_lock.
|
||||
*
|
||||
* \param[in] prTimer Pointer to a timer structure.
|
||||
* \param[in] u4TimeoutMs Timeout to issue the timer and call back function
|
||||
* (unit: ms).
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmTimerStartTimer (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_TIMER_T prTimer,
|
||||
IN UINT_32 u4TimeoutMs
|
||||
)
|
||||
{
|
||||
P_ROOT_TIMER prRootTimer;
|
||||
P_LINK_T prTimerList;
|
||||
OS_SYSTIME rExpiredSysTime, rTimeoutSystime;
|
||||
KAL_SPIN_LOCK_DECLARATION();
|
||||
|
||||
ASSERT(prAdapter);
|
||||
ASSERT(prTimer);
|
||||
|
||||
KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
|
||||
prRootTimer = &prAdapter->rRootTimer;
|
||||
prTimerList= &prRootTimer->rLinkHead;
|
||||
|
||||
/* If timeout interval is larger than 1 minute, the mod value is set
|
||||
* to the timeout value first, then per minutue.
|
||||
*/
|
||||
if (u4TimeoutMs > MSEC_PER_MIN) {
|
||||
ASSERT(u4TimeoutMs <= ((UINT_32)0xFFFF * MSEC_PER_MIN));
|
||||
|
||||
prTimer->u2Minutes = (UINT_16)(u4TimeoutMs / MSEC_PER_MIN);
|
||||
u4TimeoutMs -= (prTimer->u2Minutes * MSEC_PER_MIN);
|
||||
if (u4TimeoutMs == 0) {
|
||||
u4TimeoutMs = MSEC_PER_MIN;
|
||||
prTimer->u2Minutes--;
|
||||
}
|
||||
}
|
||||
else {
|
||||
prTimer->u2Minutes = 0;
|
||||
}
|
||||
|
||||
/* The assertion check if MSEC_TO_SYSTIME() may be overflow. */
|
||||
ASSERT(u4TimeoutMs < (((UINT_32)0x80000000 - MSEC_PER_SEC) / KAL_HZ));
|
||||
rTimeoutSystime = MSEC_TO_SYSTIME(u4TimeoutMs);
|
||||
rExpiredSysTime = kalGetTimeTick() + rTimeoutSystime;
|
||||
|
||||
/* If no timer pending or the fast time interval is used. */
|
||||
if (LINK_IS_EMPTY(prTimerList) ||
|
||||
TIME_BEFORE(rExpiredSysTime, prRootTimer->rNextExpiredSysTime)) {
|
||||
|
||||
prRootTimer->rNextExpiredSysTime = rExpiredSysTime;
|
||||
cnmTimerSetTimer(prAdapter, rTimeoutSystime);
|
||||
}
|
||||
|
||||
/* Add this timer to checking list */
|
||||
prTimer->rExpiredSysTime = rExpiredSysTime;
|
||||
|
||||
if (!timerPendingTimer(prTimer)) {
|
||||
LINK_INSERT_TAIL(prTimerList, &prTimer->rLinkEntry);
|
||||
}
|
||||
|
||||
KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This routines is called to check the timer list.
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
cnmTimerDoTimeOutCheck (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
P_ROOT_TIMER prRootTimer;
|
||||
P_LINK_T prTimerList;
|
||||
P_LINK_ENTRY_T prLinkEntry;
|
||||
P_TIMER_T prTimer;
|
||||
OS_SYSTIME rCurSysTime;
|
||||
PFN_MGMT_TIMEOUT_FUNC pfMgmtTimeOutFunc;
|
||||
UINT_32 u4TimeoutData;
|
||||
BOOLEAN fgNeedWakeLock;
|
||||
KAL_SPIN_LOCK_DECLARATION();
|
||||
|
||||
ASSERT(prAdapter);
|
||||
|
||||
/* acquire spin lock */
|
||||
KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
|
||||
prRootTimer = &prAdapter->rRootTimer;
|
||||
prTimerList= &prRootTimer->rLinkHead;
|
||||
|
||||
rCurSysTime = kalGetTimeTick();
|
||||
|
||||
/* Set the permitted max timeout value for new one */
|
||||
prRootTimer->rNextExpiredSysTime = rCurSysTime + MGMT_MAX_TIMEOUT_INTERVAL;
|
||||
|
||||
LINK_FOR_EACH(prLinkEntry, prTimerList) {
|
||||
prTimer = LINK_ENTRY(prLinkEntry, TIMER_T, rLinkEntry);
|
||||
ASSERT(prTimer);
|
||||
|
||||
/* Check if this entry is timeout. */
|
||||
if (!TIME_BEFORE(rCurSysTime, prTimer->rExpiredSysTime)) {
|
||||
cnmTimerStopTimer_impl(prAdapter, prTimer, FALSE);
|
||||
|
||||
pfMgmtTimeOutFunc = prTimer->pfMgmtTimeOutFunc;
|
||||
u4TimeoutData = prTimer->u4Data;
|
||||
|
||||
if (prTimer->u2Minutes > 0) {
|
||||
prTimer->u2Minutes--;
|
||||
prTimer->rExpiredSysTime =
|
||||
rCurSysTime + MSEC_TO_SYSTIME(MSEC_PER_MIN);
|
||||
LINK_INSERT_TAIL(prTimerList, &prTimer->rLinkEntry);
|
||||
}
|
||||
else if (pfMgmtTimeOutFunc) {
|
||||
KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
(pfMgmtTimeOutFunc)(prAdapter, u4TimeoutData);
|
||||
KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
}
|
||||
|
||||
/* Search entire list again because of nest del and add timers
|
||||
* and current MGMT_TIMER could be volatile after stopped
|
||||
*/
|
||||
prLinkEntry = (P_LINK_ENTRY_T)prTimerList;
|
||||
|
||||
prRootTimer->rNextExpiredSysTime =
|
||||
rCurSysTime + MGMT_MAX_TIMEOUT_INTERVAL;
|
||||
}
|
||||
else if (TIME_BEFORE(prTimer->rExpiredSysTime,
|
||||
prRootTimer->rNextExpiredSysTime)) {
|
||||
prRootTimer->rNextExpiredSysTime = prTimer->rExpiredSysTime;
|
||||
}
|
||||
} /* end of for loop */
|
||||
|
||||
/* Setup the prNext timeout event. It is possible the timer was already
|
||||
* set in the above timeout callback function.
|
||||
*/
|
||||
fgNeedWakeLock = FALSE;
|
||||
if (!LINK_IS_EMPTY(prTimerList)) {
|
||||
ASSERT(TIME_AFTER(prRootTimer->rNextExpiredSysTime, rCurSysTime));
|
||||
|
||||
fgNeedWakeLock = cnmTimerSetTimer(prAdapter, (OS_SYSTIME)
|
||||
((INT_32)prRootTimer->rNextExpiredSysTime - (INT_32)rCurSysTime));
|
||||
}
|
||||
|
||||
if (prRootTimer->fgWakeLocked && !fgNeedWakeLock) {
|
||||
KAL_WAKE_UNLOCK(prAdapter, &prRootTimer->rWakeLock);
|
||||
prRootTimer->fgWakeLocked = FALSE;
|
||||
}
|
||||
|
||||
/* release spin lock */
|
||||
KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_TIMER);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,831 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/hem_mbox.c#3 $
|
||||
*/
|
||||
|
||||
/*! \file "hem_mbox.c"
|
||||
\brief
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: hem_mbox.c $
|
||||
**
|
||||
** 08 31 2012 yuche.tsai
|
||||
** [ALPS00349585] [6577JB][WiFi direct][KE]Establish p2p connection while both device have connected to AP previously,one device reboots automatically with KE
|
||||
** Fix possible KE when concurrent & disconnect.
|
||||
**
|
||||
** 07 26 2012 yuche.tsai
|
||||
** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot
|
||||
** Update driver code of ALPS.JB for hot-spot.
|
||||
**
|
||||
** 07 19 2012 yuche.tsai
|
||||
** NULL
|
||||
** Code update for JB.
|
||||
*
|
||||
* 07 17 2012 yuche.tsai
|
||||
* NULL
|
||||
* Compile no error before trial run.
|
||||
*
|
||||
* 05 03 2012 cp.wu
|
||||
* [WCXRP00001231] [MT6620 Wi-Fi][MT5931][Driver] Correct SCAN_V2 related debugging facilities within hem_mbox.c
|
||||
* correct for debug message string table by adding missed scan_v2 related definitions.
|
||||
*
|
||||
* 03 02 2012 terry.wu
|
||||
* NULL
|
||||
* Sync CFG80211 modification from branch 2,2.
|
||||
*
|
||||
* 01 17 2012 yuche.tsai
|
||||
* NULL
|
||||
* Update mgmt frame filter setting.
|
||||
* Please also update FW 2.1
|
||||
*
|
||||
* 01 13 2012 yuche.tsai
|
||||
* NULL
|
||||
* WiFi Hot Spot Tethering for ICS ALPHA testing version.
|
||||
*
|
||||
* 11 24 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* Adjust code for DBG and CONFIG_XLOG.
|
||||
*
|
||||
* 11 15 2011 cm.chang
|
||||
* NULL
|
||||
* Add exception handle for NULL function pointer of mailbox message
|
||||
*
|
||||
* 11 11 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* modify the xlog related code.
|
||||
*
|
||||
* 11 02 2011 wh.su
|
||||
* [WCXRP00001078] [MT6620 Wi-Fi][Driver] Adding the mediatek log improment support : XLOG
|
||||
* adding the code for XLOG.
|
||||
*
|
||||
* 07 18 2011 cp.wu
|
||||
* [WCXRP00000858] [MT5931][Driver][Firmware] Add support for scan to search for more than one SSID in a single scanning request
|
||||
* add framework in driver domain for supporting new SCAN_REQ_V2 for more than 1 SSID support as well as uProbeDelay in NDIS 6.x driver model
|
||||
*
|
||||
* 06 07 2011 yuche.tsai
|
||||
* [WCXRP00000696] [Volunteer Patch][MT6620][Driver] Infinite loop issue when RX invitation response.[WCXRP00000763] [Volunteer Patch][MT6620][Driver] RX Service Discovery Frame under AP mode Issue
|
||||
* Add invitation support.
|
||||
*
|
||||
* 04 18 2011 terry.wu
|
||||
* [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED
|
||||
* Remove flag CFG_WIFI_DIRECT_MOVED.
|
||||
*
|
||||
* 03 29 2011 cm.chang
|
||||
* [WCXRP00000606] [MT6620 Wi-Fi][Driver][FW] Fix klocwork warning
|
||||
* As CR title
|
||||
*
|
||||
* 02 24 2011 cp.wu
|
||||
* [WCXRP00000490] [MT6620 Wi-Fi][Driver][Win32] modify kalMsleep() implementation because NdisMSleep() won't sleep long enough for specified interval such as 500ms
|
||||
* modify cnm_timer and hem_mbox APIs to be thread safe to ease invoking restrictions
|
||||
*
|
||||
* 02 15 2011 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Update bowString and channel grant.
|
||||
*
|
||||
* 01 26 2011 cm.chang
|
||||
* [WCXRP00000395] [MT6620 Wi-Fi][Driver][FW] Search STA_REC with additional net type index argument
|
||||
* Allocate system RAM if fixed message or mgmt buffer is not available
|
||||
*
|
||||
* 01 26 2011 yuche.tsai
|
||||
* [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record.
|
||||
* .
|
||||
*
|
||||
* 01 25 2011 yuche.tsai
|
||||
* [WCXRP00000388] [Volunteer Patch][MT6620][Driver/Fw] change Station Type in station record.
|
||||
* Fix Compile Error when DBG is disabled.
|
||||
*
|
||||
* 01 24 2011 cp.wu
|
||||
* [WCXRP00000382] [MT6620 Wi-Fi][Driver] Track forwarding packet number with notifying tx thread for serving
|
||||
* 1. add an extra counter for tracking pending forward frames.
|
||||
* 2. notify TX service thread as well when there is pending forward frame
|
||||
* 3. correct build errors leaded by introduction of Wi-Fi direct separation module
|
||||
*
|
||||
* 12 08 2010 chinghwa.yu
|
||||
* [WCXRP00000065] Update BoW design and settings
|
||||
* Support concurrent networks.
|
||||
*
|
||||
* 11 08 2010 cm.chang
|
||||
* [WCXRP00000169] [MT6620 Wi-Fi][Driver][FW] Remove unused CNM recover message ID
|
||||
* Remove CNM channel reover message ID
|
||||
*
|
||||
* 11 01 2010 cp.wu
|
||||
* [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000150] [MT6620 Wi-Fi][Driver] Add implementation for querying current TX rate from firmware auto rate module
|
||||
* 1) Query link speed (TX rate) from firmware directly with buffering mechanism to reduce overhead
|
||||
* 2) Remove CNM CH-RECOVER event handling
|
||||
* 3) cfg read/write API renamed with kal prefix for unified naming rules.
|
||||
*
|
||||
* 10 08 2010 wh.su
|
||||
* [WCXRP00000085] [MT6620 Wif-Fi] [Driver] update the modified p2p state machine
|
||||
* update the frog's new p2p state machine.
|
||||
*
|
||||
* 09 28 2010 wh.su
|
||||
* NULL
|
||||
* [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo.
|
||||
*
|
||||
* 09 16 2010 cm.chang
|
||||
* NULL
|
||||
* Remove unused message ID
|
||||
*
|
||||
* 08 30 2010 cp.wu
|
||||
* NULL
|
||||
* eliminate klockwork errors
|
||||
*
|
||||
* 08 26 2010 yuche.tsai
|
||||
* NULL
|
||||
* Add P2P Connection Abort Event Message handler.
|
||||
*
|
||||
* 08 25 2010 george.huang
|
||||
* NULL
|
||||
* update OID/ registry control path for PM related settings
|
||||
*
|
||||
* 08 24 2010 yarco.yang
|
||||
* NULL
|
||||
* Fixed Driver ASSERT at mboxInitMsgMap()
|
||||
*
|
||||
* 08 24 2010 chinghwa.yu
|
||||
* NULL
|
||||
* Update for MID_SCN_BOW_SCAN_DONE mboxDummy.
|
||||
* Update saa_fsm for BOW.
|
||||
*
|
||||
* 08 23 2010 chinghwa.yu
|
||||
* NULL
|
||||
* Add CFG_ENABLE_BT_OVER_WIFI.
|
||||
*
|
||||
* 08 23 2010 chinghwa.yu
|
||||
* NULL
|
||||
* Update for BOW.
|
||||
*
|
||||
* 08 16 2010 cp.wu
|
||||
* NULL
|
||||
* add interface for RLM to trigger OBSS-SCAN.
|
||||
*
|
||||
* 08 16 2010 yuche.tsai
|
||||
* NULL
|
||||
* Add debug message for newly add P2P message.
|
||||
*
|
||||
* 08 11 2010 yuche.tsai
|
||||
* NULL
|
||||
* Add some function entry for P2P FSM under provisioning phase..
|
||||
*
|
||||
* 08 11 2010 yuche.tsai
|
||||
* NULL
|
||||
* Add some events to P2P Module.
|
||||
*
|
||||
* 08 05 2010 yuche.tsai
|
||||
* NULL
|
||||
* Add message box event for P2P device switch on & device discovery.
|
||||
*
|
||||
* 08 04 2010 cp.wu
|
||||
* NULL
|
||||
* remove unused mailbox message definitions.
|
||||
*
|
||||
* 08 02 2010 yuche.tsai
|
||||
* NULL
|
||||
* P2P Group Negotiation Code Check in.
|
||||
*
|
||||
* 07 19 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration.
|
||||
* message table should not be commented out by compilation option without modifying header file
|
||||
*
|
||||
* 07 19 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration.
|
||||
* Add Ad-Hoc support to AIS-FSM
|
||||
*
|
||||
* 07 19 2010 yuche.tsai
|
||||
*
|
||||
* Add wifi direct scan done callback.
|
||||
*
|
||||
* 07 09 2010 cp.wu
|
||||
*
|
||||
* change handler of MID_MNY_CNM_CONNECTION_ABORT from NULL to mboxDummy.
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 07 08 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Rename MID_MNY_CNM_CH_RELEASE to MID_MNY_CNM_CH_ABORT
|
||||
*
|
||||
* 07 01 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* AIS-FSM integration with CNM channel request messages
|
||||
*
|
||||
* 07 01 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* implementation of DRV-SCN and related mailbox message handling.
|
||||
*
|
||||
* 07 01 2010 cm.chang
|
||||
* [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver
|
||||
* Modify CNM message handler for new flow
|
||||
*
|
||||
* 06 15 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* enable currently migrated message call-backs.
|
||||
*
|
||||
* 06 14 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* restore utility function invoking via hem_mbox to direct calls
|
||||
*
|
||||
* 06 10 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add buildable & linkable ais_fsm.c
|
||||
*
|
||||
* related reference are still waiting to be resolved
|
||||
*
|
||||
* 06 08 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* hem_mbox is migrated.
|
||||
*
|
||||
* 06 08 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add hem_mbox.c and cnm_mem.h (but disabled some feature) for further migration
|
||||
*
|
||||
* 05 12 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Fix file merge error
|
||||
*
|
||||
* 05 12 2010 kevin.huang
|
||||
* [BORA00000794][WIFISYS][New Feature]Power Management Support
|
||||
* Add Power Management - Legacy PS-POLL support.
|
||||
*
|
||||
* 04 29 2010 tehuang.liu
|
||||
* [BORA00000605][WIFISYS] Phase3 Integration
|
||||
* Removed MID_RXM_MQM_QOS_ACTION_FRAME
|
||||
*
|
||||
* 04 29 2010 tehuang.liu
|
||||
* [BORA00000605][WIFISYS] Phase3 Integration
|
||||
* Removed MID_RXM_MQM_BA_ACTION_FRAME
|
||||
*
|
||||
* 04 27 2010 tehuang.liu
|
||||
* [BORA00000605][WIFISYS] Phase3 Integration
|
||||
* MID_RXM_MQM_BA_ACTION_FRAME
|
||||
*
|
||||
* 03 30 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Support 2.4G OBSS scan
|
||||
*
|
||||
* 03 16 2010 kevin.huang
|
||||
* [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
|
||||
* Add AdHoc Mode
|
||||
*
|
||||
* 03 10 2010 kevin.huang
|
||||
* [BORA00000654][WIFISYS][New Feature] CNM Module - Ch Manager Support
|
||||
*
|
||||
* * * * * * * * * * * * * * Add Channel Manager for arbitration of JOIN and SCAN Req
|
||||
*
|
||||
* 03 05 2010 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Develop partial DPD code
|
||||
*
|
||||
* 02 11 2010 tehuang.liu
|
||||
* [BORA00000569][WIFISYS] Phase 2 Integration Test
|
||||
* Updated arMsgMapTable for MID_RXM_MQM_QOS_ACTION_FRAME
|
||||
*
|
||||
* 01 11 2010 kevin.huang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* Add Deauth and Disassoc Handler
|
||||
*
|
||||
* Dec 9 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add hemRunEventScanDone() to arMsgMapTable[]
|
||||
*
|
||||
* Dec 4 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Fix mboxDummy() didn't free prMsgHdr
|
||||
*
|
||||
* Dec 3 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add saaAisJoinComplete event handler
|
||||
*
|
||||
* Dec 2 2009 MTK02468
|
||||
* [BORA00000337] To check in codes for FPGA emulation
|
||||
* Fixed the handler function name in arMsgMapTable for MID_RXM_MQM_BA_ACTION_FRAME
|
||||
*
|
||||
* Dec 2 2009 MTK02468
|
||||
* [BORA00000337] To check in codes for FPGA emulation
|
||||
* Added MID_RXM_MQM_BA_ACTION_FRAME to MsgMapTable
|
||||
*
|
||||
* Nov 23 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Revise MSG Handler (remove dummy and add for SAA)
|
||||
*
|
||||
* Nov 16 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add aisFsmRunEventAbort() event handler
|
||||
*
|
||||
* Nov 11 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Fix typo
|
||||
*
|
||||
* Nov 10 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add more MSG_HNDL_ENTRY_T to avoid ASSERT() in mboxInitMsgMap()
|
||||
*
|
||||
* Nov 5 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Add SCN message and function entry to arMsgMapTable[]
|
||||
*
|
||||
* Nov 2 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Fix sorting algorithm in mboxInitMsgMap()
|
||||
*
|
||||
* Oct 28 2009 mtk01104
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
**
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "precomp.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
#if DBG
|
||||
/*lint -save -e64 Type mismatch */
|
||||
static PUINT_8 apucDebugMsg[] = {
|
||||
(PUINT_8)DISP_STRING("MID_MNY_CNM_CH_REQ"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_CNM_CH_ABORT"),
|
||||
(PUINT_8)DISP_STRING("MID_CNM_AIS_CH_GRANT"),
|
||||
(PUINT_8)DISP_STRING("MID_CNM_P2P_CH_GRANT"),
|
||||
(PUINT_8)DISP_STRING("MID_CNM_BOW_CH_GRANT"),
|
||||
|
||||
(PUINT_8)DISP_STRING("MID_AIS_SCN_SCAN_REQ"),
|
||||
(PUINT_8)DISP_STRING("MID_AIS_SCN_SCAN_REQ_V2"),
|
||||
(PUINT_8)DISP_STRING("MID_AIS_SCN_SCAN_CANCEL"),
|
||||
(PUINT_8)DISP_STRING("MID_P2P_SCN_SCAN_REQ"),
|
||||
(PUINT_8)DISP_STRING("MID_P2P_SCN_SCAN_REQ_V2"),
|
||||
(PUINT_8)DISP_STRING("MID_P2P_SCN_SCAN_CANCEL"),
|
||||
(PUINT_8)DISP_STRING("MID_BOW_SCN_SCAN_REQ"),
|
||||
(PUINT_8)DISP_STRING("MID_BOW_SCN_SCAN_REQ_V2"),
|
||||
(PUINT_8)DISP_STRING("MID_BOW_SCN_SCAN_CANCEL"),
|
||||
(PUINT_8)DISP_STRING("MID_RLM_SCN_SCAN_REQ"),
|
||||
(PUINT_8)DISP_STRING("MID_RLM_SCN_SCAN_REQ_V2"),
|
||||
(PUINT_8)DISP_STRING("MID_RLM_SCN_SCAN_CANCEL"),
|
||||
(PUINT_8)DISP_STRING("MID_SCN_AIS_SCAN_DONE"),
|
||||
(PUINT_8)DISP_STRING("MID_SCN_P2P_SCAN_DONE"),
|
||||
(PUINT_8)DISP_STRING("MID_SCN_BOW_SCAN_DONE"),
|
||||
(PUINT_8)DISP_STRING("MID_SCN_RLM_SCAN_DONE"),
|
||||
|
||||
(PUINT_8)DISP_STRING("MID_OID_AIS_FSM_JOIN_REQ"),
|
||||
(PUINT_8)DISP_STRING("MID_OID_AIS_FSM_ABORT"),
|
||||
(PUINT_8)DISP_STRING("MID_AIS_SAA_FSM_START"),
|
||||
(PUINT_8)DISP_STRING("MID_AIS_SAA_FSM_ABORT"),
|
||||
(PUINT_8)DISP_STRING("MID_SAA_AIS_JOIN_COMPLETE"),
|
||||
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
(PUINT_8)DISP_STRING("MID_BOW_SAA_FSM_START"),
|
||||
(PUINT_8)DISP_STRING("MID_BOW_SAA_FSM_ABORT"),
|
||||
(PUINT_8)DISP_STRING("MID_SAA_BOW_JOIN_COMPLETE"),
|
||||
#endif
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
(PUINT_8)DISP_STRING("MID_P2P_SAA_FSM_START"),
|
||||
(PUINT_8)DISP_STRING("MID_P2P_SAA_FSM_ABORT"),
|
||||
(PUINT_8)DISP_STRING("MID_SAA_P2P_JOIN_COMPLETE"),
|
||||
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_FUN_SWITCH"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_DEVICE_DISCOVERY"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_CONNECTION_REQ"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_CONNECTION_ABORT"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_BEACON_UPDATE"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_STOP_AP"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_CHNL_REQ"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_CHNL_ABORT"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_MGMT_TX"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_GROUP_DISSOLVE"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_MGMT_FRAME_REGISTER"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_NET_DEV_REGISTER"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_START_AP"),
|
||||
(PUINT_8)DISP_STRING("MID_MNY_P2P_UPDATE_IE_BUF"),
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_ADHOC
|
||||
//(PUINT_8)DISP_STRING("MID_AIS_CNM_CREATE_IBSS_REQ"),
|
||||
//(PUINT_8)DISP_STRING("MID_CNM_AIS_CREATE_IBSS_GRANT"),
|
||||
//(PUINT_8)DISP_STRING("MID_AIS_CNM_MERGE_IBSS_REQ"),
|
||||
//(PUINT_8)DISP_STRING("MID_CNM_AIS_MERGE_IBSS_GRANT"),
|
||||
(PUINT_8)DISP_STRING("MID_SCN_AIS_FOUND_IBSS"),
|
||||
#endif /* CFG_SUPPORT_ADHOC */
|
||||
|
||||
(PUINT_8)DISP_STRING("MID_SAA_AIS_FSM_ABORT")
|
||||
};
|
||||
/*lint -restore */
|
||||
#endif /* DBG */
|
||||
|
||||
/* This message entry will be re-ordered based on the message ID order
|
||||
* by invoking mboxInitMsgMap()
|
||||
*/
|
||||
static MSG_HNDL_ENTRY_T arMsgMapTable[] = {
|
||||
{ MID_MNY_CNM_CH_REQ, cnmChMngrRequestPrivilege },
|
||||
{ MID_MNY_CNM_CH_ABORT, cnmChMngrAbortPrivilege },
|
||||
{ MID_CNM_AIS_CH_GRANT, aisFsmRunEventChGrant },
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
{ MID_CNM_P2P_CH_GRANT, p2pFsmRunEventChGrant }, /*set in gl_p2p_init.c*/
|
||||
#else
|
||||
{ MID_CNM_P2P_CH_GRANT, mboxDummy },
|
||||
#endif
|
||||
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
{ MID_CNM_BOW_CH_GRANT, bowRunEventChGrant },
|
||||
#else
|
||||
{ MID_CNM_BOW_CH_GRANT, mboxDummy },
|
||||
#endif
|
||||
|
||||
/*--------------------------------------------------*/
|
||||
/* SCN Module Mailbox Messages */
|
||||
/*--------------------------------------------------*/
|
||||
{ MID_AIS_SCN_SCAN_REQ, scnFsmMsgStart },
|
||||
{ MID_AIS_SCN_SCAN_REQ_V2, scnFsmMsgStart },
|
||||
{ MID_AIS_SCN_SCAN_CANCEL, scnFsmMsgAbort },
|
||||
{ MID_P2P_SCN_SCAN_REQ, scnFsmMsgStart },
|
||||
{ MID_P2P_SCN_SCAN_REQ_V2, scnFsmMsgStart },
|
||||
{ MID_P2P_SCN_SCAN_CANCEL, scnFsmMsgAbort },
|
||||
{ MID_BOW_SCN_SCAN_REQ, scnFsmMsgStart },
|
||||
{ MID_BOW_SCN_SCAN_REQ_V2, scnFsmMsgStart },
|
||||
{ MID_BOW_SCN_SCAN_CANCEL, scnFsmMsgAbort },
|
||||
{ MID_RLM_SCN_SCAN_REQ, scnFsmMsgStart },
|
||||
{ MID_RLM_SCN_SCAN_REQ_V2, scnFsmMsgStart },
|
||||
{ MID_RLM_SCN_SCAN_CANCEL, scnFsmMsgAbort },
|
||||
{ MID_SCN_AIS_SCAN_DONE, aisFsmRunEventScanDone },
|
||||
#if CFG_ENABLE_WIFI_DIRECT
|
||||
{ MID_SCN_P2P_SCAN_DONE, p2pFsmRunEventScanDone }, /*set in gl_p2p_init.c*/
|
||||
#else
|
||||
{ MID_SCN_P2P_SCAN_DONE, mboxDummy },
|
||||
#endif
|
||||
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
{ MID_SCN_BOW_SCAN_DONE, bowResponderScanDone },
|
||||
#else
|
||||
{ MID_SCN_BOW_SCAN_DONE, mboxDummy },
|
||||
#endif
|
||||
{ MID_SCN_RLM_SCAN_DONE, rlmObssScanDone },
|
||||
|
||||
/*--------------------------------------------------*/
|
||||
/* AIS Module Mailbox Messages */
|
||||
/*--------------------------------------------------*/
|
||||
{ MID_OID_AIS_FSM_JOIN_REQ, aisFsmRunEventAbort },
|
||||
{ MID_OID_AIS_FSM_ABORT, aisFsmRunEventAbort },
|
||||
{ MID_AIS_SAA_FSM_START, saaFsmRunEventStart },
|
||||
{ MID_AIS_SAA_FSM_ABORT, saaFsmRunEventAbort },
|
||||
{ MID_SAA_AIS_JOIN_COMPLETE, aisFsmRunEventJoinComplete },
|
||||
|
||||
#if CFG_ENABLE_BT_OVER_WIFI
|
||||
/*--------------------------------------------------*/
|
||||
/* BOW Module Mailbox Messages */
|
||||
/*--------------------------------------------------*/
|
||||
{ MID_BOW_SAA_FSM_START, saaFsmRunEventStart },
|
||||
{ MID_BOW_SAA_FSM_ABORT, saaFsmRunEventAbort },
|
||||
{ MID_SAA_BOW_JOIN_COMPLETE, bowFsmRunEventJoinComplete },
|
||||
#endif
|
||||
|
||||
#if CFG_ENABLE_WIFI_DIRECT /*set in gl_p2p_init.c*/
|
||||
{ MID_P2P_SAA_FSM_START, saaFsmRunEventStart },
|
||||
{ MID_P2P_SAA_FSM_ABORT, saaFsmRunEventAbort },
|
||||
{ MID_SAA_P2P_JOIN_COMPLETE, p2pFsmRunEventJoinComplete },// TODO: p2pFsmRunEventJoinComplete
|
||||
|
||||
{ MID_MNY_P2P_FUN_SWITCH, p2pFsmRunEventSwitchOPMode },
|
||||
{ MID_MNY_P2P_DEVICE_DISCOVERY, p2pFsmRunEventScanRequest },
|
||||
{ MID_MNY_P2P_CONNECTION_REQ, p2pFsmRunEventConnectionRequest },
|
||||
{ MID_MNY_P2P_CONNECTION_ABORT, p2pFsmRunEventConnectionAbort },
|
||||
{ MID_MNY_P2P_BEACON_UPDATE, p2pFsmRunEventBeaconUpdate },
|
||||
{ MID_MNY_P2P_STOP_AP, p2pFsmRunEventStopAP },
|
||||
{ MID_MNY_P2P_CHNL_REQ, p2pFsmRunEventChannelRequest },
|
||||
{ MID_MNY_P2P_CHNL_ABORT, p2pFsmRunEventChannelAbort },
|
||||
{ MID_MNY_P2P_MGMT_TX, p2pFsmRunEventMgmtFrameTx },
|
||||
{ MID_MNY_P2P_GROUP_DISSOLVE, p2pFsmRunEventDissolve },
|
||||
{ MID_MNY_P2P_MGMT_FRAME_REGISTER, p2pFsmRunEventMgmtFrameRegister },
|
||||
{ MID_MNY_P2P_NET_DEV_REGISTER, p2pFsmRunEventNetDeviceRegister },
|
||||
{ MID_MNY_P2P_START_AP, p2pFsmRunEventStartAP },
|
||||
{ MID_MNY_P2P_MGMT_FRAME_UPDATE, p2pFsmRunEventUpdateMgmtFrame },
|
||||
#if CFG_SUPPORT_WFD
|
||||
{ MID_MNY_P2P_WFD_CFG_UPDATE, p2pFsmRunEventWfdSettingUpdate },
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if CFG_SUPPORT_ADHOC
|
||||
{ MID_SCN_AIS_FOUND_IBSS, aisFsmRunEventFoundIBSSPeer },
|
||||
#endif /* CFG_SUPPORT_ADHOC */
|
||||
|
||||
{ MID_SAA_AIS_FSM_ABORT, aisFsmRunEventAbort }
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#if DBG
|
||||
#define MBOX_HNDL_MSG(prAdapter, prMsg) do { \
|
||||
ASSERT(arMsgMapTable[prMsg->eMsgId].pfMsgHndl); \
|
||||
if (arMsgMapTable[prMsg->eMsgId].pfMsgHndl) { \
|
||||
DBGLOG(CNM, LOUD, ("DO MSG [%d: %s]\n", prMsg->eMsgId, apucDebugMsg[prMsg->eMsgId])); \
|
||||
arMsgMapTable[prMsg->eMsgId].pfMsgHndl(prAdapter, prMsg); \
|
||||
} \
|
||||
else { \
|
||||
DBGLOG(CNM, ERROR, ("NULL fptr for MSG [%d]\n", prMsg->eMsgId)); \
|
||||
cnmMemFree(prAdapter, prMsg); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define MBOX_HNDL_MSG(prAdapter, prMsg) do { \
|
||||
ASSERT(arMsgMapTable[prMsg->eMsgId].pfMsgHndl); \
|
||||
if (arMsgMapTable[prMsg->eMsgId].pfMsgHndl) { \
|
||||
DBGLOG(CNM, LOUD, ("DO MSG [%d]\n", prMsg->eMsgId)); \
|
||||
arMsgMapTable[prMsg->eMsgId].pfMsgHndl(prAdapter, prMsg); \
|
||||
} \
|
||||
else { \
|
||||
DBGLOG(CNM, ERROR, ("NULL fptr for MSG [%d]\n", prMsg->eMsgId)); \
|
||||
cnmMemFree(prAdapter, prMsg); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
mboxInitMsgMap (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
UINT_32 i, idx;
|
||||
MSG_HNDL_ENTRY_T rTempEntry;
|
||||
|
||||
ASSERT((sizeof(arMsgMapTable) / sizeof(MSG_HNDL_ENTRY_T)) == MID_TOTAL_NUM);
|
||||
|
||||
for (i = 0; i < MID_TOTAL_NUM; i++) {
|
||||
if (arMsgMapTable[i].eMsgId == (ENUM_MSG_ID_T) i) {
|
||||
continue;
|
||||
}
|
||||
for (idx = i + 1; idx < MID_TOTAL_NUM; idx++) {
|
||||
if (arMsgMapTable[idx].eMsgId == (ENUM_MSG_ID_T) i) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
ASSERT(idx < MID_TOTAL_NUM);
|
||||
if (idx >= MID_TOTAL_NUM) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Swap target entry and current entry */
|
||||
rTempEntry.eMsgId = arMsgMapTable[idx].eMsgId;
|
||||
rTempEntry.pfMsgHndl= arMsgMapTable[idx].pfMsgHndl;
|
||||
|
||||
arMsgMapTable[idx].eMsgId = arMsgMapTable[i].eMsgId;
|
||||
arMsgMapTable[idx].pfMsgHndl = arMsgMapTable[i].pfMsgHndl;
|
||||
|
||||
arMsgMapTable[i].eMsgId = rTempEntry.eMsgId;
|
||||
arMsgMapTable[i].pfMsgHndl = rTempEntry.pfMsgHndl;
|
||||
}
|
||||
|
||||
/* Verify the correctness of final message map */
|
||||
for (i = 0; i < MID_TOTAL_NUM; i++) {
|
||||
ASSERT(arMsgMapTable[i].eMsgId == (ENUM_MSG_ID_T) i);
|
||||
while (arMsgMapTable[i].eMsgId != (ENUM_MSG_ID_T) i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
mboxSetup (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_MBOX_ID_T eMboxId
|
||||
)
|
||||
{
|
||||
P_MBOX_T prMbox;
|
||||
KAL_SPIN_LOCK_DECLARATION();
|
||||
|
||||
ASSERT(eMboxId < MBOX_ID_TOTAL_NUM);
|
||||
ASSERT(prAdapter);
|
||||
|
||||
prMbox = &(prAdapter->arMbox[eMboxId]);
|
||||
|
||||
KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX);
|
||||
LINK_INITIALIZE(&prMbox->rLinkHead);
|
||||
KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
mboxSendMsg (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_MBOX_ID_T eMboxId,
|
||||
IN P_MSG_HDR_T prMsg,
|
||||
IN EUNM_MSG_SEND_METHOD_T eMethod
|
||||
)
|
||||
{
|
||||
P_MBOX_T prMbox;
|
||||
KAL_SPIN_LOCK_DECLARATION();
|
||||
|
||||
ASSERT(eMboxId < MBOX_ID_TOTAL_NUM);
|
||||
ASSERT(prMsg);
|
||||
ASSERT(prAdapter);
|
||||
|
||||
prMbox = &(prAdapter->arMbox[eMboxId]);
|
||||
|
||||
switch (eMethod) {
|
||||
case MSG_SEND_METHOD_BUF:
|
||||
KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX);
|
||||
LINK_INSERT_TAIL(&prMbox->rLinkHead, &prMsg->rLinkEntry);
|
||||
KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX);
|
||||
|
||||
// to wake up main service thread
|
||||
GLUE_SET_EVENT(prAdapter->prGlueInfo);
|
||||
|
||||
break;
|
||||
|
||||
case MSG_SEND_METHOD_UNBUF:
|
||||
MBOX_HNDL_MSG(prAdapter, prMsg);
|
||||
break;
|
||||
|
||||
default:
|
||||
ASSERT(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
mboxRcvAllMsg (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
ENUM_MBOX_ID_T eMboxId
|
||||
)
|
||||
{
|
||||
P_MBOX_T prMbox;
|
||||
P_MSG_HDR_T prMsg;
|
||||
KAL_SPIN_LOCK_DECLARATION();
|
||||
|
||||
ASSERT(eMboxId < MBOX_ID_TOTAL_NUM);
|
||||
ASSERT(prAdapter);
|
||||
|
||||
prMbox = &(prAdapter->arMbox[eMboxId]);
|
||||
|
||||
while (!LINK_IS_EMPTY(&prMbox->rLinkHead) ) {
|
||||
KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX);
|
||||
LINK_REMOVE_HEAD(&prMbox->rLinkHead, prMsg, P_MSG_HDR_T);
|
||||
KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX);
|
||||
|
||||
ASSERT(prMsg);
|
||||
MBOX_HNDL_MSG(prAdapter, prMsg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
mboxInitialize (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
UINT_32 i;
|
||||
|
||||
ASSERT(prAdapter);
|
||||
|
||||
/* Initialize Mailbox */
|
||||
mboxInitMsgMap();
|
||||
|
||||
/* Setup/initialize each mailbox */
|
||||
for (i = 0; i < MBOX_ID_TOTAL_NUM; i++) {
|
||||
mboxSetup(prAdapter, i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
mboxDestroy (
|
||||
IN P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
P_MBOX_T prMbox;
|
||||
P_MSG_HDR_T prMsg;
|
||||
UINT_8 i;
|
||||
KAL_SPIN_LOCK_DECLARATION();
|
||||
|
||||
ASSERT(prAdapter);
|
||||
|
||||
for (i = 0; i < MBOX_ID_TOTAL_NUM; i++) {
|
||||
prMbox = &(prAdapter->arMbox[i]);
|
||||
|
||||
while (!LINK_IS_EMPTY(&prMbox->rLinkHead) ) {
|
||||
KAL_ACQUIRE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX);
|
||||
LINK_REMOVE_HEAD(&prMbox->rLinkHead, prMsg, P_MSG_HDR_T);
|
||||
KAL_RELEASE_SPIN_LOCK(prAdapter, SPIN_LOCK_MAILBOX);
|
||||
|
||||
ASSERT(prMsg);
|
||||
cnmMemFree(prAdapter, prMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief This is dummy function to prevent empty arMsgMapTable[] for compiling.
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
mboxDummy (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSG_HDR_T prMsgHdr
|
||||
)
|
||||
{
|
||||
ASSERT(prAdapter);
|
||||
|
||||
cnmMemFree(prAdapter, prMsgHdr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/mib.c#1 $
|
||||
*/
|
||||
|
||||
/*! \file "mib.c"
|
||||
\brief This file includes the mib default vale and functions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: mib.c $
|
||||
*
|
||||
* 09 03 2010 kevin.huang
|
||||
* NULL
|
||||
* Refine #include sequence and solve recursive/nested #include issue
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 07 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add mib.c.
|
||||
*
|
||||
* 02 04 2010 kevin.huang
|
||||
* [BORA00000603][WIFISYS] [New Feature] AAA Module Support
|
||||
* Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
|
||||
*
|
||||
* Nov 23 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "precomp.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
NON_HT_PHY_ATTRIBUTE_T rNonHTPhyAttributes[] = {
|
||||
{RATE_SET_HR_DSSS, TRUE, FALSE }, /* For PHY_TYPE_HR_DSSS_INDEX(0) */
|
||||
{RATE_SET_ERP, TRUE, TRUE }, /* For PHY_TYPE_ERP_INDEX(1) */
|
||||
{RATE_SET_ERP_P2P, TRUE, TRUE }, /* For PHY_TYPE_ERP_P2P_INDEX(2) */
|
||||
{RATE_SET_OFDM, FALSE, FALSE }, /* For PHY_TYPE_OFDM_INDEX(3) */
|
||||
};
|
||||
|
||||
NON_HT_ADHOC_MODE_ATTRIBUTE_T rNonHTAdHocModeAttributes[AD_HOC_MODE_NUM] = {
|
||||
{PHY_TYPE_HR_DSSS_INDEX, BASIC_RATE_SET_HR_DSSS}, /* For AD_HOC_MODE_11B(0) */
|
||||
{PHY_TYPE_ERP_INDEX, BASIC_RATE_SET_HR_DSSS_ERP}, /* For AD_HOC_MODE_MIXED_11BG(1) */
|
||||
{PHY_TYPE_ERP_INDEX, BASIC_RATE_SET_ERP}, /* For AD_HOC_MODE_11G(2) */
|
||||
{PHY_TYPE_OFDM_INDEX, BASIC_RATE_SET_OFDM}, /* For AD_HOC_MODE_11A(3) */
|
||||
};
|
||||
|
||||
NON_HT_AP_MODE_ATTRIBUTE_T rNonHTApModeAttributes[AP_MODE_NUM] = {
|
||||
{PHY_TYPE_HR_DSSS_INDEX, BASIC_RATE_SET_HR_DSSS}, /* For AP_MODE_11B(0) */
|
||||
{PHY_TYPE_ERP_INDEX, BASIC_RATE_SET_HR_DSSS_ERP}, /* For AP_MODE_MIXED_11BG(1) */
|
||||
{PHY_TYPE_ERP_INDEX, BASIC_RATE_SET_ERP}, /* For AP_MODE_11G(2) */
|
||||
{PHY_TYPE_ERP_P2P_INDEX, BASIC_RATE_SET_ERP_P2P}, /* For AP_MODE_11G_P2P(3) */
|
||||
{PHY_TYPE_OFDM_INDEX, BASIC_RATE_SET_OFDM}, /* For AP_MODE_11A(4) */
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
** $Id: @(#) p2p_assoc.c@@
|
||||
*/
|
||||
|
||||
/*! \file "p2p_assoc.c"
|
||||
\brief This file includes the Wi-Fi Direct association-related functions.
|
||||
|
||||
This file includes the association-related functions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief This function is used to compose Common Information Elements for P2P Association
|
||||
* Request Frame.
|
||||
*
|
||||
* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T.
|
||||
*
|
||||
* @return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
PUINT_8
|
||||
p2pBuildReAssocReqFrameCommonIEs(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo,
|
||||
IN PUINT_8 pucBuffer
|
||||
)
|
||||
{
|
||||
P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
|
||||
|
||||
prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings;
|
||||
|
||||
/* Fill the SSID element. */
|
||||
SSID_IE(pucBuffer)->ucId = ELEM_ID_SSID;
|
||||
|
||||
/* NOTE(Kevin): We copy the SSID from CONNECTION_SETTINGS for the case of
|
||||
* Passive Scan and the target BSS didn't broadcast SSID on its Beacon Frame.
|
||||
*/
|
||||
|
||||
COPY_SSID(SSID_IE(pucBuffer)->aucSSID,
|
||||
SSID_IE(pucBuffer)->ucLength,
|
||||
prP2pConnSettings->aucSSID,
|
||||
prP2pConnSettings->ucSSIDLen);
|
||||
|
||||
prMsduInfo->u2FrameLength += IE_SIZE(pucBuffer);
|
||||
pucBuffer += IE_SIZE(pucBuffer);
|
||||
return pucBuffer;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
** $Id: @(#) p2p_bss.c@@
|
||||
*/
|
||||
|
||||
/*! \file "p2p_bss.c"
|
||||
\brief This file contains the functions for creating p2p BSS(AP).
|
||||
|
||||
This file contains the functions for BSS(AP). We may create a BSS
|
||||
network, or merge with exist IBSS network and sending Beacon Frame or reply
|
||||
the Probe Response Frame for received Probe Request Frame.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,582 +0,0 @@
|
|||
#include "p2p_precomp.h"
|
||||
|
||||
#if CFG_SUPPORT_WFD
|
||||
#if CFG_SUPPORT_WFD_COMPOSE_IE
|
||||
#if 0
|
||||
APPEND_VAR_ATTRI_ENTRY_T txProbeRspWFDAttributesTable[] = {
|
||||
{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_DEV_INFO) , NULL, wfdFuncAppendAttriDevInfo } /* 0 */
|
||||
,{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_ASSOC_BSSID), NULL, wfdFuncAppendAttriAssocBssid } /* 1 */
|
||||
,{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_COUPLED_SINK_INFO), NULL, wfdFuncAppendAttriCoupledSinkInfo } /* 6 */
|
||||
,{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_EXT_CAPABILITY), NULL, wfdFuncAppendAttriExtCapability } /* 7 */
|
||||
,{ 0, wfdFuncCalculateAttriLenSessionInfo, wfdFuncAppendAttriSessionInfo } /* 9 */
|
||||
};
|
||||
|
||||
APPEND_VAR_ATTRI_ENTRY_T txBeaconWFDAttributesTable[] = {
|
||||
{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_DEV_INFO) , NULL, wfdFuncAppendAttriDevInfo } /* 0 */
|
||||
,{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_ASSOC_BSSID), NULL, wfdFuncAppendAttriAssocBssid } /* 1 */
|
||||
,{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_COUPLED_SINK_INFO), NULL, wfdFuncAppendAttriCoupledSinkInfo } /* 6 */
|
||||
};
|
||||
|
||||
APPEND_VAR_ATTRI_ENTRY_T txAssocReqWFDAttributesTable[] = {
|
||||
{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_DEV_INFO) , NULL, wfdFuncAppendAttriDevInfo } /* 0 */
|
||||
,{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_ASSOC_BSSID), NULL, wfdFuncAppendAttriAssocBssid } /* 1 */
|
||||
,{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_COUPLED_SINK_INFO), NULL, wfdFuncAppendAttriCoupledSinkInfo } /* 6 */
|
||||
};
|
||||
#endif
|
||||
|
||||
APPEND_VAR_ATTRI_ENTRY_T txAssocRspWFDAttributesTable[] = {
|
||||
{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_DEV_INFO) , NULL, wfdFuncAppendAttriDevInfo } /* 0 */
|
||||
,{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_ASSOC_BSSID), NULL, wfdFuncAppendAttriAssocBssid } /* 1 */
|
||||
,{ (WFD_ATTRI_HDR_LEN + WFD_ATTRI_MAX_LEN_COUPLED_SINK_INFO), NULL, wfdFuncAppendAttriCoupledSinkInfo } /* 6 */
|
||||
,{ 0, wfdFuncCalculateAttriLenSessionInfo, wfdFuncAppendAttriSessionInfo } /* 9 */
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
UINT_32
|
||||
p2pCalculate_IEForAssocReq (
|
||||
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
)
|
||||
{
|
||||
P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL;
|
||||
P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo = (P_P2P_CONNECTION_REQ_INFO_T)NULL;
|
||||
UINT_32 u4RetValue = 0;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((eNetTypeIndex == NETWORK_TYPE_P2P_INDEX) && (prAdapter != NULL));
|
||||
|
||||
prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo;
|
||||
|
||||
prConnReqInfo = &(prP2pFsmInfo->rConnReqInfo);
|
||||
|
||||
u4RetValue = prConnReqInfo->u4BufLength;
|
||||
|
||||
// ADD HT Capability
|
||||
u4RetValue += (ELEM_HDR_LEN + ELEM_MAX_LEN_HT_CAP);
|
||||
|
||||
// ADD WMM Information Element
|
||||
u4RetValue += (ELEM_HDR_LEN + ELEM_MAX_LEN_WMM_INFO);
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return u4RetValue;
|
||||
} /* p2pCalculate_IEForAssocReq */
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief This function is used to generate P2P IE for Beacon frame.
|
||||
*
|
||||
* @param[in] prMsduInfo Pointer to the composed MSDU_INFO_T.
|
||||
*
|
||||
* @return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
p2pGenerate_IEForAssocReq (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
)
|
||||
{
|
||||
P_P2P_FSM_INFO_T prP2pFsmInfo = (P_P2P_FSM_INFO_T)NULL;
|
||||
P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo = (P_P2P_CONNECTION_REQ_INFO_T)NULL;
|
||||
PUINT_8 pucIEBuf = (PUINT_8)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (prMsduInfo != NULL));
|
||||
|
||||
prP2pFsmInfo = prAdapter->rWifiVar.prP2pFsmInfo;
|
||||
|
||||
prConnReqInfo = &(prP2pFsmInfo->rConnReqInfo);
|
||||
|
||||
pucIEBuf = (PUINT_8)((UINT_32)prMsduInfo->prPacket + (UINT_32)prMsduInfo->u2FrameLength);
|
||||
|
||||
kalMemCopy(pucIEBuf, prConnReqInfo->aucIEBuf, prConnReqInfo->u4BufLength);
|
||||
|
||||
prMsduInfo->u2FrameLength += prConnReqInfo->u4BufLength;
|
||||
|
||||
rlmReqGenerateHtCapIE (prAdapter,prMsduInfo);
|
||||
mqmGenerateWmmInfoIE (prAdapter,prMsduInfo);
|
||||
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return;
|
||||
|
||||
} /* p2pGenerate_IEForAssocReq */
|
||||
|
||||
|
||||
|
||||
UINT_32
|
||||
wfdFuncAppendAttriDevInfo (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
)
|
||||
{
|
||||
UINT_32 u4AttriLen = 0;
|
||||
PUINT_8 pucBuffer = NULL;
|
||||
P_WFD_DEVICE_INFORMATION_IE_T prWfdDevInfo = (P_WFD_DEVICE_INFORMATION_IE_T)NULL;
|
||||
P_WFD_CFG_SETTINGS_T prWfdCfgSettings = (P_WFD_CFG_SETTINGS_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (pucBuf != NULL) && (pu2Offset != NULL));
|
||||
|
||||
prWfdCfgSettings = &(prAdapter->rWifiVar.prP2pFsmInfo->rWfdConfigureSettings);
|
||||
|
||||
ASSERT_BREAK((prWfdCfgSettings != NULL));
|
||||
|
||||
if ((prWfdCfgSettings->ucWfdEnable == 0) ||
|
||||
((prWfdCfgSettings->u4WfdFlag & WFD_FLAGS_DEV_INFO_VALID) == 0)) {
|
||||
break;
|
||||
}
|
||||
|
||||
pucBuffer = (PUINT_8)((UINT_32)pucBuf + (UINT_32)(*pu2Offset));
|
||||
|
||||
ASSERT_BREAK(pucBuffer != NULL);
|
||||
|
||||
prWfdDevInfo = (P_WFD_DEVICE_INFORMATION_IE_T)pucBuffer;
|
||||
|
||||
prWfdDevInfo->ucElemID = WFD_ATTRI_ID_DEV_INFO;
|
||||
|
||||
WLAN_SET_FIELD_BE16(&prWfdDevInfo->u2WfdDevInfo, prWfdCfgSettings->u2WfdDevInfo);
|
||||
|
||||
WLAN_SET_FIELD_BE16(&prWfdDevInfo->u2SessionMgmtCtrlPort, prWfdCfgSettings->u2WfdControlPort);
|
||||
|
||||
WLAN_SET_FIELD_BE16(&prWfdDevInfo->u2WfdDevMaxSpeed, prWfdCfgSettings->u2WfdMaximumTp);
|
||||
|
||||
WLAN_SET_FIELD_BE16(&prWfdDevInfo->u2Length, WFD_ATTRI_MAX_LEN_DEV_INFO);
|
||||
|
||||
u4AttriLen = WFD_ATTRI_MAX_LEN_DEV_INFO + WFD_ATTRI_HDR_LEN;
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
(*pu2Offset) += (UINT_16)u4AttriLen;
|
||||
|
||||
return u4AttriLen;
|
||||
}
|
||||
/* wfdFuncAppendAttriDevInfo */
|
||||
|
||||
UINT_32
|
||||
wfdFuncAppendAttriAssocBssid (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
)
|
||||
{
|
||||
UINT_32 u4AttriLen = 0;
|
||||
PUINT_8 pucBuffer = NULL;
|
||||
P_WFD_ASSOCIATED_BSSID_IE_T prWfdAssocBssid = (P_WFD_ASSOCIATED_BSSID_IE_T)NULL;
|
||||
P_WFD_CFG_SETTINGS_T prWfdCfgSettings = (P_WFD_CFG_SETTINGS_T)NULL;
|
||||
P_BSS_INFO_T prAisBssInfo = (P_BSS_INFO_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (pucBuf != NULL) && (pu2Offset != NULL));
|
||||
|
||||
prWfdCfgSettings = &(prAdapter->rWifiVar.prP2pFsmInfo->rWfdConfigureSettings);
|
||||
|
||||
ASSERT_BREAK((prWfdCfgSettings != NULL));
|
||||
|
||||
if (prWfdCfgSettings->ucWfdEnable == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
/* AIS network. */
|
||||
prAisBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_AIS_INDEX]);
|
||||
|
||||
if ((!IS_NET_ACTIVE(prAdapter, NETWORK_TYPE_AIS_INDEX)) ||
|
||||
(prAisBssInfo->eConnectionState != PARAM_MEDIA_STATE_CONNECTED)) {
|
||||
break;
|
||||
}
|
||||
|
||||
pucBuffer = (PUINT_8)((UINT_32)pucBuf + (UINT_32)(*pu2Offset));
|
||||
|
||||
ASSERT_BREAK(pucBuffer != NULL);
|
||||
|
||||
prWfdAssocBssid = (P_WFD_ASSOCIATED_BSSID_IE_T)pucBuffer;
|
||||
|
||||
prWfdAssocBssid->ucElemID = WFD_ATTRI_ID_ASSOC_BSSID;
|
||||
|
||||
WLAN_SET_FIELD_BE16(&prWfdAssocBssid->u2Length, WFD_ATTRI_MAX_LEN_ASSOC_BSSID);
|
||||
|
||||
COPY_MAC_ADDR(prWfdAssocBssid->aucAssocBssid, prAisBssInfo->aucBSSID);
|
||||
|
||||
u4AttriLen = WFD_ATTRI_MAX_LEN_ASSOC_BSSID + WFD_ATTRI_HDR_LEN;
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
(*pu2Offset) += (UINT_16)u4AttriLen;
|
||||
|
||||
return u4AttriLen;
|
||||
}
|
||||
/* wfdFuncAppendAttriAssocBssid */
|
||||
|
||||
UINT_32
|
||||
wfdFuncAppendAttriCoupledSinkInfo (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
)
|
||||
{
|
||||
UINT_32 u4AttriLen = 0;
|
||||
PUINT_8 pucBuffer = NULL;
|
||||
P_WFD_COUPLE_SINK_INFORMATION_IE_T prWfdCoupleSinkInfo = (P_WFD_COUPLE_SINK_INFORMATION_IE_T)NULL;
|
||||
P_WFD_CFG_SETTINGS_T prWfdCfgSettings = (P_WFD_CFG_SETTINGS_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (pucBuf != NULL) && (pu2Offset != NULL));
|
||||
|
||||
prWfdCfgSettings = &(prAdapter->rWifiVar.prP2pFsmInfo->rWfdConfigureSettings);
|
||||
|
||||
ASSERT_BREAK((prWfdCfgSettings != NULL));
|
||||
|
||||
if ((prWfdCfgSettings->ucWfdEnable == 0) ||
|
||||
((prWfdCfgSettings->u4WfdFlag & WFD_FLAGS_SINK_INFO_VALID) == 0)) {
|
||||
break;
|
||||
}
|
||||
|
||||
pucBuffer = (PUINT_8)((UINT_32)pucBuf + (UINT_32)(*pu2Offset));
|
||||
|
||||
ASSERT_BREAK(pucBuffer != NULL);
|
||||
|
||||
prWfdCoupleSinkInfo = (P_WFD_COUPLE_SINK_INFORMATION_IE_T)pucBuffer;
|
||||
|
||||
prWfdCoupleSinkInfo->ucElemID = WFD_ATTRI_ID_COUPLED_SINK_INFO;
|
||||
|
||||
WLAN_SET_FIELD_BE16(&prWfdCoupleSinkInfo->u2Length, WFD_ATTRI_MAX_LEN_COUPLED_SINK_INFO);
|
||||
|
||||
COPY_MAC_ADDR(prWfdCoupleSinkInfo->aucCoupleSinkMac, prWfdCfgSettings->aucWfdCoupleSinkAddress);
|
||||
|
||||
prWfdCoupleSinkInfo->ucCoupleSinkStatusBp = prWfdCfgSettings->ucWfdCoupleSinkStatus;
|
||||
|
||||
u4AttriLen = WFD_ATTRI_MAX_LEN_COUPLED_SINK_INFO + WFD_ATTRI_HDR_LEN;
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
(*pu2Offset) += (UINT_16)u4AttriLen;
|
||||
|
||||
return u4AttriLen;
|
||||
}
|
||||
/* wfdFuncAppendAttriCoupledSinkInfo */
|
||||
|
||||
UINT_32
|
||||
wfdFuncAppendAttriExtCapability (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
)
|
||||
{
|
||||
UINT_32 u4AttriLen = 0;
|
||||
PUINT_8 pucBuffer = NULL;
|
||||
P_WFD_EXTENDED_CAPABILITY_IE_T prWfdExtCapability = (P_WFD_EXTENDED_CAPABILITY_IE_T)NULL;
|
||||
P_WFD_CFG_SETTINGS_T prWfdCfgSettings = (P_WFD_CFG_SETTINGS_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (pucBuf != NULL) && (pu2Offset != NULL));
|
||||
|
||||
prWfdCfgSettings = &(prAdapter->rWifiVar.prP2pFsmInfo->rWfdConfigureSettings);
|
||||
|
||||
ASSERT_BREAK((prWfdCfgSettings != NULL));
|
||||
|
||||
if ((prWfdCfgSettings->ucWfdEnable == 0) ||
|
||||
((prWfdCfgSettings->u4WfdFlag & WFD_FLAGS_EXT_CAPABILITY_VALID) == 0)) {
|
||||
break;
|
||||
}
|
||||
|
||||
pucBuffer = (PUINT_8)((UINT_32)pucBuf + (UINT_32)(*pu2Offset));
|
||||
|
||||
ASSERT_BREAK(pucBuffer != NULL);
|
||||
|
||||
prWfdExtCapability = (P_WFD_EXTENDED_CAPABILITY_IE_T)pucBuffer;
|
||||
|
||||
prWfdExtCapability->ucElemID = WFD_ATTRI_ID_EXT_CAPABILITY;
|
||||
|
||||
WLAN_SET_FIELD_BE16(&prWfdExtCapability->u2Length, WFD_ATTRI_MAX_LEN_EXT_CAPABILITY);
|
||||
|
||||
WLAN_SET_FIELD_BE16(&prWfdExtCapability->u2WfdExtCapabilityBp, prWfdCfgSettings->u2WfdExtendCap);
|
||||
|
||||
u4AttriLen = WFD_ATTRI_MAX_LEN_EXT_CAPABILITY + WFD_ATTRI_HDR_LEN;
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
(*pu2Offset) += (UINT_16)u4AttriLen;
|
||||
|
||||
return u4AttriLen;
|
||||
}
|
||||
/* wfdFuncAppendAttriExtCapability */
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief This function is used to calculate length of Channel List Attribute
|
||||
*
|
||||
* @param[in] prStaRec Pointer to the STA_RECORD_T
|
||||
*
|
||||
* @return The length of Attribute added
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
UINT_32
|
||||
wfdFuncCalculateAttriLenSessionInfo (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
)
|
||||
{
|
||||
UINT_16 u2AttriLen = 0;
|
||||
P_WFD_CFG_SETTINGS_T prWfdCfgSettings = (P_WFD_CFG_SETTINGS_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (prStaRec != NULL));
|
||||
|
||||
prWfdCfgSettings = &(prAdapter->rWifiVar.prP2pFsmInfo->rWfdConfigureSettings);
|
||||
|
||||
if (prWfdCfgSettings->ucWfdEnable == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
u2AttriLen = prWfdCfgSettings->u2WfdSessionInformationIELen + WFD_ATTRI_HDR_LEN;
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
|
||||
return (UINT_32)u2AttriLen;
|
||||
|
||||
} /* wfdFuncCalculateAttriLenSessionInfo */
|
||||
|
||||
|
||||
UINT_32
|
||||
wfdFuncAppendAttriSessionInfo (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize
|
||||
)
|
||||
{
|
||||
UINT_32 u4AttriLen = 0;
|
||||
PUINT_8 pucBuffer = NULL;
|
||||
P_WFD_SESSION_INFORMATION_IE_T prWfdSessionInfo = (P_WFD_SESSION_INFORMATION_IE_T)NULL;
|
||||
P_WFD_CFG_SETTINGS_T prWfdCfgSettings = (P_WFD_CFG_SETTINGS_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (pucBuf != NULL) && (pu2Offset != NULL));
|
||||
|
||||
prWfdCfgSettings = &(prAdapter->rWifiVar.prP2pFsmInfo->rWfdConfigureSettings);
|
||||
|
||||
ASSERT_BREAK((prWfdCfgSettings != NULL));
|
||||
|
||||
if ((prWfdCfgSettings->ucWfdEnable == 0) || (prWfdCfgSettings->u2WfdSessionInformationIELen == 0)) {
|
||||
break;
|
||||
}
|
||||
|
||||
pucBuffer = (PUINT_8)((UINT_32)pucBuf + (UINT_32)(*pu2Offset));
|
||||
|
||||
ASSERT_BREAK(pucBuffer != NULL);
|
||||
|
||||
prWfdSessionInfo = (P_WFD_SESSION_INFORMATION_IE_T)pucBuffer;
|
||||
|
||||
prWfdSessionInfo->ucElemID = WFD_ATTRI_ID_SESSION_INFO;
|
||||
|
||||
// TODO: Check endian issue?
|
||||
kalMemCopy(prWfdSessionInfo->pucWfdDevInfoDesc, prWfdCfgSettings->aucWfdSessionInformationIE, prWfdCfgSettings->u2WfdSessionInformationIELen);
|
||||
|
||||
WLAN_SET_FIELD_16(&prWfdSessionInfo->u2Length, prWfdCfgSettings->u2WfdSessionInformationIELen);
|
||||
|
||||
u4AttriLen = prWfdCfgSettings->u2WfdSessionInformationIELen + WFD_ATTRI_HDR_LEN;
|
||||
|
||||
}
|
||||
while (FALSE);
|
||||
|
||||
(*pu2Offset) += (UINT_16)u4AttriLen;
|
||||
|
||||
return u4AttriLen;
|
||||
}
|
||||
/* wfdFuncAppendAttriSessionInfo */
|
||||
|
||||
|
||||
|
||||
#if CFG_SUPPORT_WFD_COMPOSE_IE
|
||||
VOID
|
||||
wfdFuncGenerateWfd_IE (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN BOOLEAN fgIsAssocFrame,
|
||||
IN PUINT_16 pu2Offset,
|
||||
IN PUINT_8 pucBuf,
|
||||
IN UINT_16 u2BufSize,
|
||||
IN APPEND_VAR_ATTRI_ENTRY_T arAppendAttriTable[],
|
||||
IN UINT_32 u4AttriTableSize
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
PUINT_8 pucBuffer = (PUINT_8)NULL;
|
||||
P_IE_WFD_T prIeWFD = (P_IE_WFD_T)NULL;
|
||||
UINT_32 u4OverallAttriLen;
|
||||
UINT_32 u4AttriLen;
|
||||
UINT_8 aucWfaOui[] = VENDOR_OUI_WFA_SPECIFIC;
|
||||
UINT_8 aucTempBuffer[P2P_MAXIMUM_ATTRIBUTE_LEN];
|
||||
UINT_32 i;
|
||||
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (pucBuf != NULL));
|
||||
|
||||
pucBuffer = (PUINT_8)((UINT_32)pucBuf + (*pu2Offset));
|
||||
|
||||
ASSERT_BREAK(pucBuffer != NULL);
|
||||
|
||||
/* Check buffer length is still enough. */
|
||||
ASSERT_BREAK((u2BufSize - (*pu2Offset)) >= WFD_IE_OUI_HDR);
|
||||
|
||||
prIeWFD = (P_IE_WFD_T)pucBuffer;
|
||||
|
||||
prIeWFD->ucId = ELEM_ID_WFD;
|
||||
|
||||
prIeWFD->aucOui[0] = aucWfaOui[0];
|
||||
prIeWFD->aucOui[1] = aucWfaOui[1];
|
||||
prIeWFD->aucOui[2] = aucWfaOui[2];
|
||||
prIeWFD->ucOuiType = VENDOR_OUI_TYPE_WFD;
|
||||
|
||||
(*pu2Offset) += WFD_IE_OUI_HDR;
|
||||
|
||||
/* Overall length of all Attributes */
|
||||
u4OverallAttriLen = 0;
|
||||
|
||||
for (i = 0; i < u4AttriTableSize; i++) {
|
||||
|
||||
if (arAppendAttriTable[i].pfnAppendAttri) {
|
||||
u4AttriLen = arAppendAttriTable[i].pfnAppendAttri(prAdapter, fgIsAssocFrame, pu2Offset, pucBuf, u2BufSize);
|
||||
|
||||
u4OverallAttriLen += u4AttriLen;
|
||||
|
||||
if (u4OverallAttriLen > P2P_MAXIMUM_ATTRIBUTE_LEN) {
|
||||
u4OverallAttriLen -= P2P_MAXIMUM_ATTRIBUTE_LEN;
|
||||
|
||||
prIeWFD->ucLength = (VENDOR_OUI_TYPE_LEN + P2P_MAXIMUM_ATTRIBUTE_LEN);
|
||||
|
||||
pucBuffer = (PUINT_8)((UINT_32)prIeWFD + (WFD_IE_OUI_HDR + P2P_MAXIMUM_ATTRIBUTE_LEN));
|
||||
|
||||
prIeWFD = (P_IE_WFD_T)((UINT_32)prIeWFD + (WFD_IE_OUI_HDR + P2P_MAXIMUM_ATTRIBUTE_LEN));
|
||||
|
||||
kalMemCopy(aucTempBuffer, pucBuffer, u4OverallAttriLen);
|
||||
|
||||
prIeWFD->ucId = ELEM_ID_WFD;
|
||||
|
||||
prIeWFD->aucOui[0] = aucWfaOui[0];
|
||||
prIeWFD->aucOui[1] = aucWfaOui[1];
|
||||
prIeWFD->aucOui[2] = aucWfaOui[2];
|
||||
prIeWFD->ucOuiType = VENDOR_OUI_TYPE_WFD;
|
||||
|
||||
kalMemCopy(prIeWFD->aucWFDAttributes, aucTempBuffer, u4OverallAttriLen);
|
||||
(*pu2Offset) += WFD_IE_OUI_HDR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
prIeWFD->ucLength = (UINT_8)(VENDOR_OUI_TYPE_LEN + u4OverallAttriLen);
|
||||
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return;
|
||||
} /* wfdFuncGenerateWfd_IE */
|
||||
|
||||
#endif /* CFG_SUPPORT_WFD_COMPOSE_IE */
|
||||
|
||||
|
||||
|
||||
|
||||
UINT_32
|
||||
wfdFuncCalculateWfdIELenForAssocRsp (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN ENUM_NETWORK_TYPE_INDEX_T eNetTypeIndex,
|
||||
IN P_STA_RECORD_T prStaRec
|
||||
)
|
||||
{
|
||||
|
||||
#if CFG_SUPPORT_WFD_COMPOSE_IE
|
||||
P_WFD_CFG_SETTINGS_T prWfdCfgSettings = (P_WFD_CFG_SETTINGS_T)NULL;
|
||||
|
||||
prWfdCfgSettings = &(prAdapter->rWifiVar.prP2pFsmInfo->rWfdConfigureSettings);
|
||||
|
||||
if (
|
||||
!IS_STA_P2P_TYPE(prStaRec) ||
|
||||
(prWfdCfgSettings->ucWfdEnable == 0)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return p2pFuncCalculateP2P_IELen(prAdapter,
|
||||
eNetTypeIndex,
|
||||
prStaRec,
|
||||
txAssocRspWFDAttributesTable,
|
||||
sizeof(txAssocRspWFDAttributesTable)/sizeof(APPEND_VAR_ATTRI_ENTRY_T));
|
||||
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
} /* wfdFuncCalculateWfdIELenForAssocRsp */
|
||||
|
||||
|
||||
|
||||
VOID
|
||||
wfdFuncGenerateWfdIEForAssocRsp (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_MSDU_INFO_T prMsduInfo
|
||||
)
|
||||
{
|
||||
|
||||
#if CFG_SUPPORT_WFD_COMPOSE_IE
|
||||
P_WFD_CFG_SETTINGS_T prWfdCfgSettings = (P_WFD_CFG_SETTINGS_T)NULL;
|
||||
P_STA_RECORD_T prStaRec;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prMsduInfo != NULL) && (prAdapter != NULL));
|
||||
|
||||
prWfdCfgSettings = &(prAdapter->rWifiVar.prP2pFsmInfo->rWfdConfigureSettings);
|
||||
prStaRec = cnmGetStaRecByIndex(prAdapter, prMsduInfo->ucStaRecIndex);
|
||||
|
||||
if (IS_STA_P2P_TYPE(prStaRec)) {
|
||||
|
||||
if (prWfdCfgSettings->ucWfdEnable == 0) {
|
||||
break;
|
||||
}
|
||||
if((prWfdCfgSettings->u4WfdFlag & WFD_FLAGS_DEV_INFO_VALID) == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
wfdFuncGenerateWfd_IE(prAdapter,
|
||||
FALSE,
|
||||
&prMsduInfo->u2FrameLength,
|
||||
prMsduInfo->prPacket,
|
||||
1500,
|
||||
txAssocRspWFDAttributesTable,
|
||||
sizeof(txAssocRspWFDAttributesTable)/sizeof(APPEND_VAR_ATTRI_ENTRY_T));
|
||||
}
|
||||
} while (FALSE);
|
||||
|
||||
return;
|
||||
#else
|
||||
|
||||
return;
|
||||
#endif
|
||||
} /* wfdFuncGenerateWfdIEForAssocRsp */
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,374 +0,0 @@
|
|||
/*
|
||||
** $Id: @(#) gl_p2p_cfg80211.c@@
|
||||
*/
|
||||
|
||||
/*! \file gl_p2p_cfg80211.c
|
||||
\brief Main routines of Linux driver interface for Wi-Fi Direct
|
||||
using cfg80211 interface
|
||||
|
||||
This file contains the main routines of Linux driver for MediaTek Inc. 802.11
|
||||
Wireless LAN Adapters.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
|
||||
static UINT_8
|
||||
rlmObssChnlLevelIn2G4 (
|
||||
P_BSS_INFO_T prBssInfo,
|
||||
UINT_8 ucPriChannel,
|
||||
ENUM_CHNL_EXT_T eExtend
|
||||
);
|
||||
|
||||
static UINT_8
|
||||
rlmObssChnlLevelIn5G (
|
||||
P_BSS_INFO_T prBssInfo,
|
||||
UINT_8 ucPriChannel,
|
||||
ENUM_CHNL_EXT_T eExtend
|
||||
);
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief Different concurrent network has itself channel lists, and
|
||||
* concurrent networks should have been recorded in channel lists.
|
||||
* If role of active P2P is GO, assume associated AP of AIS will
|
||||
* record our Beacon for P2P GO because of same channel.
|
||||
*
|
||||
* Note: If we have scenario of different channel in the future,
|
||||
* the internal FW communication channel shall be established.
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
UINT_8
|
||||
rlmObssChnlLevel (
|
||||
P_BSS_INFO_T prBssInfo,
|
||||
ENUM_BAND_T eBand,
|
||||
UINT_8 ucPriChannel,
|
||||
ENUM_CHNL_EXT_T eExtend
|
||||
)
|
||||
{
|
||||
UINT_8 ucChannelLevel;
|
||||
|
||||
ASSERT(prBssInfo);
|
||||
|
||||
if (eBand == BAND_2G4) {
|
||||
ucChannelLevel = rlmObssChnlLevelIn2G4(prBssInfo, ucPriChannel,eExtend);
|
||||
|
||||
/* (TBD) If concurrent networks permit different channel, extra
|
||||
* channel judgement should be added. Please refer to
|
||||
* previous version of this file.
|
||||
*/
|
||||
}
|
||||
else if (eBand == BAND_5G) {
|
||||
ucChannelLevel = rlmObssChnlLevelIn5G(prBssInfo, ucPriChannel,eExtend);
|
||||
|
||||
/* (TBD) If concurrent networks permit different channel, extra
|
||||
* channel judgement should be added. Please refer to
|
||||
* previous version of this file.
|
||||
*/
|
||||
}
|
||||
else {
|
||||
ucChannelLevel = CHNL_LEVEL0;
|
||||
}
|
||||
|
||||
return ucChannelLevel;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
static UINT_8
|
||||
rlmObssChnlLevelIn2G4 (
|
||||
P_BSS_INFO_T prBssInfo,
|
||||
UINT_8 ucPriChannel,
|
||||
ENUM_CHNL_EXT_T eExtend
|
||||
)
|
||||
{
|
||||
UINT_8 i, ucChannelLevel;
|
||||
UINT_8 ucSecChannel, ucCenterChannel;
|
||||
UINT_8 ucAffectedChnl_L, ucAffectedChnl_H;
|
||||
|
||||
ASSERT(prBssInfo);
|
||||
|
||||
ucChannelLevel = CHNL_LEVEL2;
|
||||
|
||||
/* Calculate center channel for 2.4G band */
|
||||
if (eExtend == CHNL_EXT_SCA) {
|
||||
ucCenterChannel = ucPriChannel + 2;
|
||||
ucSecChannel = ucPriChannel + 4;
|
||||
}
|
||||
else if (eExtend == CHNL_EXT_SCB) {
|
||||
ucCenterChannel = ucPriChannel - 2;
|
||||
ucSecChannel = ucPriChannel - 4;
|
||||
}
|
||||
else {
|
||||
return CHNL_LEVEL0;
|
||||
}
|
||||
ASSERT(ucCenterChannel >= 1 && ucCenterChannel <= 14);
|
||||
|
||||
/* Calculated low/upper channels in affected freq range */
|
||||
ucAffectedChnl_L = (ucCenterChannel <= AFFECTED_CHNL_OFFSET) ?
|
||||
1 : (ucCenterChannel - AFFECTED_CHNL_OFFSET);
|
||||
|
||||
ucAffectedChnl_H = (ucCenterChannel >= (14 - AFFECTED_CHNL_OFFSET)) ?
|
||||
14 : (ucCenterChannel + AFFECTED_CHNL_OFFSET);
|
||||
|
||||
|
||||
/* Check intolerant (Non-HT) channel list */
|
||||
ASSERT(prBssInfo->auc2G_NonHtChnlList[0] <= CHNL_LIST_SZ_2G);
|
||||
for (i = 1; i <= prBssInfo->auc2G_NonHtChnlList[0] &&
|
||||
i <= CHNL_LIST_SZ_2G; i++) {
|
||||
if ((prBssInfo->auc2G_NonHtChnlList[i] >= ucAffectedChnl_L &&
|
||||
prBssInfo->auc2G_NonHtChnlList[i] <= ucAffectedChnl_H) &&
|
||||
prBssInfo->auc2G_NonHtChnlList[i] != ucPriChannel) {
|
||||
|
||||
ucChannelLevel = CHNL_LEVEL0;
|
||||
goto L_2G4_level_end;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check 20M BW request channel list */
|
||||
ASSERT(prBssInfo->auc2G_20mReqChnlList[0] <= CHNL_LIST_SZ_2G);
|
||||
for (i = 1; i <= prBssInfo->auc2G_20mReqChnlList[0] &&
|
||||
i <= CHNL_LIST_SZ_2G; i++) {
|
||||
if ((prBssInfo->auc2G_20mReqChnlList[i] >= ucAffectedChnl_L &&
|
||||
prBssInfo->auc2G_20mReqChnlList[i] <= ucAffectedChnl_H)) {
|
||||
|
||||
ucChannelLevel = CHNL_LEVEL0;
|
||||
goto L_2G4_level_end;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check 2.4G primary channel list */
|
||||
ASSERT(prBssInfo->auc2G_PriChnlList[0] <= CHNL_LIST_SZ_2G);
|
||||
for (i = 1; i <= prBssInfo->auc2G_PriChnlList[0] &&
|
||||
i <= CHNL_LIST_SZ_2G; i++) {
|
||||
if ((prBssInfo->auc2G_PriChnlList[i] >= ucAffectedChnl_L &&
|
||||
prBssInfo->auc2G_PriChnlList[i] <= ucAffectedChnl_H) &&
|
||||
prBssInfo->auc2G_PriChnlList[i] != ucPriChannel) {
|
||||
|
||||
ucChannelLevel = CHNL_LEVEL0;
|
||||
goto L_2G4_level_end;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check 2.4G secondary channel list */
|
||||
ASSERT(prBssInfo->auc2G_SecChnlList[0] <= CHNL_LIST_SZ_2G);
|
||||
for (i = 1; i <= prBssInfo->auc2G_SecChnlList[0] &&
|
||||
i <= CHNL_LIST_SZ_2G; i++) {
|
||||
if ((prBssInfo->auc2G_SecChnlList[i] >= ucAffectedChnl_L &&
|
||||
prBssInfo->auc2G_SecChnlList[i] <= ucAffectedChnl_H) &&
|
||||
prBssInfo->auc2G_SecChnlList[i] != ucSecChannel) {
|
||||
|
||||
ucChannelLevel = CHNL_LEVEL0;
|
||||
goto L_2G4_level_end;
|
||||
}
|
||||
}
|
||||
|
||||
L_2G4_level_end:
|
||||
|
||||
return ucChannelLevel;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
static UINT_8
|
||||
rlmObssChnlLevelIn5G (
|
||||
P_BSS_INFO_T prBssInfo,
|
||||
UINT_8 ucPriChannel,
|
||||
ENUM_CHNL_EXT_T eExtend
|
||||
)
|
||||
{
|
||||
UINT_8 i, ucChannelLevel;
|
||||
UINT_8 ucSecChannel;
|
||||
|
||||
ASSERT(prBssInfo);
|
||||
|
||||
ucChannelLevel = CHNL_LEVEL2;
|
||||
|
||||
/* Calculate center channel for 2.4G band */
|
||||
if (eExtend == CHNL_EXT_SCA) {
|
||||
ucSecChannel = ucPriChannel + 4;
|
||||
}
|
||||
else if (eExtend == CHNL_EXT_SCB) {
|
||||
ucSecChannel = ucPriChannel - 4;
|
||||
}
|
||||
else {
|
||||
return CHNL_LEVEL0;
|
||||
}
|
||||
ASSERT(ucSecChannel >= 36);
|
||||
|
||||
/* Check 5G primary channel list */
|
||||
ASSERT(prBssInfo->auc5G_PriChnlList[0] <= CHNL_LIST_SZ_5G);
|
||||
for (i = 1; i <= prBssInfo->auc5G_PriChnlList[0] &&
|
||||
i <= CHNL_LIST_SZ_5G; i++) {
|
||||
if (prBssInfo->auc5G_PriChnlList[i] == ucSecChannel) {
|
||||
|
||||
ucChannelLevel = CHNL_LEVEL0;
|
||||
goto L_5G_level_end;
|
||||
}
|
||||
else if (prBssInfo->auc5G_PriChnlList[i] == ucPriChannel) {
|
||||
ucChannelLevel = CHNL_LEVEL1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check non-HT channel list */
|
||||
ASSERT(prBssInfo->auc5G_NonHtChnlList[0] <= CHNL_LIST_SZ_5G);
|
||||
for (i = 1; i <= prBssInfo->auc5G_NonHtChnlList[0] &&
|
||||
i <= CHNL_LIST_SZ_5G; i++) {
|
||||
if (prBssInfo->auc5G_NonHtChnlList[i] == ucSecChannel) {
|
||||
|
||||
ucChannelLevel = CHNL_LEVEL0;
|
||||
goto L_5G_level_end;
|
||||
}
|
||||
else if (prBssInfo->auc5G_NonHtChnlList[i] == ucPriChannel) {
|
||||
ucChannelLevel = CHNL_LEVEL1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check secondary channel list */
|
||||
ASSERT(prBssInfo->auc5G_SecChnlList[0] <= CHNL_LIST_SZ_5G);
|
||||
for (i = 1; i <= prBssInfo->auc5G_SecChnlList[0] &&
|
||||
i <= CHNL_LIST_SZ_5G; i++) {
|
||||
if (prBssInfo->auc5G_SecChnlList[i] == ucPriChannel) {
|
||||
|
||||
ucChannelLevel = CHNL_LEVEL0;
|
||||
goto L_5G_level_end;
|
||||
}
|
||||
}
|
||||
|
||||
L_5G_level_end:
|
||||
|
||||
return ucChannelLevel;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief
|
||||
*
|
||||
* \param[in]
|
||||
*
|
||||
* \return none
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
rlmObssScanExemptionRsp (
|
||||
P_ADAPTER_T prAdapter,
|
||||
P_BSS_INFO_T prBssInfo,
|
||||
P_SW_RFB_T prSwRfb
|
||||
)
|
||||
{
|
||||
P_MSDU_INFO_T prMsduInfo;
|
||||
P_ACTION_20_40_COEXIST_FRAME prTxFrame;
|
||||
|
||||
/* To do: need an algorithm to do judgement. Now always reject request */
|
||||
|
||||
prMsduInfo = (P_MSDU_INFO_T)
|
||||
cnmMgtPktAlloc(prAdapter, PUBLIC_ACTION_MAX_LEN);
|
||||
if (prMsduInfo == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
DBGLOG(RLM, INFO, ("Send 20/40 coexistence rsp frame!\n"));
|
||||
|
||||
prTxFrame = (P_ACTION_20_40_COEXIST_FRAME) prMsduInfo->prPacket;
|
||||
|
||||
prTxFrame->u2FrameCtrl = MAC_FRAME_ACTION;
|
||||
COPY_MAC_ADDR(prTxFrame->aucDestAddr,
|
||||
((P_ACTION_20_40_COEXIST_FRAME) prSwRfb->pvHeader)->aucSrcAddr);
|
||||
COPY_MAC_ADDR(prTxFrame->aucSrcAddr, prBssInfo->aucOwnMacAddr);
|
||||
COPY_MAC_ADDR(prTxFrame->aucBSSID, prBssInfo->aucBSSID);
|
||||
|
||||
prTxFrame->ucCategory = CATEGORY_PUBLIC_ACTION;
|
||||
prTxFrame->ucAction = ACTION_PUBLIC_20_40_COEXIST;
|
||||
|
||||
/* To do: find correct algorithm */
|
||||
prTxFrame->rBssCoexist.ucId = ELEM_ID_20_40_BSS_COEXISTENCE;
|
||||
prTxFrame->rBssCoexist.ucLength = 1;
|
||||
prTxFrame->rBssCoexist.ucData = 0;
|
||||
|
||||
ASSERT((WLAN_MAC_HEADER_LEN + 5) <= PUBLIC_ACTION_MAX_LEN);
|
||||
|
||||
prMsduInfo->ucPacketType = HIF_TX_PACKET_TYPE_MGMT;
|
||||
prMsduInfo->ucStaRecIndex =prSwRfb->ucStaRecIdx;
|
||||
prMsduInfo->ucNetworkType = prBssInfo->ucNetTypeIndex;
|
||||
prMsduInfo->ucMacHeaderLength = WLAN_MAC_MGMT_HEADER_LEN;
|
||||
prMsduInfo->fgIs802_1x = FALSE;
|
||||
prMsduInfo->fgIs802_11 = TRUE;
|
||||
prMsduInfo->u2FrameLength = WLAN_MAC_MGMT_HEADER_HTC_LEN + 5;
|
||||
prMsduInfo->ucTxSeqNum = nicIncreaseTxSeqNum(prAdapter);
|
||||
prMsduInfo->pfTxDoneHandler = NULL;
|
||||
prMsduInfo->fgIsBasicRate = FALSE;
|
||||
|
||||
/* Send them to HW queue */
|
||||
nicTxEnqueueMsdu(prAdapter, prMsduInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,837 +0,0 @@
|
|||
/*
|
||||
** $Id: @(#) p2p_scan.c@@
|
||||
*/
|
||||
|
||||
/*! \file "p2p_scan.c"
|
||||
\brief This file defines the p2p scan profile and the processing function of
|
||||
scan result for SCAN Module.
|
||||
|
||||
The SCAN Profile selection is part of SCAN MODULE and responsible for defining
|
||||
SCAN Parameters - e.g. MIN_CHANNEL_TIME, number of scan channels.
|
||||
In this file we also define the process of SCAN Result including adding, searching
|
||||
and removing SCAN record from the list.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
P_P2P_DEVICE_DESC_T
|
||||
scanSearchTargetP2pDesc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 aucDeviceID[],
|
||||
IN PP_BSS_DESC_T pprBssDesc
|
||||
)
|
||||
{
|
||||
|
||||
P_P2P_DEVICE_DESC_T prTargetP2pDesc = (P_P2P_DEVICE_DESC_T)NULL;
|
||||
P_SCAN_INFO_T prScanInfo = (P_SCAN_INFO_T)NULL;
|
||||
P_LINK_T prBSSDescList;
|
||||
P_BSS_DESC_T prBssDesc = (P_BSS_DESC_T)NULL;
|
||||
|
||||
|
||||
ASSERT(prAdapter);
|
||||
ASSERT(aucDeviceID);
|
||||
|
||||
prScanInfo = &(prAdapter->rWifiVar.rScanInfo);
|
||||
prBSSDescList = &prScanInfo->rBSSDescList;
|
||||
|
||||
//4 <1> The outer loop to search for a candidate.
|
||||
LINK_FOR_EACH_ENTRY(prBssDesc, prBSSDescList, rLinkEntry, BSS_DESC_T) {
|
||||
|
||||
/* Loop for each prBssDesc */
|
||||
prTargetP2pDesc = scanFindP2pDeviceDesc(prAdapter,
|
||||
prBssDesc,
|
||||
aucDeviceID,
|
||||
TRUE,
|
||||
FALSE);
|
||||
|
||||
if (prTargetP2pDesc != NULL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((pprBssDesc) && (prTargetP2pDesc != NULL)) {
|
||||
/* Only valid if prTargetP2pDesc is not NULL. */
|
||||
*pprBssDesc = prBssDesc;
|
||||
}
|
||||
|
||||
return prTargetP2pDesc;
|
||||
} /* scanSearchTargetP2pDesc */
|
||||
|
||||
|
||||
|
||||
|
||||
VOID
|
||||
scanInvalidAllP2pClientDevice (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
)
|
||||
{
|
||||
P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL;
|
||||
P_P2P_DEVICE_DESC_T prTargetDesc = (P_P2P_DEVICE_DESC_T)NULL;
|
||||
|
||||
LINK_FOR_EACH(prLinkEntry, &prBssDesc->rP2pDeviceList) {
|
||||
prTargetDesc = LINK_ENTRY(prLinkEntry, P2P_DEVICE_DESC_T, rLinkEntry);
|
||||
|
||||
if (prTargetDesc->fgDevInfoValid) {
|
||||
prTargetDesc->fgDevInfoValid = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
} /* scanRenewP2pClientDevice */
|
||||
|
||||
VOID
|
||||
scanRemoveInvalidP2pClientDevice (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
)
|
||||
{
|
||||
P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL, prNexEntry = (P_LINK_ENTRY_T)NULL;
|
||||
P_P2P_DEVICE_DESC_T prTargetDesc = (P_P2P_DEVICE_DESC_T)NULL;
|
||||
P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
|
||||
|
||||
prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings;
|
||||
|
||||
LINK_FOR_EACH_SAFE(prLinkEntry, prNexEntry, &prBssDesc->rP2pDeviceList) {
|
||||
prTargetDesc = LINK_ENTRY(prLinkEntry, P2P_DEVICE_DESC_T, rLinkEntry);
|
||||
|
||||
if (!prTargetDesc->fgDevInfoValid) {
|
||||
LINK_REMOVE_KNOWN_ENTRY(&prBssDesc->rP2pDeviceList, prLinkEntry);
|
||||
if ((prP2pConnSettings) &&
|
||||
(prP2pConnSettings->prTargetP2pDesc == prTargetDesc)) {
|
||||
prP2pConnSettings->prTargetP2pDesc = NULL;
|
||||
}
|
||||
kalMemFree(prTargetDesc, VIR_MEM_TYPE, sizeof(P2P_DEVICE_DESC_T));
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
} /* scanRenewP2pClientDevice */
|
||||
|
||||
|
||||
|
||||
P_P2P_DEVICE_DESC_T
|
||||
scanFindP2pDeviceDesc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc,
|
||||
IN UINT_8 aucMacAddr[],
|
||||
IN BOOLEAN fgIsDeviceAddr,
|
||||
IN BOOLEAN fgAddIfNoFound
|
||||
)
|
||||
{
|
||||
|
||||
P_P2P_DEVICE_DESC_T prTargetDesc = (P_P2P_DEVICE_DESC_T)NULL;
|
||||
P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) &&
|
||||
(prBssDesc != NULL) &&
|
||||
(aucMacAddr != NULL));
|
||||
|
||||
LINK_FOR_EACH(prLinkEntry, &prBssDesc->rP2pDeviceList) {
|
||||
prTargetDesc = LINK_ENTRY(prLinkEntry, P2P_DEVICE_DESC_T, rLinkEntry);
|
||||
|
||||
if (fgIsDeviceAddr) {
|
||||
if (EQUAL_MAC_ADDR(prTargetDesc->aucDeviceAddr, aucMacAddr)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (EQUAL_MAC_ADDR(prTargetDesc->aucInterfaceAddr, aucMacAddr)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
prTargetDesc = NULL;
|
||||
}
|
||||
|
||||
if ((fgAddIfNoFound) && (prTargetDesc == NULL)) {
|
||||
/* Target Not Found. */
|
||||
// TODO: Use memory pool in the future.
|
||||
prTargetDesc = kalMemAlloc(sizeof(P2P_DEVICE_DESC_T), VIR_MEM_TYPE);
|
||||
|
||||
if (prTargetDesc) {
|
||||
kalMemZero(prTargetDesc, sizeof(P2P_DEVICE_DESC_T));
|
||||
LINK_ENTRY_INITIALIZE(&(prTargetDesc->rLinkEntry));
|
||||
COPY_MAC_ADDR(prTargetDesc->aucDeviceAddr, aucMacAddr);
|
||||
LINK_INSERT_TAIL(&prBssDesc->rP2pDeviceList, &prTargetDesc->rLinkEntry);
|
||||
prTargetDesc->fgDevInfoValid = TRUE;
|
||||
}
|
||||
else {
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return prTargetDesc;
|
||||
} /* scanFindP2pDeviceDesc */
|
||||
|
||||
|
||||
P_P2P_DEVICE_DESC_T
|
||||
scanGetP2pDeviceDesc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
)
|
||||
{
|
||||
|
||||
P_P2P_DEVICE_DESC_T prTargetDesc = (P_P2P_DEVICE_DESC_T)NULL;
|
||||
|
||||
ASSERT(prAdapter);
|
||||
ASSERT(prBssDesc);
|
||||
|
||||
if (prBssDesc->prP2pDesc == NULL) {
|
||||
|
||||
prTargetDesc = kalMemAlloc(sizeof(P2P_DEVICE_DESC_T), VIR_MEM_TYPE);
|
||||
|
||||
if (prTargetDesc) {
|
||||
kalMemZero(prTargetDesc, sizeof(P2P_DEVICE_DESC_T));
|
||||
LINK_ENTRY_INITIALIZE(&(prTargetDesc->rLinkEntry));
|
||||
LINK_INSERT_TAIL(&prBssDesc->rP2pDeviceList, &prTargetDesc->rLinkEntry);
|
||||
prTargetDesc->fgDevInfoValid = TRUE;
|
||||
prBssDesc->prP2pDesc = prTargetDesc;
|
||||
/* We are not sure the SrcAddr is Device Address or Interface Address. */
|
||||
COPY_MAC_ADDR(prTargetDesc->aucDeviceAddr, prBssDesc->aucSrcAddr);
|
||||
COPY_MAC_ADDR(prTargetDesc->aucInterfaceAddr, prBssDesc->aucSrcAddr);
|
||||
}
|
||||
else {
|
||||
|
||||
ASSERT(FALSE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
prTargetDesc = prBssDesc->prP2pDesc;
|
||||
}
|
||||
|
||||
|
||||
return prTargetDesc;
|
||||
|
||||
} /* scanFindP2pDeviceDesc */
|
||||
|
||||
|
||||
#if 0
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief Convert the Beacon or ProbeResp Frame in SW_RFB_T to Event Packet
|
||||
*
|
||||
* @param[in] prSwRfb Pointer to the receiving SW_RFB_T structure.
|
||||
*
|
||||
* @retval WLAN_STATUS_SUCCESS It is a valid Scan Result and been sent to the host.
|
||||
* @retval WLAN_STATUS_FAILURE It is not a valid Scan Result.
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
scanUpdateP2pDeviceDesc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
)
|
||||
{
|
||||
P_P2P_DEVICE_DESC_T prP2pDesc = (P_P2P_DEVICE_DESC_T)NULL;
|
||||
P_P2P_ATTRIBUTE_T prP2pAttribute = (P_P2P_ATTRIBUTE_T)NULL;
|
||||
UINT_16 u2AttributeLen = 0;
|
||||
UINT_32 u4Idx = 0;
|
||||
BOOLEAN fgUpdateDevInfo = FALSE;
|
||||
|
||||
P_DEVICE_NAME_TLV_T prP2pDevName = (P_DEVICE_NAME_TLV_T)NULL;
|
||||
P_P2P_ATTRI_GROUP_INFO_T prP2pAttriGroupInfo = (P_P2P_ATTRI_GROUP_INFO_T)NULL;
|
||||
|
||||
ASSERT(prAdapter);
|
||||
|
||||
prP2pDesc = scanGetP2pDeviceDesc(prAdapter, prBssDesc);
|
||||
|
||||
if (!prP2pDesc) {
|
||||
ASSERT(FALSE);
|
||||
return fgUpdateDevInfo;
|
||||
}
|
||||
|
||||
p2pGetP2PAttriList(prAdapter, prBssDesc->aucIEBuf, prBssDesc->u2IELength, (PPUINT_8)&prP2pAttribute, &u2AttributeLen);
|
||||
|
||||
while (u2AttributeLen >= P2P_ATTRI_HDR_LEN) {
|
||||
switch (prP2pAttribute->ucId) {
|
||||
case P2P_ATTRI_ID_P2P_CAPABILITY: /* Beacon, Probe Response */
|
||||
{
|
||||
P_P2P_ATTRI_CAPABILITY_T prP2pAttriCapability = (P_P2P_ATTRI_CAPABILITY_T)NULL;
|
||||
|
||||
prP2pAttriCapability = (P_P2P_ATTRI_CAPABILITY_T)prP2pAttribute;
|
||||
ASSERT(prP2pAttriCapability->u2Length == 2);
|
||||
|
||||
prP2pDesc->ucDeviceCapabilityBitmap = prP2pAttriCapability->ucDeviceCap;
|
||||
prP2pDesc->ucGroupCapabilityBitmap = prP2pAttriCapability->ucGroupCap;
|
||||
}
|
||||
break;
|
||||
case P2P_ATTRI_ID_P2P_DEV_ID: /* Beacon */
|
||||
{
|
||||
P_P2P_ATTRI_DEV_ID_T prP2pAttriDevID = (P_P2P_ATTRI_DEV_ID_T)NULL;
|
||||
|
||||
prP2pAttriDevID = (P_P2P_ATTRI_DEV_ID_T)prP2pAttribute;
|
||||
ASSERT(prP2pAttriDevID->u2Length == P2P_ATTRI_MAX_LEN_P2P_DEV_ID);
|
||||
|
||||
kalMemCopy(prP2pDesc->aucDeviceAddr, prP2pAttriDevID->aucDevAddr, MAC_ADDR_LEN);
|
||||
}
|
||||
break;
|
||||
case P2P_ATTRI_ID_P2P_DEV_INFO: /* Probe Response */
|
||||
{
|
||||
P_P2P_ATTRI_DEV_INFO_T prP2pAttriDevInfo = (P_P2P_ATTRI_DEV_INFO_T)NULL;
|
||||
P_P2P_DEVICE_TYPE_T prP2pDevType = (P_P2P_DEVICE_TYPE_T)NULL;
|
||||
UINT_16 u2NameLen = 0, u2Id = 0;
|
||||
|
||||
fgUpdateDevInfo = TRUE;
|
||||
|
||||
prP2pAttriDevInfo = (P_P2P_ATTRI_DEV_INFO_T)prP2pAttribute;
|
||||
|
||||
kalMemCopy(prP2pDesc->aucDeviceAddr, prP2pAttriDevInfo->aucDevAddr, MAC_ADDR_LEN);
|
||||
|
||||
WLAN_GET_FIELD_BE16(&prP2pAttriDevInfo->u2ConfigMethodsBE, &prP2pDesc->u2ConfigMethod);
|
||||
|
||||
prP2pDevType = &prP2pDesc->rPriDevType;
|
||||
WLAN_GET_FIELD_BE16(&prP2pAttriDevInfo->rPrimaryDevTypeBE.u2CategoryId, &prP2pDevType->u2CategoryID);
|
||||
WLAN_GET_FIELD_BE16(&prP2pAttriDevInfo->rPrimaryDevTypeBE.u2SubCategoryId, &prP2pDevType->u2SubCategoryID);
|
||||
|
||||
ASSERT(prP2pAttriDevInfo->ucNumOfSecondaryDevType <= P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT); // TODO: Fixme if secondary device type is more than 2.
|
||||
prP2pDesc->ucSecDevTypeNum = 0;
|
||||
for (u4Idx = 0; u4Idx < prP2pAttriDevInfo->ucNumOfSecondaryDevType; u4Idx++) {
|
||||
if (u4Idx < P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT) {
|
||||
prP2pDevType = &(prP2pDesc->arSecDevType[u4Idx]);
|
||||
WLAN_GET_FIELD_BE16(&prP2pAttriDevInfo->arSecondaryDevTypeListBE[u4Idx].u2CategoryId, &prP2pDevType->u2CategoryID);
|
||||
WLAN_GET_FIELD_BE16(&prP2pAttriDevInfo->arSecondaryDevTypeListBE[u4Idx].u2SubCategoryId, &prP2pDevType->u2SubCategoryID);
|
||||
prP2pDesc->ucSecDevTypeNum++;
|
||||
}
|
||||
|
||||
}
|
||||
prP2pDevName = (P_DEVICE_NAME_TLV_T)((PUINT_8)prP2pAttriDevInfo->arSecondaryDevTypeListBE + (u4Idx * sizeof(DEVICE_TYPE_T)));
|
||||
WLAN_GET_FIELD_BE16(&prP2pDevName->u2Length, &u2NameLen);
|
||||
WLAN_GET_FIELD_BE16(&prP2pDevName->u2Id, &u2Id);
|
||||
ASSERT(u2Id == WPS_ATTRI_ID_DEVICE_NAME);
|
||||
if (u2NameLen > WPS_ATTRI_MAX_LEN_DEVICE_NAME) {
|
||||
u2NameLen = WPS_ATTRI_MAX_LEN_DEVICE_NAME;
|
||||
}
|
||||
prP2pDesc->u2NameLength = u2NameLen;
|
||||
kalMemCopy(prP2pDesc->aucName, prP2pDevName->aucName, prP2pDesc->u2NameLength);
|
||||
}
|
||||
break;
|
||||
case P2P_ATTRI_ID_P2P_GROUP_INFO: /* Probe Response */
|
||||
prP2pAttriGroupInfo = (P_P2P_ATTRI_GROUP_INFO_T)prP2pAttribute;
|
||||
break;
|
||||
case P2P_ATTRI_ID_NOTICE_OF_ABSENCE:
|
||||
break;
|
||||
case P2P_ATTRI_ID_EXT_LISTEN_TIMING:
|
||||
// TODO: Not implement yet.
|
||||
//ASSERT(FALSE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
u2AttributeLen -= (prP2pAttribute->u2Length + P2P_ATTRI_HDR_LEN);
|
||||
|
||||
prP2pAttribute = (P_P2P_ATTRIBUTE_T)((UINT_32)prP2pAttribute + (prP2pAttribute->u2Length + P2P_ATTRI_HDR_LEN));
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (prP2pAttriGroupInfo != NULL) {
|
||||
P_P2P_CLIENT_INFO_DESC_T prClientInfoDesc = (P_P2P_CLIENT_INFO_DESC_T)NULL;
|
||||
P_P2P_DEVICE_TYPE_T prP2pDevType = (P_P2P_DEVICE_TYPE_T)NULL;
|
||||
|
||||
scanInvalidAllP2pClientDevice(prAdapter, prBssDesc);
|
||||
|
||||
/* GO/Device itself. */
|
||||
prP2pDesc->fgDevInfoValid = TRUE;
|
||||
|
||||
prClientInfoDesc = (P_P2P_CLIENT_INFO_DESC_T)prP2pAttriGroupInfo->arClientDesc;
|
||||
u2AttributeLen = prP2pAttriGroupInfo->u2Length;
|
||||
|
||||
|
||||
while (u2AttributeLen > 0) {
|
||||
prP2pDesc = scanFindP2pDeviceDesc(prAdapter, prBssDesc, prClientInfoDesc->aucDevAddr, TRUE, TRUE);
|
||||
|
||||
if (!prP2pDesc) {
|
||||
ASSERT(FALSE);
|
||||
break; /* while */
|
||||
}
|
||||
|
||||
prP2pDesc->fgDevInfoValid = TRUE;
|
||||
|
||||
/* Basic size for P2P client info descriptor. */
|
||||
ASSERT(u2AttributeLen >= 25);
|
||||
if (u2AttributeLen < 25) {
|
||||
DBGLOG(P2P, WARN, ("Length incorrect warning.\n"));
|
||||
break;
|
||||
}
|
||||
COPY_MAC_ADDR(prP2pDesc->aucInterfaceAddr, prClientInfoDesc->aucIfAddr);
|
||||
|
||||
prP2pDesc->ucDeviceCapabilityBitmap = prClientInfoDesc->ucDeviceCap;
|
||||
|
||||
WLAN_GET_FIELD_BE16(&prClientInfoDesc->u2ConfigMethodsBE, &prP2pDesc->u2ConfigMethod);
|
||||
|
||||
prP2pDevType = &(prP2pDesc->rPriDevType);
|
||||
WLAN_GET_FIELD_BE16(&prClientInfoDesc->rPrimaryDevTypeBE.u2CategoryId, &prP2pDevType->u2CategoryID);
|
||||
WLAN_GET_FIELD_BE16(&prClientInfoDesc->rPrimaryDevTypeBE.u2SubCategoryId, &prP2pDevType->u2SubCategoryID);
|
||||
|
||||
ASSERT(prClientInfoDesc->ucNumOfSecondaryDevType <= P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT);
|
||||
prP2pDesc->ucSecDevTypeNum = 0;
|
||||
for (u4Idx = 0; u4Idx < prClientInfoDesc->ucNumOfSecondaryDevType; u4Idx++) {
|
||||
if (u4Idx < P2P_GC_MAX_CACHED_SEC_DEV_TYPE_COUNT) {
|
||||
prP2pDevType = &(prP2pDesc->arSecDevType[u4Idx]);
|
||||
WLAN_GET_FIELD_BE16(&prClientInfoDesc->arSecondaryDevTypeListBE[u4Idx].u2CategoryId, &prP2pDevType->u2CategoryID);
|
||||
WLAN_GET_FIELD_BE16(&prClientInfoDesc->arSecondaryDevTypeListBE[u4Idx].u2SubCategoryId, &prP2pDevType->u2SubCategoryID);
|
||||
prP2pDesc->ucSecDevTypeNum++;
|
||||
}
|
||||
|
||||
}
|
||||
prP2pDevName = (P_DEVICE_NAME_TLV_T)(prClientInfoDesc->arSecondaryDevTypeListBE + (u4Idx * sizeof(DEVICE_TYPE_T)));
|
||||
WLAN_GET_FIELD_BE16(&prP2pDevName->u2Length, &prP2pDesc->u2NameLength);
|
||||
if (prP2pDesc->u2NameLength > WPS_ATTRI_MAX_LEN_DEVICE_NAME) {
|
||||
prP2pDesc->u2NameLength = WPS_ATTRI_MAX_LEN_DEVICE_NAME;
|
||||
}
|
||||
|
||||
kalMemCopy(prP2pDesc->aucName, prP2pDevName->aucName, prP2pDesc->u2NameLength);
|
||||
|
||||
u2AttributeLen -= (prClientInfoDesc->ucLength + P2P_CLIENT_INFO_DESC_HDR_LEN);
|
||||
prClientInfoDesc = (P_P2P_CLIENT_INFO_DESC_T)((UINT_32)prClientInfoDesc + (UINT_32)prClientInfoDesc->ucLength + P2P_CLIENT_INFO_DESC_HDR_LEN);
|
||||
}
|
||||
|
||||
scanRemoveInvalidP2pClientDevice(prAdapter, prBssDesc);
|
||||
}
|
||||
|
||||
return fgUpdateDevInfo;
|
||||
} /* end of scanAddP2pDeviceInfo() */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief Convert the Beacon or ProbeResp Frame in SW_RFB_T to Event Packet
|
||||
*
|
||||
* @param[in] prSwRfb Pointer to the receiving SW_RFB_T structure.
|
||||
*
|
||||
* @retval WLAN_STATUS_SUCCESS It is a valid Scan Result and been sent to the host.
|
||||
* @retval WLAN_STATUS_FAILURE It is not a valid Scan Result.
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
WLAN_STATUS
|
||||
scanSendDeviceDiscoverEvent (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc,
|
||||
IN P_SW_RFB_T prSwRfb
|
||||
)
|
||||
{
|
||||
EVENT_P2P_DEV_DISCOVER_RESULT_T rEventDevInfo;
|
||||
#if 1
|
||||
P_LINK_ENTRY_T prLinkEntry = (P_LINK_ENTRY_T)NULL;
|
||||
P_P2P_DEVICE_DESC_T prTargetDesc = (P_P2P_DEVICE_DESC_T)NULL;
|
||||
|
||||
LINK_FOR_EACH(prLinkEntry, &prBssDesc->rP2pDeviceList) {
|
||||
prTargetDesc = LINK_ENTRY(prLinkEntry, P2P_DEVICE_DESC_T, rLinkEntry);
|
||||
|
||||
COPY_MAC_ADDR(rEventDevInfo.aucDeviceAddr, prTargetDesc->aucDeviceAddr);
|
||||
COPY_MAC_ADDR(rEventDevInfo.aucInterfaceAddr, prTargetDesc->aucInterfaceAddr);
|
||||
|
||||
rEventDevInfo.ucDeviceCapabilityBitmap = prTargetDesc->ucDeviceCapabilityBitmap;
|
||||
rEventDevInfo.ucGroupCapabilityBitmap = prTargetDesc->ucGroupCapabilityBitmap;
|
||||
rEventDevInfo.u2ConfigMethod = prTargetDesc->u2ConfigMethod;
|
||||
|
||||
kalMemCopy(&rEventDevInfo.rPriDevType,
|
||||
&prTargetDesc->rPriDevType,
|
||||
sizeof(P2P_DEVICE_TYPE_T));
|
||||
|
||||
kalMemCopy(rEventDevInfo.arSecDevType,
|
||||
prTargetDesc->arSecDevType,
|
||||
(prTargetDesc->ucSecDevTypeNum * sizeof(P2P_DEVICE_TYPE_T)));
|
||||
|
||||
rEventDevInfo.ucSecDevTypeNum = prTargetDesc->ucSecDevTypeNum;
|
||||
|
||||
rEventDevInfo.u2NameLength = prTargetDesc->u2NameLength;
|
||||
kalMemCopy(rEventDevInfo.aucName,
|
||||
prTargetDesc->aucName,
|
||||
prTargetDesc->u2NameLength);
|
||||
|
||||
COPY_MAC_ADDR(rEventDevInfo.aucBSSID, prBssDesc->aucBSSID);
|
||||
|
||||
if (prTargetDesc == prBssDesc->prP2pDesc) {
|
||||
nicRxAddP2pDevice(prAdapter,
|
||||
&rEventDevInfo,
|
||||
prBssDesc->aucIEBuf,
|
||||
prBssDesc->u2IELength);
|
||||
}
|
||||
else {
|
||||
nicRxAddP2pDevice(prAdapter,
|
||||
&rEventDevInfo,
|
||||
NULL,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
kalP2PIndicateFound(prAdapter->prGlueInfo);
|
||||
|
||||
#else
|
||||
|
||||
P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL;
|
||||
P_P2P_ATTRIBUTE_T prP2pAttribute = (P_P2P_ATTRIBUTE_T)NULL;
|
||||
UINT_16 u2AttributeLen = 0;
|
||||
UINT_32 u4Idx = 0;
|
||||
P_P2P_ATTRI_GROUP_INFO_T prP2pAttriGroupInfo = (P_P2P_ATTRI_GROUP_INFO_T)NULL;
|
||||
P_DEVICE_NAME_TLV_T prP2pDevName = (P_DEVICE_NAME_TLV_T)NULL;
|
||||
|
||||
ASSERT(prAdapter);
|
||||
|
||||
prP2pSpecificBssInfo = &prAdapter->rWifiVar.rP2pSpecificBssInfo;
|
||||
|
||||
#if 1
|
||||
p2pGetP2PAttriList(prAdapter, prBssDesc->aucIEBuf, prBssDesc->u2IELength, (PPUINT_8)&prP2pAttribute, &u2AttributeLen);
|
||||
#else
|
||||
prP2pAttribute = (P_P2P_ATTRIBUTE_T)&prP2pSpecificBssInfo->aucAttributesCache[0];
|
||||
u2AttributeLen = prP2pSpecificBssInfo->u2AttributeLen;
|
||||
#endif
|
||||
rEventDevInfo.fgDevInfoValid = FALSE;
|
||||
|
||||
while (u2AttributeLen >= P2P_ATTRI_HDR_LEN) {
|
||||
switch (prP2pAttribute->ucId) {
|
||||
case P2P_ATTRI_ID_P2P_CAPABILITY:
|
||||
{
|
||||
P_P2P_ATTRI_CAPABILITY_T prP2pAttriCapability = (P_P2P_ATTRI_CAPABILITY_T)NULL;
|
||||
|
||||
prP2pAttriCapability = (P_P2P_ATTRI_CAPABILITY_T)prP2pAttribute;
|
||||
ASSERT(prP2pAttriCapability->u2Length == 2);
|
||||
rEventDevInfo.ucDeviceCapabilityBitmap = prP2pAttriCapability->ucDeviceCap;
|
||||
rEventDevInfo.ucGroupCapabilityBitmap = prP2pAttriCapability->ucGroupCap;
|
||||
}
|
||||
break;
|
||||
case P2P_ATTRI_ID_P2P_DEV_ID:
|
||||
{
|
||||
P_P2P_ATTRI_DEV_ID_T prP2pAttriDevID = (P_P2P_ATTRI_DEV_ID_T)NULL;
|
||||
|
||||
prP2pAttriDevID = (P_P2P_ATTRI_DEV_ID_T)prP2pAttribute;
|
||||
ASSERT(prP2pAttriDevID->u2Length == 6);
|
||||
kalMemCopy(rEventDevInfo.aucCommunicateAddr, prP2pAttriDevID->aucDevAddr, MAC_ADDR_LEN);
|
||||
}
|
||||
break;
|
||||
case P2P_ATTRI_ID_P2P_DEV_INFO:
|
||||
{
|
||||
P_P2P_ATTRI_DEV_INFO_T prP2pAttriDevInfo = (P_P2P_ATTRI_DEV_INFO_T)NULL;
|
||||
P_P2P_DEVICE_TYPE_T prP2pDevType = (P_P2P_DEVICE_TYPE_T)NULL;
|
||||
|
||||
prP2pAttriDevInfo = (P_P2P_ATTRI_DEV_INFO_T)prP2pAttribute;
|
||||
rEventDevInfo.fgDevInfoValid = TRUE;
|
||||
kalMemCopy(rEventDevInfo.aucCommunicateAddr, prP2pAttriDevInfo->aucDevAddr, MAC_ADDR_LEN);
|
||||
rEventDevInfo.u2ConfigMethod = prP2pAttriDevInfo->u2ConfigMethodsBE;
|
||||
|
||||
prP2pDevType = &rEventDevInfo.rPriDevType;
|
||||
prP2pDevType->u2CategoryID = prP2pAttriDevInfo->rPrimaryDevTypeBE.u2CategoryId;
|
||||
prP2pDevType->u2SubCategoryID = prP2pAttriDevInfo->rPrimaryDevTypeBE.u2SubCategoryId;
|
||||
|
||||
ASSERT(prP2pAttriDevInfo->ucNumOfSecondaryDevType <= 2); // TODO: Fixme if secondary device type is more than 2.
|
||||
for (u4Idx = 0; u4Idx < prP2pAttriDevInfo->ucNumOfSecondaryDevType; u4Idx++) {
|
||||
// TODO: Current sub device type can only support 2.
|
||||
prP2pDevType = &rEventDevInfo.arSecDevType[u4Idx];
|
||||
prP2pDevType->u2CategoryID = prP2pAttriDevInfo->rPrimaryDevTypeBE.u2CategoryId;
|
||||
prP2pDevType->u2SubCategoryID = prP2pAttriDevInfo->rPrimaryDevTypeBE.u2SubCategoryId;
|
||||
}
|
||||
|
||||
prP2pDevName = (P_DEVICE_NAME_TLV_T)(prP2pAttriDevInfo->arSecondaryDevTypeListBE + (u4Idx * sizeof(DEVICE_TYPE_T)));
|
||||
ASSERT(prP2pDevName->u2Id == 0x1011);
|
||||
ASSERT(prP2pDevName->u2Length <= 32); // TODO: Fixme if device name length is longer than 32 bytes.
|
||||
kalMemCopy(rEventDevInfo.aucName, prP2pDevName->aucName, prP2pDevName->u2Length);
|
||||
}
|
||||
break;
|
||||
case P2P_ATTRI_ID_P2P_GROUP_INFO:
|
||||
prP2pAttriGroupInfo = (P_P2P_ATTRI_GROUP_INFO_T)prP2pAttribute;
|
||||
break;
|
||||
}
|
||||
|
||||
u2AttributeLen -= (prP2pAttribute->u2Length + P2P_ATTRI_HDR_LEN);
|
||||
|
||||
prP2pAttribute = (P_P2P_ATTRIBUTE_T)((UINT_32)prP2pAttribute + (prP2pAttribute->u2Length + P2P_ATTRI_HDR_LEN));
|
||||
|
||||
}
|
||||
|
||||
nicRxAddP2pDevice(prAdapter,
|
||||
&rEventDevInfo);
|
||||
|
||||
if (prP2pAttriGroupInfo != NULL) {
|
||||
P_P2P_CLIENT_INFO_DESC_T prClientInfoDesc = (P_P2P_CLIENT_INFO_DESC_T)NULL;
|
||||
P_P2P_DEVICE_TYPE_T prP2pDevType = (P_P2P_DEVICE_TYPE_T)NULL;
|
||||
|
||||
prClientInfoDesc = prP2pAttriGroupInfo->arClientDesc;
|
||||
u2AttributeLen = prP2pAttriGroupInfo->u2Length;
|
||||
|
||||
while (u2AttributeLen > 0) {
|
||||
/* Basic size for P2P client info descriptor. */
|
||||
ASSERT(u2AttributeLen >= 25);
|
||||
rEventDevInfo.fgDevInfoValid = TRUE;
|
||||
kalMemCopy(rEventDevInfo.aucCommunicateAddr, prClientInfoDesc->aucIfAddr, MAC_ADDR_LEN);
|
||||
rEventDevInfo.ucDeviceCapabilityBitmap = prClientInfoDesc->ucDeviceCap;
|
||||
rEventDevInfo.u2ConfigMethod = prClientInfoDesc->u2ConfigMethodsBE;
|
||||
|
||||
prP2pDevType = &rEventDevInfo.rPriDevType;
|
||||
prP2pDevType->u2CategoryID = prClientInfoDesc->rPrimaryDevTypeBE.u2CategoryId;
|
||||
prP2pDevType->u2SubCategoryID = prClientInfoDesc->rPrimaryDevTypeBE.u2SubCategoryId;
|
||||
|
||||
ASSERT(prClientInfoDesc->ucNumOfSecondaryDevType <= 2); // TODO: Fixme if secondary device type is more than 2.
|
||||
for (u4Idx = 0; u4Idx < prClientInfoDesc->ucNumOfSecondaryDevType; u4Idx++) {
|
||||
// TODO: Current sub device type can only support 2.
|
||||
prP2pDevType = &rEventDevInfo.arSecDevType[u4Idx];
|
||||
prP2pDevType->u2CategoryID = prClientInfoDesc->arSecondaryDevTypeListBE[u4Idx].u2CategoryId;
|
||||
prP2pDevType->u2SubCategoryID = prClientInfoDesc->arSecondaryDevTypeListBE[u4Idx].u2SubCategoryId;
|
||||
}
|
||||
|
||||
prP2pDevName = (P_DEVICE_NAME_TLV_T)(prClientInfoDesc->arSecondaryDevTypeListBE + (u4Idx * sizeof(DEVICE_TYPE_T)));
|
||||
ASSERT(prP2pDevName->u2Id == 0x1011);
|
||||
ASSERT(prP2pDevName->u2Length <= 32); // TODO: Fixme if device name length is longer than 32 bytes.
|
||||
kalMemCopy(&rEventDevInfo.aucName, prP2pDevName->aucName, prP2pDevName->u2Length);
|
||||
|
||||
nicRxAddP2pDevice(prAdapter,
|
||||
&rEventDevInfo);
|
||||
|
||||
u2AttributeLen -= prP2pAttriGroupInfo->u2Length;
|
||||
prP2pAttriGroupInfo = prP2pAttriGroupInfo + prP2pAttriGroupInfo->u2Length + 1;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
return WLAN_STATUS_SUCCESS;
|
||||
} /* scanSendDeviceDiscoverEvent */
|
||||
|
||||
VOID
|
||||
scanP2pProcessBeaconAndProbeResp(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_SW_RFB_T prSwRfb,
|
||||
IN P_WLAN_STATUS prStatus,
|
||||
IN P_BSS_DESC_T prBssDesc,
|
||||
IN P_WLAN_BEACON_FRAME_T prWlanBeaconFrame
|
||||
)
|
||||
{
|
||||
P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL;
|
||||
P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
|
||||
prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]);
|
||||
prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings;
|
||||
|
||||
if (prBssDesc->fgIsP2PPresent) {
|
||||
|
||||
if ((!prP2pBssInfo->ucDTIMPeriod) && // First time.
|
||||
(prP2pBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE) && // P2P GC
|
||||
(prP2pBssInfo->eConnectionState == PARAM_MEDIA_STATE_CONNECTED) && // Connected
|
||||
((prWlanBeaconFrame->u2FrameCtrl & MASK_FRAME_TYPE) == MAC_FRAME_BEACON) && // TX Beacon
|
||||
EQUAL_SSID(prBssDesc->aucSSID, // SSID Match
|
||||
prBssDesc->ucSSIDLen,
|
||||
prP2pConnSettings->aucSSID,
|
||||
prP2pConnSettings->ucSSIDLen)) {
|
||||
|
||||
|
||||
prP2pBssInfo->ucDTIMPeriod = prBssDesc->ucDTIMPeriod;
|
||||
nicPmIndicateBssConnected(prAdapter, NETWORK_TYPE_P2P_INDEX);
|
||||
}
|
||||
|
||||
do {
|
||||
RF_CHANNEL_INFO_T rChannelInfo;
|
||||
|
||||
ASSERT_BREAK((prSwRfb != NULL) && (prBssDesc != NULL));
|
||||
|
||||
if (((prWlanBeaconFrame->u2FrameCtrl & MASK_FRAME_TYPE) != MAC_FRAME_PROBE_RSP)) {
|
||||
// Only report Probe Response frame to supplicant.
|
||||
/* Probe response collect much more information. */
|
||||
break;
|
||||
}
|
||||
|
||||
rChannelInfo.ucChannelNum = prBssDesc->ucChannelNum;
|
||||
rChannelInfo.eBand = prBssDesc->eBand;
|
||||
|
||||
kalP2PIndicateBssInfo(prAdapter->prGlueInfo,
|
||||
(PUINT_8)prSwRfb->pvHeader,
|
||||
(UINT_32)prSwRfb->u2PacketLen,
|
||||
&rChannelInfo,
|
||||
RCPI_TO_dBm(prBssDesc->ucRCPI));
|
||||
|
||||
|
||||
} while (FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
scnEventReturnChannel (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN UINT_8 ucScnSeqNum
|
||||
)
|
||||
{
|
||||
|
||||
CMD_SCAN_CANCEL rCmdScanCancel;
|
||||
|
||||
/* send cancel message to firmware domain */
|
||||
rCmdScanCancel.ucSeqNum = ucScnSeqNum;
|
||||
rCmdScanCancel.ucIsExtChannel = (UINT_8) FALSE;
|
||||
|
||||
wlanSendSetQueryCmd(prAdapter,
|
||||
CMD_ID_SCAN_CANCEL,
|
||||
TRUE,
|
||||
FALSE,
|
||||
FALSE,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof(CMD_SCAN_CANCEL),
|
||||
(PUINT_8)&rCmdScanCancel,
|
||||
NULL,
|
||||
0);
|
||||
|
||||
return;
|
||||
} /* scnEventReturnChannel */
|
||||
|
||||
VOID
|
||||
scanRemoveAllP2pBssDesc(
|
||||
IN P_ADAPTER_T prAdapter
|
||||
)
|
||||
{
|
||||
P_LINK_T prBSSDescList;
|
||||
P_BSS_DESC_T prBssDesc;
|
||||
P_BSS_DESC_T prBSSDescNext;
|
||||
|
||||
ASSERT(prAdapter);
|
||||
|
||||
prBSSDescList = &(prAdapter->rWifiVar.rScanInfo.rBSSDescList);
|
||||
|
||||
/* Search BSS Desc from current SCAN result list. */
|
||||
LINK_FOR_EACH_ENTRY_SAFE(prBssDesc, prBSSDescNext, prBSSDescList, rLinkEntry, BSS_DESC_T) {
|
||||
scanRemoveP2pBssDesc(prAdapter, prBssDesc);
|
||||
}
|
||||
} /* scanRemoveAllP2pBssDesc */
|
||||
|
||||
VOID
|
||||
scanRemoveP2pBssDesc(
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
)
|
||||
{
|
||||
|
||||
return;
|
||||
} /* scanRemoveP2pBssDesc */
|
||||
|
||||
|
||||
P_BSS_DESC_T
|
||||
scanP2pSearchDesc (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
IN P_P2P_CONNECTION_REQ_INFO_T prConnReqInfo
|
||||
)
|
||||
{
|
||||
P_BSS_DESC_T prCandidateBssDesc = (P_BSS_DESC_T)NULL, prBssDesc = (P_BSS_DESC_T)NULL;
|
||||
P_LINK_T prBssDescList = (P_LINK_T)NULL;
|
||||
|
||||
do {
|
||||
if ((prAdapter == NULL) ||
|
||||
(prP2pBssInfo == NULL) ||
|
||||
(prConnReqInfo == NULL)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
prBssDescList = &(prAdapter->rWifiVar.rScanInfo.rBSSDescList);
|
||||
|
||||
DBGLOG(P2P, LOUD, ("Connecting to BSSID: "MACSTR"\n", MAC2STR(prConnReqInfo->aucBssid)));
|
||||
DBGLOG(P2P, LOUD, ("Connecting to SSID:%s, length:%d\n",
|
||||
prConnReqInfo->rSsidStruct.aucSsid,
|
||||
prConnReqInfo->rSsidStruct.ucSsidLen));
|
||||
|
||||
LINK_FOR_EACH_ENTRY(prBssDesc, prBssDescList, rLinkEntry, BSS_DESC_T) {
|
||||
DBGLOG(P2P, LOUD, ("Checking BSS: "MACSTR"\n", MAC2STR(prBssDesc->aucBSSID)));
|
||||
|
||||
if (prBssDesc->eBSSType != BSS_TYPE_INFRASTRUCTURE) {
|
||||
DBGLOG(P2P, LOUD, ("Ignore mismatch BSS type.\n"));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (UNEQUAL_MAC_ADDR(prBssDesc->aucBSSID, prConnReqInfo->aucBssid)) {
|
||||
DBGLOG(P2P, LOUD, ("Ignore mismatch BSSID.\n"));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* SSID should be the same? SSID is vary for each connection. so... */
|
||||
if (UNEQUAL_SSID(prConnReqInfo->rSsidStruct.aucSsid,
|
||||
prConnReqInfo->rSsidStruct.ucSsidLen,
|
||||
prBssDesc->aucSSID,
|
||||
prBssDesc->ucSSIDLen)) {
|
||||
|
||||
DBGLOG(P2P, TRACE, ("Connecting to BSSID: "MACSTR"\n", MAC2STR(prConnReqInfo->aucBssid)));
|
||||
DBGLOG(P2P, TRACE, ("Connecting to SSID:%s, length:%d\n",
|
||||
prConnReqInfo->rSsidStruct.aucSsid,
|
||||
prConnReqInfo->rSsidStruct.ucSsidLen));
|
||||
DBGLOG(P2P, TRACE, ("Checking SSID:%s, length:%d\n",
|
||||
prBssDesc->aucSSID,
|
||||
prBssDesc->ucSSIDLen));
|
||||
DBGLOG(P2P, TRACE, ("Ignore mismatch SSID, (But BSSID match).\n"));
|
||||
ASSERT(FALSE);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!prBssDesc->fgIsP2PPresent) {
|
||||
DBGLOG(P2P, ERROR, ("SSID, BSSID, BSSTYPE match, but no P2P IE present.\n"));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* Final decision. */
|
||||
prCandidateBssDesc = prBssDesc;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return prCandidateBssDesc;
|
||||
} /* scanP2pSearchDesc */
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,577 +0,0 @@
|
|||
#include "p2p_precomp.h"
|
||||
|
||||
|
||||
BOOLEAN
|
||||
p2pStateInit_IDLE (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
OUT P_ENUM_P2P_STATE_T peNextState
|
||||
)
|
||||
{
|
||||
BOOLEAN fgIsTransOut = FALSE;
|
||||
// P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) &&
|
||||
(prP2pFsmInfo != NULL) &&
|
||||
(prP2pBssInfo != NULL) &&
|
||||
(peNextState != NULL));
|
||||
|
||||
if ((prP2pBssInfo->eIntendOPMode == OP_MODE_ACCESS_POINT) && IS_NET_PWR_STATE_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX)) {
|
||||
P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo);
|
||||
|
||||
fgIsTransOut = TRUE;
|
||||
prChnlReqInfo->eChannelReqType = CHANNEL_REQ_TYPE_GO_START_BSS;
|
||||
*peNextState = P2P_STATE_REQING_CHANNEL;
|
||||
|
||||
}
|
||||
else {
|
||||
#if 0
|
||||
else if (IS_NET_PWR_STATE_ACTIVE(prAdapter, NETWORK_TYPE_P2P_INDEX)) {
|
||||
|
||||
ASSERT((prP2pBssInfo->eCurrentOPMode == OP_MODE_ACCESS_POINT) ||
|
||||
(prP2pBssInfo->eCurrentOPMode == OP_MODE_INFRASTRUCTURE));
|
||||
|
||||
prChnlReqInfo = &prP2pFsmInfo->rChnlReqInfo;
|
||||
|
||||
if (prChnlReqInfo->fgIsChannelRequested) {
|
||||
/* Start a timer for return channel. */
|
||||
DBGLOG(P2P, TRACE, ("start a GO channel timer.\n"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
cnmTimerStartTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer), 5000);
|
||||
}
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return fgIsTransOut;
|
||||
} /* p2pStateInit_IDLE */
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateAbort_IDLE (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
)
|
||||
{
|
||||
|
||||
P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) &&
|
||||
(prP2pFsmInfo != NULL));
|
||||
|
||||
prChnlReqInfo = &prP2pFsmInfo->rChnlReqInfo;
|
||||
|
||||
|
||||
if (prChnlReqInfo->fgIsChannelRequested) {
|
||||
/* Release channel before timeout. */
|
||||
p2pFuncReleaseCh(prAdapter, prChnlReqInfo);
|
||||
}
|
||||
|
||||
|
||||
/* Stop timer for leaving this state. */
|
||||
cnmTimerStopTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer));
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return;
|
||||
} /* p2pStateAbort_IDLE */
|
||||
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateInit_CHNL_ON_HAND (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo
|
||||
)
|
||||
{
|
||||
P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL));
|
||||
|
||||
prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo);
|
||||
|
||||
/* Store the original channel info. */
|
||||
prChnlReqInfo->ucOriChnlNum = prP2pBssInfo->ucPrimaryChannel;
|
||||
prChnlReqInfo->eOriBand = prP2pBssInfo->eBand;
|
||||
prChnlReqInfo->eOriChnlSco = prP2pBssInfo->eBssSCO;
|
||||
|
||||
/* RX Probe Request would check primary channel.*/
|
||||
prP2pBssInfo->ucPrimaryChannel = prChnlReqInfo->ucReqChnlNum;
|
||||
prP2pBssInfo->eBand = prChnlReqInfo->eBand;
|
||||
prP2pBssInfo->eBssSCO = prChnlReqInfo->eChnlSco;
|
||||
|
||||
|
||||
DBGLOG(P2P, TRACE, ("start a channel on hand timer.\n"));
|
||||
cnmTimerStartTimer(prAdapter,
|
||||
&(prP2pFsmInfo->rP2pFsmTimeoutTimer),
|
||||
prChnlReqInfo->u4MaxInterval);
|
||||
|
||||
kalP2PIndicateChannelReady(prAdapter->prGlueInfo,
|
||||
prChnlReqInfo->u8Cookie,
|
||||
prChnlReqInfo->ucReqChnlNum,
|
||||
prChnlReqInfo->eBand,
|
||||
prChnlReqInfo->eChnlSco,
|
||||
prChnlReqInfo->u4MaxInterval);
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return;
|
||||
} /* p2pStateInit_CHNL_ON_HAND */
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateAbort_CHNL_ON_HAND (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
)
|
||||
{
|
||||
P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL;
|
||||
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL));
|
||||
|
||||
prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo);
|
||||
|
||||
cnmTimerStopTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer));
|
||||
|
||||
/* Restore the original channel info. */
|
||||
prP2pBssInfo->ucPrimaryChannel = prChnlReqInfo->ucOriChnlNum;
|
||||
prP2pBssInfo->eBand = prChnlReqInfo->eOriBand;
|
||||
prP2pBssInfo->eBssSCO = prChnlReqInfo->eOriChnlSco;
|
||||
|
||||
if (eNextState != P2P_STATE_CHNL_ON_HAND) {
|
||||
/* Indicate channel return. */
|
||||
kalP2PIndicateChannelExpired(prAdapter->prGlueInfo, &prP2pFsmInfo->rChnlReqInfo);
|
||||
|
||||
// Return Channel.
|
||||
p2pFuncReleaseCh(prAdapter, &(prP2pFsmInfo->rChnlReqInfo));
|
||||
}
|
||||
|
||||
} while (FALSE);
|
||||
return;
|
||||
} /* p2pStateAbort_CHNL_ON_HAND */
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateAbort_REQING_CHANNEL (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
)
|
||||
{
|
||||
P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL;
|
||||
P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL;
|
||||
|
||||
do {
|
||||
|
||||
ASSERT_BREAK((prAdapter != NULL) &&
|
||||
(prP2pFsmInfo != NULL) &&
|
||||
(eNextState < P2P_STATE_NUM));
|
||||
|
||||
prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]);
|
||||
prP2pSpecificBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo;
|
||||
|
||||
if (eNextState == P2P_STATE_IDLE) {
|
||||
if (prP2pBssInfo->eIntendOPMode == OP_MODE_ACCESS_POINT) {
|
||||
/* Intend to be AP. */
|
||||
/* Setup for AP mode. */
|
||||
p2pFuncStartGO(prAdapter,
|
||||
prP2pBssInfo,
|
||||
prP2pSpecificBssInfo->aucGroupSsid,
|
||||
prP2pSpecificBssInfo->u2GroupSsidLen,
|
||||
prP2pSpecificBssInfo->ucPreferredChannel,
|
||||
prP2pSpecificBssInfo->eRfBand,
|
||||
prP2pSpecificBssInfo->eRfSco,
|
||||
prP2pFsmInfo->fgIsApMode);
|
||||
|
||||
}
|
||||
else {
|
||||
// Return Channel.
|
||||
p2pFuncReleaseCh(prAdapter, &(prP2pFsmInfo->rChnlReqInfo));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return;
|
||||
} /* p2pStateInit_AP_CHANNEL_DETECT */
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateInit_AP_CHANNEL_DETECT (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo
|
||||
)
|
||||
{
|
||||
P_P2P_SCAN_REQ_INFO_T prScanReqInfo = (P_P2P_SCAN_REQ_INFO_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL));
|
||||
|
||||
prScanReqInfo = &(prP2pFsmInfo->rScanReqInfo);
|
||||
|
||||
prScanReqInfo->eScanType = SCAN_TYPE_PASSIVE_SCAN;
|
||||
prScanReqInfo->eChannelSet = SCAN_CHANNEL_2G4;
|
||||
prScanReqInfo->u2PassiveDewellTime = 50; // 50ms for passive channel load detection
|
||||
prScanReqInfo->fgIsAbort = TRUE;
|
||||
prScanReqInfo->fgIsScanRequest = TRUE;
|
||||
prScanReqInfo->ucNumChannelList = 0;
|
||||
prScanReqInfo->u4BufLength = 0;
|
||||
prScanReqInfo->rSsidStruct.ucSsidLen = 0;
|
||||
|
||||
p2pFuncRequestScan(prAdapter, prScanReqInfo);
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return;
|
||||
} /* p2pStateInit_AP_CHANNEL_DETECT */
|
||||
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateAbort_AP_CHANNEL_DETECT (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
)
|
||||
{
|
||||
P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL;
|
||||
P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
|
||||
|
||||
do {
|
||||
|
||||
if (eNextState == P2P_STATE_REQING_CHANNEL) {
|
||||
UINT_8 ucPreferedChnl = 0;
|
||||
ENUM_BAND_T eBand = BAND_NULL;
|
||||
ENUM_CHNL_EXT_T eSco = CHNL_EXT_SCN;
|
||||
|
||||
prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo);
|
||||
|
||||
/* Determine the channel for AP. */
|
||||
if (cnmPreferredChannel(prAdapter,
|
||||
&eBand,
|
||||
&ucPreferedChnl,
|
||||
&eSco) == FALSE) {
|
||||
|
||||
prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings;
|
||||
|
||||
if ((ucPreferedChnl = prP2pConnSettings->ucOperatingChnl) == 0) {
|
||||
|
||||
if (scnQuerySparseChannel(prAdapter, &eBand, &ucPreferedChnl) == FALSE) {
|
||||
|
||||
// What to do?
|
||||
ASSERT(FALSE);
|
||||
// TODO: Pick up a valid channel from channel list.
|
||||
ucPreferedChnl = 1;
|
||||
eBand = BAND_2G4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
prChnlReqInfo->eChannelReqType = CHANNEL_REQ_TYPE_GO_START_BSS;
|
||||
prChnlReqInfo->ucReqChnlNum = prP2pSpecificBssInfo->ucPreferredChannel = ucPreferedChnl;
|
||||
prChnlReqInfo->eBand = prP2pSpecificBssInfo->eRfBand = eBand;
|
||||
prChnlReqInfo->eChnlSco = prP2pSpecificBssInfo->eRfSco = eSco;
|
||||
}
|
||||
else {
|
||||
p2pFuncCancelScan(prAdapter, &(prP2pFsmInfo->rScanReqInfo));
|
||||
}
|
||||
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return;
|
||||
} /* p2pStateAbort_AP_CHANNEL_DETECT */
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateInit_SCAN (
|
||||
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo
|
||||
)
|
||||
{
|
||||
P_P2P_SCAN_REQ_INFO_T prScanReqInfo = (P_P2P_SCAN_REQ_INFO_T)NULL;
|
||||
|
||||
do {
|
||||
|
||||
ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL));
|
||||
|
||||
prScanReqInfo = &prP2pFsmInfo->rScanReqInfo;
|
||||
|
||||
prScanReqInfo->fgIsScanRequest = TRUE;
|
||||
|
||||
p2pFuncRequestScan(prAdapter, prScanReqInfo);
|
||||
|
||||
} while (FALSE);
|
||||
return;
|
||||
} /* p2pStateInit_SCAN */
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateAbort_SCAN (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
)
|
||||
{
|
||||
do {
|
||||
ASSERT_BREAK(prAdapter != NULL);
|
||||
|
||||
// 1. Scan cancel. (Make sure the scan request is invalid.
|
||||
p2pFuncCancelScan(prAdapter, &(prP2pFsmInfo->rScanReqInfo));
|
||||
|
||||
// Scan done indication.
|
||||
kalP2PIndicateScanDone(prAdapter->prGlueInfo, prP2pFsmInfo->rScanReqInfo.fgIsAbort);
|
||||
} while (FALSE);
|
||||
|
||||
return;
|
||||
} /* p2pStateAbort_SCAN */
|
||||
|
||||
|
||||
VOID
|
||||
p2pStateInit_GC_JOIN (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN P_BSS_INFO_T prP2pBssInfo,
|
||||
IN P_P2P_JOIN_INFO_T prJoinInfo,
|
||||
IN P_BSS_DESC_T prBssDesc
|
||||
)
|
||||
{
|
||||
P_MSG_JOIN_REQ_T prJoinReqMsg = (P_MSG_JOIN_REQ_T)NULL;
|
||||
P_STA_RECORD_T prStaRec = (P_STA_RECORD_T)NULL;
|
||||
P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) &&
|
||||
(prP2pFsmInfo != NULL) &&
|
||||
(prP2pBssInfo != NULL) &&
|
||||
(prJoinInfo != NULL) &&
|
||||
(prBssDesc != NULL));
|
||||
|
||||
prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings;
|
||||
|
||||
if (prBssDesc->ucSSIDLen) {
|
||||
COPY_SSID(prP2pConnSettings->aucSSID,
|
||||
prP2pConnSettings->ucSSIDLen,
|
||||
prBssDesc->aucSSID,
|
||||
prBssDesc->ucSSIDLen);
|
||||
}
|
||||
|
||||
|
||||
// Setup a join timer.
|
||||
DBGLOG(P2P, TRACE, ("Start a join init timer\n"));
|
||||
cnmTimerStartTimer(prAdapter,
|
||||
&(prP2pFsmInfo->rP2pFsmTimeoutTimer),
|
||||
(prP2pFsmInfo->u4GrantInterval - AIS_JOIN_CH_GRANT_THRESHOLD));
|
||||
|
||||
//2 <1> We are goin to connect to this BSS
|
||||
prBssDesc->fgIsConnecting = TRUE;
|
||||
|
||||
//2 <2> Setup corresponding STA_RECORD_T
|
||||
prStaRec = bssCreateStaRecFromBssDesc(prAdapter,
|
||||
(prBssDesc->fgIsP2PPresent?(STA_TYPE_P2P_GO):(STA_TYPE_LEGACY_AP)),
|
||||
NETWORK_TYPE_P2P_INDEX,
|
||||
prBssDesc);
|
||||
|
||||
if (prStaRec == NULL) {
|
||||
DBGLOG(P2P, TRACE, ("Create station record fail\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
prJoinInfo->prTargetStaRec = prStaRec;
|
||||
prJoinInfo->fgIsJoinComplete = FALSE;
|
||||
prJoinInfo->u4BufLength = 0;
|
||||
|
||||
//2 <2.1> Sync. to FW domain
|
||||
cnmStaRecChangeState(prAdapter, prStaRec, STA_STATE_1);
|
||||
|
||||
|
||||
if (prP2pBssInfo->eConnectionState == PARAM_MEDIA_STATE_DISCONNECTED) {
|
||||
P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings = (P_P2P_CONNECTION_SETTINGS_T)NULL;
|
||||
|
||||
prStaRec->fgIsReAssoc = FALSE;
|
||||
|
||||
prP2pConnSettings = prAdapter->rWifiVar.prP2PConnSettings;
|
||||
|
||||
switch (prP2pConnSettings->eAuthMode) {
|
||||
case AUTH_MODE_OPEN: /* Note: Omit break here. */
|
||||
case AUTH_MODE_WPA:
|
||||
case AUTH_MODE_WPA_PSK:
|
||||
case AUTH_MODE_WPA2:
|
||||
case AUTH_MODE_WPA2_PSK:
|
||||
prJoinInfo->ucAvailableAuthTypes = (UINT_8)AUTH_TYPE_OPEN_SYSTEM;
|
||||
break;
|
||||
case AUTH_MODE_SHARED:
|
||||
prJoinInfo->ucAvailableAuthTypes = (UINT_8)AUTH_TYPE_SHARED_KEY;
|
||||
break;
|
||||
case AUTH_MODE_AUTO_SWITCH:
|
||||
DBGLOG(P2P, LOUD, ("JOIN INIT: eAuthMode == AUTH_MODE_AUTO_SWITCH\n"));
|
||||
prJoinInfo->ucAvailableAuthTypes = (UINT_8)(AUTH_TYPE_OPEN_SYSTEM |
|
||||
AUTH_TYPE_SHARED_KEY);
|
||||
break;
|
||||
default:
|
||||
ASSERT(!(prP2pConnSettings->eAuthMode == AUTH_MODE_WPA_NONE));
|
||||
DBGLOG(P2P, ERROR, ("JOIN INIT: Auth Algorithm : %d was not supported by JOIN\n",
|
||||
prP2pConnSettings->eAuthMode));
|
||||
/* TODO(Kevin): error handling ? */
|
||||
return;
|
||||
}
|
||||
prStaRec->ucTxAuthAssocRetryLimit = TX_AUTH_ASSOCI_RETRY_LIMIT;
|
||||
}
|
||||
else {
|
||||
ASSERT(FALSE);
|
||||
// TODO: Shall we considering ROAMIN case for P2P Device?.
|
||||
}
|
||||
|
||||
|
||||
//2 <4> Use an appropriate Authentication Algorithm Number among the ucAvailableAuthTypes.
|
||||
if (prJoinInfo->ucAvailableAuthTypes &
|
||||
(UINT_8)AUTH_TYPE_OPEN_SYSTEM) {
|
||||
|
||||
DBGLOG(P2P, TRACE, ("JOIN INIT: Try to do Authentication with AuthType == OPEN_SYSTEM.\n"));
|
||||
|
||||
prJoinInfo->ucAvailableAuthTypes &=
|
||||
~(UINT_8)AUTH_TYPE_OPEN_SYSTEM;
|
||||
|
||||
prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_OPEN_SYSTEM;
|
||||
}
|
||||
else if (prJoinInfo->ucAvailableAuthTypes &
|
||||
(UINT_8)AUTH_TYPE_SHARED_KEY) {
|
||||
|
||||
DBGLOG(P2P, TRACE, ("JOIN INIT: Try to do Authentication with AuthType == SHARED_KEY.\n"));
|
||||
|
||||
prJoinInfo->ucAvailableAuthTypes &=
|
||||
~(UINT_8)AUTH_TYPE_SHARED_KEY;
|
||||
|
||||
prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_SHARED_KEY;
|
||||
}
|
||||
else if (prJoinInfo->ucAvailableAuthTypes &
|
||||
(UINT_8)AUTH_TYPE_FAST_BSS_TRANSITION) {
|
||||
|
||||
DBGLOG(P2P, TRACE, ("JOIN INIT: Try to do Authentication with AuthType == FAST_BSS_TRANSITION.\n"));
|
||||
|
||||
prJoinInfo->ucAvailableAuthTypes &=
|
||||
~(UINT_8)AUTH_TYPE_FAST_BSS_TRANSITION;
|
||||
|
||||
prStaRec->ucAuthAlgNum = (UINT_8)AUTH_ALGORITHM_NUM_FAST_BSS_TRANSITION;
|
||||
}
|
||||
else {
|
||||
ASSERT(0);
|
||||
}
|
||||
|
||||
|
||||
//4 <5> Overwrite Connection Setting for eConnectionPolicy == ANY (Used by Assoc Req)
|
||||
if (prBssDesc->ucSSIDLen) {
|
||||
COPY_SSID(prJoinInfo->rSsidStruct.aucSsid,
|
||||
prJoinInfo->rSsidStruct.ucSsidLen,
|
||||
prBssDesc->aucSSID,
|
||||
prBssDesc->ucSSIDLen);
|
||||
}
|
||||
|
||||
//2 <5> Backup desired channel.
|
||||
|
||||
//2 <6> Send a Msg to trigger SAA to start JOIN process.
|
||||
prJoinReqMsg = (P_MSG_JOIN_REQ_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_JOIN_REQ_T));
|
||||
|
||||
if (!prJoinReqMsg) {
|
||||
DBGLOG(P2P, TRACE, ("Allocation Join Message Fail\n"));
|
||||
ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
prJoinReqMsg->rMsgHdr.eMsgId = MID_P2P_SAA_FSM_START;
|
||||
prJoinReqMsg->ucSeqNum = ++prJoinInfo->ucSeqNumOfReqMsg;
|
||||
prJoinReqMsg->prStaRec = prStaRec;
|
||||
|
||||
// TODO: Consider fragmentation info in station record.
|
||||
|
||||
mboxSendMsg(prAdapter,
|
||||
MBOX_ID_0,
|
||||
(P_MSG_HDR_T)prJoinReqMsg,
|
||||
MSG_SEND_METHOD_BUF);
|
||||
|
||||
|
||||
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return;
|
||||
} /* p2pStateInit_GC_JOIN */
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief Process of JOIN Abort. Leave JOIN State & Abort JOIN.
|
||||
*
|
||||
* @param (none)
|
||||
*
|
||||
* @return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
p2pStateAbort_GC_JOIN (
|
||||
IN P_ADAPTER_T prAdapter,
|
||||
IN P_P2P_FSM_INFO_T prP2pFsmInfo,
|
||||
IN P_P2P_JOIN_INFO_T prJoinInfo,
|
||||
IN ENUM_P2P_STATE_T eNextState
|
||||
)
|
||||
{
|
||||
P_MSG_JOIN_ABORT_T prJoinAbortMsg = (P_MSG_JOIN_ABORT_T)NULL;
|
||||
|
||||
|
||||
do {
|
||||
ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL) && (prJoinInfo != NULL));
|
||||
|
||||
if (prJoinInfo->fgIsJoinComplete == FALSE) {
|
||||
|
||||
prJoinAbortMsg = (P_MSG_JOIN_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_JOIN_ABORT_T));
|
||||
if (!prJoinAbortMsg) {
|
||||
DBGLOG(P2P, TRACE, ("Fail to allocate join abort message buffer\n"));
|
||||
ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
prJoinAbortMsg->rMsgHdr.eMsgId = MID_P2P_SAA_FSM_ABORT;
|
||||
prJoinAbortMsg->ucSeqNum = prJoinInfo->ucSeqNumOfReqMsg;
|
||||
prJoinAbortMsg->prStaRec = prJoinInfo->prTargetStaRec;
|
||||
|
||||
mboxSendMsg(prAdapter,
|
||||
MBOX_ID_0,
|
||||
(P_MSG_HDR_T)prJoinAbortMsg,
|
||||
MSG_SEND_METHOD_BUF);
|
||||
|
||||
}
|
||||
|
||||
/* Stop Join Timer. */
|
||||
cnmTimerStopTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer));
|
||||
|
||||
/* Release channel requested. */
|
||||
p2pFuncReleaseCh(prAdapter, &(prP2pFsmInfo->rChnlReqInfo));
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
return;
|
||||
|
||||
} /* p2pStateAbort_GC_JOIN */
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,547 +0,0 @@
|
|||
/*
|
||||
** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/mgmt/rate.c#1 $
|
||||
*/
|
||||
|
||||
/*! \file "rate.c"
|
||||
\brief This file contains the transmission rate handling routines.
|
||||
|
||||
This file contains the transmission rate handling routines for setting up
|
||||
ACK/CTS Rate, Highest Tx Rate, Lowest Tx Rate, Initial Tx Rate and do
|
||||
conversion between Rate Set and Data Rates.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** $Log: rate.c $
|
||||
*
|
||||
* 07 08 2010 cp.wu
|
||||
*
|
||||
* [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
|
||||
*
|
||||
* 06 08 2010 cp.wu
|
||||
* [WPD00003833][MT6620 and MT5931] Driver migration
|
||||
* add rate.c.
|
||||
*
|
||||
* 03 16 2010 kevin.huang
|
||||
* [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
|
||||
* Add AdHoc Mode
|
||||
*
|
||||
* 12 18 2009 cm.chang
|
||||
* [BORA00000018]Integrate WIFI part into BORA for the 1st time
|
||||
* .
|
||||
*
|
||||
* Nov 23 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Update comments
|
||||
*
|
||||
* Nov 16 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
* Fix DBGLOG
|
||||
*
|
||||
* Nov 5 2009 mtk01461
|
||||
* [BORA00000018] Integrate WIFI part into BORA for the 1st time
|
||||
*
|
||||
** \main\maintrunk.MT5921\12 2008-12-19 17:19:32 GMT mtk01461
|
||||
** Fix the problem that do not ASSERT the length of Supported Rate IE == 8
|
||||
** \main\maintrunk.MT5921\11 2008-12-01 18:17:42 GMT mtk01088
|
||||
** fixed the lint "possible using null pointer" warning
|
||||
** \main\maintrunk.MT5921\10 2008-08-20 00:16:36 GMT mtk01461
|
||||
** Update for Driver Review
|
||||
** \main\maintrunk.MT5921\9 2008-04-13 21:17:13 GMT mtk01461
|
||||
** Revise GEN Link Speed OID
|
||||
** \main\maintrunk.MT5921\8 2008-03-28 10:40:13 GMT mtk01461
|
||||
** Add rateGetRateSetFromDataRates() for set desired rate OID
|
||||
** \main\maintrunk.MT5921\7 2008-03-26 09:16:20 GMT mtk01461
|
||||
** Add adopt operational rate as ACK rate if BasicRateSet was not found
|
||||
** Add comments
|
||||
** \main\maintrunk.MT5921\6 2008-02-21 15:01:39 GMT mtk01461
|
||||
** Add initial rate according rx signal quality support
|
||||
** \main\maintrunk.MT5921\5 2008-01-07 15:06:44 GMT mtk01461
|
||||
** Fix typo of rate adaptation of CtrlResp Frame
|
||||
** \main\maintrunk.MT5921\4 2007-10-25 18:05:12 GMT mtk01461
|
||||
** Add VOIP SCAN Support & Refine Roaming
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* C O M P I L E R F L A G S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* E X T E R N A L R E F E R E N C E S
|
||||
********************************************************************************
|
||||
*/
|
||||
#include "precomp.h"
|
||||
|
||||
/*******************************************************************************
|
||||
* C O N S T A N T S
|
||||
********************************************************************************
|
||||
*/
|
||||
/* The list of valid data rates. */
|
||||
const UINT_8 aucDataRate[] = {
|
||||
RATE_1M, /* RATE_1M_INDEX = 0 */
|
||||
RATE_2M, /* RATE_2M_INDEX */
|
||||
RATE_5_5M, /* RATE_5_5M_INDEX */
|
||||
RATE_11M, /* RATE_11M_INDEX */
|
||||
RATE_22M, /* RATE_22M_INDEX */
|
||||
RATE_33M, /* RATE_33M_INDEX */
|
||||
RATE_6M, /* RATE_6M_INDEX */
|
||||
RATE_9M, /* RATE_9M_INDEX */
|
||||
RATE_12M, /* RATE_12M_INDEX */
|
||||
RATE_18M, /* RATE_18M_INDEX */
|
||||
RATE_24M, /* RATE_24M_INDEX */
|
||||
RATE_36M, /* RATE_36M_INDEX */
|
||||
RATE_48M, /* RATE_48M_INDEX */
|
||||
RATE_54M, /* RATE_54M_INDEX */
|
||||
RATE_HT_PHY /* RATE_HT_PHY_INDEX */
|
||||
};
|
||||
|
||||
static const UINT_8 aucDefaultAckCtsRateIndex[RATE_NUM] = {
|
||||
RATE_1M_INDEX, /* RATE_1M_INDEX = 0 */
|
||||
RATE_2M_INDEX, /* RATE_2M_INDEX */
|
||||
RATE_5_5M_INDEX, /* RATE_5_5M_INDEX */
|
||||
RATE_11M_INDEX, /* RATE_11M_INDEX */
|
||||
RATE_1M_INDEX, /* RATE_22M_INDEX - Not supported */
|
||||
RATE_1M_INDEX, /* RATE_33M_INDEX - Not supported */
|
||||
RATE_6M_INDEX, /* RATE_6M_INDEX */
|
||||
RATE_6M_INDEX, /* RATE_9M_INDEX */
|
||||
RATE_12M_INDEX, /* RATE_12M_INDEX */
|
||||
RATE_12M_INDEX, /* RATE_18M_INDEX */
|
||||
RATE_24M_INDEX, /* RATE_24M_INDEX */
|
||||
RATE_24M_INDEX, /* RATE_36M_INDEX */
|
||||
RATE_24M_INDEX, /* RATE_48M_INDEX */
|
||||
RATE_24M_INDEX /* RATE_54M_INDEX */
|
||||
};
|
||||
|
||||
const BOOLEAN afgIsOFDMRate[RATE_NUM] = {
|
||||
FALSE, /* RATE_1M_INDEX = 0 */
|
||||
FALSE, /* RATE_2M_INDEX */
|
||||
FALSE, /* RATE_5_5M_INDEX */
|
||||
FALSE, /* RATE_11M_INDEX */
|
||||
FALSE, /* RATE_22M_INDEX - Not supported */
|
||||
FALSE, /* RATE_33M_INDEX - Not supported */
|
||||
TRUE, /* RATE_6M_INDEX */
|
||||
TRUE, /* RATE_9M_INDEX */
|
||||
TRUE, /* RATE_12M_INDEX */
|
||||
TRUE, /* RATE_18M_INDEX */
|
||||
TRUE, /* RATE_24M_INDEX */
|
||||
TRUE, /* RATE_36M_INDEX */
|
||||
TRUE, /* RATE_48M_INDEX */
|
||||
TRUE /* RATE_54M_INDEX */
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
* D A T A T Y P E S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P U B L I C D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* P R I V A T E D A T A
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* M A C R O S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N D E C L A R A T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
* F U N C T I O N S
|
||||
********************************************************************************
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief Convert the given Supported Rate & Extended Supported Rate IE to the
|
||||
* Operational Rate Set and Basic Rate Set, and also check if any Basic
|
||||
* Rate Code is unknown by driver.
|
||||
*
|
||||
* @param[in] prIeSupportedRate Pointer to the Supported Rate IE
|
||||
* @param[in] prIeExtSupportedRate Pointer to the Ext Supported Rate IE
|
||||
* @param[out] pu2OperationalRateSet Pointer to the Operational Rate Set
|
||||
* @param[out] pu2BSSBasicRateSet Pointer to the Basic Rate Set
|
||||
* @param[out] pfgIsUnknownBSSBasicRate Pointer to a Flag to indicate that Basic
|
||||
* Rate Set has unknown Rate Code
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
rateGetRateSetFromIEs (
|
||||
IN P_IE_SUPPORTED_RATE_T prIeSupportedRate,
|
||||
IN P_IE_EXT_SUPPORTED_RATE_T prIeExtSupportedRate,
|
||||
OUT PUINT_16 pu2OperationalRateSet,
|
||||
OUT PUINT_16 pu2BSSBasicRateSet,
|
||||
OUT PBOOLEAN pfgIsUnknownBSSBasicRate
|
||||
)
|
||||
{
|
||||
UINT_16 u2OperationalRateSet = 0;
|
||||
UINT_16 u2BSSBasicRateSet = 0;
|
||||
BOOLEAN fgIsUnknownBSSBasicRate = FALSE;
|
||||
UINT_8 ucRate;
|
||||
UINT_32 i, j;
|
||||
|
||||
|
||||
ASSERT(pu2OperationalRateSet);
|
||||
ASSERT(pu2BSSBasicRateSet);
|
||||
ASSERT(pfgIsUnknownBSSBasicRate);
|
||||
|
||||
if (prIeSupportedRate) {
|
||||
/* NOTE(Kevin): Buffalo WHR-G54S's supported rate set IE exceed 8.
|
||||
* IE_LEN(pucIE) == 12, "1(B), 2(B), 5.5(B), 6(B), 9(B), 11(B),
|
||||
* 12(B), 18(B), 24(B), 36(B), 48(B), 54(B)"
|
||||
*/
|
||||
//ASSERT(prIeSupportedRate->ucLength <= ELEM_MAX_LEN_SUP_RATES);
|
||||
ASSERT(prIeSupportedRate->ucLength <= RATE_NUM);
|
||||
|
||||
for (i = 0; i < prIeSupportedRate->ucLength; i++) {
|
||||
ucRate = prIeSupportedRate->aucSupportedRates[i] & RATE_MASK;
|
||||
|
||||
/* Search all valid data rates */
|
||||
for (j = 0; j < sizeof(aucDataRate)/sizeof(UINT_8); j++) {
|
||||
if (ucRate == aucDataRate[j]) {
|
||||
u2OperationalRateSet |= BIT(j);
|
||||
|
||||
if (prIeSupportedRate->aucSupportedRates[i] & RATE_BASIC_BIT) {
|
||||
u2BSSBasicRateSet |= BIT(j);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((j == sizeof(aucDataRate)/sizeof(UINT_8)) &&
|
||||
(prIeSupportedRate->aucSupportedRates[i] & RATE_BASIC_BIT)) {
|
||||
fgIsUnknownBSSBasicRate = TRUE; /* A data rate not list in the aucDataRate[] */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (prIeExtSupportedRate) {
|
||||
//ASSERT(prIeExtSupportedRate->ucLength <= ELEM_MAX_LEN_EXTENDED_SUP_RATES);
|
||||
|
||||
for (i = 0; i < prIeExtSupportedRate->ucLength; i++) {
|
||||
ucRate = prIeExtSupportedRate->aucExtSupportedRates[i] & RATE_MASK;
|
||||
|
||||
/* Search all valid data rates */
|
||||
for (j = 0; j < sizeof(aucDataRate)/sizeof(UINT_8); j++) {
|
||||
if (ucRate == aucDataRate[j]) {
|
||||
u2OperationalRateSet |= BIT(j);
|
||||
|
||||
if (prIeExtSupportedRate->aucExtSupportedRates[i] & RATE_BASIC_BIT) {
|
||||
u2BSSBasicRateSet |= BIT(j);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((j == sizeof(aucDataRate)/sizeof(UINT_8)) &&
|
||||
(prIeExtSupportedRate->aucExtSupportedRates[i] & RATE_BASIC_BIT)) {
|
||||
fgIsUnknownBSSBasicRate = TRUE; /* A data rate not list in the aucDataRate[] */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*pu2OperationalRateSet = u2OperationalRateSet;
|
||||
*pu2BSSBasicRateSet = u2BSSBasicRateSet;
|
||||
*pfgIsUnknownBSSBasicRate = fgIsUnknownBSSBasicRate;
|
||||
|
||||
return;
|
||||
|
||||
} /* end of rateGetRateSetFromIEs() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* @brief Convert the given Operational Rate Set & Basic Rate Set to the Rate Code
|
||||
* Format for used in (Ext)Supportec Rate IE.
|
||||
*
|
||||
* @param[in] u2OperationalRateSet Operational Rate Set
|
||||
* @param[in] u2BSSBasicRateSet Basic Rate Set
|
||||
* @param[out] pucDataRates Pointer to the Data Rate Buffer
|
||||
* @param[out] pucDataRatesLen Pointer to the Data Rate Buffer Length
|
||||
*
|
||||
* @return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
rateGetDataRatesFromRateSet (
|
||||
IN UINT_16 u2OperationalRateSet,
|
||||
IN UINT_16 u2BSSBasicRateSet,
|
||||
OUT PUINT_8 pucDataRates,
|
||||
OUT PUINT_8 pucDataRatesLen
|
||||
)
|
||||
{
|
||||
UINT_32 i, j;
|
||||
|
||||
|
||||
ASSERT(pucDataRates);
|
||||
ASSERT(pucDataRatesLen);
|
||||
|
||||
ASSERT(u2BSSBasicRateSet == (u2OperationalRateSet & u2BSSBasicRateSet));
|
||||
|
||||
for (i = RATE_1M_INDEX, j = 0; i < RATE_NUM; i++) {
|
||||
if (u2OperationalRateSet & BIT(i)) {
|
||||
|
||||
*(pucDataRates + j) = aucDataRate[i];
|
||||
|
||||
if (u2BSSBasicRateSet & BIT(i)) {
|
||||
*(pucDataRates + j) |= RATE_BASIC_BIT;
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
*pucDataRatesLen = (UINT_8)j;
|
||||
|
||||
return;
|
||||
|
||||
} /* end of rateGetDataRatesFromRateSet() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief Get the highest rate from given Rate Set.
|
||||
*
|
||||
* \param[in] u2RateSet Rate Set
|
||||
* \param[out] pucHighestRateIndex Pointer to buffer of the Highest Rate Index
|
||||
*
|
||||
* \retval TRUE Highest Rate Index was found
|
||||
* \retval FALSE Highest Rate Index was not found
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
rateGetHighestRateIndexFromRateSet (
|
||||
IN UINT_16 u2RateSet,
|
||||
OUT PUINT_8 pucHighestRateIndex
|
||||
)
|
||||
{
|
||||
INT_32 i;
|
||||
|
||||
|
||||
ASSERT(pucHighestRateIndex);
|
||||
|
||||
for (i = RATE_54M_INDEX; i >= RATE_1M_INDEX; i--) {
|
||||
if (u2RateSet & BIT(i)) {
|
||||
*pucHighestRateIndex = (UINT_8)i;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
} /* end of rateGetHighestRateIndexFromRateSet() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief Get the lowest rate from given Rate Set.
|
||||
*
|
||||
* \param[in] u2RateSet Rate Set
|
||||
* \param[out] pucLowestRateIndex Pointer to buffer of the Lowest Rate Index
|
||||
*
|
||||
* \retval TRUE Lowest Rate Index was found
|
||||
* \retval FALSE Lowest Rate Index was not found
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
rateGetLowestRateIndexFromRateSet (
|
||||
IN UINT_16 u2RateSet,
|
||||
OUT PUINT_8 pucLowestRateIndex
|
||||
)
|
||||
{
|
||||
UINT_32 i;
|
||||
|
||||
ASSERT(pucLowestRateIndex);
|
||||
|
||||
for (i = RATE_1M_INDEX; i <= RATE_54M_INDEX; i++) {
|
||||
if (u2RateSet & BIT(i)) {
|
||||
*pucLowestRateIndex = (UINT_8)i;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
} /* end of rateGetLowestRateIndexFromRateSet() */
|
||||
|
||||
|
||||
#if 0 // NOTE(Kevin): For reference
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief Convert the given Data Rates to the Rate Set.
|
||||
*
|
||||
* \param[in] pucDataRates Pointer to the Data Rates
|
||||
* \param[in] ucDataRatesLen Length of given Data Rates
|
||||
* \param[out] pu2RateSet Pointer to the Rate Set
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
rateGetRateSetFromDataRates (
|
||||
IN PUINT_8 pucDataRates,
|
||||
IN UINT_8 ucDataRatesLen,
|
||||
OUT PUINT_16 pu2RateSet
|
||||
)
|
||||
{
|
||||
UINT_16 u2RateSet = 0;
|
||||
UINT_8 ucRate;
|
||||
UINT_32 i, j;
|
||||
|
||||
|
||||
ASSERT(pucDataRates);
|
||||
ASSERT(pu2RateSet);
|
||||
|
||||
if (pucDataRates) {
|
||||
for (i = 0; i < ucDataRatesLen; i++) {
|
||||
ucRate = pucDataRates[i] & RATE_MASK;
|
||||
|
||||
/* Search all valid data rates */
|
||||
for (j = 0; j < sizeof(aucDataRate)/sizeof(UINT_8); j++) {
|
||||
if (ucRate == aucDataRate[j]) {
|
||||
u2RateSet |= BIT(j);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*pu2RateSet = u2RateSet;
|
||||
|
||||
return;
|
||||
|
||||
} /* end of rateGetRateSetFromDataRates() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief Parse the Operational Rate Set and Basic Rate Set to get the corresponding
|
||||
* ACK/CTS(Respnose) TX Rates.
|
||||
*
|
||||
* \param[in] u2OperationalRateSet Operational Rate Set
|
||||
* \param[in] u2BSSBasicRateSet Basic Rate Set
|
||||
* \param[out] aucAckCtsRateIndex Pointer to the Ack/Cts Data Rate Buffer
|
||||
*
|
||||
* \return (none)
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
VOID
|
||||
rateSetAckCtsDataRatesFromRateSet (
|
||||
IN UINT_16 u2OperationalRateSet,
|
||||
IN UINT_16 u2BSSBasicRateSet,
|
||||
IN OUT UINT_8 aucAckCtsRateIndex[]
|
||||
)
|
||||
{
|
||||
INT_32 i,j;
|
||||
|
||||
|
||||
ASSERT(aucAckCtsRateIndex);
|
||||
ASSERT(u2BSSBasicRateSet == (u2OperationalRateSet & u2BSSBasicRateSet));
|
||||
|
||||
/* Setup default ACK/CTS response rate */
|
||||
kalMemCopy(aucAckCtsRateIndex, (PVOID)aucDefaultAckCtsRateIndex, sizeof(aucDefaultAckCtsRateIndex));
|
||||
|
||||
|
||||
for (i = RATE_54M_INDEX; i >= RATE_1M_INDEX; i--) {
|
||||
if (u2OperationalRateSet & BIT(i)) {
|
||||
for (j = i; j >= RATE_1M_INDEX; j--) {
|
||||
if (u2BSSBasicRateSet & BIT(j)) {
|
||||
if ((afgIsOFDMRate[i] && afgIsOFDMRate[j]) || (!afgIsOFDMRate[i] && !afgIsOFDMRate[j])) // Reply ACK Frame at the same Modulation Scheme.
|
||||
aucAckCtsRateIndex[i] = (UINT_8)j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* NOTE(Kevin 2008/03/25): Following code is used for those AP which has
|
||||
* NULL BasicRateSet.
|
||||
* e.g. If input Operational Rate Set = [18M 12M 9M], Basic Rate Set = NULL.
|
||||
* Originally we'll get Ack Rate for [18M 12M 9M] is [12M 12M "6M"].
|
||||
* Now we'll get Ack Rate for [18M 12M 9M] is [12M 12M 9M],
|
||||
* The Ack Rate for Tx Rates which are not list in Operational Rate Set is still
|
||||
* use highest mandatory rate as default.
|
||||
*/
|
||||
if (j < RATE_1M_INDEX) { /* The ACK/CTS rate was not found in BasicRateSet */
|
||||
if (!(BIT(aucAckCtsRateIndex[i]) & u2OperationalRateSet)) {
|
||||
aucAckCtsRateIndex[i] = (UINT_8)i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
} /* end of rateSetAckCtsDataRatesFromRateSet() */
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/*!
|
||||
* \brief Get the proper initial rate from Rate Set according to given RCPI value
|
||||
*
|
||||
* \param[in] u2RateSet Rate Set
|
||||
* \param[in] rRcpi RCPI value from AP or Peer STA
|
||||
* \param[out] pucInitialRateIndex Pointer to buffer of the initial Rate Index
|
||||
*
|
||||
* \retval TRUE Initial Rate Index was found
|
||||
* \retval FALSE Initial Rate Index was not found
|
||||
*/
|
||||
/*----------------------------------------------------------------------------*/
|
||||
BOOLEAN
|
||||
rateGetBestInitialRateIndex (
|
||||
IN UINT_16 u2RateSet,
|
||||
IN RCPI rRcpi,
|
||||
OUT PUINT_8 pucInitialRateIndex
|
||||
)
|
||||
{
|
||||
UINT_16 u2InitRateSet;
|
||||
INT_32 i;
|
||||
|
||||
|
||||
ASSERT(pucInitialRateIndex);
|
||||
|
||||
DBGLOG(MGT, TRACE, ("rRcpi = %d\n", rRcpi));
|
||||
|
||||
if (rRcpi >= RCPI_100) { /* Best Signal */
|
||||
u2InitRateSet = INITIAL_RATE_SET(RCPI_100);
|
||||
}
|
||||
else if (rRcpi >= RCPI_80) { /* Better Signal */
|
||||
u2InitRateSet = INITIAL_RATE_SET(RCPI_80);
|
||||
}
|
||||
else if (rRcpi >= RCPI_60) { /* Good Signal */
|
||||
u2InitRateSet = INITIAL_RATE_SET(RCPI_60);
|
||||
}
|
||||
else { /* Worse Signal */
|
||||
/* NOTE(Kevin): If return FALSE, we should assign the BSS Basic Rate Index
|
||||
* (prBssInfo->ucBasicRateIndex) to the initial rate. It was determined in
|
||||
* function - bssUpdateTxRateForControlFrame().
|
||||
*/
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u2RateSet &= u2InitRateSet;
|
||||
|
||||
for (i = RATE_54M_INDEX; i >= RATE_1M_INDEX; i--) {
|
||||
if (u2RateSet & BIT(i)) {
|
||||
*pucInitialRateIndex = (UINT_8)i;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
} /* end of rateGetBestInitialRateIndex() */
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue