18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
28c2ecf20Sopenharmony_ci/* Copyright (C) 2019 Netronome Systems, Inc. */
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#ifndef NFP_CRYPTO_H
58c2ecf20Sopenharmony_ci#define NFP_CRYPTO_H 1
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cistruct net_device;
88c2ecf20Sopenharmony_cistruct nfp_net;
98c2ecf20Sopenharmony_cistruct nfp_net_tls_resync_req;
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_cistruct nfp_net_tls_offload_ctx {
128c2ecf20Sopenharmony_ci	__be32 fw_handle[2];
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci	u8 rx_end[0];
158c2ecf20Sopenharmony_ci	/* Tx only fields follow - Rx side does not have enough driver state
168c2ecf20Sopenharmony_ci	 * to fit these
178c2ecf20Sopenharmony_ci	 */
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci	u32 next_seq;
208c2ecf20Sopenharmony_ci};
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#ifdef CONFIG_TLS_DEVICE
238c2ecf20Sopenharmony_ciint nfp_net_tls_init(struct nfp_net *nn);
248c2ecf20Sopenharmony_ciint nfp_net_tls_rx_resync_req(struct net_device *netdev,
258c2ecf20Sopenharmony_ci			      struct nfp_net_tls_resync_req *req,
268c2ecf20Sopenharmony_ci			      void *pkt, unsigned int pkt_len);
278c2ecf20Sopenharmony_ci#else
288c2ecf20Sopenharmony_cistatic inline int nfp_net_tls_init(struct nfp_net *nn)
298c2ecf20Sopenharmony_ci{
308c2ecf20Sopenharmony_ci	return 0;
318c2ecf20Sopenharmony_ci}
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_cistatic inline int
348c2ecf20Sopenharmony_cinfp_net_tls_rx_resync_req(struct net_device *netdev,
358c2ecf20Sopenharmony_ci			  struct nfp_net_tls_resync_req *req,
368c2ecf20Sopenharmony_ci			  void *pkt, unsigned int pkt_len)
378c2ecf20Sopenharmony_ci{
388c2ecf20Sopenharmony_ci	return -EOPNOTSUPP;
398c2ecf20Sopenharmony_ci}
408c2ecf20Sopenharmony_ci#endif
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#endif
43