SyntekUSBVideoCamera
Main Page
Data Structures
Files
File List
Globals
stk11xx.h
Go to the documentation of this file.
1
34
#ifndef STK11XX_H
35
#define STK11XX_H
36
37
#define DRIVER_NAME "stk11xx"
38
#define DRIVER_VERSION "v3.0.0"
39
#define DRIVER_VERSION_NUM 0x030000
40
#define DRIVER_YEAR 2012
41
#define DRIVER_DESC "Syntek USB Video Camera"
42
#define DRIVER_AUTHOR "Nicolas VIVIEN"
43
#define PREFIX DRIVER_NAME ": "
44
#define DRIVER_URL \
45
"http://sourceforge.net/projects/syntekdriver/"
47
#define USB_SYNTEK1_VENDOR_ID 0x174f
48
#define USB_SYNTEK2_VENDOR_ID 0x05e1
50
#define USB_STK_A311_PRODUCT_ID 0xa311
51
#define USB_STK_A821_PRODUCT_ID 0xa821
52
#define USB_STK_AA11_PRODUCT_ID 0xaa11
53
#define USB_STK_6A31_PRODUCT_ID 0x6a31
54
#define USB_STK_6A33_PRODUCT_ID 0x6a33
55
#define USB_STK_6A51_PRODUCT_ID 0x6a51
56
#define USB_STK_6A54_PRODUCT_ID 0x6a54
57
#define USB_STK_6D51_PRODUCT_ID 0x6d51
59
#define USB_STK_0408_PRODUCT_ID 0x0408
60
#define USB_STK_0500_PRODUCT_ID 0x0500
61
#define USB_STK_0501_PRODUCT_ID 0x0501
70
#define VID_HARDWARE_STK11XX 88
71
72
73
74
88
#define MAX_ISO_BUFS 16
89
#define ISO_FRAMES_PER_DESC 10
90
#define ISO_MAX_FRAME_SIZE 3 * 1024
91
#define ISO_BUFFER_SIZE (ISO_FRAMES_PER_DESC * ISO_MAX_FRAME_SIZE)
92
93
105
#define STK11XX_MAX_IMAGES 10
106
#define STK11XX_FRAME_SIZE (1280 * 1024 * 4)
107
108
109
110
111
112
113
120
#define DRIVER_SUPPORT "Syntek USB Camera : STK-1135"
121
142
#ifndef CONFIG_STK11XX_DEBUG
143
#define CONFIG_STK11XX_DEBUG 0
144
#endif
145
146
#if CONFIG_STK11XX_DEBUG
147
148
#define STK_INFO(str, args...) printk(KERN_INFO PREFIX str, ##args)
149
#define STK_ERROR(str, args...) printk(KERN_ERR PREFIX str, ##args)
150
#define STK_WARNING(str, args...) printk(KERN_WARNING PREFIX str, ##args)
151
#define STK_DEBUG(str, args...) printk(KERN_DEBUG PREFIX str, ##args)
152
153
#else
154
155
#define STK_INFO(str, args...) printk(KERN_INFO PREFIX str, ##args)
156
#define STK_ERROR(str, args...) printk(KERN_ERR PREFIX str, ##args)
157
#define STK_WARNING(str, args...) printk(KERN_WARNING PREFIX str, ##args)
158
#define STK_DEBUG(str, args...) do { } while(0)
159
160
#endif
161
162
171
#ifndef CONFIG_STK11XX_DEBUG_STREAM
172
#define CONFIG_STK11XX_DEBUG_STREAM 0
173
#endif
174
175
#if CONFIG_STK11XX_DEBUG_STREAM
176
177
#define STK_STREAM(str, args...) printk(KERN_DEBUG PREFIX str, ##args)
178
179
#else
180
181
#define STK_STREAM(str, args...) do { } while(0)
182
183
#endif
184
185
186
190
typedef
enum
{
191
SYNTEK_STK_M811 = 1,
192
SYNTEK_STK_A311 = 2,
193
SYNTEK_STK_A821 = 3,
194
SYNTEK_STK_6A31 = 4,
195
SYNTEK_STK_6A33 = 5,
196
SYNTEK_STK_6A51 = 6,
197
SYNTEK_STK_6A54 = 7,
198
SYNTEK_STK_6D51 = 8,
199
SYNTEK_STK_0500 = 9,
200
SYNTEK_STK_0408 = 10,
201
SYNTEK_STK_AA11 = 11,
202
}
T_SYNTEK_DEVICE
;
203
204
208
typedef
enum
{
209
STK11XX_VGA
,
210
STK11XX_SXGA
,
211
STK11XX_PAL
,
212
STK11XX_UXGA
213
}
T_STK11XX_VIDEOMODE
;
214
215
219
typedef
enum
{
220
STK11XX_80x60,
221
STK11XX_128x96,
222
STK11XX_160x120,
223
STK11XX_213x160,
224
STK11XX_320x240,
225
STK11XX_640x480,
226
STK11XX_720x576,
227
STK11XX_800x600,
228
STK11XX_1024x768,
229
STK11XX_1280x1024,
230
STK11XX_NBR_SIZES
231
}
T_STK11XX_RESOLUTION
;
232
233
237
typedef
enum
{
238
STK11XX_PALETTE_RGB24,
239
STK11XX_PALETTE_RGB32,
240
STK11XX_PALETTE_BGR24,
241
STK11XX_PALETTE_BGR32,
242
STK11XX_PALETTE_UYVY,
243
STK11XX_PALETTE_YUYV
244
}
T_STK11XX_PALETTE
;
245
246
250
struct
stk11xx_iso_buf
{
251
void
*data;
252
int
length;
253
int
read;
254
struct
urb *urb;
255
};
256
257
261
struct
stk11xx_frame_buf
{
262
int
errors;
263
void
*data;
264
volatile
bool
odd;
265
volatile
int
filled;
266
struct
stk11xx_frame_buf
*next;
267
};
268
269
273
struct
stk11xx_image_buf
{
274
unsigned
long
offset
;
275
int
vma_use_count
;
276
};
277
278
282
struct
stk11xx_coord
{
283
int
x
;
284
int
y
;
285
};
286
287
291
struct
stk11xx_video
{
292
int
fps
;
293
int
brightness
;
294
int
contrast
;
295
int
whiteness
;
296
int
colour
;
297
int
depth
;
298
int
palette
;
299
int
hue
;
300
int
hflip
;
301
int
vflip
;
302
int
input
;
303
int
norm
;
305
// default values for the device. Above are *current* values
306
int
default_brightness;
307
int
default_contrast;
308
int
default_colour;
309
int
default_whiteness;
310
int
default_hflip;
311
int
default_vflip;
312
};
313
314
318
struct
usb_stk11xx
{
319
struct
video_device *
vdev
;
320
struct
usb_device *
udev
;
321
struct
usb_interface *
interface
;
323
int
release
;
324
int
webcam_model
;
325
int
webcam_type
;
327
unsigned
char
*
int_in_buffer
;
328
size_t
int_in_size
;
329
__u8
int_in_endpointAddr
;
331
size_t
isoc_in_size
;
332
__u8
isoc_in_endpointAddr
;
334
int
watchdog
;
336
struct
stk11xx_video
vsettings
;
338
int
error_status;
339
340
int
vopen
;
341
int
visoc_errors
;
342
int
vframes_error
;
343
int
vframes_dumped
;
344
int
vsync
;
345
int
v1st_cap
;
348
spinlock_t
spinlock
;
349
struct
semaphore
mutex
;
350
wait_queue_head_t
wait_frame
;
351
struct
mutex
modlock
;
354
// 1: isoc
355
char
isoc_init_ok;
356
struct
stk11xx_iso_buf
isobuf[
MAX_ISO_BUFS
];
357
358
// 2: frame
359
int
frame_size;
360
struct
stk11xx_frame_buf
*framebuf;
361
struct
stk11xx_frame_buf
*empty_frames, *empty_frames_tail;
362
struct
stk11xx_frame_buf
*full_frames, *full_frames_tail;
363
struct
stk11xx_frame_buf
*fill_frame;
364
struct
stk11xx_frame_buf
*read_frame;
365
366
// 3: image
367
int
view_size;
368
int
image_size;
369
void
*image_data;
370
struct
stk11xx_image_buf
images[
STK11XX_MAX_IMAGES
];
371
int
image_used[
STK11XX_MAX_IMAGES
];
372
unsigned
int
nbuffers;
373
unsigned
int
len_per_image;
374
int
image_read_pos;
375
int
fill_image;
376
int
resolution;
377
struct
stk11xx_coord
view;
378
struct
stk11xx_coord
image;
379
};
380
381
386
#define STK11XX_PERCENT(x,y) ( ((int)x * (int)y) / 100)
387
388
393
#define to_stk11xx_dev(d) container_of(d, struct usb_stk11xx, kref)
394
395
396
extern
const
struct
stk11xx_coord
stk11xx_image_sizes
[STK11XX_NBR_SIZES];
397
398
399
int
usb_stk11xx_write_registry
(
struct
usb_stk11xx
*, __u16, __u16);
400
int
usb_stk11xx_read_registry
(
struct
usb_stk11xx
*, __u16,
int
*);
401
int
usb_stk11xx_set_feature
(
struct
usb_stk11xx
*,
int
);
402
int
usb_stk11xx_set_configuration
(
struct
usb_stk11xx
*);
403
int
usb_stk11xx_isoc_init
(
struct
usb_stk11xx
*);
404
void
usb_stk11xx_isoc_handler
(
struct
urb *);
405
void
usb_stk11xx_isoc_cleanup
(
struct
usb_stk11xx
*);
406
407
int
dev_stk11xx_decompress
(
struct
usb_stk11xx
*);
408
int
dev_stk11xx_initialize_device
(
struct
usb_stk11xx
*);
409
int
dev_stk11xx_start_stream
(
struct
usb_stk11xx
*);
410
int
dev_stk11xx_stop_stream
(
struct
usb_stk11xx
*);
411
int
dev_stk11xx_check_device
(
struct
usb_stk11xx
*,
int
);
412
int
dev_stk11xx_camera_on
(
struct
usb_stk11xx
*);
413
int
dev_stk11xx_camera_off
(
struct
usb_stk11xx
*);
414
int
dev_stk11xx_camera_asleep
(
struct
usb_stk11xx
*);
415
int
dev_stk11xx_init_camera
(
struct
usb_stk11xx
*);
416
int
dev_stk11xx_reconf_camera
(
struct
usb_stk11xx
*);
417
int
dev_stk11xx_camera_settings
(
struct
usb_stk11xx
*);
418
int
dev_stk11xx_set_camera_quality
(
struct
usb_stk11xx
*);
419
int
dev_stk11xx_set_camera_fps
(
struct
usb_stk11xx
*);
420
int
dev_stk11xx_watchdog_camera
(
struct
usb_stk11xx
*);
421
422
int
v4l_stk11xx_select_video_mode
(
struct
usb_stk11xx
*,
int
,
int
);
423
int
v4l_stk11xx_register_video_device
(
struct
usb_stk11xx
*);
424
int
v4l_stk11xx_unregister_video_device
(
struct
usb_stk11xx
*);
425
426
int
stk11xx_create_sysfs_files
(
struct
video_device *);
427
void
stk11xx_remove_sysfs_files
(
struct
video_device *);
428
429
int
stk11xx_allocate_buffers
(
struct
usb_stk11xx
*);
430
int
stk11xx_reset_buffers
(
struct
usb_stk11xx
*);
431
int
stk11xx_clear_buffers
(
struct
usb_stk11xx
*);
432
int
stk11xx_free_buffers
(
struct
usb_stk11xx
*);
433
void
stk11xx_next_image
(
struct
usb_stk11xx
*);
434
int
stk11xx_next_frame
(
struct
usb_stk11xx
*);
435
int
stk11xx_handle_frame
(
struct
usb_stk11xx
*);
436
437
int
stk11xx_decompress
(
struct
usb_stk11xx
*);
438
439
440
#endif
Generated on Wed Jan 23 2013 06:54:28 for SyntekUSBVideoCamera by
1.8.3