Commit bf846f93 authored by Simon Evans's avatar Simon Evans Committed by Greg Kroah-Hartman

[PATCH] fix urb->next removal in usbvideo

This patch removes the use of urb->next in usbvideo.c and resubmits
the URB in the completion handler.
parent cc324568
...@@ -1802,7 +1802,7 @@ static int usbvideo_CompressIsochronous(uvd_t *uvd, struct urb *urb) ...@@ -1802,7 +1802,7 @@ static int usbvideo_CompressIsochronous(uvd_t *uvd, struct urb *urb)
static void usbvideo_IsocIrq(struct urb *urb) static void usbvideo_IsocIrq(struct urb *urb)
{ {
int i, len; int i, ret, len;
uvd_t *uvd = urb->context; uvd_t *uvd = urb->context;
/* We don't want to do anything if we are about to be removed! */ /* We don't want to do anything if we are about to be removed! */
...@@ -1844,6 +1844,11 @@ static void usbvideo_IsocIrq(struct urb *urb) ...@@ -1844,6 +1844,11 @@ static void usbvideo_IsocIrq(struct urb *urb)
urb->iso_frame_desc[i].status = 0; urb->iso_frame_desc[i].status = 0;
urb->iso_frame_desc[i].actual_length = 0; urb->iso_frame_desc[i].actual_length = 0;
} }
urb->status = 0;
urb->dev = uvd->dev;
ret = usb_submit_urb (urb, GFP_KERNEL);
if(ret)
err("usb_submit_urb error (%d)", ret);
return; return;
} }
...@@ -1889,6 +1894,7 @@ static int usbvideo_StartDataPump(uvd_t *uvd) ...@@ -1889,6 +1894,7 @@ static int usbvideo_StartDataPump(uvd_t *uvd)
urb->dev = dev; urb->dev = dev;
urb->context = uvd; urb->context = uvd;
urb->pipe = usb_rcvisocpipe(dev, uvd->video_endp); urb->pipe = usb_rcvisocpipe(dev, uvd->video_endp);
urb->interval = 1;
urb->transfer_flags = USB_ISO_ASAP; urb->transfer_flags = USB_ISO_ASAP;
urb->transfer_buffer = uvd->sbuf[i].data; urb->transfer_buffer = uvd->sbuf[i].data;
urb->complete = usbvideo_IsocIrq; urb->complete = usbvideo_IsocIrq;
...@@ -1900,14 +1906,6 @@ static int usbvideo_StartDataPump(uvd_t *uvd) ...@@ -1900,14 +1906,6 @@ static int usbvideo_StartDataPump(uvd_t *uvd)
} }
} }
/* Link URBs into a ring so that they invoke each other infinitely */
for (i=0; i < USBVIDEO_NUMSBUF; i++) {
if ((i+1) < USBVIDEO_NUMSBUF)
uvd->sbuf[i].urb->next = uvd->sbuf[i+1].urb;
else
uvd->sbuf[i].urb->next = uvd->sbuf[0].urb;
}
/* Submit all URBs */ /* Submit all URBs */
for (i=0; i < USBVIDEO_NUMSBUF; i++) { for (i=0; i < USBVIDEO_NUMSBUF; i++) {
errFlag = usb_submit_urb(uvd->sbuf[i].urb, GFP_KERNEL); errFlag = usb_submit_urb(uvd->sbuf[i].urb, GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment