1eabe30fcSAlfred Perlstein.\" 2fa6d8b65SHans Petter Selasky.\" Copyright (c) 2008-2019 Hans Petter Selasky. All rights reserved. 3eabe30fcSAlfred Perlstein.\" 4eabe30fcSAlfred Perlstein.\" Redistribution and use in source and binary forms, with or without 5eabe30fcSAlfred Perlstein.\" modification, are permitted provided that the following conditions 6eabe30fcSAlfred Perlstein.\" are met: 7eabe30fcSAlfred Perlstein.\" 1. Redistributions of source code must retain the above copyright 8eabe30fcSAlfred Perlstein.\" notice, this list of conditions and the following disclaimer. 9eabe30fcSAlfred Perlstein.\" 2. Redistributions in binary form must reproduce the above copyright 10eabe30fcSAlfred Perlstein.\" notice, this list of conditions and the following disclaimer in the 11eabe30fcSAlfred Perlstein.\" documentation and/or other materials provided with the distribution. 12eabe30fcSAlfred Perlstein.\" 13eabe30fcSAlfred Perlstein.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14eabe30fcSAlfred Perlstein.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15eabe30fcSAlfred Perlstein.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16eabe30fcSAlfred Perlstein.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17eabe30fcSAlfred Perlstein.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18eabe30fcSAlfred Perlstein.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19eabe30fcSAlfred Perlstein.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20eabe30fcSAlfred Perlstein.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21eabe30fcSAlfred Perlstein.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22eabe30fcSAlfred Perlstein.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23eabe30fcSAlfred Perlstein.\" SUCH DAMAGE. 24eabe30fcSAlfred Perlstein.\" 255eafaf9eSMateusz Piotrowski.Dd January 29, 2022 26eabe30fcSAlfred Perlstein.Dt USBCONFIG 8 27eabe30fcSAlfred Perlstein.Os 28eabe30fcSAlfred Perlstein.Sh NAME 29eabe30fcSAlfred Perlstein.Nm usbconfig 30eabe30fcSAlfred Perlstein.Nd configure the USB subsystem 31eabe30fcSAlfred Perlstein.Sh SYNOPSIS 32eabe30fcSAlfred Perlstein.Nm 33*75a86e93SMateusz Piotrowski.Op Fl v 34eabe30fcSAlfred Perlstein.Op Fl a Ar addr 35cae1884dSJoerg Wunsch.Op Fl i Ar interface_index 36*75a86e93SMateusz Piotrowski.Op Fl u Ar unit 375eafaf9eSMateusz Piotrowski.Op Ar cmds ... 38cf109686SAndrew Thompson.Nm 395eafaf9eSMateusz Piotrowski.Fl d 405eafaf9eSMateusz Piotrowski.Sm off 415eafaf9eSMateusz Piotrowski.Oo Oo Cm /dev/ Oc Cm ugen Oc Ar unit Cm \&. Ar addr 425eafaf9eSMateusz Piotrowski.Sm on 43d69b9cc2SJoerg Wunsch.Op Fl v 44*75a86e93SMateusz Piotrowski.Op Fl i Ar interface_index 455eafaf9eSMateusz Piotrowski.Op Ar cmds ... 46eabe30fcSAlfred Perlstein.Sh DESCRIPTION 47eabe30fcSAlfred PerlsteinThe 48eabe30fcSAlfred Perlstein.Nm 49eabe30fcSAlfred Perlsteinutility is used to configure and dump information about the USB subsystem. 50eabe30fcSAlfred Perlstein.Pp 51eabe30fcSAlfred PerlsteinThe options are as follows: 525eafaf9eSMateusz Piotrowski.Bl -tag -width "-u unit" 53eabe30fcSAlfred Perlstein.It Fl a Ar addr 54eabe30fcSAlfred PerlsteinLimit device range to the given USB device index. 55eabe30fcSAlfred PerlsteinShould only be used in conjunction with the unit argument. 565eafaf9eSMateusz Piotrowski.It Xo 575eafaf9eSMateusz Piotrowski.Fl d 585eafaf9eSMateusz Piotrowski.Sm off 595eafaf9eSMateusz Piotrowski.Oo Oo Cm /dev/ Oc Cm ugen Oc Ar unit Cm \&. Ar addr 605eafaf9eSMateusz Piotrowski.Sm on 615eafaf9eSMateusz Piotrowski.Xc 62cf109686SAndrew ThompsonLimit device range to USB devices connected to the given unit and address. 635eafaf9eSMateusz PiotrowskiThe unit and address coordinates may be prefixed by the lowercased word 645eafaf9eSMateusz Piotrowski.Cm ugen , 65ae450e6dSJoerg Wunschor the full path name 665eafaf9eSMateusz Piotrowski.Cm /dev/ugen . 67d69b9cc2SJoerg Wunsch.It Fl h 68d69b9cc2SJoerg WunschShow help and available commands. 6949366f62SHans Petter Selasky.It Fl i Ar interface_index 7049366f62SHans Petter SelaskySpecify interface index as indicated by the command description. 715eafaf9eSMateusz PiotrowskiIf this argument is not specified 725eafaf9eSMateusz Piotrowskia value of zero will be used for the interface index. 73*75a86e93SMateusz Piotrowski.It Fl u Ar unit 74*75a86e93SMateusz PiotrowskiLimit device range to USB devices connected to the given USBUS unit. 75d69b9cc2SJoerg Wunsch.It Fl v 765eafaf9eSMateusz PiotrowskiActivate the 77d69b9cc2SJoerg Wunsch.Cm dump_device_desc , 78d69b9cc2SJoerg Wunsch.Cm dump_curr_config_desc , 79d69b9cc2SJoerg Wunschand 80d69b9cc2SJoerg Wunsch.Cm show_ifdrv 81d69b9cc2SJoerg Wunschcommands 82d69b9cc2SJoerg Wunsch.Pq Dq verbose mode . 83eabe30fcSAlfred Perlstein.El 8494b7ebd7SChristian Brueffer.Pp 852e07d451SEdward Tomasz NapieralaThe following commands may be used with 862e07d451SEdward Tomasz Napierala.Nm : 872e07d451SEdward Tomasz Napierala.Bl -tag -width indent 882e07d451SEdward Tomasz Napierala.It Cm set_config Ar cfg_index 892e07d451SEdward Tomasz NapieralaChoose the configuration for the USB device. 902e07d451SEdward Tomasz NapieralaValid values range from zero to the number reported as the 912e07d451SEdward Tomasz Napierala.Ar bNumConfigurations 922e07d451SEdward Tomasz Napieralain 932e07d451SEdward Tomasz Napierala.Cm dump_device_desc 942e07d451SEdward Tomasz Napieralaoutput. 952e07d451SEdward Tomasz NapieralaThe special value of 255 unconfigures the device, detaching 962e07d451SEdward Tomasz Napieralathe interface drivers and reducing the power consumption to minimum, 972e07d451SEdward Tomasz Napieralabut without going into power saving mode or detaching from the bus. 982e07d451SEdward Tomasz NapieralaIn some cases, it prevents the device from charging. 992e07d451SEdward Tomasz Napierala.It Cm set_alt Ar alt_index 10049366f62SHans Petter SelaskyChoose the alternate interface for the selected interface and USB device. 1012e07d451SEdward Tomasz NapieralaAlternative settings for the current configuration are available as the 1022e07d451SEdward Tomasz Napierala.Ar bAlternateSetting 1032e07d451SEdward Tomasz Napieralain 1042e07d451SEdward Tomasz Napierala.Cm dump_curr_config_desc 1052e07d451SEdward Tomasz Napieralaoutput. 1062e07d451SEdward Tomasz NapieralaUsually there is no need to adjust this setting. 107cae1884dSJoerg WunschThis command uses the 108cae1884dSJoerg Wunsch.Fl i Ar interface_index 109cae1884dSJoerg Wunschoption. 1102e07d451SEdward Tomasz Napierala.It Cm set_template Ar template 1112e07d451SEdward Tomasz NapieralaSet the global USB device side template. 1122e07d451SEdward Tomasz NapieralaSee 1132e07d451SEdward Tomasz Napierala.Xr usb_template 4 1142e07d451SEdward Tomasz Napieralafor more information. 1152e07d451SEdward Tomasz Napierala.It Cm get_template 1162e07d451SEdward Tomasz NapieralaGet the current USB device side template. 1172e07d451SEdward Tomasz Napierala.It Cm add_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name 1182e07d451SEdward Tomasz NapieralaAdd a quirk by specifying the Vendor ID, Product ID, low and high 1192e07d451SEdward Tomasz Napieralarevision numbers, and the quirk name. 1202e07d451SEdward Tomasz NapieralaSee 1212e07d451SEdward Tomasz Napierala.Xr usb_quirk 4 1222e07d451SEdward Tomasz Napieralafor more information. 1232e07d451SEdward Tomasz Napierala.It Cm remove_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name 1242e07d451SEdward Tomasz NapieralaRemove a quirk. 1252e07d451SEdward Tomasz Napierala.It Cm add_quirk Ar quirk_name 1262e07d451SEdward Tomasz NapieralaAdd quirk for the currently selected USB device. 1272e07d451SEdward Tomasz Napierala.It Cm remove_quirk Ar quirk_name 1282e07d451SEdward Tomasz NapieralaRemove a quirk for the currently selected USB device. 129cd1fd29cSEdward Tomasz Napierala.It Cm dump_all_desc 130cd1fd29cSEdward Tomasz NapieralaDisplay the device and configuration descriptors. 1312e07d451SEdward Tomasz Napierala.It Cm dump_quirk_names 1322e07d451SEdward Tomasz NapieralaDisplay the list of supported quirk names. 1332e07d451SEdward Tomasz Napierala.It Cm dump_device_quirks 1342e07d451SEdward Tomasz NapieralaDisplay the list of current device quirks. 1352e07d451SEdward Tomasz Napierala.It Cm dump_device_desc 1362e07d451SEdward Tomasz NapieralaDisplay the device descriptor. 1372e07d451SEdward Tomasz Napierala.It Cm dump_curr_config_desc 1382e07d451SEdward Tomasz NapieralaDisplay current configuration descriptor. 1392e07d451SEdward Tomasz Napierala.It Cm dump_all_config_desc 1402e07d451SEdward Tomasz NapieralaDisplay all the configuration descriptors. 1412e07d451SEdward Tomasz Napierala.It Cm dump_string Ar index 1422e07d451SEdward Tomasz NapieralaDisplay string descriptor at selected index. 1432e07d451SEdward Tomasz Napierala.It Cm dump_info 1442e07d451SEdward Tomasz NapieralaDisplay summary information about the device. 145fa6d8b65SHans Petter Selasky.It Cm dump_stats 146fa6d8b65SHans Petter SelaskyDisplay USB transfer statistics. 1472e07d451SEdward Tomasz Napierala.It Cm show_ifdrv 1482e07d451SEdward Tomasz NapieralaDisplay the list of interface drivers (such as 1492e07d451SEdward Tomasz Napierala.Xr ukbd 4 1502e07d451SEdward Tomasz Napieralaor 1512e07d451SEdward Tomasz Napierala.Xr u3g 4 ) 1522e07d451SEdward Tomasz Napieralacurrently attached to the device. 15349366f62SHans Petter Selasky.It Cm detach_kernel_driver 15449366f62SHans Petter SelaskyDetach kernel driver for the selected interface and USB device. 155cae1884dSJoerg WunschThis command uses the 156cae1884dSJoerg Wunsch.Fl i Ar interface_index 157cae1884dSJoerg Wunschoption. 1582e07d451SEdward Tomasz Napierala.It Cm suspend 1592e07d451SEdward Tomasz NapieralaForce the device to suspend. 1602e07d451SEdward Tomasz Napierala.It Cm resume 1612e07d451SEdward Tomasz NapieralaForce the device to resume. 1622e07d451SEdward Tomasz Napierala.It Cm power_off 1632e07d451SEdward Tomasz NapieralaTurn the device off. 1642e07d451SEdward Tomasz Napierala.It Cm power_save 1652e07d451SEdward Tomasz NapieralaTurn the automatic suspend and resume on. 1662e07d451SEdward Tomasz NapieralaThis is the default for USB hubs. 1672e07d451SEdward Tomasz Napierala.It Cm power_on 1682e07d451SEdward Tomasz NapieralaTurn the device on and disable automatic suspend and resume. 1692e07d451SEdward Tomasz NapieralaThis is the default for non-hub devices. 1702e07d451SEdward Tomasz Napierala.It Cm reset 1712e07d451SEdward Tomasz NapieralaReset the device. 1722e07d451SEdward Tomasz NapieralaThis forces the USB stack to reenumerate the bus. 1732e07d451SEdward Tomasz Napierala.It Cm list 1742e07d451SEdward Tomasz NapieralaList all available USB devices. 1752e07d451SEdward Tomasz NapieralaThis is the default if 17694b7ebd7SChristian Brueffer.Nm 1772e07d451SEdward Tomasz Napieralais called without specifying a command. 1782e07d451SEdward Tomasz Napierala.It Cm do_request Ar bmReqTyp Ar bReq Ar wVal Ar wIdx Ar wLen Ar data... 1792e07d451SEdward Tomasz NapieralaPerform a synchronous control request on the specified device. 1802e07d451SEdward Tomasz NapieralaSee 1812e07d451SEdward Tomasz Napierala.Xr libusb20_dev_request_sync 3 1822e07d451SEdward Tomasz Napieralafor more information. 1832e07d451SEdward Tomasz Napierala.El 18494b7ebd7SChristian Brueffer.Sh EXAMPLES 18541adbaa5SEdward Tomasz NapieralaList all connected USB devices and their attached interface drivers: 18694b7ebd7SChristian Brueffer.Pp 18741adbaa5SEdward Tomasz Napierala.Dl usbconfig show_ifdrv 18841adbaa5SEdward Tomasz Napierala.Pp 18941adbaa5SEdward Tomasz NapieralaDump device and configuration descriptors for device on USB bus 1 at address 2: 19041adbaa5SEdward Tomasz Napierala.Pp 1915eafaf9eSMateusz Piotrowski.Dl usbconfig -d ugen1.2 dump_all_desc 192cf109686SAndrew Thompson.Pp 193cf109686SAndrew ThompsonDump HID descriptor for device on USB bus 1 at address 2: 194cf109686SAndrew Thompson.Pp 1955eafaf9eSMateusz Piotrowski.Dl usbconfig -d ugen1.2 do_request 0x81 0x06 0x2200 0 0x100 196cf109686SAndrew Thompson.Pp 19741adbaa5SEdward Tomasz NapieralaPower off the device on USB bus 1 at address 2: 198cf109686SAndrew Thompson.Pp 1995eafaf9eSMateusz Piotrowski.Dl usbconfig -d ugen1.2 power_off 200eabe30fcSAlfred Perlstein.Sh SEE ALSO 2010ea0127aSNick Hibma.Xr usb 4 , 2022e07d451SEdward Tomasz Napierala.Xr usb_quirk 4 , 2032e07d451SEdward Tomasz Napierala.Xr usb_template 4 204