1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2016-2017 Intel Corporation
5 #ifndef _RTE_KASUMI_PMD_PRIVATE_H_
6 #define _RTE_KASUMI_PMD_PRIVATE_H_
8 #include <sso_kasumi.h>
10 #define CRYPTODEV_NAME_KASUMI_PMD crypto_kasumi
11 /**< KASUMI PMD device name */
13 #define KASUMI_LOG_ERR(fmt, args...) \
14 RTE_LOG(ERR, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
15 RTE_STR(CRYPTODEV_NAME_KASUMI_PMD), \
16 __func__, __LINE__, ## args)
18 #ifdef RTE_LIBRTE_KASUMI_DEBUG
19 #define KASUMI_LOG_INFO(fmt, args...) \
20 RTE_LOG(INFO, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
21 RTE_STR(CRYPTODEV_NAME_KASUMI_PMD), \
22 __func__, __LINE__, ## args)
24 #define KASUMI_LOG_DBG(fmt, args...) \
25 RTE_LOG(DEBUG, CRYPTODEV, "[%s] %s() line %u: " fmt "\n", \
26 RTE_STR(CRYPTODEV_NAME_KASUMI_PMD), \
27 __func__, __LINE__, ## args)
29 #define KASUMI_LOG_INFO(fmt, args...)
30 #define KASUMI_LOG_DBG(fmt, args...)
33 #define KASUMI_DIGEST_LENGTH 4
35 /** private data structure for each virtual KASUMI device */
36 struct kasumi_private {
37 unsigned max_nb_queue_pairs;
38 /**< Max number of queue pairs supported by device */
39 unsigned max_nb_sessions;
40 /**< Max number of sessions supported by device */
43 /** KASUMI buffer queue pair */
46 /**< Queue Pair Identifier */
47 char name[RTE_CRYPTODEV_NAME_MAX_LEN];
48 /**< Unique Queue Pair Name */
49 struct rte_ring *processed_ops;
50 /**< Ring for placing processed ops */
51 struct rte_mempool *sess_mp;
52 /**< Session Mempool */
53 struct rte_cryptodev_stats qp_stats;
54 /**< Queue pair statistics */
55 uint8_t temp_digest[KASUMI_DIGEST_LENGTH];
56 /**< Buffer used to store the digest generated
57 * by the driver when verifying a digest provided
58 * by the user (using authentication verify operation)
60 } __rte_cache_aligned;
62 enum kasumi_operation {
63 KASUMI_OP_ONLY_CIPHER,
65 KASUMI_OP_CIPHER_AUTH,
66 KASUMI_OP_AUTH_CIPHER,
67 KASUMI_OP_NOT_SUPPORTED
70 /** KASUMI private session structure */
71 struct kasumi_session {
72 /* Keys have to be 16-byte aligned */
73 sso_kasumi_key_sched_t pKeySched_cipher;
74 sso_kasumi_key_sched_t pKeySched_hash;
75 enum kasumi_operation op;
76 enum rte_crypto_auth_operation auth_op;
77 uint16_t cipher_iv_offset;
78 } __rte_cache_aligned;
82 kasumi_set_session_parameters(struct kasumi_session *sess,
83 const struct rte_crypto_sym_xform *xform);
86 /** device specific operations function pointer structure */
87 struct rte_cryptodev_ops *rte_kasumi_pmd_ops;
89 #endif /* _RTE_KASUMI_PMD_PRIVATE_H_ */