]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/usbconfig/usbconfig.8
ena: merge ena-com v2.5.0 upgrade
[FreeBSD/FreeBSD.git] / usr.sbin / usbconfig / usbconfig.8
1 .\" $FreeBSD$
2 .\"
3 .\" Copyright (c) 2008-2019 Hans Petter Selasky. All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
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.
13 .\"
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
24 .\" SUCH DAMAGE.
25 .\"
26 .Dd December 21, 2021
27 .Dt USBCONFIG 8
28 .Os
29 .Sh NAME
30 .Nm usbconfig
31 .Nd configure the USB subsystem
32 .Sh SYNOPSIS
33 .Nm
34 .Op Fl u Ar unit
35 .Op Fl a Ar addr
36 .Op Fl i Ar interface_index
37 .Op Fl v
38 .Op cmds...
39 .Nm
40 .Fl d Ar [[/dev/]ugen]<unit>.<addr>
41 .Op Fl i Ar interface_index
42 .Op Fl v
43 .Op cmds...
44 .Sh DESCRIPTION
45 The
46 .Nm
47 utility is used to configure and dump information about the USB subsystem.
48 .Pp
49 The options are as follows:
50 .Bl -tag -width "        "
51 .It Fl u Ar unit
52 Limit device range to USB devices connected to the given USBUS unit.
53 .It Fl a Ar addr
54 Limit device range to the given USB device index.
55 Should only be used in conjunction with the unit argument.
56 .It Fl d Ar [[/dev/]ugen]<unit>.<addr>
57 Limit device range to USB devices connected to the given unit and address.
58 The unit and address coordinates may be prefixed by the lowercased word "ugen",
59 or the full path name
60 .Pa /dev/ugen .
61 .It Fl h
62 Show help and available commands.
63 .It Fl i Ar interface_index
64 Specify interface index as indicated by the command description.
65 If this argument is not specified a value of zero will be used for the interface index.
66 .It Fl v
67 Shortcut to activate the
68 .Cm dump_device_desc ,
69 .Cm dump_curr_config_desc ,
70 and
71 .Cm show_ifdrv
72 commands
73 .Pq Dq verbose mode .
74 .El
75 .Pp
76 The following commands may be used with
77 .Nm :
78 .Bl -tag -width indent
79 .It Cm set_config Ar cfg_index
80 Choose the configuration for the USB device.
81 Valid values range from zero to the number reported as the
82 .Ar bNumConfigurations
83 in
84 .Cm dump_device_desc
85 output.
86 The special value of 255 unconfigures the device, detaching
87 the interface drivers and reducing the power consumption to minimum,
88 but without going into power saving mode or detaching from the bus.
89 In some cases, it prevents the device from charging.
90 .It Cm set_alt Ar alt_index
91 Choose the alternate interface for the selected interface and USB device.
92 Alternative settings for the current configuration are available as the
93 .Ar bAlternateSetting
94 in
95 .Cm dump_curr_config_desc
96 output.
97 Usually there is no need to adjust this setting.
98 This command uses the
99 .Fl i Ar interface_index
100 option.
101 .It Cm set_template Ar template
102 Set the global USB device side template.
103 See
104 .Xr usb_template 4
105 for more information.
106 .It Cm get_template
107 Get the current USB device side template.
108 .It Cm add_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name
109 Add a quirk by specifying the Vendor ID, Product ID, low and high
110 revision numbers, and the quirk name.
111 See
112 .Xr usb_quirk 4
113 for more information.
114 .It Cm remove_dev_quirk_vplh Ar vid Ar pid Ar lo_rev Ar hi_rev Ar quirk_name
115 Remove a quirk.
116 .It Cm add_quirk Ar quirk_name
117 Add quirk for the currently selected USB device.
118 .It Cm remove_quirk Ar quirk_name
119 Remove a quirk for the currently selected USB device.
120 .It Cm dump_all_desc
121 Display the device and configuration descriptors.
122 .It Cm dump_quirk_names
123 Display the list of supported quirk names.
124 .It Cm dump_device_quirks
125 Display the list of current device quirks.
126 .It Cm dump_device_desc
127 Display the device descriptor.
128 .It Cm dump_curr_config_desc
129 Display current configuration descriptor.
130 .It Cm dump_all_config_desc
131 Display all the configuration descriptors.
132 .It Cm dump_string Ar index
133 Display string descriptor at selected index.
134 .It Cm dump_info
135 Display summary information about the device.
136 .It Cm dump_stats
137 Display USB transfer statistics.
138 .It Cm show_ifdrv
139 Display the list of interface drivers (such as
140 .Xr ukbd 4
141 or
142 .Xr u3g 4 )
143 currently attached to the device.
144 .It Cm detach_kernel_driver
145 Detach kernel driver for the selected interface and USB device.
146 This command uses the
147 .Fl i Ar interface_index
148 option.
149 .It Cm suspend
150 Force the device to suspend.
151 .It Cm resume
152 Force the device to resume.
153 .It Cm power_off
154 Turn the device off.
155 .It Cm power_save
156 Turn the automatic suspend and resume on.
157 This is the default for USB hubs.
158 .It Cm power_on
159 Turn the device on and disable automatic suspend and resume.
160 This is the default for non-hub devices.
161 .It Cm reset
162 Reset the device.
163 This forces the USB stack to reenumerate the bus.
164 .It Cm list
165 List all available USB devices.
166 This is the default if
167 .Nm
168 is called without specifying a command.
169 .It Cm do_request Ar bmReqTyp Ar bReq Ar wVal Ar wIdx Ar wLen Ar data...
170 Perform a synchronous control request on the specified device.
171 See
172 .Xr libusb20_dev_request_sync 3
173 for more information.
174 .El
175 .Sh EXAMPLES
176 List all connected USB devices and their attached interface drivers:
177 .Pp
178 .Dl usbconfig show_ifdrv
179 .Pp
180 Dump device and configuration descriptors for device on USB bus 1 at address 2:
181 .Pp
182 .Dl usbconfig ugen1.2 dump_all_desc
183 .Pp
184 Dump HID descriptor for device on USB bus 1 at address 2:
185 .Pp
186 .Dl usbconfig ugen1.2 do_request 0x81 0x06 0x2200 0 0x100
187 .Pp
188 Power off the device on USB bus 1 at address 2:
189 .Pp
190 .Dl usbconfig ugen1.2 power_off
191 .Sh SEE ALSO
192 .Xr usb 4 ,
193 .Xr usb_quirk 4 ,
194 .Xr usb_template 4