diff options
author | Dotan Barak <dotanb@mellanox.co.il> | 2006-02-14 05:43:28 +0000 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-09 11:35:59 -0800 |
commit | 6bb69dce4c299ea86a9fd80af6da85c9fdc8acc2 (patch) | |
tree | bb29d77b2c819e02bd6710ca1a7e75d65aff0f6e | |
parent | d00e2fc5f830ef7cce1c2dd76e356d3166ec38dd (diff) | |
download | libibverbs-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-- | ChangeLog | 5 | ||||
-rw-r--r-- | examples/devinfo.c | 7 |
2 files changed, 12 insertions, 0 deletions
@@ -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) { |