Commit 7ab4b6bc authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: g_ether does endpoint autoconfig too

Here's an update for the Ethernet gadget that corresponds
to the earlier one for Gadget Zero ... it gets rid of almost
all the remaining controller-specific #ifdefs in this driver.
(And also lets the driver initialize using "dummy_hcd".)

This is a significant step towards doing hardware-specific
configuration at run time (or at least init-time) rather
than compile time, but other patches will be needed to take
it the rest of the way there.   (Especially considering the
RNDIS support...)  The runtime footprint of the driver shrank
a bit, mostly because things moved into the init section.
parent 1a8ebef0
......@@ -9,9 +9,9 @@ obj-$(CONFIG_USB_GOKU) += goku_udc.o
# USB gadget drivers
#
g_zero-objs := zero.o usbstring.o config.o epautoconf.o
g_ether-objs := ether.o usbstring.o config.o
g_ether-objs := ether.o usbstring.o config.o epautoconf.o
g_serial-objs := serial.o usbstring.o
gadgetfs-objs := inode.o usbstring.o
gadgetfs-objs := inode.o
g_file_storage-objs := file_storage.o usbstring.o
obj-$(CONFIG_USB_ZERO) += g_zero.o
......
......@@ -91,7 +91,7 @@ ep_matches (
/* bulk endpoints handle interrupt transfers,
* except the toggle-quirky iso-synch kind
*/
if ('s' != tmp[2]) // == "-iso"
if ('s' == tmp[2]) // == "-iso"
return 0;
/* for now, avoid PXA "interrupt-in";
* it's documented as never using DATA1.
......
This diff is collapsed.
......@@ -14,6 +14,12 @@
#define gadget_is_net2280(g) 0
#endif
#ifdef CONFIG_USB_GADGET_DUMMY_HCD
#define gadget_is_dummy(g) !strcmp("dummy_udc", (g)->name)
#else
#define gadget_is_dummy(g) 0
#endif
#ifdef CONFIG_USB_GADGET_PXA
#define gadget_is_pxa(g) !strcmp("pxa2xx_udc", (g)->name)
#else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment