This poisons the OUT buffers to help detect more bugs.
Fill OUT buffers with 0x55 before RX, so that controller driver
bugs that mangle data can be more readily detected during testing.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>

Index: g26/drivers/usb/gadget/zero.c
===================================================================
--- g26.orig/drivers/usb/gadget/zero.c	2006-04-02 11:11:15.000000000 -0700
+++ g26/drivers/usb/gadget/zero.c	2006-04-02 11:16:56.000000000 -0700
@@ -572,9 +572,10 @@ static void source_sink_complete (struct
 	switch (status) {
 
 	case 0: 			/* normal completion? */
-		if (ep == dev->out_ep)
+		if (ep == dev->out_ep) {
 			check_read_data (dev, ep, req);
-		else
+			memset (req->buf, 0x55, req->length);
+		} else
 			reinit_write_data (dev, ep, req);
 		break;
 
@@ -626,6 +627,8 @@ source_sink_start_ep (struct usb_ep *ep,
 
 	if (strcmp (ep->name, EP_IN_NAME) == 0)
 		reinit_write_data (ep->driver_data, ep, req);
+	else
+		memset (req->buf, 0x55, req->length);
 
 	status = usb_ep_queue (ep, req, gfp_flags);
 	if (status) {

Reply via email to