aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ibmvscsi
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2008-04-25 17:58:29 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-29 20:42:32 -0400
commitc3a3b55ae80a0d595445064159c69f8e80911e85 (patch)
tree34ee20d6ab5b3624bb0a3d6d4749314cf1e8d079 /drivers/scsi/ibmvscsi
parent61d7416a286e840d905c18b1e6b0977c036c8656 (diff)
[SCSI] ibmvscsi: Handle non SCSI error status
Adds support to the ibmvscsi driver to handle non SCSI error status. This is needed to support some new VIOS enhancements. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: Santiago Leon <santil@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/ibmvscsi')
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c5
-rw-r--r--drivers/scsi/ibmvscsi/viosrp.h9
2 files changed, 13 insertions, 1 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 4a922c57125e..9c77015b7a80 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -686,7 +686,7 @@ static void handle_cmd_rsp(struct srp_event_struct *evt_struct)
686 } 686 }
687 687
688 if (cmnd) { 688 if (cmnd) {
689 cmnd->result = rsp->status; 689 cmnd->result |= rsp->status;
690 if (((cmnd->result >> 1) & 0x1f) == CHECK_CONDITION) 690 if (((cmnd->result >> 1) & 0x1f) == CHECK_CONDITION)
691 memcpy(cmnd->sense_buffer, 691 memcpy(cmnd->sense_buffer,
692 rsp->data, 692 rsp->data,
@@ -730,6 +730,7 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd,
730 u16 lun = lun_from_dev(cmnd->device); 730 u16 lun = lun_from_dev(cmnd->device);
731 u8 out_fmt, in_fmt; 731 u8 out_fmt, in_fmt;
732 732
733 cmnd->result = (DID_OK << 16);
733 evt_struct = get_event_struct(&hostdata->pool); 734 evt_struct = get_event_struct(&hostdata->pool);
734 if (!evt_struct) 735 if (!evt_struct)
735 return SCSI_MLQUEUE_HOST_BUSY; 736 return SCSI_MLQUEUE_HOST_BUSY;
@@ -1347,6 +1348,8 @@ void ibmvscsi_handle_crq(struct viosrp_crq *crq,
1347 1348
1348 del_timer(&evt_struct->timer); 1349 del_timer(&evt_struct->timer);
1349 1350
1351 if (crq->status != VIOSRP_OK && evt_struct->cmnd)
1352 evt_struct->cmnd->result = DID_ERROR << 16;
1350 if (evt_struct->done) 1353 if (evt_struct->done)
1351 evt_struct->done(evt_struct); 1354 evt_struct->done(evt_struct);
1352 else 1355 else
diff --git a/drivers/scsi/ibmvscsi/viosrp.h b/drivers/scsi/ibmvscsi/viosrp.h
index 90f1a61283ad..4c4aadb3e405 100644
--- a/drivers/scsi/ibmvscsi/viosrp.h
+++ b/drivers/scsi/ibmvscsi/viosrp.h
@@ -59,6 +59,15 @@ enum viosrp_crq_formats {
59 VIOSRP_INLINE_FORMAT = 0x07 59 VIOSRP_INLINE_FORMAT = 0x07
60}; 60};
61 61
62enum viosrp_crq_status {
63 VIOSRP_OK = 0x0,
64 VIOSRP_NONRECOVERABLE_ERR = 0x1,
65 VIOSRP_VIOLATES_MAX_XFER = 0x2,
66 VIOSRP_PARTNER_PANIC = 0x3,
67 VIOSRP_DEVICE_BUSY = 0x8,
68 VIOSRP_ADAPTER_FAIL = 0x10
69};
70
62struct viosrp_crq { 71struct viosrp_crq {
63 u8 valid; /* used by RPA */ 72 u8 valid; /* used by RPA */
64 u8 format; /* SCSI vs out-of-band */ 73 u8 format; /* SCSI vs out-of-band */