aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSalyzyn, Mark <Mark_Salyzyn@adaptec.com>2008-02-08 12:01:34 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-02-11 11:20:54 -0500
commit95f6fb578970c9dbfcaa436ff98d2f3c6bdea953 (patch)
tree593bc84eb3e85e100328da00c5e6b2760b25930b /drivers
parente78d5b8f1e73ab82f3fd041d05824cfee7d83a2c (diff)
[SCSI] aacraid: informational sysfs value corrections
Some sysfs problems reported. The serial number on late model controllers was truncated. Non-DASD devices (tapes and CDROMs) were showing up as JBOD in the level report on the physical channel. Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/aacraid/linit.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index fdfbad0903fd..ae5f74fb62d5 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -494,13 +494,14 @@ static int aac_change_queue_depth(struct scsi_device *sdev, int depth)
494 494
495static ssize_t aac_show_raid_level(struct device *dev, struct device_attribute *attr, char *buf) 495static ssize_t aac_show_raid_level(struct device *dev, struct device_attribute *attr, char *buf)
496{ 496{
497 struct scsi_device * sdev = to_scsi_device(dev); 497 struct scsi_device *sdev = to_scsi_device(dev);
498 struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata);
498 if (sdev_channel(sdev) != CONTAINER_CHANNEL) 499 if (sdev_channel(sdev) != CONTAINER_CHANNEL)
499 return snprintf(buf, PAGE_SIZE, sdev->no_uld_attach 500 return snprintf(buf, PAGE_SIZE, sdev->no_uld_attach
500 ? "Hidden\n" : "JBOD"); 501 ? "Hidden\n" :
502 ((aac->jbod && (sdev->type == TYPE_DISK)) ? "JBOD\n" : ""));
501 return snprintf(buf, PAGE_SIZE, "%s\n", 503 return snprintf(buf, PAGE_SIZE, "%s\n",
502 get_container_type(((struct aac_dev *)(sdev->host->hostdata)) 504 get_container_type(aac->fsa_dev[sdev_id(sdev)].type));
503 ->fsa_dev[sdev_id(sdev)].type));
504} 505}
505 506
506static struct device_attribute aac_raid_level_attr = { 507static struct device_attribute aac_raid_level_attr = {
@@ -860,8 +861,8 @@ ssize_t aac_show_serial_number(struct class_device *class_dev, char *buf)
860 le32_to_cpu(dev->adapter_info.serial[0])); 861 le32_to_cpu(dev->adapter_info.serial[0]));
861 if (len && 862 if (len &&
862 !memcmp(&dev->supplement_adapter_info.MfgPcbaSerialNo[ 863 !memcmp(&dev->supplement_adapter_info.MfgPcbaSerialNo[
863 sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo)+2-len], 864 sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo)-len],
864 buf, len)) 865 buf, len-1))
865 len = snprintf(buf, PAGE_SIZE, "%.*s\n", 866 len = snprintf(buf, PAGE_SIZE, "%.*s\n",
866 (int)sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo), 867 (int)sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo),
867 dev->supplement_adapter_info.MfgPcbaSerialNo); 868 dev->supplement_adapter_info.MfgPcbaSerialNo);