
PCI CD and PCI CDa
Document Number: 008-00965-06 EDT Public Revision: I December 2004
Template: edt.dot
Page 27
edt_configure_ring_buffers
Description
Configures the EDT device ring buffers. Any previous configuration is replaced, and previously
allocated buffers are released. Buffers can be allocated and maintained within the EDT device library
or within the user application itself.
Syntax
#include "edtinc.h"
int edt_configure_ring_buffers(EdtDev *edt_p, int bufsize, int nbufs,
int data_output, void *bufarray[]);
Arguments
edt_p
device handle returned from edt_open or edt_open_channel
bufsize
size of each buffer. For optimal efficiency, allocate a value approximating
throughput divided by 20: that is, if transfer occurs at 20 MB per second,
allocate 1 MB per buffer. Buffers significantly larger or smaller can overuse
memory or lock the system up in processing interrupts at this speed.
nbufs
number of buffers. Must be 1 or greater. Four is recommended for most
applications.
data_direction
Indicates whether this connection is to be used for input or output. Only one
direction is possible per device or subdevice at any given time:
EDT_READ = 0
EDT_WRITE = 1
bufarray
If NULL, the library will allocate a set of page-aligned ring buffers. If not
NULL, this argument is an array of pointers to application-allocated buffers;
these buffers must match the size and number of buffers specified in this call
and will be used as the ring buffers.
Return
0 on success; –1 on error. If all buffers cannot be allocated, none are allocated and an error is returned.
Call edt_perror() to get the system error message.
edt_buffer_addresses
Description
Returns an array containing the addresses of the ring buffers.
Syntax
#include "edtinc.h"
void **edt_buffer_addresses(EdtDev *edt_p);
Arguments
edt_p
device handle returned from edt_open or edt_open_channel.
Return
An array of pointers to the ring buffers allocated by the driver or the library. The array is indexed from
zero to n-1 where n is the number of ring buffers set in edt_configure_ring_buffers().
Kommentare zu diesen Handbüchern