1.\" $NetBSD: drvctl.8,v 1.20 2019/08/07 19:08:10 wiz 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 August 6, 2019 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 to allow the rescan of 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. 118The property can be given as a path of dictionary keys and numeric 119array indexes separated by slashes. 120.It Fl Q 121Resume the ancestors of 122.Ar device , 123.Ar device 124itself, and all of its descendants. 125.It Fl R 126Resume both the ancestors of 127.Ar device 128and 129.Ar device 130itself. 131.It Fl r 132Rescan the bus given by the 133.Ar busdevice 134argument. 135The scan range can be restricted by an optional 136.Ar locator 137list. 138.It Fl S 139Suspend both the descendants of 140.Ar device 141and 142.Ar device 143itself. 144.It Fl t 145Print a tree of devices in 146.Fl l 147output. 148.El 149.Sh FILES 150.Pa /dev/drvctl 151.Sh EXAMPLES 152To scan for IDE/SATA/eSATA disks on 153.Pa atabus1 , 154which need to use the 155.Qq ata_hl 156attribute: 157.Bd -literal -offset indent 158# drvctl -r -a ata_hl atabus1 159.Ed 160.Pp 161To scan for devices on a USB hub 162.Pa uhub3 , 163that have not been discovered by normal methods (or were detached 164with the 165.Fl d 166option for 167.Nm ) , 168need to use the 169.Qq usbifif 170or 171.Qq usbdevif 172attributes, try one or both of these: 173.Bd -literal -offset indent 174# drvctl -r -a usbifif uhub3 175# drvctl -r -a usbdevif uhub3 176.Ed 177.Sh SEE ALSO 178.Xr proplib 3 , 179.Xr drvctl 4 , 180.Xr autoconf 9 181.Sh HISTORY 182A 183.Nm 184utility appeard in 185.Nx 4.0 . 186.Sh BUGS 187Currently, there is no good way to get information about locator 188lengths and default values (which is present at kernel configuration 189time) out of a running kernel. 190Thus the locator handling is less intelligent than it could be. 191