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