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