Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235349
b: refs/heads/master
c: 10408bb
h: refs/heads/master
i:
  235347: be53da7
v: v3
  • Loading branch information
Rémi Denis-Courmont authored and Greg Kroah-Hartman committed Feb 25, 2011
1 parent fa76aac commit 6f148c5
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: 18f53461e786f21e5625124b507802a797337f6f
refs/heads/master: 10408bb9c4bf669f56f8de380f3ce18ef601a3d4
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 6f148c5

Please sign in to comment.