aic(4): Remove ISA attachment.
[dragonfly.git] / share / man / man4 / devctl.4
1 .\"
2 .\" Copyright (c) 2002 M. Warner Losh
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. The name of the author may not be used to endorse or promote products
11 .\"    derived from this software without specific prior written permission.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD: src/share/man/man4/devctl.4,v 1.5 2006/08/04 07:56:32 yar Exp $
26 .\" $DragonFly: src/share/man/man4/devctl.4,v 1.2 2008/10/03 10:30:43 swildner Exp $
27 .\"
28 .Dd October 2, 2008
29 .Dt DEVCTL 4
30 .Os
31 .Sh NAME
32 .Nm devctl
33 .Nd "device event reporting and device control interface"
34 .Sh DESCRIPTION
35 The
36 .Nm
37 device is used to report device events from the kernel.
38 Future versions will allow for some device control as well.
39 .Sh IMPLEMENTATION NOTES
40 This design allows only one reader for
41 .Pa /dev/devctl .
42 This is not desirable
43 in the long run, but will get a lot of hair out of this implementation.
44 Maybe we should make this device a clonable device.
45 .Pp
46 Also note: we specifically do not attach a device to the
47 .Vt device_t
48 tree
49 to avoid potential chicken and egg problems.
50 One could argue that all of this belongs to the root node.
51 One could also further argue that the
52 .Xr sysctl 3
53 interface that we have now might more properly be an
54 .Xr ioctl 2
55 interface.
56 .Pp
57 .Dv SIGIO
58 support is included in the driver.
59 However, the author is not sure that the
60 .Dv SIGIO
61 support is done correctly.
62 It was copied from a driver that had
63 .Dv SIGIO
64 support that likely has not been
65 tested since
66 .Fx 3.4
67 or
68 .Fx 2.2.8 !
69 .Pp
70 The read channel for this device is used to report changes to
71 userland in realtime.
72 We return one record at a time.
73 If you try to read this device a character at a time, you will lose
74 the rest of the data.
75 Listening programs are expected to cope.
76 .Pp
77 The sysctl and boot parameter
78 .Va hw.bus.devctl_disable
79 is used to disable
80 .Nm
81 when no
82 .Xr devd 8
83 is running.
84 .Sh PROTOCOL
85 The
86 .Nm
87 device
88 uses an
89 .Tn ASCII
90 protocol.
91 The driver returns one record at a time to its readers.
92 Each record is terminated with a newline.
93 The first character of the record is the event type.
94 .Pp
95 .Bl -column -compact "Type" "Description"
96 .Em "Type       Description"
97 !       A notify event, such as a link state change.
98 +       Device node in tree attached.
99 -       Device node in tree detached.
100 ?       Unknown device detected.
101 .El
102 .Ss Message Formats
103 Except for the first character in the record, attach and detach
104 messages have the same format.
105 .Pp
106 .D1 Ar T Ns Ar dev Li at Ar parent Li on Ar location
107 .Pp
108 .Bl -column -compact "location" "Description"
109 .Em "Part       Description"
110 .It Ar T Ta "+ or -"
111 .It Ar dev Ta "The device name that was attached/detached."
112 .It Ar parent Ta "The device name of the parent bus that attached the device."
113 .It Ar location Ta "Bus specific location information."
114 .El
115 .Pp
116 The nomatch messages can be used to load devices driver.
117 If you load a device driver, then one of two things can happen.
118 If the device driver attaches to something, you will get a device
119 attached message.
120 If it does not, then nothing will happen.
121 .Pp
122 The attach and detach messages arrive after the event.
123 This means one cannot use the attach message to load an alternate
124 driver.
125 The attach message driver has already claimed this device.
126 One cannot use the detach messages to flush data to the device.
127 The device is already gone.
128 .Sh SEE ALSO
129 .Xr devd 8