Skip to content

Commit

Permalink
[SCSI] aacraid: better sysfs adapter information
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Haverkamp authored and James Bottomley committed Jan 12, 2006
1 parent 6e289a9 commit 7686f13
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions drivers/scsi/aacraid/linit.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,15 @@ static ssize_t aac_show_model(struct class_device *class_dev,
struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
int len;

len = snprintf(buf, PAGE_SIZE, "%s\n",
if (dev->supplement_adapter_info.AdapterTypeText[0]) {
char * cp = dev->supplement_adapter_info.AdapterTypeText;
while (*cp && *cp != ' ')
++cp;
while (*cp == ' ')
++cp;
len = snprintf(buf, PAGE_SIZE, "%s\n", cp);
} else
len = snprintf(buf, PAGE_SIZE, "%s\n",
aac_drivers[dev->cardtype].model);
return len;
}
Expand All @@ -585,7 +593,15 @@ static ssize_t aac_show_vendor(struct class_device *class_dev,
struct aac_dev *dev = (struct aac_dev*)class_to_shost(class_dev)->hostdata;
int len;

len = snprintf(buf, PAGE_SIZE, "%s\n",
if (dev->supplement_adapter_info.AdapterTypeText[0]) {
char * cp = dev->supplement_adapter_info.AdapterTypeText;
while (*cp && *cp != ' ')
++cp;
len = snprintf(buf, PAGE_SIZE, "%.*s\n",
(int)(cp - (char *)dev->supplement_adapter_info.AdapterTypeText),
dev->supplement_adapter_info.AdapterTypeText);
} else
len = snprintf(buf, PAGE_SIZE, "%s\n",
aac_drivers[dev->cardtype].vname);
return len;
}
Expand Down

0 comments on commit 7686f13

Please sign in to comment.