1*852ba100SJustin Hibbits /* Copyright (c) 2008-2012 Freescale Semiconductor, Inc. 20aeed3e9SJustin Hibbits * All rights reserved. 30aeed3e9SJustin Hibbits * 40aeed3e9SJustin Hibbits * Redistribution and use in source and binary forms, with or without 50aeed3e9SJustin Hibbits * modification, are permitted provided that the following conditions are met: 60aeed3e9SJustin Hibbits * * Redistributions of source code must retain the above copyright 70aeed3e9SJustin Hibbits * notice, this list of conditions and the following disclaimer. 80aeed3e9SJustin Hibbits * * Redistributions in binary form must reproduce the above copyright 90aeed3e9SJustin Hibbits * notice, this list of conditions and the following disclaimer in the 100aeed3e9SJustin Hibbits * documentation and/or other materials provided with the distribution. 110aeed3e9SJustin Hibbits * * Neither the name of Freescale Semiconductor nor the 120aeed3e9SJustin Hibbits * names of its contributors may be used to endorse or promote products 130aeed3e9SJustin Hibbits * derived from this software without specific prior written permission. 140aeed3e9SJustin Hibbits * 150aeed3e9SJustin Hibbits * 160aeed3e9SJustin Hibbits * ALTERNATIVELY, this software may be distributed under the terms of the 170aeed3e9SJustin Hibbits * GNU General Public License ("GPL") as published by the Free Software 180aeed3e9SJustin Hibbits * Foundation, either version 2 of that License or (at your option) any 190aeed3e9SJustin Hibbits * later version. 200aeed3e9SJustin Hibbits * 210aeed3e9SJustin Hibbits * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 220aeed3e9SJustin Hibbits * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 230aeed3e9SJustin Hibbits * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 240aeed3e9SJustin Hibbits * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 250aeed3e9SJustin Hibbits * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 260aeed3e9SJustin Hibbits * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 270aeed3e9SJustin Hibbits * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 280aeed3e9SJustin Hibbits * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 290aeed3e9SJustin Hibbits * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 300aeed3e9SJustin Hibbits * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 310aeed3e9SJustin Hibbits */ 320aeed3e9SJustin Hibbits 33*852ba100SJustin Hibbits 340aeed3e9SJustin Hibbits /**************************************************************************//** 350aeed3e9SJustin Hibbits @File fm_port_ext.h 360aeed3e9SJustin Hibbits 370aeed3e9SJustin Hibbits @Description FM-Port Application Programming Interface. 380aeed3e9SJustin Hibbits *//***************************************************************************/ 390aeed3e9SJustin Hibbits #ifndef __FM_PORT_EXT 400aeed3e9SJustin Hibbits #define __FM_PORT_EXT 410aeed3e9SJustin Hibbits 420aeed3e9SJustin Hibbits #include "error_ext.h" 430aeed3e9SJustin Hibbits #include "std_ext.h" 440aeed3e9SJustin Hibbits #include "fm_pcd_ext.h" 450aeed3e9SJustin Hibbits #include "fm_ext.h" 460aeed3e9SJustin Hibbits #include "net_ext.h" 470aeed3e9SJustin Hibbits 480aeed3e9SJustin Hibbits 490aeed3e9SJustin Hibbits /**************************************************************************//** 500aeed3e9SJustin Hibbits 510aeed3e9SJustin Hibbits @Group FM_grp Frame Manager API 520aeed3e9SJustin Hibbits 530aeed3e9SJustin Hibbits @Description FM API functions, definitions and enums 540aeed3e9SJustin Hibbits 550aeed3e9SJustin Hibbits @{ 560aeed3e9SJustin Hibbits *//***************************************************************************/ 570aeed3e9SJustin Hibbits 580aeed3e9SJustin Hibbits /**************************************************************************//** 590aeed3e9SJustin Hibbits @Group FM_PORT_grp FM Port 600aeed3e9SJustin Hibbits 610aeed3e9SJustin Hibbits @Description FM Port API 620aeed3e9SJustin Hibbits 630aeed3e9SJustin Hibbits The FM uses a general module called "port" to represent a Tx port 64*852ba100SJustin Hibbits (MAC), an Rx port (MAC) or Offline Parsing port. 65*852ba100SJustin Hibbits The number of ports in an FM varies between SOCs. 66*852ba100SJustin Hibbits The SW driver manages these ports as sub-modules of the FM, i.e. 67*852ba100SJustin Hibbits after an FM is initialized, its ports may be initialized and 68*852ba100SJustin Hibbits operated upon. 690aeed3e9SJustin Hibbits 700aeed3e9SJustin Hibbits The port is initialized aware of its type, but other functions on 710aeed3e9SJustin Hibbits a port may be indifferent to its type. When necessary, the driver 72*852ba100SJustin Hibbits verifies coherence and returns error if applicable. 730aeed3e9SJustin Hibbits 740aeed3e9SJustin Hibbits On initialization, user specifies the port type and it's index 75*852ba100SJustin Hibbits (relative to the port's type) - always starting at 0. 760aeed3e9SJustin Hibbits 770aeed3e9SJustin Hibbits @{ 780aeed3e9SJustin Hibbits *//***************************************************************************/ 790aeed3e9SJustin Hibbits 800aeed3e9SJustin Hibbits /**************************************************************************//** 810aeed3e9SJustin Hibbits @Description An enum for defining port PCD modes. 820aeed3e9SJustin Hibbits This enum defines the superset of PCD engines support - i.e. not 830aeed3e9SJustin Hibbits all engines have to be used, but all have to be enabled. The real 840aeed3e9SJustin Hibbits flow of a specific frame depends on the PCD configuration and the 850aeed3e9SJustin Hibbits frame headers and payload. 86*852ba100SJustin Hibbits Note: the first engine and the first engine after the parser (if 87*852ba100SJustin Hibbits exists) should be in order, the order is important as it will 88*852ba100SJustin Hibbits define the flow of the port. However, as for the rest engines 89*852ba100SJustin Hibbits (the ones that follows), the order is not important anymore as 90*852ba100SJustin Hibbits it is defined by the PCD graph itself. 910aeed3e9SJustin Hibbits *//***************************************************************************/ 920aeed3e9SJustin Hibbits typedef enum e_FmPortPcdSupport { 93*852ba100SJustin Hibbits e_FM_PORT_PCD_SUPPORT_NONE = 0 /**< BMI to BMI, PCD is not used */ 94*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_PRS_ONLY /**< Use only Parser */ 95*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_PLCR_ONLY /**< Use only Policer */ 96*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_PRS_AND_PLCR /**< Use Parser and Policer */ 97*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG /**< Use Parser and Keygen */ 98*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_CC /**< Use Parser, Keygen and Coarse Classification */ 99*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_CC_AND_PLCR 1000aeed3e9SJustin Hibbits /**< Use all PCD engines */ 101*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_PLCR /**< Use Parser, Keygen and Policer */ 102*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_PRS_AND_CC /**< Use Parser and Coarse Classification */ 103*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_PRS_AND_CC_AND_PLCR /**< Use Parser and Coarse Classification and Policer */ 104*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_CC_ONLY /**< Use only Coarse Classification */ 1050aeed3e9SJustin Hibbits #ifdef FM_CAPWAP_SUPPORT 106*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_CC_AND_KG /**< Use Coarse Classification,and Keygen */ 107*852ba100SJustin Hibbits , e_FM_PORT_PCD_SUPPORT_CC_AND_KG_AND_PLCR /**< Use Coarse Classification, Keygen and Policer */ 1080aeed3e9SJustin Hibbits #endif /* FM_CAPWAP_SUPPORT */ 1090aeed3e9SJustin Hibbits } e_FmPortPcdSupport; 1100aeed3e9SJustin Hibbits 1110aeed3e9SJustin Hibbits /**************************************************************************//** 1120aeed3e9SJustin Hibbits @Description Port interrupts 1130aeed3e9SJustin Hibbits *//***************************************************************************/ 1140aeed3e9SJustin Hibbits typedef enum e_FmPortExceptions { 1150aeed3e9SJustin Hibbits e_FM_PORT_EXCEPTION_IM_BUSY /**< Independent-Mode Rx-BUSY */ 1160aeed3e9SJustin Hibbits } e_FmPortExceptions; 1170aeed3e9SJustin Hibbits 1180aeed3e9SJustin Hibbits 1190aeed3e9SJustin Hibbits /**************************************************************************//** 1200aeed3e9SJustin Hibbits @Collection General FM Port defines 1210aeed3e9SJustin Hibbits *//***************************************************************************/ 1220aeed3e9SJustin Hibbits #define FM_PORT_PRS_RESULT_NUM_OF_WORDS 8 /**< Number of 4 bytes words in parser result */ 1230aeed3e9SJustin Hibbits /* @} */ 1240aeed3e9SJustin Hibbits 1250aeed3e9SJustin Hibbits /**************************************************************************//** 1260aeed3e9SJustin Hibbits @Collection FM Frame error 1270aeed3e9SJustin Hibbits *//***************************************************************************/ 1280aeed3e9SJustin Hibbits typedef uint32_t fmPortFrameErrSelect_t; /**< typedef for defining Frame Descriptor errors */ 1290aeed3e9SJustin Hibbits 130*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_UNSUPPORTED_FORMAT FM_FD_ERR_UNSUPPORTED_FORMAT /**< Not for Rx-Port! Unsupported Format */ 131*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_LENGTH FM_FD_ERR_LENGTH /**< Not for Rx-Port! Length Error */ 132*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_DMA FM_FD_ERR_DMA /**< DMA Data error */ 133*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_NON_FM FM_FD_RX_STATUS_ERR_NON_FM /**< non Frame-Manager error; probably come from SEC that 1340aeed3e9SJustin Hibbits was chained to FM */ 135*852ba100SJustin Hibbits 136*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_IPRE (FM_FD_ERR_IPR & ~FM_FD_IPR) /**< IPR error */ 137*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_IPR_NCSP (FM_FD_ERR_IPR_NCSP & ~FM_FD_IPR) /**< IPR non-consistent-sp */ 138*852ba100SJustin Hibbits 139*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_IPFE 0 /**< Obsolete; will be removed in the future */ 140*852ba100SJustin Hibbits 141*852ba100SJustin Hibbits #ifdef FM_CAPWAP_SUPPORT 142*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_CRE FM_FD_ERR_CRE 143*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_CHE FM_FD_ERR_CHE 1440aeed3e9SJustin Hibbits #endif /* FM_CAPWAP_SUPPORT */ 145*852ba100SJustin Hibbits 146*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_PHYSICAL FM_FD_ERR_PHYSICAL /**< Rx FIFO overflow, FCS error, code error, running disparity 1470aeed3e9SJustin Hibbits error (SGMII and TBI modes), FIFO parity error. PHY 1480aeed3e9SJustin Hibbits Sequence error, PHY error control character detected. */ 149*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_SIZE FM_FD_ERR_SIZE /**< Frame too long OR Frame size exceeds max_length_frame */ 150*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_CLS_DISCARD FM_FD_ERR_CLS_DISCARD /**< indicates a classifier "drop" operation */ 151*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_EXTRACTION FM_FD_ERR_EXTRACTION /**< Extract Out of Frame */ 152*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_NO_SCHEME FM_FD_ERR_NO_SCHEME /**< No Scheme Selected */ 153*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_KEYSIZE_OVERFLOW FM_FD_ERR_KEYSIZE_OVERFLOW /**< Keysize Overflow */ 154*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_COLOR_RED FM_FD_ERR_COLOR_RED /**< Frame color is red */ 155*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_COLOR_YELLOW FM_FD_ERR_COLOR_YELLOW /**< Frame color is yellow */ 156*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_ILL_PLCR FM_FD_ERR_ILL_PLCR /**< Illegal Policer Profile selected */ 157*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_PLCR_FRAME_LEN FM_FD_ERR_PLCR_FRAME_LEN /**< Policer frame length error */ 158*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_PRS_TIMEOUT FM_FD_ERR_PRS_TIMEOUT /**< Parser Time out Exceed */ 159*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_PRS_ILL_INSTRUCT FM_FD_ERR_PRS_ILL_INSTRUCT /**< Invalid Soft Parser instruction */ 160*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_PRS_HDR_ERR FM_FD_ERR_PRS_HDR_ERR /**< Header error was identified during parsing */ 161*852ba100SJustin Hibbits #define FM_PORT_FRM_ERR_BLOCK_LIMIT_EXCEEDED FM_FD_ERR_BLOCK_LIMIT_EXCEEDED /**< Frame parsed beyind 256 first bytes */ 1620aeed3e9SJustin Hibbits #define FM_PORT_FRM_ERR_PROCESS_TIMEOUT 0x00000001 /**< FPM Frame Processing Timeout Exceeded */ 1630aeed3e9SJustin Hibbits /* @} */ 1640aeed3e9SJustin Hibbits 1650aeed3e9SJustin Hibbits 1660aeed3e9SJustin Hibbits 1670aeed3e9SJustin Hibbits /**************************************************************************//** 1680aeed3e9SJustin Hibbits @Group FM_PORT_init_grp FM Port Initialization Unit 1690aeed3e9SJustin Hibbits 1700aeed3e9SJustin Hibbits @Description FM Port Initialization Unit 1710aeed3e9SJustin Hibbits 1720aeed3e9SJustin Hibbits @{ 1730aeed3e9SJustin Hibbits *//***************************************************************************/ 1740aeed3e9SJustin Hibbits 1750aeed3e9SJustin Hibbits /**************************************************************************//** 1760aeed3e9SJustin Hibbits @Description Exceptions user callback routine, will be called upon an 1770aeed3e9SJustin Hibbits exception passing the exception identification. 1780aeed3e9SJustin Hibbits 1790aeed3e9SJustin Hibbits @Param[in] h_App - User's application descriptor. 1800aeed3e9SJustin Hibbits @Param[in] exception - The exception. 1810aeed3e9SJustin Hibbits *//***************************************************************************/ 1820aeed3e9SJustin Hibbits typedef void (t_FmPortExceptionCallback) (t_Handle h_App, e_FmPortExceptions exception); 1830aeed3e9SJustin Hibbits 1840aeed3e9SJustin Hibbits /**************************************************************************//** 1850aeed3e9SJustin Hibbits @Description User callback function called by driver with received data. 1860aeed3e9SJustin Hibbits 1870aeed3e9SJustin Hibbits User provides this function. Driver invokes it. 1880aeed3e9SJustin Hibbits 1890aeed3e9SJustin Hibbits @Param[in] h_App Application's handle originally specified to 1900aeed3e9SJustin Hibbits the API Config function 1910aeed3e9SJustin Hibbits @Param[in] p_Data A pointer to data received 1920aeed3e9SJustin Hibbits @Param[in] length length of received data 1930aeed3e9SJustin Hibbits @Param[in] status receive status and errors 1940aeed3e9SJustin Hibbits @Param[in] position position of buffer in frame 1950aeed3e9SJustin Hibbits @Param[in] h_BufContext A handle of the user acossiated with this buffer 1960aeed3e9SJustin Hibbits 1970aeed3e9SJustin Hibbits @Retval e_RX_STORE_RESPONSE_CONTINUE - order the driver to continue Rx 1980aeed3e9SJustin Hibbits operation for all ready data. 1990aeed3e9SJustin Hibbits @Retval e_RX_STORE_RESPONSE_PAUSE - order the driver to stop Rx operation. 2000aeed3e9SJustin Hibbits *//***************************************************************************/ 2010aeed3e9SJustin Hibbits typedef e_RxStoreResponse (t_FmPortImRxStoreCallback) (t_Handle h_App, 2020aeed3e9SJustin Hibbits uint8_t *p_Data, 2030aeed3e9SJustin Hibbits uint16_t length, 2040aeed3e9SJustin Hibbits uint16_t status, 2050aeed3e9SJustin Hibbits uint8_t position, 2060aeed3e9SJustin Hibbits t_Handle h_BufContext); 2070aeed3e9SJustin Hibbits 2080aeed3e9SJustin Hibbits /**************************************************************************//** 2090aeed3e9SJustin Hibbits @Description User callback function called by driver when transmit completed. 2100aeed3e9SJustin Hibbits 2110aeed3e9SJustin Hibbits User provides this function. Driver invokes it. 2120aeed3e9SJustin Hibbits 2130aeed3e9SJustin Hibbits @Param[in] h_App Application's handle originally specified to 2140aeed3e9SJustin Hibbits the API Config function 2150aeed3e9SJustin Hibbits @Param[in] p_Data A pointer to data received 2160aeed3e9SJustin Hibbits @Param[in] status transmit status and errors 2170aeed3e9SJustin Hibbits @Param[in] lastBuffer is last buffer in frame 2180aeed3e9SJustin Hibbits @Param[in] h_BufContext A handle of the user acossiated with this buffer 2190aeed3e9SJustin Hibbits *//***************************************************************************/ 2200aeed3e9SJustin Hibbits typedef void (t_FmPortImTxConfCallback) (t_Handle h_App, 2210aeed3e9SJustin Hibbits uint8_t *p_Data, 2220aeed3e9SJustin Hibbits uint16_t status, 2230aeed3e9SJustin Hibbits t_Handle h_BufContext); 2240aeed3e9SJustin Hibbits 2250aeed3e9SJustin Hibbits /**************************************************************************//** 226*852ba100SJustin Hibbits @Description A structure for additional Rx port parameters 2270aeed3e9SJustin Hibbits *//***************************************************************************/ 2280aeed3e9SJustin Hibbits typedef struct t_FmPortRxParams { 2290aeed3e9SJustin Hibbits uint32_t errFqid; /**< Error Queue Id. */ 2300aeed3e9SJustin Hibbits uint32_t dfltFqid; /**< Default Queue Id. */ 2310aeed3e9SJustin Hibbits uint16_t liodnOffset; /**< Port's LIODN offset. */ 232*852ba100SJustin Hibbits t_FmExtPools extBufPools; /**< Which external buffer pools are used 2330aeed3e9SJustin Hibbits (up to FM_PORT_MAX_NUM_OF_EXT_POOLS), and their sizes. */ 2340aeed3e9SJustin Hibbits } t_FmPortRxParams; 2350aeed3e9SJustin Hibbits 2360aeed3e9SJustin Hibbits /**************************************************************************//** 237*852ba100SJustin Hibbits @Description A structure for additional non-Rx port parameters 2380aeed3e9SJustin Hibbits *//***************************************************************************/ 2390aeed3e9SJustin Hibbits typedef struct t_FmPortNonRxParams { 2400aeed3e9SJustin Hibbits uint32_t errFqid; /**< Error Queue Id. */ 241*852ba100SJustin Hibbits uint32_t dfltFqid; /**< For Tx - Default Confirmation queue, 2420aeed3e9SJustin Hibbits 0 means no Tx confirmation for processed 243*852ba100SJustin Hibbits frames. For OP port - default Rx queue. */ 2440aeed3e9SJustin Hibbits uint32_t qmChannel; /**< QM-channel dedicated to this port; will be used 2450aeed3e9SJustin Hibbits by the FM for dequeue. */ 2460aeed3e9SJustin Hibbits } t_FmPortNonRxParams; 2470aeed3e9SJustin Hibbits 2480aeed3e9SJustin Hibbits /**************************************************************************//** 249*852ba100SJustin Hibbits @Description A structure for additional Rx port parameters 2500aeed3e9SJustin Hibbits *//***************************************************************************/ 2510aeed3e9SJustin Hibbits typedef struct t_FmPortImRxTxParams { 2520aeed3e9SJustin Hibbits t_Handle h_FmMuram; /**< A handle of the FM-MURAM partition */ 2530aeed3e9SJustin Hibbits uint16_t liodnOffset; /**< For Rx ports only. Port's LIODN Offset. */ 2540aeed3e9SJustin Hibbits uint8_t dataMemId; /**< Memory partition ID for data buffers */ 2550aeed3e9SJustin Hibbits uint32_t dataMemAttributes; /**< Memory attributes for data buffers */ 2560aeed3e9SJustin Hibbits t_BufferPoolInfo rxPoolParams; /**< For Rx ports only. */ 2570aeed3e9SJustin Hibbits t_FmPortImRxStoreCallback *f_RxStore; /**< For Rx ports only. */ 2580aeed3e9SJustin Hibbits t_FmPortImTxConfCallback *f_TxConf; /**< For Tx ports only. */ 2590aeed3e9SJustin Hibbits } t_FmPortImRxTxParams; 2600aeed3e9SJustin Hibbits 2610aeed3e9SJustin Hibbits /**************************************************************************//** 262*852ba100SJustin Hibbits @Description A union for additional parameters depending on port type 2630aeed3e9SJustin Hibbits *//***************************************************************************/ 2640aeed3e9SJustin Hibbits typedef union u_FmPortSpecificParams { 2650aeed3e9SJustin Hibbits t_FmPortImRxTxParams imRxTxParams; /**< Rx/Tx Independent-Mode port parameter structure */ 2660aeed3e9SJustin Hibbits t_FmPortRxParams rxParams; /**< Rx port parameters structure */ 2670aeed3e9SJustin Hibbits t_FmPortNonRxParams nonRxParams; /**< Non-Rx port parameters structure */ 2680aeed3e9SJustin Hibbits } u_FmPortSpecificParams; 2690aeed3e9SJustin Hibbits 2700aeed3e9SJustin Hibbits /**************************************************************************//** 271*852ba100SJustin Hibbits @Description A structure representing FM initialization parameters 2720aeed3e9SJustin Hibbits *//***************************************************************************/ 2730aeed3e9SJustin Hibbits typedef struct t_FmPortParams { 2740aeed3e9SJustin Hibbits uintptr_t baseAddr; /**< Virtual Address of memory mapped FM Port registers.*/ 2750aeed3e9SJustin Hibbits t_Handle h_Fm; /**< A handle to the FM object this port related to */ 2760aeed3e9SJustin Hibbits e_FmPortType portType; /**< Port type */ 277*852ba100SJustin Hibbits uint8_t portId; /**< Port Id - relative to type; 278*852ba100SJustin Hibbits NOTE: When configuring Offline Parsing port for 279*852ba100SJustin Hibbits FMANv3 devices (DPAA_VERSION 11 and higher), 280*852ba100SJustin Hibbits it is highly recommended NOT to use portId=0 due to lack 281*852ba100SJustin Hibbits of HW resources on portId=0. */ 2820aeed3e9SJustin Hibbits bool independentModeEnable; 2830aeed3e9SJustin Hibbits /**< This port is Independent-Mode - Used for Rx/Tx ports only! */ 2840aeed3e9SJustin Hibbits uint16_t liodnBase; /**< Irrelevant for P4080 rev 1. LIODN base for this port, to be 2850aeed3e9SJustin Hibbits used together with LIODN offset. */ 2860aeed3e9SJustin Hibbits u_FmPortSpecificParams specificParams; /**< Additional parameters depending on port 2870aeed3e9SJustin Hibbits type. */ 2880aeed3e9SJustin Hibbits 289*852ba100SJustin Hibbits t_FmPortExceptionCallback *f_Exception; /**< Relevant for IM only Callback routine to be called on BUSY exception */ 2900aeed3e9SJustin Hibbits t_Handle h_App; /**< A handle to an application layer object; This handle will 2910aeed3e9SJustin Hibbits be passed by the driver upon calling the above callbacks */ 2920aeed3e9SJustin Hibbits } t_FmPortParams; 2930aeed3e9SJustin Hibbits 2940aeed3e9SJustin Hibbits 2950aeed3e9SJustin Hibbits /**************************************************************************//** 2960aeed3e9SJustin Hibbits @Function FM_PORT_Config 2970aeed3e9SJustin Hibbits 298*852ba100SJustin Hibbits @Description Creates a descriptor for the FM PORT module. 2990aeed3e9SJustin Hibbits 3000aeed3e9SJustin Hibbits The routine returns a handle (descriptor) to the FM PORT object. 3010aeed3e9SJustin Hibbits This descriptor must be passed as first parameter to all other 3020aeed3e9SJustin Hibbits FM PORT function calls. 3030aeed3e9SJustin Hibbits 3040aeed3e9SJustin Hibbits No actual initialization or configuration of FM hardware is 3050aeed3e9SJustin Hibbits done by this routine. 3060aeed3e9SJustin Hibbits 3070aeed3e9SJustin Hibbits @Param[in] p_FmPortParams - Pointer to data structure of parameters 3080aeed3e9SJustin Hibbits 3090aeed3e9SJustin Hibbits @Retval Handle to FM object, or NULL for Failure. 3100aeed3e9SJustin Hibbits *//***************************************************************************/ 3110aeed3e9SJustin Hibbits t_Handle FM_PORT_Config(t_FmPortParams *p_FmPortParams); 3120aeed3e9SJustin Hibbits 3130aeed3e9SJustin Hibbits /**************************************************************************//** 3140aeed3e9SJustin Hibbits @Function FM_PORT_Init 3150aeed3e9SJustin Hibbits 316*852ba100SJustin Hibbits @Description Initializes the FM PORT module by defining the software structure 317*852ba100SJustin Hibbits and configuring the hardware registers. 3180aeed3e9SJustin Hibbits 3190aeed3e9SJustin Hibbits @Param[in] h_FmPort - FM PORT module descriptor 3200aeed3e9SJustin Hibbits 3210aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 3220aeed3e9SJustin Hibbits *//***************************************************************************/ 3230aeed3e9SJustin Hibbits t_Error FM_PORT_Init(t_Handle h_FmPort); 3240aeed3e9SJustin Hibbits 3250aeed3e9SJustin Hibbits /**************************************************************************//** 3260aeed3e9SJustin Hibbits @Function FM_PORT_Free 3270aeed3e9SJustin Hibbits 3280aeed3e9SJustin Hibbits @Description Frees all resources that were assigned to FM PORT module. 3290aeed3e9SJustin Hibbits 3300aeed3e9SJustin Hibbits Calling this routine invalidates the descriptor. 3310aeed3e9SJustin Hibbits 3320aeed3e9SJustin Hibbits @Param[in] h_FmPort - FM PORT module descriptor 3330aeed3e9SJustin Hibbits 3340aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 3350aeed3e9SJustin Hibbits *//***************************************************************************/ 3360aeed3e9SJustin Hibbits t_Error FM_PORT_Free(t_Handle h_FmPort); 3370aeed3e9SJustin Hibbits 3380aeed3e9SJustin Hibbits 3390aeed3e9SJustin Hibbits /**************************************************************************//** 3400aeed3e9SJustin Hibbits @Group FM_PORT_advanced_init_grp FM Port Advanced Configuration Unit 3410aeed3e9SJustin Hibbits 3420aeed3e9SJustin Hibbits @Description Configuration functions used to change default values. 3430aeed3e9SJustin Hibbits 3440aeed3e9SJustin Hibbits @{ 3450aeed3e9SJustin Hibbits *//***************************************************************************/ 3460aeed3e9SJustin Hibbits 3470aeed3e9SJustin Hibbits /**************************************************************************//** 3480aeed3e9SJustin Hibbits @Description enum for defining QM frame dequeue 3490aeed3e9SJustin Hibbits *//***************************************************************************/ 3500aeed3e9SJustin Hibbits typedef enum e_FmPortDeqType { 3510aeed3e9SJustin Hibbits e_FM_PORT_DEQ_TYPE1, /**< Dequeue from the SP channel - with priority precedence, 3520aeed3e9SJustin Hibbits and Intra-Class Scheduling respected. */ 3530aeed3e9SJustin Hibbits e_FM_PORT_DEQ_TYPE2, /**< Dequeue from the SP channel - with active FQ precedence, 3540aeed3e9SJustin Hibbits and Intra-Class Scheduling respected. */ 3550aeed3e9SJustin Hibbits e_FM_PORT_DEQ_TYPE3 /**< Dequeue from the SP channel - with active FQ precedence, 3560aeed3e9SJustin Hibbits and override Intra-Class Scheduling */ 3570aeed3e9SJustin Hibbits } e_FmPortDeqType; 3580aeed3e9SJustin Hibbits 3590aeed3e9SJustin Hibbits /**************************************************************************//** 3600aeed3e9SJustin Hibbits @Description enum for defining QM frame dequeue 3610aeed3e9SJustin Hibbits *//***************************************************************************/ 3620aeed3e9SJustin Hibbits typedef enum e_FmPortDeqPrefetchOption { 3630aeed3e9SJustin Hibbits e_FM_PORT_DEQ_NO_PREFETCH, /**< QMI preforms a dequeue action for a single frame 3640aeed3e9SJustin Hibbits only when a dedicated portID Tnum is waiting. */ 3650aeed3e9SJustin Hibbits e_FM_PORT_DEQ_PARTIAL_PREFETCH, /**< QMI preforms a dequeue action for 3 frames when 3660aeed3e9SJustin Hibbits one dedicated portId tnum is waiting. */ 3670aeed3e9SJustin Hibbits e_FM_PORT_DEQ_FULL_PREFETCH /**< QMI preforms a dequeue action for 3 frames when 3680aeed3e9SJustin Hibbits no dedicated portId tnums are waiting. */ 3690aeed3e9SJustin Hibbits 3700aeed3e9SJustin Hibbits } e_FmPortDeqPrefetchOption; 3710aeed3e9SJustin Hibbits 3720aeed3e9SJustin Hibbits /**************************************************************************//** 3730aeed3e9SJustin Hibbits @Description enum for defining port default color 3740aeed3e9SJustin Hibbits *//***************************************************************************/ 3750aeed3e9SJustin Hibbits typedef enum e_FmPortColor { 3760aeed3e9SJustin Hibbits e_FM_PORT_COLOR_GREEN, /**< Default port color is green */ 3770aeed3e9SJustin Hibbits e_FM_PORT_COLOR_YELLOW, /**< Default port color is yellow */ 3780aeed3e9SJustin Hibbits e_FM_PORT_COLOR_RED, /**< Default port color is red */ 3790aeed3e9SJustin Hibbits e_FM_PORT_COLOR_OVERRIDE /**< Ignore color */ 3800aeed3e9SJustin Hibbits } e_FmPortColor; 3810aeed3e9SJustin Hibbits 3820aeed3e9SJustin Hibbits /**************************************************************************//** 383*852ba100SJustin Hibbits @Description A structure for defining Dual Tx rate limiting scale 3840aeed3e9SJustin Hibbits *//***************************************************************************/ 3850aeed3e9SJustin Hibbits typedef enum e_FmPortDualRateLimiterScaleDown { 3860aeed3e9SJustin Hibbits e_FM_PORT_DUAL_RATE_LIMITER_NONE = 0, /**< Use only single rate limiter */ 3870aeed3e9SJustin Hibbits e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_2, /**< Divide high rate limiter by 2 */ 3880aeed3e9SJustin Hibbits e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_4, /**< Divide high rate limiter by 4 */ 3890aeed3e9SJustin Hibbits e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_8 /**< Divide high rate limiter by 8 */ 3900aeed3e9SJustin Hibbits } e_FmPortDualRateLimiterScaleDown; 3910aeed3e9SJustin Hibbits 3920aeed3e9SJustin Hibbits 3930aeed3e9SJustin Hibbits /**************************************************************************//** 394*852ba100SJustin Hibbits @Description A structure for defining FM port resources 3950aeed3e9SJustin Hibbits *//***************************************************************************/ 3960aeed3e9SJustin Hibbits typedef struct t_FmPortRsrc { 3970aeed3e9SJustin Hibbits uint32_t num; /**< Committed required resource */ 3980aeed3e9SJustin Hibbits uint32_t extra; /**< Extra (not committed) required resource */ 3990aeed3e9SJustin Hibbits } t_FmPortRsrc; 4000aeed3e9SJustin Hibbits 4010aeed3e9SJustin Hibbits /**************************************************************************//** 402*852ba100SJustin Hibbits @Description A structure for defining observed pool depletion 4030aeed3e9SJustin Hibbits *//***************************************************************************/ 4040aeed3e9SJustin Hibbits typedef struct t_FmPortObservedBufPoolDepletion { 405*852ba100SJustin Hibbits t_FmBufPoolDepletion poolDepletionParams;/**< parameters to define pool depletion */ 406*852ba100SJustin Hibbits t_FmExtPools poolsParams; /**< Which external buffer pools are observed 4070aeed3e9SJustin Hibbits (up to FM_PORT_MAX_NUM_OF_OBSERVED_EXT_POOLS), 4080aeed3e9SJustin Hibbits and their sizes. */ 4090aeed3e9SJustin Hibbits } t_FmPortObservedBufPoolDepletion; 4100aeed3e9SJustin Hibbits 4110aeed3e9SJustin Hibbits /**************************************************************************//** 412*852ba100SJustin Hibbits @Description A structure for defining Tx rate limiting 4130aeed3e9SJustin Hibbits *//***************************************************************************/ 4140aeed3e9SJustin Hibbits typedef struct t_FmPortRateLimit { 415*852ba100SJustin Hibbits uint16_t maxBurstSize; /**< in KBytes for Tx ports, in frames 416*852ba100SJustin Hibbits for OP ports. (note that 4170aeed3e9SJustin Hibbits for early chips burst size is 4180aeed3e9SJustin Hibbits rounded up to a multiply of 1000 frames).*/ 4190aeed3e9SJustin Hibbits uint32_t rateLimit; /**< in Kb/sec for Tx ports, in frame/sec for 420*852ba100SJustin Hibbits OP ports. Rate limit refers to 4210aeed3e9SJustin Hibbits data rate (rather than line rate). */ 422*852ba100SJustin Hibbits e_FmPortDualRateLimiterScaleDown rateLimitDivider; /**< For OP ports only. Not-valid 4230aeed3e9SJustin Hibbits for some earlier chip revisions */ 4240aeed3e9SJustin Hibbits } t_FmPortRateLimit; 4250aeed3e9SJustin Hibbits 4260aeed3e9SJustin Hibbits /**************************************************************************//** 427*852ba100SJustin Hibbits @Description A structure for defining the parameters of 4280aeed3e9SJustin Hibbits the Rx port performance counters 4290aeed3e9SJustin Hibbits *//***************************************************************************/ 4300aeed3e9SJustin Hibbits typedef struct t_FmPortPerformanceCnt { 4310aeed3e9SJustin Hibbits uint8_t taskCompVal; /**< Task compare value */ 4320aeed3e9SJustin Hibbits uint8_t queueCompVal; /**< Rx queue/Tx confirm queue compare 4330aeed3e9SJustin Hibbits value (unused for H/O) */ 4340aeed3e9SJustin Hibbits uint8_t dmaCompVal; /**< Dma compare value */ 4350aeed3e9SJustin Hibbits uint32_t fifoCompVal; /**< Fifo compare value (in bytes) */ 4360aeed3e9SJustin Hibbits } t_FmPortPerformanceCnt; 4370aeed3e9SJustin Hibbits 4380aeed3e9SJustin Hibbits 4390aeed3e9SJustin Hibbits /**************************************************************************//** 440*852ba100SJustin Hibbits @Description A structure for defining the sizes of the Deep Sleep 441*852ba100SJustin Hibbits the Auto Response tables 4420aeed3e9SJustin Hibbits *//***************************************************************************/ 443*852ba100SJustin Hibbits typedef struct t_FmPortDsarTablesSizes 444*852ba100SJustin Hibbits { 445*852ba100SJustin Hibbits uint16_t maxNumOfArpEntries; 446*852ba100SJustin Hibbits uint16_t maxNumOfEchoIpv4Entries; 447*852ba100SJustin Hibbits uint16_t maxNumOfNdpEntries; 448*852ba100SJustin Hibbits uint16_t maxNumOfEchoIpv6Entries; 449*852ba100SJustin Hibbits uint16_t maxNumOfSnmpIPV4Entries; 450*852ba100SJustin Hibbits uint16_t maxNumOfSnmpIPV6Entries; 451*852ba100SJustin Hibbits uint16_t maxNumOfSnmpOidEntries; 452*852ba100SJustin Hibbits uint16_t maxNumOfSnmpOidChar; /* total amount of character needed for the snmp table */ 4530aeed3e9SJustin Hibbits 454*852ba100SJustin Hibbits uint16_t maxNumOfIpProtFiltering; 455*852ba100SJustin Hibbits uint16_t maxNumOfTcpPortFiltering; 456*852ba100SJustin Hibbits uint16_t maxNumOfUdpPortFiltering; 457*852ba100SJustin Hibbits } t_FmPortDsarTablesSizes; 458*852ba100SJustin Hibbits 459*852ba100SJustin Hibbits 460*852ba100SJustin Hibbits /**************************************************************************//** 461*852ba100SJustin Hibbits @Function FM_PORT_ConfigDsarSupport 462*852ba100SJustin Hibbits 463*852ba100SJustin Hibbits @Description This function will allocate the amount of MURAM needed for 464*852ba100SJustin Hibbits this max number of entries for Deep Sleep Auto Response. 465*852ba100SJustin Hibbits it will calculate all needed MURAM for autoresponse including 466*852ba100SJustin Hibbits necesary common stuff. 467*852ba100SJustin Hibbits 468*852ba100SJustin Hibbits 469*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 470*852ba100SJustin Hibbits @Param[in] params A pointer to a structure containing the maximum 471*852ba100SJustin Hibbits sizes of the auto response tables 472*852ba100SJustin Hibbits 473*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 474*852ba100SJustin Hibbits 475*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 476*852ba100SJustin Hibbits *//***************************************************************************/ 477*852ba100SJustin Hibbits t_Error FM_PORT_ConfigDsarSupport(t_Handle h_FmPortRx, t_FmPortDsarTablesSizes *params); 478*852ba100SJustin Hibbits 479*852ba100SJustin Hibbits /**************************************************************************//** 480*852ba100SJustin Hibbits @Function FM_PORT_ConfigNumOfOpenDmas 481*852ba100SJustin Hibbits 482*852ba100SJustin Hibbits @Description Calling this routine changes the max number of open DMA's 483*852ba100SJustin Hibbits available for this port. It changes this parameter in the 484*852ba100SJustin Hibbits internal driver data base from its default configuration 485*852ba100SJustin Hibbits [OP: 1] 486*852ba100SJustin Hibbits [1G-RX, 1G-TX: 1 (+1)] 487*852ba100SJustin Hibbits [10G-RX, 10G-TX: 8 (+8)] 488*852ba100SJustin Hibbits 489*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 490*852ba100SJustin Hibbits @Param[in] p_OpenDmas A pointer to a structure of parameters defining 491*852ba100SJustin Hibbits the open DMA allocation. 492*852ba100SJustin Hibbits 493*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 494*852ba100SJustin Hibbits 495*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 496*852ba100SJustin Hibbits *//***************************************************************************/ 497*852ba100SJustin Hibbits t_Error FM_PORT_ConfigNumOfOpenDmas(t_Handle h_FmPort, t_FmPortRsrc *p_OpenDmas); 498*852ba100SJustin Hibbits 499*852ba100SJustin Hibbits /**************************************************************************//** 500*852ba100SJustin Hibbits @Function FM_PORT_ConfigNumOfTasks 501*852ba100SJustin Hibbits 502*852ba100SJustin Hibbits @Description Calling this routine changes the max number of tasks 503*852ba100SJustin Hibbits available for this port. It changes this parameter in the 504*852ba100SJustin Hibbits internal driver data base from its default configuration 505*852ba100SJustin Hibbits [OP: 1] 506*852ba100SJustin Hibbits [1G-RX, 1G-TX: 3 (+2)] 507*852ba100SJustin Hibbits [10G-RX, 10G-TX: 16 (+8)] 508*852ba100SJustin Hibbits 509*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 510*852ba100SJustin Hibbits @Param[in] p_NumOfTasks A pointer to a structure of parameters defining 511*852ba100SJustin Hibbits the tasks allocation. 512*852ba100SJustin Hibbits 513*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 514*852ba100SJustin Hibbits 515*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 516*852ba100SJustin Hibbits *//***************************************************************************/ 517*852ba100SJustin Hibbits t_Error FM_PORT_ConfigNumOfTasks(t_Handle h_FmPort, t_FmPortRsrc *p_NumOfTasks); 518*852ba100SJustin Hibbits 519*852ba100SJustin Hibbits /**************************************************************************//** 520*852ba100SJustin Hibbits @Function FM_PORT_ConfigSizeOfFifo 521*852ba100SJustin Hibbits 522*852ba100SJustin Hibbits @Description Calling this routine changes the max FIFO size configured for this port. 523*852ba100SJustin Hibbits 524*852ba100SJustin Hibbits This function changes the internal driver data base from its 525*852ba100SJustin Hibbits default configuration. Please refer to the driver's User Guide for 526*852ba100SJustin Hibbits information on default FIFO sizes in the various devices. 527*852ba100SJustin Hibbits [OP: 2KB] 528*852ba100SJustin Hibbits [1G-RX, 1G-TX: 11KB] 529*852ba100SJustin Hibbits [10G-RX, 10G-TX: 12KB] 530*852ba100SJustin Hibbits 531*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 532*852ba100SJustin Hibbits @Param[in] p_SizeOfFifo A pointer to a structure of parameters defining 533*852ba100SJustin Hibbits the FIFO allocation. 534*852ba100SJustin Hibbits 535*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 536*852ba100SJustin Hibbits 537*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 538*852ba100SJustin Hibbits *//***************************************************************************/ 539*852ba100SJustin Hibbits t_Error FM_PORT_ConfigSizeOfFifo(t_Handle h_FmPort, t_FmPortRsrc *p_SizeOfFifo); 5400aeed3e9SJustin Hibbits 5410aeed3e9SJustin Hibbits /**************************************************************************//** 5420aeed3e9SJustin Hibbits @Function FM_PORT_ConfigDeqHighPriority 5430aeed3e9SJustin Hibbits 5440aeed3e9SJustin Hibbits @Description Calling this routine changes the dequeue priority in the 5450aeed3e9SJustin Hibbits internal driver data base from its default configuration 546*852ba100SJustin Hibbits 1G: [DEFAULT_PORT_deqHighPriority_1G] 547*852ba100SJustin Hibbits 10G: [DEFAULT_PORT_deqHighPriority_10G] 5480aeed3e9SJustin Hibbits 5490aeed3e9SJustin Hibbits May be used for Non-Rx ports only 5500aeed3e9SJustin Hibbits 5510aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 5520aeed3e9SJustin Hibbits @Param[in] highPri TRUE to select high priority, FALSE for normal operation. 5530aeed3e9SJustin Hibbits 5540aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 5550aeed3e9SJustin Hibbits 5560aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 5570aeed3e9SJustin Hibbits *//***************************************************************************/ 5580aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigDeqHighPriority(t_Handle h_FmPort, bool highPri); 5590aeed3e9SJustin Hibbits 5600aeed3e9SJustin Hibbits /**************************************************************************//** 5610aeed3e9SJustin Hibbits @Function FM_PORT_ConfigDeqType 5620aeed3e9SJustin Hibbits 5630aeed3e9SJustin Hibbits @Description Calling this routine changes the dequeue type parameter in the 5640aeed3e9SJustin Hibbits internal driver data base from its default configuration 565*852ba100SJustin Hibbits [DEFAULT_PORT_deqType]. 5660aeed3e9SJustin Hibbits 5670aeed3e9SJustin Hibbits May be used for Non-Rx ports only 5680aeed3e9SJustin Hibbits 5690aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 5700aeed3e9SJustin Hibbits @Param[in] deqType According to QM definition. 5710aeed3e9SJustin Hibbits 5720aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 5730aeed3e9SJustin Hibbits 5740aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 5750aeed3e9SJustin Hibbits *//***************************************************************************/ 5760aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigDeqType(t_Handle h_FmPort, e_FmPortDeqType deqType); 5770aeed3e9SJustin Hibbits 5780aeed3e9SJustin Hibbits /**************************************************************************//** 5790aeed3e9SJustin Hibbits @Function FM_PORT_ConfigDeqPrefetchOption 5800aeed3e9SJustin Hibbits 5810aeed3e9SJustin Hibbits @Description Calling this routine changes the dequeue prefetch option parameter in the 5820aeed3e9SJustin Hibbits internal driver data base from its default configuration 583*852ba100SJustin Hibbits [DEFAULT_PORT_deqPrefetchOption] 5840aeed3e9SJustin Hibbits Note: Available for some chips only 5850aeed3e9SJustin Hibbits 5860aeed3e9SJustin Hibbits May be used for Non-Rx ports only 5870aeed3e9SJustin Hibbits 5880aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 5890aeed3e9SJustin Hibbits @Param[in] deqPrefetchOption New option 5900aeed3e9SJustin Hibbits 5910aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 5920aeed3e9SJustin Hibbits 5930aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 5940aeed3e9SJustin Hibbits *//***************************************************************************/ 5950aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigDeqPrefetchOption(t_Handle h_FmPort, e_FmPortDeqPrefetchOption deqPrefetchOption); 5960aeed3e9SJustin Hibbits 5970aeed3e9SJustin Hibbits /**************************************************************************//** 5980aeed3e9SJustin Hibbits @Function FM_PORT_ConfigDeqByteCnt 5990aeed3e9SJustin Hibbits 6000aeed3e9SJustin Hibbits @Description Calling this routine changes the dequeue byte count parameter in 601*852ba100SJustin Hibbits the internal driver data base from its default configuration 602*852ba100SJustin Hibbits 1G:[DEFAULT_PORT_deqByteCnt_1G]. 603*852ba100SJustin Hibbits 10G:[DEFAULT_PORT_deqByteCnt_10G]. 6040aeed3e9SJustin Hibbits 6050aeed3e9SJustin Hibbits May be used for Non-Rx ports only 6060aeed3e9SJustin Hibbits 6070aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 6080aeed3e9SJustin Hibbits @Param[in] deqByteCnt New byte count 6090aeed3e9SJustin Hibbits 6100aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 6110aeed3e9SJustin Hibbits 6120aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 6130aeed3e9SJustin Hibbits *//***************************************************************************/ 6140aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigDeqByteCnt(t_Handle h_FmPort, uint16_t deqByteCnt); 6150aeed3e9SJustin Hibbits 6160aeed3e9SJustin Hibbits /**************************************************************************//** 6170aeed3e9SJustin Hibbits @Function FM_PORT_ConfigBufferPrefixContent 6180aeed3e9SJustin Hibbits 6190aeed3e9SJustin Hibbits @Description Defines the structure, size and content of the application buffer. 6200aeed3e9SJustin Hibbits The prefix will 6210aeed3e9SJustin Hibbits In Tx ports, if 'passPrsResult', the application 6220aeed3e9SJustin Hibbits should set a value to their offsets in the prefix of 6230aeed3e9SJustin Hibbits the FM will save the first 'privDataSize', than, 6240aeed3e9SJustin Hibbits depending on 'passPrsResult' and 'passTimeStamp', copy parse result 6250aeed3e9SJustin Hibbits and timeStamp, and the packet itself (in this order), to the 6260aeed3e9SJustin Hibbits application buffer, and to offset. 6270aeed3e9SJustin Hibbits Calling this routine changes the buffer margins definitions 6280aeed3e9SJustin Hibbits in the internal driver data base from its default 629*852ba100SJustin Hibbits configuration: Data size: [DEFAULT_PORT_bufferPrefixContent_privDataSize] 630*852ba100SJustin Hibbits Pass Parser result: [DEFAULT_PORT_bufferPrefixContent_passPrsResult]. 631*852ba100SJustin Hibbits Pass timestamp: [DEFAULT_PORT_bufferPrefixContent_passTimeStamp]. 6320aeed3e9SJustin Hibbits 6330aeed3e9SJustin Hibbits May be used for all ports 6340aeed3e9SJustin Hibbits 6350aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 636*852ba100SJustin Hibbits @Param[in,out] p_FmBufferPrefixContent A structure of parameters describing the 6370aeed3e9SJustin Hibbits structure of the buffer. 6380aeed3e9SJustin Hibbits Out parameter: Start margin - offset 6390aeed3e9SJustin Hibbits of data from start of external buffer. 6400aeed3e9SJustin Hibbits 6410aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 6420aeed3e9SJustin Hibbits 6430aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 6440aeed3e9SJustin Hibbits *//***************************************************************************/ 645*852ba100SJustin Hibbits t_Error FM_PORT_ConfigBufferPrefixContent(t_Handle h_FmPort, 646*852ba100SJustin Hibbits t_FmBufferPrefixContent *p_FmBufferPrefixContent); 6470aeed3e9SJustin Hibbits 6480aeed3e9SJustin Hibbits /**************************************************************************//** 6490aeed3e9SJustin Hibbits @Function FM_PORT_ConfigCheksumLastBytesIgnore 6500aeed3e9SJustin Hibbits 6510aeed3e9SJustin Hibbits @Description Calling this routine changes the number of checksum bytes to ignore 6520aeed3e9SJustin Hibbits parameter in the internal driver data base from its default configuration 653*852ba100SJustin Hibbits [DEFAULT_PORT_cheksumLastBytesIgnore] 6540aeed3e9SJustin Hibbits 6550aeed3e9SJustin Hibbits May be used by Tx & Rx ports only 6560aeed3e9SJustin Hibbits 6570aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 6580aeed3e9SJustin Hibbits @Param[in] cheksumLastBytesIgnore New value 6590aeed3e9SJustin Hibbits 6600aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 6610aeed3e9SJustin Hibbits 6620aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 6630aeed3e9SJustin Hibbits *//***************************************************************************/ 6640aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigCheksumLastBytesIgnore(t_Handle h_FmPort, uint8_t cheksumLastBytesIgnore); 6650aeed3e9SJustin Hibbits 6660aeed3e9SJustin Hibbits /**************************************************************************//** 6670aeed3e9SJustin Hibbits @Function FM_PORT_ConfigCutBytesFromEnd 6680aeed3e9SJustin Hibbits 6690aeed3e9SJustin Hibbits @Description Calling this routine changes the number of bytes to cut from a 6700aeed3e9SJustin Hibbits frame's end parameter in the internal driver data base 671*852ba100SJustin Hibbits from its default configuration [DEFAULT_PORT_cutBytesFromEnd] 6720aeed3e9SJustin Hibbits Note that if the result of (frame length before chop - cutBytesFromEnd) is 6730aeed3e9SJustin Hibbits less than 14 bytes, the chop operation is not executed. 6740aeed3e9SJustin Hibbits 6750aeed3e9SJustin Hibbits May be used for Rx ports only 6760aeed3e9SJustin Hibbits 6770aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 6780aeed3e9SJustin Hibbits @Param[in] cutBytesFromEnd New value 6790aeed3e9SJustin Hibbits 6800aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 6810aeed3e9SJustin Hibbits 6820aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 6830aeed3e9SJustin Hibbits *//***************************************************************************/ 6840aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigCutBytesFromEnd(t_Handle h_FmPort, uint8_t cutBytesFromEnd); 6850aeed3e9SJustin Hibbits 6860aeed3e9SJustin Hibbits /**************************************************************************//** 6870aeed3e9SJustin Hibbits @Function FM_PORT_ConfigPoolDepletion 6880aeed3e9SJustin Hibbits 6890aeed3e9SJustin Hibbits @Description Calling this routine enables pause frame generation depending on the 6900aeed3e9SJustin Hibbits depletion status of BM pools. It also defines the conditions to activate 6910aeed3e9SJustin Hibbits this functionality. By default, this functionality is disabled. 6920aeed3e9SJustin Hibbits 6930aeed3e9SJustin Hibbits May be used for Rx ports only 6940aeed3e9SJustin Hibbits 6950aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 6960aeed3e9SJustin Hibbits @Param[in] p_BufPoolDepletion A structure of pool depletion parameters 6970aeed3e9SJustin Hibbits 6980aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 6990aeed3e9SJustin Hibbits 7000aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 7010aeed3e9SJustin Hibbits *//***************************************************************************/ 702*852ba100SJustin Hibbits t_Error FM_PORT_ConfigPoolDepletion(t_Handle h_FmPort, t_FmBufPoolDepletion *p_BufPoolDepletion); 7030aeed3e9SJustin Hibbits 7040aeed3e9SJustin Hibbits /**************************************************************************//** 7050aeed3e9SJustin Hibbits @Function FM_PORT_ConfigObservedPoolDepletion 7060aeed3e9SJustin Hibbits 7070aeed3e9SJustin Hibbits @Description Calling this routine enables a mechanism to stop port enqueue 7080aeed3e9SJustin Hibbits depending on the depletion status of selected BM pools. 7090aeed3e9SJustin Hibbits It also defines the conditions to activate 7100aeed3e9SJustin Hibbits this functionality. By default, this functionality is disabled. 7110aeed3e9SJustin Hibbits 7120aeed3e9SJustin Hibbits Note: Available for some chips only 7130aeed3e9SJustin Hibbits 714*852ba100SJustin Hibbits May be used for OP ports only 7150aeed3e9SJustin Hibbits 7160aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 7170aeed3e9SJustin Hibbits @Param[in] p_FmPortObservedBufPoolDepletion A structure of parameters for pool depletion. 7180aeed3e9SJustin Hibbits 7190aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 7200aeed3e9SJustin Hibbits 7210aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 7220aeed3e9SJustin Hibbits *//***************************************************************************/ 723*852ba100SJustin Hibbits t_Error FM_PORT_ConfigObservedPoolDepletion(t_Handle h_FmPort, 724*852ba100SJustin Hibbits t_FmPortObservedBufPoolDepletion *p_FmPortObservedBufPoolDepletion); 7250aeed3e9SJustin Hibbits 7260aeed3e9SJustin Hibbits /**************************************************************************//** 7270aeed3e9SJustin Hibbits @Function FM_PORT_ConfigExtBufPools 7280aeed3e9SJustin Hibbits 729*852ba100SJustin Hibbits @Description This routine should be called for OP ports 7300aeed3e9SJustin Hibbits that internally use BM buffer pools. In such cases, e.g. for fragmentation and 7310aeed3e9SJustin Hibbits re-assembly, the FM needs new BM buffers. By calling this routine the user 7320aeed3e9SJustin Hibbits specifies the BM buffer pools that should be used. 7330aeed3e9SJustin Hibbits 7340aeed3e9SJustin Hibbits Note: Available for some chips only 7350aeed3e9SJustin Hibbits 736*852ba100SJustin Hibbits May be used for OP ports only 7370aeed3e9SJustin Hibbits 7380aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 739*852ba100SJustin Hibbits @Param[in] p_FmExtPools A structure of parameters for the external pools. 7400aeed3e9SJustin Hibbits 7410aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 7420aeed3e9SJustin Hibbits 7430aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 7440aeed3e9SJustin Hibbits *//***************************************************************************/ 745*852ba100SJustin Hibbits t_Error FM_PORT_ConfigExtBufPools(t_Handle h_FmPort, t_FmExtPools *p_FmExtPools); 7460aeed3e9SJustin Hibbits 7470aeed3e9SJustin Hibbits /**************************************************************************//** 7480aeed3e9SJustin Hibbits @Function FM_PORT_ConfigBackupPools 7490aeed3e9SJustin Hibbits 7500aeed3e9SJustin Hibbits @Description Calling this routine allows the configuration of some of the BM pools 7510aeed3e9SJustin Hibbits defined for this port as backup pools. 7520aeed3e9SJustin Hibbits A pool configured to be a backup pool will be used only if all other 7530aeed3e9SJustin Hibbits enabled non-backup pools are depleted. 7540aeed3e9SJustin Hibbits 7550aeed3e9SJustin Hibbits May be used for Rx ports only 7560aeed3e9SJustin Hibbits 7570aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 7580aeed3e9SJustin Hibbits @Param[in] p_FmPortBackupBmPools An array of pool id's. All pools specified here will 7590aeed3e9SJustin Hibbits be defined as backup pools. 7600aeed3e9SJustin Hibbits 7610aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 7620aeed3e9SJustin Hibbits 7630aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 7640aeed3e9SJustin Hibbits *//***************************************************************************/ 765*852ba100SJustin Hibbits t_Error FM_PORT_ConfigBackupPools(t_Handle h_FmPort, t_FmBackupBmPools *p_FmPortBackupBmPools); 7660aeed3e9SJustin Hibbits 7670aeed3e9SJustin Hibbits /**************************************************************************//** 7680aeed3e9SJustin Hibbits @Function FM_PORT_ConfigFrmDiscardOverride 7690aeed3e9SJustin Hibbits 7700aeed3e9SJustin Hibbits @Description Calling this routine changes the error frames destination parameter 7710aeed3e9SJustin Hibbits in the internal driver data base from its default configuration: 772*852ba100SJustin Hibbits override = [DEFAULT_PORT_frmDiscardOverride] 7730aeed3e9SJustin Hibbits 774*852ba100SJustin Hibbits May be used for Rx and OP ports only 7750aeed3e9SJustin Hibbits 7760aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 777*852ba100SJustin Hibbits @Param[in] override TRUE to override discarding of error frames and 7780aeed3e9SJustin Hibbits enqueueing them to error queue. 7790aeed3e9SJustin Hibbits 7800aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 7810aeed3e9SJustin Hibbits 7820aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 7830aeed3e9SJustin Hibbits *//***************************************************************************/ 7840aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigFrmDiscardOverride(t_Handle h_FmPort, bool override); 7850aeed3e9SJustin Hibbits 7860aeed3e9SJustin Hibbits /**************************************************************************//** 7870aeed3e9SJustin Hibbits @Function FM_PORT_ConfigErrorsToDiscard 7880aeed3e9SJustin Hibbits 7890aeed3e9SJustin Hibbits @Description Calling this routine changes the behaviour on error parameter 7900aeed3e9SJustin Hibbits in the internal driver data base from its default configuration: 791*852ba100SJustin Hibbits [DEFAULT_PORT_errorsToDiscard]. 7920aeed3e9SJustin Hibbits If a requested error was previously defined as "ErrorsToEnqueue" it's 7930aeed3e9SJustin Hibbits definition will change and the frame will be discarded. 7940aeed3e9SJustin Hibbits Errors that were not defined either as "ErrorsToEnqueue" nor as 7950aeed3e9SJustin Hibbits "ErrorsToDiscard", will be forwarded to CPU. 7960aeed3e9SJustin Hibbits 797*852ba100SJustin Hibbits May be used for Rx and OP ports only 7980aeed3e9SJustin Hibbits 7990aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 8000aeed3e9SJustin Hibbits @Param[in] errs A list of errors to discard 8010aeed3e9SJustin Hibbits 8020aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 8030aeed3e9SJustin Hibbits 8040aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 8050aeed3e9SJustin Hibbits *//***************************************************************************/ 8060aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigErrorsToDiscard(t_Handle h_FmPort, fmPortFrameErrSelect_t errs); 8070aeed3e9SJustin Hibbits 8080aeed3e9SJustin Hibbits /**************************************************************************//** 8090aeed3e9SJustin Hibbits @Function FM_PORT_ConfigDmaSwapData 8100aeed3e9SJustin Hibbits 8110aeed3e9SJustin Hibbits @Description Calling this routine changes the DMA swap data aparameter 8120aeed3e9SJustin Hibbits in the internal driver data base from its default 813*852ba100SJustin Hibbits configuration [DEFAULT_PORT_dmaSwapData] 8140aeed3e9SJustin Hibbits 8150aeed3e9SJustin Hibbits May be used for all port types 8160aeed3e9SJustin Hibbits 8170aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 8180aeed3e9SJustin Hibbits @Param[in] swapData New selection 8190aeed3e9SJustin Hibbits 8200aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 8210aeed3e9SJustin Hibbits 8220aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 8230aeed3e9SJustin Hibbits *//***************************************************************************/ 824*852ba100SJustin Hibbits t_Error FM_PORT_ConfigDmaSwapData(t_Handle h_FmPort, e_FmDmaSwapOption swapData); 8250aeed3e9SJustin Hibbits 8260aeed3e9SJustin Hibbits /**************************************************************************//** 8270aeed3e9SJustin Hibbits @Function FM_PORT_ConfigDmaIcCacheAttr 8280aeed3e9SJustin Hibbits 8290aeed3e9SJustin Hibbits @Description Calling this routine changes the internal context cache 8300aeed3e9SJustin Hibbits attribute parameter in the internal driver data base 831*852ba100SJustin Hibbits from its default configuration [DEFAULT_PORT_dmaIntContextCacheAttr] 8320aeed3e9SJustin Hibbits 8330aeed3e9SJustin Hibbits May be used for all port types 8340aeed3e9SJustin Hibbits 8350aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 8360aeed3e9SJustin Hibbits @Param[in] intContextCacheAttr New selection 8370aeed3e9SJustin Hibbits 8380aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 8390aeed3e9SJustin Hibbits 8400aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 8410aeed3e9SJustin Hibbits *//***************************************************************************/ 842*852ba100SJustin Hibbits t_Error FM_PORT_ConfigDmaIcCacheAttr(t_Handle h_FmPort, e_FmDmaCacheOption intContextCacheAttr); 8430aeed3e9SJustin Hibbits 8440aeed3e9SJustin Hibbits /**************************************************************************//** 8450aeed3e9SJustin Hibbits @Function FM_PORT_ConfigDmaHdrAttr 8460aeed3e9SJustin Hibbits 8470aeed3e9SJustin Hibbits @Description Calling this routine changes the header cache 8480aeed3e9SJustin Hibbits attribute parameter in the internal driver data base 849*852ba100SJustin Hibbits from its default configuration [DEFAULT_PORT_dmaHeaderCacheAttr] 8500aeed3e9SJustin Hibbits 8510aeed3e9SJustin Hibbits May be used for all port types 8520aeed3e9SJustin Hibbits 8530aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 8540aeed3e9SJustin Hibbits @Param[in] headerCacheAttr New selection 8550aeed3e9SJustin Hibbits 8560aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 8570aeed3e9SJustin Hibbits 8580aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 8590aeed3e9SJustin Hibbits *//***************************************************************************/ 860*852ba100SJustin Hibbits t_Error FM_PORT_ConfigDmaHdrAttr(t_Handle h_FmPort, e_FmDmaCacheOption headerCacheAttr); 8610aeed3e9SJustin Hibbits 8620aeed3e9SJustin Hibbits /**************************************************************************//** 8630aeed3e9SJustin Hibbits @Function FM_PORT_ConfigDmaScatterGatherAttr 8640aeed3e9SJustin Hibbits 8650aeed3e9SJustin Hibbits @Description Calling this routine changes the scatter gather cache 8660aeed3e9SJustin Hibbits attribute parameter in the internal driver data base 867*852ba100SJustin Hibbits from its default configuration [DEFAULT_PORT_dmaScatterGatherCacheAttr] 8680aeed3e9SJustin Hibbits 8690aeed3e9SJustin Hibbits May be used for all port types 8700aeed3e9SJustin Hibbits 8710aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 8720aeed3e9SJustin Hibbits @Param[in] scatterGatherCacheAttr New selection 8730aeed3e9SJustin Hibbits 8740aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 8750aeed3e9SJustin Hibbits 8760aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 8770aeed3e9SJustin Hibbits *//***************************************************************************/ 878*852ba100SJustin Hibbits t_Error FM_PORT_ConfigDmaScatterGatherAttr(t_Handle h_FmPort, e_FmDmaCacheOption scatterGatherCacheAttr); 8790aeed3e9SJustin Hibbits 8800aeed3e9SJustin Hibbits /**************************************************************************//** 8810aeed3e9SJustin Hibbits @Function FM_PORT_ConfigDmaWriteOptimize 8820aeed3e9SJustin Hibbits 8830aeed3e9SJustin Hibbits @Description Calling this routine changes the write optimization 8840aeed3e9SJustin Hibbits parameter in the internal driver data base 885*852ba100SJustin Hibbits from its default configuration: By default optimize = [DEFAULT_PORT_dmaWriteOptimize]. 886*852ba100SJustin Hibbits Note: 8870aeed3e9SJustin Hibbits 888*852ba100SJustin Hibbits 1. For head optimization, data alignment must be >= 16 (supported by default). 889*852ba100SJustin Hibbits 890*852ba100SJustin Hibbits 3. For tail optimization, note that the optimization is performed by extending the write transaction 891*852ba100SJustin Hibbits of the frame payload at the tail as needed to achieve optimal bus transfers, so that the last write 892*852ba100SJustin Hibbits is extended to be on 16/64 bytes aligned block (chip dependent). 893*852ba100SJustin Hibbits 894*852ba100SJustin Hibbits Relevant for non-Tx port types 8950aeed3e9SJustin Hibbits 8960aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 8970aeed3e9SJustin Hibbits @Param[in] optimize TRUE to enable optimization, FALSE for normal operation 8980aeed3e9SJustin Hibbits 8990aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 9000aeed3e9SJustin Hibbits 9010aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 9020aeed3e9SJustin Hibbits *//***************************************************************************/ 9030aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigDmaWriteOptimize(t_Handle h_FmPort, bool optimize); 9040aeed3e9SJustin Hibbits 9050aeed3e9SJustin Hibbits /**************************************************************************//** 906*852ba100SJustin Hibbits @Function FM_PORT_ConfigNoScatherGather 907*852ba100SJustin Hibbits 908*852ba100SJustin Hibbits @Description Calling this routine changes the noScatherGather parameter in internal driver data base 909*852ba100SJustin Hibbits from its default configuration. 910*852ba100SJustin Hibbits 911*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 912*852ba100SJustin Hibbits @Param[in] noScatherGather (TRUE - frame is discarded if can not be stored in single buffer, 913*852ba100SJustin Hibbits FALSE - frame can be stored in scatter gather (S/G) format). 914*852ba100SJustin Hibbits 915*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 916*852ba100SJustin Hibbits 917*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 918*852ba100SJustin Hibbits *//***************************************************************************/ 919*852ba100SJustin Hibbits t_Error FM_PORT_ConfigNoScatherGather(t_Handle h_FmPort, bool noScatherGather); 920*852ba100SJustin Hibbits 921*852ba100SJustin Hibbits /**************************************************************************//** 9220aeed3e9SJustin Hibbits @Function FM_PORT_ConfigDfltColor 9230aeed3e9SJustin Hibbits 9240aeed3e9SJustin Hibbits @Description Calling this routine changes the internal default color parameter 9250aeed3e9SJustin Hibbits in the internal driver data base 926*852ba100SJustin Hibbits from its default configuration [DEFAULT_PORT_color] 9270aeed3e9SJustin Hibbits 9280aeed3e9SJustin Hibbits May be used for all port types 9290aeed3e9SJustin Hibbits 9300aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 9310aeed3e9SJustin Hibbits @Param[in] color New selection 9320aeed3e9SJustin Hibbits 9330aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 9340aeed3e9SJustin Hibbits 9350aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 9360aeed3e9SJustin Hibbits *//***************************************************************************/ 9370aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigDfltColor(t_Handle h_FmPort, e_FmPortColor color); 9380aeed3e9SJustin Hibbits 9390aeed3e9SJustin Hibbits /**************************************************************************//** 9400aeed3e9SJustin Hibbits @Function FM_PORT_ConfigSyncReq 9410aeed3e9SJustin Hibbits 9420aeed3e9SJustin Hibbits @Description Calling this routine changes the synchronization attribute parameter 9430aeed3e9SJustin Hibbits in the internal driver data base from its default configuration: 944*852ba100SJustin Hibbits syncReq = [DEFAULT_PORT_syncReq] 9450aeed3e9SJustin Hibbits 9460aeed3e9SJustin Hibbits May be used for all port types 9470aeed3e9SJustin Hibbits 9480aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 9490aeed3e9SJustin Hibbits @Param[in] syncReq TRUE to request synchronization, FALSE otherwize. 9500aeed3e9SJustin Hibbits 9510aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 9520aeed3e9SJustin Hibbits 9530aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 9540aeed3e9SJustin Hibbits *//***************************************************************************/ 9550aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigSyncReq(t_Handle h_FmPort, bool syncReq); 9560aeed3e9SJustin Hibbits 9570aeed3e9SJustin Hibbits /**************************************************************************//** 9580aeed3e9SJustin Hibbits @Function FM_PORT_ConfigForwardReuseIntContext 9590aeed3e9SJustin Hibbits 960*852ba100SJustin Hibbits @Description This routine is relevant for Rx ports that are routed to OP port. 961*852ba100SJustin Hibbits It changes the internal context reuse option in the internal 962*852ba100SJustin Hibbits driver data base from its default configuration: 963*852ba100SJustin Hibbits reuse = [DEFAULT_PORT_forwardIntContextReuse] 9640aeed3e9SJustin Hibbits 9650aeed3e9SJustin Hibbits May be used for Rx ports only 9660aeed3e9SJustin Hibbits 9670aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 9680aeed3e9SJustin Hibbits @Param[in] reuse TRUE to reuse internal context on frames 969*852ba100SJustin Hibbits forwarded to OP port. 9700aeed3e9SJustin Hibbits 9710aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 9720aeed3e9SJustin Hibbits 9730aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 9740aeed3e9SJustin Hibbits *//***************************************************************************/ 9750aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigForwardReuseIntContext(t_Handle h_FmPort, bool reuse); 9760aeed3e9SJustin Hibbits 9770aeed3e9SJustin Hibbits /**************************************************************************//** 9780aeed3e9SJustin Hibbits @Function FM_PORT_ConfigDontReleaseTxBufToBM 9790aeed3e9SJustin Hibbits 9800aeed3e9SJustin Hibbits @Description This routine should be called if no Tx confirmation 9810aeed3e9SJustin Hibbits is done, and yet buffers should not be released to the BM. 9820aeed3e9SJustin Hibbits Normally, buffers are returned using the Tx confirmation 9830aeed3e9SJustin Hibbits process. When Tx confirmation is not used (defFqid=0), 9840aeed3e9SJustin Hibbits buffers are typically released to the BM. This routine 9850aeed3e9SJustin Hibbits may be called to avoid this behavior and not release the 9860aeed3e9SJustin Hibbits buffers. 9870aeed3e9SJustin Hibbits 9880aeed3e9SJustin Hibbits May be used for Tx ports only 9890aeed3e9SJustin Hibbits 9900aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 9910aeed3e9SJustin Hibbits 9920aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 9930aeed3e9SJustin Hibbits 9940aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 9950aeed3e9SJustin Hibbits *//***************************************************************************/ 9960aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigDontReleaseTxBufToBM(t_Handle h_FmPort); 9970aeed3e9SJustin Hibbits 9980aeed3e9SJustin Hibbits /**************************************************************************//** 9990aeed3e9SJustin Hibbits @Function FM_PORT_ConfigIMMaxRxBufLength 10000aeed3e9SJustin Hibbits 10010aeed3e9SJustin Hibbits @Description Changes the maximum receive buffer length from its default 10020aeed3e9SJustin Hibbits configuration: Closest rounded down power of 2 value of the 10030aeed3e9SJustin Hibbits data buffer size. 10040aeed3e9SJustin Hibbits 10050aeed3e9SJustin Hibbits The maximum receive buffer length directly affects the structure 10060aeed3e9SJustin Hibbits of received frames (single- or multi-buffered) and the performance 10070aeed3e9SJustin Hibbits of both the FM and the driver. 10080aeed3e9SJustin Hibbits 10090aeed3e9SJustin Hibbits The selection between single- or multi-buffered frames should be 10100aeed3e9SJustin Hibbits done according to the characteristics of the specific application. 10110aeed3e9SJustin Hibbits The recommended mode is to use a single data buffer per packet, 10120aeed3e9SJustin Hibbits as this mode provides the best performance. However, the user can 10130aeed3e9SJustin Hibbits select to use multiple data buffers per packet. 10140aeed3e9SJustin Hibbits 10150aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 10160aeed3e9SJustin Hibbits @Param[in] newVal Maximum receive buffer length (in bytes). 10170aeed3e9SJustin Hibbits 10180aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 10190aeed3e9SJustin Hibbits 10200aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 10210aeed3e9SJustin Hibbits This routine is to be used only if Independent-Mode is enabled. 10220aeed3e9SJustin Hibbits *//***************************************************************************/ 10230aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigIMMaxRxBufLength(t_Handle h_FmPort, uint16_t newVal); 10240aeed3e9SJustin Hibbits 10250aeed3e9SJustin Hibbits /**************************************************************************//** 10260aeed3e9SJustin Hibbits @Function FM_PORT_ConfigIMRxBdRingLength 10270aeed3e9SJustin Hibbits 10280aeed3e9SJustin Hibbits @Description Changes the receive BD ring length from its default 1029*852ba100SJustin Hibbits configuration:[DEFAULT_PORT_rxBdRingLength] 10300aeed3e9SJustin Hibbits 10310aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 10320aeed3e9SJustin Hibbits @Param[in] newVal The desired BD ring length. 10330aeed3e9SJustin Hibbits 10340aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 10350aeed3e9SJustin Hibbits 10360aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 10370aeed3e9SJustin Hibbits This routine is to be used only if Independent-Mode is enabled. 10380aeed3e9SJustin Hibbits *//***************************************************************************/ 10390aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigIMRxBdRingLength(t_Handle h_FmPort, uint16_t newVal); 10400aeed3e9SJustin Hibbits 10410aeed3e9SJustin Hibbits /**************************************************************************//** 10420aeed3e9SJustin Hibbits @Function FM_PORT_ConfigIMTxBdRingLength 10430aeed3e9SJustin Hibbits 10440aeed3e9SJustin Hibbits @Description Changes the transmit BD ring length from its default 1045*852ba100SJustin Hibbits configuration:[DEFAULT_PORT_txBdRingLength] 10460aeed3e9SJustin Hibbits 10470aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 10480aeed3e9SJustin Hibbits @Param[in] newVal The desired BD ring length. 10490aeed3e9SJustin Hibbits 10500aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 10510aeed3e9SJustin Hibbits 10520aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 10530aeed3e9SJustin Hibbits This routine is to be used only if Independent-Mode is enabled. 10540aeed3e9SJustin Hibbits *//***************************************************************************/ 10550aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigIMTxBdRingLength(t_Handle h_FmPort, uint16_t newVal); 10560aeed3e9SJustin Hibbits 10570aeed3e9SJustin Hibbits /**************************************************************************//** 10580aeed3e9SJustin Hibbits @Function FM_PORT_ConfigIMFmanCtrlExternalStructsMemory 10590aeed3e9SJustin Hibbits 10600aeed3e9SJustin Hibbits @Description Configures memory partition and attributes for FMan-Controller 10610aeed3e9SJustin Hibbits data structures (e.g. BD rings). 10620aeed3e9SJustin Hibbits Calling this routine changes the internal driver data base 10630aeed3e9SJustin Hibbits from its default configuration 1064*852ba100SJustin Hibbits [DEFAULT_PORT_ImfwExtStructsMemId, DEFAULT_PORT_ImfwExtStructsMemAttr]. 10650aeed3e9SJustin Hibbits 10660aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 10670aeed3e9SJustin Hibbits @Param[in] memId Memory partition ID. 10680aeed3e9SJustin Hibbits @Param[in] memAttributes Memory attributes mask (a combination of MEMORY_ATTR_x flags). 10690aeed3e9SJustin Hibbits 10700aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 10710aeed3e9SJustin Hibbits *//***************************************************************************/ 10720aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigIMFmanCtrlExternalStructsMemory(t_Handle h_FmPort, 10730aeed3e9SJustin Hibbits uint8_t memId, 10740aeed3e9SJustin Hibbits uint32_t memAttributes); 10750aeed3e9SJustin Hibbits 10760aeed3e9SJustin Hibbits /**************************************************************************//** 10770aeed3e9SJustin Hibbits @Function FM_PORT_ConfigIMPolling 10780aeed3e9SJustin Hibbits 10790aeed3e9SJustin Hibbits @Description Changes the Rx flow from interrupt driven (default) to polling. 10800aeed3e9SJustin Hibbits 10810aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 10820aeed3e9SJustin Hibbits 10830aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 10840aeed3e9SJustin Hibbits 10850aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 10860aeed3e9SJustin Hibbits This routine is to be used only if Independent-Mode is enabled. 10870aeed3e9SJustin Hibbits *//***************************************************************************/ 10880aeed3e9SJustin Hibbits t_Error FM_PORT_ConfigIMPolling(t_Handle h_FmPort); 10890aeed3e9SJustin Hibbits 1090*852ba100SJustin Hibbits /**************************************************************************//** 1091*852ba100SJustin Hibbits @Function FM_PORT_ConfigMaxFrameLength 1092*852ba100SJustin Hibbits 1093*852ba100SJustin Hibbits @Description Changes the definition of the max size of frame that should be 1094*852ba100SJustin Hibbits transmitted/received on this port from its default value [DEFAULT_PORT_maxFrameLength]. 1095*852ba100SJustin Hibbits This parameter is used for confirmation of the minimum Fifo 1096*852ba100SJustin Hibbits size calculations and only for Tx ports or ports working in 1097*852ba100SJustin Hibbits independent mode. This should be larger than the maximum possible 1098*852ba100SJustin Hibbits MTU that will be used for this port (i.e. its MAC). 1099*852ba100SJustin Hibbits 1100*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 1101*852ba100SJustin Hibbits @Param[in] length Max size of frame 1102*852ba100SJustin Hibbits 1103*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1104*852ba100SJustin Hibbits 1105*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 1106*852ba100SJustin Hibbits This routine is to be used only if Independent-Mode is enabled. 1107*852ba100SJustin Hibbits *//***************************************************************************/ 1108*852ba100SJustin Hibbits t_Error FM_PORT_ConfigMaxFrameLength(t_Handle h_FmPort, uint16_t length); 1109*852ba100SJustin Hibbits 1110*852ba100SJustin Hibbits /**************************************************************************//* 1111*852ba100SJustin Hibbits @Function FM_PORT_ConfigTxFifoMinFillLevel 1112*852ba100SJustin Hibbits 1113*852ba100SJustin Hibbits @Description Calling this routine changes the fifo minimum 1114*852ba100SJustin Hibbits fill level parameter in the internal driver data base 1115*852ba100SJustin Hibbits from its default configuration [DEFAULT_PORT_txFifoMinFillLevel] 1116*852ba100SJustin Hibbits 1117*852ba100SJustin Hibbits May be used for Tx ports only 1118*852ba100SJustin Hibbits 1119*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 1120*852ba100SJustin Hibbits @Param[in] minFillLevel New value 1121*852ba100SJustin Hibbits 1122*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1123*852ba100SJustin Hibbits 1124*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 1125*852ba100SJustin Hibbits *//***************************************************************************/ 1126*852ba100SJustin Hibbits t_Error FM_PORT_ConfigTxFifoMinFillLevel(t_Handle h_FmPort, uint32_t minFillLevel); 1127*852ba100SJustin Hibbits 1128*852ba100SJustin Hibbits /**************************************************************************//* 1129*852ba100SJustin Hibbits @Function FM_PORT_ConfigFifoDeqPipelineDepth 1130*852ba100SJustin Hibbits 1131*852ba100SJustin Hibbits @Description Calling this routine changes the fifo dequeue 1132*852ba100SJustin Hibbits pipeline depth parameter in the internal driver data base 1133*852ba100SJustin Hibbits 1134*852ba100SJustin Hibbits from its default configuration: 1G ports: [DEFAULT_PORT_fifoDeqPipelineDepth_1G], 1135*852ba100SJustin Hibbits 10G port: [DEFAULT_PORT_fifoDeqPipelineDepth_10G], 1136*852ba100SJustin Hibbits OP port: [DEFAULT_PORT_fifoDeqPipelineDepth_OH] 1137*852ba100SJustin Hibbits 1138*852ba100SJustin Hibbits May be used for Tx/OP ports only 1139*852ba100SJustin Hibbits 1140*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 1141*852ba100SJustin Hibbits @Param[in] deqPipelineDepth New value 1142*852ba100SJustin Hibbits 1143*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1144*852ba100SJustin Hibbits 1145*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 1146*852ba100SJustin Hibbits *//***************************************************************************/ 1147*852ba100SJustin Hibbits t_Error FM_PORT_ConfigFifoDeqPipelineDepth(t_Handle h_FmPort, uint8_t deqPipelineDepth); 1148*852ba100SJustin Hibbits 1149*852ba100SJustin Hibbits /**************************************************************************//* 1150*852ba100SJustin Hibbits @Function FM_PORT_ConfigTxFifoLowComfLevel 1151*852ba100SJustin Hibbits 1152*852ba100SJustin Hibbits @Description Calling this routine changes the fifo low comfort level 1153*852ba100SJustin Hibbits parameter in internal driver data base 1154*852ba100SJustin Hibbits from its default configuration [DEFAULT_PORT_txFifoLowComfLevel] 1155*852ba100SJustin Hibbits 1156*852ba100SJustin Hibbits May be used for Tx ports only 1157*852ba100SJustin Hibbits 1158*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 1159*852ba100SJustin Hibbits @Param[in] fifoLowComfLevel New value 1160*852ba100SJustin Hibbits 1161*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1162*852ba100SJustin Hibbits 1163*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 1164*852ba100SJustin Hibbits *//***************************************************************************/ 1165*852ba100SJustin Hibbits t_Error FM_PORT_ConfigTxFifoLowComfLevel(t_Handle h_FmPort, uint32_t fifoLowComfLevel); 1166*852ba100SJustin Hibbits 1167*852ba100SJustin Hibbits /**************************************************************************//* 1168*852ba100SJustin Hibbits @Function FM_PORT_ConfigRxFifoThreshold 1169*852ba100SJustin Hibbits 1170*852ba100SJustin Hibbits @Description Calling this routine changes the threshold of the FIFO 1171*852ba100SJustin Hibbits fill level parameter in the internal driver data base 1172*852ba100SJustin Hibbits from its default configuration [DEFAULT_PORT_rxFifoThreshold] 1173*852ba100SJustin Hibbits 1174*852ba100SJustin Hibbits If the total number of buffers which are 1175*852ba100SJustin Hibbits currently in use and associated with the 1176*852ba100SJustin Hibbits specific RX port exceed this threshold, the 1177*852ba100SJustin Hibbits BMI will signal the MAC to send a pause frame 1178*852ba100SJustin Hibbits over the link. 1179*852ba100SJustin Hibbits 1180*852ba100SJustin Hibbits May be used for Rx ports only 1181*852ba100SJustin Hibbits 1182*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 1183*852ba100SJustin Hibbits @Param[in] fifoThreshold New value 1184*852ba100SJustin Hibbits 1185*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1186*852ba100SJustin Hibbits 1187*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 1188*852ba100SJustin Hibbits *//***************************************************************************/ 1189*852ba100SJustin Hibbits t_Error FM_PORT_ConfigRxFifoThreshold(t_Handle h_FmPort, uint32_t fifoThreshold); 1190*852ba100SJustin Hibbits 1191*852ba100SJustin Hibbits /**************************************************************************//* 1192*852ba100SJustin Hibbits @Function FM_PORT_ConfigRxFifoPriElevationLevel 1193*852ba100SJustin Hibbits 1194*852ba100SJustin Hibbits @Description Calling this routine changes the priority elevation level 1195*852ba100SJustin Hibbits parameter in the internal driver data base from its default 1196*852ba100SJustin Hibbits configuration [DEFAULT_PORT_rxFifoPriElevationLevel] 1197*852ba100SJustin Hibbits 1198*852ba100SJustin Hibbits If the total number of buffers which are currently in use and 1199*852ba100SJustin Hibbits associated with the specific RX port exceed the amount specified 1200*852ba100SJustin Hibbits in priElevationLevel, BMI will signal the main FM's DMA to 1201*852ba100SJustin Hibbits elevate the FM priority on the system bus. 1202*852ba100SJustin Hibbits 1203*852ba100SJustin Hibbits May be used for Rx ports only 1204*852ba100SJustin Hibbits 1205*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 1206*852ba100SJustin Hibbits @Param[in] priElevationLevel New value 1207*852ba100SJustin Hibbits 1208*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1209*852ba100SJustin Hibbits 1210*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 1211*852ba100SJustin Hibbits *//***************************************************************************/ 1212*852ba100SJustin Hibbits t_Error FM_PORT_ConfigRxFifoPriElevationLevel(t_Handle h_FmPort, uint32_t priElevationLevel); 1213*852ba100SJustin Hibbits 1214*852ba100SJustin Hibbits #ifdef FM_HEAVY_TRAFFIC_HANG_ERRATA_FMAN_A005669 1215*852ba100SJustin Hibbits /**************************************************************************//* 1216*852ba100SJustin Hibbits @Function FM_PORT_ConfigBCBWorkaround 1217*852ba100SJustin Hibbits 1218*852ba100SJustin Hibbits @Description Configures BCB errata workaround. 1219*852ba100SJustin Hibbits 1220*852ba100SJustin Hibbits When BCB errata is applicable, the workaround is always 1221*852ba100SJustin Hibbits performed by FM Controller. Thus, this functions doesn't 1222*852ba100SJustin Hibbits actually enable errata workaround but rather allows driver 1223*852ba100SJustin Hibbits to perform adjustments required due to errata workaround 1224*852ba100SJustin Hibbits execution in FM controller. 1225*852ba100SJustin Hibbits 1226*852ba100SJustin Hibbits Applying BCB workaround also configures FM_PORT_FRM_ERR_PHYSICAL 1227*852ba100SJustin Hibbits errors to be discarded. Thus FM_PORT_FRM_ERR_PHYSICAL can't be 1228*852ba100SJustin Hibbits set by FM_PORT_SetErrorsRoute() function. 1229*852ba100SJustin Hibbits 1230*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 1231*852ba100SJustin Hibbits 1232*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1233*852ba100SJustin Hibbits 1234*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 1235*852ba100SJustin Hibbits *//***************************************************************************/ 1236*852ba100SJustin Hibbits t_Error FM_PORT_ConfigBCBWorkaround(t_Handle h_FmPort); 1237*852ba100SJustin Hibbits #endif /* FM_HEAVY_TRAFFIC_HANG_ERRATA_FMAN_A005669 */ 1238*852ba100SJustin Hibbits 1239*852ba100SJustin Hibbits #if (DPAA_VERSION >= 11) 1240*852ba100SJustin Hibbits /**************************************************************************//* 1241*852ba100SJustin Hibbits @Function FM_PORT_ConfigInternalBuffOffset 1242*852ba100SJustin Hibbits 1243*852ba100SJustin Hibbits @Description Configures internal buffer offset. 1244*852ba100SJustin Hibbits 1245*852ba100SJustin Hibbits May be used for Rx and OP ports only 1246*852ba100SJustin Hibbits 1247*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 1248*852ba100SJustin Hibbits @Param[in] val New value 1249*852ba100SJustin Hibbits 1250*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1251*852ba100SJustin Hibbits 1252*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 1253*852ba100SJustin Hibbits *//***************************************************************************/ 1254*852ba100SJustin Hibbits t_Error FM_PORT_ConfigInternalBuffOffset(t_Handle h_FmPort, uint8_t val); 1255*852ba100SJustin Hibbits #endif /* (DPAA_VERSION >= 11) */ 1256*852ba100SJustin Hibbits 12570aeed3e9SJustin Hibbits /** @} */ /* end of FM_PORT_advanced_init_grp group */ 12580aeed3e9SJustin Hibbits /** @} */ /* end of FM_PORT_init_grp group */ 12590aeed3e9SJustin Hibbits 12600aeed3e9SJustin Hibbits 12610aeed3e9SJustin Hibbits /**************************************************************************//** 12620aeed3e9SJustin Hibbits @Group FM_PORT_runtime_control_grp FM Port Runtime Control Unit 12630aeed3e9SJustin Hibbits 12640aeed3e9SJustin Hibbits @Description FM Port Runtime control unit API functions, definitions and enums. 12650aeed3e9SJustin Hibbits 12660aeed3e9SJustin Hibbits @{ 12670aeed3e9SJustin Hibbits *//***************************************************************************/ 12680aeed3e9SJustin Hibbits 12690aeed3e9SJustin Hibbits /**************************************************************************//** 12700aeed3e9SJustin Hibbits @Description enum for defining FM Port counters 12710aeed3e9SJustin Hibbits *//***************************************************************************/ 12720aeed3e9SJustin Hibbits typedef enum e_FmPortCounters { 12730aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_CYCLE, /**< BMI performance counter */ 12740aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_TASK_UTIL, /**< BMI performance counter */ 12750aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_QUEUE_UTIL, /**< BMI performance counter */ 12760aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_DMA_UTIL, /**< BMI performance counter */ 12770aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_FIFO_UTIL, /**< BMI performance counter */ 12780aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_RX_PAUSE_ACTIVATION, /**< BMI Rx only performance counter */ 12790aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_FRAME, /**< BMI statistics counter */ 12800aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_DISCARD_FRAME, /**< BMI statistics counter */ 12810aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_DEALLOC_BUF, /**< BMI deallocate buffer statistics counter */ 12820aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_RX_BAD_FRAME, /**< BMI Rx only statistics counter */ 12830aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_RX_LARGE_FRAME, /**< BMI Rx only statistics counter */ 12840aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_RX_FILTER_FRAME, /**< BMI Rx & OP only statistics counter */ 12850aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_RX_LIST_DMA_ERR, /**< BMI Rx, OP & HC only statistics counter */ 1286*852ba100SJustin Hibbits e_FM_PORT_COUNTERS_RX_OUT_OF_BUFFERS_DISCARD, /**< BMI Rx, OP & HC statistics counter */ 1287*852ba100SJustin Hibbits e_FM_PORT_COUNTERS_PREPARE_TO_ENQUEUE_COUNTER, /**< BMI Rx, OP & HC only statistics counter */ 12880aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_WRED_DISCARD, /**< BMI OP & HC only statistics counter */ 12890aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_LENGTH_ERR, /**< BMI non-Rx statistics counter */ 12900aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_UNSUPPRTED_FORMAT, /**< BMI non-Rx statistics counter */ 1291*852ba100SJustin Hibbits e_FM_PORT_COUNTERS_DEQ_TOTAL, /**< QMI total QM dequeues counter */ 1292*852ba100SJustin Hibbits e_FM_PORT_COUNTERS_ENQ_TOTAL, /**< QMI total QM enqueues counter */ 12930aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_DEQ_FROM_DEFAULT, /**< QMI counter */ 12940aeed3e9SJustin Hibbits e_FM_PORT_COUNTERS_DEQ_CONFIRM /**< QMI counter */ 12950aeed3e9SJustin Hibbits } e_FmPortCounters; 12960aeed3e9SJustin Hibbits 1297*852ba100SJustin Hibbits typedef struct t_FmPortBmiStats { 1298*852ba100SJustin Hibbits uint32_t cntCycle; 1299*852ba100SJustin Hibbits uint32_t cntTaskUtil; 1300*852ba100SJustin Hibbits uint32_t cntQueueUtil; 1301*852ba100SJustin Hibbits uint32_t cntDmaUtil; 1302*852ba100SJustin Hibbits uint32_t cntFifoUtil; 1303*852ba100SJustin Hibbits uint32_t cntRxPauseActivation; 1304*852ba100SJustin Hibbits uint32_t cntFrame; 1305*852ba100SJustin Hibbits uint32_t cntDiscardFrame; 1306*852ba100SJustin Hibbits uint32_t cntDeallocBuf; 1307*852ba100SJustin Hibbits uint32_t cntRxBadFrame; 1308*852ba100SJustin Hibbits uint32_t cntRxLargeFrame; 1309*852ba100SJustin Hibbits uint32_t cntRxFilterFrame; 1310*852ba100SJustin Hibbits uint32_t cntRxListDmaErr; 1311*852ba100SJustin Hibbits uint32_t cntRxOutOfBuffersDiscard; 1312*852ba100SJustin Hibbits uint32_t cntWredDiscard; 1313*852ba100SJustin Hibbits uint32_t cntLengthErr; 1314*852ba100SJustin Hibbits uint32_t cntUnsupportedFormat; 1315*852ba100SJustin Hibbits } t_FmPortBmiStats; 1316*852ba100SJustin Hibbits 13170aeed3e9SJustin Hibbits /**************************************************************************//** 13180aeed3e9SJustin Hibbits @Description Structure for Port id parameters. 13190aeed3e9SJustin Hibbits Fields commented 'IN' are passed by the port module to be used 13200aeed3e9SJustin Hibbits by the FM module. 13210aeed3e9SJustin Hibbits Fields commented 'OUT' will be filled by FM before returning to port. 13220aeed3e9SJustin Hibbits *//***************************************************************************/ 13230aeed3e9SJustin Hibbits typedef struct t_FmPortCongestionGrps { 1324*852ba100SJustin Hibbits uint16_t numOfCongestionGrpsToConsider; /**< The number of required CGs 13250aeed3e9SJustin Hibbits to define the size of the following array */ 13260aeed3e9SJustin Hibbits uint8_t congestionGrpsToConsider[FM_PORT_NUM_OF_CONGESTION_GRPS]; 1327*852ba100SJustin Hibbits /**< An array of CG indexes; 1328*852ba100SJustin Hibbits Note that the size of the array should be 1329*852ba100SJustin Hibbits 'numOfCongestionGrpsToConsider'. */ 1330*852ba100SJustin Hibbits #if (DPAA_VERSION >= 11) 1331*852ba100SJustin Hibbits bool pfcPrioritiesEn[FM_PORT_NUM_OF_CONGESTION_GRPS][FM_MAX_NUM_OF_PFC_PRIORITIES]; 1332*852ba100SJustin Hibbits /**< a matrix that represents the map between the CG ids 1333*852ba100SJustin Hibbits defined in 'congestionGrpsToConsider' to the priorties 1334*852ba100SJustin Hibbits mapping array. */ 1335*852ba100SJustin Hibbits #endif /* (DPAA_VERSION >= 11) */ 13360aeed3e9SJustin Hibbits } t_FmPortCongestionGrps; 13370aeed3e9SJustin Hibbits 1338*852ba100SJustin Hibbits /**************************************************************************//** 1339*852ba100SJustin Hibbits @Description Structure for Deep Sleep Auto Response ARP Entry 1340*852ba100SJustin Hibbits *//***************************************************************************/ 1341*852ba100SJustin Hibbits typedef struct t_FmPortDsarArpEntry 1342*852ba100SJustin Hibbits { 1343*852ba100SJustin Hibbits uint32_t ipAddress; 1344*852ba100SJustin Hibbits uint8_t mac[6]; 1345*852ba100SJustin Hibbits bool isVlan; 1346*852ba100SJustin Hibbits uint16_t vid; 1347*852ba100SJustin Hibbits } t_FmPortDsarArpEntry; 13480aeed3e9SJustin Hibbits 1349*852ba100SJustin Hibbits /**************************************************************************//** 1350*852ba100SJustin Hibbits @Description Structure for Deep Sleep Auto Response ARP info 1351*852ba100SJustin Hibbits *//***************************************************************************/ 1352*852ba100SJustin Hibbits typedef struct t_FmPortDsarArpInfo 1353*852ba100SJustin Hibbits { 1354*852ba100SJustin Hibbits uint8_t tableSize; 1355*852ba100SJustin Hibbits t_FmPortDsarArpEntry *p_AutoResTable; 1356*852ba100SJustin Hibbits bool enableConflictDetection; /* when TRUE Conflict Detection will be checked and wake the host if needed */ 1357*852ba100SJustin Hibbits } t_FmPortDsarArpInfo; 1358*852ba100SJustin Hibbits 1359*852ba100SJustin Hibbits /**************************************************************************//** 1360*852ba100SJustin Hibbits @Description Structure for Deep Sleep Auto Response NDP Entry 1361*852ba100SJustin Hibbits *//***************************************************************************/ 1362*852ba100SJustin Hibbits typedef struct t_FmPortDsarNdpEntry 1363*852ba100SJustin Hibbits { 1364*852ba100SJustin Hibbits uint32_t ipAddress[4]; 1365*852ba100SJustin Hibbits uint8_t mac[6]; 1366*852ba100SJustin Hibbits bool isVlan; 1367*852ba100SJustin Hibbits uint16_t vid; 1368*852ba100SJustin Hibbits } t_FmPortDsarNdpEntry; 1369*852ba100SJustin Hibbits 1370*852ba100SJustin Hibbits /**************************************************************************//** 1371*852ba100SJustin Hibbits @Description Structure for Deep Sleep Auto Response NDP info 1372*852ba100SJustin Hibbits *//***************************************************************************/ 1373*852ba100SJustin Hibbits typedef struct t_FmPortDsarNdpInfo 1374*852ba100SJustin Hibbits { 1375*852ba100SJustin Hibbits uint32_t multicastGroup; 1376*852ba100SJustin Hibbits 1377*852ba100SJustin Hibbits uint8_t tableSizeAssigned; 1378*852ba100SJustin Hibbits t_FmPortDsarNdpEntry *p_AutoResTableAssigned; /* This list refer to solicitation IP addresses. 1379*852ba100SJustin Hibbits Note that all IP adresses must be from the same multicast group. 1380*852ba100SJustin Hibbits This will be checked and if not operation will fail. */ 1381*852ba100SJustin Hibbits uint8_t tableSizeTmp; 1382*852ba100SJustin Hibbits t_FmPortDsarNdpEntry *p_AutoResTableTmp; /* This list refer to temp IP addresses. 1383*852ba100SJustin Hibbits Note that all temp IP adresses must be from the same multicast group. 1384*852ba100SJustin Hibbits This will be checked and if not operation will fail. */ 1385*852ba100SJustin Hibbits 1386*852ba100SJustin Hibbits bool enableConflictDetection; /* when TRUE Conflict Detection will be checked and wake the host if needed */ 1387*852ba100SJustin Hibbits 1388*852ba100SJustin Hibbits } t_FmPortDsarNdpInfo; 1389*852ba100SJustin Hibbits 1390*852ba100SJustin Hibbits /**************************************************************************//** 1391*852ba100SJustin Hibbits @Description Structure for Deep Sleep Auto Response ICMPV4 info 1392*852ba100SJustin Hibbits *//***************************************************************************/ 1393*852ba100SJustin Hibbits typedef struct t_FmPortDsarEchoIpv4Info 1394*852ba100SJustin Hibbits { 1395*852ba100SJustin Hibbits uint8_t tableSize; 1396*852ba100SJustin Hibbits t_FmPortDsarArpEntry *p_AutoResTable; 1397*852ba100SJustin Hibbits } t_FmPortDsarEchoIpv4Info; 1398*852ba100SJustin Hibbits 1399*852ba100SJustin Hibbits /**************************************************************************//** 1400*852ba100SJustin Hibbits @Description Structure for Deep Sleep Auto Response ICMPV6 info 1401*852ba100SJustin Hibbits *//***************************************************************************/ 1402*852ba100SJustin Hibbits typedef struct t_FmPortDsarEchoIpv6Info 1403*852ba100SJustin Hibbits { 1404*852ba100SJustin Hibbits uint8_t tableSize; 1405*852ba100SJustin Hibbits t_FmPortDsarNdpEntry *p_AutoResTable; 1406*852ba100SJustin Hibbits } t_FmPortDsarEchoIpv6Info; 1407*852ba100SJustin Hibbits 1408*852ba100SJustin Hibbits /**************************************************************************//** 1409*852ba100SJustin Hibbits @Description Deep Sleep Auto Response SNMP OIDs table entry 1410*852ba100SJustin Hibbits 1411*852ba100SJustin Hibbits *//***************************************************************************/ 1412*852ba100SJustin Hibbits typedef struct { 1413*852ba100SJustin Hibbits uint16_t oidSize; 1414*852ba100SJustin Hibbits uint8_t *oidVal; /* only the oid string */ 1415*852ba100SJustin Hibbits uint16_t resSize; 1416*852ba100SJustin Hibbits uint8_t *resVal; /* resVal will be the entire reply, 1417*852ba100SJustin Hibbits i.e. "Type|Length|Value" */ 1418*852ba100SJustin Hibbits } t_FmPortDsarOidsEntry; 1419*852ba100SJustin Hibbits 1420*852ba100SJustin Hibbits /**************************************************************************//** 1421*852ba100SJustin Hibbits @Description Deep Sleep Auto Response SNMP IPv4 Addresses Table Entry 1422*852ba100SJustin Hibbits Refer to the FMan Controller spec for more details. 1423*852ba100SJustin Hibbits *//***************************************************************************/ 1424*852ba100SJustin Hibbits typedef struct 1425*852ba100SJustin Hibbits { 1426*852ba100SJustin Hibbits uint32_t ipv4Addr; /*!< 32 bit IPv4 Address. */ 1427*852ba100SJustin Hibbits bool isVlan; 1428*852ba100SJustin Hibbits uint16_t vid; /*!< 12 bits VLAN ID. The 4 left-most bits should be cleared */ 1429*852ba100SJustin Hibbits /*!< This field should be 0x0000 for an entry with no VLAN tag or a null VLAN ID. */ 1430*852ba100SJustin Hibbits } t_FmPortDsarSnmpIpv4AddrTblEntry; 1431*852ba100SJustin Hibbits 1432*852ba100SJustin Hibbits /**************************************************************************//** 1433*852ba100SJustin Hibbits @Description Deep Sleep Auto Response SNMP IPv6 Addresses Table Entry 1434*852ba100SJustin Hibbits Refer to the FMan Controller spec for more details. 1435*852ba100SJustin Hibbits *//***************************************************************************/ 1436*852ba100SJustin Hibbits typedef struct 1437*852ba100SJustin Hibbits { 1438*852ba100SJustin Hibbits uint32_t ipv6Addr[4]; /*!< 4 * 32 bit IPv6 Address. */ 1439*852ba100SJustin Hibbits bool isVlan; 1440*852ba100SJustin Hibbits uint16_t vid; /*!< 12 bits VLAN ID. The 4 left-most bits should be cleared */ 1441*852ba100SJustin Hibbits /*!< This field should be 0x0000 for an entry with no VLAN tag or a null VLAN ID. */ 1442*852ba100SJustin Hibbits } t_FmPortDsarSnmpIpv6AddrTblEntry; 1443*852ba100SJustin Hibbits 1444*852ba100SJustin Hibbits /**************************************************************************//** 1445*852ba100SJustin Hibbits @Description Deep Sleep Auto Response SNMP Descriptor 1446*852ba100SJustin Hibbits 1447*852ba100SJustin Hibbits *//***************************************************************************/ 1448*852ba100SJustin Hibbits typedef struct 1449*852ba100SJustin Hibbits { 1450*852ba100SJustin Hibbits uint16_t control; /**< Control bits [0-15]. */ 1451*852ba100SJustin Hibbits uint16_t maxSnmpMsgLength; /**< Maximal allowed SNMP message length. */ 1452*852ba100SJustin Hibbits uint16_t numOfIpv4Addresses; /**< Number of entries in IPv4 addresses table. */ 1453*852ba100SJustin Hibbits uint16_t numOfIpv6Addresses; /**< Number of entries in IPv6 addresses table. */ 1454*852ba100SJustin Hibbits t_FmPortDsarSnmpIpv4AddrTblEntry *p_Ipv4AddrTbl; /**< Pointer to IPv4 addresses table. */ 1455*852ba100SJustin Hibbits t_FmPortDsarSnmpIpv6AddrTblEntry *p_Ipv6AddrTbl; /**< Pointer to IPv6 addresses table. */ 1456*852ba100SJustin Hibbits uint8_t *p_RdOnlyCommunityStr; /**< Pointer to the Read Only Community String. */ 1457*852ba100SJustin Hibbits uint8_t *p_RdWrCommunityStr; /**< Pointer to the Read Write Community String. */ 1458*852ba100SJustin Hibbits t_FmPortDsarOidsEntry *p_OidsTbl; /**< Pointer to OIDs table. */ 1459*852ba100SJustin Hibbits uint32_t oidsTblSize; /**< Number of entries in OIDs table. */ 1460*852ba100SJustin Hibbits } t_FmPortDsarSnmpInfo; 1461*852ba100SJustin Hibbits 1462*852ba100SJustin Hibbits /**************************************************************************//** 1463*852ba100SJustin Hibbits @Description Structure for Deep Sleep Auto Response filtering Entry 1464*852ba100SJustin Hibbits *//***************************************************************************/ 1465*852ba100SJustin Hibbits typedef struct t_FmPortDsarFilteringEntry 1466*852ba100SJustin Hibbits { 1467*852ba100SJustin Hibbits uint16_t srcPort; 1468*852ba100SJustin Hibbits uint16_t dstPort; 1469*852ba100SJustin Hibbits uint16_t srcPortMask; 1470*852ba100SJustin Hibbits uint16_t dstPortMask; 1471*852ba100SJustin Hibbits } t_FmPortDsarFilteringEntry; 1472*852ba100SJustin Hibbits 1473*852ba100SJustin Hibbits /**************************************************************************//** 1474*852ba100SJustin Hibbits @Description Structure for Deep Sleep Auto Response filtering info 1475*852ba100SJustin Hibbits *//***************************************************************************/ 1476*852ba100SJustin Hibbits typedef struct t_FmPortDsarFilteringInfo 1477*852ba100SJustin Hibbits { 1478*852ba100SJustin Hibbits /* IP protocol filtering parameters */ 1479*852ba100SJustin Hibbits uint8_t ipProtTableSize; 1480*852ba100SJustin Hibbits uint8_t *p_IpProtTablePtr; 1481*852ba100SJustin Hibbits bool ipProtPassOnHit; /* when TRUE, miss in the table will cause the packet to be droped, 1482*852ba100SJustin Hibbits hit will pass the packet to UDP/TCP filters if needed and if not 1483*852ba100SJustin Hibbits to the classification tree. If the classification tree will pass 1484*852ba100SJustin Hibbits the packet to a queue it will cause a wake interupt. 1485*852ba100SJustin Hibbits When FALSE it the other way around. */ 1486*852ba100SJustin Hibbits /* UDP port filtering parameters */ 1487*852ba100SJustin Hibbits uint8_t udpPortsTableSize; 1488*852ba100SJustin Hibbits t_FmPortDsarFilteringEntry *p_UdpPortsTablePtr; 1489*852ba100SJustin Hibbits bool udpPortPassOnHit; /* when TRUE, miss in the table will cause the packet to be droped, 1490*852ba100SJustin Hibbits hit will pass the packet to classification tree. 1491*852ba100SJustin Hibbits If the classification tree will pass the packet to a queue it 1492*852ba100SJustin Hibbits will cause a wake interupt. 1493*852ba100SJustin Hibbits When FALSE it the other way around. */ 1494*852ba100SJustin Hibbits /* TCP port filtering parameters */ 1495*852ba100SJustin Hibbits uint16_t tcpFlagsMask; 1496*852ba100SJustin Hibbits uint8_t tcpPortsTableSize; 1497*852ba100SJustin Hibbits t_FmPortDsarFilteringEntry *p_TcpPortsTablePtr; 1498*852ba100SJustin Hibbits bool tcpPortPassOnHit; /* when TRUE, miss in the table will cause the packet to be droped, 1499*852ba100SJustin Hibbits hit will pass the packet to classification tree. 1500*852ba100SJustin Hibbits If the classification tree will pass the packet to a queue it 1501*852ba100SJustin Hibbits will cause a wake interupt. 1502*852ba100SJustin Hibbits When FALSE it the other way around. */ 1503*852ba100SJustin Hibbits } t_FmPortDsarFilteringInfo; 1504*852ba100SJustin Hibbits 1505*852ba100SJustin Hibbits /**************************************************************************//** 1506*852ba100SJustin Hibbits @Description Structure for Deep Sleep Auto Response parameters 1507*852ba100SJustin Hibbits *//***************************************************************************/ 1508*852ba100SJustin Hibbits typedef struct t_FmPortDsarParams 1509*852ba100SJustin Hibbits { 1510*852ba100SJustin Hibbits t_Handle h_FmPortTx; 1511*852ba100SJustin Hibbits t_FmPortDsarArpInfo *p_AutoResArpInfo; 1512*852ba100SJustin Hibbits t_FmPortDsarEchoIpv4Info *p_AutoResEchoIpv4Info; 1513*852ba100SJustin Hibbits t_FmPortDsarNdpInfo *p_AutoResNdpInfo; 1514*852ba100SJustin Hibbits t_FmPortDsarEchoIpv6Info *p_AutoResEchoIpv6Info; 1515*852ba100SJustin Hibbits t_FmPortDsarSnmpInfo *p_AutoResSnmpInfo; 1516*852ba100SJustin Hibbits t_FmPortDsarFilteringInfo *p_AutoResFilteringInfo; 1517*852ba100SJustin Hibbits } t_FmPortDsarParams; 1518*852ba100SJustin Hibbits 1519*852ba100SJustin Hibbits /**************************************************************************//** 1520*852ba100SJustin Hibbits @Function FM_PORT_EnterDsar 1521*852ba100SJustin Hibbits 1522*852ba100SJustin Hibbits @Description Enter Deep Sleep Auto Response mode. 1523*852ba100SJustin Hibbits This function write the apropriate values to in the relevant 1524*852ba100SJustin Hibbits tables in the MURAM. 1525*852ba100SJustin Hibbits 1526*852ba100SJustin Hibbits @Param[in] h_FmPortRx - FM PORT module descriptor 1527*852ba100SJustin Hibbits @Param[in] params - Auto Response parameters 1528*852ba100SJustin Hibbits 1529*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1530*852ba100SJustin Hibbits 1531*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 1532*852ba100SJustin Hibbits *//***************************************************************************/ 1533*852ba100SJustin Hibbits t_Error FM_PORT_EnterDsar(t_Handle h_FmPortRx, t_FmPortDsarParams *params); 1534*852ba100SJustin Hibbits 1535*852ba100SJustin Hibbits /**************************************************************************//** 1536*852ba100SJustin Hibbits @Function FM_PORT_EnterDsarFinal 1537*852ba100SJustin Hibbits 1538*852ba100SJustin Hibbits @Description Enter Deep Sleep Auto Response mode. 1539*852ba100SJustin Hibbits This function sets the Tx port in independent mode as needed 1540*852ba100SJustin Hibbits and redirect the receive flow to go through the 1541*852ba100SJustin Hibbits Dsar Fman-ctrl code 1542*852ba100SJustin Hibbits 1543*852ba100SJustin Hibbits @Param[in] h_DsarRxPort - FM Rx PORT module descriptor 1544*852ba100SJustin Hibbits @Param[in] h_DsarTxPort - FM Tx PORT module descriptor 1545*852ba100SJustin Hibbits 1546*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1547*852ba100SJustin Hibbits 1548*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 1549*852ba100SJustin Hibbits *//***************************************************************************/ 1550*852ba100SJustin Hibbits t_Error FM_PORT_EnterDsarFinal(t_Handle h_DsarRxPort, t_Handle h_DsarTxPort); 1551*852ba100SJustin Hibbits 1552*852ba100SJustin Hibbits /**************************************************************************//** 1553*852ba100SJustin Hibbits @Function FM_PORT_ExitDsar 1554*852ba100SJustin Hibbits 1555*852ba100SJustin Hibbits @Description Exit Deep Sleep Auto Response mode. 1556*852ba100SJustin Hibbits This function reverse the AR mode and put the ports back into 1557*852ba100SJustin Hibbits their original wake mode 1558*852ba100SJustin Hibbits 1559*852ba100SJustin Hibbits @Param[in] h_FmPortRx - FM PORT Rx module descriptor 1560*852ba100SJustin Hibbits @Param[in] h_FmPortTx - FM PORT Tx module descriptor 1561*852ba100SJustin Hibbits 1562*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1563*852ba100SJustin Hibbits 1564*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_EnterDsar(). 1565*852ba100SJustin Hibbits *//***************************************************************************/ 1566*852ba100SJustin Hibbits void FM_PORT_ExitDsar(t_Handle h_FmPortRx, t_Handle h_FmPortTx); 1567*852ba100SJustin Hibbits 1568*852ba100SJustin Hibbits /**************************************************************************//** 1569*852ba100SJustin Hibbits @Function FM_PORT_IsInDsar 1570*852ba100SJustin Hibbits 1571*852ba100SJustin Hibbits @Description This function returns TRUE if the port was set as Auto Response 1572*852ba100SJustin Hibbits and FALSE if not. Once Exit AR mode it will return FALSE as well 1573*852ba100SJustin Hibbits until re-enabled once more. 1574*852ba100SJustin Hibbits 1575*852ba100SJustin Hibbits @Param[in] h_FmPort - FM PORT module descriptor 1576*852ba100SJustin Hibbits 1577*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1578*852ba100SJustin Hibbits *//***************************************************************************/ 1579*852ba100SJustin Hibbits bool FM_PORT_IsInDsar(t_Handle h_FmPort); 1580*852ba100SJustin Hibbits 1581*852ba100SJustin Hibbits typedef struct t_FmPortDsarStats 1582*852ba100SJustin Hibbits { 1583*852ba100SJustin Hibbits uint32_t arpArCnt; 1584*852ba100SJustin Hibbits uint32_t echoIcmpv4ArCnt; 1585*852ba100SJustin Hibbits uint32_t ndpArCnt; 1586*852ba100SJustin Hibbits uint32_t echoIcmpv6ArCnt; 1587*852ba100SJustin Hibbits uint32_t snmpGetCnt; 1588*852ba100SJustin Hibbits uint32_t snmpGetNextCnt; 1589*852ba100SJustin Hibbits } t_FmPortDsarStats; 1590*852ba100SJustin Hibbits 1591*852ba100SJustin Hibbits /**************************************************************************//** 1592*852ba100SJustin Hibbits @Function FM_PORT_GetDsarStats 1593*852ba100SJustin Hibbits 1594*852ba100SJustin Hibbits @Description Return statistics for Deep Sleep Auto Response 1595*852ba100SJustin Hibbits 1596*852ba100SJustin Hibbits @Param[in] h_FmPortRx - FM PORT module descriptor 1597*852ba100SJustin Hibbits @Param[out] stats - structure containing the statistics counters 1598*852ba100SJustin Hibbits 1599*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1600*852ba100SJustin Hibbits *//***************************************************************************/ 1601*852ba100SJustin Hibbits t_Error FM_PORT_GetDsarStats(t_Handle h_FmPortRx, t_FmPortDsarStats *stats); 16020aeed3e9SJustin Hibbits 16030aeed3e9SJustin Hibbits #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) 16040aeed3e9SJustin Hibbits /**************************************************************************//** 16050aeed3e9SJustin Hibbits @Function FM_PORT_DumpRegs 16060aeed3e9SJustin Hibbits 16070aeed3e9SJustin Hibbits @Description Dump all regs. 16080aeed3e9SJustin Hibbits 16090aeed3e9SJustin Hibbits Calling this routine invalidates the descriptor. 16100aeed3e9SJustin Hibbits 16110aeed3e9SJustin Hibbits @Param[in] h_FmPort - FM PORT module descriptor 16120aeed3e9SJustin Hibbits 16130aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 16140aeed3e9SJustin Hibbits 16150aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 16160aeed3e9SJustin Hibbits *//***************************************************************************/ 16170aeed3e9SJustin Hibbits t_Error FM_PORT_DumpRegs(t_Handle h_FmPort); 16180aeed3e9SJustin Hibbits #endif /* (defined(DEBUG_ERRORS) && ... */ 16190aeed3e9SJustin Hibbits 16200aeed3e9SJustin Hibbits /**************************************************************************//** 16210aeed3e9SJustin Hibbits @Function FM_PORT_GetBufferDataOffset 16220aeed3e9SJustin Hibbits 16230aeed3e9SJustin Hibbits @Description Relevant for Rx ports. 16240aeed3e9SJustin Hibbits Returns the data offset from the beginning of the data buffer 16250aeed3e9SJustin Hibbits 16260aeed3e9SJustin Hibbits @Param[in] h_FmPort - FM PORT module descriptor 16270aeed3e9SJustin Hibbits 16280aeed3e9SJustin Hibbits @Return data offset. 16290aeed3e9SJustin Hibbits 16300aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 16310aeed3e9SJustin Hibbits *//***************************************************************************/ 16320aeed3e9SJustin Hibbits uint32_t FM_PORT_GetBufferDataOffset(t_Handle h_FmPort); 16330aeed3e9SJustin Hibbits 16340aeed3e9SJustin Hibbits /**************************************************************************//** 16350aeed3e9SJustin Hibbits @Function FM_PORT_GetBufferICInfo 16360aeed3e9SJustin Hibbits 16370aeed3e9SJustin Hibbits @Description Returns the Internal Context offset from the beginning of the data buffer 16380aeed3e9SJustin Hibbits 16390aeed3e9SJustin Hibbits @Param[in] h_FmPort - FM PORT module descriptor 16400aeed3e9SJustin Hibbits @Param[in] p_Data - A pointer to the data buffer. 16410aeed3e9SJustin Hibbits 16420aeed3e9SJustin Hibbits @Return Internal context info pointer on success, NULL if 'allOtherInfo' was not 16430aeed3e9SJustin Hibbits configured for this port. 16440aeed3e9SJustin Hibbits 16450aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 16460aeed3e9SJustin Hibbits *//***************************************************************************/ 16470aeed3e9SJustin Hibbits uint8_t * FM_PORT_GetBufferICInfo(t_Handle h_FmPort, char *p_Data); 16480aeed3e9SJustin Hibbits 16490aeed3e9SJustin Hibbits /**************************************************************************//** 16500aeed3e9SJustin Hibbits @Function FM_PORT_GetBufferPrsResult 16510aeed3e9SJustin Hibbits 16520aeed3e9SJustin Hibbits @Description Returns the pointer to the parse result in the data buffer. 16530aeed3e9SJustin Hibbits In Rx ports this is relevant after reception, if parse 16540aeed3e9SJustin Hibbits result is configured to be part of the data passed to the 16550aeed3e9SJustin Hibbits application. For non Rx ports it may be used to get the pointer 16560aeed3e9SJustin Hibbits of the area in the buffer where parse result should be 16570aeed3e9SJustin Hibbits initialized - if so configured. 16580aeed3e9SJustin Hibbits See FM_PORT_ConfigBufferPrefixContent for data buffer prefix 16590aeed3e9SJustin Hibbits configuration. 16600aeed3e9SJustin Hibbits 16610aeed3e9SJustin Hibbits @Param[in] h_FmPort - FM PORT module descriptor 16620aeed3e9SJustin Hibbits @Param[in] p_Data - A pointer to the data buffer. 16630aeed3e9SJustin Hibbits 16640aeed3e9SJustin Hibbits @Return Parse result pointer on success, NULL if parse result was not 16650aeed3e9SJustin Hibbits configured for this port. 16660aeed3e9SJustin Hibbits 16670aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 16680aeed3e9SJustin Hibbits *//***************************************************************************/ 16690aeed3e9SJustin Hibbits t_FmPrsResult * FM_PORT_GetBufferPrsResult(t_Handle h_FmPort, char *p_Data); 16700aeed3e9SJustin Hibbits 16710aeed3e9SJustin Hibbits /**************************************************************************//** 16720aeed3e9SJustin Hibbits @Function FM_PORT_GetBufferTimeStamp 16730aeed3e9SJustin Hibbits 16740aeed3e9SJustin Hibbits @Description Returns the time stamp in the data buffer. 16750aeed3e9SJustin Hibbits Relevant for Rx ports for getting the buffer time stamp. 16760aeed3e9SJustin Hibbits See FM_PORT_ConfigBufferPrefixContent for data buffer prefix 16770aeed3e9SJustin Hibbits configuration. 16780aeed3e9SJustin Hibbits 16790aeed3e9SJustin Hibbits @Param[in] h_FmPort - FM PORT module descriptor 16800aeed3e9SJustin Hibbits @Param[in] p_Data - A pointer to the data buffer. 16810aeed3e9SJustin Hibbits 16820aeed3e9SJustin Hibbits @Return A pointer to the hash result on success, NULL otherwise. 16830aeed3e9SJustin Hibbits 16840aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 16850aeed3e9SJustin Hibbits *//***************************************************************************/ 16860aeed3e9SJustin Hibbits uint64_t * FM_PORT_GetBufferTimeStamp(t_Handle h_FmPort, char *p_Data); 16870aeed3e9SJustin Hibbits 16880aeed3e9SJustin Hibbits /**************************************************************************//** 16890aeed3e9SJustin Hibbits @Function FM_PORT_GetBufferHashResult 16900aeed3e9SJustin Hibbits 16910aeed3e9SJustin Hibbits @Description Given a data buffer, on the condition that hash result was defined 16920aeed3e9SJustin Hibbits as a part of the buffer content (see FM_PORT_ConfigBufferPrefixContent) 16930aeed3e9SJustin Hibbits this routine will return the pointer to the hash result location in the 16940aeed3e9SJustin Hibbits buffer prefix. 16950aeed3e9SJustin Hibbits 16960aeed3e9SJustin Hibbits @Param[in] h_FmPort - FM PORT module descriptor 16970aeed3e9SJustin Hibbits @Param[in] p_Data - A pointer to the data buffer. 16980aeed3e9SJustin Hibbits 16990aeed3e9SJustin Hibbits @Return A pointer to the hash result on success, NULL otherwise. 17000aeed3e9SJustin Hibbits 17010aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 17020aeed3e9SJustin Hibbits *//***************************************************************************/ 17030aeed3e9SJustin Hibbits uint8_t * FM_PORT_GetBufferHashResult(t_Handle h_FmPort, char *p_Data); 17040aeed3e9SJustin Hibbits 17050aeed3e9SJustin Hibbits /**************************************************************************//** 17060aeed3e9SJustin Hibbits @Function FM_PORT_Disable 17070aeed3e9SJustin Hibbits 17080aeed3e9SJustin Hibbits @Description Gracefully disable an FM port. The port will not start new tasks after all 17090aeed3e9SJustin Hibbits tasks associated with the port are terminated. 17100aeed3e9SJustin Hibbits 17110aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 17120aeed3e9SJustin Hibbits 17130aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 17140aeed3e9SJustin Hibbits 17150aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 17160aeed3e9SJustin Hibbits This is a blocking routine, it returns after port is 17170aeed3e9SJustin Hibbits gracefully stopped, i.e. the port will not except new frames, 17180aeed3e9SJustin Hibbits but it will finish all frames or tasks which were already began 17190aeed3e9SJustin Hibbits *//***************************************************************************/ 17200aeed3e9SJustin Hibbits t_Error FM_PORT_Disable(t_Handle h_FmPort); 17210aeed3e9SJustin Hibbits 17220aeed3e9SJustin Hibbits /**************************************************************************//** 17230aeed3e9SJustin Hibbits @Function FM_PORT_Enable 17240aeed3e9SJustin Hibbits 17250aeed3e9SJustin Hibbits @Description A runtime routine provided to allow disable/enable of port. 17260aeed3e9SJustin Hibbits 17270aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 17280aeed3e9SJustin Hibbits 17290aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 17300aeed3e9SJustin Hibbits 17310aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 17320aeed3e9SJustin Hibbits *//***************************************************************************/ 17330aeed3e9SJustin Hibbits t_Error FM_PORT_Enable(t_Handle h_FmPort); 17340aeed3e9SJustin Hibbits 17350aeed3e9SJustin Hibbits /**************************************************************************//** 17360aeed3e9SJustin Hibbits @Function FM_PORT_SetRateLimit 17370aeed3e9SJustin Hibbits 17380aeed3e9SJustin Hibbits @Description Calling this routine enables rate limit algorithm. 17390aeed3e9SJustin Hibbits By default, this functionality is disabled. 17400aeed3e9SJustin Hibbits Note that rate-limit mechanism uses the FM time stamp. 17410aeed3e9SJustin Hibbits The selected rate limit specified here would be 17420aeed3e9SJustin Hibbits rounded DOWN to the nearest 16M. 17430aeed3e9SJustin Hibbits 1744*852ba100SJustin Hibbits May be used for Tx and OP ports only 17450aeed3e9SJustin Hibbits 17460aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 17470aeed3e9SJustin Hibbits @Param[in] p_RateLimit A structure of rate limit parameters 17480aeed3e9SJustin Hibbits 17490aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 17500aeed3e9SJustin Hibbits 17510aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 1752*852ba100SJustin Hibbits If rate limit is set on a port that need to send PFC frames, 1753*852ba100SJustin Hibbits it might violate the stop transmit timing. 17540aeed3e9SJustin Hibbits *//***************************************************************************/ 17550aeed3e9SJustin Hibbits t_Error FM_PORT_SetRateLimit(t_Handle h_FmPort, t_FmPortRateLimit *p_RateLimit); 17560aeed3e9SJustin Hibbits 17570aeed3e9SJustin Hibbits /**************************************************************************//** 17580aeed3e9SJustin Hibbits @Function FM_PORT_DeleteRateLimit 17590aeed3e9SJustin Hibbits 17600aeed3e9SJustin Hibbits @Description Calling this routine disables and clears rate limit 17610aeed3e9SJustin Hibbits initialization. 17620aeed3e9SJustin Hibbits 1763*852ba100SJustin Hibbits May be used for Tx and OP ports only 17640aeed3e9SJustin Hibbits 17650aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 17660aeed3e9SJustin Hibbits 17670aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 17680aeed3e9SJustin Hibbits 17690aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 17700aeed3e9SJustin Hibbits *//***************************************************************************/ 17710aeed3e9SJustin Hibbits t_Error FM_PORT_DeleteRateLimit(t_Handle h_FmPort); 17720aeed3e9SJustin Hibbits 17730aeed3e9SJustin Hibbits /**************************************************************************//** 1774*852ba100SJustin Hibbits @Function FM_PORT_SetPfcPrioritiesMappingToQmanWQ 1775*852ba100SJustin Hibbits 1776*852ba100SJustin Hibbits @Description Calling this routine maps each PFC received priority to the transmit WQ. 1777*852ba100SJustin Hibbits This WQ will be blocked upon receiving a PFC frame with this priority. 1778*852ba100SJustin Hibbits 1779*852ba100SJustin Hibbits May be used for Tx ports only. 1780*852ba100SJustin Hibbits 1781*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 1782*852ba100SJustin Hibbits @Param[in] prio PFC priority (0-7). 1783*852ba100SJustin Hibbits @Param[in] wq Work Queue (0-7). 1784*852ba100SJustin Hibbits 1785*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1786*852ba100SJustin Hibbits 1787*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 1788*852ba100SJustin Hibbits *//***************************************************************************/ 1789*852ba100SJustin Hibbits t_Error FM_PORT_SetPfcPrioritiesMappingToQmanWQ(t_Handle h_FmPort, uint8_t prio, uint8_t wq); 1790*852ba100SJustin Hibbits 1791*852ba100SJustin Hibbits /**************************************************************************//** 17920aeed3e9SJustin Hibbits @Function FM_PORT_SetStatisticsCounters 17930aeed3e9SJustin Hibbits 17940aeed3e9SJustin Hibbits @Description Calling this routine enables/disables port's statistics counters. 17950aeed3e9SJustin Hibbits By default, counters are enabled. 17960aeed3e9SJustin Hibbits 17970aeed3e9SJustin Hibbits May be used for all port types 17980aeed3e9SJustin Hibbits 17990aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 18000aeed3e9SJustin Hibbits @Param[in] enable TRUE to enable, FALSE to disable. 18010aeed3e9SJustin Hibbits 18020aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 18030aeed3e9SJustin Hibbits 18040aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 18050aeed3e9SJustin Hibbits *//***************************************************************************/ 18060aeed3e9SJustin Hibbits t_Error FM_PORT_SetStatisticsCounters(t_Handle h_FmPort, bool enable); 18070aeed3e9SJustin Hibbits 18080aeed3e9SJustin Hibbits /**************************************************************************//** 18090aeed3e9SJustin Hibbits @Function FM_PORT_SetFrameQueueCounters 18100aeed3e9SJustin Hibbits 18110aeed3e9SJustin Hibbits @Description Calling this routine enables/disables port's enqueue/dequeue counters. 18120aeed3e9SJustin Hibbits By default, counters are enabled. 18130aeed3e9SJustin Hibbits 18140aeed3e9SJustin Hibbits May be used for all ports 18150aeed3e9SJustin Hibbits 18160aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 18170aeed3e9SJustin Hibbits @Param[in] enable TRUE to enable, FALSE to disable. 18180aeed3e9SJustin Hibbits 18190aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 18200aeed3e9SJustin Hibbits 18210aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 18220aeed3e9SJustin Hibbits *//***************************************************************************/ 18230aeed3e9SJustin Hibbits t_Error FM_PORT_SetFrameQueueCounters(t_Handle h_FmPort, bool enable); 18240aeed3e9SJustin Hibbits 18250aeed3e9SJustin Hibbits /**************************************************************************//** 18260aeed3e9SJustin Hibbits @Function FM_PORT_AnalyzePerformanceParams 18270aeed3e9SJustin Hibbits 18280aeed3e9SJustin Hibbits @Description User may call this routine to so the driver will analyze if the 18290aeed3e9SJustin Hibbits basic performance parameters are correct and also the driver may 1830*852ba100SJustin Hibbits suggest of improvements; The basic parameters are FIFO sizes, number 18310aeed3e9SJustin Hibbits of DMAs and number of TNUMs for the port. 18320aeed3e9SJustin Hibbits 18330aeed3e9SJustin Hibbits May be used for all port types 18340aeed3e9SJustin Hibbits 18350aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 18360aeed3e9SJustin Hibbits 18370aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 18380aeed3e9SJustin Hibbits 18390aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 18400aeed3e9SJustin Hibbits *//***************************************************************************/ 18410aeed3e9SJustin Hibbits t_Error FM_PORT_AnalyzePerformanceParams(t_Handle h_FmPort); 18420aeed3e9SJustin Hibbits 18430aeed3e9SJustin Hibbits 18440aeed3e9SJustin Hibbits /**************************************************************************//** 18450aeed3e9SJustin Hibbits @Function FM_PORT_SetAllocBufCounter 18460aeed3e9SJustin Hibbits 18470aeed3e9SJustin Hibbits @Description Calling this routine enables/disables BM pool allocate 18480aeed3e9SJustin Hibbits buffer counters. 18490aeed3e9SJustin Hibbits By default, counters are enabled. 18500aeed3e9SJustin Hibbits 18510aeed3e9SJustin Hibbits May be used for Rx ports only 18520aeed3e9SJustin Hibbits 18530aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 18540aeed3e9SJustin Hibbits @Param[in] poolId BM pool id. 18550aeed3e9SJustin Hibbits @Param[in] enable TRUE to enable, FALSE to disable. 18560aeed3e9SJustin Hibbits 18570aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 18580aeed3e9SJustin Hibbits 18590aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 18600aeed3e9SJustin Hibbits *//***************************************************************************/ 18610aeed3e9SJustin Hibbits t_Error FM_PORT_SetAllocBufCounter(t_Handle h_FmPort, uint8_t poolId, bool enable); 18620aeed3e9SJustin Hibbits 18630aeed3e9SJustin Hibbits /**************************************************************************//** 1864*852ba100SJustin Hibbits @Function FM_PORT_GetBmiCounters 1865*852ba100SJustin Hibbits 1866*852ba100SJustin Hibbits @Description Read port's BMI stat counters and place them into 1867*852ba100SJustin Hibbits a designated structure of counters. 1868*852ba100SJustin Hibbits 1869*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 1870*852ba100SJustin Hibbits @Param[out] p_BmiStats counters structure 1871*852ba100SJustin Hibbits 1872*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 1873*852ba100SJustin Hibbits 1874*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 1875*852ba100SJustin Hibbits *//***************************************************************************/ 1876*852ba100SJustin Hibbits t_Error FM_PORT_GetBmiCounters(t_Handle h_FmPort, t_FmPortBmiStats *p_BmiStats); 1877*852ba100SJustin Hibbits 1878*852ba100SJustin Hibbits /**************************************************************************//** 18790aeed3e9SJustin Hibbits @Function FM_PORT_GetCounter 18800aeed3e9SJustin Hibbits 18810aeed3e9SJustin Hibbits @Description Reads one of the FM PORT counters. 18820aeed3e9SJustin Hibbits 18830aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 18840aeed3e9SJustin Hibbits @Param[in] fmPortCounter The requested counter. 18850aeed3e9SJustin Hibbits 18860aeed3e9SJustin Hibbits @Return Counter's current value. 18870aeed3e9SJustin Hibbits 18880aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 18890aeed3e9SJustin Hibbits Note that it is user's responsibility to call this routine only 18900aeed3e9SJustin Hibbits for enabled counters, and there will be no indication if a 18910aeed3e9SJustin Hibbits disabled counter is accessed. 18920aeed3e9SJustin Hibbits *//***************************************************************************/ 18930aeed3e9SJustin Hibbits uint32_t FM_PORT_GetCounter(t_Handle h_FmPort, e_FmPortCounters fmPortCounter); 18940aeed3e9SJustin Hibbits 18950aeed3e9SJustin Hibbits /**************************************************************************//** 18960aeed3e9SJustin Hibbits @Function FM_PORT_ModifyCounter 18970aeed3e9SJustin Hibbits 18980aeed3e9SJustin Hibbits @Description Sets a value to an enabled counter. Use "0" to reset the counter. 18990aeed3e9SJustin Hibbits 19000aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 19010aeed3e9SJustin Hibbits @Param[in] fmPortCounter The requested counter. 19020aeed3e9SJustin Hibbits @Param[in] value The requested value to be written into the counter. 19030aeed3e9SJustin Hibbits 19040aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 19050aeed3e9SJustin Hibbits 19060aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 19070aeed3e9SJustin Hibbits *//***************************************************************************/ 19080aeed3e9SJustin Hibbits t_Error FM_PORT_ModifyCounter(t_Handle h_FmPort, e_FmPortCounters fmPortCounter, uint32_t value); 19090aeed3e9SJustin Hibbits 19100aeed3e9SJustin Hibbits /**************************************************************************//** 19110aeed3e9SJustin Hibbits @Function FM_PORT_GetAllocBufCounter 19120aeed3e9SJustin Hibbits 19130aeed3e9SJustin Hibbits @Description Reads one of the FM PORT buffer counters. 19140aeed3e9SJustin Hibbits 19150aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 19160aeed3e9SJustin Hibbits @Param[in] poolId The requested pool. 19170aeed3e9SJustin Hibbits 19180aeed3e9SJustin Hibbits @Return Counter's current value. 19190aeed3e9SJustin Hibbits 19200aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 19210aeed3e9SJustin Hibbits Note that it is user's responsibility to call this routine only 19220aeed3e9SJustin Hibbits for enabled counters, and there will be no indication if a 19230aeed3e9SJustin Hibbits disabled counter is accessed. 19240aeed3e9SJustin Hibbits *//***************************************************************************/ 19250aeed3e9SJustin Hibbits uint32_t FM_PORT_GetAllocBufCounter(t_Handle h_FmPort, uint8_t poolId); 19260aeed3e9SJustin Hibbits 19270aeed3e9SJustin Hibbits /**************************************************************************//** 19280aeed3e9SJustin Hibbits @Function FM_PORT_ModifyAllocBufCounter 19290aeed3e9SJustin Hibbits 19300aeed3e9SJustin Hibbits @Description Sets a value to an enabled counter. Use "0" to reset the counter. 19310aeed3e9SJustin Hibbits 19320aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 19330aeed3e9SJustin Hibbits @Param[in] poolId The requested pool. 19340aeed3e9SJustin Hibbits @Param[in] value The requested value to be written into the counter. 19350aeed3e9SJustin Hibbits 19360aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 19370aeed3e9SJustin Hibbits 19380aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 19390aeed3e9SJustin Hibbits *//***************************************************************************/ 19400aeed3e9SJustin Hibbits t_Error FM_PORT_ModifyAllocBufCounter(t_Handle h_FmPort, uint8_t poolId, uint32_t value); 19410aeed3e9SJustin Hibbits 19420aeed3e9SJustin Hibbits /**************************************************************************//** 19430aeed3e9SJustin Hibbits @Function FM_PORT_AddCongestionGrps 19440aeed3e9SJustin Hibbits 19450aeed3e9SJustin Hibbits @Description This routine effects the corresponding Tx port. 19460aeed3e9SJustin Hibbits It should be called in order to enable pause 19470aeed3e9SJustin Hibbits frame transmission in case of congestion in one or more 19480aeed3e9SJustin Hibbits of the congestion groups relevant to this port. 19490aeed3e9SJustin Hibbits Each call to this routine may add one or more congestion 19500aeed3e9SJustin Hibbits groups to be considered relevant to this port. 19510aeed3e9SJustin Hibbits 19520aeed3e9SJustin Hibbits May be used for Rx, or RX+OP ports only (depending on chip) 19530aeed3e9SJustin Hibbits 19540aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 19550aeed3e9SJustin Hibbits @Param[in] p_CongestionGrps A pointer to an array of congestion groups 19560aeed3e9SJustin Hibbits id's to consider. 19570aeed3e9SJustin Hibbits 19580aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 19590aeed3e9SJustin Hibbits 19600aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 19610aeed3e9SJustin Hibbits *//***************************************************************************/ 19620aeed3e9SJustin Hibbits t_Error FM_PORT_AddCongestionGrps(t_Handle h_FmPort, t_FmPortCongestionGrps *p_CongestionGrps); 19630aeed3e9SJustin Hibbits 19640aeed3e9SJustin Hibbits /**************************************************************************//** 19650aeed3e9SJustin Hibbits @Function FM_PORT_RemoveCongestionGrps 19660aeed3e9SJustin Hibbits 19670aeed3e9SJustin Hibbits @Description This routine effects the corresponding Tx port. It should be 19680aeed3e9SJustin Hibbits called when congestion groups were 19690aeed3e9SJustin Hibbits defined for this port and are no longer relevant, or pause 19700aeed3e9SJustin Hibbits frames transmitting is not required on their behalf. 19710aeed3e9SJustin Hibbits Each call to this routine may remove one or more congestion 19720aeed3e9SJustin Hibbits groups to be considered relevant to this port. 19730aeed3e9SJustin Hibbits 19740aeed3e9SJustin Hibbits May be used for Rx, or RX+OP ports only (depending on chip) 19750aeed3e9SJustin Hibbits 19760aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 19770aeed3e9SJustin Hibbits @Param[in] p_CongestionGrps A pointer to an array of congestion groups 19780aeed3e9SJustin Hibbits id's to consider. 19790aeed3e9SJustin Hibbits 19800aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 19810aeed3e9SJustin Hibbits 19820aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 19830aeed3e9SJustin Hibbits *//***************************************************************************/ 19840aeed3e9SJustin Hibbits t_Error FM_PORT_RemoveCongestionGrps(t_Handle h_FmPort, t_FmPortCongestionGrps *p_CongestionGrps); 19850aeed3e9SJustin Hibbits 19860aeed3e9SJustin Hibbits /**************************************************************************//** 19870aeed3e9SJustin Hibbits @Function FM_PORT_IsStalled 19880aeed3e9SJustin Hibbits 19890aeed3e9SJustin Hibbits @Description A routine for checking whether the specified port is stalled. 19900aeed3e9SJustin Hibbits 19910aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 19920aeed3e9SJustin Hibbits 19930aeed3e9SJustin Hibbits @Return TRUE if port is stalled, FALSE otherwize 19940aeed3e9SJustin Hibbits 19950aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 19960aeed3e9SJustin Hibbits *//***************************************************************************/ 19970aeed3e9SJustin Hibbits bool FM_PORT_IsStalled(t_Handle h_FmPort); 19980aeed3e9SJustin Hibbits 19990aeed3e9SJustin Hibbits /**************************************************************************//** 20000aeed3e9SJustin Hibbits @Function FM_PORT_ReleaseStalled 20010aeed3e9SJustin Hibbits 20020aeed3e9SJustin Hibbits @Description This routine may be called in case the port was stalled and may 20030aeed3e9SJustin Hibbits now be released. 2004*852ba100SJustin Hibbits Note that this routine is available only on older FMan revisions 2005*852ba100SJustin Hibbits (FMan v2, DPAA v1.0 only). 20060aeed3e9SJustin Hibbits 20070aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 20080aeed3e9SJustin Hibbits 20090aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 20100aeed3e9SJustin Hibbits 20110aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 20120aeed3e9SJustin Hibbits *//***************************************************************************/ 20130aeed3e9SJustin Hibbits t_Error FM_PORT_ReleaseStalled(t_Handle h_FmPort); 20140aeed3e9SJustin Hibbits 20150aeed3e9SJustin Hibbits /**************************************************************************//** 20160aeed3e9SJustin Hibbits @Function FM_PORT_SetRxL4ChecksumVerify 20170aeed3e9SJustin Hibbits 20180aeed3e9SJustin Hibbits @Description This routine is relevant for Rx ports (1G and 10G). The routine 20190aeed3e9SJustin Hibbits set/clear the L3/L4 checksum verification (on RX side). 20200aeed3e9SJustin Hibbits Note that this takes affect only if hw-parser is enabled! 20210aeed3e9SJustin Hibbits 20220aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 20230aeed3e9SJustin Hibbits @Param[in] l4Checksum boolean indicates whether to do L3/L4 checksum 20240aeed3e9SJustin Hibbits on frames or not. 20250aeed3e9SJustin Hibbits 20260aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 20270aeed3e9SJustin Hibbits 20280aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 20290aeed3e9SJustin Hibbits *//***************************************************************************/ 20300aeed3e9SJustin Hibbits t_Error FM_PORT_SetRxL4ChecksumVerify(t_Handle h_FmPort, bool l4Checksum); 20310aeed3e9SJustin Hibbits 20320aeed3e9SJustin Hibbits /**************************************************************************//** 20330aeed3e9SJustin Hibbits @Function FM_PORT_SetErrorsRoute 20340aeed3e9SJustin Hibbits 20350aeed3e9SJustin Hibbits @Description Errors selected for this routine will cause a frame with that error 20360aeed3e9SJustin Hibbits to be enqueued to error queue. 20370aeed3e9SJustin Hibbits Errors not selected for this routine will cause a frame with that error 20380aeed3e9SJustin Hibbits to be enqueued to the one of the other port queues. 20390aeed3e9SJustin Hibbits By default all errors are defined to be enqueued to error queue. 20400aeed3e9SJustin Hibbits Errors that were configured to be discarded (at initialization) 20410aeed3e9SJustin Hibbits may not be selected here. 20420aeed3e9SJustin Hibbits 2043*852ba100SJustin Hibbits May be used for Rx and OP ports only 20440aeed3e9SJustin Hibbits 20450aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 20460aeed3e9SJustin Hibbits @Param[in] errs A list of errors to enqueue to error queue 20470aeed3e9SJustin Hibbits 20480aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 20490aeed3e9SJustin Hibbits 20500aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init(). 20510aeed3e9SJustin Hibbits *//***************************************************************************/ 20520aeed3e9SJustin Hibbits t_Error FM_PORT_SetErrorsRoute(t_Handle h_FmPort, fmPortFrameErrSelect_t errs); 20530aeed3e9SJustin Hibbits 20540aeed3e9SJustin Hibbits /**************************************************************************//** 20550aeed3e9SJustin Hibbits @Function FM_PORT_SetIMExceptions 20560aeed3e9SJustin Hibbits 20570aeed3e9SJustin Hibbits @Description Calling this routine enables/disables FM PORT interrupts. 20580aeed3e9SJustin Hibbits 20590aeed3e9SJustin Hibbits @Param[in] h_FmPort FM PORT module descriptor. 20600aeed3e9SJustin Hibbits @Param[in] exception The exception to be selected. 20610aeed3e9SJustin Hibbits @Param[in] enable TRUE to enable interrupt, FALSE to mask it. 20620aeed3e9SJustin Hibbits 20630aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 20640aeed3e9SJustin Hibbits 20650aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 2066*852ba100SJustin Hibbits This routine should NOT be called from guest-partition 2067*852ba100SJustin Hibbits (i.e. guestId != NCSW_MASTER_ID) 20680aeed3e9SJustin Hibbits *//***************************************************************************/ 20690aeed3e9SJustin Hibbits t_Error FM_PORT_SetIMExceptions(t_Handle h_FmPort, e_FmPortExceptions exception, bool enable); 20700aeed3e9SJustin Hibbits 2071*852ba100SJustin Hibbits /**************************************************************************//* 2072*852ba100SJustin Hibbits @Function FM_PORT_SetPerformanceCounters 20730aeed3e9SJustin Hibbits 2074*852ba100SJustin Hibbits @Description Calling this routine enables/disables port's performance counters. 2075*852ba100SJustin Hibbits By default, counters are enabled. 2076*852ba100SJustin Hibbits 2077*852ba100SJustin Hibbits May be used for all port types 2078*852ba100SJustin Hibbits 2079*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 2080*852ba100SJustin Hibbits @Param[in] enable TRUE to enable, FALSE to disable. 2081*852ba100SJustin Hibbits 2082*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 2083*852ba100SJustin Hibbits 2084*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 2085*852ba100SJustin Hibbits *//***************************************************************************/ 2086*852ba100SJustin Hibbits t_Error FM_PORT_SetPerformanceCounters(t_Handle h_FmPort, bool enable); 2087*852ba100SJustin Hibbits 2088*852ba100SJustin Hibbits /**************************************************************************//* 2089*852ba100SJustin Hibbits @Function FM_PORT_SetPerformanceCountersParams 2090*852ba100SJustin Hibbits 2091*852ba100SJustin Hibbits @Description Calling this routine defines port's performance 2092*852ba100SJustin Hibbits counters parameters. 2093*852ba100SJustin Hibbits 2094*852ba100SJustin Hibbits May be used for all port types 2095*852ba100SJustin Hibbits 2096*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 2097*852ba100SJustin Hibbits @Param[in] p_FmPortPerformanceCnt A pointer to a structure of performance 2098*852ba100SJustin Hibbits counters parameters. 2099*852ba100SJustin Hibbits 2100*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 2101*852ba100SJustin Hibbits 2102*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 2103*852ba100SJustin Hibbits *//***************************************************************************/ 2104*852ba100SJustin Hibbits t_Error FM_PORT_SetPerformanceCountersParams(t_Handle h_FmPort, t_FmPortPerformanceCnt *p_FmPortPerformanceCnt); 21050aeed3e9SJustin Hibbits 21060aeed3e9SJustin Hibbits /**************************************************************************//** 21070aeed3e9SJustin Hibbits @Group FM_PORT_pcd_runtime_control_grp FM Port PCD Runtime Control Unit 21080aeed3e9SJustin Hibbits 21090aeed3e9SJustin Hibbits @Description FM Port PCD Runtime control unit API functions, definitions and enums. 21100aeed3e9SJustin Hibbits 21110aeed3e9SJustin Hibbits @{ 21120aeed3e9SJustin Hibbits *//***************************************************************************/ 21130aeed3e9SJustin Hibbits 21140aeed3e9SJustin Hibbits /**************************************************************************//** 21150aeed3e9SJustin Hibbits @Description A structure defining the KG scheme after the parser. 21160aeed3e9SJustin Hibbits This is relevant only to change scheme selection mode - from 21170aeed3e9SJustin Hibbits direct to indirect and vice versa, or when the scheme is selected directly, 21180aeed3e9SJustin Hibbits to select the scheme id. 21190aeed3e9SJustin Hibbits 21200aeed3e9SJustin Hibbits *//***************************************************************************/ 21210aeed3e9SJustin Hibbits typedef struct t_FmPcdKgSchemeSelect { 21220aeed3e9SJustin Hibbits bool direct; /**< TRUE to use 'h_Scheme' directly, FALSE to use LCV. */ 2123*852ba100SJustin Hibbits t_Handle h_DirectScheme; /**< Scheme handle, selects the scheme after parser; 2124*852ba100SJustin Hibbits Relevant only when 'direct' is TRUE. */ 21250aeed3e9SJustin Hibbits } t_FmPcdKgSchemeSelect; 21260aeed3e9SJustin Hibbits 21270aeed3e9SJustin Hibbits /**************************************************************************//** 21280aeed3e9SJustin Hibbits @Description A structure of scheme parameters 21290aeed3e9SJustin Hibbits *//***************************************************************************/ 21300aeed3e9SJustin Hibbits typedef struct t_FmPcdPortSchemesParams { 21310aeed3e9SJustin Hibbits uint8_t numOfSchemes; /**< Number of schemes for port to be bound to. */ 21320aeed3e9SJustin Hibbits t_Handle h_Schemes[FM_PCD_KG_NUM_OF_SCHEMES]; /**< Array of 'numOfSchemes' schemes for the 21330aeed3e9SJustin Hibbits port to be bound to */ 21340aeed3e9SJustin Hibbits } t_FmPcdPortSchemesParams; 21350aeed3e9SJustin Hibbits 21360aeed3e9SJustin Hibbits /**************************************************************************//** 21370aeed3e9SJustin Hibbits @Description Union for defining port protocol parameters for parser 21380aeed3e9SJustin Hibbits *//***************************************************************************/ 21390aeed3e9SJustin Hibbits typedef union u_FmPcdHdrPrsOpts { 21400aeed3e9SJustin Hibbits /* MPLS */ 21410aeed3e9SJustin Hibbits struct { 21420aeed3e9SJustin Hibbits bool labelInterpretationEnable; /**< When this bit is set, the last MPLS label will be 21430aeed3e9SJustin Hibbits interpreted as described in HW spec table. When the bit 21440aeed3e9SJustin Hibbits is cleared, the parser will advance to MPLS next parse */ 21450aeed3e9SJustin Hibbits e_NetHeaderType nextParse; /**< must be equal or higher than IPv4 */ 21460aeed3e9SJustin Hibbits } mplsPrsOptions; 21470aeed3e9SJustin Hibbits /* VLAN */ 21480aeed3e9SJustin Hibbits struct { 21490aeed3e9SJustin Hibbits uint16_t tagProtocolId1; /**< User defined Tag Protocol Identifier, to be recognized 21500aeed3e9SJustin Hibbits on VLAN TAG on top of 0x8100 and 0x88A8 */ 21510aeed3e9SJustin Hibbits uint16_t tagProtocolId2; /**< User defined Tag Protocol Identifier, to be recognized 21520aeed3e9SJustin Hibbits on VLAN TAG on top of 0x8100 and 0x88A8 */ 21530aeed3e9SJustin Hibbits } vlanPrsOptions; 21540aeed3e9SJustin Hibbits /* PPP */ 21550aeed3e9SJustin Hibbits struct{ 21560aeed3e9SJustin Hibbits bool enableMTUCheck; /**< Check validity of MTU according to RFC2516 */ 21570aeed3e9SJustin Hibbits } pppoePrsOptions; 21580aeed3e9SJustin Hibbits 21590aeed3e9SJustin Hibbits /* IPV6 */ 21600aeed3e9SJustin Hibbits struct{ 2161*852ba100SJustin Hibbits bool routingHdrEnable; /**< TRUE to enable routing header, otherwise ignore */ 21620aeed3e9SJustin Hibbits } ipv6PrsOptions; 21630aeed3e9SJustin Hibbits 21640aeed3e9SJustin Hibbits /* UDP */ 21650aeed3e9SJustin Hibbits struct{ 21660aeed3e9SJustin Hibbits bool padIgnoreChecksum; /**< TRUE to ignore pad in checksum */ 21670aeed3e9SJustin Hibbits } udpPrsOptions; 21680aeed3e9SJustin Hibbits 21690aeed3e9SJustin Hibbits /* TCP */ 21700aeed3e9SJustin Hibbits struct { 21710aeed3e9SJustin Hibbits bool padIgnoreChecksum; /**< TRUE to ignore pad in checksum */ 21720aeed3e9SJustin Hibbits } tcpPrsOptions; 21730aeed3e9SJustin Hibbits } u_FmPcdHdrPrsOpts; 21740aeed3e9SJustin Hibbits 21750aeed3e9SJustin Hibbits /**************************************************************************//** 21760aeed3e9SJustin Hibbits @Description A structure for defining each header for the parser 21770aeed3e9SJustin Hibbits *//***************************************************************************/ 21780aeed3e9SJustin Hibbits typedef struct t_FmPcdPrsAdditionalHdrParams { 2179*852ba100SJustin Hibbits e_NetHeaderType hdr; /**< Selected header; use HEADER_TYPE_NONE 2180*852ba100SJustin Hibbits to indicate that sw parser is to run first 2181*852ba100SJustin Hibbits (before HW parser, and independent of the 2182*852ba100SJustin Hibbits existence of any protocol), in this case, 2183*852ba100SJustin Hibbits swPrsEnable must be set, and all other 2184*852ba100SJustin Hibbits parameters are irrelevant. */ 21850aeed3e9SJustin Hibbits bool errDisable; /**< TRUE to disable error indication */ 21860aeed3e9SJustin Hibbits bool swPrsEnable; /**< Enable jump to SW parser when this 21870aeed3e9SJustin Hibbits header is recognized by the HW parser. */ 21880aeed3e9SJustin Hibbits uint8_t indexPerHdr; /**< Normally 0, if more than one sw parser 21890aeed3e9SJustin Hibbits attachments exists for the same header, 21900aeed3e9SJustin Hibbits (in the main sw parser code) use this 21910aeed3e9SJustin Hibbits index to distinguish between them. */ 21920aeed3e9SJustin Hibbits bool usePrsOpts; /**< TRUE to use parser options. */ 21930aeed3e9SJustin Hibbits u_FmPcdHdrPrsOpts prsOpts; /**< A union according to header type, 21940aeed3e9SJustin Hibbits defining the parser options selected.*/ 21950aeed3e9SJustin Hibbits } t_FmPcdPrsAdditionalHdrParams; 21960aeed3e9SJustin Hibbits 21970aeed3e9SJustin Hibbits /**************************************************************************//** 21980aeed3e9SJustin Hibbits @Description struct for defining port PCD parameters 21990aeed3e9SJustin Hibbits *//***************************************************************************/ 22000aeed3e9SJustin Hibbits typedef struct t_FmPortPcdPrsParams { 22010aeed3e9SJustin Hibbits uint8_t prsResultPrivateInfo; /**< The private info provides a method of inserting 22020aeed3e9SJustin Hibbits port information into the parser result. This information 22030aeed3e9SJustin Hibbits may be extracted by Keygen and be used for frames 22040aeed3e9SJustin Hibbits distribution when a per-port distinction is required, 22050aeed3e9SJustin Hibbits it may also be used as a port logical id for analyzing 22060aeed3e9SJustin Hibbits incoming frames. */ 22070aeed3e9SJustin Hibbits uint8_t parsingOffset; /**< Number of bytes from beginning of packet to start parsing */ 22080aeed3e9SJustin Hibbits e_NetHeaderType firstPrsHdr; /**< The type of the first header expected at 'parsingOffset' */ 22090aeed3e9SJustin Hibbits bool includeInPrsStatistics; /**< TRUE to include this port in the parser statistics; 2210*852ba100SJustin Hibbits NOTE: this field is not valid when the FM is in "guest" mode 2211*852ba100SJustin Hibbits and IPC is not available. */ 22120aeed3e9SJustin Hibbits uint8_t numOfHdrsWithAdditionalParams; /**< Normally 0, some headers may get 22130aeed3e9SJustin Hibbits special parameters */ 22140aeed3e9SJustin Hibbits t_FmPcdPrsAdditionalHdrParams additionalParams[FM_PCD_PRS_NUM_OF_HDRS]; 22150aeed3e9SJustin Hibbits /**< 'numOfHdrsWithAdditionalParams' structures 22160aeed3e9SJustin Hibbits of additional parameters 22170aeed3e9SJustin Hibbits for each header that requires them */ 22180aeed3e9SJustin Hibbits bool setVlanTpid1; /**< TRUE to configure user selection of Ethertype to 22190aeed3e9SJustin Hibbits indicate a VLAN tag (in addition to the TPID values 22200aeed3e9SJustin Hibbits 0x8100 and 0x88A8). */ 22210aeed3e9SJustin Hibbits uint16_t vlanTpid1; /**< extra tag to use if setVlanTpid1=TRUE. */ 22220aeed3e9SJustin Hibbits bool setVlanTpid2; /**< TRUE to configure user selection of Ethertype to 22230aeed3e9SJustin Hibbits indicate a VLAN tag (in addition to the TPID values 22240aeed3e9SJustin Hibbits 0x8100 and 0x88A8). */ 22250aeed3e9SJustin Hibbits uint16_t vlanTpid2; /**< extra tag to use if setVlanTpid1=TRUE. */ 22260aeed3e9SJustin Hibbits } t_FmPortPcdPrsParams; 22270aeed3e9SJustin Hibbits 22280aeed3e9SJustin Hibbits /**************************************************************************//** 22290aeed3e9SJustin Hibbits @Description struct for defining coarse alassification parameters 22300aeed3e9SJustin Hibbits *//***************************************************************************/ 22310aeed3e9SJustin Hibbits typedef struct t_FmPortPcdCcParams { 22320aeed3e9SJustin Hibbits t_Handle h_CcTree; /**< A handle to a CC tree */ 22330aeed3e9SJustin Hibbits } t_FmPortPcdCcParams; 22340aeed3e9SJustin Hibbits 22350aeed3e9SJustin Hibbits /**************************************************************************//** 22360aeed3e9SJustin Hibbits @Description struct for defining keygen parameters 22370aeed3e9SJustin Hibbits *//***************************************************************************/ 22380aeed3e9SJustin Hibbits typedef struct t_FmPortPcdKgParams { 22390aeed3e9SJustin Hibbits uint8_t numOfSchemes; /**< Number of schemes for port to be bound to. */ 22400aeed3e9SJustin Hibbits t_Handle h_Schemes[FM_PCD_KG_NUM_OF_SCHEMES]; 22410aeed3e9SJustin Hibbits /**< Array of 'numOfSchemes' schemes handles for the 22420aeed3e9SJustin Hibbits port to be bound to */ 22430aeed3e9SJustin Hibbits bool directScheme; /**< TRUE for going from parser to a specific scheme, 22440aeed3e9SJustin Hibbits regardless of parser result */ 22450aeed3e9SJustin Hibbits t_Handle h_DirectScheme; /**< relevant only if direct == TRUE, Scheme handle, 22460aeed3e9SJustin Hibbits as returned by FM_PCD_KgSetScheme */ 22470aeed3e9SJustin Hibbits } t_FmPortPcdKgParams; 22480aeed3e9SJustin Hibbits 22490aeed3e9SJustin Hibbits /**************************************************************************//** 22500aeed3e9SJustin Hibbits @Description struct for defining policer parameters 22510aeed3e9SJustin Hibbits *//***************************************************************************/ 22520aeed3e9SJustin Hibbits typedef struct t_FmPortPcdPlcrParams { 2253*852ba100SJustin Hibbits t_Handle h_Profile; /**< Selected profile handle */ 22540aeed3e9SJustin Hibbits } t_FmPortPcdPlcrParams; 22550aeed3e9SJustin Hibbits 22560aeed3e9SJustin Hibbits /**************************************************************************//** 22570aeed3e9SJustin Hibbits @Description struct for defining port PCD parameters 22580aeed3e9SJustin Hibbits *//***************************************************************************/ 22590aeed3e9SJustin Hibbits typedef struct t_FmPortPcdParams { 22600aeed3e9SJustin Hibbits e_FmPortPcdSupport pcdSupport; /**< Relevant for Rx and offline ports only. 22610aeed3e9SJustin Hibbits Describes the active PCD engines for this port. */ 22620aeed3e9SJustin Hibbits t_Handle h_NetEnv; /**< HL Unused in PLCR only mode */ 22630aeed3e9SJustin Hibbits t_FmPortPcdPrsParams *p_PrsParams; /**< Parser parameters for this port */ 22640aeed3e9SJustin Hibbits t_FmPortPcdCcParams *p_CcParams; /**< Coarse classification parameters for this port */ 22650aeed3e9SJustin Hibbits t_FmPortPcdKgParams *p_KgParams; /**< Keygen parameters for this port */ 2266*852ba100SJustin Hibbits t_FmPortPcdPlcrParams *p_PlcrParams; /**< Policer parameters for this port; Relevant for one of 2267*852ba100SJustin Hibbits following cases: 2268*852ba100SJustin Hibbits e_FM_PORT_PCD_SUPPORT_PLCR_ONLY or 2269*852ba100SJustin Hibbits e_FM_PORT_PCD_SUPPORT_PRS_AND_PLCR were selected, 2270*852ba100SJustin Hibbits or if any flow uses a KG scheme were policer 2271*852ba100SJustin Hibbits profile is not generated 2272*852ba100SJustin Hibbits ('bypassPlcrProfileGeneration selected'). */ 2273*852ba100SJustin Hibbits t_Handle h_IpReassemblyManip; /**< IP Reassembly manipulation */ 2274*852ba100SJustin Hibbits #if (DPAA_VERSION >= 11) 2275*852ba100SJustin Hibbits t_Handle h_CapwapReassemblyManip;/**< CAPWAP Reassembly manipulation */ 2276*852ba100SJustin Hibbits #endif /* (DPAA_VERSION >= 11) */ 22770aeed3e9SJustin Hibbits } t_FmPortPcdParams; 22780aeed3e9SJustin Hibbits 22790aeed3e9SJustin Hibbits /**************************************************************************//** 22800aeed3e9SJustin Hibbits @Description A structure for defining the Parser starting point 22810aeed3e9SJustin Hibbits *//***************************************************************************/ 22820aeed3e9SJustin Hibbits typedef struct t_FmPcdPrsStart { 22830aeed3e9SJustin Hibbits uint8_t parsingOffset; /**< Number of bytes from beginning of packet to 22840aeed3e9SJustin Hibbits start parsing */ 22850aeed3e9SJustin Hibbits e_NetHeaderType firstPrsHdr; /**< The type of the first header axpected at 22860aeed3e9SJustin Hibbits 'parsingOffset' */ 22870aeed3e9SJustin Hibbits } t_FmPcdPrsStart; 22880aeed3e9SJustin Hibbits 2289*852ba100SJustin Hibbits #if (DPAA_VERSION >= 11) 2290*852ba100SJustin Hibbits /**************************************************************************//** 2291*852ba100SJustin Hibbits @Description struct for defining external buffer margins 2292*852ba100SJustin Hibbits *//***************************************************************************/ 2293*852ba100SJustin Hibbits typedef struct t_FmPortVSPAllocParams { 2294*852ba100SJustin Hibbits uint8_t numOfProfiles; /**< Number of Virtual Storage Profiles; must be a power of 2 */ 2295*852ba100SJustin Hibbits uint8_t dfltRelativeId; /**< The default Virtual-Storage-Profile-id dedicated to Rx/OP port 2296*852ba100SJustin Hibbits The same default Virtual-Storage-Profile-id will be for coupled Tx port 2297*852ba100SJustin Hibbits if relevant function called for Rx port */ 2298*852ba100SJustin Hibbits t_Handle h_FmTxPort; /**< Handle to coupled Tx Port; not relevant for OP port. */ 2299*852ba100SJustin Hibbits } t_FmPortVSPAllocParams; 2300*852ba100SJustin Hibbits #endif /* (DPAA_VERSION >= 11) */ 2301*852ba100SJustin Hibbits 23020aeed3e9SJustin Hibbits 23030aeed3e9SJustin Hibbits /**************************************************************************//** 23040aeed3e9SJustin Hibbits @Function FM_PORT_SetPCD 23050aeed3e9SJustin Hibbits 23060aeed3e9SJustin Hibbits @Description Calling this routine defines the port's PCD configuration. 23070aeed3e9SJustin Hibbits It changes it from its default configuration which is PCD 23080aeed3e9SJustin Hibbits disabled (BMI to BMI) and configures it according to the passed 23090aeed3e9SJustin Hibbits parameters. 23100aeed3e9SJustin Hibbits 2311*852ba100SJustin Hibbits May be used for Rx and OP ports only 23120aeed3e9SJustin Hibbits 23130aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 23140aeed3e9SJustin Hibbits @Param[in] p_FmPortPcd A Structure of parameters defining the port's PCD 23150aeed3e9SJustin Hibbits configuration. 23160aeed3e9SJustin Hibbits 23170aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 23180aeed3e9SJustin Hibbits 23190aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 23200aeed3e9SJustin Hibbits *//***************************************************************************/ 23210aeed3e9SJustin Hibbits t_Error FM_PORT_SetPCD(t_Handle h_FmPort, t_FmPortPcdParams *p_FmPortPcd); 23220aeed3e9SJustin Hibbits 23230aeed3e9SJustin Hibbits /**************************************************************************//** 23240aeed3e9SJustin Hibbits @Function FM_PORT_DeletePCD 23250aeed3e9SJustin Hibbits 23260aeed3e9SJustin Hibbits @Description Calling this routine releases the port's PCD configuration. 23270aeed3e9SJustin Hibbits The port returns to its default configuration which is PCD 23280aeed3e9SJustin Hibbits disabled (BMI to BMI) and all PCD configuration is removed. 23290aeed3e9SJustin Hibbits 2330*852ba100SJustin Hibbits May be used for Rx and OP ports which are 23310aeed3e9SJustin Hibbits in PCD mode only 23320aeed3e9SJustin Hibbits 23330aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 23340aeed3e9SJustin Hibbits 23350aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 23360aeed3e9SJustin Hibbits 23370aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 23380aeed3e9SJustin Hibbits *//***************************************************************************/ 23390aeed3e9SJustin Hibbits t_Error FM_PORT_DeletePCD(t_Handle h_FmPort); 23400aeed3e9SJustin Hibbits 23410aeed3e9SJustin Hibbits /**************************************************************************//** 23420aeed3e9SJustin Hibbits @Function FM_PORT_AttachPCD 23430aeed3e9SJustin Hibbits 23440aeed3e9SJustin Hibbits @Description This routine may be called after FM_PORT_DetachPCD was called, 23450aeed3e9SJustin Hibbits to return to the originally configured PCD support flow. 23460aeed3e9SJustin Hibbits The couple of routines are used to allow PCD configuration changes 23470aeed3e9SJustin Hibbits that demand that PCD will not be used while changes take place. 23480aeed3e9SJustin Hibbits 2349*852ba100SJustin Hibbits May be used for Rx and OP ports which are 23500aeed3e9SJustin Hibbits in PCD mode only 23510aeed3e9SJustin Hibbits 23520aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 23530aeed3e9SJustin Hibbits 23540aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 23550aeed3e9SJustin Hibbits 23560aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 23570aeed3e9SJustin Hibbits *//***************************************************************************/ 23580aeed3e9SJustin Hibbits t_Error FM_PORT_AttachPCD(t_Handle h_FmPort); 23590aeed3e9SJustin Hibbits 23600aeed3e9SJustin Hibbits /**************************************************************************//** 23610aeed3e9SJustin Hibbits @Function FM_PORT_DetachPCD 23620aeed3e9SJustin Hibbits 23630aeed3e9SJustin Hibbits @Description Calling this routine detaches the port from its PCD functionality. 23640aeed3e9SJustin Hibbits The port returns to its default flow which is BMI to BMI. 23650aeed3e9SJustin Hibbits 2366*852ba100SJustin Hibbits May be used for Rx and OP ports which are 23670aeed3e9SJustin Hibbits in PCD mode only 23680aeed3e9SJustin Hibbits 23690aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 23700aeed3e9SJustin Hibbits 23710aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 23720aeed3e9SJustin Hibbits 23730aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_AttachPCD(). 23740aeed3e9SJustin Hibbits *//***************************************************************************/ 23750aeed3e9SJustin Hibbits t_Error FM_PORT_DetachPCD(t_Handle h_FmPort); 23760aeed3e9SJustin Hibbits 23770aeed3e9SJustin Hibbits /**************************************************************************//** 23780aeed3e9SJustin Hibbits @Function FM_PORT_PcdPlcrAllocProfiles 23790aeed3e9SJustin Hibbits 23800aeed3e9SJustin Hibbits @Description This routine may be called only for ports that use the Policer in 23810aeed3e9SJustin Hibbits order to allocate private policer profiles. 23820aeed3e9SJustin Hibbits 23830aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 23840aeed3e9SJustin Hibbits @Param[in] numOfProfiles The number of required policer profiles 23850aeed3e9SJustin Hibbits 23860aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 23870aeed3e9SJustin Hibbits 2388*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Init() and FM_PCD_Init(), 2389*852ba100SJustin Hibbits and before FM_PORT_SetPCD(). 23900aeed3e9SJustin Hibbits *//***************************************************************************/ 23910aeed3e9SJustin Hibbits t_Error FM_PORT_PcdPlcrAllocProfiles(t_Handle h_FmPort, uint16_t numOfProfiles); 23920aeed3e9SJustin Hibbits 23930aeed3e9SJustin Hibbits /**************************************************************************//** 23940aeed3e9SJustin Hibbits @Function FM_PORT_PcdPlcrFreeProfiles 23950aeed3e9SJustin Hibbits 23960aeed3e9SJustin Hibbits @Description This routine should be called for freeing private policer profiles. 23970aeed3e9SJustin Hibbits 23980aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 23990aeed3e9SJustin Hibbits 24000aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 24010aeed3e9SJustin Hibbits 2402*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Init() and FM_PCD_Init(), 2403*852ba100SJustin Hibbits and before FM_PORT_SetPCD(). 24040aeed3e9SJustin Hibbits *//***************************************************************************/ 24050aeed3e9SJustin Hibbits t_Error FM_PORT_PcdPlcrFreeProfiles(t_Handle h_FmPort); 24060aeed3e9SJustin Hibbits 2407*852ba100SJustin Hibbits #if (DPAA_VERSION >= 11) 2408*852ba100SJustin Hibbits /**************************************************************************//** 2409*852ba100SJustin Hibbits @Function FM_PORT_VSPAlloc 2410*852ba100SJustin Hibbits 2411*852ba100SJustin Hibbits @Description This routine allocated VSPs per port and forces the port to work 2412*852ba100SJustin Hibbits in VSP mode. Note that the port is initialized by default with the 2413*852ba100SJustin Hibbits physical-storage-profile only. 2414*852ba100SJustin Hibbits 2415*852ba100SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 2416*852ba100SJustin Hibbits @Param[in] p_Params A structure of parameters for allocation VSP's per port 2417*852ba100SJustin Hibbits 2418*852ba100SJustin Hibbits @Return E_OK on success; Error code otherwise. 2419*852ba100SJustin Hibbits 2420*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(), and before FM_PORT_SetPCD() 2421*852ba100SJustin Hibbits and also before FM_PORT_Enable(); i.e. the port should be disabled. 2422*852ba100SJustin Hibbits *//***************************************************************************/ 2423*852ba100SJustin Hibbits t_Error FM_PORT_VSPAlloc(t_Handle h_FmPort, t_FmPortVSPAllocParams *p_Params); 2424*852ba100SJustin Hibbits #endif /* (DPAA_VERSION >= 11) */ 2425*852ba100SJustin Hibbits 24260aeed3e9SJustin Hibbits /**************************************************************************//** 24270aeed3e9SJustin Hibbits @Function FM_PORT_PcdKgModifyInitialScheme 24280aeed3e9SJustin Hibbits 24290aeed3e9SJustin Hibbits @Description This routine may be called only for ports that use the keygen in 24300aeed3e9SJustin Hibbits order to change the initial scheme frame should be routed to. 24310aeed3e9SJustin Hibbits The change may be of a scheme id (in case of direct mode), 24320aeed3e9SJustin Hibbits from direct to indirect, or from indirect to direct - specifying the scheme id. 24330aeed3e9SJustin Hibbits 24340aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 24350aeed3e9SJustin Hibbits @Param[in] p_FmPcdKgScheme A structure of parameters for defining whether 24360aeed3e9SJustin Hibbits a scheme is direct/indirect, and if direct - scheme id. 24370aeed3e9SJustin Hibbits 24380aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 24390aeed3e9SJustin Hibbits 24400aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD(). 24410aeed3e9SJustin Hibbits *//***************************************************************************/ 24420aeed3e9SJustin Hibbits t_Error FM_PORT_PcdKgModifyInitialScheme (t_Handle h_FmPort, t_FmPcdKgSchemeSelect *p_FmPcdKgScheme); 24430aeed3e9SJustin Hibbits 24440aeed3e9SJustin Hibbits /**************************************************************************//** 24450aeed3e9SJustin Hibbits @Function FM_PORT_PcdPlcrModifyInitialProfile 24460aeed3e9SJustin Hibbits 24470aeed3e9SJustin Hibbits @Description This routine may be called for ports with flows 24480aeed3e9SJustin Hibbits e_FM_PORT_PCD_SUPPORT_PLCR_ONLY or e_FM_PORT_PCD_SUPPORT_PRS_AND_PLCR 24490aeed3e9SJustin Hibbits only, to change the initial Policer profile frame should be 24500aeed3e9SJustin Hibbits routed to. The change may be of a profile and/or absolute/direct 24510aeed3e9SJustin Hibbits mode selection. 24520aeed3e9SJustin Hibbits 24530aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 24540aeed3e9SJustin Hibbits @Param[in] h_Profile Policer profile handle 24550aeed3e9SJustin Hibbits 24560aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 24570aeed3e9SJustin Hibbits 24580aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD(). 24590aeed3e9SJustin Hibbits *//***************************************************************************/ 24600aeed3e9SJustin Hibbits t_Error FM_PORT_PcdPlcrModifyInitialProfile (t_Handle h_FmPort, t_Handle h_Profile); 24610aeed3e9SJustin Hibbits 24620aeed3e9SJustin Hibbits /**************************************************************************//** 24630aeed3e9SJustin Hibbits @Function FM_PORT_PcdCcModifyTree 24640aeed3e9SJustin Hibbits 24650aeed3e9SJustin Hibbits @Description This routine may be called for ports that use coarse classification tree 24660aeed3e9SJustin Hibbits if the user wishes to replace the tree. The routine may not be called while port 24670aeed3e9SJustin Hibbits receives packets using the PCD functionalities, therefor port must be first detached 24680aeed3e9SJustin Hibbits from the PCD, only than the routine may be called, and than port be attached to PCD again. 24690aeed3e9SJustin Hibbits 24700aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 24710aeed3e9SJustin Hibbits @Param[in] h_CcTree A CC tree that was already built. The tree id as returned from 24720aeed3e9SJustin Hibbits the BuildTree routine. 24730aeed3e9SJustin Hibbits 24740aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 24750aeed3e9SJustin Hibbits 24760aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(), FM_PORT_SetPCD() and FM_PORT_DetachPCD() 24770aeed3e9SJustin Hibbits *//***************************************************************************/ 24780aeed3e9SJustin Hibbits t_Error FM_PORT_PcdCcModifyTree (t_Handle h_FmPort, t_Handle h_CcTree); 24790aeed3e9SJustin Hibbits 24800aeed3e9SJustin Hibbits /**************************************************************************//** 24810aeed3e9SJustin Hibbits @Function FM_PORT_PcdKgBindSchemes 24820aeed3e9SJustin Hibbits 24830aeed3e9SJustin Hibbits @Description These routines may be called for adding more schemes for the 24840aeed3e9SJustin Hibbits port to be bound to. The selected schemes are not added, 24850aeed3e9SJustin Hibbits just this specific port starts using them. 24860aeed3e9SJustin Hibbits 24870aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 24880aeed3e9SJustin Hibbits @Param[in] p_PortScheme A structure defining the list of schemes to be added. 24890aeed3e9SJustin Hibbits 24900aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 24910aeed3e9SJustin Hibbits 24920aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD(). 24930aeed3e9SJustin Hibbits *//***************************************************************************/ 24940aeed3e9SJustin Hibbits t_Error FM_PORT_PcdKgBindSchemes (t_Handle h_FmPort, t_FmPcdPortSchemesParams *p_PortScheme); 24950aeed3e9SJustin Hibbits 24960aeed3e9SJustin Hibbits /**************************************************************************//** 24970aeed3e9SJustin Hibbits @Function FM_PORT_PcdKgUnbindSchemes 24980aeed3e9SJustin Hibbits 24990aeed3e9SJustin Hibbits @Description These routines may be called for adding more schemes for the 25000aeed3e9SJustin Hibbits port to be bound to. The selected schemes are not removed or invalidated, 25010aeed3e9SJustin Hibbits just this specific port stops using them. 25020aeed3e9SJustin Hibbits 25030aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 25040aeed3e9SJustin Hibbits @Param[in] p_PortScheme A structure defining the list of schemes to be added. 25050aeed3e9SJustin Hibbits 25060aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 25070aeed3e9SJustin Hibbits 25080aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD(). 25090aeed3e9SJustin Hibbits *//***************************************************************************/ 25100aeed3e9SJustin Hibbits t_Error FM_PORT_PcdKgUnbindSchemes (t_Handle h_FmPort, t_FmPcdPortSchemesParams *p_PortScheme); 25110aeed3e9SJustin Hibbits 25120aeed3e9SJustin Hibbits /**************************************************************************//** 2513*852ba100SJustin Hibbits @Function FM_PORT_GetIPv4OptionsCount 25140aeed3e9SJustin Hibbits 2515*852ba100SJustin Hibbits @Description TODO 2516*852ba100SJustin Hibbits 25170aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 2518*852ba100SJustin Hibbits @Param[out] p_Ipv4OptionsCount will hold the counter value 25190aeed3e9SJustin Hibbits 25200aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 25210aeed3e9SJustin Hibbits 2522*852ba100SJustin Hibbits @Cautions Allowed only following FM_PORT_Init() 25230aeed3e9SJustin Hibbits *//***************************************************************************/ 2524*852ba100SJustin Hibbits t_Error FM_PORT_GetIPv4OptionsCount(t_Handle h_FmPort, uint32_t *p_Ipv4OptionsCount); 25250aeed3e9SJustin Hibbits 25260aeed3e9SJustin Hibbits /** @} */ /* end of FM_PORT_pcd_runtime_control_grp group */ 25270aeed3e9SJustin Hibbits /** @} */ /* end of FM_PORT_runtime_control_grp group */ 25280aeed3e9SJustin Hibbits 25290aeed3e9SJustin Hibbits 25300aeed3e9SJustin Hibbits /**************************************************************************//** 25310aeed3e9SJustin Hibbits @Group FM_PORT_runtime_data_grp FM Port Runtime Data-path Unit 25320aeed3e9SJustin Hibbits 25330aeed3e9SJustin Hibbits @Description FM Port Runtime data unit API functions, definitions and enums. 25340aeed3e9SJustin Hibbits This API is valid only if working in Independent-Mode. 25350aeed3e9SJustin Hibbits 25360aeed3e9SJustin Hibbits @{ 25370aeed3e9SJustin Hibbits *//***************************************************************************/ 25380aeed3e9SJustin Hibbits 25390aeed3e9SJustin Hibbits /**************************************************************************//** 25400aeed3e9SJustin Hibbits @Function FM_PORT_ImTx 25410aeed3e9SJustin Hibbits 25420aeed3e9SJustin Hibbits @Description Tx function, called to transmit a data buffer on the port. 25430aeed3e9SJustin Hibbits 25440aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 25450aeed3e9SJustin Hibbits @Param[in] p_Data A pointer to an LCP data buffer. 25460aeed3e9SJustin Hibbits @Param[in] length Size of data for transmission. 25470aeed3e9SJustin Hibbits @Param[in] lastBuffer Buffer position - TRUE for the last buffer 25480aeed3e9SJustin Hibbits of a frame, including a single buffer frame 25490aeed3e9SJustin Hibbits @Param[in] h_BufContext A handle of the user acossiated with this buffer 25500aeed3e9SJustin Hibbits 25510aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 25520aeed3e9SJustin Hibbits 25530aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 25540aeed3e9SJustin Hibbits NOTE - This routine can be used only when working in 25550aeed3e9SJustin Hibbits Independent-Mode mode. 25560aeed3e9SJustin Hibbits *//***************************************************************************/ 25570aeed3e9SJustin Hibbits t_Error FM_PORT_ImTx( t_Handle h_FmPort, 25580aeed3e9SJustin Hibbits uint8_t *p_Data, 25590aeed3e9SJustin Hibbits uint16_t length, 25600aeed3e9SJustin Hibbits bool lastBuffer, 25610aeed3e9SJustin Hibbits t_Handle h_BufContext); 25620aeed3e9SJustin Hibbits 25630aeed3e9SJustin Hibbits /**************************************************************************//** 25640aeed3e9SJustin Hibbits @Function FM_PORT_ImTxConf 25650aeed3e9SJustin Hibbits 25660aeed3e9SJustin Hibbits @Description Tx port confirmation routine, optional, may be called to verify 25670aeed3e9SJustin Hibbits transmission of all frames. The procedure performed by this 25680aeed3e9SJustin Hibbits routine will be performed automatically on next buffer transmission, 25690aeed3e9SJustin Hibbits but if desired, calling this routine will invoke this action on 25700aeed3e9SJustin Hibbits demand. 25710aeed3e9SJustin Hibbits 25720aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 25730aeed3e9SJustin Hibbits 25740aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 25750aeed3e9SJustin Hibbits NOTE - This routine can be used only when working in 25760aeed3e9SJustin Hibbits Independent-Mode mode. 25770aeed3e9SJustin Hibbits *//***************************************************************************/ 25780aeed3e9SJustin Hibbits void FM_PORT_ImTxConf(t_Handle h_FmPort); 25790aeed3e9SJustin Hibbits 25800aeed3e9SJustin Hibbits /**************************************************************************//** 25810aeed3e9SJustin Hibbits @Function FM_PORT_ImRx 25820aeed3e9SJustin Hibbits 25830aeed3e9SJustin Hibbits @Description Rx function, may be called to poll for received buffers. 25840aeed3e9SJustin Hibbits Normally, Rx process is invoked by the driver on Rx interrupt. 25850aeed3e9SJustin Hibbits Alternatively, this routine may be called on demand. 25860aeed3e9SJustin Hibbits 25870aeed3e9SJustin Hibbits @Param[in] h_FmPort A handle to a FM Port module. 25880aeed3e9SJustin Hibbits 25890aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 25900aeed3e9SJustin Hibbits 25910aeed3e9SJustin Hibbits @Cautions Allowed only following FM_PORT_Init(). 25920aeed3e9SJustin Hibbits NOTE - This routine can be used only when working in 25930aeed3e9SJustin Hibbits Independent-Mode mode. 25940aeed3e9SJustin Hibbits *//***************************************************************************/ 25950aeed3e9SJustin Hibbits t_Error FM_PORT_ImRx(t_Handle h_FmPort); 25960aeed3e9SJustin Hibbits 25970aeed3e9SJustin Hibbits /** @} */ /* end of FM_PORT_runtime_data_grp group */ 25980aeed3e9SJustin Hibbits /** @} */ /* end of FM_PORT_grp group */ 25990aeed3e9SJustin Hibbits /** @} */ /* end of FM_grp group */ 26000aeed3e9SJustin Hibbits 26010aeed3e9SJustin Hibbits 26020aeed3e9SJustin Hibbits 2603*852ba100SJustin Hibbits #ifdef NCSW_BACKWARD_COMPATIBLE_API 2604*852ba100SJustin Hibbits #define FM_PORT_ConfigTxFifoDeqPipelineDepth FM_PORT_ConfigFifoDeqPipelineDepth 2605*852ba100SJustin Hibbits #endif /* NCSW_BACKWARD_COMPATIBLE_API */ 2606*852ba100SJustin Hibbits 26070aeed3e9SJustin Hibbits 26080aeed3e9SJustin Hibbits #endif /* __FM_PORT_EXT */ 2609