I/O Request Processing

A port driver receives I/O requests through its I/O request routine, that is, the routine the driver inserted in the calldown list when processing the AEP_CONFIG_DCB function.

When the driver receives a request, the IOP structure for the request is on the stack. The driver must check the IOR_func member to determine whether it can process the request. If the request is valid, the driver should carry out the request immediately if possible. If the device is not ready to carry out I/O operations, the driver should use the ILB_enqueue_iop routine to place the IOP and the corresponding DCB structure in the IOP queue, then return from the request. Later, when the device is ready, the driver can use the ILB_dequeue_iop routine to retrieve the IOP from the queue and process the request.

When the driver completes processing of a request, the driver must set the IOR_status member to an appropriate value and call the callback procedure whose address is pointed to by the IOP_callback_ptr member. If the driver can not process a request, either because the request fails or is invalid, the driver must set IOR_status and call the callback procedure.

When a port driver receives an I/O request, it expects the following members to be valid in the IOP and IOR structures:

IOR_func

Function to be performed.

IOP_physical_dcb

Address of physical DCB for the device.

IOR_xfer_count

Total size of transfer, if any.

IOR_sgd_lin_phys

Linear address of list of scatter/gather elements, if any.

IOR_num_sgds

Count of scatter/gather elements.


The port driver always updates the IOR_status member, setting it to a value that indicates the status of the completed request.

See also AEP, ILB_dequeue_iop, ILB_enqueue_iop, IOP, IOR