1724365f7Ssethg /*
2724365f7Ssethg  * CDDL HEADER START
3724365f7Ssethg  *
4724365f7Ssethg  * The contents of this file are subject to the terms of the
5724365f7Ssethg  * Common Development and Distribution License (the "License").
6724365f7Ssethg  * You may not use this file except in compliance with the License.
7724365f7Ssethg  *
8724365f7Ssethg  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9724365f7Ssethg  * or http://www.opensolaris.org/os/licensing.
10724365f7Ssethg  * See the License for the specific language governing permissions
11724365f7Ssethg  * and limitations under the License.
12724365f7Ssethg  *
13724365f7Ssethg  * When distributing Covered Code, include this CDDL HEADER in each
14724365f7Ssethg  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15724365f7Ssethg  * If applicable, add the following below this CDDL HEADER, with the
16724365f7Ssethg  * fields enclosed by brackets "[]" replaced with your own identifying
17724365f7Ssethg  * information: Portions Copyright [yyyy] [name of copyright owner]
18724365f7Ssethg  *
19724365f7Ssethg  * CDDL HEADER END
20724365f7Ssethg  */
21724365f7Ssethg 
22724365f7Ssethg /*
23724365f7Ssethg  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24724365f7Ssethg  * Use is subject to license terms.
25724365f7Ssethg  */
26724365f7Ssethg 
27724365f7Ssethg #ifndef _DM_TYPES_H
28724365f7Ssethg #define	_DM_TYPES_H
29724365f7Ssethg 
30724365f7Ssethg /*
31724365f7Ssethg  * Common types for the disk monitor
32724365f7Ssethg  */
33724365f7Ssethg 
34724365f7Ssethg #ifdef __cplusplus
35724365f7Ssethg extern "C" {
36724365f7Ssethg #endif
37724365f7Ssethg 
38724365f7Ssethg #include <sys/types.h>
39724365f7Ssethg 
40724365f7Ssethg #define	NSEC_PER_POLL_POSITION	250000000UL	/* 0.25 of a second */
41724365f7Ssethg 
42724365f7Ssethg typedef enum {
43724365f7Ssethg 	HPS_UNKNOWN		= 0x0000,
44724365f7Ssethg 	HPS_ABSENT		= 0x0001,
45724365f7Ssethg 	HPS_PRESENT		= 0x0002,
46724365f7Ssethg 	HPS_UNCONFIGURED	= 0x0003,
47724365f7Ssethg 	HPS_CONFIGURED		= 0x0004,
48724365f7Ssethg 	HPS_FAULTED		= 0x1000,	/* This state can be OR'ed in */
49724365f7Ssethg 	HPS_REPAIRED		= 0x2000
50724365f7Ssethg } hotplug_state_t;
51724365f7Ssethg 
52724365f7Ssethg typedef struct {
53724365f7Ssethg 	/*
54724365f7Ssethg 	 * Each field is the size of the corresponding field in the scsi
55724365f7Ssethg 	 * inquiry structure + 1 byte for the terminating NUL.
56724365f7Ssethg 	 */
57724365f7Ssethg 	char		manuf[9];	/* 8 characters */
58724365f7Ssethg 	char		model[33];	/* 32 characters to fo ATA ident$ */
59724365f7Ssethg 	char		rev[9];		/* 8 characters */
60724365f7Ssethg 	/*
61724365f7Ssethg 	 * SCSI Serial number is 12 bytes from the main INQUIRY
62724365f7Ssethg 	 * page, but it may be longer in the Unit Serial Number
63724365f7Ssethg 	 * VPD page, so save space for up to 20 bytes of it (ATA
64724365f7Ssethg 	 * serial numbers may be up to 20-bytes long).
65724365f7Ssethg 	 */
66724365f7Ssethg 	char		serial[21];
67724365f7Ssethg 	uint64_t	size_in_bytes;
68724365f7Ssethg } dm_fru_t;
69724365f7Ssethg 
70724365f7Ssethg #ifdef __cplusplus
71724365f7Ssethg }
72724365f7Ssethg #endif
73724365f7Ssethg 
74724365f7Ssethg #endif /* _DM_TYPES_H */
75