aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDotan Barak <dotanb@mellanox.co.il>2006-02-14 05:43:28 +0000
committerRoland Dreier <rolandd@cisco.com>2006-11-09 11:35:59 -0800
commit6bb69dce4c299ea86a9fd80af6da85c9fdc8acc2 (patch)
treebb29d77b2c819e02bd6710ca1a7e75d65aff0f6e
parentd00e2fc5f830ef7cce1c2dd76e356d3166ec38dd (diff)
downloadlibibverbs-6bb69dce4c299ea86a9fd80af6da85c9fdc8acc2.tar.gz
Report board_id from ibv_devinfo, if present
Signed-off-by: Dotan Barak <dotanb@mellanox.co.il> Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--ChangeLog5
-rw-r--r--examples/devinfo.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d28bea2..da60b1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-13 Dotan Barak <dotanb@mellanox.co.il>
+
+ * examples/devinfo.c (print_hca_cap): Print board_id from sysfs,
+ if present.
+
2006-02-13 Roland Dreier <rdreier@cisco.com>
* 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) {