4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1991,1997-1998 by Sun Microsystems, Inc.
24 * All rights reserved.
30 #pragma ident "%Z%%M% %I% %E% SMI"
37 * Used for generic commands
40 ushort_t hdkc_cmd
; /* command to be executed */
41 int hdkc_flags
; /* execution flags */
42 daddr_t hdkc_blkno
; /* disk address for command */
43 int hdkc_secnt
; /* sector count for command */
44 caddr_t hdkc_bufaddr
; /* user's buffer address */
45 uint_t hdkc_buflen
; /* size of user's buffer */
52 ushort_t hdkt_hsect
; /* hard sector count (read only) */
53 ushort_t hdkt_promrev
; /* prom revision (read only) */
54 uchar_t hdkt_drtype
; /* drive type (ctlr specific) */
55 uchar_t hdkt_drstat
; /* drive status (ctlr specific, ro) */
59 * Used for bad sector map
62 caddr_t hdkb_bufaddr
; /* address of user's map buffer */
68 #define HDK_SILENT 0x01 /* no error messages */
69 #define HDK_DIAGNOSE 0x02 /* fail if any error occurs */
70 #define HDK_ISOLATE 0x04 /* isolate from normal commands */
71 #define HDK_READ 0x08 /* read from device */
72 #define HDK_WRITE 0x10 /* write to device */
73 #define HDK_KBUF 0x20 /* write to device */
76 * Used for disk diagnostics
79 ushort_t hdkd_errcmd
; /* most recent command in error */
80 daddr_t hdkd_errsect
; /* most recent sector in error */
81 uchar_t hdkd_errno
; /* most recent error number */
82 uchar_t hdkd_severe
; /* severity of most recent error */
86 * Used for getting disk error log.
89 long hdkl_entries
; /* number of dk_log entries */
90 long hdkl_max_size
; /* max. size of dk_log table */
91 caddr_t hdkl_logbfr
; /* pointer to dk_log table */
95 * Disk error log table entry.
98 daddr_t hdkl_block
; /* location of block in error */
99 ulong_t hdkl_count
; /* number of failures */
100 short hdkl_type
; /* type of error (e.g. soft error) */
101 short hdkl_err1
; /* primary error code (e.g sense key) */
102 short hdkl_err2
; /* secondary error code */
108 * FIXME: Really should specify dkd_errno error codes.
109 * For some reason they're specified in the drivers
110 * instead of here?? Should also use those here for
113 #define HDKL_SOFT 0x01 /* recoverable erro */
114 #define HDKL_HARD 0x02 /* unrecoverable error */
119 #define HDK_NOERROR 0
120 #define HDK_CORRECTED 1
121 #define HDK_RECOVERED 2
127 #define HDK_NONMEDIA 0 /* not caused by a media defect */
128 #define HDK_ISMEDIA 1 /* caused by a media defect */
131 #define HDIOC (0x04 << 8)
132 #define HDKIOCSTYPE (HDIOC|101) /* Set drive info */
133 #define HDKIOCGTYPE (HDIOC|102) /* Get drive info */
134 #define HDKIOCSBAD (HDIOC|103) /* Set bad sector map */
135 #define HDKIOCGBAD (HDIOC|104) /* Get bad sector map */
136 #define HDKIOCSCMD (HDIOC|105) /* Set generic cmd */
137 #define HDKIOCGDIAG (HDIOC|106) /* Get diagnostics */
143 #endif /* _SYS_HDIO_H */