Commit 5f796752 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Mauro Carvalho Chehab

V4L/DVB (12790): tm6000: check for errors on usb->status

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5c0d0b21
...@@ -163,7 +163,7 @@ static void inline buffer_filled (struct tm6000_core *dev, ...@@ -163,7 +163,7 @@ static void inline buffer_filled (struct tm6000_core *dev,
struct tm6000_buffer *buf) struct tm6000_buffer *buf)
{ {
/* Advice that buffer was filled */ /* Advice that buffer was filled */
dprintk(dev, V4L2_DEBUG_QUEUE, "[%p/%d] wakeup\n",buf,buf->vb.i); dprintk(dev, V4L2_DEBUG_ISOC, "[%p/%d] wakeup\n",buf,buf->vb.i);
buf->vb.state = STATE_DONE; buf->vb.state = STATE_DONE;
buf->vb.field_count++; buf->vb.field_count++;
do_gettimeofday(&buf->vb.ts); do_gettimeofday(&buf->vb.ts);
...@@ -314,7 +314,7 @@ static int copy_multiplexed(u8 *ptr, u8 *out_p, unsigned long len, ...@@ -314,7 +314,7 @@ static int copy_multiplexed(u8 *ptr, u8 *out_p, unsigned long len,
pos=0; pos=0;
/* Announces that a new buffer were filled */ /* Announces that a new buffer were filled */
buffer_filled (dev, *buf); buffer_filled (dev, *buf);
dprintk(dev, V4L2_DEBUG_QUEUE, "new buffer filled\n"); dprintk(dev, V4L2_DEBUG_ISOC, "new buffer filled\n");
rc=get_next_buf (dma_q, buf); rc=get_next_buf (dma_q, buf);
if (rc<=0) { if (rc<=0) {
...@@ -329,24 +329,9 @@ static int copy_multiplexed(u8 *ptr, u8 *out_p, unsigned long len, ...@@ -329,24 +329,9 @@ static int copy_multiplexed(u8 *ptr, u8 *out_p, unsigned long len,
return rc; return rc;
} }
/* static void inline print_err_status (struct tm6000_core *dev,
* Controls the isoc copy of each urb packet int packet, int status)
*/
static inline int tm6000_isoc_copy(struct urb *urb, struct tm6000_buffer **buf)
{ {
struct tm6000_dmaqueue *dma_q = urb->context;
struct tm6000_core *dev= container_of(dma_q,struct tm6000_core,vidq);
void *outp=videobuf_to_vmalloc (&((*buf)->vb));
int i, len=0, rc=1;
int size=(*buf)->vb.size;
char *p;
unsigned long copied;
copied=0;
for (i = 0; i < urb->number_of_packets; i++) {
int status = urb->iso_frame_desc[i].status;
char *errmsg = "Unknown"; char *errmsg = "Unknown";
switch(status) { switch(status) {
...@@ -375,11 +360,43 @@ static inline int tm6000_isoc_copy(struct urb *urb, struct tm6000_buffer **buf) ...@@ -375,11 +360,43 @@ static inline int tm6000_isoc_copy(struct urb *urb, struct tm6000_buffer **buf)
errmsg = "Device does not respond"; errmsg = "Device does not respond";
break; break;
} }
if (packet<0) {
dprintk(dev, V4L2_DEBUG_QUEUE, "URB status %d [%s].\n", dprintk(dev, V4L2_DEBUG_QUEUE, "URB status %d [%s].\n",
status, errmsg); status, errmsg);
} else {
dprintk(dev, V4L2_DEBUG_QUEUE, "URB packet %d, status %d [%s].\n",
packet, status, errmsg);
}
}
if (status<0)
/*
* Controls the isoc copy of each urb packet
*/
static inline int tm6000_isoc_copy(struct urb *urb, struct tm6000_buffer **buf)
{
struct tm6000_dmaqueue *dma_q = urb->context;
struct tm6000_core *dev= container_of(dma_q,struct tm6000_core,vidq);
void *outp=videobuf_to_vmalloc (&((*buf)->vb));
int i, len=0, rc=1;
int size=(*buf)->vb.size;
char *p;
unsigned long copied;
copied=0;
if (urb->status<0) {
print_err_status (dev,-1,urb->status);
return 0;
}
for (i = 0; i < urb->number_of_packets; i++) {
int status = urb->iso_frame_desc[i].status;
if (status<0) {
print_err_status (dev,i,status);
continue; continue;
}
len=urb->iso_frame_desc[i].actual_length; len=urb->iso_frame_desc[i].actual_length;
...@@ -402,7 +419,7 @@ static inline int tm6000_isoc_copy(struct urb *urb, struct tm6000_buffer **buf) ...@@ -402,7 +419,7 @@ static inline int tm6000_isoc_copy(struct urb *urb, struct tm6000_buffer **buf)
if (((*buf)->fmt->fourcc)!=V4L2_PIX_FMT_TM6000) { if (((*buf)->fmt->fourcc)!=V4L2_PIX_FMT_TM6000) {
buffer_filled (dev, *buf); buffer_filled (dev, *buf);
dprintk(dev, V4L2_DEBUG_QUEUE, "new buffer filled\n"); dprintk(dev, V4L2_DEBUG_ISOC, "new buffer filled\n");
} }
return rc; return rc;
......
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