diff options
author | Salyzyn, Mark <mark_salyzyn@adaptec.com> | 2007-06-19 16:29:24 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-06-20 00:59:09 -0400 |
commit | 24f02e1d819ad91de46ad3a636cd3f2bf11c720f (patch) | |
tree | 2b8d8d9fa79ad28a2c4c3a272f7807d05409794d /drivers/scsi/aacraid/linit.c | |
parent | b27e66df78a9d8d43c05a6a5777ef45f2e238951 (diff) |
[SCSI] aacraid: add support for long serial number information
Support displaying long serial number information. Reuse sysfs handler
internally as helper.
Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/linit.c')
-rw-r--r-- | drivers/scsi/aacraid/linit.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 3870bd61f418..4fda01e97f46 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
@@ -770,15 +770,21 @@ static ssize_t aac_show_bios_version(struct class_device *class_dev, | |||
770 | return len; | 770 | return len; |
771 | } | 771 | } |
772 | 772 | ||
773 | static ssize_t aac_show_serial_number(struct class_device *class_dev, | 773 | ssize_t aac_show_serial_number(struct class_device *class_dev, char *buf) |
774 | char *buf) | ||
775 | { | 774 | { |
776 | struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; | 775 | struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; |
777 | int len = 0; | 776 | int len = 0; |
778 | 777 | ||
779 | if (le32_to_cpu(dev->adapter_info.serial[0]) != 0xBAD0) | 778 | if (le32_to_cpu(dev->adapter_info.serial[0]) != 0xBAD0) |
780 | len = snprintf(buf, PAGE_SIZE, "%x\n", | 779 | len = snprintf(buf, PAGE_SIZE, "%06X\n", |
781 | le32_to_cpu(dev->adapter_info.serial[0])); | 780 | le32_to_cpu(dev->adapter_info.serial[0])); |
781 | if (len && | ||
782 | !memcmp(&dev->supplement_adapter_info.MfgPcbaSerialNo[ | ||
783 | sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo)+2-len], | ||
784 | buf, len)) | ||
785 | len = snprintf(buf, PAGE_SIZE, "%.*s\n", | ||
786 | (int)sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo), | ||
787 | dev->supplement_adapter_info.MfgPcbaSerialNo); | ||
782 | return len; | 788 | return len; |
783 | } | 789 | } |
784 | 790 | ||