1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2 /* Copyright (C) 2019 Netronome Systems, Inc. */
3 
4 #ifndef NFP_CRYPTO_H
5 #define NFP_CRYPTO_H 1
6 
7 struct net_device;
8 struct nfp_net;
9 struct nfp_net_tls_resync_req;
10 
11 struct nfp_net_tls_offload_ctx {
12 	__be32 fw_handle[2];
13 
14 	u8 rx_end[0];
15 	/* Tx only fields follow - Rx side does not have enough driver state
16 	 * to fit these
17 	 */
18 
19 	u32 next_seq;
20 };
21 
22 #ifdef CONFIG_TLS_DEVICE
23 int nfp_net_tls_init(struct nfp_net *nn);
24 int nfp_net_tls_rx_resync_req(struct net_device *netdev,
25 			      struct nfp_net_tls_resync_req *req,
26 			      void *pkt, unsigned int pkt_len);
27 #else
nfp_net_tls_init(struct nfp_net * nn)28 static inline int nfp_net_tls_init(struct nfp_net *nn)
29 {
30 	return 0;
31 }
32 
33 static inline int
nfp_net_tls_rx_resync_req(struct net_device * netdev,struct nfp_net_tls_resync_req * req,void * pkt,unsigned int pkt_len)34 nfp_net_tls_rx_resync_req(struct net_device *netdev,
35 			  struct nfp_net_tls_resync_req *req,
36 			  void *pkt, unsigned int pkt_len)
37 {
38 	return -EOPNOTSUPP;
39 }
40 #endif
41 
42 #endif
43