xref: /illumos-gate/usr/src/cmd/fm/modules/common/disk-monitor/dm_types.h (revision 2a8bcb4efb45d99ac41c94a75c396b362c414f7f)
1 /*
2  * CDDL HEADER START
3  *
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.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _DM_TYPES_H
28 #define	_DM_TYPES_H
29 
30 /*
31  * Common types for the disk monitor
32  */
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 #include <sys/types.h>
39 
40 #define	NSEC_PER_POLL_POSITION	250000000UL	/* 0.25 of a second */
41 
42 typedef enum {
43 	HPS_UNKNOWN		= 0x0000,
44 	HPS_ABSENT		= 0x0001,
45 	HPS_PRESENT		= 0x0002,
46 	HPS_UNCONFIGURED	= 0x0003,
47 	HPS_CONFIGURED		= 0x0004,
48 	HPS_FAULTED		= 0x1000,	/* This state can be OR'ed in */
49 	HPS_REPAIRED		= 0x2000
50 } hotplug_state_t;
51 
52 typedef struct {
53 	/*
54 	 * Each field is the size of the corresponding field in the scsi
55 	 * inquiry structure + 1 byte for the terminating NUL.
56 	 */
57 	char		manuf[9];	/* 8 characters */
58 	char		model[33];	/* 32 characters to fo ATA ident$ */
59 	char		rev[9];		/* 8 characters */
60 	/*
61 	 * SCSI Serial number is 12 bytes from the main INQUIRY
62 	 * page, but it may be longer in the Unit Serial Number
63 	 * VPD page, so save space for up to 20 bytes of it (ATA
64 	 * serial numbers may be up to 20-bytes long).
65 	 */
66 	char		serial[21];
67 	uint64_t	size_in_bytes;
68 } dm_fru_t;
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* _DM_TYPES_H */
75