summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorElina Pasheva <epasheva@sierrawireless.com>2010-04-06 16:23:07 +0200
committerDavid S. Miller <davem@davemloft.net>2010-04-07 04:50:22 +0200
commitb4d562e3c3553ac58c7120555c4e4aefbb090a2a (patch)
tree57399d164d3882f0f19080c0cd0014d039af6109 /drivers/net/usb
parentnet/irda: Add SuperH IrDA driver support (diff)
downloadlinux-b4d562e3c3553ac58c7120555c4e4aefbb090a2a.tar.xz
linux-b4d562e3c3553ac58c7120555c4e4aefbb090a2a.zip
NET: usb: Adding URB_ZERO_PACKET flag to usbnet.c
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/usbnet.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 17b6a62d206e..c0f64392627c 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1068,12 +1068,15 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
* 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);