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
18 #define CPT_COUNT_THOLD 32
19 #define CPT_TIMER_THOLD 0x3F
25 #define ROUNDUP4(val) (((val) + 3) & 0xfffffffc)
29 #define ROUNDUP8(val) (((val) + 7) & 0xfffffff8)
33 #define ROUNDUP16(val) (((val) + 15) & 0xfffffff0)
37 #define __hot __attribute__((hot))
40 #define MOD_INC(i, l) ((i) == (l - 1) ? (i) = 0 : (i)++)
42 struct cptvf_meta_info {
43 void *cptvf_meta_pool;
49 /** Request id of a crypto operation */
54 * Pending queue structure
57 struct pending_queue {
58 /** Tail of queue to be used for enqueue */
60 /** Head of queue to be used for dequeue */
62 /** Array of pending requests */
63 struct rid *rid_queue;
64 /** Pending requests count */
65 uint64_t pending_count;
68 struct cpt_request_info {
69 /** Data path fields */
71 volatile uint64_t *completion_addr;
72 volatile uint64_t *alternate_caddr;
81 /** Control path fields */
86 #endif /* _CPT_COMMON_H_ */