提交 7686f132 编写于 作者: M Mark Haverkamp 提交者: James Bottomley

[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: NMark Haverkamp <markh@osdl.org>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 6e289a90
......@@ -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;
}
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册