diff options
author | Salyzyn, Mark <mark_salyzyn@adaptec.com> | 2007-06-19 22:29:24 +0200 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-06-20 06:59:09 +0200 |
commit | 24f02e1d819ad91de46ad3a636cd3f2bf11c720f (patch) | |
tree | 2b8d8d9fa79ad28a2c4c3a272f7807d05409794d /drivers/scsi/aacraid/linit.c | |
parent | [SCSI] aacraid: correct PERC2/QC and family match quirk list (diff) | |
download | linux-24f02e1d819ad91de46ad3a636cd3f2bf11c720f.tar.xz linux-24f02e1d819ad91de46ad3a636cd3f2bf11c720f.zip |
[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, return len; } -static ssize_t aac_show_serial_number(struct class_device *class_dev, - char *buf) +ssize_t aac_show_serial_number(struct class_device *class_dev, char *buf) { struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; int len = 0; if (le32_to_cpu(dev->adapter_info.serial[0]) != 0xBAD0) - len = snprintf(buf, PAGE_SIZE, "%x\n", + len = snprintf(buf, PAGE_SIZE, "%06X\n", le32_to_cpu(dev->adapter_info.serial[0])); + if (len && + !memcmp(&dev->supplement_adapter_info.MfgPcbaSerialNo[ + sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo)+2-len], + buf, len)) + len = snprintf(buf, PAGE_SIZE, "%.*s\n", + (int)sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo), + dev->supplement_adapter_info.MfgPcbaSerialNo); return len; } |