summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/ipath/ipath_sysfs.c
diff options
context:
space:
mode:
authorArthur Jones <arthur.jones@qlogic.com>2008-04-16 21:01:12 -0700
committerRoland Dreier <rolandd@cisco.com>2008-04-16 21:01:12 -0700
commit6ca2abf4c02fb3e35247a985c2b6f5834e995033 (patch)
treecbf950decc213d2c5f05d72e0a2030dc7794f303 /drivers/infiniband/hw/ipath/ipath_sysfs.c
parentf2ceb4929ab543e54efaadcad215a105df684f36 (diff)
IB/ipath: Provide I/O bus speeds for diagnostic purposes
Modern I/O buses like PCIe and HT can be configured for multiple speeds and widths. When an ipath HCA seems to have lower than expected performance, it is very useful to be able to display what the driver thinks the bus speed is. Signed-off-by: Dave Olson <dave.olson@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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_sysfs.c b/drivers/infiniband/hw/ipath/ipath_sysfs.c
index 56dfc8a2344c..bb41c3f6aad3 100644
--- a/drivers/infiniband/hw/ipath/ipath_sysfs.c
+++ b/drivers/infiniband/hw/ipath/ipath_sysfs.c
@@ -163,6 +163,15 @@ static ssize_t show_boardversion(struct device *dev,
return scnprintf(buf, PAGE_SIZE, "%s", dd->ipath_boardversion);
}
+static ssize_t show_localbus_info(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct ipath_devdata *dd = dev_get_drvdata(dev);
+ /* The string printed here is already newline-terminated. */
+ return scnprintf(buf, PAGE_SIZE, "%s", dd->ipath_lbus_info);
+}
+
static ssize_t show_lmc(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -1011,6 +1020,7 @@ static DEVICE_ATTR(unit, S_IRUGO, show_unit, NULL);
static DEVICE_ATTR(rx_pol_inv, S_IWUSR, NULL, store_rx_pol_inv);
static DEVICE_ATTR(led_override, S_IWUSR, NULL, store_led_override);
static DEVICE_ATTR(logged_errors, S_IRUGO, show_logged_errs, NULL);
+static DEVICE_ATTR(localbus_info, S_IRUGO, show_localbus_info, NULL);
static DEVICE_ATTR(jint_max_packets, S_IWUSR | S_IRUGO,
show_jint_max_packets, store_jint_max_packets);
static DEVICE_ATTR(jint_idle_ticks, S_IWUSR | S_IRUGO,
@@ -1034,6 +1044,7 @@ static struct attribute *dev_attributes[] = {
&dev_attr_rx_pol_inv.attr,
&dev_attr_led_override.attr,
&dev_attr_logged_errors.attr,
+ &dev_attr_localbus_info.attr,
NULL
};