# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.369.105.17 -> 1.369.105.18
#	drivers/usb/net/usbnet.c	1.19    -> 1.20   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/04/09	david-b@pacbell.net	1.369.105.18
# [PATCH] USB GeneLink/NDIS tweaks
# 
# USB GeneLink/NDIS tweaks
# 
# This patch, from Oliver, discards slightly less data in cases
# where memory is very tight.  The GeneLink framing can batch
# several packets in one transmission, so it's always possible to
# at least report the last one, since it's already sitting in an SKB
# and we won't need a new one.
# 
# Random note, this seems to be the same issue I saw
# mentioned somewhere else recently:  MSFT host drivers
# with high latency for submitting bulk packets, so rather
# than just queuing them as they arrive, it turns out to be a
# win on the MSFT side to batch packets.
# --------------------------------------------
#
diff -Nru a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
--- a/drivers/usb/net/usbnet.c	Thu Apr 11 11:28:28 2002
+++ b/drivers/usb/net/usbnet.c	Thu Apr 11 11:28:28 2002
@@ -538,25 +538,25 @@
 
 		// allocate the skb for the individual packet
 		gl_skb = alloc_skb (size, GFP_ATOMIC);
-		if (gl_skb == 0)
-			return 0;
+		if (gl_skb) {
 
-		// copy the packet data to the new skb
-		memcpy (gl_skb->data, packet->packet_data, size);
+			// copy the packet data to the new skb
+			memcpy (gl_skb->data, packet->packet_data, size);
 
-		// set skb data size
-		gl_skb->len = size;
-		gl_skb->dev = &dev->net;
+			// set skb data size
+			gl_skb->len = size;
+			gl_skb->dev = &dev->net;
 
-		// determine the packet's protocol ID
-		gl_skb->protocol = eth_type_trans (gl_skb, &dev->net);
+			// determine the packet's protocol ID
+			gl_skb->protocol = eth_type_trans (gl_skb, &dev->net);
 
-		// update the status
-		dev->stats.rx_packets++;
-		dev->stats.rx_bytes += size;
+			// update the status
+			dev->stats.rx_packets++;
+			dev->stats.rx_bytes += size;
 
-		// notify os of the received packet
-		status = netif_rx (gl_skb);
+			// notify os of the received packet
+			status = netif_rx (gl_skb);
+		}
 
 		// advance to the next packet
 		packet = (struct gl_packet *)
