The patch number 9873 was added via Jean-Francois Moine <moin...@free.fr>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        v4l-dvb-maintai...@linuxtv.org

------

From: Jim Paris  <j...@jtan.com>
gspca - ov534: Improve payload handling.


Frame data in bulk transfers is separated into 2048-byte payloads.
Each payload has its own header.

Priority: normal

Signed-off-by: Jim Paris <j...@jtan.com>
Signed-off-by: Jean-Francois Moine <moin...@free.fr>


---

 linux/drivers/media/video/gspca/ov534.c |   23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff -r 83c1f38fe6f2 -r 077a7779338a linux/drivers/media/video/gspca/ov534.c
--- a/linux/drivers/media/video/gspca/ov534.c   Wed Dec 10 09:22:32 2008 +0100
+++ b/linux/drivers/media/video/gspca/ov534.c   Wed Dec 10 09:45:14 2008 +0100
@@ -1,6 +1,7 @@
 /*
  * ov534/ov772x gspca driver
  * Copyright (C) 2008 Antonio Ospite <osp...@studenti.unina.it>
+ * Copyright (C) 2008 Jim Paris <j...@jtan.com>
  *
  * Based on a prototype written by Mark Ferrell <majortr...@gmail.com>
  * USB protocol reverse engineered by Jim Paris <j...@jtan.com>
@@ -193,8 +194,8 @@ static const __u8 ov534_reg_initdata[][2
 
        { 0x1c, 0x00 },
        { 0x1d, 0x40 },
-       { 0x1d, 0x02 },
-       { 0x1d, 0x00 },
+       { 0x1d, 0x02 }, /* payload size 0x0200 * 4 = 2048 bytes */
+       { 0x1d, 0x00 }, /* payload size */
        { 0x1d, 0x02 }, /* frame size 0x025800 * 4 = 614400 */
        { 0x1d, 0x58 }, /* frame size */
        { 0x1d, 0x00 }, /* frame size */
@@ -325,7 +326,7 @@ static int sd_config(struct gspca_dev *g
        cam->cam_mode = vga_mode;
        cam->nmodes = ARRAY_SIZE(vga_mode);
 
-       cam->bulk_size = 2048;
+       cam->bulk_size = 16384;
        cam->bulk_nurbs = 2;
 
        return 0;
@@ -402,6 +403,17 @@ static void sd_pkt_scan(struct gspca_dev
        struct sd *sd = (struct sd *) gspca_dev;
        __u32 this_pts;
        int this_fid;
+       int remaining_len = len;
+       __u8 *next_data = data;
+
+scan_next:
+       if (remaining_len <= 0)
+               return;
+
+       data = next_data;
+       len = min(remaining_len, 2048);
+       remaining_len -= len;
+       next_data += len;
 
        /* Payloads are prefixed with a the UVC-style header.  We
           consider a frame to start when the FID toggles, or the PTS
@@ -452,12 +464,13 @@ static void sd_pkt_scan(struct gspca_dev
                gspca_frame_add(gspca_dev, LAST_PACKET, frame, NULL, 0);
        }
 
-       /* Done */
-       return;
+       /* Done this payload */
+       goto scan_next;
 
 discard:
        /* Discard data until a new frame starts. */
        gspca_frame_add(gspca_dev, DISCARD_PACKET, frame, NULL, 0);
+       goto scan_next;
 }
 
 /* sub-driver description */


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/077a7779338afc9037a02fda6d0776a1a782a8a1

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to