Polaris Project
Functions
Device Management

Functions

int polaris_get_devices (int *devs, int devs_len)
 Get list of all the FPGA devices. More...
 
int polaris_get_devices (const char *firmware_name, int *devs, int devs_len)
 Get list of all the FPGA devices that match the given firmware name. More...
 
int polaris_get_driver_version (char *ver, int ver_len)
 Get version string of the driver. More...
 

Detailed Description

Functions related to device management, including quering the version and matching devices.

Function Documentation

◆ polaris_get_devices() [1/2]

int polaris_get_devices ( int *  devs,
int  devs_len 
)

Get list of all the FPGA devices.

This function always returns the number of all FPGA devices installed in the system, even if it is greater than devs_len, but in anycase, it will never write more than devs_len device ids into devs.

Parameters
[out]devslist of all FPGA devices' ids
[in]devs_lenmalloced length (number of ints) of devs
Returns
Non-negtive value for total FPGA device count, -errno if error happens.

◆ polaris_get_devices() [2/2]

int polaris_get_devices ( const char *  firmware_name,
int *  devs,
int  devs_len 
)

Get list of all the FPGA devices that match the given firmware name.

This function always returns the number of all FPGA devices that match the firmware_name, even if it is greater than devs_len, but in anycase, it will never write more than devs_len device ids into devs.

Parameters
[in]firmware_namefirmware name to query
[out]devslist of all FPGA devices' ids
[in]devs_lenmalloced length (number of ints) of devs
Returns
Non-negtive value for matched FPGA device count, -errno if error happens.

◆ polaris_get_driver_version()

int polaris_get_driver_version ( char *  ver,
int  ver_len 
)

Get version string of the driver.

This function always returns the length of driver version string (including the trailing '\0'), even if it is greater than ver_len, but it will never write more than ver_len chars into ver.

Parameters
[out]verversion string buffer
[in]ver_lenmalloced length (number of bytes) for ver
Returns
Non-negtive value for actual version string length (including the trailing '\0') -errno if error happens.