crypto/qat: move to using new device structure
[dpdk.git] / drivers / crypto / qat / qat_sym.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2015-2018 Intel Corporation
3  */
4
5 #ifndef _QAT_SYM_H_
6 #define _QAT_SYM_H_
7
8 #include <rte_cryptodev_pmd.h>
9 #include <rte_memzone.h>
10
11 #include "qat_common.h"
12 #include "qat_device.h"
13 #include "qat_crypto_capabilities.h"
14
15 /*
16  * This macro rounds up a number to a be a multiple of
17  * the alignment when the alignment is a power of 2
18  */
19 #define ALIGN_POW2_ROUNDUP(num, align) \
20         (((num) + (align) - 1) & ~((align) - 1))
21 #define QAT_64_BTYE_ALIGN_MASK (~0x3f)
22
23 struct qat_sym_session;
24
25 struct qat_sym_op_cookie {
26         struct qat_sgl qat_sgl_src;
27         struct qat_sgl qat_sgl_dst;
28         phys_addr_t qat_sgl_src_phys_addr;
29         phys_addr_t qat_sgl_dst_phys_addr;
30 };
31
32 void qat_sym_stats_get(struct rte_cryptodev *dev,
33         struct rte_cryptodev_stats *stats);
34 void qat_sym_stats_reset(struct rte_cryptodev *dev);
35
36 int qat_sym_qp_setup(struct rte_cryptodev *dev, uint16_t queue_pair_id,
37         const struct rte_cryptodev_qp_conf *rx_conf, int socket_id,
38         struct rte_mempool *session_pool);
39 int qat_sym_qp_release(struct rte_cryptodev *dev,
40         uint16_t queue_pair_id);
41
42
43 uint16_t
44 qat_sym_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
45                 uint16_t nb_ops);
46
47 uint16_t
48 qat_sym_pmd_dequeue_op_burst(void *qp, struct rte_crypto_op **ops,
49                 uint16_t nb_ops);
50
51 #endif /* _QAT_SYM_H_ */