aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hpsa.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2011-01-06 15:48:39 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-01-24 12:31:10 -0500
commit94a136495a3fbe59b960c46fba3574b1159e8489 (patch)
treed984a7e8873bdac90ae7576a7f757fa5ea673f3d /drivers/scsi/hpsa.c
parent60d3f5b068e65d424f3cf5d108fb0747dd156d00 (diff)
[SCSI] hpsa: Add a per controller commands_outstanding entry 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/scsi/hpsa.c')
-rw-r--r--drivers/scsi/hpsa.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index ddd729e2ea89..c255f46e6405 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -159,6 +159,8 @@ static ssize_t unique_id_show(struct device *dev,
159 struct device_attribute *attr, char *buf); 159 struct device_attribute *attr, char *buf);
160static ssize_t host_show_firmware_revision(struct device *dev, 160static 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,
163 struct device_attribute *attr, char *buf);
162static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno); 164static void hpsa_update_scsi_devices(struct ctlr_info *h, int hostno);
163static ssize_t host_store_rescan(struct device *dev, 165static ssize_t host_store_rescan(struct device *dev,
164 struct device_attribute *attr, const char *buf, size_t count); 166 struct device_attribute *attr, const char *buf, size_t count);
@@ -188,6 +190,8 @@ static DEVICE_ATTR(unique_id, S_IRUGO, unique_id_show, NULL);
188static DEVICE_ATTR(rescan, S_IWUSR, NULL, host_store_rescan); 190static DEVICE_ATTR(rescan, S_IWUSR, NULL, host_store_rescan);
189static DEVICE_ATTR(firmware_revision, S_IRUGO, 191static DEVICE_ATTR(firmware_revision, S_IRUGO,
190 host_show_firmware_revision, NULL); 192 host_show_firmware_revision, NULL);
193static DEVICE_ATTR(commands_outstanding, S_IRUGO,
194 host_show_commands_outstanding, NULL);
191 195
192static struct device_attribute *hpsa_sdev_attrs[] = { 196static struct device_attribute *hpsa_sdev_attrs[] = {
193 &dev_attr_raid_level, 197 &dev_attr_raid_level,
@@ -199,6 +203,7 @@ static struct device_attribute *hpsa_sdev_attrs[] = {
199static struct device_attribute *hpsa_shost_attrs[] = { 203static struct device_attribute *hpsa_shost_attrs[] = {
200 &dev_attr_rescan, 204 &dev_attr_rescan,
201 &dev_attr_firmware_revision, 205 &dev_attr_firmware_revision,
206 &dev_attr_commands_outstanding,
202 NULL, 207 NULL,
203}; 208};
204 209
@@ -299,6 +304,15 @@ static ssize_t host_show_firmware_revision(struct device *dev,
299 fwrev[0], fwrev[1], fwrev[2], fwrev[3]); 304 fwrev[0], fwrev[1], fwrev[2], fwrev[3]);
300} 305}
301 306
307static ssize_t host_show_commands_outstanding(struct device *dev,
308 struct device_attribute *attr, char *buf)
309{
310 struct Scsi_Host *shost = class_to_shost(dev);
311 struct ctlr_info *h = shost_to_hba(shost);
312
313 return snprintf(buf, 20, "%d\n", h->commands_outstanding);
314}
315
302/* Enqueuing and dequeuing functions for cmdlists. */ 316/* Enqueuing and dequeuing functions for cmdlists. */
303static inline void addQ(struct hlist_head *list, struct CommandList *c) 317static inline void addQ(struct hlist_head *list, struct CommandList *c)
304{ 318{