Kconfig 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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. menuconfig USB_GADGET
  16. tristate "USB Gadget Support"
  17. select NLS
  18. help
  19. USB is a master/slave protocol, organized with one master
  20. host (such as a PC) controlling up to 127 peripheral devices.
  21. The USB hardware is asymmetric, which makes it easier to set up:
  22. you can't connect a "to-the-host" connector to a peripheral.
  23. Linux can run in the host, or in the peripheral. In both cases
  24. you need a low level bus controller driver, and some software
  25. talking to it. Peripheral controllers are often discrete silicon,
  26. or are integrated with the CPU in a microcontroller. The more
  27. familiar host side controllers have names like "EHCI", "OHCI",
  28. or "UHCI", and are usually integrated into southbridges on PC
  29. motherboards.
  30. Enable this configuration option if you want to run Linux inside
  31. a USB peripheral device. Configure one hardware driver for your
  32. peripheral/device side bus controller, and a "gadget driver" for
  33. your peripheral protocol. (If you use modular gadget drivers,
  34. you may configure more than one.)
  35. If in doubt, say "N" and don't enable these drivers; most people
  36. don't have this kind of hardware (except maybe inside Linux PDAs).
  37. For more information, see <http://www.linux-usb.org/gadget> and
  38. the kernel DocBook documentation for this API.
  39. if USB_GADGET
  40. config USB_GADGET_DEBUG
  41. bool "Debugging messages (DEVELOPMENT)"
  42. depends on DEBUG_KERNEL
  43. help
  44. Many controller and gadget drivers will print some debugging
  45. messages if you use this option to ask for those messages.
  46. Avoid enabling these messages, even if you're actively
  47. debugging such a driver. Many drivers will emit so many
  48. messages that the driver timings are affected, which will
  49. either create new failure modes or remove the one you're
  50. trying to track down. Never enable these messages for a
  51. production build.
  52. config USB_GADGET_VERBOSE
  53. bool "Verbose debugging Messages (DEVELOPMENT)"
  54. depends on USB_GADGET_DEBUG
  55. help
  56. Many controller and gadget drivers will print verbose debugging
  57. messages if you use this option to ask for those messages.
  58. Avoid enabling these messages, even if you're actively
  59. debugging such a driver. Many drivers will emit so many
  60. messages that the driver timings are affected, which will
  61. either create new failure modes or remove the one you're
  62. trying to track down. Never enable these messages for a
  63. production build.
  64. config USB_GADGET_DEBUG_FILES
  65. bool "Debugging information files (DEVELOPMENT)"
  66. depends on PROC_FS
  67. help
  68. Some of the drivers in the "gadget" framework can expose
  69. debugging information in files such as /proc/driver/udc
  70. (for a peripheral controller). The information in these
  71. files may help when you're troubleshooting or bringing up a
  72. driver on a new board. Enable these files by choosing "Y"
  73. here. If in doubt, or to conserve kernel memory, say "N".
  74. config USB_GADGET_DEBUG_FS
  75. bool "Debugging information files in debugfs (DEVELOPMENT)"
  76. depends on DEBUG_FS
  77. help
  78. Some of the drivers in the "gadget" framework can expose
  79. debugging information in files under /sys/kernel/debug/.
  80. The information in these files may help when you're
  81. troubleshooting or bringing up a driver on a new board.
  82. Enable these files by choosing "Y" here. If in doubt, or
  83. to conserve kernel memory, say "N".
  84. config USB_GADGET_VBUS_DRAW
  85. int "Maximum VBUS Power usage (2-500 mA)"
  86. range 2 500
  87. default 2
  88. help
  89. Some devices need to draw power from USB when they are
  90. configured, perhaps to operate circuitry or to recharge
  91. batteries. This is in addition to any local power supply,
  92. such as an AC adapter or batteries.
  93. Enter the maximum power your device draws through USB, in
  94. milliAmperes. The permitted range of values is 2 - 500 mA;
  95. 0 mA would be legal, but can make some hosts misbehave.
  96. This value will be used except for system-specific gadget
  97. drivers that have more specific information.
  98. config USB_GADGET_STORAGE_NUM_BUFFERS
  99. int "Number of storage pipeline buffers"
  100. range 2 32
  101. default 2
  102. help
  103. Usually 2 buffers are enough to establish a good buffering
  104. pipeline. The number may be increased in order to compensate
  105. for a bursty VFS behaviour. For instance there may be CPU wake up
  106. latencies that makes the VFS to appear bursty in a system with
  107. an CPU on-demand governor. Especially if DMA is doing IO to
  108. offload the CPU. In this case the CPU will go into power
  109. save often and spin up occasionally to move data within VFS.
  110. If selecting USB_GADGET_DEBUG_FILES this value may be set by
  111. a module parameter as well.
  112. If unsure, say 2.
  113. source "drivers/usb/gadget/udc/Kconfig"
  114. #
  115. # USB Gadget Drivers
  116. #
  117. # composite based drivers
  118. config USB_LIBCOMPOSITE
  119. tristate
  120. select CONFIGFS_FS
  121. depends on USB_GADGET
  122. config USB_F_ACM
  123. tristate
  124. config USB_F_SS_LB
  125. tristate
  126. config USB_U_SERIAL
  127. tristate
  128. config USB_U_ETHER
  129. tristate
  130. config USB_F_SERIAL
  131. tristate
  132. config USB_F_OBEX
  133. tristate
  134. config USB_F_NCM
  135. tristate
  136. config USB_F_ECM
  137. tristate
  138. config USB_F_PHONET
  139. tristate
  140. config USB_F_EEM
  141. tristate
  142. config USB_F_SUBSET
  143. tristate
  144. config USB_F_RNDIS
  145. tristate
  146. config USB_F_MASS_STORAGE
  147. tristate
  148. config USB_F_FS
  149. tristate
  150. config USB_F_UAC1
  151. tristate
  152. config USB_F_UAC2
  153. tristate
  154. config USB_F_UVC
  155. tristate
  156. config USB_F_MIDI
  157. tristate
  158. config USB_F_HID
  159. tristate
  160. config USB_F_PRINTER
  161. tristate
  162. choice
  163. tristate "USB Gadget Drivers"
  164. default USB_ETH
  165. help
  166. A Linux "Gadget Driver" talks to the USB Peripheral Controller
  167. driver through the abstract "gadget" API. Some other operating
  168. systems call these "client" drivers, of which "class drivers"
  169. are a subset (implementing a USB device class specification).
  170. A gadget driver implements one or more USB functions using
  171. the peripheral hardware.
  172. Gadget drivers are hardware-neutral, or "platform independent",
  173. except that they sometimes must understand quirks or limitations
  174. of the particular controllers they work with. For example, when
  175. a controller doesn't support alternate configurations or provide
  176. enough of the right types of endpoints, the gadget driver might
  177. not be able work with that controller, or might need to implement
  178. a less common variant of a device class protocol.
  179. # this first set of drivers all depend on bulk-capable hardware.
  180. config USB_CONFIGFS
  181. tristate "USB functions configurable through configfs"
  182. select USB_LIBCOMPOSITE
  183. help
  184. A Linux USB "gadget" can be set up through configfs.
  185. If this is the case, the USB functions (which from the host's
  186. perspective are seen as interfaces) and configurations are
  187. specified simply by creating appropriate directories in configfs.
  188. Associating functions with configurations is done by creating
  189. appropriate symbolic links.
  190. For more information see Documentation/usb/gadget_configfs.txt.
  191. config USB_CONFIGFS_SERIAL
  192. bool "Generic serial bulk in/out"
  193. depends on USB_CONFIGFS
  194. depends on TTY
  195. select USB_U_SERIAL
  196. select USB_F_SERIAL
  197. help
  198. The function talks to the Linux-USB generic serial driver.
  199. config USB_CONFIGFS_ACM
  200. bool "Abstract Control Model (CDC ACM)"
  201. depends on USB_CONFIGFS
  202. depends on TTY
  203. select USB_U_SERIAL
  204. select USB_F_ACM
  205. help
  206. ACM serial link. This function can be used to interoperate with
  207. MS-Windows hosts or with the Linux-USB "cdc-acm" driver.
  208. config USB_CONFIGFS_OBEX
  209. bool "Object Exchange Model (CDC OBEX)"
  210. depends on USB_CONFIGFS
  211. depends on TTY
  212. select USB_U_SERIAL
  213. select USB_F_OBEX
  214. help
  215. You will need a user space OBEX server talking to /dev/ttyGS*,
  216. since the kernel itself doesn't implement the OBEX protocol.
  217. config USB_CONFIGFS_NCM
  218. bool "Network Control Model (CDC NCM)"
  219. depends on USB_CONFIGFS
  220. depends on NET
  221. select USB_U_ETHER
  222. select USB_F_NCM
  223. help
  224. NCM is an advanced protocol for Ethernet encapsulation, allows
  225. grouping of several ethernet frames into one USB transfer and
  226. different alignment possibilities.
  227. config USB_CONFIGFS_ECM
  228. bool "Ethernet Control Model (CDC ECM)"
  229. depends on USB_CONFIGFS
  230. depends on NET
  231. select USB_U_ETHER
  232. select USB_F_ECM
  233. help
  234. The "Communication Device Class" (CDC) Ethernet Control Model.
  235. That protocol is often avoided with pure Ethernet adapters, in
  236. favor of simpler vendor-specific hardware, but is widely
  237. supported by firmware for smart network devices.
  238. config USB_CONFIGFS_ECM_SUBSET
  239. bool "Ethernet Control Model (CDC ECM) subset"
  240. depends on USB_CONFIGFS
  241. depends on NET
  242. select USB_U_ETHER
  243. select USB_F_SUBSET
  244. help
  245. On hardware that can't implement the full protocol,
  246. a simple CDC subset is used, placing fewer demands on USB.
  247. config USB_CONFIGFS_RNDIS
  248. bool "RNDIS"
  249. depends on USB_CONFIGFS
  250. depends on NET
  251. select USB_U_ETHER
  252. select USB_F_RNDIS
  253. help
  254. Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol,
  255. and Microsoft provides redistributable binary RNDIS drivers for
  256. older versions of Windows.
  257. To make MS-Windows work with this, use Documentation/usb/linux.inf
  258. as the "driver info file". For versions of MS-Windows older than
  259. XP, you'll need to download drivers from Microsoft's website; a URL
  260. is given in comments found in that info file.
  261. config USB_CONFIGFS_EEM
  262. bool "Ethernet Emulation Model (EEM)"
  263. depends on USB_CONFIGFS
  264. depends on NET
  265. select USB_U_ETHER
  266. select USB_F_EEM
  267. help
  268. CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM
  269. and therefore can be supported by more hardware. Technically ECM and
  270. EEM are designed for different applications. The ECM model extends
  271. the network interface to the target (e.g. a USB cable modem), and the
  272. EEM model is for mobile devices to communicate with hosts using
  273. ethernet over USB. For Linux gadgets, however, the interface with
  274. the host is the same (a usbX device), so the differences are minimal.
  275. config USB_CONFIGFS_PHONET
  276. bool "Phonet protocol"
  277. depends on USB_CONFIGFS
  278. depends on NET
  279. depends on PHONET
  280. select USB_U_ETHER
  281. select USB_F_PHONET
  282. help
  283. The Phonet protocol implementation for USB device.
  284. config USB_CONFIGFS_MASS_STORAGE
  285. bool "Mass storage"
  286. depends on USB_CONFIGFS
  287. depends on BLOCK
  288. select USB_F_MASS_STORAGE
  289. help
  290. The Mass Storage Gadget acts as a USB Mass Storage disk drive.
  291. As its storage repository it can use a regular file or a block
  292. device (in much the same way as the "loop" device driver),
  293. specified as a module parameter or sysfs option.
  294. config USB_CONFIGFS_F_LB_SS
  295. bool "Loopback and sourcesink function (for testing)"
  296. depends on USB_CONFIGFS
  297. select USB_F_SS_LB
  298. help
  299. Loopback function loops back a configurable number of transfers.
  300. Sourcesink function either sinks and sources bulk data.
  301. It also implements control requests, for "chapter 9" conformance.
  302. Make this be the first driver you try using on top of any new
  303. USB peripheral controller driver. Then you can use host-side
  304. test software, like the "usbtest" driver, to put your hardware
  305. and its driver through a basic set of functional tests.
  306. config USB_CONFIGFS_F_FS
  307. bool "Function filesystem (FunctionFS)"
  308. depends on USB_CONFIGFS
  309. select USB_F_FS
  310. help
  311. The Function Filesystem (FunctionFS) lets one create USB
  312. composite functions in user space in the same way GadgetFS
  313. lets one create USB gadgets in user space. This allows creation
  314. of composite gadgets such that some of the functions are
  315. implemented in kernel space (for instance Ethernet, serial or
  316. mass storage) and other are implemented in user space.
  317. config USB_CONFIGFS_F_UAC1
  318. bool "Audio Class 1.0"
  319. depends on USB_CONFIGFS
  320. depends on SND
  321. select USB_LIBCOMPOSITE
  322. select SND_PCM
  323. select USB_F_UAC1
  324. help
  325. This Audio function implements 1 AudioControl interface,
  326. 1 AudioStreaming Interface each for USB-OUT and USB-IN.
  327. This driver requires a real Audio codec to be present
  328. on the device.
  329. config USB_CONFIGFS_F_UAC2
  330. bool "Audio Class 2.0"
  331. depends on USB_CONFIGFS
  332. depends on SND
  333. select USB_LIBCOMPOSITE
  334. select SND_PCM
  335. select USB_F_UAC2
  336. help
  337. This Audio function is compatible with USB Audio Class
  338. specification 2.0. It implements 1 AudioControl interface,
  339. 1 AudioStreaming Interface each for USB-OUT and USB-IN.
  340. This driver doesn't expect any real Audio codec to be present
  341. on the device - the audio streams are simply sinked to and
  342. sourced from a virtual ALSA sound card created. The user-space
  343. application may choose to do whatever it wants with the data
  344. received from the USB Host and choose to provide whatever it
  345. wants as audio data to the USB Host.
  346. config USB_CONFIGFS_F_MIDI
  347. bool "MIDI function"
  348. depends on USB_CONFIGFS
  349. depends on SND
  350. select USB_LIBCOMPOSITE
  351. select SND_RAWMIDI
  352. select USB_F_MIDI
  353. help
  354. The MIDI Function acts as a USB Audio device, with one MIDI
  355. input and one MIDI output. These MIDI jacks appear as
  356. a sound "card" in the ALSA sound system. Other MIDI
  357. connections can then be made on the gadget system, using
  358. ALSA's aconnect utility etc.
  359. config USB_CONFIGFS_F_HID
  360. bool "HID function"
  361. depends on USB_CONFIGFS
  362. select USB_F_HID
  363. help
  364. The HID function driver provides generic emulation of USB
  365. Human Interface Devices (HID).
  366. For more information, see Documentation/usb/gadget_hid.txt.
  367. config USB_CONFIGFS_F_UVC
  368. bool "USB Webcam function"
  369. depends on USB_CONFIGFS
  370. depends on VIDEO_DEV
  371. select VIDEOBUF2_VMALLOC
  372. select USB_F_UVC
  373. help
  374. The Webcam function acts as a composite USB Audio and Video Class
  375. device. It provides a userspace API to process UVC control requests
  376. and stream video data to the host.
  377. config USB_CONFIGFS_F_PRINTER
  378. bool "Printer function"
  379. select USB_F_PRINTER
  380. depends on USB_CONFIGFS
  381. help
  382. The Printer function channels data between the USB host and a
  383. userspace program driving the print engine. The user space
  384. program reads and writes the device file /dev/g_printer<X> to
  385. receive or send printer data. It can use ioctl calls to
  386. the device file to get or set printer status.
  387. For more information, see Documentation/usb/gadget_printer.txt
  388. which includes sample code for accessing the device file.
  389. source "drivers/usb/gadget/legacy/Kconfig"
  390. endchoice
  391. endif # USB_GADGET