1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2016-2018 Intel Corporation
5 #ifndef _KASUMI_PMD_PRIVATE_H_
6 #define _KASUMI_PMD_PRIVATE_H_
8 #include <intel-ipsec-mb.h>
10 #define CRYPTODEV_NAME_KASUMI_PMD crypto_kasumi
11 /**< KASUMI PMD device name */
13 /** KASUMI PMD LOGTYPE DRIVER */
14 extern int kasumi_logtype_driver;
16 #define KASUMI_LOG(level, fmt, ...) \
17 rte_log(RTE_LOG_ ## level, kasumi_logtype_driver, \
18 "%s() line %u: " fmt "\n", __func__, __LINE__, \
21 #define KASUMI_DIGEST_LENGTH 4
23 /** private data structure for each virtual KASUMI device */
24 struct kasumi_private {
25 unsigned max_nb_queue_pairs;
26 /**< Max number of queue pairs supported by device */
28 /**< Multi-buffer instance */
31 /** KASUMI buffer queue pair */
34 /**< Queue Pair Identifier */
35 char name[RTE_CRYPTODEV_NAME_MAX_LEN];
36 /**< Unique Queue Pair Name */
37 struct rte_ring *processed_ops;
38 /**< Ring for placing processed ops */
39 struct rte_mempool *sess_mp;
40 /**< Session Mempool */
41 struct rte_mempool *sess_mp_priv;
42 /**< Session Private Data Mempool */
43 struct rte_cryptodev_stats qp_stats;
44 /**< Queue pair statistics */
45 uint8_t temp_digest[KASUMI_DIGEST_LENGTH];
46 /**< Buffer used to store the digest generated
47 * by the driver when verifying a digest provided
48 * by the user (using authentication verify operation)
51 /**< Multi-buffer instance */
52 } __rte_cache_aligned;
54 enum kasumi_operation {
55 KASUMI_OP_ONLY_CIPHER,
57 KASUMI_OP_CIPHER_AUTH,
58 KASUMI_OP_AUTH_CIPHER,
59 KASUMI_OP_NOT_SUPPORTED
62 /** KASUMI private session structure */
63 struct kasumi_session {
64 /* Keys have to be 16-byte aligned */
65 kasumi_key_sched_t pKeySched_cipher;
66 kasumi_key_sched_t pKeySched_hash;
67 enum kasumi_operation op;
68 enum rte_crypto_auth_operation auth_op;
69 uint16_t cipher_iv_offset;
70 } __rte_cache_aligned;
74 kasumi_set_session_parameters(MB_MGR *mgr, struct kasumi_session *sess,
75 const struct rte_crypto_sym_xform *xform);
78 /** device specific operations function pointer structure */
79 struct rte_cryptodev_ops *rte_kasumi_pmd_ops;
81 #endif /* _KASUMI_PMD_PRIVATE_H_ */