mms_scsi.c revision cee0fb94c0d4227de0a00efc162fb2739844b641
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <stdlib.h>
#include <mms_sym.h>
#include <mms_scsi.h>
#include <mms_strapp.h>
static mms_sym_t mms_scsi_cmd_tab[] = {
/* 0x0B */
/* 0x10 */
/* 0x1B */
NULL, -1,
};
static mms_sym_t mms_scsi_status_tab[] = {
"GOOD", STATUS_GOOD,
"CHECK", STATUS_CHECK,
"CONDITION MET", STATUS_MET,
"BUSY", STATUS_BUSY,
"INTERMEDIATE", STATUS_INTERMEDIATE,
"INTERMEDIATE MET", STATUS_INTERMEDIATE_MET,
"RESERVATION CONFLICT", STATUS_RESERVATION_CONFLICT,
"TERMINATED", STATUS_TERMINATED,
NULL, -1,
};
static mms_sym_t mms_scsi_senkey_tab[] = {
"NO SENSE", KEY_NO_SENSE,
"RECOVERABLE MMS_ERROR", KEY_RECOVERABLE_ERROR,
"NOT READY", KEY_NOT_READY,
"MEDIUM MMS_ERROR", KEY_MEDIUM_ERROR,
"HARDWARE MMS_ERROR", KEY_HARDWARE_ERROR,
"ILLEGAL REQUEST", KEY_ILLEGAL_REQUEST,
"UNIT ATTENTION", KEY_UNIT_ATTENTION,
"WRITE PROTECT", KEY_WRITE_PROTECT,
"DATA PROTECT", KEY_DATA_PROTECT,
"BLANK CHECK", KEY_BLANK_CHECK,
"VENDOR UNIQUE", KEY_VENDOR_UNIQUE,
"COPY ABORTED", KEY_COPY_ABORTED,
"ABORTED COMMAND", KEY_ABORTED_COMMAND,
"EQUAL", KEY_EQUAL,
"VOLUME OVERFLOW", KEY_VOLUME_OVERFLOW,
"MISCOMPARE", KEY_MISCOMPARE,
"RESERVED", KEY_RESERVED,
/*
* The following are SUN keys
*/
"SUN FATAL", SUN_KEY_FATAL,
"SUN TIMEOUT", SUN_KEY_TIMEOUT,
"SUN EOF", SUN_KEY_EOF,
"SUN EOT", SUN_KEY_EOT,
"SUN LENGTH MMS_ERROR", SUN_KEY_LENGTH,
"SUN BOT", SUN_KEY_BOT,
"SUN WRONG MEDIA", SUN_KEY_WRONGMEDIA,
NULL, -1,
};
static char *
{
static char hexcode[10];
}
}
return (hexcode);
}
char *
mms_scsi_cmd(int cmd)
{
}
char *
mms_scsi_status(int stat)
{
}
char *
mms_scsi_sensekey(int senkey)
{
}
char *
mms_scsi_asc(int asc)
{
static char buf[10];
return (buf);
}
char *
mms_scsi_ascq(int ascq)
{
static char buf[10];
return (buf);
}
char *
{
char *buf;
"valid=%x, resp code=%2.2x, seg num=%2.2x, "
"filemark=%x, eom=%x, ili=%x, sen key=%x, "
"info=%8.8x, add len=%2.2x, cmd info=%8.8x, "
"asc=%2.2x, ascq=%2.2x, fruc=%2.2x, "
"SKSV=%x, C/D=%x, BPV=%x, bit ptr=%x, field ptr=%4.4x",
return (buf);
}