12ffc1057SHemant Agrawal /* SPDX-License-Identifier: BSD-3-Clause 22ffc1057SHemant Agrawal * Copyright 2008-2012 Freescale Semiconductor Inc. 32ffc1057SHemant Agrawal * Copyright 2017-2020 NXP 42ffc1057SHemant Agrawal */ 52ffc1057SHemant Agrawal 62ffc1057SHemant Agrawal #ifndef __FM_PORT_EXT_H 72ffc1057SHemant Agrawal #define __FM_PORT_EXT_H 82ffc1057SHemant Agrawal 92ffc1057SHemant Agrawal #include <errno.h> 102ffc1057SHemant Agrawal #include "ncsw_ext.h" 112ffc1057SHemant Agrawal #include "fm_pcd_ext.h" 122ffc1057SHemant Agrawal #include "fm_ext.h" 132ffc1057SHemant Agrawal #include "net_ext.h" 142ffc1057SHemant Agrawal #include "dpaa_integration.h" 152ffc1057SHemant Agrawal 162ffc1057SHemant Agrawal /* 172ffc1057SHemant Agrawal * @Description FM Port routines 182ffc1057SHemant Agrawal */ 192ffc1057SHemant Agrawal 202ffc1057SHemant Agrawal /* 212ffc1057SHemant Agrawal * 222ffc1057SHemant Agrawal * @Group lnx_ioctl_FM_grp Frame Manager Linux IOCTL API 232ffc1057SHemant Agrawal * 242ffc1057SHemant Agrawal * @Description FM Linux ioctls definitions and enums 252ffc1057SHemant Agrawal * 262ffc1057SHemant Agrawal * @{ 272ffc1057SHemant Agrawal */ 282ffc1057SHemant Agrawal 292ffc1057SHemant Agrawal /* 302ffc1057SHemant Agrawal * @Group lnx_ioctl_FM_PORT_grp FM Port 312ffc1057SHemant Agrawal * 322ffc1057SHemant Agrawal * @Description FM Port API 332ffc1057SHemant Agrawal * 342ffc1057SHemant Agrawal * The FM uses a general module called "port" to represent a Tx 352ffc1057SHemant Agrawal * port (MAC), an Rx port (MAC), offline parsing flow or host 362ffc1057SHemant Agrawal * command flow. There may be up to 17 (may change) ports in an 372ffc1057SHemant Agrawal * FM - 5 Tx ports (4 for the 1G MACs, 1 for the 10G MAC), 5 Rx 382ffc1057SHemant Agrawal * Ports, and 7 Host command/Offline parsing ports. The SW driver 392ffc1057SHemant Agrawal * manages these ports as sub-modules of the FM, i.e. after an FM 402ffc1057SHemant Agrawal * is initialized, its ports may be initialized and operated 412ffc1057SHemant Agrawal * upon. 422ffc1057SHemant Agrawal * 432ffc1057SHemant Agrawal * The port is initialized aware of its type, but other functions 442ffc1057SHemant Agrawal * on a port may be indifferent to its type. When necessary, the 452ffc1057SHemant Agrawal * driver verifies coherency and returns error if applicable. 462ffc1057SHemant Agrawal * 472ffc1057SHemant Agrawal * On initialization, user specifies the port type and it's index 482ffc1057SHemant Agrawal * (relative to the port's type). Host command and Offline 492ffc1057SHemant Agrawal * parsing ports share the same id range, I.e user may not 502ffc1057SHemant Agrawal * initialized host command port 0 and offline parsing port 0. 512ffc1057SHemant Agrawal * 522ffc1057SHemant Agrawal * @{ 532ffc1057SHemant Agrawal */ 542ffc1057SHemant Agrawal 552ffc1057SHemant Agrawal /* 562ffc1057SHemant Agrawal * @Description An enum for defining port PCD modes. 572ffc1057SHemant Agrawal * (Must match enum e_fm_port_pcd_support defined in 582ffc1057SHemant Agrawal * fm_port_ext.h) 592ffc1057SHemant Agrawal * 602ffc1057SHemant Agrawal * This enum defines the superset of PCD engines support - i.e. 612ffc1057SHemant Agrawal * not all engines have to be used, but all have to be enabled. 622ffc1057SHemant Agrawal * The real flow of a specific frame depends on the PCD 632ffc1057SHemant Agrawal * configuration and the frame headers and payload. Note: the 642ffc1057SHemant Agrawal * first engine and the first engine after the parser (if exists) 652ffc1057SHemant Agrawal * should be in order, the order is important as it will define 662ffc1057SHemant Agrawal * the flow of the port. However, as for the rest engines (the 672ffc1057SHemant Agrawal * ones that follows), the order is not important anymore as it 682ffc1057SHemant Agrawal * is defined by the PCD graph itself. 692ffc1057SHemant Agrawal */ 702ffc1057SHemant Agrawal typedef enum ioc_fm_port_pcd_support { 712ffc1057SHemant Agrawal e_IOC_FM_PCD_NONE = 0 722ffc1057SHemant Agrawal /**< BMI to BMI, PCD is not used */ 732ffc1057SHemant Agrawal , e_IOC_FM_PCD_PRS_ONLY /**< Use only Parser */ 742ffc1057SHemant Agrawal , e_IOC_FM_PCD_PLCR_ONLY /**< Use only Policer */ 752ffc1057SHemant Agrawal , e_IOC_FM_PCD_PRS_PLCR/**< Use Parser and Policer */ 762ffc1057SHemant Agrawal , e_IOC_FM_PCD_PRS_KG /**< Use Parser and Keygen */ 772ffc1057SHemant Agrawal , e_IOC_FM_PCD_PRS_KG_AND_CC 782ffc1057SHemant Agrawal /**< Use Parser, Keygen and Coarse Classification */ 792ffc1057SHemant Agrawal , e_IOC_FM_PCD_PRS_KG_AND_CC_AND_PLCR 802ffc1057SHemant Agrawal /**< Use all PCD engines */ 812ffc1057SHemant Agrawal , e_IOC_FM_PCD_PRS_KG_AND_PLCR 822ffc1057SHemant Agrawal /**< Use Parser, Keygen and Policer */ 832ffc1057SHemant Agrawal , e_IOC_FM_PCD_PRS_CC 842ffc1057SHemant Agrawal /**< Use Parser and Coarse Classification */ 852ffc1057SHemant Agrawal , e_IOC_FM_PCD_PRS_CC_AND_PLCR 862ffc1057SHemant Agrawal /**< Use Parser and Coarse Classification and Policer */ 872ffc1057SHemant Agrawal , e_IOC_FM_PCD_CC_ONLY 882ffc1057SHemant Agrawal /**< Use only Coarse Classification */ 892ffc1057SHemant Agrawal } ioc_fm_port_pcd_support; 902ffc1057SHemant Agrawal 912ffc1057SHemant Agrawal /* 922ffc1057SHemant Agrawal * @Collection FM Frame error 932ffc1057SHemant Agrawal */ 942ffc1057SHemant Agrawal typedef uint32_t ioc_fm_port_frame_err_select_t; 952ffc1057SHemant Agrawal /**< typedef for defining Frame Descriptor errors */ 962ffc1057SHemant Agrawal 972ffc1057SHemant Agrawal /* @} */ 982ffc1057SHemant Agrawal 992ffc1057SHemant Agrawal /* 1002ffc1057SHemant Agrawal * @Description An enum for defining Dual Tx rate limiting scale. 1012ffc1057SHemant Agrawal * (Must match e_fm_port_dual_rate_limiter_scale_down defined in 1022ffc1057SHemant Agrawal * fm_port_ext.h) 1032ffc1057SHemant Agrawal */ 1042ffc1057SHemant Agrawal typedef enum ioc_fm_port_dual_rate_limiter_scale_down { 1052ffc1057SHemant Agrawal e_IOC_FM_PORT_DUAL_RATE_LIMITER_NONE = 0, 1062ffc1057SHemant Agrawal /**< Use only single rate limiter*/ 1072ffc1057SHemant Agrawal e_IOC_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_2, 1082ffc1057SHemant Agrawal /**< Divide high rate limiter by 2 */ 1092ffc1057SHemant Agrawal e_IOC_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_4, 1102ffc1057SHemant Agrawal /**< Divide high rate limiter by 4 */ 1112ffc1057SHemant Agrawal e_IOC_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_8 1122ffc1057SHemant Agrawal /**< Divide high rate limiter by 8 */ 1132ffc1057SHemant Agrawal } ioc_fm_port_dual_rate_limiter_scale_down; 1142ffc1057SHemant Agrawal 1152ffc1057SHemant Agrawal /* 1162ffc1057SHemant Agrawal * @Description A structure for defining Tx rate limiting 1172ffc1057SHemant Agrawal * (Must match struct t_fm_port_rate_limit defined in 1182ffc1057SHemant Agrawal * fm_port_ext.h) 1192ffc1057SHemant Agrawal */ 1202ffc1057SHemant Agrawal typedef struct ioc_fm_port_rate_limit_t { 1212ffc1057SHemant Agrawal uint16_t max_burst_size; 1222ffc1057SHemant Agrawal /**< in KBytes for Tx ports, in frames for offline 1232ffc1057SHemant Agrawal * parsing ports. (note that for early chips burst size 1242ffc1057SHemant Agrawal * is rounded up to a multiply of 1000 frames). 1252ffc1057SHemant Agrawal */ 1262ffc1057SHemant Agrawal uint32_t rate_limit; 1272ffc1057SHemant Agrawal /**< in Kb/sec for Tx ports, in frame/sec for offline 1282ffc1057SHemant Agrawal * parsing ports. Rate limit refers to data rate (rather 1292ffc1057SHemant Agrawal * than line rate). 1302ffc1057SHemant Agrawal */ 1312ffc1057SHemant Agrawal ioc_fm_port_dual_rate_limiter_scale_down rate_limit_divider; 1322ffc1057SHemant Agrawal /**< For offline parsing ports only. Not-valid for some 1332ffc1057SHemant Agrawal * earlier chip revisions 1342ffc1057SHemant Agrawal */ 1352ffc1057SHemant Agrawal } ioc_fm_port_rate_limit_t; 1362ffc1057SHemant Agrawal 1372ffc1057SHemant Agrawal 1382ffc1057SHemant Agrawal /* 1392ffc1057SHemant Agrawal * @Group lnx_ioctl_FM_PORT_runtime_control_grp FM Port Runtime Control 1402ffc1057SHemant Agrawal * Unit 1412ffc1057SHemant Agrawal * 1422ffc1057SHemant Agrawal * @Description FM Port Runtime control unit API functions, definitions and 1432ffc1057SHemant Agrawal * enums. 1442ffc1057SHemant Agrawal * 1452ffc1057SHemant Agrawal * @{ 1462ffc1057SHemant Agrawal */ 1472ffc1057SHemant Agrawal 1482ffc1057SHemant Agrawal /* 1492ffc1057SHemant Agrawal * @Description An enum for defining FM Port counters. 1502ffc1057SHemant Agrawal * (Must match enum e_fm_port_counters defined in fm_port_ext.h) 1512ffc1057SHemant Agrawal */ 1522ffc1057SHemant Agrawal typedef enum ioc_fm_port_counters { 1532ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_CYCLE, /**< BMI performance counter */ 1542ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_TASK_UTIL, /**< BMI performance counter */ 1552ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_QUEUE_UTIL, /**< BMI performance counter */ 1562ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_DMA_UTIL, /**< BMI performance counter */ 1572ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_FIFO_UTIL, /**< BMI performance counter */ 1582ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_RX_PAUSE_ACTIVATION, 1592ffc1057SHemant Agrawal /**< BMI Rx only performance counter */ 1602ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_FRAME, /**< BMI statistics counter */ 1612ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_DISCARD_FRAME, /**< BMI statistics counter */ 1622ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_DEALLOC_BUF, 1632ffc1057SHemant Agrawal /**< BMI deallocate buffer statistics counter */ 1642ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_RX_BAD_FRAME, 1652ffc1057SHemant Agrawal /**< BMI Rx only statistics counter */ 1662ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_RX_LARGE_FRAME, 1672ffc1057SHemant Agrawal /**< BMI Rx only statistics counter */ 1682ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_RX_FILTER_FRAME, 1692ffc1057SHemant Agrawal /**< BMI Rx & OP only statistics counter */ 1702ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_RX_LIST_DMA_ERR, 1712ffc1057SHemant Agrawal /**< BMI Rx, OP & HC only statistics counter */ 1722ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_RX_OUT_OF_BUFFERS_DISCARD, 1732ffc1057SHemant Agrawal /**< BMI Rx, OP & HC statistics counter */ 1742ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_PREPARE_TO_ENQUEUE_COUNTER, 1752ffc1057SHemant Agrawal /**< BMI Rx, OP & HC only statistics counter */ 1762ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_WRED_DISCARD, 1772ffc1057SHemant Agrawal /**< BMI OP & HC only statistics counter */ 1782ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_LENGTH_ERR, 1792ffc1057SHemant Agrawal /**< BMI non-Rx statistics counter */ 1802ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_UNSUPPRTED_FORMAT, 1812ffc1057SHemant Agrawal /**< BMI non-Rx statistics counter */ 1822ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_DEQ_TOTAL,/**< QMI total QM dequeues counter */ 1832ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_ENQ_TOTAL,/**< QMI total QM enqueues counter */ 1842ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_DEQ_FROM_DEFAULT,/**< QMI counter */ 1852ffc1057SHemant Agrawal e_IOC_FM_PORT_COUNTERS_DEQ_CONFIRM /**< QMI counter */ 1862ffc1057SHemant Agrawal } ioc_fm_port_counters; 1872ffc1057SHemant Agrawal 1882ffc1057SHemant Agrawal typedef struct ioc_fm_port_bmi_stats_t { 1892ffc1057SHemant Agrawal uint32_t cnt_cycle; 1902ffc1057SHemant Agrawal uint32_t cnt_task_util; 1912ffc1057SHemant Agrawal uint32_t cnt_queue_util; 1922ffc1057SHemant Agrawal uint32_t cnt_dma_util; 1932ffc1057SHemant Agrawal uint32_t cnt_fifo_util; 1942ffc1057SHemant Agrawal uint32_t cnt_rx_pause_activation; 1952ffc1057SHemant Agrawal uint32_t cnt_frame; 1962ffc1057SHemant Agrawal uint32_t cnt_discard_frame; 1972ffc1057SHemant Agrawal uint32_t cnt_dealloc_buf; 1982ffc1057SHemant Agrawal uint32_t cnt_rx_bad_frame; 1992ffc1057SHemant Agrawal uint32_t cnt_rx_large_frame; 2002ffc1057SHemant Agrawal uint32_t cnt_rx_filter_frame; 2012ffc1057SHemant Agrawal uint32_t cnt_rx_list_dma_err; 2022ffc1057SHemant Agrawal uint32_t cnt_rx_out_of_buffers_discard; 2032ffc1057SHemant Agrawal uint32_t cnt_wred_discard; 2042ffc1057SHemant Agrawal uint32_t cnt_length_err; 2052ffc1057SHemant Agrawal uint32_t cnt_unsupported_format; 2062ffc1057SHemant Agrawal } ioc_fm_port_bmi_stats_t; 2072ffc1057SHemant Agrawal 2082ffc1057SHemant Agrawal /* 2092ffc1057SHemant Agrawal * @Description Structure for Port id parameters. 2102ffc1057SHemant Agrawal * (Description may be inaccurate; 2112ffc1057SHemant Agrawal * must match struct t_fm_port_congestion_grps defined in 2122ffc1057SHemant Agrawal * fm_port_ext.h) 2132ffc1057SHemant Agrawal * 2142ffc1057SHemant Agrawal * Fields commented 'IN' are passed by the port module to be used 2152ffc1057SHemant Agrawal * by the FM module. Fields commented 'OUT' will be filled by FM 2162ffc1057SHemant Agrawal * before returning to port. 2172ffc1057SHemant Agrawal */ 2182ffc1057SHemant Agrawal typedef struct ioc_fm_port_congestion_groups_t { 2192ffc1057SHemant Agrawal uint16_t num_of_congestion_grps_to_consider; 2202ffc1057SHemant Agrawal /**< The number of required congestion groups to define 2212ffc1057SHemant Agrawal * the size of the following array 2222ffc1057SHemant Agrawal */ 2232ffc1057SHemant Agrawal uint8_t congestion_grps_to_consider[FM_NUM_CONG_GRPS]; 2242ffc1057SHemant Agrawal /**< An array of CG indexes; Note that the size of the 2252ffc1057SHemant Agrawal * array should be 'num_of_congestion_grps_to_consider'. 2262ffc1057SHemant Agrawal */ 2272ffc1057SHemant Agrawal bool pfc_priorities_enable[FM_NUM_CONG_GRPS][FM_MAX_PFC_PRIO]; 2282ffc1057SHemant Agrawal /**< A matrix that represents the map between the CG ids 2292ffc1057SHemant Agrawal * defined in 'congestion_grps_to_consider' to the 2302ffc1057SHemant Agrawal * priorities mapping array. 2312ffc1057SHemant Agrawal */ 2322ffc1057SHemant Agrawal } ioc_fm_port_congestion_groups_t; 2332ffc1057SHemant Agrawal 2342ffc1057SHemant Agrawal 2352ffc1057SHemant Agrawal /* 2362ffc1057SHemant Agrawal * @Function fm_port_disable 2372ffc1057SHemant Agrawal * 2382ffc1057SHemant Agrawal * @Description Gracefully disable an FM port. The port will not start new 2392ffc1057SHemant Agrawal * tasks after all tasks associated with the port are terminated. 2402ffc1057SHemant Agrawal * 2412ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 2422ffc1057SHemant Agrawal * 2432ffc1057SHemant Agrawal * @Cautions This is a blocking routine, it returns after port is 2442ffc1057SHemant Agrawal * gracefully stopped, i.e. the port will not except new frames, 2452ffc1057SHemant Agrawal * but it will finish all frames or tasks which were already 2462ffc1057SHemant Agrawal * began 2472ffc1057SHemant Agrawal */ 2482ffc1057SHemant Agrawal #define FM_PORT_IOC_DISABLE _IO(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(1)) 2492ffc1057SHemant Agrawal 2502ffc1057SHemant Agrawal /* 2512ffc1057SHemant Agrawal * @Function fm_port_enable 2522ffc1057SHemant Agrawal * 2532ffc1057SHemant Agrawal * @Description A runtime routine provided to allow disable/enable of port. 2542ffc1057SHemant Agrawal * 2552ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 2562ffc1057SHemant Agrawal */ 2572ffc1057SHemant Agrawal #define FM_PORT_IOC_ENABLE _IO(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(2)) 2582ffc1057SHemant Agrawal 2592ffc1057SHemant Agrawal /* 2602ffc1057SHemant Agrawal * @Function fm_port_set_rate_limit 2612ffc1057SHemant Agrawal * 2622ffc1057SHemant Agrawal * @Description Calling this routine enables rate limit algorithm. 2632ffc1057SHemant Agrawal * By default, this functionality is disabled. 2642ffc1057SHemant Agrawal * 2652ffc1057SHemant Agrawal * Note that rate - limit mechanism uses the FM time stamp. 2662ffc1057SHemant Agrawal * The selected rate limit specified here would be 2672ffc1057SHemant Agrawal * rounded DOWN to the nearest 16M. 2682ffc1057SHemant Agrawal * 2692ffc1057SHemant Agrawal * May be used for Tx and offline parsing ports only 2702ffc1057SHemant Agrawal * 2712ffc1057SHemant Agrawal * @Param[in] ioc_fm_port_rate_limit A structure of rate limit 2722ffc1057SHemant Agrawal * parameters 2732ffc1057SHemant Agrawal * 2742ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 2752ffc1057SHemant Agrawal */ 2762ffc1057SHemant Agrawal #define FM_PORT_IOC_SET_RATE_LIMIT \ 2772ffc1057SHemant Agrawal IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(3), ioc_fm_port_rate_limit_t) 2782ffc1057SHemant Agrawal 2792ffc1057SHemant Agrawal /* 2802ffc1057SHemant Agrawal * @Function fm_port_delete_rate_limit 2812ffc1057SHemant Agrawal * 2822ffc1057SHemant Agrawal * @Description Calling this routine disables the previously enabled rate 2832ffc1057SHemant Agrawal * limit. 2842ffc1057SHemant Agrawal * 2852ffc1057SHemant Agrawal * May be used for Tx and offline parsing ports only 2862ffc1057SHemant Agrawal * 2872ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 2882ffc1057SHemant Agrawal */ 2892ffc1057SHemant Agrawal #define FM_PORT_IOC_DELETE_RATE_LIMIT _IO(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(5)) 2902ffc1057SHemant Agrawal #define FM_PORT_IOC_REMOVE_RATE_LIMIT FM_PORT_IOC_DELETE_RATE_LIMIT 2912ffc1057SHemant Agrawal 2922ffc1057SHemant Agrawal /* 2932ffc1057SHemant Agrawal * @Function fm_port_add_congestion_grps 2942ffc1057SHemant Agrawal * 2952ffc1057SHemant Agrawal * @Description This routine effects the corresponding Tx port. 2962ffc1057SHemant Agrawal * It should be called in order to enable pause frame 2972ffc1057SHemant Agrawal * transmission in case of congestion in one or more of the 2982ffc1057SHemant Agrawal * congestion groups relevant to this port. 2992ffc1057SHemant Agrawal * Each call to this routine may add one or more congestion 3002ffc1057SHemant Agrawal * groups to be considered relevant to this port. 3012ffc1057SHemant Agrawal * 3022ffc1057SHemant Agrawal * May be used for Rx, or RX+OP ports only (depending on chip) 3032ffc1057SHemant Agrawal * 3042ffc1057SHemant Agrawal * @Param[in] ioc_fm_port_congestion_groups_t A pointer to an array of 3052ffc1057SHemant Agrawal * congestion group ids to 3062ffc1057SHemant Agrawal * consider. 3072ffc1057SHemant Agrawal * 3082ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 3092ffc1057SHemant Agrawal */ 3102ffc1057SHemant Agrawal #define FM_PORT_IOC_ADD_CONGESTION_GRPS \ 3112ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(34), \ 3122ffc1057SHemant Agrawal ioc_fm_port_congestion_groups_t) 3132ffc1057SHemant Agrawal 3142ffc1057SHemant Agrawal /* 3152ffc1057SHemant Agrawal * @Function fm_port_remove_congestion_grps 3162ffc1057SHemant Agrawal * 3172ffc1057SHemant Agrawal * @Description This routine effects the corresponding Tx port. It should be 3182ffc1057SHemant Agrawal * called when congestion groups were defined for this port and 3192ffc1057SHemant Agrawal * are no longer relevant, or pause frames transmitting is not 3202ffc1057SHemant Agrawal * required on their behalf. Each call to this routine may remove 3212ffc1057SHemant Agrawal * one or more congestion groups to be considered relevant to 3222ffc1057SHemant Agrawal * this port. 3232ffc1057SHemant Agrawal * 3242ffc1057SHemant Agrawal * May be used for Rx, or RX+OP ports only (depending on chip) 3252ffc1057SHemant Agrawal * 3262ffc1057SHemant Agrawal * @Param[in] ioc_fm_port_congestion_groups_t A pointer to an array of 3272ffc1057SHemant Agrawal * congestion group ids to 3282ffc1057SHemant Agrawal * consider. 3292ffc1057SHemant Agrawal * 3302ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 3312ffc1057SHemant Agrawal */ 3322ffc1057SHemant Agrawal #define FM_PORT_IOC_REMOVE_CONGESTION_GRPS \ 3332ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(35), \ 3342ffc1057SHemant Agrawal ioc_fm_port_congestion_groups_t) 3352ffc1057SHemant Agrawal 3362ffc1057SHemant Agrawal /* 3372ffc1057SHemant Agrawal * @Function fm_port_set_errors_route 3382ffc1057SHemant Agrawal * 3392ffc1057SHemant Agrawal * @Description Errors selected for this routine will cause a frame with that 3402ffc1057SHemant Agrawal * error to be enqueued to error queue. 3412ffc1057SHemant Agrawal * Errors not selected for this routine will cause a frame with 3422ffc1057SHemant Agrawal * that error to be enqueued to the one of the other port queues. 3432ffc1057SHemant Agrawal * By default all errors are defined to be enqueued to error 3442ffc1057SHemant Agrawal * queue. Errors that were configured to be discarded (at 3452ffc1057SHemant Agrawal * initialization) may not be selected here. 3462ffc1057SHemant Agrawal * 3472ffc1057SHemant Agrawal * May be used for Rx and offline parsing ports only 3482ffc1057SHemant Agrawal * 3492ffc1057SHemant Agrawal * @Param[in] ioc_fm_port_frame_err_select_t A list of errors to 3502ffc1057SHemant Agrawal * enqueue to error queue 3512ffc1057SHemant Agrawal * 3522ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 3532ffc1057SHemant Agrawal * 3542ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 3552ffc1057SHemant Agrawal * fm_port_init(). 3562ffc1057SHemant Agrawal * (szbs001: How is it possible to have one function that needs 3572ffc1057SHemant Agrawal * to be called BEFORE fm_port_init() implemented as an ioctl, 3582ffc1057SHemant Agrawal * which will ALWAYS be called AFTER the fm_port_init() for that 3592ffc1057SHemant Agrawal I port!?!?!?!???!?!??!?!?) 3602ffc1057SHemant Agrawal */ 3612ffc1057SHemant Agrawal #define FM_PORT_IOC_SET_ERRORS_ROUTE \ 3622ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(4), \ 3632ffc1057SHemant Agrawal ioc_fm_port_frame_err_select_t) 3642ffc1057SHemant Agrawal 3652ffc1057SHemant Agrawal /* 3662ffc1057SHemant Agrawal * @Group lnx_ioctl_FM_PORT_pcd_runtime_control_grp FM Port PCD Runtime 3672ffc1057SHemant Agrawal * Control Unit 3682ffc1057SHemant Agrawal * 3692ffc1057SHemant Agrawal * @Description FM Port PCD Runtime control unit API functions, definitions 3702ffc1057SHemant Agrawal * and enums. 3712ffc1057SHemant Agrawal * 3722ffc1057SHemant Agrawal * @{ 3732ffc1057SHemant Agrawal */ 3742ffc1057SHemant Agrawal 3752ffc1057SHemant Agrawal /* 3762ffc1057SHemant Agrawal * @Description A structure defining the KG scheme after the parser. 3772ffc1057SHemant Agrawal * (Must match struct ioc_fm_pcd_kg_scheme_select_t defined in 3782ffc1057SHemant Agrawal * fm_port_ext.h) 3792ffc1057SHemant Agrawal * 3802ffc1057SHemant Agrawal * This is relevant only to change scheme selection mode - from 3812ffc1057SHemant Agrawal * direct to indirect and vice versa, or when the scheme is 3822ffc1057SHemant Agrawal * selected directly, to select the scheme id. 3832ffc1057SHemant Agrawal * 3842ffc1057SHemant Agrawal */ 3852ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_kg_scheme_select_t { 3862ffc1057SHemant Agrawal bool direct; 3872ffc1057SHemant Agrawal /**< TRUE to use 'scheme_id' directly, FALSE to use LCV.*/ 3882ffc1057SHemant Agrawal void *scheme_id; 3892ffc1057SHemant Agrawal /**< Relevant for 'direct'=TRUE only. 'scheme_id' selects the 3902ffc1057SHemant Agrawal * scheme after parser. 3912ffc1057SHemant Agrawal */ 3922ffc1057SHemant Agrawal } ioc_fm_pcd_kg_scheme_select_t; 3932ffc1057SHemant Agrawal 3942ffc1057SHemant Agrawal /* 3952ffc1057SHemant Agrawal * @Description Scheme IDs structure 3962ffc1057SHemant Agrawal * (Must match struct ioc_fm_pcd_port_schemes_params_t defined 3972ffc1057SHemant Agrawal * in fm_port_ext.h) 3982ffc1057SHemant Agrawal */ 3992ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_port_schemes_params_t { 4002ffc1057SHemant Agrawal uint8_t num_schemes; 4012ffc1057SHemant Agrawal /**< Number of schemes for port to be bound to. */ 4022ffc1057SHemant Agrawal void *scheme_ids[FM_PCD_KG_NUM_OF_SCHEMES]; 4032ffc1057SHemant Agrawal /**< Array of 'num_schemes' schemes for the port to be bound 4042ffc1057SHemant Agrawal * to 4052ffc1057SHemant Agrawal */ 4062ffc1057SHemant Agrawal } ioc_fm_pcd_port_schemes_params_t; 4072ffc1057SHemant Agrawal 4082ffc1057SHemant Agrawal /* 4092ffc1057SHemant Agrawal * @Description A union for defining port protocol parameters for parser 4102ffc1057SHemant Agrawal * (Must match union u_FmPcdHdrPrsOpts defined in fm_port_ext.h) 4112ffc1057SHemant Agrawal */ 4122ffc1057SHemant Agrawal typedef union ioc_fm_pcd_hdr_prs_opts_u { 4132ffc1057SHemant Agrawal /* MPLS */ 4142ffc1057SHemant Agrawal struct { 4152ffc1057SHemant Agrawal bool label_interpretation_enable; 4162ffc1057SHemant Agrawal /**< When this bit is set, the last MPLS label will be 4172ffc1057SHemant Agrawal * interpreted as described in HW spec table. When the bit is 4182ffc1057SHemant Agrawal * cleared, the parser will advance to MPLS next parse 4192ffc1057SHemant Agrawal */ 4202ffc1057SHemant Agrawal ioc_net_header_type next_parse; 4212ffc1057SHemant Agrawal /**< must be equal or higher than IPv4 */ 4222ffc1057SHemant Agrawal } mpls_prs_options; 4232ffc1057SHemant Agrawal 4242ffc1057SHemant Agrawal /* VLAN */ 4252ffc1057SHemant Agrawal struct { 4262ffc1057SHemant Agrawal uint16_t tag_protocol_id1; 4272ffc1057SHemant Agrawal /**< User defined Tag Protocol Identifier, to be recognized on 4282ffc1057SHemant Agrawal * VLAN TAG on top of 0x8100 and 0x88A8 4292ffc1057SHemant Agrawal */ 4302ffc1057SHemant Agrawal uint16_t tag_protocol_id2; 4312ffc1057SHemant Agrawal /**< User defined Tag Protocol Identifier, to be recognized on 4322ffc1057SHemant Agrawal * VLAN TAG on top of 0x8100 and 0x88A8 4332ffc1057SHemant Agrawal */ 4342ffc1057SHemant Agrawal } vlan_prs_options; 4352ffc1057SHemant Agrawal 4362ffc1057SHemant Agrawal /* PPP */ 4372ffc1057SHemant Agrawal struct{ 4382ffc1057SHemant Agrawal bool enable_mtu_check; 4392ffc1057SHemant Agrawal /**< Check validity of MTU according to RFC2516 */ 4402ffc1057SHemant Agrawal } pppoe_prs_options; 4412ffc1057SHemant Agrawal 4422ffc1057SHemant Agrawal /* IPV6 */ 4432ffc1057SHemant Agrawal struct { 4442ffc1057SHemant Agrawal bool routing_hdr_disable; 4452ffc1057SHemant Agrawal /**< Disable routing header */ 4462ffc1057SHemant Agrawal } ipv6_prs_options; 4472ffc1057SHemant Agrawal 4482ffc1057SHemant Agrawal /* UDP */ 4492ffc1057SHemant Agrawal struct { 4502ffc1057SHemant Agrawal bool pad_ignore_checksum; 4512ffc1057SHemant Agrawal /**< TRUE to ignore pad in checksum */ 4522ffc1057SHemant Agrawal } udp_prs_options; 4532ffc1057SHemant Agrawal 4542ffc1057SHemant Agrawal /* TCP */ 4552ffc1057SHemant Agrawal struct { 4562ffc1057SHemant Agrawal bool pad_ignore_checksum; 4572ffc1057SHemant Agrawal /**< TRUE to ignore pad in checksum */ 4582ffc1057SHemant Agrawal } tcp_prs_options; 4592ffc1057SHemant Agrawal } ioc_fm_pcd_hdr_prs_opts_u; 4602ffc1057SHemant Agrawal 4612ffc1057SHemant Agrawal /* 4622ffc1057SHemant Agrawal * @Description A structure for defining each header for the parser 4632ffc1057SHemant Agrawal * (must match struct t_FmPcdPrsAdditionalHdrParams defined in 4642ffc1057SHemant Agrawal * fm_port_ext.h) 4652ffc1057SHemant Agrawal */ 4662ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_prs_additional_hdr_params_t { 4672ffc1057SHemant Agrawal ioc_net_header_type hdr; /**< Selected header */ 4682ffc1057SHemant Agrawal bool err_disable; /**< TRUE to disable error indication */ 4692ffc1057SHemant Agrawal bool soft_prs_enable; 4702ffc1057SHemant Agrawal /**< Enable jump to SW parser when this header is recognized by 4712ffc1057SHemant Agrawal * the HW parser. 4722ffc1057SHemant Agrawal */ 4732ffc1057SHemant Agrawal uint8_t index_per_hdr; 4742ffc1057SHemant Agrawal /**< Normally 0, if more than one sw parser attachments exists 4752ffc1057SHemant Agrawal * for the same header, (in the main sw parser code) use this 4762ffc1057SHemant Agrawal * index to distinguish between them. 4772ffc1057SHemant Agrawal */ 4782ffc1057SHemant Agrawal bool use_prs_opts; /**< TRUE to use parser options. */ 4792ffc1057SHemant Agrawal ioc_fm_pcd_hdr_prs_opts_u prs_opts; 4802ffc1057SHemant Agrawal /**< A unuion according to header type, defining the parser 4812ffc1057SHemant Agrawal * options selected. 4822ffc1057SHemant Agrawal */ 4832ffc1057SHemant Agrawal } ioc_fm_pcd_prs_additional_hdr_params_t; 4842ffc1057SHemant Agrawal 4852ffc1057SHemant Agrawal /* 4862ffc1057SHemant Agrawal * @Description A structure for defining port PCD parameters 4872ffc1057SHemant Agrawal * (Must match t_fm_portPcdPrsParams defined in fm_port_ext.h) 4882ffc1057SHemant Agrawal */ 4892ffc1057SHemant Agrawal typedef struct ioc_fm_port_pcd_prs_params_t { 4902ffc1057SHemant Agrawal uint8_t prs_res_priv_info; 4912ffc1057SHemant Agrawal /**< The private info provides a method of inserting port 4922ffc1057SHemant Agrawal * information into the parser result. This information may be 4932ffc1057SHemant Agrawal * extracted by KeyGen and be used for frames distribution when 4942ffc1057SHemant Agrawal * a per-port distinction is required, it may also be used as a 4952ffc1057SHemant Agrawal * port logical id for analyzing incoming frames. 4962ffc1057SHemant Agrawal */ 4972ffc1057SHemant Agrawal uint8_t parsing_offset; 4982ffc1057SHemant Agrawal /**< Number of bytes from beginning of packet to start parsing 4992ffc1057SHemant Agrawal */ 5002ffc1057SHemant Agrawal ioc_net_header_type first_prs_hdr; 501*7be78d02SJosh Soref /**< The type of the first header expected at 'parsing_offset' 5022ffc1057SHemant Agrawal */ 5032ffc1057SHemant Agrawal bool include_in_prs_statistics; 5042ffc1057SHemant Agrawal /**< TRUE to include this port in the parser statistics */ 5052ffc1057SHemant Agrawal uint8_t num_of_hdrs_with_additional_params; 5062ffc1057SHemant Agrawal /**< Normally 0, some headers may get special parameters */ 5072ffc1057SHemant Agrawal ioc_fm_pcd_prs_additional_hdr_params_t 5082ffc1057SHemant Agrawal additional_params[IOC_FM_PCD_PRS_NUM_OF_HDRS]; 5092ffc1057SHemant Agrawal /**< 'num_of_hdrs_with_additional_params' structures additional 5102ffc1057SHemant Agrawal * parameters for each header that requires them 5112ffc1057SHemant Agrawal */ 5122ffc1057SHemant Agrawal bool set_vlan_tpid1; 5132ffc1057SHemant Agrawal /**< TRUE to configure user selection of Ethertype to indicate a 5142ffc1057SHemant Agrawal * VLAN tag (in addition to the TPID values 0x8100 and 0x88A8). 5152ffc1057SHemant Agrawal */ 5162ffc1057SHemant Agrawal uint16_t vlan_tpid1; 5172ffc1057SHemant Agrawal /**< extra tag to use if set_vlan_tpid1=TRUE. */ 5182ffc1057SHemant Agrawal bool set_vlan_tpid2; 5192ffc1057SHemant Agrawal /**< TRUE to configure user selection of Ethertype to indicate a 5202ffc1057SHemant Agrawal * VLAN tag (in addition to the TPID values 0x8100 and 0x88A8). 5212ffc1057SHemant Agrawal */ 5222ffc1057SHemant Agrawal uint16_t vlan_tpid2; 5232ffc1057SHemant Agrawal /**< extra tag to use if set_vlan_tpid1=TRUE. */ 5242ffc1057SHemant Agrawal } ioc_fm_port_pcd_prs_params_t; 5252ffc1057SHemant Agrawal 5262ffc1057SHemant Agrawal /* 527*7be78d02SJosh Soref * @Description A structure for defining coarse classification parameters 5282ffc1057SHemant Agrawal * (Must match t_fm_portPcdCcParams defined in fm_port_ext.h) 5292ffc1057SHemant Agrawal */ 5302ffc1057SHemant Agrawal typedef struct ioc_fm_port_pcd_cc_params_t { 5312ffc1057SHemant Agrawal void *cc_tree_id; /**< CC tree id */ 5322ffc1057SHemant Agrawal } ioc_fm_port_pcd_cc_params_t; 5332ffc1057SHemant Agrawal 5342ffc1057SHemant Agrawal /* 5352ffc1057SHemant Agrawal * @Description A structure for defining keygen parameters 5362ffc1057SHemant Agrawal * (Must match t_fm_portPcdKgParams defined in fm_port_ext.h) 5372ffc1057SHemant Agrawal */ 5382ffc1057SHemant Agrawal typedef struct ioc_fm_port_pcd_kg_params_t { 5392ffc1057SHemant Agrawal uint8_t num_schemes; 5402ffc1057SHemant Agrawal /**< Number of schemes for port to be bound to. */ 5412ffc1057SHemant Agrawal void *scheme_ids[FM_PCD_KG_NUM_OF_SCHEMES]; 5422ffc1057SHemant Agrawal /**< Array of 'num_schemes' schemes for the port to 5432ffc1057SHemant Agrawal * be bound to 5442ffc1057SHemant Agrawal */ 5452ffc1057SHemant Agrawal bool direct_scheme; 5462ffc1057SHemant Agrawal /**< TRUE for going from parser to a specific scheme, 5472ffc1057SHemant Agrawal * regardless of parser result 5482ffc1057SHemant Agrawal */ 5492ffc1057SHemant Agrawal void *direct_scheme_id; 5502ffc1057SHemant Agrawal /**< Scheme id, as returned by FM_PCD_KgSetScheme; 5512ffc1057SHemant Agrawal * relevant only if direct=TRUE. 5522ffc1057SHemant Agrawal */ 5532ffc1057SHemant Agrawal } ioc_fm_port_pcd_kg_params_t; 5542ffc1057SHemant Agrawal 5552ffc1057SHemant Agrawal /* 5562ffc1057SHemant Agrawal * @Description A structure for defining policer parameters 5572ffc1057SHemant Agrawal * (Must match t_fm_portPcdPlcrParams defined in fm_port_ext.h) 5582ffc1057SHemant Agrawal */ 5592ffc1057SHemant Agrawal typedef struct ioc_fm_port_pcd_plcr_params_t { 5602ffc1057SHemant Agrawal void *plcr_profile_id; 5612ffc1057SHemant Agrawal /**< Selected profile handle; 5622ffc1057SHemant Agrawal * relevant in one of the following cases: 5632ffc1057SHemant Agrawal * e_IOC_FM_PCD_PLCR_ONLY or 5642ffc1057SHemant Agrawal * e_IOC_FM_PCD_PRS_PLCR were selected, or if 5652ffc1057SHemant Agrawal * any flow uses a KG scheme where policer profile is not 5662ffc1057SHemant Agrawal * generated (bypass_plcr_profile_generation selected) 5672ffc1057SHemant Agrawal */ 5682ffc1057SHemant Agrawal } ioc_fm_port_pcd_plcr_params_t; 5692ffc1057SHemant Agrawal 5702ffc1057SHemant Agrawal /* 5712ffc1057SHemant Agrawal * @Description A structure for defining port PCD parameters 5722ffc1057SHemant Agrawal * (Must match struct t_fm_portPcdParams defined in 5732ffc1057SHemant Agrawal * fm_port_ext.h) 5742ffc1057SHemant Agrawal */ 5752ffc1057SHemant Agrawal typedef struct ioc_fm_port_pcd_params_t { 5762ffc1057SHemant Agrawal ioc_fm_port_pcd_support pcd_support; 5772ffc1057SHemant Agrawal /**< Relevant for Rx and offline ports only. 5782ffc1057SHemant Agrawal * Describes the active PCD engines for this port. 5792ffc1057SHemant Agrawal */ 5802ffc1057SHemant Agrawal void *net_env_id; /**< HL Unused in PLCR only mode */ 5812ffc1057SHemant Agrawal ioc_fm_port_pcd_prs_params_t *p_prs_params; 5822ffc1057SHemant Agrawal /**< Parser parameters for this port */ 5832ffc1057SHemant Agrawal ioc_fm_port_pcd_cc_params_t *p_cc_params; 5842ffc1057SHemant Agrawal /**< Coarse classification parameters for this port */ 5852ffc1057SHemant Agrawal ioc_fm_port_pcd_kg_params_t *p_kg_params; 5862ffc1057SHemant Agrawal /**< Keygen parameters for this port */ 5872ffc1057SHemant Agrawal ioc_fm_port_pcd_plcr_params_t *p_plcr_params; 5882ffc1057SHemant Agrawal /**< Policer parameters for this port */ 5892ffc1057SHemant Agrawal void *p_ip_reassembly_manip; 5902ffc1057SHemant Agrawal /**< IP Reassembly manipulation */ 5912ffc1057SHemant Agrawal void *p_capwap_reassembly_manip; 5922ffc1057SHemant Agrawal /**< CAPWAP Reassembly manipulation */ 5932ffc1057SHemant Agrawal } ioc_fm_port_pcd_params_t; 5942ffc1057SHemant Agrawal 5952ffc1057SHemant Agrawal /* 5962ffc1057SHemant Agrawal * @Description A structure for defining the Parser starting point 5972ffc1057SHemant Agrawal * (Must match struct ioc_fm_pcd_prs_start_t defined in 5982ffc1057SHemant Agrawal * fm_port_ext.h) 5992ffc1057SHemant Agrawal */ 6002ffc1057SHemant Agrawal typedef struct ioc_fm_pcd_prs_start_t { 6012ffc1057SHemant Agrawal uint8_t parsing_offset; 6022ffc1057SHemant Agrawal /**< Number of bytes from beginning of packet to start parsing 6032ffc1057SHemant Agrawal */ 6042ffc1057SHemant Agrawal ioc_net_header_type first_prs_hdr; 605*7be78d02SJosh Soref /**< The type of the first header expected at 'parsing_offset' 6062ffc1057SHemant Agrawal */ 6072ffc1057SHemant Agrawal } ioc_fm_pcd_prs_start_t; 6082ffc1057SHemant Agrawal 6092ffc1057SHemant Agrawal /* 6102ffc1057SHemant Agrawal * @Description FQID parameters structure 6112ffc1057SHemant Agrawal */ 6122ffc1057SHemant Agrawal typedef struct ioc_fm_port_pcd_fqids_params_t { 6132ffc1057SHemant Agrawal uint32_t num_fqids; 6142ffc1057SHemant Agrawal /**< Number of fqids to be allocated for the port */ 6152ffc1057SHemant Agrawal uint8_t alignment; 6162ffc1057SHemant Agrawal /**< Alignment required for this port */ 6172ffc1057SHemant Agrawal uint32_t base_fqid; 6182ffc1057SHemant Agrawal /**< output parameter - the base fqid */ 6192ffc1057SHemant Agrawal } ioc_fm_port_pcd_fqids_params_t; 6202ffc1057SHemant Agrawal 6212ffc1057SHemant Agrawal /* 6222ffc1057SHemant Agrawal * @Function FM_PORT_IOC_ALLOC_PCD_FQIDS 6232ffc1057SHemant Agrawal * 6242ffc1057SHemant Agrawal * @Description Allocates FQID's 6252ffc1057SHemant Agrawal * May be used for Rx and offline parsing ports only 6262ffc1057SHemant Agrawal * 6272ffc1057SHemant Agrawal * @Param[in,out] ioc_fm_port_pcd_fqids_params_t Parameters for 6282ffc1057SHemant Agrawal * allocating FQID's 6292ffc1057SHemant Agrawal * 6302ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 6312ffc1057SHemant Agrawal */ 6322ffc1057SHemant Agrawal #define FM_PORT_IOC_ALLOC_PCD_FQIDS \ 6332ffc1057SHemant Agrawal _IOWR(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(19), \ 6342ffc1057SHemant Agrawal ioc_fm_port_pcd_fqids_params_t) 6352ffc1057SHemant Agrawal 6362ffc1057SHemant Agrawal /* 6372ffc1057SHemant Agrawal * @Function FM_PORT_IOC_FREE_PCD_FQIDS 6382ffc1057SHemant Agrawal * 6392ffc1057SHemant Agrawal * @Description Frees previously-allocated FQIDs 6402ffc1057SHemant Agrawal * May be used for Rx and offline parsing ports only 6412ffc1057SHemant Agrawal * 6422ffc1057SHemant Agrawal * @Param[in] uint32_t Base FQID of previously allocated range. 6432ffc1057SHemant Agrawal * 6442ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 6452ffc1057SHemant Agrawal */ 6462ffc1057SHemant Agrawal #define FM_PORT_IOC_FREE_PCD_FQIDS \ 6472ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(19), uint32_t) 6482ffc1057SHemant Agrawal 6492ffc1057SHemant Agrawal /* 6502ffc1057SHemant Agrawal * @Function fm_port_set_pcd 6512ffc1057SHemant Agrawal * 6522ffc1057SHemant Agrawal * @Description Calling this routine defines the port's PCD configuration. 6532ffc1057SHemant Agrawal * It changes it from its default configuration which is PCD 6542ffc1057SHemant Agrawal * disabled (BMI to BMI) and configures it according to the 6552ffc1057SHemant Agrawal * passed parameters. 6562ffc1057SHemant Agrawal * May be used for Rx and offline parsing ports only 6572ffc1057SHemant Agrawal * 6582ffc1057SHemant Agrawal * @Param[in] ioc_fm_port_pcd_params_t A Structure of parameters 6592ffc1057SHemant Agrawal * defining the port's PCD 6602ffc1057SHemant Agrawal * configuration. 6612ffc1057SHemant Agrawal * 6622ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 6632ffc1057SHemant Agrawal */ 6642ffc1057SHemant Agrawal #define FM_PORT_IOC_SET_PCD \ 6652ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(20), ioc_fm_port_pcd_params_t) 6662ffc1057SHemant Agrawal 6672ffc1057SHemant Agrawal /* 6682ffc1057SHemant Agrawal * @Function fm_port_delete_pcd 6692ffc1057SHemant Agrawal * 6702ffc1057SHemant Agrawal * @Description Calling this routine releases the port's PCD configuration. 6712ffc1057SHemant Agrawal * The port returns to its default configuration which is PCD 6722ffc1057SHemant Agrawal * disabled (BMI to BMI) and all PCD configuration is removed. 6732ffc1057SHemant Agrawal * May be used for Rx and offline parsing ports which are in PCD 6742ffc1057SHemant Agrawal * mode only 6752ffc1057SHemant Agrawal * 6762ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 6772ffc1057SHemant Agrawal */ 6782ffc1057SHemant Agrawal #define FM_PORT_IOC_DELETE_PCD _IO(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(21)) 6792ffc1057SHemant Agrawal 6802ffc1057SHemant Agrawal /* 6812ffc1057SHemant Agrawal * @Function fm_port_attach_pcd 6822ffc1057SHemant Agrawal * 6832ffc1057SHemant Agrawal * @Description This routine may be called after fm_port_detach_pcd was 6842ffc1057SHemant Agrawal * called, to return to the originally configured PCD support 6852ffc1057SHemant Agrawal * flow. The couple of routines are used to allow PCD 6862ffc1057SHemant Agrawal * configuration changes that demand that PCD will not be used 6872ffc1057SHemant Agrawal * while changes take place. 6882ffc1057SHemant Agrawal * 6892ffc1057SHemant Agrawal * May be used for Rx and offline parsing ports which are in PCD 6902ffc1057SHemant Agrawal * mode only 6912ffc1057SHemant Agrawal * 6922ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 6932ffc1057SHemant Agrawal */ 6942ffc1057SHemant Agrawal #define FM_PORT_IOC_ATTACH_PCD _IO(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(23)) 6952ffc1057SHemant Agrawal 6962ffc1057SHemant Agrawal /* 6972ffc1057SHemant Agrawal * @Function fm_port_detach_pcd 6982ffc1057SHemant Agrawal * 6992ffc1057SHemant Agrawal * @Description Calling this routine detaches the port from its PCD 7002ffc1057SHemant Agrawal * functionality. The port returns to its default flow which is 7012ffc1057SHemant Agrawal * BMI to BMI. 7022ffc1057SHemant Agrawal * 7032ffc1057SHemant Agrawal * May be used for Rx and offline parsing ports which are in PCD 7042ffc1057SHemant Agrawal * mode only 7052ffc1057SHemant Agrawal * 7062ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 7072ffc1057SHemant Agrawal */ 7082ffc1057SHemant Agrawal #define FM_PORT_IOC_DETACH_PCD _IO(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(22)) 7092ffc1057SHemant Agrawal 7102ffc1057SHemant Agrawal /* 7112ffc1057SHemant Agrawal * @Function fm_port_pcd_plcr_alloc_profiles 7122ffc1057SHemant Agrawal * 7132ffc1057SHemant Agrawal * @Description This routine may be called only for ports that use the Policer 7142ffc1057SHemant Agrawal * in order to allocate private policer profiles. 7152ffc1057SHemant Agrawal * 7162ffc1057SHemant Agrawal * @Param[in] uint16_t The number of required policer profiles 7172ffc1057SHemant Agrawal * 7182ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 7192ffc1057SHemant Agrawal * 7202ffc1057SHemant Agrawal * @Cautions Allowed before fm_port_set_pcd() only. 7212ffc1057SHemant Agrawal */ 7222ffc1057SHemant Agrawal #define FM_PORT_IOC_PCD_PLCR_ALLOC_PROFILES \ 7232ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(24), uint16_t) 7242ffc1057SHemant Agrawal 7252ffc1057SHemant Agrawal /* 7262ffc1057SHemant Agrawal * @Function fm_port_pcd_plcr_free_profiles 7272ffc1057SHemant Agrawal * 7282ffc1057SHemant Agrawal * @Description This routine should be called for freeing private policer 7292ffc1057SHemant Agrawal * profiles. 7302ffc1057SHemant Agrawal * 7312ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 7322ffc1057SHemant Agrawal * 7332ffc1057SHemant Agrawal * @Cautions Allowed before fm_port_set_pcd() only. 7342ffc1057SHemant Agrawal */ 7352ffc1057SHemant Agrawal #define FM_PORT_IOC_PCD_PLCR_FREE_PROFILES \ 7362ffc1057SHemant Agrawal _IO(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(25)) 7372ffc1057SHemant Agrawal 7382ffc1057SHemant Agrawal /* 7392ffc1057SHemant Agrawal * @Function fm_port_pcd_kg_modify_initial_scheme 7402ffc1057SHemant Agrawal * 7412ffc1057SHemant Agrawal * @Description This routine may be called only for ports that use the keygen 7422ffc1057SHemant Agrawal * in order to change the initial scheme frame should be routed 7432ffc1057SHemant Agrawal * to.The change may be of a scheme id (in case of direct mode), 7442ffc1057SHemant Agrawal * from direct to indirect, or from indirect to direct - 7452ffc1057SHemant Agrawal * specifying the scheme id. 7462ffc1057SHemant Agrawal * 7472ffc1057SHemant Agrawal * @Param[in] ioc_fm_pcd_kg_scheme_select_t 7482ffc1057SHemant Agrawal * A structure of parameters for defining whether a scheme is 7492ffc1057SHemant Agrawal * direct/indirect, and if direct - scheme id. 7502ffc1057SHemant Agrawal * 7512ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 7522ffc1057SHemant Agrawal */ 7532ffc1057SHemant Agrawal #define FM_PORT_IOC_PCD_KG_MODIFY_INITIAL_SCHEME \ 7542ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(26), \ 7552ffc1057SHemant Agrawal ioc_fm_pcd_kg_scheme_select_t) 7562ffc1057SHemant Agrawal 7572ffc1057SHemant Agrawal /* 7582ffc1057SHemant Agrawal * @Function fm_port_pcd_plcr_modify_initial_profile 7592ffc1057SHemant Agrawal * 7602ffc1057SHemant Agrawal * @Description This routine may be called for ports with flows 7612ffc1057SHemant Agrawal * e_IOC_FM_PCD_SUPPORT_PLCR_ONLY or 7622ffc1057SHemant Agrawal * e_IOC_FM_PCD_SUPPORT_PRS_AND_PLCR only, to change the initial 7632ffc1057SHemant Agrawal * Policer profile frame should be routed to. 7642ffc1057SHemant Agrawal * The change may be of a profile and / or absolute / direct mode 7652ffc1057SHemant Agrawal * selection. 7662ffc1057SHemant Agrawal * 7672ffc1057SHemant Agrawal * @Param[in] ioc_fm_obj_t Policer profile Id as returned from 7682ffc1057SHemant Agrawal * FM_PCD_PlcrSetProfile. 7692ffc1057SHemant Agrawal * 7702ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 7712ffc1057SHemant Agrawal */ 7722ffc1057SHemant Agrawal #define FM_PORT_IOC_PCD_PLCR_MODIFY_INITIAL_PROFILE \ 7732ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(27), ioc_fm_obj_t) 7742ffc1057SHemant Agrawal 7752ffc1057SHemant Agrawal /* 7762ffc1057SHemant Agrawal * @Function fm_port_pcd_cc_modify_tree 7772ffc1057SHemant Agrawal * 7782ffc1057SHemant Agrawal * @Description This routine may be called to change this port connection to 7792ffc1057SHemant Agrawal * a pre - initializes coarse classification Tree. 7802ffc1057SHemant Agrawal * 7812ffc1057SHemant Agrawal * @Param[in] ioc_fm_obj_t Id of new coarse classification tree selected 7822ffc1057SHemant Agrawal * for this port. 7832ffc1057SHemant Agrawal * 7842ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 7852ffc1057SHemant Agrawal * 7862ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_set_pcd() and 7872ffc1057SHemant Agrawal * fm_port_detach_pcd() 7882ffc1057SHemant Agrawal */ 7892ffc1057SHemant Agrawal #define FM_PORT_IOC_PCD_CC_MODIFY_TREE \ 7902ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(28), ioc_fm_obj_t) 7912ffc1057SHemant Agrawal 7922ffc1057SHemant Agrawal /* 7932ffc1057SHemant Agrawal * @Function fm_port_pcd_kg_bind_schemes 7942ffc1057SHemant Agrawal * 7952ffc1057SHemant Agrawal * @Description These routines may be called for modifying the binding of 7962ffc1057SHemant Agrawal * ports to schemes. The scheme itself is not added, just this 7972ffc1057SHemant Agrawal * specific port starts using it. 7982ffc1057SHemant Agrawal * 7992ffc1057SHemant Agrawal * @Param[in] ioc_fm_pcd_port_schemes_params_t Schemes parameters 8002ffc1057SHemant Agrawal * structure 8012ffc1057SHemant Agrawal * 8022ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 8032ffc1057SHemant Agrawal * 8042ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_set_pcd(). 8052ffc1057SHemant Agrawal */ 8062ffc1057SHemant Agrawal #define FM_PORT_IOC_PCD_KG_BIND_SCHEMES \ 8072ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(30), \ 8082ffc1057SHemant Agrawal ioc_fm_pcd_port_schemes_params_t) 8092ffc1057SHemant Agrawal 8102ffc1057SHemant Agrawal /* 8112ffc1057SHemant Agrawal * @Function fm_port_pcd_kg_unbind_schemes 8122ffc1057SHemant Agrawal * 8132ffc1057SHemant Agrawal * @Description These routines may be called for modifying the binding of 8142ffc1057SHemant Agrawal * ports to schemes. The scheme itself is not removed or 8152ffc1057SHemant Agrawal * invalidated, just this specific port stops using it. 8162ffc1057SHemant Agrawal * 8172ffc1057SHemant Agrawal * @Param[in] ioc_fm_pcd_port_schemes_params_t Schemes parameters 8182ffc1057SHemant Agrawal * structure 8192ffc1057SHemant Agrawal * 8202ffc1057SHemant Agrawal * @Return 0 on success; error code otherwise. 8212ffc1057SHemant Agrawal * 8222ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_set_pcd(). 8232ffc1057SHemant Agrawal */ 8242ffc1057SHemant Agrawal #define FM_PORT_IOC_PCD_KG_UNBIND_SCHEMES \ 8252ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(31), \ 8262ffc1057SHemant Agrawal ioc_fm_pcd_port_schemes_params_t) 8272ffc1057SHemant Agrawal 8282ffc1057SHemant Agrawal #define ENET_NUM_OCTETS_PER_ADDRESS 6 8292ffc1057SHemant Agrawal /**< Number of octets (8-bit bytes) in an ethernet address */ 8302ffc1057SHemant Agrawal typedef struct ioc_fm_port_mac_addr_params_t { 8312ffc1057SHemant Agrawal uint8_t addr[ENET_NUM_OCTETS_PER_ADDRESS]; 8322ffc1057SHemant Agrawal } ioc_fm_port_mac_addr_params_t; 8332ffc1057SHemant Agrawal 8342ffc1057SHemant Agrawal /* 8352ffc1057SHemant Agrawal * @Function FM_MAC_AddHashMacAddr 8362ffc1057SHemant Agrawal * 8372ffc1057SHemant Agrawal * @Description Add an Address to the hash table. This is for filter purpose 8382ffc1057SHemant Agrawal * only. 8392ffc1057SHemant Agrawal * 8402ffc1057SHemant Agrawal * @Param[in] ioc_fm_port_mac_addr_params_t Ethernet Mac address 8412ffc1057SHemant Agrawal * 8422ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 8432ffc1057SHemant Agrawal * 8442ffc1057SHemant Agrawal * @Cautions Allowed only following FM_MAC_Init(). It is a filter only 8452ffc1057SHemant Agrawal * address. 8462ffc1057SHemant Agrawal * @Cautions Some address need to be filtered out in upper FM blocks. 8472ffc1057SHemant Agrawal */ 8482ffc1057SHemant Agrawal #define FM_PORT_IOC_ADD_RX_HASH_MAC_ADDR \ 8492ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(36), \ 8502ffc1057SHemant Agrawal ioc_fm_port_mac_addr_params_t) 8512ffc1057SHemant Agrawal 8522ffc1057SHemant Agrawal /* 8532ffc1057SHemant Agrawal * @Function FM_MAC_RemoveHashMacAddr 8542ffc1057SHemant Agrawal * 8552ffc1057SHemant Agrawal * @Description Delete an Address to the hash table. This is for filter 8562ffc1057SHemant Agrawal * purpose only. 8572ffc1057SHemant Agrawal * 8582ffc1057SHemant Agrawal * @Param[in] ioc_fm_port_mac_addr_params_t Ethernet Mac address 8592ffc1057SHemant Agrawal * 8602ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 8612ffc1057SHemant Agrawal * 8622ffc1057SHemant Agrawal * @Cautions Allowed only following FM_MAC_Init(). 8632ffc1057SHemant Agrawal */ 8642ffc1057SHemant Agrawal #define FM_PORT_IOC_REMOVE_RX_HASH_MAC_ADDR \ 8652ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(37), \ 8662ffc1057SHemant Agrawal ioc_fm_port_mac_addr_params_t) 8672ffc1057SHemant Agrawal 8682ffc1057SHemant Agrawal typedef struct ioc_fm_port_tx_pause_frames_t { 8692ffc1057SHemant Agrawal uint8_t priority; 8702ffc1057SHemant Agrawal uint16_t pause_time; 8712ffc1057SHemant Agrawal uint16_t thresh_time; 8722ffc1057SHemant Agrawal } ioc_fm_port_tx_pause_frames_t; 8732ffc1057SHemant Agrawal 8742ffc1057SHemant Agrawal /* 8752ffc1057SHemant Agrawal * @Function FM_MAC_SetTxPauseFrames 8762ffc1057SHemant Agrawal * 8772ffc1057SHemant Agrawal * @Description Enable/Disable transmission of Pause-Frames. The routine 8782ffc1057SHemant Agrawal * changes the default configuration: pause-time - [0xf000] 8792ffc1057SHemant Agrawal * threshold-time - [0] 8802ffc1057SHemant Agrawal * 8812ffc1057SHemant Agrawal * @Param[in] ioc_fm_port_tx_pause_frames_params_t 8822ffc1057SHemant Agrawal * A structure holding the required parameters. 8832ffc1057SHemant Agrawal * 8842ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 8852ffc1057SHemant Agrawal * 8862ffc1057SHemant Agrawal * @Cautions Allowed only following FM_MAC_Init(). PFC is supported only on 8872ffc1057SHemant Agrawal * new mEMAC; i.e. in MACs that don't have PFC support (10G-MAC 8882ffc1057SHemant Agrawal * and dTSEC), user should use 'FM_MAC_NO_PFC' in the 'priority' 8892ffc1057SHemant Agrawal * field. 8902ffc1057SHemant Agrawal */ 8912ffc1057SHemant Agrawal #define FM_PORT_IOC_SET_TX_PAUSE_FRAMES \ 8922ffc1057SHemant Agrawal _IOW(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(40), \ 8932ffc1057SHemant Agrawal ioc_fm_port_tx_pause_frames_t) 8942ffc1057SHemant Agrawal 8952ffc1057SHemant Agrawal typedef struct ioc_fm_port_mac_statistics_t { 8962ffc1057SHemant Agrawal /* RMON */ 8972ffc1057SHemant Agrawal uint64_t e_stat_pkts_64; 8982ffc1057SHemant Agrawal /**< r-10G tr-DT 64 byte frame counter */ 8992ffc1057SHemant Agrawal uint64_t e_stat_pkts_65_to_127; 9002ffc1057SHemant Agrawal /**< r-10G 65 to 127 byte frame counter */ 9012ffc1057SHemant Agrawal uint64_t e_stat_pkts_128_to_255; 9022ffc1057SHemant Agrawal /**< r-10G 128 to 255 byte frame counter */ 9032ffc1057SHemant Agrawal uint64_t e_stat_pkts_256_to_511; 9042ffc1057SHemant Agrawal /**< r-10G 256 to 511 byte frame counter */ 9052ffc1057SHemant Agrawal uint64_t e_stat_pkts_512_to_1023; 9062ffc1057SHemant Agrawal /**< r-10G 512 to 1023 byte frame counter*/ 9072ffc1057SHemant Agrawal uint64_t e_stat_pkts_1024_to_1518; 9082ffc1057SHemant Agrawal /**< r-10G 1024 to 1518 byte frame counter */ 9092ffc1057SHemant Agrawal uint64_t e_stat_pkts_1519_to_1522; 9102ffc1057SHemant Agrawal /**< r-10G 1519 to 1522 byte good frame count */ 9112ffc1057SHemant Agrawal /* */ 9122ffc1057SHemant Agrawal uint64_t e_stat_fragments; 9132ffc1057SHemant Agrawal /**< Total number of packets that were less than 64 octets long 9142ffc1057SHemant Agrawal * with a wrong CRC. 9152ffc1057SHemant Agrawal */ 9162ffc1057SHemant Agrawal uint64_t e_stat_jabbers; 9172ffc1057SHemant Agrawal /**< Total number of packets longer than valid maximum length 9182ffc1057SHemant Agrawal * octets 9192ffc1057SHemant Agrawal */ 9202ffc1057SHemant Agrawal uint64_t e_stat_drop_events; 9212ffc1057SHemant Agrawal /**< number of dropped packets due to internal errors of the MAC 9222ffc1057SHemant Agrawal * Client (during receive). 9232ffc1057SHemant Agrawal */ 9242ffc1057SHemant Agrawal uint64_t e_stat_CRC_align_errors; 9252ffc1057SHemant Agrawal /**< Incremented when frames of correct length but with CRC 9262ffc1057SHemant Agrawal * error are received. 9272ffc1057SHemant Agrawal */ 9282ffc1057SHemant Agrawal uint64_t e_stat_undersize_pkts; 9292ffc1057SHemant Agrawal /**< Incremented for frames under 64 bytes with a valid FCS and 9302ffc1057SHemant Agrawal * otherwise well formed; This count does not include range 9312ffc1057SHemant Agrawal * length errors 9322ffc1057SHemant Agrawal */ 9332ffc1057SHemant Agrawal uint64_t e_stat_oversize_pkts; 9342ffc1057SHemant Agrawal /**< Incremented for frames which exceed 1518 (non VLAN) or 1522 9352ffc1057SHemant Agrawal * (VLAN) and contains a valid FCS and otherwise well formed 9362ffc1057SHemant Agrawal */ 9372ffc1057SHemant Agrawal /* Pause */ 9382ffc1057SHemant Agrawal uint64_t rx_stat_pause; /**< Pause MAC Control received */ 9392ffc1057SHemant Agrawal uint64_t tx_stat_pause; /**< Pause MAC Control sent */ 9402ffc1057SHemant Agrawal /* MIB II */ 9412ffc1057SHemant Agrawal uint64_t if_in_octets; /**< Total number of byte received. */ 9422ffc1057SHemant Agrawal uint64_t if_in_pkts; /**< Total number of packets received.*/ 9432ffc1057SHemant Agrawal uint64_t if_in_ucast_pkts; 9442ffc1057SHemant Agrawal /**< Total number of unicast frame received; 9452ffc1057SHemant Agrawal * NOTE: this counter is not supported on dTSEC MAC 9462ffc1057SHemant Agrawal */ 9472ffc1057SHemant Agrawal uint64_t if_in_mcast_pkts; 9482ffc1057SHemant Agrawal /**< Total number of multicast frame received*/ 9492ffc1057SHemant Agrawal uint64_t if_in_bcast_pkts; 9502ffc1057SHemant Agrawal /**< Total number of broadcast frame received */ 9512ffc1057SHemant Agrawal uint64_t if_in_discards; 9522ffc1057SHemant Agrawal /**< Frames received, but discarded due to problems within the 9532ffc1057SHemant Agrawal * MAC RX. 9542ffc1057SHemant Agrawal */ 9552ffc1057SHemant Agrawal uint64_t if_in_errors; 9562ffc1057SHemant Agrawal /**< Number of frames received with error: 9572ffc1057SHemant Agrawal * - FIFO Overflow Error 9582ffc1057SHemant Agrawal * - CRC Error 9592ffc1057SHemant Agrawal * - Frame Too Long Error 9602ffc1057SHemant Agrawal * - Alignment Error 9612ffc1057SHemant Agrawal * - The dedicated Error Code (0xfe, not a code error) was 9622ffc1057SHemant Agrawal * received 9632ffc1057SHemant Agrawal */ 9642ffc1057SHemant Agrawal uint64_t if_out_octets; /**< Total number of byte sent. */ 9652ffc1057SHemant Agrawal uint64_t if_out_pkts; /**< Total number of packets sent .*/ 9662ffc1057SHemant Agrawal uint64_t if_out_ucast_pkts; 9672ffc1057SHemant Agrawal /**< Total number of unicast frame sent; 9682ffc1057SHemant Agrawal * NOTE: this counter is not supported on dTSEC MAC 9692ffc1057SHemant Agrawal */ 9702ffc1057SHemant Agrawal uint64_t if_out_mcast_pkts; 9712ffc1057SHemant Agrawal /**< Total number of multicast frame sent */ 9722ffc1057SHemant Agrawal uint64_t if_out_bcast_pkts; 9732ffc1057SHemant Agrawal /**< Total number of multicast frame sent */ 9742ffc1057SHemant Agrawal uint64_t if_out_discards; 9752ffc1057SHemant Agrawal /**< Frames received, but discarded due to problems within the 9762ffc1057SHemant Agrawal * MAC TX N/A!. 9772ffc1057SHemant Agrawal */ 9782ffc1057SHemant Agrawal uint64_t if_out_errors; 9792ffc1057SHemant Agrawal /**< Number of frames transmitted with error: 9802ffc1057SHemant Agrawal * - FIFO Overflow Error 9812ffc1057SHemant Agrawal * - FIFO Underflow Error 9822ffc1057SHemant Agrawal * - Other 9832ffc1057SHemant Agrawal */ 9842ffc1057SHemant Agrawal } ioc_fm_port_mac_statistics_t; 9852ffc1057SHemant Agrawal 9862ffc1057SHemant Agrawal /* 9872ffc1057SHemant Agrawal * @Function FM_MAC_GetStatistics 9882ffc1057SHemant Agrawal * 9892ffc1057SHemant Agrawal * @Description get all MAC statistics counters 9902ffc1057SHemant Agrawal * 9912ffc1057SHemant Agrawal * @Param[out] ioc_fm_port_mac_statistics_t A structure holding the 9922ffc1057SHemant Agrawal * statistics 9932ffc1057SHemant Agrawal * 9942ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 9952ffc1057SHemant Agrawal * 9962ffc1057SHemant Agrawal * @Cautions Allowed only following FM_Init(). 9972ffc1057SHemant Agrawal */ 9982ffc1057SHemant Agrawal #define FM_PORT_IOC_GET_MAC_STATISTICS \ 9992ffc1057SHemant Agrawal _IOR(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(41), \ 10002ffc1057SHemant Agrawal ioc_fm_port_mac_statistics_t) 10012ffc1057SHemant Agrawal 10022ffc1057SHemant Agrawal /* 10032ffc1057SHemant Agrawal * @Function fm_port_get_bmi_counters 10042ffc1057SHemant Agrawal * 10052ffc1057SHemant Agrawal * @Description Read port's BMI stat counters and place them into 10062ffc1057SHemant Agrawal * a designated structure of counters. 10072ffc1057SHemant Agrawal * 10082ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 10092ffc1057SHemant Agrawal * @Param[out] p_bmi_stats counters structure 10102ffc1057SHemant Agrawal * 10112ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 10122ffc1057SHemant Agrawal * 10132ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 10142ffc1057SHemant Agrawal */ 10152ffc1057SHemant Agrawal 10162ffc1057SHemant Agrawal #define FM_PORT_IOC_GET_BMI_COUNTERS \ 10172ffc1057SHemant Agrawal _IOR(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(42), ioc_fm_port_bmi_stats_t) 10182ffc1057SHemant Agrawal 10192ffc1057SHemant Agrawal /** @} */ /* end of lnx_ioctl_FM_PORT_pcd_runtime_control_grp group */ 10202ffc1057SHemant Agrawal /** @} */ /* end of lnx_ioctl_FM_PORT_runtime_control_grp group */ 10212ffc1057SHemant Agrawal 10222ffc1057SHemant Agrawal /** @} */ /* end of lnx_ioctl_FM_PORT_grp group */ 10232ffc1057SHemant Agrawal /** @} */ /* end of lnx_ioctl_FM_grp group */ 10242ffc1057SHemant Agrawal 10252ffc1057SHemant Agrawal 10262ffc1057SHemant Agrawal /* 10272ffc1057SHemant Agrawal * @Group gen_id General Drivers Utilities 10282ffc1057SHemant Agrawal * 10292ffc1057SHemant Agrawal * @Description External routines. 10302ffc1057SHemant Agrawal * 10312ffc1057SHemant Agrawal * @{ 10322ffc1057SHemant Agrawal */ 10332ffc1057SHemant Agrawal 10342ffc1057SHemant Agrawal /* 10352ffc1057SHemant Agrawal * @Group gen_error_id Errors, Events and Debug 10362ffc1057SHemant Agrawal * 10372ffc1057SHemant Agrawal * @Description External routines. 10382ffc1057SHemant Agrawal * 10392ffc1057SHemant Agrawal * @{ 10402ffc1057SHemant Agrawal */ 10412ffc1057SHemant Agrawal 10422ffc1057SHemant Agrawal /* 10432ffc1057SHemant Agrawal * The scheme below provides the bits description for error codes: 10442ffc1057SHemant Agrawal * 10452ffc1057SHemant Agrawal * 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 10462ffc1057SHemant Agrawal * | Reserved (should be zero) | Module ID | 10472ffc1057SHemant Agrawal * 10482ffc1057SHemant Agrawal * 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 10492ffc1057SHemant Agrawal * | Error Type | 10502ffc1057SHemant Agrawal */ 10512ffc1057SHemant Agrawal 10522ffc1057SHemant Agrawal #define ERROR_CODE(_err) ((((uint32_t)_err) & 0x0000FFFF) | __ERR_MODULE__) 10532ffc1057SHemant Agrawal 10542ffc1057SHemant Agrawal #define GET_ERROR_TYPE(_errcode) ((_errcode) & 0x0000FFFF) 10552ffc1057SHemant Agrawal /**< Extract module code from error code (#uint32_t) */ 10562ffc1057SHemant Agrawal 10572ffc1057SHemant Agrawal #define GET_ERROR_MODULE(_errcode) ((_errcode) & 0x00FF0000) 10582ffc1057SHemant Agrawal /**< Extract error type (#e_error_type) from 10592ffc1057SHemant Agrawal * error code (#uint32_t) 10602ffc1057SHemant Agrawal */ 10612ffc1057SHemant Agrawal 10622ffc1057SHemant Agrawal #define RETURN_ERROR(_level, _err, _vmsg) { return ERROR_CODE(_err); } 10632ffc1057SHemant Agrawal 10642ffc1057SHemant Agrawal /* 10652ffc1057SHemant Agrawal * @Description Error Type Enumeration 10662ffc1057SHemant Agrawal */ 10672ffc1057SHemant Agrawal typedef enum e_error_type { 10682ffc1057SHemant Agrawal E_OK = 0 10692ffc1057SHemant Agrawal /* Never use "RETURN_ERROR" with E_OK; Use "return E_OK;"*/ 10702ffc1057SHemant Agrawal , E_WRITE_FAILED = EIO 10712ffc1057SHemant Agrawal /**< Write access failed on memory/device.*/ 10722ffc1057SHemant Agrawal /* String: none, or device name.*/ 10732ffc1057SHemant Agrawal , E_NO_DEVICE = ENXIO 10742ffc1057SHemant Agrawal /**< The associated device is not initialized.*/ 10752ffc1057SHemant Agrawal /* String: none.*/ 10762ffc1057SHemant Agrawal , E_NOT_AVAILABLE = EAGAIN 10772ffc1057SHemant Agrawal /**< Resource is unavailable.*/ 10782ffc1057SHemant Agrawal /* String: none, unless the operation is not the main goal of 10792ffc1057SHemant Agrawal * the function (in this case add resource description). 10802ffc1057SHemant Agrawal */ 10812ffc1057SHemant Agrawal , E_NO_MEMORY = ENOMEM 10822ffc1057SHemant Agrawal /**< External memory allocation failed.*/ 10832ffc1057SHemant Agrawal /* String: description of item for which allocation failed. */ 10842ffc1057SHemant Agrawal , E_INVALID_ADDRESS = EFAULT 10852ffc1057SHemant Agrawal /**< Invalid address.*/ 10862ffc1057SHemant Agrawal /* String: description of the specific violation.*/ 10872ffc1057SHemant Agrawal , E_BUSY = EBUSY 10882ffc1057SHemant Agrawal /**< Resource or module is busy.*/ 10892ffc1057SHemant Agrawal /* String: none, unless the operation is not the main goal 10902ffc1057SHemant Agrawal * of the function (in this case add resource 10912ffc1057SHemant Agrawal * description). 10922ffc1057SHemant Agrawal */ 10932ffc1057SHemant Agrawal , E_ALREADY_EXISTS = EEXIST 10942ffc1057SHemant Agrawal /**< Requested resource or item already exists.*/ 10952ffc1057SHemant Agrawal /* Use when resource duplication or sharing are not allowed. 10962ffc1057SHemant Agrawal * String: none, unless the operation is not the main goal 10972ffc1057SHemant Agrawal * of the function (in this case add item description). 10982ffc1057SHemant Agrawal */ 10992ffc1057SHemant Agrawal , E_INVALID_OPERATION = ENODEV 11002ffc1057SHemant Agrawal /**< The operation/command is invalid (unrecognized).*/ 11012ffc1057SHemant Agrawal /* String: none.*/ 11022ffc1057SHemant Agrawal , E_INVALID_VALUE = EDOM 11032ffc1057SHemant Agrawal /**< Invalid value.*/ 11042ffc1057SHemant Agrawal /* Use for non-enumeration parameters, and only when other error 11052ffc1057SHemant Agrawal * types are not suitable. 11062ffc1057SHemant Agrawal * String: parameter description + "(should be <attribute>)", 11072ffc1057SHemant Agrawal * e.g: "Maximum Rx buffer length (should be divisible 11082ffc1057SHemant Agrawal * by 8)", "Channel number (should be even)". 11092ffc1057SHemant Agrawal */ 11102ffc1057SHemant Agrawal , E_NOT_IN_RANGE = ERANGE 11112ffc1057SHemant Agrawal /**< Parameter value is out of range.*/ 11122ffc1057SHemant Agrawal /* Don't use this error for enumeration parameters. 11132ffc1057SHemant Agrawal * String: parameter description + "(should be %d-%d)", 11142ffc1057SHemant Agrawal * e.g: "Number of pad characters (should be 0-15)". 11152ffc1057SHemant Agrawal */ 11162ffc1057SHemant Agrawal , E_NOT_SUPPORTED = ENOSYS 11172ffc1057SHemant Agrawal /**< The function is not supported or not implemented.*/ 11182ffc1057SHemant Agrawal /* String: none.*/ 11192ffc1057SHemant Agrawal , E_INVALID_STATE 11202ffc1057SHemant Agrawal /**< The operation is not allowed in current module state.*/ 11212ffc1057SHemant Agrawal /* String: none.*/ 11222ffc1057SHemant Agrawal , E_INVALID_HANDLE 11232ffc1057SHemant Agrawal /**< Invalid handle of module or object.*/ 11242ffc1057SHemant Agrawal /* String: none, unless the function takes in more than one 11252ffc1057SHemant Agrawal * handle (in this case add the handle description) 11262ffc1057SHemant Agrawal */ 11272ffc1057SHemant Agrawal , E_INVALID_ID 11282ffc1057SHemant Agrawal /**< Invalid module ID (usually enumeration or index).*/ 11292ffc1057SHemant Agrawal /* String: none, unless the function takes in more than one ID 11302ffc1057SHemant Agrawal * (in this case add the ID description) 11312ffc1057SHemant Agrawal */ 11322ffc1057SHemant Agrawal , E_NULL_POINTER 11332ffc1057SHemant Agrawal /**< Unexpected NULL pointer.*/ 11342ffc1057SHemant Agrawal /* String: pointer description.*/ 11352ffc1057SHemant Agrawal , E_INVALID_SELECTION 11362ffc1057SHemant Agrawal /**< Invalid selection or mode.*/ 11372ffc1057SHemant Agrawal /* Use for enumeration values, only when other error types are 11382ffc1057SHemant Agrawal * not suitable. 11392ffc1057SHemant Agrawal * String: parameter description. 11402ffc1057SHemant Agrawal */ 11412ffc1057SHemant Agrawal , E_INVALID_COMM_MODE 11422ffc1057SHemant Agrawal /**< Invalid communication mode.*/ 11432ffc1057SHemant Agrawal /* String: none, unless the function takes in more than one 11442ffc1057SHemant Agrawal * communication mode indications (in this case add 11452ffc1057SHemant Agrawal * parameter description). 11462ffc1057SHemant Agrawal */ 11472ffc1057SHemant Agrawal , E_INVALID_MEMORY_TYPE 11482ffc1057SHemant Agrawal /**< Invalid memory type.*/ 11492ffc1057SHemant Agrawal /* String: none, unless the function takes in more than one 11502ffc1057SHemant Agrawal * memory types (in this case add memory description, 11512ffc1057SHemant Agrawal * e.g: "Data memory", "Buffer descriptors memory"). 11522ffc1057SHemant Agrawal */ 11532ffc1057SHemant Agrawal , E_INVALID_CLOCK 11542ffc1057SHemant Agrawal /**< Invalid clock.*/ 11552ffc1057SHemant Agrawal /* String: none, unless the function takes in more than one 11562ffc1057SHemant Agrawal * clocks (in this case add clock description, e.g: "Rx 11572ffc1057SHemant Agrawal * clock", "Tx clock"). 11582ffc1057SHemant Agrawal */ 11592ffc1057SHemant Agrawal , E_CONFLICT 11602ffc1057SHemant Agrawal /**< Some setting conflicts with another setting.*/ 11612ffc1057SHemant Agrawal /* String: description of the conflicting settings.*/ 11622ffc1057SHemant Agrawal , E_NOT_ALIGNED 11632ffc1057SHemant Agrawal /**< Non-aligned address.*/ 11642ffc1057SHemant Agrawal /* String: parameter description + "(should be %d-bytes 11652ffc1057SHemant Agrawal * aligned)", e.g: "Rx data buffer (should be 32-bytes 11662ffc1057SHemant Agrawal * aligned)". 11672ffc1057SHemant Agrawal */ 11682ffc1057SHemant Agrawal , E_NOT_FOUND 11692ffc1057SHemant Agrawal /**< Requested resource or item was not found.*/ 11702ffc1057SHemant Agrawal /* Use only when the resource/item is uniquely identified. 11712ffc1057SHemant Agrawal * String: none, unless the operation is not the main goal 11722ffc1057SHemant Agrawal * of the function (in this case add item description). 11732ffc1057SHemant Agrawal */ 11742ffc1057SHemant Agrawal , E_FULL 11752ffc1057SHemant Agrawal /**< Resource is full.*/ 11762ffc1057SHemant Agrawal /* String: none, unless the operation is not the main goal of 11772ffc1057SHemant Agrawal * the function (in this case add resource description). 11782ffc1057SHemant Agrawal */ 11792ffc1057SHemant Agrawal , E_EMPTY 11802ffc1057SHemant Agrawal /**< Resource is empty.*/ 11812ffc1057SHemant Agrawal /* String: none, unless the operation is not the main goal of 11822ffc1057SHemant Agrawal * the function (in this case add resource description). 11832ffc1057SHemant Agrawal */ 11842ffc1057SHemant Agrawal , E_ALREADY_FREE 11852ffc1057SHemant Agrawal /**< Specified resource or item is already free or deleted.*/ 11862ffc1057SHemant Agrawal /* String: none, unless the operation is not the main goal 11872ffc1057SHemant Agrawal * of the function (in this case add item description). 11882ffc1057SHemant Agrawal */ 11892ffc1057SHemant Agrawal , E_READ_FAILED 11902ffc1057SHemant Agrawal /**< Read access failed on memory/device.*/ 11912ffc1057SHemant Agrawal /* String: none, or device name.*/ 11922ffc1057SHemant Agrawal , E_INVALID_FRAME 11932ffc1057SHemant Agrawal /**< Invalid frame object (NULL handle or missing buffers).*/ 11942ffc1057SHemant Agrawal /* String: none.*/ 11952ffc1057SHemant Agrawal , E_SEND_FAILED 11962ffc1057SHemant Agrawal /**< Send operation failed on device.*/ 11972ffc1057SHemant Agrawal /* String: none, or device name.*/ 11982ffc1057SHemant Agrawal , E_RECEIVE_FAILED 11992ffc1057SHemant Agrawal /**< Receive operation failed on device.*/ 12002ffc1057SHemant Agrawal /* String: none, or device name.*/ 12012ffc1057SHemant Agrawal , E_TIMEOUT/* = ETIMEDOUT*/ 12022ffc1057SHemant Agrawal /**< The operation timed out.*/ 12032ffc1057SHemant Agrawal /* String: none.*/ 12042ffc1057SHemant Agrawal 12052ffc1057SHemant Agrawal , E_DUMMY_LAST /* NEVER USED */ 12062ffc1057SHemant Agrawal 12072ffc1057SHemant Agrawal } e_error_type; 12082ffc1057SHemant Agrawal 12092ffc1057SHemant Agrawal /* 12102ffc1057SHemant Agrawal * 12112ffc1057SHemant Agrawal * @Group FM_grp Frame Manager API 12122ffc1057SHemant Agrawal * 12132ffc1057SHemant Agrawal * @Description FM API functions, definitions and enums 12142ffc1057SHemant Agrawal * 12152ffc1057SHemant Agrawal * @{ 12162ffc1057SHemant Agrawal */ 12172ffc1057SHemant Agrawal 12182ffc1057SHemant Agrawal /* 12192ffc1057SHemant Agrawal * @Group FM_PORT_grp FM Port 12202ffc1057SHemant Agrawal * 12212ffc1057SHemant Agrawal * @Description FM Port API 12222ffc1057SHemant Agrawal * 12232ffc1057SHemant Agrawal * The FM uses a general module called "port" to represent a Tx 12242ffc1057SHemant Agrawal * port (MAC), an Rx port (MAC) or Offline Parsing port. The 12252ffc1057SHemant Agrawal * number of ports in an FM varies between SOCs. The SW driver 12262ffc1057SHemant Agrawal * manages these ports as sub-modules of the FM, i.e. after an FM 12272ffc1057SHemant Agrawal * is initialized, its ports may be initialized and operated 12282ffc1057SHemant Agrawal * upon. 12292ffc1057SHemant Agrawal * 12302ffc1057SHemant Agrawal * The port is initialized aware of its type, but other functions 12312ffc1057SHemant Agrawal * on a port may be indifferent to its type. When necessary, the 12322ffc1057SHemant Agrawal * driver verifies coherence and returns error if applicable. 12332ffc1057SHemant Agrawal * 12342ffc1057SHemant Agrawal * On initialization, user specifies the port type and it's index 12352ffc1057SHemant Agrawal * (relative to the port's type) - always starting at 0. 12362ffc1057SHemant Agrawal * 12372ffc1057SHemant Agrawal * @{ 12382ffc1057SHemant Agrawal */ 12392ffc1057SHemant Agrawal 12402ffc1057SHemant Agrawal /* 12412ffc1057SHemant Agrawal * @Description An enum for defining port PCD modes. 12422ffc1057SHemant Agrawal * This enum defines the superset of PCD engines support - i.e. 12432ffc1057SHemant Agrawal * not all engines have to be used, but all have to be enabled. 12442ffc1057SHemant Agrawal * The real flow of a specific frame depends on the PCD 12452ffc1057SHemant Agrawal * configuration and the frame headers and payload. Note: the 12462ffc1057SHemant Agrawal * first engine and the first engine after the parser (if exists) 12472ffc1057SHemant Agrawal * should be in order, the order is important as it will define 12482ffc1057SHemant Agrawal * the flow of the port. However, as for the rest engines (the 12492ffc1057SHemant Agrawal * ones that follows), the order is not important anymore as it 12502ffc1057SHemant Agrawal * is defined by the PCD graph itself. 12512ffc1057SHemant Agrawal */ 12522ffc1057SHemant Agrawal typedef enum e_fm_port_pcd_support { 12532ffc1057SHemant Agrawal e_FM_PORT_PCD_SUPPORT_NONE = 0 12542ffc1057SHemant Agrawal /**< BMI to BMI, PCD is not used */ 12552ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_PRS_ONLY 12562ffc1057SHemant Agrawal /**< Use only Parser */ 12572ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_PLCR_ONLY 12582ffc1057SHemant Agrawal /**< Use only Policer */ 12592ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_PRS_AND_PLCR 12602ffc1057SHemant Agrawal /**< Use Parser and Policer */ 12612ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG 12622ffc1057SHemant Agrawal /**< Use Parser and Keygen */ 12632ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_CC 12642ffc1057SHemant Agrawal /**< Use Parser, Keygen and Coarse Classification */ 12652ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_CC_AND_PLCR 12662ffc1057SHemant Agrawal /**< Use all PCD engines */ 12672ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_PRS_AND_KG_AND_PLCR 12682ffc1057SHemant Agrawal /**< Use Parser, Keygen and Policer */ 12692ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_PRS_AND_CC 12702ffc1057SHemant Agrawal /**< Use Parser and Coarse Classification */ 12712ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_PRS_AND_CC_AND_PLCR 12722ffc1057SHemant Agrawal /**< Use Parser and Coarse Classification and Policer */ 12732ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_CC_ONLY 12742ffc1057SHemant Agrawal /**< Use only Coarse Classification */ 12752ffc1057SHemant Agrawal #ifdef FM_CAPWAP_SUPPORT 12762ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_CC_AND_KG 12772ffc1057SHemant Agrawal /**< Use Coarse Classification,and Keygen */ 12782ffc1057SHemant Agrawal , e_FM_PORT_PCD_SUPPORT_CC_AND_KG_AND_PLCR 12792ffc1057SHemant Agrawal /**< Use Coarse Classification, Keygen and Policer */ 12802ffc1057SHemant Agrawal #endif /* FM_CAPWAP_SUPPORT */ 12812ffc1057SHemant Agrawal } e_fm_port_pcd_support; 12822ffc1057SHemant Agrawal 12832ffc1057SHemant Agrawal /* 12842ffc1057SHemant Agrawal * @Description Port interrupts 12852ffc1057SHemant Agrawal */ 12862ffc1057SHemant Agrawal typedef enum e_fm_port_exceptions { 12872ffc1057SHemant Agrawal e_FM_PORT_EXCEPTION_IM_BUSY /**< Independent-Mode Rx-BUSY */ 12882ffc1057SHemant Agrawal } e_fm_port_exceptions; 12892ffc1057SHemant Agrawal 12902ffc1057SHemant Agrawal /* 12912ffc1057SHemant Agrawal * @Collection General FM Port defines 12922ffc1057SHemant Agrawal */ 12932ffc1057SHemant Agrawal #define FM_PORT_PRS_RESULT_NUM_OF_WORDS 8 12942ffc1057SHemant Agrawal /**< Number of 4 bytes words in parser result */ 12952ffc1057SHemant Agrawal /* @} */ 12962ffc1057SHemant Agrawal 12972ffc1057SHemant Agrawal /* 12982ffc1057SHemant Agrawal * @Collection FM Frame error 12992ffc1057SHemant Agrawal */ 13002ffc1057SHemant Agrawal typedef uint32_t fm_port_frame_err_select_t; 13012ffc1057SHemant Agrawal /**< typedef for defining Frame Descriptor errors */ 13022ffc1057SHemant Agrawal 13032ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_UNSUPPORTED_FORMAT FM_FD_ERR_UNSUPPORTED_FORMAT 13042ffc1057SHemant Agrawal /**< Not for Rx-Port! Unsupported Format */ 13052ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_LENGTH FM_FD_ERR_LENGTH 13062ffc1057SHemant Agrawal /**< Not for Rx-Port! Length Error */ 13072ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_DMA FM_FD_ERR_DMA /**< DMA Data error */ 13082ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_NON_FM FM_FD_RX_STATUS_ERR_NON_FM 13092ffc1057SHemant Agrawal /**< non Frame-Manager error; probably come from SEC 13102ffc1057SHemant Agrawal * that was chained to FM 13112ffc1057SHemant Agrawal */ 13122ffc1057SHemant Agrawal 13132ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_IPRE (FM_FD_ERR_IPR & ~FM_FD_IPR) 13142ffc1057SHemant Agrawal /**< IPR error */ 13152ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_IPR_NCSP (FM_FD_ERR_IPR_NCSP & ~FM_FD_IPR) 13162ffc1057SHemant Agrawal /**< IPR non-consistent-sp */ 13172ffc1057SHemant Agrawal 13182ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_IPFE 0 13192ffc1057SHemant Agrawal /**< Obsolete; will be removed in the future */ 13202ffc1057SHemant Agrawal 13212ffc1057SHemant Agrawal #ifdef FM_CAPWAP_SUPPORT 13222ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_CRE FM_FD_ERR_CRE 13232ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_CHE FM_FD_ERR_CHE 13242ffc1057SHemant Agrawal #endif /* FM_CAPWAP_SUPPORT */ 13252ffc1057SHemant Agrawal 13262ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_PHYSICAL FM_FD_ERR_PHYSICAL 13272ffc1057SHemant Agrawal /**< Rx FIFO overflow, FCS error, code error, running 13282ffc1057SHemant Agrawal * disparity error (SGMII and TBI modes), FIFO parity 13292ffc1057SHemant Agrawal * error. PHY Sequence error, PHY error control 13302ffc1057SHemant Agrawal * character detected. 13312ffc1057SHemant Agrawal */ 13322ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_SIZE FM_FD_ERR_SIZE 13332ffc1057SHemant Agrawal /**< Frame too long OR Frame size exceeds 13342ffc1057SHemant Agrawal * max_length_frame 13352ffc1057SHemant Agrawal */ 13362ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_CLS_DISCARD FM_FD_ERR_CLS_DISCARD 13372ffc1057SHemant Agrawal /**< indicates a classifier "drop" operation */ 13382ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_EXTRACTION FM_FD_ERR_EXTRACTION 13392ffc1057SHemant Agrawal /**< Extract Out of Frame */ 13402ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_NO_SCHEME FM_FD_ERR_NO_SCHEME 13412ffc1057SHemant Agrawal /**< No Scheme Selected */ 13422ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_KEYSIZE_OVERFLOW FM_FD_ERR_KEYSIZE_OVERFLOW 13432ffc1057SHemant Agrawal /**< Keysize Overflow */ 13442ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_COLOR_RED FM_FD_ERR_COLOR_RED 13452ffc1057SHemant Agrawal /**< Frame color is red */ 13462ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_COLOR_YELLOW FM_FD_ERR_COLOR_YELLOW 13472ffc1057SHemant Agrawal /**< Frame color is yellow */ 13482ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_ILL_PLCR FM_FD_ERR_ILL_PLCR 13492ffc1057SHemant Agrawal /**< Illegal Policer Profile selected */ 13502ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_PLCR_FRAME_LEN FM_FD_ERR_PLCR_FRAME_LEN 13512ffc1057SHemant Agrawal /**< Policer frame length error */ 13522ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_PRS_TIMEOUT FM_FD_ERR_PRS_TIMEOUT 13532ffc1057SHemant Agrawal /**< Parser Time out Exceed */ 13542ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_PRS_ILL_INSTRUCT FM_FD_ERR_PRS_ILL_INSTRUCT 13552ffc1057SHemant Agrawal /**< Invalid Soft Parser instruction */ 13562ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_PRS_HDR_ERR FM_FD_ERR_PRS_HDR_ERR 13572ffc1057SHemant Agrawal /**< Header error was identified during parsing */ 13582ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_BLOCK_LIMIT_EXCEEDED FM_FD_ERR_BLOCK_LIMIT_EXCEEDED 1359*7be78d02SJosh Soref /**< Frame parsed beyond 256 first bytes */ 13602ffc1057SHemant Agrawal #define FM_PORT_FRM_ERR_PROCESS_TIMEOUT 0x00000001 13612ffc1057SHemant Agrawal /**< FPM Frame Processing Timeout Exceeded */ 13622ffc1057SHemant Agrawal /* @} */ 13632ffc1057SHemant Agrawal 13642ffc1057SHemant Agrawal 13652ffc1057SHemant Agrawal /* 13662ffc1057SHemant Agrawal * @Group FM_PORT_init_grp FM Port Initialization Unit 13672ffc1057SHemant Agrawal * 13682ffc1057SHemant Agrawal * @Description FM Port Initialization Unit 13692ffc1057SHemant Agrawal * 13702ffc1057SHemant Agrawal * @{ 13712ffc1057SHemant Agrawal */ 13722ffc1057SHemant Agrawal 13732ffc1057SHemant Agrawal /* 13742ffc1057SHemant Agrawal * @Description Exceptions user callback routine, will be called upon an 13752ffc1057SHemant Agrawal * exception passing the exception identification. 13762ffc1057SHemant Agrawal * 13772ffc1057SHemant Agrawal * @Param[in] h_app User's application descriptor. 13782ffc1057SHemant Agrawal * @Param[in] exception The exception. 13792ffc1057SHemant Agrawal */ 13802ffc1057SHemant Agrawal typedef void (t_fm_port_exception_callback) (t_handle h_app, 13812ffc1057SHemant Agrawal e_fm_port_exceptions exception); 13822ffc1057SHemant Agrawal 13832ffc1057SHemant Agrawal /* 13842ffc1057SHemant Agrawal * @Description User callback function called by driver with received data. 13852ffc1057SHemant Agrawal * User provides this function. Driver invokes it. 13862ffc1057SHemant Agrawal * 13872ffc1057SHemant Agrawal * @Param[in] h_app Application's handle originally specified to 13882ffc1057SHemant Agrawal * the API Config function 13892ffc1057SHemant Agrawal * @Param[in] p_data A pointer to data received 13902ffc1057SHemant Agrawal * @Param[in] length length of received data 13912ffc1057SHemant Agrawal * @Param[in] status receive status and errors 13922ffc1057SHemant Agrawal * @Param[in] position position of buffer in frame 1393*7be78d02SJosh Soref * @Param[in] h_buf_context A handle of the user associated with this buffer 13942ffc1057SHemant Agrawal * 13952ffc1057SHemant Agrawal * @Retval e_RX_STORE_RESPONSE_CONTINUE 13962ffc1057SHemant Agrawal * order the driver to continue Rx operation for all ready data. 13972ffc1057SHemant Agrawal * @Retval e_RX_STORE_RESPONSE_PAUSE 13982ffc1057SHemant Agrawal * order the driver to stop Rx operation. 13992ffc1057SHemant Agrawal */ 14002ffc1057SHemant Agrawal typedef e_rx_store_response(t_fm_port_im_rx_store_callback) (t_handle h_app, 14012ffc1057SHemant Agrawal uint8_t *p_data, 14022ffc1057SHemant Agrawal uint16_t length, 14032ffc1057SHemant Agrawal uint16_t status, 14042ffc1057SHemant Agrawal uint8_t position, 14052ffc1057SHemant Agrawal t_handle h_buf_context); 14062ffc1057SHemant Agrawal 14072ffc1057SHemant Agrawal /* 14082ffc1057SHemant Agrawal * @Description User callback function called by driver when transmit 14092ffc1057SHemant Agrawal * completed. 14102ffc1057SHemant Agrawal * User provides this function. Driver invokes it. 14112ffc1057SHemant Agrawal * 14122ffc1057SHemant Agrawal * @Param[in] h_app Application's handle originally specified to 14132ffc1057SHemant Agrawal * the API Config function 14142ffc1057SHemant Agrawal * @Param[in] p_data A pointer to data received 14152ffc1057SHemant Agrawal * @Param[in] status transmit status and errors 14162ffc1057SHemant Agrawal * @Param[in] last_buffer is last buffer in frame 1417*7be78d02SJosh Soref * @Param[in] h_buf_context A handle of the user associated with this buffer 14182ffc1057SHemant Agrawal */ 14192ffc1057SHemant Agrawal typedef void (t_fm_port_im_tx_conf_callback) (t_handle h_app, 14202ffc1057SHemant Agrawal uint8_t *p_data, 14212ffc1057SHemant Agrawal uint16_t status, 14222ffc1057SHemant Agrawal t_handle h_buf_context); 14232ffc1057SHemant Agrawal 14242ffc1057SHemant Agrawal /* 14252ffc1057SHemant Agrawal * @Description A structure for additional Rx port parameters 14262ffc1057SHemant Agrawal */ 14272ffc1057SHemant Agrawal typedef struct t_fm_port_rx_params { 14282ffc1057SHemant Agrawal uint32_t err_fqid; /**< Error Queue Id. */ 14292ffc1057SHemant Agrawal uint32_t dflt_fqid; /**< Default Queue Id.*/ 14302ffc1057SHemant Agrawal uint16_t liodn_offset; /**< Port's LIODN offset. */ 14312ffc1057SHemant Agrawal t_fm_ext_pools ext_buf_pools; 14322ffc1057SHemant Agrawal /**< Which external buffer pools are used 14332ffc1057SHemant Agrawal * (up to FM_PORT_MAX_NUM_OF_EXT_POOLS), and their sizes 14342ffc1057SHemant Agrawal */ 14352ffc1057SHemant Agrawal } t_fm_port_rx_params; 14362ffc1057SHemant Agrawal 14372ffc1057SHemant Agrawal /* 14382ffc1057SHemant Agrawal * @Description A structure for additional non-Rx port parameters 14392ffc1057SHemant Agrawal */ 14402ffc1057SHemant Agrawal typedef struct t_fm_port_non_rx_params { 14412ffc1057SHemant Agrawal uint32_t err_fqid; /**< Error Queue Id. */ 14422ffc1057SHemant Agrawal uint32_t dflt_fqid; 14432ffc1057SHemant Agrawal /**< For Tx - Default Confirmation queue, 14442ffc1057SHemant Agrawal * 0 means no Tx confirmation for processed frames. 14452ffc1057SHemant Agrawal * For OP port - default Rx queue. 14462ffc1057SHemant Agrawal */ 14472ffc1057SHemant Agrawal uint32_t qm_channel; 14482ffc1057SHemant Agrawal /**< QM-channel dedicated to this port; will be used by 14492ffc1057SHemant Agrawal * the FM for dequeue. 14502ffc1057SHemant Agrawal */ 14512ffc1057SHemant Agrawal } t_fm_port_non_rx_params; 14522ffc1057SHemant Agrawal 14532ffc1057SHemant Agrawal /* 14542ffc1057SHemant Agrawal * @Description A structure for additional Rx port parameters 14552ffc1057SHemant Agrawal */ 14562ffc1057SHemant Agrawal typedef struct t_fm_port_im_rx_tx_params { 14572ffc1057SHemant Agrawal t_handle h_fm_muram; 14582ffc1057SHemant Agrawal /**< A handle of the FM-MURAM partition */ 14592ffc1057SHemant Agrawal uint16_t liodn_offset; 14602ffc1057SHemant Agrawal /**< For Rx ports only. Port's LIODN Offset. */ 14612ffc1057SHemant Agrawal uint8_t data_mem_id; 14622ffc1057SHemant Agrawal /**< Memory partition ID for data buffers */ 14632ffc1057SHemant Agrawal uint32_t data_mem_attributes; 14642ffc1057SHemant Agrawal /**< Memory attributes for data buffers */ 14652ffc1057SHemant Agrawal t_buffer_pool_info rx_pool_params; 14662ffc1057SHemant Agrawal /**< For Rx ports only. */ 14672ffc1057SHemant Agrawal t_fm_port_im_rx_store_callback *f_rx_store; 14682ffc1057SHemant Agrawal /**< For Rx ports only. */ 14692ffc1057SHemant Agrawal t_fm_port_im_tx_conf_callback *f_tx_conf; 14702ffc1057SHemant Agrawal /**< For Tx ports only. */ 14712ffc1057SHemant Agrawal } t_fm_port_im_rx_tx_params; 14722ffc1057SHemant Agrawal 14732ffc1057SHemant Agrawal /* 14742ffc1057SHemant Agrawal * @Description A union for additional parameters depending on port type 14752ffc1057SHemant Agrawal */ 14762ffc1057SHemant Agrawal typedef union u_fm_port_specific_params { 14772ffc1057SHemant Agrawal t_fm_port_im_rx_tx_params im_rx_tx_params; 14782ffc1057SHemant Agrawal /**< Rx/Tx Independent-Mode port parameter structure */ 14792ffc1057SHemant Agrawal t_fm_port_rx_params rx_params; 14802ffc1057SHemant Agrawal /**< Rx port parameters structure */ 14812ffc1057SHemant Agrawal t_fm_port_non_rx_params non_rx_params; 14822ffc1057SHemant Agrawal /**< Non-Rx port parameters structure */ 14832ffc1057SHemant Agrawal } u_fm_port_specific_params; 14842ffc1057SHemant Agrawal 14852ffc1057SHemant Agrawal /* 14862ffc1057SHemant Agrawal * @Description A structure representing FM initialization parameters 14872ffc1057SHemant Agrawal */ 14882ffc1057SHemant Agrawal typedef struct t_fm_port_params { 14892ffc1057SHemant Agrawal uintptr_t base_addr; 14902ffc1057SHemant Agrawal /**< Virtual Address of memory mapped FM Port registers. 14912ffc1057SHemant Agrawal */ 14922ffc1057SHemant Agrawal t_handle h_fm; 14932ffc1057SHemant Agrawal /**< A handle to the FM object this port related to */ 14942ffc1057SHemant Agrawal e_fm_port_type port_type; /**< Port type */ 14952ffc1057SHemant Agrawal uint8_t port_id; 14962ffc1057SHemant Agrawal /**< Port Id - relative to type; 14972ffc1057SHemant Agrawal * NOTE: When configuring Offline Parsing port for 14982ffc1057SHemant Agrawal * FMANv3 devices (DPAA_VERSION 11 and higher), 14992ffc1057SHemant Agrawal * it is highly recommended NOT to use port_id=0 due to 15002ffc1057SHemant Agrawal * lack of HW resources on port_id=0. 15012ffc1057SHemant Agrawal */ 15022ffc1057SHemant Agrawal bool independent_mode_enable; 15032ffc1057SHemant Agrawal /**< This port is Independent-Mode - Used for Rx/Tx 15042ffc1057SHemant Agrawal * ports only! 15052ffc1057SHemant Agrawal */ 15062ffc1057SHemant Agrawal uint16_t liodn_base; 15072ffc1057SHemant Agrawal /**< Irrelevant for P4080 rev 1. LIODN base for this 15082ffc1057SHemant Agrawal * port, to be used together with LIODN offset. 15092ffc1057SHemant Agrawal */ 15102ffc1057SHemant Agrawal u_fm_port_specific_params specific_params; 15112ffc1057SHemant Agrawal /**< Additional parameters depending on port type. */ 15122ffc1057SHemant Agrawal 15132ffc1057SHemant Agrawal t_fm_port_exception_callback *f_exception; 15142ffc1057SHemant Agrawal /**< Relevant for IM only Callback routine to be called 15152ffc1057SHemant Agrawal * on BUSY exception 15162ffc1057SHemant Agrawal */ 15172ffc1057SHemant Agrawal t_handle h_app; 15182ffc1057SHemant Agrawal /**< A handle to an application layer object; This 15192ffc1057SHemant Agrawal * handle will be passed by the driver upon calling the 15202ffc1057SHemant Agrawal * above callbacks 15212ffc1057SHemant Agrawal */ 15222ffc1057SHemant Agrawal } t_fm_port_params; 15232ffc1057SHemant Agrawal 15242ffc1057SHemant Agrawal /* 15252ffc1057SHemant Agrawal * @Function fm_port_config 15262ffc1057SHemant Agrawal * 15272ffc1057SHemant Agrawal * @Description Creates a descriptor for the FM PORT module. 15282ffc1057SHemant Agrawal * 15292ffc1057SHemant Agrawal * The routine returns a handle(descriptor) to the FM PORT 15302ffc1057SHemant Agrawal * object. This descriptor must be passed as first parameter to 15312ffc1057SHemant Agrawal * all other FM PORT function calls. 15322ffc1057SHemant Agrawal * 15332ffc1057SHemant Agrawal * No actual initialization or configuration of FM hardware is 15342ffc1057SHemant Agrawal * done by this routine. 15352ffc1057SHemant Agrawal * 15362ffc1057SHemant Agrawal * @Param[in] p_fm_port_params Pointer to data structure of parameters 15372ffc1057SHemant Agrawal * 15382ffc1057SHemant Agrawal * @Retval Handle to FM object, or NULL for Failure. 15392ffc1057SHemant Agrawal */ 15402ffc1057SHemant Agrawal t_handle fm_port_config(t_fm_port_params *p_fm_port_params); 15412ffc1057SHemant Agrawal 15422ffc1057SHemant Agrawal /* 15432ffc1057SHemant Agrawal * @Function fm_port_init 15442ffc1057SHemant Agrawal * 15452ffc1057SHemant Agrawal * @Description Initializes the FM PORT module by defining the software 15462ffc1057SHemant Agrawal * structure and configuring the hardware registers. 15472ffc1057SHemant Agrawal * 15482ffc1057SHemant Agrawal * @Param[in] h_fm_port - FM PORT module descriptor 15492ffc1057SHemant Agrawal * 15502ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 15512ffc1057SHemant Agrawal */ 15522ffc1057SHemant Agrawal uint32_t fm_port_init(t_handle h_fm_port); 15532ffc1057SHemant Agrawal 15542ffc1057SHemant Agrawal /* 15552ffc1057SHemant Agrawal * @Function fm_port_free 15562ffc1057SHemant Agrawal * 15572ffc1057SHemant Agrawal * @Description Frees all resources that were assigned to FM PORT module. 15582ffc1057SHemant Agrawal * 15592ffc1057SHemant Agrawal * Calling this routine invalidates the descriptor. 15602ffc1057SHemant Agrawal * 15612ffc1057SHemant Agrawal * @Param[in] h_fm_port - FM PORT module descriptor 15622ffc1057SHemant Agrawal * 15632ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 15642ffc1057SHemant Agrawal */ 15652ffc1057SHemant Agrawal uint32_t fm_port_free(t_handle h_fm_port); 15662ffc1057SHemant Agrawal 15672ffc1057SHemant Agrawal t_handle fm_port_open(t_fm_port_params *p_fm_port_params); 15682ffc1057SHemant Agrawal void fm_port_close(t_handle h_fm_port); 15692ffc1057SHemant Agrawal 15702ffc1057SHemant Agrawal 15712ffc1057SHemant Agrawal /* 15722ffc1057SHemant Agrawal * @Group FM_PORT_advanced_init_grp FM Port Advanced Configuration 15732ffc1057SHemant Agrawal * Unit 15742ffc1057SHemant Agrawal * 15752ffc1057SHemant Agrawal * @Description Configuration functions used to change default values. 15762ffc1057SHemant Agrawal * 15772ffc1057SHemant Agrawal * @{ 15782ffc1057SHemant Agrawal */ 15792ffc1057SHemant Agrawal 15802ffc1057SHemant Agrawal /* 15812ffc1057SHemant Agrawal * @Description enum for defining QM frame dequeue 15822ffc1057SHemant Agrawal */ 15832ffc1057SHemant Agrawal typedef enum e_fm_port_deq_type { 15842ffc1057SHemant Agrawal e_FM_PORT_DEQ_TYPE1, 15852ffc1057SHemant Agrawal /**< Dequeue from the SP channel - with priority precedence, 15862ffc1057SHemant Agrawal * and Intra-Class Scheduling respected. 15872ffc1057SHemant Agrawal */ 15882ffc1057SHemant Agrawal e_FM_PORT_DEQ_TYPE2, 15892ffc1057SHemant Agrawal /**< Dequeue from the SP channel - with active FQ precedence, 15902ffc1057SHemant Agrawal * and Intra-Class Scheduling respected. 15912ffc1057SHemant Agrawal */ 15922ffc1057SHemant Agrawal e_FM_PORT_DEQ_TYPE3 15932ffc1057SHemant Agrawal /**< Dequeue from the SP channel - with active FQ precedence, 15942ffc1057SHemant Agrawal * and override Intra-Class Scheduling 15952ffc1057SHemant Agrawal */ 15962ffc1057SHemant Agrawal } e_fm_port_deq_type; 15972ffc1057SHemant Agrawal 15982ffc1057SHemant Agrawal /* 15992ffc1057SHemant Agrawal * @Description enum for defining QM frame dequeue 16002ffc1057SHemant Agrawal */ 16012ffc1057SHemant Agrawal typedef enum e_fm_port_deq_prefetch_option { 16022ffc1057SHemant Agrawal e_FM_PORT_DEQ_NO_PREFETCH, 16032ffc1057SHemant Agrawal /**< QMI performs a dequeue action for a single frame 16042ffc1057SHemant Agrawal * only when a dedicated portID Tnum is waiting. 16052ffc1057SHemant Agrawal */ 16062ffc1057SHemant Agrawal e_FM_PORT_DEQ_PARTIAL_PREFETCH, 16072ffc1057SHemant Agrawal /**< QMI performs a dequeue action for 3 frames 16082ffc1057SHemant Agrawal * when one dedicated port_id tnum is waiting. 16092ffc1057SHemant Agrawal */ 16102ffc1057SHemant Agrawal e_FM_PORT_DEQ_FULL_PREFETCH 16112ffc1057SHemant Agrawal /**< QMI performs a dequeue action for 3 frames when 16122ffc1057SHemant Agrawal * no dedicated port_id tnums are waiting. 16132ffc1057SHemant Agrawal */ 16142ffc1057SHemant Agrawal 16152ffc1057SHemant Agrawal } e_fm_port_deq_prefetch_option; 16162ffc1057SHemant Agrawal 16172ffc1057SHemant Agrawal /* 16182ffc1057SHemant Agrawal * @Description enum for defining port default color 16192ffc1057SHemant Agrawal */ 16202ffc1057SHemant Agrawal typedef enum e_fm_port_color { 16212ffc1057SHemant Agrawal e_FM_PORT_COLOR_GREEN, /**< Default port color is green */ 16222ffc1057SHemant Agrawal e_FM_PORT_COLOR_YELLOW, /**< Default port color is yellow */ 16232ffc1057SHemant Agrawal e_FM_PORT_COLOR_RED, /**< Default port color is red */ 16242ffc1057SHemant Agrawal e_FM_PORT_COLOR_OVERRIDE/**< Ignore color */ 16252ffc1057SHemant Agrawal } e_fm_port_color; 16262ffc1057SHemant Agrawal 16272ffc1057SHemant Agrawal /* 16282ffc1057SHemant Agrawal * @Description A structure for defining Dual Tx rate limiting scale 16292ffc1057SHemant Agrawal */ 16302ffc1057SHemant Agrawal typedef enum e_fm_port_dual_rate_limiter_scale_down { 16312ffc1057SHemant Agrawal e_FM_PORT_DUAL_RATE_LIMITER_NONE = 0, 16322ffc1057SHemant Agrawal /**< Use only single rate limiter*/ 16332ffc1057SHemant Agrawal e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_2, 16342ffc1057SHemant Agrawal /**< Divide high rate limiter by 2 */ 16352ffc1057SHemant Agrawal e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_4, 16362ffc1057SHemant Agrawal /**< Divide high rate limiter by 4 */ 16372ffc1057SHemant Agrawal e_FM_PORT_DUAL_RATE_LIMITER_SCALE_DOWN_BY_8 16382ffc1057SHemant Agrawal /**< Divide high rate limiter by 8 */ 16392ffc1057SHemant Agrawal } e_fm_port_dual_rate_limiter_scale_down; 16402ffc1057SHemant Agrawal 16412ffc1057SHemant Agrawal /* 16422ffc1057SHemant Agrawal * @Description A structure for defining FM port resources 16432ffc1057SHemant Agrawal */ 16442ffc1057SHemant Agrawal typedef struct t_fm_port_rsrc { 16452ffc1057SHemant Agrawal uint32_t num; 16462ffc1057SHemant Agrawal /**< Committed required resource */ 16472ffc1057SHemant Agrawal uint32_t extra; 16482ffc1057SHemant Agrawal /**< Extra (not committed) required resource */ 16492ffc1057SHemant Agrawal } t_fm_port_rsrc; 16502ffc1057SHemant Agrawal 16512ffc1057SHemant Agrawal /* 16522ffc1057SHemant Agrawal * @Description A structure for defining Tx rate limiting 16532ffc1057SHemant Agrawal */ 16542ffc1057SHemant Agrawal typedef struct t_fm_port_rate_limit { 16552ffc1057SHemant Agrawal uint16_t max_burst_size; 16562ffc1057SHemant Agrawal /**< in KBytes for Tx ports, in frames for OP 16572ffc1057SHemant Agrawal * ports. (note that for early chips burst size 16582ffc1057SHemant Agrawal * is rounded up to a multiply of 1000 frames). 16592ffc1057SHemant Agrawal */ 16602ffc1057SHemant Agrawal uint32_t rate_limit; 16612ffc1057SHemant Agrawal /**< in Kb/sec for Tx ports, in frame/sec for OP 16622ffc1057SHemant Agrawal * ports. Rate limit refers to data rate 16632ffc1057SHemant Agrawal * (rather than line rate). 16642ffc1057SHemant Agrawal */ 16652ffc1057SHemant Agrawal e_fm_port_dual_rate_limiter_scale_down rate_limit_divider; 16662ffc1057SHemant Agrawal /**< For OP ports only. Not-valid for some 16672ffc1057SHemant Agrawal * earlier chip revisions 16682ffc1057SHemant Agrawal */ 16692ffc1057SHemant Agrawal } t_fm_port_rate_limit; 16702ffc1057SHemant Agrawal 16712ffc1057SHemant Agrawal /* 16722ffc1057SHemant Agrawal * @Description A structure for defining the parameters of 16732ffc1057SHemant Agrawal * the Rx port performance counters 16742ffc1057SHemant Agrawal */ 16752ffc1057SHemant Agrawal typedef struct t_fm_port_performance_cnt { 16762ffc1057SHemant Agrawal uint8_t task_comp_val; 16772ffc1057SHemant Agrawal /**< Task compare value */ 16782ffc1057SHemant Agrawal uint8_t queue_comp_val; 16792ffc1057SHemant Agrawal /**< Rx queue/Tx confirm queue compare value (unused for H/O) */ 16802ffc1057SHemant Agrawal uint8_t dma_comp_val; 16812ffc1057SHemant Agrawal /**< Dma compare value */ 16822ffc1057SHemant Agrawal uint32_t fifo_comp_val; 16832ffc1057SHemant Agrawal /**< Fifo compare value (in bytes) */ 16842ffc1057SHemant Agrawal } t_fm_port_performance_cnt; 16852ffc1057SHemant Agrawal 16862ffc1057SHemant Agrawal /* 16872ffc1057SHemant Agrawal * @Function fm_port_config_num_of_open_dmas 16882ffc1057SHemant Agrawal * 16892ffc1057SHemant Agrawal * @Description Calling this routine changes the max number of open DMA's 16902ffc1057SHemant Agrawal * available for this port. It changes this parameter in the 16912ffc1057SHemant Agrawal * internal driver data base from its default configuration 16922ffc1057SHemant Agrawal * [OP: 1] 16932ffc1057SHemant Agrawal * [1G-RX, 1G-TX: 1 (+1)] 16942ffc1057SHemant Agrawal * [10G-RX, 10G-TX: 8 (+8)] 16952ffc1057SHemant Agrawal * 16962ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 16972ffc1057SHemant Agrawal * @Param[in] p_open_dmas A pointer to a structure of parameters defining 16982ffc1057SHemant Agrawal * the open DMA allocation. 16992ffc1057SHemant Agrawal * 17002ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 17012ffc1057SHemant Agrawal * 17022ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 17032ffc1057SHemant Agrawal * fm_port_init(). 17042ffc1057SHemant Agrawal */ 17052ffc1057SHemant Agrawal uint32_t fm_port_config_num_of_open_dmas(t_handle h_fm_port, 17062ffc1057SHemant Agrawal t_fm_port_rsrc *p_open_dmas); 17072ffc1057SHemant Agrawal 17082ffc1057SHemant Agrawal /* 17092ffc1057SHemant Agrawal * @Function fm_port_config_num_of_tasks 17102ffc1057SHemant Agrawal * 17112ffc1057SHemant Agrawal * @Description Calling this routine changes the max number of tasks available 17122ffc1057SHemant Agrawal * for this port. It changes this parameter in the internal 17132ffc1057SHemant Agrawal * driver data base from its default configuration 17142ffc1057SHemant Agrawal * [OP : 1] 17152ffc1057SHemant Agrawal * [1G - RX, 1G - TX : 3 ( + 2)] 17162ffc1057SHemant Agrawal * [10G - RX, 10G - TX : 16 ( + 8)] 17172ffc1057SHemant Agrawal * 17182ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 17192ffc1057SHemant Agrawal * @Param[in] p_num_of_tasks A pointer to a structure of parameters 17202ffc1057SHemant Agrawal * defining the tasks allocation. 17212ffc1057SHemant Agrawal * 17222ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 17232ffc1057SHemant Agrawal * 17242ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 17252ffc1057SHemant Agrawal * fm_port_init(). 17262ffc1057SHemant Agrawal */ 17272ffc1057SHemant Agrawal uint32_t fm_port_config_num_of_tasks(t_handle h_fm_port, 17282ffc1057SHemant Agrawal t_fm_port_rsrc *p_num_of_tasks); 17292ffc1057SHemant Agrawal 17302ffc1057SHemant Agrawal /* 17312ffc1057SHemant Agrawal * @Function fm_port_config_size_of_fifo 17322ffc1057SHemant Agrawal * 17332ffc1057SHemant Agrawal * @Description Calling this routine changes the max FIFO size configured for 17342ffc1057SHemant Agrawal * this port. 17352ffc1057SHemant Agrawal * 17362ffc1057SHemant Agrawal * This function changes the internal driver data base from its 17372ffc1057SHemant Agrawal * default configuration. Please refer to the driver's User Guide 17382ffc1057SHemant Agrawal * for information on default FIFO sizes in the various devices. 17392ffc1057SHemant Agrawal * [OP: 2KB] 17402ffc1057SHemant Agrawal * [1G-RX, 1G-TX: 11KB] 17412ffc1057SHemant Agrawal * [10G-RX, 10G-TX: 12KB] 17422ffc1057SHemant Agrawal * 17432ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 17442ffc1057SHemant Agrawal * @Param[in] p_size_of_fifo A pointer to a structure of parameters 17452ffc1057SHemant Agrawal * defining the FIFO allocation. 17462ffc1057SHemant Agrawal * 17472ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 17482ffc1057SHemant Agrawal * 17492ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 17502ffc1057SHemant Agrawal * fm_port_init(). 17512ffc1057SHemant Agrawal */ 17522ffc1057SHemant Agrawal uint32_t fm_port_config_size_of_fifo(t_handle h_fm_port, 17532ffc1057SHemant Agrawal t_fm_port_rsrc *p_size_of_fifo); 17542ffc1057SHemant Agrawal 17552ffc1057SHemant Agrawal /* 17562ffc1057SHemant Agrawal * @Function fm_port_config_deq_high_priority 17572ffc1057SHemant Agrawal * 17582ffc1057SHemant Agrawal * @Description Calling this routine changes the dequeue priority in the 17592ffc1057SHemant Agrawal * internal driver data base from its default configuration 17602ffc1057SHemant Agrawal * 1G: [DEFAULT_PORT_deqHighPriority_1G] 17612ffc1057SHemant Agrawal * 10G: [DEFAULT_PORT_deqHighPriority_10G] 17622ffc1057SHemant Agrawal * 17632ffc1057SHemant Agrawal * May be used for Non - Rx ports only 17642ffc1057SHemant Agrawal * 17652ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 17662ffc1057SHemant Agrawal * @Param[in] high_pri TRUE to select high priority, FALSE for normal 17672ffc1057SHemant Agrawal * operation. 17682ffc1057SHemant Agrawal * 17692ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 17702ffc1057SHemant Agrawal * 17712ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 17722ffc1057SHemant Agrawal * fm_port_init(). 17732ffc1057SHemant Agrawal */ 17742ffc1057SHemant Agrawal uint32_t fm_port_config_deq_high_priority(t_handle h_fm_port, bool high_pri); 17752ffc1057SHemant Agrawal 17762ffc1057SHemant Agrawal /* 17772ffc1057SHemant Agrawal * @Function fm_port_config_deq_type 17782ffc1057SHemant Agrawal * 17792ffc1057SHemant Agrawal * @Description Calling this routine changes the dequeue type parameter in the 17802ffc1057SHemant Agrawal * internal driver data base from its default configuration 17812ffc1057SHemant Agrawal * [DEFAULT_PORT_deq_type]. 17822ffc1057SHemant Agrawal * 17832ffc1057SHemant Agrawal * May be used for Non - Rx ports only 17842ffc1057SHemant Agrawal * 17852ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 17862ffc1057SHemant Agrawal * @Param[in] deq_type According to QM definition. 17872ffc1057SHemant Agrawal * 17882ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 17892ffc1057SHemant Agrawal * 17902ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 17912ffc1057SHemant Agrawal * fm_port_init(). 17922ffc1057SHemant Agrawal */ 17932ffc1057SHemant Agrawal uint32_t fm_port_config_deq_type(t_handle h_fm_port, 17942ffc1057SHemant Agrawal e_fm_port_deq_type deq_type); 17952ffc1057SHemant Agrawal 17962ffc1057SHemant Agrawal /* 17972ffc1057SHemant Agrawal * @Function fm_port_config_deq_prefetch_option 17982ffc1057SHemant Agrawal * 17992ffc1057SHemant Agrawal * @Description Calling this routine changes the dequeue prefetch option 18002ffc1057SHemant Agrawal * parameter in the internal driver data base from its default 18012ffc1057SHemant Agrawal * configuration [DEFAULT_PORT_deq_prefetch_option] 18022ffc1057SHemant Agrawal * Note: Available for some chips only 18032ffc1057SHemant Agrawal * 18042ffc1057SHemant Agrawal * May be used for Non - Rx ports only 18052ffc1057SHemant Agrawal * 18062ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 18072ffc1057SHemant Agrawal * @Param[in] deq_prefetch_option New option 18082ffc1057SHemant Agrawal * 18092ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 18102ffc1057SHemant Agrawal * 18112ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 18122ffc1057SHemant Agrawal * fm_port_init(). 18132ffc1057SHemant Agrawal */ 18142ffc1057SHemant Agrawal uint32_t fm_port_config_deq_prefetch_option(t_handle h_fm_port, 18152ffc1057SHemant Agrawal e_fm_port_deq_prefetch_option deq_prefetch_option); 18162ffc1057SHemant Agrawal 18172ffc1057SHemant Agrawal /* 18182ffc1057SHemant Agrawal * @Function fm_port_config_deq_byte_cnt 18192ffc1057SHemant Agrawal * 18202ffc1057SHemant Agrawal * @Description Calling this routine changes the dequeue byte count parameter 18212ffc1057SHemant Agrawal * in the internal driver data base from its default 18222ffc1057SHemant Agrawal * configuration. 18232ffc1057SHemant Agrawal * 1G:[DEFAULT_PORT_deq_byte_cnt_1G]. 18242ffc1057SHemant Agrawal * 10G:[DEFAULT_PORT_deq_byte_cnt_10G]. 18252ffc1057SHemant Agrawal * 18262ffc1057SHemant Agrawal * May be used for Non - Rx ports only 18272ffc1057SHemant Agrawal * 18282ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 18292ffc1057SHemant Agrawal * @Param[in] deq_byte_cnt New byte count 18302ffc1057SHemant Agrawal * 18312ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 18322ffc1057SHemant Agrawal * 18332ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 18342ffc1057SHemant Agrawal * fm_port_init(). 18352ffc1057SHemant Agrawal */ 18362ffc1057SHemant Agrawal uint32_t fm_port_config_deq_byte_cnt(t_handle h_fm_port, 18372ffc1057SHemant Agrawal uint16_t deq_byte_cnt); 18382ffc1057SHemant Agrawal 18392ffc1057SHemant Agrawal /* 18402ffc1057SHemant Agrawal * @Function fm_port_config_buffer_prefix_content 18412ffc1057SHemant Agrawal * 18422ffc1057SHemant Agrawal * @Description Defines the structure, size and content of the application 18432ffc1057SHemant Agrawal * buffer. The prefix will In Tx ports, if 'pass_prs_result', the 18442ffc1057SHemant Agrawal * application should set a value to their offsets in the prefix 18452ffc1057SHemant Agrawal * of the FM will save the first 'priv_data_size', than, 18462ffc1057SHemant Agrawal * depending on 'pass_prs_result' and 'pass_time_stamp', copy 18472ffc1057SHemant Agrawal * parse result and timeStamp, and the packet itself (in this 18482ffc1057SHemant Agrawal * order), to the application buffer, and to offset. 18492ffc1057SHemant Agrawal * Calling this routine changes the buffer margins definitions in 18502ffc1057SHemant Agrawal * the internal driver data base from its default configuration: 18512ffc1057SHemant Agrawal * Data size: [DEFAULT_PORT_bufferPrefixContent_priv_data_size] 18522ffc1057SHemant Agrawal * Pass Parser result: 18532ffc1057SHemant Agrawal * [DEFAULT_PORT_bufferPrefixContent_pass_prs_result]. 18542ffc1057SHemant Agrawal * Pass timestamp: 18552ffc1057SHemant Agrawal * [DEFAULT_PORT_bufferPrefixContent_pass_time_stamp]. 18562ffc1057SHemant Agrawal * 18572ffc1057SHemant Agrawal * May be used for all ports 18582ffc1057SHemant Agrawal * 18592ffc1057SHemant Agrawal * 18602ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port 18612ffc1057SHemant Agrawal * module. 18622ffc1057SHemant Agrawal * @Param[in,out] p_fm_buffer_prefix_content A structure of 18632ffc1057SHemant Agrawal * parameters describing 18642ffc1057SHemant Agrawal * the structure of the 18652ffc1057SHemant Agrawal * buffer. 18662ffc1057SHemant Agrawal * Out parameter: Start 18672ffc1057SHemant Agrawal * margin - offset of data 18682ffc1057SHemant Agrawal * from start of external 18692ffc1057SHemant Agrawal * buffer. 18702ffc1057SHemant Agrawal * 18712ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 18722ffc1057SHemant Agrawal * 18732ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 18742ffc1057SHemant Agrawal * fm_port_init(). 18752ffc1057SHemant Agrawal */ 18762ffc1057SHemant Agrawal uint32_t fm_port_config_buffer_prefix_content(t_handle h_fm_port, 18772ffc1057SHemant Agrawal t_fm_buffer_prefix_content *p_fm_buffer_prefix_content); 18782ffc1057SHemant Agrawal 18792ffc1057SHemant Agrawal /* 18802ffc1057SHemant Agrawal * @Function fm_port_config_checksum_last_bytes_ignore 18812ffc1057SHemant Agrawal * 18822ffc1057SHemant Agrawal * @Description Calling this routine changes the number of checksum bytes to 18832ffc1057SHemant Agrawal * ignore parameter in the internal driver data base from its 18842ffc1057SHemant Agrawal * default configuration. 18852ffc1057SHemant Agrawal * 18862ffc1057SHemant Agrawal * May be used by Tx & Rx ports only 18872ffc1057SHemant Agrawal * 18882ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 18892ffc1057SHemant Agrawal * @Param[in] checksum_last_bytes_ignore New value 18902ffc1057SHemant Agrawal * 18912ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 18922ffc1057SHemant Agrawal * 18932ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 18942ffc1057SHemant Agrawal * fm_port_init(). 18952ffc1057SHemant Agrawal */ 18962ffc1057SHemant Agrawal uint32_t fm_port_config_checksum_last_bytes_ignore(t_handle h_fm_port, 18972ffc1057SHemant Agrawal uint8_t checksum_last_bytes_ignore); 18982ffc1057SHemant Agrawal 18992ffc1057SHemant Agrawal /* 19002ffc1057SHemant Agrawal * @Function fm_port_config_cut_bytes_from_end 19012ffc1057SHemant Agrawal * 19022ffc1057SHemant Agrawal * @Description Calling this routine changes the number of bytes to cut from a 19032ffc1057SHemant Agrawal * frame's end parameter in the internal driver data base 19042ffc1057SHemant Agrawal * from its default configuration 19052ffc1057SHemant Agrawal * [DEFAULT_PORT_cut_bytes_from_end] 19062ffc1057SHemant Agrawal * Note that if the result of (frame length before chop - 19072ffc1057SHemant Agrawal * cut_bytes_from_end) is less than 14 bytes, the chop operation 19082ffc1057SHemant Agrawal * is not executed. 19092ffc1057SHemant Agrawal * 19102ffc1057SHemant Agrawal * May be used for Rx ports only 19112ffc1057SHemant Agrawal * 19122ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 19132ffc1057SHemant Agrawal * @Param[in] cut_bytes_from_end New value 19142ffc1057SHemant Agrawal * 19152ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 19162ffc1057SHemant Agrawal * 19172ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 19182ffc1057SHemant Agrawal * fm_port_init(). 19192ffc1057SHemant Agrawal */ 19202ffc1057SHemant Agrawal uint32_t fm_port_config_cut_bytes_from_end(t_handle h_fm_port, 19212ffc1057SHemant Agrawal uint8_t cut_bytes_from_end); 19222ffc1057SHemant Agrawal 19232ffc1057SHemant Agrawal /* 19242ffc1057SHemant Agrawal * @Function fm_port_config_ext_buf_pools 19252ffc1057SHemant Agrawal * 19262ffc1057SHemant Agrawal * @Description This routine should be called for OP ports that internally use 19272ffc1057SHemant Agrawal * BM buffer pools. In such cases, e.g. for fragmentation and 19282ffc1057SHemant Agrawal * re-assembly, the FM needs new BM buffers. By calling this 19292ffc1057SHemant Agrawal * routine the user specifies the BM buffer pools that should be 19302ffc1057SHemant Agrawal * used. 19312ffc1057SHemant Agrawal * 19322ffc1057SHemant Agrawal * Note: Available for some chips only 19332ffc1057SHemant Agrawal * 19342ffc1057SHemant Agrawal * May be used for OP ports only 19352ffc1057SHemant Agrawal * 19362ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 19372ffc1057SHemant Agrawal * @Param[in] p_fm_ext_pools A structure of parameters for the 19382ffc1057SHemant Agrawal * external pools. 19392ffc1057SHemant Agrawal * 19402ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 19412ffc1057SHemant Agrawal * 19422ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 19432ffc1057SHemant Agrawal * fm_port_init(). 19442ffc1057SHemant Agrawal */ 19452ffc1057SHemant Agrawal uint32_t fm_port_config_ext_buf_pools(t_handle h_fm_port, 19462ffc1057SHemant Agrawal t_fm_ext_pools *p_fm_ext_pools); 19472ffc1057SHemant Agrawal 19482ffc1057SHemant Agrawal /* 19492ffc1057SHemant Agrawal * @Function fm_port_config_backup_pools 19502ffc1057SHemant Agrawal * 19512ffc1057SHemant Agrawal * @Description Calling this routine allows the configuration of some of the 19522ffc1057SHemant Agrawal * BM pools defined for this port as backup pools. 19532ffc1057SHemant Agrawal * A pool configured to be a backup pool will be used only if all 19542ffc1057SHemant Agrawal * other enabled non - backup pools are depleted. 19552ffc1057SHemant Agrawal * 19562ffc1057SHemant Agrawal * May be used for Rx ports only 19572ffc1057SHemant Agrawal * 19582ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 19592ffc1057SHemant Agrawal * @Param[in] p_fm_port_backup_bm_pools An array of pool id's. All pools 19602ffc1057SHemant Agrawal * specified here will be defined 19612ffc1057SHemant Agrawal * as backup pools. 19622ffc1057SHemant Agrawal * 19632ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 19642ffc1057SHemant Agrawal * 19652ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 19662ffc1057SHemant Agrawal * fm_port_init(). 19672ffc1057SHemant Agrawal */ 19682ffc1057SHemant Agrawal uint32_t fm_port_config_backup_pools(t_handle h_fm_port, 19692ffc1057SHemant Agrawal t_fm_backup_bm_pools *p_fm_port_backup_bm_pools); 19702ffc1057SHemant Agrawal 19712ffc1057SHemant Agrawal /* 19722ffc1057SHemant Agrawal * @Function fm_port_config_frm_discard_override 19732ffc1057SHemant Agrawal * 19742ffc1057SHemant Agrawal * @Description Calling this routine changes the error frames destination 19752ffc1057SHemant Agrawal * parameter in the internal driver data base from its default 19762ffc1057SHemant Agrawal * configuration: override =[DEFAULT_PORT_frmDiscardOverride] 19772ffc1057SHemant Agrawal * 19782ffc1057SHemant Agrawal * May be used for Rx and OP ports only 19792ffc1057SHemant Agrawal * 19802ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 19812ffc1057SHemant Agrawal * @Param[in] override TRUE to override discarding of error frames and 19822ffc1057SHemant Agrawal * enqueueing them to error queue. 19832ffc1057SHemant Agrawal * 19842ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 19852ffc1057SHemant Agrawal * 19862ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 19872ffc1057SHemant Agrawal * fm_port_init(). 19882ffc1057SHemant Agrawal */ 19892ffc1057SHemant Agrawal uint32_t fm_port_config_frm_discard_override(t_handle h_fm_port, 19902ffc1057SHemant Agrawal bool override); 19912ffc1057SHemant Agrawal 19922ffc1057SHemant Agrawal /* 19932ffc1057SHemant Agrawal * @Function fm_port_config_errors_to_discard 19942ffc1057SHemant Agrawal * 19952ffc1057SHemant Agrawal * @Description Calling this routine changes the behaviour on error parameter 19962ffc1057SHemant Agrawal * in the internal driver data base from its default 19972ffc1057SHemant Agrawal * configuration: [DEFAULT_PORT_errorsToDiscard]. 19982ffc1057SHemant Agrawal * If a requested error was previously defined as 19992ffc1057SHemant Agrawal * "ErrorsToEnqueue" it's definition will change and the frame 20002ffc1057SHemant Agrawal * will be discarded. Errors that were not defined either as 20012ffc1057SHemant Agrawal * "ErrorsToEnqueue" nor as "ErrorsToDiscard", will be forwarded 20022ffc1057SHemant Agrawal * to CPU. 20032ffc1057SHemant Agrawal * 20042ffc1057SHemant Agrawal * May be used for Rx and OP ports only 20052ffc1057SHemant Agrawal * 20062ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 20072ffc1057SHemant Agrawal * @Param[in] errs A list of errors to discard 20082ffc1057SHemant Agrawal * 20092ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 20102ffc1057SHemant Agrawal * 20112ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 20122ffc1057SHemant Agrawal * fm_port_init(). 20132ffc1057SHemant Agrawal */ 20142ffc1057SHemant Agrawal uint32_t fm_port_config_errors_to_discard(t_handle h_fm_port, 20152ffc1057SHemant Agrawal fm_port_frame_err_select_t errs); 20162ffc1057SHemant Agrawal 20172ffc1057SHemant Agrawal /* 20182ffc1057SHemant Agrawal * @Function fm_port_config_dma_ic_cache_attr 20192ffc1057SHemant Agrawal * 20202ffc1057SHemant Agrawal * @Description Calling this routine changes the internal context cache 20212ffc1057SHemant Agrawal * attribute parameter in the internal driver data base 20222ffc1057SHemant Agrawal * from its default configuration: 20232ffc1057SHemant Agrawal * [DEFAULT_PORT_dmaIntContextCacheAttr] 20242ffc1057SHemant Agrawal * 20252ffc1057SHemant Agrawal * May be used for all port types 20262ffc1057SHemant Agrawal * 20272ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 20282ffc1057SHemant Agrawal * @Param[in] int_context_cache_attr New selection 20292ffc1057SHemant Agrawal * 20302ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 20312ffc1057SHemant Agrawal * 20322ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 20332ffc1057SHemant Agrawal * fm_port_init(). 20342ffc1057SHemant Agrawal */ 20352ffc1057SHemant Agrawal uint32_t fm_port_config_dma_ic_cache_attr(t_handle h_fm_port, 20362ffc1057SHemant Agrawal e_fm_dma_cache_option int_context_cache_attr); 20372ffc1057SHemant Agrawal 20382ffc1057SHemant Agrawal /* 20392ffc1057SHemant Agrawal * @Function fm_port_config_dma_hdr_attr 20402ffc1057SHemant Agrawal * 20412ffc1057SHemant Agrawal * @Description Calling this routine changes the header cache attribute 20422ffc1057SHemant Agrawal * parameter in the internal driver data base from its default 20432ffc1057SHemant Agrawal * configuration[DEFAULT_PORT_dmaHeaderCacheAttr] 20442ffc1057SHemant Agrawal * 20452ffc1057SHemant Agrawal * May be used for all port types 20462ffc1057SHemant Agrawal * 20472ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 20482ffc1057SHemant Agrawal * @Param[in] header_cache_attr New selection 20492ffc1057SHemant Agrawal * 20502ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 20512ffc1057SHemant Agrawal * 20522ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 20532ffc1057SHemant Agrawal * fm_port_init(). 20542ffc1057SHemant Agrawal */ 20552ffc1057SHemant Agrawal uint32_t fm_port_config_dma_hdr_attr(t_handle h_fm_port, 20562ffc1057SHemant Agrawal e_fm_dma_cache_option header_cache_attr); 20572ffc1057SHemant Agrawal 20582ffc1057SHemant Agrawal /* 20592ffc1057SHemant Agrawal * @Function fm_port_config_dma_scatter_gather_attr 20602ffc1057SHemant Agrawal * 20612ffc1057SHemant Agrawal * @Description Calling this routine changes the scatter gather cache 20622ffc1057SHemant Agrawal * attribute parameter in the internal driver data base from its 20632ffc1057SHemant Agrawal * default configuration[DEFAULT_PORT_dmaScatterGatherCacheAttr] 20642ffc1057SHemant Agrawal * 20652ffc1057SHemant Agrawal * May be used for all port types 20662ffc1057SHemant Agrawal * 20672ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 20682ffc1057SHemant Agrawal * @Param[in] scatter_gather_cache_attr New selection 20692ffc1057SHemant Agrawal * 20702ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 20712ffc1057SHemant Agrawal * 20722ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 20732ffc1057SHemant Agrawal * fm_port_init(). 20742ffc1057SHemant Agrawal */ 20752ffc1057SHemant Agrawal uint32_t fm_port_config_dma_scatter_gather_attr(t_handle h_fm_port, 20762ffc1057SHemant Agrawal e_fm_dma_cache_option scatter_gather_cache_attr); 20772ffc1057SHemant Agrawal 20782ffc1057SHemant Agrawal /* 20792ffc1057SHemant Agrawal * @Function fm_port_config_dma_write_optimize 20802ffc1057SHemant Agrawal * 20812ffc1057SHemant Agrawal * @Description Calling this routine changes the write optimization parameter 20822ffc1057SHemant Agrawal * in the internal driver data base from its default 20832ffc1057SHemant Agrawal * configuration : By default optimize = 20842ffc1057SHemant Agrawal * [DEFAULT_PORT_dmaWriteOptimize]. 20852ffc1057SHemant Agrawal * Note: 20862ffc1057SHemant Agrawal * 1. For head optimization, data alignment must be >= 16 20872ffc1057SHemant Agrawal * (supported by default). 20882ffc1057SHemant Agrawal * 20892ffc1057SHemant Agrawal * 2. For tail optimization, note that the optimization is 20902ffc1057SHemant Agrawal * performed by extending the write transaction of the frame 20912ffc1057SHemant Agrawal * payload at the tail as needed to achieve optimal bus 20922ffc1057SHemant Agrawal * transfers, so that the last write is extended to be on 20932ffc1057SHemant Agrawal * 16 / 64 bytes aligned block (chip dependent). 20942ffc1057SHemant Agrawal * 20952ffc1057SHemant Agrawal * Relevant for non - Tx port types 20962ffc1057SHemant Agrawal * 20972ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 20982ffc1057SHemant Agrawal * @Param[in] optimize TRUE to enable optimization, FALSE for normal 20992ffc1057SHemant Agrawal * operation 21002ffc1057SHemant Agrawal * 21012ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 21022ffc1057SHemant Agrawal * 21032ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 21042ffc1057SHemant Agrawal * fm_port_init(). 21052ffc1057SHemant Agrawal */ 21062ffc1057SHemant Agrawal uint32_t fm_port_config_dma_write_optimize(t_handle h_fm_port, 21072ffc1057SHemant Agrawal bool optimize); 21082ffc1057SHemant Agrawal 21092ffc1057SHemant Agrawal /* 21102ffc1057SHemant Agrawal * @Function fm_port_config_no_scather_gather 21112ffc1057SHemant Agrawal * 21122ffc1057SHemant Agrawal * @Description Calling this routine changes the no_scather_gather parameter 21132ffc1057SHemant Agrawal * in internal driver data base from its default configuration. 21142ffc1057SHemant Agrawal * 21152ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 21162ffc1057SHemant Agrawal * @Param[in] no_scather_gather TRUE - frame is discarded if can not be 21172ffc1057SHemant Agrawal * stored in single buffer, 21182ffc1057SHemant Agrawal * FALSE - frame can be stored in scatter 21192ffc1057SHemant Agrawal * gather (S / G) format. 21202ffc1057SHemant Agrawal * 21212ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 21222ffc1057SHemant Agrawal * 21232ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 21242ffc1057SHemant Agrawal * fm_port_init(). 21252ffc1057SHemant Agrawal */ 21262ffc1057SHemant Agrawal uint32_t fm_port_config_no_scather_gather(t_handle h_fm_port, 21272ffc1057SHemant Agrawal bool no_scather_gather); 21282ffc1057SHemant Agrawal 21292ffc1057SHemant Agrawal /* 21302ffc1057SHemant Agrawal * @Function fm_port_config_dflt_color 21312ffc1057SHemant Agrawal * 21322ffc1057SHemant Agrawal * @Description Calling this routine changes the internal default color 21332ffc1057SHemant Agrawal * parameter in the internal driver data base 21342ffc1057SHemant Agrawal * from its default configuration[DEFAULT_PORT_color] 21352ffc1057SHemant Agrawal * 21362ffc1057SHemant Agrawal * May be used for all port types 21372ffc1057SHemant Agrawal * 21382ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 21392ffc1057SHemant Agrawal * @Param[in] color New selection 21402ffc1057SHemant Agrawal * 21412ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 21422ffc1057SHemant Agrawal * 21432ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 21442ffc1057SHemant Agrawal * fm_port_init(). 21452ffc1057SHemant Agrawal */ 21462ffc1057SHemant Agrawal uint32_t fm_port_config_dflt_color(t_handle h_fm_port, e_fm_port_color color); 21472ffc1057SHemant Agrawal 21482ffc1057SHemant Agrawal /* 21492ffc1057SHemant Agrawal * @Function fm_port_config_sync_req 21502ffc1057SHemant Agrawal * 21512ffc1057SHemant Agrawal * @Description Calling this routine changes the synchronization attribute 21522ffc1057SHemant Agrawal * parameter in the internal driver data base from its default 21532ffc1057SHemant Agrawal * configuration: sync_req =[DEFAULT_PORT_sync_req] 21542ffc1057SHemant Agrawal * 21552ffc1057SHemant Agrawal * May be used for all port types 21562ffc1057SHemant Agrawal * 21572ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 21582ffc1057SHemant Agrawal * @Param[in] sync_req TRUE to request synchronization, FALSE 21592ffc1057SHemant Agrawal * otherwise. 21602ffc1057SHemant Agrawal * 21612ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 21622ffc1057SHemant Agrawal * 21632ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 21642ffc1057SHemant Agrawal * fm_port_init(). 21652ffc1057SHemant Agrawal */ 21662ffc1057SHemant Agrawal uint32_t fm_port_config_sync_req(t_handle h_fm_port, bool sync_req); 21672ffc1057SHemant Agrawal 21682ffc1057SHemant Agrawal /* 21692ffc1057SHemant Agrawal * @Function fm_port_config_forward_reuse_int_context 21702ffc1057SHemant Agrawal * 21712ffc1057SHemant Agrawal * @Description This routine is relevant for Rx ports that are routed to OP 21722ffc1057SHemant Agrawal * port. It changes the internal context reuse option in the 21732ffc1057SHemant Agrawal * internal driver data base from its default configuration: 21742ffc1057SHemant Agrawal * reuse =[DEFAULT_PORT_forwardIntContextReuse] 21752ffc1057SHemant Agrawal * 21762ffc1057SHemant Agrawal * May be used for Rx ports only 21772ffc1057SHemant Agrawal * 21782ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 21792ffc1057SHemant Agrawal * @Param[in] reuse TRUE to reuse internal context on frames 21802ffc1057SHemant Agrawal * forwarded to OP port. 21812ffc1057SHemant Agrawal * 21822ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 21832ffc1057SHemant Agrawal * 21842ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 21852ffc1057SHemant Agrawal * fm_port_init(). 21862ffc1057SHemant Agrawal */ 21872ffc1057SHemant Agrawal uint32_t fm_port_config_forward_reuse_int_context(t_handle h_fm_port, 21882ffc1057SHemant Agrawal bool reuse); 21892ffc1057SHemant Agrawal 21902ffc1057SHemant Agrawal /* 21912ffc1057SHemant Agrawal * @Function fm_port_config_donot_release_tx_buf_to_bm 21922ffc1057SHemant Agrawal * 21932ffc1057SHemant Agrawal * @Description This routine should be called if no Tx confirmation 21942ffc1057SHemant Agrawal * is done, and yet buffers should not be released to the BM. 21952ffc1057SHemant Agrawal * 21962ffc1057SHemant Agrawal * Normally, buffers are returned using the Tx confirmation 21972ffc1057SHemant Agrawal * process. When Tx confirmation is not used (defFqid = 0), 21982ffc1057SHemant Agrawal * buffers are typically released to the BM. This routine 21992ffc1057SHemant Agrawal * may be called to avoid this behavior and not release the 22002ffc1057SHemant Agrawal * buffers. 22012ffc1057SHemant Agrawal * 22022ffc1057SHemant Agrawal * May be used for Tx ports only 22032ffc1057SHemant Agrawal * 22042ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 22052ffc1057SHemant Agrawal * 22062ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 22072ffc1057SHemant Agrawal * 22082ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 22092ffc1057SHemant Agrawal * fm_port_init(). 22102ffc1057SHemant Agrawal */ 22112ffc1057SHemant Agrawal uint32_t fm_port_config_donot_release_tx_buf_to_bm(t_handle h_fm_port); 22122ffc1057SHemant Agrawal 22132ffc1057SHemant Agrawal /* 22142ffc1057SHemant Agrawal * @Function fm_port_config_immax_rx_buf_length 22152ffc1057SHemant Agrawal * 22162ffc1057SHemant Agrawal * @Description Changes the maximum receive buffer length from its default 22172ffc1057SHemant Agrawal * configuration: Closest rounded down power of 2 value of the 22182ffc1057SHemant Agrawal * data buffer size. 22192ffc1057SHemant Agrawal * 22202ffc1057SHemant Agrawal * The maximum receive buffer length directly affects the 22212ffc1057SHemant Agrawal * structure of received frames (single- or multi-buffered) and 22222ffc1057SHemant Agrawal * the performance of both the FM and the driver. 22232ffc1057SHemant Agrawal * 22242ffc1057SHemant Agrawal * The selection between single- or multi-buffered frames should 22252ffc1057SHemant Agrawal * be done according to the characteristics of the specific 22262ffc1057SHemant Agrawal * application. The recommended mode is to use a single data 22272ffc1057SHemant Agrawal * buffer per packet, as this mode provides the best performance. 22282ffc1057SHemant Agrawal * However, the user can select to use multiple data buffers per 22292ffc1057SHemant Agrawal * packet. 22302ffc1057SHemant Agrawal * 22312ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 22322ffc1057SHemant Agrawal * @Param[in] new_val Maximum receive buffer length (in bytes). 22332ffc1057SHemant Agrawal * 22342ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 22352ffc1057SHemant Agrawal * 22362ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 22372ffc1057SHemant Agrawal * fm_port_init(). This routine is to be used only if 22382ffc1057SHemant Agrawal * Independent-Mode is enabled. 22392ffc1057SHemant Agrawal */ 22402ffc1057SHemant Agrawal uint32_t fm_port_config_immax_rx_buf_length(t_handle h_fm_port, 22412ffc1057SHemant Agrawal uint16_t new_val); 22422ffc1057SHemant Agrawal 22432ffc1057SHemant Agrawal /* 22442ffc1057SHemant Agrawal * @Function fm_port_config_imrx_bd_ring_length 22452ffc1057SHemant Agrawal * 22462ffc1057SHemant Agrawal * @Description Changes the receive BD ring length from its default 22472ffc1057SHemant Agrawal * configuration:[DEFAULT_PORT_rxBdRingLength] 22482ffc1057SHemant Agrawal * 22492ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 22502ffc1057SHemant Agrawal * @Param[in] new_val The desired BD ring length. 22512ffc1057SHemant Agrawal * 22522ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 22532ffc1057SHemant Agrawal * 22542ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 22552ffc1057SHemant Agrawal * fm_port_init(). This routine is to be used only if 22562ffc1057SHemant Agrawal * Independent-Mode is enabled. 22572ffc1057SHemant Agrawal */ 22582ffc1057SHemant Agrawal uint32_t fm_port_config_imrx_bd_ring_length(t_handle h_fm_port, 22592ffc1057SHemant Agrawal uint16_t new_val); 22602ffc1057SHemant Agrawal 22612ffc1057SHemant Agrawal /* 22622ffc1057SHemant Agrawal * @Function fm_port_config_imtx_bd_ring_length 22632ffc1057SHemant Agrawal * 22642ffc1057SHemant Agrawal * @Description Changes the transmit BD ring length from its default 22652ffc1057SHemant Agrawal * configuration:[DEFAULT_PORT_txBdRingLength] 22662ffc1057SHemant Agrawal * 22672ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 22682ffc1057SHemant Agrawal * @Param[in] new_val The desired BD ring length. 22692ffc1057SHemant Agrawal * 22702ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 22712ffc1057SHemant Agrawal * 22722ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 22732ffc1057SHemant Agrawal * fm_port_init(). This routine is to be used only if 22742ffc1057SHemant Agrawal * Independent-Mode is enabled. 22752ffc1057SHemant Agrawal */ 22762ffc1057SHemant Agrawal uint32_t fm_port_config_imtx_bd_ring_length(t_handle h_fm_port, 22772ffc1057SHemant Agrawal uint16_t new_val); 22782ffc1057SHemant Agrawal 22792ffc1057SHemant Agrawal /* 22802ffc1057SHemant Agrawal * @Function fm_port_config_imfman_ctrl_external_structs_memory 22812ffc1057SHemant Agrawal * 22822ffc1057SHemant Agrawal * @Description Configures memory partition and attributes for FMan-Controller 22832ffc1057SHemant Agrawal * data structures (e.g. BD rings). 22842ffc1057SHemant Agrawal * Calling this routine changes the internal driver data base 22852ffc1057SHemant Agrawal * from its default configuration 22862ffc1057SHemant Agrawal * [DEFAULT_PORT_ImfwExtStructsMemId, 22872ffc1057SHemant Agrawal * DEFAULT_PORT_ImfwExtStructsMemAttr]. 22882ffc1057SHemant Agrawal * 22892ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 22902ffc1057SHemant Agrawal * @Param[in] mem_id Memory partition ID. 22912ffc1057SHemant Agrawal * @Param[in] mem_attributes Memory attributes mask (a combination of 22922ffc1057SHemant Agrawal * MEMORY_ATTR_x flags). 22932ffc1057SHemant Agrawal * 22942ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 22952ffc1057SHemant Agrawal */ 22962ffc1057SHemant Agrawal uint32_t fm_port_config_imfman_ctrl_external_structs_memory(t_handle h_fm_port, 22972ffc1057SHemant Agrawal uint8_t mem_id, 22982ffc1057SHemant Agrawal uint32_t mem_attributes); 22992ffc1057SHemant Agrawal 23002ffc1057SHemant Agrawal /* 23012ffc1057SHemant Agrawal * @Function fm_port_config_impolling 23022ffc1057SHemant Agrawal * 23032ffc1057SHemant Agrawal * @Description Changes the Rx flow from interrupt driven (default) to 23042ffc1057SHemant Agrawal * polling. 23052ffc1057SHemant Agrawal * 23062ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 23072ffc1057SHemant Agrawal * 23082ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 23092ffc1057SHemant Agrawal * 23102ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 23112ffc1057SHemant Agrawal * fm_port_init(). 23122ffc1057SHemant Agrawal * This routine is to be used only if Independent-Mode is 23132ffc1057SHemant Agrawal * enabled. 23142ffc1057SHemant Agrawal */ 23152ffc1057SHemant Agrawal uint32_t fm_port_config_impolling(t_handle h_fm_port); 23162ffc1057SHemant Agrawal 23172ffc1057SHemant Agrawal /* 23182ffc1057SHemant Agrawal * @Function fm_port_config_max_frame_length 23192ffc1057SHemant Agrawal * 23202ffc1057SHemant Agrawal * @Description Changes the definition of the max size of frame that should be 23212ffc1057SHemant Agrawal * transmitted/received on this port from its default value 23222ffc1057SHemant Agrawal * [DEFAULT_PORT_maxFrameLength]. 23232ffc1057SHemant Agrawal * This parameter is used for confirmation of the minimum Fifo 23242ffc1057SHemant Agrawal * size calculations and only for Tx ports or ports working in 23252ffc1057SHemant Agrawal * independent mode. This should be larger than the maximum 23262ffc1057SHemant Agrawal * possible MTU that will be used for this port (i.e. its MAC). 23272ffc1057SHemant Agrawal * 23282ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 23292ffc1057SHemant Agrawal * @Param[in] length Max size of frame 23302ffc1057SHemant Agrawal * 23312ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 23322ffc1057SHemant Agrawal * 23332ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 23342ffc1057SHemant Agrawal * fm_port_init(). This routine is to be used only if 23352ffc1057SHemant Agrawal * Independent-Mode is enabled. 23362ffc1057SHemant Agrawal */ 23372ffc1057SHemant Agrawal uint32_t fm_port_config_max_frame_length(t_handle h_fm_port, 23382ffc1057SHemant Agrawal uint16_t length); 23392ffc1057SHemant Agrawal 23402ffc1057SHemant Agrawal /* 23412ffc1057SHemant Agrawal * @Function fm_port_config_tx_fifo_min_fill_level 23422ffc1057SHemant Agrawal * 23432ffc1057SHemant Agrawal * @Description Calling this routine changes the fifo minimum fill level 23442ffc1057SHemant Agrawal * parameter in the internal driver data base from its default 23452ffc1057SHemant Agrawal * configuration[DEFAULT_PORT_txFifoMinFillLevel] 23462ffc1057SHemant Agrawal * 23472ffc1057SHemant Agrawal * May be used for Tx ports only 23482ffc1057SHemant Agrawal * 23492ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 23502ffc1057SHemant Agrawal * @Param[in] min_fill_level New value 23512ffc1057SHemant Agrawal * 23522ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 23532ffc1057SHemant Agrawal * 23542ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 23552ffc1057SHemant Agrawal * fm_port_init(). 23562ffc1057SHemant Agrawal */ 23572ffc1057SHemant Agrawal uint32_t fm_port_config_tx_fifo_min_fill_level(t_handle h_fm_port, 23582ffc1057SHemant Agrawal uint32_t min_fill_level); 23592ffc1057SHemant Agrawal 23602ffc1057SHemant Agrawal /* 23612ffc1057SHemant Agrawal * @Function fm_port_config_fifo_deq_pipeline_depth 23622ffc1057SHemant Agrawal * 23632ffc1057SHemant Agrawal * @Description Calling this routine changes the fifo dequeue pipeline depth 23642ffc1057SHemant Agrawal * parameter in the internal driver data base 23652ffc1057SHemant Agrawal * 23662ffc1057SHemant Agrawal * from its default configuration : 23672ffc1057SHemant Agrawal * 1G ports : [DEFAULT_PORT_fifoDeqPipelineDepth_1G], 23682ffc1057SHemant Agrawal * 10G port : [DEFAULT_PORT_fifoDeqPipelineDepth_10G], 23692ffc1057SHemant Agrawal * OP port : [DEFAULT_PORT_fifoDeqPipelineDepth_OH] 23702ffc1057SHemant Agrawal * 23712ffc1057SHemant Agrawal * May be used for Tx / OP ports only 23722ffc1057SHemant Agrawal * 23732ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 23742ffc1057SHemant Agrawal * @Param[in] deq_pipeline_depth New value 23752ffc1057SHemant Agrawal * 23762ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 23772ffc1057SHemant Agrawal * 23782ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 23792ffc1057SHemant Agrawal * fm_port_init(). 23802ffc1057SHemant Agrawal */ 23812ffc1057SHemant Agrawal uint32_t fm_port_config_fifo_deq_pipeline_depth(t_handle h_fm_port, 23822ffc1057SHemant Agrawal uint8_t deq_pipeline_depth); 23832ffc1057SHemant Agrawal 23842ffc1057SHemant Agrawal /* 23852ffc1057SHemant Agrawal * @Function fm_port_config_tx_fifo_low_comf_level 23862ffc1057SHemant Agrawal * 23872ffc1057SHemant Agrawal * @Description Calling this routine changes the fifo low comfort level 23882ffc1057SHemant Agrawal * parameter in internal driver data base from its default 23892ffc1057SHemant Agrawal * configuration[DEFAULT_PORT_txFifoLowComfLevel] 23902ffc1057SHemant Agrawal * 23912ffc1057SHemant Agrawal * May be used for Tx ports only 23922ffc1057SHemant Agrawal * 23932ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 23942ffc1057SHemant Agrawal * @Param[in] fifo_low_comf_level New value 23952ffc1057SHemant Agrawal * 23962ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 23972ffc1057SHemant Agrawal * 23982ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 23992ffc1057SHemant Agrawal * fm_port_init(). 24002ffc1057SHemant Agrawal */ 24012ffc1057SHemant Agrawal uint32_t fm_port_config_tx_fifo_low_comf_level(t_handle h_fm_port, 24022ffc1057SHemant Agrawal uint32_t fifo_low_comf_level); 24032ffc1057SHemant Agrawal 24042ffc1057SHemant Agrawal /* 24052ffc1057SHemant Agrawal * @Function fm_port_config_rx_fifo_threshold 24062ffc1057SHemant Agrawal * 24072ffc1057SHemant Agrawal * @Description Calling this routine changes the threshold of the FIFO fill 24082ffc1057SHemant Agrawal * level parameter in the internal driver data base from its 24092ffc1057SHemant Agrawal * default configuration[DEFAULT_PORT_rxFifoThreshold] 24102ffc1057SHemant Agrawal * 24112ffc1057SHemant Agrawal * If the total number of buffers which are currently in use and 24122ffc1057SHemant Agrawal * associated with the specific RX port exceed this threshold, 24132ffc1057SHemant Agrawal * the BMI will signal the MAC to send a pause frame over the 24142ffc1057SHemant Agrawal * link. 24152ffc1057SHemant Agrawal * 24162ffc1057SHemant Agrawal * May be used for Rx ports only 24172ffc1057SHemant Agrawal * 24182ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 24192ffc1057SHemant Agrawal * @Param[in] fifo_threshold New value 24202ffc1057SHemant Agrawal * 24212ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 24222ffc1057SHemant Agrawal * 24232ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 24242ffc1057SHemant Agrawal * fm_port_init(). 24252ffc1057SHemant Agrawal */ 24262ffc1057SHemant Agrawal uint32_t fm_port_config_rx_fifo_threshold(t_handle h_fm_port, 24272ffc1057SHemant Agrawal uint32_t fifo_threshold); 24282ffc1057SHemant Agrawal 24292ffc1057SHemant Agrawal /* 24302ffc1057SHemant Agrawal * @Function fm_port_config_rx_fifo_pri_elevation_level 24312ffc1057SHemant Agrawal * 24322ffc1057SHemant Agrawal * @Description Calling this routine changes the priority elevation level 24332ffc1057SHemant Agrawal * parameter in the internal driver data base from its default 24342ffc1057SHemant Agrawal * configuration[DEFAULT_PORT_rxFifoPriElevationLevel] 24352ffc1057SHemant Agrawal * 24362ffc1057SHemant Agrawal * If the total number of buffers which are currently in use and 24372ffc1057SHemant Agrawal * associated with the specific RX port exceed the amount 24382ffc1057SHemant Agrawal * specified in pri_elevation_level, BMI will signal the main 24392ffc1057SHemant Agrawal * FM's DMA to elevate the FM priority on the system bus. 24402ffc1057SHemant Agrawal * 24412ffc1057SHemant Agrawal * May be used for Rx ports only 24422ffc1057SHemant Agrawal * 24432ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 24442ffc1057SHemant Agrawal * @Param[in] pri_elevation_level New value 24452ffc1057SHemant Agrawal * 24462ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 24472ffc1057SHemant Agrawal * 24482ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 24492ffc1057SHemant Agrawal * fm_port_init(). 24502ffc1057SHemant Agrawal */ 24512ffc1057SHemant Agrawal uint32_t fm_port_config_rx_fifo_pri_elevation_level(t_handle h_fm_port, 24522ffc1057SHemant Agrawal uint32_t pri_elevation_level); 24532ffc1057SHemant Agrawal 24542ffc1057SHemant Agrawal #ifdef FM_HEAVY_TRAFFIC_HANG_ERRATA_FMAN_A005669 24552ffc1057SHemant Agrawal /* 24562ffc1057SHemant Agrawal * @Function fm_port_config_bcbworkaround 24572ffc1057SHemant Agrawal * 24582ffc1057SHemant Agrawal * @Description Configures BCB errata workaround. 24592ffc1057SHemant Agrawal * 24602ffc1057SHemant Agrawal * When BCB errata is applicable, the workaround is always 24612ffc1057SHemant Agrawal * performed by FM Controller. Thus, this function does not 24622ffc1057SHemant Agrawal * actually enable errata workaround but rather allows driver to 24632ffc1057SHemant Agrawal * perform adjustments required due to errata workaround 24642ffc1057SHemant Agrawal * execution in FM controller. 24652ffc1057SHemant Agrawal * 24662ffc1057SHemant Agrawal * Applying BCB workaround also configures 24672ffc1057SHemant Agrawal * FM_PORT_FRM_ERR_PHYSICAL errors to be discarded. Thus 24682ffc1057SHemant Agrawal * FM_PORT_FRM_ERR_PHYSICAL can't be set by 24692ffc1057SHemant Agrawal * fm_port_set_errors_route() function. 24702ffc1057SHemant Agrawal * 24712ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 24722ffc1057SHemant Agrawal * 24732ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 24742ffc1057SHemant Agrawal * 24752ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 24762ffc1057SHemant Agrawal * fm_port_init(). 24772ffc1057SHemant Agrawal */ 24782ffc1057SHemant Agrawal uint32_t fm_port_config_bcbworkaround(t_handle h_fm_port); 24792ffc1057SHemant Agrawal #endif /* FM_HEAVY_TRAFFIC_HANG_ERRATA_FMAN_A005669 */ 24802ffc1057SHemant Agrawal 24812ffc1057SHemant Agrawal /* 24822ffc1057SHemant Agrawal * @Function fm_port_config_internal_buff_offset 24832ffc1057SHemant Agrawal * 24842ffc1057SHemant Agrawal * @Description Configures internal buffer offset. 24852ffc1057SHemant Agrawal * 24862ffc1057SHemant Agrawal * May be used for Rx and OP ports only 24872ffc1057SHemant Agrawal * 24882ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 24892ffc1057SHemant Agrawal * @Param[in] val New value 24902ffc1057SHemant Agrawal * 24912ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 24922ffc1057SHemant Agrawal * 24932ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 24942ffc1057SHemant Agrawal * fm_port_init(). 24952ffc1057SHemant Agrawal */ 24962ffc1057SHemant Agrawal uint32_t fm_port_config_internal_buff_offset(t_handle h_fm_port, uint8_t val); 24972ffc1057SHemant Agrawal 24982ffc1057SHemant Agrawal /** @} */ /* end of FM_PORT_advanced_init_grp group */ 24992ffc1057SHemant Agrawal /** @} */ /* end of FM_PORT_init_grp group */ 25002ffc1057SHemant Agrawal 25012ffc1057SHemant Agrawal /* 25022ffc1057SHemant Agrawal * @Group FM_PORT_runtime_control_grp FM Port Runtime Control Unit 25032ffc1057SHemant Agrawal * 25042ffc1057SHemant Agrawal * @Description FM Port Runtime control unit API functions, definitions and 25052ffc1057SHemant Agrawal * enums. 25062ffc1057SHemant Agrawal * 25072ffc1057SHemant Agrawal * @{ 25082ffc1057SHemant Agrawal */ 25092ffc1057SHemant Agrawal 25102ffc1057SHemant Agrawal /* 25112ffc1057SHemant Agrawal * @Description enum for defining FM Port counters 25122ffc1057SHemant Agrawal */ 25132ffc1057SHemant Agrawal typedef enum e_fm_port_counters { 25142ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_CYCLE, /**< BMI performance counter */ 25152ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_TASK_UTIL, /**< BMI performance counter */ 25162ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_QUEUE_UTIL, /**< BMI performance counter */ 25172ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_DMA_UTIL, /**< BMI performance counter */ 25182ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_FIFO_UTIL, /**< BMI performance counter */ 25192ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_RX_PAUSE_ACTIVATION, 25202ffc1057SHemant Agrawal /**< BMI Rx only performance counter */ 25212ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_FRAME, /**< BMI statistics counter */ 25222ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_DISCARD_FRAME, /**< BMI statistics counter */ 25232ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_DEALLOC_BUF, 25242ffc1057SHemant Agrawal /**< BMI deallocate buffer statistics counter */ 25252ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_RX_BAD_FRAME, 25262ffc1057SHemant Agrawal /**< BMI Rx only statistics counter */ 25272ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_RX_LARGE_FRAME, 25282ffc1057SHemant Agrawal /**< BMI Rx only statistics counter */ 25292ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_RX_FILTER_FRAME, 25302ffc1057SHemant Agrawal /**< BMI Rx & OP only statistics counter */ 25312ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_RX_LIST_DMA_ERR, 25322ffc1057SHemant Agrawal /**< BMI Rx, OP & HC only statistics counter */ 25332ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_RX_OUT_OF_BUFFERS_DISCARD, 25342ffc1057SHemant Agrawal /**< BMI Rx, OP & HC statistics counter */ 25352ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_PREPARE_TO_ENQUEUE_COUNTER, 25362ffc1057SHemant Agrawal /**< BMI Rx, OP & HC only statistics counter */ 25372ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_WRED_DISCARD, 25382ffc1057SHemant Agrawal /**< BMI OP & HC only statistics counter */ 25392ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_LENGTH_ERR, 25402ffc1057SHemant Agrawal /**< BMI non-Rx statistics counter */ 25412ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_UNSUPPRTED_FORMAT, 25422ffc1057SHemant Agrawal /**< BMI non-Rx statistics counter */ 25432ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_DEQ_TOTAL, /**< QMI total QM dequeues counter */ 25442ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_ENQ_TOTAL, /**< QMI total QM enqueues counter */ 25452ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_DEQ_FROM_DEFAULT, /**< QMI counter */ 25462ffc1057SHemant Agrawal e_FM_PORT_COUNTERS_DEQ_CONFIRM /**< QMI counter */ 25472ffc1057SHemant Agrawal } e_fm_port_counters; 25482ffc1057SHemant Agrawal 25492ffc1057SHemant Agrawal typedef struct t_fm_port_bmi_stats { 25502ffc1057SHemant Agrawal uint32_t cnt_cycle; 25512ffc1057SHemant Agrawal uint32_t cnt_task_util; 25522ffc1057SHemant Agrawal uint32_t cnt_queue_util; 25532ffc1057SHemant Agrawal uint32_t cnt_dma_util; 25542ffc1057SHemant Agrawal uint32_t cnt_fifo_util; 25552ffc1057SHemant Agrawal uint32_t cnt_rx_pause_activation; 25562ffc1057SHemant Agrawal uint32_t cnt_frame; 25572ffc1057SHemant Agrawal uint32_t cnt_discard_frame; 25582ffc1057SHemant Agrawal uint32_t cnt_dealloc_buf; 25592ffc1057SHemant Agrawal uint32_t cnt_rx_bad_frame; 25602ffc1057SHemant Agrawal uint32_t cnt_rx_large_frame; 25612ffc1057SHemant Agrawal uint32_t cnt_rx_filter_frame; 25622ffc1057SHemant Agrawal uint32_t cnt_rx_list_dma_err; 25632ffc1057SHemant Agrawal uint32_t cnt_rx_out_of_buffers_discard; 25642ffc1057SHemant Agrawal uint32_t cnt_wred_discard; 25652ffc1057SHemant Agrawal uint32_t cnt_length_err; 25662ffc1057SHemant Agrawal uint32_t cnt_unsupported_format; 25672ffc1057SHemant Agrawal } t_fm_port_bmi_stats; 25682ffc1057SHemant Agrawal 25692ffc1057SHemant Agrawal /* 25702ffc1057SHemant Agrawal * @Description Structure for Port id parameters. 25712ffc1057SHemant Agrawal * Fields commented 'IN' are passed by the port module to be used 25722ffc1057SHemant Agrawal * by the FM module. 25732ffc1057SHemant Agrawal * Fields commented 'OUT' will be filled by FM before returning 25742ffc1057SHemant Agrawal * to port. 25752ffc1057SHemant Agrawal */ 25762ffc1057SHemant Agrawal typedef struct t_fm_port_congestion_grps { 25772ffc1057SHemant Agrawal uint16_t num_of_congestion_grps_to_consider; 25782ffc1057SHemant Agrawal /**< The number of required CGs to define the size of 25792ffc1057SHemant Agrawal * the following array 25802ffc1057SHemant Agrawal */ 25812ffc1057SHemant Agrawal uint8_t congestion_grps_to_consider[FM_NUM_CONG_GRPS]; 25822ffc1057SHemant Agrawal /**< An array of CG indexes; Note that the size of the 25832ffc1057SHemant Agrawal * array should be 'num_of_congestion_grps_to_consider'. 25842ffc1057SHemant Agrawal */ 25852ffc1057SHemant Agrawal bool pfc_prio_enable[FM_NUM_CONG_GRPS][FM_MAX_PFC_PRIO]; 25862ffc1057SHemant Agrawal /**< a matrix that represents the map between the CG ids 25872ffc1057SHemant Agrawal * defined in 'congestion_grps_to_consider' to the 2588*7be78d02SJosh Soref * priorities mapping array. 25892ffc1057SHemant Agrawal */ 25902ffc1057SHemant Agrawal } t_fm_port_congestion_grps; 25912ffc1057SHemant Agrawal 25922ffc1057SHemant Agrawal 25932ffc1057SHemant Agrawal #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) 25942ffc1057SHemant Agrawal /* 25952ffc1057SHemant Agrawal * @Function fm_port_dump_regs 25962ffc1057SHemant Agrawal * 25972ffc1057SHemant Agrawal * @Description Dump all regs. 25982ffc1057SHemant Agrawal * 25992ffc1057SHemant Agrawal * Calling this routine invalidates the descriptor. 26002ffc1057SHemant Agrawal * 26012ffc1057SHemant Agrawal * @Param[in] h_fm_port FM PORT module descriptor 26022ffc1057SHemant Agrawal * 26032ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 26042ffc1057SHemant Agrawal * 26052ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 26062ffc1057SHemant Agrawal */ 26072ffc1057SHemant Agrawal uint32_t fm_port_dump_regs(t_handle h_fm_port); 26082ffc1057SHemant Agrawal #endif /* (defined(DEBUG_ERRORS) && ... */ 26092ffc1057SHemant Agrawal 26102ffc1057SHemant Agrawal /* 26112ffc1057SHemant Agrawal * @Function fm_port_get_buffer_data_offset 26122ffc1057SHemant Agrawal * 26132ffc1057SHemant Agrawal * @Description Relevant for Rx ports. Returns the data offset from the 26142ffc1057SHemant Agrawal * beginning of the data buffer 26152ffc1057SHemant Agrawal * 26162ffc1057SHemant Agrawal * @Param[in] h_fm_port FM PORT module descriptor 26172ffc1057SHemant Agrawal * 26182ffc1057SHemant Agrawal * @Return data offset. 26192ffc1057SHemant Agrawal * 26202ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 26212ffc1057SHemant Agrawal */ 26222ffc1057SHemant Agrawal uint32_t fm_port_get_buffer_data_offset(t_handle h_fm_port); 26232ffc1057SHemant Agrawal 26242ffc1057SHemant Agrawal /* 26252ffc1057SHemant Agrawal * @Function fm_port_get_buffer_icinfo 26262ffc1057SHemant Agrawal * 26272ffc1057SHemant Agrawal * @Description Returns the Internal Context offset from the beginning of the 26282ffc1057SHemant Agrawal * data buffer 26292ffc1057SHemant Agrawal * 26302ffc1057SHemant Agrawal * @Param[in] h_fm_port FM PORT module descriptor 26312ffc1057SHemant Agrawal * @Param[in] p_data A pointer to the data buffer. 26322ffc1057SHemant Agrawal * 26332ffc1057SHemant Agrawal * @Return Internal context info pointer on success, NULL if 26342ffc1057SHemant Agrawal * 'allOtherInfo' was not configured for this port. 26352ffc1057SHemant Agrawal * 26362ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 26372ffc1057SHemant Agrawal */ 26382ffc1057SHemant Agrawal uint8_t *fm_port_get_buffer_icinfo(t_handle h_fm_port, char *p_data); 26392ffc1057SHemant Agrawal 26402ffc1057SHemant Agrawal /* 26412ffc1057SHemant Agrawal * @Function fm_port_get_buffer_prs_result 26422ffc1057SHemant Agrawal * 26432ffc1057SHemant Agrawal * @Description Returns the pointer to the parse result in the data buffer. 26442ffc1057SHemant Agrawal * In Rx ports this is relevant after reception, if parse result 26452ffc1057SHemant Agrawal * is configured to be part of the data passed to the 26462ffc1057SHemant Agrawal * application. For non Rx ports it may be used to get the 26472ffc1057SHemant Agrawal * pointer of the area in the buffer where parse result should be 26482ffc1057SHemant Agrawal * initialized - if so configured. 26492ffc1057SHemant Agrawal * See fm_port_config_buffer_prefix_content for data buffer 26502ffc1057SHemant Agrawal * prefix configuration. 26512ffc1057SHemant Agrawal * 26522ffc1057SHemant Agrawal * @Param[in] h_fm_port FM PORT module descriptor 26532ffc1057SHemant Agrawal * @Param[in] p_data A pointer to the data buffer. 26542ffc1057SHemant Agrawal * 26552ffc1057SHemant Agrawal * @Return Parse result pointer on success, NULL if parse result was not 26562ffc1057SHemant Agrawal * configured for this port. 26572ffc1057SHemant Agrawal * 26582ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 26592ffc1057SHemant Agrawal */ 26602ffc1057SHemant Agrawal t_fm_prs_result *fm_port_get_buffer_prs_result(t_handle h_fm_port, 26612ffc1057SHemant Agrawal char *p_data); 26622ffc1057SHemant Agrawal 26632ffc1057SHemant Agrawal /* 26642ffc1057SHemant Agrawal * @Function fm_port_get_buffer_time_stamp 26652ffc1057SHemant Agrawal * 26662ffc1057SHemant Agrawal * @Description Returns the time stamp in the data buffer. 26672ffc1057SHemant Agrawal * Relevant for Rx ports for getting the buffer time stamp. 26682ffc1057SHemant Agrawal * See fm_port_config_buffer_prefix_content for data buffer 26692ffc1057SHemant Agrawal * prefix configuration. 26702ffc1057SHemant Agrawal * 26712ffc1057SHemant Agrawal * @Param[in] h_fm_port FM PORT module descriptor 26722ffc1057SHemant Agrawal * @Param[in] p_data A pointer to the data buffer. 26732ffc1057SHemant Agrawal * 26742ffc1057SHemant Agrawal * @Return A pointer to the hash result on success, NULL otherwise. 26752ffc1057SHemant Agrawal * 26762ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 26772ffc1057SHemant Agrawal */ 26782ffc1057SHemant Agrawal uint64_t *fm_port_get_buffer_time_stamp(t_handle h_fm_port, char *p_data); 26792ffc1057SHemant Agrawal 26802ffc1057SHemant Agrawal /* 26812ffc1057SHemant Agrawal * @Function fm_port_get_buffer_hash_result 26822ffc1057SHemant Agrawal * 26832ffc1057SHemant Agrawal * @Description Given a data buffer, on the condition that hash result was 26842ffc1057SHemant Agrawal * defined as a part of the buffer content(see 26852ffc1057SHemant Agrawal * fm_port_config_buffer_prefix_content) this routine will return 26862ffc1057SHemant Agrawal * the pointer to the hash result location in the buffer prefix. 26872ffc1057SHemant Agrawal * 26882ffc1057SHemant Agrawal * @Param[in] h_fm_port FM PORT module descriptor 26892ffc1057SHemant Agrawal * @Param[in] p_data A pointer to the data buffer. 26902ffc1057SHemant Agrawal * 26912ffc1057SHemant Agrawal * @Return A pointer to the hash result on success, NULL otherwise. 26922ffc1057SHemant Agrawal * 26932ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 26942ffc1057SHemant Agrawal */ 26952ffc1057SHemant Agrawal uint8_t *fm_port_get_buffer_hash_result(t_handle h_fm_port, char *p_data); 26962ffc1057SHemant Agrawal 26972ffc1057SHemant Agrawal /* 26982ffc1057SHemant Agrawal * @Function fm_port_disable 26992ffc1057SHemant Agrawal * 27002ffc1057SHemant Agrawal * @Description Gracefully disable an FM port. The port will not start new 27012ffc1057SHemant Agrawal * tasks after all tasks associated with the port are terminated. 27022ffc1057SHemant Agrawal * 27032ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 27042ffc1057SHemant Agrawal * 27052ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 27062ffc1057SHemant Agrawal * 27072ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 27082ffc1057SHemant Agrawal * This is a blocking routine, it returns after port is 27092ffc1057SHemant Agrawal * gracefully stopped, i.e. the port will not except new frames, 27102ffc1057SHemant Agrawal * but it will finish all frames or tasks which were already 27112ffc1057SHemant Agrawal * began 27122ffc1057SHemant Agrawal */ 27132ffc1057SHemant Agrawal uint32_t fm_port_disable(t_handle h_fm_port); 27142ffc1057SHemant Agrawal 27152ffc1057SHemant Agrawal /* 27162ffc1057SHemant Agrawal * @Function fm_port_enable 27172ffc1057SHemant Agrawal * 27182ffc1057SHemant Agrawal * @Description A runtime routine provided to allow disable/enable of port. 27192ffc1057SHemant Agrawal * 27202ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 27212ffc1057SHemant Agrawal * 27222ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 27232ffc1057SHemant Agrawal * 27242ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 27252ffc1057SHemant Agrawal */ 27262ffc1057SHemant Agrawal uint32_t fm_port_enable(t_handle h_fm_port); 27272ffc1057SHemant Agrawal 27282ffc1057SHemant Agrawal /* 27292ffc1057SHemant Agrawal * @Function fm_port_set_rate_limit 27302ffc1057SHemant Agrawal * 27312ffc1057SHemant Agrawal * @Description Calling this routine enables rate limit algorithm. 27322ffc1057SHemant Agrawal * By default, this functionality is disabled. 27332ffc1057SHemant Agrawal * 27342ffc1057SHemant Agrawal * Note that rate - limit mechanism uses the FM time stamp. 27352ffc1057SHemant Agrawal * The selected rate limit specified here would be 27362ffc1057SHemant Agrawal * rounded DOWN to the nearest 16M. 27372ffc1057SHemant Agrawal * 27382ffc1057SHemant Agrawal * May be used for Tx and OP ports only 27392ffc1057SHemant Agrawal * 27402ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 27412ffc1057SHemant Agrawal * @Param[in] p_rate_limit A structure of rate limit parameters 27422ffc1057SHemant Agrawal * 27432ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 27442ffc1057SHemant Agrawal * 27452ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). If rate limit is set 27462ffc1057SHemant Agrawal * on a port that need to send PFC frames, it might violate the 27472ffc1057SHemant Agrawal * stop transmit timing. 27482ffc1057SHemant Agrawal */ 27492ffc1057SHemant Agrawal uint32_t fm_port_set_rate_limit(t_handle h_fm_port, 27502ffc1057SHemant Agrawal t_fm_port_rate_limit *p_rate_limit); 27512ffc1057SHemant Agrawal 27522ffc1057SHemant Agrawal /* 27532ffc1057SHemant Agrawal * @Function fm_port_delete_rate_limit 27542ffc1057SHemant Agrawal * 27552ffc1057SHemant Agrawal * @Description Calling this routine disables and clears rate limit 27562ffc1057SHemant Agrawal * initialization. 27572ffc1057SHemant Agrawal * 27582ffc1057SHemant Agrawal * May be used for Tx and OP ports only 27592ffc1057SHemant Agrawal * 27602ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 27612ffc1057SHemant Agrawal * 27622ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 27632ffc1057SHemant Agrawal * 27642ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 27652ffc1057SHemant Agrawal */ 27662ffc1057SHemant Agrawal uint32_t fm_port_delete_rate_limit(t_handle h_fm_port); 27672ffc1057SHemant Agrawal 27682ffc1057SHemant Agrawal /* 27692ffc1057SHemant Agrawal * @Function fm_port_set_pfc_priorities_mapping_to_qman_wq 27702ffc1057SHemant Agrawal 27712ffc1057SHemant Agrawal * @Description Calling this routine maps each PFC received priority to the 27722ffc1057SHemant Agrawal * transmit WQ. This WQ will be blocked upon receiving a PFC 27732ffc1057SHemant Agrawal * frame with this priority. 27742ffc1057SHemant Agrawal * 27752ffc1057SHemant Agrawal * May be used for Tx ports only. 27762ffc1057SHemant Agrawal * 27772ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 27782ffc1057SHemant Agrawal * @Param[in] prio PFC priority (0 - 7). 27792ffc1057SHemant Agrawal * @Param[in] wq Work Queue (0 - 7). 27802ffc1057SHemant Agrawal * 27812ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 27822ffc1057SHemant Agrawal * 27832ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 27842ffc1057SHemant Agrawal */ 27852ffc1057SHemant Agrawal uint32_t fm_port_set_pfc_priorities_mapping_to_qman_wq(t_handle h_fm_port, 27862ffc1057SHemant Agrawal uint8_t prio, uint8_t wq); 27872ffc1057SHemant Agrawal 27882ffc1057SHemant Agrawal /* 27892ffc1057SHemant Agrawal * @Function fm_port_set_statistics_counters 27902ffc1057SHemant Agrawal * 27912ffc1057SHemant Agrawal * @Description Calling this routine enables/disables port's statistics 27922ffc1057SHemant Agrawal * counters. By default, counters are enabled. 27932ffc1057SHemant Agrawal * 27942ffc1057SHemant Agrawal * May be used for all port types 27952ffc1057SHemant Agrawal * 27962ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 27972ffc1057SHemant Agrawal * @Param[in] enable TRUE to enable, FALSE to disable. 27982ffc1057SHemant Agrawal * 27992ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 28002ffc1057SHemant Agrawal * 28012ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 28022ffc1057SHemant Agrawal */ 28032ffc1057SHemant Agrawal uint32_t fm_port_set_statistics_counters(t_handle h_fm_port, bool enable); 28042ffc1057SHemant Agrawal 28052ffc1057SHemant Agrawal /* 28062ffc1057SHemant Agrawal * @Function fm_port_set_frame_queue_counters 28072ffc1057SHemant Agrawal * 28082ffc1057SHemant Agrawal * @Description Calling this routine enables/disables port's enqueue/dequeue 28092ffc1057SHemant Agrawal * counters. By default, counters are enabled. 28102ffc1057SHemant Agrawal * 28112ffc1057SHemant Agrawal * May be used for all ports 28122ffc1057SHemant Agrawal * 28132ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 28142ffc1057SHemant Agrawal * @Param[in] enable TRUE to enable, FALSE to disable. 28152ffc1057SHemant Agrawal * 28162ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 28172ffc1057SHemant Agrawal * 28182ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 28192ffc1057SHemant Agrawal */ 28202ffc1057SHemant Agrawal uint32_t fm_port_set_frame_queue_counters(t_handle h_fm_port, 28212ffc1057SHemant Agrawal bool enable); 28222ffc1057SHemant Agrawal 28232ffc1057SHemant Agrawal /* 28242ffc1057SHemant Agrawal * @Function fm_port_analyze_performance_params 28252ffc1057SHemant Agrawal * 28262ffc1057SHemant Agrawal * @Description User may call this routine to so the driver will analyze if 28272ffc1057SHemant Agrawal * the basic performance parameters are correct and also the 28282ffc1057SHemant Agrawal * driver may suggest of improvements; The basic parameters are 28292ffc1057SHemant Agrawal * FIFO sizes, number of DMAs and number of TNUMs for the port. 28302ffc1057SHemant Agrawal * 28312ffc1057SHemant Agrawal * May be used for all port types 28322ffc1057SHemant Agrawal * 28332ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 28342ffc1057SHemant Agrawal * 28352ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 28362ffc1057SHemant Agrawal * 28372ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 28382ffc1057SHemant Agrawal */ 28392ffc1057SHemant Agrawal uint32_t fm_port_analyze_performance_params(t_handle h_fm_port); 28402ffc1057SHemant Agrawal 28412ffc1057SHemant Agrawal /* 28422ffc1057SHemant Agrawal * @Function fm_port_set_alloc_buf_counter 28432ffc1057SHemant Agrawal * 28442ffc1057SHemant Agrawal * @Description Calling this routine enables/disables BM pool allocate 28452ffc1057SHemant Agrawal * buffer counters. 28462ffc1057SHemant Agrawal * By default, counters are enabled. 28472ffc1057SHemant Agrawal * 28482ffc1057SHemant Agrawal * May be used for Rx ports only 28492ffc1057SHemant Agrawal * 28502ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 28512ffc1057SHemant Agrawal * @Param[in] pool_id BM pool id. 28522ffc1057SHemant Agrawal * @Param[in] enable TRUE to enable, FALSE to disable. 28532ffc1057SHemant Agrawal * 28542ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 28552ffc1057SHemant Agrawal * 28562ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 28572ffc1057SHemant Agrawal */ 28582ffc1057SHemant Agrawal uint32_t fm_port_set_alloc_buf_counter(t_handle h_fm_port, 28592ffc1057SHemant Agrawal uint8_t pool_id, bool enable); 28602ffc1057SHemant Agrawal 28612ffc1057SHemant Agrawal /* 28622ffc1057SHemant Agrawal * @Function fm_port_get_bmi_counters 28632ffc1057SHemant Agrawal * 28642ffc1057SHemant Agrawal * @Description Read port's BMI stat counters and place them into 28652ffc1057SHemant Agrawal * a designated structure of counters. 28662ffc1057SHemant Agrawal * 28672ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 28682ffc1057SHemant Agrawal * @Param[out] p_bmi_stats counters structure 28692ffc1057SHemant Agrawal * 28702ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 28712ffc1057SHemant Agrawal * 28722ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 28732ffc1057SHemant Agrawal */ 28742ffc1057SHemant Agrawal uint32_t fm_port_get_bmi_counters(t_handle h_fm_port, 28752ffc1057SHemant Agrawal t_fm_port_bmi_stats *p_bmi_stats); 28762ffc1057SHemant Agrawal 28772ffc1057SHemant Agrawal /* 28782ffc1057SHemant Agrawal * @Function fm_port_get_counter 28792ffc1057SHemant Agrawal * 28802ffc1057SHemant Agrawal * @Description Reads one of the FM PORT counters. 28812ffc1057SHemant Agrawal * 28822ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 28832ffc1057SHemant Agrawal * @Param[in] fm_port_counter The requested counter. 28842ffc1057SHemant Agrawal * 28852ffc1057SHemant Agrawal * @Return Counter's current value. 28862ffc1057SHemant Agrawal * 28872ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 28882ffc1057SHemant Agrawal * Note that it is user's responsibility to call this routine 28892ffc1057SHemant Agrawal * only for enabled counters, and there will be no indication if 28902ffc1057SHemant Agrawal * a disabled counter is accessed. 28912ffc1057SHemant Agrawal */ 28922ffc1057SHemant Agrawal uint32_t fm_port_get_counter(t_handle h_fm_port, 28932ffc1057SHemant Agrawal e_fm_port_counters fm_port_counter); 28942ffc1057SHemant Agrawal 28952ffc1057SHemant Agrawal /* 28962ffc1057SHemant Agrawal * @Function fm_port_modify_counter 28972ffc1057SHemant Agrawal * 28982ffc1057SHemant Agrawal * @Description Sets a value to an enabled counter. Use "0" to reset the 28992ffc1057SHemant Agrawal * counter. 29002ffc1057SHemant Agrawal * 29012ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 29022ffc1057SHemant Agrawal * @Param[in] fm_port_counter The requested counter. 29032ffc1057SHemant Agrawal * @Param[in] value The requested value to be written into 29042ffc1057SHemant Agrawal * the counter. 29052ffc1057SHemant Agrawal * 29062ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 29072ffc1057SHemant Agrawal * 29082ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 29092ffc1057SHemant Agrawal */ 29102ffc1057SHemant Agrawal uint32_t fm_port_modify_counter(t_handle h_fm_port, 29112ffc1057SHemant Agrawal e_fm_port_counters fm_port_counter, uint32_t value); 29122ffc1057SHemant Agrawal 29132ffc1057SHemant Agrawal /* 29142ffc1057SHemant Agrawal * @Function fm_port_get_alloc_buf_counter 29152ffc1057SHemant Agrawal * 29162ffc1057SHemant Agrawal * @Description Reads one of the FM PORT buffer counters. 29172ffc1057SHemant Agrawal * 29182ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 29192ffc1057SHemant Agrawal * @Param[in] pool_id The requested pool. 29202ffc1057SHemant Agrawal * 29212ffc1057SHemant Agrawal * @Return Counter's current value. 29222ffc1057SHemant Agrawal * 29232ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 29242ffc1057SHemant Agrawal * Note that it is user's responsibility to call this routine 29252ffc1057SHemant Agrawal * only for enabled counters, and there will be no indication if 29262ffc1057SHemant Agrawal * a disabled counter is accessed. 29272ffc1057SHemant Agrawal */ 29282ffc1057SHemant Agrawal uint32_t fm_port_get_alloc_buf_counter(t_handle h_fm_port, 29292ffc1057SHemant Agrawal uint8_t pool_id); 29302ffc1057SHemant Agrawal 29312ffc1057SHemant Agrawal /* 29322ffc1057SHemant Agrawal * @Function fm_port_modify_alloc_buf_counter 29332ffc1057SHemant Agrawal * 29342ffc1057SHemant Agrawal * @Description Sets a value to an enabled counter. Use "0" to reset the 29352ffc1057SHemant Agrawal * counter. 29362ffc1057SHemant Agrawal * 29372ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 29382ffc1057SHemant Agrawal * @Param[in] pool_id The requested pool. 29392ffc1057SHemant Agrawal * @Param[in] value The requested value to be written into the 29402ffc1057SHemant Agrawal * counter. 29412ffc1057SHemant Agrawal * 29422ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 29432ffc1057SHemant Agrawal * 29442ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 29452ffc1057SHemant Agrawal */ 29462ffc1057SHemant Agrawal uint32_t fm_port_modify_alloc_buf_counter(t_handle h_fm_port, 29472ffc1057SHemant Agrawal uint8_t pool_id, uint32_t value); 29482ffc1057SHemant Agrawal 29492ffc1057SHemant Agrawal /* 29502ffc1057SHemant Agrawal * @Function fm_port_add_congestion_grps 29512ffc1057SHemant Agrawal * 29522ffc1057SHemant Agrawal * @Description This routine effects the corresponding Tx port. 29532ffc1057SHemant Agrawal * It should be called in order to enable pause 29542ffc1057SHemant Agrawal * frame transmission in case of congestion in one or more 29552ffc1057SHemant Agrawal * of the congestion groups relevant to this port. 29562ffc1057SHemant Agrawal * Each call to this routine may add one or more congestion 29572ffc1057SHemant Agrawal * groups to be considered relevant to this port. 29582ffc1057SHemant Agrawal * 29592ffc1057SHemant Agrawal * May be used for Rx, or RX + OP ports only (depending on chip) 29602ffc1057SHemant Agrawal * 29612ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 29622ffc1057SHemant Agrawal * @Param[in] p_congestion_grps A pointer to an array of congestion 29632ffc1057SHemant Agrawal * groups id's to consider. 29642ffc1057SHemant Agrawal * 29652ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 29662ffc1057SHemant Agrawal * 29672ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 29682ffc1057SHemant Agrawal */ 29692ffc1057SHemant Agrawal uint32_t fm_port_add_congestion_grps(t_handle h_fm_port, 29702ffc1057SHemant Agrawal t_fm_port_congestion_grps *p_congestion_grps); 29712ffc1057SHemant Agrawal 29722ffc1057SHemant Agrawal /* 29732ffc1057SHemant Agrawal * @Function fm_port_remove_congestion_grps 29742ffc1057SHemant Agrawal * 29752ffc1057SHemant Agrawal * @Description This routine effects the corresponding Tx port. It should be 29762ffc1057SHemant Agrawal * called when congestion groups were defined for this port and 29772ffc1057SHemant Agrawal * are no longer relevant, or pause frames transmitting is not 29782ffc1057SHemant Agrawal * required on their behalf. 29792ffc1057SHemant Agrawal * Each call to this routine may remove one or more congestion 29802ffc1057SHemant Agrawal * groups to be considered relevant to this port. 29812ffc1057SHemant Agrawal * 29822ffc1057SHemant Agrawal * May be used for Rx, or RX + OP ports only (depending on chip) 29832ffc1057SHemant Agrawal * 29842ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 29852ffc1057SHemant Agrawal * @Param[in] p_congestion_grps A pointer to an array of congestion 29862ffc1057SHemant Agrawal * groups id's to consider. 29872ffc1057SHemant Agrawal * 29882ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 29892ffc1057SHemant Agrawal * 29902ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 29912ffc1057SHemant Agrawal */ 29922ffc1057SHemant Agrawal uint32_t fm_port_remove_congestion_grps(t_handle h_fm_port, 29932ffc1057SHemant Agrawal t_fm_port_congestion_grps *p_congestion_grps); 29942ffc1057SHemant Agrawal 29952ffc1057SHemant Agrawal /* 29962ffc1057SHemant Agrawal * @Function fm_port_is_stalled 29972ffc1057SHemant Agrawal * 29982ffc1057SHemant Agrawal * @Description A routine for checking whether the specified port is stalled. 29992ffc1057SHemant Agrawal * 30002ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 30012ffc1057SHemant Agrawal * 30022ffc1057SHemant Agrawal * @Return TRUE if port is stalled, FALSE otherwise 30032ffc1057SHemant Agrawal * 30042ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 30052ffc1057SHemant Agrawal */ 30062ffc1057SHemant Agrawal bool fm_port_is_stalled(t_handle h_fm_port); 30072ffc1057SHemant Agrawal 30082ffc1057SHemant Agrawal /* 30092ffc1057SHemant Agrawal * @Function fm_port_release_stalled 30102ffc1057SHemant Agrawal * 30112ffc1057SHemant Agrawal * @Description This routine may be called in case the port was stalled and 30122ffc1057SHemant Agrawal * may now be released. 30132ffc1057SHemant Agrawal * Note that this routine is available only on older FMan 30142ffc1057SHemant Agrawal * revisions (FMan v2, DPAA v1.0 only). 30152ffc1057SHemant Agrawal * 30162ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 30172ffc1057SHemant Agrawal * 30182ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 30192ffc1057SHemant Agrawal * 30202ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 30212ffc1057SHemant Agrawal */ 30222ffc1057SHemant Agrawal uint32_t fm_port_release_stalled(t_handle h_fm_port); 30232ffc1057SHemant Agrawal 30242ffc1057SHemant Agrawal /* 30252ffc1057SHemant Agrawal * @Function fm_port_set_rx_l4checksum_verify 30262ffc1057SHemant Agrawal * 30272ffc1057SHemant Agrawal * @Description This routine is relevant for Rx ports (1G and 10G). The 30282ffc1057SHemant Agrawal * routine set / clear the L3 / L4 checksum verification (on RX 30292ffc1057SHemant Agrawal * side). Note that this takes affect only if hw - parser is 30302ffc1057SHemant Agrawal * enabled ! 30312ffc1057SHemant Agrawal * 30322ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 30332ffc1057SHemant Agrawal * @Param[in] l_4checksum boolean indicates whether to do L3/L4 checksum 30342ffc1057SHemant Agrawal * on frames or not. 30352ffc1057SHemant Agrawal * 30362ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 30372ffc1057SHemant Agrawal * 30382ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 30392ffc1057SHemant Agrawal */ 30402ffc1057SHemant Agrawal uint32_t fm_port_set_rx_l4checksum_verify(t_handle h_fm_port, 30412ffc1057SHemant Agrawal bool l_4checksum); 30422ffc1057SHemant Agrawal 30432ffc1057SHemant Agrawal /* 30442ffc1057SHemant Agrawal * @Function fm_port_set_errors_route 30452ffc1057SHemant Agrawal * 30462ffc1057SHemant Agrawal * @Description Errors selected for this routine will cause a frame with that 30472ffc1057SHemant Agrawal * error to be enqueued to error queue. 30482ffc1057SHemant Agrawal * Errors not selected for this routine will cause a frame with 30492ffc1057SHemant Agrawal * that error to be enqueued to the one of the other port queues. 30502ffc1057SHemant Agrawal * By default all errors are defined to be enqueued to error 30512ffc1057SHemant Agrawal * queue. Errors that were configured to be discarded(at 30522ffc1057SHemant Agrawal * initialization) may not be selected here. 30532ffc1057SHemant Agrawal * 30542ffc1057SHemant Agrawal * May be used for Rx and OP ports only 30552ffc1057SHemant Agrawal * 30562ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 30572ffc1057SHemant Agrawal * @Param[in] errs A list of errors to enqueue to error queue 30582ffc1057SHemant Agrawal * 30592ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 30602ffc1057SHemant Agrawal * 30612ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_config() and before 30622ffc1057SHemant Agrawal * fm_port_init(). 30632ffc1057SHemant Agrawal */ 30642ffc1057SHemant Agrawal uint32_t fm_port_set_errors_route(t_handle h_fm_port, 30652ffc1057SHemant Agrawal fm_port_frame_err_select_t errs); 30662ffc1057SHemant Agrawal 30672ffc1057SHemant Agrawal /* 30682ffc1057SHemant Agrawal * @Function fm_port_set_imexceptions 30692ffc1057SHemant Agrawal * 30702ffc1057SHemant Agrawal * @Description Calling this routine enables/disables FM PORT interrupts. 30712ffc1057SHemant Agrawal * 30722ffc1057SHemant Agrawal * @Param[in] h_fm_port FM PORT module descriptor. 30732ffc1057SHemant Agrawal * @Param[in] exception The exception to be selected. 30742ffc1057SHemant Agrawal * @Param[in] enable TRUE to enable interrupt, FALSE to mask it. 30752ffc1057SHemant Agrawal * 30762ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 30772ffc1057SHemant Agrawal * 30782ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 30792ffc1057SHemant Agrawal * This routine should NOT be called from guest-partition 30802ffc1057SHemant Agrawal * (i.e. guestId != NCSW_PRIMARY_ID) 30812ffc1057SHemant Agrawal */ 30822ffc1057SHemant Agrawal uint32_t fm_port_set_imexceptions(t_handle h_fm_port, 30832ffc1057SHemant Agrawal e_fm_port_exceptions exception, bool enable); 30842ffc1057SHemant Agrawal 30852ffc1057SHemant Agrawal /* 30862ffc1057SHemant Agrawal * @Function fm_port_set_performance_counters 30872ffc1057SHemant Agrawal * 30882ffc1057SHemant Agrawal * @Description Calling this routine enables/disables port's performance 30892ffc1057SHemant Agrawal * counters. By default, counters are enabled. 30902ffc1057SHemant Agrawal * 30912ffc1057SHemant Agrawal * May be used for all port types 30922ffc1057SHemant Agrawal * 30932ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 30942ffc1057SHemant Agrawal * @Param[in] enable TRUE to enable, FALSE to disable. 30952ffc1057SHemant Agrawal * 30962ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 30972ffc1057SHemant Agrawal * 30982ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 30992ffc1057SHemant Agrawal */ 31002ffc1057SHemant Agrawal uint32_t fm_port_set_performance_counters(t_handle h_fm_port, 31012ffc1057SHemant Agrawal bool enable); 31022ffc1057SHemant Agrawal 31032ffc1057SHemant Agrawal /* 31042ffc1057SHemant Agrawal * @Function fm_port_set_performance_counters_params 31052ffc1057SHemant Agrawal * 31062ffc1057SHemant Agrawal * @Description Calling this routine defines port's performance counters 31072ffc1057SHemant Agrawal * parameters. 31082ffc1057SHemant Agrawal * 31092ffc1057SHemant Agrawal * May be used for all port types 31102ffc1057SHemant Agrawal * 31112ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 31122ffc1057SHemant Agrawal * @Param[in] p_fm_port_performance_cnt A pointer to a structure of 31132ffc1057SHemant Agrawal * performance counters parameters. 31142ffc1057SHemant Agrawal * 31152ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 31162ffc1057SHemant Agrawal * 31172ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 31182ffc1057SHemant Agrawal */ 31192ffc1057SHemant Agrawal uint32_t fm_port_set_performance_counters_params(t_handle h_fm_port, 31202ffc1057SHemant Agrawal t_fm_port_performance_cnt *p_fm_port_performance_cnt); 31212ffc1057SHemant Agrawal 31222ffc1057SHemant Agrawal /* 31232ffc1057SHemant Agrawal * @Group FM_PORT_pcd_runtime_control_grp 31242ffc1057SHemant Agrawal * FM Port PCD Runtime Control Unit 31252ffc1057SHemant Agrawal * 31262ffc1057SHemant Agrawal * @Description FM Port PCD Runtime control unit API functions, definitions 31272ffc1057SHemant Agrawal * and enums. 31282ffc1057SHemant Agrawal * 31292ffc1057SHemant Agrawal * @Function fm_port_set_pcd 31302ffc1057SHemant Agrawal * 31312ffc1057SHemant Agrawal * @Description Calling this routine defines the port's PCD configuration. It 31322ffc1057SHemant Agrawal * changes it from its default configuration which is PCD 31332ffc1057SHemant Agrawal * disabled (BMI to BMI) and configures it according to the 31342ffc1057SHemant Agrawal * passed parameters. 31352ffc1057SHemant Agrawal * 31362ffc1057SHemant Agrawal * May be used for Rx and OP ports only 31372ffc1057SHemant Agrawal * 31382ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 31392ffc1057SHemant Agrawal * @Param[in] p_fm_port_pcd A Structure of parameters defining the port's 31402ffc1057SHemant Agrawal * PCD configuration. 31412ffc1057SHemant Agrawal * 31422ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 31432ffc1057SHemant Agrawal * 31442ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 31452ffc1057SHemant Agrawal */ 31462ffc1057SHemant Agrawal uint32_t fm_port_set_pcd(t_handle h_fm_port, 31472ffc1057SHemant Agrawal ioc_fm_port_pcd_params_t *p_fm_port_pcd); 31482ffc1057SHemant Agrawal 31492ffc1057SHemant Agrawal /* 31502ffc1057SHemant Agrawal * @Function fm_port_delete_pcd 31512ffc1057SHemant Agrawal * 31522ffc1057SHemant Agrawal * @Description Calling this routine releases the port's PCD configuration. 31532ffc1057SHemant Agrawal * The port returns to its default configuration which is PCD 31542ffc1057SHemant Agrawal * disabled (BMI to BMI) and all PCD configuration is removed. 31552ffc1057SHemant Agrawal * 31562ffc1057SHemant Agrawal * May be used for Rx and OP ports which are in PCD mode only 31572ffc1057SHemant Agrawal * 31582ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 31592ffc1057SHemant Agrawal * 31602ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 31612ffc1057SHemant Agrawal * 31622ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 31632ffc1057SHemant Agrawal */ 31642ffc1057SHemant Agrawal uint32_t fm_port_delete_pcd(t_handle h_fm_port); 31652ffc1057SHemant Agrawal 31662ffc1057SHemant Agrawal /* 31672ffc1057SHemant Agrawal * @Function fm_port_attach_pcd 31682ffc1057SHemant Agrawal * 31692ffc1057SHemant Agrawal * @Description This routine may be called after fm_port_detach_pcd was 31702ffc1057SHemant Agrawal * called, to return to the originally configured PCD support 31712ffc1057SHemant Agrawal * flow. The couple of routines are used to allow PCD 31722ffc1057SHemant Agrawal * configuration changes that demand that PCD will not be used 31732ffc1057SHemant Agrawal * while changes take place. 31742ffc1057SHemant Agrawal * 31752ffc1057SHemant Agrawal * May be used for Rx and OP ports which are in PCD mode only 31762ffc1057SHemant Agrawal * 31772ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 31782ffc1057SHemant Agrawal * 31792ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 31802ffc1057SHemant Agrawal * 31812ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(). 31822ffc1057SHemant Agrawal */ 31832ffc1057SHemant Agrawal uint32_t fm_port_attach_pcd(t_handle h_fm_port); 31842ffc1057SHemant Agrawal 31852ffc1057SHemant Agrawal /* 31862ffc1057SHemant Agrawal * @Function fm_port_detach_pcd 31872ffc1057SHemant Agrawal * 31882ffc1057SHemant Agrawal * @Description Calling this routine detaches the port from its PCD 31892ffc1057SHemant Agrawal * functionality. The port returns to its default flow which is 31902ffc1057SHemant Agrawal * BMI to BMI. 31912ffc1057SHemant Agrawal * 31922ffc1057SHemant Agrawal * May be used for Rx and OP ports which are in PCD mode only 31932ffc1057SHemant Agrawal * 31942ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 31952ffc1057SHemant Agrawal * 31962ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 31972ffc1057SHemant Agrawal * 31982ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_attach_pcd(). 31992ffc1057SHemant Agrawal */ 32002ffc1057SHemant Agrawal uint32_t fm_port_detach_pcd(t_handle h_fm_port); 32012ffc1057SHemant Agrawal 32022ffc1057SHemant Agrawal /* 32032ffc1057SHemant Agrawal * @Function fm_port_pcd_plcr_alloc_profiles 32042ffc1057SHemant Agrawal * 32052ffc1057SHemant Agrawal * @Description This routine may be called only for ports that use the Policer 32062ffc1057SHemant Agrawal * in order to allocate private policer profiles. 32072ffc1057SHemant Agrawal * 32082ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 32092ffc1057SHemant Agrawal * @Param[in] num_of_profiles The number of required policer profiles 32102ffc1057SHemant Agrawal * 32112ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 32122ffc1057SHemant Agrawal * 32132ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init() and fm_pcd_init(), and 32142ffc1057SHemant Agrawal * before fm_port_set_pcd(). 32152ffc1057SHemant Agrawal */ 32162ffc1057SHemant Agrawal uint32_t fm_port_pcd_plcr_alloc_profiles(t_handle h_fm_port, 32172ffc1057SHemant Agrawal uint16_t num_of_profiles); 32182ffc1057SHemant Agrawal 32192ffc1057SHemant Agrawal /* 32202ffc1057SHemant Agrawal * @Function fm_port_pcd_plcr_free_profiles 32212ffc1057SHemant Agrawal * 32222ffc1057SHemant Agrawal * @Description This routine should be called for freeing private policer 32232ffc1057SHemant Agrawal * profiles. 32242ffc1057SHemant Agrawal * 32252ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 32262ffc1057SHemant Agrawal * 32272ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 32282ffc1057SHemant Agrawal * 32292ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init() and fm_pcd_init(), and 32302ffc1057SHemant Agrawal * before fm_port_set_pcd(). 32312ffc1057SHemant Agrawal */ 32322ffc1057SHemant Agrawal uint32_t fm_port_pcd_plcr_free_profiles(t_handle h_fm_port); 32332ffc1057SHemant Agrawal 32342ffc1057SHemant Agrawal /* 32352ffc1057SHemant Agrawal * @Function fm_port_pcd_kg_modify_initial_scheme 32362ffc1057SHemant Agrawal * 32372ffc1057SHemant Agrawal * @Description This routine may be called only for ports that use the keygen 32382ffc1057SHemant Agrawal * in order to change the initial scheme frame should be routed 32392ffc1057SHemant Agrawal * to. The change may be of a scheme id(in case of direct mode), 32402ffc1057SHemant Agrawal * from direct to indirect, or from indirect to direct - 32412ffc1057SHemant Agrawal * specifying the scheme id. 32422ffc1057SHemant Agrawal * 32432ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 32442ffc1057SHemant Agrawal * @Param[in] p_fm_pcd_kg_scheme A structure of parameters for defining 32452ffc1057SHemant Agrawal * whether a scheme is direct / indirect, 32462ffc1057SHemant Agrawal * and if direct - scheme id. 32472ffc1057SHemant Agrawal * 32482ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 32492ffc1057SHemant Agrawal * 32502ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init() and fm_port_set_pcd(). 32512ffc1057SHemant Agrawal */ 32522ffc1057SHemant Agrawal uint32_t fm_port_pcd_kg_modify_initial_scheme(t_handle h_fm_port, 32532ffc1057SHemant Agrawal ioc_fm_pcd_kg_scheme_select_t *p_fm_pcd_kg_scheme); 32542ffc1057SHemant Agrawal 32552ffc1057SHemant Agrawal /* 32562ffc1057SHemant Agrawal * @Function fm_port_pcd_plcr_modify_initial_profile 32572ffc1057SHemant Agrawal * 32582ffc1057SHemant Agrawal * @Description This routine may be called for ports with flows 32592ffc1057SHemant Agrawal * e_FM_PORT_PCD_SUPPORT_PLCR_ONLY or 32602ffc1057SHemant Agrawal * e_FM_PORT_PCD_SUPPORT_PRS_AND_PLCR only, to change the initial 32612ffc1057SHemant Agrawal * Policer profile frame should be routed to. The change may be 32622ffc1057SHemant Agrawal * of a profile and / or absolute / direct mode selection. 32632ffc1057SHemant Agrawal * 32642ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 32652ffc1057SHemant Agrawal * @Param[in] h_profile Policer profile handle 32662ffc1057SHemant Agrawal * 32672ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 32682ffc1057SHemant Agrawal * 32692ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init() and fm_port_set_pcd(). 32702ffc1057SHemant Agrawal */ 32712ffc1057SHemant Agrawal uint32_t fm_port_pcd_plcr_modify_initial_profile(t_handle h_fm_port, 32722ffc1057SHemant Agrawal t_handle h_profile); 32732ffc1057SHemant Agrawal 32742ffc1057SHemant Agrawal /* 32752ffc1057SHemant Agrawal * @Function fm_port_pcd_cc_modify_tree 32762ffc1057SHemant Agrawal * 32772ffc1057SHemant Agrawal * @Description This routine may be called for ports that use coarse 32782ffc1057SHemant Agrawal * classification tree if the user wishes to replace the tree. 32792ffc1057SHemant Agrawal * The routine may not be called while port receives packets 32802ffc1057SHemant Agrawal * using the PCD functionalities, therefore port must be first 32812ffc1057SHemant Agrawal * detached from the PCD, only than the routine may be called, 32822ffc1057SHemant Agrawal * and than port be attached to PCD again. 32832ffc1057SHemant Agrawal * 32842ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 32852ffc1057SHemant Agrawal * @Param[in] h_cc_tree A CC tree that was already built. The tree id as 32862ffc1057SHemant Agrawal * returned from the BuildTree routine. 32872ffc1057SHemant Agrawal * 32882ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 32892ffc1057SHemant Agrawal * 32902ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init(), fm_port_set_pcd() and 32912ffc1057SHemant Agrawal * fm_port_detach_pcd() 32922ffc1057SHemant Agrawal */ 32932ffc1057SHemant Agrawal uint32_t fm_port_pcd_cc_modify_tree(t_handle h_fm_port, t_handle h_cc_tree); 32942ffc1057SHemant Agrawal 32952ffc1057SHemant Agrawal /* 32962ffc1057SHemant Agrawal * @Function fm_port_pcd_kg_bind_schemes 32972ffc1057SHemant Agrawal * 32982ffc1057SHemant Agrawal * @Description These routines may be called for adding more schemes for the 32992ffc1057SHemant Agrawal * port to be bound to. The selected schemes are not added, just 33002ffc1057SHemant Agrawal * this specific port starts using them. 33012ffc1057SHemant Agrawal * 33022ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 33032ffc1057SHemant Agrawal * @Param[in] p_port_scheme A structure defining the list of schemes 33042ffc1057SHemant Agrawal * to be added. 33052ffc1057SHemant Agrawal * 33062ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 33072ffc1057SHemant Agrawal * 33082ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init() and fm_port_set_pcd(). 33092ffc1057SHemant Agrawal */ 33102ffc1057SHemant Agrawal uint32_t fm_port_pcd_kg_bind_schemes(t_handle h_fm_port, 33112ffc1057SHemant Agrawal ioc_fm_pcd_port_schemes_params_t *p_port_scheme); 33122ffc1057SHemant Agrawal 33132ffc1057SHemant Agrawal /* 33142ffc1057SHemant Agrawal * @Function fm_port_pcd_kg_unbind_schemes 33152ffc1057SHemant Agrawal * 33162ffc1057SHemant Agrawal * @Description These routines may be called for adding more schemes for the 33172ffc1057SHemant Agrawal * port to be bound to. The selected schemes are not removed or 33182ffc1057SHemant Agrawal * invalidated, just this specific port stops using them. 33192ffc1057SHemant Agrawal * 33202ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 33212ffc1057SHemant Agrawal * @Param[in] p_port_scheme A structure defining the list of schemes 33222ffc1057SHemant Agrawal * to be added. 33232ffc1057SHemant Agrawal * 33242ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 33252ffc1057SHemant Agrawal * 33262ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init() and fm_port_set_pcd(). 33272ffc1057SHemant Agrawal */ 33282ffc1057SHemant Agrawal uint32_t fm_port_pcd_kg_unbind_schemes(t_handle h_fm_port, 33292ffc1057SHemant Agrawal ioc_fm_pcd_port_schemes_params_t *p_port_scheme); 33302ffc1057SHemant Agrawal 33312ffc1057SHemant Agrawal /* 33322ffc1057SHemant Agrawal * @Function fm_port_get_ipv_4options_count 33332ffc1057SHemant Agrawal * 33342ffc1057SHemant Agrawal * @Description TODO 33352ffc1057SHemant Agrawal * 33362ffc1057SHemant Agrawal * @Param[in] h_fm_port A handle to a FM Port module. 33372ffc1057SHemant Agrawal * @Param[out] p_ipv_4options_count will hold the counter value 33382ffc1057SHemant Agrawal * 33392ffc1057SHemant Agrawal * @Return E_OK on success; Error code otherwise. 33402ffc1057SHemant Agrawal * 33412ffc1057SHemant Agrawal * @Cautions Allowed only following fm_port_init() 33422ffc1057SHemant Agrawal */ 33432ffc1057SHemant Agrawal uint32_t fm_port_get_ipv_4options_count(t_handle h_fm_port, 33442ffc1057SHemant Agrawal uint32_t *p_ipv_4options_count); 33452ffc1057SHemant Agrawal 33462ffc1057SHemant Agrawal /** @} */ /* end of FM_PORT_pcd_runtime_control_grp group */ 33472ffc1057SHemant Agrawal /** @} */ /* end of FM_PORT_runtime_control_grp group */ 33482ffc1057SHemant Agrawal /** @} */ /* end of FM_PORT_grp group */ 33492ffc1057SHemant Agrawal /** @} */ /* end of FM_grp group */ 33502ffc1057SHemant Agrawal #endif /* __FM_PORT_EXT_H */ 3351