e53c50adc185e23c2ca85195a6af22c98ab949f5
[dpdk.git] / drivers / crypto / bcmfs / bcmfs_sym_req.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Broadcom
3  * All rights reserved.
4  */
5
6 #ifndef _BCMFS_SYM_REQ_H_
7 #define _BCMFS_SYM_REQ_H_
8
9 #include <rte_cryptodev.h>
10
11 #include "bcmfs_dev_msg.h"
12 #include "bcmfs_sym_defs.h"
13
14 /* Fixed SPU2 Metadata */
15 struct spu2_fmd {
16         uint64_t ctrl0;
17         uint64_t ctrl1;
18         uint64_t ctrl2;
19         uint64_t ctrl3;
20 };
21
22 /*
23  * This structure hold the supportive data required to process a
24  * rte_crypto_op
25  */
26 struct bcmfs_sym_request {
27         /* spu2 engine related data */
28         struct spu2_fmd fmd;
29         /* cipher key */
30         uint8_t cipher_key[BCMFS_MAX_KEY_SIZE];
31         /* auth key */
32         uint8_t auth_key[BCMFS_MAX_KEY_SIZE];
33         /* iv key */
34         uint8_t iv[BCMFS_MAX_IV_SIZE];
35         /* digest data output from crypto h/w */
36         uint8_t digest[BCMFS_MAX_DIGEST_SIZE];
37         /* 2-Bytes response from crypto h/w */
38         uint8_t resp[2];
39         /*
40          * Below are all iovas for above members
41          * from top
42          */
43         /* iova for fmd */
44         rte_iova_t fptr;
45         /* iova for cipher key */
46         rte_iova_t cptr;
47         /* iova for auth key */
48         rte_iova_t aptr;
49         /* iova for iv key */
50         rte_iova_t iptr;
51         /* iova for digest */
52         rte_iova_t dptr;
53         /* iova for response */
54         rte_iova_t rptr;
55
56         /* bcmfs qp message for h/w queues to process */
57         struct bcmfs_qp_message msgs;
58         /* crypto op */
59         struct rte_crypto_op *op;
60 };
61
62 #endif /* _BCMFS_SYM_REQ_H_ */