0001
0002
0003
0004 #ifndef NFP_CRYPTO_FW_H
0005 #define NFP_CRYPTO_FW_H 1
0006
0007 #include "../ccm.h"
0008
0009 #define NFP_NET_CRYPTO_OP_TLS_1_2_AES_GCM_128_ENC 0
0010 #define NFP_NET_CRYPTO_OP_TLS_1_2_AES_GCM_128_DEC 1
0011
0012 struct nfp_net_tls_resync_req {
0013 __be32 fw_handle[2];
0014 __be32 tcp_seq;
0015 u8 l3_offset;
0016 u8 l4_offset;
0017 u8 resv[2];
0018 };
0019
0020 struct nfp_crypto_reply_simple {
0021 struct nfp_ccm_hdr hdr;
0022 __be32 error;
0023 };
0024
0025 struct nfp_crypto_req_reset {
0026 struct nfp_ccm_hdr hdr;
0027 __be32 ep_id;
0028 };
0029
0030 #define NFP_NET_TLS_IPVER GENMASK(15, 12)
0031 #define NFP_NET_TLS_VLAN GENMASK(11, 0)
0032 #define NFP_NET_TLS_VLAN_UNUSED 4095
0033
0034 struct nfp_crypto_req_add_front {
0035 struct nfp_ccm_hdr hdr;
0036 __be32 ep_id;
0037 u8 resv[3];
0038 u8 opcode;
0039 u8 key_len;
0040 __be16 ipver_vlan __packed;
0041 u8 l4_proto;
0042 #define NFP_NET_TLS_NON_ADDR_KEY_LEN 8
0043 u8 l3_addrs[];
0044 };
0045
0046 struct nfp_crypto_req_add_back {
0047 __be16 src_port;
0048 __be16 dst_port;
0049 __be32 key[8];
0050 __be32 salt;
0051 __be32 iv[2];
0052 __be32 counter;
0053 __be32 rec_no[2];
0054 __be32 tcp_seq;
0055 };
0056
0057 struct nfp_crypto_req_add_v4 {
0058 struct nfp_crypto_req_add_front front;
0059 __be32 src_ip;
0060 __be32 dst_ip;
0061 struct nfp_crypto_req_add_back back;
0062 };
0063
0064 struct nfp_crypto_req_add_v6 {
0065 struct nfp_crypto_req_add_front front;
0066 __be32 src_ip[4];
0067 __be32 dst_ip[4];
0068 struct nfp_crypto_req_add_back back;
0069 };
0070
0071 struct nfp_crypto_reply_add {
0072 struct nfp_ccm_hdr hdr;
0073 __be32 error;
0074 __be32 handle[2];
0075 };
0076
0077 struct nfp_crypto_req_del {
0078 struct nfp_ccm_hdr hdr;
0079 __be32 ep_id;
0080 __be32 handle[2];
0081 };
0082
0083 struct nfp_crypto_req_update {
0084 struct nfp_ccm_hdr hdr;
0085 __be32 ep_id;
0086 u8 resv[3];
0087 u8 opcode;
0088 __be32 handle[2];
0089 __be32 rec_no[2];
0090 __be32 tcp_seq;
0091 };
0092 #endif