📄 rt2570sw.h
字号:
////////////////////////////////////////////////////////////////////////////// VERSION_INFO exchanged between driver/application////////////////////////////////////////////////////////////////////////////typedef struct __VERSION_INFO{ UCHAR DriverMajorVersion; UCHAR DriverMinorVersion; UCHAR DriverSubVersion; USHORT DriverBuild; USHORT FwMajorVersion; USHORT FwMinorVersion; USHORT FwSubVersion; USHORT FwBuild;}VERSION_INFO, *PVERSION_INFO;#if 0////////////////////////////////////////////////////////////////////////////// The RX_BUFFER structure forms the Received USB packet from the device////////////////////////////////////////////////////////////////////////////typedef struct __RX_BUFFER{ USHORT WLength; UCHAR RxRate; //This field is not used in this version of Drv/FW UCHAR ChangeBSSID; UCHAR Fragmentation;//This field is not used in this version of Drv/FW UCHAR RSSI; UCHAR LinkQuality; UCHAR NoiseLevel; //This field is not used in this version of Drv/FW UCHAR RxTime[4]; //This field is not used in this version of Drv/FW UCHAR WirelessPacket[MAX_WIRELESS_SIZE];} RX_BUFFER, *PRX_BUFFER;#endif////////////////////////////////////////////////////////////////////////////// The TX_BUFFER structure forms the transmitted USB packet to the device////////////////////////////////////////////////////////////////////////////typedef struct _TX_BUFFER{// UINT BulkOutSize; TXD_STRUC TxDesc; UCHAR WirelessPacket[2342];} TX_BUFFER, *PTX_BUFFER;////////////////////////////////////////////////////////////////////////////// The RTS_BUFFER structure forms the transmitted USB packet to the device////////////////////////////////////////////////////////////////////////////typedef struct __RTS_BUFFER{ TXD_STRUC TxDesc; UCHAR RTSPacket[16];} RTS_BUFFER, *PRTS_BUFFER;////////////////////////////////////////////////////////////////////////////// The USB_CARD_CONFIG structure is used only during device initialization// to pass the initial operationg parameters to device////////////////////////////////////////////////////////////////////////////typedef struct __USB_CARD_CONFIG{ UCHAR ExcludeUnencrypted; UCHAR PromiscuousMode; UCHAR ShortRetryLimit; UCHAR EncryptionType; USHORT RtsThreshold; USHORT FragmentationThreshold; // 256..2346 UCHAR BasicRateSet[4]; BOOLEAN AutoRateFallBack; //0,1 UCHAR Channel; BOOLEAN PrivacyInvoked; UCHAR WEPDefaultKeyID; // 0..3 UCHAR CurrentSSID[32]; UCHAR WEPDefaultKeyValue[4][WEP_KEY_SIZE]; UCHAR SSIDLen; UCHAR ShortPreamble; USHORT BeaconPeriod;} USB_CARD_CONFIG, *PUSB_CARD_CONFIG;////////////////////////////////////////////////////////////////////////////// In WEP_INFO are kept all the WEP related parameters. This structure is// also exchanged between driver and application.////////////////////////////////////////////////////////////////////////////typedef struct __WEP_INFO{ UCHAR WepKeyToUse; UCHAR WepMode; USHORT AuthenticationType; UCHAR EncryptionLevel; UCHAR WepKey1[WEP_KEY_SIZE]; UCHAR WepKey2[WEP_KEY_SIZE]; UCHAR WepKey3[WEP_KEY_SIZE]; UCHAR WepKey4[WEP_KEY_SIZE];} WEP_INFO, *PWEP_INFO;////////////////////////////////////////////////////////////////////////////// In the STATISTICS structure are kept all the device's statitrics.// This structure is also exchanged between driver and application.////////////////////////////////////////////////////////////////////////////typedef struct __STATISTICS{ ULONG TxDataPacketsOk; ULONG TxDataPacketsError; ULONG TxMgmtPacketsOk; ULONG TxMgmtPacketsError; ULONG RxDataPacketsOk; ULONG RxDataPacketsError; ULONG RxMgmtPacketsOk; ULONG RxMgmtPacketsError; ULONG RxLost; ULONG TxPacketsRejectedNotReady; ULONG TxPacketsRejectedResources; ULONG MatchingBeacons;}STATISTICS, *PSTATISTICS;////////////////////////////////////////////////////////////////////////////// The BSS_INFO and SITE_SURVEY_INFO structures are used to form a custom// list of 12 maximum BSSs and keet there characteristics.// This list is the one that application displays in Site Survey Tab.////////////////////////////////////////////////////////////////////////////typedef struct __BSS_INFO{ UCHAR Channel; UCHAR SSID[ESS_ID_SIZE]; UCHAR SSIDsize; UCHAR BSSID[6]; UCHAR RSSI; UCHAR UsingWEP; UCHAR PreambleType; USHORT BeaconPeriod; UCHAR BSSType; //11->Ad-Hoc, 2->Infrastructure}BSS_INFO, *PBSS_INFO;#define MAX_AP_ENTRIES 30typedef struct __SITE_SURVEY_INFO{ BSS_INFO BSSinfo[MAX_AP_ENTRIES]; UCHAR BSSsInList; UCHAR UserSelectedIndex; UCHAR SiteSurveyState;}SITE_SURVEY_INFO, *PSITE_SURVEY_INFO;#ifdef WINXPtypedef struct __XP_BSSID_LIST{ ULONG NumberOfEntries; NDIS_WLAN_BSSID NdisBSSIDEntry[MAX_AP_ENTRIES];}XP_BSSID_LIST;#endif//#pragma pack(pop)////////////////////////////////////////////////////////////////////////////// The FRAGMENTED_PACKET structure is used for the reassembly of the// fragmented 802.11 packets in the driver////////////////////////////////////////////////////////////////////////////typedef struct __FRAGMENTED_PACKET{ USHORT Sequence; USHORT CurrentLen; UCHAR SourceAddress[6]; UCHAR FragmentNumber;//next fragment expected UCHAR WirelessPacket[MAX_WIRELESS_SIZE];}FRAGMENTED_PACKET, *PFRAGMENTED_PACKET;////////////////////////////////////////////////////////////////////////////// The ASYNC_OID structure is used for holding the context of an OID call// that the driver will complete asynchronously////////////////////////////////////////////////////////////////////////////typedef struct __ASYNC_OID{ PVOID InformationBuffer; ULONG InformationBufferLength; PULONG Bytes; PULONG BytesNeeded;}ASYNC_OID, *PASYNC_OID;#if 1//RT2460//// Some utility macros//#ifndef min#define min(_a, _b) (((_a) < (_b)) ? (_a) : (_b))#endif#ifndef max#define max(_a, _b) (((_a) > (_b)) ? (_a) : (_b))#endif#define INC_COUNTER(Val) (Val.QuadPart++)#define INFRA_ON(_p) (((_p)->PortCfg.Massoc) == TRUE) // Check Massoc#define ADHOC_ON(_p) (((_p)->PortCfg.Mibss) == TRUE) // check Mibss#define RTMP_SET_PACKET_FRAGMENTS(_p, number) ((_p)->cb[10] = number)#define RTMP_GET_PACKET_FRAGMENTS(_p) ((_p)->cb[10])#define RTMP_SET_PACKET_RTS(_p, number) ((_p)->cb[11] = number)#define RTMP_GET_PACKET_RTS(_p) ((_p)->cb[11])#define RTMP_SET_PACKET_FIRST_CONTEXT(_p, number) ((_p)->cb[12] = number)#define RTMP_GET_PACKET_FIRST_CONTEXT(_p) ((_p)->cb[12])//blue,#define RTMP_SET_PACKET_CONTEXTS_REQUIRED(_p, number) ((_p)->cb[13] = number)//blue,#define RTMP_GET_PACKET_CONTEXTS_REQUIRED(_p) ((_p)->cb[13])#define GET_NEXT_PACKET_IN_BULKOUT_QUEUE(_p) ((struct sk_buff **)&((_p)->cb[14]))#define MAKE_802_3_HEADER(_p, _pMac1, _pMac2, _pType) \{ \ memcpy(_p, _pMac1, ETH_LENGTH_OF_ADDRESS); \ memcpy((_p + ETH_LENGTH_OF_ADDRESS), _pMac2, ETH_LENGTH_OF_ADDRESS); \ memcpy((_p + ETH_LENGTH_OF_ADDRESS * 2), _pType, LENGTH_802_3_TYPE); \}//// Register set pair for initialzation register set definition//typedef struct _RTMP_REG_PAIR{ ULONG Register; ULONG Value;} RTMP_REG_PAIR, *PRTMP_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;typedef struct _RTMP_RF_REGS_1{ UCHAR Channel; ULONG TempR2; ULONG R1; ULONG R2; ULONG R3; ULONG R4;} RTMP_RF_REGS_1, *PRTMP_RF_REGS_1;//// Macros for flag and ref count operations//#define RTMP_SET_FLAG(_M, _F) ((_M)->Flags |= (_F))#define RTMP_CLEAR_FLAG(_M, _F) ((_M)->Flags &= ~(_F))#define RTMP_CLEAR_FLAGS(_M) ((_M)->Flags = 0)#define RTMP_TEST_FLAG(_M, _F) (((_M)->Flags & (_F)) != 0)#define RTMP_TEST_FLAGS(_M, _F) (((_M)->Flags & (_F)) == (_F))#define RTMP_INC_REF(_A) NdisInterlockedIncrement(&(_A)->RefCount)#define RTMP_DEC_REF(_A) NdisInterlockedDecrement(&(_A)->RefCount); ASSERT(_A->RefCount >= 0)#define RTMP_GET_REF(_A) ((_A)->RefCount)#define RTMP_INC_RCV_REF(_A) ((_A)->RcvRefCount++)#define RTMP_DEC_RCV_REF(_A) ((_A)->RcvRefCount--)#define RTMP_GET_RCV_REF(_A) ((_A)->RcvRefCount)#define RTMP_INC_SEND_REF(_A) ((_A)->SendRefCount++)#define RTMP_DEC_SEND_REF(_A) ((_A)->SendRefCount--)#define RTMP_GET_SEND_REF(_A) ((_A)->SendRefCount)#define RTMP_OFFSET(field) ((UINT)FIELD_OFFSET(RTMP_ADAPTER, field))#define RTMP_SIZE(field) sizeof(((PRT2570ADAPTER)0)->field)#define PORT_OFFSET(field) ((UINT)FIELD_OFFSET(PORT_CONFIG, field))#define PORT_SIZE(field) sizeof(((PPORT_CONFIG)0)->field)//blue,#define RTMP_IO_READ32(_A, _R, _pV) RTUSBReadMACRegister((_A), (_R), (_pV))//blue,#define RTMP_IO_WRITE32(_A, _R, _V) RTUSBReadMACRegister((_A), (_R), (_V))//// Statistic counter structure////mandatory counters from general and Ethernet statistics objectstypedef 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;//OID_802_11_STATISTICStypedef 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;//proprietary counterstypedef 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 DecryptCount; ULONG RxRingErrCount; ULONG EncryptCount; ULONG KickTxCount; ULONG TxRingErrCount; } COUNTER_RALINK, *PCOUNTER_RALINK;typedef struct _COUNTER_DRS { 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;// 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;// Shared key data structuretypedef struct _WPA_KEY { 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]; NDIS_802_11_MAC_ADDRESS BssId; // For pairwise key only UCHAR TxTsc[6]; // 48bit TSC value UCHAR RxTsc[6]; // 48bit TSC value UCHAR Type; // Indicate Pairwise / Group} WPA_KEY, *PWPA_KEY;// configuration to be used when this STA starts a new ADHOC networktypedef struct _IBSS_CONFIG { USHORT BeaconPeriod; USHORT AtimWin; UCHAR Channel; UCHAR SupportedRates[MAX_LEN_OF_SUPPORTED_RATES]; // Supported rates UCHAR SupportedRatesLen;} IBSS_CONFIG, *PIBSS_CONFIG;typedef struct _LED_CONTROL { BOOLEAN fOdd; BOOLEAN fRxActivity; BOOLEAN fSiteSurvey; BOOLEAN fLinkUp; RALINK_TIMER_STRUCT BlinkTimer; // 50 ms periodic timer// ULONG LastLedCsr; USHORT LastLedCsr;} LED_CONTROL;typedef 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -