opal/mca/common/libfabric/libfabric/prov/usnic/src/usnic_direct/usd_device.c
/*
 * Rummage around and collect all the info about this device we can find
 */
Rummage around and collect all the info about this device we can find
Rummage around and collect all the info about this device we can find
static int
usd_discover_device_attrs(
    struct usd_device *dev,
    const char *dev_name)
{
    struct usd_device_attrs *dap;
    int ret;
    ret = usd_get_iface(dev);
    if (ret != 0)
        return ret;
    ret = usd_get_mac(dev, dev->ud_attrs.uda_mac_addr);
    if (ret != 0)
        return ret;
    ret = usd_get_usnic_config(dev);
    if (ret != 0)
        return ret;
    ret = usd_get_firmware(dev);
    if (ret != 0)
        return ret;
    ret = usd_get_dev_if_info(dev);
    if (ret != 0)
        return ret;
    ret = usd_ib_query_dev(dev);
    if (ret != 0)
        return ret;
    dap = &dev->ud_attrs;
    dap->uda_max_cqe = (1 << 16) - 1;;
    dap->uda_max_send_credits = (1 << 12) - 1;
    dap->uda_max_recv_credits = (1 << 12) - 1;
    strncpy(dap->uda_devname, dev_name, sizeof(dap->uda_devname) - 1);
    return 0;
}
static int usd_discover_device_attrs ( struct usd_device * dev , const char * dev_name ) { struct usd_device_attrs * dap ; int ret ; ret = usd_get_iface ( dev ) ; if ( ret != 0 ) return ret ; ret = usd_get_mac ( dev , dev -> ud_attrs . uda_mac_addr ) ; if ( ret != 0 ) return ret ; ret = usd_get_usnic_config ( dev ) ; if ( ret != 0 ) return ret ; ret = usd_get_firmware ( dev ) ; if ( ret != 0 ) return ret ; ret = usd_get_dev_if_info ( dev ) ; if ( ret != 0 ) return ret ; ret = usd_ib_query_dev ( dev ) ; if ( ret != 0 ) return ret ; dap = & dev -> ud_attrs ; dap -> uda_max_cqe = ( 1 << 16 ) - 1 ; ; dap -> uda_max_send_credits = ( 1 << 12 ) - 1 ; dap -> uda_max_recv_credits = ( 1 << 12 ) - 1 ; strncpy ( dap -> uda_devname , dev_name , sizeof ( dap -> uda_devname ) - 1 ) ; return 0 ; }
Rummage around and collect all the info about this device we can find
Rummage around and collect all the info about this device we can find
/* find interface name */ /* ipaddr, netmask, mtu */ /* get what attributes we can from querying IB */ /* constants that should come from driver */