|
|
#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;
drv_ops
member of the
drvinfo(D4)
structure is a pointer to this structure.
d_config
d_config
to NULL.
Other drivers must define the
config( )
entry point routine.
d_open
d_close
d_devinfo
d_biostart
d_ioctl
d_drvctl
d_mmap
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.