diff options
Diffstat (limited to 'drivers/media/video/gspca/gspca.h')
-rw-r--r-- | drivers/media/video/gspca/gspca.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/media/video/gspca/gspca.h b/drivers/media/video/gspca/gspca.h index d25e8d69373b..c90af9cb1e07 100644 --- a/drivers/media/video/gspca/gspca.h +++ b/drivers/media/video/gspca/gspca.h | |||
@@ -56,8 +56,12 @@ extern int gspca_debug; | |||
56 | /* device information - set at probe time */ | 56 | /* device information - set at probe time */ |
57 | struct cam { | 57 | struct cam { |
58 | int bulk_size; /* buffer size when image transfer by bulk */ | 58 | int bulk_size; /* buffer size when image transfer by bulk */ |
59 | struct v4l2_pix_format *cam_mode; /* size nmodes */ | 59 | const struct v4l2_pix_format *cam_mode; /* size nmodes */ |
60 | char nmodes; | 60 | char nmodes; |
61 | __u8 bulk_nurbs; /* number of URBs in bulk mode | ||
62 | * - cannot be > MAX_NURBS | ||
63 | * - when 0 and bulk_size != 0 means | ||
64 | * 1 URB and submit done by subdriver */ | ||
61 | __u8 epaddr; | 65 | __u8 epaddr; |
62 | }; | 66 | }; |
63 | 67 | ||
@@ -70,6 +74,8 @@ typedef void (*cam_v_op) (struct gspca_dev *); | |||
70 | typedef int (*cam_cf_op) (struct gspca_dev *, const struct usb_device_id *); | 74 | typedef int (*cam_cf_op) (struct gspca_dev *, const struct usb_device_id *); |
71 | typedef int (*cam_jpg_op) (struct gspca_dev *, | 75 | typedef int (*cam_jpg_op) (struct gspca_dev *, |
72 | struct v4l2_jpegcompression *); | 76 | struct v4l2_jpegcompression *); |
77 | typedef int (*cam_streamparm_op) (struct gspca_dev *, | ||
78 | struct v4l2_streamparm *); | ||
73 | typedef int (*cam_qmnu_op) (struct gspca_dev *, | 79 | typedef int (*cam_qmnu_op) (struct gspca_dev *, |
74 | struct v4l2_querymenu *); | 80 | struct v4l2_querymenu *); |
75 | typedef void (*cam_pkt_op) (struct gspca_dev *gspca_dev, | 81 | typedef void (*cam_pkt_op) (struct gspca_dev *gspca_dev, |
@@ -102,6 +108,8 @@ struct sd_desc { | |||
102 | cam_jpg_op get_jcomp; | 108 | cam_jpg_op get_jcomp; |
103 | cam_jpg_op set_jcomp; | 109 | cam_jpg_op set_jcomp; |
104 | cam_qmnu_op querymenu; | 110 | cam_qmnu_op querymenu; |
111 | cam_streamparm_op get_streamparm; | ||
112 | cam_streamparm_op set_streamparm; | ||
105 | }; | 113 | }; |
106 | 114 | ||
107 | /* packet types when moving from iso buf to frame buf */ | 115 | /* packet types when moving from iso buf to frame buf */ |
@@ -120,10 +128,9 @@ struct gspca_frame { | |||
120 | }; | 128 | }; |
121 | 129 | ||
122 | struct gspca_dev { | 130 | struct gspca_dev { |
123 | struct video_device *vdev; | 131 | struct video_device vdev; /* !! must be the first item */ |
124 | struct module *module; /* subdriver handling the device */ | 132 | struct module *module; /* subdriver handling the device */ |
125 | struct usb_device *dev; | 133 | struct usb_device *dev; |
126 | struct kref kref; | ||
127 | struct file *capt_file; /* file doing video capture */ | 134 | struct file *capt_file; /* file doing video capture */ |
128 | 135 | ||
129 | struct cam cam; /* device information */ | 136 | struct cam cam; /* device information */ |
@@ -142,22 +149,20 @@ struct gspca_dev { | |||
142 | char fr_q; /* next frame to queue */ | 149 | char fr_q; /* next frame to queue */ |
143 | char fr_o; /* next frame to dequeue */ | 150 | char fr_o; /* next frame to dequeue */ |
144 | signed char fr_queue[GSPCA_MAX_FRAMES]; /* frame queue */ | 151 | signed char fr_queue[GSPCA_MAX_FRAMES]; /* frame queue */ |
145 | char last_packet_type; | 152 | __u8 last_packet_type; |
153 | __s8 empty_packet; /* if (-1) don't check empty packets */ | ||
154 | __u8 streaming; | ||
146 | 155 | ||
147 | __u8 iface; /* USB interface number */ | ||
148 | __u8 alt; /* USB alternate setting */ | ||
149 | __u8 curr_mode; /* current camera mode */ | 156 | __u8 curr_mode; /* current camera mode */ |
150 | __u32 pixfmt; /* current mode parameters */ | 157 | __u32 pixfmt; /* current mode parameters */ |
151 | __u16 width; | 158 | __u16 width; |
152 | __u16 height; | 159 | __u16 height; |
160 | __u32 sequence; /* frame sequence number */ | ||
153 | 161 | ||
154 | atomic_t nevent; /* number of frames done */ | ||
155 | wait_queue_head_t wq; /* wait queue */ | 162 | wait_queue_head_t wq; /* wait queue */ |
156 | struct mutex usb_lock; /* usb exchange protection */ | 163 | struct mutex usb_lock; /* usb exchange protection */ |
157 | struct mutex read_lock; /* read protection */ | 164 | struct mutex read_lock; /* read protection */ |
158 | struct mutex queue_lock; /* ISOC queue protection */ | 165 | struct mutex queue_lock; /* ISOC queue protection */ |
159 | __u32 sequence; /* frame sequence number */ | ||
160 | char streaming; | ||
161 | #ifdef CONFIG_PM | 166 | #ifdef CONFIG_PM |
162 | char frozen; /* suspend - resume */ | 167 | char frozen; /* suspend - resume */ |
163 | #endif | 168 | #endif |
@@ -166,6 +171,8 @@ struct gspca_dev { | |||
166 | char nbufread; /* number of buffers for read() */ | 171 | char nbufread; /* number of buffers for read() */ |
167 | char nurbs; /* number of allocated URBs */ | 172 | char nurbs; /* number of allocated URBs */ |
168 | char memory; /* memory type (V4L2_MEMORY_xxx) */ | 173 | char memory; /* memory type (V4L2_MEMORY_xxx) */ |
174 | __u8 iface; /* USB interface number */ | ||
175 | __u8 alt; /* USB alternate setting */ | ||
169 | __u8 nbalt; /* number of USB alternate settings */ | 176 | __u8 nbalt; /* number of USB alternate settings */ |
170 | }; | 177 | }; |
171 | 178 | ||