Skip to contentSkip to conversation

aacraid: Show max channel and max id is sysfs

PATCH New Mark Haverkamp 1 participant 1 message Mar 27, 2006

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

PATCH 9/11 aacraid: Show max channel and max id is sysfs

Received from Mark Salyzyn

Add max_channel and max_id sysfs parameters.

---
Applies to the scsi-misc-2.6 git tree.

drivers/scsi/aacraid/linit.c +28 -0
@@ -688,6 +688,18 @@
 	return len;
 }
 
+static ssize_t aac_show_max_channel(struct class_device *class_dev, char *buf)
+{
+	return snprintf(buf, PAGE_SIZE, "%d\n",
+	  class_to_shost(class_dev)->max_channel);
+}
+
+static ssize_t aac_show_max_id(struct class_device *class_dev, char *buf)
+{
+	return snprintf(buf, PAGE_SIZE, "%d\n",
+	  class_to_shost(class_dev)->max_id);
+}
+
 
 static struct class_device_attribute aac_model = {
 	.attr = {
@@ -731,6 +743,20 @@
 	},
 	.show = aac_show_serial_number,
 };
+static struct class_device_attribute aac_max_channel = {
+	.attr = {
+		.name = "max_channel",
+		.mode = S_IRUGO,
+	},
+	.show = aac_show_max_channel,
+};
+static struct class_device_attribute aac_max_id = {
+	.attr = {
+		.name = "max_id",
+		.mode = S_IRUGO,
+	},
+	.show = aac_show_max_id,
+};
 
 static struct class_device_attribute *aac_attrs[] = {
 	&aac_model,
@@ -739,6 +765,8 @@
 	&aac_monitor_version,
 	&aac_bios_version,
 	&aac_serial_number,
+	&aac_max_channel,
+	&aac_max_id,
 	NULL
 };
 
Signature · 1 line
Mark Haverkamp <[email protected]>