[RFC 5/6] target/cdb: Do not support command queues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



UAS supports command queues only if running in SuperSpeed aka USB3.0. If
the device is connected at USB2.0 speed aka HighSpeed command queuing is
not supported.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
---
 drivers/target/target_core_cdb.c    |    9 ++++++++-
 include/target/target_core_fabric.h |    5 +++++
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c
index 957fac7..11c538d 100644
--- a/drivers/target/target_core_cdb.c
+++ b/drivers/target/target_core_cdb.c
@@ -73,6 +73,7 @@ target_emulate_inquiry_std(struct se_cmd *cmd)
 	struct se_device *dev = cmd->se_dev;
 	struct se_portal_group *tpg = lun->lun_sep->sep_tpg;
 	unsigned char *buf;
+	u32 cmd_queue;
 
 	/*
 	 * Make sure we at least have 6 bytes of INQUIRY response
@@ -106,8 +107,14 @@ target_emulate_inquiry_std(struct se_cmd *cmd)
 		goto out;
 	}
 
-	buf[7] = 0x32; /* Sync=1 and CmdQue=1 */
+	if (tpg->se_tpg_tfo->cmd_queue_supported)
+		cmd_queue = tpg->se_tpg_tfo->cmd_queue_supported(cmd);
+	else
+		cmd_queue = 1;
 
+	buf[7] = 0x30; /* WBUS16=1, Sync=1 */
+	if (cmd_queue)
+		buf[7] |= 0x02; /* CmdQue */
 	/*
 	 * Do not include vendor, product, reversion info in INQUIRY
 	 * response payload for cdbs with a small allocation length.
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index d035d86..0511bdf 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -45,6 +45,11 @@ struct target_core_fabric_ops {
 	 */
 	int (*new_cmd_map)(struct se_cmd *);
 	/*
+	 * Optional function pointer for TCM to check if command queueing is
+	 * supported. This affects the INQUIRY command. Default is yes.
+	 */
+	int (*cmd_queue_supported)(struct se_cmd *);
+	/*
 	 * Optional to release struct se_cmd and fabric dependent allocated
 	 * I/O descriptor in transport_cmd_check_stop().
 	 *
-- 
1.7.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux