third-party/libfabric/libfabric-src/prov/usnic/src/usnic_direct/usd_device.c
/*
 * Return list of currently available devices
 */
Return list of currently available devices
Return list of currently available devices
int
usd_get_device_list(
    struct usd_device_entry *entries,
    int *num_entries)
{
    int n;
    struct usd_ib_dev *idp;
    int ret;
    n = 0;
    ret = usd_init();
    if (ret != 0) {
        goto out;
    }
    idp = usd_ib_dev_list;
    while (idp != NULL && n < *num_entries) {
        strncpy(entries[n].ude_devname, idp->id_usnic_name,
                sizeof(entries[n].ude_devname) - 1);
        ++n;
        idp = idp->id_next;
    }
out:
    *num_entries = n;
    return ret;
}
int usd_get_device_list ( struct usd_device_entry * entries , int * num_entries ) { int n ; struct usd_ib_dev * idp ; int ret ; n = 0 ; ret = usd_init ( ) ; if ( ret != 0 ) { goto out ; } idp = usd_ib_dev_list ; while ( idp != NULL && n < * num_entries ) { strncpy ( entries [ n ] . ude_devname , idp -> id_usnic_name , sizeof ( entries [ n ] . ude_devname ) - 1 ) ; ++ n ; idp = idp -> id_next ; } out : * num_entries = n ; return ret ; }
Return list of currently available devices
Return list of currently available devices