stk11xx.h File Reference

Driver for Syntek USB video camera. More...

Go to the source code of this file.

Data Structures

struct  stk11xx_iso_buf
struct  stk11xx_frame_buf
struct  stk11xx_image_buf
struct  stk11xx_coord
struct  stk11xx_video
struct  usb_stk11xx

Defines

#define DRIVER_NAME   "stk11xx"
#define DRIVER_VERSION   "v1.0.0"
#define DRIVER_VERSION_NUM   0x000100
#define DRIVER_DESC   "Syntek USB Video Camera"
#define DRIVER_AUTHOR   "Nicolas VIVIEN"
#define PREFIX   DRIVER_NAME ": "
#define USB_SYNTEK1_VENDOR_ID   0x174F
#define USB_SYNTEK2_VENDOR_ID   0x05E1
#define USB_STK_A311_PRODUCT_ID   0xa311
#define USB_STK_A821_PRODUCT_ID   0xa821
#define USB_STK_6A31_PRODUCT_ID   0x6A31
#define USB_STK_0501_PRODUCT_ID   0x0501
#define VID_HARDWARE_STK11XX   88
#define MAX_ISO_BUFS   16
#define ISO_FRAMES_PER_DESC   10
#define ISO_MAX_FRAME_SIZE   3 * 1024
#define ISO_BUFFER_SIZE   (ISO_FRAMES_PER_DESC * ISO_MAX_FRAME_SIZE)
#define STK11XX_MAX_IMAGES   10
#define STK11XX_FRAME_SIZE   (1280 * 1024 * 4)
#define DRIVER_SUPPORT   "Syntek USB Camera : STK-1135"
#define CONFIG_STK11XX_DEBUG   0
#define STK_INFO(str, args...)   printk(KERN_INFO PREFIX str, ##args)
#define STK_ERROR(str, args...)   printk(KERN_ERR PREFIX str, ##args)
#define STK_WARNING(str, args...)   printk(KERN_WARNING PREFIX str, ##args)
#define STK_DEBUG(str, args...)   do { } while(0)
#define CONFIG_STK11XX_DEBUG_STREAM   0
#define STK_STREAM(str, args...)   do { } while(0)
#define to_stk11xx_dev(d)   container_of(d, struct usb_stk11xx, kref)

Enumerations

enum  T_SYNTEK_DEVICE { SYNTEK_STK_A311 = 1, SYNTEK_STK_A821 = 2, SYNTEK_STK_6A31 = 3 }
enum  { STK11XX_VGA, STK11XX_SXGA, STK11XX_UXGA }
enum  {
  STK11XX_80x60, STK11XX_128x96, STK11XX_160x120, STK11XX_213x160,
  STK11XX_320x240, STK11XX_640x480, STK11XX_800x600, STK11XX_1024x768,
  STK11XX_1280x1024, STK11XX_NBR_SIZES
}
enum  { STK11XX_PALETTE_RGB24, STK11XX_PALETTE_RGB32, STK11XX_PALETTE_BGR24, STK11XX_PALETTE_BGR32 }

Functions

void usb_stk11xx_delete (struct kref *)
int usb_stk11xx_write_registry (struct usb_stk11xx *, __u16, __u16)
 Write a 16-bits value to a 16-bits register.
int usb_stk11xx_read_registry (struct usb_stk11xx *, __u16, int *)
 Read a 16-bits value from a 16-bits register.
int usb_stk11xx_set_feature (struct usb_stk11xx *, int)
 Send the message SET_FEATURE and choose the interface.
int usb_stk11xx_set_configuration (struct usb_stk11xx *)
 Send the message SET_CONFIGURATION.
int usb_stk11xx_isoc_init (struct usb_stk11xx *)
 Initilize an isochronous pipe.
void usb_stk11xx_isoc_handler (struct urb *)
 ISOC handler.
void usb_stk11xx_isoc_cleanup (struct usb_stk11xx *)
 Clean-up all the ISOC buffers.
int dev_stk11xx_initialize_device (struct usb_stk11xx *)
 This function permits to initialize the device.
int dev_stk11xx_start_stream (struct usb_stk11xx *)
 This function sets the device to start the stream.
int dev_stk11xx_stop_stream (struct usb_stk11xx *)
 This function sets the device to stop the stream.
int dev_stk11xx_check_device (struct usb_stk11xx *, int)
 This function permits to check the device in reading the register 0x0201.
int dev_stk11xx_camera_on (struct usb_stk11xx *)
 This function switchs on the camera.
int dev_stk11xx_camera_off (struct usb_stk11xx *)
 This function switchs off the camera.
int dev_stk11xx_camera_asleep (struct usb_stk11xx *)
 Wake-up the camera.
int dev_stk11xx_init_camera (struct usb_stk11xx *)
 This function initializes the device for the stream.
int dev_stk11xx_load_microcode (struct usb_stk11xx *)
int dev_stk11xx_reconf_camera (struct usb_stk11xx *)
 Reconfigure the camera before the stream.
int dev_stk11xx_camera_settings (struct usb_stk11xx *)
 This function permits to modify the settings of the camera.
int dev_stk11xx_set_camera_quality (struct usb_stk11xx *)
 This function permits to modify the quality video of the camera.
int dev_stk11xx_set_camera_fps (struct usb_stk11xx *)
 This function permits to modify the fps of the camera.
int dev_stk11xx_watchdog_camera (struct usb_stk11xx *)
 A espece of software watchdog.
int v4l_stk11xx_select_video_mode (struct usb_stk11xx *, int, int)
 Select a video mode.
int v4l_stk11xx_register_video_device (struct usb_stk11xx *)
 Register the video device.
int v4l_stk11xx_unregister_video_device (struct usb_stk11xx *)
 Unregister the video device.
int stk11xx_create_sysfs_files (struct video_device *)
 Create the 'sys' entries.
void stk11xx_remove_sysfs_files (struct video_device *)
 Remove the 'sys' entries.
int stk11xx_allocate_buffers (struct usb_stk11xx *)
 Allocate all ISOC buffers.
int stk11xx_reset_buffers (struct usb_stk11xx *)
 Reset all ISOC buffers.
int stk11xx_clear_buffers (struct usb_stk11xx *)
int stk11xx_free_buffers (struct usb_stk11xx *)
 Release all buffers.
void stk11xx_next_image (struct usb_stk11xx *)
 Prepare the next image.
int stk11xx_next_frame (struct usb_stk11xx *)
 Prepare the next frame.
int stk11xx_handle_frame (struct usb_stk11xx *)
 Handler frame.
int stk11xx_decompress (struct usb_stk11xx *)
 Decompress a frame.

Variables

struct stk11xx_coord stk11xx_image_sizes [STK11XX_NBR_SIZES]


Detailed Description

Driver for Syntek USB video camera.

Author:
Nicolas VIVIEN
Date:
2006-10-23
Version:
v1.0.0
Note:
Copyright (C) Nicolas VIVIEN
Licences
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

SubVersion
Date
Revision
Author
HeadURL

Definition in file stk11xx.h.


Define Documentation

#define CONFIG_STK11XX_DEBUG   0

Enable / Disable the debug mode.

Definition at line 130 of file stk11xx.h.

#define CONFIG_STK11XX_DEBUG_STREAM   0

Enable / Disable the debug mode about the stream.

Definition at line 159 of file stk11xx.h.

#define DRIVER_AUTHOR   "Nicolas VIVIEN"

Author of this driver

Definition at line 42 of file stk11xx.h.

#define DRIVER_DESC   "Syntek USB Video Camera"

Short description of this driver

Definition at line 41 of file stk11xx.h.

Referenced by usb_stk11xx_init(), and v4l_stk11xx_register_video_device().

#define DRIVER_NAME   "stk11xx"

Name of this driver

Definition at line 38 of file stk11xx.h.

#define DRIVER_SUPPORT   "Syntek USB Camera : STK-1135"

List of supported device

Definition at line 107 of file stk11xx.h.

#define DRIVER_VERSION   "v1.0.0"

Version of this driver

Definition at line 39 of file stk11xx.h.

Referenced by usb_stk11xx_init().

#define DRIVER_VERSION_NUM   0x000100

Version numerical of this driver

Definition at line 40 of file stk11xx.h.

Referenced by v4l_stk11xx_do_ioctl().

#define ISO_BUFFER_SIZE   (ISO_FRAMES_PER_DESC * ISO_MAX_FRAME_SIZE)

Maximal size of buffer

Definition at line 82 of file stk11xx.h.

Referenced by stk11xx_allocate_buffers(), and usb_stk11xx_isoc_init().

#define ISO_FRAMES_PER_DESC   10

Number frames per ISOC descriptor

Definition at line 80 of file stk11xx.h.

Referenced by usb_stk11xx_isoc_init().

#define ISO_MAX_FRAME_SIZE   3 * 1024

Maximale size of frame

Definition at line 81 of file stk11xx.h.

Referenced by usb_stk11xx_isoc_init().

#define MAX_ISO_BUFS   16

Number maximal of ISOC buffers

Definition at line 79 of file stk11xx.h.

Referenced by stk11xx_allocate_buffers(), stk11xx_free_buffers(), usb_stk11xx_isoc_cleanup(), and usb_stk11xx_isoc_init().

#define PREFIX   DRIVER_NAME ": "

Prefix use for the STK "printk"

Definition at line 43 of file stk11xx.h.

#define STK11XX_FRAME_SIZE   (1280 * 1024 * 4)

Maximum size after decompression

Definition at line 93 of file stk11xx.h.

Referenced by stk11xx_allocate_buffers().

#define STK11XX_MAX_IMAGES   10

Absolute maximum number of buffers available for mmap()

Definition at line 92 of file stk11xx.h.

Referenced by stk11xx_allocate_buffers(), and v4l_stk11xx_mmap().

#define STK_DEBUG ( str,
args...   )     do { } while(0)

Print debug message. Use this function like the function printf.

Definition at line 145 of file stk11xx.h.

Referenced by dev_stk6a31_configure_device(), dev_stk6a31_set_camera_quality(), dev_stka311_camera_settings(), dev_stka311_configure_device(), dev_stka311_initialize_device(), dev_stka311_set_camera_quality(), dev_stka821_configure_device(), dev_stka821_initialize_device(), dev_stka821_set_camera_quality(), stk11xx_allocate_buffers(), stk11xx_free_buffers(), stk11xx_reset_buffers(), usb_stk11xx_isoc_cleanup(), usb_stk11xx_isoc_handler(), usb_stk11xx_isoc_init(), usb_stk11xx_probe(), usb_stk11xx_set_configuration(), usb_stk11xx_set_feature(), v4l_stk11xx_do_ioctl(), v4l_stk11xx_ioctl(), v4l_stk11xx_open(), and v4l_stk11xx_select_video_mode().

#define STK_ERROR ( str,
args...   )     printk(KERN_ERR PREFIX str, ##args)

Print error message. Use this function like the function printf.

Definition at line 143 of file stk11xx.h.

Referenced by dev_stk11xx_camera_off(), dev_stk11xx_camera_on(), dev_stk11xx_check_device(), dev_stk11xx_watchdog_camera(), dev_stk6a31_load_microcode(), dev_stka311_load_microcode(), dev_stka821_load_microcode(), stk11xx_allocate_buffers(), stk11xx_next_frame(), usb_stk11xx_init(), usb_stk11xx_isoc_handler(), usb_stk11xx_isoc_init(), usb_stk11xx_probe(), usb_stk11xx_read_registry(), usb_stk11xx_set_configuration(), usb_stk11xx_set_feature(), usb_stk11xx_write_registry(), v4l_stk11xx_do_ioctl(), v4l_stk11xx_mmap(), v4l_stk11xx_open(), v4l_stk11xx_register_video_device(), and v4l_stk11xx_release().

#define STK_INFO ( str,
args...   )     printk(KERN_INFO PREFIX str, ##args)

Print information message. Use this function like the function printf.

Definition at line 142 of file stk11xx.h.

Referenced by dev_stk6a31_initialize_device(), dev_stka311_initialize_device(), dev_stka821_initialize_device(), runtest(), usb_stk11xx_disconnect(), usb_stk11xx_exit(), usb_stk11xx_init(), usb_stk11xx_probe(), v4l_stk11xx_register_video_device(), and v4l_stk11xx_unregister_video_device().

#define STK_STREAM ( str,
args...   )     do { } while(0)

Print stream debug message. Use this function like the function printf.

Definition at line 168 of file stk11xx.h.

Referenced by stk11xx_handle_frame(), stk11xx_next_frame(), stk11xx_next_image(), usb_stk11xx_isoc_handler(), v4l_stk11xx_mmap(), v4l_stk11xx_poll(), and v4l_stk11xx_read().

#define STK_WARNING ( str,
args...   )     printk(KERN_WARNING PREFIX str, ##args)

Print warning message. Use this function like the function printf.

Definition at line 144 of file stk11xx.h.

#define to_stk11xx_dev (  )     container_of(d, struct usb_stk11xx, kref)

Cast a member of a structure out to the containing structure

Definition at line 346 of file stk11xx.h.

#define USB_STK_0501_PRODUCT_ID   0x0501

Product ID of the camera DC-1125

Definition at line 52 of file stk11xx.h.

Referenced by usb_stk11xx_probe().

#define USB_STK_6A31_PRODUCT_ID   0x6A31

Product ID of the camera DC-NEW

Definition at line 50 of file stk11xx.h.

Referenced by usb_stk11xx_probe().

#define USB_STK_A311_PRODUCT_ID   0xa311

Product ID of the camera STK-1125

Definition at line 48 of file stk11xx.h.

Referenced by usb_stk11xx_probe().

#define USB_STK_A821_PRODUCT_ID   0xa821

Product ID of the camera STK-1135

Definition at line 49 of file stk11xx.h.

Referenced by usb_stk11xx_probe().

#define USB_SYNTEK1_VENDOR_ID   0x174F

Vendor ID of the camera

Definition at line 45 of file stk11xx.h.

Referenced by usb_stk11xx_probe().

#define USB_SYNTEK2_VENDOR_ID   0x05E1

Vendor ID of the camera

Definition at line 46 of file stk11xx.h.

Referenced by usb_stk11xx_probe().

#define VID_HARDWARE_STK11XX   88

This value must be inserted into the kernel headers linux/videodev.h It's useful only for the support of V4L v1

Definition at line 61 of file stk11xx.h.

Referenced by v4l_stk11xx_register_video_device().


Enumeration Type Documentation

anonymous enum

Enumerator:
STK11XX_VGA  For VGA video camera
STK11XX_SXGA  For SXGA video camera 1.3M
STK11XX_UXGA  For UXGA video camera 2M

Definition at line 187 of file stk11xx.h.

anonymous enum

Enumerator:
STK11XX_80x60 
STK11XX_128x96 
STK11XX_160x120 
STK11XX_213x160 
STK11XX_320x240 
STK11XX_640x480 
STK11XX_800x600 
STK11XX_1024x768 
STK11XX_1280x1024 
STK11XX_NBR_SIZES 

Definition at line 197 of file stk11xx.h.

anonymous enum

Enumerator:
STK11XX_PALETTE_RGB24 
STK11XX_PALETTE_RGB32 
STK11XX_PALETTE_BGR24 
STK11XX_PALETTE_BGR32 

Definition at line 214 of file stk11xx.h.

enum T_SYNTEK_DEVICE

Enumerator:
SYNTEK_STK_A311 
SYNTEK_STK_A821 
SYNTEK_STK_6A31 

Definition at line 177 of file stk11xx.h.


Function Documentation

int dev_stk11xx_camera_asleep ( struct usb_stk11xx dev  ) 

Wake-up the camera.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to wake-up the device.

Definition at line 276 of file stk11xx-dev.c.

References dev_stk6a31_camera_asleep(), dev_stka311_camera_asleep(), dev_stka821_camera_asleep(), SYNTEK_STK_6A31, SYNTEK_STK_A311, SYNTEK_STK_A821, and usb_stk11xx::webcam_model.

int dev_stk11xx_camera_off ( struct usb_stk11xx dev  ) 

This function switchs off the camera.

Parameters:
dev Device structure
Returns:
0 if all is OK
In fact, we choose the alternate interface '0'.

Definition at line 253 of file stk11xx-dev.c.

References STK_ERROR, and usb_stk11xx::udev.

int dev_stk11xx_camera_on ( struct usb_stk11xx dev  ) 

This function switchs on the camera.

Parameters:
dev Device structure
Returns:
0 if all is OK
In fact, we choose the alternate interface '5'.

Definition at line 230 of file stk11xx-dev.c.

References STK_ERROR, and usb_stk11xx::udev.

int dev_stk11xx_camera_settings ( struct usb_stk11xx dev  ) 

This function permits to modify the settings of the camera.

Parameters:
dev Device structure
Returns:
0 if all is OK
This functions permits to modify the settings :

Definition at line 314 of file stk11xx-dev.c.

References dev_stk6a31_camera_settings(), dev_stka311_camera_settings(), dev_stka821_camera_settings(), SYNTEK_STK_6A31, SYNTEK_STK_A311, SYNTEK_STK_A821, and usb_stk11xx::webcam_model.

int dev_stk11xx_check_device ( struct usb_stk11xx dev,
int  nbr 
)

This function permits to check the device in reading the register 0x0201.

Parameters:
dev Device structure
nbr Number of tries
Returns:
0 if all is OK
When we configure the stk11xx, this function is used to check the device status.

Definition at line 171 of file stk11xx-dev.c.

References STK_ERROR, and usb_stk11xx_read_registry().

int dev_stk11xx_init_camera ( struct usb_stk11xx dev  ) 

This function initializes the device for the stream.

Parameters:
dev Device structure
Returns:
0 if all is OK
It's the start. This function has to be called at first, before enabling the video stream.

Definition at line 133 of file stk11xx-dev.c.

References dev_stk6a31_init_camera(), dev_stka311_init_camera(), dev_stka821_init_camera(), SYNTEK_STK_6A31, SYNTEK_STK_A311, SYNTEK_STK_A821, and usb_stk11xx::webcam_model.

int dev_stk11xx_initialize_device ( struct usb_stk11xx dev  ) 

This function permits to initialize the device.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function must be called at first. It's the start of the initialization process. After this process, the device is completly initalized and it's ready.

This function is written from the USB log.

Definition at line 98 of file stk11xx-dev.c.

References dev_stk6a31_initialize_device(), dev_stka311_initialize_device(), dev_stka821_initialize_device(), SYNTEK_STK_6A31, SYNTEK_STK_A311, SYNTEK_STK_A821, and usb_stk11xx::webcam_model.

int dev_stk11xx_reconf_camera ( struct usb_stk11xx dev  ) 

Reconfigure the camera before the stream.

Parameters:
dev Device structure
Returns:
0 if all is OK
Before enabling the video stream, you have to reconfigure the device.

Definition at line 456 of file stk11xx-dev.c.

References dev_stk6a31_reconf_camera(), dev_stka311_reconf_camera(), dev_stka821_reconf_camera(), SYNTEK_STK_6A31, SYNTEK_STK_A311, SYNTEK_STK_A821, and usb_stk11xx::webcam_model.

int dev_stk11xx_set_camera_fps ( struct usb_stk11xx dev  ) 

This function permits to modify the fps of the camera.

Parameters:
dev Device structure
Returns:
0 if all is OK
This functions permits to modify the frame rate per second of the camera. So the number of images per second.

Definition at line 387 of file stk11xx-dev.c.

References dev_stk6a31_set_camera_fps(), dev_stka311_set_camera_fps(), dev_stka821_set_camera_fps(), SYNTEK_STK_6A31, SYNTEK_STK_A311, SYNTEK_STK_A821, and usb_stk11xx::webcam_model.

int dev_stk11xx_set_camera_quality ( struct usb_stk11xx dev  ) 

This function permits to modify the quality video of the camera.

Parameters:
dev Device structure
Returns:
0 if all is OK
This functions permits to modify the settings :

Definition at line 352 of file stk11xx-dev.c.

References dev_stk6a31_set_camera_quality(), dev_stka311_set_camera_quality(), dev_stka821_set_camera_quality(), SYNTEK_STK_6A31, SYNTEK_STK_A311, SYNTEK_STK_A821, and usb_stk11xx::webcam_model.

int dev_stk11xx_start_stream ( struct usb_stk11xx dev  ) 

This function sets the device to start the stream.

Parameters:
dev Device structure
Returns:
0 if all is OK
After the initialization of the device and the initialization of the video stream, this function permits to enable the stream.

Definition at line 422 of file stk11xx-dev.c.

References dev_stk6a31_start_stream(), dev_stka311_start_stream(), dev_stka821_start_stream(), SYNTEK_STK_6A31, SYNTEK_STK_A311, SYNTEK_STK_A821, and usb_stk11xx::webcam_model.

int dev_stk11xx_stop_stream ( struct usb_stk11xx dev  ) 

This function sets the device to stop the stream.

Parameters:
dev Device structure
Returns:
0 if all is OK
You use the function start_stream to enable the video stream. So you have to use the function stop_strem to disable the video stream.

Definition at line 491 of file stk11xx-dev.c.

References dev_stk6a31_stop_stream(), dev_stka311_stop_stream(), dev_stka821_stop_stream(), SYNTEK_STK_6A31, SYNTEK_STK_A311, SYNTEK_STK_A821, and usb_stk11xx::webcam_model.

int dev_stk11xx_watchdog_camera ( struct usb_stk11xx dev  ) 

A espece of software watchdog.

Parameters:
dev Device structure
Returns:
Value of register 0x0001
This function reads periodically the value of register 0x0001.

We don't know the purpose. I assume that it seems to a software watchdog.

Definition at line 207 of file stk11xx-dev.c.

References STK_ERROR, and usb_stk11xx_read_registry().

int stk11xx_allocate_buffers ( struct usb_stk11xx dev  ) 

Allocate all ISOC buffers.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to reserved the memory for each ISOC buffer.

Definition at line 126 of file stk11xx-buf.c.

References stk11xx_frame_buf::data, stk11xx_iso_buf::data, default_nbrframebuf, usb_stk11xx::framebuf, usb_stk11xx::image_data, usb_stk11xx::images, ISO_BUFFER_SIZE, usb_stk11xx::isobuf, usb_stk11xx::len_per_image, MAX_ISO_BUFS, usb_stk11xx::nbuffers, stk11xx_image_buf::offset, STK11XX_FRAME_SIZE, STK11XX_MAX_IMAGES, stk11xx_rvmalloc(), STK_DEBUG, STK_ERROR, and stk11xx_image_buf::vma_use_count.

int stk11xx_create_sysfs_files ( struct video_device *  vdev  ) 

Create the 'sys' entries.

This function permits to create all the entries in the 'sys' filesystem.

Parameters:
vdev Video device structure
Returns:
0 if all is OK

Definition at line 418 of file stk11xx-sysfs.c.

int stk11xx_decompress ( struct usb_stk11xx dev  ) 

Decompress a frame.

This function permits to decompress a frame from the video stream.

Parameters:
dev Device structure
Returns:
0 if all is OK

Definition at line 79 of file stk11xx-bayer.c.

References stk11xx_video::brightness, stk11xx_frame_buf::data, stk11xx_video::depth, usb_stk11xx::fill_image, stk11xx_video::hflip, usb_stk11xx::image, usb_stk11xx::image_data, usb_stk11xx::images, stk11xx_image_buf::offset, stk11xx_video::palette, usb_stk11xx::read_frame, usb_stk11xx::resolution, STK11XX_1024x768, STK11XX_1280x1024, STK11XX_128x96, STK11XX_160x120, STK11XX_213x160, STK11XX_320x240, STK11XX_640x480, STK11XX_800x600, STK11XX_80x60, stk11xx_b2bgr24(), stk11xx_b2bgr32(), stk11xx_b2rgb24(), stk11xx_b2rgb32(), stk11xx_correct_brightness(), STK11XX_PALETTE_BGR24, STK11XX_PALETTE_BGR32, STK11XX_PALETTE_RGB24, STK11XX_PALETTE_RGB32, stk11xx_video::vflip, usb_stk11xx::view, usb_stk11xx::vsettings, stk11xx_coord::x, and stk11xx_coord::y.

int stk11xx_free_buffers ( struct usb_stk11xx dev  ) 

Release all buffers.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to release and free the memory for each ISOC buffer.

Definition at line 276 of file stk11xx-buf.c.

References stk11xx_frame_buf::data, stk11xx_iso_buf::data, default_nbrframebuf, usb_stk11xx::framebuf, usb_stk11xx::image_data, usb_stk11xx::isobuf, usb_stk11xx::len_per_image, MAX_ISO_BUFS, usb_stk11xx::nbuffers, stk11xx_rvfree(), and STK_DEBUG.

int stk11xx_handle_frame ( struct usb_stk11xx dev  ) 

Handler frame.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function gets called for the isochronous pipe. This function is only called when a frame is ready. So we have to be fast to decompress the data.

Definition at line 396 of file stk11xx-buf.c.

References dev_stk11xx_watchdog_camera(), usb_stk11xx::empty_frames, usb_stk11xx::empty_frames_tail, usb_stk11xx::full_frames, stk11xx_frame_buf::next, usb_stk11xx::read_frame, usb_stk11xx::spinlock, stk11xx_decompress(), and STK_STREAM.

int stk11xx_next_frame ( struct usb_stk11xx dev  ) 

Prepare the next frame.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function is called when a frame is ready, so as to prepare the next frame.

Definition at line 341 of file stk11xx-buf.c.

References usb_stk11xx::empty_frames, usb_stk11xx::fill_frame, usb_stk11xx::full_frames, usb_stk11xx::full_frames_tail, stk11xx_frame_buf::next, usb_stk11xx::spinlock, STK_ERROR, and STK_STREAM.

void stk11xx_next_image ( struct usb_stk11xx dev  ) 

Prepare the next image.

Parameters:
dev Device structure
This function is called when an image is ready, so as to prepare the next image.

Definition at line 323 of file stk11xx-buf.c.

References usb_stk11xx::fill_image, usb_stk11xx::image_used, usb_stk11xx::nbuffers, and STK_STREAM.

void stk11xx_remove_sysfs_files ( struct video_device *  vdev  ) 

Remove the 'sys' entries.

This function permits to remove all the entries in the 'sys' filesystem.

Parameters:
vdev Video device structure
Returns:
0 if all is OK

Definition at line 445 of file stk11xx-sysfs.c.

int stk11xx_reset_buffers ( struct usb_stk11xx dev  ) 

Reset all ISOC buffers.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to reset all ISOC buffers.

Definition at line 219 of file stk11xx-buf.c.

References usb_stk11xx::empty_frames, usb_stk11xx::empty_frames_tail, stk11xx_frame_buf::errors, usb_stk11xx::fill_frame, usb_stk11xx::fill_image, stk11xx_frame_buf::filled, usb_stk11xx::framebuf, usb_stk11xx::full_frames, usb_stk11xx::full_frames_tail, usb_stk11xx::image_read_pos, usb_stk11xx::image_used, usb_stk11xx::nbuffers, stk11xx_frame_buf::next, usb_stk11xx::read_frame, usb_stk11xx::spinlock, and STK_DEBUG.

void usb_stk11xx_isoc_cleanup ( struct usb_stk11xx dev  ) 

Clean-up all the ISOC buffers.

Parameters:
dev Device structure
This function permits to clean-up all the ISOC buffers.

Definition at line 401 of file stk11xx-usb.c.

References usb_stk11xx::isobuf, usb_stk11xx::isoc_init_ok, MAX_ISO_BUFS, STK_DEBUG, and stk11xx_iso_buf::urb.

void usb_stk11xx_isoc_handler ( struct urb *  urb  ) 

ISOC handler.

Parameters:
urb URB structure
This function is called as an URB transfert is complete (Isochronous pipe). So, the traitement is done in interrupt time, so it has be fast, not crash, ans not stall. Neat.

Definition at line 213 of file stk11xx-usb.c.

References stk11xx_frame_buf::data, stk11xx_frame_buf::errors, usb_stk11xx::fill_frame, stk11xx_frame_buf::filled, usb_stk11xx::frame_size, stk11xx_next_frame(), STK_DEBUG, STK_ERROR, STK_STREAM, usb_stk11xx::udev, usb_stk11xx::vframes_dumped, usb_stk11xx::vframes_error, usb_stk11xx::visoc_errors, and usb_stk11xx::wait_frame.

int usb_stk11xx_isoc_init ( struct usb_stk11xx dev  ) 

Initilize an isochronous pipe.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to initialize an URB transfert (or isochronous pipe).

Definition at line 94 of file stk11xx-usb.c.

References stk11xx_iso_buf::data, ISO_BUFFER_SIZE, ISO_FRAMES_PER_DESC, ISO_MAX_FRAME_SIZE, usb_stk11xx::isobuf, usb_stk11xx::isoc_in_endpointAddr, usb_stk11xx::isoc_in_size, usb_stk11xx::isoc_init_ok, MAX_ISO_BUFS, STK_DEBUG, STK_ERROR, usb_stk11xx::udev, stk11xx_iso_buf::urb, and usb_stk11xx_isoc_handler().

int usb_stk11xx_read_registry ( struct usb_stk11xx dev,
__u16  index,
int *  value 
)

Read a 16-bits value from a 16-bits register.

Parameters:
dev 
index 
value 
Returns:
0 if all is OK
This function permits to read a 16-bits value from a 16-bits register on the USB bus.

Definition at line 542 of file stk11xx-usb.c.

References STK_ERROR, and usb_stk11xx::udev.

int usb_stk11xx_set_configuration ( struct usb_stk11xx dev  ) 

Send the message SET_CONFIGURATION.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to send the message SET_CONFIGURATION on the USB bus.

Definition at line 476 of file stk11xx-usb.c.

References STK_DEBUG, STK_ERROR, and usb_stk11xx::udev.

int usb_stk11xx_set_feature ( struct usb_stk11xx dev,
int  index 
)

Send the message SET_FEATURE and choose the interface.

Parameters:
dev Device structure
index Choice of the interface
Returns:
0 if all is OK
This function permits to send the message SET_FEATURE on the USB bus.

Definition at line 444 of file stk11xx-usb.c.

References STK_DEBUG, STK_ERROR, and usb_stk11xx::udev.

int usb_stk11xx_write_registry ( struct usb_stk11xx dev,
__u16  index,
__u16  value 
)

Write a 16-bits value to a 16-bits register.

Parameters:
dev 
index 
value 
Returns:
0 if all is OK
This function permits to write a 16-bits value to a 16-bits register on the USB bus.

Definition at line 510 of file stk11xx-usb.c.

References STK_ERROR, and usb_stk11xx::udev.

int v4l_stk11xx_register_video_device ( struct usb_stk11xx dev  ) 

Register the video device.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to register the USB device to the video device.

Definition at line 1524 of file stk11xx-v4l.c.

References DRIVER_DESC, STK_ERROR, STK_INFO, v4l_stk11xx_fops, usb_stk11xx::vdev, and VID_HARDWARE_STK11XX.

int v4l_stk11xx_select_video_mode ( struct usb_stk11xx dev,
int  width,
int  height 
)

Select a video mode.

Parameters:
dev 
width Width of wished resolution
height Height of wished resolution
Returns:
0 if all is OK
This function permits to check and select a video mode.

Definition at line 114 of file stk11xx-v4l.c.

References usb_stk11xx::frame_size, usb_stk11xx::image, usb_stk11xx::image_size, stk11xx_video::palette, usb_stk11xx::resolution, STK11XX_1024x768, STK11XX_1280x1024, STK11XX_128x96, STK11XX_160x120, STK11XX_213x160, STK11XX_320x240, STK11XX_640x480, STK11XX_800x600, STK11XX_80x60, STK11XX_NBR_SIZES, STK11XX_PALETTE_BGR24, STK11XX_PALETTE_BGR32, STK11XX_PALETTE_RGB24, STK11XX_PALETTE_RGB32, STK11XX_SXGA, STK11XX_VGA, STK_DEBUG, usb_stk11xx::view, usb_stk11xx::vsettings, usb_stk11xx::webcam_type, stk11xx_coord::x, and stk11xx_coord::y.

int v4l_stk11xx_unregister_video_device ( struct usb_stk11xx dev  ) 

Unregister the video device.

Parameters:
dev Device structure
Returns:
0 if all is OK
This function permits to unregister the video device.

Definition at line 1559 of file stk11xx-v4l.c.

References STK_INFO, and usb_stk11xx::vdev.


Variable Documentation

struct stk11xx_coord stk11xx_image_sizes[STK11XX_NBR_SIZES]

List of all resolutions supported by the driver

Definition at line 64 of file stk11xx-v4l.c.


Generated on Tue Oct 2 06:18:12 2007 for SyntekUSBVideoCamera by  doxygen 1.5.3