aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_sysfs.c
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-09-28 11:59:59 -0400
committerRoland Dreier <rolandd@cisco.com>2006-09-28 14:16:25 -0400
commit9929b0fb0f35f54371e9364bab809bcd753f9d3a (patch)
tree1722f36becc47589bb7b0d98ad00c10dece2a95e /drivers/infiniband/hw/ipath/ipath_sysfs.c
parent221e31985b490309eb9ae33ac815deae3b5aa021 (diff)
IB/ipath: Driver support for userspace sharing of HW contexts
This allows multiple userspace processes to share a single hardware context in a master/slave arrangement. It is backwards binary compatible with existing userspace. Signed-off-by: Bryan O'Sullivan <bryan.osullivan@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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_sysfs.c b/drivers/infiniband/hw/ipath/ipath_sysfs.c
index e299148c4b68..b48ebf62e5dd 100644
--- a/drivers/infiniband/hw/ipath/ipath_sysfs.c
+++ b/drivers/infiniband/hw/ipath/ipath_sysfs.c
@@ -297,6 +297,16 @@ static ssize_t show_nguid(struct device *dev,
297 return scnprintf(buf, PAGE_SIZE, "%u\n", dd->ipath_nguid); 297 return scnprintf(buf, PAGE_SIZE, "%u\n", dd->ipath_nguid);
298} 298}
299 299
300static ssize_t show_nports(struct device *dev,
301 struct device_attribute *attr,
302 char *buf)
303{
304 struct ipath_devdata *dd = dev_get_drvdata(dev);
305
306 /* Return the number of user ports available. */
307 return scnprintf(buf, PAGE_SIZE, "%u\n", dd->ipath_cfgports - 1);
308}
309
300static ssize_t show_serial(struct device *dev, 310static ssize_t show_serial(struct device *dev,
301 struct device_attribute *attr, 311 struct device_attribute *attr,
302 char *buf) 312 char *buf)
@@ -608,6 +618,7 @@ static DEVICE_ATTR(mlid, S_IWUSR | S_IRUGO, show_mlid, store_mlid);
608static DEVICE_ATTR(mtu, S_IWUSR | S_IRUGO, show_mtu, store_mtu); 618static DEVICE_ATTR(mtu, S_IWUSR | S_IRUGO, show_mtu, store_mtu);
609static DEVICE_ATTR(enabled, S_IWUSR | S_IRUGO, show_enabled, store_enabled); 619static DEVICE_ATTR(enabled, S_IWUSR | S_IRUGO, show_enabled, store_enabled);
610static DEVICE_ATTR(nguid, S_IRUGO, show_nguid, NULL); 620static DEVICE_ATTR(nguid, S_IRUGO, show_nguid, NULL);
621static DEVICE_ATTR(nports, S_IRUGO, show_nports, NULL);
611static DEVICE_ATTR(reset, S_IWUSR, NULL, store_reset); 622static DEVICE_ATTR(reset, S_IWUSR, NULL, store_reset);
612static DEVICE_ATTR(serial, S_IRUGO, show_serial, NULL); 623static DEVICE_ATTR(serial, S_IRUGO, show_serial, NULL);
613static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); 624static DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
@@ -623,6 +634,7 @@ static struct attribute *dev_attributes[] = {
623 &dev_attr_mlid.attr, 634 &dev_attr_mlid.attr,
624 &dev_attr_mtu.attr, 635 &dev_attr_mtu.attr,
625 &dev_attr_nguid.attr, 636 &dev_attr_nguid.attr,
637 &dev_attr_nports.attr,
626 &dev_attr_serial.attr, 638 &dev_attr_serial.attr,
627 &dev_attr_status.attr, 639 &dev_attr_status.attr,
628 &dev_attr_status_str.attr, 640 &dev_attr_status_str.attr,