summaryrefslogtreecommitdiff
path: root/static/freebsd/man4/devctl.4 3.html
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 19:55:43 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-25 19:55:43 -0400
commitac5e55f5f2af5b92794c2aded46c6bae85b5f5ed (patch)
tree9367490586c84cba28652e443e3166d66c33b0d9 /static/freebsd/man4/devctl.4 3.html
parent253e67c8b3a72b3a4757fdbc5845297628db0a4a (diff)
docs: Added All FreeBSD Manuals
Diffstat (limited to 'static/freebsd/man4/devctl.4 3.html')
-rw-r--r--static/freebsd/man4/devctl.4 3.html146
1 files changed, 146 insertions, 0 deletions
diff --git a/static/freebsd/man4/devctl.4 3.html b/static/freebsd/man4/devctl.4 3.html
new file mode 100644
index 00000000..ef6b602a
--- /dev/null
+++ b/static/freebsd/man4/devctl.4 3.html
@@ -0,0 +1,146 @@
+<table class="head">
+ <tr>
+ <td class="head-ltitle">DEVCTL(4)</td>
+ <td class="head-vol">Device Drivers Manual</td>
+ <td class="head-rtitle">DEVCTL(4)</td>
+ </tr>
+</table>
+<div class="manual-text">
+<section class="Sh">
+<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
+<p class="Pp"><code class="Nm">devctl</code> &#x2014; <span class="Nd">device
+ event reporting and device control interface</span></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
+<p class="Pp">The</p>
+<br/>
+<table class="Nm">
+ <tr>
+ <td><code class="Nm">devctl</code></td>
+ <td>driver is automatically included in the kernel.</td>
+ </tr>
+</table>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
+<p class="Pp">The <code class="Nm">devctl</code> device is used to report device
+ events from the kernel. Future versions will allow for some device control
+ as well.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="IMPLEMENTATION_NOTES"><a class="permalink" href="#IMPLEMENTATION_NOTES">IMPLEMENTATION
+ NOTES</a></h1>
+<p class="Pp">This design allows only one reader for
+ <span class="Pa">/dev/devctl</span>. This is not desirable in the long run,
+ but will get a lot of hair out of this implementation. Maybe we should make
+ this device a clonable device.</p>
+<p class="Pp">Also note: we specifically do not attach a device to the
+ <var class="Vt">device_t</var> tree to avoid potential chicken and egg
+ problems. One could argue that all of this belongs to the root node. One
+ could also further argue that the <a class="Xr">sysctl(3)</a> interface that
+ we have now might more properly be an <a class="Xr">ioctl(2)</a>
+ interface.</p>
+<p class="Pp"><code class="Dv">SIGIO</code> support is included in the driver.
+ However, the author is not sure that the <code class="Dv">SIGIO</code>
+ support is done correctly. It was copied from a driver that had
+ <code class="Dv">SIGIO</code> support that likely has not been tested since
+ <span class="Ux">FreeBSD 3.4</span> or <span class="Ux">FreeBSD
+ 2.2.8</span>!</p>
+<p class="Pp">The read channel for this device is used to report changes to
+ userland in realtime. We return one record at a time. If you try to read
+ this device a character at a time, you will lose the rest of the data.
+ Listening programs are expected to cope.</p>
+<p class="Pp">The sysctl <var class="Va">hw.bus.devctl_queue</var> can be used
+ to control queue length. It is set to 0 to disable
+ <code class="Nm">devctl</code> when no <a class="Xr">devd(8)</a> is
+ running.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="PROTOCOL"><a class="permalink" href="#PROTOCOL">PROTOCOL</a></h1>
+<p class="Pp">The <code class="Nm">devctl</code> device uses an ASCII protocol.
+ The driver returns one record at a time to its readers. Each record is
+ terminated with a newline. The first character of the record is the event
+ type.</p>
+<p class="Pp"></p>
+<table class="Bl-column Bl-compact">
+ <tr id="Type">
+ <td><a class="permalink" href="#Type"><i class="Em">Type</i></a></td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td>!</td>
+ <td>A notify event, such as a link state change.</td>
+ </tr>
+ <tr>
+ <td>+</td>
+ <td>Device node in tree attached.</td>
+ </tr>
+ <tr>
+ <td>-</td>
+ <td>Device node in tree detached.</td>
+ </tr>
+ <tr>
+ <td>?</td>
+ <td>Unknown device detected.</td>
+ </tr>
+</table>
+<section class="Ss">
+<h2 class="Ss" id="Message_Formats"><a class="permalink" href="#Message_Formats">Message
+ Formats</a></h2>
+<p class="Pp">Except for the first character in the record, attach and detach
+ messages have the same format.</p>
+<p class="Pp"></p>
+<div class="Bd Bd-indent"><var class="Ar">T</var><var class="Ar">dev</var>
+ <code class="Li">at</code> <var class="Ar">parent</var>
+ <code class="Li">on</code> <var class="Ar">location</var></div>
+<p class="Pp"></p>
+<table class="Bl-column Bl-compact">
+ <tr id="Part">
+ <td><a class="permalink" href="#Part"><i class="Em">Part</i></a></td>
+ <td>Description</td>
+ </tr>
+ <tr>
+ <td><var class="Ar">T</var></td>
+ <td>+ or -</td>
+ </tr>
+ <tr>
+ <td><var class="Ar">dev</var></td>
+ <td>The device name that was attached/detached.</td>
+ </tr>
+ <tr>
+ <td><var class="Ar">parent</var></td>
+ <td>The device name of the parent bus that attached the device.</td>
+ </tr>
+ <tr>
+ <td><var class="Ar">location</var></td>
+ <td>Bus specific location information.</td>
+ </tr>
+</table>
+<p class="Pp">The nomatch messages can be used to load devices driver. If you
+ load a device driver, then one of two things can happen. If the device
+ driver attaches to something, you will get a device attached message. If it
+ does not, then nothing will happen.</p>
+<p class="Pp">The attach and detach messages arrive after the event. This means
+ one cannot use the attach message to load an alternate driver. The attach
+ message driver has already claimed this device. One cannot use the detach
+ messages to flush data to the device. The device is already gone.</p>
+<p class="Pp">All values passed back are of the form &#x2018;key=value&#x2019;
+ or &#x2018;key=&quot;value&quot;&#x2019;. When the latter, the string
+ &#x201C;value&#x201D; must have any internal backslashes doubled. It must
+ also have any internal double quote characters &#x2018;&#x2019; preceded by
+ a backslash. All other characters should be passed through.</p>
+</section>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
+ ALSO</a></h1>
+<p class="Pp"><a class="Xr">devd(8)</a></p>
+</section>
+</div>
+<table class="foot">
+ <tr>
+ <td class="foot-date">September 21, 2020</td>
+ <td class="foot-os">FreeBSD 15.0</td>
+ </tr>
+</table>