📄 rtmp.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.h Abstract: Miniport generic portion header file Revision History: Who When What -------- ---------- ---------------------------------------------- Paul Lin 2002-08-01 created James Tan 2002-09-06 modified (Revise NTCRegTable) John Chang 2004-09-06 modified for RT2600 */#ifndef __RTMP_H__#define __RTMP_H__#include "link_list.h"#include "spectrum_def.h"#ifdef MLME_EX#include "mlme_ex_def.h"#endif // MLME_EX //#ifdef CONFIG_STA_SUPPORT#include <aironet.h>#endif // CONFIG_STA_SUPPORT //#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//#define DBG 1//#define DBG_DIAGNOSE 1#if defined(CONFIG_AP_SUPPORT) && defined(CONFIG_STA_SUPPORT)#define IF_DEV_CONFIG_OPMODE_ON_AP(_pAd) if(_pAd->OpMode == OPMODE_AP)#define IF_DEV_CONFIG_OPMODE_ON_STA(_pAd) if(_pAd->OpMode == OPMODE_STA)#else#define IF_DEV_CONFIG_OPMODE_ON_AP(_pAd)#define IF_DEV_CONFIG_OPMODE_ON_STA(_pAd)#endif#define VIRTUAL_IF_INC(__pAd) ((__pAd)->VirtualIfCnt++)#define VIRTUAL_IF_DEC(__pAd) ((__pAd)->VirtualIfCnt--)#define VIRTUAL_IF_NUM(__pAd) ((__pAd)->VirtualIfCnt)#ifdef RT2870////////////////////////////////////////////////////////////////////////////// The TX_BUFFER structure forms the transmitted USB packet to the device////////////////////////////////////////////////////////////////////////////typedef struct __TX_BUFFER{ union { UCHAR WirelessPacket[TX_BUFFER_NORMSIZE]; HEADER_802_11 NullFrame; PSPOLL_FRAME PsPollPacket; RTS_FRAME RTSFrame; }field; UCHAR Aggregation[4]; //Buffer for save Aggregation size.} TX_BUFFER, *PTX_BUFFER;typedef struct __HTTX_BUFFER{ union { UCHAR WirelessPacket[MAX_TXBULK_SIZE]; HEADER_802_11 NullFrame; PSPOLL_FRAME PsPollPacket; RTS_FRAME RTSFrame; }field; UCHAR Aggregation[4]; //Buffer for save Aggregation size.} HTTX_BUFFER, *PHTTX_BUFFER;// used to track driver-generated write irps typedef struct _TX_CONTEXT{ PVOID pAd; //Initialized in MiniportInitialize PURB pUrb; //Initialized in MiniportInitialize PIRP pIrp; //used to cancel pending bulk out. //Initialized in MiniportInitialize PTX_BUFFER TransferBuffer; //Initialized in MiniportInitialize ULONG BulkOutSize; UCHAR BulkOutPipeId; UCHAR SelfIdx; BOOLEAN InUse; BOOLEAN bWaitingBulkOut; // at least one packet is in this TxContext, ready for making IRP anytime. BOOLEAN bFullForBulkOut; // all tx buffer are full , so waiting for tx bulkout. BOOLEAN IRPPending; BOOLEAN LastOne; BOOLEAN bAggregatible; UCHAR Header_802_3[LENGTH_802_3]; UCHAR Rsv[2]; ULONG DataOffset; UINT TxRate; dma_addr_t data_dma; // urb dma on linux} TX_CONTEXT, *PTX_CONTEXT, **PPTX_CONTEXT;// used to track driver-generated write irps typedef struct _HT_TX_CONTEXT{ PVOID pAd; //Initialized in MiniportInitialize PURB pUrb; //Initialized in MiniportInitialize PIRP pIrp; //used to cancel pending bulk out. //Initialized in MiniportInitialize PHTTX_BUFFER TransferBuffer; //Initialized in MiniportInitialize ULONG BulkOutSize; // Indicate the total bulk-out size in bytes in one bulk-transmission UCHAR BulkOutPipeId; BOOLEAN IRPPending; BOOLEAN LastOne; BOOLEAN bCurWriting; BOOLEAN bRingEmpty; BOOLEAN bCopySavePad; UCHAR SavedPad[8]; UCHAR Header_802_3[LENGTH_802_3]; ULONG CurWritePosition; // Indicate the buffer offset which packet will be inserted start from. ULONG CurWriteRealPos; // Indicate the buffer offset which packet now are writing to. ULONG NextBulkOutPosition; // Indicate the buffer start offset of a bulk-transmission ULONG ENextBulkOutPosition; // Indicate the buffer end offset of a bulk-transmission UINT TxRate; dma_addr_t data_dma; // urb dma on linux} HT_TX_CONTEXT, *PHT_TX_CONTEXT, **PPHT_TX_CONTEXT;//// Structure to keep track of receive packets and buffers to indicate// receive data to the protocol.//typedef struct _RX_CONTEXT{ PUCHAR TransferBuffer; PVOID pAd; PIRP pIrp;//used to cancel pending bulk in. PURB pUrb; //These 2 Boolean shouldn't both be 1 at the same time. ULONG BulkInOffset; // number of packets waiting for reordering . // BOOLEAN ReorderInUse; // At least one packet in this buffer are in reordering buffer and wait for receive indication BOOLEAN bRxHandling; // Notify this packet is being process now. BOOLEAN InUse; // USB Hardware Occupied. Wait for USB HW to put packet. BOOLEAN Readable; // Receive Complete back. OK for driver to indicate receiving packet. BOOLEAN IRPPending; // TODO: To be removed atomic_t IrpLock; NDIS_SPIN_LOCK RxContextLock; dma_addr_t data_dma; // urb dma on linux} RX_CONTEXT, *PRX_CONTEXT;#endif // RT2870 ////// NDIS Version definitions//#ifdef NDIS50_MINIPORT#define RTMP_NDIS_MAJOR_VERSION 5#define RTMP_NDIS_MINOR_VERSION 0#endif#ifdef NDIS51_MINIPORT#define RTMP_NDIS_MAJOR_VERSION 5#define RTMP_NDIS_MINOR_VERSION 1#endifextern char NIC_VENDOR_DESC[];extern int NIC_VENDOR_DESC_LEN;extern unsigned char SNAP_AIRONET[];extern unsigned char CipherSuiteCiscoCCKM[];extern unsigned char CipherSuiteCiscoCCKMLen;extern unsigned char CipherSuiteCiscoCCKM24[];extern unsigned char CipherSuiteCiscoCCKM24Len;extern unsigned char CipherSuiteCCXTkip[];extern unsigned char CipherSuiteCCXTkipLen;extern unsigned char CISCO_OUI[];extern UCHAR BaSizeArray[4];extern UCHAR BROADCAST_ADDR[MAC_ADDR_LEN];extern UCHAR MULTICAST_ADDR[MAC_ADDR_LEN];extern UCHAR ZERO_MAC_ADDR[MAC_ADDR_LEN];extern ULONG BIT32[32];extern UCHAR BIT8[8];extern char* CipherName[];extern char* MCSToMbps[];extern UCHAR RxwiMCSToOfdmRate[12];extern UCHAR SNAP_802_1H[6];extern UCHAR SNAP_BRIDGE_TUNNEL[6];extern UCHAR SNAP_AIRONET[8];extern UCHAR CKIP_LLC_SNAP[8];extern UCHAR EAPOL_LLC_SNAP[8];extern UCHAR EAPOL[2];extern UCHAR IPX[2];extern UCHAR APPLE_TALK[2];extern UCHAR RateIdToPlcpSignal[12]; // see IEEE802.11a-1999 p.14extern UCHAR OfdmRateToRxwiMCS[];extern UCHAR OfdmSignalToRateId[16] ;extern UCHAR default_cwmin[4];extern UCHAR default_cwmax[4];extern UCHAR default_sta_aifsn[4];extern UCHAR MapUserPriorityToAccessCategory[8];extern USHORT RateUpPER[];extern USHORT RateDownPER[];extern UCHAR Phy11BNextRateDownward[];extern UCHAR Phy11BNextRateUpward[];extern UCHAR Phy11BGNextRateDownward[];extern UCHAR Phy11BGNextRateUpward[];extern UCHAR Phy11ANextRateDownward[];extern UCHAR Phy11ANextRateUpward[];extern CHAR RssiSafeLevelForTxRate[];extern UCHAR RateIdToMbps[];extern USHORT RateIdTo500Kbps[];extern UCHAR CipherSuiteWpaNoneTkip[];extern UCHAR CipherSuiteWpaNoneTkipLen;extern UCHAR CipherSuiteWpaNoneAes[];extern UCHAR CipherSuiteWpaNoneAesLen;extern UCHAR SsidIe;extern UCHAR SupRateIe;extern UCHAR ExtRateIe;#ifdef DOT11_N_SUPPORTextern UCHAR HtCapIe;extern UCHAR AddHtInfoIe;extern UCHAR NewExtChanIe;#ifdef DOT11N_DRAFT3extern UCHAR ExtHtCapIe;#endif // DOT11N_DRAFT3 //#endif // DOT11_N_SUPPORT //extern UCHAR ErpIe;extern UCHAR DsIe;extern UCHAR TimIe;extern UCHAR WpaIe;extern UCHAR Wpa2Ie;extern UCHAR IbssIe;extern UCHAR Ccx2Ie;extern UCHAR WapiIe;extern UCHAR WPA_OUI[];extern UCHAR RSN_OUI[];extern UCHAR WAPI_OUI[];extern UCHAR WME_INFO_ELEM[];extern UCHAR WME_PARM_ELEM[];extern UCHAR Ccx2QosInfo[];extern UCHAR Ccx2IeInfo[];extern UCHAR RALINK_OUI[];extern UCHAR PowerConstraintIE[];extern UCHAR RateSwitchTable[];extern UCHAR RateSwitchTable11B[];extern UCHAR RateSwitchTable11G[];extern UCHAR RateSwitchTable11BG[];#ifdef DOT11_N_SUPPORTextern UCHAR RateSwitchTable11BGN1S[];extern UCHAR RateSwitchTable11BGN2S[];extern UCHAR RateSwitchTable11BGN2SForABand[];extern UCHAR RateSwitchTable11N1S[];extern UCHAR RateSwitchTable11N2S[];extern UCHAR RateSwitchTable11N2SForABand[];#ifdef CONFIG_STA_SUPPORTextern UCHAR PRE_N_HT_OUI[];#endif // CONFIG_STA_SUPPORT //#endif // DOT11_N_SUPPORT //#define MAXSEQ (0xFFF)#ifdef RALINK_ATEtypedef struct _ATE_INFO { UCHAR Mode; CHAR TxPower0; CHAR TxPower1; CHAR TxAntennaSel; CHAR RxAntennaSel; TXWI_STRUC TxWI; // TXWI USHORT QID; UCHAR Addr1[MAC_ADDR_LEN]; UCHAR Addr2[MAC_ADDR_LEN]; UCHAR Addr3[MAC_ADDR_LEN]; UCHAR Channel; UINT32 TxLength; UINT32 TxCount; UINT32 TxDoneCount; // Tx DMA Done UINT32 RFFreqOffset; BOOLEAN bRxFer; BOOLEAN bQATxStart; // Have compiled QA in and use it to ATE tx. BOOLEAN bQARxStart; // Have compiled QA in and use it to ATE rx. UINT32 RxTotalCnt; UINT32 RxCntPerSec; CHAR LastSNR0; // last received SNR CHAR LastSNR1; // last received SNR for 2nd antenna CHAR LastRssi0; // last received RSSI CHAR LastRssi1; // last received RSSI for 2nd antenna CHAR LastRssi2; // last received RSSI for 3rd antenna CHAR AvgRssi0; // last 8 frames' average RSSI CHAR AvgRssi1; // last 8 frames' average RSSI CHAR AvgRssi2; // last 8 frames' average RSSI SHORT AvgRssi0X8; // sum of last 8 frames' RSSI SHORT AvgRssi1X8; // sum of last 8 frames' RSSI SHORT AvgRssi2X8; // sum of last 8 frames' RSSI UINT32 NumOfAvgRssiSample;#ifdef RALINK_28xx_QA // Tx frame#ifdef RT2870 /* not used in RT2860 */ TXINFO_STRUC TxInfo; // TxInfo#endif // RT2870 // USHORT HLen; // Header Length USHORT PLen; // Pattern Length
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -