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

devswchg Kernel Service

Purpose

Alters a device switch entry point in the device switch table.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/device.h>
int devswchg (devno, type, newfunc, oldfunc);
dev_t devno;
int type;
int (*newfunc) ();
int (**oldfunc)();

Parameters

devno Specifies the major and minor device numbers of the device to be changed.
type Specifies the device switch entry point to alter. The type parameter can have one of the following values:
DSW_BLOCK Alters the ddstrategy entry point.
DSW_CONFIG Alters the ddconfig entry point.
DSW_CREAD Alters the ddread entry point.
DSW_CWRITE Alters the ddwrite entry point.
DSW_DUMP Alters the dddump entry point.
DSW_MPX Alters the ddmpx entry point.
DSW_SELECT Alters the ddselect entry point.
DSW_TCPATH Alters the ddrevoke entry point.
newfunc Specifies the new value for the device switch entry point.
oldfunc Specifies that the old value of the device switch entry point be returned here.

Description

The devswchg kernel service alters the value of a device switch entry point (function pointer) after a device switch table entry has been added by the devswadd kernel service. The device switch entry point specified by the type parameter is set to the value of the newfunc parameter. Its previous value is returned in the memory addressed by the oldfunc parameter. Only one device switch entry can be altered per call.

If the devswchg kernel service is unsuccessful, the value referenced by the oldfunc parameter is not defined.

Execution Environment

The devswchg kernel service can be called from the process environment only.

Return Values

0 Indicates a successful operation.
EINVAL Indicates the Type command was not valid.
ENODEV Indicates the device switch entry specified by the devno parameter is not defined.

Implementation Specifics

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

Related Information

The devswadd kernel service.

List of Kernel Extension and Device Driver Management Kernel Services and How Device Drivers are Accessed in AIX Version 4.3 Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]