?? zl5011x.h
字號:
/*******************************************************************************
*
* File name: zl5011x.h
*
* Version: 142
*
* Author: MRC
*
* Date created: 08/02/2002
*
* Copyright 2002, 2003, 2004, 2005, Zarlink Semiconductor Limited.
* All rights reserved.
*
* Module Description:
*
* This is the master header file for zl5011x. It contains the register
* offset addresses, enumeration, and structure definitions.
*
* Revision History:
*
* Rev: Date: Author: Comments:
* 1 08/02/2002 MRC Creation
* 2 15/02/2002 MRC Update
* 3 28/02/2002 MRC Check TIF and test
* 4 08/03/2002 MRC Update
* 5 19/03/2002 MRC Update
* 6 22/03/2002 MRC Update
* 7 22/03/2002 MRC Update
* 8 22/03/2002 MRC Update
* 9 26/03/2002 PJE Added bits for CPU
* 10 27/03/2002 PJE Update
* 11 27/03/2002 PJE Update
* 12 03/04/2002 PJE Added bits for MM
* 13 03/04/2002 MRC Added PAC async bits
* 14 04/04/2002 PJE Updated MM
* 15 04/04/2002 MRC Added GM bits
* 16 09/04/2002 MRC Added modes for x2 clock in TIF interface
* 17 11/04/2002 MRC TIF block changed - modified frame pulse type
* 18 16/04/2002 MRC Update
* 19 17/04/2002 MRC Changed the CHECK_.. macros to ZL5011X_CHECK_..
* 20 23/04/2002 MRC Added bits for the TFQ
* 21 24/04/2002 MRC Added PTX bits for different number of headers
* and header size.
* 22 26/04/2002 MRC Changed some data names in response to comments
* from Thomas, regarding the MIB interface.
* 23 03/05/2002 MRC Added the TFM underrun settings to the device
* structure
* 24 07/05/2002 MRC Added PKC classifier structures
* 25 10/05/2002 MRC Changed name of some PKC classifier entries
* 26 13/05/2002 MRC Added PKC pre-classifier structures
* 27 14/05/2002 MRC Merged admin changes
* 28 15/05/2002 MRC Removed rtp stats from pkc classifier struct
* 29 16/05/2002 PJE additions for PKI block
* 30 16/05/2002 MRC Changed the TIF channel enable storage
* 31 17/05/2002 LCW Update
* 32 21/05/2002 PJE Update
* 33 21/05/2002 PJE addition for PKI PCS det
* 34 23/05/2002 MRC Changed PAC async structure and enums
* 35 29/05/2002 PJE addition of RTP block items
* 36 31/05/2002 LCW addition of RTP block items
* 37 31/05/2002 MRC Added TIF configuration entries
* 38 31/05/2002 PJE PKI review items
* 39 05/06/2002 MRC Modified PKQ enums
* 40 05/06/2002 PJE PKI review items all done.
* 41 06/06/2002 PJE PKI review items all done & debugged.
* 42 10/06/2002 LCW Update
* 43 10/06/2002 MRC Modified RTP header structure
* 44 11/06/2002 MRC Moved RTP header structure
* 45 11/06/2002 LCW Added structure for PKC statistics
* 46 12/06/2002 MRC Added structure for interrupt masks
* 47 19/06/2002 MRC DPLL changed and started adding bits for PKC
* context control
* 48 19/06/2002 PJE merged with interrupt changes
* 49 19/06/2002 MRC Made changes following PTX block change
* 50 20/06/2002 MRC Changed interface type enum names following review
* 51 25/06/2002 LCW Merged
* 52 25/06/2002 LCW Minor mods
* 53 28/06/2002 LCW Added extra elements to PKQ structure
* 54 03/07/2002 MRC PKC protocol structure names changed
* 55 03/07/2002 PJE added struct items zl5011xCpuDmaIfS clockPeriod
* and zl5011xInterruptMasksS tfmMask[]
* 56 09/07/2002 MRC Changed TIF interface type structure and added
* TIF BER functions
* 57 12/07/2002 MRC Rationalised the 2 enums for CPU queues
* 58 18/07/2002 MRC Added MM heap info to structure
* 59 24/07/2002 MRC Added TM trace message structure
* 60 30/07/2002 PJE Modified int structure
* 61 06/08/2002 MRC Added packet Rx filtering structures
* 62 14/08/2002 MRC Changed TIF sample point enums etc.
* 63 16/08/2002 MRC Added CES control for RTP block update
* 64 04/09/2002 MRC Changed the name of a structure entry from
* protocolLength16Bits to protocolTwoByteSeq
* 65 05/09/2002 MRC Added a current Wan Rx header variable
* 66 12/09/2002 MRC Updated structure for semaphores
* 67 12/09/2002 MRC Added semaphore for Lan PHYs
* 68 16/09/2002 MRC Added PAC DCO filtering values
* 69 16/09/2002 MRC Added padding & polarity to Cpu part of struct
* 70 19/09/2002 MRC Added extra DPLL settings
* 71 25/09/2002 JFE Added array of protocol stacks to zl5011xPacketRxS
* and associated structure and #define.
* 72 26/09/2002 ARW Added common enums and structures for DMA
* 73 27/09/2002 JFE Removed stuff added in rev 71.
* 74 07/10/2002 ARW Added extra field to zl5011xCpuDmaIfS
* 75 08/10/2002 PJE extra struct items to zl5011xInterruptMasksS
* 76 09/10/2002 ARW Added a field to dmaChannelS
* 77 16/10/2002 ARW Removed PADDDING typo.
* Removed ZL5011X_DMA_HI_Z enumeration
* 78 16/10/2002 ARW Added more structures for the DMA
* 79 21/10/2002 PJE added to zl5011xInterruptMasksS
* 80 22/10/2002 MRC added Lan port initialisation variables and
* parameter check macros
* 81 24/10/2002 PJE API tidy up
* 82 24/10/2002 ARW Added enum zl5011xDmaBypassRegisterE
* 83 24/10/2002 ARW Removed enum zl5011xDmaBypassRegisterE
* 84 28/10/2002 ARW Added another parameter to zl5011xDmaRxModeE
* 85 30/10/2002 MRC Added variant structure
* 86 31/10/2002 MRC Added variants + minor fixes
* 87 06/11/2002 MRC Added enum to store variant type
* 88 07/11/2002 MRC Added control for the Lan Rx context match to
* use the raw packet length
* 89 13/11/2002 MRC Added DMA and interrupt status
* 90 19/11/2002 MRC Added a granule count variable
* 91 25/11/2002 MRC Redefined packet queue weighting enum
* 92 27/11/2002 MRC Packet Tx structure now defined for the host
* headers as well.
* 93 03/12/2002 MRC Updated variant information
* 94 11/12/2002 ARW Added extra fields (byte count) in DMA structures
* 95 18/12/2002 ARW Added more fileds to DMA structures
* 96 06/01/2003 MRC Added PKC statistics structure
* 97 29/01/2003 MRC Added CET structures and tidied ext mem Enums
* 98 29/01/2003 MRC Added doneInit variable
* 99 06/02/2003 MRC Changed the DPLL config enumeration
* 100 26/02/2003 MRC Added packet loopback variables
* 101 24/03/2003 MRC Changed dpllLockDetectTimeUs to 32 bits
* 102 28/03/2003 ARW Added parameter to zl5011xReceiveQueueParamsS
* 103 07/04/2003 ARW Added more parameters to zl5011xReceiveQueueParamsS
* 104 08/04/2003 ARW Added more parameters to zl5011xReceiveQueueParamsS
* Made other parameters volatile
* 105 14/04/2003 ARW Updated fields in zl5011xReceiveQueueParamsS
* 106 07/05/2003 MRC Added user defined frequency for Reference i/p
* 107 22/05/2003 MRC Changed size of arrays for Lan Tx port / queue
* 108 09/06/2003 MRC Added setting for 64 bit aligned payload sizes
* 109 09/06/2003 DJA Performed pre-audit actions
* 110 29/07/2003 APL Added support for devices with no TDM interface
* Renamed global wanLimits structure to devLimits
* 111 30/07/2003 APL Renamed packetToTdmMapping
* 112 04/08/2003 APL Removed unused variable when device has no TDM interface
* 113 11/08/2003 MRC Added MAC type, to allow a port to be disabled
* 114 08/09/2003 MRC Updated MAC type check macro
* 115 08/09/2003 APL Added comment for ZL50130
* 116 03/11/2003 AMS Update
* 117 18/11/2003 AMS Update
* 118 18/11/2003 AMS Update
* 119 07/01/2004 MRC Reverted to revision 115
* 120 20/04/2004 APL Payload size can now be specified in bytes
* 121 29/07/2004 MRC Fixed some compiler warnings
* 122 19/08/2004 MRC Added user defined LIU frequency setting
* 123 25/08/2004 MRC Made some packet protocol changes
* 124 26/08/2004 MRC Added extra fields for PW status byte support
* 123 25/08/2004 MRC Made some packet protocol changes
* 124 26/08/2004 MRC Added extra fields for PW status byte support
* 125 06/09/2004 APL Added support for different device variants
* 126 13/09/2004 APL Added lanMacType to zl5011xPacketIfS
* 127 14/09/2004 APL lanLanContext and classifierEnablePending
* type changed to zl5011xBooleanE
* 128 15/09/2004 APL Added wanNumAuxClocks to the device limits info
* 129 19/10/2004 MRC Added variable to store the prsRefDivider setting
* 130 19/10/2004 APL Added cpucpuPacket counter for the low level DMA TX
* 131 16/11/2004 MRC Added individual stream frequency control
* 132 25/11/2004 MRC Added extra packet protocols
* 133 09/12/2004 MRC Added extra device variants
* 134 21/01/2005 MRC Added variables to variants table
* 135 03/02/2005 APL Added ZL30301 and ZL30302 device variants and
* more variables to variants table
* 136 03/02/2005 APL Renamed device ID's to allow new family members
* 137 07/02/2005 APL Altered device enumerations to maintain backwards
* compatibility
* 138 28/02/2005 APL Added ZL5011X_ETHERNET protocol
* Removed numTimingStreams
* Added apiTiming parameters to zl5011xParamsS
* 139 31/03/2005 MRC Added support for DMA packet Rx interrupt
* 140 17/05/2005 MRC Added support for custom packet headers
* 141 26/05/2005 APL Updated comment on external memory size enum
* 142 21/07/2005 MRC Added extra UDP->RTP protocols
*
*******************************************************************************/
#ifndef _ZL5011X_H
#define _ZL5011X_H
#ifdef __cplusplus
extern "C" {
#endif
/***************** INCLUDE FILES ******************************************/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <stdarg.h>
#include <time.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "zl5011xCompiler.h"
#include "zl5011xError.h"
#include "zl5011xOs.h"
#include "zl5011xAddrMap.h"
#include "zl5011xFlow.h"
/***************** # DEFINES **********************************************/
#define ZL5011X_1BIT_MASK ((Uint32T)0x00000001)
#define ZL5011X_2BIT_MASK ((Uint32T)0x00000003)
#define ZL5011X_3BIT_MASK ((Uint32T)0x00000007)
#define ZL5011X_4BIT_MASK ((Uint32T)0x0000000F)
#define ZL5011X_5BIT_MASK ((Uint32T)0x01F)
#define ZL5011X_8BIT_MASK ((Uint32T)0x000000FF)
#define ZL5011X_10BIT_MASK ((Uint32T)0x3FF)
#define ZL5011X_11BIT_MASK ((Uint32T)0x7FF)
#define ZL5011X_12BIT_MASK ((Uint32T)0xFFF)
#define ZL5011X_13BIT_MASK ((Uint32T)0x1FFF)
#define ZL5011X_16BIT_MASK ((Uint32T)0x0000FFFF)
#define ZL5011X_24BIT_MASK ((Uint32T)0x00FFFFFF)
#define ZL5011X_SET_ALL_BITS_MASK ((Uint32T)0xFFFFFFFF)
#define ZL5011X_ZERO_ALL ((Uint32T)0x00000000)
#define ZL5011X_ALL_BUT_MSB ((Uint32T)0x7FFFFFFF)
#define ZL5011X_MSBIT_MASK ((Uint32T)0x80000000)
/* the following defines are used to represent invalid settings. That is all
1's. A signed -1 is used to allow the define to be assigned to any size
variable */
#define ZL5011X_INVALID (-1)
#define ZL5011X_INVALID_CONTEXT (-1)
#define ZL5011X_INVALID_CHANNEL (-1)
#define ZL5011X_INVALID_STREAM (-1)
#define ZL5011X_NOT_INITIALISED (-1)
/* set the default timeout for the get device exclusion function */
#define ZL5011X_GET_DEVICE_TIMEOUT_MODE ZL5011X_FALSE
/* general pointer check macro */
#define ZL5011X_CHECK_POINTERS(ptr1, ptr2) \
((ptr1 == NULL) || (ptr2 == NULL)) ? \
ZL5011X_INVALID_POINTER : ZL5011X_OK
/* check that the device is functioning macro */
#define ZL5011X_CHECK_RUNNING(dev) \
(dev->running != ZL5011X_TRUE) ? \
ZL5011X_NOT_RUNNING : ZL5011X_OK
/***************** DATA ENUMERATIONS **************************************/
/* True / False question */
#define ZL5011X_CHECK_BOOLEAN(X) \
((X < ZL5011X_FALSE) || (X > ZL5011X_TRUE)) ? \
ZL5011X_PARAMETER_INVALID : ZL5011X_OK
typedef enum
{
ZL5011X_FALSE = 0,
ZL5011X_TRUE = 1
} zl5011xBooleanE;
/* polarity enum and macro for checking parameters */
#define ZL5011X_CHECK_POLARITY(X) \
((X < ZL5011X_NEGATIVE) || (X > ZL5011X_POSITIVE)) ? \
ZL5011X_PARAMETER_INVALID : ZL5011X_OK
typedef enum
{
ZL5011X_NEGATIVE = 0,
ZL5011X_POSITIVE = 1
} zl5011xPolarityE;
/******************************************************************************
* enumerations + structures used for controlling the CPU block
******************************************************************************/
/* DMA Rx Mode enum and macro for checking parameters */
#define ZL5011X_CHECK_DMA_RX_MODE(X) \
((X < ZL5011X_DMA_RX_SINGLEPKT) || (X > ZL5011X_DMA_RX_CONTIN)) ? \
ZL5011X_PARAMETER_INVALID : ZL5011X_OK
typedef enum
{
ZL5011X_DMA_RX_SINGLEPKT,
ZL5011X_DMA_RX_EMPTYBUF,
ZL5011X_DMA_RX_CONTIN,
ZL5011X_DMA_RX_WAIT_AND_EMPTYBUF
} zl5011xDmaRxModeE;
/**********************/
/* DMA Rx/Tx Control enum and macro for checking parameters */
#define ZL5011X_CHECK_DMA_CONTROL(X) \
((X < ZL5011X_DMA_DISABLED) || (X > ZL5011X_DMA_ENABLED)) ? \
ZL5011X_PARAMETER_INVALID : ZL5011X_OK
typedef enum
{
ZL5011X_DMA_DISABLED,
ZL5011X_DMA_ENABLED
} zl5011xDmaControlModeE;
/**********************/
typedef enum
{
ZL5011X_DMA_NO_INTERRUPT,
ZL5011X_DMA_INTERRUPT_ON_PACKET,
ZL5011X_DMA_INTERRUPT_ON_FINISH
} zl5011xDmaInterruptModeE;
/******************************************************************************
* The CPU DMA structure used for the CPU interface
******************************************************************************/
#define ZL5011X_CHECK_DMA_PADDING(X) \
((X > ZL5011X_DMA_NO_PADDING) || (X < ZL5011X_DMA_64BYTE_PADDING)) ? \
ZL5011X_PARAMETER_INVALID : ZL5011X_OK
typedef enum
{
ZL5011X_DMA_64BYTE_PADDING,
ZL5011X_DMA_32BYTE_PADDING,
ZL5011X_DMA_NO_PADDING
} zl5011xDmaMsgPaddingE;
/* Macro to check the CPU queue number */
/* Do not use this for checking the Lan Port queue validity */
#define ZL5011X_CHECK_QUEUE_NUMBER(X) \
(X != ZL5011X_QUEUE_0) ?\
ZL5011X_PARAMETER_INVALID : ZL5011X_OK
typedef enum
{
ZL5011X_QUEUE_0 = 0
} zl5011xQueueE;
typedef struct
{
zl5011xQueueE Queue; /* Queue 0 to 3 */
Uint32T QueueOverflow[ZL5011X_CPQ_QUEUES];/* Used to limit capacity of queues */
Uint32T QueueSize[ZL5011X_CPQ_QUEUES]; /* Actual number of granules in queue */
Uint32T TailPointer[ZL5011X_CPQ_QUEUES]; /* Pointer to tail granule */
Uint32T HeadPointer[ZL5011X_CPQ_QUEUES]; /* Pointer to head granule */
Uint32T PacketCount[ZL5011X_CPQ_QUEUES];/* Number of data packets held in queue */
Uint32T QueueStatus; /* Status information of queue */
Uint32T QueueControl; /* Used to contol packet dropping */
Uint32T MaxQueueSize; /* Maximum allowable queue size */
} zl5011xCpqS;
typedef struct
{
zl5011xDmaControlModeE txControlMode;
zl5011xDmaControlModeE rxControlMode;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -