Note: This function is supported in AIX® 5.1 and earlier only.
Provides a means of transmitting data to the token-ring device handler.
#include <sys/device.h> #include <sys/uio.h> #include <sys/comio.h> #include <sys/tokuser.h> int tokwrite (devno, uiop, chan, arg) dev_t devno; struct uio * uiop; int chan; struct write_extension * arg;
Item | Description |
---|---|
devno | Specifies major and minor device numbers. |
uiop | Points to a uio structure specifying the location and length of the caller's data. |
chan | Specifies the channel number assigned by the tokmpx entry point. |
arg | Points to a write_extension structure. If the arg parameter is null, then default values are assumed. |
The tokwrite entry point provides the means for transmitting data to the token-ring device handler. The kernel calls it when a user-mode caller issues a write, writex, writev, or a writevx subroutine.
For a user-mode process, the kernel fills in the uio structure with the appropriate values. A kernel-mode process must fill in the uio structure as described by the ddwrite communications entry point.
For the tokwrite entry point, the arg parameter may point to a write_extension structure. This structure is defined in the /usr/include/sys/comio.h file and contains the following fields:
Field | Description |
---|---|
status | Indicates the status condition that occurred. Possible values for the returned status field are: |
flag | Consists
of a possible bitwise OR one of the following:
|
write_id | For a user-mode caller, the write_id field is returned to the caller by the CIO_GET_STAT operation (if the CIO_ACK_TX_DONE option is selected). For a kernel-mode caller, the write_id field is returned to the caller by the stat_fn function that was provided at open time. |
The tokwrite entry point functions with a Token-Ring High Performance Network Adapter that has been correctly configured for use on a qualified network. Consult adapter specifications for more information on configuring the adapter and network qualifications.
The tokwrite entry point can be called from the process environment only.
Item | Description |
---|---|
EAGAIN | Indicates the transmit queue is full. |
EFAULT | Indicates an invalid address was supplied. |
EINTR | Indicates a system call was interrupted. |
EINVAL | Indicates the specified parameter is not valid. |
ENETDOWN | Indicates the network is down. The device is unable to process the write. |
ENETUNREACH | Indicates the device is in network Recovery mode and unable to process the entry point. |
ENOCONNECT | Indicates the device has not been started. |
ENOMEM | Indicates the device handler was unable to allocate the required memory. |
ENXIO | Indicates the specified minor number is not valid. |