📄 rtmp.h
字号:
NONEPENDING, IRP0PENDING, IRP1PENDING} PendingIRP;typedef enum _BEACON_INDEX { BEACON0, BEACON1} BEACON_INDEX;#define IRPLOCK_COMPLETED 0#define IRPLOCK_CANCELABLE 1#define IRPLOCK_CANCE_START 2#define IRPLOCK_CANCE_COMPLETE 3//// 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; BOOLEAN InUse; BOOLEAN IRPPending; // TODO: To be removed atomic_t IrpLock;} RX_CONTEXT, *PRX_CONTEXT;//// Register set pair for initialzation register set definition//typedef struct _RTMP_REG_PAIR{ ULONG Register; ULONG Value;} RTMP_REG_PAIR, *PRTMP_REG_PAIR;typedef struct _BBP_REG_PAIR{ UCHAR Register; UCHAR Value;} BBP_REG_PAIR, *PBBP_REG_PAIR;//// Register set pair for initialzation register set definition//typedef struct _RTMP_RF_REGS{ UCHAR Channel; ULONG R1; ULONG R2; ULONG R3; ULONG R4;} RTMP_RF_REGS, *PRTMP_RF_REGS;//// Statistic counter structure//typedef struct _COUNTER_802_3{ // General Stats ULONG GoodTransmits; ULONG GoodReceives; ULONG TxErrors; ULONG RxErrors; ULONG RxNoBuffer; // Ethernet Stats ULONG RcvAlignmentErrors; ULONG OneCollision; ULONG MoreCollisions;} COUNTER_802_3, *PCOUNTER_802_3;typedef struct _COUNTER_802_11 { ULONG Length; LARGE_INTEGER TransmittedFragmentCount; LARGE_INTEGER MulticastTransmittedFrameCount; LARGE_INTEGER FailedCount; LARGE_INTEGER NoRetryCount; LARGE_INTEGER RetryCount; LARGE_INTEGER MultipleRetryCount; LARGE_INTEGER RTSSuccessCount; LARGE_INTEGER RTSFailureCount; LARGE_INTEGER ACKFailureCount; LARGE_INTEGER FrameDuplicateCount; LARGE_INTEGER ReceivedFragmentCount; LARGE_INTEGER MulticastReceivedFrameCount; LARGE_INTEGER FCSErrorCount;} COUNTER_802_11, *PCOUNTER_802_11;typedef struct _COUNTER_RALINK { ULONG TransmittedByteCount; // both successful and failure, used to calculate TX throughput ULONG ReceivedByteCount; // both CRC okay and CRC error, used to calculate RX throughput ULONG BeenDisassociatedCount; ULONG BadCQIAutoRecoveryCount; ULONG PoorCQIRoamingCount; ULONG MgmtRingFullCount; ULONG RxCount; ULONG RxRingErrCount; ULONG KickTxCount; ULONG TxRingErrCount; LARGE_INTEGER RealFcsErrCount; ULONG PendingNdisPacketCount; ULONG OneSecOsTxCount[NUM_OF_TX_RING]; ULONG OneSecDmaDoneCount[NUM_OF_TX_RING]; ULONG OneSecTxDoneCount; ULONG OneSecTxAggregationCount; ULONG OneSecRxAggregationCount; ULONG OneSecTxNoRetryOkCount; ULONG OneSecTxRetryOkCount; ULONG OneSecTxFailCount; ULONG OneSecFalseCCACnt; // CCA error count, for debug purpose, might move to global counter ULONG OneSecRxOkCnt; // RX without error ULONG OneSecRxFcsErrCnt; // CRC error ULONG OneSecBeaconSentCnt;} COUNTER_RALINK, *PCOUNTER_RALINK;typedef struct _COUNTER_DRS { // to record the each TX rate's quality. 0 is best, the bigger the worse. USHORT TxQuality[MAX_LEN_OF_SUPPORTED_RATES]; UCHAR PER[MAX_LEN_OF_SUPPORTED_RATES]; UCHAR TxRateUpPenalty; // extra # of second penalty due to last unstable condition ULONG CurrTxRateStableTime; // # of second in current TX rate BOOLEAN fNoisyEnvironment; UCHAR LastSecTxRateChangeAction; // 0: no change, 1:rate UP, 2:rate down} COUNTER_DRS, *PCOUNTER_DRS;typedef struct _COUNTER_QA { LARGE_INTEGER CRCErrorCount; LARGE_INTEGER RXOverFlowCount; LARGE_INTEGER PHYErrorCount; LARGE_INTEGER FalseCCACount; LARGE_INTEGER U2MDataCount; LARGE_INTEGER OtherDataCount; LARGE_INTEGER BeaconCount; LARGE_INTEGER othersCount;} COUNTER_QA, *PCOUNTER_QA;//// Arcfour Structure Added by PaulWu//typedef struct _ARCFOUR{ UINT X; UINT Y; UCHAR STATE[256];} ARCFOURCONTEXT, *PARCFOURCONTEXT;typedef struct PACKED _IV_CONTROL_{ union PACKED { struct PACKED { UCHAR rc0; UCHAR rc1; UCHAR rc2; union PACKED { struct PACKED {#ifdef BIG_ENDIAN UCHAR KeyID:2; UCHAR ExtIV:1; UCHAR Rsvd:5;#else UCHAR Rsvd:5; UCHAR ExtIV:1; UCHAR KeyID:2;#endif } field; UCHAR Byte; } CONTROL; } field; ULONG word; } IV16; ULONG IV32;} TKIP_IV, *PTKIP_IV;// Shared key data structuretypedef struct _WEP_KEY { UCHAR KeyLen; // Key length for each key, 0: entry is invalid UCHAR Key[MAX_LEN_OF_KEY]; // right now we implement 4 keys, 128 bits max} WEP_KEY, *PWEP_KEY;#if 0 // remove to rtmp_type.htypedef struct _CIPHER_KEY { UCHAR BssId[6]; UCHAR CipherAlg; // 0-none, 1:WEP64, 2:WEP128, 3:TKIP, 4:AES, 5:CKIP64, 6:CKIP128 UCHAR KeyLen; // Key length for each key, 0: entry is invalid UCHAR Key[16]; // right now we implement 4 keys, 128 bits max UCHAR RxMic[8]; UCHAR TxMic[8]; UCHAR TxTsc[6]; // 48bit TSC value UCHAR RxTsc[6]; // 48bit TSC value UCHAR Type; // Indicate Pairwise/Group when reporting MIC error} CIPHER_KEY, *PCIPHER_KEY;#endif // removetypedef struct _BBP_TUNING_STRUCT { BOOLEAN Enable; UCHAR FalseCcaCountUpperBound; // 100 per sec UCHAR FalseCcaCountLowerBound; // 10 per sec UCHAR R17LowerBound; // specified in E2PROM UCHAR R17UpperBound; // 0x68 according to David Tung UCHAR CurrentR17Value;} BBP_TUNING, *PBBP_TUNING;typedef struct _SOFT_RX_ANT_DIVERSITY_STRUCT { UCHAR EvaluatePeriod; // 0:not evalute status, 1: evaluate status, 2: switching status UCHAR Pair1PrimaryRxAnt; // 0:Ant-E1, 1:Ant-E2 UCHAR Pair1SecondaryRxAnt; // 0:Ant-E1, 1:Ant-E2 UCHAR Pair2PrimaryRxAnt; // 0:Ant-E3, 1:Ant-E4 UCHAR Pair2SecondaryRxAnt; // 0:Ant-E3, 1:Ant-E4 SHORT Pair1AvgRssi[2]; // AvgRssi[0]:E1, AvgRssi[1]:E2 SHORT Pair2AvgRssi[2]; // AvgRssi[0]:E3, AvgRssi[1]:E4 SHORT Pair1LastAvgRssi; // SHORT Pair2LastAvgRssi; // ULONG RcvPktNumWhenEvaluate; BOOLEAN FirstPktArrivedWhenEvaluate; RALINK_TIMER_STRUCT RxAntDiversityTimer;} SOFT_RX_ANT_DIVERSITY, *PSOFT_RX_ANT_DIVERSITY;typedef struct { BOOLEAN Enable; UCHAR Delta; BOOLEAN PlusSign;} CCK_TX_POWER_CALIBRATE, *PCCK_TX_POWER_CALIBRATE;//// Receive Tuple Cache Format//typedef struct _TUPLE_CACHE { BOOLEAN Valid; UCHAR MacAddress[MAC_ADDR_LEN]; USHORT Sequence; USHORT Frag;} TUPLE_CACHE, *PTUPLE_CACHE;//// Fragment Frame structure//typedef struct _FRAGMENT_FRAME { UCHAR Header802_11[LENGTH_802_11]; // add by johnli, fix WPAPSK/WPA2PSK bugs for receiving EAPoL fragmentation packets UCHAR Header802_3[LENGTH_802_3]; UCHAR Header_LLC[LENGTH_802_1_H]; UCHAR Buffer[LENGTH_802_3 + MAX_FRAME_SIZE]; // Add header to prevent NETBUEI continuous buffer isssue ULONG RxSize; USHORT Sequence; USHORT LastFrag; ULONG Flags; // Some extra frame information. bit 0: LLC presented} FRAGMENT_FRAME, *PFRAGMENT_FRAME;//// Tkip Key structure which RC4 key & MIC calculation//typedef struct _TKIP_KEY_INFO { UINT nBytesInM; // # bytes in M for MICKEY ULONG IV16; ULONG IV32; ULONG K0; // for MICKEY Low ULONG K1; // for MICKEY Hig ULONG L; // Current state for MICKEY ULONG R; // Current state for MICKEY ULONG M; // Message accumulator for MICKEY UCHAR RC4KEY[16]; UCHAR MIC[8];} TKIP_KEY_INFO, *PTKIP_KEY_INFO;//// Private / Misc data, counters for driver internal use//typedef struct __PRIVATE_STRUC { ULONG SystemResetCnt; // System reset counter ULONG TxRingFullCnt; // Tx ring full occurrance number ULONG PhyRxErrCnt; // PHY Rx error count, for debug purpose, might move to global counter // Variables for WEP encryption / decryption in rtmp_wep.c ULONG FCSCRC32; ARCFOURCONTEXT WEPCONTEXT; // Tkip stuff TKIP_KEY_INFO Tx; TKIP_KEY_INFO Rx;} PRIVATE_STRUC, *PPRIVATE_STRUC;#ifdef RALINK_ATEtypedef struct _ATE_INFO { UCHAR Mode; CHAR TxPower; UCHAR Addr1[6]; UCHAR Addr2[6]; UCHAR Addr3[6]; UCHAR Channel; ULONG TxLength; ULONG TxCount; ULONG TxDoneCount; ULONG TxRate; ULONG RFFreqOffset;} ATE_INFO, *PATE_INFO;#endif // RALINK_ATE// structure to tune BBP R17 "RX AGC VGC init"typedef struct _BBP_R17_TUNING { BOOLEAN bEnable; UCHAR R17LowerBoundG; UCHAR R17LowerBoundA; UCHAR R17UpperBoundG; UCHAR R17UpperBoundA;// UCHAR LastR17Value;// SHORT R17Dec; // R17Dec = 0x79 - RssiToDbm, for old version R17Dec = 0.// // This is signed value USHORT FalseCcaLowerThreshold; // default 100 USHORT FalseCcaUpperThreshold; // default 512 UCHAR R17Delta; // R17 +- R17Delta whenever false CCA over UpperThreshold or lower than LowerThreshold UCHAR R17CurrentValue; BOOLEAN R17LowerUpperSelect; //Before LinkUp, Used LowerBound or UpperBound as R17 value.} BBP_R17_TUNING, *PBBP_R17_TUNING;// structure to store channel TX powertypedef struct _CHANNEL_TX_POWER { UCHAR Channel; CHAR Power;} CHANNEL_TX_POWER, *PCHANNEL_TX_POWER;typedef enum _ABGBAND_STATE_ { UNKNOWN_BAND, BG_BAND, A_BAND,} ABGBAND_STATE;typedef struct _MLME_MEMORY_STRUCT { PVOID AllocVa; //Pointer to the base virtual address of the allocated memory struct _MLME_MEMORY_STRUCT *Next; //Pointer to the next virtual address of the allocated memory} MLME_MEMORY_STRUCT, *PMLME_MEMORY_STRUCT;typedef struct _MLME_MEMORY_HANDLER { BOOLEAN MemRunning; //The flag of the Mlme memory handler's status UINT MemoryCount; //Total nonpaged system-space memory not size UINT InUseCount; //Nonpaged system-space memory in used counts UINT UnUseCount; //Nonpaged system-space memory available counts UINT PendingCount; //Nonpaged system-space memory for free counts PMLME_MEMORY_STRUCT pInUseHead; //Pointer to the first nonpaed memory not used PMLME_MEMORY_STRUCT pInUseTail; //Pointer to the last nonpaged memory not used PMLME_MEMORY_STRUCT pUnUseHead; //Pointer to the first nonpaged memory in used PMLME_MEMORY_STRUCT pUnUseTail; //Pointer to the last nonpaged memory in used PULONG MemFreePending[MAX_MLME_HANDLER_MEMORY]; //an array to keep pending free-memory's pointer (32bits)} MLME_MEMORY_HANDLER, *PMLME_MEMORY_HANDLER;typedef struct _MLME_STRUCT { STATE_MACHINE CntlMachine; STATE_MACHINE AssocMachine; STATE_MACHINE AuthMachine; STATE_MACHINE AuthRspMachine; STATE_MACHINE SyncMachine; STATE_MACHINE WpaPskMachine; STATE_MACHINE_FUNC AssocFunc[ASSOC_FUNC_SIZE]; STATE_MACHINE_FUNC AuthFunc[AUTH_FUNC_SIZE]; STATE_MACHINE_FUNC AuthRspFunc[AUTH_RSP_FUNC_SIZE]; STATE_MACHINE_FUNC SyncFunc[SYNC_FUNC_SIZE]; STATE_MACHINE_FUNC WpaPskFunc[WPA_PSK_FUNC_SIZE]; ULONG ChannelQuality; // 0..100, Channel Quality Indication for Roaming ULONG Now32; // latch the value of NdisGetSystemUpTime() BOOLEAN bRunning; spinlock_t TaskLock; MLME_QUEUE Queue; UINT ShiftReg; RALINK_TIMER_STRUCT PeriodicTimer; RALINK_TIMER_STRUCT LinkDownTimer; ULONG PeriodicRound; MLME_MEMORY_HANDLER MemHandler; //The handler of the nonpaged memory inside MLME } MLME_STRUCT, *PMLME_STRUCT;//// Management ring buffer format//typedef struct PACKED _MGMT_STRUC { BOOLEAN Valid; PUCHAR pBuffer; ULONG Length;} MGMT_STRUC, *PMGMT_STRUC;// structure for radar detection and channel switchtypedef struct _RADAR_DETECT_STRUCT { UCHAR CSCount; //Channel switch counter UCHAR CSPeriod; //Channel switch period (beacon count) UCHAR RDCount; //Radar detection counter UCHAR RDMode; //Radar Detection mode UCHAR BBPR16; UCHAR BBPR17; UCHAR BBPR18; UCHAR BBPR21; UCHAR BBPR22; UCHAR BBPR64; ULONG InServiceMonitorCount; // unit: sec} RADAR_DETECT_STRUCT, *PRADAR_DETECT_STRUCT;//// configuration and status//typedef struct _PORT_CONFIG { // MIB:ieee802dot11.dot11smt(1).dot11StationConfigTable(1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -