aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2011-02-15 16:32:58 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-18 13:33:06 -0500
commit745a7a25bc0f6dc77db72656b7bc8d17b6ee8e53 (patch)
tree4fbe997a4a9ba97f3d4f8a728b2519bc53566d9d
parenta9a3a2739a44fc05dcaba0d4d36e52dc444c294f (diff)
[SCSI] hpsa: Add transport_mode host attribute in /sys
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--Documentation/scsi/hpsa.txt5
-rw-r--r--drivers/scsi/hpsa.c18
2 files changed, 22 insertions, 1 deletions
diff --git a/Documentation/scsi/hpsa.txt b/Documentation/scsi/hpsa.txt
index b14e6ee00a95..880c085b951b 100644
--- a/Documentation/scsi/hpsa.txt
+++ b/Documentation/scsi/hpsa.txt
@@ -45,6 +45,7 @@ HPSA specific entries in /sys
45 45
46 /sys/class/scsi_host/host*/rescan 46 /sys/class/scsi_host/host*/rescan
47 /sys/class/scsi_host/host*/firmware_revision 47 /sys/class/scsi_host/host*/firmware_revision
48 /sys/class/scsi_host/host*/transport_mode
48 49
49 the host "rescan" attribute is a write only attribute. Writing to this 50 the host "rescan" attribute is a write only attribute. Writing to this
50 attribute will cause the driver to scan for new, changed, or removed devices 51 attribute will cause the driver to scan for new, changed, or removed devices
@@ -61,6 +62,10 @@ HPSA specific entries in /sys
61 root@host:/sys/class/scsi_host/host4# cat firmware_revision 62 root@host:/sys/class/scsi_host/host4# cat firmware_revision
62 7.14 63 7.14
63 64
65 The transport_mode indicates whether the controller is in "performant"
66 or "simple" mode. This is controlled by the "hpsa_simple_mode" module
67 parameter.
68
64 HPSA specific disk attributes: 69 HPSA specific disk attributes:
65 ------------------------------ 70 ------------------------------
66 71
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 66ccacfffd51..563d439c2f46 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -161,6 +161,8 @@ static ssize_t host_show_firmware_revision(struct device *dev,
161 struct device_attribute *attr, char *buf); 161 struct device_attribute *attr, char *buf);
162static ssize_t host_show_commands_outstanding(struct device *dev, 162static ssize_t host_show_commands_outstanding(struct device *dev,
163 struct device_attribute *attr, char *buf); 163 struct device_attribute *attr, char *buf);
164static ssize_t host_show_transport_mode(struct device *dev,
165 struct device_attribute *attr, char *buf);
164static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno); 166static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno);
165static ssize_t host_store_rescan(struct device *dev, 167static ssize_t host_store_rescan(struct device *dev,
166 struct device_attribute *attr, const char *buf, size_t count); 168 struct device_attribute *attr, const char *buf, size_t count);
@@ -192,6 +194,8 @@ static DEVICE_ATTR(firmware_revision, S_IRUGO,
192 host_show_firmware_revision, NULL); 194 host_show_firmware_revision, NULL);
193static DEVICE_ATTR(commands_outstanding, S_IRUGO, 195static DEVICE_ATTR(commands_outstanding, S_IRUGO,
194 host_show_commands_outstanding, NULL); 196 host_show_commands_outstanding, NULL);
197static DEVICE_ATTR(transport_mode, S_IRUGO,
198 host_show_transport_mode, NULL);
195 199
196static struct device_attribute *hpsa_sdev_attrs[] = { 200static struct device_attribute *hpsa_sdev_attrs[] = {
197 &dev_attr_raid_level, 201 &dev_attr_raid_level,
@@ -204,6 +208,7 @@ static struct device_attribute *hpsa_shost_attrs[] = {
204 &dev_attr_rescan, 208 &dev_attr_rescan,
205 &dev_attr_firmware_revision, 209 &dev_attr_firmware_revision,
206 &dev_attr_commands_outstanding, 210 &dev_attr_commands_outstanding,
211 &dev_attr_transport_mode,
207 NULL, 212 NULL,
208}; 213};
209 214
@@ -313,6 +318,18 @@ static ssize_t host_show_commands_outstanding(struct device *dev,
313 return snprintf(buf, 20, "%d\n", h->commands_outstanding); 318 return snprintf(buf, 20, "%d\n", h->commands_outstanding);
314} 319}
315 320
321static ssize_t host_show_transport_mode(struct device *dev,
322 struct device_attribute *attr, char *buf)
323{
324 struct ctlr_info *h;
325 struct Scsi_Host *shost = class_to_shost(dev);
326
327 h = shost_to_hba(shost);
328 return snprintf(buf, 20, "%s\n",
329 h->transMethod == CFGTBL_Trans_Performant ?
330 "performant" : "simple");
331}
332
316/* Enqueuing and dequeuing functions for cmdlists. */ 333/* Enqueuing and dequeuing functions for cmdlists. */
317static inline void addQ(struct list_head *list, struct CommandList *c) 334static inline void addQ(struct list_head *list, struct CommandList *c)
318{ 335{
@@ -3768,7 +3785,6 @@ static int __devinit hpsa_init_one(struct pci_dev *pdev,
3768 h->pdev = pdev; 3785 h->pdev = pdev;
3769 h->busy_initializing = 1; 3786 h->busy_initializing = 1;
3770 h->intr_mode = hpsa_simple_mode ? SIMPLE_MODE_INT : PERF_MODE_INT; 3787 h->intr_mode = hpsa_simple_mode ? SIMPLE_MODE_INT : PERF_MODE_INT;
3771 printk(KERN_WARNING "hpsa_simple_mode is %d\n", hpsa_simple_mode);
3772 INIT_LIST_HEAD(&h->cmpQ); 3788 INIT_LIST_HEAD(&h->cmpQ);
3773 INIT_LIST_HEAD(&h->reqQ); 3789 INIT_LIST_HEAD(&h->reqQ);
3774 spin_lock_init(&h->lock); 3790 spin_lock_init(&h->lock);