From 21850b4dca6135d6fd9e1aee25f6d76d8ee5f80a Mon Sep 17 00:00:00 2001 From: Stanislaw Gruszka Date: Tue, 8 Apr 2008 06:47:30 +0000 Subject: [PATCH] Pass expected transfer length and direction to SCST for fibre channel devices. Fix bug when using SCST_DATA_UNKNOWN insted of SCST_DATA_NONE. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@331 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla_isp/linux/isp_scst.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/qla_isp/linux/isp_scst.c b/qla_isp/linux/isp_scst.c index 492248a58..648a6afcf 100644 --- a/qla_isp/linux/isp_scst.c +++ b/qla_isp/linux/isp_scst.c @@ -429,20 +429,15 @@ rx_loop: scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED; break; } - - /* - * XXX: For some commands like INQUIRY, SYNCHRONIZE_CACHE, VERIFY, ... - * XXX: we can not get good direction and transfer length values - * XXX: from low level driver. As long as we could not assure - * XXX: proper things, we stop setting exected values for SCST - */ - if (0) { + + if (bp->h.r_type == R_FC) { scst_data_direction dir; int len; - /* bidirectional or no transfer */ - dir = SCST_DATA_UNKNOWN; - if ((tmd->cd_flags & CDF_DATA_OUT) && !(tmd->cd_flags & CDF_DATA_IN)) { + dir = SCST_DATA_NONE; + if (tmd->cd_flags & CDF_BIDIR) { + dir = SCST_DATA_UNKNOWN; + } else if (tmd->cd_flags & CDF_DATA_OUT) { dir = SCST_DATA_WRITE; } else if (tmd->cd_flags & CDF_DATA_IN) { dir = SCST_DATA_READ;