xref: /netbsd-src/sbin/drvctl/drvctl.8 (revision 6a493d6bc668897c91594964a732d38505b70cbb)
1.\" $NetBSD: drvctl.8,v 1.13 2012/01/16 19:43:50 pgoyette Exp $
2.\"
3.\" Copyright (c) 2004
4.\" 	Matthias Drochner.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.Dd January 16, 2012
28.Dt DRVCTL 8
29.Os
30.Sh NAME
31.Nm drvctl
32.Nd tool to rescan busses and detach devices on user request
33.Sh SYNOPSIS
34.Nm
35.Fl r
36.Op Fl a Ar attribute
37.Ar busdevice
38.Op locator ...
39.Nm
40.Fl d
41.Ar device
42.Nm
43.Op Fl nt
44.Fl l
45.Op Ar device
46.Nm
47.Op Fl n
48.Fl p
49.Ar device
50.Op Ar property ...
51.Nm
52.Fl Q
53.Ar device
54.Nm
55.Fl R
56.Ar device
57.Nm
58.Fl S
59.Ar device
60.Sh DESCRIPTION
61The
62.Nm
63program works with the
64.Xr drvctl 4
65pseudo-driver, and allows to rescan busses and to detach
66drivers from devices.
67.Pp
68The following options are available:
69.Bl -tag -width 123456
70.It Fl a
71Give the interface attribute where children are to be
72attached to (and which defines the interpretation of
73the locator information).
74This will only be needed in rare cases where the bus
75has multiple attributes.
76If there are multiple attributes, and one is not specified,
77.Nm
78will return an Invalid argument.
79In such cases, the
80.Fl p
81option can be used to determine the available interface
82attributes.
83.It Fl d
84Detach the device driver from the device given by the
85.Ar device
86argument.
87.It Fl l
88List the children of the device specified by the
89.Ar device
90argument.
91If
92.Ar device
93is not specified, list roots of the device tree instead.
94Output comes in two columns.
95The first column is
96.Ar device ,
97or
98.Dq root
99if
100.Ar device
101is not specified.
102The second column is the child.
103.It Fl n
104Suppress first column in
105.Fl l
106output.
107Suppress non-XML headers in
108.Fl p
109output.
110.It Fl p
111Get properties for the device specified by the
112.Ar device
113argument.
114If
115.Ar property
116is specified, the value of that property is printed, otherwise
117the properties are displayed as an XML property list.
118.It Fl Q
119Resume the ancestors of
120.Ar device ,
121.Ar device
122itself, and all of its descendants.
123.It Fl R
124Resume both the ancestors of
125.Ar device
126and
127.Ar device
128itself.
129.It Fl r
130Rescan the bus given by the
131.Ar busdevice
132argument.
133The scan range can be restricted by an optional
134.Ar locator
135list.
136.It Fl S
137Suspend both the descendants of
138.Ar device
139and
140.Ar device
141itself.
142.It Fl t
143Print a tree of devices in
144.Fl l
145output.
146.El
147.Sh FILES
148.Pa /dev/drvctl
149.Sh SEE ALSO
150.Xr proplib 3 ,
151.\" .Xr drvctl 4 ,
152.Xr autoconf 9
153.Sh BUGS
154Currently, there is no good way to get information about locator
155lengths and default values (which is present at kernel configuration
156time) out of a running kernel.
157Thus the locator handling is less intelligent than it could be.
158