speedtch testatm.c,1.4,1.5

Roman Kagan rkagan at mail.ru
Sat Apr 9 11:32:33 EDT 2005


On Sat, Apr 09, 2005 at 12:24:18PM +0400, Roman Kagan wrote:
> I've tried using testatm with single-interface devices, and observed one
> nasty thing: it makes cat /proc/bus/usb/devices slow, generating
> timeouts on ep0in.  I suppose this is due to testatm not initializing
> (IOW using zeros) for .in and .out endpoints, but zero endpoints are
> the control ones, so this may interfere with the rest of usb stuff.

The following trivial patch makes it behave somewhat better.  The
endpoint number of 1 is arbitrary, the important thing is supposedly
that it differs from 0.  Can't outline the exact scenario which led to
the failures, though...

Cheers,
  Roman.


Index: testatm.c
===================================================================
RCS file: /home/cvs/usbatm/testatm.c,v
retrieving revision 1.5
diff -u -r1.5 testatm.c
--- testatm.c	7 Apr 2005 22:16:18 -0000	1.5
+++ testatm.c	9 Apr 2005 15:25:47 -0000
@@ -116,17 +116,23 @@
 static struct usbatm_driver testatm_drivers[] = {
 	{
 		.owner          = THIS_MODULE,
-	        .driver_name    = "testatm_0"
+	        .driver_name    = "testatm_0",
+		.in		= 1,
+		.out		= 1,
 	},
 	{
 		.owner          = THIS_MODULE,
 	        .driver_name    = "testatm_1",
+		.in		= 1,
+		.out		= 1,
 
 		.bind		= refuse_bind
 	},
 	{
 		.owner          = THIS_MODULE,
 	        .driver_name    = "testatm_2",
+		.in		= 1,
+		.out		= 1,
 
 		.bind		= accept_bind,
 
@@ -135,6 +141,8 @@
 	{
 		.owner          = THIS_MODULE,
 	        .driver_name    = "testatm_3",
+		.in		= 1,
+		.out		= 1,
 
 		.bind		= accept_bind,
 		.unbind		= testatm_unbind,
@@ -145,6 +153,8 @@
 	{
 		.owner          = THIS_MODULE,
 	        .driver_name    = "testatm_4",
+		.in		= 1,
+		.out		= 1,
 
 		.bind		= accept_bind,
 		.unbind		= testatm_unbind,
@@ -156,6 +166,8 @@
 	{
 		.owner          = THIS_MODULE,
 	        .driver_name    = "testatm_5",
+		.in		= 1,
+		.out		= 1,
 
 		.bind		= accept_bind,
 		.unbind		= testatm_unbind,
@@ -167,6 +179,8 @@
 	{
 		.owner          = THIS_MODULE,
 	        .driver_name    = "testatm_6",
+		.in		= 1,
+		.out		= 1,
 
 		.bind		= accept_bind,
 		.unbind		= testatm_unbind,
@@ -179,6 +193,8 @@
 	{
 		.owner          = THIS_MODULE,
 	        .driver_name    = "testatm_7",
+		.in		= 1,
+		.out		= 1,
 
 		.bind		= accept_bind,
 		.unbind		= testatm_unbind,
@@ -191,6 +207,8 @@
 	{
 		.owner          = THIS_MODULE,
 	        .driver_name    = "testatm_8",
+		.in		= 1,
+		.out		= 1,
 
 		.bind		= claim_bind,
 		.unbind		= claim_unbind,



More information about the Usbatm mailing list