diff options
author | Michael Brown <mcb30@etherboot.org> | 2009-07-02 12:54:36 +0100 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2009-07-17 23:06:33 +0100 |
commit | 7ba33f78263ba17633cf6c264e99b4a4140abfcb (patch) | |
tree | 3ce2ef77e4aef89f705c49219ca5ebda9f80333f /src/net/infiniband | |
parent | b25a4b6c8a7f311f639bf999050dbad5e50ede4d (diff) | |
download | ipxe-7ba33f78263ba17633cf6c264e99b4a4140abfcb.tar.gz |
[infiniband] Provide ib_get_hca_info() as a commonly-available function
Diffstat (limited to 'src/net/infiniband')
-rw-r--r-- | src/net/infiniband/ib_sma.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/net/infiniband/ib_sma.c b/src/net/infiniband/ib_sma.c index 96cc37c9..cfc881c5 100644 --- a/src/net/infiniband/ib_sma.c +++ b/src/net/infiniband/ib_sma.c @@ -47,27 +47,15 @@ static void ib_sma_get_node_info ( struct ib_sma *sma, union ib_smp_data *get ) { struct ib_device *ibdev = sma->ibdev; struct ib_node_info *node_info = &get->node_info; - struct ib_device *tmp; memset ( node_info, 0, sizeof ( *node_info ) ); node_info->base_version = IB_MGMT_BASE_VERSION; node_info->class_version = IB_SMP_CLASS_VERSION; node_info->node_type = IB_NODE_TYPE_HCA; - /* Search for IB devices with the same physical device to - * identify port count and a suitable Node GUID. - */ - for_each_ibdev ( tmp ) { - if ( tmp->dev != ibdev->dev ) - continue; - if ( node_info->num_ports == 0 ) { - memcpy ( node_info->sys_guid, &tmp->gid.u.half[1], - sizeof ( node_info->sys_guid ) ); - memcpy ( node_info->node_guid, &tmp->gid.u.half[1], - sizeof ( node_info->node_guid ) ); - } - node_info->num_ports++; - } - memcpy ( node_info->port_guid, &ibdev->gid.u.half[1], + node_info->num_ports = ib_get_hca_info ( ibdev, &node_info->sys_guid ); + memcpy ( &node_info->node_guid, &node_info->sys_guid, + sizeof ( node_info->node_guid ) ); + memcpy ( &node_info->port_guid, &ibdev->gid.u.half[1], sizeof ( node_info->port_guid ) ); node_info->partition_cap = htons ( 1 ); node_info->local_port_num = ibdev->port; |