xref: /titanic_52/usr/src/uts/sun/sys/dada/conf/device.h (revision c2580b931007758eab8cb5ae8726ebe1588e259b)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1996, by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 /*
28  * DCD device structure.
29  *
30  *	All DCD target drivers will have one of these per target/lun.
31  *	It will be created by a parent device and stored as driver private
32  *	data in that device's dev_info_t (and thus can be retrieved by
33  *	the function ddi_get_driver_private).
34  */
35 
36 #ifndef	_SYS_DCD_CONF_DEVICE_H
37 #define	_SYS_DCD_CONF_DEVICE_H
38 
39 #pragma ident	"%Z%%M%	%I%	%E% SMI"
40 
41 #include <sys/dada/dada_types.h>
42 
43 #ifdef	__cplusplus
44 extern "C" {
45 #endif
46 
47 struct dcd_device {
48 	/*
49 	 * Routing info for this device.
50 	 */
51 
52 	struct dcd_address	*dcd_address;
53 
54 	/*
55 	 * Cross-reference to our dev_info_t.
56 	 */
57 
58 	dev_info_t		*dcd_dev;
59 
60 	/*
61 	 * Mutex for this device, initialized by
62 	 * parent prior to calling probe or attach
63 	 * routine.
64 	 */
65 
66 	kmutex_t		dcd_mutex;
67 
68 	/*
69 	 * Reserved, do not use.
70 	 */
71 
72 	void			*dcd_reserved;
73 
74 
75 	/*
76 	 * If dcd_probe is used to probe out this device,
77 	 * a dcd_identify data structure will be allocated
78 	 * and an IDENTIFY command will be run to fill it in.
79 	 *
80 	 */
81 
82 	struct dcd_identify	*dcd_ident;
83 
84 	/*
85 	 * More detailed information is 'private' information, i.e., is
86 	 * only pertinent to Target drivers.
87 	 */
88 
89 	caddr_t			dcd_private;
90 
91 };
92 
93 
94 #ifdef	_KERNEL
95 #ifdef	__STDC__
96 extern int dcd_probe(struct dcd_device *devp, int (*callback)());
97 extern void dcd_unprobe(struct dcd_device *devp);
98 #else	/* __STDC__ */
99 extern int dcd_probe();
100 extern void dcd_unprobe();
101 #endif	/* __STDC__ */
102 #endif	/* _KERNEL */
103 
104 #ifdef	__cplusplus
105 }
106 #endif
107 
108 #endif	/* _SYS_DCD_CONF_DEVICE_H */
109