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 * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _DS_IMPL_H
2N/A#define _DS_IMPL_H
2N/A
2N/A#include <dlfcn.h>
2N/A#include <libnvpair.h>
2N/A#include <sys/types.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/Astruct disk_status;
2N/A
2N/Atypedef struct ds_transport {
2N/A void *(*dt_open)(struct disk_status *);
2N/A void (*dt_close)(void *);
2N/A int (*dt_scan)(void *);
2N/A} ds_transport_t;
2N/A
2N/Astruct disk_status {
2N/A char *ds_path; /* path to device */
2N/A int ds_fd; /* device file descriptor */
2N/A ds_transport_t *ds_transport; /* associated transport */
2N/A void *ds_data; /* transport-specific data */
2N/A int ds_faults; /* mask of current faults */
2N/A nvlist_t *ds_overtemp; /* overtemp */
2N/A nvlist_t *ds_predfail; /* predict fail */
2N/A nvlist_t *ds_testfail; /* self test fail */
2N/A int ds_error; /* last error */
2N/A nvlist_t *ds_state; /* protocol state */
2N/A int ds_test_mask;
2N/A boolean_t ds_skip_update;
2N/A};
2N/A
2N/A#define DS_FAULT_OVERTEMP 0x1
2N/A#define DS_FAULT_PREDFAIL 0x2
2N/A#define DS_FAULT_TESTFAIL 0x4
2N/A
2N/Aextern void dprintf(const char *, ...);
2N/Aextern void ddump(const char *, const void *, size_t);
2N/Aextern boolean_t ds_debug;
2N/A
2N/Aextern int ds_set_errno(struct disk_status *, int);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _DS_IMPL_H */