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

Standard Parameters to Device Driver Entry Points

Description

There are three parameters passed to device driver entry points that always have the same meanings: the devno parameter, the chan parameter, and the ext parameter.

The devno Parameter

This value, defined to be of type dev_t, specifies the device or subdevice to which the operation is directed. For convenience and portability, the /usr/include/sys/sysmacros.h file defines the following macros for manipulating device numbers:

major(devno) Returns the major device number.
minor(devno) Returns the minor device number.
makedev(maj, min). Constructs a composite device number in the format of devno from the major and minor device numbers given.

The chan Parameter

This value, defined to be of type chan_t, is the channel ID for a multiplexed device driver. If the device driver is not multiplexed, chan has the value of 0. If the driver is multiplexed, then the chan parameter is the chan_t value returned from the device driver's ddmpx routine.

The ext Parameter

The ext parameter, or extension parameter, is defined to be of type int. It is meaningful only with calls to such extended subroutines as the openx, readx, writex, and ioctlx subroutines. These subroutines allow applications to pass an extra, device-specific parameter to the device driver. This parameter is then passed to the ddopen, ddread, ddwrite, and ddioctl device driver entry points as the ext parameter. If the application uses one of the non-extended subroutines (for example, the read instead of the readx subroutine), then the ext parameter has a value of 0.

Note: Using the ext parameter is highly discouraged because doing so makes an application program less portable to other operating systems.

Related Information

The ddioctl device driver entry point, ddmpx device driver entry point, ddopen device driver entry point, ddread device driver entry point, ddwrite device driver entry point.

The close subroutine, ioctl subroutine, lseek subroutine, open subroutine, read subroutine, write subroutine.

Device Driver Kernel Extension Overview in AIX Kernel Extensions and Device Support Programming Concepts.

Programming in the Kernel Environment Overview in AIX Kernel Extensions and Device Support Programming Concepts.


[ Previous | Next | Contents | Home | Search ]