📄 dsdef.h
字号:
MAX_TYPE_AVG
} SNRNF_DATA;
#define MRVDRV_RSSI_TRIGGER_DEFAULT (-200)
#define MRVDRV_RSSI_INDICATION_THRESHOLD 5
#define MRVDRV_RSSI_DEFAULT_NOISE_VALUE (-90)
#define MRVL_CHECK_FOR_HANG_TIME 8
//
// Define WCB, PPA, DPA and RxPD
//
#pragma pack(1)
//
// WCB descriptor
//
// Status : Current Tx packet transmit status
// PktPtr : Physical address of the Tx Packet on host PC memory
// PktLen : Tx packet length
// UCHAR DestMACAdrHi[2] : First 2 byte of destination MAC address
// DestMACAdrLow[4] : Last 4 byte of destination MAC address
// DataRate : Driver uses this field to specify data rate for the Tx packet
// NextWCBPtr : Address to next WCB (Used by the driver)
//
typedef struct _WCB
{
ULONG Status;
ULONG TxControl;
ULONG PktPtr;
USHORT PktLen;
UCHAR DestMACAdrHi[2];
UCHAR DestMACAdrLow[4];
struct _WCB *NextWCBPtr;
//#ifdef WMM
UCHAR Priority;
UCHAR Reserved[3];
//#endif
} WCB, *PWCB;
#define MAX_TX_PKT_LEN 2048
typedef struct TX_PKT_T
{
WCB Wcb;
UCHAR PktBuf[MAX_TX_PKT_LEN];
USHORT PktLen;
} TX_PKT_T, *PTX_PKT_T;
//
// RxPD descirptor
//
// Status : Rx packet reception status
// RSSI : Receive RF signal strength for this packet (dbm)
// Control : Not used in CF and SDIO
// PktLen : Number of bytes in the payload
// NF : Noise floor for this packet
// Rate : Rate at which this packet is received
// PktPtr : Offset from the start of the packet to the begining of the payload data
// NextRxPDPtr : Not used in CF and SDIO
//
typedef struct _RxPD
{
USHORT Status;
UCHAR SNR;
UCHAR Control;
USHORT PktLen;
UCHAR NF;
UCHAR RxRate;
ULONG PktPtr;
ULONG NextRxPDPtr;
//#ifdef WMM
UCHAR Priority;
UCHAR Reserved[3];
//#endif
} RxPD, *PRxPD;
// PJG: get these to match FW and then fix all usage.
#define MRVDRV_MAXIMUM_ETH_PACKET_SIZE 1514 // PJG:
// On CF device we ask upper layer to give us no more data than this.
#define CF_MAX_PACKET_SIZE (MRVDRV_MAXIMUM_ETH_PACKET_SIZE - MRVDRV_ETH_HEADER_SIZE)
// TODO: Check why it is necessary to add extra 38 bytes
#define MRVDRV_ETH_TX_PACKET_BUFFER_SIZE (MRVDRV_MAXIMUM_ETH_PACKET_SIZE + sizeof(WCB))
#define MRVDRV_ETH_RX_PACKET_BUFFER_SIZE (MRVDRV_MAXIMUM_ETH_PACKET_SIZE + sizeof(RxPD) + 38)
//
// Tx control node data structure
// Tx control node is used by the driver to keep ready to send Tx packet information.
// Status :
// NPTxPacket : NDIS_PACKET reference
// LocalWCB : Local WCB reference
// BufVirtualAddr : Tx staging buffer logical address
// BufPhyAddr : Tx staging buffer physical address
// NextNode : link to next Tx control node
//
typedef struct _TxCtrlNode
{
ULONG Status;
PTX_PKT_T NPTxPacket;
PWCB LocalWCB;
PUCHAR BufVirtualAddr;
NDIS_PHYSICAL_ADDRESS BufPhyAddr;
struct _TxCtrlNode *NextNode;
} TxCtrlNode, *PTxCtrlNode;
//
// Command control nore data structure, command data structures are defined in
// hostcmd.h
//
// Next : Link to nect command control node
// Status : Current command execution status
// PendingOID : Set or query OID passed from NdisRequest()
// ExpectedRetCode : Result code for the current command
// PendingInfo : Init, Reset, Set OID, Get OID, Host command, etc.
// INTOption : USE_INT or NO_INT
// BatchQNum : Reserved for batch command processing
// IsLastBatchCmd : Reserved for batch command processing
// BytesWritten : For async OID processing
// BytesRead : For async OID processing
// BytesNeeded : For async OID processing
// InformationBuffer : For async OID processing
// BufVirtualAddr : Command buffer logical address
// BufPhyAddr : Command buffer physical address
//
typedef struct _CmdCtrlNode
{
struct _CmdCtrlNode *Next;
ULONG Status;
NDIS_OID PendingOID;
USHORT ExpectedRetCode;
USHORT PendingInfo; // Init, Reset, Set OID, Get OID, Host command, etc.
USHORT INTOption;
USHORT BatchQNum;
BOOLEAN IsLastBatchCmd; // BOOLEAN is defined as unsigned char
UCHAR Pad[3]; // To make it on 4 byte boundary
PULONG BytesWritten; // For async OID processing
PULONG BytesRead; // For async OID processing
PULONG BytesNeeded; // For async OID processing
PVOID InformationBuffer; // For async OID processing
PUCHAR BufVirtualAddr;
NDIS_PHYSICAL_ADDRESS BufPhyAddr;
UCHAR PadExt[4];
} CmdCtrlNode, *PCmdCtrlNode;
// for packet Q
typedef struct _PacketQueueNode
{
struct _PacketQueueNode *Next;
PNDIS_PACKET pPacket;
} PACKET_QUEUE_NODE, *PPACKET_QUEUE_NODE;
typedef enum _GET_PACKET_STATUS
{
GPS_SUCCESS = 0, // get packet was successful
GPS_RESOURCE, // get packet was successful, but number of free packet is low
GPS_FAILED // unable to get packet
} MRVDRV_GET_PACKET_STATUS;
//
// Ethernet Frame Structure
//
// Ethernet MAC address
typedef struct _ETH_ADDRESS_STRUC
{
UCHAR EthNodeAddr[MRVDRV_ETH_ADDR_LEN];
} ETH_ADDR_STRUC, *PETH_ADDR_STRUC;
// Ethernet frame header
typedef struct _ETH_HEADER_STRUC
{
UCHAR DestAddr[MRVDRV_ETH_ADDR_LEN];
UCHAR SrcAddr[MRVDRV_ETH_ADDR_LEN];
USHORT TypeLength;
} ETH_HEADER_STRUC, *PETH_HEADER_STRUC;
typedef struct _REGINFOTAB
{
NDIS_STRING ObjNSName; // Object name (UNICOODE)
char *ObjName; // Object name (ASCII)
UINT Type; // StringData (1), IntegerData (0)
UINT Offset; // Offset to adapter object field
UINT MaxSize; // Maximum Size (in bytes)
} REGINFOTAB;
#ifdef UNDER_CE_XSCALE
#pragma pack()
#endif
// WEP list data structures
#define MRVL_KEY_BUFFER_SIZE_IN_BYTE 16
// Based on NDIS_802_11_WEP, we extend the WEP buffer length to 128 bits
typedef struct _MRVL_WEP_KEY
{
ULONG Length;
ULONG KeyIndex;
ULONG KeyLength;
UCHAR KeyMaterial[MRVL_KEY_BUFFER_SIZE_IN_BYTE];
} MRVL_WEP_KEY, *PMRVL_WEP_KEY;
typedef struct _MRVL_WEP_INFO
{
ULONG LastKeyIndex;
NDIS_802_11_SSID SSID;
MRVL_WEP_KEY KEY[4];
} MRVL_WEP_INFO, *PMRVL_WEP_INFO;
#ifdef WPA
// support 5 key sets
#define MRVL_NUM_WPA_KEYSET_SUPPORTED 5
// support 4 keys per key set
#define MRVL_NUM_WPA_KEY_PER_SET 4
// max key length is 32 bytes acording to current WPA document
#define MRVL_MAX_WPA_KEY_LENGTH 32
typedef struct _MRVL_WPA_KEY
{
ULONG KeyIndex;
ULONG KeyLength; // length of key in bytes
NDIS_802_11_KEY_RSC KeyRSC;
// variable length depending on above field
UCHAR KeyMaterial[MRVL_MAX_WPA_KEY_LENGTH];
} MRVL_WPA_KEY, *PMRVL_WPA_KEY;
typedef struct _MRVL_WPA_KEY_SET
{
// BSSID is common within the set
NDIS_802_11_MAC_ADDRESS BSSID;
MRVL_WPA_KEY Key[MRVL_NUM_WPA_KEY_PER_SET];
} MRVL_WPA_KEY_SET, *PMRVL_WPA_KEY_SET;
typedef struct _MRVL_NDIS_WPA_KEY
{
UCHAR EncryptionKey[16];
UCHAR MICKey1[8];
UCHAR MICKey2[8];
} MRVL_NDIS_WPA_KEY, *PMRVL_NDIS_WPA_KEY;
// Fixed IE size is 8 bytes time stamp + 2 bytes beacon interval + 2 bytes cap
#define MRVL_FIXED_IE_SIZE 12
#endif // #ifdef WPA
#ifdef WPA2
#define KEY_INFO_ENABLED 0x01
typedef enum {
KEY_TYPE_ID_WEP = 0,
KEY_TYPE_ID_TKIP,
KEY_TYPE_ID_AES
} KEY_TYPE_ID;
typedef enum {
KEY_INFO_WEP_DEFAULT_KEY = 0x01
} KEY_INFO_WEP;
typedef enum {
KEY_INFO_TKIP_MCAST = 0x01,
KEY_INFO_TKIP_UNICAST = 0x02,
KEY_INFO_TKIP_ENABLED = 0x04
} KEY_INFO_TKIP;
typedef enum {
KEY_INFO_AES_MCAST = 0x01,
KEY_INFO_AES_UNICAST = 0x02,
KEY_INFO_AES_ENABLED = 0x04
} KEY_INFO_AES;
#endif /* WPA2 */
#define WPA_AES_KEY_LEN 16
#define WPA_TKIP_KEY_LEN 32
#ifdef ADHOCAES
typedef struct _MRVL_ADHOC_AES_KEY
{
ULONG Length;
UCHAR KeyBody[32]; //assic form
} MRVL_ADHOC_AES_KEY, *PMRVL_ADHOC_AES_KEY;
#endif
/*
===============================================================================
GLOBAL CONSTANT
===============================================================================
*/
static ULONG DSFeqList[15] = {
0, 2412000, 2417000, 2422000, 2427000, 2432000, 2437000, 2442000,
2447000, 2452000, 2457000, 2462000, 2467000, 2472000, 2484000
};
// region code table
static USHORT RegionCodeToIndex[MRVDRV_MAX_REGION_CODE] = {0x10, 0x20, 0x30, 0x31, 0x32, 0x40};
// for Extended Channel List to work, all INVALID (0) channels must be grouped together
// and store at the end of the list
static UCHAR IEEERegionChannel[MRVDRV_MAX_REGION_CODE][MRVDRV_MAX_CHANNEL_NUMBER] = {
{ 1, 2, 3, 4, 5, 6, 7,8, 9, 10, 11, 0, 0, 0}, //USA FCC
{ 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11, 0, 0, 0}, //Canada IC
{ 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13, 0}, //Europe ETSI
{10,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //Spain
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -