public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH [8/11]   qla2xxx: SYSFS queue-depth override
@ 2004-12-09  7:39 Andrew Vasquez
  2004-12-09 14:59 ` James Bottomley
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Vasquez @ 2004-12-09  7:39 UTC (permalink / raw)
  To: James Bottomley, Linux-SCSI Mailing List; +Cc: Andrew Vasquez

ChangeSet
  1.2242 04/12/08 16:48:25 andrew.vasquez@qlogic.com +1 -0
  Add sysfs queue depth override to qla2xxx.
  
Signed-off-by: Jeremy Higdon  <jeremy@sgi.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>

 drivers/scsi/qla2xxx/qla_os.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+)

diff -Nru a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
--- a/drivers/scsi/qla2xxx/qla_os.c	2004-12-08 22:16:12 -08:00
+++ b/drivers/scsi/qla2xxx/qla_os.c	2004-12-08 22:16:12 -08:00
@@ -162,6 +162,20 @@
 
 static int qla2x00_proc_info(struct Scsi_Host *, char *, char **,
     off_t, int, int);
+static ssize_t qla2xxx_store_queue_depth(struct device *, const char *, size_t);
+
+static struct device_attribute qla2xxx_queue_depth_attr = {
+	.attr = {
+		.name =		"queue_depth",
+		.mode =		S_IWUSR,
+	},
+	.store = qla2xxx_store_queue_depth,
+};
+
+static struct device_attribute *qla2xxx_dev_attrs[] = {
+	&qla2xxx_queue_depth_attr,
+	NULL,
+};
 
 static struct scsi_host_template qla2x00_driver_template = {
 	.module			= THIS_MODULE,
@@ -187,6 +201,8 @@
 	 * which equates to 0x800000 sectors.
 	 */
 	.max_sectors		= 0xFFFF,
+
+	.sdev_attrs		= qla2xxx_dev_attrs,
 };
 
 static struct scsi_transport_template *qla2xxx_transport_template = NULL;
@@ -1787,6 +1803,21 @@
 	}
 
 	return (0);
+}
+
+static ssize_t
+qla2xxx_store_queue_depth(struct device *dev, const char *buf, size_t count)
+{
+	int			 depth;
+	struct scsi_device	*sdev = to_scsi_device(dev);
+
+	if (sdev->tagged_supported) {
+		depth = simple_strtoul(buf, NULL, 0);
+		if (depth > UINT_MAX)
+			depth = UINT_MAX;
+		scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, depth);
+	}
+	return count;
 }
 
 /**

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

end of thread, other threads:[~2004-12-09 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-09  7:39 PATCH [8/11] qla2xxx: SYSFS queue-depth override Andrew Vasquez
2004-12-09 14:59 ` James Bottomley

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