Software Library API naibrd 1.62
See all documentation at naii.docs.com
PCI Enumeration Functions

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_PCI_GetHandle (int32_t cardIndex, uint32_t *outaddr)
 Return the base address of the card.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PCI_GetDevInfo (int32_t cardIndex, int32_t slot, uint16_t *outvendor, uint16_t *outdevcode, uint32_t *outclasscode, uint16_t *outrevid)
 Gets information for the PCI device in the specified slot.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_PCI_GetDevAddr (int32_t cardIndex, int32_t slot, int16_t *outbus, int16_t *outdev, uint32_t *outaddr)
 Gets information for the PCI device in the specified slot.
 
NAIFUNC int32_t NAIAPI nai_PCI_List (int32_t start, int32_t count, int32_t lane, int32_t bus[], int32_t dev[], int32_t func[], uint16_t devid[], uint32_t baseaddr[])
 Retrieves the PCI enumeration information for the PCI boards detected by the NAI controller board.
 

Detailed Description


Function Documentation

◆ nai_PCI_List()

NAIFUNC int32_t NAIAPI nai_PCI_List ( int32_t start,
int32_t count,
int32_t lane,
int32_t bus[],
int32_t dev[],
int32_t func[],
uint16_t devid[],
uint32_t baseaddr[] )

Retrieves the PCI enumeration information for the PCI boards detected by the NAI controller board.

Parameters
start: (Input) Normally zero is passed in to start retrieving PCI enumeration for the first board. However, an offset can be passed in to allow for "paging" of multiple boards.
count: (Input) Maximum number of PCI boards to list.
lane: (Input) PCIe Backplane Lane Number.
bus: (Output) Array of the PCI Bus Location for detected PCI boards.
dev: (Output) Array of the PCI Device Location for detected PCI boards.
func: (Output) Array of the PCI Function Location for detected PCI boards.
devid: (Output) Array of the Device ID for detected PCI boards.
baseaddr: (Output) Array of the Base Address Value for detected PCI boards.
Returns
  • NAI_ERROR_NOT_FOUND when no NAI boards have been found or the number of NAI boards that have been detected.

◆ naibrd_PCI_GetDevAddr()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PCI_GetDevAddr ( int32_t cardIndex,
int32_t slot,
int16_t * outbus,
int16_t * outdev,
uint32_t * outaddr )

Gets information for the PCI device in the specified slot.

Parameters
cardIndex: (Input) Logical Card Index assigned to the PCI master's connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
slot: (Input) Physical or logical PCI slot number.
outbus: (Output, Optional) The PCI bus of the device.
outdev: (Output, Optional) The PCI device number of the device.
outaddr: (Output, Optional) The address of the start of the device.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_VALUE when the slot number is invalid.
  • An error returned by the devaddrFnc function set by naibrd_PCI_SetEnumFnc

◆ naibrd_PCI_GetDevInfo()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PCI_GetDevInfo ( int32_t cardIndex,
int32_t slot,
uint16_t * outvendor,
uint16_t * outdevcode,
uint32_t * outclasscode,
uint16_t * outrevid )

Gets information for the PCI device in the specified slot.

Parameters
cardIndex: (Input) Logical Card Index assigned to the PCI master's connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
slot: (Input) Physical or logical PCI slot number.
outvendor: (Output) The vendor of the device.
outdevcode: (Output) The device code of the device.
outclasscode: (Output) The class code of the device.
outrevid: (Output) The revision ID of the device.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • An error returned by the devinfoFnc function set by naibrd_PCI_SetEnumFnc

◆ naibrd_PCI_GetHandle()

NAIBRDFUNC nai_status_t NAIAPI naibrd_PCI_GetHandle ( int32_t cardIndex,
uint32_t * outaddr )

Return the base address of the card.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
outaddr: (Output) A point to where to store the start address of the card.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.