On Tue, 16 Mar 2004, Greg KH wrote:

> Hm, I get the following errors when trying to build the gadget drivers
> with this driver selected:
> 
> drivers/usb/gadget/ether.c:260:9: #error Configure some USB peripheral controller 
> driver!
> drivers/usb/gadget/ether.c:395: error: `DRIVER_VERSION_NUM' undeclared here (not in 
> a function)
...
> I'll hold off applying this for now till the build fixes are done.

Well, clearly you just tried to build the wrong gadget driver!  :-)

Seriously, you're right of course.  g_file_storage already includes 
support for dummy_hcd.  This patch adds support to g_ether and g_serial, 
and it also adds a gadget_is_dummy() macro to gadget_chips.h.

The g_zero driver is a little tricky.  I don't want to include an update 
for it here, because David has already sent in a patch that converts it to 
use the new endpoint autoconfig routine.  It hasn't been applied yet, but 
once it has the zero.c file won't require any changes at all to support 
dummy_hcd.

Alan Stern


===== ether.c 1.18 vs edited =====
--- 1.18/drivers/usb/gadget/ether.c     Mon Mar  8 13:19:56 2004
+++ edited/drivers/usb/gadget/ether.c   Tue Mar 16 17:55:32 2004
@@ -175,6 +175,27 @@
 #endif
 
 /*
+ * Dummy_hcd, software-based loopback controller.
+ *
+ * This imitates the abilities of the NetChip 2280, so we will use
+ * the same configuration.
+ */
+#ifdef CONFIG_USB_GADGET_DUMMY_HCD
+#define CHIP                   "dummy"
+#define DRIVER_VERSION_NUM     0x0102
+static const char EP_OUT_NAME [] = "ep-a";
+#define EP_OUT_NUM     1
+static const char EP_IN_NAME [] = "ep-b";
+#define EP_IN_NUM      2
+static const char EP_STATUS_NAME [] = "ep-f";
+#define EP_STATUS_NUM  3
+/* doesn't support remote wakeup, obviously */
+
+/* no hw optimizations to apply */
+#define hw_optimize(g) do {} while (0)
+#endif
+
+/*
  * PXA-2xx UDC:  widely used in second gen Linux-capable ARM PDAs
  * and other products.
  *
===== serial.c 1.3 vs edited =====
--- 1.3/drivers/usb/gadget/serial.c     Fri Jan 30 22:02:34 2004
+++ edited/drivers/usb/gadget/serial.c  Tue Mar 16 17:59:35 2004
@@ -207,6 +207,27 @@
 
 
 /*
+ * Dummy_hcd, software-based loopback controller.
+ *
+ * This imitates the abilities of the NetChip 2280, so we will use
+ * the same configuration.
+ */
+#ifdef CONFIG_USB_GADGET_DUMMY_HCD
+#define CHIP                           "dummy"
+#define EP0_MAXPACKET                  64
+static const char EP_OUT_NAME[] =      "ep-a";
+#define EP_OUT_NUM                     2
+static const char EP_IN_NAME[] =       "ep-b";
+#define EP_IN_NUM                      2
+#define HIGHSPEED
+#define SELFPOWER                      USB_CONFIG_ATT_SELFPOWER
+
+/* no hw optimizations to apply */
+#define hw_optimize(g)                 do {} while (0)
+#endif
+
+
+/*
  * PXA-2xx UDC:  widely used in second gen Linux-capable PDAs.
  *
  * This has fifteen fixed-function full speed endpoints, and it
===== drivers/usb/gadget/gadget_chips.h 1.1 vs edited =====
--- 1.1/drivers/usb/gadget/gadget_chips.h       Wed Mar 10 20:45:51 2004
+++ edited/drivers/usb/gadget/gadget_chips.h    Wed Mar 17 11:31:29 2004
@@ -14,6 +14,12 @@
 #define        gadget_is_net2280(g)    0
 #endif
 
+#ifdef CONFIG_USB_GADGET_DUMMY_HCD
+#define        gadget_is_dummy(g)      !strcmp("dummy_hcd", (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



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to