1dev_ops(9S) Data Structures for Drivers dev_ops(9S)
2
3
4
6 dev_ops - device operations structure
7
9 #include <sys/conf.h>
10 #include <sys/devops.h>
11
12
14 Solaris DDI specific (Solaris DDI).
15
17 dev_ops contains driver common fields and pointers to the bus_ops and
18 cb_ops(9S).
19
20
21 Following are the device functions provided in the device operations
22 structure. All fields must be set at compile time.
23
24 devo_rev Driver build version. Set this to DEVO_REV.
25
26
27 devo_refcnt Driver reference count. Set this to 0.
28
29
30 devo_getinfo Get device driver information (see getinfo(9E)).
31
32
33 devo_identify This entry point is obsolete. Set to nulldev.
34
35
36 devo_probe Probe device. See probe(9E).
37
38
39 devo_attach Attach driver to dev_info. See attach(9E).
40
41
42 devo_detach Detach/prepare driver to unload. See detach(9E).
43
44
45 devo_reset Reset device. (Not supported in this release.) Set
46 this to nodev.
47
48
49 devo_cb_ops Pointer to cb_ops(9S) structure for leaf drivers.
50
51
52 devo_bus_ops Pointer to bus operations structure for nexus drivers.
53 Set this to NULL if this is for a leaf driver.
54
55
56 devo_power Power a device attached to system. See power(9E).
57
58
59 devo_quiesce Quiesce a device attached to system (see quiesce(9E)
60 for more information). This can be set to ddi_qui‐
61 esce_not_needed() if the driver does not need to
62 implement quiesce.
63
64
66 int devo_rev;
67 int devo_refcnt;
68 int (*devo_getinfo)(dev_info_t *dip,
69 ddi_info_cmd_t infocmd, void *arg, void **result);
70 int (*devo_identify)(dev_info_t *dip);
71 int (*devo_probe)(dev_info_t *dip);
72 int (*devo_attach)(dev_info_t *dip,
73 ddi_attach_cmd_t cmd);
74 int (*devo_detach)(dev_info_t *dip,
75 ddi_detach_cmd_t cmd);
76 int (*devo_reset)(dev_info_t *dip, ddi_reset_cmd_t cmd);
77 struct cb_ops *devo_cb_ops;
78 struct bus_ops *devo_bus_ops;
79 int (*devo_power)(dev_info_t *dip, int component, int level);
80 int (*devo_quiesce)(dev_info_t *dip);
81
82
84 attach(9E), detach(9E), getinfo(9E), probe(9E), power(9E), quiesce(9E),
85 nodev(9F)
86
87
88 Writing Device Drivers
89
90
91
92SunOS 5.11 16 Sep 2008 dev_ops(9S)