dadkio.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DKTP_DADKIO_H
#define _SYS_DKTP_DADKIO_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/* direct coupled disk driver ioctl command */
/*
* arg structure for DIOCTL_GETMODEL and DIOCTL_GETSERIAL
* On input to the ioctl, is_size contains the size of the buffer
* pointed to by is_buf;
* On return, is_size contains the number of characters needed to
* represent the string. This may be more than the input value, in
* which case the caller can choose to
* 1. Use the truncated string as is
* 2. Allocate a buffer of is_size+1 bytes to hold the string
*/
#ifdef _SYSCALL32
typedef struct dadk_ioc_string32
{
int is_size; /* string length */
#endif /* _SYSCALL32 */
typedef struct dadk_ioc_string
{
int is_size; /* string length */
/* direct coupled disk driver command */
/* cd-rom commands */
/* driver error code */
#define DERR_SUCCESS 0 /* success */
/*
* atapi additional error codes
*/
/*
* atapi (SCSI) sense key errors
*/
struct dadkio_derr {
int d_action;
int d_severity;
};
/*
* dadkio_rwcmd cmd
*/
/*
* dadkio_rwcmd flags
*/
/* generate any warning */
/* or error console msgs */
#define DADKIO_ERROR_INFO_LEN 128
/*
* dadkio_status status value.
*/
struct dadkio_status {
int status;
int failed_blk_is_valid;
int fru_code_is_valid;
int fru_code;
};
#ifdef _SYSCALL32
struct dadkio_status32 {
int status;
int failed_blk_is_valid;
int fru_code_is_valid;
int fru_code;
};
#endif /* _SYSCALL32 */
/*
*/
struct dadkio_rwcmd {
int cmd;
int flags;
struct dadkio_status status;
};
#ifdef _SYSCALL32
struct dadkio_rwcmd32 {
int cmd;
int flags;
struct dadkio_status32 status;
};
#endif /* _SYSCALL32 */
/*
* dadkio_status status values
*/
#define DADKIO_STAT_NO_ERROR 0 /* cmd was successful */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DKTP_DADKIO_H */