Skip to contentSkip to conversation

PATCH [8/11] qla2xxx: SYSFS queue-depth override

PATCH Andrew Vasquez 2 participants 2 messages Dec 9, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

ChangeSet
1.2242 04/12/08 16:48:25 [email protected] +1 -0 Add sysfs queue depth override to qla2xxx.

 drivers/scsi/qla2xxx/qla_os.c |   31 +++++++++++++++++++++++++++++++
 1 files changed, 31 insertions(+)
drivers/scsi/qla2xxx/qla_os.c +31 -0
diff -Nru a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
@@ -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;
 }
 
 /**
#1 lore raw
Quoted 3 lines · Andrew Vasquez

ChangeSet
1.2242 04/12/08 16:48:25 [email protected] +1 -0 Add sysfs queue depth override to qla2xxx.

I'd like not to do this one. This was really demo code in the 53c700 showing how attribute overriding could be done for individual features. Since this is now becoming a standard feature, it should have its own API in the mid-layer ... I'll try to add it.

James