summaryrefslogtreecommitdiff
path: root/usr/src/uts/sun4u/sys/i2c/misc/i2c_svc_impl.h
blob: bd97df2fcbb9d6123bcd7d72a3affbba51f9b0ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * Copyright (c) 1999-2000 by Sun Microsystems, Inc.
 * All rights reserved.
 */

#ifndef _I2C_SVC_IMPL_H
#define	_I2C_SVC_IMPL_H

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#ifdef	__cplusplus
extern "C" {
#endif

/*
 * i2c_transfer_alloc is a wrapper structure that is used
 * to store i2c_transfer_t allocation information so that
 * the caller to i2c_transfer_allocate() can modify the
 * buffer/size fields and i2c_transfer_free() will still
 * be able to recover all buffers.
 */
typedef struct i2c_transfer_alloc {
	i2c_transfer_t		i2cw_i2ct;
	uint32_t		i2cw_size;
} i2c_transfer_alloc_t;

#define	CHDL(client_hdl) ((i2c_client_hdl_impl_t *)(client_hdl))

/*
 * i2c_client_hdl_impl is the real implementation of
 * i2c_client_hdl.
 */
typedef struct i2c_client_hdl_impl {
	dev_info_t	*chdl_dip; /* dip for I2C device */
	struct i2c_nexus_reg *chdl_nexus_reg;
} i2c_client_hdl_impl_t;

/*
 * i2c_nexus_reg_list are the elements of a linked list which
 * tracks all I2C parents.
 */
typedef struct i2c_nexus_reg_list {
	i2c_nexus_reg_t nexus_reg;
	dev_info_t	*dip;
	struct i2c_nexus_reg_list *next;
} i2c_nexus_reg_list_t;

#ifdef	__cplusplus
}
#endif

#endif /* _I2C_SVC_IMPL_H */