1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Cavium, Inc
9 * This file defines common macros and structs
13 * Macros to determine CPT model. Driver makefile will define CPT_MODEL
16 #define CRYPTO_OCTEONTX 0x1
22 #define ROUNDUP4(val) (((val) + 3) & 0xfffffffc)
26 #define ROUNDUP8(val) (((val) + 7) & 0xfffffff8)
30 #define ROUNDUP16(val) (((val) + 15) & 0xfffffff0)
34 #define __hot __attribute__((hot))
37 #define MOD_INC(i, l) ((i) == (l - 1) ? (i) = 0 : (i)++)
39 struct cptvf_meta_info {
40 void *cptvf_meta_pool;
46 /** Request id of a crypto operation */
51 * Pending queue structure
54 struct pending_queue {
55 /** Tail of queue to be used for enqueue */
57 /** Head of queue to be used for dequeue */
59 /** Array of pending requests */
60 struct rid *rid_queue;
61 /** Pending requests count */
62 uint64_t pending_count;
65 struct cpt_request_info {
66 /** Data path fields */
68 volatile uint64_t *completion_addr;
69 volatile uint64_t *alternate_caddr;
78 /** Control path fields */
83 #endif /* _CPT_COMMON_H_ */