18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci# 38c2ecf20Sopenharmony_ci# USB Gadget support on a system involves 48c2ecf20Sopenharmony_ci# (a) a peripheral controller, and 58c2ecf20Sopenharmony_ci# (b) the gadget driver using it. 68c2ecf20Sopenharmony_ci# 78c2ecf20Sopenharmony_ci# NOTE: Gadget support ** DOES NOT ** depend on host-side CONFIG_USB !! 88c2ecf20Sopenharmony_ci# 98c2ecf20Sopenharmony_ci# - Host systems (like PCs) need CONFIG_USB (with "A" jacks). 108c2ecf20Sopenharmony_ci# - Peripherals (like PDAs) need CONFIG_USB_GADGET (with "B" jacks). 118c2ecf20Sopenharmony_ci# - Some systems have both kinds of controllers. 128c2ecf20Sopenharmony_ci# 138c2ecf20Sopenharmony_ci# With help from a special transceiver and a "Mini-AB" jack, systems with 148c2ecf20Sopenharmony_ci# both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG). 158c2ecf20Sopenharmony_ci# 168c2ecf20Sopenharmony_ci# A Linux "Gadget Driver" talks to the USB Peripheral Controller 178c2ecf20Sopenharmony_ci# driver through the abstract "gadget" API. Some other operating 188c2ecf20Sopenharmony_ci# systems call these "client" drivers, of which "class drivers" 198c2ecf20Sopenharmony_ci# are a subset (implementing a USB device class specification). 208c2ecf20Sopenharmony_ci# A gadget driver implements one or more USB functions using 218c2ecf20Sopenharmony_ci# the peripheral hardware. 228c2ecf20Sopenharmony_ci# 238c2ecf20Sopenharmony_ci# Gadget drivers are hardware-neutral, or "platform independent", 248c2ecf20Sopenharmony_ci# except that they sometimes must understand quirks or limitations 258c2ecf20Sopenharmony_ci# of the particular controllers they work with. For example, when 268c2ecf20Sopenharmony_ci# a controller doesn't support alternate configurations or provide 278c2ecf20Sopenharmony_ci# enough of the right types of endpoints, the gadget driver might 288c2ecf20Sopenharmony_ci# not be able work with that controller, or might need to implement 298c2ecf20Sopenharmony_ci# a less common variant of a device class protocol. 308c2ecf20Sopenharmony_ci# 318c2ecf20Sopenharmony_ci# The available choices each represent a single precomposed USB 328c2ecf20Sopenharmony_ci# gadget configuration. In the device model, each option contains 338c2ecf20Sopenharmony_ci# both the device instantiation as a child for a USB gadget 348c2ecf20Sopenharmony_ci# controller, and the relevant drivers for each function declared 358c2ecf20Sopenharmony_ci# by the device. 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_cimenu "USB Gadget precomposed configurations" 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciconfig USB_ZERO 408c2ecf20Sopenharmony_ci tristate "Gadget Zero (DEVELOPMENT)" 418c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 428c2ecf20Sopenharmony_ci select USB_F_SS_LB 438c2ecf20Sopenharmony_ci help 448c2ecf20Sopenharmony_ci Gadget Zero is a two-configuration device. It either sinks and 458c2ecf20Sopenharmony_ci sources bulk data; or it loops back a configurable number of 468c2ecf20Sopenharmony_ci transfers. It also implements control requests, for "chapter 9" 478c2ecf20Sopenharmony_ci conformance. The driver needs only two bulk-capable endpoints, so 488c2ecf20Sopenharmony_ci it can work on top of most device-side usb controllers. It's 498c2ecf20Sopenharmony_ci useful for testing, and is also a working example showing how 508c2ecf20Sopenharmony_ci USB "gadget drivers" can be written. 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci Make this be the first driver you try using on top of any new 538c2ecf20Sopenharmony_ci USB peripheral controller driver. Then you can use host-side 548c2ecf20Sopenharmony_ci test software, like the "usbtest" driver, to put your hardware 558c2ecf20Sopenharmony_ci and its driver through a basic set of functional tests. 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci Gadget Zero also works with the host-side "usb-skeleton" driver, 588c2ecf20Sopenharmony_ci and with many kinds of host-side test software. You may need 598c2ecf20Sopenharmony_ci to tweak product and vendor IDs before host software knows about 608c2ecf20Sopenharmony_ci this device, and arrange to select an appropriate configuration. 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 638c2ecf20Sopenharmony_ci dynamically linked module called "g_zero". 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ciconfig USB_ZERO_HNPTEST 668c2ecf20Sopenharmony_ci bool "HNP Test Device" 678c2ecf20Sopenharmony_ci depends on USB_ZERO && USB_OTG 688c2ecf20Sopenharmony_ci help 698c2ecf20Sopenharmony_ci You can configure this device to enumerate using the device 708c2ecf20Sopenharmony_ci identifiers of the USB-OTG test device. That means that when 718c2ecf20Sopenharmony_ci this gadget connects to another OTG device, with this one using 728c2ecf20Sopenharmony_ci the "B-Peripheral" role, that device will use HNP to let this 738c2ecf20Sopenharmony_ci one serve as the USB host instead (in the "B-Host" role). 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ciconfig USB_AUDIO 768c2ecf20Sopenharmony_ci tristate "Audio Gadget" 778c2ecf20Sopenharmony_ci depends on SND 788c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 798c2ecf20Sopenharmony_ci select SND_PCM 808c2ecf20Sopenharmony_ci select USB_F_UAC1 if (GADGET_UAC1 && !GADGET_UAC1_LEGACY) 818c2ecf20Sopenharmony_ci select USB_F_UAC1_LEGACY if (GADGET_UAC1 && GADGET_UAC1_LEGACY) 828c2ecf20Sopenharmony_ci select USB_F_UAC2 if !GADGET_UAC1 838c2ecf20Sopenharmony_ci select USB_U_AUDIO if (USB_F_UAC2 || USB_F_UAC1) 848c2ecf20Sopenharmony_ci help 858c2ecf20Sopenharmony_ci This Gadget Audio driver is compatible with USB Audio Class 868c2ecf20Sopenharmony_ci specification 2.0. It implements 1 AudioControl interface, 878c2ecf20Sopenharmony_ci 1 AudioStreaming Interface each for USB-OUT and USB-IN. 888c2ecf20Sopenharmony_ci Number of channels, sample rate and sample size can be 898c2ecf20Sopenharmony_ci specified as module parameters. 908c2ecf20Sopenharmony_ci This driver doesn't expect any real Audio codec to be present 918c2ecf20Sopenharmony_ci on the device - the audio streams are simply sinked to and 928c2ecf20Sopenharmony_ci sourced from a virtual ALSA sound card created. The user-space 938c2ecf20Sopenharmony_ci application may choose to do whatever it wants with the data 948c2ecf20Sopenharmony_ci received from the USB Host and choose to provide whatever it 958c2ecf20Sopenharmony_ci wants as audio data to the USB Host. 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 988c2ecf20Sopenharmony_ci dynamically linked module called "g_audio". 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ciconfig GADGET_UAC1 1018c2ecf20Sopenharmony_ci bool "UAC 1.0" 1028c2ecf20Sopenharmony_ci depends on USB_AUDIO 1038c2ecf20Sopenharmony_ci help 1048c2ecf20Sopenharmony_ci If you instead want older USB Audio Class specification 1.0 support 1058c2ecf20Sopenharmony_ci with similar driver capabilities. 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ciconfig GADGET_UAC1_LEGACY 1088c2ecf20Sopenharmony_ci bool "UAC 1.0 (Legacy)" 1098c2ecf20Sopenharmony_ci depends on GADGET_UAC1 1108c2ecf20Sopenharmony_ci help 1118c2ecf20Sopenharmony_ci If you instead want legacy UAC Spec-1.0 driver that also has audio 1128c2ecf20Sopenharmony_ci paths hardwired to the Audio codec chip on-board and doesn't work 1138c2ecf20Sopenharmony_ci without one. 1148c2ecf20Sopenharmony_ci 1158c2ecf20Sopenharmony_ciconfig USB_ETH 1168c2ecf20Sopenharmony_ci tristate "Ethernet Gadget (with CDC Ethernet support)" 1178c2ecf20Sopenharmony_ci depends on NET 1188c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 1198c2ecf20Sopenharmony_ci select USB_U_ETHER 1208c2ecf20Sopenharmony_ci select USB_F_ECM 1218c2ecf20Sopenharmony_ci select USB_F_SUBSET 1228c2ecf20Sopenharmony_ci select CRC32 1238c2ecf20Sopenharmony_ci help 1248c2ecf20Sopenharmony_ci This driver implements Ethernet style communication, in one of 1258c2ecf20Sopenharmony_ci several ways: 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_ci - The "Communication Device Class" (CDC) Ethernet Control Model. 1288c2ecf20Sopenharmony_ci That protocol is often avoided with pure Ethernet adapters, in 1298c2ecf20Sopenharmony_ci favor of simpler vendor-specific hardware, but is widely 1308c2ecf20Sopenharmony_ci supported by firmware for smart network devices. 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_ci - On hardware can't implement that protocol, a simple CDC subset 1338c2ecf20Sopenharmony_ci is used, placing fewer demands on USB. 1348c2ecf20Sopenharmony_ci 1358c2ecf20Sopenharmony_ci - CDC Ethernet Emulation Model (EEM) is a newer standard that has 1368c2ecf20Sopenharmony_ci a simpler interface that can be used by more USB hardware. 1378c2ecf20Sopenharmony_ci 1388c2ecf20Sopenharmony_ci RNDIS support is an additional option, more demanding than subset. 1398c2ecf20Sopenharmony_ci 1408c2ecf20Sopenharmony_ci Within the USB device, this gadget driver exposes a network device 1418c2ecf20Sopenharmony_ci "usbX", where X depends on what other networking devices you have. 1428c2ecf20Sopenharmony_ci Treat it like a two-node Ethernet link: host, and gadget. 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_ci The Linux-USB host-side "usbnet" driver interoperates with this 1458c2ecf20Sopenharmony_ci driver, so that deep I/O queues can be supported. On 2.4 kernels, 1468c2ecf20Sopenharmony_ci use "CDCEther" instead, if you're using the CDC option. That CDC 1478c2ecf20Sopenharmony_ci mode should also interoperate with standard CDC Ethernet class 1488c2ecf20Sopenharmony_ci drivers on other host operating systems. 1498c2ecf20Sopenharmony_ci 1508c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 1518c2ecf20Sopenharmony_ci dynamically linked module called "g_ether". 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ciconfig USB_ETH_RNDIS 1548c2ecf20Sopenharmony_ci bool "RNDIS support" 1558c2ecf20Sopenharmony_ci depends on USB_ETH 1568c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 1578c2ecf20Sopenharmony_ci select USB_F_RNDIS 1588c2ecf20Sopenharmony_ci default y 1598c2ecf20Sopenharmony_ci help 1608c2ecf20Sopenharmony_ci Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol, 1618c2ecf20Sopenharmony_ci and Microsoft provides redistributable binary RNDIS drivers for 1628c2ecf20Sopenharmony_ci older versions of Windows. 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ci If you say "y" here, the Ethernet gadget driver will try to provide 1658c2ecf20Sopenharmony_ci a second device configuration, supporting RNDIS to talk to such 1668c2ecf20Sopenharmony_ci Microsoft USB hosts. 1678c2ecf20Sopenharmony_ci 1688c2ecf20Sopenharmony_ci To make MS-Windows work with this, use Documentation/usb/linux.inf 1698c2ecf20Sopenharmony_ci as the "driver info file". For versions of MS-Windows older than 1708c2ecf20Sopenharmony_ci XP, you'll need to download drivers from Microsoft's website; a URL 1718c2ecf20Sopenharmony_ci is given in comments found in that info file. 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_ciconfig USB_ETH_EEM 1748c2ecf20Sopenharmony_ci bool "Ethernet Emulation Model (EEM) support" 1758c2ecf20Sopenharmony_ci depends on USB_ETH 1768c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 1778c2ecf20Sopenharmony_ci select USB_F_EEM 1788c2ecf20Sopenharmony_ci help 1798c2ecf20Sopenharmony_ci CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM 1808c2ecf20Sopenharmony_ci and therefore can be supported by more hardware. Technically ECM and 1818c2ecf20Sopenharmony_ci EEM are designed for different applications. The ECM model extends 1828c2ecf20Sopenharmony_ci the network interface to the target (e.g. a USB cable modem), and the 1838c2ecf20Sopenharmony_ci EEM model is for mobile devices to communicate with hosts using 1848c2ecf20Sopenharmony_ci ethernet over USB. For Linux gadgets, however, the interface with 1858c2ecf20Sopenharmony_ci the host is the same (a usbX device), so the differences are minimal. 1868c2ecf20Sopenharmony_ci 1878c2ecf20Sopenharmony_ci If you say "y" here, the Ethernet gadget driver will use the EEM 1888c2ecf20Sopenharmony_ci protocol rather than ECM. If unsure, say "n". 1898c2ecf20Sopenharmony_ci 1908c2ecf20Sopenharmony_ciconfig USB_G_NCM 1918c2ecf20Sopenharmony_ci tristate "Network Control Model (NCM) support" 1928c2ecf20Sopenharmony_ci depends on NET 1938c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 1948c2ecf20Sopenharmony_ci select USB_U_ETHER 1958c2ecf20Sopenharmony_ci select USB_F_NCM 1968c2ecf20Sopenharmony_ci select CRC32 1978c2ecf20Sopenharmony_ci help 1988c2ecf20Sopenharmony_ci This driver implements USB CDC NCM subclass standard. NCM is 1998c2ecf20Sopenharmony_ci an advanced protocol for Ethernet encapsulation, allows grouping 2008c2ecf20Sopenharmony_ci of several ethernet frames into one USB transfer and different 2018c2ecf20Sopenharmony_ci alignment possibilities. 2028c2ecf20Sopenharmony_ci 2038c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 2048c2ecf20Sopenharmony_ci dynamically linked module called "g_ncm". 2058c2ecf20Sopenharmony_ci 2068c2ecf20Sopenharmony_ciconfig USB_GADGETFS 2078c2ecf20Sopenharmony_ci tristate "Gadget Filesystem" 2088c2ecf20Sopenharmony_ci help 2098c2ecf20Sopenharmony_ci This driver provides a filesystem based API that lets user mode 2108c2ecf20Sopenharmony_ci programs implement a single-configuration USB device, including 2118c2ecf20Sopenharmony_ci endpoint I/O and control requests that don't relate to enumeration. 2128c2ecf20Sopenharmony_ci All endpoints, transfer speeds, and transfer types supported by 2138c2ecf20Sopenharmony_ci the hardware are available, through read() and write() calls. 2148c2ecf20Sopenharmony_ci 2158c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 2168c2ecf20Sopenharmony_ci dynamically linked module called "gadgetfs". 2178c2ecf20Sopenharmony_ci 2188c2ecf20Sopenharmony_ciconfig USB_FUNCTIONFS 2198c2ecf20Sopenharmony_ci tristate "Function Filesystem" 2208c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 2218c2ecf20Sopenharmony_ci select USB_F_FS 2228c2ecf20Sopenharmony_ci select USB_FUNCTIONFS_GENERIC if !(USB_FUNCTIONFS_ETH || USB_FUNCTIONFS_RNDIS) 2238c2ecf20Sopenharmony_ci help 2248c2ecf20Sopenharmony_ci The Function Filesystem (FunctionFS) lets one create USB 2258c2ecf20Sopenharmony_ci composite functions in user space in the same way GadgetFS 2268c2ecf20Sopenharmony_ci lets one create USB gadgets in user space. This allows creation 2278c2ecf20Sopenharmony_ci of composite gadgets such that some of the functions are 2288c2ecf20Sopenharmony_ci implemented in kernel space (for instance Ethernet, serial or 2298c2ecf20Sopenharmony_ci mass storage) and other are implemented in user space. 2308c2ecf20Sopenharmony_ci 2318c2ecf20Sopenharmony_ci If you say "y" or "m" here you will be able what kind of 2328c2ecf20Sopenharmony_ci configurations the gadget will provide. 2338c2ecf20Sopenharmony_ci 2348c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build 2358c2ecf20Sopenharmony_ci a dynamically linked module called "g_ffs". 2368c2ecf20Sopenharmony_ci 2378c2ecf20Sopenharmony_ciconfig USB_FUNCTIONFS_ETH 2388c2ecf20Sopenharmony_ci bool "Include configuration with CDC ECM (Ethernet)" 2398c2ecf20Sopenharmony_ci depends on USB_FUNCTIONFS && NET 2408c2ecf20Sopenharmony_ci select USB_U_ETHER 2418c2ecf20Sopenharmony_ci select USB_F_ECM 2428c2ecf20Sopenharmony_ci select USB_F_SUBSET 2438c2ecf20Sopenharmony_ci help 2448c2ecf20Sopenharmony_ci Include a configuration with CDC ECM function (Ethernet) and the 2458c2ecf20Sopenharmony_ci Function Filesystem. 2468c2ecf20Sopenharmony_ci 2478c2ecf20Sopenharmony_ciconfig USB_FUNCTIONFS_RNDIS 2488c2ecf20Sopenharmony_ci bool "Include configuration with RNDIS (Ethernet)" 2498c2ecf20Sopenharmony_ci depends on USB_FUNCTIONFS && NET 2508c2ecf20Sopenharmony_ci select USB_U_ETHER 2518c2ecf20Sopenharmony_ci select USB_F_RNDIS 2528c2ecf20Sopenharmony_ci help 2538c2ecf20Sopenharmony_ci Include a configuration with RNDIS function (Ethernet) and the Filesystem. 2548c2ecf20Sopenharmony_ci 2558c2ecf20Sopenharmony_ciconfig USB_FUNCTIONFS_GENERIC 2568c2ecf20Sopenharmony_ci bool "Include 'pure' configuration" 2578c2ecf20Sopenharmony_ci depends on USB_FUNCTIONFS 2588c2ecf20Sopenharmony_ci help 2598c2ecf20Sopenharmony_ci Include a configuration with the Function Filesystem alone with 2608c2ecf20Sopenharmony_ci no Ethernet interface. 2618c2ecf20Sopenharmony_ci 2628c2ecf20Sopenharmony_ciconfig USB_MASS_STORAGE 2638c2ecf20Sopenharmony_ci tristate "Mass Storage Gadget" 2648c2ecf20Sopenharmony_ci depends on BLOCK 2658c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 2668c2ecf20Sopenharmony_ci select USB_F_MASS_STORAGE 2678c2ecf20Sopenharmony_ci help 2688c2ecf20Sopenharmony_ci The Mass Storage Gadget acts as a USB Mass Storage disk drive. 2698c2ecf20Sopenharmony_ci As its storage repository it can use a regular file or a block 2708c2ecf20Sopenharmony_ci device (in much the same way as the "loop" device driver), 2718c2ecf20Sopenharmony_ci specified as a module parameter or sysfs option. 2728c2ecf20Sopenharmony_ci 2738c2ecf20Sopenharmony_ci This driver is a replacement for now removed File-backed 2748c2ecf20Sopenharmony_ci Storage Gadget (g_file_storage). 2758c2ecf20Sopenharmony_ci 2768c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build 2778c2ecf20Sopenharmony_ci a dynamically linked module called "g_mass_storage". 2788c2ecf20Sopenharmony_ci 2798c2ecf20Sopenharmony_ciconfig USB_GADGET_TARGET 2808c2ecf20Sopenharmony_ci tristate "USB Gadget Target Fabric Module" 2818c2ecf20Sopenharmony_ci depends on TARGET_CORE 2828c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 2838c2ecf20Sopenharmony_ci select USB_F_TCM 2848c2ecf20Sopenharmony_ci help 2858c2ecf20Sopenharmony_ci This fabric is an USB gadget. Two USB protocols are supported that is 2868c2ecf20Sopenharmony_ci BBB or BOT (Bulk Only Transport) and UAS (USB Attached SCSI). BOT is 2878c2ecf20Sopenharmony_ci advertised on alternative interface 0 (primary) and UAS is on 2888c2ecf20Sopenharmony_ci alternative interface 1. Both protocols can work on USB2.0 and USB3.0. 2898c2ecf20Sopenharmony_ci UAS utilizes the USB 3.0 feature called streams support. 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ciconfig USB_G_SERIAL 2928c2ecf20Sopenharmony_ci tristate "Serial Gadget (with CDC ACM and CDC OBEX support)" 2938c2ecf20Sopenharmony_ci depends on TTY 2948c2ecf20Sopenharmony_ci select USB_U_SERIAL 2958c2ecf20Sopenharmony_ci select USB_F_ACM 2968c2ecf20Sopenharmony_ci select USB_F_SERIAL 2978c2ecf20Sopenharmony_ci select USB_F_OBEX 2988c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 2998c2ecf20Sopenharmony_ci help 3008c2ecf20Sopenharmony_ci The Serial Gadget talks to the Linux-USB generic serial driver. 3018c2ecf20Sopenharmony_ci This driver supports a CDC-ACM module option, which can be used 3028c2ecf20Sopenharmony_ci to interoperate with MS-Windows hosts or with the Linux-USB 3038c2ecf20Sopenharmony_ci "cdc-acm" driver. 3048c2ecf20Sopenharmony_ci 3058c2ecf20Sopenharmony_ci This driver also supports a CDC-OBEX option. You will need a 3068c2ecf20Sopenharmony_ci user space OBEX server talking to /dev/ttyGS*, since the kernel 3078c2ecf20Sopenharmony_ci itself doesn't implement the OBEX protocol. 3088c2ecf20Sopenharmony_ci 3098c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 3108c2ecf20Sopenharmony_ci dynamically linked module called "g_serial". 3118c2ecf20Sopenharmony_ci 3128c2ecf20Sopenharmony_ci For more information, see Documentation/usb/gadget_serial.rst 3138c2ecf20Sopenharmony_ci which includes instructions and a "driver info file" needed to 3148c2ecf20Sopenharmony_ci make MS-Windows work with CDC ACM. 3158c2ecf20Sopenharmony_ci 3168c2ecf20Sopenharmony_ciconfig USB_MIDI_GADGET 3178c2ecf20Sopenharmony_ci tristate "MIDI Gadget" 3188c2ecf20Sopenharmony_ci depends on SND 3198c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 3208c2ecf20Sopenharmony_ci select SND_RAWMIDI 3218c2ecf20Sopenharmony_ci select USB_F_MIDI 3228c2ecf20Sopenharmony_ci help 3238c2ecf20Sopenharmony_ci The MIDI Gadget acts as a USB Audio device, with one MIDI 3248c2ecf20Sopenharmony_ci input and one MIDI output. These MIDI jacks appear as 3258c2ecf20Sopenharmony_ci a sound "card" in the ALSA sound system. Other MIDI 3268c2ecf20Sopenharmony_ci connections can then be made on the gadget system, using 3278c2ecf20Sopenharmony_ci ALSA's aconnect utility etc. 3288c2ecf20Sopenharmony_ci 3298c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 3308c2ecf20Sopenharmony_ci dynamically linked module called "g_midi". 3318c2ecf20Sopenharmony_ci 3328c2ecf20Sopenharmony_ciconfig USB_G_PRINTER 3338c2ecf20Sopenharmony_ci tristate "Printer Gadget" 3348c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 3358c2ecf20Sopenharmony_ci select USB_F_PRINTER 3368c2ecf20Sopenharmony_ci help 3378c2ecf20Sopenharmony_ci The Printer Gadget channels data between the USB host and a 3388c2ecf20Sopenharmony_ci userspace program driving the print engine. The user space 3398c2ecf20Sopenharmony_ci program reads and writes the device file /dev/g_printer to 3408c2ecf20Sopenharmony_ci receive or send printer data. It can use ioctl calls to 3418c2ecf20Sopenharmony_ci the device file to get or set printer status. 3428c2ecf20Sopenharmony_ci 3438c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 3448c2ecf20Sopenharmony_ci dynamically linked module called "g_printer". 3458c2ecf20Sopenharmony_ci 3468c2ecf20Sopenharmony_ci For more information, see Documentation/usb/gadget_printer.rst 3478c2ecf20Sopenharmony_ci which includes sample code for accessing the device file. 3488c2ecf20Sopenharmony_ci 3498c2ecf20Sopenharmony_ciif TTY 3508c2ecf20Sopenharmony_ci 3518c2ecf20Sopenharmony_ciconfig USB_CDC_COMPOSITE 3528c2ecf20Sopenharmony_ci tristate "CDC Composite Device (Ethernet and ACM)" 3538c2ecf20Sopenharmony_ci depends on NET 3548c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 3558c2ecf20Sopenharmony_ci select USB_U_SERIAL 3568c2ecf20Sopenharmony_ci select USB_U_ETHER 3578c2ecf20Sopenharmony_ci select USB_F_ACM 3588c2ecf20Sopenharmony_ci select USB_F_ECM 3598c2ecf20Sopenharmony_ci help 3608c2ecf20Sopenharmony_ci This driver provides two functions in one configuration: 3618c2ecf20Sopenharmony_ci a CDC Ethernet (ECM) link, and a CDC ACM (serial port) link. 3628c2ecf20Sopenharmony_ci 3638c2ecf20Sopenharmony_ci This driver requires four bulk and two interrupt endpoints, 3648c2ecf20Sopenharmony_ci plus the ability to handle altsettings. Not all peripheral 3658c2ecf20Sopenharmony_ci controllers are that capable. 3668c2ecf20Sopenharmony_ci 3678c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 3688c2ecf20Sopenharmony_ci dynamically linked module. 3698c2ecf20Sopenharmony_ci 3708c2ecf20Sopenharmony_ciconfig USB_G_NOKIA 3718c2ecf20Sopenharmony_ci tristate "Nokia composite gadget" 3728c2ecf20Sopenharmony_ci depends on PHONET 3738c2ecf20Sopenharmony_ci depends on BLOCK 3748c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 3758c2ecf20Sopenharmony_ci select USB_U_SERIAL 3768c2ecf20Sopenharmony_ci select USB_U_ETHER 3778c2ecf20Sopenharmony_ci select USB_F_ACM 3788c2ecf20Sopenharmony_ci select USB_F_OBEX 3798c2ecf20Sopenharmony_ci select USB_F_PHONET 3808c2ecf20Sopenharmony_ci select USB_F_ECM 3818c2ecf20Sopenharmony_ci select USB_F_MASS_STORAGE 3828c2ecf20Sopenharmony_ci help 3838c2ecf20Sopenharmony_ci The Nokia composite gadget provides support for acm, obex 3848c2ecf20Sopenharmony_ci and phonet in only one composite gadget driver. 3858c2ecf20Sopenharmony_ci 3868c2ecf20Sopenharmony_ci It's only really useful for N900 hardware. If you're building 3878c2ecf20Sopenharmony_ci a kernel for N900, say Y or M here. If unsure, say N. 3888c2ecf20Sopenharmony_ci 3898c2ecf20Sopenharmony_ciconfig USB_G_ACM_MS 3908c2ecf20Sopenharmony_ci tristate "CDC Composite Device (ACM and mass storage)" 3918c2ecf20Sopenharmony_ci depends on BLOCK 3928c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 3938c2ecf20Sopenharmony_ci select USB_U_SERIAL 3948c2ecf20Sopenharmony_ci select USB_F_ACM 3958c2ecf20Sopenharmony_ci select USB_F_MASS_STORAGE 3968c2ecf20Sopenharmony_ci help 3978c2ecf20Sopenharmony_ci This driver provides two functions in one configuration: 3988c2ecf20Sopenharmony_ci a mass storage, and a CDC ACM (serial port) link. 3998c2ecf20Sopenharmony_ci 4008c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 4018c2ecf20Sopenharmony_ci dynamically linked module called "g_acm_ms". 4028c2ecf20Sopenharmony_ci 4038c2ecf20Sopenharmony_ciconfig USB_G_MULTI 4048c2ecf20Sopenharmony_ci tristate "Multifunction Composite Gadget" 4058c2ecf20Sopenharmony_ci depends on BLOCK && NET 4068c2ecf20Sopenharmony_ci select USB_G_MULTI_CDC if !USB_G_MULTI_RNDIS 4078c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 4088c2ecf20Sopenharmony_ci select USB_U_SERIAL 4098c2ecf20Sopenharmony_ci select USB_U_ETHER 4108c2ecf20Sopenharmony_ci select USB_F_ACM 4118c2ecf20Sopenharmony_ci select USB_F_MASS_STORAGE 4128c2ecf20Sopenharmony_ci help 4138c2ecf20Sopenharmony_ci The Multifunction Composite Gadget provides Ethernet (RNDIS 4148c2ecf20Sopenharmony_ci and/or CDC Ethernet), mass storage and ACM serial link 4158c2ecf20Sopenharmony_ci interfaces. 4168c2ecf20Sopenharmony_ci 4178c2ecf20Sopenharmony_ci You will be asked to choose which of the two configurations is 4188c2ecf20Sopenharmony_ci to be available in the gadget. At least one configuration must 4198c2ecf20Sopenharmony_ci be chosen to make the gadget usable. Selecting more than one 4208c2ecf20Sopenharmony_ci configuration will prevent Windows from automatically detecting 4218c2ecf20Sopenharmony_ci the gadget as a composite gadget, so an INF file will be needed to 4228c2ecf20Sopenharmony_ci use the gadget. 4238c2ecf20Sopenharmony_ci 4248c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 4258c2ecf20Sopenharmony_ci dynamically linked module called "g_multi". 4268c2ecf20Sopenharmony_ci 4278c2ecf20Sopenharmony_ciconfig USB_G_MULTI_RNDIS 4288c2ecf20Sopenharmony_ci bool "RNDIS + CDC Serial + Storage configuration" 4298c2ecf20Sopenharmony_ci depends on USB_G_MULTI 4308c2ecf20Sopenharmony_ci select USB_F_RNDIS 4318c2ecf20Sopenharmony_ci default y 4328c2ecf20Sopenharmony_ci help 4338c2ecf20Sopenharmony_ci This option enables a configuration with RNDIS, CDC Serial and 4348c2ecf20Sopenharmony_ci Mass Storage functions available in the Multifunction Composite 4358c2ecf20Sopenharmony_ci Gadget. This is the configuration dedicated for Windows since RNDIS 4368c2ecf20Sopenharmony_ci is Microsoft's protocol. 4378c2ecf20Sopenharmony_ci 4388c2ecf20Sopenharmony_ci If unsure, say "y". 4398c2ecf20Sopenharmony_ci 4408c2ecf20Sopenharmony_ciconfig USB_G_MULTI_CDC 4418c2ecf20Sopenharmony_ci bool "CDC Ethernet + CDC Serial + Storage configuration" 4428c2ecf20Sopenharmony_ci depends on USB_G_MULTI 4438c2ecf20Sopenharmony_ci select USB_F_ECM 4448c2ecf20Sopenharmony_ci help 4458c2ecf20Sopenharmony_ci This option enables a configuration with CDC Ethernet (ECM), CDC 4468c2ecf20Sopenharmony_ci Serial and Mass Storage functions available in the Multifunction 4478c2ecf20Sopenharmony_ci Composite Gadget. 4488c2ecf20Sopenharmony_ci 4498c2ecf20Sopenharmony_ci If unsure, say "y". 4508c2ecf20Sopenharmony_ci 4518c2ecf20Sopenharmony_ciendif # TTY 4528c2ecf20Sopenharmony_ci 4538c2ecf20Sopenharmony_ciconfig USB_G_HID 4548c2ecf20Sopenharmony_ci tristate "HID Gadget" 4558c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 4568c2ecf20Sopenharmony_ci select USB_F_HID 4578c2ecf20Sopenharmony_ci help 4588c2ecf20Sopenharmony_ci The HID gadget driver provides generic emulation of USB 4598c2ecf20Sopenharmony_ci Human Interface Devices (HID). 4608c2ecf20Sopenharmony_ci 4618c2ecf20Sopenharmony_ci For more information, see Documentation/usb/gadget_hid.rst which 4628c2ecf20Sopenharmony_ci includes sample code for accessing the device files. 4638c2ecf20Sopenharmony_ci 4648c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 4658c2ecf20Sopenharmony_ci dynamically linked module called "g_hid". 4668c2ecf20Sopenharmony_ci 4678c2ecf20Sopenharmony_ci# Standalone / single function gadgets 4688c2ecf20Sopenharmony_ciconfig USB_G_DBGP 4698c2ecf20Sopenharmony_ci tristate "EHCI Debug Device Gadget" 4708c2ecf20Sopenharmony_ci depends on TTY 4718c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 4728c2ecf20Sopenharmony_ci help 4738c2ecf20Sopenharmony_ci This gadget emulates an EHCI Debug device. This is useful when you want 4748c2ecf20Sopenharmony_ci to interact with an EHCI Debug Port. 4758c2ecf20Sopenharmony_ci 4768c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 4778c2ecf20Sopenharmony_ci dynamically linked module called "g_dbgp". 4788c2ecf20Sopenharmony_ci 4798c2ecf20Sopenharmony_ciif USB_G_DBGP 4808c2ecf20Sopenharmony_cichoice 4818c2ecf20Sopenharmony_ci prompt "EHCI Debug Device mode" 4828c2ecf20Sopenharmony_ci default USB_G_DBGP_SERIAL 4838c2ecf20Sopenharmony_ci 4848c2ecf20Sopenharmony_ciconfig USB_G_DBGP_PRINTK 4858c2ecf20Sopenharmony_ci depends on USB_G_DBGP 4868c2ecf20Sopenharmony_ci bool "printk" 4878c2ecf20Sopenharmony_ci help 4888c2ecf20Sopenharmony_ci Directly printk() received data. No interaction. 4898c2ecf20Sopenharmony_ci 4908c2ecf20Sopenharmony_ciconfig USB_G_DBGP_SERIAL 4918c2ecf20Sopenharmony_ci depends on USB_G_DBGP 4928c2ecf20Sopenharmony_ci select USB_U_SERIAL 4938c2ecf20Sopenharmony_ci bool "serial" 4948c2ecf20Sopenharmony_ci help 4958c2ecf20Sopenharmony_ci Userland can interact using /dev/ttyGSxxx. 4968c2ecf20Sopenharmony_ciendchoice 4978c2ecf20Sopenharmony_ciendif 4988c2ecf20Sopenharmony_ci 4998c2ecf20Sopenharmony_ci# put drivers that need isochronous transfer support (for audio 5008c2ecf20Sopenharmony_ci# or video class gadget drivers), or specific hardware, here. 5018c2ecf20Sopenharmony_ciconfig USB_G_WEBCAM 5028c2ecf20Sopenharmony_ci tristate "USB Webcam Gadget" 5038c2ecf20Sopenharmony_ci depends on VIDEO_V4L2 5048c2ecf20Sopenharmony_ci select USB_LIBCOMPOSITE 5058c2ecf20Sopenharmony_ci select VIDEOBUF2_VMALLOC 5068c2ecf20Sopenharmony_ci select USB_F_UVC 5078c2ecf20Sopenharmony_ci help 5088c2ecf20Sopenharmony_ci The Webcam Gadget acts as a composite USB Audio and Video Class 5098c2ecf20Sopenharmony_ci device. It provides a userspace API to process UVC control requests 5108c2ecf20Sopenharmony_ci and stream video data to the host. 5118c2ecf20Sopenharmony_ci 5128c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 5138c2ecf20Sopenharmony_ci dynamically linked module called "g_webcam". 5148c2ecf20Sopenharmony_ci 5158c2ecf20Sopenharmony_ciconfig USB_RAW_GADGET 5168c2ecf20Sopenharmony_ci tristate "USB Raw Gadget" 5178c2ecf20Sopenharmony_ci help 5188c2ecf20Sopenharmony_ci USB Raw Gadget is a kernel module that provides a userspace interface 5198c2ecf20Sopenharmony_ci for the USB Gadget subsystem. Essentially it allows to emulate USB 5208c2ecf20Sopenharmony_ci devices from userspace. See Documentation/usb/raw-gadget.rst for 5218c2ecf20Sopenharmony_ci details. 5228c2ecf20Sopenharmony_ci 5238c2ecf20Sopenharmony_ci Say "y" to link the driver statically, or "m" to build a 5248c2ecf20Sopenharmony_ci dynamically linked module called "raw_gadget". 5258c2ecf20Sopenharmony_ci 5268c2ecf20Sopenharmony_ciendmenu 527