GIO_control
2-124
C Interface
Syntax
status = GIO_control(gioChan, cmd, args);
Parameters
GIO_Handle gioChan; /* handle to an instance of the device */
Int
cmd;
/* control functionality to perform */
Ptr
args;
/* data structure to pass control information */
Return Value
Int
status;
/* returns IOM_COMPLETED if successful */
Description
An application calls GIO_control to configure or perform control
functionality on the communication channel.
The cmd parameter may be one of the command code constants listed
in “Constants, Types, and Structures” on page 2-118. A mini-driver may
add command codes for additional functionality.
The args parameter points to a data structure defined by the device to
allow control information to be passed between the device and the
application. This structure can be generic across a domain or specific to
a mini-driver. In some cases, this argument may point directly to a buffer
holding control data. In other cases, there may be a level of indirection if
the mini-driver expects a data structure to package many components of
data required for the control operation. In the simple case where no data
is required, this parameter may just be a predefined command value.
GIO_control returns IOM_COMPLETED upon success. If an error
occurs, the device returns a negative value. For a list of error values, see
“Constants, Types, and Structures” on page 2-118.
A call to GIO_control results in a call to the mdControl function of the
associated mini-driver. The mdControl call is typically a blocking call, so
calling GIO_control can result in blocking.
Constraints and
Calling Context
❏
This function can be called only after the device has been loaded and
initialized. The handle supplied should have been obtained with a
prior call to GIO_create or GIO_new.
❏
GIO_control cannot be called from a SWI or HWI unless the
underlying mini-driver is a non-blocking driver and the GIO Manager
properties are set to use non-blocking synchronization methods.
Example
/* Carry out control/configuration on the device*/
gioStatus = GIO_control(gioChan, XXX_RESET, &args);
GIO_control
Device specific control call