diff options
author | Mark Haverkamp <markh@osdl.org> | 2006-01-11 12:28:16 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2006-01-12 12:54:45 -0500 |
commit | 7686f132653fa3d52d45c3f021215f714094f1ca (patch) | |
tree | 285ed2e0e3a044e869eab806a5bed80141b178c4 /drivers/scsi/aacraid/linit.c | |
parent | 6e289a9023d589c24f86b29186d324215cdc9947 (diff) |
[SCSI] aacraid: better sysfs adapter information
Received from Mark Salyzyn.
Provide more accurate adapter information.
Allows the Adapter Firmware to override the Adapter product
information.
Signed-off-by: Mark Haverkamp <markh@osdl.org>
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 | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 9b9062f02462..d183a072a9d7 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
@@ -574,7 +574,15 @@ static ssize_t aac_show_model(struct class_device *class_dev, | |||
574 | struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; | 574 | struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; |
575 | int len; | 575 | int len; |
576 | 576 | ||
577 | len = snprintf(buf, PAGE_SIZE, "%s\n", | 577 | if (dev->supplement_adapter_info.AdapterTypeText[0]) { |
578 | char * cp = dev->supplement_adapter_info.AdapterTypeText; | ||
579 | while (*cp && *cp != ' ') | ||
580 | ++cp; | ||
581 | while (*cp == ' ') | ||
582 | ++cp; | ||
583 | len = snprintf(buf, PAGE_SIZE, "%s\n", cp); | ||
584 | } else | ||
585 | len = snprintf(buf, PAGE_SIZE, "%s\n", | ||
578 | aac_drivers[dev->cardtype].model); | 586 | aac_drivers[dev->cardtype].model); |
579 | return len; | 587 | return len; |
580 | } | 588 | } |
@@ -585,7 +593,15 @@ static ssize_t aac_show_vendor(struct class_device *class_dev, | |||
585 | struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; | 593 | struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata; |
586 | int len; | 594 | int len; |
587 | 595 | ||
588 | len = snprintf(buf, PAGE_SIZE, "%s\n", | 596 | if (dev->supplement_adapter_info.AdapterTypeText[0]) { |
597 | char * cp = dev->supplement_adapter_info.AdapterTypeText; | ||
598 | while (*cp && *cp != ' ') | ||
599 | ++cp; | ||
600 | len = snprintf(buf, PAGE_SIZE, "%.*s\n", | ||
601 | (int)(cp - (char *)dev->supplement_adapter_info.AdapterTypeText), | ||
602 | dev->supplement_adapter_info.AdapterTypeText); | ||
603 | } else | ||
604 | len = snprintf(buf, PAGE_SIZE, "%s\n", | ||
589 | aac_drivers[dev->cardtype].vname); | 605 | aac_drivers[dev->cardtype].vname); |
590 | return len; | 606 | return len; |
591 | } | 607 | } |