aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_sysfs.c
diff options
context:
space:
mode:
authorMichael Albaugh <michael.albaugh@qlogic.com>2007-05-17 10:26:28 -0400
committerRoland Dreier <rolandd@cisco.com>2007-07-09 23:12:25 -0400
commitaecd3b5ab19624ca9644b9df9c61615282d8923f (patch)
treed4f4b5367a40bd737899b7e3dbfcfab6021891e0 /drivers/infiniband/hw/ipath/ipath_sysfs.c
parent8e9ab3f1c9e34d5c28446c3738983d33a3937fe0 (diff)
IB/ipath: Log "active" time and some errors to EEPROM
We currently track various errors, now we enhance that capability by logging some of them to EEPROM. We also now log a cumulative "active" time defined by traffic though the InfiniPath HCA beyond the normal SM traffic. Signed-off-by: Michael Albaugh <michael.albaugh@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_sysfs.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_sysfs.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_sysfs.c b/drivers/infiniband/hw/ipath/ipath_sysfs.c
index 17ec1457172..ab34d3e8b95 100644
--- a/drivers/infiniband/hw/ipath/ipath_sysfs.c
+++ b/drivers/infiniband/hw/ipath/ipath_sysfs.c
@@ -613,6 +613,26 @@ static ssize_t store_led_override(struct device *dev,
613 return ret; 613 return ret;
614} 614}
615 615
616static ssize_t show_logged_errs(struct device *dev,
617 struct device_attribute *attr,
618 char *buf)
619{
620 struct ipath_devdata *dd = dev_get_drvdata(dev);
621 int idx, count;
622
623 /* force consistency with actual EEPROM */
624 if (ipath_update_eeprom_log(dd) != 0)
625 return -ENXIO;
626
627 count = 0;
628 for (idx = 0; idx < IPATH_EEP_LOG_CNT; ++idx) {
629 count += scnprintf(buf + count, PAGE_SIZE - count, "%d%c",
630 dd->ipath_eep_st_errs[idx],
631 idx == (IPATH_EEP_LOG_CNT - 1) ? '\n' : ' ');
632 }
633
634 return count;
635}
616 636
617static DRIVER_ATTR(num_units, S_IRUGO, show_num_units, NULL); 637static DRIVER_ATTR(num_units, S_IRUGO, show_num_units, NULL);
618static DRIVER_ATTR(version, S_IRUGO, show_version, NULL); 638static DRIVER_ATTR(version, S_IRUGO, show_version, NULL);
@@ -643,6 +663,7 @@ static DEVICE_ATTR(boardversion, S_IRUGO, show_boardversion, NULL);
643static DEVICE_ATTR(unit, S_IRUGO, show_unit, NULL); 663static DEVICE_ATTR(unit, S_IRUGO, show_unit, NULL);
644static DEVICE_ATTR(rx_pol_inv, S_IWUSR, NULL, store_rx_pol_inv); 664static DEVICE_ATTR(rx_pol_inv, S_IWUSR, NULL, store_rx_pol_inv);
645static DEVICE_ATTR(led_override, S_IWUSR, NULL, store_led_override); 665static DEVICE_ATTR(led_override, S_IWUSR, NULL, store_led_override);
666static DEVICE_ATTR(logged_errors, S_IRUGO, show_logged_errs, NULL);
646 667
647static struct attribute *dev_attributes[] = { 668static struct attribute *dev_attributes[] = {
648 &dev_attr_guid.attr, 669 &dev_attr_guid.attr,
@@ -660,6 +681,7 @@ static struct attribute *dev_attributes[] = {
660 &dev_attr_enabled.attr, 681 &dev_attr_enabled.attr,
661 &dev_attr_rx_pol_inv.attr, 682 &dev_attr_rx_pol_inv.attr,
662 &dev_attr_led_override.attr, 683 &dev_attr_led_override.attr,
684 &dev_attr_logged_errors.attr,
663 NULL 685 NULL
664}; 686};
665 687