1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0 2*4882a593Smuzhiyun# 3*4882a593Smuzhiyun# USB Gadget support on a system involves 4*4882a593Smuzhiyun# (a) a peripheral controller, and 5*4882a593Smuzhiyun# (b) the gadget driver using it. 6*4882a593Smuzhiyun# 7*4882a593Smuzhiyun# NOTE: Gadget support ** DOES NOT ** depend on host-side CONFIG_USB !! 8*4882a593Smuzhiyun# 9*4882a593Smuzhiyun# - Host systems (like PCs) need CONFIG_USB (with "A" jacks). 10*4882a593Smuzhiyun# - Peripherals (like PDAs) need CONFIG_USB_GADGET (with "B" jacks). 11*4882a593Smuzhiyun# - Some systems have both kinds of controllers. 12*4882a593Smuzhiyun# 13*4882a593Smuzhiyun# With help from a special transceiver and a "Mini-AB" jack, systems with 14*4882a593Smuzhiyun# both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG). 15*4882a593Smuzhiyun# 16*4882a593Smuzhiyun# A Linux "Gadget Driver" talks to the USB Peripheral Controller 17*4882a593Smuzhiyun# driver through the abstract "gadget" API. Some other operating 18*4882a593Smuzhiyun# systems call these "client" drivers, of which "class drivers" 19*4882a593Smuzhiyun# are a subset (implementing a USB device class specification). 20*4882a593Smuzhiyun# A gadget driver implements one or more USB functions using 21*4882a593Smuzhiyun# the peripheral hardware. 22*4882a593Smuzhiyun# 23*4882a593Smuzhiyun# Gadget drivers are hardware-neutral, or "platform independent", 24*4882a593Smuzhiyun# except that they sometimes must understand quirks or limitations 25*4882a593Smuzhiyun# of the particular controllers they work with. For example, when 26*4882a593Smuzhiyun# a controller doesn't support alternate configurations or provide 27*4882a593Smuzhiyun# enough of the right types of endpoints, the gadget driver might 28*4882a593Smuzhiyun# not be able work with that controller, or might need to implement 29*4882a593Smuzhiyun# a less common variant of a device class protocol. 30*4882a593Smuzhiyun# 31*4882a593Smuzhiyun# The available choices each represent a single precomposed USB 32*4882a593Smuzhiyun# gadget configuration. In the device model, each option contains 33*4882a593Smuzhiyun# both the device instantiation as a child for a USB gadget 34*4882a593Smuzhiyun# controller, and the relevant drivers for each function declared 35*4882a593Smuzhiyun# by the device. 36*4882a593Smuzhiyun 37*4882a593Smuzhiyunmenu "USB Gadget precomposed configurations" 38*4882a593Smuzhiyun 39*4882a593Smuzhiyunconfig USB_ZERO 40*4882a593Smuzhiyun tristate "Gadget Zero (DEVELOPMENT)" 41*4882a593Smuzhiyun select USB_LIBCOMPOSITE 42*4882a593Smuzhiyun select USB_F_SS_LB 43*4882a593Smuzhiyun help 44*4882a593Smuzhiyun Gadget Zero is a two-configuration device. It either sinks and 45*4882a593Smuzhiyun sources bulk data; or it loops back a configurable number of 46*4882a593Smuzhiyun transfers. It also implements control requests, for "chapter 9" 47*4882a593Smuzhiyun conformance. The driver needs only two bulk-capable endpoints, so 48*4882a593Smuzhiyun it can work on top of most device-side usb controllers. It's 49*4882a593Smuzhiyun useful for testing, and is also a working example showing how 50*4882a593Smuzhiyun USB "gadget drivers" can be written. 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun Make this be the first driver you try using on top of any new 53*4882a593Smuzhiyun USB peripheral controller driver. Then you can use host-side 54*4882a593Smuzhiyun test software, like the "usbtest" driver, to put your hardware 55*4882a593Smuzhiyun and its driver through a basic set of functional tests. 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun Gadget Zero also works with the host-side "usb-skeleton" driver, 58*4882a593Smuzhiyun and with many kinds of host-side test software. You may need 59*4882a593Smuzhiyun to tweak product and vendor IDs before host software knows about 60*4882a593Smuzhiyun this device, and arrange to select an appropriate configuration. 61*4882a593Smuzhiyun 62*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 63*4882a593Smuzhiyun dynamically linked module called "g_zero". 64*4882a593Smuzhiyun 65*4882a593Smuzhiyunconfig USB_ZERO_HNPTEST 66*4882a593Smuzhiyun bool "HNP Test Device" 67*4882a593Smuzhiyun depends on USB_ZERO && USB_OTG 68*4882a593Smuzhiyun help 69*4882a593Smuzhiyun You can configure this device to enumerate using the device 70*4882a593Smuzhiyun identifiers of the USB-OTG test device. That means that when 71*4882a593Smuzhiyun this gadget connects to another OTG device, with this one using 72*4882a593Smuzhiyun the "B-Peripheral" role, that device will use HNP to let this 73*4882a593Smuzhiyun one serve as the USB host instead (in the "B-Host" role). 74*4882a593Smuzhiyun 75*4882a593Smuzhiyunconfig USB_AUDIO 76*4882a593Smuzhiyun tristate "Audio Gadget" 77*4882a593Smuzhiyun depends on SND 78*4882a593Smuzhiyun select USB_LIBCOMPOSITE 79*4882a593Smuzhiyun select SND_PCM 80*4882a593Smuzhiyun select USB_F_UAC1 if (GADGET_UAC1 && !GADGET_UAC1_LEGACY) 81*4882a593Smuzhiyun select USB_F_UAC1_LEGACY if (GADGET_UAC1 && GADGET_UAC1_LEGACY) 82*4882a593Smuzhiyun select USB_F_UAC2 if !GADGET_UAC1 83*4882a593Smuzhiyun select USB_U_AUDIO if (USB_F_UAC2 || USB_F_UAC1) 84*4882a593Smuzhiyun help 85*4882a593Smuzhiyun This Gadget Audio driver is compatible with USB Audio Class 86*4882a593Smuzhiyun specification 2.0. It implements 1 AudioControl interface, 87*4882a593Smuzhiyun 1 AudioStreaming Interface each for USB-OUT and USB-IN. 88*4882a593Smuzhiyun Number of channels, sample rate and sample size can be 89*4882a593Smuzhiyun specified as module parameters. 90*4882a593Smuzhiyun This driver doesn't expect any real Audio codec to be present 91*4882a593Smuzhiyun on the device - the audio streams are simply sinked to and 92*4882a593Smuzhiyun sourced from a virtual ALSA sound card created. The user-space 93*4882a593Smuzhiyun application may choose to do whatever it wants with the data 94*4882a593Smuzhiyun received from the USB Host and choose to provide whatever it 95*4882a593Smuzhiyun wants as audio data to the USB Host. 96*4882a593Smuzhiyun 97*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 98*4882a593Smuzhiyun dynamically linked module called "g_audio". 99*4882a593Smuzhiyun 100*4882a593Smuzhiyunconfig GADGET_UAC1 101*4882a593Smuzhiyun bool "UAC 1.0" 102*4882a593Smuzhiyun depends on USB_AUDIO 103*4882a593Smuzhiyun help 104*4882a593Smuzhiyun If you instead want older USB Audio Class specification 1.0 support 105*4882a593Smuzhiyun with similar driver capabilities. 106*4882a593Smuzhiyun 107*4882a593Smuzhiyunconfig GADGET_UAC1_LEGACY 108*4882a593Smuzhiyun bool "UAC 1.0 (Legacy)" 109*4882a593Smuzhiyun depends on GADGET_UAC1 110*4882a593Smuzhiyun help 111*4882a593Smuzhiyun If you instead want legacy UAC Spec-1.0 driver that also has audio 112*4882a593Smuzhiyun paths hardwired to the Audio codec chip on-board and doesn't work 113*4882a593Smuzhiyun without one. 114*4882a593Smuzhiyun 115*4882a593Smuzhiyunconfig USB_ETH 116*4882a593Smuzhiyun tristate "Ethernet Gadget (with CDC Ethernet support)" 117*4882a593Smuzhiyun depends on NET 118*4882a593Smuzhiyun select USB_LIBCOMPOSITE 119*4882a593Smuzhiyun select USB_U_ETHER 120*4882a593Smuzhiyun select USB_F_ECM 121*4882a593Smuzhiyun select USB_F_SUBSET 122*4882a593Smuzhiyun select CRC32 123*4882a593Smuzhiyun help 124*4882a593Smuzhiyun This driver implements Ethernet style communication, in one of 125*4882a593Smuzhiyun several ways: 126*4882a593Smuzhiyun 127*4882a593Smuzhiyun - The "Communication Device Class" (CDC) Ethernet Control Model. 128*4882a593Smuzhiyun That protocol is often avoided with pure Ethernet adapters, in 129*4882a593Smuzhiyun favor of simpler vendor-specific hardware, but is widely 130*4882a593Smuzhiyun supported by firmware for smart network devices. 131*4882a593Smuzhiyun 132*4882a593Smuzhiyun - On hardware can't implement that protocol, a simple CDC subset 133*4882a593Smuzhiyun is used, placing fewer demands on USB. 134*4882a593Smuzhiyun 135*4882a593Smuzhiyun - CDC Ethernet Emulation Model (EEM) is a newer standard that has 136*4882a593Smuzhiyun a simpler interface that can be used by more USB hardware. 137*4882a593Smuzhiyun 138*4882a593Smuzhiyun RNDIS support is an additional option, more demanding than subset. 139*4882a593Smuzhiyun 140*4882a593Smuzhiyun Within the USB device, this gadget driver exposes a network device 141*4882a593Smuzhiyun "usbX", where X depends on what other networking devices you have. 142*4882a593Smuzhiyun Treat it like a two-node Ethernet link: host, and gadget. 143*4882a593Smuzhiyun 144*4882a593Smuzhiyun The Linux-USB host-side "usbnet" driver interoperates with this 145*4882a593Smuzhiyun driver, so that deep I/O queues can be supported. On 2.4 kernels, 146*4882a593Smuzhiyun use "CDCEther" instead, if you're using the CDC option. That CDC 147*4882a593Smuzhiyun mode should also interoperate with standard CDC Ethernet class 148*4882a593Smuzhiyun drivers on other host operating systems. 149*4882a593Smuzhiyun 150*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 151*4882a593Smuzhiyun dynamically linked module called "g_ether". 152*4882a593Smuzhiyun 153*4882a593Smuzhiyunconfig USB_ETH_RNDIS 154*4882a593Smuzhiyun bool "RNDIS support" 155*4882a593Smuzhiyun depends on USB_ETH 156*4882a593Smuzhiyun select USB_LIBCOMPOSITE 157*4882a593Smuzhiyun select USB_F_RNDIS 158*4882a593Smuzhiyun default y 159*4882a593Smuzhiyun help 160*4882a593Smuzhiyun Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol, 161*4882a593Smuzhiyun and Microsoft provides redistributable binary RNDIS drivers for 162*4882a593Smuzhiyun older versions of Windows. 163*4882a593Smuzhiyun 164*4882a593Smuzhiyun If you say "y" here, the Ethernet gadget driver will try to provide 165*4882a593Smuzhiyun a second device configuration, supporting RNDIS to talk to such 166*4882a593Smuzhiyun Microsoft USB hosts. 167*4882a593Smuzhiyun 168*4882a593Smuzhiyun To make MS-Windows work with this, use Documentation/usb/linux.inf 169*4882a593Smuzhiyun as the "driver info file". For versions of MS-Windows older than 170*4882a593Smuzhiyun XP, you'll need to download drivers from Microsoft's website; a URL 171*4882a593Smuzhiyun is given in comments found in that info file. 172*4882a593Smuzhiyun 173*4882a593Smuzhiyunconfig USB_ETH_EEM 174*4882a593Smuzhiyun bool "Ethernet Emulation Model (EEM) support" 175*4882a593Smuzhiyun depends on USB_ETH 176*4882a593Smuzhiyun select USB_LIBCOMPOSITE 177*4882a593Smuzhiyun select USB_F_EEM 178*4882a593Smuzhiyun help 179*4882a593Smuzhiyun CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM 180*4882a593Smuzhiyun and therefore can be supported by more hardware. Technically ECM and 181*4882a593Smuzhiyun EEM are designed for different applications. The ECM model extends 182*4882a593Smuzhiyun the network interface to the target (e.g. a USB cable modem), and the 183*4882a593Smuzhiyun EEM model is for mobile devices to communicate with hosts using 184*4882a593Smuzhiyun ethernet over USB. For Linux gadgets, however, the interface with 185*4882a593Smuzhiyun the host is the same (a usbX device), so the differences are minimal. 186*4882a593Smuzhiyun 187*4882a593Smuzhiyun If you say "y" here, the Ethernet gadget driver will use the EEM 188*4882a593Smuzhiyun protocol rather than ECM. If unsure, say "n". 189*4882a593Smuzhiyun 190*4882a593Smuzhiyunconfig USB_G_NCM 191*4882a593Smuzhiyun tristate "Network Control Model (NCM) support" 192*4882a593Smuzhiyun depends on NET 193*4882a593Smuzhiyun select USB_LIBCOMPOSITE 194*4882a593Smuzhiyun select USB_U_ETHER 195*4882a593Smuzhiyun select USB_F_NCM 196*4882a593Smuzhiyun select CRC32 197*4882a593Smuzhiyun help 198*4882a593Smuzhiyun This driver implements USB CDC NCM subclass standard. NCM is 199*4882a593Smuzhiyun an advanced protocol for Ethernet encapsulation, allows grouping 200*4882a593Smuzhiyun of several ethernet frames into one USB transfer and different 201*4882a593Smuzhiyun alignment possibilities. 202*4882a593Smuzhiyun 203*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 204*4882a593Smuzhiyun dynamically linked module called "g_ncm". 205*4882a593Smuzhiyun 206*4882a593Smuzhiyunconfig USB_GADGETFS 207*4882a593Smuzhiyun tristate "Gadget Filesystem" 208*4882a593Smuzhiyun help 209*4882a593Smuzhiyun This driver provides a filesystem based API that lets user mode 210*4882a593Smuzhiyun programs implement a single-configuration USB device, including 211*4882a593Smuzhiyun endpoint I/O and control requests that don't relate to enumeration. 212*4882a593Smuzhiyun All endpoints, transfer speeds, and transfer types supported by 213*4882a593Smuzhiyun the hardware are available, through read() and write() calls. 214*4882a593Smuzhiyun 215*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 216*4882a593Smuzhiyun dynamically linked module called "gadgetfs". 217*4882a593Smuzhiyun 218*4882a593Smuzhiyunconfig USB_FUNCTIONFS 219*4882a593Smuzhiyun tristate "Function Filesystem" 220*4882a593Smuzhiyun select USB_LIBCOMPOSITE 221*4882a593Smuzhiyun select USB_F_FS 222*4882a593Smuzhiyun select USB_FUNCTIONFS_GENERIC if !(USB_FUNCTIONFS_ETH || USB_FUNCTIONFS_RNDIS) 223*4882a593Smuzhiyun help 224*4882a593Smuzhiyun The Function Filesystem (FunctionFS) lets one create USB 225*4882a593Smuzhiyun composite functions in user space in the same way GadgetFS 226*4882a593Smuzhiyun lets one create USB gadgets in user space. This allows creation 227*4882a593Smuzhiyun of composite gadgets such that some of the functions are 228*4882a593Smuzhiyun implemented in kernel space (for instance Ethernet, serial or 229*4882a593Smuzhiyun mass storage) and other are implemented in user space. 230*4882a593Smuzhiyun 231*4882a593Smuzhiyun If you say "y" or "m" here you will be able what kind of 232*4882a593Smuzhiyun configurations the gadget will provide. 233*4882a593Smuzhiyun 234*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build 235*4882a593Smuzhiyun a dynamically linked module called "g_ffs". 236*4882a593Smuzhiyun 237*4882a593Smuzhiyunconfig USB_FUNCTIONFS_ETH 238*4882a593Smuzhiyun bool "Include configuration with CDC ECM (Ethernet)" 239*4882a593Smuzhiyun depends on USB_FUNCTIONFS && NET 240*4882a593Smuzhiyun select USB_U_ETHER 241*4882a593Smuzhiyun select USB_F_ECM 242*4882a593Smuzhiyun select USB_F_SUBSET 243*4882a593Smuzhiyun help 244*4882a593Smuzhiyun Include a configuration with CDC ECM function (Ethernet) and the 245*4882a593Smuzhiyun Function Filesystem. 246*4882a593Smuzhiyun 247*4882a593Smuzhiyunconfig USB_FUNCTIONFS_RNDIS 248*4882a593Smuzhiyun bool "Include configuration with RNDIS (Ethernet)" 249*4882a593Smuzhiyun depends on USB_FUNCTIONFS && NET 250*4882a593Smuzhiyun select USB_U_ETHER 251*4882a593Smuzhiyun select USB_F_RNDIS 252*4882a593Smuzhiyun help 253*4882a593Smuzhiyun Include a configuration with RNDIS function (Ethernet) and the Filesystem. 254*4882a593Smuzhiyun 255*4882a593Smuzhiyunconfig USB_FUNCTIONFS_GENERIC 256*4882a593Smuzhiyun bool "Include 'pure' configuration" 257*4882a593Smuzhiyun depends on USB_FUNCTIONFS 258*4882a593Smuzhiyun help 259*4882a593Smuzhiyun Include a configuration with the Function Filesystem alone with 260*4882a593Smuzhiyun no Ethernet interface. 261*4882a593Smuzhiyun 262*4882a593Smuzhiyunconfig USB_MASS_STORAGE 263*4882a593Smuzhiyun tristate "Mass Storage Gadget" 264*4882a593Smuzhiyun depends on BLOCK 265*4882a593Smuzhiyun select USB_LIBCOMPOSITE 266*4882a593Smuzhiyun select USB_F_MASS_STORAGE 267*4882a593Smuzhiyun help 268*4882a593Smuzhiyun The Mass Storage Gadget acts as a USB Mass Storage disk drive. 269*4882a593Smuzhiyun As its storage repository it can use a regular file or a block 270*4882a593Smuzhiyun device (in much the same way as the "loop" device driver), 271*4882a593Smuzhiyun specified as a module parameter or sysfs option. 272*4882a593Smuzhiyun 273*4882a593Smuzhiyun This driver is a replacement for now removed File-backed 274*4882a593Smuzhiyun Storage Gadget (g_file_storage). 275*4882a593Smuzhiyun 276*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build 277*4882a593Smuzhiyun a dynamically linked module called "g_mass_storage". 278*4882a593Smuzhiyun 279*4882a593Smuzhiyunconfig USB_GADGET_TARGET 280*4882a593Smuzhiyun tristate "USB Gadget Target Fabric Module" 281*4882a593Smuzhiyun depends on TARGET_CORE 282*4882a593Smuzhiyun select USB_LIBCOMPOSITE 283*4882a593Smuzhiyun select USB_F_TCM 284*4882a593Smuzhiyun help 285*4882a593Smuzhiyun This fabric is an USB gadget. Two USB protocols are supported that is 286*4882a593Smuzhiyun BBB or BOT (Bulk Only Transport) and UAS (USB Attached SCSI). BOT is 287*4882a593Smuzhiyun advertised on alternative interface 0 (primary) and UAS is on 288*4882a593Smuzhiyun alternative interface 1. Both protocols can work on USB2.0 and USB3.0. 289*4882a593Smuzhiyun UAS utilizes the USB 3.0 feature called streams support. 290*4882a593Smuzhiyun 291*4882a593Smuzhiyunconfig USB_G_SERIAL 292*4882a593Smuzhiyun tristate "Serial Gadget (with CDC ACM and CDC OBEX support)" 293*4882a593Smuzhiyun depends on TTY 294*4882a593Smuzhiyun select USB_U_SERIAL 295*4882a593Smuzhiyun select USB_F_ACM 296*4882a593Smuzhiyun select USB_F_SERIAL 297*4882a593Smuzhiyun select USB_F_OBEX 298*4882a593Smuzhiyun select USB_LIBCOMPOSITE 299*4882a593Smuzhiyun help 300*4882a593Smuzhiyun The Serial Gadget talks to the Linux-USB generic serial driver. 301*4882a593Smuzhiyun This driver supports a CDC-ACM module option, which can be used 302*4882a593Smuzhiyun to interoperate with MS-Windows hosts or with the Linux-USB 303*4882a593Smuzhiyun "cdc-acm" driver. 304*4882a593Smuzhiyun 305*4882a593Smuzhiyun This driver also supports a CDC-OBEX option. You will need a 306*4882a593Smuzhiyun user space OBEX server talking to /dev/ttyGS*, since the kernel 307*4882a593Smuzhiyun itself doesn't implement the OBEX protocol. 308*4882a593Smuzhiyun 309*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 310*4882a593Smuzhiyun dynamically linked module called "g_serial". 311*4882a593Smuzhiyun 312*4882a593Smuzhiyun For more information, see Documentation/usb/gadget_serial.rst 313*4882a593Smuzhiyun which includes instructions and a "driver info file" needed to 314*4882a593Smuzhiyun make MS-Windows work with CDC ACM. 315*4882a593Smuzhiyun 316*4882a593Smuzhiyunconfig USB_MIDI_GADGET 317*4882a593Smuzhiyun tristate "MIDI Gadget" 318*4882a593Smuzhiyun depends on SND 319*4882a593Smuzhiyun select USB_LIBCOMPOSITE 320*4882a593Smuzhiyun select SND_RAWMIDI 321*4882a593Smuzhiyun select USB_F_MIDI 322*4882a593Smuzhiyun help 323*4882a593Smuzhiyun The MIDI Gadget acts as a USB Audio device, with one MIDI 324*4882a593Smuzhiyun input and one MIDI output. These MIDI jacks appear as 325*4882a593Smuzhiyun a sound "card" in the ALSA sound system. Other MIDI 326*4882a593Smuzhiyun connections can then be made on the gadget system, using 327*4882a593Smuzhiyun ALSA's aconnect utility etc. 328*4882a593Smuzhiyun 329*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 330*4882a593Smuzhiyun dynamically linked module called "g_midi". 331*4882a593Smuzhiyun 332*4882a593Smuzhiyunconfig USB_G_PRINTER 333*4882a593Smuzhiyun tristate "Printer Gadget" 334*4882a593Smuzhiyun select USB_LIBCOMPOSITE 335*4882a593Smuzhiyun select USB_F_PRINTER 336*4882a593Smuzhiyun help 337*4882a593Smuzhiyun The Printer Gadget channels data between the USB host and a 338*4882a593Smuzhiyun userspace program driving the print engine. The user space 339*4882a593Smuzhiyun program reads and writes the device file /dev/g_printer to 340*4882a593Smuzhiyun receive or send printer data. It can use ioctl calls to 341*4882a593Smuzhiyun the device file to get or set printer status. 342*4882a593Smuzhiyun 343*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 344*4882a593Smuzhiyun dynamically linked module called "g_printer". 345*4882a593Smuzhiyun 346*4882a593Smuzhiyun For more information, see Documentation/usb/gadget_printer.rst 347*4882a593Smuzhiyun which includes sample code for accessing the device file. 348*4882a593Smuzhiyun 349*4882a593Smuzhiyunif TTY 350*4882a593Smuzhiyun 351*4882a593Smuzhiyunconfig USB_CDC_COMPOSITE 352*4882a593Smuzhiyun tristate "CDC Composite Device (Ethernet and ACM)" 353*4882a593Smuzhiyun depends on NET 354*4882a593Smuzhiyun select USB_LIBCOMPOSITE 355*4882a593Smuzhiyun select USB_U_SERIAL 356*4882a593Smuzhiyun select USB_U_ETHER 357*4882a593Smuzhiyun select USB_F_ACM 358*4882a593Smuzhiyun select USB_F_ECM 359*4882a593Smuzhiyun help 360*4882a593Smuzhiyun This driver provides two functions in one configuration: 361*4882a593Smuzhiyun a CDC Ethernet (ECM) link, and a CDC ACM (serial port) link. 362*4882a593Smuzhiyun 363*4882a593Smuzhiyun This driver requires four bulk and two interrupt endpoints, 364*4882a593Smuzhiyun plus the ability to handle altsettings. Not all peripheral 365*4882a593Smuzhiyun controllers are that capable. 366*4882a593Smuzhiyun 367*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 368*4882a593Smuzhiyun dynamically linked module. 369*4882a593Smuzhiyun 370*4882a593Smuzhiyunconfig USB_G_NOKIA 371*4882a593Smuzhiyun tristate "Nokia composite gadget" 372*4882a593Smuzhiyun depends on PHONET 373*4882a593Smuzhiyun depends on BLOCK 374*4882a593Smuzhiyun select USB_LIBCOMPOSITE 375*4882a593Smuzhiyun select USB_U_SERIAL 376*4882a593Smuzhiyun select USB_U_ETHER 377*4882a593Smuzhiyun select USB_F_ACM 378*4882a593Smuzhiyun select USB_F_OBEX 379*4882a593Smuzhiyun select USB_F_PHONET 380*4882a593Smuzhiyun select USB_F_ECM 381*4882a593Smuzhiyun select USB_F_MASS_STORAGE 382*4882a593Smuzhiyun help 383*4882a593Smuzhiyun The Nokia composite gadget provides support for acm, obex 384*4882a593Smuzhiyun and phonet in only one composite gadget driver. 385*4882a593Smuzhiyun 386*4882a593Smuzhiyun It's only really useful for N900 hardware. If you're building 387*4882a593Smuzhiyun a kernel for N900, say Y or M here. If unsure, say N. 388*4882a593Smuzhiyun 389*4882a593Smuzhiyunconfig USB_G_ACM_MS 390*4882a593Smuzhiyun tristate "CDC Composite Device (ACM and mass storage)" 391*4882a593Smuzhiyun depends on BLOCK 392*4882a593Smuzhiyun select USB_LIBCOMPOSITE 393*4882a593Smuzhiyun select USB_U_SERIAL 394*4882a593Smuzhiyun select USB_F_ACM 395*4882a593Smuzhiyun select USB_F_MASS_STORAGE 396*4882a593Smuzhiyun help 397*4882a593Smuzhiyun This driver provides two functions in one configuration: 398*4882a593Smuzhiyun a mass storage, and a CDC ACM (serial port) link. 399*4882a593Smuzhiyun 400*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 401*4882a593Smuzhiyun dynamically linked module called "g_acm_ms". 402*4882a593Smuzhiyun 403*4882a593Smuzhiyunconfig USB_G_MULTI 404*4882a593Smuzhiyun tristate "Multifunction Composite Gadget" 405*4882a593Smuzhiyun depends on BLOCK && NET 406*4882a593Smuzhiyun select USB_G_MULTI_CDC if !USB_G_MULTI_RNDIS 407*4882a593Smuzhiyun select USB_LIBCOMPOSITE 408*4882a593Smuzhiyun select USB_U_SERIAL 409*4882a593Smuzhiyun select USB_U_ETHER 410*4882a593Smuzhiyun select USB_F_ACM 411*4882a593Smuzhiyun select USB_F_MASS_STORAGE 412*4882a593Smuzhiyun help 413*4882a593Smuzhiyun The Multifunction Composite Gadget provides Ethernet (RNDIS 414*4882a593Smuzhiyun and/or CDC Ethernet), mass storage and ACM serial link 415*4882a593Smuzhiyun interfaces. 416*4882a593Smuzhiyun 417*4882a593Smuzhiyun You will be asked to choose which of the two configurations is 418*4882a593Smuzhiyun to be available in the gadget. At least one configuration must 419*4882a593Smuzhiyun be chosen to make the gadget usable. Selecting more than one 420*4882a593Smuzhiyun configuration will prevent Windows from automatically detecting 421*4882a593Smuzhiyun the gadget as a composite gadget, so an INF file will be needed to 422*4882a593Smuzhiyun use the gadget. 423*4882a593Smuzhiyun 424*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 425*4882a593Smuzhiyun dynamically linked module called "g_multi". 426*4882a593Smuzhiyun 427*4882a593Smuzhiyunconfig USB_G_MULTI_RNDIS 428*4882a593Smuzhiyun bool "RNDIS + CDC Serial + Storage configuration" 429*4882a593Smuzhiyun depends on USB_G_MULTI 430*4882a593Smuzhiyun select USB_F_RNDIS 431*4882a593Smuzhiyun default y 432*4882a593Smuzhiyun help 433*4882a593Smuzhiyun This option enables a configuration with RNDIS, CDC Serial and 434*4882a593Smuzhiyun Mass Storage functions available in the Multifunction Composite 435*4882a593Smuzhiyun Gadget. This is the configuration dedicated for Windows since RNDIS 436*4882a593Smuzhiyun is Microsoft's protocol. 437*4882a593Smuzhiyun 438*4882a593Smuzhiyun If unsure, say "y". 439*4882a593Smuzhiyun 440*4882a593Smuzhiyunconfig USB_G_MULTI_CDC 441*4882a593Smuzhiyun bool "CDC Ethernet + CDC Serial + Storage configuration" 442*4882a593Smuzhiyun depends on USB_G_MULTI 443*4882a593Smuzhiyun select USB_F_ECM 444*4882a593Smuzhiyun help 445*4882a593Smuzhiyun This option enables a configuration with CDC Ethernet (ECM), CDC 446*4882a593Smuzhiyun Serial and Mass Storage functions available in the Multifunction 447*4882a593Smuzhiyun Composite Gadget. 448*4882a593Smuzhiyun 449*4882a593Smuzhiyun If unsure, say "y". 450*4882a593Smuzhiyun 451*4882a593Smuzhiyunendif # TTY 452*4882a593Smuzhiyun 453*4882a593Smuzhiyunconfig USB_G_HID 454*4882a593Smuzhiyun tristate "HID Gadget" 455*4882a593Smuzhiyun select USB_LIBCOMPOSITE 456*4882a593Smuzhiyun select USB_F_HID 457*4882a593Smuzhiyun help 458*4882a593Smuzhiyun The HID gadget driver provides generic emulation of USB 459*4882a593Smuzhiyun Human Interface Devices (HID). 460*4882a593Smuzhiyun 461*4882a593Smuzhiyun For more information, see Documentation/usb/gadget_hid.rst which 462*4882a593Smuzhiyun includes sample code for accessing the device files. 463*4882a593Smuzhiyun 464*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 465*4882a593Smuzhiyun dynamically linked module called "g_hid". 466*4882a593Smuzhiyun 467*4882a593Smuzhiyun# Standalone / single function gadgets 468*4882a593Smuzhiyunconfig USB_G_DBGP 469*4882a593Smuzhiyun tristate "EHCI Debug Device Gadget" 470*4882a593Smuzhiyun depends on TTY 471*4882a593Smuzhiyun select USB_LIBCOMPOSITE 472*4882a593Smuzhiyun help 473*4882a593Smuzhiyun This gadget emulates an EHCI Debug device. This is useful when you want 474*4882a593Smuzhiyun to interact with an EHCI Debug Port. 475*4882a593Smuzhiyun 476*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 477*4882a593Smuzhiyun dynamically linked module called "g_dbgp". 478*4882a593Smuzhiyun 479*4882a593Smuzhiyunif USB_G_DBGP 480*4882a593Smuzhiyunchoice 481*4882a593Smuzhiyun prompt "EHCI Debug Device mode" 482*4882a593Smuzhiyun default USB_G_DBGP_SERIAL 483*4882a593Smuzhiyun 484*4882a593Smuzhiyunconfig USB_G_DBGP_PRINTK 485*4882a593Smuzhiyun depends on USB_G_DBGP 486*4882a593Smuzhiyun bool "printk" 487*4882a593Smuzhiyun help 488*4882a593Smuzhiyun Directly printk() received data. No interaction. 489*4882a593Smuzhiyun 490*4882a593Smuzhiyunconfig USB_G_DBGP_SERIAL 491*4882a593Smuzhiyun depends on USB_G_DBGP 492*4882a593Smuzhiyun select USB_U_SERIAL 493*4882a593Smuzhiyun bool "serial" 494*4882a593Smuzhiyun help 495*4882a593Smuzhiyun Userland can interact using /dev/ttyGSxxx. 496*4882a593Smuzhiyunendchoice 497*4882a593Smuzhiyunendif 498*4882a593Smuzhiyun 499*4882a593Smuzhiyun# put drivers that need isochronous transfer support (for audio 500*4882a593Smuzhiyun# or video class gadget drivers), or specific hardware, here. 501*4882a593Smuzhiyunconfig USB_G_WEBCAM 502*4882a593Smuzhiyun tristate "USB Webcam Gadget" 503*4882a593Smuzhiyun depends on VIDEO_V4L2 504*4882a593Smuzhiyun select USB_LIBCOMPOSITE 505*4882a593Smuzhiyun select VIDEOBUF2_VMALLOC 506*4882a593Smuzhiyun select USB_F_UVC 507*4882a593Smuzhiyun help 508*4882a593Smuzhiyun The Webcam Gadget acts as a composite USB Audio and Video Class 509*4882a593Smuzhiyun device. It provides a userspace API to process UVC control requests 510*4882a593Smuzhiyun and stream video data to the host. 511*4882a593Smuzhiyun 512*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 513*4882a593Smuzhiyun dynamically linked module called "g_webcam". 514*4882a593Smuzhiyun 515*4882a593Smuzhiyunconfig USB_RAW_GADGET 516*4882a593Smuzhiyun tristate "USB Raw Gadget" 517*4882a593Smuzhiyun help 518*4882a593Smuzhiyun USB Raw Gadget is a kernel module that provides a userspace interface 519*4882a593Smuzhiyun for the USB Gadget subsystem. Essentially it allows to emulate USB 520*4882a593Smuzhiyun devices from userspace. See Documentation/usb/raw-gadget.rst for 521*4882a593Smuzhiyun details. 522*4882a593Smuzhiyun 523*4882a593Smuzhiyun Say "y" to link the driver statically, or "m" to build a 524*4882a593Smuzhiyun dynamically linked module called "raw_gadget". 525*4882a593Smuzhiyun 526*4882a593Smuzhiyunendmenu 527