bf4181ac9bde1a0c9d3dec13e201be8bc5cbb8c2
[dpdk.git] / drivers / crypto / octeontx2 / otx2_ipsec_fp.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2020 Marvell International Ltd.
3  */
4
5 #ifndef __OTX2_IPSEC_FP_H__
6 #define __OTX2_IPSEC_FP_H__
7
8 struct otx2_ipsec_fp_sa_ctl {
9         rte_be32_t spi          : 32;
10         uint64_t exp_proto_inter_frag : 8;
11         uint64_t rsvd_42_40   : 3;
12         uint64_t esn_en       : 1;
13         uint64_t rsvd_45_44   : 2;
14         uint64_t encap_type   : 2;
15         uint64_t enc_type     : 3;
16         uint64_t rsvd_48      : 1;
17         uint64_t auth_type    : 4;
18         uint64_t valid        : 1;
19         uint64_t direction    : 1;
20         uint64_t outer_ip_ver : 1;
21         uint64_t inner_ip_ver : 1;
22         uint64_t ipsec_mode   : 1;
23         uint64_t ipsec_proto  : 1;
24         uint64_t aes_key_len  : 2;
25 };
26
27 struct otx2_ipsec_fp_in_sa {
28         /* w0 */
29         struct otx2_ipsec_fp_sa_ctl ctl;
30
31         /* w1 */
32         uint8_t nonce[4]; /* Only for AES-GCM */
33         uint32_t unused;
34
35         /* w2 */
36         uint32_t esn_low;
37         uint32_t esn_hi;
38
39         /* w3-w6 */
40         uint8_t cipher_key[32];
41
42         /* w7-w12 */
43         uint8_t hmac_key[48];
44
45         RTE_STD_C11
46         union {
47                 void *userdata;
48                 uint64_t udata64;
49         };
50
51         uint64_t reserved1;
52         uint64_t reserved2;
53 };
54
55 #endif /* __OTX2_IPSEC_FP_H__ */