From: Hannes Reinecke <hare@suse.de>
Date: Mon, 17 Oct 2011 09:31:00 +0200
Subject: bfa: set correct command return code
References: bnc#721874
Patch-Mainline: not yet

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>

diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index eb3824c..fbcb0c6 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -71,9 +71,14 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio,
 
 		break;
 
-	case BFI_IOIM_STS_ABORTED:
 	case BFI_IOIM_STS_TIMEDOUT:
+		host_status = DID_TIME_OUT;
+		cmnd->result = ScsiResult(host_status, 0);
+		break;
 	case BFI_IOIM_STS_PATHTOV:
+		host_status = DID_TRANSPORT_DISRUPTED;
+		cmnd->result = ScsiResult(host_status, 0);
+		break;
 	default:
 		host_status = DID_ERROR;
 		cmnd->result = ScsiResult(host_status, 0);
