Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 233839
b: refs/heads/master
c: f5a4532
h: refs/heads/master
i:
  233837: c3b6363
  233835: ed91248
  233831: 992b87a
  233823: 32d182c
v: v3
  • Loading branch information
Rémi Denis-Courmont authored and David S. Miller committed Feb 28, 2011
1 parent 14f37e1 commit 0dc979e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 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: 9eb0e6f26e48ef22cc56a2b81b1572ace999f70f
refs/heads/master: f5a45325284ec10a907b96052ebf2168e7166b5c
15 changes: 10 additions & 5 deletions trunk/drivers/usb/gadget/f_phonet.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,19 @@ static void pn_rx_complete(struct usb_ep *ep, struct usb_request *req)

if (unlikely(!skb))
break;
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page, 0,
req->actual);
page = NULL;

if (req->actual < req->length) { /* Last fragment */
if (skb->len == 0) { /* First fragment */
skb->protocol = htons(ETH_P_PHONET);
skb_reset_mac_header(skb);
pskb_pull(skb, 1);
/* Can't use pskb_pull() on page in IRQ */
memcpy(skb_put(skb, 1), page_address(page), 1);
}

skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
skb->len == 0, req->actual);
page = NULL;

if (req->actual < req->length) { /* Last fragment */
skb->dev = dev;
dev->stats.rx_packets++;
dev->stats.rx_bytes += skb->len;
Expand Down

0 comments on commit 0dc979e

Please sign in to comment.