Commit dff369aa authored by Antonio Ospite's avatar Antonio Ospite Committed by Mauro Carvalho Chehab

V4L/DVB (9682): gspca: New subdriver parameter 'bulk_nurbs'.

Some webcams with image transfer by bulk messages accept one or many
permanent bulk read.
Signed-off-by: default avatarAntonio Ospite <ospite@studenti.unina.it>
Signed-off-by: default avatarJean-Francois Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6270330a
...@@ -203,6 +203,7 @@ static void bulk_irq(struct urb *urb ...@@ -203,6 +203,7 @@ static void bulk_irq(struct urb *urb
{ {
struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context; struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context;
struct gspca_frame *frame; struct gspca_frame *frame;
int st;
PDEBUG(D_PACK, "bulk irq"); PDEBUG(D_PACK, "bulk irq");
if (!gspca_dev->streaming) if (!gspca_dev->streaming)
...@@ -226,6 +227,13 @@ static void bulk_irq(struct urb *urb ...@@ -226,6 +227,13 @@ static void bulk_irq(struct urb *urb
urb->transfer_buffer, urb->transfer_buffer,
urb->actual_length); 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);
}
} }
/* /*
...@@ -523,11 +531,14 @@ static int create_urbs(struct gspca_dev *gspca_dev, ...@@ -523,11 +531,14 @@ static int create_urbs(struct gspca_dev *gspca_dev,
nurbs = DEF_NURBS; nurbs = DEF_NURBS;
} else { /* bulk */ } else { /* bulk */
npkt = 0; npkt = 0;
bsize = gspca_dev->cam. bulk_size; bsize = gspca_dev->cam.bulk_size;
if (bsize == 0) if (bsize == 0)
bsize = psize; bsize = psize;
PDEBUG(D_STREAM, "bulk bsize:%d", bsize); 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; gspca_dev->nurbs = nurbs;
...@@ -615,8 +626,8 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev) ...@@ -615,8 +626,8 @@ static int gspca_init_transfer(struct gspca_dev *gspca_dev)
gspca_dev->streaming = 1; gspca_dev->streaming = 1;
atomic_set(&gspca_dev->nevent, 0); atomic_set(&gspca_dev->nevent, 0);
/* bulk transfers are started by the subdriver */ /* some bulk transfers are started by the subdriver */
if (gspca_dev->alt == 0) if (gspca_dev->alt == 0 && gspca_dev->cam.bulk_nurbs == 0)
break; break;
/* submit the URBs */ /* submit the URBs */
......
...@@ -58,6 +58,10 @@ struct cam { ...@@ -58,6 +58,10 @@ struct cam {
int bulk_size; /* buffer size when image transfer by bulk */ int bulk_size; /* buffer size when image transfer by bulk */
struct v4l2_pix_format *cam_mode; /* size nmodes */ struct v4l2_pix_format *cam_mode; /* size nmodes */
char 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; __u8 epaddr;
}; };
......
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