/* * File Name : pixelsmart.h * * Header file included in the driver. Should not be used by the application * or any test program. * Work done for final project, Course: CIS5930 * Course Name: Linux Kernel Programming & Device Driver Programming * Written by: Veena Adityan and Arthi Gokarn. * Submitted to: Dr. Baker * Date: 06/20/2003 * Copyright 2003 */ #ifndef _PIXELSMART_H #define _PIXELSMART_H #ifndef __KERNEL__ #define __KERNEL__ #endif #ifndef MODULE #define MODULE #endif /* *Uncomment if the printk statements used for debugging purpose are requrired */ //#define DEBUG #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "sysdep.h" #include "vidioctl.h" /* * Card Specifics */ #define PIXELSMART_VENDOR_ID 0x0004 #define PIXELSMART_DEVICE_ID 0x0404 #define PIXELSMART_CONTROL_REG 0x2000 #define PIXELSMART_Y_LOW_REG 0x2002 #define PIXELSMART_Y_HIGH_REG 0x2003 #define PIXELSMART_POLARITY_CONTROL_REG 0x2004 /* * The various commands for freeze, live, etc. */ #define PIXELSMART_EXTRIGSTATUS_MASK 0x01 #define PIXELSMART_FIELD_MASK 0x01 #define PIXELSMART_LIVE_CMD 0x91 #define PIXELSMART_FREEZE_IMM_CMD 0x5B #define PIXELSMART_FREEZE_NEXT_CMD 0x99 spinlock_t ps_lock; /* Streaming data buffer */ struct stream_buffer { struct v4l2_q_node qnode; struct v4l2_buffer vidbuf; int requested; __u8 *vaddress; /* vmalloc() */ int vma_refcount; }; /* * The maximum number of buffers that can be speicifed by the application * for streaming. */ #define MAX_CAPTURE_BUFFERS 5 // Can be increased to 30 if needed. struct pixelsmart{ int field; struct v4l2_device video_dev; struct pci_dev* dev; /* ptr to PCI device */ ulong pixelsmart_adr; /* bus address of IO memory */ ulong pixelsmart_mem; /* kernel address of IO memory */ ulong pixelsmart_len; /* kernel memory size */ wait_queue_head_t queue; /*For blocking a read*/ char *frame_buffer; int buf_size; /* video card details*/ uint swidth; /* screen width */ uint sheight; /* screen height */ /* State details */ char* fbuffer; /*framebuffers for mmap */ /* Client capture format and capture modes */ struct v4l2_pix_format clientfmt; struct v4l2_captureparm capture; int input; /* stream */ /* Capture state */ int ready_to_capture; int capture_completed; int streaming; struct stream_buffer stream_buf[MAX_CAPTURE_BUFFERS]; int stream_buffers_requested; int stream_buffers_mapped; struct v4l2_queue stream_q_capture; struct v4l2_queue stream_q_done; int q_cap_count; int getmoreframes; int bypp; //bytes per pixel unsigned long capture_size; }; #endif //_PIXELSMART_H