mms_scsi.h revision cee0fb94c0d4227de0a00efc162fb2739844b641
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws/*
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * CDDL HEADER START
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws *
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * The contents of this file are subject to the terms of the
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * Common Development and Distribution License (the "License").
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * You may not use this file except in compliance with the License.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws *
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * or http://www.opensolaris.org/os/licensing.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * See the License for the specific language governing permissions
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * and limitations under the License.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws *
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * When distributing Covered Code, include this CDDL HEADER in each
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * If applicable, add the following below this CDDL HEADER, with the
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * fields enclosed by brackets "[]" replaced with your own identifying
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * information: Portions Copyright [yyyy] [name of copyright owner]
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws *
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * CDDL HEADER END
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws *
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws * Use is subject to license terms.
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws */
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#ifndef __MMS_SCSI_H
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#define __MMS_SCSI_H
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#include <sys/list.h>
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mws#ifdef __cplusplus
84ab085a13f931bc78e7415e7ce921dbaa14fcb3mwsextern "C" {
#endif
#define MMS_MAX_CDB_LEN 32 /* max cdb length (bytes) */
#define MMS_SENSEKEY(sen) ((sen)[2] & 0x0f)
#define MMS_ASC(sen) ((sen)[12])
#define MMS_ASCQ(sen) ((sen)[13])
typedef struct mms_skey_specific {
#if defined(_BIT_FIELDS_HTOL)
uchar_t mms_sksv : 1, /* SKV */
mms_cd : 1, /* cmd / data */
mms_reserved : 2,
mms_bpv : 1,
mms_bitptr : 3; /* bit pointer */
#elif defined(_BIT_FIELDS_LTOH)
uchar_t mms_bitptr : 3, /* bit pointer */
mms_bpv : 1,
mms_reserved : 2,
mms_cd : 1, /* cmd / data */
mms_sksv : 1; /* SKV */
#else
#error One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined
#endif
uchar_t mms_fp[2]; /* field pointer */
} mms_skey_specific_t;
char *mms_scsi_cmd(int cmd);
char *mms_scsi_status(int stat);
char *mms_scsi_sensekey(int senkey);
char *mms_scsi_asc(int asc);
char *mms_scsi_ascq(int ascq);
char *mms_format_sense(struct scsi_extended_sense *sen);
#ifdef __cplusplus
}
#endif
#endif /* __MMS_SCSI_H */