[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel and Subsystems Technical Reference, Volume 1

check Device Queue Management Routine


Provides a means for performing device-specific validity checking for parameters included in request queue elements.


#include <sys/types.h>
#include <sys/errno.h>
#include <sys/deviceq.h>
int check (type, ptr, length)
int type;
struct req_qe *ptr;
int length;


type Specifies the type of call. The following values are used when the kernel calls the check routine:
CHECK_PARMS + SEND_CMD Send command queue element.
CHECK_PARMS + START_IO Start I/O CCB queue element.
CHECK_PARMS + GEN_PURPOSE General purpose queue element.
ptr Specifies the address of the queue element.
length Specifies the length of the queue element.


Each device queue can have a check routine. This routine is optional and must be specified when the device queue is created with the creatq service. The enque service calls the check routine before a request queue element is put on the device queue. The kernel uses the routine's return value to determine whether to put the queue element on the device queue or to stop the request.

The kernel does not call the check routine when an acknowledgment or control queue element is sent. Therefore, the check routine is only called while executing within a process.

The address of the actual queue element is passed to this routine. In the check routine, take care to alter only the fields that were meant to be altered. This routine does not need to be serialized with the rest of the server's routines, because it is only checking the parameters in the queue element.

The check routine can check the request before the request queue element is placed on the device queue. The advantage of using this routine is that you can filter out unacceptable commands before they are put on the device queue.

The routine looks at the queue element and returns RC_GOOD if the request is acceptable. If the return code is not RC_GOOD, the kernel does not place the queue element in a device queue.

Execution Environment

The check routine executes under the process environment of the requester. Therefore, access to data areas must be handled as if the routine were in an interrupt handler environment. There is, however, no requirement to pin the code and data as in a normal interrupt handler environment.

Return Values

RC_GOOD Indicates successful completion.

All other return values are device-specific.

Implementation Specifics

The check routine is part of the Device Queue Management Kernel extension.

Related Information

The enque kernel service.

[ Previous | Next | Contents | Home | Search ]