83a8a42659e0e2545b3d49b65f282107a91fc92a
[dpdk.git] / drivers / common / cpt / cpt_mcode_defines.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Cavium, Inc
3  */
4
5 #ifndef _CPT_MCODE_DEFINES_H_
6 #define _CPT_MCODE_DEFINES_H_
7
8 /*
9  * This file defines macros and structures according to microcode spec
10  *
11  */
12
13 #define CPT_BYTE_16             16
14 #define CPT_BYTE_24             24
15 #define CPT_BYTE_32             32
16 #define CPT_MAX_SG_IN_OUT_CNT   32
17 #define CPT_MAX_SG_CNT          (CPT_MAX_SG_IN_OUT_CNT/2)
18
19 #define COMPLETION_CODE_SIZE    8
20 #define COMPLETION_CODE_INIT    0
21
22 #define SG_LIST_HDR_SIZE        (8u)
23 #define SG_ENTRY_SIZE           sizeof(sg_comp_t)
24
25 /* #define CPT_ALWAYS_USE_SG_MODE */
26 #define CPT_ALWAYS_USE_SEPARATE_BUF
27
28 typedef struct sglist_comp {
29         union {
30                 uint64_t len;
31                 struct {
32                         uint16_t len[4];
33                 } s;
34         } u;
35         uint64_t ptr[4];
36 } sg_comp_t;
37
38 #endif /* _CPT_MCODE_DEFINES_H_ */