3 .\" Copyright (c) 2008-2010 Hans Petter Selasky. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .Nd configure the USB subsystem
38 .Op Fl d Ar [ugen]<unit>.<addr>
43 utility is used to configure and dump information about the USB subsystem.
45 The options are as follows:
48 Limit device range to USB devices connected to the given USBUS unit.
50 Limit device range to the given USB device index.
51 Should only be used in conjunction with the unit argument.
52 .It Fl d Ar [ugen]<unit>.<addr>
53 Limit device range to USB devices connected to the given unit and address.
54 The unit and address coordinates may be prefixed by the lowercased word "ugen".
56 Show help and available commands.
59 The following commands may be used with
61 .Bl -tag -width indent
62 .It Cm set_config Ar cfg_index
63 Choose the configuration for the USB device.
64 Valid values range from zero to the number reported as the
65 .Ar bNumConfigurations
69 The special value of 255 unconfigures the device, detaching
70 the interface drivers and reducing the power consumption to minimum,
71 but without going into power saving mode or detaching from the bus.
72 In some cases, it prevents the device from charging.
73 .It Cm set_alt Ar alt_index
74 Choose the alternate interface for the USB device.
75 Alternative settings for the current configuration are available as the
78 .Cm dump_curr_config_desc
80 Usually there is no need to adjust this setting.
81 .It Cm set_template Ar template
82 Set the global USB device side template.
87 Get the current USB device side template.
88 .It Cm add_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name
89 Add a quirk by specifying the Vendor ID, Product ID, low and high
90 revision numbers, and the quirk name.
94 .It Cm remove_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name
96 .It Cm add_quirk Ar quirk_name
97 Add quirk for the currently selected USB device.
98 .It Cm remove_quirk Ar quirk_name
99 Remove a quirk for the currently selected USB device.
101 Display the device and configuration descriptors.
102 .It Cm dump_quirk_names
103 Display the list of supported quirk names.
104 .It Cm dump_device_quirks
105 Display the list of current device quirks.
106 .It Cm dump_device_desc
107 Display the device descriptor.
108 .It Cm dump_curr_config_desc
109 Display current configuration descriptor.
110 .It Cm dump_all_config_desc
111 Display all the configuration descriptors.
112 .It Cm dump_string Ar index
113 Display string descriptor at selected index.
115 Display summary information about the device.
117 Display the list of interface drivers (such as
121 currently attached to the device.
123 Force the device to suspend.
125 Force the device to resume.
129 Turn the automatic suspend and resume on.
130 This is the default for USB hubs.
132 Turn the device on and disable automatic suspend and resume.
133 This is the default for non-hub devices.
136 This forces the USB stack to reenumerate the bus.
138 List all available USB devices.
139 This is the default if
141 is called without specifying a command.
142 .It Cm do_request Ar bmReqTyp Ar bReq Ar wVal Ar wIdx Ar wLen Ar data...
143 Perform a synchronous control request on the specified device.
145 .Xr libusb20_dev_request_sync 3
146 for more information.
149 Show information about the device on USB bus 1 at address 2:
151 .Dl usbconfig -d ugen1.2 dump_info
153 Dump HID descriptor for device on USB bus 1 at address 2:
155 .Dl usbconfig -d ugen1.2 do_request 0x81 0x06 0x2200 0 0x100
157 Dump string descriptor at index Z for device on USB bus 1 at address 2:
159 .Dl usbconfig -d ugen1.2 dump_string Z
161 Dump current configuration descriptor for device on USB bus 1 at address 2:
163 .Dl usbconfig -d ugen1.2 dump_curr_config_desc
165 Dump device descriptor for device on USB bus 1 at address 2:
167 .Dl usbconfig -d ugen1.2 dump_device_desc
169 Program the device on USB bus 1 at address 2 to suspend, resume, power off, go into power save, or power on:
171 .Dl usbconfig -d ugen1.2 suspend
172 .Dl usbconfig -d ugen1.2 resume
173 .Dl usbconfig -d ugen1.2 power_off
174 .Dl usbconfig -d ugen1.2 power_save
175 .Dl usbconfig -d ugen1.2 power_on