---
name: "usbconfig"
section: "8"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/usbconfig"
---

# usbconfig(8)

configure the USB subsystem

## NAME

**usbconfig** – configure the USB subsystem

## SYNOPSIS

**usbconfig** \[**-l**\] \[**-v**\] \[**-a** *addr*\] \[**-i** *interface\_index*\] \[**-u** *unit*\] \[*cmds* *...*\]

**usbconfig** **-d** \[\[**/dev/**\]**ugen**\]*unit***.***addr* \[**-l**\] \[**-v**\] \[**-i** *interface\_index*\] \[*cmds* *...*\]

## DESCRIPTION

The **usbconfig** utility is used to configure and dump information about the USB subsystem.

The options are as follows:

- **-a** *addr*

  Limit device range to the given USB device index. Should only be used in conjunction with the unit argument.

-

  **-d** \[\[**/dev/**\]**ugen**\]*unit***.***addr* Limit device range to USB devices connected to the given unit and address. The unit and address coordinates may be prefixed by the lowercased word **ugen**, or the full path name **/dev/ugen**.

- **-h**

  Show help and available commands.

- **-i** *interface\_index*

  Specify interface index as indicated by the command description. If this argument is not specified a value of zero will be used for the interface index.

- **-l** **dump\_device\_desc**

  Show numeral only key=value output as one long line.

- **-u** *unit*

  Limit device range to USB devices connected to the given USBUS unit.

- **-v**

  Activate the **dump\_device\_desc**, **dump\_curr\_config\_desc**, and **show\_ifdrv** commands (“verbose mode”).

The following commands may be used with **usbconfig**:

- **set\_config** *cfg\_index*

  Choose the configuration for the USB device. Valid values range from zero to the number reported as the *bNumConfigurations* in **dump\_device\_desc** output. The special value of 255 unconfigures the device, detaching the interface drivers and reducing the power consumption to minimum, but without going into power saving mode or detaching from the bus. In some cases, it prevents the device from charging.

- **set\_alt** *alt\_index*

  Choose the alternate interface for the selected interface and USB device. Alternative settings for the current configuration are available as the *bAlternateSetting* in **dump\_curr\_config\_desc** output. Usually there is no need to adjust this setting. This command uses the **-i** *interface\_index* option.

- **set\_template** *template*

  Set the global USB device side template. See [usb\_template(4)](/usb_template/4.md) for more information.

- **get\_template**

  Get the current USB device side template.

- **add\_dev\_quirk\_vplh** *vid* *pid* *lo\_rev* *hi\_rev* *quirk\_name*

  Add a quirk by specifying the Vendor ID, Product ID, low and high revision numbers, and the quirk name. See [usb\_quirk(4)](/usb_quirk/4.md) for more information.

- **remove\_dev\_quirk\_vplh** *vid* *pid* *lo\_rev* *hi\_rev* *quirk\_name*

  Remove a quirk.

- **add\_quirk** *quirk\_name*

  Add quirk for the currently selected USB device.

- **remove\_quirk** *quirk\_name*

  Remove a quirk for the currently selected USB device.

- **dump\_all\_desc**

  Display the device and configuration descriptors.

- **dump\_quirk\_names**

  Display the list of supported quirk names.

- **dump\_device\_quirks**

  Display the list of current device quirks.

- **dump\_device\_desc**

  Display the device descriptor.

- **dump\_curr\_config\_desc**

  Display current configuration descriptor.

- **dump\_all\_config\_desc**

  Display all the configuration descriptors.

- **dump\_string** *index*

  Display string descriptor at selected index.

- **dump\_info**

  Display summary information about the device.

- **dump\_stats**

  Display USB transfer statistics.

- **show\_ifdrv**

  Display the list of interface drivers (such as [ukbd(4)](/ukbd/4.md) or [u3g(4)](/u3g/4.md)) currently attached to the device.

- **detach\_kernel\_driver**

  Detach kernel driver for the selected interface and USB device. This command uses the **-i** *interface\_index* option.

- **attach\_kernel\_driver**

  Attach kernel driver for the selected interface and USB device. This command uses the **-i** *interface\_index* option.

- **suspend**

  Force the device to suspend.

- **resume**

  Force the device to resume.

- **power\_off**

  Turn the device off.

- **power\_save**

  Turn the automatic suspend and resume on. This is the default for USB hubs.

- **power\_on**

  Turn the device on and disable automatic suspend and resume. This is the default for non-hub devices.

- **reset**

  Reset the device. This forces the USB stack to reenumerate the bus.

- **list**

  List all available USB devices. This is the default if **usbconfig** is called without specifying a command.

- **do\_request** *bmReqTyp* *bReq* *wVal* *wIdx* *wLen* *data...*

  Perform a synchronous control request on the specified device. See [libusb20\_dev\_request\_sync(3)](/libusb20_dev_request_sync/3.md) for more information.

## EXAMPLES

List all connected USB devices and their attached interface drivers:

```
usbconfig show_ifdrv
```

Dump device and configuration descriptors for device on USB bus 1 at address 2:

```
usbconfig -d ugen1.2 dump_all_desc
```

Dump HID descriptor for device on USB bus 1 at address 2:

```
usbconfig -d ugen1.2 do_request 0x81 0x06 0x2200 0 0x100
```

Power off the device on USB bus 1 at address 2:

```
usbconfig -d ugen1.2 power_off
```

## SEE ALSO

[usb(4)](/usb/4.md), [usb\_quirk(4)](/usb_quirk/4.md), [usb\_template(4)](/usb_template/4.md)
