1d91236feSeschrock /*
2d91236feSeschrock  * CDDL HEADER START
3d91236feSeschrock  *
4d91236feSeschrock  * The contents of this file are subject to the terms of the
5d91236feSeschrock  * Common Development and Distribution License (the "License").
6d91236feSeschrock  * You may not use this file except in compliance with the License.
7d91236feSeschrock  *
8d91236feSeschrock  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9d91236feSeschrock  * or http://www.opensolaris.org/os/licensing.
10d91236feSeschrock  * See the License for the specific language governing permissions
11d91236feSeschrock  * and limitations under the License.
12d91236feSeschrock  *
13d91236feSeschrock  * When distributing Covered Code, include this CDDL HEADER in each
14d91236feSeschrock  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15d91236feSeschrock  * If applicable, add the following below this CDDL HEADER, with the
16d91236feSeschrock  * fields enclosed by brackets "[]" replaced with your own identifying
17d91236feSeschrock  * information: Portions Copyright [yyyy] [name of copyright owner]
18d91236feSeschrock  *
19d91236feSeschrock  * CDDL HEADER END
20d91236feSeschrock  */
21d91236feSeschrock 
22d91236feSeschrock /*
23ac88567aSHyon Kim  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
24d91236feSeschrock  */
25d91236feSeschrock 
26d91236feSeschrock #ifndef	_SES_H
27d91236feSeschrock #define	_SES_H
28d91236feSeschrock 
29d91236feSeschrock #include <assert.h>
30d91236feSeschrock 
31d91236feSeschrock #include <scsi/libses.h>
32d91236feSeschrock 
33d91236feSeschrock #include <fm/topo_mod.h>
34d91236feSeschrock #include <fm/topo_list.h>
35d91236feSeschrock #include <fm/topo_method.h>
36d91236feSeschrock 
37d91236feSeschrock #ifdef	__cplusplus
38d91236feSeschrock extern "C" {
39d91236feSeschrock #endif
40d91236feSeschrock 
410b32bb8bSEric Schrock extern ses_node_t *ses_node_lock(topo_mod_t *, tnode_t *);
420b32bb8bSEric Schrock extern void ses_node_unlock(topo_mod_t *, tnode_t *);
43d91236feSeschrock 
44d91236feSeschrock extern int ses_node_enum_facility(topo_mod_t *, tnode_t *, topo_version_t,
45d91236feSeschrock     nvlist_t *, nvlist_t **);
46d91236feSeschrock extern int ses_enc_enum_facility(topo_mod_t *, tnode_t *, topo_version_t,
47d91236feSeschrock     nvlist_t *, nvlist_t **);
48d91236feSeschrock 
497bced3d7SEric Schrock typedef struct ses_enum_target {
507bced3d7SEric Schrock 	topo_list_t		set_link;
517bced3d7SEric Schrock 	ses_target_t		*set_target;
527bced3d7SEric Schrock 	ses_snap_t		*set_snap;
53525b85dbSEric Schrock 	hrtime_t		set_snaptime;
547bced3d7SEric Schrock 	char			*set_devpath;
557bced3d7SEric Schrock 	int			set_refcount;
560b32bb8bSEric Schrock 	pthread_mutex_t		set_lock;
57*f76de749SStephen Hanson 	ctid_t			set_ctid;
587bced3d7SEric Schrock } ses_enum_target_t;
597bced3d7SEric Schrock 
60d91236feSeschrock #ifndef	NDEBUG
61d91236feSeschrock #define	verify(x)	assert(x)
62d91236feSeschrock #else
63d91236feSeschrock #define	verify(x)	((void)(x))
64d91236feSeschrock #endif
65d91236feSeschrock 
66d91236feSeschrock #ifdef	__cplusplus
67d91236feSeschrock }
68d91236feSeschrock #endif
69d91236feSeschrock 
70d91236feSeschrock #endif	/* _SES_H */
71