📄 dsdef.h
字号:
{
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
{10,11,12,13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //France
{ 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13, 14} }; //Japan MKK
#ifdef MRV_CHIP_8385PN
static const UCHAR MrvDrvSupportedRates[] = {
0x02, // 1Mbps
0x04, // 2Mbps
0x0b, // 5.5Mbps
0x16, // 11Mbps
0x00, // reserved
0x0c, // 6Mbps
0x12, // 9Mbps
0x18, // 12Mbps
0x24, // 18Mbps
0x30, // 24Mbps
0x48, // 36Mbps
0x60, // 48Mbps
0x6c, // 54Mbps
};
#elif defined(MRV_CHIP_8385H)
static const UCHAR MrvDrvSupportedRates[] = {
0x02, // 1Mbps
0x04, // 2Mbps
0x0b, // 5.5Mbps
0x16, // 11Mbps
0x00, // reserved
0x0c, // 6Mbps
0x12, // 9Mbps
0x18, // 12Mbps
0x24, // 18Mbps
0x30, // 24Mbps
0x48, // 36Mbps
0x60, // 48Mbps
0x6c, // 54Mbps
};
#else
static const UCHAR MrvDrvSupportedRates[] = {
0x02, // 1Mbps
0x04, // 2Mbps
0x0b, // 5.5Mbps
0x16 // 11Mbps
};
#endif // #ifdef MRV_CHIP_8385PN
#define MRVDRV_NUM_SUPPORTED_RATES sizeof(MrvDrvSupportedRates)
#ifndef ETH_ADDR_LENGTH
#define ETH_ADDR_LENGTH 6
#endif
#pragma pack()
#ifdef UNDER_CE
// Structure describing Registry values
typedef struct _REG_VALUE_DESCR
{
LPWSTR val_name;
DWORD val_type;
PBYTE val_data;
} REG_VALUE_DESCR, *PREG_VALUE_DESCR;
#endif
typedef struct _PENDING_OID
{
BOOLEAN bIsPendingOID;
NDIS_OID PendingOID;
PVOID InformationBuffer;
ULONG InformationBufferLength;
PULONG BytesReadWrite;
PULONG BytesNeeded;
} PENDING_OID, *PPENDING_OID;
#define MRVDRV_802_11_BAND_B 0x00
#define MRVDRV_802_11_BAND_BG 0x01
#define MRVDRV_802_11_BAND_A 0x02
#define MRVDRV_SCAN_CMD_START 0x20
#define MRVDRV_SCAN_CMD_END 0x10
#define MAX_CHAN_NUM 255
#define UNIVERSAL_REGION_CODE 0xff
#define MRVDRV_MAX_SUBBAND_802_11D 83
#define COUNTRY_CODE_LEN 3
#define MAX_NO_OF_CHAN 40
#define OID_802_11D_ENABLE 0x00008020
typedef struct _CHANNEL_FREQ_POWER
{
USHORT Channel; // Channel Number
ULONG Freq; // Frequency of this Channel
USHORT MaxTxPower; // Max allowed Tx power level
} CHANNEL_FREQ_POWER, *PCHANNEL_FREQ_POWER;
#define MAX_REGION_BAND_NUM 2
#define MAX_PSCAN_CH_NUM 34
typedef struct _REGION_CHANNEL
{
BOOLEAN Valid; // TRUE if this entry is valid
UCHAR Region; // Region code for US, Japan ...
UCHAR Band; // B, G, or A, used for BAND_CONFIG cmd
UCHAR NrCFP; // Actual No. of elements in the array below
CHANNEL_FREQ_POWER *CFP;
UCHAR ScanType[MAX_PSCAN_CH_NUM]; // ACTIVE=0, PASSIVE=1
UCHAR TxPower[MAX_PSCAN_CH_NUM]; // Tx Power Level for channel
} REGION_CHANNEL, *PREGION_CHANNEL;
//
// Format { Channel, Frequency (MHz), MaxTxPower }
//
#define TX_PWR_DEFAULT 10
typedef struct _region_code_mapping
{
CHAR region[COUNTRY_CODE_LEN];
UCHAR code;
} region_code_mapping_t;
static region_code_mapping_t region_code_mapping[] =
{
{ "US ", 0x10 },
{ "CA ", 0x20 },
{ "EU ", 0x30 },
{ "ES ", 0x31 },
{ "FR ", 0x32 },
{ "JP ", 0x40 }
};
/* Following 2 structure defines the supported channels */
static CHANNEL_FREQ_POWER channel_freq_power_UN_BG[] = {
{1, 2412, TX_PWR_DEFAULT},
{2, 2417, TX_PWR_DEFAULT},
{3, 2422, TX_PWR_DEFAULT},
{4, 2427, TX_PWR_DEFAULT},
{5, 2432, TX_PWR_DEFAULT},
{6, 2437, TX_PWR_DEFAULT},
{7, 2442, TX_PWR_DEFAULT},
{8, 2447, TX_PWR_DEFAULT},
{9, 2452, TX_PWR_DEFAULT},
{10, 2457, TX_PWR_DEFAULT},
{11, 2462, TX_PWR_DEFAULT},
{12, 2467, TX_PWR_DEFAULT},
{13, 2472, TX_PWR_DEFAULT},
{14, 2484, TX_PWR_DEFAULT}
};
static CHANNEL_FREQ_POWER channel_freq_power_UN_AJ[] = {
// {8, 5040, TX_PWR_DEFAULT},
// {12, 5060, TX_PWR_DEFAULT},
// {16, 5080, TX_PWR_DEFAULT},
// {34, 5170, TX_PWR_DEFAULT},
{36, 5180, TX_PWR_DEFAULT},
// {38, 5190, TX_PWR_DEFAULT},
{40, 5200, TX_PWR_DEFAULT},
// {42, 5210, TX_PWR_DEFAULT},
{44, 5220, TX_PWR_DEFAULT},
// {46, 5230, TX_PWR_DEFAULT},
{48, 5240, TX_PWR_DEFAULT},
{52, 5260, TX_PWR_DEFAULT},
{56, 5280, TX_PWR_DEFAULT},
{60, 5300, TX_PWR_DEFAULT},
{64, 5320, TX_PWR_DEFAULT},
{100, 5500, TX_PWR_DEFAULT},
{104, 5520, TX_PWR_DEFAULT},
{108, 5540, TX_PWR_DEFAULT},
{112, 5560, TX_PWR_DEFAULT},
{116, 5580, TX_PWR_DEFAULT},
{120, 5600, TX_PWR_DEFAULT},
{124, 5620, TX_PWR_DEFAULT},
{128, 5640, TX_PWR_DEFAULT},
{132, 5660, TX_PWR_DEFAULT},
{136, 5680, TX_PWR_DEFAULT},
{140, 5700, TX_PWR_DEFAULT},
{149, 5745, TX_PWR_DEFAULT},
{153, 5765, TX_PWR_DEFAULT},
{157, 5785, TX_PWR_DEFAULT},
{161, 5805, TX_PWR_DEFAULT},
{165, 5825, TX_PWR_DEFAULT}
// {240, 4920, TX_PWR_DEFAULT},
// {244, 4940, TX_PWR_DEFAULT},
// {248, 4960, TX_PWR_DEFAULT},
// {252, 4980, TX_PWR_DEFAULT},
};
// Band: 'B/G', Region: USA FCC/Canada IC
static CHANNEL_FREQ_POWER channel_freq_power_US_BG[] = {
{1, 2412, TX_PWR_DEFAULT},
{2, 2417, TX_PWR_DEFAULT},
{3, 2422, TX_PWR_DEFAULT},
{4, 2427, TX_PWR_DEFAULT},
{5, 2432, TX_PWR_DEFAULT},
{6, 2437, TX_PWR_DEFAULT},
{7, 2442, TX_PWR_DEFAULT},
{8, 2447, TX_PWR_DEFAULT},
{9, 2452, TX_PWR_DEFAULT},
{10, 2457, TX_PWR_DEFAULT},
{11, 2462, TX_PWR_DEFAULT}
};
// Band: 'B/G', Region: Europe ETSI
static CHANNEL_FREQ_POWER channel_freq_power_EU_BG[] = {
{1, 2412, TX_PWR_DEFAULT},
{2, 2417, TX_PWR_DEFAULT},
{3, 2422, TX_PWR_DEFAULT},
{4, 2427, TX_PWR_DEFAULT},
{5, 2432, TX_PWR_DEFAULT},
{6, 2437, TX_PWR_DEFAULT},
{7, 2442, TX_PWR_DEFAULT},
{8, 2447, TX_PWR_DEFAULT},
{9, 2452, TX_PWR_DEFAULT},
{10, 2457, TX_PWR_DEFAULT},
{11, 2462, TX_PWR_DEFAULT},
{12, 2467, TX_PWR_DEFAULT},
{13, 2472, TX_PWR_DEFAULT}
};
// Band: 'B/G', Region: Spain
static CHANNEL_FREQ_POWER channel_freq_power_SPN_BG[] = {
{10, 2457, TX_PWR_DEFAULT},
{11, 2462, TX_PWR_DEFAULT}
};
// Band: 'B/G', Region: France
static CHANNEL_FREQ_POWER channel_freq_power_FR_BG[] = {
{10, 2457, TX_PWR_DEFAULT},
{11, 2462, TX_PWR_DEFAULT},
{12, 2467, TX_PWR_DEFAULT},
{13, 2472, TX_PWR_DEFAULT}
};
// Band: 'B/G', Region: Japan
static CHANNEL_FREQ_POWER channel_freq_power_JPN_BG[] = {
{1, 2412, TX_PWR_DEFAULT},
{2, 2417, TX_PWR_DEFAULT},
{3, 2422, TX_PWR_DEFAULT},
{4, 2427, TX_PWR_DEFAULT},
{5, 2432, TX_PWR_DEFAULT},
{6, 2437, TX_PWR_DEFAULT},
{7, 2442, TX_PWR_DEFAULT},
{8, 2447, TX_PWR_DEFAULT},
{9, 2452, TX_PWR_DEFAULT},
{10, 2457, TX_PWR_DEFAULT},
{11, 2462, TX_PWR_DEFAULT},
{12, 2467, TX_PWR_DEFAULT},
{13, 2472, TX_PWR_DEFAULT},
{14, 2484, TX_PWR_DEFAULT}
};
//#ifdef MULTI_BANDS
// Band: 'A', Region: USA FCC, Canada IC, Spain, France
static CHANNEL_FREQ_POWER channel_freq_power_A[] = {
{36, 5180, TX_PWR_DEFAULT},
{40, 5200, TX_PWR_DEFAULT},
{44, 5220, TX_PWR_DEFAULT},
{48, 5240, TX_PWR_DEFAULT},
{52, 5260, TX_PWR_DEFAULT},
{56, 5280, TX_PWR_DEFAULT},
{60, 5300, TX_PWR_DEFAULT},
{64, 5320, TX_PWR_DEFAULT},
{149, 5745, TX_PWR_DEFAULT},
{153, 5765, TX_PWR_DEFAULT},
{157, 5785, TX_PWR_DEFAULT},
{161, 5805, TX_PWR_DEFAULT},
{165, 5825, TX_PWR_DEFAULT}
};
// Band: 'A', Region: Europe ETSI
static CHANNEL_FREQ_POWER channel_freq_power_EU_A[] = {
{36, 5180, TX_PWR_DEFAULT},
{40, 5200, TX_PWR_DEFAULT},
{44, 5220, TX_PWR_DEFAULT},
{48, 5240, TX_PWR_DEFAULT},
{52, 5260, TX_PWR_DEFAULT},
{56, 5280, TX_PWR_DEFAULT},
{60, 5300, TX_PWR_DEFAULT},
{64, 5320, TX_PWR_DEFAULT},
{100, 5500, TX_PWR_DEFAULT},
{104, 5520, TX_PWR_DEFAULT},
{108, 5540, TX_PWR_DEFAULT},
{112, 5560, TX_PWR_DEFAULT},
{116, 5580, TX_PWR_DEFAULT},
{120, 5600, TX_PWR_DEFAULT},
{124, 5620, TX_PWR_DEFAULT},
{128, 5640, TX_PWR_DEFAULT},
{132, 5660, TX_PWR_DEFAULT},
{136, 5680, TX_PWR_DEFAULT},
{140, 5700, TX_PWR_DEFAULT}
};
// Band: 'A', Region: Japan
static CHANNEL_FREQ_POWER channel_freq_power_JPN_A[] = {
{8, 5040, TX_PWR_DEFAULT},
{12, 5060, TX_PWR_DEFAULT},
{16, 5080, TX_PWR_DEFAULT},
{34, 5170, TX_PWR_DEFAULT},
{38, 5190, TX_PWR_DEFAULT},
{42, 5210, TX_PWR_DEFAULT},
{46, 5230, TX_PWR_DEFAULT},
{240, 4920, TX_PWR_DEFAULT},
{244, 4940, TX_PWR_DEFAULT},
{248, 4960, TX_PWR_DEFAULT},
{252, 4980, TX_PWR_DEFAULT}
};
static UCHAR SupportedRates[G_SUPPORTED_RATES];
//First two rates are basic rates
static UCHAR SupportedRates_B[B_SUPPORTED_RATES] =
{ 0x82, 0x84, 0x8b, 0x96, 0, 0, 0, 0 };
// First four rates are basic rates
static UCHAR SupportedRates_G[G_SUPPORTED_RATES] =
{ 0x82, 0x84, 0x8b, 0x96, 0x0c, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6c, 0, 0};
// TODO: Check which are basic rates for band 'a'
// First two rates are basic rates
static UCHAR SupportedRates_A[G_SUPPORTED_RATES] =
{ 0x8c, 0x12, 0x98, 0x24, 0xb0, 0x48, 0x60, 0x6c, 0, 0, 0, 0, 0, 0 };
#endif _DSDEF_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -