summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/gspca.h
diff options
context:
space:
mode:
authorJean-Francois Moine <moinejf@free.fr>2008-05-04 06:46:21 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 07:14:40 -0300
commit4aa0d037a6c8e6b37ecfd986a444f83190c32a21 (patch)
tree37ec7366de97498236b82048e7c10e0d6ebe22e2 /drivers/media/video/gspca/gspca.h
parente2997a72ddfafc25bd0c8f1f52bcf41979d5a559 (diff)
V4L/DVB (8154): Fix protection problems in the main driver.
- Protect format change when streaming active. - Protect USB exchanges on close. - Set a timeout in frame wait. - Have only one capture file and free the resources when closing this file. - Simplify the URB buffer. - Don't reset the control values at open time in pac207. - Fix compilation warnings of stk014. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/gspca/gspca.h')
-rw-r--r--drivers/media/video/gspca/gspca.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h
index 3bfb3641cf3..c2618c0e661 100644
--- a/drivers/media/video/gspca/gspca.h
+++ b/drivers/media/video/gspca/gspca.h
@@ -108,11 +108,6 @@ struct sd_desc {
cam_qmnu_op querymenu;
};
-struct gspca_pktbuf {
- char *data;
- struct urb *urb;
-};
-
/* packet types when moving from iso buf to frame buf */
#define DISCARD_PACKET 0
#define FIRST_PACKET 1
@@ -121,19 +116,20 @@ struct gspca_pktbuf {
struct gspca_frame {
unsigned char *data; /* frame buffer */
- unsigned char *data_end; /* current end of frame while filling */
+ unsigned char *data_end; /* end of frame while filling */
int vma_use_count;
struct v4l2_buffer v4l2_buf;
};
struct gspca_dev {
- struct video_device vdev; /* !! must be the first item */
+ struct video_device vdev; /* !! must be the first item */
struct usb_device *dev;
+ struct file *capt_file; /* file doing video capture */
struct cam cam; /* device information */
const struct sd_desc *sd_desc; /* subdriver description */
- struct gspca_pktbuf pktbuf[NURBS];
+ struct urb *urb[NURBS];
__u8 *frbuf; /* buffer for nframes */
struct gspca_frame frame[GSPCA_MAX_FRAMES];
@@ -147,7 +143,7 @@ struct gspca_dev {
__u8 iface; /* USB interface number */
__u8 alt; /* USB alternate setting */
- char curr_mode; /* current camera mode */
+ unsigned char curr_mode; /* current camera mode */
__u32 pixfmt; /* current mode parameters */
short width;
short height;
@@ -158,7 +154,7 @@ struct gspca_dev {
struct mutex read_lock; /* read protection */
struct mutex queue_lock; /* ISOC queue protection */
__u32 sequence; /* frame sequence number */
- signed char streaming;
+ char streaming;
char users; /* # open */
char present; /* device connected */
char nbufread; /* number of buffers for read() */