struct stream_buffer { struct v4l2_buffer vidbuf; /* For the V4L ioctl's */ int fields_grabbed; /* Two-bit pair of flags indicating which fields have been grabbed (i.e., 00 = no fields, 11 = both) */ struct list_head node; /* Connection into queues */ int requested; /* Set by REQBUF ioctl */ unsigned char *vaddress; /* This is the pointer to the vmalloc()'d memory into which the actual frame goes */ int vma_refcount; /* Reference count */ }; /********************************************************************/ /** * struct stream_buffer_queue - FIFO of stream_buffer structs */ struct stream_buffer_queue { struct stream_buffer *streambuf; /* Pointer to node data */ struct list_head head; /* Start of the queue */ rwlock_t lock; /* Lock to protect the queue */ int length; /* How many nodes are on the queue */ }; /********************************************************************/ /** * HRT device descriptor */ typedef struct { /* Added By Ryan Walega & Daniel Beech */ int registered; int num; int state; /* minor device number, index in hrt_devices[] */ unsigned long virt_addr; unsigned long phys_addr; /* cannot be opened again until released */ /* spinlock and is_locked control access to the device */ spinlock_t spinlock; int is_locked; wait_queue_head_t wait_queue; struct timer_list timer; struct tasklet_struct tasklet; int timer_active; int tasklet_active; /* timer_active != 0 iff timer or irq is active */ int irq; /* irq != 0 if board supports interrupts = -irq if handler not installed = irq if handler is installed */ volatile int irq_count; volatile int i2c_bits; /* last values written to i2c */ char saa7110_registers[HRT_SAA7110_MAXREG+1]; /* video data format, and dependent values */ int mode; int rows, cols, bytes_per_pixel; int win_row, win_col, win_width, win_height; /* current field being digitized */ int field; /* how many field changes we are waiting for */ int field_changes; /* the device is either frozen or being frozen */ int is_frozen; /* Local buffer for storing the frame currently read from the device */ /* Added june 8,2005 - atulya/sean */ unsigned char *framedata; /* Variable to keep track of the field being read inside the current frame */ unsigned int field_id; /* Semaphore for the device structure */ struct semaphore sem; /* Local buffer used for manipulation of the data returned * by the color device. * ONLY used by the color device */ unsigned char *localbuf; /* Flag for streaming mode */ int streaming; /* Number of buffers for streaming */ int numbufs; /* Array of buffers */ struct stream_buffer *streambufs; /* List of queued buffers */ struct stream_buffer_queue capture_list; /* List of filled buffers */ struct stream_buffer_queue done_list; int stream_buffers_mapped; struct stream_buffer stream_buf[MAX_CAPTURE_BUFFERS]; int stream_buffers_requested; /* Variable used to keep track of our state while streaming * added 13 June 2005 - Atulya/Sean */ int streaming_state; /* We allow the user to make the view upside down too ! * came out of compulsion actually since we have the cameras installed * upside down ! * the following variable determines what sort of output we return to the user * set using an ioctl */ int upside_down; /* Following structure used for registering with V4L */ struct video_device video_dev; struct v4l2_format clientfmt; struct v4l2_captureparm capture; /* Bytes per raster line. 640 for grey scale card * and 2*640 = 1280 for the color card */ unsigned int bytesperline; /* Memory size of the entire frame * = 512 X 480 X 1 bytes per pixel= 240 KB for grey scale card * = 640 X 480 X 2 bytes per pixel= 600 KB for color card */ unsigned int framesize; /* Current region of interest * fields = width,height,starty,startx */ struct subwindow *win; #ifdef CONFIG_PCI /* structure to represent a pci device */ struct pci_dev *pci_dev; #endif } hrt_t;