diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 75b76d5a0fe9104c1124cc18b8a22efa44013ab5..a53be32c22cfd1ed54b0edb0a338f50fdefa183f 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -494,6 +494,12 @@ endmenu # # USB Gadget Drivers # + +# composite based drivers +config USB_LIBCOMPOSITE + tristate + depends on USB_GADGET + choice tristate "USB Gadget Drivers" default USB_ETH @@ -517,6 +523,7 @@ choice config USB_ZERO tristate "Gadget Zero (DEVELOPMENT)" + select USB_LIBCOMPOSITE help Gadget Zero is a two-configuration device. It either sinks and sources bulk data; or it loops back a configurable number of @@ -552,6 +559,7 @@ config USB_ZERO_HNPTEST config USB_AUDIO tristate "Audio Gadget (EXPERIMENTAL)" depends on SND + select USB_LIBCOMPOSITE select SND_PCM help This Gadget Audio driver is compatible with USB Audio Class @@ -580,6 +588,7 @@ config GADGET_UAC1 config USB_ETH tristate "Ethernet Gadget (with CDC Ethernet support)" depends on NET + select USB_LIBCOMPOSITE select CRC32 help This driver implements Ethernet style communication, in one of @@ -615,6 +624,7 @@ config USB_ETH config USB_ETH_RNDIS bool "RNDIS support" depends on USB_ETH + select USB_LIBCOMPOSITE default y help Microsoft Windows XP bundles the "Remote NDIS" (RNDIS) protocol, @@ -633,6 +643,7 @@ config USB_ETH_RNDIS config USB_ETH_EEM bool "Ethernet Emulation Model (EEM) support" depends on USB_ETH + select USB_LIBCOMPOSITE default n help CDC EEM is a newer USB standard that is somewhat simpler than CDC ECM @@ -649,6 +660,7 @@ config USB_ETH_EEM config USB_G_NCM tristate "Network Control Model (NCM) support" depends on NET + select USB_LIBCOMPOSITE select CRC32 help This driver implements USB CDC NCM subclass standard. NCM is @@ -678,6 +690,7 @@ config USB_GADGETFS config USB_FUNCTIONFS tristate "Function Filesystem (EXPERIMENTAL)" depends on EXPERIMENTAL + select USB_LIBCOMPOSITE select USB_FUNCTIONFS_GENERIC if !(USB_FUNCTIONFS_ETH || USB_FUNCTIONFS_RNDIS) help The Function Filesystem (FunctionFS) lets one create USB @@ -741,6 +754,7 @@ config USB_FILE_STORAGE_TEST config USB_MASS_STORAGE tristate "Mass Storage Gadget" depends on BLOCK + select USB_LIBCOMPOSITE help The Mass Storage Gadget acts as a USB Mass Storage disk drive. As its storage repository it can use a regular file or a block @@ -756,6 +770,7 @@ config USB_MASS_STORAGE config USB_GADGET_TARGET tristate "USB Gadget Target Fabric Module" depends on TARGET_CORE + select USB_LIBCOMPOSITE help This fabric is an USB gadget. Two USB protocols are supported that is BBB or BOT (Bulk Only Transport) and UAS (USB Attached SCSI). BOT is @@ -765,6 +780,7 @@ config USB_GADGET_TARGET config USB_G_SERIAL tristate "Serial Gadget (with CDC ACM and CDC OBEX support)" + select USB_LIBCOMPOSITE help The Serial Gadget talks to the Linux-USB generic serial driver. This driver supports a CDC-ACM module option, which can be used @@ -785,6 +801,7 @@ config USB_G_SERIAL config USB_MIDI_GADGET tristate "MIDI Gadget (EXPERIMENTAL)" depends on SND && EXPERIMENTAL + select USB_LIBCOMPOSITE select SND_RAWMIDI help The MIDI Gadget acts as a USB Audio device, with one MIDI @@ -798,6 +815,7 @@ config USB_MIDI_GADGET config USB_G_PRINTER tristate "Printer Gadget" + select USB_LIBCOMPOSITE help The Printer Gadget channels data between the USB host and a userspace program driving the print engine. The user space @@ -814,6 +832,7 @@ config USB_G_PRINTER config USB_CDC_COMPOSITE tristate "CDC Composite Device (Ethernet and ACM)" depends on NET + select USB_LIBCOMPOSITE help This driver provides two functions in one configuration: a CDC Ethernet (ECM) link, and a CDC ACM (serial port) link. @@ -828,6 +847,7 @@ config USB_CDC_COMPOSITE config USB_G_NOKIA tristate "Nokia composite gadget" depends on PHONET + select USB_LIBCOMPOSITE help The Nokia composite gadget provides support for acm, obex and phonet in only one composite gadget driver. @@ -838,6 +858,7 @@ config USB_G_NOKIA config USB_G_ACM_MS tristate "CDC Composite Device (ACM and mass storage)" depends on BLOCK + select USB_LIBCOMPOSITE help This driver provides two functions in one configuration: a mass storage, and a CDC ACM (serial port) link. @@ -849,6 +870,7 @@ config USB_G_MULTI tristate "Multifunction Composite Gadget (EXPERIMENTAL)" depends on BLOCK && NET select USB_G_MULTI_CDC if !USB_G_MULTI_RNDIS + select USB_LIBCOMPOSITE help The Multifunction Composite Gadget provides Ethernet (RNDIS and/or CDC Ethernet), mass storage and ACM serial link @@ -889,6 +911,7 @@ config USB_G_MULTI_CDC config USB_G_HID tristate "HID Gadget" + select USB_LIBCOMPOSITE help The HID gadget driver provides generic emulation of USB Human Interface Devices (HID). @@ -899,8 +922,10 @@ config USB_G_HID Say "y" to link the driver statically, or "m" to build a dynamically linked module called "g_hid". +# Standalone / single function gadgets config USB_G_DBGP tristate "EHCI Debug Device Gadget" + select USB_LIBCOMPOSITE help This gadget emulates an EHCI Debug device. This is useful when you want to interact with an EHCI Debug Port. diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile index d84f92325a7463d2367cb055dd002519401c194a..eadbc86333f6f0714e0558874a5c2f31e3d06ea5 100644 --- a/drivers/usb/gadget/Makefile +++ b/drivers/usb/gadget/Makefile @@ -4,6 +4,8 @@ ccflags-$(CONFIG_USB_GADGET_DEBUG) := -DDEBUG obj-$(CONFIG_USB_GADGET) += udc-core.o +obj-$(CONFIG_USB_LIBCOMPOSITE) += libcomposite.o +libcomposite-y := usbstring.o obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o obj-$(CONFIG_USB_NET2272) += net2272.o obj-$(CONFIG_USB_NET2280) += net2280.o diff --git a/drivers/usb/gadget/acm_ms.c b/drivers/usb/gadget/acm_ms.c index 65a2f3cbcde39e197de5d18b1fab7e716b1450a0..9820960dfc5c21dfb46c23d8f64395e482389555 100644 --- a/drivers/usb/gadget/acm_ms.c +++ b/drivers/usb/gadget/acm_ms.c @@ -42,7 +42,6 @@ */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" #include "u_serial.c" diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c index dd339bc5b40c747e12979c7e9cbe758746b9da81..76e54b44c27ae961d2853b3b9bbbe11296a2fd91 100644 --- a/drivers/usb/gadget/audio.c +++ b/drivers/usb/gadget/audio.c @@ -27,7 +27,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c index b7d984b54ca9928473eff1b6950fc91fe7652270..74a9c7f65ec8265d2ee37ef469ad2ed87536b248 100644 --- a/drivers/usb/gadget/cdc2.c +++ b/drivers/usb/gadget/cdc2.c @@ -44,7 +44,6 @@ */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" #include "u_serial.c" diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 4580ec09cc539bc10f85db29c253830a4f12e7b4..e16094e5d1d2b8c70175c0bcb2281d7acf119dcf 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -103,7 +103,6 @@ static inline bool has_rndis(void) * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index cdacae706b7069f0e14ca025ccb3f83ab4a147f9..8d0166b76d40e8dd154b185edb037323306f1a83 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c @@ -265,7 +265,6 @@ * the runtime footprint, and giving us at least some parts of what * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ -#include "usbstring.c" #include "config.c" #include "epautoconf.c" diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c index da9809f55cb559a4a942f4f2492321f24edc5d9a..407b5ccc64a418eec9330be2ca226fe68b48fb96 100644 --- a/drivers/usb/gadget/g_ffs.c +++ b/drivers/usb/gadget/g_ffs.c @@ -24,7 +24,6 @@ */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index 1e3cd378a2d7e8d804fe88199da6b2ebcbffd825..135b3900eaa379c0bca3ac8d8023a55da97d72df 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c @@ -38,7 +38,6 @@ #include "gadget_chips.h" #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" #include "f_midi.c" diff --git a/drivers/usb/gadget/hid.c b/drivers/usb/gadget/hid.c index 8502e56d73bc0f42850f923065e4b35764ea83c5..effda2e0742b0a3fadedf095ef2565c654333c3a 100644 --- a/drivers/usb/gadget/hid.c +++ b/drivers/usb/gadget/hid.c @@ -35,7 +35,6 @@ */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" diff --git a/drivers/usb/gadget/mass_storage.c b/drivers/usb/gadget/mass_storage.c index 480edbc368e59ea3238bbdc6d1ee3391d87aa44a..a7f32c312a6bd809f8b249422f61bd92f18b6cfc 100644 --- a/drivers/usb/gadget/mass_storage.c +++ b/drivers/usb/gadget/mass_storage.c @@ -49,7 +49,6 @@ */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" #include "f_mass_storage.c" diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c index 13db7ccb95717f97e651020a0580368af173ff62..71c1fabdbb78d8991c00dfacccd8b9b07d0012d9 100644 --- a/drivers/usb/gadget/multi.c +++ b/drivers/usb/gadget/multi.c @@ -44,7 +44,6 @@ MODULE_LICENSE("GPL"); */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" diff --git a/drivers/usb/gadget/ncm.c b/drivers/usb/gadget/ncm.c index 9a20057896cd5500a1cdb373be33d70ee7521873..d7e6b1ee866463f586e6b042c0566705eff3a9ff 100644 --- a/drivers/usb/gadget/ncm.c +++ b/drivers/usb/gadget/ncm.c @@ -37,7 +37,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" diff --git a/drivers/usb/gadget/nokia.c b/drivers/usb/gadget/nokia.c index a5b5e7162fef721dddc35ac86b0fa71ff03c2a2a..474c77ca58c02a236bee1cf7ff6c982d948cb439 100644 --- a/drivers/usb/gadget/nokia.c +++ b/drivers/usb/gadget/nokia.c @@ -39,7 +39,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index 33c0c07493e86bc408a840205fa51385c557452d..c55e7d99b810f7d99592e29b008e643be00ad05a 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c @@ -52,7 +52,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index ea3f8e9344ae6d064acab6b1d323342f040d334e..88baa9e3f8279c57cf55d2059b6de3c413321605 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c @@ -38,7 +38,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c index 35ca09af9b4afe4c288acd5e60ece17a8257ba8a..327af68837151cd7556b31db9206a34e7456d38e 100644 --- a/drivers/usb/gadget/tcm_usb_gadget.c +++ b/drivers/usb/gadget/tcm_usb_gadget.c @@ -25,7 +25,6 @@ #include #include -#include "usbstring.c" #include "epautoconf.c" #include "config.c" #include "composite.c" diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c index 4d25b9009edf4175d3a5e648c877fad6d2890925..24e9bbd255a730267a4cbfae75fd071f311739ad 100644 --- a/drivers/usb/gadget/usbstring.c +++ b/drivers/usb/gadget/usbstring.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -68,4 +69,5 @@ usb_gadget_get_string (struct usb_gadget_strings *table, int id, u8 *buf) buf [1] = USB_DT_STRING; return buf [0]; } - +EXPORT_SYMBOL_GPL(usb_gadget_get_string); +MODULE_LICENSE("GPL"); diff --git a/drivers/usb/gadget/webcam.c b/drivers/usb/gadget/webcam.c index 2a617c3f5a4036080c7a67e29dd7ca5f7671ba79..dc8fd5cc4f92ed4a99046adfd80b011bff1af870 100644 --- a/drivers/usb/gadget/webcam.c +++ b/drivers/usb/gadget/webcam.c @@ -24,7 +24,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c" diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index 90df613cccc0f2c7a1a44a353fa0f45dc4894f84..4469be8fcee378915c0e86dc22f5ea95a004693e 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c @@ -59,7 +59,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "usbstring.c" #include "config.c" #include "epautoconf.c"