DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

drvops(D4)


drvops -- declaration of unnamed DDI entry points

Synopsis

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

typedef struct drvops { int (*d_config)(cfg_func_t func, void *idata, rm_key_t key); int (*d_open)(void *idata, channel_t *channelp, int oflags, cred_t *crp, queue_t *q); int (*d_close)(void *idata, channel_t channel, int oflags, cred_t *crp, queue_t *q); int (*d_devinfo)(void *idata, channel_t channel, di_parm_t parm, void *valp); void (*d_biostart)(void *idata, channel_t channel, buf_t *bp); int (*d_ioctl)(void *idata, channel_t channel, int cmd, void *arg, int oflags, cred_t *crp, int *rvalp); int (*d_drvctl)(void *idata, channel_t channel, int cmd, void *arg); ppid_t (*d_mmap)(void *idata, channel_t channel, size_t offset, int prot); } drvops_t;

Description

The drvops structure is populated with the names of the entry point routines supported by the driver. The drv_ops member of the drvinfo(D4) structure is a pointer to this structure.

Structure members

The members are defined as:

d_config
pointer to the config(D2) entry point routine. Software-only drivers, including STREAMS modules, must set d_config to NULL. Other drivers must define the config( ) entry point routine.

d_open
pointer to the open(D2) entry point routine.

d_close
pointer to the close(D2) entry point routine.

d_devinfo
pointer to the devinfo(D2) entry point routine. All drivers must include a devinfo( ) entry point routine that is defined here.

d_biostart
pointer to the biostart(D2) entry point routine.

d_ioctl
pointer to the ioctl(D2) entry point routine.

d_drvctl
pointer to the drvctl(D2) entry point routine.

d_mmap
pointer to the mmap(D2) entry point routine.

Usage

All non-STREAMS DDI 8 drivers, including SDI drivers, must use the drv_attach(D3) function to pass their own drvinfo(D4) structure with an associated drvops structure to the kernel. Any of the entry point routines that are not used by the driver must be set to NULL in the drvops structure.

SDI HBA drivers also call the sdi_register(D3sdi) function and pass their hba_info(D4sdi) structure, which points to additional SDI-specific operations, including the special SDI versions of open( ), close( ), and ioctl( ) that are used in HBA drivers to support the SDI passthrough feature; see ``SDI pass-through interface'' in HDK Technical Reference. SDI drivers must set the drvops members for these functions to NULL.

The drvops structure is optional for DDI 8 STREAMS drivers, which also pass a streamtab(D4str) structure to declare their entry point routines. DDI 8 STREAMS drivers can use streamtab for all entry point routines, or can use drvops for non-STREAMS entry point routines and use streamtab just for the STREAMS-only entry points. ?

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 structure. All drivers must provide a devinfo(D2) entry point routine that is pointed to by the d_devinfo member of the drvops structure.

Hardware applicability

All

Version applicability

ddi: 8, 8mp

Differences between versions

DDI versions prior to version 8 used named entry points instead of the drvops structure.

References

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