aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/usbvision/usbvision.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/usbvision/usbvision.h')
-rw-r--r--drivers/media/video/usbvision/usbvision.h194
1 files changed, 97 insertions, 97 deletions
diff --git a/drivers/media/video/usbvision/usbvision.h b/drivers/media/video/usbvision/usbvision.h
index 2271ede78ddf..42189e500143 100644
--- a/drivers/media/video/usbvision/usbvision.h
+++ b/drivers/media/video/usbvision/usbvision.h
@@ -223,39 +223,39 @@ enum {
223/* ----------------------------------------------------------------- */ 223/* ----------------------------------------------------------------- */
224/* usbvision video structures */ 224/* usbvision video structures */
225/* ----------------------------------------------------------------- */ 225/* ----------------------------------------------------------------- */
226enum ScanState { 226enum scan_state {
227 ScanState_Scanning, /* Scanning for header */ 227 scan_state_scanning, /* Scanning for header */
228 ScanState_Lines /* Parsing lines */ 228 scan_state_lines /* Parsing lines */
229}; 229};
230 230
231/* Completion states of the data parser */ 231/* Completion states of the data parser */
232enum ParseState { 232enum parse_state {
233 ParseState_Continue, /* Just parse next item */ 233 parse_state_continue, /* Just parse next item */
234 ParseState_NextFrame, /* Frame done, send it to V4L */ 234 parse_state_next_frame, /* Frame done, send it to V4L */
235 ParseState_Out, /* Not enough data for frame */ 235 parse_state_out, /* Not enough data for frame */
236 ParseState_EndParse /* End parsing */ 236 parse_state_end_parse /* End parsing */
237}; 237};
238 238
239enum FrameState { 239enum frame_state {
240 FrameState_Unused, /* Unused (no MCAPTURE) */ 240 frame_state_unused, /* Unused (no MCAPTURE) */
241 FrameState_Ready, /* Ready to start grabbing */ 241 frame_state_ready, /* Ready to start grabbing */
242 FrameState_Grabbing, /* In the process of being grabbed into */ 242 frame_state_grabbing, /* In the process of being grabbed into */
243 FrameState_Done, /* Finished grabbing, but not been synced yet */ 243 frame_state_done, /* Finished grabbing, but not been synced yet */
244 FrameState_DoneHold, /* Are syncing or reading */ 244 frame_state_done_hold, /* Are syncing or reading */
245 FrameState_Error, /* Something bad happened while processing */ 245 frame_state_error, /* Something bad happened while processing */
246}; 246};
247 247
248/* stream states */ 248/* stream states */
249enum StreamState { 249enum stream_state {
250 Stream_Off, /* Driver streaming is completely OFF */ 250 stream_off, /* Driver streaming is completely OFF */
251 Stream_Idle, /* Driver streaming is ready to be put ON by the application */ 251 stream_idle, /* Driver streaming is ready to be put ON by the application */
252 Stream_Interrupt, /* Driver streaming must be interrupted */ 252 stream_interrupt, /* Driver streaming must be interrupted */
253 Stream_On, /* Driver streaming is put ON by the application */ 253 stream_on, /* Driver streaming is put ON by the application */
254}; 254};
255 255
256enum IsocState { 256enum isoc_state {
257 IsocState_InFrame, /* Isoc packet is member of frame */ 257 isoc_state_in_frame, /* Isoc packet is member of frame */
258 IsocState_NoFrame, /* Isoc packet is not member of any frame */ 258 isoc_state_no_frame, /* Isoc packet is not member of any frame */
259}; 259};
260 260
261struct usb_device; 261struct usb_device;
@@ -286,23 +286,23 @@ struct usbvision_v4l2_format_st {
286struct usbvision_frame_header { 286struct usbvision_frame_header {
287 unsigned char magic_1; /* 0 magic */ 287 unsigned char magic_1; /* 0 magic */
288 unsigned char magic_2; /* 1 magic */ 288 unsigned char magic_2; /* 1 magic */
289 unsigned char headerLength; /* 2 */ 289 unsigned char header_length; /* 2 */
290 unsigned char frameNum; /* 3 */ 290 unsigned char frame_num; /* 3 */
291 unsigned char framePhase; /* 4 */ 291 unsigned char frame_phase; /* 4 */
292 unsigned char frameLatency; /* 5 */ 292 unsigned char frame_latency; /* 5 */
293 unsigned char dataFormat; /* 6 */ 293 unsigned char data_format; /* 6 */
294 unsigned char formatParam; /* 7 */ 294 unsigned char format_param; /* 7 */
295 unsigned char frameWidthLo; /* 8 */ 295 unsigned char frame_width_lo; /* 8 */
296 unsigned char frameWidthHi; /* 9 */ 296 unsigned char frame_width_hi; /* 9 */
297 unsigned char frameHeightLo; /* 10 */ 297 unsigned char frame_height_lo; /* 10 */
298 unsigned char frameHeightHi; /* 11 */ 298 unsigned char frame_height_hi; /* 11 */
299 __u16 frameWidth; /* 8 - 9 after endian correction*/ 299 __u16 frame_width; /* 8 - 9 after endian correction*/
300 __u16 frameHeight; /* 10 - 11 after endian correction*/ 300 __u16 frame_height; /* 10 - 11 after endian correction*/
301}; 301};
302 302
303struct usbvision_frame { 303struct usbvision_frame {
304 char *data; /* Frame buffer */ 304 char *data; /* Frame buffer */
305 struct usbvision_frame_header isocHeader; /* Header from stream */ 305 struct usbvision_frame_header isoc_header; /* Header from stream */
306 306
307 int width; /* Width application is expecting */ 307 int width; /* Width application is expecting */
308 int height; /* Height */ 308 int height; /* Height */
@@ -332,24 +332,24 @@ struct usbvision_frame {
332#define BRIDGE_NT1005 1005 332#define BRIDGE_NT1005 1005
333 333
334struct usbvision_device_data_st { 334struct usbvision_device_data_st {
335 __u64 VideoNorm; 335 __u64 video_norm;
336 const char *ModelString; 336 const char *model_string;
337 int Interface; /* to handle special interface number like BELKIN and Hauppauge WinTV-USB II */ 337 int interface; /* to handle special interface number like BELKIN and Hauppauge WinTV-USB II */
338 __u16 Codec; 338 __u16 codec;
339 unsigned VideoChannels:3; 339 unsigned video_channels:3;
340 unsigned AudioChannels:2; 340 unsigned audio_channels:2;
341 unsigned Radio:1; 341 unsigned radio:1;
342 unsigned vbi:1; 342 unsigned vbi:1;
343 unsigned Tuner:1; 343 unsigned tuner:1;
344 unsigned Vin_Reg1_override:1; /* Override default value with */ 344 unsigned vin_reg1_override:1; /* Override default value with */
345 unsigned Vin_Reg2_override:1; /* Vin_Reg1, Vin_Reg2, etc. */ 345 unsigned vin_reg2_override:1; /* vin_reg1, vin_reg2, etc. */
346 unsigned Dvi_yuv_override:1; 346 unsigned dvi_yuv_override:1;
347 __u8 Vin_Reg1; 347 __u8 vin_reg1;
348 __u8 Vin_Reg2; 348 __u8 vin_reg2;
349 __u8 Dvi_yuv; 349 __u8 dvi_yuv;
350 __u8 TunerType; 350 __u8 tuner_type;
351 __s16 X_Offset; 351 __s16 x_offset;
352 __s16 Y_Offset; 352 __s16 y_offset;
353}; 353};
354 354
355/* Declared on usbvision-cards.c */ 355/* Declared on usbvision-cards.c */
@@ -365,40 +365,40 @@ struct usb_usbvision {
365 struct i2c_adapter i2c_adap; 365 struct i2c_adapter i2c_adap;
366 int registered_i2c; 366 int registered_i2c;
367 367
368 struct urb *ctrlUrb; 368 struct urb *ctrl_urb;
369 unsigned char ctrlUrbBuffer[8]; 369 unsigned char ctrl_urb_buffer[8];
370 int ctrlUrbBusy; 370 int ctrl_urb_busy;
371 struct usb_ctrlrequest ctrlUrbSetup; 371 struct usb_ctrlrequest ctrl_urb_setup;
372 wait_queue_head_t ctrlUrb_wq; // Processes waiting 372 wait_queue_head_t ctrl_urb_wq; // Processes waiting
373 373
374 /* configuration part */ 374 /* configuration part */
375 int have_tuner; 375 int have_tuner;
376 int tuner_type; 376 int tuner_type;
377 int bridgeType; // NT1003, NT1004, NT1005 377 int bridge_type; // NT1003, NT1004, NT1005
378 int radio; 378 int radio;
379 int video_inputs; // # of inputs 379 int video_inputs; // # of inputs
380 unsigned long freq; 380 unsigned long freq;
381 int AudioMute; 381 int audio_mute;
382 int AudioChannel; 382 int audio_channel;
383 int isocMode; // format of video data for the usb isoc-transfer 383 int isoc_mode; // format of video data for the usb isoc-transfer
384 unsigned int nr; // Number of the device 384 unsigned int nr; // Number of the device
385 385
386 /* Device structure */ 386 /* Device structure */
387 struct usb_device *dev; 387 struct usb_device *dev;
388 /* usb transfer */ 388 /* usb transfer */
389 int num_alt; /* Number of alternative settings */ 389 int num_alt; /* Number of alternative settings */
390 unsigned int *alt_max_pkt_size; /* array of wMaxPacketSize */ 390 unsigned int *alt_max_pkt_size; /* array of max_packet_size */
391 unsigned char iface; /* Video interface number */ 391 unsigned char iface; /* Video interface number */
392 unsigned char ifaceAlt; /* Alt settings */ 392 unsigned char iface_alt; /* Alt settings */
393 unsigned char Vin_Reg2_Preset; 393 unsigned char vin_reg2_preset;
394 struct mutex v4l2_lock; 394 struct mutex v4l2_lock;
395 struct timer_list powerOffTimer; 395 struct timer_list power_off_timer;
396 struct work_struct powerOffWork; 396 struct work_struct power_off_work;
397 int power; /* is the device powered on? */ 397 int power; /* is the device powered on? */
398 int user; /* user count for exclusive use */ 398 int user; /* user count for exclusive use */
399 int initialized; /* Had we already sent init sequence? */ 399 int initialized; /* Had we already sent init sequence? */
400 int DevModel; /* What type of USBVISION device we got? */ 400 int dev_model; /* What type of USBVISION device we got? */
401 enum StreamState streaming; /* Are we streaming Isochronous? */ 401 enum stream_state streaming; /* Are we streaming Isochronous? */
402 int last_error; /* What calamity struck us? */ 402 int last_error; /* What calamity struck us? */
403 int curwidth; /* width of the frame the device is currently set to*/ 403 int curwidth; /* width of the frame the device is currently set to*/
404 int curheight; /* height of the frame the device is currently set to*/ 404 int curheight; /* height of the frame the device is currently set to*/
@@ -411,7 +411,7 @@ struct usb_usbvision {
411 struct list_head inqueue, outqueue; /* queued frame list and ready to dequeue frame list */ 411 struct list_head inqueue, outqueue; /* queued frame list and ready to dequeue frame list */
412 wait_queue_head_t wait_frame; /* Processes waiting */ 412 wait_queue_head_t wait_frame; /* Processes waiting */
413 wait_queue_head_t wait_stream; /* Processes waiting */ 413 wait_queue_head_t wait_stream; /* Processes waiting */
414 struct usbvision_frame *curFrame; // pointer to current frame, set by usbvision_find_header 414 struct usbvision_frame *cur_frame; // pointer to current frame, set by usbvision_find_header
415 struct usbvision_frame frame[USBVISION_NUMFRAMES]; // frame buffer 415 struct usbvision_frame frame[USBVISION_NUMFRAMES]; // frame buffer
416 int num_frames; // number of frames allocated 416 int num_frames; // number of frames allocated
417 struct usbvision_sbuf sbuf[USBVISION_NUMSBUF]; // S buffering 417 struct usbvision_sbuf sbuf[USBVISION_NUMSBUF]; // S buffering
@@ -424,43 +424,43 @@ struct usb_usbvision {
424 int scratch_headermarker[USBVISION_NUM_HEADERMARKER]; 424 int scratch_headermarker[USBVISION_NUM_HEADERMARKER];
425 int scratch_headermarker_read_ptr; 425 int scratch_headermarker_read_ptr;
426 int scratch_headermarker_write_ptr; 426 int scratch_headermarker_write_ptr;
427 enum IsocState isocstate; 427 enum isoc_state isocstate;
428 struct usbvision_v4l2_format_st palette; 428 struct usbvision_v4l2_format_st palette;
429 429
430 struct v4l2_capability vcap; /* Video capabilities */ 430 struct v4l2_capability vcap; /* Video capabilities */
431 unsigned int ctl_input; /* selected input */ 431 unsigned int ctl_input; /* selected input */
432 v4l2_std_id tvnormId; /* selected tv norm */ 432 v4l2_std_id tvnorm_id; /* selected tv norm */
433 unsigned char video_endp; /* 0x82 for USBVISION devices based */ 433 unsigned char video_endp; /* 0x82 for USBVISION devices based */
434 434
435 // Decompression stuff: 435 // Decompression stuff:
436 unsigned char *IntraFrameBuffer; /* Buffer for reference frame */ 436 unsigned char *intra_frame_buffer; /* Buffer for reference frame */
437 int BlockPos; //for test only 437 int block_pos; //for test only
438 int requestIntra; // 0 = normal; 1 = intra frame is requested; 438 int request_intra; // 0 = normal; 1 = intra frame is requested;
439 int lastIsocFrameNum; // check for lost isoc frames 439 int last_isoc_frame_num; // check for lost isoc frames
440 int isocPacketSize; // need to calculate usedBandwidth 440 int isoc_packet_size; // need to calculate used_bandwidth
441 int usedBandwidth; // used bandwidth 0-100%, need to set comprLevel 441 int used_bandwidth; // used bandwidth 0-100%, need to set compr_level
442 int comprLevel; // How strong (100) or weak (0) is compression 442 int compr_level; // How strong (100) or weak (0) is compression
443 int lastComprLevel; // How strong (100) or weak (0) was compression 443 int last_compr_level; // How strong (100) or weak (0) was compression
444 int usb_bandwidth; /* Mbit/s */ 444 int usb_bandwidth; /* Mbit/s */
445 445
446 /* Statistics that can be overlayed on the screen */ 446 /* Statistics that can be overlayed on the screen */
447 unsigned long isocUrbCount; // How many URBs we received so far 447 unsigned long isoc_urb_count; // How many URBs we received so far
448 unsigned long urb_length; /* Length of last URB */ 448 unsigned long urb_length; /* Length of last URB */
449 unsigned long isocDataCount; /* How many bytes we received */ 449 unsigned long isoc_data_count; /* How many bytes we received */
450 unsigned long header_count; /* How many frame headers we found */ 450 unsigned long header_count; /* How many frame headers we found */
451 unsigned long scratch_ovf_count; /* How many times we overflowed scratch */ 451 unsigned long scratch_ovf_count; /* How many times we overflowed scratch */
452 unsigned long isocSkipCount; /* How many empty ISO packets received */ 452 unsigned long isoc_skip_count; /* How many empty ISO packets received */
453 unsigned long isocErrCount; /* How many bad ISO packets received */ 453 unsigned long isoc_err_count; /* How many bad ISO packets received */
454 unsigned long isocPacketCount; // How many packets we totally got 454 unsigned long isoc_packet_count; // How many packets we totally got
455 unsigned long timeInIrq; // How long do we need for interrupt 455 unsigned long time_in_irq; // How long do we need for interrupt
456 int isocMeasureBandwidthCount; 456 int isoc_measure_bandwidth_count;
457 int frame_num; // How many video frames we send to user 457 int frame_num; // How many video frames we send to user
458 int maxStripLen; // How big is the biggest strip 458 int max_strip_len; // How big is the biggest strip
459 int comprBlockPos; 459 int comprblock_pos;
460 int stripLenErrors; // How many times was BlockPos greater than StripLen 460 int strip_len_errors; // How many times was block_pos greater than strip_len
461 int stripMagicErrors; 461 int strip_magic_errors;
462 int stripLineNumberErrors; 462 int strip_line_number_errors;
463 int ComprBlockTypes[4]; 463 int compr_block_types[4];
464}; 464};
465 465
466static inline struct usb_usbvision *to_usbvision(struct v4l2_device *v4l2_dev) 466static inline struct usb_usbvision *to_usbvision(struct v4l2_device *v4l2_dev)
@@ -500,7 +500,7 @@ int usbvision_restart_isoc(struct usb_usbvision *usbvision);
500void usbvision_stop_isoc(struct usb_usbvision *usbvision); 500void usbvision_stop_isoc(struct usb_usbvision *usbvision);
501int usbvision_set_alternate(struct usb_usbvision *dev); 501int usbvision_set_alternate(struct usb_usbvision *dev);
502 502
503int usbvision_set_audio(struct usb_usbvision *usbvision, int AudioChannel); 503int usbvision_set_audio(struct usb_usbvision *usbvision, int audio_channel);
504int usbvision_audio_off(struct usb_usbvision *usbvision); 504int usbvision_audio_off(struct usb_usbvision *usbvision);
505 505
506int usbvision_begin_streaming(struct usb_usbvision *usbvision); 506int usbvision_begin_streaming(struct usb_usbvision *usbvision);
@@ -511,9 +511,9 @@ int usbvision_muxsel(struct usb_usbvision *usbvision, int channel);
511int usbvision_set_input(struct usb_usbvision *usbvision); 511int usbvision_set_input(struct usb_usbvision *usbvision);
512int usbvision_set_output(struct usb_usbvision *usbvision, int width, int height); 512int usbvision_set_output(struct usb_usbvision *usbvision, int width, int height);
513 513
514void usbvision_init_powerOffTimer(struct usb_usbvision *usbvision); 514void usbvision_init_power_off_timer(struct usb_usbvision *usbvision);
515void usbvision_set_powerOffTimer(struct usb_usbvision *usbvision); 515void usbvision_set_power_off_timer(struct usb_usbvision *usbvision);
516void usbvision_reset_powerOffTimer(struct usb_usbvision *usbvision); 516void usbvision_reset_power_off_timer(struct usb_usbvision *usbvision);
517int usbvision_power_off(struct usb_usbvision *usbvision); 517int usbvision_power_off(struct usb_usbvision *usbvision);
518int usbvision_power_on(struct usb_usbvision *usbvision); 518int usbvision_power_on(struct usb_usbvision *usbvision);
519 519