📄 rt2570sw.h
字号:
//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 ResetCountDown; // Count down before issue reset, patch for RT2430// ULONG CCAErrCnt; // CCA error count, for debug purpose, might move to global counter ULONG PhyRxErrCnt; // PHY Rx error count, for debug purpose, might move to global counter ULONG PhyTxErrCnt; // PHY Tx error count, for debug purpose, might move to global counter // Variables for WEP encryption / decryption in rtmp_wep.c ULONG FCSCRC32; ULONG RxSetCnt; ULONG DecryptCnt; ARCFOURCONTEXT WEPCONTEXT; // Tkip stuff TKIP_KEY_INFO Tx; TKIP_KEY_INFO Rx;} PRIVATE_STRUC, *PPRIVATE_STRUC;///////////////////Vendor Commands/////////////////#define COMMAND_QUEUE_SIZE 11typedef struct _CmdQElmt { UINT command; PVOID buffer; ULONG bufferlength; BOOLEAN CmdFromNdis; BOOLEAN SetOperation; BOOLEAN InUse;//blue struct _CmdQElmt *next;} CmdQElmt, *PCmdQElmt;typedef struct _CmdQ { UINT size; CmdQElmt *head; CmdQElmt *tail;} CmdQ, *PCmdQ;typedef enum _BULK_OUT_TYPE { DATA, MLME, BEACON, PS_POLL, ALL} BULK_OUT_TYPE;#if 0typedef struct _BULK_OUT_QUEUE_ELEMENT { BULK_OUT_TYPE BulkOutType; PVOID buffer; struct _BULK_OUT_QUEUE_ELEMENT *next;} BULK_OUT_QUEUE_ELEMENT, *PBULK_OUT_QUEUE_ELEMENT;typedef struct _BULK_OUT_QUEUE { UINT size; BULK_OUT_QUEUE_ELEMENT *head; BULK_OUT_QUEUE_ELEMENT *tail;} BULK_OUT_QUEUE, *PBULK_OUT_QUEUE;typedef struct _BULK_OUT_QUEUE_ELEMENT { PVOID buffer; struct _BULK_OUT_QUEUE_ELEMENT *next;} BULK_OUT_QUEUE_ELEMENT, *PBULK_OUT_QUEUE_ELEMENT;typedef struct _BULK_OUT_QUEUE { UINT size; BULK_OUT_QUEUE_ELEMENT *head; BULK_OUT_QUEUE_ELEMENT *tail;} BULK_OUT_QUEUE, *PBULK_OUT_QUEUE;#endif//bluetypedef struct _DATA_BULKOUT_QUEUE { UINT size; struct sk_buff *head; struct sk_buff *tail;} DATA_BULKOUT_QUEUE, *PDATA_BULKOUT_QUEUE;typedef struct _MLME_BULKOUT_QUEUE { UINT size; PMGMT_STRUC head; PMGMT_STRUC tail;} MLME_BULKOUT_QUEUE, *PMLME_BULKOUT_QUEUE;#if 0typedef enum bufferStates { FREE, USED, COMPLETED, PENDING} BufferState;#endif// used to track driver-generated write irps typedef struct _TX_CONTEXT{ PVOID pAdapter;//Initialized in MiniportInitialize // struct sk_buff *skb; PURB pUrb;//Initialized in MiniportInitialize PIRP pIrp;//used to cancel pending bulk out.//Initialized in MiniportInitialize PTX_BUFFER TransferBuffer;//Initialized in MiniportInitialize ULONG BulkOutSize; BOOLEAN InUse; BOOLEAN IRPPending; BOOLEAN LastOne;}TX_CONTEXT, *PTX_CONTEXT, **PPTX_CONTEXT;// used to track driver-generated write irps typedef struct _MLME_CONTEXT{ PVOID pAdapter;//Initialized in MiniportInitialize PMGMT_STRUC pMgmt; PURB pUrb;//Initialized in MiniportInitialize PIRP pIrp;//used to cancel pending bulk out.//Initialized in MiniportInitialize PTX_BUFFER TransferBuffer;//Initialized in MiniportInitialize// UINT TransferBufferLength;//TransferBufferLength// CONTEXT_TYPE Type;// BufferState fInUse; // Declared as ULONG so can use with InterlockedExchange() BOOLEAN InUse; BOOLEAN IRPPending; BOOLEAN LastOne; UCHAR Index;}MLME_CONTEXT, *PMLME_CONTEXT, **PPMLME_CONTEXT;typedef struct _NULL_CONTEXT{ PVOID pAdapter;//Initialized in MiniportInitialize PURB pUrb;//Initialized in MiniportInitialize PIRP pIrp;//used to cancel pending bulk out. PNULL_FRAME_BUFFER TransferBuffer;//Initialized in MiniportInitialize// UINT TransferBufferLength;//TransferBufferLength// BufferState fInUse; // Declared as ULONG so can use with InterlockedExchange() BOOLEAN InUse; BOOLEAN IRPPending;}NULL_CONTEXT, *PNULL_CONTEXT;typedef struct _WPAPSK_CONTEXT{ PVOID pAdapter;//Initialized in MiniportInitialize PURB pUrb;//Initialized in MiniportInitialize PIRP pIrp;//used to cancel pending bulk out. PWPAPSK_BUFFER TransferBuffer;//Initialized in MiniportInitialize// UINT TransferBufferLength;//TransferBufferLength// BufferState fInUse; // Declared as ULONG so can use with InterlockedExchange() BOOLEAN InUse; BOOLEAN Ready; BOOLEAN IRPPending;}WPAPSK_CONTEXT, *PWPAPSK_CONTEXT;typedef struct _PS_POLL_CONTEXT{ PVOID pAdapter;//Initialized in MiniportInitialize PURB pUrb;//Initialized in MiniportInitialize PIRP pIrp;//used to cancel pending bulk out. PPS_POLL_BUFFER TransferBuffer;//Initialized in MiniportInitialize// UINT TransferBufferLength;//TransferBufferLength// BufferState fInUse; // Declared as ULONG so can use with InterlockedExchange() BOOLEAN InUse; BOOLEAN Ready; BOOLEAN IRPPending;}PS_POLL_CONTEXT, *PPS_POLL_CONTEXT;typedef struct _STUFF_CONTEXT{ PVOID pAdapter;//Initialized in MiniportInitialize PURB pUrb;//Initialized in MiniportInitialize PIRP pIrp;//used to cancel pending bulk out. PSTUFF_BUFFER TransferBuffer;//Initialized in MiniportInitialize// UINT TransferBufferLength;//TransferBufferLength// BufferState fInUse; // Declared as ULONG so can use with InterlockedExchange() BOOLEAN InUse; BOOLEAN Ready; BOOLEAN IRPPending;}STUFF_CONTEXT, *PSTUFF_CONTEXT;//// Structure to keep track of receive packets and buffers to indicate// receive data to the protocol.//#define IRPLOCK_COMPLETED 0#define IRPLOCK_CANCELABLE 1#define IRPLOCK_CANCE_START 2#define IRPLOCK_CANCE_COMPLETE 3typedef struct _RX_CONTEXT{ PVOID pAdapter; PIRP pIrp; //used to cancel pending bulk in. PURB pUrb; BOOLEAN InUse; atomic_t IrpLock; PUCHAR TransferBuffer; }RX_CONTEXT, *PRX_CONTEXT;#if 0// NDIStypedef struct _RX_CONTEXT{ PUCHAR TransferBuffer; PVOID pAdapter; PIRP pIrp;//used to cancel pending bulk in. PURB pUrb; BOOLEAN InUse; IRPLOCK IrpLock;} RX_CONTEXT, *PRX_CONTEXT;#endiftypedef struct _VENDOR_REQUEST_URB{ PURB pUrb;// BOOLEAN InUse; PIRP pIrp;//used to cancel pending IRP BOOLEAN IRPPending;}VENDOR_REQUEST_URB;typedef struct _TX_RATE_SWITCHING_STRUC{ ULONG LastStableTime; UCHAR DownRate1Ratio; UCHAR DownRate2Ratio; UCHAR UpRateRatio; UCHAR StableTimeRequired; UCHAR PenaltyPeriod; UCHAR DownWaitingTime;}TX_RATE_SWITCHING_STRUC, *PTX_RATE_SWITCHING_STRUC;typedef struct _TX_RATE_SWITCHING_COUNTERS{ USHORT NoRetryOKCnt; USHORT OneRetryOKCnt; USHORT MRetryOKCnt; USHORT FailCnt;}TX_RATE_SWITCHING_COUNTERS, *PTX_RATE_SWITCHING_COUNTERS;typedef struct _BBP_TUNING_PARAMETERS_STRUC{ UCHAR BBPTuningThreshold; UCHAR R24LowerValue; UCHAR R24HigherValue; UCHAR R25LowerValue; UCHAR R25HigherValue; UCHAR R61LowerValue; UCHAR R61HigherValue; UCHAR BBPR17LowSensitivity; UCHAR BBPR17MidSensitivity; UCHAR RSSIToDbmOffset; BOOLEAN LargeCurrentRSSI;}BBP_TUNING_PARAMETERS_STRUC, *PBBP_TUNING_PARAMETERS_STRUC;#define IEEE80211_NWID_LEN 32#define UNLINK_TIMEOUT_MS 3//// The miniport adapter structure//typedef struct _RT2570_ADAPTER{ int nicknamelen; char nickn[IEEE80211_NWID_LEN+1]; // nickname, only used in the iwconfig i/f struct tasklet_struct rx_bh; struct usb_device *usb; //KERNEL266 struct usb_config_descriptor *config; //struct usb_host_config *config; devctrlrequest *devreq; /* The device we're working with * It's important to note: * (o) you must hold dev_semaphore to change pusb_dev */ struct semaphore usbdev_semaphore; /* protect usb */ // Thread struct semaphore mlme_semaphore; /* to sleep thread on */ struct semaphore RTUSBCmd_semaphore; /* to sleep thread on */#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) struct completion notify; /* thread begin/end */ pid_t MLMEThr_pid; pid_t RTUSBCmdThr_pid;#else struct task_struct * MLMEThr; volatile int MLMEThr_active; struct task_struct * RTUSBCmdThr; volatile int RTUSBCmdThr_active;#endif wait_queue_head_t *wait; spinlock_t *lock;#if 1 UINT SET_R17_FLAG; UCHAR BBPR17InitValue; UCHAR ResetRequest; UCHAR BulkAction;#endif struct net_device *net; BOOLEAN bNetDeviceStopQueue;#if WIRELESS_EXT >= 12 struct iw_statistics iw_stats;#endif struct net_device_stats netstats; // configuration UCHAR PermanentAddress[ETH_LENGTH_OF_ADDRESS]; // Factory default MAC address UCHAR CurrentAddress[ETH_LENGTH_OF_ADDRESS]; // User changed MAC address USHORT EEPROMDefaultValue[NUM_EEPROM_BBP_PARMS]; USHORT EEPROMBBPTuningParameters[NUM_EEPROM_BBP_TUNING_PARMS]; // // Handle given by NDIS when the Adapter registered itself. // Various NDIS handle function // MGMT_STRUC MgmtRing[MGMT_RING_SIZE]; // management ring size UCHAR NextTxIndex; // Next TxD write pointer UCHAR NextMLMEIndex; // Next PrioD write pointer UCHAR PushMgmtIndex; // Next SW management ring index UCHAR PopMgmtIndex; // Next SW management ring index atomic_t MgmtQueueSize; // Number of Mgmt request stored in MgmtRing UCHAR NextRxBulkInIndex; UCHAR NextBulkOutIndex; BOOLEAN BulkOutPending; BOOLEAN ControlPending; ULONG PrioRingTxCnt; UCHAR PrioRingFirstIndex; // 802.3 multicast support ULONG NumberOfMcAddresses; // Number of mcast entry exists UCHAR McastTable[MAX_MCAST_LIST_SIZE][ETH_LENGTH_OF_ADDRESS]; // Mcast list ULONG Flags; // Represent current device status // Flags for bulk out data priority ULONG BulkFlags; ///////////////////// // Transmit Path ///////////////////// atomic_t TxCount; // Number of Bulkout waiting to be send. TX_CONTEXT TxContext[TX_RING_SIZE]; TX_CONTEXT MLMEContext[PRIO_RING_SIZE]; TX_CONTEXT BeaconContext[BEACON_RING_SIZE]; TX_CONTEXT NullContext; TX_CONTEXT PsPollContext; RTS_BUFFER RTSBuffer; WPAPSK_CONTEXT WpaPskContext; PUCHAR TxBuffer; TX_BUFFER TxMgmtBuf; ///////////////////// // Receive Path ///////////////////// RX_CONTEXT RxContext[RX_RING_SIZE]; PURB pRxUrb;//red: test mode only PIRP pRxIrp; PUCHAR RxBuffer; // SEND queue list struct sk_buff_head SendTxWaitQueue; USHORT Sequence; // Current sequence number
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -