USB on FreeBSD

USB is short for Universial Serial BUS. There are currently five variants of USB. The USB stack in FreeBSD -current supports Low-, Full-, High- and Super- speed USB devices in Host- and Device Mode.

Debugging USB

If you want very verbose messages, you can set the following variables in loader.conf

hw.usb.ehci.iaadbug=1
hw.usb.ehci.debug=1
hw.usb.xhci.debug=1

usbconfig gives you information on your devices. If you run it with the list argument, or no argument it prints a list of your devices.

$ sudo usbconfig
ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.1: <Intel EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <vendor 0x8087 product 0x8000> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <Microsoft Wired Keyboard 600> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)
ugen0.3: <VXIS Inc FHD Webcamera> at usbus0, cfg=255 md=HOST spd=SUPER (5.0Gbps) pwr=ON (100mA)

You can get more detailed information on your devices with the dump_all_desc command. Note the addressing after the -d arg, this is the common format for most commands, you can use either ugen0.3, or just 0.3.

$ sudo usbconfig -d 0.3 dump_all_desc
ugen0.3: <VXIS Inc FHD Webcamera> at usbus0, cfg=255 md=HOST spd=SUPER (5.0Gbps) pwr=ON (100mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0310
  bDeviceClass = 0x00ef  <Miscellaneous device> 
  bDeviceSubClass = 0x0002
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0009
  idVendor = 0x1bcf
  idProduct = 0x2c99
  bcdDevice = 0x0200
  iManufacturer = 0x0001  <VXIS Inc>
  iProduct = 0x0002  <FHD Webcamera>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

The key take away points here (other than obvious things like the power setting) are:

HPSUSB FAQ

USB (last edited 2020-05-17T20:27:59+0000 by MarkLinimon)