638d17b3fa
(Upstream commit f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10.) USB Raw Gadget is a kernel module that provides a userspace interface for the USB Gadget subsystem. Essentially it allows to emulate USB devices from userspace. Enabled with CONFIG_USB_RAW_GADGET. Raw Gadget is currently a strictly debugging feature and shouldn't be used in production. Raw Gadget is similar to GadgetFS, but provides a more low-level and direct access to the USB Gadget layer for the userspace. The key differences are: 1. Every USB request is passed to the userspace to get a response, while GadgetFS responds to some USB requests internally based on the provided descriptors. However note, that the UDC driver might respond to some requests on its own and never forward them to the Gadget layer. 2. GadgetFS performs some sanity checks on the provided USB descriptors, while Raw Gadget allows you to provide arbitrary data as responses to USB requests. 3. Raw Gadget provides a way to select a UDC device/driver to bind to, while GadgetFS currently binds to the first available UDC. 4. Raw Gadget uses predictable endpoint names (handles) across different UDCs (as long as UDCs have enough endpoints of each required transfer type). 5. Raw Gadget has ioctl-based interface instead of a filesystem-based one. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Felipe Balbi <balbi@kernel.org> Bug: 147413187 Signed-off-by: Andrey Konovalov <andreyknvl@google.com> Change-Id: Ib48759bda0651e685160c532bed55b7335a39034
47 lines
1.4 KiB
Makefile
47 lines
1.4 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# USB gadget drivers
|
|
#
|
|
|
|
ccflags-y := -I$(srctree)/drivers/usb/gadget/
|
|
ccflags-y += -I$(srctree)/drivers/usb/gadget/udc/
|
|
ccflags-y += -I$(srctree)/drivers/usb/gadget/function/
|
|
|
|
g_zero-y := zero.o
|
|
g_audio-y := audio.o
|
|
g_ether-y := ether.o
|
|
g_serial-y := serial.o
|
|
g_midi-y := gmidi.o
|
|
gadgetfs-y := inode.o
|
|
g_mass_storage-y := mass_storage.o
|
|
g_printer-y := printer.o
|
|
g_cdc-y := cdc2.o
|
|
g_multi-y := multi.o
|
|
g_hid-y := hid.o
|
|
g_dbgp-y := dbgp.o
|
|
g_nokia-y := nokia.o
|
|
g_webcam-y := webcam.o
|
|
g_ncm-y := ncm.o
|
|
g_acm_ms-y := acm_ms.o
|
|
g_tcm_usb_gadget-y := tcm_usb_gadget.o
|
|
|
|
obj-$(CONFIG_USB_ZERO) += g_zero.o
|
|
obj-$(CONFIG_USB_AUDIO) += g_audio.o
|
|
obj-$(CONFIG_USB_ETH) += g_ether.o
|
|
obj-$(CONFIG_USB_GADGETFS) += gadgetfs.o
|
|
obj-$(CONFIG_USB_FUNCTIONFS) += g_ffs.o
|
|
obj-$(CONFIG_USB_MASS_STORAGE) += g_mass_storage.o
|
|
obj-$(CONFIG_USB_G_SERIAL) += g_serial.o
|
|
obj-$(CONFIG_USB_G_PRINTER) += g_printer.o
|
|
obj-$(CONFIG_USB_MIDI_GADGET) += g_midi.o
|
|
obj-$(CONFIG_USB_CDC_COMPOSITE) += g_cdc.o
|
|
obj-$(CONFIG_USB_G_HID) += g_hid.o
|
|
obj-$(CONFIG_USB_G_DBGP) += g_dbgp.o
|
|
obj-$(CONFIG_USB_G_MULTI) += g_multi.o
|
|
obj-$(CONFIG_USB_G_NOKIA) += g_nokia.o
|
|
obj-$(CONFIG_USB_G_WEBCAM) += g_webcam.o
|
|
obj-$(CONFIG_USB_G_NCM) += g_ncm.o
|
|
obj-$(CONFIG_USB_G_ACM_MS) += g_acm_ms.o
|
|
obj-$(CONFIG_USB_GADGET_TARGET) += tcm_usb_gadget.o
|
|
obj-$(CONFIG_USB_RAW_GADGET) += raw_gadget.o
|