[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts

Status Blocks for Communications Device Handlers Overview

Status blocks are used to communicate status and exception information.

User-mode processes receive a status block whenever they request a CIO_GET_STAT operation. A user-mode process can wait for the next available status block by issuing a ddselect entry point with the specified POLLPRI event.

A kernel-mode process receives a status block through the stat_fn procedure. This procedure is specified when the device is opened with the ddopen entry point.

Status blocks contain a code field and possible options. The code field indicates the type of status block code (for example, CIO_START_DONE). A status block's options depend on the block code. The C structure of a status block is defined in the /usr/include/sys/comio.h file.

The following are the six common status codes:

Additional device-dependent status block codes may be defined.

CIO_START_DONE

This block is provided by the device handler when the CIO_START operation completes:

option[0] The CIO_OK or CIO_HARD_FAIL status/exception code from the common or device-dependent list.
option[1] The low-order two bytes are filled in with the netid field. This field is passed when the CIO_START operation is invoked.
option[2] Device-dependent.
option[3] Device-dependent.

CIO_HALT_DONE

This block is provided by the device handler when the CIO_HALT operation completes:

option[0] The CIO_OK status/exception code from the common or device-dependent list.
option[1] The low-order two bytes are filled in with the netid field. This field is passed when the CIO_START operation is invoked.
option[2] Device-dependent.
option[3] Device-dependent.

CIO_TX_DONE

The following block is provided when the physical device handler (PDH) is finished with a transmit request for which acknowledgment was requested:

option[0] The CIO_OK or CIO_TIMEOUT status/exception code from the common or device-dependent list.
option[1] The write_id field specified in the write_extension structure passed in the ext parameter to the ddwrite entry point.
option[2] For a kernel-mode process, indicates the mbuf pointer for the transmitted frame.
option[3] Device-dependent.

CIO_NULL_BLK

This block is returned whenever a status block is requested but there are none available:

option[0] Not used
option[1] Not used
option[2] Not used
option[3] Not used

CIO_LOST_STATUS

This block is returned once after one or more status blocks is lost due to status queue overflow. The CIO_LOST_STATUS block provides the following:

option[0] Not used
option[1] Not used
option[2] Not used
option[3] Not used

CIO_ASYNC_STATUS

This status block is used to return status and exception codes that occur unexpectedly:

option[0] The CIO_HARD_FAIL or CIO_LOST_DATA status/exception code from the common or device-dependent list
option[1] Device-dependent
option[2] Device-dependent
option[3] Device-dependent

Related Information

The ddwrite entry point, ddselect entry point.

The CIO_HALT operation, CIO_GET_STAT operation, CIO_START operation.

Common Status/Exception Codes.


[ Previous | Next | Contents | Home | Search ]