diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-07 11:17:34 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-07 11:17:34 +0200 |
commit | b7a4abb67416aa07cd65446dd39e64525ccfe8e5 (patch) | |
tree | 8f5b0f9ffb617622944b5e6368473f91e3efeaa4 /drivers/net/usb/usbnet.c | |
parent | d30323f810e4da94eb75cf4bfe5165b9518c64df (diff) | |
parent | f22e6e847115abc3a0e2ad7bb18d243d42275af1 (diff) | |
download | blackbird-op-linux-b7a4abb67416aa07cd65446dd39e64525ccfe8e5.tar.gz blackbird-op-linux-b7a4abb67416aa07cd65446dd39e64525ccfe8e5.zip |
Merge 4.0-rc7 into usb-next
We want the fixes in here, and to help resolve merge issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/usb/usbnet.c')
-rw-r--r-- | drivers/net/usb/usbnet.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 449835f4331e..777757ae1973 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1188,8 +1188,7 @@ static void tx_complete (struct urb *urb) struct usbnet *dev = entry->dev; if (urb->status == 0) { - if (!(dev->driver_info->flags & FLAG_MULTI_PACKET)) - dev->net->stats.tx_packets++; + dev->net->stats.tx_packets += entry->packets; dev->net->stats.tx_bytes += entry->length; } else { dev->net->stats.tx_errors++; @@ -1347,7 +1346,19 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, } else urb->transfer_flags |= URB_ZERO_PACKET; } - entry->length = urb->transfer_buffer_length = length; + urb->transfer_buffer_length = length; + + if (info->flags & FLAG_MULTI_PACKET) { + /* Driver has set number of packets and a length delta. + * Calculate the complete length and ensure that it's + * positive. + */ + entry->length += length; + if (WARN_ON_ONCE(entry->length <= 0)) + entry->length = length; + } else { + usbnet_set_skb_tx_stats(skb, 1, length); + } spin_lock_irqsave(&dev->txq.lock, flags); retval = usb_autopm_get_interface_async(dev->intf); |