xref: /illumos-gate/usr/src/uts/intel/io/amdzen/zen_udf.h (revision ce01deb6d39b300af7a4301eebdd545595ae4171)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright 2025 Oxide Computer Company
14  */
15 
16 #ifndef _ZEN_UDF_H
17 #define	_ZEN_UDF_H
18 
19 /*
20  * Private ioctls for interfacing with the zen_udf driver.
21  */
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #define	ZEN_UDF_IOCTL	(('u' << 24) | ('d' << 16) | ('f' << 8))
28 
29 #define	ZEN_UDF_READ	(ZEN_UDF_IOCTL | 0x01)
30 
31 typedef enum zen_udf_flags {
32 	/*
33 	 * Perform a broadcast rather than per-instance read. This is
34 	 * effectively an OR of the result across all instances.
35 	 */
36 	ZEN_UDF_F_BCAST		= 1 << 0,
37 	/*
38 	 * Treat the given register as 64-bits wide rather than 32-bits.
39 	 */
40 	ZEN_UDF_F_64		= 1 << 1
41 
42 } zen_udf_flags_t;
43 
44 typedef struct zen_udf_io {
45 	zen_udf_flags_t	zui_flags;
46 	uint8_t		zui_inst;
47 	uint8_t		zui_func;
48 	uint16_t	zui_reg;
49 	uint64_t	zui_data;
50 } zen_udf_io_t;
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 
56 #endif /* _ZEN_UDF_H */
57