📄 rtmp_def.h
字号:
/*************************************************************************** * Copyright (c) 2007, Ralink Technology Corporation * All rights reserved. * * Redistribution. Redistribution and use in binary form, without * modification, are permitted provided that the following conditions are * met: * * * Redistributions must reproduce the above copyright notice and the * following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of Ralink Technology Corporation nor the names of its * suppliers may be used to endorse or promote products derived from this * software without specific prior written permission. * * No reverse engineering, decompilation, or disassembly of this software * is permitted. * * Limited patent license. Ralink Technology Corporation grants a world-wide, * royalty-free, non-exclusive license under patents it now or hereafter * owns or controls to make, have made, use, import, offer to sell and * sell ("Utilize") this software, but solely to the extent that any * such patent is necessary to Utilize the software alone, or in * combination with an operating system licensed under an approved Open * Source license as listed by the Open Source Initiative at * http://opensource.org/licenses. The patent license shall not apply to * any other combinations which include this software. No hardware per * se is licensed hereunder. * * DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. *************************************************************************** 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__//// 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 ("**RT2860**")//#define PACKED//// 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)// TX need WCID to find Cipher Key// dedicate wcid of 254 and 253 for DFS and Carrier-Sense.#define DFS_CTS_WCID 254#define CS_CTS_WCID 253// reserve 252 ~~ for broadcast packet.#define GET_GroupKey_WCID(__wcid, __bssidx) \ { \ __wcid = 253 - (MAX_MBSSID_NUM) + __bssidx; \ }#define IsGroupKeyWCID(__wcid) (((__wcid) < 253) && ((__wcid) >= (253 - (MAX_MBSSID_NUM))))//// Entry number for each DMA descriptor ring//#define TX_RING_SIZE 64 //64#define MGMT_RING_SIZE 128#define RX_RING_SIZE 128 //64#define MAX_RX_PROCESS 128 //64 //32#define NUM_OF_LOCAL_TXBUF 2#define LOCAL_TXBUF_SIZE 2#define TXD_SIZE 16#define TXWI_SIZE 16#define RXD_SIZE 16#define RXWI_SIZE 16// 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 MAX_FRAME_SIZE 2346 // Maximum 802.11 frame size#define MAX_AGGREGATION_SIZE 3840 //3904 //3968 //4096#define MAX_TX_PROCESS TX_RING_SIZE //8#define MAX_DMA_DONE_PROCESS TX_RING_SIZE#define MAX_TX_DONE_PROCESS TX_RING_SIZE //8#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 32#define WMM_NUM_OF_AC 4 /* AC0, AC1, AC2, and AC3 */// RxFilter#define STANORMAL 0x17f97#define APNORMAL 0x14f97//// 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_RECEIVE_PACKET_ERROR 0x00000020#define fRTMP_ADAPTER_HALT_IN_PROGRESS 0x00000040#define fRTMP_ADAPTER_RESET_IN_PROGRESS 0x00000080#define fRTMP_ADAPTER_REMOVE_IN_PROGRESS 0x00000100//#define fRTMP_ADAPTER_TX_RING_ALLOCATED 0x00000200//#define fRTMP_ADAPTER_ATIM_RING_ALLOCATED 0x00000400//#define fRTMP_ADAPTER_PRIO_RING_ALLOCATED 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_MEDIA_STATE_CHANGE 0x00008000//#define fRTMP_ADAPTER_MEDIA_STATE_PENDING 0x00010000#define fRTMP_ADAPTER_RADIO_OFF 0x00020000#define fRTMP_ADAPTER_RADIO_MEASUREMENT 0x00040000#define fRTMP_ADAPTER_MIMORATE_INUSED 0x00080000#define fRTMP_ADAPTER_NIC_NOT_EXIST 0x02000000#define fRTMP_ADAPTER_START_UP 0x04000000 //Devive already initialized and enabled Tx/Rx.#define fRTMP_ADAPTER_RDG_ACTIVE 0x00100000 #define fRTMP_ADAPTER_DYNAMIC_BE_TXOP_ACTIVE 0x00200000 // 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 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 */#define fCLIENT_STATUS_RALINK_CHIPSET 0x00100000//// STA configuration flags////#define fSTA_CFG_ENABLE_TX_BURST 0x00000001//// 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#ifdef APCLI_SUPPORT#define MAX_APCLI_NUM 1#endif // APCLI_SUPPORT //#ifdef MBSS_SUPPORT#ifdef APCLI_SUPPORT#define MAX_MBSSID_NUM 3#else#define MAX_MBSSID_NUM 4#endif // APCLI_SUPPORT //#else#define MAX_MBSSID_NUM 1#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; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -