xref: /freebsd/usr.sbin/usbconfig/usbconfig.8 (revision 2e07d451f9d7ad5ca59b60afd688a9c096d4c47e)
1eabe30fcSAlfred Perlstein.\" $FreeBSD$
2eabe30fcSAlfred Perlstein.\"
3cf109686SAndrew Thompson.\" Copyright (c) 2008-2010 Hans Petter Selasky. All rights reserved.
4eabe30fcSAlfred Perlstein.\"
5eabe30fcSAlfred Perlstein.\" Redistribution and use in source and binary forms, with or without
6eabe30fcSAlfred Perlstein.\" modification, are permitted provided that the following conditions
7eabe30fcSAlfred Perlstein.\" are met:
8eabe30fcSAlfred Perlstein.\" 1. Redistributions of source code must retain the above copyright
9eabe30fcSAlfred Perlstein.\"    notice, this list of conditions and the following disclaimer.
10eabe30fcSAlfred Perlstein.\" 2. Redistributions in binary form must reproduce the above copyright
11eabe30fcSAlfred Perlstein.\"    notice, this list of conditions and the following disclaimer in the
12eabe30fcSAlfred Perlstein.\"    documentation and/or other materials provided with the distribution.
13eabe30fcSAlfred Perlstein.\"
14eabe30fcSAlfred Perlstein.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15eabe30fcSAlfred Perlstein.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16eabe30fcSAlfred Perlstein.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17eabe30fcSAlfred Perlstein.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18eabe30fcSAlfred Perlstein.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19eabe30fcSAlfred Perlstein.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20eabe30fcSAlfred Perlstein.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21eabe30fcSAlfred Perlstein.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22eabe30fcSAlfred Perlstein.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23eabe30fcSAlfred Perlstein.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24eabe30fcSAlfred Perlstein.\" SUCH DAMAGE.
25eabe30fcSAlfred Perlstein.\"
26*2e07d451SEdward Tomasz Napierala.Dd December 30, 2017
27eabe30fcSAlfred Perlstein.Dt USBCONFIG 8
28eabe30fcSAlfred Perlstein.Os
29eabe30fcSAlfred Perlstein.Sh NAME
30eabe30fcSAlfred Perlstein.Nm usbconfig
31eabe30fcSAlfred Perlstein.Nd configure the USB subsystem
32eabe30fcSAlfred Perlstein.Sh SYNOPSIS
33eabe30fcSAlfred Perlstein.Nm
34eabe30fcSAlfred Perlstein.Op Fl u Ar unit
35eabe30fcSAlfred Perlstein.Op Fl a Ar addr
36eabe30fcSAlfred Perlstein.Op cmds...
37cf109686SAndrew Thompson.Nm
38cf109686SAndrew Thompson.Op Fl d Ar [ugen]<unit>.<addr>
39cf109686SAndrew Thompson.Op cmds...
40eabe30fcSAlfred Perlstein.Sh DESCRIPTION
41eabe30fcSAlfred PerlsteinThe
42eabe30fcSAlfred Perlstein.Nm
43eabe30fcSAlfred Perlsteinutility is used to configure and dump information about the USB subsystem.
44eabe30fcSAlfred Perlstein.Pp
45eabe30fcSAlfred PerlsteinThe options are as follows:
46eabe30fcSAlfred Perlstein.Bl -tag -width "        "
47eabe30fcSAlfred Perlstein.It Fl u Ar unit
48eabe30fcSAlfred PerlsteinLimit device range to USB devices connected to the given USBUS unit.
49eabe30fcSAlfred Perlstein.It Fl a Ar addr
50eabe30fcSAlfred PerlsteinLimit device range to the given USB device index.
51eabe30fcSAlfred PerlsteinShould only be used in conjunction with the unit argument.
52cf109686SAndrew Thompson.It Fl d Ar [ugen]<unit>.<addr>
53cf109686SAndrew ThompsonLimit device range to USB devices connected to the given unit and address.
54cf109686SAndrew ThompsonThe unit and address coordinates may be prefixed by the lowercased word "ugen".
55eabe30fcSAlfred Perlstein.It Fl h
56eabe30fcSAlfred PerlsteinShow help and available commands.
57eabe30fcSAlfred Perlstein.El
5894b7ebd7SChristian Brueffer.Pp
59*2e07d451SEdward Tomasz NapieralaThe following commands may be used with
60*2e07d451SEdward Tomasz Napierala.Nm :
61*2e07d451SEdward Tomasz Napierala.Bl -tag -width indent
62*2e07d451SEdward Tomasz Napierala.It Cm set_config Ar cfg_index
63*2e07d451SEdward Tomasz NapieralaChoose the configuration for the USB device.
64*2e07d451SEdward Tomasz NapieralaValid values range from zero to the number reported as the
65*2e07d451SEdward Tomasz Napierala.Ar bNumConfigurations
66*2e07d451SEdward Tomasz Napieralain
67*2e07d451SEdward Tomasz Napierala.Cm dump_device_desc
68*2e07d451SEdward Tomasz Napieralaoutput.
69*2e07d451SEdward Tomasz NapieralaThe special value of 255 unconfigures the device, detaching
70*2e07d451SEdward Tomasz Napieralathe interface drivers and reducing the power consumption to minimum,
71*2e07d451SEdward Tomasz Napieralabut without going into power saving mode or detaching from the bus.
72*2e07d451SEdward Tomasz NapieralaIn some cases, it prevents the device from charging.
73*2e07d451SEdward Tomasz Napierala.It Cm set_alt Ar alt_index
74*2e07d451SEdward Tomasz NapieralaChoose the alternate interface for the USB device.
75*2e07d451SEdward Tomasz NapieralaAlternative settings for the current configuration are available as the
76*2e07d451SEdward Tomasz Napierala.Ar bAlternateSetting
77*2e07d451SEdward Tomasz Napieralain
78*2e07d451SEdward Tomasz Napierala.Cm dump_curr_config_desc
79*2e07d451SEdward Tomasz Napieralaoutput.
80*2e07d451SEdward Tomasz NapieralaUsually there is no need to adjust this setting.
81*2e07d451SEdward Tomasz Napierala.It Cm set_template Ar template
82*2e07d451SEdward Tomasz NapieralaSet the global USB device side template.
83*2e07d451SEdward Tomasz NapieralaSee
84*2e07d451SEdward Tomasz Napierala.Xr usb_template 4
85*2e07d451SEdward Tomasz Napieralafor more information.
86*2e07d451SEdward Tomasz Napierala.It Cm get_template
87*2e07d451SEdward Tomasz NapieralaGet the current USB device side template.
88*2e07d451SEdward Tomasz Napierala.It Cm add_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name
89*2e07d451SEdward Tomasz NapieralaAdd a quirk by specifying the Vendor ID, Product ID, low and high
90*2e07d451SEdward Tomasz Napieralarevision numbers, and the quirk name.
91*2e07d451SEdward Tomasz NapieralaSee
92*2e07d451SEdward Tomasz Napierala.Xr usb_quirk 4
93*2e07d451SEdward Tomasz Napieralafor more information.
94*2e07d451SEdward Tomasz Napierala.It Cm remove_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name
95*2e07d451SEdward Tomasz NapieralaRemove a quirk.
96*2e07d451SEdward Tomasz Napierala.It Cm add_quirk Ar quirk_name
97*2e07d451SEdward Tomasz NapieralaAdd quirk for the currently selected USB device.
98*2e07d451SEdward Tomasz Napierala.It Cm remove_quirk Ar quirk_name
99*2e07d451SEdward Tomasz NapieralaRemove a quirk for the currently selected USB device.
100*2e07d451SEdward Tomasz Napierala.It Cm dump_quirk_names
101*2e07d451SEdward Tomasz NapieralaDisplay the list of supported quirk names.
102*2e07d451SEdward Tomasz Napierala.It Cm dump_device_quirks
103*2e07d451SEdward Tomasz NapieralaDisplay the list of current device quirks.
104*2e07d451SEdward Tomasz Napierala.It Cm dump_device_desc
105*2e07d451SEdward Tomasz NapieralaDisplay the device descriptor.
106*2e07d451SEdward Tomasz Napierala.It Cm dump_curr_config_desc
107*2e07d451SEdward Tomasz NapieralaDisplay current configuration descriptor.
108*2e07d451SEdward Tomasz Napierala.It Cm dump_all_config_desc
109*2e07d451SEdward Tomasz NapieralaDisplay all the configuration descriptors.
110*2e07d451SEdward Tomasz Napierala.It Cm dump_string Ar index
111*2e07d451SEdward Tomasz NapieralaDisplay string descriptor at selected index.
112*2e07d451SEdward Tomasz Napierala.It Cm dump_info
113*2e07d451SEdward Tomasz NapieralaDisplay summary information about the device.
114*2e07d451SEdward Tomasz Napierala.It Cm show_ifdrv
115*2e07d451SEdward Tomasz NapieralaDisplay the list of interface drivers (such as
116*2e07d451SEdward Tomasz Napierala.Xr ukbd 4
117*2e07d451SEdward Tomasz Napieralaor
118*2e07d451SEdward Tomasz Napierala.Xr u3g 4 )
119*2e07d451SEdward Tomasz Napieralacurrently attached to the device.
120*2e07d451SEdward Tomasz Napierala.It Cm suspend
121*2e07d451SEdward Tomasz NapieralaForce the device to suspend.
122*2e07d451SEdward Tomasz Napierala.It Cm resume
123*2e07d451SEdward Tomasz NapieralaForce the device to resume.
124*2e07d451SEdward Tomasz Napierala.It Cm power_off
125*2e07d451SEdward Tomasz NapieralaTurn the device off.
126*2e07d451SEdward Tomasz Napierala.It Cm power_save
127*2e07d451SEdward Tomasz NapieralaTurn the automatic suspend and resume on.
128*2e07d451SEdward Tomasz NapieralaThis is the default for USB hubs.
129*2e07d451SEdward Tomasz Napierala.It Cm power_on
130*2e07d451SEdward Tomasz NapieralaTurn the device on and disable automatic suspend and resume.
131*2e07d451SEdward Tomasz NapieralaThis is the default for non-hub devices.
132*2e07d451SEdward Tomasz Napierala.It Cm reset
133*2e07d451SEdward Tomasz NapieralaReset the device.
134*2e07d451SEdward Tomasz NapieralaThis forces the USB stack to reenumerate the bus.
135*2e07d451SEdward Tomasz Napierala.It Cm list
136*2e07d451SEdward Tomasz NapieralaList all available USB devices.
137*2e07d451SEdward Tomasz NapieralaThis is the default if
13894b7ebd7SChristian Brueffer.Nm
139*2e07d451SEdward Tomasz Napieralais called without specifying a command.
140*2e07d451SEdward Tomasz Napierala.It Cm do_request Ar bmReqTyp Ar bReq Ar wVal Ar wIdx Ar wLen Ar data...
141*2e07d451SEdward Tomasz NapieralaPerform a synchronous control request on the specified device.
142*2e07d451SEdward Tomasz NapieralaSee
143*2e07d451SEdward Tomasz Napierala.Xr libusb20_dev_request_sync 3
144*2e07d451SEdward Tomasz Napieralafor more information.
145*2e07d451SEdward Tomasz Napierala.El
14694b7ebd7SChristian Brueffer.Sh EXAMPLES
147*2e07d451SEdward Tomasz Napierala.Pp
14894b7ebd7SChristian BruefferShow information about the device on USB bus 1 at address 2:
14994b7ebd7SChristian Brueffer.Pp
150*2e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 dump_info
151cf109686SAndrew Thompson.Pp
152cf109686SAndrew ThompsonDump HID descriptor for device on USB bus 1 at address 2:
153cf109686SAndrew Thompson.Pp
154*2e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 do_request 0x81 0x06 0x2200 0 0x100
155cf109686SAndrew Thompson.Pp
156cf109686SAndrew ThompsonDump string descriptor at index Z for device on USB bus 1 at address 2:
157cf109686SAndrew Thompson.Pp
158*2e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 dump_string Z
159cf109686SAndrew Thompson.Pp
160cf109686SAndrew ThompsonDump current configuration descriptor for device on USB bus 1 at address 2:
161cf109686SAndrew Thompson.Pp
162*2e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 dump_curr_config_desc
163cf109686SAndrew Thompson.Pp
164cf109686SAndrew ThompsonDump device descriptor for device on USB bus 1 at address 2:
165cf109686SAndrew Thompson.Pp
166*2e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 dump_device_desc
167cf109686SAndrew Thompson.Pp
168cf109686SAndrew ThompsonProgram the device on USB bus 1 at address 2 to suspend, resume, power off, go into power save, or power on:
169cf109686SAndrew Thompson.Pp
170*2e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 suspend
171*2e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 resume
172*2e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 power_off
173*2e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 power_save
174*2e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 power_on
175cf109686SAndrew Thompson.Pp
176eabe30fcSAlfred Perlstein.Sh SEE ALSO
1770ea0127aSNick Hibma.Xr usb 4 ,
178*2e07d451SEdward Tomasz Napierala.Xr usb_quirk 4 ,
179*2e07d451SEdward Tomasz Napierala.Xr usb_template 4
180