blob: b275dbce3a1ba5cad58e3efcae308074b5f2822b [file] [log] [blame]
Mauro Carvalho Chehabc3a3d1d2017-12-18 15:15:53 -05001/*
2 * SPDX-License-Identifier: GPL-2.0
3 * tm6000-buf.c - driver for TM5600/TM6000/TM6010 USB video capture devices
4 *
Mauro Carvalho Chehab32590812018-04-25 05:34:48 -04005 * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org>
Mauro Carvalho Chehabc3a3d1d2017-12-18 15:15:53 -05006 */
Mauro Carvalho Chehab9701dc92009-09-14 09:42:41 -03007
8#include <linux/videodev2.h>
9
Mauro Carvalho Chehab6eb5c8a2008-01-08 11:25:57 -030010#define TM6000_URB_MSG_LEN 180
11
Mauro Carvalho Chehab9701dc92009-09-14 09:42:41 -030012struct usb_isoc_ctl {
13 /* max packet size of isoc transaction */
14 int max_pkt_size;
15
16 /* number of allocated urbs */
17 int num_bufs;
18
19 /* urb for isoc transfers */
20 struct urb **urb;
21
22 /* transfer buffers for isoc transfer */
23 char **transfer_buffer;
24
Mauro Carvalho Chehabed0236a2008-04-09 08:07:20 -030025 /* Last buffer command and region */
26 u8 cmd;
27 int pos, size, pktsize;
Mauro Carvalho Chehab9701dc92009-09-14 09:42:41 -030028
29 /* Last field: ODD or EVEN? */
Stefan Ringel423c79e2011-05-21 03:05:38 -030030 int vfield, field;
Mauro Carvalho Chehabcc6c60d2007-09-19 16:24:05 -030031
Mauro Carvalho Chehaba2286182007-09-22 02:06:25 -030032 /* Stores incomplete commands */
Mauro Carvalho Chehabed0236a2008-04-09 08:07:20 -030033 u32 tmp_buf;
34 int tmp_buf_len;
Mauro Carvalho Chehaba2286182007-09-22 02:06:25 -030035
36 /* Stores already requested buffers */
Mauro Carvalho Chehab45dbf0d2011-09-23 09:26:22 -030037 struct tm6000_buffer *buf;
Mauro Carvalho Chehab9701dc92009-09-14 09:42:41 -030038};