tokconfig Token-Ring Device Handler Entry Point

Purpose

Note: This function is supported in AIX® 5.1 and earlier only.

Provides functions for initializing, terminating, and querying the vital product data (VPD) of the token-ring device handler.

Syntax

#include <sys/device.h>
#include <sys/uio.h>
#include <sys/comio.h>
#include <sys/tokuser.h>
int tokconfig 
(devno, cmd, uiop)
dev_t devno;
int cmd;
struct uio *uiop;

Parameters

Item Description
devno Specifies major and minor device numbers.
cmd Identifies the function to be performed by the tokconfig routine.
uiop Points to a uio structure, that describes the relevant data area for reading or writing.

Description

The tokconfig entry point provides functions for initializing, terminating, and querying the VPD of the token-ring device handler. The tokconfig routine is invoked at device configuration time. The tokconfig entry point provides the following three operations:

Operation Description
CFG_INIT Initializes the token-ring device handler. The token-ring device handler registers the entry points in the device switch table.

The token-ring define device structure (DDS) address and length is described in the uio structure. The DDS is copied into an internal save area by the device handler.

CFG_TERM Terminates the token-ring device handler. If there are no outstanding opens, the token-ring device handler marks itself terminated and prevents subsequent opens. All dynamically allocated areas are freed. All token-ring device handler entry points are removed from the device switch table.
CFG_QVPD Returns the token-ring VPD to the caller. The VPD is placed in the area specified by the caller in the uio structure.

The tokconfig 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.

Execution Environment

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

Return Values

Depending on the operation selected, the tokconfig entry point returns values.

Return Values for the CFG_INIT Operation

Item Description
ENOMEM Indicates the routine was unable to allocate space for the DDS.
EEXIST Indicates the device was already initialized.
EINVAL Indicates the DDS provided is not valid.
ENXIO Indicates the initialization of the token-ring device was unsuccessful.
EFAULT Indicates that the specified address is not valid.

Return Values for the CFG_TERM Operation

Item Description
EBUSY Indicates there are outstanding opens unable to terminate.
ENOENT Indicates there was no device to terminate.
EACCES Indicates the device was not configured.
EEXIST Unable to remove the device from the device switch table.

Return Values for the CFG_QVPD Operation

Item Description
ENOENT Indicates there was no device to query the VPD.
EFAULT Indicates that the specified address is not valid.
EACCES Indicates the token-ring device handler is not initialized.