Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124230
b: refs/heads/master
c: dff369a
h: refs/heads/master
v: v3
  • Loading branch information
Antonio Ospite authored and Mauro Carvalho Chehab committed Dec 29, 2008
1 parent da6f88a commit 834f2ec
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 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: 6270330abea2d9556583d597bb78d64b291aa6ba
refs/heads/master: dff369aad6407e7b123e239e9ea2f552299cf74c
19 changes: 15 additions & 4 deletions trunk/drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ static void bulk_irq(struct urb *urb
{
struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context;
struct gspca_frame *frame;
int st;

PDEBUG(D_PACK, "bulk irq");
if (!gspca_dev->streaming)
Expand All @@ -226,6 +227,13 @@ static void bulk_irq(struct urb *urb
urb->transfer_buffer,
urb->actual_length);
}

/* resubmit the URB */
if (gspca_dev->cam.bulk_nurbs != 0) {
st = usb_submit_urb(urb, GFP_ATOMIC);
if (st < 0)
PDEBUG(D_ERR|D_PACK, "usb_submit_urb() ret %d", st);
}
}

/*
Expand Down Expand Up @@ -523,11 +531,14 @@ static int create_urbs(struct gspca_dev *gspca_dev,
nurbs = DEF_NURBS;
} else { /* bulk */
npkt = 0;
bsize = gspca_dev->cam. bulk_size;
bsize = gspca_dev->cam.bulk_size;
if (bsize == 0)
bsize = psize;
PDEBUG(D_STREAM, "bulk bsize:%d", bsize);
nurbs = 1;
if (gspca_dev->cam.bulk_nurbs != 0)
nurbs = gspca_dev->cam.bulk_nurbs;
else
nurbs = 1;
}

gspca_dev->nurbs = nurbs;
Expand Down Expand Up @@ -615,8 +626,8 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
gspca_dev->streaming = 1;
atomic_set(&gspca_dev->nevent, 0);

/* bulk transfers are started by the subdriver */
if (gspca_dev->alt == 0)
/* some bulk transfers are started by the subdriver */
if (gspca_dev->alt == 0 && gspca_dev->cam.bulk_nurbs == 0)
break;

/* submit the URBs */
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/media/video/gspca/gspca.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ struct cam {
int bulk_size; /* buffer size when image transfer by bulk */
struct v4l2_pix_format *cam_mode; /* size nmodes */
char nmodes;
__u8 bulk_nurbs; /* number of URBs in bulk mode
* - cannot be > MAX_NURBS
* - when 0 and bulk_size != 0 means
* 1 URB and submit done by subdriver */
__u8 epaddr;
};

Expand Down

0 comments on commit 834f2ec

Please sign in to comment.