Current File : //usr/man/man9s/dev_ops.9s
'\" te
.\" Copyright (c) 2008, Sun Microsystems, Inc., All Rights Reserved
.TH dev_ops 9S "16 Sep 2008" "SunOS 5.11" "Data Structures for Drivers"
.SH NAME
dev_ops \- device operations structure
.SH SYNOPSIS
.LP
.nf
#include <sys/conf.h>
#include <sys/devops.h>
.fi

.SH INTERFACE LEVEL
.sp
.LP
Solaris DDI specific (Solaris DDI).
.SH DESCRIPTION
.sp
.LP
\fBdev_ops\fR contains driver common fields and pointers to the \fBbus_ops\fR and \fBcb_ops\fR(9S). 
.sp
.LP
Following are the device functions provided in the device operations structure. All fields must be set at compile time.
.sp
.ne 2
.mk
.na
\fB\fBdevo_rev\fR\fR
.ad
.RS 17n
.rt  
Driver build version. Set this to \fBDEVO_REV\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fBdevo_refcnt\fR\fR
.ad
.RS 17n
.rt  
Driver reference count. Set this to \fB0\fR. 
.RE

.sp
.ne 2
.mk
.na
\fB\fBdevo_getinfo\fR\fR
.ad
.RS 17n
.rt  
Get device driver information (see \fBgetinfo\fR(9E)). 
.RE

.sp
.ne 2
.mk
.na
\fB\fBdevo_identify\fR\fR
.ad
.RS 17n
.rt  
This entry point is obsolete. Set to \fBnulldev\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fBdevo_probe\fR\fR
.ad
.RS 17n
.rt  
Probe device. See \fBprobe\fR(9E).
.RE

.sp
.ne 2
.mk
.na
\fB\fBdevo_attach\fR\fR
.ad
.RS 17n
.rt  
Attach driver to \fBdev_info\fR. See \fBattach\fR(9E).
.RE

.sp
.ne 2
.mk
.na
\fB\fBdevo_detach\fR\fR
.ad
.RS 17n
.rt  
Detach/prepare driver to unload. See \fBdetach\fR(9E).
.RE

.sp
.ne 2
.mk
.na
\fB\fBdevo_reset\fR\fR
.ad
.RS 17n
.rt  
Reset device. (Not supported in this release.) Set this to \fBnodev\fR.
.RE

.sp
.ne 2
.mk
.na
\fB\fBdevo_cb_ops\fR\fR
.ad
.RS 17n
.rt  
Pointer to \fBcb_ops\fR(9S) structure for leaf drivers.
.RE

.sp
.ne 2
.mk
.na
\fB\fBdevo_bus_ops\fR\fR
.ad
.RS 17n
.rt  
Pointer to bus operations structure for nexus drivers. Set this to \fINULL\fR if this is for a leaf driver.
.RE

.sp
.ne 2
.mk
.na
\fB\fBdevo_power\fR\fR
.ad
.RS 17n
.rt  
Power a device attached to system. See \fBpower\fR(9E).
.RE

.sp
.ne 2
.mk
.na
\fB\fBdevo_quiesce\fR\fR
.ad
.RS 17n
.rt  
Quiesce a device attached to system (see \fBquiesce\fR(9E) for more information). This can be set to \fBddi_quiesce_not_needed()\fR if the driver does not need to implement quiesce.
.RE

.SH STRUCTURE MEMBERS
.sp
.in +2
.nf
int             devo_rev;
int             devo_refcnt;
int             (*devo_getinfo)(dev_info_t *dip,
                ddi_info_cmd_t infocmd, void *arg, void **result);
int             (*devo_identify)(dev_info_t *dip);
int             (*devo_probe)(dev_info_t *dip);
int             (*devo_attach)(dev_info_t *dip,
                ddi_attach_cmd_t cmd);
int             (*devo_detach)(dev_info_t *dip,
                ddi_detach_cmd_t cmd);
int             (*devo_reset)(dev_info_t *dip, ddi_reset_cmd_t cmd);
struct cb_ops   *devo_cb_ops;
struct bus_ops  *devo_bus_ops;
int             (*devo_power)(dev_info_t *dip, int component, int level);
int             (*devo_quiesce)(dev_info_t *dip);
.fi
.in -2

.SH SEE ALSO
.sp
.LP
\fBattach\fR(9E), \fBdetach\fR(9E), \fBgetinfo\fR(9E), \fBprobe\fR(9E), \fBpower\fR(9E), \fBquiesce\fR(9E), \fBnodev\fR(9F) 
.sp
.LP
\fIWriting Device Drivers for Oracle Solaris 11.2\fR