Path: blob/main/sys/contrib/ncsw/Peripherals/FM/Pcd/fm_pcd_ipc.h
48524 views
/*1* Copyright 2008-2012 Freescale Semiconductor Inc.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/313233/**************************************************************************//**34@File fm_pcd_ipc.h3536@Description FM PCD Inter-Partition prototypes, structures and definitions.37*//***************************************************************************/38#ifndef __FM_PCD_IPC_H39#define __FM_PCD_IPC_H4041#include "std_ext.h"424344/**************************************************************************//**45@Group FM_grp Frame Manager API4647@Description FM API functions, definitions and enums4849@{50*//***************************************************************************/515253#if defined(__MWERKS__) && !defined(__GNUC__)54#pragma pack(push,1)55#endif /* defined(__MWERKS__) && ... */5657/**************************************************************************//**58@Description Structure for getting a sw parser address according to a label59Fields commented 'IN' are passed by the port module to be used60by the FM module.61Fields commented 'OUT' will be filled by FM before returning to port.62*//***************************************************************************/63typedef _Packed struct t_FmPcdIpcSwPrsLable64{65uint32_t enumHdr; /**< IN. The existence of this header will invoke66the sw parser code. */67uint8_t indexPerHdr; /**< IN. Normally 0, if more than one sw parser68attachments for the same header, use this6970index to distinguish between them. */71} _PackedType t_FmPcdIpcSwPrsLable;7273/**************************************************************************//**74@Description Structure for port-PCD communication.75Fields commented 'IN' are passed by the port module to be used76by the FM module.77Fields commented 'OUT' will be filled by FM before returning to port.78Some fields are optional (depending on configuration) and79will be analized by the port and FM modules accordingly.80*//***************************************************************************/8182typedef struct t_FmPcdIpcKgSchemesParams83{84uint8_t guestId;85uint8_t numOfSchemes;86uint8_t schemesIds[FM_PCD_KG_NUM_OF_SCHEMES];87} _PackedType t_FmPcdIpcKgSchemesParams;8889typedef struct t_FmPcdIpcKgClsPlanParams90{91uint8_t guestId;92uint16_t numOfClsPlanEntries;93uint8_t clsPlanBase;94} _PackedType t_FmPcdIpcKgClsPlanParams;9596typedef _Packed struct t_FmPcdIpcPrsIncludePort97{98uint8_t hardwarePortId;99bool include;100} _PackedType t_FmPcdIpcPrsIncludePort;101102103#define FM_PCD_MAX_REPLY_SIZE 16104#define FM_PCD_MAX_MSG_SIZE 36105#define FM_PCD_MAX_REPLY_BODY_SIZE 36106107typedef _Packed struct {108uint32_t msgId;109uint8_t msgBody[FM_PCD_MAX_MSG_SIZE];110} _PackedType t_FmPcdIpcMsg;111112typedef _Packed struct t_FmPcdIpcReply {113uint32_t error;114uint8_t replyBody[FM_PCD_MAX_REPLY_BODY_SIZE];115} _PackedType t_FmPcdIpcReply;116117typedef _Packed struct t_FmIpcResourceAllocParams {118uint8_t guestId;119uint16_t base;120uint16_t num;121}_PackedType t_FmIpcResourceAllocParams;122123#if defined(__MWERKS__) && !defined(__GNUC__)124#pragma pack(pop)125#endif /* defined(__MWERKS__) && ... */126127128129/**************************************************************************//**130@Function FM_PCD_ALLOC_KG_SCHEMES131132@Description Used by FM PCD front-end in order to allocate KG resources133134@Param[in/out] t_FmPcdIpcKgAllocParams Pointer135*//***************************************************************************/136#define FM_PCD_ALLOC_KG_SCHEMES 3137138/**************************************************************************//**139@Function FM_PCD_FREE_KG_SCHEMES140141@Description Used by FM PCD front-end in order to Free KG resources142143@Param[in/out] t_FmPcdIpcKgSchemesParams Pointer144*//***************************************************************************/145#define FM_PCD_FREE_KG_SCHEMES 4146147/**************************************************************************//**148@Function FM_PCD_ALLOC_PROFILES149150@Description Used by FM PCD front-end in order to allocate Policer profiles151152@Param[in/out] t_FmIpcResourceAllocParams Pointer153*//***************************************************************************/154#define FM_PCD_ALLOC_PROFILES 5155156/**************************************************************************//**157@Function FM_PCD_FREE_PROFILES158159@Description Used by FM PCD front-end in order to Free Policer profiles160161@Param[in/out] t_FmIpcResourceAllocParams Pointer162*//***************************************************************************/163#define FM_PCD_FREE_PROFILES 6164165/**************************************************************************//**166@Function FM_PCD_SET_PORT_PROFILES167168@Description Used by FM PCD front-end in order to allocate Policer profiles169for specific port170171@Param[in/out] t_FmIpcResourceAllocParams Pointer172*//***************************************************************************/173#define FM_PCD_SET_PORT_PROFILES 7174175/**************************************************************************//**176@Function FM_PCD_CLEAR_PORT_PROFILES177178@Description Used by FM PCD front-end in order to allocate Policer profiles179for specific port180181@Param[in/out] t_FmIpcResourceAllocParams Pointer182*//***************************************************************************/183#define FM_PCD_CLEAR_PORT_PROFILES 8184185/**************************************************************************//**186@Function FM_PCD_GET_PHYS_MURAM_BASE187188@Description Used by FM PCD front-end in order to get MURAM base address189190@Param[in/out] t_FmPcdIcPhysAddr Pointer191*//***************************************************************************/192#define FM_PCD_GET_PHYS_MURAM_BASE 9193194/**************************************************************************//**195@Function FM_PCD_GET_SW_PRS_OFFSET196197@Description Used by FM front-end to get the SW parser offset of the start of198code relevant to a given label.199200@Param[in/out] t_FmPcdIpcSwPrsLable Pointer201*//***************************************************************************/202#define FM_PCD_GET_SW_PRS_OFFSET 10203204/**************************************************************************//**205@Function FM_PCD_MASTER_IS_ENABLED206207@Description Used by FM front-end in order to verify208PCD enablement.209210@Param[in] bool Pointer211*//***************************************************************************/212#define FM_PCD_MASTER_IS_ENABLED 15213214/**************************************************************************//**215@Function FM_PCD_GUEST_DISABLE216217@Description Used by FM front-end to inform back-end when218front-end PCD is disabled219220@Param[in] None221*//***************************************************************************/222#define FM_PCD_GUEST_DISABLE 16223224/**************************************************************************//**225@Function FM_PCD_FREE_KG_CLSPLAN226227@Description Used by FM PCD front-end in order to Free KG classification plan entries228229@Param[in/out] t_FmPcdIpcKgClsPlanParams Pointer230*//***************************************************************************/231#define FM_PCD_FREE_KG_CLSPLAN 22232233/**************************************************************************//**234@Function FM_PCD_ALLOC_KG_CLSPLAN235236@Description Used by FM PCD front-end in order to allocate KG classification plan entries237238@Param[in/out] t_FmPcdIpcKgClsPlanParams Pointer239*//***************************************************************************/240#define FM_PCD_ALLOC_KG_CLSPLAN 23241242/**************************************************************************//**243@Function FM_PCD_MASTER_IS_ALIVE244245@Description Used by FM front-end to check that back-end exists246247@Param[in] None248*//***************************************************************************/249#define FM_PCD_MASTER_IS_ALIVE 24250251/**************************************************************************//**252@Function FM_PCD_GET_COUNTER253254@Description Used by FM front-end to read PCD counters255256@Param[in/out] t_FmPcdIpcGetCounter Pointer257*//***************************************************************************/258#define FM_PCD_GET_COUNTER 25259260/**************************************************************************//**261@Function FM_PCD_PRS_INC_PORT_STATS262263@Description Used by FM front-end to set/clear statistics for port264265@Param[in/out] t_FmPcdIpcPrsIncludePort Pointer266*//***************************************************************************/267#define FM_PCD_PRS_INC_PORT_STATS 26268269#if (DPAA_VERSION >= 11)270/* TODO - doc */271#define FM_PCD_ALLOC_SP 27272#endif /* (DPAA_VERSION >= 11) */273274275/** @} */ /* end of FM_PCD_IPC_grp group */276/** @} */ /* end of FM_grp group */277278279#endif /* __FM_PCD_IPC_H */280281282