1 /*
2  * Copyright (c) 1999-2000 by Sun Microsystems, Inc.
3  * All rights reserved.
4  */
5 
6 #ifndef _I2C_SVC_IMPL_H
7 #define	_I2C_SVC_IMPL_H
8 
9 #pragma ident	"%Z%%M%	%I%	%E% SMI"
10 
11 #ifdef	__cplusplus
12 extern "C" {
13 #endif
14 
15 /*
16  * i2c_transfer_alloc is a wrapper structure that is used
17  * to store i2c_transfer_t allocation information so that
18  * the caller to i2c_transfer_allocate() can modify the
19  * buffer/size fields and i2c_transfer_free() will still
20  * be able to recover all buffers.
21  */
22 typedef struct i2c_transfer_alloc {
23 	i2c_transfer_t		i2cw_i2ct;
24 	uint32_t		i2cw_size;
25 } i2c_transfer_alloc_t;
26 
27 #define	CHDL(client_hdl) ((i2c_client_hdl_impl_t *)(client_hdl))
28 
29 /*
30  * i2c_client_hdl_impl is the real implementation of
31  * i2c_client_hdl.
32  */
33 typedef struct i2c_client_hdl_impl {
34 	dev_info_t	*chdl_dip; /* dip for I2C device */
35 	struct i2c_nexus_reg *chdl_nexus_reg;
36 } i2c_client_hdl_impl_t;
37 
38 /*
39  * i2c_nexus_reg_list are the elements of a linked list which
40  * tracks all I2C parents.
41  */
42 typedef struct i2c_nexus_reg_list {
43 	i2c_nexus_reg_t nexus_reg;
44 	dev_info_t	*dip;
45 	struct i2c_nexus_reg_list *next;
46 } i2c_nexus_reg_list_t;
47 
48 #ifdef	__cplusplus
49 }
50 #endif
51 
52 #endif /* _I2C_SVC_IMPL_H */
53