diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-11-14 11:53:32 +0100 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2008-11-14 11:53:32 +0100 |
commit | a8e1bceccfb5d1b6d69c2bb36a4f6b9b74af14ba (patch) | |
tree | a6efa64d97de2320db6aa5123c61a9bbb3663036 /linux/drivers/media/video/gspca/gspca.c | |
parent | 221e0e602ebce4471e92208e29081124c173af77 (diff) | |
download | mediapointer-dvb-s2-a8e1bceccfb5d1b6d69c2bb36a4f6b9b74af14ba.tar.gz mediapointer-dvb-s2-a8e1bceccfb5d1b6d69c2bb36a4f6b9b74af14ba.tar.bz2 |
gspca: New subdriver parameter 'bulk_nurbs'.
From: Antonio Ospite <ospite@studenti.unina.it>
Some webcams with image transfer by bulk messages accept one or many
permanent bulk read.
Priority: normal
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video/gspca/gspca.c')
-rw-r--r-- | linux/drivers/media/video/gspca/gspca.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c index 7a2006c3e..709b63704 100644 --- a/linux/drivers/media/video/gspca/gspca.c +++ b/linux/drivers/media/video/gspca/gspca.c @@ -213,6 +213,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) @@ -236,6 +237,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); + } } /* @@ -533,11 +541,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; @@ -625,8 +636,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 */ |