[SCSI] bfa: set correct command return code

For various error conditions the bfa driver just returns
'DID_ERROR', which carries no information at all about the
actual source of error.
This patch updates the error handling to return a correct
error code, depending on the type of error occurred.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
Hannes Reinecke 2014-01-14 10:26:25 +01:00 committed by James Bottomley
parent 10ca149c4a
commit c60b7b121d

View file

@ -73,9 +73,14 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio,
break; break;
case BFI_IOIM_STS_ABORTED:
case BFI_IOIM_STS_TIMEDOUT: case BFI_IOIM_STS_TIMEDOUT:
host_status = DID_TIME_OUT;
cmnd->result = ScsiResult(host_status, 0);
break;
case BFI_IOIM_STS_PATHTOV: case BFI_IOIM_STS_PATHTOV:
host_status = DID_TRANSPORT_DISRUPTED;
cmnd->result = ScsiResult(host_status, 0);
break;
default: default:
host_status = DID_ERROR; host_status = DID_ERROR;
cmnd->result = ScsiResult(host_status, 0); cmnd->result = ScsiResult(host_status, 0);