1
2
3
4 #ifndef NFP_CRYPTO_FW_H
5 #define NFP_CRYPTO_FW_H 1
6
7 #include "../ccm.h"
8
9 #define NFP_NET_CRYPTO_OP_TLS_1_2_AES_GCM_128_ENC 0
10 #define NFP_NET_CRYPTO_OP_TLS_1_2_AES_GCM_128_DEC 1
11
12 struct nfp_crypto_reply_simple {
13 struct nfp_ccm_hdr hdr;
14 __be32 error;
15 };
16
17 struct nfp_crypto_req_reset {
18 struct nfp_ccm_hdr hdr;
19 __be32 ep_id;
20 };
21
22 #define NFP_NET_TLS_IPVER GENMASK(15, 12)
23 #define NFP_NET_TLS_VLAN GENMASK(11, 0)
24 #define NFP_NET_TLS_VLAN_UNUSED 4095
25
26 struct nfp_crypto_req_add_front {
27 struct nfp_ccm_hdr hdr;
28 __be32 ep_id;
29 u8 resv[3];
30 u8 opcode;
31 u8 key_len;
32 __be16 ipver_vlan __packed;
33 u8 l4_proto;
34 #define NFP_NET_TLS_NON_ADDR_KEY_LEN 8
35 u8 l3_addrs[0];
36 };
37
38 struct nfp_crypto_req_add_back {
39 __be16 src_port;
40 __be16 dst_port;
41 __be32 key[8];
42 __be32 salt;
43 __be32 iv[2];
44 __be32 counter;
45 __be32 rec_no[2];
46 __be32 tcp_seq;
47 };
48
49 struct nfp_crypto_req_add_v4 {
50 struct nfp_crypto_req_add_front front;
51 __be32 src_ip;
52 __be32 dst_ip;
53 struct nfp_crypto_req_add_back back;
54 };
55
56 struct nfp_crypto_req_add_v6 {
57 struct nfp_crypto_req_add_front front;
58 __be32 src_ip[4];
59 __be32 dst_ip[4];
60 struct nfp_crypto_req_add_back back;
61 };
62
63 struct nfp_crypto_reply_add {
64 struct nfp_ccm_hdr hdr;
65 __be32 error;
66 __be32 handle[2];
67 };
68
69 struct nfp_crypto_req_del {
70 struct nfp_ccm_hdr hdr;
71 __be32 ep_id;
72 __be32 handle[2];
73 };
74
75 struct nfp_crypto_req_update {
76 struct nfp_ccm_hdr hdr;
77 __be32 ep_id;
78 u8 resv[3];
79 u8 opcode;
80 __be32 handle[2];
81 __be32 rec_no[2];
82 __be32 tcp_seq;
83 };
84 #endif