[ Previous | Next | Contents | Search ]
AIXLink/X.25 1.1 for AIX: Guide and Reference

CIO_GET_STAT (Get Status) x25sioctl X.25 Device Handler Operation

Purpose

Returns the next status block.

Description

Note: Only a user-mode process can call the CIO_GET_STAT operation.

The CIO_GET_STAT x25sioctl operation reads the next status block available on the channel. This operation does not block. To call the CIO_GET_STAT operation, the DKERNEL flag must be clear, indicating a user-mode process. If a new status block is available for a kernel-mode process, the stat_fn kernel procedure defined by the x25sopen entry point is called.

For the CIO_GET_STAT operation, the arg parameter returns a pointer to a status_block structure as defined in the /usr/include/sys/comio.h file.

Status Blocks for the X.25 Device Handler

Status blocks are provided to user-mode and kernel-mode processes differently. Kernel-mode processes receive a status block when they are called using the stat_fn kernel procedure. This procedure is indicated when a channel is opened by the x25sopen entry point.

User-mode processes receive a status block whenever they issue a CIO_GET_STAT operation. In addition, a user-mode process can wait for the next available status block by issuing an x25sselect entry point with the DPOLLPRI event specified.

Status blocks can be solicited to indicate a completion of a previous command (such as a CIO_START operation). Status blocks can also be unsolicited to indicate some asynchronous event.

Status blocks contain a code field and possible options. The code field indicates the type of status block code (for example, CIO_START_DONE). The types of status blocks are:

CIO_HALT_DONE Status Block

This block is provided by the X.25 device handler when the CIO_HALT operation is complete:

option[0] Specifies the status or exception code. This option is set to CIO_OK if the start is successful. Otherwise, it is set to one of the status returns defined by the CIO_HALT operation.
option[1] Specifies the session ID and the network ID. The 2 high-order bytes contain the session ID, and the 2 low-order bytes contain the network ID.
option[2] Valid only if the CIO_HALT was used to issue a Clear Request. For a user-mode process, this option contains a pointer to the first byte of the process's data buffer.

For kernel-mode process, this option contains the mbuf structure passed with the CIO_HALT operation. The buffer described by the mbuf structure represents a Clear Confirm received in response to the Clear Request. If there was a clear collision, the buffer represents a Clear Indication that should be treated as an acknowledgment of the Clear Request as no Clear Confirm is subsequently received.

This option is null for other CIO_HALT operation types.

option[3] Not used.

CIO_NULL_BLK Status Block

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

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

CIO_START_DONE Status Block

This block is provided by the X.25 device handler when the CIO_START operation is complete:

option[0] Specifies the status or exception code. This option is set to CIO_OK if the start is successful. Otherwise, it is set to one of the status returns defined by the CIO_START operation.
option[1] Specifies the session ID and the network ID. The 2 high-order bytes contain the session ID and the 2 low-order bytes contain the network ID.
option[2] Valid only for a session of type SESSION_SVC_OUT. For a user-mode process, this option contains a pointer to the first byte of the process's data buffer.

For kernel-mode process, this option contains the mbuf structure passed with the CIO_START operation. The mbuf structure describes a buffer that represents either a Call Connected or a Clear Indication received in response to a Call Request.

This option is null for other session types.

option[3] Not used.

CIO_TX_DONE Status Block

This block is provided by the X.25 device handler when a transmit request for which an acknowledgment was requested is complete:

option[0] Specifies the status or exception code. This option is set to CIO_OK if the start is successful. Otherwise, it is set to one of the status returns defined by the x25swrite entry point.
option[1] Specifies the write ID in the write_extension structure. This structure is passed by the x25swrite entry point.
option[2] Points to the first byte of a user-mode process data buffer or to the mbuf structure for a kernel-mode process. The mbuf structure is passed with the x25swrite entry point.
option[3] Specifies the session ID in the 2 high-order bytes and the network ID in the 2 low-order bytes.

X25_REJECT_DONE Status Block

This status block indicates that the CIO_REJECT operation is complete:

option[0] Specifies the status or exception code. This option is set to CIO_OK if the start is successful. Otherwise, it is set to one of the status returns defined by the CIO_REJECT operation.
option[1] Specifies the session ID in the 2 high-order bytes and the network ID in the 2 low-order bytes.
option[2] Identifies the call ID of the incoming call that is being rejected.
option[3] Not used.

Execution Environment

The CIO_GET_STAT operation can be called from the process environment only.

Return Values

A return code of -1 indicates an unsuccessful operation. If -1 is returned, the kernel sets the errno global variable to the following value:

EFAULT Indicates an invalid address was specified.

Implementation Specifics

The CIO_GET_STAT operation functions with an X.25 Interface Co-Processor/2 that has been correctly configured for use on a qualified network. Consult adapter specifications for more information on configuring the adapter and network qualifications.

Related Information

Common Communications Status/Exception Codes in AIX Kernel Extensions and Device Support Programming Concepts.

The x25sioctl entry point x25sopen entry point, x25sselect entry point, x25swrite entry point.

The CIO_HALT x25sioctl X.25 Device Handler Operation, CIO_START x25sioctl X.25 Device Handler Operation, X25_REJECT x25sioctl X.25 Device Handler Operation.


[ Previous | Next | Contents | Search ]