1 /* 2 * Copyright 2008-2012 Freescale Semiconductor Inc. 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 /****************************************************************************** 35 @File fm_manip.h 36 37 @Description FM PCD manip... 38 *//***************************************************************************/ 39 #ifndef __FM_MANIP_H 40 #define __FM_MANIP_H 41 42 #include "std_ext.h" 43 #include "error_ext.h" 44 #include "list_ext.h" 45 46 #include "fm_cc.h" 47 48 49 /***********************************************************************/ 50 /* Header manipulations defines */ 51 /***********************************************************************/ 52 53 #define NUM_OF_SCRATCH_POOL_BUFFERS 1000 /*TODO - Change it!!*/ 54 55 #if (defined(FM_CAPWAP_SUPPORT) && (DPAA_VERSION == 10)) 56 #define HMAN_OC_RMV_N_OR_INSRT_INT_FRM_HDR 0x2e 57 #define HMAN_OC_INSRT_HDR_BY_TEMPL_N_OR_FRAG_AFTER 0x31 58 #define HMAN_OC_MV_INT_FRAME_HDR_FROM_FRM_TO_BUFFER_PREFFIX 0x2f 59 #define HMAN_OC_CAPWAP_RMV_DTLS_IF_EXIST 0x30 60 #define HMAN_OC_CAPWAP_REASSEMBLY 0x11 /* dummy */ 61 #define HMAN_OC_CAPWAP_INDEXED_STATS 0x32 /* dummy */ 62 #define HMAN_OC_CAPWAP_FRAGMENTATION 0x33 63 #else 64 #define HMAN_OC_CAPWAP_MANIP 0x2F 65 #define HMAN_OC_CAPWAP_FRAG_CHECK 0x2E 66 #define HMAN_OC_CAPWAP_FRAGMENTATION 0x33 67 #define HMAN_OC_CAPWAP_REASSEMBLY 0x30 68 #endif /* (defined(FM_CAPWAP_SUPPORT) && (DPAA_VERSION == 10)) */ 69 #define HMAN_OC_IP_MANIP 0x34 70 #define HMAN_OC_IP_FRAGMENTATION 0x74 71 #define HMAN_OC_IP_REASSEMBLY 0xB4 72 #define HMAN_OC_IPSEC_MANIP 0xF4 73 #define HMAN_OC 0x35 74 75 #if (defined(FM_CAPWAP_SUPPORT) && (DPAA_VERSION == 10)) 76 #define HMAN_RMV_HDR 0x80000000 77 #define HMAN_INSRT_INT_FRM_HDR 0x40000000 78 79 #define UDP_CHECKSUM_FIELD_OFFSET_FROM_UDP 6 80 #define UDP_CHECKSUM_FIELD_SIZE 2 81 #define UDP_LENGTH_FIELD_OFFSET_FROM_UDP 4 82 83 #define IPv4_DSCECN_FIELD_OFFSET_FROM_IP 1 84 #define IPv4_TOTALLENGTH_FIELD_OFFSET_FROM_IP 2 85 #define IPv4_HDRCHECKSUM_FIELD_OFFSET_FROM_IP 10 86 #define VLAN_TAG_FIELD_OFFSET_FROM_ETH 12 87 #define IPv4_ID_FIELD_OFFSET_FROM_IP 4 88 89 #define IPv6_PAYLOAD_LENGTH_OFFSET_FROM_IP 4 90 #define IPv6_NEXT_HEADER_OFFSET_FROM_IP 6 91 92 #define FM_PCD_MANIP_CAPWAP_REASM_TABLE_SIZE 0x80 93 #define FM_PCD_MANIP_CAPWAP_REASM_TABLE_ALIGN 8 94 #define FM_PCD_MANIP_CAPWAP_REASM_RFD_SIZE 32 95 #define FM_PCD_MANIP_CAPWAP_REASM_AUTO_LEARNING_HASH_ENTRY_SIZE 4 96 #define FM_PCD_MANIP_CAPWAP_REASM_TIME_OUT_ENTRY_SIZE 8 97 98 99 #define FM_PCD_MANIP_CAPWAP_REASM_TIME_OUT_BETWEEN_FRAMES 0x40000000 100 #define FM_PCD_MANIP_CAPWAP_REASM_HALT_ON_DUPLICATE_FRAG 0x10000000 101 #define FM_PCD_MANIP_CAPWAP_REASM_AUTOMATIC_LEARNIN_HASH_8_WAYS 0x08000000 102 #define FM_PCD_MANIP_CAPWAP_REASM_PR_COPY 0x00800000 103 104 #define FM_PCD_MANIP_CAPWAP_FRAG_COMPR_OPTION_FIELD_EN 0x80000000 105 106 #define FM_PCD_MANIP_INDEXED_STATS_ENTRY_SIZE 4 107 #define FM_PCD_MANIP_INDEXED_STATS_CNIA 0x20000000 108 #define FM_PCD_MANIP_INDEXED_STATS_DPD 0x10000000 109 #endif /* (defined(FM_CAPWAP_SUPPORT) && (DPAA_VERSION == 10)) */ 110 111 #if (DPAA_VERSION >= 11) 112 #define FM_PCD_MANIP_CAPWAP_DTLS 0x00040000 113 #define FM_PCD_MANIP_CAPWAP_NADEN 0x20000000 114 115 #define FM_PCD_MANIP_CAPWAP_FRAG_CHECK_MTU_SHIFT 16 116 #define FM_PCD_MANIP_CAPWAP_FRAG_CHECK_NO_FRAGMENTATION 0xFFFF0000 117 #define FM_PCD_MANIP_CAPWAP_FRAG_CHECK_CNIA 0x20000000 118 119 #define FM_PCD_MANIP_CAPWAP_FRAG_COMPRESS_EN 0x04000000 120 #define FM_PCD_MANIP_CAPWAP_FRAG_SCRATCH_BPID 24 121 #define FM_PCD_MANIP_CAPWAP_FRAG_SG_BDID_EN 0x08000000 122 #define FM_PCD_MANIP_CAPWAP_FRAG_SG_BDID_MASK 0xFF000000 123 #define FM_PCD_MANIP_CAPWAP_FRAG_SG_BDID_SHIFT 24 124 #endif /* (DPAA_VERSION >= 11) */ 125 126 #define FM_PCD_MANIP_REASM_TABLE_SIZE 0x40 127 #define FM_PCD_MANIP_REASM_TABLE_ALIGN 8 128 129 #define FM_PCD_MANIP_REASM_COMMON_PARAM_TABLE_SIZE 64 130 #define FM_PCD_MANIP_REASM_COMMON_PARAM_TABLE_ALIGN 8 131 #define FM_PCD_MANIP_REASM_TIME_OUT_BETWEEN_FRAMES 0x80000000 132 #define FM_PCD_MANIP_REASM_COUPLING_ENABLE 0x40000000 133 #define FM_PCD_MANIP_REASM_COUPLING_MASK 0xFF000000 134 #define FM_PCD_MANIP_REASM_COUPLING_SHIFT 24 135 #define FM_PCD_MANIP_REASM_LIODN_MASK 0x0000003F 136 #define FM_PCD_MANIP_REASM_LIODN_SHIFT 56 137 #define FM_PCD_MANIP_REASM_ELIODN_MASK 0x000003c0 138 #define FM_PCD_MANIP_REASM_ELIODN_SHIFT 38 139 #define FM_PCD_MANIP_REASM_COMMON_INT_BUFFER_IDX_MASK 0x000000FF 140 #define FM_PCD_MANIP_REASM_COMMON_INT_BUFFER_IDX_SHIFT 24 141 #define FM_PCD_MANIP_REASM_TIMEOUT_THREAD_THRESH 1024 142 143 #define FM_PCD_MANIP_IP_MTU_SHIFT 16 144 #define FM_PCD_MANIP_IP_NO_FRAGMENTATION 0xFFFF0000 145 #define FM_PCD_MANIP_IP_CNIA 0x20000000 146 147 #define FM_PCD_MANIP_IP_FRAG_DF_SHIFT 28 148 #define FM_PCD_MANIP_IP_FRAG_SCRATCH_BPID 24 149 #define FM_PCD_MANIP_IP_FRAG_SG_BDID_EN 0x08000000 150 #define FM_PCD_MANIP_IP_FRAG_SG_BDID_MASK 0xFF000000 151 #define FM_PCD_MANIP_IP_FRAG_SG_BDID_SHIFT 24 152 153 #define FM_PCD_MANIP_IPSEC_DEC 0x10000000 154 #define FM_PCD_MANIP_IPSEC_VIPV_EN 0x08000000 155 #define FM_PCD_MANIP_IPSEC_ECN_EN 0x04000000 156 #define FM_PCD_MANIP_IPSEC_DSCP_EN 0x02000000 157 #define FM_PCD_MANIP_IPSEC_VIPL_EN 0x01000000 158 #define FM_PCD_MANIP_IPSEC_NADEN 0x20000000 159 160 #define FM_PCD_MANIP_IPSEC_IP_HDR_LEN_MASK 0x00FF0000 161 #define FM_PCD_MANIP_IPSEC_IP_HDR_LEN_SHIFT 16 162 163 #define FM_PCD_MANIP_IPSEC_ARW_SIZE_MASK 0xFFFF0000 164 #define FM_PCD_MANIP_IPSEC_ARW_SIZE_SHIFT 16 165 166 #define e_FM_MANIP_IP_INDX 1 167 168 #define HMCD_OPCODE_GENERIC_RMV 0x01 169 #define HMCD_OPCODE_GENERIC_INSRT 0x02 170 #define HMCD_OPCODE_GENERIC_REPLACE 0x05 171 #define HMCD_OPCODE_L2_RMV 0x08 172 #define HMCD_OPCODE_L2_INSRT 0x09 173 #define HMCD_OPCODE_VLAN_PRI_UPDATE 0x0B 174 #define HMCD_OPCODE_IPV4_UPDATE 0x0C 175 #define HMCD_OPCODE_IPV6_UPDATE 0x10 176 #define HMCD_OPCODE_TCP_UDP_UPDATE 0x0E 177 #define HMCD_OPCODE_TCP_UDP_CHECKSUM 0x14 178 #define HMCD_OPCODE_REPLACE_IP 0x12 179 #define HMCD_OPCODE_RMV_TILL 0x15 180 #define HMCD_OPCODE_UDP_INSRT 0x16 181 #define HMCD_OPCODE_IP_INSRT 0x17 182 #define HMCD_OPCODE_CAPWAP_RMV 0x18 183 #define HMCD_OPCODE_CAPWAP_INSRT 0x18 184 #define HMCD_OPCODE_GEN_FIELD_REPLACE 0x19 185 186 #define HMCD_LAST 0x00800000 187 188 #define HMCD_DSCP_VALUES 64 189 190 #define HMCD_BASIC_SIZE 4 191 #define HMCD_PTR_SIZE 4 192 #define HMCD_PARAM_SIZE 4 193 #define HMCD_IPV4_ADDR_SIZE 4 194 #define HMCD_IPV6_ADDR_SIZE 0x10 195 #define HMCD_L4_HDR_SIZE 8 196 197 #define HMCD_CAPWAP_INSRT 0x00010000 198 #define HMCD_INSRT_UDP_LITE 0x00010000 199 #define HMCD_IP_ID_MASK 0x0000FFFF 200 #define HMCD_IP_SIZE_MASK 0x0000FF00 201 #define HMCD_IP_SIZE_SHIFT 8 202 #define HMCD_IP_LAST_PID_MASK 0x000000FF 203 #define HMCD_IP_OR_QOS 0x00010000 204 #define HMCD_IP_L4_CS_CALC 0x00040000 205 #define HMCD_IP_DF_MODE 0x00400000 206 207 208 #define HMCD_OC_SHIFT 24 209 210 #define HMCD_RMV_OFFSET_SHIFT 0 211 #define HMCD_RMV_SIZE_SHIFT 8 212 213 #define HMCD_INSRT_OFFSET_SHIFT 0 214 #define HMCD_INSRT_SIZE_SHIFT 8 215 216 #define HMTD_CFG_TYPE 0x4000 217 #define HMTD_CFG_EXT_HMCT 0x0080 218 #define HMTD_CFG_PRS_AFTER_HM 0x0040 219 #define HMTD_CFG_NEXT_AD_EN 0x0020 220 221 #define HMCD_RMV_L2_ETHERNET 0 222 #define HMCD_RMV_L2_STACKED_QTAGS 1 223 #define HMCD_RMV_L2_ETHERNET_AND_MPLS 2 224 #define HMCD_RMV_L2_MPLS 3 225 #define HMCD_RMV_L2_PPPOE 4 226 227 #define HMCD_INSRT_L2_MPLS 0 228 #define HMCD_INSRT_N_UPDATE_L2_MPLS 1 229 #define HMCD_INSRT_L2_PPPOE 2 230 #define HMCD_INSRT_L2_SIZE_SHIFT 24 231 232 #define HMCD_L2_MODE_SHIFT 16 233 234 #define HMCD_VLAN_PRI_REP_MODE_SHIFT 16 235 #define HMCD_VLAN_PRI_UPDATE 0 236 #define HMCD_VLAN_PRI_UPDATE_DSCP_TO_VPRI 1 237 238 #define HMCD_IPV4_UPDATE_TTL 0x00000001 239 #define HMCD_IPV4_UPDATE_TOS 0x00000002 240 #define HMCD_IPV4_UPDATE_DST 0x00000020 241 #define HMCD_IPV4_UPDATE_SRC 0x00000040 242 #define HMCD_IPV4_UPDATE_ID 0x00000080 243 #define HMCD_IPV4_UPDATE_TOS_SHIFT 8 244 245 #define HMCD_IPV6_UPDATE_HL 0x00000001 246 #define HMCD_IPV6_UPDATE_TC 0x00000002 247 #define HMCD_IPV6_UPDATE_DST 0x00000040 248 #define HMCD_IPV6_UPDATE_SRC 0x00000080 249 #define HMCD_IPV6_UPDATE_TC_SHIFT 8 250 251 #define HMCD_TCP_UDP_UPDATE_DST 0x00004000 252 #define HMCD_TCP_UDP_UPDATE_SRC 0x00008000 253 #define HMCD_TCP_UDP_UPDATE_SRC_SHIFT 16 254 255 #define HMCD_IP_REPLACE_REPLACE_IPV4 0x00000000 256 #define HMCD_IP_REPLACE_REPLACE_IPV6 0x00010000 257 #define HMCD_IP_REPLACE_TTL_HL 0x00200000 258 #define HMCD_IP_REPLACE_ID 0x00400000 259 260 #define HMCD_IP_REPLACE_L3HDRSIZE_SHIFT 24 261 262 #define HMCD_GEN_FIELD_SIZE_SHIFT 16 263 #define HMCD_GEN_FIELD_SRC_OFF_SHIFT 8 264 #define HMCD_GEN_FIELD_DST_OFF_SHIFT 0 265 #define HMCD_GEN_FIELD_MASK_EN 0x00400000 266 267 #define HMCD_GEN_FIELD_MASK_OFF_SHIFT 16 268 #define HMCD_GEN_FIELD_MASK_SHIFT 24 269 270 #define DSCP_TO_VLAN_TABLE_SIZE 32 271 272 #define MANIP_GET_HMCT_SIZE(h_Manip) (((t_FmPcdManip *)h_Manip)->tableSize) 273 #define MANIP_GET_DATA_SIZE(h_Manip) (((t_FmPcdManip *)h_Manip)->dataSize) 274 275 #define MANIP_GET_HMCT_PTR(h_Manip) (((t_FmPcdManip *)h_Manip)->p_Hmct) 276 #define MANIP_GET_DATA_PTR(h_Manip) (((t_FmPcdManip *)h_Manip)->p_Data) 277 278 #define MANIP_SET_HMCT_PTR(h_Manip, h_NewPtr) (((t_FmPcdManip *)h_Manip)->p_Hmct = h_NewPtr) 279 #define MANIP_SET_DATA_PTR(h_Manip, h_NewPtr) (((t_FmPcdManip *)h_Manip)->p_Data = h_NewPtr) 280 281 #define MANIP_GET_HMTD_PTR(h_Manip) (((t_FmPcdManip *)h_Manip)->h_Ad) 282 #define MANIP_DONT_REPARSE(h_Manip) (((t_FmPcdManip *)h_Manip)->dontParseAfterManip) 283 #define MANIP_SET_PREV(h_Manip, h_Prev) (((t_FmPcdManip *)h_Manip)->h_PrevManip = h_Prev) 284 #define MANIP_GET_OWNERS(h_Manip) (((t_FmPcdManip *)h_Manip)->owner) 285 #define MANIP_GET_TYPE(h_Manip) (((t_FmPcdManip *)h_Manip)->type) 286 #define MANIP_SET_UNIFIED_TBL_PTR_INDICATION(h_Manip) (((t_FmPcdManip *)h_Manip)->unifiedTablePtr = TRUE) 287 #define MANIP_GET_MURAM(h_Manip) (((t_FmPcd *)((t_FmPcdManip *)h_Manip)->h_FmPcd)->h_FmMuram) 288 #define MANIP_FREE_HMTD(h_Manip) \ 289 {if (((t_FmPcdManip *)h_Manip)->muramAllocate) \ 290 FM_MURAM_FreeMem(((t_FmPcd *)((t_FmPcdManip *)h_Manip)->h_FmPcd)->h_FmMuram, ((t_FmPcdManip *)h_Manip)->h_Ad);\ 291 else \ 292 XX_Free(((t_FmPcdManip *)h_Manip)->h_Ad); \ 293 ((t_FmPcdManip *)h_Manip)->h_Ad = NULL; \ 294 } 295 /* position regarding Manip SW structure */ 296 #define MANIP_IS_FIRST(h_Manip) (!(((t_FmPcdManip *)h_Manip)->h_PrevManip)) 297 #define MANIP_IS_CASCADED(h_Manip) (((t_FmPcdManip *)h_Manip)->cascaded) 298 #define MANIP_IS_UNIFIED(h_Manip) (!(((t_FmPcdManip *)h_Manip)->unifiedPosition == e_MANIP_UNIFIED_NONE)) 299 #define MANIP_IS_UNIFIED_NON_FIRST(h_Manip) ((((t_FmPcdManip *)h_Manip)->unifiedPosition == e_MANIP_UNIFIED_MID) || \ 300 (((t_FmPcdManip *)h_Manip)->unifiedPosition == e_MANIP_UNIFIED_LAST)) 301 #define MANIP_IS_UNIFIED_NON_LAST(h_Manip) ((((t_FmPcdManip *)h_Manip)->unifiedPosition == e_MANIP_UNIFIED_FIRST) ||\ 302 (((t_FmPcdManip *)h_Manip)->unifiedPosition == e_MANIP_UNIFIED_MID)) 303 #define MANIP_IS_UNIFIED_FIRST(h_Manip) (((t_FmPcdManip *)h_Manip)->unifiedPosition == e_MANIP_UNIFIED_FIRST) 304 #define MANIP_IS_UNIFIED_LAST(h_Manip) (((t_FmPcdManip *)h_Manip)->unifiedPosition == e_MANIP_UNIFIED_LAST) 305 306 #define MANIP_UPDATE_UNIFIED_POSITION(h_Manip) (((t_FmPcdManip *)h_Manip)->unifiedPosition = \ 307 (((t_FmPcdManip *)h_Manip)->unifiedPosition == e_MANIP_UNIFIED_NONE)? \ 308 e_MANIP_UNIFIED_LAST : e_MANIP_UNIFIED_MID) 309 310 typedef enum e_ManipUnifiedPosition { 311 e_MANIP_UNIFIED_NONE = 0, 312 e_MANIP_UNIFIED_FIRST, 313 e_MANIP_UNIFIED_MID, 314 e_MANIP_UNIFIED_LAST 315 } e_ManipUnifiedPosition; 316 317 typedef enum e_ManipInfo { 318 e_MANIP_HMTD, 319 e_MANIP_HMCT, 320 e_MANIP_HANDLER_TABLE_OWNER 321 }e_ManipInfo; 322 /***********************************************************************/ 323 /* Memory map */ 324 /***********************************************************************/ 325 #if defined(__MWERKS__) && !defined(__GNUC__) 326 #pragma pack(push,1) 327 #endif /* defined(__MWERKS__) && ... */ 328 329 #if (defined(FM_CAPWAP_SUPPORT) && (DPAA_VERSION == 10)) 330 typedef struct t_CapwapReasmPram { 331 volatile uint32_t mode; 332 volatile uint32_t autoLearnHashTblPtr; 333 volatile uint32_t intStatsTblPtr; 334 volatile uint32_t reasmFrmDescPoolTblPtr; 335 volatile uint32_t reasmFrmDescIndexPoolTblPtr; 336 volatile uint32_t timeOutTblPtr; 337 volatile uint32_t bufferPoolIdAndRisc1SetIndexes; 338 volatile uint32_t risc23SetIndexes; 339 volatile uint32_t risc4SetIndexesAndExtendedStatsTblPtr; 340 volatile uint32_t extendedStatsTblPtr; 341 volatile uint32_t expirationDelay; 342 volatile uint32_t totalProcessedFragCounter; 343 volatile uint32_t totalUnsuccessfulReasmFramesCounter; 344 volatile uint32_t totalDuplicatedFragCounter; 345 volatile uint32_t totalMalformdFragCounter; 346 volatile uint32_t totalTimeOutCounter; 347 volatile uint32_t totalSetBusyCounter; 348 volatile uint32_t totalRfdPoolBusyCounter; 349 volatile uint32_t totalDiscardedFragsCounter; 350 volatile uint32_t totalMoreThan16FramesCounter; 351 volatile uint32_t internalBufferBusy; 352 volatile uint32_t externalBufferBusy; 353 volatile uint32_t reserved1[4]; 354 } t_CapwapReasmPram; 355 #endif /* (defined(FM_CAPWAP_SUPPORT) && (DPAA_VERSION == 10)) */ 356 357 typedef _Packed struct t_ReassTbl { 358 volatile uint16_t waysNumAndSetSize; 359 volatile uint16_t autoLearnHashKeyMask; 360 volatile uint32_t reassCommonPrmTblPtr; 361 volatile uint32_t liodnAlAndAutoLearnHashTblPtrHi; 362 volatile uint32_t autoLearnHashTblPtrLow; 363 volatile uint32_t liodnSlAndAutoLearnSetLockTblPtrHi; 364 volatile uint32_t autoLearnSetLockTblPtrLow; 365 volatile uint16_t minFragSize; /* Not relevant for CAPWAP*/ 366 volatile uint16_t maxReassemblySize; /* Only relevant for CAPWAP*/ 367 volatile uint32_t totalSuccessfullyReasmFramesCounter; 368 volatile uint32_t totalValidFragmentCounter; 369 volatile uint32_t totalProcessedFragCounter; 370 volatile uint32_t totalMalformdFragCounter; 371 volatile uint32_t totalSetBusyCounter; 372 volatile uint32_t totalDiscardedFragsCounter; 373 volatile uint32_t totalMoreThan16FramesCounter; 374 volatile uint32_t reserved2[2]; 375 } _PackedType t_ReassTbl; 376 377 typedef struct t_ReassCommonTbl { 378 volatile uint32_t timeoutModeAndFqid; 379 volatile uint32_t reassFrmDescIndexPoolTblPtr; 380 volatile uint32_t liodnAndReassFrmDescPoolPtrHi; 381 volatile uint32_t reassFrmDescPoolPtrLow; 382 volatile uint32_t timeOutTblPtr; 383 volatile uint32_t expirationDelay; 384 volatile uint32_t internalBufferManagement; 385 volatile uint32_t reserved2; 386 volatile uint32_t totalTimeOutCounter; 387 volatile uint32_t totalRfdPoolBusyCounter; 388 volatile uint32_t totalInternalBufferBusy; 389 volatile uint32_t totalExternalBufferBusy; 390 volatile uint32_t totalSgFragmentCounter; 391 volatile uint32_t totalDmaSemaphoreDepletionCounter; 392 volatile uint32_t totalNCSPCounter; 393 volatile uint32_t discardMask; 394 } t_ReassCommonTbl; 395 396 typedef _Packed struct t_Hmtd { 397 volatile uint16_t cfg; 398 volatile uint8_t eliodnOffset; 399 volatile uint8_t extHmcdBasePtrHi; 400 volatile uint32_t hmcdBasePtr; 401 volatile uint16_t nextAdIdx; 402 volatile uint8_t res1; 403 volatile uint8_t opCode; 404 volatile uint32_t res2; 405 } _PackedType t_Hmtd; 406 407 #if defined(__MWERKS__) && !defined(__GNUC__) 408 #pragma pack(pop) 409 #endif /* defined(__MWERKS__) && ... */ 410 411 412 /***********************************************************************/ 413 /* Driver's internal structures */ 414 /***********************************************************************/ 415 #if (defined(FM_CAPWAP_SUPPORT) && (DPAA_VERSION == 10)) 416 typedef struct 417 { 418 t_Handle p_AutoLearnHashTbl; 419 t_Handle p_ReassmFrmDescrPoolTbl; 420 t_Handle p_ReassmFrmDescrIndxPoolTbl; 421 t_Handle p_TimeOutTbl; 422 uint16_t maxNumFramesInProcess; 423 uint8_t numOfTasks; 424 //uint8_t poolId; 425 uint8_t prOffset; 426 uint16_t dataOffset; 427 uint8_t sgBpid; 428 uint8_t hwPortId; 429 uint32_t fqidForTimeOutFrames; 430 uint32_t timeoutRoutineRequestTime; 431 uint32_t bitFor1Micro; 432 } t_CapwapFragParams; 433 #endif /* (defined(FM_CAPWAP_SUPPORT) && (DPAA_VERSION == 10)) */ 434 435 typedef struct 436 { 437 t_AdOfTypeContLookup *p_Frag; 438 #if (DPAA_VERSION == 10) 439 uint8_t scratchBpid; 440 #endif /* (DPAA_VERSION == 10) */ 441 } t_FragParams; 442 443 typedef struct t_ReassmParams 444 { 445 e_NetHeaderType hdr; /* Header selection */ 446 t_ReassCommonTbl *p_ReassCommonTbl; 447 uintptr_t reassFrmDescrIndxPoolTblAddr; 448 uintptr_t reassFrmDescrPoolTblAddr; 449 uintptr_t timeOutTblAddr; 450 uintptr_t internalBufferPoolManagementIndexAddr; 451 uintptr_t internalBufferPoolAddr; 452 uint32_t maxNumFramesInProcess; 453 uint8_t sgBpid; 454 uint8_t dataMemId; 455 uint16_t dataLiodnOffset; 456 uint32_t fqidForTimeOutFrames; 457 e_FmPcdManipReassemTimeOutMode timeOutMode; 458 uint32_t timeoutThresholdForReassmProcess; 459 union { 460 struct { 461 t_Handle h_Ipv4Ad; 462 t_Handle h_Ipv6Ad; 463 bool ipv6Assigned; 464 t_ReassTbl *p_Ipv4ReassTbl; 465 t_ReassTbl *p_Ipv6ReassTbl; 466 uintptr_t ipv4AutoLearnHashTblAddr; 467 uintptr_t ipv6AutoLearnHashTblAddr; 468 uintptr_t ipv4AutoLearnSetLockTblAddr; 469 uintptr_t ipv6AutoLearnSetLockTblAddr; 470 uint16_t minFragSize[2]; 471 e_FmPcdManipReassemWaysNumber numOfFramesPerHashEntry[2]; 472 uint8_t relativeSchemeId[2]; 473 t_Handle h_Ipv4Scheme; 474 t_Handle h_Ipv6Scheme; 475 uint32_t nonConsistentSpFqid; 476 } ip; 477 struct { 478 t_Handle h_Ad; 479 t_ReassTbl *p_ReassTbl; 480 uintptr_t autoLearnHashTblAddr; 481 uintptr_t autoLearnSetLockTblAddr; 482 uint16_t maxRessembledsSize; 483 e_FmPcdManipReassemWaysNumber numOfFramesPerHashEntry; 484 uint8_t relativeSchemeId; 485 t_Handle h_Scheme; 486 } capwap; 487 }; 488 } t_ReassmParams; 489 490 typedef struct{ 491 e_FmPcdManipType type; 492 t_FmPcdManipParams manipParams; 493 bool muramAllocate; 494 t_Handle h_Ad; 495 uint32_t opcode; 496 bool rmv; 497 bool insrt; 498 t_Handle h_NextManip; 499 t_Handle h_PrevManip; 500 e_FmPcdManipType nextManipType; 501 /* HdrManip parameters*/ 502 uint8_t *p_Hmct; 503 uint8_t *p_Data; 504 bool dontParseAfterManip; 505 bool fieldUpdate; 506 bool custom; 507 uint16_t tableSize; 508 uint8_t dataSize; 509 bool cascaded; 510 e_ManipUnifiedPosition unifiedPosition; 511 /* end HdrManip */ 512 uint8_t *p_Template; 513 uint16_t owner; 514 uint32_t updateParams; 515 uint32_t shadowUpdateParams; 516 bool frag; 517 bool reassm; 518 uint16_t sizeForFragmentation; 519 #if (defined(FM_CAPWAP_SUPPORT) && (DPAA_VERSION == 10)) 520 t_Handle h_Frag; 521 t_CapwapFragParams capwapFragParams; 522 #endif /* (defined(FM_CAPWAP_SUPPORT) && (DPAA_VERSION == 10)) */ 523 union { 524 t_ReassmParams reassmParams; 525 t_FragParams fragParams; 526 }; 527 uint8_t icOffset; 528 uint16_t ownerTmp; 529 bool cnia; 530 t_Handle p_StatsTbl; 531 t_Handle h_FmPcd; 532 t_List nodesLst; 533 t_Handle h_Spinlock; 534 } t_FmPcdManip; 535 536 typedef struct t_FmPcdCcSavedManipParams 537 { 538 union 539 { 540 struct 541 { 542 uint16_t dataOffset; 543 //uint8_t poolId; 544 }capwapParams; 545 struct 546 { 547 uint16_t dataOffset; 548 uint8_t poolId; 549 }ipParams; 550 }; 551 552 } t_FmPcdCcSavedManipParams; 553 554 555 #endif /* __FM_MANIP_H */ 556