Bug
        
                          [В начало]
Ошибка # 52
Показать/спрятать трассу ошибок|            Error trace     
         {    19     typedef signed char __s8;    20     typedef unsigned char __u8;    22     typedef short __s16;    23     typedef unsigned short __u16;    25     typedef int __s32;    26     typedef unsigned int __u32;    29     typedef long long __s64;    30     typedef unsigned long long __u64;    15     typedef signed char s8;    16     typedef unsigned char u8;    19     typedef unsigned short u16;    21     typedef int s32;    22     typedef unsigned int u32;    24     typedef long long s64;    25     typedef unsigned long long u64;    14     typedef long __kernel_long_t;    15     typedef unsigned long __kernel_ulong_t;    27     typedef int __kernel_pid_t;    40     typedef __kernel_long_t __kernel_suseconds_t;    48     typedef unsigned int __kernel_uid32_t;    49     typedef unsigned int __kernel_gid32_t;    71     typedef __kernel_ulong_t __kernel_size_t;    72     typedef __kernel_long_t __kernel_ssize_t;    87     typedef long long __kernel_loff_t;    88     typedef __kernel_long_t __kernel_time_t;    89     typedef __kernel_long_t __kernel_clock_t;    90     typedef int __kernel_timer_t;    91     typedef int __kernel_clockid_t;    32     typedef __u16 __le16;    34     typedef __u32 __le32;   239     struct kernel_symbol {   unsigned long value;   const char *name; } ;    33     struct module ;    12     typedef __u32 __kernel_dev_t;    15     typedef __kernel_dev_t dev_t;    18     typedef unsigned short umode_t;    21     typedef __kernel_pid_t pid_t;    26     typedef __kernel_clockid_t clockid_t;    29     typedef _Bool bool;    31     typedef __kernel_uid32_t uid_t;    32     typedef __kernel_gid32_t gid_t;    45     typedef __kernel_loff_t loff_t;    54     typedef __kernel_size_t size_t;    59     typedef __kernel_ssize_t ssize_t;    69     typedef __kernel_time_t time_t;   102     typedef __s32 int32_t;   108     typedef __u32 uint32_t;   133     typedef unsigned long sector_t;   134     typedef unsigned long blkcnt_t;   144     typedef u64 dma_addr_t;   155     typedef unsigned int gfp_t;   156     typedef unsigned int fmode_t;   157     typedef unsigned int oom_flags_t;   175     struct __anonstruct_atomic_t_6 {   int counter; } ;   175     typedef struct __anonstruct_atomic_t_6 atomic_t;   180     struct __anonstruct_atomic64_t_7 {   long counter; } ;   180     typedef struct __anonstruct_atomic64_t_7 atomic64_t;   181     struct list_head {   struct list_head *next;   struct list_head *prev; } ;   186     struct hlist_node ;   186     struct hlist_head {   struct hlist_node *first; } ;   190     struct hlist_node {   struct hlist_node *next;   struct hlist_node **pprev; } ;   201     struct callback_head {   struct callback_head *next;   void (*func)(struct callback_head *); } ;    67     struct pt_regs {   unsigned long r15;   unsigned long r14;   unsigned long r13;   unsigned long r12;   unsigned long bp;   unsigned long bx;   unsigned long r11;   unsigned long r10;   unsigned long r9;   unsigned long r8;   unsigned long ax;   unsigned long cx;   unsigned long dx;   unsigned long si;   unsigned long di;   unsigned long orig_ax;   unsigned long ip;   unsigned long cs;   unsigned long flags;   unsigned long sp;   unsigned long ss; } ;    59     struct __anonstruct____missing_field_name_9 {   unsigned int a;   unsigned int b; } ;    59     struct __anonstruct____missing_field_name_10 {   u16 limit0;   u16 base0;   unsigned char base1;   unsigned char type;   unsigned char s;   unsigned char dpl;   unsigned char p;   unsigned char limit;   unsigned char avl;   unsigned char l;   unsigned char d;   unsigned char g;   unsigned char base2; } ;    59     union __anonunion____missing_field_name_8 {   struct __anonstruct____missing_field_name_9 __annonCompField4;   struct __anonstruct____missing_field_name_10 __annonCompField5; } ;    59     struct desc_struct {   union __anonunion____missing_field_name_8 __annonCompField6; } ;    12     typedef unsigned long pteval_t;    15     typedef unsigned long pgdval_t;    16     typedef unsigned long pgprotval_t;    18     struct __anonstruct_pte_t_11 {   pteval_t pte; } ;    18     typedef struct __anonstruct_pte_t_11 pte_t;    20     struct pgprot {   pgprotval_t pgprot; } ;   218     typedef struct pgprot pgprot_t;   220     struct __anonstruct_pgd_t_12 {   pgdval_t pgd; } ;   220     typedef struct __anonstruct_pgd_t_12 pgd_t;   361     struct page ;   361     typedef struct page *pgtable_t;   369     struct file ;   382     struct seq_file ;   420     struct thread_struct ;   422     struct mm_struct ;   423     struct task_struct ;   424     struct cpumask ;   327     struct arch_spinlock ;    18     typedef u16 __ticket_t;    19     typedef u32 __ticketpair_t;    20     struct __raw_tickets {   __ticket_t head;   __ticket_t tail; } ;    32     union __anonunion____missing_field_name_15 {   __ticketpair_t head_tail;   struct __raw_tickets tickets; } ;    32     struct arch_spinlock {   union __anonunion____missing_field_name_15 __annonCompField7; } ;    33     typedef struct arch_spinlock arch_spinlock_t;    34     struct qrwlock {   atomic_t cnts;   arch_spinlock_t lock; } ;    14     typedef struct qrwlock arch_rwlock_t;   142     typedef void (*ctor_fn_t)();    48     struct device ;   413     struct file_operations ;   425     struct completion ;   555     struct bug_entry {   int bug_addr_disp;   int file_disp;   unsigned short line;   unsigned short flags; } ;   102     struct timespec ;   103     struct compat_timespec ;   104     struct __anonstruct_futex_17 {   u32 *uaddr;   u32 val;   u32 flags;   u32 bitset;   u64 time;   u32 *uaddr2; } ;   104     struct __anonstruct_nanosleep_18 {   clockid_t clockid;   struct timespec *rmtp;   struct compat_timespec *compat_rmtp;   u64 expires; } ;   104     struct pollfd ;   104     struct __anonstruct_poll_19 {   struct pollfd *ufds;   int nfds;   int has_timeout;   unsigned long tv_sec;   unsigned long tv_nsec; } ;   104     union __anonunion____missing_field_name_16 {   struct __anonstruct_futex_17 futex;   struct __anonstruct_nanosleep_18 nanosleep;   struct __anonstruct_poll_19 poll; } ;   104     struct restart_block {   long int (*fn)(struct restart_block *);   union __anonunion____missing_field_name_16 __annonCompField8; } ;   127     struct kernel_vm86_regs {   struct pt_regs pt;   unsigned short es;   unsigned short __esh;   unsigned short ds;   unsigned short __dsh;   unsigned short fs;   unsigned short __fsh;   unsigned short gs;   unsigned short __gsh; } ;    79     union __anonunion____missing_field_name_20 {   struct pt_regs *regs;   struct kernel_vm86_regs *vm86; } ;    79     struct math_emu_info {   long ___orig_eip;   union __anonunion____missing_field_name_20 __annonCompField9; } ;   332     struct cpumask {   unsigned long bits[128U]; } ;    14     typedef struct cpumask cpumask_t;   655     typedef struct cpumask *cpumask_var_t;   161     struct seq_operations ;   293     struct i387_fsave_struct {   u32 cwd;   u32 swd;   u32 twd;   u32 fip;   u32 fcs;   u32 foo;   u32 fos;   u32 st_space[20U];   u32 status; } ;   311     struct __anonstruct____missing_field_name_25 {   u64 rip;   u64 rdp; } ;   311     struct __anonstruct____missing_field_name_26 {   u32 fip;   u32 fcs;   u32 foo;   u32 fos; } ;   311     union __anonunion____missing_field_name_24 {   struct __anonstruct____missing_field_name_25 __annonCompField13;   struct __anonstruct____missing_field_name_26 __annonCompField14; } ;   311     union __anonunion____missing_field_name_27 {   u32 padding1[12U];   u32 sw_reserved[12U]; } ;   311     struct i387_fxsave_struct {   u16 cwd;   u16 swd;   u16 twd;   u16 fop;   union __anonunion____missing_field_name_24 __annonCompField15;   u32 mxcsr;   u32 mxcsr_mask;   u32 st_space[32U];   u32 xmm_space[64U];   u32 padding[12U];   union __anonunion____missing_field_name_27 __annonCompField16; } ;   345     struct i387_soft_struct {   u32 cwd;   u32 swd;   u32 twd;   u32 fip;   u32 fcs;   u32 foo;   u32 fos;   u32 st_space[20U];   u8 ftop;   u8 changed;   u8 lookahead;   u8 no_update;   u8 rm;   u8 alimit;   struct math_emu_info *info;   u32 entry_eip; } ;   366     struct ymmh_struct {   u32 ymmh_space[64U]; } ;   371     struct lwp_struct {   u8 reserved[128U]; } ;   376     struct bndreg {   u64 lower_bound;   u64 upper_bound; } ;   381     struct bndcsr {   u64 bndcfgu;   u64 bndstatus; } ;   386     struct xsave_hdr_struct {   u64 xstate_bv;   u64 xcomp_bv;   u64 reserved[6U]; } ;   392     struct xsave_struct {   struct i387_fxsave_struct i387;   struct xsave_hdr_struct xsave_hdr;   struct ymmh_struct ymmh;   struct lwp_struct lwp;   struct bndreg bndreg[4U];   struct bndcsr bndcsr; } ;   401     union thread_xstate {   struct i387_fsave_struct fsave;   struct i387_fxsave_struct fxsave;   struct i387_soft_struct soft;   struct xsave_struct xsave; } ;   409     struct fpu {   unsigned int last_cpu;   unsigned int has_fpu;   union thread_xstate *state; } ;   465     struct kmem_cache ;   466     struct perf_event ;   467     struct thread_struct {   struct desc_struct tls_array[3U];   unsigned long sp0;   unsigned long sp;   unsigned long usersp;   unsigned short es;   unsigned short ds;   unsigned short fsindex;   unsigned short gsindex;   unsigned long fs;   unsigned long gs;   struct perf_event *ptrace_bps[4U];   unsigned long debugreg6;   unsigned long ptrace_dr7;   unsigned long cr2;   unsigned long trap_nr;   unsigned long error_code;   struct fpu fpu;   unsigned long *io_bitmap_ptr;   unsigned long iopl;   unsigned int io_bitmap_max;   unsigned char fpu_counter; } ;    23     typedef atomic64_t atomic_long_t;    35     struct lockdep_map ;    55     struct stack_trace {   unsigned int nr_entries;   unsigned int max_entries;   unsigned long *entries;   int skip; } ;    30     struct lockdep_subclass_key {   char __one_byte; } ;    53     struct lock_class_key {   struct lockdep_subclass_key subkeys[8U]; } ;    59     struct lock_class {   struct list_head hash_entry;   struct list_head lock_entry;   struct lockdep_subclass_key *key;   unsigned int subclass;   unsigned int dep_gen_id;   unsigned long usage_mask;   struct stack_trace usage_traces[13U];   struct list_head locks_after;   struct list_head locks_before;   unsigned int version;   unsigned long ops;   const char *name;   int name_version;   unsigned long contention_point[4U];   unsigned long contending_point[4U]; } ;   144     struct lockdep_map {   struct lock_class_key *key;   struct lock_class *class_cache[2U];   const char *name;   int cpu;   unsigned long ip; } ;   205     struct held_lock {   u64 prev_chain_key;   unsigned long acquire_ip;   struct lockdep_map *instance;   struct lockdep_map *nest_lock;   u64 waittime_stamp;   u64 holdtime_stamp;   unsigned short class_idx;   unsigned char irq_context;   unsigned char trylock;   unsigned char read;   unsigned char check;   unsigned char hardirqs_off;   unsigned short references; } ;   536     struct raw_spinlock {   arch_spinlock_t raw_lock;   unsigned int magic;   unsigned int owner_cpu;   void *owner;   struct lockdep_map dep_map; } ;    32     typedef struct raw_spinlock raw_spinlock_t;    33     struct __anonstruct____missing_field_name_31 {   u8 __padding[24U];   struct lockdep_map dep_map; } ;    33     union __anonunion____missing_field_name_30 {   struct raw_spinlock rlock;   struct __anonstruct____missing_field_name_31 __annonCompField18; } ;    33     struct spinlock {   union __anonunion____missing_field_name_30 __annonCompField19; } ;    76     typedef struct spinlock spinlock_t;    23     struct __anonstruct_rwlock_t_32 {   arch_rwlock_t raw_lock;   unsigned int magic;   unsigned int owner_cpu;   void *owner;   struct lockdep_map dep_map; } ;    23     typedef struct __anonstruct_rwlock_t_32 rwlock_t;   426     struct seqcount {   unsigned int sequence;   struct lockdep_map dep_map; } ;    51     typedef struct seqcount seqcount_t;   284     struct __anonstruct_seqlock_t_45 {   struct seqcount seqcount;   spinlock_t lock; } ;   284     typedef struct __anonstruct_seqlock_t_45 seqlock_t;   478     struct timespec {   __kernel_time_t tv_sec;   long tv_nsec; } ;    13     struct timeval {   __kernel_time_t tv_sec;   __kernel_suseconds_t tv_usec; } ;    83     struct user_namespace ;    22     struct __anonstruct_kuid_t_46 {   uid_t val; } ;    22     typedef struct __anonstruct_kuid_t_46 kuid_t;    27     struct __anonstruct_kgid_t_47 {   gid_t val; } ;    27     typedef struct __anonstruct_kgid_t_47 kgid_t;   127     struct kstat {   u64 ino;   dev_t dev;   umode_t mode;   unsigned int nlink;   kuid_t uid;   kgid_t gid;   dev_t rdev;   loff_t size;   struct timespec atime;   struct timespec mtime;   struct timespec ctime;   unsigned long blksize;   unsigned long long blocks; } ;    36     struct vm_area_struct ;    12     struct __wait_queue ;    12     typedef struct __wait_queue wait_queue_t;    15     struct __wait_queue {   unsigned int flags;   void *private;   int (*func)(wait_queue_t *, unsigned int, int, void *);   struct list_head task_list; } ;    38     struct __wait_queue_head {   spinlock_t lock;   struct list_head task_list; } ;    43     typedef struct __wait_queue_head wait_queue_head_t;    95     struct __anonstruct_nodemask_t_48 {   unsigned long bits[16U]; } ;    95     typedef struct __anonstruct_nodemask_t_48 nodemask_t;    13     struct optimistic_spin_queue {   atomic_t tail; } ;    34     struct mutex {   atomic_t count;   spinlock_t wait_lock;   struct list_head wait_list;   struct task_struct *owner;   void *magic;   struct lockdep_map dep_map; } ;    67     struct mutex_waiter {   struct list_head list;   struct task_struct *task;   void *magic; } ;   177     struct rw_semaphore ;   178     struct rw_semaphore {   long count;   struct list_head wait_list;   raw_spinlock_t wait_lock;   struct optimistic_spin_queue osq;   struct task_struct *owner;   struct lockdep_map dep_map; } ;   172     struct completion {   unsigned int done;   wait_queue_head_t wait; } ;   311     union ktime {   s64 tv64; } ;    41     typedef union ktime ktime_t;   267     struct tvec_base ;   268     struct timer_list {   struct list_head entry;   unsigned long expires;   struct tvec_base *base;   void (*function)(unsigned long);   unsigned long data;   int slack;   int start_pid;   void *start_site;   char start_comm[16U];   struct lockdep_map lockdep_map; } ;   254     struct hrtimer ;   255     enum hrtimer_restart ;   266     struct workqueue_struct ;   267     struct work_struct ;    53     struct work_struct {   atomic_long_t data;   struct list_head entry;   void (*func)(struct work_struct *);   struct lockdep_map lockdep_map; } ;   106     struct delayed_work {   struct work_struct work;   struct timer_list timer;   struct workqueue_struct *wq;   int cpu; } ;    58     struct pm_message {   int event; } ;    64     typedef struct pm_message pm_message_t;    65     struct dev_pm_ops {   int (*prepare)(struct device *);   void (*complete)(struct device *);   int (*suspend)(struct device *);   int (*resume)(struct device *);   int (*freeze)(struct device *);   int (*thaw)(struct device *);   int (*poweroff)(struct device *);   int (*restore)(struct device *);   int (*suspend_late)(struct device *);   int (*resume_early)(struct device *);   int (*freeze_late)(struct device *);   int (*thaw_early)(struct device *);   int (*poweroff_late)(struct device *);   int (*restore_early)(struct device *);   int (*suspend_noirq)(struct device *);   int (*resume_noirq)(struct device *);   int (*freeze_noirq)(struct device *);   int (*thaw_noirq)(struct device *);   int (*poweroff_noirq)(struct device *);   int (*restore_noirq)(struct device *);   int (*runtime_suspend)(struct device *);   int (*runtime_resume)(struct device *);   int (*runtime_idle)(struct device *); } ;   320     enum rpm_status {   RPM_ACTIVE = 0,   RPM_RESUMING = 1,   RPM_SUSPENDED = 2,   RPM_SUSPENDING = 3 } ;   327     enum rpm_request {   RPM_REQ_NONE = 0,   RPM_REQ_IDLE = 1,   RPM_REQ_SUSPEND = 2,   RPM_REQ_AUTOSUSPEND = 3,   RPM_REQ_RESUME = 4 } ;   335     struct wakeup_source ;   337     struct pm_subsys_data {   spinlock_t lock;   unsigned int refcount;   struct list_head clock_list; } ;   540     struct dev_pm_qos ;   540     struct dev_pm_info {   pm_message_t power_state;   unsigned char can_wakeup;   unsigned char async_suspend;   bool is_prepared;   bool is_suspended;   bool is_noirq_suspended;   bool is_late_suspended;   bool ignore_children;   bool early_init;   bool direct_complete;   spinlock_t lock;   struct list_head entry;   struct completion completion;   struct wakeup_source *wakeup;   bool wakeup_path;   bool syscore;   struct timer_list suspend_timer;   unsigned long timer_expires;   struct work_struct work;   wait_queue_head_t wait_queue;   atomic_t usage_count;   atomic_t child_count;   unsigned char disable_depth;   unsigned char idle_notification;   unsigned char request_pending;   unsigned char deferred_resume;   unsigned char run_wake;   unsigned char runtime_auto;   unsigned char no_callbacks;   unsigned char irq_safe;   unsigned char use_autosuspend;   unsigned char timer_autosuspends;   unsigned char memalloc_noio;   enum rpm_request request;   enum rpm_status runtime_status;   int runtime_error;   int autosuspend_delay;   unsigned long last_busy;   unsigned long active_jiffies;   unsigned long suspended_jiffies;   unsigned long accounting_timestamp;   struct pm_subsys_data *subsys_data;   void (*set_latency_tolerance)(struct device *, s32 );   struct dev_pm_qos *qos; } ;   601     struct dev_pm_domain {   struct dev_pm_ops ops;   void (*detach)(struct device *, bool ); } ;    24     struct __anonstruct_mm_context_t_113 {   void *ldt;   int size;   unsigned short ia32_compat;   struct mutex lock;   void *vdso;   atomic_t perf_rdpmc_allowed; } ;    24     typedef struct __anonstruct_mm_context_t_113 mm_context_t;    19     struct rb_node {   unsigned long __rb_parent_color;   struct rb_node *rb_right;   struct rb_node *rb_left; } ;    40     struct rb_root {   struct rb_node *rb_node; } ;   177     struct device_node ;  1269     struct llist_node ;    64     struct llist_node {   struct llist_node *next; } ;   837     struct nsproxy ;    37     struct cred ;    19     struct inode ;    58     struct arch_uprobe_task {   unsigned long saved_scratch_register;   unsigned int saved_trap_nr;   unsigned int saved_tf; } ;    66     enum uprobe_task_state {   UTASK_RUNNING = 0,   UTASK_SSTEP = 1,   UTASK_SSTEP_ACK = 2,   UTASK_SSTEP_TRAPPED = 3 } ;    73     struct __anonstruct____missing_field_name_148 {   struct arch_uprobe_task autask;   unsigned long vaddr; } ;    73     struct __anonstruct____missing_field_name_149 {   struct callback_head dup_xol_work;   unsigned long dup_xol_addr; } ;    73     union __anonunion____missing_field_name_147 {   struct __anonstruct____missing_field_name_148 __annonCompField34;   struct __anonstruct____missing_field_name_149 __annonCompField35; } ;    73     struct uprobe ;    73     struct return_instance ;    73     struct uprobe_task {   enum uprobe_task_state state;   union __anonunion____missing_field_name_147 __annonCompField36;   struct uprobe *active_uprobe;   unsigned long xol_vaddr;   struct return_instance *return_instances;   unsigned int depth; } ;    94     struct xol_area ;    95     struct uprobes_state {   struct xol_area *xol_area; } ;   133     struct address_space ;   134     struct mem_cgroup ;    31     typedef void compound_page_dtor(struct page *);    32     union __anonunion____missing_field_name_150 {   struct address_space *mapping;   void *s_mem; } ;    32     union __anonunion____missing_field_name_152 {   unsigned long index;   void *freelist;   bool pfmemalloc; } ;    32     struct __anonstruct____missing_field_name_156 {   unsigned short inuse;   unsigned short objects;   unsigned char frozen; } ;    32     union __anonunion____missing_field_name_155 {   atomic_t _mapcount;   struct __anonstruct____missing_field_name_156 __annonCompField39;   int units; } ;    32     struct __anonstruct____missing_field_name_154 {   union __anonunion____missing_field_name_155 __annonCompField40;   atomic_t _count; } ;    32     union __anonunion____missing_field_name_153 {   unsigned long counters;   struct __anonstruct____missing_field_name_154 __annonCompField41;   unsigned int active; } ;    32     struct __anonstruct____missing_field_name_151 {   union __anonunion____missing_field_name_152 __annonCompField38;   union __anonunion____missing_field_name_153 __annonCompField42; } ;    32     struct __anonstruct____missing_field_name_158 {   struct page *next;   int pages;   int pobjects; } ;    32     struct slab ;    32     struct __anonstruct____missing_field_name_159 {   compound_page_dtor *compound_dtor;   unsigned long compound_order; } ;    32     union __anonunion____missing_field_name_157 {   struct list_head lru;   struct __anonstruct____missing_field_name_158 __annonCompField44;   struct slab *slab_page;   struct callback_head callback_head;   struct __anonstruct____missing_field_name_159 __annonCompField45;   pgtable_t pmd_huge_pte; } ;    32     union __anonunion____missing_field_name_160 {   unsigned long private;   spinlock_t *ptl;   struct kmem_cache *slab_cache;   struct page *first_page; } ;    32     struct page {   unsigned long flags;   union __anonunion____missing_field_name_150 __annonCompField37;   struct __anonstruct____missing_field_name_151 __annonCompField43;   union __anonunion____missing_field_name_157 __annonCompField46;   union __anonunion____missing_field_name_160 __annonCompField47;   struct mem_cgroup *mem_cgroup; } ;   181     struct page_frag {   struct page *page;   __u32 offset;   __u32 size; } ;   248     struct __anonstruct_shared_161 {   struct rb_node rb;   unsigned long rb_subtree_last; } ;   248     struct anon_vma ;   248     struct vm_operations_struct ;   248     struct mempolicy ;   248     struct vm_area_struct {   unsigned long vm_start;   unsigned long vm_end;   struct vm_area_struct *vm_next;   struct vm_area_struct *vm_prev;   struct rb_node vm_rb;   unsigned long rb_subtree_gap;   struct mm_struct *vm_mm;   pgprot_t vm_page_prot;   unsigned long vm_flags;   struct __anonstruct_shared_161 shared;   struct list_head anon_vma_chain;   struct anon_vma *anon_vma;   const struct vm_operations_struct *vm_ops;   unsigned long vm_pgoff;   struct file *vm_file;   void *vm_private_data;   struct mempolicy *vm_policy; } ;   316     struct core_thread {   struct task_struct *task;   struct core_thread *next; } ;   322     struct core_state {   atomic_t nr_threads;   struct core_thread dumper;   struct completion startup; } ;   335     struct task_rss_stat {   int events;   int count[3U]; } ;   343     struct mm_rss_stat {   atomic_long_t count[3U]; } ;   348     struct kioctx_table ;   349     struct linux_binfmt ;   349     struct mmu_notifier_mm ;   349     struct mm_struct {   struct vm_area_struct *mmap;   struct rb_root mm_rb;   u32 vmacache_seqnum;   unsigned long int (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);   unsigned long mmap_base;   unsigned long mmap_legacy_base;   unsigned long task_size;   unsigned long highest_vm_end;   pgd_t *pgd;   atomic_t mm_users;   atomic_t mm_count;   atomic_long_t nr_ptes;   atomic_long_t nr_pmds;   int map_count;   spinlock_t page_table_lock;   struct rw_semaphore mmap_sem;   struct list_head mmlist;   unsigned long hiwater_rss;   unsigned long hiwater_vm;   unsigned long total_vm;   unsigned long locked_vm;   unsigned long pinned_vm;   unsigned long shared_vm;   unsigned long exec_vm;   unsigned long stack_vm;   unsigned long def_flags;   unsigned long start_code;   unsigned long end_code;   unsigned long start_data;   unsigned long end_data;   unsigned long start_brk;   unsigned long brk;   unsigned long start_stack;   unsigned long arg_start;   unsigned long arg_end;   unsigned long env_start;   unsigned long env_end;   unsigned long saved_auxv[46U];   struct mm_rss_stat rss_stat;   struct linux_binfmt *binfmt;   cpumask_var_t cpu_vm_mask_var;   mm_context_t context;   unsigned long flags;   struct core_state *core_state;   spinlock_t ioctx_lock;   struct kioctx_table *ioctx_table;   struct task_struct *owner;   struct file *exe_file;   struct mmu_notifier_mm *mmu_notifier_mm;   struct cpumask cpumask_allocation;   unsigned long numa_next_scan;   unsigned long numa_scan_offset;   int numa_scan_seq;   bool tlb_flush_pending;   struct uprobes_state uprobes_state;   void *bd_addr; } ;    15     typedef __u64 Elf64_Addr;    16     typedef __u16 Elf64_Half;    20     typedef __u32 Elf64_Word;    21     typedef __u64 Elf64_Xword;   190     struct elf64_sym {   Elf64_Word st_name;   unsigned char st_info;   unsigned char st_other;   Elf64_Half st_shndx;   Elf64_Addr st_value;   Elf64_Xword st_size; } ;   198     typedef struct elf64_sym Elf64_Sym;    53     union __anonunion____missing_field_name_166 {   unsigned long bitmap[4U];   struct callback_head callback_head; } ;    53     struct idr_layer {   int prefix;   int layer;   struct idr_layer *ary[256U];   int count;   union __anonunion____missing_field_name_166 __annonCompField48; } ;    41     struct idr {   struct idr_layer *hint;   struct idr_layer *top;   int layers;   int cur;   spinlock_t lock;   int id_free_cnt;   struct idr_layer *id_free; } ;   124     struct ida_bitmap {   long nr_busy;   unsigned long bitmap[15U]; } ;   153     struct ida {   struct idr idr;   struct ida_bitmap *free_bitmap; } ;   185     struct dentry ;   186     struct iattr ;   187     struct super_block ;   188     struct file_system_type ;   189     struct kernfs_open_node ;   190     struct kernfs_iattrs ;   212     struct kernfs_root ;   212     struct kernfs_elem_dir {   unsigned long subdirs;   struct rb_root children;   struct kernfs_root *root; } ;    84     struct kernfs_node ;    84     struct kernfs_elem_symlink {   struct kernfs_node *target_kn; } ;    88     struct kernfs_ops ;    88     struct kernfs_elem_attr {   const struct kernfs_ops *ops;   struct kernfs_open_node *open;   loff_t size;   struct kernfs_node *notify_next; } ;    95     union __anonunion____missing_field_name_167 {   struct kernfs_elem_dir dir;   struct kernfs_elem_symlink symlink;   struct kernfs_elem_attr attr; } ;    95     struct kernfs_node {   atomic_t count;   atomic_t active;   struct lockdep_map dep_map;   struct kernfs_node *parent;   const char *name;   struct rb_node rb;   const void *ns;   unsigned int hash;   union __anonunion____missing_field_name_167 __annonCompField49;   void *priv;   unsigned short flags;   umode_t mode;   unsigned int ino;   struct kernfs_iattrs *iattr; } ;   137     struct kernfs_syscall_ops {   int (*remount_fs)(struct kernfs_root *, int *, char *);   int (*show_options)(struct seq_file *, struct kernfs_root *);   int (*mkdir)(struct kernfs_node *, const char *, umode_t );   int (*rmdir)(struct kernfs_node *);   int (*rename)(struct kernfs_node *, struct kernfs_node *, const char *); } ;   154     struct kernfs_root {   struct kernfs_node *kn;   unsigned int flags;   struct ida ino_ida;   struct kernfs_syscall_ops *syscall_ops;   struct list_head supers;   wait_queue_head_t deactivate_waitq; } ;   170     struct kernfs_open_file {   struct kernfs_node *kn;   struct file *file;   void *priv;   struct mutex mutex;   int event;   struct list_head list;   char *prealloc_buf;   size_t atomic_write_len;   bool mmapped;   const struct vm_operations_struct *vm_ops; } ;   187     struct kernfs_ops {   int (*seq_show)(struct seq_file *, void *);   void * (*seq_start)(struct seq_file *, loff_t *);   void * (*seq_next)(struct seq_file *, void *, loff_t *);   void (*seq_stop)(struct seq_file *, void *);   ssize_t  (*read)(struct kernfs_open_file *, char *, size_t , loff_t );   size_t atomic_write_len;   bool prealloc;   ssize_t  (*write)(struct kernfs_open_file *, char *, size_t , loff_t );   int (*mmap)(struct kernfs_open_file *, struct vm_area_struct *);   struct lock_class_key lockdep_key; } ;   469     struct sock ;   470     struct kobject ;   471     enum kobj_ns_type {   KOBJ_NS_TYPE_NONE = 0,   KOBJ_NS_TYPE_NET = 1,   KOBJ_NS_TYPES = 2 } ;   477     struct kobj_ns_type_operations {   enum kobj_ns_type type;   bool  (*current_may_mount)();   void * (*grab_current_ns)();   const void * (*netlink_ns)(struct sock *);   const void * (*initial_ns)();   void (*drop_ns)(void *); } ;    59     struct bin_attribute ;    60     struct attribute {   const char *name;   umode_t mode;   bool ignore_lockdep;   struct lock_class_key *key;   struct lock_class_key skey; } ;    37     struct attribute_group {   const char *name;   umode_t  (*is_visible)(struct kobject *, struct attribute *, int);   struct attribute **attrs;   struct bin_attribute **bin_attrs; } ;    67     struct bin_attribute {   struct attribute attr;   size_t size;   void *private;   ssize_t  (*read)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t , size_t );   ssize_t  (*write)(struct file *, struct kobject *, struct bin_attribute *, char *, loff_t , size_t );   int (*mmap)(struct file *, struct kobject *, struct bin_attribute *, struct vm_area_struct *); } ;   140     struct sysfs_ops {   ssize_t  (*show)(struct kobject *, struct attribute *, char *);   ssize_t  (*store)(struct kobject *, struct attribute *, const char *, size_t ); } ;   479     struct kref {   atomic_t refcount; } ;    52     struct kset ;    52     struct kobj_type ;    52     struct kobject {   const char *name;   struct list_head entry;   struct kobject *parent;   struct kset *kset;   struct kobj_type *ktype;   struct kernfs_node *sd;   struct kref kref;   struct delayed_work release;   unsigned char state_initialized;   unsigned char state_in_sysfs;   unsigned char state_add_uevent_sent;   unsigned char state_remove_uevent_sent;   unsigned char uevent_suppress; } ;   114     struct kobj_type {   void (*release)(struct kobject *);   const struct sysfs_ops *sysfs_ops;   struct attribute **default_attrs;   const struct kobj_ns_type_operations * (*child_ns_type)(struct kobject *);   const void * (*namespace)(struct kobject *); } ;   122     struct kobj_uevent_env {   char *argv[3U];   char *envp[32U];   int envp_idx;   char buf[2048U];   int buflen; } ;   130     struct kset_uevent_ops {   const int (*filter)(struct kset *, struct kobject *);   const const char * (*name)(struct kset *, struct kobject *);   const int (*uevent)(struct kset *, struct kobject *, struct kobj_uevent_env *); } ;   147     struct kset {   struct list_head list;   spinlock_t list_lock;   struct kobject kobj;   const struct kset_uevent_ops *uevent_ops; } ;   222     struct kernel_param ;   227     struct kernel_param_ops {   unsigned int flags;   int (*set)(const char *, const struct kernel_param *);   int (*get)(char *, const struct kernel_param *);   void (*free)(void *); } ;    62     struct kparam_string ;    62     struct kparam_array ;    62     union __anonunion____missing_field_name_168 {   void *arg;   const struct kparam_string *str;   const struct kparam_array *arr; } ;    62     struct kernel_param {   const char *name;   const struct kernel_param_ops *ops;   u16 perm;   s8 level;   u8 flags;   union __anonunion____missing_field_name_168 __annonCompField50; } ;    82     struct kparam_string {   unsigned int maxlen;   char *string; } ;    88     struct kparam_array {   unsigned int max;   unsigned int elemsize;   unsigned int *num;   const struct kernel_param_ops *ops;   void *elem; } ;   496     struct mod_arch_specific { } ;    36     struct module_param_attrs ;    36     struct module_kobject {   struct kobject kobj;   struct module *mod;   struct kobject *drivers_dir;   struct module_param_attrs *mp;   struct completion *kobj_completion; } ;    46     struct module_attribute {   struct attribute attr;   ssize_t  (*show)(struct module_attribute *, struct module_kobject *, char *);   ssize_t  (*store)(struct module_attribute *, struct module_kobject *, const char *, size_t );   void (*setup)(struct module *, const char *);   int (*test)(struct module *);   void (*free)(struct module *); } ;    72     struct exception_table_entry ;   205     enum module_state {   MODULE_STATE_LIVE = 0,   MODULE_STATE_COMING = 1,   MODULE_STATE_GOING = 2,   MODULE_STATE_UNFORMED = 3 } ;   212     struct module_sect_attrs ;   212     struct module_notes_attrs ;   212     struct tracepoint ;   212     struct ftrace_event_call ;   212     struct module {   enum module_state state;   struct list_head list;   char name[56U];   struct module_kobject mkobj;   struct module_attribute *modinfo_attrs;   const char *version;   const char *srcversion;   struct kobject *holders_dir;   const struct kernel_symbol *syms;   const unsigned long *crcs;   unsigned int num_syms;   struct kernel_param *kp;   unsigned int num_kp;   unsigned int num_gpl_syms;   const struct kernel_symbol *gpl_syms;   const unsigned long *gpl_crcs;   const struct kernel_symbol *unused_syms;   const unsigned long *unused_crcs;   unsigned int num_unused_syms;   unsigned int num_unused_gpl_syms;   const struct kernel_symbol *unused_gpl_syms;   const unsigned long *unused_gpl_crcs;   bool sig_ok;   const struct kernel_symbol *gpl_future_syms;   const unsigned long *gpl_future_crcs;   unsigned int num_gpl_future_syms;   unsigned int num_exentries;   struct exception_table_entry *extable;   int (*init)();   void *module_init;   void *module_core;   unsigned int init_size;   unsigned int core_size;   unsigned int init_text_size;   unsigned int core_text_size;   unsigned int init_ro_size;   unsigned int core_ro_size;   struct mod_arch_specific arch;   unsigned int taints;   unsigned int num_bugs;   struct list_head bug_list;   struct bug_entry *bug_table;   Elf64_Sym *symtab;   Elf64_Sym *core_symtab;   unsigned int num_symtab;   unsigned int core_num_syms;   char *strtab;   char *core_strtab;   struct module_sect_attrs *sect_attrs;   struct module_notes_attrs *notes_attrs;   char *args;   void *percpu;   unsigned int percpu_size;   unsigned int num_tracepoints;   const struct tracepoint **tracepoints_ptrs;   unsigned int num_trace_bprintk_fmt;   const char **trace_bprintk_fmt_start;   struct ftrace_event_call **trace_events;   unsigned int num_trace_events;   struct list_head source_list;   struct list_head target_list;   void (*exit)();   atomic_t refcnt;   ctor_fn_t  (**ctors)();   unsigned int num_ctors; } ;    13     typedef unsigned long kernel_ulong_t;   186     struct acpi_device_id {   __u8 id[9U];   kernel_ulong_t driver_data; } ;   219     struct of_device_id {   char name[32U];   char type[32U];   char compatible[128U];   const void *data; } ;   623     struct usb_ctrlrequest {   __u8 bRequestType;   __u8 bRequest;   __le16 wValue;   __le16 wIndex;   __le16 wLength; } ;   253     struct usb_device_descriptor {   __u8 bLength;   __u8 bDescriptorType;   __le16 bcdUSB;   __u8 bDeviceClass;   __u8 bDeviceSubClass;   __u8 bDeviceProtocol;   __u8 bMaxPacketSize0;   __le16 idVendor;   __le16 idProduct;   __le16 bcdDevice;   __u8 iManufacturer;   __u8 iProduct;   __u8 iSerialNumber;   __u8 bNumConfigurations; } ;   275     struct usb_config_descriptor {   __u8 bLength;   __u8 bDescriptorType;   __le16 wTotalLength;   __u8 bNumInterfaces;   __u8 bConfigurationValue;   __u8 iConfiguration;   __u8 bmAttributes;   __u8 bMaxPower; } ;   343     struct usb_interface_descriptor {   __u8 bLength;   __u8 bDescriptorType;   __u8 bInterfaceNumber;   __u8 bAlternateSetting;   __u8 bNumEndpoints;   __u8 bInterfaceClass;   __u8 bInterfaceSubClass;   __u8 bInterfaceProtocol;   __u8 iInterface; } ;   363     struct usb_endpoint_descriptor {   __u8 bLength;   __u8 bDescriptorType;   __u8 bEndpointAddress;   __u8 bmAttributes;   __le16 wMaxPacketSize;   __u8 bInterval;   __u8 bRefresh;   __u8 bSynchAddress; } ;   613     struct usb_ss_ep_comp_descriptor {   __u8 bLength;   __u8 bDescriptorType;   __u8 bMaxBurst;   __u8 bmAttributes;   __le16 wBytesPerInterval; } ;   692     struct usb_interface_assoc_descriptor {   __u8 bLength;   __u8 bDescriptorType;   __u8 bFirstInterface;   __u8 bInterfaceCount;   __u8 bFunctionClass;   __u8 bFunctionSubClass;   __u8 bFunctionProtocol;   __u8 iFunction; } ;   751     struct usb_bos_descriptor {   __u8 bLength;   __u8 bDescriptorType;   __le16 wTotalLength;   __u8 bNumDeviceCaps; } ;   801     struct usb_ext_cap_descriptor {   __u8 bLength;   __u8 bDescriptorType;   __u8 bDevCapabilityType;   __le32 bmAttributes; } ;   811     struct usb_ss_cap_descriptor {   __u8 bLength;   __u8 bDescriptorType;   __u8 bDevCapabilityType;   __u8 bmAttributes;   __le16 wSpeedSupported;   __u8 bFunctionalitySupport;   __u8 bU1devExitLat;   __le16 bU2DevExitLat; } ;   840     struct usb_ss_container_id_descriptor {   __u8 bLength;   __u8 bDescriptorType;   __u8 bDevCapabilityType;   __u8 bReserved;   __u8 ContainerID[16U]; } ;   905     enum usb_device_speed {   USB_SPEED_UNKNOWN = 0,   USB_SPEED_LOW = 1,   USB_SPEED_FULL = 2,   USB_SPEED_HIGH = 3,   USB_SPEED_WIRELESS = 4,   USB_SPEED_SUPER = 5 } ;   914     enum usb_device_state {   USB_STATE_NOTATTACHED = 0,   USB_STATE_ATTACHED = 1,   USB_STATE_POWERED = 2,   USB_STATE_RECONNECTING = 3,   USB_STATE_UNAUTHENTICATED = 4,   USB_STATE_DEFAULT = 5,   USB_STATE_ADDRESS = 6,   USB_STATE_CONFIGURED = 7,   USB_STATE_SUSPENDED = 8 } ;    62     struct exception_table_entry {   int insn;   int fixup; } ;    61     struct timerqueue_node {   struct rb_node node;   ktime_t expires; } ;    12     struct timerqueue_head {   struct rb_root head;   struct timerqueue_node *next; } ;    50     struct hrtimer_clock_base ;    51     struct hrtimer_cpu_base ;    60     enum hrtimer_restart {   HRTIMER_NORESTART = 0,   HRTIMER_RESTART = 1 } ;    65     struct hrtimer {   struct timerqueue_node node;   ktime_t _softexpires;   enum hrtimer_restart  (*function)(struct hrtimer *);   struct hrtimer_clock_base *base;   unsigned long state;   int start_pid;   void *start_site;   char start_comm[16U]; } ;   132     struct hrtimer_clock_base {   struct hrtimer_cpu_base *cpu_base;   int index;   clockid_t clockid;   struct timerqueue_head active;   ktime_t resolution;   ktime_t  (*get_time)();   ktime_t softirq_time;   ktime_t offset; } ;   163     struct hrtimer_cpu_base {   raw_spinlock_t lock;   unsigned int cpu;   unsigned int active_bases;   unsigned int clock_was_set;   ktime_t expires_next;   int in_hrtirq;   int hres_active;   int hang_detected;   unsigned long nr_events;   unsigned long nr_retries;   unsigned long nr_hangs;   ktime_t max_hang_time;   struct hrtimer_clock_base clock_base[4U]; } ;   652     struct klist_node ;    37     struct klist_node {   void *n_klist;   struct list_head n_node;   struct kref n_ref; } ;    67     struct path ;    68     struct seq_file {   char *buf;   size_t size;   size_t from;   size_t count;   size_t pad_until;   loff_t index;   loff_t read_pos;   u64 version;   struct mutex lock;   const struct seq_operations *op;   int poll_event;   struct user_namespace *user_ns;   void *private; } ;    35     struct seq_operations {   void * (*start)(struct seq_file *, loff_t *);   void (*stop)(struct seq_file *, void *);   void * (*next)(struct seq_file *, void *, loff_t *);   int (*show)(struct seq_file *, void *); } ;   186     struct pinctrl ;   187     struct pinctrl_state ;   194     struct dev_pin_info {   struct pinctrl *p;   struct pinctrl_state *default_state;   struct pinctrl_state *sleep_state;   struct pinctrl_state *idle_state; } ;    48     struct dma_map_ops ;    48     struct dev_archdata {   struct dma_map_ops *dma_ops;   void *iommu; } ;    14     struct device_private ;    15     struct device_driver ;    16     struct driver_private ;    17     struct class ;    18     struct subsys_private ;    19     struct bus_type ;    20     struct iommu_ops ;    21     struct iommu_group ;    60     struct device_attribute ;    60     struct bus_type {   const char *name;   const char *dev_name;   struct device *dev_root;   struct device_attribute *dev_attrs;   const struct attribute_group **bus_groups;   const struct attribute_group **dev_groups;   const struct attribute_group **drv_groups;   int (*match)(struct device *, struct device_driver *);   int (*uevent)(struct device *, struct kobj_uevent_env *);   int (*probe)(struct device *);   int (*remove)(struct device *);   void (*shutdown)(struct device *);   int (*online)(struct device *);   int (*offline)(struct device *);   int (*suspend)(struct device *, pm_message_t );   int (*resume)(struct device *);   const struct dev_pm_ops *pm;   const struct iommu_ops *iommu_ops;   struct subsys_private *p;   struct lock_class_key lock_key; } ;   138     struct device_type ;   196     struct device_driver {   const char *name;   struct bus_type *bus;   struct module *owner;   const char *mod_name;   bool suppress_bind_attrs;   const struct of_device_id *of_match_table;   const struct acpi_device_id *acpi_match_table;   int (*probe)(struct device *);   int (*remove)(struct device *);   void (*shutdown)(struct device *);   int (*suspend)(struct device *, pm_message_t );   int (*resume)(struct device *);   const struct attribute_group **groups;   const struct dev_pm_ops *pm;   struct driver_private *p; } ;   322     struct class_attribute ;   322     struct class {   const char *name;   struct module *owner;   struct class_attribute *class_attrs;   const struct attribute_group **dev_groups;   struct kobject *dev_kobj;   int (*dev_uevent)(struct device *, struct kobj_uevent_env *);   char * (*devnode)(struct device *, umode_t *);   void (*class_release)(struct class *);   void (*dev_release)(struct device *);   int (*suspend)(struct device *, pm_message_t );   int (*resume)(struct device *);   const struct kobj_ns_type_operations *ns_type;   const void * (*namespace)(struct device *);   const struct dev_pm_ops *pm;   struct subsys_private *p; } ;   415     struct class_attribute {   struct attribute attr;   ssize_t  (*show)(struct class *, struct class_attribute *, char *);   ssize_t  (*store)(struct class *, struct class_attribute *, const char *, size_t ); } ;   483     struct device_type {   const char *name;   const struct attribute_group **groups;   int (*uevent)(struct device *, struct kobj_uevent_env *);   char * (*devnode)(struct device *, umode_t *, kuid_t *, kgid_t *);   void (*release)(struct device *);   const struct dev_pm_ops *pm; } ;   511     struct device_attribute {   struct attribute attr;   ssize_t  (*show)(struct device *, struct device_attribute *, char *);   ssize_t  (*store)(struct device *, struct device_attribute *, const char *, size_t ); } ;   643     struct device_dma_parameters {   unsigned int max_segment_size;   unsigned long segment_boundary_mask; } ;   652     struct acpi_device ;   653     struct acpi_dev_node {   struct acpi_device *companion; } ;   659     struct dma_coherent_mem ;   659     struct cma ;   659     struct device {   struct device *parent;   struct device_private *p;   struct kobject kobj;   const char *init_name;   const struct device_type *type;   struct mutex mutex;   struct bus_type *bus;   struct device_driver *driver;   void *platform_data;   void *driver_data;   struct dev_pm_info power;   struct dev_pm_domain *pm_domain;   struct dev_pin_info *pins;   int numa_node;   u64 *dma_mask;   u64 coherent_dma_mask;   unsigned long dma_pfn_offset;   struct device_dma_parameters *dma_parms;   struct list_head dma_pools;   struct dma_coherent_mem *dma_mem;   struct cma *cma_area;   struct dev_archdata archdata;   struct device_node *of_node;   struct acpi_dev_node acpi_node;   dev_t devt;   u32 id;   spinlock_t devres_lock;   struct list_head devres_head;   struct klist_node knode_class;   struct class *class;   const struct attribute_group **groups;   void (*release)(struct device *);   struct iommu_group *iommu_group;   bool offline_disabled;   bool offline; } ;   806     struct wakeup_source {   const char *name;   struct list_head entry;   spinlock_t lock;   struct timer_list timer;   unsigned long timer_expires;   ktime_t total_time;   ktime_t max_time;   ktime_t last_time;   ktime_t start_prevent_time;   ktime_t prevent_sleep_time;   unsigned long event_count;   unsigned long active_count;   unsigned long relax_count;   unsigned long expire_count;   unsigned long wakeup_count;   bool active;   bool autosleep_enabled; } ;    93     struct hlist_bl_node ;    93     struct hlist_bl_head {   struct hlist_bl_node *first; } ;    36     struct hlist_bl_node {   struct hlist_bl_node *next;   struct hlist_bl_node **pprev; } ;   114     struct __anonstruct____missing_field_name_177 {   spinlock_t lock;   int count; } ;   114     union __anonunion____missing_field_name_176 {   struct __anonstruct____missing_field_name_177 __annonCompField54; } ;   114     struct lockref {   union __anonunion____missing_field_name_176 __annonCompField55; } ;    50     struct vfsmount ;    51     struct __anonstruct____missing_field_name_179 {   u32 hash;   u32 len; } ;    51     union __anonunion____missing_field_name_178 {   struct __anonstruct____missing_field_name_179 __annonCompField56;   u64 hash_len; } ;    51     struct qstr {   union __anonunion____missing_field_name_178 __annonCompField57;   const unsigned char *name; } ;    90     struct dentry_operations ;    90     union __anonunion_d_u_180 {   struct hlist_node d_alias;   struct callback_head d_rcu; } ;    90     struct dentry {   unsigned int d_flags;   seqcount_t d_seq;   struct hlist_bl_node d_hash;   struct dentry *d_parent;   struct qstr d_name;   struct inode *d_inode;   unsigned char d_iname[32U];   struct lockref d_lockref;   const struct dentry_operations *d_op;   struct super_block *d_sb;   unsigned long d_time;   void *d_fsdata;   struct list_head d_lru;   struct list_head d_child;   struct list_head d_subdirs;   union __anonunion_d_u_180 d_u; } ;   142     struct dentry_operations {   int (*d_revalidate)(struct dentry *, unsigned int);   int (*d_weak_revalidate)(struct dentry *, unsigned int);   int (*d_hash)(const struct dentry *, struct qstr *);   int (*d_compare)(const struct dentry *, const struct dentry *, unsigned int, const char *, const struct qstr *);   int (*d_delete)(const struct dentry *);   void (*d_release)(struct dentry *);   void (*d_prune)(struct dentry *);   void (*d_iput)(struct dentry *, struct inode *);   char * (*d_dname)(struct dentry *, char *, int);   struct vfsmount * (*d_automount)(struct path *);   int (*d_manage)(struct dentry *, bool ); } ;   555     struct path {   struct vfsmount *mnt;   struct dentry *dentry; } ;    19     struct shrink_control {   gfp_t gfp_mask;   unsigned long nr_to_scan;   int nid;   struct mem_cgroup *memcg; } ;    27     struct shrinker {   unsigned long int (*count_objects)(struct shrinker *, struct shrink_control *);   unsigned long int (*scan_objects)(struct shrinker *, struct shrink_control *);   int seeks;   long batch;   unsigned long flags;   struct list_head list;   atomic_long_t *nr_deferred; } ;    80     struct list_lru_one {   struct list_head list;   long nr_items; } ;    32     struct list_lru_memcg {   struct list_lru_one *lru[0U]; } ;    37     struct list_lru_node {   spinlock_t lock;   struct list_lru_one lru;   struct list_lru_memcg *memcg_lrus; } ;    47     struct list_lru {   struct list_lru_node *node;   struct list_head list; } ;    58     struct __anonstruct____missing_field_name_182 {   struct radix_tree_node *parent;   void *private_data; } ;    58     union __anonunion____missing_field_name_181 {   struct __anonstruct____missing_field_name_182 __annonCompField58;   struct callback_head callback_head; } ;    58     struct radix_tree_node {   unsigned int path;   unsigned int count;   union __anonunion____missing_field_name_181 __annonCompField59;   struct list_head private_list;   void *slots[64U];   unsigned long tags[3U][1U]; } ;   105     struct radix_tree_root {   unsigned int height;   gfp_t gfp_mask;   struct radix_tree_node *rnode; } ;   428     enum pid_type {   PIDTYPE_PID = 0,   PIDTYPE_PGID = 1,   PIDTYPE_SID = 2,   PIDTYPE_MAX = 3 } ;   435     struct pid_namespace ;   435     struct upid {   int nr;   struct pid_namespace *ns;   struct hlist_node pid_chain; } ;    56     struct pid {   atomic_t count;   unsigned int level;   struct hlist_head tasks[3U];   struct callback_head rcu;   struct upid numbers[1U]; } ;    68     struct pid_link {   struct hlist_node node;   struct pid *pid; } ;    22     struct kernel_cap_struct {   __u32 cap[2U]; } ;    25     typedef struct kernel_cap_struct kernel_cap_t;    45     struct fiemap_extent {   __u64 fe_logical;   __u64 fe_physical;   __u64 fe_length;   __u64 fe_reserved64[2U];   __u32 fe_flags;   __u32 fe_reserved[3U]; } ;    38     enum migrate_mode {   MIGRATE_ASYNC = 0,   MIGRATE_SYNC_LIGHT = 1,   MIGRATE_SYNC = 2 } ;    30     struct block_device ;    31     struct io_context ;    60     struct backing_dev_info ;    61     struct export_operations ;    63     struct iovec ;    64     struct nameidata ;    65     struct kiocb ;    66     struct pipe_inode_info ;    67     struct poll_table_struct ;    68     struct kstatfs ;    69     struct swap_info_struct ;    70     struct iov_iter ;    71     struct vm_fault ;    72     struct iattr {   unsigned int ia_valid;   umode_t ia_mode;   kuid_t ia_uid;   kgid_t ia_gid;   loff_t ia_size;   struct timespec ia_atime;   struct timespec ia_mtime;   struct timespec ia_ctime;   struct file *ia_file; } ;   261     struct percpu_counter {   raw_spinlock_t lock;   s64 count;   struct list_head list;   s32 *counters; } ;    76     struct fs_qfilestat {   __u64 qfs_ino;   __u64 qfs_nblks;   __u32 qfs_nextents; } ;   151     typedef struct fs_qfilestat fs_qfilestat_t;   152     struct fs_quota_stat {   __s8 qs_version;   __u16 qs_flags;   __s8 qs_pad;   fs_qfilestat_t qs_uquota;   fs_qfilestat_t qs_gquota;   __u32 qs_incoredqs;   __s32 qs_btimelimit;   __s32 qs_itimelimit;   __s32 qs_rtbtimelimit;   __u16 qs_bwarnlimit;   __u16 qs_iwarnlimit; } ;   166     struct fs_qfilestatv {   __u64 qfs_ino;   __u64 qfs_nblks;   __u32 qfs_nextents;   __u32 qfs_pad; } ;   196     struct fs_quota_statv {   __s8 qs_version;   __u8 qs_pad1;   __u16 qs_flags;   __u32 qs_incoredqs;   struct fs_qfilestatv qs_uquota;   struct fs_qfilestatv qs_gquota;   struct fs_qfilestatv qs_pquota;   __s32 qs_btimelimit;   __s32 qs_itimelimit;   __s32 qs_rtbtimelimit;   __u16 qs_bwarnlimit;   __u16 qs_iwarnlimit;   __u64 qs_pad2[8U]; } ;   212     struct dquot ;    19     typedef __kernel_uid32_t projid_t;    23     struct __anonstruct_kprojid_t_185 {   projid_t val; } ;    23     typedef struct __anonstruct_kprojid_t_185 kprojid_t;   125     struct if_dqinfo {   __u64 dqi_bgrace;   __u64 dqi_igrace;   __u32 dqi_flags;   __u32 dqi_valid; } ;   164     enum quota_type {   USRQUOTA = 0,   GRPQUOTA = 1,   PRJQUOTA = 2 } ;    65     typedef long long qsize_t;    66     union __anonunion____missing_field_name_186 {   kuid_t uid;   kgid_t gid;   kprojid_t projid; } ;    66     struct kqid {   union __anonunion____missing_field_name_186 __annonCompField61;   enum quota_type type; } ;   183     struct mem_dqblk {   qsize_t dqb_bhardlimit;   qsize_t dqb_bsoftlimit;   qsize_t dqb_curspace;   qsize_t dqb_rsvspace;   qsize_t dqb_ihardlimit;   qsize_t dqb_isoftlimit;   qsize_t dqb_curinodes;   time_t dqb_btime;   time_t dqb_itime; } ;   205     struct quota_format_type ;   206     struct mem_dqinfo {   struct quota_format_type *dqi_format;   int dqi_fmt_id;   struct list_head dqi_dirty_list;   unsigned long dqi_flags;   unsigned int dqi_bgrace;   unsigned int dqi_igrace;   qsize_t dqi_max_spc_limit;   qsize_t dqi_max_ino_limit;   void *dqi_priv; } ;   271     struct dquot {   struct hlist_node dq_hash;   struct list_head dq_inuse;   struct list_head dq_free;   struct list_head dq_dirty;   struct mutex dq_lock;   atomic_t dq_count;   wait_queue_head_t dq_wait_unused;   struct super_block *dq_sb;   struct kqid dq_id;   loff_t dq_off;   unsigned long dq_flags;   struct mem_dqblk dq_dqb; } ;   298     struct quota_format_ops {   int (*check_quota_file)(struct super_block *, int);   int (*read_file_info)(struct super_block *, int);   int (*write_file_info)(struct super_block *, int);   int (*free_file_info)(struct super_block *, int);   int (*read_dqblk)(struct dquot *);   int (*commit_dqblk)(struct dquot *);   int (*release_dqblk)(struct dquot *); } ;   309     struct dquot_operations {   int (*write_dquot)(struct dquot *);   struct dquot * (*alloc_dquot)(struct super_block *, int);   void (*destroy_dquot)(struct dquot *);   int (*acquire_dquot)(struct dquot *);   int (*release_dquot)(struct dquot *);   int (*mark_dirty)(struct dquot *);   int (*write_info)(struct super_block *, int);   qsize_t * (*get_reserved_space)(struct inode *); } ;   323     struct qc_dqblk {   int d_fieldmask;   u64 d_spc_hardlimit;   u64 d_spc_softlimit;   u64 d_ino_hardlimit;   u64 d_ino_softlimit;   u64 d_space;   u64 d_ino_count;   s64 d_ino_timer;   s64 d_spc_timer;   int d_ino_warns;   int d_spc_warns;   u64 d_rt_spc_hardlimit;   u64 d_rt_spc_softlimit;   u64 d_rt_space;   s64 d_rt_spc_timer;   int d_rt_spc_warns; } ;   346     struct quotactl_ops {   int (*quota_on)(struct super_block *, int, int, struct path *);   int (*quota_off)(struct super_block *, int);   int (*quota_enable)(struct super_block *, unsigned int);   int (*quota_disable)(struct super_block *, unsigned int);   int (*quota_sync)(struct super_block *, int);   int (*get_info)(struct super_block *, int, struct if_dqinfo *);   int (*set_info)(struct super_block *, int, struct if_dqinfo *);   int (*get_dqblk)(struct super_block *, struct kqid , struct qc_dqblk *);   int (*set_dqblk)(struct super_block *, struct kqid , struct qc_dqblk *);   int (*get_xstate)(struct super_block *, struct fs_quota_stat *);   int (*get_xstatev)(struct super_block *, struct fs_quota_statv *);   int (*rm_xquota)(struct super_block *, unsigned int); } ;   384     struct quota_format_type {   int qf_fmt_id;   const struct quota_format_ops *qf_ops;   struct module *qf_owner;   struct quota_format_type *qf_next; } ;   430     struct quota_info {   unsigned int flags;   struct mutex dqio_mutex;   struct mutex dqonoff_mutex;   struct inode *files[2U];   struct mem_dqinfo info[2U];   const struct quota_format_ops *ops[2U]; } ;   460     struct writeback_control ;   337     struct address_space_operations {   int (*writepage)(struct page *, struct writeback_control *);   int (*readpage)(struct file *, struct page *);   int (*writepages)(struct address_space *, struct writeback_control *);   int (*set_page_dirty)(struct page *);   int (*readpages)(struct file *, struct address_space *, struct list_head *, unsigned int);   int (*write_begin)(struct file *, struct address_space *, loff_t , unsigned int, unsigned int, struct page **, void **);   int (*write_end)(struct file *, struct address_space *, loff_t , unsigned int, unsigned int, struct page *, void *);   sector_t  (*bmap)(struct address_space *, sector_t );   void (*invalidatepage)(struct page *, unsigned int, unsigned int);   int (*releasepage)(struct page *, gfp_t );   void (*freepage)(struct page *);   ssize_t  (*direct_IO)(int, struct kiocb *, struct iov_iter *, loff_t );   int (*migratepage)(struct address_space *, struct page *, struct page *, enum migrate_mode );   int (*launder_page)(struct page *);   int (*is_partially_uptodate)(struct page *, unsigned long, unsigned long);   void (*is_dirty_writeback)(struct page *, bool *, bool *);   int (*error_remove_page)(struct address_space *, struct page *);   int (*swap_activate)(struct swap_info_struct *, struct file *, sector_t *);   void (*swap_deactivate)(struct file *); } ;   394     struct address_space {   struct inode *host;   struct radix_tree_root page_tree;   spinlock_t tree_lock;   atomic_t i_mmap_writable;   struct rb_root i_mmap;   struct rw_semaphore i_mmap_rwsem;   unsigned long nrpages;   unsigned long nrshadows;   unsigned long writeback_index;   const struct address_space_operations *a_ops;   unsigned long flags;   spinlock_t private_lock;   struct list_head private_list;   void *private_data; } ;   414     struct request_queue ;   415     struct hd_struct ;   415     struct gendisk ;   415     struct block_device {   dev_t bd_dev;   int bd_openers;   struct inode *bd_inode;   struct super_block *bd_super;   struct mutex bd_mutex;   struct list_head bd_inodes;   void *bd_claiming;   void *bd_holder;   int bd_holders;   bool bd_write_holder;   struct list_head bd_holder_disks;   struct block_device *bd_contains;   unsigned int bd_block_size;   struct hd_struct *bd_part;   unsigned int bd_part_count;   int bd_invalidated;   struct gendisk *bd_disk;   struct request_queue *bd_queue;   struct list_head bd_list;   unsigned long bd_private;   int bd_fsfreeze_count;   struct mutex bd_fsfreeze_mutex; } ;   531     struct posix_acl ;   532     struct inode_operations ;   532     union __anonunion____missing_field_name_189 {   const unsigned int i_nlink;   unsigned int __i_nlink; } ;   532     union __anonunion____missing_field_name_190 {   struct hlist_head i_dentry;   struct callback_head i_rcu; } ;   532     struct file_lock_context ;   532     struct cdev ;   532     union __anonunion____missing_field_name_191 {   struct pipe_inode_info *i_pipe;   struct block_device *i_bdev;   struct cdev *i_cdev; } ;   532     struct inode {   umode_t i_mode;   unsigned short i_opflags;   kuid_t i_uid;   kgid_t i_gid;   unsigned int i_flags;   struct posix_acl *i_acl;   struct posix_acl *i_default_acl;   const struct inode_operations *i_op;   struct super_block *i_sb;   struct address_space *i_mapping;   void *i_security;   unsigned long i_ino;   union __anonunion____missing_field_name_189 __annonCompField62;   dev_t i_rdev;   loff_t i_size;   struct timespec i_atime;   struct timespec i_mtime;   struct timespec i_ctime;   spinlock_t i_lock;   unsigned short i_bytes;   unsigned int i_blkbits;   blkcnt_t i_blocks;   unsigned long i_state;   struct mutex i_mutex;   unsigned long dirtied_when;   struct hlist_node i_hash;   struct list_head i_wb_list;   struct list_head i_lru;   struct list_head i_sb_list;   union __anonunion____missing_field_name_190 __annonCompField63;   u64 i_version;   atomic_t i_count;   atomic_t i_dio_count;   atomic_t i_writecount;   atomic_t i_readcount;   const struct file_operations *i_fop;   struct file_lock_context *i_flctx;   struct address_space i_data;   struct list_head i_devices;   union __anonunion____missing_field_name_191 __annonCompField64;   __u32 i_generation;   __u32 i_fsnotify_mask;   struct hlist_head i_fsnotify_marks;   void *i_private; } ;   768     struct fown_struct {   rwlock_t lock;   struct pid *pid;   enum pid_type pid_type;   kuid_t uid;   kuid_t euid;   int signum; } ;   776     struct file_ra_state {   unsigned long start;   unsigned int size;   unsigned int async_size;   unsigned int ra_pages;   unsigned int mmap_miss;   loff_t prev_pos; } ;   799     union __anonunion_f_u_192 {   struct llist_node fu_llist;   struct callback_head fu_rcuhead; } ;   799     struct file {   union __anonunion_f_u_192 f_u;   struct path f_path;   struct inode *f_inode;   const struct file_operations *f_op;   spinlock_t f_lock;   atomic_long_t f_count;   unsigned int f_flags;   fmode_t f_mode;   struct mutex f_pos_lock;   loff_t f_pos;   struct fown_struct f_owner;   const struct cred *f_cred;   struct file_ra_state f_ra;   u64 f_version;   void *f_security;   void *private_data;   struct list_head f_ep_links;   struct list_head f_tfile_llink;   struct address_space *f_mapping; } ;   883     typedef void *fl_owner_t;   884     struct file_lock ;   885     struct file_lock_operations {   void (*fl_copy_lock)(struct file_lock *, struct file_lock *);   void (*fl_release_private)(struct file_lock *); } ;   891     struct lock_manager_operations {   int (*lm_compare_owner)(struct file_lock *, struct file_lock *);   unsigned long int (*lm_owner_key)(struct file_lock *);   void (*lm_get_owner)(struct file_lock *, struct file_lock *);   void (*lm_put_owner)(struct file_lock *);   void (*lm_notify)(struct file_lock *);   int (*lm_grant)(struct file_lock *, int);   bool  (*lm_break)(struct file_lock *);   int (*lm_change)(struct file_lock *, int, struct list_head *);   void (*lm_setup)(struct file_lock *, void **); } ;   912     struct nlm_lockowner ;   913     struct nfs_lock_info {   u32 state;   struct nlm_lockowner *owner;   struct list_head list; } ;    14     struct nfs4_lock_state ;    15     struct nfs4_lock_info {   struct nfs4_lock_state *owner; } ;    19     struct fasync_struct ;    19     struct __anonstruct_afs_194 {   struct list_head link;   int state; } ;    19     union __anonunion_fl_u_193 {   struct nfs_lock_info nfs_fl;   struct nfs4_lock_info nfs4_fl;   struct __anonstruct_afs_194 afs; } ;    19     struct file_lock {   struct file_lock *fl_next;   struct list_head fl_list;   struct hlist_node fl_link;   struct list_head fl_block;   fl_owner_t fl_owner;   unsigned int fl_flags;   unsigned char fl_type;   unsigned int fl_pid;   int fl_link_cpu;   struct pid *fl_nspid;   wait_queue_head_t fl_wait;   struct file *fl_file;   loff_t fl_start;   loff_t fl_end;   struct fasync_struct *fl_fasync;   unsigned long fl_break_time;   unsigned long fl_downgrade_time;   const struct file_lock_operations *fl_ops;   const struct lock_manager_operations *fl_lmops;   union __anonunion_fl_u_193 fl_u; } ;   965     struct file_lock_context {   spinlock_t flc_lock;   struct list_head flc_flock;   struct list_head flc_posix;   struct list_head flc_lease; } ;  1021     struct fasync_struct {   spinlock_t fa_lock;   int magic;   int fa_fd;   struct fasync_struct *fa_next;   struct file *fa_file;   struct callback_head fa_rcu; } ;  1194     struct sb_writers {   struct percpu_counter counter[3U];   wait_queue_head_t wait;   int frozen;   wait_queue_head_t wait_unfrozen;   struct lockdep_map lock_map[3U]; } ;  1223     struct super_operations ;  1223     struct xattr_handler ;  1223     struct mtd_info ;  1223     struct super_block {   struct list_head s_list;   dev_t s_dev;   unsigned char s_blocksize_bits;   unsigned long s_blocksize;   loff_t s_maxbytes;   struct file_system_type *s_type;   const struct super_operations *s_op;   const struct dquot_operations *dq_op;   const struct quotactl_ops *s_qcop;   const struct export_operations *s_export_op;   unsigned long s_flags;   unsigned long s_magic;   struct dentry *s_root;   struct rw_semaphore s_umount;   int s_count;   atomic_t s_active;   void *s_security;   const struct xattr_handler **s_xattr;   struct list_head s_inodes;   struct hlist_bl_head s_anon;   struct list_head s_mounts;   struct block_device *s_bdev;   struct backing_dev_info *s_bdi;   struct mtd_info *s_mtd;   struct hlist_node s_instances;   unsigned int s_quota_types;   struct quota_info s_dquot;   struct sb_writers s_writers;   char s_id[32U];   u8 s_uuid[16U];   void *s_fs_info;   unsigned int s_max_links;   fmode_t s_mode;   u32 s_time_gran;   struct mutex s_vfs_rename_mutex;   char *s_subtype;   char *s_options;   const struct dentry_operations *s_d_op;   int cleancache_poolid;   struct shrinker s_shrink;   atomic_long_t s_remove_count;   int s_readonly_remount;   struct workqueue_struct *s_dio_done_wq;   struct hlist_head s_pins;   struct list_lru s_dentry_lru;   struct list_lru s_inode_lru;   struct callback_head rcu;   int s_stack_depth; } ;  1461     struct fiemap_extent_info {   unsigned int fi_flags;   unsigned int fi_extents_mapped;   unsigned int fi_extents_max;   struct fiemap_extent *fi_extents_start; } ;  1475     struct dir_context ;  1500     struct dir_context {   int (*actor)(struct dir_context *, const char *, int, loff_t , u64 , unsigned int);   loff_t pos; } ;  1507     struct file_operations {   struct module *owner;   loff_t  (*llseek)(struct file *, loff_t , int);   ssize_t  (*read)(struct file *, char *, size_t , loff_t *);   ssize_t  (*write)(struct file *, const char *, size_t , loff_t *);   ssize_t  (*aio_read)(struct kiocb *, const struct iovec *, unsigned long, loff_t );   ssize_t  (*aio_write)(struct kiocb *, const struct iovec *, unsigned long, loff_t );   ssize_t  (*read_iter)(struct kiocb *, struct iov_iter *);   ssize_t  (*write_iter)(struct kiocb *, struct iov_iter *);   int (*iterate)(struct file *, struct dir_context *);   unsigned int (*poll)(struct file *, struct poll_table_struct *);   long int (*unlocked_ioctl)(struct file *, unsigned int, unsigned long);   long int (*compat_ioctl)(struct file *, unsigned int, unsigned long);   int (*mmap)(struct file *, struct vm_area_struct *);   void (*mremap)(struct file *, struct vm_area_struct *);   int (*open)(struct inode *, struct file *);   int (*flush)(struct file *, fl_owner_t );   int (*release)(struct inode *, struct file *);   int (*fsync)(struct file *, loff_t , loff_t , int);   int (*aio_fsync)(struct kiocb *, int);   int (*fasync)(int, struct file *, int);   int (*lock)(struct file *, int, struct file_lock *);   ssize_t  (*sendpage)(struct file *, struct page *, int, size_t , loff_t *, int);   unsigned long int (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);   int (*check_flags)(int);   int (*flock)(struct file *, int, struct file_lock *);   ssize_t  (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t , unsigned int);   ssize_t  (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t , unsigned int);   int (*setlease)(struct file *, long, struct file_lock **, void **);   long int (*fallocate)(struct file *, int, loff_t , loff_t );   void (*show_fdinfo)(struct seq_file *, struct file *); } ;  1570     struct inode_operations {   struct dentry * (*lookup)(struct inode *, struct dentry *, unsigned int);   void * (*follow_link)(struct dentry *, struct nameidata *);   int (*permission)(struct inode *, int);   struct posix_acl * (*get_acl)(struct inode *, int);   int (*readlink)(struct dentry *, char *, int);   void (*put_link)(struct dentry *, struct nameidata *, void *);   int (*create)(struct inode *, struct dentry *, umode_t , bool );   int (*link)(struct dentry *, struct inode *, struct dentry *);   int (*unlink)(struct inode *, struct dentry *);   int (*symlink)(struct inode *, struct dentry *, const char *);   int (*mkdir)(struct inode *, struct dentry *, umode_t );   int (*rmdir)(struct inode *, struct dentry *);   int (*mknod)(struct inode *, struct dentry *, umode_t , dev_t );   int (*rename)(struct inode *, struct dentry *, struct inode *, struct dentry *);   int (*rename2)(struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int);   int (*setattr)(struct dentry *, struct iattr *);   int (*getattr)(struct vfsmount *, struct dentry *, struct kstat *);   int (*setxattr)(struct dentry *, const char *, const void *, size_t , int);   ssize_t  (*getxattr)(struct dentry *, const char *, void *, size_t );   ssize_t  (*listxattr)(struct dentry *, char *, size_t );   int (*removexattr)(struct dentry *, const char *);   int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 , u64 );   int (*update_time)(struct inode *, struct timespec *, int);   int (*atomic_open)(struct inode *, struct dentry *, struct file *, unsigned int, umode_t , int *);   int (*tmpfile)(struct inode *, struct dentry *, umode_t );   int (*set_acl)(struct inode *, struct posix_acl *, int);   int (*dentry_open)(struct dentry *, struct file *, const struct cred *); } ;  1624     struct super_operations {   struct inode * (*alloc_inode)(struct super_block *);   void (*destroy_inode)(struct inode *);   void (*dirty_inode)(struct inode *, int);   int (*write_inode)(struct inode *, struct writeback_control *);   int (*drop_inode)(struct inode *);   void (*evict_inode)(struct inode *);   void (*put_super)(struct super_block *);   int (*sync_fs)(struct super_block *, int);   int (*freeze_super)(struct super_block *);   int (*freeze_fs)(struct super_block *);   int (*thaw_super)(struct super_block *);   int (*unfreeze_fs)(struct super_block *);   int (*statfs)(struct dentry *, struct kstatfs *);   int (*remount_fs)(struct super_block *, int *, char *);   void (*umount_begin)(struct super_block *);   int (*show_options)(struct seq_file *, struct dentry *);   int (*show_devname)(struct seq_file *, struct dentry *);   int (*show_path)(struct seq_file *, struct dentry *);   int (*show_stats)(struct seq_file *, struct dentry *);   ssize_t  (*quota_read)(struct super_block *, int, char *, size_t , loff_t );   ssize_t  (*quota_write)(struct super_block *, int, const char *, size_t , loff_t );   struct dquot ** (*get_dquots)(struct inode *);   int (*bdev_try_to_free_page)(struct super_block *, struct page *, gfp_t );   long int (*nr_cached_objects)(struct super_block *, struct shrink_control *);   long int (*free_cached_objects)(struct super_block *, struct shrink_control *); } ;  1856     struct file_system_type {   const char *name;   int fs_flags;   struct dentry * (*mount)(struct file_system_type *, int, const char *, void *);   void (*kill_sb)(struct super_block *);   struct module *owner;   struct file_system_type *next;   struct hlist_head fs_supers;   struct lock_class_key s_lock_key;   struct lock_class_key s_umount_key;   struct lock_class_key s_vfs_rename_key;   struct lock_class_key s_writers_key[3U];   struct lock_class_key i_lock_key;   struct lock_class_key i_mutex_key;   struct lock_class_key i_mutex_dir_key; } ;    84     struct plist_node {   int prio;   struct list_head prio_list;   struct list_head node_list; } ;     4     typedef unsigned long cputime_t;    25     struct sem_undo_list ;    25     struct sysv_sem {   struct sem_undo_list *undo_list; } ;    78     struct user_struct ;    26     struct sysv_shm {   struct list_head shm_clist; } ;    24     struct __anonstruct_sigset_t_195 {   unsigned long sig[1U]; } ;    24     typedef struct __anonstruct_sigset_t_195 sigset_t;    25     struct siginfo ;    17     typedef void __signalfn_t(int);    18     typedef __signalfn_t *__sighandler_t;    20     typedef void __restorefn_t();    21     typedef __restorefn_t *__sigrestore_t;    34     union sigval {   int sival_int;   void *sival_ptr; } ;    10     typedef union sigval sigval_t;    11     struct __anonstruct__kill_197 {   __kernel_pid_t _pid;   __kernel_uid32_t _uid; } ;    11     struct __anonstruct__timer_198 {   __kernel_timer_t _tid;   int _overrun;   char _pad[0U];   sigval_t _sigval;   int _sys_private; } ;    11     struct __anonstruct__rt_199 {   __kernel_pid_t _pid;   __kernel_uid32_t _uid;   sigval_t _sigval; } ;    11     struct __anonstruct__sigchld_200 {   __kernel_pid_t _pid;   __kernel_uid32_t _uid;   int _status;   __kernel_clock_t _utime;   __kernel_clock_t _stime; } ;    11     struct __anonstruct__addr_bnd_202 {   void *_lower;   void *_upper; } ;    11     struct __anonstruct__sigfault_201 {   void *_addr;   short _addr_lsb;   struct __anonstruct__addr_bnd_202 _addr_bnd; } ;    11     struct __anonstruct__sigpoll_203 {   long _band;   int _fd; } ;    11     struct __anonstruct__sigsys_204 {   void *_call_addr;   int _syscall;   unsigned int _arch; } ;    11     union __anonunion__sifields_196 {   int _pad[28U];   struct __anonstruct__kill_197 _kill;   struct __anonstruct__timer_198 _timer;   struct __anonstruct__rt_199 _rt;   struct __anonstruct__sigchld_200 _sigchld;   struct __anonstruct__sigfault_201 _sigfault;   struct __anonstruct__sigpoll_203 _sigpoll;   struct __anonstruct__sigsys_204 _sigsys; } ;    11     struct siginfo {   int si_signo;   int si_errno;   int si_code;   union __anonunion__sifields_196 _sifields; } ;   113     typedef struct siginfo siginfo_t;    22     struct sigpending {   struct list_head list;   sigset_t signal; } ;   243     struct sigaction {   __sighandler_t sa_handler;   unsigned long sa_flags;   __sigrestore_t sa_restorer;   sigset_t sa_mask; } ;   257     struct k_sigaction {   struct sigaction sa; } ;    53     struct seccomp_filter ;    54     struct seccomp {   int mode;   struct seccomp_filter *filter; } ;    20     struct rt_mutex {   raw_spinlock_t wait_lock;   struct rb_root waiters;   struct rb_node *waiters_leftmost;   struct task_struct *owner;   int save_state;   const char *name;   const char *file;   int line;   void *magic; } ;    40     struct rt_mutex_waiter ;    41     struct rlimit {   __kernel_ulong_t rlim_cur;   __kernel_ulong_t rlim_max; } ;    11     struct task_io_accounting {   u64 rchar;   u64 wchar;   u64 syscr;   u64 syscw;   u64 read_bytes;   u64 write_bytes;   u64 cancelled_write_bytes; } ;    45     struct latency_record {   unsigned long backtrace[12U];   unsigned int count;   unsigned long time;   unsigned long max; } ;    39     struct assoc_array_ptr ;    39     struct assoc_array {   struct assoc_array_ptr *root;   unsigned long nr_leaves_on_tree; } ;    31     typedef int32_t key_serial_t;    34     typedef uint32_t key_perm_t;    35     struct key ;    36     struct signal_struct ;    37     struct key_type ;    41     struct keyring_index_key {   struct key_type *type;   const char *description;   size_t desc_len; } ;   123     union __anonunion____missing_field_name_207 {   struct list_head graveyard_link;   struct rb_node serial_node; } ;   123     struct key_user ;   123     union __anonunion____missing_field_name_208 {   time_t expiry;   time_t revoked_at; } ;   123     struct __anonstruct____missing_field_name_210 {   struct key_type *type;   char *description; } ;   123     union __anonunion____missing_field_name_209 {   struct keyring_index_key index_key;   struct __anonstruct____missing_field_name_210 __annonCompField67; } ;   123     union __anonunion_type_data_211 {   struct list_head link;   unsigned long x[2U];   void *p[2U];   int reject_error; } ;   123     union __anonunion_payload_213 {   unsigned long value;   void *rcudata;   void *data;   void *data2[2U]; } ;   123     union __anonunion____missing_field_name_212 {   union __anonunion_payload_213 payload;   struct assoc_array keys; } ;   123     struct key {   atomic_t usage;   key_serial_t serial;   union __anonunion____missing_field_name_207 __annonCompField65;   struct rw_semaphore sem;   struct key_user *user;   void *security;   union __anonunion____missing_field_name_208 __annonCompField66;   time_t last_used_at;   kuid_t uid;   kgid_t gid;   key_perm_t perm;   unsigned short quotalen;   unsigned short datalen;   unsigned long flags;   union __anonunion____missing_field_name_209 __annonCompField68;   union __anonunion_type_data_211 type_data;   union __anonunion____missing_field_name_212 __annonCompField69; } ;   358     struct audit_context ;    27     struct group_info {   atomic_t usage;   int ngroups;   int nblocks;   kgid_t small_block[32U];   kgid_t *blocks[0U]; } ;    79     struct cred {   atomic_t usage;   atomic_t subscribers;   void *put_addr;   unsigned int magic;   kuid_t uid;   kgid_t gid;   kuid_t suid;   kgid_t sgid;   kuid_t euid;   kgid_t egid;   kuid_t fsuid;   kgid_t fsgid;   unsigned int securebits;   kernel_cap_t cap_inheritable;   kernel_cap_t cap_permitted;   kernel_cap_t cap_effective;   kernel_cap_t cap_bset;   unsigned char jit_keyring;   struct key *session_keyring;   struct key *process_keyring;   struct key *thread_keyring;   struct key *request_key_auth;   void *security;   struct user_struct *user;   struct user_namespace *user_ns;   struct group_info *group_info;   struct callback_head rcu; } ;   127     struct futex_pi_state ;   128     struct robust_list_head ;   129     struct bio_list ;   130     struct fs_struct ;   131     struct perf_event_context ;   132     struct blk_plug ;   182     struct cfs_rq ;   183     struct task_group ;   471     struct sighand_struct {   atomic_t count;   struct k_sigaction action[64U];   spinlock_t siglock;   wait_queue_head_t signalfd_wqh; } ;   510     struct pacct_struct {   int ac_flag;   long ac_exitcode;   unsigned long ac_mem;   cputime_t ac_utime;   cputime_t ac_stime;   unsigned long ac_minflt;   unsigned long ac_majflt; } ;   518     struct cpu_itimer {   cputime_t expires;   cputime_t incr;   u32 error;   u32 incr_error; } ;   525     struct cputime {   cputime_t utime;   cputime_t stime; } ;   537     struct task_cputime {   cputime_t utime;   cputime_t stime;   unsigned long long sum_exec_runtime; } ;   557     struct thread_group_cputimer {   struct task_cputime cputime;   int running;   raw_spinlock_t lock; } ;   599     struct autogroup ;   600     struct tty_struct ;   600     struct taskstats ;   600     struct tty_audit_buf ;   600     struct signal_struct {   atomic_t sigcnt;   atomic_t live;   int nr_threads;   struct list_head thread_head;   wait_queue_head_t wait_chldexit;   struct task_struct *curr_target;   struct sigpending shared_pending;   int group_exit_code;   int notify_count;   struct task_struct *group_exit_task;   int group_stop_count;   unsigned int flags;   unsigned char is_child_subreaper;   unsigned char has_child_subreaper;   int posix_timer_id;   struct list_head posix_timers;   struct hrtimer real_timer;   struct pid *leader_pid;   ktime_t it_real_incr;   struct cpu_itimer it[2U];   struct thread_group_cputimer cputimer;   struct task_cputime cputime_expires;   struct list_head cpu_timers[3U];   struct pid *tty_old_pgrp;   int leader;   struct tty_struct *tty;   struct autogroup *autogroup;   seqlock_t stats_lock;   cputime_t utime;   cputime_t stime;   cputime_t cutime;   cputime_t cstime;   cputime_t gtime;   cputime_t cgtime;   struct cputime prev_cputime;   unsigned long nvcsw;   unsigned long nivcsw;   unsigned long cnvcsw;   unsigned long cnivcsw;   unsigned long min_flt;   unsigned long maj_flt;   unsigned long cmin_flt;   unsigned long cmaj_flt;   unsigned long inblock;   unsigned long oublock;   unsigned long cinblock;   unsigned long coublock;   unsigned long maxrss;   unsigned long cmaxrss;   struct task_io_accounting ioac;   unsigned long long sum_sched_runtime;   struct rlimit rlim[16U];   struct pacct_struct pacct;   struct taskstats *stats;   unsigned int audit_tty;   unsigned int audit_tty_log_passwd;   struct tty_audit_buf *tty_audit_buf;   struct rw_semaphore group_rwsem;   oom_flags_t oom_flags;   short oom_score_adj;   short oom_score_adj_min;   struct mutex cred_guard_mutex; } ;   781     struct user_struct {   atomic_t __count;   atomic_t processes;   atomic_t sigpending;   atomic_t inotify_watches;   atomic_t inotify_devs;   atomic_t fanotify_listeners;   atomic_long_t epoll_watches;   unsigned long mq_bytes;   unsigned long locked_shm;   struct key *uid_keyring;   struct key *session_keyring;   struct hlist_node uidhash_node;   kuid_t uid;   atomic_long_t locked_vm; } ;   824     struct reclaim_state ;   825     struct sched_info {   unsigned long pcount;   unsigned long long run_delay;   unsigned long long last_arrival;   unsigned long long last_queued; } ;   840     struct task_delay_info {   spinlock_t lock;   unsigned int flags;   u64 blkio_start;   u64 blkio_delay;   u64 swapin_delay;   u32 blkio_count;   u32 swapin_count;   u64 freepages_start;   u64 freepages_delay;   u32 freepages_count; } ;  1108     struct load_weight {   unsigned long weight;   u32 inv_weight; } ;  1116     struct sched_avg {   u32 runnable_avg_sum;   u32 runnable_avg_period;   u64 last_runnable_update;   s64 decay_count;   unsigned long load_avg_contrib; } ;  1128     struct sched_statistics {   u64 wait_start;   u64 wait_max;   u64 wait_count;   u64 wait_sum;   u64 iowait_count;   u64 iowait_sum;   u64 sleep_start;   u64 sleep_max;   s64 sum_sleep_runtime;   u64 block_start;   u64 block_max;   u64 exec_max;   u64 slice_max;   u64 nr_migrations_cold;   u64 nr_failed_migrations_affine;   u64 nr_failed_migrations_running;   u64 nr_failed_migrations_hot;   u64 nr_forced_migrations;   u64 nr_wakeups;   u64 nr_wakeups_sync;   u64 nr_wakeups_migrate;   u64 nr_wakeups_local;   u64 nr_wakeups_remote;   u64 nr_wakeups_affine;   u64 nr_wakeups_affine_attempts;   u64 nr_wakeups_passive;   u64 nr_wakeups_idle; } ;  1163     struct sched_entity {   struct load_weight load;   struct rb_node run_node;   struct list_head group_node;   unsigned int on_rq;   u64 exec_start;   u64 sum_exec_runtime;   u64 vruntime;   u64 prev_sum_exec_runtime;   u64 nr_migrations;   struct sched_statistics statistics;   int depth;   struct sched_entity *parent;   struct cfs_rq *cfs_rq;   struct cfs_rq *my_q;   struct sched_avg avg; } ;  1195     struct rt_rq ;  1195     struct sched_rt_entity {   struct list_head run_list;   unsigned long timeout;   unsigned long watchdog_stamp;   unsigned int time_slice;   struct sched_rt_entity *back;   struct sched_rt_entity *parent;   struct rt_rq *rt_rq;   struct rt_rq *my_q; } ;  1211     struct sched_dl_entity {   struct rb_node rb_node;   u64 dl_runtime;   u64 dl_deadline;   u64 dl_period;   u64 dl_bw;   s64 runtime;   u64 deadline;   unsigned int flags;   int dl_throttled;   int dl_new;   int dl_boosted;   int dl_yielded;   struct hrtimer dl_timer; } ;  1277     struct memcg_oom_info {   struct mem_cgroup *memcg;   gfp_t gfp_mask;   int order;   unsigned char may_oom; } ;  1702     struct sched_class ;  1702     struct files_struct ;  1702     struct css_set ;  1702     struct compat_robust_list_head ;  1702     struct numa_group ;  1702     struct task_struct {   volatile long state;   void *stack;   atomic_t usage;   unsigned int flags;   unsigned int ptrace;   struct llist_node wake_entry;   int on_cpu;   struct task_struct *last_wakee;   unsigned long wakee_flips;   unsigned long wakee_flip_decay_ts;   int wake_cpu;   int on_rq;   int prio;   int static_prio;   int normal_prio;   unsigned int rt_priority;   const struct sched_class *sched_class;   struct sched_entity se;   struct sched_rt_entity rt;   struct task_group *sched_task_group;   struct sched_dl_entity dl;   struct hlist_head preempt_notifiers;   unsigned int policy;   int nr_cpus_allowed;   cpumask_t cpus_allowed;   unsigned long rcu_tasks_nvcsw;   bool rcu_tasks_holdout;   struct list_head rcu_tasks_holdout_list;   int rcu_tasks_idle_cpu;   struct sched_info sched_info;   struct list_head tasks;   struct plist_node pushable_tasks;   struct rb_node pushable_dl_tasks;   struct mm_struct *mm;   struct mm_struct *active_mm;   unsigned char brk_randomized;   u32 vmacache_seqnum;   struct vm_area_struct *vmacache[4U];   struct task_rss_stat rss_stat;   int exit_state;   int exit_code;   int exit_signal;   int pdeath_signal;   unsigned int jobctl;   unsigned int personality;   unsigned char in_execve;   unsigned char in_iowait;   unsigned char sched_reset_on_fork;   unsigned char sched_contributes_to_load;   unsigned char memcg_kmem_skip_account;   unsigned long atomic_flags;   struct restart_block restart_block;   pid_t pid;   pid_t tgid;   struct task_struct *real_parent;   struct task_struct *parent;   struct list_head children;   struct list_head sibling;   struct task_struct *group_leader;   struct list_head ptraced;   struct list_head ptrace_entry;   struct pid_link pids[3U];   struct list_head thread_group;   struct list_head thread_node;   struct completion *vfork_done;   int *set_child_tid;   int *clear_child_tid;   cputime_t utime;   cputime_t stime;   cputime_t utimescaled;   cputime_t stimescaled;   cputime_t gtime;   struct cputime prev_cputime;   unsigned long nvcsw;   unsigned long nivcsw;   u64 start_time;   u64 real_start_time;   unsigned long min_flt;   unsigned long maj_flt;   struct task_cputime cputime_expires;   struct list_head cpu_timers[3U];   const struct cred *real_cred;   const struct cred *cred;   char comm[16U];   int link_count;   int total_link_count;   struct sysv_sem sysvsem;   struct sysv_shm sysvshm;   unsigned long last_switch_count;   struct thread_struct thread;   struct fs_struct *fs;   struct files_struct *files;   struct nsproxy *nsproxy;   struct signal_struct *signal;   struct sighand_struct *sighand;   sigset_t blocked;   sigset_t real_blocked;   sigset_t saved_sigmask;   struct sigpending pending;   unsigned long sas_ss_sp;   size_t sas_ss_size;   int (*notifier)(void *);   void *notifier_data;   sigset_t *notifier_mask;   struct callback_head *task_works;   struct audit_context *audit_context;   kuid_t loginuid;   unsigned int sessionid;   struct seccomp seccomp;   u32 parent_exec_id;   u32 self_exec_id;   spinlock_t alloc_lock;   raw_spinlock_t pi_lock;   struct rb_root pi_waiters;   struct rb_node *pi_waiters_leftmost;   struct rt_mutex_waiter *pi_blocked_on;   struct mutex_waiter *blocked_on;   unsigned int irq_events;   unsigned long hardirq_enable_ip;   unsigned long hardirq_disable_ip;   unsigned int hardirq_enable_event;   unsigned int hardirq_disable_event;   int hardirqs_enabled;   int hardirq_context;   unsigned long softirq_disable_ip;   unsigned long softirq_enable_ip;   unsigned int softirq_disable_event;   unsigned int softirq_enable_event;   int softirqs_enabled;   int softirq_context;   u64 curr_chain_key;   int lockdep_depth;   unsigned int lockdep_recursion;   struct held_lock held_locks[48U];   gfp_t lockdep_reclaim_gfp;   void *journal_info;   struct bio_list *bio_list;   struct blk_plug *plug;   struct reclaim_state *reclaim_state;   struct backing_dev_info *backing_dev_info;   struct io_context *io_context;   unsigned long ptrace_message;   siginfo_t *last_siginfo;   struct task_io_accounting ioac;   u64 acct_rss_mem1;   u64 acct_vm_mem1;   cputime_t acct_timexpd;   nodemask_t mems_allowed;   seqcount_t mems_allowed_seq;   int cpuset_mem_spread_rotor;   int cpuset_slab_spread_rotor;   struct css_set *cgroups;   struct list_head cg_list;   struct robust_list_head *robust_list;   struct compat_robust_list_head *compat_robust_list;   struct list_head pi_state_list;   struct futex_pi_state *pi_state_cache;   struct perf_event_context *perf_event_ctxp[2U];   struct mutex perf_event_mutex;   struct list_head perf_event_list;   struct mempolicy *mempolicy;   short il_next;   short pref_node_fork;   int numa_scan_seq;   unsigned int numa_scan_period;   unsigned int numa_scan_period_max;   int numa_preferred_nid;   unsigned long numa_migrate_retry;   u64 node_stamp;   u64 last_task_numa_placement;   u64 last_sum_exec_runtime;   struct callback_head numa_work;   struct list_head numa_entry;   struct numa_group *numa_group;   unsigned long *numa_faults;   unsigned long total_numa_faults;   unsigned long numa_faults_locality[2U];   unsigned long numa_pages_migrated;   struct callback_head rcu;   struct pipe_inode_info *splice_pipe;   struct page_frag task_frag;   struct task_delay_info *delays;   int make_it_fail;   int nr_dirtied;   int nr_dirtied_pause;   unsigned long dirty_paused_when;   int latency_record_count;   struct latency_record latency_record[32U];   unsigned long timer_slack_ns;   unsigned long default_timer_slack_ns;   unsigned int kasan_depth;   unsigned long trace;   unsigned long trace_recursion;   struct memcg_oom_info memcg_oom;   struct uprobe_task *utask;   unsigned int sequential_io;   unsigned int sequential_io_avg;   unsigned long task_state_change; } ;   282     struct usb_device ;   284     struct wusb_dev ;   285     struct ep_device ;   286     struct usb_host_endpoint {   struct usb_endpoint_descriptor desc;   struct usb_ss_ep_comp_descriptor ss_ep_comp;   struct list_head urb_list;   void *hcpriv;   struct ep_device *ep_dev;   unsigned char *extra;   int extralen;   int enabled;   int streams; } ;    77     struct usb_host_interface {   struct usb_interface_descriptor desc;   int extralen;   unsigned char *extra;   struct usb_host_endpoint *endpoint;   char *string; } ;    92     enum usb_interface_condition {   USB_INTERFACE_UNBOUND = 0,   USB_INTERFACE_BINDING = 1,   USB_INTERFACE_BOUND = 2,   USB_INTERFACE_UNBINDING = 3 } ;    99     struct usb_interface {   struct usb_host_interface *altsetting;   struct usb_host_interface *cur_altsetting;   unsigned int num_altsetting;   struct usb_interface_assoc_descriptor *intf_assoc;   int minor;   enum usb_interface_condition condition;   unsigned char sysfs_files_created;   unsigned char ep_devs_created;   unsigned char unregistering;   unsigned char needs_remote_wakeup;   unsigned char needs_altsetting0;   unsigned char needs_binding;   unsigned char resetting_device;   struct device dev;   struct device *usb_dev;   atomic_t pm_usage_cnt;   struct work_struct reset_ws; } ;   201     struct usb_interface_cache {   unsigned int num_altsetting;   struct kref ref;   struct usb_host_interface altsetting[0U]; } ;   230     struct usb_host_config {   struct usb_config_descriptor desc;   char *string;   struct usb_interface_assoc_descriptor *intf_assoc[16U];   struct usb_interface *interface[32U];   struct usb_interface_cache *intf_cache[32U];   unsigned char *extra;   int extralen; } ;   294     struct usb_host_bos {   struct usb_bos_descriptor *desc;   struct usb_ext_cap_descriptor *ext_cap;   struct usb_ss_cap_descriptor *ss_cap;   struct usb_ss_container_id_descriptor *ss_id; } ;   306     struct usb_devmap {   unsigned long devicemap[2U]; } ;   318     struct mon_bus ;   318     struct usb_bus {   struct device *controller;   int busnum;   const char *bus_name;   u8 uses_dma;   u8 uses_pio_for_control;   u8 otg_port;   unsigned char is_b_host;   unsigned char b_hnp_enable;   unsigned char no_stop_on_short;   unsigned char no_sg_constraint;   unsigned int sg_tablesize;   int devnum_next;   struct usb_devmap devmap;   struct usb_device *root_hub;   struct usb_bus *hs_companion;   struct list_head bus_list;   struct mutex usb_address0_mutex;   int bandwidth_allocated;   int bandwidth_int_reqs;   int bandwidth_isoc_reqs;   unsigned int resuming_ports;   struct mon_bus *mon_bus;   int monitored; } ;   369     struct usb_tt ;   370     enum usb_device_removable {   USB_DEVICE_REMOVABLE_UNKNOWN = 0,   USB_DEVICE_REMOVABLE = 1,   USB_DEVICE_FIXED = 2 } ;   383     struct usb2_lpm_parameters {   unsigned int besl;   int timeout; } ;   404     struct usb3_lpm_parameters {   unsigned int mel;   unsigned int pel;   unsigned int sel;   int timeout; } ;   443     struct usb_device {   int devnum;   char devpath[16U];   u32 route;   enum usb_device_state state;   enum usb_device_speed speed;   struct usb_tt *tt;   int ttport;   unsigned int toggle[2U];   struct usb_device *parent;   struct usb_bus *bus;   struct usb_host_endpoint ep0;   struct device dev;   struct usb_device_descriptor descriptor;   struct usb_host_bos *bos;   struct usb_host_config *config;   struct usb_host_config *actconfig;   struct usb_host_endpoint *ep_in[16U];   struct usb_host_endpoint *ep_out[16U];   char **rawdescriptors;   unsigned short bus_mA;   u8 portnum;   u8 level;   unsigned char can_submit;   unsigned char persist_enabled;   unsigned char have_langid;   unsigned char authorized;   unsigned char authenticated;   unsigned char wusb;   unsigned char lpm_capable;   unsigned char usb2_hw_lpm_capable;   unsigned char usb2_hw_lpm_besl_capable;   unsigned char usb2_hw_lpm_enabled;   unsigned char usb2_hw_lpm_allowed;   unsigned char usb3_lpm_enabled;   int string_langid;   char *product;   char *manufacturer;   char *serial;   struct list_head filelist;   int maxchild;   u32 quirks;   atomic_t urbnum;   unsigned long active_duration;   unsigned long connect_time;   unsigned char do_remote_wakeup;   unsigned char reset_resume;   unsigned char port_is_suspended;   struct wusb_dev *wusb_dev;   int slot_id;   enum usb_device_removable removable;   struct usb2_lpm_parameters l1_params;   struct usb3_lpm_parameters u1_params;   struct usb3_lpm_parameters u2_params;   unsigned int lpm_disable_count; } ;  1174     struct usb_iso_packet_descriptor {   unsigned int offset;   unsigned int length;   unsigned int actual_length;   int status; } ;  1216     struct urb ;  1217     struct usb_anchor {   struct list_head urb_list;   wait_queue_head_t wait;   spinlock_t lock;   atomic_t suspend_wakeups;   unsigned char poisoned; } ;  1236     struct scatterlist ;  1236     struct urb {   struct kref kref;   void *hcpriv;   atomic_t use_count;   atomic_t reject;   int unlinked;   struct list_head urb_list;   struct list_head anchor_list;   struct usb_anchor *anchor;   struct usb_device *dev;   struct usb_host_endpoint *ep;   unsigned int pipe;   unsigned int stream_id;   int status;   unsigned int transfer_flags;   void *transfer_buffer;   dma_addr_t transfer_dma;   struct scatterlist *sg;   int num_mapped_sgs;   int num_sgs;   u32 transfer_buffer_length;   u32 actual_length;   unsigned char *setup_packet;   dma_addr_t setup_dma;   int start_frame;   int number_of_packets;   int interval;   int error_count;   void *context;   void (*complete)(struct urb *);   struct usb_iso_packet_descriptor iso_frame_desc[0U]; } ;   206     struct vm_fault {   unsigned int flags;   unsigned long pgoff;   void *virtual_address;   struct page *cow_page;   struct page *page;   unsigned long max_pgoff;   pte_t *pte; } ;   238     struct vm_operations_struct {   void (*open)(struct vm_area_struct *);   void (*close)(struct vm_area_struct *);   int (*fault)(struct vm_area_struct *, struct vm_fault *);   void (*map_pages)(struct vm_area_struct *, struct vm_fault *);   int (*page_mkwrite)(struct vm_area_struct *, struct vm_fault *);   int (*access)(struct vm_area_struct *, unsigned long, void *, int, int);   const char * (*name)(struct vm_area_struct *);   int (*set_policy)(struct vm_area_struct *, struct mempolicy *);   struct mempolicy * (*get_policy)(struct vm_area_struct *, unsigned long);   struct page * (*find_special_page)(struct vm_area_struct *, unsigned long); } ;   248     struct v4l2_edid {   __u32 pad;   __u32 start_block;   __u32 blocks;   __u32 reserved[5U];   __u8 *edid; } ;   632     enum v4l2_priority {   V4L2_PRIORITY_UNSET = 0,   V4L2_PRIORITY_BACKGROUND = 1,   V4L2_PRIORITY_INTERACTIVE = 2,   V4L2_PRIORITY_RECORD = 3,   V4L2_PRIORITY_DEFAULT = 2 } ;   640     struct v4l2_rect {   __s32 left;   __s32 top;   __u32 width;   __u32 height; } ;   294     struct v4l2_fract {   __u32 numerator;   __u32 denominator; } ;   299     struct v4l2_capability {   __u8 driver[16U];   __u8 card[32U];   __u8 bus_info[32U];   __u32 version;   __u32 capabilities;   __u32 device_caps;   __u32 reserved[3U]; } ;   562     struct v4l2_frmsize_discrete {   __u32 width;   __u32 height; } ;   575     struct v4l2_frmsize_stepwise {   __u32 min_width;   __u32 max_width;   __u32 step_width;   __u32 min_height;   __u32 max_height;   __u32 step_height; } ;   584     union __anonunion____missing_field_name_216 {   struct v4l2_frmsize_discrete discrete;   struct v4l2_frmsize_stepwise stepwise; } ;   584     struct v4l2_frmsizeenum {   __u32 index;   __u32 pixel_format;   __u32 type;   union __anonunion____missing_field_name_216 __annonCompField71;   __u32 reserved[2U]; } ;   603     struct v4l2_frmival_stepwise {   struct v4l2_fract min;   struct v4l2_fract max;   struct v4l2_fract step; } ;   612     union __anonunion____missing_field_name_217 {   struct v4l2_fract discrete;   struct v4l2_frmival_stepwise stepwise; } ;   612     struct v4l2_frmivalenum {   __u32 index;   __u32 pixel_format;   __u32 width;   __u32 height;   __u32 type;   union __anonunion____missing_field_name_217 __annonCompField72;   __u32 reserved[2U]; } ;   892     struct v4l2_captureparm {   __u32 capability;   __u32 capturemode;   struct v4l2_fract timeperframe;   __u32 extendedmode;   __u32 readbuffers;   __u32 reserved[4U]; } ;   904     struct v4l2_outputparm {   __u32 capability;   __u32 outputmode;   struct v4l2_fract timeperframe;   __u32 extendedmode;   __u32 writebuffers;   __u32 reserved[4U]; } ;   917     struct v4l2_cropcap {   __u32 type;   struct v4l2_rect bounds;   struct v4l2_rect defrect;   struct v4l2_fract pixelaspect; } ;   927     struct v4l2_crop {   __u32 type;   struct v4l2_rect c; } ;   959     typedef __u64 v4l2_std_id;  1095     struct v4l2_bt_timings {   __u32 width;   __u32 height;   __u32 interlaced;   __u32 polarities;   __u64 pixelclock;   __u32 hfrontporch;   __u32 hsync;   __u32 hbackporch;   __u32 vfrontporch;   __u32 vsync;   __u32 vbackporch;   __u32 il_vfrontporch;   __u32 il_vsync;   __u32 il_vbackporch;   __u32 standards;   __u32 flags;   __u32 reserved[14U]; } ;  1151     union __anonunion____missing_field_name_221 {   struct v4l2_bt_timings bt;   __u32 reserved[32U]; } ;  1151     struct v4l2_dv_timings {   __u32 type;   union __anonunion____missing_field_name_221 __annonCompField73; } ;  1213     struct v4l2_enum_dv_timings {   __u32 index;   __u32 pad;   __u32 reserved[2U];   struct v4l2_dv_timings timings; } ;  1231     struct v4l2_bt_timings_cap {   __u32 min_width;   __u32 max_width;   __u32 min_height;   __u32 max_height;   __u64 min_pixelclock;   __u64 max_pixelclock;   __u32 standards;   __u32 capabilities;   __u32 reserved[16U]; } ;  1254     union __anonunion____missing_field_name_222 {   struct v4l2_bt_timings_cap bt;   __u32 raw_data[32U]; } ;  1254     struct v4l2_dv_timings_cap {   __u32 type;   __u32 pad;   __u32 reserved[2U];   union __anonunion____missing_field_name_222 __annonCompField74; } ;  1343     struct v4l2_control {   __u32 id;   __s32 value; } ;  1361     union __anonunion____missing_field_name_223 {   __s32 value;   __s64 value64;   char *string;   __u8 *p_u8;   __u16 *p_u16;   __u32 *p_u32;   void *ptr; } ;  1361     struct v4l2_ext_control {   __u32 id;   __u32 size;   __u32 reserved2[1U];   union __anonunion____missing_field_name_223 __annonCompField75; } ;  1376     struct v4l2_ext_controls {   __u32 ctrl_class;   __u32 count;   __u32 error_idx;   __u32 reserved[2U];   struct v4l2_ext_control *controls; } ;  1400     struct v4l2_queryctrl {   __u32 id;   __u32 type;   __u8 name[32U];   __s32 minimum;   __s32 maximum;   __s32 step;   __s32 default_value;   __u32 flags;   __u32 reserved[2U]; } ;  1437     union __anonunion____missing_field_name_224 {   __u8 name[32U];   __s64 value; } ;  1437     struct v4l2_querymenu {   __u32 id;   __u32 index;   union __anonunion____missing_field_name_224 __annonCompField76;   __u32 reserved; } ;  1448     struct v4l2_tuner {   __u32 index;   __u8 name[32U];   __u32 type;   __u32 capability;   __u32 rangelow;   __u32 rangehigh;   __u32 rxsubchans;   __u32 audmode;   __s32 signal;   __s32 afc;   __u32 reserved[4U]; } ;  1486     struct v4l2_modulator {   __u32 index;   __u8 name[32U];   __u32 capability;   __u32 rangelow;   __u32 rangehigh;   __u32 txsubchans;   __u32 reserved[4U]; } ;  1496     struct v4l2_frequency {   __u32 tuner;   __u32 type;   __u32 frequency;   __u32 reserved[8U]; } ;  1535     struct v4l2_frequency_band {   __u32 tuner;   __u32 type;   __u32 index;   __u32 capability;   __u32 rangelow;   __u32 rangehigh;   __u32 modulation;   __u32 reserved[9U]; } ;  1703     struct v4l2_vbi_format {   __u32 sampling_rate;   __u32 offset;   __u32 samples_per_line;   __u32 sample_format;   __s32 start[2U];   __u32 count[2U];   __u32 flags;   __u32 reserved[2U]; } ;  1723     struct v4l2_sliced_vbi_format {   __u16 service_set;   __u16 service_lines[2U][24U];   __u32 io_size;   __u32 reserved[2U]; } ;  1751     struct v4l2_sliced_vbi_cap {   __u16 service_set;   __u16 service_lines[2U][24U];   __u32 type;   __u32 reserved[3U]; } ;  1775     struct v4l2_sliced_vbi_data {   __u32 id;   __u32 field;   __u32 line;   __u32 reserved;   __u8 data[48U]; } ;  1909     union __anonunion_parm_233 {   struct v4l2_captureparm capture;   struct v4l2_outputparm output;   __u8 raw_data[200U]; } ;  1909     struct v4l2_streamparm {   __u32 type;   union __anonunion_parm_233 parm; } ;  2000     struct v4l2_event_subscription {   __u32 type;   __u32 id;   __u32 flags;   __u32 reserved[5U]; } ;  2010     union __anonunion____missing_field_name_236 {   __u32 addr;   char name[32U]; } ;  2010     struct v4l2_dbg_match {   __u32 type;   union __anonunion____missing_field_name_236 __annonCompField81; } ;  2036     struct v4l2_dbg_register {   struct v4l2_dbg_match match;   __u32 size;   __u64 reg;   __u64 val; } ;    41     enum fwnode_type {   FWNODE_INVALID = 0,   FWNODE_OF = 1,   FWNODE_ACPI = 2 } ;    47     struct fwnode_handle {   enum fwnode_type type; } ;    32     typedef u32 phandle;    34     struct property {   char *name;   int length;   void *value;   struct property *next;   unsigned long _flags;   unsigned int unique_id;   struct bin_attribute attr; } ;    44     struct device_node {   const char *name;   const char *type;   phandle phandle;   const char *full_name;   struct fwnode_handle fwnode;   struct property *properties;   struct property *deadprops;   struct device_node *parent;   struct device_node *child;   struct device_node *sibling;   struct kobject kobj;   unsigned long _flags;   void *data; } ;  1043     struct i2c_msg {   __u16 addr;   __u16 flags;   __u16 len;   __u8 *buf; } ;    82     union i2c_smbus_data {   __u8 byte;   __u16 word;   __u8 block[34U]; } ;    39     struct i2c_algorithm ;    40     struct i2c_adapter ;    41     struct i2c_client ;    44     enum i2c_slave_event ;   196     struct i2c_client {   unsigned short flags;   unsigned short addr;   char name[20U];   struct i2c_adapter *adapter;   struct device dev;   int irq;   struct list_head detected;   int (*slave_cb)(struct i2c_client *, enum i2c_slave_event , u8 *); } ;   251     enum i2c_slave_event {   I2C_SLAVE_REQ_READ_START = 0,   I2C_SLAVE_REQ_READ_END = 1,   I2C_SLAVE_REQ_WRITE_START = 2,   I2C_SLAVE_REQ_WRITE_END = 3,   I2C_SLAVE_STOP = 4 } ;   359     struct i2c_algorithm {   int (*master_xfer)(struct i2c_adapter *, struct i2c_msg *, int);   int (*smbus_xfer)(struct i2c_adapter *, u16 , unsigned short, char, u8 , int, union i2c_smbus_data *);   u32  (*functionality)(struct i2c_adapter *);   int (*reg_slave)(struct i2c_client *);   int (*unreg_slave)(struct i2c_client *); } ;   411     struct i2c_bus_recovery_info {   int (*recover_bus)(struct i2c_adapter *);   int (*get_scl)(struct i2c_adapter *);   void (*set_scl)(struct i2c_adapter *, int);   int (*get_sda)(struct i2c_adapter *);   void (*prepare_recovery)(struct i2c_bus_recovery_info *);   void (*unprepare_recovery)(struct i2c_bus_recovery_info *);   int scl_gpio;   int sda_gpio; } ;   451     struct i2c_adapter {   struct module *owner;   unsigned int class;   const struct i2c_algorithm *algo;   void *algo_data;   struct rt_mutex bus_lock;   int timeout;   int retries;   struct device dev;   int nr;   char name[48U];   struct completion dev_released;   struct mutex userspace_clients_lock;   struct list_head userspace_clients;   struct i2c_bus_recovery_info *bus_recovery_info; } ;   139     struct pollfd {   int fd;   short events;   short revents; } ;    32     struct poll_table_struct {   void (*_qproc)(struct file *, wait_queue_head_t *, struct poll_table_struct *);   unsigned long _key; } ;   163     struct cdev {   struct kobject kobj;   struct module *owner;   const struct file_operations *ops;   struct list_head list;   dev_t dev;   unsigned int count; } ;   129     struct media_pipeline { } ;   132     struct media_pad ;   132     struct media_link {   struct media_pad *source;   struct media_pad *sink;   struct media_link *reverse;   unsigned long flags; } ;    40     struct media_entity ;    40     struct media_pad {   struct media_entity *entity;   u16 index;   unsigned long flags; } ;    46     struct media_entity_operations {   int (*link_setup)(struct media_entity *, const struct media_pad *, const struct media_pad *, u32 );   int (*link_validate)(struct media_link *); } ;    53     struct media_device ;    53     struct __anonstruct_v4l_243 {   u32 major;   u32 minor; } ;    53     struct __anonstruct_fb_244 {   u32 major;   u32 minor; } ;    53     struct __anonstruct_alsa_245 {   u32 card;   u32 device;   u32 subdevice; } ;    53     union __anonunion_info_242 {   struct __anonstruct_v4l_243 v4l;   struct __anonstruct_fb_244 fb;   struct __anonstruct_alsa_245 alsa;   int dvb; } ;    53     struct media_entity {   struct list_head list;   struct media_device *parent;   u32 id;   const char *name;   u32 type;   u32 revision;   unsigned long flags;   u32 group_id;   u16 num_pads;   u16 num_links;   u16 num_backlinks;   u16 max_links;   struct media_pad *pads;   struct media_link *links;   const struct media_entity_operations *ops;   int stream_count;   int use_count;   struct media_pipeline *pipe;   union __anonunion_info_242 info; } ;   156     struct video_device ;   157     struct v4l2_device ;   158     struct v4l2_ctrl_handler ;   159     struct v4l2_prio_state {   atomic_t prios[4U]; } ;    61     struct v4l2_file_operations {   struct module *owner;   ssize_t  (*read)(struct file *, char *, size_t , loff_t *);   ssize_t  (*write)(struct file *, const char *, size_t , loff_t *);   unsigned int (*poll)(struct file *, struct poll_table_struct *);   long int (*ioctl)(struct file *, unsigned int, unsigned long);   long int (*unlocked_ioctl)(struct file *, unsigned int, unsigned long);   long int (*compat_ioctl32)(struct file *, unsigned int, unsigned long);   unsigned long int (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);   int (*mmap)(struct file *, struct vm_area_struct *);   int (*open)(struct file *);   int (*release)(struct file *); } ;    79     struct vb2_queue ;    79     struct v4l2_ioctl_ops ;    79     struct video_device {   struct media_entity entity;   const struct v4l2_file_operations *fops;   struct device dev;   struct cdev *cdev;   struct v4l2_device *v4l2_dev;   struct device *dev_parent;   struct v4l2_ctrl_handler *ctrl_handler;   struct vb2_queue *queue;   struct v4l2_prio_state *prio;   char name[32U];   int vfl_type;   int vfl_dir;   int minor;   u16 num;   unsigned long flags;   int index;   spinlock_t fh_lock;   struct list_head fh_list;   int dev_debug;   v4l2_std_id tvnorms;   void (*release)(struct video_device *);   const struct v4l2_ioctl_ops *ioctl_ops;   unsigned long valid_ioctls[3U];   unsigned long disable_locking[3U];   struct mutex *lock; } ;    86     struct v4l2_subdev ;    87     struct v4l2_subdev_ops ;   130     struct scatterlist {   unsigned long sg_magic;   unsigned long page_link;   unsigned int offset;   unsigned int length;   dma_addr_t dma_address;   unsigned int dma_length; } ;   147     struct v4l2_priv_tun_config {   int tuner;   void *priv; } ;   196     struct tuner_setup {   unsigned short addr;   unsigned int type;   unsigned int mode_mask;   void *config;   int (*tuner_callback)(void *, int, int, int); } ;   198     struct media_file_operations {   struct module *owner;   ssize_t  (*read)(struct file *, char *, size_t , loff_t *);   ssize_t  (*write)(struct file *, const char *, size_t , loff_t *);   unsigned int (*poll)(struct file *, struct poll_table_struct *);   long int (*ioctl)(struct file *, unsigned int, unsigned long);   long int (*compat_ioctl)(struct file *, unsigned int, unsigned long);   int (*open)(struct file *);   int (*release)(struct file *); } ;    53     struct media_devnode {   const struct media_file_operations *fops;   struct device dev;   struct cdev cdev;   struct device *parent;   int minor;   unsigned long flags;   void (*release)(struct media_devnode *); } ;    98     struct media_device {   struct device *dev;   struct media_devnode devnode;   char model[32U];   char serial[40U];   char bus_info[32U];   u32 hw_revision;   u32 driver_version;   u32 entity_id;   struct list_head entities;   spinlock_t lock;   struct mutex graph_mutex;   int (*link_notify)(struct media_link *, u32 , unsigned int); } ;    98     struct v4l2_mbus_framefmt {   __u32 width;   __u32 height;   __u32 code;   __u32 field;   __u32 colorspace;   __u16 ycbcr_enc;   __u16 quantization;   __u32 reserved[6U]; } ;    43     struct v4l2_subdev_format {   __u32 which;   __u32 pad;   struct v4l2_mbus_framefmt format;   __u32 reserved[8U]; } ;    66     struct v4l2_subdev_mbus_code_enum {   __u32 pad;   __u32 index;   __u32 code;   __u32 reserved[9U]; } ;    79     struct v4l2_subdev_frame_size_enum {   __u32 index;   __u32 pad;   __u32 code;   __u32 min_width;   __u32 max_width;   __u32 min_height;   __u32 max_height;   __u32 reserved[9U]; } ;    96     struct v4l2_subdev_frame_interval {   __u32 pad;   struct v4l2_fract interval;   __u32 reserved[9U]; } ;   107     struct v4l2_subdev_frame_interval_enum {   __u32 index;   __u32 pad;   __u32 code;   __u32 width;   __u32 height;   struct v4l2_fract interval;   __u32 reserved[9U]; } ;   126     struct v4l2_subdev_selection {   __u32 which;   __u32 pad;   __u32 target;   __u32 flags;   struct v4l2_rect r;   __u32 reserved[8U]; } ;   150     struct v4l2_async_notifier ;   151     enum v4l2_async_match_type {   V4L2_ASYNC_MATCH_CUSTOM = 0,   V4L2_ASYNC_MATCH_DEVNAME = 1,   V4L2_ASYNC_MATCH_I2C = 2,   V4L2_ASYNC_MATCH_OF = 3 } ;   158     struct __anonstruct_of_250 {   const struct device_node *node; } ;   158     struct __anonstruct_device_name_251 {   const char *name; } ;   158     struct __anonstruct_i2c_252 {   int adapter_id;   unsigned short address; } ;   158     struct __anonstruct_custom_253 {   bool  (*match)(struct device *, struct v4l2_async_subdev *);   void *priv; } ;   158     union __anonunion_match_249 {   struct __anonstruct_of_250 of;   struct __anonstruct_device_name_251 device_name;   struct __anonstruct_i2c_252 i2c;   struct __anonstruct_custom_253 custom; } ;   158     struct v4l2_async_subdev {   enum v4l2_async_match_type match_type;   union __anonunion_match_249 match;   struct list_head list; } ;    63     struct v4l2_async_notifier {   unsigned int num_subdevs;   struct v4l2_async_subdev **subdevs;   struct v4l2_device *v4l2_dev;   struct list_head waiting;   struct list_head done;   struct list_head list;   int (*bound)(struct v4l2_async_notifier *, struct v4l2_subdev *, struct v4l2_async_subdev *);   int (*complete)(struct v4l2_async_notifier *);   void (*unbind)(struct v4l2_async_notifier *, struct v4l2_subdev *, struct v4l2_async_subdev *); } ;    97     struct v4l2_m2m_ctx ;    97     struct v4l2_fh {   struct list_head list;   struct video_device *vdev;   struct v4l2_ctrl_handler *ctrl_handler;   enum v4l2_priority prio;   wait_queue_head_t wait;   struct list_head subscribed;   struct list_head available;   unsigned int navailable;   u32 sequence;   struct v4l2_m2m_ctx *m2m_ctx; } ;   106     enum v4l2_mbus_type {   V4L2_MBUS_PARALLEL = 0,   V4L2_MBUS_BT656 = 1,   V4L2_MBUS_CSI2 = 2 } ;   112     struct v4l2_mbus_config {   enum v4l2_mbus_type type;   unsigned int flags; } ;   113     struct v4l2_subdev_fh ;   114     struct v4l2_mbus_frame_desc ;   115     struct v4l2_decode_vbi_line {   u32 is_second_field;   u8 *p;   u32 line;   u32 type; } ;    61     struct v4l2_subdev_io_pin_config {   u32 flags;   u8 pin;   u8 function;   u8 value;   u8 strength; } ;   117     struct v4l2_subdev_core_ops {   int (*log_status)(struct v4l2_subdev *);   int (*s_io_pin_config)(struct v4l2_subdev *, size_t , struct v4l2_subdev_io_pin_config *);   int (*init)(struct v4l2_subdev *, u32 );   int (*load_fw)(struct v4l2_subdev *);   int (*reset)(struct v4l2_subdev *, u32 );   int (*s_gpio)(struct v4l2_subdev *, u32 );   int (*queryctrl)(struct v4l2_subdev *, struct v4l2_queryctrl *);   int (*g_ctrl)(struct v4l2_subdev *, struct v4l2_control *);   int (*s_ctrl)(struct v4l2_subdev *, struct v4l2_control *);   int (*g_ext_ctrls)(struct v4l2_subdev *, struct v4l2_ext_controls *);   int (*s_ext_ctrls)(struct v4l2_subdev *, struct v4l2_ext_controls *);   int (*try_ext_ctrls)(struct v4l2_subdev *, struct v4l2_ext_controls *);   int (*querymenu)(struct v4l2_subdev *, struct v4l2_querymenu *);   long int (*ioctl)(struct v4l2_subdev *, unsigned int, void *);   long int (*compat_ioctl32)(struct v4l2_subdev *, unsigned int, unsigned long);   int (*g_register)(struct v4l2_subdev *, struct v4l2_dbg_register *);   int (*s_register)(struct v4l2_subdev *, const struct v4l2_dbg_register *);   int (*s_power)(struct v4l2_subdev *, int);   int (*interrupt_service_routine)(struct v4l2_subdev *, u32 , bool *);   int (*subscribe_event)(struct v4l2_subdev *, struct v4l2_fh *, struct v4l2_event_subscription *);   int (*unsubscribe_event)(struct v4l2_subdev *, struct v4l2_fh *, struct v4l2_event_subscription *); } ;   178     struct v4l2_subdev_tuner_ops {   int (*s_radio)(struct v4l2_subdev *);   int (*s_frequency)(struct v4l2_subdev *, const struct v4l2_frequency *);   int (*g_frequency)(struct v4l2_subdev *, struct v4l2_frequency *);   int (*enum_freq_bands)(struct v4l2_subdev *, struct v4l2_frequency_band *);   int (*g_tuner)(struct v4l2_subdev *, struct v4l2_tuner *);   int (*s_tuner)(struct v4l2_subdev *, const struct v4l2_tuner *);   int (*g_modulator)(struct v4l2_subdev *, struct v4l2_modulator *);   int (*s_modulator)(struct v4l2_subdev *, const struct v4l2_modulator *);   int (*s_type_addr)(struct v4l2_subdev *, struct tuner_setup *);   int (*s_config)(struct v4l2_subdev *, const struct v4l2_priv_tun_config *); } ;   205     struct v4l2_subdev_audio_ops {   int (*s_clock_freq)(struct v4l2_subdev *, u32 );   int (*s_i2s_clock_freq)(struct v4l2_subdev *, u32 );   int (*s_routing)(struct v4l2_subdev *, u32 , u32 , u32 );   int (*s_stream)(struct v4l2_subdev *, int); } ;   232     struct v4l2_mbus_frame_desc_entry {   u16 flags;   u32 pixelcode;   u32 length; } ;   253     struct v4l2_mbus_frame_desc {   struct v4l2_mbus_frame_desc_entry entry[4U];   unsigned short num_entries; } ;   265     struct v4l2_subdev_video_ops {   int (*s_routing)(struct v4l2_subdev *, u32 , u32 , u32 );   int (*s_crystal_freq)(struct v4l2_subdev *, u32 , u32 );   int (*g_std)(struct v4l2_subdev *, v4l2_std_id *);   int (*s_std)(struct v4l2_subdev *, v4l2_std_id );   int (*s_std_output)(struct v4l2_subdev *, v4l2_std_id );   int (*g_std_output)(struct v4l2_subdev *, v4l2_std_id *);   int (*querystd)(struct v4l2_subdev *, v4l2_std_id *);   int (*g_tvnorms)(struct v4l2_subdev *, v4l2_std_id *);   int (*g_tvnorms_output)(struct v4l2_subdev *, v4l2_std_id *);   int (*g_input_status)(struct v4l2_subdev *, u32 *);   int (*s_stream)(struct v4l2_subdev *, int);   int (*cropcap)(struct v4l2_subdev *, struct v4l2_cropcap *);   int (*g_crop)(struct v4l2_subdev *, struct v4l2_crop *);   int (*s_crop)(struct v4l2_subdev *, const struct v4l2_crop *);   int (*g_parm)(struct v4l2_subdev *, struct v4l2_streamparm *);   int (*s_parm)(struct v4l2_subdev *, struct v4l2_streamparm *);   int (*g_frame_interval)(struct v4l2_subdev *, struct v4l2_subdev_frame_interval *);   int (*s_frame_interval)(struct v4l2_subdev *, struct v4l2_subdev_frame_interval *);   int (*enum_framesizes)(struct v4l2_subdev *, struct v4l2_frmsizeenum *);   int (*enum_frameintervals)(struct v4l2_subdev *, struct v4l2_frmivalenum *);   int (*s_dv_timings)(struct v4l2_subdev *, struct v4l2_dv_timings *);   int (*g_dv_timings)(struct v4l2_subdev *, struct v4l2_dv_timings *);   int (*query_dv_timings)(struct v4l2_subdev *, struct v4l2_dv_timings *);   int (*enum_mbus_fmt)(struct v4l2_subdev *, unsigned int, u32 *);   int (*g_mbus_fmt)(struct v4l2_subdev *, struct v4l2_mbus_framefmt *);   int (*try_mbus_fmt)(struct v4l2_subdev *, struct v4l2_mbus_framefmt *);   int (*s_mbus_fmt)(struct v4l2_subdev *, struct v4l2_mbus_framefmt *);   int (*g_mbus_config)(struct v4l2_subdev *, struct v4l2_mbus_config *);   int (*s_mbus_config)(struct v4l2_subdev *, const struct v4l2_mbus_config *);   int (*s_rx_buffer)(struct v4l2_subdev *, void *, unsigned int *); } ;   357     struct v4l2_subdev_vbi_ops {   int (*decode_vbi_line)(struct v4l2_subdev *, struct v4l2_decode_vbi_line *);   int (*s_vbi_data)(struct v4l2_subdev *, const struct v4l2_sliced_vbi_data *);   int (*g_vbi_data)(struct v4l2_subdev *, struct v4l2_sliced_vbi_data *);   int (*g_sliced_vbi_cap)(struct v4l2_subdev *, struct v4l2_sliced_vbi_cap *);   int (*s_raw_fmt)(struct v4l2_subdev *, struct v4l2_vbi_format *);   int (*g_sliced_fmt)(struct v4l2_subdev *, struct v4l2_sliced_vbi_format *);   int (*s_sliced_fmt)(struct v4l2_subdev *, struct v4l2_sliced_vbi_format *); } ;   397     struct v4l2_subdev_sensor_ops {   int (*g_skip_top_lines)(struct v4l2_subdev *, u32 *);   int (*g_skip_frames)(struct v4l2_subdev *, u32 *); } ;   412     enum v4l2_subdev_ir_mode {   V4L2_SUBDEV_IR_MODE_PULSE_WIDTH = 0 } ;   416     struct v4l2_subdev_ir_parameters {   unsigned int bytes_per_data_element;   enum v4l2_subdev_ir_mode mode;   bool enable;   bool interrupt_enable;   bool shutdown;   bool modulation;   u32 max_pulse_width;   unsigned int carrier_freq;   unsigned int duty_cycle;   bool invert_level;   bool invert_carrier_sense;   u32 noise_filter_min_width;   unsigned int carrier_range_lower;   unsigned int carrier_range_upper;   u32 resolution; } ;   464     struct v4l2_subdev_ir_ops {   int (*rx_read)(struct v4l2_subdev *, u8 *, size_t , ssize_t *);   int (*rx_g_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *);   int (*rx_s_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *);   int (*tx_write)(struct v4l2_subdev *, u8 *, size_t , ssize_t *);   int (*tx_g_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *);   int (*tx_s_parameters)(struct v4l2_subdev *, struct v4l2_subdev_ir_parameters *); } ;   483     struct v4l2_subdev_pad_ops {   int (*enum_mbus_code)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_mbus_code_enum *);   int (*enum_frame_size)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_frame_size_enum *);   int (*enum_frame_interval)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_frame_interval_enum *);   int (*get_fmt)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_format *);   int (*set_fmt)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_format *);   int (*get_selection)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_selection *);   int (*set_selection)(struct v4l2_subdev *, struct v4l2_subdev_fh *, struct v4l2_subdev_selection *);   int (*get_edid)(struct v4l2_subdev *, struct v4l2_edid *);   int (*set_edid)(struct v4l2_subdev *, struct v4l2_edid *);   int (*dv_timings_cap)(struct v4l2_subdev *, struct v4l2_dv_timings_cap *);   int (*enum_dv_timings)(struct v4l2_subdev *, struct v4l2_enum_dv_timings *);   int (*link_validate)(struct v4l2_subdev *, struct media_link *, struct v4l2_subdev_format *, struct v4l2_subdev_format *);   int (*get_frame_desc)(struct v4l2_subdev *, unsigned int, struct v4l2_mbus_frame_desc *);   int (*set_frame_desc)(struct v4l2_subdev *, unsigned int, struct v4l2_mbus_frame_desc *); } ;   523     struct v4l2_subdev_ops {   const struct v4l2_subdev_core_ops *core;   const struct v4l2_subdev_tuner_ops *tuner;   const struct v4l2_subdev_audio_ops *audio;   const struct v4l2_subdev_video_ops *video;   const struct v4l2_subdev_vbi_ops *vbi;   const struct v4l2_subdev_ir_ops *ir;   const struct v4l2_subdev_sensor_ops *sensor;   const struct v4l2_subdev_pad_ops *pad; } ;   535     struct v4l2_subdev_internal_ops {   int (*registered)(struct v4l2_subdev *);   void (*unregistered)(struct v4l2_subdev *);   int (*open)(struct v4l2_subdev *, struct v4l2_subdev_fh *);   int (*close)(struct v4l2_subdev *, struct v4l2_subdev_fh *); } ;   556     struct regulator_bulk_data ;   557     struct v4l2_subdev_platform_data {   struct regulator_bulk_data *regulators;   int num_regulators;   void *host_priv; } ;   578     struct v4l2_subdev {   struct media_entity entity;   struct list_head list;   struct module *owner;   bool owner_v4l2_dev;   u32 flags;   struct v4l2_device *v4l2_dev;   const struct v4l2_subdev_ops *ops;   const struct v4l2_subdev_internal_ops *internal_ops;   struct v4l2_ctrl_handler *ctrl_handler;   char name[32U];   u32 grp_id;   void *dev_priv;   void *host_priv;   struct video_device *devnode;   struct device *dev;   struct list_head async_list;   struct v4l2_async_subdev *asd;   struct v4l2_async_notifier *notifier;   struct v4l2_subdev_platform_data *pdata; } ;   616     struct __anonstruct_pad_254 {   struct v4l2_mbus_framefmt try_fmt;   struct v4l2_rect try_crop;   struct v4l2_rect try_compose; } ;   616     struct v4l2_subdev_fh {   struct v4l2_fh vfh;   struct __anonstruct_pad_254 *pad; } ;   685     struct v4l2_device {   struct device *dev;   struct media_device *mdev;   struct list_head subdevs;   spinlock_t lock;   char name[36U];   void (*notify)(struct v4l2_subdev *, unsigned int, void *);   struct v4l2_ctrl_handler *ctrl_handler;   struct v4l2_prio_state prio;   struct mutex ioctl_lock;   struct kref ref;   void (*release)(struct v4l2_device *); } ;   141     enum parse_state {   parse_state_continue = 0,   parse_state_next_frame = 1,   parse_state_out = 2,   parse_state_end_parse = 3 } ;   157     enum stream_state {   stream_off = 0,   stream_idle = 1,   stream_interrupt = 2,   stream_on = 3 } ;   164     enum isoc_state {   isoc_state_in_frame = 0,   isoc_state_no_frame = 1 } ;   169     struct usbvision_sbuf {   char *data;   struct urb *urb; } ;   265     struct usbvision_v4l2_format_st {   int supported;   int bytes_per_pixel;   int depth;   int format;   char *desc; } ;   282     struct usbvision_frame_header {   unsigned char magic_1;   unsigned char magic_2;   unsigned char header_length;   unsigned char frame_num;   unsigned char frame_phase;   unsigned char frame_latency;   unsigned char data_format;   unsigned char format_param;   unsigned char frame_width_lo;   unsigned char frame_width_hi;   unsigned char frame_height_lo;   unsigned char frame_height_hi;   __u16 frame_width;   __u16 frame_height; } ;   300     struct usbvision_frame {   char *data;   struct usbvision_frame_header isoc_header;   int width;   int height;   int index;   int frmwidth;   int frmheight;   volatile int grabstate;   int scanstate;   struct list_head frame;   int curline;   long scanlength;   long bytes_read;   struct usbvision_v4l2_format_st v4l2_format;   int v4l2_linesize;   struct timeval timestamp;   int sequence; } ;   325     struct usbvision_device_data_st {   __u64 video_norm;   const char *model_string;   int interface;   __u16 codec;   unsigned char video_channels;   unsigned char audio_channels;   unsigned char radio;   unsigned char vbi;   unsigned char tuner;   unsigned char vin_reg1_override;   unsigned char vin_reg2_override;   unsigned char dvi_yuv_override;   __u8 vin_reg1;   __u8 vin_reg2;   __u8 dvi_yuv;   __u8 tuner_type;   __s16 x_offset;   __s16 y_offset; } ;   357     struct usb_usbvision {   struct v4l2_device v4l2_dev;   struct video_device *vdev;   struct video_device *rdev;   struct i2c_adapter i2c_adap;   int registered_i2c;   struct urb *ctrl_urb;   unsigned char ctrl_urb_buffer[8U];   int ctrl_urb_busy;   struct usb_ctrlrequest ctrl_urb_setup;   wait_queue_head_t ctrl_urb_wq;   int have_tuner;   int tuner_type;   int bridge_type;   int radio;   int video_inputs;   unsigned long freq;   int audio_mute;   int audio_channel;   int isoc_mode;   unsigned int nr;   struct usb_device *dev;   int num_alt;   unsigned int *alt_max_pkt_size;   unsigned char iface;   unsigned char iface_alt;   unsigned char vin_reg2_preset;   struct mutex v4l2_lock;   struct timer_list power_off_timer;   struct work_struct power_off_work;   int power;   int user;   int initialized;   int dev_model;   enum stream_state streaming;   int last_error;   int curwidth;   int curheight;   int stretch_width;   int stretch_height;   char *fbuf;   int max_frame_size;   int fbuf_size;   spinlock_t queue_lock;   struct list_head inqueue;   struct list_head outqueue;   wait_queue_head_t wait_frame;   wait_queue_head_t wait_stream;   struct usbvision_frame *cur_frame;   struct usbvision_frame frame[3U];   int num_frames;   struct usbvision_sbuf sbuf[2U];   volatile int remove_pending;   unsigned char *scratch;   int scratch_read_ptr;   int scratch_write_ptr;   int scratch_headermarker[20U];   int scratch_headermarker_read_ptr;   int scratch_headermarker_write_ptr;   enum isoc_state isocstate;   struct usbvision_v4l2_format_st palette;   struct v4l2_capability vcap;   unsigned int ctl_input;   v4l2_std_id tvnorm_id;   unsigned char video_endp;   unsigned char *intra_frame_buffer;   int block_pos;   int request_intra;   int last_isoc_frame_num;   int isoc_packet_size;   int used_bandwidth;   int compr_level;   int last_compr_level;   int usb_bandwidth;   unsigned long isoc_urb_count;   unsigned long urb_length;   unsigned long isoc_data_count;   unsigned long header_count;   unsigned long scratch_ovf_count;   unsigned long isoc_skip_count;   unsigned long isoc_err_count;   unsigned long isoc_packet_count;   unsigned long time_in_irq;   int isoc_measure_bandwidth_count;   int frame_num;   int max_strip_len;   int comprblock_pos;   int strip_len_errors;   int strip_magic_errors;   int strip_line_number_errors;   int compr_block_types[4U]; } ;    39     struct usb_device_id {   __u16 match_flags;   __u16 idVendor;   __u16 idProduct;   __u16 bcdDevice_lo;   __u16 bcdDevice_hi;   __u8 bDeviceClass;   __u8 bDeviceSubClass;   __u8 bDeviceProtocol;   __u8 bInterfaceClass;   __u8 bInterfaceSubClass;   __u8 bInterfaceProtocol;   __u8 bInterfaceNumber;   kernel_ulong_t driver_info; } ;   283     struct usb_driver ;   793     struct usb_dynids {   spinlock_t lock;   struct list_head list; } ;   981     struct usbdrv_wrap {   struct device_driver driver;   int for_devices; } ;   991     struct usb_driver {   const char *name;   int (*probe)(struct usb_interface *, const struct usb_device_id *);   void (*disconnect)(struct usb_interface *);   int (*unlocked_ioctl)(struct usb_interface *, unsigned int, void *);   int (*suspend)(struct usb_interface *, pm_message_t );   int (*resume)(struct usb_interface *);   int (*reset_resume)(struct usb_interface *);   int (*pre_reset)(struct usb_interface *);   int (*post_reset)(struct usb_interface *);   const struct usb_device_id *id_table;   struct usb_dynids dynids;   struct usbdrv_wrap drvwrap;   unsigned char no_dynamic_id;   unsigned char supports_autosuspend;   unsigned char disable_hub_initiated_lpm;   unsigned char soft_unbind; } ;   571     enum v4l2_buf_type {   V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,   V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,   V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,   V4L2_BUF_TYPE_VBI_CAPTURE = 4,   V4L2_BUF_TYPE_VBI_OUTPUT = 5,   V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,   V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,   V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,   V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,   V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,   V4L2_BUF_TYPE_SDR_CAPTURE = 11,   V4L2_BUF_TYPE_PRIVATE = 128 } ;   320     struct v4l2_pix_format {   __u32 width;   __u32 height;   __u32 pixelformat;   __u32 field;   __u32 bytesperline;   __u32 sizeimage;   __u32 colorspace;   __u32 priv;   __u32 flags;   __u32 ycbcr_enc;   __u32 quantization; } ;   373     struct v4l2_fmtdesc {   __u32 index;   __u32 type;   __u32 flags;   __u8 description[32U];   __u32 pixelformat;   __u32 reserved[4U]; } ;   627     struct v4l2_timecode {   __u32 type;   __u32 flags;   __u8 frames;   __u8 seconds;   __u8 minutes;   __u8 hours;   __u8 userbits[4U]; } ;   641     struct v4l2_jpegcompression {   int quality;   int APPn;   int APP_len;   char APP_data[60U];   int COM_len;   char COM_data[60U];   __u32 jpeg_markers; } ;   670     struct v4l2_requestbuffers {   __u32 count;   __u32 type;   __u32 memory;   __u32 reserved[2U]; } ;   695     union __anonunion_m_220 {   __u32 mem_offset;   unsigned long userptr;   __s32 fd; } ;   695     struct v4l2_plane {   __u32 bytesused;   __u32 length;   union __anonunion_m_220 m;   __u32 data_offset;   __u32 reserved[11U]; } ;   727     union __anonunion_m_221 {   __u32 offset;   unsigned long userptr;   struct v4l2_plane *planes;   __s32 fd; } ;   727     struct v4l2_buffer {   __u32 index;   __u32 type;   __u32 bytesused;   __u32 flags;   __u32 field;   struct timeval timestamp;   struct v4l2_timecode timecode;   __u32 sequence;   __u32 memory;   union __anonunion_m_221 m;   __u32 length;   __u32 reserved2;   __u32 reserved; } ;   780     struct v4l2_exportbuffer {   __u32 type;   __u32 index;   __u32 plane;   __u32 flags;   __s32 fd;   __u32 reserved[11U]; } ;   839     struct __anonstruct_fmt_222 {   __u32 width;   __u32 height;   __u32 pixelformat;   __u32 field;   __u32 bytesperline;   __u32 sizeimage;   __u32 colorspace;   __u32 priv; } ;   839     struct v4l2_framebuffer {   __u32 capability;   __u32 flags;   void *base;   struct __anonstruct_fmt_222 fmt; } ;   860     struct v4l2_clip {   struct v4l2_rect c;   struct v4l2_clip *next; } ;   882     struct v4l2_window {   struct v4l2_rect w;   __u32 field;   __u32 chromakey;   struct v4l2_clip *clips;   __u32 clipcount;   void *bitmap;   __u8 global_alpha; } ;   932     struct v4l2_selection {   __u32 type;   __u32 target;   __u32 flags;   struct v4l2_rect r;   __u32 reserved[9U]; } ;  1279     struct v4l2_input {   __u32 index;   __u8 name[32U];   __u32 type;   __u32 audioset;   __u32 tuner;   v4l2_std_id std;   __u32 status;   __u32 capabilities;   __u32 reserved[3U]; } ;  1295     struct v4l2_output {   __u32 index;   __u8 name[32U];   __u32 type;   __u32 audioset;   __u32 modulator;   v4l2_std_id std;   __u32 capabilities;   __u32 reserved[3U]; } ;  1420     struct v4l2_query_ext_ctrl {   __u32 id;   __u32 type;   char name[32U];   __s64 minimum;   __s64 maximum;   __u64 step;   __s64 default_value;   __u32 flags;   __u32 elem_size;   __u32 elems;   __u32 nr_of_dims;   __u32 dims[4U];   __u32 reserved[32U]; } ;  1550     struct v4l2_hw_freq_seek {   __u32 tuner;   __u32 type;   __u32 seek_upward;   __u32 wrap_around;   __u32 spacing;   __u32 rangelow;   __u32 rangehigh;   __u32 reserved[5U]; } ;  1571     struct v4l2_audio {   __u32 index;   __u8 name[32U];   __u32 capability;   __u32 mode;   __u32 reserved[2U]; } ;  1593     struct v4l2_audioout {   __u32 index;   __u8 name[32U];   __u32 capability;   __u32 mode;   __u32 reserved[2U]; } ;  1608     struct v4l2_enc_idx_entry {   __u64 offset;   __u64 pts;   __u32 length;   __u32 flags;   __u32 reserved[2U]; } ;  1627     struct v4l2_enc_idx {   __u32 entries;   __u32 entries_cap;   __u32 reserved[4U];   struct v4l2_enc_idx_entry entry[64U]; } ;  1635     struct __anonstruct_raw_228 {   __u32 data[8U]; } ;  1635     union __anonunion____missing_field_name_227 {   struct __anonstruct_raw_228 raw; } ;  1635     struct v4l2_encoder_cmd {   __u32 cmd;   __u32 flags;   union __anonunion____missing_field_name_227 __annonCompField79; } ;  1654     struct __anonstruct_stop_230 {   __u64 pts; } ;  1654     struct __anonstruct_start_231 {   __s32 speed;   __u32 format; } ;  1654     struct __anonstruct_raw_232 {   __u32 data[16U]; } ;  1654     union __anonunion____missing_field_name_229 {   struct __anonstruct_stop_230 stop;   struct __anonstruct_start_231 start;   struct __anonstruct_raw_232 raw; } ;  1654     struct v4l2_decoder_cmd {   __u32 cmd;   __u32 flags;   union __anonunion____missing_field_name_229 __annonCompField80; } ;  1830     struct v4l2_plane_pix_format {   __u32 sizeimage;   __u16 bytesperline;   __u16 reserved[7U]; } ;  1847     struct v4l2_pix_format_mplane {   __u32 width;   __u32 height;   __u32 pixelformat;   __u32 field;   __u32 colorspace;   struct v4l2_plane_pix_format plane_fmt[8U];   __u8 num_planes;   __u8 flags;   __u8 ycbcr_enc;   __u8 quantization;   __u8 reserved[8U]; } ;  1875     struct v4l2_sdr_format {   __u32 pixelformat;   __u32 buffersize;   __u8 reserved[24U]; } ;  1886     union __anonunion_fmt_234 {   struct v4l2_pix_format pix;   struct v4l2_pix_format_mplane pix_mp;   struct v4l2_window win;   struct v4l2_vbi_format vbi;   struct v4l2_sliced_vbi_format sliced;   struct v4l2_sdr_format sdr;   __u8 raw_data[200U]; } ;  1886     struct v4l2_format {   __u32 type;   union __anonunion_fmt_234 fmt; } ;  2043     struct v4l2_dbg_chip_info {   struct v4l2_dbg_match match;   char name[32U];   __u32 flags;   __u32 reserved[32U]; } ;  2054     struct v4l2_create_buffers {   __u32 index;   __u32 count;   __u32 memory;   struct v4l2_format format;   __u32 reserved[8U]; } ;   192     struct v4l2_ioctl_ops {   int (*vidioc_querycap)(struct file *, void *, struct v4l2_capability *);   int (*vidioc_g_priority)(struct file *, void *, enum v4l2_priority *);   int (*vidioc_s_priority)(struct file *, void *, enum v4l2_priority );   int (*vidioc_enum_fmt_vid_cap)(struct file *, void *, struct v4l2_fmtdesc *);   int (*vidioc_enum_fmt_vid_overlay)(struct file *, void *, struct v4l2_fmtdesc *);   int (*vidioc_enum_fmt_vid_out)(struct file *, void *, struct v4l2_fmtdesc *);   int (*vidioc_enum_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_fmtdesc *);   int (*vidioc_enum_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_fmtdesc *);   int (*vidioc_enum_fmt_sdr_cap)(struct file *, void *, struct v4l2_fmtdesc *);   int (*vidioc_g_fmt_vid_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_g_fmt_vid_overlay)(struct file *, void *, struct v4l2_format *);   int (*vidioc_g_fmt_vid_out)(struct file *, void *, struct v4l2_format *);   int (*vidioc_g_fmt_vid_out_overlay)(struct file *, void *, struct v4l2_format *);   int (*vidioc_g_fmt_vbi_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_g_fmt_vbi_out)(struct file *, void *, struct v4l2_format *);   int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_g_fmt_sliced_vbi_out)(struct file *, void *, struct v4l2_format *);   int (*vidioc_g_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_format *);   int (*vidioc_g_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_format *);   int (*vidioc_g_fmt_sdr_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_s_fmt_vid_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_s_fmt_vid_overlay)(struct file *, void *, struct v4l2_format *);   int (*vidioc_s_fmt_vid_out)(struct file *, void *, struct v4l2_format *);   int (*vidioc_s_fmt_vid_out_overlay)(struct file *, void *, struct v4l2_format *);   int (*vidioc_s_fmt_vbi_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_s_fmt_vbi_out)(struct file *, void *, struct v4l2_format *);   int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_s_fmt_sliced_vbi_out)(struct file *, void *, struct v4l2_format *);   int (*vidioc_s_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_format *);   int (*vidioc_s_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_format *);   int (*vidioc_s_fmt_sdr_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_try_fmt_vid_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_try_fmt_vid_overlay)(struct file *, void *, struct v4l2_format *);   int (*vidioc_try_fmt_vid_out)(struct file *, void *, struct v4l2_format *);   int (*vidioc_try_fmt_vid_out_overlay)(struct file *, void *, struct v4l2_format *);   int (*vidioc_try_fmt_vbi_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_try_fmt_vbi_out)(struct file *, void *, struct v4l2_format *);   int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_try_fmt_sliced_vbi_out)(struct file *, void *, struct v4l2_format *);   int (*vidioc_try_fmt_vid_cap_mplane)(struct file *, void *, struct v4l2_format *);   int (*vidioc_try_fmt_vid_out_mplane)(struct file *, void *, struct v4l2_format *);   int (*vidioc_try_fmt_sdr_cap)(struct file *, void *, struct v4l2_format *);   int (*vidioc_reqbufs)(struct file *, void *, struct v4l2_requestbuffers *);   int (*vidioc_querybuf)(struct file *, void *, struct v4l2_buffer *);   int (*vidioc_qbuf)(struct file *, void *, struct v4l2_buffer *);   int (*vidioc_expbuf)(struct file *, void *, struct v4l2_exportbuffer *);   int (*vidioc_dqbuf)(struct file *, void *, struct v4l2_buffer *);   int (*vidioc_create_bufs)(struct file *, void *, struct v4l2_create_buffers *);   int (*vidioc_prepare_buf)(struct file *, void *, struct v4l2_buffer *);   int (*vidioc_overlay)(struct file *, void *, unsigned int);   int (*vidioc_g_fbuf)(struct file *, void *, struct v4l2_framebuffer *);   int (*vidioc_s_fbuf)(struct file *, void *, const struct v4l2_framebuffer *);   int (*vidioc_streamon)(struct file *, void *, enum v4l2_buf_type );   int (*vidioc_streamoff)(struct file *, void *, enum v4l2_buf_type );   int (*vidioc_g_std)(struct file *, void *, v4l2_std_id *);   int (*vidioc_s_std)(struct file *, void *, v4l2_std_id );   int (*vidioc_querystd)(struct file *, void *, v4l2_std_id *);   int (*vidioc_enum_input)(struct file *, void *, struct v4l2_input *);   int (*vidioc_g_input)(struct file *, void *, unsigned int *);   int (*vidioc_s_input)(struct file *, void *, unsigned int);   int (*vidioc_enum_output)(struct file *, void *, struct v4l2_output *);   int (*vidioc_g_output)(struct file *, void *, unsigned int *);   int (*vidioc_s_output)(struct file *, void *, unsigned int);   int (*vidioc_queryctrl)(struct file *, void *, struct v4l2_queryctrl *);   int (*vidioc_query_ext_ctrl)(struct file *, void *, struct v4l2_query_ext_ctrl *);   int (*vidioc_g_ctrl)(struct file *, void *, struct v4l2_control *);   int (*vidioc_s_ctrl)(struct file *, void *, struct v4l2_control *);   int (*vidioc_g_ext_ctrls)(struct file *, void *, struct v4l2_ext_controls *);   int (*vidioc_s_ext_ctrls)(struct file *, void *, struct v4l2_ext_controls *);   int (*vidioc_try_ext_ctrls)(struct file *, void *, struct v4l2_ext_controls *);   int (*vidioc_querymenu)(struct file *, void *, struct v4l2_querymenu *);   int (*vidioc_enumaudio)(struct file *, void *, struct v4l2_audio *);   int (*vidioc_g_audio)(struct file *, void *, struct v4l2_audio *);   int (*vidioc_s_audio)(struct file *, void *, const struct v4l2_audio *);   int (*vidioc_enumaudout)(struct file *, void *, struct v4l2_audioout *);   int (*vidioc_g_audout)(struct file *, void *, struct v4l2_audioout *);   int (*vidioc_s_audout)(struct file *, void *, const struct v4l2_audioout *);   int (*vidioc_g_modulator)(struct file *, void *, struct v4l2_modulator *);   int (*vidioc_s_modulator)(struct file *, void *, const struct v4l2_modulator *);   int (*vidioc_cropcap)(struct file *, void *, struct v4l2_cropcap *);   int (*vidioc_g_crop)(struct file *, void *, struct v4l2_crop *);   int (*vidioc_s_crop)(struct file *, void *, const struct v4l2_crop *);   int (*vidioc_g_selection)(struct file *, void *, struct v4l2_selection *);   int (*vidioc_s_selection)(struct file *, void *, struct v4l2_selection *);   int (*vidioc_g_jpegcomp)(struct file *, void *, struct v4l2_jpegcompression *);   int (*vidioc_s_jpegcomp)(struct file *, void *, const struct v4l2_jpegcompression *);   int (*vidioc_g_enc_index)(struct file *, void *, struct v4l2_enc_idx *);   int (*vidioc_encoder_cmd)(struct file *, void *, struct v4l2_encoder_cmd *);   int (*vidioc_try_encoder_cmd)(struct file *, void *, struct v4l2_encoder_cmd *);   int (*vidioc_decoder_cmd)(struct file *, void *, struct v4l2_decoder_cmd *);   int (*vidioc_try_decoder_cmd)(struct file *, void *, struct v4l2_decoder_cmd *);   int (*vidioc_g_parm)(struct file *, void *, struct v4l2_streamparm *);   int (*vidioc_s_parm)(struct file *, void *, struct v4l2_streamparm *);   int (*vidioc_g_tuner)(struct file *, void *, struct v4l2_tuner *);   int (*vidioc_s_tuner)(struct file *, void *, const struct v4l2_tuner *);   int (*vidioc_g_frequency)(struct file *, void *, struct v4l2_frequency *);   int (*vidioc_s_frequency)(struct file *, void *, const struct v4l2_frequency *);   int (*vidioc_enum_freq_bands)(struct file *, void *, struct v4l2_frequency_band *);   int (*vidioc_g_sliced_vbi_cap)(struct file *, void *, struct v4l2_sliced_vbi_cap *);   int (*vidioc_log_status)(struct file *, void *);   int (*vidioc_s_hw_freq_seek)(struct file *, void *, const struct v4l2_hw_freq_seek *);   int (*vidioc_g_register)(struct file *, void *, struct v4l2_dbg_register *);   int (*vidioc_s_register)(struct file *, void *, const struct v4l2_dbg_register *);   int (*vidioc_g_chip_info)(struct file *, void *, struct v4l2_dbg_chip_info *);   int (*vidioc_enum_framesizes)(struct file *, void *, struct v4l2_frmsizeenum *);   int (*vidioc_enum_frameintervals)(struct file *, void *, struct v4l2_frmivalenum *);   int (*vidioc_s_dv_timings)(struct file *, void *, struct v4l2_dv_timings *);   int (*vidioc_g_dv_timings)(struct file *, void *, struct v4l2_dv_timings *);   int (*vidioc_query_dv_timings)(struct file *, void *, struct v4l2_dv_timings *);   int (*vidioc_enum_dv_timings)(struct file *, void *, struct v4l2_enum_dv_timings *);   int (*vidioc_dv_timings_cap)(struct file *, void *, struct v4l2_dv_timings_cap *);   int (*vidioc_g_edid)(struct file *, void *, struct v4l2_edid *);   int (*vidioc_s_edid)(struct file *, void *, struct v4l2_edid *);   int (*vidioc_subscribe_event)(struct v4l2_fh *, const struct v4l2_event_subscription *);   int (*vidioc_unsubscribe_event)(struct v4l2_fh *, const struct v4l2_event_subscription *);   long int (*vidioc_default)(struct file *, void *, bool , unsigned int, void *); } ;    41     typedef struct usb_device *ldv_func_ret_type;   117     enum v4l2_i2c_tuner_type {   ADDRS_RADIO = 0,   ADDRS_DEMOD = 1,   ADDRS_TV = 2,   ADDRS_TV_WITH_DEMOD = 3 } ;    72     void set_bit(long nr, volatile unsigned long *addr);   110     void clear_bit(long nr, volatile unsigned long *addr);   140     int printk(const char *, ...);   166     void __might_sleep(const char *, int, int);    25     void INIT_LIST_HEAD(struct list_head *list);    48     void __list_add(struct list_head *, struct list_head *, struct list_head *);    75     void list_add_tail(struct list_head *new, struct list_head *head);   112     void __list_del_entry(struct list_head *);   165     void list_move_tail(struct list_head *list, struct list_head *head);   187     int list_empty(const struct list_head *head);    30     void * __memcpy(void *, const void *, size_t );    57     void * __memset(void *, int, size_t );   279     void lockdep_init_map(struct lockdep_map *, const char *, struct lock_class_key *, int);    93     void __raw_spin_lock_init(raw_spinlock_t *, const char *, struct lock_class_key *);    34     unsigned long int _raw_spin_lock_irqsave(raw_spinlock_t *);    45     void _raw_spin_unlock_irqrestore(raw_spinlock_t *, unsigned long);   299     raw_spinlock_t * spinlock_check(spinlock_t *lock);   370     void spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags);    72     void __init_waitqueue_head(wait_queue_head_t *, const char *, struct lock_class_key *);   105     int waitqueue_active(wait_queue_head_t *q);   149     void __wake_up(wait_queue_head_t *, unsigned int, int, void *);   913     long int prepare_to_wait_event(wait_queue_head_t *, wait_queue_t *, int);   914     void finish_wait(wait_queue_head_t *, wait_queue_t *);   141     int mutex_lock_interruptible_nested(struct mutex *, unsigned int);   174     void mutex_unlock(struct mutex *);    77     extern volatile unsigned long jiffies;   291     unsigned long int msecs_to_jiffies(const unsigned int);    94     void init_timer_key(struct timer_list *, unsigned int, const char *, struct lock_class_key *);   169     int timer_pending(const struct timer_list *timer);   175     int del_timer(struct timer_list *);   176     int mod_timer(struct timer_list *, unsigned long);   180     void __init_work(struct work_struct *, int);   351     extern struct workqueue_struct *system_wq;   427     bool  queue_work_on(int, struct workqueue_struct *, struct work_struct *);   467     bool  queue_work(struct workqueue_struct *wq, struct work_struct *work);   526     bool  schedule_work(struct work_struct *work);    74     void * vmalloc_32(unsigned long);    82     void vfree(const void *);    10     void __const_udelay(unsigned long);  1050     void dev_err(const struct device *, const char *, ...);   415     long int schedule_timeout(long);  1475     void usb_fill_control_urb(struct urb *urb, struct usb_device *dev, unsigned int pipe, unsigned char *setup_packet, void *transfer_buffer, int buffer_length, void (*complete_fn)(struct urb *), void *context);  1576     struct urb * usb_alloc_urb(int, gfp_t );  1577     void usb_free_urb(struct urb *);  1580     int usb_submit_urb(struct urb *, gfp_t );  1582     void usb_kill_urb(struct urb *);  1626     void * usb_alloc_coherent(struct usb_device *, size_t , gfp_t , dma_addr_t *);  1628     void usb_free_coherent(struct usb_device *, size_t , void *, dma_addr_t );  1651     int usb_control_msg(struct usb_device *, unsigned int, __u8 , __u8 , __u16 , __u16 , void *, __u16 , int);  1671     int usb_set_interface(struct usb_device *, int, int);  1779     unsigned int __create_pipe(struct usb_device *dev, unsigned int endpoint);   223     void SetPageReserved(struct page *page);   223     void ClearPageReserved(struct page *page);   371     struct page * vmalloc_to_page(const void *);   190     void v4l2_get_timestamp(struct timeval *);   355     struct usbvision_device_data_st usbvision_device_data[67U];   482     int usbvision_i2c_unregister(struct usb_usbvision *usbvision);   485     int usbvision_read_reg(struct usb_usbvision *usbvision, unsigned char reg);   486     int usbvision_write_reg(struct usb_usbvision *usbvision, unsigned char reg, unsigned char value);   489     int usbvision_frames_alloc(struct usb_usbvision *usbvision, int number_of_frames);   490     void usbvision_frames_free(struct usb_usbvision *usbvision);   491     int usbvision_scratch_alloc(struct usb_usbvision *usbvision);   492     void usbvision_scratch_free(struct usb_usbvision *usbvision);   493     int usbvision_decompress_alloc(struct usb_usbvision *usbvision);   494     void usbvision_decompress_free(struct usb_usbvision *usbvision);   496     int usbvision_setup(struct usb_usbvision *usbvision, int format);   497     int usbvision_init_isoc(struct usb_usbvision *usbvision);   498     int usbvision_restart_isoc(struct usb_usbvision *usbvision);   499     void usbvision_stop_isoc(struct usb_usbvision *usbvision);   500     int usbvision_set_alternate(struct usb_usbvision *dev);   502     int usbvision_set_audio(struct usb_usbvision *usbvision, int audio_channel);   503     int usbvision_audio_off(struct usb_usbvision *usbvision);   505     int usbvision_begin_streaming(struct usb_usbvision *usbvision);   506     void usbvision_empty_framequeues(struct usb_usbvision *usbvision);   507     int usbvision_stream_interrupt(struct usb_usbvision *usbvision);   509     int usbvision_muxsel(struct usb_usbvision *usbvision, int channel);   510     int usbvision_set_input(struct usb_usbvision *usbvision);   511     int usbvision_set_output(struct usb_usbvision *usbvision, int width, int height);   513     void usbvision_init_power_off_timer(struct usb_usbvision *usbvision);   514     void usbvision_set_power_off_timer(struct usb_usbvision *usbvision);   515     void usbvision_reset_power_off_timer(struct usb_usbvision *usbvision);   516     int usbvision_power_off(struct usb_usbvision *usbvision);   517     int usbvision_power_on(struct usb_usbvision *usbvision);    48     unsigned int core_debug = 0U;    52     int adjust_compression = 1;    58     int switch_svideo_input = 0;    62     unsigned int adjust_x_offset = 4294967295U;    66     unsigned int adjust_y_offset = 4294967295U;   103     const int scratch_buf_size = 131072;   106     int usbvision_request_intra(struct usb_usbvision *usbvision);   107     int usbvision_unrequest_intra(struct usb_usbvision *usbvision);   108     int usbvision_adjust_compression(struct usb_usbvision *usbvision);   109     int usbvision_measure_bandwidth(struct usb_usbvision *usbvision);   120     void * usbvision_rvmalloc(unsigned long size);   141     void usbvision_rvfree(void *mem, unsigned long size);   182     int scratch_len(struct usb_usbvision *usbvision);   195     int scratch_free(struct usb_usbvision *usbvision);   211     int scratch_put(struct usb_usbvision *usbvision, unsigned char *data, int len);   236     void scratch_mark_header(struct usb_usbvision *usbvision);   247     int scratch_get_extra(struct usb_usbvision *usbvision, unsigned char *data, int *ptr, int len);   273     void scratch_set_extra_ptr(struct usb_usbvision *usbvision, int *ptr, int len);   283     void scratch_inc_extra_ptr(int *ptr, int len);   292     int scratch_get(struct usb_usbvision *usbvision, unsigned char *data, int len);   318     int scratch_get_header(struct usb_usbvision *usbvision, struct usbvision_frame_header *header);   347     void scratch_rm_old(struct usb_usbvision *usbvision, int len);   356     void scratch_reset(struct usb_usbvision *usbvision);   425     enum parse_state  usbvision_find_header(struct usb_usbvision *usbvision);   489     enum parse_state  usbvision_parse_lines_422(struct usb_usbvision *usbvision, long *pcopylen);   600     int usbvision_decompress(struct usb_usbvision *usbvision, unsigned char *compressed, unsigned char *decompressed, int *start_pos, int *block_typestart_pos, int len);   692     enum parse_state  usbvision_parse_compress(struct usb_usbvision *usbvision, long *pcopylen);   870     enum parse_state  usbvision_parse_lines_420(struct usb_usbvision *usbvision, long *pcopylen);  1138     void usbvision_parse_data(struct usb_usbvision *usbvision);  1199     int usbvision_compress_isochronous(struct usb_usbvision *usbvision, struct urb *urb);  1278     void usbvision_isoc_irq(struct urb *urb);  1417     void usbvision_ctrl_urb_complete(struct urb *urb);  1428     int usbvision_write_reg_irq(struct usb_usbvision *usbvision, int address, unsigned char *data, int len);  1464     int usbvision_init_compression(struct usb_usbvision *usbvision);  1583     int usbvision_init_webcam(struct usb_usbvision *usbvision);  1635     int usbvision_set_video_format(struct usb_usbvision *usbvision, int format);  1871     int usbvision_set_compress_params(struct usb_usbvision *usbvision);  2063     int usbvision_set_dram_settings(struct usb_usbvision *usbvision);  2168     void call_usbvision_power_off(struct work_struct *work);  2185     void usbvision_power_off_timer(unsigned long data);     1     unsigned long int __builtin_object_size(void *, int);     1     long int __builtin_expect(long exp, long c);    33     extern struct module __this_module;   308     int constant_test_bit(long nr, const volatile unsigned long *addr);   235     void might_fault();   389     int sprintf(char *, const char *, ...);   392     int snprintf(char *, size_t , const char *, ...);   113     void list_del(struct list_head *);    65     char * strcpy(char *, const char *);    26     size_t  strlcpy(char *, const char *, size_t );   119     void __mutex_init(struct mutex *, const char *, struct lock_class_key *);   138     void mutex_lock_nested(struct mutex *, unsigned int);    86     const char * kobject_name(const struct kobject *kobj);   459     int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd);   512     int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd);   647     unsigned long int _copy_to_user(void *, const void *, unsigned int);   672     void __copy_to_user_overflow();   723     unsigned long int copy_to_user(void *to, const void *from, unsigned long n);   560     int device_create_file(struct device *, const struct device_attribute *);   562     void device_remove_file(struct device *, const struct device_attribute *);   809     const char * dev_name(const struct device *dev);   840     void * dev_get_drvdata(const struct device *dev);   845     void dev_set_drvdata(struct device *dev, void *data);   419     void schedule();   189     void * usb_get_intfdata(struct usb_interface *intf);   590     struct usb_device * interface_to_usbdev(struct usb_interface *intf);   595     struct usb_device * usb_get_dev(struct usb_device *);   598     struct usb_device * ldv_usb_get_dev_9(struct usb_device *ldv_func_arg1);   600     void usb_put_dev(struct usb_device *);   603     void ldv_usb_put_dev_10(struct usb_device *ldv_func_arg1);   786     int usb_make_path(struct usb_device *dev, char *buf, size_t size);  1143     int usb_register_driver(struct usb_driver *, struct module *, const char *);  1150     void usb_deregister(struct usb_driver *);    12     void ldv_usb_get_dev();    13     void ldv_usb_put_dev();   143     void kfree(const void *);   289     void * __kmalloc(size_t , gfp_t );   418     void * kmalloc(size_t size, gfp_t flags);   581     void * kzalloc(size_t size, gfp_t flags);  2086     int vm_insert_page(struct vm_area_struct *, unsigned long, struct page *);   150     int __video_register_device(struct video_device *, int, int, int, struct module *);   157     int video_register_device(struct video_device *vdev, int type, int nr);   173     void video_unregister_device(struct video_device *);   177     struct video_device * video_device_alloc();   180     void video_device_release(struct video_device *);   208     void * video_get_drvdata(struct video_device *vdev);   213     void video_set_drvdata(struct video_device *vdev, void *data);   218     struct video_device * video_devdata(struct file *);   222     void * video_drvdata(struct file *file);   227     const char * video_device_node_name(struct video_device *vdev);   232     int video_is_registered(struct video_device *vdev);   339     long int video_ioctl2(struct file *, unsigned int, unsigned long);    79     int v4l2_device_register(struct device *, struct v4l2_device *);   103     void v4l2_device_disconnect(struct v4l2_device *);   106     void v4l2_device_unregister(struct v4l2_device *);   356     struct usb_device_id usbvision_table[68U];   465     struct usb_usbvision * to_usbvision(struct v4l2_device *v4l2_dev);   481     int usbvision_i2c_register(struct usb_usbvision *usbvision);    69     const int usbvision_device_data_size;   105     int usbvision_nr = 0;   107     struct usbvision_v4l2_format_st usbvision_v4l2_format[8U] = { { 1, 1, 8, 1497715271, (char *)"GREY" }, { 1, 2, 16, 1346520914, (char *)"RGB565" }, { 1, 3, 24, 859981650, (char *)"RGB24" }, { 1, 4, 32, 876758866, (char *)"RGB32" }, { 1, 2, 16, 1329743698, (char *)"RGB555" }, { 1, 2, 16, 1448695129, (char *)"YUV422" }, { 1, 2, 12, 842094169, (char *)"YUV420P" }, { 1, 2, 16, 1345466932, (char *)"YUV422P" } };   119     void usbvision_release(struct usb_usbvision *usbvision);   123     int isoc_mode = 96;   125     int video_debug = 0;   127     int power_on_at_open = 1;   129     int video_nr = -1;   131     int radio_nr = -1;   174     ssize_t  show_version(struct device *cd, struct device_attribute *attr, char *buf);   179     struct device_attribute dev_attr_version = { { "version", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &show_version, (ssize_t  (*)(struct device *, struct device_attribute *, const char *, size_t ))0 };   181     ssize_t  show_model(struct device *cd, struct device_attribute *attr, char *buf);   190     struct device_attribute dev_attr_model = { { "model", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &show_model, (ssize_t  (*)(struct device *, struct device_attribute *, const char *, size_t ))0 };   192     ssize_t  show_hue(struct device *cd, struct device_attribute *attr, char *buf);   205     struct device_attribute dev_attr_hue = { { "hue", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &show_hue, (ssize_t  (*)(struct device *, struct device_attribute *, const char *, size_t ))0 };   207     ssize_t  show_contrast(struct device *cd, struct device_attribute *attr, char *buf);   220     struct device_attribute dev_attr_contrast = { { "contrast", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &show_contrast, (ssize_t  (*)(struct device *, struct device_attribute *, const char *, size_t ))0 };   222     ssize_t  show_brightness(struct device *cd, struct device_attribute *attr, char *buf);   235     struct device_attribute dev_attr_brightness = { { "brightness", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &show_brightness, (ssize_t  (*)(struct device *, struct device_attribute *, const char *, size_t ))0 };   237     ssize_t  show_saturation(struct device *cd, struct device_attribute *attr, char *buf);   250     struct device_attribute dev_attr_saturation = { { "saturation", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &show_saturation, (ssize_t  (*)(struct device *, struct device_attribute *, const char *, size_t ))0 };   252     ssize_t  show_streaming(struct device *cd, struct device_attribute *attr, char *buf);   261     struct device_attribute dev_attr_streaming = { { "streaming", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &show_streaming, (ssize_t  (*)(struct device *, struct device_attribute *, const char *, size_t ))0 };   263     ssize_t  show_compression(struct device *cd, struct device_attribute *attr, char *buf);   272     struct device_attribute dev_attr_compression = { { "compression", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &show_compression, (ssize_t  (*)(struct device *, struct device_attribute *, const char *, size_t ))0 };   274     ssize_t  show_device_bridge(struct device *cd, struct device_attribute *attr, char *buf);   282     struct device_attribute dev_attr_bridge = { { "bridge", 292U, (_Bool)0, 0, { { { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 } } } }, &show_device_bridge, (ssize_t  (*)(struct device *, struct device_attribute *, const char *, size_t ))0 };   284     void usbvision_create_sysfs(struct video_device *vdev);   323     void usbvision_remove_sysfs(struct video_device *vdev);   346     int usbvision_v4l2_open(struct file *file);   422     int usbvision_v4l2_close(struct file *file);   466     int vidioc_g_register(struct file *file, void *priv, struct v4l2_dbg_register *reg);   485     int vidioc_s_register(struct file *file, void *priv, const struct v4l2_dbg_register *reg);   503     int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *vc);   522     int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *vi);   574     int vidioc_g_input(struct file *file, void *priv, unsigned int *input);   582     int vidioc_s_input(struct file *file, void *priv, unsigned int input);   597     int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id);   610     int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id);   618     int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *vt);   637     int vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *vt);   651     int vidioc_g_frequency(struct file *file, void *priv, struct v4l2_frequency *freq);   666     int vidioc_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *freq);   681     int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a);   693     int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a);   701     int vidioc_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *ctrl);   714     int vidioc_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl);   723     int vidioc_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl);   732     int vidioc_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *vr);   760     int vidioc_querybuf(struct file *file, void *priv, struct v4l2_buffer *vb);   793     int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *vb);   825     int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *vb);   864     int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i);   874     int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type type);   892     int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *vfd);   902     int vidioc_g_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf);   918     int vidioc_try_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf);   945     int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf);   972     ssize_t  usbvision_read(struct file *file, char *buf, size_t count, loff_t *ppos);  1076     ssize_t  usbvision_v4l2_read(struct file *file, char *buf, size_t count, loff_t *ppos);  1089     int usbvision_mmap(struct file *file, struct vm_area_struct *vma);  1135     int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma);  1151     int usbvision_radio_open(struct file *file);  1202     int usbvision_radio_close(struct file *file);  1238     const struct v4l2_file_operations usbvision_fops = { &__this_module, &usbvision_v4l2_read, 0, 0, 0, &video_ioctl2, 0, 0, &usbvision_v4l2_mmap, &usbvision_v4l2_open, &usbvision_v4l2_close };  1248     const struct v4l2_ioctl_ops usbvision_ioctl_ops = { &vidioc_querycap, 0, 0, &vidioc_enum_fmt_vid_cap, 0, 0, 0, 0, 0, &vidioc_g_fmt_vid_cap, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &vidioc_s_fmt_vid_cap, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &vidioc_try_fmt_vid_cap, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &vidioc_reqbufs, &vidioc_querybuf, &vidioc_qbuf, 0, &vidioc_dqbuf, 0, 0, 0, 0, 0, &vidioc_streamon, &vidioc_streamoff, &vidioc_g_std, &vidioc_s_std, 0, &vidioc_enum_input, &vidioc_g_input, &vidioc_s_input, 0, 0, 0, &vidioc_queryctrl, 0, &vidioc_g_ctrl, &vidioc_s_ctrl, 0, 0, 0, 0, 0, &vidioc_g_audio, &vidioc_s_audio, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &vidioc_g_tuner, &vidioc_s_tuner, &vidioc_g_frequency, &vidioc_s_frequency, 0, 0, 0, 0, &vidioc_g_register, &vidioc_s_register, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  1280     struct video_device usbvision_video_template = { { { 0, 0 }, 0, 0U, 0, 0U, 0U, 0UL, 0U, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, 0, 0, 0, 0, 0, 0, { .alsa = { 0U, 0U, 0U } } }, &usbvision_fops, { 0, 0, { 0, { 0, 0 }, 0, 0, 0, 0, { { 0 } }, { { { 0L }, { 0, 0 }, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, { { 0, 0 }, 0UL, 0, 0, 0UL, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, { 0, 0 }, 0, 0, 0UL } }, 0, 0 }, 0U, 0U, 0U, 0U, 0U }, 0, 0, { { 0 }, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, 0, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, 0, 0, 0, 0, { { 0 }, 0U, 0U, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, { 0U, { { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } } }, 0, (_Bool)0, (_Bool)0, { { 0, 0 }, 0UL, 0, 0, 0UL, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, { 0, 0 }, 0, 0, 0UL } }, 0UL, { { 0L }, { 0, 0 }, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, { { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } }, { 0 }, { 0 }, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0, 0, 0, 0, 0UL, 0UL, 0UL, 0UL, 0, 0, 0 }, 0, 0, 0, 0, 0ULL, 0UL, 0, { 0, 0 }, 0, 0, { 0, 0 }, 0, { 0 }, 0U, 0U, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, { 0, { 0, 0 }, { { 0 } } }, 0, 0, 0, 0, (_Bool)0, (_Bool)0 }, 0, 0, 0, 0, 0, 0, { 'u', 's', 'b', 'v', 'i', 's', 'i', 'o', 'n', '-', 'v', 'i', 'd', 'e', 'o', '\x0' }, 0, 0, 0, (unsigned short)0, 0UL, 0, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, 0, 16757247ULL, &video_device_release, &usbvision_ioctl_ops, { 0UL, 0UL, 0UL }, { 0UL, 0UL, 0UL }, 0 };  1290     const struct v4l2_file_operations usbvision_radio_fops = { &__this_module, 0, 0, 0, 0, &video_ioctl2, 0, 0, 0, &usbvision_radio_open, &usbvision_radio_close };  1297     const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = { &vidioc_querycap, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &vidioc_enum_input, &vidioc_g_input, &vidioc_s_input, 0, 0, 0, &vidioc_queryctrl, 0, &vidioc_g_ctrl, &vidioc_s_ctrl, 0, 0, 0, 0, 0, &vidioc_g_audio, &vidioc_s_audio, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, &vidioc_g_tuner, &vidioc_s_tuner, &vidioc_g_frequency, &vidioc_s_frequency, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };  1313     struct video_device usbvision_radio_template = { { { 0, 0 }, 0, 0U, 0, 0U, 0U, 0UL, 0U, (unsigned short)0, (unsigned short)0, (unsigned short)0, (unsigned short)0, 0, 0, 0, 0, 0, 0, { .alsa = { 0U, 0U, 0U } } }, &usbvision_radio_fops, { 0, 0, { 0, { 0, 0 }, 0, 0, 0, 0, { { 0 } }, { { { 0L }, { 0, 0 }, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, { { 0, 0 }, 0UL, 0, 0, 0UL, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, { 0, 0 }, 0, 0, 0UL } }, 0, 0 }, 0U, 0U, 0U, 0U, 0U }, 0, 0, { { 0 }, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, 0, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, 0, 0, 0, 0, { { 0 }, 0U, 0U, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, { 0U, { { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } } }, 0, (_Bool)0, (_Bool)0, { { 0, 0 }, 0UL, 0, 0, 0UL, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, { 0, 0 }, 0, 0, 0UL } }, 0UL, { { 0L }, { 0, 0 }, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, { { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } }, { 0 }, { 0 }, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0, 0, 0, 0, 0UL, 0UL, 0UL, 0UL, 0, 0, 0 }, 0, 0, 0, 0, 0ULL, 0UL, 0, { 0, 0 }, 0, 0, { 0, 0 }, 0, { 0 }, 0U, 0U, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, { 0, { 0, 0 }, { { 0 } } }, 0, 0, 0, 0, (_Bool)0, (_Bool)0 }, 0, 0, 0, 0, 0, 0, { 'u', 's', 'b', 'v', 'i', 's', 'i', 'o', 'n', '-', 'r', 'a', 'd', 'i', 'o', '\x0' }, 0, 0, 0, (unsigned short)0, 0UL, 0, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, 0, 0ULL, &video_device_release, &usbvision_radio_ioctl_ops, { 0UL, 0UL, 0UL }, { 0UL, 0UL, 0UL }, 0 };  1321     struct video_device * usbvision_vdev_init(struct usb_usbvision *usbvision, struct video_device *vdev_template, char *name);  1346     void usbvision_unregister_video(struct usb_usbvision *usbvision);  1372     int usbvision_register_video(struct usb_usbvision *usbvision);  1418     struct usb_usbvision * usbvision_alloc(struct usb_device *dev, struct usb_interface *intf);  1480     void usbvision_configure_video(struct usb_usbvision *usbvision);  1520     int usbvision_probe(struct usb_interface *intf, const struct usb_device_id *devid);  1630     void usbvision_disconnect(struct usb_interface *intf);  1671     struct usb_driver usbvision_driver = { "usbvision", &usbvision_probe, &usbvision_disconnect, 0, 0, 0, 0, 0, 0, (const struct usb_device_id *)(&usbvision_table), { { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } }, { { 0, 0, 0, 0, (_Bool)0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0 }, 0U, 0U, 0U, 0U };  1684     int usbvision_init();  1710     void usbvision_exit();  1737     void ldv_check_final_state();  1740     void ldv_check_return_value(int);  1743     void ldv_check_return_value_probe(int retval);  1746     void ldv_initialize();  1749     void ldv_handler_precall();  1752     int nondet_int();  1755     int LDV_IN_INTERRUPT = 0;  1758     void ldv_main1_sequence_infinite_withcheck_stateful();   480     void * i2c_get_adapdata(const struct i2c_adapter *dev);   485     void i2c_set_adapdata(struct i2c_adapter *dev, void *data);   536     int i2c_add_adapter(struct i2c_adapter *);   537     void i2c_del_adapter(struct i2c_adapter *);   102     struct v4l2_subdev * v4l2_i2c_new_subdev(struct v4l2_device *, struct i2c_adapter *, const char *, u8 , const unsigned short *);   116     unsigned short int v4l2_i2c_subdev_addr(struct v4l2_subdev *);   129     const unsigned short * v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type );    41     int i2c_debug = 0;    52     int usbvision_i2c_write(struct usb_usbvision *usbvision, unsigned char addr, char *buf, short len);    54     int usbvision_i2c_read(struct usb_usbvision *usbvision, unsigned char addr, char *buf, short len);    57     int try_write_address(struct i2c_adapter *i2c_adap, unsigned char addr, int retries);    82     int try_read_address(struct i2c_adapter *i2c_adap, unsigned char addr, int retries);   106     int usb_find_address(struct i2c_adapter *i2c_adap, struct i2c_msg *msg, int retries, unsigned char *add);   132     int usbvision_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, int num);   164     u32  functionality(struct i2c_adapter *adap);   171     struct i2c_algorithm usbvision_algo = { &usbvision_i2c_xfer, (int (*)(struct i2c_adapter *, u16 , unsigned short, char, u8 , int, union i2c_smbus_data *))0, &functionality, 0, 0 };   181     struct i2c_adapter i2c_adap_template;   277     int usbvision_i2c_read_max4(struct usb_usbvision *usbvision, unsigned char addr, char *buf, short len);   341     int usbvision_i2c_write_max4(struct usb_usbvision *usbvision, unsigned char addr, const char *buf, short len);   445     struct i2c_adapter i2c_adap_template = { &__this_module, 0U, 0, 0, { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, { 0 }, 0, 0, 0, 0, 0, 0, 0 }, 0, 0, { 0, 0, { 0, { 0, 0 }, 0, 0, 0, 0, { { 0 } }, { { { 0L }, { 0, 0 }, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, { { 0, 0 }, 0UL, 0, 0, 0UL, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, { 0, 0 }, 0, 0, 0UL } }, 0, 0 }, 0U, 0U, 0U, 0U, 0U }, 0, 0, { { 0 }, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, 0, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, 0, 0, 0, 0, { { 0 }, 0U, 0U, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, (_Bool)0, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, { 0U, { { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } } }, 0, (_Bool)0, (_Bool)0, { { 0, 0 }, 0UL, 0, 0, 0UL, 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, { 0, 0 }, 0, 0, 0UL } }, 0UL, { { 0L }, { 0, 0 }, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, { { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } }, { 0 }, { 0 }, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0, 0, 0, 0, 0UL, 0UL, 0UL, 0UL, 0, 0, 0 }, 0, 0, 0, 0, 0ULL, 0UL, 0, { 0, 0 }, 0, 0, { 0, 0 }, 0, { 0 }, 0U, 0U, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, { 0, { 0, 0 }, { { 0 } } }, 0, 0, 0, 0, (_Bool)0, (_Bool)0 }, 0, { 'u', 's', 'b', 'v', 'i', 's', 'i', 'o', 'n', '\x0' }, { 0U, { { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } } }, { { 0 }, { { { { { 0U } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 }, 0, 0, { 0, { 0, 0 }, 0, 0, 0UL } }, { 0, 0 }, 0 };   487     void ldv_main2_sequence_infinite_withcheck_stateful();    34     struct usbvision_device_data_st usbvision_device_data[67U] = { { 45056ULL, "Xanboo", -1, 7113U, 4U, 1U, 0U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, -1, -1 }, { 255ULL, "Belkin USB VideoBus II Adapter", -1, 7113U, 2U, 1U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 0, 3 }, { 45056ULL, "Belkin Components USB VideoBus", -1, 7111U, 2U, 1U, 0U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, -1, -1 }, { 45056ULL, "Belkin USB VideoBus II", -1, 7113U, 2U, 1U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 0, 3 }, { 255ULL, "echoFX InterView Lite", 0, 7111U, 2U, 0U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, -1, -1 }, { 45056ULL, "USBGear USBG-V1 resp. HAMA USB", -1, 7111U, 2U, 1U, 0U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, -1, -1 }, { 45056ULL, "D-Link V100", -1, 7113U, 4U, 0U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 0, 3 }, { 45056ULL, "X10 USB Camera", -1, 7111U, 2U, 1U, 0U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, -1, -1 }, { 255ULL, "Hauppauge WinTV USB Live (PAL B/G)", -1, 7111U, 2U, 1U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, -1, 3 }, { 45056ULL, "Hauppauge WinTV USB Live Pro (NTSC M/N)", -1, 7113U, 2U, 0U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 0, 3 }, { 255ULL, "Zoran Co. PMD (Nogatech) AV-grabber Manhattan", -1, 7113U, 2U, 2U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 0, 3 }, { 45056ULL, "Nogatech USB-TV (NTSC) FM", -1, 7111U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 17U, -1, 20 }, { 45056ULL, "PNY USB-TV (NTSC) FM", -1, 7111U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 17U, -1, 20 }, { 255ULL, "PixelView PlayTv-USB PRO (PAL) FM", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 5U, 0, 3 }, { 255ULL, "ZTV ZT-721 2.4GHz USB A/V Receiver", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 5U, 0, 3 }, { 45056ULL, "Hauppauge WinTV USB (NTSC M/N)", -1, 7111U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 17U, -1, 20 }, { 255ULL, "Hauppauge WinTV USB (PAL B/G)", -1, 7111U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, -1, -1 }, { 255ULL, "Hauppauge WinTV USB (PAL I)", -1, 7111U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, -1, -1 }, { 16711680ULL, "Hauppauge WinTV USB (PAL/SECAM L)", -1, 7111U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 3U, 128, 22 }, { 255ULL, "Hauppauge WinTV USB (PAL D/K)", -1, 7111U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, -1, -1 }, { 45056ULL, "Hauppauge WinTV USB (NTSC FM)", -1, 7111U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 17U, -1, -1 }, { 255ULL, "Hauppauge WinTV USB (PAL B/G FM)", -1, 7111U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, -1, -1 }, { 255ULL, "Hauppauge WinTV USB (PAL I FM)", -1, 7111U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, -1, -1 }, { 255ULL, "Hauppauge WinTV USB (PAL D/K FM)", -1, 7111U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, -1, -1 }, { 45056ULL, "Hauppauge WinTV USB Pro (NTSC M/N)", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 45U, 0, 3 }, { 45056ULL, "Hauppauge WinTV USB Pro (NTSC M/N) V2", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 45U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L)", 0, 7113U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 38U, 0, 3 }, { 45056ULL, "Hauppauge WinTV USB Pro (NTSC M/N) V3", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 17U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (PAL B/G)", 0, 7113U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 5U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (PAL I)", 0, 7113U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 5U, 0, 3 }, { 16711680ULL, "Hauppauge WinTV USB Pro (PAL/SECAM L)", -1, 7113U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 3U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (PAL D/K)", -1, 7113U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 5U, 0, 3 }, { 16711680ULL, "Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L)", -1, 7113U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 3U, 0, 3 }, { 16711680ULL, "Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L) V2", -1, 7113U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 3U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (PAL B/G) V2", -1, 7113U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 10U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (PAL B/G,D/K)", -1, 7113U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 10U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (PAL I,D/K)", -1, 7113U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 37U, 0, 3 }, { 45056ULL, "Hauppauge WinTV USB Pro (NTSC M/N FM)", -1, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 17U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (PAL B/G FM)", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 5U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (PAL I FM)", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 5U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (PAL D/K FM)", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 5U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (Temic PAL/SECAM B/G/I/D/K/L FM)", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 45U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (Temic PAL B/G FM)", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 45U, 0, 3 }, { 255ULL, "Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L FM)", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 38U, 0, 3 }, { 45056ULL, "Hauppauge WinTV USB Pro (NTSC M/N FM) V2", 0, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 17U, 0, 3 }, { 45056ULL, "Camtel Technology USB TV Genie Pro FM Model TVB330", -1, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 17U, 5, 5 }, { 255ULL, "Digital Video Creator I", -1, 7113U, 2U, 0U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 0, 3 }, { 45056ULL, "Global Village GV-007 (NTSC)", -1, 7111U, 2U, 0U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 82, 20 }, { 45056ULL, "Dazzle Fusion Model DVC-50 Rev 1 (NTSC)", 0, 7113U, 2U, 0U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 0, 3 }, { 255ULL, "Dazzle Fusion Model DVC-80 Rev 1 (PAL)", 0, 7113U, 2U, 0U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 0, 3 }, { 16711680ULL, "Dazzle Fusion Model DVC-90 Rev 1 (SECAM)", 0, 7113U, 2U, 0U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 0, 3 }, { 255ULL, "Eskape Labs MyTV2Go", 0, 7113U, 2U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 38U, 0, 3 }, { 255ULL, "Pinnacle Studio PCTV USB (PAL)", -1, 7111U, 3U, 1U, 0U, 0U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 18U, -1, -1 }, { 16711680ULL, "Pinnacle Studio PCTV USB (SECAM)", -1, 7111U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 3U, -1, -1 }, { 255ULL, "Pinnacle Studio PCTV USB (PAL) FM", -1, 7111U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, 128, 23 }, { 255ULL, "Miro PCTV USB", -1, 7111U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 5U, -1, -1 }, { 45056ULL, "Pinnacle Studio PCTV USB (NTSC) FM", -1, 7111U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 17U, -1, -1 }, { 255ULL, "Pinnacle Studio PCTV USB (PAL) FM V2", -1, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 20U, 0, 3 }, { 45056ULL, "Pinnacle Studio PCTV USB (NTSC) FM V2", -1, 7111U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 21U, 0, 3 }, { 255ULL, "Pinnacle Studio PCTV USB (PAL) FM V3", -1, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 20U, 0, 3 }, { 45056ULL, "Pinnacle Studio Linx Video input cable (NTSC)", -1, 7113U, 2U, 1U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 0, 3 }, { 255ULL, "Pinnacle Studio Linx Video input cable (PAL)", -1, 7113U, 2U, 1U, 0U, 1U, 0U, 0U, 0U, 1U, 0U, 0U, 7U, 0U, 0, 3 }, { 255ULL, "Pinnacle PCTV Bungee USB (PAL) FM", -1, 7113U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 1U, 0U, 0U, 7U, 20U, 0, 3 }, { 45056ULL, "Hauppauge WinTv-USB", -1, 7111U, 3U, 1U, 0U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 17U, -1, -1 }, { 45056ULL, "Pinnacle Studio PCTV USB (NTSC) FM V3", -1, 7111U, 3U, 1U, 1U, 1U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 17U, -1, -1 }, { 45056ULL, "Nogatech USB MicroCam NTSC (NV3000N)", -1, 3000U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 71, 15 }, { 255ULL, "Nogatech USB MicroCam PAL (NV3001P)", -1, 3000U, 1U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 71, 18 } };  1058     const int usbvision_device_data_size = 67;  1062     struct usb_device_id usbvision_table[68U] = { { 3U, 2671U, 1024U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 0UL }, { 3U, 1293U, 262U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 1UL }, { 3U, 1293U, 519U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 2UL }, { 3U, 1293U, 520U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 3UL }, { 3U, 1393U, 2U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 4UL }, { 3U, 1395U, 3U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 5UL }, { 3U, 1395U, 1024U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 6UL }, { 3U, 1395U, 8192U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 7UL }, { 3U, 1395U, 11520U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 8UL }, { 3U, 1395U, 11521U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 9UL }, { 3U, 1395U, 8449U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 10UL }, { 3U, 1395U, 12288U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 65UL }, { 3U, 1395U, 12289U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 66UL }, { 3U, 1395U, 16640U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 11UL }, { 3U, 1395U, 16656U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 12UL }, { 3U, 1395U, 17488U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 13UL }, { 3U, 1395U, 17744U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 14UL }, { 3U, 1395U, 19712U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 15UL }, { 3U, 1395U, 19713U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 16UL }, { 3U, 1395U, 19714U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 17UL }, { 3U, 1395U, 19715U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 18UL }, { 3U, 1395U, 19716U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 19UL }, { 3U, 1395U, 19728U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 20UL }, { 3U, 1395U, 19729U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 21UL }, { 3U, 1395U, 19730U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 22UL }, { 3U, 1395U, 19732U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 23UL }, { 3U, 1395U, 19754U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 24UL }, { 3U, 1395U, 19755U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 25UL }, { 3U, 1395U, 19756U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 26UL }, { 3U, 1395U, 19744U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 27UL }, { 3U, 1395U, 19745U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 28UL }, { 3U, 1395U, 19746U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 29UL }, { 3U, 1395U, 19747U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 30UL }, { 3U, 1395U, 19748U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 31UL }, { 3U, 1395U, 19749U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 32UL }, { 3U, 1395U, 19750U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 33UL }, { 3U, 1395U, 19751U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 34UL }, { 3U, 1395U, 19752U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 35UL }, { 3U, 1395U, 19753U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 36UL }, { 3U, 1395U, 19760U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 37UL }, { 3U, 1395U, 19761U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 38UL }, { 3U, 1395U, 19762U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 39UL }, { 3U, 1395U, 19764U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 40UL }, { 3U, 1395U, 19765U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 41UL }, { 3U, 1395U, 19766U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 42UL }, { 3U, 1395U, 19767U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 43UL }, { 3U, 1395U, 19768U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 44UL }, { 3U, 1896U, 6U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 45UL }, { 3U, 2000U, 1U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 46UL }, { 3U, 2000U, 2U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 47UL }, { 3U, 2000U, 3U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 48UL }, { 3U, 2000U, 4U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 49UL }, { 3U, 2000U, 5U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 50UL }, { 3U, 2040U, 37124U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 51UL }, { 3U, 8964U, 269U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 52UL }, { 3U, 8964U, 265U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 53UL }, { 3U, 8964U, 272U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 54UL }, { 3U, 8964U, 273U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 55UL }, { 3U, 8964U, 274U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 56UL }, { 3U, 8964U, 275U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 64UL }, { 3U, 8964U, 528U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 57UL }, { 3U, 8964U, 530U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 58UL }, { 3U, 8964U, 532U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 59UL }, { 3U, 8964U, 768U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 60UL }, { 3U, 8964U, 769U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 61UL }, { 3U, 8964U, 1049U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 62UL }, { 3U, 9216U, 16896U, (unsigned short)0, (unsigned short)0, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 63UL } };  1133     const struct usb_device_id __mod_usb__usbvision_table_device_table[68U] = {  };    10     void ldv_error();    60     void __builtin_trap();     7     bool  ldv_is_err(const void *ptr);    14     void * ldv_err_ptr(long error);    21     long int ldv_ptr_err(const void *ptr);    28     bool  ldv_is_err_or_null(const void *ptr);    13     int ldv_usb_dev_state = 0;           return ;         }        {      1760     struct file *var_group1;  1761     int res_usbvision_v4l2_open_12;  1762     char *var_usbvision_v4l2_read_42_p1;  1763     unsigned long var_usbvision_v4l2_read_42_p2;  1764     loff_t *var_usbvision_v4l2_read_42_p3;  1765     struct vm_area_struct *var_group2;  1766     void *var_vidioc_querycap_16_p1;  1767     struct v4l2_capability *var_vidioc_querycap_16_p2;  1768     void *var_vidioc_enum_fmt_vid_cap_37_p1;  1769     struct v4l2_fmtdesc *var_vidioc_enum_fmt_vid_cap_37_p2;  1770     void *var_vidioc_g_fmt_vid_cap_38_p1;  1771     struct v4l2_format *var_vidioc_g_fmt_vid_cap_38_p2;  1772     void *var_vidioc_try_fmt_vid_cap_39_p1;  1773     struct v4l2_format *var_vidioc_try_fmt_vid_cap_39_p2;  1774     void *var_vidioc_s_fmt_vid_cap_40_p1;  1775     struct v4l2_format *var_vidioc_s_fmt_vid_cap_40_p2;  1776     void *var_vidioc_reqbufs_31_p1;  1777     struct v4l2_requestbuffers *var_vidioc_reqbufs_31_p2;  1778     void *var_vidioc_querybuf_32_p1;  1779     struct v4l2_buffer *var_vidioc_querybuf_32_p2;  1780     void *var_vidioc_qbuf_33_p1;  1781     struct v4l2_buffer *var_vidioc_qbuf_33_p2;  1782     void *var_vidioc_dqbuf_34_p1;  1783     struct v4l2_buffer *var_vidioc_dqbuf_34_p2;  1784     void *var_vidioc_s_std_20_p1;  1785     unsigned long long var_vidioc_s_std_20_p2;  1786     void *var_vidioc_g_std_21_p1;  1787     v4l2_std_id *var_vidioc_g_std_21_p2;  1788     void *var_vidioc_enum_input_17_p1;  1789     struct v4l2_input *var_vidioc_enum_input_17_p2;  1790     void *var_vidioc_g_input_18_p1;  1791     unsigned int *var_vidioc_g_input_18_p2;  1792     void *var_vidioc_s_input_19_p1;  1793     unsigned int var_vidioc_s_input_19_p2;  1794     void *var_vidioc_queryctrl_28_p1;  1795     struct v4l2_queryctrl *var_vidioc_queryctrl_28_p2;  1796     void *var_vidioc_g_audio_26_p1;  1797     struct v4l2_audio *var_vidioc_g_audio_26_p2;  1798     void *var_vidioc_s_audio_27_p1;  1799     const struct v4l2_audio *var_vidioc_s_audio_27_p2;  1800     void *var_vidioc_g_ctrl_29_p1;  1801     struct v4l2_control *var_vidioc_g_ctrl_29_p2;  1802     void *var_vidioc_s_ctrl_30_p1;  1803     struct v4l2_control *var_vidioc_s_ctrl_30_p2;  1804     void *var_vidioc_streamon_35_p1;  1805     enum v4l2_buf_type var_vidioc_streamon_35_p2;  1806     void *var_vidioc_streamoff_36_p1;  1807     enum v4l2_buf_type var_vidioc_streamoff_36_p2;  1808     void *var_vidioc_g_tuner_22_p1;  1809     struct v4l2_tuner *var_vidioc_g_tuner_22_p2;  1810     void *var_vidioc_s_tuner_23_p1;  1811     const struct v4l2_tuner *var_vidioc_s_tuner_23_p2;  1812     void *var_vidioc_g_frequency_24_p1;  1813     struct v4l2_frequency *var_vidioc_g_frequency_24_p2;  1814     void *var_vidioc_s_frequency_25_p1;  1815     const struct v4l2_frequency *var_vidioc_s_frequency_25_p2;  1816     void *var_vidioc_g_register_14_p1;  1817     struct v4l2_dbg_register *var_vidioc_g_register_14_p2;  1818     void *var_vidioc_s_register_15_p1;  1819     const struct v4l2_dbg_register *var_vidioc_s_register_15_p2;  1820     int res_usbvision_radio_open_45;  1821     struct usb_interface *var_group3;  1822     const struct usb_device_id *var_usbvision_probe_53_p1;  1823     int res_usbvision_probe_53;  1824     int ldv_s_usbvision_fops_v4l2_file_operations;  1825     int ldv_s_usbvision_radio_fops_v4l2_file_operations;  1826     int ldv_s_usbvision_driver_usb_driver;  1827     int tmp;  1828     int tmp___0;  1829     int tmp___1;  3535     ldv_s_usbvision_fops_v4l2_file_operations = 0;  3540     ldv_s_usbvision_radio_fops_v4l2_file_operations = 0;  3544     ldv_s_usbvision_driver_usb_driver = 0;  3488     LDV_IN_INTERRUPT = 1;  3497     ldv_initialize() { /* Function call is skipped due to function is undefined */}  3532     ldv_handler_precall() { /* Function call is skipped due to function is undefined */}           {  1686       int err_code;  1692       printk("\016usbvision:[%s:%d] MMAP    debugging is enabled [video]", "usbvision_init", 1692) { /* Function call is skipped due to function is undefined */}  1701       err_code = usb_register_driver(&usbvision_driver, &__this_module, "usbvision") { /* Function call is skipped due to function is undefined */}  1704       printk("\016USBVision USB Video Device Driver for Linux : 0.9.11\n") { /* Function call is skipped due to function is undefined */}           } 3547     goto ldv_35724;  3547     tmp___1 = nondet_int() { /* Function call is skipped due to function is undefined */}  3552     goto ldv_35723;  3548     ldv_35723:;  3553     tmp___0 = nondet_int() { /* Function call is skipped due to function is undefined */}  3553     switch (tmp___0)          {  1522       struct usb_device *dev;  1523       struct usb_device *tmp;  1524       struct usb_device *tmp___0;  1525       struct usb_interface *uif;  1526       unsigned char ifnum;  1527       const struct usb_host_interface *interface;  1528       struct usb_usbvision *usbvision;  1529       const struct usb_endpoint_descriptor *endpoint;  1530       int model;  1531       int i;  1532       int tmp___1;  1533       int tmp___2;  1534       void *tmp___3;  1535       unsigned short tmp___4;  1536       int tmp___5;             {    41         struct usb_device *ldv_func_res;    42         struct usb_device *tmp;    43         tmp = usb_get_dev(ldv_func_arg1) { /* Function call is skipped due to function is undefined */}    43         ldv_func_res = tmp;             } 1523       dev = tmp___0;  1525       ifnum = intf->altsetting->desc.bInterfaceNumber;  1527       usbvision = (struct usb_usbvision *)0;  1535       int __CPAchecker_TMP_0 = (int)(devid->driver_info);  1535       model = __CPAchecker_TMP_0;  1540       printk("\016%s: %s found\n", "usbvision_probe", (usbvision_device_data[model]).model_string) { /* Function call is skipped due to function is undefined */}  1544       const struct usb_host_interface *__CPAchecker_TMP_1 = (const struct usb_host_interface *)(((dev->actconfig->interface)[(usbvision_device_data[model]).interface])->altsetting);  1544       interface = __CPAchecker_TMP_1;  1547       endpoint = (const struct usb_endpoint_descriptor *)(&(((interface->endpoint) + 1UL)->desc));             {  1420         struct usb_usbvision *usbvision;  1421         void *tmp;  1422         int tmp___0;  1423         struct lock_class_key __key;  1424         struct lock_class_key __key___0;               {   583           void *tmp;                 {               }  420             void *tmp___2;   435             tmp___2 = __kmalloc(size, flags) { /* Function call is skipped due to function is undefined */}                 } 1423         usbvision = (struct usb_usbvision *)tmp;  1427         usbvision->dev = dev;  1428         tmp___0 = v4l2_device_register(&(intf->dev), &(usbvision->v4l2_dev)) { /* Function call is skipped due to function is undefined */}  1431         __mutex_init(&(usbvision->v4l2_lock), "&usbvision->v4l2_lock", &__key) { /* Function call is skipped due to function is undefined */}  1434         usbvision->ctrl_urb = usb_alloc_urb(32, 208U) { /* Function call is skipped due to function is undefined */}  1435         unsigned long __CPAchecker_TMP_0 = (unsigned long)(usbvision->ctrl_urb);  1437         __init_waitqueue_head(&(usbvision->ctrl_urb_wq), "&usbvision->ctrl_urb_wq", &__key___0) { /* Function call is skipped due to function is undefined */}               {             } 2197           struct lock_class_key __key;  2197           init_timer_key(&(usbvision->power_off_timer), 0U, "((&usbvision->power_off_timer))", &__key) { /* Function call is skipped due to function is undefined */}  2197           usbvision->power_off_timer.function = &usbvision_power_off_timer;  2197           usbvision->power_off_timer.data = (unsigned long)usbvision;               } 1570       usbvision->bridge_type = 1005;  1576       uif = (dev->actconfig->interface)[0];  1578       int __CPAchecker_TMP_4 = (int)(uif->num_altsetting);  1578       usbvision->num_alt = __CPAchecker_TMP_4;             {   420         void *tmp___2;   435         tmp___2 = __kmalloc(size, flags) { /* Function call is skipped due to function is undefined */}             } 1580       usbvision->alt_max_pkt_size = (unsigned int *)tmp___3;  1581       unsigned long __CPAchecker_TMP_5 = (unsigned long)(usbvision->alt_max_pkt_size);  1582       dev_err((const struct device *)(&(intf->dev)), "usbvision: out of memory!\n") { /* Function call is skipped due to function is undefined */}             {           } 1463         usbvision->initialized = 0;               { }               {  1348           const char *tmp;  1349           int tmp___0;  1350           const char *tmp___1;  1351           int tmp___2;  1349           unsigned long __CPAchecker_TMP_0 = (unsigned long)(usbvision->rdev);  1360           unsigned long __CPAchecker_TMP_1 = (unsigned long)(usbvision->vdev);               } 1467         const void *__CPAchecker_TMP_0 = (const void *)(usbvision->alt_max_pkt_size);  1467         kfree(__CPAchecker_TMP_0) { /* Function call is skipped due to function is undefined */}  1469         usb_free_urb(usbvision->ctrl_urb) { /* Function call is skipped due to function is undefined */}  1471         v4l2_device_unregister(&(usbvision->v4l2_dev)) { /* Function call is skipped due to function is undefined */}  1472         kfree((const void *)usbvision) { /* Function call is skipped due to function is undefined */}             } 5807     ldv_check_return_value(res_usbvision_probe_53) { /* Function call is skipped due to function is undefined */}         } |              Source code         
     1 /*
    2  * usbvision-core.c - driver for NT100x USB video capture devices
    3  *
    4  *
    5  * Copyright (c) 1999-2005 Joerg Heckenbach <joerg@heckenbach-aw.de>
    6  *                         Dwaine Garden <dwainegarden@rogers.com>
    7  *
    8  * This module is part of usbvision driver project.
    9  * Updates to driver completed by Dwaine P. Garden
   10  *
   11  * This program is free software; you can redistribute it and/or modify
   12  * it under the terms of the GNU General Public License as published by
   13  * the Free Software Foundation; either version 2 of the License, or
   14  * (at your option) any later version.
   15  *
   16  * This program is distributed in the hope that it will be useful,
   17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   19  * GNU General Public License for more details.
   20  *
   21  * You should have received a copy of the GNU General Public License
   22  * along with this program; if not, write to the Free Software
   23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   24  */
   25 
   26 #include <linux/kernel.h>
   27 #include <linux/list.h>
   28 #include <linux/timer.h>
   29 #include <linux/gfp.h>
   30 #include <linux/mm.h>
   31 #include <linux/highmem.h>
   32 #include <linux/vmalloc.h>
   33 #include <linux/module.h>
   34 #include <linux/init.h>
   35 #include <linux/spinlock.h>
   36 #include <linux/io.h>
   37 #include <linux/videodev2.h>
   38 #include <linux/i2c.h>
   39 
   40 #include <media/saa7115.h>
   41 #include <media/v4l2-common.h>
   42 #include <media/tuner.h>
   43 
   44 #include <linux/workqueue.h>
   45 
   46 #include "usbvision.h"
   47 
   48 static unsigned int core_debug;
   49 module_param(core_debug, int, 0644);
   50 MODULE_PARM_DESC(core_debug, "enable debug messages [core]");
   51 
   52 static int adjust_compression = 1;	/* Set the compression to be adaptive */
   53 module_param(adjust_compression, int, 0444);
   54 MODULE_PARM_DESC(adjust_compression, " Set the ADPCM compression for the device.  Default: 1 (On)");
   55 
   56 /* To help people with Black and White output with using s-video input.
   57  * Some cables and input device are wired differently. */
   58 static int switch_svideo_input;
   59 module_param(switch_svideo_input, int, 0444);
   60 MODULE_PARM_DESC(switch_svideo_input, " Set the S-Video input.  Some cables and input device are wired differently. Default: 0 (Off)");
   61 
   62 static unsigned int adjust_x_offset = -1;
   63 module_param(adjust_x_offset, int, 0644);
   64 MODULE_PARM_DESC(adjust_x_offset, "adjust X offset display [core]");
   65 
   66 static unsigned int adjust_y_offset = -1;
   67 module_param(adjust_y_offset, int, 0644);
   68 MODULE_PARM_DESC(adjust_y_offset, "adjust Y offset display [core]");
   69 
   70 
   71 #define	ENABLE_HEXDUMP	0	/* Enable if you need it */
   72 
   73 
   74 #ifdef USBVISION_DEBUG
   75 	#define PDEBUG(level, fmt, args...) { \
   76 		if (core_debug & (level)) \
   77 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
   78 				__func__, __LINE__ , ## args); \
   79 	}
   80 #else
   81 	#define PDEBUG(level, fmt, args...) do {} while (0)
   82 #endif
   83 
   84 #define DBG_HEADER	(1 << 0)
   85 #define DBG_IRQ		(1 << 1)
   86 #define DBG_ISOC	(1 << 2)
   87 #define DBG_PARSE	(1 << 3)
   88 #define DBG_SCRATCH	(1 << 4)
   89 #define DBG_FUNC	(1 << 5)
   90 
   91 static const int max_imgwidth = MAX_FRAME_WIDTH;
   92 static const int max_imgheight = MAX_FRAME_HEIGHT;
   93 static const int min_imgwidth = MIN_FRAME_WIDTH;
   94 static const int min_imgheight = MIN_FRAME_HEIGHT;
   95 
   96 /* The value of 'scratch_buf_size' affects quality of the picture
   97  * in many ways. Shorter buffers may cause loss of data when client
   98  * is too slow. Larger buffers are memory-consuming and take longer
   99  * to work with. This setting can be adjusted, but the default value
  100  * should be OK for most desktop users.
  101  */
  102 #define DEFAULT_SCRATCH_BUF_SIZE	(0x20000)		/* 128kB memory scratch buffer */
  103 static const int scratch_buf_size = DEFAULT_SCRATCH_BUF_SIZE;
  104 
  105 /* Function prototypes */
  106 static int usbvision_request_intra(struct usb_usbvision *usbvision);
  107 static int usbvision_unrequest_intra(struct usb_usbvision *usbvision);
  108 static int usbvision_adjust_compression(struct usb_usbvision *usbvision);
  109 static int usbvision_measure_bandwidth(struct usb_usbvision *usbvision);
  110 
  111 /*******************************/
  112 /* Memory management functions */
  113 /*******************************/
  114 
  115 /*
  116  * Here we want the physical address of the memory.
  117  * This is used when initializing the contents of the area.
  118  */
  119 
  120 static void *usbvision_rvmalloc(unsigned long size)
  121 {
  122 	void *mem;
  123 	unsigned long adr;
  124 
  125 	size = PAGE_ALIGN(size);
  126 	mem = vmalloc_32(size);
  127 	if (!mem)
  128 		return NULL;
  129 
  130 	memset(mem, 0, size); /* Clear the ram out, no junk to the user */
  131 	adr = (unsigned long) mem;
  132 	while (size > 0) {
  133 		SetPageReserved(vmalloc_to_page((void *)adr));
  134 		adr += PAGE_SIZE;
  135 		size -= PAGE_SIZE;
  136 	}
  137 
  138 	return mem;
  139 }
  140 
  141 static void usbvision_rvfree(void *mem, unsigned long size)
  142 {
  143 	unsigned long adr;
  144 
  145 	if (!mem)
  146 		return;
  147 
  148 	size = PAGE_ALIGN(size);
  149 
  150 	adr = (unsigned long) mem;
  151 	while ((long) size > 0) {
  152 		ClearPageReserved(vmalloc_to_page((void *)adr));
  153 		adr += PAGE_SIZE;
  154 		size -= PAGE_SIZE;
  155 	}
  156 
  157 	vfree(mem);
  158 }
  159 
  160 
  161 #if ENABLE_HEXDUMP
  162 static void usbvision_hexdump(const unsigned char *data, int len)
  163 {
  164 	char tmp[80];
  165 	int i, k;
  166 
  167 	for (i = k = 0; len > 0; i++, len--) {
  168 		if (i > 0 && (i % 16 == 0)) {
  169 			printk("%s\n", tmp);
  170 			k = 0;
  171 		}
  172 		k += sprintf(&tmp[k], "%02x ", data[i]);
  173 	}
  174 	if (k > 0)
  175 		printk(KERN_CONT "%s\n", tmp);
  176 }
  177 #endif
  178 
  179 /********************************
  180  * scratch ring buffer handling
  181  ********************************/
  182 static int scratch_len(struct usb_usbvision *usbvision)    /* This returns the amount of data actually in the buffer */
  183 {
  184 	int len = usbvision->scratch_write_ptr - usbvision->scratch_read_ptr;
  185 
  186 	if (len < 0)
  187 		len += scratch_buf_size;
  188 	PDEBUG(DBG_SCRATCH, "scratch_len() = %d\n", len);
  189 
  190 	return len;
  191 }
  192 
  193 
  194 /* This returns the free space left in the buffer */
  195 static int scratch_free(struct usb_usbvision *usbvision)
  196 {
  197 	int free = usbvision->scratch_read_ptr - usbvision->scratch_write_ptr;
  198 	if (free <= 0)
  199 		free += scratch_buf_size;
  200 	if (free) {
  201 		free -= 1;							/* at least one byte in the buffer must */
  202 										/* left blank, otherwise there is no chance to differ between full and empty */
  203 	}
  204 	PDEBUG(DBG_SCRATCH, "return %d\n", free);
  205 
  206 	return free;
  207 }
  208 
  209 
  210 /* This puts data into the buffer */
  211 static int scratch_put(struct usb_usbvision *usbvision, unsigned char *data,
  212 		       int len)
  213 {
  214 	int len_part;
  215 
  216 	if (usbvision->scratch_write_ptr + len < scratch_buf_size) {
  217 		memcpy(usbvision->scratch + usbvision->scratch_write_ptr, data, len);
  218 		usbvision->scratch_write_ptr += len;
  219 	} else {
  220 		len_part = scratch_buf_size - usbvision->scratch_write_ptr;
  221 		memcpy(usbvision->scratch + usbvision->scratch_write_ptr, data, len_part);
  222 		if (len == len_part) {
  223 			usbvision->scratch_write_ptr = 0;			/* just set write_ptr to zero */
  224 		} else {
  225 			memcpy(usbvision->scratch, data + len_part, len - len_part);
  226 			usbvision->scratch_write_ptr = len - len_part;
  227 		}
  228 	}
  229 
  230 	PDEBUG(DBG_SCRATCH, "len=%d, new write_ptr=%d\n", len, usbvision->scratch_write_ptr);
  231 
  232 	return len;
  233 }
  234 
  235 /* This marks the write_ptr as position of new frame header */
  236 static void scratch_mark_header(struct usb_usbvision *usbvision)
  237 {
  238 	PDEBUG(DBG_SCRATCH, "header at write_ptr=%d\n", usbvision->scratch_headermarker_write_ptr);
  239 
  240 	usbvision->scratch_headermarker[usbvision->scratch_headermarker_write_ptr] =
  241 				usbvision->scratch_write_ptr;
  242 	usbvision->scratch_headermarker_write_ptr += 1;
  243 	usbvision->scratch_headermarker_write_ptr %= USBVISION_NUM_HEADERMARKER;
  244 }
  245 
  246 /* This gets data from the buffer at the given "ptr" position */
  247 static int scratch_get_extra(struct usb_usbvision *usbvision,
  248 			     unsigned char *data, int *ptr, int len)
  249 {
  250 	int len_part;
  251 
  252 	if (*ptr + len < scratch_buf_size) {
  253 		memcpy(data, usbvision->scratch + *ptr, len);
  254 		*ptr += len;
  255 	} else {
  256 		len_part = scratch_buf_size - *ptr;
  257 		memcpy(data, usbvision->scratch + *ptr, len_part);
  258 		if (len == len_part) {
  259 			*ptr = 0;							/* just set the y_ptr to zero */
  260 		} else {
  261 			memcpy(data + len_part, usbvision->scratch, len - len_part);
  262 			*ptr = len - len_part;
  263 		}
  264 	}
  265 
  266 	PDEBUG(DBG_SCRATCH, "len=%d, new ptr=%d\n", len, *ptr);
  267 
  268 	return len;
  269 }
  270 
  271 
  272 /* This sets the scratch extra read pointer */
  273 static void scratch_set_extra_ptr(struct usb_usbvision *usbvision, int *ptr,
  274 				  int len)
  275 {
  276 	*ptr = (usbvision->scratch_read_ptr + len) % scratch_buf_size;
  277 
  278 	PDEBUG(DBG_SCRATCH, "ptr=%d\n", *ptr);
  279 }
  280 
  281 
  282 /* This increments the scratch extra read pointer */
  283 static void scratch_inc_extra_ptr(int *ptr, int len)
  284 {
  285 	*ptr = (*ptr + len) % scratch_buf_size;
  286 
  287 	PDEBUG(DBG_SCRATCH, "ptr=%d\n", *ptr);
  288 }
  289 
  290 
  291 /* This gets data from the buffer */
  292 static int scratch_get(struct usb_usbvision *usbvision, unsigned char *data,
  293 		       int len)
  294 {
  295 	int len_part;
  296 
  297 	if (usbvision->scratch_read_ptr + len < scratch_buf_size) {
  298 		memcpy(data, usbvision->scratch + usbvision->scratch_read_ptr, len);
  299 		usbvision->scratch_read_ptr += len;
  300 	} else {
  301 		len_part = scratch_buf_size - usbvision->scratch_read_ptr;
  302 		memcpy(data, usbvision->scratch + usbvision->scratch_read_ptr, len_part);
  303 		if (len == len_part) {
  304 			usbvision->scratch_read_ptr = 0;				/* just set the read_ptr to zero */
  305 		} else {
  306 			memcpy(data + len_part, usbvision->scratch, len - len_part);
  307 			usbvision->scratch_read_ptr = len - len_part;
  308 		}
  309 	}
  310 
  311 	PDEBUG(DBG_SCRATCH, "len=%d, new read_ptr=%d\n", len, usbvision->scratch_read_ptr);
  312 
  313 	return len;
  314 }
  315 
  316 
  317 /* This sets read pointer to next header and returns it */
  318 static int scratch_get_header(struct usb_usbvision *usbvision,
  319 			      struct usbvision_frame_header *header)
  320 {
  321 	int err_code = 0;
  322 
  323 	PDEBUG(DBG_SCRATCH, "from read_ptr=%d", usbvision->scratch_headermarker_read_ptr);
  324 
  325 	while (usbvision->scratch_headermarker_write_ptr -
  326 		usbvision->scratch_headermarker_read_ptr != 0) {
  327 		usbvision->scratch_read_ptr =
  328 			usbvision->scratch_headermarker[usbvision->scratch_headermarker_read_ptr];
  329 		usbvision->scratch_headermarker_read_ptr += 1;
  330 		usbvision->scratch_headermarker_read_ptr %= USBVISION_NUM_HEADERMARKER;
  331 		scratch_get(usbvision, (unsigned char *)header, USBVISION_HEADER_LENGTH);
  332 		if ((header->magic_1 == USBVISION_MAGIC_1)
  333 			 && (header->magic_2 == USBVISION_MAGIC_2)
  334 			 && (header->header_length == USBVISION_HEADER_LENGTH)) {
  335 			err_code = USBVISION_HEADER_LENGTH;
  336 			header->frame_width  = header->frame_width_lo  + (header->frame_width_hi << 8);
  337 			header->frame_height = header->frame_height_lo + (header->frame_height_hi << 8);
  338 			break;
  339 		}
  340 	}
  341 
  342 	return err_code;
  343 }
  344 
  345 
  346 /* This removes len bytes of old data from the buffer */
  347 static void scratch_rm_old(struct usb_usbvision *usbvision, int len)
  348 {
  349 	usbvision->scratch_read_ptr += len;
  350 	usbvision->scratch_read_ptr %= scratch_buf_size;
  351 	PDEBUG(DBG_SCRATCH, "read_ptr is now %d\n", usbvision->scratch_read_ptr);
  352 }
  353 
  354 
  355 /* This resets the buffer - kills all data in it too */
  356 static void scratch_reset(struct usb_usbvision *usbvision)
  357 {
  358 	PDEBUG(DBG_SCRATCH, "\n");
  359 
  360 	usbvision->scratch_read_ptr = 0;
  361 	usbvision->scratch_write_ptr = 0;
  362 	usbvision->scratch_headermarker_read_ptr = 0;
  363 	usbvision->scratch_headermarker_write_ptr = 0;
  364 	usbvision->isocstate = isoc_state_no_frame;
  365 }
  366 
  367 int usbvision_scratch_alloc(struct usb_usbvision *usbvision)
  368 {
  369 	usbvision->scratch = vmalloc_32(scratch_buf_size);
  370 	scratch_reset(usbvision);
  371 	if (usbvision->scratch == NULL) {
  372 		dev_err(&usbvision->dev->dev,
  373 			"%s: unable to allocate %d bytes for scratch\n",
  374 				__func__, scratch_buf_size);
  375 		return -ENOMEM;
  376 	}
  377 	return 0;
  378 }
  379 
  380 void usbvision_scratch_free(struct usb_usbvision *usbvision)
  381 {
  382 	vfree(usbvision->scratch);
  383 	usbvision->scratch = NULL;
  384 }
  385 
  386 /*
  387  * usbvision_decompress_alloc()
  388  *
  389  * allocates intermediate buffer for decompression
  390  */
  391 int usbvision_decompress_alloc(struct usb_usbvision *usbvision)
  392 {
  393 	int IFB_size = MAX_FRAME_WIDTH * MAX_FRAME_HEIGHT * 3 / 2;
  394 
  395 	usbvision->intra_frame_buffer = vmalloc_32(IFB_size);
  396 	if (usbvision->intra_frame_buffer == NULL) {
  397 		dev_err(&usbvision->dev->dev,
  398 			"%s: unable to allocate %d for compr. frame buffer\n",
  399 				__func__, IFB_size);
  400 		return -ENOMEM;
  401 	}
  402 	return 0;
  403 }
  404 
  405 /*
  406  * usbvision_decompress_free()
  407  *
  408  * frees intermediate buffer for decompression
  409  */
  410 void usbvision_decompress_free(struct usb_usbvision *usbvision)
  411 {
  412 	vfree(usbvision->intra_frame_buffer);
  413 	usbvision->intra_frame_buffer = NULL;
  414 
  415 }
  416 
  417 /************************************************************
  418  * Here comes the data parsing stuff that is run as interrupt
  419  ************************************************************/
  420 /*
  421  * usbvision_find_header()
  422  *
  423  * Locate one of supported header markers in the scratch buffer.
  424  */
  425 static enum parse_state usbvision_find_header(struct usb_usbvision *usbvision)
  426 {
  427 	struct usbvision_frame *frame;
  428 	int found_header = 0;
  429 
  430 	frame = usbvision->cur_frame;
  431 
  432 	while (scratch_get_header(usbvision, &frame->isoc_header) == USBVISION_HEADER_LENGTH) {
  433 		/* found header in scratch */
  434 		PDEBUG(DBG_HEADER, "found header: 0x%02x%02x %d %d %d %d %#x 0x%02x %u %u",
  435 				frame->isoc_header.magic_2,
  436 				frame->isoc_header.magic_1,
  437 				frame->isoc_header.header_length,
  438 				frame->isoc_header.frame_num,
  439 				frame->isoc_header.frame_phase,
  440 				frame->isoc_header.frame_latency,
  441 				frame->isoc_header.data_format,
  442 				frame->isoc_header.format_param,
  443 				frame->isoc_header.frame_width,
  444 				frame->isoc_header.frame_height);
  445 
  446 		if (usbvision->request_intra) {
  447 			if (frame->isoc_header.format_param & 0x80) {
  448 				found_header = 1;
  449 				usbvision->last_isoc_frame_num = -1; /* do not check for lost frames this time */
  450 				usbvision_unrequest_intra(usbvision);
  451 				break;
  452 			}
  453 		} else {
  454 			found_header = 1;
  455 			break;
  456 		}
  457 	}
  458 
  459 	if (found_header) {
  460 		frame->frmwidth = frame->isoc_header.frame_width * usbvision->stretch_width;
  461 		frame->frmheight = frame->isoc_header.frame_height * usbvision->stretch_height;
  462 		frame->v4l2_linesize = (frame->frmwidth * frame->v4l2_format.depth) >> 3;
  463 	} else { /* no header found */
  464 		PDEBUG(DBG_HEADER, "skipping scratch data, no header");
  465 		scratch_reset(usbvision);
  466 		return parse_state_end_parse;
  467 	}
  468 
  469 	/* found header */
  470 	if (frame->isoc_header.data_format == ISOC_MODE_COMPRESS) {
  471 		/* check isoc_header.frame_num for lost frames */
  472 		if (usbvision->last_isoc_frame_num >= 0) {
  473 			if (((usbvision->last_isoc_frame_num + 1) % 32) != frame->isoc_header.frame_num) {
  474 				/* unexpected frame drop: need to request new intra frame */
  475 				PDEBUG(DBG_HEADER, "Lost frame before %d on USB", frame->isoc_header.frame_num);
  476 				usbvision_request_intra(usbvision);
  477 				return parse_state_next_frame;
  478 			}
  479 		}
  480 		usbvision->last_isoc_frame_num = frame->isoc_header.frame_num;
  481 	}
  482 	usbvision->header_count++;
  483 	frame->scanstate = scan_state_lines;
  484 	frame->curline = 0;
  485 
  486 	return parse_state_continue;
  487 }
  488 
  489 static enum parse_state usbvision_parse_lines_422(struct usb_usbvision *usbvision,
  490 					   long *pcopylen)
  491 {
  492 	volatile struct usbvision_frame *frame;
  493 	unsigned char *f;
  494 	int len;
  495 	int i;
  496 	unsigned char yuyv[4] = { 180, 128, 10, 128 }; /* YUV components */
  497 	unsigned char rv, gv, bv;	/* RGB components */
  498 	int clipmask_index, bytes_per_pixel;
  499 	int stretch_bytes, clipmask_add;
  500 
  501 	frame  = usbvision->cur_frame;
  502 	f = frame->data + (frame->v4l2_linesize * frame->curline);
  503 
  504 	/* Make sure there's enough data for the entire line */
  505 	len = (frame->isoc_header.frame_width * 2) + 5;
  506 	if (scratch_len(usbvision) < len) {
  507 		PDEBUG(DBG_PARSE, "out of data in line %d, need %u.\n", frame->curline, len);
  508 		return parse_state_out;
  509 	}
  510 
  511 	if ((frame->curline + 1) >= frame->frmheight)
  512 		return parse_state_next_frame;
  513 
  514 	bytes_per_pixel = frame->v4l2_format.bytes_per_pixel;
  515 	stretch_bytes = (usbvision->stretch_width - 1) * bytes_per_pixel;
  516 	clipmask_index = frame->curline * MAX_FRAME_WIDTH;
  517 	clipmask_add = usbvision->stretch_width;
  518 
  519 	for (i = 0; i < frame->frmwidth; i += (2 * usbvision->stretch_width)) {
  520 		scratch_get(usbvision, &yuyv[0], 4);
  521 
  522 		if (frame->v4l2_format.format == V4L2_PIX_FMT_YUYV) {
  523 			*f++ = yuyv[0]; /* Y */
  524 			*f++ = yuyv[3]; /* U */
  525 		} else {
  526 			YUV_TO_RGB_BY_THE_BOOK(yuyv[0], yuyv[1], yuyv[3], rv, gv, bv);
  527 			switch (frame->v4l2_format.format) {
  528 			case V4L2_PIX_FMT_RGB565:
  529 				*f++ = (0x1F & rv) |
  530 					(0xE0 & (gv << 5));
  531 				*f++ = (0x07 & (gv >> 3)) |
  532 					(0xF8 &  bv);
  533 				break;
  534 			case V4L2_PIX_FMT_RGB24:
  535 				*f++ = rv;
  536 				*f++ = gv;
  537 				*f++ = bv;
  538 				break;
  539 			case V4L2_PIX_FMT_RGB32:
  540 				*f++ = rv;
  541 				*f++ = gv;
  542 				*f++ = bv;
  543 				f++;
  544 				break;
  545 			case V4L2_PIX_FMT_RGB555:
  546 				*f++ = (0x1F & rv) |
  547 					(0xE0 & (gv << 5));
  548 				*f++ = (0x03 & (gv >> 3)) |
  549 					(0x7C & (bv << 2));
  550 				break;
  551 			}
  552 		}
  553 		clipmask_index += clipmask_add;
  554 		f += stretch_bytes;
  555 
  556 		if (frame->v4l2_format.format == V4L2_PIX_FMT_YUYV) {
  557 			*f++ = yuyv[2]; /* Y */
  558 			*f++ = yuyv[1]; /* V */
  559 		} else {
  560 			YUV_TO_RGB_BY_THE_BOOK(yuyv[2], yuyv[1], yuyv[3], rv, gv, bv);
  561 			switch (frame->v4l2_format.format) {
  562 			case V4L2_PIX_FMT_RGB565:
  563 				*f++ = (0x1F & rv) |
  564 					(0xE0 & (gv << 5));
  565 				*f++ = (0x07 & (gv >> 3)) |
  566 					(0xF8 &  bv);
  567 				break;
  568 			case V4L2_PIX_FMT_RGB24:
  569 				*f++ = rv;
  570 				*f++ = gv;
  571 				*f++ = bv;
  572 				break;
  573 			case V4L2_PIX_FMT_RGB32:
  574 				*f++ = rv;
  575 				*f++ = gv;
  576 				*f++ = bv;
  577 				f++;
  578 				break;
  579 			case V4L2_PIX_FMT_RGB555:
  580 				*f++ = (0x1F & rv) |
  581 					(0xE0 & (gv << 5));
  582 				*f++ = (0x03 & (gv >> 3)) |
  583 					(0x7C & (bv << 2));
  584 				break;
  585 			}
  586 		}
  587 		clipmask_index += clipmask_add;
  588 		f += stretch_bytes;
  589 	}
  590 
  591 	frame->curline += usbvision->stretch_height;
  592 	*pcopylen += frame->v4l2_linesize * usbvision->stretch_height;
  593 
  594 	if (frame->curline >= frame->frmheight)
  595 		return parse_state_next_frame;
  596 	return parse_state_continue;
  597 }
  598 
  599 /* The decompression routine  */
  600 static int usbvision_decompress(struct usb_usbvision *usbvision, unsigned char *compressed,
  601 								unsigned char *decompressed, int *start_pos,
  602 								int *block_typestart_pos, int len)
  603 {
  604 	int rest_pixel, idx, pos, extra_pos, block_len, block_type_pos, block_type_len;
  605 	unsigned char block_byte, block_code, block_type, block_type_byte, integrator;
  606 
  607 	integrator = 0;
  608 	pos = *start_pos;
  609 	block_type_pos = *block_typestart_pos;
  610 	extra_pos = pos;
  611 	block_len = 0;
  612 	block_byte = 0;
  613 	block_code = 0;
  614 	block_type = 0;
  615 	block_type_byte = 0;
  616 	block_type_len = 0;
  617 	rest_pixel = len;
  618 
  619 	for (idx = 0; idx < len; idx++) {
  620 		if (block_len == 0) {
  621 			if (block_type_len == 0) {
  622 				block_type_byte = compressed[block_type_pos];
  623 				block_type_pos++;
  624 				block_type_len = 4;
  625 			}
  626 			block_type = (block_type_byte & 0xC0) >> 6;
  627 
  628 			/* statistic: */
  629 			usbvision->compr_block_types[block_type]++;
  630 
  631 			pos = extra_pos;
  632 			if (block_type == 0) {
  633 				if (rest_pixel >= 24) {
  634 					idx += 23;
  635 					rest_pixel -= 24;
  636 					integrator = decompressed[idx];
  637 				} else {
  638 					idx += rest_pixel - 1;
  639 					rest_pixel = 0;
  640 				}
  641 			} else {
  642 				block_code = compressed[pos];
  643 				pos++;
  644 				if (rest_pixel >= 24)
  645 					block_len  = 24;
  646 				else
  647 					block_len = rest_pixel;
  648 				rest_pixel -= block_len;
  649 				extra_pos = pos + (block_len / 4);
  650 			}
  651 			block_type_byte <<= 2;
  652 			block_type_len -= 1;
  653 		}
  654 		if (block_len > 0) {
  655 			if ((block_len % 4) == 0) {
  656 				block_byte = compressed[pos];
  657 				pos++;
  658 			}
  659 			if (block_type == 1) /* inter Block */
  660 				integrator = decompressed[idx];
  661 			switch (block_byte & 0xC0) {
  662 			case 0x03 << 6:
  663 				integrator += compressed[extra_pos];
  664 				extra_pos++;
  665 				break;
  666 			case 0x02 << 6:
  667 				integrator += block_code;
  668 				break;
  669 			case 0x00:
  670 				integrator -= block_code;
  671 				break;
  672 			}
  673 			decompressed[idx] = integrator;
  674 			block_byte <<= 2;
  675 			block_len -= 1;
  676 		}
  677 	}
  678 	*start_pos = extra_pos;
  679 	*block_typestart_pos = block_type_pos;
  680 	return idx;
  681 }
  682 
  683 
  684 /*
  685  * usbvision_parse_compress()
  686  *
  687  * Parse compressed frame from the scratch buffer, put
  688  * decoded RGB value into the current frame buffer and add the written
  689  * number of bytes (RGB) to the *pcopylen.
  690  *
  691  */
  692 static enum parse_state usbvision_parse_compress(struct usb_usbvision *usbvision,
  693 					   long *pcopylen)
  694 {
  695 #define USBVISION_STRIP_MAGIC		0x5A
  696 #define USBVISION_STRIP_LEN_MAX		400
  697 #define USBVISION_STRIP_HEADER_LEN	3
  698 
  699 	struct usbvision_frame *frame;
  700 	unsigned char *f, *u = NULL, *v = NULL;
  701 	unsigned char strip_data[USBVISION_STRIP_LEN_MAX];
  702 	unsigned char strip_header[USBVISION_STRIP_HEADER_LEN];
  703 	int idx, idx_end, strip_len, strip_ptr, startblock_pos, block_pos, block_type_pos;
  704 	int clipmask_index;
  705 	int image_size;
  706 	unsigned char rv, gv, bv;
  707 	static unsigned char *Y, *U, *V;
  708 
  709 	frame = usbvision->cur_frame;
  710 	image_size = frame->frmwidth * frame->frmheight;
  711 	if ((frame->v4l2_format.format == V4L2_PIX_FMT_YUV422P) ||
  712 	    (frame->v4l2_format.format == V4L2_PIX_FMT_YVU420)) {       /* this is a planar format */
  713 		/* ... v4l2_linesize not used here. */
  714 		f = frame->data + (frame->width * frame->curline);
  715 	} else
  716 		f = frame->data + (frame->v4l2_linesize * frame->curline);
  717 
  718 	if (frame->v4l2_format.format == V4L2_PIX_FMT_YUYV) { /* initialise u and v pointers */
  719 		/* get base of u and b planes add halfoffset */
  720 		u = frame->data
  721 			+ image_size
  722 			+ (frame->frmwidth >> 1) * frame->curline;
  723 		v = u + (image_size >> 1);
  724 	} else if (frame->v4l2_format.format == V4L2_PIX_FMT_YVU420) {
  725 		v = frame->data + image_size + ((frame->curline * (frame->width)) >> 2);
  726 		u = v + (image_size >> 2);
  727 	}
  728 
  729 	if (frame->curline == 0)
  730 		usbvision_adjust_compression(usbvision);
  731 
  732 	if (scratch_len(usbvision) < USBVISION_STRIP_HEADER_LEN)
  733 		return parse_state_out;
  734 
  735 	/* get strip header without changing the scratch_read_ptr */
  736 	scratch_set_extra_ptr(usbvision, &strip_ptr, 0);
  737 	scratch_get_extra(usbvision, &strip_header[0], &strip_ptr,
  738 				USBVISION_STRIP_HEADER_LEN);
  739 
  740 	if (strip_header[0] != USBVISION_STRIP_MAGIC) {
  741 		/* wrong strip magic */
  742 		usbvision->strip_magic_errors++;
  743 		return parse_state_next_frame;
  744 	}
  745 
  746 	if (frame->curline != (int)strip_header[2]) {
  747 		/* line number mismatch error */
  748 		usbvision->strip_line_number_errors++;
  749 	}
  750 
  751 	strip_len = 2 * (unsigned int)strip_header[1];
  752 	if (strip_len > USBVISION_STRIP_LEN_MAX) {
  753 		/* strip overrun */
  754 		/* I think this never happens */
  755 		usbvision_request_intra(usbvision);
  756 	}
  757 
  758 	if (scratch_len(usbvision) < strip_len) {
  759 		/* there is not enough data for the strip */
  760 		return parse_state_out;
  761 	}
  762 
  763 	if (usbvision->intra_frame_buffer) {
  764 		Y = usbvision->intra_frame_buffer + frame->frmwidth * frame->curline;
  765 		U = usbvision->intra_frame_buffer + image_size + (frame->frmwidth / 2) * (frame->curline / 2);
  766 		V = usbvision->intra_frame_buffer + image_size / 4 * 5 + (frame->frmwidth / 2) * (frame->curline / 2);
  767 	} else {
  768 		return parse_state_next_frame;
  769 	}
  770 
  771 	clipmask_index = frame->curline * MAX_FRAME_WIDTH;
  772 
  773 	scratch_get(usbvision, strip_data, strip_len);
  774 
  775 	idx_end = frame->frmwidth;
  776 	block_type_pos = USBVISION_STRIP_HEADER_LEN;
  777 	startblock_pos = block_type_pos + (idx_end - 1) / 96 + (idx_end / 2 - 1) / 96 + 2;
  778 	block_pos = startblock_pos;
  779 
  780 	usbvision->block_pos = block_pos;
  781 
  782 	usbvision_decompress(usbvision, strip_data, Y, &block_pos, &block_type_pos, idx_end);
  783 	if (strip_len > usbvision->max_strip_len)
  784 		usbvision->max_strip_len = strip_len;
  785 
  786 	if (frame->curline % 2)
  787 		usbvision_decompress(usbvision, strip_data, V, &block_pos, &block_type_pos, idx_end / 2);
  788 	else
  789 		usbvision_decompress(usbvision, strip_data, U, &block_pos, &block_type_pos, idx_end / 2);
  790 
  791 	if (block_pos > usbvision->comprblock_pos)
  792 		usbvision->comprblock_pos = block_pos;
  793 	if (block_pos > strip_len)
  794 		usbvision->strip_len_errors++;
  795 
  796 	for (idx = 0; idx < idx_end; idx++) {
  797 		if (frame->v4l2_format.format == V4L2_PIX_FMT_YUYV) {
  798 			*f++ = Y[idx];
  799 			*f++ = idx & 0x01 ? U[idx / 2] : V[idx / 2];
  800 		} else if (frame->v4l2_format.format == V4L2_PIX_FMT_YUV422P) {
  801 			*f++ = Y[idx];
  802 			if (idx & 0x01)
  803 				*u++ = U[idx >> 1];
  804 			else
  805 				*v++ = V[idx >> 1];
  806 		} else if (frame->v4l2_format.format == V4L2_PIX_FMT_YVU420) {
  807 			*f++ = Y[idx];
  808 			if (!((idx & 0x01) | (frame->curline & 0x01))) {
  809 				/* only need do this for 1 in 4 pixels */
  810 				/* intraframe buffer is YUV420 format */
  811 				*u++ = U[idx >> 1];
  812 				*v++ = V[idx >> 1];
  813 			}
  814 		} else {
  815 			YUV_TO_RGB_BY_THE_BOOK(Y[idx], U[idx / 2], V[idx / 2], rv, gv, bv);
  816 			switch (frame->v4l2_format.format) {
  817 			case V4L2_PIX_FMT_GREY:
  818 				*f++ = Y[idx];
  819 				break;
  820 			case V4L2_PIX_FMT_RGB555:
  821 				*f++ = (0x1F & rv) |
  822 					(0xE0 & (gv << 5));
  823 				*f++ = (0x03 & (gv >> 3)) |
  824 					(0x7C & (bv << 2));
  825 				break;
  826 			case V4L2_PIX_FMT_RGB565:
  827 				*f++ = (0x1F & rv) |
  828 					(0xE0 & (gv << 5));
  829 				*f++ = (0x07 & (gv >> 3)) |
  830 					(0xF8 & bv);
  831 				break;
  832 			case V4L2_PIX_FMT_RGB24:
  833 				*f++ = rv;
  834 				*f++ = gv;
  835 				*f++ = bv;
  836 				break;
  837 			case V4L2_PIX_FMT_RGB32:
  838 				*f++ = rv;
  839 				*f++ = gv;
  840 				*f++ = bv;
  841 				f++;
  842 				break;
  843 			}
  844 		}
  845 		clipmask_index++;
  846 	}
  847 	/* Deal with non-integer no. of bytes for YUV420P */
  848 	if (frame->v4l2_format.format != V4L2_PIX_FMT_YVU420)
  849 		*pcopylen += frame->v4l2_linesize;
  850 	else
  851 		*pcopylen += frame->curline & 0x01 ? frame->v4l2_linesize : frame->v4l2_linesize << 1;
  852 
  853 	frame->curline += 1;
  854 
  855 	if (frame->curline >= frame->frmheight)
  856 		return parse_state_next_frame;
  857 	return parse_state_continue;
  858 
  859 }
  860 
  861 
  862 /*
  863  * usbvision_parse_lines_420()
  864  *
  865  * Parse two lines from the scratch buffer, put
  866  * decoded RGB value into the current frame buffer and add the written
  867  * number of bytes (RGB) to the *pcopylen.
  868  *
  869  */
  870 static enum parse_state usbvision_parse_lines_420(struct usb_usbvision *usbvision,
  871 					   long *pcopylen)
  872 {
  873 	struct usbvision_frame *frame;
  874 	unsigned char *f_even = NULL, *f_odd = NULL;
  875 	unsigned int pixel_per_line, block;
  876 	int pixel, block_split;
  877 	int y_ptr, u_ptr, v_ptr, y_odd_offset;
  878 	const int y_block_size = 128;
  879 	const int uv_block_size = 64;
  880 	const int sub_block_size = 32;
  881 	const int y_step[] = { 0, 0, 0, 2 }, y_step_size = 4;
  882 	const int uv_step[] = { 0, 0, 0, 4 }, uv_step_size = 4;
  883 	unsigned char y[2], u, v;	/* YUV components */
  884 	int y_, u_, v_, vb, uvg, ur;
  885 	int r_, g_, b_;			/* RGB components */
  886 	unsigned char g;
  887 	int clipmask_even_index, clipmask_odd_index, bytes_per_pixel;
  888 	int clipmask_add, stretch_bytes;
  889 
  890 	frame  = usbvision->cur_frame;
  891 	f_even = frame->data + (frame->v4l2_linesize * frame->curline);
  892 	f_odd  = f_even + frame->v4l2_linesize * usbvision->stretch_height;
  893 
  894 	/* Make sure there's enough data for the entire line */
  895 	/* In this mode usbvision transfer 3 bytes for every 2 pixels */
  896 	/* I need two lines to decode the color */
  897 	bytes_per_pixel = frame->v4l2_format.bytes_per_pixel;
  898 	stretch_bytes = (usbvision->stretch_width - 1) * bytes_per_pixel;
  899 	clipmask_even_index = frame->curline * MAX_FRAME_WIDTH;
  900 	clipmask_odd_index  = clipmask_even_index + MAX_FRAME_WIDTH;
  901 	clipmask_add = usbvision->stretch_width;
  902 	pixel_per_line = frame->isoc_header.frame_width;
  903 
  904 	if (scratch_len(usbvision) < (int)pixel_per_line * 3) {
  905 		/* printk(KERN_DEBUG "out of data, need %d\n", len); */
  906 		return parse_state_out;
  907 	}
  908 
  909 	if ((frame->curline + 1) >= frame->frmheight)
  910 		return parse_state_next_frame;
  911 
  912 	block_split = (pixel_per_line%y_block_size) ? 1 : 0;	/* are some blocks splitted into different lines? */
  913 
  914 	y_odd_offset = (pixel_per_line / y_block_size) * (y_block_size + uv_block_size)
  915 			+ block_split * uv_block_size;
  916 
  917 	scratch_set_extra_ptr(usbvision, &y_ptr, y_odd_offset);
  918 	scratch_set_extra_ptr(usbvision, &u_ptr, y_block_size);
  919 	scratch_set_extra_ptr(usbvision, &v_ptr, y_odd_offset
  920 			+ (4 - block_split) * sub_block_size);
  921 
  922 	for (block = 0; block < (pixel_per_line / sub_block_size); block++) {
  923 		for (pixel = 0; pixel < sub_block_size; pixel += 2) {
  924 			scratch_get(usbvision, &y[0], 2);
  925 			scratch_get_extra(usbvision, &u, &u_ptr, 1);
  926 			scratch_get_extra(usbvision, &v, &v_ptr, 1);
  927 
  928 			/* I don't use the YUV_TO_RGB macro for better performance */
  929 			v_ = v - 128;
  930 			u_ = u - 128;
  931 			vb = 132252 * v_;
  932 			uvg = -53281 * u_ - 25625 * v_;
  933 			ur = 104595 * u_;
  934 
  935 			if (frame->v4l2_format.format == V4L2_PIX_FMT_YUYV) {
  936 				*f_even++ = y[0];
  937 				*f_even++ = v;
  938 			} else {
  939 				y_ = 76284 * (y[0] - 16);
  940 
  941 				b_ = (y_ + vb) >> 16;
  942 				g_ = (y_ + uvg) >> 16;
  943 				r_ = (y_ + ur) >> 16;
  944 
  945 				switch (frame->v4l2_format.format) {
  946 				case V4L2_PIX_FMT_RGB565:
  947 					g = LIMIT_RGB(g_);
  948 					*f_even++ =
  949 						(0x1F & LIMIT_RGB(r_)) |
  950 						(0xE0 & (g << 5));
  951 					*f_even++ =
  952 						(0x07 & (g >> 3)) |
  953 						(0xF8 &  LIMIT_RGB(b_));
  954 					break;
  955 				case V4L2_PIX_FMT_RGB24:
  956 					*f_even++ = LIMIT_RGB(r_);
  957 					*f_even++ = LIMIT_RGB(g_);
  958 					*f_even++ = LIMIT_RGB(b_);
  959 					break;
  960 				case V4L2_PIX_FMT_RGB32:
  961 					*f_even++ = LIMIT_RGB(r_);
  962 					*f_even++ = LIMIT_RGB(g_);
  963 					*f_even++ = LIMIT_RGB(b_);
  964 					f_even++;
  965 					break;
  966 				case V4L2_PIX_FMT_RGB555:
  967 					g = LIMIT_RGB(g_);
  968 					*f_even++ = (0x1F & LIMIT_RGB(r_)) |
  969 						(0xE0 & (g << 5));
  970 					*f_even++ = (0x03 & (g >> 3)) |
  971 						(0x7C & (LIMIT_RGB(b_) << 2));
  972 					break;
  973 				}
  974 			}
  975 			clipmask_even_index += clipmask_add;
  976 			f_even += stretch_bytes;
  977 
  978 			if (frame->v4l2_format.format == V4L2_PIX_FMT_YUYV) {
  979 				*f_even++ = y[1];
  980 				*f_even++ = u;
  981 			} else {
  982 				y_ = 76284 * (y[1] - 16);
  983 
  984 				b_ = (y_ + vb) >> 16;
  985 				g_ = (y_ + uvg) >> 16;
  986 				r_ = (y_ + ur) >> 16;
  987 
  988 				switch (frame->v4l2_format.format) {
  989 				case V4L2_PIX_FMT_RGB565:
  990 					g = LIMIT_RGB(g_);
  991 					*f_even++ =
  992 						(0x1F & LIMIT_RGB(r_)) |
  993 						(0xE0 & (g << 5));
  994 					*f_even++ =
  995 						(0x07 & (g >> 3)) |
  996 						(0xF8 &  LIMIT_RGB(b_));
  997 					break;
  998 				case V4L2_PIX_FMT_RGB24:
  999 					*f_even++ = LIMIT_RGB(r_);
 1000 					*f_even++ = LIMIT_RGB(g_);
 1001 					*f_even++ = LIMIT_RGB(b_);
 1002 					break;
 1003 				case V4L2_PIX_FMT_RGB32:
 1004 					*f_even++ = LIMIT_RGB(r_);
 1005 					*f_even++ = LIMIT_RGB(g_);
 1006 					*f_even++ = LIMIT_RGB(b_);
 1007 					f_even++;
 1008 					break;
 1009 				case V4L2_PIX_FMT_RGB555:
 1010 					g = LIMIT_RGB(g_);
 1011 					*f_even++ = (0x1F & LIMIT_RGB(r_)) |
 1012 						(0xE0 & (g << 5));
 1013 					*f_even++ = (0x03 & (g >> 3)) |
 1014 						(0x7C & (LIMIT_RGB(b_) << 2));
 1015 					break;
 1016 				}
 1017 			}
 1018 			clipmask_even_index += clipmask_add;
 1019 			f_even += stretch_bytes;
 1020 
 1021 			scratch_get_extra(usbvision, &y[0], &y_ptr, 2);
 1022 
 1023 			if (frame->v4l2_format.format == V4L2_PIX_FMT_YUYV) {
 1024 				*f_odd++ = y[0];
 1025 				*f_odd++ = v;
 1026 			} else {
 1027 				y_ = 76284 * (y[0] - 16);
 1028 
 1029 				b_ = (y_ + vb) >> 16;
 1030 				g_ = (y_ + uvg) >> 16;
 1031 				r_ = (y_ + ur) >> 16;
 1032 
 1033 				switch (frame->v4l2_format.format) {
 1034 				case V4L2_PIX_FMT_RGB565:
 1035 					g = LIMIT_RGB(g_);
 1036 					*f_odd++ =
 1037 						(0x1F & LIMIT_RGB(r_)) |
 1038 						(0xE0 & (g << 5));
 1039 					*f_odd++ =
 1040 						(0x07 & (g >> 3)) |
 1041 						(0xF8 &  LIMIT_RGB(b_));
 1042 					break;
 1043 				case V4L2_PIX_FMT_RGB24:
 1044 					*f_odd++ = LIMIT_RGB(r_);
 1045 					*f_odd++ = LIMIT_RGB(g_);
 1046 					*f_odd++ = LIMIT_RGB(b_);
 1047 					break;
 1048 				case V4L2_PIX_FMT_RGB32:
 1049 					*f_odd++ = LIMIT_RGB(r_);
 1050 					*f_odd++ = LIMIT_RGB(g_);
 1051 					*f_odd++ = LIMIT_RGB(b_);
 1052 					f_odd++;
 1053 					break;
 1054 				case V4L2_PIX_FMT_RGB555:
 1055 					g = LIMIT_RGB(g_);
 1056 					*f_odd++ = (0x1F & LIMIT_RGB(r_)) |
 1057 						(0xE0 & (g << 5));
 1058 					*f_odd++ = (0x03 & (g >> 3)) |
 1059 						(0x7C & (LIMIT_RGB(b_) << 2));
 1060 					break;
 1061 				}
 1062 			}
 1063 			clipmask_odd_index += clipmask_add;
 1064 			f_odd += stretch_bytes;
 1065 
 1066 			if (frame->v4l2_format.format == V4L2_PIX_FMT_YUYV) {
 1067 				*f_odd++ = y[1];
 1068 				*f_odd++ = u;
 1069 			} else {
 1070 				y_ = 76284 * (y[1] - 16);
 1071 
 1072 				b_ = (y_ + vb) >> 16;
 1073 				g_ = (y_ + uvg) >> 16;
 1074 				r_ = (y_ + ur) >> 16;
 1075 
 1076 				switch (frame->v4l2_format.format) {
 1077 				case V4L2_PIX_FMT_RGB565:
 1078 					g = LIMIT_RGB(g_);
 1079 					*f_odd++ =
 1080 						(0x1F & LIMIT_RGB(r_)) |
 1081 						(0xE0 & (g << 5));
 1082 					*f_odd++ =
 1083 						(0x07 & (g >> 3)) |
 1084 						(0xF8 &  LIMIT_RGB(b_));
 1085 					break;
 1086 				case V4L2_PIX_FMT_RGB24:
 1087 					*f_odd++ = LIMIT_RGB(r_);
 1088 					*f_odd++ = LIMIT_RGB(g_);
 1089 					*f_odd++ = LIMIT_RGB(b_);
 1090 					break;
 1091 				case V4L2_PIX_FMT_RGB32:
 1092 					*f_odd++ = LIMIT_RGB(r_);
 1093 					*f_odd++ = LIMIT_RGB(g_);
 1094 					*f_odd++ = LIMIT_RGB(b_);
 1095 					f_odd++;
 1096 					break;
 1097 				case V4L2_PIX_FMT_RGB555:
 1098 					g = LIMIT_RGB(g_);
 1099 					*f_odd++ = (0x1F & LIMIT_RGB(r_)) |
 1100 						(0xE0 & (g << 5));
 1101 					*f_odd++ = (0x03 & (g >> 3)) |
 1102 						(0x7C & (LIMIT_RGB(b_) << 2));
 1103 					break;
 1104 				}
 1105 			}
 1106 			clipmask_odd_index += clipmask_add;
 1107 			f_odd += stretch_bytes;
 1108 		}
 1109 
 1110 		scratch_rm_old(usbvision, y_step[block % y_step_size] * sub_block_size);
 1111 		scratch_inc_extra_ptr(&y_ptr, y_step[(block + 2 * block_split) % y_step_size]
 1112 				* sub_block_size);
 1113 		scratch_inc_extra_ptr(&u_ptr, uv_step[block % uv_step_size]
 1114 				* sub_block_size);
 1115 		scratch_inc_extra_ptr(&v_ptr, uv_step[(block + 2 * block_split) % uv_step_size]
 1116 				* sub_block_size);
 1117 	}
 1118 
 1119 	scratch_rm_old(usbvision, pixel_per_line * 3 / 2
 1120 			+ block_split * sub_block_size);
 1121 
 1122 	frame->curline += 2 * usbvision->stretch_height;
 1123 	*pcopylen += frame->v4l2_linesize * 2 * usbvision->stretch_height;
 1124 
 1125 	if (frame->curline >= frame->frmheight)
 1126 		return parse_state_next_frame;
 1127 	return parse_state_continue;
 1128 }
 1129 
 1130 /*
 1131  * usbvision_parse_data()
 1132  *
 1133  * Generic routine to parse the scratch buffer. It employs either
 1134  * usbvision_find_header() or usbvision_parse_lines() to do most
 1135  * of work.
 1136  *
 1137  */
 1138 static void usbvision_parse_data(struct usb_usbvision *usbvision)
 1139 {
 1140 	struct usbvision_frame *frame;
 1141 	enum parse_state newstate;
 1142 	long copylen = 0;
 1143 	unsigned long lock_flags;
 1144 
 1145 	frame = usbvision->cur_frame;
 1146 
 1147 	PDEBUG(DBG_PARSE, "parsing len=%d\n", scratch_len(usbvision));
 1148 
 1149 	while (1) {
 1150 		newstate = parse_state_out;
 1151 		if (scratch_len(usbvision)) {
 1152 			if (frame->scanstate == scan_state_scanning) {
 1153 				newstate = usbvision_find_header(usbvision);
 1154 			} else if (frame->scanstate == scan_state_lines) {
 1155 				if (usbvision->isoc_mode == ISOC_MODE_YUV420)
 1156 					newstate = usbvision_parse_lines_420(usbvision, ©len);
 1157 				else if (usbvision->isoc_mode == ISOC_MODE_YUV422)
 1158 					newstate = usbvision_parse_lines_422(usbvision, ©len);
 1159 				else if (usbvision->isoc_mode == ISOC_MODE_COMPRESS)
 1160 					newstate = usbvision_parse_compress(usbvision, ©len);
 1161 			}
 1162 		}
 1163 		if (newstate == parse_state_continue)
 1164 			continue;
 1165 		if ((newstate == parse_state_next_frame) || (newstate == parse_state_out))
 1166 			break;
 1167 		return;	/* parse_state_end_parse */
 1168 	}
 1169 
 1170 	if (newstate == parse_state_next_frame) {
 1171 		frame->grabstate = frame_state_done;
 1172 		v4l2_get_timestamp(&(frame->timestamp));
 1173 		frame->sequence = usbvision->frame_num;
 1174 
 1175 		spin_lock_irqsave(&usbvision->queue_lock, lock_flags);
 1176 		list_move_tail(&(frame->frame), &usbvision->outqueue);
 1177 		usbvision->cur_frame = NULL;
 1178 		spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags);
 1179 
 1180 		usbvision->frame_num++;
 1181 
 1182 		/* This will cause the process to request another frame. */
 1183 		if (waitqueue_active(&usbvision->wait_frame)) {
 1184 			PDEBUG(DBG_PARSE, "Wake up !");
 1185 			wake_up_interruptible(&usbvision->wait_frame);
 1186 		}
 1187 	} else {
 1188 		frame->grabstate = frame_state_grabbing;
 1189 	}
 1190 
 1191 	/* Update the frame's uncompressed length. */
 1192 	frame->scanlength += copylen;
 1193 }
 1194 
 1195 
 1196 /*
 1197  * Make all of the blocks of data contiguous
 1198  */
 1199 static int usbvision_compress_isochronous(struct usb_usbvision *usbvision,
 1200 					  struct urb *urb)
 1201 {
 1202 	unsigned char *packet_data;
 1203 	int i, totlen = 0;
 1204 
 1205 	for (i = 0; i < urb->number_of_packets; i++) {
 1206 		int packet_len = urb->iso_frame_desc[i].actual_length;
 1207 		int packet_stat = urb->iso_frame_desc[i].status;
 1208 
 1209 		packet_data = urb->transfer_buffer + urb->iso_frame_desc[i].offset;
 1210 
 1211 		/* Detect and ignore errored packets */
 1212 		if (packet_stat) {	/* packet_stat != 0 ????????????? */
 1213 			PDEBUG(DBG_ISOC, "data error: [%d] len=%d, status=%X", i, packet_len, packet_stat);
 1214 			usbvision->isoc_err_count++;
 1215 			continue;
 1216 		}
 1217 
 1218 		/* Detect and ignore empty packets */
 1219 		if (packet_len < 0) {
 1220 			PDEBUG(DBG_ISOC, "error packet [%d]", i);
 1221 			usbvision->isoc_skip_count++;
 1222 			continue;
 1223 		} else if (packet_len == 0) {	/* Frame end ????? */
 1224 			PDEBUG(DBG_ISOC, "null packet [%d]", i);
 1225 			usbvision->isocstate = isoc_state_no_frame;
 1226 			usbvision->isoc_skip_count++;
 1227 			continue;
 1228 		} else if (packet_len > usbvision->isoc_packet_size) {
 1229 			PDEBUG(DBG_ISOC, "packet[%d] > isoc_packet_size", i);
 1230 			usbvision->isoc_skip_count++;
 1231 			continue;
 1232 		}
 1233 
 1234 		PDEBUG(DBG_ISOC, "packet ok [%d] len=%d", i, packet_len);
 1235 
 1236 		if (usbvision->isocstate == isoc_state_no_frame) { /* new frame begins */
 1237 			usbvision->isocstate = isoc_state_in_frame;
 1238 			scratch_mark_header(usbvision);
 1239 			usbvision_measure_bandwidth(usbvision);
 1240 			PDEBUG(DBG_ISOC, "packet with header");
 1241 		}
 1242 
 1243 		/*
 1244 		 * If usbvision continues to feed us with data but there is no
 1245 		 * consumption (if, for example, V4L client fell asleep) we
 1246 		 * may overflow the buffer. We have to move old data over to
 1247 		 * free room for new data. This is bad for old data. If we
 1248 		 * just drop new data then it's bad for new data... choose
 1249 		 * your favorite evil here.
 1250 		 */
 1251 		if (scratch_free(usbvision) < packet_len) {
 1252 			usbvision->scratch_ovf_count++;
 1253 			PDEBUG(DBG_ISOC, "scratch buf overflow! scr_len: %d, n: %d",
 1254 			       scratch_len(usbvision), packet_len);
 1255 			scratch_rm_old(usbvision, packet_len - scratch_free(usbvision));
 1256 		}
 1257 
 1258 		/* Now we know that there is enough room in scratch buffer */
 1259 		scratch_put(usbvision, packet_data, packet_len);
 1260 		totlen += packet_len;
 1261 		usbvision->isoc_data_count += packet_len;
 1262 		usbvision->isoc_packet_count++;
 1263 	}
 1264 #if ENABLE_HEXDUMP
 1265 	if (totlen > 0) {
 1266 		static int foo;
 1267 
 1268 		if (foo < 1) {
 1269 			printk(KERN_DEBUG "+%d.\n", usbvision->scratchlen);
 1270 			usbvision_hexdump(data0, (totlen > 64) ? 64 : totlen);
 1271 			++foo;
 1272 		}
 1273 	}
 1274 #endif
 1275 	return totlen;
 1276 }
 1277 
 1278 static void usbvision_isoc_irq(struct urb *urb)
 1279 {
 1280 	int err_code = 0;
 1281 	int len;
 1282 	struct usb_usbvision *usbvision = urb->context;
 1283 	int i;
 1284 	unsigned long start_time = jiffies;
 1285 	struct usbvision_frame **f;
 1286 
 1287 	/* We don't want to do anything if we are about to be removed! */
 1288 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 1289 		return;
 1290 
 1291 	/* any urb with wrong status is ignored without acknowledgement */
 1292 	if (urb->status == -ENOENT)
 1293 		return;
 1294 
 1295 	f = &usbvision->cur_frame;
 1296 
 1297 	/* Manage streaming interruption */
 1298 	if (usbvision->streaming == stream_interrupt) {
 1299 		usbvision->streaming = stream_idle;
 1300 		if ((*f)) {
 1301 			(*f)->grabstate = frame_state_ready;
 1302 			(*f)->scanstate = scan_state_scanning;
 1303 		}
 1304 		PDEBUG(DBG_IRQ, "stream interrupted");
 1305 		wake_up_interruptible(&usbvision->wait_stream);
 1306 	}
 1307 
 1308 	/* Copy the data received into our scratch buffer */
 1309 	len = usbvision_compress_isochronous(usbvision, urb);
 1310 
 1311 	usbvision->isoc_urb_count++;
 1312 	usbvision->urb_length = len;
 1313 
 1314 	if (usbvision->streaming == stream_on) {
 1315 		/* If we collected enough data let's parse! */
 1316 		if (scratch_len(usbvision) > USBVISION_HEADER_LENGTH &&
 1317 		    !list_empty(&(usbvision->inqueue))) {
 1318 			if (!(*f)) {
 1319 				(*f) = list_entry(usbvision->inqueue.next,
 1320 						  struct usbvision_frame,
 1321 						  frame);
 1322 			}
 1323 			usbvision_parse_data(usbvision);
 1324 		} else {
 1325 			/* If we don't have a frame
 1326 			  we're current working on, complain */
 1327 			PDEBUG(DBG_IRQ,
 1328 			       "received data, but no one needs it");
 1329 			scratch_reset(usbvision);
 1330 		}
 1331 	} else {
 1332 		PDEBUG(DBG_IRQ, "received data, but no one needs it");
 1333 		scratch_reset(usbvision);
 1334 	}
 1335 
 1336 	usbvision->time_in_irq += jiffies - start_time;
 1337 
 1338 	for (i = 0; i < USBVISION_URB_FRAMES; i++) {
 1339 		urb->iso_frame_desc[i].status = 0;
 1340 		urb->iso_frame_desc[i].actual_length = 0;
 1341 	}
 1342 
 1343 	urb->status = 0;
 1344 	urb->dev = usbvision->dev;
 1345 	err_code = usb_submit_urb(urb, GFP_ATOMIC);
 1346 
 1347 	if (err_code) {
 1348 		dev_err(&usbvision->dev->dev,
 1349 			"%s: usb_submit_urb failed: error %d\n",
 1350 				__func__, err_code);
 1351 	}
 1352 
 1353 	return;
 1354 }
 1355 
 1356 /*************************************/
 1357 /* Low level usbvision access functions */
 1358 /*************************************/
 1359 
 1360 /*
 1361  * usbvision_read_reg()
 1362  *
 1363  * return  < 0 -> Error
 1364  *        >= 0 -> Data
 1365  */
 1366 
 1367 int usbvision_read_reg(struct usb_usbvision *usbvision, unsigned char reg)
 1368 {
 1369 	int err_code = 0;
 1370 	unsigned char buffer[1];
 1371 
 1372 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 1373 		return -1;
 1374 
 1375 	err_code = usb_control_msg(usbvision->dev, usb_rcvctrlpipe(usbvision->dev, 1),
 1376 				USBVISION_OP_CODE,
 1377 				USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT,
 1378 				0, (__u16) reg, buffer, 1, HZ);
 1379 
 1380 	if (err_code < 0) {
 1381 		dev_err(&usbvision->dev->dev,
 1382 			"%s: failed: error %d\n", __func__, err_code);
 1383 		return err_code;
 1384 	}
 1385 	return buffer[0];
 1386 }
 1387 
 1388 /*
 1389  * usbvision_write_reg()
 1390  *
 1391  * return 1 -> Reg written
 1392  *        0 -> usbvision is not yet ready
 1393  *       -1 -> Something went wrong
 1394  */
 1395 
 1396 int usbvision_write_reg(struct usb_usbvision *usbvision, unsigned char reg,
 1397 			    unsigned char value)
 1398 {
 1399 	int err_code = 0;
 1400 
 1401 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 1402 		return 0;
 1403 
 1404 	err_code = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1),
 1405 				USBVISION_OP_CODE,
 1406 				USB_DIR_OUT | USB_TYPE_VENDOR |
 1407 				USB_RECIP_ENDPOINT, 0, (__u16) reg, &value, 1, HZ);
 1408 
 1409 	if (err_code < 0) {
 1410 		dev_err(&usbvision->dev->dev,
 1411 			"%s: failed: error %d\n", __func__, err_code);
 1412 	}
 1413 	return err_code;
 1414 }
 1415 
 1416 
 1417 static void usbvision_ctrl_urb_complete(struct urb *urb)
 1418 {
 1419 	struct usb_usbvision *usbvision = (struct usb_usbvision *)urb->context;
 1420 
 1421 	PDEBUG(DBG_IRQ, "");
 1422 	usbvision->ctrl_urb_busy = 0;
 1423 	if (waitqueue_active(&usbvision->ctrl_urb_wq))
 1424 		wake_up_interruptible(&usbvision->ctrl_urb_wq);
 1425 }
 1426 
 1427 
 1428 static int usbvision_write_reg_irq(struct usb_usbvision *usbvision, int address,
 1429 				unsigned char *data, int len)
 1430 {
 1431 	int err_code = 0;
 1432 
 1433 	PDEBUG(DBG_IRQ, "");
 1434 	if (len > 8)
 1435 		return -EFAULT;
 1436 	if (usbvision->ctrl_urb_busy)
 1437 		return -EBUSY;
 1438 	usbvision->ctrl_urb_busy = 1;
 1439 
 1440 	usbvision->ctrl_urb_setup.bRequestType = USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT;
 1441 	usbvision->ctrl_urb_setup.bRequest     = USBVISION_OP_CODE;
 1442 	usbvision->ctrl_urb_setup.wValue       = 0;
 1443 	usbvision->ctrl_urb_setup.wIndex       = cpu_to_le16(address);
 1444 	usbvision->ctrl_urb_setup.wLength      = cpu_to_le16(len);
 1445 	usb_fill_control_urb(usbvision->ctrl_urb, usbvision->dev,
 1446 							usb_sndctrlpipe(usbvision->dev, 1),
 1447 							(unsigned char *)&usbvision->ctrl_urb_setup,
 1448 							(void *)usbvision->ctrl_urb_buffer, len,
 1449 							usbvision_ctrl_urb_complete,
 1450 							(void *)usbvision);
 1451 
 1452 	memcpy(usbvision->ctrl_urb_buffer, data, len);
 1453 
 1454 	err_code = usb_submit_urb(usbvision->ctrl_urb, GFP_ATOMIC);
 1455 	if (err_code < 0) {
 1456 		/* error in usb_submit_urb() */
 1457 		usbvision->ctrl_urb_busy = 0;
 1458 	}
 1459 	PDEBUG(DBG_IRQ, "submit %d byte: error %d", len, err_code);
 1460 	return err_code;
 1461 }
 1462 
 1463 
 1464 static int usbvision_init_compression(struct usb_usbvision *usbvision)
 1465 {
 1466 	usbvision->last_isoc_frame_num = -1;
 1467 	usbvision->isoc_data_count = 0;
 1468 	usbvision->isoc_packet_count = 0;
 1469 	usbvision->isoc_skip_count = 0;
 1470 	usbvision->compr_level = 50;
 1471 	usbvision->last_compr_level = -1;
 1472 	usbvision->isoc_urb_count = 0;
 1473 	usbvision->request_intra = 1;
 1474 	usbvision->isoc_measure_bandwidth_count = 0;
 1475 
 1476 	return 0;
 1477 }
 1478 
 1479 /* this function measures the used bandwidth since last call
 1480  * return:    0 : no error
 1481  * sets used_bandwidth to 1-100 : 1-100% of full bandwidth resp. to isoc_packet_size
 1482  */
 1483 static int usbvision_measure_bandwidth(struct usb_usbvision *usbvision)
 1484 {
 1485 	if (usbvision->isoc_measure_bandwidth_count < 2) { /* this gives an average bandwidth of 3 frames */
 1486 		usbvision->isoc_measure_bandwidth_count++;
 1487 		return 0;
 1488 	}
 1489 	if ((usbvision->isoc_packet_size > 0) && (usbvision->isoc_packet_count > 0)) {
 1490 		usbvision->used_bandwidth = usbvision->isoc_data_count /
 1491 					(usbvision->isoc_packet_count + usbvision->isoc_skip_count) *
 1492 					100 / usbvision->isoc_packet_size;
 1493 	}
 1494 	usbvision->isoc_measure_bandwidth_count = 0;
 1495 	usbvision->isoc_data_count = 0;
 1496 	usbvision->isoc_packet_count = 0;
 1497 	usbvision->isoc_skip_count = 0;
 1498 	return 0;
 1499 }
 1500 
 1501 static int usbvision_adjust_compression(struct usb_usbvision *usbvision)
 1502 {
 1503 	int err_code = 0;
 1504 	unsigned char buffer[6];
 1505 
 1506 	PDEBUG(DBG_IRQ, "");
 1507 	if ((adjust_compression) && (usbvision->used_bandwidth > 0)) {
 1508 		usbvision->compr_level += (usbvision->used_bandwidth - 90) / 2;
 1509 		RESTRICT_TO_RANGE(usbvision->compr_level, 0, 100);
 1510 		if (usbvision->compr_level != usbvision->last_compr_level) {
 1511 			int distortion;
 1512 
 1513 			if (usbvision->bridge_type == BRIDGE_NT1004 || usbvision->bridge_type == BRIDGE_NT1005) {
 1514 				buffer[0] = (unsigned char)(4 + 16 * usbvision->compr_level / 100);	/* PCM Threshold 1 */
 1515 				buffer[1] = (unsigned char)(4 + 8 * usbvision->compr_level / 100);	/* PCM Threshold 2 */
 1516 				distortion = 7 + 248 * usbvision->compr_level / 100;
 1517 				buffer[2] = (unsigned char)(distortion & 0xFF);				/* Average distortion Threshold (inter) */
 1518 				buffer[3] = (unsigned char)(distortion & 0xFF);				/* Average distortion Threshold (intra) */
 1519 				distortion = 1 + 42 * usbvision->compr_level / 100;
 1520 				buffer[4] = (unsigned char)(distortion & 0xFF);				/* Maximum distortion Threshold (inter) */
 1521 				buffer[5] = (unsigned char)(distortion & 0xFF);				/* Maximum distortion Threshold (intra) */
 1522 			} else { /* BRIDGE_NT1003 */
 1523 				buffer[0] = (unsigned char)(4 + 16 * usbvision->compr_level / 100);	/* PCM threshold 1 */
 1524 				buffer[1] = (unsigned char)(4 + 8 * usbvision->compr_level / 100);	/* PCM threshold 2 */
 1525 				distortion = 2 + 253 * usbvision->compr_level / 100;
 1526 				buffer[2] = (unsigned char)(distortion & 0xFF);				/* distortion threshold bit0-7 */
 1527 				buffer[3] = 0;	/* (unsigned char)((distortion >> 8) & 0x0F);		distortion threshold bit 8-11 */
 1528 				distortion = 0 + 43 * usbvision->compr_level / 100;
 1529 				buffer[4] = (unsigned char)(distortion & 0xFF);				/* maximum distortion bit0-7 */
 1530 				buffer[5] = 0; /* (unsigned char)((distortion >> 8) & 0x01);		maximum distortion bit 8 */
 1531 			}
 1532 			err_code = usbvision_write_reg_irq(usbvision, USBVISION_PCM_THR1, buffer, 6);
 1533 			if (err_code == 0) {
 1534 				PDEBUG(DBG_IRQ, "new compr params %#02x %#02x %#02x %#02x %#02x %#02x", buffer[0],
 1535 								buffer[1], buffer[2], buffer[3], buffer[4], buffer[5]);
 1536 				usbvision->last_compr_level = usbvision->compr_level;
 1537 			}
 1538 		}
 1539 	}
 1540 	return err_code;
 1541 }
 1542 
 1543 static int usbvision_request_intra(struct usb_usbvision *usbvision)
 1544 {
 1545 	unsigned char buffer[1];
 1546 
 1547 	PDEBUG(DBG_IRQ, "");
 1548 	usbvision->request_intra = 1;
 1549 	buffer[0] = 1;
 1550 	usbvision_write_reg_irq(usbvision, USBVISION_FORCE_INTRA, buffer, 1);
 1551 	return 0;
 1552 }
 1553 
 1554 static int usbvision_unrequest_intra(struct usb_usbvision *usbvision)
 1555 {
 1556 	unsigned char buffer[1];
 1557 
 1558 	PDEBUG(DBG_IRQ, "");
 1559 	usbvision->request_intra = 0;
 1560 	buffer[0] = 0;
 1561 	usbvision_write_reg_irq(usbvision, USBVISION_FORCE_INTRA, buffer, 1);
 1562 	return 0;
 1563 }
 1564 
 1565 /*******************************
 1566  * usbvision utility functions
 1567  *******************************/
 1568 
 1569 int usbvision_power_off(struct usb_usbvision *usbvision)
 1570 {
 1571 	int err_code = 0;
 1572 
 1573 	PDEBUG(DBG_FUNC, "");
 1574 
 1575 	err_code = usbvision_write_reg(usbvision, USBVISION_PWR_REG, USBVISION_SSPND_EN);
 1576 	if (err_code == 1)
 1577 		usbvision->power = 0;
 1578 	PDEBUG(DBG_FUNC, "%s: err_code %d", (err_code != 1) ? "ERROR" : "power is off", err_code);
 1579 	return err_code;
 1580 }
 1581 
 1582 /* configure webcam image sensor using the serial port */
 1583 static int usbvision_init_webcam(struct usb_usbvision *usbvision)
 1584 {
 1585 	int rc;
 1586 	int i;
 1587 	static char init_values[38][3] = {
 1588 		{ 0x04, 0x12, 0x08 }, { 0x05, 0xff, 0xc8 }, { 0x06, 0x18, 0x07 }, { 0x07, 0x90, 0x00 },
 1589 		{ 0x09, 0x00, 0x00 }, { 0x0a, 0x00, 0x00 }, { 0x0b, 0x08, 0x00 }, { 0x0d, 0xcc, 0xcc },
 1590 		{ 0x0e, 0x13, 0x14 }, { 0x10, 0x9b, 0x83 }, { 0x11, 0x5a, 0x3f }, { 0x12, 0xe4, 0x73 },
 1591 		{ 0x13, 0x88, 0x84 }, { 0x14, 0x89, 0x80 }, { 0x15, 0x00, 0x20 }, { 0x16, 0x00, 0x00 },
 1592 		{ 0x17, 0xff, 0xa0 }, { 0x18, 0x6b, 0x20 }, { 0x19, 0x22, 0x40 }, { 0x1a, 0x10, 0x07 },
 1593 		{ 0x1b, 0x00, 0x47 }, { 0x1c, 0x03, 0xe0 }, { 0x1d, 0x00, 0x00 }, { 0x1e, 0x00, 0x00 },
 1594 		{ 0x1f, 0x00, 0x00 }, { 0x20, 0x00, 0x00 }, { 0x21, 0x00, 0x00 }, { 0x22, 0x00, 0x00 },
 1595 		{ 0x23, 0x00, 0x00 }, { 0x24, 0x00, 0x00 }, { 0x25, 0x00, 0x00 }, { 0x26, 0x00, 0x00 },
 1596 		{ 0x27, 0x00, 0x00 }, { 0x28, 0x00, 0x00 }, { 0x29, 0x00, 0x00 }, { 0x08, 0x80, 0x60 },
 1597 		{ 0x0f, 0x2d, 0x24 }, { 0x0c, 0x80, 0x80 }
 1598 	};
 1599 	char value[3];
 1600 
 1601 	/* the only difference between PAL and NTSC init_values */
 1602 	if (usbvision_device_data[usbvision->dev_model].video_norm == V4L2_STD_NTSC)
 1603 		init_values[4][1] = 0x34;
 1604 
 1605 	for (i = 0; i < sizeof(init_values) / 3; i++) {
 1606 		usbvision_write_reg(usbvision, USBVISION_SER_MODE, USBVISION_SER_MODE_SOFT);
 1607 		memcpy(value, init_values[i], 3);
 1608 		rc = usb_control_msg(usbvision->dev,
 1609 				     usb_sndctrlpipe(usbvision->dev, 1),
 1610 				     USBVISION_OP_CODE,
 1611 				     USB_DIR_OUT | USB_TYPE_VENDOR |
 1612 				     USB_RECIP_ENDPOINT, 0,
 1613 				     (__u16) USBVISION_SER_DAT1, value,
 1614 				     3, HZ);
 1615 		if (rc < 0)
 1616 			return rc;
 1617 		usbvision_write_reg(usbvision, USBVISION_SER_MODE, USBVISION_SER_MODE_SIO);
 1618 		/* write 3 bytes to the serial port using SIO mode */
 1619 		usbvision_write_reg(usbvision, USBVISION_SER_CONT, 3 | 0x10);
 1620 		usbvision_write_reg(usbvision, USBVISION_IOPIN_REG, 0);
 1621 		usbvision_write_reg(usbvision, USBVISION_SER_MODE, USBVISION_SER_MODE_SOFT);
 1622 		usbvision_write_reg(usbvision, USBVISION_IOPIN_REG, USBVISION_IO_2);
 1623 		usbvision_write_reg(usbvision, USBVISION_SER_MODE, USBVISION_SER_MODE_SOFT | USBVISION_CLK_OUT);
 1624 		usbvision_write_reg(usbvision, USBVISION_SER_MODE, USBVISION_SER_MODE_SOFT | USBVISION_DAT_IO);
 1625 		usbvision_write_reg(usbvision, USBVISION_SER_MODE, USBVISION_SER_MODE_SOFT | USBVISION_CLK_OUT | USBVISION_DAT_IO);
 1626 	}
 1627 
 1628 	return 0;
 1629 }
 1630 
 1631 /*
 1632  * usbvision_set_video_format()
 1633  *
 1634  */
 1635 static int usbvision_set_video_format(struct usb_usbvision *usbvision, int format)
 1636 {
 1637 	static const char proc[] = "usbvision_set_video_format";
 1638 	int rc;
 1639 	unsigned char value[2];
 1640 
 1641 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 1642 		return 0;
 1643 
 1644 	PDEBUG(DBG_FUNC, "isoc_mode %#02x", format);
 1645 
 1646 	if ((format != ISOC_MODE_YUV422)
 1647 	    && (format != ISOC_MODE_YUV420)
 1648 	    && (format != ISOC_MODE_COMPRESS)) {
 1649 		printk(KERN_ERR "usbvision: unknown video format %02x, using default YUV420",
 1650 		       format);
 1651 		format = ISOC_MODE_YUV420;
 1652 	}
 1653 	value[0] = 0x0A;  /* TODO: See the effect of the filter */
 1654 	value[1] = format; /* Sets the VO_MODE register which follows FILT_CONT */
 1655 	rc = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1),
 1656 			     USBVISION_OP_CODE,
 1657 			     USB_DIR_OUT | USB_TYPE_VENDOR |
 1658 			     USB_RECIP_ENDPOINT, 0,
 1659 			     (__u16) USBVISION_FILT_CONT, value, 2, HZ);
 1660 
 1661 	if (rc < 0) {
 1662 		printk(KERN_ERR "%s: ERROR=%d. USBVISION stopped - "
 1663 		       "reconnect or reload driver.\n", proc, rc);
 1664 	}
 1665 	usbvision->isoc_mode = format;
 1666 	return rc;
 1667 }
 1668 
 1669 /*
 1670  * usbvision_set_output()
 1671  *
 1672  */
 1673 
 1674 int usbvision_set_output(struct usb_usbvision *usbvision, int width,
 1675 			 int height)
 1676 {
 1677 	int err_code = 0;
 1678 	int usb_width, usb_height;
 1679 	unsigned int frame_rate = 0, frame_drop = 0;
 1680 	unsigned char value[4];
 1681 
 1682 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 1683 		return 0;
 1684 
 1685 	if (width > MAX_USB_WIDTH) {
 1686 		usb_width = width / 2;
 1687 		usbvision->stretch_width = 2;
 1688 	} else {
 1689 		usb_width = width;
 1690 		usbvision->stretch_width = 1;
 1691 	}
 1692 
 1693 	if (height > MAX_USB_HEIGHT) {
 1694 		usb_height = height / 2;
 1695 		usbvision->stretch_height = 2;
 1696 	} else {
 1697 		usb_height = height;
 1698 		usbvision->stretch_height = 1;
 1699 	}
 1700 
 1701 	RESTRICT_TO_RANGE(usb_width, MIN_FRAME_WIDTH, MAX_USB_WIDTH);
 1702 	usb_width &= ~(MIN_FRAME_WIDTH-1);
 1703 	RESTRICT_TO_RANGE(usb_height, MIN_FRAME_HEIGHT, MAX_USB_HEIGHT);
 1704 	usb_height &= ~(1);
 1705 
 1706 	PDEBUG(DBG_FUNC, "usb %dx%d; screen %dx%d; stretch %dx%d",
 1707 						usb_width, usb_height, width, height,
 1708 						usbvision->stretch_width, usbvision->stretch_height);
 1709 
 1710 	/* I'll not rewrite the same values */
 1711 	if ((usb_width != usbvision->curwidth) || (usb_height != usbvision->curheight)) {
 1712 		value[0] = usb_width & 0xff;		/* LSB */
 1713 		value[1] = (usb_width >> 8) & 0x03;	/* MSB */
 1714 		value[2] = usb_height & 0xff;		/* LSB */
 1715 		value[3] = (usb_height >> 8) & 0x03;	/* MSB */
 1716 
 1717 		err_code = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1),
 1718 			     USBVISION_OP_CODE,
 1719 			     USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT,
 1720 				 0, (__u16) USBVISION_LXSIZE_O, value, 4, HZ);
 1721 
 1722 		if (err_code < 0) {
 1723 			dev_err(&usbvision->dev->dev,
 1724 				"%s failed: error %d\n", __func__, err_code);
 1725 			return err_code;
 1726 		}
 1727 		usbvision->curwidth = usbvision->stretch_width * usb_width;
 1728 		usbvision->curheight = usbvision->stretch_height * usb_height;
 1729 	}
 1730 
 1731 	if (usbvision->isoc_mode == ISOC_MODE_YUV422)
 1732 		frame_rate = (usbvision->isoc_packet_size * 1000) / (usb_width * usb_height * 2);
 1733 	else if (usbvision->isoc_mode == ISOC_MODE_YUV420)
 1734 		frame_rate = (usbvision->isoc_packet_size * 1000) / ((usb_width * usb_height * 12) / 8);
 1735 	else
 1736 		frame_rate = FRAMERATE_MAX;
 1737 
 1738 	if (usbvision->tvnorm_id & V4L2_STD_625_50)
 1739 		frame_drop = frame_rate * 32 / 25 - 1;
 1740 	else if (usbvision->tvnorm_id & V4L2_STD_525_60)
 1741 		frame_drop = frame_rate * 32 / 30 - 1;
 1742 
 1743 	RESTRICT_TO_RANGE(frame_drop, FRAMERATE_MIN, FRAMERATE_MAX);
 1744 
 1745 	PDEBUG(DBG_FUNC, "frame_rate %d fps, frame_drop %d", frame_rate, frame_drop);
 1746 
 1747 	frame_drop = FRAMERATE_MAX;	/* We can allow the maximum here, because dropping is controlled */
 1748 
 1749 	if (usbvision_device_data[usbvision->dev_model].codec == CODEC_WEBCAM) {
 1750 		if (usbvision_device_data[usbvision->dev_model].video_norm == V4L2_STD_PAL)
 1751 			frame_drop = 25;
 1752 		else
 1753 			frame_drop = 30;
 1754 	}
 1755 
 1756 	/* frame_drop = 7; => frame_phase = 1, 5, 9, 13, 17, 21, 25, 0, 4, 8, ...
 1757 		=> frame_skip = 4;
 1758 		=> frame_rate = (7 + 1) * 25 / 32 = 200 / 32 = 6.25;
 1759 
 1760 	   frame_drop = 9; => frame_phase = 1, 5, 8, 11, 14, 17, 21, 24, 27, 1, 4, 8, ...
 1761 	    => frame_skip = 4, 3, 3, 3, 3, 4, 3, 3, 3, 3, 4, ...
 1762 		=> frame_rate = (9 + 1) * 25 / 32 = 250 / 32 = 7.8125;
 1763 	*/
 1764 	err_code = usbvision_write_reg(usbvision, USBVISION_FRM_RATE, frame_drop);
 1765 	return err_code;
 1766 }
 1767 
 1768 
 1769 /*
 1770  * usbvision_frames_alloc
 1771  * allocate the required frames
 1772  */
 1773 int usbvision_frames_alloc(struct usb_usbvision *usbvision, int number_of_frames)
 1774 {
 1775 	int i;
 1776 
 1777 	/* needs to be page aligned cause the buffers can be mapped individually! */
 1778 	usbvision->max_frame_size = PAGE_ALIGN(usbvision->curwidth *
 1779 						usbvision->curheight *
 1780 						usbvision->palette.bytes_per_pixel);
 1781 
 1782 	/* Try to do my best to allocate the frames the user want in the remaining memory */
 1783 	usbvision->num_frames = number_of_frames;
 1784 	while (usbvision->num_frames > 0) {
 1785 		usbvision->fbuf_size = usbvision->num_frames * usbvision->max_frame_size;
 1786 		usbvision->fbuf = usbvision_rvmalloc(usbvision->fbuf_size);
 1787 		if (usbvision->fbuf)
 1788 			break;
 1789 		usbvision->num_frames--;
 1790 	}
 1791 
 1792 	spin_lock_init(&usbvision->queue_lock);
 1793 	init_waitqueue_head(&usbvision->wait_frame);
 1794 	init_waitqueue_head(&usbvision->wait_stream);
 1795 
 1796 	/* Allocate all buffers */
 1797 	for (i = 0; i < usbvision->num_frames; i++) {
 1798 		usbvision->frame[i].index = i;
 1799 		usbvision->frame[i].grabstate = frame_state_unused;
 1800 		usbvision->frame[i].data = usbvision->fbuf +
 1801 			i * usbvision->max_frame_size;
 1802 		/*
 1803 		 * Set default sizes for read operation.
 1804 		 */
 1805 		usbvision->stretch_width = 1;
 1806 		usbvision->stretch_height = 1;
 1807 		usbvision->frame[i].width = usbvision->curwidth;
 1808 		usbvision->frame[i].height = usbvision->curheight;
 1809 		usbvision->frame[i].bytes_read = 0;
 1810 	}
 1811 	PDEBUG(DBG_FUNC, "allocated %d frames (%d bytes per frame)",
 1812 			usbvision->num_frames, usbvision->max_frame_size);
 1813 	return usbvision->num_frames;
 1814 }
 1815 
 1816 /*
 1817  * usbvision_frames_free
 1818  * frees memory allocated for the frames
 1819  */
 1820 void usbvision_frames_free(struct usb_usbvision *usbvision)
 1821 {
 1822 	/* Have to free all that memory */
 1823 	PDEBUG(DBG_FUNC, "free %d frames", usbvision->num_frames);
 1824 
 1825 	if (usbvision->fbuf != NULL) {
 1826 		usbvision_rvfree(usbvision->fbuf, usbvision->fbuf_size);
 1827 		usbvision->fbuf = NULL;
 1828 
 1829 		usbvision->num_frames = 0;
 1830 	}
 1831 }
 1832 /*
 1833  * usbvision_empty_framequeues()
 1834  * prepare queues for incoming and outgoing frames
 1835  */
 1836 void usbvision_empty_framequeues(struct usb_usbvision *usbvision)
 1837 {
 1838 	u32 i;
 1839 
 1840 	INIT_LIST_HEAD(&(usbvision->inqueue));
 1841 	INIT_LIST_HEAD(&(usbvision->outqueue));
 1842 
 1843 	for (i = 0; i < USBVISION_NUMFRAMES; i++) {
 1844 		usbvision->frame[i].grabstate = frame_state_unused;
 1845 		usbvision->frame[i].bytes_read = 0;
 1846 	}
 1847 }
 1848 
 1849 /*
 1850  * usbvision_stream_interrupt()
 1851  * stops streaming
 1852  */
 1853 int usbvision_stream_interrupt(struct usb_usbvision *usbvision)
 1854 {
 1855 	int ret = 0;
 1856 
 1857 	/* stop reading from the device */
 1858 
 1859 	usbvision->streaming = stream_interrupt;
 1860 	ret = wait_event_timeout(usbvision->wait_stream,
 1861 				 (usbvision->streaming == stream_idle),
 1862 				 msecs_to_jiffies(USBVISION_NUMSBUF*USBVISION_URB_FRAMES));
 1863 	return ret;
 1864 }
 1865 
 1866 /*
 1867  * usbvision_set_compress_params()
 1868  *
 1869  */
 1870 
 1871 static int usbvision_set_compress_params(struct usb_usbvision *usbvision)
 1872 {
 1873 	static const char proc[] = "usbvision_set_compresion_params: ";
 1874 	int rc;
 1875 	unsigned char value[6];
 1876 
 1877 	value[0] = 0x0F;    /* Intra-Compression cycle */
 1878 	value[1] = 0x01;    /* Reg.45 one line per strip */
 1879 	value[2] = 0x00;    /* Reg.46 Force intra mode on all new frames */
 1880 	value[3] = 0x00;    /* Reg.47 FORCE_UP <- 0 normal operation (not force) */
 1881 	value[4] = 0xA2;    /* Reg.48 BUF_THR I'm not sure if this does something in not compressed mode. */
 1882 	value[5] = 0x00;    /* Reg.49 DVI_YUV This has nothing to do with compression */
 1883 
 1884 	/* catched values for NT1004 */
 1885 	/* value[0] = 0xFF; Never apply intra mode automatically */
 1886 	/* value[1] = 0xF1; Use full frame height for virtual strip width; One line per strip */
 1887 	/* value[2] = 0x01; Force intra mode on all new frames */
 1888 	/* value[3] = 0x00; Strip size 400 Bytes; do not force up */
 1889 	/* value[4] = 0xA2; */
 1890 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 1891 		return 0;
 1892 
 1893 	rc = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1),
 1894 			     USBVISION_OP_CODE,
 1895 			     USB_DIR_OUT | USB_TYPE_VENDOR |
 1896 			     USB_RECIP_ENDPOINT, 0,
 1897 			     (__u16) USBVISION_INTRA_CYC, value, 5, HZ);
 1898 
 1899 	if (rc < 0) {
 1900 		printk(KERN_ERR "%sERROR=%d. USBVISION stopped - "
 1901 		       "reconnect or reload driver.\n", proc, rc);
 1902 		return rc;
 1903 	}
 1904 
 1905 	if (usbvision->bridge_type == BRIDGE_NT1004) {
 1906 		value[0] =  20; /* PCM Threshold 1 */
 1907 		value[1] =  12; /* PCM Threshold 2 */
 1908 		value[2] = 255; /* Distortion Threshold inter */
 1909 		value[3] = 255; /* Distortion Threshold intra */
 1910 		value[4] =  43; /* Max Distortion inter */
 1911 		value[5] =  43; /* Max Distortion intra */
 1912 	} else {
 1913 		value[0] =  20; /* PCM Threshold 1 */
 1914 		value[1] =  12; /* PCM Threshold 2 */
 1915 		value[2] = 255; /* Distortion Threshold d7-d0 */
 1916 		value[3] =   0; /* Distortion Threshold d11-d8 */
 1917 		value[4] =  43; /* Max Distortion d7-d0 */
 1918 		value[5] =   0; /* Max Distortion d8 */
 1919 	}
 1920 
 1921 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 1922 		return 0;
 1923 
 1924 	rc = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1),
 1925 			     USBVISION_OP_CODE,
 1926 			     USB_DIR_OUT | USB_TYPE_VENDOR |
 1927 			     USB_RECIP_ENDPOINT, 0,
 1928 			     (__u16) USBVISION_PCM_THR1, value, 6, HZ);
 1929 
 1930 	if (rc < 0) {
 1931 		printk(KERN_ERR "%sERROR=%d. USBVISION stopped - "
 1932 		       "reconnect or reload driver.\n", proc, rc);
 1933 	}
 1934 	return rc;
 1935 }
 1936 
 1937 
 1938 /*
 1939  * usbvision_set_input()
 1940  *
 1941  * Set the input (saa711x, ...) size x y and other misc input params
 1942  * I've no idea if this parameters are right
 1943  *
 1944  */
 1945 int usbvision_set_input(struct usb_usbvision *usbvision)
 1946 {
 1947 	static const char proc[] = "usbvision_set_input: ";
 1948 	int rc;
 1949 	unsigned char value[8];
 1950 	unsigned char dvi_yuv_value;
 1951 
 1952 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 1953 		return 0;
 1954 
 1955 	/* Set input format expected from decoder*/
 1956 	if (usbvision_device_data[usbvision->dev_model].vin_reg1_override) {
 1957 		value[0] = usbvision_device_data[usbvision->dev_model].vin_reg1;
 1958 	} else if (usbvision_device_data[usbvision->dev_model].codec == CODEC_SAA7113) {
 1959 		/* SAA7113 uses 8 bit output */
 1960 		value[0] = USBVISION_8_422_SYNC;
 1961 	} else {
 1962 		/* I'm sure only about d2-d0 [010] 16 bit 4:2:2 usin sync pulses
 1963 		 * as that is how saa7111 is configured */
 1964 		value[0] = USBVISION_16_422_SYNC;
 1965 		/* | USBVISION_VSNC_POL | USBVISION_VCLK_POL);*/
 1966 	}
 1967 
 1968 	rc = usbvision_write_reg(usbvision, USBVISION_VIN_REG1, value[0]);
 1969 	if (rc < 0) {
 1970 		printk(KERN_ERR "%sERROR=%d. USBVISION stopped - "
 1971 		       "reconnect or reload driver.\n", proc, rc);
 1972 		return rc;
 1973 	}
 1974 
 1975 
 1976 	if (usbvision->tvnorm_id & V4L2_STD_PAL) {
 1977 		value[0] = 0xC0;
 1978 		value[1] = 0x02;	/* 0x02C0 -> 704 Input video line length */
 1979 		value[2] = 0x20;
 1980 		value[3] = 0x01;	/* 0x0120 -> 288 Input video n. of lines */
 1981 		value[4] = 0x60;
 1982 		value[5] = 0x00;	/* 0x0060 -> 96 Input video h offset */
 1983 		value[6] = 0x16;
 1984 		value[7] = 0x00;	/* 0x0016 -> 22 Input video v offset */
 1985 	} else if (usbvision->tvnorm_id & V4L2_STD_SECAM) {
 1986 		value[0] = 0xC0;
 1987 		value[1] = 0x02;	/* 0x02C0 -> 704 Input video line length */
 1988 		value[2] = 0x20;
 1989 		value[3] = 0x01;	/* 0x0120 -> 288 Input video n. of lines */
 1990 		value[4] = 0x01;
 1991 		value[5] = 0x00;	/* 0x0001 -> 01 Input video h offset */
 1992 		value[6] = 0x01;
 1993 		value[7] = 0x00;	/* 0x0001 -> 01 Input video v offset */
 1994 	} else {	/* V4L2_STD_NTSC */
 1995 		value[0] = 0xD0;
 1996 		value[1] = 0x02;	/* 0x02D0 -> 720 Input video line length */
 1997 		value[2] = 0xF0;
 1998 		value[3] = 0x00;	/* 0x00F0 -> 240 Input video number of lines */
 1999 		value[4] = 0x50;
 2000 		value[5] = 0x00;	/* 0x0050 -> 80 Input video h offset */
 2001 		value[6] = 0x10;
 2002 		value[7] = 0x00;	/* 0x0010 -> 16 Input video v offset */
 2003 	}
 2004 
 2005 	/* webcam is only 480 pixels wide, both PAL and NTSC version */
 2006 	if (usbvision_device_data[usbvision->dev_model].codec == CODEC_WEBCAM) {
 2007 		value[0] = 0xe0;
 2008 		value[1] = 0x01;	/* 0x01E0 -> 480 Input video line length */
 2009 	}
 2010 
 2011 	if (usbvision_device_data[usbvision->dev_model].x_offset >= 0) {
 2012 		value[4] = usbvision_device_data[usbvision->dev_model].x_offset & 0xff;
 2013 		value[5] = (usbvision_device_data[usbvision->dev_model].x_offset & 0x0300) >> 8;
 2014 	}
 2015 
 2016 	if (adjust_x_offset != -1) {
 2017 		value[4] = adjust_x_offset & 0xff;
 2018 		value[5] = (adjust_x_offset & 0x0300) >> 8;
 2019 	}
 2020 
 2021 	if (usbvision_device_data[usbvision->dev_model].y_offset >= 0) {
 2022 		value[6] = usbvision_device_data[usbvision->dev_model].y_offset & 0xff;
 2023 		value[7] = (usbvision_device_data[usbvision->dev_model].y_offset & 0x0300) >> 8;
 2024 	}
 2025 
 2026 	if (adjust_y_offset != -1) {
 2027 		value[6] = adjust_y_offset & 0xff;
 2028 		value[7] = (adjust_y_offset & 0x0300) >> 8;
 2029 	}
 2030 
 2031 	rc = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1),
 2032 			     USBVISION_OP_CODE,	/* USBVISION specific code */
 2033 			     USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT, 0,
 2034 			     (__u16) USBVISION_LXSIZE_I, value, 8, HZ);
 2035 	if (rc < 0) {
 2036 		printk(KERN_ERR "%sERROR=%d. USBVISION stopped - "
 2037 		       "reconnect or reload driver.\n", proc, rc);
 2038 		return rc;
 2039 	}
 2040 
 2041 
 2042 	dvi_yuv_value = 0x00;	/* U comes after V, Ya comes after U/V, Yb comes after Yb */
 2043 
 2044 	if (usbvision_device_data[usbvision->dev_model].dvi_yuv_override) {
 2045 		dvi_yuv_value = usbvision_device_data[usbvision->dev_model].dvi_yuv;
 2046 	} else if (usbvision_device_data[usbvision->dev_model].codec == CODEC_SAA7113) {
 2047 		/* This changes as the fine sync control changes. Further investigation necessary */
 2048 		dvi_yuv_value = 0x06;
 2049 	}
 2050 
 2051 	return usbvision_write_reg(usbvision, USBVISION_DVI_YUV, dvi_yuv_value);
 2052 }
 2053 
 2054 
 2055 /*
 2056  * usbvision_set_dram_settings()
 2057  *
 2058  * Set the buffer address needed by the usbvision dram to operate
 2059  * This values has been taken with usbsnoop.
 2060  *
 2061  */
 2062 
 2063 static int usbvision_set_dram_settings(struct usb_usbvision *usbvision)
 2064 {
 2065 	int rc;
 2066 	unsigned char value[8];
 2067 
 2068 	if (usbvision->isoc_mode == ISOC_MODE_COMPRESS) {
 2069 		value[0] = 0x42;
 2070 		value[1] = 0x71;
 2071 		value[2] = 0xff;
 2072 		value[3] = 0x00;
 2073 		value[4] = 0x98;
 2074 		value[5] = 0xe0;
 2075 		value[6] = 0x71;
 2076 		value[7] = 0xff;
 2077 		/* UR:  0x0E200-0x3FFFF = 204288 Words (1 Word = 2 Byte) */
 2078 		/* FDL: 0x00000-0x0E099 =  57498 Words */
 2079 		/* VDW: 0x0E3FF-0x3FFFF */
 2080 	} else {
 2081 		value[0] = 0x42;
 2082 		value[1] = 0x00;
 2083 		value[2] = 0xff;
 2084 		value[3] = 0x00;
 2085 		value[4] = 0x00;
 2086 		value[5] = 0x00;
 2087 		value[6] = 0x00;
 2088 		value[7] = 0xff;
 2089 	}
 2090 	/* These are the values of the address of the video buffer,
 2091 	 * they have to be loaded into the USBVISION_DRM_PRM1-8
 2092 	 *
 2093 	 * Start address of video output buffer for read:	drm_prm1-2 -> 0x00000
 2094 	 * End address of video output buffer for read:		drm_prm1-3 -> 0x1ffff
 2095 	 * Start address of video frame delay buffer:		drm_prm1-4 -> 0x20000
 2096 	 *    Only used in compressed mode
 2097 	 * End address of video frame delay buffer:		drm_prm1-5-6 -> 0x3ffff
 2098 	 *    Only used in compressed mode
 2099 	 * Start address of video output buffer for write:	drm_prm1-7 -> 0x00000
 2100 	 * End address of video output buffer for write:	drm_prm1-8 -> 0x1ffff
 2101 	 */
 2102 
 2103 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 2104 		return 0;
 2105 
 2106 	rc = usb_control_msg(usbvision->dev, usb_sndctrlpipe(usbvision->dev, 1),
 2107 			     USBVISION_OP_CODE,	/* USBVISION specific code */
 2108 			     USB_DIR_OUT | USB_TYPE_VENDOR |
 2109 			     USB_RECIP_ENDPOINT, 0,
 2110 			     (__u16) USBVISION_DRM_PRM1, value, 8, HZ);
 2111 
 2112 	if (rc < 0) {
 2113 		dev_err(&usbvision->dev->dev, "%s: ERROR=%d\n", __func__, rc);
 2114 		return rc;
 2115 	}
 2116 
 2117 	/* Restart the video buffer logic */
 2118 	rc = usbvision_write_reg(usbvision, USBVISION_DRM_CONT, USBVISION_RES_UR |
 2119 				   USBVISION_RES_FDL | USBVISION_RES_VDW);
 2120 	if (rc < 0)
 2121 		return rc;
 2122 	rc = usbvision_write_reg(usbvision, USBVISION_DRM_CONT, 0x00);
 2123 
 2124 	return rc;
 2125 }
 2126 
 2127 /*
 2128  * ()
 2129  *
 2130  * Power on the device, enables suspend-resume logic
 2131  * &  reset the isoc End-Point
 2132  *
 2133  */
 2134 
 2135 int usbvision_power_on(struct usb_usbvision *usbvision)
 2136 {
 2137 	int err_code = 0;
 2138 
 2139 	PDEBUG(DBG_FUNC, "");
 2140 
 2141 	usbvision_write_reg(usbvision, USBVISION_PWR_REG, USBVISION_SSPND_EN);
 2142 	usbvision_write_reg(usbvision, USBVISION_PWR_REG,
 2143 			USBVISION_SSPND_EN | USBVISION_RES2);
 2144 
 2145 	if (usbvision_device_data[usbvision->dev_model].codec == CODEC_WEBCAM) {
 2146 		usbvision_write_reg(usbvision, USBVISION_VIN_REG1,
 2147 				USBVISION_16_422_SYNC | USBVISION_HVALID_PO);
 2148 		usbvision_write_reg(usbvision, USBVISION_VIN_REG2,
 2149 				USBVISION_NOHVALID | USBVISION_KEEP_BLANK);
 2150 	}
 2151 	usbvision_write_reg(usbvision, USBVISION_PWR_REG,
 2152 			USBVISION_SSPND_EN | USBVISION_PWR_VID);
 2153 	mdelay(10);
 2154 	err_code = usbvision_write_reg(usbvision, USBVISION_PWR_REG,
 2155 			USBVISION_SSPND_EN | USBVISION_PWR_VID | USBVISION_RES2);
 2156 	if (err_code == 1)
 2157 		usbvision->power = 1;
 2158 	PDEBUG(DBG_FUNC, "%s: err_code %d", (err_code < 0) ? "ERROR" : "power is on", err_code);
 2159 	return err_code;
 2160 }
 2161 
 2162 
 2163 /*
 2164  * usbvision timer stuff
 2165  */
 2166 
 2167 /* to call usbvision_power_off from task queue */
 2168 static void call_usbvision_power_off(struct work_struct *work)
 2169 {
 2170 	struct usb_usbvision *usbvision = container_of(work, struct usb_usbvision, power_off_work);
 2171 
 2172 	PDEBUG(DBG_FUNC, "");
 2173 	if (mutex_lock_interruptible(&usbvision->v4l2_lock))
 2174 		return;
 2175 
 2176 	if (usbvision->user == 0) {
 2177 		usbvision_i2c_unregister(usbvision);
 2178 
 2179 		usbvision_power_off(usbvision);
 2180 		usbvision->initialized = 0;
 2181 	}
 2182 	mutex_unlock(&usbvision->v4l2_lock);
 2183 }
 2184 
 2185 static void usbvision_power_off_timer(unsigned long data)
 2186 {
 2187 	struct usb_usbvision *usbvision = (void *)data;
 2188 
 2189 	PDEBUG(DBG_FUNC, "");
 2190 	del_timer(&usbvision->power_off_timer);
 2191 	INIT_WORK(&usbvision->power_off_work, call_usbvision_power_off);
 2192 	(void) schedule_work(&usbvision->power_off_work);
 2193 }
 2194 
 2195 void usbvision_init_power_off_timer(struct usb_usbvision *usbvision)
 2196 {
 2197 	setup_timer(&usbvision->power_off_timer, usbvision_power_off_timer,
 2198 		    (unsigned long)usbvision);
 2199 }
 2200 
 2201 void usbvision_set_power_off_timer(struct usb_usbvision *usbvision)
 2202 {
 2203 	mod_timer(&usbvision->power_off_timer, jiffies + USBVISION_POWEROFF_TIME);
 2204 }
 2205 
 2206 void usbvision_reset_power_off_timer(struct usb_usbvision *usbvision)
 2207 {
 2208 	if (timer_pending(&usbvision->power_off_timer))
 2209 		del_timer(&usbvision->power_off_timer);
 2210 }
 2211 
 2212 /*
 2213  * usbvision_begin_streaming()
 2214  * Sure you have to put bit 7 to 0, if not incoming frames are droped, but no
 2215  * idea about the rest
 2216  */
 2217 int usbvision_begin_streaming(struct usb_usbvision *usbvision)
 2218 {
 2219 	if (usbvision->isoc_mode == ISOC_MODE_COMPRESS)
 2220 		usbvision_init_compression(usbvision);
 2221 	return usbvision_write_reg(usbvision, USBVISION_VIN_REG2,
 2222 		USBVISION_NOHVALID | usbvision->vin_reg2_preset);
 2223 }
 2224 
 2225 /*
 2226  * usbvision_restart_isoc()
 2227  * Not sure yet if touching here PWR_REG make loose the config
 2228  */
 2229 
 2230 int usbvision_restart_isoc(struct usb_usbvision *usbvision)
 2231 {
 2232 	int ret;
 2233 
 2234 	ret = usbvision_write_reg(usbvision, USBVISION_PWR_REG,
 2235 			      USBVISION_SSPND_EN | USBVISION_PWR_VID);
 2236 	if (ret < 0)
 2237 		return ret;
 2238 	ret = usbvision_write_reg(usbvision, USBVISION_PWR_REG,
 2239 			      USBVISION_SSPND_EN | USBVISION_PWR_VID |
 2240 			      USBVISION_RES2);
 2241 	if (ret < 0)
 2242 		return ret;
 2243 	ret = usbvision_write_reg(usbvision, USBVISION_VIN_REG2,
 2244 			      USBVISION_KEEP_BLANK | USBVISION_NOHVALID |
 2245 				  usbvision->vin_reg2_preset);
 2246 	if (ret < 0)
 2247 		return ret;
 2248 
 2249 	/* TODO: schedule timeout */
 2250 	while ((usbvision_read_reg(usbvision, USBVISION_STATUS_REG) & 0x01) != 1)
 2251 		;
 2252 
 2253 	return 0;
 2254 }
 2255 
 2256 int usbvision_audio_off(struct usb_usbvision *usbvision)
 2257 {
 2258 	if (usbvision_write_reg(usbvision, USBVISION_IOPIN_REG, USBVISION_AUDIO_MUTE) < 0) {
 2259 		printk(KERN_ERR "usbvision_audio_off: can't write reg\n");
 2260 		return -1;
 2261 	}
 2262 	usbvision->audio_mute = 0;
 2263 	usbvision->audio_channel = USBVISION_AUDIO_MUTE;
 2264 	return 0;
 2265 }
 2266 
 2267 int usbvision_set_audio(struct usb_usbvision *usbvision, int audio_channel)
 2268 {
 2269 	if (!usbvision->audio_mute) {
 2270 		if (usbvision_write_reg(usbvision, USBVISION_IOPIN_REG, audio_channel) < 0) {
 2271 			printk(KERN_ERR "usbvision_set_audio: can't write iopin register for audio switching\n");
 2272 			return -1;
 2273 		}
 2274 	}
 2275 	usbvision->audio_channel = audio_channel;
 2276 	return 0;
 2277 }
 2278 
 2279 int usbvision_setup(struct usb_usbvision *usbvision, int format)
 2280 {
 2281 	if (usbvision_device_data[usbvision->dev_model].codec == CODEC_WEBCAM)
 2282 		usbvision_init_webcam(usbvision);
 2283 	usbvision_set_video_format(usbvision, format);
 2284 	usbvision_set_dram_settings(usbvision);
 2285 	usbvision_set_compress_params(usbvision);
 2286 	usbvision_set_input(usbvision);
 2287 	usbvision_set_output(usbvision, MAX_USB_WIDTH, MAX_USB_HEIGHT);
 2288 	usbvision_restart_isoc(usbvision);
 2289 
 2290 	/* cosas del PCM */
 2291 	return USBVISION_IS_OPERATIONAL(usbvision);
 2292 }
 2293 
 2294 int usbvision_set_alternate(struct usb_usbvision *dev)
 2295 {
 2296 	int err_code, prev_alt = dev->iface_alt;
 2297 	int i;
 2298 
 2299 	dev->iface_alt = 0;
 2300 	for (i = 0; i < dev->num_alt; i++)
 2301 		if (dev->alt_max_pkt_size[i] > dev->alt_max_pkt_size[dev->iface_alt])
 2302 			dev->iface_alt = i;
 2303 
 2304 	if (dev->iface_alt != prev_alt) {
 2305 		dev->isoc_packet_size = dev->alt_max_pkt_size[dev->iface_alt];
 2306 		PDEBUG(DBG_FUNC, "setting alternate %d with max_packet_size=%u",
 2307 				dev->iface_alt, dev->isoc_packet_size);
 2308 		err_code = usb_set_interface(dev->dev, dev->iface, dev->iface_alt);
 2309 		if (err_code < 0) {
 2310 			dev_err(&dev->dev->dev,
 2311 				"cannot change alternate number to %d (error=%i)\n",
 2312 					dev->iface_alt, err_code);
 2313 			return err_code;
 2314 		}
 2315 	}
 2316 
 2317 	PDEBUG(DBG_ISOC, "ISO Packet Length:%d", dev->isoc_packet_size);
 2318 
 2319 	return 0;
 2320 }
 2321 
 2322 /*
 2323  * usbvision_init_isoc()
 2324  *
 2325  */
 2326 int usbvision_init_isoc(struct usb_usbvision *usbvision)
 2327 {
 2328 	struct usb_device *dev = usbvision->dev;
 2329 	int buf_idx, err_code, reg_value;
 2330 	int sb_size;
 2331 
 2332 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 2333 		return -EFAULT;
 2334 
 2335 	usbvision->cur_frame = NULL;
 2336 	scratch_reset(usbvision);
 2337 
 2338 	/* Alternate interface 1 is is the biggest frame size */
 2339 	err_code = usbvision_set_alternate(usbvision);
 2340 	if (err_code < 0) {
 2341 		usbvision->last_error = err_code;
 2342 		return -EBUSY;
 2343 	}
 2344 	sb_size = USBVISION_URB_FRAMES * usbvision->isoc_packet_size;
 2345 
 2346 	reg_value = (16 - usbvision_read_reg(usbvision,
 2347 					    USBVISION_ALTER_REG)) & 0x0F;
 2348 
 2349 	usbvision->usb_bandwidth = reg_value >> 1;
 2350 	PDEBUG(DBG_ISOC, "USB Bandwidth Usage: %dMbit/Sec",
 2351 	       usbvision->usb_bandwidth);
 2352 
 2353 
 2354 
 2355 	/* We double buffer the Iso lists */
 2356 
 2357 	for (buf_idx = 0; buf_idx < USBVISION_NUMSBUF; buf_idx++) {
 2358 		int j, k;
 2359 		struct urb *urb;
 2360 
 2361 		urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL);
 2362 		if (urb == NULL) {
 2363 			dev_err(&usbvision->dev->dev,
 2364 				"%s: usb_alloc_urb() failed\n", __func__);
 2365 			return -ENOMEM;
 2366 		}
 2367 		usbvision->sbuf[buf_idx].urb = urb;
 2368 		usbvision->sbuf[buf_idx].data =
 2369 			usb_alloc_coherent(usbvision->dev,
 2370 					   sb_size,
 2371 					   GFP_KERNEL,
 2372 					   &urb->transfer_dma);
 2373 		urb->dev = dev;
 2374 		urb->context = usbvision;
 2375 		urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp);
 2376 		urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP;
 2377 		urb->interval = 1;
 2378 		urb->transfer_buffer = usbvision->sbuf[buf_idx].data;
 2379 		urb->complete = usbvision_isoc_irq;
 2380 		urb->number_of_packets = USBVISION_URB_FRAMES;
 2381 		urb->transfer_buffer_length =
 2382 		    usbvision->isoc_packet_size * USBVISION_URB_FRAMES;
 2383 		for (j = k = 0; j < USBVISION_URB_FRAMES; j++,
 2384 		     k += usbvision->isoc_packet_size) {
 2385 			urb->iso_frame_desc[j].offset = k;
 2386 			urb->iso_frame_desc[j].length =
 2387 				usbvision->isoc_packet_size;
 2388 		}
 2389 	}
 2390 
 2391 	/* Submit all URBs */
 2392 	for (buf_idx = 0; buf_idx < USBVISION_NUMSBUF; buf_idx++) {
 2393 			err_code = usb_submit_urb(usbvision->sbuf[buf_idx].urb,
 2394 						 GFP_KERNEL);
 2395 		if (err_code) {
 2396 			dev_err(&usbvision->dev->dev,
 2397 				"%s: usb_submit_urb(%d) failed: error %d\n",
 2398 					__func__, buf_idx, err_code);
 2399 		}
 2400 	}
 2401 
 2402 	usbvision->streaming = stream_idle;
 2403 	PDEBUG(DBG_ISOC, "%s: streaming=1 usbvision->video_endp=$%02x",
 2404 	       __func__,
 2405 	       usbvision->video_endp);
 2406 	return 0;
 2407 }
 2408 
 2409 /*
 2410  * usbvision_stop_isoc()
 2411  *
 2412  * This procedure stops streaming and deallocates URBs. Then it
 2413  * activates zero-bandwidth alt. setting of the video interface.
 2414  *
 2415  */
 2416 void usbvision_stop_isoc(struct usb_usbvision *usbvision)
 2417 {
 2418 	int buf_idx, err_code, reg_value;
 2419 	int sb_size = USBVISION_URB_FRAMES * usbvision->isoc_packet_size;
 2420 
 2421 	if ((usbvision->streaming == stream_off) || (usbvision->dev == NULL))
 2422 		return;
 2423 
 2424 	/* Unschedule all of the iso td's */
 2425 	for (buf_idx = 0; buf_idx < USBVISION_NUMSBUF; buf_idx++) {
 2426 		usb_kill_urb(usbvision->sbuf[buf_idx].urb);
 2427 		if (usbvision->sbuf[buf_idx].data) {
 2428 			usb_free_coherent(usbvision->dev,
 2429 					  sb_size,
 2430 					  usbvision->sbuf[buf_idx].data,
 2431 					  usbvision->sbuf[buf_idx].urb->transfer_dma);
 2432 		}
 2433 		usb_free_urb(usbvision->sbuf[buf_idx].urb);
 2434 		usbvision->sbuf[buf_idx].urb = NULL;
 2435 	}
 2436 
 2437 	PDEBUG(DBG_ISOC, "%s: streaming=stream_off\n", __func__);
 2438 	usbvision->streaming = stream_off;
 2439 
 2440 	if (!usbvision->remove_pending) {
 2441 		/* Set packet size to 0 */
 2442 		usbvision->iface_alt = 0;
 2443 		err_code = usb_set_interface(usbvision->dev, usbvision->iface,
 2444 					    usbvision->iface_alt);
 2445 		if (err_code < 0) {
 2446 			dev_err(&usbvision->dev->dev,
 2447 				"%s: usb_set_interface() failed: error %d\n",
 2448 					__func__, err_code);
 2449 			usbvision->last_error = err_code;
 2450 		}
 2451 		reg_value = (16-usbvision_read_reg(usbvision, USBVISION_ALTER_REG)) & 0x0F;
 2452 		usbvision->isoc_packet_size =
 2453 			(reg_value == 0) ? 0 : (reg_value * 64) - 1;
 2454 		PDEBUG(DBG_ISOC, "ISO Packet Length:%d",
 2455 		       usbvision->isoc_packet_size);
 2456 
 2457 		usbvision->usb_bandwidth = reg_value >> 1;
 2458 		PDEBUG(DBG_ISOC, "USB Bandwidth Usage: %dMbit/Sec",
 2459 		       usbvision->usb_bandwidth);
 2460 	}
 2461 }
 2462 
 2463 int usbvision_muxsel(struct usb_usbvision *usbvision, int channel)
 2464 {
 2465 	/* inputs #0 and #3 are constant for every SAA711x. */
 2466 	/* inputs #1 and #2 are variable for SAA7111 and SAA7113 */
 2467 	int mode[4] = { SAA7115_COMPOSITE0, 0, 0, SAA7115_COMPOSITE3 };
 2468 	int audio[] = { 1, 0, 0, 0 };
 2469 	/* channel 0 is TV with audiochannel 1 (tuner mono) */
 2470 	/* channel 1 is Composite with audio channel 0 (line in) */
 2471 	/* channel 2 is S-Video with audio channel 0 (line in) */
 2472 	/* channel 3 is additional video inputs to the device with audio channel 0 (line in) */
 2473 
 2474 	RESTRICT_TO_RANGE(channel, 0, usbvision->video_inputs);
 2475 	usbvision->ctl_input = channel;
 2476 
 2477 	/* set the new channel */
 2478 	/* Regular USB TV Tuners -> channel: 0 = Television, 1 = Composite, 2 = S-Video */
 2479 	/* Four video input devices -> channel: 0 = Chan White, 1 = Chan Green, 2 = Chan Yellow, 3 = Chan Red */
 2480 
 2481 	switch (usbvision_device_data[usbvision->dev_model].codec) {
 2482 	case CODEC_SAA7113:
 2483 		mode[1] = SAA7115_COMPOSITE2;
 2484 		if (switch_svideo_input) {
 2485 			/* To handle problems with S-Video Input for
 2486 			 * some devices.  Use switch_svideo_input
 2487 			 * parameter when loading the module.*/
 2488 			mode[2] = SAA7115_COMPOSITE1;
 2489 		} else {
 2490 			mode[2] = SAA7115_SVIDEO1;
 2491 		}
 2492 		break;
 2493 	case CODEC_SAA7111:
 2494 	default:
 2495 		/* modes for saa7111 */
 2496 		mode[1] = SAA7115_COMPOSITE1;
 2497 		mode[2] = SAA7115_SVIDEO1;
 2498 		break;
 2499 	}
 2500 	call_all(usbvision, video, s_routing, mode[channel], 0, 0);
 2501 	usbvision_set_audio(usbvision, audio[channel]);
 2502 	return 0;
 2503 }                 1 
    2 /*
    3  * USB USBVISION Video device driver 0.9.10
    4  *
    5  *
    6  *
    7  * Copyright (c) 1999-2005 Joerg Heckenbach <joerg@heckenbach-aw.de>
    8  *
    9  * This module is part of usbvision driver project.
   10  *
   11  * This program is free software; you can redistribute it and/or modify
   12  * it under the terms of the GNU General Public License as published by
   13  * the Free Software Foundation; either version 2 of the License, or
   14  * (at your option) any later version.
   15  *
   16  * This program is distributed in the hope that it will be useful,
   17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   19  * GNU General Public License for more details.
   20  *
   21  * You should have received a copy of the GNU General Public License
   22  * along with this program; if not, write to the Free Software
   23  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   24  *
   25  * Let's call the version 0.... until compression decoding is completely
   26  * implemented.
   27  *
   28  * This driver is written by Jose Ignacio Gijon and Joerg Heckenbach.
   29  * It was based on USB CPiA driver written by Peter Pregler,
   30  * Scott J. Bertin and Johannes Erdfelt
   31  * Ideas are taken from bttv driver by Ralph Metzler, Marcus Metzler &
   32  * Gerd Knorr and zoran 36120/36125 driver by Pauline Middelink
   33  * Updates to driver completed by Dwaine P. Garden
   34  *
   35  *
   36  * TODO:
   37  *     - use submit_urb for all setup packets
   38  *     - Fix memory settings for nt1004. It is 4 times as big as the
   39  *       nt1003 memory.
   40  *     - Add audio on endpoint 3 for nt1004 chip.
   41  *         Seems impossible, needs a codec interface.  Which one?
   42  *     - Clean up the driver.
   43  *     - optimization for performance.
   44  *     - Add Videotext capability (VBI).  Working on it.....
   45  *     - Check audio for other devices
   46  *
   47  */
   48 
   49 #include <linux/kernel.h>
   50 #include <linux/list.h>
   51 #include <linux/timer.h>
   52 #include <linux/slab.h>
   53 #include <linux/mm.h>
   54 #include <linux/highmem.h>
   55 #include <linux/vmalloc.h>
   56 #include <linux/module.h>
   57 #include <linux/init.h>
   58 #include <linux/spinlock.h>
   59 #include <linux/io.h>
   60 #include <linux/videodev2.h>
   61 #include <linux/i2c.h>
   62 
   63 #include <media/saa7115.h>
   64 #include <media/v4l2-common.h>
   65 #include <media/v4l2-ioctl.h>
   66 #include <media/tuner.h>
   67 
   68 #include <linux/workqueue.h>
   69 
   70 #include "usbvision.h"
   71 #include "usbvision-cards.h"
   72 
   73 #define DRIVER_AUTHOR					\
   74 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
   75 	"Dwaine Garden <DwaineGarden@rogers.com>"
   76 #define DRIVER_NAME "usbvision"
   77 #define DRIVER_ALIAS "USBVision"
   78 #define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
   79 #define DRIVER_LICENSE "GPL"
   80 #define USBVISION_VERSION_STRING "0.9.11"
   81 
   82 #define	ENABLE_HEXDUMP	0	/* Enable if you need it */
   83 
   84 
   85 #ifdef USBVISION_DEBUG
   86 	#define PDEBUG(level, fmt, args...) { \
   87 		if (video_debug & (level)) \
   88 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
   89 				__func__, __LINE__ , ## args); \
   90 	}
   91 #else
   92 	#define PDEBUG(level, fmt, args...) do {} while (0)
   93 #endif
   94 
   95 #define DBG_IO		(1 << 1)
   96 #define DBG_PROBE	(1 << 2)
   97 #define DBG_MMAP	(1 << 3)
   98 
   99 /* String operations */
  100 #define rmspace(str)	while (*str == ' ') str++;
  101 #define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
  102 
  103 
  104 /* sequential number of usbvision device */
  105 static int usbvision_nr;
  106 
  107 static struct usbvision_v4l2_format_st usbvision_v4l2_format[] = {
  108 	{ 1, 1,  8, V4L2_PIX_FMT_GREY    , "GREY" },
  109 	{ 1, 2, 16, V4L2_PIX_FMT_RGB565  , "RGB565" },
  110 	{ 1, 3, 24, V4L2_PIX_FMT_RGB24   , "RGB24" },
  111 	{ 1, 4, 32, V4L2_PIX_FMT_RGB32   , "RGB32" },
  112 	{ 1, 2, 16, V4L2_PIX_FMT_RGB555  , "RGB555" },
  113 	{ 1, 2, 16, V4L2_PIX_FMT_YUYV    , "YUV422" },
  114 	{ 1, 2, 12, V4L2_PIX_FMT_YVU420  , "YUV420P" }, /* 1.5 ! */
  115 	{ 1, 2, 16, V4L2_PIX_FMT_YUV422P , "YUV422P" }
  116 };
  117 
  118 /* Function prototypes */
  119 static void usbvision_release(struct usb_usbvision *usbvision);
  120 
  121 /* Default initialization of device driver parameters */
  122 /* Set the default format for ISOC endpoint */
  123 static int isoc_mode = ISOC_MODE_COMPRESS;
  124 /* Set the default Debug Mode of the device driver */
  125 static int video_debug;
  126 /* Set the default device to power on at startup */
  127 static int power_on_at_open = 1;
  128 /* Sequential Number of Video Device */
  129 static int video_nr = -1;
  130 /* Sequential Number of Radio Device */
  131 static int radio_nr = -1;
  132 
  133 /* Grab parameters for the device driver */
  134 
  135 /* Showing parameters under SYSFS */
  136 module_param(isoc_mode, int, 0444);
  137 module_param(video_debug, int, 0444);
  138 module_param(power_on_at_open, int, 0444);
  139 module_param(video_nr, int, 0444);
  140 module_param(radio_nr, int, 0444);
  141 
  142 MODULE_PARM_DESC(isoc_mode, " Set the default format for ISOC endpoint.  Default: 0x60 (Compression On)");
  143 MODULE_PARM_DESC(video_debug, " Set the default Debug Mode of the device driver.  Default: 0 (Off)");
  144 MODULE_PARM_DESC(power_on_at_open, " Set the default device to power on when device is opened.  Default: 1 (On)");
  145 MODULE_PARM_DESC(video_nr, "Set video device number (/dev/videoX).  Default: -1 (autodetect)");
  146 MODULE_PARM_DESC(radio_nr, "Set radio device number (/dev/radioX).  Default: -1 (autodetect)");
  147 
  148 
  149 /* Misc stuff */
  150 MODULE_AUTHOR(DRIVER_AUTHOR);
  151 MODULE_DESCRIPTION(DRIVER_DESC);
  152 MODULE_LICENSE(DRIVER_LICENSE);
  153 MODULE_VERSION(USBVISION_VERSION_STRING);
  154 MODULE_ALIAS(DRIVER_ALIAS);
  155 
  156 
  157 /*****************************************************************************/
  158 /* SYSFS Code - Copied from the stv680.c usb module.			     */
  159 /* Device information is located at /sys/class/video4linux/video0            */
  160 /* Device parameters information is located at /sys/module/usbvision         */
  161 /* Device USB Information is located at                                      */
  162 /*   /sys/bus/usb/drivers/USBVision Video Grabber                            */
  163 /*****************************************************************************/
  164 
  165 #define YES_NO(x) ((x) ? "Yes" : "No")
  166 
  167 static inline struct usb_usbvision *cd_to_usbvision(struct device *cd)
  168 {
  169 	struct video_device *vdev =
  170 		container_of(cd, struct video_device, dev);
  171 	return video_get_drvdata(vdev);
  172 }
  173 
  174 static ssize_t show_version(struct device *cd,
  175 			    struct device_attribute *attr, char *buf)
  176 {
  177 	return sprintf(buf, "%s\n", USBVISION_VERSION_STRING);
  178 }
  179 static DEVICE_ATTR(version, S_IRUGO, show_version, NULL);
  180 
  181 static ssize_t show_model(struct device *cd,
  182 			  struct device_attribute *attr, char *buf)
  183 {
  184 	struct video_device *vdev =
  185 		container_of(cd, struct video_device, dev);
  186 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  187 	return sprintf(buf, "%s\n",
  188 		       usbvision_device_data[usbvision->dev_model].model_string);
  189 }
  190 static DEVICE_ATTR(model, S_IRUGO, show_model, NULL);
  191 
  192 static ssize_t show_hue(struct device *cd,
  193 			struct device_attribute *attr, char *buf)
  194 {
  195 	struct video_device *vdev =
  196 		container_of(cd, struct video_device, dev);
  197 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  198 	struct v4l2_control ctrl;
  199 	ctrl.id = V4L2_CID_HUE;
  200 	ctrl.value = 0;
  201 	if (usbvision->user)
  202 		call_all(usbvision, core, g_ctrl, &ctrl);
  203 	return sprintf(buf, "%d\n", ctrl.value);
  204 }
  205 static DEVICE_ATTR(hue, S_IRUGO, show_hue, NULL);
  206 
  207 static ssize_t show_contrast(struct device *cd,
  208 			     struct device_attribute *attr, char *buf)
  209 {
  210 	struct video_device *vdev =
  211 		container_of(cd, struct video_device, dev);
  212 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  213 	struct v4l2_control ctrl;
  214 	ctrl.id = V4L2_CID_CONTRAST;
  215 	ctrl.value = 0;
  216 	if (usbvision->user)
  217 		call_all(usbvision, core, g_ctrl, &ctrl);
  218 	return sprintf(buf, "%d\n", ctrl.value);
  219 }
  220 static DEVICE_ATTR(contrast, S_IRUGO, show_contrast, NULL);
  221 
  222 static ssize_t show_brightness(struct device *cd,
  223 			       struct device_attribute *attr, char *buf)
  224 {
  225 	struct video_device *vdev =
  226 		container_of(cd, struct video_device, dev);
  227 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  228 	struct v4l2_control ctrl;
  229 	ctrl.id = V4L2_CID_BRIGHTNESS;
  230 	ctrl.value = 0;
  231 	if (usbvision->user)
  232 		call_all(usbvision, core, g_ctrl, &ctrl);
  233 	return sprintf(buf, "%d\n", ctrl.value);
  234 }
  235 static DEVICE_ATTR(brightness, S_IRUGO, show_brightness, NULL);
  236 
  237 static ssize_t show_saturation(struct device *cd,
  238 			       struct device_attribute *attr, char *buf)
  239 {
  240 	struct video_device *vdev =
  241 		container_of(cd, struct video_device, dev);
  242 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  243 	struct v4l2_control ctrl;
  244 	ctrl.id = V4L2_CID_SATURATION;
  245 	ctrl.value = 0;
  246 	if (usbvision->user)
  247 		call_all(usbvision, core, g_ctrl, &ctrl);
  248 	return sprintf(buf, "%d\n", ctrl.value);
  249 }
  250 static DEVICE_ATTR(saturation, S_IRUGO, show_saturation, NULL);
  251 
  252 static ssize_t show_streaming(struct device *cd,
  253 			      struct device_attribute *attr, char *buf)
  254 {
  255 	struct video_device *vdev =
  256 		container_of(cd, struct video_device, dev);
  257 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  258 	return sprintf(buf, "%s\n",
  259 		       YES_NO(usbvision->streaming == stream_on ? 1 : 0));
  260 }
  261 static DEVICE_ATTR(streaming, S_IRUGO, show_streaming, NULL);
  262 
  263 static ssize_t show_compression(struct device *cd,
  264 				struct device_attribute *attr, char *buf)
  265 {
  266 	struct video_device *vdev =
  267 		container_of(cd, struct video_device, dev);
  268 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  269 	return sprintf(buf, "%s\n",
  270 		       YES_NO(usbvision->isoc_mode == ISOC_MODE_COMPRESS));
  271 }
  272 static DEVICE_ATTR(compression, S_IRUGO, show_compression, NULL);
  273 
  274 static ssize_t show_device_bridge(struct device *cd,
  275 				  struct device_attribute *attr, char *buf)
  276 {
  277 	struct video_device *vdev =
  278 		container_of(cd, struct video_device, dev);
  279 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  280 	return sprintf(buf, "%d\n", usbvision->bridge_type);
  281 }
  282 static DEVICE_ATTR(bridge, S_IRUGO, show_device_bridge, NULL);
  283 
  284 static void usbvision_create_sysfs(struct video_device *vdev)
  285 {
  286 	int res;
  287 
  288 	if (!vdev)
  289 		return;
  290 	do {
  291 		res = device_create_file(&vdev->dev, &dev_attr_version);
  292 		if (res < 0)
  293 			break;
  294 		res = device_create_file(&vdev->dev, &dev_attr_model);
  295 		if (res < 0)
  296 			break;
  297 		res = device_create_file(&vdev->dev, &dev_attr_hue);
  298 		if (res < 0)
  299 			break;
  300 		res = device_create_file(&vdev->dev, &dev_attr_contrast);
  301 		if (res < 0)
  302 			break;
  303 		res = device_create_file(&vdev->dev, &dev_attr_brightness);
  304 		if (res < 0)
  305 			break;
  306 		res = device_create_file(&vdev->dev, &dev_attr_saturation);
  307 		if (res < 0)
  308 			break;
  309 		res = device_create_file(&vdev->dev, &dev_attr_streaming);
  310 		if (res < 0)
  311 			break;
  312 		res = device_create_file(&vdev->dev, &dev_attr_compression);
  313 		if (res < 0)
  314 			break;
  315 		res = device_create_file(&vdev->dev, &dev_attr_bridge);
  316 		if (res >= 0)
  317 			return;
  318 	} while (0);
  319 
  320 	dev_err(&vdev->dev, "%s error: %d\n", __func__, res);
  321 }
  322 
  323 static void usbvision_remove_sysfs(struct video_device *vdev)
  324 {
  325 	if (vdev) {
  326 		device_remove_file(&vdev->dev, &dev_attr_version);
  327 		device_remove_file(&vdev->dev, &dev_attr_model);
  328 		device_remove_file(&vdev->dev, &dev_attr_hue);
  329 		device_remove_file(&vdev->dev, &dev_attr_contrast);
  330 		device_remove_file(&vdev->dev, &dev_attr_brightness);
  331 		device_remove_file(&vdev->dev, &dev_attr_saturation);
  332 		device_remove_file(&vdev->dev, &dev_attr_streaming);
  333 		device_remove_file(&vdev->dev, &dev_attr_compression);
  334 		device_remove_file(&vdev->dev, &dev_attr_bridge);
  335 	}
  336 }
  337 
  338 /*
  339  * usbvision_open()
  340  *
  341  * This is part of Video 4 Linux API. The driver can be opened by one
  342  * client only (checks internal counter 'usbvision->user'). The procedure
  343  * then allocates buffers needed for video processing.
  344  *
  345  */
  346 static int usbvision_v4l2_open(struct file *file)
  347 {
  348 	struct usb_usbvision *usbvision = video_drvdata(file);
  349 	int err_code = 0;
  350 
  351 	PDEBUG(DBG_IO, "open");
  352 
  353 	if (mutex_lock_interruptible(&usbvision->v4l2_lock))
  354 		return -ERESTARTSYS;
  355 	usbvision_reset_power_off_timer(usbvision);
  356 
  357 	if (usbvision->user)
  358 		err_code = -EBUSY;
  359 	else {
  360 		/* Allocate memory for the scratch ring buffer */
  361 		err_code = usbvision_scratch_alloc(usbvision);
  362 		if (isoc_mode == ISOC_MODE_COMPRESS) {
  363 			/* Allocate intermediate decompression buffers
  364 			   only if needed */
  365 			err_code = usbvision_decompress_alloc(usbvision);
  366 		}
  367 		if (err_code) {
  368 			/* Deallocate all buffers if trouble */
  369 			usbvision_scratch_free(usbvision);
  370 			usbvision_decompress_free(usbvision);
  371 		}
  372 	}
  373 
  374 	/* If so far no errors then we shall start the camera */
  375 	if (!err_code) {
  376 		if (usbvision->power == 0) {
  377 			usbvision_power_on(usbvision);
  378 			usbvision_i2c_register(usbvision);
  379 		}
  380 
  381 		/* Send init sequence only once, it's large! */
  382 		if (!usbvision->initialized) {
  383 			int setup_ok = 0;
  384 			setup_ok = usbvision_setup(usbvision, isoc_mode);
  385 			if (setup_ok)
  386 				usbvision->initialized = 1;
  387 			else
  388 				err_code = -EBUSY;
  389 		}
  390 
  391 		if (!err_code) {
  392 			usbvision_begin_streaming(usbvision);
  393 			err_code = usbvision_init_isoc(usbvision);
  394 			/* device must be initialized before isoc transfer */
  395 			usbvision_muxsel(usbvision, 0);
  396 			usbvision->user++;
  397 		} else {
  398 			if (power_on_at_open) {
  399 				usbvision_i2c_unregister(usbvision);
  400 				usbvision_power_off(usbvision);
  401 				usbvision->initialized = 0;
  402 			}
  403 		}
  404 	}
  405 
  406 	/* prepare queues */
  407 	usbvision_empty_framequeues(usbvision);
  408 	mutex_unlock(&usbvision->v4l2_lock);
  409 
  410 	PDEBUG(DBG_IO, "success");
  411 	return err_code;
  412 }
  413 
  414 /*
  415  * usbvision_v4l2_close()
  416  *
  417  * This is part of Video 4 Linux API. The procedure
  418  * stops streaming and deallocates all buffers that were earlier
  419  * allocated in usbvision_v4l2_open().
  420  *
  421  */
  422 static int usbvision_v4l2_close(struct file *file)
  423 {
  424 	struct usb_usbvision *usbvision = video_drvdata(file);
  425 
  426 	PDEBUG(DBG_IO, "close");
  427 
  428 	mutex_lock(&usbvision->v4l2_lock);
  429 	usbvision_audio_off(usbvision);
  430 	usbvision_restart_isoc(usbvision);
  431 	usbvision_stop_isoc(usbvision);
  432 
  433 	usbvision_decompress_free(usbvision);
  434 	usbvision_frames_free(usbvision);
  435 	usbvision_empty_framequeues(usbvision);
  436 	usbvision_scratch_free(usbvision);
  437 
  438 	usbvision->user--;
  439 
  440 	if (power_on_at_open) {
  441 		/* power off in a little while
  442 		   to avoid off/on every close/open short sequences */
  443 		usbvision_set_power_off_timer(usbvision);
  444 		usbvision->initialized = 0;
  445 	}
  446 
  447 	if (usbvision->remove_pending) {
  448 		printk(KERN_INFO "%s: Final disconnect\n", __func__);
  449 		usbvision_release(usbvision);
  450 		return 0;
  451 	}
  452 	mutex_unlock(&usbvision->v4l2_lock);
  453 
  454 	PDEBUG(DBG_IO, "success");
  455 	return 0;
  456 }
  457 
  458 
  459 /*
  460  * usbvision_ioctl()
  461  *
  462  * This is part of Video 4 Linux API. The procedure handles ioctl() calls.
  463  *
  464  */
  465 #ifdef CONFIG_VIDEO_ADV_DEBUG
  466 static int vidioc_g_register(struct file *file, void *priv,
  467 				struct v4l2_dbg_register *reg)
  468 {
  469 	struct usb_usbvision *usbvision = video_drvdata(file);
  470 	int err_code;
  471 
  472 	/* NT100x has a 8-bit register space */
  473 	err_code = usbvision_read_reg(usbvision, reg->reg&0xff);
  474 	if (err_code < 0) {
  475 		dev_err(&usbvision->vdev->dev,
  476 			"%s: VIDIOC_DBG_G_REGISTER failed: error %d\n",
  477 				__func__, err_code);
  478 		return err_code;
  479 	}
  480 	reg->val = err_code;
  481 	reg->size = 1;
  482 	return 0;
  483 }
  484 
  485 static int vidioc_s_register(struct file *file, void *priv,
  486 				const struct v4l2_dbg_register *reg)
  487 {
  488 	struct usb_usbvision *usbvision = video_drvdata(file);
  489 	int err_code;
  490 
  491 	/* NT100x has a 8-bit register space */
  492 	err_code = usbvision_write_reg(usbvision, reg->reg & 0xff, reg->val);
  493 	if (err_code < 0) {
  494 		dev_err(&usbvision->vdev->dev,
  495 			"%s: VIDIOC_DBG_S_REGISTER failed: error %d\n",
  496 				__func__, err_code);
  497 		return err_code;
  498 	}
  499 	return 0;
  500 }
  501 #endif
  502 
  503 static int vidioc_querycap(struct file *file, void  *priv,
  504 					struct v4l2_capability *vc)
  505 {
  506 	struct usb_usbvision *usbvision = video_drvdata(file);
  507 
  508 	strlcpy(vc->driver, "USBVision", sizeof(vc->driver));
  509 	strlcpy(vc->card,
  510 		usbvision_device_data[usbvision->dev_model].model_string,
  511 		sizeof(vc->card));
  512 	usb_make_path(usbvision->dev, vc->bus_info, sizeof(vc->bus_info));
  513 	vc->device_caps = V4L2_CAP_VIDEO_CAPTURE |
  514 		V4L2_CAP_AUDIO |
  515 		V4L2_CAP_READWRITE |
  516 		V4L2_CAP_STREAMING |
  517 		(usbvision->have_tuner ? V4L2_CAP_TUNER : 0);
  518 	vc->capabilities = vc->device_caps | V4L2_CAP_DEVICE_CAPS;
  519 	return 0;
  520 }
  521 
  522 static int vidioc_enum_input(struct file *file, void *priv,
  523 				struct v4l2_input *vi)
  524 {
  525 	struct usb_usbvision *usbvision = video_drvdata(file);
  526 	int chan;
  527 
  528 	if (vi->index >= usbvision->video_inputs)
  529 		return -EINVAL;
  530 	if (usbvision->have_tuner)
  531 		chan = vi->index;
  532 	else
  533 		chan = vi->index + 1; /* skip Television string*/
  534 
  535 	/* Determine the requested input characteristics
  536 	   specific for each usbvision card model */
  537 	switch (chan) {
  538 	case 0:
  539 		if (usbvision_device_data[usbvision->dev_model].video_channels == 4) {
  540 			strcpy(vi->name, "White Video Input");
  541 		} else {
  542 			strcpy(vi->name, "Television");
  543 			vi->type = V4L2_INPUT_TYPE_TUNER;
  544 			vi->audioset = 1;
  545 			vi->tuner = chan;
  546 			vi->std = USBVISION_NORMS;
  547 		}
  548 		break;
  549 	case 1:
  550 		vi->type = V4L2_INPUT_TYPE_CAMERA;
  551 		if (usbvision_device_data[usbvision->dev_model].video_channels == 4)
  552 			strcpy(vi->name, "Green Video Input");
  553 		else
  554 			strcpy(vi->name, "Composite Video Input");
  555 		vi->std = V4L2_STD_PAL;
  556 		break;
  557 	case 2:
  558 		vi->type = V4L2_INPUT_TYPE_CAMERA;
  559 		if (usbvision_device_data[usbvision->dev_model].video_channels == 4)
  560 			strcpy(vi->name, "Yellow Video Input");
  561 		else
  562 			strcpy(vi->name, "S-Video Input");
  563 		vi->std = V4L2_STD_PAL;
  564 		break;
  565 	case 3:
  566 		vi->type = V4L2_INPUT_TYPE_CAMERA;
  567 		strcpy(vi->name, "Red Video Input");
  568 		vi->std = V4L2_STD_PAL;
  569 		break;
  570 	}
  571 	return 0;
  572 }
  573 
  574 static int vidioc_g_input(struct file *file, void *priv, unsigned int *input)
  575 {
  576 	struct usb_usbvision *usbvision = video_drvdata(file);
  577 
  578 	*input = usbvision->ctl_input;
  579 	return 0;
  580 }
  581 
  582 static int vidioc_s_input(struct file *file, void *priv, unsigned int input)
  583 {
  584 	struct usb_usbvision *usbvision = video_drvdata(file);
  585 
  586 	if (input >= usbvision->video_inputs)
  587 		return -EINVAL;
  588 
  589 	usbvision_muxsel(usbvision, input);
  590 	usbvision_set_input(usbvision);
  591 	usbvision_set_output(usbvision,
  592 			     usbvision->curwidth,
  593 			     usbvision->curheight);
  594 	return 0;
  595 }
  596 
  597 static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
  598 {
  599 	struct usb_usbvision *usbvision = video_drvdata(file);
  600 
  601 	usbvision->tvnorm_id = id;
  602 
  603 	call_all(usbvision, video, s_std, usbvision->tvnorm_id);
  604 	/* propagate the change to the decoder */
  605 	usbvision_muxsel(usbvision, usbvision->ctl_input);
  606 
  607 	return 0;
  608 }
  609 
  610 static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
  611 {
  612 	struct usb_usbvision *usbvision = video_drvdata(file);
  613 
  614 	*id = usbvision->tvnorm_id;
  615 	return 0;
  616 }
  617 
  618 static int vidioc_g_tuner(struct file *file, void *priv,
  619 				struct v4l2_tuner *vt)
  620 {
  621 	struct usb_usbvision *usbvision = video_drvdata(file);
  622 
  623 	if (!usbvision->have_tuner || vt->index)	/* Only tuner 0 */
  624 		return -EINVAL;
  625 	if (usbvision->radio) {
  626 		strcpy(vt->name, "Radio");
  627 		vt->type = V4L2_TUNER_RADIO;
  628 	} else {
  629 		strcpy(vt->name, "Television");
  630 	}
  631 	/* Let clients fill in the remainder of this struct */
  632 	call_all(usbvision, tuner, g_tuner, vt);
  633 
  634 	return 0;
  635 }
  636 
  637 static int vidioc_s_tuner(struct file *file, void *priv,
  638 				const struct v4l2_tuner *vt)
  639 {
  640 	struct usb_usbvision *usbvision = video_drvdata(file);
  641 
  642 	/* Only no or one tuner for now */
  643 	if (!usbvision->have_tuner || vt->index)
  644 		return -EINVAL;
  645 	/* let clients handle this */
  646 	call_all(usbvision, tuner, s_tuner, vt);
  647 
  648 	return 0;
  649 }
  650 
  651 static int vidioc_g_frequency(struct file *file, void *priv,
  652 				struct v4l2_frequency *freq)
  653 {
  654 	struct usb_usbvision *usbvision = video_drvdata(file);
  655 
  656 	freq->tuner = 0; /* Only one tuner */
  657 	if (usbvision->radio)
  658 		freq->type = V4L2_TUNER_RADIO;
  659 	else
  660 		freq->type = V4L2_TUNER_ANALOG_TV;
  661 	freq->frequency = usbvision->freq;
  662 
  663 	return 0;
  664 }
  665 
  666 static int vidioc_s_frequency(struct file *file, void *priv,
  667 				const struct v4l2_frequency *freq)
  668 {
  669 	struct usb_usbvision *usbvision = video_drvdata(file);
  670 
  671 	/* Only no or one tuner for now */
  672 	if (!usbvision->have_tuner || freq->tuner)
  673 		return -EINVAL;
  674 
  675 	usbvision->freq = freq->frequency;
  676 	call_all(usbvision, tuner, s_frequency, freq);
  677 
  678 	return 0;
  679 }
  680 
  681 static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
  682 {
  683 	struct usb_usbvision *usbvision = video_drvdata(file);
  684 
  685 	if (usbvision->radio)
  686 		strcpy(a->name, "Radio");
  687 	else
  688 		strcpy(a->name, "TV");
  689 
  690 	return 0;
  691 }
  692 
  693 static int vidioc_s_audio(struct file *file, void *fh,
  694 			  const struct v4l2_audio *a)
  695 {
  696 	if (a->index)
  697 		return -EINVAL;
  698 	return 0;
  699 }
  700 
  701 static int vidioc_queryctrl(struct file *file, void *priv,
  702 			    struct v4l2_queryctrl *ctrl)
  703 {
  704 	struct usb_usbvision *usbvision = video_drvdata(file);
  705 
  706 	call_all(usbvision, core, queryctrl, ctrl);
  707 
  708 	if (!ctrl->type)
  709 		return -EINVAL;
  710 
  711 	return 0;
  712 }
  713 
  714 static int vidioc_g_ctrl(struct file *file, void *priv,
  715 				struct v4l2_control *ctrl)
  716 {
  717 	struct usb_usbvision *usbvision = video_drvdata(file);
  718 
  719 	call_all(usbvision, core, g_ctrl, ctrl);
  720 	return 0;
  721 }
  722 
  723 static int vidioc_s_ctrl(struct file *file, void *priv,
  724 				struct v4l2_control *ctrl)
  725 {
  726 	struct usb_usbvision *usbvision = video_drvdata(file);
  727 
  728 	call_all(usbvision, core, s_ctrl, ctrl);
  729 	return 0;
  730 }
  731 
  732 static int vidioc_reqbufs(struct file *file,
  733 			   void *priv, struct v4l2_requestbuffers *vr)
  734 {
  735 	struct usb_usbvision *usbvision = video_drvdata(file);
  736 	int ret;
  737 
  738 	RESTRICT_TO_RANGE(vr->count, 1, USBVISION_NUMFRAMES);
  739 
  740 	/* Check input validity:
  741 	   the user must do a VIDEO CAPTURE and MMAP method. */
  742 	if (vr->memory != V4L2_MEMORY_MMAP)
  743 		return -EINVAL;
  744 
  745 	if (usbvision->streaming == stream_on) {
  746 		ret = usbvision_stream_interrupt(usbvision);
  747 		if (ret)
  748 			return ret;
  749 	}
  750 
  751 	usbvision_frames_free(usbvision);
  752 	usbvision_empty_framequeues(usbvision);
  753 	vr->count = usbvision_frames_alloc(usbvision, vr->count);
  754 
  755 	usbvision->cur_frame = NULL;
  756 
  757 	return 0;
  758 }
  759 
  760 static int vidioc_querybuf(struct file *file,
  761 			    void *priv, struct v4l2_buffer *vb)
  762 {
  763 	struct usb_usbvision *usbvision = video_drvdata(file);
  764 	struct usbvision_frame *frame;
  765 
  766 	/* FIXME : must control
  767 	   that buffers are mapped (VIDIOC_REQBUFS has been called) */
  768 	if (vb->index >= usbvision->num_frames)
  769 		return -EINVAL;
  770 	/* Updating the corresponding frame state */
  771 	vb->flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
  772 	frame = &usbvision->frame[vb->index];
  773 	if (frame->grabstate >= frame_state_ready)
  774 		vb->flags |= V4L2_BUF_FLAG_QUEUED;
  775 	if (frame->grabstate >= frame_state_done)
  776 		vb->flags |= V4L2_BUF_FLAG_DONE;
  777 	if (frame->grabstate == frame_state_unused)
  778 		vb->flags |= V4L2_BUF_FLAG_MAPPED;
  779 	vb->memory = V4L2_MEMORY_MMAP;
  780 
  781 	vb->m.offset = vb->index * PAGE_ALIGN(usbvision->max_frame_size);
  782 
  783 	vb->memory = V4L2_MEMORY_MMAP;
  784 	vb->field = V4L2_FIELD_NONE;
  785 	vb->length = usbvision->curwidth *
  786 		usbvision->curheight *
  787 		usbvision->palette.bytes_per_pixel;
  788 	vb->timestamp = usbvision->frame[vb->index].timestamp;
  789 	vb->sequence = usbvision->frame[vb->index].sequence;
  790 	return 0;
  791 }
  792 
  793 static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *vb)
  794 {
  795 	struct usb_usbvision *usbvision = video_drvdata(file);
  796 	struct usbvision_frame *frame;
  797 	unsigned long lock_flags;
  798 
  799 	/* FIXME : works only on VIDEO_CAPTURE MODE, MMAP. */
  800 	if (vb->index >= usbvision->num_frames)
  801 		return -EINVAL;
  802 
  803 	frame = &usbvision->frame[vb->index];
  804 
  805 	if (frame->grabstate != frame_state_unused)
  806 		return -EAGAIN;
  807 
  808 	/* Mark it as ready and enqueue frame */
  809 	frame->grabstate = frame_state_ready;
  810 	frame->scanstate = scan_state_scanning;
  811 	frame->scanlength = 0;	/* Accumulated in usbvision_parse_data() */
  812 
  813 	vb->flags &= ~V4L2_BUF_FLAG_DONE;
  814 
  815 	/* set v4l2_format index */
  816 	frame->v4l2_format = usbvision->palette;
  817 
  818 	spin_lock_irqsave(&usbvision->queue_lock, lock_flags);
  819 	list_add_tail(&usbvision->frame[vb->index].frame, &usbvision->inqueue);
  820 	spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags);
  821 
  822 	return 0;
  823 }
  824 
  825 static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *vb)
  826 {
  827 	struct usb_usbvision *usbvision = video_drvdata(file);
  828 	int ret;
  829 	struct usbvision_frame *f;
  830 	unsigned long lock_flags;
  831 
  832 	if (list_empty(&(usbvision->outqueue))) {
  833 		if (usbvision->streaming == stream_idle)
  834 			return -EINVAL;
  835 		ret = wait_event_interruptible
  836 			(usbvision->wait_frame,
  837 			 !list_empty(&(usbvision->outqueue)));
  838 		if (ret)
  839 			return ret;
  840 	}
  841 
  842 	spin_lock_irqsave(&usbvision->queue_lock, lock_flags);
  843 	f = list_entry(usbvision->outqueue.next,
  844 		       struct usbvision_frame, frame);
  845 	list_del(usbvision->outqueue.next);
  846 	spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags);
  847 
  848 	f->grabstate = frame_state_unused;
  849 
  850 	vb->memory = V4L2_MEMORY_MMAP;
  851 	vb->flags = V4L2_BUF_FLAG_MAPPED |
  852 		V4L2_BUF_FLAG_QUEUED |
  853 		V4L2_BUF_FLAG_DONE |
  854 		V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
  855 	vb->index = f->index;
  856 	vb->sequence = f->sequence;
  857 	vb->timestamp = f->timestamp;
  858 	vb->field = V4L2_FIELD_NONE;
  859 	vb->bytesused = f->scanlength;
  860 
  861 	return 0;
  862 }
  863 
  864 static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
  865 {
  866 	struct usb_usbvision *usbvision = video_drvdata(file);
  867 
  868 	usbvision->streaming = stream_on;
  869 	call_all(usbvision, video, s_stream, 1);
  870 
  871 	return 0;
  872 }
  873 
  874 static int vidioc_streamoff(struct file *file,
  875 			    void *priv, enum v4l2_buf_type type)
  876 {
  877 	struct usb_usbvision *usbvision = video_drvdata(file);
  878 
  879 	if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
  880 		return -EINVAL;
  881 
  882 	if (usbvision->streaming == stream_on) {
  883 		usbvision_stream_interrupt(usbvision);
  884 		/* Stop all video streamings */
  885 		call_all(usbvision, video, s_stream, 0);
  886 	}
  887 	usbvision_empty_framequeues(usbvision);
  888 
  889 	return 0;
  890 }
  891 
  892 static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
  893 					struct v4l2_fmtdesc *vfd)
  894 {
  895 	if (vfd->index >= USBVISION_SUPPORTED_PALETTES - 1)
  896 		return -EINVAL;
  897 	strcpy(vfd->description, usbvision_v4l2_format[vfd->index].desc);
  898 	vfd->pixelformat = usbvision_v4l2_format[vfd->index].format;
  899 	return 0;
  900 }
  901 
  902 static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
  903 					struct v4l2_format *vf)
  904 {
  905 	struct usb_usbvision *usbvision = video_drvdata(file);
  906 	vf->fmt.pix.width = usbvision->curwidth;
  907 	vf->fmt.pix.height = usbvision->curheight;
  908 	vf->fmt.pix.pixelformat = usbvision->palette.format;
  909 	vf->fmt.pix.bytesperline =
  910 		usbvision->curwidth * usbvision->palette.bytes_per_pixel;
  911 	vf->fmt.pix.sizeimage = vf->fmt.pix.bytesperline * usbvision->curheight;
  912 	vf->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
  913 	vf->fmt.pix.field = V4L2_FIELD_NONE; /* Always progressive image */
  914 
  915 	return 0;
  916 }
  917 
  918 static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
  919 			       struct v4l2_format *vf)
  920 {
  921 	struct usb_usbvision *usbvision = video_drvdata(file);
  922 	int format_idx;
  923 
  924 	/* Find requested format in available ones */
  925 	for (format_idx = 0; format_idx < USBVISION_SUPPORTED_PALETTES; format_idx++) {
  926 		if (vf->fmt.pix.pixelformat ==
  927 		   usbvision_v4l2_format[format_idx].format) {
  928 			usbvision->palette = usbvision_v4l2_format[format_idx];
  929 			break;
  930 		}
  931 	}
  932 	/* robustness */
  933 	if (format_idx == USBVISION_SUPPORTED_PALETTES)
  934 		return -EINVAL;
  935 	RESTRICT_TO_RANGE(vf->fmt.pix.width, MIN_FRAME_WIDTH, MAX_FRAME_WIDTH);
  936 	RESTRICT_TO_RANGE(vf->fmt.pix.height, MIN_FRAME_HEIGHT, MAX_FRAME_HEIGHT);
  937 
  938 	vf->fmt.pix.bytesperline = vf->fmt.pix.width*
  939 		usbvision->palette.bytes_per_pixel;
  940 	vf->fmt.pix.sizeimage = vf->fmt.pix.bytesperline*vf->fmt.pix.height;
  941 
  942 	return 0;
  943 }
  944 
  945 static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
  946 			       struct v4l2_format *vf)
  947 {
  948 	struct usb_usbvision *usbvision = video_drvdata(file);
  949 	int ret;
  950 
  951 	ret = vidioc_try_fmt_vid_cap(file, priv, vf);
  952 	if (ret)
  953 		return ret;
  954 
  955 	/* stop io in case it is already in progress */
  956 	if (usbvision->streaming == stream_on) {
  957 		ret = usbvision_stream_interrupt(usbvision);
  958 		if (ret)
  959 			return ret;
  960 	}
  961 	usbvision_frames_free(usbvision);
  962 	usbvision_empty_framequeues(usbvision);
  963 
  964 	usbvision->cur_frame = NULL;
  965 
  966 	/* by now we are committed to the new data... */
  967 	usbvision_set_output(usbvision, vf->fmt.pix.width, vf->fmt.pix.height);
  968 
  969 	return 0;
  970 }
  971 
  972 static ssize_t usbvision_read(struct file *file, char __user *buf,
  973 		      size_t count, loff_t *ppos)
  974 {
  975 	struct usb_usbvision *usbvision = video_drvdata(file);
  976 	int noblock = file->f_flags & O_NONBLOCK;
  977 	unsigned long lock_flags;
  978 	int ret, i;
  979 	struct usbvision_frame *frame;
  980 
  981 	PDEBUG(DBG_IO, "%s: %ld bytes, noblock=%d", __func__,
  982 	       (unsigned long)count, noblock);
  983 
  984 	if (!USBVISION_IS_OPERATIONAL(usbvision) || (buf == NULL))
  985 		return -EFAULT;
  986 
  987 	/* This entry point is compatible with the mmap routines
  988 	   so that a user can do either VIDIOC_QBUF/VIDIOC_DQBUF
  989 	   to get frames or call read on the device. */
  990 	if (!usbvision->num_frames) {
  991 		/* First, allocate some frames to work with
  992 		   if this has not been done with VIDIOC_REQBUF */
  993 		usbvision_frames_free(usbvision);
  994 		usbvision_empty_framequeues(usbvision);
  995 		usbvision_frames_alloc(usbvision, USBVISION_NUMFRAMES);
  996 	}
  997 
  998 	if (usbvision->streaming != stream_on) {
  999 		/* no stream is running, make it running ! */
 1000 		usbvision->streaming = stream_on;
 1001 		call_all(usbvision, video, s_stream, 1);
 1002 	}
 1003 
 1004 	/* Then, enqueue as many frames as possible
 1005 	   (like a user of VIDIOC_QBUF would do) */
 1006 	for (i = 0; i < usbvision->num_frames; i++) {
 1007 		frame = &usbvision->frame[i];
 1008 		if (frame->grabstate == frame_state_unused) {
 1009 			/* Mark it as ready and enqueue frame */
 1010 			frame->grabstate = frame_state_ready;
 1011 			frame->scanstate = scan_state_scanning;
 1012 			/* Accumulated in usbvision_parse_data() */
 1013 			frame->scanlength = 0;
 1014 
 1015 			/* set v4l2_format index */
 1016 			frame->v4l2_format = usbvision->palette;
 1017 
 1018 			spin_lock_irqsave(&usbvision->queue_lock, lock_flags);
 1019 			list_add_tail(&frame->frame, &usbvision->inqueue);
 1020 			spin_unlock_irqrestore(&usbvision->queue_lock,
 1021 					       lock_flags);
 1022 		}
 1023 	}
 1024 
 1025 	/* Then try to steal a frame (like a VIDIOC_DQBUF would do) */
 1026 	if (list_empty(&(usbvision->outqueue))) {
 1027 		if (noblock)
 1028 			return -EAGAIN;
 1029 
 1030 		ret = wait_event_interruptible
 1031 			(usbvision->wait_frame,
 1032 			 !list_empty(&(usbvision->outqueue)));
 1033 		if (ret)
 1034 			return ret;
 1035 	}
 1036 
 1037 	spin_lock_irqsave(&usbvision->queue_lock, lock_flags);
 1038 	frame = list_entry(usbvision->outqueue.next,
 1039 			   struct usbvision_frame, frame);
 1040 	list_del(usbvision->outqueue.next);
 1041 	spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags);
 1042 
 1043 	/* An error returns an empty frame */
 1044 	if (frame->grabstate == frame_state_error) {
 1045 		frame->bytes_read = 0;
 1046 		return 0;
 1047 	}
 1048 
 1049 	PDEBUG(DBG_IO, "%s: frmx=%d, bytes_read=%ld, scanlength=%ld",
 1050 	       __func__,
 1051 	       frame->index, frame->bytes_read, frame->scanlength);
 1052 
 1053 	/* copy bytes to user space; we allow for partials reads */
 1054 	if ((count + frame->bytes_read) > (unsigned long)frame->scanlength)
 1055 		count = frame->scanlength - frame->bytes_read;
 1056 
 1057 	if (copy_to_user(buf, frame->data + frame->bytes_read, count))
 1058 		return -EFAULT;
 1059 
 1060 	frame->bytes_read += count;
 1061 	PDEBUG(DBG_IO, "%s: {copy} count used=%ld, new bytes_read=%ld",
 1062 	       __func__,
 1063 	       (unsigned long)count, frame->bytes_read);
 1064 
 1065 	/* For now, forget the frame if it has not been read in one shot. */
 1066 /*	if (frame->bytes_read >= frame->scanlength) {*/ /* All data has been read */
 1067 		frame->bytes_read = 0;
 1068 
 1069 		/* Mark it as available to be used again. */
 1070 		frame->grabstate = frame_state_unused;
 1071 /*	} */
 1072 
 1073 	return count;
 1074 }
 1075 
 1076 static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf,
 1077 		      size_t count, loff_t *ppos)
 1078 {
 1079 	struct usb_usbvision *usbvision = video_drvdata(file);
 1080 	int res;
 1081 
 1082 	if (mutex_lock_interruptible(&usbvision->v4l2_lock))
 1083 		return -ERESTARTSYS;
 1084 	res = usbvision_read(file, buf, count, ppos);
 1085 	mutex_unlock(&usbvision->v4l2_lock);
 1086 	return res;
 1087 }
 1088 
 1089 static int usbvision_mmap(struct file *file, struct vm_area_struct *vma)
 1090 {
 1091 	unsigned long size = vma->vm_end - vma->vm_start,
 1092 		start = vma->vm_start;
 1093 	void *pos;
 1094 	u32 i;
 1095 	struct usb_usbvision *usbvision = video_drvdata(file);
 1096 
 1097 	PDEBUG(DBG_MMAP, "mmap");
 1098 
 1099 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 1100 		return -EFAULT;
 1101 
 1102 	if (!(vma->vm_flags & VM_WRITE) ||
 1103 	    size != PAGE_ALIGN(usbvision->max_frame_size)) {
 1104 		return -EINVAL;
 1105 	}
 1106 
 1107 	for (i = 0; i < usbvision->num_frames; i++) {
 1108 		if (((PAGE_ALIGN(usbvision->max_frame_size)*i) >> PAGE_SHIFT) ==
 1109 		    vma->vm_pgoff)
 1110 			break;
 1111 	}
 1112 	if (i == usbvision->num_frames) {
 1113 		PDEBUG(DBG_MMAP,
 1114 		       "mmap: user supplied mapping address is out of range");
 1115 		return -EINVAL;
 1116 	}
 1117 
 1118 	/* VM_IO is eventually going to replace PageReserved altogether */
 1119 	vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
 1120 
 1121 	pos = usbvision->frame[i].data;
 1122 	while (size > 0) {
 1123 		if (vm_insert_page(vma, start, vmalloc_to_page(pos))) {
 1124 			PDEBUG(DBG_MMAP, "mmap: vm_insert_page failed");
 1125 			return -EAGAIN;
 1126 		}
 1127 		start += PAGE_SIZE;
 1128 		pos += PAGE_SIZE;
 1129 		size -= PAGE_SIZE;
 1130 	}
 1131 
 1132 	return 0;
 1133 }
 1134 
 1135 static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
 1136 {
 1137 	struct usb_usbvision *usbvision = video_drvdata(file);
 1138 	int res;
 1139 
 1140 	if (mutex_lock_interruptible(&usbvision->v4l2_lock))
 1141 		return -ERESTARTSYS;
 1142 	res = usbvision_mmap(file, vma);
 1143 	mutex_unlock(&usbvision->v4l2_lock);
 1144 	return res;
 1145 }
 1146 
 1147 /*
 1148  * Here comes the stuff for radio on usbvision based devices
 1149  *
 1150  */
 1151 static int usbvision_radio_open(struct file *file)
 1152 {
 1153 	struct usb_usbvision *usbvision = video_drvdata(file);
 1154 	int err_code = 0;
 1155 
 1156 	PDEBUG(DBG_IO, "%s:", __func__);
 1157 
 1158 	if (mutex_lock_interruptible(&usbvision->v4l2_lock))
 1159 		return -ERESTARTSYS;
 1160 	if (usbvision->user) {
 1161 		dev_err(&usbvision->rdev->dev,
 1162 			"%s: Someone tried to open an already opened USBVision Radio!\n",
 1163 				__func__);
 1164 		err_code = -EBUSY;
 1165 	} else {
 1166 		if (power_on_at_open) {
 1167 			usbvision_reset_power_off_timer(usbvision);
 1168 			if (usbvision->power == 0) {
 1169 				usbvision_power_on(usbvision);
 1170 				usbvision_i2c_register(usbvision);
 1171 			}
 1172 		}
 1173 
 1174 		/* Alternate interface 1 is is the biggest frame size */
 1175 		err_code = usbvision_set_alternate(usbvision);
 1176 		if (err_code < 0) {
 1177 			usbvision->last_error = err_code;
 1178 			err_code = -EBUSY;
 1179 			goto out;
 1180 		}
 1181 
 1182 		/* If so far no errors then we shall start the radio */
 1183 		usbvision->radio = 1;
 1184 		call_all(usbvision, tuner, s_radio);
 1185 		usbvision_set_audio(usbvision, USBVISION_AUDIO_RADIO);
 1186 		usbvision->user++;
 1187 	}
 1188 
 1189 	if (err_code) {
 1190 		if (power_on_at_open) {
 1191 			usbvision_i2c_unregister(usbvision);
 1192 			usbvision_power_off(usbvision);
 1193 			usbvision->initialized = 0;
 1194 		}
 1195 	}
 1196 out:
 1197 	mutex_unlock(&usbvision->v4l2_lock);
 1198 	return err_code;
 1199 }
 1200 
 1201 
 1202 static int usbvision_radio_close(struct file *file)
 1203 {
 1204 	struct usb_usbvision *usbvision = video_drvdata(file);
 1205 	int err_code = 0;
 1206 
 1207 	PDEBUG(DBG_IO, "");
 1208 
 1209 	mutex_lock(&usbvision->v4l2_lock);
 1210 	/* Set packet size to 0 */
 1211 	usbvision->iface_alt = 0;
 1212 	err_code = usb_set_interface(usbvision->dev, usbvision->iface,
 1213 				    usbvision->iface_alt);
 1214 
 1215 	usbvision_audio_off(usbvision);
 1216 	usbvision->radio = 0;
 1217 	usbvision->user--;
 1218 
 1219 	if (power_on_at_open) {
 1220 		usbvision_set_power_off_timer(usbvision);
 1221 		usbvision->initialized = 0;
 1222 	}
 1223 
 1224 	if (usbvision->remove_pending) {
 1225 		printk(KERN_INFO "%s: Final disconnect\n", __func__);
 1226 		usbvision_release(usbvision);
 1227 		return err_code;
 1228 	}
 1229 
 1230 	mutex_unlock(&usbvision->v4l2_lock);
 1231 	PDEBUG(DBG_IO, "success");
 1232 	return err_code;
 1233 }
 1234 
 1235 /* Video registration stuff */
 1236 
 1237 /* Video template */
 1238 static const struct v4l2_file_operations usbvision_fops = {
 1239 	.owner             = THIS_MODULE,
 1240 	.open		= usbvision_v4l2_open,
 1241 	.release	= usbvision_v4l2_close,
 1242 	.read		= usbvision_v4l2_read,
 1243 	.mmap		= usbvision_v4l2_mmap,
 1244 	.unlocked_ioctl	= video_ioctl2,
 1245 /*	.poll		= video_poll, */
 1246 };
 1247 
 1248 static const struct v4l2_ioctl_ops usbvision_ioctl_ops = {
 1249 	.vidioc_querycap      = vidioc_querycap,
 1250 	.vidioc_enum_fmt_vid_cap  = vidioc_enum_fmt_vid_cap,
 1251 	.vidioc_g_fmt_vid_cap     = vidioc_g_fmt_vid_cap,
 1252 	.vidioc_try_fmt_vid_cap   = vidioc_try_fmt_vid_cap,
 1253 	.vidioc_s_fmt_vid_cap     = vidioc_s_fmt_vid_cap,
 1254 	.vidioc_reqbufs       = vidioc_reqbufs,
 1255 	.vidioc_querybuf      = vidioc_querybuf,
 1256 	.vidioc_qbuf          = vidioc_qbuf,
 1257 	.vidioc_dqbuf         = vidioc_dqbuf,
 1258 	.vidioc_s_std         = vidioc_s_std,
 1259 	.vidioc_g_std         = vidioc_g_std,
 1260 	.vidioc_enum_input    = vidioc_enum_input,
 1261 	.vidioc_g_input       = vidioc_g_input,
 1262 	.vidioc_s_input       = vidioc_s_input,
 1263 	.vidioc_queryctrl     = vidioc_queryctrl,
 1264 	.vidioc_g_audio       = vidioc_g_audio,
 1265 	.vidioc_s_audio       = vidioc_s_audio,
 1266 	.vidioc_g_ctrl        = vidioc_g_ctrl,
 1267 	.vidioc_s_ctrl        = vidioc_s_ctrl,
 1268 	.vidioc_streamon      = vidioc_streamon,
 1269 	.vidioc_streamoff     = vidioc_streamoff,
 1270 	.vidioc_g_tuner       = vidioc_g_tuner,
 1271 	.vidioc_s_tuner       = vidioc_s_tuner,
 1272 	.vidioc_g_frequency   = vidioc_g_frequency,
 1273 	.vidioc_s_frequency   = vidioc_s_frequency,
 1274 #ifdef CONFIG_VIDEO_ADV_DEBUG
 1275 	.vidioc_g_register    = vidioc_g_register,
 1276 	.vidioc_s_register    = vidioc_s_register,
 1277 #endif
 1278 };
 1279 
 1280 static struct video_device usbvision_video_template = {
 1281 	.fops		= &usbvision_fops,
 1282 	.ioctl_ops	= &usbvision_ioctl_ops,
 1283 	.name           = "usbvision-video",
 1284 	.release	= video_device_release,
 1285 	.tvnorms        = USBVISION_NORMS,
 1286 };
 1287 
 1288 
 1289 /* Radio template */
 1290 static const struct v4l2_file_operations usbvision_radio_fops = {
 1291 	.owner             = THIS_MODULE,
 1292 	.open		= usbvision_radio_open,
 1293 	.release	= usbvision_radio_close,
 1294 	.unlocked_ioctl	= video_ioctl2,
 1295 };
 1296 
 1297 static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = {
 1298 	.vidioc_querycap      = vidioc_querycap,
 1299 	.vidioc_enum_input    = vidioc_enum_input,
 1300 	.vidioc_g_input       = vidioc_g_input,
 1301 	.vidioc_s_input       = vidioc_s_input,
 1302 	.vidioc_queryctrl     = vidioc_queryctrl,
 1303 	.vidioc_g_audio       = vidioc_g_audio,
 1304 	.vidioc_s_audio       = vidioc_s_audio,
 1305 	.vidioc_g_ctrl        = vidioc_g_ctrl,
 1306 	.vidioc_s_ctrl        = vidioc_s_ctrl,
 1307 	.vidioc_g_tuner       = vidioc_g_tuner,
 1308 	.vidioc_s_tuner       = vidioc_s_tuner,
 1309 	.vidioc_g_frequency   = vidioc_g_frequency,
 1310 	.vidioc_s_frequency   = vidioc_s_frequency,
 1311 };
 1312 
 1313 static struct video_device usbvision_radio_template = {
 1314 	.fops		= &usbvision_radio_fops,
 1315 	.name		= "usbvision-radio",
 1316 	.release	= video_device_release,
 1317 	.ioctl_ops	= &usbvision_radio_ioctl_ops,
 1318 };
 1319 
 1320 
 1321 static struct video_device *usbvision_vdev_init(struct usb_usbvision *usbvision,
 1322 					struct video_device *vdev_template,
 1323 					char *name)
 1324 {
 1325 	struct usb_device *usb_dev = usbvision->dev;
 1326 	struct video_device *vdev;
 1327 
 1328 	if (usb_dev == NULL) {
 1329 		dev_err(&usbvision->dev->dev,
 1330 			"%s: usbvision->dev is not set\n", __func__);
 1331 		return NULL;
 1332 	}
 1333 
 1334 	vdev = video_device_alloc();
 1335 	if (NULL == vdev)
 1336 		return NULL;
 1337 	*vdev = *vdev_template;
 1338 	vdev->lock = &usbvision->v4l2_lock;
 1339 	vdev->v4l2_dev = &usbvision->v4l2_dev;
 1340 	snprintf(vdev->name, sizeof(vdev->name), "%s", name);
 1341 	video_set_drvdata(vdev, usbvision);
 1342 	return vdev;
 1343 }
 1344 
 1345 /* unregister video4linux devices */
 1346 static void usbvision_unregister_video(struct usb_usbvision *usbvision)
 1347 {
 1348 	/* Radio Device: */
 1349 	if (usbvision->rdev) {
 1350 		PDEBUG(DBG_PROBE, "unregister %s [v4l2]",
 1351 		       video_device_node_name(usbvision->rdev));
 1352 		if (video_is_registered(usbvision->rdev))
 1353 			video_unregister_device(usbvision->rdev);
 1354 		else
 1355 			video_device_release(usbvision->rdev);
 1356 		usbvision->rdev = NULL;
 1357 	}
 1358 
 1359 	/* Video Device: */
 1360 	if (usbvision->vdev) {
 1361 		PDEBUG(DBG_PROBE, "unregister %s [v4l2]",
 1362 		       video_device_node_name(usbvision->vdev));
 1363 		if (video_is_registered(usbvision->vdev))
 1364 			video_unregister_device(usbvision->vdev);
 1365 		else
 1366 			video_device_release(usbvision->vdev);
 1367 		usbvision->vdev = NULL;
 1368 	}
 1369 }
 1370 
 1371 /* register video4linux devices */
 1372 static int usbvision_register_video(struct usb_usbvision *usbvision)
 1373 {
 1374 	/* Video Device: */
 1375 	usbvision->vdev = usbvision_vdev_init(usbvision,
 1376 					      &usbvision_video_template,
 1377 					      "USBVision Video");
 1378 	if (usbvision->vdev == NULL)
 1379 		goto err_exit;
 1380 	if (video_register_device(usbvision->vdev, VFL_TYPE_GRABBER, video_nr) < 0)
 1381 		goto err_exit;
 1382 	printk(KERN_INFO "USBVision[%d]: registered USBVision Video device %s [v4l2]\n",
 1383 	       usbvision->nr, video_device_node_name(usbvision->vdev));
 1384 
 1385 	/* Radio Device: */
 1386 	if (usbvision_device_data[usbvision->dev_model].radio) {
 1387 		/* usbvision has radio */
 1388 		usbvision->rdev = usbvision_vdev_init(usbvision,
 1389 						      &usbvision_radio_template,
 1390 						      "USBVision Radio");
 1391 		if (usbvision->rdev == NULL)
 1392 			goto err_exit;
 1393 		if (video_register_device(usbvision->rdev, VFL_TYPE_RADIO, radio_nr) < 0)
 1394 			goto err_exit;
 1395 		printk(KERN_INFO "USBVision[%d]: registered USBVision Radio device %s [v4l2]\n",
 1396 		       usbvision->nr, video_device_node_name(usbvision->rdev));
 1397 	}
 1398 	/* all done */
 1399 	return 0;
 1400 
 1401  err_exit:
 1402 	dev_err(&usbvision->dev->dev,
 1403 		"USBVision[%d]: video_register_device() failed\n",
 1404 			usbvision->nr);
 1405 	usbvision_unregister_video(usbvision);
 1406 	return -1;
 1407 }
 1408 
 1409 /*
 1410  * usbvision_alloc()
 1411  *
 1412  * This code allocates the struct usb_usbvision.
 1413  * It is filled with default values.
 1414  *
 1415  * Returns NULL on error, a pointer to usb_usbvision else.
 1416  *
 1417  */
 1418 static struct usb_usbvision *usbvision_alloc(struct usb_device *dev,
 1419 					     struct usb_interface *intf)
 1420 {
 1421 	struct usb_usbvision *usbvision;
 1422 
 1423 	usbvision = kzalloc(sizeof(struct usb_usbvision), GFP_KERNEL);
 1424 	if (usbvision == NULL)
 1425 		return NULL;
 1426 
 1427 	usbvision->dev = dev;
 1428 	if (v4l2_device_register(&intf->dev, &usbvision->v4l2_dev))
 1429 		goto err_free;
 1430 
 1431 	mutex_init(&usbvision->v4l2_lock);
 1432 
 1433 	/* prepare control urb for control messages during interrupts */
 1434 	usbvision->ctrl_urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL);
 1435 	if (usbvision->ctrl_urb == NULL)
 1436 		goto err_unreg;
 1437 	init_waitqueue_head(&usbvision->ctrl_urb_wq);
 1438 
 1439 	usbvision_init_power_off_timer(usbvision);
 1440 
 1441 	return usbvision;
 1442 
 1443 err_unreg:
 1444 	v4l2_device_unregister(&usbvision->v4l2_dev);
 1445 err_free:
 1446 	kfree(usbvision);
 1447 	return NULL;
 1448 }
 1449 
 1450 /*
 1451  * usbvision_release()
 1452  *
 1453  * This code does final release of struct usb_usbvision. This happens
 1454  * after the device is disconnected -and- all clients closed their files.
 1455  *
 1456  */
 1457 static void usbvision_release(struct usb_usbvision *usbvision)
 1458 {
 1459 	PDEBUG(DBG_PROBE, "");
 1460 
 1461 	usbvision_reset_power_off_timer(usbvision);
 1462 
 1463 	usbvision->initialized = 0;
 1464 
 1465 	usbvision_remove_sysfs(usbvision->vdev);
 1466 	usbvision_unregister_video(usbvision);
 1467 	kfree(usbvision->alt_max_pkt_size);
 1468 
 1469 	usb_free_urb(usbvision->ctrl_urb);
 1470 
 1471 	v4l2_device_unregister(&usbvision->v4l2_dev);
 1472 	kfree(usbvision);
 1473 
 1474 	PDEBUG(DBG_PROBE, "success");
 1475 }
 1476 
 1477 
 1478 /*********************** usb interface **********************************/
 1479 
 1480 static void usbvision_configure_video(struct usb_usbvision *usbvision)
 1481 {
 1482 	int model;
 1483 
 1484 	if (usbvision == NULL)
 1485 		return;
 1486 
 1487 	model = usbvision->dev_model;
 1488 	usbvision->palette = usbvision_v4l2_format[2]; /* V4L2_PIX_FMT_RGB24; */
 1489 
 1490 	if (usbvision_device_data[usbvision->dev_model].vin_reg2_override) {
 1491 		usbvision->vin_reg2_preset =
 1492 			usbvision_device_data[usbvision->dev_model].vin_reg2;
 1493 	} else {
 1494 		usbvision->vin_reg2_preset = 0;
 1495 	}
 1496 
 1497 	usbvision->tvnorm_id = usbvision_device_data[model].video_norm;
 1498 
 1499 	usbvision->video_inputs = usbvision_device_data[model].video_channels;
 1500 	usbvision->ctl_input = 0;
 1501 
 1502 	/* This should be here to make i2c clients to be able to register */
 1503 	/* first switch off audio */
 1504 	if (usbvision_device_data[model].audio_channels > 0)
 1505 		usbvision_audio_off(usbvision);
 1506 	if (!power_on_at_open) {
 1507 		/* and then power up the noisy tuner */
 1508 		usbvision_power_on(usbvision);
 1509 		usbvision_i2c_register(usbvision);
 1510 	}
 1511 }
 1512 
 1513 /*
 1514  * usbvision_probe()
 1515  *
 1516  * This procedure queries device descriptor and accepts the interface
 1517  * if it looks like USBVISION video device
 1518  *
 1519  */
 1520 static int usbvision_probe(struct usb_interface *intf,
 1521 			   const struct usb_device_id *devid)
 1522 {
 1523 	struct usb_device *dev = usb_get_dev(interface_to_usbdev(intf));
 1524 	struct usb_interface *uif;
 1525 	__u8 ifnum = intf->altsetting->desc.bInterfaceNumber;
 1526 	const struct usb_host_interface *interface;
 1527 	struct usb_usbvision *usbvision = NULL;
 1528 	const struct usb_endpoint_descriptor *endpoint;
 1529 	int model, i;
 1530 
 1531 	PDEBUG(DBG_PROBE, "VID=%#04x, PID=%#04x, ifnum=%u",
 1532 				dev->descriptor.idVendor,
 1533 				dev->descriptor.idProduct, ifnum);
 1534 
 1535 	model = devid->driver_info;
 1536 	if (model < 0 || model >= usbvision_device_data_size) {
 1537 		PDEBUG(DBG_PROBE, "model out of bounds %d", model);
 1538 		return -ENODEV;
 1539 	}
 1540 	printk(KERN_INFO "%s: %s found\n", __func__,
 1541 				usbvision_device_data[model].model_string);
 1542 
 1543 	if (usbvision_device_data[model].interface >= 0)
 1544 		interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0];
 1545 	else
 1546 		interface = &dev->actconfig->interface[ifnum]->altsetting[0];
 1547 	endpoint = &interface->endpoint[1].desc;
 1548 	if (!usb_endpoint_xfer_isoc(endpoint)) {
 1549 		dev_err(&intf->dev, "%s: interface %d. has non-ISO endpoint!\n",
 1550 		    __func__, ifnum);
 1551 		dev_err(&intf->dev, "%s: Endpoint attributes %d",
 1552 		    __func__, endpoint->bmAttributes);
 1553 		return -ENODEV;
 1554 	}
 1555 	if (usb_endpoint_dir_out(endpoint)) {
 1556 		dev_err(&intf->dev, "%s: interface %d. has ISO OUT endpoint!\n",
 1557 		    __func__, ifnum);
 1558 		return -ENODEV;
 1559 	}
 1560 
 1561 	usbvision = usbvision_alloc(dev, intf);
 1562 	if (usbvision == NULL) {
 1563 		dev_err(&intf->dev, "%s: couldn't allocate USBVision struct\n", __func__);
 1564 		return -ENOMEM;
 1565 	}
 1566 
 1567 	if (dev->descriptor.bNumConfigurations > 1)
 1568 		usbvision->bridge_type = BRIDGE_NT1004;
 1569 	else if (model == DAZZLE_DVC_90_REV_1_SECAM)
 1570 		usbvision->bridge_type = BRIDGE_NT1005;
 1571 	else
 1572 		usbvision->bridge_type = BRIDGE_NT1003;
 1573 	PDEBUG(DBG_PROBE, "bridge_type %d", usbvision->bridge_type);
 1574 
 1575 	/* compute alternate max packet sizes */
 1576 	uif = dev->actconfig->interface[0];
 1577 
 1578 	usbvision->num_alt = uif->num_altsetting;
 1579 	PDEBUG(DBG_PROBE, "Alternate settings: %i", usbvision->num_alt);
 1580 	usbvision->alt_max_pkt_size = kmalloc(32 * usbvision->num_alt, GFP_KERNEL);
 1581 	if (usbvision->alt_max_pkt_size == NULL) {
 1582 		dev_err(&intf->dev, "usbvision: out of memory!\n");
 1583 		usbvision_release(usbvision);
 1584 		return -ENOMEM;
 1585 	}
 1586 
 1587 	for (i = 0; i < usbvision->num_alt; i++) {
 1588 		u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[1].desc.
 1589 				      wMaxPacketSize);
 1590 		usbvision->alt_max_pkt_size[i] =
 1591 			(tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
 1592 		PDEBUG(DBG_PROBE, "Alternate setting %i, max size= %i", i,
 1593 		       usbvision->alt_max_pkt_size[i]);
 1594 	}
 1595 
 1596 
 1597 	usbvision->nr = usbvision_nr++;
 1598 
 1599 	usbvision->have_tuner = usbvision_device_data[model].tuner;
 1600 	if (usbvision->have_tuner)
 1601 		usbvision->tuner_type = usbvision_device_data[model].tuner_type;
 1602 
 1603 	usbvision->dev_model = model;
 1604 	usbvision->remove_pending = 0;
 1605 	usbvision->iface = ifnum;
 1606 	usbvision->iface_alt = 0;
 1607 	usbvision->video_endp = endpoint->bEndpointAddress;
 1608 	usbvision->isoc_packet_size = 0;
 1609 	usbvision->usb_bandwidth = 0;
 1610 	usbvision->user = 0;
 1611 	usbvision->streaming = stream_off;
 1612 	usbvision_configure_video(usbvision);
 1613 	usbvision_register_video(usbvision);
 1614 
 1615 	usbvision_create_sysfs(usbvision->vdev);
 1616 
 1617 	PDEBUG(DBG_PROBE, "success");
 1618 	return 0;
 1619 }
 1620 
 1621 
 1622 /*
 1623  * usbvision_disconnect()
 1624  *
 1625  * This procedure stops all driver activity, deallocates interface-private
 1626  * structure (pointed by 'ptr') and after that driver should be removable
 1627  * with no ill consequences.
 1628  *
 1629  */
 1630 static void usbvision_disconnect(struct usb_interface *intf)
 1631 {
 1632 	struct usb_usbvision *usbvision = to_usbvision(usb_get_intfdata(intf));
 1633 
 1634 	PDEBUG(DBG_PROBE, "");
 1635 
 1636 	if (usbvision == NULL) {
 1637 		pr_err("%s: usb_get_intfdata() failed\n", __func__);
 1638 		return;
 1639 	}
 1640 
 1641 	mutex_lock(&usbvision->v4l2_lock);
 1642 
 1643 	/* At this time we ask to cancel outstanding URBs */
 1644 	usbvision_stop_isoc(usbvision);
 1645 
 1646 	v4l2_device_disconnect(&usbvision->v4l2_dev);
 1647 
 1648 	if (usbvision->power) {
 1649 		usbvision_i2c_unregister(usbvision);
 1650 		usbvision_power_off(usbvision);
 1651 	}
 1652 	usbvision->remove_pending = 1;	/* Now all ISO data will be ignored */
 1653 
 1654 	usb_put_dev(usbvision->dev);
 1655 	usbvision->dev = NULL;	/* USB device is no more */
 1656 
 1657 	mutex_unlock(&usbvision->v4l2_lock);
 1658 
 1659 	if (usbvision->user) {
 1660 		printk(KERN_INFO "%s: In use, disconnect pending\n",
 1661 		       __func__);
 1662 		wake_up_interruptible(&usbvision->wait_frame);
 1663 		wake_up_interruptible(&usbvision->wait_stream);
 1664 	} else {
 1665 		usbvision_release(usbvision);
 1666 	}
 1667 
 1668 	PDEBUG(DBG_PROBE, "success");
 1669 }
 1670 
 1671 static struct usb_driver usbvision_driver = {
 1672 	.name		= "usbvision",
 1673 	.id_table	= usbvision_table,
 1674 	.probe		= usbvision_probe,
 1675 	.disconnect	= usbvision_disconnect,
 1676 };
 1677 
 1678 /*
 1679  * usbvision_init()
 1680  *
 1681  * This code is run to initialize the driver.
 1682  *
 1683  */
 1684 static int __init usbvision_init(void)
 1685 {
 1686 	int err_code;
 1687 
 1688 	PDEBUG(DBG_PROBE, "");
 1689 
 1690 	PDEBUG(DBG_IO,  "IO      debugging is enabled [video]");
 1691 	PDEBUG(DBG_PROBE, "PROBE   debugging is enabled [video]");
 1692 	PDEBUG(DBG_MMAP, "MMAP    debugging is enabled [video]");
 1693 
 1694 	/* disable planar mode support unless compression enabled */
 1695 	if (isoc_mode != ISOC_MODE_COMPRESS) {
 1696 		/* FIXME : not the right way to set supported flag */
 1697 		usbvision_v4l2_format[6].supported = 0; /* V4L2_PIX_FMT_YVU420 */
 1698 		usbvision_v4l2_format[7].supported = 0; /* V4L2_PIX_FMT_YUV422P */
 1699 	}
 1700 
 1701 	err_code = usb_register(&usbvision_driver);
 1702 
 1703 	if (err_code == 0) {
 1704 		printk(KERN_INFO DRIVER_DESC " : " USBVISION_VERSION_STRING "\n");
 1705 		PDEBUG(DBG_PROBE, "success");
 1706 	}
 1707 	return err_code;
 1708 }
 1709 
 1710 static void __exit usbvision_exit(void)
 1711 {
 1712 	PDEBUG(DBG_PROBE, "");
 1713 
 1714 	usb_deregister(&usbvision_driver);
 1715 	PDEBUG(DBG_PROBE, "success");
 1716 }
 1717 
 1718 module_init(usbvision_init);
 1719 module_exit(usbvision_exit);
 1720 
 1721 
 1722 
 1723 
 1724 
 1725 /* LDV_COMMENT_BEGIN_MAIN */
 1726 #ifdef LDV_MAIN1_sequence_infinite_withcheck_stateful
 1727 
 1728 /*###########################################################################*/
 1729 
 1730 /*############## Driver Environment Generator 0.2 output ####################*/
 1731 
 1732 /*###########################################################################*/
 1733 
 1734 
 1735 
 1736 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test if all kernel resources are correctly released by driver before driver will be unloaded. */
 1737 void ldv_check_final_state(void);
 1738 
 1739 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result. */
 1740 void ldv_check_return_value(int res);
 1741 
 1742 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result of probe() function. */
 1743 void ldv_check_return_value_probe(int res);
 1744 
 1745 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Initializes the model. */
 1746 void ldv_initialize(void);
 1747 
 1748 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Reinitializes the model between distinct model function calls. */
 1749 void ldv_handler_precall(void);
 1750 
 1751 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Returns arbitrary interger value. */
 1752 int nondet_int(void);
 1753 
 1754 /* LDV_COMMENT_VAR_DECLARE_LDV Special variable for LDV verifier. */
 1755 int LDV_IN_INTERRUPT;
 1756 
 1757 /* LDV_COMMENT_FUNCTION_MAIN Main function for LDV verifier. */
 1758 void ldv_main1_sequence_infinite_withcheck_stateful(void) {
 1759 
 1760 
 1761 
 1762 	/* LDV_COMMENT_BEGIN_VARIABLE_DECLARATION_PART */
 1763 	/*============================= VARIABLE DECLARATION PART   =============================*/
 1764 	/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_fops **/
 1765 	/* content: static int usbvision_v4l2_open(struct file *file)*/
 1766 	/* LDV_COMMENT_BEGIN_PREP */
 1767 	#define DRIVER_AUTHOR					\
 1768 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1769 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1770 	#define DRIVER_NAME "usbvision"
 1771 	#define DRIVER_ALIAS "USBVision"
 1772 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1773 	#define DRIVER_LICENSE "GPL"
 1774 	#define USBVISION_VERSION_STRING "0.9.11"
 1775 	#define	ENABLE_HEXDUMP	0	
 1776 	#ifdef USBVISION_DEBUG
 1777 	#define PDEBUG(level, fmt, args...) { \
 1778 		if (video_debug & (level)) \
 1779 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1780 				__func__, __LINE__ , ## args); \
 1781 	}
 1782 	#else
 1783 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1784 	#endif
 1785 	#define DBG_IO		(1 << 1)
 1786 	#define DBG_PROBE	(1 << 2)
 1787 	#define DBG_MMAP	(1 << 3)
 1788 	#define rmspace(str)	while (*str == ' ') str++;
 1789 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1790 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1791 	/* LDV_COMMENT_END_PREP */
 1792 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_v4l2_open" */
 1793 	struct file * var_group1;
 1794 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "usbvision_v4l2_open" */
 1795 	static int res_usbvision_v4l2_open_12;
 1796 	/* LDV_COMMENT_BEGIN_PREP */
 1797 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1798 	#endif
 1799 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1800 	#endif
 1801 	/* LDV_COMMENT_END_PREP */
 1802 	/* content: static int usbvision_v4l2_close(struct file *file)*/
 1803 	/* LDV_COMMENT_BEGIN_PREP */
 1804 	#define DRIVER_AUTHOR					\
 1805 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1806 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1807 	#define DRIVER_NAME "usbvision"
 1808 	#define DRIVER_ALIAS "USBVision"
 1809 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1810 	#define DRIVER_LICENSE "GPL"
 1811 	#define USBVISION_VERSION_STRING "0.9.11"
 1812 	#define	ENABLE_HEXDUMP	0	
 1813 	#ifdef USBVISION_DEBUG
 1814 	#define PDEBUG(level, fmt, args...) { \
 1815 		if (video_debug & (level)) \
 1816 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1817 				__func__, __LINE__ , ## args); \
 1818 	}
 1819 	#else
 1820 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1821 	#endif
 1822 	#define DBG_IO		(1 << 1)
 1823 	#define DBG_PROBE	(1 << 2)
 1824 	#define DBG_MMAP	(1 << 3)
 1825 	#define rmspace(str)	while (*str == ' ') str++;
 1826 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1827 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1828 	/* LDV_COMMENT_END_PREP */
 1829 	/* LDV_COMMENT_BEGIN_PREP */
 1830 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1831 	#endif
 1832 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1833 	#endif
 1834 	/* LDV_COMMENT_END_PREP */
 1835 	/* content: static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)*/
 1836 	/* LDV_COMMENT_BEGIN_PREP */
 1837 	#define DRIVER_AUTHOR					\
 1838 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1839 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1840 	#define DRIVER_NAME "usbvision"
 1841 	#define DRIVER_ALIAS "USBVision"
 1842 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1843 	#define DRIVER_LICENSE "GPL"
 1844 	#define USBVISION_VERSION_STRING "0.9.11"
 1845 	#define	ENABLE_HEXDUMP	0	
 1846 	#ifdef USBVISION_DEBUG
 1847 	#define PDEBUG(level, fmt, args...) { \
 1848 		if (video_debug & (level)) \
 1849 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1850 				__func__, __LINE__ , ## args); \
 1851 	}
 1852 	#else
 1853 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1854 	#endif
 1855 	#define DBG_IO		(1 << 1)
 1856 	#define DBG_PROBE	(1 << 2)
 1857 	#define DBG_MMAP	(1 << 3)
 1858 	#define rmspace(str)	while (*str == ' ') str++;
 1859 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1860 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1861 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1862 	#endif
 1863 	/* LDV_COMMENT_END_PREP */
 1864 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_v4l2_read" */
 1865 	char __user * var_usbvision_v4l2_read_42_p1;
 1866 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_v4l2_read" */
 1867 	size_t  var_usbvision_v4l2_read_42_p2;
 1868 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_v4l2_read" */
 1869 	loff_t * var_usbvision_v4l2_read_42_p3;
 1870 	/* LDV_COMMENT_BEGIN_PREP */
 1871 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1872 	#endif
 1873 	/* LDV_COMMENT_END_PREP */
 1874 	/* content: static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma)*/
 1875 	/* LDV_COMMENT_BEGIN_PREP */
 1876 	#define DRIVER_AUTHOR					\
 1877 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1878 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1879 	#define DRIVER_NAME "usbvision"
 1880 	#define DRIVER_ALIAS "USBVision"
 1881 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1882 	#define DRIVER_LICENSE "GPL"
 1883 	#define USBVISION_VERSION_STRING "0.9.11"
 1884 	#define	ENABLE_HEXDUMP	0	
 1885 	#ifdef USBVISION_DEBUG
 1886 	#define PDEBUG(level, fmt, args...) { \
 1887 		if (video_debug & (level)) \
 1888 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1889 				__func__, __LINE__ , ## args); \
 1890 	}
 1891 	#else
 1892 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1893 	#endif
 1894 	#define DBG_IO		(1 << 1)
 1895 	#define DBG_PROBE	(1 << 2)
 1896 	#define DBG_MMAP	(1 << 3)
 1897 	#define rmspace(str)	while (*str == ' ') str++;
 1898 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1899 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1900 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1901 	#endif
 1902 	/* LDV_COMMENT_END_PREP */
 1903 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_v4l2_mmap" */
 1904 	struct vm_area_struct * var_group2;
 1905 	/* LDV_COMMENT_BEGIN_PREP */
 1906 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1907 	#endif
 1908 	/* LDV_COMMENT_END_PREP */
 1909 
 1910 	/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 1911 	/* content: static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *vc)*/
 1912 	/* LDV_COMMENT_BEGIN_PREP */
 1913 	#define DRIVER_AUTHOR					\
 1914 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1915 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1916 	#define DRIVER_NAME "usbvision"
 1917 	#define DRIVER_ALIAS "USBVision"
 1918 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1919 	#define DRIVER_LICENSE "GPL"
 1920 	#define USBVISION_VERSION_STRING "0.9.11"
 1921 	#define	ENABLE_HEXDUMP	0	
 1922 	#ifdef USBVISION_DEBUG
 1923 	#define PDEBUG(level, fmt, args...) { \
 1924 		if (video_debug & (level)) \
 1925 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1926 				__func__, __LINE__ , ## args); \
 1927 	}
 1928 	#else
 1929 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1930 	#endif
 1931 	#define DBG_IO		(1 << 1)
 1932 	#define DBG_PROBE	(1 << 2)
 1933 	#define DBG_MMAP	(1 << 3)
 1934 	#define rmspace(str)	while (*str == ' ') str++;
 1935 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1936 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1937 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1938 	#endif
 1939 	/* LDV_COMMENT_END_PREP */
 1940 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_querycap" */
 1941 	void * var_vidioc_querycap_16_p1;
 1942 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_querycap" */
 1943 	struct v4l2_capability * var_vidioc_querycap_16_p2;
 1944 	/* LDV_COMMENT_BEGIN_PREP */
 1945 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1946 	#endif
 1947 	/* LDV_COMMENT_END_PREP */
 1948 	/* content: static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *vfd)*/
 1949 	/* LDV_COMMENT_BEGIN_PREP */
 1950 	#define DRIVER_AUTHOR					\
 1951 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1952 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1953 	#define DRIVER_NAME "usbvision"
 1954 	#define DRIVER_ALIAS "USBVision"
 1955 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1956 	#define DRIVER_LICENSE "GPL"
 1957 	#define USBVISION_VERSION_STRING "0.9.11"
 1958 	#define	ENABLE_HEXDUMP	0	
 1959 	#ifdef USBVISION_DEBUG
 1960 	#define PDEBUG(level, fmt, args...) { \
 1961 		if (video_debug & (level)) \
 1962 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1963 				__func__, __LINE__ , ## args); \
 1964 	}
 1965 	#else
 1966 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1967 	#endif
 1968 	#define DBG_IO		(1 << 1)
 1969 	#define DBG_PROBE	(1 << 2)
 1970 	#define DBG_MMAP	(1 << 3)
 1971 	#define rmspace(str)	while (*str == ' ') str++;
 1972 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1973 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1974 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1975 	#endif
 1976 	/* LDV_COMMENT_END_PREP */
 1977 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_enum_fmt_vid_cap" */
 1978 	void * var_vidioc_enum_fmt_vid_cap_37_p1;
 1979 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_enum_fmt_vid_cap" */
 1980 	struct v4l2_fmtdesc * var_vidioc_enum_fmt_vid_cap_37_p2;
 1981 	/* LDV_COMMENT_BEGIN_PREP */
 1982 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1983 	#endif
 1984 	/* LDV_COMMENT_END_PREP */
 1985 	/* content: static int vidioc_g_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 1986 	/* LDV_COMMENT_BEGIN_PREP */
 1987 	#define DRIVER_AUTHOR					\
 1988 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1989 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1990 	#define DRIVER_NAME "usbvision"
 1991 	#define DRIVER_ALIAS "USBVision"
 1992 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1993 	#define DRIVER_LICENSE "GPL"
 1994 	#define USBVISION_VERSION_STRING "0.9.11"
 1995 	#define	ENABLE_HEXDUMP	0	
 1996 	#ifdef USBVISION_DEBUG
 1997 	#define PDEBUG(level, fmt, args...) { \
 1998 		if (video_debug & (level)) \
 1999 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2000 				__func__, __LINE__ , ## args); \
 2001 	}
 2002 	#else
 2003 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2004 	#endif
 2005 	#define DBG_IO		(1 << 1)
 2006 	#define DBG_PROBE	(1 << 2)
 2007 	#define DBG_MMAP	(1 << 3)
 2008 	#define rmspace(str)	while (*str == ' ') str++;
 2009 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2010 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2011 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2012 	#endif
 2013 	/* LDV_COMMENT_END_PREP */
 2014 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_fmt_vid_cap" */
 2015 	void * var_vidioc_g_fmt_vid_cap_38_p1;
 2016 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_fmt_vid_cap" */
 2017 	struct v4l2_format * var_vidioc_g_fmt_vid_cap_38_p2;
 2018 	/* LDV_COMMENT_BEGIN_PREP */
 2019 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2020 	#endif
 2021 	/* LDV_COMMENT_END_PREP */
 2022 	/* content: static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 2023 	/* LDV_COMMENT_BEGIN_PREP */
 2024 	#define DRIVER_AUTHOR					\
 2025 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2026 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2027 	#define DRIVER_NAME "usbvision"
 2028 	#define DRIVER_ALIAS "USBVision"
 2029 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2030 	#define DRIVER_LICENSE "GPL"
 2031 	#define USBVISION_VERSION_STRING "0.9.11"
 2032 	#define	ENABLE_HEXDUMP	0	
 2033 	#ifdef USBVISION_DEBUG
 2034 	#define PDEBUG(level, fmt, args...) { \
 2035 		if (video_debug & (level)) \
 2036 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2037 				__func__, __LINE__ , ## args); \
 2038 	}
 2039 	#else
 2040 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2041 	#endif
 2042 	#define DBG_IO		(1 << 1)
 2043 	#define DBG_PROBE	(1 << 2)
 2044 	#define DBG_MMAP	(1 << 3)
 2045 	#define rmspace(str)	while (*str == ' ') str++;
 2046 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2047 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2048 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2049 	#endif
 2050 	/* LDV_COMMENT_END_PREP */
 2051 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_try_fmt_vid_cap" */
 2052 	void * var_vidioc_try_fmt_vid_cap_39_p1;
 2053 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_try_fmt_vid_cap" */
 2054 	struct v4l2_format * var_vidioc_try_fmt_vid_cap_39_p2;
 2055 	/* LDV_COMMENT_BEGIN_PREP */
 2056 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2057 	#endif
 2058 	/* LDV_COMMENT_END_PREP */
 2059 	/* content: static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 2060 	/* LDV_COMMENT_BEGIN_PREP */
 2061 	#define DRIVER_AUTHOR					\
 2062 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2063 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2064 	#define DRIVER_NAME "usbvision"
 2065 	#define DRIVER_ALIAS "USBVision"
 2066 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2067 	#define DRIVER_LICENSE "GPL"
 2068 	#define USBVISION_VERSION_STRING "0.9.11"
 2069 	#define	ENABLE_HEXDUMP	0	
 2070 	#ifdef USBVISION_DEBUG
 2071 	#define PDEBUG(level, fmt, args...) { \
 2072 		if (video_debug & (level)) \
 2073 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2074 				__func__, __LINE__ , ## args); \
 2075 	}
 2076 	#else
 2077 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2078 	#endif
 2079 	#define DBG_IO		(1 << 1)
 2080 	#define DBG_PROBE	(1 << 2)
 2081 	#define DBG_MMAP	(1 << 3)
 2082 	#define rmspace(str)	while (*str == ' ') str++;
 2083 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2084 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2085 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2086 	#endif
 2087 	/* LDV_COMMENT_END_PREP */
 2088 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_fmt_vid_cap" */
 2089 	void * var_vidioc_s_fmt_vid_cap_40_p1;
 2090 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_fmt_vid_cap" */
 2091 	struct v4l2_format * var_vidioc_s_fmt_vid_cap_40_p2;
 2092 	/* LDV_COMMENT_BEGIN_PREP */
 2093 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2094 	#endif
 2095 	/* LDV_COMMENT_END_PREP */
 2096 	/* content: static int vidioc_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *vr)*/
 2097 	/* LDV_COMMENT_BEGIN_PREP */
 2098 	#define DRIVER_AUTHOR					\
 2099 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2100 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2101 	#define DRIVER_NAME "usbvision"
 2102 	#define DRIVER_ALIAS "USBVision"
 2103 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2104 	#define DRIVER_LICENSE "GPL"
 2105 	#define USBVISION_VERSION_STRING "0.9.11"
 2106 	#define	ENABLE_HEXDUMP	0	
 2107 	#ifdef USBVISION_DEBUG
 2108 	#define PDEBUG(level, fmt, args...) { \
 2109 		if (video_debug & (level)) \
 2110 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2111 				__func__, __LINE__ , ## args); \
 2112 	}
 2113 	#else
 2114 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2115 	#endif
 2116 	#define DBG_IO		(1 << 1)
 2117 	#define DBG_PROBE	(1 << 2)
 2118 	#define DBG_MMAP	(1 << 3)
 2119 	#define rmspace(str)	while (*str == ' ') str++;
 2120 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2121 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2122 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2123 	#endif
 2124 	/* LDV_COMMENT_END_PREP */
 2125 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_reqbufs" */
 2126 	void * var_vidioc_reqbufs_31_p1;
 2127 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_reqbufs" */
 2128 	struct v4l2_requestbuffers * var_vidioc_reqbufs_31_p2;
 2129 	/* LDV_COMMENT_BEGIN_PREP */
 2130 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2131 	#endif
 2132 	/* LDV_COMMENT_END_PREP */
 2133 	/* content: static int vidioc_querybuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 2134 	/* LDV_COMMENT_BEGIN_PREP */
 2135 	#define DRIVER_AUTHOR					\
 2136 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2137 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2138 	#define DRIVER_NAME "usbvision"
 2139 	#define DRIVER_ALIAS "USBVision"
 2140 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2141 	#define DRIVER_LICENSE "GPL"
 2142 	#define USBVISION_VERSION_STRING "0.9.11"
 2143 	#define	ENABLE_HEXDUMP	0	
 2144 	#ifdef USBVISION_DEBUG
 2145 	#define PDEBUG(level, fmt, args...) { \
 2146 		if (video_debug & (level)) \
 2147 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2148 				__func__, __LINE__ , ## args); \
 2149 	}
 2150 	#else
 2151 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2152 	#endif
 2153 	#define DBG_IO		(1 << 1)
 2154 	#define DBG_PROBE	(1 << 2)
 2155 	#define DBG_MMAP	(1 << 3)
 2156 	#define rmspace(str)	while (*str == ' ') str++;
 2157 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2158 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2159 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2160 	#endif
 2161 	/* LDV_COMMENT_END_PREP */
 2162 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_querybuf" */
 2163 	void * var_vidioc_querybuf_32_p1;
 2164 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_querybuf" */
 2165 	struct v4l2_buffer * var_vidioc_querybuf_32_p2;
 2166 	/* LDV_COMMENT_BEGIN_PREP */
 2167 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2168 	#endif
 2169 	/* LDV_COMMENT_END_PREP */
 2170 	/* content: static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 2171 	/* LDV_COMMENT_BEGIN_PREP */
 2172 	#define DRIVER_AUTHOR					\
 2173 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2174 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2175 	#define DRIVER_NAME "usbvision"
 2176 	#define DRIVER_ALIAS "USBVision"
 2177 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2178 	#define DRIVER_LICENSE "GPL"
 2179 	#define USBVISION_VERSION_STRING "0.9.11"
 2180 	#define	ENABLE_HEXDUMP	0	
 2181 	#ifdef USBVISION_DEBUG
 2182 	#define PDEBUG(level, fmt, args...) { \
 2183 		if (video_debug & (level)) \
 2184 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2185 				__func__, __LINE__ , ## args); \
 2186 	}
 2187 	#else
 2188 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2189 	#endif
 2190 	#define DBG_IO		(1 << 1)
 2191 	#define DBG_PROBE	(1 << 2)
 2192 	#define DBG_MMAP	(1 << 3)
 2193 	#define rmspace(str)	while (*str == ' ') str++;
 2194 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2195 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2196 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2197 	#endif
 2198 	/* LDV_COMMENT_END_PREP */
 2199 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_qbuf" */
 2200 	void * var_vidioc_qbuf_33_p1;
 2201 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_qbuf" */
 2202 	struct v4l2_buffer * var_vidioc_qbuf_33_p2;
 2203 	/* LDV_COMMENT_BEGIN_PREP */
 2204 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2205 	#endif
 2206 	/* LDV_COMMENT_END_PREP */
 2207 	/* content: static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 2208 	/* LDV_COMMENT_BEGIN_PREP */
 2209 	#define DRIVER_AUTHOR					\
 2210 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2211 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2212 	#define DRIVER_NAME "usbvision"
 2213 	#define DRIVER_ALIAS "USBVision"
 2214 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2215 	#define DRIVER_LICENSE "GPL"
 2216 	#define USBVISION_VERSION_STRING "0.9.11"
 2217 	#define	ENABLE_HEXDUMP	0	
 2218 	#ifdef USBVISION_DEBUG
 2219 	#define PDEBUG(level, fmt, args...) { \
 2220 		if (video_debug & (level)) \
 2221 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2222 				__func__, __LINE__ , ## args); \
 2223 	}
 2224 	#else
 2225 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2226 	#endif
 2227 	#define DBG_IO		(1 << 1)
 2228 	#define DBG_PROBE	(1 << 2)
 2229 	#define DBG_MMAP	(1 << 3)
 2230 	#define rmspace(str)	while (*str == ' ') str++;
 2231 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2232 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2233 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2234 	#endif
 2235 	/* LDV_COMMENT_END_PREP */
 2236 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_dqbuf" */
 2237 	void * var_vidioc_dqbuf_34_p1;
 2238 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_dqbuf" */
 2239 	struct v4l2_buffer * var_vidioc_dqbuf_34_p2;
 2240 	/* LDV_COMMENT_BEGIN_PREP */
 2241 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2242 	#endif
 2243 	/* LDV_COMMENT_END_PREP */
 2244 	/* content: static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)*/
 2245 	/* LDV_COMMENT_BEGIN_PREP */
 2246 	#define DRIVER_AUTHOR					\
 2247 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2248 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2249 	#define DRIVER_NAME "usbvision"
 2250 	#define DRIVER_ALIAS "USBVision"
 2251 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2252 	#define DRIVER_LICENSE "GPL"
 2253 	#define USBVISION_VERSION_STRING "0.9.11"
 2254 	#define	ENABLE_HEXDUMP	0	
 2255 	#ifdef USBVISION_DEBUG
 2256 	#define PDEBUG(level, fmt, args...) { \
 2257 		if (video_debug & (level)) \
 2258 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2259 				__func__, __LINE__ , ## args); \
 2260 	}
 2261 	#else
 2262 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2263 	#endif
 2264 	#define DBG_IO		(1 << 1)
 2265 	#define DBG_PROBE	(1 << 2)
 2266 	#define DBG_MMAP	(1 << 3)
 2267 	#define rmspace(str)	while (*str == ' ') str++;
 2268 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2269 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2270 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2271 	#endif
 2272 	/* LDV_COMMENT_END_PREP */
 2273 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_std" */
 2274 	void * var_vidioc_s_std_20_p1;
 2275 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_std" */
 2276 	v4l2_std_id  var_vidioc_s_std_20_p2;
 2277 	/* LDV_COMMENT_BEGIN_PREP */
 2278 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2279 	#endif
 2280 	/* LDV_COMMENT_END_PREP */
 2281 	/* content: static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)*/
 2282 	/* LDV_COMMENT_BEGIN_PREP */
 2283 	#define DRIVER_AUTHOR					\
 2284 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2285 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2286 	#define DRIVER_NAME "usbvision"
 2287 	#define DRIVER_ALIAS "USBVision"
 2288 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2289 	#define DRIVER_LICENSE "GPL"
 2290 	#define USBVISION_VERSION_STRING "0.9.11"
 2291 	#define	ENABLE_HEXDUMP	0	
 2292 	#ifdef USBVISION_DEBUG
 2293 	#define PDEBUG(level, fmt, args...) { \
 2294 		if (video_debug & (level)) \
 2295 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2296 				__func__, __LINE__ , ## args); \
 2297 	}
 2298 	#else
 2299 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2300 	#endif
 2301 	#define DBG_IO		(1 << 1)
 2302 	#define DBG_PROBE	(1 << 2)
 2303 	#define DBG_MMAP	(1 << 3)
 2304 	#define rmspace(str)	while (*str == ' ') str++;
 2305 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2306 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2307 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2308 	#endif
 2309 	/* LDV_COMMENT_END_PREP */
 2310 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_std" */
 2311 	void * var_vidioc_g_std_21_p1;
 2312 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_std" */
 2313 	v4l2_std_id * var_vidioc_g_std_21_p2;
 2314 	/* LDV_COMMENT_BEGIN_PREP */
 2315 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2316 	#endif
 2317 	/* LDV_COMMENT_END_PREP */
 2318 	/* content: static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *vi)*/
 2319 	/* LDV_COMMENT_BEGIN_PREP */
 2320 	#define DRIVER_AUTHOR					\
 2321 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2322 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2323 	#define DRIVER_NAME "usbvision"
 2324 	#define DRIVER_ALIAS "USBVision"
 2325 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2326 	#define DRIVER_LICENSE "GPL"
 2327 	#define USBVISION_VERSION_STRING "0.9.11"
 2328 	#define	ENABLE_HEXDUMP	0	
 2329 	#ifdef USBVISION_DEBUG
 2330 	#define PDEBUG(level, fmt, args...) { \
 2331 		if (video_debug & (level)) \
 2332 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2333 				__func__, __LINE__ , ## args); \
 2334 	}
 2335 	#else
 2336 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2337 	#endif
 2338 	#define DBG_IO		(1 << 1)
 2339 	#define DBG_PROBE	(1 << 2)
 2340 	#define DBG_MMAP	(1 << 3)
 2341 	#define rmspace(str)	while (*str == ' ') str++;
 2342 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2343 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2344 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2345 	#endif
 2346 	/* LDV_COMMENT_END_PREP */
 2347 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_enum_input" */
 2348 	void * var_vidioc_enum_input_17_p1;
 2349 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_enum_input" */
 2350 	struct v4l2_input * var_vidioc_enum_input_17_p2;
 2351 	/* LDV_COMMENT_BEGIN_PREP */
 2352 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2353 	#endif
 2354 	/* LDV_COMMENT_END_PREP */
 2355 	/* content: static int vidioc_g_input(struct file *file, void *priv, unsigned int *input)*/
 2356 	/* LDV_COMMENT_BEGIN_PREP */
 2357 	#define DRIVER_AUTHOR					\
 2358 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2359 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2360 	#define DRIVER_NAME "usbvision"
 2361 	#define DRIVER_ALIAS "USBVision"
 2362 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2363 	#define DRIVER_LICENSE "GPL"
 2364 	#define USBVISION_VERSION_STRING "0.9.11"
 2365 	#define	ENABLE_HEXDUMP	0	
 2366 	#ifdef USBVISION_DEBUG
 2367 	#define PDEBUG(level, fmt, args...) { \
 2368 		if (video_debug & (level)) \
 2369 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2370 				__func__, __LINE__ , ## args); \
 2371 	}
 2372 	#else
 2373 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2374 	#endif
 2375 	#define DBG_IO		(1 << 1)
 2376 	#define DBG_PROBE	(1 << 2)
 2377 	#define DBG_MMAP	(1 << 3)
 2378 	#define rmspace(str)	while (*str == ' ') str++;
 2379 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2380 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2381 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2382 	#endif
 2383 	/* LDV_COMMENT_END_PREP */
 2384 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_input" */
 2385 	void * var_vidioc_g_input_18_p1;
 2386 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_input" */
 2387 	unsigned int * var_vidioc_g_input_18_p2;
 2388 	/* LDV_COMMENT_BEGIN_PREP */
 2389 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2390 	#endif
 2391 	/* LDV_COMMENT_END_PREP */
 2392 	/* content: static int vidioc_s_input(struct file *file, void *priv, unsigned int input)*/
 2393 	/* LDV_COMMENT_BEGIN_PREP */
 2394 	#define DRIVER_AUTHOR					\
 2395 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2396 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2397 	#define DRIVER_NAME "usbvision"
 2398 	#define DRIVER_ALIAS "USBVision"
 2399 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2400 	#define DRIVER_LICENSE "GPL"
 2401 	#define USBVISION_VERSION_STRING "0.9.11"
 2402 	#define	ENABLE_HEXDUMP	0	
 2403 	#ifdef USBVISION_DEBUG
 2404 	#define PDEBUG(level, fmt, args...) { \
 2405 		if (video_debug & (level)) \
 2406 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2407 				__func__, __LINE__ , ## args); \
 2408 	}
 2409 	#else
 2410 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2411 	#endif
 2412 	#define DBG_IO		(1 << 1)
 2413 	#define DBG_PROBE	(1 << 2)
 2414 	#define DBG_MMAP	(1 << 3)
 2415 	#define rmspace(str)	while (*str == ' ') str++;
 2416 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2417 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2418 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2419 	#endif
 2420 	/* LDV_COMMENT_END_PREP */
 2421 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_input" */
 2422 	void * var_vidioc_s_input_19_p1;
 2423 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_input" */
 2424 	unsigned int  var_vidioc_s_input_19_p2;
 2425 	/* LDV_COMMENT_BEGIN_PREP */
 2426 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2427 	#endif
 2428 	/* LDV_COMMENT_END_PREP */
 2429 	/* content: static int vidioc_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *ctrl)*/
 2430 	/* LDV_COMMENT_BEGIN_PREP */
 2431 	#define DRIVER_AUTHOR					\
 2432 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2433 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2434 	#define DRIVER_NAME "usbvision"
 2435 	#define DRIVER_ALIAS "USBVision"
 2436 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2437 	#define DRIVER_LICENSE "GPL"
 2438 	#define USBVISION_VERSION_STRING "0.9.11"
 2439 	#define	ENABLE_HEXDUMP	0	
 2440 	#ifdef USBVISION_DEBUG
 2441 	#define PDEBUG(level, fmt, args...) { \
 2442 		if (video_debug & (level)) \
 2443 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2444 				__func__, __LINE__ , ## args); \
 2445 	}
 2446 	#else
 2447 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2448 	#endif
 2449 	#define DBG_IO		(1 << 1)
 2450 	#define DBG_PROBE	(1 << 2)
 2451 	#define DBG_MMAP	(1 << 3)
 2452 	#define rmspace(str)	while (*str == ' ') str++;
 2453 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2454 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2455 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2456 	#endif
 2457 	/* LDV_COMMENT_END_PREP */
 2458 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_queryctrl" */
 2459 	void * var_vidioc_queryctrl_28_p1;
 2460 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_queryctrl" */
 2461 	struct v4l2_queryctrl * var_vidioc_queryctrl_28_p2;
 2462 	/* LDV_COMMENT_BEGIN_PREP */
 2463 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2464 	#endif
 2465 	/* LDV_COMMENT_END_PREP */
 2466 	/* content: static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)*/
 2467 	/* LDV_COMMENT_BEGIN_PREP */
 2468 	#define DRIVER_AUTHOR					\
 2469 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2470 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2471 	#define DRIVER_NAME "usbvision"
 2472 	#define DRIVER_ALIAS "USBVision"
 2473 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2474 	#define DRIVER_LICENSE "GPL"
 2475 	#define USBVISION_VERSION_STRING "0.9.11"
 2476 	#define	ENABLE_HEXDUMP	0	
 2477 	#ifdef USBVISION_DEBUG
 2478 	#define PDEBUG(level, fmt, args...) { \
 2479 		if (video_debug & (level)) \
 2480 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2481 				__func__, __LINE__ , ## args); \
 2482 	}
 2483 	#else
 2484 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2485 	#endif
 2486 	#define DBG_IO		(1 << 1)
 2487 	#define DBG_PROBE	(1 << 2)
 2488 	#define DBG_MMAP	(1 << 3)
 2489 	#define rmspace(str)	while (*str == ' ') str++;
 2490 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2491 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2492 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2493 	#endif
 2494 	/* LDV_COMMENT_END_PREP */
 2495 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_audio" */
 2496 	void * var_vidioc_g_audio_26_p1;
 2497 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_audio" */
 2498 	struct v4l2_audio * var_vidioc_g_audio_26_p2;
 2499 	/* LDV_COMMENT_BEGIN_PREP */
 2500 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2501 	#endif
 2502 	/* LDV_COMMENT_END_PREP */
 2503 	/* content: static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)*/
 2504 	/* LDV_COMMENT_BEGIN_PREP */
 2505 	#define DRIVER_AUTHOR					\
 2506 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2507 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2508 	#define DRIVER_NAME "usbvision"
 2509 	#define DRIVER_ALIAS "USBVision"
 2510 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2511 	#define DRIVER_LICENSE "GPL"
 2512 	#define USBVISION_VERSION_STRING "0.9.11"
 2513 	#define	ENABLE_HEXDUMP	0	
 2514 	#ifdef USBVISION_DEBUG
 2515 	#define PDEBUG(level, fmt, args...) { \
 2516 		if (video_debug & (level)) \
 2517 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2518 				__func__, __LINE__ , ## args); \
 2519 	}
 2520 	#else
 2521 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2522 	#endif
 2523 	#define DBG_IO		(1 << 1)
 2524 	#define DBG_PROBE	(1 << 2)
 2525 	#define DBG_MMAP	(1 << 3)
 2526 	#define rmspace(str)	while (*str == ' ') str++;
 2527 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2528 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2529 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2530 	#endif
 2531 	/* LDV_COMMENT_END_PREP */
 2532 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_audio" */
 2533 	void * var_vidioc_s_audio_27_p1;
 2534 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_audio" */
 2535 	const struct v4l2_audio * var_vidioc_s_audio_27_p2;
 2536 	/* LDV_COMMENT_BEGIN_PREP */
 2537 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2538 	#endif
 2539 	/* LDV_COMMENT_END_PREP */
 2540 	/* content: static int vidioc_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 2541 	/* LDV_COMMENT_BEGIN_PREP */
 2542 	#define DRIVER_AUTHOR					\
 2543 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2544 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2545 	#define DRIVER_NAME "usbvision"
 2546 	#define DRIVER_ALIAS "USBVision"
 2547 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2548 	#define DRIVER_LICENSE "GPL"
 2549 	#define USBVISION_VERSION_STRING "0.9.11"
 2550 	#define	ENABLE_HEXDUMP	0	
 2551 	#ifdef USBVISION_DEBUG
 2552 	#define PDEBUG(level, fmt, args...) { \
 2553 		if (video_debug & (level)) \
 2554 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2555 				__func__, __LINE__ , ## args); \
 2556 	}
 2557 	#else
 2558 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2559 	#endif
 2560 	#define DBG_IO		(1 << 1)
 2561 	#define DBG_PROBE	(1 << 2)
 2562 	#define DBG_MMAP	(1 << 3)
 2563 	#define rmspace(str)	while (*str == ' ') str++;
 2564 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2565 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2566 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2567 	#endif
 2568 	/* LDV_COMMENT_END_PREP */
 2569 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_ctrl" */
 2570 	void * var_vidioc_g_ctrl_29_p1;
 2571 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_ctrl" */
 2572 	struct v4l2_control * var_vidioc_g_ctrl_29_p2;
 2573 	/* LDV_COMMENT_BEGIN_PREP */
 2574 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2575 	#endif
 2576 	/* LDV_COMMENT_END_PREP */
 2577 	/* content: static int vidioc_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 2578 	/* LDV_COMMENT_BEGIN_PREP */
 2579 	#define DRIVER_AUTHOR					\
 2580 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2581 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2582 	#define DRIVER_NAME "usbvision"
 2583 	#define DRIVER_ALIAS "USBVision"
 2584 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2585 	#define DRIVER_LICENSE "GPL"
 2586 	#define USBVISION_VERSION_STRING "0.9.11"
 2587 	#define	ENABLE_HEXDUMP	0	
 2588 	#ifdef USBVISION_DEBUG
 2589 	#define PDEBUG(level, fmt, args...) { \
 2590 		if (video_debug & (level)) \
 2591 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2592 				__func__, __LINE__ , ## args); \
 2593 	}
 2594 	#else
 2595 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2596 	#endif
 2597 	#define DBG_IO		(1 << 1)
 2598 	#define DBG_PROBE	(1 << 2)
 2599 	#define DBG_MMAP	(1 << 3)
 2600 	#define rmspace(str)	while (*str == ' ') str++;
 2601 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2602 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2603 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2604 	#endif
 2605 	/* LDV_COMMENT_END_PREP */
 2606 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_ctrl" */
 2607 	void * var_vidioc_s_ctrl_30_p1;
 2608 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_ctrl" */
 2609 	struct v4l2_control * var_vidioc_s_ctrl_30_p2;
 2610 	/* LDV_COMMENT_BEGIN_PREP */
 2611 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2612 	#endif
 2613 	/* LDV_COMMENT_END_PREP */
 2614 	/* content: static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)*/
 2615 	/* LDV_COMMENT_BEGIN_PREP */
 2616 	#define DRIVER_AUTHOR					\
 2617 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2618 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2619 	#define DRIVER_NAME "usbvision"
 2620 	#define DRIVER_ALIAS "USBVision"
 2621 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2622 	#define DRIVER_LICENSE "GPL"
 2623 	#define USBVISION_VERSION_STRING "0.9.11"
 2624 	#define	ENABLE_HEXDUMP	0	
 2625 	#ifdef USBVISION_DEBUG
 2626 	#define PDEBUG(level, fmt, args...) { \
 2627 		if (video_debug & (level)) \
 2628 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2629 				__func__, __LINE__ , ## args); \
 2630 	}
 2631 	#else
 2632 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2633 	#endif
 2634 	#define DBG_IO		(1 << 1)
 2635 	#define DBG_PROBE	(1 << 2)
 2636 	#define DBG_MMAP	(1 << 3)
 2637 	#define rmspace(str)	while (*str == ' ') str++;
 2638 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2639 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2640 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2641 	#endif
 2642 	/* LDV_COMMENT_END_PREP */
 2643 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_streamon" */
 2644 	void * var_vidioc_streamon_35_p1;
 2645 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_streamon" */
 2646 	enum v4l2_buf_type  var_vidioc_streamon_35_p2;
 2647 	/* LDV_COMMENT_BEGIN_PREP */
 2648 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2649 	#endif
 2650 	/* LDV_COMMENT_END_PREP */
 2651 	/* content: static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type type)*/
 2652 	/* LDV_COMMENT_BEGIN_PREP */
 2653 	#define DRIVER_AUTHOR					\
 2654 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2655 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2656 	#define DRIVER_NAME "usbvision"
 2657 	#define DRIVER_ALIAS "USBVision"
 2658 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2659 	#define DRIVER_LICENSE "GPL"
 2660 	#define USBVISION_VERSION_STRING "0.9.11"
 2661 	#define	ENABLE_HEXDUMP	0	
 2662 	#ifdef USBVISION_DEBUG
 2663 	#define PDEBUG(level, fmt, args...) { \
 2664 		if (video_debug & (level)) \
 2665 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2666 				__func__, __LINE__ , ## args); \
 2667 	}
 2668 	#else
 2669 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2670 	#endif
 2671 	#define DBG_IO		(1 << 1)
 2672 	#define DBG_PROBE	(1 << 2)
 2673 	#define DBG_MMAP	(1 << 3)
 2674 	#define rmspace(str)	while (*str == ' ') str++;
 2675 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2676 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2677 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2678 	#endif
 2679 	/* LDV_COMMENT_END_PREP */
 2680 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_streamoff" */
 2681 	void * var_vidioc_streamoff_36_p1;
 2682 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_streamoff" */
 2683 	enum v4l2_buf_type  var_vidioc_streamoff_36_p2;
 2684 	/* LDV_COMMENT_BEGIN_PREP */
 2685 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2686 	#endif
 2687 	/* LDV_COMMENT_END_PREP */
 2688 	/* content: static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)*/
 2689 	/* LDV_COMMENT_BEGIN_PREP */
 2690 	#define DRIVER_AUTHOR					\
 2691 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2692 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2693 	#define DRIVER_NAME "usbvision"
 2694 	#define DRIVER_ALIAS "USBVision"
 2695 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2696 	#define DRIVER_LICENSE "GPL"
 2697 	#define USBVISION_VERSION_STRING "0.9.11"
 2698 	#define	ENABLE_HEXDUMP	0	
 2699 	#ifdef USBVISION_DEBUG
 2700 	#define PDEBUG(level, fmt, args...) { \
 2701 		if (video_debug & (level)) \
 2702 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2703 				__func__, __LINE__ , ## args); \
 2704 	}
 2705 	#else
 2706 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2707 	#endif
 2708 	#define DBG_IO		(1 << 1)
 2709 	#define DBG_PROBE	(1 << 2)
 2710 	#define DBG_MMAP	(1 << 3)
 2711 	#define rmspace(str)	while (*str == ' ') str++;
 2712 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2713 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2714 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2715 	#endif
 2716 	/* LDV_COMMENT_END_PREP */
 2717 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_tuner" */
 2718 	void * var_vidioc_g_tuner_22_p1;
 2719 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_tuner" */
 2720 	struct v4l2_tuner * var_vidioc_g_tuner_22_p2;
 2721 	/* LDV_COMMENT_BEGIN_PREP */
 2722 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2723 	#endif
 2724 	/* LDV_COMMENT_END_PREP */
 2725 	/* content: static int vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *vt)*/
 2726 	/* LDV_COMMENT_BEGIN_PREP */
 2727 	#define DRIVER_AUTHOR					\
 2728 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2729 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2730 	#define DRIVER_NAME "usbvision"
 2731 	#define DRIVER_ALIAS "USBVision"
 2732 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2733 	#define DRIVER_LICENSE "GPL"
 2734 	#define USBVISION_VERSION_STRING "0.9.11"
 2735 	#define	ENABLE_HEXDUMP	0	
 2736 	#ifdef USBVISION_DEBUG
 2737 	#define PDEBUG(level, fmt, args...) { \
 2738 		if (video_debug & (level)) \
 2739 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2740 				__func__, __LINE__ , ## args); \
 2741 	}
 2742 	#else
 2743 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2744 	#endif
 2745 	#define DBG_IO		(1 << 1)
 2746 	#define DBG_PROBE	(1 << 2)
 2747 	#define DBG_MMAP	(1 << 3)
 2748 	#define rmspace(str)	while (*str == ' ') str++;
 2749 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2750 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2751 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2752 	#endif
 2753 	/* LDV_COMMENT_END_PREP */
 2754 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_tuner" */
 2755 	void * var_vidioc_s_tuner_23_p1;
 2756 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_tuner" */
 2757 	const struct v4l2_tuner * var_vidioc_s_tuner_23_p2;
 2758 	/* LDV_COMMENT_BEGIN_PREP */
 2759 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2760 	#endif
 2761 	/* LDV_COMMENT_END_PREP */
 2762 	/* content: static int vidioc_g_frequency(struct file *file, void *priv, struct v4l2_frequency *freq)*/
 2763 	/* LDV_COMMENT_BEGIN_PREP */
 2764 	#define DRIVER_AUTHOR					\
 2765 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2766 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2767 	#define DRIVER_NAME "usbvision"
 2768 	#define DRIVER_ALIAS "USBVision"
 2769 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2770 	#define DRIVER_LICENSE "GPL"
 2771 	#define USBVISION_VERSION_STRING "0.9.11"
 2772 	#define	ENABLE_HEXDUMP	0	
 2773 	#ifdef USBVISION_DEBUG
 2774 	#define PDEBUG(level, fmt, args...) { \
 2775 		if (video_debug & (level)) \
 2776 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2777 				__func__, __LINE__ , ## args); \
 2778 	}
 2779 	#else
 2780 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2781 	#endif
 2782 	#define DBG_IO		(1 << 1)
 2783 	#define DBG_PROBE	(1 << 2)
 2784 	#define DBG_MMAP	(1 << 3)
 2785 	#define rmspace(str)	while (*str == ' ') str++;
 2786 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2787 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2788 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2789 	#endif
 2790 	/* LDV_COMMENT_END_PREP */
 2791 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_frequency" */
 2792 	void * var_vidioc_g_frequency_24_p1;
 2793 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_frequency" */
 2794 	struct v4l2_frequency * var_vidioc_g_frequency_24_p2;
 2795 	/* LDV_COMMENT_BEGIN_PREP */
 2796 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2797 	#endif
 2798 	/* LDV_COMMENT_END_PREP */
 2799 	/* content: static int vidioc_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *freq)*/
 2800 	/* LDV_COMMENT_BEGIN_PREP */
 2801 	#define DRIVER_AUTHOR					\
 2802 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2803 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2804 	#define DRIVER_NAME "usbvision"
 2805 	#define DRIVER_ALIAS "USBVision"
 2806 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2807 	#define DRIVER_LICENSE "GPL"
 2808 	#define USBVISION_VERSION_STRING "0.9.11"
 2809 	#define	ENABLE_HEXDUMP	0	
 2810 	#ifdef USBVISION_DEBUG
 2811 	#define PDEBUG(level, fmt, args...) { \
 2812 		if (video_debug & (level)) \
 2813 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2814 				__func__, __LINE__ , ## args); \
 2815 	}
 2816 	#else
 2817 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2818 	#endif
 2819 	#define DBG_IO		(1 << 1)
 2820 	#define DBG_PROBE	(1 << 2)
 2821 	#define DBG_MMAP	(1 << 3)
 2822 	#define rmspace(str)	while (*str == ' ') str++;
 2823 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2824 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2825 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2826 	#endif
 2827 	/* LDV_COMMENT_END_PREP */
 2828 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_frequency" */
 2829 	void * var_vidioc_s_frequency_25_p1;
 2830 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_frequency" */
 2831 	const struct v4l2_frequency * var_vidioc_s_frequency_25_p2;
 2832 	/* LDV_COMMENT_BEGIN_PREP */
 2833 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2834 	#endif
 2835 	/* LDV_COMMENT_END_PREP */
 2836 	/* content: static int vidioc_g_register(struct file *file, void *priv, struct v4l2_dbg_register *reg)*/
 2837 	/* LDV_COMMENT_BEGIN_PREP */
 2838 	#define DRIVER_AUTHOR					\
 2839 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2840 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2841 	#define DRIVER_NAME "usbvision"
 2842 	#define DRIVER_ALIAS "USBVision"
 2843 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2844 	#define DRIVER_LICENSE "GPL"
 2845 	#define USBVISION_VERSION_STRING "0.9.11"
 2846 	#define	ENABLE_HEXDUMP	0	
 2847 	#ifdef USBVISION_DEBUG
 2848 	#define PDEBUG(level, fmt, args...) { \
 2849 		if (video_debug & (level)) \
 2850 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2851 				__func__, __LINE__ , ## args); \
 2852 	}
 2853 	#else
 2854 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2855 	#endif
 2856 	#define DBG_IO		(1 << 1)
 2857 	#define DBG_PROBE	(1 << 2)
 2858 	#define DBG_MMAP	(1 << 3)
 2859 	#define rmspace(str)	while (*str == ' ') str++;
 2860 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2861 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2862 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2863 	/* LDV_COMMENT_END_PREP */
 2864 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_register" */
 2865 	void * var_vidioc_g_register_14_p1;
 2866 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_register" */
 2867 	struct v4l2_dbg_register * var_vidioc_g_register_14_p2;
 2868 	/* LDV_COMMENT_BEGIN_PREP */
 2869 	#endif
 2870 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2871 	#endif
 2872 	/* LDV_COMMENT_END_PREP */
 2873 	/* content: static int vidioc_s_register(struct file *file, void *priv, const struct v4l2_dbg_register *reg)*/
 2874 	/* LDV_COMMENT_BEGIN_PREP */
 2875 	#define DRIVER_AUTHOR					\
 2876 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2877 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2878 	#define DRIVER_NAME "usbvision"
 2879 	#define DRIVER_ALIAS "USBVision"
 2880 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2881 	#define DRIVER_LICENSE "GPL"
 2882 	#define USBVISION_VERSION_STRING "0.9.11"
 2883 	#define	ENABLE_HEXDUMP	0	
 2884 	#ifdef USBVISION_DEBUG
 2885 	#define PDEBUG(level, fmt, args...) { \
 2886 		if (video_debug & (level)) \
 2887 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2888 				__func__, __LINE__ , ## args); \
 2889 	}
 2890 	#else
 2891 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2892 	#endif
 2893 	#define DBG_IO		(1 << 1)
 2894 	#define DBG_PROBE	(1 << 2)
 2895 	#define DBG_MMAP	(1 << 3)
 2896 	#define rmspace(str)	while (*str == ' ') str++;
 2897 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2898 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2899 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2900 	/* LDV_COMMENT_END_PREP */
 2901 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_register" */
 2902 	void * var_vidioc_s_register_15_p1;
 2903 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_register" */
 2904 	const struct v4l2_dbg_register * var_vidioc_s_register_15_p2;
 2905 	/* LDV_COMMENT_BEGIN_PREP */
 2906 	#endif
 2907 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2908 	#endif
 2909 	/* LDV_COMMENT_END_PREP */
 2910 
 2911 	/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_radio_fops **/
 2912 	/* content: static int usbvision_radio_open(struct file *file)*/
 2913 	/* LDV_COMMENT_BEGIN_PREP */
 2914 	#define DRIVER_AUTHOR					\
 2915 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2916 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2917 	#define DRIVER_NAME "usbvision"
 2918 	#define DRIVER_ALIAS "USBVision"
 2919 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2920 	#define DRIVER_LICENSE "GPL"
 2921 	#define USBVISION_VERSION_STRING "0.9.11"
 2922 	#define	ENABLE_HEXDUMP	0	
 2923 	#ifdef USBVISION_DEBUG
 2924 	#define PDEBUG(level, fmt, args...) { \
 2925 		if (video_debug & (level)) \
 2926 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2927 				__func__, __LINE__ , ## args); \
 2928 	}
 2929 	#else
 2930 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2931 	#endif
 2932 	#define DBG_IO		(1 << 1)
 2933 	#define DBG_PROBE	(1 << 2)
 2934 	#define DBG_MMAP	(1 << 3)
 2935 	#define rmspace(str)	while (*str == ' ') str++;
 2936 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2937 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2938 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2939 	#endif
 2940 	/* LDV_COMMENT_END_PREP */
 2941 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "usbvision_radio_open" */
 2942 	static int res_usbvision_radio_open_45;
 2943 	/* LDV_COMMENT_BEGIN_PREP */
 2944 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2945 	#endif
 2946 	/* LDV_COMMENT_END_PREP */
 2947 	/* content: static int usbvision_radio_close(struct file *file)*/
 2948 	/* LDV_COMMENT_BEGIN_PREP */
 2949 	#define DRIVER_AUTHOR					\
 2950 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2951 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2952 	#define DRIVER_NAME "usbvision"
 2953 	#define DRIVER_ALIAS "USBVision"
 2954 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2955 	#define DRIVER_LICENSE "GPL"
 2956 	#define USBVISION_VERSION_STRING "0.9.11"
 2957 	#define	ENABLE_HEXDUMP	0	
 2958 	#ifdef USBVISION_DEBUG
 2959 	#define PDEBUG(level, fmt, args...) { \
 2960 		if (video_debug & (level)) \
 2961 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2962 				__func__, __LINE__ , ## args); \
 2963 	}
 2964 	#else
 2965 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2966 	#endif
 2967 	#define DBG_IO		(1 << 1)
 2968 	#define DBG_PROBE	(1 << 2)
 2969 	#define DBG_MMAP	(1 << 3)
 2970 	#define rmspace(str)	while (*str == ' ') str++;
 2971 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2972 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2973 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2974 	#endif
 2975 	/* LDV_COMMENT_END_PREP */
 2976 	/* LDV_COMMENT_BEGIN_PREP */
 2977 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2978 	#endif
 2979 	/* LDV_COMMENT_END_PREP */
 2980 
 2981 	/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 2982 	/* content: static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *vc)*/
 2983 	/* LDV_COMMENT_BEGIN_PREP */
 2984 	#define DRIVER_AUTHOR					\
 2985 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2986 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2987 	#define DRIVER_NAME "usbvision"
 2988 	#define DRIVER_ALIAS "USBVision"
 2989 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2990 	#define DRIVER_LICENSE "GPL"
 2991 	#define USBVISION_VERSION_STRING "0.9.11"
 2992 	#define	ENABLE_HEXDUMP	0	
 2993 	#ifdef USBVISION_DEBUG
 2994 	#define PDEBUG(level, fmt, args...) { \
 2995 		if (video_debug & (level)) \
 2996 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2997 				__func__, __LINE__ , ## args); \
 2998 	}
 2999 	#else
 3000 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3001 	#endif
 3002 	#define DBG_IO		(1 << 1)
 3003 	#define DBG_PROBE	(1 << 2)
 3004 	#define DBG_MMAP	(1 << 3)
 3005 	#define rmspace(str)	while (*str == ' ') str++;
 3006 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3007 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3008 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3009 	#endif
 3010 	/* LDV_COMMENT_END_PREP */
 3011 	/* LDV_COMMENT_BEGIN_PREP */
 3012 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3013 	#endif
 3014 	/* LDV_COMMENT_END_PREP */
 3015 	/* content: static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *vi)*/
 3016 	/* LDV_COMMENT_BEGIN_PREP */
 3017 	#define DRIVER_AUTHOR					\
 3018 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3019 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3020 	#define DRIVER_NAME "usbvision"
 3021 	#define DRIVER_ALIAS "USBVision"
 3022 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3023 	#define DRIVER_LICENSE "GPL"
 3024 	#define USBVISION_VERSION_STRING "0.9.11"
 3025 	#define	ENABLE_HEXDUMP	0	
 3026 	#ifdef USBVISION_DEBUG
 3027 	#define PDEBUG(level, fmt, args...) { \
 3028 		if (video_debug & (level)) \
 3029 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3030 				__func__, __LINE__ , ## args); \
 3031 	}
 3032 	#else
 3033 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3034 	#endif
 3035 	#define DBG_IO		(1 << 1)
 3036 	#define DBG_PROBE	(1 << 2)
 3037 	#define DBG_MMAP	(1 << 3)
 3038 	#define rmspace(str)	while (*str == ' ') str++;
 3039 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3040 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3041 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3042 	#endif
 3043 	/* LDV_COMMENT_END_PREP */
 3044 	/* LDV_COMMENT_BEGIN_PREP */
 3045 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3046 	#endif
 3047 	/* LDV_COMMENT_END_PREP */
 3048 	/* content: static int vidioc_g_input(struct file *file, void *priv, unsigned int *input)*/
 3049 	/* LDV_COMMENT_BEGIN_PREP */
 3050 	#define DRIVER_AUTHOR					\
 3051 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3052 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3053 	#define DRIVER_NAME "usbvision"
 3054 	#define DRIVER_ALIAS "USBVision"
 3055 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3056 	#define DRIVER_LICENSE "GPL"
 3057 	#define USBVISION_VERSION_STRING "0.9.11"
 3058 	#define	ENABLE_HEXDUMP	0	
 3059 	#ifdef USBVISION_DEBUG
 3060 	#define PDEBUG(level, fmt, args...) { \
 3061 		if (video_debug & (level)) \
 3062 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3063 				__func__, __LINE__ , ## args); \
 3064 	}
 3065 	#else
 3066 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3067 	#endif
 3068 	#define DBG_IO		(1 << 1)
 3069 	#define DBG_PROBE	(1 << 2)
 3070 	#define DBG_MMAP	(1 << 3)
 3071 	#define rmspace(str)	while (*str == ' ') str++;
 3072 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3073 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3074 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3075 	#endif
 3076 	/* LDV_COMMENT_END_PREP */
 3077 	/* LDV_COMMENT_BEGIN_PREP */
 3078 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3079 	#endif
 3080 	/* LDV_COMMENT_END_PREP */
 3081 	/* content: static int vidioc_s_input(struct file *file, void *priv, unsigned int input)*/
 3082 	/* LDV_COMMENT_BEGIN_PREP */
 3083 	#define DRIVER_AUTHOR					\
 3084 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3085 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3086 	#define DRIVER_NAME "usbvision"
 3087 	#define DRIVER_ALIAS "USBVision"
 3088 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3089 	#define DRIVER_LICENSE "GPL"
 3090 	#define USBVISION_VERSION_STRING "0.9.11"
 3091 	#define	ENABLE_HEXDUMP	0	
 3092 	#ifdef USBVISION_DEBUG
 3093 	#define PDEBUG(level, fmt, args...) { \
 3094 		if (video_debug & (level)) \
 3095 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3096 				__func__, __LINE__ , ## args); \
 3097 	}
 3098 	#else
 3099 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3100 	#endif
 3101 	#define DBG_IO		(1 << 1)
 3102 	#define DBG_PROBE	(1 << 2)
 3103 	#define DBG_MMAP	(1 << 3)
 3104 	#define rmspace(str)	while (*str == ' ') str++;
 3105 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3106 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3107 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3108 	#endif
 3109 	/* LDV_COMMENT_END_PREP */
 3110 	/* LDV_COMMENT_BEGIN_PREP */
 3111 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3112 	#endif
 3113 	/* LDV_COMMENT_END_PREP */
 3114 	/* content: static int vidioc_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *ctrl)*/
 3115 	/* LDV_COMMENT_BEGIN_PREP */
 3116 	#define DRIVER_AUTHOR					\
 3117 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3118 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3119 	#define DRIVER_NAME "usbvision"
 3120 	#define DRIVER_ALIAS "USBVision"
 3121 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3122 	#define DRIVER_LICENSE "GPL"
 3123 	#define USBVISION_VERSION_STRING "0.9.11"
 3124 	#define	ENABLE_HEXDUMP	0	
 3125 	#ifdef USBVISION_DEBUG
 3126 	#define PDEBUG(level, fmt, args...) { \
 3127 		if (video_debug & (level)) \
 3128 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3129 				__func__, __LINE__ , ## args); \
 3130 	}
 3131 	#else
 3132 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3133 	#endif
 3134 	#define DBG_IO		(1 << 1)
 3135 	#define DBG_PROBE	(1 << 2)
 3136 	#define DBG_MMAP	(1 << 3)
 3137 	#define rmspace(str)	while (*str == ' ') str++;
 3138 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3139 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3140 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3141 	#endif
 3142 	/* LDV_COMMENT_END_PREP */
 3143 	/* LDV_COMMENT_BEGIN_PREP */
 3144 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3145 	#endif
 3146 	/* LDV_COMMENT_END_PREP */
 3147 	/* content: static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)*/
 3148 	/* LDV_COMMENT_BEGIN_PREP */
 3149 	#define DRIVER_AUTHOR					\
 3150 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3151 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3152 	#define DRIVER_NAME "usbvision"
 3153 	#define DRIVER_ALIAS "USBVision"
 3154 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3155 	#define DRIVER_LICENSE "GPL"
 3156 	#define USBVISION_VERSION_STRING "0.9.11"
 3157 	#define	ENABLE_HEXDUMP	0	
 3158 	#ifdef USBVISION_DEBUG
 3159 	#define PDEBUG(level, fmt, args...) { \
 3160 		if (video_debug & (level)) \
 3161 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3162 				__func__, __LINE__ , ## args); \
 3163 	}
 3164 	#else
 3165 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3166 	#endif
 3167 	#define DBG_IO		(1 << 1)
 3168 	#define DBG_PROBE	(1 << 2)
 3169 	#define DBG_MMAP	(1 << 3)
 3170 	#define rmspace(str)	while (*str == ' ') str++;
 3171 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3172 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3173 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3174 	#endif
 3175 	/* LDV_COMMENT_END_PREP */
 3176 	/* LDV_COMMENT_BEGIN_PREP */
 3177 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3178 	#endif
 3179 	/* LDV_COMMENT_END_PREP */
 3180 	/* content: static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)*/
 3181 	/* LDV_COMMENT_BEGIN_PREP */
 3182 	#define DRIVER_AUTHOR					\
 3183 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3184 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3185 	#define DRIVER_NAME "usbvision"
 3186 	#define DRIVER_ALIAS "USBVision"
 3187 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3188 	#define DRIVER_LICENSE "GPL"
 3189 	#define USBVISION_VERSION_STRING "0.9.11"
 3190 	#define	ENABLE_HEXDUMP	0	
 3191 	#ifdef USBVISION_DEBUG
 3192 	#define PDEBUG(level, fmt, args...) { \
 3193 		if (video_debug & (level)) \
 3194 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3195 				__func__, __LINE__ , ## args); \
 3196 	}
 3197 	#else
 3198 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3199 	#endif
 3200 	#define DBG_IO		(1 << 1)
 3201 	#define DBG_PROBE	(1 << 2)
 3202 	#define DBG_MMAP	(1 << 3)
 3203 	#define rmspace(str)	while (*str == ' ') str++;
 3204 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3205 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3206 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3207 	#endif
 3208 	/* LDV_COMMENT_END_PREP */
 3209 	/* LDV_COMMENT_BEGIN_PREP */
 3210 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3211 	#endif
 3212 	/* LDV_COMMENT_END_PREP */
 3213 	/* content: static int vidioc_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 3214 	/* LDV_COMMENT_BEGIN_PREP */
 3215 	#define DRIVER_AUTHOR					\
 3216 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3217 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3218 	#define DRIVER_NAME "usbvision"
 3219 	#define DRIVER_ALIAS "USBVision"
 3220 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3221 	#define DRIVER_LICENSE "GPL"
 3222 	#define USBVISION_VERSION_STRING "0.9.11"
 3223 	#define	ENABLE_HEXDUMP	0	
 3224 	#ifdef USBVISION_DEBUG
 3225 	#define PDEBUG(level, fmt, args...) { \
 3226 		if (video_debug & (level)) \
 3227 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3228 				__func__, __LINE__ , ## args); \
 3229 	}
 3230 	#else
 3231 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3232 	#endif
 3233 	#define DBG_IO		(1 << 1)
 3234 	#define DBG_PROBE	(1 << 2)
 3235 	#define DBG_MMAP	(1 << 3)
 3236 	#define rmspace(str)	while (*str == ' ') str++;
 3237 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3238 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3239 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3240 	#endif
 3241 	/* LDV_COMMENT_END_PREP */
 3242 	/* LDV_COMMENT_BEGIN_PREP */
 3243 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3244 	#endif
 3245 	/* LDV_COMMENT_END_PREP */
 3246 	/* content: static int vidioc_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 3247 	/* LDV_COMMENT_BEGIN_PREP */
 3248 	#define DRIVER_AUTHOR					\
 3249 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3250 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3251 	#define DRIVER_NAME "usbvision"
 3252 	#define DRIVER_ALIAS "USBVision"
 3253 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3254 	#define DRIVER_LICENSE "GPL"
 3255 	#define USBVISION_VERSION_STRING "0.9.11"
 3256 	#define	ENABLE_HEXDUMP	0	
 3257 	#ifdef USBVISION_DEBUG
 3258 	#define PDEBUG(level, fmt, args...) { \
 3259 		if (video_debug & (level)) \
 3260 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3261 				__func__, __LINE__ , ## args); \
 3262 	}
 3263 	#else
 3264 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3265 	#endif
 3266 	#define DBG_IO		(1 << 1)
 3267 	#define DBG_PROBE	(1 << 2)
 3268 	#define DBG_MMAP	(1 << 3)
 3269 	#define rmspace(str)	while (*str == ' ') str++;
 3270 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3271 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3272 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3273 	#endif
 3274 	/* LDV_COMMENT_END_PREP */
 3275 	/* LDV_COMMENT_BEGIN_PREP */
 3276 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3277 	#endif
 3278 	/* LDV_COMMENT_END_PREP */
 3279 	/* content: static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)*/
 3280 	/* LDV_COMMENT_BEGIN_PREP */
 3281 	#define DRIVER_AUTHOR					\
 3282 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3283 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3284 	#define DRIVER_NAME "usbvision"
 3285 	#define DRIVER_ALIAS "USBVision"
 3286 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3287 	#define DRIVER_LICENSE "GPL"
 3288 	#define USBVISION_VERSION_STRING "0.9.11"
 3289 	#define	ENABLE_HEXDUMP	0	
 3290 	#ifdef USBVISION_DEBUG
 3291 	#define PDEBUG(level, fmt, args...) { \
 3292 		if (video_debug & (level)) \
 3293 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3294 				__func__, __LINE__ , ## args); \
 3295 	}
 3296 	#else
 3297 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3298 	#endif
 3299 	#define DBG_IO		(1 << 1)
 3300 	#define DBG_PROBE	(1 << 2)
 3301 	#define DBG_MMAP	(1 << 3)
 3302 	#define rmspace(str)	while (*str == ' ') str++;
 3303 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3304 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3305 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3306 	#endif
 3307 	/* LDV_COMMENT_END_PREP */
 3308 	/* LDV_COMMENT_BEGIN_PREP */
 3309 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3310 	#endif
 3311 	/* LDV_COMMENT_END_PREP */
 3312 	/* content: static int vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *vt)*/
 3313 	/* LDV_COMMENT_BEGIN_PREP */
 3314 	#define DRIVER_AUTHOR					\
 3315 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3316 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3317 	#define DRIVER_NAME "usbvision"
 3318 	#define DRIVER_ALIAS "USBVision"
 3319 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3320 	#define DRIVER_LICENSE "GPL"
 3321 	#define USBVISION_VERSION_STRING "0.9.11"
 3322 	#define	ENABLE_HEXDUMP	0	
 3323 	#ifdef USBVISION_DEBUG
 3324 	#define PDEBUG(level, fmt, args...) { \
 3325 		if (video_debug & (level)) \
 3326 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3327 				__func__, __LINE__ , ## args); \
 3328 	}
 3329 	#else
 3330 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3331 	#endif
 3332 	#define DBG_IO		(1 << 1)
 3333 	#define DBG_PROBE	(1 << 2)
 3334 	#define DBG_MMAP	(1 << 3)
 3335 	#define rmspace(str)	while (*str == ' ') str++;
 3336 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3337 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3338 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3339 	#endif
 3340 	/* LDV_COMMENT_END_PREP */
 3341 	/* LDV_COMMENT_BEGIN_PREP */
 3342 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3343 	#endif
 3344 	/* LDV_COMMENT_END_PREP */
 3345 	/* content: static int vidioc_g_frequency(struct file *file, void *priv, struct v4l2_frequency *freq)*/
 3346 	/* LDV_COMMENT_BEGIN_PREP */
 3347 	#define DRIVER_AUTHOR					\
 3348 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3349 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3350 	#define DRIVER_NAME "usbvision"
 3351 	#define DRIVER_ALIAS "USBVision"
 3352 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3353 	#define DRIVER_LICENSE "GPL"
 3354 	#define USBVISION_VERSION_STRING "0.9.11"
 3355 	#define	ENABLE_HEXDUMP	0	
 3356 	#ifdef USBVISION_DEBUG
 3357 	#define PDEBUG(level, fmt, args...) { \
 3358 		if (video_debug & (level)) \
 3359 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3360 				__func__, __LINE__ , ## args); \
 3361 	}
 3362 	#else
 3363 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3364 	#endif
 3365 	#define DBG_IO		(1 << 1)
 3366 	#define DBG_PROBE	(1 << 2)
 3367 	#define DBG_MMAP	(1 << 3)
 3368 	#define rmspace(str)	while (*str == ' ') str++;
 3369 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3370 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3371 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3372 	#endif
 3373 	/* LDV_COMMENT_END_PREP */
 3374 	/* LDV_COMMENT_BEGIN_PREP */
 3375 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3376 	#endif
 3377 	/* LDV_COMMENT_END_PREP */
 3378 	/* content: static int vidioc_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *freq)*/
 3379 	/* LDV_COMMENT_BEGIN_PREP */
 3380 	#define DRIVER_AUTHOR					\
 3381 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3382 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3383 	#define DRIVER_NAME "usbvision"
 3384 	#define DRIVER_ALIAS "USBVision"
 3385 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3386 	#define DRIVER_LICENSE "GPL"
 3387 	#define USBVISION_VERSION_STRING "0.9.11"
 3388 	#define	ENABLE_HEXDUMP	0	
 3389 	#ifdef USBVISION_DEBUG
 3390 	#define PDEBUG(level, fmt, args...) { \
 3391 		if (video_debug & (level)) \
 3392 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3393 				__func__, __LINE__ , ## args); \
 3394 	}
 3395 	#else
 3396 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3397 	#endif
 3398 	#define DBG_IO		(1 << 1)
 3399 	#define DBG_PROBE	(1 << 2)
 3400 	#define DBG_MMAP	(1 << 3)
 3401 	#define rmspace(str)	while (*str == ' ') str++;
 3402 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3403 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3404 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3405 	#endif
 3406 	/* LDV_COMMENT_END_PREP */
 3407 	/* LDV_COMMENT_BEGIN_PREP */
 3408 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3409 	#endif
 3410 	/* LDV_COMMENT_END_PREP */
 3411 
 3412 	/** STRUCT: struct type: usb_driver, struct name: usbvision_driver **/
 3413 	/* content: static int usbvision_probe(struct usb_interface *intf, const struct usb_device_id *devid)*/
 3414 	/* LDV_COMMENT_BEGIN_PREP */
 3415 	#define DRIVER_AUTHOR					\
 3416 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3417 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3418 	#define DRIVER_NAME "usbvision"
 3419 	#define DRIVER_ALIAS "USBVision"
 3420 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3421 	#define DRIVER_LICENSE "GPL"
 3422 	#define USBVISION_VERSION_STRING "0.9.11"
 3423 	#define	ENABLE_HEXDUMP	0	
 3424 	#ifdef USBVISION_DEBUG
 3425 	#define PDEBUG(level, fmt, args...) { \
 3426 		if (video_debug & (level)) \
 3427 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3428 				__func__, __LINE__ , ## args); \
 3429 	}
 3430 	#else
 3431 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3432 	#endif
 3433 	#define DBG_IO		(1 << 1)
 3434 	#define DBG_PROBE	(1 << 2)
 3435 	#define DBG_MMAP	(1 << 3)
 3436 	#define rmspace(str)	while (*str == ' ') str++;
 3437 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3438 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3439 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3440 	#endif
 3441 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3442 	#endif
 3443 	/* LDV_COMMENT_END_PREP */
 3444 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_probe" */
 3445 	struct usb_interface * var_group3;
 3446 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_probe" */
 3447 	const struct usb_device_id * var_usbvision_probe_53_p1;
 3448 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "usbvision_probe" */
 3449 	static int res_usbvision_probe_53;
 3450 	/* content: static void usbvision_disconnect(struct usb_interface *intf)*/
 3451 	/* LDV_COMMENT_BEGIN_PREP */
 3452 	#define DRIVER_AUTHOR					\
 3453 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3454 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3455 	#define DRIVER_NAME "usbvision"
 3456 	#define DRIVER_ALIAS "USBVision"
 3457 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3458 	#define DRIVER_LICENSE "GPL"
 3459 	#define USBVISION_VERSION_STRING "0.9.11"
 3460 	#define	ENABLE_HEXDUMP	0	
 3461 	#ifdef USBVISION_DEBUG
 3462 	#define PDEBUG(level, fmt, args...) { \
 3463 		if (video_debug & (level)) \
 3464 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3465 				__func__, __LINE__ , ## args); \
 3466 	}
 3467 	#else
 3468 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3469 	#endif
 3470 	#define DBG_IO		(1 << 1)
 3471 	#define DBG_PROBE	(1 << 2)
 3472 	#define DBG_MMAP	(1 << 3)
 3473 	#define rmspace(str)	while (*str == ' ') str++;
 3474 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3475 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3476 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3477 	#endif
 3478 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3479 	#endif
 3480 	/* LDV_COMMENT_END_PREP */
 3481 
 3482 
 3483 
 3484 
 3485 	/* LDV_COMMENT_END_VARIABLE_DECLARATION_PART */
 3486 	/* LDV_COMMENT_BEGIN_VARIABLE_INITIALIZING_PART */
 3487 	/*============================= VARIABLE INITIALIZING PART  =============================*/
 3488 	LDV_IN_INTERRUPT=1;
 3489 
 3490 
 3491 
 3492 
 3493 	/* LDV_COMMENT_END_VARIABLE_INITIALIZING_PART */
 3494 	/* LDV_COMMENT_BEGIN_FUNCTION_CALL_SECTION */
 3495 	/*============================= FUNCTION CALL SECTION       =============================*/
 3496 	/* LDV_COMMENT_FUNCTION_CALL Initialize LDV model. */
 3497 	ldv_initialize();
 3498 
 3499 	/** INIT: init_type: ST_MODULE_INIT **/
 3500 	/* content: static int __init usbvision_init(void)*/
 3501 	/* LDV_COMMENT_BEGIN_PREP */
 3502 	#define DRIVER_AUTHOR					\
 3503 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3504 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3505 	#define DRIVER_NAME "usbvision"
 3506 	#define DRIVER_ALIAS "USBVision"
 3507 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3508 	#define DRIVER_LICENSE "GPL"
 3509 	#define USBVISION_VERSION_STRING "0.9.11"
 3510 	#define	ENABLE_HEXDUMP	0	
 3511 	#ifdef USBVISION_DEBUG
 3512 	#define PDEBUG(level, fmt, args...) { \
 3513 		if (video_debug & (level)) \
 3514 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3515 				__func__, __LINE__ , ## args); \
 3516 	}
 3517 	#else
 3518 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3519 	#endif
 3520 	#define DBG_IO		(1 << 1)
 3521 	#define DBG_PROBE	(1 << 2)
 3522 	#define DBG_MMAP	(1 << 3)
 3523 	#define rmspace(str)	while (*str == ' ') str++;
 3524 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3525 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3526 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3527 	#endif
 3528 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3529 	#endif
 3530 	/* LDV_COMMENT_END_PREP */
 3531 	/* LDV_COMMENT_FUNCTION_CALL Kernel calls driver init function after driver loading to kernel. This function declared as "MODULE_INIT(function name)". */
 3532 	ldv_handler_precall();
 3533 	 if(usbvision_init()) 
 3534 		goto ldv_final;
 3535 	int ldv_s_usbvision_fops_v4l2_file_operations = 0;
 3536 	
 3537 
 3538 	
 3539 
 3540 	int ldv_s_usbvision_radio_fops_v4l2_file_operations = 0;
 3541 
 3542 	
 3543 
 3544 	int ldv_s_usbvision_driver_usb_driver = 0;
 3545 
 3546 
 3547 	while(  nondet_int()
 3548 		|| !(ldv_s_usbvision_fops_v4l2_file_operations == 0)
 3549 		|| !(ldv_s_usbvision_radio_fops_v4l2_file_operations == 0)
 3550 		|| !(ldv_s_usbvision_driver_usb_driver == 0)
 3551 	) {
 3552 
 3553 		switch(nondet_int()) {
 3554 
 3555 			case 0: {
 3556 
 3557 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_fops **/
 3558 				if(ldv_s_usbvision_fops_v4l2_file_operations==0) {
 3559 
 3560 				/* content: static int usbvision_v4l2_open(struct file *file)*/
 3561 				/* LDV_COMMENT_BEGIN_PREP */
 3562 				#define DRIVER_AUTHOR					\
 3563 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3564 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3565 				#define DRIVER_NAME "usbvision"
 3566 				#define DRIVER_ALIAS "USBVision"
 3567 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3568 				#define DRIVER_LICENSE "GPL"
 3569 				#define USBVISION_VERSION_STRING "0.9.11"
 3570 				#define	ENABLE_HEXDUMP	0	
 3571 				#ifdef USBVISION_DEBUG
 3572 				#define PDEBUG(level, fmt, args...) { \
 3573 		if (video_debug & (level)) \
 3574 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3575 				__func__, __LINE__ , ## args); \
 3576 	}
 3577 				#else
 3578 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3579 				#endif
 3580 				#define DBG_IO		(1 << 1)
 3581 				#define DBG_PROBE	(1 << 2)
 3582 				#define DBG_MMAP	(1 << 3)
 3583 				#define rmspace(str)	while (*str == ' ') str++;
 3584 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3585 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3586 				/* LDV_COMMENT_END_PREP */
 3587 				/* LDV_COMMENT_FUNCTION_CALL Function from field "open" from driver structure with callbacks "usbvision_fops". Standart function test for correct return result. */
 3588 				ldv_handler_precall();
 3589 				res_usbvision_v4l2_open_12 = usbvision_v4l2_open( var_group1);
 3590 				 ldv_check_return_value(res_usbvision_v4l2_open_12);
 3591 				 if(res_usbvision_v4l2_open_12) 
 3592 					goto ldv_module_exit;
 3593 				/* LDV_COMMENT_BEGIN_PREP */
 3594 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3595 				#endif
 3596 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3597 				#endif
 3598 				/* LDV_COMMENT_END_PREP */
 3599 				ldv_s_usbvision_fops_v4l2_file_operations++;
 3600 
 3601 				}
 3602 
 3603 			}
 3604 
 3605 			break;
 3606 			case 1: {
 3607 
 3608 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_fops **/
 3609 				if(ldv_s_usbvision_fops_v4l2_file_operations==1) {
 3610 
 3611 				/* content: static int usbvision_v4l2_close(struct file *file)*/
 3612 				/* LDV_COMMENT_BEGIN_PREP */
 3613 				#define DRIVER_AUTHOR					\
 3614 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3615 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3616 				#define DRIVER_NAME "usbvision"
 3617 				#define DRIVER_ALIAS "USBVision"
 3618 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3619 				#define DRIVER_LICENSE "GPL"
 3620 				#define USBVISION_VERSION_STRING "0.9.11"
 3621 				#define	ENABLE_HEXDUMP	0	
 3622 				#ifdef USBVISION_DEBUG
 3623 				#define PDEBUG(level, fmt, args...) { \
 3624 		if (video_debug & (level)) \
 3625 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3626 				__func__, __LINE__ , ## args); \
 3627 	}
 3628 				#else
 3629 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3630 				#endif
 3631 				#define DBG_IO		(1 << 1)
 3632 				#define DBG_PROBE	(1 << 2)
 3633 				#define DBG_MMAP	(1 << 3)
 3634 				#define rmspace(str)	while (*str == ' ') str++;
 3635 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3636 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3637 				/* LDV_COMMENT_END_PREP */
 3638 				/* LDV_COMMENT_FUNCTION_CALL Function from field "release" from driver structure with callbacks "usbvision_fops" */
 3639 				ldv_handler_precall();
 3640 				usbvision_v4l2_close( var_group1);
 3641 				/* LDV_COMMENT_BEGIN_PREP */
 3642 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3643 				#endif
 3644 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3645 				#endif
 3646 				/* LDV_COMMENT_END_PREP */
 3647 				ldv_s_usbvision_fops_v4l2_file_operations=0;
 3648 
 3649 				}
 3650 
 3651 			}
 3652 
 3653 			break;
 3654 			case 2: {
 3655 
 3656 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_fops **/
 3657 				
 3658 
 3659 				/* content: static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)*/
 3660 				/* LDV_COMMENT_BEGIN_PREP */
 3661 				#define DRIVER_AUTHOR					\
 3662 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3663 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3664 				#define DRIVER_NAME "usbvision"
 3665 				#define DRIVER_ALIAS "USBVision"
 3666 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3667 				#define DRIVER_LICENSE "GPL"
 3668 				#define USBVISION_VERSION_STRING "0.9.11"
 3669 				#define	ENABLE_HEXDUMP	0	
 3670 				#ifdef USBVISION_DEBUG
 3671 				#define PDEBUG(level, fmt, args...) { \
 3672 		if (video_debug & (level)) \
 3673 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3674 				__func__, __LINE__ , ## args); \
 3675 	}
 3676 				#else
 3677 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3678 				#endif
 3679 				#define DBG_IO		(1 << 1)
 3680 				#define DBG_PROBE	(1 << 2)
 3681 				#define DBG_MMAP	(1 << 3)
 3682 				#define rmspace(str)	while (*str == ' ') str++;
 3683 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3684 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3685 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3686 				#endif
 3687 				/* LDV_COMMENT_END_PREP */
 3688 				/* LDV_COMMENT_FUNCTION_CALL Function from field "read" from driver structure with callbacks "usbvision_fops" */
 3689 				ldv_handler_precall();
 3690 				usbvision_v4l2_read( var_group1, var_usbvision_v4l2_read_42_p1, var_usbvision_v4l2_read_42_p2, var_usbvision_v4l2_read_42_p3);
 3691 				/* LDV_COMMENT_BEGIN_PREP */
 3692 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3693 				#endif
 3694 				/* LDV_COMMENT_END_PREP */
 3695 				
 3696 
 3697 				
 3698 
 3699 			}
 3700 
 3701 			break;
 3702 			case 3: {
 3703 
 3704 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_fops **/
 3705 				
 3706 
 3707 				/* content: static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma)*/
 3708 				/* LDV_COMMENT_BEGIN_PREP */
 3709 				#define DRIVER_AUTHOR					\
 3710 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3711 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3712 				#define DRIVER_NAME "usbvision"
 3713 				#define DRIVER_ALIAS "USBVision"
 3714 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3715 				#define DRIVER_LICENSE "GPL"
 3716 				#define USBVISION_VERSION_STRING "0.9.11"
 3717 				#define	ENABLE_HEXDUMP	0	
 3718 				#ifdef USBVISION_DEBUG
 3719 				#define PDEBUG(level, fmt, args...) { \
 3720 		if (video_debug & (level)) \
 3721 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3722 				__func__, __LINE__ , ## args); \
 3723 	}
 3724 				#else
 3725 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3726 				#endif
 3727 				#define DBG_IO		(1 << 1)
 3728 				#define DBG_PROBE	(1 << 2)
 3729 				#define DBG_MMAP	(1 << 3)
 3730 				#define rmspace(str)	while (*str == ' ') str++;
 3731 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3732 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3733 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3734 				#endif
 3735 				/* LDV_COMMENT_END_PREP */
 3736 				/* LDV_COMMENT_FUNCTION_CALL Function from field "mmap" from driver structure with callbacks "usbvision_fops" */
 3737 				ldv_handler_precall();
 3738 				usbvision_v4l2_mmap( var_group1, var_group2);
 3739 				/* LDV_COMMENT_BEGIN_PREP */
 3740 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3741 				#endif
 3742 				/* LDV_COMMENT_END_PREP */
 3743 				
 3744 
 3745 				
 3746 
 3747 			}
 3748 
 3749 			break;
 3750 			case 4: {
 3751 
 3752 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 3753 				
 3754 
 3755 				/* content: static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *vc)*/
 3756 				/* LDV_COMMENT_BEGIN_PREP */
 3757 				#define DRIVER_AUTHOR					\
 3758 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3759 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3760 				#define DRIVER_NAME "usbvision"
 3761 				#define DRIVER_ALIAS "USBVision"
 3762 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3763 				#define DRIVER_LICENSE "GPL"
 3764 				#define USBVISION_VERSION_STRING "0.9.11"
 3765 				#define	ENABLE_HEXDUMP	0	
 3766 				#ifdef USBVISION_DEBUG
 3767 				#define PDEBUG(level, fmt, args...) { \
 3768 		if (video_debug & (level)) \
 3769 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3770 				__func__, __LINE__ , ## args); \
 3771 	}
 3772 				#else
 3773 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3774 				#endif
 3775 				#define DBG_IO		(1 << 1)
 3776 				#define DBG_PROBE	(1 << 2)
 3777 				#define DBG_MMAP	(1 << 3)
 3778 				#define rmspace(str)	while (*str == ' ') str++;
 3779 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3780 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3781 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3782 				#endif
 3783 				/* LDV_COMMENT_END_PREP */
 3784 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_querycap" from driver structure with callbacks "usbvision_ioctl_ops" */
 3785 				ldv_handler_precall();
 3786 				vidioc_querycap( var_group1, var_vidioc_querycap_16_p1, var_vidioc_querycap_16_p2);
 3787 				/* LDV_COMMENT_BEGIN_PREP */
 3788 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3789 				#endif
 3790 				/* LDV_COMMENT_END_PREP */
 3791 				
 3792 
 3793 				
 3794 
 3795 			}
 3796 
 3797 			break;
 3798 			case 5: {
 3799 
 3800 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 3801 				
 3802 
 3803 				/* content: static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *vfd)*/
 3804 				/* LDV_COMMENT_BEGIN_PREP */
 3805 				#define DRIVER_AUTHOR					\
 3806 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3807 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3808 				#define DRIVER_NAME "usbvision"
 3809 				#define DRIVER_ALIAS "USBVision"
 3810 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3811 				#define DRIVER_LICENSE "GPL"
 3812 				#define USBVISION_VERSION_STRING "0.9.11"
 3813 				#define	ENABLE_HEXDUMP	0	
 3814 				#ifdef USBVISION_DEBUG
 3815 				#define PDEBUG(level, fmt, args...) { \
 3816 		if (video_debug & (level)) \
 3817 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3818 				__func__, __LINE__ , ## args); \
 3819 	}
 3820 				#else
 3821 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3822 				#endif
 3823 				#define DBG_IO		(1 << 1)
 3824 				#define DBG_PROBE	(1 << 2)
 3825 				#define DBG_MMAP	(1 << 3)
 3826 				#define rmspace(str)	while (*str == ' ') str++;
 3827 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3828 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3829 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3830 				#endif
 3831 				/* LDV_COMMENT_END_PREP */
 3832 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_enum_fmt_vid_cap" from driver structure with callbacks "usbvision_ioctl_ops" */
 3833 				ldv_handler_precall();
 3834 				vidioc_enum_fmt_vid_cap( var_group1, var_vidioc_enum_fmt_vid_cap_37_p1, var_vidioc_enum_fmt_vid_cap_37_p2);
 3835 				/* LDV_COMMENT_BEGIN_PREP */
 3836 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3837 				#endif
 3838 				/* LDV_COMMENT_END_PREP */
 3839 				
 3840 
 3841 				
 3842 
 3843 			}
 3844 
 3845 			break;
 3846 			case 6: {
 3847 
 3848 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 3849 				
 3850 
 3851 				/* content: static int vidioc_g_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 3852 				/* LDV_COMMENT_BEGIN_PREP */
 3853 				#define DRIVER_AUTHOR					\
 3854 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3855 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3856 				#define DRIVER_NAME "usbvision"
 3857 				#define DRIVER_ALIAS "USBVision"
 3858 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3859 				#define DRIVER_LICENSE "GPL"
 3860 				#define USBVISION_VERSION_STRING "0.9.11"
 3861 				#define	ENABLE_HEXDUMP	0	
 3862 				#ifdef USBVISION_DEBUG
 3863 				#define PDEBUG(level, fmt, args...) { \
 3864 		if (video_debug & (level)) \
 3865 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3866 				__func__, __LINE__ , ## args); \
 3867 	}
 3868 				#else
 3869 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3870 				#endif
 3871 				#define DBG_IO		(1 << 1)
 3872 				#define DBG_PROBE	(1 << 2)
 3873 				#define DBG_MMAP	(1 << 3)
 3874 				#define rmspace(str)	while (*str == ' ') str++;
 3875 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3876 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3877 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3878 				#endif
 3879 				/* LDV_COMMENT_END_PREP */
 3880 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_fmt_vid_cap" from driver structure with callbacks "usbvision_ioctl_ops" */
 3881 				ldv_handler_precall();
 3882 				vidioc_g_fmt_vid_cap( var_group1, var_vidioc_g_fmt_vid_cap_38_p1, var_vidioc_g_fmt_vid_cap_38_p2);
 3883 				/* LDV_COMMENT_BEGIN_PREP */
 3884 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3885 				#endif
 3886 				/* LDV_COMMENT_END_PREP */
 3887 				
 3888 
 3889 				
 3890 
 3891 			}
 3892 
 3893 			break;
 3894 			case 7: {
 3895 
 3896 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 3897 				
 3898 
 3899 				/* content: static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 3900 				/* LDV_COMMENT_BEGIN_PREP */
 3901 				#define DRIVER_AUTHOR					\
 3902 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3903 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3904 				#define DRIVER_NAME "usbvision"
 3905 				#define DRIVER_ALIAS "USBVision"
 3906 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3907 				#define DRIVER_LICENSE "GPL"
 3908 				#define USBVISION_VERSION_STRING "0.9.11"
 3909 				#define	ENABLE_HEXDUMP	0	
 3910 				#ifdef USBVISION_DEBUG
 3911 				#define PDEBUG(level, fmt, args...) { \
 3912 		if (video_debug & (level)) \
 3913 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3914 				__func__, __LINE__ , ## args); \
 3915 	}
 3916 				#else
 3917 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3918 				#endif
 3919 				#define DBG_IO		(1 << 1)
 3920 				#define DBG_PROBE	(1 << 2)
 3921 				#define DBG_MMAP	(1 << 3)
 3922 				#define rmspace(str)	while (*str == ' ') str++;
 3923 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3924 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3925 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3926 				#endif
 3927 				/* LDV_COMMENT_END_PREP */
 3928 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_try_fmt_vid_cap" from driver structure with callbacks "usbvision_ioctl_ops" */
 3929 				ldv_handler_precall();
 3930 				vidioc_try_fmt_vid_cap( var_group1, var_vidioc_try_fmt_vid_cap_39_p1, var_vidioc_try_fmt_vid_cap_39_p2);
 3931 				/* LDV_COMMENT_BEGIN_PREP */
 3932 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3933 				#endif
 3934 				/* LDV_COMMENT_END_PREP */
 3935 				
 3936 
 3937 				
 3938 
 3939 			}
 3940 
 3941 			break;
 3942 			case 8: {
 3943 
 3944 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 3945 				
 3946 
 3947 				/* content: static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 3948 				/* LDV_COMMENT_BEGIN_PREP */
 3949 				#define DRIVER_AUTHOR					\
 3950 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3951 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3952 				#define DRIVER_NAME "usbvision"
 3953 				#define DRIVER_ALIAS "USBVision"
 3954 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3955 				#define DRIVER_LICENSE "GPL"
 3956 				#define USBVISION_VERSION_STRING "0.9.11"
 3957 				#define	ENABLE_HEXDUMP	0	
 3958 				#ifdef USBVISION_DEBUG
 3959 				#define PDEBUG(level, fmt, args...) { \
 3960 		if (video_debug & (level)) \
 3961 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3962 				__func__, __LINE__ , ## args); \
 3963 	}
 3964 				#else
 3965 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3966 				#endif
 3967 				#define DBG_IO		(1 << 1)
 3968 				#define DBG_PROBE	(1 << 2)
 3969 				#define DBG_MMAP	(1 << 3)
 3970 				#define rmspace(str)	while (*str == ' ') str++;
 3971 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3972 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3973 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3974 				#endif
 3975 				/* LDV_COMMENT_END_PREP */
 3976 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_fmt_vid_cap" from driver structure with callbacks "usbvision_ioctl_ops" */
 3977 				ldv_handler_precall();
 3978 				vidioc_s_fmt_vid_cap( var_group1, var_vidioc_s_fmt_vid_cap_40_p1, var_vidioc_s_fmt_vid_cap_40_p2);
 3979 				/* LDV_COMMENT_BEGIN_PREP */
 3980 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3981 				#endif
 3982 				/* LDV_COMMENT_END_PREP */
 3983 				
 3984 
 3985 				
 3986 
 3987 			}
 3988 
 3989 			break;
 3990 			case 9: {
 3991 
 3992 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 3993 				
 3994 
 3995 				/* content: static int vidioc_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *vr)*/
 3996 				/* LDV_COMMENT_BEGIN_PREP */
 3997 				#define DRIVER_AUTHOR					\
 3998 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3999 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4000 				#define DRIVER_NAME "usbvision"
 4001 				#define DRIVER_ALIAS "USBVision"
 4002 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4003 				#define DRIVER_LICENSE "GPL"
 4004 				#define USBVISION_VERSION_STRING "0.9.11"
 4005 				#define	ENABLE_HEXDUMP	0	
 4006 				#ifdef USBVISION_DEBUG
 4007 				#define PDEBUG(level, fmt, args...) { \
 4008 		if (video_debug & (level)) \
 4009 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4010 				__func__, __LINE__ , ## args); \
 4011 	}
 4012 				#else
 4013 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4014 				#endif
 4015 				#define DBG_IO		(1 << 1)
 4016 				#define DBG_PROBE	(1 << 2)
 4017 				#define DBG_MMAP	(1 << 3)
 4018 				#define rmspace(str)	while (*str == ' ') str++;
 4019 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4020 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4021 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4022 				#endif
 4023 				/* LDV_COMMENT_END_PREP */
 4024 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_reqbufs" from driver structure with callbacks "usbvision_ioctl_ops" */
 4025 				ldv_handler_precall();
 4026 				vidioc_reqbufs( var_group1, var_vidioc_reqbufs_31_p1, var_vidioc_reqbufs_31_p2);
 4027 				/* LDV_COMMENT_BEGIN_PREP */
 4028 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4029 				#endif
 4030 				/* LDV_COMMENT_END_PREP */
 4031 				
 4032 
 4033 				
 4034 
 4035 			}
 4036 
 4037 			break;
 4038 			case 10: {
 4039 
 4040 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4041 				
 4042 
 4043 				/* content: static int vidioc_querybuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 4044 				/* LDV_COMMENT_BEGIN_PREP */
 4045 				#define DRIVER_AUTHOR					\
 4046 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4047 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4048 				#define DRIVER_NAME "usbvision"
 4049 				#define DRIVER_ALIAS "USBVision"
 4050 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4051 				#define DRIVER_LICENSE "GPL"
 4052 				#define USBVISION_VERSION_STRING "0.9.11"
 4053 				#define	ENABLE_HEXDUMP	0	
 4054 				#ifdef USBVISION_DEBUG
 4055 				#define PDEBUG(level, fmt, args...) { \
 4056 		if (video_debug & (level)) \
 4057 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4058 				__func__, __LINE__ , ## args); \
 4059 	}
 4060 				#else
 4061 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4062 				#endif
 4063 				#define DBG_IO		(1 << 1)
 4064 				#define DBG_PROBE	(1 << 2)
 4065 				#define DBG_MMAP	(1 << 3)
 4066 				#define rmspace(str)	while (*str == ' ') str++;
 4067 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4068 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4069 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4070 				#endif
 4071 				/* LDV_COMMENT_END_PREP */
 4072 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_querybuf" from driver structure with callbacks "usbvision_ioctl_ops" */
 4073 				ldv_handler_precall();
 4074 				vidioc_querybuf( var_group1, var_vidioc_querybuf_32_p1, var_vidioc_querybuf_32_p2);
 4075 				/* LDV_COMMENT_BEGIN_PREP */
 4076 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4077 				#endif
 4078 				/* LDV_COMMENT_END_PREP */
 4079 				
 4080 
 4081 				
 4082 
 4083 			}
 4084 
 4085 			break;
 4086 			case 11: {
 4087 
 4088 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4089 				
 4090 
 4091 				/* content: static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 4092 				/* LDV_COMMENT_BEGIN_PREP */
 4093 				#define DRIVER_AUTHOR					\
 4094 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4095 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4096 				#define DRIVER_NAME "usbvision"
 4097 				#define DRIVER_ALIAS "USBVision"
 4098 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4099 				#define DRIVER_LICENSE "GPL"
 4100 				#define USBVISION_VERSION_STRING "0.9.11"
 4101 				#define	ENABLE_HEXDUMP	0	
 4102 				#ifdef USBVISION_DEBUG
 4103 				#define PDEBUG(level, fmt, args...) { \
 4104 		if (video_debug & (level)) \
 4105 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4106 				__func__, __LINE__ , ## args); \
 4107 	}
 4108 				#else
 4109 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4110 				#endif
 4111 				#define DBG_IO		(1 << 1)
 4112 				#define DBG_PROBE	(1 << 2)
 4113 				#define DBG_MMAP	(1 << 3)
 4114 				#define rmspace(str)	while (*str == ' ') str++;
 4115 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4116 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4117 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4118 				#endif
 4119 				/* LDV_COMMENT_END_PREP */
 4120 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_qbuf" from driver structure with callbacks "usbvision_ioctl_ops" */
 4121 				ldv_handler_precall();
 4122 				vidioc_qbuf( var_group1, var_vidioc_qbuf_33_p1, var_vidioc_qbuf_33_p2);
 4123 				/* LDV_COMMENT_BEGIN_PREP */
 4124 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4125 				#endif
 4126 				/* LDV_COMMENT_END_PREP */
 4127 				
 4128 
 4129 				
 4130 
 4131 			}
 4132 
 4133 			break;
 4134 			case 12: {
 4135 
 4136 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4137 				
 4138 
 4139 				/* content: static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 4140 				/* LDV_COMMENT_BEGIN_PREP */
 4141 				#define DRIVER_AUTHOR					\
 4142 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4143 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4144 				#define DRIVER_NAME "usbvision"
 4145 				#define DRIVER_ALIAS "USBVision"
 4146 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4147 				#define DRIVER_LICENSE "GPL"
 4148 				#define USBVISION_VERSION_STRING "0.9.11"
 4149 				#define	ENABLE_HEXDUMP	0	
 4150 				#ifdef USBVISION_DEBUG
 4151 				#define PDEBUG(level, fmt, args...) { \
 4152 		if (video_debug & (level)) \
 4153 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4154 				__func__, __LINE__ , ## args); \
 4155 	}
 4156 				#else
 4157 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4158 				#endif
 4159 				#define DBG_IO		(1 << 1)
 4160 				#define DBG_PROBE	(1 << 2)
 4161 				#define DBG_MMAP	(1 << 3)
 4162 				#define rmspace(str)	while (*str == ' ') str++;
 4163 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4164 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4165 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4166 				#endif
 4167 				/* LDV_COMMENT_END_PREP */
 4168 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_dqbuf" from driver structure with callbacks "usbvision_ioctl_ops" */
 4169 				ldv_handler_precall();
 4170 				vidioc_dqbuf( var_group1, var_vidioc_dqbuf_34_p1, var_vidioc_dqbuf_34_p2);
 4171 				/* LDV_COMMENT_BEGIN_PREP */
 4172 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4173 				#endif
 4174 				/* LDV_COMMENT_END_PREP */
 4175 				
 4176 
 4177 				
 4178 
 4179 			}
 4180 
 4181 			break;
 4182 			case 13: {
 4183 
 4184 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4185 				
 4186 
 4187 				/* content: static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)*/
 4188 				/* LDV_COMMENT_BEGIN_PREP */
 4189 				#define DRIVER_AUTHOR					\
 4190 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4191 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4192 				#define DRIVER_NAME "usbvision"
 4193 				#define DRIVER_ALIAS "USBVision"
 4194 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4195 				#define DRIVER_LICENSE "GPL"
 4196 				#define USBVISION_VERSION_STRING "0.9.11"
 4197 				#define	ENABLE_HEXDUMP	0	
 4198 				#ifdef USBVISION_DEBUG
 4199 				#define PDEBUG(level, fmt, args...) { \
 4200 		if (video_debug & (level)) \
 4201 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4202 				__func__, __LINE__ , ## args); \
 4203 	}
 4204 				#else
 4205 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4206 				#endif
 4207 				#define DBG_IO		(1 << 1)
 4208 				#define DBG_PROBE	(1 << 2)
 4209 				#define DBG_MMAP	(1 << 3)
 4210 				#define rmspace(str)	while (*str == ' ') str++;
 4211 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4212 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4213 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4214 				#endif
 4215 				/* LDV_COMMENT_END_PREP */
 4216 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_std" from driver structure with callbacks "usbvision_ioctl_ops" */
 4217 				ldv_handler_precall();
 4218 				vidioc_s_std( var_group1, var_vidioc_s_std_20_p1, var_vidioc_s_std_20_p2);
 4219 				/* LDV_COMMENT_BEGIN_PREP */
 4220 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4221 				#endif
 4222 				/* LDV_COMMENT_END_PREP */
 4223 				
 4224 
 4225 				
 4226 
 4227 			}
 4228 
 4229 			break;
 4230 			case 14: {
 4231 
 4232 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4233 				
 4234 
 4235 				/* content: static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)*/
 4236 				/* LDV_COMMENT_BEGIN_PREP */
 4237 				#define DRIVER_AUTHOR					\
 4238 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4239 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4240 				#define DRIVER_NAME "usbvision"
 4241 				#define DRIVER_ALIAS "USBVision"
 4242 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4243 				#define DRIVER_LICENSE "GPL"
 4244 				#define USBVISION_VERSION_STRING "0.9.11"
 4245 				#define	ENABLE_HEXDUMP	0	
 4246 				#ifdef USBVISION_DEBUG
 4247 				#define PDEBUG(level, fmt, args...) { \
 4248 		if (video_debug & (level)) \
 4249 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4250 				__func__, __LINE__ , ## args); \
 4251 	}
 4252 				#else
 4253 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4254 				#endif
 4255 				#define DBG_IO		(1 << 1)
 4256 				#define DBG_PROBE	(1 << 2)
 4257 				#define DBG_MMAP	(1 << 3)
 4258 				#define rmspace(str)	while (*str == ' ') str++;
 4259 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4260 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4261 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4262 				#endif
 4263 				/* LDV_COMMENT_END_PREP */
 4264 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_std" from driver structure with callbacks "usbvision_ioctl_ops" */
 4265 				ldv_handler_precall();
 4266 				vidioc_g_std( var_group1, var_vidioc_g_std_21_p1, var_vidioc_g_std_21_p2);
 4267 				/* LDV_COMMENT_BEGIN_PREP */
 4268 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4269 				#endif
 4270 				/* LDV_COMMENT_END_PREP */
 4271 				
 4272 
 4273 				
 4274 
 4275 			}
 4276 
 4277 			break;
 4278 			case 15: {
 4279 
 4280 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4281 				
 4282 
 4283 				/* content: static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *vi)*/
 4284 				/* LDV_COMMENT_BEGIN_PREP */
 4285 				#define DRIVER_AUTHOR					\
 4286 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4287 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4288 				#define DRIVER_NAME "usbvision"
 4289 				#define DRIVER_ALIAS "USBVision"
 4290 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4291 				#define DRIVER_LICENSE "GPL"
 4292 				#define USBVISION_VERSION_STRING "0.9.11"
 4293 				#define	ENABLE_HEXDUMP	0	
 4294 				#ifdef USBVISION_DEBUG
 4295 				#define PDEBUG(level, fmt, args...) { \
 4296 		if (video_debug & (level)) \
 4297 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4298 				__func__, __LINE__ , ## args); \
 4299 	}
 4300 				#else
 4301 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4302 				#endif
 4303 				#define DBG_IO		(1 << 1)
 4304 				#define DBG_PROBE	(1 << 2)
 4305 				#define DBG_MMAP	(1 << 3)
 4306 				#define rmspace(str)	while (*str == ' ') str++;
 4307 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4308 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4309 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4310 				#endif
 4311 				/* LDV_COMMENT_END_PREP */
 4312 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_enum_input" from driver structure with callbacks "usbvision_ioctl_ops" */
 4313 				ldv_handler_precall();
 4314 				vidioc_enum_input( var_group1, var_vidioc_enum_input_17_p1, var_vidioc_enum_input_17_p2);
 4315 				/* LDV_COMMENT_BEGIN_PREP */
 4316 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4317 				#endif
 4318 				/* LDV_COMMENT_END_PREP */
 4319 				
 4320 
 4321 				
 4322 
 4323 			}
 4324 
 4325 			break;
 4326 			case 16: {
 4327 
 4328 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4329 				
 4330 
 4331 				/* content: static int vidioc_g_input(struct file *file, void *priv, unsigned int *input)*/
 4332 				/* LDV_COMMENT_BEGIN_PREP */
 4333 				#define DRIVER_AUTHOR					\
 4334 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4335 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4336 				#define DRIVER_NAME "usbvision"
 4337 				#define DRIVER_ALIAS "USBVision"
 4338 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4339 				#define DRIVER_LICENSE "GPL"
 4340 				#define USBVISION_VERSION_STRING "0.9.11"
 4341 				#define	ENABLE_HEXDUMP	0	
 4342 				#ifdef USBVISION_DEBUG
 4343 				#define PDEBUG(level, fmt, args...) { \
 4344 		if (video_debug & (level)) \
 4345 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4346 				__func__, __LINE__ , ## args); \
 4347 	}
 4348 				#else
 4349 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4350 				#endif
 4351 				#define DBG_IO		(1 << 1)
 4352 				#define DBG_PROBE	(1 << 2)
 4353 				#define DBG_MMAP	(1 << 3)
 4354 				#define rmspace(str)	while (*str == ' ') str++;
 4355 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4356 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4357 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4358 				#endif
 4359 				/* LDV_COMMENT_END_PREP */
 4360 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_input" from driver structure with callbacks "usbvision_ioctl_ops" */
 4361 				ldv_handler_precall();
 4362 				vidioc_g_input( var_group1, var_vidioc_g_input_18_p1, var_vidioc_g_input_18_p2);
 4363 				/* LDV_COMMENT_BEGIN_PREP */
 4364 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4365 				#endif
 4366 				/* LDV_COMMENT_END_PREP */
 4367 				
 4368 
 4369 				
 4370 
 4371 			}
 4372 
 4373 			break;
 4374 			case 17: {
 4375 
 4376 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4377 				
 4378 
 4379 				/* content: static int vidioc_s_input(struct file *file, void *priv, unsigned int input)*/
 4380 				/* LDV_COMMENT_BEGIN_PREP */
 4381 				#define DRIVER_AUTHOR					\
 4382 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4383 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4384 				#define DRIVER_NAME "usbvision"
 4385 				#define DRIVER_ALIAS "USBVision"
 4386 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4387 				#define DRIVER_LICENSE "GPL"
 4388 				#define USBVISION_VERSION_STRING "0.9.11"
 4389 				#define	ENABLE_HEXDUMP	0	
 4390 				#ifdef USBVISION_DEBUG
 4391 				#define PDEBUG(level, fmt, args...) { \
 4392 		if (video_debug & (level)) \
 4393 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4394 				__func__, __LINE__ , ## args); \
 4395 	}
 4396 				#else
 4397 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4398 				#endif
 4399 				#define DBG_IO		(1 << 1)
 4400 				#define DBG_PROBE	(1 << 2)
 4401 				#define DBG_MMAP	(1 << 3)
 4402 				#define rmspace(str)	while (*str == ' ') str++;
 4403 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4404 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4405 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4406 				#endif
 4407 				/* LDV_COMMENT_END_PREP */
 4408 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_input" from driver structure with callbacks "usbvision_ioctl_ops" */
 4409 				ldv_handler_precall();
 4410 				vidioc_s_input( var_group1, var_vidioc_s_input_19_p1, var_vidioc_s_input_19_p2);
 4411 				/* LDV_COMMENT_BEGIN_PREP */
 4412 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4413 				#endif
 4414 				/* LDV_COMMENT_END_PREP */
 4415 				
 4416 
 4417 				
 4418 
 4419 			}
 4420 
 4421 			break;
 4422 			case 18: {
 4423 
 4424 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4425 				
 4426 
 4427 				/* content: static int vidioc_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *ctrl)*/
 4428 				/* LDV_COMMENT_BEGIN_PREP */
 4429 				#define DRIVER_AUTHOR					\
 4430 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4431 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4432 				#define DRIVER_NAME "usbvision"
 4433 				#define DRIVER_ALIAS "USBVision"
 4434 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4435 				#define DRIVER_LICENSE "GPL"
 4436 				#define USBVISION_VERSION_STRING "0.9.11"
 4437 				#define	ENABLE_HEXDUMP	0	
 4438 				#ifdef USBVISION_DEBUG
 4439 				#define PDEBUG(level, fmt, args...) { \
 4440 		if (video_debug & (level)) \
 4441 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4442 				__func__, __LINE__ , ## args); \
 4443 	}
 4444 				#else
 4445 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4446 				#endif
 4447 				#define DBG_IO		(1 << 1)
 4448 				#define DBG_PROBE	(1 << 2)
 4449 				#define DBG_MMAP	(1 << 3)
 4450 				#define rmspace(str)	while (*str == ' ') str++;
 4451 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4452 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4453 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4454 				#endif
 4455 				/* LDV_COMMENT_END_PREP */
 4456 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_queryctrl" from driver structure with callbacks "usbvision_ioctl_ops" */
 4457 				ldv_handler_precall();
 4458 				vidioc_queryctrl( var_group1, var_vidioc_queryctrl_28_p1, var_vidioc_queryctrl_28_p2);
 4459 				/* LDV_COMMENT_BEGIN_PREP */
 4460 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4461 				#endif
 4462 				/* LDV_COMMENT_END_PREP */
 4463 				
 4464 
 4465 				
 4466 
 4467 			}
 4468 
 4469 			break;
 4470 			case 19: {
 4471 
 4472 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4473 				
 4474 
 4475 				/* content: static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)*/
 4476 				/* LDV_COMMENT_BEGIN_PREP */
 4477 				#define DRIVER_AUTHOR					\
 4478 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4479 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4480 				#define DRIVER_NAME "usbvision"
 4481 				#define DRIVER_ALIAS "USBVision"
 4482 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4483 				#define DRIVER_LICENSE "GPL"
 4484 				#define USBVISION_VERSION_STRING "0.9.11"
 4485 				#define	ENABLE_HEXDUMP	0	
 4486 				#ifdef USBVISION_DEBUG
 4487 				#define PDEBUG(level, fmt, args...) { \
 4488 		if (video_debug & (level)) \
 4489 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4490 				__func__, __LINE__ , ## args); \
 4491 	}
 4492 				#else
 4493 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4494 				#endif
 4495 				#define DBG_IO		(1 << 1)
 4496 				#define DBG_PROBE	(1 << 2)
 4497 				#define DBG_MMAP	(1 << 3)
 4498 				#define rmspace(str)	while (*str == ' ') str++;
 4499 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4500 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4501 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4502 				#endif
 4503 				/* LDV_COMMENT_END_PREP */
 4504 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_audio" from driver structure with callbacks "usbvision_ioctl_ops" */
 4505 				ldv_handler_precall();
 4506 				vidioc_g_audio( var_group1, var_vidioc_g_audio_26_p1, var_vidioc_g_audio_26_p2);
 4507 				/* LDV_COMMENT_BEGIN_PREP */
 4508 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4509 				#endif
 4510 				/* LDV_COMMENT_END_PREP */
 4511 				
 4512 
 4513 				
 4514 
 4515 			}
 4516 
 4517 			break;
 4518 			case 20: {
 4519 
 4520 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4521 				
 4522 
 4523 				/* content: static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)*/
 4524 				/* LDV_COMMENT_BEGIN_PREP */
 4525 				#define DRIVER_AUTHOR					\
 4526 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4527 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4528 				#define DRIVER_NAME "usbvision"
 4529 				#define DRIVER_ALIAS "USBVision"
 4530 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4531 				#define DRIVER_LICENSE "GPL"
 4532 				#define USBVISION_VERSION_STRING "0.9.11"
 4533 				#define	ENABLE_HEXDUMP	0	
 4534 				#ifdef USBVISION_DEBUG
 4535 				#define PDEBUG(level, fmt, args...) { \
 4536 		if (video_debug & (level)) \
 4537 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4538 				__func__, __LINE__ , ## args); \
 4539 	}
 4540 				#else
 4541 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4542 				#endif
 4543 				#define DBG_IO		(1 << 1)
 4544 				#define DBG_PROBE	(1 << 2)
 4545 				#define DBG_MMAP	(1 << 3)
 4546 				#define rmspace(str)	while (*str == ' ') str++;
 4547 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4548 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4549 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4550 				#endif
 4551 				/* LDV_COMMENT_END_PREP */
 4552 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_audio" from driver structure with callbacks "usbvision_ioctl_ops" */
 4553 				ldv_handler_precall();
 4554 				vidioc_s_audio( var_group1, var_vidioc_s_audio_27_p1, var_vidioc_s_audio_27_p2);
 4555 				/* LDV_COMMENT_BEGIN_PREP */
 4556 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4557 				#endif
 4558 				/* LDV_COMMENT_END_PREP */
 4559 				
 4560 
 4561 				
 4562 
 4563 			}
 4564 
 4565 			break;
 4566 			case 21: {
 4567 
 4568 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4569 				
 4570 
 4571 				/* content: static int vidioc_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 4572 				/* LDV_COMMENT_BEGIN_PREP */
 4573 				#define DRIVER_AUTHOR					\
 4574 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4575 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4576 				#define DRIVER_NAME "usbvision"
 4577 				#define DRIVER_ALIAS "USBVision"
 4578 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4579 				#define DRIVER_LICENSE "GPL"
 4580 				#define USBVISION_VERSION_STRING "0.9.11"
 4581 				#define	ENABLE_HEXDUMP	0	
 4582 				#ifdef USBVISION_DEBUG
 4583 				#define PDEBUG(level, fmt, args...) { \
 4584 		if (video_debug & (level)) \
 4585 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4586 				__func__, __LINE__ , ## args); \
 4587 	}
 4588 				#else
 4589 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4590 				#endif
 4591 				#define DBG_IO		(1 << 1)
 4592 				#define DBG_PROBE	(1 << 2)
 4593 				#define DBG_MMAP	(1 << 3)
 4594 				#define rmspace(str)	while (*str == ' ') str++;
 4595 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4596 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4597 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4598 				#endif
 4599 				/* LDV_COMMENT_END_PREP */
 4600 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_ctrl" from driver structure with callbacks "usbvision_ioctl_ops" */
 4601 				ldv_handler_precall();
 4602 				vidioc_g_ctrl( var_group1, var_vidioc_g_ctrl_29_p1, var_vidioc_g_ctrl_29_p2);
 4603 				/* LDV_COMMENT_BEGIN_PREP */
 4604 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4605 				#endif
 4606 				/* LDV_COMMENT_END_PREP */
 4607 				
 4608 
 4609 				
 4610 
 4611 			}
 4612 
 4613 			break;
 4614 			case 22: {
 4615 
 4616 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4617 				
 4618 
 4619 				/* content: static int vidioc_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 4620 				/* LDV_COMMENT_BEGIN_PREP */
 4621 				#define DRIVER_AUTHOR					\
 4622 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4623 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4624 				#define DRIVER_NAME "usbvision"
 4625 				#define DRIVER_ALIAS "USBVision"
 4626 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4627 				#define DRIVER_LICENSE "GPL"
 4628 				#define USBVISION_VERSION_STRING "0.9.11"
 4629 				#define	ENABLE_HEXDUMP	0	
 4630 				#ifdef USBVISION_DEBUG
 4631 				#define PDEBUG(level, fmt, args...) { \
 4632 		if (video_debug & (level)) \
 4633 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4634 				__func__, __LINE__ , ## args); \
 4635 	}
 4636 				#else
 4637 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4638 				#endif
 4639 				#define DBG_IO		(1 << 1)
 4640 				#define DBG_PROBE	(1 << 2)
 4641 				#define DBG_MMAP	(1 << 3)
 4642 				#define rmspace(str)	while (*str == ' ') str++;
 4643 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4644 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4645 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4646 				#endif
 4647 				/* LDV_COMMENT_END_PREP */
 4648 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_ctrl" from driver structure with callbacks "usbvision_ioctl_ops" */
 4649 				ldv_handler_precall();
 4650 				vidioc_s_ctrl( var_group1, var_vidioc_s_ctrl_30_p1, var_vidioc_s_ctrl_30_p2);
 4651 				/* LDV_COMMENT_BEGIN_PREP */
 4652 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4653 				#endif
 4654 				/* LDV_COMMENT_END_PREP */
 4655 				
 4656 
 4657 				
 4658 
 4659 			}
 4660 
 4661 			break;
 4662 			case 23: {
 4663 
 4664 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4665 				
 4666 
 4667 				/* content: static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)*/
 4668 				/* LDV_COMMENT_BEGIN_PREP */
 4669 				#define DRIVER_AUTHOR					\
 4670 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4671 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4672 				#define DRIVER_NAME "usbvision"
 4673 				#define DRIVER_ALIAS "USBVision"
 4674 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4675 				#define DRIVER_LICENSE "GPL"
 4676 				#define USBVISION_VERSION_STRING "0.9.11"
 4677 				#define	ENABLE_HEXDUMP	0	
 4678 				#ifdef USBVISION_DEBUG
 4679 				#define PDEBUG(level, fmt, args...) { \
 4680 		if (video_debug & (level)) \
 4681 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4682 				__func__, __LINE__ , ## args); \
 4683 	}
 4684 				#else
 4685 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4686 				#endif
 4687 				#define DBG_IO		(1 << 1)
 4688 				#define DBG_PROBE	(1 << 2)
 4689 				#define DBG_MMAP	(1 << 3)
 4690 				#define rmspace(str)	while (*str == ' ') str++;
 4691 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4692 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4693 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4694 				#endif
 4695 				/* LDV_COMMENT_END_PREP */
 4696 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_streamon" from driver structure with callbacks "usbvision_ioctl_ops" */
 4697 				ldv_handler_precall();
 4698 				vidioc_streamon( var_group1, var_vidioc_streamon_35_p1, var_vidioc_streamon_35_p2);
 4699 				/* LDV_COMMENT_BEGIN_PREP */
 4700 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4701 				#endif
 4702 				/* LDV_COMMENT_END_PREP */
 4703 				
 4704 
 4705 				
 4706 
 4707 			}
 4708 
 4709 			break;
 4710 			case 24: {
 4711 
 4712 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4713 				
 4714 
 4715 				/* content: static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type type)*/
 4716 				/* LDV_COMMENT_BEGIN_PREP */
 4717 				#define DRIVER_AUTHOR					\
 4718 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4719 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4720 				#define DRIVER_NAME "usbvision"
 4721 				#define DRIVER_ALIAS "USBVision"
 4722 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4723 				#define DRIVER_LICENSE "GPL"
 4724 				#define USBVISION_VERSION_STRING "0.9.11"
 4725 				#define	ENABLE_HEXDUMP	0	
 4726 				#ifdef USBVISION_DEBUG
 4727 				#define PDEBUG(level, fmt, args...) { \
 4728 		if (video_debug & (level)) \
 4729 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4730 				__func__, __LINE__ , ## args); \
 4731 	}
 4732 				#else
 4733 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4734 				#endif
 4735 				#define DBG_IO		(1 << 1)
 4736 				#define DBG_PROBE	(1 << 2)
 4737 				#define DBG_MMAP	(1 << 3)
 4738 				#define rmspace(str)	while (*str == ' ') str++;
 4739 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4740 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4741 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4742 				#endif
 4743 				/* LDV_COMMENT_END_PREP */
 4744 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_streamoff" from driver structure with callbacks "usbvision_ioctl_ops" */
 4745 				ldv_handler_precall();
 4746 				vidioc_streamoff( var_group1, var_vidioc_streamoff_36_p1, var_vidioc_streamoff_36_p2);
 4747 				/* LDV_COMMENT_BEGIN_PREP */
 4748 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4749 				#endif
 4750 				/* LDV_COMMENT_END_PREP */
 4751 				
 4752 
 4753 				
 4754 
 4755 			}
 4756 
 4757 			break;
 4758 			case 25: {
 4759 
 4760 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4761 				
 4762 
 4763 				/* content: static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)*/
 4764 				/* LDV_COMMENT_BEGIN_PREP */
 4765 				#define DRIVER_AUTHOR					\
 4766 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4767 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4768 				#define DRIVER_NAME "usbvision"
 4769 				#define DRIVER_ALIAS "USBVision"
 4770 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4771 				#define DRIVER_LICENSE "GPL"
 4772 				#define USBVISION_VERSION_STRING "0.9.11"
 4773 				#define	ENABLE_HEXDUMP	0	
 4774 				#ifdef USBVISION_DEBUG
 4775 				#define PDEBUG(level, fmt, args...) { \
 4776 		if (video_debug & (level)) \
 4777 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4778 				__func__, __LINE__ , ## args); \
 4779 	}
 4780 				#else
 4781 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4782 				#endif
 4783 				#define DBG_IO		(1 << 1)
 4784 				#define DBG_PROBE	(1 << 2)
 4785 				#define DBG_MMAP	(1 << 3)
 4786 				#define rmspace(str)	while (*str == ' ') str++;
 4787 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4788 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4789 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4790 				#endif
 4791 				/* LDV_COMMENT_END_PREP */
 4792 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_tuner" from driver structure with callbacks "usbvision_ioctl_ops" */
 4793 				ldv_handler_precall();
 4794 				vidioc_g_tuner( var_group1, var_vidioc_g_tuner_22_p1, var_vidioc_g_tuner_22_p2);
 4795 				/* LDV_COMMENT_BEGIN_PREP */
 4796 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4797 				#endif
 4798 				/* LDV_COMMENT_END_PREP */
 4799 				
 4800 
 4801 				
 4802 
 4803 			}
 4804 
 4805 			break;
 4806 			case 26: {
 4807 
 4808 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4809 				
 4810 
 4811 				/* content: static int vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *vt)*/
 4812 				/* LDV_COMMENT_BEGIN_PREP */
 4813 				#define DRIVER_AUTHOR					\
 4814 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4815 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4816 				#define DRIVER_NAME "usbvision"
 4817 				#define DRIVER_ALIAS "USBVision"
 4818 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4819 				#define DRIVER_LICENSE "GPL"
 4820 				#define USBVISION_VERSION_STRING "0.9.11"
 4821 				#define	ENABLE_HEXDUMP	0	
 4822 				#ifdef USBVISION_DEBUG
 4823 				#define PDEBUG(level, fmt, args...) { \
 4824 		if (video_debug & (level)) \
 4825 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4826 				__func__, __LINE__ , ## args); \
 4827 	}
 4828 				#else
 4829 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4830 				#endif
 4831 				#define DBG_IO		(1 << 1)
 4832 				#define DBG_PROBE	(1 << 2)
 4833 				#define DBG_MMAP	(1 << 3)
 4834 				#define rmspace(str)	while (*str == ' ') str++;
 4835 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4836 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4837 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4838 				#endif
 4839 				/* LDV_COMMENT_END_PREP */
 4840 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_tuner" from driver structure with callbacks "usbvision_ioctl_ops" */
 4841 				ldv_handler_precall();
 4842 				vidioc_s_tuner( var_group1, var_vidioc_s_tuner_23_p1, var_vidioc_s_tuner_23_p2);
 4843 				/* LDV_COMMENT_BEGIN_PREP */
 4844 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4845 				#endif
 4846 				/* LDV_COMMENT_END_PREP */
 4847 				
 4848 
 4849 				
 4850 
 4851 			}
 4852 
 4853 			break;
 4854 			case 27: {
 4855 
 4856 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4857 				
 4858 
 4859 				/* content: static int vidioc_g_frequency(struct file *file, void *priv, struct v4l2_frequency *freq)*/
 4860 				/* LDV_COMMENT_BEGIN_PREP */
 4861 				#define DRIVER_AUTHOR					\
 4862 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4863 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4864 				#define DRIVER_NAME "usbvision"
 4865 				#define DRIVER_ALIAS "USBVision"
 4866 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4867 				#define DRIVER_LICENSE "GPL"
 4868 				#define USBVISION_VERSION_STRING "0.9.11"
 4869 				#define	ENABLE_HEXDUMP	0	
 4870 				#ifdef USBVISION_DEBUG
 4871 				#define PDEBUG(level, fmt, args...) { \
 4872 		if (video_debug & (level)) \
 4873 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4874 				__func__, __LINE__ , ## args); \
 4875 	}
 4876 				#else
 4877 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4878 				#endif
 4879 				#define DBG_IO		(1 << 1)
 4880 				#define DBG_PROBE	(1 << 2)
 4881 				#define DBG_MMAP	(1 << 3)
 4882 				#define rmspace(str)	while (*str == ' ') str++;
 4883 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4884 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4885 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4886 				#endif
 4887 				/* LDV_COMMENT_END_PREP */
 4888 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_frequency" from driver structure with callbacks "usbvision_ioctl_ops" */
 4889 				ldv_handler_precall();
 4890 				vidioc_g_frequency( var_group1, var_vidioc_g_frequency_24_p1, var_vidioc_g_frequency_24_p2);
 4891 				/* LDV_COMMENT_BEGIN_PREP */
 4892 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4893 				#endif
 4894 				/* LDV_COMMENT_END_PREP */
 4895 				
 4896 
 4897 				
 4898 
 4899 			}
 4900 
 4901 			break;
 4902 			case 28: {
 4903 
 4904 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4905 				
 4906 
 4907 				/* content: static int vidioc_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *freq)*/
 4908 				/* LDV_COMMENT_BEGIN_PREP */
 4909 				#define DRIVER_AUTHOR					\
 4910 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4911 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4912 				#define DRIVER_NAME "usbvision"
 4913 				#define DRIVER_ALIAS "USBVision"
 4914 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4915 				#define DRIVER_LICENSE "GPL"
 4916 				#define USBVISION_VERSION_STRING "0.9.11"
 4917 				#define	ENABLE_HEXDUMP	0	
 4918 				#ifdef USBVISION_DEBUG
 4919 				#define PDEBUG(level, fmt, args...) { \
 4920 		if (video_debug & (level)) \
 4921 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4922 				__func__, __LINE__ , ## args); \
 4923 	}
 4924 				#else
 4925 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4926 				#endif
 4927 				#define DBG_IO		(1 << 1)
 4928 				#define DBG_PROBE	(1 << 2)
 4929 				#define DBG_MMAP	(1 << 3)
 4930 				#define rmspace(str)	while (*str == ' ') str++;
 4931 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4932 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4933 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4934 				#endif
 4935 				/* LDV_COMMENT_END_PREP */
 4936 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_frequency" from driver structure with callbacks "usbvision_ioctl_ops" */
 4937 				ldv_handler_precall();
 4938 				vidioc_s_frequency( var_group1, var_vidioc_s_frequency_25_p1, var_vidioc_s_frequency_25_p2);
 4939 				/* LDV_COMMENT_BEGIN_PREP */
 4940 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4941 				#endif
 4942 				/* LDV_COMMENT_END_PREP */
 4943 				
 4944 
 4945 				
 4946 
 4947 			}
 4948 
 4949 			break;
 4950 			case 29: {
 4951 
 4952 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4953 				
 4954 
 4955 				/* content: static int vidioc_g_register(struct file *file, void *priv, struct v4l2_dbg_register *reg)*/
 4956 				/* LDV_COMMENT_BEGIN_PREP */
 4957 				#define DRIVER_AUTHOR					\
 4958 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4959 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4960 				#define DRIVER_NAME "usbvision"
 4961 				#define DRIVER_ALIAS "USBVision"
 4962 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4963 				#define DRIVER_LICENSE "GPL"
 4964 				#define USBVISION_VERSION_STRING "0.9.11"
 4965 				#define	ENABLE_HEXDUMP	0	
 4966 				#ifdef USBVISION_DEBUG
 4967 				#define PDEBUG(level, fmt, args...) { \
 4968 		if (video_debug & (level)) \
 4969 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4970 				__func__, __LINE__ , ## args); \
 4971 	}
 4972 				#else
 4973 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4974 				#endif
 4975 				#define DBG_IO		(1 << 1)
 4976 				#define DBG_PROBE	(1 << 2)
 4977 				#define DBG_MMAP	(1 << 3)
 4978 				#define rmspace(str)	while (*str == ' ') str++;
 4979 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4980 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4981 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4982 				/* LDV_COMMENT_END_PREP */
 4983 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_register" from driver structure with callbacks "usbvision_ioctl_ops" */
 4984 				ldv_handler_precall();
 4985 				vidioc_g_register( var_group1, var_vidioc_g_register_14_p1, var_vidioc_g_register_14_p2);
 4986 				/* LDV_COMMENT_BEGIN_PREP */
 4987 				#endif
 4988 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4989 				#endif
 4990 				/* LDV_COMMENT_END_PREP */
 4991 				
 4992 
 4993 				
 4994 
 4995 			}
 4996 
 4997 			break;
 4998 			case 30: {
 4999 
 5000 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 5001 				
 5002 
 5003 				/* content: static int vidioc_s_register(struct file *file, void *priv, const struct v4l2_dbg_register *reg)*/
 5004 				/* LDV_COMMENT_BEGIN_PREP */
 5005 				#define DRIVER_AUTHOR					\
 5006 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5007 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5008 				#define DRIVER_NAME "usbvision"
 5009 				#define DRIVER_ALIAS "USBVision"
 5010 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5011 				#define DRIVER_LICENSE "GPL"
 5012 				#define USBVISION_VERSION_STRING "0.9.11"
 5013 				#define	ENABLE_HEXDUMP	0	
 5014 				#ifdef USBVISION_DEBUG
 5015 				#define PDEBUG(level, fmt, args...) { \
 5016 		if (video_debug & (level)) \
 5017 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5018 				__func__, __LINE__ , ## args); \
 5019 	}
 5020 				#else
 5021 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5022 				#endif
 5023 				#define DBG_IO		(1 << 1)
 5024 				#define DBG_PROBE	(1 << 2)
 5025 				#define DBG_MMAP	(1 << 3)
 5026 				#define rmspace(str)	while (*str == ' ') str++;
 5027 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5028 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5029 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5030 				/* LDV_COMMENT_END_PREP */
 5031 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_register" from driver structure with callbacks "usbvision_ioctl_ops" */
 5032 				ldv_handler_precall();
 5033 				vidioc_s_register( var_group1, var_vidioc_s_register_15_p1, var_vidioc_s_register_15_p2);
 5034 				/* LDV_COMMENT_BEGIN_PREP */
 5035 				#endif
 5036 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5037 				#endif
 5038 				/* LDV_COMMENT_END_PREP */
 5039 				
 5040 
 5041 				
 5042 
 5043 			}
 5044 
 5045 			break;
 5046 			case 31: {
 5047 
 5048 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_radio_fops **/
 5049 				if(ldv_s_usbvision_radio_fops_v4l2_file_operations==0) {
 5050 
 5051 				/* content: static int usbvision_radio_open(struct file *file)*/
 5052 				/* LDV_COMMENT_BEGIN_PREP */
 5053 				#define DRIVER_AUTHOR					\
 5054 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5055 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5056 				#define DRIVER_NAME "usbvision"
 5057 				#define DRIVER_ALIAS "USBVision"
 5058 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5059 				#define DRIVER_LICENSE "GPL"
 5060 				#define USBVISION_VERSION_STRING "0.9.11"
 5061 				#define	ENABLE_HEXDUMP	0	
 5062 				#ifdef USBVISION_DEBUG
 5063 				#define PDEBUG(level, fmt, args...) { \
 5064 		if (video_debug & (level)) \
 5065 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5066 				__func__, __LINE__ , ## args); \
 5067 	}
 5068 				#else
 5069 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5070 				#endif
 5071 				#define DBG_IO		(1 << 1)
 5072 				#define DBG_PROBE	(1 << 2)
 5073 				#define DBG_MMAP	(1 << 3)
 5074 				#define rmspace(str)	while (*str == ' ') str++;
 5075 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5076 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5077 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5078 				#endif
 5079 				/* LDV_COMMENT_END_PREP */
 5080 				/* LDV_COMMENT_FUNCTION_CALL Function from field "open" from driver structure with callbacks "usbvision_radio_fops". Standart function test for correct return result. */
 5081 				ldv_handler_precall();
 5082 				res_usbvision_radio_open_45 = usbvision_radio_open( var_group1);
 5083 				 ldv_check_return_value(res_usbvision_radio_open_45);
 5084 				 if(res_usbvision_radio_open_45) 
 5085 					goto ldv_module_exit;
 5086 				/* LDV_COMMENT_BEGIN_PREP */
 5087 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5088 				#endif
 5089 				/* LDV_COMMENT_END_PREP */
 5090 				ldv_s_usbvision_radio_fops_v4l2_file_operations++;
 5091 
 5092 				}
 5093 
 5094 			}
 5095 
 5096 			break;
 5097 			case 32: {
 5098 
 5099 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_radio_fops **/
 5100 				if(ldv_s_usbvision_radio_fops_v4l2_file_operations==1) {
 5101 
 5102 				/* content: static int usbvision_radio_close(struct file *file)*/
 5103 				/* LDV_COMMENT_BEGIN_PREP */
 5104 				#define DRIVER_AUTHOR					\
 5105 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5106 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5107 				#define DRIVER_NAME "usbvision"
 5108 				#define DRIVER_ALIAS "USBVision"
 5109 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5110 				#define DRIVER_LICENSE "GPL"
 5111 				#define USBVISION_VERSION_STRING "0.9.11"
 5112 				#define	ENABLE_HEXDUMP	0	
 5113 				#ifdef USBVISION_DEBUG
 5114 				#define PDEBUG(level, fmt, args...) { \
 5115 		if (video_debug & (level)) \
 5116 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5117 				__func__, __LINE__ , ## args); \
 5118 	}
 5119 				#else
 5120 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5121 				#endif
 5122 				#define DBG_IO		(1 << 1)
 5123 				#define DBG_PROBE	(1 << 2)
 5124 				#define DBG_MMAP	(1 << 3)
 5125 				#define rmspace(str)	while (*str == ' ') str++;
 5126 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5127 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5128 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5129 				#endif
 5130 				/* LDV_COMMENT_END_PREP */
 5131 				/* LDV_COMMENT_FUNCTION_CALL Function from field "release" from driver structure with callbacks "usbvision_radio_fops" */
 5132 				ldv_handler_precall();
 5133 				usbvision_radio_close( var_group1);
 5134 				/* LDV_COMMENT_BEGIN_PREP */
 5135 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5136 				#endif
 5137 				/* LDV_COMMENT_END_PREP */
 5138 				ldv_s_usbvision_radio_fops_v4l2_file_operations=0;
 5139 
 5140 				}
 5141 
 5142 			}
 5143 
 5144 			break;
 5145 			case 33: {
 5146 
 5147 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5148 				
 5149 
 5150 				/* content: static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *vc)*/
 5151 				/* LDV_COMMENT_BEGIN_PREP */
 5152 				#define DRIVER_AUTHOR					\
 5153 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5154 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5155 				#define DRIVER_NAME "usbvision"
 5156 				#define DRIVER_ALIAS "USBVision"
 5157 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5158 				#define DRIVER_LICENSE "GPL"
 5159 				#define USBVISION_VERSION_STRING "0.9.11"
 5160 				#define	ENABLE_HEXDUMP	0	
 5161 				#ifdef USBVISION_DEBUG
 5162 				#define PDEBUG(level, fmt, args...) { \
 5163 		if (video_debug & (level)) \
 5164 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5165 				__func__, __LINE__ , ## args); \
 5166 	}
 5167 				#else
 5168 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5169 				#endif
 5170 				#define DBG_IO		(1 << 1)
 5171 				#define DBG_PROBE	(1 << 2)
 5172 				#define DBG_MMAP	(1 << 3)
 5173 				#define rmspace(str)	while (*str == ' ') str++;
 5174 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5175 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5176 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5177 				#endif
 5178 				/* LDV_COMMENT_END_PREP */
 5179 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_querycap" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5180 				ldv_handler_precall();
 5181 				vidioc_querycap( var_group1, var_vidioc_querycap_16_p1, var_vidioc_querycap_16_p2);
 5182 				/* LDV_COMMENT_BEGIN_PREP */
 5183 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5184 				#endif
 5185 				/* LDV_COMMENT_END_PREP */
 5186 				
 5187 
 5188 				
 5189 
 5190 			}
 5191 
 5192 			break;
 5193 			case 34: {
 5194 
 5195 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5196 				
 5197 
 5198 				/* content: static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *vi)*/
 5199 				/* LDV_COMMENT_BEGIN_PREP */
 5200 				#define DRIVER_AUTHOR					\
 5201 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5202 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5203 				#define DRIVER_NAME "usbvision"
 5204 				#define DRIVER_ALIAS "USBVision"
 5205 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5206 				#define DRIVER_LICENSE "GPL"
 5207 				#define USBVISION_VERSION_STRING "0.9.11"
 5208 				#define	ENABLE_HEXDUMP	0	
 5209 				#ifdef USBVISION_DEBUG
 5210 				#define PDEBUG(level, fmt, args...) { \
 5211 		if (video_debug & (level)) \
 5212 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5213 				__func__, __LINE__ , ## args); \
 5214 	}
 5215 				#else
 5216 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5217 				#endif
 5218 				#define DBG_IO		(1 << 1)
 5219 				#define DBG_PROBE	(1 << 2)
 5220 				#define DBG_MMAP	(1 << 3)
 5221 				#define rmspace(str)	while (*str == ' ') str++;
 5222 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5223 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5224 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5225 				#endif
 5226 				/* LDV_COMMENT_END_PREP */
 5227 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_enum_input" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5228 				ldv_handler_precall();
 5229 				vidioc_enum_input( var_group1, var_vidioc_enum_input_17_p1, var_vidioc_enum_input_17_p2);
 5230 				/* LDV_COMMENT_BEGIN_PREP */
 5231 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5232 				#endif
 5233 				/* LDV_COMMENT_END_PREP */
 5234 				
 5235 
 5236 				
 5237 
 5238 			}
 5239 
 5240 			break;
 5241 			case 35: {
 5242 
 5243 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5244 				
 5245 
 5246 				/* content: static int vidioc_g_input(struct file *file, void *priv, unsigned int *input)*/
 5247 				/* LDV_COMMENT_BEGIN_PREP */
 5248 				#define DRIVER_AUTHOR					\
 5249 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5250 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5251 				#define DRIVER_NAME "usbvision"
 5252 				#define DRIVER_ALIAS "USBVision"
 5253 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5254 				#define DRIVER_LICENSE "GPL"
 5255 				#define USBVISION_VERSION_STRING "0.9.11"
 5256 				#define	ENABLE_HEXDUMP	0	
 5257 				#ifdef USBVISION_DEBUG
 5258 				#define PDEBUG(level, fmt, args...) { \
 5259 		if (video_debug & (level)) \
 5260 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5261 				__func__, __LINE__ , ## args); \
 5262 	}
 5263 				#else
 5264 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5265 				#endif
 5266 				#define DBG_IO		(1 << 1)
 5267 				#define DBG_PROBE	(1 << 2)
 5268 				#define DBG_MMAP	(1 << 3)
 5269 				#define rmspace(str)	while (*str == ' ') str++;
 5270 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5271 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5272 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5273 				#endif
 5274 				/* LDV_COMMENT_END_PREP */
 5275 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_input" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5276 				ldv_handler_precall();
 5277 				vidioc_g_input( var_group1, var_vidioc_g_input_18_p1, var_vidioc_g_input_18_p2);
 5278 				/* LDV_COMMENT_BEGIN_PREP */
 5279 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5280 				#endif
 5281 				/* LDV_COMMENT_END_PREP */
 5282 				
 5283 
 5284 				
 5285 
 5286 			}
 5287 
 5288 			break;
 5289 			case 36: {
 5290 
 5291 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5292 				
 5293 
 5294 				/* content: static int vidioc_s_input(struct file *file, void *priv, unsigned int input)*/
 5295 				/* LDV_COMMENT_BEGIN_PREP */
 5296 				#define DRIVER_AUTHOR					\
 5297 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5298 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5299 				#define DRIVER_NAME "usbvision"
 5300 				#define DRIVER_ALIAS "USBVision"
 5301 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5302 				#define DRIVER_LICENSE "GPL"
 5303 				#define USBVISION_VERSION_STRING "0.9.11"
 5304 				#define	ENABLE_HEXDUMP	0	
 5305 				#ifdef USBVISION_DEBUG
 5306 				#define PDEBUG(level, fmt, args...) { \
 5307 		if (video_debug & (level)) \
 5308 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5309 				__func__, __LINE__ , ## args); \
 5310 	}
 5311 				#else
 5312 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5313 				#endif
 5314 				#define DBG_IO		(1 << 1)
 5315 				#define DBG_PROBE	(1 << 2)
 5316 				#define DBG_MMAP	(1 << 3)
 5317 				#define rmspace(str)	while (*str == ' ') str++;
 5318 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5319 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5320 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5321 				#endif
 5322 				/* LDV_COMMENT_END_PREP */
 5323 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_input" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5324 				ldv_handler_precall();
 5325 				vidioc_s_input( var_group1, var_vidioc_s_input_19_p1, var_vidioc_s_input_19_p2);
 5326 				/* LDV_COMMENT_BEGIN_PREP */
 5327 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5328 				#endif
 5329 				/* LDV_COMMENT_END_PREP */
 5330 				
 5331 
 5332 				
 5333 
 5334 			}
 5335 
 5336 			break;
 5337 			case 37: {
 5338 
 5339 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5340 				
 5341 
 5342 				/* content: static int vidioc_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *ctrl)*/
 5343 				/* LDV_COMMENT_BEGIN_PREP */
 5344 				#define DRIVER_AUTHOR					\
 5345 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5346 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5347 				#define DRIVER_NAME "usbvision"
 5348 				#define DRIVER_ALIAS "USBVision"
 5349 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5350 				#define DRIVER_LICENSE "GPL"
 5351 				#define USBVISION_VERSION_STRING "0.9.11"
 5352 				#define	ENABLE_HEXDUMP	0	
 5353 				#ifdef USBVISION_DEBUG
 5354 				#define PDEBUG(level, fmt, args...) { \
 5355 		if (video_debug & (level)) \
 5356 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5357 				__func__, __LINE__ , ## args); \
 5358 	}
 5359 				#else
 5360 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5361 				#endif
 5362 				#define DBG_IO		(1 << 1)
 5363 				#define DBG_PROBE	(1 << 2)
 5364 				#define DBG_MMAP	(1 << 3)
 5365 				#define rmspace(str)	while (*str == ' ') str++;
 5366 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5367 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5368 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5369 				#endif
 5370 				/* LDV_COMMENT_END_PREP */
 5371 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_queryctrl" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5372 				ldv_handler_precall();
 5373 				vidioc_queryctrl( var_group1, var_vidioc_queryctrl_28_p1, var_vidioc_queryctrl_28_p2);
 5374 				/* LDV_COMMENT_BEGIN_PREP */
 5375 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5376 				#endif
 5377 				/* LDV_COMMENT_END_PREP */
 5378 				
 5379 
 5380 				
 5381 
 5382 			}
 5383 
 5384 			break;
 5385 			case 38: {
 5386 
 5387 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5388 				
 5389 
 5390 				/* content: static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)*/
 5391 				/* LDV_COMMENT_BEGIN_PREP */
 5392 				#define DRIVER_AUTHOR					\
 5393 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5394 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5395 				#define DRIVER_NAME "usbvision"
 5396 				#define DRIVER_ALIAS "USBVision"
 5397 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5398 				#define DRIVER_LICENSE "GPL"
 5399 				#define USBVISION_VERSION_STRING "0.9.11"
 5400 				#define	ENABLE_HEXDUMP	0	
 5401 				#ifdef USBVISION_DEBUG
 5402 				#define PDEBUG(level, fmt, args...) { \
 5403 		if (video_debug & (level)) \
 5404 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5405 				__func__, __LINE__ , ## args); \
 5406 	}
 5407 				#else
 5408 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5409 				#endif
 5410 				#define DBG_IO		(1 << 1)
 5411 				#define DBG_PROBE	(1 << 2)
 5412 				#define DBG_MMAP	(1 << 3)
 5413 				#define rmspace(str)	while (*str == ' ') str++;
 5414 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5415 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5416 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5417 				#endif
 5418 				/* LDV_COMMENT_END_PREP */
 5419 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_audio" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5420 				ldv_handler_precall();
 5421 				vidioc_g_audio( var_group1, var_vidioc_g_audio_26_p1, var_vidioc_g_audio_26_p2);
 5422 				/* LDV_COMMENT_BEGIN_PREP */
 5423 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5424 				#endif
 5425 				/* LDV_COMMENT_END_PREP */
 5426 				
 5427 
 5428 				
 5429 
 5430 			}
 5431 
 5432 			break;
 5433 			case 39: {
 5434 
 5435 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5436 				
 5437 
 5438 				/* content: static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)*/
 5439 				/* LDV_COMMENT_BEGIN_PREP */
 5440 				#define DRIVER_AUTHOR					\
 5441 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5442 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5443 				#define DRIVER_NAME "usbvision"
 5444 				#define DRIVER_ALIAS "USBVision"
 5445 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5446 				#define DRIVER_LICENSE "GPL"
 5447 				#define USBVISION_VERSION_STRING "0.9.11"
 5448 				#define	ENABLE_HEXDUMP	0	
 5449 				#ifdef USBVISION_DEBUG
 5450 				#define PDEBUG(level, fmt, args...) { \
 5451 		if (video_debug & (level)) \
 5452 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5453 				__func__, __LINE__ , ## args); \
 5454 	}
 5455 				#else
 5456 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5457 				#endif
 5458 				#define DBG_IO		(1 << 1)
 5459 				#define DBG_PROBE	(1 << 2)
 5460 				#define DBG_MMAP	(1 << 3)
 5461 				#define rmspace(str)	while (*str == ' ') str++;
 5462 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5463 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5464 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5465 				#endif
 5466 				/* LDV_COMMENT_END_PREP */
 5467 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_audio" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5468 				ldv_handler_precall();
 5469 				vidioc_s_audio( var_group1, var_vidioc_s_audio_27_p1, var_vidioc_s_audio_27_p2);
 5470 				/* LDV_COMMENT_BEGIN_PREP */
 5471 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5472 				#endif
 5473 				/* LDV_COMMENT_END_PREP */
 5474 				
 5475 
 5476 				
 5477 
 5478 			}
 5479 
 5480 			break;
 5481 			case 40: {
 5482 
 5483 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5484 				
 5485 
 5486 				/* content: static int vidioc_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 5487 				/* LDV_COMMENT_BEGIN_PREP */
 5488 				#define DRIVER_AUTHOR					\
 5489 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5490 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5491 				#define DRIVER_NAME "usbvision"
 5492 				#define DRIVER_ALIAS "USBVision"
 5493 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5494 				#define DRIVER_LICENSE "GPL"
 5495 				#define USBVISION_VERSION_STRING "0.9.11"
 5496 				#define	ENABLE_HEXDUMP	0	
 5497 				#ifdef USBVISION_DEBUG
 5498 				#define PDEBUG(level, fmt, args...) { \
 5499 		if (video_debug & (level)) \
 5500 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5501 				__func__, __LINE__ , ## args); \
 5502 	}
 5503 				#else
 5504 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5505 				#endif
 5506 				#define DBG_IO		(1 << 1)
 5507 				#define DBG_PROBE	(1 << 2)
 5508 				#define DBG_MMAP	(1 << 3)
 5509 				#define rmspace(str)	while (*str == ' ') str++;
 5510 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5511 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5512 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5513 				#endif
 5514 				/* LDV_COMMENT_END_PREP */
 5515 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_ctrl" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5516 				ldv_handler_precall();
 5517 				vidioc_g_ctrl( var_group1, var_vidioc_g_ctrl_29_p1, var_vidioc_g_ctrl_29_p2);
 5518 				/* LDV_COMMENT_BEGIN_PREP */
 5519 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5520 				#endif
 5521 				/* LDV_COMMENT_END_PREP */
 5522 				
 5523 
 5524 				
 5525 
 5526 			}
 5527 
 5528 			break;
 5529 			case 41: {
 5530 
 5531 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5532 				
 5533 
 5534 				/* content: static int vidioc_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 5535 				/* LDV_COMMENT_BEGIN_PREP */
 5536 				#define DRIVER_AUTHOR					\
 5537 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5538 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5539 				#define DRIVER_NAME "usbvision"
 5540 				#define DRIVER_ALIAS "USBVision"
 5541 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5542 				#define DRIVER_LICENSE "GPL"
 5543 				#define USBVISION_VERSION_STRING "0.9.11"
 5544 				#define	ENABLE_HEXDUMP	0	
 5545 				#ifdef USBVISION_DEBUG
 5546 				#define PDEBUG(level, fmt, args...) { \
 5547 		if (video_debug & (level)) \
 5548 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5549 				__func__, __LINE__ , ## args); \
 5550 	}
 5551 				#else
 5552 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5553 				#endif
 5554 				#define DBG_IO		(1 << 1)
 5555 				#define DBG_PROBE	(1 << 2)
 5556 				#define DBG_MMAP	(1 << 3)
 5557 				#define rmspace(str)	while (*str == ' ') str++;
 5558 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5559 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5560 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5561 				#endif
 5562 				/* LDV_COMMENT_END_PREP */
 5563 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_ctrl" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5564 				ldv_handler_precall();
 5565 				vidioc_s_ctrl( var_group1, var_vidioc_s_ctrl_30_p1, var_vidioc_s_ctrl_30_p2);
 5566 				/* LDV_COMMENT_BEGIN_PREP */
 5567 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5568 				#endif
 5569 				/* LDV_COMMENT_END_PREP */
 5570 				
 5571 
 5572 				
 5573 
 5574 			}
 5575 
 5576 			break;
 5577 			case 42: {
 5578 
 5579 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5580 				
 5581 
 5582 				/* content: static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)*/
 5583 				/* LDV_COMMENT_BEGIN_PREP */
 5584 				#define DRIVER_AUTHOR					\
 5585 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5586 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5587 				#define DRIVER_NAME "usbvision"
 5588 				#define DRIVER_ALIAS "USBVision"
 5589 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5590 				#define DRIVER_LICENSE "GPL"
 5591 				#define USBVISION_VERSION_STRING "0.9.11"
 5592 				#define	ENABLE_HEXDUMP	0	
 5593 				#ifdef USBVISION_DEBUG
 5594 				#define PDEBUG(level, fmt, args...) { \
 5595 		if (video_debug & (level)) \
 5596 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5597 				__func__, __LINE__ , ## args); \
 5598 	}
 5599 				#else
 5600 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5601 				#endif
 5602 				#define DBG_IO		(1 << 1)
 5603 				#define DBG_PROBE	(1 << 2)
 5604 				#define DBG_MMAP	(1 << 3)
 5605 				#define rmspace(str)	while (*str == ' ') str++;
 5606 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5607 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5608 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5609 				#endif
 5610 				/* LDV_COMMENT_END_PREP */
 5611 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_tuner" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5612 				ldv_handler_precall();
 5613 				vidioc_g_tuner( var_group1, var_vidioc_g_tuner_22_p1, var_vidioc_g_tuner_22_p2);
 5614 				/* LDV_COMMENT_BEGIN_PREP */
 5615 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5616 				#endif
 5617 				/* LDV_COMMENT_END_PREP */
 5618 				
 5619 
 5620 				
 5621 
 5622 			}
 5623 
 5624 			break;
 5625 			case 43: {
 5626 
 5627 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5628 				
 5629 
 5630 				/* content: static int vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *vt)*/
 5631 				/* LDV_COMMENT_BEGIN_PREP */
 5632 				#define DRIVER_AUTHOR					\
 5633 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5634 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5635 				#define DRIVER_NAME "usbvision"
 5636 				#define DRIVER_ALIAS "USBVision"
 5637 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5638 				#define DRIVER_LICENSE "GPL"
 5639 				#define USBVISION_VERSION_STRING "0.9.11"
 5640 				#define	ENABLE_HEXDUMP	0	
 5641 				#ifdef USBVISION_DEBUG
 5642 				#define PDEBUG(level, fmt, args...) { \
 5643 		if (video_debug & (level)) \
 5644 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5645 				__func__, __LINE__ , ## args); \
 5646 	}
 5647 				#else
 5648 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5649 				#endif
 5650 				#define DBG_IO		(1 << 1)
 5651 				#define DBG_PROBE	(1 << 2)
 5652 				#define DBG_MMAP	(1 << 3)
 5653 				#define rmspace(str)	while (*str == ' ') str++;
 5654 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5655 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5656 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5657 				#endif
 5658 				/* LDV_COMMENT_END_PREP */
 5659 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_tuner" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5660 				ldv_handler_precall();
 5661 				vidioc_s_tuner( var_group1, var_vidioc_s_tuner_23_p1, var_vidioc_s_tuner_23_p2);
 5662 				/* LDV_COMMENT_BEGIN_PREP */
 5663 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5664 				#endif
 5665 				/* LDV_COMMENT_END_PREP */
 5666 				
 5667 
 5668 				
 5669 
 5670 			}
 5671 
 5672 			break;
 5673 			case 44: {
 5674 
 5675 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5676 				
 5677 
 5678 				/* content: static int vidioc_g_frequency(struct file *file, void *priv, struct v4l2_frequency *freq)*/
 5679 				/* LDV_COMMENT_BEGIN_PREP */
 5680 				#define DRIVER_AUTHOR					\
 5681 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5682 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5683 				#define DRIVER_NAME "usbvision"
 5684 				#define DRIVER_ALIAS "USBVision"
 5685 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5686 				#define DRIVER_LICENSE "GPL"
 5687 				#define USBVISION_VERSION_STRING "0.9.11"
 5688 				#define	ENABLE_HEXDUMP	0	
 5689 				#ifdef USBVISION_DEBUG
 5690 				#define PDEBUG(level, fmt, args...) { \
 5691 		if (video_debug & (level)) \
 5692 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5693 				__func__, __LINE__ , ## args); \
 5694 	}
 5695 				#else
 5696 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5697 				#endif
 5698 				#define DBG_IO		(1 << 1)
 5699 				#define DBG_PROBE	(1 << 2)
 5700 				#define DBG_MMAP	(1 << 3)
 5701 				#define rmspace(str)	while (*str == ' ') str++;
 5702 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5703 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5704 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5705 				#endif
 5706 				/* LDV_COMMENT_END_PREP */
 5707 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_frequency" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5708 				ldv_handler_precall();
 5709 				vidioc_g_frequency( var_group1, var_vidioc_g_frequency_24_p1, var_vidioc_g_frequency_24_p2);
 5710 				/* LDV_COMMENT_BEGIN_PREP */
 5711 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5712 				#endif
 5713 				/* LDV_COMMENT_END_PREP */
 5714 				
 5715 
 5716 				
 5717 
 5718 			}
 5719 
 5720 			break;
 5721 			case 45: {
 5722 
 5723 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5724 				
 5725 
 5726 				/* content: static int vidioc_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *freq)*/
 5727 				/* LDV_COMMENT_BEGIN_PREP */
 5728 				#define DRIVER_AUTHOR					\
 5729 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5730 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5731 				#define DRIVER_NAME "usbvision"
 5732 				#define DRIVER_ALIAS "USBVision"
 5733 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5734 				#define DRIVER_LICENSE "GPL"
 5735 				#define USBVISION_VERSION_STRING "0.9.11"
 5736 				#define	ENABLE_HEXDUMP	0	
 5737 				#ifdef USBVISION_DEBUG
 5738 				#define PDEBUG(level, fmt, args...) { \
 5739 		if (video_debug & (level)) \
 5740 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5741 				__func__, __LINE__ , ## args); \
 5742 	}
 5743 				#else
 5744 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5745 				#endif
 5746 				#define DBG_IO		(1 << 1)
 5747 				#define DBG_PROBE	(1 << 2)
 5748 				#define DBG_MMAP	(1 << 3)
 5749 				#define rmspace(str)	while (*str == ' ') str++;
 5750 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5751 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5752 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5753 				#endif
 5754 				/* LDV_COMMENT_END_PREP */
 5755 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_frequency" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5756 				ldv_handler_precall();
 5757 				vidioc_s_frequency( var_group1, var_vidioc_s_frequency_25_p1, var_vidioc_s_frequency_25_p2);
 5758 				/* LDV_COMMENT_BEGIN_PREP */
 5759 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5760 				#endif
 5761 				/* LDV_COMMENT_END_PREP */
 5762 				
 5763 
 5764 				
 5765 
 5766 			}
 5767 
 5768 			break;
 5769 			case 46: {
 5770 
 5771 				/** STRUCT: struct type: usb_driver, struct name: usbvision_driver **/
 5772 				if(ldv_s_usbvision_driver_usb_driver==0) {
 5773 
 5774 				/* content: static int usbvision_probe(struct usb_interface *intf, const struct usb_device_id *devid)*/
 5775 				/* LDV_COMMENT_BEGIN_PREP */
 5776 				#define DRIVER_AUTHOR					\
 5777 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5778 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5779 				#define DRIVER_NAME "usbvision"
 5780 				#define DRIVER_ALIAS "USBVision"
 5781 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5782 				#define DRIVER_LICENSE "GPL"
 5783 				#define USBVISION_VERSION_STRING "0.9.11"
 5784 				#define	ENABLE_HEXDUMP	0	
 5785 				#ifdef USBVISION_DEBUG
 5786 				#define PDEBUG(level, fmt, args...) { \
 5787 		if (video_debug & (level)) \
 5788 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5789 				__func__, __LINE__ , ## args); \
 5790 	}
 5791 				#else
 5792 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5793 				#endif
 5794 				#define DBG_IO		(1 << 1)
 5795 				#define DBG_PROBE	(1 << 2)
 5796 				#define DBG_MMAP	(1 << 3)
 5797 				#define rmspace(str)	while (*str == ' ') str++;
 5798 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5799 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5800 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5801 				#endif
 5802 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5803 				#endif
 5804 				/* LDV_COMMENT_END_PREP */
 5805 				/* LDV_COMMENT_FUNCTION_CALL Function from field "probe" from driver structure with callbacks "usbvision_driver". Standart function test for correct return result. */
 5806 				res_usbvision_probe_53 = usbvision_probe( var_group3, var_usbvision_probe_53_p1);
 5807 				 ldv_check_return_value(res_usbvision_probe_53);
 5808 				 ldv_check_return_value_probe(res_usbvision_probe_53);
 5809 				 if(res_usbvision_probe_53) 
 5810 					goto ldv_module_exit;
 5811 				ldv_s_usbvision_driver_usb_driver++;
 5812 
 5813 				}
 5814 
 5815 			}
 5816 
 5817 			break;
 5818 			case 47: {
 5819 
 5820 				/** STRUCT: struct type: usb_driver, struct name: usbvision_driver **/
 5821 				if(ldv_s_usbvision_driver_usb_driver==1) {
 5822 
 5823 				/* content: static void usbvision_disconnect(struct usb_interface *intf)*/
 5824 				/* LDV_COMMENT_BEGIN_PREP */
 5825 				#define DRIVER_AUTHOR					\
 5826 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5827 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5828 				#define DRIVER_NAME "usbvision"
 5829 				#define DRIVER_ALIAS "USBVision"
 5830 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5831 				#define DRIVER_LICENSE "GPL"
 5832 				#define USBVISION_VERSION_STRING "0.9.11"
 5833 				#define	ENABLE_HEXDUMP	0	
 5834 				#ifdef USBVISION_DEBUG
 5835 				#define PDEBUG(level, fmt, args...) { \
 5836 		if (video_debug & (level)) \
 5837 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5838 				__func__, __LINE__ , ## args); \
 5839 	}
 5840 				#else
 5841 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5842 				#endif
 5843 				#define DBG_IO		(1 << 1)
 5844 				#define DBG_PROBE	(1 << 2)
 5845 				#define DBG_MMAP	(1 << 3)
 5846 				#define rmspace(str)	while (*str == ' ') str++;
 5847 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5848 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5849 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5850 				#endif
 5851 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5852 				#endif
 5853 				/* LDV_COMMENT_END_PREP */
 5854 				/* LDV_COMMENT_FUNCTION_CALL Function from field "disconnect" from driver structure with callbacks "usbvision_driver" */
 5855 				ldv_handler_precall();
 5856 				usbvision_disconnect( var_group3);
 5857 				ldv_s_usbvision_driver_usb_driver=0;
 5858 
 5859 				}
 5860 
 5861 			}
 5862 
 5863 			break;
 5864 			default: break;
 5865 
 5866 		}
 5867 
 5868 	}
 5869 
 5870 	ldv_module_exit: 
 5871 
 5872 	/** INIT: init_type: ST_MODULE_EXIT **/
 5873 	/* content: static void __exit usbvision_exit(void)*/
 5874 	/* LDV_COMMENT_BEGIN_PREP */
 5875 	#define DRIVER_AUTHOR					\
 5876 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5877 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5878 	#define DRIVER_NAME "usbvision"
 5879 	#define DRIVER_ALIAS "USBVision"
 5880 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5881 	#define DRIVER_LICENSE "GPL"
 5882 	#define USBVISION_VERSION_STRING "0.9.11"
 5883 	#define	ENABLE_HEXDUMP	0	
 5884 	#ifdef USBVISION_DEBUG
 5885 	#define PDEBUG(level, fmt, args...) { \
 5886 		if (video_debug & (level)) \
 5887 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5888 				__func__, __LINE__ , ## args); \
 5889 	}
 5890 	#else
 5891 	#define PDEBUG(level, fmt, args...) do {} while (0)
 5892 	#endif
 5893 	#define DBG_IO		(1 << 1)
 5894 	#define DBG_PROBE	(1 << 2)
 5895 	#define DBG_MMAP	(1 << 3)
 5896 	#define rmspace(str)	while (*str == ' ') str++;
 5897 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5898 	#define YES_NO(x) ((x) ? "Yes" : "No")
 5899 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 5900 	#endif
 5901 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 5902 	#endif
 5903 	/* LDV_COMMENT_END_PREP */
 5904 	/* LDV_COMMENT_FUNCTION_CALL Kernel calls driver release function before driver will be uploaded from kernel. This function declared as "MODULE_EXIT(function name)". */
 5905 	ldv_handler_precall();
 5906 	usbvision_exit();
 5907 
 5908 	/* LDV_COMMENT_FUNCTION_CALL Checks that all resources and locks are correctly released before the driver will be unloaded. */
 5909 	ldv_final: ldv_check_final_state();
 5910 
 5911 	/* LDV_COMMENT_END_FUNCTION_CALL_SECTION */
 5912 	return;
 5913 
 5914 }
 5915 #endif
 5916 
 5917 /* LDV_COMMENT_END_MAIN */                 1 
    2 #include <linux/kernel.h>
    3 bool ldv_is_err(const void *ptr);
    4 bool ldv_is_err_or_null(const void *ptr);
    5 void* ldv_err_ptr(long error);
    6 long ldv_ptr_err(const void *ptr);
    7 
    8 #include <linux/module.h>
    9 #include <linux/usb.h>
   10 
   11 // Provide model function prototypes before their usage.
   12 void ldv_usb_get_dev(void);
   13 void ldv_usb_put_dev(void);
   14 #line 1 "/work/ldvuser/ref_launch/work/current--X--drivers--X--defaultlinux-4.0-rc1.tar.xz--X--132_1a--X--cpachecker/linux-4.0-rc1.tar.xz/csd_deg_dscv/8231/dscv_tempdir/dscv/ri/132_1a/drivers/media/usb/usbvision/usbvision-video.c"
   15 
   16 /*
   17  * USB USBVISION Video device driver 0.9.10
   18  *
   19  *
   20  *
   21  * Copyright (c) 1999-2005 Joerg Heckenbach <joerg@heckenbach-aw.de>
   22  *
   23  * This module is part of usbvision driver project.
   24  *
   25  * This program is free software; you can redistribute it and/or modify
   26  * it under the terms of the GNU General Public License as published by
   27  * the Free Software Foundation; either version 2 of the License, or
   28  * (at your option) any later version.
   29  *
   30  * This program is distributed in the hope that it will be useful,
   31  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   32  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   33  * GNU General Public License for more details.
   34  *
   35  * You should have received a copy of the GNU General Public License
   36  * along with this program; if not, write to the Free Software
   37  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   38  *
   39  * Let's call the version 0.... until compression decoding is completely
   40  * implemented.
   41  *
   42  * This driver is written by Jose Ignacio Gijon and Joerg Heckenbach.
   43  * It was based on USB CPiA driver written by Peter Pregler,
   44  * Scott J. Bertin and Johannes Erdfelt
   45  * Ideas are taken from bttv driver by Ralph Metzler, Marcus Metzler &
   46  * Gerd Knorr and zoran 36120/36125 driver by Pauline Middelink
   47  * Updates to driver completed by Dwaine P. Garden
   48  *
   49  *
   50  * TODO:
   51  *     - use submit_urb for all setup packets
   52  *     - Fix memory settings for nt1004. It is 4 times as big as the
   53  *       nt1003 memory.
   54  *     - Add audio on endpoint 3 for nt1004 chip.
   55  *         Seems impossible, needs a codec interface.  Which one?
   56  *     - Clean up the driver.
   57  *     - optimization for performance.
   58  *     - Add Videotext capability (VBI).  Working on it.....
   59  *     - Check audio for other devices
   60  *
   61  */
   62 
   63 #include <linux/kernel.h>
   64 #include <linux/list.h>
   65 #include <linux/timer.h>
   66 #include <linux/slab.h>
   67 #include <linux/mm.h>
   68 #include <linux/highmem.h>
   69 #include <linux/vmalloc.h>
   70 #include <linux/module.h>
   71 #include <linux/init.h>
   72 #include <linux/spinlock.h>
   73 #include <linux/io.h>
   74 #include <linux/videodev2.h>
   75 #include <linux/i2c.h>
   76 
   77 #include <media/saa7115.h>
   78 #include <media/v4l2-common.h>
   79 #include <media/v4l2-ioctl.h>
   80 #include <media/tuner.h>
   81 
   82 #include <linux/workqueue.h>
   83 
   84 #include "usbvision.h"
   85 #include "usbvision-cards.h"
   86 
   87 #define DRIVER_AUTHOR					\
   88 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
   89 	"Dwaine Garden <DwaineGarden@rogers.com>"
   90 #define DRIVER_NAME "usbvision"
   91 #define DRIVER_ALIAS "USBVision"
   92 #define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
   93 #define DRIVER_LICENSE "GPL"
   94 #define USBVISION_VERSION_STRING "0.9.11"
   95 
   96 #define	ENABLE_HEXDUMP	0	/* Enable if you need it */
   97 
   98 
   99 #ifdef USBVISION_DEBUG
  100 	#define PDEBUG(level, fmt, args...) { \
  101 		if (video_debug & (level)) \
  102 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
  103 				__func__, __LINE__ , ## args); \
  104 	}
  105 #else
  106 	#define PDEBUG(level, fmt, args...) do {} while (0)
  107 #endif
  108 
  109 #define DBG_IO		(1 << 1)
  110 #define DBG_PROBE	(1 << 2)
  111 #define DBG_MMAP	(1 << 3)
  112 
  113 /* String operations */
  114 #define rmspace(str)	while (*str == ' ') str++;
  115 #define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
  116 
  117 
  118 /* sequential number of usbvision device */
  119 static int usbvision_nr;
  120 
  121 static struct usbvision_v4l2_format_st usbvision_v4l2_format[] = {
  122 	{ 1, 1,  8, V4L2_PIX_FMT_GREY    , "GREY" },
  123 	{ 1, 2, 16, V4L2_PIX_FMT_RGB565  , "RGB565" },
  124 	{ 1, 3, 24, V4L2_PIX_FMT_RGB24   , "RGB24" },
  125 	{ 1, 4, 32, V4L2_PIX_FMT_RGB32   , "RGB32" },
  126 	{ 1, 2, 16, V4L2_PIX_FMT_RGB555  , "RGB555" },
  127 	{ 1, 2, 16, V4L2_PIX_FMT_YUYV    , "YUV422" },
  128 	{ 1, 2, 12, V4L2_PIX_FMT_YVU420  , "YUV420P" }, /* 1.5 ! */
  129 	{ 1, 2, 16, V4L2_PIX_FMT_YUV422P , "YUV422P" }
  130 };
  131 
  132 /* Function prototypes */
  133 static void usbvision_release(struct usb_usbvision *usbvision);
  134 
  135 /* Default initialization of device driver parameters */
  136 /* Set the default format for ISOC endpoint */
  137 static int isoc_mode = ISOC_MODE_COMPRESS;
  138 /* Set the default Debug Mode of the device driver */
  139 static int video_debug;
  140 /* Set the default device to power on at startup */
  141 static int power_on_at_open = 1;
  142 /* Sequential Number of Video Device */
  143 static int video_nr = -1;
  144 /* Sequential Number of Radio Device */
  145 static int radio_nr = -1;
  146 
  147 /* Grab parameters for the device driver */
  148 
  149 /* Showing parameters under SYSFS */
  150 module_param(isoc_mode, int, 0444);
  151 module_param(video_debug, int, 0444);
  152 module_param(power_on_at_open, int, 0444);
  153 module_param(video_nr, int, 0444);
  154 module_param(radio_nr, int, 0444);
  155 
  156 MODULE_PARM_DESC(isoc_mode, " Set the default format for ISOC endpoint.  Default: 0x60 (Compression On)");
  157 MODULE_PARM_DESC(video_debug, " Set the default Debug Mode of the device driver.  Default: 0 (Off)");
  158 MODULE_PARM_DESC(power_on_at_open, " Set the default device to power on when device is opened.  Default: 1 (On)");
  159 MODULE_PARM_DESC(video_nr, "Set video device number (/dev/videoX).  Default: -1 (autodetect)");
  160 MODULE_PARM_DESC(radio_nr, "Set radio device number (/dev/radioX).  Default: -1 (autodetect)");
  161 
  162 
  163 /* Misc stuff */
  164 MODULE_AUTHOR(DRIVER_AUTHOR);
  165 MODULE_DESCRIPTION(DRIVER_DESC);
  166 MODULE_LICENSE(DRIVER_LICENSE);
  167 MODULE_VERSION(USBVISION_VERSION_STRING);
  168 MODULE_ALIAS(DRIVER_ALIAS);
  169 
  170 
  171 /*****************************************************************************/
  172 /* SYSFS Code - Copied from the stv680.c usb module.			     */
  173 /* Device information is located at /sys/class/video4linux/video0            */
  174 /* Device parameters information is located at /sys/module/usbvision         */
  175 /* Device USB Information is located at                                      */
  176 /*   /sys/bus/usb/drivers/USBVision Video Grabber                            */
  177 /*****************************************************************************/
  178 
  179 #define YES_NO(x) ((x) ? "Yes" : "No")
  180 
  181 static inline struct usb_usbvision *cd_to_usbvision(struct device *cd)
  182 {
  183 	struct video_device *vdev =
  184 		container_of(cd, struct video_device, dev);
  185 	return video_get_drvdata(vdev);
  186 }
  187 
  188 static ssize_t show_version(struct device *cd,
  189 			    struct device_attribute *attr, char *buf)
  190 {
  191 	return sprintf(buf, "%s\n", USBVISION_VERSION_STRING);
  192 }
  193 static DEVICE_ATTR(version, S_IRUGO, show_version, NULL);
  194 
  195 static ssize_t show_model(struct device *cd,
  196 			  struct device_attribute *attr, char *buf)
  197 {
  198 	struct video_device *vdev =
  199 		container_of(cd, struct video_device, dev);
  200 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  201 	return sprintf(buf, "%s\n",
  202 		       usbvision_device_data[usbvision->dev_model].model_string);
  203 }
  204 static DEVICE_ATTR(model, S_IRUGO, show_model, NULL);
  205 
  206 static ssize_t show_hue(struct device *cd,
  207 			struct device_attribute *attr, char *buf)
  208 {
  209 	struct video_device *vdev =
  210 		container_of(cd, struct video_device, dev);
  211 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  212 	struct v4l2_control ctrl;
  213 	ctrl.id = V4L2_CID_HUE;
  214 	ctrl.value = 0;
  215 	if (usbvision->user)
  216 		call_all(usbvision, core, g_ctrl, &ctrl);
  217 	return sprintf(buf, "%d\n", ctrl.value);
  218 }
  219 static DEVICE_ATTR(hue, S_IRUGO, show_hue, NULL);
  220 
  221 static ssize_t show_contrast(struct device *cd,
  222 			     struct device_attribute *attr, char *buf)
  223 {
  224 	struct video_device *vdev =
  225 		container_of(cd, struct video_device, dev);
  226 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  227 	struct v4l2_control ctrl;
  228 	ctrl.id = V4L2_CID_CONTRAST;
  229 	ctrl.value = 0;
  230 	if (usbvision->user)
  231 		call_all(usbvision, core, g_ctrl, &ctrl);
  232 	return sprintf(buf, "%d\n", ctrl.value);
  233 }
  234 static DEVICE_ATTR(contrast, S_IRUGO, show_contrast, NULL);
  235 
  236 static ssize_t show_brightness(struct device *cd,
  237 			       struct device_attribute *attr, char *buf)
  238 {
  239 	struct video_device *vdev =
  240 		container_of(cd, struct video_device, dev);
  241 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  242 	struct v4l2_control ctrl;
  243 	ctrl.id = V4L2_CID_BRIGHTNESS;
  244 	ctrl.value = 0;
  245 	if (usbvision->user)
  246 		call_all(usbvision, core, g_ctrl, &ctrl);
  247 	return sprintf(buf, "%d\n", ctrl.value);
  248 }
  249 static DEVICE_ATTR(brightness, S_IRUGO, show_brightness, NULL);
  250 
  251 static ssize_t show_saturation(struct device *cd,
  252 			       struct device_attribute *attr, char *buf)
  253 {
  254 	struct video_device *vdev =
  255 		container_of(cd, struct video_device, dev);
  256 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  257 	struct v4l2_control ctrl;
  258 	ctrl.id = V4L2_CID_SATURATION;
  259 	ctrl.value = 0;
  260 	if (usbvision->user)
  261 		call_all(usbvision, core, g_ctrl, &ctrl);
  262 	return sprintf(buf, "%d\n", ctrl.value);
  263 }
  264 static DEVICE_ATTR(saturation, S_IRUGO, show_saturation, NULL);
  265 
  266 static ssize_t show_streaming(struct device *cd,
  267 			      struct device_attribute *attr, char *buf)
  268 {
  269 	struct video_device *vdev =
  270 		container_of(cd, struct video_device, dev);
  271 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  272 	return sprintf(buf, "%s\n",
  273 		       YES_NO(usbvision->streaming == stream_on ? 1 : 0));
  274 }
  275 static DEVICE_ATTR(streaming, S_IRUGO, show_streaming, NULL);
  276 
  277 static ssize_t show_compression(struct device *cd,
  278 				struct device_attribute *attr, char *buf)
  279 {
  280 	struct video_device *vdev =
  281 		container_of(cd, struct video_device, dev);
  282 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  283 	return sprintf(buf, "%s\n",
  284 		       YES_NO(usbvision->isoc_mode == ISOC_MODE_COMPRESS));
  285 }
  286 static DEVICE_ATTR(compression, S_IRUGO, show_compression, NULL);
  287 
  288 static ssize_t show_device_bridge(struct device *cd,
  289 				  struct device_attribute *attr, char *buf)
  290 {
  291 	struct video_device *vdev =
  292 		container_of(cd, struct video_device, dev);
  293 	struct usb_usbvision *usbvision = video_get_drvdata(vdev);
  294 	return sprintf(buf, "%d\n", usbvision->bridge_type);
  295 }
  296 static DEVICE_ATTR(bridge, S_IRUGO, show_device_bridge, NULL);
  297 
  298 static void usbvision_create_sysfs(struct video_device *vdev)
  299 {
  300 	int res;
  301 
  302 	if (!vdev)
  303 		return;
  304 	do {
  305 		res = device_create_file(&vdev->dev, &dev_attr_version);
  306 		if (res < 0)
  307 			break;
  308 		res = device_create_file(&vdev->dev, &dev_attr_model);
  309 		if (res < 0)
  310 			break;
  311 		res = device_create_file(&vdev->dev, &dev_attr_hue);
  312 		if (res < 0)
  313 			break;
  314 		res = device_create_file(&vdev->dev, &dev_attr_contrast);
  315 		if (res < 0)
  316 			break;
  317 		res = device_create_file(&vdev->dev, &dev_attr_brightness);
  318 		if (res < 0)
  319 			break;
  320 		res = device_create_file(&vdev->dev, &dev_attr_saturation);
  321 		if (res < 0)
  322 			break;
  323 		res = device_create_file(&vdev->dev, &dev_attr_streaming);
  324 		if (res < 0)
  325 			break;
  326 		res = device_create_file(&vdev->dev, &dev_attr_compression);
  327 		if (res < 0)
  328 			break;
  329 		res = device_create_file(&vdev->dev, &dev_attr_bridge);
  330 		if (res >= 0)
  331 			return;
  332 	} while (0);
  333 
  334 	dev_err(&vdev->dev, "%s error: %d\n", __func__, res);
  335 }
  336 
  337 static void usbvision_remove_sysfs(struct video_device *vdev)
  338 {
  339 	if (vdev) {
  340 		device_remove_file(&vdev->dev, &dev_attr_version);
  341 		device_remove_file(&vdev->dev, &dev_attr_model);
  342 		device_remove_file(&vdev->dev, &dev_attr_hue);
  343 		device_remove_file(&vdev->dev, &dev_attr_contrast);
  344 		device_remove_file(&vdev->dev, &dev_attr_brightness);
  345 		device_remove_file(&vdev->dev, &dev_attr_saturation);
  346 		device_remove_file(&vdev->dev, &dev_attr_streaming);
  347 		device_remove_file(&vdev->dev, &dev_attr_compression);
  348 		device_remove_file(&vdev->dev, &dev_attr_bridge);
  349 	}
  350 }
  351 
  352 /*
  353  * usbvision_open()
  354  *
  355  * This is part of Video 4 Linux API. The driver can be opened by one
  356  * client only (checks internal counter 'usbvision->user'). The procedure
  357  * then allocates buffers needed for video processing.
  358  *
  359  */
  360 static int usbvision_v4l2_open(struct file *file)
  361 {
  362 	struct usb_usbvision *usbvision = video_drvdata(file);
  363 	int err_code = 0;
  364 
  365 	PDEBUG(DBG_IO, "open");
  366 
  367 	if (mutex_lock_interruptible(&usbvision->v4l2_lock))
  368 		return -ERESTARTSYS;
  369 	usbvision_reset_power_off_timer(usbvision);
  370 
  371 	if (usbvision->user)
  372 		err_code = -EBUSY;
  373 	else {
  374 		/* Allocate memory for the scratch ring buffer */
  375 		err_code = usbvision_scratch_alloc(usbvision);
  376 		if (isoc_mode == ISOC_MODE_COMPRESS) {
  377 			/* Allocate intermediate decompression buffers
  378 			   only if needed */
  379 			err_code = usbvision_decompress_alloc(usbvision);
  380 		}
  381 		if (err_code) {
  382 			/* Deallocate all buffers if trouble */
  383 			usbvision_scratch_free(usbvision);
  384 			usbvision_decompress_free(usbvision);
  385 		}
  386 	}
  387 
  388 	/* If so far no errors then we shall start the camera */
  389 	if (!err_code) {
  390 		if (usbvision->power == 0) {
  391 			usbvision_power_on(usbvision);
  392 			usbvision_i2c_register(usbvision);
  393 		}
  394 
  395 		/* Send init sequence only once, it's large! */
  396 		if (!usbvision->initialized) {
  397 			int setup_ok = 0;
  398 			setup_ok = usbvision_setup(usbvision, isoc_mode);
  399 			if (setup_ok)
  400 				usbvision->initialized = 1;
  401 			else
  402 				err_code = -EBUSY;
  403 		}
  404 
  405 		if (!err_code) {
  406 			usbvision_begin_streaming(usbvision);
  407 			err_code = usbvision_init_isoc(usbvision);
  408 			/* device must be initialized before isoc transfer */
  409 			usbvision_muxsel(usbvision, 0);
  410 			usbvision->user++;
  411 		} else {
  412 			if (power_on_at_open) {
  413 				usbvision_i2c_unregister(usbvision);
  414 				usbvision_power_off(usbvision);
  415 				usbvision->initialized = 0;
  416 			}
  417 		}
  418 	}
  419 
  420 	/* prepare queues */
  421 	usbvision_empty_framequeues(usbvision);
  422 	mutex_unlock(&usbvision->v4l2_lock);
  423 
  424 	PDEBUG(DBG_IO, "success");
  425 	return err_code;
  426 }
  427 
  428 /*
  429  * usbvision_v4l2_close()
  430  *
  431  * This is part of Video 4 Linux API. The procedure
  432  * stops streaming and deallocates all buffers that were earlier
  433  * allocated in usbvision_v4l2_open().
  434  *
  435  */
  436 static int usbvision_v4l2_close(struct file *file)
  437 {
  438 	struct usb_usbvision *usbvision = video_drvdata(file);
  439 
  440 	PDEBUG(DBG_IO, "close");
  441 
  442 	mutex_lock(&usbvision->v4l2_lock);
  443 	usbvision_audio_off(usbvision);
  444 	usbvision_restart_isoc(usbvision);
  445 	usbvision_stop_isoc(usbvision);
  446 
  447 	usbvision_decompress_free(usbvision);
  448 	usbvision_frames_free(usbvision);
  449 	usbvision_empty_framequeues(usbvision);
  450 	usbvision_scratch_free(usbvision);
  451 
  452 	usbvision->user--;
  453 
  454 	if (power_on_at_open) {
  455 		/* power off in a little while
  456 		   to avoid off/on every close/open short sequences */
  457 		usbvision_set_power_off_timer(usbvision);
  458 		usbvision->initialized = 0;
  459 	}
  460 
  461 	if (usbvision->remove_pending) {
  462 		printk(KERN_INFO "%s: Final disconnect\n", __func__);
  463 		usbvision_release(usbvision);
  464 		return 0;
  465 	}
  466 	mutex_unlock(&usbvision->v4l2_lock);
  467 
  468 	PDEBUG(DBG_IO, "success");
  469 	return 0;
  470 }
  471 
  472 
  473 /*
  474  * usbvision_ioctl()
  475  *
  476  * This is part of Video 4 Linux API. The procedure handles ioctl() calls.
  477  *
  478  */
  479 #ifdef CONFIG_VIDEO_ADV_DEBUG
  480 static int vidioc_g_register(struct file *file, void *priv,
  481 				struct v4l2_dbg_register *reg)
  482 {
  483 	struct usb_usbvision *usbvision = video_drvdata(file);
  484 	int err_code;
  485 
  486 	/* NT100x has a 8-bit register space */
  487 	err_code = usbvision_read_reg(usbvision, reg->reg&0xff);
  488 	if (err_code < 0) {
  489 		dev_err(&usbvision->vdev->dev,
  490 			"%s: VIDIOC_DBG_G_REGISTER failed: error %d\n",
  491 				__func__, err_code);
  492 		return err_code;
  493 	}
  494 	reg->val = err_code;
  495 	reg->size = 1;
  496 	return 0;
  497 }
  498 
  499 static int vidioc_s_register(struct file *file, void *priv,
  500 				const struct v4l2_dbg_register *reg)
  501 {
  502 	struct usb_usbvision *usbvision = video_drvdata(file);
  503 	int err_code;
  504 
  505 	/* NT100x has a 8-bit register space */
  506 	err_code = usbvision_write_reg(usbvision, reg->reg & 0xff, reg->val);
  507 	if (err_code < 0) {
  508 		dev_err(&usbvision->vdev->dev,
  509 			"%s: VIDIOC_DBG_S_REGISTER failed: error %d\n",
  510 				__func__, err_code);
  511 		return err_code;
  512 	}
  513 	return 0;
  514 }
  515 #endif
  516 
  517 static int vidioc_querycap(struct file *file, void  *priv,
  518 					struct v4l2_capability *vc)
  519 {
  520 	struct usb_usbvision *usbvision = video_drvdata(file);
  521 
  522 	strlcpy(vc->driver, "USBVision", sizeof(vc->driver));
  523 	strlcpy(vc->card,
  524 		usbvision_device_data[usbvision->dev_model].model_string,
  525 		sizeof(vc->card));
  526 	usb_make_path(usbvision->dev, vc->bus_info, sizeof(vc->bus_info));
  527 	vc->device_caps = V4L2_CAP_VIDEO_CAPTURE |
  528 		V4L2_CAP_AUDIO |
  529 		V4L2_CAP_READWRITE |
  530 		V4L2_CAP_STREAMING |
  531 		(usbvision->have_tuner ? V4L2_CAP_TUNER : 0);
  532 	vc->capabilities = vc->device_caps | V4L2_CAP_DEVICE_CAPS;
  533 	return 0;
  534 }
  535 
  536 static int vidioc_enum_input(struct file *file, void *priv,
  537 				struct v4l2_input *vi)
  538 {
  539 	struct usb_usbvision *usbvision = video_drvdata(file);
  540 	int chan;
  541 
  542 	if (vi->index >= usbvision->video_inputs)
  543 		return -EINVAL;
  544 	if (usbvision->have_tuner)
  545 		chan = vi->index;
  546 	else
  547 		chan = vi->index + 1; /* skip Television string*/
  548 
  549 	/* Determine the requested input characteristics
  550 	   specific for each usbvision card model */
  551 	switch (chan) {
  552 	case 0:
  553 		if (usbvision_device_data[usbvision->dev_model].video_channels == 4) {
  554 			strcpy(vi->name, "White Video Input");
  555 		} else {
  556 			strcpy(vi->name, "Television");
  557 			vi->type = V4L2_INPUT_TYPE_TUNER;
  558 			vi->audioset = 1;
  559 			vi->tuner = chan;
  560 			vi->std = USBVISION_NORMS;
  561 		}
  562 		break;
  563 	case 1:
  564 		vi->type = V4L2_INPUT_TYPE_CAMERA;
  565 		if (usbvision_device_data[usbvision->dev_model].video_channels == 4)
  566 			strcpy(vi->name, "Green Video Input");
  567 		else
  568 			strcpy(vi->name, "Composite Video Input");
  569 		vi->std = V4L2_STD_PAL;
  570 		break;
  571 	case 2:
  572 		vi->type = V4L2_INPUT_TYPE_CAMERA;
  573 		if (usbvision_device_data[usbvision->dev_model].video_channels == 4)
  574 			strcpy(vi->name, "Yellow Video Input");
  575 		else
  576 			strcpy(vi->name, "S-Video Input");
  577 		vi->std = V4L2_STD_PAL;
  578 		break;
  579 	case 3:
  580 		vi->type = V4L2_INPUT_TYPE_CAMERA;
  581 		strcpy(vi->name, "Red Video Input");
  582 		vi->std = V4L2_STD_PAL;
  583 		break;
  584 	}
  585 	return 0;
  586 }
  587 
  588 static int vidioc_g_input(struct file *file, void *priv, unsigned int *input)
  589 {
  590 	struct usb_usbvision *usbvision = video_drvdata(file);
  591 
  592 	*input = usbvision->ctl_input;
  593 	return 0;
  594 }
  595 
  596 static int vidioc_s_input(struct file *file, void *priv, unsigned int input)
  597 {
  598 	struct usb_usbvision *usbvision = video_drvdata(file);
  599 
  600 	if (input >= usbvision->video_inputs)
  601 		return -EINVAL;
  602 
  603 	usbvision_muxsel(usbvision, input);
  604 	usbvision_set_input(usbvision);
  605 	usbvision_set_output(usbvision,
  606 			     usbvision->curwidth,
  607 			     usbvision->curheight);
  608 	return 0;
  609 }
  610 
  611 static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
  612 {
  613 	struct usb_usbvision *usbvision = video_drvdata(file);
  614 
  615 	usbvision->tvnorm_id = id;
  616 
  617 	call_all(usbvision, video, s_std, usbvision->tvnorm_id);
  618 	/* propagate the change to the decoder */
  619 	usbvision_muxsel(usbvision, usbvision->ctl_input);
  620 
  621 	return 0;
  622 }
  623 
  624 static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)
  625 {
  626 	struct usb_usbvision *usbvision = video_drvdata(file);
  627 
  628 	*id = usbvision->tvnorm_id;
  629 	return 0;
  630 }
  631 
  632 static int vidioc_g_tuner(struct file *file, void *priv,
  633 				struct v4l2_tuner *vt)
  634 {
  635 	struct usb_usbvision *usbvision = video_drvdata(file);
  636 
  637 	if (!usbvision->have_tuner || vt->index)	/* Only tuner 0 */
  638 		return -EINVAL;
  639 	if (usbvision->radio) {
  640 		strcpy(vt->name, "Radio");
  641 		vt->type = V4L2_TUNER_RADIO;
  642 	} else {
  643 		strcpy(vt->name, "Television");
  644 	}
  645 	/* Let clients fill in the remainder of this struct */
  646 	call_all(usbvision, tuner, g_tuner, vt);
  647 
  648 	return 0;
  649 }
  650 
  651 static int vidioc_s_tuner(struct file *file, void *priv,
  652 				const struct v4l2_tuner *vt)
  653 {
  654 	struct usb_usbvision *usbvision = video_drvdata(file);
  655 
  656 	/* Only no or one tuner for now */
  657 	if (!usbvision->have_tuner || vt->index)
  658 		return -EINVAL;
  659 	/* let clients handle this */
  660 	call_all(usbvision, tuner, s_tuner, vt);
  661 
  662 	return 0;
  663 }
  664 
  665 static int vidioc_g_frequency(struct file *file, void *priv,
  666 				struct v4l2_frequency *freq)
  667 {
  668 	struct usb_usbvision *usbvision = video_drvdata(file);
  669 
  670 	freq->tuner = 0; /* Only one tuner */
  671 	if (usbvision->radio)
  672 		freq->type = V4L2_TUNER_RADIO;
  673 	else
  674 		freq->type = V4L2_TUNER_ANALOG_TV;
  675 	freq->frequency = usbvision->freq;
  676 
  677 	return 0;
  678 }
  679 
  680 static int vidioc_s_frequency(struct file *file, void *priv,
  681 				const struct v4l2_frequency *freq)
  682 {
  683 	struct usb_usbvision *usbvision = video_drvdata(file);
  684 
  685 	/* Only no or one tuner for now */
  686 	if (!usbvision->have_tuner || freq->tuner)
  687 		return -EINVAL;
  688 
  689 	usbvision->freq = freq->frequency;
  690 	call_all(usbvision, tuner, s_frequency, freq);
  691 
  692 	return 0;
  693 }
  694 
  695 static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)
  696 {
  697 	struct usb_usbvision *usbvision = video_drvdata(file);
  698 
  699 	if (usbvision->radio)
  700 		strcpy(a->name, "Radio");
  701 	else
  702 		strcpy(a->name, "TV");
  703 
  704 	return 0;
  705 }
  706 
  707 static int vidioc_s_audio(struct file *file, void *fh,
  708 			  const struct v4l2_audio *a)
  709 {
  710 	if (a->index)
  711 		return -EINVAL;
  712 	return 0;
  713 }
  714 
  715 static int vidioc_queryctrl(struct file *file, void *priv,
  716 			    struct v4l2_queryctrl *ctrl)
  717 {
  718 	struct usb_usbvision *usbvision = video_drvdata(file);
  719 
  720 	call_all(usbvision, core, queryctrl, ctrl);
  721 
  722 	if (!ctrl->type)
  723 		return -EINVAL;
  724 
  725 	return 0;
  726 }
  727 
  728 static int vidioc_g_ctrl(struct file *file, void *priv,
  729 				struct v4l2_control *ctrl)
  730 {
  731 	struct usb_usbvision *usbvision = video_drvdata(file);
  732 
  733 	call_all(usbvision, core, g_ctrl, ctrl);
  734 	return 0;
  735 }
  736 
  737 static int vidioc_s_ctrl(struct file *file, void *priv,
  738 				struct v4l2_control *ctrl)
  739 {
  740 	struct usb_usbvision *usbvision = video_drvdata(file);
  741 
  742 	call_all(usbvision, core, s_ctrl, ctrl);
  743 	return 0;
  744 }
  745 
  746 static int vidioc_reqbufs(struct file *file,
  747 			   void *priv, struct v4l2_requestbuffers *vr)
  748 {
  749 	struct usb_usbvision *usbvision = video_drvdata(file);
  750 	int ret;
  751 
  752 	RESTRICT_TO_RANGE(vr->count, 1, USBVISION_NUMFRAMES);
  753 
  754 	/* Check input validity:
  755 	   the user must do a VIDEO CAPTURE and MMAP method. */
  756 	if (vr->memory != V4L2_MEMORY_MMAP)
  757 		return -EINVAL;
  758 
  759 	if (usbvision->streaming == stream_on) {
  760 		ret = usbvision_stream_interrupt(usbvision);
  761 		if (ret)
  762 			return ret;
  763 	}
  764 
  765 	usbvision_frames_free(usbvision);
  766 	usbvision_empty_framequeues(usbvision);
  767 	vr->count = usbvision_frames_alloc(usbvision, vr->count);
  768 
  769 	usbvision->cur_frame = NULL;
  770 
  771 	return 0;
  772 }
  773 
  774 static int vidioc_querybuf(struct file *file,
  775 			    void *priv, struct v4l2_buffer *vb)
  776 {
  777 	struct usb_usbvision *usbvision = video_drvdata(file);
  778 	struct usbvision_frame *frame;
  779 
  780 	/* FIXME : must control
  781 	   that buffers are mapped (VIDIOC_REQBUFS has been called) */
  782 	if (vb->index >= usbvision->num_frames)
  783 		return -EINVAL;
  784 	/* Updating the corresponding frame state */
  785 	vb->flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
  786 	frame = &usbvision->frame[vb->index];
  787 	if (frame->grabstate >= frame_state_ready)
  788 		vb->flags |= V4L2_BUF_FLAG_QUEUED;
  789 	if (frame->grabstate >= frame_state_done)
  790 		vb->flags |= V4L2_BUF_FLAG_DONE;
  791 	if (frame->grabstate == frame_state_unused)
  792 		vb->flags |= V4L2_BUF_FLAG_MAPPED;
  793 	vb->memory = V4L2_MEMORY_MMAP;
  794 
  795 	vb->m.offset = vb->index * PAGE_ALIGN(usbvision->max_frame_size);
  796 
  797 	vb->memory = V4L2_MEMORY_MMAP;
  798 	vb->field = V4L2_FIELD_NONE;
  799 	vb->length = usbvision->curwidth *
  800 		usbvision->curheight *
  801 		usbvision->palette.bytes_per_pixel;
  802 	vb->timestamp = usbvision->frame[vb->index].timestamp;
  803 	vb->sequence = usbvision->frame[vb->index].sequence;
  804 	return 0;
  805 }
  806 
  807 static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *vb)
  808 {
  809 	struct usb_usbvision *usbvision = video_drvdata(file);
  810 	struct usbvision_frame *frame;
  811 	unsigned long lock_flags;
  812 
  813 	/* FIXME : works only on VIDEO_CAPTURE MODE, MMAP. */
  814 	if (vb->index >= usbvision->num_frames)
  815 		return -EINVAL;
  816 
  817 	frame = &usbvision->frame[vb->index];
  818 
  819 	if (frame->grabstate != frame_state_unused)
  820 		return -EAGAIN;
  821 
  822 	/* Mark it as ready and enqueue frame */
  823 	frame->grabstate = frame_state_ready;
  824 	frame->scanstate = scan_state_scanning;
  825 	frame->scanlength = 0;	/* Accumulated in usbvision_parse_data() */
  826 
  827 	vb->flags &= ~V4L2_BUF_FLAG_DONE;
  828 
  829 	/* set v4l2_format index */
  830 	frame->v4l2_format = usbvision->palette;
  831 
  832 	spin_lock_irqsave(&usbvision->queue_lock, lock_flags);
  833 	list_add_tail(&usbvision->frame[vb->index].frame, &usbvision->inqueue);
  834 	spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags);
  835 
  836 	return 0;
  837 }
  838 
  839 static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *vb)
  840 {
  841 	struct usb_usbvision *usbvision = video_drvdata(file);
  842 	int ret;
  843 	struct usbvision_frame *f;
  844 	unsigned long lock_flags;
  845 
  846 	if (list_empty(&(usbvision->outqueue))) {
  847 		if (usbvision->streaming == stream_idle)
  848 			return -EINVAL;
  849 		ret = wait_event_interruptible
  850 			(usbvision->wait_frame,
  851 			 !list_empty(&(usbvision->outqueue)));
  852 		if (ret)
  853 			return ret;
  854 	}
  855 
  856 	spin_lock_irqsave(&usbvision->queue_lock, lock_flags);
  857 	f = list_entry(usbvision->outqueue.next,
  858 		       struct usbvision_frame, frame);
  859 	list_del(usbvision->outqueue.next);
  860 	spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags);
  861 
  862 	f->grabstate = frame_state_unused;
  863 
  864 	vb->memory = V4L2_MEMORY_MMAP;
  865 	vb->flags = V4L2_BUF_FLAG_MAPPED |
  866 		V4L2_BUF_FLAG_QUEUED |
  867 		V4L2_BUF_FLAG_DONE |
  868 		V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
  869 	vb->index = f->index;
  870 	vb->sequence = f->sequence;
  871 	vb->timestamp = f->timestamp;
  872 	vb->field = V4L2_FIELD_NONE;
  873 	vb->bytesused = f->scanlength;
  874 
  875 	return 0;
  876 }
  877 
  878 static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
  879 {
  880 	struct usb_usbvision *usbvision = video_drvdata(file);
  881 
  882 	usbvision->streaming = stream_on;
  883 	call_all(usbvision, video, s_stream, 1);
  884 
  885 	return 0;
  886 }
  887 
  888 static int vidioc_streamoff(struct file *file,
  889 			    void *priv, enum v4l2_buf_type type)
  890 {
  891 	struct usb_usbvision *usbvision = video_drvdata(file);
  892 
  893 	if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
  894 		return -EINVAL;
  895 
  896 	if (usbvision->streaming == stream_on) {
  897 		usbvision_stream_interrupt(usbvision);
  898 		/* Stop all video streamings */
  899 		call_all(usbvision, video, s_stream, 0);
  900 	}
  901 	usbvision_empty_framequeues(usbvision);
  902 
  903 	return 0;
  904 }
  905 
  906 static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
  907 					struct v4l2_fmtdesc *vfd)
  908 {
  909 	if (vfd->index >= USBVISION_SUPPORTED_PALETTES - 1)
  910 		return -EINVAL;
  911 	strcpy(vfd->description, usbvision_v4l2_format[vfd->index].desc);
  912 	vfd->pixelformat = usbvision_v4l2_format[vfd->index].format;
  913 	return 0;
  914 }
  915 
  916 static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
  917 					struct v4l2_format *vf)
  918 {
  919 	struct usb_usbvision *usbvision = video_drvdata(file);
  920 	vf->fmt.pix.width = usbvision->curwidth;
  921 	vf->fmt.pix.height = usbvision->curheight;
  922 	vf->fmt.pix.pixelformat = usbvision->palette.format;
  923 	vf->fmt.pix.bytesperline =
  924 		usbvision->curwidth * usbvision->palette.bytes_per_pixel;
  925 	vf->fmt.pix.sizeimage = vf->fmt.pix.bytesperline * usbvision->curheight;
  926 	vf->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
  927 	vf->fmt.pix.field = V4L2_FIELD_NONE; /* Always progressive image */
  928 
  929 	return 0;
  930 }
  931 
  932 static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
  933 			       struct v4l2_format *vf)
  934 {
  935 	struct usb_usbvision *usbvision = video_drvdata(file);
  936 	int format_idx;
  937 
  938 	/* Find requested format in available ones */
  939 	for (format_idx = 0; format_idx < USBVISION_SUPPORTED_PALETTES; format_idx++) {
  940 		if (vf->fmt.pix.pixelformat ==
  941 		   usbvision_v4l2_format[format_idx].format) {
  942 			usbvision->palette = usbvision_v4l2_format[format_idx];
  943 			break;
  944 		}
  945 	}
  946 	/* robustness */
  947 	if (format_idx == USBVISION_SUPPORTED_PALETTES)
  948 		return -EINVAL;
  949 	RESTRICT_TO_RANGE(vf->fmt.pix.width, MIN_FRAME_WIDTH, MAX_FRAME_WIDTH);
  950 	RESTRICT_TO_RANGE(vf->fmt.pix.height, MIN_FRAME_HEIGHT, MAX_FRAME_HEIGHT);
  951 
  952 	vf->fmt.pix.bytesperline = vf->fmt.pix.width*
  953 		usbvision->palette.bytes_per_pixel;
  954 	vf->fmt.pix.sizeimage = vf->fmt.pix.bytesperline*vf->fmt.pix.height;
  955 
  956 	return 0;
  957 }
  958 
  959 static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
  960 			       struct v4l2_format *vf)
  961 {
  962 	struct usb_usbvision *usbvision = video_drvdata(file);
  963 	int ret;
  964 
  965 	ret = vidioc_try_fmt_vid_cap(file, priv, vf);
  966 	if (ret)
  967 		return ret;
  968 
  969 	/* stop io in case it is already in progress */
  970 	if (usbvision->streaming == stream_on) {
  971 		ret = usbvision_stream_interrupt(usbvision);
  972 		if (ret)
  973 			return ret;
  974 	}
  975 	usbvision_frames_free(usbvision);
  976 	usbvision_empty_framequeues(usbvision);
  977 
  978 	usbvision->cur_frame = NULL;
  979 
  980 	/* by now we are committed to the new data... */
  981 	usbvision_set_output(usbvision, vf->fmt.pix.width, vf->fmt.pix.height);
  982 
  983 	return 0;
  984 }
  985 
  986 static ssize_t usbvision_read(struct file *file, char __user *buf,
  987 		      size_t count, loff_t *ppos)
  988 {
  989 	struct usb_usbvision *usbvision = video_drvdata(file);
  990 	int noblock = file->f_flags & O_NONBLOCK;
  991 	unsigned long lock_flags;
  992 	int ret, i;
  993 	struct usbvision_frame *frame;
  994 
  995 	PDEBUG(DBG_IO, "%s: %ld bytes, noblock=%d", __func__,
  996 	       (unsigned long)count, noblock);
  997 
  998 	if (!USBVISION_IS_OPERATIONAL(usbvision) || (buf == NULL))
  999 		return -EFAULT;
 1000 
 1001 	/* This entry point is compatible with the mmap routines
 1002 	   so that a user can do either VIDIOC_QBUF/VIDIOC_DQBUF
 1003 	   to get frames or call read on the device. */
 1004 	if (!usbvision->num_frames) {
 1005 		/* First, allocate some frames to work with
 1006 		   if this has not been done with VIDIOC_REQBUF */
 1007 		usbvision_frames_free(usbvision);
 1008 		usbvision_empty_framequeues(usbvision);
 1009 		usbvision_frames_alloc(usbvision, USBVISION_NUMFRAMES);
 1010 	}
 1011 
 1012 	if (usbvision->streaming != stream_on) {
 1013 		/* no stream is running, make it running ! */
 1014 		usbvision->streaming = stream_on;
 1015 		call_all(usbvision, video, s_stream, 1);
 1016 	}
 1017 
 1018 	/* Then, enqueue as many frames as possible
 1019 	   (like a user of VIDIOC_QBUF would do) */
 1020 	for (i = 0; i < usbvision->num_frames; i++) {
 1021 		frame = &usbvision->frame[i];
 1022 		if (frame->grabstate == frame_state_unused) {
 1023 			/* Mark it as ready and enqueue frame */
 1024 			frame->grabstate = frame_state_ready;
 1025 			frame->scanstate = scan_state_scanning;
 1026 			/* Accumulated in usbvision_parse_data() */
 1027 			frame->scanlength = 0;
 1028 
 1029 			/* set v4l2_format index */
 1030 			frame->v4l2_format = usbvision->palette;
 1031 
 1032 			spin_lock_irqsave(&usbvision->queue_lock, lock_flags);
 1033 			list_add_tail(&frame->frame, &usbvision->inqueue);
 1034 			spin_unlock_irqrestore(&usbvision->queue_lock,
 1035 					       lock_flags);
 1036 		}
 1037 	}
 1038 
 1039 	/* Then try to steal a frame (like a VIDIOC_DQBUF would do) */
 1040 	if (list_empty(&(usbvision->outqueue))) {
 1041 		if (noblock)
 1042 			return -EAGAIN;
 1043 
 1044 		ret = wait_event_interruptible
 1045 			(usbvision->wait_frame,
 1046 			 !list_empty(&(usbvision->outqueue)));
 1047 		if (ret)
 1048 			return ret;
 1049 	}
 1050 
 1051 	spin_lock_irqsave(&usbvision->queue_lock, lock_flags);
 1052 	frame = list_entry(usbvision->outqueue.next,
 1053 			   struct usbvision_frame, frame);
 1054 	list_del(usbvision->outqueue.next);
 1055 	spin_unlock_irqrestore(&usbvision->queue_lock, lock_flags);
 1056 
 1057 	/* An error returns an empty frame */
 1058 	if (frame->grabstate == frame_state_error) {
 1059 		frame->bytes_read = 0;
 1060 		return 0;
 1061 	}
 1062 
 1063 	PDEBUG(DBG_IO, "%s: frmx=%d, bytes_read=%ld, scanlength=%ld",
 1064 	       __func__,
 1065 	       frame->index, frame->bytes_read, frame->scanlength);
 1066 
 1067 	/* copy bytes to user space; we allow for partials reads */
 1068 	if ((count + frame->bytes_read) > (unsigned long)frame->scanlength)
 1069 		count = frame->scanlength - frame->bytes_read;
 1070 
 1071 	if (copy_to_user(buf, frame->data + frame->bytes_read, count))
 1072 		return -EFAULT;
 1073 
 1074 	frame->bytes_read += count;
 1075 	PDEBUG(DBG_IO, "%s: {copy} count used=%ld, new bytes_read=%ld",
 1076 	       __func__,
 1077 	       (unsigned long)count, frame->bytes_read);
 1078 
 1079 	/* For now, forget the frame if it has not been read in one shot. */
 1080 /*	if (frame->bytes_read >= frame->scanlength) {*/ /* All data has been read */
 1081 		frame->bytes_read = 0;
 1082 
 1083 		/* Mark it as available to be used again. */
 1084 		frame->grabstate = frame_state_unused;
 1085 /*	} */
 1086 
 1087 	return count;
 1088 }
 1089 
 1090 static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf,
 1091 		      size_t count, loff_t *ppos)
 1092 {
 1093 	struct usb_usbvision *usbvision = video_drvdata(file);
 1094 	int res;
 1095 
 1096 	if (mutex_lock_interruptible(&usbvision->v4l2_lock))
 1097 		return -ERESTARTSYS;
 1098 	res = usbvision_read(file, buf, count, ppos);
 1099 	mutex_unlock(&usbvision->v4l2_lock);
 1100 	return res;
 1101 }
 1102 
 1103 static int usbvision_mmap(struct file *file, struct vm_area_struct *vma)
 1104 {
 1105 	unsigned long size = vma->vm_end - vma->vm_start,
 1106 		start = vma->vm_start;
 1107 	void *pos;
 1108 	u32 i;
 1109 	struct usb_usbvision *usbvision = video_drvdata(file);
 1110 
 1111 	PDEBUG(DBG_MMAP, "mmap");
 1112 
 1113 	if (!USBVISION_IS_OPERATIONAL(usbvision))
 1114 		return -EFAULT;
 1115 
 1116 	if (!(vma->vm_flags & VM_WRITE) ||
 1117 	    size != PAGE_ALIGN(usbvision->max_frame_size)) {
 1118 		return -EINVAL;
 1119 	}
 1120 
 1121 	for (i = 0; i < usbvision->num_frames; i++) {
 1122 		if (((PAGE_ALIGN(usbvision->max_frame_size)*i) >> PAGE_SHIFT) ==
 1123 		    vma->vm_pgoff)
 1124 			break;
 1125 	}
 1126 	if (i == usbvision->num_frames) {
 1127 		PDEBUG(DBG_MMAP,
 1128 		       "mmap: user supplied mapping address is out of range");
 1129 		return -EINVAL;
 1130 	}
 1131 
 1132 	/* VM_IO is eventually going to replace PageReserved altogether */
 1133 	vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP;
 1134 
 1135 	pos = usbvision->frame[i].data;
 1136 	while (size > 0) {
 1137 		if (vm_insert_page(vma, start, vmalloc_to_page(pos))) {
 1138 			PDEBUG(DBG_MMAP, "mmap: vm_insert_page failed");
 1139 			return -EAGAIN;
 1140 		}
 1141 		start += PAGE_SIZE;
 1142 		pos += PAGE_SIZE;
 1143 		size -= PAGE_SIZE;
 1144 	}
 1145 
 1146 	return 0;
 1147 }
 1148 
 1149 static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
 1150 {
 1151 	struct usb_usbvision *usbvision = video_drvdata(file);
 1152 	int res;
 1153 
 1154 	if (mutex_lock_interruptible(&usbvision->v4l2_lock))
 1155 		return -ERESTARTSYS;
 1156 	res = usbvision_mmap(file, vma);
 1157 	mutex_unlock(&usbvision->v4l2_lock);
 1158 	return res;
 1159 }
 1160 
 1161 /*
 1162  * Here comes the stuff for radio on usbvision based devices
 1163  *
 1164  */
 1165 static int usbvision_radio_open(struct file *file)
 1166 {
 1167 	struct usb_usbvision *usbvision = video_drvdata(file);
 1168 	int err_code = 0;
 1169 
 1170 	PDEBUG(DBG_IO, "%s:", __func__);
 1171 
 1172 	if (mutex_lock_interruptible(&usbvision->v4l2_lock))
 1173 		return -ERESTARTSYS;
 1174 	if (usbvision->user) {
 1175 		dev_err(&usbvision->rdev->dev,
 1176 			"%s: Someone tried to open an already opened USBVision Radio!\n",
 1177 				__func__);
 1178 		err_code = -EBUSY;
 1179 	} else {
 1180 		if (power_on_at_open) {
 1181 			usbvision_reset_power_off_timer(usbvision);
 1182 			if (usbvision->power == 0) {
 1183 				usbvision_power_on(usbvision);
 1184 				usbvision_i2c_register(usbvision);
 1185 			}
 1186 		}
 1187 
 1188 		/* Alternate interface 1 is is the biggest frame size */
 1189 		err_code = usbvision_set_alternate(usbvision);
 1190 		if (err_code < 0) {
 1191 			usbvision->last_error = err_code;
 1192 			err_code = -EBUSY;
 1193 			goto out;
 1194 		}
 1195 
 1196 		/* If so far no errors then we shall start the radio */
 1197 		usbvision->radio = 1;
 1198 		call_all(usbvision, tuner, s_radio);
 1199 		usbvision_set_audio(usbvision, USBVISION_AUDIO_RADIO);
 1200 		usbvision->user++;
 1201 	}
 1202 
 1203 	if (err_code) {
 1204 		if (power_on_at_open) {
 1205 			usbvision_i2c_unregister(usbvision);
 1206 			usbvision_power_off(usbvision);
 1207 			usbvision->initialized = 0;
 1208 		}
 1209 	}
 1210 out:
 1211 	mutex_unlock(&usbvision->v4l2_lock);
 1212 	return err_code;
 1213 }
 1214 
 1215 
 1216 static int usbvision_radio_close(struct file *file)
 1217 {
 1218 	struct usb_usbvision *usbvision = video_drvdata(file);
 1219 	int err_code = 0;
 1220 
 1221 	PDEBUG(DBG_IO, "");
 1222 
 1223 	mutex_lock(&usbvision->v4l2_lock);
 1224 	/* Set packet size to 0 */
 1225 	usbvision->iface_alt = 0;
 1226 	err_code = usb_set_interface(usbvision->dev, usbvision->iface,
 1227 				    usbvision->iface_alt);
 1228 
 1229 	usbvision_audio_off(usbvision);
 1230 	usbvision->radio = 0;
 1231 	usbvision->user--;
 1232 
 1233 	if (power_on_at_open) {
 1234 		usbvision_set_power_off_timer(usbvision);
 1235 		usbvision->initialized = 0;
 1236 	}
 1237 
 1238 	if (usbvision->remove_pending) {
 1239 		printk(KERN_INFO "%s: Final disconnect\n", __func__);
 1240 		usbvision_release(usbvision);
 1241 		return err_code;
 1242 	}
 1243 
 1244 	mutex_unlock(&usbvision->v4l2_lock);
 1245 	PDEBUG(DBG_IO, "success");
 1246 	return err_code;
 1247 }
 1248 
 1249 /* Video registration stuff */
 1250 
 1251 /* Video template */
 1252 static const struct v4l2_file_operations usbvision_fops = {
 1253 	.owner             = THIS_MODULE,
 1254 	.open		= usbvision_v4l2_open,
 1255 	.release	= usbvision_v4l2_close,
 1256 	.read		= usbvision_v4l2_read,
 1257 	.mmap		= usbvision_v4l2_mmap,
 1258 	.unlocked_ioctl	= video_ioctl2,
 1259 /*	.poll		= video_poll, */
 1260 };
 1261 
 1262 static const struct v4l2_ioctl_ops usbvision_ioctl_ops = {
 1263 	.vidioc_querycap      = vidioc_querycap,
 1264 	.vidioc_enum_fmt_vid_cap  = vidioc_enum_fmt_vid_cap,
 1265 	.vidioc_g_fmt_vid_cap     = vidioc_g_fmt_vid_cap,
 1266 	.vidioc_try_fmt_vid_cap   = vidioc_try_fmt_vid_cap,
 1267 	.vidioc_s_fmt_vid_cap     = vidioc_s_fmt_vid_cap,
 1268 	.vidioc_reqbufs       = vidioc_reqbufs,
 1269 	.vidioc_querybuf      = vidioc_querybuf,
 1270 	.vidioc_qbuf          = vidioc_qbuf,
 1271 	.vidioc_dqbuf         = vidioc_dqbuf,
 1272 	.vidioc_s_std         = vidioc_s_std,
 1273 	.vidioc_g_std         = vidioc_g_std,
 1274 	.vidioc_enum_input    = vidioc_enum_input,
 1275 	.vidioc_g_input       = vidioc_g_input,
 1276 	.vidioc_s_input       = vidioc_s_input,
 1277 	.vidioc_queryctrl     = vidioc_queryctrl,
 1278 	.vidioc_g_audio       = vidioc_g_audio,
 1279 	.vidioc_s_audio       = vidioc_s_audio,
 1280 	.vidioc_g_ctrl        = vidioc_g_ctrl,
 1281 	.vidioc_s_ctrl        = vidioc_s_ctrl,
 1282 	.vidioc_streamon      = vidioc_streamon,
 1283 	.vidioc_streamoff     = vidioc_streamoff,
 1284 	.vidioc_g_tuner       = vidioc_g_tuner,
 1285 	.vidioc_s_tuner       = vidioc_s_tuner,
 1286 	.vidioc_g_frequency   = vidioc_g_frequency,
 1287 	.vidioc_s_frequency   = vidioc_s_frequency,
 1288 #ifdef CONFIG_VIDEO_ADV_DEBUG
 1289 	.vidioc_g_register    = vidioc_g_register,
 1290 	.vidioc_s_register    = vidioc_s_register,
 1291 #endif
 1292 };
 1293 
 1294 static struct video_device usbvision_video_template = {
 1295 	.fops		= &usbvision_fops,
 1296 	.ioctl_ops	= &usbvision_ioctl_ops,
 1297 	.name           = "usbvision-video",
 1298 	.release	= video_device_release,
 1299 	.tvnorms        = USBVISION_NORMS,
 1300 };
 1301 
 1302 
 1303 /* Radio template */
 1304 static const struct v4l2_file_operations usbvision_radio_fops = {
 1305 	.owner             = THIS_MODULE,
 1306 	.open		= usbvision_radio_open,
 1307 	.release	= usbvision_radio_close,
 1308 	.unlocked_ioctl	= video_ioctl2,
 1309 };
 1310 
 1311 static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = {
 1312 	.vidioc_querycap      = vidioc_querycap,
 1313 	.vidioc_enum_input    = vidioc_enum_input,
 1314 	.vidioc_g_input       = vidioc_g_input,
 1315 	.vidioc_s_input       = vidioc_s_input,
 1316 	.vidioc_queryctrl     = vidioc_queryctrl,
 1317 	.vidioc_g_audio       = vidioc_g_audio,
 1318 	.vidioc_s_audio       = vidioc_s_audio,
 1319 	.vidioc_g_ctrl        = vidioc_g_ctrl,
 1320 	.vidioc_s_ctrl        = vidioc_s_ctrl,
 1321 	.vidioc_g_tuner       = vidioc_g_tuner,
 1322 	.vidioc_s_tuner       = vidioc_s_tuner,
 1323 	.vidioc_g_frequency   = vidioc_g_frequency,
 1324 	.vidioc_s_frequency   = vidioc_s_frequency,
 1325 };
 1326 
 1327 static struct video_device usbvision_radio_template = {
 1328 	.fops		= &usbvision_radio_fops,
 1329 	.name		= "usbvision-radio",
 1330 	.release	= video_device_release,
 1331 	.ioctl_ops	= &usbvision_radio_ioctl_ops,
 1332 };
 1333 
 1334 
 1335 static struct video_device *usbvision_vdev_init(struct usb_usbvision *usbvision,
 1336 					struct video_device *vdev_template,
 1337 					char *name)
 1338 {
 1339 	struct usb_device *usb_dev = usbvision->dev;
 1340 	struct video_device *vdev;
 1341 
 1342 	if (usb_dev == NULL) {
 1343 		dev_err(&usbvision->dev->dev,
 1344 			"%s: usbvision->dev is not set\n", __func__);
 1345 		return NULL;
 1346 	}
 1347 
 1348 	vdev = video_device_alloc();
 1349 	if (NULL == vdev)
 1350 		return NULL;
 1351 	*vdev = *vdev_template;
 1352 	vdev->lock = &usbvision->v4l2_lock;
 1353 	vdev->v4l2_dev = &usbvision->v4l2_dev;
 1354 	snprintf(vdev->name, sizeof(vdev->name), "%s", name);
 1355 	video_set_drvdata(vdev, usbvision);
 1356 	return vdev;
 1357 }
 1358 
 1359 /* unregister video4linux devices */
 1360 static void usbvision_unregister_video(struct usb_usbvision *usbvision)
 1361 {
 1362 	/* Radio Device: */
 1363 	if (usbvision->rdev) {
 1364 		PDEBUG(DBG_PROBE, "unregister %s [v4l2]",
 1365 		       video_device_node_name(usbvision->rdev));
 1366 		if (video_is_registered(usbvision->rdev))
 1367 			video_unregister_device(usbvision->rdev);
 1368 		else
 1369 			video_device_release(usbvision->rdev);
 1370 		usbvision->rdev = NULL;
 1371 	}
 1372 
 1373 	/* Video Device: */
 1374 	if (usbvision->vdev) {
 1375 		PDEBUG(DBG_PROBE, "unregister %s [v4l2]",
 1376 		       video_device_node_name(usbvision->vdev));
 1377 		if (video_is_registered(usbvision->vdev))
 1378 			video_unregister_device(usbvision->vdev);
 1379 		else
 1380 			video_device_release(usbvision->vdev);
 1381 		usbvision->vdev = NULL;
 1382 	}
 1383 }
 1384 
 1385 /* register video4linux devices */
 1386 static int usbvision_register_video(struct usb_usbvision *usbvision)
 1387 {
 1388 	/* Video Device: */
 1389 	usbvision->vdev = usbvision_vdev_init(usbvision,
 1390 					      &usbvision_video_template,
 1391 					      "USBVision Video");
 1392 	if (usbvision->vdev == NULL)
 1393 		goto err_exit;
 1394 	if (video_register_device(usbvision->vdev, VFL_TYPE_GRABBER, video_nr) < 0)
 1395 		goto err_exit;
 1396 	printk(KERN_INFO "USBVision[%d]: registered USBVision Video device %s [v4l2]\n",
 1397 	       usbvision->nr, video_device_node_name(usbvision->vdev));
 1398 
 1399 	/* Radio Device: */
 1400 	if (usbvision_device_data[usbvision->dev_model].radio) {
 1401 		/* usbvision has radio */
 1402 		usbvision->rdev = usbvision_vdev_init(usbvision,
 1403 						      &usbvision_radio_template,
 1404 						      "USBVision Radio");
 1405 		if (usbvision->rdev == NULL)
 1406 			goto err_exit;
 1407 		if (video_register_device(usbvision->rdev, VFL_TYPE_RADIO, radio_nr) < 0)
 1408 			goto err_exit;
 1409 		printk(KERN_INFO "USBVision[%d]: registered USBVision Radio device %s [v4l2]\n",
 1410 		       usbvision->nr, video_device_node_name(usbvision->rdev));
 1411 	}
 1412 	/* all done */
 1413 	return 0;
 1414 
 1415  err_exit:
 1416 	dev_err(&usbvision->dev->dev,
 1417 		"USBVision[%d]: video_register_device() failed\n",
 1418 			usbvision->nr);
 1419 	usbvision_unregister_video(usbvision);
 1420 	return -1;
 1421 }
 1422 
 1423 /*
 1424  * usbvision_alloc()
 1425  *
 1426  * This code allocates the struct usb_usbvision.
 1427  * It is filled with default values.
 1428  *
 1429  * Returns NULL on error, a pointer to usb_usbvision else.
 1430  *
 1431  */
 1432 static struct usb_usbvision *usbvision_alloc(struct usb_device *dev,
 1433 					     struct usb_interface *intf)
 1434 {
 1435 	struct usb_usbvision *usbvision;
 1436 
 1437 	usbvision = kzalloc(sizeof(struct usb_usbvision), GFP_KERNEL);
 1438 	if (usbvision == NULL)
 1439 		return NULL;
 1440 
 1441 	usbvision->dev = dev;
 1442 	if (v4l2_device_register(&intf->dev, &usbvision->v4l2_dev))
 1443 		goto err_free;
 1444 
 1445 	mutex_init(&usbvision->v4l2_lock);
 1446 
 1447 	/* prepare control urb for control messages during interrupts */
 1448 	usbvision->ctrl_urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL);
 1449 	if (usbvision->ctrl_urb == NULL)
 1450 		goto err_unreg;
 1451 	init_waitqueue_head(&usbvision->ctrl_urb_wq);
 1452 
 1453 	usbvision_init_power_off_timer(usbvision);
 1454 
 1455 	return usbvision;
 1456 
 1457 err_unreg:
 1458 	v4l2_device_unregister(&usbvision->v4l2_dev);
 1459 err_free:
 1460 	kfree(usbvision);
 1461 	return NULL;
 1462 }
 1463 
 1464 /*
 1465  * usbvision_release()
 1466  *
 1467  * This code does final release of struct usb_usbvision. This happens
 1468  * after the device is disconnected -and- all clients closed their files.
 1469  *
 1470  */
 1471 static void usbvision_release(struct usb_usbvision *usbvision)
 1472 {
 1473 	PDEBUG(DBG_PROBE, "");
 1474 
 1475 	usbvision_reset_power_off_timer(usbvision);
 1476 
 1477 	usbvision->initialized = 0;
 1478 
 1479 	usbvision_remove_sysfs(usbvision->vdev);
 1480 	usbvision_unregister_video(usbvision);
 1481 	kfree(usbvision->alt_max_pkt_size);
 1482 
 1483 	usb_free_urb(usbvision->ctrl_urb);
 1484 
 1485 	v4l2_device_unregister(&usbvision->v4l2_dev);
 1486 	kfree(usbvision);
 1487 
 1488 	PDEBUG(DBG_PROBE, "success");
 1489 }
 1490 
 1491 
 1492 /*********************** usb interface **********************************/
 1493 
 1494 static void usbvision_configure_video(struct usb_usbvision *usbvision)
 1495 {
 1496 	int model;
 1497 
 1498 	if (usbvision == NULL)
 1499 		return;
 1500 
 1501 	model = usbvision->dev_model;
 1502 	usbvision->palette = usbvision_v4l2_format[2]; /* V4L2_PIX_FMT_RGB24; */
 1503 
 1504 	if (usbvision_device_data[usbvision->dev_model].vin_reg2_override) {
 1505 		usbvision->vin_reg2_preset =
 1506 			usbvision_device_data[usbvision->dev_model].vin_reg2;
 1507 	} else {
 1508 		usbvision->vin_reg2_preset = 0;
 1509 	}
 1510 
 1511 	usbvision->tvnorm_id = usbvision_device_data[model].video_norm;
 1512 
 1513 	usbvision->video_inputs = usbvision_device_data[model].video_channels;
 1514 	usbvision->ctl_input = 0;
 1515 
 1516 	/* This should be here to make i2c clients to be able to register */
 1517 	/* first switch off audio */
 1518 	if (usbvision_device_data[model].audio_channels > 0)
 1519 		usbvision_audio_off(usbvision);
 1520 	if (!power_on_at_open) {
 1521 		/* and then power up the noisy tuner */
 1522 		usbvision_power_on(usbvision);
 1523 		usbvision_i2c_register(usbvision);
 1524 	}
 1525 }
 1526 
 1527 /*
 1528  * usbvision_probe()
 1529  *
 1530  * This procedure queries device descriptor and accepts the interface
 1531  * if it looks like USBVISION video device
 1532  *
 1533  */
 1534 static int usbvision_probe(struct usb_interface *intf,
 1535 			   const struct usb_device_id *devid)
 1536 {
 1537 	struct usb_device *dev = usb_get_dev(interface_to_usbdev(intf));
 1538 	struct usb_interface *uif;
 1539 	__u8 ifnum = intf->altsetting->desc.bInterfaceNumber;
 1540 	const struct usb_host_interface *interface;
 1541 	struct usb_usbvision *usbvision = NULL;
 1542 	const struct usb_endpoint_descriptor *endpoint;
 1543 	int model, i;
 1544 
 1545 	PDEBUG(DBG_PROBE, "VID=%#04x, PID=%#04x, ifnum=%u",
 1546 				dev->descriptor.idVendor,
 1547 				dev->descriptor.idProduct, ifnum);
 1548 
 1549 	model = devid->driver_info;
 1550 	if (model < 0 || model >= usbvision_device_data_size) {
 1551 		PDEBUG(DBG_PROBE, "model out of bounds %d", model);
 1552 		return -ENODEV;
 1553 	}
 1554 	printk(KERN_INFO "%s: %s found\n", __func__,
 1555 				usbvision_device_data[model].model_string);
 1556 
 1557 	if (usbvision_device_data[model].interface >= 0)
 1558 		interface = &dev->actconfig->interface[usbvision_device_data[model].interface]->altsetting[0];
 1559 	else
 1560 		interface = &dev->actconfig->interface[ifnum]->altsetting[0];
 1561 	endpoint = &interface->endpoint[1].desc;
 1562 	if (!usb_endpoint_xfer_isoc(endpoint)) {
 1563 		dev_err(&intf->dev, "%s: interface %d. has non-ISO endpoint!\n",
 1564 		    __func__, ifnum);
 1565 		dev_err(&intf->dev, "%s: Endpoint attributes %d",
 1566 		    __func__, endpoint->bmAttributes);
 1567 		return -ENODEV;
 1568 	}
 1569 	if (usb_endpoint_dir_out(endpoint)) {
 1570 		dev_err(&intf->dev, "%s: interface %d. has ISO OUT endpoint!\n",
 1571 		    __func__, ifnum);
 1572 		return -ENODEV;
 1573 	}
 1574 
 1575 	usbvision = usbvision_alloc(dev, intf);
 1576 	if (usbvision == NULL) {
 1577 		dev_err(&intf->dev, "%s: couldn't allocate USBVision struct\n", __func__);
 1578 		return -ENOMEM;
 1579 	}
 1580 
 1581 	if (dev->descriptor.bNumConfigurations > 1)
 1582 		usbvision->bridge_type = BRIDGE_NT1004;
 1583 	else if (model == DAZZLE_DVC_90_REV_1_SECAM)
 1584 		usbvision->bridge_type = BRIDGE_NT1005;
 1585 	else
 1586 		usbvision->bridge_type = BRIDGE_NT1003;
 1587 	PDEBUG(DBG_PROBE, "bridge_type %d", usbvision->bridge_type);
 1588 
 1589 	/* compute alternate max packet sizes */
 1590 	uif = dev->actconfig->interface[0];
 1591 
 1592 	usbvision->num_alt = uif->num_altsetting;
 1593 	PDEBUG(DBG_PROBE, "Alternate settings: %i", usbvision->num_alt);
 1594 	usbvision->alt_max_pkt_size = kmalloc(32 * usbvision->num_alt, GFP_KERNEL);
 1595 	if (usbvision->alt_max_pkt_size == NULL) {
 1596 		dev_err(&intf->dev, "usbvision: out of memory!\n");
 1597 		usbvision_release(usbvision);
 1598 		return -ENOMEM;
 1599 	}
 1600 
 1601 	for (i = 0; i < usbvision->num_alt; i++) {
 1602 		u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[1].desc.
 1603 				      wMaxPacketSize);
 1604 		usbvision->alt_max_pkt_size[i] =
 1605 			(tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
 1606 		PDEBUG(DBG_PROBE, "Alternate setting %i, max size= %i", i,
 1607 		       usbvision->alt_max_pkt_size[i]);
 1608 	}
 1609 
 1610 
 1611 	usbvision->nr = usbvision_nr++;
 1612 
 1613 	usbvision->have_tuner = usbvision_device_data[model].tuner;
 1614 	if (usbvision->have_tuner)
 1615 		usbvision->tuner_type = usbvision_device_data[model].tuner_type;
 1616 
 1617 	usbvision->dev_model = model;
 1618 	usbvision->remove_pending = 0;
 1619 	usbvision->iface = ifnum;
 1620 	usbvision->iface_alt = 0;
 1621 	usbvision->video_endp = endpoint->bEndpointAddress;
 1622 	usbvision->isoc_packet_size = 0;
 1623 	usbvision->usb_bandwidth = 0;
 1624 	usbvision->user = 0;
 1625 	usbvision->streaming = stream_off;
 1626 	usbvision_configure_video(usbvision);
 1627 	usbvision_register_video(usbvision);
 1628 
 1629 	usbvision_create_sysfs(usbvision->vdev);
 1630 
 1631 	PDEBUG(DBG_PROBE, "success");
 1632 	return 0;
 1633 }
 1634 
 1635 
 1636 /*
 1637  * usbvision_disconnect()
 1638  *
 1639  * This procedure stops all driver activity, deallocates interface-private
 1640  * structure (pointed by 'ptr') and after that driver should be removable
 1641  * with no ill consequences.
 1642  *
 1643  */
 1644 static void usbvision_disconnect(struct usb_interface *intf)
 1645 {
 1646 	struct usb_usbvision *usbvision = to_usbvision(usb_get_intfdata(intf));
 1647 
 1648 	PDEBUG(DBG_PROBE, "");
 1649 
 1650 	if (usbvision == NULL) {
 1651 		pr_err("%s: usb_get_intfdata() failed\n", __func__);
 1652 		return;
 1653 	}
 1654 
 1655 	mutex_lock(&usbvision->v4l2_lock);
 1656 
 1657 	/* At this time we ask to cancel outstanding URBs */
 1658 	usbvision_stop_isoc(usbvision);
 1659 
 1660 	v4l2_device_disconnect(&usbvision->v4l2_dev);
 1661 
 1662 	if (usbvision->power) {
 1663 		usbvision_i2c_unregister(usbvision);
 1664 		usbvision_power_off(usbvision);
 1665 	}
 1666 	usbvision->remove_pending = 1;	/* Now all ISO data will be ignored */
 1667 
 1668 	usb_put_dev(usbvision->dev);
 1669 	usbvision->dev = NULL;	/* USB device is no more */
 1670 
 1671 	mutex_unlock(&usbvision->v4l2_lock);
 1672 
 1673 	if (usbvision->user) {
 1674 		printk(KERN_INFO "%s: In use, disconnect pending\n",
 1675 		       __func__);
 1676 		wake_up_interruptible(&usbvision->wait_frame);
 1677 		wake_up_interruptible(&usbvision->wait_stream);
 1678 	} else {
 1679 		usbvision_release(usbvision);
 1680 	}
 1681 
 1682 	PDEBUG(DBG_PROBE, "success");
 1683 }
 1684 
 1685 static struct usb_driver usbvision_driver = {
 1686 	.name		= "usbvision",
 1687 	.id_table	= usbvision_table,
 1688 	.probe		= usbvision_probe,
 1689 	.disconnect	= usbvision_disconnect,
 1690 };
 1691 
 1692 /*
 1693  * usbvision_init()
 1694  *
 1695  * This code is run to initialize the driver.
 1696  *
 1697  */
 1698 static int __init usbvision_init(void)
 1699 {
 1700 	int err_code;
 1701 
 1702 	PDEBUG(DBG_PROBE, "");
 1703 
 1704 	PDEBUG(DBG_IO,  "IO      debugging is enabled [video]");
 1705 	PDEBUG(DBG_PROBE, "PROBE   debugging is enabled [video]");
 1706 	PDEBUG(DBG_MMAP, "MMAP    debugging is enabled [video]");
 1707 
 1708 	/* disable planar mode support unless compression enabled */
 1709 	if (isoc_mode != ISOC_MODE_COMPRESS) {
 1710 		/* FIXME : not the right way to set supported flag */
 1711 		usbvision_v4l2_format[6].supported = 0; /* V4L2_PIX_FMT_YVU420 */
 1712 		usbvision_v4l2_format[7].supported = 0; /* V4L2_PIX_FMT_YUV422P */
 1713 	}
 1714 
 1715 	err_code = usb_register(&usbvision_driver);
 1716 
 1717 	if (err_code == 0) {
 1718 		printk(KERN_INFO DRIVER_DESC " : " USBVISION_VERSION_STRING "\n");
 1719 		PDEBUG(DBG_PROBE, "success");
 1720 	}
 1721 	return err_code;
 1722 }
 1723 
 1724 static void __exit usbvision_exit(void)
 1725 {
 1726 	PDEBUG(DBG_PROBE, "");
 1727 
 1728 	usb_deregister(&usbvision_driver);
 1729 	PDEBUG(DBG_PROBE, "success");
 1730 }
 1731 
 1732 module_init(usbvision_init);
 1733 module_exit(usbvision_exit);
 1734 
 1735 
 1736 
 1737 
 1738 
 1739 /* LDV_COMMENT_BEGIN_MAIN */
 1740 #ifdef LDV_MAIN1_sequence_infinite_withcheck_stateful
 1741 
 1742 /*###########################################################################*/
 1743 
 1744 /*############## Driver Environment Generator 0.2 output ####################*/
 1745 
 1746 /*###########################################################################*/
 1747 
 1748 
 1749 
 1750 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test if all kernel resources are correctly released by driver before driver will be unloaded. */
 1751 void ldv_check_final_state(void);
 1752 
 1753 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result. */
 1754 void ldv_check_return_value(int res);
 1755 
 1756 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result of probe() function. */
 1757 void ldv_check_return_value_probe(int res);
 1758 
 1759 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Initializes the model. */
 1760 void ldv_initialize(void);
 1761 
 1762 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Reinitializes the model between distinct model function calls. */
 1763 void ldv_handler_precall(void);
 1764 
 1765 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Returns arbitrary interger value. */
 1766 int nondet_int(void);
 1767 
 1768 /* LDV_COMMENT_VAR_DECLARE_LDV Special variable for LDV verifier. */
 1769 int LDV_IN_INTERRUPT;
 1770 
 1771 /* LDV_COMMENT_FUNCTION_MAIN Main function for LDV verifier. */
 1772 void ldv_main1_sequence_infinite_withcheck_stateful(void) {
 1773 
 1774 
 1775 
 1776 	/* LDV_COMMENT_BEGIN_VARIABLE_DECLARATION_PART */
 1777 	/*============================= VARIABLE DECLARATION PART   =============================*/
 1778 	/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_fops **/
 1779 	/* content: static int usbvision_v4l2_open(struct file *file)*/
 1780 	/* LDV_COMMENT_BEGIN_PREP */
 1781 	#define DRIVER_AUTHOR					\
 1782 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1783 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1784 	#define DRIVER_NAME "usbvision"
 1785 	#define DRIVER_ALIAS "USBVision"
 1786 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1787 	#define DRIVER_LICENSE "GPL"
 1788 	#define USBVISION_VERSION_STRING "0.9.11"
 1789 	#define	ENABLE_HEXDUMP	0	
 1790 	#ifdef USBVISION_DEBUG
 1791 	#define PDEBUG(level, fmt, args...) { \
 1792 		if (video_debug & (level)) \
 1793 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1794 				__func__, __LINE__ , ## args); \
 1795 	}
 1796 	#else
 1797 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1798 	#endif
 1799 	#define DBG_IO		(1 << 1)
 1800 	#define DBG_PROBE	(1 << 2)
 1801 	#define DBG_MMAP	(1 << 3)
 1802 	#define rmspace(str)	while (*str == ' ') str++;
 1803 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1804 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1805 	/* LDV_COMMENT_END_PREP */
 1806 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_v4l2_open" */
 1807 	struct file * var_group1;
 1808 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "usbvision_v4l2_open" */
 1809 	static int res_usbvision_v4l2_open_12;
 1810 	/* LDV_COMMENT_BEGIN_PREP */
 1811 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1812 	#endif
 1813 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1814 	#endif
 1815 	/* LDV_COMMENT_END_PREP */
 1816 	/* content: static int usbvision_v4l2_close(struct file *file)*/
 1817 	/* LDV_COMMENT_BEGIN_PREP */
 1818 	#define DRIVER_AUTHOR					\
 1819 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1820 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1821 	#define DRIVER_NAME "usbvision"
 1822 	#define DRIVER_ALIAS "USBVision"
 1823 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1824 	#define DRIVER_LICENSE "GPL"
 1825 	#define USBVISION_VERSION_STRING "0.9.11"
 1826 	#define	ENABLE_HEXDUMP	0	
 1827 	#ifdef USBVISION_DEBUG
 1828 	#define PDEBUG(level, fmt, args...) { \
 1829 		if (video_debug & (level)) \
 1830 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1831 				__func__, __LINE__ , ## args); \
 1832 	}
 1833 	#else
 1834 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1835 	#endif
 1836 	#define DBG_IO		(1 << 1)
 1837 	#define DBG_PROBE	(1 << 2)
 1838 	#define DBG_MMAP	(1 << 3)
 1839 	#define rmspace(str)	while (*str == ' ') str++;
 1840 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1841 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1842 	/* LDV_COMMENT_END_PREP */
 1843 	/* LDV_COMMENT_BEGIN_PREP */
 1844 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1845 	#endif
 1846 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1847 	#endif
 1848 	/* LDV_COMMENT_END_PREP */
 1849 	/* content: static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)*/
 1850 	/* LDV_COMMENT_BEGIN_PREP */
 1851 	#define DRIVER_AUTHOR					\
 1852 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1853 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1854 	#define DRIVER_NAME "usbvision"
 1855 	#define DRIVER_ALIAS "USBVision"
 1856 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1857 	#define DRIVER_LICENSE "GPL"
 1858 	#define USBVISION_VERSION_STRING "0.9.11"
 1859 	#define	ENABLE_HEXDUMP	0	
 1860 	#ifdef USBVISION_DEBUG
 1861 	#define PDEBUG(level, fmt, args...) { \
 1862 		if (video_debug & (level)) \
 1863 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1864 				__func__, __LINE__ , ## args); \
 1865 	}
 1866 	#else
 1867 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1868 	#endif
 1869 	#define DBG_IO		(1 << 1)
 1870 	#define DBG_PROBE	(1 << 2)
 1871 	#define DBG_MMAP	(1 << 3)
 1872 	#define rmspace(str)	while (*str == ' ') str++;
 1873 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1874 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1875 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1876 	#endif
 1877 	/* LDV_COMMENT_END_PREP */
 1878 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_v4l2_read" */
 1879 	char __user * var_usbvision_v4l2_read_42_p1;
 1880 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_v4l2_read" */
 1881 	size_t  var_usbvision_v4l2_read_42_p2;
 1882 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_v4l2_read" */
 1883 	loff_t * var_usbvision_v4l2_read_42_p3;
 1884 	/* LDV_COMMENT_BEGIN_PREP */
 1885 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1886 	#endif
 1887 	/* LDV_COMMENT_END_PREP */
 1888 	/* content: static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma)*/
 1889 	/* LDV_COMMENT_BEGIN_PREP */
 1890 	#define DRIVER_AUTHOR					\
 1891 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1892 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1893 	#define DRIVER_NAME "usbvision"
 1894 	#define DRIVER_ALIAS "USBVision"
 1895 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1896 	#define DRIVER_LICENSE "GPL"
 1897 	#define USBVISION_VERSION_STRING "0.9.11"
 1898 	#define	ENABLE_HEXDUMP	0	
 1899 	#ifdef USBVISION_DEBUG
 1900 	#define PDEBUG(level, fmt, args...) { \
 1901 		if (video_debug & (level)) \
 1902 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1903 				__func__, __LINE__ , ## args); \
 1904 	}
 1905 	#else
 1906 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1907 	#endif
 1908 	#define DBG_IO		(1 << 1)
 1909 	#define DBG_PROBE	(1 << 2)
 1910 	#define DBG_MMAP	(1 << 3)
 1911 	#define rmspace(str)	while (*str == ' ') str++;
 1912 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1913 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1914 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1915 	#endif
 1916 	/* LDV_COMMENT_END_PREP */
 1917 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_v4l2_mmap" */
 1918 	struct vm_area_struct * var_group2;
 1919 	/* LDV_COMMENT_BEGIN_PREP */
 1920 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1921 	#endif
 1922 	/* LDV_COMMENT_END_PREP */
 1923 
 1924 	/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 1925 	/* content: static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *vc)*/
 1926 	/* LDV_COMMENT_BEGIN_PREP */
 1927 	#define DRIVER_AUTHOR					\
 1928 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1929 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1930 	#define DRIVER_NAME "usbvision"
 1931 	#define DRIVER_ALIAS "USBVision"
 1932 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1933 	#define DRIVER_LICENSE "GPL"
 1934 	#define USBVISION_VERSION_STRING "0.9.11"
 1935 	#define	ENABLE_HEXDUMP	0	
 1936 	#ifdef USBVISION_DEBUG
 1937 	#define PDEBUG(level, fmt, args...) { \
 1938 		if (video_debug & (level)) \
 1939 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1940 				__func__, __LINE__ , ## args); \
 1941 	}
 1942 	#else
 1943 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1944 	#endif
 1945 	#define DBG_IO		(1 << 1)
 1946 	#define DBG_PROBE	(1 << 2)
 1947 	#define DBG_MMAP	(1 << 3)
 1948 	#define rmspace(str)	while (*str == ' ') str++;
 1949 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1950 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1951 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1952 	#endif
 1953 	/* LDV_COMMENT_END_PREP */
 1954 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_querycap" */
 1955 	void * var_vidioc_querycap_16_p1;
 1956 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_querycap" */
 1957 	struct v4l2_capability * var_vidioc_querycap_16_p2;
 1958 	/* LDV_COMMENT_BEGIN_PREP */
 1959 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1960 	#endif
 1961 	/* LDV_COMMENT_END_PREP */
 1962 	/* content: static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *vfd)*/
 1963 	/* LDV_COMMENT_BEGIN_PREP */
 1964 	#define DRIVER_AUTHOR					\
 1965 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 1966 	"Dwaine Garden <DwaineGarden@rogers.com>"
 1967 	#define DRIVER_NAME "usbvision"
 1968 	#define DRIVER_ALIAS "USBVision"
 1969 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 1970 	#define DRIVER_LICENSE "GPL"
 1971 	#define USBVISION_VERSION_STRING "0.9.11"
 1972 	#define	ENABLE_HEXDUMP	0	
 1973 	#ifdef USBVISION_DEBUG
 1974 	#define PDEBUG(level, fmt, args...) { \
 1975 		if (video_debug & (level)) \
 1976 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 1977 				__func__, __LINE__ , ## args); \
 1978 	}
 1979 	#else
 1980 	#define PDEBUG(level, fmt, args...) do {} while (0)
 1981 	#endif
 1982 	#define DBG_IO		(1 << 1)
 1983 	#define DBG_PROBE	(1 << 2)
 1984 	#define DBG_MMAP	(1 << 3)
 1985 	#define rmspace(str)	while (*str == ' ') str++;
 1986 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 1987 	#define YES_NO(x) ((x) ? "Yes" : "No")
 1988 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1989 	#endif
 1990 	/* LDV_COMMENT_END_PREP */
 1991 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_enum_fmt_vid_cap" */
 1992 	void * var_vidioc_enum_fmt_vid_cap_37_p1;
 1993 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_enum_fmt_vid_cap" */
 1994 	struct v4l2_fmtdesc * var_vidioc_enum_fmt_vid_cap_37_p2;
 1995 	/* LDV_COMMENT_BEGIN_PREP */
 1996 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 1997 	#endif
 1998 	/* LDV_COMMENT_END_PREP */
 1999 	/* content: static int vidioc_g_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 2000 	/* LDV_COMMENT_BEGIN_PREP */
 2001 	#define DRIVER_AUTHOR					\
 2002 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2003 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2004 	#define DRIVER_NAME "usbvision"
 2005 	#define DRIVER_ALIAS "USBVision"
 2006 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2007 	#define DRIVER_LICENSE "GPL"
 2008 	#define USBVISION_VERSION_STRING "0.9.11"
 2009 	#define	ENABLE_HEXDUMP	0	
 2010 	#ifdef USBVISION_DEBUG
 2011 	#define PDEBUG(level, fmt, args...) { \
 2012 		if (video_debug & (level)) \
 2013 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2014 				__func__, __LINE__ , ## args); \
 2015 	}
 2016 	#else
 2017 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2018 	#endif
 2019 	#define DBG_IO		(1 << 1)
 2020 	#define DBG_PROBE	(1 << 2)
 2021 	#define DBG_MMAP	(1 << 3)
 2022 	#define rmspace(str)	while (*str == ' ') str++;
 2023 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2024 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2025 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2026 	#endif
 2027 	/* LDV_COMMENT_END_PREP */
 2028 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_fmt_vid_cap" */
 2029 	void * var_vidioc_g_fmt_vid_cap_38_p1;
 2030 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_fmt_vid_cap" */
 2031 	struct v4l2_format * var_vidioc_g_fmt_vid_cap_38_p2;
 2032 	/* LDV_COMMENT_BEGIN_PREP */
 2033 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2034 	#endif
 2035 	/* LDV_COMMENT_END_PREP */
 2036 	/* content: static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 2037 	/* LDV_COMMENT_BEGIN_PREP */
 2038 	#define DRIVER_AUTHOR					\
 2039 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2040 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2041 	#define DRIVER_NAME "usbvision"
 2042 	#define DRIVER_ALIAS "USBVision"
 2043 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2044 	#define DRIVER_LICENSE "GPL"
 2045 	#define USBVISION_VERSION_STRING "0.9.11"
 2046 	#define	ENABLE_HEXDUMP	0	
 2047 	#ifdef USBVISION_DEBUG
 2048 	#define PDEBUG(level, fmt, args...) { \
 2049 		if (video_debug & (level)) \
 2050 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2051 				__func__, __LINE__ , ## args); \
 2052 	}
 2053 	#else
 2054 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2055 	#endif
 2056 	#define DBG_IO		(1 << 1)
 2057 	#define DBG_PROBE	(1 << 2)
 2058 	#define DBG_MMAP	(1 << 3)
 2059 	#define rmspace(str)	while (*str == ' ') str++;
 2060 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2061 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2062 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2063 	#endif
 2064 	/* LDV_COMMENT_END_PREP */
 2065 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_try_fmt_vid_cap" */
 2066 	void * var_vidioc_try_fmt_vid_cap_39_p1;
 2067 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_try_fmt_vid_cap" */
 2068 	struct v4l2_format * var_vidioc_try_fmt_vid_cap_39_p2;
 2069 	/* LDV_COMMENT_BEGIN_PREP */
 2070 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2071 	#endif
 2072 	/* LDV_COMMENT_END_PREP */
 2073 	/* content: static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 2074 	/* LDV_COMMENT_BEGIN_PREP */
 2075 	#define DRIVER_AUTHOR					\
 2076 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2077 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2078 	#define DRIVER_NAME "usbvision"
 2079 	#define DRIVER_ALIAS "USBVision"
 2080 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2081 	#define DRIVER_LICENSE "GPL"
 2082 	#define USBVISION_VERSION_STRING "0.9.11"
 2083 	#define	ENABLE_HEXDUMP	0	
 2084 	#ifdef USBVISION_DEBUG
 2085 	#define PDEBUG(level, fmt, args...) { \
 2086 		if (video_debug & (level)) \
 2087 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2088 				__func__, __LINE__ , ## args); \
 2089 	}
 2090 	#else
 2091 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2092 	#endif
 2093 	#define DBG_IO		(1 << 1)
 2094 	#define DBG_PROBE	(1 << 2)
 2095 	#define DBG_MMAP	(1 << 3)
 2096 	#define rmspace(str)	while (*str == ' ') str++;
 2097 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2098 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2099 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2100 	#endif
 2101 	/* LDV_COMMENT_END_PREP */
 2102 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_fmt_vid_cap" */
 2103 	void * var_vidioc_s_fmt_vid_cap_40_p1;
 2104 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_fmt_vid_cap" */
 2105 	struct v4l2_format * var_vidioc_s_fmt_vid_cap_40_p2;
 2106 	/* LDV_COMMENT_BEGIN_PREP */
 2107 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2108 	#endif
 2109 	/* LDV_COMMENT_END_PREP */
 2110 	/* content: static int vidioc_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *vr)*/
 2111 	/* LDV_COMMENT_BEGIN_PREP */
 2112 	#define DRIVER_AUTHOR					\
 2113 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2114 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2115 	#define DRIVER_NAME "usbvision"
 2116 	#define DRIVER_ALIAS "USBVision"
 2117 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2118 	#define DRIVER_LICENSE "GPL"
 2119 	#define USBVISION_VERSION_STRING "0.9.11"
 2120 	#define	ENABLE_HEXDUMP	0	
 2121 	#ifdef USBVISION_DEBUG
 2122 	#define PDEBUG(level, fmt, args...) { \
 2123 		if (video_debug & (level)) \
 2124 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2125 				__func__, __LINE__ , ## args); \
 2126 	}
 2127 	#else
 2128 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2129 	#endif
 2130 	#define DBG_IO		(1 << 1)
 2131 	#define DBG_PROBE	(1 << 2)
 2132 	#define DBG_MMAP	(1 << 3)
 2133 	#define rmspace(str)	while (*str == ' ') str++;
 2134 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2135 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2136 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2137 	#endif
 2138 	/* LDV_COMMENT_END_PREP */
 2139 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_reqbufs" */
 2140 	void * var_vidioc_reqbufs_31_p1;
 2141 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_reqbufs" */
 2142 	struct v4l2_requestbuffers * var_vidioc_reqbufs_31_p2;
 2143 	/* LDV_COMMENT_BEGIN_PREP */
 2144 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2145 	#endif
 2146 	/* LDV_COMMENT_END_PREP */
 2147 	/* content: static int vidioc_querybuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 2148 	/* LDV_COMMENT_BEGIN_PREP */
 2149 	#define DRIVER_AUTHOR					\
 2150 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2151 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2152 	#define DRIVER_NAME "usbvision"
 2153 	#define DRIVER_ALIAS "USBVision"
 2154 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2155 	#define DRIVER_LICENSE "GPL"
 2156 	#define USBVISION_VERSION_STRING "0.9.11"
 2157 	#define	ENABLE_HEXDUMP	0	
 2158 	#ifdef USBVISION_DEBUG
 2159 	#define PDEBUG(level, fmt, args...) { \
 2160 		if (video_debug & (level)) \
 2161 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2162 				__func__, __LINE__ , ## args); \
 2163 	}
 2164 	#else
 2165 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2166 	#endif
 2167 	#define DBG_IO		(1 << 1)
 2168 	#define DBG_PROBE	(1 << 2)
 2169 	#define DBG_MMAP	(1 << 3)
 2170 	#define rmspace(str)	while (*str == ' ') str++;
 2171 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2172 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2173 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2174 	#endif
 2175 	/* LDV_COMMENT_END_PREP */
 2176 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_querybuf" */
 2177 	void * var_vidioc_querybuf_32_p1;
 2178 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_querybuf" */
 2179 	struct v4l2_buffer * var_vidioc_querybuf_32_p2;
 2180 	/* LDV_COMMENT_BEGIN_PREP */
 2181 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2182 	#endif
 2183 	/* LDV_COMMENT_END_PREP */
 2184 	/* content: static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 2185 	/* LDV_COMMENT_BEGIN_PREP */
 2186 	#define DRIVER_AUTHOR					\
 2187 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2188 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2189 	#define DRIVER_NAME "usbvision"
 2190 	#define DRIVER_ALIAS "USBVision"
 2191 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2192 	#define DRIVER_LICENSE "GPL"
 2193 	#define USBVISION_VERSION_STRING "0.9.11"
 2194 	#define	ENABLE_HEXDUMP	0	
 2195 	#ifdef USBVISION_DEBUG
 2196 	#define PDEBUG(level, fmt, args...) { \
 2197 		if (video_debug & (level)) \
 2198 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2199 				__func__, __LINE__ , ## args); \
 2200 	}
 2201 	#else
 2202 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2203 	#endif
 2204 	#define DBG_IO		(1 << 1)
 2205 	#define DBG_PROBE	(1 << 2)
 2206 	#define DBG_MMAP	(1 << 3)
 2207 	#define rmspace(str)	while (*str == ' ') str++;
 2208 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2209 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2210 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2211 	#endif
 2212 	/* LDV_COMMENT_END_PREP */
 2213 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_qbuf" */
 2214 	void * var_vidioc_qbuf_33_p1;
 2215 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_qbuf" */
 2216 	struct v4l2_buffer * var_vidioc_qbuf_33_p2;
 2217 	/* LDV_COMMENT_BEGIN_PREP */
 2218 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2219 	#endif
 2220 	/* LDV_COMMENT_END_PREP */
 2221 	/* content: static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 2222 	/* LDV_COMMENT_BEGIN_PREP */
 2223 	#define DRIVER_AUTHOR					\
 2224 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2225 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2226 	#define DRIVER_NAME "usbvision"
 2227 	#define DRIVER_ALIAS "USBVision"
 2228 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2229 	#define DRIVER_LICENSE "GPL"
 2230 	#define USBVISION_VERSION_STRING "0.9.11"
 2231 	#define	ENABLE_HEXDUMP	0	
 2232 	#ifdef USBVISION_DEBUG
 2233 	#define PDEBUG(level, fmt, args...) { \
 2234 		if (video_debug & (level)) \
 2235 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2236 				__func__, __LINE__ , ## args); \
 2237 	}
 2238 	#else
 2239 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2240 	#endif
 2241 	#define DBG_IO		(1 << 1)
 2242 	#define DBG_PROBE	(1 << 2)
 2243 	#define DBG_MMAP	(1 << 3)
 2244 	#define rmspace(str)	while (*str == ' ') str++;
 2245 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2246 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2247 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2248 	#endif
 2249 	/* LDV_COMMENT_END_PREP */
 2250 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_dqbuf" */
 2251 	void * var_vidioc_dqbuf_34_p1;
 2252 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_dqbuf" */
 2253 	struct v4l2_buffer * var_vidioc_dqbuf_34_p2;
 2254 	/* LDV_COMMENT_BEGIN_PREP */
 2255 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2256 	#endif
 2257 	/* LDV_COMMENT_END_PREP */
 2258 	/* content: static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)*/
 2259 	/* LDV_COMMENT_BEGIN_PREP */
 2260 	#define DRIVER_AUTHOR					\
 2261 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2262 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2263 	#define DRIVER_NAME "usbvision"
 2264 	#define DRIVER_ALIAS "USBVision"
 2265 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2266 	#define DRIVER_LICENSE "GPL"
 2267 	#define USBVISION_VERSION_STRING "0.9.11"
 2268 	#define	ENABLE_HEXDUMP	0	
 2269 	#ifdef USBVISION_DEBUG
 2270 	#define PDEBUG(level, fmt, args...) { \
 2271 		if (video_debug & (level)) \
 2272 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2273 				__func__, __LINE__ , ## args); \
 2274 	}
 2275 	#else
 2276 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2277 	#endif
 2278 	#define DBG_IO		(1 << 1)
 2279 	#define DBG_PROBE	(1 << 2)
 2280 	#define DBG_MMAP	(1 << 3)
 2281 	#define rmspace(str)	while (*str == ' ') str++;
 2282 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2283 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2284 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2285 	#endif
 2286 	/* LDV_COMMENT_END_PREP */
 2287 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_std" */
 2288 	void * var_vidioc_s_std_20_p1;
 2289 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_std" */
 2290 	v4l2_std_id  var_vidioc_s_std_20_p2;
 2291 	/* LDV_COMMENT_BEGIN_PREP */
 2292 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2293 	#endif
 2294 	/* LDV_COMMENT_END_PREP */
 2295 	/* content: static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)*/
 2296 	/* LDV_COMMENT_BEGIN_PREP */
 2297 	#define DRIVER_AUTHOR					\
 2298 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2299 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2300 	#define DRIVER_NAME "usbvision"
 2301 	#define DRIVER_ALIAS "USBVision"
 2302 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2303 	#define DRIVER_LICENSE "GPL"
 2304 	#define USBVISION_VERSION_STRING "0.9.11"
 2305 	#define	ENABLE_HEXDUMP	0	
 2306 	#ifdef USBVISION_DEBUG
 2307 	#define PDEBUG(level, fmt, args...) { \
 2308 		if (video_debug & (level)) \
 2309 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2310 				__func__, __LINE__ , ## args); \
 2311 	}
 2312 	#else
 2313 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2314 	#endif
 2315 	#define DBG_IO		(1 << 1)
 2316 	#define DBG_PROBE	(1 << 2)
 2317 	#define DBG_MMAP	(1 << 3)
 2318 	#define rmspace(str)	while (*str == ' ') str++;
 2319 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2320 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2321 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2322 	#endif
 2323 	/* LDV_COMMENT_END_PREP */
 2324 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_std" */
 2325 	void * var_vidioc_g_std_21_p1;
 2326 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_std" */
 2327 	v4l2_std_id * var_vidioc_g_std_21_p2;
 2328 	/* LDV_COMMENT_BEGIN_PREP */
 2329 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2330 	#endif
 2331 	/* LDV_COMMENT_END_PREP */
 2332 	/* content: static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *vi)*/
 2333 	/* LDV_COMMENT_BEGIN_PREP */
 2334 	#define DRIVER_AUTHOR					\
 2335 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2336 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2337 	#define DRIVER_NAME "usbvision"
 2338 	#define DRIVER_ALIAS "USBVision"
 2339 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2340 	#define DRIVER_LICENSE "GPL"
 2341 	#define USBVISION_VERSION_STRING "0.9.11"
 2342 	#define	ENABLE_HEXDUMP	0	
 2343 	#ifdef USBVISION_DEBUG
 2344 	#define PDEBUG(level, fmt, args...) { \
 2345 		if (video_debug & (level)) \
 2346 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2347 				__func__, __LINE__ , ## args); \
 2348 	}
 2349 	#else
 2350 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2351 	#endif
 2352 	#define DBG_IO		(1 << 1)
 2353 	#define DBG_PROBE	(1 << 2)
 2354 	#define DBG_MMAP	(1 << 3)
 2355 	#define rmspace(str)	while (*str == ' ') str++;
 2356 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2357 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2358 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2359 	#endif
 2360 	/* LDV_COMMENT_END_PREP */
 2361 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_enum_input" */
 2362 	void * var_vidioc_enum_input_17_p1;
 2363 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_enum_input" */
 2364 	struct v4l2_input * var_vidioc_enum_input_17_p2;
 2365 	/* LDV_COMMENT_BEGIN_PREP */
 2366 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2367 	#endif
 2368 	/* LDV_COMMENT_END_PREP */
 2369 	/* content: static int vidioc_g_input(struct file *file, void *priv, unsigned int *input)*/
 2370 	/* LDV_COMMENT_BEGIN_PREP */
 2371 	#define DRIVER_AUTHOR					\
 2372 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2373 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2374 	#define DRIVER_NAME "usbvision"
 2375 	#define DRIVER_ALIAS "USBVision"
 2376 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2377 	#define DRIVER_LICENSE "GPL"
 2378 	#define USBVISION_VERSION_STRING "0.9.11"
 2379 	#define	ENABLE_HEXDUMP	0	
 2380 	#ifdef USBVISION_DEBUG
 2381 	#define PDEBUG(level, fmt, args...) { \
 2382 		if (video_debug & (level)) \
 2383 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2384 				__func__, __LINE__ , ## args); \
 2385 	}
 2386 	#else
 2387 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2388 	#endif
 2389 	#define DBG_IO		(1 << 1)
 2390 	#define DBG_PROBE	(1 << 2)
 2391 	#define DBG_MMAP	(1 << 3)
 2392 	#define rmspace(str)	while (*str == ' ') str++;
 2393 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2394 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2395 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2396 	#endif
 2397 	/* LDV_COMMENT_END_PREP */
 2398 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_input" */
 2399 	void * var_vidioc_g_input_18_p1;
 2400 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_input" */
 2401 	unsigned int * var_vidioc_g_input_18_p2;
 2402 	/* LDV_COMMENT_BEGIN_PREP */
 2403 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2404 	#endif
 2405 	/* LDV_COMMENT_END_PREP */
 2406 	/* content: static int vidioc_s_input(struct file *file, void *priv, unsigned int input)*/
 2407 	/* LDV_COMMENT_BEGIN_PREP */
 2408 	#define DRIVER_AUTHOR					\
 2409 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2410 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2411 	#define DRIVER_NAME "usbvision"
 2412 	#define DRIVER_ALIAS "USBVision"
 2413 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2414 	#define DRIVER_LICENSE "GPL"
 2415 	#define USBVISION_VERSION_STRING "0.9.11"
 2416 	#define	ENABLE_HEXDUMP	0	
 2417 	#ifdef USBVISION_DEBUG
 2418 	#define PDEBUG(level, fmt, args...) { \
 2419 		if (video_debug & (level)) \
 2420 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2421 				__func__, __LINE__ , ## args); \
 2422 	}
 2423 	#else
 2424 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2425 	#endif
 2426 	#define DBG_IO		(1 << 1)
 2427 	#define DBG_PROBE	(1 << 2)
 2428 	#define DBG_MMAP	(1 << 3)
 2429 	#define rmspace(str)	while (*str == ' ') str++;
 2430 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2431 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2432 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2433 	#endif
 2434 	/* LDV_COMMENT_END_PREP */
 2435 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_input" */
 2436 	void * var_vidioc_s_input_19_p1;
 2437 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_input" */
 2438 	unsigned int  var_vidioc_s_input_19_p2;
 2439 	/* LDV_COMMENT_BEGIN_PREP */
 2440 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2441 	#endif
 2442 	/* LDV_COMMENT_END_PREP */
 2443 	/* content: static int vidioc_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *ctrl)*/
 2444 	/* LDV_COMMENT_BEGIN_PREP */
 2445 	#define DRIVER_AUTHOR					\
 2446 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2447 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2448 	#define DRIVER_NAME "usbvision"
 2449 	#define DRIVER_ALIAS "USBVision"
 2450 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2451 	#define DRIVER_LICENSE "GPL"
 2452 	#define USBVISION_VERSION_STRING "0.9.11"
 2453 	#define	ENABLE_HEXDUMP	0	
 2454 	#ifdef USBVISION_DEBUG
 2455 	#define PDEBUG(level, fmt, args...) { \
 2456 		if (video_debug & (level)) \
 2457 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2458 				__func__, __LINE__ , ## args); \
 2459 	}
 2460 	#else
 2461 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2462 	#endif
 2463 	#define DBG_IO		(1 << 1)
 2464 	#define DBG_PROBE	(1 << 2)
 2465 	#define DBG_MMAP	(1 << 3)
 2466 	#define rmspace(str)	while (*str == ' ') str++;
 2467 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2468 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2469 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2470 	#endif
 2471 	/* LDV_COMMENT_END_PREP */
 2472 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_queryctrl" */
 2473 	void * var_vidioc_queryctrl_28_p1;
 2474 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_queryctrl" */
 2475 	struct v4l2_queryctrl * var_vidioc_queryctrl_28_p2;
 2476 	/* LDV_COMMENT_BEGIN_PREP */
 2477 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2478 	#endif
 2479 	/* LDV_COMMENT_END_PREP */
 2480 	/* content: static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)*/
 2481 	/* LDV_COMMENT_BEGIN_PREP */
 2482 	#define DRIVER_AUTHOR					\
 2483 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2484 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2485 	#define DRIVER_NAME "usbvision"
 2486 	#define DRIVER_ALIAS "USBVision"
 2487 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2488 	#define DRIVER_LICENSE "GPL"
 2489 	#define USBVISION_VERSION_STRING "0.9.11"
 2490 	#define	ENABLE_HEXDUMP	0	
 2491 	#ifdef USBVISION_DEBUG
 2492 	#define PDEBUG(level, fmt, args...) { \
 2493 		if (video_debug & (level)) \
 2494 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2495 				__func__, __LINE__ , ## args); \
 2496 	}
 2497 	#else
 2498 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2499 	#endif
 2500 	#define DBG_IO		(1 << 1)
 2501 	#define DBG_PROBE	(1 << 2)
 2502 	#define DBG_MMAP	(1 << 3)
 2503 	#define rmspace(str)	while (*str == ' ') str++;
 2504 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2505 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2506 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2507 	#endif
 2508 	/* LDV_COMMENT_END_PREP */
 2509 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_audio" */
 2510 	void * var_vidioc_g_audio_26_p1;
 2511 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_audio" */
 2512 	struct v4l2_audio * var_vidioc_g_audio_26_p2;
 2513 	/* LDV_COMMENT_BEGIN_PREP */
 2514 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2515 	#endif
 2516 	/* LDV_COMMENT_END_PREP */
 2517 	/* content: static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)*/
 2518 	/* LDV_COMMENT_BEGIN_PREP */
 2519 	#define DRIVER_AUTHOR					\
 2520 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2521 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2522 	#define DRIVER_NAME "usbvision"
 2523 	#define DRIVER_ALIAS "USBVision"
 2524 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2525 	#define DRIVER_LICENSE "GPL"
 2526 	#define USBVISION_VERSION_STRING "0.9.11"
 2527 	#define	ENABLE_HEXDUMP	0	
 2528 	#ifdef USBVISION_DEBUG
 2529 	#define PDEBUG(level, fmt, args...) { \
 2530 		if (video_debug & (level)) \
 2531 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2532 				__func__, __LINE__ , ## args); \
 2533 	}
 2534 	#else
 2535 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2536 	#endif
 2537 	#define DBG_IO		(1 << 1)
 2538 	#define DBG_PROBE	(1 << 2)
 2539 	#define DBG_MMAP	(1 << 3)
 2540 	#define rmspace(str)	while (*str == ' ') str++;
 2541 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2542 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2543 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2544 	#endif
 2545 	/* LDV_COMMENT_END_PREP */
 2546 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_audio" */
 2547 	void * var_vidioc_s_audio_27_p1;
 2548 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_audio" */
 2549 	const struct v4l2_audio * var_vidioc_s_audio_27_p2;
 2550 	/* LDV_COMMENT_BEGIN_PREP */
 2551 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2552 	#endif
 2553 	/* LDV_COMMENT_END_PREP */
 2554 	/* content: static int vidioc_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 2555 	/* LDV_COMMENT_BEGIN_PREP */
 2556 	#define DRIVER_AUTHOR					\
 2557 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2558 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2559 	#define DRIVER_NAME "usbvision"
 2560 	#define DRIVER_ALIAS "USBVision"
 2561 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2562 	#define DRIVER_LICENSE "GPL"
 2563 	#define USBVISION_VERSION_STRING "0.9.11"
 2564 	#define	ENABLE_HEXDUMP	0	
 2565 	#ifdef USBVISION_DEBUG
 2566 	#define PDEBUG(level, fmt, args...) { \
 2567 		if (video_debug & (level)) \
 2568 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2569 				__func__, __LINE__ , ## args); \
 2570 	}
 2571 	#else
 2572 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2573 	#endif
 2574 	#define DBG_IO		(1 << 1)
 2575 	#define DBG_PROBE	(1 << 2)
 2576 	#define DBG_MMAP	(1 << 3)
 2577 	#define rmspace(str)	while (*str == ' ') str++;
 2578 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2579 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2580 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2581 	#endif
 2582 	/* LDV_COMMENT_END_PREP */
 2583 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_ctrl" */
 2584 	void * var_vidioc_g_ctrl_29_p1;
 2585 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_ctrl" */
 2586 	struct v4l2_control * var_vidioc_g_ctrl_29_p2;
 2587 	/* LDV_COMMENT_BEGIN_PREP */
 2588 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2589 	#endif
 2590 	/* LDV_COMMENT_END_PREP */
 2591 	/* content: static int vidioc_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 2592 	/* LDV_COMMENT_BEGIN_PREP */
 2593 	#define DRIVER_AUTHOR					\
 2594 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2595 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2596 	#define DRIVER_NAME "usbvision"
 2597 	#define DRIVER_ALIAS "USBVision"
 2598 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2599 	#define DRIVER_LICENSE "GPL"
 2600 	#define USBVISION_VERSION_STRING "0.9.11"
 2601 	#define	ENABLE_HEXDUMP	0	
 2602 	#ifdef USBVISION_DEBUG
 2603 	#define PDEBUG(level, fmt, args...) { \
 2604 		if (video_debug & (level)) \
 2605 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2606 				__func__, __LINE__ , ## args); \
 2607 	}
 2608 	#else
 2609 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2610 	#endif
 2611 	#define DBG_IO		(1 << 1)
 2612 	#define DBG_PROBE	(1 << 2)
 2613 	#define DBG_MMAP	(1 << 3)
 2614 	#define rmspace(str)	while (*str == ' ') str++;
 2615 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2616 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2617 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2618 	#endif
 2619 	/* LDV_COMMENT_END_PREP */
 2620 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_ctrl" */
 2621 	void * var_vidioc_s_ctrl_30_p1;
 2622 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_ctrl" */
 2623 	struct v4l2_control * var_vidioc_s_ctrl_30_p2;
 2624 	/* LDV_COMMENT_BEGIN_PREP */
 2625 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2626 	#endif
 2627 	/* LDV_COMMENT_END_PREP */
 2628 	/* content: static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)*/
 2629 	/* LDV_COMMENT_BEGIN_PREP */
 2630 	#define DRIVER_AUTHOR					\
 2631 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2632 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2633 	#define DRIVER_NAME "usbvision"
 2634 	#define DRIVER_ALIAS "USBVision"
 2635 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2636 	#define DRIVER_LICENSE "GPL"
 2637 	#define USBVISION_VERSION_STRING "0.9.11"
 2638 	#define	ENABLE_HEXDUMP	0	
 2639 	#ifdef USBVISION_DEBUG
 2640 	#define PDEBUG(level, fmt, args...) { \
 2641 		if (video_debug & (level)) \
 2642 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2643 				__func__, __LINE__ , ## args); \
 2644 	}
 2645 	#else
 2646 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2647 	#endif
 2648 	#define DBG_IO		(1 << 1)
 2649 	#define DBG_PROBE	(1 << 2)
 2650 	#define DBG_MMAP	(1 << 3)
 2651 	#define rmspace(str)	while (*str == ' ') str++;
 2652 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2653 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2654 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2655 	#endif
 2656 	/* LDV_COMMENT_END_PREP */
 2657 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_streamon" */
 2658 	void * var_vidioc_streamon_35_p1;
 2659 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_streamon" */
 2660 	enum v4l2_buf_type  var_vidioc_streamon_35_p2;
 2661 	/* LDV_COMMENT_BEGIN_PREP */
 2662 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2663 	#endif
 2664 	/* LDV_COMMENT_END_PREP */
 2665 	/* content: static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type type)*/
 2666 	/* LDV_COMMENT_BEGIN_PREP */
 2667 	#define DRIVER_AUTHOR					\
 2668 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2669 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2670 	#define DRIVER_NAME "usbvision"
 2671 	#define DRIVER_ALIAS "USBVision"
 2672 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2673 	#define DRIVER_LICENSE "GPL"
 2674 	#define USBVISION_VERSION_STRING "0.9.11"
 2675 	#define	ENABLE_HEXDUMP	0	
 2676 	#ifdef USBVISION_DEBUG
 2677 	#define PDEBUG(level, fmt, args...) { \
 2678 		if (video_debug & (level)) \
 2679 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2680 				__func__, __LINE__ , ## args); \
 2681 	}
 2682 	#else
 2683 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2684 	#endif
 2685 	#define DBG_IO		(1 << 1)
 2686 	#define DBG_PROBE	(1 << 2)
 2687 	#define DBG_MMAP	(1 << 3)
 2688 	#define rmspace(str)	while (*str == ' ') str++;
 2689 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2690 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2691 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2692 	#endif
 2693 	/* LDV_COMMENT_END_PREP */
 2694 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_streamoff" */
 2695 	void * var_vidioc_streamoff_36_p1;
 2696 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_streamoff" */
 2697 	enum v4l2_buf_type  var_vidioc_streamoff_36_p2;
 2698 	/* LDV_COMMENT_BEGIN_PREP */
 2699 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2700 	#endif
 2701 	/* LDV_COMMENT_END_PREP */
 2702 	/* content: static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)*/
 2703 	/* LDV_COMMENT_BEGIN_PREP */
 2704 	#define DRIVER_AUTHOR					\
 2705 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2706 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2707 	#define DRIVER_NAME "usbvision"
 2708 	#define DRIVER_ALIAS "USBVision"
 2709 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2710 	#define DRIVER_LICENSE "GPL"
 2711 	#define USBVISION_VERSION_STRING "0.9.11"
 2712 	#define	ENABLE_HEXDUMP	0	
 2713 	#ifdef USBVISION_DEBUG
 2714 	#define PDEBUG(level, fmt, args...) { \
 2715 		if (video_debug & (level)) \
 2716 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2717 				__func__, __LINE__ , ## args); \
 2718 	}
 2719 	#else
 2720 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2721 	#endif
 2722 	#define DBG_IO		(1 << 1)
 2723 	#define DBG_PROBE	(1 << 2)
 2724 	#define DBG_MMAP	(1 << 3)
 2725 	#define rmspace(str)	while (*str == ' ') str++;
 2726 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2727 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2728 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2729 	#endif
 2730 	/* LDV_COMMENT_END_PREP */
 2731 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_tuner" */
 2732 	void * var_vidioc_g_tuner_22_p1;
 2733 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_tuner" */
 2734 	struct v4l2_tuner * var_vidioc_g_tuner_22_p2;
 2735 	/* LDV_COMMENT_BEGIN_PREP */
 2736 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2737 	#endif
 2738 	/* LDV_COMMENT_END_PREP */
 2739 	/* content: static int vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *vt)*/
 2740 	/* LDV_COMMENT_BEGIN_PREP */
 2741 	#define DRIVER_AUTHOR					\
 2742 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2743 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2744 	#define DRIVER_NAME "usbvision"
 2745 	#define DRIVER_ALIAS "USBVision"
 2746 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2747 	#define DRIVER_LICENSE "GPL"
 2748 	#define USBVISION_VERSION_STRING "0.9.11"
 2749 	#define	ENABLE_HEXDUMP	0	
 2750 	#ifdef USBVISION_DEBUG
 2751 	#define PDEBUG(level, fmt, args...) { \
 2752 		if (video_debug & (level)) \
 2753 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2754 				__func__, __LINE__ , ## args); \
 2755 	}
 2756 	#else
 2757 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2758 	#endif
 2759 	#define DBG_IO		(1 << 1)
 2760 	#define DBG_PROBE	(1 << 2)
 2761 	#define DBG_MMAP	(1 << 3)
 2762 	#define rmspace(str)	while (*str == ' ') str++;
 2763 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2764 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2765 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2766 	#endif
 2767 	/* LDV_COMMENT_END_PREP */
 2768 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_tuner" */
 2769 	void * var_vidioc_s_tuner_23_p1;
 2770 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_tuner" */
 2771 	const struct v4l2_tuner * var_vidioc_s_tuner_23_p2;
 2772 	/* LDV_COMMENT_BEGIN_PREP */
 2773 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2774 	#endif
 2775 	/* LDV_COMMENT_END_PREP */
 2776 	/* content: static int vidioc_g_frequency(struct file *file, void *priv, struct v4l2_frequency *freq)*/
 2777 	/* LDV_COMMENT_BEGIN_PREP */
 2778 	#define DRIVER_AUTHOR					\
 2779 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2780 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2781 	#define DRIVER_NAME "usbvision"
 2782 	#define DRIVER_ALIAS "USBVision"
 2783 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2784 	#define DRIVER_LICENSE "GPL"
 2785 	#define USBVISION_VERSION_STRING "0.9.11"
 2786 	#define	ENABLE_HEXDUMP	0	
 2787 	#ifdef USBVISION_DEBUG
 2788 	#define PDEBUG(level, fmt, args...) { \
 2789 		if (video_debug & (level)) \
 2790 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2791 				__func__, __LINE__ , ## args); \
 2792 	}
 2793 	#else
 2794 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2795 	#endif
 2796 	#define DBG_IO		(1 << 1)
 2797 	#define DBG_PROBE	(1 << 2)
 2798 	#define DBG_MMAP	(1 << 3)
 2799 	#define rmspace(str)	while (*str == ' ') str++;
 2800 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2801 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2802 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2803 	#endif
 2804 	/* LDV_COMMENT_END_PREP */
 2805 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_frequency" */
 2806 	void * var_vidioc_g_frequency_24_p1;
 2807 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_frequency" */
 2808 	struct v4l2_frequency * var_vidioc_g_frequency_24_p2;
 2809 	/* LDV_COMMENT_BEGIN_PREP */
 2810 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2811 	#endif
 2812 	/* LDV_COMMENT_END_PREP */
 2813 	/* content: static int vidioc_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *freq)*/
 2814 	/* LDV_COMMENT_BEGIN_PREP */
 2815 	#define DRIVER_AUTHOR					\
 2816 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2817 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2818 	#define DRIVER_NAME "usbvision"
 2819 	#define DRIVER_ALIAS "USBVision"
 2820 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2821 	#define DRIVER_LICENSE "GPL"
 2822 	#define USBVISION_VERSION_STRING "0.9.11"
 2823 	#define	ENABLE_HEXDUMP	0	
 2824 	#ifdef USBVISION_DEBUG
 2825 	#define PDEBUG(level, fmt, args...) { \
 2826 		if (video_debug & (level)) \
 2827 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2828 				__func__, __LINE__ , ## args); \
 2829 	}
 2830 	#else
 2831 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2832 	#endif
 2833 	#define DBG_IO		(1 << 1)
 2834 	#define DBG_PROBE	(1 << 2)
 2835 	#define DBG_MMAP	(1 << 3)
 2836 	#define rmspace(str)	while (*str == ' ') str++;
 2837 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2838 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2839 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2840 	#endif
 2841 	/* LDV_COMMENT_END_PREP */
 2842 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_frequency" */
 2843 	void * var_vidioc_s_frequency_25_p1;
 2844 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_frequency" */
 2845 	const struct v4l2_frequency * var_vidioc_s_frequency_25_p2;
 2846 	/* LDV_COMMENT_BEGIN_PREP */
 2847 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2848 	#endif
 2849 	/* LDV_COMMENT_END_PREP */
 2850 	/* content: static int vidioc_g_register(struct file *file, void *priv, struct v4l2_dbg_register *reg)*/
 2851 	/* LDV_COMMENT_BEGIN_PREP */
 2852 	#define DRIVER_AUTHOR					\
 2853 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2854 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2855 	#define DRIVER_NAME "usbvision"
 2856 	#define DRIVER_ALIAS "USBVision"
 2857 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2858 	#define DRIVER_LICENSE "GPL"
 2859 	#define USBVISION_VERSION_STRING "0.9.11"
 2860 	#define	ENABLE_HEXDUMP	0	
 2861 	#ifdef USBVISION_DEBUG
 2862 	#define PDEBUG(level, fmt, args...) { \
 2863 		if (video_debug & (level)) \
 2864 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2865 				__func__, __LINE__ , ## args); \
 2866 	}
 2867 	#else
 2868 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2869 	#endif
 2870 	#define DBG_IO		(1 << 1)
 2871 	#define DBG_PROBE	(1 << 2)
 2872 	#define DBG_MMAP	(1 << 3)
 2873 	#define rmspace(str)	while (*str == ' ') str++;
 2874 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2875 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2876 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2877 	/* LDV_COMMENT_END_PREP */
 2878 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_register" */
 2879 	void * var_vidioc_g_register_14_p1;
 2880 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_g_register" */
 2881 	struct v4l2_dbg_register * var_vidioc_g_register_14_p2;
 2882 	/* LDV_COMMENT_BEGIN_PREP */
 2883 	#endif
 2884 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2885 	#endif
 2886 	/* LDV_COMMENT_END_PREP */
 2887 	/* content: static int vidioc_s_register(struct file *file, void *priv, const struct v4l2_dbg_register *reg)*/
 2888 	/* LDV_COMMENT_BEGIN_PREP */
 2889 	#define DRIVER_AUTHOR					\
 2890 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2891 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2892 	#define DRIVER_NAME "usbvision"
 2893 	#define DRIVER_ALIAS "USBVision"
 2894 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2895 	#define DRIVER_LICENSE "GPL"
 2896 	#define USBVISION_VERSION_STRING "0.9.11"
 2897 	#define	ENABLE_HEXDUMP	0	
 2898 	#ifdef USBVISION_DEBUG
 2899 	#define PDEBUG(level, fmt, args...) { \
 2900 		if (video_debug & (level)) \
 2901 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2902 				__func__, __LINE__ , ## args); \
 2903 	}
 2904 	#else
 2905 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2906 	#endif
 2907 	#define DBG_IO		(1 << 1)
 2908 	#define DBG_PROBE	(1 << 2)
 2909 	#define DBG_MMAP	(1 << 3)
 2910 	#define rmspace(str)	while (*str == ' ') str++;
 2911 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2912 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2913 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2914 	/* LDV_COMMENT_END_PREP */
 2915 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_register" */
 2916 	void * var_vidioc_s_register_15_p1;
 2917 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "vidioc_s_register" */
 2918 	const struct v4l2_dbg_register * var_vidioc_s_register_15_p2;
 2919 	/* LDV_COMMENT_BEGIN_PREP */
 2920 	#endif
 2921 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2922 	#endif
 2923 	/* LDV_COMMENT_END_PREP */
 2924 
 2925 	/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_radio_fops **/
 2926 	/* content: static int usbvision_radio_open(struct file *file)*/
 2927 	/* LDV_COMMENT_BEGIN_PREP */
 2928 	#define DRIVER_AUTHOR					\
 2929 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2930 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2931 	#define DRIVER_NAME "usbvision"
 2932 	#define DRIVER_ALIAS "USBVision"
 2933 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2934 	#define DRIVER_LICENSE "GPL"
 2935 	#define USBVISION_VERSION_STRING "0.9.11"
 2936 	#define	ENABLE_HEXDUMP	0	
 2937 	#ifdef USBVISION_DEBUG
 2938 	#define PDEBUG(level, fmt, args...) { \
 2939 		if (video_debug & (level)) \
 2940 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2941 				__func__, __LINE__ , ## args); \
 2942 	}
 2943 	#else
 2944 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2945 	#endif
 2946 	#define DBG_IO		(1 << 1)
 2947 	#define DBG_PROBE	(1 << 2)
 2948 	#define DBG_MMAP	(1 << 3)
 2949 	#define rmspace(str)	while (*str == ' ') str++;
 2950 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2951 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2952 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2953 	#endif
 2954 	/* LDV_COMMENT_END_PREP */
 2955 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "usbvision_radio_open" */
 2956 	static int res_usbvision_radio_open_45;
 2957 	/* LDV_COMMENT_BEGIN_PREP */
 2958 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2959 	#endif
 2960 	/* LDV_COMMENT_END_PREP */
 2961 	/* content: static int usbvision_radio_close(struct file *file)*/
 2962 	/* LDV_COMMENT_BEGIN_PREP */
 2963 	#define DRIVER_AUTHOR					\
 2964 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 2965 	"Dwaine Garden <DwaineGarden@rogers.com>"
 2966 	#define DRIVER_NAME "usbvision"
 2967 	#define DRIVER_ALIAS "USBVision"
 2968 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 2969 	#define DRIVER_LICENSE "GPL"
 2970 	#define USBVISION_VERSION_STRING "0.9.11"
 2971 	#define	ENABLE_HEXDUMP	0	
 2972 	#ifdef USBVISION_DEBUG
 2973 	#define PDEBUG(level, fmt, args...) { \
 2974 		if (video_debug & (level)) \
 2975 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 2976 				__func__, __LINE__ , ## args); \
 2977 	}
 2978 	#else
 2979 	#define PDEBUG(level, fmt, args...) do {} while (0)
 2980 	#endif
 2981 	#define DBG_IO		(1 << 1)
 2982 	#define DBG_PROBE	(1 << 2)
 2983 	#define DBG_MMAP	(1 << 3)
 2984 	#define rmspace(str)	while (*str == ' ') str++;
 2985 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 2986 	#define YES_NO(x) ((x) ? "Yes" : "No")
 2987 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2988 	#endif
 2989 	/* LDV_COMMENT_END_PREP */
 2990 	/* LDV_COMMENT_BEGIN_PREP */
 2991 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 2992 	#endif
 2993 	/* LDV_COMMENT_END_PREP */
 2994 
 2995 	/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 2996 	/* content: static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *vc)*/
 2997 	/* LDV_COMMENT_BEGIN_PREP */
 2998 	#define DRIVER_AUTHOR					\
 2999 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3000 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3001 	#define DRIVER_NAME "usbvision"
 3002 	#define DRIVER_ALIAS "USBVision"
 3003 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3004 	#define DRIVER_LICENSE "GPL"
 3005 	#define USBVISION_VERSION_STRING "0.9.11"
 3006 	#define	ENABLE_HEXDUMP	0	
 3007 	#ifdef USBVISION_DEBUG
 3008 	#define PDEBUG(level, fmt, args...) { \
 3009 		if (video_debug & (level)) \
 3010 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3011 				__func__, __LINE__ , ## args); \
 3012 	}
 3013 	#else
 3014 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3015 	#endif
 3016 	#define DBG_IO		(1 << 1)
 3017 	#define DBG_PROBE	(1 << 2)
 3018 	#define DBG_MMAP	(1 << 3)
 3019 	#define rmspace(str)	while (*str == ' ') str++;
 3020 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3021 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3022 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3023 	#endif
 3024 	/* LDV_COMMENT_END_PREP */
 3025 	/* LDV_COMMENT_BEGIN_PREP */
 3026 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3027 	#endif
 3028 	/* LDV_COMMENT_END_PREP */
 3029 	/* content: static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *vi)*/
 3030 	/* LDV_COMMENT_BEGIN_PREP */
 3031 	#define DRIVER_AUTHOR					\
 3032 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3033 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3034 	#define DRIVER_NAME "usbvision"
 3035 	#define DRIVER_ALIAS "USBVision"
 3036 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3037 	#define DRIVER_LICENSE "GPL"
 3038 	#define USBVISION_VERSION_STRING "0.9.11"
 3039 	#define	ENABLE_HEXDUMP	0	
 3040 	#ifdef USBVISION_DEBUG
 3041 	#define PDEBUG(level, fmt, args...) { \
 3042 		if (video_debug & (level)) \
 3043 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3044 				__func__, __LINE__ , ## args); \
 3045 	}
 3046 	#else
 3047 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3048 	#endif
 3049 	#define DBG_IO		(1 << 1)
 3050 	#define DBG_PROBE	(1 << 2)
 3051 	#define DBG_MMAP	(1 << 3)
 3052 	#define rmspace(str)	while (*str == ' ') str++;
 3053 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3054 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3055 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3056 	#endif
 3057 	/* LDV_COMMENT_END_PREP */
 3058 	/* LDV_COMMENT_BEGIN_PREP */
 3059 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3060 	#endif
 3061 	/* LDV_COMMENT_END_PREP */
 3062 	/* content: static int vidioc_g_input(struct file *file, void *priv, unsigned int *input)*/
 3063 	/* LDV_COMMENT_BEGIN_PREP */
 3064 	#define DRIVER_AUTHOR					\
 3065 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3066 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3067 	#define DRIVER_NAME "usbvision"
 3068 	#define DRIVER_ALIAS "USBVision"
 3069 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3070 	#define DRIVER_LICENSE "GPL"
 3071 	#define USBVISION_VERSION_STRING "0.9.11"
 3072 	#define	ENABLE_HEXDUMP	0	
 3073 	#ifdef USBVISION_DEBUG
 3074 	#define PDEBUG(level, fmt, args...) { \
 3075 		if (video_debug & (level)) \
 3076 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3077 				__func__, __LINE__ , ## args); \
 3078 	}
 3079 	#else
 3080 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3081 	#endif
 3082 	#define DBG_IO		(1 << 1)
 3083 	#define DBG_PROBE	(1 << 2)
 3084 	#define DBG_MMAP	(1 << 3)
 3085 	#define rmspace(str)	while (*str == ' ') str++;
 3086 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3087 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3088 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3089 	#endif
 3090 	/* LDV_COMMENT_END_PREP */
 3091 	/* LDV_COMMENT_BEGIN_PREP */
 3092 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3093 	#endif
 3094 	/* LDV_COMMENT_END_PREP */
 3095 	/* content: static int vidioc_s_input(struct file *file, void *priv, unsigned int input)*/
 3096 	/* LDV_COMMENT_BEGIN_PREP */
 3097 	#define DRIVER_AUTHOR					\
 3098 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3099 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3100 	#define DRIVER_NAME "usbvision"
 3101 	#define DRIVER_ALIAS "USBVision"
 3102 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3103 	#define DRIVER_LICENSE "GPL"
 3104 	#define USBVISION_VERSION_STRING "0.9.11"
 3105 	#define	ENABLE_HEXDUMP	0	
 3106 	#ifdef USBVISION_DEBUG
 3107 	#define PDEBUG(level, fmt, args...) { \
 3108 		if (video_debug & (level)) \
 3109 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3110 				__func__, __LINE__ , ## args); \
 3111 	}
 3112 	#else
 3113 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3114 	#endif
 3115 	#define DBG_IO		(1 << 1)
 3116 	#define DBG_PROBE	(1 << 2)
 3117 	#define DBG_MMAP	(1 << 3)
 3118 	#define rmspace(str)	while (*str == ' ') str++;
 3119 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3120 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3121 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3122 	#endif
 3123 	/* LDV_COMMENT_END_PREP */
 3124 	/* LDV_COMMENT_BEGIN_PREP */
 3125 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3126 	#endif
 3127 	/* LDV_COMMENT_END_PREP */
 3128 	/* content: static int vidioc_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *ctrl)*/
 3129 	/* LDV_COMMENT_BEGIN_PREP */
 3130 	#define DRIVER_AUTHOR					\
 3131 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3132 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3133 	#define DRIVER_NAME "usbvision"
 3134 	#define DRIVER_ALIAS "USBVision"
 3135 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3136 	#define DRIVER_LICENSE "GPL"
 3137 	#define USBVISION_VERSION_STRING "0.9.11"
 3138 	#define	ENABLE_HEXDUMP	0	
 3139 	#ifdef USBVISION_DEBUG
 3140 	#define PDEBUG(level, fmt, args...) { \
 3141 		if (video_debug & (level)) \
 3142 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3143 				__func__, __LINE__ , ## args); \
 3144 	}
 3145 	#else
 3146 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3147 	#endif
 3148 	#define DBG_IO		(1 << 1)
 3149 	#define DBG_PROBE	(1 << 2)
 3150 	#define DBG_MMAP	(1 << 3)
 3151 	#define rmspace(str)	while (*str == ' ') str++;
 3152 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3153 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3154 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3155 	#endif
 3156 	/* LDV_COMMENT_END_PREP */
 3157 	/* LDV_COMMENT_BEGIN_PREP */
 3158 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3159 	#endif
 3160 	/* LDV_COMMENT_END_PREP */
 3161 	/* content: static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)*/
 3162 	/* LDV_COMMENT_BEGIN_PREP */
 3163 	#define DRIVER_AUTHOR					\
 3164 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3165 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3166 	#define DRIVER_NAME "usbvision"
 3167 	#define DRIVER_ALIAS "USBVision"
 3168 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3169 	#define DRIVER_LICENSE "GPL"
 3170 	#define USBVISION_VERSION_STRING "0.9.11"
 3171 	#define	ENABLE_HEXDUMP	0	
 3172 	#ifdef USBVISION_DEBUG
 3173 	#define PDEBUG(level, fmt, args...) { \
 3174 		if (video_debug & (level)) \
 3175 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3176 				__func__, __LINE__ , ## args); \
 3177 	}
 3178 	#else
 3179 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3180 	#endif
 3181 	#define DBG_IO		(1 << 1)
 3182 	#define DBG_PROBE	(1 << 2)
 3183 	#define DBG_MMAP	(1 << 3)
 3184 	#define rmspace(str)	while (*str == ' ') str++;
 3185 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3186 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3187 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3188 	#endif
 3189 	/* LDV_COMMENT_END_PREP */
 3190 	/* LDV_COMMENT_BEGIN_PREP */
 3191 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3192 	#endif
 3193 	/* LDV_COMMENT_END_PREP */
 3194 	/* content: static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)*/
 3195 	/* LDV_COMMENT_BEGIN_PREP */
 3196 	#define DRIVER_AUTHOR					\
 3197 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3198 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3199 	#define DRIVER_NAME "usbvision"
 3200 	#define DRIVER_ALIAS "USBVision"
 3201 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3202 	#define DRIVER_LICENSE "GPL"
 3203 	#define USBVISION_VERSION_STRING "0.9.11"
 3204 	#define	ENABLE_HEXDUMP	0	
 3205 	#ifdef USBVISION_DEBUG
 3206 	#define PDEBUG(level, fmt, args...) { \
 3207 		if (video_debug & (level)) \
 3208 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3209 				__func__, __LINE__ , ## args); \
 3210 	}
 3211 	#else
 3212 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3213 	#endif
 3214 	#define DBG_IO		(1 << 1)
 3215 	#define DBG_PROBE	(1 << 2)
 3216 	#define DBG_MMAP	(1 << 3)
 3217 	#define rmspace(str)	while (*str == ' ') str++;
 3218 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3219 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3220 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3221 	#endif
 3222 	/* LDV_COMMENT_END_PREP */
 3223 	/* LDV_COMMENT_BEGIN_PREP */
 3224 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3225 	#endif
 3226 	/* LDV_COMMENT_END_PREP */
 3227 	/* content: static int vidioc_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 3228 	/* LDV_COMMENT_BEGIN_PREP */
 3229 	#define DRIVER_AUTHOR					\
 3230 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3231 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3232 	#define DRIVER_NAME "usbvision"
 3233 	#define DRIVER_ALIAS "USBVision"
 3234 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3235 	#define DRIVER_LICENSE "GPL"
 3236 	#define USBVISION_VERSION_STRING "0.9.11"
 3237 	#define	ENABLE_HEXDUMP	0	
 3238 	#ifdef USBVISION_DEBUG
 3239 	#define PDEBUG(level, fmt, args...) { \
 3240 		if (video_debug & (level)) \
 3241 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3242 				__func__, __LINE__ , ## args); \
 3243 	}
 3244 	#else
 3245 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3246 	#endif
 3247 	#define DBG_IO		(1 << 1)
 3248 	#define DBG_PROBE	(1 << 2)
 3249 	#define DBG_MMAP	(1 << 3)
 3250 	#define rmspace(str)	while (*str == ' ') str++;
 3251 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3252 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3253 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3254 	#endif
 3255 	/* LDV_COMMENT_END_PREP */
 3256 	/* LDV_COMMENT_BEGIN_PREP */
 3257 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3258 	#endif
 3259 	/* LDV_COMMENT_END_PREP */
 3260 	/* content: static int vidioc_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 3261 	/* LDV_COMMENT_BEGIN_PREP */
 3262 	#define DRIVER_AUTHOR					\
 3263 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3264 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3265 	#define DRIVER_NAME "usbvision"
 3266 	#define DRIVER_ALIAS "USBVision"
 3267 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3268 	#define DRIVER_LICENSE "GPL"
 3269 	#define USBVISION_VERSION_STRING "0.9.11"
 3270 	#define	ENABLE_HEXDUMP	0	
 3271 	#ifdef USBVISION_DEBUG
 3272 	#define PDEBUG(level, fmt, args...) { \
 3273 		if (video_debug & (level)) \
 3274 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3275 				__func__, __LINE__ , ## args); \
 3276 	}
 3277 	#else
 3278 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3279 	#endif
 3280 	#define DBG_IO		(1 << 1)
 3281 	#define DBG_PROBE	(1 << 2)
 3282 	#define DBG_MMAP	(1 << 3)
 3283 	#define rmspace(str)	while (*str == ' ') str++;
 3284 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3285 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3286 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3287 	#endif
 3288 	/* LDV_COMMENT_END_PREP */
 3289 	/* LDV_COMMENT_BEGIN_PREP */
 3290 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3291 	#endif
 3292 	/* LDV_COMMENT_END_PREP */
 3293 	/* content: static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)*/
 3294 	/* LDV_COMMENT_BEGIN_PREP */
 3295 	#define DRIVER_AUTHOR					\
 3296 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3297 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3298 	#define DRIVER_NAME "usbvision"
 3299 	#define DRIVER_ALIAS "USBVision"
 3300 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3301 	#define DRIVER_LICENSE "GPL"
 3302 	#define USBVISION_VERSION_STRING "0.9.11"
 3303 	#define	ENABLE_HEXDUMP	0	
 3304 	#ifdef USBVISION_DEBUG
 3305 	#define PDEBUG(level, fmt, args...) { \
 3306 		if (video_debug & (level)) \
 3307 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3308 				__func__, __LINE__ , ## args); \
 3309 	}
 3310 	#else
 3311 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3312 	#endif
 3313 	#define DBG_IO		(1 << 1)
 3314 	#define DBG_PROBE	(1 << 2)
 3315 	#define DBG_MMAP	(1 << 3)
 3316 	#define rmspace(str)	while (*str == ' ') str++;
 3317 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3318 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3319 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3320 	#endif
 3321 	/* LDV_COMMENT_END_PREP */
 3322 	/* LDV_COMMENT_BEGIN_PREP */
 3323 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3324 	#endif
 3325 	/* LDV_COMMENT_END_PREP */
 3326 	/* content: static int vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *vt)*/
 3327 	/* LDV_COMMENT_BEGIN_PREP */
 3328 	#define DRIVER_AUTHOR					\
 3329 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3330 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3331 	#define DRIVER_NAME "usbvision"
 3332 	#define DRIVER_ALIAS "USBVision"
 3333 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3334 	#define DRIVER_LICENSE "GPL"
 3335 	#define USBVISION_VERSION_STRING "0.9.11"
 3336 	#define	ENABLE_HEXDUMP	0	
 3337 	#ifdef USBVISION_DEBUG
 3338 	#define PDEBUG(level, fmt, args...) { \
 3339 		if (video_debug & (level)) \
 3340 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3341 				__func__, __LINE__ , ## args); \
 3342 	}
 3343 	#else
 3344 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3345 	#endif
 3346 	#define DBG_IO		(1 << 1)
 3347 	#define DBG_PROBE	(1 << 2)
 3348 	#define DBG_MMAP	(1 << 3)
 3349 	#define rmspace(str)	while (*str == ' ') str++;
 3350 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3351 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3352 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3353 	#endif
 3354 	/* LDV_COMMENT_END_PREP */
 3355 	/* LDV_COMMENT_BEGIN_PREP */
 3356 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3357 	#endif
 3358 	/* LDV_COMMENT_END_PREP */
 3359 	/* content: static int vidioc_g_frequency(struct file *file, void *priv, struct v4l2_frequency *freq)*/
 3360 	/* LDV_COMMENT_BEGIN_PREP */
 3361 	#define DRIVER_AUTHOR					\
 3362 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3363 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3364 	#define DRIVER_NAME "usbvision"
 3365 	#define DRIVER_ALIAS "USBVision"
 3366 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3367 	#define DRIVER_LICENSE "GPL"
 3368 	#define USBVISION_VERSION_STRING "0.9.11"
 3369 	#define	ENABLE_HEXDUMP	0	
 3370 	#ifdef USBVISION_DEBUG
 3371 	#define PDEBUG(level, fmt, args...) { \
 3372 		if (video_debug & (level)) \
 3373 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3374 				__func__, __LINE__ , ## args); \
 3375 	}
 3376 	#else
 3377 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3378 	#endif
 3379 	#define DBG_IO		(1 << 1)
 3380 	#define DBG_PROBE	(1 << 2)
 3381 	#define DBG_MMAP	(1 << 3)
 3382 	#define rmspace(str)	while (*str == ' ') str++;
 3383 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3384 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3385 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3386 	#endif
 3387 	/* LDV_COMMENT_END_PREP */
 3388 	/* LDV_COMMENT_BEGIN_PREP */
 3389 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3390 	#endif
 3391 	/* LDV_COMMENT_END_PREP */
 3392 	/* content: static int vidioc_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *freq)*/
 3393 	/* LDV_COMMENT_BEGIN_PREP */
 3394 	#define DRIVER_AUTHOR					\
 3395 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3396 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3397 	#define DRIVER_NAME "usbvision"
 3398 	#define DRIVER_ALIAS "USBVision"
 3399 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3400 	#define DRIVER_LICENSE "GPL"
 3401 	#define USBVISION_VERSION_STRING "0.9.11"
 3402 	#define	ENABLE_HEXDUMP	0	
 3403 	#ifdef USBVISION_DEBUG
 3404 	#define PDEBUG(level, fmt, args...) { \
 3405 		if (video_debug & (level)) \
 3406 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3407 				__func__, __LINE__ , ## args); \
 3408 	}
 3409 	#else
 3410 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3411 	#endif
 3412 	#define DBG_IO		(1 << 1)
 3413 	#define DBG_PROBE	(1 << 2)
 3414 	#define DBG_MMAP	(1 << 3)
 3415 	#define rmspace(str)	while (*str == ' ') str++;
 3416 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3417 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3418 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3419 	#endif
 3420 	/* LDV_COMMENT_END_PREP */
 3421 	/* LDV_COMMENT_BEGIN_PREP */
 3422 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3423 	#endif
 3424 	/* LDV_COMMENT_END_PREP */
 3425 
 3426 	/** STRUCT: struct type: usb_driver, struct name: usbvision_driver **/
 3427 	/* content: static int usbvision_probe(struct usb_interface *intf, const struct usb_device_id *devid)*/
 3428 	/* LDV_COMMENT_BEGIN_PREP */
 3429 	#define DRIVER_AUTHOR					\
 3430 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3431 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3432 	#define DRIVER_NAME "usbvision"
 3433 	#define DRIVER_ALIAS "USBVision"
 3434 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3435 	#define DRIVER_LICENSE "GPL"
 3436 	#define USBVISION_VERSION_STRING "0.9.11"
 3437 	#define	ENABLE_HEXDUMP	0	
 3438 	#ifdef USBVISION_DEBUG
 3439 	#define PDEBUG(level, fmt, args...) { \
 3440 		if (video_debug & (level)) \
 3441 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3442 				__func__, __LINE__ , ## args); \
 3443 	}
 3444 	#else
 3445 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3446 	#endif
 3447 	#define DBG_IO		(1 << 1)
 3448 	#define DBG_PROBE	(1 << 2)
 3449 	#define DBG_MMAP	(1 << 3)
 3450 	#define rmspace(str)	while (*str == ' ') str++;
 3451 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3452 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3453 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3454 	#endif
 3455 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3456 	#endif
 3457 	/* LDV_COMMENT_END_PREP */
 3458 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_probe" */
 3459 	struct usb_interface * var_group3;
 3460 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for function "usbvision_probe" */
 3461 	const struct usb_device_id * var_usbvision_probe_53_p1;
 3462 	/* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "usbvision_probe" */
 3463 	static int res_usbvision_probe_53;
 3464 	/* content: static void usbvision_disconnect(struct usb_interface *intf)*/
 3465 	/* LDV_COMMENT_BEGIN_PREP */
 3466 	#define DRIVER_AUTHOR					\
 3467 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3468 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3469 	#define DRIVER_NAME "usbvision"
 3470 	#define DRIVER_ALIAS "USBVision"
 3471 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3472 	#define DRIVER_LICENSE "GPL"
 3473 	#define USBVISION_VERSION_STRING "0.9.11"
 3474 	#define	ENABLE_HEXDUMP	0	
 3475 	#ifdef USBVISION_DEBUG
 3476 	#define PDEBUG(level, fmt, args...) { \
 3477 		if (video_debug & (level)) \
 3478 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3479 				__func__, __LINE__ , ## args); \
 3480 	}
 3481 	#else
 3482 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3483 	#endif
 3484 	#define DBG_IO		(1 << 1)
 3485 	#define DBG_PROBE	(1 << 2)
 3486 	#define DBG_MMAP	(1 << 3)
 3487 	#define rmspace(str)	while (*str == ' ') str++;
 3488 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3489 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3490 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3491 	#endif
 3492 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3493 	#endif
 3494 	/* LDV_COMMENT_END_PREP */
 3495 
 3496 
 3497 
 3498 
 3499 	/* LDV_COMMENT_END_VARIABLE_DECLARATION_PART */
 3500 	/* LDV_COMMENT_BEGIN_VARIABLE_INITIALIZING_PART */
 3501 	/*============================= VARIABLE INITIALIZING PART  =============================*/
 3502 	LDV_IN_INTERRUPT=1;
 3503 
 3504 
 3505 
 3506 
 3507 	/* LDV_COMMENT_END_VARIABLE_INITIALIZING_PART */
 3508 	/* LDV_COMMENT_BEGIN_FUNCTION_CALL_SECTION */
 3509 	/*============================= FUNCTION CALL SECTION       =============================*/
 3510 	/* LDV_COMMENT_FUNCTION_CALL Initialize LDV model. */
 3511 	ldv_initialize();
 3512 
 3513 	/** INIT: init_type: ST_MODULE_INIT **/
 3514 	/* content: static int __init usbvision_init(void)*/
 3515 	/* LDV_COMMENT_BEGIN_PREP */
 3516 	#define DRIVER_AUTHOR					\
 3517 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3518 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3519 	#define DRIVER_NAME "usbvision"
 3520 	#define DRIVER_ALIAS "USBVision"
 3521 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3522 	#define DRIVER_LICENSE "GPL"
 3523 	#define USBVISION_VERSION_STRING "0.9.11"
 3524 	#define	ENABLE_HEXDUMP	0	
 3525 	#ifdef USBVISION_DEBUG
 3526 	#define PDEBUG(level, fmt, args...) { \
 3527 		if (video_debug & (level)) \
 3528 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3529 				__func__, __LINE__ , ## args); \
 3530 	}
 3531 	#else
 3532 	#define PDEBUG(level, fmt, args...) do {} while (0)
 3533 	#endif
 3534 	#define DBG_IO		(1 << 1)
 3535 	#define DBG_PROBE	(1 << 2)
 3536 	#define DBG_MMAP	(1 << 3)
 3537 	#define rmspace(str)	while (*str == ' ') str++;
 3538 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3539 	#define YES_NO(x) ((x) ? "Yes" : "No")
 3540 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3541 	#endif
 3542 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 3543 	#endif
 3544 	/* LDV_COMMENT_END_PREP */
 3545 	/* LDV_COMMENT_FUNCTION_CALL Kernel calls driver init function after driver loading to kernel. This function declared as "MODULE_INIT(function name)". */
 3546 	ldv_handler_precall();
 3547 	 if(usbvision_init()) 
 3548 		goto ldv_final;
 3549 	int ldv_s_usbvision_fops_v4l2_file_operations = 0;
 3550 	
 3551 
 3552 	
 3553 
 3554 	int ldv_s_usbvision_radio_fops_v4l2_file_operations = 0;
 3555 
 3556 	
 3557 
 3558 	int ldv_s_usbvision_driver_usb_driver = 0;
 3559 
 3560 
 3561 	while(  nondet_int()
 3562 		|| !(ldv_s_usbvision_fops_v4l2_file_operations == 0)
 3563 		|| !(ldv_s_usbvision_radio_fops_v4l2_file_operations == 0)
 3564 		|| !(ldv_s_usbvision_driver_usb_driver == 0)
 3565 	) {
 3566 
 3567 		switch(nondet_int()) {
 3568 
 3569 			case 0: {
 3570 
 3571 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_fops **/
 3572 				if(ldv_s_usbvision_fops_v4l2_file_operations==0) {
 3573 
 3574 				/* content: static int usbvision_v4l2_open(struct file *file)*/
 3575 				/* LDV_COMMENT_BEGIN_PREP */
 3576 				#define DRIVER_AUTHOR					\
 3577 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3578 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3579 				#define DRIVER_NAME "usbvision"
 3580 				#define DRIVER_ALIAS "USBVision"
 3581 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3582 				#define DRIVER_LICENSE "GPL"
 3583 				#define USBVISION_VERSION_STRING "0.9.11"
 3584 				#define	ENABLE_HEXDUMP	0	
 3585 				#ifdef USBVISION_DEBUG
 3586 				#define PDEBUG(level, fmt, args...) { \
 3587 		if (video_debug & (level)) \
 3588 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3589 				__func__, __LINE__ , ## args); \
 3590 	}
 3591 				#else
 3592 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3593 				#endif
 3594 				#define DBG_IO		(1 << 1)
 3595 				#define DBG_PROBE	(1 << 2)
 3596 				#define DBG_MMAP	(1 << 3)
 3597 				#define rmspace(str)	while (*str == ' ') str++;
 3598 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3599 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3600 				/* LDV_COMMENT_END_PREP */
 3601 				/* LDV_COMMENT_FUNCTION_CALL Function from field "open" from driver structure with callbacks "usbvision_fops". Standart function test for correct return result. */
 3602 				ldv_handler_precall();
 3603 				res_usbvision_v4l2_open_12 = usbvision_v4l2_open( var_group1);
 3604 				 ldv_check_return_value(res_usbvision_v4l2_open_12);
 3605 				 if(res_usbvision_v4l2_open_12) 
 3606 					goto ldv_module_exit;
 3607 				/* LDV_COMMENT_BEGIN_PREP */
 3608 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3609 				#endif
 3610 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3611 				#endif
 3612 				/* LDV_COMMENT_END_PREP */
 3613 				ldv_s_usbvision_fops_v4l2_file_operations++;
 3614 
 3615 				}
 3616 
 3617 			}
 3618 
 3619 			break;
 3620 			case 1: {
 3621 
 3622 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_fops **/
 3623 				if(ldv_s_usbvision_fops_v4l2_file_operations==1) {
 3624 
 3625 				/* content: static int usbvision_v4l2_close(struct file *file)*/
 3626 				/* LDV_COMMENT_BEGIN_PREP */
 3627 				#define DRIVER_AUTHOR					\
 3628 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3629 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3630 				#define DRIVER_NAME "usbvision"
 3631 				#define DRIVER_ALIAS "USBVision"
 3632 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3633 				#define DRIVER_LICENSE "GPL"
 3634 				#define USBVISION_VERSION_STRING "0.9.11"
 3635 				#define	ENABLE_HEXDUMP	0	
 3636 				#ifdef USBVISION_DEBUG
 3637 				#define PDEBUG(level, fmt, args...) { \
 3638 		if (video_debug & (level)) \
 3639 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3640 				__func__, __LINE__ , ## args); \
 3641 	}
 3642 				#else
 3643 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3644 				#endif
 3645 				#define DBG_IO		(1 << 1)
 3646 				#define DBG_PROBE	(1 << 2)
 3647 				#define DBG_MMAP	(1 << 3)
 3648 				#define rmspace(str)	while (*str == ' ') str++;
 3649 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3650 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3651 				/* LDV_COMMENT_END_PREP */
 3652 				/* LDV_COMMENT_FUNCTION_CALL Function from field "release" from driver structure with callbacks "usbvision_fops" */
 3653 				ldv_handler_precall();
 3654 				usbvision_v4l2_close( var_group1);
 3655 				/* LDV_COMMENT_BEGIN_PREP */
 3656 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3657 				#endif
 3658 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3659 				#endif
 3660 				/* LDV_COMMENT_END_PREP */
 3661 				ldv_s_usbvision_fops_v4l2_file_operations=0;
 3662 
 3663 				}
 3664 
 3665 			}
 3666 
 3667 			break;
 3668 			case 2: {
 3669 
 3670 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_fops **/
 3671 				
 3672 
 3673 				/* content: static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)*/
 3674 				/* LDV_COMMENT_BEGIN_PREP */
 3675 				#define DRIVER_AUTHOR					\
 3676 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3677 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3678 				#define DRIVER_NAME "usbvision"
 3679 				#define DRIVER_ALIAS "USBVision"
 3680 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3681 				#define DRIVER_LICENSE "GPL"
 3682 				#define USBVISION_VERSION_STRING "0.9.11"
 3683 				#define	ENABLE_HEXDUMP	0	
 3684 				#ifdef USBVISION_DEBUG
 3685 				#define PDEBUG(level, fmt, args...) { \
 3686 		if (video_debug & (level)) \
 3687 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3688 				__func__, __LINE__ , ## args); \
 3689 	}
 3690 				#else
 3691 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3692 				#endif
 3693 				#define DBG_IO		(1 << 1)
 3694 				#define DBG_PROBE	(1 << 2)
 3695 				#define DBG_MMAP	(1 << 3)
 3696 				#define rmspace(str)	while (*str == ' ') str++;
 3697 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3698 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3699 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3700 				#endif
 3701 				/* LDV_COMMENT_END_PREP */
 3702 				/* LDV_COMMENT_FUNCTION_CALL Function from field "read" from driver structure with callbacks "usbvision_fops" */
 3703 				ldv_handler_precall();
 3704 				usbvision_v4l2_read( var_group1, var_usbvision_v4l2_read_42_p1, var_usbvision_v4l2_read_42_p2, var_usbvision_v4l2_read_42_p3);
 3705 				/* LDV_COMMENT_BEGIN_PREP */
 3706 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3707 				#endif
 3708 				/* LDV_COMMENT_END_PREP */
 3709 				
 3710 
 3711 				
 3712 
 3713 			}
 3714 
 3715 			break;
 3716 			case 3: {
 3717 
 3718 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_fops **/
 3719 				
 3720 
 3721 				/* content: static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma)*/
 3722 				/* LDV_COMMENT_BEGIN_PREP */
 3723 				#define DRIVER_AUTHOR					\
 3724 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3725 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3726 				#define DRIVER_NAME "usbvision"
 3727 				#define DRIVER_ALIAS "USBVision"
 3728 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3729 				#define DRIVER_LICENSE "GPL"
 3730 				#define USBVISION_VERSION_STRING "0.9.11"
 3731 				#define	ENABLE_HEXDUMP	0	
 3732 				#ifdef USBVISION_DEBUG
 3733 				#define PDEBUG(level, fmt, args...) { \
 3734 		if (video_debug & (level)) \
 3735 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3736 				__func__, __LINE__ , ## args); \
 3737 	}
 3738 				#else
 3739 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3740 				#endif
 3741 				#define DBG_IO		(1 << 1)
 3742 				#define DBG_PROBE	(1 << 2)
 3743 				#define DBG_MMAP	(1 << 3)
 3744 				#define rmspace(str)	while (*str == ' ') str++;
 3745 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3746 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3747 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3748 				#endif
 3749 				/* LDV_COMMENT_END_PREP */
 3750 				/* LDV_COMMENT_FUNCTION_CALL Function from field "mmap" from driver structure with callbacks "usbvision_fops" */
 3751 				ldv_handler_precall();
 3752 				usbvision_v4l2_mmap( var_group1, var_group2);
 3753 				/* LDV_COMMENT_BEGIN_PREP */
 3754 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3755 				#endif
 3756 				/* LDV_COMMENT_END_PREP */
 3757 				
 3758 
 3759 				
 3760 
 3761 			}
 3762 
 3763 			break;
 3764 			case 4: {
 3765 
 3766 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 3767 				
 3768 
 3769 				/* content: static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *vc)*/
 3770 				/* LDV_COMMENT_BEGIN_PREP */
 3771 				#define DRIVER_AUTHOR					\
 3772 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3773 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3774 				#define DRIVER_NAME "usbvision"
 3775 				#define DRIVER_ALIAS "USBVision"
 3776 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3777 				#define DRIVER_LICENSE "GPL"
 3778 				#define USBVISION_VERSION_STRING "0.9.11"
 3779 				#define	ENABLE_HEXDUMP	0	
 3780 				#ifdef USBVISION_DEBUG
 3781 				#define PDEBUG(level, fmt, args...) { \
 3782 		if (video_debug & (level)) \
 3783 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3784 				__func__, __LINE__ , ## args); \
 3785 	}
 3786 				#else
 3787 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3788 				#endif
 3789 				#define DBG_IO		(1 << 1)
 3790 				#define DBG_PROBE	(1 << 2)
 3791 				#define DBG_MMAP	(1 << 3)
 3792 				#define rmspace(str)	while (*str == ' ') str++;
 3793 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3794 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3795 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3796 				#endif
 3797 				/* LDV_COMMENT_END_PREP */
 3798 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_querycap" from driver structure with callbacks "usbvision_ioctl_ops" */
 3799 				ldv_handler_precall();
 3800 				vidioc_querycap( var_group1, var_vidioc_querycap_16_p1, var_vidioc_querycap_16_p2);
 3801 				/* LDV_COMMENT_BEGIN_PREP */
 3802 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3803 				#endif
 3804 				/* LDV_COMMENT_END_PREP */
 3805 				
 3806 
 3807 				
 3808 
 3809 			}
 3810 
 3811 			break;
 3812 			case 5: {
 3813 
 3814 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 3815 				
 3816 
 3817 				/* content: static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *vfd)*/
 3818 				/* LDV_COMMENT_BEGIN_PREP */
 3819 				#define DRIVER_AUTHOR					\
 3820 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3821 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3822 				#define DRIVER_NAME "usbvision"
 3823 				#define DRIVER_ALIAS "USBVision"
 3824 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3825 				#define DRIVER_LICENSE "GPL"
 3826 				#define USBVISION_VERSION_STRING "0.9.11"
 3827 				#define	ENABLE_HEXDUMP	0	
 3828 				#ifdef USBVISION_DEBUG
 3829 				#define PDEBUG(level, fmt, args...) { \
 3830 		if (video_debug & (level)) \
 3831 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3832 				__func__, __LINE__ , ## args); \
 3833 	}
 3834 				#else
 3835 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3836 				#endif
 3837 				#define DBG_IO		(1 << 1)
 3838 				#define DBG_PROBE	(1 << 2)
 3839 				#define DBG_MMAP	(1 << 3)
 3840 				#define rmspace(str)	while (*str == ' ') str++;
 3841 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3842 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3843 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3844 				#endif
 3845 				/* LDV_COMMENT_END_PREP */
 3846 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_enum_fmt_vid_cap" from driver structure with callbacks "usbvision_ioctl_ops" */
 3847 				ldv_handler_precall();
 3848 				vidioc_enum_fmt_vid_cap( var_group1, var_vidioc_enum_fmt_vid_cap_37_p1, var_vidioc_enum_fmt_vid_cap_37_p2);
 3849 				/* LDV_COMMENT_BEGIN_PREP */
 3850 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3851 				#endif
 3852 				/* LDV_COMMENT_END_PREP */
 3853 				
 3854 
 3855 				
 3856 
 3857 			}
 3858 
 3859 			break;
 3860 			case 6: {
 3861 
 3862 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 3863 				
 3864 
 3865 				/* content: static int vidioc_g_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 3866 				/* LDV_COMMENT_BEGIN_PREP */
 3867 				#define DRIVER_AUTHOR					\
 3868 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3869 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3870 				#define DRIVER_NAME "usbvision"
 3871 				#define DRIVER_ALIAS "USBVision"
 3872 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3873 				#define DRIVER_LICENSE "GPL"
 3874 				#define USBVISION_VERSION_STRING "0.9.11"
 3875 				#define	ENABLE_HEXDUMP	0	
 3876 				#ifdef USBVISION_DEBUG
 3877 				#define PDEBUG(level, fmt, args...) { \
 3878 		if (video_debug & (level)) \
 3879 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3880 				__func__, __LINE__ , ## args); \
 3881 	}
 3882 				#else
 3883 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3884 				#endif
 3885 				#define DBG_IO		(1 << 1)
 3886 				#define DBG_PROBE	(1 << 2)
 3887 				#define DBG_MMAP	(1 << 3)
 3888 				#define rmspace(str)	while (*str == ' ') str++;
 3889 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3890 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3891 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3892 				#endif
 3893 				/* LDV_COMMENT_END_PREP */
 3894 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_fmt_vid_cap" from driver structure with callbacks "usbvision_ioctl_ops" */
 3895 				ldv_handler_precall();
 3896 				vidioc_g_fmt_vid_cap( var_group1, var_vidioc_g_fmt_vid_cap_38_p1, var_vidioc_g_fmt_vid_cap_38_p2);
 3897 				/* LDV_COMMENT_BEGIN_PREP */
 3898 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3899 				#endif
 3900 				/* LDV_COMMENT_END_PREP */
 3901 				
 3902 
 3903 				
 3904 
 3905 			}
 3906 
 3907 			break;
 3908 			case 7: {
 3909 
 3910 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 3911 				
 3912 
 3913 				/* content: static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 3914 				/* LDV_COMMENT_BEGIN_PREP */
 3915 				#define DRIVER_AUTHOR					\
 3916 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3917 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3918 				#define DRIVER_NAME "usbvision"
 3919 				#define DRIVER_ALIAS "USBVision"
 3920 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3921 				#define DRIVER_LICENSE "GPL"
 3922 				#define USBVISION_VERSION_STRING "0.9.11"
 3923 				#define	ENABLE_HEXDUMP	0	
 3924 				#ifdef USBVISION_DEBUG
 3925 				#define PDEBUG(level, fmt, args...) { \
 3926 		if (video_debug & (level)) \
 3927 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3928 				__func__, __LINE__ , ## args); \
 3929 	}
 3930 				#else
 3931 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3932 				#endif
 3933 				#define DBG_IO		(1 << 1)
 3934 				#define DBG_PROBE	(1 << 2)
 3935 				#define DBG_MMAP	(1 << 3)
 3936 				#define rmspace(str)	while (*str == ' ') str++;
 3937 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3938 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3939 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3940 				#endif
 3941 				/* LDV_COMMENT_END_PREP */
 3942 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_try_fmt_vid_cap" from driver structure with callbacks "usbvision_ioctl_ops" */
 3943 				ldv_handler_precall();
 3944 				vidioc_try_fmt_vid_cap( var_group1, var_vidioc_try_fmt_vid_cap_39_p1, var_vidioc_try_fmt_vid_cap_39_p2);
 3945 				/* LDV_COMMENT_BEGIN_PREP */
 3946 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3947 				#endif
 3948 				/* LDV_COMMENT_END_PREP */
 3949 				
 3950 
 3951 				
 3952 
 3953 			}
 3954 
 3955 			break;
 3956 			case 8: {
 3957 
 3958 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 3959 				
 3960 
 3961 				/* content: static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *vf)*/
 3962 				/* LDV_COMMENT_BEGIN_PREP */
 3963 				#define DRIVER_AUTHOR					\
 3964 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 3965 	"Dwaine Garden <DwaineGarden@rogers.com>"
 3966 				#define DRIVER_NAME "usbvision"
 3967 				#define DRIVER_ALIAS "USBVision"
 3968 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 3969 				#define DRIVER_LICENSE "GPL"
 3970 				#define USBVISION_VERSION_STRING "0.9.11"
 3971 				#define	ENABLE_HEXDUMP	0	
 3972 				#ifdef USBVISION_DEBUG
 3973 				#define PDEBUG(level, fmt, args...) { \
 3974 		if (video_debug & (level)) \
 3975 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 3976 				__func__, __LINE__ , ## args); \
 3977 	}
 3978 				#else
 3979 				#define PDEBUG(level, fmt, args...) do {} while (0)
 3980 				#endif
 3981 				#define DBG_IO		(1 << 1)
 3982 				#define DBG_PROBE	(1 << 2)
 3983 				#define DBG_MMAP	(1 << 3)
 3984 				#define rmspace(str)	while (*str == ' ') str++;
 3985 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 3986 				#define YES_NO(x) ((x) ? "Yes" : "No")
 3987 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3988 				#endif
 3989 				/* LDV_COMMENT_END_PREP */
 3990 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_fmt_vid_cap" from driver structure with callbacks "usbvision_ioctl_ops" */
 3991 				ldv_handler_precall();
 3992 				vidioc_s_fmt_vid_cap( var_group1, var_vidioc_s_fmt_vid_cap_40_p1, var_vidioc_s_fmt_vid_cap_40_p2);
 3993 				/* LDV_COMMENT_BEGIN_PREP */
 3994 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 3995 				#endif
 3996 				/* LDV_COMMENT_END_PREP */
 3997 				
 3998 
 3999 				
 4000 
 4001 			}
 4002 
 4003 			break;
 4004 			case 9: {
 4005 
 4006 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4007 				
 4008 
 4009 				/* content: static int vidioc_reqbufs(struct file *file, void *priv, struct v4l2_requestbuffers *vr)*/
 4010 				/* LDV_COMMENT_BEGIN_PREP */
 4011 				#define DRIVER_AUTHOR					\
 4012 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4013 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4014 				#define DRIVER_NAME "usbvision"
 4015 				#define DRIVER_ALIAS "USBVision"
 4016 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4017 				#define DRIVER_LICENSE "GPL"
 4018 				#define USBVISION_VERSION_STRING "0.9.11"
 4019 				#define	ENABLE_HEXDUMP	0	
 4020 				#ifdef USBVISION_DEBUG
 4021 				#define PDEBUG(level, fmt, args...) { \
 4022 		if (video_debug & (level)) \
 4023 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4024 				__func__, __LINE__ , ## args); \
 4025 	}
 4026 				#else
 4027 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4028 				#endif
 4029 				#define DBG_IO		(1 << 1)
 4030 				#define DBG_PROBE	(1 << 2)
 4031 				#define DBG_MMAP	(1 << 3)
 4032 				#define rmspace(str)	while (*str == ' ') str++;
 4033 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4034 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4035 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4036 				#endif
 4037 				/* LDV_COMMENT_END_PREP */
 4038 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_reqbufs" from driver structure with callbacks "usbvision_ioctl_ops" */
 4039 				ldv_handler_precall();
 4040 				vidioc_reqbufs( var_group1, var_vidioc_reqbufs_31_p1, var_vidioc_reqbufs_31_p2);
 4041 				/* LDV_COMMENT_BEGIN_PREP */
 4042 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4043 				#endif
 4044 				/* LDV_COMMENT_END_PREP */
 4045 				
 4046 
 4047 				
 4048 
 4049 			}
 4050 
 4051 			break;
 4052 			case 10: {
 4053 
 4054 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4055 				
 4056 
 4057 				/* content: static int vidioc_querybuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 4058 				/* LDV_COMMENT_BEGIN_PREP */
 4059 				#define DRIVER_AUTHOR					\
 4060 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4061 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4062 				#define DRIVER_NAME "usbvision"
 4063 				#define DRIVER_ALIAS "USBVision"
 4064 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4065 				#define DRIVER_LICENSE "GPL"
 4066 				#define USBVISION_VERSION_STRING "0.9.11"
 4067 				#define	ENABLE_HEXDUMP	0	
 4068 				#ifdef USBVISION_DEBUG
 4069 				#define PDEBUG(level, fmt, args...) { \
 4070 		if (video_debug & (level)) \
 4071 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4072 				__func__, __LINE__ , ## args); \
 4073 	}
 4074 				#else
 4075 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4076 				#endif
 4077 				#define DBG_IO		(1 << 1)
 4078 				#define DBG_PROBE	(1 << 2)
 4079 				#define DBG_MMAP	(1 << 3)
 4080 				#define rmspace(str)	while (*str == ' ') str++;
 4081 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4082 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4083 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4084 				#endif
 4085 				/* LDV_COMMENT_END_PREP */
 4086 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_querybuf" from driver structure with callbacks "usbvision_ioctl_ops" */
 4087 				ldv_handler_precall();
 4088 				vidioc_querybuf( var_group1, var_vidioc_querybuf_32_p1, var_vidioc_querybuf_32_p2);
 4089 				/* LDV_COMMENT_BEGIN_PREP */
 4090 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4091 				#endif
 4092 				/* LDV_COMMENT_END_PREP */
 4093 				
 4094 
 4095 				
 4096 
 4097 			}
 4098 
 4099 			break;
 4100 			case 11: {
 4101 
 4102 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4103 				
 4104 
 4105 				/* content: static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 4106 				/* LDV_COMMENT_BEGIN_PREP */
 4107 				#define DRIVER_AUTHOR					\
 4108 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4109 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4110 				#define DRIVER_NAME "usbvision"
 4111 				#define DRIVER_ALIAS "USBVision"
 4112 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4113 				#define DRIVER_LICENSE "GPL"
 4114 				#define USBVISION_VERSION_STRING "0.9.11"
 4115 				#define	ENABLE_HEXDUMP	0	
 4116 				#ifdef USBVISION_DEBUG
 4117 				#define PDEBUG(level, fmt, args...) { \
 4118 		if (video_debug & (level)) \
 4119 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4120 				__func__, __LINE__ , ## args); \
 4121 	}
 4122 				#else
 4123 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4124 				#endif
 4125 				#define DBG_IO		(1 << 1)
 4126 				#define DBG_PROBE	(1 << 2)
 4127 				#define DBG_MMAP	(1 << 3)
 4128 				#define rmspace(str)	while (*str == ' ') str++;
 4129 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4130 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4131 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4132 				#endif
 4133 				/* LDV_COMMENT_END_PREP */
 4134 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_qbuf" from driver structure with callbacks "usbvision_ioctl_ops" */
 4135 				ldv_handler_precall();
 4136 				vidioc_qbuf( var_group1, var_vidioc_qbuf_33_p1, var_vidioc_qbuf_33_p2);
 4137 				/* LDV_COMMENT_BEGIN_PREP */
 4138 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4139 				#endif
 4140 				/* LDV_COMMENT_END_PREP */
 4141 				
 4142 
 4143 				
 4144 
 4145 			}
 4146 
 4147 			break;
 4148 			case 12: {
 4149 
 4150 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4151 				
 4152 
 4153 				/* content: static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *vb)*/
 4154 				/* LDV_COMMENT_BEGIN_PREP */
 4155 				#define DRIVER_AUTHOR					\
 4156 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4157 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4158 				#define DRIVER_NAME "usbvision"
 4159 				#define DRIVER_ALIAS "USBVision"
 4160 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4161 				#define DRIVER_LICENSE "GPL"
 4162 				#define USBVISION_VERSION_STRING "0.9.11"
 4163 				#define	ENABLE_HEXDUMP	0	
 4164 				#ifdef USBVISION_DEBUG
 4165 				#define PDEBUG(level, fmt, args...) { \
 4166 		if (video_debug & (level)) \
 4167 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4168 				__func__, __LINE__ , ## args); \
 4169 	}
 4170 				#else
 4171 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4172 				#endif
 4173 				#define DBG_IO		(1 << 1)
 4174 				#define DBG_PROBE	(1 << 2)
 4175 				#define DBG_MMAP	(1 << 3)
 4176 				#define rmspace(str)	while (*str == ' ') str++;
 4177 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4178 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4179 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4180 				#endif
 4181 				/* LDV_COMMENT_END_PREP */
 4182 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_dqbuf" from driver structure with callbacks "usbvision_ioctl_ops" */
 4183 				ldv_handler_precall();
 4184 				vidioc_dqbuf( var_group1, var_vidioc_dqbuf_34_p1, var_vidioc_dqbuf_34_p2);
 4185 				/* LDV_COMMENT_BEGIN_PREP */
 4186 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4187 				#endif
 4188 				/* LDV_COMMENT_END_PREP */
 4189 				
 4190 
 4191 				
 4192 
 4193 			}
 4194 
 4195 			break;
 4196 			case 13: {
 4197 
 4198 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4199 				
 4200 
 4201 				/* content: static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)*/
 4202 				/* LDV_COMMENT_BEGIN_PREP */
 4203 				#define DRIVER_AUTHOR					\
 4204 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4205 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4206 				#define DRIVER_NAME "usbvision"
 4207 				#define DRIVER_ALIAS "USBVision"
 4208 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4209 				#define DRIVER_LICENSE "GPL"
 4210 				#define USBVISION_VERSION_STRING "0.9.11"
 4211 				#define	ENABLE_HEXDUMP	0	
 4212 				#ifdef USBVISION_DEBUG
 4213 				#define PDEBUG(level, fmt, args...) { \
 4214 		if (video_debug & (level)) \
 4215 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4216 				__func__, __LINE__ , ## args); \
 4217 	}
 4218 				#else
 4219 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4220 				#endif
 4221 				#define DBG_IO		(1 << 1)
 4222 				#define DBG_PROBE	(1 << 2)
 4223 				#define DBG_MMAP	(1 << 3)
 4224 				#define rmspace(str)	while (*str == ' ') str++;
 4225 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4226 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4227 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4228 				#endif
 4229 				/* LDV_COMMENT_END_PREP */
 4230 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_std" from driver structure with callbacks "usbvision_ioctl_ops" */
 4231 				ldv_handler_precall();
 4232 				vidioc_s_std( var_group1, var_vidioc_s_std_20_p1, var_vidioc_s_std_20_p2);
 4233 				/* LDV_COMMENT_BEGIN_PREP */
 4234 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4235 				#endif
 4236 				/* LDV_COMMENT_END_PREP */
 4237 				
 4238 
 4239 				
 4240 
 4241 			}
 4242 
 4243 			break;
 4244 			case 14: {
 4245 
 4246 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4247 				
 4248 
 4249 				/* content: static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *id)*/
 4250 				/* LDV_COMMENT_BEGIN_PREP */
 4251 				#define DRIVER_AUTHOR					\
 4252 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4253 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4254 				#define DRIVER_NAME "usbvision"
 4255 				#define DRIVER_ALIAS "USBVision"
 4256 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4257 				#define DRIVER_LICENSE "GPL"
 4258 				#define USBVISION_VERSION_STRING "0.9.11"
 4259 				#define	ENABLE_HEXDUMP	0	
 4260 				#ifdef USBVISION_DEBUG
 4261 				#define PDEBUG(level, fmt, args...) { \
 4262 		if (video_debug & (level)) \
 4263 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4264 				__func__, __LINE__ , ## args); \
 4265 	}
 4266 				#else
 4267 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4268 				#endif
 4269 				#define DBG_IO		(1 << 1)
 4270 				#define DBG_PROBE	(1 << 2)
 4271 				#define DBG_MMAP	(1 << 3)
 4272 				#define rmspace(str)	while (*str == ' ') str++;
 4273 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4274 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4275 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4276 				#endif
 4277 				/* LDV_COMMENT_END_PREP */
 4278 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_std" from driver structure with callbacks "usbvision_ioctl_ops" */
 4279 				ldv_handler_precall();
 4280 				vidioc_g_std( var_group1, var_vidioc_g_std_21_p1, var_vidioc_g_std_21_p2);
 4281 				/* LDV_COMMENT_BEGIN_PREP */
 4282 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4283 				#endif
 4284 				/* LDV_COMMENT_END_PREP */
 4285 				
 4286 
 4287 				
 4288 
 4289 			}
 4290 
 4291 			break;
 4292 			case 15: {
 4293 
 4294 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4295 				
 4296 
 4297 				/* content: static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *vi)*/
 4298 				/* LDV_COMMENT_BEGIN_PREP */
 4299 				#define DRIVER_AUTHOR					\
 4300 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4301 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4302 				#define DRIVER_NAME "usbvision"
 4303 				#define DRIVER_ALIAS "USBVision"
 4304 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4305 				#define DRIVER_LICENSE "GPL"
 4306 				#define USBVISION_VERSION_STRING "0.9.11"
 4307 				#define	ENABLE_HEXDUMP	0	
 4308 				#ifdef USBVISION_DEBUG
 4309 				#define PDEBUG(level, fmt, args...) { \
 4310 		if (video_debug & (level)) \
 4311 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4312 				__func__, __LINE__ , ## args); \
 4313 	}
 4314 				#else
 4315 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4316 				#endif
 4317 				#define DBG_IO		(1 << 1)
 4318 				#define DBG_PROBE	(1 << 2)
 4319 				#define DBG_MMAP	(1 << 3)
 4320 				#define rmspace(str)	while (*str == ' ') str++;
 4321 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4322 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4323 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4324 				#endif
 4325 				/* LDV_COMMENT_END_PREP */
 4326 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_enum_input" from driver structure with callbacks "usbvision_ioctl_ops" */
 4327 				ldv_handler_precall();
 4328 				vidioc_enum_input( var_group1, var_vidioc_enum_input_17_p1, var_vidioc_enum_input_17_p2);
 4329 				/* LDV_COMMENT_BEGIN_PREP */
 4330 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4331 				#endif
 4332 				/* LDV_COMMENT_END_PREP */
 4333 				
 4334 
 4335 				
 4336 
 4337 			}
 4338 
 4339 			break;
 4340 			case 16: {
 4341 
 4342 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4343 				
 4344 
 4345 				/* content: static int vidioc_g_input(struct file *file, void *priv, unsigned int *input)*/
 4346 				/* LDV_COMMENT_BEGIN_PREP */
 4347 				#define DRIVER_AUTHOR					\
 4348 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4349 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4350 				#define DRIVER_NAME "usbvision"
 4351 				#define DRIVER_ALIAS "USBVision"
 4352 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4353 				#define DRIVER_LICENSE "GPL"
 4354 				#define USBVISION_VERSION_STRING "0.9.11"
 4355 				#define	ENABLE_HEXDUMP	0	
 4356 				#ifdef USBVISION_DEBUG
 4357 				#define PDEBUG(level, fmt, args...) { \
 4358 		if (video_debug & (level)) \
 4359 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4360 				__func__, __LINE__ , ## args); \
 4361 	}
 4362 				#else
 4363 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4364 				#endif
 4365 				#define DBG_IO		(1 << 1)
 4366 				#define DBG_PROBE	(1 << 2)
 4367 				#define DBG_MMAP	(1 << 3)
 4368 				#define rmspace(str)	while (*str == ' ') str++;
 4369 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4370 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4371 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4372 				#endif
 4373 				/* LDV_COMMENT_END_PREP */
 4374 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_input" from driver structure with callbacks "usbvision_ioctl_ops" */
 4375 				ldv_handler_precall();
 4376 				vidioc_g_input( var_group1, var_vidioc_g_input_18_p1, var_vidioc_g_input_18_p2);
 4377 				/* LDV_COMMENT_BEGIN_PREP */
 4378 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4379 				#endif
 4380 				/* LDV_COMMENT_END_PREP */
 4381 				
 4382 
 4383 				
 4384 
 4385 			}
 4386 
 4387 			break;
 4388 			case 17: {
 4389 
 4390 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4391 				
 4392 
 4393 				/* content: static int vidioc_s_input(struct file *file, void *priv, unsigned int input)*/
 4394 				/* LDV_COMMENT_BEGIN_PREP */
 4395 				#define DRIVER_AUTHOR					\
 4396 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4397 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4398 				#define DRIVER_NAME "usbvision"
 4399 				#define DRIVER_ALIAS "USBVision"
 4400 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4401 				#define DRIVER_LICENSE "GPL"
 4402 				#define USBVISION_VERSION_STRING "0.9.11"
 4403 				#define	ENABLE_HEXDUMP	0	
 4404 				#ifdef USBVISION_DEBUG
 4405 				#define PDEBUG(level, fmt, args...) { \
 4406 		if (video_debug & (level)) \
 4407 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4408 				__func__, __LINE__ , ## args); \
 4409 	}
 4410 				#else
 4411 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4412 				#endif
 4413 				#define DBG_IO		(1 << 1)
 4414 				#define DBG_PROBE	(1 << 2)
 4415 				#define DBG_MMAP	(1 << 3)
 4416 				#define rmspace(str)	while (*str == ' ') str++;
 4417 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4418 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4419 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4420 				#endif
 4421 				/* LDV_COMMENT_END_PREP */
 4422 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_input" from driver structure with callbacks "usbvision_ioctl_ops" */
 4423 				ldv_handler_precall();
 4424 				vidioc_s_input( var_group1, var_vidioc_s_input_19_p1, var_vidioc_s_input_19_p2);
 4425 				/* LDV_COMMENT_BEGIN_PREP */
 4426 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4427 				#endif
 4428 				/* LDV_COMMENT_END_PREP */
 4429 				
 4430 
 4431 				
 4432 
 4433 			}
 4434 
 4435 			break;
 4436 			case 18: {
 4437 
 4438 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4439 				
 4440 
 4441 				/* content: static int vidioc_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *ctrl)*/
 4442 				/* LDV_COMMENT_BEGIN_PREP */
 4443 				#define DRIVER_AUTHOR					\
 4444 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4445 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4446 				#define DRIVER_NAME "usbvision"
 4447 				#define DRIVER_ALIAS "USBVision"
 4448 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4449 				#define DRIVER_LICENSE "GPL"
 4450 				#define USBVISION_VERSION_STRING "0.9.11"
 4451 				#define	ENABLE_HEXDUMP	0	
 4452 				#ifdef USBVISION_DEBUG
 4453 				#define PDEBUG(level, fmt, args...) { \
 4454 		if (video_debug & (level)) \
 4455 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4456 				__func__, __LINE__ , ## args); \
 4457 	}
 4458 				#else
 4459 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4460 				#endif
 4461 				#define DBG_IO		(1 << 1)
 4462 				#define DBG_PROBE	(1 << 2)
 4463 				#define DBG_MMAP	(1 << 3)
 4464 				#define rmspace(str)	while (*str == ' ') str++;
 4465 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4466 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4467 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4468 				#endif
 4469 				/* LDV_COMMENT_END_PREP */
 4470 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_queryctrl" from driver structure with callbacks "usbvision_ioctl_ops" */
 4471 				ldv_handler_precall();
 4472 				vidioc_queryctrl( var_group1, var_vidioc_queryctrl_28_p1, var_vidioc_queryctrl_28_p2);
 4473 				/* LDV_COMMENT_BEGIN_PREP */
 4474 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4475 				#endif
 4476 				/* LDV_COMMENT_END_PREP */
 4477 				
 4478 
 4479 				
 4480 
 4481 			}
 4482 
 4483 			break;
 4484 			case 19: {
 4485 
 4486 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4487 				
 4488 
 4489 				/* content: static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)*/
 4490 				/* LDV_COMMENT_BEGIN_PREP */
 4491 				#define DRIVER_AUTHOR					\
 4492 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4493 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4494 				#define DRIVER_NAME "usbvision"
 4495 				#define DRIVER_ALIAS "USBVision"
 4496 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4497 				#define DRIVER_LICENSE "GPL"
 4498 				#define USBVISION_VERSION_STRING "0.9.11"
 4499 				#define	ENABLE_HEXDUMP	0	
 4500 				#ifdef USBVISION_DEBUG
 4501 				#define PDEBUG(level, fmt, args...) { \
 4502 		if (video_debug & (level)) \
 4503 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4504 				__func__, __LINE__ , ## args); \
 4505 	}
 4506 				#else
 4507 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4508 				#endif
 4509 				#define DBG_IO		(1 << 1)
 4510 				#define DBG_PROBE	(1 << 2)
 4511 				#define DBG_MMAP	(1 << 3)
 4512 				#define rmspace(str)	while (*str == ' ') str++;
 4513 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4514 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4515 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4516 				#endif
 4517 				/* LDV_COMMENT_END_PREP */
 4518 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_audio" from driver structure with callbacks "usbvision_ioctl_ops" */
 4519 				ldv_handler_precall();
 4520 				vidioc_g_audio( var_group1, var_vidioc_g_audio_26_p1, var_vidioc_g_audio_26_p2);
 4521 				/* LDV_COMMENT_BEGIN_PREP */
 4522 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4523 				#endif
 4524 				/* LDV_COMMENT_END_PREP */
 4525 				
 4526 
 4527 				
 4528 
 4529 			}
 4530 
 4531 			break;
 4532 			case 20: {
 4533 
 4534 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4535 				
 4536 
 4537 				/* content: static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)*/
 4538 				/* LDV_COMMENT_BEGIN_PREP */
 4539 				#define DRIVER_AUTHOR					\
 4540 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4541 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4542 				#define DRIVER_NAME "usbvision"
 4543 				#define DRIVER_ALIAS "USBVision"
 4544 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4545 				#define DRIVER_LICENSE "GPL"
 4546 				#define USBVISION_VERSION_STRING "0.9.11"
 4547 				#define	ENABLE_HEXDUMP	0	
 4548 				#ifdef USBVISION_DEBUG
 4549 				#define PDEBUG(level, fmt, args...) { \
 4550 		if (video_debug & (level)) \
 4551 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4552 				__func__, __LINE__ , ## args); \
 4553 	}
 4554 				#else
 4555 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4556 				#endif
 4557 				#define DBG_IO		(1 << 1)
 4558 				#define DBG_PROBE	(1 << 2)
 4559 				#define DBG_MMAP	(1 << 3)
 4560 				#define rmspace(str)	while (*str == ' ') str++;
 4561 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4562 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4563 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4564 				#endif
 4565 				/* LDV_COMMENT_END_PREP */
 4566 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_audio" from driver structure with callbacks "usbvision_ioctl_ops" */
 4567 				ldv_handler_precall();
 4568 				vidioc_s_audio( var_group1, var_vidioc_s_audio_27_p1, var_vidioc_s_audio_27_p2);
 4569 				/* LDV_COMMENT_BEGIN_PREP */
 4570 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4571 				#endif
 4572 				/* LDV_COMMENT_END_PREP */
 4573 				
 4574 
 4575 				
 4576 
 4577 			}
 4578 
 4579 			break;
 4580 			case 21: {
 4581 
 4582 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4583 				
 4584 
 4585 				/* content: static int vidioc_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 4586 				/* LDV_COMMENT_BEGIN_PREP */
 4587 				#define DRIVER_AUTHOR					\
 4588 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4589 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4590 				#define DRIVER_NAME "usbvision"
 4591 				#define DRIVER_ALIAS "USBVision"
 4592 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4593 				#define DRIVER_LICENSE "GPL"
 4594 				#define USBVISION_VERSION_STRING "0.9.11"
 4595 				#define	ENABLE_HEXDUMP	0	
 4596 				#ifdef USBVISION_DEBUG
 4597 				#define PDEBUG(level, fmt, args...) { \
 4598 		if (video_debug & (level)) \
 4599 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4600 				__func__, __LINE__ , ## args); \
 4601 	}
 4602 				#else
 4603 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4604 				#endif
 4605 				#define DBG_IO		(1 << 1)
 4606 				#define DBG_PROBE	(1 << 2)
 4607 				#define DBG_MMAP	(1 << 3)
 4608 				#define rmspace(str)	while (*str == ' ') str++;
 4609 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4610 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4611 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4612 				#endif
 4613 				/* LDV_COMMENT_END_PREP */
 4614 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_ctrl" from driver structure with callbacks "usbvision_ioctl_ops" */
 4615 				ldv_handler_precall();
 4616 				vidioc_g_ctrl( var_group1, var_vidioc_g_ctrl_29_p1, var_vidioc_g_ctrl_29_p2);
 4617 				/* LDV_COMMENT_BEGIN_PREP */
 4618 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4619 				#endif
 4620 				/* LDV_COMMENT_END_PREP */
 4621 				
 4622 
 4623 				
 4624 
 4625 			}
 4626 
 4627 			break;
 4628 			case 22: {
 4629 
 4630 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4631 				
 4632 
 4633 				/* content: static int vidioc_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 4634 				/* LDV_COMMENT_BEGIN_PREP */
 4635 				#define DRIVER_AUTHOR					\
 4636 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4637 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4638 				#define DRIVER_NAME "usbvision"
 4639 				#define DRIVER_ALIAS "USBVision"
 4640 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4641 				#define DRIVER_LICENSE "GPL"
 4642 				#define USBVISION_VERSION_STRING "0.9.11"
 4643 				#define	ENABLE_HEXDUMP	0	
 4644 				#ifdef USBVISION_DEBUG
 4645 				#define PDEBUG(level, fmt, args...) { \
 4646 		if (video_debug & (level)) \
 4647 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4648 				__func__, __LINE__ , ## args); \
 4649 	}
 4650 				#else
 4651 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4652 				#endif
 4653 				#define DBG_IO		(1 << 1)
 4654 				#define DBG_PROBE	(1 << 2)
 4655 				#define DBG_MMAP	(1 << 3)
 4656 				#define rmspace(str)	while (*str == ' ') str++;
 4657 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4658 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4659 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4660 				#endif
 4661 				/* LDV_COMMENT_END_PREP */
 4662 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_ctrl" from driver structure with callbacks "usbvision_ioctl_ops" */
 4663 				ldv_handler_precall();
 4664 				vidioc_s_ctrl( var_group1, var_vidioc_s_ctrl_30_p1, var_vidioc_s_ctrl_30_p2);
 4665 				/* LDV_COMMENT_BEGIN_PREP */
 4666 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4667 				#endif
 4668 				/* LDV_COMMENT_END_PREP */
 4669 				
 4670 
 4671 				
 4672 
 4673 			}
 4674 
 4675 			break;
 4676 			case 23: {
 4677 
 4678 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4679 				
 4680 
 4681 				/* content: static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)*/
 4682 				/* LDV_COMMENT_BEGIN_PREP */
 4683 				#define DRIVER_AUTHOR					\
 4684 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4685 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4686 				#define DRIVER_NAME "usbvision"
 4687 				#define DRIVER_ALIAS "USBVision"
 4688 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4689 				#define DRIVER_LICENSE "GPL"
 4690 				#define USBVISION_VERSION_STRING "0.9.11"
 4691 				#define	ENABLE_HEXDUMP	0	
 4692 				#ifdef USBVISION_DEBUG
 4693 				#define PDEBUG(level, fmt, args...) { \
 4694 		if (video_debug & (level)) \
 4695 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4696 				__func__, __LINE__ , ## args); \
 4697 	}
 4698 				#else
 4699 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4700 				#endif
 4701 				#define DBG_IO		(1 << 1)
 4702 				#define DBG_PROBE	(1 << 2)
 4703 				#define DBG_MMAP	(1 << 3)
 4704 				#define rmspace(str)	while (*str == ' ') str++;
 4705 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4706 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4707 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4708 				#endif
 4709 				/* LDV_COMMENT_END_PREP */
 4710 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_streamon" from driver structure with callbacks "usbvision_ioctl_ops" */
 4711 				ldv_handler_precall();
 4712 				vidioc_streamon( var_group1, var_vidioc_streamon_35_p1, var_vidioc_streamon_35_p2);
 4713 				/* LDV_COMMENT_BEGIN_PREP */
 4714 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4715 				#endif
 4716 				/* LDV_COMMENT_END_PREP */
 4717 				
 4718 
 4719 				
 4720 
 4721 			}
 4722 
 4723 			break;
 4724 			case 24: {
 4725 
 4726 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4727 				
 4728 
 4729 				/* content: static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type type)*/
 4730 				/* LDV_COMMENT_BEGIN_PREP */
 4731 				#define DRIVER_AUTHOR					\
 4732 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4733 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4734 				#define DRIVER_NAME "usbvision"
 4735 				#define DRIVER_ALIAS "USBVision"
 4736 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4737 				#define DRIVER_LICENSE "GPL"
 4738 				#define USBVISION_VERSION_STRING "0.9.11"
 4739 				#define	ENABLE_HEXDUMP	0	
 4740 				#ifdef USBVISION_DEBUG
 4741 				#define PDEBUG(level, fmt, args...) { \
 4742 		if (video_debug & (level)) \
 4743 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4744 				__func__, __LINE__ , ## args); \
 4745 	}
 4746 				#else
 4747 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4748 				#endif
 4749 				#define DBG_IO		(1 << 1)
 4750 				#define DBG_PROBE	(1 << 2)
 4751 				#define DBG_MMAP	(1 << 3)
 4752 				#define rmspace(str)	while (*str == ' ') str++;
 4753 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4754 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4755 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4756 				#endif
 4757 				/* LDV_COMMENT_END_PREP */
 4758 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_streamoff" from driver structure with callbacks "usbvision_ioctl_ops" */
 4759 				ldv_handler_precall();
 4760 				vidioc_streamoff( var_group1, var_vidioc_streamoff_36_p1, var_vidioc_streamoff_36_p2);
 4761 				/* LDV_COMMENT_BEGIN_PREP */
 4762 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4763 				#endif
 4764 				/* LDV_COMMENT_END_PREP */
 4765 				
 4766 
 4767 				
 4768 
 4769 			}
 4770 
 4771 			break;
 4772 			case 25: {
 4773 
 4774 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4775 				
 4776 
 4777 				/* content: static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)*/
 4778 				/* LDV_COMMENT_BEGIN_PREP */
 4779 				#define DRIVER_AUTHOR					\
 4780 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4781 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4782 				#define DRIVER_NAME "usbvision"
 4783 				#define DRIVER_ALIAS "USBVision"
 4784 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4785 				#define DRIVER_LICENSE "GPL"
 4786 				#define USBVISION_VERSION_STRING "0.9.11"
 4787 				#define	ENABLE_HEXDUMP	0	
 4788 				#ifdef USBVISION_DEBUG
 4789 				#define PDEBUG(level, fmt, args...) { \
 4790 		if (video_debug & (level)) \
 4791 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4792 				__func__, __LINE__ , ## args); \
 4793 	}
 4794 				#else
 4795 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4796 				#endif
 4797 				#define DBG_IO		(1 << 1)
 4798 				#define DBG_PROBE	(1 << 2)
 4799 				#define DBG_MMAP	(1 << 3)
 4800 				#define rmspace(str)	while (*str == ' ') str++;
 4801 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4802 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4803 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4804 				#endif
 4805 				/* LDV_COMMENT_END_PREP */
 4806 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_tuner" from driver structure with callbacks "usbvision_ioctl_ops" */
 4807 				ldv_handler_precall();
 4808 				vidioc_g_tuner( var_group1, var_vidioc_g_tuner_22_p1, var_vidioc_g_tuner_22_p2);
 4809 				/* LDV_COMMENT_BEGIN_PREP */
 4810 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4811 				#endif
 4812 				/* LDV_COMMENT_END_PREP */
 4813 				
 4814 
 4815 				
 4816 
 4817 			}
 4818 
 4819 			break;
 4820 			case 26: {
 4821 
 4822 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4823 				
 4824 
 4825 				/* content: static int vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *vt)*/
 4826 				/* LDV_COMMENT_BEGIN_PREP */
 4827 				#define DRIVER_AUTHOR					\
 4828 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4829 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4830 				#define DRIVER_NAME "usbvision"
 4831 				#define DRIVER_ALIAS "USBVision"
 4832 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4833 				#define DRIVER_LICENSE "GPL"
 4834 				#define USBVISION_VERSION_STRING "0.9.11"
 4835 				#define	ENABLE_HEXDUMP	0	
 4836 				#ifdef USBVISION_DEBUG
 4837 				#define PDEBUG(level, fmt, args...) { \
 4838 		if (video_debug & (level)) \
 4839 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4840 				__func__, __LINE__ , ## args); \
 4841 	}
 4842 				#else
 4843 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4844 				#endif
 4845 				#define DBG_IO		(1 << 1)
 4846 				#define DBG_PROBE	(1 << 2)
 4847 				#define DBG_MMAP	(1 << 3)
 4848 				#define rmspace(str)	while (*str == ' ') str++;
 4849 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4850 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4851 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4852 				#endif
 4853 				/* LDV_COMMENT_END_PREP */
 4854 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_tuner" from driver structure with callbacks "usbvision_ioctl_ops" */
 4855 				ldv_handler_precall();
 4856 				vidioc_s_tuner( var_group1, var_vidioc_s_tuner_23_p1, var_vidioc_s_tuner_23_p2);
 4857 				/* LDV_COMMENT_BEGIN_PREP */
 4858 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4859 				#endif
 4860 				/* LDV_COMMENT_END_PREP */
 4861 				
 4862 
 4863 				
 4864 
 4865 			}
 4866 
 4867 			break;
 4868 			case 27: {
 4869 
 4870 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4871 				
 4872 
 4873 				/* content: static int vidioc_g_frequency(struct file *file, void *priv, struct v4l2_frequency *freq)*/
 4874 				/* LDV_COMMENT_BEGIN_PREP */
 4875 				#define DRIVER_AUTHOR					\
 4876 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4877 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4878 				#define DRIVER_NAME "usbvision"
 4879 				#define DRIVER_ALIAS "USBVision"
 4880 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4881 				#define DRIVER_LICENSE "GPL"
 4882 				#define USBVISION_VERSION_STRING "0.9.11"
 4883 				#define	ENABLE_HEXDUMP	0	
 4884 				#ifdef USBVISION_DEBUG
 4885 				#define PDEBUG(level, fmt, args...) { \
 4886 		if (video_debug & (level)) \
 4887 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4888 				__func__, __LINE__ , ## args); \
 4889 	}
 4890 				#else
 4891 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4892 				#endif
 4893 				#define DBG_IO		(1 << 1)
 4894 				#define DBG_PROBE	(1 << 2)
 4895 				#define DBG_MMAP	(1 << 3)
 4896 				#define rmspace(str)	while (*str == ' ') str++;
 4897 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4898 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4899 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4900 				#endif
 4901 				/* LDV_COMMENT_END_PREP */
 4902 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_frequency" from driver structure with callbacks "usbvision_ioctl_ops" */
 4903 				ldv_handler_precall();
 4904 				vidioc_g_frequency( var_group1, var_vidioc_g_frequency_24_p1, var_vidioc_g_frequency_24_p2);
 4905 				/* LDV_COMMENT_BEGIN_PREP */
 4906 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4907 				#endif
 4908 				/* LDV_COMMENT_END_PREP */
 4909 				
 4910 
 4911 				
 4912 
 4913 			}
 4914 
 4915 			break;
 4916 			case 28: {
 4917 
 4918 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4919 				
 4920 
 4921 				/* content: static int vidioc_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *freq)*/
 4922 				/* LDV_COMMENT_BEGIN_PREP */
 4923 				#define DRIVER_AUTHOR					\
 4924 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4925 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4926 				#define DRIVER_NAME "usbvision"
 4927 				#define DRIVER_ALIAS "USBVision"
 4928 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4929 				#define DRIVER_LICENSE "GPL"
 4930 				#define USBVISION_VERSION_STRING "0.9.11"
 4931 				#define	ENABLE_HEXDUMP	0	
 4932 				#ifdef USBVISION_DEBUG
 4933 				#define PDEBUG(level, fmt, args...) { \
 4934 		if (video_debug & (level)) \
 4935 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4936 				__func__, __LINE__ , ## args); \
 4937 	}
 4938 				#else
 4939 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4940 				#endif
 4941 				#define DBG_IO		(1 << 1)
 4942 				#define DBG_PROBE	(1 << 2)
 4943 				#define DBG_MMAP	(1 << 3)
 4944 				#define rmspace(str)	while (*str == ' ') str++;
 4945 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4946 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4947 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4948 				#endif
 4949 				/* LDV_COMMENT_END_PREP */
 4950 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_frequency" from driver structure with callbacks "usbvision_ioctl_ops" */
 4951 				ldv_handler_precall();
 4952 				vidioc_s_frequency( var_group1, var_vidioc_s_frequency_25_p1, var_vidioc_s_frequency_25_p2);
 4953 				/* LDV_COMMENT_BEGIN_PREP */
 4954 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4955 				#endif
 4956 				/* LDV_COMMENT_END_PREP */
 4957 				
 4958 
 4959 				
 4960 
 4961 			}
 4962 
 4963 			break;
 4964 			case 29: {
 4965 
 4966 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 4967 				
 4968 
 4969 				/* content: static int vidioc_g_register(struct file *file, void *priv, struct v4l2_dbg_register *reg)*/
 4970 				/* LDV_COMMENT_BEGIN_PREP */
 4971 				#define DRIVER_AUTHOR					\
 4972 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 4973 	"Dwaine Garden <DwaineGarden@rogers.com>"
 4974 				#define DRIVER_NAME "usbvision"
 4975 				#define DRIVER_ALIAS "USBVision"
 4976 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 4977 				#define DRIVER_LICENSE "GPL"
 4978 				#define USBVISION_VERSION_STRING "0.9.11"
 4979 				#define	ENABLE_HEXDUMP	0	
 4980 				#ifdef USBVISION_DEBUG
 4981 				#define PDEBUG(level, fmt, args...) { \
 4982 		if (video_debug & (level)) \
 4983 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 4984 				__func__, __LINE__ , ## args); \
 4985 	}
 4986 				#else
 4987 				#define PDEBUG(level, fmt, args...) do {} while (0)
 4988 				#endif
 4989 				#define DBG_IO		(1 << 1)
 4990 				#define DBG_PROBE	(1 << 2)
 4991 				#define DBG_MMAP	(1 << 3)
 4992 				#define rmspace(str)	while (*str == ' ') str++;
 4993 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 4994 				#define YES_NO(x) ((x) ? "Yes" : "No")
 4995 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 4996 				/* LDV_COMMENT_END_PREP */
 4997 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_register" from driver structure with callbacks "usbvision_ioctl_ops" */
 4998 				ldv_handler_precall();
 4999 				vidioc_g_register( var_group1, var_vidioc_g_register_14_p1, var_vidioc_g_register_14_p2);
 5000 				/* LDV_COMMENT_BEGIN_PREP */
 5001 				#endif
 5002 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5003 				#endif
 5004 				/* LDV_COMMENT_END_PREP */
 5005 				
 5006 
 5007 				
 5008 
 5009 			}
 5010 
 5011 			break;
 5012 			case 30: {
 5013 
 5014 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_ioctl_ops **/
 5015 				
 5016 
 5017 				/* content: static int vidioc_s_register(struct file *file, void *priv, const struct v4l2_dbg_register *reg)*/
 5018 				/* LDV_COMMENT_BEGIN_PREP */
 5019 				#define DRIVER_AUTHOR					\
 5020 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5021 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5022 				#define DRIVER_NAME "usbvision"
 5023 				#define DRIVER_ALIAS "USBVision"
 5024 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5025 				#define DRIVER_LICENSE "GPL"
 5026 				#define USBVISION_VERSION_STRING "0.9.11"
 5027 				#define	ENABLE_HEXDUMP	0	
 5028 				#ifdef USBVISION_DEBUG
 5029 				#define PDEBUG(level, fmt, args...) { \
 5030 		if (video_debug & (level)) \
 5031 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5032 				__func__, __LINE__ , ## args); \
 5033 	}
 5034 				#else
 5035 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5036 				#endif
 5037 				#define DBG_IO		(1 << 1)
 5038 				#define DBG_PROBE	(1 << 2)
 5039 				#define DBG_MMAP	(1 << 3)
 5040 				#define rmspace(str)	while (*str == ' ') str++;
 5041 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5042 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5043 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5044 				/* LDV_COMMENT_END_PREP */
 5045 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_register" from driver structure with callbacks "usbvision_ioctl_ops" */
 5046 				ldv_handler_precall();
 5047 				vidioc_s_register( var_group1, var_vidioc_s_register_15_p1, var_vidioc_s_register_15_p2);
 5048 				/* LDV_COMMENT_BEGIN_PREP */
 5049 				#endif
 5050 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5051 				#endif
 5052 				/* LDV_COMMENT_END_PREP */
 5053 				
 5054 
 5055 				
 5056 
 5057 			}
 5058 
 5059 			break;
 5060 			case 31: {
 5061 
 5062 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_radio_fops **/
 5063 				if(ldv_s_usbvision_radio_fops_v4l2_file_operations==0) {
 5064 
 5065 				/* content: static int usbvision_radio_open(struct file *file)*/
 5066 				/* LDV_COMMENT_BEGIN_PREP */
 5067 				#define DRIVER_AUTHOR					\
 5068 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5069 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5070 				#define DRIVER_NAME "usbvision"
 5071 				#define DRIVER_ALIAS "USBVision"
 5072 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5073 				#define DRIVER_LICENSE "GPL"
 5074 				#define USBVISION_VERSION_STRING "0.9.11"
 5075 				#define	ENABLE_HEXDUMP	0	
 5076 				#ifdef USBVISION_DEBUG
 5077 				#define PDEBUG(level, fmt, args...) { \
 5078 		if (video_debug & (level)) \
 5079 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5080 				__func__, __LINE__ , ## args); \
 5081 	}
 5082 				#else
 5083 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5084 				#endif
 5085 				#define DBG_IO		(1 << 1)
 5086 				#define DBG_PROBE	(1 << 2)
 5087 				#define DBG_MMAP	(1 << 3)
 5088 				#define rmspace(str)	while (*str == ' ') str++;
 5089 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5090 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5091 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5092 				#endif
 5093 				/* LDV_COMMENT_END_PREP */
 5094 				/* LDV_COMMENT_FUNCTION_CALL Function from field "open" from driver structure with callbacks "usbvision_radio_fops". Standart function test for correct return result. */
 5095 				ldv_handler_precall();
 5096 				res_usbvision_radio_open_45 = usbvision_radio_open( var_group1);
 5097 				 ldv_check_return_value(res_usbvision_radio_open_45);
 5098 				 if(res_usbvision_radio_open_45) 
 5099 					goto ldv_module_exit;
 5100 				/* LDV_COMMENT_BEGIN_PREP */
 5101 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5102 				#endif
 5103 				/* LDV_COMMENT_END_PREP */
 5104 				ldv_s_usbvision_radio_fops_v4l2_file_operations++;
 5105 
 5106 				}
 5107 
 5108 			}
 5109 
 5110 			break;
 5111 			case 32: {
 5112 
 5113 				/** STRUCT: struct type: v4l2_file_operations, struct name: usbvision_radio_fops **/
 5114 				if(ldv_s_usbvision_radio_fops_v4l2_file_operations==1) {
 5115 
 5116 				/* content: static int usbvision_radio_close(struct file *file)*/
 5117 				/* LDV_COMMENT_BEGIN_PREP */
 5118 				#define DRIVER_AUTHOR					\
 5119 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5120 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5121 				#define DRIVER_NAME "usbvision"
 5122 				#define DRIVER_ALIAS "USBVision"
 5123 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5124 				#define DRIVER_LICENSE "GPL"
 5125 				#define USBVISION_VERSION_STRING "0.9.11"
 5126 				#define	ENABLE_HEXDUMP	0	
 5127 				#ifdef USBVISION_DEBUG
 5128 				#define PDEBUG(level, fmt, args...) { \
 5129 		if (video_debug & (level)) \
 5130 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5131 				__func__, __LINE__ , ## args); \
 5132 	}
 5133 				#else
 5134 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5135 				#endif
 5136 				#define DBG_IO		(1 << 1)
 5137 				#define DBG_PROBE	(1 << 2)
 5138 				#define DBG_MMAP	(1 << 3)
 5139 				#define rmspace(str)	while (*str == ' ') str++;
 5140 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5141 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5142 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5143 				#endif
 5144 				/* LDV_COMMENT_END_PREP */
 5145 				/* LDV_COMMENT_FUNCTION_CALL Function from field "release" from driver structure with callbacks "usbvision_radio_fops" */
 5146 				ldv_handler_precall();
 5147 				usbvision_radio_close( var_group1);
 5148 				/* LDV_COMMENT_BEGIN_PREP */
 5149 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5150 				#endif
 5151 				/* LDV_COMMENT_END_PREP */
 5152 				ldv_s_usbvision_radio_fops_v4l2_file_operations=0;
 5153 
 5154 				}
 5155 
 5156 			}
 5157 
 5158 			break;
 5159 			case 33: {
 5160 
 5161 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5162 				
 5163 
 5164 				/* content: static int vidioc_querycap(struct file *file, void *priv, struct v4l2_capability *vc)*/
 5165 				/* LDV_COMMENT_BEGIN_PREP */
 5166 				#define DRIVER_AUTHOR					\
 5167 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5168 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5169 				#define DRIVER_NAME "usbvision"
 5170 				#define DRIVER_ALIAS "USBVision"
 5171 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5172 				#define DRIVER_LICENSE "GPL"
 5173 				#define USBVISION_VERSION_STRING "0.9.11"
 5174 				#define	ENABLE_HEXDUMP	0	
 5175 				#ifdef USBVISION_DEBUG
 5176 				#define PDEBUG(level, fmt, args...) { \
 5177 		if (video_debug & (level)) \
 5178 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5179 				__func__, __LINE__ , ## args); \
 5180 	}
 5181 				#else
 5182 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5183 				#endif
 5184 				#define DBG_IO		(1 << 1)
 5185 				#define DBG_PROBE	(1 << 2)
 5186 				#define DBG_MMAP	(1 << 3)
 5187 				#define rmspace(str)	while (*str == ' ') str++;
 5188 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5189 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5190 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5191 				#endif
 5192 				/* LDV_COMMENT_END_PREP */
 5193 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_querycap" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5194 				ldv_handler_precall();
 5195 				vidioc_querycap( var_group1, var_vidioc_querycap_16_p1, var_vidioc_querycap_16_p2);
 5196 				/* LDV_COMMENT_BEGIN_PREP */
 5197 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5198 				#endif
 5199 				/* LDV_COMMENT_END_PREP */
 5200 				
 5201 
 5202 				
 5203 
 5204 			}
 5205 
 5206 			break;
 5207 			case 34: {
 5208 
 5209 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5210 				
 5211 
 5212 				/* content: static int vidioc_enum_input(struct file *file, void *priv, struct v4l2_input *vi)*/
 5213 				/* LDV_COMMENT_BEGIN_PREP */
 5214 				#define DRIVER_AUTHOR					\
 5215 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5216 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5217 				#define DRIVER_NAME "usbvision"
 5218 				#define DRIVER_ALIAS "USBVision"
 5219 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5220 				#define DRIVER_LICENSE "GPL"
 5221 				#define USBVISION_VERSION_STRING "0.9.11"
 5222 				#define	ENABLE_HEXDUMP	0	
 5223 				#ifdef USBVISION_DEBUG
 5224 				#define PDEBUG(level, fmt, args...) { \
 5225 		if (video_debug & (level)) \
 5226 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5227 				__func__, __LINE__ , ## args); \
 5228 	}
 5229 				#else
 5230 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5231 				#endif
 5232 				#define DBG_IO		(1 << 1)
 5233 				#define DBG_PROBE	(1 << 2)
 5234 				#define DBG_MMAP	(1 << 3)
 5235 				#define rmspace(str)	while (*str == ' ') str++;
 5236 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5237 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5238 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5239 				#endif
 5240 				/* LDV_COMMENT_END_PREP */
 5241 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_enum_input" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5242 				ldv_handler_precall();
 5243 				vidioc_enum_input( var_group1, var_vidioc_enum_input_17_p1, var_vidioc_enum_input_17_p2);
 5244 				/* LDV_COMMENT_BEGIN_PREP */
 5245 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5246 				#endif
 5247 				/* LDV_COMMENT_END_PREP */
 5248 				
 5249 
 5250 				
 5251 
 5252 			}
 5253 
 5254 			break;
 5255 			case 35: {
 5256 
 5257 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5258 				
 5259 
 5260 				/* content: static int vidioc_g_input(struct file *file, void *priv, unsigned int *input)*/
 5261 				/* LDV_COMMENT_BEGIN_PREP */
 5262 				#define DRIVER_AUTHOR					\
 5263 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5264 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5265 				#define DRIVER_NAME "usbvision"
 5266 				#define DRIVER_ALIAS "USBVision"
 5267 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5268 				#define DRIVER_LICENSE "GPL"
 5269 				#define USBVISION_VERSION_STRING "0.9.11"
 5270 				#define	ENABLE_HEXDUMP	0	
 5271 				#ifdef USBVISION_DEBUG
 5272 				#define PDEBUG(level, fmt, args...) { \
 5273 		if (video_debug & (level)) \
 5274 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5275 				__func__, __LINE__ , ## args); \
 5276 	}
 5277 				#else
 5278 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5279 				#endif
 5280 				#define DBG_IO		(1 << 1)
 5281 				#define DBG_PROBE	(1 << 2)
 5282 				#define DBG_MMAP	(1 << 3)
 5283 				#define rmspace(str)	while (*str == ' ') str++;
 5284 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5285 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5286 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5287 				#endif
 5288 				/* LDV_COMMENT_END_PREP */
 5289 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_input" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5290 				ldv_handler_precall();
 5291 				vidioc_g_input( var_group1, var_vidioc_g_input_18_p1, var_vidioc_g_input_18_p2);
 5292 				/* LDV_COMMENT_BEGIN_PREP */
 5293 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5294 				#endif
 5295 				/* LDV_COMMENT_END_PREP */
 5296 				
 5297 
 5298 				
 5299 
 5300 			}
 5301 
 5302 			break;
 5303 			case 36: {
 5304 
 5305 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5306 				
 5307 
 5308 				/* content: static int vidioc_s_input(struct file *file, void *priv, unsigned int input)*/
 5309 				/* LDV_COMMENT_BEGIN_PREP */
 5310 				#define DRIVER_AUTHOR					\
 5311 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5312 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5313 				#define DRIVER_NAME "usbvision"
 5314 				#define DRIVER_ALIAS "USBVision"
 5315 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5316 				#define DRIVER_LICENSE "GPL"
 5317 				#define USBVISION_VERSION_STRING "0.9.11"
 5318 				#define	ENABLE_HEXDUMP	0	
 5319 				#ifdef USBVISION_DEBUG
 5320 				#define PDEBUG(level, fmt, args...) { \
 5321 		if (video_debug & (level)) \
 5322 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5323 				__func__, __LINE__ , ## args); \
 5324 	}
 5325 				#else
 5326 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5327 				#endif
 5328 				#define DBG_IO		(1 << 1)
 5329 				#define DBG_PROBE	(1 << 2)
 5330 				#define DBG_MMAP	(1 << 3)
 5331 				#define rmspace(str)	while (*str == ' ') str++;
 5332 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5333 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5334 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5335 				#endif
 5336 				/* LDV_COMMENT_END_PREP */
 5337 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_input" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5338 				ldv_handler_precall();
 5339 				vidioc_s_input( var_group1, var_vidioc_s_input_19_p1, var_vidioc_s_input_19_p2);
 5340 				/* LDV_COMMENT_BEGIN_PREP */
 5341 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5342 				#endif
 5343 				/* LDV_COMMENT_END_PREP */
 5344 				
 5345 
 5346 				
 5347 
 5348 			}
 5349 
 5350 			break;
 5351 			case 37: {
 5352 
 5353 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5354 				
 5355 
 5356 				/* content: static int vidioc_queryctrl(struct file *file, void *priv, struct v4l2_queryctrl *ctrl)*/
 5357 				/* LDV_COMMENT_BEGIN_PREP */
 5358 				#define DRIVER_AUTHOR					\
 5359 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5360 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5361 				#define DRIVER_NAME "usbvision"
 5362 				#define DRIVER_ALIAS "USBVision"
 5363 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5364 				#define DRIVER_LICENSE "GPL"
 5365 				#define USBVISION_VERSION_STRING "0.9.11"
 5366 				#define	ENABLE_HEXDUMP	0	
 5367 				#ifdef USBVISION_DEBUG
 5368 				#define PDEBUG(level, fmt, args...) { \
 5369 		if (video_debug & (level)) \
 5370 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5371 				__func__, __LINE__ , ## args); \
 5372 	}
 5373 				#else
 5374 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5375 				#endif
 5376 				#define DBG_IO		(1 << 1)
 5377 				#define DBG_PROBE	(1 << 2)
 5378 				#define DBG_MMAP	(1 << 3)
 5379 				#define rmspace(str)	while (*str == ' ') str++;
 5380 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5381 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5382 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5383 				#endif
 5384 				/* LDV_COMMENT_END_PREP */
 5385 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_queryctrl" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5386 				ldv_handler_precall();
 5387 				vidioc_queryctrl( var_group1, var_vidioc_queryctrl_28_p1, var_vidioc_queryctrl_28_p2);
 5388 				/* LDV_COMMENT_BEGIN_PREP */
 5389 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5390 				#endif
 5391 				/* LDV_COMMENT_END_PREP */
 5392 				
 5393 
 5394 				
 5395 
 5396 			}
 5397 
 5398 			break;
 5399 			case 38: {
 5400 
 5401 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5402 				
 5403 
 5404 				/* content: static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a)*/
 5405 				/* LDV_COMMENT_BEGIN_PREP */
 5406 				#define DRIVER_AUTHOR					\
 5407 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5408 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5409 				#define DRIVER_NAME "usbvision"
 5410 				#define DRIVER_ALIAS "USBVision"
 5411 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5412 				#define DRIVER_LICENSE "GPL"
 5413 				#define USBVISION_VERSION_STRING "0.9.11"
 5414 				#define	ENABLE_HEXDUMP	0	
 5415 				#ifdef USBVISION_DEBUG
 5416 				#define PDEBUG(level, fmt, args...) { \
 5417 		if (video_debug & (level)) \
 5418 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5419 				__func__, __LINE__ , ## args); \
 5420 	}
 5421 				#else
 5422 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5423 				#endif
 5424 				#define DBG_IO		(1 << 1)
 5425 				#define DBG_PROBE	(1 << 2)
 5426 				#define DBG_MMAP	(1 << 3)
 5427 				#define rmspace(str)	while (*str == ' ') str++;
 5428 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5429 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5430 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5431 				#endif
 5432 				/* LDV_COMMENT_END_PREP */
 5433 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_audio" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5434 				ldv_handler_precall();
 5435 				vidioc_g_audio( var_group1, var_vidioc_g_audio_26_p1, var_vidioc_g_audio_26_p2);
 5436 				/* LDV_COMMENT_BEGIN_PREP */
 5437 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5438 				#endif
 5439 				/* LDV_COMMENT_END_PREP */
 5440 				
 5441 
 5442 				
 5443 
 5444 			}
 5445 
 5446 			break;
 5447 			case 39: {
 5448 
 5449 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5450 				
 5451 
 5452 				/* content: static int vidioc_s_audio(struct file *file, void *fh, const struct v4l2_audio *a)*/
 5453 				/* LDV_COMMENT_BEGIN_PREP */
 5454 				#define DRIVER_AUTHOR					\
 5455 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5456 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5457 				#define DRIVER_NAME "usbvision"
 5458 				#define DRIVER_ALIAS "USBVision"
 5459 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5460 				#define DRIVER_LICENSE "GPL"
 5461 				#define USBVISION_VERSION_STRING "0.9.11"
 5462 				#define	ENABLE_HEXDUMP	0	
 5463 				#ifdef USBVISION_DEBUG
 5464 				#define PDEBUG(level, fmt, args...) { \
 5465 		if (video_debug & (level)) \
 5466 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5467 				__func__, __LINE__ , ## args); \
 5468 	}
 5469 				#else
 5470 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5471 				#endif
 5472 				#define DBG_IO		(1 << 1)
 5473 				#define DBG_PROBE	(1 << 2)
 5474 				#define DBG_MMAP	(1 << 3)
 5475 				#define rmspace(str)	while (*str == ' ') str++;
 5476 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5477 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5478 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5479 				#endif
 5480 				/* LDV_COMMENT_END_PREP */
 5481 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_audio" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5482 				ldv_handler_precall();
 5483 				vidioc_s_audio( var_group1, var_vidioc_s_audio_27_p1, var_vidioc_s_audio_27_p2);
 5484 				/* LDV_COMMENT_BEGIN_PREP */
 5485 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5486 				#endif
 5487 				/* LDV_COMMENT_END_PREP */
 5488 				
 5489 
 5490 				
 5491 
 5492 			}
 5493 
 5494 			break;
 5495 			case 40: {
 5496 
 5497 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5498 				
 5499 
 5500 				/* content: static int vidioc_g_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 5501 				/* LDV_COMMENT_BEGIN_PREP */
 5502 				#define DRIVER_AUTHOR					\
 5503 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5504 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5505 				#define DRIVER_NAME "usbvision"
 5506 				#define DRIVER_ALIAS "USBVision"
 5507 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5508 				#define DRIVER_LICENSE "GPL"
 5509 				#define USBVISION_VERSION_STRING "0.9.11"
 5510 				#define	ENABLE_HEXDUMP	0	
 5511 				#ifdef USBVISION_DEBUG
 5512 				#define PDEBUG(level, fmt, args...) { \
 5513 		if (video_debug & (level)) \
 5514 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5515 				__func__, __LINE__ , ## args); \
 5516 	}
 5517 				#else
 5518 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5519 				#endif
 5520 				#define DBG_IO		(1 << 1)
 5521 				#define DBG_PROBE	(1 << 2)
 5522 				#define DBG_MMAP	(1 << 3)
 5523 				#define rmspace(str)	while (*str == ' ') str++;
 5524 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5525 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5526 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5527 				#endif
 5528 				/* LDV_COMMENT_END_PREP */
 5529 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_ctrl" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5530 				ldv_handler_precall();
 5531 				vidioc_g_ctrl( var_group1, var_vidioc_g_ctrl_29_p1, var_vidioc_g_ctrl_29_p2);
 5532 				/* LDV_COMMENT_BEGIN_PREP */
 5533 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5534 				#endif
 5535 				/* LDV_COMMENT_END_PREP */
 5536 				
 5537 
 5538 				
 5539 
 5540 			}
 5541 
 5542 			break;
 5543 			case 41: {
 5544 
 5545 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5546 				
 5547 
 5548 				/* content: static int vidioc_s_ctrl(struct file *file, void *priv, struct v4l2_control *ctrl)*/
 5549 				/* LDV_COMMENT_BEGIN_PREP */
 5550 				#define DRIVER_AUTHOR					\
 5551 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5552 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5553 				#define DRIVER_NAME "usbvision"
 5554 				#define DRIVER_ALIAS "USBVision"
 5555 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5556 				#define DRIVER_LICENSE "GPL"
 5557 				#define USBVISION_VERSION_STRING "0.9.11"
 5558 				#define	ENABLE_HEXDUMP	0	
 5559 				#ifdef USBVISION_DEBUG
 5560 				#define PDEBUG(level, fmt, args...) { \
 5561 		if (video_debug & (level)) \
 5562 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5563 				__func__, __LINE__ , ## args); \
 5564 	}
 5565 				#else
 5566 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5567 				#endif
 5568 				#define DBG_IO		(1 << 1)
 5569 				#define DBG_PROBE	(1 << 2)
 5570 				#define DBG_MMAP	(1 << 3)
 5571 				#define rmspace(str)	while (*str == ' ') str++;
 5572 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5573 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5574 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5575 				#endif
 5576 				/* LDV_COMMENT_END_PREP */
 5577 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_ctrl" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5578 				ldv_handler_precall();
 5579 				vidioc_s_ctrl( var_group1, var_vidioc_s_ctrl_30_p1, var_vidioc_s_ctrl_30_p2);
 5580 				/* LDV_COMMENT_BEGIN_PREP */
 5581 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5582 				#endif
 5583 				/* LDV_COMMENT_END_PREP */
 5584 				
 5585 
 5586 				
 5587 
 5588 			}
 5589 
 5590 			break;
 5591 			case 42: {
 5592 
 5593 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5594 				
 5595 
 5596 				/* content: static int vidioc_g_tuner(struct file *file, void *priv, struct v4l2_tuner *vt)*/
 5597 				/* LDV_COMMENT_BEGIN_PREP */
 5598 				#define DRIVER_AUTHOR					\
 5599 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5600 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5601 				#define DRIVER_NAME "usbvision"
 5602 				#define DRIVER_ALIAS "USBVision"
 5603 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5604 				#define DRIVER_LICENSE "GPL"
 5605 				#define USBVISION_VERSION_STRING "0.9.11"
 5606 				#define	ENABLE_HEXDUMP	0	
 5607 				#ifdef USBVISION_DEBUG
 5608 				#define PDEBUG(level, fmt, args...) { \
 5609 		if (video_debug & (level)) \
 5610 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5611 				__func__, __LINE__ , ## args); \
 5612 	}
 5613 				#else
 5614 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5615 				#endif
 5616 				#define DBG_IO		(1 << 1)
 5617 				#define DBG_PROBE	(1 << 2)
 5618 				#define DBG_MMAP	(1 << 3)
 5619 				#define rmspace(str)	while (*str == ' ') str++;
 5620 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5621 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5622 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5623 				#endif
 5624 				/* LDV_COMMENT_END_PREP */
 5625 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_tuner" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5626 				ldv_handler_precall();
 5627 				vidioc_g_tuner( var_group1, var_vidioc_g_tuner_22_p1, var_vidioc_g_tuner_22_p2);
 5628 				/* LDV_COMMENT_BEGIN_PREP */
 5629 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5630 				#endif
 5631 				/* LDV_COMMENT_END_PREP */
 5632 				
 5633 
 5634 				
 5635 
 5636 			}
 5637 
 5638 			break;
 5639 			case 43: {
 5640 
 5641 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5642 				
 5643 
 5644 				/* content: static int vidioc_s_tuner(struct file *file, void *priv, const struct v4l2_tuner *vt)*/
 5645 				/* LDV_COMMENT_BEGIN_PREP */
 5646 				#define DRIVER_AUTHOR					\
 5647 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5648 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5649 				#define DRIVER_NAME "usbvision"
 5650 				#define DRIVER_ALIAS "USBVision"
 5651 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5652 				#define DRIVER_LICENSE "GPL"
 5653 				#define USBVISION_VERSION_STRING "0.9.11"
 5654 				#define	ENABLE_HEXDUMP	0	
 5655 				#ifdef USBVISION_DEBUG
 5656 				#define PDEBUG(level, fmt, args...) { \
 5657 		if (video_debug & (level)) \
 5658 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5659 				__func__, __LINE__ , ## args); \
 5660 	}
 5661 				#else
 5662 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5663 				#endif
 5664 				#define DBG_IO		(1 << 1)
 5665 				#define DBG_PROBE	(1 << 2)
 5666 				#define DBG_MMAP	(1 << 3)
 5667 				#define rmspace(str)	while (*str == ' ') str++;
 5668 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5669 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5670 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5671 				#endif
 5672 				/* LDV_COMMENT_END_PREP */
 5673 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_tuner" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5674 				ldv_handler_precall();
 5675 				vidioc_s_tuner( var_group1, var_vidioc_s_tuner_23_p1, var_vidioc_s_tuner_23_p2);
 5676 				/* LDV_COMMENT_BEGIN_PREP */
 5677 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5678 				#endif
 5679 				/* LDV_COMMENT_END_PREP */
 5680 				
 5681 
 5682 				
 5683 
 5684 			}
 5685 
 5686 			break;
 5687 			case 44: {
 5688 
 5689 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5690 				
 5691 
 5692 				/* content: static int vidioc_g_frequency(struct file *file, void *priv, struct v4l2_frequency *freq)*/
 5693 				/* LDV_COMMENT_BEGIN_PREP */
 5694 				#define DRIVER_AUTHOR					\
 5695 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5696 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5697 				#define DRIVER_NAME "usbvision"
 5698 				#define DRIVER_ALIAS "USBVision"
 5699 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5700 				#define DRIVER_LICENSE "GPL"
 5701 				#define USBVISION_VERSION_STRING "0.9.11"
 5702 				#define	ENABLE_HEXDUMP	0	
 5703 				#ifdef USBVISION_DEBUG
 5704 				#define PDEBUG(level, fmt, args...) { \
 5705 		if (video_debug & (level)) \
 5706 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5707 				__func__, __LINE__ , ## args); \
 5708 	}
 5709 				#else
 5710 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5711 				#endif
 5712 				#define DBG_IO		(1 << 1)
 5713 				#define DBG_PROBE	(1 << 2)
 5714 				#define DBG_MMAP	(1 << 3)
 5715 				#define rmspace(str)	while (*str == ' ') str++;
 5716 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5717 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5718 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5719 				#endif
 5720 				/* LDV_COMMENT_END_PREP */
 5721 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_g_frequency" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5722 				ldv_handler_precall();
 5723 				vidioc_g_frequency( var_group1, var_vidioc_g_frequency_24_p1, var_vidioc_g_frequency_24_p2);
 5724 				/* LDV_COMMENT_BEGIN_PREP */
 5725 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5726 				#endif
 5727 				/* LDV_COMMENT_END_PREP */
 5728 				
 5729 
 5730 				
 5731 
 5732 			}
 5733 
 5734 			break;
 5735 			case 45: {
 5736 
 5737 				/** STRUCT: struct type: v4l2_ioctl_ops, struct name: usbvision_radio_ioctl_ops **/
 5738 				
 5739 
 5740 				/* content: static int vidioc_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *freq)*/
 5741 				/* LDV_COMMENT_BEGIN_PREP */
 5742 				#define DRIVER_AUTHOR					\
 5743 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5744 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5745 				#define DRIVER_NAME "usbvision"
 5746 				#define DRIVER_ALIAS "USBVision"
 5747 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5748 				#define DRIVER_LICENSE "GPL"
 5749 				#define USBVISION_VERSION_STRING "0.9.11"
 5750 				#define	ENABLE_HEXDUMP	0	
 5751 				#ifdef USBVISION_DEBUG
 5752 				#define PDEBUG(level, fmt, args...) { \
 5753 		if (video_debug & (level)) \
 5754 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5755 				__func__, __LINE__ , ## args); \
 5756 	}
 5757 				#else
 5758 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5759 				#endif
 5760 				#define DBG_IO		(1 << 1)
 5761 				#define DBG_PROBE	(1 << 2)
 5762 				#define DBG_MMAP	(1 << 3)
 5763 				#define rmspace(str)	while (*str == ' ') str++;
 5764 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5765 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5766 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5767 				#endif
 5768 				/* LDV_COMMENT_END_PREP */
 5769 				/* LDV_COMMENT_FUNCTION_CALL Function from field "vidioc_s_frequency" from driver structure with callbacks "usbvision_radio_ioctl_ops" */
 5770 				ldv_handler_precall();
 5771 				vidioc_s_frequency( var_group1, var_vidioc_s_frequency_25_p1, var_vidioc_s_frequency_25_p2);
 5772 				/* LDV_COMMENT_BEGIN_PREP */
 5773 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5774 				#endif
 5775 				/* LDV_COMMENT_END_PREP */
 5776 				
 5777 
 5778 				
 5779 
 5780 			}
 5781 
 5782 			break;
 5783 			case 46: {
 5784 
 5785 				/** STRUCT: struct type: usb_driver, struct name: usbvision_driver **/
 5786 				if(ldv_s_usbvision_driver_usb_driver==0) {
 5787 
 5788 				/* content: static int usbvision_probe(struct usb_interface *intf, const struct usb_device_id *devid)*/
 5789 				/* LDV_COMMENT_BEGIN_PREP */
 5790 				#define DRIVER_AUTHOR					\
 5791 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5792 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5793 				#define DRIVER_NAME "usbvision"
 5794 				#define DRIVER_ALIAS "USBVision"
 5795 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5796 				#define DRIVER_LICENSE "GPL"
 5797 				#define USBVISION_VERSION_STRING "0.9.11"
 5798 				#define	ENABLE_HEXDUMP	0	
 5799 				#ifdef USBVISION_DEBUG
 5800 				#define PDEBUG(level, fmt, args...) { \
 5801 		if (video_debug & (level)) \
 5802 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5803 				__func__, __LINE__ , ## args); \
 5804 	}
 5805 				#else
 5806 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5807 				#endif
 5808 				#define DBG_IO		(1 << 1)
 5809 				#define DBG_PROBE	(1 << 2)
 5810 				#define DBG_MMAP	(1 << 3)
 5811 				#define rmspace(str)	while (*str == ' ') str++;
 5812 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5813 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5814 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5815 				#endif
 5816 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5817 				#endif
 5818 				/* LDV_COMMENT_END_PREP */
 5819 				/* LDV_COMMENT_FUNCTION_CALL Function from field "probe" from driver structure with callbacks "usbvision_driver". Standart function test for correct return result. */
 5820 				res_usbvision_probe_53 = usbvision_probe( var_group3, var_usbvision_probe_53_p1);
 5821 				 ldv_check_return_value(res_usbvision_probe_53);
 5822 				 ldv_check_return_value_probe(res_usbvision_probe_53);
 5823 				 if(res_usbvision_probe_53) 
 5824 					goto ldv_module_exit;
 5825 				ldv_s_usbvision_driver_usb_driver++;
 5826 
 5827 				}
 5828 
 5829 			}
 5830 
 5831 			break;
 5832 			case 47: {
 5833 
 5834 				/** STRUCT: struct type: usb_driver, struct name: usbvision_driver **/
 5835 				if(ldv_s_usbvision_driver_usb_driver==1) {
 5836 
 5837 				/* content: static void usbvision_disconnect(struct usb_interface *intf)*/
 5838 				/* LDV_COMMENT_BEGIN_PREP */
 5839 				#define DRIVER_AUTHOR					\
 5840 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5841 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5842 				#define DRIVER_NAME "usbvision"
 5843 				#define DRIVER_ALIAS "USBVision"
 5844 				#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5845 				#define DRIVER_LICENSE "GPL"
 5846 				#define USBVISION_VERSION_STRING "0.9.11"
 5847 				#define	ENABLE_HEXDUMP	0	
 5848 				#ifdef USBVISION_DEBUG
 5849 				#define PDEBUG(level, fmt, args...) { \
 5850 		if (video_debug & (level)) \
 5851 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5852 				__func__, __LINE__ , ## args); \
 5853 	}
 5854 				#else
 5855 				#define PDEBUG(level, fmt, args...) do {} while (0)
 5856 				#endif
 5857 				#define DBG_IO		(1 << 1)
 5858 				#define DBG_PROBE	(1 << 2)
 5859 				#define DBG_MMAP	(1 << 3)
 5860 				#define rmspace(str)	while (*str == ' ') str++;
 5861 				#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5862 				#define YES_NO(x) ((x) ? "Yes" : "No")
 5863 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5864 				#endif
 5865 				#ifdef CONFIG_VIDEO_ADV_DEBUG
 5866 				#endif
 5867 				/* LDV_COMMENT_END_PREP */
 5868 				/* LDV_COMMENT_FUNCTION_CALL Function from field "disconnect" from driver structure with callbacks "usbvision_driver" */
 5869 				ldv_handler_precall();
 5870 				usbvision_disconnect( var_group3);
 5871 				ldv_s_usbvision_driver_usb_driver=0;
 5872 
 5873 				}
 5874 
 5875 			}
 5876 
 5877 			break;
 5878 			default: break;
 5879 
 5880 		}
 5881 
 5882 	}
 5883 
 5884 	ldv_module_exit: 
 5885 
 5886 	/** INIT: init_type: ST_MODULE_EXIT **/
 5887 	/* content: static void __exit usbvision_exit(void)*/
 5888 	/* LDV_COMMENT_BEGIN_PREP */
 5889 	#define DRIVER_AUTHOR					\
 5890 	"Joerg Heckenbach <joerg@heckenbach-aw.de>, "	\
 5891 	"Dwaine Garden <DwaineGarden@rogers.com>"
 5892 	#define DRIVER_NAME "usbvision"
 5893 	#define DRIVER_ALIAS "USBVision"
 5894 	#define DRIVER_DESC "USBVision USB Video Device Driver for Linux"
 5895 	#define DRIVER_LICENSE "GPL"
 5896 	#define USBVISION_VERSION_STRING "0.9.11"
 5897 	#define	ENABLE_HEXDUMP	0	
 5898 	#ifdef USBVISION_DEBUG
 5899 	#define PDEBUG(level, fmt, args...) { \
 5900 		if (video_debug & (level)) \
 5901 			printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \
 5902 				__func__, __LINE__ , ## args); \
 5903 	}
 5904 	#else
 5905 	#define PDEBUG(level, fmt, args...) do {} while (0)
 5906 	#endif
 5907 	#define DBG_IO		(1 << 1)
 5908 	#define DBG_PROBE	(1 << 2)
 5909 	#define DBG_MMAP	(1 << 3)
 5910 	#define rmspace(str)	while (*str == ' ') str++;
 5911 	#define goto2next(str)	while (*str != ' ') str++; while (*str == ' ') str++;
 5912 	#define YES_NO(x) ((x) ? "Yes" : "No")
 5913 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 5914 	#endif
 5915 	#ifdef CONFIG_VIDEO_ADV_DEBUG
 5916 	#endif
 5917 	/* LDV_COMMENT_END_PREP */
 5918 	/* LDV_COMMENT_FUNCTION_CALL Kernel calls driver release function before driver will be uploaded from kernel. This function declared as "MODULE_EXIT(function name)". */
 5919 	ldv_handler_precall();
 5920 	usbvision_exit();
 5921 
 5922 	/* LDV_COMMENT_FUNCTION_CALL Checks that all resources and locks are correctly released before the driver will be unloaded. */
 5923 	ldv_final: ldv_check_final_state();
 5924 
 5925 	/* LDV_COMMENT_END_FUNCTION_CALL_SECTION */
 5926 	return;
 5927 
 5928 }
 5929 #endif
 5930 
 5931 /* LDV_COMMENT_END_MAIN */
 5932 
 5933 #line 14 "/work/ldvuser/ref_launch/work/current--X--drivers--X--defaultlinux-4.0-rc1.tar.xz--X--132_1a--X--cpachecker/linux-4.0-rc1.tar.xz/csd_deg_dscv/8231/dscv_tempdir/dscv/ri/132_1a/drivers/media/usb/usbvision/usbvision-video.o.c.prepared"                 1 
    2 #include <verifier/rcv.h> // For LDV auxiliary routines.
    3 #include <kernel-model/ERR.inc>
    4 
    5 // There are 3 possible states of usb device reference counter
    6 enum
    7 {
    8  LDV_USB_DEV_ZERO_STATE = 0, // Usb device reference hasn't been acquired
    9  LDV_USB_DEV_INCREASED = 1 // Usb device reference counter increased
   10 };
   11 
   12 /* LDV_COMMENT_OTHER The model automaton state (one of thee possible ones). */
   13 int ldv_usb_dev_state = LDV_USB_DEV_ZERO_STATE;
   14 
   15 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_usb_get_dev') Change state after increasing the reference counter with usb_get_dev. */
   16 void ldv_usb_get_dev(void)
   17 {
   18  /* LDV_COMMENT_CHANGE_STATE Increase reference counter. */
   19  ldv_usb_dev_state++;
   20 }
   21 
   22 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_usb_put_dev') Change state after decreasing the reference counter with usb_put_dev. */
   23 void ldv_usb_put_dev(void)
   24 {
   25  /* LDV_COMMENT_ASSERT Check usb device reference counter has been increased. */
   26  ldv_assert(ldv_usb_dev_state >= LDV_USB_DEV_INCREASED);
   27  /* LDV_COMMENT_CHANGE_STATE Decrease reference counter. */
   28  ldv_usb_dev_state--;
   29 }
   30 
   31 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_check_return_value_probe') Check the probe function leaved the model in the proper state. */
   32 void ldv_check_return_value_probe(int retval)
   33 {
   34  /* LDV_COMMENT_OTHER Probe finished unsuccessfully and returned an error. */
   35  if (retval) {
   36   /* LDV_COMMENT_ASSERT Check usb device reference counter is not increased. */
   37   ldv_assert(ldv_usb_dev_state < LDV_USB_DEV_INCREASED);
   38  }
   39 }
   40 
   41 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_check_final_state') Check that usb device reference hasn't been acquired or the counter has been decreased. */
   42 void ldv_check_final_state(void)
   43 {
   44  /* LDV_COMMENT_ASSERT Check that usb device reference hasn't been acquired or the counter has been decreased. */
   45  ldv_assert(ldv_usb_dev_state < LDV_USB_DEV_INCREASED);
   46 }                 1 #ifndef _LDV_RCV_H_
    2 #define _LDV_RCV_H_
    3 
    4 /* If expr evaluates to zero, ldv_assert() causes a program to reach the error
    5    label like the standard assert(). */
    6 #define ldv_assert(expr) ((expr) ? 0 : ldv_error())
    7 
    8 /* The error label wrapper. It is used because of some static verifiers (like
    9    BLAST) don't accept multiple error labels through a program. */
   10 static inline void ldv_error(void)
   11 {
   12   LDV_ERROR: goto LDV_ERROR;
   13 }
   14 
   15 /* If expr evaluates to zero, ldv_assume() causes an infinite loop that is
   16    avoided by verifiers. */
   17 #define ldv_assume(expr) ((expr) ? 0 : ldv_stop())
   18 
   19 /* Infinite loop, that causes verifiers to skip such paths. */
   20 static inline void ldv_stop(void) {
   21   LDV_STOP: goto LDV_STOP;
   22 }
   23 
   24 /* Special nondeterministic functions. */
   25 int ldv_undef_int(void);
   26 void *ldv_undef_ptr(void);
   27 unsigned long ldv_undef_ulong(void);
   28 long ldv_undef_long(void);
   29 /* Return nondeterministic negative integer number. */
   30 static inline int ldv_undef_int_negative(void)
   31 {
   32   int ret = ldv_undef_int();
   33 
   34   ldv_assume(ret < 0);
   35 
   36   return ret;
   37 }
   38 /* Return nondeterministic nonpositive integer number. */
   39 static inline int ldv_undef_int_nonpositive(void)
   40 {
   41   int ret = ldv_undef_int();
   42 
   43   ldv_assume(ret <= 0);
   44 
   45   return ret;
   46 }
   47 
   48 /* Add explicit model for __builin_expect GCC function. Without the model a
   49    return value will be treated as nondetermined by verifiers. */
   50 long __builtin_expect(long exp, long c)
   51 {
   52   return exp;
   53 }
   54 
   55 /* This function causes the program to exit abnormally. GCC implements this
   56 function by using a target-dependent mechanism (such as intentionally executing
   57 an illegal instruction) or by calling abort. The mechanism used may vary from
   58 release to release so you should not rely on any particular implementation.
   59 http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */
   60 void __builtin_trap(void)
   61 {
   62   ldv_assert(0);
   63 }
   64 
   65 /* The constant is for simulating an error of ldv_undef_ptr() function. */
   66 #define LDV_PTR_MAX 2012
   67 
   68 #endif /* _LDV_RCV_H_ */                 1 /*
    2  * Written by Mark Hemment, 1996 (markhe@nextd.demon.co.uk).
    3  *
    4  * (C) SGI 2006, Christoph Lameter
    5  * 	Cleaned up and restructured to ease the addition of alternative
    6  * 	implementations of SLAB allocators.
    7  * (C) Linux Foundation 2008-2013
    8  *      Unified interface for all slab allocators
    9  */
   10 
   11 #ifndef _LINUX_SLAB_H
   12 #define	_LINUX_SLAB_H
   13 
   14 #include <linux/gfp.h>
   15 #include <linux/types.h>
   16 #include <linux/workqueue.h>
   17 
   18 
   19 /*
   20  * Flags to pass to kmem_cache_create().
   21  * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set.
   22  */
   23 #define SLAB_DEBUG_FREE		0x00000100UL	/* DEBUG: Perform (expensive) checks on free */
   24 #define SLAB_RED_ZONE		0x00000400UL	/* DEBUG: Red zone objs in a cache */
   25 #define SLAB_POISON		0x00000800UL	/* DEBUG: Poison objects */
   26 #define SLAB_HWCACHE_ALIGN	0x00002000UL	/* Align objs on cache lines */
   27 #define SLAB_CACHE_DMA		0x00004000UL	/* Use GFP_DMA memory */
   28 #define SLAB_STORE_USER		0x00010000UL	/* DEBUG: Store the last owner for bug hunting */
   29 #define SLAB_PANIC		0x00040000UL	/* Panic if kmem_cache_create() fails */
   30 /*
   31  * SLAB_DESTROY_BY_RCU - **WARNING** READ THIS!
   32  *
   33  * This delays freeing the SLAB page by a grace period, it does _NOT_
   34  * delay object freeing. This means that if you do kmem_cache_free()
   35  * that memory location is free to be reused at any time. Thus it may
   36  * be possible to see another object there in the same RCU grace period.
   37  *
   38  * This feature only ensures the memory location backing the object
   39  * stays valid, the trick to using this is relying on an independent
   40  * object validation pass. Something like:
   41  *
   42  *  rcu_read_lock()
   43  * again:
   44  *  obj = lockless_lookup(key);
   45  *  if (obj) {
   46  *    if (!try_get_ref(obj)) // might fail for free objects
   47  *      goto again;
   48  *
   49  *    if (obj->key != key) { // not the object we expected
   50  *      put_ref(obj);
   51  *      goto again;
   52  *    }
   53  *  }
   54  *  rcu_read_unlock();
   55  *
   56  * This is useful if we need to approach a kernel structure obliquely,
   57  * from its address obtained without the usual locking. We can lock
   58  * the structure to stabilize it and check it's still at the given address,
   59  * only if we can be sure that the memory has not been meanwhile reused
   60  * for some other kind of object (which our subsystem's lock might corrupt).
   61  *
   62  * rcu_read_lock before reading the address, then rcu_read_unlock after
   63  * taking the spinlock within the structure expected at that address.
   64  */
   65 #define SLAB_DESTROY_BY_RCU	0x00080000UL	/* Defer freeing slabs to RCU */
   66 #define SLAB_MEM_SPREAD		0x00100000UL	/* Spread some memory over cpuset */
   67 #define SLAB_TRACE		0x00200000UL	/* Trace allocations and frees */
   68 
   69 /* Flag to prevent checks on free */
   70 #ifdef CONFIG_DEBUG_OBJECTS
   71 # define SLAB_DEBUG_OBJECTS	0x00400000UL
   72 #else
   73 # define SLAB_DEBUG_OBJECTS	0x00000000UL
   74 #endif
   75 
   76 #define SLAB_NOLEAKTRACE	0x00800000UL	/* Avoid kmemleak tracing */
   77 
   78 /* Don't track use of uninitialized memory */
   79 #ifdef CONFIG_KMEMCHECK
   80 # define SLAB_NOTRACK		0x01000000UL
   81 #else
   82 # define SLAB_NOTRACK		0x00000000UL
   83 #endif
   84 #ifdef CONFIG_FAILSLAB
   85 # define SLAB_FAILSLAB		0x02000000UL	/* Fault injection mark */
   86 #else
   87 # define SLAB_FAILSLAB		0x00000000UL
   88 #endif
   89 
   90 /* The following flags affect the page allocator grouping pages by mobility */
   91 #define SLAB_RECLAIM_ACCOUNT	0x00020000UL		/* Objects are reclaimable */
   92 #define SLAB_TEMPORARY		SLAB_RECLAIM_ACCOUNT	/* Objects are short-lived */
   93 /*
   94  * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests.
   95  *
   96  * Dereferencing ZERO_SIZE_PTR will lead to a distinct access fault.
   97  *
   98  * ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can.
   99  * Both make kfree a no-op.
  100  */
  101 #define ZERO_SIZE_PTR ((void *)16)
  102 
  103 #define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= \
  104 				(unsigned long)ZERO_SIZE_PTR)
  105 
  106 #include <linux/kmemleak.h>
  107 #include <linux/kasan.h>
  108 
  109 struct mem_cgroup;
  110 /*
  111  * struct kmem_cache related prototypes
  112  */
  113 void __init kmem_cache_init(void);
  114 int slab_is_available(void);
  115 
  116 struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
  117 			unsigned long,
  118 			void (*)(void *));
  119 void kmem_cache_destroy(struct kmem_cache *);
  120 int kmem_cache_shrink(struct kmem_cache *);
  121 
  122 void memcg_create_kmem_cache(struct mem_cgroup *, struct kmem_cache *);
  123 void memcg_deactivate_kmem_caches(struct mem_cgroup *);
  124 void memcg_destroy_kmem_caches(struct mem_cgroup *);
  125 
  126 /*
  127  * Please use this macro to create slab caches. Simply specify the
  128  * name of the structure and maybe some flags that are listed above.
  129  *
  130  * The alignment of the struct determines object alignment. If you
  131  * f.e. add ____cacheline_aligned_in_smp to the struct declaration
  132  * then the objects will be properly aligned in SMP configurations.
  133  */
  134 #define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\
  135 		sizeof(struct __struct), __alignof__(struct __struct),\
  136 		(__flags), NULL)
  137 
  138 /*
  139  * Common kmalloc functions provided by all allocators
  140  */
  141 void * __must_check __krealloc(const void *, size_t, gfp_t);
  142 void * __must_check krealloc(const void *, size_t, gfp_t);
  143 void kfree(const void *);
  144 void kzfree(const void *);
  145 size_t ksize(const void *);
  146 
  147 /*
  148  * Some archs want to perform DMA into kmalloc caches and need a guaranteed
  149  * alignment larger than the alignment of a 64-bit integer.
  150  * Setting ARCH_KMALLOC_MINALIGN in arch headers allows that.
  151  */
  152 #if defined(ARCH_DMA_MINALIGN) && ARCH_DMA_MINALIGN > 8
  153 #define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
  154 #define KMALLOC_MIN_SIZE ARCH_DMA_MINALIGN
  155 #define KMALLOC_SHIFT_LOW ilog2(ARCH_DMA_MINALIGN)
  156 #else
  157 #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
  158 #endif
  159 
  160 /*
  161  * Kmalloc array related definitions
  162  */
  163 
  164 #ifdef CONFIG_SLAB
  165 /*
  166  * The largest kmalloc size supported by the SLAB allocators is
  167  * 32 megabyte (2^25) or the maximum allocatable page order if that is
  168  * less than 32 MB.
  169  *
  170  * WARNING: Its not easy to increase this value since the allocators have
  171  * to do various tricks to work around compiler limitations in order to
  172  * ensure proper constant folding.
  173  */
  174 #define KMALLOC_SHIFT_HIGH	((MAX_ORDER + PAGE_SHIFT - 1) <= 25 ? \
  175 				(MAX_ORDER + PAGE_SHIFT - 1) : 25)
  176 #define KMALLOC_SHIFT_MAX	KMALLOC_SHIFT_HIGH
  177 #ifndef KMALLOC_SHIFT_LOW
  178 #define KMALLOC_SHIFT_LOW	5
  179 #endif
  180 #endif
  181 
  182 #ifdef CONFIG_SLUB
  183 /*
  184  * SLUB directly allocates requests fitting in to an order-1 page
  185  * (PAGE_SIZE*2).  Larger requests are passed to the page allocator.
  186  */
  187 #define KMALLOC_SHIFT_HIGH	(PAGE_SHIFT + 1)
  188 #define KMALLOC_SHIFT_MAX	(MAX_ORDER + PAGE_SHIFT)
  189 #ifndef KMALLOC_SHIFT_LOW
  190 #define KMALLOC_SHIFT_LOW	3
  191 #endif
  192 #endif
  193 
  194 #ifdef CONFIG_SLOB
  195 /*
  196  * SLOB passes all requests larger than one page to the page allocator.
  197  * No kmalloc array is necessary since objects of different sizes can
  198  * be allocated from the same page.
  199  */
  200 #define KMALLOC_SHIFT_HIGH	PAGE_SHIFT
  201 #define KMALLOC_SHIFT_MAX	30
  202 #ifndef KMALLOC_SHIFT_LOW
  203 #define KMALLOC_SHIFT_LOW	3
  204 #endif
  205 #endif
  206 
  207 /* Maximum allocatable size */
  208 #define KMALLOC_MAX_SIZE	(1UL << KMALLOC_SHIFT_MAX)
  209 /* Maximum size for which we actually use a slab cache */
  210 #define KMALLOC_MAX_CACHE_SIZE	(1UL << KMALLOC_SHIFT_HIGH)
  211 /* Maximum order allocatable via the slab allocagtor */
  212 #define KMALLOC_MAX_ORDER	(KMALLOC_SHIFT_MAX - PAGE_SHIFT)
  213 
  214 /*
  215  * Kmalloc subsystem.
  216  */
  217 #ifndef KMALLOC_MIN_SIZE
  218 #define KMALLOC_MIN_SIZE (1 << KMALLOC_SHIFT_LOW)
  219 #endif
  220 
  221 /*
  222  * This restriction comes from byte sized index implementation.
  223  * Page size is normally 2^12 bytes and, in this case, if we want to use
  224  * byte sized index which can represent 2^8 entries, the size of the object
  225  * should be equal or greater to 2^12 / 2^8 = 2^4 = 16.
  226  * If minimum size of kmalloc is less than 16, we use it as minimum object
  227  * size and give up to use byte sized index.
  228  */
  229 #define SLAB_OBJ_MIN_SIZE      (KMALLOC_MIN_SIZE < 16 ? \
  230                                (KMALLOC_MIN_SIZE) : 16)
  231 
  232 #ifndef CONFIG_SLOB
  233 extern struct kmem_cache *kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
  234 #ifdef CONFIG_ZONE_DMA
  235 extern struct kmem_cache *kmalloc_dma_caches[KMALLOC_SHIFT_HIGH + 1];
  236 #endif
  237 
  238 /*
  239  * Figure out which kmalloc slab an allocation of a certain size
  240  * belongs to.
  241  * 0 = zero alloc
  242  * 1 =  65 .. 96 bytes
  243  * 2 = 120 .. 192 bytes
  244  * n = 2^(n-1) .. 2^n -1
  245  */
  246 static __always_inline int kmalloc_index(size_t size)
  247 {
  248 	if (!size)
  249 		return 0;
  250 
  251 	if (size <= KMALLOC_MIN_SIZE)
  252 		return KMALLOC_SHIFT_LOW;
  253 
  254 	if (KMALLOC_MIN_SIZE <= 32 && size > 64 && size <= 96)
  255 		return 1;
  256 	if (KMALLOC_MIN_SIZE <= 64 && size > 128 && size <= 192)
  257 		return 2;
  258 	if (size <=          8) return 3;
  259 	if (size <=         16) return 4;
  260 	if (size <=         32) return 5;
  261 	if (size <=         64) return 6;
  262 	if (size <=        128) return 7;
  263 	if (size <=        256) return 8;
  264 	if (size <=        512) return 9;
  265 	if (size <=       1024) return 10;
  266 	if (size <=   2 * 1024) return 11;
  267 	if (size <=   4 * 1024) return 12;
  268 	if (size <=   8 * 1024) return 13;
  269 	if (size <=  16 * 1024) return 14;
  270 	if (size <=  32 * 1024) return 15;
  271 	if (size <=  64 * 1024) return 16;
  272 	if (size <= 128 * 1024) return 17;
  273 	if (size <= 256 * 1024) return 18;
  274 	if (size <= 512 * 1024) return 19;
  275 	if (size <= 1024 * 1024) return 20;
  276 	if (size <=  2 * 1024 * 1024) return 21;
  277 	if (size <=  4 * 1024 * 1024) return 22;
  278 	if (size <=  8 * 1024 * 1024) return 23;
  279 	if (size <=  16 * 1024 * 1024) return 24;
  280 	if (size <=  32 * 1024 * 1024) return 25;
  281 	if (size <=  64 * 1024 * 1024) return 26;
  282 	BUG();
  283 
  284 	/* Will never be reached. Needed because the compiler may complain */
  285 	return -1;
  286 }
  287 #endif /* !CONFIG_SLOB */
  288 
  289 void *__kmalloc(size_t size, gfp_t flags);
  290 void *kmem_cache_alloc(struct kmem_cache *, gfp_t flags);
  291 void kmem_cache_free(struct kmem_cache *, void *);
  292 
  293 #ifdef CONFIG_NUMA
  294 void *__kmalloc_node(size_t size, gfp_t flags, int node);
  295 void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
  296 #else
  297 static __always_inline void *__kmalloc_node(size_t size, gfp_t flags, int node)
  298 {
  299 	return __kmalloc(size, flags);
  300 }
  301 
  302 static __always_inline void *kmem_cache_alloc_node(struct kmem_cache *s, gfp_t flags, int node)
  303 {
  304 	return kmem_cache_alloc(s, flags);
  305 }
  306 #endif
  307 
  308 #ifdef CONFIG_TRACING
  309 extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t, size_t);
  310 
  311 #ifdef CONFIG_NUMA
  312 extern void *kmem_cache_alloc_node_trace(struct kmem_cache *s,
  313 					   gfp_t gfpflags,
  314 					   int node, size_t size);
  315 #else
  316 static __always_inline void *
  317 kmem_cache_alloc_node_trace(struct kmem_cache *s,
  318 			      gfp_t gfpflags,
  319 			      int node, size_t size)
  320 {
  321 	return kmem_cache_alloc_trace(s, gfpflags, size);
  322 }
  323 #endif /* CONFIG_NUMA */
  324 
  325 #else /* CONFIG_TRACING */
  326 static __always_inline void *kmem_cache_alloc_trace(struct kmem_cache *s,
  327 		gfp_t flags, size_t size)
  328 {
  329 	void *ret = kmem_cache_alloc(s, flags);
  330 
  331 	kasan_kmalloc(s, ret, size);
  332 	return ret;
  333 }
  334 
  335 static __always_inline void *
  336 kmem_cache_alloc_node_trace(struct kmem_cache *s,
  337 			      gfp_t gfpflags,
  338 			      int node, size_t size)
  339 {
  340 	void *ret = kmem_cache_alloc_node(s, gfpflags, node);
  341 
  342 	kasan_kmalloc(s, ret, size);
  343 	return ret;
  344 }
  345 #endif /* CONFIG_TRACING */
  346 
  347 extern void *kmalloc_order(size_t size, gfp_t flags, unsigned int order);
  348 
  349 #ifdef CONFIG_TRACING
  350 extern void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order);
  351 #else
  352 static __always_inline void *
  353 kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order)
  354 {
  355 	return kmalloc_order(size, flags, order);
  356 }
  357 #endif
  358 
  359 static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
  360 {
  361 	unsigned int order = get_order(size);
  362 	return kmalloc_order_trace(size, flags, order);
  363 }
  364 
  365 /**
  366  * kmalloc - allocate memory
  367  * @size: how many bytes of memory are required.
  368  * @flags: the type of memory to allocate.
  369  *
  370  * kmalloc is the normal method of allocating memory
  371  * for objects smaller than page size in the kernel.
  372  *
  373  * The @flags argument may be one of:
  374  *
  375  * %GFP_USER - Allocate memory on behalf of user.  May sleep.
  376  *
  377  * %GFP_KERNEL - Allocate normal kernel ram.  May sleep.
  378  *
  379  * %GFP_ATOMIC - Allocation will not sleep.  May use emergency pools.
  380  *   For example, use this inside interrupt handlers.
  381  *
  382  * %GFP_HIGHUSER - Allocate pages from high memory.
  383  *
  384  * %GFP_NOIO - Do not do any I/O at all while trying to get memory.
  385  *
  386  * %GFP_NOFS - Do not make any fs calls while trying to get memory.
  387  *
  388  * %GFP_NOWAIT - Allocation will not sleep.
  389  *
  390  * %__GFP_THISNODE - Allocate node-local memory only.
  391  *
  392  * %GFP_DMA - Allocation suitable for DMA.
  393  *   Should only be used for kmalloc() caches. Otherwise, use a
  394  *   slab created with SLAB_DMA.
  395  *
  396  * Also it is possible to set different flags by OR'ing
  397  * in one or more of the following additional @flags:
  398  *
  399  * %__GFP_COLD - Request cache-cold pages instead of
  400  *   trying to return cache-warm pages.
  401  *
  402  * %__GFP_HIGH - This allocation has high priority and may use emergency pools.
  403  *
  404  * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail
  405  *   (think twice before using).
  406  *
  407  * %__GFP_NORETRY - If memory is not immediately available,
  408  *   then give up at once.
  409  *
  410  * %__GFP_NOWARN - If allocation fails, don't issue any warnings.
  411  *
  412  * %__GFP_REPEAT - If allocation fails initially, try once more before failing.
  413  *
  414  * There are other flags available as well, but these are not intended
  415  * for general use, and so are not documented here. For a full list of
  416  * potential flags, always refer to linux/gfp.h.
  417  */
  418 static __always_inline void *kmalloc(size_t size, gfp_t flags)
  419 {
  420 	if (__builtin_constant_p(size)) {
  421 		if (size > KMALLOC_MAX_CACHE_SIZE)
  422 			return kmalloc_large(size, flags);
  423 #ifndef CONFIG_SLOB
  424 		if (!(flags & GFP_DMA)) {
  425 			int index = kmalloc_index(size);
  426 
  427 			if (!index)
  428 				return ZERO_SIZE_PTR;
  429 
  430 			return kmem_cache_alloc_trace(kmalloc_caches[index],
  431 					flags, size);
  432 		}
  433 #endif
  434 	}
  435 	return __kmalloc(size, flags);
  436 }
  437 
  438 /*
  439  * Determine size used for the nth kmalloc cache.
  440  * return size or 0 if a kmalloc cache for that
  441  * size does not exist
  442  */
  443 static __always_inline int kmalloc_size(int n)
  444 {
  445 #ifndef CONFIG_SLOB
  446 	if (n > 2)
  447 		return 1 << n;
  448 
  449 	if (n == 1 && KMALLOC_MIN_SIZE <= 32)
  450 		return 96;
  451 
  452 	if (n == 2 && KMALLOC_MIN_SIZE <= 64)
  453 		return 192;
  454 #endif
  455 	return 0;
  456 }
  457 
  458 static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
  459 {
  460 #ifndef CONFIG_SLOB
  461 	if (__builtin_constant_p(size) &&
  462 		size <= KMALLOC_MAX_CACHE_SIZE && !(flags & GFP_DMA)) {
  463 		int i = kmalloc_index(size);
  464 
  465 		if (!i)
  466 			return ZERO_SIZE_PTR;
  467 
  468 		return kmem_cache_alloc_node_trace(kmalloc_caches[i],
  469 						flags, node, size);
  470 	}
  471 #endif
  472 	return __kmalloc_node(size, flags, node);
  473 }
  474 
  475 /*
  476  * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment.
  477  * Intended for arches that get misalignment faults even for 64 bit integer
  478  * aligned buffers.
  479  */
  480 #ifndef ARCH_SLAB_MINALIGN
  481 #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
  482 #endif
  483 
  484 struct memcg_cache_array {
  485 	struct rcu_head rcu;
  486 	struct kmem_cache *entries[0];
  487 };
  488 
  489 /*
  490  * This is the main placeholder for memcg-related information in kmem caches.
  491  * Both the root cache and the child caches will have it. For the root cache,
  492  * this will hold a dynamically allocated array large enough to hold
  493  * information about the currently limited memcgs in the system. To allow the
  494  * array to be accessed without taking any locks, on relocation we free the old
  495  * version only after a grace period.
  496  *
  497  * Child caches will hold extra metadata needed for its operation. Fields are:
  498  *
  499  * @memcg: pointer to the memcg this cache belongs to
  500  * @root_cache: pointer to the global, root cache, this cache was derived from
  501  *
  502  * Both root and child caches of the same kind are linked into a list chained
  503  * through @list.
  504  */
  505 struct memcg_cache_params {
  506 	bool is_root_cache;
  507 	struct list_head list;
  508 	union {
  509 		struct memcg_cache_array __rcu *memcg_caches;
  510 		struct {
  511 			struct mem_cgroup *memcg;
  512 			struct kmem_cache *root_cache;
  513 		};
  514 	};
  515 };
  516 
  517 int memcg_update_all_caches(int num_memcgs);
  518 
  519 /**
  520  * kmalloc_array - allocate memory for an array.
  521  * @n: number of elements.
  522  * @size: element size.
  523  * @flags: the type of memory to allocate (see kmalloc).
  524  */
  525 static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags)
  526 {
  527 	if (size != 0 && n > SIZE_MAX / size)
  528 		return NULL;
  529 	return __kmalloc(n * size, flags);
  530 }
  531 
  532 /**
  533  * kcalloc - allocate memory for an array. The memory is set to zero.
  534  * @n: number of elements.
  535  * @size: element size.
  536  * @flags: the type of memory to allocate (see kmalloc).
  537  */
  538 static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
  539 {
  540 	return kmalloc_array(n, size, flags | __GFP_ZERO);
  541 }
  542 
  543 /*
  544  * kmalloc_track_caller is a special version of kmalloc that records the
  545  * calling function of the routine calling it for slab leak tracking instead
  546  * of just the calling function (confusing, eh?).
  547  * It's useful when the call to kmalloc comes from a widely-used standard
  548  * allocator where we care about the real place the memory allocation
  549  * request comes from.
  550  */
  551 extern void *__kmalloc_track_caller(size_t, gfp_t, unsigned long);
  552 #define kmalloc_track_caller(size, flags) \
  553 	__kmalloc_track_caller(size, flags, _RET_IP_)
  554 
  555 #ifdef CONFIG_NUMA
  556 extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, unsigned long);
  557 #define kmalloc_node_track_caller(size, flags, node) \
  558 	__kmalloc_node_track_caller(size, flags, node, \
  559 			_RET_IP_)
  560 
  561 #else /* CONFIG_NUMA */
  562 
  563 #define kmalloc_node_track_caller(size, flags, node) \
  564 	kmalloc_track_caller(size, flags)
  565 
  566 #endif /* CONFIG_NUMA */
  567 
  568 /*
  569  * Shortcuts
  570  */
  571 static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags)
  572 {
  573 	return kmem_cache_alloc(k, flags | __GFP_ZERO);
  574 }
  575 
  576 /**
  577  * kzalloc - allocate memory. The memory is set to zero.
  578  * @size: how many bytes of memory are required.
  579  * @flags: the type of memory to allocate (see kmalloc).
  580  */
  581 static inline void *kzalloc(size_t size, gfp_t flags)
  582 {
  583 	return kmalloc(size, flags | __GFP_ZERO);
  584 }
  585 
  586 /**
  587  * kzalloc_node - allocate zeroed memory from a particular memory node.
  588  * @size: how many bytes of memory are required.
  589  * @flags: the type of memory to allocate (see kmalloc).
  590  * @node: memory node from which to allocate
  591  */
  592 static inline void *kzalloc_node(size_t size, gfp_t flags, int node)
  593 {
  594 	return kmalloc_node(size, flags | __GFP_ZERO, node);
  595 }
  596 
  597 unsigned int kmem_cache_size(struct kmem_cache *s);
  598 void __init kmem_cache_init_late(void);
  599 
  600 #endif	/* _LINUX_SLAB_H */                 1 #ifndef _LINUX_TIMER_H
    2 #define _LINUX_TIMER_H
    3 
    4 #include <linux/list.h>
    5 #include <linux/ktime.h>
    6 #include <linux/stddef.h>
    7 #include <linux/debugobjects.h>
    8 #include <linux/stringify.h>
    9 
   10 struct tvec_base;
   11 
   12 struct timer_list {
   13 	/*
   14 	 * All fields that change during normal runtime grouped to the
   15 	 * same cacheline
   16 	 */
   17 	struct list_head entry;
   18 	unsigned long expires;
   19 	struct tvec_base *base;
   20 
   21 	void (*function)(unsigned long);
   22 	unsigned long data;
   23 
   24 	int slack;
   25 
   26 #ifdef CONFIG_TIMER_STATS
   27 	int start_pid;
   28 	void *start_site;
   29 	char start_comm[16];
   30 #endif
   31 #ifdef CONFIG_LOCKDEP
   32 	struct lockdep_map lockdep_map;
   33 #endif
   34 };
   35 
   36 extern struct tvec_base boot_tvec_bases;
   37 
   38 #ifdef CONFIG_LOCKDEP
   39 /*
   40  * NB: because we have to copy the lockdep_map, setting the lockdep_map key
   41  * (second argument) here is required, otherwise it could be initialised to
   42  * the copy of the lockdep_map later! We use the pointer to and the string
   43  * "<file>:<line>" as the key resp. the name of the lockdep_map.
   44  */
   45 #define __TIMER_LOCKDEP_MAP_INITIALIZER(_kn)				\
   46 	.lockdep_map = STATIC_LOCKDEP_MAP_INIT(_kn, &_kn),
   47 #else
   48 #define __TIMER_LOCKDEP_MAP_INITIALIZER(_kn)
   49 #endif
   50 
   51 /*
   52  * Note that all tvec_bases are at least 4 byte aligned and lower two bits
   53  * of base in timer_list is guaranteed to be zero. Use them for flags.
   54  *
   55  * A deferrable timer will work normally when the system is busy, but
   56  * will not cause a CPU to come out of idle just to service it; instead,
   57  * the timer will be serviced when the CPU eventually wakes up with a
   58  * subsequent non-deferrable timer.
   59  *
   60  * An irqsafe timer is executed with IRQ disabled and it's safe to wait for
   61  * the completion of the running instance from IRQ handlers, for example,
   62  * by calling del_timer_sync().
   63  *
   64  * Note: The irq disabled callback execution is a special case for
   65  * workqueue locking issues. It's not meant for executing random crap
   66  * with interrupts disabled. Abuse is monitored!
   67  */
   68 #define TIMER_DEFERRABLE		0x1LU
   69 #define TIMER_IRQSAFE			0x2LU
   70 
   71 #define TIMER_FLAG_MASK			0x3LU
   72 
   73 #define __TIMER_INITIALIZER(_function, _expires, _data, _flags) { \
   74 		.entry = { .prev = TIMER_ENTRY_STATIC },	\
   75 		.function = (_function),			\
   76 		.expires = (_expires),				\
   77 		.data = (_data),				\
   78 		.base = (void *)((unsigned long)&boot_tvec_bases + (_flags)), \
   79 		.slack = -1,					\
   80 		__TIMER_LOCKDEP_MAP_INITIALIZER(		\
   81 			__FILE__ ":" __stringify(__LINE__))	\
   82 	}
   83 
   84 #define TIMER_INITIALIZER(_function, _expires, _data)		\
   85 	__TIMER_INITIALIZER((_function), (_expires), (_data), 0)
   86 
   87 #define TIMER_DEFERRED_INITIALIZER(_function, _expires, _data)	\
   88 	__TIMER_INITIALIZER((_function), (_expires), (_data), TIMER_DEFERRABLE)
   89 
   90 #define DEFINE_TIMER(_name, _function, _expires, _data)		\
   91 	struct timer_list _name =				\
   92 		TIMER_INITIALIZER(_function, _expires, _data)
   93 
   94 void init_timer_key(struct timer_list *timer, unsigned int flags,
   95 		    const char *name, struct lock_class_key *key);
   96 
   97 #ifdef CONFIG_DEBUG_OBJECTS_TIMERS
   98 extern void init_timer_on_stack_key(struct timer_list *timer,
   99 				    unsigned int flags, const char *name,
  100 				    struct lock_class_key *key);
  101 extern void destroy_timer_on_stack(struct timer_list *timer);
  102 #else
  103 static inline void destroy_timer_on_stack(struct timer_list *timer) { }
  104 static inline void init_timer_on_stack_key(struct timer_list *timer,
  105 					   unsigned int flags, const char *name,
  106 					   struct lock_class_key *key)
  107 {
  108 	init_timer_key(timer, flags, name, key);
  109 }
  110 #endif
  111 
  112 #ifdef CONFIG_LOCKDEP
  113 #define __init_timer(_timer, _flags)					\
  114 	do {								\
  115 		static struct lock_class_key __key;			\
  116 		init_timer_key((_timer), (_flags), #_timer, &__key);	\
  117 	} while (0)
  118 
  119 #define __init_timer_on_stack(_timer, _flags)				\
  120 	do {								\
  121 		static struct lock_class_key __key;			\
  122 		init_timer_on_stack_key((_timer), (_flags), #_timer, &__key); \
  123 	} while (0)
  124 #else
  125 #define __init_timer(_timer, _flags)					\
  126 	init_timer_key((_timer), (_flags), NULL, NULL)
  127 #define __init_timer_on_stack(_timer, _flags)				\
  128 	init_timer_on_stack_key((_timer), (_flags), NULL, NULL)
  129 #endif
  130 
  131 #define init_timer(timer)						\
  132 	__init_timer((timer), 0)
  133 #define init_timer_deferrable(timer)					\
  134 	__init_timer((timer), TIMER_DEFERRABLE)
  135 #define init_timer_on_stack(timer)					\
  136 	__init_timer_on_stack((timer), 0)
  137 
  138 #define __setup_timer(_timer, _fn, _data, _flags)			\
  139 	do {								\
  140 		__init_timer((_timer), (_flags));			\
  141 		(_timer)->function = (_fn);				\
  142 		(_timer)->data = (_data);				\
  143 	} while (0)
  144 
  145 #define __setup_timer_on_stack(_timer, _fn, _data, _flags)		\
  146 	do {								\
  147 		__init_timer_on_stack((_timer), (_flags));		\
  148 		(_timer)->function = (_fn);				\
  149 		(_timer)->data = (_data);				\
  150 	} while (0)
  151 
  152 #define setup_timer(timer, fn, data)					\
  153 	__setup_timer((timer), (fn), (data), 0)
  154 #define setup_timer_on_stack(timer, fn, data)				\
  155 	__setup_timer_on_stack((timer), (fn), (data), 0)
  156 #define setup_deferrable_timer_on_stack(timer, fn, data)		\
  157 	__setup_timer_on_stack((timer), (fn), (data), TIMER_DEFERRABLE)
  158 
  159 /**
  160  * timer_pending - is a timer pending?
  161  * @timer: the timer in question
  162  *
  163  * timer_pending will tell whether a given timer is currently pending,
  164  * or not. Callers must ensure serialization wrt. other operations done
  165  * to this timer, eg. interrupt contexts, or other CPUs on SMP.
  166  *
  167  * return value: 1 if the timer is pending, 0 if not.
  168  */
  169 static inline int timer_pending(const struct timer_list * timer)
  170 {
  171 	return timer->entry.next != NULL;
  172 }
  173 
  174 extern void add_timer_on(struct timer_list *timer, int cpu);
  175 extern int del_timer(struct timer_list * timer);
  176 extern int mod_timer(struct timer_list *timer, unsigned long expires);
  177 extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);
  178 extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires);
  179 
  180 extern void set_timer_slack(struct timer_list *time, int slack_hz);
  181 
  182 #define TIMER_NOT_PINNED	0
  183 #define TIMER_PINNED		1
  184 /*
  185  * The jiffies value which is added to now, when there is no timer
  186  * in the timer wheel:
  187  */
  188 #define NEXT_TIMER_MAX_DELTA	((1UL << 30) - 1)
  189 
  190 /*
  191  * Return when the next timer-wheel timeout occurs (in absolute jiffies),
  192  * locks the timer base and does the comparison against the given
  193  * jiffie.
  194  */
  195 extern unsigned long get_next_timer_interrupt(unsigned long now);
  196 
  197 /*
  198  * Timer-statistics info:
  199  */
  200 #ifdef CONFIG_TIMER_STATS
  201 
  202 extern int timer_stats_active;
  203 
  204 #define TIMER_STATS_FLAG_DEFERRABLE	0x1
  205 
  206 extern void init_timer_stats(void);
  207 
  208 extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
  209 				     void *timerf, char *comm,
  210 				     unsigned int timer_flag);
  211 
  212 extern void __timer_stats_timer_set_start_info(struct timer_list *timer,
  213 					       void *addr);
  214 
  215 static inline void timer_stats_timer_set_start_info(struct timer_list *timer)
  216 {
  217 	if (likely(!timer_stats_active))
  218 		return;
  219 	__timer_stats_timer_set_start_info(timer, __builtin_return_address(0));
  220 }
  221 
  222 static inline void timer_stats_timer_clear_start_info(struct timer_list *timer)
  223 {
  224 	timer->start_site = NULL;
  225 }
  226 #else
  227 static inline void init_timer_stats(void)
  228 {
  229 }
  230 
  231 static inline void timer_stats_timer_set_start_info(struct timer_list *timer)
  232 {
  233 }
  234 
  235 static inline void timer_stats_timer_clear_start_info(struct timer_list *timer)
  236 {
  237 }
  238 #endif
  239 
  240 extern void add_timer(struct timer_list *timer);
  241 
  242 extern int try_to_del_timer_sync(struct timer_list *timer);
  243 
  244 #ifdef CONFIG_SMP
  245   extern int del_timer_sync(struct timer_list *timer);
  246 #else
  247 # define del_timer_sync(t)		del_timer(t)
  248 #endif
  249 
  250 #define del_singleshot_timer_sync(t) del_timer_sync(t)
  251 
  252 extern void init_timers(void);
  253 extern void run_local_timers(void);
  254 struct hrtimer;
  255 extern enum hrtimer_restart it_real_fn(struct hrtimer *);
  256 
  257 unsigned long __round_jiffies(unsigned long j, int cpu);
  258 unsigned long __round_jiffies_relative(unsigned long j, int cpu);
  259 unsigned long round_jiffies(unsigned long j);
  260 unsigned long round_jiffies_relative(unsigned long j);
  261 
  262 unsigned long __round_jiffies_up(unsigned long j, int cpu);
  263 unsigned long __round_jiffies_up_relative(unsigned long j, int cpu);
  264 unsigned long round_jiffies_up(unsigned long j);
  265 unsigned long round_jiffies_up_relative(unsigned long j);
  266 
  267 #endif                 1 #ifndef __LINUX_USB_H
    2 #define __LINUX_USB_H
    3 
    4 #include <linux/mod_devicetable.h>
    5 #include <linux/usb/ch9.h>
    6 
    7 #define USB_MAJOR			180
    8 #define USB_DEVICE_MAJOR		189
    9 
   10 
   11 #ifdef __KERNEL__
   12 
   13 #include <linux/errno.h>        /* for -ENODEV */
   14 #include <linux/delay.h>	/* for mdelay() */
   15 #include <linux/interrupt.h>	/* for in_interrupt() */
   16 #include <linux/list.h>		/* for struct list_head */
   17 #include <linux/kref.h>		/* for struct kref */
   18 #include <linux/device.h>	/* for struct device */
   19 #include <linux/fs.h>		/* for struct file_operations */
   20 #include <linux/completion.h>	/* for struct completion */
   21 #include <linux/sched.h>	/* for current && schedule_timeout */
   22 #include <linux/mutex.h>	/* for struct mutex */
   23 #include <linux/pm_runtime.h>	/* for runtime PM */
   24 
   25 struct usb_device;
   26 struct usb_driver;
   27 struct wusb_dev;
   28 
   29 /*-------------------------------------------------------------------------*/
   30 
   31 /*
   32  * Host-side wrappers for standard USB descriptors ... these are parsed
   33  * from the data provided by devices.  Parsing turns them from a flat
   34  * sequence of descriptors into a hierarchy:
   35  *
   36  *  - devices have one (usually) or more configs;
   37  *  - configs have one (often) or more interfaces;
   38  *  - interfaces have one (usually) or more settings;
   39  *  - each interface setting has zero or (usually) more endpoints.
   40  *  - a SuperSpeed endpoint has a companion descriptor
   41  *
   42  * And there might be other descriptors mixed in with those.
   43  *
   44  * Devices may also have class-specific or vendor-specific descriptors.
   45  */
   46 
   47 struct ep_device;
   48 
   49 /**
   50  * struct usb_host_endpoint - host-side endpoint descriptor and queue
   51  * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder
   52  * @ss_ep_comp: SuperSpeed companion descriptor for this endpoint
   53  * @urb_list: urbs queued to this endpoint; maintained by usbcore
   54  * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)
   55  *	with one or more transfer descriptors (TDs) per urb
   56  * @ep_dev: ep_device for sysfs info
   57  * @extra: descriptors following this endpoint in the configuration
   58  * @extralen: how many bytes of "extra" are valid
   59  * @enabled: URBs may be submitted to this endpoint
   60  * @streams: number of USB-3 streams allocated on the endpoint
   61  *
   62  * USB requests are always queued to a given endpoint, identified by a
   63  * descriptor within an active interface in a given USB configuration.
   64  */
   65 struct usb_host_endpoint {
   66 	struct usb_endpoint_descriptor		desc;
   67 	struct usb_ss_ep_comp_descriptor	ss_ep_comp;
   68 	struct list_head		urb_list;
   69 	void				*hcpriv;
   70 	struct ep_device		*ep_dev;	/* For sysfs info */
   71 
   72 	unsigned char *extra;   /* Extra descriptors */
   73 	int extralen;
   74 	int enabled;
   75 	int streams;
   76 };
   77 
   78 /* host-side wrapper for one interface setting's parsed descriptors */
   79 struct usb_host_interface {
   80 	struct usb_interface_descriptor	desc;
   81 
   82 	int extralen;
   83 	unsigned char *extra;   /* Extra descriptors */
   84 
   85 	/* array of desc.bNumEndpoints endpoints associated with this
   86 	 * interface setting.  these will be in no particular order.
   87 	 */
   88 	struct usb_host_endpoint *endpoint;
   89 
   90 	char *string;		/* iInterface string, if present */
   91 };
   92 
   93 enum usb_interface_condition {
   94 	USB_INTERFACE_UNBOUND = 0,
   95 	USB_INTERFACE_BINDING,
   96 	USB_INTERFACE_BOUND,
   97 	USB_INTERFACE_UNBINDING,
   98 };
   99 
  100 /**
  101  * struct usb_interface - what usb device drivers talk to
  102  * @altsetting: array of interface structures, one for each alternate
  103  *	setting that may be selected.  Each one includes a set of
  104  *	endpoint configurations.  They will be in no particular order.
  105  * @cur_altsetting: the current altsetting.
  106  * @num_altsetting: number of altsettings defined.
  107  * @intf_assoc: interface association descriptor
  108  * @minor: the minor number assigned to this interface, if this
  109  *	interface is bound to a driver that uses the USB major number.
  110  *	If this interface does not use the USB major, this field should
  111  *	be unused.  The driver should set this value in the probe()
  112  *	function of the driver, after it has been assigned a minor
  113  *	number from the USB core by calling usb_register_dev().
  114  * @condition: binding state of the interface: not bound, binding
  115  *	(in probe()), bound to a driver, or unbinding (in disconnect())
  116  * @sysfs_files_created: sysfs attributes exist
  117  * @ep_devs_created: endpoint child pseudo-devices exist
  118  * @unregistering: flag set when the interface is being unregistered
  119  * @needs_remote_wakeup: flag set when the driver requires remote-wakeup
  120  *	capability during autosuspend.
  121  * @needs_altsetting0: flag set when a set-interface request for altsetting 0
  122  *	has been deferred.
  123  * @needs_binding: flag set when the driver should be re-probed or unbound
  124  *	following a reset or suspend operation it doesn't support.
  125  * @dev: driver model's view of this device
  126  * @usb_dev: if an interface is bound to the USB major, this will point
  127  *	to the sysfs representation for that device.
  128  * @pm_usage_cnt: PM usage counter for this interface
  129  * @reset_ws: Used for scheduling resets from atomic context.
  130  * @resetting_device: USB core reset the device, so use alt setting 0 as
  131  *	current; needs bandwidth alloc after reset.
  132  *
  133  * USB device drivers attach to interfaces on a physical device.  Each
  134  * interface encapsulates a single high level function, such as feeding
  135  * an audio stream to a speaker or reporting a change in a volume control.
  136  * Many USB devices only have one interface.  The protocol used to talk to
  137  * an interface's endpoints can be defined in a usb "class" specification,
  138  * or by a product's vendor.  The (default) control endpoint is part of
  139  * every interface, but is never listed among the interface's descriptors.
  140  *
  141  * The driver that is bound to the interface can use standard driver model
  142  * calls such as dev_get_drvdata() on the dev member of this structure.
  143  *
  144  * Each interface may have alternate settings.  The initial configuration
  145  * of a device sets altsetting 0, but the device driver can change
  146  * that setting using usb_set_interface().  Alternate settings are often
  147  * used to control the use of periodic endpoints, such as by having
  148  * different endpoints use different amounts of reserved USB bandwidth.
  149  * All standards-conformant USB devices that use isochronous endpoints
  150  * will use them in non-default settings.
  151  *
  152  * The USB specification says that alternate setting numbers must run from
  153  * 0 to one less than the total number of alternate settings.  But some
  154  * devices manage to mess this up, and the structures aren't necessarily
  155  * stored in numerical order anyhow.  Use usb_altnum_to_altsetting() to
  156  * look up an alternate setting in the altsetting array based on its number.
  157  */
  158 struct usb_interface {
  159 	/* array of alternate settings for this interface,
  160 	 * stored in no particular order */
  161 	struct usb_host_interface *altsetting;
  162 
  163 	struct usb_host_interface *cur_altsetting;	/* the currently
  164 					 * active alternate setting */
  165 	unsigned num_altsetting;	/* number of alternate settings */
  166 
  167 	/* If there is an interface association descriptor then it will list
  168 	 * the associated interfaces */
  169 	struct usb_interface_assoc_descriptor *intf_assoc;
  170 
  171 	int minor;			/* minor number this interface is
  172 					 * bound to */
  173 	enum usb_interface_condition condition;		/* state of binding */
  174 	unsigned sysfs_files_created:1;	/* the sysfs attributes exist */
  175 	unsigned ep_devs_created:1;	/* endpoint "devices" exist */
  176 	unsigned unregistering:1;	/* unregistration is in progress */
  177 	unsigned needs_remote_wakeup:1;	/* driver requires remote wakeup */
  178 	unsigned needs_altsetting0:1;	/* switch to altsetting 0 is pending */
  179 	unsigned needs_binding:1;	/* needs delayed unbind/rebind */
  180 	unsigned resetting_device:1;	/* true: bandwidth alloc after reset */
  181 
  182 	struct device dev;		/* interface specific device info */
  183 	struct device *usb_dev;
  184 	atomic_t pm_usage_cnt;		/* usage counter for autosuspend */
  185 	struct work_struct reset_ws;	/* for resets in atomic context */
  186 };
  187 #define	to_usb_interface(d) container_of(d, struct usb_interface, dev)
  188 
  189 static inline void *usb_get_intfdata(struct usb_interface *intf)
  190 {
  191 	return dev_get_drvdata(&intf->dev);
  192 }
  193 
  194 static inline void usb_set_intfdata(struct usb_interface *intf, void *data)
  195 {
  196 	dev_set_drvdata(&intf->dev, data);
  197 }
  198 
  199 struct usb_interface *usb_get_intf(struct usb_interface *intf);
  200 void usb_put_intf(struct usb_interface *intf);
  201 
  202 /* Hard limit */
  203 #define USB_MAXENDPOINTS	30
  204 /* this maximum is arbitrary */
  205 #define USB_MAXINTERFACES	32
  206 #define USB_MAXIADS		(USB_MAXINTERFACES/2)
  207 
  208 /**
  209  * struct usb_interface_cache - long-term representation of a device interface
  210  * @num_altsetting: number of altsettings defined.
  211  * @ref: reference counter.
  212  * @altsetting: variable-length array of interface structures, one for
  213  *	each alternate setting that may be selected.  Each one includes a
  214  *	set of endpoint configurations.  They will be in no particular order.
  215  *
  216  * These structures persist for the lifetime of a usb_device, unlike
  217  * struct usb_interface (which persists only as long as its configuration
  218  * is installed).  The altsetting arrays can be accessed through these
  219  * structures at any time, permitting comparison of configurations and
  220  * providing support for the /proc/bus/usb/devices pseudo-file.
  221  */
  222 struct usb_interface_cache {
  223 	unsigned num_altsetting;	/* number of alternate settings */
  224 	struct kref ref;		/* reference counter */
  225 
  226 	/* variable-length array of alternate settings for this interface,
  227 	 * stored in no particular order */
  228 	struct usb_host_interface altsetting[0];
  229 };
  230 #define	ref_to_usb_interface_cache(r) \
  231 		container_of(r, struct usb_interface_cache, ref)
  232 #define	altsetting_to_usb_interface_cache(a) \
  233 		container_of(a, struct usb_interface_cache, altsetting[0])
  234 
  235 /**
  236  * struct usb_host_config - representation of a device's configuration
  237  * @desc: the device's configuration descriptor.
  238  * @string: pointer to the cached version of the iConfiguration string, if
  239  *	present for this configuration.
  240  * @intf_assoc: list of any interface association descriptors in this config
  241  * @interface: array of pointers to usb_interface structures, one for each
  242  *	interface in the configuration.  The number of interfaces is stored
  243  *	in desc.bNumInterfaces.  These pointers are valid only while the
  244  *	the configuration is active.
  245  * @intf_cache: array of pointers to usb_interface_cache structures, one
  246  *	for each interface in the configuration.  These structures exist
  247  *	for the entire life of the device.
  248  * @extra: pointer to buffer containing all extra descriptors associated
  249  *	with this configuration (those preceding the first interface
  250  *	descriptor).
  251  * @extralen: length of the extra descriptors buffer.
  252  *
  253  * USB devices may have multiple configurations, but only one can be active
  254  * at any time.  Each encapsulates a different operational environment;
  255  * for example, a dual-speed device would have separate configurations for
  256  * full-speed and high-speed operation.  The number of configurations
  257  * available is stored in the device descriptor as bNumConfigurations.
  258  *
  259  * A configuration can contain multiple interfaces.  Each corresponds to
  260  * a different function of the USB device, and all are available whenever
  261  * the configuration is active.  The USB standard says that interfaces
  262  * are supposed to be numbered from 0 to desc.bNumInterfaces-1, but a lot
  263  * of devices get this wrong.  In addition, the interface array is not
  264  * guaranteed to be sorted in numerical order.  Use usb_ifnum_to_if() to
  265  * look up an interface entry based on its number.
  266  *
  267  * Device drivers should not attempt to activate configurations.  The choice
  268  * of which configuration to install is a policy decision based on such
  269  * considerations as available power, functionality provided, and the user's
  270  * desires (expressed through userspace tools).  However, drivers can call
  271  * usb_reset_configuration() to reinitialize the current configuration and
  272  * all its interfaces.
  273  */
  274 struct usb_host_config {
  275 	struct usb_config_descriptor	desc;
  276 
  277 	char *string;		/* iConfiguration string, if present */
  278 
  279 	/* List of any Interface Association Descriptors in this
  280 	 * configuration. */
  281 	struct usb_interface_assoc_descriptor *intf_assoc[USB_MAXIADS];
  282 
  283 	/* the interfaces associated with this configuration,
  284 	 * stored in no particular order */
  285 	struct usb_interface *interface[USB_MAXINTERFACES];
  286 
  287 	/* Interface information available even when this is not the
  288 	 * active configuration */
  289 	struct usb_interface_cache *intf_cache[USB_MAXINTERFACES];
  290 
  291 	unsigned char *extra;   /* Extra descriptors */
  292 	int extralen;
  293 };
  294 
  295 /* USB2.0 and USB3.0 device BOS descriptor set */
  296 struct usb_host_bos {
  297 	struct usb_bos_descriptor	*desc;
  298 
  299 	/* wireless cap descriptor is handled by wusb */
  300 	struct usb_ext_cap_descriptor	*ext_cap;
  301 	struct usb_ss_cap_descriptor	*ss_cap;
  302 	struct usb_ss_container_id_descriptor	*ss_id;
  303 };
  304 
  305 int __usb_get_extra_descriptor(char *buffer, unsigned size,
  306 	unsigned char type, void **ptr);
  307 #define usb_get_extra_descriptor(ifpoint, type, ptr) \
  308 				__usb_get_extra_descriptor((ifpoint)->extra, \
  309 				(ifpoint)->extralen, \
  310 				type, (void **)ptr)
  311 
  312 /* ----------------------------------------------------------------------- */
  313 
  314 /* USB device number allocation bitmap */
  315 struct usb_devmap {
  316 	unsigned long devicemap[128 / (8*sizeof(unsigned long))];
  317 };
  318 
  319 /*
  320  * Allocated per bus (tree of devices) we have:
  321  */
  322 struct usb_bus {
  323 	struct device *controller;	/* host/master side hardware */
  324 	int busnum;			/* Bus number (in order of reg) */
  325 	const char *bus_name;		/* stable id (PCI slot_name etc) */
  326 	u8 uses_dma;			/* Does the host controller use DMA? */
  327 	u8 uses_pio_for_control;	/*
  328 					 * Does the host controller use PIO
  329 					 * for control transfers?
  330 					 */
  331 	u8 otg_port;			/* 0, or number of OTG/HNP port */
  332 	unsigned is_b_host:1;		/* true during some HNP roleswitches */
  333 	unsigned b_hnp_enable:1;	/* OTG: did A-Host enable HNP? */
  334 	unsigned no_stop_on_short:1;    /*
  335 					 * Quirk: some controllers don't stop
  336 					 * the ep queue on a short transfer
  337 					 * with the URB_SHORT_NOT_OK flag set.
  338 					 */
  339 	unsigned no_sg_constraint:1;	/* no sg constraint */
  340 	unsigned sg_tablesize;		/* 0 or largest number of sg list entries */
  341 
  342 	int devnum_next;		/* Next open device number in
  343 					 * round-robin allocation */
  344 
  345 	struct usb_devmap devmap;	/* device address allocation map */
  346 	struct usb_device *root_hub;	/* Root hub */
  347 	struct usb_bus *hs_companion;	/* Companion EHCI bus, if any */
  348 	struct list_head bus_list;	/* list of busses */
  349 
  350 	struct mutex usb_address0_mutex; /* unaddressed device mutex */
  351 
  352 	int bandwidth_allocated;	/* on this bus: how much of the time
  353 					 * reserved for periodic (intr/iso)
  354 					 * requests is used, on average?
  355 					 * Units: microseconds/frame.
  356 					 * Limits: Full/low speed reserve 90%,
  357 					 * while high speed reserves 80%.
  358 					 */
  359 	int bandwidth_int_reqs;		/* number of Interrupt requests */
  360 	int bandwidth_isoc_reqs;	/* number of Isoc. requests */
  361 
  362 	unsigned resuming_ports;	/* bit array: resuming root-hub ports */
  363 
  364 #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
  365 	struct mon_bus *mon_bus;	/* non-null when associated */
  366 	int monitored;			/* non-zero when monitored */
  367 #endif
  368 };
  369 
  370 struct usb_dev_state;
  371 
  372 /* ----------------------------------------------------------------------- */
  373 
  374 struct usb_tt;
  375 
  376 enum usb_device_removable {
  377 	USB_DEVICE_REMOVABLE_UNKNOWN = 0,
  378 	USB_DEVICE_REMOVABLE,
  379 	USB_DEVICE_FIXED,
  380 };
  381 
  382 enum usb_port_connect_type {
  383 	USB_PORT_CONNECT_TYPE_UNKNOWN = 0,
  384 	USB_PORT_CONNECT_TYPE_HOT_PLUG,
  385 	USB_PORT_CONNECT_TYPE_HARD_WIRED,
  386 	USB_PORT_NOT_USED,
  387 };
  388 
  389 /*
  390  * USB 2.0 Link Power Management (LPM) parameters.
  391  */
  392 struct usb2_lpm_parameters {
  393 	/* Best effort service latency indicate how long the host will drive
  394 	 * resume on an exit from L1.
  395 	 */
  396 	unsigned int besl;
  397 
  398 	/* Timeout value in microseconds for the L1 inactivity (LPM) timer.
  399 	 * When the timer counts to zero, the parent hub will initiate a LPM
  400 	 * transition to L1.
  401 	 */
  402 	int timeout;
  403 };
  404 
  405 /*
  406  * USB 3.0 Link Power Management (LPM) parameters.
  407  *
  408  * PEL and SEL are USB 3.0 Link PM latencies for device-initiated LPM exit.
  409  * MEL is the USB 3.0 Link PM latency for host-initiated LPM exit.
  410  * All three are stored in nanoseconds.
  411  */
  412 struct usb3_lpm_parameters {
  413 	/*
  414 	 * Maximum exit latency (MEL) for the host to send a packet to the
  415 	 * device (either a Ping for isoc endpoints, or a data packet for
  416 	 * interrupt endpoints), the hubs to decode the packet, and for all hubs
  417 	 * in the path to transition the links to U0.
  418 	 */
  419 	unsigned int mel;
  420 	/*
  421 	 * Maximum exit latency for a device-initiated LPM transition to bring
  422 	 * all links into U0.  Abbreviated as "PEL" in section 9.4.12 of the USB
  423 	 * 3.0 spec, with no explanation of what "P" stands for.  "Path"?
  424 	 */
  425 	unsigned int pel;
  426 
  427 	/*
  428 	 * The System Exit Latency (SEL) includes PEL, and three other
  429 	 * latencies.  After a device initiates a U0 transition, it will take
  430 	 * some time from when the device sends the ERDY to when it will finally
  431 	 * receive the data packet.  Basically, SEL should be the worse-case
  432 	 * latency from when a device starts initiating a U0 transition to when
  433 	 * it will get data.
  434 	 */
  435 	unsigned int sel;
  436 	/*
  437 	 * The idle timeout value that is currently programmed into the parent
  438 	 * hub for this device.  When the timer counts to zero, the parent hub
  439 	 * will initiate an LPM transition to either U1 or U2.
  440 	 */
  441 	int timeout;
  442 };
  443 
  444 /**
  445  * struct usb_device - kernel's representation of a USB device
  446  * @devnum: device number; address on a USB bus
  447  * @devpath: device ID string for use in messages (e.g., /port/...)
  448  * @route: tree topology hex string for use with xHCI
  449  * @state: device state: configured, not attached, etc.
  450  * @speed: device speed: high/full/low (or error)
  451  * @tt: Transaction Translator info; used with low/full speed dev, highspeed hub
  452  * @ttport: device port on that tt hub
  453  * @toggle: one bit for each endpoint, with ([0] = IN, [1] = OUT) endpoints
  454  * @parent: our hub, unless we're the root
  455  * @bus: bus we're part of
  456  * @ep0: endpoint 0 data (default control pipe)
  457  * @dev: generic device interface
  458  * @descriptor: USB device descriptor
  459  * @bos: USB device BOS descriptor set
  460  * @config: all of the device's configs
  461  * @actconfig: the active configuration
  462  * @ep_in: array of IN endpoints
  463  * @ep_out: array of OUT endpoints
  464  * @rawdescriptors: raw descriptors for each config
  465  * @bus_mA: Current available from the bus
  466  * @portnum: parent port number (origin 1)
  467  * @level: number of USB hub ancestors
  468  * @can_submit: URBs may be submitted
  469  * @persist_enabled:  USB_PERSIST enabled for this device
  470  * @have_langid: whether string_langid is valid
  471  * @authorized: policy has said we can use it;
  472  *	(user space) policy determines if we authorize this device to be
  473  *	used or not. By default, wired USB devices are authorized.
  474  *	WUSB devices are not, until we authorize them from user space.
  475  *	FIXME -- complete doc
  476  * @authenticated: Crypto authentication passed
  477  * @wusb: device is Wireless USB
  478  * @lpm_capable: device supports LPM
  479  * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM
  480  * @usb2_hw_lpm_besl_capable: device can perform USB2 hardware BESL LPM
  481  * @usb2_hw_lpm_enabled: USB2 hardware LPM is enabled
  482  * @usb2_hw_lpm_allowed: Userspace allows USB 2.0 LPM to be enabled
  483  * @usb3_lpm_enabled: USB3 hardware LPM enabled
  484  * @string_langid: language ID for strings
  485  * @product: iProduct string, if present (static)
  486  * @manufacturer: iManufacturer string, if present (static)
  487  * @serial: iSerialNumber string, if present (static)
  488  * @filelist: usbfs files that are open to this device
  489  * @maxchild: number of ports if hub
  490  * @quirks: quirks of the whole device
  491  * @urbnum: number of URBs submitted for the whole device
  492  * @active_duration: total time device is not suspended
  493  * @connect_time: time device was first connected
  494  * @do_remote_wakeup:  remote wakeup should be enabled
  495  * @reset_resume: needs reset instead of resume
  496  * @port_is_suspended: the upstream port is suspended (L2 or U3)
  497  * @wusb_dev: if this is a Wireless USB device, link to the WUSB
  498  *	specific data for the device.
  499  * @slot_id: Slot ID assigned by xHCI
  500  * @removable: Device can be physically removed from this port
  501  * @l1_params: best effor service latency for USB2 L1 LPM state, and L1 timeout.
  502  * @u1_params: exit latencies for USB3 U1 LPM state, and hub-initiated timeout.
  503  * @u2_params: exit latencies for USB3 U2 LPM state, and hub-initiated timeout.
  504  * @lpm_disable_count: Ref count used by usb_disable_lpm() and usb_enable_lpm()
  505  *	to keep track of the number of functions that require USB 3.0 Link Power
  506  *	Management to be disabled for this usb_device.  This count should only
  507  *	be manipulated by those functions, with the bandwidth_mutex is held.
  508  *
  509  * Notes:
  510  * Usbcore drivers should not set usbdev->state directly.  Instead use
  511  * usb_set_device_state().
  512  */
  513 struct usb_device {
  514 	int		devnum;
  515 	char		devpath[16];
  516 	u32		route;
  517 	enum usb_device_state	state;
  518 	enum usb_device_speed	speed;
  519 
  520 	struct usb_tt	*tt;
  521 	int		ttport;
  522 
  523 	unsigned int toggle[2];
  524 
  525 	struct usb_device *parent;
  526 	struct usb_bus *bus;
  527 	struct usb_host_endpoint ep0;
  528 
  529 	struct device dev;
  530 
  531 	struct usb_device_descriptor descriptor;
  532 	struct usb_host_bos *bos;
  533 	struct usb_host_config *config;
  534 
  535 	struct usb_host_config *actconfig;
  536 	struct usb_host_endpoint *ep_in[16];
  537 	struct usb_host_endpoint *ep_out[16];
  538 
  539 	char **rawdescriptors;
  540 
  541 	unsigned short bus_mA;
  542 	u8 portnum;
  543 	u8 level;
  544 
  545 	unsigned can_submit:1;
  546 	unsigned persist_enabled:1;
  547 	unsigned have_langid:1;
  548 	unsigned authorized:1;
  549 	unsigned authenticated:1;
  550 	unsigned wusb:1;
  551 	unsigned lpm_capable:1;
  552 	unsigned usb2_hw_lpm_capable:1;
  553 	unsigned usb2_hw_lpm_besl_capable:1;
  554 	unsigned usb2_hw_lpm_enabled:1;
  555 	unsigned usb2_hw_lpm_allowed:1;
  556 	unsigned usb3_lpm_enabled:1;
  557 	int string_langid;
  558 
  559 	/* static strings from the device */
  560 	char *product;
  561 	char *manufacturer;
  562 	char *serial;
  563 
  564 	struct list_head filelist;
  565 
  566 	int maxchild;
  567 
  568 	u32 quirks;
  569 	atomic_t urbnum;
  570 
  571 	unsigned long active_duration;
  572 
  573 #ifdef CONFIG_PM
  574 	unsigned long connect_time;
  575 
  576 	unsigned do_remote_wakeup:1;
  577 	unsigned reset_resume:1;
  578 	unsigned port_is_suspended:1;
  579 #endif
  580 	struct wusb_dev *wusb_dev;
  581 	int slot_id;
  582 	enum usb_device_removable removable;
  583 	struct usb2_lpm_parameters l1_params;
  584 	struct usb3_lpm_parameters u1_params;
  585 	struct usb3_lpm_parameters u2_params;
  586 	unsigned lpm_disable_count;
  587 };
  588 #define	to_usb_device(d) container_of(d, struct usb_device, dev)
  589 
  590 static inline struct usb_device *interface_to_usbdev(struct usb_interface *intf)
  591 {
  592 	return to_usb_device(intf->dev.parent);
  593 }
  594 
  595 extern struct usb_device *usb_get_dev(struct usb_device *dev);
  596 extern void usb_put_dev(struct usb_device *dev);
  597 extern struct usb_device *usb_hub_find_child(struct usb_device *hdev,
  598 	int port1);
  599 
  600 /**
  601  * usb_hub_for_each_child - iterate over all child devices on the hub
  602  * @hdev:  USB device belonging to the usb hub
  603  * @port1: portnum associated with child device
  604  * @child: child device pointer
  605  */
  606 #define usb_hub_for_each_child(hdev, port1, child) \
  607 	for (port1 = 1,	child =	usb_hub_find_child(hdev, port1); \
  608 			port1 <= hdev->maxchild; \
  609 			child = usb_hub_find_child(hdev, ++port1)) \
  610 		if (!child) continue; else
  611 
  612 /* USB device locking */
  613 #define usb_lock_device(udev)		device_lock(&(udev)->dev)
  614 #define usb_unlock_device(udev)		device_unlock(&(udev)->dev)
  615 #define usb_trylock_device(udev)	device_trylock(&(udev)->dev)
  616 extern int usb_lock_device_for_reset(struct usb_device *udev,
  617 				     const struct usb_interface *iface);
  618 
  619 /* USB port reset for device reinitialization */
  620 extern int usb_reset_device(struct usb_device *dev);
  621 extern void usb_queue_reset_device(struct usb_interface *dev);
  622 
  623 #ifdef CONFIG_ACPI
  624 extern int usb_acpi_set_power_state(struct usb_device *hdev, int index,
  625 	bool enable);
  626 extern bool usb_acpi_power_manageable(struct usb_device *hdev, int index);
  627 #else
  628 static inline int usb_acpi_set_power_state(struct usb_device *hdev, int index,
  629 	bool enable) { return 0; }
  630 static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index)
  631 	{ return true; }
  632 #endif
  633 
  634 /* USB autosuspend and autoresume */
  635 #ifdef CONFIG_PM
  636 extern void usb_enable_autosuspend(struct usb_device *udev);
  637 extern void usb_disable_autosuspend(struct usb_device *udev);
  638 
  639 extern int usb_autopm_get_interface(struct usb_interface *intf);
  640 extern void usb_autopm_put_interface(struct usb_interface *intf);
  641 extern int usb_autopm_get_interface_async(struct usb_interface *intf);
  642 extern void usb_autopm_put_interface_async(struct usb_interface *intf);
  643 extern void usb_autopm_get_interface_no_resume(struct usb_interface *intf);
  644 extern void usb_autopm_put_interface_no_suspend(struct usb_interface *intf);
  645 
  646 static inline void usb_mark_last_busy(struct usb_device *udev)
  647 {
  648 	pm_runtime_mark_last_busy(&udev->dev);
  649 }
  650 
  651 #else
  652 
  653 static inline int usb_enable_autosuspend(struct usb_device *udev)
  654 { return 0; }
  655 static inline int usb_disable_autosuspend(struct usb_device *udev)
  656 { return 0; }
  657 
  658 static inline int usb_autopm_get_interface(struct usb_interface *intf)
  659 { return 0; }
  660 static inline int usb_autopm_get_interface_async(struct usb_interface *intf)
  661 { return 0; }
  662 
  663 static inline void usb_autopm_put_interface(struct usb_interface *intf)
  664 { }
  665 static inline void usb_autopm_put_interface_async(struct usb_interface *intf)
  666 { }
  667 static inline void usb_autopm_get_interface_no_resume(
  668 		struct usb_interface *intf)
  669 { }
  670 static inline void usb_autopm_put_interface_no_suspend(
  671 		struct usb_interface *intf)
  672 { }
  673 static inline void usb_mark_last_busy(struct usb_device *udev)
  674 { }
  675 #endif
  676 
  677 extern int usb_disable_lpm(struct usb_device *udev);
  678 extern void usb_enable_lpm(struct usb_device *udev);
  679 /* Same as above, but these functions lock/unlock the bandwidth_mutex. */
  680 extern int usb_unlocked_disable_lpm(struct usb_device *udev);
  681 extern void usb_unlocked_enable_lpm(struct usb_device *udev);
  682 
  683 extern int usb_disable_ltm(struct usb_device *udev);
  684 extern void usb_enable_ltm(struct usb_device *udev);
  685 
  686 static inline bool usb_device_supports_ltm(struct usb_device *udev)
  687 {
  688 	if (udev->speed != USB_SPEED_SUPER || !udev->bos || !udev->bos->ss_cap)
  689 		return false;
  690 	return udev->bos->ss_cap->bmAttributes & USB_LTM_SUPPORT;
  691 }
  692 
  693 static inline bool usb_device_no_sg_constraint(struct usb_device *udev)
  694 {
  695 	return udev && udev->bus && udev->bus->no_sg_constraint;
  696 }
  697 
  698 
  699 /*-------------------------------------------------------------------------*/
  700 
  701 /* for drivers using iso endpoints */
  702 extern int usb_get_current_frame_number(struct usb_device *usb_dev);
  703 
  704 /* Sets up a group of bulk endpoints to support multiple stream IDs. */
  705 extern int usb_alloc_streams(struct usb_interface *interface,
  706 		struct usb_host_endpoint **eps, unsigned int num_eps,
  707 		unsigned int num_streams, gfp_t mem_flags);
  708 
  709 /* Reverts a group of bulk endpoints back to not using stream IDs. */
  710 extern int usb_free_streams(struct usb_interface *interface,
  711 		struct usb_host_endpoint **eps, unsigned int num_eps,
  712 		gfp_t mem_flags);
  713 
  714 /* used these for multi-interface device registration */
  715 extern int usb_driver_claim_interface(struct usb_driver *driver,
  716 			struct usb_interface *iface, void *priv);
  717 
  718 /**
  719  * usb_interface_claimed - returns true iff an interface is claimed
  720  * @iface: the interface being checked
  721  *
  722  * Return: %true (nonzero) iff the interface is claimed, else %false
  723  * (zero).
  724  *
  725  * Note:
  726  * Callers must own the driver model's usb bus readlock.  So driver
  727  * probe() entries don't need extra locking, but other call contexts
  728  * may need to explicitly claim that lock.
  729  *
  730  */
  731 static inline int usb_interface_claimed(struct usb_interface *iface)
  732 {
  733 	return (iface->dev.driver != NULL);
  734 }
  735 
  736 extern void usb_driver_release_interface(struct usb_driver *driver,
  737 			struct usb_interface *iface);
  738 const struct usb_device_id *usb_match_id(struct usb_interface *interface,
  739 					 const struct usb_device_id *id);
  740 extern int usb_match_one_id(struct usb_interface *interface,
  741 			    const struct usb_device_id *id);
  742 
  743 extern int usb_for_each_dev(void *data, int (*fn)(struct usb_device *, void *));
  744 extern struct usb_interface *usb_find_interface(struct usb_driver *drv,
  745 		int minor);
  746 extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev,
  747 		unsigned ifnum);
  748 extern struct usb_host_interface *usb_altnum_to_altsetting(
  749 		const struct usb_interface *intf, unsigned int altnum);
  750 extern struct usb_host_interface *usb_find_alt_setting(
  751 		struct usb_host_config *config,
  752 		unsigned int iface_num,
  753 		unsigned int alt_num);
  754 
  755 /* port claiming functions */
  756 int usb_hub_claim_port(struct usb_device *hdev, unsigned port1,
  757 		struct usb_dev_state *owner);
  758 int usb_hub_release_port(struct usb_device *hdev, unsigned port1,
  759 		struct usb_dev_state *owner);
  760 
  761 /**
  762  * usb_make_path - returns stable device path in the usb tree
  763  * @dev: the device whose path is being constructed
  764  * @buf: where to put the string
  765  * @size: how big is "buf"?
  766  *
  767  * Return: Length of the string (> 0) or negative if size was too small.
  768  *
  769  * Note:
  770  * This identifier is intended to be "stable", reflecting physical paths in
  771  * hardware such as physical bus addresses for host controllers or ports on
  772  * USB hubs.  That makes it stay the same until systems are physically
  773  * reconfigured, by re-cabling a tree of USB devices or by moving USB host
  774  * controllers.  Adding and removing devices, including virtual root hubs
  775  * in host controller driver modules, does not change these path identifiers;
  776  * neither does rebooting or re-enumerating.  These are more useful identifiers
  777  * than changeable ("unstable") ones like bus numbers or device addresses.
  778  *
  779  * With a partial exception for devices connected to USB 2.0 root hubs, these
  780  * identifiers are also predictable.  So long as the device tree isn't changed,
  781  * plugging any USB device into a given hub port always gives it the same path.
  782  * Because of the use of "companion" controllers, devices connected to ports on
  783  * USB 2.0 root hubs (EHCI host controllers) will get one path ID if they are
  784  * high speed, and a different one if they are full or low speed.
  785  */
  786 static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size)
  787 {
  788 	int actual;
  789 	actual = snprintf(buf, size, "usb-%s-%s", dev->bus->bus_name,
  790 			  dev->devpath);
  791 	return (actual >= (int)size) ? -1 : actual;
  792 }
  793 
  794 /*-------------------------------------------------------------------------*/
  795 
  796 #define USB_DEVICE_ID_MATCH_DEVICE \
  797 		(USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT)
  798 #define USB_DEVICE_ID_MATCH_DEV_RANGE \
  799 		(USB_DEVICE_ID_MATCH_DEV_LO | USB_DEVICE_ID_MATCH_DEV_HI)
  800 #define USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION \
  801 		(USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_DEV_RANGE)
  802 #define USB_DEVICE_ID_MATCH_DEV_INFO \
  803 		(USB_DEVICE_ID_MATCH_DEV_CLASS | \
  804 		USB_DEVICE_ID_MATCH_DEV_SUBCLASS | \
  805 		USB_DEVICE_ID_MATCH_DEV_PROTOCOL)
  806 #define USB_DEVICE_ID_MATCH_INT_INFO \
  807 		(USB_DEVICE_ID_MATCH_INT_CLASS | \
  808 		USB_DEVICE_ID_MATCH_INT_SUBCLASS | \
  809 		USB_DEVICE_ID_MATCH_INT_PROTOCOL)
  810 
  811 /**
  812  * USB_DEVICE - macro used to describe a specific usb device
  813  * @vend: the 16 bit USB Vendor ID
  814  * @prod: the 16 bit USB Product ID
  815  *
  816  * This macro is used to create a struct usb_device_id that matches a
  817  * specific device.
  818  */
  819 #define USB_DEVICE(vend, prod) \
  820 	.match_flags = USB_DEVICE_ID_MATCH_DEVICE, \
  821 	.idVendor = (vend), \
  822 	.idProduct = (prod)
  823 /**
  824  * USB_DEVICE_VER - describe a specific usb device with a version range
  825  * @vend: the 16 bit USB Vendor ID
  826  * @prod: the 16 bit USB Product ID
  827  * @lo: the bcdDevice_lo value
  828  * @hi: the bcdDevice_hi value
  829  *
  830  * This macro is used to create a struct usb_device_id that matches a
  831  * specific device, with a version range.
  832  */
  833 #define USB_DEVICE_VER(vend, prod, lo, hi) \
  834 	.match_flags = USB_DEVICE_ID_MATCH_DEVICE_AND_VERSION, \
  835 	.idVendor = (vend), \
  836 	.idProduct = (prod), \
  837 	.bcdDevice_lo = (lo), \
  838 	.bcdDevice_hi = (hi)
  839 
  840 /**
  841  * USB_DEVICE_INTERFACE_CLASS - describe a usb device with a specific interface class
  842  * @vend: the 16 bit USB Vendor ID
  843  * @prod: the 16 bit USB Product ID
  844  * @cl: bInterfaceClass value
  845  *
  846  * This macro is used to create a struct usb_device_id that matches a
  847  * specific interface class of devices.
  848  */
  849 #define USB_DEVICE_INTERFACE_CLASS(vend, prod, cl) \
  850 	.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
  851 		       USB_DEVICE_ID_MATCH_INT_CLASS, \
  852 	.idVendor = (vend), \
  853 	.idProduct = (prod), \
  854 	.bInterfaceClass = (cl)
  855 
  856 /**
  857  * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol
  858  * @vend: the 16 bit USB Vendor ID
  859  * @prod: the 16 bit USB Product ID
  860  * @pr: bInterfaceProtocol value
  861  *
  862  * This macro is used to create a struct usb_device_id that matches a
  863  * specific interface protocol of devices.
  864  */
  865 #define USB_DEVICE_INTERFACE_PROTOCOL(vend, prod, pr) \
  866 	.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
  867 		       USB_DEVICE_ID_MATCH_INT_PROTOCOL, \
  868 	.idVendor = (vend), \
  869 	.idProduct = (prod), \
  870 	.bInterfaceProtocol = (pr)
  871 
  872 /**
  873  * USB_DEVICE_INTERFACE_NUMBER - describe a usb device with a specific interface number
  874  * @vend: the 16 bit USB Vendor ID
  875  * @prod: the 16 bit USB Product ID
  876  * @num: bInterfaceNumber value
  877  *
  878  * This macro is used to create a struct usb_device_id that matches a
  879  * specific interface number of devices.
  880  */
  881 #define USB_DEVICE_INTERFACE_NUMBER(vend, prod, num) \
  882 	.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
  883 		       USB_DEVICE_ID_MATCH_INT_NUMBER, \
  884 	.idVendor = (vend), \
  885 	.idProduct = (prod), \
  886 	.bInterfaceNumber = (num)
  887 
  888 /**
  889  * USB_DEVICE_INFO - macro used to describe a class of usb devices
  890  * @cl: bDeviceClass value
  891  * @sc: bDeviceSubClass value
  892  * @pr: bDeviceProtocol value
  893  *
  894  * This macro is used to create a struct usb_device_id that matches a
  895  * specific class of devices.
  896  */
  897 #define USB_DEVICE_INFO(cl, sc, pr) \
  898 	.match_flags = USB_DEVICE_ID_MATCH_DEV_INFO, \
  899 	.bDeviceClass = (cl), \
  900 	.bDeviceSubClass = (sc), \
  901 	.bDeviceProtocol = (pr)
  902 
  903 /**
  904  * USB_INTERFACE_INFO - macro used to describe a class of usb interfaces
  905  * @cl: bInterfaceClass value
  906  * @sc: bInterfaceSubClass value
  907  * @pr: bInterfaceProtocol value
  908  *
  909  * This macro is used to create a struct usb_device_id that matches a
  910  * specific class of interfaces.
  911  */
  912 #define USB_INTERFACE_INFO(cl, sc, pr) \
  913 	.match_flags = USB_DEVICE_ID_MATCH_INT_INFO, \
  914 	.bInterfaceClass = (cl), \
  915 	.bInterfaceSubClass = (sc), \
  916 	.bInterfaceProtocol = (pr)
  917 
  918 /**
  919  * USB_DEVICE_AND_INTERFACE_INFO - describe a specific usb device with a class of usb interfaces
  920  * @vend: the 16 bit USB Vendor ID
  921  * @prod: the 16 bit USB Product ID
  922  * @cl: bInterfaceClass value
  923  * @sc: bInterfaceSubClass value
  924  * @pr: bInterfaceProtocol value
  925  *
  926  * This macro is used to create a struct usb_device_id that matches a
  927  * specific device with a specific class of interfaces.
  928  *
  929  * This is especially useful when explicitly matching devices that have
  930  * vendor specific bDeviceClass values, but standards-compliant interfaces.
  931  */
  932 #define USB_DEVICE_AND_INTERFACE_INFO(vend, prod, cl, sc, pr) \
  933 	.match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
  934 		| USB_DEVICE_ID_MATCH_DEVICE, \
  935 	.idVendor = (vend), \
  936 	.idProduct = (prod), \
  937 	.bInterfaceClass = (cl), \
  938 	.bInterfaceSubClass = (sc), \
  939 	.bInterfaceProtocol = (pr)
  940 
  941 /**
  942  * USB_VENDOR_AND_INTERFACE_INFO - describe a specific usb vendor with a class of usb interfaces
  943  * @vend: the 16 bit USB Vendor ID
  944  * @cl: bInterfaceClass value
  945  * @sc: bInterfaceSubClass value
  946  * @pr: bInterfaceProtocol value
  947  *
  948  * This macro is used to create a struct usb_device_id that matches a
  949  * specific vendor with a specific class of interfaces.
  950  *
  951  * This is especially useful when explicitly matching devices that have
  952  * vendor specific bDeviceClass values, but standards-compliant interfaces.
  953  */
  954 #define USB_VENDOR_AND_INTERFACE_INFO(vend, cl, sc, pr) \
  955 	.match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
  956 		| USB_DEVICE_ID_MATCH_VENDOR, \
  957 	.idVendor = (vend), \
  958 	.bInterfaceClass = (cl), \
  959 	.bInterfaceSubClass = (sc), \
  960 	.bInterfaceProtocol = (pr)
  961 
  962 /* ----------------------------------------------------------------------- */
  963 
  964 /* Stuff for dynamic usb ids */
  965 struct usb_dynids {
  966 	spinlock_t lock;
  967 	struct list_head list;
  968 };
  969 
  970 struct usb_dynid {
  971 	struct list_head node;
  972 	struct usb_device_id id;
  973 };
  974 
  975 extern ssize_t usb_store_new_id(struct usb_dynids *dynids,
  976 				const struct usb_device_id *id_table,
  977 				struct device_driver *driver,
  978 				const char *buf, size_t count);
  979 
  980 extern ssize_t usb_show_dynids(struct usb_dynids *dynids, char *buf);
  981 
  982 /**
  983  * struct usbdrv_wrap - wrapper for driver-model structure
  984  * @driver: The driver-model core driver structure.
  985  * @for_devices: Non-zero for device drivers, 0 for interface drivers.
  986  */
  987 struct usbdrv_wrap {
  988 	struct device_driver driver;
  989 	int for_devices;
  990 };
  991 
  992 /**
  993  * struct usb_driver - identifies USB interface driver to usbcore
  994  * @name: The driver name should be unique among USB drivers,
  995  *	and should normally be the same as the module name.
  996  * @probe: Called to see if the driver is willing to manage a particular
  997  *	interface on a device.  If it is, probe returns zero and uses
  998  *	usb_set_intfdata() to associate driver-specific data with the
  999  *	interface.  It may also use usb_set_interface() to specify the
 1000  *	appropriate altsetting.  If unwilling to manage the interface,
 1001  *	return -ENODEV, if genuine IO errors occurred, an appropriate
 1002  *	negative errno value.
 1003  * @disconnect: Called when the interface is no longer accessible, usually
 1004  *	because its device has been (or is being) disconnected or the
 1005  *	driver module is being unloaded.
 1006  * @unlocked_ioctl: Used for drivers that want to talk to userspace through
 1007  *	the "usbfs" filesystem.  This lets devices provide ways to
 1008  *	expose information to user space regardless of where they
 1009  *	do (or don't) show up otherwise in the filesystem.
 1010  * @suspend: Called when the device is going to be suspended by the
 1011  *	system either from system sleep or runtime suspend context. The
 1012  *	return value will be ignored in system sleep context, so do NOT
 1013  *	try to continue using the device if suspend fails in this case.
 1014  *	Instead, let the resume or reset-resume routine recover from
 1015  *	the failure.
 1016  * @resume: Called when the device is being resumed by the system.
 1017  * @reset_resume: Called when the suspended device has been reset instead
 1018  *	of being resumed.
 1019  * @pre_reset: Called by usb_reset_device() when the device is about to be
 1020  *	reset.  This routine must not return until the driver has no active
 1021  *	URBs for the device, and no more URBs may be submitted until the
 1022  *	post_reset method is called.
 1023  * @post_reset: Called by usb_reset_device() after the device
 1024  *	has been reset
 1025  * @id_table: USB drivers use ID table to support hotplugging.
 1026  *	Export this with MODULE_DEVICE_TABLE(usb,...).  This must be set
 1027  *	or your driver's probe function will never get called.
 1028  * @dynids: used internally to hold the list of dynamically added device
 1029  *	ids for this driver.
 1030  * @drvwrap: Driver-model core structure wrapper.
 1031  * @no_dynamic_id: if set to 1, the USB core will not allow dynamic ids to be
 1032  *	added to this driver by preventing the sysfs file from being created.
 1033  * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend
 1034  *	for interfaces bound to this driver.
 1035  * @soft_unbind: if set to 1, the USB core will not kill URBs and disable
 1036  *	endpoints before calling the driver's disconnect method.
 1037  * @disable_hub_initiated_lpm: if set to 0, the USB core will not allow hubs
 1038  *	to initiate lower power link state transitions when an idle timeout
 1039  *	occurs.  Device-initiated USB 3.0 link PM will still be allowed.
 1040  *
 1041  * USB interface drivers must provide a name, probe() and disconnect()
 1042  * methods, and an id_table.  Other driver fields are optional.
 1043  *
 1044  * The id_table is used in hotplugging.  It holds a set of descriptors,
 1045  * and specialized data may be associated with each entry.  That table
 1046  * is used by both user and kernel mode hotplugging support.
 1047  *
 1048  * The probe() and disconnect() methods are called in a context where
 1049  * they can sleep, but they should avoid abusing the privilege.  Most
 1050  * work to connect to a device should be done when the device is opened,
 1051  * and undone at the last close.  The disconnect code needs to address
 1052  * concurrency issues with respect to open() and close() methods, as
 1053  * well as forcing all pending I/O requests to complete (by unlinking
 1054  * them as necessary, and blocking until the unlinks complete).
 1055  */
 1056 struct usb_driver {
 1057 	const char *name;
 1058 
 1059 	int (*probe) (struct usb_interface *intf,
 1060 		      const struct usb_device_id *id);
 1061 
 1062 	void (*disconnect) (struct usb_interface *intf);
 1063 
 1064 	int (*unlocked_ioctl) (struct usb_interface *intf, unsigned int code,
 1065 			void *buf);
 1066 
 1067 	int (*suspend) (struct usb_interface *intf, pm_message_t message);
 1068 	int (*resume) (struct usb_interface *intf);
 1069 	int (*reset_resume)(struct usb_interface *intf);
 1070 
 1071 	int (*pre_reset)(struct usb_interface *intf);
 1072 	int (*post_reset)(struct usb_interface *intf);
 1073 
 1074 	const struct usb_device_id *id_table;
 1075 
 1076 	struct usb_dynids dynids;
 1077 	struct usbdrv_wrap drvwrap;
 1078 	unsigned int no_dynamic_id:1;
 1079 	unsigned int supports_autosuspend:1;
 1080 	unsigned int disable_hub_initiated_lpm:1;
 1081 	unsigned int soft_unbind:1;
 1082 };
 1083 #define	to_usb_driver(d) container_of(d, struct usb_driver, drvwrap.driver)
 1084 
 1085 /**
 1086  * struct usb_device_driver - identifies USB device driver to usbcore
 1087  * @name: The driver name should be unique among USB drivers,
 1088  *	and should normally be the same as the module name.
 1089  * @probe: Called to see if the driver is willing to manage a particular
 1090  *	device.  If it is, probe returns zero and uses dev_set_drvdata()
 1091  *	to associate driver-specific data with the device.  If unwilling
 1092  *	to manage the device, return a negative errno value.
 1093  * @disconnect: Called when the device is no longer accessible, usually
 1094  *	because it has been (or is being) disconnected or the driver's
 1095  *	module is being unloaded.
 1096  * @suspend: Called when the device is going to be suspended by the system.
 1097  * @resume: Called when the device is being resumed by the system.
 1098  * @drvwrap: Driver-model core structure wrapper.
 1099  * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend
 1100  *	for devices bound to this driver.
 1101  *
 1102  * USB drivers must provide all the fields listed above except drvwrap.
 1103  */
 1104 struct usb_device_driver {
 1105 	const char *name;
 1106 
 1107 	int (*probe) (struct usb_device *udev);
 1108 	void (*disconnect) (struct usb_device *udev);
 1109 
 1110 	int (*suspend) (struct usb_device *udev, pm_message_t message);
 1111 	int (*resume) (struct usb_device *udev, pm_message_t message);
 1112 	struct usbdrv_wrap drvwrap;
 1113 	unsigned int supports_autosuspend:1;
 1114 };
 1115 #define	to_usb_device_driver(d) container_of(d, struct usb_device_driver, \
 1116 		drvwrap.driver)
 1117 
 1118 extern struct bus_type usb_bus_type;
 1119 
 1120 /**
 1121  * struct usb_class_driver - identifies a USB driver that wants to use the USB major number
 1122  * @name: the usb class device name for this driver.  Will show up in sysfs.
 1123  * @devnode: Callback to provide a naming hint for a possible
 1124  *	device node to create.
 1125  * @fops: pointer to the struct file_operations of this driver.
 1126  * @minor_base: the start of the minor range for this driver.
 1127  *
 1128  * This structure is used for the usb_register_dev() and
 1129  * usb_unregister_dev() functions, to consolidate a number of the
 1130  * parameters used for them.
 1131  */
 1132 struct usb_class_driver {
 1133 	char *name;
 1134 	char *(*devnode)(struct device *dev, umode_t *mode);
 1135 	const struct file_operations *fops;
 1136 	int minor_base;
 1137 };
 1138 
 1139 /*
 1140  * use these in module_init()/module_exit()
 1141  * and don't forget MODULE_DEVICE_TABLE(usb, ...)
 1142  */
 1143 extern int usb_register_driver(struct usb_driver *, struct module *,
 1144 			       const char *);
 1145 
 1146 /* use a define to avoid include chaining to get THIS_MODULE & friends */
 1147 #define usb_register(driver) \
 1148 	usb_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
 1149 
 1150 extern void usb_deregister(struct usb_driver *);
 1151 
 1152 /**
 1153  * module_usb_driver() - Helper macro for registering a USB driver
 1154  * @__usb_driver: usb_driver struct
 1155  *
 1156  * Helper macro for USB drivers which do not do anything special in module
 1157  * init/exit. This eliminates a lot of boilerplate. Each module may only
 1158  * use this macro once, and calling it replaces module_init() and module_exit()
 1159  */
 1160 #define module_usb_driver(__usb_driver) \
 1161 	module_driver(__usb_driver, usb_register, \
 1162 		       usb_deregister)
 1163 
 1164 extern int usb_register_device_driver(struct usb_device_driver *,
 1165 			struct module *);
 1166 extern void usb_deregister_device_driver(struct usb_device_driver *);
 1167 
 1168 extern int usb_register_dev(struct usb_interface *intf,
 1169 			    struct usb_class_driver *class_driver);
 1170 extern void usb_deregister_dev(struct usb_interface *intf,
 1171 			       struct usb_class_driver *class_driver);
 1172 
 1173 extern int usb_disabled(void);
 1174 
 1175 /* ----------------------------------------------------------------------- */
 1176 
 1177 /*
 1178  * URB support, for asynchronous request completions
 1179  */
 1180 
 1181 /*
 1182  * urb->transfer_flags:
 1183  *
 1184  * Note: URB_DIR_IN/OUT is automatically set in usb_submit_urb().
 1185  */
 1186 #define URB_SHORT_NOT_OK	0x0001	/* report short reads as errors */
 1187 #define URB_ISO_ASAP		0x0002	/* iso-only; use the first unexpired
 1188 					 * slot in the schedule */
 1189 #define URB_NO_TRANSFER_DMA_MAP	0x0004	/* urb->transfer_dma valid on submit */
 1190 #define URB_NO_FSBR		0x0020	/* UHCI-specific */
 1191 #define URB_ZERO_PACKET		0x0040	/* Finish bulk OUT with short packet */
 1192 #define URB_NO_INTERRUPT	0x0080	/* HINT: no non-error interrupt
 1193 					 * needed */
 1194 #define URB_FREE_BUFFER		0x0100	/* Free transfer buffer with the URB */
 1195 
 1196 /* The following flags are used internally by usbcore and HCDs */
 1197 #define URB_DIR_IN		0x0200	/* Transfer from device to host */
 1198 #define URB_DIR_OUT		0
 1199 #define URB_DIR_MASK		URB_DIR_IN
 1200 
 1201 #define URB_DMA_MAP_SINGLE	0x00010000	/* Non-scatter-gather mapping */
 1202 #define URB_DMA_MAP_PAGE	0x00020000	/* HCD-unsupported S-G */
 1203 #define URB_DMA_MAP_SG		0x00040000	/* HCD-supported S-G */
 1204 #define URB_MAP_LOCAL		0x00080000	/* HCD-local-memory mapping */
 1205 #define URB_SETUP_MAP_SINGLE	0x00100000	/* Setup packet DMA mapped */
 1206 #define URB_SETUP_MAP_LOCAL	0x00200000	/* HCD-local setup packet */
 1207 #define URB_DMA_SG_COMBINED	0x00400000	/* S-G entries were combined */
 1208 #define URB_ALIGNED_TEMP_BUFFER	0x00800000	/* Temp buffer was alloc'd */
 1209 
 1210 struct usb_iso_packet_descriptor {
 1211 	unsigned int offset;
 1212 	unsigned int length;		/* expected length */
 1213 	unsigned int actual_length;
 1214 	int status;
 1215 };
 1216 
 1217 struct urb;
 1218 
 1219 struct usb_anchor {
 1220 	struct list_head urb_list;
 1221 	wait_queue_head_t wait;
 1222 	spinlock_t lock;
 1223 	atomic_t suspend_wakeups;
 1224 	unsigned int poisoned:1;
 1225 };
 1226 
 1227 static inline void init_usb_anchor(struct usb_anchor *anchor)
 1228 {
 1229 	memset(anchor, 0, sizeof(*anchor));
 1230 	INIT_LIST_HEAD(&anchor->urb_list);
 1231 	init_waitqueue_head(&anchor->wait);
 1232 	spin_lock_init(&anchor->lock);
 1233 }
 1234 
 1235 typedef void (*usb_complete_t)(struct urb *);
 1236 
 1237 /**
 1238  * struct urb - USB Request Block
 1239  * @urb_list: For use by current owner of the URB.
 1240  * @anchor_list: membership in the list of an anchor
 1241  * @anchor: to anchor URBs to a common mooring
 1242  * @ep: Points to the endpoint's data structure.  Will eventually
 1243  *	replace @pipe.
 1244  * @pipe: Holds endpoint number, direction, type, and more.
 1245  *	Create these values with the eight macros available;
 1246  *	usb_{snd,rcv}TYPEpipe(dev,endpoint), where the TYPE is "ctrl"
 1247  *	(control), "bulk", "int" (interrupt), or "iso" (isochronous).
 1248  *	For example usb_sndbulkpipe() or usb_rcvintpipe().  Endpoint
 1249  *	numbers range from zero to fifteen.  Note that "in" endpoint two
 1250  *	is a different endpoint (and pipe) from "out" endpoint two.
 1251  *	The current configuration controls the existence, type, and
 1252  *	maximum packet size of any given endpoint.
 1253  * @stream_id: the endpoint's stream ID for bulk streams
 1254  * @dev: Identifies the USB device to perform the request.
 1255  * @status: This is read in non-iso completion functions to get the
 1256  *	status of the particular request.  ISO requests only use it
 1257  *	to tell whether the URB was unlinked; detailed status for
 1258  *	each frame is in the fields of the iso_frame-desc.
 1259  * @transfer_flags: A variety of flags may be used to affect how URB
 1260  *	submission, unlinking, or operation are handled.  Different
 1261  *	kinds of URB can use different flags.
 1262  * @transfer_buffer:  This identifies the buffer to (or from) which the I/O
 1263  *	request will be performed unless URB_NO_TRANSFER_DMA_MAP is set
 1264  *	(however, do not leave garbage in transfer_buffer even then).
 1265  *	This buffer must be suitable for DMA; allocate it with
 1266  *	kmalloc() or equivalent.  For transfers to "in" endpoints, contents
 1267  *	of this buffer will be modified.  This buffer is used for the data
 1268  *	stage of control transfers.
 1269  * @transfer_dma: When transfer_flags includes URB_NO_TRANSFER_DMA_MAP,
 1270  *	the device driver is saying that it provided this DMA address,
 1271  *	which the host controller driver should use in preference to the
 1272  *	transfer_buffer.
 1273  * @sg: scatter gather buffer list, the buffer size of each element in
 1274  * 	the list (except the last) must be divisible by the endpoint's
 1275  * 	max packet size if no_sg_constraint isn't set in 'struct usb_bus'
 1276  * @num_mapped_sgs: (internal) number of mapped sg entries
 1277  * @num_sgs: number of entries in the sg list
 1278  * @transfer_buffer_length: How big is transfer_buffer.  The transfer may
 1279  *	be broken up into chunks according to the current maximum packet
 1280  *	size for the endpoint, which is a function of the configuration
 1281  *	and is encoded in the pipe.  When the length is zero, neither
 1282  *	transfer_buffer nor transfer_dma is used.
 1283  * @actual_length: This is read in non-iso completion functions, and
 1284  *	it tells how many bytes (out of transfer_buffer_length) were
 1285  *	transferred.  It will normally be the same as requested, unless
 1286  *	either an error was reported or a short read was performed.
 1287  *	The URB_SHORT_NOT_OK transfer flag may be used to make such
 1288  *	short reads be reported as errors.
 1289  * @setup_packet: Only used for control transfers, this points to eight bytes
 1290  *	of setup data.  Control transfers always start by sending this data
 1291  *	to the device.  Then transfer_buffer is read or written, if needed.
 1292  * @setup_dma: DMA pointer for the setup packet.  The caller must not use
 1293  *	this field; setup_packet must point to a valid buffer.
 1294  * @start_frame: Returns the initial frame for isochronous transfers.
 1295  * @number_of_packets: Lists the number of ISO transfer buffers.
 1296  * @interval: Specifies the polling interval for interrupt or isochronous
 1297  *	transfers.  The units are frames (milliseconds) for full and low
 1298  *	speed devices, and microframes (1/8 millisecond) for highspeed
 1299  *	and SuperSpeed devices.
 1300  * @error_count: Returns the number of ISO transfers that reported errors.
 1301  * @context: For use in completion functions.  This normally points to
 1302  *	request-specific driver context.
 1303  * @complete: Completion handler. This URB is passed as the parameter to the
 1304  *	completion function.  The completion function may then do what
 1305  *	it likes with the URB, including resubmitting or freeing it.
 1306  * @iso_frame_desc: Used to provide arrays of ISO transfer buffers and to
 1307  *	collect the transfer status for each buffer.
 1308  *
 1309  * This structure identifies USB transfer requests.  URBs must be allocated by
 1310  * calling usb_alloc_urb() and freed with a call to usb_free_urb().
 1311  * Initialization may be done using various usb_fill_*_urb() functions.  URBs
 1312  * are submitted using usb_submit_urb(), and pending requests may be canceled
 1313  * using usb_unlink_urb() or usb_kill_urb().
 1314  *
 1315  * Data Transfer Buffers:
 1316  *
 1317  * Normally drivers provide I/O buffers allocated with kmalloc() or otherwise
 1318  * taken from the general page pool.  That is provided by transfer_buffer
 1319  * (control requests also use setup_packet), and host controller drivers
 1320  * perform a dma mapping (and unmapping) for each buffer transferred.  Those
 1321  * mapping operations can be expensive on some platforms (perhaps using a dma
 1322  * bounce buffer or talking to an IOMMU),
 1323  * although they're cheap on commodity x86 and ppc hardware.
 1324  *
 1325  * Alternatively, drivers may pass the URB_NO_TRANSFER_DMA_MAP transfer flag,
 1326  * which tells the host controller driver that no such mapping is needed for
 1327  * the transfer_buffer since
 1328  * the device driver is DMA-aware.  For example, a device driver might
 1329  * allocate a DMA buffer with usb_alloc_coherent() or call usb_buffer_map().
 1330  * When this transfer flag is provided, host controller drivers will
 1331  * attempt to use the dma address found in the transfer_dma
 1332  * field rather than determining a dma address themselves.
 1333  *
 1334  * Note that transfer_buffer must still be set if the controller
 1335  * does not support DMA (as indicated by bus.uses_dma) and when talking
 1336  * to root hub. If you have to trasfer between highmem zone and the device
 1337  * on such controller, create a bounce buffer or bail out with an error.
 1338  * If transfer_buffer cannot be set (is in highmem) and the controller is DMA
 1339  * capable, assign NULL to it, so that usbmon knows not to use the value.
 1340  * The setup_packet must always be set, so it cannot be located in highmem.
 1341  *
 1342  * Initialization:
 1343  *
 1344  * All URBs submitted must initialize the dev, pipe, transfer_flags (may be
 1345  * zero), and complete fields.  All URBs must also initialize
 1346  * transfer_buffer and transfer_buffer_length.  They may provide the
 1347  * URB_SHORT_NOT_OK transfer flag, indicating that short reads are
 1348  * to be treated as errors; that flag is invalid for write requests.
 1349  *
 1350  * Bulk URBs may
 1351  * use the URB_ZERO_PACKET transfer flag, indicating that bulk OUT transfers
 1352  * should always terminate with a short packet, even if it means adding an
 1353  * extra zero length packet.
 1354  *
 1355  * Control URBs must provide a valid pointer in the setup_packet field.
 1356  * Unlike the transfer_buffer, the setup_packet may not be mapped for DMA
 1357  * beforehand.
 1358  *
 1359  * Interrupt URBs must provide an interval, saying how often (in milliseconds
 1360  * or, for highspeed devices, 125 microsecond units)
 1361  * to poll for transfers.  After the URB has been submitted, the interval
 1362  * field reflects how the transfer was actually scheduled.
 1363  * The polling interval may be more frequent than requested.
 1364  * For example, some controllers have a maximum interval of 32 milliseconds,
 1365  * while others support intervals of up to 1024 milliseconds.
 1366  * Isochronous URBs also have transfer intervals.  (Note that for isochronous
 1367  * endpoints, as well as high speed interrupt endpoints, the encoding of
 1368  * the transfer interval in the endpoint descriptor is logarithmic.
 1369  * Device drivers must convert that value to linear units themselves.)
 1370  *
 1371  * If an isochronous endpoint queue isn't already running, the host
 1372  * controller will schedule a new URB to start as soon as bandwidth
 1373  * utilization allows.  If the queue is running then a new URB will be
 1374  * scheduled to start in the first transfer slot following the end of the
 1375  * preceding URB, if that slot has not already expired.  If the slot has
 1376  * expired (which can happen when IRQ delivery is delayed for a long time),
 1377  * the scheduling behavior depends on the URB_ISO_ASAP flag.  If the flag
 1378  * is clear then the URB will be scheduled to start in the expired slot,
 1379  * implying that some of its packets will not be transferred; if the flag
 1380  * is set then the URB will be scheduled in the first unexpired slot,
 1381  * breaking the queue's synchronization.  Upon URB completion, the
 1382  * start_frame field will be set to the (micro)frame number in which the
 1383  * transfer was scheduled.  Ranges for frame counter values are HC-specific
 1384  * and can go from as low as 256 to as high as 65536 frames.
 1385  *
 1386  * Isochronous URBs have a different data transfer model, in part because
 1387  * the quality of service is only "best effort".  Callers provide specially
 1388  * allocated URBs, with number_of_packets worth of iso_frame_desc structures
 1389  * at the end.  Each such packet is an individual ISO transfer.  Isochronous
 1390  * URBs are normally queued, submitted by drivers to arrange that
 1391  * transfers are at least double buffered, and then explicitly resubmitted
 1392  * in completion handlers, so
 1393  * that data (such as audio or video) streams at as constant a rate as the
 1394  * host controller scheduler can support.
 1395  *
 1396  * Completion Callbacks:
 1397  *
 1398  * The completion callback is made in_interrupt(), and one of the first
 1399  * things that a completion handler should do is check the status field.
 1400  * The status field is provided for all URBs.  It is used to report
 1401  * unlinked URBs, and status for all non-ISO transfers.  It should not
 1402  * be examined before the URB is returned to the completion handler.
 1403  *
 1404  * The context field is normally used to link URBs back to the relevant
 1405  * driver or request state.
 1406  *
 1407  * When the completion callback is invoked for non-isochronous URBs, the
 1408  * actual_length field tells how many bytes were transferred.  This field
 1409  * is updated even when the URB terminated with an error or was unlinked.
 1410  *
 1411  * ISO transfer status is reported in the status and actual_length fields
 1412  * of the iso_frame_desc array, and the number of errors is reported in
 1413  * error_count.  Completion callbacks for ISO transfers will normally
 1414  * (re)submit URBs to ensure a constant transfer rate.
 1415  *
 1416  * Note that even fields marked "public" should not be touched by the driver
 1417  * when the urb is owned by the hcd, that is, since the call to
 1418  * usb_submit_urb() till the entry into the completion routine.
 1419  */
 1420 struct urb {
 1421 	/* private: usb core and host controller only fields in the urb */
 1422 	struct kref kref;		/* reference count of the URB */
 1423 	void *hcpriv;			/* private data for host controller */
 1424 	atomic_t use_count;		/* concurrent submissions counter */
 1425 	atomic_t reject;		/* submissions will fail */
 1426 	int unlinked;			/* unlink error code */
 1427 
 1428 	/* public: documented fields in the urb that can be used by drivers */
 1429 	struct list_head urb_list;	/* list head for use by the urb's
 1430 					 * current owner */
 1431 	struct list_head anchor_list;	/* the URB may be anchored */
 1432 	struct usb_anchor *anchor;
 1433 	struct usb_device *dev;		/* (in) pointer to associated device */
 1434 	struct usb_host_endpoint *ep;	/* (internal) pointer to endpoint */
 1435 	unsigned int pipe;		/* (in) pipe information */
 1436 	unsigned int stream_id;		/* (in) stream ID */
 1437 	int status;			/* (return) non-ISO status */
 1438 	unsigned int transfer_flags;	/* (in) URB_SHORT_NOT_OK | ...*/
 1439 	void *transfer_buffer;		/* (in) associated data buffer */
 1440 	dma_addr_t transfer_dma;	/* (in) dma addr for transfer_buffer */
 1441 	struct scatterlist *sg;		/* (in) scatter gather buffer list */
 1442 	int num_mapped_sgs;		/* (internal) mapped sg entries */
 1443 	int num_sgs;			/* (in) number of entries in the sg list */
 1444 	u32 transfer_buffer_length;	/* (in) data buffer length */
 1445 	u32 actual_length;		/* (return) actual transfer length */
 1446 	unsigned char *setup_packet;	/* (in) setup packet (control only) */
 1447 	dma_addr_t setup_dma;		/* (in) dma addr for setup_packet */
 1448 	int start_frame;		/* (modify) start frame (ISO) */
 1449 	int number_of_packets;		/* (in) number of ISO packets */
 1450 	int interval;			/* (modify) transfer interval
 1451 					 * (INT/ISO) */
 1452 	int error_count;		/* (return) number of ISO errors */
 1453 	void *context;			/* (in) context for completion */
 1454 	usb_complete_t complete;	/* (in) completion routine */
 1455 	struct usb_iso_packet_descriptor iso_frame_desc[0];
 1456 					/* (in) ISO ONLY */
 1457 };
 1458 
 1459 /* ----------------------------------------------------------------------- */
 1460 
 1461 /**
 1462  * usb_fill_control_urb - initializes a control urb
 1463  * @urb: pointer to the urb to initialize.
 1464  * @dev: pointer to the struct usb_device for this urb.
 1465  * @pipe: the endpoint pipe
 1466  * @setup_packet: pointer to the setup_packet buffer
 1467  * @transfer_buffer: pointer to the transfer buffer
 1468  * @buffer_length: length of the transfer buffer
 1469  * @complete_fn: pointer to the usb_complete_t function
 1470  * @context: what to set the urb context to.
 1471  *
 1472  * Initializes a control urb with the proper information needed to submit
 1473  * it to a device.
 1474  */
 1475 static inline void usb_fill_control_urb(struct urb *urb,
 1476 					struct usb_device *dev,
 1477 					unsigned int pipe,
 1478 					unsigned char *setup_packet,
 1479 					void *transfer_buffer,
 1480 					int buffer_length,
 1481 					usb_complete_t complete_fn,
 1482 					void *context)
 1483 {
 1484 	urb->dev = dev;
 1485 	urb->pipe = pipe;
 1486 	urb->setup_packet = setup_packet;
 1487 	urb->transfer_buffer = transfer_buffer;
 1488 	urb->transfer_buffer_length = buffer_length;
 1489 	urb->complete = complete_fn;
 1490 	urb->context = context;
 1491 }
 1492 
 1493 /**
 1494  * usb_fill_bulk_urb - macro to help initialize a bulk urb
 1495  * @urb: pointer to the urb to initialize.
 1496  * @dev: pointer to the struct usb_device for this urb.
 1497  * @pipe: the endpoint pipe
 1498  * @transfer_buffer: pointer to the transfer buffer
 1499  * @buffer_length: length of the transfer buffer
 1500  * @complete_fn: pointer to the usb_complete_t function
 1501  * @context: what to set the urb context to.
 1502  *
 1503  * Initializes a bulk urb with the proper information needed to submit it
 1504  * to a device.
 1505  */
 1506 static inline void usb_fill_bulk_urb(struct urb *urb,
 1507 				     struct usb_device *dev,
 1508 				     unsigned int pipe,
 1509 				     void *transfer_buffer,
 1510 				     int buffer_length,
 1511 				     usb_complete_t complete_fn,
 1512 				     void *context)
 1513 {
 1514 	urb->dev = dev;
 1515 	urb->pipe = pipe;
 1516 	urb->transfer_buffer = transfer_buffer;
 1517 	urb->transfer_buffer_length = buffer_length;
 1518 	urb->complete = complete_fn;
 1519 	urb->context = context;
 1520 }
 1521 
 1522 /**
 1523  * usb_fill_int_urb - macro to help initialize a interrupt urb
 1524  * @urb: pointer to the urb to initialize.
 1525  * @dev: pointer to the struct usb_device for this urb.
 1526  * @pipe: the endpoint pipe
 1527  * @transfer_buffer: pointer to the transfer buffer
 1528  * @buffer_length: length of the transfer buffer
 1529  * @complete_fn: pointer to the usb_complete_t function
 1530  * @context: what to set the urb context to.
 1531  * @interval: what to set the urb interval to, encoded like
 1532  *	the endpoint descriptor's bInterval value.
 1533  *
 1534  * Initializes a interrupt urb with the proper information needed to submit
 1535  * it to a device.
 1536  *
 1537  * Note that High Speed and SuperSpeed interrupt endpoints use a logarithmic
 1538  * encoding of the endpoint interval, and express polling intervals in
 1539  * microframes (eight per millisecond) rather than in frames (one per
 1540  * millisecond).
 1541  *
 1542  * Wireless USB also uses the logarithmic encoding, but specifies it in units of
 1543  * 128us instead of 125us.  For Wireless USB devices, the interval is passed
 1544  * through to the host controller, rather than being translated into microframe
 1545  * units.
 1546  */
 1547 static inline void usb_fill_int_urb(struct urb *urb,
 1548 				    struct usb_device *dev,
 1549 				    unsigned int pipe,
 1550 				    void *transfer_buffer,
 1551 				    int buffer_length,
 1552 				    usb_complete_t complete_fn,
 1553 				    void *context,
 1554 				    int interval)
 1555 {
 1556 	urb->dev = dev;
 1557 	urb->pipe = pipe;
 1558 	urb->transfer_buffer = transfer_buffer;
 1559 	urb->transfer_buffer_length = buffer_length;
 1560 	urb->complete = complete_fn;
 1561 	urb->context = context;
 1562 
 1563 	if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) {
 1564 		/* make sure interval is within allowed range */
 1565 		interval = clamp(interval, 1, 16);
 1566 
 1567 		urb->interval = 1 << (interval - 1);
 1568 	} else {
 1569 		urb->interval = interval;
 1570 	}
 1571 
 1572 	urb->start_frame = -1;
 1573 }
 1574 
 1575 extern void usb_init_urb(struct urb *urb);
 1576 extern struct urb *usb_alloc_urb(int iso_packets, gfp_t mem_flags);
 1577 extern void usb_free_urb(struct urb *urb);
 1578 #define usb_put_urb usb_free_urb
 1579 extern struct urb *usb_get_urb(struct urb *urb);
 1580 extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags);
 1581 extern int usb_unlink_urb(struct urb *urb);
 1582 extern void usb_kill_urb(struct urb *urb);
 1583 extern void usb_poison_urb(struct urb *urb);
 1584 extern void usb_unpoison_urb(struct urb *urb);
 1585 extern void usb_block_urb(struct urb *urb);
 1586 extern void usb_kill_anchored_urbs(struct usb_anchor *anchor);
 1587 extern void usb_poison_anchored_urbs(struct usb_anchor *anchor);
 1588 extern void usb_unpoison_anchored_urbs(struct usb_anchor *anchor);
 1589 extern void usb_unlink_anchored_urbs(struct usb_anchor *anchor);
 1590 extern void usb_anchor_suspend_wakeups(struct usb_anchor *anchor);
 1591 extern void usb_anchor_resume_wakeups(struct usb_anchor *anchor);
 1592 extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor);
 1593 extern void usb_unanchor_urb(struct urb *urb);
 1594 extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor,
 1595 					 unsigned int timeout);
 1596 extern struct urb *usb_get_from_anchor(struct usb_anchor *anchor);
 1597 extern void usb_scuttle_anchored_urbs(struct usb_anchor *anchor);
 1598 extern int usb_anchor_empty(struct usb_anchor *anchor);
 1599 
 1600 #define usb_unblock_urb	usb_unpoison_urb
 1601 
 1602 /**
 1603  * usb_urb_dir_in - check if an URB describes an IN transfer
 1604  * @urb: URB to be checked
 1605  *
 1606  * Return: 1 if @urb describes an IN transfer (device-to-host),
 1607  * otherwise 0.
 1608  */
 1609 static inline int usb_urb_dir_in(struct urb *urb)
 1610 {
 1611 	return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_IN;
 1612 }
 1613 
 1614 /**
 1615  * usb_urb_dir_out - check if an URB describes an OUT transfer
 1616  * @urb: URB to be checked
 1617  *
 1618  * Return: 1 if @urb describes an OUT transfer (host-to-device),
 1619  * otherwise 0.
 1620  */
 1621 static inline int usb_urb_dir_out(struct urb *urb)
 1622 {
 1623 	return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT;
 1624 }
 1625 
 1626 void *usb_alloc_coherent(struct usb_device *dev, size_t size,
 1627 	gfp_t mem_flags, dma_addr_t *dma);
 1628 void usb_free_coherent(struct usb_device *dev, size_t size,
 1629 	void *addr, dma_addr_t dma);
 1630 
 1631 #if 0
 1632 struct urb *usb_buffer_map(struct urb *urb);
 1633 void usb_buffer_dmasync(struct urb *urb);
 1634 void usb_buffer_unmap(struct urb *urb);
 1635 #endif
 1636 
 1637 struct scatterlist;
 1638 int usb_buffer_map_sg(const struct usb_device *dev, int is_in,
 1639 		      struct scatterlist *sg, int nents);
 1640 #if 0
 1641 void usb_buffer_dmasync_sg(const struct usb_device *dev, int is_in,
 1642 			   struct scatterlist *sg, int n_hw_ents);
 1643 #endif
 1644 void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in,
 1645 			 struct scatterlist *sg, int n_hw_ents);
 1646 
 1647 /*-------------------------------------------------------------------*
 1648  *                         SYNCHRONOUS CALL SUPPORT                  *
 1649  *-------------------------------------------------------------------*/
 1650 
 1651 extern int usb_control_msg(struct usb_device *dev, unsigned int pipe,
 1652 	__u8 request, __u8 requesttype, __u16 value, __u16 index,
 1653 	void *data, __u16 size, int timeout);
 1654 extern int usb_interrupt_msg(struct usb_device *usb_dev, unsigned int pipe,
 1655 	void *data, int len, int *actual_length, int timeout);
 1656 extern int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,
 1657 	void *data, int len, int *actual_length,
 1658 	int timeout);
 1659 
 1660 /* wrappers around usb_control_msg() for the most common standard requests */
 1661 extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype,
 1662 	unsigned char descindex, void *buf, int size);
 1663 extern int usb_get_status(struct usb_device *dev,
 1664 	int type, int target, void *data);
 1665 extern int usb_string(struct usb_device *dev, int index,
 1666 	char *buf, size_t size);
 1667 
 1668 /* wrappers that also update important state inside usbcore */
 1669 extern int usb_clear_halt(struct usb_device *dev, int pipe);
 1670 extern int usb_reset_configuration(struct usb_device *dev);
 1671 extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate);
 1672 extern void usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr);
 1673 
 1674 /* this request isn't really synchronous, but it belongs with the others */
 1675 extern int usb_driver_set_configuration(struct usb_device *udev, int config);
 1676 
 1677 /* choose and set configuration for device */
 1678 extern int usb_choose_configuration(struct usb_device *udev);
 1679 extern int usb_set_configuration(struct usb_device *dev, int configuration);
 1680 
 1681 /*
 1682  * timeouts, in milliseconds, used for sending/receiving control messages
 1683  * they typically complete within a few frames (msec) after they're issued
 1684  * USB identifies 5 second timeouts, maybe more in a few cases, and a few
 1685  * slow devices (like some MGE Ellipse UPSes) actually push that limit.
 1686  */
 1687 #define USB_CTRL_GET_TIMEOUT	5000
 1688 #define USB_CTRL_SET_TIMEOUT	5000
 1689 
 1690 
 1691 /**
 1692  * struct usb_sg_request - support for scatter/gather I/O
 1693  * @status: zero indicates success, else negative errno
 1694  * @bytes: counts bytes transferred.
 1695  *
 1696  * These requests are initialized using usb_sg_init(), and then are used
 1697  * as request handles passed to usb_sg_wait() or usb_sg_cancel().  Most
 1698  * members of the request object aren't for driver access.
 1699  *
 1700  * The status and bytecount values are valid only after usb_sg_wait()
 1701  * returns.  If the status is zero, then the bytecount matches the total
 1702  * from the request.
 1703  *
 1704  * After an error completion, drivers may need to clear a halt condition
 1705  * on the endpoint.
 1706  */
 1707 struct usb_sg_request {
 1708 	int			status;
 1709 	size_t			bytes;
 1710 
 1711 	/* private:
 1712 	 * members below are private to usbcore,
 1713 	 * and are not provided for driver access!
 1714 	 */
 1715 	spinlock_t		lock;
 1716 
 1717 	struct usb_device	*dev;
 1718 	int			pipe;
 1719 
 1720 	int			entries;
 1721 	struct urb		**urbs;
 1722 
 1723 	int			count;
 1724 	struct completion	complete;
 1725 };
 1726 
 1727 int usb_sg_init(
 1728 	struct usb_sg_request	*io,
 1729 	struct usb_device	*dev,
 1730 	unsigned		pipe,
 1731 	unsigned		period,
 1732 	struct scatterlist	*sg,
 1733 	int			nents,
 1734 	size_t			length,
 1735 	gfp_t			mem_flags
 1736 );
 1737 void usb_sg_cancel(struct usb_sg_request *io);
 1738 void usb_sg_wait(struct usb_sg_request *io);
 1739 
 1740 
 1741 /* ----------------------------------------------------------------------- */
 1742 
 1743 /*
 1744  * For various legacy reasons, Linux has a small cookie that's paired with
 1745  * a struct usb_device to identify an endpoint queue.  Queue characteristics
 1746  * are defined by the endpoint's descriptor.  This cookie is called a "pipe",
 1747  * an unsigned int encoded as:
 1748  *
 1749  *  - direction:	bit 7		(0 = Host-to-Device [Out],
 1750  *					 1 = Device-to-Host [In] ...
 1751  *					like endpoint bEndpointAddress)
 1752  *  - device address:	bits 8-14       ... bit positions known to uhci-hcd
 1753  *  - endpoint:		bits 15-18      ... bit positions known to uhci-hcd
 1754  *  - pipe type:	bits 30-31	(00 = isochronous, 01 = interrupt,
 1755  *					 10 = control, 11 = bulk)
 1756  *
 1757  * Given the device address and endpoint descriptor, pipes are redundant.
 1758  */
 1759 
 1760 /* NOTE:  these are not the standard USB_ENDPOINT_XFER_* values!! */
 1761 /* (yet ... they're the values used by usbfs) */
 1762 #define PIPE_ISOCHRONOUS		0
 1763 #define PIPE_INTERRUPT			1
 1764 #define PIPE_CONTROL			2
 1765 #define PIPE_BULK			3
 1766 
 1767 #define usb_pipein(pipe)	((pipe) & USB_DIR_IN)
 1768 #define usb_pipeout(pipe)	(!usb_pipein(pipe))
 1769 
 1770 #define usb_pipedevice(pipe)	(((pipe) >> 8) & 0x7f)
 1771 #define usb_pipeendpoint(pipe)	(((pipe) >> 15) & 0xf)
 1772 
 1773 #define usb_pipetype(pipe)	(((pipe) >> 30) & 3)
 1774 #define usb_pipeisoc(pipe)	(usb_pipetype((pipe)) == PIPE_ISOCHRONOUS)
 1775 #define usb_pipeint(pipe)	(usb_pipetype((pipe)) == PIPE_INTERRUPT)
 1776 #define usb_pipecontrol(pipe)	(usb_pipetype((pipe)) == PIPE_CONTROL)
 1777 #define usb_pipebulk(pipe)	(usb_pipetype((pipe)) == PIPE_BULK)
 1778 
 1779 static inline unsigned int __create_pipe(struct usb_device *dev,
 1780 		unsigned int endpoint)
 1781 {
 1782 	return (dev->devnum << 8) | (endpoint << 15);
 1783 }
 1784 
 1785 /* Create various pipes... */
 1786 #define usb_sndctrlpipe(dev, endpoint)	\
 1787 	((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint))
 1788 #define usb_rcvctrlpipe(dev, endpoint)	\
 1789 	((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN)
 1790 #define usb_sndisocpipe(dev, endpoint)	\
 1791 	((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint))
 1792 #define usb_rcvisocpipe(dev, endpoint)	\
 1793 	((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN)
 1794 #define usb_sndbulkpipe(dev, endpoint)	\
 1795 	((PIPE_BULK << 30) | __create_pipe(dev, endpoint))
 1796 #define usb_rcvbulkpipe(dev, endpoint)	\
 1797 	((PIPE_BULK << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN)
 1798 #define usb_sndintpipe(dev, endpoint)	\
 1799 	((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint))
 1800 #define usb_rcvintpipe(dev, endpoint)	\
 1801 	((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN)
 1802 
 1803 static inline struct usb_host_endpoint *
 1804 usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe)
 1805 {
 1806 	struct usb_host_endpoint **eps;
 1807 	eps = usb_pipein(pipe) ? dev->ep_in : dev->ep_out;
 1808 	return eps[usb_pipeendpoint(pipe)];
 1809 }
 1810 
 1811 /*-------------------------------------------------------------------------*/
 1812 
 1813 static inline __u16
 1814 usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
 1815 {
 1816 	struct usb_host_endpoint	*ep;
 1817 	unsigned			epnum = usb_pipeendpoint(pipe);
 1818 
 1819 	if (is_out) {
 1820 		WARN_ON(usb_pipein(pipe));
 1821 		ep = udev->ep_out[epnum];
 1822 	} else {
 1823 		WARN_ON(usb_pipeout(pipe));
 1824 		ep = udev->ep_in[epnum];
 1825 	}
 1826 	if (!ep)
 1827 		return 0;
 1828 
 1829 	/* NOTE:  only 0x07ff bits are for packet size... */
 1830 	return usb_endpoint_maxp(&ep->desc);
 1831 }
 1832 
 1833 /* ----------------------------------------------------------------------- */
 1834 
 1835 /* translate USB error codes to codes user space understands */
 1836 static inline int usb_translate_errors(int error_code)
 1837 {
 1838 	switch (error_code) {
 1839 	case 0:
 1840 	case -ENOMEM:
 1841 	case -ENODEV:
 1842 	case -EOPNOTSUPP:
 1843 		return error_code;
 1844 	default:
 1845 		return -EIO;
 1846 	}
 1847 }
 1848 
 1849 /* Events from the usb core */
 1850 #define USB_DEVICE_ADD		0x0001
 1851 #define USB_DEVICE_REMOVE	0x0002
 1852 #define USB_BUS_ADD		0x0003
 1853 #define USB_BUS_REMOVE		0x0004
 1854 extern void usb_register_notify(struct notifier_block *nb);
 1855 extern void usb_unregister_notify(struct notifier_block *nb);
 1856 
 1857 /* debugfs stuff */
 1858 extern struct dentry *usb_debug_root;
 1859 
 1860 /* LED triggers */
 1861 enum usb_led_event {
 1862 	USB_LED_EVENT_HOST = 0,
 1863 	USB_LED_EVENT_GADGET = 1,
 1864 };
 1865 
 1866 #ifdef CONFIG_USB_LED_TRIG
 1867 extern void usb_led_activity(enum usb_led_event ev);
 1868 #else
 1869 static inline void usb_led_activity(enum usb_led_event ev) {}
 1870 #endif
 1871 
 1872 #endif  /* __KERNEL__ */
 1873 
 1874 #endif                 1 /*
    2  * This file holds USB constants and structures that are needed for
    3  * USB device APIs.  These are used by the USB device model, which is
    4  * defined in chapter 9 of the USB 2.0 specification and in the
    5  * Wireless USB 1.0 (spread around).  Linux has several APIs in C that
    6  * need these:
    7  *
    8  * - the master/host side Linux-USB kernel driver API;
    9  * - the "usbfs" user space API; and
   10  * - the Linux "gadget" slave/device/peripheral side driver API.
   11  *
   12  * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems
   13  * act either as a USB master/host or as a USB slave/device.  That means
   14  * the master and slave side APIs benefit from working well together.
   15  *
   16  * There's also "Wireless USB", using low power short range radios for
   17  * peripheral interconnection but otherwise building on the USB framework.
   18  *
   19  * Note all descriptors are declared '__attribute__((packed))' so that:
   20  *
   21  * [a] they never get padded, either internally (USB spec writers
   22  *     probably handled that) or externally;
   23  *
   24  * [b] so that accessing bigger-than-a-bytes fields will never
   25  *     generate bus errors on any platform, even when the location of
   26  *     its descriptor inside a bundle isn't "naturally aligned", and
   27  *
   28  * [c] for consistency, removing all doubt even when it appears to
   29  *     someone that the two other points are non-issues for that
   30  *     particular descriptor type.
   31  */
   32 
   33 #ifndef _UAPI__LINUX_USB_CH9_H
   34 #define _UAPI__LINUX_USB_CH9_H
   35 
   36 #include <linux/types.h>	/* __u8 etc */
   37 #include <asm/byteorder.h>	/* le16_to_cpu */
   38 
   39 /*-------------------------------------------------------------------------*/
   40 
   41 /* CONTROL REQUEST SUPPORT */
   42 
   43 /*
   44  * USB directions
   45  *
   46  * This bit flag is used in endpoint descriptors' bEndpointAddress field.
   47  * It's also one of three fields in control requests bRequestType.
   48  */
   49 #define USB_DIR_OUT			0		/* to device */
   50 #define USB_DIR_IN			0x80		/* to host */
   51 
   52 /*
   53  * USB types, the second of three bRequestType fields
   54  */
   55 #define USB_TYPE_MASK			(0x03 << 5)
   56 #define USB_TYPE_STANDARD		(0x00 << 5)
   57 #define USB_TYPE_CLASS			(0x01 << 5)
   58 #define USB_TYPE_VENDOR			(0x02 << 5)
   59 #define USB_TYPE_RESERVED		(0x03 << 5)
   60 
   61 /*
   62  * USB recipients, the third of three bRequestType fields
   63  */
   64 #define USB_RECIP_MASK			0x1f
   65 #define USB_RECIP_DEVICE		0x00
   66 #define USB_RECIP_INTERFACE		0x01
   67 #define USB_RECIP_ENDPOINT		0x02
   68 #define USB_RECIP_OTHER			0x03
   69 /* From Wireless USB 1.0 */
   70 #define USB_RECIP_PORT			0x04
   71 #define USB_RECIP_RPIPE		0x05
   72 
   73 /*
   74  * Standard requests, for the bRequest field of a SETUP packet.
   75  *
   76  * These are qualified by the bRequestType field, so that for example
   77  * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved
   78  * by a GET_STATUS request.
   79  */
   80 #define USB_REQ_GET_STATUS		0x00
   81 #define USB_REQ_CLEAR_FEATURE		0x01
   82 #define USB_REQ_SET_FEATURE		0x03
   83 #define USB_REQ_SET_ADDRESS		0x05
   84 #define USB_REQ_GET_DESCRIPTOR		0x06
   85 #define USB_REQ_SET_DESCRIPTOR		0x07
   86 #define USB_REQ_GET_CONFIGURATION	0x08
   87 #define USB_REQ_SET_CONFIGURATION	0x09
   88 #define USB_REQ_GET_INTERFACE		0x0A
   89 #define USB_REQ_SET_INTERFACE		0x0B
   90 #define USB_REQ_SYNCH_FRAME		0x0C
   91 #define USB_REQ_SET_SEL			0x30
   92 #define USB_REQ_SET_ISOCH_DELAY		0x31
   93 
   94 #define USB_REQ_SET_ENCRYPTION		0x0D	/* Wireless USB */
   95 #define USB_REQ_GET_ENCRYPTION		0x0E
   96 #define USB_REQ_RPIPE_ABORT		0x0E
   97 #define USB_REQ_SET_HANDSHAKE		0x0F
   98 #define USB_REQ_RPIPE_RESET		0x0F
   99 #define USB_REQ_GET_HANDSHAKE		0x10
  100 #define USB_REQ_SET_CONNECTION		0x11
  101 #define USB_REQ_SET_SECURITY_DATA	0x12
  102 #define USB_REQ_GET_SECURITY_DATA	0x13
  103 #define USB_REQ_SET_WUSB_DATA		0x14
  104 #define USB_REQ_LOOPBACK_DATA_WRITE	0x15
  105 #define USB_REQ_LOOPBACK_DATA_READ	0x16
  106 #define USB_REQ_SET_INTERFACE_DS	0x17
  107 
  108 /* The Link Power Management (LPM) ECN defines USB_REQ_TEST_AND_SET command,
  109  * used by hubs to put ports into a new L1 suspend state, except that it
  110  * forgot to define its number ...
  111  */
  112 
  113 /*
  114  * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
  115  * are read as a bit array returned by USB_REQ_GET_STATUS.  (So there
  116  * are at most sixteen features of each type.)  Hubs may also support a
  117  * new USB_REQ_TEST_AND_SET_FEATURE to put ports into L1 suspend.
  118  */
  119 #define USB_DEVICE_SELF_POWERED		0	/* (read only) */
  120 #define USB_DEVICE_REMOTE_WAKEUP	1	/* dev may initiate wakeup */
  121 #define USB_DEVICE_TEST_MODE		2	/* (wired high speed only) */
  122 #define USB_DEVICE_BATTERY		2	/* (wireless) */
  123 #define USB_DEVICE_B_HNP_ENABLE		3	/* (otg) dev may initiate HNP */
  124 #define USB_DEVICE_WUSB_DEVICE		3	/* (wireless)*/
  125 #define USB_DEVICE_A_HNP_SUPPORT	4	/* (otg) RH port supports HNP */
  126 #define USB_DEVICE_A_ALT_HNP_SUPPORT	5	/* (otg) other RH port does */
  127 #define USB_DEVICE_DEBUG_MODE		6	/* (special devices only) */
  128 
  129 /*
  130  * Test Mode Selectors
  131  * See USB 2.0 spec Table 9-7
  132  */
  133 #define	TEST_J		1
  134 #define	TEST_K		2
  135 #define	TEST_SE0_NAK	3
  136 #define	TEST_PACKET	4
  137 #define	TEST_FORCE_EN	5
  138 
  139 /*
  140  * New Feature Selectors as added by USB 3.0
  141  * See USB 3.0 spec Table 9-7
  142  */
  143 #define USB_DEVICE_U1_ENABLE	48	/* dev may initiate U1 transition */
  144 #define USB_DEVICE_U2_ENABLE	49	/* dev may initiate U2 transition */
  145 #define USB_DEVICE_LTM_ENABLE	50	/* dev may send LTM */
  146 #define USB_INTRF_FUNC_SUSPEND	0	/* function suspend */
  147 
  148 #define USB_INTR_FUNC_SUSPEND_OPT_MASK	0xFF00
  149 /*
  150  * Suspend Options, Table 9-8 USB 3.0 spec
  151  */
  152 #define USB_INTRF_FUNC_SUSPEND_LP	(1 << (8 + 0))
  153 #define USB_INTRF_FUNC_SUSPEND_RW	(1 << (8 + 1))
  154 
  155 /*
  156  * Interface status, Figure 9-5 USB 3.0 spec
  157  */
  158 #define USB_INTRF_STAT_FUNC_RW_CAP     1
  159 #define USB_INTRF_STAT_FUNC_RW         2
  160 
  161 #define USB_ENDPOINT_HALT		0	/* IN/OUT will STALL */
  162 
  163 /* Bit array elements as returned by the USB_REQ_GET_STATUS request. */
  164 #define USB_DEV_STAT_U1_ENABLED		2	/* transition into U1 state */
  165 #define USB_DEV_STAT_U2_ENABLED		3	/* transition into U2 state */
  166 #define USB_DEV_STAT_LTM_ENABLED	4	/* Latency tolerance messages */
  167 
  168 /**
  169  * struct usb_ctrlrequest - SETUP data for a USB device control request
  170  * @bRequestType: matches the USB bmRequestType field
  171  * @bRequest: matches the USB bRequest field
  172  * @wValue: matches the USB wValue field (le16 byte order)
  173  * @wIndex: matches the USB wIndex field (le16 byte order)
  174  * @wLength: matches the USB wLength field (le16 byte order)
  175  *
  176  * This structure is used to send control requests to a USB device.  It matches
  177  * the different fields of the USB 2.0 Spec section 9.3, table 9-2.  See the
  178  * USB spec for a fuller description of the different fields, and what they are
  179  * used for.
  180  *
  181  * Note that the driver for any interface can issue control requests.
  182  * For most devices, interfaces don't coordinate with each other, so
  183  * such requests may be made at any time.
  184  */
  185 struct usb_ctrlrequest {
  186 	__u8 bRequestType;
  187 	__u8 bRequest;
  188 	__le16 wValue;
  189 	__le16 wIndex;
  190 	__le16 wLength;
  191 } __attribute__ ((packed));
  192 
  193 /*-------------------------------------------------------------------------*/
  194 
  195 /*
  196  * STANDARD DESCRIPTORS ... as returned by GET_DESCRIPTOR, or
  197  * (rarely) accepted by SET_DESCRIPTOR.
  198  *
  199  * Note that all multi-byte values here are encoded in little endian
  200  * byte order "on the wire".  Within the kernel and when exposed
  201  * through the Linux-USB APIs, they are not converted to cpu byte
  202  * order; it is the responsibility of the client code to do this.
  203  * The single exception is when device and configuration descriptors (but
  204  * not other descriptors) are read from usbfs (i.e. /proc/bus/usb/BBB/DDD);
  205  * in this case the fields are converted to host endianness by the kernel.
  206  */
  207 
  208 /*
  209  * Descriptor types ... USB 2.0 spec table 9.5
  210  */
  211 #define USB_DT_DEVICE			0x01
  212 #define USB_DT_CONFIG			0x02
  213 #define USB_DT_STRING			0x03
  214 #define USB_DT_INTERFACE		0x04
  215 #define USB_DT_ENDPOINT			0x05
  216 #define USB_DT_DEVICE_QUALIFIER		0x06
  217 #define USB_DT_OTHER_SPEED_CONFIG	0x07
  218 #define USB_DT_INTERFACE_POWER		0x08
  219 /* these are from a minor usb 2.0 revision (ECN) */
  220 #define USB_DT_OTG			0x09
  221 #define USB_DT_DEBUG			0x0a
  222 #define USB_DT_INTERFACE_ASSOCIATION	0x0b
  223 /* these are from the Wireless USB spec */
  224 #define USB_DT_SECURITY			0x0c
  225 #define USB_DT_KEY			0x0d
  226 #define USB_DT_ENCRYPTION_TYPE		0x0e
  227 #define USB_DT_BOS			0x0f
  228 #define USB_DT_DEVICE_CAPABILITY	0x10
  229 #define USB_DT_WIRELESS_ENDPOINT_COMP	0x11
  230 #define USB_DT_WIRE_ADAPTER		0x21
  231 #define USB_DT_RPIPE			0x22
  232 #define USB_DT_CS_RADIO_CONTROL		0x23
  233 /* From the T10 UAS specification */
  234 #define USB_DT_PIPE_USAGE		0x24
  235 /* From the USB 3.0 spec */
  236 #define	USB_DT_SS_ENDPOINT_COMP		0x30
  237 
  238 /* Conventional codes for class-specific descriptors.  The convention is
  239  * defined in the USB "Common Class" Spec (3.11).  Individual class specs
  240  * are authoritative for their usage, not the "common class" writeup.
  241  */
  242 #define USB_DT_CS_DEVICE		(USB_TYPE_CLASS | USB_DT_DEVICE)
  243 #define USB_DT_CS_CONFIG		(USB_TYPE_CLASS | USB_DT_CONFIG)
  244 #define USB_DT_CS_STRING		(USB_TYPE_CLASS | USB_DT_STRING)
  245 #define USB_DT_CS_INTERFACE		(USB_TYPE_CLASS | USB_DT_INTERFACE)
  246 #define USB_DT_CS_ENDPOINT		(USB_TYPE_CLASS | USB_DT_ENDPOINT)
  247 
  248 /* All standard descriptors have these 2 fields at the beginning */
  249 struct usb_descriptor_header {
  250 	__u8  bLength;
  251 	__u8  bDescriptorType;
  252 } __attribute__ ((packed));
  253 
  254 
  255 /*-------------------------------------------------------------------------*/
  256 
  257 /* USB_DT_DEVICE: Device descriptor */
  258 struct usb_device_descriptor {
  259 	__u8  bLength;
  260 	__u8  bDescriptorType;
  261 
  262 	__le16 bcdUSB;
  263 	__u8  bDeviceClass;
  264 	__u8  bDeviceSubClass;
  265 	__u8  bDeviceProtocol;
  266 	__u8  bMaxPacketSize0;
  267 	__le16 idVendor;
  268 	__le16 idProduct;
  269 	__le16 bcdDevice;
  270 	__u8  iManufacturer;
  271 	__u8  iProduct;
  272 	__u8  iSerialNumber;
  273 	__u8  bNumConfigurations;
  274 } __attribute__ ((packed));
  275 
  276 #define USB_DT_DEVICE_SIZE		18
  277 
  278 
  279 /*
  280  * Device and/or Interface Class codes
  281  * as found in bDeviceClass or bInterfaceClass
  282  * and defined by www.usb.org documents
  283  */
  284 #define USB_CLASS_PER_INTERFACE		0	/* for DeviceClass */
  285 #define USB_CLASS_AUDIO			1
  286 #define USB_CLASS_COMM			2
  287 #define USB_CLASS_HID			3
  288 #define USB_CLASS_PHYSICAL		5
  289 #define USB_CLASS_STILL_IMAGE		6
  290 #define USB_CLASS_PRINTER		7
  291 #define USB_CLASS_MASS_STORAGE		8
  292 #define USB_CLASS_HUB			9
  293 #define USB_CLASS_CDC_DATA		0x0a
  294 #define USB_CLASS_CSCID			0x0b	/* chip+ smart card */
  295 #define USB_CLASS_CONTENT_SEC		0x0d	/* content security */
  296 #define USB_CLASS_VIDEO			0x0e
  297 #define USB_CLASS_WIRELESS_CONTROLLER	0xe0
  298 #define USB_CLASS_MISC			0xef
  299 #define USB_CLASS_APP_SPEC		0xfe
  300 #define USB_CLASS_VENDOR_SPEC		0xff
  301 
  302 #define USB_SUBCLASS_VENDOR_SPEC	0xff
  303 
  304 /*-------------------------------------------------------------------------*/
  305 
  306 /* USB_DT_CONFIG: Configuration descriptor information.
  307  *
  308  * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the
  309  * descriptor type is different.  Highspeed-capable devices can look
  310  * different depending on what speed they're currently running.  Only
  311  * devices with a USB_DT_DEVICE_QUALIFIER have any OTHER_SPEED_CONFIG
  312  * descriptors.
  313  */
  314 struct usb_config_descriptor {
  315 	__u8  bLength;
  316 	__u8  bDescriptorType;
  317 
  318 	__le16 wTotalLength;
  319 	__u8  bNumInterfaces;
  320 	__u8  bConfigurationValue;
  321 	__u8  iConfiguration;
  322 	__u8  bmAttributes;
  323 	__u8  bMaxPower;
  324 } __attribute__ ((packed));
  325 
  326 #define USB_DT_CONFIG_SIZE		9
  327 
  328 /* from config descriptor bmAttributes */
  329 #define USB_CONFIG_ATT_ONE		(1 << 7)	/* must be set */
  330 #define USB_CONFIG_ATT_SELFPOWER	(1 << 6)	/* self powered */
  331 #define USB_CONFIG_ATT_WAKEUP		(1 << 5)	/* can wakeup */
  332 #define USB_CONFIG_ATT_BATTERY		(1 << 4)	/* battery powered */
  333 
  334 /*-------------------------------------------------------------------------*/
  335 
  336 /* USB_DT_STRING: String descriptor */
  337 struct usb_string_descriptor {
  338 	__u8  bLength;
  339 	__u8  bDescriptorType;
  340 
  341 	__le16 wData[1];		/* UTF-16LE encoded */
  342 } __attribute__ ((packed));
  343 
  344 /* note that "string" zero is special, it holds language codes that
  345  * the device supports, not Unicode characters.
  346  */
  347 
  348 /*-------------------------------------------------------------------------*/
  349 
  350 /* USB_DT_INTERFACE: Interface descriptor */
  351 struct usb_interface_descriptor {
  352 	__u8  bLength;
  353 	__u8  bDescriptorType;
  354 
  355 	__u8  bInterfaceNumber;
  356 	__u8  bAlternateSetting;
  357 	__u8  bNumEndpoints;
  358 	__u8  bInterfaceClass;
  359 	__u8  bInterfaceSubClass;
  360 	__u8  bInterfaceProtocol;
  361 	__u8  iInterface;
  362 } __attribute__ ((packed));
  363 
  364 #define USB_DT_INTERFACE_SIZE		9
  365 
  366 /*-------------------------------------------------------------------------*/
  367 
  368 /* USB_DT_ENDPOINT: Endpoint descriptor */
  369 struct usb_endpoint_descriptor {
  370 	__u8  bLength;
  371 	__u8  bDescriptorType;
  372 
  373 	__u8  bEndpointAddress;
  374 	__u8  bmAttributes;
  375 	__le16 wMaxPacketSize;
  376 	__u8  bInterval;
  377 
  378 	/* NOTE:  these two are _only_ in audio endpoints. */
  379 	/* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
  380 	__u8  bRefresh;
  381 	__u8  bSynchAddress;
  382 } __attribute__ ((packed));
  383 
  384 #define USB_DT_ENDPOINT_SIZE		7
  385 #define USB_DT_ENDPOINT_AUDIO_SIZE	9	/* Audio extension */
  386 
  387 
  388 /*
  389  * Endpoints
  390  */
  391 #define USB_ENDPOINT_NUMBER_MASK	0x0f	/* in bEndpointAddress */
  392 #define USB_ENDPOINT_DIR_MASK		0x80
  393 
  394 #define USB_ENDPOINT_XFERTYPE_MASK	0x03	/* in bmAttributes */
  395 #define USB_ENDPOINT_XFER_CONTROL	0
  396 #define USB_ENDPOINT_XFER_ISOC		1
  397 #define USB_ENDPOINT_XFER_BULK		2
  398 #define USB_ENDPOINT_XFER_INT		3
  399 #define USB_ENDPOINT_MAX_ADJUSTABLE	0x80
  400 
  401 /* The USB 3.0 spec redefines bits 5:4 of bmAttributes as interrupt ep type. */
  402 #define USB_ENDPOINT_INTRTYPE		0x30
  403 #define USB_ENDPOINT_INTR_PERIODIC	(0 << 4)
  404 #define USB_ENDPOINT_INTR_NOTIFICATION	(1 << 4)
  405 
  406 #define USB_ENDPOINT_SYNCTYPE		0x0c
  407 #define USB_ENDPOINT_SYNC_NONE		(0 << 2)
  408 #define USB_ENDPOINT_SYNC_ASYNC		(1 << 2)
  409 #define USB_ENDPOINT_SYNC_ADAPTIVE	(2 << 2)
  410 #define USB_ENDPOINT_SYNC_SYNC		(3 << 2)
  411 
  412 #define USB_ENDPOINT_USAGE_MASK		0x30
  413 #define USB_ENDPOINT_USAGE_DATA		0x00
  414 #define USB_ENDPOINT_USAGE_FEEDBACK	0x10
  415 #define USB_ENDPOINT_USAGE_IMPLICIT_FB	0x20	/* Implicit feedback Data endpoint */
  416 
  417 /*-------------------------------------------------------------------------*/
  418 
  419 /**
  420  * usb_endpoint_num - get the endpoint's number
  421  * @epd: endpoint to be checked
  422  *
  423  * Returns @epd's number: 0 to 15.
  424  */
  425 static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
  426 {
  427 	return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
  428 }
  429 
  430 /**
  431  * usb_endpoint_type - get the endpoint's transfer type
  432  * @epd: endpoint to be checked
  433  *
  434  * Returns one of USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT} according
  435  * to @epd's transfer type.
  436  */
  437 static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd)
  438 {
  439 	return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
  440 }
  441 
  442 /**
  443  * usb_endpoint_dir_in - check if the endpoint has IN direction
  444  * @epd: endpoint to be checked
  445  *
  446  * Returns true if the endpoint is of type IN, otherwise it returns false.
  447  */
  448 static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
  449 {
  450 	return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN);
  451 }
  452 
  453 /**
  454  * usb_endpoint_dir_out - check if the endpoint has OUT direction
  455  * @epd: endpoint to be checked
  456  *
  457  * Returns true if the endpoint is of type OUT, otherwise it returns false.
  458  */
  459 static inline int usb_endpoint_dir_out(
  460 				const struct usb_endpoint_descriptor *epd)
  461 {
  462 	return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT);
  463 }
  464 
  465 /**
  466  * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type
  467  * @epd: endpoint to be checked
  468  *
  469  * Returns true if the endpoint is of type bulk, otherwise it returns false.
  470  */
  471 static inline int usb_endpoint_xfer_bulk(
  472 				const struct usb_endpoint_descriptor *epd)
  473 {
  474 	return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
  475 		USB_ENDPOINT_XFER_BULK);
  476 }
  477 
  478 /**
  479  * usb_endpoint_xfer_control - check if the endpoint has control transfer type
  480  * @epd: endpoint to be checked
  481  *
  482  * Returns true if the endpoint is of type control, otherwise it returns false.
  483  */
  484 static inline int usb_endpoint_xfer_control(
  485 				const struct usb_endpoint_descriptor *epd)
  486 {
  487 	return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
  488 		USB_ENDPOINT_XFER_CONTROL);
  489 }
  490 
  491 /**
  492  * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
  493  * @epd: endpoint to be checked
  494  *
  495  * Returns true if the endpoint is of type interrupt, otherwise it returns
  496  * false.
  497  */
  498 static inline int usb_endpoint_xfer_int(
  499 				const struct usb_endpoint_descriptor *epd)
  500 {
  501 	return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
  502 		USB_ENDPOINT_XFER_INT);
  503 }
  504 
  505 /**
  506  * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type
  507  * @epd: endpoint to be checked
  508  *
  509  * Returns true if the endpoint is of type isochronous, otherwise it returns
  510  * false.
  511  */
  512 static inline int usb_endpoint_xfer_isoc(
  513 				const struct usb_endpoint_descriptor *epd)
  514 {
  515 	return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
  516 		USB_ENDPOINT_XFER_ISOC);
  517 }
  518 
  519 /**
  520  * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN
  521  * @epd: endpoint to be checked
  522  *
  523  * Returns true if the endpoint has bulk transfer type and IN direction,
  524  * otherwise it returns false.
  525  */
  526 static inline int usb_endpoint_is_bulk_in(
  527 				const struct usb_endpoint_descriptor *epd)
  528 {
  529 	return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd);
  530 }
  531 
  532 /**
  533  * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT
  534  * @epd: endpoint to be checked
  535  *
  536  * Returns true if the endpoint has bulk transfer type and OUT direction,
  537  * otherwise it returns false.
  538  */
  539 static inline int usb_endpoint_is_bulk_out(
  540 				const struct usb_endpoint_descriptor *epd)
  541 {
  542 	return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd);
  543 }
  544 
  545 /**
  546  * usb_endpoint_is_int_in - check if the endpoint is interrupt IN
  547  * @epd: endpoint to be checked
  548  *
  549  * Returns true if the endpoint has interrupt transfer type and IN direction,
  550  * otherwise it returns false.
  551  */
  552 static inline int usb_endpoint_is_int_in(
  553 				const struct usb_endpoint_descriptor *epd)
  554 {
  555 	return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd);
  556 }
  557 
  558 /**
  559  * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT
  560  * @epd: endpoint to be checked
  561  *
  562  * Returns true if the endpoint has interrupt transfer type and OUT direction,
  563  * otherwise it returns false.
  564  */
  565 static inline int usb_endpoint_is_int_out(
  566 				const struct usb_endpoint_descriptor *epd)
  567 {
  568 	return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd);
  569 }
  570 
  571 /**
  572  * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN
  573  * @epd: endpoint to be checked
  574  *
  575  * Returns true if the endpoint has isochronous transfer type and IN direction,
  576  * otherwise it returns false.
  577  */
  578 static inline int usb_endpoint_is_isoc_in(
  579 				const struct usb_endpoint_descriptor *epd)
  580 {
  581 	return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd);
  582 }
  583 
  584 /**
  585  * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT
  586  * @epd: endpoint to be checked
  587  *
  588  * Returns true if the endpoint has isochronous transfer type and OUT direction,
  589  * otherwise it returns false.
  590  */
  591 static inline int usb_endpoint_is_isoc_out(
  592 				const struct usb_endpoint_descriptor *epd)
  593 {
  594 	return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd);
  595 }
  596 
  597 /**
  598  * usb_endpoint_maxp - get endpoint's max packet size
  599  * @epd: endpoint to be checked
  600  *
  601  * Returns @epd's max packet
  602  */
  603 static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
  604 {
  605 	return __le16_to_cpu(epd->wMaxPacketSize);
  606 }
  607 
  608 static inline int usb_endpoint_interrupt_type(
  609 		const struct usb_endpoint_descriptor *epd)
  610 {
  611 	return epd->bmAttributes & USB_ENDPOINT_INTRTYPE;
  612 }
  613 
  614 /*-------------------------------------------------------------------------*/
  615 
  616 /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */
  617 struct usb_ss_ep_comp_descriptor {
  618 	__u8  bLength;
  619 	__u8  bDescriptorType;
  620 
  621 	__u8  bMaxBurst;
  622 	__u8  bmAttributes;
  623 	__le16 wBytesPerInterval;
  624 } __attribute__ ((packed));
  625 
  626 #define USB_DT_SS_EP_COMP_SIZE		6
  627 
  628 /* Bits 4:0 of bmAttributes if this is a bulk endpoint */
  629 static inline int
  630 usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp)
  631 {
  632 	int		max_streams;
  633 
  634 	if (!comp)
  635 		return 0;
  636 
  637 	max_streams = comp->bmAttributes & 0x1f;
  638 
  639 	if (!max_streams)
  640 		return 0;
  641 
  642 	max_streams = 1 << max_streams;
  643 
  644 	return max_streams;
  645 }
  646 
  647 /* Bits 1:0 of bmAttributes if this is an isoc endpoint */
  648 #define USB_SS_MULT(p)			(1 + ((p) & 0x3))
  649 
  650 /*-------------------------------------------------------------------------*/
  651 
  652 /* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */
  653 struct usb_qualifier_descriptor {
  654 	__u8  bLength;
  655 	__u8  bDescriptorType;
  656 
  657 	__le16 bcdUSB;
  658 	__u8  bDeviceClass;
  659 	__u8  bDeviceSubClass;
  660 	__u8  bDeviceProtocol;
  661 	__u8  bMaxPacketSize0;
  662 	__u8  bNumConfigurations;
  663 	__u8  bRESERVED;
  664 } __attribute__ ((packed));
  665 
  666 
  667 /*-------------------------------------------------------------------------*/
  668 
  669 /* USB_DT_OTG (from OTG 1.0a supplement) */
  670 struct usb_otg_descriptor {
  671 	__u8  bLength;
  672 	__u8  bDescriptorType;
  673 
  674 	__u8  bmAttributes;	/* support for HNP, SRP, etc */
  675 } __attribute__ ((packed));
  676 
  677 /* from usb_otg_descriptor.bmAttributes */
  678 #define USB_OTG_SRP		(1 << 0)
  679 #define USB_OTG_HNP		(1 << 1)	/* swap host/device roles */
  680 
  681 /*-------------------------------------------------------------------------*/
  682 
  683 /* USB_DT_DEBUG:  for special highspeed devices, replacing serial console */
  684 struct usb_debug_descriptor {
  685 	__u8  bLength;
  686 	__u8  bDescriptorType;
  687 
  688 	/* bulk endpoints with 8 byte maxpacket */
  689 	__u8  bDebugInEndpoint;
  690 	__u8  bDebugOutEndpoint;
  691 } __attribute__((packed));
  692 
  693 /*-------------------------------------------------------------------------*/
  694 
  695 /* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */
  696 struct usb_interface_assoc_descriptor {
  697 	__u8  bLength;
  698 	__u8  bDescriptorType;
  699 
  700 	__u8  bFirstInterface;
  701 	__u8  bInterfaceCount;
  702 	__u8  bFunctionClass;
  703 	__u8  bFunctionSubClass;
  704 	__u8  bFunctionProtocol;
  705 	__u8  iFunction;
  706 } __attribute__ ((packed));
  707 
  708 
  709 /*-------------------------------------------------------------------------*/
  710 
  711 /* USB_DT_SECURITY:  group of wireless security descriptors, including
  712  * encryption types available for setting up a CC/association.
  713  */
  714 struct usb_security_descriptor {
  715 	__u8  bLength;
  716 	__u8  bDescriptorType;
  717 
  718 	__le16 wTotalLength;
  719 	__u8  bNumEncryptionTypes;
  720 } __attribute__((packed));
  721 
  722 /*-------------------------------------------------------------------------*/
  723 
  724 /* USB_DT_KEY:  used with {GET,SET}_SECURITY_DATA; only public keys
  725  * may be retrieved.
  726  */
  727 struct usb_key_descriptor {
  728 	__u8  bLength;
  729 	__u8  bDescriptorType;
  730 
  731 	__u8  tTKID[3];
  732 	__u8  bReserved;
  733 	__u8  bKeyData[0];
  734 } __attribute__((packed));
  735 
  736 /*-------------------------------------------------------------------------*/
  737 
  738 /* USB_DT_ENCRYPTION_TYPE:  bundled in DT_SECURITY groups */
  739 struct usb_encryption_descriptor {
  740 	__u8  bLength;
  741 	__u8  bDescriptorType;
  742 
  743 	__u8  bEncryptionType;
  744 #define	USB_ENC_TYPE_UNSECURE		0
  745 #define	USB_ENC_TYPE_WIRED		1	/* non-wireless mode */
  746 #define	USB_ENC_TYPE_CCM_1		2	/* aes128/cbc session */
  747 #define	USB_ENC_TYPE_RSA_1		3	/* rsa3072/sha1 auth */
  748 	__u8  bEncryptionValue;		/* use in SET_ENCRYPTION */
  749 	__u8  bAuthKeyIndex;
  750 } __attribute__((packed));
  751 
  752 
  753 /*-------------------------------------------------------------------------*/
  754 
  755 /* USB_DT_BOS:  group of device-level capabilities */
  756 struct usb_bos_descriptor {
  757 	__u8  bLength;
  758 	__u8  bDescriptorType;
  759 
  760 	__le16 wTotalLength;
  761 	__u8  bNumDeviceCaps;
  762 } __attribute__((packed));
  763 
  764 #define USB_DT_BOS_SIZE		5
  765 /*-------------------------------------------------------------------------*/
  766 
  767 /* USB_DT_DEVICE_CAPABILITY:  grouped with BOS */
  768 struct usb_dev_cap_header {
  769 	__u8  bLength;
  770 	__u8  bDescriptorType;
  771 	__u8  bDevCapabilityType;
  772 } __attribute__((packed));
  773 
  774 #define	USB_CAP_TYPE_WIRELESS_USB	1
  775 
  776 struct usb_wireless_cap_descriptor {	/* Ultra Wide Band */
  777 	__u8  bLength;
  778 	__u8  bDescriptorType;
  779 	__u8  bDevCapabilityType;
  780 
  781 	__u8  bmAttributes;
  782 #define	USB_WIRELESS_P2P_DRD		(1 << 1)
  783 #define	USB_WIRELESS_BEACON_MASK	(3 << 2)
  784 #define	USB_WIRELESS_BEACON_SELF	(1 << 2)
  785 #define	USB_WIRELESS_BEACON_DIRECTED	(2 << 2)
  786 #define	USB_WIRELESS_BEACON_NONE	(3 << 2)
  787 	__le16 wPHYRates;	/* bit rates, Mbps */
  788 #define	USB_WIRELESS_PHY_53		(1 << 0)	/* always set */
  789 #define	USB_WIRELESS_PHY_80		(1 << 1)
  790 #define	USB_WIRELESS_PHY_107		(1 << 2)	/* always set */
  791 #define	USB_WIRELESS_PHY_160		(1 << 3)
  792 #define	USB_WIRELESS_PHY_200		(1 << 4)	/* always set */
  793 #define	USB_WIRELESS_PHY_320		(1 << 5)
  794 #define	USB_WIRELESS_PHY_400		(1 << 6)
  795 #define	USB_WIRELESS_PHY_480		(1 << 7)
  796 	__u8  bmTFITXPowerInfo;	/* TFI power levels */
  797 	__u8  bmFFITXPowerInfo;	/* FFI power levels */
  798 	__le16 bmBandGroup;
  799 	__u8  bReserved;
  800 } __attribute__((packed));
  801 
  802 /* USB 2.0 Extension descriptor */
  803 #define	USB_CAP_TYPE_EXT		2
  804 
  805 struct usb_ext_cap_descriptor {		/* Link Power Management */
  806 	__u8  bLength;
  807 	__u8  bDescriptorType;
  808 	__u8  bDevCapabilityType;
  809 	__le32 bmAttributes;
  810 #define USB_LPM_SUPPORT			(1 << 1)	/* supports LPM */
  811 #define USB_BESL_SUPPORT		(1 << 2)	/* supports BESL */
  812 #define USB_BESL_BASELINE_VALID		(1 << 3)	/* Baseline BESL valid*/
  813 #define USB_BESL_DEEP_VALID		(1 << 4)	/* Deep BESL valid */
  814 #define USB_GET_BESL_BASELINE(p)	(((p) & (0xf << 8)) >> 8)
  815 #define USB_GET_BESL_DEEP(p)		(((p) & (0xf << 12)) >> 12)
  816 } __attribute__((packed));
  817 
  818 #define USB_DT_USB_EXT_CAP_SIZE	7
  819 
  820 /*
  821  * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed USB
  822  * specific device level capabilities
  823  */
  824 #define		USB_SS_CAP_TYPE		3
  825 struct usb_ss_cap_descriptor {		/* Link Power Management */
  826 	__u8  bLength;
  827 	__u8  bDescriptorType;
  828 	__u8  bDevCapabilityType;
  829 	__u8  bmAttributes;
  830 #define USB_LTM_SUPPORT			(1 << 1) /* supports LTM */
  831 	__le16 wSpeedSupported;
  832 #define USB_LOW_SPEED_OPERATION		(1)	 /* Low speed operation */
  833 #define USB_FULL_SPEED_OPERATION	(1 << 1) /* Full speed operation */
  834 #define USB_HIGH_SPEED_OPERATION	(1 << 2) /* High speed operation */
  835 #define USB_5GBPS_OPERATION		(1 << 3) /* Operation at 5Gbps */
  836 	__u8  bFunctionalitySupport;
  837 	__u8  bU1devExitLat;
  838 	__le16 bU2DevExitLat;
  839 } __attribute__((packed));
  840 
  841 #define USB_DT_USB_SS_CAP_SIZE	10
  842 
  843 /*
  844  * Container ID Capability descriptor: Defines the instance unique ID used to
  845  * identify the instance across all operating modes
  846  */
  847 #define	CONTAINER_ID_TYPE	4
  848 struct usb_ss_container_id_descriptor {
  849 	__u8  bLength;
  850 	__u8  bDescriptorType;
  851 	__u8  bDevCapabilityType;
  852 	__u8  bReserved;
  853 	__u8  ContainerID[16]; /* 128-bit number */
  854 } __attribute__((packed));
  855 
  856 #define USB_DT_USB_SS_CONTN_ID_SIZE	20
  857 /*-------------------------------------------------------------------------*/
  858 
  859 /* USB_DT_WIRELESS_ENDPOINT_COMP:  companion descriptor associated with
  860  * each endpoint descriptor for a wireless device
  861  */
  862 struct usb_wireless_ep_comp_descriptor {
  863 	__u8  bLength;
  864 	__u8  bDescriptorType;
  865 
  866 	__u8  bMaxBurst;
  867 	__u8  bMaxSequence;
  868 	__le16 wMaxStreamDelay;
  869 	__le16 wOverTheAirPacketSize;
  870 	__u8  bOverTheAirInterval;
  871 	__u8  bmCompAttributes;
  872 #define USB_ENDPOINT_SWITCH_MASK	0x03	/* in bmCompAttributes */
  873 #define USB_ENDPOINT_SWITCH_NO		0
  874 #define USB_ENDPOINT_SWITCH_SWITCH	1
  875 #define USB_ENDPOINT_SWITCH_SCALE	2
  876 } __attribute__((packed));
  877 
  878 /*-------------------------------------------------------------------------*/
  879 
  880 /* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless
  881  * host and a device for connection set up, mutual authentication, and
  882  * exchanging short lived session keys.  The handshake depends on a CC.
  883  */
  884 struct usb_handshake {
  885 	__u8 bMessageNumber;
  886 	__u8 bStatus;
  887 	__u8 tTKID[3];
  888 	__u8 bReserved;
  889 	__u8 CDID[16];
  890 	__u8 nonce[16];
  891 	__u8 MIC[8];
  892 } __attribute__((packed));
  893 
  894 /*-------------------------------------------------------------------------*/
  895 
  896 /* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC).
  897  * A CC may also be set up using non-wireless secure channels (including
  898  * wired USB!), and some devices may support CCs with multiple hosts.
  899  */
  900 struct usb_connection_context {
  901 	__u8 CHID[16];		/* persistent host id */
  902 	__u8 CDID[16];		/* device id (unique w/in host context) */
  903 	__u8 CK[16];		/* connection key */
  904 } __attribute__((packed));
  905 
  906 /*-------------------------------------------------------------------------*/
  907 
  908 /* USB 2.0 defines three speeds, here's how Linux identifies them */
  909 
  910 enum usb_device_speed {
  911 	USB_SPEED_UNKNOWN = 0,			/* enumerating */
  912 	USB_SPEED_LOW, USB_SPEED_FULL,		/* usb 1.1 */
  913 	USB_SPEED_HIGH,				/* usb 2.0 */
  914 	USB_SPEED_WIRELESS,			/* wireless (usb 2.5) */
  915 	USB_SPEED_SUPER,			/* usb 3.0 */
  916 };
  917 
  918 
  919 enum usb_device_state {
  920 	/* NOTATTACHED isn't in the USB spec, and this state acts
  921 	 * the same as ATTACHED ... but it's clearer this way.
  922 	 */
  923 	USB_STATE_NOTATTACHED = 0,
  924 
  925 	/* chapter 9 and authentication (wireless) device states */
  926 	USB_STATE_ATTACHED,
  927 	USB_STATE_POWERED,			/* wired */
  928 	USB_STATE_RECONNECTING,			/* auth */
  929 	USB_STATE_UNAUTHENTICATED,		/* auth */
  930 	USB_STATE_DEFAULT,			/* limited function */
  931 	USB_STATE_ADDRESS,
  932 	USB_STATE_CONFIGURED,			/* most functions */
  933 
  934 	USB_STATE_SUSPENDED
  935 
  936 	/* NOTE:  there are actually four different SUSPENDED
  937 	 * states, returning to POWERED, DEFAULT, ADDRESS, or
  938 	 * CONFIGURED respectively when SOF tokens flow again.
  939 	 * At this level there's no difference between L1 and L2
  940 	 * suspend states.  (L2 being original USB 1.1 suspend.)
  941 	 */
  942 };
  943 
  944 enum usb3_link_state {
  945 	USB3_LPM_U0 = 0,
  946 	USB3_LPM_U1,
  947 	USB3_LPM_U2,
  948 	USB3_LPM_U3
  949 };
  950 
  951 /*
  952  * A U1 timeout of 0x0 means the parent hub will reject any transitions to U1.
  953  * 0xff means the parent hub will accept transitions to U1, but will not
  954  * initiate a transition.
  955  *
  956  * A U1 timeout of 0x1 to 0x7F also causes the hub to initiate a transition to
  957  * U1 after that many microseconds.  Timeouts of 0x80 to 0xFE are reserved
  958  * values.
  959  *
  960  * A U2 timeout of 0x0 means the parent hub will reject any transitions to U2.
  961  * 0xff means the parent hub will accept transitions to U2, but will not
  962  * initiate a transition.
  963  *
  964  * A U2 timeout of 0x1 to 0xFE also causes the hub to initiate a transition to
  965  * U2 after N*256 microseconds.  Therefore a U2 timeout value of 0x1 means a U2
  966  * idle timer of 256 microseconds, 0x2 means 512 microseconds, 0xFE means
  967  * 65.024ms.
  968  */
  969 #define USB3_LPM_DISABLED		0x0
  970 #define USB3_LPM_U1_MAX_TIMEOUT		0x7F
  971 #define USB3_LPM_U2_MAX_TIMEOUT		0xFE
  972 #define USB3_LPM_DEVICE_INITIATED	0xFF
  973 
  974 struct usb_set_sel_req {
  975 	__u8	u1_sel;
  976 	__u8	u1_pel;
  977 	__le16	u2_sel;
  978 	__le16	u2_pel;
  979 } __attribute__ ((packed));
  980 
  981 /*
  982  * The Set System Exit Latency control transfer provides one byte each for
  983  * U1 SEL and U1 PEL, so the max exit latency is 0xFF.  U2 SEL and U2 PEL each
  984  * are two bytes long.
  985  */
  986 #define USB3_LPM_MAX_U1_SEL_PEL		0xFF
  987 #define USB3_LPM_MAX_U2_SEL_PEL		0xFFFF
  988 
  989 /*-------------------------------------------------------------------------*/
  990 
  991 /*
  992  * As per USB compliance update, a device that is actively drawing
  993  * more than 100mA from USB must report itself as bus-powered in
  994  * the GetStatus(DEVICE) call.
  995  * http://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#34
  996  */
  997 #define USB_SELF_POWER_VBUS_MAX_DRAW		100
  998 
  999 #endif /* _UAPI__LINUX_USB_CH9_H */            | 
Here is an explanation of a rule violation arisen while checking your driver against a corresponding kernel.
Note that it may be false positive, i.e. there isn't a real error indeed. Please analyze a given error trace and related source code to understand whether there is an error in your driver.
Error trace column contains a path on which the given rule is violated. You can expand/collapse some entity classes by clicking on corresponding checkboxes in a main menu or in an advanced Others menu. Also you can expand/collapse each particular entity by clicking on +/-. In hovering on some entities you can see some tips. Also the error trace is bound with related source code. Line numbers may be shown as links on the left. You can click on them to open corresponding lines in source code.
Source code column contains a content of files related with the error trace. There is source code of your driver (note that there are some LDV modifications at the end), kernel headers and rule model. Tabs show a currently opened file and other available files. In hovering on them you can see full file names. On clicking a corresponding file content will be shown.
| Ядро | Модуль | Правило | Верификатор | Вердикт | Статус | Время создания | Описание проблемы | 
| linux-4.0-rc1.tar.xz | drivers/media/usb/usbvision/usbvision.ko | 132_1a | CPAchecker | Bug | Fixed | 2015-03-28 01:41:14 | L0200 | 
Комментарий
reported: 28 Mar 2015
[В начало]