Skip to content

Commit

Permalink
dwc_otg: fix summarize urb->actual_length for isochronous transfers
Browse files Browse the repository at this point in the history
Kernel does not copy input data of ISO transfers to userspace
if actual_length is set only in ISO transfers and not summarized
in urb->actual_length. Fixes #903
  • Loading branch information
mcerveny authored and popcornmix committed Feb 13, 2017
1 parent 5ec2891 commit d01e28d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,12 @@ static int _complete(dwc_otg_hcd_t * hcd, void *urb_handle,
int i;

urb->error_count = dwc_otg_hcd_urb_get_error_count(dwc_otg_urb);
urb->actual_length = 0;
for (i = 0; i < urb->number_of_packets; ++i) {
urb->iso_frame_desc[i].actual_length =
dwc_otg_hcd_urb_get_iso_desc_actual_length
(dwc_otg_urb, i);
urb->actual_length += urb->iso_frame_desc[i].actual_length;
urb->iso_frame_desc[i].status =
dwc_otg_hcd_urb_get_iso_desc_status(dwc_otg_urb, i);
}
Expand Down

0 comments on commit d01e28d

Please sign in to comment.