From: Elina Pasheva <epasheva@sierrawireless.com>
To: <dbrownell@users.sourceforge.net>
Cc: <epasheva@sierrawireless.com>, <rfiler@sierrawireless.com>,
<netdev@vger.kernel.org>, <linux-usb@vger.kernel.org>
Subject: [PATCH 1/1] NET: usb: Adding URB_ZERO_PACKET flag to usbnet.c
Date: Tue, 6 Apr 2010 17:23:07 -0700 [thread overview]
Message-ID: <1270599787.8900.8.camel@Linuxdev4-laptop> (raw)
Subject: [PATCH 1/1] NET: usb: Adding URB_ZERO_PACKET flag to usbnet.c
From: Elina Pasheva <epasheva@sierrawireless.com>
This patch adds setting of the urb transfer flag URB_ZERO_PACKET before
submitting an urb for drivers that have requested it (by advertising flag
FLAG_SEND_ZLP).
The modification is in usbnet.c function usbnet_start_xmit().
This patch only adds the zero length flag.
A subsequent patch will address the buggy code we found when devices do not
advertise FLAG_SEND_ZLP in which case there is a possibility of transferring
packets with non-deterministic length.
This patch has been tested on kernel-2.6.34-rc3.
This patch has been checked against net-2.6 tree.
Signed-off-by: Elina Pasheva <epasheva@sierrawireless.com>
Signed-off-by: Rory Filer <rfiler@sierrawireless.com>
---
drivers/net/usb/usbnet.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
--- a/drivers/net/usb/usbnet.c 2010-04-06 10:52:54.000000000 -0700
+++ b/drivers/net/usb/usbnet.c 2010-04-06 16:54:44.000000000 -0700
@@ -1068,12 +1068,15 @@ netdev_tx_t usbnet_start_xmit (struct sk
* NOTE: strictly conforming cdc-ether devices should expect
* the ZLP here, but ignore the one-byte packet.
*/
- if (!(info->flags & FLAG_SEND_ZLP) && (length % dev->maxpacket) == 0) {
- urb->transfer_buffer_length++;
- if (skb_tailroom(skb)) {
- skb->data[skb->len] = 0;
- __skb_put(skb, 1);
- }
+ if (length % dev->maxpacket == 0) {
+ if (!(info->flags & FLAG_SEND_ZLP)) {
+ urb->transfer_buffer_length++;
+ if (skb_tailroom(skb)) {
+ skb->data[skb->len] = 0;
+ __skb_put(skb, 1);
+ }
+ } else
+ urb->transfer_flags |= URB_ZERO_PACKET;
}
spin_lock_irqsave(&dev->txq.lock, flags);
next reply other threads:[~2010-04-07 0:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-07 0:23 Elina Pasheva [this message]
2010-04-07 2:50 ` [PATCH 1/1] NET: usb: Adding URB_ZERO_PACKET flag to usbnet.c David Miller
2010-04-07 5:46 ` Maulik
[not found] ` <002801cad615$a352f2a0$808918ac-wD+IZp/g4/2mHdYHvhjUOg@public.gmane.org>
2010-04-07 21:13 ` Elina Pasheva
2010-04-07 21:14 ` David Brownell
[not found] ` <201004071414.33917.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2010-04-07 23:07 ` Elina Pasheva
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1270599787.8900.8.camel@Linuxdev4-laptop \
--to=epasheva@sierrawireless.com \
--cc=dbrownell@users.sourceforge.net \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rfiler@sierrawireless.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).