#
# [31mCONFIG_USB[0m Gadget support on a system involves
# (a) a peripheral controller, and
# (b) the gadget driver using it.
#
# NOTE: Gadget support ** DOES NOT ** depend on host-side CONFIG_USB !!
#
# - Host systems (like PCs) need CONFIG_USB (with "A" jacks).
# - Peripherals (like PDAs) need CONFIG_USB_GADGET (with "B" jacks).
# - Some systems have both kinds of controllers.
#
# With help from a special transceiver and a "Mini-AB" jack, systems with
# both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG).
#
menuconfig [31mCONFIG_USB_GADGET[0m
tristate "USB Gadget Support"
select [31mCONFIG_USB_COMMON[0m
select [31mCONFIG_NLS[0m
help
[31mCONFIG_USB[0m is a master/slave protocol, organized with one master
host (such as a PC) controlling up to 127 peripheral devices.
The [31mCONFIG_USB[0m hardware is asymmetric, which makes it easier to set up:
you can't connect a "to-the-host" connector to a peripheral.
Linux can run in the host, or in the peripheral. In both cases
you need a low level bus controller driver, and some software
talking to it. Peripheral controllers are often discrete silicon,
or are integrated with the CPU in a microcontroller. The more
familiar host side controllers have names like "EHCI", "OHCI",
or "UHCI", and are usually integrated into southbridges on PC
motherboards.
Enable this configuration option if you want to run Linux inside
a [31mCONFIG_USB[0m peripheral device. Configure one hardware driver for your
peripheral/device side bus controller, and a "gadget driver" for
your peripheral protocol. (If you use modular gadget drivers,
you may configure more than one.)
If in doubt, say "N" and don't enable these drivers; most people
don't have this kind of hardware (except maybe inside Linux PDAs).
For more information, see <http://www.linux-usb.org/gadget> and
the kernel DocBook documentation for this API.
if [31mCONFIG_USB_GADGET[0m
config [31mCONFIG_USB_GADGET_DEBUG[0m
bool "Debugging messages (DEVELOPMENT)"
depends on [31mCONFIG_DEBUG_KERNEL[0m
help
Many controller and gadget drivers will print some debugging
messages if you use this option to ask for those messages.
Avoid enabling these messages, even if you're actively
debugging such a driver. Many drivers will emit so many
messages that the driver timings are affected, which will
either create new failure modes or remove the one you're
trying to track down. Never enable these messages for a
production build.
config [31mCONFIG_USB_GADGET_VERBOSE[0m
bool "Verbose debugging Messages (DEVELOPMENT)"
depends on [31mCONFIG_USB_GADGET_DEBUG[0m
help
Many controller and gadget drivers will print verbose debugging
messages if you use this option to ask for those messages.
Avoid enabling these messages, even if you're actively
debugging such a driver. Many drivers will emit so many
messages that the driver timings are affected, which will
either create new failure modes or remove the one you're
trying to track down. Never enable these messages for a
production build.
config [31mCONFIG_USB_GADGET_DEBUG_FILES[0m
bool "Debugging information files (DEVELOPMENT)"
depends on [31mCONFIG_PROC_FS[0m
help
Some of the drivers in the "gadget" framework can expose
debugging information in files such as /proc/driver/udc
(for a peripheral controller). The information in these
files may help when you're troubleshooting or bringing up a
driver on a new board. Enable these files by choosing "Y"
here. If in doubt, or to conserve kernel memory, say "N".
config [31mCONFIG_USB_GADGET_DEBUG_FS[0m
bool "Debugging information files in debugfs (DEVELOPMENT)"
depends on [31mCONFIG_DEBUG_FS[0m
help
Some of the drivers in the "gadget" framework can expose
debugging information in files under /sys/kernel/debug/.
The information in these files may help when you're
troubleshooting or bringing up a driver on a new board.
Enable these files by choosing "Y" here. If in doubt, or
to conserve kernel memory, say "N".
config [31mCONFIG_USB_GADGET_VBUS_DRAW[0m
int "Maximum VBUS Power usage (2-500 mA)"
range 2 500
default 2
help
Some devices need to draw power from [31mCONFIG_USB[0m when they are
configured, perhaps to operate circuitry or to recharge
batteries. This is in addition to any local power supply,
such as an AC adapter or batteries.
Enter the maximum power your device draws through [31mCONFIG_USB[0m, in
milliAmperes. The permitted range of values is 2 - 500 mA;
0 mA would be legal, but can make some hosts misbehave.
This value will be used except for system-specific gadget
drivers that have more specific information.
config [31mCONFIG_USB_GADGET_STORAGE_NUM_BUFFERS[0m
int "Number of storage pipeline buffers"
range 2 256
default 2
help
Usually 2 buffers are enough to establish a good buffering
pipeline. The number may be increased in order to compensate
for a bursty VFS behaviour. For instance there may be CPU wake up
latencies that makes the VFS to appear bursty in a system with
an CPU on-demand governor. Especially if DMA is doing IO to
offload the CPU. In this case the CPU will go into power
save often and spin up occasionally to move data within VFS.
If selecting [31mCONFIG_USB_GADGET_DEBUG_FILES[0m this value may be set by
a module parameter as well.
If unsure, say 2.
config [31mCONFIG_U_SERIAL_CONSOLE[0m
bool "Serial gadget console support"
depends on [31mCONFIG_USB_G_SERIAL[0m
help
It supports the serial gadget can be used as a console.
source "drivers/usb/gadget/udc/Kconfig"
#
# [31mCONFIG_USB[0m Gadget Drivers
#
# composite based drivers
config [31mCONFIG_USB_LIBCOMPOSITE[0m
tristate
select [31mCONFIG_CONFIGFS_FS[0m
depends on [31mCONFIG_USB_GADGET[0m
config [31mCONFIG_USB_F_ACM[0m
tristate
config [31mCONFIG_USB_F_SS_LB[0m
tristate
config [31mCONFIG_USB_U_SERIAL[0m
tristate
config [31mCONFIG_USB_U_ETHER[0m
tristate
config [31mCONFIG_USB_F_SERIAL[0m
tristate
config [31mCONFIG_USB_F_OBEX[0m
tristate
config [31mCONFIG_USB_F_NCM[0m
tristate
config [31mCONFIG_USB_F_ECM[0m
tristate
config [31mCONFIG_USB_F_PHONET[0m
tristate
config [31mCONFIG_USB_F_EEM[0m
tristate
config [31mCONFIG_USB_F_SUBSET[0m
tristate
config [31mCONFIG_USB_F_RNDIS[0m
tristate
config [31mCONFIG_USB_F_MASS_STORAGE[0m
tristate
config [31mCONFIG_USB_F_FS[0m
tristate
config [31mCONFIG_USB_F_UAC1[0m
tristate
config [31mCONFIG_USB_F_UAC2[0m
tristate
config [31mCONFIG_USB_F_UVC[0m
tristate
config [31mCONFIG_USB_F_MIDI[0m
tristate
config [31mCONFIG_USB_F_HID[0m
tristate
config [31mCONFIG_USB_F_PRINTER[0m
tristate
config [31mCONFIG_USB_F_TCM[0m
tristate
# this first set of drivers all depend on bulk-capable hardware.
config [31mCONFIG_USB_CONFIGFS[0m
tristate "USB functions configurable through configfs"
select [31mCONFIG_USB_LIBCOMPOSITE[0m
help
[31mCONFIG_A[0m Linux [31mCONFIG_USB[0m "gadget" can be set up through configfs.
If this is the case, the [31mCONFIG_USB[0m functions (which from the host's
perspective are seen as interfaces) and configurations are
specified simply by creating appropriate directories in configfs.
Associating functions with configurations is done by creating
appropriate symbolic links.
For more information see Documentation/usb/gadget_configfs.txt.
config [31mCONFIG_USB_CONFIGFS_SERIAL[0m
bool "Generic serial bulk in/out"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_TTY[0m
select [31mCONFIG_USB_U_SERIAL[0m
select [31mCONFIG_USB_F_SERIAL[0m
help
The function talks to the Linux-[31mCONFIG_USB[0m generic serial driver.
config [31mCONFIG_USB_CONFIGFS_ACM[0m
bool "Abstract Control Model (CDC ACM)"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_TTY[0m
select [31mCONFIG_USB_U_SERIAL[0m
select [31mCONFIG_USB_F_ACM[0m
help
ACM serial link. This function can be used to interoperate with
MS-Windows hosts or with the Linux-[31mCONFIG_USB[0m "cdc-acm" driver.
config [31mCONFIG_USB_CONFIGFS_OBEX[0m
bool "Object Exchange Model (CDC OBEX)"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_TTY[0m
select [31mCONFIG_USB_U_SERIAL[0m
select [31mCONFIG_USB_F_OBEX[0m
help
You will need a user space OBEX server talking to /dev/ttyGS*,
since the kernel itself doesn't implement the OBEX protocol.
config [31mCONFIG_USB_CONFIGFS_NCM[0m
bool "Network Control Model (CDC NCM)"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_NET[0m
select [31mCONFIG_USB_U_ETHER[0m
select [31mCONFIG_USB_F_NCM[0m
help
NCM is an advanced protocol for Ethernet encapsulation, allows
grouping of several ethernet frames into one [31mCONFIG_USB[0m transfer and
different alignment possibilities.
config [31mCONFIG_USB_CONFIGFS_ECM[0m
bool "Ethernet Control Model (CDC ECM)"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_NET[0m
select [31mCONFIG_USB_U_ETHER[0m
select [31mCONFIG_USB_F_ECM[0m
help
The "Communication Device Class" (CDC) Ethernet Control Model.
That protocol is often avoided with pure Ethernet adapters, in
favor of simpler vendor-specific hardware, but is widely
supported by firmware for smart network devices.
config [31mCONFIG_USB_CONFIGFS_ECM_SUBSET[0m
bool "Ethernet Control Model (CDC ECM) subset"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_NET[0m
select [31mCONFIG_USB_U_ETHER[0m
select [31mCONFIG_USB_F_SUBSET[0m
help
On hardware that can't implement the full protocol,
a simple CDC subset is used, placing fewer demands on [31mCONFIG_USB[0m.
config [31mCONFIG_USB_CONFIGFS_RNDIS[0m
bool "RNDIS"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_NET[0m
select [31mCONFIG_USB_U_ETHER[0m
select [31mCONFIG_USB_F_RNDIS[0m
help
Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol,
and Microsoft provides redistributable binary RNDIS drivers for
older versions of Windows.
To make MS-Windows work with this, use Documentation/usb/linux.inf
as the "driver info file". For versions of MS-Windows older than
XP, you'll need to download drivers from Microsoft's website; a URL
is given in comments found in that info file.
config [31mCONFIG_USB_CONFIGFS_EEM[0m
bool "Ethernet Emulation Model (EEM)"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_NET[0m
select [31mCONFIG_USB_U_ETHER[0m
select [31mCONFIG_USB_F_EEM[0m
help
CDC EEM is a newer [31mCONFIG_USB[0m standard that is somewhat simpler than CDC ECM
and therefore can be supported by more hardware. Technically ECM and
EEM are designed for different applications. The ECM model extends
the network interface to the target (e.g. a [31mCONFIG_USB[0m cable modem), and the
EEM model is for mobile devices to communicate with hosts using
ethernet over [31mCONFIG_USB[0m. For Linux gadgets, however, the interface with
the host is the same (a usbX device), so the differences are minimal.
config [31mCONFIG_USB_CONFIGFS_PHONET[0m
bool "Phonet protocol"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_NET[0m
depends on [31mCONFIG_PHONET[0m
select [31mCONFIG_USB_U_ETHER[0m
select [31mCONFIG_USB_F_PHONET[0m
help
The Phonet protocol implementation for [31mCONFIG_USB[0m device.
config [31mCONFIG_USB_CONFIGFS_MASS_STORAGE[0m
bool "Mass storage"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_BLOCK[0m
select [31mCONFIG_USB_F_MASS_STORAGE[0m
help
The Mass Storage Gadget acts as a [31mCONFIG_USB[0m Mass Storage disk drive.
As its storage repository it can use a regular file or a block
device (in much the same way as the "loop" device driver),
specified as a module parameter or sysfs option.
config [31mCONFIG_USB_CONFIGFS_F_LB_SS[0m
bool "Loopback and sourcesink function (for testing)"
depends on [31mCONFIG_USB_CONFIGFS[0m
select [31mCONFIG_USB_F_SS_LB[0m
help
Loopback function loops back a configurable number of transfers.
Sourcesink function either sinks and sources bulk data.
It also implements control requests, for "chapter 9" conformance.
Make this be the first driver you try using on top of any new
[31mCONFIG_USB[0m peripheral controller driver. Then you can use host-side
test software, like the "usbtest" driver, to put your hardware
and its driver through a basic set of functional tests.
config [31mCONFIG_USB_CONFIGFS_F_FS[0m
bool "Function filesystem (FunctionFS)"
depends on [31mCONFIG_USB_CONFIGFS[0m
select [31mCONFIG_USB_F_FS[0m
help
The Function Filesystem (FunctionFS) lets one create [31mCONFIG_USB[0m
composite functions in user space in the same way GadgetFS
lets one create [31mCONFIG_USB[0m gadgets in user space. This allows creation
of composite gadgets such that some of the functions are
implemented in kernel space (for instance Ethernet, serial or
mass storage) and other are implemented in user space.
config [31mCONFIG_USB_CONFIGFS_F_UAC1[0m
bool "Audio Class 1.0"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_SND[0m
select [31mCONFIG_USB_LIBCOMPOSITE[0m
select [31mCONFIG_SND_PCM[0m
select [31mCONFIG_USB_F_UAC1[0m
help
This Audio function implements 1 AudioControl interface,
1 AudioStreaming Interface each for [31mCONFIG_USB[0m-OUT and [31mCONFIG_USB[0m-IN.
This driver requires a real Audio codec to be present
on the device.
config [31mCONFIG_USB_CONFIGFS_F_UAC2[0m
bool "Audio Class 2.0"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_SND[0m
select [31mCONFIG_USB_LIBCOMPOSITE[0m
select [31mCONFIG_SND_PCM[0m
select [31mCONFIG_USB_F_UAC2[0m
help
This Audio function is compatible with [31mCONFIG_USB[0m Audio Class
specification 2.0. It implements 1 AudioControl interface,
1 AudioStreaming Interface each for [31mCONFIG_USB[0m-OUT and [31mCONFIG_USB[0m-IN.
This driver doesn't expect any real Audio codec to be present
on the device - the audio streams are simply sinked to and
sourced from a virtual ALSA sound card created. The user-space
application may choose to do whatever it wants with the data
received from the [31mCONFIG_USB[0m Host and choose to provide whatever it
wants as audio data to the [31mCONFIG_USB[0m Host.
config [31mCONFIG_USB_CONFIGFS_F_MIDI[0m
bool "MIDI function"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_SND[0m
select [31mCONFIG_USB_LIBCOMPOSITE[0m
select [31mCONFIG_SND_RAWMIDI[0m
select [31mCONFIG_USB_F_MIDI[0m
help
The MIDI Function acts as a [31mCONFIG_USB[0m Audio device, with one MIDI
input and one MIDI output. These MIDI jacks appear as
a sound "card" in the ALSA sound system. Other MIDI
connections can then be made on the gadget system, using
ALSA's aconnect utility etc.
config [31mCONFIG_USB_CONFIGFS_F_HID[0m
bool "HID function"
depends on [31mCONFIG_USB_CONFIGFS[0m
select [31mCONFIG_USB_F_HID[0m
help
The [31mCONFIG_HID[0m function driver provides generic emulation of [31mCONFIG_USB[0m
Human Interface Devices ([31mCONFIG_HID[0m).
For more information, see Documentation/usb/gadget_hid.txt.
config [31mCONFIG_USB_CONFIGFS_F_UVC[0m
bool "USB Webcam function"
depends on [31mCONFIG_USB_CONFIGFS[0m
depends on [31mCONFIG_VIDEO_V4L2[0m
depends on [31mCONFIG_VIDEO_DEV[0m
select [31mCONFIG_VIDEOBUF2_VMALLOC[0m
select [31mCONFIG_USB_F_UVC[0m
help
The Webcam function acts as a composite [31mCONFIG_USB[0m Audio and Video Class
device. It provides a userspace API to process UVC control requests
and stream video data to the host.
config [31mCONFIG_USB_CONFIGFS_F_PRINTER[0m
bool "Printer function"
select [31mCONFIG_USB_F_PRINTER[0m
depends on [31mCONFIG_USB_CONFIGFS[0m
help
The Printer function channels data between the [31mCONFIG_USB[0m host and a
userspace program driving the print engine. The user space
program reads and writes the device file /dev/g_printer<X> to
receive or send printer data. It can use ioctl calls to
the device file to get or set printer status.
For more information, see Documentation/usb/gadget_printer.txt
which includes sample code for accessing the device file.
config [31mCONFIG_USB_CONFIGFS_F_TCM[0m
bool "USB Gadget Target Fabric"
depends on [31mCONFIG_TARGET_CORE[0m
depends on [31mCONFIG_USB_CONFIGFS[0m
select [31mCONFIG_USB_LIBCOMPOSITE[0m
select [31mCONFIG_USB_F_TCM[0m
help
This fabric is a [31mCONFIG_USB[0m gadget component. Two [31mCONFIG_USB[0m protocols are
supported that is BBB or BOT (Bulk Only Transport) and UAS
([31mCONFIG_USB[0m Attached [31mCONFIG_SCSI[0m). BOT is advertised on alternative
interface 0 (primary) and UAS is on alternative interface 1.
Both protocols can work on USB2.0 and USB3.0.
UAS utilizes the [31mCONFIG_USB[0m 3.0 feature called streams support.
choice
tristate "USB Gadget Drivers"
default [31mCONFIG_USB_ETH[0m
help
[31mCONFIG_A[0m Linux "Gadget Driver" talks to the [31mCONFIG_USB[0m Peripheral Controller
driver through the abstract "gadget" API. Some other operating
systems call these "client" drivers, of which "class drivers"
are a subset (implementing a [31mCONFIG_USB[0m device class specification).
[31mCONFIG_A[0m gadget driver implements one or more [31mCONFIG_USB[0m functions using
the peripheral hardware.
Gadget drivers are hardware-neutral, or "platform independent",
except that they sometimes must understand quirks or limitations
of the particular controllers they work with. For example, when
a controller doesn't support alternate configurations or provide
enough of the right types of endpoints, the gadget driver might
not be able work with that controller, or might need to implement
a less common variant of a device class protocol.
source "drivers/usb/gadget/legacy/Kconfig"
endchoice
endif # [31mCONFIG_USB_GADGET[0m