📄 txc_envoy_mac_api.h
字号:
/*--------------------------------------------------------------------------
******* ****
* ***** ** * * * * * * ***** **** * *
* * * * * ** * * * * * * * * * *
* * * * * * * * **** * * * * * ******
* ***** ****** * * * * * ** * * * * * *
* * * * * * ** * * ** ** * * * * * *
* * * * * * * **** * * * * **** * *
Proprietary and Confidential
This program is made available only to customers and prospective customers
of TranSwitch Corporation under license and may be used only with TranSwitch
semi-conductor products.
Copyright(c) 2004 TranSwitch Inc.
--------------------------------------------------------------------------
******* ** ** ** ** ******** ** **
******* *** ** ** ** ********** ** **
** ** * ** ** ** ** ** ** **
***** ** * ** ** ** ** ** * *
***** ** * ** ** ** ** ** **
** ** * ** ** ** ** ** **
******* ** *** **** ********** **
******* ** ** ** ******** **
--------------------------------------------------------------------------
TranSwitch Envoy-CE2/CE4
Device Driver
--------------------------------------------------------------------------
Workfile: txc_envoy_mac_api.h
Description: This header file contains the defines, data types and prototypes
for the ethernet MAC interface.
--------------------------------------------------------------------------
Revision History
--------------------------------------------------------------------------
Rev # Date Author Description
----- ------- ----------- -----------
0.5.0 6/03/04 F. Giannella Initial release (beta)
*--------------------------------------------------------------------------*/
#ifndef TXC_ENVOY_MAC_API_H
#define TXC_ENVOY_MAC_API_H
/****************************************************************************
** Defines **
****************************************************************************/
/* these defines are used by all MAC functions */
#define ENVOY_MAC_MAX_TERMS 1
#define ENVOY_MAC_MAX_PORTS 8
#define ENVOY_MAC_ALL_TERMS 0xFFFF
#define ENVOY_MAC_ALL_PORTS 0xFFFF
#define ENVOY_MAC_ALL_PHYS 0xFFFF
/* these defines are used by TXC_ENVOY_MacReset */
#define ENVOY_MAC_FULL_RESET_CMD 0x800F0000
/* these defines are used by TXC_ENVOY_MacIfaceSet & TXC_ENVOY_MacIfaceGet */
#define ENVOY_SIZE_OF_MAC_ADDR 6
/* #define ENVOY_MAC_MAX_RX_MIN_FRAME 6 */
#define ENVOY_MAC_MAX_GAP_SIZE 0x7F
#define ENVOY_MAC_MAX_IPG_SIZE 0x7F
#define ENVOY_MAC_MAX_IFG_SIZE 0x7F
#define ENVOY_MAX_PREAMBLE_LEN 0xF
#define ENVOY_MAC_FRAMELEN_CNFG_ERR 0xFFFE
#define ENVOY_MAX_FRAME_SIZE 12000 /* Super Jumbo */
#define ENVOY_MIN_FRAME_SIZE 64 /* hard-coded minimum */
#define ENVOY_MAC_MAX_ALT_BACKOFF_TRUNC 0x000F
#define ENVOY_MAC_MAX_COLLISION_WINDOW 0x03FF
#define ENVOY_MAC_MAX_RETRANS 0x000F
/* these defines are used by TXC_ENVOY_MacIngressFlowCtrlSet & TXC_ENVOY_MacIngressFlowCtrlSet */
TXC_U16BIT ingressFlowCtrlFramePauseTime;
TXC_U16BIT ingressFlowCtrlFrameExtendedParameter;
#define ENVOY_MAC_MAX_FC_FRAME_PAUSE_TIME 0xFFFF
#define ENVOY_MAC_MAX_FC_FRAME_EXT 0xFFFF
/* these defines are used by ENVOY_EthernetPortConfigRealGet */
#define ENVOY_MAC_MODE_OFF 0
#define ENVOY_MAC_SMII_OR_MII_MODE 1
#define ENVOY_MAC_GMII_MODE 2
/* these defines are used by TXC_ENVOY_RtrvMacStatus */
#define ENVOY_MAC_STATUS_MASK 0x000003FF /* status bits to read from status register */
#define ENVOY_MAC_LATCH_JABBER 0x00000001 /* latched jabber condition */
#define ENVOY_MAC_LATCH_SQE 0x00000002 /* latched SQE condition */
#define ENVOY_MAC_LATCH_LOC 0x00000004 /* latched loss of ethernet carrier condition */
#define ENVOY_MAC_LINK_FAIL 0x00000008 /* 330 mS has occurred since a signal was detected */
#define ENVOY_MAC_SPEED 0x00000010 /* set if link is running at 100 MHz, clear if 10 MHz */
#define ENVOY_MAC_FULL_DUPLEX 0x00000020 /* set if interface is full duplex mode, clear if half */
#define ENVOY_MAC_LINK_OK 0x00000040 /* link is detected */
#define ENVOY_MAC_JABBER 0x00000080 /* real-time jabber condition */
#define ENVOY_MAC_CLASH 0x00000100 /* real-time clash conditions */
#define ENVOY_MAC_LATCH_DEFER 0x00000200 /* latched excessive defer condition Clear on read */
#define ENVOY_MAC_DEFECT_MASK 0x000003FF /* all conditions */
#define ENVOY_MAC_MAX_PHYSCAN_RETRY (64*20*2) /* 64 MII Mgmt port clocks, assume using div by 20 clock */
/****************************************************************************
** Data Structures **
****************************************************************************/
/* this enumerated data type & structure are used by TXC_IfMAC_OperationalStateSet
and TXC_IfMAC_OperationalStateGet */
typedef enum
{
TXC_IfMAC_NO_DIR_ENABLED = 0,
TXC_IfMAC_INGRESS_ENABLED_ONLY,
TXC_IfMAC_EGRESS_ENABLED_ONLY,
TXC_IfMAC_BOTH_DIR_ENABLED,
TXC_IfMAC_END_OF_ENABLE_MODE_ENUM,
TXC_IfMAC_ENABLE_MODE_ENUM_ERR= 0xFFFE
} TXC_IfMAC_ENABLE_MODE_ENUM;
typedef struct
{
TXC_IfMAC_ENABLE_MODE_ENUM macTransferEnableMode;
} TXC_IfMAC_OPERATIONAL_STATE_STRUCT;
/****************************************************************************/
/* this enumerated data type & structure are used by TXC_IfMAC_Reset */
typedef enum
{
TXC_IfMAC_HARD_RESET = 0, /* reset the entire EIB including the Host I/F */
/* Reg0.31 and Reg0.19_16 */
TXC_IfMAC_SOFT_RESET, /* reset the MAC, Reg08.31 */
TXC_IfMAC_END_OF_RESET_ENUM,
TXC_IfMAC_RESET_ENUM_ERR= 0xFFFE
} TXC_IfMAC_RESET_ENUM;
typedef struct
{
TXC_IfMAC_RESET_ENUM resetMode; /* This parameter selects the type of reset on the MAC. */
} TXC_IfMAC_RESET_STRUCT;
/****************************************************************************/
/* these enumerated data types & structures are used by TXC_IfMAC_ConfigSet
& TXC_IfMAC_ConfigGet */
typedef enum
{
TXC_IfMAC_NO_PAD_NO_CRC = 0,
TXC_IfMAC_NO_PAD_CRC_ALL,
TXC_IfMAC_PAD_SMALL_CRC_ALL,
TXC_IfMAC_END_OF_PAD_CRC_ENUM,
TXC_IfMAC_PAD_CRC_ENUM_ERR= 0xFFFE
} TXC_IfMAC_PAD_CRC_ENUM;
typedef struct
{
TXC_U8BIT stationAddr[ENVOY_SIZE_OF_MAC_ADDR];
TXC_BOOL fullDuplexEnable;
TXC_U16BIT maxFrameLen;
TXC_BOOL ingressFrameLenCheckEnable;
TXC_BOOL hugeFrameEnable;
TXC_U16BIT b2bIPG;
TXC_U16BIT minIFG;
TXC_U16BIT preambleLen;
TXC_IfMAC_PAD_CRC_ENUM egressPadAndCrcAppendMode;
} TXC_IfMAC_CONFIG_STRUCT;
/****************************************************************************/
/* this structure is used by TXC_IfMAC_HalfDuplexSet
& TXC_IfMAC_HalfDuplexGet */
typedef struct
{
TXC_BOOL excessiveDeferEnable;
TXC_BOOL noBackoffEnable;
TXC_BOOL backPressureNoBackoffEnable;
TXC_BOOL altBinExpBackoffEnable;
TXC_U16BIT altBinExpBackoffTrunc;
TXC_U16BIT collisionWindow;
TXC_U16BIT retranMax;
TXC_U16BIT nonB2bIPGpart1;
TXC_U16BIT nonB2bIPGpart2;
} TXC_IfMAC_HALF_DUPLEX_STRUCT;
/****************************************************************************/
/* this enumeration and structure are used by TXC_IfMAC_LoopbackSet
& TXC_IfMAC_LoopbackGet */
typedef enum
{
TXC_IfMAC_LPBK_NONE = 0,
TXC_IfMAC_EGR_TO_INGR_LPBK,
TXC_IfMAC_INGR_TO_EGR_TRANSPARENT_LPBK,
TXC_IfMAC_INGR_TO_EGR_NON_TRANSPARENT_LPBK,
TXC_IfMAC_END_OF_LPBK_ENUM,
TXC_IfMAC_LPBK_ENUM_ERR= 0xFFFE
} TXC_IfMAC_LPBK_ENUM;
typedef struct
{ TXC_IfMAC_LPBK_ENUM macLpbkMode;
} TXC_IfMAC_LOOPBACK_STRUCT;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -