From 6bb69dce4c299ea86a9fd80af6da85c9fdc8acc2 Mon Sep 17 00:00:00 2001 From: Dotan Barak Date: Tue, 14 Feb 2006 05:43:28 +0000 Subject: [PATCH] Report board_id from ibv_devinfo, if present Signed-off-by: Dotan Barak Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier --- ChangeLog | 5 +++++ examples/devinfo.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index d28bea2..da60b1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-02-13 Dotan Barak + + * examples/devinfo.c (print_hca_cap): Print board_id from sysfs, + if present. + 2006-02-13 Roland Dreier * examples/asyncwatch.c, examples/device_list.c, diff --git a/examples/devinfo.c b/examples/devinfo.c index 3be2cff..6961b7f 100644 --- a/examples/devinfo.c +++ b/examples/devinfo.c @@ -169,6 +169,7 @@ static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port) struct ibv_context *ctx; struct ibv_device_attr device_attr; struct ibv_port_attr port_attr; + struct sysfs_attribute *attr; int rc = 0; uint8_t port; char buf[256]; @@ -193,6 +194,12 @@ static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port) printf("\tvendor_id:\t\t\t0x%04x\n", device_attr.vendor_id); printf("\tvendor_part_id:\t\t\t%d\n", device_attr.vendor_part_id); printf("\thw_ver:\t\t\t\t0x%X\n", device_attr.hw_ver); + attr = sysfs_get_classdev_attr(ib_dev->ibdev, "board_id"); + if (attr) { + printf("\tboard_id:\t\t\t%s", attr->value); + sysfs_close_attribute(attr); + } + printf("\tphys_port_cnt:\t\t\t%d\n", device_attr.phys_port_cnt); if (verbose) { -- 2.46.0