aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/linit.c
diff options
context:
space:
mode:
authorSalyzyn, Mark <Mark_Salyzyn@adaptec.com>2008-01-08 15:23:49 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-23 12:29:19 -0500
commit17eaaceef52b1ce5ca061d49a1ff9ae56ccce1e1 (patch)
tree82c8b75f0d572601865c45bd121b922ab9d471aa /drivers/scsi/aacraid/linit.c
parent95e852e1ef165560e85d3012127068c8f08b19a1 (diff)
[SCSI] aacraid: add sysfs report of RAID level
Report the RAID level string for the SCSI device representing the array. Report is in /sys/class/scsi_device/#:#:#:#/device/level. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/aacraid/linit.c')
-rw-r--r--drivers/scsi/aacraid/linit.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index b4ad9effcf50..e6bdc930d528 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -487,6 +487,30 @@ static int aac_change_queue_depth(struct scsi_device *sdev, int depth)
487 return sdev->queue_depth; 487 return sdev->queue_depth;
488} 488}
489 489
490static ssize_t aac_show_raid_level(struct device *dev, struct device_attribute *attr, char *buf)
491{
492 struct scsi_device * sdev = to_scsi_device(dev);
493 if (sdev_channel(sdev) != CONTAINER_CHANNEL)
494 return snprintf(buf, PAGE_SIZE, sdev->no_uld_attach
495 ? "Hidden\n" : "JBOD");
496 return snprintf(buf, PAGE_SIZE, "%s\n",
497 get_container_type(((struct aac_dev *)(sdev->host->hostdata))
498 ->fsa_dev[sdev_id(sdev)].type));
499}
500
501static struct device_attribute aac_raid_level_attr = {
502 .attr = {
503 .name = "level",
504 .mode = S_IRUGO,
505 },
506 .show = aac_show_raid_level
507};
508
509static struct device_attribute *aac_dev_attrs[] = {
510 &aac_raid_level_attr,
511 NULL,
512};
513
490static int aac_ioctl(struct scsi_device *sdev, int cmd, void __user * arg) 514static int aac_ioctl(struct scsi_device *sdev, int cmd, void __user * arg)
491{ 515{
492 struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; 516 struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
@@ -941,6 +965,7 @@ static struct scsi_host_template aac_driver_template = {
941 .shost_attrs = aac_attrs, 965 .shost_attrs = aac_attrs,
942 .slave_configure = aac_slave_configure, 966 .slave_configure = aac_slave_configure,
943 .change_queue_depth = aac_change_queue_depth, 967 .change_queue_depth = aac_change_queue_depth,
968 .sdev_attrs = aac_dev_attrs,
944 .eh_abort_handler = aac_eh_abort, 969 .eh_abort_handler = aac_eh_abort,
945 .eh_host_reset_handler = aac_eh_reset, 970 .eh_host_reset_handler = aac_eh_reset,
946 .can_queue = AAC_NUM_IO_FIB, 971 .can_queue = AAC_NUM_IO_FIB,