From 8f98cf3e128c8770fa0f1274a15fc046a2e23ff5 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 19 Sep 2012 18:23:54 -0700 Subject: [PATCH] INQUIRY: When alloc_len is set to 0 we should set XFER direction to NONOE, not READ --- lib/scsi-lowlevel.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/scsi-lowlevel.c b/lib/scsi-lowlevel.c index 56a66d6..ccad570 100644 --- a/lib/scsi-lowlevel.c +++ b/lib/scsi-lowlevel.c @@ -420,7 +420,11 @@ scsi_cdb_inquiry(int evpd, int page_code, int alloc_len) *(uint16_t *)&task->cdb[3] = htons(alloc_len); task->cdb_size = 6; - task->xfer_dir = SCSI_XFER_READ; + if (alloc_len > 0) { + task->xfer_dir = SCSI_XFER_READ; + } else { + task->xfer_dir = SCSI_XFER_NONE; + } task->expxferlen = alloc_len; task->params.inquiry.evpd = evpd;