⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dsdef.h

📁 此压缩包为杰得开发得z228的BSP的源代码,可以实现很多功能,尤其是视频解码有很好的效果.
💻 H
📖 第 1 页 / 共 3 页
字号:
/******************* (c) Marvell Semiconductor, Inc., 2004 ********************
 *
 *     
 *  This file contains definitions and data structures that are specific
 *  to Marvell 802.11 NIC. 
 *
 *  $Author: schiu $
 *
 *	$Date: 2004/12/15 $
 *
 *	$Revision: #18 $   	     
 *
 *****************************************************************************/

#ifndef _DSDEF_H_
#define _DSDEF_H_

//===============================================================================
//          PUBLIC TYPE DEFINITIONS
//===============================================================================

// ***************** DO NOT MODIFY *****************
// #define MRVL_AUTOMATED_BUILD_VERSION
// ***************** END DO NOT MODIFY *************

#define MRVDRV_DRIVER_BUILD_VERSION             "36.p8"



#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'   

#ifdef TX_PRY_Q
  #define NUM_OF_WMM_PRIORITY_LEVEL             4       
#endif

//
//          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

//
//          Buffer Constants
//
//          The size of SQ memory PPA, DPA are 8 DWORDs, that keep the physical
//          addresses of WCB buffers. Station has only 8 WCB available, Whereas
//          NDIS miniport driver has more local WCBs(32). Each WAB on the host memory
//          is associated with a Tx control node. NDIS miniport driver maintains 8 
//          RxPD descriptors for station firmware to store Rx packet information.
//
//          Current version of MAC has a 32x6 multicast address buffer.
//
//          802.11b can have up to  14 channels, NDIS miniport driver keeps the
//          BSSID(MAC address) of each APs or Ad hoc stations it has sensed.
//
#define MRVDRV_MAX_MULTICAST_LIST_SIZE   0x00000020
#define MRVDRV_SIZE_OF_CMD_BUFFER        0x00000c00 // 3K
#define MRVDRV_NUM_OF_CMD_BUFFER         0x00000040
//
//          Timer constants
//
//          This section defines time-out intervals for different tasks
//
#define MRVDRV_TEN_SECS_TIMER_INTERVAL     	10000     // 10/14/02 - tune to 10 seconds

#define MRVDRV_DEFAULT_TIMER_INTERVAL       10000     // 10/14/02 - tune to 10 seconds

// most command should finish within 0.5 second
#define MRVDRV_DEFAULT_COMMAND_TIME_OUT	            500      
#define MRVDRV_DEFAULT_LONG_COMMAND_TIME_OUT	    10000      // 11/04/02 - tune to 10 seconds

#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   1000         // lot's of time for debug
#else                                        
#ifdef IF_GSPI
	#define MRVDRV_DEFAULT_TX_PKT_TIME_OUT   10000	///crlo:test, 2k51129
#else
    #define MRVDRV_DEFAULT_TX_PKT_TIME_OUT   1000 //300  , dralee 072705     
#endif ///IF_GSPI
#endif // end of Debug

#ifdef RETQ_TIMER
    #define MRVDRV_DEFAULT_RETQ_TIME_OUT  750
#endif

#define MRVDRV_DEFAULT_INT_WORKAROUND_TIMEOUT  2000



// 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
#ifdef BCM
  #define MRVDRV_DEFAULT_LISTEN_INTERVAL	    10
#else
#define MRVDRV_DEFAULT_LISTEN_INTERVAL	    0  //dralee_20060515
#endif //BCM
// 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			      0x40  //34.p1  //0x20   

// reserve 150 bytes for each AP's variable IE in the scan list
#ifdef CCX
#define MRVDRV_SCAN_LIST_VAR_IE_SPACE       200
#else
#define MRVDRV_SCAN_LIST_VAR_IE_SPACE       150
#endif

// 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

#define BGACTIVE_ROAMING_PERIOD_TIME   120000   // 120 sec

//#ifdef PROGRESSIVE_SCAN
// number of channels per scan

#ifdef CCX
	#define PSCAN_NUM_CH_PER_SCAN           1
#else

#if(defined(MRV_MODEP_A) || defined(MRV_MODE_ABG))///#ifdef MRV_CHIP_8385H
	#define PSCAN_NUM_CH_PER_SCAN           1
#else
	#define PSCAN_NUM_CH_PER_SCAN           3
#endif

#endif



//35.p6++
#define MAX_LIST_BUFFER_SIZE                  8192
//35.p6--


//
//          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
//
//          SQ memory on MrvDrv chip starts at address 0xC00000000
//

//
// 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 to use
#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_10mbps         100000 
#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
//
#ifdef NEW_RSSI
   #define SNR_BEACON		0
   #define SNR_RXPD		    1
   #define NF_BEACON		2
   #define NF_RXPD			3

   /* MACRO DEFINITIONS */
   #define CAL_NF(NF)			((LONG)(-(LONG)(NF)))
   #define CAL_RSSI(SNR, NF) 	((LONG)((UCHAR)(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 QUERY_RSSI_TIMER           3000
  #define CAL_AVG_SNR_NF(AVG, SNRNF, N)	(((AVG) == 0) ? ((USHORT)(SNRNF) * AVG_SCALE) : \
					                    ((((int)(AVG) * (N-1)) + ((USHORT)(SNRNF) * \
						                 AVG_SCALE)) /N))

  
   /* 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,
		MAX_TYPE_AVG
	} SNRNF_DATA;
#endif  //NEW_RSSI

#define MRVDRV_RSSI_TRIGGER_DEFAULT      (-200)
#define MRVDRV_RSSI_INDICATION_THRESHOLD 5
//#define MRVDRV_RSSI_DEFAULT_NOISE_VALUE	(-90) 
#define MRVDRV_RSSI_DEFAULT_NOISE_VALUE	0 

#define MRVL_CHECK_FOR_HANG_TIME        20

//Power Saving Mode related
//
 
// Send packet status
#define READY_TO_SEND	0
#define STOP_SENDING	1

#define PS_CAM_STATE	1
#define PS_HOST_CMD		2  

//dralee_20060307, Add for pripority PS 
#define MRVDRV_WCB_POWER_MGMT_NULL_PACKET 0x01
#define MRVDRV_WCB_POWER_MGMT_LAST_PACKET 0x08

 
  
//
// 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;

#ifdef INTERFACE20
    ULONG	TxControl;
#endif // #ifdef INTERFACE20

    // Packet offset in CF
    ULONG PktPtr;
    USHORT PktLen;
    UCHAR DestMACAdrHi[2];
    UCHAR DestMACAdrLow[4];
/*
    tt: mark off the following "#ifdef WMM" since our firmware needs them.
*/
//#ifdef WMM    
    UCHAR Priority;
    UCHAR PowerMgmt;
    UCHAR Reserved[2];
//#else
//    struct _WCB *NextWCBPtr;
//#endif    
} WCB, *PWCB;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -