Error Trace

[Home]

Bug # 52

Show/hide error trace
Error trace
Function bodies
Blocks
  • Others...
    Function bodies without model function calls
    Initialization function calls
    Initialization function bodies
    Entry point
    Entry point body
    Function calls
    Skipped function calls
    Formal parameter names
    Declarations
    Assumes
    Assume conditions
    Returns
    Return values
    DEG initialization
    DEG function calls
    Model function calls
    Model function bodies
    Model asserts
    Model state changes
    Model function function calls
    Model function function bodies
    Model returns
    Model others
    Identation
    Line numbers
    Expand signs
-__CPAchecker_initialize()
{
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 ;
}
-entry_point
{
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 */}
3533 -usbvision_init()
{
1686 int err_code;
1688 assume(!((video_debug & 4) != 0));
1690 assume(!((video_debug & 2) != 0));
1691 assume(!((video_debug & 4) != 0));
1692 assume((video_debug & 8) != 0);
1692 printk("\016usbvision:[%s:%d] MMAP debugging is enabled [video]", "usbvision_init", 1692) { /* Function call is skipped due to function is undefined */}
1695 assume(!(isoc_mode != 96));
1701 err_code = usb_register_driver(&usbvision_driver, &__this_module, "usbvision") { /* Function call is skipped due to function is undefined */}
1703 assume(err_code == 0);
1704 printk("\016USBVision USB Video Device Driver for Linux : 0.9.11\n") { /* Function call is skipped due to function is undefined */}
1705 assume(!((video_debug & 4) != 0));
1707 return err_code;;
}
3533 assume(!(tmp != 0));
3547 goto ldv_35724;
3547 tmp___1 = nondet_int() { /* Function call is skipped due to function is undefined */}
3547 assume(tmp___1 != 0);
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)
3554 assume(!(tmp___0 == 0));
3606 assume(!(tmp___0 == 1));
3654 assume(!(tmp___0 == 2));
3702 assume(!(tmp___0 == 3));
3750 assume(!(tmp___0 == 4));
3798 assume(!(tmp___0 == 5));
3846 assume(!(tmp___0 == 6));
3894 assume(!(tmp___0 == 7));
3942 assume(!(tmp___0 == 8));
3990 assume(!(tmp___0 == 9));
4038 assume(!(tmp___0 == 10));
4086 assume(!(tmp___0 == 11));
4134 assume(!(tmp___0 == 12));
4182 assume(!(tmp___0 == 13));
4230 assume(!(tmp___0 == 14));
4278 assume(!(tmp___0 == 15));
4326 assume(!(tmp___0 == 16));
4374 assume(!(tmp___0 == 17));
4422 assume(!(tmp___0 == 18));
4470 assume(!(tmp___0 == 19));
4518 assume(!(tmp___0 == 20));
4566 assume(!(tmp___0 == 21));
4614 assume(!(tmp___0 == 22));
4662 assume(!(tmp___0 == 23));
4710 assume(!(tmp___0 == 24));
4758 assume(!(tmp___0 == 25));
4806 assume(!(tmp___0 == 26));
4854 assume(!(tmp___0 == 27));
4902 assume(!(tmp___0 == 28));
4950 assume(!(tmp___0 == 29));
4998 assume(!(tmp___0 == 30));
5046 assume(!(tmp___0 == 31));
5097 assume(!(tmp___0 == 32));
5145 assume(!(tmp___0 == 33));
5193 assume(!(tmp___0 == 34));
5241 assume(!(tmp___0 == 35));
5289 assume(!(tmp___0 == 36));
5337 assume(!(tmp___0 == 37));
5385 assume(!(tmp___0 == 38));
5433 assume(!(tmp___0 == 39));
5481 assume(!(tmp___0 == 40));
5529 assume(!(tmp___0 == 41));
5577 assume(!(tmp___0 == 42));
5625 assume(!(tmp___0 == 43));
5673 assume(!(tmp___0 == 44));
5721 assume(!(tmp___0 == 45));
5769 assume(tmp___0 == 46);
5772 assume(ldv_s_usbvision_driver_usb_driver == 0);
5806 -usbvision_probe(var_group3, var_usbvision_probe_53_p1)
{
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;
1523 -interface_to_usbdev(intf)
{
592 const struct device *__mptr;
592 __mptr = (const struct device *)(intf->dev.parent);
592 return ((struct usb_device *)__mptr) + 18446744073709551472UL;;
}
1523 -ldv_usb_get_dev_9(tmp)
{
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;
45 -ldv_usb_get_dev()
{
19 ldv_usb_dev_state = ldv_usb_dev_state + 1;
20 return ;;
}
47 return ldv_func_res;;
}
1523 dev = tmp___0;
1525 ifnum = intf->altsetting->desc.bInterfaceNumber;
1527 usbvision = (struct usb_usbvision *)0;
1531 assume(!((video_debug & 4) != 0));
1535 int __CPAchecker_TMP_0 = (int)(devid->driver_info);
1535 model = __CPAchecker_TMP_0;
1536 assume(!(model < 0));
1536 assume(!(model >= ((int)usbvision_device_data_size)));
1540 printk("\016%s: %s found\n", "usbvision_probe", (usbvision_device_data[model]).model_string) { /* Function call is skipped due to function is undefined */}
1543 assume(((usbvision_device_data[model]).interface) >= 0);
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));
1548 -usb_endpoint_xfer_isoc(endpoint)
{
515 int __CPAchecker_TMP_0 = (int)(epd->bmAttributes);
515 return (__CPAchecker_TMP_0 & 3) == 1;;
}
1548 assume(!(tmp___1 == 0));
1555 -usb_endpoint_dir_out(endpoint)
{
462 signed char __CPAchecker_TMP_0 = (signed char)(epd->bEndpointAddress);
462 return ((int)__CPAchecker_TMP_0) >= 0;;
}
1555 assume(!(tmp___2 != 0));
1561 -usbvision_alloc(dev, intf)
{
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;
1423 -kzalloc(4136UL, 208U)
{
583 void *tmp;
583 -kmalloc(size, flags | 32768U)
{
420 void *tmp___2;
435 tmp___2 = __kmalloc(size, flags) { /* Function call is skipped due to function is undefined */}
435 return tmp___2;;
}
583 return tmp;;
}
1423 usbvision = (struct usb_usbvision *)tmp;
1424 assume(!(((unsigned long)usbvision) == ((unsigned long)((struct usb_usbvision *)0))));
1427 usbvision->dev = dev;
1428 tmp___0 = v4l2_device_register(&(intf->dev), &(usbvision->v4l2_dev)) { /* Function call is skipped due to function is undefined */}
1428 assume(!(tmp___0 != 0));
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);
1435 assume(!(__CPAchecker_TMP_0 == ((unsigned long)((struct urb *)0))));
1437 __init_waitqueue_head(&(usbvision->ctrl_urb_wq), "&usbvision->ctrl_urb_wq", &__key___0) { /* Function call is skipped due to function is undefined */}
1439 -usbvision_init_power_off_timer(usbvision)
{
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;
2198 return ;;
}
1441 return usbvision;;
}
1562 assume(!(((unsigned long)usbvision) == ((unsigned long)((struct usb_usbvision *)0))));
1567 assume(!(((unsigned int)(dev->descriptor.bNumConfigurations)) > 1U));
1569 assume(model == 50);
1570 usbvision->bridge_type = 1005;
1573 assume(!((video_debug & 4) != 0));
1576 uif = (dev->actconfig->interface)[0];
1578 int __CPAchecker_TMP_4 = (int)(uif->num_altsetting);
1578 usbvision->num_alt = __CPAchecker_TMP_4;
1579 assume(!((video_debug & 4) != 0));
1580 -kmalloc((size_t )((usbvision->num_alt) * 32), 208U)
{
420 void *tmp___2;
435 tmp___2 = __kmalloc(size, flags) { /* Function call is skipped due to function is undefined */}
435 return tmp___2;;
}
1580 usbvision->alt_max_pkt_size = (unsigned int *)tmp___3;
1581 unsigned long __CPAchecker_TMP_5 = (unsigned long)(usbvision->alt_max_pkt_size);
1581 assume(__CPAchecker_TMP_5 == ((unsigned long)((unsigned int *)0U)));
1582 dev_err((const struct device *)(&(intf->dev)), "usbvision: out of memory!\n") { /* Function call is skipped due to function is undefined */}
1583 -usbvision_release(usbvision)
{
1459 assume(!((video_debug & 4) != 0));
1461 -usbvision_reset_power_off_timer(usbvision)
{
2208 int tmp;
2208 -timer_pending((const struct timer_list *)(&(usbvision->power_off_timer)))
{
171 return ((unsigned long)(timer->entry.next)) != ((unsigned long)((struct list_head *)0));;
}
2208 assume(!(tmp != 0));
2210 return ;;
}
1463 usbvision->initialized = 0;
1465 -usbvision_remove_sysfs(usbvision->vdev)
{
325 assume(!(((unsigned long)vdev) != ((unsigned long)((struct video_device *)0))));
336 return ;;
}
1466 -usbvision_unregister_video(usbvision)
{
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);
1349 assume(!(__CPAchecker_TMP_0 != ((unsigned long)((struct video_device *)0))));
1360 unsigned long __CPAchecker_TMP_1 = (unsigned long)(usbvision->vdev);
1360 assume(!(__CPAchecker_TMP_1 != ((unsigned long)((struct video_device *)0))));
1369 return ;;
}
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 */}
1474 assume(!((video_debug & 4) != 0));
1475 return ;;
}
1584 return -12;;
}
5807 ldv_check_return_value(res_usbvision_probe_53) { /* Function call is skipped due to function is undefined */}
5808 -ldv_check_return_value_probe(res_usbvision_probe_53)
{
35 assume(retval != 0);
37 assume(ldv_usb_dev_state > 0);
37 -ldv_error()
{
15 LDV_ERROR:;
}
}
}
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, &copylen); 1157 else if (usbvision->isoc_mode == ISOC_MODE_YUV422) 1158 newstate = usbvision_parse_lines_422(usbvision, &copylen); 1159 else if (usbvision->isoc_mode == ISOC_MODE_COMPRESS) 1160 newstate = usbvision_parse_compress(usbvision, &copylen); 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, \