crypto/qat: use generic driver name for PCI registration
[dpdk.git] / drivers / crypto / qat / qat_common.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Intel Corporation
3  */
4 #ifndef _QAT_COMMON_H_
5 #define _QAT_COMMON_H_
6
7 #include <stdint.h>
8
9 #include <rte_mbuf.h>
10
11 /**< Intel(R) QAT Symmetric Crypto PMD device name */
12 #define CRYPTODEV_NAME_QAT_SYM_PMD      crypto_qat
13
14 /**< Intel(R) QAT device name for PCI registration */
15 #define QAT_PCI_NAME    qat
16 /*
17  * Maximum number of SGL entries
18  */
19 #define QAT_SGL_MAX_NUMBER      16
20
21 /* Intel(R) QuickAssist Technology device generation is enumerated
22  * from one according to the generation of the device
23  */
24
25 enum qat_device_gen {
26         QAT_GEN1 = 1,
27         QAT_GEN2,
28 };
29
30 enum qat_service_type {
31         QAT_SERVICE_ASYMMETRIC = 0,
32         QAT_SERVICE_SYMMETRIC,
33         QAT_SERVICE_COMPRESSION,
34         QAT_SERVICE_INVALID
35 };
36 #define QAT_MAX_SERVICES                (QAT_SERVICE_INVALID)
37
38 /**< Common struct for scatter-gather list operations */
39 struct qat_flat_buf {
40         uint32_t len;
41         uint32_t resrvd;
42         uint64_t addr;
43 } __rte_packed;
44
45 struct qat_sgl {
46         uint64_t resrvd;
47         uint32_t num_bufs;
48         uint32_t num_mapped_bufs;
49         struct qat_flat_buf buffers[QAT_SGL_MAX_NUMBER];
50 } __rte_packed __rte_cache_aligned;
51
52 int
53 qat_sgl_fill_array(struct rte_mbuf *buf, uint64_t buf_start,
54                 struct qat_sgl *list, uint32_t data_len);
55
56 #endif /* _QAT_COMMON_H_ */