📄 ixatmcodelet_p.h
字号:
/** * @file IxAtmCodelet_p.h * * @date 31-May-2002 * * @brief Private header file for the IXP400 Atm codelet * * @par * IXP400 SW Release version 2.1 * * -- Copyright Notice -- * * @par * Copyright (c) 2001-2005, Intel Corporation. * All rights reserved. * * @par * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Intel Corporation nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * * @par * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * @par * -- End of Copyright Notice -- */#ifndef IXATMCODELET_P_H#define IXATMCODELET_P_H/* * System defined includes *//* * User defined includes */#include "IxOsal.h"#include "IxAtmTypes.h"#include "IxAtmdAcc.h"#include "IxAtmdAcc.h"#include "IxAtmm.h"#include "IxNpeDl.h"/* * #defines and macros used in this file. *//** * @brief Mbuf cluster block size */#define IX_ATMCODELET_MBUF_SIZE (2000) /** * @brief Notification trigger threshold value */#define IX_ATMCODELET_RX_FREE_Q_LOW_THRESHOLD (8) /** * @brief Default Cell Loss Priority value for ATM cell */#define IX_ATMCODELET_DEFAULT_CLP (0)/** * @brief ATM Codelet log */#define IX_ATMCODELET_LOG printf/** * @brief VCI values */#define IX_OAM_ITU610_F4_SEG_VCI 3#define IX_OAM_ITU610_F4_ETE_VCI 4/** * @brief PTI values */#define IX_OAM_ITU610_F5_SEG_PTI 4#define IX_OAM_ITU610_F5_ETE_PTI 5/** * @brief Length of correlation tag bytes in LB cell */#define IX_OAM_ITU610_LB_CORRELATION_TAG_LEN 4/** * @brief Size of all location ID attributes in bytes. */#define IX_OAM_ITU610_LOCATION_ID_LEN 16/** * @brief Reserved bytes in OAM cells */#define IX_OAM_ITU610_RESERVED_BYTE_VALUE 0x6a#define IX_OAM_ITU610_GENERIC_PAYLOAD_RESERVED_BYTES_LEN 45#define IX_OAM_ITU610_LB_RESERVED_BYTES_LEN 8/** * @brief Reserved and CRC10 length */#define IX_OAM_ITU610_RESERVED_AND_CRC10_LEN 2/** * @brief Loopback timeout */#define IX_OAM_ITU610_LB_TIMEOUT_PERIOD_MSECS 5000/** * @brief OAM Function Types */#define IX_OAM_ITU610_TYPE_FAULT_MAN_LB 0x18/** * @brief Values for Loopback Indication field */#define IX_OAM_ITU610_LB_INDICATION_PARENT 1#define IX_OAM_ITU610_LB_INDICATION_CHILD 0#define IX_ATMCODELET_8VCS 8#define IX_ATMCODELET_16VCS 16/* * Typedefs *//** * @brief atm cell header */typedef UINT32 atmCellHeader;/** * @brief Codelet statistics */typedef struct{ UINT32 txPdus; UINT32 txBytes; UINT32 rxPdus; UINT32 rxBytes; UINT32 txDonePdus; UINT32 rxFreeBuffers; UINT32 txPdusSubmitFail; UINT32 txPdusSubmitBusy; UINT32 rxPdusInvalid;} IxAtmCodeletStats;/** * @brief Mode of operation of the Atmd Access Codelet. */typedef enum{ /**< All cells sent out are looped back in by the UTOPIA hardware. * Useful for demonstrating traffic on a board with no ADSL PHY or * external test equipment. Setup 32 UBR VCs. */ IX_ATMCODELET_UTOPIA_LOOPBACK = 0, /**< All cells sent out are looped back in by the UTOPIA hardware. Setup only * 8VBR, 8CBR and 16UBR VCs */ IX_ATMCODELET_UTOPIA_LOOPBACK_8VBR_8CBR_16UBR, /**< All cells received are looped back out again by the software. * Setup 32 UBR VCs*/ IX_ATMCODELET_SOFTWARE_LOOPBACK, /**< All cells received are looped back out again by the software. * Setup 8VBR, 8 CBR and 16 UBR VCs*/ IX_ATMCODELET_SOFTWARE_LOOPBACK_8VBR_8CBR_16UBR, /**< All cells sent are anticipated to be loopbed back by external * equipment. Setup 32 UBRs */ IX_ATMCODELET_REMOTE_LOOPBACK, /**< All cells sent are anticipated to be loopbed back by external * equipment. Setup 8VBR, 8CBR, 16UBR VCs */ IX_ATMCODELET_REMOTE_LOOPBACK_8VBR_8CBR_16UBR, /**< Mode type for OAM Utopia Loopback ping */ IX_ATMCODELET_UTOPIA_LOOPBACK_PERFORM_OAM_PING_F4F5, /**< Mode type for OAM Software Loopback Ping */ IX_ATMCODELET_SOFTWARE_LOOPBACK_PERFORM_OAM_PING_F4F5, /**< Invalid mode */ IX_ATMCODELET_INVALID_MODE} IxAtmCodeletMode;/** * @brief The type of AAL that the user is allowed to use */typedef enum{ ixAtmCodeletAalTypeInvalid = 0, /**< Invalid AAL*/ ixAtmCodeletAalType5, /**< AAL 5*/ ixAtmCodeletAalType0_48, /**< AAL 0 48bytes */ ixAtmCodeletAalType0_52, /**< AAL0 52bytes */ ixAtmCodeletAalTypeMax /**< Max AAL type that is available here*/ } IxAtmCodeletAalType; /** * @brief Oam cells payload typedefs */typedef struct{ UINT8 oamTypeAndFunction; UINT8 loopbackIndication; UINT8 correlationTag[IX_OAM_ITU610_LB_CORRELATION_TAG_LEN]; UINT8 llid[IX_OAM_ITU610_LOCATION_ID_LEN]; UINT8 sourceId[IX_OAM_ITU610_LOCATION_ID_LEN]; UINT8 reserved[IX_OAM_ITU610_LB_RESERVED_BYTES_LEN]; UINT8 reservedAndCrc10[IX_OAM_ITU610_RESERVED_AND_CRC10_LEN];} IxOamITU610LbPayload;/** * @brief Generic payload isn't a real payload but is used * for checking which payload type a received OAM cell is */typedef struct{ UINT8 oamTypeAndFunction; UINT8 reserved[IX_OAM_ITU610_GENERIC_PAYLOAD_RESERVED_BYTES_LEN]; UINT8 reservedAndCrc10[IX_OAM_ITU610_RESERVED_AND_CRC10_LEN];} IxOamITU610GenericPayload;/** * @brief OAM ITU610 Payload */typedef union{ IxOamITU610LbPayload lbPayload; IxOamITU610GenericPayload genericPayload; /* Other payload types could be defined here, e.g. Fault Management etc.*/} IxOamITU610Payload;/** * @brief OAM ITU610 Cell */typedef struct{ atmCellHeader header; IxOamITU610Payload payload;} IxOamITU610Cell;/* * Function declarations *//** * @brief This function is used to initialize the lower level system component * used by the IxAtmCodelet. It should be called before any other * IxAtmCodelet API function UNLESS the system initialisation is done * elsewhere. * * This function initializes QMgr using ixQMgrInit() function in order to * provide interfaces for configuring and accessing the IXP4XX AQM hardware * queues to facilitate communication of data between the NPEs and the XScale. * * It also sets up how the QMgr is being called i.e. interrupt or poll mode. * In addition, this function initializes the NPE Message Handler * (ixNpeMhInitialize()), download NPE image (ixAtmUtilsAtmImageDownload()), * and starts the NPE (ixNpeDlNpeExecutionStart()). * * @param "UINT32 numPorts" The number of ATM ports to configure. * Valid values range from 1 to 12. * * @param "IxAtmCodeletMode mode" This indicates the codelet mode. * * @return * IX_SUCCESS Indicates that the Atm Codelet system init successfull.<br> * IX_FAIL Some internal error has prevented the Atm Codelet * sstem components from initialising. */PUBLIC IX_STATUSixAtmCodeletSystemInit (UINT32 numPorts, IxAtmCodeletMode mode);/** * @brief This function is used to initialize the IxAtmCodelet. It * should be called before any other IxAtmCodelet API function. * This function can be called from the VxWorks* windSh. * * This function does the following sequence:<br> * a) Enabled up either UTOPIA, Software or Remote loopback mode * * b) Sets up the UTOPIA Phy port addresss for each port. These addresses * need to be defined as per the Physical interface used. * * c) Initialize the following component: * - ATM Scheduler - ixAtmSchInit() * - ATM Driver Access component - ixAtmdAccInit() * - ATM Mgmt for UTOPIA - ixAtmmUtopiaInit() * - MBuf Pool through the IxAtmUtils subcomponent- ixAtmUtilsMbufPoolInit() * - The ports (ixAtmmPortInitialize) * * d) Enable the ports using ixAtmmPortEnable() * * e) Depending on the Loopback mode, this function will initialize * - IxAtmCodeletRxTx subcomponent by using ixAtmTxRxInit() function <br> * IF UTOPIA_LOOPBACK or REMOTE_LOOPBACK mode is set * - IxAtmCodeletSwLoopback subcomponent by using ixAtmSwLbInit() function <br> * IF SOFTWARE_LOOPBACK mode is set * f) Initialize OAM Codelet using ixOamCodeletInit() * * g) Sets the initialized flag - i.e. ixAtmCodeletInitialized = TRUE * * @param "UINT32 numPorts" The number of ATM ports to configure. * Valid values range from 1 to 12. * * @param "UINT32 rxToTxRatio" Ratio of PDUs received to attempted PDU sends * when softwareLoopbackEnabled := TRUE. e.g. if rxToTxRatio is 6 then * 1 PDU will be sent for every 6 PDUs received. * * @return * IX_SUCCESS Indicates tha the Atm Codelet has been successfully * initialized. <br> * IX_FAIL Some internal error has prevented the Atm Codelet * from initialising. */PUBLIC IX_STATUSixAtmCodeletInit (UINT32 numPorts, UINT32 rxToTxRatio);/** * @brief This function is used to provision a number of bidirectional * Atm UBR channels on the specified number of ports. * This function may be called a number of times for different Aal * types until all of the available 32 channels are used. * * It is responsible to create the specified number of ports and channels. * The number of ports provisioned must be <= the number of ports specified * to ixAtmCodeletInit(). There are two functions to be called depending
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -