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 /* 23d91236feSeschrock * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24d91236feSeschrock * Use is subject to license terms. 25d91236feSeschrock */ 26d91236feSeschrock 27d91236feSeschrock #ifndef _SES_H 28d91236feSeschrock #define _SES_H 29d91236feSeschrock 30d91236feSeschrock #include <assert.h> 31d91236feSeschrock 32d91236feSeschrock #include <scsi/libses.h> 33d91236feSeschrock 34d91236feSeschrock #include <fm/topo_mod.h> 35d91236feSeschrock #include <fm/topo_list.h> 36d91236feSeschrock #include <fm/topo_method.h> 37d91236feSeschrock 38d91236feSeschrock #ifdef __cplusplus 39d91236feSeschrock extern "C" { 40d91236feSeschrock #endif 41d91236feSeschrock 42*0b32bb8bSEric Schrock extern ses_node_t *ses_node_lock(topo_mod_t *, tnode_t *); 43*0b32bb8bSEric Schrock extern void ses_node_unlock(topo_mod_t *, tnode_t *); 44d91236feSeschrock 45d91236feSeschrock extern int ses_node_enum_facility(topo_mod_t *, tnode_t *, topo_version_t, 46d91236feSeschrock nvlist_t *, nvlist_t **); 47d91236feSeschrock extern int ses_enc_enum_facility(topo_mod_t *, tnode_t *, topo_version_t, 48d91236feSeschrock nvlist_t *, nvlist_t **); 49d91236feSeschrock 507bced3d7SEric Schrock typedef struct ses_enum_target { 517bced3d7SEric Schrock topo_list_t set_link; 527bced3d7SEric Schrock ses_target_t *set_target; 537bced3d7SEric Schrock ses_snap_t *set_snap; 547bced3d7SEric Schrock struct timeval set_snaptime; 557bced3d7SEric Schrock char *set_devpath; 567bced3d7SEric Schrock int set_refcount; 57*0b32bb8bSEric Schrock pthread_mutex_t set_lock; 587bced3d7SEric Schrock } ses_enum_target_t; 597bced3d7SEric Schrock 60d91236feSeschrock #define TOPO_PGROUP_SES "ses" 61d91236feSeschrock #define TOPO_PROP_NODE_ID "node-id" 62d91236feSeschrock #define TOPO_PROP_TARGET_PATH "target-path" 63*0b32bb8bSEric Schrock #define TOPO_PROP_SAS_ADDR "sas-address" 64d91236feSeschrock 65d91236feSeschrock #ifndef NDEBUG 66d91236feSeschrock #define verify(x) assert(x) 67d91236feSeschrock #else 68d91236feSeschrock #define verify(x) ((void)(x)) 69d91236feSeschrock #endif 70d91236feSeschrock 71d91236feSeschrock #ifdef __cplusplus 72d91236feSeschrock } 73d91236feSeschrock #endif 74d91236feSeschrock 75d91236feSeschrock #endif /* _SES_H */ 76