diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2011-02-15 16:32:58 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-02-18 13:33:06 -0500 |
commit | 745a7a25bc0f6dc77db72656b7bc8d17b6ee8e53 (patch) | |
tree | 4fbe997a4a9ba97f3d4f8a728b2519bc53566d9d /drivers | |
parent | a9a3a2739a44fc05dcaba0d4d36e52dc444c294f (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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/hpsa.c | 18 |
1 files changed, 17 insertions, 1 deletions
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); |
162 | static ssize_t host_show_commands_outstanding(struct device *dev, | 162 | static ssize_t host_show_commands_outstanding(struct device *dev, |
163 | struct device_attribute *attr, char *buf); | 163 | struct device_attribute *attr, char *buf); |
164 | static ssize_t host_show_transport_mode(struct device *dev, | ||
165 | struct device_attribute *attr, char *buf); | ||
164 | static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno); | 166 | static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno); |
165 | static ssize_t host_store_rescan(struct device *dev, | 167 | static 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); |
193 | static DEVICE_ATTR(commands_outstanding, S_IRUGO, | 195 | static DEVICE_ATTR(commands_outstanding, S_IRUGO, |
194 | host_show_commands_outstanding, NULL); | 196 | host_show_commands_outstanding, NULL); |
197 | static DEVICE_ATTR(transport_mode, S_IRUGO, | ||
198 | host_show_transport_mode, NULL); | ||
195 | 199 | ||
196 | static struct device_attribute *hpsa_sdev_attrs[] = { | 200 | static 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 | ||
321 | static 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. */ |
317 | static inline void addQ(struct list_head *list, struct CommandList *c) | 334 | static 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); |