xref: /freebsd/usr.sbin/usbconfig/usbconfig.8 (revision 912280b4b4bb73550319bb860aa3d3b641e1ddfe)
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*912280b4SEdward Tomasz Napierala.Dd April 17, 2018
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
38*912280b4SEdward Tomasz Napierala.Op Oo Fl d Oc 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
592e07d451SEdward Tomasz NapieralaThe following commands may be used with
602e07d451SEdward Tomasz Napierala.Nm :
612e07d451SEdward Tomasz Napierala.Bl -tag -width indent
622e07d451SEdward Tomasz Napierala.It Cm set_config Ar cfg_index
632e07d451SEdward Tomasz NapieralaChoose the configuration for the USB device.
642e07d451SEdward Tomasz NapieralaValid values range from zero to the number reported as the
652e07d451SEdward Tomasz Napierala.Ar bNumConfigurations
662e07d451SEdward Tomasz Napieralain
672e07d451SEdward Tomasz Napierala.Cm dump_device_desc
682e07d451SEdward Tomasz Napieralaoutput.
692e07d451SEdward Tomasz NapieralaThe special value of 255 unconfigures the device, detaching
702e07d451SEdward Tomasz Napieralathe interface drivers and reducing the power consumption to minimum,
712e07d451SEdward Tomasz Napieralabut without going into power saving mode or detaching from the bus.
722e07d451SEdward Tomasz NapieralaIn some cases, it prevents the device from charging.
732e07d451SEdward Tomasz Napierala.It Cm set_alt Ar alt_index
742e07d451SEdward Tomasz NapieralaChoose the alternate interface for the USB device.
752e07d451SEdward Tomasz NapieralaAlternative settings for the current configuration are available as the
762e07d451SEdward Tomasz Napierala.Ar bAlternateSetting
772e07d451SEdward Tomasz Napieralain
782e07d451SEdward Tomasz Napierala.Cm dump_curr_config_desc
792e07d451SEdward Tomasz Napieralaoutput.
802e07d451SEdward Tomasz NapieralaUsually there is no need to adjust this setting.
812e07d451SEdward Tomasz Napierala.It Cm set_template Ar template
822e07d451SEdward Tomasz NapieralaSet the global USB device side template.
832e07d451SEdward Tomasz NapieralaSee
842e07d451SEdward Tomasz Napierala.Xr usb_template 4
852e07d451SEdward Tomasz Napieralafor more information.
862e07d451SEdward Tomasz Napierala.It Cm get_template
872e07d451SEdward Tomasz NapieralaGet the current USB device side template.
882e07d451SEdward Tomasz Napierala.It Cm add_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name
892e07d451SEdward Tomasz NapieralaAdd a quirk by specifying the Vendor ID, Product ID, low and high
902e07d451SEdward Tomasz Napieralarevision numbers, and the quirk name.
912e07d451SEdward Tomasz NapieralaSee
922e07d451SEdward Tomasz Napierala.Xr usb_quirk 4
932e07d451SEdward Tomasz Napieralafor more information.
942e07d451SEdward Tomasz Napierala.It Cm remove_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name
952e07d451SEdward Tomasz NapieralaRemove a quirk.
962e07d451SEdward Tomasz Napierala.It Cm add_quirk Ar quirk_name
972e07d451SEdward Tomasz NapieralaAdd quirk for the currently selected USB device.
982e07d451SEdward Tomasz Napierala.It Cm remove_quirk Ar quirk_name
992e07d451SEdward Tomasz NapieralaRemove a quirk for the currently selected USB device.
100cd1fd29cSEdward Tomasz Napierala.It Cm dump_all_desc
101cd1fd29cSEdward Tomasz NapieralaDisplay the device and configuration descriptors.
1022e07d451SEdward Tomasz Napierala.It Cm dump_quirk_names
1032e07d451SEdward Tomasz NapieralaDisplay the list of supported quirk names.
1042e07d451SEdward Tomasz Napierala.It Cm dump_device_quirks
1052e07d451SEdward Tomasz NapieralaDisplay the list of current device quirks.
1062e07d451SEdward Tomasz Napierala.It Cm dump_device_desc
1072e07d451SEdward Tomasz NapieralaDisplay the device descriptor.
1082e07d451SEdward Tomasz Napierala.It Cm dump_curr_config_desc
1092e07d451SEdward Tomasz NapieralaDisplay current configuration descriptor.
1102e07d451SEdward Tomasz Napierala.It Cm dump_all_config_desc
1112e07d451SEdward Tomasz NapieralaDisplay all the configuration descriptors.
1122e07d451SEdward Tomasz Napierala.It Cm dump_string Ar index
1132e07d451SEdward Tomasz NapieralaDisplay string descriptor at selected index.
1142e07d451SEdward Tomasz Napierala.It Cm dump_info
1152e07d451SEdward Tomasz NapieralaDisplay summary information about the device.
1162e07d451SEdward Tomasz Napierala.It Cm show_ifdrv
1172e07d451SEdward Tomasz NapieralaDisplay the list of interface drivers (such as
1182e07d451SEdward Tomasz Napierala.Xr ukbd 4
1192e07d451SEdward Tomasz Napieralaor
1202e07d451SEdward Tomasz Napierala.Xr u3g 4 )
1212e07d451SEdward Tomasz Napieralacurrently attached to the device.
1222e07d451SEdward Tomasz Napierala.It Cm suspend
1232e07d451SEdward Tomasz NapieralaForce the device to suspend.
1242e07d451SEdward Tomasz Napierala.It Cm resume
1252e07d451SEdward Tomasz NapieralaForce the device to resume.
1262e07d451SEdward Tomasz Napierala.It Cm power_off
1272e07d451SEdward Tomasz NapieralaTurn the device off.
1282e07d451SEdward Tomasz Napierala.It Cm power_save
1292e07d451SEdward Tomasz NapieralaTurn the automatic suspend and resume on.
1302e07d451SEdward Tomasz NapieralaThis is the default for USB hubs.
1312e07d451SEdward Tomasz Napierala.It Cm power_on
1322e07d451SEdward Tomasz NapieralaTurn the device on and disable automatic suspend and resume.
1332e07d451SEdward Tomasz NapieralaThis is the default for non-hub devices.
1342e07d451SEdward Tomasz Napierala.It Cm reset
1352e07d451SEdward Tomasz NapieralaReset the device.
1362e07d451SEdward Tomasz NapieralaThis forces the USB stack to reenumerate the bus.
1372e07d451SEdward Tomasz Napierala.It Cm list
1382e07d451SEdward Tomasz NapieralaList all available USB devices.
1392e07d451SEdward Tomasz NapieralaThis is the default if
14094b7ebd7SChristian Brueffer.Nm
1412e07d451SEdward Tomasz Napieralais called without specifying a command.
1422e07d451SEdward Tomasz Napierala.It Cm do_request Ar bmReqTyp Ar bReq Ar wVal Ar wIdx Ar wLen Ar data...
1432e07d451SEdward Tomasz NapieralaPerform a synchronous control request on the specified device.
1442e07d451SEdward Tomasz NapieralaSee
1452e07d451SEdward Tomasz Napierala.Xr libusb20_dev_request_sync 3
1462e07d451SEdward Tomasz Napieralafor more information.
1472e07d451SEdward Tomasz Napierala.El
14894b7ebd7SChristian Brueffer.Sh EXAMPLES
14994b7ebd7SChristian BruefferShow information about the device on USB bus 1 at address 2:
15094b7ebd7SChristian Brueffer.Pp
1512e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 dump_info
152cf109686SAndrew Thompson.Pp
153cf109686SAndrew ThompsonDump HID descriptor for device on USB bus 1 at address 2:
154cf109686SAndrew Thompson.Pp
1552e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 do_request 0x81 0x06 0x2200 0 0x100
156cf109686SAndrew Thompson.Pp
157cf109686SAndrew ThompsonDump string descriptor at index Z for device on USB bus 1 at address 2:
158cf109686SAndrew Thompson.Pp
1592e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 dump_string Z
160cf109686SAndrew Thompson.Pp
161cf109686SAndrew ThompsonDump current configuration descriptor for device on USB bus 1 at address 2:
162cf109686SAndrew Thompson.Pp
1632e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 dump_curr_config_desc
164cf109686SAndrew Thompson.Pp
165cf109686SAndrew ThompsonDump device descriptor for device on USB bus 1 at address 2:
166cf109686SAndrew Thompson.Pp
1672e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 dump_device_desc
168cf109686SAndrew Thompson.Pp
169cf109686SAndrew ThompsonProgram the device on USB bus 1 at address 2 to suspend, resume, power off, go into power save, or power on:
170cf109686SAndrew Thompson.Pp
1712e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 suspend
1722e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 resume
1732e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 power_off
1742e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 power_save
1752e07d451SEdward Tomasz Napierala.Dl usbconfig -d ugen1.2 power_on
176eabe30fcSAlfred Perlstein.Sh SEE ALSO
1770ea0127aSNick Hibma.Xr usb 4 ,
1782e07d451SEdward Tomasz Napierala.Xr usb_quirk 4 ,
1792e07d451SEdward Tomasz Napierala.Xr usb_template 4
180