2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _SES_H
2N/A#define _SES_H
2N/A
2N/A#include <assert.h>
2N/A
2N/A#include <scsi/libses.h>
2N/A
2N/A#include <fm/topo_mod.h>
2N/A#include <fm/topo_list.h>
2N/A#include <fm/topo_method.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/Aextern ses_node_t *ses_node_lock(topo_mod_t *, tnode_t *);
2N/Aextern void ses_node_unlock(topo_mod_t *, tnode_t *);
2N/A
2N/Aextern int ses_node_enum_facility(topo_mod_t *, tnode_t *, topo_version_t,
2N/A nvlist_t *, nvlist_t **);
2N/Aextern int ses_enc_enum_facility(topo_mod_t *, tnode_t *, topo_version_t,
2N/A nvlist_t *, nvlist_t **);
2N/A
2N/Aextern void ses_dev_list_free(topo_mod_t *mod, topo_list_t *listp);
2N/Aextern int ses_dev_list_gather(topo_mod_t *mod, topo_list_t *listp);
2N/A
2N/Aextern char *ses_auth_clean(topo_mod_t *mod, const char *str);
2N/A
2N/A/*
2N/A * ses device node information.
2N/A */
2N/Atypedef struct ses_path_dev {
2N/A char *spd_dpath; /* devinfo paths */
2N/A char *spd_minor; /* minor node path */
2N/A char *spd_lpath; /* /dev links */
2N/A} ses_path_dev_t;
2N/A
2N/Atypedef struct ses_di_node {
2N/A topo_list_t sdn_list; /* list of devices */
2N/A
2N/A /* the following two fields are always defined */
2N/A uchar_t sdn_dtype; /* scsi inquiry device type. */
2N/A char *sdn_devid; /* devid of device */
2N/A char *sdn_mfg; /* vid/pid/revision info */
2N/A char *sdn_model;
2N/A char *sdn_serial;
2N/A char *sdn_firm;
2N/A
2N/A int sdn_pathdev_n; /* count of devinfo paths */
2N/A ses_path_dev_t *sdn_pathdevs; /* devinfo paths */
2N/A int sdn_ppaths_n; /* count of physical path */
2N/A char **sdn_ppaths; /* physical path(devinfo or pathinfo) */
2N/A
2N/A int sdn_target_ports_n; /* target-ports */
2N/A char **sdn_target_ports;
2N/A int sdn_attached_ports_n; /* attached-ports */
2N/A char **sdn_attached_ports;
2N/A int sdn_bridge_ports_n; /* bridge-ports */
2N/A char **sdn_bridge_ports;
2N/A} ses_di_node_t;
2N/A
2N/Atypedef struct ses_enum_target {
2N/A topo_list_t set_link;
2N/A ses_target_t *set_target;
2N/A ses_snap_t *set_snap;
2N/A hrtime_t set_snaptime;
2N/A char *set_devpath;
2N/A int set_refcount;
2N/A pthread_mutex_t set_lock;
2N/A ctid_t set_ctid;
2N/A} ses_enum_target_t;
2N/A
2N/A#ifndef NDEBUG
2N/A#define verify(x) assert(x)
2N/A#else
2N/A#define verify(x) ((void)(x))
2N/A#endif
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _SES_H */