Multi Channel DMA Intel® FPGA IP for PCI Express User Guide

ID 683821
Date 10/29/2021
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

8.3.7. API List

Table 117.  Open
Function Description Prototype Return Values
Channel acquisition int open(const char *pathname, int flags, mode_t mode); File descriptor if successful, negative otherwise
Table 118.  Close
Function Description Prototype Return Values
Free the allocated channel int close(int fd); zero on success -1 otherwise, errno is set appropriately
Table 119.  Read
Function Description Prototype Return Values
Request submission for D2H transfer

ssize_t read(int fd, void *buf, int count);

buf : DMA buffer memory starting address

count: size of the DMA transfer data

number of bytes read if successful

-1 otherwise, errno is set appropriately

Table 120.  Write
Function Description Prototype Return Values
Request submission for H2D transfer

ssize_t write(int fd, void *buf, int count);

buf: DMA buffer memory starting address

count: size of the DMA transfer data

number of bytes written if successful -1 otherwise, errno is set appropriately
Table 121.  Readv
Function Description Prototype Return Values
Request submission for H2D transfer in batches ssize_t readv(int fd, const struct iovec *iov, int iovcnt);

On success, readv() return the number of bytes read

On error, -1 is returned, and errno is set appropriately

Table 122.  Writev
Function Description Prototype Return Values
Request submission for D2H transfer in batches ssize_t writev(int fd, const struct iovec *iov, int iovcnt);

On success, writev() return the number of bytes written

On error, -1 is returned, and errno is set appropriately

Table 123.  Poll
Function Description Prototype Return Values
Write Back poll

int poll(struct pollfd *fds, nfds_t nfds, int timeout);

Special support of events:
  • POLLIN: at least one descriptor queue slot free for D2H
  • POLLOUT: at least one descriptor queue slot free for H2D
  • POLLRDNORM: D2H descriptor queue is empty
  • POLLWRNORM: H2D descriptor queue is empty

On success, poll() returns a nonnegative value which is the number of elements in the pollfds whose revents fields have been set to a nonzero value (indicating an event or an error). A return value of zero indicates that the system call timed out before any file descriptors became read.

On error, -1 is returned, and errno is set to indicate the cause of the error.