USB_TEMPLATE(4) | Device Drivers Manual | USB_TEMPLATE(4) |
usb_template
— USB
device side templates
To compile this module into the kernel, place the following line in your kernel configuration file:
device usb_template
To load the module at boot time, place the following line in loader.conf(5):
usb_template_load="YES"
The usb_template
module implements various
USB templates that are needed when programming an USB device side driver. A
USB template consists of an USB device descriptor, one or more USB
configuration descriptors, one or more USB interface descriptors, one or
more USB endpoint descriptors, USB strings and additional USB descriptors.
USB templates are selected using the hw.usb.template
sysctl and tunable, or by using the usbconfig(8)
set_template
subcommand. Changing the
hw.usb.template sysctl triggers reenumeration by the
USB host; changes to other sysctls may not be visible to the host until
reenumeration is performed.
Available templates are:
Value | Description |
0 |
USB Mass Storage, see cfumass(4) |
1 |
CDC Ethernet, see cdce(4) |
2 |
Media Transfer Protocol (MTP) |
3 |
USB serial port, see umodem(4) |
4 |
USB audio |
5 |
USB keyboard |
6 |
USB mouse |
7 |
USB phone |
8 |
CDC Ethernet and serial port |
9 |
USB MIDI |
10 |
CDC Ethernet, serial port, and storage |
The following variables are available as both sysctl(8) variables and loader(8) tunables:
The usb_template
module complies to the
USB 1.0, 2.0 and 3.0 standard.
The usb_template
module was written by
Hans Petter Selasky
<hselasky@FreeBSD.org>.
May 24, 2018 | Debian |