Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c60b7b12 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by James Bottomley
Browse files

[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: default avatarHannes Reinecke <hare@suse.de>
Acked-by: default avatarVijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 10ca149c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -73,9 +73,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);