netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usbnet: Zero padding byte if there is tail room in skb
@ 2007-06-27  6:48 Peter Korsgaard
  2007-07-02 12:25 ` Jeff Garzik
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Korsgaard @ 2007-06-27  6:48 UTC (permalink / raw)
  To: netdev, jeff; +Cc: david-b

Usbnet adds a padding byte if a 0 byte USB packet would be sent. Zero
padding byte if there is tail room in skb.

Signed-of-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>

---
 drivers/net/usb/usbnet.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6.22-rc6/drivers/net/usb/usbnet.c
===================================================================
--- linux-2.6.22-rc6.orig/drivers/net/usb/usbnet.c
+++ linux-2.6.22-rc6/drivers/net/usb/usbnet.c
@@ -953,11 +953,14 @@
 	/* don't assume the hardware handles USB_ZERO_PACKET
 	 * NOTE:  strictly conforming cdc-ether devices should expect
 	 * the ZLP here, but ignore the one-byte packet.
-	 *
-	 * FIXME zero that byte, if it doesn't require a new skb.
 	 */
-	if ((length % dev->maxpacket) == 0)
+	if ((length % dev->maxpacket) == 0) {
 		urb->transfer_buffer_length++;
+		if (skb_tailroom(skb)) {
+			skb->data[skb->len] = 0;
+			__skb_put(skb, 1);
+		}
+	}
 
 	spin_lock_irqsave (&dev->txq.lock, flags);

-- 
Bye, Peter Korsgaard


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] usbnet: Zero padding byte if there is tail room in skb
  2007-06-27  6:48 [PATCH] usbnet: Zero padding byte if there is tail room in skb Peter Korsgaard
@ 2007-07-02 12:25 ` Jeff Garzik
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-07-02 12:25 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: netdev, david-b

Peter Korsgaard wrote:
> Usbnet adds a padding byte if a 0 byte USB packet would be sent. Zero
> padding byte if there is tail room in skb.
> 
> Signed-of-by: Peter Korsgaard <jacmet@sunsite.dk>
> Acked-by: David Brownell <dbrownell@users.sourceforge.net>
> 
> ---
>  drivers/net/usb/usbnet.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)

applied



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-02 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-27  6:48 [PATCH] usbnet: Zero padding byte if there is tail room in skb Peter Korsgaard
2007-07-02 12:25 ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).