xref: /illumos-gate/usr/src/uts/common/io/i2c/ctrl/i2csim/i2csim.h (revision 0cbe48189888d02563dba9c90132ac391ba233b6)
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 _I2CSIM_H
17 #define	_I2CSIM_H
18 
19 /*
20  * Definitions for accesss to the I2C Simulation driver.
21  */
22 
23 #include <sys/i2c/i2c.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #define	I2CSIM_IOCTL	(('i' << 24) | ('s' << 16) | ('m' << 8))
30 
31 typedef struct i2csim_req {
32 	uint64_t i2csim_seq;
33 	uint32_t i2csim_ctrl;
34 	uint32_t i2csim_port;
35 	i2c_ctrl_type_t i2csim_type;
36 	i2c_req_t i2csim_i2c;
37 	smbus_req_t i2csim_smbus;
38 } i2csim_req_t;
39 
40 #define	I2CSIM_REQUEST	(I2CSIM_IOCTL | 0)
41 #define	I2CSIM_REPLY	(I2CSIM_IOCTL | 1)
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 
47 #endif /* _I2CSIM_H */
48