Kconfig 17 KB

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