Hi,

The recently created drivers/usb/atm/usb_atm.c seems to have a bug in
the case snd_padding is not zero (so speedtch didn't trigger it).  It
looks like a cut&paste error when compared to the original xdslusb.c.

The attached patch fixes it, and also changes the driver name to reflect
its generic nature.  With this patch applied, it works correctly with
the new Conexant AccessRunner driver I'll be sending shortly, and it
didn't without (took me half a day staring at tcpdump output figuring
out why I received packets correctly but none of them was in response to
what I sent).

The patch is against 2.6.10-rc3.  Please consider applying and pushing
to Linus before 2.6.10-final is out.

 drivers/usb/atm/usb_atm.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

Signed-off-by: Roman Kagan <[EMAIL PROTECTED]>

Roman.
--- linux-2.6.10-rc3.orig/drivers/usb/atm/usb_atm.c	2004-12-04 00:55:02.000000000 +0300
+++ linux-2.6.10-rc3/drivers/usb/atm/usb_atm.c	2004-12-21 21:39:21.000000000 +0300
@@ -81,8 +81,6 @@
 #include <linux/init.h>
 #include <linux/firmware.h>
 
-#include "usb_atm.h"
-
 /*
 #define DEBUG
 #define VERBOSE_DEBUG
@@ -94,6 +92,8 @@
 
 #include <linux/usb.h>
 
+#include "usb_atm.h"
+
 #ifdef DEBUG
 #define UDSL_ASSERT(x)	BUG_ON(!(x))
 #else
@@ -111,7 +111,7 @@
 
 #define DRIVER_AUTHOR	"Johan Verrept, Duncan Sands <[EMAIL PROTECTED]>"
 #define DRIVER_VERSION	"1.8"
-#define DRIVER_DESC	"Alcatel SpeedTouch USB driver version " DRIVER_VERSION
+#define DRIVER_DESC	"Generic USB ATM/DSL core I/O driver version " DRIVER_VERSION
 
 static unsigned int num_rcv_urbs = UDSL_DEFAULT_RCV_URBS;
 static unsigned int num_snd_urbs = UDSL_DEFAULT_SND_URBS;
@@ -386,10 +386,6 @@
 	if (!(ctrl->num_cells -= ne) || !(howmany -= ne))
 		goto out;
 
-	if (instance->snd_padding) {
-		memset(target, 0, instance->snd_padding);
-		target += instance->snd_padding;
-	}
 	udsl_fill_cell_header(target, ctrl->atm_data.vcc);
 	target += ATM_CELL_HEADER;
 	memcpy(target, skb->data, skb->len);
@@ -404,6 +400,10 @@
 			goto out;
 		}
 
+		if (instance->snd_padding) {
+			memset(target, 0, instance->snd_padding);
+			target += instance->snd_padding;
+		}
 		udsl_fill_cell_header(target, ctrl->atm_data.vcc);
 		target += ATM_CELL_HEADER;
 		memset(target, 0, ATM_CELL_PAYLOAD - ATM_AAL5_TRAILER);

Reply via email to