1 .\" $OpenBSD: hotplug.4,v 1.3 2007/05/31 19:19:50 jmc Exp $
3 .\" Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 .Nd devices hot plugging
24 .Cd "pseudo-device hotplug 1"
32 pseudo-device passes device attachment and detachment events to
34 When a device attaches or detaches, the corresponding event is queued.
35 The events can then be obtained from the queue through the
40 Once an event has been read, it's deleted from the queue.
41 The event queue has a limited size and if it's full all new events will be
43 Each event is described with the following structure declared in the
46 .Bd -literal -offset indent
47 struct hotplug_event {
48 int he_type; /* event type */
49 enum devclass he_devclass; /* device class */
50 char he_devname[16]; /* device name */
56 field describes the event type and can be either
58 for device attachment or
63 field describes the device class.
64 All device classes can be found in the
67 .Bd -literal -offset indent
69 DV_DULL, /* generic, no special info */
70 DV_CPU, /* CPU (carries resource utilization) */
71 DV_DISK, /* disk drive (label, etc) */
72 DV_IFNET, /* network interface */
73 DV_TAPE, /* tape device */
74 DV_TTY /* serial line interface */
80 is a device name including unit number, e.g.\&
83 Only one structure can be read per call.
84 If there are no events in the queue, the
86 call will block until an event appears.
89 .It "hotplug: event lost, queue full"
90 New events will be dropped until all pending events have been read.
98 device first appeared in
102 driver was imported to
107 driver was written by
108 .An Alexander Yurchenko Aq grange@openbsd.org .