提交 745a7a25 编写于 作者: S Stephen M. Cameron 提交者: James Bottomley

[SCSI] hpsa: Add transport_mode host attribute in /sys

Signed-off-by: NStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: NJames Bottomley <James.Bottomley@suse.de>
上级 a9a3a273
...@@ -45,6 +45,7 @@ HPSA specific entries in /sys ...@@ -45,6 +45,7 @@ HPSA specific entries in /sys
/sys/class/scsi_host/host*/rescan /sys/class/scsi_host/host*/rescan
/sys/class/scsi_host/host*/firmware_revision /sys/class/scsi_host/host*/firmware_revision
/sys/class/scsi_host/host*/transport_mode
the host "rescan" attribute is a write only attribute. Writing to this the host "rescan" attribute is a write only attribute. Writing to this
attribute will cause the driver to scan for new, changed, or removed devices attribute will cause the driver to scan for new, changed, or removed devices
...@@ -61,6 +62,10 @@ HPSA specific entries in /sys ...@@ -61,6 +62,10 @@ HPSA specific entries in /sys
root@host:/sys/class/scsi_host/host4# cat firmware_revision root@host:/sys/class/scsi_host/host4# cat firmware_revision
7.14 7.14
The transport_mode indicates whether the controller is in "performant"
or "simple" mode. This is controlled by the "hpsa_simple_mode" module
parameter.
HPSA specific disk attributes: HPSA specific disk attributes:
------------------------------ ------------------------------
......
...@@ -161,6 +161,8 @@ static ssize_t host_show_firmware_revision(struct device *dev, ...@@ -161,6 +161,8 @@ static ssize_t host_show_firmware_revision(struct device *dev,
struct device_attribute *attr, char *buf); struct device_attribute *attr, char *buf);
static ssize_t host_show_commands_outstanding(struct device *dev, static ssize_t host_show_commands_outstanding(struct device *dev,
struct device_attribute *attr, char *buf); struct device_attribute *attr, char *buf);
static ssize_t host_show_transport_mode(struct device *dev,
struct device_attribute *attr, char *buf);
static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno); static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno);
static ssize_t host_store_rescan(struct device *dev, static ssize_t host_store_rescan(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count); struct device_attribute *attr, const char *buf, size_t count);
...@@ -192,6 +194,8 @@ static DEVICE_ATTR(firmware_revision, S_IRUGO, ...@@ -192,6 +194,8 @@ static DEVICE_ATTR(firmware_revision, S_IRUGO,
host_show_firmware_revision, NULL); host_show_firmware_revision, NULL);
static DEVICE_ATTR(commands_outstanding, S_IRUGO, static DEVICE_ATTR(commands_outstanding, S_IRUGO,
host_show_commands_outstanding, NULL); host_show_commands_outstanding, NULL);
static DEVICE_ATTR(transport_mode, S_IRUGO,
host_show_transport_mode, NULL);
static struct device_attribute *hpsa_sdev_attrs[] = { static struct device_attribute *hpsa_sdev_attrs[] = {
&dev_attr_raid_level, &dev_attr_raid_level,
...@@ -204,6 +208,7 @@ static struct device_attribute *hpsa_shost_attrs[] = { ...@@ -204,6 +208,7 @@ static struct device_attribute *hpsa_shost_attrs[] = {
&dev_attr_rescan, &dev_attr_rescan,
&dev_attr_firmware_revision, &dev_attr_firmware_revision,
&dev_attr_commands_outstanding, &dev_attr_commands_outstanding,
&dev_attr_transport_mode,
NULL, NULL,
}; };
...@@ -313,6 +318,18 @@ static ssize_t host_show_commands_outstanding(struct device *dev, ...@@ -313,6 +318,18 @@ static ssize_t host_show_commands_outstanding(struct device *dev,
return snprintf(buf, 20, "%d\n", h->commands_outstanding); return snprintf(buf, 20, "%d\n", h->commands_outstanding);
} }
static ssize_t host_show_transport_mode(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct ctlr_info *h;
struct Scsi_Host *shost = class_to_shost(dev);
h = shost_to_hba(shost);
return snprintf(buf, 20, "%s\n",
h->transMethod == CFGTBL_Trans_Performant ?
"performant" : "simple");
}
/* Enqueuing and dequeuing functions for cmdlists. */ /* Enqueuing and dequeuing functions for cmdlists. */
static inline void addQ(struct list_head *list, struct CommandList *c) static inline void addQ(struct list_head *list, struct CommandList *c)
{ {
...@@ -3768,7 +3785,6 @@ static int __devinit hpsa_init_one(struct pci_dev *pdev, ...@@ -3768,7 +3785,6 @@ static int __devinit hpsa_init_one(struct pci_dev *pdev,
h->pdev = pdev; h->pdev = pdev;
h->busy_initializing = 1; h->busy_initializing = 1;
h->intr_mode = hpsa_simple_mode ? SIMPLE_MODE_INT : PERF_MODE_INT; h->intr_mode = hpsa_simple_mode ? SIMPLE_MODE_INT : PERF_MODE_INT;
printk(KERN_WARNING "hpsa_simple_mode is %d\n", hpsa_simple_mode);
INIT_LIST_HEAD(&h->cmpQ); INIT_LIST_HEAD(&h->cmpQ);
INIT_LIST_HEAD(&h->reqQ); INIT_LIST_HEAD(&h->reqQ);
spin_lock_init(&h->lock); spin_lock_init(&h->lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册