DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

drvinfo(D4)


drvinfo -- externally visible driver characteristics

Syntax

   #include <sys/types.h>
   #include <sys/ddi.h>
   

typedef struct { const drvops_t *drv_ops; const char *drv_name; uint_t drv_flags; const streamtab *drv_str; channel_t drv_maxchan; } drvinfo_t;

Description

The drvinfo structure describes driver properties and entry points.

Structure definitions

The members are defined as:

drv_ops
pointer to the entry point ops vector

drv_name
driver's externally-visible name. This should be set based on the MODNAME or prfx_MODNAME preprocessor symbol in the Space.c(DSP/4dsp) file rather than being hard-coded.

drv_flags
Set of flags describing driver properties. Valid flags are:

D_MP
Driver is multiprocessor-safe.

D_HOT
Driver supports the hotplug subfunctions to the config(D2) entry point routine: CFG_SUSPEND, CFG_RESUME, CFG_MODIFY, and CFG_REMOVE. See ``Hotplug devices'' in HDK Technical Reference.

D_MOD
Driver is a STREAMS module rather than a STREAMS driver.

D_UPF
Driver is a multithreaded, multiplexing STREAMS driver that has both upper and lower read and write service routines.

D_RANDOM
Non-STREAMS driver supports random access. If not set, the driver ignores the values of the b_blkno and b_blkoff members of the buf(D4) structure.

D_NOSPECMACDATA
Mandatory Access Control checking is not performed during data transfers to and from the device controlled by this driver and the access time field in the inode is not updated.

D_INITPUB
Device controlled by this driver is, by default, accessible by non-privileged processes. This setting can be changed using a security system call.

D_RDWEQ
All accesses of the device controlled by the driver (both read and write) require strict equality under the Mandatory Access Control policy.

drv_str
For STREAMS drivers, contains a pointer to the driver's streamtab(D4str) structure. For all other driver types, this member contains a NULL pointer.

drv_maxchan
Maximum channel number per instance that this driver supports. This value must match the value in the $maxchan field of the driver's Node(DSP/4dsp) file.

The typical driver only uses one channel, so this value is typically 0; channel numbering begins with zero. Drivers that support multiple device files per device instance use non-zero values here. Examples include a driver that supports multiple operating modes, such as with or without flow control, or multiple subparts such as slices on a disk. So an 8-port serial board usually requires at least 16 nodes, two for each port to indicate modem or non-modem control; in this case, drv_maxchan is set to 15. Drivers that use open redirection (or ``cloning''), should create one channel for the initial open plus one for each clone channel. See open(D2) for more information about open redirection.

The driver should set this to the value it actually needs, because the kernel might, for example, try to pack channel numbers for multiple instances into a single minor number field.

Usage

Non-STREAMS DDI 8 drivers must register themselves with the system by passing a drvinfo structure to the drv_attach(D3) function. This structure identifies the type of driver, its entry points, and other driver properties of which the core kernel must be aware. Use of the drvinfo structure is optional for DDI 8 STREAMS drivers.

Three general types of drivers may be identified: non-STREAMS drivers, STREAMS drivers, and STREAMS modules. The drv_str member points to a streamtab(D4str) structure for STREAMS drivers and STREAMS modules; it must be set to NULL for non-STREAMS drivers. The D_MOD flag distinguishes a STREAMS module from a STREAMS driver. The D_MOD and D_UPF flags may be set only if drv_str is non-NULL.

Drivers that control some hardware device, either a directly connected adapter or an attached device such as a SCSI disk, are considered hardware drivers and must provide a config(D2) entry point that is pointed to by the d_config member of the drvops(D4) structure. Software-only drivers must set d_config to NULL. All STREAMS modules are software-only drivers.

Hardware applicability

All

Version applicability

ddi: 8, 8mp

Differences between versions

Drivers written for earlier DDI versions provided some of this information through their devflag(D1) declarations.

Some flags in the list are carried over from the devflag(D1) flags. The D_NOBRKUP and D_BLKOFF devflag flags are obsolete and are considered to always be set; the D_DMA and D_TAPE devflag flags are obsolete and are considered to always be cleared.

References

drv_attach(D3), drvops(D4) Intro(D2)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005