Provides a description of standard device driver entry points parameters.
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.
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:
Macro | Descriptionf |
---|---|
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. |
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, 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.