xref: /openbsd/sys/dev/usb/uvideo.h (revision c200fde7)
1*c200fde7Smglocker /*	$OpenBSD: uvideo.h,v 1.2 2008/04/09 20:38:55 mglocker Exp $ */
2*c200fde7Smglocker 
3cf110a4aSrobert /*
4cf110a4aSrobert  * Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
5cf110a4aSrobert  * Copyright (c) 2008 Marcus Glocker <mglocker@openbsd.org>
6cf110a4aSrobert  *
7cf110a4aSrobert  * Permission to use, copy, modify, and distribute this software for any
8cf110a4aSrobert  * purpose with or without fee is hereby granted, provided that the above
9cf110a4aSrobert  * copyright notice and this permission notice appear in all copies.
10cf110a4aSrobert  *
11cf110a4aSrobert  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12cf110a4aSrobert  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13cf110a4aSrobert  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14cf110a4aSrobert  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15cf110a4aSrobert  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16cf110a4aSrobert  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17cf110a4aSrobert  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18cf110a4aSrobert  */
19cf110a4aSrobert 
20cf110a4aSrobert #include <sys/videoio.h>
21cf110a4aSrobert 
22cf110a4aSrobert /*
23cf110a4aSrobert  * USB Video Class
24cf110a4aSrobert  */
25cf110a4aSrobert /* Table A-7: Video Class-Specific Endpoint Descriptor Subtypes */
26cf110a4aSrobert #define	EP_UNDEFINED					0x00
27cf110a4aSrobert #define EP_GENERAL					0x01
28cf110a4aSrobert #define EP_ENDPOINT					0x02
29cf110a4aSrobert #define EP_INTERRUPT					0x03
30cf110a4aSrobert 
31cf110a4aSrobert /* Table A-5: Video Class-Specific VC Interface Descriptor Subtypes */
32cf110a4aSrobert #define	UDESCSUB_VC_DESCRIPTOR_UNDEFINED		0x00
33cf110a4aSrobert #define UDESCSUB_VC_HEADER				0x01
34cf110a4aSrobert #define UDESCSUB_VC_INPUT_TERMINAL			0x02
35cf110a4aSrobert #define UDESCSUB_VC_OUTPUT_TERMINAL			0x03
36cf110a4aSrobert #define UDESCSUB_VC_SELECTOR_UNIT			0x04
37cf110a4aSrobert #define UDESCSUB_VC_PROCESSING_UNIT			0x05
38cf110a4aSrobert #define UDESCSUB_VC_EXTENSION_UNIT			0x06
39cf110a4aSrobert 
40cf110a4aSrobert /* Table A-6: Video Class-Specific VS Interface Descriptor Subtypes */
41cf110a4aSrobert #define	UDESCSUB_VS_UNDEFINED				0x00
42cf110a4aSrobert #define UDESCSUB_VS_INPUT_HEADER			0x01
43cf110a4aSrobert #define UDESCSUB_VS_OUTPUT_HEADER			0x02
44cf110a4aSrobert #define UDESCSUB_VS_STILL_IMAGE_FRAME			0x03
45cf110a4aSrobert #define UDESCSUB_VS_FORMAT_UNCOMPRESSED			0x04
46cf110a4aSrobert #define UDESCSUB_VS_FRAME_UNCOMPRESSED			0x05
47cf110a4aSrobert #define UDESCSUB_VS_FORMAT_MJPEG			0x06
48cf110a4aSrobert #define UDESCSUB_VS_FRAME_MJPEG				0x07
49cf110a4aSrobert #define UDESCSUB_VS_FORMAT_MPEG2TS			0x0a
50cf110a4aSrobert #define UDESCSUB_VS_FORMAT_DV				0x0c
51cf110a4aSrobert #define UDESCSUB_VS_COLORFORMAT				0x0d
52cf110a4aSrobert #define UDESCSUB_VS_FORMAT_FRAME_BASED			0x10
53cf110a4aSrobert #define UDESCSUB_VS_FRAME_FRAME_BASED			0x11
54cf110a4aSrobert #define UDESCSUB_VS_FORMAT_STREAM_BASED			0x12
55cf110a4aSrobert 
56cf110a4aSrobert /* Table A-8: Video Class-Specific Request Codes */
57cf110a4aSrobert #define RC_UNDEFINED					0x00
58cf110a4aSrobert #define SET_CUR						0x01
59cf110a4aSrobert #define GET_CUR						0x81
60cf110a4aSrobert #define GET_MIN						0x82
61cf110a4aSrobert #define GET_MAX						0x83
62cf110a4aSrobert #define GET_RES						0x84
63cf110a4aSrobert #define GET_LEN						0x85
64cf110a4aSrobert #define GET_INFO					0x86
65cf110a4aSrobert #define GET_DEF						0x87
66cf110a4aSrobert 
67cf110a4aSrobert /* Table A-9: Video Control Interface Control Selectors */
68cf110a4aSrobert #define VC_CONTROL_UNDEFINED				0x00
69cf110a4aSrobert #define VC_VIDEO_POWER_MODE_CONTROL			0x01
70cf110a4aSrobert #define VC_REQUEST_ERROR_CODE_CONTROL			0x02
71cf110a4aSrobert 
72cf110a4aSrobert /* Table A-11: Selector Unit Control Selectors */
73cf110a4aSrobert #define	SU_CONTROL_UNDEFINED				0x00
74cf110a4aSrobert #define	SU_INPUT_SELECT_CONTROL 			0x01
75cf110a4aSrobert 
76cf110a4aSrobert /* Table A-12: Camera Terminal Control Selectors */
77cf110a4aSrobert #define	CT_CONTROL_UNDEFINED				0x00
78cf110a4aSrobert #define	CT_SCANNING_MODE_CONTROL			0x01
79cf110a4aSrobert #define	CT_AE_MODE_CONTROL				0x02
80cf110a4aSrobert #define	CT_AE_PRIORITY_CONTROL				0x03
81cf110a4aSrobert #define	CT_EXPOSURE_TIME_ABSOLUTE_CONTROL		0x04
82cf110a4aSrobert #define	CT_EXPOSURE_TIME_RELATIVE_CONTROL		0x05
83cf110a4aSrobert #define	CT_FOCUS_ABSOLUTE_CONTROL			0x06
84cf110a4aSrobert #define	CT_FOCUS_RELATIVE_CONTROL			0x07
85cf110a4aSrobert #define	CT_FOCUS_AUTO_CONTROL				0x08
86cf110a4aSrobert #define	CT_IRIS_ABSOLUTE_CONTROL			0x09
87cf110a4aSrobert #define	CT_IRIS_RELATIVE_CONTROL			0x0a
88cf110a4aSrobert #define	CT_ZOOM_ABSOLUTE_CONTROL			0x0b
89cf110a4aSrobert #define	CT_ZOOM_RELATIVE_CONTROL			0x0c
90cf110a4aSrobert #define	CT_PANTILT_ABSOLUTE_CONTROL			0x0d
91cf110a4aSrobert #define	CT_PANTILT_RELATIVE_CONTROL			0x0e
92cf110a4aSrobert #define	CT_ROLL_ABSOLUTE_CONTROL			0x0f
93cf110a4aSrobert #define	CT_ROLL_RELATIVE_CONTROL			0x10
94cf110a4aSrobert #define	CT_PRIVACY_CONTROL				0x11
95cf110a4aSrobert 
96cf110a4aSrobert /* Table A-13: Processing Unit Control Selectors */
97cf110a4aSrobert #define	PU_CONTROL_UNDEFINED				0x00
98cf110a4aSrobert #define	PU_BACKLIGHT_COMPENSATION_CONTROL		0x01
99cf110a4aSrobert #define	PU_BRIGHTNESS_CONTROL				0x02
100cf110a4aSrobert #define	PU_CONTRAST_CONTROL				0x03
101cf110a4aSrobert #define	PU_GAIN_CONTROL 				0x04
102cf110a4aSrobert #define	PU_POWER_LINE_FREQUENCY_CONTROL 		0x05
103cf110a4aSrobert #define	PU_HUE_CONTROL					0x06
104cf110a4aSrobert #define	PU_SATURATION_CONTROL				0x07
105cf110a4aSrobert #define	PU_SHARPNESS_CONTROL				0x08
106cf110a4aSrobert #define	PU_GAMMA_CONTROL				0x09
107cf110a4aSrobert #define	PU_WHITE_BALANCE_TEMPERATURE_CONTROL		0x0a
108cf110a4aSrobert #define	PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL	0x0b
109cf110a4aSrobert #define	PU_WHITE_BALANCE_COMPONENT_CONTROL		0x0c
110cf110a4aSrobert #define	PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 	0x0d
111cf110a4aSrobert #define	PU_DIGITAL_MULTIPLIER_CONTROL			0x0e
112cf110a4aSrobert #define	PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL		0x0f
113cf110a4aSrobert #define	PU_HUE_AUTO_CONTROL				0x10
114cf110a4aSrobert #define	PU_ANALOG_VIDEO_STANDARD_CONTROL		0x11
115cf110a4aSrobert #define	PU_ANALOG_LOCK_STATUS_CONTROL			0x12
116cf110a4aSrobert 
117cf110a4aSrobert /* Table A-15: VideoStreaming Interface Control Selectors */
118cf110a4aSrobert #define	VS_CONTROL_UNDEFINED				0x00
119cf110a4aSrobert #define	VS_PROBE_CONTROL				0x01
120cf110a4aSrobert #define	VS_COMMIT_CONTROL				0x02
121cf110a4aSrobert #define	VS_STILL_PROBE_CONTROL				0x03
122cf110a4aSrobert #define	VS_STILL_COMMIT_CONTROL 			0x04
123cf110a4aSrobert #define	VS_STILL_IMAGE_TRIGGER_CONTROL			0x05
124cf110a4aSrobert #define	VS_STREAM_ERROR_CODE_CONTROL			0x06
125cf110a4aSrobert #define	VS_GENERATE_KEY_FRAME_CONTROL			0x07
126cf110a4aSrobert #define	VS_UPDATE_FRAME_SEGMENT_CONTROL			0x08
127cf110a4aSrobert #define	VS_SYNC_DELAY_CONTROL				0x09
128cf110a4aSrobert 
129cf110a4aSrobert /* probe commit bmRequests */
130cf110a4aSrobert #define	UVIDEO_SET_IF					0x21
131cf110a4aSrobert #define	UVIDEO_GET_IF					0xa1
132cf110a4aSrobert #define	UVIDEO_SET_EP					0x22
133cf110a4aSrobert #define	UVIDEO_GET_EP					0xa2
134cf110a4aSrobert 
135cf110a4aSrobert /* Table B-1: USB Terminal Types */
136cf110a4aSrobert #define	TT_VENDOR_SPECIFIC				0x0100
137cf110a4aSrobert #define	TT_STREAMING					0x0101
138cf110a4aSrobert 
139cf110a4aSrobert /* Table B-2: Input Terminal Types */
140cf110a4aSrobert #define	ITT_VENDOR_SPECIFIC				0x0200
141cf110a4aSrobert #define	ITT_CAMERA					0x0201
142cf110a4aSrobert #define	ITT_MEDIA_TRANSPORT_INPUT			0x0202
143cf110a4aSrobert 
144cf110a4aSrobert /* Table B-3: Output Terminal Types */
145cf110a4aSrobert #define	OTT_VENDOR_SPECIFIC				0x0300
146cf110a4aSrobert #define	OTT_DISPLAY					0x0301
147cf110a4aSrobert #define	OTT_MEDIA_TRANSPORT_OUTPUT			0x0302
148cf110a4aSrobert 
149cf110a4aSrobert /* Table B-4: External Terminal Types */
150cf110a4aSrobert #define	EXTERNAL_VENDOR_SPECIFIC			0x0400
151cf110a4aSrobert #define	COMPOSITE_CONNECTOR				0x0401
152cf110a4aSrobert #define	SVIDEO_CONNECTOR				0x0402
153cf110a4aSrobert #define	COMPONENT_CONNECTOR				0x0403
154cf110a4aSrobert 
155cf110a4aSrobert /* Table 3-3: VC Interface Header Descriptor */
156cf110a4aSrobert struct usb_video_header_descriptor {
157cf110a4aSrobert 	uByte	bLength;
158cf110a4aSrobert 	uByte	bDescriptorType;
159cf110a4aSrobert 	uByte	bDescriptorSubtype;
160cf110a4aSrobert 	uWord	bcdUVC;
161cf110a4aSrobert 	uWord	wTotalLength;
162cf110a4aSrobert 	uDWord	dwClockFrequency; /* XXX deprecated */
163cf110a4aSrobert 	uByte	bInCollection;
164cf110a4aSrobert };
165cf110a4aSrobert 
166cf110a4aSrobert struct usb_video_control {
167cf110a4aSrobert 	struct usb_video_header_descriptor	*descr;
168cf110a4aSrobert 	uByte					*baInterfaceNr;
169cf110a4aSrobert };
170cf110a4aSrobert 
171cf110a4aSrobert struct usb_video_header_desc {
172cf110a4aSrobert 	uByte	bLength;
173cf110a4aSrobert 	uByte	bDescriptorType;
174cf110a4aSrobert 	uByte	bDescriptorSubtype;
175cf110a4aSrobert 	uWord	bcdUVC;
176cf110a4aSrobert 	uWord	wTotalLength;
177cf110a4aSrobert 	uDWord	dwClockFrequency; /* XXX deprecated */
178cf110a4aSrobert 	uByte	bInCollection;
179cf110a4aSrobert 	uByte	baInterfaceNr;
180cf110a4aSrobert };
181cf110a4aSrobert 
182cf110a4aSrobert /* Table 3-4: Input Terminal Descriptor */
183cf110a4aSrobert struct usb_video_input_terminal_desc {
184cf110a4aSrobert 	uByte	bLength;
185cf110a4aSrobert 	uByte	bDescriptorType;
186cf110a4aSrobert 	uByte	bDescriptorSubtype;
187cf110a4aSrobert 	uByte	bTerminalID;
188cf110a4aSrobert 	uWord	wTerminalType;
189cf110a4aSrobert 	uByte	bAssocTerminal;
190cf110a4aSrobert 	uByte	iTerminal;
191cf110a4aSrobert };
192cf110a4aSrobert 
193cf110a4aSrobert /* Table 3-5: Output Terminal Descriptor */
194cf110a4aSrobert struct usb_video_output_terminal_desc {
195cf110a4aSrobert 	uByte	bLength;
196cf110a4aSrobert 	uByte	bDescriptorType;
197cf110a4aSrobert 	uByte	bDescriptorSubtype;
198cf110a4aSrobert 	uByte	bTerminalID;
199cf110a4aSrobert 	uWord	wTerminalType;
200cf110a4aSrobert 	uByte	bAssocTerminal;
201cf110a4aSrobert 	uByte	bSourceID;
202cf110a4aSrobert 	uByte	iTerminal;
203cf110a4aSrobert };
204cf110a4aSrobert 
205cf110a4aSrobert /* Table 3-6: Camera Terminal Descriptor */
206cf110a4aSrobert struct usb_video_camera_terminal_desc {
207cf110a4aSrobert 	uByte	bLength;
208cf110a4aSrobert 	uByte	bDescriptorType;
209cf110a4aSrobert 	uByte	bDescriptorSubtype;
210cf110a4aSrobert 	uByte	bTerminalID;
211cf110a4aSrobert 	uWord	wTerminalType;
212cf110a4aSrobert 	uByte	bAssocTerminal;
213cf110a4aSrobert 	uByte	iTerminal;
214cf110a4aSrobert 	uWord	wObjectiveFocalLengthMin;
215cf110a4aSrobert 	uWord	wObjectiveFocalLengthMax;
216cf110a4aSrobert 	uWord	wOcularFocalLength;
217cf110a4aSrobert 	uByte	bControlSize;
218cf110a4aSrobert 	uByte	*bmControls; /* XXX */
219cf110a4aSrobert };
220cf110a4aSrobert 
221cf110a4aSrobert /* Table 3-11: VC Endpoint Descriptor */
222cf110a4aSrobert struct usb_video_vc_endpoint_desc {
223cf110a4aSrobert 	uByte	bLength;
224cf110a4aSrobert 	uByte	bDescriptorType;
225cf110a4aSrobert 	uByte	bDescriptorSubtype;
226cf110a4aSrobert 	uWord	wMaxTransferSize;
227cf110a4aSrobert };
228cf110a4aSrobert 
229cf110a4aSrobert /* Table 3-18: Color Matching Descriptor */
230cf110a4aSrobert struct usb_video_color_matching_descr {
231cf110a4aSrobert 	uByte	bLength;
232cf110a4aSrobert 	uByte	bDescriptorType;
233cf110a4aSrobert 	uByte	bDescriptorSubtype;
234cf110a4aSrobert 	uByte	bColorPrimaries;
235cf110a4aSrobert 	uByte	bTransferCharacteristics;
236cf110a4aSrobert 	uByte	bMatrixCoefficients;
237cf110a4aSrobert } __packed;
238cf110a4aSrobert 
239cf110a4aSrobert /* Table 4-47: Video Probe and Commit Controls */
240cf110a4aSrobert struct usb_video_probe_commit {
241cf110a4aSrobert 	uByte	bmHint[2];
242cf110a4aSrobert 	uByte	bFormatIndex;
243cf110a4aSrobert 	uByte	bFrameIndex;
244cf110a4aSrobert 	uByte	dwFrameInterval[4];
245cf110a4aSrobert 	uByte	wKeyFrameRate[2];
246cf110a4aSrobert 	uByte	wPFrameRate[2];
247cf110a4aSrobert 	uByte	wCompQuality[2];
248cf110a4aSrobert 	uByte	wCompWindowSize[2];
249cf110a4aSrobert 	uByte	wDelay[2];
250cf110a4aSrobert 	uByte	dwMaxVideoFrameSize[4];
251cf110a4aSrobert 	uByte	dwMaxPayloadTransferSize[4];
252cf110a4aSrobert 	uByte	wClockFrequency[4];
253cf110a4aSrobert 	uByte	bmFramingInfo;
254cf110a4aSrobert 	uByte	bPreferedVersion;
255cf110a4aSrobert 	uByte	bMinVersion;
256cf110a4aSrobert 	uByte	bMaxVersion;
257cf110a4aSrobert } __packed;
258cf110a4aSrobert 
259cf110a4aSrobert /*
260cf110a4aSrobert  * USB Video Payload Uncompressed
261cf110a4aSrobert  */
262cf110a4aSrobert /* Table 2-1: Compression Formats */
263cf110a4aSrobert #define	UVIDEO_FORMAT_GUID_YUY2	{			\
264cf110a4aSrobert     0x59, 0x55, 0x59, 0x32, 0x00, 0x00, 0x10, 0x00,	\
265cf110a4aSrobert     0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 }
266cf110a4aSrobert 
267cf110a4aSrobert #define	UVIDEO_FORMAT_GUID_NV12	{			\
268cf110a4aSrobert     0x4e, 0x56, 0x31, 0x32, 0x00, 0x00, 0x10, 0x00,	\
269cf110a4aSrobert     0x80, 0x00, 0x00, 0xaa, 0x00, 0x38,	0x9b, 0x71 }
270cf110a4aSrobert 
271cf110a4aSrobert /*
272cf110a4aSrobert  * USB Video Payload MJPEG
273cf110a4aSrobert  */
274cf110a4aSrobert /* Table 2-1: Stream Header Format for the Motion-JPEG */
275cf110a4aSrobert #define	UVIDEO_STREAM_FID	(1 << 0)
276cf110a4aSrobert #define	UVIDEO_STREAM_EOF	(1 << 1)
277cf110a4aSrobert #define	UVIDEO_STREAM_PTS	(1 << 2)
278cf110a4aSrobert #define	UVIDEO_STREAM_SCR	(1 << 3)
279cf110a4aSrobert #define	UVIDEO_STREAM_RES	(1 << 4)
280cf110a4aSrobert #define	UVIDEO_STREAM_STI	(1 << 5)
281cf110a4aSrobert #define	UVIDEO_STREAM_ERR	(1 << 6)
282cf110a4aSrobert #define	UVIDEO_STREAM_EOH	(1 << 7)
283cf110a4aSrobert 
284cf110a4aSrobert /* Table 3-1: Motion-JPEG Video Format Descriptor */
285cf110a4aSrobert struct usb_video_format_mjpeg_descriptor {
286cf110a4aSrobert 	uByte	bLength;
287cf110a4aSrobert 	uByte	bDescriptorType;
288cf110a4aSrobert 	uByte	bDescriptorSubtype;
289cf110a4aSrobert 	uByte	bFormatIndex;
290cf110a4aSrobert 	uByte	bNumFrameDescriptors;
291cf110a4aSrobert 	uByte	bmFlags;
292cf110a4aSrobert 	uByte	bDefaultFrameIndex;
293cf110a4aSrobert 	uByte	bAspectRatioX;
294cf110a4aSrobert 	uByte	bAspectRatioY;
295cf110a4aSrobert 	uByte	bmInterlaceFlags;
296cf110a4aSrobert 	uByte	bCopyProtect;
297cf110a4aSrobert } __packed;
298cf110a4aSrobert 
299cf110a4aSrobert /* Table 3-2: Motion-JPEG Video Frame Descriptor */
300cf110a4aSrobert struct usb_video_frame_descriptor {
301cf110a4aSrobert 	uByte	bLength;
302cf110a4aSrobert 	uByte	bDescriptorType;
303cf110a4aSrobert 	uByte	bDescriptorSubtype;
304cf110a4aSrobert 	uByte	bFrameIndex;
305cf110a4aSrobert 	uByte	bmCapabilities;
306cf110a4aSrobert 	uWord	wWidth;
307cf110a4aSrobert 	uWord	wHeight;
308cf110a4aSrobert 	uDWord	dwMinBitRate;
309cf110a4aSrobert 	uDWord	dwMaxBitRate;
310cf110a4aSrobert 	uDWord	dwMaxVideoFrameBufferSize;
311cf110a4aSrobert 	uWord	dwDefaultFrameInterval;
312cf110a4aSrobert 	uByte	bFrameIntervalType;
313cf110a4aSrobert } __packed;
314cf110a4aSrobert 
315cf110a4aSrobert /*
316cf110a4aSrobert  * Driver specific private definitions.
317cf110a4aSrobert  */
318cf110a4aSrobert #define UVIDEO_NFRAMES		10 /* XXX calculate right value */
319cf110a4aSrobert 
320cf110a4aSrobert struct uvideo_stream_if {
321cf110a4aSrobert 	struct uvideo_softc	*sc;
322cf110a4aSrobert 	usbd_xfer_handle	 xfer;
323cf110a4aSrobert 	void			*buf;
324cf110a4aSrobert 	int			 busy;
325cf110a4aSrobert 	int			 numalts;
326cf110a4aSrobert 	usbd_interface_handle  	 in_ifaceh;
327cf110a4aSrobert 	usbd_pipe_handle	 in_pipeh;
328cf110a4aSrobert 	int			 endpoint;
329cf110a4aSrobert 	u_int16_t		 size[UVIDEO_NFRAMES];
330cf110a4aSrobert 
331cf110a4aSrobert 	u_int8_t		 fmtgrp_cnt;
332cf110a4aSrobert 
333cf110a4aSrobert 	usbd_interface_handle	 ifaceh;
334cf110a4aSrobert 	usbd_interface_handle	*if_descr;
335cf110a4aSrobert 	int			 curr_alt;
336cf110a4aSrobert 	u_int32_t		 max_isoc_payload;
337cf110a4aSrobert 
338cf110a4aSrobert 	char			 start_polling;
339cf110a4aSrobert 	char			 fid;
340cf110a4aSrobert };
341cf110a4aSrobert 
342cf110a4aSrobert struct uvideo_sample_buffer {
343cf110a4aSrobert 	int		 fragment;
344cf110a4aSrobert 	uint8_t		 fid;
345cf110a4aSrobert 	int		 offset;
346cf110a4aSrobert 	uint8_t		*buf;
347cf110a4aSrobert };
348cf110a4aSrobert 
349cf110a4aSrobert struct uvideo_softc {
350cf110a4aSrobert 	struct device				 sc_dev;
351cf110a4aSrobert 	usbd_device_handle			 sc_udev;
352cf110a4aSrobert 	usbd_interface_handle			 sc_iface;
353cf110a4aSrobert 	int					 sc_iface_number;
354cf110a4aSrobert 	int					 sc_product;
355cf110a4aSrobert 	int					 sc_vendor;
356cf110a4aSrobert 
357cf110a4aSrobert 	int					 sc_intr_number;
358cf110a4aSrobert 	usbd_pipe_handle			 sc_intr_pipe;
359cf110a4aSrobert 	u_char					*sc_ibuf;
360cf110a4aSrobert 	int					 sc_isize;
361cf110a4aSrobert 	int					 sc_vc_iface;
362cf110a4aSrobert 
363cf110a4aSrobert 	struct device				*sc_videodev;
364cf110a4aSrobert 
365cf110a4aSrobert 	struct vs_info				*sc_alts;
366cf110a4aSrobert 	int					 sc_nalts;
367cf110a4aSrobert 	int					 sc_nullalt;
368cf110a4aSrobert 	int					 sc_video_rev;
369cf110a4aSrobert 	int					 sc_enabled;
370cf110a4aSrobert 	int					 sc_dying;
371cf110a4aSrobert 	int					 sc_mode;
372cf110a4aSrobert 
373cf110a4aSrobert 	u_int16_t				 uvc_version;
374cf110a4aSrobert 	u_int32_t				 clock_frequency;
375cf110a4aSrobert 	u_int32_t				 quirks;
376cf110a4aSrobert 
377cf110a4aSrobert 	struct uvideo_sample_buffer		 sc_sample_buffer;
378cf110a4aSrobert 
379cf110a4aSrobert 	struct vnode				*sc_vp;
380cf110a4aSrobert 	struct usb_task				 sc_task_write;
381cf110a4aSrobert 
382cf110a4aSrobert 	struct usb_video_control		*sc_vc_header;
383cf110a4aSrobert 	struct uvideo_stream_if			 sc_curr_strm;
384cf110a4aSrobert };
385