📄 rtmp_def.h
字号:
/* ************************************************************************* * Ralink Tech Inc. * 5F., No.36, Taiyuan St., Jhubei City, * Hsinchu County 302, * Taiwan, R.O.C. * * (c) Copyright 2002-2007, Ralink Technology, Inc. * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * * ************************************************************************* Module Name: rtmp_def.h Abstract: Miniport related definition header Revision History: Who When What -------- ---------- ---------------------------------------------- Paul Lin 08-01-2002 created John Chang 08-05-2003 add definition for 11g & other drafts*/#ifndef __RTMP_DEF_H__#define __RTMP_DEF_H__#include "oid.h"#undef AP_WSC_INCLUDED#undef STA_WSC_INCLUDED#undef WSC_INCLUDED#ifdef CONFIG_STA_SUPPORT#endif // CONFIG_STA_SUPPORT //#if defined(AP_WSC_INCLUDED) || defined(STA_WSC_INCLUDED)#define WSC_INCLUDED#endif//// Debug information verbosity: lower values indicate higher urgency//#define RT_DEBUG_OFF 0#define RT_DEBUG_ERROR 1#define RT_DEBUG_WARN 2#define RT_DEBUG_TRACE 3#define RT_DEBUG_INFO 4#define RT_DEBUG_LOUD 5#define NIC_TAG ((ULONG)'0682')#define NIC_DBG_STRING ("**RT28xx**")#ifdef SNMP_SUPPORT// for snmp // to get manufacturer OUI, kathy, 2008_0220#define ManufacturerOUI_LEN 3#define ManufacturerNAME ("Ralink Technology Company.")#define ResourceTypeIdName ("Ralink_ID")#endif //#define PACKED#define RALINK_2883_VERSION ((UINT32)0x28830300)#define RALINK_2880E_VERSION ((UINT32)0x28720200)#define RALINK_3070_VERSION ((UINT32)0x30700200)//// NDIS version in use by the NIC driver.// The high byte is the major version. The low byte is the minor version.//#ifdef NDIS51_MINIPORT#define NIC_DRIVER_VERSION 0x0501#else#define NIC_DRIVER_VERSION 0x0500#endif//// NDIS media type, current is ethernet, change if native wireless supported//#define NIC_MEDIA_TYPE NdisMedium802_3#define NIC_PCI_HDR_LENGTH 0xe2#define NIC_MAX_PACKET_SIZE 2304#define NIC_HEADER_SIZE 14#define MAX_MAP_REGISTERS_NEEDED 32#define MIN_MAP_REGISTERS_NEEDED 2 //Todo: should consider fragment issue.//// interface type, we use PCI//#define NIC_INTERFACE_TYPE NdisInterfacePci#define NIC_INTERRUPT_MODE NdisInterruptLevelSensitive//// buffer size passed in NdisMQueryAdapterResources// We should only need three adapter resources (IO, interrupt and memory),// Some devices get extra resources, so have room for 10 resources// UF_SIZE (sizeof(NDIS_RESOURCE_LIST) + (10*sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)))#define NIC_RESOURCE_B//// IO space length//#define NIC_MAP_IOSPACE_LENGTH sizeof(CSR_STRUC)#define MAX_RX_PKT_LEN 1520//// Entry number for each DMA descriptor ring//#ifdef RT2870#define TX_RING_SIZE 8 // 1#define PRIO_RING_SIZE 8#define MGMT_RING_SIZE 32 // PRIO_RING_SIZE#define RX_RING_SIZE 8#define MAX_TX_PROCESS 4#define LOCAL_TXBUF_SIZE 2048#endif // RT2870 //#ifdef MULTIPLE_CARD_SUPPORT// MC: Multple Cards#define MAX_NUM_OF_MULTIPLE_CARD 32#endif // MULTIPLE_CARD_SUPPORT //#define MAX_RX_PROCESS 128 //64 //32#define NUM_OF_LOCAL_TXBUF 2#define TXD_SIZE 16#define TXWI_SIZE 16#define RXD_SIZE 16#define RXWI_SIZE 16// TXINFO_SIZE + TXWI_SIZE + 802.11 Header Size + AMSDU sub frame header#define TX_DMA_1ST_BUFFER_SIZE 96 // only the 1st physical buffer is pre-allocated#define MGMT_DMA_BUFFER_SIZE 1536 //2048#define RX_BUFFER_AGGRESIZE 3840 //3904 //3968 //4096 //2048 //4096#define RX_BUFFER_NORMSIZE 3840 //3904 //3968 //4096 //2048 //4096#define TX_BUFFER_NORMSIZE RX_BUFFER_NORMSIZE#define MAX_FRAME_SIZE 2346 // Maximum 802.11 frame size#define MAX_AGGREGATION_SIZE 3840 //3904 //3968 //4096#define MAX_NUM_OF_TUPLE_CACHE 2#define MAX_MCAST_LIST_SIZE 32#define MAX_LEN_OF_VENDOR_DESC 64//#define MAX_SIZE_OF_MCAST_PSQ (NUM_OF_LOCAL_TXBUF >> 2) // AP won't spend more than 1/4 of total buffers on M/BCAST PSQ#define MAX_SIZE_OF_MCAST_PSQ 32#define MAX_RX_PROCESS_CNT (RX_RING_SIZE)#define MAX_PACKETS_IN_QUEUE (512) //(512) // to pass WMM A5-WPAPSK#define MAX_PACKETS_IN_MCAST_PS_QUEUE 32 #define MAX_PACKETS_IN_PS_QUEUE 128 //32#define WMM_NUM_OF_AC 4 /* AC0, AC1, AC2, and AC3 *///2008/09/11:KH add to support efuse<--#define MAX_EEPROM_BIN_FILE_SIZE 1024//2008/09/11:KH add to support efuse-->// RxFilter#define STANORMAL 0x17f97#define APNORMAL 0x15f97//// RTMP_ADAPTER flags//#define fRTMP_ADAPTER_MAP_REGISTER 0x00000001#define fRTMP_ADAPTER_INTERRUPT_IN_USE 0x00000002#define fRTMP_ADAPTER_HARDWARE_ERROR 0x00000004#define fRTMP_ADAPTER_SCATTER_GATHER 0x00000008#define fRTMP_ADAPTER_SEND_PACKET_ERROR 0x00000010#define fRTMP_ADAPTER_MLME_RESET_IN_PROGRESS 0x00000020#define fRTMP_ADAPTER_HALT_IN_PROGRESS 0x00000040#define fRTMP_ADAPTER_RESET_IN_PROGRESS 0x00000080#define fRTMP_ADAPTER_NIC_NOT_EXIST 0x00000100#define fRTMP_ADAPTER_TX_RING_ALLOCATED 0x00000200#define fRTMP_ADAPTER_REMOVE_IN_PROGRESS 0x00000400#define fRTMP_ADAPTER_MIMORATE_INUSED 0x00000800#define fRTMP_ADAPTER_RX_RING_ALLOCATED 0x00001000#define fRTMP_ADAPTER_INTERRUPT_ACTIVE 0x00002000#define fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS 0x00004000#define fRTMP_ADAPTER_REASSOC_IN_PROGRESS 0x00008000#define fRTMP_ADAPTER_MEDIA_STATE_PENDING 0x00010000#define fRTMP_ADAPTER_RADIO_OFF 0x00020000#define fRTMP_ADAPTER_BULKOUT_RESET 0x00040000#define fRTMP_ADAPTER_BULKIN_RESET 0x00080000#define fRTMP_ADAPTER_RDG_ACTIVE 0x00100000#define fRTMP_ADAPTER_DYNAMIC_BE_TXOP_ACTIVE 0x00200000#define fRTMP_ADAPTER_SCAN_2040 0x04000000#define fRTMP_ADAPTER_RADIO_MEASUREMENT 0x08000000#define fRTMP_ADAPTER_START_UP 0x10000000 //Devive already initialized and enabled Tx/Rx.#define fRTMP_ADAPTER_MEDIA_STATE_CHANGE 0x20000000#define fRTMP_ADAPTER_IDLE_RADIO_OFF 0x40000000// Lock bit for accessing different ring buffers//#define fRTMP_ADAPTER_TX_RING_BUSY 0x80000000//#define fRTMP_ADAPTER_MGMT_RING_BUSY 0x40000000//#define fRTMP_ADAPTER_ATIM_RING_BUSY 0x20000000//#define fRTMP_ADAPTER_RX_RING_BUSY 0x10000000// Lock bit for accessing different queue//#define fRTMP_ADAPTER_TX_QUEUE_BUSY 0x08000000//#define fRTMP_ADAPTER_MGMT_QUEUE_BUSY 0x04000000//// STA operation status flags//#define fOP_STATUS_INFRA_ON 0x00000001#define fOP_STATUS_ADHOC_ON 0x00000002#define fOP_STATUS_BG_PROTECTION_INUSED 0x00000004#define fOP_STATUS_SHORT_SLOT_INUSED 0x00000008#define fOP_STATUS_SHORT_PREAMBLE_INUSED 0x00000010#define fOP_STATUS_RECEIVE_DTIM 0x00000020//#define fOP_STATUS_TX_RATE_SWITCH_ENABLED 0x00000040#define fOP_STATUS_MEDIA_STATE_CONNECTED 0x00000080#define fOP_STATUS_WMM_INUSED 0x00000100#define fOP_STATUS_AGGREGATION_INUSED 0x00000200#define fOP_STATUS_DOZE 0x00000400 // debug purpose#define fOP_STATUS_PIGGYBACK_INUSED 0x00000800 // piggy-back, and aggregation#define fOP_STATUS_APSD_INUSED 0x00001000#define fOP_STATUS_TX_AMSDU_INUSED 0x00002000#define fOP_STATUS_MAX_RETRY_ENABLED 0x00004000#define fOP_STATUS_WAKEUP_NOW 0x00008000#define fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE 0x00020000#ifdef DOT11N_DRAFT3#define fOP_STATUS_SCAN_2040 0x00040000#endif // DOT11N_DRAFT3 //#define CCKSETPROTECT 0x1#define OFDMSETPROTECT 0x2#define MM20SETPROTECT 0x4#define MM40SETPROTECT 0x8#define GF20SETPROTECT 0x10#define GR40SETPROTECT 0x20#define ALLN_SETPROTECT (GR40SETPROTECT | GF20SETPROTECT | MM40SETPROTECT | MM20SETPROTECT)//// AP's client table operation status flags//#define fCLIENT_STATUS_WMM_CAPABLE 0x00000001 // CLIENT can parse QOS DATA frame#define fCLIENT_STATUS_AGGREGATION_CAPABLE 0x00000002 // CLIENT can receive Ralink's proprietary TX aggregation frame#define fCLIENT_STATUS_PIGGYBACK_CAPABLE 0x00000004 // CLIENT support piggy-back#define fCLIENT_STATUS_AMSDU_INUSED 0x00000008#define fCLIENT_STATUS_SGI20_CAPABLE 0x00000010#define fCLIENT_STATUS_SGI40_CAPABLE 0x00000020#define fCLIENT_STATUS_TxSTBC_CAPABLE 0x00000040#define fCLIENT_STATUS_RxSTBC_CAPABLE 0x00000080#define fCLIENT_STATUS_HTC_CAPABLE 0x00000100#define fCLIENT_STATUS_RDG_CAPABLE 0x00000200#define fCLIENT_STATUS_MCSFEEDBACK_CAPABLE 0x00000400#define fCLIENT_STATUS_APSD_CAPABLE 0x00000800 /* UAPSD STATION */#ifdef DOT11N_DRAFT3#define fCLIENT_STATUS_BSSCOEXIST_CAPABLE 0x00001000#endif // DOT11N_DRAFT3 //#define fCLIENT_STATUS_RALINK_CHIPSET 0x00100000//// STA configuration flags////#define fSTA_CFG_ENABLE_TX_BURST 0x00000001// 802.11n Operating Mode Definition. 0-3 also used in ASICUPdateProtect switch case #define HT_NO_PROTECT 0#define HT_LEGACY_PROTECT 1#define HT_40_PROTECT 2#define HT_2040_PROTECT 3#define HT_RTSCTS_6M 7//following is our own definition in order to turn on our ASIC protection register in INFRASTRUCTURE.#define HT_ATHEROS 8#define HT_FORCERTSCTS 9 // Force turn on RTS/CTS first. then go to evaluate if this force RTS is necessary.//// RX Packet Filter control flags. Apply on pAd->PacketFilter//#define fRX_FILTER_ACCEPT_DIRECT NDIS_PACKET_TYPE_DIRECTED#define fRX_FILTER_ACCEPT_MULTICAST NDIS_PACKET_TYPE_MULTICAST#define fRX_FILTER_ACCEPT_BROADCAST NDIS_PACKET_TYPE_BROADCAST#define fRX_FILTER_ACCEPT_ALL_MULTICAST NDIS_PACKET_TYPE_ALL_MULTICAST//// Error code section//// NDIS_ERROR_CODE_ADAPTER_NOT_FOUND#define ERRLOG_READ_PCI_SLOT_FAILED 0x00000101L#define ERRLOG_WRITE_PCI_SLOT_FAILED 0x00000102L#define ERRLOG_VENDOR_DEVICE_NOMATCH 0x00000103L// NDIS_ERROR_CODE_ADAPTER_DISABLED#define ERRLOG_BUS_MASTER_DISABLED 0x00000201L// NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION#define ERRLOG_INVALID_SPEED_DUPLEX 0x00000301L#define ERRLOG_SET_SECONDARY_FAILED 0x00000302L// NDIS_ERROR_CODE_OUT_OF_RESOURCES#define ERRLOG_OUT_OF_MEMORY 0x00000401L#define ERRLOG_OUT_OF_SHARED_MEMORY 0x00000402L#define ERRLOG_OUT_OF_MAP_REGISTERS 0x00000403L#define ERRLOG_OUT_OF_BUFFER_POOL 0x00000404L#define ERRLOG_OUT_OF_NDIS_BUFFER 0x00000405L#define ERRLOG_OUT_OF_PACKET_POOL 0x00000406L#define ERRLOG_OUT_OF_NDIS_PACKET 0x00000407L#define ERRLOG_OUT_OF_LOOKASIDE_MEMORY 0x00000408L// NDIS_ERROR_CODE_HARDWARE_FAILURE#define ERRLOG_SELFTEST_FAILED 0x00000501L#define ERRLOG_INITIALIZE_ADAPTER 0x00000502L#define ERRLOG_REMOVE_MINIPORT 0x00000503L// NDIS_ERROR_CODE_RESOURCE_CONFLICT#define ERRLOG_MAP_IO_SPACE 0x00000601L#define ERRLOG_QUERY_ADAPTER_RESOURCES 0x00000602L#define ERRLOG_NO_IO_RESOURCE 0x00000603L#define ERRLOG_NO_INTERRUPT_RESOURCE 0x00000604L#define ERRLOG_NO_MEMORY_RESOURCE 0x00000605L// WDS definition#define MAX_WDS_ENTRY 4#define WDS_PAIRWISE_KEY_OFFSET 60 // WDS links uses pairwise key#60 ~ 63 in ASIC pairwise key table#define WDS_DISABLE_MODE 0#define WDS_RESTRICT_MODE 1#define WDS_BRIDGE_MODE 2#define WDS_REPEATER_MODE 3#define WDS_LAZY_MODE 4#define MAX_MESH_NUM 0#define MAX_APCLI_NUM 0#define MAX_MBSSID_NUM 1#ifdef MBSS_SUPPORT#undef MAX_MBSSID_NUM#define MAX_MBSSID_NUM (8 - MAX_MESH_NUM - MAX_APCLI_NUM)#endif // MBSS_SUPPORT ///* sanity check for apidx */#define MBSS_MR_APIDX_SANITY_CHECK(apidx) \ { if (apidx > MAX_MBSSID_NUM) { \ printk("%s> Error! apidx = %d > MAX_MBSSID_NUM!\n", __FUNCTION__, apidx); \ apidx = MAIN_MBSSID; } }#define VALID_WCID(_wcid) ((_wcid) > 0 && (_wcid) < MAX_LEN_OF_MAC_TABLE )#define MAIN_MBSSID 0#define FIRST_MBSSID 1#define MAX_BEACON_SIZE 512// If the MAX_MBSSID_NUM is larger than 6, // it shall reserve some WCID space(wcid 222~253) for beacon frames. // - these wcid 238~253 are reserved for beacon#6(ra6).// - these wcid 222~237 are reserved for beacon#7(ra7).#if defined(MAX_MBSSID_NUM) && (MAX_MBSSID_NUM == 8)#define HW_RESERVED_WCID 222#elif defined(MAX_MBSSID_NUM) && (MAX_MBSSID_NUM == 7)#define HW_RESERVED_WCID 238#else#define HW_RESERVED_WCID 255#endif// Then dedicate wcid of DFS and Carrier-Sense.#define DFS_CTS_WCID (HW_RESERVED_WCID - 1)#define CS_CTS_WCID (HW_RESERVED_WCID - 2)#define LAST_SPECIFIC_WCID (HW_RESERVED_WCID - 2)// If MAX_MBSSID_NUM is 8, the maximum available wcid for the associated STA is 211. // If MAX_MBSSID_NUM is 7, the maximum available wcid for the associated STA is 228.#define MAX_AVAILABLE_CLIENT_WCID (LAST_SPECIFIC_WCID - MAX_MBSSID_NUM - 1) // TX need WCID to find Cipher Key
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -