📄 dsdef.h
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES OR INDEMNITIES.
//
/** @file dsdef.h
* @This file contains definitions and data structures that are specific
* to Marvell 802.11 NIC.
*
* Copyright (c) Marvell Semiconductor, Inc.
*/
#ifndef _DSDEF_H_
#define _DSDEF_H_
// ***************** DO NOT MODIFY *****************
// #define MRVL_AUTOMATED_BUILD_VERSION
// ***************** END DO NOT MODIFY *************
#ifndef MRVL_AUTOMATED_BUILD_VERSION
// This section is used for versioning displayed for
// developer built drivers
#ifdef MRV_CHIP_8305
// Driver Version number
#define MRVDRV_DRIVER_BUILD_VERSION "22.p1"
#endif // #ifdef MRV_CHIP_8305
#ifdef MRV_CHIP_8381PN
// Driver Version number
#define MRVDRV_DRIVER_BUILD_VERSION "27.p14"
#endif
#ifdef MRV_CHIP_8381P
// Driver Version number
#define MRVDRV_DRIVER_BUILD_VERSION "27"
#endif
#ifdef MRV_CHIP_8385PN
// Driver Version number
#define MRVDRV_DRIVER_BUILD_VERSION "pre-27.p24"
#endif
#ifdef MRV_CHIP_8385H
// Driver Version number
#define MRVDRV_DRIVER_BUILD_VERSION "27"
#endif
#else
// This section is used for versioning displayed for
// automated built driver
// ***************** DO NOT MODIFY *****************
#ifdef MRV_CHIP_8305
// Driver Version number
#define MRVDRV_DRIVER_BUILD_VERSION "8305_AUTO_VERSION"
#endif // #ifdef MRV_CHIP_8305
#ifdef MRV_CHIP_8381PN
// Driver Version number
#define MRVDRV_DRIVER_BUILD_VERSION "8381_AUTO_VERSION"
#endif
#ifdef MRV_CHIP_8381P
// Driver Version number
#define MRVDRV_DRIVER_BUILD_VERSION "8381_AUTO_VERSION"
#endif
#ifdef MRV_CHIP_8385PN
// Driver Version number
#define MRVDRV_DRIVER_BUILD_VERSION "8385_AUTO_VERSION"
#endif
#ifdef MRV_CHIP_8385H
// Driver Version number
#define MRVDRV_DRIVER_BUILD_VERSION "8385_AUTO_VERSION"
#endif
// ***************** END DO NOT MODIFY *****************
#endif // #ifndef MRVL_AUTOMATED_BUILD_VERSION
#define MRVDRV_NUM_OF_WEP_INFO 16
// Number of RSSI values to keep for roaming
#define MRVDRV_NUM_RSSI_VALUE 10
// number of packet in RX queue
#define MRVDRV_NUM_RX_PKT_IN_QUEUE 20
#define MRVDRV_MEMORY_TAG 'lvrm'
//
// Ethernet Frame Sizes
//
// Currently, Microsoft passes 802.3/Ethernet packet to the NDIS miniport driver,
// Driver allocates 1536 bytes of host memory to keep Tx/Rx packets.
//
#define MRVDRV_ETH_ADDR_LEN 6
#define MRVDRV_ETH_HEADER_SIZE 14
#define MRVL_DEFAULT_INITIAL_RSSI -200
// Threshold is 500kbps
#define MRVL_SCAN_ALLOW_THRESHOLD 500000/8
// when connected, the driver will try to scan every 60s if there is no traffic
#define MRVL_BACKGOUND_SCAN_TIME 30
#define MRVDRV_MAX_MULTICAST_LIST_SIZE 0x00000020
#define MRVDRV_SIZE_OF_CMD_BUFFER 0x00001000 // 4K
#define MRVDRV_NUM_OF_CMD_BUFFER 0x00000030
// Timer constants
// This section defines time-out intervals for different tasks
#define MRVDRV_TEN_SECS_TIMER_INTERVAL 10000 // 10 sec
#define MRVDRV_DEFAULT_TIMER_INTERVAL 10000 // 10 sec
// most command should finish within 0.5 second
#define MRVDRV_DEFAULT_COMMAND_TIME_OUT 5000
#define MRVDRV_DEFAULT_LONG_COMMAND_TIME_OUT 10000 // 10 sec
#define MRVDRV_ASSOCIATION_TIME_OUT 195
// disconnect if more than one MIC error occurred within the following period (60s)
#define MRVDRV_MIC_ERROR_PERIOD 60000
#if DBG
#define MRVDRV_DEFAULT_TX_PKT_TIME_OUT 5000 // lot's of time for debug dralee
#else
#define MRVDRV_DEFAULT_TX_PKT_TIME_OUT 5000 //300 dralee
#endif
#define MRVDRV_TIME_TO_ENTER_PS_MODE 10000
// for Adapter->Initialization Status flags
#define MRVDRV_INIT_STATUS_CMDTIMER_INITALIZED 0x1
#define MRVDRV_INIT_STATUS_MAP_REGISTER_ALLOCATED 0x2
//
// Misc constants
// This section defines 802.11 specific contants
//
#define MRVDRV_DEFAULT_MACHINE_NAME_SIZE 32
#define MRVDRV_MAX_SSID_LENGTH 32
#define MRVDRV_MAX_BSS_DESCRIPTS 16
#define MRVDRV_MAX_REGION_CODE 6
#define MRVDRV_MAX_CHANNEL_NUMBER 14
#define MRVDRV_DEFAULT_LISTEN_INTERVAL 3
// We define 8 levels in TX power command
#define MRVDRV_TX_POWER_LEVEL_TOTAL 0x0008
// definition for power level high, mid, and low
#define MRVDRV_TX_POWER_LEVEL_HIGH 19
#define MRVDRV_TX_POWER_LEVEL_MID 10
#define MRVDRV_TX_POWER_LEVEL_LOW 5
#define MRVDRV_MAX_BSSID_LIST 0x20
// reserve 150 bytes for each AP's variable IE in the scan list
#define MRVDRV_SCAN_LIST_VAR_IE_SPACE 256
// set aside 500 bytes for the association information buffer
#define MRVDRV_ASSOCIATE_INFO_BUFFER_SIZE 500
// max time between awake in ms, used by check for hang
#define MRVL_MAX_TIME_BETWEEN_AWAKE 5000
#ifdef MRV_CHIP_8385H
#define PSCAN_NUM_CH_PER_SCAN 1
#else
#define PSCAN_NUM_CH_PER_SCAN 3
#endif
#define MAX_LIST_BUFFER_SIZE 16384 //8192
#ifdef MRV_CHIP_8385PN
#define HOSTCMD_SUPPORTED_RATES 14
#else
#define HOSTCMD_SUPPORTED_RATES 8
#endif
//
// Resource size
//
// NDIS miniport driver (driver) has 2 ways to get BAR from the bus. The
// driver can either look at the PCI configuration BAR directly or query
// CM_PARTIAL_RESOURCE_DESCRIPTOR to get BAR information, which requires
// a buffer to keep resource list.
//
#define MRVDRV_RESOURCE_BUF_SIZE (sizeof(NDIS_RESOURCE_LIST) + \
(10*sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)))
//
// Define WCB, PPA, DPA page mask
//
// WCB Status
//
// Station firmware use WCB status field to report final Tx transmit result,
// Bit masks are used to present combined situations.
//
#define MRVDRV_WCB_STATUS_IDLE 0x00000000
#define MRVDRV_WCB_STATUS_USED 0x00000001 // for WCBRefNode
#define MRVDRV_WCB_STATUS_OK 0x00000001
#define MRVDRV_WCB_STATUS_OK_RETRY 0x00000002
#define MRVDRV_WCB_STATUS_OK_MORE_RETRY 0x00000004
#define MRVDRV_WCB_STATUS_MULTICAST_TX 0x00000008
#define MRVDRV_WCB_STATUS_BROADCAST_TX 0x00000010
#define MRVDRV_WCB_STATUS_FAILED_LINK_ERROR 0x00000020
#define MRVDRV_WCB_STATUS_FAILED_EXCEED_LIMIT 0x00000040
#define MRVDRV_WCB_STATUS_FAILED_AGING 0x00000080
//
// in extended scan mode, because there will be
// multiple outstanding scan, this is the way to tell
// whether a command was specific scan or not
//
// in pad[0]
#define MRVDRV_ES_SPECIFICSCAN 0x01
#define MRVDRV_ES_NOTSPECIFICSCAN 0x00
// in pad[1]
#define MRVDRV_ES_ASSOCIATIONBLOCKED 0x01
#define MRVDRV_ES_ASSOCIATIONNOTBLOCKED 0x00
// Tx control node status
// For miniport driver internal use
//
#define MRVDRV_TX_CTRL_NODE_STATUS_IDLE 0x0000
#define MRVDRV_TX_CTRL_NODE_STATUS_USED 0x0001
#define MRVDRV_TX_CTRL_NODE_STATUS_PENDING 0x0002
// RxPD Control
// RxPD control field is used to keep ownership information
//
#define MRVDRV_RXPD_CONTROL_DRIVER_OWNED 0x00
#define MRVDRV_RXPD_CONTROL_OS_OWNED 0x04
#define MRVDRV_RXPD_CONTROL_DMA_OWNED 0x80
// RxPD Status
// Station firmware (FW) use RxPD Status field to report Rx packet type
//
#define MRVDRV_RXPD_STATUS_IDLE 0x0000
#define MRVDRV_RXPD_STATUS_OK 0x0001
#define MRVDRV_RXPD_STATUS_MULTICAST_RX 0x0002
#define MRVDRV_RXPD_STATUS_BROADCAST_RX 0x0004
#define MRVDRV_RXPD_STATUS_FRAGMENT_RX 0x0008
// Command control node status
// Miniport driver use status field to maintian command control nodes
//
#define MRVDRV_CMD_CTRL_NODE_STATUS_IDLE 0x0000
#define MRVDRV_CMD_CTRL_NODE_STATUS_PENDING 0x0001
#define MRVDRV_CMD_CTRL_NODE_STATUS_PROCESSING 0x0002
#define MRVDRV_FW_STATUS_READY 0x5A
#define MRVDRV_FW_DL_RDY_FOR_NEXT_BLOCK 0xAA
// Link spped
// Microsoft defines the unit of link speed measurement to be 100 bps
//
#define MRVDRV_LINK_SPEED_10mbps 100000
#define MRVDRV_LINK_SPEED_B_RATES 1
#define MRVDRV_LINK_SPEED_DEFAULT MRVDRV_LINK_SPEED_11mbps
#define MRVDRV_LINK_SPEED_0mbps 0
#define MRVDRV_LINK_SPEED_1mbps 10000 // in unit of 100bps
#define MRVDRV_LINK_SPEED_2mbps 20000
#define MRVDRV_LINK_SPEED_5dot5mbps 55000
#define MRVDRV_LINK_SPEED_6mbps 60000
#define MRVDRV_LINK_SPEED_9mbps 90000
#define MRVDRV_LINK_SPEED_11mbps 110000
#define MRVDRV_LINK_SPEED_12mbps 120000
#define MRVDRV_LINK_SPEED_18mbps 180000
#define MRVDRV_LINK_SPEED_22mbps 220000
#define MRVDRV_LINK_SPEED_24mbps 240000
#define MRVDRV_LINK_SPEED_33mbps 330000
#define MRVDRV_LINK_SPEED_36mbps 360000
#define MRVDRV_LINK_SPEED_48mbps 480000
#define MRVDRV_LINK_SPEED_54mbps 540000
#define MRVDRV_LINK_SPEED_72mbps 720000
#define MRVDRV_LINK_SPEED_100mbps 1000000
//
// RSSI-related defines
//
// RSSI constants are used to implement NDIS 5.1 802.11 RSSI threshold
// indication. if the Rx packet signal got too weak for 5 consecutive times,
// miniport driver (driver) will report this event to wrapper
//
#define SNR_BEACON 0
#define SNR_RXPD 1
#define NF_BEACON 2
#define NF_RXPD 3
#define MAX_SNR 4
#define CAL_NF(NF) ((LONG)(-(LONG)(NF)))
#define CAL_RSSI(SNR, NF) (CHAR)((LONG)((LONG)(SNR) + CAL_NF(NF)))
#define SCAN_RSSI(RSSI) (0x100 - ((UCHAR)(RSSI)))
#define DEFAULT_BCN_AVG_FACTOR 8
#define DEFAULT_DATA_AVG_FACTOR 8
#define AVG_SCALE 100
#define CAL_AVG_SNR_NF(AVG, SNRNF, N) \
(((AVG) == 0) ? ((USHORT)(SNRNF) * AVG_SCALE) : \
((((int)(AVG) * (N -1)) + ((USHORT)(SNRNF) * \
AVG_SCALE)) / N))
#define RXPD_SNR_AGEOUT_TIME 5000 // 5 sec
// Definitions for SNR and NF
typedef enum _SNRNF_TYPE {
TYPE_BEACON = 0,
TYPE_RXPD,
MAX_TYPE_B
} SNRNF_TYPE;
typedef enum _SNRNF_DATA {
TYPE_NOAVG = 0,
TYPE_AVG,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -