2 .\" Copyright (c) 2008, Sun Microsystems, Inc., All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH DEV_OPS 9S "Sep 16, 2008"
8 dev_ops \- device operations structure
13 #include <sys/devops.h>
19 Solaris DDI specific (Solaris DDI).
23 \fBdev_ops\fR contains driver common fields and pointers to the \fBbus_ops\fR
27 Following are the device functions provided in the device operations structure.
28 All fields must be set at compile time.
35 Driver build version. Set this to \fBDEVO_REV\fR.
41 \fB\fBdevo_refcnt\fR\fR
44 Driver reference count. Set this to \fB0\fR.
50 \fB\fBdevo_getinfo\fR\fR
53 Get device driver information (see \fBgetinfo\fR(9E)).
59 \fB\fBdevo_identify\fR\fR
62 This entry point is obsolete. Set to \fBnulldev\fR.
68 \fB\fBdevo_probe\fR\fR
71 Probe device. See \fBprobe\fR(9E).
77 \fB\fBdevo_attach\fR\fR
80 Attach driver to \fBdev_info\fR. See \fBattach\fR(9E).
86 \fB\fBdevo_detach\fR\fR
89 Detach/prepare driver to unload. See \fBdetach\fR(9E).
95 \fB\fBdevo_reset\fR\fR
98 Reset device. (Not supported in this release.) Set this to \fBnodev\fR.
104 \fB\fBdevo_cb_ops\fR\fR
107 Pointer to \fBcb_ops\fR(9S) structure for leaf drivers.
113 \fB\fBdevo_bus_ops\fR\fR
116 Pointer to bus operations structure for nexus drivers. Set this to \fINULL\fR
117 if this is for a leaf driver.
123 \fB\fBdevo_power\fR\fR
126 Power a device attached to system. See \fBpower\fR(9E).
132 \fB\fBdevo_quiesce\fR\fR
135 Quiesce a device attached to system (see \fBquiesce\fR(9E) for more
136 information). This can be set to \fBddi_quiesce_not_needed()\fR if the driver
137 does not need to implement quiesce.
140 .SH STRUCTURE MEMBERS
146 int (*devo_getinfo)(dev_info_t *dip,
147 ddi_info_cmd_t infocmd, void *arg, void **result);
148 int (*devo_identify)(dev_info_t *dip);
149 int (*devo_probe)(dev_info_t *dip);
150 int (*devo_attach)(dev_info_t *dip,
151 ddi_attach_cmd_t cmd);
152 int (*devo_detach)(dev_info_t *dip,
153 ddi_detach_cmd_t cmd);
154 int (*devo_reset)(dev_info_t *dip, ddi_reset_cmd_t cmd);
155 struct cb_ops *devo_cb_ops;
156 struct bus_ops *devo_bus_ops;
157 int (*devo_power)(dev_info_t *dip, int component, int level);
158 int (*devo_quiesce)(dev_info_t *dip);
165 \fBattach\fR(9E), \fBdetach\fR(9E), \fBgetinfo\fR(9E), \fBprobe\fR(9E),
166 \fBpower\fR(9E), \fBquiesce\fR(9E), \fBnodev\fR(9F)
169 \fIWriting Device Drivers\fR