dadkio.h (161b8835) dadkio.h (342440ec)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
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, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 *
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.
13 *
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]
19 *
20 * CDDL HEADER END
21 */
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/*
22/*
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#ifndef _SYS_DKTP_DADKIO_H
28#define _SYS_DKTP_DADKIO_H
29
24 * Use is subject to license terms.
25 */
26
27#ifndef _SYS_DKTP_DADKIO_H
28#define _SYS_DKTP_DADKIO_H
29
30#pragma ident "%Z%%M% %I% %E% SMI"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36/* direct coupled disk driver ioctl command */
37#define DIOCTL_GETGEOM 1 /* get logical disk geometry */
38#define DIOCTL_GETPHYGEOM 2 /* get physical disk geometry */
39#define DIOCTL_GETMODEL 3 /* get model number */
40#define DIOCTL_GETSERIAL 4 /* get serial number */
41#define DIOCTL_RWCMD 5 /* read/write a disk */
42#define DIOCTL_GETWCE 6 /* get write cache enabled state */
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/* direct coupled disk driver ioctl command */
35#define DIOCTL_GETGEOM 1 /* get logical disk geometry */
36#define DIOCTL_GETPHYGEOM 2 /* get physical disk geometry */
37#define DIOCTL_GETMODEL 3 /* get model number */
38#define DIOCTL_GETSERIAL 4 /* get serial number */
39#define DIOCTL_RWCMD 5 /* read/write a disk */
40#define DIOCTL_GETWCE 6 /* get write cache enabled state */
41
42#if !defined(BLKADDR_TYPE)
43#define BLKADDR_TYPE
44#if defined(_EXTVTOC)
45typedef unsigned long blkaddr_t;
46typedef unsigned int blkaddr32_t;
47#else
48typedef daddr_t blkaddr_t;
49typedef daddr32_t blkaddr32_t;
50#endif
51#endif
52
43/*
44 * arg structure for DIOCTL_GETMODEL and DIOCTL_GETSERIAL
45 * On input to the ioctl, is_size contains the size of the buffer
46 * pointed to by is_buf;
47 * On return, is_size contains the number of characters needed to
48 * represent the string. This may be more than the input value, in
49 * which case the caller can choose to
50 * 1. Use the truncated string as is

--- 102 unchanged lines hidden (view full) ---

153
154/*
155 * dadkio_status status value.
156 */
157struct dadkio_status {
158 int status;
159 ulong_t resid;
160 int failed_blk_is_valid;
53/*
54 * arg structure for DIOCTL_GETMODEL and DIOCTL_GETSERIAL
55 * On input to the ioctl, is_size contains the size of the buffer
56 * pointed to by is_buf;
57 * On return, is_size contains the number of characters needed to
58 * represent the string. This may be more than the input value, in
59 * which case the caller can choose to
60 * 1. Use the truncated string as is

--- 102 unchanged lines hidden (view full) ---

163
164/*
165 * dadkio_status status value.
166 */
167struct dadkio_status {
168 int status;
169 ulong_t resid;
170 int failed_blk_is_valid;
161 daddr_t failed_blk;
171 blkaddr_t failed_blk;
162 int fru_code_is_valid;
163 int fru_code;
164 char add_error_info[DADKIO_ERROR_INFO_LEN];
165};
166
167#ifdef _SYSCALL32
168struct dadkio_status32 {
169 int status;
170 uint32_t resid;
171 int failed_blk_is_valid;
172 int fru_code_is_valid;
173 int fru_code;
174 char add_error_info[DADKIO_ERROR_INFO_LEN];
175};
176
177#ifdef _SYSCALL32
178struct dadkio_status32 {
179 int status;
180 uint32_t resid;
181 int failed_blk_is_valid;
172 daddr32_t failed_blk;
182 blkaddr32_t failed_blk;
173 int fru_code_is_valid;
174 int fru_code;
175 char add_error_info[DADKIO_ERROR_INFO_LEN];
176};
177#endif /* _SYSCALL32 */
178
179/*
180 * Used by read/write ioctl (DKIOCTL_RWCMD)
181 */
182struct dadkio_rwcmd {
183 int cmd;
184 int flags;
183 int fru_code_is_valid;
184 int fru_code;
185 char add_error_info[DADKIO_ERROR_INFO_LEN];
186};
187#endif /* _SYSCALL32 */
188
189/*
190 * Used by read/write ioctl (DKIOCTL_RWCMD)
191 */
192struct dadkio_rwcmd {
193 int cmd;
194 int flags;
185 daddr_t blkaddr;
195 blkaddr_t blkaddr;
186 uint_t buflen;
187 caddr_t bufaddr;
188 struct dadkio_status status;
189};
190
191#ifdef _SYSCALL32
192struct dadkio_rwcmd32 {
193 int cmd;
194 int flags;
196 uint_t buflen;
197 caddr_t bufaddr;
198 struct dadkio_status status;
199};
200
201#ifdef _SYSCALL32
202struct dadkio_rwcmd32 {
203 int cmd;
204 int flags;
195 daddr32_t blkaddr;
205 blkaddr32_t blkaddr;
196 uint_t buflen;
197 caddr32_t bufaddr;
198 struct dadkio_status32 status;
199};
200#endif /* _SYSCALL32 */
201
202/*
203 * dadkio_status status values

--- 23 unchanged lines hidden ---
206 uint_t buflen;
207 caddr32_t bufaddr;
208 struct dadkio_status32 status;
209};
210#endif /* _SYSCALL32 */
211
212/*
213 * dadkio_status status values

--- 23 unchanged lines hidden ---