162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci# 362306a36Sopenharmony_ci# USB Gadget support on a system involves 462306a36Sopenharmony_ci# (a) a peripheral controller, and 562306a36Sopenharmony_ci# (b) the gadget driver using it. 662306a36Sopenharmony_ci# 762306a36Sopenharmony_ci# NOTE: Gadget support ** DOES NOT ** depend on host-side CONFIG_USB !! 862306a36Sopenharmony_ci# 962306a36Sopenharmony_ci# - Host systems (like PCs) need CONFIG_USB (with "A" jacks). 1062306a36Sopenharmony_ci# - Peripherals (like PDAs) need CONFIG_USB_GADGET (with "B" jacks). 1162306a36Sopenharmony_ci# - Some systems have both kinds of controllers. 1262306a36Sopenharmony_ci# 1362306a36Sopenharmony_ci# With help from a special transceiver and a "Mini-AB" jack, systems with 1462306a36Sopenharmony_ci# both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG). 1562306a36Sopenharmony_ci# 1662306a36Sopenharmony_ci# A Linux "Gadget Driver" talks to the USB Peripheral Controller 1762306a36Sopenharmony_ci# driver through the abstract "gadget" API. Some other operating 1862306a36Sopenharmony_ci# systems call these "client" drivers, of which "class drivers" 1962306a36Sopenharmony_ci# are a subset (implementing a USB device class specification). 2062306a36Sopenharmony_ci# A gadget driver implements one or more USB functions using 2162306a36Sopenharmony_ci# the peripheral hardware. 2262306a36Sopenharmony_ci# 2362306a36Sopenharmony_ci# Gadget drivers are hardware-neutral, or "platform independent", 2462306a36Sopenharmony_ci# except that they sometimes must understand quirks or limitations 2562306a36Sopenharmony_ci# of the particular controllers they work with. For example, when 2662306a36Sopenharmony_ci# a controller doesn't support alternate configurations or provide 2762306a36Sopenharmony_ci# enough of the right types of endpoints, the gadget driver might 2862306a36Sopenharmony_ci# not be able work with that controller, or might need to implement 2962306a36Sopenharmony_ci# a less common variant of a device class protocol. 3062306a36Sopenharmony_ci# 3162306a36Sopenharmony_ci# The available choices each represent a single precomposed USB 3262306a36Sopenharmony_ci# gadget configuration. In the device model, each option contains 3362306a36Sopenharmony_ci# both the device instantiation as a child for a USB gadget 3462306a36Sopenharmony_ci# controller, and the relevant drivers for each function declared 3562306a36Sopenharmony_ci# by the device. 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_cimenu "USB Gadget precomposed configurations" 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ciconfig USB_ZERO 4062306a36Sopenharmony_ci tristate "Gadget Zero (DEVELOPMENT)" 4162306a36Sopenharmony_ci select USB_LIBCOMPOSITE 4262306a36Sopenharmony_ci select USB_F_SS_LB 4362306a36Sopenharmony_ci help 4462306a36Sopenharmony_ci Gadget Zero is a two-configuration device. It either sinks and 4562306a36Sopenharmony_ci sources bulk data; or it loops back a configurable number of 4662306a36Sopenharmony_ci transfers. It also implements control requests, for "chapter 9" 4762306a36Sopenharmony_ci conformance. The driver needs only two bulk-capable endpoints, so 4862306a36Sopenharmony_ci it can work on top of most device-side usb controllers. It's 4962306a36Sopenharmony_ci useful for testing, and is also a working example showing how 5062306a36Sopenharmony_ci USB "gadget drivers" can be written. 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ci Make this be the first driver you try using on top of any new 5362306a36Sopenharmony_ci USB peripheral controller driver. Then you can use host-side 5462306a36Sopenharmony_ci test software, like the "usbtest" driver, to put your hardware 5562306a36Sopenharmony_ci and its driver through a basic set of functional tests. 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci Gadget Zero also works with the host-side "usb-skeleton" driver, 5862306a36Sopenharmony_ci and with many kinds of host-side test software. You may need 5962306a36Sopenharmony_ci to tweak product and vendor IDs before host software knows about 6062306a36Sopenharmony_ci this device, and arrange to select an appropriate configuration. 6162306a36Sopenharmony_ci 6262306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 6362306a36Sopenharmony_ci dynamically linked module called "g_zero". 6462306a36Sopenharmony_ci 6562306a36Sopenharmony_ciconfig USB_ZERO_HNPTEST 6662306a36Sopenharmony_ci bool "HNP Test Device" 6762306a36Sopenharmony_ci depends on USB_ZERO && USB_OTG 6862306a36Sopenharmony_ci help 6962306a36Sopenharmony_ci You can configure this device to enumerate using the device 7062306a36Sopenharmony_ci identifiers of the USB-OTG test device. That means that when 7162306a36Sopenharmony_ci this gadget connects to another OTG device, with this one using 7262306a36Sopenharmony_ci the "B-Peripheral" role, that device will use HNP to let this 7362306a36Sopenharmony_ci one serve as the USB host instead (in the "B-Host" role). 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ciconfig USB_AUDIO 7662306a36Sopenharmony_ci tristate "Audio Gadget" 7762306a36Sopenharmony_ci depends on SND 7862306a36Sopenharmony_ci select USB_LIBCOMPOSITE 7962306a36Sopenharmony_ci select SND_PCM 8062306a36Sopenharmony_ci select USB_F_UAC1 if (GADGET_UAC1 && !GADGET_UAC1_LEGACY) 8162306a36Sopenharmony_ci select USB_F_UAC1_LEGACY if (GADGET_UAC1 && GADGET_UAC1_LEGACY) 8262306a36Sopenharmony_ci select USB_F_UAC2 if !GADGET_UAC1 8362306a36Sopenharmony_ci select USB_U_AUDIO if (USB_F_UAC2 || USB_F_UAC1) 8462306a36Sopenharmony_ci help 8562306a36Sopenharmony_ci This Gadget Audio driver is compatible with USB Audio Class 8662306a36Sopenharmony_ci specification 2.0. It implements 1 AudioControl interface, 8762306a36Sopenharmony_ci 1 AudioStreaming Interface each for USB-OUT and USB-IN. 8862306a36Sopenharmony_ci Number of channels, sample rate and sample size can be 8962306a36Sopenharmony_ci specified as module parameters. 9062306a36Sopenharmony_ci This driver doesn't expect any real Audio codec to be present 9162306a36Sopenharmony_ci on the device - the audio streams are simply sinked to and 9262306a36Sopenharmony_ci sourced from a virtual ALSA sound card created. The user-space 9362306a36Sopenharmony_ci application may choose to do whatever it wants with the data 9462306a36Sopenharmony_ci received from the USB Host and choose to provide whatever it 9562306a36Sopenharmony_ci wants as audio data to the USB Host. 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 9862306a36Sopenharmony_ci dynamically linked module called "g_audio". 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ciconfig GADGET_UAC1 10162306a36Sopenharmony_ci bool "UAC 1.0" 10262306a36Sopenharmony_ci depends on USB_AUDIO 10362306a36Sopenharmony_ci help 10462306a36Sopenharmony_ci If you instead want older USB Audio Class specification 1.0 support 10562306a36Sopenharmony_ci with similar driver capabilities. 10662306a36Sopenharmony_ci 10762306a36Sopenharmony_ciconfig GADGET_UAC1_LEGACY 10862306a36Sopenharmony_ci bool "UAC 1.0 (Legacy)" 10962306a36Sopenharmony_ci depends on GADGET_UAC1 11062306a36Sopenharmony_ci help 11162306a36Sopenharmony_ci If you instead want legacy UAC Spec-1.0 driver that also has audio 11262306a36Sopenharmony_ci paths hardwired to the Audio codec chip on-board and doesn't work 11362306a36Sopenharmony_ci without one. 11462306a36Sopenharmony_ci 11562306a36Sopenharmony_ciconfig USB_ETH 11662306a36Sopenharmony_ci tristate "Ethernet Gadget (with CDC Ethernet support)" 11762306a36Sopenharmony_ci depends on NET 11862306a36Sopenharmony_ci select USB_LIBCOMPOSITE 11962306a36Sopenharmony_ci select USB_U_ETHER 12062306a36Sopenharmony_ci select USB_F_ECM 12162306a36Sopenharmony_ci select USB_F_SUBSET 12262306a36Sopenharmony_ci select CRC32 12362306a36Sopenharmony_ci help 12462306a36Sopenharmony_ci This driver implements Ethernet style communication, in one of 12562306a36Sopenharmony_ci several ways: 12662306a36Sopenharmony_ci 12762306a36Sopenharmony_ci - The "Communication Device Class" (CDC) Ethernet Control Model. 12862306a36Sopenharmony_ci That protocol is often avoided with pure Ethernet adapters, in 12962306a36Sopenharmony_ci favor of simpler vendor-specific hardware, but is widely 13062306a36Sopenharmony_ci supported by firmware for smart network devices. 13162306a36Sopenharmony_ci 13262306a36Sopenharmony_ci - On hardware can't implement that protocol, a simple CDC subset 13362306a36Sopenharmony_ci is used, placing fewer demands on USB. 13462306a36Sopenharmony_ci 13562306a36Sopenharmony_ci - CDC Ethernet Emulation Model (EEM) is a newer standard that has 13662306a36Sopenharmony_ci a simpler interface that can be used by more USB hardware. 13762306a36Sopenharmony_ci 13862306a36Sopenharmony_ci RNDIS support is an additional option, more demanding than subset. 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ci Within the USB device, this gadget driver exposes a network device 14162306a36Sopenharmony_ci "usbX", where X depends on what other networking devices you have. 14262306a36Sopenharmony_ci Treat it like a two-node Ethernet link: host, and gadget. 14362306a36Sopenharmony_ci 14462306a36Sopenharmony_ci The Linux-USB host-side "usbnet" driver interoperates with this 14562306a36Sopenharmony_ci driver, so that deep I/O queues can be supported. On 2.4 kernels, 14662306a36Sopenharmony_ci use "CDCEther" instead, if you're using the CDC option. That CDC 14762306a36Sopenharmony_ci mode should also interoperate with standard CDC Ethernet class 14862306a36Sopenharmony_ci drivers on other host operating systems. 14962306a36Sopenharmony_ci 15062306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 15162306a36Sopenharmony_ci dynamically linked module called "g_ether". 15262306a36Sopenharmony_ci 15362306a36Sopenharmony_ciconfig USB_ETH_RNDIS 15462306a36Sopenharmony_ci bool "RNDIS support" 15562306a36Sopenharmony_ci depends on USB_ETH 15662306a36Sopenharmony_ci select USB_LIBCOMPOSITE 15762306a36Sopenharmony_ci select USB_F_RNDIS 15862306a36Sopenharmony_ci default y 15962306a36Sopenharmony_ci help 16062306a36Sopenharmony_ci Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol, 16162306a36Sopenharmony_ci and Microsoft provides redistributable binary RNDIS drivers for 16262306a36Sopenharmony_ci older versions of Windows. 16362306a36Sopenharmony_ci 16462306a36Sopenharmony_ci If you say "y" here, the Ethernet gadget driver will try to provide 16562306a36Sopenharmony_ci a second device configuration, supporting RNDIS to talk to such 16662306a36Sopenharmony_ci Microsoft USB hosts. 16762306a36Sopenharmony_ci 16862306a36Sopenharmony_ci To make MS-Windows work with this, use Documentation/usb/linux.inf 16962306a36Sopenharmony_ci as the "driver info file". For versions of MS-Windows older than 17062306a36Sopenharmony_ci XP, you'll need to download drivers from Microsoft's website; a URL 17162306a36Sopenharmony_ci is given in comments found in that info file. 17262306a36Sopenharmony_ci 17362306a36Sopenharmony_ciconfig USB_ETH_EEM 17462306a36Sopenharmony_ci bool "Ethernet Emulation Model (EEM) support" 17562306a36Sopenharmony_ci depends on USB_ETH 17662306a36Sopenharmony_ci select USB_LIBCOMPOSITE 17762306a36Sopenharmony_ci select USB_F_EEM 17862306a36Sopenharmony_ci help 17962306a36Sopenharmony_ci CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM 18062306a36Sopenharmony_ci and therefore can be supported by more hardware. Technically ECM and 18162306a36Sopenharmony_ci EEM are designed for different applications. The ECM model extends 18262306a36Sopenharmony_ci the network interface to the target (e.g. a USB cable modem), and the 18362306a36Sopenharmony_ci EEM model is for mobile devices to communicate with hosts using 18462306a36Sopenharmony_ci ethernet over USB. For Linux gadgets, however, the interface with 18562306a36Sopenharmony_ci the host is the same (a usbX device), so the differences are minimal. 18662306a36Sopenharmony_ci 18762306a36Sopenharmony_ci If you say "y" here, the Ethernet gadget driver will use the EEM 18862306a36Sopenharmony_ci protocol rather than ECM. If unsure, say "n". 18962306a36Sopenharmony_ci 19062306a36Sopenharmony_ciconfig USB_G_NCM 19162306a36Sopenharmony_ci tristate "Network Control Model (NCM) support" 19262306a36Sopenharmony_ci depends on NET 19362306a36Sopenharmony_ci select USB_LIBCOMPOSITE 19462306a36Sopenharmony_ci select USB_U_ETHER 19562306a36Sopenharmony_ci select USB_F_NCM 19662306a36Sopenharmony_ci select CRC32 19762306a36Sopenharmony_ci help 19862306a36Sopenharmony_ci This driver implements USB CDC NCM subclass standard. NCM is 19962306a36Sopenharmony_ci an advanced protocol for Ethernet encapsulation, allows grouping 20062306a36Sopenharmony_ci of several ethernet frames into one USB transfer and different 20162306a36Sopenharmony_ci alignment possibilities. 20262306a36Sopenharmony_ci 20362306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 20462306a36Sopenharmony_ci dynamically linked module called "g_ncm". 20562306a36Sopenharmony_ci 20662306a36Sopenharmony_ciconfig USB_GADGETFS 20762306a36Sopenharmony_ci tristate "Gadget Filesystem" 20862306a36Sopenharmony_ci help 20962306a36Sopenharmony_ci This driver provides a filesystem based API that lets user mode 21062306a36Sopenharmony_ci programs implement a single-configuration USB device, including 21162306a36Sopenharmony_ci endpoint I/O and control requests that don't relate to enumeration. 21262306a36Sopenharmony_ci All endpoints, transfer speeds, and transfer types supported by 21362306a36Sopenharmony_ci the hardware are available, through read() and write() calls. 21462306a36Sopenharmony_ci 21562306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 21662306a36Sopenharmony_ci dynamically linked module called "gadgetfs". 21762306a36Sopenharmony_ci 21862306a36Sopenharmony_ciconfig USB_FUNCTIONFS 21962306a36Sopenharmony_ci tristate "Function Filesystem" 22062306a36Sopenharmony_ci select USB_LIBCOMPOSITE 22162306a36Sopenharmony_ci select USB_F_FS 22262306a36Sopenharmony_ci select USB_FUNCTIONFS_GENERIC if !(USB_FUNCTIONFS_ETH || USB_FUNCTIONFS_RNDIS) 22362306a36Sopenharmony_ci help 22462306a36Sopenharmony_ci The Function Filesystem (FunctionFS) lets one create USB 22562306a36Sopenharmony_ci composite functions in user space in the same way GadgetFS 22662306a36Sopenharmony_ci lets one create USB gadgets in user space. This allows creation 22762306a36Sopenharmony_ci of composite gadgets such that some of the functions are 22862306a36Sopenharmony_ci implemented in kernel space (for instance Ethernet, serial or 22962306a36Sopenharmony_ci mass storage) and other are implemented in user space. 23062306a36Sopenharmony_ci 23162306a36Sopenharmony_ci If you say "y" or "m" here you will be able what kind of 23262306a36Sopenharmony_ci configurations the gadget will provide. 23362306a36Sopenharmony_ci 23462306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build 23562306a36Sopenharmony_ci a dynamically linked module called "g_ffs". 23662306a36Sopenharmony_ci 23762306a36Sopenharmony_ciconfig USB_FUNCTIONFS_ETH 23862306a36Sopenharmony_ci bool "Include configuration with CDC ECM (Ethernet)" 23962306a36Sopenharmony_ci depends on USB_FUNCTIONFS && NET 24062306a36Sopenharmony_ci select USB_U_ETHER 24162306a36Sopenharmony_ci select USB_F_ECM 24262306a36Sopenharmony_ci select USB_F_SUBSET 24362306a36Sopenharmony_ci help 24462306a36Sopenharmony_ci Include a configuration with CDC ECM function (Ethernet) and the 24562306a36Sopenharmony_ci Function Filesystem. 24662306a36Sopenharmony_ci 24762306a36Sopenharmony_ciconfig USB_FUNCTIONFS_RNDIS 24862306a36Sopenharmony_ci bool "Include configuration with RNDIS (Ethernet)" 24962306a36Sopenharmony_ci depends on USB_FUNCTIONFS && NET 25062306a36Sopenharmony_ci select USB_U_ETHER 25162306a36Sopenharmony_ci select USB_F_RNDIS 25262306a36Sopenharmony_ci help 25362306a36Sopenharmony_ci Include a configuration with RNDIS function (Ethernet) and the Filesystem. 25462306a36Sopenharmony_ci 25562306a36Sopenharmony_ciconfig USB_FUNCTIONFS_GENERIC 25662306a36Sopenharmony_ci bool "Include 'pure' configuration" 25762306a36Sopenharmony_ci depends on USB_FUNCTIONFS 25862306a36Sopenharmony_ci help 25962306a36Sopenharmony_ci Include a configuration with the Function Filesystem alone with 26062306a36Sopenharmony_ci no Ethernet interface. 26162306a36Sopenharmony_ci 26262306a36Sopenharmony_ciconfig USB_MASS_STORAGE 26362306a36Sopenharmony_ci tristate "Mass Storage Gadget" 26462306a36Sopenharmony_ci depends on BLOCK 26562306a36Sopenharmony_ci select USB_LIBCOMPOSITE 26662306a36Sopenharmony_ci select USB_F_MASS_STORAGE 26762306a36Sopenharmony_ci help 26862306a36Sopenharmony_ci The Mass Storage Gadget acts as a USB Mass Storage disk drive. 26962306a36Sopenharmony_ci As its storage repository it can use a regular file or a block 27062306a36Sopenharmony_ci device (in much the same way as the "loop" device driver), 27162306a36Sopenharmony_ci specified as a module parameter or sysfs option. 27262306a36Sopenharmony_ci 27362306a36Sopenharmony_ci This driver is a replacement for now removed File-backed 27462306a36Sopenharmony_ci Storage Gadget (g_file_storage). 27562306a36Sopenharmony_ci 27662306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build 27762306a36Sopenharmony_ci a dynamically linked module called "g_mass_storage". 27862306a36Sopenharmony_ci 27962306a36Sopenharmony_ciconfig USB_GADGET_TARGET 28062306a36Sopenharmony_ci tristate "USB Gadget Target Fabric Module" 28162306a36Sopenharmony_ci depends on TARGET_CORE 28262306a36Sopenharmony_ci select USB_LIBCOMPOSITE 28362306a36Sopenharmony_ci select USB_F_TCM 28462306a36Sopenharmony_ci help 28562306a36Sopenharmony_ci This fabric is an USB gadget. Two USB protocols are supported that is 28662306a36Sopenharmony_ci BBB or BOT (Bulk Only Transport) and UAS (USB Attached SCSI). BOT is 28762306a36Sopenharmony_ci advertised on alternative interface 0 (primary) and UAS is on 28862306a36Sopenharmony_ci alternative interface 1. Both protocols can work on USB2.0 and USB3.0. 28962306a36Sopenharmony_ci UAS utilizes the USB 3.0 feature called streams support. 29062306a36Sopenharmony_ci 29162306a36Sopenharmony_ciconfig USB_G_SERIAL 29262306a36Sopenharmony_ci tristate "Serial Gadget (with CDC ACM and CDC OBEX support)" 29362306a36Sopenharmony_ci depends on TTY 29462306a36Sopenharmony_ci select USB_U_SERIAL 29562306a36Sopenharmony_ci select USB_F_ACM 29662306a36Sopenharmony_ci select USB_F_SERIAL 29762306a36Sopenharmony_ci select USB_F_OBEX 29862306a36Sopenharmony_ci select USB_LIBCOMPOSITE 29962306a36Sopenharmony_ci help 30062306a36Sopenharmony_ci The Serial Gadget talks to the Linux-USB generic serial driver. 30162306a36Sopenharmony_ci This driver supports a CDC-ACM module option, which can be used 30262306a36Sopenharmony_ci to interoperate with MS-Windows hosts or with the Linux-USB 30362306a36Sopenharmony_ci "cdc-acm" driver. 30462306a36Sopenharmony_ci 30562306a36Sopenharmony_ci This driver also supports a CDC-OBEX option. You will need a 30662306a36Sopenharmony_ci user space OBEX server talking to /dev/ttyGS*, since the kernel 30762306a36Sopenharmony_ci itself doesn't implement the OBEX protocol. 30862306a36Sopenharmony_ci 30962306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 31062306a36Sopenharmony_ci dynamically linked module called "g_serial". 31162306a36Sopenharmony_ci 31262306a36Sopenharmony_ci For more information, see Documentation/usb/gadget_serial.rst 31362306a36Sopenharmony_ci which includes instructions and a "driver info file" needed to 31462306a36Sopenharmony_ci make MS-Windows work with CDC ACM. 31562306a36Sopenharmony_ci 31662306a36Sopenharmony_ciconfig USB_MIDI_GADGET 31762306a36Sopenharmony_ci tristate "MIDI Gadget" 31862306a36Sopenharmony_ci depends on SND 31962306a36Sopenharmony_ci select USB_LIBCOMPOSITE 32062306a36Sopenharmony_ci select SND_RAWMIDI 32162306a36Sopenharmony_ci select USB_F_MIDI 32262306a36Sopenharmony_ci help 32362306a36Sopenharmony_ci The MIDI Gadget acts as a USB Audio device, with one MIDI 32462306a36Sopenharmony_ci input and one MIDI output. These MIDI jacks appear as 32562306a36Sopenharmony_ci a sound "card" in the ALSA sound system. Other MIDI 32662306a36Sopenharmony_ci connections can then be made on the gadget system, using 32762306a36Sopenharmony_ci ALSA's aconnect utility etc. 32862306a36Sopenharmony_ci 32962306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 33062306a36Sopenharmony_ci dynamically linked module called "g_midi". 33162306a36Sopenharmony_ci 33262306a36Sopenharmony_ciconfig USB_G_PRINTER 33362306a36Sopenharmony_ci tristate "Printer Gadget" 33462306a36Sopenharmony_ci select USB_LIBCOMPOSITE 33562306a36Sopenharmony_ci select USB_F_PRINTER 33662306a36Sopenharmony_ci help 33762306a36Sopenharmony_ci The Printer Gadget channels data between the USB host and a 33862306a36Sopenharmony_ci userspace program driving the print engine. The user space 33962306a36Sopenharmony_ci program reads and writes the device file /dev/g_printer to 34062306a36Sopenharmony_ci receive or send printer data. It can use ioctl calls to 34162306a36Sopenharmony_ci the device file to get or set printer status. 34262306a36Sopenharmony_ci 34362306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 34462306a36Sopenharmony_ci dynamically linked module called "g_printer". 34562306a36Sopenharmony_ci 34662306a36Sopenharmony_ci For more information, see Documentation/usb/gadget_printer.rst 34762306a36Sopenharmony_ci which includes sample code for accessing the device file. 34862306a36Sopenharmony_ci 34962306a36Sopenharmony_ciif TTY 35062306a36Sopenharmony_ci 35162306a36Sopenharmony_ciconfig USB_CDC_COMPOSITE 35262306a36Sopenharmony_ci tristate "CDC Composite Device (Ethernet and ACM)" 35362306a36Sopenharmony_ci depends on NET 35462306a36Sopenharmony_ci select USB_LIBCOMPOSITE 35562306a36Sopenharmony_ci select USB_U_SERIAL 35662306a36Sopenharmony_ci select USB_U_ETHER 35762306a36Sopenharmony_ci select USB_F_ACM 35862306a36Sopenharmony_ci select USB_F_ECM 35962306a36Sopenharmony_ci help 36062306a36Sopenharmony_ci This driver provides two functions in one configuration: 36162306a36Sopenharmony_ci a CDC Ethernet (ECM) link, and a CDC ACM (serial port) link. 36262306a36Sopenharmony_ci 36362306a36Sopenharmony_ci This driver requires four bulk and two interrupt endpoints, 36462306a36Sopenharmony_ci plus the ability to handle altsettings. Not all peripheral 36562306a36Sopenharmony_ci controllers are that capable. 36662306a36Sopenharmony_ci 36762306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 36862306a36Sopenharmony_ci dynamically linked module. 36962306a36Sopenharmony_ci 37062306a36Sopenharmony_ciconfig USB_G_NOKIA 37162306a36Sopenharmony_ci tristate "Nokia composite gadget" 37262306a36Sopenharmony_ci depends on PHONET 37362306a36Sopenharmony_ci depends on BLOCK 37462306a36Sopenharmony_ci select USB_LIBCOMPOSITE 37562306a36Sopenharmony_ci select USB_U_SERIAL 37662306a36Sopenharmony_ci select USB_U_ETHER 37762306a36Sopenharmony_ci select USB_F_ACM 37862306a36Sopenharmony_ci select USB_F_OBEX 37962306a36Sopenharmony_ci select USB_F_PHONET 38062306a36Sopenharmony_ci select USB_F_ECM 38162306a36Sopenharmony_ci select USB_F_MASS_STORAGE 38262306a36Sopenharmony_ci help 38362306a36Sopenharmony_ci The Nokia composite gadget provides support for acm, obex 38462306a36Sopenharmony_ci and phonet in only one composite gadget driver. 38562306a36Sopenharmony_ci 38662306a36Sopenharmony_ci It's only really useful for N900 hardware. If you're building 38762306a36Sopenharmony_ci a kernel for N900, say Y or M here. If unsure, say N. 38862306a36Sopenharmony_ci 38962306a36Sopenharmony_ciconfig USB_G_ACM_MS 39062306a36Sopenharmony_ci tristate "CDC Composite Device (ACM and mass storage)" 39162306a36Sopenharmony_ci depends on BLOCK 39262306a36Sopenharmony_ci select USB_LIBCOMPOSITE 39362306a36Sopenharmony_ci select USB_U_SERIAL 39462306a36Sopenharmony_ci select USB_F_ACM 39562306a36Sopenharmony_ci select USB_F_MASS_STORAGE 39662306a36Sopenharmony_ci help 39762306a36Sopenharmony_ci This driver provides two functions in one configuration: 39862306a36Sopenharmony_ci a mass storage, and a CDC ACM (serial port) link. 39962306a36Sopenharmony_ci 40062306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 40162306a36Sopenharmony_ci dynamically linked module called "g_acm_ms". 40262306a36Sopenharmony_ci 40362306a36Sopenharmony_ciconfig USB_G_MULTI 40462306a36Sopenharmony_ci tristate "Multifunction Composite Gadget" 40562306a36Sopenharmony_ci depends on BLOCK && NET 40662306a36Sopenharmony_ci select USB_G_MULTI_CDC if !USB_G_MULTI_RNDIS 40762306a36Sopenharmony_ci select USB_LIBCOMPOSITE 40862306a36Sopenharmony_ci select USB_U_SERIAL 40962306a36Sopenharmony_ci select USB_U_ETHER 41062306a36Sopenharmony_ci select USB_F_ACM 41162306a36Sopenharmony_ci select USB_F_MASS_STORAGE 41262306a36Sopenharmony_ci help 41362306a36Sopenharmony_ci The Multifunction Composite Gadget provides Ethernet (RNDIS 41462306a36Sopenharmony_ci and/or CDC Ethernet), mass storage and ACM serial link 41562306a36Sopenharmony_ci interfaces. 41662306a36Sopenharmony_ci 41762306a36Sopenharmony_ci You will be asked to choose which of the two configurations is 41862306a36Sopenharmony_ci to be available in the gadget. At least one configuration must 41962306a36Sopenharmony_ci be chosen to make the gadget usable. Selecting more than one 42062306a36Sopenharmony_ci configuration will prevent Windows from automatically detecting 42162306a36Sopenharmony_ci the gadget as a composite gadget, so an INF file will be needed to 42262306a36Sopenharmony_ci use the gadget. 42362306a36Sopenharmony_ci 42462306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 42562306a36Sopenharmony_ci dynamically linked module called "g_multi". 42662306a36Sopenharmony_ci 42762306a36Sopenharmony_ciconfig USB_G_MULTI_RNDIS 42862306a36Sopenharmony_ci bool "RNDIS + CDC Serial + Storage configuration" 42962306a36Sopenharmony_ci depends on USB_G_MULTI 43062306a36Sopenharmony_ci select USB_F_RNDIS 43162306a36Sopenharmony_ci default y 43262306a36Sopenharmony_ci help 43362306a36Sopenharmony_ci This option enables a configuration with RNDIS, CDC Serial and 43462306a36Sopenharmony_ci Mass Storage functions available in the Multifunction Composite 43562306a36Sopenharmony_ci Gadget. This is the configuration dedicated for Windows since RNDIS 43662306a36Sopenharmony_ci is Microsoft's protocol. 43762306a36Sopenharmony_ci 43862306a36Sopenharmony_ci If unsure, say "y". 43962306a36Sopenharmony_ci 44062306a36Sopenharmony_ciconfig USB_G_MULTI_CDC 44162306a36Sopenharmony_ci bool "CDC Ethernet + CDC Serial + Storage configuration" 44262306a36Sopenharmony_ci depends on USB_G_MULTI 44362306a36Sopenharmony_ci select USB_F_ECM 44462306a36Sopenharmony_ci help 44562306a36Sopenharmony_ci This option enables a configuration with CDC Ethernet (ECM), CDC 44662306a36Sopenharmony_ci Serial and Mass Storage functions available in the Multifunction 44762306a36Sopenharmony_ci Composite Gadget. 44862306a36Sopenharmony_ci 44962306a36Sopenharmony_ci If unsure, say "y". 45062306a36Sopenharmony_ci 45162306a36Sopenharmony_ciendif # TTY 45262306a36Sopenharmony_ci 45362306a36Sopenharmony_ciconfig USB_G_HID 45462306a36Sopenharmony_ci tristate "HID Gadget" 45562306a36Sopenharmony_ci select USB_LIBCOMPOSITE 45662306a36Sopenharmony_ci select USB_F_HID 45762306a36Sopenharmony_ci help 45862306a36Sopenharmony_ci The HID gadget driver provides generic emulation of USB 45962306a36Sopenharmony_ci Human Interface Devices (HID). 46062306a36Sopenharmony_ci 46162306a36Sopenharmony_ci For more information, see Documentation/usb/gadget_hid.rst which 46262306a36Sopenharmony_ci includes sample code for accessing the device files. 46362306a36Sopenharmony_ci 46462306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 46562306a36Sopenharmony_ci dynamically linked module called "g_hid". 46662306a36Sopenharmony_ci 46762306a36Sopenharmony_ci# Standalone / single function gadgets 46862306a36Sopenharmony_ciconfig USB_G_DBGP 46962306a36Sopenharmony_ci tristate "EHCI Debug Device Gadget" 47062306a36Sopenharmony_ci depends on TTY 47162306a36Sopenharmony_ci select USB_LIBCOMPOSITE 47262306a36Sopenharmony_ci help 47362306a36Sopenharmony_ci This gadget emulates an EHCI Debug device. This is useful when you want 47462306a36Sopenharmony_ci to interact with an EHCI Debug Port. 47562306a36Sopenharmony_ci 47662306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 47762306a36Sopenharmony_ci dynamically linked module called "g_dbgp". 47862306a36Sopenharmony_ci 47962306a36Sopenharmony_ciif USB_G_DBGP 48062306a36Sopenharmony_cichoice 48162306a36Sopenharmony_ci prompt "EHCI Debug Device mode" 48262306a36Sopenharmony_ci default USB_G_DBGP_SERIAL 48362306a36Sopenharmony_ci 48462306a36Sopenharmony_ciconfig USB_G_DBGP_PRINTK 48562306a36Sopenharmony_ci depends on USB_G_DBGP 48662306a36Sopenharmony_ci bool "printk" 48762306a36Sopenharmony_ci help 48862306a36Sopenharmony_ci Directly printk() received data. No interaction. 48962306a36Sopenharmony_ci 49062306a36Sopenharmony_ciconfig USB_G_DBGP_SERIAL 49162306a36Sopenharmony_ci depends on USB_G_DBGP 49262306a36Sopenharmony_ci select USB_U_SERIAL 49362306a36Sopenharmony_ci bool "serial" 49462306a36Sopenharmony_ci help 49562306a36Sopenharmony_ci Userland can interact using /dev/ttyGSxxx. 49662306a36Sopenharmony_ciendchoice 49762306a36Sopenharmony_ciendif 49862306a36Sopenharmony_ci 49962306a36Sopenharmony_ci# put drivers that need isochronous transfer support (for audio 50062306a36Sopenharmony_ci# or video class gadget drivers), or specific hardware, here. 50162306a36Sopenharmony_ciconfig USB_G_WEBCAM 50262306a36Sopenharmony_ci tristate "USB Webcam Gadget" 50362306a36Sopenharmony_ci depends on VIDEO_DEV 50462306a36Sopenharmony_ci select USB_LIBCOMPOSITE 50562306a36Sopenharmony_ci select VIDEOBUF2_DMA_SG 50662306a36Sopenharmony_ci select VIDEOBUF2_VMALLOC 50762306a36Sopenharmony_ci select USB_F_UVC 50862306a36Sopenharmony_ci help 50962306a36Sopenharmony_ci The Webcam Gadget acts as a composite USB Audio and Video Class 51062306a36Sopenharmony_ci device. It provides a userspace API to process UVC control requests 51162306a36Sopenharmony_ci and stream video data to the host. 51262306a36Sopenharmony_ci 51362306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 51462306a36Sopenharmony_ci dynamically linked module called "g_webcam". 51562306a36Sopenharmony_ci 51662306a36Sopenharmony_ciconfig USB_RAW_GADGET 51762306a36Sopenharmony_ci tristate "USB Raw Gadget" 51862306a36Sopenharmony_ci help 51962306a36Sopenharmony_ci USB Raw Gadget is a gadget driver that gives userspace low-level 52062306a36Sopenharmony_ci control over the gadget's communication process. 52162306a36Sopenharmony_ci 52262306a36Sopenharmony_ci Like any other gadget driver, Raw Gadget implements USB devices via 52362306a36Sopenharmony_ci the USB gadget API. Unlike most gadget drivers, Raw Gadget does not 52462306a36Sopenharmony_ci implement any concrete USB functions itself but requires userspace 52562306a36Sopenharmony_ci to do that. 52662306a36Sopenharmony_ci 52762306a36Sopenharmony_ci See Documentation/usb/raw-gadget.rst for details. 52862306a36Sopenharmony_ci 52962306a36Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 53062306a36Sopenharmony_ci dynamically linked module called "raw_gadget". 53162306a36Sopenharmony_ci 53262306a36Sopenharmony_ciendmenu 533