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

tokwrite Token-Ring Device Handler Entry Point

Purpose

Provides a means of transmitting data to the token-ring device handler.

Syntax

#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;

Parameters

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.

Description

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:

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:
CIO_NOFREE_MBUF Requests that the token-ring device handler not free the mbuf structure after transmission is complete. The default is bit clear (free the buffer). For a user-mode process, the token-ring device handler always frees the mbuf structure.
CIO_ACK_TX_DONE Requests that, when done with this operation, the token-ring device handler acknowledges completion by building a CIO_TX_DONE status block. In addition, requests the token-ring device handler either call the kernel status function or (for a user-mode process) place the status block in the status/exception queue. The default is bit clear (do not acknowledge transmit completion).
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.

Execution Environment

The tokwrite entry point can be called from the process environment only.

Return Values

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.

Implementation Specifics

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.

Related Information

The CIO_GET_FASTWRT tokioctl entry point

The ddwrite entry point, tokfastwrt entry point, tokmpx entry point, tokopen entry point.

The write, writex, writev, or writevx,subroutine.

The CIO_START tokioctl operation.

The uio structure in BkSym.TRKernel5;.

See the Use of mbuf Structures in the Communications PDH in AIX Kernel Extensions and Device Support Programming Concepts for more information about mbuf structures.


[ Previous | Next | Contents | Home | Search ]