diff options
Diffstat (limited to 'drivers/scsi/aacraid/linit.c')
-rw-r--r-- | drivers/scsi/aacraid/linit.c | 25 |
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 | ||
490 | static 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 | |||
501 | static 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 | |||
509 | static struct device_attribute *aac_dev_attrs[] = { | ||
510 | &aac_raid_level_attr, | ||
511 | NULL, | ||
512 | }; | ||
513 | |||
490 | static int aac_ioctl(struct scsi_device *sdev, int cmd, void __user * arg) | 514 | static 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, |