From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoX92-00060Z-R4 for qemu-devel@nongnu.org; Wed, 03 Aug 2011 04:49:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QoX8z-0003jH-Ut for qemu-devel@nongnu.org; Wed, 03 Aug 2011 04:49:40 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:65424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoX8z-0003g9-Kp for qemu-devel@nongnu.org; Wed, 03 Aug 2011 04:49:37 -0400 Received: by mail-wy0-f173.google.com with SMTP id 20so154364wye.4 for ; Wed, 03 Aug 2011 01:49:37 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 3 Aug 2011 10:49:16 +0200 Message-Id: <1312361359-15445-14-git-send-email-pbonzini@redhat.com> In-Reply-To: <1312361359-15445-1-git-send-email-pbonzini@redhat.com> References: <1312361359-15445-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 13/16] scsi: add a bunch more common sense codes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Paolo Bonzini --- hw/scsi-bus.c | 30 ++++++++++++++++++++++++++++++ hw/scsi.h | 12 ++++++++++++ 2 files changed, 42 insertions(+), 0 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index fbb9801..0e2e4cd 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -698,6 +698,16 @@ const struct SCSISense sense_code_LUN_NOT_SUPPORTED = { .key = ILLEGAL_REQUEST, .asc = 0x25, .ascq = 0x00 }; +/* Illegal request, Saving parameters not supported */ +const struct SCSISense sense_code_SAVING_PARAMS_NOT_SUPPORTED = { + .key = ILLEGAL_REQUEST, .asc = 0x39, .ascq = 0x00 +}; + +/* Illegal request, Incompatible medium installed */ +const struct SCSISense sense_code_INCOMPATIBLE_MEDIUM = { + .key = ILLEGAL_REQUEST, .asc = 0x30, .ascq = 0x00 +}; + /* Command aborted, I/O process terminated */ const struct SCSISense sense_code_IO_ERROR = { .key = ABORTED_COMMAND, .asc = 0x00, .ascq = 0x06 @@ -713,6 +723,26 @@ const struct SCSISense sense_code_LUN_FAILURE = { .key = ABORTED_COMMAND, .asc = 0x3e, .ascq = 0x01 }; +/* Unit attention, Power on, reset or bus device reset occurred */ +const struct SCSISense sense_code_RESET = { + .key = UNIT_ATTENTION, .asc = 0x29, .ascq = 0x00 +}; + +/* Unit attention, Medium may have changed */ +const struct SCSISense sense_code_MEDIUM_CHANGED = { + .key = UNIT_ATTENTION, .asc = 0x28, .ascq = 0x00 +}; + +/* Unit attention, Reported LUNs data has changed */ +const struct SCSISense sense_code_REPORTED_LUNS_CHANGED = { + .key = UNIT_ATTENTION, .asc = 0x3f, .ascq = 0x0e +}; + +/* Unit attention, Device internal reset */ +const struct SCSISense sense_code_DEVICE_INTERNAL_RESET = { + .key = UNIT_ATTENTION, .asc = 0x29, .ascq = 0x04 +}; + /* * scsi_build_sense * diff --git a/hw/scsi.h b/hw/scsi.h index dec814a..4d5b596 100644 --- a/hw/scsi.h +++ b/hw/scsi.h @@ -144,12 +144,24 @@ extern const struct SCSISense sense_code_LBA_OUT_OF_RANGE; extern const struct SCSISense sense_code_INVALID_FIELD; /* Illegal request, LUN not supported */ extern const struct SCSISense sense_code_LUN_NOT_SUPPORTED; +/* Illegal request, Saving parameters not supported */ +extern const struct SCSISense sense_code_SAVING_PARAMS_NOT_SUPPORTED; +/* Illegal request, Incompatible format */ +extern const struct SCSISense sense_code_INCOMPATIBLE_FORMAT; /* Command aborted, I/O process terminated */ extern const struct SCSISense sense_code_IO_ERROR; /* Command aborted, I_T Nexus loss occurred */ extern const struct SCSISense sense_code_I_T_NEXUS_LOSS; /* Command aborted, Logical Unit failure */ extern const struct SCSISense sense_code_LUN_FAILURE; +/* Unit attention, Power on, reset or bus device reset occurred */ +extern const struct SCSISense sense_code_RESET; +/* Unit attention, Medium may have changed*/ +extern const struct SCSISense sense_code_MEDIUM_CHANGED; +/* Unit attention, Reported LUNs data has changed */ +extern const struct SCSISense sense_code_REPORTED_LUNS_CHANGED; +/* Unit attention, Device internal reset */ +extern const struct SCSISense sense_code_DEVICE_INTERNAL_RESET; #define SENSE_CODE(x) sense_code_ ## x -- 1.7.6