aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2012-12-17 03:53:33 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2013-01-10 23:06:08 -0500
commitba829137bfd167623363548aa385be769c6b2664 (patch)
tree27d8f1896ec608476bd7b94edfdcd5d82a72e46e
parent18a9df42d53fabfa43b78be1104838cc8b9762e1 (diff)
target: Introduce TCM_NO_SENSE
Introduce TCM_NO_SENSE, mapping to sense code 'Not ready, no additional sense information'. Signed-off-by: Hannes Reinecke <hare@suse.de> Cc: Nicholas Bellinger <nab@risingtidesystems.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/target/target_core_transport.c10
-rw-r--r--include/target/target_core_base.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 978762dc81bf..104bf3b45a01 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2597,6 +2597,16 @@ transport_send_check_condition_and_sense(struct se_cmd *cmd,
2597 * SENSE KEY values from include/scsi/scsi.h 2597 * SENSE KEY values from include/scsi/scsi.h
2598 */ 2598 */
2599 switch (reason) { 2599 switch (reason) {
2600 case TCM_NO_SENSE:
2601 /* CURRENT ERROR */
2602 buffer[0] = 0x70;
2603 buffer[SPC_ADD_SENSE_LEN_OFFSET] = 10;
2604 /* Not Ready */
2605 buffer[SPC_SENSE_KEY_OFFSET] = NOT_READY;
2606 /* NO ADDITIONAL SENSE INFORMATION */
2607 buffer[SPC_ASC_KEY_OFFSET] = 0;
2608 buffer[SPC_ASCQ_KEY_OFFSET] = 0;
2609 break;
2600 case TCM_NON_EXISTENT_LUN: 2610 case TCM_NON_EXISTENT_LUN:
2601 /* CURRENT ERROR */ 2611 /* CURRENT ERROR */
2602 buffer[0] = 0x70; 2612 buffer[0] = 0x70;
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 7cae2360221e..663e34a5383f 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -174,6 +174,7 @@ typedef unsigned __bitwise__ sense_reason_t;
174 174
175enum tcm_sense_reason_table { 175enum tcm_sense_reason_table {
176#define R(x) (__force sense_reason_t )(x) 176#define R(x) (__force sense_reason_t )(x)
177 TCM_NO_SENSE = R(0x00),
177 TCM_NON_EXISTENT_LUN = R(0x01), 178 TCM_NON_EXISTENT_LUN = R(0x01),
178 TCM_UNSUPPORTED_SCSI_OPCODE = R(0x02), 179 TCM_UNSUPPORTED_SCSI_OPCODE = R(0x02),
179 TCM_INCORRECT_AMOUNT_OF_DATA = R(0x03), 180 TCM_INCORRECT_AMOUNT_OF_DATA = R(0x03),