public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tmscsim: implement change_queue_depth
@ 2004-12-22 12:15 Guennadi Liakhovetski
  2004-12-23 18:34 ` James Bottomley
  0 siblings, 1 reply; 7+ messages in thread
From: Guennadi Liakhovetski @ 2004-12-22 12:15 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi

Hi

Further to my recent doubts wrt change_queue_depth semantics, I decided to 
just implement this function for tmscsim following comments in 
scsi_host.h. If this gets accepted in this form (returning -EIO if depth 
!= sdev->queue_depth after scsi_adjust_depth_queue), I'll submit patches 
to 53c700.c and a comment-modification to scsi_host.h.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

--- a/drivers/scsi/tmscsim.c	Tue Dec 14 23:20:52 2004
+++ b/drivers/scsi/tmscsim.c	Tue Dec 14 22:59:55 2004
@@ -2274,6 +2274,18 @@
 	return 0;
 }
 
+static int dc390_change_queue_depth(struct scsi_device *sdev, int depth)
+{
+	struct dc390_acb *acb = (struct dc390_acb *)sdev->host->hostdata;
+
+	if (depth > acb->TagMaxNum)
+		depth = acb->TagMaxNum;
+
+	scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, depth);
+
+	return depth == sdev->queue_depth ? depth : -EIO;
+}
+
 static struct scsi_host_template driver_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= "tmscsim", 
@@ -2284,6 +2296,7 @@
 	.queuecommand		= DC390_queuecommand,
 	.eh_abort_handler	= DC390_abort,
 	.eh_bus_reset_handler	= DC390_bus_reset,
+	.change_queue_depth	= dc390_change_queue_depth,
 	.can_queue		= 1,
 	.this_id		= 7,
 	.sg_tablesize		= SG_ALL,

Thanks
Guennadi
---
Guennadi Liakhovetski


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-12-28  0:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-22 12:15 [PATCH] tmscsim: implement change_queue_depth Guennadi Liakhovetski
2004-12-23 18:34 ` James Bottomley
2004-12-25  0:36   ` Guennadi Liakhovetski
2004-12-26 15:49     ` James Bottomley
2004-12-26 21:49       ` Guennadi Liakhovetski
2004-12-27 18:31         ` James Bottomley
2004-12-28  0:29           ` Guennadi Liakhovetski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox