1 /* Copyright (c) 2008-2011 Freescale Semiconductor, Inc. 2 * All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * * Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 8 * * Redistributions in binary form must reproduce the above copyright 9 * notice, this list of conditions and the following disclaimer in the 10 * documentation and/or other materials provided with the distribution. 11 * * Neither the name of Freescale Semiconductor nor the 12 * names of its contributors may be used to endorse or promote products 13 * derived from this software without specific prior written permission. 14 * 15 * 16 * ALTERNATIVELY, this software may be distributed under the terms of the 17 * GNU General Public License ("GPL") as published by the Free Software 18 * Foundation, either version 2 of that License or (at your option) any 19 * later version. 20 * 21 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 22 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33 /**************************************************************************//** 34 @File fm_pcd_ipc.h 35 36 @Description FM PCD Inter-Partition prototypes, structures and definitions. 37 *//***************************************************************************/ 38 #ifndef __FM_PCD_IPC_H 39 #define __FM_PCD_IPC_H 40 41 #include "std_ext.h" 42 43 44 /**************************************************************************//** 45 @Group FM_grp Frame Manager API 46 47 @Description FM API functions, definitions and enums 48 49 @{ 50 *//***************************************************************************/ 51 52 53 #if defined(__MWERKS__) && !defined(__GNUC__) 54 #pragma pack(push,1) 55 #endif /* defined(__MWERKS__) && ... */ 56 #define MEM_MAP_START 57 58 /**************************************************************************//** 59 @Description Structure for getting a sw parser address according to a label 60 Fields commented 'IN' are passed by the port module to be used 61 by the FM module. 62 Fields commented 'OUT' will be filled by FM before returning to port. 63 *//***************************************************************************/ 64 typedef _Packed struct t_FmPcdIpcSwPrsLable 65 { 66 uint32_t enumHdr; /**< IN. The existance of this header will envoke 67 the sw parser code. */ 68 uint8_t indexPerHdr; /**< IN. Normally 0, if more than one sw parser 69 attachments for the same header, use this 70 71 index to distinguish between them. */ 72 } _PackedType t_FmPcdIpcSwPrsLable; 73 74 /**************************************************************************//** 75 @Description Structure for port-PCD communication. 76 Fields commented 'IN' are passed by the port module to be used 77 by the FM module. 78 Fields commented 'OUT' will be filled by FM before returning to port. 79 Some fields are optional (depending on configuration) and 80 will be analized by the port and FM modules accordingly. 81 *//***************************************************************************/ 82 typedef struct t_FmPcdIpcKgSchemesParams 83 { 84 uint8_t guestId; /**< IN */ 85 uint8_t numOfSchemes; /**< IN */ 86 uint8_t schemesIds[FM_PCD_KG_NUM_OF_SCHEMES]; /**< OUT */ 87 } _PackedType t_FmPcdIpcKgSchemesParams; 88 89 typedef struct t_FmPcdIpcKgClsPlanParams 90 { 91 uint8_t guestId; /**< IN */ 92 uint16_t numOfClsPlanEntries; /**< IN */ 93 uint8_t clsPlanBase; /**< IN in alloc only */ 94 } _PackedType t_FmPcdIpcKgClsPlanParams; 95 96 typedef _Packed struct t_FmPcdIpcPlcrAllocParams 97 { 98 uint16_t num; 99 uint8_t hardwarePortId; 100 uint16_t plcrProfilesBase; 101 } _PackedType t_FmPcdIpcPlcrAllocParams; 102 103 typedef _Packed struct t_FmPcdIpcSharedPlcrAllocParams 104 { 105 uint16_t num; /**< IN */ 106 //uint16_t profilesIds[FM_PCD_PLCR_NUM_ENTRIES]; /**< OUT */ 107 uint32_t sharedProfilesMask[8]; 108 } _PackedType t_FmPcdIpcSharedPlcrAllocParams; 109 110 typedef _Packed struct t_FmPcdIpcPrsIncludePort 111 { 112 uint8_t hardwarePortId; /* IN */ 113 bool include; /* IN */ 114 } _PackedType t_FmPcdIpcPrsIncludePort; 115 116 117 #define FM_PCD_MAX_REPLY_SIZE 16 118 #define FM_PCD_MAX_MSG_SIZE 36 119 #define FM_PCD_MAX_REPLY_BODY_SIZE 36 120 121 typedef _Packed struct 122 { 123 uint32_t msgId; 124 uint8_t msgBody[FM_PCD_MAX_MSG_SIZE]; 125 } _PackedType t_FmPcdIpcMsg; 126 127 typedef _Packed struct t_FmPcdIpcReply 128 { 129 uint32_t error; 130 uint8_t replyBody[FM_PCD_MAX_REPLY_BODY_SIZE]; 131 } _PackedType t_FmPcdIpcReply; 132 133 #define MEM_MAP_END 134 #if defined(__MWERKS__) && !defined(__GNUC__) 135 #pragma pack(pop) 136 #endif /* defined(__MWERKS__) && ... */ 137 138 139 140 /**************************************************************************//** 141 @Function FM_PCD_ALLOC_KG_SCHEMES 142 143 @Description Used by FM PCD front-end in order to allocate KG resources 144 145 @Param[in/out] t_FmPcdIpcKgAllocParams Pointer 146 *//***************************************************************************/ 147 #define FM_PCD_ALLOC_KG_SCHEMES 3 148 149 /**************************************************************************//** 150 @Function FM_PCD_FREE_KG_SCHEMES 151 152 @Description Used by FM PCD front-end in order to Free KG resources 153 154 @Param[in/out] t_FmPcdIpcKgSchemesParams Pointer 155 *//***************************************************************************/ 156 #define FM_PCD_FREE_KG_SCHEMES 4 157 158 /**************************************************************************//** 159 @Function FM_PCD_ALLOC_PROFILES 160 161 @Description Used by FM PCD front-end in order to allocate Policer profiles 162 163 @Param[in/out] t_FmPcdIpcKgSchemesParams Pointer 164 *//***************************************************************************/ 165 #define FM_PCD_ALLOC_PROFILES 5 166 167 /**************************************************************************//** 168 @Function FM_PCD_FREE_PROFILES 169 170 @Description Used by FM PCD front-end in order to Free Policer profiles 171 172 @Param[in/out] t_FmPcdIpcPlcrAllocParams Pointer 173 *//***************************************************************************/ 174 #define FM_PCD_FREE_PROFILES 6 175 176 /**************************************************************************//** 177 @Function FM_PCD_GET_PHYS_MURAM_BASE 178 179 @Description Used by FM PCD front-end in order to get MURAM base address 180 181 @Param[in/out] t_FmPcdIcPhysAddr Pointer 182 *//***************************************************************************/ 183 #define FM_PCD_GET_PHYS_MURAM_BASE 7 184 185 /**************************************************************************//** 186 @Function FM_PCD_GET_SW_PRS_OFFSET 187 188 @Description Used by FM front-end to get the SW parser offset of the start of 189 code relevant to a given label. 190 191 @Param[in/out] t_FmPcdIpcSwPrsLable Pointer 192 *//***************************************************************************/ 193 #define FM_PCD_GET_SW_PRS_OFFSET 8 194 195 /**************************************************************************//** 196 @Function FM_PCD_ALLOC_SHARED_PROFILES 197 198 @Description Used by FM PCD front-end in order to allocate shared profiles 199 200 @Param[in/out] t_FmPcdIpcSharedPlcrAllocParams Pointer 201 *//***************************************************************************/ 202 #define FM_PCD_ALLOC_SHARED_PROFILES 9 203 204 /**************************************************************************//** 205 @Function FM_PCD_FREE_SHARED_PROFILES 206 207 @Description Used by FM PCD front-end in order to free shared profiles 208 209 @Param[in/out] t_FmPcdIpcSharedPlcrAllocParams Pointer 210 *//***************************************************************************/ 211 #define FM_PCD_FREE_SHARED_PROFILES 10 212 213 /**************************************************************************//** 214 @Function FM_PCD_MASTER_IS_ENABLED 215 216 @Description Used by FM front-end in order to verify 217 PCD enablement. 218 219 @Param[in] bool Pointer 220 *//***************************************************************************/ 221 #define FM_PCD_MASTER_IS_ENABLED 15 222 223 /**************************************************************************//** 224 @Function FM_PCD_GUEST_DISABLE 225 226 @Description Used by FM front-end to inform back-end when 227 front-end PCD is disabled 228 229 @Param[in] None 230 *//***************************************************************************/ 231 #define FM_PCD_GUEST_DISABLE 16 232 233 /**************************************************************************//** 234 @Function FM_PCD_DUMP_REGS 235 236 @Description Used by FM front-end to dump all PCD registers 237 238 @Param[in] None 239 *//***************************************************************************/ 240 #define FM_PCD_DUMP_REGS 17 241 242 /**************************************************************************//** 243 @Function FM_PCD_KG_DUMP_REGS 244 245 @Description Used by FM front-end to dump KG registers 246 247 @Param[in] None 248 *//***************************************************************************/ 249 #define FM_PCD_KG_DUMP_REGS 18 250 251 /**************************************************************************//** 252 @Function FM_PCD_PLCR_DUMP_REGS 253 254 @Description Used by FM front-end to dump PLCR registers 255 256 @Param[in] None 257 *//***************************************************************************/ 258 #define FM_PCD_PLCR_DUMP_REGS 19 259 260 /**************************************************************************//** 261 @Function FM_PCD_PLCR_PROFILE_DUMP_REGS 262 263 @Description Used by FM front-end to dump PLCR specified profile registers 264 265 @Param[in] t_Handle Pointer 266 *//***************************************************************************/ 267 #define FM_PCD_PLCR_PROFILE_DUMP_REGS 20 268 269 /**************************************************************************//** 270 @Function FM_PCD_PRS_DUMP_REGS 271 272 @Description Used by FM front-end to dump PRS registers 273 274 @Param[in] None 275 *//***************************************************************************/ 276 #define FM_PCD_PRS_DUMP_REGS 21 277 278 /**************************************************************************//** 279 @Function FM_PCD_FREE_KG_CLSPLAN 280 281 @Description Used by FM PCD front-end in order to Free KG classification plan entries 282 283 @Param[in/out] t_FmPcdIpcKgClsPlanParams Pointer 284 *//***************************************************************************/ 285 #define FM_PCD_FREE_KG_CLSPLAN 22 286 287 /**************************************************************************//** 288 @Function FM_PCD_ALLOC_KG_CLSPLAN 289 290 @Description Used by FM PCD front-end in order to allocate KG classification plan entries 291 292 @Param[in/out] t_FmPcdIpcKgClsPlanParams Pointer 293 *//***************************************************************************/ 294 #define FM_PCD_ALLOC_KG_CLSPLAN 23 295 296 /**************************************************************************//** 297 @Function FM_PCD_MASTER_IS_ALIVE 298 299 @Description Used by FM front-end to check that back-end exists 300 301 @Param[in] None 302 *//***************************************************************************/ 303 #define FM_PCD_MASTER_IS_ALIVE 24 304 305 /**************************************************************************//** 306 @Function FM_PCD_GET_COUNTER 307 308 @Description Used by FM front-end to read PCD counters 309 310 @Param[in/out] t_FmPcdIpcGetCounter Pointer 311 *//***************************************************************************/ 312 #define FM_PCD_GET_COUNTER 25 313 314 /**************************************************************************//** 315 @Function FM_PCD_PRS_INC_PORT_STATS 316 317 @Description Used by FM front-end to set/clear statistics for port 318 319 @Param[in/out] t_FmPcdIpcPrsIncludePort Pointer 320 *//***************************************************************************/ 321 #define FM_PCD_PRS_INC_PORT_STATS 26 322 /** @} */ /* end of FM_PCD_IPC_grp group */ 323 /** @} */ /* end of FM_grp group */ 324 325 326 #endif /* __FM_PCD_IPC_H */ 327