1*0cbe4818SRobert Mustacchi /* 2*0cbe4818SRobert Mustacchi * This file and its contents are supplied under the terms of the 3*0cbe4818SRobert Mustacchi * Common Development and Distribution License ("CDDL"), version 1.0. 4*0cbe4818SRobert Mustacchi * You may only use this file in accordance with the terms of version 5*0cbe4818SRobert Mustacchi * 1.0 of the CDDL. 6*0cbe4818SRobert Mustacchi * 7*0cbe4818SRobert Mustacchi * A full copy of the text of the CDDL should have accompanied this 8*0cbe4818SRobert Mustacchi * source. A copy of the CDDL is also available via the Internet at 9*0cbe4818SRobert Mustacchi * http://www.illumos.org/license/CDDL. 10*0cbe4818SRobert Mustacchi */ 11*0cbe4818SRobert Mustacchi 12*0cbe4818SRobert Mustacchi /* 13*0cbe4818SRobert Mustacchi * Copyright 2025 Oxide Computer Company 14*0cbe4818SRobert Mustacchi */ 15*0cbe4818SRobert Mustacchi 16*0cbe4818SRobert Mustacchi #ifndef _I2CSIM_H 17*0cbe4818SRobert Mustacchi #define _I2CSIM_H 18*0cbe4818SRobert Mustacchi 19*0cbe4818SRobert Mustacchi /* 20*0cbe4818SRobert Mustacchi * Definitions for accesss to the I2C Simulation driver. 21*0cbe4818SRobert Mustacchi */ 22*0cbe4818SRobert Mustacchi 23*0cbe4818SRobert Mustacchi #include <sys/i2c/i2c.h> 24*0cbe4818SRobert Mustacchi 25*0cbe4818SRobert Mustacchi #ifdef __cplusplus 26*0cbe4818SRobert Mustacchi extern "C" { 27*0cbe4818SRobert Mustacchi #endif 28*0cbe4818SRobert Mustacchi 29*0cbe4818SRobert Mustacchi #define I2CSIM_IOCTL (('i' << 24) | ('s' << 16) | ('m' << 8)) 30*0cbe4818SRobert Mustacchi 31*0cbe4818SRobert Mustacchi typedef struct i2csim_req { 32*0cbe4818SRobert Mustacchi uint64_t i2csim_seq; 33*0cbe4818SRobert Mustacchi uint32_t i2csim_ctrl; 34*0cbe4818SRobert Mustacchi uint32_t i2csim_port; 35*0cbe4818SRobert Mustacchi i2c_ctrl_type_t i2csim_type; 36*0cbe4818SRobert Mustacchi i2c_req_t i2csim_i2c; 37*0cbe4818SRobert Mustacchi smbus_req_t i2csim_smbus; 38*0cbe4818SRobert Mustacchi } i2csim_req_t; 39*0cbe4818SRobert Mustacchi 40*0cbe4818SRobert Mustacchi #define I2CSIM_REQUEST (I2CSIM_IOCTL | 0) 41*0cbe4818SRobert Mustacchi #define I2CSIM_REPLY (I2CSIM_IOCTL | 1) 42*0cbe4818SRobert Mustacchi 43*0cbe4818SRobert Mustacchi #ifdef __cplusplus 44*0cbe4818SRobert Mustacchi } 45*0cbe4818SRobert Mustacchi #endif 46*0cbe4818SRobert Mustacchi 47*0cbe4818SRobert Mustacchi #endif /* _I2CSIM_H */ 48