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

On Sat, 22 Mar 2003 18:01, Brad Hards wrote:
> cdc-ether-zerolength.patch is the same for 2.5.65 - compile tested, but not
> even installed, since you now have the software testing.
Grr. But fails to compile. Try the attached one.

Brad
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+fBlXW6pHgIdAuOMRAoDSAKCk7R1Nw9VKsqWPQFypxDsKRWfd1wCgp2Ou
jpIuCL8Cho42/SO+BS1NNeI=
=xB1l
-----END PGP SIGNATURE-----
diff -Naur -X dontdiff linux-2.5.65/drivers/usb/net/cdc-ether.c linux-2.5.65-cdcfixup/drivers/usb/net/cdc-ether.c
--- linux-2.5.65/drivers/usb/net/cdc-ether.c	2003-03-18 08:43:39.000000000 +1100
+++ linux-2.5.65-cdcfixup/drivers/usb/net/cdc-ether.c	2003-03-22 18:18:23.000000000 +1100
@@ -269,22 +269,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 );
@@ -299,7 +285,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 problem, I hope */
+	ether_dev->tx_urb->transfer_flags |= URB_ZERO_PACKET;
 	
 	// Send the URB on its merry way.
 	if ((res = usb_submit_urb(ether_dev->tx_urb, GFP_ATOMIC)))  {

Reply via email to