import less(1)
[unleashed/tickless.git] / usr / src / lib / fm / libdiskstatus / common / ds_impl.h
blob34f8b15d75667084d9cf586739b2eaaefcfd47e2
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _DS_IMPL_H
27 #define _DS_IMPL_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <dlfcn.h>
32 #include <libnvpair.h>
33 #include <sys/types.h>
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
39 struct disk_status;
41 typedef struct ds_transport {
42 void *(*dt_open)(struct disk_status *);
43 void (*dt_close)(void *);
44 int (*dt_scan)(void *);
45 } ds_transport_t;
47 struct disk_status {
48 char *ds_path; /* path to device */
49 int ds_fd; /* device file descriptor */
50 ds_transport_t *ds_transport; /* associated transport */
51 void *ds_data; /* transport-specific data */
52 int ds_faults; /* mask of current faults */
53 nvlist_t *ds_overtemp; /* overtemp */
54 nvlist_t *ds_predfail; /* predict fail */
55 nvlist_t *ds_testfail; /* self test fail */
56 int ds_error; /* last error */
57 nvlist_t *ds_state; /* protocol state */
60 #define DS_FAULT_OVERTEMP 0x1
61 #define DS_FAULT_PREDFAIL 0x2
62 #define DS_FAULT_TESTFAIL 0x4
64 extern void dprintf(const char *, ...);
65 extern void ddump(const char *, const void *, size_t);
66 extern boolean_t ds_debug;
68 extern int ds_set_errno(struct disk_status *, int);
70 #ifdef __cplusplus
72 #endif
74 #endif /* _DS_IMPL_H */