From 047c6b0c38aea98e8a7dc79954846a7295a0cf43 Mon Sep 17 00:00:00 2001 From: Hunyue Yau Date: Fri, 7 Dec 2007 19:29:13 -0800 Subject: [PATCH] Fix MUSB DMA for inbound ISO endpoints The DMA receive path in the MUSB driver does not update the fields in the URB for ISO end points (the PIO path does, however). This patch updates the fields in the URB for the DMA path. Drivers using ISO endpoints will not see any valid data without those fields since the USB core initializes them to be zero/error. Tested with on the 2430SDP with a USB bluetooth dongle and SCO audio recording and playback. This implements the ISO URB handling for the DMA rx case by providing the appropriate length and status in the struct usb_iso_packet_descriptor field of the URB. Previously, this was only done in the PIO case. Signed-off-by: Hunyue Yau Signed-off-by: Tony Lindgren --- drivers/usb/musb/musb_host.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index ec32edcf9cb..2ad2ed95404 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -1625,6 +1625,19 @@ void musb_host_rx(struct musb *musb, u8 epnum) } } + if (dma && usb_pipeisoc(pipe)) { + struct usb_iso_packet_descriptor *d; + int iso_stat = status; + + d = urb->iso_frame_desc + qh->iso_idx; + d->actual_length += xfer_len; + if (iso_err) { + iso_stat = -EILSEQ; + urb->error_count++; + } + d->status = iso_stat; + } + finish: urb->actual_length += xfer_len; qh->offset += xfer_len; -- 2.41.1