diff options
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_sysfs.c')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_sysfs.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/qib/qib_sysfs.c b/drivers/infiniband/hw/qib/qib_sysfs.c index d50a33fe8bbc..14d129de4320 100644 --- a/drivers/infiniband/hw/qib/qib_sysfs.c +++ b/drivers/infiniband/hw/qib/qib_sysfs.c | |||
@@ -507,6 +507,18 @@ static ssize_t show_nctxts(struct device *device, | |||
507 | dd->first_user_ctxt); | 507 | dd->first_user_ctxt); |
508 | } | 508 | } |
509 | 509 | ||
510 | static ssize_t show_nfreectxts(struct device *device, | ||
511 | struct device_attribute *attr, char *buf) | ||
512 | { | ||
513 | struct qib_ibdev *dev = | ||
514 | container_of(device, struct qib_ibdev, ibdev.dev); | ||
515 | struct qib_devdata *dd = dd_from_dev(dev); | ||
516 | |||
517 | /* Return the number of free user ports (contexts) available. */ | ||
518 | return scnprintf(buf, PAGE_SIZE, "%u\n", dd->cfgctxts - | ||
519 | dd->first_user_ctxt - (u32)qib_stats.sps_ctxts); | ||
520 | } | ||
521 | |||
510 | static ssize_t show_serial(struct device *device, | 522 | static ssize_t show_serial(struct device *device, |
511 | struct device_attribute *attr, char *buf) | 523 | struct device_attribute *attr, char *buf) |
512 | { | 524 | { |
@@ -604,6 +616,7 @@ static DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL); | |||
604 | static DEVICE_ATTR(board_id, S_IRUGO, show_hca, NULL); | 616 | static DEVICE_ATTR(board_id, S_IRUGO, show_hca, NULL); |
605 | static DEVICE_ATTR(version, S_IRUGO, show_version, NULL); | 617 | static DEVICE_ATTR(version, S_IRUGO, show_version, NULL); |
606 | static DEVICE_ATTR(nctxts, S_IRUGO, show_nctxts, NULL); | 618 | static DEVICE_ATTR(nctxts, S_IRUGO, show_nctxts, NULL); |
619 | static DEVICE_ATTR(nfreectxts, S_IRUGO, show_nfreectxts, NULL); | ||
607 | static DEVICE_ATTR(serial, S_IRUGO, show_serial, NULL); | 620 | static DEVICE_ATTR(serial, S_IRUGO, show_serial, NULL); |
608 | static DEVICE_ATTR(boardversion, S_IRUGO, show_boardversion, NULL); | 621 | static DEVICE_ATTR(boardversion, S_IRUGO, show_boardversion, NULL); |
609 | static DEVICE_ATTR(logged_errors, S_IRUGO, show_logged_errs, NULL); | 622 | static DEVICE_ATTR(logged_errors, S_IRUGO, show_logged_errs, NULL); |
@@ -617,6 +630,7 @@ static struct device_attribute *qib_attributes[] = { | |||
617 | &dev_attr_board_id, | 630 | &dev_attr_board_id, |
618 | &dev_attr_version, | 631 | &dev_attr_version, |
619 | &dev_attr_nctxts, | 632 | &dev_attr_nctxts, |
633 | &dev_attr_nfreectxts, | ||
620 | &dev_attr_serial, | 634 | &dev_attr_serial, |
621 | &dev_attr_boardversion, | 635 | &dev_attr_boardversion, |
622 | &dev_attr_logged_errors, | 636 | &dev_attr_logged_errors, |