diff options
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_sysfs.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_sysfs.c | 22 |
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 | ||
616 | static 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 | ||
617 | static DRIVER_ATTR(num_units, S_IRUGO, show_num_units, NULL); | 637 | static DRIVER_ATTR(num_units, S_IRUGO, show_num_units, NULL); |
618 | static DRIVER_ATTR(version, S_IRUGO, show_version, NULL); | 638 | static DRIVER_ATTR(version, S_IRUGO, show_version, NULL); |
@@ -643,6 +663,7 @@ static DEVICE_ATTR(boardversion, S_IRUGO, show_boardversion, NULL); | |||
643 | static DEVICE_ATTR(unit, S_IRUGO, show_unit, NULL); | 663 | static DEVICE_ATTR(unit, S_IRUGO, show_unit, NULL); |
644 | static DEVICE_ATTR(rx_pol_inv, S_IWUSR, NULL, store_rx_pol_inv); | 664 | static DEVICE_ATTR(rx_pol_inv, S_IWUSR, NULL, store_rx_pol_inv); |
645 | static DEVICE_ATTR(led_override, S_IWUSR, NULL, store_led_override); | 665 | static DEVICE_ATTR(led_override, S_IWUSR, NULL, store_led_override); |
666 | static DEVICE_ATTR(logged_errors, S_IRUGO, show_logged_errs, NULL); | ||
646 | 667 | ||
647 | static struct attribute *dev_attributes[] = { | 668 | static 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 | ||