Commit ff374747 authored by Jean-Francois Moine's avatar Jean-Francois Moine Committed by Mauro Carvalho Chehab

V4L/DVB (9545): gspca: Add a flag for empty ISOC packets.

- This flag is needed by some subdrivers as tv8532 for start
  of frame detection.
Signed-off-by: default avatarJean-Francois Moine <moinejf@free.fr>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 8fe2f1d5
...@@ -150,8 +150,11 @@ static void fill_frame(struct gspca_dev *gspca_dev, ...@@ -150,8 +150,11 @@ static void fill_frame(struct gspca_dev *gspca_dev,
/* check the packet status and length */ /* check the packet status and length */
len = urb->iso_frame_desc[i].actual_length; len = urb->iso_frame_desc[i].actual_length;
if (len == 0) if (len == 0) {
if (gspca_dev->empty_packet == 0)
gspca_dev->empty_packet = 1;
continue; continue;
}
st = urb->iso_frame_desc[i].status; st = urb->iso_frame_desc[i].status;
if (st) { if (st) {
PDEBUG(D_ERR, PDEBUG(D_ERR,
...@@ -1858,6 +1861,7 @@ int gspca_dev_probe(struct usb_interface *intf, ...@@ -1858,6 +1861,7 @@ int gspca_dev_probe(struct usb_interface *intf,
gspca_dev->nbalt = intf->num_altsetting; gspca_dev->nbalt = intf->num_altsetting;
gspca_dev->sd_desc = sd_desc; gspca_dev->sd_desc = sd_desc;
gspca_dev->nbufread = 2; gspca_dev->nbufread = 2;
gspca_dev->empty_packet = -1; /* don't check the empty packets */
/* configure the subdriver and initialize the USB device */ /* configure the subdriver and initialize the USB device */
ret = gspca_dev->sd_desc->config(gspca_dev, id); ret = gspca_dev->sd_desc->config(gspca_dev, id);
......
...@@ -142,22 +142,21 @@ struct gspca_dev { ...@@ -142,22 +142,21 @@ struct gspca_dev {
char fr_q; /* next frame to queue */ char fr_q; /* next frame to queue */
char fr_o; /* next frame to dequeue */ char fr_o; /* next frame to dequeue */
signed char fr_queue[GSPCA_MAX_FRAMES]; /* frame queue */ signed char fr_queue[GSPCA_MAX_FRAMES]; /* frame queue */
char last_packet_type; __u8 last_packet_type;
__s8 empty_packet; /* if (-1) don't check empty packets */
__u8 streaming;
__u8 iface; /* USB interface number */
__u8 alt; /* USB alternate setting */
__u8 curr_mode; /* current camera mode */ __u8 curr_mode; /* current camera mode */
__u32 pixfmt; /* current mode parameters */ __u32 pixfmt; /* current mode parameters */
__u16 width; __u16 width;
__u16 height; __u16 height;
__u32 sequence; /* frame sequence number */
atomic_t nevent; /* number of frames done */ atomic_t nevent; /* number of frames done */
wait_queue_head_t wq; /* wait queue */ wait_queue_head_t wq; /* wait queue */
struct mutex usb_lock; /* usb exchange protection */ struct mutex usb_lock; /* usb exchange protection */
struct mutex read_lock; /* read protection */ struct mutex read_lock; /* read protection */
struct mutex queue_lock; /* ISOC queue protection */ struct mutex queue_lock; /* ISOC queue protection */
__u32 sequence; /* frame sequence number */
char streaming;
#ifdef CONFIG_PM #ifdef CONFIG_PM
char frozen; /* suspend - resume */ char frozen; /* suspend - resume */
#endif #endif
...@@ -166,6 +165,8 @@ struct gspca_dev { ...@@ -166,6 +165,8 @@ struct gspca_dev {
char nbufread; /* number of buffers for read() */ char nbufread; /* number of buffers for read() */
char nurbs; /* number of allocated URBs */ char nurbs; /* number of allocated URBs */
char memory; /* memory type (V4L2_MEMORY_xxx) */ char memory; /* memory type (V4L2_MEMORY_xxx) */
__u8 iface; /* USB interface number */
__u8 alt; /* USB alternate setting */
__u8 nbalt; /* number of USB alternate settings */ __u8 nbalt; /* number of USB alternate settings */
}; };
......
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