Bug

[В начало]

Ошибка # 142

Показать/спрятать трассу ошибок
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()
{
20 typedef unsigned char __u8;
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;
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;
34 typedef __u32 __le32;
259 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;
152 typedef u64 dma_addr_t;
157 typedef unsigned int gfp_t;
158 typedef unsigned int fmode_t;
161 typedef u64 phys_addr_t;
166 typedef phys_addr_t resource_size_t;
176 struct __anonstruct_atomic_t_6 { int counter; } ;
176 typedef struct __anonstruct_atomic_t_6 atomic_t;
181 struct __anonstruct_atomic64_t_7 { long counter; } ;
181 typedef struct __anonstruct_atomic64_t_7 atomic64_t;
182 struct list_head { struct list_head *next; struct list_head *prev; } ;
187 struct hlist_node ;
187 struct hlist_head { struct hlist_node *first; } ;
191 struct hlist_node { struct hlist_node *next; struct hlist_node **pprev; } ;
202 struct callback_head { struct callback_head *next; void (*func)(struct callback_head *); } ;
131 typedef void (*ctor_fn_t)();
48 struct device ;
432 struct file_operations ;
444 struct completion ;
445 struct pt_regs ;
555 struct bug_entry { int bug_addr_disp; int file_disp; unsigned short line; unsigned short flags; } ;
111 struct timespec ;
112 struct compat_timespec ;
113 struct __anonstruct_futex_25 { u32 *uaddr; u32 val; u32 flags; u32 bitset; u64 time; u32 *uaddr2; } ;
113 struct __anonstruct_nanosleep_26 { clockid_t clockid; struct timespec *rmtp; struct compat_timespec *compat_rmtp; u64 expires; } ;
113 struct pollfd ;
113 struct __anonstruct_poll_27 { struct pollfd *ufds; int nfds; int has_timeout; unsigned long tv_sec; unsigned long tv_nsec; } ;
113 union __anonunion____missing_field_name_24 { struct __anonstruct_futex_25 futex; struct __anonstruct_nanosleep_26 nanosleep; struct __anonstruct_poll_27 poll; } ;
113 struct restart_block { long int (*fn)(struct restart_block *); union __anonunion____missing_field_name_24 __annonCompField4; } ;
39 struct page ;
26 struct task_struct ;
27 struct mm_struct ;
288 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; } ;
66 struct __anonstruct____missing_field_name_30 { unsigned int a; unsigned int b; } ;
66 struct __anonstruct____missing_field_name_31 { 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; } ;
66 union __anonunion____missing_field_name_29 { struct __anonstruct____missing_field_name_30 __annonCompField5; struct __anonstruct____missing_field_name_31 __annonCompField6; } ;
66 struct desc_struct { union __anonunion____missing_field_name_29 __annonCompField7; } ;
12 typedef unsigned long pteval_t;
13 typedef unsigned long pmdval_t;
15 typedef unsigned long pgdval_t;
16 typedef unsigned long pgprotval_t;
18 struct __anonstruct_pte_t_32 { pteval_t pte; } ;
18 typedef struct __anonstruct_pte_t_32 pte_t;
20 struct pgprot { pgprotval_t pgprot; } ;
250 typedef struct pgprot pgprot_t;
252 struct __anonstruct_pgd_t_33 { pgdval_t pgd; } ;
252 typedef struct __anonstruct_pgd_t_33 pgd_t;
291 struct __anonstruct_pmd_t_35 { pmdval_t pmd; } ;
291 typedef struct __anonstruct_pmd_t_35 pmd_t;
417 typedef struct page *pgtable_t;
428 struct file ;
441 struct seq_file ;
479 struct thread_struct ;
481 struct cpumask ;
20 struct qspinlock { atomic_t val; } ;
33 typedef struct qspinlock arch_spinlock_t;
34 struct qrwlock { atomic_t cnts; arch_spinlock_t wait_lock; } ;
14 typedef struct qrwlock arch_rwlock_t;
253 struct math_emu_info { long ___orig_eip; struct pt_regs *regs; } ;
338 struct cpumask { unsigned long bits[128U]; } ;
15 typedef struct cpumask cpumask_t;
654 typedef struct cpumask *cpumask_var_t;
23 typedef atomic64_t atomic_long_t;
82 struct static_key { atomic_t enabled; } ;
22 struct tracepoint_func { void *func; void *data; int prio; } ;
28 struct tracepoint { const char *name; struct static_key key; void (*regfunc)(); void (*unregfunc)(); struct tracepoint_func *funcs; } ;
298 struct fregs_state { u32 cwd; u32 swd; u32 twd; u32 fip; u32 fcs; u32 foo; u32 fos; u32 st_space[20U]; u32 status; } ;
26 struct __anonstruct____missing_field_name_59 { u64 rip; u64 rdp; } ;
26 struct __anonstruct____missing_field_name_60 { u32 fip; u32 fcs; u32 foo; u32 fos; } ;
26 union __anonunion____missing_field_name_58 { struct __anonstruct____missing_field_name_59 __annonCompField13; struct __anonstruct____missing_field_name_60 __annonCompField14; } ;
26 union __anonunion____missing_field_name_61 { u32 padding1[12U]; u32 sw_reserved[12U]; } ;
26 struct fxregs_state { u16 cwd; u16 swd; u16 twd; u16 fop; union __anonunion____missing_field_name_58 __annonCompField15; u32 mxcsr; u32 mxcsr_mask; u32 st_space[32U]; u32 xmm_space[64U]; u32 padding[12U]; union __anonunion____missing_field_name_61 __annonCompField16; } ;
66 struct swregs_state { 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; } ;
226 struct xstate_header { u64 xfeatures; u64 xcomp_bv; u64 reserved[6U]; } ;
232 struct xregs_state { struct fxregs_state i387; struct xstate_header header; u8 extended_state_area[0U]; } ;
247 union fpregs_state { struct fregs_state fsave; struct fxregs_state fxsave; struct swregs_state soft; struct xregs_state xsave; u8 __padding[4096U]; } ;
264 struct fpu { unsigned int last_cpu; unsigned char fpstate_active; unsigned char fpregs_active; unsigned char counter; union fpregs_state state; } ;
169 struct seq_operations ;
371 struct perf_event ;
372 struct thread_struct { struct desc_struct tls_array[3U]; unsigned long sp0; unsigned long sp; unsigned short es; unsigned short ds; unsigned short fsindex; unsigned short gsindex; unsigned long fsbase; unsigned long gsbase; struct perf_event *ptrace_bps[4U]; unsigned long debugreg6; unsigned long ptrace_dr7; unsigned long cr2; unsigned long trap_nr; unsigned long error_code; unsigned long *io_bitmap_ptr; unsigned long iopl; unsigned int io_bitmap_max; struct fpu fpu; } ;
33 struct lockdep_map ;
55 struct stack_trace { unsigned int nr_entries; unsigned int max_entries; unsigned long *entries; int skip; } ;
28 struct lockdep_subclass_key { char __one_byte; } ;
53 struct lock_class_key { struct lockdep_subclass_key subkeys[8U]; } ;
59 struct lock_class { struct hlist_node 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; } ;
207 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; unsigned int pin_count; } ;
572 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_75 { u8 __padding[24U]; struct lockdep_map dep_map; } ;
33 union __anonunion____missing_field_name_74 { struct raw_spinlock rlock; struct __anonstruct____missing_field_name_75 __annonCompField19; } ;
33 struct spinlock { union __anonunion____missing_field_name_74 __annonCompField20; } ;
76 typedef struct spinlock spinlock_t;
23 struct __anonstruct_rwlock_t_76 { 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_76 rwlock_t;
416 struct seqcount { unsigned int sequence; struct lockdep_map dep_map; } ;
52 typedef struct seqcount seqcount_t;
404 struct __anonstruct_seqlock_t_89 { struct seqcount seqcount; spinlock_t lock; } ;
404 typedef struct __anonstruct_seqlock_t_89 seqlock_t;
598 struct timespec { __kernel_time_t tv_sec; long tv_nsec; } ;
83 struct user_namespace ;
22 struct __anonstruct_kuid_t_90 { uid_t val; } ;
22 typedef struct __anonstruct_kuid_t_90 kuid_t;
27 struct __anonstruct_kgid_t_91 { gid_t val; } ;
27 typedef struct __anonstruct_kgid_t_91 kgid_t;
139 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 ;
38 struct __wait_queue_head { spinlock_t lock; struct list_head task_list; } ;
43 typedef struct __wait_queue_head wait_queue_head_t;
97 struct __anonstruct_nodemask_t_92 { unsigned long bits[16U]; } ;
97 typedef struct __anonstruct_nodemask_t_92 nodemask_t;
13 struct optimistic_spin_queue { atomic_t tail; } ;
39 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; } ;
176 struct completion { unsigned int done; wait_queue_head_t wait; } ;
446 union ktime { s64 tv64; } ;
41 typedef union ktime ktime_t;
1129 struct timer_list { struct hlist_node entry; unsigned long expires; void (*function)(unsigned long); unsigned long data; u32 flags; int slack; int start_pid; void *start_site; char start_comm[16U]; struct lockdep_map lockdep_map; } ;
240 struct hrtimer ;
241 enum hrtimer_restart ;
242 struct rb_node { unsigned long __rb_parent_color; struct rb_node *rb_right; struct rb_node *rb_left; } ;
41 struct rb_root { struct rb_node *rb_node; } ;
838 struct nsproxy ;
261 struct workqueue_struct ;
262 struct work_struct ;
54 struct work_struct { atomic_long_t data; struct list_head entry; void (*func)(struct work_struct *); struct lockdep_map lockdep_map; } ;
107 struct delayed_work { struct work_struct work; struct timer_list timer; struct workqueue_struct *wq; int cpu; } ;
217 struct resource ;
64 struct resource { resource_size_t start; resource_size_t end; const char *name; unsigned long flags; unsigned long desc; struct resource *parent; struct resource *sibling; struct resource *child; } ;
217 struct pci_dev ;
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 ;
336 struct wake_irq ;
337 struct pm_domain_data ;
338 struct pm_subsys_data { spinlock_t lock; unsigned int refcount; struct list_head clock_list; struct pm_domain_data *domain_data; } ;
556 struct dev_pm_qos ;
556 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 early_init; bool direct_complete; spinlock_t lock; struct list_head entry; struct completion completion; struct wakeup_source *wakeup; bool wakeup_path; bool syscore; bool no_pm_callbacks; struct timer_list suspend_timer; unsigned long timer_expires; struct work_struct work; wait_queue_head_t wait_queue; struct wake_irq *wakeirq; 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; bool ignore_children; 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; } ;
616 struct dev_pm_domain { struct dev_pm_ops ops; void (*detach)(struct device *, bool ); int (*activate)(struct device *); void (*sync)(struct device *); void (*dismiss)(struct device *); } ;
144 struct pci_bus ;
26 struct ldt_struct ;
26 struct vdso_image ;
26 struct __anonstruct_mm_context_t_161 { struct ldt_struct *ldt; unsigned short ia32_compat; struct mutex lock; void *vdso; const struct vdso_image *vdso_image; atomic_t perf_rdpmc_allowed; } ;
26 typedef struct __anonstruct_mm_context_t_161 mm_context_t;
1238 struct llist_node ;
64 struct llist_node { struct llist_node *next; } ;
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_197 { struct arch_uprobe_task autask; unsigned long vaddr; } ;
73 struct __anonstruct____missing_field_name_198 { struct callback_head dup_xol_work; unsigned long dup_xol_addr; } ;
73 union __anonunion____missing_field_name_196 { struct __anonstruct____missing_field_name_197 __annonCompField35; struct __anonstruct____missing_field_name_198 __annonCompField36; } ;
73 struct uprobe ;
73 struct return_instance ;
73 struct uprobe_task { enum uprobe_task_state state; union __anonunion____missing_field_name_196 __annonCompField37; struct uprobe *active_uprobe; unsigned long xol_vaddr; struct return_instance *return_instances; unsigned int depth; } ;
94 struct return_instance { struct uprobe *uprobe; unsigned long func; unsigned long stack; unsigned long orig_ret_vaddr; bool chained; struct return_instance *next; } ;
110 struct xol_area ;
111 struct uprobes_state { struct xol_area *xol_area; } ;
150 struct address_space ;
151 struct mem_cgroup ;
152 union __anonunion____missing_field_name_199 { struct address_space *mapping; void *s_mem; atomic_t compound_mapcount; } ;
152 union __anonunion____missing_field_name_201 { unsigned long index; void *freelist; } ;
152 struct __anonstruct____missing_field_name_205 { unsigned short inuse; unsigned short objects; unsigned char frozen; } ;
152 union __anonunion____missing_field_name_204 { atomic_t _mapcount; struct __anonstruct____missing_field_name_205 __annonCompField40; int units; } ;
152 struct __anonstruct____missing_field_name_203 { union __anonunion____missing_field_name_204 __annonCompField41; atomic_t _refcount; } ;
152 union __anonunion____missing_field_name_202 { unsigned long counters; struct __anonstruct____missing_field_name_203 __annonCompField42; unsigned int active; } ;
152 struct __anonstruct____missing_field_name_200 { union __anonunion____missing_field_name_201 __annonCompField39; union __anonunion____missing_field_name_202 __annonCompField43; } ;
152 struct dev_pagemap ;
152 struct __anonstruct____missing_field_name_207 { struct page *next; int pages; int pobjects; } ;
152 struct __anonstruct____missing_field_name_208 { unsigned long compound_head; unsigned int compound_dtor; unsigned int compound_order; } ;
152 struct __anonstruct____missing_field_name_209 { unsigned long __pad; pgtable_t pmd_huge_pte; } ;
152 union __anonunion____missing_field_name_206 { struct list_head lru; struct dev_pagemap *pgmap; struct __anonstruct____missing_field_name_207 __annonCompField45; struct callback_head callback_head; struct __anonstruct____missing_field_name_208 __annonCompField46; struct __anonstruct____missing_field_name_209 __annonCompField47; } ;
152 struct kmem_cache ;
152 union __anonunion____missing_field_name_210 { unsigned long private; spinlock_t *ptl; struct kmem_cache *slab_cache; } ;
152 struct page { unsigned long flags; union __anonunion____missing_field_name_199 __annonCompField38; struct __anonstruct____missing_field_name_200 __annonCompField44; union __anonunion____missing_field_name_206 __annonCompField48; union __anonunion____missing_field_name_210 __annonCompField49; struct mem_cgroup *mem_cgroup; } ;
196 struct page_frag { struct page *page; __u32 offset; __u32 size; } ;
281 struct userfaultfd_ctx ;
281 struct vm_userfaultfd_ctx { struct userfaultfd_ctx *ctx; } ;
288 struct __anonstruct_shared_211 { struct rb_node rb; unsigned long rb_subtree_last; } ;
288 struct anon_vma ;
288 struct vm_operations_struct ;
288 struct mempolicy ;
288 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_211 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; struct vm_userfaultfd_ctx vm_userfaultfd_ctx; } ;
361 struct core_thread { struct task_struct *task; struct core_thread *next; } ;
366 struct core_state { atomic_t nr_threads; struct core_thread dumper; struct completion startup; } ;
380 struct task_rss_stat { int events; int count[4U]; } ;
388 struct mm_rss_stat { atomic_long_t count[4U]; } ;
393 struct kioctx_table ;
394 struct linux_binfmt ;
394 struct mmu_notifier_mm ;
394 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 data_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; atomic_long_t hugetlb_usage; struct work_struct async_put_work; } ;
564 struct vm_fault ;
615 struct vdso_image { void *data; unsigned long size; unsigned long alt; unsigned long alt_len; long sym_vvar_start; long sym_vvar_page; long sym_hpet_page; long sym_pvclock_page; long sym_VDSO32_NOTE_MASK; long sym___kernel_sigreturn; long sym___kernel_rt_sigreturn; long sym___kernel_vsyscall; long sym_int80_landing_pad; } ;
15 typedef __u64 Elf64_Addr;
16 typedef __u16 Elf64_Half;
18 typedef __u64 Elf64_Off;
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;
219 struct elf64_hdr { unsigned char e_ident[16U]; Elf64_Half e_type; Elf64_Half e_machine; Elf64_Word e_version; Elf64_Addr e_entry; Elf64_Off e_phoff; Elf64_Off e_shoff; Elf64_Word e_flags; Elf64_Half e_ehsize; Elf64_Half e_phentsize; Elf64_Half e_phnum; Elf64_Half e_shentsize; Elf64_Half e_shnum; Elf64_Half e_shstrndx; } ;
235 typedef struct elf64_hdr Elf64_Ehdr;
313 struct elf64_shdr { Elf64_Word sh_name; Elf64_Word sh_type; Elf64_Xword sh_flags; Elf64_Addr sh_addr; Elf64_Off sh_offset; Elf64_Xword sh_size; Elf64_Word sh_link; Elf64_Word sh_info; Elf64_Xword sh_addralign; Elf64_Xword sh_entsize; } ;
325 typedef struct elf64_shdr Elf64_Shdr;
53 union __anonunion____missing_field_name_216 { 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_216 __annonCompField50; } ;
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]; } ;
167 struct ida { struct idr idr; struct ida_bitmap *free_bitmap; } ;
199 struct dentry ;
200 struct iattr ;
201 struct super_block ;
202 struct file_system_type ;
203 struct kernfs_open_node ;
204 struct kernfs_iattrs ;
227 struct kernfs_root ;
227 struct kernfs_elem_dir { unsigned long subdirs; struct rb_root children; struct kernfs_root *root; } ;
85 struct kernfs_node ;
85 struct kernfs_elem_symlink { struct kernfs_node *target_kn; } ;
89 struct kernfs_ops ;
89 struct kernfs_elem_attr { const struct kernfs_ops *ops; struct kernfs_open_node *open; loff_t size; struct kernfs_node *notify_next; } ;
96 union __anonunion____missing_field_name_221 { struct kernfs_elem_dir dir; struct kernfs_elem_symlink symlink; struct kernfs_elem_attr attr; } ;
96 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_221 __annonCompField51; void *priv; unsigned short flags; umode_t mode; unsigned int ino; struct kernfs_iattrs *iattr; } ;
138 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 *); int (*show_path)(struct seq_file *, struct kernfs_node *, struct kernfs_root *); } ;
157 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; } ;
173 struct kernfs_open_file { struct kernfs_node *kn; struct file *file; void *priv; struct mutex mutex; struct mutex prealloc_mutex; int event; struct list_head list; char *prealloc_buf; size_t atomic_write_len; bool mmapped; const struct vm_operations_struct *vm_ops; } ;
191 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; } ;
499 struct sock ;
500 struct kobject ;
501 enum kobj_ns_type { KOBJ_NS_TYPE_NONE = 0, KOBJ_NS_TYPE_NET = 1, KOBJ_NS_TYPES = 2 } ;
507 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); umode_t (*is_bin_visible)(struct kobject *, struct bin_attribute *, int); struct attribute **attrs; struct bin_attribute **bin_attrs; } ;
92 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 *); } ;
165 struct sysfs_ops { ssize_t (*show)(struct kobject *, struct attribute *, char *); ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t ); } ;
530 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; } ;
115 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 *); } ;
123 struct kobj_uevent_env { char *argv[3U]; char *envp[32U]; int envp_idx; char buf[2048U]; int buflen; } ;
131 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 *); } ;
148 struct kset { struct list_head list; spinlock_t list_lock; struct kobject kobj; const struct kset_uevent_ops *uevent_ops; } ;
223 struct kernel_param ;
228 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_224 { void *arg; const struct kparam_string *str; const struct kparam_array *arr; } ;
62 struct kernel_param { const char *name; struct module *mod; const struct kernel_param_ops *ops; const u16 perm; s8 level; u8 flags; union __anonunion____missing_field_name_224 __annonCompField52; } ;
83 struct kparam_string { unsigned int maxlen; char *string; } ;
89 struct kparam_array { unsigned int max; unsigned int elemsize; unsigned int *num; const struct kernel_param_ops *ops; void *elem; } ;
470 struct latch_tree_node { struct rb_node node[2U]; } ;
211 struct mod_arch_specific { } ;
38 struct module_param_attrs ;
38 struct module_kobject { struct kobject kobj; struct module *mod; struct kobject *drivers_dir; struct module_param_attrs *mp; struct completion *kobj_completion; } ;
48 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 *); } ;
74 struct exception_table_entry ;
290 enum module_state { MODULE_STATE_LIVE = 0, MODULE_STATE_COMING = 1, MODULE_STATE_GOING = 2, MODULE_STATE_UNFORMED = 3 } ;
297 struct mod_tree_node { struct module *mod; struct latch_tree_node node; } ;
304 struct module_layout { void *base; unsigned int size; unsigned int text_size; unsigned int ro_size; struct mod_tree_node mtn; } ;
318 struct mod_kallsyms { Elf64_Sym *symtab; unsigned int num_symtab; char *strtab; } ;
332 struct klp_modinfo { Elf64_Ehdr hdr; Elf64_Shdr *sechdrs; char *secstrings; unsigned int symndx; } ;
340 struct module_sect_attrs ;
340 struct module_notes_attrs ;
340 struct trace_event_call ;
340 struct trace_enum_map ;
340 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 mutex param_lock; 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; bool async_probe_requested; 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)(); struct module_layout core_layout; struct module_layout init_layout; struct mod_arch_specific arch; unsigned int taints; unsigned int num_bugs; struct list_head bug_list; struct bug_entry *bug_table; struct mod_kallsyms *kallsyms; struct mod_kallsyms core_kallsyms; 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 trace_event_call **trace_events; unsigned int num_trace_events; struct trace_enum_map **trace_enums; unsigned int num_trace_enums; unsigned int num_ftrace_callsites; unsigned long *ftrace_callsites; bool klp; bool klp_alive; struct klp_modinfo *klp_info; struct list_head source_list; struct list_head target_list; void (*exit)(); atomic_t refcnt; ctor_fn_t (**ctors)(); unsigned int num_ctors; } ;
22 struct kernel_cap_struct { __u32 cap[2U]; } ;
25 typedef struct kernel_cap_struct kernel_cap_t;
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_232 { unsigned long sig[1U]; } ;
24 typedef struct __anonstruct_sigset_t_232 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_234 { __kernel_pid_t _pid; __kernel_uid32_t _uid; } ;
11 struct __anonstruct__timer_235 { __kernel_timer_t _tid; int _overrun; char _pad[0U]; sigval_t _sigval; int _sys_private; } ;
11 struct __anonstruct__rt_236 { __kernel_pid_t _pid; __kernel_uid32_t _uid; sigval_t _sigval; } ;
11 struct __anonstruct__sigchld_237 { __kernel_pid_t _pid; __kernel_uid32_t _uid; int _status; __kernel_clock_t _utime; __kernel_clock_t _stime; } ;
11 struct __anonstruct__addr_bnd_240 { void *_lower; void *_upper; } ;
11 union __anonunion____missing_field_name_239 { struct __anonstruct__addr_bnd_240 _addr_bnd; __u32 _pkey; } ;
11 struct __anonstruct__sigfault_238 { void *_addr; short _addr_lsb; union __anonunion____missing_field_name_239 __annonCompField53; } ;
11 struct __anonstruct__sigpoll_241 { long _band; int _fd; } ;
11 struct __anonstruct__sigsys_242 { void *_call_addr; int _syscall; unsigned int _arch; } ;
11 union __anonunion__sifields_233 { int _pad[28U]; struct __anonstruct__kill_234 _kill; struct __anonstruct__timer_235 _timer; struct __anonstruct__rt_236 _rt; struct __anonstruct__sigchld_237 _sigchld; struct __anonstruct__sigfault_238 _sigfault; struct __anonstruct__sigpoll_241 _sigpoll; struct __anonstruct__sigsys_242 _sigsys; } ;
11 struct siginfo { int si_signo; int si_errno; int si_code; union __anonunion__sifields_233 _sifields; } ;
118 typedef struct siginfo siginfo_t;
22 struct sigpending { struct list_head list; sigset_t signal; } ;
257 struct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; __sigrestore_t sa_restorer; sigset_t sa_mask; } ;
271 struct k_sigaction { struct sigaction sa; } ;
457 enum pid_type { PIDTYPE_PID = 0, PIDTYPE_PGID = 1, PIDTYPE_SID = 2, PIDTYPE_MAX = 3 } ;
464 struct pid_namespace ;
464 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; } ;
43 struct seccomp_filter ;
44 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 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; u8 state; u8 is_rel; int start_pid; void *start_site; char start_comm[16U]; } ;
125 struct hrtimer_clock_base { struct hrtimer_cpu_base *cpu_base; int index; clockid_t clockid; struct timerqueue_head active; ktime_t (*get_time)(); ktime_t offset; } ;
158 struct hrtimer_cpu_base { raw_spinlock_t lock; seqcount_t seq; struct hrtimer *running; unsigned int cpu; unsigned int active_bases; unsigned int clock_was_set_seq; bool migration_enabled; bool nohz_active; unsigned char in_hrtirq; unsigned char hres_active; unsigned char hang_detected; ktime_t expires_next; struct hrtimer *next_timer; unsigned int nr_events; unsigned int nr_retries; unsigned int nr_hangs; unsigned int max_hang_time; struct hrtimer_clock_base clock_base[4U]; } ;
12 enum kcov_mode { KCOV_MODE_DISABLED = 0, KCOV_MODE_TRACE = 1 } ;
17 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; } ;
41 struct assoc_array_ptr ;
41 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; } ;
91 union key_payload { void *rcu_data0; void *data[4U]; } ;
128 union __anonunion____missing_field_name_263 { struct list_head graveyard_link; struct rb_node serial_node; } ;
128 struct key_user ;
128 union __anonunion____missing_field_name_264 { time_t expiry; time_t revoked_at; } ;
128 struct __anonstruct____missing_field_name_266 { struct key_type *type; char *description; } ;
128 union __anonunion____missing_field_name_265 { struct keyring_index_key index_key; struct __anonstruct____missing_field_name_266 __annonCompField56; } ;
128 struct __anonstruct____missing_field_name_268 { struct list_head name_link; struct assoc_array keys; } ;
128 union __anonunion____missing_field_name_267 { union key_payload payload; struct __anonstruct____missing_field_name_268 __annonCompField58; int reject_error; } ;
128 struct key { atomic_t usage; key_serial_t serial; union __anonunion____missing_field_name_263 __annonCompField54; struct rw_semaphore sem; struct key_user *user; void *security; union __anonunion____missing_field_name_264 __annonCompField55; 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_265 __annonCompField57; union __anonunion____missing_field_name_267 __annonCompField59; int (*restrict_link)(struct key *, const struct key_type *, const union key_payload *); } ;
377 struct audit_context ;
27 struct group_info { atomic_t usage; int ngroups; int nblocks; kgid_t small_block[32U]; kgid_t *blocks[0U]; } ;
90 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; kernel_cap_t cap_ambient; 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; } ;
377 struct percpu_ref ;
55 typedef void percpu_ref_func_t(struct percpu_ref *);
68 struct percpu_ref { atomic_long_t count; unsigned long percpu_count_ptr; percpu_ref_func_t *release; percpu_ref_func_t *confirm_switch; bool force_atomic; struct callback_head rcu; } ;
327 enum rcu_sync_type { RCU_SYNC = 0, RCU_SCHED_SYNC = 1, RCU_BH_SYNC = 2 } ;
333 struct rcu_sync { int gp_state; int gp_count; wait_queue_head_t gp_wait; int cb_state; struct callback_head cb_head; enum rcu_sync_type gp_type; } ;
65 struct percpu_rw_semaphore { struct rcu_sync rss; unsigned int *fast_read_ctr; struct rw_semaphore rw_sem; atomic_t slow_read_ctr; wait_queue_head_t write_waitq; } ;
54 struct cgroup ;
55 struct cgroup_root ;
56 struct cgroup_subsys ;
57 struct cgroup_taskset ;
101 struct cgroup_file { struct kernfs_node *kn; } ;
90 struct cgroup_subsys_state { struct cgroup *cgroup; struct cgroup_subsys *ss; struct percpu_ref refcnt; struct cgroup_subsys_state *parent; struct list_head sibling; struct list_head children; int id; unsigned int flags; u64 serial_nr; atomic_t online_cnt; struct callback_head callback_head; struct work_struct destroy_work; } ;
141 struct css_set { atomic_t refcount; struct hlist_node hlist; struct list_head tasks; struct list_head mg_tasks; struct list_head cgrp_links; struct cgroup *dfl_cgrp; struct cgroup_subsys_state *subsys[13U]; struct list_head mg_preload_node; struct list_head mg_node; struct cgroup *mg_src_cgrp; struct cgroup *mg_dst_cgrp; struct css_set *mg_dst_cset; struct list_head e_cset_node[13U]; struct list_head task_iters; bool dead; struct callback_head callback_head; } ;
221 struct cgroup { struct cgroup_subsys_state self; unsigned long flags; int id; int level; int populated_cnt; struct kernfs_node *kn; struct cgroup_file procs_file; struct cgroup_file events_file; u16 subtree_control; u16 subtree_ss_mask; u16 old_subtree_control; u16 old_subtree_ss_mask; struct cgroup_subsys_state *subsys[13U]; struct cgroup_root *root; struct list_head cset_links; struct list_head e_csets[13U]; struct list_head pidlists; struct mutex pidlist_mutex; wait_queue_head_t offline_waitq; struct work_struct release_agent_work; int ancestor_ids[]; } ;
306 struct cgroup_root { struct kernfs_root *kf_root; unsigned int subsys_mask; int hierarchy_id; struct cgroup cgrp; int cgrp_ancestor_id_storage; atomic_t nr_cgrps; struct list_head root_list; unsigned int flags; struct idr cgroup_idr; char release_agent_path[4096U]; char name[64U]; } ;
345 struct cftype { char name[64U]; unsigned long private; size_t max_write_len; unsigned int flags; unsigned int file_offset; struct cgroup_subsys *ss; struct list_head node; struct kernfs_ops *kf_ops; u64 (*read_u64)(struct cgroup_subsys_state *, struct cftype *); s64 (*read_s64)(struct cgroup_subsys_state *, struct cftype *); 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 *); int (*write_u64)(struct cgroup_subsys_state *, struct cftype *, u64 ); int (*write_s64)(struct cgroup_subsys_state *, struct cftype *, s64 ); ssize_t (*write)(struct kernfs_open_file *, char *, size_t , loff_t ); struct lock_class_key lockdep_key; } ;
430 struct cgroup_subsys { struct cgroup_subsys_state * (*css_alloc)(struct cgroup_subsys_state *); int (*css_online)(struct cgroup_subsys_state *); void (*css_offline)(struct cgroup_subsys_state *); void (*css_released)(struct cgroup_subsys_state *); void (*css_free)(struct cgroup_subsys_state *); void (*css_reset)(struct cgroup_subsys_state *); int (*can_attach)(struct cgroup_taskset *); void (*cancel_attach)(struct cgroup_taskset *); void (*attach)(struct cgroup_taskset *); void (*post_attach)(); int (*can_fork)(struct task_struct *); void (*cancel_fork)(struct task_struct *); void (*fork)(struct task_struct *); void (*exit)(struct task_struct *); void (*free)(struct task_struct *); void (*bind)(struct cgroup_subsys_state *); bool early_init; bool implicit_on_dfl; bool broken_hierarchy; bool warned_broken_hierarchy; int id; const char *name; const char *legacy_name; struct cgroup_root *root; struct idr css_idr; struct list_head cfts; struct cftype *dfl_cftypes; struct cftype *legacy_cftypes; unsigned int depends_on; } ;
128 struct futex_pi_state ;
129 struct robust_list_head ;
130 struct bio_list ;
131 struct fs_struct ;
132 struct perf_event_context ;
133 struct blk_plug ;
135 struct nameidata ;
188 struct cfs_rq ;
189 struct task_group ;
492 struct sighand_struct { atomic_t count; struct k_sigaction action[64U]; spinlock_t siglock; wait_queue_head_t signalfd_wqh; } ;
534 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; } ;
542 struct cpu_itimer { cputime_t expires; cputime_t incr; u32 error; u32 incr_error; } ;
549 struct prev_cputime { cputime_t utime; cputime_t stime; raw_spinlock_t lock; } ;
574 struct task_cputime { cputime_t utime; cputime_t stime; unsigned long long sum_exec_runtime; } ;
590 struct task_cputime_atomic { atomic64_t utime; atomic64_t stime; atomic64_t sum_exec_runtime; } ;
612 struct thread_group_cputimer { struct task_cputime_atomic cputime_atomic; bool running; bool checking_timer; } ;
657 struct autogroup ;
658 struct tty_struct ;
658 struct taskstats ;
658 struct tty_audit_buf ;
658 struct signal_struct { atomic_t sigcnt; atomic_t live; int nr_threads; atomic_t oom_victims; 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 prev_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; struct tty_audit_buf *tty_audit_buf; bool oom_flag_origin; short oom_score_adj; short oom_score_adj_min; struct mutex cred_guard_mutex; } ;
833 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; unsigned long unix_inflight; atomic_long_t pipe_bufs; struct key *uid_keyring; struct key *session_keyring; struct hlist_node uidhash_node; kuid_t uid; atomic_long_t locked_vm; } ;
878 struct backing_dev_info ;
879 struct reclaim_state ;
880 struct sched_info { unsigned long pcount; unsigned long long run_delay; unsigned long long last_arrival; unsigned long long last_queued; } ;
894 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; } ;
951 struct wake_q_node { struct wake_q_node *next; } ;
1183 struct io_context ;
1217 struct pipe_inode_info ;
1219 struct load_weight { unsigned long weight; u32 inv_weight; } ;
1226 struct sched_avg { u64 last_update_time; u64 load_sum; u32 util_sum; u32 period_contrib; unsigned long load_avg; unsigned long util_avg; } ;
1284 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; } ;
1319 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; } ;
1356 struct rt_rq ;
1356 struct sched_rt_entity { struct list_head run_list; unsigned long timeout; unsigned long watchdog_stamp; unsigned int time_slice; unsigned short on_rq; unsigned short on_list; struct sched_rt_entity *back; struct sched_rt_entity *parent; struct rt_rq *rt_rq; struct rt_rq *my_q; } ;
1374 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_boosted; int dl_yielded; struct hrtimer dl_timer; } ;
1438 struct tlbflush_unmap_batch { struct cpumask cpumask; bool flush_required; bool writable; } ;
1457 struct sched_class ;
1457 struct files_struct ;
1457 struct compat_robust_list_head ;
1457 struct numa_group ;
1457 struct ftrace_ret_stack ;
1457 struct kcov ;
1457 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; unsigned int wakee_flips; unsigned long wakee_flip_decay_ts; struct task_struct *last_wakee; 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 btrace_seq; 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; 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 long jobctl; unsigned int personality; unsigned char sched_reset_on_fork; unsigned char sched_contributes_to_load; unsigned char sched_migrated; unsigned char sched_remote_wakeup; unsigned char; unsigned char in_execve; unsigned char in_iowait; unsigned char memcg_may_oom; unsigned char memcg_kmem_skip_account; unsigned char brk_randomized; 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 prev_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]; struct nameidata *nameidata; struct sysv_sem sysvsem; struct sysv_shm sysvshm; unsigned long last_switch_count; 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; unsigned int sas_ss_flags; 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 wake_q_node wake_q; 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; unsigned int in_ubsan; 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[3U]; unsigned long numa_pages_migrated; struct tlbflush_unmap_batch tlb_ubc; 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]; u64 timer_slack_ns; u64 default_timer_slack_ns; unsigned int kasan_depth; int curr_ret_stack; struct ftrace_ret_stack *ret_stack; unsigned long long ftrace_timestamp; atomic_t trace_overrun; atomic_t tracing_graph_pause; unsigned long trace; unsigned long trace_recursion; enum kcov_mode kcov_mode; unsigned int kcov_size; void *kcov_area; struct kcov *kcov; struct mem_cgroup *memcg_in_oom; gfp_t memcg_oom_gfp_mask; int memcg_oom_order; unsigned int memcg_nr_pages_over_high; struct uprobe_task *utask; unsigned int sequential_io; unsigned int sequential_io_avg; unsigned long task_state_change; int pagefault_disabled; struct task_struct *oom_reaper_list; struct thread_struct thread; } ;
638 struct ca_slot_info { int num; int type; unsigned int flags; } ;
54 struct ca_caps { unsigned int slot_num; unsigned int slot_type; unsigned int descr_num; unsigned int descr_type; } ;
61 struct ca_msg { unsigned int index; unsigned int type; unsigned int length; unsigned char msg[256U]; } ;
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_302 { spinlock_t lock; int count; } ;
114 union __anonunion____missing_field_name_301 { struct __anonstruct____missing_field_name_302 __annonCompField65; } ;
114 struct lockref { union __anonunion____missing_field_name_301 __annonCompField66; } ;
75 struct path ;
76 struct vfsmount ;
77 struct __anonstruct____missing_field_name_304 { u32 hash; u32 len; } ;
77 union __anonunion____missing_field_name_303 { struct __anonstruct____missing_field_name_304 __annonCompField67; u64 hash_len; } ;
77 struct qstr { union __anonunion____missing_field_name_303 __annonCompField68; const unsigned char *name; } ;
65 struct dentry_operations ;
65 union __anonunion____missing_field_name_305 { struct list_head d_lru; wait_queue_head_t *d_wait; } ;
65 union __anonunion_d_u_306 { struct hlist_node d_alias; struct hlist_bl_node d_in_lookup_hash; struct callback_head d_rcu; } ;
65 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; union __anonunion____missing_field_name_305 __annonCompField69; struct list_head d_child; struct list_head d_subdirs; union __anonunion_d_u_306 d_u; } ;
121 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 ); struct inode * (*d_select_inode)(struct dentry *, unsigned int); struct dentry * (*d_real)(struct dentry *, struct inode *); } ;
577 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; } ;
63 struct __anonstruct____missing_field_name_308 { struct radix_tree_node *parent; void *private_data; } ;
63 union __anonunion____missing_field_name_307 { struct __anonstruct____missing_field_name_308 __annonCompField70; struct callback_head callback_head; } ;
63 struct radix_tree_node { unsigned char shift; unsigned char offset; unsigned int count; union __anonunion____missing_field_name_307 __annonCompField71; struct list_head private_list; void *slots[64U]; unsigned long tags[3U][1U]; } ;
106 struct radix_tree_root { gfp_t gfp_mask; struct radix_tree_node *rnode; } ;
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 } ;
47 struct block_device ;
268 struct delayed_call { void (*fn)(void *); void *arg; } ;
261 struct bdi_writeback ;
262 struct export_operations ;
265 struct kiocb ;
266 struct poll_table_struct ;
267 struct kstatfs ;
268 struct swap_info_struct ;
269 struct iov_iter ;
270 struct fscrypt_info ;
271 struct fscrypt_operations ;
76 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; } ;
213 struct dquot ;
214 struct kqid ;
19 typedef __kernel_uid32_t projid_t;
23 struct __anonstruct_kprojid_t_314 { projid_t val; } ;
23 typedef struct __anonstruct_kprojid_t_314 kprojid_t;
181 enum quota_type { USRQUOTA = 0, GRPQUOTA = 1, PRJQUOTA = 2 } ;
66 typedef long long qsize_t;
67 union __anonunion____missing_field_name_315 { kuid_t uid; kgid_t gid; kprojid_t projid; } ;
67 struct kqid { union __anonunion____missing_field_name_315 __annonCompField73; enum quota_type type; } ;
184 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; } ;
206 struct quota_format_type ;
207 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; } ;
272 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; } ;
299 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 *); int (*get_next_id)(struct super_block *, struct kqid *); } ;
311 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 *); int (*get_projid)(struct inode *, kprojid_t *); int (*get_next_id)(struct super_block *, struct kqid *); } ;
328 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; } ;
351 struct qc_type_state { unsigned int flags; unsigned int spc_timelimit; unsigned int ino_timelimit; unsigned int rt_spc_timelimit; unsigned int spc_warnlimit; unsigned int ino_warnlimit; unsigned int rt_spc_warnlimit; unsigned long long ino; blkcnt_t blocks; blkcnt_t nextents; } ;
397 struct qc_state { unsigned int s_incoredqs; struct qc_type_state s_state[3U]; } ;
408 struct qc_info { int i_fieldmask; unsigned int i_flags; unsigned int i_spc_timelimit; unsigned int i_ino_timelimit; unsigned int i_rt_spc_timelimit; unsigned int i_spc_warnlimit; unsigned int i_ino_warnlimit; unsigned int i_rt_spc_warnlimit; } ;
421 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 (*set_info)(struct super_block *, int, struct qc_info *); int (*get_dqblk)(struct super_block *, struct kqid , struct qc_dqblk *); int (*get_nextdqblk)(struct super_block *, struct kqid *, struct qc_dqblk *); int (*set_dqblk)(struct super_block *, struct kqid , struct qc_dqblk *); int (*get_state)(struct super_block *, struct qc_state *); int (*rm_xquota)(struct super_block *, unsigned int); } ;
437 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; } ;
501 struct quota_info { unsigned int flags; struct mutex dqio_mutex; struct mutex dqonoff_mutex; struct inode *files[3U]; struct mem_dqinfo info[3U]; const struct quota_format_ops *ops[3U]; } ;
531 struct writeback_control ;
532 struct kiocb { struct file *ki_filp; loff_t ki_pos; void (*ki_complete)(struct kiocb *, long, long); void *private; int ki_flags; } ;
371 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)(struct kiocb *, struct iov_iter *); 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 *); } ;
428 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 nrexceptional; 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; } ;
449 struct request_queue ;
450 struct hd_struct ;
450 struct gendisk ;
450 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; } ;
566 struct posix_acl ;
592 struct inode_operations ;
592 union __anonunion____missing_field_name_320 { const unsigned int i_nlink; unsigned int __i_nlink; } ;
592 union __anonunion____missing_field_name_321 { struct hlist_head i_dentry; struct callback_head i_rcu; } ;
592 struct file_lock_context ;
592 struct cdev ;
592 union __anonunion____missing_field_name_322 { struct pipe_inode_info *i_pipe; struct block_device *i_bdev; struct cdev *i_cdev; char *i_link; unsigned int i_dir_seq; } ;
592 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_320 __annonCompField74; 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 rw_semaphore i_rwsem; unsigned long dirtied_when; unsigned long dirtied_time_when; struct hlist_node i_hash; struct list_head i_io_list; struct bdi_writeback *i_wb; int i_wb_frn_winner; u16 i_wb_frn_avg_time; u16 i_wb_frn_history; struct list_head i_lru; struct list_head i_sb_list; union __anonunion____missing_field_name_321 __annonCompField75; 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_322 __annonCompField76; __u32 i_generation; __u32 i_fsnotify_mask; struct hlist_head i_fsnotify_marks; struct fscrypt_info *i_crypt_info; void *i_private; } ;
870 struct fown_struct { rwlock_t lock; struct pid *pid; enum pid_type pid_type; kuid_t uid; kuid_t euid; int signum; } ;
878 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; } ;
901 union __anonunion_f_u_323 { struct llist_node fu_llist; struct callback_head fu_rcuhead; } ;
901 struct file { union __anonunion_f_u_323 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; } ;
986 typedef void *fl_owner_t;
987 struct file_lock ;
988 struct file_lock_operations { void (*fl_copy_lock)(struct file_lock *, struct file_lock *); void (*fl_release_private)(struct file_lock *); } ;
994 struct lock_manager_operations { int (*lm_compare_owner)(struct file_lock *, struct file_lock *); unsigned long int (*lm_owner_key)(struct file_lock *); fl_owner_t (*lm_get_owner)(fl_owner_t ); void (*lm_put_owner)(fl_owner_t ); 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 **); } ;
1021 struct nlm_lockowner ;
1022 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_325 { struct list_head link; int state; } ;
19 union __anonunion_fl_u_324 { struct nfs_lock_info nfs_fl; struct nfs4_lock_info nfs4_fl; struct __anonstruct_afs_325 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_324 fl_u; } ;
1074 struct file_lock_context { spinlock_t flc_lock; struct list_head flc_flock; struct list_head flc_posix; struct list_head flc_lease; } ;
1287 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; } ;
1322 struct sb_writers { int frozen; wait_queue_head_t wait_unfrozen; struct percpu_rw_semaphore rw_sem[3U]; } ;
1348 struct super_operations ;
1348 struct xattr_handler ;
1348 struct mtd_info ;
1348 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_iflags; 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; const struct fscrypt_operations *s_cop; 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; struct work_struct destroy_work; struct mutex s_sync_lock; int s_stack_depth; spinlock_t s_inode_list_lock; struct list_head s_inodes; } ;
1594 struct fiemap_extent_info { unsigned int fi_flags; unsigned int fi_extents_mapped; unsigned int fi_extents_max; struct fiemap_extent *fi_extents_start; } ;
1608 struct dir_context ;
1633 struct dir_context { int (*actor)(struct dir_context *, const char *, int, loff_t , u64 , unsigned int); loff_t pos; } ;
1640 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 (*read_iter)(struct kiocb *, struct iov_iter *); ssize_t (*write_iter)(struct kiocb *, struct iov_iter *); int (*iterate)(struct file *, struct dir_context *); int (*iterate_shared)(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 *); 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 *); ssize_t (*copy_file_range)(struct file *, loff_t , struct file *, loff_t , size_t , unsigned int); int (*clone_file_range)(struct file *, loff_t , struct file *, loff_t , u64 ); ssize_t (*dedupe_file_range)(struct file *, u64 , u64 , struct file *, u64 ); } ;
1709 struct inode_operations { struct dentry * (*lookup)(struct inode *, struct dentry *, unsigned int); const char * (*get_link)(struct dentry *, struct inode *, struct delayed_call *); int (*permission)(struct inode *, int); struct posix_acl * (*get_acl)(struct inode *, int); int (*readlink)(struct dentry *, char *, int); 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 *, struct inode *, const char *, const void *, size_t , int); ssize_t (*getxattr)(struct dentry *, struct inode *, 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); } ;
1766 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 *); } ;
2005 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; } ;
63 struct exception_table_entry { int insn; int fixup; int handler; } ;
774 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 klist_node ;
37 struct klist_node { void *n_klist; struct list_head n_node; struct kref n_ref; } ;
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; const struct file *file; void *private; } ;
30 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 *); } ;
222 struct pinctrl ;
223 struct pinctrl_state ;
194 struct dev_pin_info { struct pinctrl *p; struct pinctrl_state *default_state; struct pinctrl_state *init_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; } ;
24 struct device_private ;
25 struct device_driver ;
26 struct driver_private ;
27 struct class ;
28 struct subsys_private ;
29 struct bus_type ;
30 struct device_node ;
31 struct fwnode_handle ;
32 struct iommu_ops ;
33 struct iommu_group ;
61 struct device_attribute ;
61 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; } ;
142 struct device_type ;
201 enum probe_type { PROBE_DEFAULT_STRATEGY = 0, PROBE_PREFER_ASYNCHRONOUS = 1, PROBE_FORCE_SYNCHRONOUS = 2 } ;
207 struct of_device_id ;
207 struct acpi_device_id ;
207 struct device_driver { const char *name; struct bus_type *bus; struct module *owner; const char *mod_name; bool suppress_bind_attrs; enum probe_type probe_type; 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; } ;
357 struct class_attribute ;
357 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; } ;
450 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 ); } ;
518 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; } ;
546 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 ); } ;
699 struct device_dma_parameters { unsigned int max_segment_size; unsigned long segment_boundary_mask; } ;
708 struct irq_domain ;
708 struct dma_coherent_mem ;
708 struct cma ;
708 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 irq_domain *msi_domain; struct dev_pin_info *pins; struct list_head msi_list; 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 fwnode_handle *fwnode; 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; } ;
862 struct wakeup_source { const char *name; struct list_head entry; spinlock_t lock; struct wake_irq *wakeirq; 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; } ;
1327 struct cdev { struct kobject kobj; struct module *owner; const struct file_operations *ops; struct list_head list; dev_t dev; unsigned int count; } ;
32 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 *); } ;
67 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 *); } ;
396 struct media_device ;
396 struct media_gobj { struct media_device *mdev; u32 id; struct list_head list; } ;
73 struct media_entity_enum { unsigned long *bmap; int idx_max; } ;
87 struct media_entity ;
87 struct __anonstruct_stack_333 { struct media_entity *entity; struct list_head *link; } ;
87 struct media_entity_graph { struct __anonstruct_stack_333 stack[16U]; struct media_entity_enum ent_enum; int top; } ;
106 struct media_pipeline { int streaming_count; struct media_entity_graph graph; } ;
117 struct media_pad ;
117 struct media_interface ;
117 union __anonunion____missing_field_name_334 { struct media_gobj *gobj0; struct media_pad *source; struct media_interface *intf; } ;
117 union __anonunion____missing_field_name_335 { struct media_gobj *gobj1; struct media_pad *sink; struct media_entity *entity; } ;
117 struct media_link { struct media_gobj graph_obj; struct list_head list; union __anonunion____missing_field_name_334 __annonCompField79; union __anonunion____missing_field_name_335 __annonCompField80; struct media_link *reverse; unsigned long flags; bool is_backlink; } ;
158 struct media_pad { struct media_gobj graph_obj; struct media_entity *entity; u16 index; unsigned long flags; } ;
173 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 *); } ;
192 enum media_entity_type { MEDIA_ENTITY_TYPE_BASE = 0, MEDIA_ENTITY_TYPE_VIDEO_DEVICE = 1, MEDIA_ENTITY_TYPE_V4L2_SUBDEV = 2 } ;
198 struct __anonstruct_dev_337 { u32 major; u32 minor; } ;
198 union __anonunion_info_336 { struct __anonstruct_dev_337 dev; } ;
198 struct media_entity { struct media_gobj graph_obj; const char *name; enum media_entity_type obj_type; u32 function; unsigned long flags; u16 num_pads; u16 num_links; u16 num_backlinks; int internal_idx; struct media_pad *pads; struct list_head links; const struct media_entity_operations *ops; int stream_count; int use_count; struct media_pipeline *pipe; union __anonunion_info_336 info; } ;
284 struct media_interface { struct media_gobj graph_obj; struct list_head links; u32 type; u32 flags; } ;
301 struct media_intf_devnode { struct media_interface intf; u32 major; u32 minor; } ;
281 struct media_device { struct device *dev; struct media_devnode devnode; char model[32U]; char driver_name[32U]; char serial[40U]; char bus_info[32U]; u32 hw_revision; u32 driver_version; u64 topology_version; u32 id; struct ida entity_internal_idx; int entity_internal_idx_max; struct list_head entities; struct list_head interfaces; struct list_head pads; struct list_head links; struct list_head entity_notify; struct mutex graph_mutex; struct media_entity_graph pm_count_walk; void *source_priv; int (*enable_source)(struct media_entity *, struct media_pipeline *); void (*disable_source)(struct media_entity *); int (*link_notify)(struct media_link *, u32 , unsigned int); } ;
652 struct dvb_frontend ;
653 struct dvb_device ;
653 struct dvb_adapter { int num; struct list_head list_head; struct list_head device_list; const char *name; u8 proposed_mac[6U]; void *priv; struct device *device; struct module *module; int mfe_shared; struct dvb_device *mfe_dvbdev; struct mutex mfe_lock; struct media_device *mdev; struct media_entity *conn; struct media_pad *conn_pads; } ;
103 struct dvb_device { struct list_head list_head; const struct file_operations *fops; struct dvb_adapter *adapter; int type; int minor; u32 id; int readers; int writers; int users; wait_queue_head_t wait_queue; int (*kernel_ioctl)(struct file *, unsigned int, void *); const char *name; struct media_intf_devnode *intf_devnode; unsigned int tsout_num_entities; struct media_entity *entity; struct media_entity *tsout_entity; struct media_pad *pads; struct media_pad *tsout_pads; void *priv; } ;
13 typedef unsigned long kernel_ulong_t;
14 struct pci_device_id { __u32 vendor; __u32 device; __u32 subvendor; __u32 subdevice; __u32 class; __u32 class_mask; kernel_ulong_t driver_data; } ;
186 struct acpi_device_id { __u8 id[9U]; kernel_ulong_t driver_data; __u32 cls; __u32 cls_msk; } ;
229 struct of_device_id { char name[32U]; char type[32U]; char compatible[128U]; const void *data; } ;
659 enum fwnode_type { FWNODE_INVALID = 0, FWNODE_OF = 1, FWNODE_ACPI = 2, FWNODE_ACPI_DATA = 3, FWNODE_PDATA = 4, FWNODE_IRQCHIP = 5 } ;
668 struct fwnode_handle { enum fwnode_type type; struct fwnode_handle *secondary; } ;
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; } ;
1150 struct i2c_msg { __u16 addr; __u16 flags; __u16 len; __u8 *buf; } ;
83 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 ;
199 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 *); } ;
254 enum i2c_slave_event { I2C_SLAVE_READ_REQUESTED = 0, I2C_SLAVE_WRITE_REQUESTED = 1, I2C_SLAVE_READ_PROCESSED = 2, I2C_SLAVE_WRITE_RECEIVED = 3, I2C_SLAVE_STOP = 4 } ;
362 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 *); } ;
431 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_adapter *); void (*unprepare_recovery)(struct i2c_adapter *); int scl_gpio; int sda_gpio; } ;
470 struct i2c_adapter_quirks { u64 flags; int max_num_msgs; u16 max_write_len; u16 max_read_len; u16 max_comb_1st_msg_len; u16 max_comb_2nd_msg_len; } ;
500 struct i2c_adapter { struct module *owner; unsigned int class; const struct i2c_algorithm *algo; void *algo_data; struct rt_mutex bus_lock; struct rt_mutex mux_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; const struct i2c_adapter_quirks *quirks; void (*lock_bus)(struct i2c_adapter *, unsigned int); int (*trylock_bus)(struct i2c_adapter *, unsigned int); void (*unlock_bus)(struct i2c_adapter *, unsigned int); } ;
54 enum fe_type { FE_QPSK = 0, FE_QAM = 1, FE_OFDM = 2, FE_ATSC = 3 } ;
61 enum fe_caps { FE_IS_STUPID = 0, FE_CAN_INVERSION_AUTO = 1, FE_CAN_FEC_1_2 = 2, FE_CAN_FEC_2_3 = 4, FE_CAN_FEC_3_4 = 8, FE_CAN_FEC_4_5 = 16, FE_CAN_FEC_5_6 = 32, FE_CAN_FEC_6_7 = 64, FE_CAN_FEC_7_8 = 128, FE_CAN_FEC_8_9 = 256, FE_CAN_FEC_AUTO = 512, FE_CAN_QPSK = 1024, FE_CAN_QAM_16 = 2048, FE_CAN_QAM_32 = 4096, FE_CAN_QAM_64 = 8192, FE_CAN_QAM_128 = 16384, FE_CAN_QAM_256 = 32768, FE_CAN_QAM_AUTO = 65536, FE_CAN_TRANSMISSION_MODE_AUTO = 131072, FE_CAN_BANDWIDTH_AUTO = 262144, FE_CAN_GUARD_INTERVAL_AUTO = 524288, FE_CAN_HIERARCHY_AUTO = 1048576, FE_CAN_8VSB = 2097152, FE_CAN_16VSB = 4194304, FE_HAS_EXTENDED_CAPS = 8388608, FE_CAN_MULTISTREAM = 67108864, FE_CAN_TURBO_FEC = 134217728, FE_CAN_2G_MODULATION = 268435456, FE_NEEDS_BENDING = 536870912, FE_CAN_RECOVER = 1073741824, FE_CAN_MUTE_TS = 2147483648 } ;
95 struct dvb_frontend_info { char name[128U]; enum fe_type type; __u32 frequency_min; __u32 frequency_max; __u32 frequency_stepsize; __u32 frequency_tolerance; __u32 symbol_rate_min; __u32 symbol_rate_max; __u32 symbol_rate_tolerance; __u32 notifier_delay; enum fe_caps caps; } ;
85 struct dvb_diseqc_master_cmd { __u8 msg[6U]; __u8 msg_len; } ;
95 struct dvb_diseqc_slave_reply { __u8 msg[4U]; __u8 msg_len; int timeout; } ;
101 enum fe_sec_voltage { SEC_VOLTAGE_13 = 0, SEC_VOLTAGE_18 = 1, SEC_VOLTAGE_OFF = 2 } ;
107 enum fe_sec_tone_mode { SEC_TONE_ON = 0, SEC_TONE_OFF = 1 } ;
112 enum fe_sec_mini_cmd { SEC_MINI_A = 0, SEC_MINI_B = 1 } ;
117 enum fe_status { FE_HAS_SIGNAL = 1, FE_HAS_CARRIER = 2, FE_HAS_VITERBI = 4, FE_HAS_SYNC = 8, FE_HAS_LOCK = 16, FE_TIMEDOUT = 32, FE_REINIT = 64 } ;
127 enum fe_spectral_inversion { INVERSION_OFF = 0, INVERSION_ON = 1, INVERSION_AUTO = 2 } ;
133 enum fe_code_rate { FEC_NONE = 0, FEC_1_2 = 1, FEC_2_3 = 2, FEC_3_4 = 3, FEC_4_5 = 4, FEC_5_6 = 5, FEC_6_7 = 6, FEC_7_8 = 7, FEC_8_9 = 8, FEC_AUTO = 9, FEC_3_5 = 10, FEC_9_10 = 11, FEC_2_5 = 12 } ;
149 enum fe_modulation { QPSK = 0, QAM_16 = 1, QAM_32 = 2, QAM_64 = 3, QAM_128 = 4, QAM_256 = 5, QAM_AUTO = 6, VSB_8 = 7, VSB_16 = 8, PSK_8 = 9, APSK_16 = 10, APSK_32 = 11, DQPSK = 12, QAM_4_NR = 13 } ;
166 enum fe_transmit_mode { TRANSMISSION_MODE_2K = 0, TRANSMISSION_MODE_8K = 1, TRANSMISSION_MODE_AUTO = 2, TRANSMISSION_MODE_4K = 3, TRANSMISSION_MODE_1K = 4, TRANSMISSION_MODE_16K = 5, TRANSMISSION_MODE_32K = 6, TRANSMISSION_MODE_C1 = 7, TRANSMISSION_MODE_C3780 = 8 } ;
178 enum fe_guard_interval { GUARD_INTERVAL_1_32 = 0, GUARD_INTERVAL_1_16 = 1, GUARD_INTERVAL_1_8 = 2, GUARD_INTERVAL_1_4 = 3, GUARD_INTERVAL_AUTO = 4, GUARD_INTERVAL_1_128 = 5, GUARD_INTERVAL_19_128 = 6, GUARD_INTERVAL_19_256 = 7, GUARD_INTERVAL_PN420 = 8, GUARD_INTERVAL_PN595 = 9, GUARD_INTERVAL_PN945 = 10 } ;
192 enum fe_hierarchy { HIERARCHY_NONE = 0, HIERARCHY_1 = 1, HIERARCHY_2 = 2, HIERARCHY_4 = 3, HIERARCHY_AUTO = 4 } ;
200 enum fe_interleaving { INTERLEAVING_NONE = 0, INTERLEAVING_AUTO = 1, INTERLEAVING_240 = 2, INTERLEAVING_720 = 3 } ;
207 enum fe_pilot { PILOT_ON = 0, PILOT_OFF = 1, PILOT_AUTO = 2 } ;
213 enum fe_rolloff { ROLLOFF_35 = 0, ROLLOFF_20 = 1, ROLLOFF_25 = 2, ROLLOFF_AUTO = 3 } ;
220 enum fe_delivery_system { SYS_UNDEFINED = 0, SYS_DVBC_ANNEX_A = 1, SYS_DVBC_ANNEX_B = 2, SYS_DVBT = 3, SYS_DSS = 4, SYS_DVBS = 5, SYS_DVBS2 = 6, SYS_DVBH = 7, SYS_ISDBT = 8, SYS_ISDBS = 9, SYS_ISDBC = 10, SYS_ATSC = 11, SYS_ATSCMH = 12, SYS_DTMB = 13, SYS_CMMB = 14, SYS_DAB = 15, SYS_DVBT2 = 16, SYS_TURBO = 17, SYS_DVBC_ANNEX_C = 18 } ;
403 union __anonunion____missing_field_name_344 { __u64 uvalue; __s64 svalue; } ;
403 struct dtv_stats { __u8 scale; union __anonunion____missing_field_name_344 __annonCompField82; } ;
454 struct dtv_fe_stats { __u8 len; struct dtv_stats stat[4U]; } ;
462 struct __anonstruct_buffer_346 { __u8 data[32U]; __u32 len; __u32 reserved1[3U]; void *reserved2; } ;
462 union __anonunion_u_345 { __u32 data; struct dtv_fe_stats st; struct __anonstruct_buffer_346 buffer; } ;
462 struct dtv_property { __u32 cmd; __u32 reserved[3U]; union __anonunion_u_345 u; int result; } ;
486 struct dvb_frontend_tune_settings { int min_delay_ms; int step_size; int max_drift; } ;
88 struct dvb_tuner_info { char name[128U]; u32 frequency_min; u32 frequency_max; u32 frequency_step; u32 bandwidth_min; u32 bandwidth_max; u32 bandwidth_step; } ;
116 struct analog_parameters { unsigned int frequency; unsigned int mode; unsigned int audmode; u64 std; } ;
137 enum dvbfe_algo { DVBFE_ALGO_HW = 1, DVBFE_ALGO_SW = 2, DVBFE_ALGO_CUSTOM = 4, DVBFE_ALGO_RECOVERY = -2147483648 } ;
144 enum dvbfe_search { DVBFE_ALGO_SEARCH_SUCCESS = 1, DVBFE_ALGO_SEARCH_ASLEEP = 2, DVBFE_ALGO_SEARCH_FAILED = 4, DVBFE_ALGO_SEARCH_INVALID = 8, DVBFE_ALGO_SEARCH_AGAIN = 16, DVBFE_ALGO_SEARCH_ERROR = -2147483648 } ;
153 struct dvb_tuner_ops { struct dvb_tuner_info info; int (*release)(struct dvb_frontend *); int (*init)(struct dvb_frontend *); int (*sleep)(struct dvb_frontend *); int (*suspend)(struct dvb_frontend *); int (*resume)(struct dvb_frontend *); int (*set_params)(struct dvb_frontend *); int (*set_analog_params)(struct dvb_frontend *, struct analog_parameters *); int (*set_config)(struct dvb_frontend *, void *); int (*get_frequency)(struct dvb_frontend *, u32 *); int (*get_bandwidth)(struct dvb_frontend *, u32 *); int (*get_if_frequency)(struct dvb_frontend *, u32 *); int (*get_status)(struct dvb_frontend *, u32 *); int (*get_rf_strength)(struct dvb_frontend *, u16 *); int (*get_afc)(struct dvb_frontend *, s32 *); int (*calc_regs)(struct dvb_frontend *, u8 *, int); int (*set_frequency)(struct dvb_frontend *, u32 ); int (*set_bandwidth)(struct dvb_frontend *, u32 ); } ;
287 struct analog_demod_info { char *name; } ;
296 struct analog_demod_ops { struct analog_demod_info info; void (*set_params)(struct dvb_frontend *, struct analog_parameters *); int (*has_signal)(struct dvb_frontend *, u16 *); int (*get_afc)(struct dvb_frontend *, s32 *); void (*tuner_status)(struct dvb_frontend *); void (*standby)(struct dvb_frontend *); void (*release)(struct dvb_frontend *); int (*i2c_gate_ctrl)(struct dvb_frontend *, int); int (*set_config)(struct dvb_frontend *, void *); } ;
335 struct dtv_frontend_properties ;
336 struct dvb_frontend_ops { struct dvb_frontend_info info; u8 delsys[8U]; void (*release)(struct dvb_frontend *); void (*release_sec)(struct dvb_frontend *); int (*init)(struct dvb_frontend *); int (*sleep)(struct dvb_frontend *); int (*write)(struct dvb_frontend *, const u8 *, int); int (*tune)(struct dvb_frontend *, bool , unsigned int, unsigned int *, enum fe_status *); enum dvbfe_algo (*get_frontend_algo)(struct dvb_frontend *); int (*set_frontend)(struct dvb_frontend *); int (*get_tune_settings)(struct dvb_frontend *, struct dvb_frontend_tune_settings *); int (*get_frontend)(struct dvb_frontend *, struct dtv_frontend_properties *); int (*read_status)(struct dvb_frontend *, enum fe_status *); int (*read_ber)(struct dvb_frontend *, u32 *); int (*read_signal_strength)(struct dvb_frontend *, u16 *); int (*read_snr)(struct dvb_frontend *, u16 *); int (*read_ucblocks)(struct dvb_frontend *, u32 *); int (*diseqc_reset_overload)(struct dvb_frontend *); int (*diseqc_send_master_cmd)(struct dvb_frontend *, struct dvb_diseqc_master_cmd *); int (*diseqc_recv_slave_reply)(struct dvb_frontend *, struct dvb_diseqc_slave_reply *); int (*diseqc_send_burst)(struct dvb_frontend *, enum fe_sec_mini_cmd ); int (*set_tone)(struct dvb_frontend *, enum fe_sec_tone_mode ); int (*set_voltage)(struct dvb_frontend *, enum fe_sec_voltage ); int (*enable_high_lnb_voltage)(struct dvb_frontend *, long); int (*dishnetwork_send_legacy_command)(struct dvb_frontend *, unsigned long); int (*i2c_gate_ctrl)(struct dvb_frontend *, int); int (*ts_bus_ctrl)(struct dvb_frontend *, int); int (*set_lna)(struct dvb_frontend *); enum dvbfe_search (*search)(struct dvb_frontend *); struct dvb_tuner_ops tuner_ops; struct analog_demod_ops analog_ops; int (*set_property)(struct dvb_frontend *, struct dtv_property *); int (*get_property)(struct dvb_frontend *, struct dtv_property *); } ;
487 struct __anonstruct_layer_347 { u8 segment_count; enum fe_code_rate fec; enum fe_modulation modulation; u8 interleaving; } ;
487 struct dtv_frontend_properties { u32 frequency; enum fe_modulation modulation; enum fe_sec_voltage voltage; enum fe_sec_tone_mode sectone; enum fe_spectral_inversion inversion; enum fe_code_rate fec_inner; enum fe_transmit_mode transmission_mode; u32 bandwidth_hz; enum fe_guard_interval guard_interval; enum fe_hierarchy hierarchy; u32 symbol_rate; enum fe_code_rate code_rate_HP; enum fe_code_rate code_rate_LP; enum fe_pilot pilot; enum fe_rolloff rolloff; enum fe_delivery_system delivery_system; enum fe_interleaving interleaving; u8 isdbt_partial_reception; u8 isdbt_sb_mode; u8 isdbt_sb_subchannel; u32 isdbt_sb_segment_idx; u32 isdbt_sb_segment_count; u8 isdbt_layer_enabled; struct __anonstruct_layer_347 layer[3U]; u32 stream_id; u8 atscmh_fic_ver; u8 atscmh_parade_id; u8 atscmh_nog; u8 atscmh_tnog; u8 atscmh_sgn; u8 atscmh_prc; u8 atscmh_rs_frame_mode; u8 atscmh_rs_frame_ensemble; u8 atscmh_rs_code_mode_pri; u8 atscmh_rs_code_mode_sec; u8 atscmh_sccc_block_mode; u8 atscmh_sccc_code_mode_a; u8 atscmh_sccc_code_mode_b; u8 atscmh_sccc_code_mode_c; u8 atscmh_sccc_code_mode_d; u32 lna; struct dtv_fe_stats strength; struct dtv_fe_stats cnr; struct dtv_fe_stats pre_bit_error; struct dtv_fe_stats pre_bit_count; struct dtv_fe_stats post_bit_error; struct dtv_fe_stats post_bit_count; struct dtv_fe_stats block_error; struct dtv_fe_stats block_count; u32 state; } ;
650 struct dvb_frontend { struct dvb_frontend_ops ops; struct dvb_adapter *dvb; void *demodulator_priv; void *tuner_priv; void *frontend_priv; void *sec_priv; void *analog_demod_priv; struct dtv_frontend_properties dtv_property_cache; int (*callback)(void *, int, int, int); int id; unsigned int exit; } ;
813 struct dst_state ;
414 struct proc_dir_entry ;
478 struct tasklet_struct { struct tasklet_struct *next; unsigned long state; atomic_t count; void (*func)(unsigned long); unsigned long data; } ;
70 struct hotplug_slot ;
70 struct pci_slot { struct pci_bus *bus; struct list_head list; struct hotplug_slot *hotplug; unsigned char number; struct kobject kobj; } ;
104 typedef int pci_power_t;
131 typedef unsigned int pci_channel_state_t;
132 enum pci_channel_state { pci_channel_io_normal = 1, pci_channel_io_frozen = 2, pci_channel_io_perm_failure = 3 } ;
157 typedef unsigned short pci_dev_flags_t;
184 typedef unsigned short pci_bus_flags_t;
241 struct pcie_link_state ;
242 struct pci_vpd ;
243 struct pci_sriov ;
245 struct pci_driver ;
245 union __anonunion____missing_field_name_357 { struct pci_sriov *sriov; struct pci_dev *physfn; } ;
245 struct pci_dev { struct list_head bus_list; struct pci_bus *bus; struct pci_bus *subordinate; void *sysdata; struct proc_dir_entry *procent; struct pci_slot *slot; unsigned int devfn; unsigned short vendor; unsigned short device; unsigned short subsystem_vendor; unsigned short subsystem_device; unsigned int class; u8 revision; u8 hdr_type; u8 pcie_cap; u8 msi_cap; u8 msix_cap; unsigned char pcie_mpss; u8 rom_base_reg; u8 pin; u16 pcie_flags_reg; unsigned long *dma_alias_mask; struct pci_driver *driver; u64 dma_mask; struct device_dma_parameters dma_parms; pci_power_t current_state; u8 pm_cap; unsigned char pme_support; unsigned char pme_interrupt; unsigned char pme_poll; unsigned char d1_support; unsigned char d2_support; unsigned char no_d1d2; unsigned char no_d3cold; unsigned char d3cold_allowed; unsigned char mmio_always_on; unsigned char wakeup_prepared; unsigned char runtime_d3cold; unsigned char ignore_hotplug; unsigned int d3_delay; unsigned int d3cold_delay; struct pcie_link_state *link_state; pci_channel_state_t error_state; struct device dev; int cfg_size; unsigned int irq; struct resource resource[17U]; bool match_driver; unsigned char transparent; unsigned char multifunction; unsigned char is_added; unsigned char is_busmaster; unsigned char no_msi; unsigned char no_64bit_msi; unsigned char block_cfg_access; unsigned char broken_parity_status; unsigned char irq_reroute_variant; unsigned char msi_enabled; unsigned char msix_enabled; unsigned char ari_enabled; unsigned char ats_enabled; unsigned char is_managed; unsigned char needs_freset; unsigned char state_saved; unsigned char is_physfn; unsigned char is_virtfn; unsigned char reset_fn; unsigned char is_hotplug_bridge; unsigned char __aer_firmware_first_valid; unsigned char __aer_firmware_first; unsigned char broken_intx_masking; unsigned char io_window_1k; unsigned char irq_managed; unsigned char has_secondary_link; unsigned char non_compliant_bars; pci_dev_flags_t dev_flags; atomic_t enable_cnt; u32 saved_config_space[16U]; struct hlist_head saved_cap_space; struct bin_attribute *rom_attr; int rom_attr_enabled; struct bin_attribute *res_attr[17U]; struct bin_attribute *res_attr_wc[17U]; const struct attribute_group **msi_irq_groups; struct pci_vpd *vpd; union __anonunion____missing_field_name_357 __annonCompField91; u16 ats_cap; u8 ats_stu; atomic_t ats_ref_cnt; phys_addr_t rom; size_t romlen; char *driver_override; } ;
446 struct pci_ops ;
446 struct msi_controller ;
446 struct pci_bus { struct list_head node; struct pci_bus *parent; struct list_head children; struct list_head devices; struct pci_dev *self; struct list_head slots; struct resource *resource[4U]; struct list_head resources; struct resource busn_res; struct pci_ops *ops; struct msi_controller *msi; void *sysdata; struct proc_dir_entry *procdir; unsigned char number; unsigned char primary; unsigned char max_bus_speed; unsigned char cur_bus_speed; char name[48U]; unsigned short bridge_ctl; pci_bus_flags_t bus_flags; struct device *bridge; struct device dev; struct bin_attribute *legacy_io; struct bin_attribute *legacy_mem; unsigned char is_added; } ;
570 struct pci_ops { int (*add_bus)(struct pci_bus *); void (*remove_bus)(struct pci_bus *); void * (*map_bus)(struct pci_bus *, unsigned int, int); int (*read)(struct pci_bus *, unsigned int, int, int, u32 *); int (*write)(struct pci_bus *, unsigned int, int, int, u32 ); } ;
600 struct pci_dynids { spinlock_t lock; struct list_head list; } ;
614 typedef unsigned int pci_ers_result_t;
624 struct pci_error_handlers { pci_ers_result_t (*error_detected)(struct pci_dev *, enum pci_channel_state ); pci_ers_result_t (*mmio_enabled)(struct pci_dev *); pci_ers_result_t (*link_reset)(struct pci_dev *); pci_ers_result_t (*slot_reset)(struct pci_dev *); void (*reset_notify)(struct pci_dev *, bool ); void (*resume)(struct pci_dev *); } ;
657 struct pci_driver { struct list_head node; const char *name; const struct pci_device_id *id_table; int (*probe)(struct pci_dev *, const struct pci_device_id *); void (*remove)(struct pci_dev *); int (*suspend)(struct pci_dev *, pm_message_t ); int (*suspend_late)(struct pci_dev *, pm_message_t ); int (*resume_early)(struct pci_dev *); int (*resume)(struct pci_dev *); void (*shutdown)(struct pci_dev *); int (*sriov_configure)(struct pci_dev *, int); const struct pci_error_handlers *err_handler; struct device_driver driver; struct pci_dynids dynids; } ;
273 struct vm_fault { unsigned int flags; gfp_t gfp_mask; unsigned long pgoff; void *virtual_address; struct page *cow_page; struct page *page; void *entry; unsigned long max_pgoff; pte_t *pte; } ;
317 struct vm_operations_struct { void (*open)(struct vm_area_struct *); void (*close)(struct vm_area_struct *); int (*mremap)(struct vm_area_struct *); int (*fault)(struct vm_area_struct *, struct vm_fault *); int (*pmd_fault)(struct vm_area_struct *, unsigned long, pmd_t *, unsigned int); void (*map_pages)(struct vm_area_struct *, struct vm_fault *); int (*page_mkwrite)(struct vm_area_struct *, struct vm_fault *); int (*pfn_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); } ;
2409 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; } ;
21 struct sg_table { struct scatterlist *sgl; unsigned int nents; unsigned int orig_nents; } ;
2040 struct dma_attrs { unsigned long flags[1U]; } ;
89 enum dma_data_direction { DMA_BIDIRECTIONAL = 0, DMA_TO_DEVICE = 1, DMA_FROM_DEVICE = 2, DMA_NONE = 3 } ;
158 struct dma_map_ops { void * (*alloc)(struct device *, size_t , dma_addr_t *, gfp_t , struct dma_attrs *); void (*free)(struct device *, size_t , void *, dma_addr_t , struct dma_attrs *); int (*mmap)(struct device *, struct vm_area_struct *, void *, dma_addr_t , size_t , struct dma_attrs *); int (*get_sgtable)(struct device *, struct sg_table *, void *, dma_addr_t , size_t , struct dma_attrs *); dma_addr_t (*map_page)(struct device *, struct page *, unsigned long, size_t , enum dma_data_direction , struct dma_attrs *); void (*unmap_page)(struct device *, dma_addr_t , size_t , enum dma_data_direction , struct dma_attrs *); int (*map_sg)(struct device *, struct scatterlist *, int, enum dma_data_direction , struct dma_attrs *); void (*unmap_sg)(struct device *, struct scatterlist *, int, enum dma_data_direction , struct dma_attrs *); void (*sync_single_for_cpu)(struct device *, dma_addr_t , size_t , enum dma_data_direction ); void (*sync_single_for_device)(struct device *, dma_addr_t , size_t , enum dma_data_direction ); void (*sync_sg_for_cpu)(struct device *, struct scatterlist *, int, enum dma_data_direction ); void (*sync_sg_for_device)(struct device *, struct scatterlist *, int, enum dma_data_direction ); int (*mapping_error)(struct device *, dma_addr_t ); int (*dma_supported)(struct device *, u64 ); int (*set_dma_mask)(struct device *, u64 ); int is_phys; } ;
105 struct bt878 { struct mutex gpio_lock; unsigned int nr; unsigned int bttv_nr; struct i2c_adapter *adapter; struct pci_dev *dev; unsigned int id; unsigned int TS_Size; unsigned char revision; unsigned int irq; unsigned long bt878_adr; volatile void *bt878_mem; volatile u32 finished_block; volatile u32 last_block; u32 block_count; u32 block_bytes; u32 line_bytes; u32 line_count; u32 buf_size; u8 *buf_cpu; dma_addr_t buf_dma; u32 risc_size; __le32 *risc_cpu; dma_addr_t risc_dma; u32 risc_pos; struct tasklet_struct tasklet; int shutdown; } ;
144 struct dst_config ;
144 struct dst_state { struct i2c_adapter *i2c; struct bt878 *bt; const struct dst_config *config; struct dvb_frontend frontend; u8 tx_tuna[10U]; u8 rx_tuna[10U]; u8 rxbuffer[10U]; u8 diseq_flags; u8 dst_type; u32 type_flags; u32 frequency; enum fe_spectral_inversion inversion; u32 symbol_rate; enum fe_code_rate fec; enum fe_sec_voltage voltage; enum fe_sec_tone_mode tone; u32 decode_freq; u8 decode_lock; u16 decode_strength; u16 decode_snr; unsigned long cur_jiff; u8 k22; u32 bandwidth; u32 dst_hw_cap; u8 dst_fw_version; enum fe_sec_mini_cmd minicmd; enum fe_modulation modulation; u8 messages[256U]; u8 mac_address[8U]; u8 fw_version[8U]; u8 card_info[8U]; u8 vendor[8U]; u8 board_info[8U]; u32 tuner_type; char *tuner_name; struct mutex dst_mutex; u8 fw_name[8U]; struct dvb_device *dst_ca; } ;
160 struct dst_config { u8 demod_address; } ;
1 unsigned long int __builtin_object_size(void *, int);
1 long int __builtin_expect(long, long);
33 extern struct module __this_module;
154 int printk(const char *, ...);
255 void __might_fault(const char *, int);
31 void * __memcpy(void *, const void *, size_t );
56 void * __memset(void *, int, size_t );
60 void * __memmove(void *, const void *, size_t );
138 void mutex_lock_nested(struct mutex *, unsigned int);
174 void mutex_unlock(struct mutex *);
597 bool ldv_try_module_get_5(struct module *ldv_func_arg1);
603 void ldv_module_put_6(struct module *ldv_func_arg1);
9 int ldv_try_module_get(struct module *module);
11 void ldv_module_put(struct module *module);
154 void kfree(const void *);
318 void * __kmalloc(size_t , gfp_t );
466 void * kmalloc(size_t size, gfp_t flags);
2791 loff_t noop_llseek(struct file *, loff_t , int);
5 void kasan_check_read(const void *, unsigned int);
6 void kasan_check_write(const void *, unsigned int);
676 unsigned long int _copy_from_user(void *, const void *, unsigned int);
678 unsigned long int _copy_to_user(void *, const void *, unsigned int);
698 void __copy_from_user_overflow();
703 void __copy_to_user_overflow();
719 unsigned long int copy_from_user(void *to, const void *from, unsigned long n);
756 unsigned long int copy_to_user(void *to, const void *from, unsigned long n);
207 int dvb_register_device(struct dvb_adapter *, struct dvb_device **, const struct dvb_device *, void *, int, int);
46 void msleep(unsigned int);
167 int rdc_reset_state(struct dst_state *);
169 int dst_wait_dst_ready(struct dst_state *, u8 );
170 int dst_pio_disable(struct dst_state *);
171 int dst_error_recovery(struct dst_state *);
172 int dst_error_bailout(struct dst_state *);
173 int dst_comm_init(struct dst_state *);
175 int write_dst(struct dst_state *, u8 *, u8 );
176 int read_dst(struct dst_state *, u8 *, u8 );
177 u8 dst_check_sum(u8 *, u32 );
179 struct dvb_device * dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter);
56 struct mutex dst_ca_mutex = { { 1 }, { { { { { 0 } }, 3735899821U, 4294967295U, (void *)-1, { 0, { 0, 0 }, "dst_ca_mutex.wait_lock", 0, 0UL } } } }, { &(dst_ca_mutex.wait_list), &(dst_ca_mutex.wait_list) }, 0, (void *)(&dst_ca_mutex), { 0, { 0, 0 }, "dst_ca_mutex", 0, 0UL } };
57 unsigned int verbose = 5U;
62 int ca_set_slot_descr();
69 int ca_set_pid();
75 void put_command_and_length(u8 *data, int command, int length);
83 void put_checksum(u8 *check_string, int length);
91 int dst_ci_command(struct dst_state *state, u8 *data, u8 *ca_string, u8 len, int read);
133 int dst_put_ci(struct dst_state *state, u8 *data, int len, u8 *ca_string, int read);
155 int ca_get_app_info(struct dst_state *state);
193 int ca_get_ca_info(struct dst_state *state);
237 int ca_get_slot_caps(struct dst_state *state, struct ca_caps *p_ca_caps, void *arg);
270 int ca_get_slot_descr(struct dst_state *state, struct ca_msg *p_ca_message, void *arg);
276 int ca_get_slot_info(struct dst_state *state, struct ca_slot_info *p_ca_slot_info, void *arg);
316 int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message, void *arg);
350 int handle_dst_tag(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer, u32 length);
378 int write_to_8820(struct dst_state *state, struct ca_msg *hw_buffer, u8 length, u8 reply);
391 u32 asn_1_decode(u8 *asn_1_array);
412 int debug_string(u8 *msg, u32 length, u32 offset);
425 int ca_set_pmt(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer, u8 reply, u8 query);
446 int dst_check_ca_pmt(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer);
477 int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, void *arg);
554 long int dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioctl_arg);
656 int dst_ca_open(struct inode *inode, struct file *file);
664 int dst_ca_release(struct inode *inode, struct file *file);
672 ssize_t dst_ca_read(struct file *file, char *buffer, size_t length, loff_t *offset);
679 ssize_t dst_ca_write(struct file *file, const char *buffer, size_t length, loff_t *offset);
686 const struct file_operations dst_ca_fops = { &__this_module, &noop_llseek, &dst_ca_read, &dst_ca_write, 0, 0, 0, 0, 0, &dst_ca_ioctl, 0, 0, &dst_ca_open, 0, &dst_ca_release, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
696 struct dvb_device dvbdev_ca = { { 0, 0 }, &dst_ca_fops, 0, 0, 0, 0U, 1, 1, 1, { { { { { { 0 } }, 0U, 0U, 0, { 0, { 0, 0 }, 0, 0, 0UL } } } }, { 0, 0 } }, 0, 0, 0, 0U, 0, 0, 0, 0, (void *)0 };
718 const char __kstrtab_dst_ca_attach[14U] = { 'd', 's', 't', '_', 'c', 'a', '_', 'a', 't', 't', 'a', 'c', 'h', '\x0' };
718 const struct kernel_symbol __ksymtab_dst_ca_attach;
718 const struct kernel_symbol __ksymtab_dst_ca_attach = { (unsigned long)(&dst_ca_attach), (const char *)(&__kstrtab_dst_ca_attach) };
740 void ldv_check_final_state();
743 void ldv_check_return_value(int);
749 void ldv_initialize();
752 void ldv_handler_precall();
755 int nondet_int();
758 int LDV_IN_INTERRUPT = 0;
761 void ldv_main0_sequence_infinite_withcheck_stateful();
10 void ldv_error();
25 int ldv_undef_int();
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);
7 int ldv_module_refcounter = 1;
10 void ldv_module_get(struct module *module);
57 void ldv_module_put_and_exit();
65 unsigned int ldv_module_refcount();
return ;
}
-entry_point
{
763 struct file *var_group1;
764 unsigned int var_dst_ca_ioctl_19_p1;
765 unsigned long var_dst_ca_ioctl_19_p2;
766 struct inode *var_group2;
767 int res_dst_ca_open_20;
768 char *var_dst_ca_read_22_p1;
769 unsigned long var_dst_ca_read_22_p2;
770 loff_t *var_dst_ca_read_22_p3;
771 long res_dst_ca_read_22;
772 const char *var_dst_ca_write_23_p1;
773 unsigned long var_dst_ca_write_23_p2;
774 loff_t *var_dst_ca_write_23_p3;
775 long res_dst_ca_write_23;
776 int ldv_s_dst_ca_fops_file_operations;
777 int tmp;
778 int tmp___0;
921 ldv_s_dst_ca_fops_file_operations = 0;
911 LDV_IN_INTERRUPT = 1;
920 ldv_initialize() { /* Function call is skipped due to function is undefined */}
925 goto ldv_39130;
925 tmp___0 = nondet_int() { /* Function call is skipped due to function is undefined */}
925 assume(tmp___0 != 0);
928 goto ldv_39129;
926 ldv_39129:;
929 tmp = nondet_int() { /* Function call is skipped due to function is undefined */}
929 switch (tmp);
930 assume(tmp == 0);
934 assume(ldv_s_dst_ca_fops_file_operations == 0);
959 ldv_handler_precall() { /* Function call is skipped due to function is undefined */}
960 -dst_ca_open(var_group2, var_group1)
{
658 assume(verbose != 0U);
658 assume(verbose > 3U);
658 printk("\v%s: Device opened [%p] \n", "dst_ca_open", file) { /* Function call is skipped due to function is undefined */}
659 -ldv_try_module_get_5(&__this_module)
{
41 int tmp;
42 -ldv_try_module_get(ldv_func_arg1)
{
22 int module_get_succeeded;
25 assume(((unsigned long)module) != ((unsigned long)((struct module *)0)));
28 module_get_succeeded = ldv_undef_int() { /* Function call is skipped due to function is undefined */}
30 assume(!(module_get_succeeded == 1));
39 return 0;;
}
42 return tmp != 0;;
}
661 return 0;;
}
961 ldv_check_return_value(res_dst_ca_open_20) { /* Function call is skipped due to function is undefined */}
962 assume(!(res_dst_ca_open_20 != 0));
964 ldv_s_dst_ca_fops_file_operations = ldv_s_dst_ca_fops_file_operations + 1;
970 goto ldv_39123;
1127 ldv_39123:;
1128 ldv_39130:;
925 tmp___0 = nondet_int() { /* Function call is skipped due to function is undefined */}
925 assume(tmp___0 != 0);
928 goto ldv_39129;
926 ldv_39129:;
929 tmp = nondet_int() { /* Function call is skipped due to function is undefined */}
929 switch (tmp);
930 assume(!(tmp == 0));
971 assume(tmp == 1);
974 assume(ldv_s_dst_ca_fops_file_operations == 1);
999 ldv_handler_precall() { /* Function call is skipped due to function is undefined */}
1000 -dst_ca_read(var_group1, var_dst_ca_read_22_p1, var_dst_ca_read_22_p2, var_dst_ca_read_22_p3)
{
674 assume(verbose != 0U);
674 assume(verbose > 3U);
674 printk("\v%s: Device read.\n", "dst_ca_read") { /* Function call is skipped due to function is undefined */}
676 return 0L;;
}
1001 ldv_check_return_value((int)res_dst_ca_read_22) { /* Function call is skipped due to function is undefined */}
1002 assume(!(res_dst_ca_read_22 < 0L));
1004 ldv_s_dst_ca_fops_file_operations = ldv_s_dst_ca_fops_file_operations + 1;
1010 goto ldv_39123;
1127 ldv_39123:;
1128 ldv_39130:;
925 tmp___0 = nondet_int() { /* Function call is skipped due to function is undefined */}
925 assume(tmp___0 != 0);
928 goto ldv_39129;
926 ldv_39129:;
929 tmp = nondet_int() { /* Function call is skipped due to function is undefined */}
929 switch (tmp);
930 assume(!(tmp == 0));
971 assume(!(tmp == 1));
1011 assume(tmp == 2);
1014 assume(ldv_s_dst_ca_fops_file_operations == 2);
1039 ldv_handler_precall() { /* Function call is skipped due to function is undefined */}
1040 -dst_ca_write(var_group1, var_dst_ca_write_23_p1, var_dst_ca_write_23_p2, var_dst_ca_write_23_p3)
{
681 assume(verbose != 0U);
681 assume(verbose > 3U);
681 printk("\v%s: Device write.\n", "dst_ca_write") { /* Function call is skipped due to function is undefined */}
683 return 0L;;
}
1041 ldv_check_return_value((int)res_dst_ca_write_23) { /* Function call is skipped due to function is undefined */}
1042 assume(!(res_dst_ca_write_23 < 0L));
1044 ldv_s_dst_ca_fops_file_operations = ldv_s_dst_ca_fops_file_operations + 1;
1050 goto ldv_39123;
1127 ldv_39123:;
1128 ldv_39130:;
925 tmp___0 = nondet_int() { /* Function call is skipped due to function is undefined */}
925 assume(!(tmp___0 != 0));
925 assume(ldv_s_dst_ca_fops_file_operations != 0);
928 goto ldv_39129;
926 ldv_39129:;
929 tmp = nondet_int() { /* Function call is skipped due to function is undefined */}
929 switch (tmp);
930 assume(!(tmp == 0));
971 assume(!(tmp == 1));
1011 assume(!(tmp == 2));
1051 assume(tmp == 3);
1054 assume(ldv_s_dst_ca_fops_file_operations == 3);
1079 ldv_handler_precall() { /* Function call is skipped due to function is undefined */}
1080 -dst_ca_release(var_group2, var_group1)
{
666 assume(verbose != 0U);
666 assume(verbose > 3U);
666 printk("\v%s: Device closed.\n", "dst_ca_release") { /* Function call is skipped due to function is undefined */}
667 -ldv_module_put_6(&__this_module)
{
48 -ldv_module_put(ldv_func_arg1)
{
48 assume(((unsigned long)module) != ((unsigned long)((struct module *)0)));
50 assume(ldv_module_refcounter <= 1);
50 -ldv_error()
{
15 LDV_ERROR:;
}
}
}
}
}
Source code
1 2 /* 3 CA-driver for TwinHan DST Frontend/Card 4 5 Copyright (C) 2004, 2005 Manu Abraham (manu@kromtek.com) 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 2 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; if not, write to the Free Software 19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 */ 21 22 #include <linux/kernel.h> 23 #include <linux/module.h> 24 #include <linux/slab.h> 25 #include <linux/init.h> 26 #include <linux/mutex.h> 27 #include <linux/string.h> 28 #include <linux/dvb/ca.h> 29 #include "dvbdev.h" 30 #include "dvb_frontend.h" 31 #include "dst_ca.h" 32 #include "dst_common.h" 33 34 #define DST_CA_ERROR 0 35 #define DST_CA_NOTICE 1 36 #define DST_CA_INFO 2 37 #define DST_CA_DEBUG 3 38 39 #define dprintk(x, y, z, format, arg...) do { \ 40 if (z) { \ 41 if ((x > DST_CA_ERROR) && (x > y)) \ 42 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 43 else if ((x > DST_CA_NOTICE) && (x > y)) \ 44 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 45 else if ((x > DST_CA_INFO) && (x > y)) \ 46 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 47 else if ((x > DST_CA_DEBUG) && (x > y)) \ 48 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 49 } else { \ 50 if (x > y) \ 51 printk(format, ## arg); \ 52 } \ 53 } while(0) 54 55 56 static DEFINE_MUTEX(dst_ca_mutex); 57 static unsigned int verbose = 5; 58 module_param(verbose, int, 0644); 59 MODULE_PARM_DESC(verbose, "verbose startup messages, default is 1 (yes)"); 60 61 /* Need some more work */ 62 static int ca_set_slot_descr(void) 63 { 64 /* We could make this more graceful ? */ 65 return -EOPNOTSUPP; 66 } 67 68 /* Need some more work */ 69 static int ca_set_pid(void) 70 { 71 /* We could make this more graceful ? */ 72 return -EOPNOTSUPP; 73 } 74 75 static void put_command_and_length(u8 *data, int command, int length) 76 { 77 data[0] = (command >> 16) & 0xff; 78 data[1] = (command >> 8) & 0xff; 79 data[2] = command & 0xff; 80 data[3] = length; 81 } 82 83 static void put_checksum(u8 *check_string, int length) 84 { 85 dprintk(verbose, DST_CA_DEBUG, 1, " Computing string checksum."); 86 dprintk(verbose, DST_CA_DEBUG, 1, " -> string length : 0x%02x", length); 87 check_string[length] = dst_check_sum (check_string, length); 88 dprintk(verbose, DST_CA_DEBUG, 1, " -> checksum : 0x%02x", check_string[length]); 89 } 90 91 static int dst_ci_command(struct dst_state* state, u8 * data, u8 *ca_string, u8 len, int read) 92 { 93 u8 reply; 94 95 mutex_lock(&state->dst_mutex); 96 dst_comm_init(state); 97 msleep(65); 98 99 if (write_dst(state, data, len)) { 100 dprintk(verbose, DST_CA_INFO, 1, " Write not successful, trying to recover"); 101 dst_error_recovery(state); 102 goto error; 103 } 104 if ((dst_pio_disable(state)) < 0) { 105 dprintk(verbose, DST_CA_ERROR, 1, " DST PIO disable failed."); 106 goto error; 107 } 108 if (read_dst(state, &reply, GET_ACK) < 0) { 109 dprintk(verbose, DST_CA_INFO, 1, " Read not successful, trying to recover"); 110 dst_error_recovery(state); 111 goto error; 112 } 113 if (read) { 114 if (! dst_wait_dst_ready(state, LONG_DELAY)) { 115 dprintk(verbose, DST_CA_NOTICE, 1, " 8820 not ready"); 116 goto error; 117 } 118 if (read_dst(state, ca_string, 128) < 0) { /* Try to make this dynamic */ 119 dprintk(verbose, DST_CA_INFO, 1, " Read not successful, trying to recover"); 120 dst_error_recovery(state); 121 goto error; 122 } 123 } 124 mutex_unlock(&state->dst_mutex); 125 return 0; 126 127 error: 128 mutex_unlock(&state->dst_mutex); 129 return -EIO; 130 } 131 132 133 static int dst_put_ci(struct dst_state *state, u8 *data, int len, u8 *ca_string, int read) 134 { 135 u8 dst_ca_comm_err = 0; 136 137 while (dst_ca_comm_err < RETRIES) { 138 dprintk(verbose, DST_CA_NOTICE, 1, " Put Command"); 139 if (dst_ci_command(state, data, ca_string, len, read)) { // If error 140 dst_error_recovery(state); 141 dst_ca_comm_err++; // work required here. 142 } else { 143 break; 144 } 145 } 146 147 if(dst_ca_comm_err == RETRIES) 148 return -1; 149 150 return 0; 151 } 152 153 154 155 static int ca_get_app_info(struct dst_state *state) 156 { 157 int length, str_length; 158 static u8 command[8] = {0x07, 0x40, 0x01, 0x00, 0x01, 0x00, 0x00, 0xff}; 159 160 put_checksum(&command[0], command[0]); 161 if ((dst_put_ci(state, command, sizeof(command), state->messages, GET_REPLY)) < 0) { 162 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); 163 return -1; 164 } 165 dprintk(verbose, DST_CA_INFO, 1, " -->dst_put_ci SUCCESS !"); 166 dprintk(verbose, DST_CA_INFO, 1, " ================================ CI Module Application Info ======================================"); 167 dprintk(verbose, DST_CA_INFO, 1, " Application Type=[%d], Application Vendor=[%d], Vendor Code=[%d]\n%s: Application info=[%s]", 168 state->messages[7], (state->messages[8] << 8) | state->messages[9], 169 (state->messages[10] << 8) | state->messages[11], __func__, (char *)(&state->messages[12])); 170 dprintk(verbose, DST_CA_INFO, 1, " =================================================================================================="); 171 172 // Transform dst message to correct application_info message 173 length = state->messages[5]; 174 str_length = length - 6; 175 if (str_length < 0) { 176 str_length = 0; 177 dprintk(verbose, DST_CA_ERROR, 1, "Invalid string length returned in ca_get_app_info(). Recovering."); 178 } 179 180 // First, the command and length fields 181 put_command_and_length(&state->messages[0], CA_APP_INFO, length); 182 183 // Copy application_type, application_manufacturer and manufacturer_code 184 memmove(&state->messages[4], &state->messages[7], 5); 185 186 // Set string length and copy string 187 state->messages[9] = str_length; 188 memmove(&state->messages[10], &state->messages[12], str_length); 189 190 return 0; 191 } 192 193 static int ca_get_ca_info(struct dst_state *state) 194 { 195 int srcPtr, dstPtr, i, num_ids; 196 static u8 slot_command[8] = {0x07, 0x40, 0x00, 0x00, 0x02, 0x00, 0x00, 0xff}; 197 const int in_system_id_pos = 8, out_system_id_pos = 4, in_num_ids_pos = 7; 198 199 put_checksum(&slot_command[0], slot_command[0]); 200 if ((dst_put_ci(state, slot_command, sizeof (slot_command), state->messages, GET_REPLY)) < 0) { 201 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); 202 return -1; 203 } 204 dprintk(verbose, DST_CA_INFO, 1, " -->dst_put_ci SUCCESS !"); 205 206 // Print raw data 207 dprintk(verbose, DST_CA_INFO, 0, " DST data = ["); 208 for (i = 0; i < state->messages[0] + 1; i++) { 209 dprintk(verbose, DST_CA_INFO, 0, " 0x%02x", state->messages[i]); 210 } 211 dprintk(verbose, DST_CA_INFO, 0, "]\n"); 212 213 // Set the command and length of the output 214 num_ids = state->messages[in_num_ids_pos]; 215 if (num_ids >= 100) { 216 num_ids = 100; 217 dprintk(verbose, DST_CA_ERROR, 1, "Invalid number of ids (>100). Recovering."); 218 } 219 put_command_and_length(&state->messages[0], CA_INFO, num_ids * 2); 220 221 dprintk(verbose, DST_CA_INFO, 0, " CA_INFO = ["); 222 srcPtr = in_system_id_pos; 223 dstPtr = out_system_id_pos; 224 for(i = 0; i < num_ids; i++) { 225 dprintk(verbose, DST_CA_INFO, 0, " 0x%02x%02x", state->messages[srcPtr + 0], state->messages[srcPtr + 1]); 226 // Append to output 227 state->messages[dstPtr + 0] = state->messages[srcPtr + 0]; 228 state->messages[dstPtr + 1] = state->messages[srcPtr + 1]; 229 srcPtr += 2; 230 dstPtr += 2; 231 } 232 dprintk(verbose, DST_CA_INFO, 0, "]\n"); 233 234 return 0; 235 } 236 237 static int ca_get_slot_caps(struct dst_state *state, struct ca_caps *p_ca_caps, void __user *arg) 238 { 239 int i; 240 u8 slot_cap[256]; 241 static u8 slot_command[8] = {0x07, 0x40, 0x02, 0x00, 0x02, 0x00, 0x00, 0xff}; 242 243 put_checksum(&slot_command[0], slot_command[0]); 244 if ((dst_put_ci(state, slot_command, sizeof (slot_command), slot_cap, GET_REPLY)) < 0) { 245 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); 246 return -1; 247 } 248 dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !"); 249 250 /* Will implement the rest soon */ 251 252 dprintk(verbose, DST_CA_INFO, 1, " Slot cap = [%d]", slot_cap[7]); 253 dprintk(verbose, DST_CA_INFO, 0, "===================================\n"); 254 for (i = 0; i < slot_cap[0] + 1; i++) 255 dprintk(verbose, DST_CA_INFO, 0, " %d", slot_cap[i]); 256 dprintk(verbose, DST_CA_INFO, 0, "\n"); 257 258 p_ca_caps->slot_num = 1; 259 p_ca_caps->slot_type = 1; 260 p_ca_caps->descr_num = slot_cap[7]; 261 p_ca_caps->descr_type = 1; 262 263 if (copy_to_user(arg, p_ca_caps, sizeof (struct ca_caps))) 264 return -EFAULT; 265 266 return 0; 267 } 268 269 /* Need some more work */ 270 static int ca_get_slot_descr(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg) 271 { 272 return -EOPNOTSUPP; 273 } 274 275 276 static int ca_get_slot_info(struct dst_state *state, struct ca_slot_info *p_ca_slot_info, void __user *arg) 277 { 278 int i; 279 static u8 slot_command[8] = {0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff}; 280 281 u8 *slot_info = state->messages; 282 283 put_checksum(&slot_command[0], 7); 284 if ((dst_put_ci(state, slot_command, sizeof (slot_command), slot_info, GET_REPLY)) < 0) { 285 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); 286 return -1; 287 } 288 dprintk(verbose, DST_CA_INFO, 1, " -->dst_put_ci SUCCESS !"); 289 290 /* Will implement the rest soon */ 291 292 dprintk(verbose, DST_CA_INFO, 1, " Slot info = [%d]", slot_info[3]); 293 dprintk(verbose, DST_CA_INFO, 0, "===================================\n"); 294 for (i = 0; i < 8; i++) 295 dprintk(verbose, DST_CA_INFO, 0, " %d", slot_info[i]); 296 dprintk(verbose, DST_CA_INFO, 0, "\n"); 297 298 if (slot_info[4] & 0x80) { 299 p_ca_slot_info->flags = CA_CI_MODULE_PRESENT; 300 p_ca_slot_info->num = 1; 301 p_ca_slot_info->type = CA_CI; 302 } else if (slot_info[4] & 0x40) { 303 p_ca_slot_info->flags = CA_CI_MODULE_READY; 304 p_ca_slot_info->num = 1; 305 p_ca_slot_info->type = CA_CI; 306 } else 307 p_ca_slot_info->flags = 0; 308 309 if (copy_to_user(arg, p_ca_slot_info, sizeof (struct ca_slot_info))) 310 return -EFAULT; 311 312 return 0; 313 } 314 315 316 static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg) 317 { 318 u8 i = 0; 319 u32 command = 0; 320 321 if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg))) 322 return -EFAULT; 323 324 dprintk(verbose, DST_CA_NOTICE, 1, " Message = [%*ph]", 325 3, p_ca_message->msg); 326 327 for (i = 0; i < 3; i++) { 328 command = command | p_ca_message->msg[i]; 329 if (i < 2) 330 command = command << 8; 331 } 332 dprintk(verbose, DST_CA_NOTICE, 1, " Command=[0x%x]", command); 333 334 switch (command) { 335 case CA_APP_INFO: 336 memcpy(p_ca_message->msg, state->messages, 128); 337 if (copy_to_user(arg, p_ca_message, sizeof (struct ca_msg)) ) 338 return -EFAULT; 339 break; 340 case CA_INFO: 341 memcpy(p_ca_message->msg, state->messages, 128); 342 if (copy_to_user(arg, p_ca_message, sizeof (struct ca_msg)) ) 343 return -EFAULT; 344 break; 345 } 346 347 return 0; 348 } 349 350 static int handle_dst_tag(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer, u32 length) 351 { 352 if (state->dst_hw_cap & DST_TYPE_HAS_SESSION) { 353 hw_buffer->msg[2] = p_ca_message->msg[1]; /* MSB */ 354 hw_buffer->msg[3] = p_ca_message->msg[2]; /* LSB */ 355 } else { 356 if (length > 247) { 357 dprintk(verbose, DST_CA_ERROR, 1, " Message too long ! *** Bailing Out *** !"); 358 return -1; 359 } 360 hw_buffer->msg[0] = (length & 0xff) + 7; 361 hw_buffer->msg[1] = 0x40; 362 hw_buffer->msg[2] = 0x03; 363 hw_buffer->msg[3] = 0x00; 364 hw_buffer->msg[4] = 0x03; 365 hw_buffer->msg[5] = length & 0xff; 366 hw_buffer->msg[6] = 0x00; 367 368 /* 369 * Need to compute length for EN50221 section 8.3.2, for the time being 370 * assuming 8.3.2 is not applicable 371 */ 372 memcpy(&hw_buffer->msg[7], &p_ca_message->msg[4], length); 373 } 374 375 return 0; 376 } 377 378 static int write_to_8820(struct dst_state *state, struct ca_msg *hw_buffer, u8 length, u8 reply) 379 { 380 if ((dst_put_ci(state, hw_buffer->msg, length, hw_buffer->msg, reply)) < 0) { 381 dprintk(verbose, DST_CA_ERROR, 1, " DST-CI Command failed."); 382 dprintk(verbose, DST_CA_NOTICE, 1, " Resetting DST."); 383 rdc_reset_state(state); 384 return -1; 385 } 386 dprintk(verbose, DST_CA_NOTICE, 1, " DST-CI Command success."); 387 388 return 0; 389 } 390 391 static u32 asn_1_decode(u8 *asn_1_array) 392 { 393 u8 length_field = 0, word_count = 0, count = 0; 394 u32 length = 0; 395 396 length_field = asn_1_array[0]; 397 dprintk(verbose, DST_CA_DEBUG, 1, " Length field=[%02x]", length_field); 398 if (length_field < 0x80) { 399 length = length_field & 0x7f; 400 dprintk(verbose, DST_CA_DEBUG, 1, " Length=[%02x]\n", length); 401 } else { 402 word_count = length_field & 0x7f; 403 for (count = 0; count < word_count; count++) { 404 length = length << 8; 405 length += asn_1_array[count + 1]; 406 dprintk(verbose, DST_CA_DEBUG, 1, " Length=[%04x]", length); 407 } 408 } 409 return length; 410 } 411 412 static int debug_string(u8 *msg, u32 length, u32 offset) 413 { 414 u32 i; 415 416 dprintk(verbose, DST_CA_DEBUG, 0, " String=[ "); 417 for (i = offset; i < length; i++) 418 dprintk(verbose, DST_CA_DEBUG, 0, "%02x ", msg[i]); 419 dprintk(verbose, DST_CA_DEBUG, 0, "]\n"); 420 421 return 0; 422 } 423 424 425 static int ca_set_pmt(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer, u8 reply, u8 query) 426 { 427 u32 length = 0; 428 u8 tag_length = 8; 429 430 length = asn_1_decode(&p_ca_message->msg[3]); 431 dprintk(verbose, DST_CA_DEBUG, 1, " CA Message length=[%d]", length); 432 debug_string(&p_ca_message->msg[4], length, 0); /* length is excluding tag & length */ 433 434 memset(hw_buffer->msg, '\0', length); 435 handle_dst_tag(state, p_ca_message, hw_buffer, length); 436 put_checksum(hw_buffer->msg, hw_buffer->msg[0]); 437 438 debug_string(hw_buffer->msg, (length + tag_length), 0); /* tags too */ 439 write_to_8820(state, hw_buffer, (length + tag_length), reply); 440 441 return 0; 442 } 443 444 445 /* Board supports CA PMT reply ? */ 446 static int dst_check_ca_pmt(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer) 447 { 448 int ca_pmt_reply_test = 0; 449 450 /* Do test board */ 451 /* Not there yet but soon */ 452 453 /* CA PMT Reply capable */ 454 if (ca_pmt_reply_test) { 455 if ((ca_set_pmt(state, p_ca_message, hw_buffer, 1, GET_REPLY)) < 0) { 456 dprintk(verbose, DST_CA_ERROR, 1, " ca_set_pmt.. failed !"); 457 return -1; 458 } 459 460 /* Process CA PMT Reply */ 461 /* will implement soon */ 462 dprintk(verbose, DST_CA_ERROR, 1, " Not there yet"); 463 } 464 /* CA PMT Reply not capable */ 465 if (!ca_pmt_reply_test) { 466 if ((ca_set_pmt(state, p_ca_message, hw_buffer, 0, NO_REPLY)) < 0) { 467 dprintk(verbose, DST_CA_ERROR, 1, " ca_set_pmt.. failed !"); 468 return -1; 469 } 470 dprintk(verbose, DST_CA_NOTICE, 1, " ca_set_pmt.. success !"); 471 /* put a dummy message */ 472 473 } 474 return 0; 475 } 476 477 static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg) 478 { 479 int i = 0; 480 481 u32 command = 0; 482 struct ca_msg *hw_buffer; 483 int result = 0; 484 485 if ((hw_buffer = kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) { 486 dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); 487 return -ENOMEM; 488 } 489 dprintk(verbose, DST_CA_DEBUG, 1, " "); 490 491 if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg))) { 492 result = -EFAULT; 493 goto free_mem_and_exit; 494 } 495 496 /* EN50221 tag */ 497 command = 0; 498 499 for (i = 0; i < 3; i++) { 500 command = command | p_ca_message->msg[i]; 501 if (i < 2) 502 command = command << 8; 503 } 504 dprintk(verbose, DST_CA_DEBUG, 1, " Command=[0x%x]\n", command); 505 506 switch (command) { 507 case CA_PMT: 508 dprintk(verbose, DST_CA_DEBUG, 1, "Command = SEND_CA_PMT"); 509 if ((ca_set_pmt(state, p_ca_message, hw_buffer, 0, 0)) < 0) { // code simplification started 510 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_PMT Failed !"); 511 result = -1; 512 goto free_mem_and_exit; 513 } 514 dprintk(verbose, DST_CA_INFO, 1, " -->CA_PMT Success !"); 515 break; 516 case CA_PMT_REPLY: 517 dprintk(verbose, DST_CA_INFO, 1, "Command = CA_PMT_REPLY"); 518 /* Have to handle the 2 basic types of cards here */ 519 if ((dst_check_ca_pmt(state, p_ca_message, hw_buffer)) < 0) { 520 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_PMT_REPLY Failed !"); 521 result = -1; 522 goto free_mem_and_exit; 523 } 524 dprintk(verbose, DST_CA_INFO, 1, " -->CA_PMT_REPLY Success !"); 525 break; 526 case CA_APP_INFO_ENQUIRY: // only for debugging 527 dprintk(verbose, DST_CA_INFO, 1, " Getting Cam Application information"); 528 529 if ((ca_get_app_info(state)) < 0) { 530 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_APP_INFO_ENQUIRY Failed !"); 531 result = -1; 532 goto free_mem_and_exit; 533 } 534 dprintk(verbose, DST_CA_INFO, 1, " -->CA_APP_INFO_ENQUIRY Success !"); 535 break; 536 case CA_INFO_ENQUIRY: 537 dprintk(verbose, DST_CA_INFO, 1, " Getting CA Information"); 538 539 if ((ca_get_ca_info(state)) < 0) { 540 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_INFO_ENQUIRY Failed !"); 541 result = -1; 542 goto free_mem_and_exit; 543 } 544 dprintk(verbose, DST_CA_INFO, 1, " -->CA_INFO_ENQUIRY Success !"); 545 break; 546 } 547 548 free_mem_and_exit: 549 kfree (hw_buffer); 550 551 return result; 552 } 553 554 static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioctl_arg) 555 { 556 struct dvb_device *dvbdev; 557 struct dst_state *state; 558 struct ca_slot_info *p_ca_slot_info; 559 struct ca_caps *p_ca_caps; 560 struct ca_msg *p_ca_message; 561 void __user *arg = (void __user *)ioctl_arg; 562 int result = 0; 563 564 mutex_lock(&dst_ca_mutex); 565 dvbdev = file->private_data; 566 state = (struct dst_state *)dvbdev->priv; 567 p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL); 568 p_ca_slot_info = kmalloc(sizeof (struct ca_slot_info), GFP_KERNEL); 569 p_ca_caps = kmalloc(sizeof (struct ca_caps), GFP_KERNEL); 570 if (!p_ca_message || !p_ca_slot_info || !p_ca_caps) { 571 dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); 572 result = -ENOMEM; 573 goto free_mem_and_exit; 574 } 575 576 /* We have now only the standard ioctl's, the driver is upposed to handle internals. */ 577 switch (cmd) { 578 case CA_SEND_MSG: 579 dprintk(verbose, DST_CA_INFO, 1, " Sending message"); 580 if ((ca_send_message(state, p_ca_message, arg)) < 0) { 581 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_SEND_MSG Failed !"); 582 result = -1; 583 goto free_mem_and_exit; 584 } 585 break; 586 case CA_GET_MSG: 587 dprintk(verbose, DST_CA_INFO, 1, " Getting message"); 588 if ((ca_get_message(state, p_ca_message, arg)) < 0) { 589 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_MSG Failed !"); 590 result = -1; 591 goto free_mem_and_exit; 592 } 593 dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_MSG Success !"); 594 break; 595 case CA_RESET: 596 dprintk(verbose, DST_CA_ERROR, 1, " Resetting DST"); 597 dst_error_bailout(state); 598 msleep(4000); 599 break; 600 case CA_GET_SLOT_INFO: 601 dprintk(verbose, DST_CA_INFO, 1, " Getting Slot info"); 602 if ((ca_get_slot_info(state, p_ca_slot_info, arg)) < 0) { 603 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_SLOT_INFO Failed !"); 604 result = -1; 605 goto free_mem_and_exit; 606 } 607 dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_SLOT_INFO Success !"); 608 break; 609 case CA_GET_CAP: 610 dprintk(verbose, DST_CA_INFO, 1, " Getting Slot capabilities"); 611 if ((ca_get_slot_caps(state, p_ca_caps, arg)) < 0) { 612 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_CAP Failed !"); 613 result = -1; 614 goto free_mem_and_exit; 615 } 616 dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_CAP Success !"); 617 break; 618 case CA_GET_DESCR_INFO: 619 dprintk(verbose, DST_CA_INFO, 1, " Getting descrambler description"); 620 if ((ca_get_slot_descr(state, p_ca_message, arg)) < 0) { 621 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_DESCR_INFO Failed !"); 622 result = -1; 623 goto free_mem_and_exit; 624 } 625 dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_DESCR_INFO Success !"); 626 break; 627 case CA_SET_DESCR: 628 dprintk(verbose, DST_CA_INFO, 1, " Setting descrambler"); 629 if ((ca_set_slot_descr()) < 0) { 630 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_SET_DESCR Failed !"); 631 result = -1; 632 goto free_mem_and_exit; 633 } 634 dprintk(verbose, DST_CA_INFO, 1, " -->CA_SET_DESCR Success !"); 635 break; 636 case CA_SET_PID: 637 dprintk(verbose, DST_CA_INFO, 1, " Setting PID"); 638 if ((ca_set_pid()) < 0) { 639 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_SET_PID Failed !"); 640 result = -1; 641 goto free_mem_and_exit; 642 } 643 dprintk(verbose, DST_CA_INFO, 1, " -->CA_SET_PID Success !"); 644 default: 645 result = -EOPNOTSUPP; 646 } 647 free_mem_and_exit: 648 kfree (p_ca_message); 649 kfree (p_ca_slot_info); 650 kfree (p_ca_caps); 651 652 mutex_unlock(&dst_ca_mutex); 653 return result; 654 } 655 656 static int dst_ca_open(struct inode *inode, struct file *file) 657 { 658 dprintk(verbose, DST_CA_DEBUG, 1, " Device opened [%p] ", file); 659 try_module_get(THIS_MODULE); 660 661 return 0; 662 } 663 664 static int dst_ca_release(struct inode *inode, struct file *file) 665 { 666 dprintk(verbose, DST_CA_DEBUG, 1, " Device closed."); 667 module_put(THIS_MODULE); 668 669 return 0; 670 } 671 672 static ssize_t dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset) 673 { 674 dprintk(verbose, DST_CA_DEBUG, 1, " Device read."); 675 676 return 0; 677 } 678 679 static ssize_t dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset) 680 { 681 dprintk(verbose, DST_CA_DEBUG, 1, " Device write."); 682 683 return 0; 684 } 685 686 static const struct file_operations dst_ca_fops = { 687 .owner = THIS_MODULE, 688 .unlocked_ioctl = dst_ca_ioctl, 689 .open = dst_ca_open, 690 .release = dst_ca_release, 691 .read = dst_ca_read, 692 .write = dst_ca_write, 693 .llseek = noop_llseek, 694 }; 695 696 static struct dvb_device dvbdev_ca = { 697 .priv = NULL, 698 .users = 1, 699 .readers = 1, 700 .writers = 1, 701 .fops = &dst_ca_fops 702 }; 703 704 struct dvb_device *dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter) 705 { 706 struct dvb_device *dvbdev; 707 708 dprintk(verbose, DST_CA_ERROR, 1, "registering DST-CA device"); 709 if (dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst, 710 DVB_DEVICE_CA, 0) == 0) { 711 dst->dst_ca = dvbdev; 712 return dst->dst_ca; 713 } 714 715 return NULL; 716 } 717 718 EXPORT_SYMBOL(dst_ca_attach); 719 720 MODULE_DESCRIPTION("DST DVB-S/T/C Combo CA driver"); 721 MODULE_AUTHOR("Manu Abraham"); 722 MODULE_LICENSE("GPL"); 723 724 725 726 727 728 /* LDV_COMMENT_BEGIN_MAIN */ 729 #ifdef LDV_MAIN0_sequence_infinite_withcheck_stateful 730 731 /*###########################################################################*/ 732 733 /*############## Driver Environment Generator 0.2 output ####################*/ 734 735 /*###########################################################################*/ 736 737 738 739 /* 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. */ 740 void ldv_check_final_state(void); 741 742 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result. */ 743 void ldv_check_return_value(int res); 744 745 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result of probe() function. */ 746 void ldv_check_return_value_probe(int res); 747 748 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Initializes the model. */ 749 void ldv_initialize(void); 750 751 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Reinitializes the model between distinct model function calls. */ 752 void ldv_handler_precall(void); 753 754 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Returns arbitrary interger value. */ 755 int nondet_int(void); 756 757 /* LDV_COMMENT_VAR_DECLARE_LDV Special variable for LDV verifier. */ 758 int LDV_IN_INTERRUPT; 759 760 /* LDV_COMMENT_FUNCTION_MAIN Main function for LDV verifier. */ 761 void ldv_main0_sequence_infinite_withcheck_stateful(void) { 762 763 764 765 /* LDV_COMMENT_BEGIN_VARIABLE_DECLARATION_PART */ 766 /*============================= VARIABLE DECLARATION PART =============================*/ 767 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 768 /* content: static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioctl_arg)*/ 769 /* LDV_COMMENT_BEGIN_PREP */ 770 #define DST_CA_ERROR 0 771 #define DST_CA_NOTICE 1 772 #define DST_CA_INFO 2 773 #define DST_CA_DEBUG 3 774 #define dprintk(x, y, z, format, arg...) do { \ 775 if (z) { \ 776 if ((x > DST_CA_ERROR) && (x > y)) \ 777 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 778 else if ((x > DST_CA_NOTICE) && (x > y)) \ 779 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 780 else if ((x > DST_CA_INFO) && (x > y)) \ 781 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 782 else if ((x > DST_CA_DEBUG) && (x > y)) \ 783 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 784 } else { \ 785 if (x > y) \ 786 printk(format, ## arg); \ 787 } \ 788 } while(0) 789 /* LDV_COMMENT_END_PREP */ 790 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_ioctl" */ 791 struct file * var_group1; 792 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_ioctl" */ 793 unsigned int var_dst_ca_ioctl_19_p1; 794 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_ioctl" */ 795 unsigned long var_dst_ca_ioctl_19_p2; 796 /* content: static int dst_ca_open(struct inode *inode, struct file *file)*/ 797 /* LDV_COMMENT_BEGIN_PREP */ 798 #define DST_CA_ERROR 0 799 #define DST_CA_NOTICE 1 800 #define DST_CA_INFO 2 801 #define DST_CA_DEBUG 3 802 #define dprintk(x, y, z, format, arg...) do { \ 803 if (z) { \ 804 if ((x > DST_CA_ERROR) && (x > y)) \ 805 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 806 else if ((x > DST_CA_NOTICE) && (x > y)) \ 807 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 808 else if ((x > DST_CA_INFO) && (x > y)) \ 809 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 810 else if ((x > DST_CA_DEBUG) && (x > y)) \ 811 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 812 } else { \ 813 if (x > y) \ 814 printk(format, ## arg); \ 815 } \ 816 } while(0) 817 /* LDV_COMMENT_END_PREP */ 818 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_open" */ 819 struct inode * var_group2; 820 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "dst_ca_open" */ 821 static int res_dst_ca_open_20; 822 /* content: static int dst_ca_release(struct inode *inode, struct file *file)*/ 823 /* LDV_COMMENT_BEGIN_PREP */ 824 #define DST_CA_ERROR 0 825 #define DST_CA_NOTICE 1 826 #define DST_CA_INFO 2 827 #define DST_CA_DEBUG 3 828 #define dprintk(x, y, z, format, arg...) do { \ 829 if (z) { \ 830 if ((x > DST_CA_ERROR) && (x > y)) \ 831 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 832 else if ((x > DST_CA_NOTICE) && (x > y)) \ 833 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 834 else if ((x > DST_CA_INFO) && (x > y)) \ 835 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 836 else if ((x > DST_CA_DEBUG) && (x > y)) \ 837 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 838 } else { \ 839 if (x > y) \ 840 printk(format, ## arg); \ 841 } \ 842 } while(0) 843 /* LDV_COMMENT_END_PREP */ 844 /* content: static ssize_t dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset)*/ 845 /* LDV_COMMENT_BEGIN_PREP */ 846 #define DST_CA_ERROR 0 847 #define DST_CA_NOTICE 1 848 #define DST_CA_INFO 2 849 #define DST_CA_DEBUG 3 850 #define dprintk(x, y, z, format, arg...) do { \ 851 if (z) { \ 852 if ((x > DST_CA_ERROR) && (x > y)) \ 853 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 854 else if ((x > DST_CA_NOTICE) && (x > y)) \ 855 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 856 else if ((x > DST_CA_INFO) && (x > y)) \ 857 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 858 else if ((x > DST_CA_DEBUG) && (x > y)) \ 859 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 860 } else { \ 861 if (x > y) \ 862 printk(format, ## arg); \ 863 } \ 864 } while(0) 865 /* LDV_COMMENT_END_PREP */ 866 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_read" */ 867 char __user * var_dst_ca_read_22_p1; 868 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_read" */ 869 size_t var_dst_ca_read_22_p2; 870 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_read" */ 871 loff_t * var_dst_ca_read_22_p3; 872 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "dst_ca_read" */ 873 static ssize_t res_dst_ca_read_22; 874 /* content: static ssize_t dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset)*/ 875 /* LDV_COMMENT_BEGIN_PREP */ 876 #define DST_CA_ERROR 0 877 #define DST_CA_NOTICE 1 878 #define DST_CA_INFO 2 879 #define DST_CA_DEBUG 3 880 #define dprintk(x, y, z, format, arg...) do { \ 881 if (z) { \ 882 if ((x > DST_CA_ERROR) && (x > y)) \ 883 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 884 else if ((x > DST_CA_NOTICE) && (x > y)) \ 885 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 886 else if ((x > DST_CA_INFO) && (x > y)) \ 887 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 888 else if ((x > DST_CA_DEBUG) && (x > y)) \ 889 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 890 } else { \ 891 if (x > y) \ 892 printk(format, ## arg); \ 893 } \ 894 } while(0) 895 /* LDV_COMMENT_END_PREP */ 896 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_write" */ 897 const char __user * var_dst_ca_write_23_p1; 898 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_write" */ 899 size_t var_dst_ca_write_23_p2; 900 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_write" */ 901 loff_t * var_dst_ca_write_23_p3; 902 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "dst_ca_write" */ 903 static ssize_t res_dst_ca_write_23; 904 905 906 907 908 /* LDV_COMMENT_END_VARIABLE_DECLARATION_PART */ 909 /* LDV_COMMENT_BEGIN_VARIABLE_INITIALIZING_PART */ 910 /*============================= VARIABLE INITIALIZING PART =============================*/ 911 LDV_IN_INTERRUPT=1; 912 913 914 915 916 /* LDV_COMMENT_END_VARIABLE_INITIALIZING_PART */ 917 /* LDV_COMMENT_BEGIN_FUNCTION_CALL_SECTION */ 918 /*============================= FUNCTION CALL SECTION =============================*/ 919 /* LDV_COMMENT_FUNCTION_CALL Initialize LDV model. */ 920 ldv_initialize(); 921 int ldv_s_dst_ca_fops_file_operations = 0; 922 923 924 925 while( nondet_int() 926 || !(ldv_s_dst_ca_fops_file_operations == 0) 927 ) { 928 929 switch(nondet_int()) { 930 931 case 0: { 932 933 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 934 if(ldv_s_dst_ca_fops_file_operations==0) { 935 936 /* content: static int dst_ca_open(struct inode *inode, struct file *file)*/ 937 /* LDV_COMMENT_BEGIN_PREP */ 938 #define DST_CA_ERROR 0 939 #define DST_CA_NOTICE 1 940 #define DST_CA_INFO 2 941 #define DST_CA_DEBUG 3 942 #define dprintk(x, y, z, format, arg...) do { \ 943 if (z) { \ 944 if ((x > DST_CA_ERROR) && (x > y)) \ 945 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 946 else if ((x > DST_CA_NOTICE) && (x > y)) \ 947 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 948 else if ((x > DST_CA_INFO) && (x > y)) \ 949 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 950 else if ((x > DST_CA_DEBUG) && (x > y)) \ 951 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 952 } else { \ 953 if (x > y) \ 954 printk(format, ## arg); \ 955 } \ 956 } while(0) 957 /* LDV_COMMENT_END_PREP */ 958 /* LDV_COMMENT_FUNCTION_CALL Function from field "open" from driver structure with callbacks "dst_ca_fops". Standart function test for correct return result. */ 959 ldv_handler_precall(); 960 res_dst_ca_open_20 = dst_ca_open( var_group2, var_group1); 961 ldv_check_return_value(res_dst_ca_open_20); 962 if(res_dst_ca_open_20) 963 goto ldv_module_exit; 964 ldv_s_dst_ca_fops_file_operations++; 965 966 } 967 968 } 969 970 break; 971 case 1: { 972 973 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 974 if(ldv_s_dst_ca_fops_file_operations==1) { 975 976 /* content: static ssize_t dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset)*/ 977 /* LDV_COMMENT_BEGIN_PREP */ 978 #define DST_CA_ERROR 0 979 #define DST_CA_NOTICE 1 980 #define DST_CA_INFO 2 981 #define DST_CA_DEBUG 3 982 #define dprintk(x, y, z, format, arg...) do { \ 983 if (z) { \ 984 if ((x > DST_CA_ERROR) && (x > y)) \ 985 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 986 else if ((x > DST_CA_NOTICE) && (x > y)) \ 987 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 988 else if ((x > DST_CA_INFO) && (x > y)) \ 989 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 990 else if ((x > DST_CA_DEBUG) && (x > y)) \ 991 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 992 } else { \ 993 if (x > y) \ 994 printk(format, ## arg); \ 995 } \ 996 } while(0) 997 /* LDV_COMMENT_END_PREP */ 998 /* LDV_COMMENT_FUNCTION_CALL Function from field "read" from driver structure with callbacks "dst_ca_fops". Standart function test for correct return result. */ 999 ldv_handler_precall(); 1000 res_dst_ca_read_22 = dst_ca_read( var_group1, var_dst_ca_read_22_p1, var_dst_ca_read_22_p2, var_dst_ca_read_22_p3); 1001 ldv_check_return_value(res_dst_ca_read_22); 1002 if(res_dst_ca_read_22 < 0) 1003 goto ldv_module_exit; 1004 ldv_s_dst_ca_fops_file_operations++; 1005 1006 } 1007 1008 } 1009 1010 break; 1011 case 2: { 1012 1013 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 1014 if(ldv_s_dst_ca_fops_file_operations==2) { 1015 1016 /* content: static ssize_t dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset)*/ 1017 /* LDV_COMMENT_BEGIN_PREP */ 1018 #define DST_CA_ERROR 0 1019 #define DST_CA_NOTICE 1 1020 #define DST_CA_INFO 2 1021 #define DST_CA_DEBUG 3 1022 #define dprintk(x, y, z, format, arg...) do { \ 1023 if (z) { \ 1024 if ((x > DST_CA_ERROR) && (x > y)) \ 1025 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 1026 else if ((x > DST_CA_NOTICE) && (x > y)) \ 1027 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 1028 else if ((x > DST_CA_INFO) && (x > y)) \ 1029 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 1030 else if ((x > DST_CA_DEBUG) && (x > y)) \ 1031 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 1032 } else { \ 1033 if (x > y) \ 1034 printk(format, ## arg); \ 1035 } \ 1036 } while(0) 1037 /* LDV_COMMENT_END_PREP */ 1038 /* LDV_COMMENT_FUNCTION_CALL Function from field "write" from driver structure with callbacks "dst_ca_fops". Standart function test for correct return result. */ 1039 ldv_handler_precall(); 1040 res_dst_ca_write_23 = dst_ca_write( var_group1, var_dst_ca_write_23_p1, var_dst_ca_write_23_p2, var_dst_ca_write_23_p3); 1041 ldv_check_return_value(res_dst_ca_write_23); 1042 if(res_dst_ca_write_23 < 0) 1043 goto ldv_module_exit; 1044 ldv_s_dst_ca_fops_file_operations++; 1045 1046 } 1047 1048 } 1049 1050 break; 1051 case 3: { 1052 1053 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 1054 if(ldv_s_dst_ca_fops_file_operations==3) { 1055 1056 /* content: static int dst_ca_release(struct inode *inode, struct file *file)*/ 1057 /* LDV_COMMENT_BEGIN_PREP */ 1058 #define DST_CA_ERROR 0 1059 #define DST_CA_NOTICE 1 1060 #define DST_CA_INFO 2 1061 #define DST_CA_DEBUG 3 1062 #define dprintk(x, y, z, format, arg...) do { \ 1063 if (z) { \ 1064 if ((x > DST_CA_ERROR) && (x > y)) \ 1065 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 1066 else if ((x > DST_CA_NOTICE) && (x > y)) \ 1067 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 1068 else if ((x > DST_CA_INFO) && (x > y)) \ 1069 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 1070 else if ((x > DST_CA_DEBUG) && (x > y)) \ 1071 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 1072 } else { \ 1073 if (x > y) \ 1074 printk(format, ## arg); \ 1075 } \ 1076 } while(0) 1077 /* LDV_COMMENT_END_PREP */ 1078 /* LDV_COMMENT_FUNCTION_CALL Function from field "release" from driver structure with callbacks "dst_ca_fops" */ 1079 ldv_handler_precall(); 1080 dst_ca_release( var_group2, var_group1); 1081 ldv_s_dst_ca_fops_file_operations=0; 1082 1083 } 1084 1085 } 1086 1087 break; 1088 case 4: { 1089 1090 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 1091 1092 1093 /* content: static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioctl_arg)*/ 1094 /* LDV_COMMENT_BEGIN_PREP */ 1095 #define DST_CA_ERROR 0 1096 #define DST_CA_NOTICE 1 1097 #define DST_CA_INFO 2 1098 #define DST_CA_DEBUG 3 1099 #define dprintk(x, y, z, format, arg...) do { \ 1100 if (z) { \ 1101 if ((x > DST_CA_ERROR) && (x > y)) \ 1102 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 1103 else if ((x > DST_CA_NOTICE) && (x > y)) \ 1104 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 1105 else if ((x > DST_CA_INFO) && (x > y)) \ 1106 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 1107 else if ((x > DST_CA_DEBUG) && (x > y)) \ 1108 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 1109 } else { \ 1110 if (x > y) \ 1111 printk(format, ## arg); \ 1112 } \ 1113 } while(0) 1114 /* LDV_COMMENT_END_PREP */ 1115 /* LDV_COMMENT_FUNCTION_CALL Function from field "unlocked_ioctl" from driver structure with callbacks "dst_ca_fops" */ 1116 ldv_handler_precall(); 1117 dst_ca_ioctl( var_group1, var_dst_ca_ioctl_19_p1, var_dst_ca_ioctl_19_p2); 1118 1119 1120 1121 1122 } 1123 1124 break; 1125 default: break; 1126 1127 } 1128 1129 } 1130 1131 ldv_module_exit: 1132 1133 /* LDV_COMMENT_FUNCTION_CALL Checks that all resources and locks are correctly released before the driver will be unloaded. */ 1134 ldv_final: ldv_check_final_state(); 1135 1136 /* LDV_COMMENT_END_FUNCTION_CALL_SECTION */ 1137 return; 1138 1139 } 1140 #endif 1141 1142 /* LDV_COMMENT_END_MAIN */
1 2 #include <linux/kernel.h> 3 bool ldv_is_err(const void *ptr); 4 bool ldv_is_err_or_null(const void *ptr); 5 void* ldv_err_ptr(long error); 6 long ldv_ptr_err(const void *ptr); 7 8 #include <linux/module.h> 9 extern int ldv_try_module_get(struct module*); 10 extern void ldv_module_get(struct module*); 11 extern void ldv_module_put(struct module*); 12 extern unsigned int ldv_module_refcount(void); 13 extern void ldv_module_put_and_exit(void); 14 #line 1 "/home/ubuntu/launches/work/current--X--drivers--X--defaultlinux-4.7-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.7-rc1.tar.xz/csd_deg_dscv/2217/dscv_tempdir/dscv/ri/08_1a/drivers/media/pci/bt8xx/dst_ca.c" 15 16 /* 17 CA-driver for TwinHan DST Frontend/Card 18 19 Copyright (C) 2004, 2005 Manu Abraham (manu@kromtek.com) 20 21 This program is free software; you can redistribute it and/or modify 22 it under the terms of the GNU General Public License as published by 23 the Free Software Foundation; either version 2 of the License, or 24 (at your option) any later version. 25 26 This program is distributed in the hope that it will be useful, 27 but WITHOUT ANY WARRANTY; without even the implied warranty of 28 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 GNU General Public License for more details. 30 31 You should have received a copy of the GNU General Public License 32 along with this program; if not, write to the Free Software 33 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 34 */ 35 36 #include <linux/kernel.h> 37 #include <linux/module.h> 38 #include <linux/slab.h> 39 #include <linux/init.h> 40 #include <linux/mutex.h> 41 #include <linux/string.h> 42 #include <linux/dvb/ca.h> 43 #include "dvbdev.h" 44 #include "dvb_frontend.h" 45 #include "dst_ca.h" 46 #include "dst_common.h" 47 48 #define DST_CA_ERROR 0 49 #define DST_CA_NOTICE 1 50 #define DST_CA_INFO 2 51 #define DST_CA_DEBUG 3 52 53 #define dprintk(x, y, z, format, arg...) do { \ 54 if (z) { \ 55 if ((x > DST_CA_ERROR) && (x > y)) \ 56 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 57 else if ((x > DST_CA_NOTICE) && (x > y)) \ 58 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 59 else if ((x > DST_CA_INFO) && (x > y)) \ 60 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 61 else if ((x > DST_CA_DEBUG) && (x > y)) \ 62 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 63 } else { \ 64 if (x > y) \ 65 printk(format, ## arg); \ 66 } \ 67 } while(0) 68 69 70 static DEFINE_MUTEX(dst_ca_mutex); 71 static unsigned int verbose = 5; 72 module_param(verbose, int, 0644); 73 MODULE_PARM_DESC(verbose, "verbose startup messages, default is 1 (yes)"); 74 75 /* Need some more work */ 76 static int ca_set_slot_descr(void) 77 { 78 /* We could make this more graceful ? */ 79 return -EOPNOTSUPP; 80 } 81 82 /* Need some more work */ 83 static int ca_set_pid(void) 84 { 85 /* We could make this more graceful ? */ 86 return -EOPNOTSUPP; 87 } 88 89 static void put_command_and_length(u8 *data, int command, int length) 90 { 91 data[0] = (command >> 16) & 0xff; 92 data[1] = (command >> 8) & 0xff; 93 data[2] = command & 0xff; 94 data[3] = length; 95 } 96 97 static void put_checksum(u8 *check_string, int length) 98 { 99 dprintk(verbose, DST_CA_DEBUG, 1, " Computing string checksum."); 100 dprintk(verbose, DST_CA_DEBUG, 1, " -> string length : 0x%02x", length); 101 check_string[length] = dst_check_sum (check_string, length); 102 dprintk(verbose, DST_CA_DEBUG, 1, " -> checksum : 0x%02x", check_string[length]); 103 } 104 105 static int dst_ci_command(struct dst_state* state, u8 * data, u8 *ca_string, u8 len, int read) 106 { 107 u8 reply; 108 109 mutex_lock(&state->dst_mutex); 110 dst_comm_init(state); 111 msleep(65); 112 113 if (write_dst(state, data, len)) { 114 dprintk(verbose, DST_CA_INFO, 1, " Write not successful, trying to recover"); 115 dst_error_recovery(state); 116 goto error; 117 } 118 if ((dst_pio_disable(state)) < 0) { 119 dprintk(verbose, DST_CA_ERROR, 1, " DST PIO disable failed."); 120 goto error; 121 } 122 if (read_dst(state, &reply, GET_ACK) < 0) { 123 dprintk(verbose, DST_CA_INFO, 1, " Read not successful, trying to recover"); 124 dst_error_recovery(state); 125 goto error; 126 } 127 if (read) { 128 if (! dst_wait_dst_ready(state, LONG_DELAY)) { 129 dprintk(verbose, DST_CA_NOTICE, 1, " 8820 not ready"); 130 goto error; 131 } 132 if (read_dst(state, ca_string, 128) < 0) { /* Try to make this dynamic */ 133 dprintk(verbose, DST_CA_INFO, 1, " Read not successful, trying to recover"); 134 dst_error_recovery(state); 135 goto error; 136 } 137 } 138 mutex_unlock(&state->dst_mutex); 139 return 0; 140 141 error: 142 mutex_unlock(&state->dst_mutex); 143 return -EIO; 144 } 145 146 147 static int dst_put_ci(struct dst_state *state, u8 *data, int len, u8 *ca_string, int read) 148 { 149 u8 dst_ca_comm_err = 0; 150 151 while (dst_ca_comm_err < RETRIES) { 152 dprintk(verbose, DST_CA_NOTICE, 1, " Put Command"); 153 if (dst_ci_command(state, data, ca_string, len, read)) { // If error 154 dst_error_recovery(state); 155 dst_ca_comm_err++; // work required here. 156 } else { 157 break; 158 } 159 } 160 161 if(dst_ca_comm_err == RETRIES) 162 return -1; 163 164 return 0; 165 } 166 167 168 169 static int ca_get_app_info(struct dst_state *state) 170 { 171 int length, str_length; 172 static u8 command[8] = {0x07, 0x40, 0x01, 0x00, 0x01, 0x00, 0x00, 0xff}; 173 174 put_checksum(&command[0], command[0]); 175 if ((dst_put_ci(state, command, sizeof(command), state->messages, GET_REPLY)) < 0) { 176 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); 177 return -1; 178 } 179 dprintk(verbose, DST_CA_INFO, 1, " -->dst_put_ci SUCCESS !"); 180 dprintk(verbose, DST_CA_INFO, 1, " ================================ CI Module Application Info ======================================"); 181 dprintk(verbose, DST_CA_INFO, 1, " Application Type=[%d], Application Vendor=[%d], Vendor Code=[%d]\n%s: Application info=[%s]", 182 state->messages[7], (state->messages[8] << 8) | state->messages[9], 183 (state->messages[10] << 8) | state->messages[11], __func__, (char *)(&state->messages[12])); 184 dprintk(verbose, DST_CA_INFO, 1, " =================================================================================================="); 185 186 // Transform dst message to correct application_info message 187 length = state->messages[5]; 188 str_length = length - 6; 189 if (str_length < 0) { 190 str_length = 0; 191 dprintk(verbose, DST_CA_ERROR, 1, "Invalid string length returned in ca_get_app_info(). Recovering."); 192 } 193 194 // First, the command and length fields 195 put_command_and_length(&state->messages[0], CA_APP_INFO, length); 196 197 // Copy application_type, application_manufacturer and manufacturer_code 198 memmove(&state->messages[4], &state->messages[7], 5); 199 200 // Set string length and copy string 201 state->messages[9] = str_length; 202 memmove(&state->messages[10], &state->messages[12], str_length); 203 204 return 0; 205 } 206 207 static int ca_get_ca_info(struct dst_state *state) 208 { 209 int srcPtr, dstPtr, i, num_ids; 210 static u8 slot_command[8] = {0x07, 0x40, 0x00, 0x00, 0x02, 0x00, 0x00, 0xff}; 211 const int in_system_id_pos = 8, out_system_id_pos = 4, in_num_ids_pos = 7; 212 213 put_checksum(&slot_command[0], slot_command[0]); 214 if ((dst_put_ci(state, slot_command, sizeof (slot_command), state->messages, GET_REPLY)) < 0) { 215 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); 216 return -1; 217 } 218 dprintk(verbose, DST_CA_INFO, 1, " -->dst_put_ci SUCCESS !"); 219 220 // Print raw data 221 dprintk(verbose, DST_CA_INFO, 0, " DST data = ["); 222 for (i = 0; i < state->messages[0] + 1; i++) { 223 dprintk(verbose, DST_CA_INFO, 0, " 0x%02x", state->messages[i]); 224 } 225 dprintk(verbose, DST_CA_INFO, 0, "]\n"); 226 227 // Set the command and length of the output 228 num_ids = state->messages[in_num_ids_pos]; 229 if (num_ids >= 100) { 230 num_ids = 100; 231 dprintk(verbose, DST_CA_ERROR, 1, "Invalid number of ids (>100). Recovering."); 232 } 233 put_command_and_length(&state->messages[0], CA_INFO, num_ids * 2); 234 235 dprintk(verbose, DST_CA_INFO, 0, " CA_INFO = ["); 236 srcPtr = in_system_id_pos; 237 dstPtr = out_system_id_pos; 238 for(i = 0; i < num_ids; i++) { 239 dprintk(verbose, DST_CA_INFO, 0, " 0x%02x%02x", state->messages[srcPtr + 0], state->messages[srcPtr + 1]); 240 // Append to output 241 state->messages[dstPtr + 0] = state->messages[srcPtr + 0]; 242 state->messages[dstPtr + 1] = state->messages[srcPtr + 1]; 243 srcPtr += 2; 244 dstPtr += 2; 245 } 246 dprintk(verbose, DST_CA_INFO, 0, "]\n"); 247 248 return 0; 249 } 250 251 static int ca_get_slot_caps(struct dst_state *state, struct ca_caps *p_ca_caps, void __user *arg) 252 { 253 int i; 254 u8 slot_cap[256]; 255 static u8 slot_command[8] = {0x07, 0x40, 0x02, 0x00, 0x02, 0x00, 0x00, 0xff}; 256 257 put_checksum(&slot_command[0], slot_command[0]); 258 if ((dst_put_ci(state, slot_command, sizeof (slot_command), slot_cap, GET_REPLY)) < 0) { 259 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); 260 return -1; 261 } 262 dprintk(verbose, DST_CA_NOTICE, 1, " -->dst_put_ci SUCCESS !"); 263 264 /* Will implement the rest soon */ 265 266 dprintk(verbose, DST_CA_INFO, 1, " Slot cap = [%d]", slot_cap[7]); 267 dprintk(verbose, DST_CA_INFO, 0, "===================================\n"); 268 for (i = 0; i < slot_cap[0] + 1; i++) 269 dprintk(verbose, DST_CA_INFO, 0, " %d", slot_cap[i]); 270 dprintk(verbose, DST_CA_INFO, 0, "\n"); 271 272 p_ca_caps->slot_num = 1; 273 p_ca_caps->slot_type = 1; 274 p_ca_caps->descr_num = slot_cap[7]; 275 p_ca_caps->descr_type = 1; 276 277 if (copy_to_user(arg, p_ca_caps, sizeof (struct ca_caps))) 278 return -EFAULT; 279 280 return 0; 281 } 282 283 /* Need some more work */ 284 static int ca_get_slot_descr(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg) 285 { 286 return -EOPNOTSUPP; 287 } 288 289 290 static int ca_get_slot_info(struct dst_state *state, struct ca_slot_info *p_ca_slot_info, void __user *arg) 291 { 292 int i; 293 static u8 slot_command[8] = {0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff}; 294 295 u8 *slot_info = state->messages; 296 297 put_checksum(&slot_command[0], 7); 298 if ((dst_put_ci(state, slot_command, sizeof (slot_command), slot_info, GET_REPLY)) < 0) { 299 dprintk(verbose, DST_CA_ERROR, 1, " -->dst_put_ci FAILED !"); 300 return -1; 301 } 302 dprintk(verbose, DST_CA_INFO, 1, " -->dst_put_ci SUCCESS !"); 303 304 /* Will implement the rest soon */ 305 306 dprintk(verbose, DST_CA_INFO, 1, " Slot info = [%d]", slot_info[3]); 307 dprintk(verbose, DST_CA_INFO, 0, "===================================\n"); 308 for (i = 0; i < 8; i++) 309 dprintk(verbose, DST_CA_INFO, 0, " %d", slot_info[i]); 310 dprintk(verbose, DST_CA_INFO, 0, "\n"); 311 312 if (slot_info[4] & 0x80) { 313 p_ca_slot_info->flags = CA_CI_MODULE_PRESENT; 314 p_ca_slot_info->num = 1; 315 p_ca_slot_info->type = CA_CI; 316 } else if (slot_info[4] & 0x40) { 317 p_ca_slot_info->flags = CA_CI_MODULE_READY; 318 p_ca_slot_info->num = 1; 319 p_ca_slot_info->type = CA_CI; 320 } else 321 p_ca_slot_info->flags = 0; 322 323 if (copy_to_user(arg, p_ca_slot_info, sizeof (struct ca_slot_info))) 324 return -EFAULT; 325 326 return 0; 327 } 328 329 330 static int ca_get_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg) 331 { 332 u8 i = 0; 333 u32 command = 0; 334 335 if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg))) 336 return -EFAULT; 337 338 dprintk(verbose, DST_CA_NOTICE, 1, " Message = [%*ph]", 339 3, p_ca_message->msg); 340 341 for (i = 0; i < 3; i++) { 342 command = command | p_ca_message->msg[i]; 343 if (i < 2) 344 command = command << 8; 345 } 346 dprintk(verbose, DST_CA_NOTICE, 1, " Command=[0x%x]", command); 347 348 switch (command) { 349 case CA_APP_INFO: 350 memcpy(p_ca_message->msg, state->messages, 128); 351 if (copy_to_user(arg, p_ca_message, sizeof (struct ca_msg)) ) 352 return -EFAULT; 353 break; 354 case CA_INFO: 355 memcpy(p_ca_message->msg, state->messages, 128); 356 if (copy_to_user(arg, p_ca_message, sizeof (struct ca_msg)) ) 357 return -EFAULT; 358 break; 359 } 360 361 return 0; 362 } 363 364 static int handle_dst_tag(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer, u32 length) 365 { 366 if (state->dst_hw_cap & DST_TYPE_HAS_SESSION) { 367 hw_buffer->msg[2] = p_ca_message->msg[1]; /* MSB */ 368 hw_buffer->msg[3] = p_ca_message->msg[2]; /* LSB */ 369 } else { 370 if (length > 247) { 371 dprintk(verbose, DST_CA_ERROR, 1, " Message too long ! *** Bailing Out *** !"); 372 return -1; 373 } 374 hw_buffer->msg[0] = (length & 0xff) + 7; 375 hw_buffer->msg[1] = 0x40; 376 hw_buffer->msg[2] = 0x03; 377 hw_buffer->msg[3] = 0x00; 378 hw_buffer->msg[4] = 0x03; 379 hw_buffer->msg[5] = length & 0xff; 380 hw_buffer->msg[6] = 0x00; 381 382 /* 383 * Need to compute length for EN50221 section 8.3.2, for the time being 384 * assuming 8.3.2 is not applicable 385 */ 386 memcpy(&hw_buffer->msg[7], &p_ca_message->msg[4], length); 387 } 388 389 return 0; 390 } 391 392 static int write_to_8820(struct dst_state *state, struct ca_msg *hw_buffer, u8 length, u8 reply) 393 { 394 if ((dst_put_ci(state, hw_buffer->msg, length, hw_buffer->msg, reply)) < 0) { 395 dprintk(verbose, DST_CA_ERROR, 1, " DST-CI Command failed."); 396 dprintk(verbose, DST_CA_NOTICE, 1, " Resetting DST."); 397 rdc_reset_state(state); 398 return -1; 399 } 400 dprintk(verbose, DST_CA_NOTICE, 1, " DST-CI Command success."); 401 402 return 0; 403 } 404 405 static u32 asn_1_decode(u8 *asn_1_array) 406 { 407 u8 length_field = 0, word_count = 0, count = 0; 408 u32 length = 0; 409 410 length_field = asn_1_array[0]; 411 dprintk(verbose, DST_CA_DEBUG, 1, " Length field=[%02x]", length_field); 412 if (length_field < 0x80) { 413 length = length_field & 0x7f; 414 dprintk(verbose, DST_CA_DEBUG, 1, " Length=[%02x]\n", length); 415 } else { 416 word_count = length_field & 0x7f; 417 for (count = 0; count < word_count; count++) { 418 length = length << 8; 419 length += asn_1_array[count + 1]; 420 dprintk(verbose, DST_CA_DEBUG, 1, " Length=[%04x]", length); 421 } 422 } 423 return length; 424 } 425 426 static int debug_string(u8 *msg, u32 length, u32 offset) 427 { 428 u32 i; 429 430 dprintk(verbose, DST_CA_DEBUG, 0, " String=[ "); 431 for (i = offset; i < length; i++) 432 dprintk(verbose, DST_CA_DEBUG, 0, "%02x ", msg[i]); 433 dprintk(verbose, DST_CA_DEBUG, 0, "]\n"); 434 435 return 0; 436 } 437 438 439 static int ca_set_pmt(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer, u8 reply, u8 query) 440 { 441 u32 length = 0; 442 u8 tag_length = 8; 443 444 length = asn_1_decode(&p_ca_message->msg[3]); 445 dprintk(verbose, DST_CA_DEBUG, 1, " CA Message length=[%d]", length); 446 debug_string(&p_ca_message->msg[4], length, 0); /* length is excluding tag & length */ 447 448 memset(hw_buffer->msg, '\0', length); 449 handle_dst_tag(state, p_ca_message, hw_buffer, length); 450 put_checksum(hw_buffer->msg, hw_buffer->msg[0]); 451 452 debug_string(hw_buffer->msg, (length + tag_length), 0); /* tags too */ 453 write_to_8820(state, hw_buffer, (length + tag_length), reply); 454 455 return 0; 456 } 457 458 459 /* Board supports CA PMT reply ? */ 460 static int dst_check_ca_pmt(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer) 461 { 462 int ca_pmt_reply_test = 0; 463 464 /* Do test board */ 465 /* Not there yet but soon */ 466 467 /* CA PMT Reply capable */ 468 if (ca_pmt_reply_test) { 469 if ((ca_set_pmt(state, p_ca_message, hw_buffer, 1, GET_REPLY)) < 0) { 470 dprintk(verbose, DST_CA_ERROR, 1, " ca_set_pmt.. failed !"); 471 return -1; 472 } 473 474 /* Process CA PMT Reply */ 475 /* will implement soon */ 476 dprintk(verbose, DST_CA_ERROR, 1, " Not there yet"); 477 } 478 /* CA PMT Reply not capable */ 479 if (!ca_pmt_reply_test) { 480 if ((ca_set_pmt(state, p_ca_message, hw_buffer, 0, NO_REPLY)) < 0) { 481 dprintk(verbose, DST_CA_ERROR, 1, " ca_set_pmt.. failed !"); 482 return -1; 483 } 484 dprintk(verbose, DST_CA_NOTICE, 1, " ca_set_pmt.. success !"); 485 /* put a dummy message */ 486 487 } 488 return 0; 489 } 490 491 static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, void __user *arg) 492 { 493 int i = 0; 494 495 u32 command = 0; 496 struct ca_msg *hw_buffer; 497 int result = 0; 498 499 if ((hw_buffer = kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) { 500 dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); 501 return -ENOMEM; 502 } 503 dprintk(verbose, DST_CA_DEBUG, 1, " "); 504 505 if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg))) { 506 result = -EFAULT; 507 goto free_mem_and_exit; 508 } 509 510 /* EN50221 tag */ 511 command = 0; 512 513 for (i = 0; i < 3; i++) { 514 command = command | p_ca_message->msg[i]; 515 if (i < 2) 516 command = command << 8; 517 } 518 dprintk(verbose, DST_CA_DEBUG, 1, " Command=[0x%x]\n", command); 519 520 switch (command) { 521 case CA_PMT: 522 dprintk(verbose, DST_CA_DEBUG, 1, "Command = SEND_CA_PMT"); 523 if ((ca_set_pmt(state, p_ca_message, hw_buffer, 0, 0)) < 0) { // code simplification started 524 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_PMT Failed !"); 525 result = -1; 526 goto free_mem_and_exit; 527 } 528 dprintk(verbose, DST_CA_INFO, 1, " -->CA_PMT Success !"); 529 break; 530 case CA_PMT_REPLY: 531 dprintk(verbose, DST_CA_INFO, 1, "Command = CA_PMT_REPLY"); 532 /* Have to handle the 2 basic types of cards here */ 533 if ((dst_check_ca_pmt(state, p_ca_message, hw_buffer)) < 0) { 534 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_PMT_REPLY Failed !"); 535 result = -1; 536 goto free_mem_and_exit; 537 } 538 dprintk(verbose, DST_CA_INFO, 1, " -->CA_PMT_REPLY Success !"); 539 break; 540 case CA_APP_INFO_ENQUIRY: // only for debugging 541 dprintk(verbose, DST_CA_INFO, 1, " Getting Cam Application information"); 542 543 if ((ca_get_app_info(state)) < 0) { 544 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_APP_INFO_ENQUIRY Failed !"); 545 result = -1; 546 goto free_mem_and_exit; 547 } 548 dprintk(verbose, DST_CA_INFO, 1, " -->CA_APP_INFO_ENQUIRY Success !"); 549 break; 550 case CA_INFO_ENQUIRY: 551 dprintk(verbose, DST_CA_INFO, 1, " Getting CA Information"); 552 553 if ((ca_get_ca_info(state)) < 0) { 554 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_INFO_ENQUIRY Failed !"); 555 result = -1; 556 goto free_mem_and_exit; 557 } 558 dprintk(verbose, DST_CA_INFO, 1, " -->CA_INFO_ENQUIRY Success !"); 559 break; 560 } 561 562 free_mem_and_exit: 563 kfree (hw_buffer); 564 565 return result; 566 } 567 568 static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioctl_arg) 569 { 570 struct dvb_device *dvbdev; 571 struct dst_state *state; 572 struct ca_slot_info *p_ca_slot_info; 573 struct ca_caps *p_ca_caps; 574 struct ca_msg *p_ca_message; 575 void __user *arg = (void __user *)ioctl_arg; 576 int result = 0; 577 578 mutex_lock(&dst_ca_mutex); 579 dvbdev = file->private_data; 580 state = (struct dst_state *)dvbdev->priv; 581 p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL); 582 p_ca_slot_info = kmalloc(sizeof (struct ca_slot_info), GFP_KERNEL); 583 p_ca_caps = kmalloc(sizeof (struct ca_caps), GFP_KERNEL); 584 if (!p_ca_message || !p_ca_slot_info || !p_ca_caps) { 585 dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); 586 result = -ENOMEM; 587 goto free_mem_and_exit; 588 } 589 590 /* We have now only the standard ioctl's, the driver is upposed to handle internals. */ 591 switch (cmd) { 592 case CA_SEND_MSG: 593 dprintk(verbose, DST_CA_INFO, 1, " Sending message"); 594 if ((ca_send_message(state, p_ca_message, arg)) < 0) { 595 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_SEND_MSG Failed !"); 596 result = -1; 597 goto free_mem_and_exit; 598 } 599 break; 600 case CA_GET_MSG: 601 dprintk(verbose, DST_CA_INFO, 1, " Getting message"); 602 if ((ca_get_message(state, p_ca_message, arg)) < 0) { 603 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_MSG Failed !"); 604 result = -1; 605 goto free_mem_and_exit; 606 } 607 dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_MSG Success !"); 608 break; 609 case CA_RESET: 610 dprintk(verbose, DST_CA_ERROR, 1, " Resetting DST"); 611 dst_error_bailout(state); 612 msleep(4000); 613 break; 614 case CA_GET_SLOT_INFO: 615 dprintk(verbose, DST_CA_INFO, 1, " Getting Slot info"); 616 if ((ca_get_slot_info(state, p_ca_slot_info, arg)) < 0) { 617 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_SLOT_INFO Failed !"); 618 result = -1; 619 goto free_mem_and_exit; 620 } 621 dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_SLOT_INFO Success !"); 622 break; 623 case CA_GET_CAP: 624 dprintk(verbose, DST_CA_INFO, 1, " Getting Slot capabilities"); 625 if ((ca_get_slot_caps(state, p_ca_caps, arg)) < 0) { 626 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_CAP Failed !"); 627 result = -1; 628 goto free_mem_and_exit; 629 } 630 dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_CAP Success !"); 631 break; 632 case CA_GET_DESCR_INFO: 633 dprintk(verbose, DST_CA_INFO, 1, " Getting descrambler description"); 634 if ((ca_get_slot_descr(state, p_ca_message, arg)) < 0) { 635 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_GET_DESCR_INFO Failed !"); 636 result = -1; 637 goto free_mem_and_exit; 638 } 639 dprintk(verbose, DST_CA_INFO, 1, " -->CA_GET_DESCR_INFO Success !"); 640 break; 641 case CA_SET_DESCR: 642 dprintk(verbose, DST_CA_INFO, 1, " Setting descrambler"); 643 if ((ca_set_slot_descr()) < 0) { 644 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_SET_DESCR Failed !"); 645 result = -1; 646 goto free_mem_and_exit; 647 } 648 dprintk(verbose, DST_CA_INFO, 1, " -->CA_SET_DESCR Success !"); 649 break; 650 case CA_SET_PID: 651 dprintk(verbose, DST_CA_INFO, 1, " Setting PID"); 652 if ((ca_set_pid()) < 0) { 653 dprintk(verbose, DST_CA_ERROR, 1, " -->CA_SET_PID Failed !"); 654 result = -1; 655 goto free_mem_and_exit; 656 } 657 dprintk(verbose, DST_CA_INFO, 1, " -->CA_SET_PID Success !"); 658 default: 659 result = -EOPNOTSUPP; 660 } 661 free_mem_and_exit: 662 kfree (p_ca_message); 663 kfree (p_ca_slot_info); 664 kfree (p_ca_caps); 665 666 mutex_unlock(&dst_ca_mutex); 667 return result; 668 } 669 670 static int dst_ca_open(struct inode *inode, struct file *file) 671 { 672 dprintk(verbose, DST_CA_DEBUG, 1, " Device opened [%p] ", file); 673 try_module_get(THIS_MODULE); 674 675 return 0; 676 } 677 678 static int dst_ca_release(struct inode *inode, struct file *file) 679 { 680 dprintk(verbose, DST_CA_DEBUG, 1, " Device closed."); 681 module_put(THIS_MODULE); 682 683 return 0; 684 } 685 686 static ssize_t dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset) 687 { 688 dprintk(verbose, DST_CA_DEBUG, 1, " Device read."); 689 690 return 0; 691 } 692 693 static ssize_t dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset) 694 { 695 dprintk(verbose, DST_CA_DEBUG, 1, " Device write."); 696 697 return 0; 698 } 699 700 static const struct file_operations dst_ca_fops = { 701 .owner = THIS_MODULE, 702 .unlocked_ioctl = dst_ca_ioctl, 703 .open = dst_ca_open, 704 .release = dst_ca_release, 705 .read = dst_ca_read, 706 .write = dst_ca_write, 707 .llseek = noop_llseek, 708 }; 709 710 static struct dvb_device dvbdev_ca = { 711 .priv = NULL, 712 .users = 1, 713 .readers = 1, 714 .writers = 1, 715 .fops = &dst_ca_fops 716 }; 717 718 struct dvb_device *dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter) 719 { 720 struct dvb_device *dvbdev; 721 722 dprintk(verbose, DST_CA_ERROR, 1, "registering DST-CA device"); 723 if (dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst, 724 DVB_DEVICE_CA, 0) == 0) { 725 dst->dst_ca = dvbdev; 726 return dst->dst_ca; 727 } 728 729 return NULL; 730 } 731 732 EXPORT_SYMBOL(dst_ca_attach); 733 734 MODULE_DESCRIPTION("DST DVB-S/T/C Combo CA driver"); 735 MODULE_AUTHOR("Manu Abraham"); 736 MODULE_LICENSE("GPL"); 737 738 739 740 741 742 /* LDV_COMMENT_BEGIN_MAIN */ 743 #ifdef LDV_MAIN0_sequence_infinite_withcheck_stateful 744 745 /*###########################################################################*/ 746 747 /*############## Driver Environment Generator 0.2 output ####################*/ 748 749 /*###########################################################################*/ 750 751 752 753 /* 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. */ 754 void ldv_check_final_state(void); 755 756 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result. */ 757 void ldv_check_return_value(int res); 758 759 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Test correct return result of probe() function. */ 760 void ldv_check_return_value_probe(int res); 761 762 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Initializes the model. */ 763 void ldv_initialize(void); 764 765 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Reinitializes the model between distinct model function calls. */ 766 void ldv_handler_precall(void); 767 768 /* LDV_COMMENT_FUNCTION_DECLARE_LDV Special function for LDV verifier. Returns arbitrary interger value. */ 769 int nondet_int(void); 770 771 /* LDV_COMMENT_VAR_DECLARE_LDV Special variable for LDV verifier. */ 772 int LDV_IN_INTERRUPT; 773 774 /* LDV_COMMENT_FUNCTION_MAIN Main function for LDV verifier. */ 775 void ldv_main0_sequence_infinite_withcheck_stateful(void) { 776 777 778 779 /* LDV_COMMENT_BEGIN_VARIABLE_DECLARATION_PART */ 780 /*============================= VARIABLE DECLARATION PART =============================*/ 781 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 782 /* content: static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioctl_arg)*/ 783 /* LDV_COMMENT_BEGIN_PREP */ 784 #define DST_CA_ERROR 0 785 #define DST_CA_NOTICE 1 786 #define DST_CA_INFO 2 787 #define DST_CA_DEBUG 3 788 #define dprintk(x, y, z, format, arg...) do { \ 789 if (z) { \ 790 if ((x > DST_CA_ERROR) && (x > y)) \ 791 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 792 else if ((x > DST_CA_NOTICE) && (x > y)) \ 793 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 794 else if ((x > DST_CA_INFO) && (x > y)) \ 795 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 796 else if ((x > DST_CA_DEBUG) && (x > y)) \ 797 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 798 } else { \ 799 if (x > y) \ 800 printk(format, ## arg); \ 801 } \ 802 } while(0) 803 /* LDV_COMMENT_END_PREP */ 804 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_ioctl" */ 805 struct file * var_group1; 806 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_ioctl" */ 807 unsigned int var_dst_ca_ioctl_19_p1; 808 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_ioctl" */ 809 unsigned long var_dst_ca_ioctl_19_p2; 810 /* content: static int dst_ca_open(struct inode *inode, struct file *file)*/ 811 /* LDV_COMMENT_BEGIN_PREP */ 812 #define DST_CA_ERROR 0 813 #define DST_CA_NOTICE 1 814 #define DST_CA_INFO 2 815 #define DST_CA_DEBUG 3 816 #define dprintk(x, y, z, format, arg...) do { \ 817 if (z) { \ 818 if ((x > DST_CA_ERROR) && (x > y)) \ 819 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 820 else if ((x > DST_CA_NOTICE) && (x > y)) \ 821 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 822 else if ((x > DST_CA_INFO) && (x > y)) \ 823 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 824 else if ((x > DST_CA_DEBUG) && (x > y)) \ 825 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 826 } else { \ 827 if (x > y) \ 828 printk(format, ## arg); \ 829 } \ 830 } while(0) 831 /* LDV_COMMENT_END_PREP */ 832 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_open" */ 833 struct inode * var_group2; 834 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "dst_ca_open" */ 835 static int res_dst_ca_open_20; 836 /* content: static int dst_ca_release(struct inode *inode, struct file *file)*/ 837 /* LDV_COMMENT_BEGIN_PREP */ 838 #define DST_CA_ERROR 0 839 #define DST_CA_NOTICE 1 840 #define DST_CA_INFO 2 841 #define DST_CA_DEBUG 3 842 #define dprintk(x, y, z, format, arg...) do { \ 843 if (z) { \ 844 if ((x > DST_CA_ERROR) && (x > y)) \ 845 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 846 else if ((x > DST_CA_NOTICE) && (x > y)) \ 847 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 848 else if ((x > DST_CA_INFO) && (x > y)) \ 849 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 850 else if ((x > DST_CA_DEBUG) && (x > y)) \ 851 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 852 } else { \ 853 if (x > y) \ 854 printk(format, ## arg); \ 855 } \ 856 } while(0) 857 /* LDV_COMMENT_END_PREP */ 858 /* content: static ssize_t dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset)*/ 859 /* LDV_COMMENT_BEGIN_PREP */ 860 #define DST_CA_ERROR 0 861 #define DST_CA_NOTICE 1 862 #define DST_CA_INFO 2 863 #define DST_CA_DEBUG 3 864 #define dprintk(x, y, z, format, arg...) do { \ 865 if (z) { \ 866 if ((x > DST_CA_ERROR) && (x > y)) \ 867 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 868 else if ((x > DST_CA_NOTICE) && (x > y)) \ 869 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 870 else if ((x > DST_CA_INFO) && (x > y)) \ 871 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 872 else if ((x > DST_CA_DEBUG) && (x > y)) \ 873 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 874 } else { \ 875 if (x > y) \ 876 printk(format, ## arg); \ 877 } \ 878 } while(0) 879 /* LDV_COMMENT_END_PREP */ 880 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_read" */ 881 char __user * var_dst_ca_read_22_p1; 882 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_read" */ 883 size_t var_dst_ca_read_22_p2; 884 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_read" */ 885 loff_t * var_dst_ca_read_22_p3; 886 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "dst_ca_read" */ 887 static ssize_t res_dst_ca_read_22; 888 /* content: static ssize_t dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset)*/ 889 /* LDV_COMMENT_BEGIN_PREP */ 890 #define DST_CA_ERROR 0 891 #define DST_CA_NOTICE 1 892 #define DST_CA_INFO 2 893 #define DST_CA_DEBUG 3 894 #define dprintk(x, y, z, format, arg...) do { \ 895 if (z) { \ 896 if ((x > DST_CA_ERROR) && (x > y)) \ 897 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 898 else if ((x > DST_CA_NOTICE) && (x > y)) \ 899 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 900 else if ((x > DST_CA_INFO) && (x > y)) \ 901 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 902 else if ((x > DST_CA_DEBUG) && (x > y)) \ 903 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 904 } else { \ 905 if (x > y) \ 906 printk(format, ## arg); \ 907 } \ 908 } while(0) 909 /* LDV_COMMENT_END_PREP */ 910 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_write" */ 911 const char __user * var_dst_ca_write_23_p1; 912 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_write" */ 913 size_t var_dst_ca_write_23_p2; 914 /* LDV_COMMENT_VAR_DECLARE Variable declaration for function "dst_ca_write" */ 915 loff_t * var_dst_ca_write_23_p3; 916 /* LDV_COMMENT_VAR_DECLARE Variable declaration for test return result from function call "dst_ca_write" */ 917 static ssize_t res_dst_ca_write_23; 918 919 920 921 922 /* LDV_COMMENT_END_VARIABLE_DECLARATION_PART */ 923 /* LDV_COMMENT_BEGIN_VARIABLE_INITIALIZING_PART */ 924 /*============================= VARIABLE INITIALIZING PART =============================*/ 925 LDV_IN_INTERRUPT=1; 926 927 928 929 930 /* LDV_COMMENT_END_VARIABLE_INITIALIZING_PART */ 931 /* LDV_COMMENT_BEGIN_FUNCTION_CALL_SECTION */ 932 /*============================= FUNCTION CALL SECTION =============================*/ 933 /* LDV_COMMENT_FUNCTION_CALL Initialize LDV model. */ 934 ldv_initialize(); 935 int ldv_s_dst_ca_fops_file_operations = 0; 936 937 938 939 while( nondet_int() 940 || !(ldv_s_dst_ca_fops_file_operations == 0) 941 ) { 942 943 switch(nondet_int()) { 944 945 case 0: { 946 947 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 948 if(ldv_s_dst_ca_fops_file_operations==0) { 949 950 /* content: static int dst_ca_open(struct inode *inode, struct file *file)*/ 951 /* LDV_COMMENT_BEGIN_PREP */ 952 #define DST_CA_ERROR 0 953 #define DST_CA_NOTICE 1 954 #define DST_CA_INFO 2 955 #define DST_CA_DEBUG 3 956 #define dprintk(x, y, z, format, arg...) do { \ 957 if (z) { \ 958 if ((x > DST_CA_ERROR) && (x > y)) \ 959 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 960 else if ((x > DST_CA_NOTICE) && (x > y)) \ 961 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 962 else if ((x > DST_CA_INFO) && (x > y)) \ 963 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 964 else if ((x > DST_CA_DEBUG) && (x > y)) \ 965 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 966 } else { \ 967 if (x > y) \ 968 printk(format, ## arg); \ 969 } \ 970 } while(0) 971 /* LDV_COMMENT_END_PREP */ 972 /* LDV_COMMENT_FUNCTION_CALL Function from field "open" from driver structure with callbacks "dst_ca_fops". Standart function test for correct return result. */ 973 ldv_handler_precall(); 974 res_dst_ca_open_20 = dst_ca_open( var_group2, var_group1); 975 ldv_check_return_value(res_dst_ca_open_20); 976 if(res_dst_ca_open_20) 977 goto ldv_module_exit; 978 ldv_s_dst_ca_fops_file_operations++; 979 980 } 981 982 } 983 984 break; 985 case 1: { 986 987 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 988 if(ldv_s_dst_ca_fops_file_operations==1) { 989 990 /* content: static ssize_t dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset)*/ 991 /* LDV_COMMENT_BEGIN_PREP */ 992 #define DST_CA_ERROR 0 993 #define DST_CA_NOTICE 1 994 #define DST_CA_INFO 2 995 #define DST_CA_DEBUG 3 996 #define dprintk(x, y, z, format, arg...) do { \ 997 if (z) { \ 998 if ((x > DST_CA_ERROR) && (x > y)) \ 999 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 1000 else if ((x > DST_CA_NOTICE) && (x > y)) \ 1001 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 1002 else if ((x > DST_CA_INFO) && (x > y)) \ 1003 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 1004 else if ((x > DST_CA_DEBUG) && (x > y)) \ 1005 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 1006 } else { \ 1007 if (x > y) \ 1008 printk(format, ## arg); \ 1009 } \ 1010 } while(0) 1011 /* LDV_COMMENT_END_PREP */ 1012 /* LDV_COMMENT_FUNCTION_CALL Function from field "read" from driver structure with callbacks "dst_ca_fops". Standart function test for correct return result. */ 1013 ldv_handler_precall(); 1014 res_dst_ca_read_22 = dst_ca_read( var_group1, var_dst_ca_read_22_p1, var_dst_ca_read_22_p2, var_dst_ca_read_22_p3); 1015 ldv_check_return_value(res_dst_ca_read_22); 1016 if(res_dst_ca_read_22 < 0) 1017 goto ldv_module_exit; 1018 ldv_s_dst_ca_fops_file_operations++; 1019 1020 } 1021 1022 } 1023 1024 break; 1025 case 2: { 1026 1027 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 1028 if(ldv_s_dst_ca_fops_file_operations==2) { 1029 1030 /* content: static ssize_t dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset)*/ 1031 /* LDV_COMMENT_BEGIN_PREP */ 1032 #define DST_CA_ERROR 0 1033 #define DST_CA_NOTICE 1 1034 #define DST_CA_INFO 2 1035 #define DST_CA_DEBUG 3 1036 #define dprintk(x, y, z, format, arg...) do { \ 1037 if (z) { \ 1038 if ((x > DST_CA_ERROR) && (x > y)) \ 1039 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 1040 else if ((x > DST_CA_NOTICE) && (x > y)) \ 1041 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 1042 else if ((x > DST_CA_INFO) && (x > y)) \ 1043 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 1044 else if ((x > DST_CA_DEBUG) && (x > y)) \ 1045 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 1046 } else { \ 1047 if (x > y) \ 1048 printk(format, ## arg); \ 1049 } \ 1050 } while(0) 1051 /* LDV_COMMENT_END_PREP */ 1052 /* LDV_COMMENT_FUNCTION_CALL Function from field "write" from driver structure with callbacks "dst_ca_fops". Standart function test for correct return result. */ 1053 ldv_handler_precall(); 1054 res_dst_ca_write_23 = dst_ca_write( var_group1, var_dst_ca_write_23_p1, var_dst_ca_write_23_p2, var_dst_ca_write_23_p3); 1055 ldv_check_return_value(res_dst_ca_write_23); 1056 if(res_dst_ca_write_23 < 0) 1057 goto ldv_module_exit; 1058 ldv_s_dst_ca_fops_file_operations++; 1059 1060 } 1061 1062 } 1063 1064 break; 1065 case 3: { 1066 1067 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 1068 if(ldv_s_dst_ca_fops_file_operations==3) { 1069 1070 /* content: static int dst_ca_release(struct inode *inode, struct file *file)*/ 1071 /* LDV_COMMENT_BEGIN_PREP */ 1072 #define DST_CA_ERROR 0 1073 #define DST_CA_NOTICE 1 1074 #define DST_CA_INFO 2 1075 #define DST_CA_DEBUG 3 1076 #define dprintk(x, y, z, format, arg...) do { \ 1077 if (z) { \ 1078 if ((x > DST_CA_ERROR) && (x > y)) \ 1079 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 1080 else if ((x > DST_CA_NOTICE) && (x > y)) \ 1081 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 1082 else if ((x > DST_CA_INFO) && (x > y)) \ 1083 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 1084 else if ((x > DST_CA_DEBUG) && (x > y)) \ 1085 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 1086 } else { \ 1087 if (x > y) \ 1088 printk(format, ## arg); \ 1089 } \ 1090 } while(0) 1091 /* LDV_COMMENT_END_PREP */ 1092 /* LDV_COMMENT_FUNCTION_CALL Function from field "release" from driver structure with callbacks "dst_ca_fops" */ 1093 ldv_handler_precall(); 1094 dst_ca_release( var_group2, var_group1); 1095 ldv_s_dst_ca_fops_file_operations=0; 1096 1097 } 1098 1099 } 1100 1101 break; 1102 case 4: { 1103 1104 /** STRUCT: struct type: file_operations, struct name: dst_ca_fops **/ 1105 1106 1107 /* content: static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioctl_arg)*/ 1108 /* LDV_COMMENT_BEGIN_PREP */ 1109 #define DST_CA_ERROR 0 1110 #define DST_CA_NOTICE 1 1111 #define DST_CA_INFO 2 1112 #define DST_CA_DEBUG 3 1113 #define dprintk(x, y, z, format, arg...) do { \ 1114 if (z) { \ 1115 if ((x > DST_CA_ERROR) && (x > y)) \ 1116 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 1117 else if ((x > DST_CA_NOTICE) && (x > y)) \ 1118 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 1119 else if ((x > DST_CA_INFO) && (x > y)) \ 1120 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 1121 else if ((x > DST_CA_DEBUG) && (x > y)) \ 1122 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 1123 } else { \ 1124 if (x > y) \ 1125 printk(format, ## arg); \ 1126 } \ 1127 } while(0) 1128 /* LDV_COMMENT_END_PREP */ 1129 /* LDV_COMMENT_FUNCTION_CALL Function from field "unlocked_ioctl" from driver structure with callbacks "dst_ca_fops" */ 1130 ldv_handler_precall(); 1131 dst_ca_ioctl( var_group1, var_dst_ca_ioctl_19_p1, var_dst_ca_ioctl_19_p2); 1132 1133 1134 1135 1136 } 1137 1138 break; 1139 default: break; 1140 1141 } 1142 1143 } 1144 1145 ldv_module_exit: 1146 1147 /* LDV_COMMENT_FUNCTION_CALL Checks that all resources and locks are correctly released before the driver will be unloaded. */ 1148 ldv_final: ldv_check_final_state(); 1149 1150 /* LDV_COMMENT_END_FUNCTION_CALL_SECTION */ 1151 return; 1152 1153 } 1154 #endif 1155 1156 /* LDV_COMMENT_END_MAIN */ 1157 1158 #line 14 "/home/ubuntu/launches/work/current--X--drivers--X--defaultlinux-4.7-rc1.tar.xz--X--08_1a--X--cpachecker/linux-4.7-rc1.tar.xz/csd_deg_dscv/2217/dscv_tempdir/dscv/ri/08_1a/drivers/media/pci/bt8xx/dst_ca.o.c.prepared"
1 2 3 #include <verifier/rcv.h> 4 #include <kernel-model/ERR.inc> 5 6 /* Module locks counter (1 is the initial state; it shouldn't go lower). We do not distinguish different modules. */ 7 int ldv_module_refcounter = 1; 8 9 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_module_get') Increment module reference counter (unless the module pointer is NULL). */ 10 void ldv_module_get(struct module *module) 11 { 12 /* LDV_COMMENT_OTHER Do nothing if the module pointer is NULL */ 13 if (module){ 14 /* LDV_COMMENT_CHANGE_STATE Increment module reference counter. */ 15 ldv_module_refcounter++; 16 } 17 } 18 19 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_try_module_get') Try to get module. The operation may succeed and return 1, or fail and return 0. */ 20 int ldv_try_module_get(struct module *module) 21 { 22 int module_get_succeeded; 23 24 /* LDV_COMMENT_OTHER Do nothing if the module pointer is NULL */ 25 if (module){ 26 27 /* LDV_COMMENT_OTHER Model success or failure of getting the module. */ 28 module_get_succeeded = ldv_undef_int(); 29 30 if (module_get_succeeded == 1) { 31 /* LDV_COMMENT_CHANGE_STATE Increment module reference counter. */ 32 ldv_module_refcounter++; 33 /* LDV_COMMENT_RETURN Return 1 telling about success. */ 34 return 1; 35 } 36 else 37 { 38 /* LDV_COMMENT_RETURN Return 0 telling that module get has failed.. */ 39 return 0; 40 } 41 } 42 } 43 44 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_module_put') Put module (unless module pointer is zero). Check if the module reference counter was greater than zero. */ 45 void ldv_module_put(struct module *module) 46 { 47 /* LDV_COMMENT_OTHER Do nothing if the module pointer is NULL */ 48 if (module){ 49 /* LDV_COMMENT_ASSERT This assertion fails if the module was put more times than it was got */ 50 ldv_assert(ldv_module_refcounter > 1); 51 /* LDV_COMMENT_CHANGE_STATE Decrease reference counter thus putting the module. */ 52 ldv_module_refcounter--; 53 } 54 } 55 56 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_module_put_and_exit') Put the module and stop execution. */ 57 void ldv_module_put_and_exit(void) 58 { 59 ldv_module_put((struct module*)1); 60 /* LDV_COMMENT_OTHER Stop execution. */ 61 LDV_STOP: goto LDV_STOP; 62 } 63 64 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_module_refcount') Get the reference counter of the module. */ 65 unsigned int ldv_module_refcount(void) 66 { 67 /* LDV_COMMENT_RETURN Return reference counter */ 68 return ldv_module_refcounter - 1; 69 } 70 71 /* LDV_COMMENT_MODEL_FUNCTION_DEFINITION(name='ldv_check_final_state') At the end of execution, module reference counter must be the same as at the beginning. */ 72 void ldv_check_final_state(void) 73 { 74 /* LDV_COMMENT_ASSERT If this assertion is violated, then the module was put somewhere duiring the execution, and wasn't got! */ 75 ldv_assert(ldv_module_refcounter == 1); 76 }
1 #ifndef _LDV_RCV_H_ 2 #define _LDV_RCV_H_ 3 4 /* If expr evaluates to zero, ldv_assert() causes a program to reach the error 5 label like the standard assert(). */ 6 #define ldv_assert(expr) ((expr) ? 0 : ldv_error()) 7 8 /* The error label wrapper. It is used because of some static verifiers (like 9 BLAST) don't accept multiple error labels through a program. */ 10 static inline void ldv_error(void) 11 { 12 LDV_ERROR: goto LDV_ERROR; 13 } 14 15 /* If expr evaluates to zero, ldv_assume() causes an infinite loop that is 16 avoided by verifiers. */ 17 #define ldv_assume(expr) ((expr) ? 0 : ldv_stop()) 18 19 /* Infinite loop, that causes verifiers to skip such paths. */ 20 static inline void ldv_stop(void) { 21 LDV_STOP: goto LDV_STOP; 22 } 23 24 /* Special nondeterministic functions. */ 25 int ldv_undef_int(void); 26 void *ldv_undef_ptr(void); 27 unsigned long ldv_undef_ulong(void); 28 long ldv_undef_long(void); 29 /* Return nondeterministic negative integer number. */ 30 static inline int ldv_undef_int_negative(void) 31 { 32 int ret = ldv_undef_int(); 33 34 ldv_assume(ret < 0); 35 36 return ret; 37 } 38 /* Return nondeterministic nonpositive integer number. */ 39 static inline int ldv_undef_int_nonpositive(void) 40 { 41 int ret = ldv_undef_int(); 42 43 ldv_assume(ret <= 0); 44 45 return ret; 46 } 47 48 /* Add explicit model for __builin_expect GCC function. Without the model a 49 return value will be treated as nondetermined by verifiers. */ 50 static inline long __builtin_expect(long exp, long c) 51 { 52 return exp; 53 } 54 55 /* This function causes the program to exit abnormally. GCC implements this 56 function by using a target-dependent mechanism (such as intentionally executing 57 an illegal instruction) or by calling abort. The mechanism used may vary from 58 release to release so you should not rely on any particular implementation. 59 http://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html */ 60 static inline void __builtin_trap(void) 61 { 62 ldv_assert(0); 63 } 64 65 /* The constant is for simulating an error of ldv_undef_ptr() function. */ 66 #define LDV_PTR_MAX 2012 67 68 #endif /* _LDV_RCV_H_ */

Here is an explanation of a rule violation arisen while checking your driver against a corresponding kernel.

Note that it may be false positive, i.e. there isn't a real error indeed. Please analyze a given error trace and related source code to understand whether there is an error in your driver.

Error trace column contains a path on which the given rule is violated. You can expand/collapse some entity classes by clicking on corresponding checkboxes in a main menu or in an advanced Others menu. Also you can expand/collapse each particular entity by clicking on +/-. In hovering on some entities you can see some tips. Also the error trace is bound with related source code. Line numbers may be shown as links on the left. You can click on them to open corresponding lines in source code.

Source code column contains a content of files related with the error trace. There is source code of your driver (note that there are some LDV modifications at the end), kernel headers and rule model. Tabs show a currently opened file and other available files. In hovering on them you can see full file names. On clicking a corresponding file content will be shown.

Ядро Модуль Правило Верификатор Вердикт Статус Время создания Описание проблемы
linux-4.7-rc1.tar.xz drivers/media/pci/bt8xx/dst_ca.ko 08_1a CPAchecker Bug Fixed 2016-08-19 01:48:51 L0236

Комментарий

Reported: 9 Apr 2016

[В начало]