diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2010-06-17 04:06:53 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:02:11 -0400 |
commit | d32a8c15e1116e87f0105356eca1afb99842ab49 (patch) | |
tree | 3795c1d0bd520021a21613ec063b557e51955cd0 /drivers/scsi/mpt2sas/mpt2sas_ctl.c | |
parent | b8d7d7bb37b5e25ea740369eb12de5279fe6ab30 (diff) |
[SCSI] mpt2sas: Added sysfs counter for ioc reset
Added a new sysfs shost attribute called ioc_reset_count. This will
keep count of host resets (both diagnostic and message unit).
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_ctl.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_ctl.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c index d88e9756d8f5..25c866e3e900 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c +++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c | |||
@@ -2581,6 +2581,29 @@ _ctl_fwfault_debug_store(struct device *cdev, | |||
2581 | static DEVICE_ATTR(fwfault_debug, S_IRUGO | S_IWUSR, | 2581 | static DEVICE_ATTR(fwfault_debug, S_IRUGO | S_IWUSR, |
2582 | _ctl_fwfault_debug_show, _ctl_fwfault_debug_store); | 2582 | _ctl_fwfault_debug_show, _ctl_fwfault_debug_store); |
2583 | 2583 | ||
2584 | |||
2585 | /** | ||
2586 | * _ctl_ioc_reset_count_show - ioc reset count | ||
2587 | * @cdev - pointer to embedded class device | ||
2588 | * @buf - the buffer returned | ||
2589 | * | ||
2590 | * This is firmware queue depth limit | ||
2591 | * | ||
2592 | * A sysfs 'read-only' shost attribute. | ||
2593 | */ | ||
2594 | static ssize_t | ||
2595 | _ctl_ioc_reset_count_show(struct device *cdev, struct device_attribute *attr, | ||
2596 | char *buf) | ||
2597 | { | ||
2598 | struct Scsi_Host *shost = class_to_shost(cdev); | ||
2599 | struct MPT2SAS_ADAPTER *ioc = shost_priv(shost); | ||
2600 | |||
2601 | return snprintf(buf, PAGE_SIZE, "%08d\n", ioc->ioc_reset_count); | ||
2602 | } | ||
2603 | static DEVICE_ATTR(ioc_reset_count, S_IRUGO, | ||
2604 | _ctl_ioc_reset_count_show, NULL); | ||
2605 | |||
2606 | |||
2584 | struct device_attribute *mpt2sas_host_attrs[] = { | 2607 | struct device_attribute *mpt2sas_host_attrs[] = { |
2585 | &dev_attr_version_fw, | 2608 | &dev_attr_version_fw, |
2586 | &dev_attr_version_bios, | 2609 | &dev_attr_version_bios, |
@@ -2597,6 +2620,7 @@ struct device_attribute *mpt2sas_host_attrs[] = { | |||
2597 | &dev_attr_fwfault_debug, | 2620 | &dev_attr_fwfault_debug, |
2598 | &dev_attr_fw_queue_depth, | 2621 | &dev_attr_fw_queue_depth, |
2599 | &dev_attr_host_sas_address, | 2622 | &dev_attr_host_sas_address, |
2623 | &dev_attr_ioc_reset_count, | ||
2600 | NULL, | 2624 | NULL, |
2601 | }; | 2625 | }; |
2602 | 2626 | ||