Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231931
b: refs/heads/master
c: f742aa8
h: refs/heads/master
i:
  231929: 003a67f
  231927: 0fe9df3
v: v3
  • Loading branch information
Alexey Orishko authored and David S. Miller committed Jan 19, 2011
1 parent a922f7b commit 4781aa4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1956cc52e73984a39252994f0beee458fc0d8909
refs/heads/master: f742aa8acb7e50a383f6d2b00b1c52e081970d38
19 changes: 12 additions & 7 deletions trunk/drivers/net/usb/cdc_ncm.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include <linux/usb/usbnet.h>
#include <linux/usb/cdc.h>

#define DRIVER_VERSION "30-Nov-2010"
#define DRIVER_VERSION "17-Jan-2011"

/* CDC NCM subclass 3.2.1 */
#define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10
Expand Down Expand Up @@ -868,15 +868,19 @@ static void cdc_ncm_tx_timeout(unsigned long arg)
if (ctx->tx_timer_pending != 0) {
ctx->tx_timer_pending--;
restart = 1;
} else
} else {
restart = 0;
}

spin_unlock(&ctx->mtx);

if (restart)
if (restart) {
spin_lock(&ctx->mtx);
cdc_ncm_tx_timeout_start(ctx);
else if (ctx->netdev != NULL)
spin_unlock(&ctx->mtx);
} else if (ctx->netdev != NULL) {
usbnet_start_xmit(NULL, ctx->netdev);
}
}

static struct sk_buff *
Expand All @@ -900,14 +904,15 @@ cdc_ncm_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
skb_out = cdc_ncm_fill_tx_frame(ctx, skb);
if (ctx->tx_curr_skb != NULL)
need_timer = 1;
spin_unlock(&ctx->mtx);

/* Start timer, if there is a remaining skb */
if (need_timer)
cdc_ncm_tx_timeout_start(ctx);

if (skb_out)
dev->net->stats.tx_packets += ctx->tx_curr_frame_num;

spin_unlock(&ctx->mtx);
return skb_out;

error:
Expand Down Expand Up @@ -1020,8 +1025,8 @@ static int cdc_ncm_rx_fixup(struct usbnet *dev, struct sk_buff *skb_in)
if (((offset + temp) > actlen) ||
(temp > CDC_NCM_MAX_DATAGRAM_SIZE) || (temp < ETH_HLEN)) {
pr_debug("invalid frame detected (ignored)"
"offset[%u]=%u, length=%u, skb=%p\n",
x, offset, temp, skb_in);
"offset[%u]=%u, length=%u, skb=%p\n",
x, offset, temp, skb_in);
if (!x)
goto error;
break;
Expand Down

0 comments on commit 4781aa4

Please sign in to comment.