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

devswqry Kernel Service

Purpose

Checks the status of a device switch entry in the device switch table.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/device.h>int devswqry (devno, status, dsdptr)
dev_t devno;
uint *status;
caddr_t *dsdptr;

Parameters

devno Specifies the major and minor device numbers of the device to be queried.
status Points to the status of the specified device entry in the device switch table. This parameter is passed by reference.
dsdptr Points to device-dependent information for the specified device entry in the device switch table. This parameter is passed by reference.

Description

The devswqry kernel service returns the status of a specified device entry in the device switch table. The entry in the table to query is determined by the major portion of the device number specified in the devno parameter. The status of the entry is returned in the status parameter that is passed by reference on the call. If this pointer is null on entry to the devswqry service, then the status is not returned to the caller.

The devswqry service also returns the address of device-dependent information for the specified device entry in the device switch table. This address is taken from the d_dsdptr field for the entry and returned in the dsdptr parameter, which is passed by reference. If this pointer is null on entry to the devswqry service, then the service does not return the address from the d_dsdptr field to the caller.

Status Parameter Flags

The status parameter comprises a set of flags that can indicate the following conditions:

DSW_BLOCK Device switch entry is defined by a block device driver. This flag is set when the device driver has a ddstrategy entry point.
DSW_CONFIG Device driver in this device switch entry provides an entry point for configuration.
DSW_CREAD Device driver in this device switch entry is providing a routine for character reads or raw input. This flag is set when the device driver has a ddread entry point.
DSW_CWRITE Device driver in this device switch entry is providing a routine for character writes or raw output. This flag is set when the device driver has a ddwrite entry point.
DSW_DEFINED Device switch entry is defined.
DSW_DUMP Device driver defined by this device switch entry provides the capability to support one or more of its devices as targets for a kernel dump. This flag is set when the device driver has provided a dddump entry point.
DSW_MPX Device switch entry is defined by a multiplexed device driver. This flag is set when the device driver has a ddmpx entry point.
DSW_OPENED Device switch entry is in use and the device has outstanding opens. This flag is set when the device driver has at least one outstanding open.
DSW_SELECT Device driver in this device switch entry provides a routine for handling the select or poll subroutines. This flag is set when the device driver has provided a ddselect entry point.
DSW_TCPATH Device driver in this device switch entry supports devices that are considered to be in the trusted computing path and provide support for the revoke function. This flag is set when the device driver has provided a ddrevoke entry point.
DSW_TTY Device switch entry is in use by a tty device driver. This flag is set when the pointer to the d_ttys structure is not a null character.
DSW_UNDEFINED Device switch entry is not defined.

The status parameter is set to the DSW_UNDEFINED flag when a device switch entry is not in use. This is the case if either of the following are true:

No other flags are set when the DSW_UNDEFINED flag is set.

Note: The status parameter must be a null character if called from the interrupt environment.

Execution Environment

The devswqry kernel service can be called from either the process or interrupt environment.

Return Values

0 Indicates a successful operation.
EINVAL Indicates that the major device number portion of the devno parameter exceeds the maximum permitted number of device switch entries.

Implementation Specifics

The devswqry kernel service is part of Base Operating System (BOS) Runtime.

Related Information

The devswadd kernel service, devswchg kernel service, devswdel kernel service.

Kernel Extension and Device Driver Management Kernel Services.


[ Previous | Next | Contents | Home | Search ]