xref: /freebsd/sys/dev/qat/include/common/adf_uio_control.h (revision b07549f3c15637af6064d2f52b572f239f5ba870)
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright(c) 2007-2023 Intel Corporation */
3 /* $FreeBSD$ */
4 #ifndef QAT_UIO_CONTROL_H
5 #define QAT_UIO_CONTROL_H
6 #include <sys/condvar.h>
7 
8 struct adf_uio_instance_rings {
9 	unsigned int user_pid;
10 	u16 ring_mask;
11 	struct list_head list;
12 };
13 
14 struct adf_uio_control_bundle {
15 	uint8_t hardware_bundle_number;
16 	bool used;
17 	struct list_head list;
18 	struct mutex list_lock; /* protects list struct */
19 	struct mutex lock;      /* protects rings_used and csr_addr */
20 	u16 rings_used;
21 	u32 rings_enabled;
22 	void *csr_addr;
23 	struct qat_uio_bundle_dev uio_priv;
24 	vm_object_t obj;
25 };
26 
27 struct adf_uio_control_accel {
28 	struct adf_accel_dev *accel_dev;
29 	struct cdev *cdev;
30 	struct mtx lock;
31 	struct adf_bar *bar;
32 	unsigned int nb_bundles;
33 	unsigned int num_ker_bundles;
34 	unsigned int total_used_bundles;
35 	unsigned int num_handles;
36 	struct cv cleanup_ok;
37 	/* bundle[] must be last to allow dynamic size allocation. */
38 	struct adf_uio_control_bundle bundle[0];
39 
40 };
41 
42 
43 #endif /* end of include guard: QAT_UIO_CONTROL_H */
44