-.\" $OpenBSD: usbdevs.8,v 1.11 2018/07/08 20:04:44 schwarze Exp $
+.\" $OpenBSD: usbdevs.8,v 1.12 2018/07/12 07:58:23 mpi Exp $
.\" $NetBSD: usbdevs.8,v 1.5 2000/10/15 12:44:11 bjh21 Exp $
.\"
.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: July 8 2018 $
+.Dd $Mdocdate: July 12 2018 $
.Dt USBDEVS 8
.Os
.Sh NAME
.Nd show USB devices connected to the system
.Sh SYNOPSIS
.Nm
-.Op Fl dv
+.Op Fl v
.Op Fl a Ar addr
-.Op Fl f Ar dev
+.Op Fl d Ar usbdev
.Sh DESCRIPTION
.Nm
prints a listing of all USB devices connected to the system
with some information about each device.
-The indentation of each line indicates its distance from the root.
.Pp
The options are as follows:
.Bl -tag -width Fl
.It Fl a Ar addr
Only print information about the device at the given address.
-.It Fl d
-Show the device drivers associated with each device.
-.It Fl f Ar dev
+.It Fl d Ar usbdev
Only print information for the given USB controller.
.It Fl v
Be verbose.
-/* $OpenBSD: usbdevs.c,v 1.28 2018/07/10 09:18:36 mpi Exp $ */
+/* $OpenBSD: usbdevs.c,v 1.29 2018/07/12 07:58:23 mpi Exp $ */
/* $NetBSD: usbdevs.c,v 1.19 2002/02/21 00:34:31 christos Exp $ */
/*
#define USBDEV "/dev/usb"
int verbose = 0;
-int showdevs = 0;
void usage(void);
void usbdev(int f, uint8_t);
void
usage(void)
{
- fprintf(stderr, "usage: %s [-dv] [-a addr] [-f dev]\n", __progname);
+ fprintf(stderr, "usage: %s [-v] [-a addr] [-d usbdev]\n", __progname);
exit(1);
}
}
printf("\n");
- if (showdevs) {
+ if (verbose) {
for (i = 0; i < USB_MAX_DEVNAMES; i++)
if (di.udi_devnames[i][0])
printf("\t driver: %s\n", di.udi_devnames[i]);
int addr = 0;
int ncont;
- while ((ch = getopt(argc, argv, "a:df:v?")) != -1) {
+ while ((ch = getopt(argc, argv, "a:d:v?")) != -1) {
switch (ch) {
case 'a':
addr = strtonum(optarg, 1, USB_MAX_DEVICES, &errstr);
errx(1, "addr %s", errstr);
break;
case 'd':
- showdevs = 1;
- break;
- case 'f':
dev = optarg;
break;
case 'v':