Path: blob/main/sys/contrib/ncsw/inc/Peripherals/fm_port_ext.h
48375 views
/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc.1* All rights reserved.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/313233/**************************************************************************//**34@File fm_port_ext.h3536@Description FM-Port Application Programming Interface.37*//***************************************************************************/38#ifndef __FM_PORT_EXT39#define __FM_PORT_EXT4041#include "error_ext.h"42#include "std_ext.h"43#include "fm_pcd_ext.h"44#include "fm_ext.h"45#include "net_ext.h"464748/**************************************************************************//**4950@Group FM_grp Frame Manager API5152@Description FM API functions, definitions and enums5354@{55*//***************************************************************************/5657/**************************************************************************//**58@Group FM_PORT_grp FM Port5960@Description FM Port API6162The FM uses a general module called "port" to represent a Tx port63(MAC), an Rx port (MAC) or Offline Parsing port.64The number of ports in an FM varies between SOCs.65The SW driver manages these ports as sub-modules of the FM, i.e.66after an FM is initialized, its ports may be initialized and67operated upon.6869The port is initialized aware of its type, but other functions on70a port may be indifferent to its type. When necessary, the driver71verifies coherence and returns error if applicable.7273On initialization, user specifies the port type and it's index74(relative to the port's type) - always starting at 0.7576@{77*//***************************************************************************/7879/**************************************************************************//**80@Description An enum for defining port PCD modes.81This enum defines the superset of PCD engines support - i.e. not82all engines have to be used, but all have to be enabled. The real83flow of a specific frame depends on the PCD configuration and the84frame headers and payload.85Note: the first engine and the first engine after the parser (if86exists) should be in order, the order is important as it will87define the flow of the port. However, as for the rest engines88(the ones that follows), the order is not important anymore as89it is defined by the PCD graph itself.90*//***************************************************************************/91typedef enum e_FmPortPcdSupport {92e_FM_PORT_PCD_SUPPORT_NONE = 0 /**< BMI to BMI, PCD is not used */93, e_FM_PORT_PCD_SUPPORT_PRS_ONLY /**< Use only Parser */94, e_FM_PORT_PCD_SUPPORT_PLCR_ONLY /**< Use only Policer */95, e_FM_PORT_PCD_SUPPORT_PRS_AND_PLCR /**< Use Parser and Policer */96, e_FM_PORT_PCD_SUPPORT_PRS_AND_KG /**< Use Parser and Keygen */97, e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_CC /**< Use Parser, Keygen and Coarse Classification */98, e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_CC_AND_PLCR99/**< Use all PCD engines */100, e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_PLCR /**< Use Parser, Keygen and Policer */101, e_FM_PORT_PCD_SUPPORT_PRS_AND_CC /**< Use Parser and Coarse Classification */102, e_FM_PORT_PCD_SUPPORT_PRS_AND_CC_AND_PLCR /**< Use Parser and Coarse Classification and Policer */103, e_FM_PORT_PCD_SUPPORT_CC_ONLY /**< Use only Coarse Classification */104#ifdef FM_CAPWAP_SUPPORT105, e_FM_PORT_PCD_SUPPORT_CC_AND_KG /**< Use Coarse Classification,and Keygen */106, e_FM_PORT_PCD_SUPPORT_CC_AND_KG_AND_PLCR /**< Use Coarse Classification, Keygen and Policer */107#endif /* FM_CAPWAP_SUPPORT */108} e_FmPortPcdSupport;109110/**************************************************************************//**111@Description Port interrupts112*//***************************************************************************/113typedef enum e_FmPortExceptions {114e_FM_PORT_EXCEPTION_IM_BUSY /**< Independent-Mode Rx-BUSY */115} e_FmPortExceptions;116117118/**************************************************************************//**119@Collection General FM Port defines120*//***************************************************************************/121#define FM_PORT_PRS_RESULT_NUM_OF_WORDS 8 /**< Number of 4 bytes words in parser result */122/* @} */123124/**************************************************************************//**125@Collection FM Frame error126*//***************************************************************************/127typedef uint32_t fmPortFrameErrSelect_t; /**< typedef for defining Frame Descriptor errors */128129#define FM_PORT_FRM_ERR_UNSUPPORTED_FORMAT FM_FD_ERR_UNSUPPORTED_FORMAT /**< Not for Rx-Port! Unsupported Format */130#define FM_PORT_FRM_ERR_LENGTH FM_FD_ERR_LENGTH /**< Not for Rx-Port! Length Error */131#define FM_PORT_FRM_ERR_DMA FM_FD_ERR_DMA /**< DMA Data error */132#define FM_PORT_FRM_ERR_NON_FM FM_FD_RX_STATUS_ERR_NON_FM /**< non Frame-Manager error; probably come from SEC that133was chained to FM */134135#define FM_PORT_FRM_ERR_IPRE (FM_FD_ERR_IPR & ~FM_FD_IPR) /**< IPR error */136#define FM_PORT_FRM_ERR_IPR_NCSP (FM_FD_ERR_IPR_NCSP & ~FM_FD_IPR) /**< IPR non-consistent-sp */137138#define FM_PORT_FRM_ERR_IPFE 0 /**< Obsolete; will be removed in the future */139140#ifdef FM_CAPWAP_SUPPORT141#define FM_PORT_FRM_ERR_CRE FM_FD_ERR_CRE142#define FM_PORT_FRM_ERR_CHE FM_FD_ERR_CHE143#endif /* FM_CAPWAP_SUPPORT */144145#define FM_PORT_FRM_ERR_PHYSICAL FM_FD_ERR_PHYSICAL /**< Rx FIFO overflow, FCS error, code error, running disparity146error (SGMII and TBI modes), FIFO parity error. PHY147Sequence error, PHY error control character detected. */148#define FM_PORT_FRM_ERR_SIZE FM_FD_ERR_SIZE /**< Frame too long OR Frame size exceeds max_length_frame */149#define FM_PORT_FRM_ERR_CLS_DISCARD FM_FD_ERR_CLS_DISCARD /**< indicates a classifier "drop" operation */150#define FM_PORT_FRM_ERR_EXTRACTION FM_FD_ERR_EXTRACTION /**< Extract Out of Frame */151#define FM_PORT_FRM_ERR_NO_SCHEME FM_FD_ERR_NO_SCHEME /**< No Scheme Selected */152#define FM_PORT_FRM_ERR_KEYSIZE_OVERFLOW FM_FD_ERR_KEYSIZE_OVERFLOW /**< Keysize Overflow */153#define FM_PORT_FRM_ERR_COLOR_RED FM_FD_ERR_COLOR_RED /**< Frame color is red */154#define FM_PORT_FRM_ERR_COLOR_YELLOW FM_FD_ERR_COLOR_YELLOW /**< Frame color is yellow */155#define FM_PORT_FRM_ERR_ILL_PLCR FM_FD_ERR_ILL_PLCR /**< Illegal Policer Profile selected */156#define FM_PORT_FRM_ERR_PLCR_FRAME_LEN FM_FD_ERR_PLCR_FRAME_LEN /**< Policer frame length error */157#define FM_PORT_FRM_ERR_PRS_TIMEOUT FM_FD_ERR_PRS_TIMEOUT /**< Parser Time out Exceed */158#define FM_PORT_FRM_ERR_PRS_ILL_INSTRUCT FM_FD_ERR_PRS_ILL_INSTRUCT /**< Invalid Soft Parser instruction */159#define FM_PORT_FRM_ERR_PRS_HDR_ERR FM_FD_ERR_PRS_HDR_ERR /**< Header error was identified during parsing */160#define FM_PORT_FRM_ERR_BLOCK_LIMIT_EXCEEDED FM_FD_ERR_BLOCK_LIMIT_EXCEEDED /**< Frame parsed beyind 256 first bytes */161#define FM_PORT_FRM_ERR_PROCESS_TIMEOUT 0x00000001 /**< FPM Frame Processing Timeout Exceeded */162/* @} */163164165166/**************************************************************************//**167@Group FM_PORT_init_grp FM Port Initialization Unit168169@Description FM Port Initialization Unit170171@{172*//***************************************************************************/173174/**************************************************************************//**175@Description Exceptions user callback routine, will be called upon an176exception passing the exception identification.177178@Param[in] h_App - User's application descriptor.179@Param[in] exception - The exception.180*//***************************************************************************/181typedef void (t_FmPortExceptionCallback) (t_Handle h_App, e_FmPortExceptions exception);182183/**************************************************************************//**184@Description User callback function called by driver with received data.185186User provides this function. Driver invokes it.187188@Param[in] h_App Application's handle originally specified to189the API Config function190@Param[in] p_Data A pointer to data received191@Param[in] length length of received data192@Param[in] status receive status and errors193@Param[in] position position of buffer in frame194@Param[in] h_BufContext A handle of the user acossiated with this buffer195196@Retval e_RX_STORE_RESPONSE_CONTINUE - order the driver to continue Rx197operation for all ready data.198@Retval e_RX_STORE_RESPONSE_PAUSE - order the driver to stop Rx operation.199*//***************************************************************************/200typedef e_RxStoreResponse (t_FmPortImRxStoreCallback) (t_Handle h_App,201uint8_t *p_Data,202uint16_t length,203uint16_t status,204uint8_t position,205t_Handle h_BufContext);206207/**************************************************************************//**208@Description User callback function called by driver when transmit completed.209210User provides this function. Driver invokes it.211212@Param[in] h_App Application's handle originally specified to213the API Config function214@Param[in] p_Data A pointer to data received215@Param[in] status transmit status and errors216@Param[in] lastBuffer is last buffer in frame217@Param[in] h_BufContext A handle of the user acossiated with this buffer218*//***************************************************************************/219typedef void (t_FmPortImTxConfCallback) (t_Handle h_App,220uint8_t *p_Data,221uint16_t status,222t_Handle h_BufContext);223224/**************************************************************************//**225@Description A structure for additional Rx port parameters226*//***************************************************************************/227typedef struct t_FmPortRxParams {228uint32_t errFqid; /**< Error Queue Id. */229uint32_t dfltFqid; /**< Default Queue Id. */230uint16_t liodnOffset; /**< Port's LIODN offset. */231t_FmExtPools extBufPools; /**< Which external buffer pools are used232(up to FM_PORT_MAX_NUM_OF_EXT_POOLS), and their sizes. */233} t_FmPortRxParams;234235/**************************************************************************//**236@Description A structure for additional non-Rx port parameters237*//***************************************************************************/238typedef struct t_FmPortNonRxParams {239uint32_t errFqid; /**< Error Queue Id. */240uint32_t dfltFqid; /**< For Tx - Default Confirmation queue,2410 means no Tx confirmation for processed242frames. For OP port - default Rx queue. */243uint32_t qmChannel; /**< QM-channel dedicated to this port; will be used244by the FM for dequeue. */245} t_FmPortNonRxParams;246247/**************************************************************************//**248@Description A structure for additional Rx port parameters249*//***************************************************************************/250typedef struct t_FmPortImRxTxParams {251t_Handle h_FmMuram; /**< A handle of the FM-MURAM partition */252uint16_t liodnOffset; /**< For Rx ports only. Port's LIODN Offset. */253uint8_t dataMemId; /**< Memory partition ID for data buffers */254uint32_t dataMemAttributes; /**< Memory attributes for data buffers */255t_BufferPoolInfo rxPoolParams; /**< For Rx ports only. */256t_FmPortImRxStoreCallback *f_RxStore; /**< For Rx ports only. */257t_FmPortImTxConfCallback *f_TxConf; /**< For Tx ports only. */258} t_FmPortImRxTxParams;259260/**************************************************************************//**261@Description A union for additional parameters depending on port type262*//***************************************************************************/263typedef union u_FmPortSpecificParams {264t_FmPortImRxTxParams imRxTxParams; /**< Rx/Tx Independent-Mode port parameter structure */265t_FmPortRxParams rxParams; /**< Rx port parameters structure */266t_FmPortNonRxParams nonRxParams; /**< Non-Rx port parameters structure */267} u_FmPortSpecificParams;268269/**************************************************************************//**270@Description A structure representing FM initialization parameters271*//***************************************************************************/272typedef struct t_FmPortParams {273uintptr_t baseAddr; /**< Virtual Address of memory mapped FM Port registers.*/274t_Handle h_Fm; /**< A handle to the FM object this port related to */275e_FmPortType portType; /**< Port type */276uint8_t portId; /**< Port Id - relative to type;277NOTE: When configuring Offline Parsing port for278FMANv3 devices (DPAA_VERSION 11 and higher),279it is highly recommended NOT to use portId=0 due to lack280of HW resources on portId=0. */281bool independentModeEnable;282/**< This port is Independent-Mode - Used for Rx/Tx ports only! */283uint16_t liodnBase; /**< Irrelevant for P4080 rev 1. LIODN base for this port, to be284used together with LIODN offset. */285u_FmPortSpecificParams specificParams; /**< Additional parameters depending on port286type. */287288t_FmPortExceptionCallback *f_Exception; /**< Relevant for IM only Callback routine to be called on BUSY exception */289t_Handle h_App; /**< A handle to an application layer object; This handle will290be passed by the driver upon calling the above callbacks */291} t_FmPortParams;292293294/**************************************************************************//**295@Function FM_PORT_Config296297@Description Creates a descriptor for the FM PORT module.298299The routine returns a handle (descriptor) to the FM PORT object.300This descriptor must be passed as first parameter to all other301FM PORT function calls.302303No actual initialization or configuration of FM hardware is304done by this routine.305306@Param[in] p_FmPortParams - Pointer to data structure of parameters307308@Retval Handle to FM object, or NULL for Failure.309*//***************************************************************************/310t_Handle FM_PORT_Config(t_FmPortParams *p_FmPortParams);311312/**************************************************************************//**313@Function FM_PORT_Init314315@Description Initializes the FM PORT module by defining the software structure316and configuring the hardware registers.317318@Param[in] h_FmPort - FM PORT module descriptor319320@Return E_OK on success; Error code otherwise.321*//***************************************************************************/322t_Error FM_PORT_Init(t_Handle h_FmPort);323324/**************************************************************************//**325@Function FM_PORT_Free326327@Description Frees all resources that were assigned to FM PORT module.328329Calling this routine invalidates the descriptor.330331@Param[in] h_FmPort - FM PORT module descriptor332333@Return E_OK on success; Error code otherwise.334*//***************************************************************************/335t_Error FM_PORT_Free(t_Handle h_FmPort);336337338/**************************************************************************//**339@Group FM_PORT_advanced_init_grp FM Port Advanced Configuration Unit340341@Description Configuration functions used to change default values.342343@{344*//***************************************************************************/345346/**************************************************************************//**347@Description enum for defining QM frame dequeue348*//***************************************************************************/349typedef enum e_FmPortDeqType {350e_FM_PORT_DEQ_TYPE1, /**< Dequeue from the SP channel - with priority precedence,351and Intra-Class Scheduling respected. */352e_FM_PORT_DEQ_TYPE2, /**< Dequeue from the SP channel - with active FQ precedence,353and Intra-Class Scheduling respected. */354e_FM_PORT_DEQ_TYPE3 /**< Dequeue from the SP channel - with active FQ precedence,355and override Intra-Class Scheduling */356} e_FmPortDeqType;357358/**************************************************************************//**359@Description enum for defining QM frame dequeue360*//***************************************************************************/361typedef enum e_FmPortDeqPrefetchOption {362e_FM_PORT_DEQ_NO_PREFETCH, /**< QMI preforms a dequeue action for a single frame363only when a dedicated portID Tnum is waiting. */364e_FM_PORT_DEQ_PARTIAL_PREFETCH, /**< QMI preforms a dequeue action for 3 frames when365one dedicated portId tnum is waiting. */366e_FM_PORT_DEQ_FULL_PREFETCH /**< QMI preforms a dequeue action for 3 frames when367no dedicated portId tnums are waiting. */368369} e_FmPortDeqPrefetchOption;370371/**************************************************************************//**372@Description enum for defining port default color373*//***************************************************************************/374typedef enum e_FmPortColor {375e_FM_PORT_COLOR_GREEN, /**< Default port color is green */376e_FM_PORT_COLOR_YELLOW, /**< Default port color is yellow */377e_FM_PORT_COLOR_RED, /**< Default port color is red */378e_FM_PORT_COLOR_OVERRIDE /**< Ignore color */379} e_FmPortColor;380381/**************************************************************************//**382@Description A structure for defining Dual Tx rate limiting scale383*//***************************************************************************/384typedef enum e_FmPortDualRateLimiterScaleDown {385e_FM_PORT_DUAL_RATE_LIMITER_NONE = 0, /**< Use only single rate limiter */386e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_2, /**< Divide high rate limiter by 2 */387e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_4, /**< Divide high rate limiter by 4 */388e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_8 /**< Divide high rate limiter by 8 */389} e_FmPortDualRateLimiterScaleDown;390391392/**************************************************************************//**393@Description A structure for defining FM port resources394*//***************************************************************************/395typedef struct t_FmPortRsrc {396uint32_t num; /**< Committed required resource */397uint32_t extra; /**< Extra (not committed) required resource */398} t_FmPortRsrc;399400/**************************************************************************//**401@Description A structure for defining observed pool depletion402*//***************************************************************************/403typedef struct t_FmPortObservedBufPoolDepletion {404t_FmBufPoolDepletion poolDepletionParams;/**< parameters to define pool depletion */405t_FmExtPools poolsParams; /**< Which external buffer pools are observed406(up to FM_PORT_MAX_NUM_OF_OBSERVED_EXT_POOLS),407and their sizes. */408} t_FmPortObservedBufPoolDepletion;409410/**************************************************************************//**411@Description A structure for defining Tx rate limiting412*//***************************************************************************/413typedef struct t_FmPortRateLimit {414uint16_t maxBurstSize; /**< in KBytes for Tx ports, in frames415for OP ports. (note that416for early chips burst size is417rounded up to a multiply of 1000 frames).*/418uint32_t rateLimit; /**< in Kb/sec for Tx ports, in frame/sec for419OP ports. Rate limit refers to420data rate (rather than line rate). */421e_FmPortDualRateLimiterScaleDown rateLimitDivider; /**< For OP ports only. Not-valid422for some earlier chip revisions */423} t_FmPortRateLimit;424425/**************************************************************************//**426@Description A structure for defining the parameters of427the Rx port performance counters428*//***************************************************************************/429typedef struct t_FmPortPerformanceCnt {430uint8_t taskCompVal; /**< Task compare value */431uint8_t queueCompVal; /**< Rx queue/Tx confirm queue compare432value (unused for H/O) */433uint8_t dmaCompVal; /**< Dma compare value */434uint32_t fifoCompVal; /**< Fifo compare value (in bytes) */435} t_FmPortPerformanceCnt;436437438/**************************************************************************//**439@Description A structure for defining the sizes of the Deep Sleep440the Auto Response tables441*//***************************************************************************/442typedef struct t_FmPortDsarTablesSizes443{444uint16_t maxNumOfArpEntries;445uint16_t maxNumOfEchoIpv4Entries;446uint16_t maxNumOfNdpEntries;447uint16_t maxNumOfEchoIpv6Entries;448uint16_t maxNumOfSnmpIPV4Entries;449uint16_t maxNumOfSnmpIPV6Entries;450uint16_t maxNumOfSnmpOidEntries;451uint16_t maxNumOfSnmpOidChar; /* total amount of character needed for the snmp table */452453uint16_t maxNumOfIpProtFiltering;454uint16_t maxNumOfTcpPortFiltering;455uint16_t maxNumOfUdpPortFiltering;456} t_FmPortDsarTablesSizes;457458459/**************************************************************************//**460@Function FM_PORT_ConfigDsarSupport461462@Description This function will allocate the amount of MURAM needed for463this max number of entries for Deep Sleep Auto Response.464it will calculate all needed MURAM for autoresponse including465necesary common stuff.466467468@Param[in] h_FmPort A handle to a FM Port module.469@Param[in] params A pointer to a structure containing the maximum470sizes of the auto response tables471472@Return E_OK on success; Error code otherwise.473474@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().475*//***************************************************************************/476t_Error FM_PORT_ConfigDsarSupport(t_Handle h_FmPortRx, t_FmPortDsarTablesSizes *params);477478/**************************************************************************//**479@Function FM_PORT_ConfigNumOfOpenDmas480481@Description Calling this routine changes the max number of open DMA's482available for this port. It changes this parameter in the483internal driver data base from its default configuration484[OP: 1]485[1G-RX, 1G-TX: 1 (+1)]486[10G-RX, 10G-TX: 8 (+8)]487488@Param[in] h_FmPort A handle to a FM Port module.489@Param[in] p_OpenDmas A pointer to a structure of parameters defining490the open DMA allocation.491492@Return E_OK on success; Error code otherwise.493494@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().495*//***************************************************************************/496t_Error FM_PORT_ConfigNumOfOpenDmas(t_Handle h_FmPort, t_FmPortRsrc *p_OpenDmas);497498/**************************************************************************//**499@Function FM_PORT_ConfigNumOfTasks500501@Description Calling this routine changes the max number of tasks502available for this port. It changes this parameter in the503internal driver data base from its default configuration504[OP: 1]505[1G-RX, 1G-TX: 3 (+2)]506[10G-RX, 10G-TX: 16 (+8)]507508@Param[in] h_FmPort A handle to a FM Port module.509@Param[in] p_NumOfTasks A pointer to a structure of parameters defining510the tasks allocation.511512@Return E_OK on success; Error code otherwise.513514@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().515*//***************************************************************************/516t_Error FM_PORT_ConfigNumOfTasks(t_Handle h_FmPort, t_FmPortRsrc *p_NumOfTasks);517518/**************************************************************************//**519@Function FM_PORT_ConfigSizeOfFifo520521@Description Calling this routine changes the max FIFO size configured for this port.522523This function changes the internal driver data base from its524default configuration. Please refer to the driver's User Guide for525information on default FIFO sizes in the various devices.526[OP: 2KB]527[1G-RX, 1G-TX: 11KB]528[10G-RX, 10G-TX: 12KB]529530@Param[in] h_FmPort A handle to a FM Port module.531@Param[in] p_SizeOfFifo A pointer to a structure of parameters defining532the FIFO allocation.533534@Return E_OK on success; Error code otherwise.535536@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().537*//***************************************************************************/538t_Error FM_PORT_ConfigSizeOfFifo(t_Handle h_FmPort, t_FmPortRsrc *p_SizeOfFifo);539540/**************************************************************************//**541@Function FM_PORT_ConfigDeqHighPriority542543@Description Calling this routine changes the dequeue priority in the544internal driver data base from its default configuration5451G: [DEFAULT_PORT_deqHighPriority_1G]54610G: [DEFAULT_PORT_deqHighPriority_10G]547548May be used for Non-Rx ports only549550@Param[in] h_FmPort A handle to a FM Port module.551@Param[in] highPri TRUE to select high priority, FALSE for normal operation.552553@Return E_OK on success; Error code otherwise.554555@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().556*//***************************************************************************/557t_Error FM_PORT_ConfigDeqHighPriority(t_Handle h_FmPort, bool highPri);558559/**************************************************************************//**560@Function FM_PORT_ConfigDeqType561562@Description Calling this routine changes the dequeue type parameter in the563internal driver data base from its default configuration564[DEFAULT_PORT_deqType].565566May be used for Non-Rx ports only567568@Param[in] h_FmPort A handle to a FM Port module.569@Param[in] deqType According to QM definition.570571@Return E_OK on success; Error code otherwise.572573@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().574*//***************************************************************************/575t_Error FM_PORT_ConfigDeqType(t_Handle h_FmPort, e_FmPortDeqType deqType);576577/**************************************************************************//**578@Function FM_PORT_ConfigDeqPrefetchOption579580@Description Calling this routine changes the dequeue prefetch option parameter in the581internal driver data base from its default configuration582[DEFAULT_PORT_deqPrefetchOption]583Note: Available for some chips only584585May be used for Non-Rx ports only586587@Param[in] h_FmPort A handle to a FM Port module.588@Param[in] deqPrefetchOption New option589590@Return E_OK on success; Error code otherwise.591592@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().593*//***************************************************************************/594t_Error FM_PORT_ConfigDeqPrefetchOption(t_Handle h_FmPort, e_FmPortDeqPrefetchOption deqPrefetchOption);595596/**************************************************************************//**597@Function FM_PORT_ConfigDeqByteCnt598599@Description Calling this routine changes the dequeue byte count parameter in600the internal driver data base from its default configuration6011G:[DEFAULT_PORT_deqByteCnt_1G].60210G:[DEFAULT_PORT_deqByteCnt_10G].603604May be used for Non-Rx ports only605606@Param[in] h_FmPort A handle to a FM Port module.607@Param[in] deqByteCnt New byte count608609@Return E_OK on success; Error code otherwise.610611@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().612*//***************************************************************************/613t_Error FM_PORT_ConfigDeqByteCnt(t_Handle h_FmPort, uint16_t deqByteCnt);614615/**************************************************************************//**616@Function FM_PORT_ConfigBufferPrefixContent617618@Description Defines the structure, size and content of the application buffer.619The prefix will620In Tx ports, if 'passPrsResult', the application621should set a value to their offsets in the prefix of622the FM will save the first 'privDataSize', than,623depending on 'passPrsResult' and 'passTimeStamp', copy parse result624and timeStamp, and the packet itself (in this order), to the625application buffer, and to offset.626Calling this routine changes the buffer margins definitions627in the internal driver data base from its default628configuration: Data size: [DEFAULT_PORT_bufferPrefixContent_privDataSize]629Pass Parser result: [DEFAULT_PORT_bufferPrefixContent_passPrsResult].630Pass timestamp: [DEFAULT_PORT_bufferPrefixContent_passTimeStamp].631632May be used for all ports633634@Param[in] h_FmPort A handle to a FM Port module.635@Param[in,out] p_FmBufferPrefixContent A structure of parameters describing the636structure of the buffer.637Out parameter: Start margin - offset638of data from start of external buffer.639640@Return E_OK on success; Error code otherwise.641642@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().643*//***************************************************************************/644t_Error FM_PORT_ConfigBufferPrefixContent(t_Handle h_FmPort,645t_FmBufferPrefixContent *p_FmBufferPrefixContent);646647/**************************************************************************//**648@Function FM_PORT_ConfigCheksumLastBytesIgnore649650@Description Calling this routine changes the number of checksum bytes to ignore651parameter in the internal driver data base from its default configuration652[DEFAULT_PORT_cheksumLastBytesIgnore]653654May be used by Tx & Rx ports only655656@Param[in] h_FmPort A handle to a FM Port module.657@Param[in] cheksumLastBytesIgnore New value658659@Return E_OK on success; Error code otherwise.660661@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().662*//***************************************************************************/663t_Error FM_PORT_ConfigCheksumLastBytesIgnore(t_Handle h_FmPort, uint8_t cheksumLastBytesIgnore);664665/**************************************************************************//**666@Function FM_PORT_ConfigCutBytesFromEnd667668@Description Calling this routine changes the number of bytes to cut from a669frame's end parameter in the internal driver data base670from its default configuration [DEFAULT_PORT_cutBytesFromEnd]671Note that if the result of (frame length before chop - cutBytesFromEnd) is672less than 14 bytes, the chop operation is not executed.673674May be used for Rx ports only675676@Param[in] h_FmPort A handle to a FM Port module.677@Param[in] cutBytesFromEnd New value678679@Return E_OK on success; Error code otherwise.680681@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().682*//***************************************************************************/683t_Error FM_PORT_ConfigCutBytesFromEnd(t_Handle h_FmPort, uint8_t cutBytesFromEnd);684685/**************************************************************************//**686@Function FM_PORT_ConfigPoolDepletion687688@Description Calling this routine enables pause frame generation depending on the689depletion status of BM pools. It also defines the conditions to activate690this functionality. By default, this functionality is disabled.691692May be used for Rx ports only693694@Param[in] h_FmPort A handle to a FM Port module.695@Param[in] p_BufPoolDepletion A structure of pool depletion parameters696697@Return E_OK on success; Error code otherwise.698699@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().700*//***************************************************************************/701t_Error FM_PORT_ConfigPoolDepletion(t_Handle h_FmPort, t_FmBufPoolDepletion *p_BufPoolDepletion);702703/**************************************************************************//**704@Function FM_PORT_ConfigObservedPoolDepletion705706@Description Calling this routine enables a mechanism to stop port enqueue707depending on the depletion status of selected BM pools.708It also defines the conditions to activate709this functionality. By default, this functionality is disabled.710711Note: Available for some chips only712713May be used for OP ports only714715@Param[in] h_FmPort A handle to a FM Port module.716@Param[in] p_FmPortObservedBufPoolDepletion A structure of parameters for pool depletion.717718@Return E_OK on success; Error code otherwise.719720@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().721*//***************************************************************************/722t_Error FM_PORT_ConfigObservedPoolDepletion(t_Handle h_FmPort,723t_FmPortObservedBufPoolDepletion *p_FmPortObservedBufPoolDepletion);724725/**************************************************************************//**726@Function FM_PORT_ConfigExtBufPools727728@Description This routine should be called for OP ports729that internally use BM buffer pools. In such cases, e.g. for fragmentation and730re-assembly, the FM needs new BM buffers. By calling this routine the user731specifies the BM buffer pools that should be used.732733Note: Available for some chips only734735May be used for OP ports only736737@Param[in] h_FmPort A handle to a FM Port module.738@Param[in] p_FmExtPools A structure of parameters for the external pools.739740@Return E_OK on success; Error code otherwise.741742@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().743*//***************************************************************************/744t_Error FM_PORT_ConfigExtBufPools(t_Handle h_FmPort, t_FmExtPools *p_FmExtPools);745746/**************************************************************************//**747@Function FM_PORT_ConfigBackupPools748749@Description Calling this routine allows the configuration of some of the BM pools750defined for this port as backup pools.751A pool configured to be a backup pool will be used only if all other752enabled non-backup pools are depleted.753754May be used for Rx ports only755756@Param[in] h_FmPort A handle to a FM Port module.757@Param[in] p_FmPortBackupBmPools An array of pool id's. All pools specified here will758be defined as backup pools.759760@Return E_OK on success; Error code otherwise.761762@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().763*//***************************************************************************/764t_Error FM_PORT_ConfigBackupPools(t_Handle h_FmPort, t_FmBackupBmPools *p_FmPortBackupBmPools);765766/**************************************************************************//**767@Function FM_PORT_ConfigFrmDiscardOverride768769@Description Calling this routine changes the error frames destination parameter770in the internal driver data base from its default configuration:771override = [DEFAULT_PORT_frmDiscardOverride]772773May be used for Rx and OP ports only774775@Param[in] h_FmPort A handle to a FM Port module.776@Param[in] override TRUE to override discarding of error frames and777enqueueing them to error queue.778779@Return E_OK on success; Error code otherwise.780781@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().782*//***************************************************************************/783t_Error FM_PORT_ConfigFrmDiscardOverride(t_Handle h_FmPort, bool override);784785/**************************************************************************//**786@Function FM_PORT_ConfigErrorsToDiscard787788@Description Calling this routine changes the behaviour on error parameter789in the internal driver data base from its default configuration:790[DEFAULT_PORT_errorsToDiscard].791If a requested error was previously defined as "ErrorsToEnqueue" it's792definition will change and the frame will be discarded.793Errors that were not defined either as "ErrorsToEnqueue" nor as794"ErrorsToDiscard", will be forwarded to CPU.795796May be used for Rx and OP ports only797798@Param[in] h_FmPort A handle to a FM Port module.799@Param[in] errs A list of errors to discard800801@Return E_OK on success; Error code otherwise.802803@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().804*//***************************************************************************/805t_Error FM_PORT_ConfigErrorsToDiscard(t_Handle h_FmPort, fmPortFrameErrSelect_t errs);806807/**************************************************************************//**808@Function FM_PORT_ConfigDmaSwapData809810@Description Calling this routine changes the DMA swap data aparameter811in the internal driver data base from its default812configuration [DEFAULT_PORT_dmaSwapData]813814May be used for all port types815816@Param[in] h_FmPort A handle to a FM Port module.817@Param[in] swapData New selection818819@Return E_OK on success; Error code otherwise.820821@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().822*//***************************************************************************/823t_Error FM_PORT_ConfigDmaSwapData(t_Handle h_FmPort, e_FmDmaSwapOption swapData);824825/**************************************************************************//**826@Function FM_PORT_ConfigDmaIcCacheAttr827828@Description Calling this routine changes the internal context cache829attribute parameter in the internal driver data base830from its default configuration [DEFAULT_PORT_dmaIntContextCacheAttr]831832May be used for all port types833834@Param[in] h_FmPort A handle to a FM Port module.835@Param[in] intContextCacheAttr New selection836837@Return E_OK on success; Error code otherwise.838839@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().840*//***************************************************************************/841t_Error FM_PORT_ConfigDmaIcCacheAttr(t_Handle h_FmPort, e_FmDmaCacheOption intContextCacheAttr);842843/**************************************************************************//**844@Function FM_PORT_ConfigDmaHdrAttr845846@Description Calling this routine changes the header cache847attribute parameter in the internal driver data base848from its default configuration [DEFAULT_PORT_dmaHeaderCacheAttr]849850May be used for all port types851852@Param[in] h_FmPort A handle to a FM Port module.853@Param[in] headerCacheAttr New selection854855@Return E_OK on success; Error code otherwise.856857@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().858*//***************************************************************************/859t_Error FM_PORT_ConfigDmaHdrAttr(t_Handle h_FmPort, e_FmDmaCacheOption headerCacheAttr);860861/**************************************************************************//**862@Function FM_PORT_ConfigDmaScatterGatherAttr863864@Description Calling this routine changes the scatter gather cache865attribute parameter in the internal driver data base866from its default configuration [DEFAULT_PORT_dmaScatterGatherCacheAttr]867868May be used for all port types869870@Param[in] h_FmPort A handle to a FM Port module.871@Param[in] scatterGatherCacheAttr New selection872873@Return E_OK on success; Error code otherwise.874875@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().876*//***************************************************************************/877t_Error FM_PORT_ConfigDmaScatterGatherAttr(t_Handle h_FmPort, e_FmDmaCacheOption scatterGatherCacheAttr);878879/**************************************************************************//**880@Function FM_PORT_ConfigDmaWriteOptimize881882@Description Calling this routine changes the write optimization883parameter in the internal driver data base884from its default configuration: By default optimize = [DEFAULT_PORT_dmaWriteOptimize].885Note:8868871. For head optimization, data alignment must be >= 16 (supported by default).8888893. For tail optimization, note that the optimization is performed by extending the write transaction890of the frame payload at the tail as needed to achieve optimal bus transfers, so that the last write891is extended to be on 16/64 bytes aligned block (chip dependent).892893Relevant for non-Tx port types894895@Param[in] h_FmPort A handle to a FM Port module.896@Param[in] optimize TRUE to enable optimization, FALSE for normal operation897898@Return E_OK on success; Error code otherwise.899900@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().901*//***************************************************************************/902t_Error FM_PORT_ConfigDmaWriteOptimize(t_Handle h_FmPort, bool optimize);903904/**************************************************************************//**905@Function FM_PORT_ConfigNoScatherGather906907@Description Calling this routine changes the noScatherGather parameter in internal driver data base908from its default configuration.909910@Param[in] h_FmPort A handle to a FM Port module.911@Param[in] noScatherGather (TRUE - frame is discarded if can not be stored in single buffer,912FALSE - frame can be stored in scatter gather (S/G) format).913914@Return E_OK on success; Error code otherwise.915916@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().917*//***************************************************************************/918t_Error FM_PORT_ConfigNoScatherGather(t_Handle h_FmPort, bool noScatherGather);919920/**************************************************************************//**921@Function FM_PORT_ConfigDfltColor922923@Description Calling this routine changes the internal default color parameter924in the internal driver data base925from its default configuration [DEFAULT_PORT_color]926927May be used for all port types928929@Param[in] h_FmPort A handle to a FM Port module.930@Param[in] color New selection931932@Return E_OK on success; Error code otherwise.933934@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().935*//***************************************************************************/936t_Error FM_PORT_ConfigDfltColor(t_Handle h_FmPort, e_FmPortColor color);937938/**************************************************************************//**939@Function FM_PORT_ConfigSyncReq940941@Description Calling this routine changes the synchronization attribute parameter942in the internal driver data base from its default configuration:943syncReq = [DEFAULT_PORT_syncReq]944945May be used for all port types946947@Param[in] h_FmPort A handle to a FM Port module.948@Param[in] syncReq TRUE to request synchronization, FALSE otherwize.949950@Return E_OK on success; Error code otherwise.951952@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().953*//***************************************************************************/954t_Error FM_PORT_ConfigSyncReq(t_Handle h_FmPort, bool syncReq);955956/**************************************************************************//**957@Function FM_PORT_ConfigForwardReuseIntContext958959@Description This routine is relevant for Rx ports that are routed to OP port.960It changes the internal context reuse option in the internal961driver data base from its default configuration:962reuse = [DEFAULT_PORT_forwardIntContextReuse]963964May be used for Rx ports only965966@Param[in] h_FmPort A handle to a FM Port module.967@Param[in] reuse TRUE to reuse internal context on frames968forwarded to OP port.969970@Return E_OK on success; Error code otherwise.971972@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().973*//***************************************************************************/974t_Error FM_PORT_ConfigForwardReuseIntContext(t_Handle h_FmPort, bool reuse);975976/**************************************************************************//**977@Function FM_PORT_ConfigDontReleaseTxBufToBM978979@Description This routine should be called if no Tx confirmation980is done, and yet buffers should not be released to the BM.981Normally, buffers are returned using the Tx confirmation982process. When Tx confirmation is not used (defFqid=0),983buffers are typically released to the BM. This routine984may be called to avoid this behavior and not release the985buffers.986987May be used for Tx ports only988989@Param[in] h_FmPort A handle to a FM Port module.990991@Return E_OK on success; Error code otherwise.992993@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().994*//***************************************************************************/995t_Error FM_PORT_ConfigDontReleaseTxBufToBM(t_Handle h_FmPort);996997/**************************************************************************//**998@Function FM_PORT_ConfigIMMaxRxBufLength9991000@Description Changes the maximum receive buffer length from its default1001configuration: Closest rounded down power of 2 value of the1002data buffer size.10031004The maximum receive buffer length directly affects the structure1005of received frames (single- or multi-buffered) and the performance1006of both the FM and the driver.10071008The selection between single- or multi-buffered frames should be1009done according to the characteristics of the specific application.1010The recommended mode is to use a single data buffer per packet,1011as this mode provides the best performance. However, the user can1012select to use multiple data buffers per packet.10131014@Param[in] h_FmPort A handle to a FM Port module.1015@Param[in] newVal Maximum receive buffer length (in bytes).10161017@Return E_OK on success; Error code otherwise.10181019@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1020This routine is to be used only if Independent-Mode is enabled.1021*//***************************************************************************/1022t_Error FM_PORT_ConfigIMMaxRxBufLength(t_Handle h_FmPort, uint16_t newVal);10231024/**************************************************************************//**1025@Function FM_PORT_ConfigIMRxBdRingLength10261027@Description Changes the receive BD ring length from its default1028configuration:[DEFAULT_PORT_rxBdRingLength]10291030@Param[in] h_FmPort A handle to a FM Port module.1031@Param[in] newVal The desired BD ring length.10321033@Return E_OK on success; Error code otherwise.10341035@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1036This routine is to be used only if Independent-Mode is enabled.1037*//***************************************************************************/1038t_Error FM_PORT_ConfigIMRxBdRingLength(t_Handle h_FmPort, uint16_t newVal);10391040/**************************************************************************//**1041@Function FM_PORT_ConfigIMTxBdRingLength10421043@Description Changes the transmit BD ring length from its default1044configuration:[DEFAULT_PORT_txBdRingLength]10451046@Param[in] h_FmPort A handle to a FM Port module.1047@Param[in] newVal The desired BD ring length.10481049@Return E_OK on success; Error code otherwise.10501051@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1052This routine is to be used only if Independent-Mode is enabled.1053*//***************************************************************************/1054t_Error FM_PORT_ConfigIMTxBdRingLength(t_Handle h_FmPort, uint16_t newVal);10551056/**************************************************************************//**1057@Function FM_PORT_ConfigIMFmanCtrlExternalStructsMemory10581059@Description Configures memory partition and attributes for FMan-Controller1060data structures (e.g. BD rings).1061Calling this routine changes the internal driver data base1062from its default configuration1063[DEFAULT_PORT_ImfwExtStructsMemId, DEFAULT_PORT_ImfwExtStructsMemAttr].10641065@Param[in] h_FmPort A handle to a FM Port module.1066@Param[in] memId Memory partition ID.1067@Param[in] memAttributes Memory attributes mask (a combination of MEMORY_ATTR_x flags).10681069@Return E_OK on success; Error code otherwise.1070*//***************************************************************************/1071t_Error FM_PORT_ConfigIMFmanCtrlExternalStructsMemory(t_Handle h_FmPort,1072uint8_t memId,1073uint32_t memAttributes);10741075/**************************************************************************//**1076@Function FM_PORT_ConfigIMPolling10771078@Description Changes the Rx flow from interrupt driven (default) to polling.10791080@Param[in] h_FmPort A handle to a FM Port module.10811082@Return E_OK on success; Error code otherwise.10831084@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1085This routine is to be used only if Independent-Mode is enabled.1086*//***************************************************************************/1087t_Error FM_PORT_ConfigIMPolling(t_Handle h_FmPort);10881089/**************************************************************************//**1090@Function FM_PORT_ConfigMaxFrameLength10911092@Description Changes the definition of the max size of frame that should be1093transmitted/received on this port from its default value [DEFAULT_PORT_maxFrameLength].1094This parameter is used for confirmation of the minimum Fifo1095size calculations and only for Tx ports or ports working in1096independent mode. This should be larger than the maximum possible1097MTU that will be used for this port (i.e. its MAC).10981099@Param[in] h_FmPort A handle to a FM Port module.1100@Param[in] length Max size of frame11011102@Return E_OK on success; Error code otherwise.11031104@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1105This routine is to be used only if Independent-Mode is enabled.1106*//***************************************************************************/1107t_Error FM_PORT_ConfigMaxFrameLength(t_Handle h_FmPort, uint16_t length);11081109/**************************************************************************//*1110@Function FM_PORT_ConfigTxFifoMinFillLevel11111112@Description Calling this routine changes the fifo minimum1113fill level parameter in the internal driver data base1114from its default configuration [DEFAULT_PORT_txFifoMinFillLevel]11151116May be used for Tx ports only11171118@Param[in] h_FmPort A handle to a FM Port module.1119@Param[in] minFillLevel New value11201121@Return E_OK on success; Error code otherwise.11221123@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1124*//***************************************************************************/1125t_Error FM_PORT_ConfigTxFifoMinFillLevel(t_Handle h_FmPort, uint32_t minFillLevel);11261127/**************************************************************************//*1128@Function FM_PORT_ConfigFifoDeqPipelineDepth11291130@Description Calling this routine changes the fifo dequeue1131pipeline depth parameter in the internal driver data base11321133from its default configuration: 1G ports: [DEFAULT_PORT_fifoDeqPipelineDepth_1G],113410G port: [DEFAULT_PORT_fifoDeqPipelineDepth_10G],1135OP port: [DEFAULT_PORT_fifoDeqPipelineDepth_OH]11361137May be used for Tx/OP ports only11381139@Param[in] h_FmPort A handle to a FM Port module.1140@Param[in] deqPipelineDepth New value11411142@Return E_OK on success; Error code otherwise.11431144@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1145*//***************************************************************************/1146t_Error FM_PORT_ConfigFifoDeqPipelineDepth(t_Handle h_FmPort, uint8_t deqPipelineDepth);11471148/**************************************************************************//*1149@Function FM_PORT_ConfigTxFifoLowComfLevel11501151@Description Calling this routine changes the fifo low comfort level1152parameter in internal driver data base1153from its default configuration [DEFAULT_PORT_txFifoLowComfLevel]11541155May be used for Tx ports only11561157@Param[in] h_FmPort A handle to a FM Port module.1158@Param[in] fifoLowComfLevel New value11591160@Return E_OK on success; Error code otherwise.11611162@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1163*//***************************************************************************/1164t_Error FM_PORT_ConfigTxFifoLowComfLevel(t_Handle h_FmPort, uint32_t fifoLowComfLevel);11651166/**************************************************************************//*1167@Function FM_PORT_ConfigRxFifoThreshold11681169@Description Calling this routine changes the threshold of the FIFO1170fill level parameter in the internal driver data base1171from its default configuration [DEFAULT_PORT_rxFifoThreshold]11721173If the total number of buffers which are1174currently in use and associated with the1175specific RX port exceed this threshold, the1176BMI will signal the MAC to send a pause frame1177over the link.11781179May be used for Rx ports only11801181@Param[in] h_FmPort A handle to a FM Port module.1182@Param[in] fifoThreshold New value11831184@Return E_OK on success; Error code otherwise.11851186@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1187*//***************************************************************************/1188t_Error FM_PORT_ConfigRxFifoThreshold(t_Handle h_FmPort, uint32_t fifoThreshold);11891190/**************************************************************************//*1191@Function FM_PORT_ConfigRxFifoPriElevationLevel11921193@Description Calling this routine changes the priority elevation level1194parameter in the internal driver data base from its default1195configuration [DEFAULT_PORT_rxFifoPriElevationLevel]11961197If the total number of buffers which are currently in use and1198associated with the specific RX port exceed the amount specified1199in priElevationLevel, BMI will signal the main FM's DMA to1200elevate the FM priority on the system bus.12011202May be used for Rx ports only12031204@Param[in] h_FmPort A handle to a FM Port module.1205@Param[in] priElevationLevel New value12061207@Return E_OK on success; Error code otherwise.12081209@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1210*//***************************************************************************/1211t_Error FM_PORT_ConfigRxFifoPriElevationLevel(t_Handle h_FmPort, uint32_t priElevationLevel);12121213#ifdef FM_HEAVY_TRAFFIC_HANG_ERRATA_FMAN_A0056691214/**************************************************************************//*1215@Function FM_PORT_ConfigBCBWorkaround12161217@Description Configures BCB errata workaround.12181219When BCB errata is applicable, the workaround is always1220performed by FM Controller. Thus, this functions doesn't1221actually enable errata workaround but rather allows driver1222to perform adjustments required due to errata workaround1223execution in FM controller.12241225Applying BCB workaround also configures FM_PORT_FRM_ERR_PHYSICAL1226errors to be discarded. Thus FM_PORT_FRM_ERR_PHYSICAL can't be1227set by FM_PORT_SetErrorsRoute() function.12281229@Param[in] h_FmPort A handle to a FM Port module.12301231@Return E_OK on success; Error code otherwise.12321233@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1234*//***************************************************************************/1235t_Error FM_PORT_ConfigBCBWorkaround(t_Handle h_FmPort);1236#endif /* FM_HEAVY_TRAFFIC_HANG_ERRATA_FMAN_A005669 */12371238#if (DPAA_VERSION >= 11)1239/**************************************************************************//*1240@Function FM_PORT_ConfigInternalBuffOffset12411242@Description Configures internal buffer offset.12431244May be used for Rx and OP ports only12451246@Param[in] h_FmPort A handle to a FM Port module.1247@Param[in] val New value12481249@Return E_OK on success; Error code otherwise.12501251@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().1252*//***************************************************************************/1253t_Error FM_PORT_ConfigInternalBuffOffset(t_Handle h_FmPort, uint8_t val);1254#endif /* (DPAA_VERSION >= 11) */12551256/** @} */ /* end of FM_PORT_advanced_init_grp group */1257/** @} */ /* end of FM_PORT_init_grp group */125812591260/**************************************************************************//**1261@Group FM_PORT_runtime_control_grp FM Port Runtime Control Unit12621263@Description FM Port Runtime control unit API functions, definitions and enums.12641265@{1266*//***************************************************************************/12671268/**************************************************************************//**1269@Description enum for defining FM Port counters1270*//***************************************************************************/1271typedef enum e_FmPortCounters {1272e_FM_PORT_COUNTERS_CYCLE, /**< BMI performance counter */1273e_FM_PORT_COUNTERS_TASK_UTIL, /**< BMI performance counter */1274e_FM_PORT_COUNTERS_QUEUE_UTIL, /**< BMI performance counter */1275e_FM_PORT_COUNTERS_DMA_UTIL, /**< BMI performance counter */1276e_FM_PORT_COUNTERS_FIFO_UTIL, /**< BMI performance counter */1277e_FM_PORT_COUNTERS_RX_PAUSE_ACTIVATION, /**< BMI Rx only performance counter */1278e_FM_PORT_COUNTERS_FRAME, /**< BMI statistics counter */1279e_FM_PORT_COUNTERS_DISCARD_FRAME, /**< BMI statistics counter */1280e_FM_PORT_COUNTERS_DEALLOC_BUF, /**< BMI deallocate buffer statistics counter */1281e_FM_PORT_COUNTERS_RX_BAD_FRAME, /**< BMI Rx only statistics counter */1282e_FM_PORT_COUNTERS_RX_LARGE_FRAME, /**< BMI Rx only statistics counter */1283e_FM_PORT_COUNTERS_RX_FILTER_FRAME, /**< BMI Rx & OP only statistics counter */1284e_FM_PORT_COUNTERS_RX_LIST_DMA_ERR, /**< BMI Rx, OP & HC only statistics counter */1285e_FM_PORT_COUNTERS_RX_OUT_OF_BUFFERS_DISCARD, /**< BMI Rx, OP & HC statistics counter */1286e_FM_PORT_COUNTERS_PREPARE_TO_ENQUEUE_COUNTER, /**< BMI Rx, OP & HC only statistics counter */1287e_FM_PORT_COUNTERS_WRED_DISCARD, /**< BMI OP & HC only statistics counter */1288e_FM_PORT_COUNTERS_LENGTH_ERR, /**< BMI non-Rx statistics counter */1289e_FM_PORT_COUNTERS_UNSUPPRTED_FORMAT, /**< BMI non-Rx statistics counter */1290e_FM_PORT_COUNTERS_DEQ_TOTAL, /**< QMI total QM dequeues counter */1291e_FM_PORT_COUNTERS_ENQ_TOTAL, /**< QMI total QM enqueues counter */1292e_FM_PORT_COUNTERS_DEQ_FROM_DEFAULT, /**< QMI counter */1293e_FM_PORT_COUNTERS_DEQ_CONFIRM /**< QMI counter */1294} e_FmPortCounters;12951296typedef struct t_FmPortBmiStats {1297uint32_t cntCycle;1298uint32_t cntTaskUtil;1299uint32_t cntQueueUtil;1300uint32_t cntDmaUtil;1301uint32_t cntFifoUtil;1302uint32_t cntRxPauseActivation;1303uint32_t cntFrame;1304uint32_t cntDiscardFrame;1305uint32_t cntDeallocBuf;1306uint32_t cntRxBadFrame;1307uint32_t cntRxLargeFrame;1308uint32_t cntRxFilterFrame;1309uint32_t cntRxListDmaErr;1310uint32_t cntRxOutOfBuffersDiscard;1311uint32_t cntWredDiscard;1312uint32_t cntLengthErr;1313uint32_t cntUnsupportedFormat;1314} t_FmPortBmiStats;13151316/**************************************************************************//**1317@Description Structure for Port id parameters.1318Fields commented 'IN' are passed by the port module to be used1319by the FM module.1320Fields commented 'OUT' will be filled by FM before returning to port.1321*//***************************************************************************/1322typedef struct t_FmPortCongestionGrps {1323uint16_t numOfCongestionGrpsToConsider; /**< The number of required CGs1324to define the size of the following array */1325uint8_t congestionGrpsToConsider[FM_PORT_NUM_OF_CONGESTION_GRPS];1326/**< An array of CG indexes;1327Note that the size of the array should be1328'numOfCongestionGrpsToConsider'. */1329#if (DPAA_VERSION >= 11)1330bool pfcPrioritiesEn[FM_PORT_NUM_OF_CONGESTION_GRPS][FM_MAX_NUM_OF_PFC_PRIORITIES];1331/**< a matrix that represents the map between the CG ids1332defined in 'congestionGrpsToConsider' to the priorties1333mapping array. */1334#endif /* (DPAA_VERSION >= 11) */1335} t_FmPortCongestionGrps;13361337/**************************************************************************//**1338@Description Structure for Deep Sleep Auto Response ARP Entry1339*//***************************************************************************/1340typedef struct t_FmPortDsarArpEntry1341{1342uint32_t ipAddress;1343uint8_t mac[6];1344bool isVlan;1345uint16_t vid;1346} t_FmPortDsarArpEntry;13471348/**************************************************************************//**1349@Description Structure for Deep Sleep Auto Response ARP info1350*//***************************************************************************/1351typedef struct t_FmPortDsarArpInfo1352{1353uint8_t tableSize;1354t_FmPortDsarArpEntry *p_AutoResTable;1355bool enableConflictDetection; /* when TRUE Conflict Detection will be checked and wake the host if needed */1356} t_FmPortDsarArpInfo;13571358/**************************************************************************//**1359@Description Structure for Deep Sleep Auto Response NDP Entry1360*//***************************************************************************/1361typedef struct t_FmPortDsarNdpEntry1362{1363uint32_t ipAddress[4];1364uint8_t mac[6];1365bool isVlan;1366uint16_t vid;1367} t_FmPortDsarNdpEntry;13681369/**************************************************************************//**1370@Description Structure for Deep Sleep Auto Response NDP info1371*//***************************************************************************/1372typedef struct t_FmPortDsarNdpInfo1373{1374uint32_t multicastGroup;13751376uint8_t tableSizeAssigned;1377t_FmPortDsarNdpEntry *p_AutoResTableAssigned; /* This list refer to solicitation IP addresses.1378Note that all IP adresses must be from the same multicast group.1379This will be checked and if not operation will fail. */1380uint8_t tableSizeTmp;1381t_FmPortDsarNdpEntry *p_AutoResTableTmp; /* This list refer to temp IP addresses.1382Note that all temp IP adresses must be from the same multicast group.1383This will be checked and if not operation will fail. */13841385bool enableConflictDetection; /* when TRUE Conflict Detection will be checked and wake the host if needed */13861387} t_FmPortDsarNdpInfo;13881389/**************************************************************************//**1390@Description Structure for Deep Sleep Auto Response ICMPV4 info1391*//***************************************************************************/1392typedef struct t_FmPortDsarEchoIpv4Info1393{1394uint8_t tableSize;1395t_FmPortDsarArpEntry *p_AutoResTable;1396} t_FmPortDsarEchoIpv4Info;13971398/**************************************************************************//**1399@Description Structure for Deep Sleep Auto Response ICMPV6 info1400*//***************************************************************************/1401typedef struct t_FmPortDsarEchoIpv6Info1402{1403uint8_t tableSize;1404t_FmPortDsarNdpEntry *p_AutoResTable;1405} t_FmPortDsarEchoIpv6Info;14061407/**************************************************************************//**1408@Description Deep Sleep Auto Response SNMP OIDs table entry14091410*//***************************************************************************/1411typedef struct {1412uint16_t oidSize;1413uint8_t *oidVal; /* only the oid string */1414uint16_t resSize;1415uint8_t *resVal; /* resVal will be the entire reply,1416i.e. "Type|Length|Value" */1417} t_FmPortDsarOidsEntry;14181419/**************************************************************************//**1420@Description Deep Sleep Auto Response SNMP IPv4 Addresses Table Entry1421Refer to the FMan Controller spec for more details.1422*//***************************************************************************/1423typedef struct1424{1425uint32_t ipv4Addr; /*!< 32 bit IPv4 Address. */1426bool isVlan;1427uint16_t vid; /*!< 12 bits VLAN ID. The 4 left-most bits should be cleared */1428/*!< This field should be 0x0000 for an entry with no VLAN tag or a null VLAN ID. */1429} t_FmPortDsarSnmpIpv4AddrTblEntry;14301431/**************************************************************************//**1432@Description Deep Sleep Auto Response SNMP IPv6 Addresses Table Entry1433Refer to the FMan Controller spec for more details.1434*//***************************************************************************/1435typedef struct1436{1437uint32_t ipv6Addr[4]; /*!< 4 * 32 bit IPv6 Address. */1438bool isVlan;1439uint16_t vid; /*!< 12 bits VLAN ID. The 4 left-most bits should be cleared */1440/*!< This field should be 0x0000 for an entry with no VLAN tag or a null VLAN ID. */1441} t_FmPortDsarSnmpIpv6AddrTblEntry;14421443/**************************************************************************//**1444@Description Deep Sleep Auto Response SNMP Descriptor14451446*//***************************************************************************/1447typedef struct1448{1449uint16_t control; /**< Control bits [0-15]. */1450uint16_t maxSnmpMsgLength; /**< Maximal allowed SNMP message length. */1451uint16_t numOfIpv4Addresses; /**< Number of entries in IPv4 addresses table. */1452uint16_t numOfIpv6Addresses; /**< Number of entries in IPv6 addresses table. */1453t_FmPortDsarSnmpIpv4AddrTblEntry *p_Ipv4AddrTbl; /**< Pointer to IPv4 addresses table. */1454t_FmPortDsarSnmpIpv6AddrTblEntry *p_Ipv6AddrTbl; /**< Pointer to IPv6 addresses table. */1455uint8_t *p_RdOnlyCommunityStr; /**< Pointer to the Read Only Community String. */1456uint8_t *p_RdWrCommunityStr; /**< Pointer to the Read Write Community String. */1457t_FmPortDsarOidsEntry *p_OidsTbl; /**< Pointer to OIDs table. */1458uint32_t oidsTblSize; /**< Number of entries in OIDs table. */1459} t_FmPortDsarSnmpInfo;14601461/**************************************************************************//**1462@Description Structure for Deep Sleep Auto Response filtering Entry1463*//***************************************************************************/1464typedef struct t_FmPortDsarFilteringEntry1465{1466uint16_t srcPort;1467uint16_t dstPort;1468uint16_t srcPortMask;1469uint16_t dstPortMask;1470} t_FmPortDsarFilteringEntry;14711472/**************************************************************************//**1473@Description Structure for Deep Sleep Auto Response filtering info1474*//***************************************************************************/1475typedef struct t_FmPortDsarFilteringInfo1476{1477/* IP protocol filtering parameters */1478uint8_t ipProtTableSize;1479uint8_t *p_IpProtTablePtr;1480bool ipProtPassOnHit; /* when TRUE, miss in the table will cause the packet to be droped,1481hit will pass the packet to UDP/TCP filters if needed and if not1482to the classification tree. If the classification tree will pass1483the packet to a queue it will cause a wake interupt.1484When FALSE it the other way around. */1485/* UDP port filtering parameters */1486uint8_t udpPortsTableSize;1487t_FmPortDsarFilteringEntry *p_UdpPortsTablePtr;1488bool udpPortPassOnHit; /* when TRUE, miss in the table will cause the packet to be droped,1489hit will pass the packet to classification tree.1490If the classification tree will pass the packet to a queue it1491will cause a wake interupt.1492When FALSE it the other way around. */1493/* TCP port filtering parameters */1494uint16_t tcpFlagsMask;1495uint8_t tcpPortsTableSize;1496t_FmPortDsarFilteringEntry *p_TcpPortsTablePtr;1497bool tcpPortPassOnHit; /* when TRUE, miss in the table will cause the packet to be droped,1498hit will pass the packet to classification tree.1499If the classification tree will pass the packet to a queue it1500will cause a wake interupt.1501When FALSE it the other way around. */1502} t_FmPortDsarFilteringInfo;15031504/**************************************************************************//**1505@Description Structure for Deep Sleep Auto Response parameters1506*//***************************************************************************/1507typedef struct t_FmPortDsarParams1508{1509t_Handle h_FmPortTx;1510t_FmPortDsarArpInfo *p_AutoResArpInfo;1511t_FmPortDsarEchoIpv4Info *p_AutoResEchoIpv4Info;1512t_FmPortDsarNdpInfo *p_AutoResNdpInfo;1513t_FmPortDsarEchoIpv6Info *p_AutoResEchoIpv6Info;1514t_FmPortDsarSnmpInfo *p_AutoResSnmpInfo;1515t_FmPortDsarFilteringInfo *p_AutoResFilteringInfo;1516} t_FmPortDsarParams;15171518/**************************************************************************//**1519@Function FM_PORT_EnterDsar15201521@Description Enter Deep Sleep Auto Response mode.1522This function write the apropriate values to in the relevant1523tables in the MURAM.15241525@Param[in] h_FmPortRx - FM PORT module descriptor1526@Param[in] params - Auto Response parameters15271528@Return E_OK on success; Error code otherwise.15291530@Cautions Allowed only following FM_PORT_Init().1531*//***************************************************************************/1532t_Error FM_PORT_EnterDsar(t_Handle h_FmPortRx, t_FmPortDsarParams *params);15331534/**************************************************************************//**1535@Function FM_PORT_EnterDsarFinal15361537@Description Enter Deep Sleep Auto Response mode.1538This function sets the Tx port in independent mode as needed1539and redirect the receive flow to go through the1540Dsar Fman-ctrl code15411542@Param[in] h_DsarRxPort - FM Rx PORT module descriptor1543@Param[in] h_DsarTxPort - FM Tx PORT module descriptor15441545@Return E_OK on success; Error code otherwise.15461547@Cautions Allowed only following FM_PORT_Init().1548*//***************************************************************************/1549t_Error FM_PORT_EnterDsarFinal(t_Handle h_DsarRxPort, t_Handle h_DsarTxPort);15501551/**************************************************************************//**1552@Function FM_PORT_ExitDsar15531554@Description Exit Deep Sleep Auto Response mode.1555This function reverse the AR mode and put the ports back into1556their original wake mode15571558@Param[in] h_FmPortRx - FM PORT Rx module descriptor1559@Param[in] h_FmPortTx - FM PORT Tx module descriptor15601561@Return E_OK on success; Error code otherwise.15621563@Cautions Allowed only following FM_PORT_EnterDsar().1564*//***************************************************************************/1565void FM_PORT_ExitDsar(t_Handle h_FmPortRx, t_Handle h_FmPortTx);15661567/**************************************************************************//**1568@Function FM_PORT_IsInDsar15691570@Description This function returns TRUE if the port was set as Auto Response1571and FALSE if not. Once Exit AR mode it will return FALSE as well1572until re-enabled once more.15731574@Param[in] h_FmPort - FM PORT module descriptor15751576@Return E_OK on success; Error code otherwise.1577*//***************************************************************************/1578bool FM_PORT_IsInDsar(t_Handle h_FmPort);15791580typedef struct t_FmPortDsarStats1581{1582uint32_t arpArCnt;1583uint32_t echoIcmpv4ArCnt;1584uint32_t ndpArCnt;1585uint32_t echoIcmpv6ArCnt;1586uint32_t snmpGetCnt;1587uint32_t snmpGetNextCnt;1588} t_FmPortDsarStats;15891590/**************************************************************************//**1591@Function FM_PORT_GetDsarStats15921593@Description Return statistics for Deep Sleep Auto Response15941595@Param[in] h_FmPortRx - FM PORT module descriptor1596@Param[out] stats - structure containing the statistics counters15971598@Return E_OK on success; Error code otherwise.1599*//***************************************************************************/1600t_Error FM_PORT_GetDsarStats(t_Handle h_FmPortRx, t_FmPortDsarStats *stats);16011602#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))1603/**************************************************************************//**1604@Function FM_PORT_DumpRegs16051606@Description Dump all regs.16071608Calling this routine invalidates the descriptor.16091610@Param[in] h_FmPort - FM PORT module descriptor16111612@Return E_OK on success; Error code otherwise.16131614@Cautions Allowed only following FM_PORT_Init().1615*//***************************************************************************/1616t_Error FM_PORT_DumpRegs(t_Handle h_FmPort);1617#endif /* (defined(DEBUG_ERRORS) && ... */16181619/**************************************************************************//**1620@Function FM_PORT_GetBufferDataOffset16211622@Description Relevant for Rx ports.1623Returns the data offset from the beginning of the data buffer16241625@Param[in] h_FmPort - FM PORT module descriptor16261627@Return data offset.16281629@Cautions Allowed only following FM_PORT_Init().1630*//***************************************************************************/1631uint32_t FM_PORT_GetBufferDataOffset(t_Handle h_FmPort);16321633/**************************************************************************//**1634@Function FM_PORT_GetBufferICInfo16351636@Description Returns the Internal Context offset from the beginning of the data buffer16371638@Param[in] h_FmPort - FM PORT module descriptor1639@Param[in] p_Data - A pointer to the data buffer.16401641@Return Internal context info pointer on success, NULL if 'allOtherInfo' was not1642configured for this port.16431644@Cautions Allowed only following FM_PORT_Init().1645*//***************************************************************************/1646uint8_t * FM_PORT_GetBufferICInfo(t_Handle h_FmPort, char *p_Data);16471648/**************************************************************************//**1649@Function FM_PORT_GetBufferPrsResult16501651@Description Returns the pointer to the parse result in the data buffer.1652In Rx ports this is relevant after reception, if parse1653result is configured to be part of the data passed to the1654application. For non Rx ports it may be used to get the pointer1655of the area in the buffer where parse result should be1656initialized - if so configured.1657See FM_PORT_ConfigBufferPrefixContent for data buffer prefix1658configuration.16591660@Param[in] h_FmPort - FM PORT module descriptor1661@Param[in] p_Data - A pointer to the data buffer.16621663@Return Parse result pointer on success, NULL if parse result was not1664configured for this port.16651666@Cautions Allowed only following FM_PORT_Init().1667*//***************************************************************************/1668t_FmPrsResult * FM_PORT_GetBufferPrsResult(t_Handle h_FmPort, char *p_Data);16691670/**************************************************************************//**1671@Function FM_PORT_GetBufferTimeStamp16721673@Description Returns the time stamp in the data buffer.1674Relevant for Rx ports for getting the buffer time stamp.1675See FM_PORT_ConfigBufferPrefixContent for data buffer prefix1676configuration.16771678@Param[in] h_FmPort - FM PORT module descriptor1679@Param[in] p_Data - A pointer to the data buffer.16801681@Return A pointer to the hash result on success, NULL otherwise.16821683@Cautions Allowed only following FM_PORT_Init().1684*//***************************************************************************/1685uint64_t * FM_PORT_GetBufferTimeStamp(t_Handle h_FmPort, char *p_Data);16861687/**************************************************************************//**1688@Function FM_PORT_GetBufferHashResult16891690@Description Given a data buffer, on the condition that hash result was defined1691as a part of the buffer content (see FM_PORT_ConfigBufferPrefixContent)1692this routine will return the pointer to the hash result location in the1693buffer prefix.16941695@Param[in] h_FmPort - FM PORT module descriptor1696@Param[in] p_Data - A pointer to the data buffer.16971698@Return A pointer to the hash result on success, NULL otherwise.16991700@Cautions Allowed only following FM_PORT_Init().1701*//***************************************************************************/1702uint8_t * FM_PORT_GetBufferHashResult(t_Handle h_FmPort, char *p_Data);17031704/**************************************************************************//**1705@Function FM_PORT_Disable17061707@Description Gracefully disable an FM port. The port will not start new tasks after all1708tasks associated with the port are terminated.17091710@Param[in] h_FmPort A handle to a FM Port module.17111712@Return E_OK on success; Error code otherwise.17131714@Cautions Allowed only following FM_PORT_Init().1715This is a blocking routine, it returns after port is1716gracefully stopped, i.e. the port will not except new frames,1717but it will finish all frames or tasks which were already began1718*//***************************************************************************/1719t_Error FM_PORT_Disable(t_Handle h_FmPort);17201721/**************************************************************************//**1722@Function FM_PORT_Enable17231724@Description A runtime routine provided to allow disable/enable of port.17251726@Param[in] h_FmPort A handle to a FM Port module.17271728@Return E_OK on success; Error code otherwise.17291730@Cautions Allowed only following FM_PORT_Init().1731*//***************************************************************************/1732t_Error FM_PORT_Enable(t_Handle h_FmPort);17331734/**************************************************************************//**1735@Function FM_PORT_SetRateLimit17361737@Description Calling this routine enables rate limit algorithm.1738By default, this functionality is disabled.1739Note that rate-limit mechanism uses the FM time stamp.1740The selected rate limit specified here would be1741rounded DOWN to the nearest 16M.17421743May be used for Tx and OP ports only17441745@Param[in] h_FmPort A handle to a FM Port module.1746@Param[in] p_RateLimit A structure of rate limit parameters17471748@Return E_OK on success; Error code otherwise.17491750@Cautions Allowed only following FM_PORT_Init().1751If rate limit is set on a port that need to send PFC frames,1752it might violate the stop transmit timing.1753*//***************************************************************************/1754t_Error FM_PORT_SetRateLimit(t_Handle h_FmPort, t_FmPortRateLimit *p_RateLimit);17551756/**************************************************************************//**1757@Function FM_PORT_DeleteRateLimit17581759@Description Calling this routine disables and clears rate limit1760initialization.17611762May be used for Tx and OP ports only17631764@Param[in] h_FmPort A handle to a FM Port module.17651766@Return E_OK on success; Error code otherwise.17671768@Cautions Allowed only following FM_PORT_Init().1769*//***************************************************************************/1770t_Error FM_PORT_DeleteRateLimit(t_Handle h_FmPort);17711772/**************************************************************************//**1773@Function FM_PORT_SetPfcPrioritiesMappingToQmanWQ17741775@Description Calling this routine maps each PFC received priority to the transmit WQ.1776This WQ will be blocked upon receiving a PFC frame with this priority.17771778May be used for Tx ports only.17791780@Param[in] h_FmPort A handle to a FM Port module.1781@Param[in] prio PFC priority (0-7).1782@Param[in] wq Work Queue (0-7).17831784@Return E_OK on success; Error code otherwise.17851786@Cautions Allowed only following FM_PORT_Init().1787*//***************************************************************************/1788t_Error FM_PORT_SetPfcPrioritiesMappingToQmanWQ(t_Handle h_FmPort, uint8_t prio, uint8_t wq);17891790/**************************************************************************//**1791@Function FM_PORT_SetStatisticsCounters17921793@Description Calling this routine enables/disables port's statistics counters.1794By default, counters are enabled.17951796May be used for all port types17971798@Param[in] h_FmPort A handle to a FM Port module.1799@Param[in] enable TRUE to enable, FALSE to disable.18001801@Return E_OK on success; Error code otherwise.18021803@Cautions Allowed only following FM_PORT_Init().1804*//***************************************************************************/1805t_Error FM_PORT_SetStatisticsCounters(t_Handle h_FmPort, bool enable);18061807/**************************************************************************//**1808@Function FM_PORT_SetFrameQueueCounters18091810@Description Calling this routine enables/disables port's enqueue/dequeue counters.1811By default, counters are enabled.18121813May be used for all ports18141815@Param[in] h_FmPort A handle to a FM Port module.1816@Param[in] enable TRUE to enable, FALSE to disable.18171818@Return E_OK on success; Error code otherwise.18191820@Cautions Allowed only following FM_PORT_Init().1821*//***************************************************************************/1822t_Error FM_PORT_SetFrameQueueCounters(t_Handle h_FmPort, bool enable);18231824/**************************************************************************//**1825@Function FM_PORT_AnalyzePerformanceParams18261827@Description User may call this routine to so the driver will analyze if the1828basic performance parameters are correct and also the driver may1829suggest of improvements; The basic parameters are FIFO sizes, number1830of DMAs and number of TNUMs for the port.18311832May be used for all port types18331834@Param[in] h_FmPort A handle to a FM Port module.18351836@Return E_OK on success; Error code otherwise.18371838@Cautions Allowed only following FM_PORT_Init().1839*//***************************************************************************/1840t_Error FM_PORT_AnalyzePerformanceParams(t_Handle h_FmPort);184118421843/**************************************************************************//**1844@Function FM_PORT_SetAllocBufCounter18451846@Description Calling this routine enables/disables BM pool allocate1847buffer counters.1848By default, counters are enabled.18491850May be used for Rx ports only18511852@Param[in] h_FmPort A handle to a FM Port module.1853@Param[in] poolId BM pool id.1854@Param[in] enable TRUE to enable, FALSE to disable.18551856@Return E_OK on success; Error code otherwise.18571858@Cautions Allowed only following FM_PORT_Init().1859*//***************************************************************************/1860t_Error FM_PORT_SetAllocBufCounter(t_Handle h_FmPort, uint8_t poolId, bool enable);18611862/**************************************************************************//**1863@Function FM_PORT_GetBmiCounters18641865@Description Read port's BMI stat counters and place them into1866a designated structure of counters.18671868@Param[in] h_FmPort A handle to a FM Port module.1869@Param[out] p_BmiStats counters structure18701871@Return E_OK on success; Error code otherwise.18721873@Cautions Allowed only following FM_PORT_Init().1874*//***************************************************************************/1875t_Error FM_PORT_GetBmiCounters(t_Handle h_FmPort, t_FmPortBmiStats *p_BmiStats);18761877/**************************************************************************//**1878@Function FM_PORT_GetCounter18791880@Description Reads one of the FM PORT counters.18811882@Param[in] h_FmPort A handle to a FM Port module.1883@Param[in] fmPortCounter The requested counter.18841885@Return Counter's current value.18861887@Cautions Allowed only following FM_PORT_Init().1888Note that it is user's responsibility to call this routine only1889for enabled counters, and there will be no indication if a1890disabled counter is accessed.1891*//***************************************************************************/1892uint32_t FM_PORT_GetCounter(t_Handle h_FmPort, e_FmPortCounters fmPortCounter);18931894/**************************************************************************//**1895@Function FM_PORT_ModifyCounter18961897@Description Sets a value to an enabled counter. Use "0" to reset the counter.18981899@Param[in] h_FmPort A handle to a FM Port module.1900@Param[in] fmPortCounter The requested counter.1901@Param[in] value The requested value to be written into the counter.19021903@Return E_OK on success; Error code otherwise.19041905@Cautions Allowed only following FM_PORT_Init().1906*//***************************************************************************/1907t_Error FM_PORT_ModifyCounter(t_Handle h_FmPort, e_FmPortCounters fmPortCounter, uint32_t value);19081909/**************************************************************************//**1910@Function FM_PORT_GetAllocBufCounter19111912@Description Reads one of the FM PORT buffer counters.19131914@Param[in] h_FmPort A handle to a FM Port module.1915@Param[in] poolId The requested pool.19161917@Return Counter's current value.19181919@Cautions Allowed only following FM_PORT_Init().1920Note that it is user's responsibility to call this routine only1921for enabled counters, and there will be no indication if a1922disabled counter is accessed.1923*//***************************************************************************/1924uint32_t FM_PORT_GetAllocBufCounter(t_Handle h_FmPort, uint8_t poolId);19251926/**************************************************************************//**1927@Function FM_PORT_ModifyAllocBufCounter19281929@Description Sets a value to an enabled counter. Use "0" to reset the counter.19301931@Param[in] h_FmPort A handle to a FM Port module.1932@Param[in] poolId The requested pool.1933@Param[in] value The requested value to be written into the counter.19341935@Return E_OK on success; Error code otherwise.19361937@Cautions Allowed only following FM_PORT_Init().1938*//***************************************************************************/1939t_Error FM_PORT_ModifyAllocBufCounter(t_Handle h_FmPort, uint8_t poolId, uint32_t value);19401941/**************************************************************************//**1942@Function FM_PORT_AddCongestionGrps19431944@Description This routine effects the corresponding Tx port.1945It should be called in order to enable pause1946frame transmission in case of congestion in one or more1947of the congestion groups relevant to this port.1948Each call to this routine may add one or more congestion1949groups to be considered relevant to this port.19501951May be used for Rx, or RX+OP ports only (depending on chip)19521953@Param[in] h_FmPort A handle to a FM Port module.1954@Param[in] p_CongestionGrps A pointer to an array of congestion groups1955id's to consider.19561957@Return E_OK on success; Error code otherwise.19581959@Cautions Allowed only following FM_PORT_Init().1960*//***************************************************************************/1961t_Error FM_PORT_AddCongestionGrps(t_Handle h_FmPort, t_FmPortCongestionGrps *p_CongestionGrps);19621963/**************************************************************************//**1964@Function FM_PORT_RemoveCongestionGrps19651966@Description This routine effects the corresponding Tx port. It should be1967called when congestion groups were1968defined for this port and are no longer relevant, or pause1969frames transmitting is not required on their behalf.1970Each call to this routine may remove one or more congestion1971groups to be considered relevant to this port.19721973May be used for Rx, or RX+OP ports only (depending on chip)19741975@Param[in] h_FmPort A handle to a FM Port module.1976@Param[in] p_CongestionGrps A pointer to an array of congestion groups1977id's to consider.19781979@Return E_OK on success; Error code otherwise.19801981@Cautions Allowed only following FM_PORT_Init().1982*//***************************************************************************/1983t_Error FM_PORT_RemoveCongestionGrps(t_Handle h_FmPort, t_FmPortCongestionGrps *p_CongestionGrps);19841985/**************************************************************************//**1986@Function FM_PORT_IsStalled19871988@Description A routine for checking whether the specified port is stalled.19891990@Param[in] h_FmPort A handle to a FM Port module.19911992@Return TRUE if port is stalled, FALSE otherwize19931994@Cautions Allowed only following FM_PORT_Init().1995*//***************************************************************************/1996bool FM_PORT_IsStalled(t_Handle h_FmPort);19971998/**************************************************************************//**1999@Function FM_PORT_ReleaseStalled20002001@Description This routine may be called in case the port was stalled and may2002now be released.2003Note that this routine is available only on older FMan revisions2004(FMan v2, DPAA v1.0 only).20052006@Param[in] h_FmPort A handle to a FM Port module.20072008@Return E_OK on success; Error code otherwise.20092010@Cautions Allowed only following FM_PORT_Init().2011*//***************************************************************************/2012t_Error FM_PORT_ReleaseStalled(t_Handle h_FmPort);20132014/**************************************************************************//**2015@Function FM_PORT_SetRxL4ChecksumVerify20162017@Description This routine is relevant for Rx ports (1G and 10G). The routine2018set/clear the L3/L4 checksum verification (on RX side).2019Note that this takes affect only if hw-parser is enabled!20202021@Param[in] h_FmPort A handle to a FM Port module.2022@Param[in] l4Checksum boolean indicates whether to do L3/L4 checksum2023on frames or not.20242025@Return E_OK on success; Error code otherwise.20262027@Cautions Allowed only following FM_PORT_Init().2028*//***************************************************************************/2029t_Error FM_PORT_SetRxL4ChecksumVerify(t_Handle h_FmPort, bool l4Checksum);20302031/**************************************************************************//**2032@Function FM_PORT_SetErrorsRoute20332034@Description Errors selected for this routine will cause a frame with that error2035to be enqueued to error queue.2036Errors not selected for this routine will cause a frame with that error2037to be enqueued to the one of the other port queues.2038By default all errors are defined to be enqueued to error queue.2039Errors that were configured to be discarded (at initialization)2040may not be selected here.20412042May be used for Rx and OP ports only20432044@Param[in] h_FmPort A handle to a FM Port module.2045@Param[in] errs A list of errors to enqueue to error queue20462047@Return E_OK on success; Error code otherwise.20482049@Cautions Allowed only following FM_PORT_Config() and before FM_PORT_Init().2050*//***************************************************************************/2051t_Error FM_PORT_SetErrorsRoute(t_Handle h_FmPort, fmPortFrameErrSelect_t errs);20522053/**************************************************************************//**2054@Function FM_PORT_SetIMExceptions20552056@Description Calling this routine enables/disables FM PORT interrupts.20572058@Param[in] h_FmPort FM PORT module descriptor.2059@Param[in] exception The exception to be selected.2060@Param[in] enable TRUE to enable interrupt, FALSE to mask it.20612062@Return E_OK on success; Error code otherwise.20632064@Cautions Allowed only following FM_PORT_Init().2065This routine should NOT be called from guest-partition2066(i.e. guestId != NCSW_MASTER_ID)2067*//***************************************************************************/2068t_Error FM_PORT_SetIMExceptions(t_Handle h_FmPort, e_FmPortExceptions exception, bool enable);20692070/**************************************************************************//*2071@Function FM_PORT_SetPerformanceCounters20722073@Description Calling this routine enables/disables port's performance counters.2074By default, counters are enabled.20752076May be used for all port types20772078@Param[in] h_FmPort A handle to a FM Port module.2079@Param[in] enable TRUE to enable, FALSE to disable.20802081@Return E_OK on success; Error code otherwise.20822083@Cautions Allowed only following FM_PORT_Init().2084*//***************************************************************************/2085t_Error FM_PORT_SetPerformanceCounters(t_Handle h_FmPort, bool enable);20862087/**************************************************************************//*2088@Function FM_PORT_SetPerformanceCountersParams20892090@Description Calling this routine defines port's performance2091counters parameters.20922093May be used for all port types20942095@Param[in] h_FmPort A handle to a FM Port module.2096@Param[in] p_FmPortPerformanceCnt A pointer to a structure of performance2097counters parameters.20982099@Return E_OK on success; Error code otherwise.21002101@Cautions Allowed only following FM_PORT_Init().2102*//***************************************************************************/2103t_Error FM_PORT_SetPerformanceCountersParams(t_Handle h_FmPort, t_FmPortPerformanceCnt *p_FmPortPerformanceCnt);21042105/**************************************************************************//**2106@Group FM_PORT_pcd_runtime_control_grp FM Port PCD Runtime Control Unit21072108@Description FM Port PCD Runtime control unit API functions, definitions and enums.21092110@{2111*//***************************************************************************/21122113/**************************************************************************//**2114@Description A structure defining the KG scheme after the parser.2115This is relevant only to change scheme selection mode - from2116direct to indirect and vice versa, or when the scheme is selected directly,2117to select the scheme id.21182119*//***************************************************************************/2120typedef struct t_FmPcdKgSchemeSelect {2121bool direct; /**< TRUE to use 'h_Scheme' directly, FALSE to use LCV. */2122t_Handle h_DirectScheme; /**< Scheme handle, selects the scheme after parser;2123Relevant only when 'direct' is TRUE. */2124} t_FmPcdKgSchemeSelect;21252126/**************************************************************************//**2127@Description A structure of scheme parameters2128*//***************************************************************************/2129typedef struct t_FmPcdPortSchemesParams {2130uint8_t numOfSchemes; /**< Number of schemes for port to be bound to. */2131t_Handle h_Schemes[FM_PCD_KG_NUM_OF_SCHEMES]; /**< Array of 'numOfSchemes' schemes for the2132port to be bound to */2133} t_FmPcdPortSchemesParams;21342135/**************************************************************************//**2136@Description Union for defining port protocol parameters for parser2137*//***************************************************************************/2138typedef union u_FmPcdHdrPrsOpts {2139/* MPLS */2140struct {2141bool labelInterpretationEnable; /**< When this bit is set, the last MPLS label will be2142interpreted as described in HW spec table. When the bit2143is cleared, the parser will advance to MPLS next parse */2144e_NetHeaderType nextParse; /**< must be equal or higher than IPv4 */2145} mplsPrsOptions;2146/* VLAN */2147struct {2148uint16_t tagProtocolId1; /**< User defined Tag Protocol Identifier, to be recognized2149on VLAN TAG on top of 0x8100 and 0x88A8 */2150uint16_t tagProtocolId2; /**< User defined Tag Protocol Identifier, to be recognized2151on VLAN TAG on top of 0x8100 and 0x88A8 */2152} vlanPrsOptions;2153/* PPP */2154struct{2155bool enableMTUCheck; /**< Check validity of MTU according to RFC2516 */2156} pppoePrsOptions;21572158/* IPV6 */2159struct{2160bool routingHdrEnable; /**< TRUE to enable routing header, otherwise ignore */2161} ipv6PrsOptions;21622163/* UDP */2164struct{2165bool padIgnoreChecksum; /**< TRUE to ignore pad in checksum */2166} udpPrsOptions;21672168/* TCP */2169struct {2170bool padIgnoreChecksum; /**< TRUE to ignore pad in checksum */2171} tcpPrsOptions;2172} u_FmPcdHdrPrsOpts;21732174/**************************************************************************//**2175@Description A structure for defining each header for the parser2176*//***************************************************************************/2177typedef struct t_FmPcdPrsAdditionalHdrParams {2178e_NetHeaderType hdr; /**< Selected header; use HEADER_TYPE_NONE2179to indicate that sw parser is to run first2180(before HW parser, and independent of the2181existence of any protocol), in this case,2182swPrsEnable must be set, and all other2183parameters are irrelevant. */2184bool errDisable; /**< TRUE to disable error indication */2185bool swPrsEnable; /**< Enable jump to SW parser when this2186header is recognized by the HW parser. */2187uint8_t indexPerHdr; /**< Normally 0, if more than one sw parser2188attachments exists for the same header,2189(in the main sw parser code) use this2190index to distinguish between them. */2191bool usePrsOpts; /**< TRUE to use parser options. */2192u_FmPcdHdrPrsOpts prsOpts; /**< A union according to header type,2193defining the parser options selected.*/2194} t_FmPcdPrsAdditionalHdrParams;21952196/**************************************************************************//**2197@Description struct for defining port PCD parameters2198*//***************************************************************************/2199typedef struct t_FmPortPcdPrsParams {2200uint8_t prsResultPrivateInfo; /**< The private info provides a method of inserting2201port information into the parser result. This information2202may be extracted by Keygen and be used for frames2203distribution when a per-port distinction is required,2204it may also be used as a port logical id for analyzing2205incoming frames. */2206uint8_t parsingOffset; /**< Number of bytes from beginning of packet to start parsing */2207e_NetHeaderType firstPrsHdr; /**< The type of the first header expected at 'parsingOffset' */2208bool includeInPrsStatistics; /**< TRUE to include this port in the parser statistics;2209NOTE: this field is not valid when the FM is in "guest" mode2210and IPC is not available. */2211uint8_t numOfHdrsWithAdditionalParams; /**< Normally 0, some headers may get2212special parameters */2213t_FmPcdPrsAdditionalHdrParams additionalParams[FM_PCD_PRS_NUM_OF_HDRS];2214/**< 'numOfHdrsWithAdditionalParams' structures2215of additional parameters2216for each header that requires them */2217bool setVlanTpid1; /**< TRUE to configure user selection of Ethertype to2218indicate a VLAN tag (in addition to the TPID values22190x8100 and 0x88A8). */2220uint16_t vlanTpid1; /**< extra tag to use if setVlanTpid1=TRUE. */2221bool setVlanTpid2; /**< TRUE to configure user selection of Ethertype to2222indicate a VLAN tag (in addition to the TPID values22230x8100 and 0x88A8). */2224uint16_t vlanTpid2; /**< extra tag to use if setVlanTpid1=TRUE. */2225} t_FmPortPcdPrsParams;22262227/**************************************************************************//**2228@Description struct for defining coarse alassification parameters2229*//***************************************************************************/2230typedef struct t_FmPortPcdCcParams {2231t_Handle h_CcTree; /**< A handle to a CC tree */2232} t_FmPortPcdCcParams;22332234/**************************************************************************//**2235@Description struct for defining keygen parameters2236*//***************************************************************************/2237typedef struct t_FmPortPcdKgParams {2238uint8_t numOfSchemes; /**< Number of schemes for port to be bound to. */2239t_Handle h_Schemes[FM_PCD_KG_NUM_OF_SCHEMES];2240/**< Array of 'numOfSchemes' schemes handles for the2241port to be bound to */2242bool directScheme; /**< TRUE for going from parser to a specific scheme,2243regardless of parser result */2244t_Handle h_DirectScheme; /**< relevant only if direct == TRUE, Scheme handle,2245as returned by FM_PCD_KgSetScheme */2246} t_FmPortPcdKgParams;22472248/**************************************************************************//**2249@Description struct for defining policer parameters2250*//***************************************************************************/2251typedef struct t_FmPortPcdPlcrParams {2252t_Handle h_Profile; /**< Selected profile handle */2253} t_FmPortPcdPlcrParams;22542255/**************************************************************************//**2256@Description struct for defining port PCD parameters2257*//***************************************************************************/2258typedef struct t_FmPortPcdParams {2259e_FmPortPcdSupport pcdSupport; /**< Relevant for Rx and offline ports only.2260Describes the active PCD engines for this port. */2261t_Handle h_NetEnv; /**< HL Unused in PLCR only mode */2262t_FmPortPcdPrsParams *p_PrsParams; /**< Parser parameters for this port */2263t_FmPortPcdCcParams *p_CcParams; /**< Coarse classification parameters for this port */2264t_FmPortPcdKgParams *p_KgParams; /**< Keygen parameters for this port */2265t_FmPortPcdPlcrParams *p_PlcrParams; /**< Policer parameters for this port; Relevant for one of2266following cases:2267e_FM_PORT_PCD_SUPPORT_PLCR_ONLY or2268e_FM_PORT_PCD_SUPPORT_PRS_AND_PLCR were selected,2269or if any flow uses a KG scheme were policer2270profile is not generated2271('bypassPlcrProfileGeneration selected'). */2272t_Handle h_IpReassemblyManip; /**< IP Reassembly manipulation */2273#if (DPAA_VERSION >= 11)2274t_Handle h_CapwapReassemblyManip;/**< CAPWAP Reassembly manipulation */2275#endif /* (DPAA_VERSION >= 11) */2276} t_FmPortPcdParams;22772278/**************************************************************************//**2279@Description A structure for defining the Parser starting point2280*//***************************************************************************/2281typedef struct t_FmPcdPrsStart {2282uint8_t parsingOffset; /**< Number of bytes from beginning of packet to2283start parsing */2284e_NetHeaderType firstPrsHdr; /**< The type of the first header axpected at2285'parsingOffset' */2286} t_FmPcdPrsStart;22872288#if (DPAA_VERSION >= 11)2289/**************************************************************************//**2290@Description struct for defining external buffer margins2291*//***************************************************************************/2292typedef struct t_FmPortVSPAllocParams {2293uint8_t numOfProfiles; /**< Number of Virtual Storage Profiles; must be a power of 2 */2294uint8_t dfltRelativeId; /**< The default Virtual-Storage-Profile-id dedicated to Rx/OP port2295The same default Virtual-Storage-Profile-id will be for coupled Tx port2296if relevant function called for Rx port */2297t_Handle h_FmTxPort; /**< Handle to coupled Tx Port; not relevant for OP port. */2298} t_FmPortVSPAllocParams;2299#endif /* (DPAA_VERSION >= 11) */230023012302/**************************************************************************//**2303@Function FM_PORT_SetPCD23042305@Description Calling this routine defines the port's PCD configuration.2306It changes it from its default configuration which is PCD2307disabled (BMI to BMI) and configures it according to the passed2308parameters.23092310May be used for Rx and OP ports only23112312@Param[in] h_FmPort A handle to a FM Port module.2313@Param[in] p_FmPortPcd A Structure of parameters defining the port's PCD2314configuration.23152316@Return E_OK on success; Error code otherwise.23172318@Cautions Allowed only following FM_PORT_Init().2319*//***************************************************************************/2320t_Error FM_PORT_SetPCD(t_Handle h_FmPort, t_FmPortPcdParams *p_FmPortPcd);23212322/**************************************************************************//**2323@Function FM_PORT_DeletePCD23242325@Description Calling this routine releases the port's PCD configuration.2326The port returns to its default configuration which is PCD2327disabled (BMI to BMI) and all PCD configuration is removed.23282329May be used for Rx and OP ports which are2330in PCD mode only23312332@Param[in] h_FmPort A handle to a FM Port module.23332334@Return E_OK on success; Error code otherwise.23352336@Cautions Allowed only following FM_PORT_Init().2337*//***************************************************************************/2338t_Error FM_PORT_DeletePCD(t_Handle h_FmPort);23392340/**************************************************************************//**2341@Function FM_PORT_AttachPCD23422343@Description This routine may be called after FM_PORT_DetachPCD was called,2344to return to the originally configured PCD support flow.2345The couple of routines are used to allow PCD configuration changes2346that demand that PCD will not be used while changes take place.23472348May be used for Rx and OP ports which are2349in PCD mode only23502351@Param[in] h_FmPort A handle to a FM Port module.23522353@Return E_OK on success; Error code otherwise.23542355@Cautions Allowed only following FM_PORT_Init().2356*//***************************************************************************/2357t_Error FM_PORT_AttachPCD(t_Handle h_FmPort);23582359/**************************************************************************//**2360@Function FM_PORT_DetachPCD23612362@Description Calling this routine detaches the port from its PCD functionality.2363The port returns to its default flow which is BMI to BMI.23642365May be used for Rx and OP ports which are2366in PCD mode only23672368@Param[in] h_FmPort A handle to a FM Port module.23692370@Return E_OK on success; Error code otherwise.23712372@Cautions Allowed only following FM_PORT_AttachPCD().2373*//***************************************************************************/2374t_Error FM_PORT_DetachPCD(t_Handle h_FmPort);23752376/**************************************************************************//**2377@Function FM_PORT_PcdPlcrAllocProfiles23782379@Description This routine may be called only for ports that use the Policer in2380order to allocate private policer profiles.23812382@Param[in] h_FmPort A handle to a FM Port module.2383@Param[in] numOfProfiles The number of required policer profiles23842385@Return E_OK on success; Error code otherwise.23862387@Cautions Allowed only following FM_PORT_Init() and FM_PCD_Init(),2388and before FM_PORT_SetPCD().2389*//***************************************************************************/2390t_Error FM_PORT_PcdPlcrAllocProfiles(t_Handle h_FmPort, uint16_t numOfProfiles);23912392/**************************************************************************//**2393@Function FM_PORT_PcdPlcrFreeProfiles23942395@Description This routine should be called for freeing private policer profiles.23962397@Param[in] h_FmPort A handle to a FM Port module.23982399@Return E_OK on success; Error code otherwise.24002401@Cautions Allowed only following FM_PORT_Init() and FM_PCD_Init(),2402and before FM_PORT_SetPCD().2403*//***************************************************************************/2404t_Error FM_PORT_PcdPlcrFreeProfiles(t_Handle h_FmPort);24052406#if (DPAA_VERSION >= 11)2407/**************************************************************************//**2408@Function FM_PORT_VSPAlloc24092410@Description This routine allocated VSPs per port and forces the port to work2411in VSP mode. Note that the port is initialized by default with the2412physical-storage-profile only.24132414@Param[in] h_FmPort A handle to a FM Port module.2415@Param[in] p_Params A structure of parameters for allocation VSP's per port24162417@Return E_OK on success; Error code otherwise.24182419@Cautions Allowed only following FM_PORT_Init(), and before FM_PORT_SetPCD()2420and also before FM_PORT_Enable(); i.e. the port should be disabled.2421*//***************************************************************************/2422t_Error FM_PORT_VSPAlloc(t_Handle h_FmPort, t_FmPortVSPAllocParams *p_Params);2423#endif /* (DPAA_VERSION >= 11) */24242425/**************************************************************************//**2426@Function FM_PORT_PcdKgModifyInitialScheme24272428@Description This routine may be called only for ports that use the keygen in2429order to change the initial scheme frame should be routed to.2430The change may be of a scheme id (in case of direct mode),2431from direct to indirect, or from indirect to direct - specifying the scheme id.24322433@Param[in] h_FmPort A handle to a FM Port module.2434@Param[in] p_FmPcdKgScheme A structure of parameters for defining whether2435a scheme is direct/indirect, and if direct - scheme id.24362437@Return E_OK on success; Error code otherwise.24382439@Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD().2440*//***************************************************************************/2441t_Error FM_PORT_PcdKgModifyInitialScheme (t_Handle h_FmPort, t_FmPcdKgSchemeSelect *p_FmPcdKgScheme);24422443/**************************************************************************//**2444@Function FM_PORT_PcdPlcrModifyInitialProfile24452446@Description This routine may be called for ports with flows2447e_FM_PORT_PCD_SUPPORT_PLCR_ONLY or e_FM_PORT_PCD_SUPPORT_PRS_AND_PLCR2448only, to change the initial Policer profile frame should be2449routed to. The change may be of a profile and/or absolute/direct2450mode selection.24512452@Param[in] h_FmPort A handle to a FM Port module.2453@Param[in] h_Profile Policer profile handle24542455@Return E_OK on success; Error code otherwise.24562457@Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD().2458*//***************************************************************************/2459t_Error FM_PORT_PcdPlcrModifyInitialProfile (t_Handle h_FmPort, t_Handle h_Profile);24602461/**************************************************************************//**2462@Function FM_PORT_PcdCcModifyTree24632464@Description This routine may be called for ports that use coarse classification tree2465if the user wishes to replace the tree. The routine may not be called while port2466receives packets using the PCD functionalities, therefor port must be first detached2467from the PCD, only than the routine may be called, and than port be attached to PCD again.24682469@Param[in] h_FmPort A handle to a FM Port module.2470@Param[in] h_CcTree A CC tree that was already built. The tree id as returned from2471the BuildTree routine.24722473@Return E_OK on success; Error code otherwise.24742475@Cautions Allowed only following FM_PORT_Init(), FM_PORT_SetPCD() and FM_PORT_DetachPCD()2476*//***************************************************************************/2477t_Error FM_PORT_PcdCcModifyTree (t_Handle h_FmPort, t_Handle h_CcTree);24782479/**************************************************************************//**2480@Function FM_PORT_PcdKgBindSchemes24812482@Description These routines may be called for adding more schemes for the2483port to be bound to. The selected schemes are not added,2484just this specific port starts using them.24852486@Param[in] h_FmPort A handle to a FM Port module.2487@Param[in] p_PortScheme A structure defining the list of schemes to be added.24882489@Return E_OK on success; Error code otherwise.24902491@Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD().2492*//***************************************************************************/2493t_Error FM_PORT_PcdKgBindSchemes (t_Handle h_FmPort, t_FmPcdPortSchemesParams *p_PortScheme);24942495/**************************************************************************//**2496@Function FM_PORT_PcdKgUnbindSchemes24972498@Description These routines may be called for adding more schemes for the2499port to be bound to. The selected schemes are not removed or invalidated,2500just this specific port stops using them.25012502@Param[in] h_FmPort A handle to a FM Port module.2503@Param[in] p_PortScheme A structure defining the list of schemes to be added.25042505@Return E_OK on success; Error code otherwise.25062507@Cautions Allowed only following FM_PORT_Init() and FM_PORT_SetPCD().2508*//***************************************************************************/2509t_Error FM_PORT_PcdKgUnbindSchemes (t_Handle h_FmPort, t_FmPcdPortSchemesParams *p_PortScheme);25102511/**************************************************************************//**2512@Function FM_PORT_GetIPv4OptionsCount25132514@Description TODO25152516@Param[in] h_FmPort A handle to a FM Port module.2517@Param[out] p_Ipv4OptionsCount will hold the counter value25182519@Return E_OK on success; Error code otherwise.25202521@Cautions Allowed only following FM_PORT_Init()2522*//***************************************************************************/2523t_Error FM_PORT_GetIPv4OptionsCount(t_Handle h_FmPort, uint32_t *p_Ipv4OptionsCount);25242525/** @} */ /* end of FM_PORT_pcd_runtime_control_grp group */2526/** @} */ /* end of FM_PORT_runtime_control_grp group */252725282529/**************************************************************************//**2530@Group FM_PORT_runtime_data_grp FM Port Runtime Data-path Unit25312532@Description FM Port Runtime data unit API functions, definitions and enums.2533This API is valid only if working in Independent-Mode.25342535@{2536*//***************************************************************************/25372538/**************************************************************************//**2539@Function FM_PORT_ImTx25402541@Description Tx function, called to transmit a data buffer on the port.25422543@Param[in] h_FmPort A handle to a FM Port module.2544@Param[in] p_Data A pointer to an LCP data buffer.2545@Param[in] length Size of data for transmission.2546@Param[in] lastBuffer Buffer position - TRUE for the last buffer2547of a frame, including a single buffer frame2548@Param[in] h_BufContext A handle of the user acossiated with this buffer25492550@Return E_OK on success; Error code otherwise.25512552@Cautions Allowed only following FM_PORT_Init().2553NOTE - This routine can be used only when working in2554Independent-Mode mode.2555*//***************************************************************************/2556t_Error FM_PORT_ImTx( t_Handle h_FmPort,2557uint8_t *p_Data,2558uint16_t length,2559bool lastBuffer,2560t_Handle h_BufContext);25612562/**************************************************************************//**2563@Function FM_PORT_ImTxConf25642565@Description Tx port confirmation routine, optional, may be called to verify2566transmission of all frames. The procedure performed by this2567routine will be performed automatically on next buffer transmission,2568but if desired, calling this routine will invoke this action on2569demand.25702571@Param[in] h_FmPort A handle to a FM Port module.25722573@Cautions Allowed only following FM_PORT_Init().2574NOTE - This routine can be used only when working in2575Independent-Mode mode.2576*//***************************************************************************/2577void FM_PORT_ImTxConf(t_Handle h_FmPort);25782579/**************************************************************************//**2580@Function FM_PORT_ImRx25812582@Description Rx function, may be called to poll for received buffers.2583Normally, Rx process is invoked by the driver on Rx interrupt.2584Alternatively, this routine may be called on demand.25852586@Param[in] h_FmPort A handle to a FM Port module.25872588@Return E_OK on success; Error code otherwise.25892590@Cautions Allowed only following FM_PORT_Init().2591NOTE - This routine can be used only when working in2592Independent-Mode mode.2593*//***************************************************************************/2594t_Error FM_PORT_ImRx(t_Handle h_FmPort);25952596/** @} */ /* end of FM_PORT_runtime_data_grp group */2597/** @} */ /* end of FM_PORT_grp group */2598/** @} */ /* end of FM_grp group */2599260026012602#ifdef NCSW_BACKWARD_COMPATIBLE_API2603#define FM_PORT_ConfigTxFifoDeqPipelineDepth FM_PORT_ConfigFifoDeqPipelineDepth2604#endif /* NCSW_BACKWARD_COMPATIBLE_API */260526062607#endif /* __FM_PORT_EXT */260826092610