Function summary

The CPI library provides synchronous and asynchronous interfaces to the TX board:

Interface

Description

Synchronous

  • Can allow packet loss and can introduce data overload conditions.

  • Adequate for simple applications but not as efficient as asynchronous interfaces.

  • Can stall multiple-threaded calling applications until a response is received from the TX host-based driver.

  • Does not include a flow control mechanism, causing dropped packets and resource depletion during heavy packet traffic, whether from host to TX board or from TX board to host.

  • Used when opening a CPI channel using cpi_open.

Asynchronous

  • Recommended for all development because it is more efficient than synchronous interfaces.

  • Does not stall the calling application because all responses from the driver are handled as independent events. For certain operating systems, multiple-threaded applications must use an asynchronous interface. For operating systems that do not impose this restriction, an asynchronous interface is still recommended.

  • Includes flow control mechanisms to ensure that no packets are dropped and no depletion conditions are introduced due to host traffic.

  • Used when opening a CPI channel with cpia_open or cpix_open.


Not all CPI library functions can handle asynchronous I/O and synchronous I/O functions. Mixed-mode (synchronous and asynchronous) I/O on the same handle is not allowed. The following table summarizes the CPI functions and their modality. An asterisk (*) indicates a user-supplied function.

Function

Synchronous

Asynchronous

cpia_chkey

No

Yes

cpia_get_data

No

Yes

cpia_intr

No

Yes

cpia_open

No

Yes

cpia_rxnotify*

No

Yes

cpia_send

No

Yes

cpia_txnotify*

No

Yes

cpix_open

No

YEs

cpi_check_bs

Yes

Yes

cpi_close

Yes

Yes

cpi_cptoh_l

Yes

Yes

cpi_cptoh_s

Yes

Yes

cpi_force_bs

Yes

Yes

cpi_get_board

Yes

Yes

cpi_get_data

Yes

No

cpi_get_dev_info

Yes

Yes

cpi_get_error_str

Yes

Yes

cpi_get_last_error

Yes

Yes

cpi_get_resources

Yes

Yes

cpi_htocp_l

Yes

Yes

cpi_htocp_s

Yes

Yes

cpi_init

Yes

Yes

cpi_nmi

Yes

Yes

cpi_open

Yes

No

cpi_read_control

Yes

Yes

cpi_read_dpr

Yes

Yes

cpi_send

Yes

No

cpi_set_cpid

Yes

Yes

cpi_show_stats

Yes

Yes

cpi_stats

Yes

Yes

cpi_wait_msg

Yes

No

cpi_wait_obj

Yes

Yes

cpi_write_control

Yes

Yes

cpi_write_dpr

Yes

Yes