udi_gio_op_t(3udi)


GIO operation type

SYNOPSIS

#include <udi.h>

typedef udi_ubit8_t udi_gio_op_t;
 
/* Limit values for udi_gio_op_t */
 
#define  UDI_GIO_OP_CUSTOM				16
 
#define  UDI_GIO_OP_MAX				64
 
/* Direction flag values for op */
 
#define UDI_GIO_DIR_READ (1U<<6) #define UDI_GIO_DIR_WRITE (1U<<7)
/* Standard Operation Codes */
 
#define UDI_GIO_OP_READ UDI_GIO_DIR_READ #define UDI_GIO_OP_WRITE UDI_GIO_DIR_WRITE

DESCRIPTION This type is used to hold an operation code, including direction flags, for a Generic I/O transfer control block.

The data_buf parameter is used to specify the data buffer to be read or written in this GIO transfer operation. The data_buf->buf_size field indicates the number of bytes that are to be transferred; if no actual data is to be transferred then data_buf may be NULL.

The operation code includes a bitmask of zero, one, or both direction flags from the following list:

UDI_GIO_DIR_READ - from provider to client

UDI_GIO_DIR_WRITE - from client to provider

These indicate the direction of data flow for the data_buf buffer. They do not imply any particular operation semantics.

The standard operation codes listed above are defined below with specific semantics. Additional, optional, standard operation codes are defined for device diagnostics in Chapter 26, "Diagnostics Support". The GIO provider may define additional custom operations, whose semantics and parameters are completely defined by the GIO provider. However, the basic rules for use of data_buf, data_buf->buf_size, and the direction flags must be followed in all cases. Driver-defined custom operations must use op values of UDI_GIO_OP_CUSTOM or greater.

The UDI_GIO_OP_READ and UDI_GIO_OP_WRITE operations use a udi_gio_rw_params_t structure for tr_params in the transfer control block.

The UDI_GIO_OP_READ operation reads data from the device at the offset indicated by offset_lo and offset_hi (if applicable). If there are fewer than data_buf->buf_size bytes remaining on the device at the time the request is processed, then those bytes that are present must be returned and data_buf->buf_size adjusted accordingly. If there are no data bytes available, and the possibility exists of more data arriving eventually, the provider must wait until at least one byte becomes available before responding.

The UDI_GIO_OP_WRITE operation writes data to the device at the offset indicated by offset_lo and offset_hi (if applicable). If the device cannot hold data_buf->buf_size additional bytes at the time the request is processed, then those bytes that fit must be sent to the device and data_buf->buf_size must be set to that value. Note that if the device is just temporarily unable to accept more data (for example, due to flow control), and can reasonably be expected to be eventually able to accept more data without external action, then the provider must continue to process the write operation once the device is no longer busy, and must not respond early with a short count.

Transfer constraints (see udi_xfer_constraints_t) apply to the standard read/write operations, but not to any other standard or custom operations.

REFERENCES udi_gio_xfer_cb_t, udi_gio_rw_params_t


UDI Core Specification Contents