-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 13 Nov 2002 10:58, Alan Cox wrote:
> On Tue, 2002-11-12 at 23:19, Benjamin Herrenschmidt wrote:
> > In both 2.4 CDCEther.c and 2.5 cdc-ether.c, there is this bit of
> > code in the start_xmit function:
>
> A fix was posted for this a long time ago, and its been in -ac for a
> while. Its needed for the USB cable modem I have too.
Can you try this patch? The original code is bogosity.
I will try to find some time to play with this more, but this is the right 
fix, I hope.

Brad
- -- 
http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE90frhW6pHgIdAuOMRAtoMAJ4kMvOAcq8x9NfUcgqPe4aEeF781wCfeGVB
ObuvTri/sx9MisZA6mZ53jw=
=uwyV
-----END PGP SIGNATURE-----
diff -Naur -X dontdiff linux-2.4.20-pre11-clean/drivers/usb/CDCEther.c linux-2.4.20-pre11/drivers/usb/CDCEther.c
--- linux-2.4.20-pre11-clean/drivers/usb/CDCEther.c	2002-10-18 09:57:03.000000000 +1000
+++ linux-2.4.20-pre11/drivers/usb/CDCEther.c	2002-10-18 09:23:48.000000000 +1000
@@ -306,22 +306,8 @@
 static int CDCEther_start_xmit( struct sk_buff *skb, struct net_device *net )
 {
 	ether_dev_t	*ether_dev = net->priv;
-	int 	count;
 	int 	res;
 
-	// If we are told to transmit an ethernet frame that fits EXACTLY 
-	// into an integer number of USB packets, we force it to send one 
-	// more byte so the device will get a runt USB packet signalling the 
-	// end of the ethernet frame
-	if ( (skb->len) ^ (ether_dev->data_ep_out_size) ) {
-		// It was not an exact multiple
-		// no need to add anything extra
-		count = skb->len;
-	} else {
-		// Add one to make it NOT an exact multiple
-		count = skb->len + 1;
-	}
-
 	// Tell the kernel, "No more frames 'til we are done
 	// with this one.'
 	netif_stop_queue( net );
@@ -336,7 +322,10 @@
 			write_bulk_callback, ether_dev );
 
 	// Tell the URB how much it will be transporting today
-	ether_dev->tx_urb.transfer_buffer_length = count;
+	ether_dev->tx_urb.transfer_buffer_length = skb->len;
+
+	/* Deal with the Zero Length packet problem, I hope */
+	ether_dev->tx_urb.transfer_flags |= USB_ZERO_PACKET;
 	
 	// Send the URB on its merry way.
 	if ((res = usb_submit_urb(&ether_dev->tx_urb)))  {

Reply via email to